diff --git a/.gitignore b/.gitignore index e869cd90..5d32b237 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ **/*.log **/node_modules .coverage +coverage .nyc_output docs/ out/ @@ -9,6 +10,5 @@ system-test/secrets.js system-test/*key.json *.lock .DS_Store -__pycache__ -.vscode package-lock.json +__pycache__ diff --git a/.jsdoc.js b/.jsdoc.js index 4cf9a1d7..20014ff5 100644 --- a/.jsdoc.js +++ b/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -31,18 +34,19 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'src' + 'build/src', + 'protos' ], includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/compute', theme: 'lumen', default: { - "outputSourceFiles": false + outputSourceFiles: false } }, markdown: { diff --git a/.mocharc.js b/.mocharc.js index 5698d781..0b600509 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -14,9 +14,8 @@ const config = { "enable-source-maps": true, "throw-deprecation": true, - // There seems to be a regression such that overrides are not being - // supported by mocha: - "timeout": 1200000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/.repo-metadata.json b/.repo-metadata.json index e6658bc4..53d5c0b7 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -10,5 +10,6 @@ "distribution_name": "@google-cloud/compute", "api_id": "compute.googleapis.com", "requires_billing": true, + "library_type": "GAPIC_AUTO", "codeowner_team": "@googleapis/api-compute" } diff --git a/README.md b/README.md index a71c979b..538a4042 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [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) @@ -55,36 +55,6 @@ npm install @google-cloud/compute ``` -### Using the client library - -```javascript -// Imports the Google Cloud client library -const Compute = require('@google-cloud/compute'); - -// Creates a client -const compute = new Compute(); - -async function quickstart() { - // Create a new VM using the latest OS image of your choice. - const zone = compute.zone('us-central1-c'); - - // TODO(developer): choose a name for the VM - // const vmName = 'vm-name'; - - // Start the VM create task - const [vm, operation] = await zone.createVM(vmName, {os: 'ubuntu'}); - console.log(vm); - - // `operation` lets you check the status of long-running tasks. - await operation.promise(); - - // Complete! - console.log('Virtual machine created!'); -} -quickstart(); - -``` - ## Samples @@ -93,14 +63,18 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-compute/tre | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Create VM | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/createVM.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/createVM.js,samples/README.md) | -| Delete VM | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/deleteVM.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/deleteVM.js,samples/README.md) | -| List VMs | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listVMs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listVMs.js,samples/README.md) | +| Create Instance | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/createInstance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/createInstance.js,samples/README.md) | +| Delete Instance | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/deleteInstance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/deleteInstance.js,samples/README.md) | +| Disable Usage Export | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/disableUsageExport.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/disableUsageExport.js,samples/README.md) | +| Get Usage Export Bucket | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/getUsageExportBucket.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/getUsageExportBucket.js,samples/README.md) | +| List All Instances | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listAllInstances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listAllInstances.js,samples/README.md) | +| List Images | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listImages.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listImages.js,samples/README.md) | +| List Images By Page | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listImagesByPage.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listImagesByPage.js,samples/README.md) | +| List Instances | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listInstances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listInstances.js,samples/README.md) | | Mailjet | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/mailjet.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/mailjet.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | | Sendgrid | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/sendgrid.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/sendgrid.js,samples/README.md) | -| Startup Script | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/startupScript.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/startupScript.js,samples/README.md) | -| Vms | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/vms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/vms.js,samples/README.md) | +| Set Usage Export Bucket | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/setUsageExportBucket.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/setUsageExportBucket.js,samples/README.md) | +| Wait For Operation | [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/waitForOperation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/waitForOperation.js,samples/README.md) | diff --git a/package.json b/package.json index 9f0c7755..9c021c06 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,19 @@ { "name": "@google-cloud/compute", "description": "Google Compute Engine Client Library for Node.js", - "version": "2.6.0", + "version": "3.0.0-alpha.3", "license": "Apache-2.0", "author": "Google Inc.", "engines": { "node": ">=10" }, "repository": "googleapis/nodejs-compute", - "main": "./src/index.js", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", "files": [ - "src" + "build/src", + "build/protos" ], "keywords": [ "google apis client", @@ -21,46 +24,123 @@ "google cloud platform", "google cloud", "cloud", - "google compute engine", - "compute engine" + "google compute", + "compute", + "accelerator types", + "addresses", + "autoscalers", + "backend buckets", + "backend services", + "disks", + "disk types", + "external vpn gateways", + "firewalls", + "forwarding rules", + "global addresses", + "global forwarding rules", + "global network endpoint groups", + "global operations", + "global organization operations", + "health checks", + "images", + "instance group managers", + "instance groups", + "instances", + "instance templates", + "interconnect attachments", + "interconnect locations", + "interconnects", + "license codes", + "licenses", + "machine types", + "network endpoint groups", + "networks", + "node groups", + "node templates", + "node types", + "packet mirrorings", + "projects", + "region autoscalers", + "region backend services", + "region commitments", + "region disks", + "region disk types", + "region health checks", + "region health check services", + "region instance group managers", + "region instance groups", + "region network endpoint groups", + "region notification endpoints", + "region operations", + "regions", + "region ssl certificates", + "region target http proxies", + "region target https proxies", + "region url maps", + "reservations", + "resource policies", + "routers", + "routes", + "security policies", + "snapshots", + "ssl certificates", + "ssl policies", + "subnetworks", + "target grpc proxies", + "target http proxies", + "target https proxies", + "target instances", + "target pools", + "target ssl proxies", + "target tcp proxies", + "target vpn gateways", + "url maps", + "vpn gateways", + "vpn tunnels", + "zone operations", + "zones" ], "scripts": { - "docs": "jsdoc -c .jsdoc.js", + "test": "c8 node build/test/run.js", + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "system-test": "mocha build/system-test system-test/*.js", "lint": "gts check", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "system-test": "mocha system-test/*.js --timeout 1200000", - "test": "c8 mocha", "fix": "gts fix", + "docs": "jsdoc -c .jsdoc.js", "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-protos && npm run compile", "prelint": "cd samples; npm link ../; npm install", - "clean": "gts clean", "precompile": "gts clean" }, "dependencies": { - "@google-cloud/common": "^3.0.0", - "@google-cloud/paginator": "^3.0.0", - "@google-cloud/projectify": "^2.0.0", - "@google-cloud/promisify": "^2.0.0", - "arrify": "^2.0.0", - "async": "^3.0.0", - "extend": "^3.0.2", - "gce-images": "^3.0.0", - "is": "^3.2.1", - "string-format-obj": "^1.1.1" + "google-gax": "^2.13.0" }, "devDependencies": { - "c8": "^7.0.0", - "codecov": "^3.0.2", - "concat-stream": "^2.0.0", - "gts": "^2.0.2", - "jsdoc": "^3.6.2", - "jsdoc-fresh": "^1.0.1", - "jsdoc-region-tag": "^1.0.2", - "linkinator": "^2.0.0", - "mocha": "^8.0.0", - "proxyquire": "^2.0.1", - "typescript": "^3.8.3", - "uuid": "^8.0.0" + "@types/mocha": "^8.2.0", + "@types/node": "^14.14.13", + "@types/sinon": "^9.0.9", + "c8": "^7.3.5", + "chai": "^4.3.4", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.6", + "linkinator": "^2.8.0", + "mocha": "^8.2.1", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^9.2.2", + "ts-loader": "^8.0.12", + "typescript": "^4.1.3", + "uuid": "^8.0.0", + "webpack": "^5.10.1", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=10" } } diff --git a/protos/google/cloud/compute/v1/compute.proto b/protos/google/cloud/compute/v1/compute.proto new file mode 100644 index 00000000..f4ac04a4 --- /dev/null +++ b/protos/google/cloud/compute/v1/compute.proto @@ -0,0 +1,32754 @@ +// 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. + +// Generated by the disco-to-proto3-converter. DO NOT EDIT! +// Source Discovery file: compute.v1.json +// Source file revision: 20210415 +// API name: compute +// API version: v1 + +syntax = "proto3"; + +package google.cloud.compute.v1; + +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.Compute.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/compute/v1;compute"; +option java_multiple_files = true; +option java_package = "com.google.cloud.compute.v1"; +option php_namespace = "Google\\Cloud\\Compute\\V1"; +option ruby_package = "Google::Cloud::Compute::V1"; + +// +// File level resource definitions +// + +// [Empty] + +// +// Messages +// +// A specification of the type and number of accelerator cards attached to the instance. +message AcceleratorConfig { + // The number of the guest accelerator cards exposed to this instance. + optional int32 accelerator_count = 504879675; + + // Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types. + optional string accelerator_type = 138031246; + +} + +// Deprecation status for a public resource. +message DeprecationStatus { + // The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + ACTIVE = 314733318; + + DELETED = 120962041; + + DEPRECATED = 463360435; + + OBSOLETE = 66532761; + + } + + // An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + optional string deleted = 476721177; + + // An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + optional string deprecated = 515138995; + + // An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + optional string obsolete = 357647769; + + // The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + optional string replacement = 430919186; + + // The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + optional State state = 109757585; + +} + +// Represents an Accelerator Type resource. +// +// Google Cloud Platform provides graphics processing units (accelerators) that you can add to VM instances to improve or accelerate performance when working with intensive workloads. For more information, read GPUs on Compute Engine. (== resource_for {$api_version}.acceleratorTypes ==) +message AcceleratorType { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] The deprecation status associated with this accelerator type. + optional DeprecationStatus deprecated = 515138995; + + // [Output Only] An optional textual description of the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] The type of the resource. Always compute#acceleratorType for accelerator types. + optional string kind = 3292052; + + // [Output Only] Maximum number of accelerator cards allowed per instance. + optional int32 maximum_cards_per_instance = 263814482; + + // [Output Only] Name of the resource. + optional string name = 3373707; + + // [Output Only] Server-defined, fully qualified URL for this resource. + optional string self_link = 456214797; + + // [Output Only] The name of the zone where the accelerator type resides, such as us-central1-a. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string zone = 3744684; + +} + +// +message AcceleratorTypesScopedList { + // [Output Only] A list of accelerator types contained in this scope. + repeated AcceleratorType accelerator_types = 520872357; + + // [Output Only] An informational warning that appears when the accelerator types list is empty. + optional Warning warning = 50704284; + +} + +// +message Data { + // [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding). + optional string key = 106079; + + // [Output Only] A warning data value corresponding to the key. + optional string value = 111972721; + +} + +// [Output Only] Informational warning message. +message Warning { + // [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + enum Code { + // A value indicating that the enum field is not set. + UNDEFINED_CODE = 0; + + CLEANUP_FAILED = 150308440; + + DEPRECATED_RESOURCE_USED = 391835586; + + DEPRECATED_TYPE_USED = 346526230; + + DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + + EXPERIMENTAL_TYPE_USED = 451954443; + + EXTERNAL_API_WARNING = 175546307; + + FIELD_VALUE_OVERRIDEN = 329669423; + + INJECTED_KERNELS_DEPRECATED = 417377419; + + LARGE_DEPLOYMENT_WARNING = 481440678; + + MISSING_TYPE_DEPENDENCY = 344505463; + + NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + + NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + + NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + + NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + + NEXT_HOP_NOT_RUNNING = 417081265; + + NOT_CRITICAL_ERROR = 105763924; + + NO_RESULTS_ON_PAGE = 30036744; + + PARTIAL_SUCCESS = 39966469; + + REQUIRED_TOS_AGREEMENT = 3745539; + + RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + + RESOURCE_NOT_DELETED = 168598460; + + SCHEMA_VALIDATION_IGNORED = 275245642; + + SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + + UNDECLARED_PROPERTIES = 390513439; + + UNREACHABLE = 13328052; + + } + + // [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + optional Code code = 3059181; + + // [Output Only] Metadata about this warning in key: value format. For example: + // "data": [ { "key": "scope", "value": "zones/us-east1-d" } + repeated Data data = 3076010; + + // [Output Only] A human-readable description of the warning code. + optional string message = 418054151; + +} + +// +message AcceleratorTypeAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of AcceleratorTypesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#acceleratorTypeAggregatedList for aggregated lists of accelerator types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of accelerator types. +message AcceleratorTypeList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of AcceleratorType resources. + repeated AcceleratorType items = 100526016; + + // [Output Only] Type of resource. Always compute#acceleratorTypeList for lists of accelerator types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// An access configuration attached to an instance's network interface. Only one access config per instance is supported. +message AccessConfig { + // This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. + // + // If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. + // + // If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. + enum NetworkTier { + // A value indicating that the enum field is not set. + UNDEFINED_NETWORK_TIER = 0; + + PREMIUM = 399530551; + + STANDARD = 484642493; + + } + + // The type of configuration. The default and only option is ONE_TO_ONE_NAT. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + ONE_TO_ONE_NAT = 84090205; + + } + + // [Output Only] Type of the resource. Always compute#accessConfig for access configs. + optional string kind = 3292052; + + // The name of this access configuration. The default and recommended name is External NAT, but you can use any arbitrary string, such as My external IP or Network Access. + optional string name = 3373707; + + // An external IP address associated with this instance. Specify an unused static external IP address available to the project or leave this field undefined to use an IP from a shared ephemeral IP address pool. If you specify a static external IP address, it must live in the same region as the zone of the instance. + optional string nat_i_p = 117634556; + + // This signifies the networking tier used for configuring this access configuration and can only take the following values: PREMIUM, STANDARD. + // + // If an AccessConfig is specified without a valid external IP address, an ephemeral IP will be created with this networkTier. + // + // If an AccessConfig with a valid external IP address is specified, it must match that of the networkTier associated with the Address resource owning that IP. + optional NetworkTier network_tier = 517397843; + + // The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled. + optional string public_ptr_domain_name = 316599167; + + // Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. + optional bool set_public_ptr = 523870229; + + // The type of configuration. The default and only option is ONE_TO_ONE_NAT. + optional Type type = 3575610; + +} + +// Use global external addresses for GFE-based external HTTP(S) load balancers in Premium Tier. +// +// Use global internal addresses for reserved peering network range. +// +// Use regional external addresses for the following resources: +// +// - External IP addresses for VM instances - Regional external forwarding rules - Cloud NAT external IP addresses - GFE based LBs in Standard Tier - Network LBs in Premium or Standard Tier - Cloud VPN gateways (both Classic and HA) +// +// Use regional internal IP addresses for subnet IP ranges (primary and secondary). This includes: +// +// - Internal IP addresses for VM instances - Alias IP ranges of VM instances (/32 only) - Regional internal forwarding rules - Internal TCP/UDP load balancer addresses - Internal HTTP(S) load balancer addresses - Cloud DNS inbound forwarding IP addresses +// +// For more information, read reserved IP address. +// +// (== resource_for {$api_version}.addresses ==) (== resource_for {$api_version}.globalAddresses ==) +message Address { + // The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. + enum AddressType { + // A value indicating that the enum field is not set. + UNDEFINED_ADDRESS_TYPE = 0; + + EXTERNAL = 35607499; + + INTERNAL = 279295677; + + UNSPECIFIED_TYPE = 53933922; + + } + + // The IP version that will be used by this address. Valid options are IPV4 or IPV6. This can only be specified for a global address. + enum IpVersion { + // A value indicating that the enum field is not set. + UNDEFINED_IP_VERSION = 0; + + IPV4 = 2254341; + + IPV6 = 2254343; + + UNSPECIFIED_VERSION = 21850000; + + } + + // This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Global forwarding rules can only be Premium Tier. Regional forwarding rules can be either Premium or Standard Tier. Standard Tier addresses applied to regional forwarding rules can be used with any external load balancer. Regional forwarding rules in Premium Tier can only be used with a network load balancer. + // + // If this field is not specified, it is assumed to be PREMIUM. + enum NetworkTier { + // A value indicating that the enum field is not set. + UNDEFINED_NETWORK_TIER = 0; + + PREMIUM = 399530551; + + STANDARD = 484642493; + + } + + // The purpose of this resource, which can be one of the following values: + // - `GCE_ENDPOINT` for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources. + // - `DNS_RESOLVER` for a DNS resolver address in a subnetwork + // - `VPC_PEERING` for addresses that are reserved for VPC peer networks. + // - `NAT_AUTO` for addresses that are external IP addresses automatically reserved for Cloud NAT. + // - `IPSEC_INTERCONNECT` for addresses created from a private IP range that are reserved for a VLAN attachment in an IPsec-encrypted Cloud Interconnect configuration. These addresses are regional resources. + enum Purpose { + // A value indicating that the enum field is not set. + UNDEFINED_PURPOSE = 0; + + DNS_RESOLVER = 476114556; + + GCE_ENDPOINT = 230515243; + + IPSEC_INTERCONNECT = 340437251; + + NAT_AUTO = 163666477; + + PRIVATE_SERVICE_CONNECT = 48134724; + + SHARED_LOADBALANCER_VIP = 294447572; + + VPC_PEERING = 400800170; + + } + + // [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + IN_USE = 17393485; + + RESERVED = 432241448; + + RESERVING = 514587225; + + } + + // The static IP address represented by this resource. + optional string address = 462920692; + + // The type of address to reserve, either INTERNAL or EXTERNAL. If unspecified, defaults to EXTERNAL. + optional AddressType address_type = 264307877; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this field when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // The IP version that will be used by this address. Valid options are IPV4 or IPV6. This can only be specified for a global address. + optional IpVersion ip_version = 294959552; + + // [Output Only] Type of the resource. Always compute#address for addresses. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + optional string name = 3373707; + + // The URL of the network in which to reserve the address. This field can only be used with INTERNAL type with the VPC_PEERING purpose. + optional string network = 232872494; + + // This signifies the networking tier used for configuring this address and can only take the following values: PREMIUM or STANDARD. Global forwarding rules can only be Premium Tier. Regional forwarding rules can be either Premium or Standard Tier. Standard Tier addresses applied to regional forwarding rules can be used with any external load balancer. Regional forwarding rules in Premium Tier can only be used with a network load balancer. + // + // If this field is not specified, it is assumed to be PREMIUM. + optional NetworkTier network_tier = 517397843; + + // The prefix length if the resource represents an IP range. + optional int32 prefix_length = 453565747; + + // The purpose of this resource, which can be one of the following values: + // - `GCE_ENDPOINT` for addresses that are used by VM instances, alias IP ranges, internal load balancers, and similar resources. + // - `DNS_RESOLVER` for a DNS resolver address in a subnetwork + // - `VPC_PEERING` for addresses that are reserved for VPC peer networks. + // - `NAT_AUTO` for addresses that are external IP addresses automatically reserved for Cloud NAT. + // - `IPSEC_INTERCONNECT` for addresses created from a private IP range that are reserved for a VLAN attachment in an IPsec-encrypted Cloud Interconnect configuration. These addresses are regional resources. + optional Purpose purpose = 316407070; + + // [Output Only] The URL of the region where a regional address resides. For regional addresses, you must specify the region as a path parameter in the HTTP request URL. This field is not applicable to global addresses. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available. + optional Status status = 181260274; + + // The URL of the subnetwork in which to reserve the address. If an IP address is specified, it must be within the subnetwork's IP range. This field can only be used with INTERNAL type with a GCE_ENDPOINT or DNS_RESOLVER purpose. + optional string subnetwork = 307827694; + + // [Output Only] The URLs of the resources that are using this address. + repeated string users = 111578632; + +} + +// +message AddressesScopedList { + // [Output Only] A list of addresses contained in this scope. + repeated Address addresses = 337673122; + + // [Output Only] Informational warning which replaces the list of addresses when the list is empty. + optional Warning warning = 50704284; + +} + +// +message AddressAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of AddressesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#addressAggregatedList for aggregated lists of addresses. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of addresses. +message AddressList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Address resources. + repeated Address items = 100526016; + + // [Output Only] Type of resource. Always compute#addressList for lists of addresses. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Specifies options for controlling advanced machine features. Options that would traditionally be configured in a BIOS belong here. Features that require operating system support may have corresponding entries in the GuestOsFeatures of an Image (e.g., whether or not the OS in the Image supports nested virtualization being enabled or disabled). +message AdvancedMachineFeatures { + // Whether to enable nested virtualization or not (default is false). + optional bool enable_nested_virtualization = 16639365; + + // The number of threads per physical core. To disable simultaneous multithreading (SMT) set this to 1. If unset, the maximum number of threads supported per core by the underlying processor is assumed. + optional int32 threads_per_core = 352611671; + +} + +// An alias IP range attached to an instance's network interface. +message AliasIpRange { + // The IP alias ranges to allocate for this interface. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. This range may be a single IP address (such as 10.2.3.4), a netmask (such as /24) or a CIDR-formatted string (such as 10.1.2.0/24). + optional string ip_cidr_range = 98117322; + + // The name of a subnetwork secondary IP range from which to allocate an IP alias range. If not specified, the primary range of the subnetwork is used. + optional string subnetwork_range_name = 387995966; + +} + +// +message AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { + // Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + enum Interface { + // A value indicating that the enum field is not set. + UNDEFINED_INTERFACE = 0; + + NVME = 2408800; + + SCSI = 2539686; + + } + + // Specifies the size of the disk in base-2 GB. + optional int64 disk_size_gb = 316263735; + + // Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + optional Interface interface = 502623545; + +} + +// Properties of the SKU instances being reserved. Next ID: 9 +message AllocationSpecificSKUAllocationReservedInstanceProperties { + // Specifies accelerator type and count. + repeated AcceleratorConfig guest_accelerators = 463595119; + + // Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd. + repeated AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk local_ssds = 229951299; + + // An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API. + optional string location_hint = 350519505; + + // Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern. + optional string machine_type = 227711026; + + // Minimum cpu platform the reservation. + optional string min_cpu_platform = 242912759; + +} + +// This reservation type allows to pre allocate specific instance configuration. +message AllocationSpecificSKUReservation { + // Specifies the number of resources that are allocated. + optional int64 count = 94851343; + + // [Output Only] Indicates how many instances are in use. + optional int64 in_use_count = 493458877; + + // The instance properties for the reservation. + optional AllocationSpecificSKUAllocationReservedInstanceProperties instance_properties = 215355165; + +} + +// +message CustomerEncryptionKey { + // The name of the encryption key that is stored in Google Cloud KMS. + optional string kms_key_name = 484373913; + + // The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used. + optional string kms_key_service_account = 209986261; + + // Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. + optional string raw_key = 449196488; + + // [Output only] The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. + optional string sha256 = 170112551; + +} + +// Guest OS features. +message GuestOsFeature { + // The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + FEATURE_TYPE_UNSPECIFIED = 531767259; + + GVNIC = 68209305; + + MULTI_IP_SUBNET = 151776719; + + SECURE_BOOT = 376811194; + + SEV_CAPABLE = 87083793; + + UEFI_COMPATIBLE = 195865408; + + VIRTIO_SCSI_MULTIQUEUE = 201597069; + + WINDOWS = 456863331; + + } + + // The ID of a supported feature. Read Enabling guest operating system features to see a list of available options. + optional Type type = 3575610; + +} + +// [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. +// +// This property is mutually exclusive with the source property; you can only define one or the other, but not both. +message AttachedDiskInitializeParams { + // Specifies which action to take on instance update with this disk. Default is to use the existing disk. + enum OnUpdateAction { + // A value indicating that the enum field is not set. + UNDEFINED_ON_UPDATE_ACTION = 0; + + RECREATE_DISK = 494767853; + + RECREATE_DISK_IF_SOURCE_CHANGED = 398099712; + + USE_EXISTING_DISK = 232682233; + + } + + // An optional description. Provide this property when creating the disk. + optional string description = 422937596; + + // Specifies the disk name. If not specified, the default is to use the name of the instance. If a disk with the same name already exists in the given region, the existing disk is attached to the new instance and the new disk is not created. + optional string disk_name = 92807149; + + // Specifies the size of the disk in base-2 GB. The size must be at least 10 GB. If you specify a sourceImage, which is required for boot disks, the default size is the size of the sourceImage. If you do not specify a sourceImage, the default disk size is 500 GB. + optional int64 disk_size_gb = 316263735; + + // Specifies the disk type to use to create the instance. If not specified, the default is pd-standard, specified using the full URL. For example: + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard + // + // + // Other values include pd-ssd and local-ssd. If you define this field, you can provide either the full or partial URL. For example, the following are valid values: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + // - projects/project/zones/zone/diskTypes/diskType + // - zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the name of the disk type, not URL. + optional string disk_type = 93009052; + + // Labels to apply to this disk. These can be later modified by the disks.setLabels method. This field is only applicable for persistent disks. + map labels = 500195327; + + // Specifies which action to take on instance update with this disk. Default is to use the existing disk. + optional OnUpdateAction on_update_action = 202451980; + + // Indicates how many IOPS must be provisioned for the disk. + optional int64 provisioned_iops = 186769108; + + // Resource policies applied to this disk for automatic snapshot creations. Specified using the full or partial URL. For instance template, specify only the resource policy name. + repeated string resource_policies = 22220385; + + // The source image to create this disk. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. + // + // To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: + // projects/debian-cloud/global/images/family/debian-9 + // + // + // Alternatively, use a specific version of a public operating system image: + // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD + // + // + // To create a disk with a custom image that you created, specify the image name in the following format: + // global/images/my-custom-image + // + // + // You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: + // global/images/family/my-image-family + // + // + // If the source image is deleted later, this field will not be set. + optional string source_image = 50443319; + + // The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + // + // Instance templates do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. + optional CustomerEncryptionKey source_image_encryption_key = 381503659; + + // The source snapshot to create this disk. When creating a new instance, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required except for local SSD. + // + // To create a disk with a snapshot that you created, specify the snapshot name in the following format: + // global/snapshots/my-backup + // + // + // If the source snapshot is deleted later, this field will not be set. + optional string source_snapshot = 126061928; + + // The customer-supplied encryption key of the source snapshot. + optional CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + +} + +// Initial State for shielded instance, these are public keys which are safe to store in public +message InitialStateConfig { + // The Key Database (db). + repeated FileContentBuffer dbs = 99253; + + // The forbidden key database (dbx). + repeated FileContentBuffer dbxs = 3077113; + + // The Key Exchange Key (KEK). + repeated FileContentBuffer keks = 3288130; + + // The Platform Key (PK). + optional FileContentBuffer pk = 3579; + +} + +// An instance-attached disk resource. +message AttachedDisk { + // Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + enum Interface { + // A value indicating that the enum field is not set. + UNDEFINED_INTERFACE = 0; + + NVME = 2408800; + + SCSI = 2539686; + + } + + // The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + enum Mode { + // A value indicating that the enum field is not set. + UNDEFINED_MODE = 0; + + READ_ONLY = 91950261; + + READ_WRITE = 173607894; + + } + + // Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + PERSISTENT = 460683927; + + SCRATCH = 496778970; + + } + + // Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + optional bool auto_delete = 464761403; + + // Indicates that this is a boot disk. The virtual machine will use the first partition of the disk for its root filesystem. + optional bool boot = 3029746; + + // Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance. + // + // If not specified, the server chooses a default device name to apply to this disk, in the form persistent-disk-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks. + optional string device_name = 67541716; + + // Encrypts or decrypts a disk using a customer-supplied encryption key. + // + // If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key. + // + // If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance. + // + // If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. + // + // Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. + optional CustomerEncryptionKey disk_encryption_key = 271660677; + + // The size of the disk in GB. + optional int64 disk_size_gb = 316263735; + + // A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + repeated GuestOsFeature guest_os_features = 79294545; + + // [Output Only] A zero-based index to this disk, where 0 is reserved for the boot disk. If you have many disks attached to an instance, each disk would have a unique index number. + optional int32 index = 100346066; + + // [Input Only] Specifies the parameters for a new disk that will be created alongside the new instance. Use initialization parameters to create boot disks or local SSDs attached to the new instance. + // + // This property is mutually exclusive with the source property; you can only define one or the other, but not both. + optional AttachedDiskInitializeParams initialize_params = 17697045; + + // Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI and the request will fail if you attempt to attach a persistent disk in any other format than SCSI. Local SSDs can use either NVME or SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance. + optional Interface interface = 502623545; + + // [Output Only] Type of the resource. Always compute#attachedDisk for attached disks. + optional string kind = 3292052; + + // [Output Only] Any valid publicly visible licenses. + repeated string licenses = 337642578; + + // The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + optional Mode mode = 3357091; + + // [Output Only] shielded vm initial state stored on disk + optional InitialStateConfig shielded_instance_initial_state = 192356867; + + // Specifies a valid partial or full URL to an existing Persistent Disk resource. When creating a new instance, one of initializeParams.sourceImage or initializeParams.sourceSnapshot or disks.source is required except for local SSD. + // + // If desired, you can also attach existing non-root persistent disks using this property. This field is only applicable for persistent disks. + // + // Note that for InstanceTemplate, specify the disk name, not the URL for the disk. + optional string source = 177235995; + + // Specifies the type of the disk, either SCRATCH or PERSISTENT. If not specified, the default is PERSISTENT. + optional Type type = 3575610; + +} + +// Provides the configuration for logging a type of permissions. Example: +// +// { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } +// +// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging. +message AuditLogConfig { + // The log type that this config enables. + enum LogType { + // A value indicating that the enum field is not set. + UNDEFINED_LOG_TYPE = 0; + + ADMIN_READ = 128951462; + + DATA_READ = 305224971; + + DATA_WRITE = 340181738; + + LOG_TYPE_UNSPECIFIED = 154527053; + + } + + // Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. + repeated string exempted_members = 232615576; + + optional bool ignore_child_exemptions = 70141850; + + // The log type that this config enables. + optional LogType log_type = 403115861; + +} + +// Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. +// +// If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. +// +// Example Policy with multiple AuditConfigs: +// +// { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } +// +// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging. +message AuditConfig { + // The configuration for logging of each type of permission. + repeated AuditLogConfig audit_log_configs = 488420626; + + repeated string exempted_members = 232615576; + + // Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + optional string service = 373540533; + +} + +// Authorization-related information used by Cloud Audit Logging. +message AuthorizationLoggingOptions { + // The type of the permission that was checked. + enum PermissionType { + // A value indicating that the enum field is not set. + UNDEFINED_PERMISSION_TYPE = 0; + + ADMIN_READ = 128951462; + + ADMIN_WRITE = 244412079; + + DATA_READ = 305224971; + + DATA_WRITE = 340181738; + + PERMISSION_TYPE_UNSPECIFIED = 440313346; + + } + + // The type of the permission that was checked. + optional PermissionType permission_type = 525978538; + +} + +// Cloud Autoscaler policy. +message AutoscalingPolicy { + // Defines operating mode for this policy. + enum Mode { + // A value indicating that the enum field is not set. + UNDEFINED_MODE = 0; + + OFF = 78159; + + ON = 2527; + + ONLY_SCALE_OUT = 152713670; + + ONLY_UP = 478095374; + + } + + // The number of seconds that the autoscaler waits before it starts collecting information from a new instance. This prevents the autoscaler from collecting information when the instance is initializing, during which the collected usage would not be reliable. The default time autoscaler waits is 60 seconds. + // + // Virtual machine initialization times might vary because of numerous factors. We recommend that you test how long an instance may take to initialize. To do this, create an instance and time the startup process. + optional int32 cool_down_period_sec = 107692954; + + // Defines the CPU utilization policy that allows the autoscaler to scale based on the average CPU utilization of a managed instance group. + optional AutoscalingPolicyCpuUtilization cpu_utilization = 381211147; + + // Configuration parameters of autoscaling based on a custom metric. + repeated AutoscalingPolicyCustomMetricUtilization custom_metric_utilizations = 131972850; + + // Configuration parameters of autoscaling based on load balancer. + optional AutoscalingPolicyLoadBalancingUtilization load_balancing_utilization = 429746403; + + // The maximum number of instances that the autoscaler can scale out to. This is required when creating or updating an autoscaler. The maximum number of replicas must not be lower than minimal number of replicas. + optional int32 max_num_replicas = 62327375; + + // The minimum number of replicas that the autoscaler can scale in to. This cannot be less than 0. If not provided, autoscaler chooses a default value depending on maximum number of instances allowed. + optional int32 min_num_replicas = 535329825; + + // Defines operating mode for this policy. + optional Mode mode = 3357091; + + optional AutoscalingPolicyScaleInControl scale_in_control = 527670872; + + // Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler, and they can overlap. During overlapping periods the greatest min_required_replicas of all scaling schedules is applied. Up to 128 scaling schedules are allowed. + map scaling_schedules = 355416580; + +} + +// +message ScalingScheduleStatus { + // [Output Only] The current state of a scaling schedule. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + ACTIVE = 314733318; + + DISABLED = 516696700; + + OBSOLETE = 66532761; + + READY = 77848963; + + } + + // [Output Only] The last time the scaling schedule became active. Note: this is a timestamp when a schedule actually became active, not when it was planned to do so. The timestamp is in RFC3339 text format. + optional string last_start_time = 34545107; + + // [Output Only] The next time the scaling schedule is to become active. Note: this is a timestamp when a schedule is planned to run, but the actual time might be slightly different. The timestamp is in RFC3339 text format. + optional string next_start_time = 97270102; + + // [Output Only] The current state of a scaling schedule. + optional State state = 109757585; + +} + +// +message AutoscalerStatusDetails { + // The type of error, warning, or notice returned. Current set of possible values: + // - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state). + // - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group. + // - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas. + // - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling. + // - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels. + // - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. + // - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling. + // - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. + // - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. + // - MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only out" mode. The autoscaler can add instances but not remove any. + // - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it. + // - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances. + // - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region. + // - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist. + // - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. + // - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + ALL_INSTANCES_UNHEALTHY = 404965477; + + BACKEND_SERVICE_DOES_NOT_EXIST = 191417626; + + CAPPED_AT_MAX_NUM_REPLICAS = 518617; + + CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE = 328964659; + + CUSTOM_METRIC_INVALID = 204430550; + + MIN_EQUALS_MAX = 2821361; + + MISSING_CUSTOM_METRIC_DATA_POINTS = 94885086; + + MISSING_LOAD_BALANCING_DATA_POINTS = 509858898; + + MODE_OFF = 164169907; + + MODE_ONLY_SCALE_OUT = 3840994; + + MODE_ONLY_UP = 100969842; + + MORE_THAN_ONE_BACKEND_SERVICE = 151922141; + + NOT_ENOUGH_QUOTA_AVAILABLE = 403101631; + + REGION_RESOURCE_STOCKOUT = 528622846; + + SCALING_TARGET_DOES_NOT_EXIST = 122636699; + + SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX = 29275586; + + SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN = 398287669; + + UNKNOWN = 433141802; + + UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION = 330845009; + + ZONE_RESOURCE_STOCKOUT = 210200502; + + } + + // The status message. + optional string message = 418054151; + + // The type of error, warning, or notice returned. Current set of possible values: + // - ALL_INSTANCES_UNHEALTHY (WARNING): All instances in the instance group are unhealthy (not in RUNNING state). + // - BACKEND_SERVICE_DOES_NOT_EXIST (ERROR): There is no backend service attached to the instance group. + // - CAPPED_AT_MAX_NUM_REPLICAS (WARNING): Autoscaler recommends a size greater than maxNumReplicas. + // - CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE (WARNING): The custom metric samples are not exported often enough to be a credible base for autoscaling. + // - CUSTOM_METRIC_INVALID (ERROR): The custom metric that was specified does not exist or does not have the necessary labels. + // - MIN_EQUALS_MAX (WARNING): The minNumReplicas is equal to maxNumReplicas. This means the autoscaler cannot add or remove instances from the instance group. + // - MISSING_CUSTOM_METRIC_DATA_POINTS (WARNING): The autoscaler did not receive any data from the custom metric configured for autoscaling. + // - MISSING_LOAD_BALANCING_DATA_POINTS (WARNING): The autoscaler is configured to scale based on a load balancing signal but the instance group has not received any requests from the load balancer. + // - MODE_OFF (WARNING): Autoscaling is turned off. The number of instances in the group won't change automatically. The autoscaling configuration is preserved. + // - MODE_ONLY_UP (WARNING): Autoscaling is in the "Autoscale only out" mode. The autoscaler can add instances but not remove any. + // - MORE_THAN_ONE_BACKEND_SERVICE (ERROR): The instance group cannot be autoscaled because it has more than one backend service attached to it. + // - NOT_ENOUGH_QUOTA_AVAILABLE (ERROR): There is insufficient quota for the necessary resources, such as CPU or number of instances. + // - REGION_RESOURCE_STOCKOUT (ERROR): Shown only for regional autoscalers: there is a resource stockout in the chosen region. + // - SCALING_TARGET_DOES_NOT_EXIST (ERROR): The target to be scaled does not exist. + // - UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION (ERROR): Autoscaling does not work with an HTTP/S load balancer that has been configured for maxRate. + // - ZONE_RESOURCE_STOCKOUT (ERROR): For zonal autoscalers: there is a resource stockout in the chosen zone. For regional autoscalers: in at least one of the zones you're using there is a resource stockout. New values might be added in the future. Some of the values might not be available in all API versions. + optional Type type = 3575610; + +} + +// Represents an Autoscaler resource. +// +// Google Compute Engine has two Autoscaler resources: +// +// * [Zonal](/compute/docs/reference/rest/{$api_version}/autoscalers) * [Regional](/compute/docs/reference/rest/{$api_version}/regionAutoscalers) +// +// Use autoscalers to automatically add or delete instances from a managed instance group according to your defined autoscaling policy. For more information, read Autoscaling Groups of Instances. +// +// For zonal managed instance groups resource, use the autoscaler resource. +// +// For regional managed instance groups, use the regionAutoscalers resource. (== resource_for {$api_version}.autoscalers ==) (== resource_for {$api_version}.regionAutoscalers ==) +message Autoscaler { + // [Output Only] The status of the autoscaler configuration. Current set of possible values: + // - PENDING: Autoscaler backend hasn't read new/updated configuration. + // - DELETING: Configuration is being deleted. + // - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. + // - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + ACTIVE = 314733318; + + DELETING = 528602024; + + ERROR = 66247144; + + PENDING = 35394935; + + } + + // The configuration parameters for the autoscaling algorithm. You can define one or more signals for an autoscaler: cpuUtilization, customMetricUtilizations, and loadBalancingUtilization. + // + // If none of these are specified, the default will be to autoscale based on cpuUtilization to 0.6 or 60%. + optional AutoscalingPolicy autoscaling_policy = 221950041; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#autoscaler for autoscalers. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] Target recommended MIG size (number of instances) computed by autoscaler. Autoscaler calculates the recommended MIG size even when the autoscaling policy mode is different from ON. This field is empty when autoscaler is not connected to an existing managed instance group or autoscaler did not generate its prediction. + optional int32 recommended_size = 257915749; + + // [Output Only] URL of the region where the instance group resides (for autoscalers living in regional scope). + optional string region = 138946292; + + // [Output Only] Status information of existing scaling schedules. + map scaling_schedule_status = 465950178; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The status of the autoscaler configuration. Current set of possible values: + // - PENDING: Autoscaler backend hasn't read new/updated configuration. + // - DELETING: Configuration is being deleted. + // - ACTIVE: Configuration is acknowledged to be effective. Some warnings might be present in the statusDetails field. + // - ERROR: Configuration has errors. Actionable for users. Details are present in the statusDetails field. New values might be added in the future. + optional Status status = 181260274; + + // [Output Only] Human-readable details about the current state of the autoscaler. Read the documentation for Commonly returned status messages for examples of status messages you might encounter. + repeated AutoscalerStatusDetails status_details = 363353845; + + // URL of the managed instance group that this autoscaler will scale. This field is required when creating an autoscaler. + optional string target = 192835985; + + // [Output Only] URL of the zone where the instance group resides (for autoscalers living in zonal scope). + optional string zone = 3744684; + +} + +// +message AutoscalersScopedList { + // [Output Only] A list of autoscalers contained in this scope. + repeated Autoscaler autoscalers = 465771644; + + // [Output Only] Informational warning which replaces the list of autoscalers when the list is empty. + optional Warning warning = 50704284; + +} + +// +message AutoscalerAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of AutoscalersScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#autoscalerAggregatedList for aggregated lists of autoscalers. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of Autoscaler resources. +message AutoscalerList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Autoscaler resources. + repeated Autoscaler items = 100526016; + + // [Output Only] Type of resource. Always compute#autoscalerList for lists of autoscalers. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// CPU utilization policy. +message AutoscalingPolicyCpuUtilization { + // Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + // + // * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. + enum PredictiveMethod { + // A value indicating that the enum field is not set. + UNDEFINED_PREDICTIVE_METHOD = 0; + + NONE = 2402104; + + OPTIMIZE_AVAILABILITY = 11629437; + + } + + // Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + // + // * NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. * OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. + optional PredictiveMethod predictive_method = 390220737; + + // The target CPU utilization that the autoscaler maintains. Must be a float value in the range (0, 1]. If not specified, the default is 0.6. + // + // If the CPU level is below the target utilization, the autoscaler scales in the number of instances until it reaches the minimum number of instances you specified or until the average CPU of your instances reaches the target utilization. + // + // If the average CPU is above the target utilization, the autoscaler scales out until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization. + optional double utilization_target = 215905870; + +} + +// Custom utilization metric policy. +message AutoscalingPolicyCustomMetricUtilization { + // Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + enum UtilizationTargetType { + // A value indicating that the enum field is not set. + UNDEFINED_UTILIZATION_TARGET_TYPE = 0; + + DELTA_PER_MINUTE = 87432861; + + DELTA_PER_SECOND = 255180029; + + GAUGE = 67590361; + + } + + // A filter string, compatible with a Stackdriver Monitoring filter string for TimeSeries.list API call. This filter is used to select a specific TimeSeries for the purpose of autoscaling and to determine whether the metric is exporting per-instance or per-group data. + // + // For the filter to be valid for autoscaling purposes, the following rules apply: + // - You can only use the AND operator for joining selectors. + // - You can only use direct equality comparison operator (=) without any functions for each selector. + // - You can specify the metric in both the filter string and in the metric field. However, if specified in both places, the metric must be identical. + // - The monitored resource type determines what kind of values are expected for the metric. If it is a gce_instance, the autoscaler expects the metric to include a separate TimeSeries for each instance in a group. In such a case, you cannot filter on resource labels. + // If the resource type is any other value, the autoscaler expects this metric to contain values that apply to the entire autoscaled instance group and resource label filtering can be performed to point autoscaler at the correct TimeSeries to scale upon. This is called a per-group metric for the purpose of autoscaling. + // + // If not specified, the type defaults to gce_instance. + // + // Try to provide a filter that is selective enough to pick just one TimeSeries for the autoscaled group or for each of the instances (if you are using gce_instance resource type). If multiple TimeSeries are returned upon the query execution, the autoscaler will sum their respective values to obtain its scaling value. + optional string filter = 336120696; + + // The identifier (type) of the Stackdriver Monitoring metric. The metric cannot have negative values. + // + // The metric must have a value type of INT64 or DOUBLE. + optional string metric = 533067184; + + // If scaling is based on a per-group metric value that represents the total amount of work to be done or resource usage, set this value to an amount assigned for a single instance of the scaled group. Autoscaler keeps the number of instances proportional to the value of this metric. The metric itself does not change value due to group resizing. + // + // A good metric to use with the target is for example pubsub.googleapis.com/subscription/num_undelivered_messages or a custom metric exporting the total number of requests coming to your instances. + // + // A bad example would be a metric exporting an average or median latency, since this value can't include a chunk assignable to a single instance, it could be better used with utilization_target instead. + optional double single_instance_assignment = 504768064; + + // The target value of the metric that autoscaler maintains. This must be a positive value. A utilization metric scales number of virtual machines handling requests to increase or decrease proportionally to the metric. + // + // For example, a good metric to use as a utilization_target is https://www.googleapis.com/compute/v1/instance/network/received_bytes_count. The autoscaler works to keep this value constant for each of the instances. + optional double utilization_target = 215905870; + + // Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + optional UtilizationTargetType utilization_target_type = 340169355; + +} + +// Configuration parameters of autoscaling based on load balancing. +message AutoscalingPolicyLoadBalancingUtilization { + // Fraction of backend capacity utilization (set in HTTP(S) load balancing configuration) that the autoscaler maintains. Must be a positive float value. If not defined, the default is 0.8. + optional double utilization_target = 215905870; + +} + +// Configuration that allows for slower scale in so that even if Autoscaler recommends an abrupt scale in of a MIG, it will be throttled as specified by the parameters below. +message AutoscalingPolicyScaleInControl { + // Maximum allowed number (or %) of VMs that can be deducted from the peak recommendation during the window autoscaler looks at when computing recommendations. Possibly all these VMs can be deleted at once so user service needs to be prepared to lose that many VMs in one step. + optional FixedOrPercent max_scaled_in_replicas = 180710123; + + // How far back autoscaling looks when computing recommendations to include directives regarding slower scale in, as described above. + optional int32 time_window_sec = 36405300; + +} + +// Scaling based on user-defined schedule. The message describes a single scaling schedule. A scaling schedule changes the minimum number of VM instances an autoscaler can recommend, which can trigger scaling out. +message AutoscalingPolicyScalingSchedule { + // A description of a scaling schedule. + optional string description = 422937596; + + // A boolean value that specifies whether a scaling schedule can influence autoscaler recommendations. If set to true, then a scaling schedule has no effect. This field is optional, and its value is false by default. + optional bool disabled = 270940796; + + // The duration of time intervals, in seconds, for which this scaling schedule is to run. The minimum allowed value is 300. This field is required. + optional int32 duration_sec = 212356902; + + // The minimum number of VM instances that the autoscaler will recommend in time intervals starting according to schedule. This field is required. + optional int32 min_required_replicas = 365514414; + + // The start timestamps of time intervals when this scaling schedule is to provide a scaling signal. This field uses the extended cron format (with an optional year field). The expression can describe a single timestamp if the optional year is set, in which case the scaling schedule runs once. The schedule is interpreted with respect to time_zone. This field is required. Note: These timestamps only describe when autoscaler starts providing the scaling signal. The VMs need additional time to become serving. + optional string schedule = 375820951; + + // The time zone to use when interpreting the schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. This field is assigned a default value of ?UTC? if left empty. + optional string time_zone = 36848094; + +} + +// Encapsulates numeric value that can be either absolute or relative. +message FixedOrPercent { + // [Output Only] Absolute value of VM instances calculated based on the specific mode. + // + // + // - If the value is fixed, then the calculated value is equal to the fixed value. + // - If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up. + optional int32 calculated = 472082878; + + // Specifies a fixed number of VM instances. This must be a positive integer. + optional int32 fixed = 97445748; + + // Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. + optional int32 percent = 394814533; + +} + +// Message containing information of one individual backend. +message Backend { + // Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode. + enum BalancingMode { + // A value indicating that the enum field is not set. + UNDEFINED_BALANCING_MODE = 0; + + CONNECTION = 246311646; + + RATE = 2508000; + + UTILIZATION = 157008386; + + } + + // Specifies how to determine whether the backend of a load balancer can handle additional traffic or is fully loaded. For usage guidelines, see Connection balancing mode. + optional BalancingMode balancing_mode = 430286217; + + // A multiplier applied to the backend's target capacity of its balancing mode. The default value is 1, which means the group serves up to 100% of its configured capacity (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available capacity. The valid ranges are 0.0 and [0.1,1.0]. You cannot configure a setting larger than 0 and smaller than 0.1. You cannot configure a setting of 0 when there is only one backend attached to the backend service. + // + // Not supported by: + // + // - Internal TCP/UDP Load Balancing - Network Load Balancing + optional float capacity_scaler = 315958157; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // This field designates whether this is a failover backend. More than one failover backend can be configured for a given BackendService. + optional bool failover = 138892530; + + // The fully-qualified URL of an instance group or network endpoint group (NEG) resource. The type of backend that a backend service supports depends on the backend service's loadBalancingScheme. + // + // + // - When the loadBalancingScheme for the backend service is EXTERNAL (except Network Load Balancing), INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED , the backend can be either an instance group or a NEG. The backends on the backend service must be either all instance groups or all NEGs. You cannot mix instance group and NEG backends on the same backend service. + // + // + // - When the loadBalancingScheme for the backend service is EXTERNAL for Network Load Balancing or INTERNAL for Internal TCP/UDP Load Balancing, the backend must be an instance group. NEGs are not supported. + // + // For regional services, the backend must be in the same region as the backend service. + // + // You must use the fully-qualified URL (starting with https://www.googleapis.com/) to specify the instance group or NEG. Partial URLs are not supported. + optional string group = 98629247; + + // Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. Not available if the backend's balancingMode is RATE. Not supported by: + // + // - Internal TCP/UDP Load Balancing - Network Load Balancing + optional int32 max_connections = 110652154; + + // Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. + // + // Not available if the backend's balancingMode is RATE. Not supported by: + // + // - Internal TCP/UDP Load Balancing - Network Load Balancing. + optional int32 max_connections_per_endpoint = 216904604; + + // Defines a target maximum number of simultaneous connections. For usage guidelines, see Connection balancing mode and Utilization balancing mode. + // + // Not available if the backend's balancingMode is RATE. Not supported by: + // + // - Internal TCP/UDP Load Balancing - Network Load Balancing. + optional int32 max_connections_per_instance = 104671900; + + // Defines a maximum number of HTTP requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. + // + // Not available if the backend's balancingMode is CONNECTION. + optional int32 max_rate = 408035035; + + // Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. + // + // Not available if the backend's balancingMode is CONNECTION. + optional float max_rate_per_endpoint = 129832283; + + // Defines a maximum target for requests per second (RPS). For usage guidelines, see Rate balancing mode and Utilization balancing mode. + // + // Not available if the backend's balancingMode is CONNECTION. + optional float max_rate_per_instance = 17599579; + + optional float max_utilization = 148192199; + +} + +// Message containing Cloud CDN configuration for a backend bucket. +message BackendBucketCdnPolicy { + // Specifies the cache setting for all responses from this backend. The possible values are: + // + // USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. + // + // FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. + // + // CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + enum CacheMode { + // A value indicating that the enum field is not set. + UNDEFINED_CACHE_MODE = 0; + + CACHE_ALL_STATIC = 355027945; + + FORCE_CACHE_ALL = 486026928; + + INVALID_CACHE_MODE = 381295560; + + USE_ORIGIN_HEADERS = 55380261; + + } + + // Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + repeated BackendBucketCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + + // Specifies the cache setting for all responses from this backend. The possible values are: + // + // USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. + // + // FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. + // + // CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + optional CacheMode cache_mode = 28877888; + + // Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 86400s (1 day). + optional int32 client_ttl = 29034360; + + // Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + optional int32 default_ttl = 100253422; + + // Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + optional int32 max_ttl = 307578001; + + // Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + optional bool negative_caching = 336110005; + + // Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + repeated BackendBucketCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + + // If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + optional bool request_coalescing = 532808276; + + // Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + optional int32 serve_while_stale = 236682203; + + // Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + optional int64 signed_url_cache_max_age_sec = 269374534; + + // [Output Only] Names of the keys for signing request URLs. + repeated string signed_url_key_names = 371848885; + +} + +// Represents a Cloud Storage Bucket resource. +// +// This Cloud Storage bucket resource is referenced by a URL map of a load balancer. For more information, read Backend Buckets. +message BackendBucket { + // Cloud Storage bucket name. + optional string bucket_name = 283610048; + + // Cloud CDN configuration for this BackendBucket. + optional BackendBucketCdnPolicy cdn_policy = 213976452; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // Headers that the HTTP/S load balancer should add to proxied responses. + repeated string custom_response_headers = 387539094; + + // An optional textual description of the resource; provided by the client when the resource is created. + optional string description = 422937596; + + // If true, enable Cloud CDN for this BackendBucket. + optional bool enable_cdn = 282942321; + + // [Output Only] Unique identifier for the resource; defined by the server. + optional uint64 id = 3355; + + // Type of the resource. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + +} + +// Bypass the cache when the specified request headers are present, e.g. Pragma or Authorization headers. Values are case insensitive. The presence of such a header overrides the cache_mode setting. +message BackendBucketCdnPolicyBypassCacheOnRequestHeader { + // The header field name to match on when bypassing cache. Values are case-insensitive. + optional string header_name = 110223613; + +} + +// Specify CDN TTLs for response error codes. +message BackendBucketCdnPolicyNegativeCachingPolicy { + // The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + optional int32 code = 3059181; + + // The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + optional int32 ttl = 115180; + +} + +// Contains a list of BackendBucket resources. +message BackendBucketList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of BackendBucket resources. + repeated BackendBucket items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Message containing Cloud CDN configuration for a backend service. +message BackendServiceCdnPolicy { + // Specifies the cache setting for all responses from this backend. The possible values are: + // + // USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. + // + // FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. + // + // CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + enum CacheMode { + // A value indicating that the enum field is not set. + UNDEFINED_CACHE_MODE = 0; + + CACHE_ALL_STATIC = 355027945; + + FORCE_CACHE_ALL = 486026928; + + INVALID_CACHE_MODE = 381295560; + + USE_ORIGIN_HEADERS = 55380261; + + } + + // Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified. The cache is bypassed for all cdnPolicy.cacheMode settings. + repeated BackendServiceCdnPolicyBypassCacheOnRequestHeader bypass_cache_on_request_headers = 486203082; + + // The CacheKeyPolicy for this CdnPolicy. + optional CacheKeyPolicy cache_key_policy = 159263727; + + // Specifies the cache setting for all responses from this backend. The possible values are: + // + // USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. + // + // FORCE_CACHE_ALL Cache all content, ignoring any "private", "no-store" or "no-cache" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. + // + // CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. + optional CacheMode cache_mode = 28877888; + + // Specifies a separate client (e.g. browser client) maximum TTL. This is used to clamp the max-age (or Expires) value sent to the client. With FORCE_CACHE_ALL, the lesser of client_ttl and default_ttl is used for the response max-age directive, along with a "public" directive. For cacheable content in CACHE_ALL_STATIC mode, client_ttl clamps the max-age from the origin (if specified), or else sets the response max-age directive to the lesser of the client_ttl and default_ttl, and also ensures a "public" cache-control directive is present. If a client TTL is not specified, a default value (1 hour) will be used. The maximum allowed value is 86400s (1 day). + optional int32 client_ttl = 29034360; + + // Specifies the default TTL for cached content served by this origin for responses that do not have an existing valid TTL (max-age or s-max-age). Setting a TTL of "0" means "always revalidate". The value of defaultTTL cannot be set to a value greater than that of maxTTL, but can be equal. When the cacheMode is set to FORCE_CACHE_ALL, the defaultTTL will overwrite the TTL set in all responses. The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + optional int32 default_ttl = 100253422; + + // Specifies the maximum allowed TTL for cached content served by this origin. Cache directives that attempt to set a max-age or s-maxage higher than this, or an Expires header more than maxTTL seconds in the future will be capped at the value of maxTTL, as if it were the value of an s-maxage Cache-Control directive. Headers sent to the client will not be modified. Setting a TTL of "0" means "always revalidate". The maximum allowed value is 31,622,400s (1 year), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + optional int32 max_ttl = 307578001; + + // Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects. This can reduce the load on your origin and improve end-user experience by reducing response latency. When the cache mode is set to CACHE_ALL_STATIC or USE_ORIGIN_HEADERS, negative caching applies to responses with the specified response code that lack any Cache-Control, Expires, or Pragma: no-cache directives. When the cache mode is set to FORCE_CACHE_ALL, negative caching applies to all responses with the specified response code, and override any caching headers. By default, Cloud CDN will apply the following default TTLs to these status codes: HTTP 300 (Multiple Choice), 301, 308 (Permanent Redirects): 10m HTTP 404 (Not Found), 410 (Gone), 451 (Unavailable For Legal Reasons): 120s HTTP 405 (Method Not Found), 421 (Misdirected Request), 501 (Not Implemented): 60s. These defaults can be overridden in negative_caching_policy. + optional bool negative_caching = 336110005; + + // Sets a cache TTL for the specified HTTP status code. negative_caching must be enabled to configure negative_caching_policy. Omitting the policy and leaving negative_caching enabled will use Cloud CDN's default cache TTLs. Note that when specifying an explicit negative_caching_policy, you should take care to specify a cache TTL for all response codes that you wish to cache. Cloud CDN will not apply any default negative caching when a policy exists. + repeated BackendServiceCdnPolicyNegativeCachingPolicy negative_caching_policy = 155359996; + + // If true then Cloud CDN will combine multiple concurrent cache fill requests into a small number of requests to the origin. + optional bool request_coalescing = 532808276; + + // Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache. This setting defines the default "max-stale" duration for any cached responses that do not specify a max-stale directive. Stale responses that exceed the TTL configured here will not be served. The default limit (max-stale) is 86400s (1 day), which will allow stale content to be served up to this limit beyond the max-age (or s-max-age) of a cached response. The maximum allowed value is 604800 (1 week). Set this to zero (0) to disable serve-while-stale. + optional int32 serve_while_stale = 236682203; + + // Maximum number of seconds the response to a signed URL request will be considered fresh. After this time period, the response will be revalidated before being served. Defaults to 1hr (3600s). When serving responses to signed URL requests, Cloud CDN will internally behave as though all responses from this backend had a "Cache-Control: public, max-age=[TTL]" header, regardless of any existing Cache-Control header. The actual headers served in responses will not be altered. + optional int64 signed_url_cache_max_age_sec = 269374534; + + // [Output Only] Names of the keys for signing request URLs. + repeated string signed_url_key_names = 371848885; + +} + +// Settings controlling the volume of connections to a backend service. +message CircuitBreakers { + // The maximum number of connections to the backend service. If not specified, there is no limit. + optional int32 max_connections = 110652154; + + // The maximum number of pending requests allowed to the backend service. If not specified, there is no limit. + optional int32 max_pending_requests = 375558887; + + // The maximum number of parallel requests that allowed to the backend service. If not specified, there is no limit. + optional int32 max_requests = 28097599; + + // Maximum requests for a single connection to the backend service. This parameter is respected by both the HTTP/1.1 and HTTP/2 implementations. If not specified, there is no limit. Setting this parameter to 1 will effectively disable keep alive. + optional int32 max_requests_per_connection = 361630528; + + // The maximum number of parallel retries allowed to the backend cluster. If not specified, the default is 1. + optional int32 max_retries = 55546219; + +} + +// Message containing connection draining configuration. +message ConnectionDraining { + // Configures a duration timeout for existing requests on a removed backend instance. For supported load balancers and protocols, as described in Enabling connection draining. + optional int32 draining_timeout_sec = 225127070; + +} + +// This message defines settings for a consistent hash style load balancer. +message ConsistentHashLoadBalancerSettings { + // Hash is based on HTTP Cookie. This field describes a HTTP cookie that will be used as the hash key for the consistent hash load balancer. If the cookie is not present, it will be generated. This field is applicable if the sessionAffinity is set to HTTP_COOKIE. + optional ConsistentHashLoadBalancerSettingsHttpCookie http_cookie = 6673915; + + // The hash based on the value of the specified header field. This field is applicable if the sessionAffinity is set to HEADER_FIELD. + optional string http_header_name = 234798022; + + // The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node. + optional int64 minimum_ring_size = 234380735; + +} + +// Applicable only to Failover for Internal TCP/UDP Load Balancing and Network Load Balancing. On failover or failback, this field indicates whether connection draining will be honored. GCP has a fixed connection draining timeout of 10 minutes. A setting of true terminates existing TCP connections to the active pool during failover and failback, immediately draining traffic. A setting of false allows existing TCP connections to persist, even on VMs no longer in the active pool, for up to the duration of the connection draining timeout (10 minutes). +message BackendServiceFailoverPolicy { + // This can be set to true only if the protocol is TCP. + // + // The default is false. + optional bool disable_connection_drain_on_failover = 182150753; + + // Applicable only to Failover for Internal TCP/UDP Load Balancing and Network Load Balancing, If set to true, connections to the load balancer are dropped when all primary and all backup backend VMs are unhealthy.If set to false, connections are distributed among all primary VMs when all primary and all backup backend VMs are unhealthy. The default is false. + optional bool drop_traffic_if_unhealthy = 112289428; + + // Applicable only to Failover for Internal TCP/UDP Load Balancing and Network Load Balancing. The value of the field must be in the range [0, 1]. If the value is 0, the load balancer performs a failover when the number of healthy primary VMs equals zero. For all other values, the load balancer performs a failover when the total number of healthy primary VMs is less than this ratio. + optional float failover_ratio = 212667006; + +} + +// Identity-Aware Proxy +message BackendServiceIAP { + // Whether the serving infrastructure will authenticate and authorize all incoming requests. If true, the oauth2ClientId and oauth2ClientSecret fields must be non-empty. + optional bool enabled = 1018689; + + // OAuth2 client ID to use for the authentication flow. + optional string oauth2_client_id = 314017611; + + // OAuth2 client secret to use for the authentication flow. For security reasons, this value cannot be retrieved via the API. Instead, the SHA-256 hash of the value is returned in the oauth2ClientSecretSha256 field. + optional string oauth2_client_secret = 50999520; + + // [Output Only] SHA256 hash value for the field oauth2_client_secret above. + optional string oauth2_client_secret_sha256 = 112903782; + +} + +// The available logging options for the load balancer traffic served by this backend service. +message BackendServiceLogConfig { + // This field denotes whether to enable logging for the load balancer traffic served by this backend service. + optional bool enable = 311764355; + + // This field can only be specified if logging is enabled for this backend service. The value of the field must be in [0, 1]. This configures the sampling rate of requests to the load balancer where 1.0 means all logged requests are reported and 0.0 means no logged requests are reported. The default value is 1.0. + optional float sample_rate = 153193045; + +} + +// A Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". Range is approximately 10,000 years. +message Duration { + // Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 `seconds` field and a positive `nanos` field. Must be from 0 to 999,999,999 inclusive. + optional int32 nanos = 104586303; + + // Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + optional int64 seconds = 359484031; + +} + +// Settings controlling the eviction of unhealthy hosts from the load balancing pool for the backend service. +message OutlierDetection { + // The base time that a host is ejected for. The real ejection time is equal to the base ejection time multiplied by the number of times the host has been ejected. Defaults to 30000ms or 30s. + optional Duration base_ejection_time = 80997255; + + // Number of errors before a host is ejected from the connection pool. When the backend host is accessed over HTTP, a 5xx return code qualifies as an error. Defaults to 5. + optional int32 consecutive_errors = 387193248; + + // The number of consecutive gateway failures (502, 503, 504 status or connection errors that are mapped to one of those status codes) before a consecutive gateway failure ejection occurs. Defaults to 3. + optional int32 consecutive_gateway_failure = 417504250; + + // The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive 5xx. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 0. + optional int32 enforcing_consecutive_errors = 213133760; + + // The percentage chance that a host will be actually ejected when an outlier status is detected through consecutive gateway failures. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + optional int32 enforcing_consecutive_gateway_failure = 394440666; + + // The percentage chance that a host will be actually ejected when an outlier status is detected through success rate statistics. This setting can be used to disable ejection or to ramp it up slowly. Defaults to 100. + optional int32 enforcing_success_rate = 194508732; + + // Time interval between ejection analysis sweeps. This can result in both new ejections as well as hosts being returned to service. Defaults to 1 second. + optional Duration interval = 33547461; + + // Maximum percentage of hosts in the load balancing pool for the backend service that can be ejected. Defaults to 50%. + optional int32 max_ejection_percent = 18436888; + + // The number of hosts in a cluster that must have enough request volume to detect success rate outliers. If the number of hosts is less than this setting, outlier detection via success rate statistics is not performed for any host in the cluster. Defaults to 5. + optional int32 success_rate_minimum_hosts = 525766903; + + // The minimum number of total requests that must be collected in one interval (as defined by the interval duration above) to include this host in success rate based outlier detection. If the volume is lower than this setting, outlier detection via success rate statistics is not performed for that host. Defaults to 100. + optional int32 success_rate_request_volume = 281425357; + + // This factor is used to determine the ejection threshold for success rate outlier ejection. The ejection threshold is the difference between the mean success rate, and the product of this factor and the standard deviation of the mean success rate: mean - (stdev * success_rate_stdev_factor). This factor is divided by a thousand to get a double. That is, if the desired factor is 1.9, the runtime value should be 1900. Defaults to 1900. + optional int32 success_rate_stdev_factor = 174735773; + +} + +// The authentication and authorization settings for a BackendService. +message SecuritySettings { + // Optional. A URL referring to a networksecurity.ClientTlsPolicy resource that describes how clients should authenticate with this service's backends. + // clientTlsPolicy only applies to a global BackendService with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. + // If left blank, communications are not encrypted. + // Note: This field currently has no impact. + optional string client_tls_policy = 462325226; + + // Optional. A list of Subject Alternative Names (SANs) that the client verifies during a mutual TLS handshake with an server/endpoint for this BackendService. When the server presents its X.509 certificate to the client, the client inspects the certificate's subjectAltName field. If the field contains one of the specified values, the communication continues. Otherwise, it fails. This additional check enables the client to verify that the server is authorized to run the requested service. + // Note that the contents of the server certificate's subjectAltName field are configured by the Public Key Infrastructure which provisions server identities. + // Only applies to a global BackendService with loadBalancingScheme set to INTERNAL_SELF_MANAGED. Only applies when BackendService has an attached clientTlsPolicy with clientCertificate (mTLS mode). + // Note: This field currently has no impact. + repeated string subject_alt_names = 330029535; + +} + +// Represents a Backend Service resource. +// +// A backend service defines how Google Cloud load balancers distribute traffic. The backend service configuration contains a set of values, such as the protocol used to connect to backends, various distribution and session settings, health checks, and timeouts. These settings provide fine-grained control over how your load balancer behaves. Most of the settings have default values that allow for easy configuration if you need to get started quickly. +// +// Backend services in Google Compute Engine can be either regionally or globally scoped. +// +// * [Global](/compute/docs/reference/rest/{$api_version}/backendServices) * [Regional](/compute/docs/reference/rest/{$api_version}/regionBackendServices) +// +// For more information, see Backend Services. +// +// (== resource_for {$api_version}.backendService ==) +message BackendService { + // Specifies the load balancer type. Choose EXTERNAL for external HTTP(S), SSL Proxy, TCP Proxy and Network Load Balancing. Choose INTERNAL for Internal TCP/UDP Load Balancing. Choose INTERNAL_MANAGED for Internal HTTP(S) Load Balancing. INTERNAL_SELF_MANAGED for Traffic Director. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. + enum LoadBalancingScheme { + // A value indicating that the enum field is not set. + UNDEFINED_LOAD_BALANCING_SCHEME = 0; + + EXTERNAL = 35607499; + + INTERNAL = 279295677; + + INTERNAL_MANAGED = 37350397; + + INTERNAL_SELF_MANAGED = 236211150; + + INVALID_LOAD_BALANCING_SCHEME = 275352060; + + } + + // The load balancing algorithm used within the scope of the locality. The possible values are: + // - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. + // - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. + // - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. + // - RANDOM: The load balancer selects a random healthy host. + // - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. + // - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 + // + // This field is applicable to either: + // - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + // - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + // + // If sessionAffinity is not NONE, and this field is not set to MAGLEV or RING_HASH, session affinity settings will not take effect. + // + // Only the default ROUND_ROBIN policy is supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + enum LocalityLbPolicy { + // A value indicating that the enum field is not set. + UNDEFINED_LOCALITY_LB_POLICY = 0; + + INVALID_LB_POLICY = 323318707; + + LEAST_REQUEST = 46604921; + + MAGLEV = 119180266; + + ORIGINAL_DESTINATION = 166297216; + + RANDOM = 262527171; + + RING_HASH = 432795069; + + ROUND_ROBIN = 153895801; + + } + + // The protocol this BackendService uses to communicate with backends. + // + // Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancer or for Traffic Director for more information. + // + // Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. + enum Protocol { + // A value indicating that the enum field is not set. + UNDEFINED_PROTOCOL = 0; + + GRPC = 2196510; + + HTTP = 2228360; + + HTTP2 = 69079210; + + HTTPS = 69079243; + + SSL = 82412; + + TCP = 82881; + + UDP = 83873; + + } + + // Type of session affinity to use. The default is NONE. + // + // When the loadBalancingScheme is EXTERNAL: * For Network Load Balancing, the possible values are NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. * For all other load balancers that use loadBalancingScheme=EXTERNAL, the possible values are NONE, CLIENT_IP, or GENERATED_COOKIE. * You can use GENERATED_COOKIE if the protocol is HTTP, HTTP2, or HTTPS. + // + // When the loadBalancingScheme is INTERNAL, possible values are NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. + // + // When the loadBalancingScheme is INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED, possible values are NONE, CLIENT_IP, GENERATED_COOKIE, HEADER_FIELD, or HTTP_COOKIE. + // + // Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + enum SessionAffinity { + // A value indicating that the enum field is not set. + UNDEFINED_SESSION_AFFINITY = 0; + + CLIENT_IP = 345665051; + + CLIENT_IP_NO_DESTINATION = 106122516; + + CLIENT_IP_PORT_PROTO = 221722926; + + CLIENT_IP_PROTO = 25322148; + + GENERATED_COOKIE = 370321204; + + HEADER_FIELD = 200737960; + + HTTP_COOKIE = 494981627; + + NONE = 2402104; + + } + + // Lifetime of cookies in seconds. Only applicable if the loadBalancingScheme is EXTERNAL, INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED, the protocol is HTTP or HTTPS, and the sessionAffinity is GENERATED_COOKIE, or HTTP_COOKIE. + // + // If set to 0, the cookie is non-persistent and lasts only until the end of the browser session (or equivalent). The maximum allowed value is one day (86,400). + // + // Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + optional int32 affinity_cookie_ttl_sec = 369996954; + + // The list of backends that serve this BackendService. + repeated Backend backends = 510839903; + + // Cloud CDN configuration for this BackendService. Only available for external HTTP(S) Load Balancing. + optional BackendServiceCdnPolicy cdn_policy = 213976452; + + // Settings controlling the volume of connections to a backend service. If not set, this feature is considered disabled. + // + // This field is applicable to either: + // - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + // - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + // + // Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + optional CircuitBreakers circuit_breakers = 421340061; + + optional ConnectionDraining connection_draining = 461096747; + + // Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service. This field specifies parameters that control consistent hashing. This field is only applicable when localityLbPolicy is set to MAGLEV or RING_HASH. + // + // This field is applicable to either: + // - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + // - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + // + // Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + optional ConsistentHashLoadBalancerSettings consistent_hash = 905883; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // Headers that the HTTP/S load balancer should add to proxied requests. + repeated string custom_request_headers = 27977992; + + // Headers that the HTTP/S load balancer should add to proxied responses. + repeated string custom_response_headers = 387539094; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // If true, enables Cloud CDN for the backend service. Only applicable if the loadBalancingScheme is EXTERNAL and the protocol is HTTP or HTTPS. + optional bool enable_c_d_n = 250733499; + + // Applicable only to Failover for Internal TCP/UDP Load Balancing and Network Load Balancing. Requires at least one backend instance group to be defined as a backup (failover) backend. + optional BackendServiceFailoverPolicy failover_policy = 105658655; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a BackendService. An up-to-date fingerprint must be provided in order to update the BackendService, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve a BackendService. + optional string fingerprint = 234678500; + + // The list of URLs to the healthChecks, httpHealthChecks (legacy), or httpsHealthChecks (legacy) resource for health checking this backend service. Not all backend services support legacy health checks. See Load balancer guide. Currently, at most one health check can be specified for each backend service. Backend services with instance group or zonal NEG backends must have a health check. Backend services with internet or serverless NEG backends must not have a health check. + repeated string health_checks = 448370606; + + // The configurations for Identity-Aware Proxy on this resource. Not available for Internal TCP/UDP Load Balancing and Network Load Balancing. + optional BackendServiceIAP iap = 104024; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of resource. Always compute#backendService for backend services. + optional string kind = 3292052; + + // Specifies the load balancer type. Choose EXTERNAL for external HTTP(S), SSL Proxy, TCP Proxy and Network Load Balancing. Choose INTERNAL for Internal TCP/UDP Load Balancing. Choose INTERNAL_MANAGED for Internal HTTP(S) Load Balancing. INTERNAL_SELF_MANAGED for Traffic Director. A backend service created for one type of load balancer cannot be used with another. For more information, refer to Choosing a load balancer. + optional LoadBalancingScheme load_balancing_scheme = 363890244; + + // The load balancing algorithm used within the scope of the locality. The possible values are: + // - ROUND_ROBIN: This is a simple policy in which each healthy backend is selected in round robin order. This is the default. + // - LEAST_REQUEST: An O(1) algorithm which selects two random healthy hosts and picks the host which has fewer active requests. + // - RING_HASH: The ring/modulo hash load balancer implements consistent hashing to backends. The algorithm has the property that the addition/removal of a host from a set of N hosts only affects 1/N of the requests. + // - RANDOM: The load balancer selects a random healthy host. + // - ORIGINAL_DESTINATION: Backend host is selected based on the client connection metadata, i.e., connections are opened to the same address as the destination address of the incoming connection before the connection was redirected to the load balancer. + // - MAGLEV: used as a drop in replacement for the ring hash load balancer. Maglev is not as stable as ring hash but has faster table lookup build times and host selection times. For more information about Maglev, see https://ai.google/research/pubs/pub44824 + // + // This field is applicable to either: + // - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + // - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + // + // If sessionAffinity is not NONE, and this field is not set to MAGLEV or RING_HASH, session affinity settings will not take effect. + // + // Only the default ROUND_ROBIN policy is supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + optional LocalityLbPolicy locality_lb_policy = 131431487; + + // This field denotes the logging options for the load balancer traffic served by this backend service. If logging is enabled, logs will be exported to Stackdriver. + optional BackendServiceLogConfig log_config = 351299741; + + // Specifies the default maximum duration (timeout) for streams to this service. Duration is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. + // If not specified, there will be no timeout limit, i.e. the maximum duration is infinite. + // This field is only allowed when the loadBalancingScheme of the backend service is INTERNAL_SELF_MANAGED. + optional Duration max_stream_duration = 61428376; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The URL of the network to which this backend service belongs. This field can only be specified when the load balancing scheme is set to INTERNAL. + optional string network = 232872494; + + // Settings controlling the eviction of unhealthy hosts from the load balancing pool for the backend service. If not set, this feature is considered disabled. + // + // This field is applicable to either: + // - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + // - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + // + // Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + optional OutlierDetection outlier_detection = 354625086; + + // Deprecated in favor of portName. The TCP port to connect on the backend. The default value is 80. + // + // Backend services for Internal TCP/UDP Load Balancing and Network Load Balancing require you omit port. + optional int32 port = 3446913; + + // A named port on a backend instance group representing the port for communication to the backend VMs in that group. Required when the loadBalancingScheme is EXTERNAL (except Network Load Balancing), INTERNAL_MANAGED, or INTERNAL_SELF_MANAGED and the backends are instance groups. The named port must be defined on each backend instance group. This parameter has no meaning if the backends are NEGs. + // + // + // + // Backend services for Internal TCP/UDP Load Balancing and Network Load Balancing require you omit port_name. + optional string port_name = 41534345; + + // The protocol this BackendService uses to communicate with backends. + // + // Possible values are HTTP, HTTPS, HTTP2, TCP, SSL, UDP or GRPC. depending on the chosen load balancer or Traffic Director configuration. Refer to the documentation for the load balancer or for Traffic Director for more information. + // + // Must be set to GRPC when the backend service is referenced by a URL map that is bound to target gRPC proxy. + optional Protocol protocol = 84577944; + + // [Output Only] URL of the region where the regional backend service resides. This field is not applicable to global backend services. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] The resource URL for the security policy associated with this backend service. + optional string security_policy = 171082513; + + // This field specifies the security policy that applies to this backend service. This field is applicable to either: + // - A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2, and load_balancing_scheme set to INTERNAL_MANAGED. + // - A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED. + optional SecuritySettings security_settings = 478649922; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Type of session affinity to use. The default is NONE. + // + // When the loadBalancingScheme is EXTERNAL: * For Network Load Balancing, the possible values are NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. * For all other load balancers that use loadBalancingScheme=EXTERNAL, the possible values are NONE, CLIENT_IP, or GENERATED_COOKIE. * You can use GENERATED_COOKIE if the protocol is HTTP, HTTP2, or HTTPS. + // + // When the loadBalancingScheme is INTERNAL, possible values are NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. + // + // When the loadBalancingScheme is INTERNAL_SELF_MANAGED, or INTERNAL_MANAGED, possible values are NONE, CLIENT_IP, GENERATED_COOKIE, HEADER_FIELD, or HTTP_COOKIE. + // + // Not supported when the backend service is referenced by a URL map that is bound to target gRPC proxy that has validateForProxyless field set to true. + optional SessionAffinity session_affinity = 463888561; + + // The backend service timeout has a different meaning depending on the type of load balancer. For more information see, Backend service settings The default is 30 seconds. The full range of timeout values allowed is 1 - 2,147,483,647 seconds. + optional int32 timeout_sec = 79994995; + +} + +// +message BackendServicesScopedList { + // A list of BackendServices contained in this scope. + repeated BackendService backend_services = 388522409; + + // Informational warning which replaces the list of backend services when the list is empty. + optional Warning warning = 50704284; + +} + +// Contains a list of BackendServicesScopedList. +message BackendServiceAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of BackendServicesScopedList resources. + map items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Bypass the cache when the specified request headers are present, e.g. Pragma or Authorization headers. Values are case insensitive. The presence of such a header overrides the cache_mode setting. +message BackendServiceCdnPolicyBypassCacheOnRequestHeader { + // The header field name to match on when bypassing cache. Values are case-insensitive. + optional string header_name = 110223613; + +} + +// Message containing what to include in the cache key for a request for Cloud CDN. +message CacheKeyPolicy { + // If true, requests to different hosts will be cached separately. + optional bool include_host = 486867679; + + // If true, http and https requests will be cached separately. + optional bool include_protocol = 303507535; + + // If true, include query string parameters in the cache key according to query_string_whitelist and query_string_blacklist. If neither is set, the entire query string will be included. If false, the query string will be excluded from the cache key entirely. + optional bool include_query_string = 474036639; + + // Names of query string parameters to exclude in cache keys. All other parameters will be included. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + repeated string query_string_blacklist = 354964742; + + // Names of query string parameters to include in cache keys. All other parameters will be excluded. Either specify query_string_whitelist or query_string_blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. + repeated string query_string_whitelist = 52456496; + +} + +// Specify CDN TTLs for response error codes. +message BackendServiceCdnPolicyNegativeCachingPolicy { + // The HTTP status code to define a TTL against. Only HTTP status codes 300, 301, 302, 307, 308, 404, 405, 410, 421, 451 and 501 are can be specified as values, and you cannot specify a status code more than once. + optional int32 code = 3059181; + + // The TTL (in seconds) for which to cache responses with the corresponding status code. The maximum allowed value is 1800s (30 minutes), noting that infrequently accessed objects may be evicted from the cache before the defined TTL. + optional int32 ttl = 115180; + +} + +// +message HealthStatus { + // Health state of the instance. + enum HealthState { + // A value indicating that the enum field is not set. + UNDEFINED_HEALTH_STATE = 0; + + HEALTHY = 439801213; + + UNHEALTHY = 462118084; + + } + + // + enum WeightError { + // A value indicating that the enum field is not set. + UNDEFINED_WEIGHT_ERROR = 0; + + INVALID_WEIGHT = 383698400; + + MISSING_WEIGHT = 384027537; + + UNAVAILABLE_WEIGHT = 439464295; + + WEIGHT_NONE = 502428831; + + } + + // Metadata defined as annotations for network endpoint. + map annotations = 112032548; + + // URL of the forwarding rule associated with the health status of the instance. + optional string forwarding_rule = 269964030; + + // A forwarding rule IP address assigned to this instance. + optional string forwarding_rule_ip = 172250632; + + // Health state of the instance. + optional HealthState health_state = 324007150; + + // URL of the instance resource. + optional string instance = 18257045; + + // For target pool based Network Load Balancing, it indicates the forwarding rule's IP address assigned to this instance. For other types of load balancing, the field indicates VM internal ip. + optional string ip_address = 406272220; + + // The named port of the instance group, not necessarily the port that is health-checked. + optional int32 port = 3446913; + + optional string weight = 282149496; + + optional WeightError weight_error = 522501505; + +} + +// +message BackendServiceGroupHealth { + // Metadata defined as annotations on the network endpoint group. + map annotations = 112032548; + + // Health state of the backend instances or endpoints in requested instance or network endpoint group, determined based on configured health checks. + repeated HealthStatus health_status = 380545845; + + // [Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services. + optional string kind = 3292052; + +} + +// Contains a list of BackendService resources. +message BackendServiceList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of BackendService resources. + repeated BackendService items = 100526016; + + // [Output Only] Type of resource. Always compute#backendServiceList for lists of backend services. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message BackendServiceReference { + optional string backend_service = 306946058; + +} + +// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. +// +// Example (Comparison): +// +// title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" +// +// Example (Equality): +// +// title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" +// +// Example (Logic): +// +// title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" +// +// Example (Data Manipulation): +// +// title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" +// +// The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. +message Expr { + // Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + optional string description = 422937596; + + // Textual representation of an expression in Common Expression Language syntax. + optional string expression = 352031384; + + // Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + optional string location = 290430901; + + // Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + optional string title = 110371416; + +} + +// Associates `members` with a `role`. +message Binding { + optional string binding_id = 441088277; + + // The condition that is associated with this binding. + // + // If the condition evaluates to `true`, then this binding applies to the current request. + // + // If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the members in this binding. + // + // To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + optional Expr condition = 212430107; + + // Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: + // + // * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. + // + // * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. + // + // * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . + // + // + // + // * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. + // + // * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. + // + // * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. + // + // * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. + // + // * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. + // + // + // + // * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. + repeated string members = 412010777; + + // Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + optional string role = 3506294; + +} + +// +message InstanceProperties { + // The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. + enum PrivateIpv6GoogleAccess { + // A value indicating that the enum field is not set. + UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + + INHERIT_FROM_SUBNETWORK = 530256959; + + } + + // Controls for advanced machine-related behavior features. + optional AdvancedMachineFeatures advanced_machine_features = 409646002; + + // Enables instances created based on these properties to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the Enable IP forwarding documentation for more information. + optional bool can_ip_forward = 467731324; + + // Specifies the Confidential Instance options. + optional ConfidentialInstanceConfig confidential_instance_config = 490637685; + + // An optional text description for the instances that are created from these properties. + optional string description = 422937596; + + // An array of disks that are associated with the instances that are created from these properties. + repeated AttachedDisk disks = 95594102; + + // A list of guest accelerator cards' type and count to use for instances created from these properties. + repeated AcceleratorConfig guest_accelerators = 463595119; + + // Labels to apply to instances that are created from these properties. + map labels = 500195327; + + // The machine type to use for instances that are created from these properties. + optional string machine_type = 227711026; + + // The metadata key/value pairs to assign to instances that are created from these properties. These pairs can consist of custom metadata or predefined keys. See Project and instance metadata for more information. + optional Metadata metadata = 86866735; + + // Minimum cpu/platform to be used by instances. The instance may be scheduled on the specified or newer cpu/platform. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more information, read Specifying a Minimum CPU Platform. + optional string min_cpu_platform = 242912759; + + // An array of network access configurations for this interface. + repeated NetworkInterface network_interfaces = 52735243; + + // The private IPv6 google access type for VMs. If not specified, use INHERIT_FROM_SUBNETWORK as default. + optional PrivateIpv6GoogleAccess private_ipv6_google_access = 48277006; + + // Specifies the reservations that instances can consume from. + optional ReservationAffinity reservation_affinity = 157850683; + + // Resource policies (names, not ULRs) applied to instances created from these properties. + repeated string resource_policies = 22220385; + + // Specifies the scheduling options for the instances that are created from these properties. + optional Scheduling scheduling = 386688404; + + // A list of service accounts with specified scopes. Access tokens for these service accounts are available to the instances that are created from these properties. Use metadata queries to obtain the access tokens for these instances. + repeated ServiceAccount service_accounts = 277537328; + + optional ShieldedInstanceConfig shielded_instance_config = 12862901; + + // A list of tags to apply to the instances that are created from these properties. The tags identify valid sources or targets for network firewalls. The setTags method can modify this list of tags. Each tag within the list must comply with RFC1035. + optional Tags tags = 3552281; + +} + +// Configuration for location policy among multiple possible locations (e.g. preferences for zone selection among zones in a single region). +message LocationPolicy { + // Location configurations mapped by location name. Currently only zone names are supported and must be represented as valid internal URLs, such as zones/us-central1-a. + map locations = 413423454; + +} + +// Per-instance properties to be set on individual instances. To be extended in the future. +message BulkInsertInstanceResourcePerInstanceProperties { + // This field is only temporary. It will be removed. Do not use it. + optional string name = 3373707; + +} + +// +message BulkInsertInstanceResource { + // The maximum number of instances to create. + optional int64 count = 94851343; + + // The instance properties defining the VM instances to be created. Required if sourceInstanceTemplate is not provided. + optional InstanceProperties instance_properties = 215355165; + + // Policy for chosing target zone. + optional LocationPolicy location_policy = 465689852; + + // The minimum number of instances to create. If no min_count is specified then count is used as the default value. If min_count instances cannot be created, then no instances will be created and instances already created will be deleted. + optional int64 min_count = 523228386; + + // The string pattern used for the names of the VMs. Either name_pattern or per_instance_properties must be set. The pattern should contain one continuous sequence of placeholder hash characters (#) with each character corresponding to one digit of the generated instance name. Example: name_pattern of inst-#### will generate instance names such as inst-0001, inst-0002, ... . If there already exist instance(s) whose names match the name pattern in the same project and zone, then the generated instance numbers will start after the biggest existing number. For example, if there exists an instance with name inst-0050, then instance names generated using the pattern inst-#### will be inst-0051, inst-0052, etc. The name pattern placeholder #...# can contain up to 18 characters. + optional string name_pattern = 413815260; + + // Per-instance properties to be set on individual instances. Keys of this map specify requested instance names. Can be empty if name_pattern is used. + map per_instance_properties = 108502267; + + // Specifies the instance template from which to create instances. You may combine sourceInstanceTemplate with instanceProperties to override specific values from an existing instance template. Bulk API follows the semantics of JSON Merge Patch described by RFC 7396. + // + // It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + // - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate + // - projects/project/global/instanceTemplates/instanceTemplate + // - global/instanceTemplates/instanceTemplate + // + // This field is optional. + optional string source_instance_template = 332423616; + +} + +// +message CacheInvalidationRule { + // If set, this invalidation rule will only apply to requests with a Host header matching host. + optional string host = 3208616; + + optional string path = 3433509; + +} + +// Commitment for a particular license resource. +message LicenseResourceCommitment { + // The number of licenses purchased. + optional int64 amount = 196759640; + + // Specifies the core range of the instance for which this license applies. + optional string cores_per_license = 32482324; + + // Any applicable license URI. + optional string license = 166757441; + +} + +// Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==) +message Reservation { + // [Output Only] The status of the reservation. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + INVALID = 530283991; + + READY = 77848963; + + UPDATING = 494614342; + + } + + // [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment. + optional string commitment = 482134805; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#reservations for reservations. + optional string kind = 3292052; + + // The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] Reserved for future use. + optional bool satisfies_pzs = 480964267; + + // [Output Only] Server-defined fully-qualified URL for this resource. + optional string self_link = 456214797; + + // Reservation for instances with specific machine shapes. + optional AllocationSpecificSKUReservation specific_reservation = 404901951; + + // Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation. + optional bool specific_reservation_required = 226550687; + + // [Output Only] The status of the reservation. + optional Status status = 181260274; + + // Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment. + optional string zone = 3744684; + +} + +// Commitment for a particular resource (a Commitment is composed of one or more of these). +message ResourceCommitment { + // Type of resource for which this commitment applies. Possible values are VCPU and MEMORY + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + ACCELERATOR = 429815371; + + LOCAL_SSD = 508934896; + + MEMORY = 123056385; + + UNSPECIFIED = 526786327; + + VCPU = 2628978; + + } + + // Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. + optional string accelerator_type = 138031246; + + // The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + optional int64 amount = 196759640; + + // Type of resource for which this commitment applies. Possible values are VCPU and MEMORY + optional Type type = 3575610; + +} + +// Represents a regional Commitment resource. +// +// Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. (== resource_for {$api_version}.regionCommitments ==) +message Commitment { + // The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + enum Category { + // A value indicating that the enum field is not set. + UNDEFINED_CATEGORY = 0; + + CATEGORY_UNSPECIFIED = 509189462; + + LICENSE = 347869217; + + MACHINE = 469553191; + + } + + // The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + enum Plan { + // A value indicating that the enum field is not set. + UNDEFINED_PLAN = 0; + + INVALID = 530283991; + + THIRTY_SIX_MONTH = 266295942; + + TWELVE_MONTH = 173083962; + + } + + // [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + ACTIVE = 314733318; + + CREATING = 455564985; + + EXPIRED = 482489093; + + NOT_YET_ACTIVE = 20607337; + + } + + // The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + optional Category category = 50511102; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] Commitment end time in RFC3339 text format. + optional string end_timestamp = 468096690; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#commitment for commitments. + optional string kind = 3292052; + + // The license specification required as part of a license commitment. + optional LicenseResourceCommitment license_resource = 437955148; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + optional Plan plan = 3443497; + + // [Output Only] URL of the region where this commitment may be used. + optional string region = 138946292; + + // List of reservations in this commitment. + repeated Reservation reservations = 399717927; + + // A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. + repeated ResourceCommitment resources = 164412965; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] Commitment start time in RFC3339 text format. + optional string start_timestamp = 83645817; + + // [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + optional Status status = 181260274; + + // [Output Only] An optional, human-readable explanation of the status. + optional string status_message = 297428154; + +} + +// +message CommitmentsScopedList { + // [Output Only] A list of commitments contained in this scope. + repeated Commitment commitments = 450664446; + + // [Output Only] Informational warning which replaces the list of commitments when the list is empty. + optional Warning warning = 50704284; + +} + +// +message CommitmentAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of CommitmentsScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#commitmentAggregatedList for aggregated lists of commitments. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of Commitment resources. +message CommitmentList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Commitment resources. + repeated Commitment items = 100526016; + + // [Output Only] Type of resource. Always compute#commitmentList for lists of commitments. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// A condition to be met. +message Condition { + // Trusted attributes supplied by the IAM system. + optional string iam = 104021; + + // An operator to apply the subject with. + optional string op = 3553; + + // Trusted attributes discharged by the service. + optional string svc = 114272; + + // Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. + optional string sys = 114381; + + // The objects of the condition. + repeated string values = 249928994; + +} + +// A set of Confidential Instance options. +message ConfidentialInstanceConfig { + // Defines whether the instance should have confidential compute enabled. + optional bool enable_confidential_compute = 102135228; + +} + +// The information about the HTTP Cookie on which the hash function is based for load balancing policies that use a consistent hash. +message ConsistentHashLoadBalancerSettingsHttpCookie { + // Name of the cookie. + optional string name = 3373707; + + // Path to set for the cookie. + optional string path = 3433509; + + // Lifetime of the cookie. + optional Duration ttl = 115180; + +} + +// The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing +message CorsPolicy { + // In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. + // Default is false. + optional bool allow_credentials = 481263366; + + // Specifies the content for the Access-Control-Allow-Headers header. + repeated string allow_headers = 45179024; + + // Specifies the content for the Access-Control-Allow-Methods header. + repeated string allow_methods = 205405372; + + // Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax + // An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. + repeated string allow_origin_regexes = 215385810; + + // Specifies the list of origins that will be allowed to do CORS requests. + // An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. + repeated string allow_origins = 194914071; + + // If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect. + optional bool disabled = 270940796; + + // Specifies the content for the Access-Control-Expose-Headers header. + repeated string expose_headers = 247604747; + + // Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header. + optional int32 max_age = 307559332; + +} + +// +message CustomerEncryptionKeyProtectedDisk { + // Decrypts data associated with the disk with a customer-supplied encryption key. + optional CustomerEncryptionKey disk_encryption_key = 271660677; + + // Specifies a valid partial or full URL to an existing Persistent Disk resource. This field is only applicable for persistent disks. + optional string source = 177235995; + +} + +// Represents a Persistent Disk resource. +// +// Google Compute Engine has two Disk resources: +// +// * [Zonal](/compute/docs/reference/rest/{$api_version}/disks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionDisks) +// +// Persistent disks are required for running your VM instances. Create both boot and non-boot (data) persistent disks. For more information, read Persistent Disks. For more storage options, read Storage options. +// +// The disks resource represents a zonal persistent disk. For more information, read Zonal persistent disks. +// +// The regionDisks resource represents a regional persistent disk. For more information, read Regional resources. (== resource_for {$api_version}.disks ==) (== resource_for {$api_version}.regionDisks ==) +message Disk { + // [Output Only] The status of disk creation. + // - CREATING: Disk is provisioning. + // - RESTORING: Source data is being copied into the disk. + // - FAILED: Disk creation failed. + // - READY: Disk is ready for use. + // - DELETING: Disk is deleting. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + FAILED = 455706685; + + READY = 77848963; + + RESTORING = 404263851; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Encrypts the disk using a customer-supplied encryption key. + // + // After you encrypt a disk with a customer-supplied key, you must provide the same key if you use the disk later (e.g. to create a disk snapshot, to create a disk image, to create a machine image, or to attach the disk to a virtual machine). + // + // Customer-supplied encryption keys do not protect access to metadata of the disk. + // + // If you do not provide an encryption key when creating the disk, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later. + optional CustomerEncryptionKey disk_encryption_key = 271660677; + + // A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + repeated GuestOsFeature guest_os_features = 79294545; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#disk for disks. + optional string kind = 3292052; + + // A fingerprint for the labels being applied to this disk, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve a disk. + optional string label_fingerprint = 178124825; + + // Labels to apply to this disk. These can be later modified by the setLabels method. + map labels = 500195327; + + // [Output Only] Last attach timestamp in RFC3339 text format. + optional string last_attach_timestamp = 42159653; + + // [Output Only] Last detach timestamp in RFC3339 text format. + optional string last_detach_timestamp = 56471027; + + // Integer license codes indicating which licenses are attached to this disk. + repeated int64 license_codes = 45482664; + + // A list of publicly visible licenses. Reserved for Google's use. + repeated string licenses = 337642578; + + // An opaque location hint used to place the disk close to other resources. This field is for use by internal tools that use the public API. + optional string location_hint = 350519505; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Internal use only. + optional string options = 361137822; + + // Physical block size of the persistent disk, in bytes. If not present in a request, a default value is used. The currently supported size is 4096, other sizes may be added in the future. If an unsupported value is requested, the error message will list the supported values for the caller's project. + optional int64 physical_block_size_bytes = 420007943; + + // Indicates how many IOPS must be provisioned for the disk. + optional int64 provisioned_iops = 186769108; + + // [Output Only] URL of the region where the disk resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // URLs of the zones where the disk should be replicated to. Only applicable for regional resources. + repeated string replica_zones = 48438272; + + // Resource policies applied to this disk for automatic snapshot creations. + repeated string resource_policies = 22220385; + + // [Output Only] Reserved for future use. + optional bool satisfies_pzs = 480964267; + + // [Output Only] Server-defined fully-qualified URL for this resource. + optional string self_link = 456214797; + + // Size, in GB, of the persistent disk. You can specify this field when creating a persistent disk using the sourceImage, sourceSnapshot, or sourceDisk parameter, or specify it alone to create an empty persistent disk. + // + // If you specify this field along with a source, the value of sizeGb must not be less than the size of the source. Acceptable values are 1 to 65536, inclusive. + optional int64 size_gb = 494929369; + + // The source disk used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + // - https://www.googleapis.com/compute/v1/projects/project/regions/region/disks/disk + // - projects/project/zones/zone/disks/disk + // - projects/project/regions/region/disks/disk + // - zones/zone/disks/disk + // - regions/region/disks/disk + optional string source_disk = 451753793; + + // [Output Only] The unique ID of the disk used to create this disk. This value identifies the exact disk that was used to create this persistent disk. For example, if you created the persistent disk from a disk that was later deleted and recreated under the same name, the source disk ID would identify the exact version of the disk that was used. + optional string source_disk_id = 454190809; + + // The source image used to create this disk. If the source image is deleted, this field will not be set. + // + // To create a disk with one of the public operating system images, specify the image by its family name. For example, specify family/debian-9 to use the latest Debian 9 image: + // projects/debian-cloud/global/images/family/debian-9 + // + // + // Alternatively, use a specific version of a public operating system image: + // projects/debian-cloud/global/images/debian-9-stretch-vYYYYMMDD + // + // + // To create a disk with a custom image that you created, specify the image name in the following format: + // global/images/my-custom-image + // + // + // You can also specify a custom image by its image family, which returns the latest version of the image in that family. Replace the image name with family/family-name: + // global/images/family/my-image-family + optional string source_image = 50443319; + + // The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + optional CustomerEncryptionKey source_image_encryption_key = 381503659; + + // [Output Only] The ID value of the image used to create this disk. This value identifies the exact image that was used to create this persistent disk. For example, if you created the persistent disk from an image that was later deleted and recreated under the same name, the source image ID would identify the exact version of the image that was used. + optional string source_image_id = 55328291; + + // The source snapshot used to create this disk. You can provide this as a partial or full URL to the resource. For example, the following are valid values: + // - https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + // - projects/project/global/snapshots/snapshot + // - global/snapshots/snapshot + optional string source_snapshot = 126061928; + + // The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + optional CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + + // [Output Only] The unique ID of the snapshot used to create this disk. This value identifies the exact snapshot that was used to create this persistent disk. For example, if you created the persistent disk from a snapshot that was later deleted and recreated under the same name, the source snapshot ID would identify the exact version of the snapshot that was used. + optional string source_snapshot_id = 98962258; + + // The full Google Cloud Storage URI where the disk image is stored. This file must be a gzip-compressed tarball whose name ends in .tar.gz or virtual machine disk whose name ends in vmdk. Valid URIs may start with gs:// or https://storage.googleapis.com/. This flag is not optimized for creating multiple disks from a source storage object. To create many disks from a source storage object, use gcloud compute images import instead. + optional string source_storage_object = 233052711; + + // [Output Only] The status of disk creation. + // - CREATING: Disk is provisioning. + // - RESTORING: Source data is being copied into the disk. + // - FAILED: Disk creation failed. + // - READY: Disk is ready for use. + // - DELETING: Disk is deleting. + optional Status status = 181260274; + + // URL of the disk type resource describing which disk type to use to create the disk. Provide this when creating the disk. For example: projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + optional string type = 3575610; + + // [Output Only] Links to the users of the disk (attached instances) in form: projects/project/zones/zone/instances/instance + repeated string users = 111578632; + + // [Output Only] URL of the zone where the disk resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string zone = 3744684; + +} + +// +message DisksScopedList { + // [Output Only] A list of disks contained in this scope. + repeated Disk disks = 95594102; + + // [Output Only] Informational warning which replaces the list of disks when the list is empty. + optional Warning warning = 50704284; + +} + +// +message DiskAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of DisksScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#diskAggregatedList for aggregated lists of persistent disks. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// A specification of the desired way to instantiate a disk in the instance template when its created from a source instance. +message DiskInstantiationConfig { + // Specifies whether to include the disk and what image to use. Possible values are: + // - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. + // - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. + // - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. + // - attach-read-only: to attach a read-only disk. Applicable to read-only disks. + // - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. + enum InstantiateFrom { + // A value indicating that the enum field is not set. + UNDEFINED_INSTANTIATE_FROM = 0; + + ATTACH_READ_ONLY = 513775419; + + BLANK = 63281460; + + CUSTOM_IMAGE = 196311789; + + DEFAULT = 115302945; + + DO_NOT_INCLUDE = 104218952; + + SOURCE_IMAGE = 62631959; + + SOURCE_IMAGE_FAMILY = 76850316; + + } + + // Specifies whether the disk will be auto-deleted when the instance is deleted (but not when the disk is detached from the instance). + optional bool auto_delete = 464761403; + + // The custom source image to be used to restore this disk when instantiating this instance template. + optional string custom_image = 184123149; + + // Specifies the device name of the disk to which the configurations apply to. + optional string device_name = 67541716; + + // Specifies whether to include the disk and what image to use. Possible values are: + // - source-image: to use the same image that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. + // - source-image-family: to use the same image family that was used to create the source instance's corresponding disk. Applicable to the boot disk and additional read-write disks. + // - custom-image: to use a user-provided image url for disk creation. Applicable to the boot disk and additional read-write disks. + // - attach-read-only: to attach a read-only disk. Applicable to read-only disks. + // - do-not-include: to exclude a disk from the template. Applicable to additional read-write disks, local SSDs, and read-only disks. + optional InstantiateFrom instantiate_from = 393383903; + +} + +// A list of Disk resources. +message DiskList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Disk resources. + repeated Disk items = 100526016; + + // [Output Only] Type of resource. Always compute#diskList for lists of disks. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message DiskMoveRequest { + // The URL of the destination zone to move the disk. This can be a full or partial URL. For example, the following are all valid URLs to a zone: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone + // - projects/project/zones/zone + // - zones/zone + optional string destination_zone = 131854653; + + // The URL of the target disk to move. This can be a full or partial URL. For example, the following are all valid URLs to a disk: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + // - projects/project/zones/zone/disks/disk + // - zones/zone/disks/disk + optional string target_disk = 62433163; + +} + +// Represents a Disk Type resource. +// +// Google Compute Engine has two Disk Type resources: +// +// * [Regional](/compute/docs/reference/rest/{$api_version}/regionDiskTypes) * [Zonal](/compute/docs/reference/rest/{$api_version}/diskTypes) +// +// You can choose from a variety of disk types based on your needs. For more information, read Storage options. +// +// The diskTypes resource represents disk types for a zonal persistent disk. For more information, read Zonal persistent disks. +// +// The regionDiskTypes resource represents disk types for a regional persistent disk. For more information, read Regional persistent disks. (== resource_for {$api_version}.diskTypes ==) (== resource_for {$api_version}.regionDiskTypes ==) +message DiskType { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] Server-defined default disk size in GB. + optional int64 default_disk_size_gb = 270619253; + + // [Output Only] The deprecation status associated with this disk type. + optional DeprecationStatus deprecated = 515138995; + + // [Output Only] An optional description of this resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#diskType for disk types. + optional string kind = 3292052; + + // [Output Only] Name of the resource. + optional string name = 3373707; + + // [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". + optional string valid_disk_size = 493962464; + + // [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string zone = 3744684; + +} + +// +message DiskTypesScopedList { + // [Output Only] A list of disk types contained in this scope. + repeated DiskType disk_types = 198926167; + + // [Output Only] Informational warning which replaces the list of disk types when the list is empty. + optional Warning warning = 50704284; + +} + +// +message DiskTypeAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of DiskTypesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of disk types. +message DiskTypeList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of DiskType resources. + repeated DiskType items = 100526016; + + // [Output Only] Type of resource. Always compute#diskTypeList for disk types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message DisksAddResourcePoliciesRequest { + // Resource policies to be added to this disk. Currently you can only specify one policy here. + repeated string resource_policies = 22220385; + +} + +// +message DisksRemoveResourcePoliciesRequest { + // Resource policies to be removed from this disk. + repeated string resource_policies = 22220385; + +} + +// +message DisksResizeRequest { + // The new size of the persistent disk, which is specified in GB. + optional int64 size_gb = 494929369; + +} + +// A set of Display Device options +message DisplayDevice { + // Defines whether the instance has Display enabled. + optional bool enable_display = 14266886; + +} + +// +message DistributionPolicyZoneConfiguration { + // The URL of the zone. The zone must exist in the region where the managed instance group is located. + optional string zone = 3744684; + +} + +// +message DistributionPolicy { + // The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). + enum TargetShape { + // A value indicating that the enum field is not set. + UNDEFINED_TARGET_SHAPE = 0; + + ANY = 64972; + + BALANCED = 468409608; + + EVEN = 2140442; + + } + + // The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType). + optional TargetShape target_shape = 338621299; + + // Zones where the regional managed instance group will create and manage its instances. + repeated DistributionPolicyZoneConfiguration zones = 116085319; + +} + +// +message ExchangedPeeringRoute { + // The type of the peering route. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + DYNAMIC_PEERING_ROUTE = 469794858; + + STATIC_PEERING_ROUTE = 473407545; + + SUBNET_PEERING_ROUTE = 465782504; + + } + + // The destination range of the route. + optional string dest_range = 381327712; + + // True if the peering route has been imported from a peer. The actual import happens if the field networkPeering.importCustomRoutes is true for this network, and networkPeering.exportCustomRoutes is true for the peer network, and the import does not result in a route conflict. + optional bool imported = 114502404; + + // The region of peering route next hop, only applies to dynamic routes. + optional string next_hop_region = 122577014; + + // The priority of the peering route. + optional uint32 priority = 445151652; + + // The type of the peering route. + optional Type type = 3575610; + +} + +// +message ExchangedPeeringRoutesList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of ExchangedPeeringRoute resources. + repeated ExchangedPeeringRoute items = 100526016; + + // [Output Only] Type of resource. Always compute#exchangedPeeringRoutesList for exchanged peering routes lists. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// The interface for the external VPN gateway. +message ExternalVpnGatewayInterface { + // The numeric ID of this interface. The allowed input values for this id for different redundancy types of external VPN gateway: SINGLE_IP_INTERNALLY_REDUNDANT - 0 TWO_IPS_REDUNDANCY - 0, 1 FOUR_IPS_REDUNDANCY - 0, 1, 2, 3 + optional uint32 id = 3355; + + // IP address of the interface in the external VPN gateway. Only IPv4 is supported. This IP address can be either from your on-premise gateway or another Cloud provider's VPN gateway, it cannot be an IP address from Google Compute Engine. + optional string ip_address = 406272220; + +} + +// Represents an external VPN gateway. +// +// External VPN gateway is the on-premises VPN gateway(s) or another cloud provider's VPN gateway that connects to your Google Cloud VPN gateway. +// +// To create a highly available VPN from Google Cloud Platform to your VPN gateway or another cloud provider's VPN gateway, you must create a external VPN gateway resource with information about the other gateway. +// +// For more information about using external VPN gateways, see Creating an HA VPN gateway and tunnel pair to a peer VPN. (== resource_for {$api_version}.externalVpnGateways ==) +message ExternalVpnGateway { + // Indicates the user-supplied redundancy type of this external VPN gateway. + enum RedundancyType { + // A value indicating that the enum field is not set. + UNDEFINED_REDUNDANCY_TYPE = 0; + + FOUR_IPS_REDUNDANCY = 520087913; + + SINGLE_IP_INTERNALLY_REDUNDANT = 133914873; + + TWO_IPS_REDUNDANCY = 367049635; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // List of interfaces for this external VPN gateway. + repeated ExternalVpnGatewayInterface interfaces = 12073562; + + // [Output Only] Type of the resource. Always compute#externalVpnGateway for externalVpnGateways. + optional string kind = 3292052; + + // A fingerprint for the labels being applied to this ExternalVpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve an ExternalVpnGateway. + optional string label_fingerprint = 178124825; + + // Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty. + map labels = 500195327; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Indicates the user-supplied redundancy type of this external VPN gateway. + optional RedundancyType redundancy_type = 271443740; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + +} + +// Response to the list request, and contains a list of externalVpnGateways. +message ExternalVpnGatewayList { + optional string etag = 3123477; + + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of ExternalVpnGateway resources. + repeated ExternalVpnGateway items = 100526016; + + // [Output Only] Type of resource. Always compute#externalVpnGatewayList for lists of externalVpnGateways. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message FileContentBuffer { + // The file type of source file. + enum FileType { + // A value indicating that the enum field is not set. + UNDEFINED_FILE_TYPE = 0; + + BIN = 65767; + + UNDEFINED = 137851184; + + X509 = 2674086; + + } + + // The raw content in the secure keys file. + optional string content = 414659705; + + // The file type of source file. + optional FileType file_type = 294346781; + +} + +// +message Allowed { + // The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + optional string I_p_protocol = 488094525; + + // An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + // + // Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + repeated string ports = 106854418; + +} + +// +message Denied { + // The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. + optional string I_p_protocol = 488094525; + + // An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + // + // Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + repeated string ports = 106854418; + +} + +// The available logging options for a firewall rule. +message FirewallLogConfig { + // This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. + enum Metadata { + // A value indicating that the enum field is not set. + UNDEFINED_METADATA = 0; + + EXCLUDE_ALL_METADATA = 334519954; + + INCLUDE_ALL_METADATA = 164619908; + + } + + // This field denotes whether to enable logging for a particular firewall rule. + optional bool enable = 311764355; + + // This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. + optional Metadata metadata = 86866735; + +} + +// Represents a Firewall Rule resource. +// +// Firewall rules allow or deny ingress traffic to, and egress traffic from your instances. For more information, read Firewall rules. +message Firewall { + // Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `INGRESS` traffic, you cannot specify the destinationRanges field, and for `EGRESS` traffic, you cannot specify the sourceRanges or sourceTags fields. + enum Direction { + // A value indicating that the enum field is not set. + UNDEFINED_DIRECTION = 0; + + EGRESS = 432880501; + + INGRESS = 516931221; + + } + + // The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. + repeated Allowed allowed = 162398632; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. + repeated Denied denied = 275217307; + + // An optional description of this resource. Provide this field when you create the resource. + optional string description = 422937596; + + // If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. + repeated string destination_ranges = 305699879; + + // Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `INGRESS` traffic, you cannot specify the destinationRanges field, and for `EGRESS` traffic, you cannot specify the sourceRanges or sourceTags fields. + optional Direction direction = 111150975; + + // Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. + optional bool disabled = 270940796; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#firewall for firewall rules. + optional string kind = 3292052; + + // This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Cloud Logging. + optional FirewallLogConfig log_config = 351299741; + + // Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + optional string name = 3373707; + + // URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: + // global/networks/default + // If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + // - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + // - projects/myproject/global/networks/my-network + // - global/networks/default + optional string network = 232872494; + + // Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. + optional int32 priority = 445151652; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Only IPv4 is supported. + repeated string source_ranges = 200097658; + + // If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. + repeated string source_service_accounts = 105100756; + + // If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. + repeated string source_tags = 452222397; + + // A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. + repeated string target_service_accounts = 457639710; + + // A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. + repeated string target_tags = 62901767; + +} + +// Contains a list of firewalls. +message FirewallList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Firewall resources. + repeated Firewall items = 100526016; + + // [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message FirewallPolicyAssociation { + // The target that the firewall policy is attached to. + optional string attachment_target = 175773741; + + // [Output Only] Deprecated, please use short name instead. The display name of the firewall policy of the association. + optional string display_name = 4473832; + + // [Output Only] The firewall policy ID of the association. + optional string firewall_policy_id = 357211849; + + // The name for an association. + optional string name = 3373707; + + // [Output Only] The short name of the firewall policy of the association. + optional string short_name = 492051566; + +} + +// +message FirewallPoliciesListAssociationsResponse { + // A list of associations. + repeated FirewallPolicyAssociation associations = 508736530; + + // [Output Only] Type of firewallPolicy associations. Always compute#FirewallPoliciesListAssociations for lists of firewallPolicy associations. + optional string kind = 3292052; + +} + +// Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny). +message FirewallPolicyRule { + // The direction in which this rule applies. + enum Direction { + // A value indicating that the enum field is not set. + UNDEFINED_DIRECTION = 0; + + EGRESS = 432880501; + + INGRESS = 516931221; + + } + + // The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502. + optional string action = 187661878; + + // An optional description for this resource. + optional string description = 422937596; + + // The direction in which this rule applies. + optional Direction direction = 111150975; + + // Denotes whether the firewall policy rule is disabled. When set to true, the firewall policy rule is not enforced and traffic behaves as if it did not exist. If this is unspecified, the firewall policy rule will be enabled. + optional bool disabled = 270940796; + + // Denotes whether to enable logging for a particular rule. If logging is enabled, logs will be exported to the configured export destination in Stackdriver. Logs may be exported to BigQuery or Pub/Sub. Note: you cannot enable logging on "goto_next" rules. + optional bool enable_logging = 295396515; + + // [Output only] Type of the resource. Always compute#firewallPolicyRule for firewall policy rules + optional string kind = 3292052; + + // A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + optional FirewallPolicyRuleMatcher match = 103668165; + + // An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. + optional int32 priority = 445151652; + + // [Output Only] Calculation of the complexity of a single firewall policy rule. + optional int32 rule_tuple_count = 388342037; + + // A list of network resource URLs to which this rule applies. This field allows you to control which network's VMs get this rule. If this field is left blank, all VMs within the organization will receive the rule. + repeated string target_resources = 528230647; + + // A list of service accounts indicating the sets of instances that are applied with this rule. + repeated string target_service_accounts = 457639710; + +} + +// Represents a Firewall Policy resource. (== resource_for {$api_version}.firewallPolicies ==) +message FirewallPolicy { + // A list of associations that belong to this firewall policy. + repeated FirewallPolicyAssociation associations = 508736530; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Depreacted, please use short name instead. User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string display_name = 4473832; + + // Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make get() request to the firewall policy. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output only] Type of the resource. Always compute#firewallPolicyfor firewall policies + optional string kind = 3292052; + + // [Output Only] Name of the resource. It is a numeric ID allocated by GCP which uniquely identifies the Firewall Policy. + optional string name = 3373707; + + // [Output Only] The parent of the firewall policy. + optional string parent = 78317738; + + // [Output Only] Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples. + optional int32 rule_tuple_count = 388342037; + + // A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a firewall policy, a default rule with action "allow" will be added. + repeated FirewallPolicyRule rules = 108873975; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] Server-defined URL for this resource with the resource id. + optional string self_link_with_id = 44520962; + + // User-provided name of the Organization firewall plicy. The name should be unique in the organization in which the firewall policy is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string short_name = 492051566; + +} + +// +message FirewallPolicyList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of FirewallPolicy resources. + repeated FirewallPolicy items = 100526016; + + // [Output Only] Type of resource. Always compute#firewallPolicyList for listsof FirewallPolicies + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. +message FirewallPolicyRuleMatcher { + // CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 256. + repeated string dest_ip_ranges = 337357713; + + // Pairs of IP protocols and ports that the rule should match. + repeated FirewallPolicyRuleMatcherLayer4Config layer4_configs = 373534261; + + // CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 256. + repeated string src_ip_ranges = 432128083; + +} + +// +message FirewallPolicyRuleMatcherLayer4Config { + // The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp), or the IP protocol number. + optional string ip_protocol = 475958960; + + // An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. + // + // Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. + repeated string ports = 106854418; + +} + +// Opaque filter criteria used by loadbalancers to restrict routing configuration to a limited set of loadbalancing proxies. Proxies and sidecars involved in loadbalancing would typically present metadata to the loadbalancers which need to match criteria specified here. If a match takes place, the relevant configuration is made available to those proxies. +// For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. +// An example for using metadataFilters would be: if loadbalancing involves Envoys, they will only receive routing configuration when values in metadataFilters match values supplied in labels = 500195327; + + // Specifies the forwarding rule type. + // + // + // - EXTERNAL is used for: + // - Classic Cloud VPN gateways + // - Protocol forwarding to VMs from an external IP address + // - HTTP(S), SSL Proxy, TCP Proxy, and Network Load Balancing + // - INTERNAL is used for: + // - Protocol forwarding to VMs from an internal IP address + // - Internal TCP/UDP Load Balancing + // - INTERNAL_MANAGED is used for: + // - Internal HTTP(S) Load Balancing + // - INTERNAL_SELF_MANAGED is used for: + // - Traffic Director + // + // For more information about forwarding rules, refer to Forwarding rule concepts. + optional LoadBalancingScheme load_balancing_scheme = 363890244; + + // Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. When there is a match, the relevant configuration is made available to those proxies. Otherwise, all the resources (e.g. TargetHttpProxy, UrlMap) referenced by the ForwardingRule will not be visible to those proxies. + // For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadataFilters are specified, all of them need to be satisfied in order to be considered a match. + // metadataFilters specified here will be applifed before those specified in the UrlMap that this ForwardingRule references. + // metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + repeated MetadataFilter metadata_filters = 464725739; + + // Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // This field is not used for external load balancing. + // + // For Internal TCP/UDP Load Balancing, this field identifies the network that the load balanced IP should belong to for this Forwarding Rule. If this field is not specified, the default network will be used. + // + // For Private Service Connect forwarding rules that forward traffic to Google APIs, a network must be provided. + optional string network = 232872494; + + // This signifies the networking tier used for configuring this load balancer and can only take the following values: PREMIUM, STANDARD. + // + // For regional ForwardingRule, the valid values are PREMIUM and STANDARD. For GlobalForwardingRule, the valid value is PREMIUM. + // + // If this field is not specified, it is assumed to be PREMIUM. If IPAddress is specified, this value must be equal to the networkTier of the Address. + optional NetworkTier network_tier = 517397843; + + // This field can be used only if: * Load balancing scheme is one of EXTERNAL, INTERNAL_SELF_MANAGED or INTERNAL_MANAGED, and * IPProtocol is one of TCP, UDP, or SCTP. + // + // Packets addressed to ports in the specified range will be forwarded to target or backend_service. You can only use one of ports, port_range, or allPorts. The three are mutually exclusive. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges. + // + // Some types of forwarding target have constraints on the acceptable ports: + // - TargetHttpProxy: 80, 8080 + // - TargetHttpsProxy: 443 + // - TargetGrpcProxy: no constraints + // - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 + // - TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 + // - TargetVpnGateway: 500, 4500 + optional string port_range = 217518079; + + // The ports field is only supported when the forwarding rule references a backend_service directly. Supported load balancing products are Internal TCP/UDP Load Balancing and Network Load Balancing. Only packets addressed to the specified list of ports are forwarded to backends. + // + // You can only use one of ports and port_range, or allPorts. The three are mutually exclusive. + // + // You can specify a list of up to five ports, which can be non-contiguous. + // + // For Internal TCP/UDP Load Balancing, if you specify allPorts, you should not specify ports. + // + // For more information, see [Port specifications](/load-balancing/docs/forwarding-rule-concepts#port_specifications). + repeated string ports = 106854418; + + // [Output Only] The PSC connection id of the PSC Forwarding Rule. + optional uint64 psc_connection_id = 292082397; + + // [Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Service Directory resources to register this forwarding rule with. Currently, only supports a single Service Directory resource. + // + // It is only supported for Internal TCP/UDP Load Balancing and Internal HTTP(S) Load Balancing. + repeated ForwardingRuleServiceDirectoryRegistration service_directory_registrations = 223549694; + + // An optional prefix to the service name for this Forwarding Rule. If specified, the prefix is the first label of the fully qualified service name. + // + // The label must be 1-63 characters long, and comply with RFC1035. Specifically, the label must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + // + // This field is only used for internal load balancing. + optional string service_label = 417008874; + + // [Output Only] The internal fully qualified service name for this Forwarding Rule. + // + // This field is only used for internal load balancing. + optional string service_name = 359880149; + + // This field is only used for internal load balancing. + // + // For internal load balancing, this field identifies the subnetwork that the load balanced IP should belong to for this Forwarding Rule. + // + // If the network specified is in auto subnet mode, this field is optional. However, if the network is in custom subnet mode, a subnetwork must be specified. + optional string subnetwork = 307827694; + + optional string target = 192835985; + +} + +// +message ForwardingRulesScopedList { + // A list of forwarding rules contained in this scope. + repeated ForwardingRule forwarding_rules = 315821365; + + // Informational warning which replaces the list of forwarding rules when the list is empty. + optional Warning warning = 50704284; + +} + +// +message ForwardingRuleAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of ForwardingRulesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList for lists of forwarding rules. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of ForwardingRule resources. +message ForwardingRuleList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of ForwardingRule resources. + repeated ForwardingRule items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message ForwardingRuleReference { + optional string forwarding_rule = 269964030; + +} + +// +message GRPCHealthCheck { + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, gRPC health check follows behavior specified in port and portName fields. + enum PortSpecification { + // A value indicating that the enum field is not set. + UNDEFINED_PORT_SPECIFICATION = 0; + + USE_FIXED_PORT = 190235748; + + USE_NAMED_PORT = 349300671; + + USE_SERVING_PORT = 362637516; + + } + + // The gRPC service name for the health check. This field is optional. The value of grpc_service_name has the following meanings by convention: + // - Empty service_name means the overall status of all services at the backend. + // - Non-empty service_name means the health of that gRPC service, as defined by the owner of the service. + // The grpc_service_name can only be ASCII. + optional string grpc_service_name = 136533078; + + // The port number for the health check request. Must be specified if port_name and port_specification are not set or if port_specification is USE_FIXED_PORT. Valid values are 1 through 65535. + optional int32 port = 3446913; + + // Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. The port_name should conform to RFC1035. + optional string port_name = 41534345; + + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, gRPC health check follows behavior specified in port and portName fields. + optional PortSpecification port_specification = 51590597; + +} + +// The network endpoint. +message NetworkEndpoint { + // Metadata defined as annotations on the network endpoint. + map annotations = 112032548; + + // Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. + optional string fqdn = 3150485; + + // The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group. + // + // The name must be 1-63 characters long, and comply with RFC1035. + optional string instance = 18257045; + + // Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. + optional string ip_address = 406272220; + + // Optional port number of network endpoint. If not specified, the defaultPort for the network endpoint group will be used. + optional int32 port = 3446913; + +} + +// +message GlobalNetworkEndpointGroupsAttachEndpointsRequest { + // The list of network endpoints to be attached. + repeated NetworkEndpoint network_endpoints = 149850285; + +} + +// +message GlobalNetworkEndpointGroupsDetachEndpointsRequest { + // The list of network endpoints to be detached. + repeated NetworkEndpoint network_endpoints = 149850285; + +} + +// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. +// +// +// +// A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. +// +// For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). +// +// **JSON example:** +// +// { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } +// +// **YAML example:** +// +// bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3 +// +// For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). +message Policy { + // Specifies cloud audit logging configuration for this policy. + repeated AuditConfig audit_configs = 328080653; + + // Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member. + repeated Binding bindings = 403251854; + + // `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. + // + // **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + optional string etag = 3123477; + + optional bool iam_owned = 450566203; + + // If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied. + repeated Rule rules = 108873975; + + // Specifies the format of the policy. + // + // Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. + // + // Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: + // + // * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions + // + // **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + // + // If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. + // + // To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + optional int32 version = 351608024; + +} + +// +message GlobalOrganizationSetPolicyRequest { + // Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + repeated Binding bindings = 403251854; + + // Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + optional string etag = 3123477; + + // 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 in general a valid policy but certain services (like Projects) might reject them. + optional Policy policy = 91071794; + +} + +// +message GlobalSetLabelsRequest { + // The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint. + optional string label_fingerprint = 178124825; + + // A list of labels to apply for this resource. Each label key & value must comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": ""). + map labels = 500195327; + +} + +// +message GlobalSetPolicyRequest { + // Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify bindings. + repeated Binding bindings = 403251854; + + // Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + optional string etag = 3123477; + + // 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 in general a valid policy but certain services (like Projects) might reject them. + optional Policy policy = 91071794; + +} + +// Array of guest attribute namespace/key/value tuples. +message GuestAttributesValue { + repeated GuestAttributesEntry items = 100526016; + +} + +// A guest attributes entry. +message GuestAttributes { + // [Output Only] Type of the resource. Always compute#guestAttributes for guest attributes entry. + optional string kind = 3292052; + + // The path to be queried. This can be the default namespace ('/') or a nested namespace ('/\/') or a specified key ('/\/\') + optional string query_path = 368591164; + + // [Output Only] The value of the requested queried path. + optional GuestAttributesValue query_value = 157570874; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // The key to search for. + optional string variable_key = 164364828; + + // [Output Only] The value found for the requested key. + optional string variable_value = 124582382; + +} + +// A guest attributes namespace/key/value entry. +message GuestAttributesEntry { + // Key for the guest attribute entry. + optional string key = 106079; + + // Namespace for the guest attribute entry. + optional string namespace = 178476379; + + // Value for the guest attribute entry. + optional string value = 111972721; + +} + +// +message HTTP2HealthCheck { + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, HTTP2 health check follows behavior specified in port and portName fields. + enum PortSpecification { + // A value indicating that the enum field is not set. + UNDEFINED_PORT_SPECIFICATION = 0; + + USE_FIXED_PORT = 190235748; + + USE_NAMED_PORT = 349300671; + + USE_SERVING_PORT = 362637516; + + } + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // The value of the host header in the HTTP/2 health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. + optional string host = 3208616; + + // The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. + optional int32 port = 3446913; + + // Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + optional string port_name = 41534345; + + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, HTTP2 health check follows behavior specified in port and portName fields. + optional PortSpecification port_specification = 51590597; + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + optional ProxyHeader proxy_header = 160374142; + + // The request path of the HTTP/2 health check request. The default value is /. + optional string request_path = 229403605; + + // The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. + optional string response = 196547649; + +} + +// +message HTTPHealthCheck { + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, HTTP health check follows behavior specified in port and portName fields. + enum PortSpecification { + // A value indicating that the enum field is not set. + UNDEFINED_PORT_SPECIFICATION = 0; + + USE_FIXED_PORT = 190235748; + + USE_NAMED_PORT = 349300671; + + USE_SERVING_PORT = 362637516; + + } + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // The value of the host header in the HTTP health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. + optional string host = 3208616; + + // The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. + optional int32 port = 3446913; + + // Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + optional string port_name = 41534345; + + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, HTTP health check follows behavior specified in port and portName fields. + optional PortSpecification port_specification = 51590597; + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + optional ProxyHeader proxy_header = 160374142; + + // The request path of the HTTP health check request. The default value is /. + optional string request_path = 229403605; + + // The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. + optional string response = 196547649; + +} + +// +message HTTPSHealthCheck { + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, HTTPS health check follows behavior specified in port and portName fields. + enum PortSpecification { + // A value indicating that the enum field is not set. + UNDEFINED_PORT_SPECIFICATION = 0; + + USE_FIXED_PORT = 190235748; + + USE_NAMED_PORT = 349300671; + + USE_SERVING_PORT = 362637516; + + } + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // The value of the host header in the HTTPS health check request. If left empty (default value), the IP on behalf of which this health check is performed will be used. + optional string host = 3208616; + + // The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. + optional int32 port = 3446913; + + // Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + optional string port_name = 41534345; + + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, HTTPS health check follows behavior specified in port and portName fields. + optional PortSpecification port_specification = 51590597; + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + optional ProxyHeader proxy_header = 160374142; + + // The request path of the HTTPS health check request. The default value is /. + optional string request_path = 229403605; + + // The string to match anywhere in the first 1024 bytes of the response body. If left empty (the default value), the status code determines health. The response data can only be ASCII. + optional string response = 196547649; + +} + +// Configuration of logging on a health check. If logging is enabled, logs will be exported to Stackdriver. +message HealthCheckLogConfig { + // Indicates whether or not to export logs. This is false by default, which means no health check logging will be done. + optional bool enable = 311764355; + +} + +// +message SSLHealthCheck { + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, SSL health check follows behavior specified in port and portName fields. + enum PortSpecification { + // A value indicating that the enum field is not set. + UNDEFINED_PORT_SPECIFICATION = 0; + + USE_FIXED_PORT = 190235748; + + USE_NAMED_PORT = 349300671; + + USE_SERVING_PORT = 362637516; + + } + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // The TCP port number for the health check request. The default value is 443. Valid values are 1 through 65535. + optional int32 port = 3446913; + + // Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + optional string port_name = 41534345; + + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, SSL health check follows behavior specified in port and portName fields. + optional PortSpecification port_specification = 51590597; + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + optional ProxyHeader proxy_header = 160374142; + + // The application data to send once the SSL connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. + optional string request = 21951119; + + // The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. + optional string response = 196547649; + +} + +// +message TCPHealthCheck { + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, TCP health check follows behavior specified in port and portName fields. + enum PortSpecification { + // A value indicating that the enum field is not set. + UNDEFINED_PORT_SPECIFICATION = 0; + + USE_FIXED_PORT = 190235748; + + USE_NAMED_PORT = 349300671; + + USE_SERVING_PORT = 362637516; + + } + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // The TCP port number for the health check request. The default value is 80. Valid values are 1 through 65535. + optional int32 port = 3446913; + + // Port name as defined in InstanceGroup#NamedPort#name. If both port and port_name are defined, port takes precedence. + optional string port_name = 41534345; + + // Specifies how port is selected for health checking, can be one of following values: + // USE_FIXED_PORT: The port number in port is used for health checking. + // USE_NAMED_PORT: The portName is used for health checking. + // USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. + // + // + // If not specified, TCP health check follows behavior specified in port and portName fields. + optional PortSpecification port_specification = 51590597; + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + optional ProxyHeader proxy_header = 160374142; + + // The application data to send once the TCP connection has been established (default value is empty). If both request and response are empty, the connection establishment alone will indicate health. The request data can only be ASCII. + optional string request = 21951119; + + // The bytes to match against the beginning of the response data. If left empty (the default value), any response will indicate health. The response data can only be ASCII. + optional string response = 196547649; + +} + +// Represents a Health Check resource. +// +// Google Compute Engine has two Health Check resources: +// +// * [Global](/compute/docs/reference/rest/{$api_version}/healthChecks) * [Regional](/compute/docs/reference/rest/{$api_version}/regionHealthChecks) +// +// Internal HTTP(S) load balancers must use regional health checks (`compute.v1.regionHealthChecks`). +// +// Traffic Director must use global health checks (`compute.v1.HealthChecks`). +// +// Internal TCP/UDP load balancers can use either regional or global health checks (`compute.v1.regionHealthChecks` or `compute.v1.HealthChecks`). +// +// External HTTP(S), TCP proxy, and SSL proxy load balancers as well as managed instance group auto-healing must use global health checks (`compute.v1.HealthChecks`). +// +// Network load balancers must use legacy HTTP health checks (httpHealthChecks). +// +// For more information, see Health checks overview. +message HealthCheck { + // Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of the protocol-specific health check field must be specified, which must match type field. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + GRPC = 2196510; + + HTTP = 2228360; + + HTTP2 = 69079210; + + HTTPS = 69079243; + + INVALID = 530283991; + + SSL = 82412; + + TCP = 82881; + + } + + // How often (in seconds) to send a health check. The default value is 5 seconds. + optional int32 check_interval_sec = 345561006; + + // [Output Only] Creation timestamp in 3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + optional GRPCHealthCheck grpc_health_check = 85529574; + + // A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. + optional int32 healthy_threshold = 403212361; + + optional HTTP2HealthCheck http2_health_check = 11360986; + + optional HTTPHealthCheck http_health_check = 412586940; + + optional HTTPSHealthCheck https_health_check = 436046905; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // Type of the resource. + optional string kind = 3292052; + + // Configure logging on this health check. + optional HealthCheckLogConfig log_config = 351299741; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. For example, a name that is 1-63 characters long, matches the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. + optional string name = 3373707; + + // [Output Only] Region where the health check resides. Not applicable to global health checks. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + optional SSLHealthCheck ssl_health_check = 280032440; + + optional TCPHealthCheck tcp_health_check = 469980419; + + // How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. + optional int32 timeout_sec = 79994995; + + // Specifies the type of the healthCheck, either TCP, SSL, HTTP, HTTPS or HTTP2. If not specified, the default is TCP. Exactly one of the protocol-specific health check field must be specified, which must match type field. + optional Type type = 3575610; + + // A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. + optional int32 unhealthy_threshold = 227958480; + +} + +// Contains a list of HealthCheck resources. +message HealthCheckList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of HealthCheck resources. + repeated HealthCheck items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// A full or valid partial URL to a health check. For example, the following are valid URLs: +// - https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check +// - projects/project-id/global/httpHealthChecks/health-check +// - global/httpHealthChecks/health-check +message HealthCheckReference { + optional string health_check = 308876645; + +} + +// Represents a Health-Check as a Service resource. +// +// (== resource_for {$api_version}.regionHealthCheckServices ==) +message HealthCheckService { + // Optional. Policy for how the results from multiple health checks for the same endpoint are aggregated. Defaults to NO_AGGREGATION if unspecified. + // - NO_AGGREGATION. An EndpointHealth message is returned for each backend in the health check service. + // - AND. If any backend's health check reports UNHEALTHY, then UNHEALTHY is the HealthState of the entire health check service. If all backend's are healthy, the HealthState of the health check service is HEALTHY. . + enum HealthStatusAggregationPolicy { + // A value indicating that the enum field is not set. + UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY = 0; + + AND = 64951; + + NO_AGGREGATION = 426445124; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a HealthCheckService. An up-to-date fingerprint must be provided in order to patch/update the HealthCheckService; Otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the HealthCheckService. + optional string fingerprint = 234678500; + + // List of URLs to the HealthCheck resources. Must have at least one HealthCheck, and not more than 10. HealthCheck resources must have portSpecification=USE_SERVING_PORT. For regional HealthCheckService, the HealthCheck must be regional and in the same region. For global HealthCheckService, HealthCheck must be global. Mix of regional and global HealthChecks is not supported. Multiple regional HealthChecks must belong to the same region. Regional HealthChecks items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message HealthStatusForNetworkEndpoint { + // Health state of the network endpoint determined based on the health checks configured. + enum HealthState { + // A value indicating that the enum field is not set. + UNDEFINED_HEALTH_STATE = 0; + + DRAINING = 480455402; + + HEALTHY = 439801213; + + UNHEALTHY = 462118084; + + UNKNOWN = 433141802; + + } + + // URL of the backend service associated with the health state of the network endpoint. + optional BackendServiceReference backend_service = 306946058; + + // URL of the forwarding rule associated with the health state of the network endpoint. + optional ForwardingRuleReference forwarding_rule = 269964030; + + // URL of the health check associated with the health state of the network endpoint. + optional HealthCheckReference health_check = 308876645; + + // URL of the health check service associated with the health state of the network endpoint. + optional HealthCheckServiceReference health_check_service = 408374747; + + // Health state of the network endpoint determined based on the health checks configured. + optional HealthState health_state = 324007150; + +} + +// UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService. +message HostRule { + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // The list of host patterns to match. They must be valid hostnames with optional port numbers in the format host:port. * matches any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or .. + // * based matching is not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + repeated string hosts = 99467211; + + // The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion. + optional string path_matcher = 337813272; + +} + +// Specification for how requests are aborted as part of fault injection. +message HttpFaultAbort { + // The HTTP status code used to abort the request. + // The value must be between 200 and 599 inclusive. + optional uint32 http_status = 468949897; + + // The percentage of traffic (connections/operations/requests) which will be aborted as part of fault injection. + // The value must be between 0.0 and 100.0 inclusive. + optional double percentage = 151909018; + +} + +// Specifies the delay introduced by Loadbalancer before forwarding the request to the backend service as part of fault injection. +message HttpFaultDelay { + // Specifies the value of the fixed delay interval. + optional Duration fixed_delay = 317037816; + + // The percentage of traffic (connections/operations/requests) on which delay will be introduced as part of fault injection. + // The value must be between 0.0 and 100.0 inclusive. + optional double percentage = 151909018; + +} + +// The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. +message HttpFaultInjection { + // The specification for how client requests are aborted as part of fault injection. + optional HttpFaultAbort abort = 92611376; + + // The specification for how client requests are delayed as part of fault injection, before being sent to a backend service. + optional HttpFaultDelay delay = 95467907; + +} + +// Specification determining how headers are added to requests or responses. +message HttpHeaderOption { + // The name of the header. + optional string header_name = 110223613; + + // The value of the header to add. + optional string header_value = 203094335; + + // If false, headerValue is appended to any values that already exist for the header. If true, headerValue is set for the header, discarding any values that were set for that header. + // The default value is false. + optional bool replace = 20755124; + +} + +// The request and response header transformations that take effect before the request is passed along to the selected backendService. +message HttpHeaderAction { + // Headers to add to a matching request prior to forwarding the request to the backendService. + repeated HttpHeaderOption request_headers_to_add = 72111974; + + // A list of header names for headers that need to be removed from the request prior to forwarding the request to the backendService. + repeated string request_headers_to_remove = 218425247; + + // Headers to add the response prior to sending the response back to the client. + repeated HttpHeaderOption response_headers_to_add = 32136052; + + // A list of header names for headers that need to be removed from the response prior to sending the response back to the client. + repeated string response_headers_to_remove = 75415761; + +} + +// HttpRouteRuleMatch criteria for field values that must stay within the specified integer range. +message Int64RangeMatch { + // The end of the range (exclusive) in signed long integer format. + optional int64 range_end = 322439897; + + // The start of the range (inclusive) in signed long integer format. + optional int64 range_start = 103333600; + +} + +// matchRule criteria for request header matches. +message HttpHeaderMatch { + // The value should exactly match contents of exactMatch. + // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + optional string exact_match = 457641093; + + // The name of the HTTP header to match. + // For matching against the HTTP request's authority, use a headerMatch with the header name ":authority". + // For matching a request's method, use the headerName ":method". + // When the URL map is bound to target gRPC proxy that has validateForProxyless field set to true, only non-binary user-specified custom metadata and the `content-type` header are supported. The following transport-level headers cannot be used in header matching rules: `:authority`, `:method`, `:path`, `:scheme`, `user-agent`, `accept-encoding`, `content-encoding`, `grpc-accept-encoding`, `grpc-encoding`, `grpc-previous-rpc-attempts`, `grpc-tags-bin`, `grpc-timeout` and `grpc-trace-bin. + optional string header_name = 110223613; + + // If set to false, the headerMatch is considered a match if the match criteria above are met. If set to true, the headerMatch is considered a match if the match criteria above are NOT met. + // The default setting is false. + optional bool invert_match = 501130268; + + // The value of the header must start with the contents of prefixMatch. + // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + optional string prefix_match = 257898968; + + // A header with the contents of headerName must exist. The match takes place whether or not the request's header has a value. + // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + optional bool present_match = 67435841; + + // The header value must be an integer and its value must be in the range specified in rangeMatch. If the header does not contain an integer, number or is empty, the match fails. + // For example for a range [-5, 0] + // - -3 will match. + // - 0 will not match. + // - 0.25 will not match. + // - -3someString will not match. + // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + // Note that rangeMatch is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. + optional Int64RangeMatch range_match = 97244227; + + // The value of the header must match the regular expression specified in regexMatch. For regular expression grammar, please see: github.com/google/re2/wiki/Syntax + // For matching against a port specified in the HTTP request, use a headerMatch with headerName set to PORT and a regular expression that satisfies the RFC2616 Host header's port specifier. + // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + // Note that regexMatch only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + optional string regex_match = 107387853; + + // The value of the header must end with the contents of suffixMatch. + // Only one of exactMatch, prefixMatch, suffixMatch, regexMatch, presentMatch or rangeMatch must be set. + optional string suffix_match = 426488663; + +} + +// HttpRouteRuleMatch criteria for a request's query parameter. +message HttpQueryParameterMatch { + // The queryParameterMatch matches if the value of the parameter exactly matches the contents of exactMatch. + // Only one of presentMatch, exactMatch or regexMatch must be set. + optional string exact_match = 457641093; + + // The name of the query parameter to match. The query parameter must exist in the request, in the absence of which the request match fails. + optional string name = 3373707; + + // Specifies that the queryParameterMatch matches if the request contains the query parameter, irrespective of whether the parameter has a value or not. + // Only one of presentMatch, exactMatch or regexMatch must be set. + optional bool present_match = 67435841; + + // The queryParameterMatch matches if the value of the parameter matches the regular expression specified by regexMatch. For the regular expression grammar, please see github.com/google/re2/wiki/Syntax + // Only one of presentMatch, exactMatch or regexMatch must be set. + // Note that regexMatch only applies when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED. + optional string regex_match = 107387853; + +} + +// Specifies settings for an HTTP redirect. +message HttpRedirectAction { + // The HTTP Status code to use for this RedirectAction. + // Supported values are: + // - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301. + // - FOUND, which corresponds to 302. + // - SEE_OTHER which corresponds to 303. + // - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method will be retained. + // - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. + enum RedirectResponseCode { + // A value indicating that the enum field is not set. + UNDEFINED_REDIRECT_RESPONSE_CODE = 0; + + FOUND = 67084130; + + MOVED_PERMANENTLY_DEFAULT = 386698449; + + PERMANENT_REDIRECT = 382006381; + + SEE_OTHER = 445380580; + + TEMPORARY_REDIRECT = 489550378; + + } + + // The host that will be used in the redirect response instead of the one that was supplied in the request. + // The value must be between 1 and 255 characters. + optional string host_redirect = 107417747; + + // If set to true, the URL scheme in the redirected request is set to https. If set to false, the URL scheme of the redirected request will remain the same as that of the request. + // This must only be set for UrlMaps used in TargetHttpProxys. Setting this true for TargetHttpsProxy is not permitted. + // The default is set to false. + optional bool https_redirect = 170260656; + + // The path that will be used in the redirect response instead of the one that was supplied in the request. + // pathRedirect cannot be supplied together with prefixRedirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect. + // The value must be between 1 and 1024 characters. + optional string path_redirect = 272342710; + + // The prefix that replaces the prefixMatch specified in the HttpRouteRuleMatch, retaining the remaining portion of the URL before redirecting the request. + // prefixRedirect cannot be supplied together with pathRedirect. Supply one alone or neither. If neither is supplied, the path of the original request will be used for the redirect. + // The value must be between 1 and 1024 characters. + optional string prefix_redirect = 446184169; + + // The HTTP Status code to use for this RedirectAction. + // Supported values are: + // - MOVED_PERMANENTLY_DEFAULT, which is the default value and corresponds to 301. + // - FOUND, which corresponds to 302. + // - SEE_OTHER which corresponds to 303. + // - TEMPORARY_REDIRECT, which corresponds to 307. In this case, the request method will be retained. + // - PERMANENT_REDIRECT, which corresponds to 308. In this case, the request method will be retained. + optional RedirectResponseCode redirect_response_code = 436710408; + + // If set to true, any accompanying query portion of the original URL is removed prior to redirecting the request. If set to false, the query portion of the original URL is retained. + // The default is set to false. + optional bool strip_query = 52284641; + +} + +// The retry policy associates with HttpRouteRule +message HttpRetryPolicy { + // Specifies the allowed number retries. This number must be > 0. If not specified, defaults to 1. + optional uint32 num_retries = 251680141; + + // Specifies a non-zero timeout per retry attempt. + // If not specified, will use the timeout set in HttpRouteAction. If timeout in HttpRouteAction is not set, will use the largest timeout among all backend services associated with the route. + optional Duration per_try_timeout = 280041147; + + // Specfies one or more conditions when this retry rule applies. Valid values are: + // - 5xx: Loadbalancer will attempt a retry if the backend service responds with any 5xx response code, or if the backend service does not respond at all, example: disconnects, reset, read timeout, connection failure, and refused streams. + // - gateway-error: Similar to 5xx, but only applies to response codes 502, 503 or 504. + // - + // - connect-failure: Loadbalancer will retry on failures connecting to backend services, for example due to connection timeouts. + // - retriable-4xx: Loadbalancer will retry for retriable 4xx response codes. Currently the only retriable error supported is 409. + // - refused-stream:Loadbalancer will retry if the backend service resets the stream with a REFUSED_STREAM error code. This reset type indicates that it is safe to retry. + // - cancelledLoadbalancer will retry if the gRPC status code in the response header is set to cancelled + // - deadline-exceeded: Loadbalancer will retry if the gRPC status code in the response header is set to deadline-exceeded + // - resource-exhausted: Loadbalancer will retry if the gRPC status code in the response header is set to resource-exhausted + // - unavailable: Loadbalancer will retry if the gRPC status code in the response header is set to unavailable + repeated string retry_conditions = 28815535; + +} + +// A policy that specifies how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. +message RequestMirrorPolicy { + // The full or partial URL to the BackendService resource being mirrored to. + optional string backend_service = 306946058; + +} + +// The spec for modifying the path before sending the request to the matched backend service. +message UrlRewrite { + // Prior to forwarding the request to the selected service, the request's host header is replaced with contents of hostRewrite. + // The value must be between 1 and 255 characters. + optional string host_rewrite = 159819253; + + // Prior to forwarding the request to the selected backend service, the matching portion of the request's path is replaced by pathPrefixRewrite. + // The value must be between 1 and 1024 characters. + optional string path_prefix_rewrite = 41186361; + +} + +// In contrast to a single BackendService in HttpRouteAction to which all matching traffic is directed to, WeightedBackendService allows traffic to be split across multiple BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService +message WeightedBackendService { + // The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. + optional string backend_service = 306946058; + + // Specifies changes to request and response headers that need to take effect for the selected backendService. + // headerAction specified here take effect before headerAction in the enclosing HttpRouteRule, PathMatcher and UrlMap. + // Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional HttpHeaderAction header_action = 328077352; + + // Specifies the fraction of traffic sent to backendService, computed as weight / (sum of all weightedBackendService weights in routeAction) . + // The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. + // The value must be between 0 and 1000 + optional uint32 weight = 282149496; + +} + +// +message HttpRouteAction { + // The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing + // Not supported when the URL map is bound to target gRPC proxy. + optional CorsPolicy cors_policy = 398943748; + + // The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. As part of fault injection, when clients send requests to a backend service, delays can be introduced by Loadbalancer on a percentage of requests before sending those request to the backend service. Similarly requests from clients can be aborted by the Loadbalancer for a percentage of requests. + // timeout and retry_policy will be ignored by clients that are configured with a fault_injection_policy. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional HttpFaultInjection fault_injection_policy = 412781079; + + // Specifies the maximum duration (timeout) for streams on the selected route. Unlike the timeout field where the timeout duration starts from the time the request has been fully processed (i.e. end-of-stream), the duration in this field is computed from the beginning of the stream until the response has been completely processed, including all retries. A stream that does not complete in this duration is closed. + // If not specified, will use the largest maxStreamDuration among all backend services associated with the route. + // This field is only allowed if the Url map is used with backend services with loadBalancingScheme set to INTERNAL_SELF_MANAGED. + optional Duration max_stream_duration = 61428376; + + // Specifies the policy on how requests intended for the route's backends are shadowed to a separate mirrored backend service. Loadbalancer does not wait for responses from the shadow service. Prior to sending traffic to the shadow service, the host / authority header is suffixed with -shadow. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional RequestMirrorPolicy request_mirror_policy = 220196866; + + // Specifies the retry policy associated with this route. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional HttpRetryPolicy retry_policy = 56799913; + + // Specifies the timeout for the selected route. Timeout is computed from the time the request has been fully processed (i.e. end-of-stream) up until the response has been completely processed. Timeout includes all retries. + // If not specified, will use the largest timeout among all backend services associated with the route. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional Duration timeout = 296701281; + + // The spec to modify the URL of the request, prior to forwarding the request to the matched service. + // urlRewrite is the only action supported in UrlMaps for external HTTP(S) load balancers. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional UrlRewrite url_rewrite = 273333948; + + // A list of weighted backend services to send traffic to when a route match occurs. The weights determine the fraction of traffic that flows to their corresponding backend service. If all traffic needs to go to a single backend service, there must be one weightedBackendService with weight set to a non-zero number. + // Once a backendService is identified and before forwarding the request to the backend service, advanced routing actions such as URL rewrites and header transformations are applied depending on additional settings specified in this HttpRouteAction. + repeated WeightedBackendService weighted_backend_services = 337028049; + +} + +// HttpRouteRuleMatch specifies a set of criteria for matching requests to an HttpRouteRule. All specified criteria must be satisfied for a match to occur. +message HttpRouteRuleMatch { + // For satisfying the matchRule condition, the path of the request must exactly match the value specified in fullPathMatch after removing any query parameters and anchor that may be part of the original URL. + // fullPathMatch must be between 1 and 1024 characters. + // Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + optional string full_path_match = 214598875; + + // Specifies a list of header match criteria, all of which must match corresponding headers in the request. + repeated HttpHeaderMatch header_matches = 361903489; + + // Specifies that prefixMatch and fullPathMatch matches are case sensitive. + // The default value is false. + // ignoreCase must not be used with regexMatch. + // Not supported when the URL map is bound to target gRPC proxy. + optional bool ignore_case = 464324989; + + // Opaque filter criteria used by Loadbalancer to restrict routing configuration to a limited set of xDS compliant clients. In their xDS requests to Loadbalancer, xDS clients present node metadata. When there is a match, the relevant routing configuration is made available to those proxies. + // For each metadataFilter in this list, if its filterMatchCriteria is set to MATCH_ANY, at least one of the filterLabels must match the corresponding label provided in the metadata. If its filterMatchCriteria is set to MATCH_ALL, then all of its filterLabels must match with corresponding labels provided in the metadata. If multiple metadataFilters are specified, all of them need to be satisfied in order to be considered a match. + // metadataFilters specified here will be applied after those specified in ForwardingRule that refers to the UrlMap this HttpRouteRuleMatch belongs to. + // metadataFilters only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + repeated MetadataFilter metadata_filters = 464725739; + + // For satisfying the matchRule condition, the request's path must begin with the specified prefixMatch. prefixMatch must begin with a /. + // The value must be between 1 and 1024 characters. + // Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + optional string prefix_match = 257898968; + + // Specifies a list of query parameter match criteria, all of which must match corresponding query parameters in the request. + // Not supported when the URL map is bound to target gRPC proxy. + repeated HttpQueryParameterMatch query_parameter_matches = 286231270; + + // For satisfying the matchRule condition, the path of the request must satisfy the regular expression specified in regexMatch after removing any query parameters and anchor supplied with the original URL. For regular expression grammar please see github.com/google/re2/wiki/Syntax + // Only one of prefixMatch, fullPathMatch or regexMatch must be specified. + // Note that regexMatch only applies to Loadbalancers that have their loadBalancingScheme set to INTERNAL_SELF_MANAGED. + optional string regex_match = 107387853; + +} + +// An HttpRouteRule specifies how to match an HTTP request and the corresponding routing action that load balancing proxies will perform. +message HttpRouteRule { + // The short description conveying the intent of this routeRule. + // The description can have a maximum length of 1024 characters. + optional string description = 422937596; + + // Specifies changes to request and response headers that need to take effect for the selected backendService. + // The headerAction specified here are applied before the matching pathMatchers[].headerAction and after pathMatchers[].routeRules[].routeAction.weightedBackendService.backendServiceWeightAction[].headerAction + // Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional HttpHeaderAction header_action = 328077352; + + // The list of criteria for matching attributes of a request to this routeRule. This list has OR semantics: the request matches this routeRule when any of the matchRules are satisfied. However predicates within a given matchRule have AND semantics. All predicates within a matchRule must match for the request to match the rule. + repeated HttpRouteRuleMatch match_rules = 376200701; + + // For routeRules within a given pathMatcher, priority determines the order in which load balancer will interpret routeRules. RouteRules are evaluated in order of priority, from the lowest to highest number. The priority of a rule decreases as its number increases (1, 2, 3, N+1). The first rule that matches the request is applied. + // You cannot configure two or more routeRules with the same priority. Priority for each rule must be set to a number between 0 and 2147483647 inclusive. + // Priority numbers can have gaps, which enable you to add or remove rules in the future without affecting the rest of the rules. For example, 1, 2, 3, 4, 5, 9, 12, 16 is a valid series of priority numbers to which you could add rules numbered from 6 to 8, 10 to 11, and 13 to 15 in the future without any impact on existing rules. + optional int32 priority = 445151652; + + // In response to a matching matchRule, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. + // Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + // UrlMaps for external HTTP(S) load balancers support only the urlRewrite action within a routeRule's routeAction. + optional HttpRouteAction route_action = 424563948; + + // The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. + // Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + optional string service = 373540533; + + // When this rule is matched, the request is redirected to a URL specified by urlRedirect. + // If urlRedirect is specified, service or routeAction must not be set. + // Not supported when the URL map is bound to target gRPC proxy. + optional HttpRedirectAction url_redirect = 405147820; + +} + +// The parameters of the raw disk image. +message RawDisk { + // The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. + enum ContainerType { + // A value indicating that the enum field is not set. + UNDEFINED_CONTAINER_TYPE = 0; + + TAR = 82821; + + } + + // The format used to encode and transmit the block device, which should be TAR. This is just a container and transmission format and not a runtime format. Provided by the client when the disk image is created. + optional ContainerType container_type = 318809144; + + // [Deprecated] This field is deprecated. An optional SHA1 checksum of the disk image before unpackaging provided by the client when the disk image is created. + optional string sha1_checksum = 314444349; + + // The full Google Cloud Storage URL where the disk image is stored. You must provide either this property or the sourceDisk property but not both. + optional string source = 177235995; + +} + +// Represents an Image resource. +// +// You can use images to create boot disks for your VM instances. For more information, read Images. (== resource_for {$api_version}.images ==) +message Image { + // The type of the image used to create this disk. The default and only value is RAW + enum SourceType { + // A value indicating that the enum field is not set. + UNDEFINED_SOURCE_TYPE = 0; + + RAW = 80904; + + } + + // [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + DELETING = 528602024; + + FAILED = 455706685; + + PENDING = 35394935; + + READY = 77848963; + + } + + // Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). + optional int64 archive_size_bytes = 381093450; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // The deprecation status associated with this image. + optional DeprecationStatus deprecated = 515138995; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Size of the image when restored onto a persistent disk (in GB). + optional int64 disk_size_gb = 316263735; + + // The name of the image family to which this image belongs. You can create disks by specifying an image family instead of a specific image name. The image family always returns its latest image that is not deprecated. The name of the image family must comply with RFC1035. + optional string family = 328751972; + + // A list of features to enable on the guest operating system. Applicable only for bootable images. Read Enabling guest operating system features to see a list of available options. + repeated GuestOsFeature guest_os_features = 79294545; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // Encrypts the image using a customer-supplied encryption key. + // + // After you encrypt an image with a customer-supplied key, you must provide the same key if you use the image later (e.g. to create a disk from the image). + // + // Customer-supplied encryption keys do not protect access to metadata of the disk. + // + // If you do not provide an encryption key when creating the image, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the image later. + optional CustomerEncryptionKey image_encryption_key = 379512583; + + // [Output Only] Type of the resource. Always compute#image for images. + optional string kind = 3292052; + + // A fingerprint for the labels being applied to this image, which is essentially a hash of the labels used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve an image. + optional string label_fingerprint = 178124825; + + // Labels to apply to this image. These can be later modified by the setLabels method. + map labels = 500195327; + + // Integer license codes indicating which licenses are attached to this image. + repeated int64 license_codes = 45482664; + + // Any applicable license URI. + repeated string licenses = 337642578; + + // Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The parameters of the raw disk image. + optional RawDisk raw_disk = 503113556; + + // [Output Only] Reserved for future use. + optional bool satisfies_pzs = 480964267; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Set the secure boot keys of shielded instance. + optional InitialStateConfig shielded_instance_initial_state = 192356867; + + // URL of the source disk used to create this image. This can be a full or valid partial URL. You must provide either this property or the rawDisk.source property but not both to create an image. For example, the following are valid values: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + // - projects/project/zones/zone/disks/disk + // - zones/zone/disks/disk + optional string source_disk = 451753793; + + // The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + optional CustomerEncryptionKey source_disk_encryption_key = 531501153; + + // [Output Only] The ID value of the disk used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given disk name. + optional string source_disk_id = 454190809; + + // URL of the source image used to create this image. + // + // In order to create an image, you must provide the full or partial URL of one of the following: + // - The selfLink URL + // - This property + // - The rawDisk.source URL + // - The sourceDisk URL + optional string source_image = 50443319; + + // The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. + optional CustomerEncryptionKey source_image_encryption_key = 381503659; + + // [Output Only] The ID value of the image used to create this image. This value may be used to determine whether the image was taken from the current or a previous instance of a given image name. + optional string source_image_id = 55328291; + + // URL of the source snapshot used to create this image. + // + // In order to create an image, you must provide the full or partial URL of one of the following: + // - The selfLink URL + // - This property + // - The sourceImage URL + // - The rawDisk.source URL + // - The sourceDisk URL + optional string source_snapshot = 126061928; + + // The customer-supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. + optional CustomerEncryptionKey source_snapshot_encryption_key = 303679322; + + // [Output Only] The ID value of the snapshot used to create this image. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given snapshot name. + optional string source_snapshot_id = 98962258; + + // The type of the image used to create this disk. The default and only value is RAW + optional SourceType source_type = 452245726; + + // [Output Only] The status of the image. An image can be used to create other resources, such as instances, only after the image has been successfully created and the status is set to READY. Possible values are FAILED, PENDING, or READY. + optional Status status = 181260274; + + // Cloud Storage bucket storage location of the image (regional or multi-regional). + repeated string storage_locations = 328005274; + +} + +// Contains a list of images. +message ImageList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Image resources. + repeated Image items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// A metadata key/value entry. +message Metadata { + // Specifies a fingerprint for this request, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve the resource. + optional string fingerprint = 234678500; + + // Array of key/value pairs. The total size of all keys and values must be less than 512 KB. + repeated Items items = 100526016; + + // [Output Only] Type of the resource. Always compute#metadata for metadata. + optional string kind = 3292052; + +} + +// A network interface resource attached to an instance. +message NetworkInterface { + // The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. + enum NicType { + // A value indicating that the enum field is not set. + UNDEFINED_NIC_TYPE = 0; + + GVNIC = 68209305; + + UNSPECIFIED_NIC_TYPE = 67411801; + + VIRTIO_NET = 452123481; + + } + + // An array of configurations for this interface. Currently, only one access config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs specified, then this instance will have no external internet access. + repeated AccessConfig access_configs = 111058326; + + // An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks. + repeated AliasIpRange alias_ip_ranges = 165085631; + + // Fingerprint hash of contents stored in this network interface. This field will be ignored when inserting an Instance or adding a NetworkInterface. An up-to-date fingerprint must be provided in order to update the NetworkInterface. The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date. + optional string fingerprint = 234678500; + + // [Output Only] An IPv6 internal network address for this network interface. + optional string ipv6_address = 341563804; + + // [Output Only] Type of the resource. Always compute#networkInterface for network interfaces. + optional string kind = 3292052; + + // [Output Only] The name of the network interface, which is generated by the server. For network devices, these are eth0, eth1, etc. + optional string name = 3373707; + + // URL of the network resource for this instance. When creating an instance, if neither the network nor the subnetwork is specified, the default network global/networks/default is used; if the network is not specified but the subnetwork is specified, the network is inferred. + // + // If you specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: + // - https://www.googleapis.com/compute/v1/projects/project/global/networks/network + // - projects/project/global/networks/network + // - global/networks/default + optional string network = 232872494; + + // An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system. + optional string network_i_p = 207181961; + + // The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet. + optional NicType nic_type = 59810577; + + // The URL of the Subnetwork resource for this instance. If the network resource is in legacy mode, do not specify this field. If the network is in auto subnet mode, specifying the subnetwork is optional. If the network is in custom subnet mode, specifying the subnetwork is required. If you specify this field, you can specify the subnetwork as a full or partial URL. For example, the following are all valid URLs: + // - https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork + // - regions/region/subnetworks/subnetwork + optional string subnetwork = 307827694; + +} + +// Specifies the reservations that this instance can consume from. +message ReservationAffinity { + // Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. + enum ConsumeReservationType { + // A value indicating that the enum field is not set. + UNDEFINED_CONSUME_RESERVATION_TYPE = 0; + + ANY_RESERVATION = 200008121; + + NO_RESERVATION = 169322030; + + SPECIFIC_RESERVATION = 229889055; + + UNSPECIFIED = 526786327; + + } + + // Specifies the type of reservation from which this instance can consume resources: ANY_RESERVATION (default), SPECIFIC_RESERVATION, or NO_RESERVATION. See Consuming reserved instances for examples. + optional ConsumeReservationType consume_reservation_type = 300736944; + + // Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify googleapis.com/reservation-name as the key and specify the name of your reservation as its value. + optional string key = 106079; + + // Corresponds to the label values of a reservation resource. + repeated string values = 249928994; + +} + +// Sets the scheduling options for an Instance. NextID: 20 +message Scheduling { + // Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options. + enum OnHostMaintenance { + // A value indicating that the enum field is not set. + UNDEFINED_ON_HOST_MAINTENANCE = 0; + + MIGRATE = 165699979; + + TERMINATE = 527617601; + + } + + // Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted. + // + // By default, this is set to true so an instance is automatically restarted if it is terminated by Compute Engine. + optional bool automatic_restart = 350821371; + + // An opaque location hint used to place the instance close to other resources. This field is for use by internal tools that use the public API. + optional string location_hint = 350519505; + + // The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. + optional int32 min_node_cpus = 317231675; + + // A set of node affinity and anti-affinity configurations. Refer to Configuring node affinity for more information. Overrides reservationAffinity. + repeated SchedulingNodeAffinity node_affinities = 461799971; + + // Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting Instance Scheduling Options. + optional OnHostMaintenance on_host_maintenance = 64616796; + + // Defines whether the instance is preemptible. This can only be set during instance creation or while the instance is stopped and therefore, in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. + optional bool preemptible = 324203169; + +} + +// A service account. +message ServiceAccount { + // Email address of the service account. + optional string email = 96619420; + + // The list of scopes to be made available for this service account. + repeated string scopes = 165973151; + +} + +// A set of Shielded Instance options. +message ShieldedInstanceConfig { + // Defines whether the instance has integrity monitoring enabled. Enabled by default. + optional bool enable_integrity_monitoring = 409071030; + + // Defines whether the instance has Secure Boot enabled. Disabled by default. + optional bool enable_secure_boot = 123568638; + + // Defines whether the instance has the vTPM enabled. Enabled by default. + optional bool enable_vtpm = 181858935; + +} + +// The policy describes the baseline against which Instance boot integrity is measured. +message ShieldedInstanceIntegrityPolicy { + // Updates the integrity policy baseline using the measurements from the VM instance's most recent boot. + optional bool update_auto_learn_policy = 245490215; + +} + +// A set of instance tags. +message Tags { + // Specifies a fingerprint for this request, which is essentially a hash of the tags' contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update tags. You must always provide an up-to-date fingerprint hash in order to update or change tags. + // + // To see the latest fingerprint, make get() request to the instance. + optional string fingerprint = 234678500; + + // An array of tags. Each tag must be 1-63 characters long, and comply with RFC1035. + repeated string items = 100526016; + +} + +// Represents an Instance resource. +// +// An instance is a virtual machine that is hosted on Google Cloud Platform. For more information, read Virtual Machine Instances. (== resource_for {$api_version}.instances ==) +message Instance { + // The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. + enum PrivateIpv6GoogleAccess { + // A value indicating that the enum field is not set. + UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + + INHERIT_FROM_SUBNETWORK = 530256959; + + } + + // [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + DEPROVISIONING = 428935662; + + PROVISIONING = 290896621; + + REPAIRING = 413483285; + + RUNNING = 121282975; + + STAGING = 431072283; + + STOPPED = 444276141; + + STOPPING = 350791796; + + SUSPENDED = 51223995; + + SUSPENDING = 514206246; + + TERMINATED = 250018339; + + } + + // Controls for advanced machine-related behavior features. + optional AdvancedMachineFeatures advanced_machine_features = 409646002; + + // Allows this instance to send and receive packets with non-matching destination or source IPs. This is required if you plan to use this instance to forward routes. For more information, see Enabling IP Forwarding. + optional bool can_ip_forward = 467731324; + + optional ConfidentialInstanceConfig confidential_instance_config = 490637685; + + // [Output Only] The CPU platform used by this instance. + optional string cpu_platform = 410285354; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // Whether the resource should be protected against deletion. + optional bool deletion_protection = 458014698; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Array of disks associated with this instance. Persistent disks must be created before you can assign them. + repeated AttachedDisk disks = 95594102; + + // Enables display device for the instance. + optional DisplayDevice display_device = 258933875; + + // Specifies a fingerprint for this resource, which is essentially a hash of the instance's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update the instance. You must always provide an up-to-date fingerprint hash in order to update the instance. + // + // To see the latest fingerprint, make get() request to the instance. + optional string fingerprint = 234678500; + + // A list of the type and count of accelerator cards attached to the instance. + repeated AcceleratorConfig guest_accelerators = 463595119; + + // Specifies the hostname of the instance. The specified hostname must be RFC1035 compliant. If hostname is not specified, the default hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal DNS. + optional string hostname = 237067315; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#instance for instances. + optional string kind = 3292052; + + // A fingerprint for this request, which is essentially a hash of the label's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. + // + // To see the latest fingerprint, make get() request to the instance. + optional string label_fingerprint = 178124825; + + // Labels to apply to this instance. These can be later modified by the setLabels method. + map labels = 500195327; + + // [Output Only] Last start timestamp in RFC3339 text format. + optional string last_start_timestamp = 443830736; + + // [Output Only] Last stop timestamp in RFC3339 text format. + optional string last_stop_timestamp = 412823010; + + // [Output Only] Last suspended timestamp in RFC3339 text format. + optional string last_suspended_timestamp = 356275337; + + // Full or partial URL of the machine type resource to use for this instance, in the format: zones/zone/machineTypes/machine-type. This is provided by the client when the instance is created. For example, the following is a valid partial url to a predefined machine type: + // zones/us-central1-f/machineTypes/n1-standard-1 + // + // + // To create a custom machine type, provide a URL to a machine type in the following format, where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the total memory for this instance. Memory must be a multiple of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): + // zones/zone/machineTypes/custom-CPUS-MEMORY + // + // + // For example: zones/us-central1-f/machineTypes/custom-4-5120 + // + // For a full list of restrictions, read the Specifications for custom machine types. + optional string machine_type = 227711026; + + // The metadata key/value pairs assigned to this instance. This includes custom metadata and predefined keys. + optional Metadata metadata = 86866735; + + // Specifies a minimum CPU platform for the VM instance. Applicable values are the friendly names of CPU platforms, such as minCpuPlatform: "Intel Haswell" or minCpuPlatform: "Intel Sandy Bridge". + optional string min_cpu_platform = 242912759; + + // The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // An array of network configurations for this instance. These specify how interfaces are configured to interact with other network services, such as connecting to the internet. Multiple interfaces are supported per instance. + repeated NetworkInterface network_interfaces = 52735243; + + // The private IPv6 google access type for the VM. If not specified, use INHERIT_FROM_SUBNETWORK as default. + optional PrivateIpv6GoogleAccess private_ipv6_google_access = 48277006; + + // Specifies the reservations that this instance can consume from. + optional ReservationAffinity reservation_affinity = 157850683; + + // Resource policies applied to this instance. + repeated string resource_policies = 22220385; + + // [Output Only] Reserved for future use. + optional bool satisfies_pzs = 480964267; + + // Sets the scheduling options for this instance. + optional Scheduling scheduling = 386688404; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // A list of service accounts, with their specified scopes, authorized for this instance. Only one service account per VM instance is supported. + // + // Service accounts generate access tokens that can be accessed through the metadata server and used to authenticate applications on the instance. See Service Accounts for more information. + repeated ServiceAccount service_accounts = 277537328; + + optional ShieldedInstanceConfig shielded_instance_config = 12862901; + + optional ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy = 163696919; + + // [Output Only] Whether a VM has been restricted for start because Compute Engine has detected suspicious activity. + optional bool start_restricted = 123693144; + + // [Output Only] The status of the instance. One of the following values: PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. For more information about the status of the instance, see Instance life cycle. + optional Status status = 181260274; + + // [Output Only] An optional, human-readable explanation of the status. + optional string status_message = 297428154; + + // Tags to apply to this instance. Tags are used to identify valid sources or targets for network firewalls and are specified by the client during instance creation. The tags can be later modified by the setTags method. Each tag within the list must comply with RFC1035. Multiple tags can be specified via the 'tags.items' field. + optional Tags tags = 3552281; + + // [Output Only] URL of the zone where the instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string zone = 3744684; + +} + +// +message InstancesScopedList { + // [Output Only] A list of instances contained in this scope. + repeated Instance instances = 29097598; + + // [Output Only] Informational warning which replaces the list of instances when the list is empty. + optional Warning warning = 50704284; + +} + +// +message InstanceAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // An object that contains a list of instances scoped by zone. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#instanceAggregatedList for aggregated lists of Instance resources. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// The named port. For example: . +message NamedPort { + // The name for this named port. The name must be 1-63 characters long, and comply with RFC1035. + optional string name = 3373707; + + // The port number, which can be a value between 1 and 65535. + optional int32 port = 3446913; + +} + +// Represents an Instance Group resource. +// +// Instance Groups can be used to configure a target for load balancing. +// +// Instance groups can either be managed or unmanaged. +// +// To create managed instance groups, use the instanceGroupManager or regionInstanceGroupManager resource instead. +// +// Use zonal unmanaged instance groups if you need to apply load balancing to groups of heterogeneous instances or if you need to manage the instances yourself. You cannot create regional unmanaged instance groups. +// +// For more information, read Instance groups. +// +// (== resource_for {$api_version}.instanceGroups ==) (== resource_for {$api_version}.regionInstanceGroups ==) +message InstanceGroup { + // [Output Only] The creation timestamp for this instance group in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. + optional string fingerprint = 234678500; + + // [Output Only] A unique identifier for this instance group, generated by the server. + optional uint64 id = 3355; + + // [Output Only] The resource type, which is always compute#instanceGroup for instance groups. + optional string kind = 3292052; + + // The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. + optional string name = 3373707; + + // Assigns a name to a port number. For example: {name: "http", port: 80} + // + // This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "http", port: 80},{name: "http", port: 8080}] + // + // Named ports apply to all instances in this instance group. + repeated NamedPort named_ports = 427598732; + + // [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + optional string network = 232872494; + + // [Output Only] The URL of the region where the instance group is located (for regional resources). + optional string region = 138946292; + + // [Output Only] The URL for this instance group. The server generates this URL. + optional string self_link = 456214797; + + // [Output Only] The total number of instances in the instance group. + optional int32 size = 3530753; + + // [Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). + optional string subnetwork = 307827694; + + // [Output Only] The URL of the zone where the instance group is located (for zonal resources). + optional string zone = 3744684; + +} + +// +message InstanceGroupsScopedList { + // [Output Only] The list of instance groups that are contained in this scope. + repeated InstanceGroup instance_groups = 366469310; + + // [Output Only] An informational warning that replaces the list of instance groups when the list is empty. + optional Warning warning = 50704284; + +} + +// +message InstanceGroupAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceGroupsScopedList resources. + map items = 100526016; + + // [Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// A list of InstanceGroup resources. +message InstanceGroupList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceGroup resources. + repeated InstanceGroup items = 100526016; + + // [Output Only] The resource type, which is always compute#instanceGroupList for instance group lists. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message InstanceGroupManagerAutoHealingPolicy { + // The URL for the health check that signals autohealing. + optional string health_check = 308876645; + + // The number of seconds that the managed instance group waits before it applies autohealing policies to new instances or recently recreated instances. This initial delay allows instances to initialize and run their startup scripts before the instance group determines that they are UNHEALTHY. This prevents the managed instance group from recreating its instances prematurely. This value must be from range [0, 3600]. + optional int32 initial_delay_sec = 263207002; + +} + +// +message InstanceGroupManagerActionsSummary { + // [Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it. + optional int32 abandoning = 440023373; + + // [Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created. If the group fails to create any of these instances, it tries again until it creates the instance successfully. + // + // If you have disabled creation retries, this field will not be populated; instead, the creatingWithoutRetries field will be populated. + optional int32 creating = 209809081; + + // [Output Only] The number of instances that the managed instance group will attempt to create. The group attempts to create each instance only once. If the group fails to create any of these instances, it decreases the group's targetSize value accordingly. + optional int32 creating_without_retries = 369916745; + + // [Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted. + optional int32 deleting = 282846120; + + // [Output Only] The number of instances in the managed instance group that are running and have no scheduled actions. + optional int32 none = 3387192; + + // [Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template. + optional int32 recreating = 339057132; + + // [Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance. + optional int32 refreshing = 215044903; + + // [Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted. + optional int32 restarting = 372312947; + + // [Output Only] The number of instances in the managed instance group that are being verified. See the managedInstances[].currentAction property in the listManagedInstances method documentation. + optional int32 verifying = 451612873; + +} + +// +message StatefulPolicy { + optional StatefulPolicyPreservedState preserved_state = 2634026; + +} + +// +message InstanceGroupManagerStatus { + // [Output Only] The URL of the Autoscaler that targets this instance group manager. + optional string autoscaler = 517258967; + + // [Output Only] A bit indicating whether the managed instance group is in a stable state. A stable state means that: none of the instances in the managed instance group is currently undergoing any type of change (for example, creation, restart, or deletion); no future changes are scheduled for instances in the managed instance group; and the managed instance group itself is not being modified. + optional bool is_stable = 108410864; + + // [Output Only] Stateful status of the given Instance Group Manager. + optional InstanceGroupManagerStatusStateful stateful = 244462412; + + // [Output Only] A status of consistency of Instances' versions with their target version specified by version field on Instance Group Manager. + optional InstanceGroupManagerStatusVersionTarget version_target = 289386200; + +} + +// +message InstanceGroupManagerUpdatePolicy { + // The instance redistribution policy for regional managed instance groups. Valid values are: + // - PROACTIVE (default): The group attempts to maintain an even distribution of VM instances across zones in the region. + // - NONE: For non-autoscaled groups, proactive redistribution is disabled. + optional string instance_redistribution_type = 292630424; + + // The maximum number of instances that can be created above the specified targetSize during the update process. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded up if necessary. The default value for maxSurge is a fixed value equal to the number of zones in which the managed instance group operates. + // + // At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxSurge. + optional FixedOrPercent max_surge = 302572691; + + // The maximum number of instances that can be unavailable during the update process. An instance is considered available if all of the following conditions are satisfied: + // + // + // - The instance's status is RUNNING. + // - If there is a health check on the instance group, the instance's health check status must be HEALTHY at least once. If there is no health check on the group, then the instance only needs to have a status of RUNNING to be considered available. This value can be either a fixed number or, if the group has 10 or more instances, a percentage. If you set a percentage, the number of instances is rounded up if necessary. The default value for maxUnavailable is a fixed value equal to the number of zones in which the managed instance group operates. + // + // At least one of either maxSurge or maxUnavailable must be greater than 0. Learn more about maxUnavailable. + optional FixedOrPercent max_unavailable = 404940277; + + // Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action. + optional string minimal_action = 270567060; + + // What action should be used to replace instances. See minimal_action.REPLACE + optional string replacement_method = 505931694; + + // The type of update process. You can specify either PROACTIVE so that the instance group manager proactively executes actions in order to bring instances to their target versions or OPPORTUNISTIC so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls). + optional string type = 3575610; + +} + +// +message InstanceGroupManagerVersion { + // The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the `targetSize` for this version is reached. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE; in those cases, existing instances are updated until the `targetSize` for this version is reached. + optional string instance_template = 309248228; + + // Name of the version. Unique among all versions in the scope of this managed instance group. + optional string name = 3373707; + + // Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to: + // - If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used. + // - if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded up. If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information. + optional FixedOrPercent target_size = 62880239; + +} + +// Represents a Managed Instance Group resource. +// +// An instance group is a collection of VM instances that you can manage as a single entity. For more information, read Instance groups. +// +// For zonal Managed Instance Group, use the instanceGroupManagers resource. +// +// For regional Managed Instance Group, use the regionInstanceGroupManagers resource. (== resource_for {$api_version}.instanceGroupManagers ==) (== resource_for {$api_version}.regionInstanceGroupManagers ==) +message InstanceGroupManager { + // The autohealing policy for this managed instance group. You can specify only one value. + repeated InstanceGroupManagerAutoHealingPolicy auto_healing_policies = 456799109; + + // The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035. + optional string base_instance_name = 389106439; + + // [Output Only] The creation timestamp for this managed instance group in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions. + optional InstanceGroupManagerActionsSummary current_actions = 164045879; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Policy specifying the intended distribution of managed instances across zones in a regional managed instance group. + optional DistributionPolicy distribution_policy = 534558541; + + // Fingerprint of this resource. This field may be used in optimistic locking. It will be ignored when inserting an InstanceGroupManager. An up-to-date fingerprint must be provided in order to update the InstanceGroupManager, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve an InstanceGroupManager. + optional string fingerprint = 234678500; + + // [Output Only] A unique identifier for this resource type. The server generates this identifier. + optional uint64 id = 3355; + + // [Output Only] The URL of the Instance Group resource. + optional string instance_group = 81095253; + + // The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + optional string instance_template = 309248228; + + // [Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups. + optional string kind = 3292052; + + // The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035. + optional string name = 3373707; + + // Named ports configured for the Instance Groups complementary to this Instance Group Manager. + repeated NamedPort named_ports = 427598732; + + // [Output Only] The URL of the region where the managed instance group resides (for regional resources). + optional string region = 138946292; + + // [Output Only] The URL for this managed instance group. The server defines this URL. + optional string self_link = 456214797; + + // Stateful configuration for this Instanced Group Manager + optional StatefulPolicy stateful_policy = 47538565; + + // [Output Only] The status of this managed instance group. + optional InstanceGroupManagerStatus status = 181260274; + + // The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + repeated string target_pools = 336072617; + + // The target number of running instances for this managed instance group. You can reduce this number by using the instanceGroupManager deleteInstances or abandonInstances methods. Resizing the group also changes this number. + optional int32 target_size = 62880239; + + // The update policy for this managed instance group. + optional InstanceGroupManagerUpdatePolicy update_policy = 175809896; + + // Specifies the instance templates used by this managed instance group to create instances. + // + // Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates. + repeated InstanceGroupManagerVersion versions = 162430619; + + // [Output Only] The URL of a zone where the managed instance group is located (for zonal resources). + optional string zone = 3744684; + +} + +// +message InstanceGroupManagersScopedList { + // [Output Only] The list of managed instance groups that are contained in the specified project and zone. + repeated InstanceGroupManager instance_group_managers = 214072592; + + // [Output Only] The warning that replaces the list of managed instance groups when the list is empty. + optional Warning warning = 50704284; + +} + +// +message InstanceGroupManagerAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceGroupManagersScopedList resources. + map items = 100526016; + + // [Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// [Output Only] A list of managed instance groups. +message InstanceGroupManagerList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceGroupManager resources. + repeated InstanceGroupManager items = 100526016; + + // [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message InstanceGroupManagerStatusStateful { + // [Output Only] A bit indicating whether the managed instance group has stateful configuration, that is, if you have configured any items in a stateful policy or in per-instance configs. The group might report that it has no stateful config even when there is still some preserved state on a managed instance, for example, if you have deleted all PICs but not yet applied those deletions. + optional bool has_stateful_config = 110474224; + + // [Output Only] Status of per-instance configs on the instance. + optional InstanceGroupManagerStatusStatefulPerInstanceConfigs per_instance_configs = 526265001; + +} + +// +message InstanceGroupManagerStatusVersionTarget { + // [Output Only] A bit indicating whether version target has been reached in this managed instance group, i.e. all instances are in their target version. Instances' target version are specified by version field on Instance Group Manager. + optional bool is_reached = 433209149; + +} + +// +message InstanceGroupManagerStatusStatefulPerInstanceConfigs { + // A bit indicating if all of the group's per-instance configs (listed in the output of a listPerInstanceConfigs API call) have status EFFECTIVE or there are no per-instance-configs. + optional bool all_effective = 516540553; + +} + +// +message InstanceGroupManagersAbandonInstancesRequest { + // The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + +} + +// InstanceGroupManagers.applyUpdatesToInstances +message InstanceGroupManagersApplyUpdatesRequest { + // Flag to update all instances instead of specified list of ?instances?. If the flag is set to true then the instances may not be specified in the request. + optional bool all_instances = 403676512; + + // The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + + // The minimal action that you want to perform on each instance during the update: + // - REPLACE: At minimum, delete the instance and create it again. + // - RESTART: Stop the instance and start it again. + // - REFRESH: Do not stop the instance. + // - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + optional string minimal_action = 270567060; + + // The most disruptive action that you want to perform on each instance during the update: + // - REPLACE: Delete the instance and create it again. + // - RESTART: Stop the instance and start it again. + // - REFRESH: Do not stop the instance. + // - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + optional string most_disruptive_allowed_action = 66103053; + +} + +// +message PerInstanceConfig { + // The status of applying this per-instance config on the corresponding managed instance. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + APPLYING = 352003508; + + DELETING = 528602024; + + EFFECTIVE = 244201863; + + NONE = 2402104; + + UNAPPLIED = 483935140; + + UNAPPLIED_DELETION = 313956873; + + } + + // Fingerprint of this per-instance config. This field can be used in optimistic locking. It is ignored when inserting a per-instance config. An up-to-date fingerprint must be provided in order to update an existing per-instance config or the field needs to be unset. + optional string fingerprint = 234678500; + + // The name of a per-instance config and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance config with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance config for a VM instance that either doesn't exist or is not part of the group will result in an error. + optional string name = 3373707; + + // The intended preserved state for the given instance. Does not contain preserved state generated from a stateful policy. + optional PreservedState preserved_state = 2634026; + + // The status of applying this per-instance config on the corresponding managed instance. + optional Status status = 181260274; + +} + +// InstanceGroupManagers.createInstances +message InstanceGroupManagersCreateInstancesRequest { + // [Required] List of specifications of per-instance configs. + repeated PerInstanceConfig instances = 29097598; + +} + +// +message InstanceGroupManagersDeleteInstancesRequest { + // The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + +} + +// InstanceGroupManagers.deletePerInstanceConfigs +message InstanceGroupManagersDeletePerInstanceConfigsReq { + // The list of instance names for which we want to delete per-instance configs on this managed instance group. + repeated string names = 104585032; + +} + +// +message InstanceManagedByIgmError { + // [Output Only] Contents of the error. + optional InstanceManagedByIgmErrorManagedInstanceError error = 96784904; + + // [Output Only] Details of the instance action that triggered this error. May be null, if the error was not caused by an action on an instance. This field is optional. + optional InstanceManagedByIgmErrorInstanceActionDetails instance_action_details = 292224547; + + // [Output Only] The time that this error occurred. This value is in RFC3339 text format. + optional string timestamp = 55126294; + +} + +// +message InstanceGroupManagersListErrorsResponse { + // [Output Only] The list of errors of the managed instance group. + repeated InstanceManagedByIgmError items = 100526016; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + +} + +// A Managed Instance resource. +message ManagedInstance { + // [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: + // - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. + // - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. + // - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. + // - RECREATING The managed instance group is recreating this instance. + // - DELETING The managed instance group is permanently deleting this instance. + // - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. + // - RESTARTING The managed instance group is restarting the instance. + // - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. + // - VERIFYING The managed instance group has created the instance and it is in the process of being verified. + enum CurrentAction { + // A value indicating that the enum field is not set. + UNDEFINED_CURRENT_ACTION = 0; + + ABANDONING = 388244813; + + CREATING = 455564985; + + CREATING_WITHOUT_RETRIES = 428843785; + + DELETING = 528602024; + + NONE = 2402104; + + RECREATING = 287278572; + + REFRESHING = 163266343; + + RESTARTING = 320534387; + + VERIFYING = 16982185; + + } + + // [Output Only] The status of the instance. This field is empty when the instance does not exist. + enum InstanceStatus { + // A value indicating that the enum field is not set. + UNDEFINED_INSTANCE_STATUS = 0; + + DEPROVISIONING = 428935662; + + PROVISIONING = 290896621; + + REPAIRING = 413483285; + + RUNNING = 121282975; + + STAGING = 431072283; + + STOPPED = 444276141; + + STOPPING = 350791796; + + SUSPENDED = 51223995; + + SUSPENDING = 514206246; + + TERMINATED = 250018339; + + } + + // [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: + // - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. + // - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. + // - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. + // - RECREATING The managed instance group is recreating this instance. + // - DELETING The managed instance group is permanently deleting this instance. + // - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. + // - RESTARTING The managed instance group is restarting the instance. + // - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. + // - VERIFYING The managed instance group has created the instance and it is in the process of being verified. + optional CurrentAction current_action = 178475964; + + // [Output only] The unique identifier for this resource. This field is empty when instance does not exist. + optional uint64 id = 3355; + + // [Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. + optional string instance = 18257045; + + // [Output Only] Health state of the instance per health-check. + repeated ManagedInstanceInstanceHealth instance_health = 382667078; + + // [Output Only] The status of the instance. This field is empty when the instance does not exist. + optional InstanceStatus instance_status = 174577372; + + // [Output Only] Information about the last attempt to create or delete the instance. + optional ManagedInstanceLastAttempt last_attempt = 434771492; + + // [Output Only] Preserved state applied from per-instance config for this instance. + optional PreservedState preserved_state_from_config = 98661858; + + // [Output Only] Preserved state generated based on stateful policy for this instance. + optional PreservedState preserved_state_from_policy = 470783954; + + // [Output Only] Intended version of this instance. + optional ManagedInstanceVersion version = 351608024; + +} + +// +message InstanceGroupManagersListManagedInstancesResponse { + // [Output Only] The list of instances in the managed instance group. + repeated ManagedInstance managed_instances = 336219614; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + +} + +// +message InstanceGroupManagersListPerInstanceConfigsResp { + // [Output Only] The list of PerInstanceConfig. + repeated PerInstanceConfig items = 100526016; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// InstanceGroupManagers.patchPerInstanceConfigs +message InstanceGroupManagersPatchPerInstanceConfigsReq { + // The list of per-instance configs to insert or patch on this managed instance group. + repeated PerInstanceConfig per_instance_configs = 526265001; + +} + +// +message InstanceGroupManagersRecreateInstancesRequest { + // The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + +} + +// +message InstanceGroupManagersSetInstanceTemplateRequest { + // The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + optional string instance_template = 309248228; + +} + +// +message InstanceGroupManagersSetTargetPoolsRequest { + // The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + optional string fingerprint = 234678500; + + // The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings. + repeated string target_pools = 336072617; + +} + +// InstanceGroupManagers.updatePerInstanceConfigs +message InstanceGroupManagersUpdatePerInstanceConfigsReq { + // The list of per-instance configs to insert or patch on this managed instance group. + repeated PerInstanceConfig per_instance_configs = 526265001; + +} + +// +message InstanceReference { + // The URL for a specific instance. + optional string instance = 18257045; + +} + +// +message InstanceGroupsAddInstancesRequest { + // The list of instances to add to the instance group. + repeated InstanceReference instances = 29097598; + +} + +// +message InstanceWithNamedPorts { + // [Output Only] The status of the instance. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + DEPROVISIONING = 428935662; + + PROVISIONING = 290896621; + + REPAIRING = 413483285; + + RUNNING = 121282975; + + STAGING = 431072283; + + STOPPED = 444276141; + + STOPPING = 350791796; + + SUSPENDED = 51223995; + + SUSPENDING = 514206246; + + TERMINATED = 250018339; + + } + + // [Output Only] The URL of the instance. + optional string instance = 18257045; + + // [Output Only] The named ports that belong to this instance group. + repeated NamedPort named_ports = 427598732; + + // [Output Only] The status of the instance. + optional Status status = 181260274; + +} + +// +message InstanceGroupsListInstances { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceWithNamedPorts resources. + repeated InstanceWithNamedPorts items = 100526016; + + // [Output Only] The resource type, which is always compute#instanceGroupsListInstances for the list of instances in the specified instance group. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message InstanceGroupsListInstancesRequest { + // A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + enum InstanceState { + // A value indicating that the enum field is not set. + UNDEFINED_INSTANCE_STATE = 0; + + ALL = 64897; + + RUNNING = 121282975; + + } + + // A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state. + optional InstanceState instance_state = 92223591; + +} + +// +message InstanceGroupsRemoveInstancesRequest { + // The list of instances to remove from the instance group. + repeated InstanceReference instances = 29097598; + +} + +// +message InstanceGroupsSetNamedPortsRequest { + // The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. A request with an incorrect fingerprint will fail with error 412 conditionNotMet. + optional string fingerprint = 234678500; + + // The list of named ports to set for this instance group. + repeated NamedPort named_ports = 427598732; + +} + +// Contains a list of instances. +message InstanceList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Instance resources. + repeated Instance items = 100526016; + + // [Output Only] Type of resource. Always compute#instanceList for lists of Instance resources. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a reference to a resource. +message Reference { + // [Output Only] Type of the resource. Always compute#reference for references. + optional string kind = 3292052; + + // A description of the reference type with no implied semantics. Possible values include: + // - MEMBER_OF + optional string reference_type = 247521198; + + // URL of the resource which refers to the target. + optional string referrer = 351173663; + + // URL of the resource to which this reference points. + optional string target = 192835985; + +} + +// Contains a list of instance referrers. +message InstanceListReferrers { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Reference resources. + repeated Reference items = 100526016; + + // [Output Only] Type of resource. Always compute#instanceListReferrers for lists of Instance referrers. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message InstanceManagedByIgmErrorManagedInstanceError { + // [Output Only] Error code. + optional string code = 3059181; + + // [Output Only] Error message. + optional string message = 418054151; + +} + +// +message InstanceManagedByIgmErrorInstanceActionDetails { + // [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values: + enum Action { + // A value indicating that the enum field is not set. + UNDEFINED_ACTION = 0; + + ABANDONING = 388244813; + + CREATING = 455564985; + + CREATING_WITHOUT_RETRIES = 428843785; + + DELETING = 528602024; + + NONE = 2402104; + + RECREATING = 287278572; + + REFRESHING = 163266343; + + RESTARTING = 320534387; + + VERIFYING = 16982185; + + } + + // [Output Only] Action that managed instance group was executing on the instance when the error occurred. Possible values: + optional Action action = 187661878; + + // [Output Only] The URL of the instance. The URL can be set even if the instance has not yet been created. + optional string instance = 18257045; + + // [Output Only] Version this instance was created from, or was being created from, but the creation failed. Corresponds to one of the versions that were set on the Instance Group Manager resource at the time this instance was being created. + optional ManagedInstanceVersion version = 351608024; + +} + +// +message ManagedInstanceVersion { + // [Output Only] The intended template of the instance. This field is empty when current_action is one of { DELETING, ABANDONING }. + optional string instance_template = 309248228; + + // [Output Only] Name of the version. + optional string name = 3373707; + +} + +// +message InstanceMoveRequest { + // The URL of the destination zone to move the instance. This can be a full or partial URL. For example, the following are all valid URLs to a zone: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone + // - projects/project/zones/zone + // - zones/zone + optional string destination_zone = 131854653; + + // The URL of the target instance to move. This can be a full or partial URL. For example, the following are all valid URLs to an instance: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + // - projects/project/zones/zone/instances/instance + // - zones/zone/instances/instance + optional string target_instance = 289769347; + +} + +// A specification of the parameters to use when creating the instance template from a source instance. +message SourceInstanceParams { + // Attached disks configuration. If not provided, defaults are applied: For boot disk and any other R/W disks, new custom images will be created from each disk. For read-only disks, they will be attached in read-only mode. Local SSD disks will be created as blank volumes. + repeated DiskInstantiationConfig disk_configs = 235580623; + +} + +// Represents an Instance Template resource. +// +// You can use instance templates to create VM instances and managed instance groups. For more information, read Instance Templates. (== resource_for {$api_version}.instanceTemplates ==) +message InstanceTemplate { + // [Output Only] The creation timestamp for this instance template in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] A unique identifier for this instance template. The server defines this identifier. + optional uint64 id = 3355; + + // [Output Only] The resource type, which is always compute#instanceTemplate for instance templates. + optional string kind = 3292052; + + // Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The instance properties for this instance template. + optional InstanceProperties properties = 147688755; + + // [Output Only] The URL for this instance template. The server defines this URL. + optional string self_link = 456214797; + + // The source instance used to create the template. You can provide this as a partial or full URL to the resource. For example, the following are valid values: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + // - projects/project/zones/zone/instances/instance + optional string source_instance = 396315705; + + // The source instance params to use to create this instance template. + optional SourceInstanceParams source_instance_params = 135342156; + +} + +// A list of instance templates. +message InstanceTemplateList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceTemplate resources. + repeated InstanceTemplate items = 100526016; + + // [Output Only] The resource type, which is always compute#instanceTemplatesListResponse for instance template lists. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message InstancesAddResourcePoliciesRequest { + // Resource policies to be added to this instance. + repeated string resource_policies = 22220385; + +} + +// +message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + // [Output Only] The type of the firewall policy. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + HIERARCHY = 69902869; + + UNSPECIFIED = 526786327; + + } + + // [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + optional string display_name = 4473832; + + // [Output Only] The name of the firewall policy. + optional string name = 3373707; + + // The rules that apply to the network. + repeated FirewallPolicyRule rules = 108873975; + + // [Output Only] The short name of the firewall policy. + optional string short_name = 492051566; + + // [Output Only] The type of the firewall policy. + optional Type type = 3575610; + +} + +// +message InstancesGetEffectiveFirewallsResponse { + // Effective firewalls from firewall policies. + repeated InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + + // Effective firewalls on the instance. + repeated Firewall firewalls = 272245619; + +} + +// +message InstancesRemoveResourcePoliciesRequest { + // Resource policies to be removed from this instance. + repeated string resource_policies = 22220385; + +} + +// +message InstancesSetLabelsRequest { + // Fingerprint of the previous set of labels for this resource, used to prevent conflicts. Provide the latest fingerprint value when making a request to add or change labels. + optional string label_fingerprint = 178124825; + + map labels = 500195327; + +} + +// +message InstancesSetMachineResourcesRequest { + // A list of the type and count of accelerator cards attached to the instance. + repeated AcceleratorConfig guest_accelerators = 463595119; + +} + +// +message InstancesSetMachineTypeRequest { + // Full or partial URL of the machine type resource. See Machine Types for a full list of machine types. For example: zones/us-central1-f/machineTypes/n1-standard-1 + optional string machine_type = 227711026; + +} + +// +message InstancesSetMinCpuPlatformRequest { + // Minimum cpu/platform this instance should be started at. + optional string min_cpu_platform = 242912759; + +} + +// +message InstancesSetServiceAccountRequest { + // Email address of the service account. + optional string email = 96619420; + + // The list of scopes to be made available for this service account. + repeated string scopes = 165973151; + +} + +// +message InstancesStartWithEncryptionKeyRequest { + // Array of disks associated with this instance that are protected with a customer-supplied encryption key. + // + // In order to start the instance, the disk url and its corresponding key must be provided. + // + // If the disk is not protected with a customer-supplied encryption key it should not be specified. + repeated CustomerEncryptionKeyProtectedDisk disks = 95594102; + +} + +// Describes a single physical circuit between the Customer and Google. CircuitInfo objects are created by Google, so all fields are output only. +message InterconnectCircuitInfo { + // Customer-side demarc ID for this circuit. + optional string customer_demarc_id = 28771859; + + // Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + optional string google_circuit_id = 262014711; + + // Google-side demarc ID for this circuit. Assigned at circuit turn-up and provided by Google to the customer in the LOA. + optional string google_demarc_id = 448196270; + +} + +// Description of a planned outage on this Interconnect. +message InterconnectOutageNotification { + // Form this outage is expected to take, which can take one of the following values: + // - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. + // - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with "IT_" have been deprecated in favor of the unprefixed values. + enum IssueType { + // A value indicating that the enum field is not set. + UNDEFINED_ISSUE_TYPE = 0; + + IT_OUTAGE = 175779973; + + IT_PARTIAL_OUTAGE = 92103971; + + OUTAGE = 195285745; + + PARTIAL_OUTAGE = 147053455; + + } + + // The party that generated this notification, which can take the following value: + // - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE. + enum Source { + // A value indicating that the enum field is not set. + UNDEFINED_SOURCE = 0; + + GOOGLE = 497439289; + + NSRC_GOOGLE = 510574562; + + } + + // State of this notification, which can take one of the following values: + // - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. + // - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. Note that the versions of this enum prefixed with "NS_" have been deprecated in favor of the unprefixed values. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + ACTIVE = 314733318; + + CANCELLED = 41957681; + + COMPLETED = 309921323; + + NS_ACTIVE = 252563136; + + NS_CANCELED = 506579411; + + } + + // If issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs that will be affected. + repeated string affected_circuits = 177717013; + + // A description about the purpose of the outage. + optional string description = 422937596; + + // Scheduled end time for the outage (milliseconds since Unix epoch). + optional int64 end_time = 114938801; + + // Form this outage is expected to take, which can take one of the following values: + // - OUTAGE: The Interconnect may be completely out of service for some or all of the specified window. + // - PARTIAL_OUTAGE: Some circuits comprising the Interconnect as a whole should remain up, but with reduced bandwidth. Note that the versions of this enum prefixed with "IT_" have been deprecated in favor of the unprefixed values. + optional IssueType issue_type = 369639136; + + // Unique identifier for this outage notification. + optional string name = 3373707; + + // The party that generated this notification, which can take the following value: + // - GOOGLE: this notification as generated by Google. Note that the value of NSRC_GOOGLE has been deprecated in favor of GOOGLE. + optional Source source = 177235995; + + // Scheduled start time for the outage (milliseconds since Unix epoch). + optional int64 start_time = 37467274; + + // State of this notification, which can take one of the following values: + // - ACTIVE: This outage notification is active. The event could be in the past, present, or future. See start_time and end_time for scheduling. + // - CANCELLED: The outage associated with this notification was cancelled before the outage was due to start. Note that the versions of this enum prefixed with "NS_" have been deprecated in favor of the unprefixed values. + optional State state = 109757585; + +} + +// Represents an Interconnect resource. +// +// An Interconnect resource is a dedicated connection between the GCP network and your on-premises network. For more information, read the Dedicated Interconnect Overview. (== resource_for {$api_version}.interconnects ==) +message Interconnect { + // Type of interconnect, which can take one of the following values: + // - PARTNER: A partner-managed interconnection shared between customers though a partner. + // - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. + enum InterconnectType { + // A value indicating that the enum field is not set. + UNDEFINED_INTERCONNECT_TYPE = 0; + + DEDICATED = 258411983; + + IT_PRIVATE = 335677007; + + PARTNER = 461924520; + + } + + // Type of link requested, which can take one of the following values: + // - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics + // - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. + enum LinkType { + // A value indicating that the enum field is not set. + UNDEFINED_LINK_TYPE = 0; + + LINK_TYPE_ETHERNET_100G_LR = 337672551; + + LINK_TYPE_ETHERNET_10G_LR = 236739749; + + } + + // [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: + // - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. + // - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. + // - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + enum OperationalStatus { + // A value indicating that the enum field is not set. + UNDEFINED_OPERATIONAL_STATUS = 0; + + OS_ACTIVE = 55721409; + + OS_UNPROVISIONED = 239771840; + + } + + // [Output Only] The current state of Interconnect functionality, which can take one of the following values: + // - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. + // - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. + // - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + ACTIVE = 314733318; + + UNPROVISIONED = 517333979; + + } + + // Administrative status of the interconnect. When this is set to true, the Interconnect is functional and can carry traffic. When set to false, no packets can be carried over the interconnect and no BGP routes are exchanged over it. By default, the status is set to true. + optional bool admin_enabled = 445675089; + + // [Output Only] A list of CircuitInfo objects, that describe the individual circuits in this LAG. + repeated InterconnectCircuitInfo circuit_infos = 164839855; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // Customer name, to put in the Letter of Authorization as the party authorized to request a crossconnect. + optional string customer_name = 3665484; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] A list of outages expected for this Interconnect. + repeated InterconnectOutageNotification expected_outages = 264484123; + + // [Output Only] IP address configured on the Google side of the Interconnect link. This can be used only for ping tests. + optional string google_ip_address = 443105954; + + // [Output Only] Google reference ID to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. + optional string google_reference_id = 534944469; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] A list of the URLs of all InterconnectAttachments configured to use this Interconnect. + repeated string interconnect_attachments = 425388415; + + // Type of interconnect, which can take one of the following values: + // - PARTNER: A partner-managed interconnection shared between customers though a partner. + // - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED. + optional InterconnectType interconnect_type = 515165259; + + // [Output Only] Type of the resource. Always compute#interconnect for interconnects. + optional string kind = 3292052; + + // Type of link requested, which can take one of the following values: + // - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics + // - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle. + optional LinkType link_type = 523207775; + + // URL of the InterconnectLocation object that represents where this connection is to be provisioned. + optional string location = 290430901; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Email address to contact the customer NOC for operations and maintenance notifications regarding this Interconnect. If specified, this will be used for notifications in addition to all other forms described, such as Stackdriver logs alerting and Cloud Notifications. + optional string noc_contact_email = 14072832; + + // [Output Only] The current status of this Interconnect's functionality, which can take one of the following values: + // - OS_ACTIVE: A valid Interconnect, which is turned up and is ready to use. Attachments may be provisioned on this Interconnect. + // - OS_UNPROVISIONED: An Interconnect that has not completed turnup. No attachments may be provisioned on this Interconnect. + // - OS_UNDER_MAINTENANCE: An Interconnect that is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + optional OperationalStatus operational_status = 201070847; + + // [Output Only] IP address configured on the customer side of the Interconnect link. The customer should configure this IP address during turnup when prompted by Google NOC. This can be used only for ping tests. + optional string peer_ip_address = 207735769; + + // [Output Only] Number of links actually provisioned in this interconnect. + optional int32 provisioned_link_count = 410888565; + + // Target number of physical links in the link bundle, as requested by the customer. + optional int32 requested_link_count = 45051387; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The current state of Interconnect functionality, which can take one of the following values: + // - ACTIVE: The Interconnect is valid, turned up and ready to use. Attachments may be provisioned on this Interconnect. + // - UNPROVISIONED: The Interconnect has not completed turnup. No attachments may be provisioned on this Interconnect. + // - UNDER_MAINTENANCE: The Interconnect is undergoing internal maintenance. No attachments may be provisioned or updated on this Interconnect. + optional State state = 109757585; + +} + +// Informational metadata about Partner attachments from Partners to display to customers. These fields are propagated from PARTNER_PROVIDER attachments to their corresponding PARTNER attachments. +message InterconnectAttachmentPartnerMetadata { + // Plain text name of the Interconnect this attachment is connected to, as displayed in the Partner's portal. For instance "Chicago 1". This value may be validated to match approved Partner values. + optional string interconnect_name = 514963356; + + // Plain text name of the Partner providing this attachment. This value may be validated to match approved Partner values. + optional string partner_name = 161747874; + + // URL of the Partner's portal for this Attachment. Partners may customise this to be a deep link to the specific resource on the Partner portal. This value may be validated to match approved Partner values. + optional string portal_url = 269182748; + +} + +// Information for an interconnect attachment when this belongs to an interconnect of type DEDICATED. +message InterconnectAttachmentPrivateInfo { + // [Output Only] 802.1q encapsulation tag to be used for traffic between Google and the customer, going to and from this network and region. + optional uint32 tag8021q = 271820992; + +} + +// Represents an Interconnect Attachment (VLAN) resource. +// +// You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. (== resource_for {$api_version}.interconnectAttachments ==) +message InterconnectAttachment { + // Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: + // - BPS_50M: 50 Mbit/s + // - BPS_100M: 100 Mbit/s + // - BPS_200M: 200 Mbit/s + // - BPS_300M: 300 Mbit/s + // - BPS_400M: 400 Mbit/s + // - BPS_500M: 500 Mbit/s + // - BPS_1G: 1 Gbit/s + // - BPS_2G: 2 Gbit/s + // - BPS_5G: 5 Gbit/s + // - BPS_10G: 10 Gbit/s + // - BPS_20G: 20 Gbit/s + // - BPS_50G: 50 Gbit/s + enum Bandwidth { + // A value indicating that the enum field is not set. + UNDEFINED_BANDWIDTH = 0; + + BPS_100M = 49547958; + + BPS_10G = 278693006; + + BPS_1G = 355358448; + + BPS_200M = 49577749; + + BPS_20G = 278693967; + + BPS_2G = 355358479; + + BPS_300M = 49607540; + + BPS_400M = 49637331; + + BPS_500M = 49667122; + + BPS_50G = 278696850; + + BPS_50M = 278696856; + + BPS_5G = 355358572; + + } + + // Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: + // - AVAILABILITY_DOMAIN_ANY + // - AVAILABILITY_DOMAIN_1 + // - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + enum EdgeAvailabilityDomain { + // A value indicating that the enum field is not set. + UNDEFINED_EDGE_AVAILABILITY_DOMAIN = 0; + + AVAILABILITY_DOMAIN_1 = 349552090; + + AVAILABILITY_DOMAIN_2 = 349552091; + + AVAILABILITY_DOMAIN_ANY = 375256373; + + } + + // Indicates the user-supplied encryption option of this interconnect attachment: + // - NONE is the default value, which means that the attachment carries unencrypted traffic. VMs can send traffic to, or receive traffic from, this type of attachment. + // - IPSEC indicates that the attachment carries only traffic encrypted by an IPsec device such as an HA VPN gateway. VMs cannot directly send traffic to, or receive traffic from, such an attachment. To use IPsec-encrypted Cloud Interconnect, create the attachment using this option. + // Not currently available in all Interconnect locations. + enum Encryption { + // A value indicating that the enum field is not set. + UNDEFINED_ENCRYPTION = 0; + + IPSEC = 69882282; + + NONE = 2402104; + + } + + // [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: + // - OS_ACTIVE: The attachment has been turned up and is ready to use. + // - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + enum OperationalStatus { + // A value indicating that the enum field is not set. + UNDEFINED_OPERATIONAL_STATUS = 0; + + OS_ACTIVE = 55721409; + + OS_UNPROVISIONED = 239771840; + + } + + // [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: + // - ACTIVE: The attachment has been turned up and is ready to use. + // - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + // - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. + // - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. + // - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. + // - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + ACTIVE = 314733318; + + DEFUNCT = 115891759; + + PARTNER_REQUEST_RECEIVED = 513587304; + + PENDING_CUSTOMER = 167494054; + + PENDING_PARTNER = 387890656; + + STATE_UNSPECIFIED = 470755401; + + UNPROVISIONED = 517333979; + + } + + // The type of interconnect attachment this is, which can take one of the following values: + // - DEDICATED: an attachment to a Dedicated Interconnect. + // - PARTNER: an attachment to a Partner Interconnect, created by the customer. + // - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + DEDICATED = 258411983; + + PARTNER = 461924520; + + PARTNER_PROVIDER = 483261352; + + } + + // Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. + optional bool admin_enabled = 445675089; + + // Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: + // - BPS_50M: 50 Mbit/s + // - BPS_100M: 100 Mbit/s + // - BPS_200M: 200 Mbit/s + // - BPS_300M: 300 Mbit/s + // - BPS_400M: 400 Mbit/s + // - BPS_500M: 500 Mbit/s + // - BPS_1G: 1 Gbit/s + // - BPS_2G: 2 Gbit/s + // - BPS_5G: 5 Gbit/s + // - BPS_10G: 10 Gbit/s + // - BPS_20G: 20 Gbit/s + // - BPS_50G: 50 Gbit/s + optional Bandwidth bandwidth = 181715121; + + // Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. + repeated string candidate_subnets = 237842938; + + // [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. + optional string cloud_router_ip_address = 287392776; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] IPv4 address + prefix length to be configured on the customer router subinterface for this interconnect attachment. + optional string customer_router_ip_address = 332475761; + + // [Output Only] Dataplane version for this InterconnectAttachment. + optional int32 dataplane_version = 34920075; + + // An optional description of this resource. + optional string description = 422937596; + + // Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: + // - AVAILABILITY_DOMAIN_ANY + // - AVAILABILITY_DOMAIN_1 + // - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + optional EdgeAvailabilityDomain edge_availability_domain = 71289510; + + // Indicates the user-supplied encryption option of this interconnect attachment: + // - NONE is the default value, which means that the attachment carries unencrypted traffic. VMs can send traffic to, or receive traffic from, this type of attachment. + // - IPSEC indicates that the attachment carries only traffic encrypted by an IPsec device such as an HA VPN gateway. VMs cannot directly send traffic to, or receive traffic from, such an attachment. To use IPsec-encrypted Cloud Interconnect, create the attachment using this option. + // Not currently available in all Interconnect locations. + optional Encryption encryption = 97980291; + + // [Output Only] Google reference ID, to be used when raising support tickets with Google or otherwise to debug backend connectivity issues. [Deprecated] This field is not used. + optional string google_reference_id = 534944469; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // URL of the underlying Interconnect object that this attachment's traffic will traverse through. + optional string interconnect = 224601230; + + // URL of addresses that have been reserved for the interconnect attachment, Used only for interconnect attachment that has the encryption option as IPSEC. The addresses must be RFC 1918 IP address ranges. When creating HA VPN gateway over the interconnect attachment, if the attachment is configured to use an RFC 1918 IP address, then the VPN gateway's IP address will be allocated from the IP address range specified here. For example, if the HA VPN gateway's interface 0 is paired to this interconnect attachment, then an RFC 1918 IP address for the VPN gateway interface 0 will be allocated from the IP address specified for this interconnect attachment. If this field is not specified for interconnect attachment that has encryption option as IPSEC, later on when creating HA VPN gateway on this interconnect attachment, the HA VPN gateway's IP address will be allocated from regional external IP address pool. + // Not currently available in all Interconnect locations. + repeated string ipsec_internal_addresses = 407648565; + + // [Output Only] Type of the resource. Always compute#interconnectAttachment for interconnect attachments. + optional string kind = 3292052; + + // Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Only 1440 and 1500 are allowed. If not specified, the value will default to 1440. + optional int32 mtu = 108462; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] The current status of whether or not this interconnect attachment is functional, which can take one of the following values: + // - OS_ACTIVE: The attachment has been turned up and is ready to use. + // - OS_UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + optional OperationalStatus operational_status = 201070847; + + // [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present for DEDICATED]. The opaque identifier of an PARTNER attachment used to initiate provisioning with a selected partner. Of the form "XXXXX/region/domain" + optional string pairing_key = 439695464; + + // Optional BGP ASN for the router supplied by a Layer 3 Partner if they configured BGP on behalf of the customer. Output only for PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. + optional int64 partner_asn = 438166149; + + // Informational metadata about Partner attachments from Partners to display to customers. Output only for for PARTNER type, mutable for PARTNER_PROVIDER, not available for DEDICATED. + optional InterconnectAttachmentPartnerMetadata partner_metadata = 65908934; + + // [Output Only] Information specific to an InterconnectAttachment. This property is populated if the interconnect that this is attached to is of type DEDICATED. + optional InterconnectAttachmentPrivateInfo private_interconnect_info = 237270531; + + // [Output Only] URL of the region where the regional interconnect attachment resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // URL of the Cloud Router to be used for dynamic routing. This router must be in the same region as this InterconnectAttachment. The InterconnectAttachment will automatically connect the Interconnect to the network & region within which the Cloud Router is configured. + optional string router = 148608841; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The current state of this attachment's functionality. Enum values ACTIVE and UNPROVISIONED are shared by DEDICATED/PRIVATE, PARTNER, and PARTNER_PROVIDER interconnect attachments, while enum values PENDING_PARTNER, PARTNER_REQUEST_RECEIVED, and PENDING_CUSTOMER are used for only PARTNER and PARTNER_PROVIDER interconnect attachments. This state can take one of the following values: + // - ACTIVE: The attachment has been turned up and is ready to use. + // - UNPROVISIONED: The attachment is not ready to use yet, because turnup is not complete. + // - PENDING_PARTNER: A newly-created PARTNER attachment that has not yet been configured on the Partner side. + // - PARTNER_REQUEST_RECEIVED: A PARTNER attachment is in the process of provisioning after a PARTNER_PROVIDER attachment was created that references it. + // - PENDING_CUSTOMER: A PARTNER or PARTNER_PROVIDER attachment that is waiting for a customer to activate it. + // - DEFUNCT: The attachment was deleted externally and is no longer functional. This could be because the associated Interconnect was removed, or because the other side of a Partner attachment was deleted. + optional State state = 109757585; + + // The type of interconnect attachment this is, which can take one of the following values: + // - DEDICATED: an attachment to a Dedicated Interconnect. + // - PARTNER: an attachment to a Partner Interconnect, created by the customer. + // - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. + optional Type type = 3575610; + + // The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094. Only specified at creation time. + optional int32 vlan_tag8021q = 119927836; + +} + +// +message InterconnectAttachmentsScopedList { + // A list of interconnect attachments contained in this scope. + repeated InterconnectAttachment interconnect_attachments = 425388415; + + // Informational warning which replaces the list of addresses when the list is empty. + optional Warning warning = 50704284; + +} + +// +message InterconnectAttachmentAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InterconnectAttachmentsScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#interconnectAttachmentAggregatedList for aggregated lists of interconnect attachments. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Response to the list request, and contains a list of interconnect attachments. +message InterconnectAttachmentList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InterconnectAttachment resources. + repeated InterconnectAttachment items = 100526016; + + // [Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Describing the ARP neighbor entries seen on this link +message InterconnectDiagnosticsARPEntry { + // The IP address of this ARP neighbor. + optional string ip_address = 406272220; + + // The MAC address of this ARP neighbor. + optional string mac_address = 332540164; + +} + +// +message InterconnectDiagnosticsLinkStatus { + // A list of InterconnectDiagnostics.ARPEntry objects, describing the ARP neighbor entries seen on this link. This will be empty if the link is bundled + repeated InterconnectDiagnosticsARPEntry arp_caches = 414591761; + + // The unique ID for this link assigned during turn up by Google. + optional string circuit_id = 225180977; + + // The Demarc address assigned by Google and provided in the LoA. + optional string google_demarc = 51084; + + optional InterconnectDiagnosticsLinkLACPStatus lacp_status = 361210415; + + // An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the received light level. + optional InterconnectDiagnosticsLinkOpticalPower receiving_optical_power = 244717279; + + // An InterconnectDiagnostics.LinkOpticalPower object, describing the current value and status of the transmitted light level. + optional InterconnectDiagnosticsLinkOpticalPower transmitting_optical_power = 459431197; + +} + +// Diagnostics information about interconnect, contains detailed and current technical information about Google's side of the connection. +message InterconnectDiagnostics { + // A list of InterconnectDiagnostics.ARPEntry objects, describing individual neighbors currently seen by the Google router in the ARP cache for the Interconnect. This will be empty when the Interconnect is not bundled. + repeated InterconnectDiagnosticsARPEntry arp_caches = 414591761; + + // A list of InterconnectDiagnostics.LinkStatus objects, describing the status for each link on the Interconnect. + repeated InterconnectDiagnosticsLinkStatus links = 102977465; + + // The MAC address of the Interconnect's bundle interface. + optional string mac_address = 332540164; + +} + +// +message InterconnectDiagnosticsLinkLACPStatus { + // The state of a LACP link, which can take one of the following values: + // - ACTIVE: The link is configured and active within the bundle. + // - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + ACTIVE = 314733318; + + DETACHED = 216562546; + + } + + // System ID of the port on Google's side of the LACP exchange. + optional string google_system_id = 91210405; + + // System ID of the port on the neighbor's side of the LACP exchange. + optional string neighbor_system_id = 343821342; + + // The state of a LACP link, which can take one of the following values: + // - ACTIVE: The link is configured and active within the bundle. + // - DETACHED: The link is not configured within the bundle. This means that the rest of the object should be empty. + optional State state = 109757585; + +} + +// +message InterconnectDiagnosticsLinkOpticalPower { + // The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: + // - OK: The value has not crossed a warning threshold. + // - LOW_WARNING: The value has crossed below the low warning threshold. + // - HIGH_WARNING: The value has crossed above the high warning threshold. + // - LOW_ALARM: The value has crossed below the low alarm threshold. + // - HIGH_ALARM: The value has crossed above the high alarm threshold. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + HIGH_ALARM = 305363284; + + HIGH_WARNING = 220984799; + + LOW_ALARM = 316659046; + + LOW_WARNING = 338793841; + + OK = 2524; + + } + + // The status of the current value when compared to the warning and alarm levels for the receiving or transmitting transceiver. Possible states include: + // - OK: The value has not crossed a warning threshold. + // - LOW_WARNING: The value has crossed below the low warning threshold. + // - HIGH_WARNING: The value has crossed above the high warning threshold. + // - LOW_ALARM: The value has crossed below the low alarm threshold. + // - HIGH_ALARM: The value has crossed above the high alarm threshold. + optional State state = 109757585; + + // Value of the current receiving or transmitting optical power, read in dBm. Take a known good optical value, give it a 10% margin and trigger warnings relative to that value. In general, a -7dBm warning and a -11dBm alarm are good optical value estimates for most links. + optional float value = 111972721; + +} + +// Response to the list request, and contains a list of interconnects. +message InterconnectList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Interconnect resources. + repeated Interconnect items = 100526016; + + // [Output Only] Type of resource. Always compute#interconnectList for lists of interconnects. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Information about any potential InterconnectAttachments between an Interconnect at a specific InterconnectLocation, and a specific Cloud Region. +message InterconnectLocationRegionInfo { + // Identifies the network presence of this location. + enum LocationPresence { + // A value indicating that the enum field is not set. + UNDEFINED_LOCATION_PRESENCE = 0; + + GLOBAL = 494663587; + + LOCAL_REGION = 403535464; + + LP_GLOBAL = 429584062; + + LP_LOCAL_REGION = 488598851; + + } + + // Expected round-trip time in milliseconds, from this InterconnectLocation to a VM in this region. + optional int64 expected_rtt_ms = 422543866; + + // Identifies the network presence of this location. + optional LocationPresence location_presence = 101517893; + + // URL for the region of this location. + optional string region = 138946292; + +} + +// Represents an Interconnect Attachment (VLAN) Location resource. +// +// You can use this resource to find location details about an Interconnect attachment (VLAN). For more information about interconnect attachments, read Creating VLAN Attachments. +message InterconnectLocation { + // [Output Only] Continent for this location, which can take one of the following values: + // - AFRICA + // - ASIA_PAC + // - EUROPE + // - NORTH_AMERICA + // - SOUTH_AMERICA + enum Continent { + // A value indicating that the enum field is not set. + UNDEFINED_CONTINENT = 0; + + AFRICA = 317443706; + + ASIA_PAC = 119782269; + + C_AFRICA = 71993846; + + C_ASIA_PAC = 465668089; + + C_EUROPE = 200369438; + + C_NORTH_AMERICA = 275697048; + + C_SOUTH_AMERICA = 397149792; + + EUROPE = 445819298; + + NORTH_AMERICA = 448015508; + + SOUTH_AMERICA = 32597340; + + } + + // [Output Only] The status of this InterconnectLocation, which can take one of the following values: + // - CLOSED: The InterconnectLocation is closed and is unavailable for provisioning new Interconnects. + // - AVAILABLE: The InterconnectLocation is available for provisioning new Interconnects. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + AVAILABLE = 442079913; + + CLOSED = 380163436; + + } + + // [Output Only] The postal address of the Point of Presence, each line in the address is separated by a newline character. + optional string address = 462920692; + + // [Output Only] Availability zone for this InterconnectLocation. Within a metropolitan area (metro), maintenance will not be simultaneously scheduled in more than one availability zone. Example: "zone1" or "zone2". + optional string availability_zone = 158459920; + + // [Output Only] Metropolitan area designator that indicates which city an interconnect is located. For example: "Chicago, IL", "Amsterdam, Netherlands". + optional string city = 3053931; + + // [Output Only] Continent for this location, which can take one of the following values: + // - AFRICA + // - ASIA_PAC + // - EUROPE + // - NORTH_AMERICA + // - SOUTH_AMERICA + optional Continent continent = 133442996; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] An optional description of the resource. + optional string description = 422937596; + + // [Output Only] The name of the provider for this facility (e.g., EQUINIX). + optional string facility_provider = 533303309; + + // [Output Only] A provider-assigned Identifier for this facility (e.g., Ashburn-DC1). + optional string facility_provider_facility_id = 87269125; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#interconnectLocation for interconnect locations. + optional string kind = 3292052; + + // [Output Only] Name of the resource. + optional string name = 3373707; + + // [Output Only] The peeringdb identifier for this facility (corresponding with a netfac type in peeringdb). + optional string peeringdb_facility_id = 536567094; + + // [Output Only] A list of InterconnectLocation.RegionInfo objects, that describe parameters pertaining to the relation between this InterconnectLocation and various Google Cloud regions. + repeated InterconnectLocationRegionInfo region_infos = 312194170; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The status of this InterconnectLocation, which can take one of the following values: + // - CLOSED: The InterconnectLocation is closed and is unavailable for provisioning new Interconnects. + // - AVAILABLE: The InterconnectLocation is available for provisioning new Interconnects. + optional Status status = 181260274; + +} + +// Response to the list request, and contains a list of interconnect locations. +message InterconnectLocationList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InterconnectLocation resources. + repeated InterconnectLocation items = 100526016; + + // [Output Only] Type of resource. Always compute#interconnectLocationList for lists of interconnect locations. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Response for the InterconnectsGetDiagnosticsRequest. +message InterconnectsGetDiagnosticsResponse { + optional InterconnectDiagnostics result = 139315229; + +} + +// +message LicenseResourceRequirements { + // Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start. + optional int32 min_guest_cpu_count = 477964836; + + // Minimum memory required to use the Instance. Enforced at Instance creation and Instance start. + optional int32 min_memory_mb = 504785894; + +} + +// Represents a License resource. +// +// A License represents billing and aggregate usage data for public and marketplace images. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. (== resource_for {$api_version}.licenses ==) +message License { + // [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. + optional bool charges_use_fee = 372412622; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional textual description of the resource; provided by the client when the resource is created. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of resource. Always compute#license for licenses. + optional string kind = 3292052; + + // [Output Only] The unique code used to attach this license to images, snapshots, and disks. + optional uint64 license_code = 1467179; + + // Name of the resource. The name must be 1-63 characters long and comply with RFC1035. + optional string name = 3373707; + + optional LicenseResourceRequirements resource_requirements = 214292769; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. + optional bool transferable = 4349893; + +} + +// +message LicenseCodeLicenseAlias { + // [Output Only] Description of this License Code. + optional string description = 422937596; + + // [Output Only] URL of license corresponding to this License Code. + optional string self_link = 456214797; + +} + +// Represents a License Code resource. +// +// A License Code is a unique identifier used to represent a license resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. (== resource_for {$api_version}.licenseCodes ==) +message LicenseCode { + // [Output Only] Current state of this License Code. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + DISABLED = 516696700; + + ENABLED = 182130465; + + RESTRICTED = 261551195; + + STATE_UNSPECIFIED = 470755401; + + TERMINATED = 250018339; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] Description of this License Code. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of resource. Always compute#licenseCode for licenses. + optional string kind = 3292052; + + // [Output Only] URL and description aliases of Licenses with the same License Code. + repeated LicenseCodeLicenseAlias license_alias = 43550930; + + // [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer. + optional string name = 3373707; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] Current state of this License Code. + optional State state = 109757585; + + // [Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred. + optional bool transferable = 4349893; + +} + +// +message LicensesListResponse { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of License resources. + repeated License items = 100526016; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message LocalDisk { + // Specifies the number of such disks. + optional int32 disk_count = 182933485; + + // Specifies the size of the disk in base-2 GB. + optional int32 disk_size_gb = 316263735; + + // Specifies the desired disk type on the node. This disk type must be a local storage type (e.g.: local-ssd). Note that for nodeTemplates, this should be the name of the disk type and not its URL. + optional string disk_type = 93009052; + +} + +// +message LocationPolicyLocation { + // Preference for a given locaction: ALLOW or DENY. + enum Preference { + // A value indicating that the enum field is not set. + UNDEFINED_PREFERENCE = 0; + + ALLOW = 62368553; + + DENY = 2094604; + + PREFERENCE_UNSPECIFIED = 496219571; + + } + + // Preference for a given locaction: ALLOW or DENY. + optional Preference preference = 150781147; + +} + +// Write a Cloud Audit log +message LogConfigCloudAuditOptions { + // The log_name to populate in the Cloud Audit Record. + enum LogName { + // A value indicating that the enum field is not set. + UNDEFINED_LOG_NAME = 0; + + ADMIN_ACTIVITY = 427503135; + + DATA_ACCESS = 238070681; + + UNSPECIFIED_LOG_NAME = 410515182; + + } + + // Information used by the Cloud Audit Logging pipeline. + optional AuthorizationLoggingOptions authorization_logging_options = 217861624; + + // The log_name to populate in the Cloud Audit Record. + optional LogName log_name = 402913958; + +} + +// Increment a streamz counter with the specified metric and field names. +// +// Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended. +// +// Field names correspond to IAM request parameters and field values are their respective values. +// +// Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields. +// +// Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==> increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]} +message LogConfigCounterOptions { + // Custom fields. + repeated LogConfigCounterOptionsCustomField custom_fields = 249651015; + + // The field value to attribute. + optional string field = 97427706; + + // The metric to update. + optional string metric = 533067184; + +} + +// Write a Data Access (Gin) log +message LogConfigDataAccessOptions { + // + enum LogMode { + // A value indicating that the enum field is not set. + UNDEFINED_LOG_MODE = 0; + + LOG_FAIL_CLOSED = 360469778; + + LOG_MODE_UNSPECIFIED = 88160822; + + } + + optional LogMode log_mode = 402897342; + +} + +// Specifies what kind of log the caller must write +message LogConfig { + // Cloud audit options. + optional LogConfigCloudAuditOptions cloud_audit = 412852561; + + // Counter options. + optional LogConfigCounterOptions counter = 420959740; + + // Data access options. + optional LogConfigDataAccessOptions data_access = 286633881; + +} + +// Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields. +message LogConfigCounterOptionsCustomField { + // Name is the field name. + optional string name = 3373707; + + // Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext. + optional string value = 111972721; + +} + +// +message Accelerators { + // Number of accelerator cards exposed to the guest. + optional int32 guest_accelerator_count = 479079316; + + // The accelerator type resource name, not a full URL, e.g. 'nvidia-tesla-k80'. + optional string guest_accelerator_type = 293064725; + +} + +// +message ScratchDisks { + // Size of the scratch disk, defined in GB. + optional int32 disk_gb = 60990141; + +} + +// Represents a Machine Type resource. +// +// You can use specific machine types for your VM instances based on performance and pricing requirements. For more information, read Machine Types. (== resource_for {$api_version}.machineTypes ==) +message MachineType { + // [Output Only] A list of accelerator configurations assigned to this machine type. + repeated Accelerators accelerators = 269577064; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] The deprecation status associated with this machine type. Only applicable if the machine type is unavailable. + optional DeprecationStatus deprecated = 515138995; + + // [Output Only] An optional textual description of the resource. + optional string description = 422937596; + + // [Output Only] The number of virtual CPUs that are available to the instance. + optional int32 guest_cpus = 393356754; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Deprecated] This property is deprecated and will never be populated with any relevant values. + optional int32 image_space_gb = 75331864; + + // [Output Only] Whether this machine type has a shared CPU. See Shared-core machine types for more information. + optional bool is_shared_cpu = 521399555; + + // [Output Only] The type of the resource. Always compute#machineType for machine types. + optional string kind = 3292052; + + // [Output Only] Maximum persistent disks allowed. + optional int32 maximum_persistent_disks = 496220941; + + // [Output Only] Maximum total persistent disks size (GB) allowed. + optional int64 maximum_persistent_disks_size_gb = 154274471; + + // [Output Only] The amount of physical memory available to the instance, defined in MB. + optional int32 memory_mb = 116001171; + + // [Output Only] Name of the resource. + optional string name = 3373707; + + // [Output Only] A list of extended scratch disks assigned to the instance. + repeated ScratchDisks scratch_disks = 480778481; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The name of the zone where the machine type resides, such as us-central1-a. + optional string zone = 3744684; + +} + +// +message MachineTypesScopedList { + // [Output Only] A list of machine types contained in this scope. + repeated MachineType machine_types = 79720065; + + // [Output Only] An informational warning that appears when the machine types list is empty. + optional Warning warning = 50704284; + +} + +// +message MachineTypeAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of MachineTypesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#machineTypeAggregatedList for aggregated lists of machine types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of machine types. +message MachineTypeList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of MachineType resources. + repeated MachineType items = 100526016; + + // [Output Only] Type of resource. Always compute#machineTypeList for lists of machine types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message ManagedInstanceInstanceHealth { + // [Output Only] The current detailed instance health state. + enum DetailedHealthState { + // A value indicating that the enum field is not set. + UNDEFINED_DETAILED_HEALTH_STATE = 0; + + DRAINING = 480455402; + + HEALTHY = 439801213; + + TIMEOUT = 477813057; + + UNHEALTHY = 462118084; + + UNKNOWN = 433141802; + + } + + // [Output Only] The current detailed instance health state. + optional DetailedHealthState detailed_health_state = 510470173; + + // [Output Only] The URL for the health check that verifies whether the instance is healthy. + optional string health_check = 308876645; + +} + +// +message ManagedInstanceLastAttempt { + // [Output Only] Encountered errors during the last attempt to create or delete the instance. + optional Errors errors = 315977579; + +} + +// Preserved state for a given instance. +message PreservedState { + // Preserved disks defined for this instance. This map is keyed with the device names of the disks. + map disks = 95594102; + + // Preserved metadata defined for this instance. + map metadata = 86866735; + +} + +// +message Errors { + // [Output Only] The error type identifier for this error. + optional string code = 3059181; + + // [Output Only] Indicates the field in the request that caused the error. This property is optional. + optional string location = 290430901; + + // [Output Only] An optional, human-readable error message. + optional string message = 418054151; + +} + +// +message Items { + // Key for the metadata entry. Keys must conform to the following regexp: [a-zA-Z0-9-_]+, and be less than 128 bytes in length. This is reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project. + optional string key = 106079; + + // Value for the metadata entry. These are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on values is that their size must be less than or equal to 262144 bytes (256 KiB). + optional string value = 111972721; + +} + +// MetadataFilter label name value pairs that are expected to match corresponding labels presented as metadata to the loadbalancer. +message MetadataFilterLabelMatch { + // Name of metadata label. + // The name can have a maximum length of 1024 characters and must be at least 1 character long. + optional string name = 3373707; + + // The value of the label must match the specified value. + // value can have a maximum length of 1024 characters. + optional string value = 111972721; + +} + +// A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a flag indicating whether Google Compute Engine should automatically create routes for the peering. +message NetworkPeering { + // [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + ACTIVE = 314733318; + + INACTIVE = 270421099; + + } + + // This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + optional bool auto_create_routes = 57454941; + + // Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + optional bool exchange_subnet_routes = 26322256; + + // Whether to export the custom routes to peer network. + optional bool export_custom_routes = 60281485; + + // Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always exported to peers and are not controlled by this field. + optional bool export_subnet_routes_with_public_ip = 97940834; + + // Whether to import the custom routes from peer network. + optional bool import_custom_routes = 197982398; + + // Whether subnet routes with public IP range are imported. The default value is false. The IPv4 special-use ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always imported from peers and are not controlled by this field. + optional bool import_subnet_routes_with_public_ip = 14419729; + + // Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + optional string network = 232872494; + + // Maximum Transmission Unit in bytes. + optional int32 peer_mtu = 69584721; + + // [Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network. + optional State state = 109757585; + + // [Output Only] Details about the current state of the peering. + optional string state_details = 95566996; + +} + +// A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide. +message NetworkRoutingConfig { + // The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. + enum RoutingMode { + // A value indicating that the enum field is not set. + UNDEFINED_ROUTING_MODE = 0; + + GLOBAL = 494663587; + + REGIONAL = 92288543; + + } + + // The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. + optional RoutingMode routing_mode = 475143548; + +} + +// Represents a VPC Network resource. +// +// Networks connect resources to each other and to the internet. For more information, read Virtual Private Cloud (VPC) Network. (== resource_for {$api_version}.networks ==) +message Network { + // Deprecated in favor of subnet mode networks. The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created. + optional string I_pv4_range = 59234358; + + // Must be set to create a VPC network. If not set, a legacy network is created. + // + // When set to true, the VPC network is created in auto mode. When set to false, the VPC network is created in custom mode. + // + // An auto mode VPC network starts with one subnet per region. Each subnet has a predetermined range as described in Auto mode VPC network IP ranges. + // + // For custom mode VPC networks, you can add subnets using the subnetworks insert method. + optional bool auto_create_subnetworks = 256156690; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this field when you create the resource. + optional string description = 422937596; + + // [Output Only] The gateway address for default routing out of the network, selected by GCP. + optional string gateway_i_pv4 = 178678877; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#network for networks. + optional string kind = 3292052; + + // Maximum Transmission Unit in bytes. The minimum value for this field is 1460 and the maximum value is 1500 bytes. + optional int32 mtu = 108462; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + optional string name = 3373707; + + // [Output Only] A list of network peerings for the resource. + repeated NetworkPeering peerings = 69883187; + + // The network-level routing configuration for this network. Used by Cloud Router to determine what type of network-wide routing behavior to enforce. + optional NetworkRoutingConfig routing_config = 523556059; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] Server-defined fully-qualified URLs for all subnetworks in this VPC network. + repeated string subnetworks = 415853125; + +} + +// Configuration for an App Engine network endpoint group (NEG). The service is optional, may be provided explicitly or in the URL mask. The version is optional and can only be provided explicitly or in the URL mask when service is present. +// +// Note: App Engine service must be in the same project and located in the same region as the Serverless NEG. +message NetworkEndpointGroupAppEngine { + // Optional serving service. + // + // The service name is case-sensitive and must be 1-63 characters long. + // + // Example value: "default", "my-service". + optional string service = 373540533; + + // A template to parse service and version fields from a request URL. URL mask allows for routing to multiple App Engine services without having to create multiple Network Endpoint Groups and backend services. + // + // For example, the request URLs "foo1-dot-appname.appspot.com/v1" and "foo1-dot-appname.appspot.com/v2" can be backed by the same Serverless NEG with URL mask "-dot-appname.appspot.com/". The URL mask will parse them to { service = "foo1", version = "v1" } and { service = "foo1", version = "v2" } respectively. + optional string url_mask = 103352252; + + // Optional serving version. + // + // The version name is case-sensitive and must be 1-100 characters long. + // + // Example value: "v1", "v2". + optional string version = 351608024; + +} + +// Configuration for a Cloud Function network endpoint group (NEG). The function must be provided explicitly or in the URL mask. +// +// Note: Cloud Function must be in the same project and located in the same region as the Serverless NEG. +message NetworkEndpointGroupCloudFunction { + // A user-defined name of the Cloud Function. + // + // The function name is case-sensitive and must be 1-63 characters long. + // + // Example value: "func1". + optional string function = 307196888; + + // A template to parse function field from a request URL. URL mask allows for routing to multiple Cloud Functions without having to create multiple Network Endpoint Groups and backend services. + // + // For example, request URLs "mydomain.com/function1" and "mydomain.com/function2" can be backed by the same Serverless NEG with URL mask "/". The URL mask will parse them to { function = "function1" } and { function = "function2" } respectively. + optional string url_mask = 103352252; + +} + +// Configuration for a Cloud Run network endpoint group (NEG). The service must be provided explicitly or in the URL mask. The tag is optional, may be provided explicitly or in the URL mask. +// +// Note: Cloud Run service must be in the same project and located in the same region as the Serverless NEG. +message NetworkEndpointGroupCloudRun { + // Cloud Run service is the main resource of Cloud Run. + // + // The service must be 1-63 characters long, and comply with RFC1035. + // + // Example value: "run-service". + optional string service = 373540533; + + // Optional Cloud Run tag represents the "named-revision" to provide additional fine-grained traffic routing information. + // + // The tag must be 1-63 characters long, and comply with RFC1035. + // + // Example value: "revision-0010". + optional string tag = 114586; + + // A template to parse service and tag fields from a request URL. URL mask allows for routing to multiple Run services without having to create multiple network endpoint groups and backend services. + // + // For example, request URLs "foo1.domain.com/bar1" and "foo1.domain.com/bar2" can be backed by the same Serverless Network Endpoint Group (NEG) with URL mask ".domain.com/". The URL mask will parse them to { service="bar1", tag="foo1" } and { service="bar2", tag="foo2" } respectively. + optional string url_mask = 103352252; + +} + +// Represents a collection of network endpoints. +// +// A network endpoint group (NEG) defines how a set of endpoints should be reached, whether they are reachable, and where they are located. For more information about using NEGs, see Setting up external HTTP(S) Load Balancing with internet NEGs, Setting up zonal NEGs, or Setting up external HTTP(S) Load Balancing with serverless NEGs. (== resource_for {$api_version}.networkEndpointGroups ==) (== resource_for {$api_version}.globalNetworkEndpointGroups ==) (== resource_for {$api_version}.regionNetworkEndpointGroups ==) +message NetworkEndpointGroup { + // Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, or SERVERLESS. + enum NetworkEndpointType { + // A value indicating that the enum field is not set. + UNDEFINED_NETWORK_ENDPOINT_TYPE = 0; + + GCE_VM_IP = 401880793; + + GCE_VM_IP_PORT = 501838375; + + INTERNET_FQDN_PORT = 404154477; + + INTERNET_IP_PORT = 477719963; + + NON_GCP_PRIVATE_IP_PORT = 336447968; + + SERVERLESS = 270492508; + + } + + // Metadata defined as annotations on the network endpoint group. + map annotations = 112032548; + + // Only valid when networkEndpointType is "SERVERLESS". Only one of cloudRun, appEngine or cloudFunction may be set. + optional NetworkEndpointGroupAppEngine app_engine = 340788768; + + // Only valid when networkEndpointType is "SERVERLESS". Only one of cloudRun, appEngine or cloudFunction may be set. + optional NetworkEndpointGroupCloudFunction cloud_function = 519893666; + + // Only valid when networkEndpointType is "SERVERLESS". Only one of cloudRun, appEngine or cloudFunction may be set. + optional NetworkEndpointGroupCloudRun cloud_run = 111060353; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // The default port used if the port number is not specified in the network endpoint. + optional int32 default_port = 423377855; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#networkEndpointGroup for network endpoint group. + optional string kind = 3292052; + + // Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The URL of the network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified. + optional string network = 232872494; + + // Type of network endpoints in this network endpoint group. Can be one of GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT, INTERNET_FQDN_PORT, INTERNET_IP_PORT, or SERVERLESS. + optional NetworkEndpointType network_endpoint_type = 118301523; + + // [Output Only] The URL of the region where the network endpoint group is located. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output only] Number of network endpoints in the network endpoint group. + optional int32 size = 3530753; + + // Optional URL of the subnetwork to which all network endpoints in the NEG belong. + optional string subnetwork = 307827694; + + // [Output Only] The URL of the zone where the network endpoint group is located. + optional string zone = 3744684; + +} + +// +message NetworkEndpointGroupsScopedList { + // [Output Only] The list of network endpoint groups that are contained in this scope. + repeated NetworkEndpointGroup network_endpoint_groups = 29346733; + + // [Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty. + optional Warning warning = 50704284; + +} + +// +message NetworkEndpointGroupAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NetworkEndpointGroupsScopedList resources. + map items = 100526016; + + // [Output Only] The resource type, which is always compute#networkEndpointGroupAggregatedList for aggregated lists of network endpoint groups. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message NetworkEndpointGroupList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NetworkEndpointGroup resources. + repeated NetworkEndpointGroup items = 100526016; + + // [Output Only] The resource type, which is always compute#networkEndpointGroupList for network endpoint group lists. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message NetworkEndpointGroupsAttachEndpointsRequest { + // The list of network endpoints to be attached. + repeated NetworkEndpoint network_endpoints = 149850285; + +} + +// +message NetworkEndpointGroupsDetachEndpointsRequest { + // The list of network endpoints to be detached. + repeated NetworkEndpoint network_endpoints = 149850285; + +} + +// +message NetworkEndpointGroupsListEndpointsRequest { + // Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specify this parameter, the health status of network endpoints will not be provided. + enum HealthStatus { + // A value indicating that the enum field is not set. + UNDEFINED_HEALTH_STATUS = 0; + + SHOW = 2544381; + + SKIP = 2547071; + + } + + // Optional query parameter for showing the health status of each network endpoint. Valid options are SKIP or SHOW. If you don't specify this parameter, the health status of network endpoints will not be provided. + optional HealthStatus health_status = 380545845; + +} + +// +message NetworkEndpointWithHealthStatus { + // [Output only] The health status of network endpoint; + repeated HealthStatusForNetworkEndpoint healths = 258689431; + + // [Output only] The network endpoint; + optional NetworkEndpoint network_endpoint = 56789126; + +} + +// +message NetworkEndpointGroupsListNetworkEndpoints { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NetworkEndpointWithHealthStatus resources. + repeated NetworkEndpointWithHealthStatus items = 100526016; + + // [Output Only] The resource type, which is always compute#networkEndpointGroupsListNetworkEndpoints for the list of network endpoints in the specified network endpoint group. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of networks. +message NetworkList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Network resources. + repeated Network items = 100526016; + + // [Output Only] Type of resource. Always compute#networkList for lists of networks. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message NetworksAddPeeringRequest { + // This field will be deprecated soon. Use exchange_subnet_routes in network_peering instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE. + optional bool auto_create_routes = 57454941; + + // Name of the peering, which should conform to RFC1035. + optional string name = 3373707; + + // Network peering parameters. In order to specify route policies for peering using import and export custom routes, you must specify all peering related parameters (name, peer network, exchange_subnet_routes) in the network_peering field. The corresponding fields in NetworksAddPeeringRequest will be deprecated soon. + optional NetworkPeering network_peering = 328926767; + + // URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network. + optional string peer_network = 500625489; + +} + +// +message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + // [Output Only] The type of the firewall policy. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + HIERARCHY = 69902869; + + NETWORK = 413984270; + + UNSPECIFIED = 526786327; + + } + + // [Output Only] Deprecated, please use short name instead. The display name of the firewall policy. + optional string display_name = 4473832; + + // [Output Only] The name of the firewall policy. + optional string name = 3373707; + + // The rules that apply to the network. + repeated FirewallPolicyRule rules = 108873975; + + // [Output Only] The short name of the firewall policy. + optional string short_name = 492051566; + + // [Output Only] The type of the firewall policy. + optional Type type = 3575610; + +} + +// +message NetworksGetEffectiveFirewallsResponse { + // Effective firewalls from firewall policy. + repeated NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy firewall_policys = 410985794; + + // Effective firewalls on the network. + repeated Firewall firewalls = 272245619; + +} + +// +message NetworksRemovePeeringRequest { + // Name of the peering, which should conform to RFC1035. + optional string name = 3373707; + +} + +// +message NetworksUpdatePeeringRequest { + optional NetworkPeering network_peering = 328926767; + +} + +// +message NodeGroupAutoscalingPolicy { + // The autoscaling mode. Set to one of: ON, OFF, or ONLY_SCALE_OUT. For more information, see Autoscaler modes. + enum Mode { + // A value indicating that the enum field is not set. + UNDEFINED_MODE = 0; + + MODE_UNSPECIFIED = 371348091; + + OFF = 78159; + + ON = 2527; + + ONLY_SCALE_OUT = 152713670; + + } + + // The maximum number of nodes that the group should have. Must be set if autoscaling is enabled. Maximum value allowed is 100. + optional int32 max_nodes = 297762838; + + // The minimum number of nodes that the group should have. + optional int32 min_nodes = 533370500; + + // The autoscaling mode. Set to one of: ON, OFF, or ONLY_SCALE_OUT. For more information, see Autoscaler modes. + optional Mode mode = 3357091; + +} + +// Time window specified for daily maintenance operations. GCE's internal maintenance will be performed within this window. +message NodeGroupMaintenanceWindow { + // [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + optional Duration maintenance_duration = 525291840; + + // Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + optional string start_time = 37467274; + +} + +// Represent a sole-tenant Node Group resource. +// +// A sole-tenant node is a physical server that is dedicated to hosting VM instances only for your specific project. Use sole-tenant nodes to keep your instances physically separated from instances in other projects, or to group your instances together on the same host hardware. For more information, read Sole-tenant nodes. (== resource_for {$api_version}.nodeGroups ==) +message NodeGroup { + // Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. + enum MaintenancePolicy { + // A value indicating that the enum field is not set. + UNDEFINED_MAINTENANCE_POLICY = 0; + + DEFAULT = 115302945; + + MAINTENANCE_POLICY_UNSPECIFIED = 72964182; + + MIGRATE_WITHIN_NODE_GROUP = 153483394; + + RESTART_IN_PLACE = 228647325; + + } + + // + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + INVALID = 530283991; + + READY = 77848963; + + } + + // Specifies how autoscaling should behave. + optional NodeGroupAutoscalingPolicy autoscaling_policy = 221950041; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] The type of the resource. Always compute#nodeGroup for node group. + optional string kind = 3292052; + + // An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate. + optional string location_hint = 350519505; + + // Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT, RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. + optional MaintenancePolicy maintenance_policy = 528327646; + + optional NodeGroupMaintenanceWindow maintenance_window = 186374812; + + // The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // URL of the node template to create the node group from. + optional string node_template = 323154455; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The total number of nodes in the node group. + optional int32 size = 3530753; + + optional Status status = 181260274; + + // [Output Only] The name of the zone where the node group resides, such as us-central1-a. + optional string zone = 3744684; + +} + +// +message NodeGroupsScopedList { + // [Output Only] A list of node groups contained in this scope. + repeated NodeGroup node_groups = 73188017; + + // [Output Only] An informational warning that appears when the nodeGroup list is empty. + optional Warning warning = 50704284; + +} + +// +message NodeGroupAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NodeGroupsScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for aggregated lists of node groups. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of nodeGroups. +message NodeGroupList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NodeGroup resources. + repeated NodeGroup items = 100526016; + + // [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message ServerBinding { + // + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + RESTART_NODE_ON_ANY_SERVER = 502950985; + + RESTART_NODE_ON_MINIMAL_SERVERS = 204166495; + + SERVER_BINDING_TYPE_UNSPECIFIED = 180825512; + + } + + optional Type type = 3575610; + +} + +// +message NodeGroupNode { + // CPU overcommit. + enum CpuOvercommitType { + // A value indicating that the enum field is not set. + UNDEFINED_CPU_OVERCOMMIT_TYPE = 0; + + CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615; + + ENABLED = 182130465; + + NONE = 2402104; + + } + + // + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + INVALID = 530283991; + + READY = 77848963; + + REPAIRING = 413483285; + + } + + // Accelerators for this node. + repeated AcceleratorConfig accelerators = 269577064; + + // CPU overcommit. + optional CpuOvercommitType cpu_overcommit_type = 247727959; + + // Local disk configurations. + repeated LocalDisk disks = 95594102; + + // Instances scheduled on this node. + repeated string instances = 29097598; + + // The name of the node. + optional string name = 3373707; + + // The type of this node. + optional string node_type = 465832791; + + // [Output Only] Reserved for future use. + optional bool satisfies_pzs = 480964267; + + // Binding properties for the physical server. + optional ServerBinding server_binding = 208179593; + + // Server ID associated with this node. + optional string server_id = 339433367; + + optional Status status = 181260274; + +} + +// +message NodeGroupsAddNodesRequest { + // Count of additional nodes to be added to the node group. + optional int32 additional_node_count = 134997930; + +} + +// +message NodeGroupsDeleteNodesRequest { + // Names of the nodes to delete. + repeated string nodes = 104993457; + +} + +// +message NodeGroupsListNodes { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Node resources. + repeated NodeGroupNode items = 100526016; + + // [Output Only] The resource type, which is always compute.nodeGroupsListNodes for the list of nodes in the specified node group. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message NodeGroupsSetNodeTemplateRequest { + // Full or partial URL of the node template resource to be updated for this node group. + optional string node_template = 323154455; + +} + +// +message NodeTemplateNodeTypeFlexibility { + optional string cpus = 3060683; + + optional string local_ssd = 405741360; + + optional string memory = 532856065; + +} + +// Represent a sole-tenant Node Template resource. +// +// You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for {$api_version}.nodeTemplates ==) +message NodeTemplate { + // CPU overcommit. + enum CpuOvercommitType { + // A value indicating that the enum field is not set. + UNDEFINED_CPU_OVERCOMMIT_TYPE = 0; + + CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615; + + ENABLED = 182130465; + + NONE = 2402104; + + } + + // [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + INVALID = 530283991; + + READY = 77848963; + + } + + repeated AcceleratorConfig accelerators = 269577064; + + // CPU overcommit. + optional CpuOvercommitType cpu_overcommit_type = 247727959; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + repeated LocalDisk disks = 95594102; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] The type of the resource. Always compute#nodeTemplate for node templates. + optional string kind = 3292052; + + // The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Labels to use for node affinity, which will be used in instance scheduling. + map node_affinity_labels = 339007161; + + // The node type to use for nodes group that are created from this template. + optional string node_type = 465832791; + + // The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties. + // + // This field is mutually exclusive with the node_type property; you can only define one or the other, but not both. + optional NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905; + + // [Output Only] The name of the region where the node template resides, such as us-central1. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Sets the binding properties for the physical server. Valid values include: + // - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server + // - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible + // + // See Sole-tenant node options for more information. + optional ServerBinding server_binding = 208179593; + + // [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING. + optional Status status = 181260274; + + // [Output Only] An optional, human-readable explanation of the status. + optional string status_message = 297428154; + +} + +// +message NodeTemplatesScopedList { + // [Output Only] A list of node templates contained in this scope. + repeated NodeTemplate node_templates = 354111804; + + // [Output Only] An informational warning that appears when the node templates list is empty. + optional Warning warning = 50704284; + +} + +// +message NodeTemplateAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NodeTemplatesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList for aggregated lists of node templates. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of node templates. +message NodeTemplateList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NodeTemplate resources. + repeated NodeTemplate items = 100526016; + + // [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represent a sole-tenant Node Type resource. +// +// Each node within a node group must have a node type. A node type specifies the total amount of cores and memory for that node. Currently, the only available node type is n1-node-96-624 node type that has 96 vCPUs and 624 GB of memory, available in multiple zones. For more information read Node types. (== resource_for {$api_version}.nodeTypes ==) +message NodeType { + // [Output Only] The CPU platform used by this node type. + optional string cpu_platform = 410285354; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] The deprecation status associated with this node type. + optional DeprecationStatus deprecated = 515138995; + + // [Output Only] An optional textual description of the resource. + optional string description = 422937596; + + // [Output Only] The number of virtual CPUs that are available to the node type. + optional int32 guest_cpus = 393356754; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] The type of the resource. Always compute#nodeType for node types. + optional string kind = 3292052; + + // [Output Only] Local SSD available to the node type, defined in GB. + optional int32 local_ssd_gb = 329237578; + + // [Output Only] The amount of physical memory available to the node type, defined in MB. + optional int32 memory_mb = 116001171; + + // [Output Only] Name of the resource. + optional string name = 3373707; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The name of the zone where the node type resides, such as us-central1-a. + optional string zone = 3744684; + +} + +// +message NodeTypesScopedList { + // [Output Only] A list of node types contained in this scope. + repeated NodeType node_types = 482172924; + + // [Output Only] An informational warning that appears when the node types list is empty. + optional Warning warning = 50704284; + +} + +// +message NodeTypeAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NodeTypesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for aggregated lists of node types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of node types. +message NodeTypeList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NodeType resources. + repeated NodeType items = 100526016; + + // [Output Only] Type of resource.Always compute#nodeTypeList for lists of node types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a gRPC setting that describes one gRPC notification endpoint and the retry duration attempting to send notification to this endpoint. +message NotificationEndpointGrpcSettings { + // Optional. If specified, this field is used to set the authority header by the sender of notifications. See https://tools.ietf.org/html/rfc7540#section-8.1.2.3 + optional string authority = 401868611; + + // Endpoint to which gRPC notifications are sent. This must be a valid gRPCLB DNS name. + optional string endpoint = 130489749; + + // Optional. If specified, this field is used to populate the "name" field in gRPC requests. + optional string payload_name = 300358300; + + // Optional. This field is used to configure how often to send a full update of all non-healthy backends. If unspecified, full updates are not sent. If specified, must be in the range between 600 seconds to 3600 seconds. Nanos are disallowed. + optional Duration resend_interval = 478288969; + + // How much time (in seconds) is spent attempting notification retries until a successful response is received. Default is 30s. Limit is 20m (1200s). Must be a positive number. + optional uint32 retry_duration_sec = 115681117; + +} + +// Represents a notification endpoint. +// +// A notification endpoint resource defines an endpoint to receive notifications when there are status changes detected by the associated health check service. +// +// For more information, see Health checks overview. (== resource_for {$api_version}.notificationEndpoint ==) (== resource_for {$api_version}.regionNotificationEndpoints ==) +message NotificationEndpoint { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Settings of the gRPC notification endpoint including the endpoint URL and the retry duration. + optional NotificationEndpointGrpcSettings grpc_settings = 456139556; + + // [Output Only] A unique identifier for this resource type. The server generates this identifier. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] URL of the region where the notification endpoint resides. This field applies only to the regional resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + +} + +// +message NotificationEndpointList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of NotificationEndpoint resources. + repeated NotificationEndpoint items = 100526016; + + // [Output Only] Type of the resource. Always compute#notificationEndpoint for notification endpoints. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// [Output Only] If errors are generated during processing of the operation, this field will be populated. +message Error { + // [Output Only] The array of errors encountered while processing this operation. + repeated Errors errors = 315977579; + +} + +// +message Warnings { + // [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + enum Code { + // A value indicating that the enum field is not set. + UNDEFINED_CODE = 0; + + CLEANUP_FAILED = 150308440; + + DEPRECATED_RESOURCE_USED = 391835586; + + DEPRECATED_TYPE_USED = 346526230; + + DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967; + + EXPERIMENTAL_TYPE_USED = 451954443; + + EXTERNAL_API_WARNING = 175546307; + + FIELD_VALUE_OVERRIDEN = 329669423; + + INJECTED_KERNELS_DEPRECATED = 417377419; + + LARGE_DEPLOYMENT_WARNING = 481440678; + + MISSING_TYPE_DEPENDENCY = 344505463; + + NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999; + + NEXT_HOP_CANNOT_IP_FORWARD = 383382887; + + NEXT_HOP_INSTANCE_NOT_FOUND = 464250446; + + NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146; + + NEXT_HOP_NOT_RUNNING = 417081265; + + NOT_CRITICAL_ERROR = 105763924; + + NO_RESULTS_ON_PAGE = 30036744; + + PARTIAL_SUCCESS = 39966469; + + REQUIRED_TOS_AGREEMENT = 3745539; + + RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641; + + RESOURCE_NOT_DELETED = 168598460; + + SCHEMA_VALIDATION_IGNORED = 275245642; + + SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617; + + UNDECLARED_PROPERTIES = 390513439; + + UNREACHABLE = 13328052; + + } + + // [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + optional Code code = 3059181; + + // [Output Only] Metadata about this warning in key: value format. For example: + // "data": [ { "key": "scope", "value": "zones/us-east1-d" } + repeated Data data = 3076010; + + // [Output Only] A human-readable description of the warning code. + optional string message = 418054151; + +} + +// Represents an Operation resource. +// +// Google Compute Engine has three Operation resources: +// +// * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations) +// +// You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. +// +// Operations can be global, regional or zonal. +// - For global operations, use the `globalOperations` resource. +// - For regional operations, use the `regionOperations` resource. +// - For zonal operations, use the `zonalOperations` resource. +// +// For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==) +message Operation { + // [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + DONE = 2104194; + + PENDING = 35394935; + + RUNNING = 121282975; + + } + + // [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. + optional string client_operation_id = 297240295; + + // [Deprecated] This field is deprecated. + optional string creation_timestamp = 30525366; + + // [Output Only] A textual description of the operation, which is set when the operation is created. + optional string description = 422937596; + + // [Output Only] The time that this operation was completed. This value is in RFC3339 text format. + optional string end_time = 114938801; + + // [Output Only] If errors are generated during processing of the operation, this field will be populated. + optional Error error = 96784904; + + // [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`. + optional string http_error_message = 202521945; + + // [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found. + optional int32 http_error_status_code = 312345196; + + // [Output Only] The unique identifier for the operation. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] The time that this operation was requested. This value is in RFC3339 text format. + optional string insert_time = 433722515; + + // [Output Only] Type of the resource. Always `compute#operation` for Operation resources. + optional string kind = 3292052; + + // [Output Only] Name of the operation. + optional string name = 3373707; + + // [Output Only] An ID that represents a group of operations, such as when a group of operations results from a `bulkInsert` API request. + optional string operation_group_id = 40171187; + + // [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on. + optional string operation_type = 177650450; + + // [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses. + optional int32 progress = 72663597; + + // [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. + optional string start_time = 37467274; + + // [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`. + optional Status status = 181260274; + + // [Output Only] An optional textual description of the current status of the operation. + optional string status_message = 297428154; + + // [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. + optional uint64 target_id = 258165385; + + // [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from. + optional string target_link = 62671336; + + // [Output Only] User who requested the operation, for example: `user@example.com`. + optional string user = 3599307; + + // [Output Only] If warning messages are generated during processing of the operation, this field will be populated. + repeated Warnings warnings = 498091095; + + // [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. + optional string zone = 3744684; + +} + +// +message OperationsScopedList { + // [Output Only] A list of operations contained in this scope. + repeated Operation operations = 4184044; + + // [Output Only] Informational warning which replaces the list of operations when the list is empty. + optional Warning warning = 50704284; + +} + +// +message OperationAggregatedList { + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output Only] A map of scoped operation lists. + map items = 100526016; + + // [Output Only] Type of resource. Always `compute#operationAggregatedList` for aggregated lists of operations. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than `maxResults`, use the `nextPageToken` as a value for the query parameter `pageToken` in the next list request. Subsequent list requests will have their own `nextPageToken` to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of Operation resources. +message OperationList { + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output Only] A list of Operation resources. + repeated Operation items = 100526016; + + // [Output Only] Type of resource. Always `compute#operations` for Operations resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than `maxResults`, use the `nextPageToken` as a value for the query parameter `pageToken` in the next list request. Subsequent list requests will have their own `nextPageToken` to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message PacketMirroringForwardingRuleInfo { + // [Output Only] Unique identifier for the forwarding rule; defined by the server. + optional string canonical_url = 512294820; + + // Resource URL to the forwarding rule representing the ILB configured as destination of the mirrored traffic. + optional string url = 116079; + +} + +// +message PacketMirroringFilter { + // Direction of traffic to mirror, either INGRESS, EGRESS, or BOTH. The default is BOTH. + enum Direction { + // A value indicating that the enum field is not set. + UNDEFINED_DIRECTION = 0; + + BOTH = 2044801; + + EGRESS = 432880501; + + INGRESS = 516931221; + + } + + // Protocols that apply as filter on mirrored traffic. If no protocols are specified, all traffic that matches the specified CIDR ranges is mirrored. If neither cidrRanges nor IPProtocols is specified, all traffic is mirrored. + repeated string I_p_protocols = 98544854; + + // IP CIDR ranges that apply as filter on the source (ingress) or destination (egress) IP in the IP header. Only IPv4 is supported. If no ranges are specified, all traffic that matches the specified IPProtocols is mirrored. If neither cidrRanges nor IPProtocols is specified, all traffic is mirrored. + repeated string cidr_ranges = 487901697; + + // Direction of traffic to mirror, either INGRESS, EGRESS, or BOTH. The default is BOTH. + optional Direction direction = 111150975; + +} + +// +message PacketMirroringMirroredResourceInfo { + // A set of virtual machine instances that are being mirrored. They must live in zones contained in the same region as this packetMirroring. + // + // Note that this config will apply only to those network interfaces of the Instances that belong to the network specified in this packetMirroring. + // + // You may specify a maximum of 50 Instances. + repeated PacketMirroringMirroredResourceInfoInstanceInfo instances = 29097598; + + // A set of subnetworks for which traffic from/to all VM instances will be mirrored. They must live in the same region as this packetMirroring. + // + // You may specify a maximum of 5 subnetworks. + repeated PacketMirroringMirroredResourceInfoSubnetInfo subnetworks = 415853125; + + // A set of mirrored tags. Traffic from/to all VM instances that have one or more of these tags will be mirrored. + repeated string tags = 3552281; + +} + +// +message PacketMirroringNetworkInfo { + // [Output Only] Unique identifier for the network; defined by the server. + optional string canonical_url = 512294820; + + // URL of the network resource. + optional string url = 116079; + +} + +// Represents a Packet Mirroring resource. +// +// Packet Mirroring clones the traffic of specified instances in your Virtual Private Cloud (VPC) network and forwards it to a collector destination, such as an instance group of an internal TCP/UDP load balancer, for analysis or examination. For more information about setting up Packet Mirroring, see Using Packet Mirroring. (== resource_for {$api_version}.packetMirrorings ==) +message PacketMirroring { + // Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. + // + // The default is TRUE. + enum Enable { + // A value indicating that the enum field is not set. + UNDEFINED_ENABLE = 0; + + FALSE = 66658563; + + TRUE = 2583950; + + } + + // The Forwarding Rule resource of type loadBalancingScheme=INTERNAL that will be used as collector for mirrored traffic. The specified forwarding rule must have isMirroringCollector set to true. + optional PacketMirroringForwardingRuleInfo collector_ilb = 426607853; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. + // + // The default is TRUE. + optional Enable enable = 311764355; + + // Filter for mirrored traffic. If unspecified, all traffic is mirrored. + optional PacketMirroringFilter filter = 336120696; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#packetMirroring for packet mirrorings. + optional string kind = 3292052; + + // PacketMirroring mirroredResourceInfos. MirroredResourceInfo specifies a set of mirrored VM instances, subnetworks and/or tags for which traffic from/to all VM instances will be mirrored. + optional PacketMirroringMirroredResourceInfo mirrored_resources = 124817348; + + // Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Specifies the mirrored VPC network. Only packets in this network will be mirrored. All mirrored VMs should have a NIC in the given network. All mirrored subnetworks should belong to the given network. + optional PacketMirroringNetworkInfo network = 232872494; + + // The priority of applying this configuration. Priority is used to break ties in cases where there is more than one matching rule. In the case of two rules that apply for a given Instance, the one with the lowest-numbered priority value wins. + // + // Default value is 1000. Valid range is 0 through 65535. + optional uint32 priority = 445151652; + + // [Output Only] URI of the region where the packetMirroring resides. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + +} + +// +message PacketMirroringsScopedList { + // A list of packetMirrorings contained in this scope. + repeated PacketMirroring packet_mirrorings = 154615079; + + // Informational warning which replaces the list of packetMirrorings when the list is empty. + optional Warning warning = 50704284; + +} + +// Contains a list of packetMirrorings. +message PacketMirroringAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of PacketMirroring resources. + map items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of PacketMirroring resources. +message PacketMirroringList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of PacketMirroring resources. + repeated PacketMirroring items = 100526016; + + // [Output Only] Type of resource. Always compute#packetMirroring for packetMirrorings. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message PacketMirroringMirroredResourceInfoInstanceInfo { + // [Output Only] Unique identifier for the instance; defined by the server. + optional string canonical_url = 512294820; + + // Resource URL to the virtual machine instance which is being mirrored. + optional string url = 116079; + +} + +// +message PacketMirroringMirroredResourceInfoSubnetInfo { + // [Output Only] Unique identifier for the subnetwork; defined by the server. + optional string canonical_url = 512294820; + + // Resource URL to the subnetwork for which traffic from/to all VM instances will be mirrored. + optional string url = 116079; + +} + +// A path-matching rule for a URL. If matched, will use the specified BackendService to handle the traffic arriving at this URL. +message PathRule { + // The list of path patterns to match. Each must start with / and the only place a * is allowed is at the end following a /. The string fed to the path matcher does not include any text after the first ? or #, and those chars are not allowed here. + repeated string paths = 106438894; + + // In response to a matching path, the load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. + // Only one of routeAction or urlRedirect must be set. + // UrlMaps for external HTTP(S) load balancers support only the urlRewrite action within a pathRule's routeAction. + optional HttpRouteAction route_action = 424563948; + + // The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendService s. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. + // Only one of urlRedirect, service or routeAction.weightedBackendService must be set. + optional string service = 373540533; + + // When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. + // If urlRedirect is specified, service or routeAction must not be set. + // Not supported when the URL map is bound to target gRPC proxy. + optional HttpRedirectAction url_redirect = 405147820; + +} + +// A matcher for the path portion of the URL. The BackendService from the longest-matched rule will serve the URL. If no rule was matched, the default service will be used. +message PathMatcher { + // defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + // Only one of defaultRouteAction or defaultUrlRedirect must be set. + // UrlMaps for external HTTP(S) load balancers support only the urlRewrite action within a pathMatcher's defaultRouteAction. + optional HttpRouteAction default_route_action = 378919466; + + // The full or partial URL to the BackendService resource. This will be used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: + // - https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService + // - compute/v1/projects/project/global/backendServices/backendService + // - global/backendServices/backendService If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. + // Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + // Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: + // - compute.backendBuckets.use + // - compute.backendServices.use + optional string default_service = 370242231; + + // When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. + // If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. + // Not supported when the URL map is bound to target gRPC proxy. + optional HttpRedirectAction default_url_redirect = 359503338; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Specifies changes to request and response headers that need to take effect for the selected backendService. + // HeaderAction specified here are applied after the matching HttpRouteRule HeaderAction and before the HeaderAction in the UrlMap + // Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional HttpHeaderAction header_action = 328077352; + + // The name to which this PathMatcher is referred by the HostRule. + optional string name = 3373707; + + // The list of path rules. Use this list instead of routeRules when routing based on simple path matching is all that's required. The order by which path rules are specified does not matter. Matches are always done on the longest-path-first basis. + // For example: a pathRule with a path /a/b/c/* will match before /a/b/* irrespective of the order in which those paths appear in this list. + // Within a given pathMatcher, only one of pathRules or routeRules must be set. + repeated PathRule path_rules = 104439901; + + // The list of HTTP route rules. Use this list instead of pathRules when advanced route matching and routing actions are desired. routeRules are evaluated in order of priority, from the lowest to highest number. + // Within a given pathMatcher, you can set only one of pathRules or routeRules. + repeated HttpRouteRule route_rules = 376292225; + +} + +// A rule to be applied in a Policy. +message Rule { + // Required + enum Action { + // A value indicating that the enum field is not set. + UNDEFINED_ACTION = 0; + + ALLOW = 62368553; + + ALLOW_WITH_LOG = 76034177; + + DENY = 2094604; + + DENY_WITH_LOG = 351433982; + + LOG = 75556; + + NO_ACTION = 260643444; + + } + + // Required + optional Action action = 187661878; + + // Additional restrictions that must be met. All conditions must pass for the rule to match. + repeated Condition conditions = 142882488; + + // Human-readable description of the rule. + optional string description = 422937596; + + // If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. + repeated string ins = 104430; + + // The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. + repeated LogConfig log_configs = 152873846; + + // If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. + repeated string not_ins = 518443138; + + // A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. + repeated string permissions = 59962500; + +} + +// +message WafExpressionSet { + // A list of alternate IDs. The format should be: - E.g. XSS-stable Generic suffix like "stable" is particularly useful if a policy likes to avail newer set of expressions without having to change the policy. A given alias name can't be used for more than one entity set. + repeated string aliases = 159207166; + + // List of available expressions. + repeated WafExpressionSetExpression expressions = 175554779; + + // Google specified expression set ID. The format should be: - E.g. XSS-20170329 + optional string id = 3355; + +} + +// +message PreconfiguredWafSet { + // List of entities that are currently supported for WAF rules. + repeated WafExpressionSet expression_sets = 474011032; + +} + +// +message PreservedStatePreservedDisk { + // These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + enum AutoDelete { + // A value indicating that the enum field is not set. + UNDEFINED_AUTO_DELETE = 0; + + NEVER = 74175084; + + ON_PERMANENT_INSTANCE_DELETION = 95727719; + + } + + // The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + enum Mode { + // A value indicating that the enum field is not set. + UNDEFINED_MODE = 0; + + READ_ONLY = 91950261; + + READ_WRITE = 173607894; + + } + + // These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + optional AutoDelete auto_delete = 464761403; + + // The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode. + optional Mode mode = 3357091; + + // The URL of the disk resource that is stateful and should be attached to the VM instance. + optional string source = 177235995; + +} + +// A quotas entry. +message Quota { + // [Output Only] Name of the quota metric. + enum Metric { + // A value indicating that the enum field is not set. + UNDEFINED_METRIC = 0; + + A2_CPUS = 153206585; + + AFFINITY_GROUPS = 108303563; + + AUTOSCALERS = 471248988; + + BACKEND_BUCKETS = 137626846; + + BACKEND_SERVICES = 269623753; + + C2D_CPUS = 508182517; + + C2_CPUS = 317601211; + + COMMITMENTS = 456141790; + + COMMITTED_A2_CPUS = 59330902; + + COMMITTED_C2D_CPUS = 282390904; + + COMMITTED_C2_CPUS = 223725528; + + COMMITTED_CPUS = 292394702; + + COMMITTED_E2_CPUS = 388120154; + + COMMITTED_LICENSES = 357606869; + + COMMITTED_LOCAL_SSD_TOTAL_GB = 308393480; + + COMMITTED_MEMORY_OPTIMIZED_CPUS = 489057886; + + COMMITTED_N2A_CPUS = 40064304; + + COMMITTED_N2D_CPUS = 125951757; + + COMMITTED_N2_CPUS = 322589603; + + COMMITTED_NVIDIA_A100_GPUS = 375799445; + + COMMITTED_NVIDIA_K80_GPUS = 3857188; + + COMMITTED_NVIDIA_P100_GPUS = 107528100; + + COMMITTED_NVIDIA_P4_GPUS = 347952897; + + COMMITTED_NVIDIA_T4_GPUS = 139871237; + + COMMITTED_NVIDIA_V100_GPUS = 219562; + + CPUS = 2075595; + + CPUS_ALL_REGIONS = 470911149; + + DISKS_TOTAL_GB = 353520543; + + E2_CPUS = 481995837; + + EXTERNAL_NETWORK_LB_FORWARDING_RULES = 374298265; + + EXTERNAL_PROTOCOL_FORWARDING_RULES = 63478888; + + EXTERNAL_VPN_GATEWAYS = 272457134; + + FIREWALLS = 374485843; + + FORWARDING_RULES = 432668949; + + GLOBAL_INTERNAL_ADDRESSES = 42738332; + + GPUS_ALL_REGIONS = 39387177; + + HEALTH_CHECKS = 289347502; + + IMAGES = 15562360; + + INSTANCES = 131337822; + + INSTANCE_GROUPS = 355919038; + + INSTANCE_GROUP_MANAGERS = 101798192; + + INSTANCE_TEMPLATES = 226188271; + + INTERCONNECTS = 415204741; + + INTERCONNECT_ATTACHMENTS_PER_REGION = 159968086; + + INTERCONNECT_ATTACHMENTS_TOTAL_MBPS = 425090419; + + INTERCONNECT_TOTAL_GBPS = 285341866; + + INTERNAL_ADDRESSES = 197899392; + + INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES = 266433668; + + IN_PLACE_SNAPSHOTS = 151359133; + + IN_USE_ADDRESSES = 402125072; + + IN_USE_BACKUP_SCHEDULES = 32786705; + + IN_USE_SNAPSHOT_SCHEDULES = 462104083; + + LOCAL_SSD_TOTAL_GB = 330878021; + + M1_CPUS = 37203366; + + M2_CPUS = 65832517; + + MACHINE_IMAGES = 446986640; + + N2A_CPUS = 265855917; + + N2D_CPUS = 351743370; + + N2_CPUS = 416465286; + + NETWORKS = 485481477; + + NETWORK_ENDPOINT_GROUPS = 102144909; + + NETWORK_FIREWALL_POLICIES = 101117374; + + NODE_GROUPS = 24624817; + + NODE_TEMPLATES = 474896668; + + NVIDIA_A100_GPUS = 504872978; + + NVIDIA_K80_GPUS = 163886599; + + NVIDIA_P100_GPUS = 236601633; + + NVIDIA_P100_VWS_GPUS = 213970574; + + NVIDIA_P4_GPUS = 283841470; + + NVIDIA_P4_VWS_GPUS = 528296619; + + NVIDIA_T4_GPUS = 75759810; + + NVIDIA_T4_VWS_GPUS = 319813039; + + NVIDIA_V100_GPUS = 129293095; + + PACKET_MIRRORINGS = 15578407; + + PD_EXTREME_TOTAL_PROVISIONED_IOPS = 69593965; + + PREEMPTIBLE_CPUS = 251184841; + + PREEMPTIBLE_LOCAL_SSD_GB = 260819336; + + PREEMPTIBLE_NVIDIA_A100_GPUS = 68832784; + + PREEMPTIBLE_NVIDIA_K80_GPUS = 374960201; + + PREEMPTIBLE_NVIDIA_P100_GPUS = 337432351; + + PREEMPTIBLE_NVIDIA_P100_VWS_GPUS = 313544076; + + PREEMPTIBLE_NVIDIA_P4_GPUS = 429197628; + + PREEMPTIBLE_NVIDIA_P4_VWS_GPUS = 252981545; + + PREEMPTIBLE_NVIDIA_T4_GPUS = 221115968; + + PREEMPTIBLE_NVIDIA_T4_VWS_GPUS = 44497965; + + PREEMPTIBLE_NVIDIA_V100_GPUS = 230123813; + + PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK = 231164291; + + PUBLIC_ADVERTISED_PREFIXES = 471371980; + + PUBLIC_DELEGATED_PREFIXES = 532465974; + + REGIONAL_AUTOSCALERS = 29363772; + + REGIONAL_INSTANCE_GROUP_MANAGERS = 37543696; + + RESERVATIONS = 32644647; + + RESOURCE_POLICIES = 83955297; + + ROUTERS = 493018666; + + ROUTES = 275680074; + + SECURITY_POLICIES = 189518703; + + SECURITY_POLICY_CEVAL_RULES = 470815689; + + SECURITY_POLICY_RULES = 203549225; + + SNAPSHOTS = 343405327; + + SSD_TOTAL_GB = 161732561; + + SSL_CERTIFICATES = 378372399; + + STATIC_ADDRESSES = 93624049; + + STATIC_BYOIP_ADDRESSES = 275809649; + + SUBNETWORKS = 421330469; + + TARGET_HTTPS_PROXIES = 219522506; + + TARGET_HTTP_PROXIES = 164117155; + + TARGET_INSTANCES = 284519728; + + TARGET_POOLS = 348261257; + + TARGET_SSL_PROXIES = 159216235; + + TARGET_TCP_PROXIES = 182243136; + + TARGET_VPN_GATEWAYS = 75029928; + + URL_MAPS = 378660743; + + VPN_GATEWAYS = 35620282; + + VPN_TUNNELS = 104327296; + + XPN_SERVICE_PROJECTS = 95191981; + + } + + // [Output Only] Quota limit for this metric. + optional double limit = 102976443; + + // [Output Only] Name of the quota metric. + optional Metric metric = 533067184; + + // [Output Only] Owning resource. This is the resource on which this quota is applied. + optional string owner = 106164915; + + // [Output Only] Current usage of this metric. + optional double usage = 111574433; + +} + +// The location in Cloud Storage and naming method of the daily usage report. Contains bucket_name and report_name prefix. +message UsageExportLocation { + // The name of an existing bucket in Cloud Storage where the usage report object is stored. The Google Service Account is granted write access to this bucket. This can either be the bucket name by itself, such as example-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://example-bucket. + optional string bucket_name = 283610048; + + // An optional prefix for the name of the usage report object stored in bucketName. If not supplied, defaults to usage. The report is stored as a CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. If you supply a prefix, it should conform to Cloud Storage object naming conventions. + optional string report_name_prefix = 320198715; + +} + +// Represents a Project resource. +// +// A project is used to organize resources in a Google Cloud Platform environment. For more information, read about the Resource Hierarchy. (== resource_for {$api_version}.projects ==) +message Project { + // This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + enum DefaultNetworkTier { + // A value indicating that the enum field is not set. + UNDEFINED_DEFAULT_NETWORK_TIER = 0; + + PREMIUM = 399530551; + + STANDARD = 484642493; + + } + + // [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + enum XpnProjectStatus { + // A value indicating that the enum field is not set. + UNDEFINED_XPN_PROJECT_STATUS = 0; + + HOST = 2223528; + + UNSPECIFIED_XPN_PROJECT_STATUS = 340393257; + + } + + // Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. + optional Metadata common_instance_metadata = 185794117; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // This signifies the default network tier used for configuring resources of the project and can only take the following values: PREMIUM, STANDARD. Initially the default network tier is PREMIUM. + optional DefaultNetworkTier default_network_tier = 471753361; + + // [Output Only] Default service account used by VMs running in this project. + optional string default_service_account = 298712229; + + // An optional textual description of the resource. + optional string description = 422937596; + + // Restricted features enabled for use on this project. + repeated string enabled_features = 469017467; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#project for projects. + optional string kind = 3292052; + + // The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. + optional string name = 3373707; + + // [Output Only] Quotas assigned to this project. + repeated Quota quotas = 125341947; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. + optional UsageExportLocation usage_export_location = 347543874; + + // [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. + optional XpnProjectStatus xpn_project_status = 228419265; + +} + +// Service resource (a.k.a service project) ID. +message XpnResourceId { + // The type of the service resource. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + PROJECT = 408671993; + + XPN_RESOURCE_TYPE_UNSPECIFIED = 151607034; + + } + + // The ID of the service resource. In the case of projects, this field supports project id (e.g., my-project-123) and project number (e.g. 12345678). + optional string id = 3355; + + // The type of the service resource. + optional Type type = 3575610; + +} + +// +message ProjectsDisableXpnResourceRequest { + // Service resource (a.k.a service project) ID. + optional XpnResourceId xpn_resource = 133384631; + +} + +// +message ProjectsEnableXpnResourceRequest { + // Service resource (a.k.a service project) ID. + optional XpnResourceId xpn_resource = 133384631; + +} + +// +message ProjectsGetXpnResources { + // [Output Only] Type of resource. Always compute#projectsGetXpnResources for lists of service resources (a.k.a service projects) + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // Service resources (a.k.a service projects) attached to this project as their shared VPC host. + repeated XpnResourceId resources = 164412965; + +} + +// +message ProjectsListXpnHostsRequest { + // Optional organization ID managed by Cloud Resource Manager, for which to list shared VPC host projects. If not specified, the organization will be inferred from the project. + optional string organization = 105180467; + +} + +// +message ProjectsSetDefaultNetworkTierRequest { + // Default network tier to be set. + enum NetworkTier { + // A value indicating that the enum field is not set. + UNDEFINED_NETWORK_TIER = 0; + + PREMIUM = 399530551; + + STANDARD = 484642493; + + } + + // Default network tier to be set. + optional NetworkTier network_tier = 517397843; + +} + +// Represents a CIDR range which can be used to assign addresses. +message PublicAdvertisedPrefixPublicDelegatedPrefix { + // The IP address range of the public delegated prefix + optional string ip_range = 145092645; + + // The name of the public delegated prefix + optional string name = 3373707; + + // The project number of the public delegated prefix + optional string project = 227560217; + + // The region of the public delegated prefix if it is regional. If absent, the prefix is global. + optional string region = 138946292; + + // The status of the public delegated prefix. Possible values are: INITIALIZING: The public delegated prefix is being initialized and addresses cannot be created yet. ANNOUNCED: The public delegated prefix is active. + optional string status = 181260274; + +} + +// A public advertised prefix represents an aggregated IP prefix or netblock which customers bring to cloud. The IP prefix is a single unit of route advertisement and is announced globally to the internet. +message PublicAdvertisedPrefix { + // The status of the public advertised prefix. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + INITIAL = 518841124; + + PREFIX_CONFIGURATION_COMPLETE = 480889551; + + PREFIX_CONFIGURATION_IN_PROGRESS = 378550961; + + PREFIX_REMOVAL_IN_PROGRESS = 284375783; + + PTR_CONFIGURED = 513497167; + + REVERSE_DNS_LOOKUP_FAILED = 295755183; + + VALIDATED = 66197998; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // The IPv4 address to be used for reverse DNS verification. + optional string dns_verification_ip = 241011381; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource type. The server generates this identifier. + optional uint64 id = 3355; + + // The IPv4 address range, in CIDR format, represented by this public advertised prefix. + optional string ip_cidr_range = 98117322; + + // [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] The list of public delegated prefixes that exist for this public advertised prefix. + repeated PublicAdvertisedPrefixPublicDelegatedPrefix public_delegated_prefixs = 425811723; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The shared secret to be used for reverse DNS verification. + optional string shared_secret = 381932490; + + // The status of the public advertised prefix. + optional Status status = 181260274; + +} + +// +message PublicAdvertisedPrefixList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of PublicAdvertisedPrefix resources. + repeated PublicAdvertisedPrefix items = 100526016; + + // [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a sub PublicDelegatedPrefix. +message PublicDelegatedPrefixPublicDelegatedSubPrefix { + // [Output Only] The status of the sub public delegated prefix. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + ACTIVE = 314733318; + + INACTIVE = 270421099; + + } + + // Name of the project scoping this PublicDelegatedSubPrefix. + optional string delegatee_project = 414860634; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // The IPv4 address range, in CIDR format, represented by this sub public delegated prefix. + optional string ip_cidr_range = 98117322; + + // Whether the sub prefix is delegated to create Address resources in the delegatee project. + optional bool is_address = 352617951; + + // The name of the sub public delegated prefix. + optional string name = 3373707; + + // [Output Only] The region of the sub public delegated prefix if it is regional. If absent, the sub prefix is global. + optional string region = 138946292; + + // [Output Only] The status of the sub public delegated prefix. + optional Status status = 181260274; + +} + +// A PublicDelegatedPrefix resource represents an IP block within a PublicAdvertisedPrefix that is configured within a single cloud scope (global or region). IPs in the block can be allocated to resources within that scope. Public delegated prefixes may be further broken up into smaller IP blocks in the same scope as the parent block. +message PublicDelegatedPrefix { + // [Output Only] The status of the public delegated prefix. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + ANNOUNCED = 365103355; + + DELETING = 528602024; + + INITIALIZING = 306588749; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicDelegatedPrefix. An up-to-date fingerprint must be provided in order to update the PublicDelegatedPrefix, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve a PublicDelegatedPrefix. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource type. The server generates this identifier. + optional uint64 id = 3355; + + // The IPv4 address range, in CIDR format, represented by this public delegated prefix. + optional string ip_cidr_range = 98117322; + + // If true, the prefix will be live migrated. + optional bool is_live_migration = 511823856; + + // [Output Only] Type of the resource. Always compute#publicDelegatedPrefix for public delegated prefixes. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The URL of parent prefix. Either PublicAdvertisedPrefix or PublicDelegatedPrefix. + optional string parent_prefix = 15233991; + + // The list of sub public delegated prefixes that exist for this public delegated prefix. + repeated PublicDelegatedPrefixPublicDelegatedSubPrefix public_delegated_sub_prefixs = 188940044; + + // [Output Only] URL of the region where the public delegated prefix resides. This field applies only to the region resource. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The status of the public delegated prefix. + optional Status status = 181260274; + +} + +// +message PublicDelegatedPrefixesScopedList { + // [Output Only] A list of PublicDelegatedPrefixes contained in this scope. + repeated PublicDelegatedPrefix public_delegated_prefixes = 315261206; + + // [Output Only] Informational warning which replaces the list of public delegated prefixes when the list is empty. + optional Warning warning = 50704284; + +} + +// +message PublicDelegatedPrefixAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of PublicDelegatedPrefixesScopedList resources. + map items = 100526016; + + // [Output Only] Type of the resource. Always compute#publicDelegatedPrefixAggregatedList for aggregated lists of public delegated prefixes. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message PublicDelegatedPrefixList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of PublicDelegatedPrefix resources. + repeated PublicDelegatedPrefix items = 100526016; + + // [Output Only] Type of the resource. Always compute#publicDelegatedPrefixList for public delegated prefixes. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a Region resource. +// +// A region is a geographical area where a resource is located. For more information, read Regions and Zones. (== resource_for {$api_version}.regions ==) +message Region { + // [Output Only] Status of the region, either UP or DOWN. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + DOWN = 2104482; + + UP = 2715; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] The deprecation status associated with this region. + optional DeprecationStatus deprecated = 515138995; + + // [Output Only] Textual description of the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#region for regions. + optional string kind = 3292052; + + // [Output Only] Name of the resource. + optional string name = 3373707; + + // [Output Only] Quotas assigned to this region. + repeated Quota quotas = 125341947; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] Status of the region, either UP or DOWN. + optional Status status = 181260274; + + // [Output Only] Reserved for future use. + optional bool supports_pzs = 83983214; + + // [Output Only] A list of zones available in this region, in the form of resource URLs. + repeated string zones = 116085319; + +} + +// Contains a list of autoscalers. +message RegionAutoscalerList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Autoscaler resources. + repeated Autoscaler items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message RegionDiskTypeList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of DiskType resources. + repeated DiskType items = 100526016; + + // [Output Only] Type of resource. Always compute#regionDiskTypeList for region disk types. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message RegionDisksAddResourcePoliciesRequest { + // Resource policies to be added to this disk. + repeated string resource_policies = 22220385; + +} + +// +message RegionDisksRemoveResourcePoliciesRequest { + // Resource policies to be removed from this disk. + repeated string resource_policies = 22220385; + +} + +// +message RegionDisksResizeRequest { + // The new size of the regional persistent disk, which is specified in GB. + optional int64 size_gb = 494929369; + +} + +// Contains a list of InstanceGroup resources. +message RegionInstanceGroupList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceGroup resources. + repeated InstanceGroup items = 100526016; + + // The resource type. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// RegionInstanceGroupManagers.deletePerInstanceConfigs +message RegionInstanceGroupManagerDeleteInstanceConfigReq { + // The list of instance names for which we want to delete per-instance configs on this managed instance group. + repeated string names = 104585032; + +} + +// Contains a list of managed instance groups. +message RegionInstanceGroupManagerList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceGroupManager resources. + repeated InstanceGroupManager items = 100526016; + + // [Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups that exist in th regional scope. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// RegionInstanceGroupManagers.patchPerInstanceConfigs +message RegionInstanceGroupManagerPatchInstanceConfigReq { + // The list of per-instance configs to insert or patch on this managed instance group. + repeated PerInstanceConfig per_instance_configs = 526265001; + +} + +// RegionInstanceGroupManagers.updatePerInstanceConfigs +message RegionInstanceGroupManagerUpdateInstanceConfigReq { + // The list of per-instance configs to insert or patch on this managed instance group. + repeated PerInstanceConfig per_instance_configs = 526265001; + +} + +// +message RegionInstanceGroupManagersAbandonInstancesRequest { + // The URLs of one or more instances to abandon. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + +} + +// RegionInstanceGroupManagers.applyUpdatesToInstances +message RegionInstanceGroupManagersApplyUpdatesRequest { + // Flag to update all instances instead of specified list of ?instances?. If the flag is set to true then the instances may not be specified in the request. + optional bool all_instances = 403676512; + + // The list of URLs of one or more instances for which you want to apply updates. Each URL can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + + // The minimal action that you want to perform on each instance during the update: + // - REPLACE: At minimum, delete the instance and create it again. + // - RESTART: Stop the instance and start it again. + // - REFRESH: Do not stop the instance. + // - NONE: Do not disrupt the instance at all. By default, the minimum action is NONE. If your update requires a more disruptive action than you set with this flag, the necessary action is performed to execute the update. + optional string minimal_action = 270567060; + + // The most disruptive action that you want to perform on each instance during the update: + // - REPLACE: Delete the instance and create it again. + // - RESTART: Stop the instance and start it again. + // - REFRESH: Do not stop the instance. + // - NONE: Do not disrupt the instance at all. By default, the most disruptive allowed action is REPLACE. If your update requires a more disruptive action than you set with this flag, the update request will fail. + optional string most_disruptive_allowed_action = 66103053; + +} + +// RegionInstanceGroupManagers.createInstances +message RegionInstanceGroupManagersCreateInstancesRequest { + // [Required] List of specifications of per-instance configs. + repeated PerInstanceConfig instances = 29097598; + +} + +// +message RegionInstanceGroupManagersDeleteInstancesRequest { + // The URLs of one or more instances to delete. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + +} + +// +message RegionInstanceGroupManagersListErrorsResponse { + // [Output Only] The list of errors of the managed instance group. + repeated InstanceManagedByIgmError items = 100526016; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + +} + +// +message RegionInstanceGroupManagersListInstanceConfigsResp { + // [Output Only] The list of PerInstanceConfig. + repeated PerInstanceConfig items = 100526016; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message RegionInstanceGroupManagersListInstancesResponse { + // A list of managed instances. + repeated ManagedInstance managed_instances = 336219614; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + +} + +// +message RegionInstanceGroupManagersRecreateRequest { + // The URLs of one or more instances to recreate. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + repeated string instances = 29097598; + +} + +// +message RegionInstanceGroupManagersSetTargetPoolsRequest { + // Fingerprint of the target pools information, which is a hash of the contents. This field is used for optimistic locking when you update the target pool entries. This field is optional. + optional string fingerprint = 234678500; + + // The URL of all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group. + repeated string target_pools = 336072617; + +} + +// +message RegionInstanceGroupManagersSetTemplateRequest { + // URL of the InstanceTemplate resource from which all new instances will be created. + optional string instance_template = 309248228; + +} + +// +message RegionInstanceGroupsListInstances { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of InstanceWithNamedPorts resources. + repeated InstanceWithNamedPorts items = 100526016; + + // The resource type. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message RegionInstanceGroupsListInstancesRequest { + // Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. + enum InstanceState { + // A value indicating that the enum field is not set. + UNDEFINED_INSTANCE_STATE = 0; + + ALL = 64897; + + RUNNING = 121282975; + + } + + // Instances in which state should be returned. Valid options are: 'ALL', 'RUNNING'. By default, it lists all instances. + optional InstanceState instance_state = 92223591; + + // Name of port user is interested in. It is optional. If it is set, only information about this ports will be returned. If it is not set, all the named ports will be returned. Always lists all instances. + optional string port_name = 41534345; + +} + +// +message RegionInstanceGroupsSetNamedPortsRequest { + // The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request. + optional string fingerprint = 234678500; + + // The list of named ports to set for this instance group. + repeated NamedPort named_ports = 427598732; + +} + +// Contains a list of region resources. +message RegionList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Region resources. + repeated Region items = 100526016; + + // [Output Only] Type of resource. Always compute#regionList for lists of regions. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message RegionSetLabelsRequest { + // The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint. + optional string label_fingerprint = 178124825; + + // The labels to set for this resource. + map labels = 500195327; + +} + +// +message RegionSetPolicyRequest { + // Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + repeated Binding bindings = 403251854; + + // Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + optional string etag = 3123477; + + // 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 in general a valid policy but certain services (like Projects) might reject them. + optional Policy policy = 91071794; + +} + +// +message RegionTargetHttpsProxiesSetSslCertificatesRequest { + // New set of SslCertificate resources to associate with this TargetHttpsProxy resource. Currently exactly one SslCertificate resource must be specified. + repeated string ssl_certificates = 366006543; + +} + +// Represents a URL Map resource. +// +// Google Compute Engine has two URL Map resources: +// +// * [Global](/compute/docs/reference/rest/{$api_version}/urlMaps) * [Regional](/compute/docs/reference/rest/{$api_version}/regionUrlMaps) +// +// A URL map resource is a component of certain types of GCP load balancers and Traffic Director. +// +// * urlMaps are used by external HTTP(S) load balancers and Traffic Director. * regionUrlMaps are used by internal HTTP(S) load balancers. +// +// For a list of supported URL map features by load balancer type, see the Load balancing features: Routing and traffic management table. +// +// For a list of supported URL map features for Traffic Director, see the Traffic Director features: Routing and traffic management table. +// +// This resource defines mappings from host names and URL paths to either a backend service or a backend bucket. +// +// To use the global urlMaps resource, the backend service must have a loadBalancingScheme of either EXTERNAL or INTERNAL_SELF_MANAGED. To use the regionUrlMaps resource, the backend service must have a loadBalancingScheme of INTERNAL_MANAGED. For more information, read URL Map Concepts. +message UrlMap { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions like URL rewrites, header transformations, etc. prior to forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. + // Only one of defaultRouteAction or defaultUrlRedirect must be set. + // UrlMaps for external HTTP(S) load balancers support only the urlRewrite action within defaultRouteAction. + // defaultRouteAction has no effect when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional HttpRouteAction default_route_action = 378919466; + + // The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is additionally specified, advanced routing actions like URL Rewrites, etc. take effect prior to sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. + // Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set. + // defaultService has no effect when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional string default_service = 370242231; + + // When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. + // If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. + // Not supported when the URL map is bound to target gRPC proxy. + optional HttpRedirectAction default_url_redirect = 359503338; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a UrlMap. An up-to-date fingerprint must be provided in order to update the UrlMap, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve a UrlMap. + optional string fingerprint = 234678500; + + // Specifies changes to request and response headers that need to take effect for the selected backendService. + // The headerAction specified here take effect after headerAction specified under pathMatcher. + // Note that headerAction is not supported for Loadbalancers that have their loadBalancingScheme set to EXTERNAL. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + optional HttpHeaderAction header_action = 328077352; + + // The list of HostRules to use against the URL. + repeated HostRule host_rules = 311804832; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#urlMaps for url maps. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The list of named PathMatchers to use against the URL. + repeated PathMatcher path_matchers = 271664219; + + // [Output Only] URL of the region where the regional URL map resides. This field is not applicable to global URL maps. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // The list of expected URL mapping tests. Request to update this UrlMap will succeed only if all of the test cases pass. You can specify a maximum of 100 tests per UrlMap. + // Not supported when the URL map is bound to target gRPC proxy that has validateForProxyless field set to true. + repeated UrlMapTest tests = 110251553; + +} + +// +message RegionUrlMapsValidateRequest { + // Content of the UrlMap to be validated. + optional UrlMap resource = 195806222; + +} + +// +message ReservationsScopedList { + // A list of reservations contained in this scope. + repeated Reservation reservations = 399717927; + + // Informational warning which replaces the list of reservations when the list is empty. + optional Warning warning = 50704284; + +} + +// Contains a list of reservations. +message ReservationAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Allocation resources. + map items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message ReservationList { + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output Only] A list of Allocation resources. + repeated Reservation items = 100526016; + + // [Output Only] Type of resource.Always compute#reservationsList for listsof reservations + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message ReservationsResizeRequest { + // Number of allocated resources can be resized with minimum = 1 and maximum = 1000. + optional int64 specific_sku_count = 13890720; + +} + +// +message ResourceGroupReference { + // A URI referencing one of the instance groups or network endpoint groups listed in the backend service. + optional string group = 98629247; + +} + +// Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them to schedule persistent disk snapshots. +// +// (== resource_for {$api_version}.resourcePolicies ==) +message ResourcePolicy { + // [Output Only] The status of resource policy creation. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + EXPIRED = 482489093; + + INVALID = 530283991; + + READY = 77848963; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + optional string description = 422937596; + + // Resource policy for instances for placement configuration. + optional ResourcePolicyGroupPlacementPolicy group_placement_policy = 10931596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // Resource policy for scheduling instance operations. + optional ResourcePolicyInstanceSchedulePolicy instance_schedule_policy = 344877104; + + // [Output Only] Type of the resource. Always compute#resource_policies for resource policies. + optional string kind = 3292052; + + // The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + optional string region = 138946292; + + // [Output Only] The system status of the resource policy. + optional ResourcePolicyResourceStatus resource_status = 249429315; + + // [Output Only] Server-defined fully-qualified URL for this resource. + optional string self_link = 456214797; + + // Resource policy for persistent disks for creating snapshots. + optional ResourcePolicySnapshotSchedulePolicy snapshot_schedule_policy = 218131295; + + // [Output Only] The status of resource policy creation. + optional Status status = 181260274; + +} + +// +message ResourcePoliciesScopedList { + // A list of resourcePolicies contained in this scope. + repeated ResourcePolicy resource_policies = 22220385; + + // Informational warning which replaces the list of resourcePolicies when the list is empty. + optional Warning warning = 50704284; + +} + +// A GroupPlacementPolicy specifies resource placement configuration. It specifies the failure bucket separation as well as network locality +message ResourcePolicyGroupPlacementPolicy { + // Specifies network collocation + enum Collocation { + // A value indicating that the enum field is not set. + UNDEFINED_COLLOCATION = 0; + + COLLOCATED = 103257554; + + UNSPECIFIED_COLLOCATION = 464308205; + + } + + // The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network + optional int32 availability_domain_count = 12453432; + + // Specifies network collocation + optional Collocation collocation = 511156533; + + // Number of vms in this placement group + optional int32 vm_count = 261463431; + +} + +// An InstanceSchedulePolicy specifies when and how frequent certain operations are performed on the instance. +message ResourcePolicyInstanceSchedulePolicy { + // The expiration time of the schedule. The timestamp is an RFC3339 string. + optional string expiration_time = 230299229; + + // The start time of the schedule. The timestamp is an RFC3339 string. + optional string start_time = 37467274; + + // Specifies the time zone to be used in interpreting Schedule.schedule. The value of this field must be a time zone name from the tz database: http://en.wikipedia.org/wiki/Tz_database. + optional string time_zone = 36848094; + + // Specifies the schedule for starting instances. + optional ResourcePolicyInstanceSchedulePolicySchedule vm_start_schedule = 17762396; + + // Specifies the schedule for stopping instances. + optional ResourcePolicyInstanceSchedulePolicySchedule vm_stop_schedule = 426242732; + +} + +// Contains output only fields. Use this sub-message for all output fields set on ResourcePolicy. The internal structure of this "status" field should mimic the structure of ResourcePolicy proto specification. +message ResourcePolicyResourceStatus { + // [Output Only] Specifies a set of output values reffering to the instance_schedule_policy system status. This field should have the same name as corresponding policy field. + optional ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance_schedule_policy = 344877104; + +} + +// A snapshot schedule policy specifies when and how frequently snapshots are to be created for the target disk. Also specifies how many and how long these scheduled snapshots should be retained. +message ResourcePolicySnapshotSchedulePolicy { + // Retention policy applied to snapshots created by this resource policy. + optional ResourcePolicySnapshotSchedulePolicyRetentionPolicy retention_policy = 68625779; + + // A Vm Maintenance Policy specifies what kind of infrastructure maintenance we are allowed to perform on this VM and when. Schedule that is applied to disks covered by this policy. + optional ResourcePolicySnapshotSchedulePolicySchedule schedule = 375820951; + + // Properties with which snapshots are created such as labels, encryption keys. + optional ResourcePolicySnapshotSchedulePolicySnapshotProperties snapshot_properties = 185371278; + +} + +// Contains a list of resourcePolicies. +message ResourcePolicyAggregatedList { + optional string etag = 3123477; + + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of ResourcePolicy resources. + map items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Time window specified for daily operations. +message ResourcePolicyDailyCycle { + // Defines a schedule with units measured in months. The value determines how many months pass between the start of each cycle. + optional int32 days_in_cycle = 369790004; + + // [Output only] A predetermined duration for the window, automatically chosen to be the smallest possible in the given scenario. + optional string duration = 155471252; + + // Start time of the window. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. + optional string start_time = 37467274; + +} + +// Time window specified for hourly operations. +message ResourcePolicyHourlyCycle { + // [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + optional string duration = 155471252; + + // Defines a schedule with units measured in hours. The value determines how many hours pass between the start of each cycle. + optional int32 hours_in_cycle = 526763132; + + // Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + optional string start_time = 37467274; + +} + +// Schedule for an instance operation. +message ResourcePolicyInstanceSchedulePolicySchedule { + // Specifies the frequency for the operation, using the unix-cron format. + optional string schedule = 375820951; + +} + +// +message ResourcePolicyList { + optional string etag = 3123477; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output Only] A list of ResourcePolicy resources. + repeated ResourcePolicy items = 100526016; + + // [Output Only] Type of resource.Always compute#resourcePoliciesList for listsof resourcePolicies + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message ResourcePolicyResourceStatusInstanceSchedulePolicyStatus { + // [Output Only] The last time the schedule successfully ran. The timestamp is an RFC3339 string. + optional string last_run_start_time = 303069063; + + // [Output Only] The next time the schedule is planned to run. The actual time might be slightly different. The timestamp is an RFC3339 string. + optional string next_run_start_time = 318642570; + +} + +// Policy for retention of scheduled snapshots. +message ResourcePolicySnapshotSchedulePolicyRetentionPolicy { + // Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. + enum OnSourceDiskDelete { + // A value indicating that the enum field is not set. + UNDEFINED_ON_SOURCE_DISK_DELETE = 0; + + APPLY_RETENTION_POLICY = 535071332; + + KEEP_AUTO_SNAPSHOTS = 258925689; + + UNSPECIFIED_ON_SOURCE_DISK_DELETE = 239140769; + + } + + // Maximum age of the snapshot that is allowed to be kept. + optional int32 max_retention_days = 324296979; + + // Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. + optional OnSourceDiskDelete on_source_disk_delete = 321955529; + +} + +// A schedule for disks where the schedueled operations are performed. +message ResourcePolicySnapshotSchedulePolicySchedule { + optional ResourcePolicyDailyCycle daily_schedule = 86159869; + + optional ResourcePolicyHourlyCycle hourly_schedule = 38328485; + + optional ResourcePolicyWeeklyCycle weekly_schedule = 359548053; + +} + +// Specified snapshot properties for scheduled snapshots created by this policy. +message ResourcePolicySnapshotSchedulePolicySnapshotProperties { + // Chain name that the snapshot is created in. + optional string chain_name = 68644169; + + // Indication to perform a 'guest aware' snapshot. + optional bool guest_flush = 385550813; + + // Labels to apply to scheduled snapshots. These can be later modified by the setLabels method. Label values may be empty. + map labels = 500195327; + + // Cloud Storage bucket storage location of the auto snapshot (regional or multi-regional). + repeated string storage_locations = 328005274; + +} + +// Time window specified for weekly operations. +message ResourcePolicyWeeklyCycle { + // Up to 7 intervals/windows, one for each day of the week. + repeated ResourcePolicyWeeklyCycleDayOfWeek day_of_weeks = 257871834; + +} + +// +message ResourcePolicyWeeklyCycleDayOfWeek { + // Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + enum Day { + // A value indicating that the enum field is not set. + UNDEFINED_DAY = 0; + + FRIDAY = 471398751; + + INVALID = 530283991; + + MONDAY = 132310288; + + SATURDAY = 279037881; + + SUNDAY = 309626320; + + THURSDAY = 207198682; + + TUESDAY = 277509677; + + WEDNESDAY = 422029110; + + } + + // Defines a schedule that runs on specific days of the week. Specify one or more days. The following options are available: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY. + optional Day day = 99228; + + // [Output only] Duration of the time window, automatically chosen to be smallest possible in the given scenario. + optional string duration = 155471252; + + // Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. + optional string start_time = 37467274; + +} + +// Represents a Route resource. +// +// A route defines a path from VM instances in the VPC network to a specific destination. This destination can be inside or outside the VPC network. For more information, read the Routes overview. (== resource_for {$api_version}.routes ==) +message Route { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this field when you create the resource. + optional string description = 422937596; + + // The destination range of outgoing packets that this route applies to. Both IPv4 and IPv6 are supported. + optional string dest_range = 381327712; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of this resource. Always compute#routes for Route resources. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. + optional string name = 3373707; + + // Fully-qualified URL of the network that this route applies to. + optional string network = 232872494; + + // The URL to a gateway that should handle matching packets. You can only specify the internet gateway using a full or partial valid URL: projects/project/global/gateways/default-internet-gateway + optional string next_hop_gateway = 377175298; + + // The URL to a forwarding rule of type loadBalancingScheme=INTERNAL that should handle matching packets or the IP address of the forwarding Rule. For example, the following are all valid URLs: + // - 10.128.0.56 + // - https://www.googleapis.com/compute/v1/projects/project/regions/region/forwardingRules/forwardingRule + // - regions/region/forwardingRules/forwardingRule + optional string next_hop_ilb = 198679901; + + // The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + optional string next_hop_instance = 393508247; + + // The network IP address of an instance that should handle matching packets. Only IPv4 is supported. + optional string next_hop_ip = 110319529; + + // The URL of the local network if it should handle matching packets. + optional string next_hop_network = 262295788; + + // [Output Only] The network peering name that should handle matching packets, which should conform to RFC1035. + optional string next_hop_peering = 412682750; + + // The URL to a VpnTunnel that should handle matching packets. + optional string next_hop_vpn_tunnel = 519844501; + + // The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In cases where multiple routes have equal prefix length, the one with the lowest-numbered priority value wins. The default value is `1000`. The priority value must be from `0` to `65535`, inclusive. + optional uint32 priority = 445151652; + + // [Output Only] Server-defined fully-qualified URL for this resource. + optional string self_link = 456214797; + + // A list of instance tags to which this route applies. + repeated string tags = 3552281; + + // [Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages. + repeated Warnings warnings = 498091095; + +} + +// Contains a list of Route resources. +message RouteList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Route resources. + repeated Route items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message RouterBgp { + // User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. + enum AdvertiseMode { + // A value indicating that the enum field is not set. + UNDEFINED_ADVERTISE_MODE = 0; + + CUSTOM = 388595569; + + DEFAULT = 115302945; + + } + + // + enum AdvertisedGroups { + // A value indicating that the enum field is not set. + UNDEFINED_ADVERTISED_GROUPS = 0; + + ALL_SUBNETS = 3622872; + + } + + // User-specified flag to indicate which mode to use for advertisement. The options are DEFAULT or CUSTOM. + optional AdvertiseMode advertise_mode = 312134331; + + // User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + repeated AdvertisedGroups advertised_groups = 21065526; + + // User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + repeated RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + + // Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, either 16-bit or 32-bit. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. + optional uint32 asn = 96892; + +} + +// +message RouterBgpPeer { + // User-specified flag to indicate which mode to use for advertisement. + enum AdvertiseMode { + // A value indicating that the enum field is not set. + UNDEFINED_ADVERTISE_MODE = 0; + + CUSTOM = 388595569; + + DEFAULT = 115302945; + + } + + // + enum AdvertisedGroups { + // A value indicating that the enum field is not set. + UNDEFINED_ADVERTISED_GROUPS = 0; + + ALL_SUBNETS = 3622872; + + } + + // [Output Only] The resource that configures and manages this BGP peer. + // - MANAGED_BY_USER is the default value and can be managed by you or other users + // - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. + enum ManagementType { + // A value indicating that the enum field is not set. + UNDEFINED_MANAGEMENT_TYPE = 0; + + MANAGED_BY_ATTACHMENT = 458926411; + + MANAGED_BY_USER = 317294067; + + } + + // User-specified flag to indicate which mode to use for advertisement. + optional AdvertiseMode advertise_mode = 312134331; + + // User-specified list of prefix groups to advertise in custom mode, which can take one of the following options: + // - ALL_SUBNETS: Advertises all available subnets, including peer VPC subnets. + // - ALL_VPC_SUBNETS: Advertises the router's own VPC subnets. Note that this field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These groups are advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. + repeated AdvertisedGroups advertised_groups = 21065526; + + // User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertise_mode is CUSTOM and overrides the list defined for the router (in the "bgp" message). These IP ranges are advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. + repeated RouterAdvertisedIpRange advertised_ip_ranges = 35449932; + + // The priority of routes advertised to this BGP peer. Where there is more than one matching route of maximum length, the routes with the lowest priority value win. + optional uint32 advertised_route_priority = 186486332; + + // Name of the interface the BGP peer is associated with. + optional string interface_name = 437854673; + + // IP address of the interface inside Google Cloud Platform. Only IPv4 is supported. + optional string ip_address = 406272220; + + // [Output Only] The resource that configures and manages this BGP peer. + // - MANAGED_BY_USER is the default value and can be managed by you or other users + // - MANAGED_BY_ATTACHMENT is a BGP peer that is configured and managed by Cloud Interconnect, specifically by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of BGP peer when the PARTNER InterconnectAttachment is created, updated, or deleted. + optional ManagementType management_type = 173703606; + + // Name of this BGP peer. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Peer BGP Autonomous System Number (ASN). Each BGP interface may use a different value. + optional uint32 peer_asn = 69573151; + + // IP address of the BGP interface outside Google Cloud Platform. Only IPv4 is supported. + optional string peer_ip_address = 207735769; + +} + +// +message RouterInterface { + // [Output Only] The resource that configures and manages this interface. + // - MANAGED_BY_USER is the default value and can be managed directly by users. + // - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. + enum ManagementType { + // A value indicating that the enum field is not set. + UNDEFINED_MANAGEMENT_TYPE = 0; + + MANAGED_BY_ATTACHMENT = 458926411; + + MANAGED_BY_USER = 317294067; + + } + + // IP address and range of the interface. The IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example: 169.254.0.1/30. NOTE: Do not truncate the address as it represents the IP address of the interface. + optional string ip_range = 145092645; + + // URI of the linked Interconnect attachment. It must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a virtual machine instance. + optional string linked_interconnect_attachment = 501085518; + + // URI of the linked VPN tunnel, which must be in the same region as the router. Each interface can have one linked resource, which can be a VPN tunnel, an Interconnect attachment, or a virtual machine instance. + optional string linked_vpn_tunnel = 352296953; + + // [Output Only] The resource that configures and manages this interface. + // - MANAGED_BY_USER is the default value and can be managed directly by users. + // - MANAGED_BY_ATTACHMENT is an interface that is configured and managed by Cloud Interconnect, specifically, by an InterconnectAttachment of type PARTNER. Google automatically creates, updates, and deletes this type of interface when the PARTNER InterconnectAttachment is created, updated, or deleted. + optional ManagementType management_type = 173703606; + + // Name of this interface entry. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + +} + +// Represents a Nat resource. It enables the VMs within the specified subnetworks to access Internet without external IP addresses. It specifies a list of subnetworks (and the ranges within) that want to use NAT. Customers can also provide the external IPs that would be used for NAT. GCP would auto-allocate ephemeral IPs if no external IPs are provided. +message RouterNat { + // Specify the NatIpAllocateOption, which can take one of the following values: + // - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. + // - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. + enum NatIpAllocateOption { + // A value indicating that the enum field is not set. + UNDEFINED_NAT_IP_ALLOCATE_OPTION = 0; + + AUTO_ONLY = 182333500; + + MANUAL_ONLY = 261251205; + + } + + // Specify the Nat option, which can take one of the following values: + // - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. + // - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. + // - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region. + enum SourceSubnetworkIpRangesToNat { + // A value indicating that the enum field is not set. + UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT = 0; + + ALL_SUBNETWORKS_ALL_IP_RANGES = 179964376; + + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES = 185573819; + + LIST_OF_SUBNETWORKS = 517542270; + + } + + // A list of URLs of the IP resources to be drained. These IPs must be valid static external IPs that have been assigned to the NAT. These IPs should be used for updating/patching a NAT only. + repeated string drain_nat_ips = 504078535; + + optional bool enable_endpoint_independent_mapping = 259441819; + + // Timeout (in seconds) for ICMP connections. Defaults to 30s if not set. + optional int32 icmp_idle_timeout_sec = 3647562; + + // Configure logging on this NAT. + optional RouterNatLogConfig log_config = 351299741; + + // Minimum number of ports allocated to a VM from this NAT config. If not set, a default number of ports is allocated to a VM. This is rounded up to the nearest power of 2. For example, if the value of this field is 50, at least 64 ports are allocated to a VM. + optional int32 min_ports_per_vm = 186193587; + + // Unique name of this Nat service. The name must be 1-63 characters long and comply with RFC1035. + optional string name = 3373707; + + // Specify the NatIpAllocateOption, which can take one of the following values: + // - MANUAL_ONLY: Uses only Nat IP addresses provided by customers. When there are not enough specified Nat IPs, the Nat service fails for new VMs. + // - AUTO_ONLY: Nat IPs are allocated by Google Cloud Platform; customers can't specify any Nat IPs. When choosing AUTO_ONLY, then nat_ip should be empty. + optional NatIpAllocateOption nat_ip_allocate_option = 429726845; + + // A list of URLs of the IP resources used for this Nat service. These IP addresses must be valid static external IP addresses assigned to the project. + repeated string nat_ips = 117635086; + + // Specify the Nat option, which can take one of the following values: + // - ALL_SUBNETWORKS_ALL_IP_RANGES: All of the IP ranges in every Subnetwork are allowed to Nat. + // - ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES: All of the primary IP ranges in every Subnetwork are allowed to Nat. + // - LIST_OF_SUBNETWORKS: A list of Subnetworks are allowed to Nat (specified in the field subnetwork below) The default is SUBNETWORK_IP_RANGE_TO_NAT_OPTION_UNSPECIFIED. Note that if this field contains ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, then there should not be any other Router.Nat section in any Router for this network in this region. + optional SourceSubnetworkIpRangesToNat source_subnetwork_ip_ranges_to_nat = 252213211; + + // A list of Subnetwork resources whose traffic should be translated by NAT Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the SubnetworkIpRangeToNatOption above. + repeated RouterNatSubnetworkToNat subnetworks = 415853125; + + // Timeout (in seconds) for TCP established connections. Defaults to 1200s if not set. + optional int32 tcp_established_idle_timeout_sec = 223098349; + + // Timeout (in seconds) for TCP transitory connections. Defaults to 30s if not set. + optional int32 tcp_transitory_idle_timeout_sec = 205028774; + + // Timeout (in seconds) for UDP connections. Defaults to 30s if not set. + optional int32 udp_idle_timeout_sec = 64919878; + +} + +// Represents a Cloud Router resource. +// +// For more information about Cloud Router, read the Cloud Router overview. +message Router { + // BGP information specific to this router. + optional RouterBgp bgp = 97483; + + // BGP information that must be configured into the routing stack to establish BGP peering. This information must specify the peer ASN and either the interface name, IP address, or peer IP address. Please refer to RFC4273. + repeated RouterBgpPeer bgp_peers = 452695773; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Field to indicate if a router is dedicated to use with encrypted Interconnect Attachment (IPsec-encrypted Cloud Interconnect feature). + // Not currently available in all Interconnect locations. + optional bool encrypted_interconnect_router = 297996575; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // Router interfaces. Each interface requires either one linked resource, (for example, linkedVpnTunnel), or IP address and IP address range (for example, ipRange), or both. + repeated RouterInterface interfaces = 12073562; + + // [Output Only] Type of resource. Always compute#router for routers. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // A list of NAT services created in this router. + repeated RouterNat nats = 3373938; + + // URI of the network to which this router belongs. + optional string network = 232872494; + + // [Output Only] URI of the region where the router resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + +} + +// Description-tagged IP ranges for the router to advertise. +message RouterAdvertisedIpRange { + // User-specified description for the IP range. + optional string description = 422937596; + + // The IP range to advertise. The value must be a CIDR-formatted string. + optional string range = 108280125; + +} + +// +message RoutersScopedList { + // A list of routers contained in this scope. + repeated Router routers = 311906890; + + // Informational warning which replaces the list of routers when the list is empty. + optional Warning warning = 50704284; + +} + +// Contains a list of routers. +message RouterAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Router resources. + map items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of Router resources. +message RouterList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Router resources. + repeated Router items = 100526016; + + // [Output Only] Type of resource. Always compute#router for routers. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Configuration of logging on a NAT. +message RouterNatLogConfig { + // Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: + // - ERRORS_ONLY: Export logs only for connection failures. + // - TRANSLATIONS_ONLY: Export logs only for successful connections. + // - ALL: Export logs for all connections, successful and unsuccessful. + enum Filter { + // A value indicating that the enum field is not set. + UNDEFINED_FILTER = 0; + + ALL = 64897; + + ERRORS_ONLY = 307484672; + + TRANSLATIONS_ONLY = 357212649; + + } + + // Indicates whether or not to export logs. This is false by default. + optional bool enable = 311764355; + + // Specify the desired filtering of logs on this NAT. If unspecified, logs are exported for all connections handled by this NAT. This option can take one of the following values: + // - ERRORS_ONLY: Export logs only for connection failures. + // - TRANSLATIONS_ONLY: Export logs only for successful connections. + // - ALL: Export logs for all connections, successful and unsuccessful. + optional Filter filter = 336120696; + +} + +// Defines the IP ranges that want to use NAT for a subnetwork. +message RouterNatSubnetworkToNat { + // + enum SourceIpRangesToNat { + // A value indicating that the enum field is not set. + UNDEFINED_SOURCE_IP_RANGES_TO_NAT = 0; + + ALL_IP_RANGES = 35608496; + + LIST_OF_SECONDARY_IP_RANGES = 192289308; + + PRIMARY_IP_RANGE = 297109954; + + } + + // URL for the subnetwork resource that will use NAT. + optional string name = 3373707; + + // A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if "LIST_OF_SECONDARY_IP_RANGES" is one of the values in source_ip_ranges_to_nat. + repeated string secondary_ip_range_names = 264315097; + + // Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: ["PRIMARY_IP_RANGE", "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] + repeated SourceIpRangesToNat source_ip_ranges_to_nat = 388310386; + +} + +// +message RouterStatusBgpPeerStatus { + // Status of the BGP peer: {UP, DOWN} + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + DOWN = 2104482; + + UNKNOWN = 433141802; + + UP = 2715; + + } + + // Routes that were advertised to the remote BGP peer + repeated Route advertised_routes = 333393068; + + // IP address of the local BGP interface. + optional string ip_address = 406272220; + + // URL of the VPN tunnel that this BGP peer controls. + optional string linked_vpn_tunnel = 352296953; + + // Name of this BGP peer. Unique within the Routers resource. + optional string name = 3373707; + + // Number of routes learned from the remote BGP Peer. + optional uint32 num_learned_routes = 135457535; + + // IP address of the remote BGP interface. + optional string peer_ip_address = 207735769; + + // BGP state as specified in RFC1771. + optional string state = 109757585; + + // Status of the BGP peer: {UP, DOWN} + optional Status status = 181260274; + + // Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 hours, 59 minutes, 59 seconds + optional string uptime = 235379688; + + // Time this session has been up, in seconds. Format: 145 + optional string uptime_seconds = 104736040; + +} + +// Status of a NAT contained in this router. +message RouterStatusNatStatus { + // A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", "129.2.16.89"] + repeated string auto_allocated_nat_ips = 510794246; + + // A list of IPs auto-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + repeated string drain_auto_allocated_nat_ips = 309184557; + + // A list of IPs user-allocated for NAT that are in drain mode. Example: ["1.1.1.1", "179.12.26.133"]. + repeated string drain_user_allocated_nat_ips = 305268553; + + // The number of extra IPs to allocate. This will be greater than 0 only if user-specified IPs are NOT enough to allow all configured VMs to use NAT. This value is meaningful only when auto-allocation of NAT IPs is *not* used. + optional int32 min_extra_nat_ips_needed = 365786338; + + // Unique name of this NAT. + optional string name = 3373707; + + // Number of VM endpoints (i.e., Nics) that can use NAT. + optional int32 num_vm_endpoints_with_nat_mappings = 512367468; + + // A list of fully qualified URLs of reserved IP address resources. + repeated string user_allocated_nat_ip_resources = 212776151; + + // A list of IPs user-allocated for NAT. They will be raw IP strings like "179.12.26.133". + repeated string user_allocated_nat_ips = 506878242; + +} + +// +message RouterStatus { + // Best routes for this router's network. + repeated Route best_routes = 395826693; + + // Best routes learned by this router. + repeated Route best_routes_for_router = 119389689; + + repeated RouterStatusBgpPeerStatus bgp_peer_status = 218459131; + + repeated RouterStatusNatStatus nat_status = 63098064; + + // URI of the network to which this router belongs. + optional string network = 232872494; + +} + +// +message RouterStatusResponse { + // Type of resource. + optional string kind = 3292052; + + optional RouterStatus result = 139315229; + +} + +// +message RoutersPreviewResponse { + // Preview of given router. + optional Router resource = 195806222; + +} + +// Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. +message SchedulingNodeAffinity { + // Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity. + enum Operator { + // A value indicating that the enum field is not set. + UNDEFINED_OPERATOR = 0; + + IN = 2341; + + NOT_IN = 161144369; + + OPERATOR_UNSPECIFIED = 128892924; + + } + + // Corresponds to the label key of Node resource. + optional string key = 106079; + + // Defines the operation of node selection. Valid operators are IN for affinity and NOT_IN for anti-affinity. + optional Operator operator = 36317348; + + // Corresponds to the label values of Node resource. + repeated string values = 249928994; + +} + +// An instance's screenshot. +message Screenshot { + // [Output Only] The Base64-encoded screenshot data. + optional string contents = 506419994; + + // [Output Only] Type of the resource. Always compute#screenshot for the screenshots. + optional string kind = 3292052; + +} + +// +message SecurityPoliciesWafConfig { + optional PreconfiguredWafSet waf_rules = 74899924; + +} + +// +message SecurityPoliciesListPreconfiguredExpressionSetsResponse { + optional SecurityPoliciesWafConfig preconfigured_expression_sets = 536200826; + +} + +// Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny). +message SecurityPolicyRule { + // The Action to perform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502. + optional string action = 187661878; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules + optional string kind = 3292052; + + // A match condition that incoming traffic is evaluated against. If it evaluates to true, the corresponding 'action' is enforced. + optional SecurityPolicyRuleMatcher match = 103668165; + + // If set to true, the specified action is not enforced. + optional bool preview = 218686408; + + // An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest priority. + optional int32 priority = 445151652; + +} + +// Represents a Google Cloud Armor security policy resource. +// +// Only external backend services that use load balancers can reference a security policy. For more information, see Google Cloud Armor security policy overview. (== resource_for {$api_version}.securityPolicies ==) +message SecurityPolicy { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Specifies a fingerprint for this resource, which is essentially a hash of the metadata's contents and used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update metadata. You must always provide an up-to-date fingerprint hash in order to update or change metadata, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make get() request to the security policy. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output only] Type of the resource. Always compute#securityPolicyfor security policies + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // A list of rules that belong to this policy. There must always be a default rule (rule with priority 2147483647 and match "*"). If no rules are provided when creating a security policy, a default rule with action "allow" will be added. + repeated SecurityPolicyRule rules = 108873975; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + +} + +// +message SecurityPolicyList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of SecurityPolicy resources. + repeated SecurityPolicy items = 100526016; + + // [Output Only] Type of resource. Always compute#securityPolicyList for listsof securityPolicies + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message SecurityPolicyReference { + optional string security_policy = 171082513; + +} + +// Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. +message SecurityPolicyRuleMatcher { + // Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. + enum VersionedExpr { + // A value indicating that the enum field is not set. + UNDEFINED_VERSIONED_EXPR = 0; + + SRC_IPS_V1 = 70925961; + + } + + // The configuration options available when specifying versioned_expr. This field must be specified if versioned_expr is specified and cannot be specified if versioned_expr is not specified. + optional SecurityPolicyRuleMatcherConfig config = 255820610; + + // User defined CEVAL expression. A CEVAL expression is used to specify match criteria such as origin.ip, source.region_code and contents in the request header. + optional Expr expr = 3127797; + + // Preconfigured versioned expression. If this field is specified, config must also be specified. Available preconfigured expressions along with their requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range field in config. + optional VersionedExpr versioned_expr = 322286013; + +} + +// +message SecurityPolicyRuleMatcherConfig { + // CIDR IP address range. Maximum number of src_ip_ranges allowed is 10. + repeated string src_ip_ranges = 432128083; + +} + +// An instance's serial console output. +message SerialPortOutput { + // [Output Only] The contents of the console output. + optional string contents = 506419994; + + // [Output Only] Type of the resource. Always compute#serialPortOutput for serial port output. + optional string kind = 3292052; + + // [Output Only] The position of the next byte of content, regardless of whether the content exists, following the output returned in the `contents` property. Use this value in the next request as the start parameter. + optional int64 next = 3377907; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // The starting byte position of the output that was returned. This should match the start parameter sent with the request. If the serial console output exceeds the size of the buffer (1 MB), older output is overwritten by newer content. The output start value will indicate the byte position of the output that was returned, which might be different than the `start` value that was specified in the request. + optional int64 start = 109757538; + +} + +// A Shielded Instance Identity Entry. +message ShieldedInstanceIdentityEntry { + // A PEM-encoded X.509 certificate. This field can be empty. + optional string ek_cert = 450178589; + + // A PEM-encoded public key. + optional string ek_pub = 308947940; + +} + +// A shielded Instance identity entry. +message ShieldedInstanceIdentity { + // An Endorsement Key (EK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + optional ShieldedInstanceIdentityEntry encryption_key = 488268707; + + // [Output Only] Type of the resource. Always compute#shieldedInstanceIdentity for shielded Instance identity entry. + optional string kind = 3292052; + + // An Attestation Key (AK) made by the RSA 2048 algorithm issued to the Shielded Instance's vTPM. + optional ShieldedInstanceIdentityEntry signing_key = 320948261; + +} + +// Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs +message SignedUrlKey { + // Name of the key. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string key_name = 500938859; + + // 128-bit key value used for signing the URL. The key value must be a valid RFC 4648 Section 5 base64url encoded string. + optional string key_value = 504106897; + +} + +// Represents a Persistent Disk Snapshot resource. +// +// You can use snapshots to back up data on a regular interval. For more information, read Creating persistent disk snapshots. (== resource_for {$api_version}.snapshots ==) +message Snapshot { + // [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + FAILED = 455706685; + + READY = 77848963; + + UPLOADING = 267603489; + + } + + // [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + enum StorageBytesStatus { + // A value indicating that the enum field is not set. + UNDEFINED_STORAGE_BYTES_STATUS = 0; + + UPDATING = 494614342; + + UP_TO_DATE = 101306702; + + } + + // [Output Only] Set to true if snapshots are automatically created by applying resource policy on the target disk. + optional bool auto_created = 463922264; + + // Creates the new snapshot in the snapshot chain labeled with the specified name. The chain name must be 1-63 characters long and comply with RFC1035. This is an uncommon option only for advanced service owners who needs to create separate snapshot chains, for example, for chargeback tracking. When you describe your snapshot resource, this field is visible only if it has a non-empty value. + optional string chain_name = 68644169; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] Size of the source disk, specified in GB. + optional int64 disk_size_gb = 316263735; + + // [Output Only] Number of bytes downloaded to restore a snapshot to a disk. + optional int64 download_bytes = 435054068; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#snapshot for Snapshot resources. + optional string kind = 3292052; + + // A fingerprint for the labels being applied to this snapshot, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve a snapshot. + optional string label_fingerprint = 178124825; + + // Labels to apply to this snapshot. These can be later modified by the setLabels method. Label values may be empty. + map labels = 500195327; + + // [Output Only] Integer license codes indicating which licenses are attached to this snapshot. + repeated int64 license_codes = 45482664; + + // [Output Only] A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). + repeated string licenses = 337642578; + + // An opaque location hint used to place the snapshot close to other resources. This field is for use by internal tools that use the public API. + optional string location_hint = 350519505; + + // Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] Reserved for future use. + optional bool satisfies_pzs = 480964267; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Encrypts the snapshot using a customer-supplied encryption key. + // + // After you encrypt a snapshot using a customer-supplied key, you must provide the same key if you use the snapshot later. For example, you must provide the encryption key when you create a disk from the encrypted snapshot in a future request. + // + // Customer-supplied encryption keys do not protect access to metadata of the snapshot. + // + // If you do not provide an encryption key when creating the snapshot, then the snapshot will be encrypted using an automatically generated key and you do not need to provide a key to use the snapshot later. + optional CustomerEncryptionKey snapshot_encryption_key = 43334526; + + // The source disk used to create this snapshot. + optional string source_disk = 451753793; + + // The customer-supplied encryption key of the source disk. Required if the source disk is protected by a customer-supplied encryption key. + optional CustomerEncryptionKey source_disk_encryption_key = 531501153; + + // [Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name. + optional string source_disk_id = 454190809; + + // [Output Only] The status of the snapshot. This can be CREATING, DELETING, FAILED, READY, or UPLOADING. + optional Status status = 181260274; + + // [Output Only] A size of the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. + optional int64 storage_bytes = 424631719; + + // [Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation. This status can either be UPDATING, meaning the size of the snapshot is being updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + optional StorageBytesStatus storage_bytes_status = 490739082; + + // Cloud Storage bucket storage location of the snapshot (regional or multi-regional). + repeated string storage_locations = 328005274; + +} + +// Contains a list of Snapshot resources. +message SnapshotList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Snapshot resources. + repeated Snapshot items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Configuration and status of a managed SSL certificate. +message SslCertificateManagedSslCertificate { + // [Output only] Status of the managed certificate resource. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + ACTIVE = 314733318; + + MANAGED_CERTIFICATE_STATUS_UNSPECIFIED = 474800850; + + PROVISIONING = 290896621; + + PROVISIONING_FAILED = 76813775; + + PROVISIONING_FAILED_PERMANENTLY = 275036203; + + RENEWAL_FAILED = 434659076; + + } + + // [Output only] Detailed statuses of the domains specified for managed certificate resource. + map domain_status = 360305613; + + // The domains for which a managed SSL certificate will be generated. Each Google-managed SSL certificate supports up to the [maximum number of domains per Google-managed SSL certificate](/load-balancing/docs/quotas#ssl_certificates). + repeated string domains = 226935855; + + // [Output only] Status of the managed certificate resource. + optional Status status = 181260274; + +} + +// Configuration and status of a self-managed SSL certificate. +message SslCertificateSelfManagedSslCertificate { + // A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + optional string certificate = 341787031; + + // A write-only private key in PEM format. Only insert requests will include this field. + optional string private_key = 361331107; + +} + +// Represents an SSL Certificate resource. +// +// Google Compute Engine has two SSL Certificate resources: +// +// * [Global](/compute/docs/reference/rest/{$api_version}/sslCertificates) * [Regional](/compute/docs/reference/rest/{$api_version}/regionSslCertificates) +// +// +// +// The sslCertificates are used by: +// - external HTTPS load balancers +// - SSL proxy load balancers +// +// The regionSslCertificates are used by internal HTTPS load balancers. +// +// Optionally, certificate file contents that you upload can contain a set of up to five PEM-encoded certificates. The API call creates an object (sslCertificate) that holds this data. You can use SSL keys and certificates to secure connections to a load balancer. For more information, read Creating and using SSL certificates, SSL certificates quotas and limits, and Troubleshooting SSL certificates. (== resource_for {$api_version}.sslCertificates ==) (== resource_for {$api_version}.regionSslCertificates ==) +message SslCertificate { + // (Optional) Specifies the type of SSL certificate, either "SELF_MANAGED" or "MANAGED". If not specified, the certificate is self-managed and the fields certificate and private_key are used. + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + MANAGED = 479501183; + + SELF_MANAGED = 434437516; + + TYPE_UNSPECIFIED = 437714322; + + } + + // A value read into memory from a certificate file. The certificate file must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert. + optional string certificate = 341787031; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] Expire time of the certificate. RFC3339 + optional string expire_time = 440691181; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates. + optional string kind = 3292052; + + // Configuration and status of a managed SSL certificate. + optional SslCertificateManagedSslCertificate managed = 298389407; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // A value read into memory from a write-only private key file. The private key file must be in PEM format. For security, only insert requests include this field. + optional string private_key = 361331107; + + // [Output Only] URL of the region where the regional SSL Certificate resides. This field is not applicable to global SSL Certificate. + optional string region = 138946292; + + // [Output only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Configuration and status of a self-managed SSL certificate. + optional SslCertificateSelfManagedSslCertificate self_managed = 329284012; + + // [Output Only] Domains associated with the certificate via Subject Alternative Name. + repeated string subject_alternative_names = 528807907; + + // (Optional) Specifies the type of SSL certificate, either "SELF_MANAGED" or "MANAGED". If not specified, the certificate is self-managed and the fields certificate and private_key are used. + optional Type type = 3575610; + +} + +// +message SslCertificatesScopedList { + // List of SslCertificates contained in this scope. + repeated SslCertificate ssl_certificates = 366006543; + + // Informational warning which replaces the list of backend services when the list is empty. + optional Warning warning = 50704284; + +} + +// +message SslCertificateAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of SslCertificatesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#sslCertificateAggregatedList for lists of SSL Certificates. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of SslCertificate resources. +message SslCertificateList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of SslCertificate resources. + repeated SslCertificate items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents an SSL Policy resource. +// +// Use SSL policies to control the SSL features, such as versions and cipher suites, offered by an HTTPS or SSL Proxy load balancer. For more information, read SSL Policy Concepts. (== resource_for {$api_version}.sslPolicies ==) +message SslPolicy { + // The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. + enum MinTlsVersion { + // A value indicating that the enum field is not set. + UNDEFINED_MIN_TLS_VERSION = 0; + + TLS_1_0 = 33116734; + + TLS_1_1 = 33116735; + + TLS_1_2 = 33116736; + + } + + // Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. + enum Profile { + // A value indicating that the enum field is not set. + UNDEFINED_PROFILE = 0; + + COMPATIBLE = 179357396; + + CUSTOM = 388595569; + + MODERN = 132013855; + + RESTRICTED = 261551195; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // A list of features enabled when the selected profile is CUSTOM. The + // - method returns the set of features that can be specified in this list. This field must be empty if the profile is not CUSTOM. + repeated string custom_features = 34789707; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The list of features enabled in the SSL policy. + repeated string enabled_features = 469017467; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a SslPolicy. An up-to-date fingerprint must be provided in order to update the SslPolicy, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve an SslPolicy. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output only] Type of the resource. Always compute#sslPolicyfor SSL policies. + optional string kind = 3292052; + + // The minimum version of SSL protocol that can be used by the clients to establish a connection with the load balancer. This can be one of TLS_1_0, TLS_1_1, TLS_1_2. + optional MinTlsVersion min_tls_version = 8155943; + + // Name of the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Profile specifies the set of SSL features that can be used by the load balancer when negotiating SSL with clients. This can be one of COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to enable must be specified in the customFeatures field. + optional Profile profile = 227445161; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] If potential misconfigurations are detected for this SSL policy, this field will be populated with warning messages. + repeated Warnings warnings = 498091095; + +} + +// +message SslPoliciesList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of SslPolicy resources. + repeated SslPolicy items = 100526016; + + // [Output Only] Type of the resource. Always compute#sslPoliciesList for lists of sslPolicies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message SslPoliciesListAvailableFeaturesResponse { + repeated string features = 246211645; + +} + +// +message SslPolicyReference { + // URL of the SSL policy resource. Set this to empty string to clear any existing SSL policy associated with the target proxy resource. + optional string ssl_policy = 295190213; + +} + +// Configuration of preserved resources. +message StatefulPolicyPreservedState { + // Disks created on the instances that will be preserved on instance delete, update, etc. This map is keyed with the device names of the disks. + map disks = 95594102; + +} + +// +message StatefulPolicyPreservedStateDiskDevice { + // These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + enum AutoDelete { + // A value indicating that the enum field is not set. + UNDEFINED_AUTO_DELETE = 0; + + NEVER = 74175084; + + ON_PERMANENT_INSTANCE_DELETION = 95727719; + + } + + // These stateful disks will never be deleted during autohealing, update or VM instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted. + optional AutoDelete auto_delete = 464761403; + +} + +// The available logging options for this subnetwork. +message SubnetworkLogConfig { + // Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. + enum AggregationInterval { + // A value indicating that the enum field is not set. + UNDEFINED_AGGREGATION_INTERVAL = 0; + + INTERVAL_10_MIN = 487155916; + + INTERVAL_15_MIN = 491773521; + + INTERVAL_1_MIN = 69052714; + + INTERVAL_30_SEC = 7548937; + + INTERVAL_5_MIN = 72746798; + + INTERVAL_5_SEC = 72752429; + + } + + // Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. + enum Metadata { + // A value indicating that the enum field is not set. + UNDEFINED_METADATA = 0; + + CUSTOM_METADATA = 62450749; + + EXCLUDE_ALL_METADATA = 334519954; + + INCLUDE_ALL_METADATA = 164619908; + + } + + // Can only be specified if VPC flow logging for this subnetwork is enabled. Toggles the aggregation interval for collecting flow logs. Increasing the interval time will reduce the amount of generated flow logs for long lasting connections. Default is an interval of 5 seconds per connection. + optional AggregationInterval aggregation_interval = 174919042; + + // Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is to disable flow logging. + optional bool enable = 311764355; + + // Can only be specified if VPC flow logs for this subnetwork is enabled. Export filter used to define which VPC flow logs should be logged. + optional string filter_expr = 183374428; + + // Can only be specified if VPC flow logging for this subnetwork is enabled. The value of the field must be in [0, 1]. Set the sampling rate of VPC flow logs within the subnetwork where 1.0 means all collected logs are reported and 0.0 means no logs are reported. Default is 0.5, which means half of all collected logs are reported. + optional float flow_sampling = 530150360; + + // Can only be specified if VPC flow logs for this subnetwork is enabled. Configures whether all, none or a subset of metadata fields should be added to the reported VPC flow logs. Default is EXCLUDE_ALL_METADATA. + optional Metadata metadata = 86866735; + + // Can only be specified if VPC flow logs for this subnetwork is enabled and "metadata" was set to CUSTOM_METADATA. + repeated string metadata_fields = 378461641; + +} + +// Represents a secondary IP range of a subnetwork. +message SubnetworkSecondaryRange { + // The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. The range can be any range listed in the Valid ranges list. + optional string ip_cidr_range = 98117322; + + // The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + optional string range_name = 332216397; + +} + +// Represents a Subnetwork resource. +// +// A subnetwork (also known as a subnet) is a logical partition of a Virtual Private Cloud network with one primary IP range and zero or more secondary IP ranges. For more information, read Virtual Private Cloud (VPC) Network. (== resource_for {$api_version}.subnetworks ==) +message Subnetwork { + // The private IPv6 google access type for the VMs in this subnet. This is an expanded field of enablePrivateV6Access. If both fields are set, privateIpv6GoogleAccess will take priority. + // + // This field can be both set at resource creation time and updated using patch. + enum PrivateIpv6GoogleAccess { + // A value indicating that the enum field is not set. + UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0; + + DISABLE_GOOGLE_ACCESS = 450958579; + + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994; + + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263; + + } + + // The purpose of the resource. This field can be either PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER. + enum Purpose { + // A value indicating that the enum field is not set. + UNDEFINED_PURPOSE = 0; + + INTERNAL_HTTPS_LOAD_BALANCER = 248748889; + + PRIVATE = 403485027; + + PRIVATE_RFC_1918 = 254902107; + + } + + // The role of subnetwork. Currently, this field is only used when purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + enum Role { + // A value indicating that the enum field is not set. + UNDEFINED_ROLE = 0; + + ACTIVE = 314733318; + + BACKUP = 341010882; + + } + + // [Output Only] The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + DRAINING = 480455402; + + READY = 77848963; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. + optional string description = 422937596; + + // Whether to enable flow logging for this subnetwork. If this field is not explicitly set, it will not appear in get listings. If not set the default behavior is to disable flow logging. This field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER. + optional bool enable_flow_logs = 151544420; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a Subnetwork. An up-to-date fingerprint must be provided in order to update the Subnetwork, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve a Subnetwork. + optional string fingerprint = 234678500; + + // [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. + optional string gateway_address = 459867385; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 100.64.0.0/10. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field is set at resource creation time. The range can be any range listed in the Valid ranges list. The range can be expanded after creation using expandIpCidrRange. + optional string ip_cidr_range = 98117322; + + // [Output Only] The range of internal IPv6 addresses that are owned by this subnetwork. + optional string ipv6_cidr_range = 273141258; + + // [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. + optional string kind = 3292052; + + // This field denotes the VPC flow logging options for this subnetwork. If logging is enabled, logs are exported to Cloud Logging. + optional SubnetworkLogConfig log_config = 351299741; + + // The name of the resource, provided by the client when initially creating the resource. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time. + optional string network = 232872494; + + // Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. + optional bool private_ip_google_access = 421491790; + + // The private IPv6 google access type for the VMs in this subnet. This is an expanded field of enablePrivateV6Access. If both fields are set, privateIpv6GoogleAccess will take priority. + // + // This field can be both set at resource creation time and updated using patch. + optional PrivateIpv6GoogleAccess private_ipv6_google_access = 48277006; + + // The purpose of the resource. This field can be either PRIVATE_RFC_1918 or INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with purpose set to INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved for Internal HTTP(S) Load Balancing. If unspecified, the purpose defaults to PRIVATE_RFC_1918. The enableFlowLogs field isn't supported with the purpose field set to INTERNAL_HTTPS_LOAD_BALANCER. + optional Purpose purpose = 316407070; + + // URL of the region where the Subnetwork resides. This field can be set only at resource creation time. + optional string region = 138946292; + + // The role of subnetwork. Currently, this field is only used when purpose = INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to ACTIVE or BACKUP. An ACTIVE subnetwork is one that is currently being used for Internal HTTP(S) Load Balancing. A BACKUP subnetwork is one that is ready to be promoted to ACTIVE or is currently draining. This field can be updated with a patch request. + optional Role role = 3506294; + + // An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. This field can be updated with a patch request. + repeated SubnetworkSecondaryRange secondary_ip_ranges = 136658915; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The state of the subnetwork, which can be one of the following values: READY: Subnetwork is created and ready to use DRAINING: only applicable to subnetworks that have the purpose set to INTERNAL_HTTPS_LOAD_BALANCER and indicates that connections to the load balancer are being drained. A subnetwork that is draining cannot be used or modified until it reaches a status of READY + optional State state = 109757585; + +} + +// +message SubnetworksScopedList { + // A list of subnetworks contained in this scope. + repeated Subnetwork subnetworks = 415853125; + + // An informational warning that appears when the list of addresses is empty. + optional Warning warning = 50704284; + +} + +// +message SubnetworkAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of SubnetworksScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of Subnetwork resources. +message SubnetworkList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Subnetwork resources. + repeated Subnetwork items = 100526016; + + // [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message SubnetworksExpandIpCidrRangeRequest { + // The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. + optional string ip_cidr_range = 98117322; + +} + +// +message SubnetworksSetPrivateIpGoogleAccessRequest { + optional bool private_ip_google_access = 421491790; + +} + +// Represents a Target gRPC Proxy resource. +// +// A target gRPC proxy is a component of load balancers intended for load balancing gRPC traffic. Only global forwarding rules with load balancing scheme INTERNAL_SELF_MANAGED can reference a target gRPC proxy. The target gRPC Proxy references a URL map that specifies how traffic is routed to gRPC backend services. (== resource_for {$api_version}.targetGrpcProxies ==) +message TargetGrpcProxy { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetGrpcProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetGrpcProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetGrpcProxy. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource type. The server generates this identifier. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] Server-defined URL with id for the resource. + optional string self_link_with_id = 44520962; + + // URL to the UrlMap resource that defines the mapping from URL to the BackendService. The protocol field in the BackendService must be set to GRPC. + optional string url_map = 367020684; + + // If true, indicates that the BackendServices referenced by the urlMap may be accessed by gRPC applications without using a sidecar proxy. This will enable configuration checks on urlMap and its referenced BackendServices to not allow unsupported features. A gRPC application must use "xds:///" scheme in the target URI of the service it is connecting to. If false, indicates that the BackendServices referenced by the urlMap will be accessed by gRPC applications via a sidecar proxy. In this case, a gRPC application must not use "xds:///" scheme in the target URI of the service it is connecting to + optional bool validate_for_proxyless = 101822888; + +} + +// +message TargetGrpcProxyList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetGrpcProxy resources. + repeated TargetGrpcProxy items = 100526016; + + // [Output Only] Type of the resource. Always compute#targetGrpcProxy for target grpc proxies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a Target HTTP Proxy resource. +// +// Google Compute Engine has two Target HTTP Proxy resources: +// +// * [Global](/compute/docs/reference/rest/{$api_version}/targetHttpProxies) * [Regional](/compute/docs/reference/rest/{$api_version}/regionTargetHttpProxies) +// +// A target HTTP proxy is a component of GCP HTTP load balancers. +// +// * targetHttpProxies are used by external HTTP load balancers and Traffic Director. * regionTargetHttpProxies are used by internal HTTP load balancers. +// +// Forwarding rules reference a target HTTP proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies and Forwarding rule concepts. (== resource_for {$api_version}.targetHttpProxies ==) (== resource_for {$api_version}.regionTargetHttpProxies ==) +message TargetHttpProxy { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpProxy. An up-to-date fingerprint must be provided in order to patch/update the TargetHttpProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpProxy. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of resource. Always compute#targetHttpProxy for target HTTP proxies. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + // + // When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. + // + // The default is false. + optional bool proxy_bind = 286025582; + + // [Output Only] URL of the region where the regional Target HTTP Proxy resides. This field is not applicable to global Target HTTP Proxies. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // URL to the UrlMap resource that defines the mapping from URL to the BackendService. + optional string url_map = 367020684; + +} + +// +message TargetHttpProxiesScopedList { + // A list of TargetHttpProxies contained in this scope. + repeated TargetHttpProxy target_http_proxies = 162147011; + + // Informational warning which replaces the list of backend services when the list is empty. + optional Warning warning = 50704284; + +} + +// +message TargetHttpProxyAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetHttpProxiesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + +} + +// A list of TargetHttpProxy resources. +message TargetHttpProxyList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetHttpProxy resources. + repeated TargetHttpProxy items = 100526016; + + // Type of resource. Always compute#targetHttpProxyList for lists of target HTTP proxies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a Target HTTPS Proxy resource. +// +// Google Compute Engine has two Target HTTPS Proxy resources: +// +// * [Global](/compute/docs/reference/rest/{$api_version}/targetHttpsProxies) * [Regional](/compute/docs/reference/rest/{$api_version}/regionTargetHttpsProxies) +// +// A target HTTPS proxy is a component of GCP HTTPS load balancers. +// +// * targetHttpsProxies are used by external HTTPS load balancers. * regionTargetHttpsProxies are used by internal HTTPS load balancers. +// +// Forwarding rules reference a target HTTPS proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies and Forwarding rule concepts. (== resource_for {$api_version}.targetHttpsProxies ==) (== resource_for {$api_version}.regionTargetHttpsProxies ==) +message TargetHttpsProxy { + // Specifies the QUIC override policy for this TargetHttpsProxy resource. This setting determines whether the load balancer attempts to negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. + // - When quic-override is set to NONE, Google manages whether QUIC is used. + // - When quic-override is set to ENABLE, the load balancer uses QUIC when possible. + // - When quic-override is set to DISABLE, the load balancer doesn't use QUIC. + // - If the quic-override flag is not specified, NONE is implied. + enum QuicOverride { + // A value indicating that the enum field is not set. + UNDEFINED_QUIC_OVERRIDE = 0; + + DISABLE = 241807048; + + ENABLE = 438835587; + + NONE = 2402104; + + } + + // Optional. A URL referring to a networksecurity.AuthorizationPolicy resource that describes how the proxy should authorize inbound traffic. If left blank, access will not be restricted by an authorization policy. + // Refer to the AuthorizationPolicy resource for additional details. + // authorizationPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. + // Note: This field currently has no impact. + optional string authorization_policy = 33945528; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a TargetHttpsProxy. An up-to-date fingerprint must be provided in order to patch the TargetHttpsProxy; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the TargetHttpsProxy. + optional string fingerprint = 234678500; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of resource. Always compute#targetHttpsProxy for target HTTPS proxies. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + // + // When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. + // + // The default is false. + optional bool proxy_bind = 286025582; + + // Specifies the QUIC override policy for this TargetHttpsProxy resource. This setting determines whether the load balancer attempts to negotiate QUIC with clients. You can specify NONE, ENABLE, or DISABLE. + // - When quic-override is set to NONE, Google manages whether QUIC is used. + // - When quic-override is set to ENABLE, the load balancer uses QUIC when possible. + // - When quic-override is set to DISABLE, the load balancer doesn't use QUIC. + // - If the quic-override flag is not specified, NONE is implied. + optional QuicOverride quic_override = 456577197; + + // [Output Only] URL of the region where the regional TargetHttpsProxy resides. This field is not applicable to global TargetHttpsProxies. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Optional. A URL referring to a networksecurity.ServerTlsPolicy resource that describes how the proxy should authenticate inbound traffic. + // serverTlsPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED. + // If left blank, communications are not encrypted. + // Note: This field currently has no impact. + optional string server_tls_policy = 295825266; + + // URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + repeated string ssl_certificates = 366006543; + + // URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured. + optional string ssl_policy = 295190213; + + // A fully-qualified or valid partial URL to the UrlMap resource that defines the mapping from URL to the BackendService. For example, the following are all valid URLs for specifying a URL map: + // - https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map + // - projects/project/global/urlMaps/url-map + // - global/urlMaps/url-map + optional string url_map = 367020684; + +} + +// +message TargetHttpsProxiesScopedList { + // A list of TargetHttpsProxies contained in this scope. + repeated TargetHttpsProxy target_https_proxies = 366607882; + + // Informational warning which replaces the list of backend services when the list is empty. + optional Warning warning = 50704284; + +} + +// +message TargetHttpsProxiesSetQuicOverrideRequest { + // QUIC policy for the TargetHttpsProxy resource. + enum QuicOverride { + // A value indicating that the enum field is not set. + UNDEFINED_QUIC_OVERRIDE = 0; + + DISABLE = 241807048; + + ENABLE = 438835587; + + NONE = 2402104; + + } + + // QUIC policy for the TargetHttpsProxy resource. + optional QuicOverride quic_override = 456577197; + +} + +// +message TargetHttpsProxiesSetSslCertificatesRequest { + // New set of SslCertificate resources to associate with this TargetHttpsProxy resource. Currently exactly one SslCertificate resource must be specified. + repeated string ssl_certificates = 366006543; + +} + +// +message TargetHttpsProxyAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetHttpsProxiesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#targetHttpsProxyAggregatedList for lists of Target HTTP Proxies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of TargetHttpsProxy resources. +message TargetHttpsProxyList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetHttpsProxy resources. + repeated TargetHttpsProxy items = 100526016; + + // Type of resource. Always compute#targetHttpsProxyList for lists of target HTTPS proxies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a Target Instance resource. +// +// You can use a target instance to handle traffic for one or more forwarding rules, which is ideal for forwarding protocol traffic that is managed by a single source. For example, ESP, AH, TCP, or UDP. For more information, read Target instances. (== resource_for {$api_version}.targetInstances ==) +message TargetInstance { + // NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported. + enum NatPolicy { + // A value indicating that the enum field is not set. + UNDEFINED_NAT_POLICY = 0; + + NO_NAT = 161455491; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: + // - https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + // - projects/project/zones/zone/instances/instance + // - zones/zone/instances/instance + optional string instance = 18257045; + + // [Output Only] The type of the resource. Always compute#targetInstance for target instances. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported. + optional NatPolicy nat_policy = 509780496; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] URL of the zone where the target instance resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string zone = 3744684; + +} + +// +message TargetInstancesScopedList { + // A list of target instances contained in this scope. + repeated TargetInstance target_instances = 392915280; + + // Informational warning which replaces the list of addresses when the list is empty. + optional Warning warning = 50704284; + +} + +// +message TargetInstanceAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetInstance resources. + map items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of TargetInstance resources. +message TargetInstanceList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetInstance resources. + repeated TargetInstance items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a Target Pool resource. +// +// Target pools are used for network TCP/UDP load balancing. A target pool references member instances, an associated legacy HttpHealthCheck resource, and, optionally, a backup target pool. For more information, read Using target pools. (== resource_for {$api_version}.targetPools ==) +message TargetPool { + // Session affinity option, must be one of the following values: + // NONE: Connections from the same client IP may go to any instance in the pool. + // CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. + // CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. + enum SessionAffinity { + // A value indicating that the enum field is not set. + UNDEFINED_SESSION_AFFINITY = 0; + + CLIENT_IP = 345665051; + + CLIENT_IP_NO_DESTINATION = 106122516; + + CLIENT_IP_PORT_PROTO = 221722926; + + CLIENT_IP_PROTO = 25322148; + + GENERATED_COOKIE = 370321204; + + HEADER_FIELD = 200737960; + + HTTP_COOKIE = 494981627; + + NONE = 2402104; + + } + + // The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. + // + // backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. + // + // In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + optional string backup_pool = 45884537; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. + // + // If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. + // + // In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. + optional float failover_ratio = 212667006; + + // The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified. + repeated string health_checks = 448370606; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. + repeated string instances = 29097598; + + // [Output Only] Type of the resource. Always compute#targetPool for target pools. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // [Output Only] URL of the region where the target pool resides. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Session affinity option, must be one of the following values: + // NONE: Connections from the same client IP may go to any instance in the pool. + // CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. + // CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. + optional SessionAffinity session_affinity = 463888561; + +} + +// +message TargetPoolsScopedList { + // A list of target pools contained in this scope. + repeated TargetPool target_pools = 336072617; + + // Informational warning which replaces the list of addresses when the list is empty. + optional Warning warning = 50704284; + +} + +// +message TargetPoolAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetPool resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#targetPoolAggregatedList for aggregated lists of target pools. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message TargetPoolInstanceHealth { + repeated HealthStatus health_status = 380545845; + + // [Output Only] Type of resource. Always compute#targetPoolInstanceHealth when checking the health of an instance. + optional string kind = 3292052; + +} + +// Contains a list of TargetPool resources. +message TargetPoolList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetPool resources. + repeated TargetPool items = 100526016; + + // [Output Only] Type of resource. Always compute#targetPoolList for lists of target pools. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message TargetPoolsAddHealthCheckRequest { + // The HttpHealthCheck to add to the target pool. + repeated HealthCheckReference health_checks = 448370606; + +} + +// +message TargetPoolsAddInstanceRequest { + // A full or partial URL to an instance to add to this target pool. This can be a full or partial URL. For example, the following are valid URLs: + // - https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name + // - projects/project-id/zones/zone/instances/instance-name + // - zones/zone/instances/instance-name + repeated InstanceReference instances = 29097598; + +} + +// +message TargetPoolsRemoveHealthCheckRequest { + // Health check URL to be removed. This can be a full or valid partial URL. For example, the following are valid URLs: + // - https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check + // - projects/project/global/httpHealthChecks/health-check + // - global/httpHealthChecks/health-check + repeated HealthCheckReference health_checks = 448370606; + +} + +// +message TargetPoolsRemoveInstanceRequest { + // URLs of the instances to be removed from target pool. + repeated InstanceReference instances = 29097598; + +} + +// +message TargetReference { + optional string target = 192835985; + +} + +// +message TargetSslProxiesSetBackendServiceRequest { + // The URL of the new BackendService resource for the targetSslProxy. + optional string service = 373540533; + +} + +// +message TargetSslProxiesSetProxyHeaderRequest { + // The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + optional ProxyHeader proxy_header = 160374142; + +} + +// +message TargetSslProxiesSetSslCertificatesRequest { + // New set of URLs to SslCertificate resources to associate with this TargetSslProxy. Currently exactly one ssl certificate must be specified. + repeated string ssl_certificates = 366006543; + +} + +// Represents a Target SSL Proxy resource. +// +// A target SSL proxy is a component of a SSL Proxy load balancer. Global forwarding rules reference a target SSL proxy, and the target proxy then references an external backend service. For more information, read Using Target Proxies. (== resource_for {$api_version}.targetSslProxies ==) +message TargetSslProxy { + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#targetSslProxy for target SSL proxies. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + optional ProxyHeader proxy_header = 160374142; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // URL to the BackendService resource. + optional string service = 373540533; + + // URLs to SslCertificate resources that are used to authenticate connections to Backends. At least one SSL certificate must be specified. Currently, you may specify up to 15 SSL certificates. + repeated string ssl_certificates = 366006543; + + // URL of SslPolicy resource that will be associated with the TargetSslProxy resource. If not set, the TargetSslProxy resource will not have any SSL policy configured. + optional string ssl_policy = 295190213; + +} + +// Contains a list of TargetSslProxy resources. +message TargetSslProxyList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetSslProxy resources. + repeated TargetSslProxy items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message TargetTcpProxiesSetBackendServiceRequest { + // The URL of the new BackendService resource for the targetTcpProxy. + optional string service = 373540533; + +} + +// +message TargetTcpProxiesSetProxyHeaderRequest { + // The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // The new type of proxy header to append before sending data to the backend. NONE or PROXY_V1 are allowed. + optional ProxyHeader proxy_header = 160374142; + +} + +// Represents a Target TCP Proxy resource. +// +// A target TCP proxy is a component of a TCP Proxy load balancer. Global forwarding rules reference target TCP proxy, and the target proxy then references an external backend service. For more information, read TCP Proxy Load Balancing overview. (== resource_for {$api_version}.targetTcpProxies ==) +message TargetTcpProxy { + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + enum ProxyHeader { + // A value indicating that the enum field is not set. + UNDEFINED_PROXY_HEADER = 0; + + NONE = 2402104; + + PROXY_V1 = 334352940; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#targetTcpProxy for target TCP proxies. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // This field only applies when the forwarding rule that references this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED. + // + // When this field is set to true, Envoy proxies set up inbound traffic interception and bind to the IP address and port specified in the forwarding rule. This is generally useful when using Traffic Director to configure Envoy as a gateway or middle proxy (in other words, not a sidecar proxy). The Envoy proxy listens for inbound requests and handles requests when it receives them. + // + // The default is false. + optional bool proxy_bind = 286025582; + + // Specifies the type of proxy header to append before sending data to the backend, either NONE or PROXY_V1. The default is NONE. + optional ProxyHeader proxy_header = 160374142; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // URL to the BackendService resource. + optional string service = 373540533; + +} + +// Contains a list of TargetTcpProxy resources. +message TargetTcpProxyList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetTcpProxy resources. + repeated TargetTcpProxy items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a Target VPN Gateway resource. +// +// The target VPN gateway resource represents a Classic Cloud VPN gateway. For more information, read the the Cloud VPN Overview. (== resource_for {$api_version}.targetVpnGateways ==) +message TargetVpnGateway { + // [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + CREATING = 455564985; + + DELETING = 528602024; + + FAILED = 455706685; + + READY = 77848963; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. + repeated string forwarding_rules = 315821365; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + optional string kind = 3292052; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + optional string network = 232872494; + + // [Output Only] URL of the region where the target VPN gateway resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + optional Status status = 181260274; + + // [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. + repeated string tunnels = 104561931; + +} + +// +message TargetVpnGatewaysScopedList { + // [Output Only] A list of target VPN gateways contained in this scope. + repeated TargetVpnGateway target_vpn_gateways = 401770888; + + // [Output Only] Informational warning which replaces the list of addresses when the list is empty. + optional Warning warning = 50704284; + +} + +// +message TargetVpnGatewayAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetVpnGateway resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of TargetVpnGateway resources. +message TargetVpnGatewayList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of TargetVpnGateway resources. + repeated TargetVpnGateway items = 100526016; + + // [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// HTTP headers used in UrlMapTests. +message UrlMapTestHeader { + // Header name. + optional string name = 3373707; + + // Header value. + optional string value = 111972721; + +} + +// +message TestFailure { + // The actual output URL evaluated by load balancer containing the scheme, host, path and query parameters. + optional string actual_output_url = 287075458; + + // Actual HTTP status code for rule with `urlRedirect` calculated by load balancer + optional int32 actual_redirect_response_code = 42926553; + + // BackendService or BackendBucket returned by load balancer. + optional string actual_service = 440379652; + + // The expected output URL evaluated by load balancer containing the scheme, host, path and query parameters. + optional string expected_output_url = 433967384; + + // Expected HTTP status code for rule with `urlRedirect` calculated by load balancer + optional int32 expected_redirect_response_code = 18888047; + + // Expected BackendService or BackendBucket resource the given URL should be mapped to. + optional string expected_service = 133987374; + + // HTTP headers of the request. + repeated UrlMapTestHeader headers = 258436998; + + // Host portion of the URL. + optional string host = 3208616; + + // Path portion including query parameters in the URL. + optional string path = 3433509; + +} + +// +message TestPermissionsRequest { + // The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + repeated string permissions = 59962500; + +} + +// +message TestPermissionsResponse { + // A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + repeated string permissions = 59962500; + +} + +// Message for the expected URL mappings. +message UrlMapTest { + // Description of this test case. + optional string description = 422937596; + + // The expected output URL evaluated by load balancer containing the scheme, host, path and query parameters. + // For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. + // For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to https. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. + // expectedOutputUrl is optional when service is specified. + optional string expected_output_url = 433967384; + + // For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. + // expectedRedirectResponseCode cannot be set when service is set. + optional int32 expected_redirect_response_code = 18888047; + + // HTTP headers for this request. If headers contains a host header, then host must also match the header value. + repeated UrlMapTestHeader headers = 258436998; + + // Host portion of the URL. If headers contains a host header, then host must also match the header value. + optional string host = 3208616; + + // Path portion of the URL. + optional string path = 3433509; + + // Expected BackendService or BackendBucket resource the given URL should be mapped to. + // service cannot be set if expectedRedirectResponseCode is set. + optional string service = 373540533; + +} + +// Contains a list of UrlMap resources. +message UrlMapList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of UrlMap resources. + repeated UrlMap items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message UrlMapReference { + optional string url_map = 367020684; + +} + +// Message representing the validation result for a UrlMap. +message UrlMapValidationResult { + repeated string load_errors = 310147300; + + // Whether the given UrlMap can be successfully loaded. If false, 'loadErrors' indicates the reasons. + optional bool load_succeeded = 128326216; + + repeated TestFailure test_failures = 505934134; + + // If successfully loaded, this field indicates whether the test passed. If false, 'testFailures's indicate the reason of failure. + optional bool test_passed = 192708797; + +} + +// +message UrlMapsScopedList { + // A list of UrlMaps contained in this scope. + repeated UrlMap url_maps = 103352167; + + // Informational warning which replaces the list of backend services when the list is empty. + optional Warning warning = 50704284; + +} + +// +message UrlMapsAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of UrlMapsScopedList resources. + map items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message UrlMapsValidateRequest { + // Content of the UrlMap to be validated. + optional UrlMap resource = 195806222; + +} + +// +message UrlMapsValidateResponse { + optional UrlMapValidationResult result = 139315229; + +} + +// Secondary IP range of a usable subnetwork. +message UsableSubnetworkSecondaryRange { + // The range of IP addresses belonging to this subnetwork secondary range. + optional string ip_cidr_range = 98117322; + + // The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. + optional string range_name = 332216397; + +} + +// Subnetwork which the current user has compute.subnetworks.use permission on. +message UsableSubnetwork { + // The range of internal addresses that are owned by this subnetwork. + optional string ip_cidr_range = 98117322; + + // Network URL. + optional string network = 232872494; + + // Secondary IP ranges. + repeated UsableSubnetworkSecondaryRange secondary_ip_ranges = 136658915; + + // Subnetwork URL. + optional string subnetwork = 307827694; + +} + +// +message UsableSubnetworksAggregatedList { + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output] A list of usable subnetwork URLs. + repeated UsableSubnetwork items = 100526016; + + // [Output Only] Type of resource. Always compute#usableSubnetworksAggregatedList for aggregated lists of usable subnetworks. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contain information of Nat mapping for an interface of this endpoint. +message VmEndpointNatMappingsInterfaceNatMappings { + // List of all drain IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + repeated string drain_nat_ip_port_ranges = 395440577; + + // A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: ["2.2.2.2:12345-12355", "1.1.1.1:2234-2234"]. + repeated string nat_ip_port_ranges = 531830810; + + // Total number of drain ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field drain_nat_ip_port_ranges. + optional int32 num_total_drain_nat_ports = 335532793; + + // Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges. + optional int32 num_total_nat_ports = 299904384; + + // Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: "10.33.4.55/32", or "192.168.5.0/24". + optional string source_alias_ip_range = 440340952; + + // Primary IP of the VM for this NIC. + optional string source_virtual_ip = 149836159; + +} + +// Contain information of Nat mapping for a VM endpoint (i.e., NIC). +message VmEndpointNatMappings { + // Name of the VM instance which the endpoint belongs to + optional string instance_name = 227947509; + + repeated VmEndpointNatMappingsInterfaceNatMappings interface_nat_mappings = 256196617; + +} + +// Contains a list of VmEndpointNatMappings. +message VmEndpointNatMappingsList { + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output Only] Type of resource. Always compute#vmEndpointNatMappingsList for lists of Nat mappings of VM endpoints. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] A list of Nat mapping information of VM endpoints. + repeated VmEndpointNatMappings result = 139315229; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// A VPN gateway interface. +message VpnGatewayVpnGatewayInterface { + // The numeric ID of this VPN gateway interface. + optional uint32 id = 3355; + + // URL of the interconnect attachment resource. When the value of this field is present, the VPN Gateway will be used for IPsec-encrypted Cloud Interconnect; all Egress or Ingress traffic for this VPN Gateway interface will go through the specified interconnect attachment resource. + // Not currently available in all Interconnect locations. + optional string interconnect_attachment = 308135284; + + // [Output Only] The external IP address for this VPN gateway interface. + optional string ip_address = 406272220; + +} + +// Represents a HA VPN gateway. +// +// HA VPN is a high-availability (HA) Cloud VPN solution that lets you securely connect your on-premises network to your Google Cloud Virtual Private Cloud network through an IPsec VPN connection in a single region. For more information about Cloud HA VPN solutions, see Cloud VPN topologies . (== resource_for {$api_version}.vpnGateways ==) +message VpnGateway { + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + optional string kind = 3292052; + + // A fingerprint for the labels being applied to this VpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. + // + // To see the latest fingerprint, make a get() request to retrieve an VpnGateway. + optional string label_fingerprint = 178124825; + + // Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty. + map labels = 500195327; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + optional string network = 232872494; + + // [Output Only] URL of the region where the VPN gateway resides. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // A list of interfaces on this VPN gateway. + repeated VpnGatewayVpnGatewayInterface vpn_interfaces = 91842181; + +} + +// +message VpnGatewaysScopedList { + // [Output Only] A list of VPN gateways contained in this scope. + repeated VpnGateway vpn_gateways = 259177882; + + // [Output Only] Informational warning which replaces the list of addresses when the list is empty. + optional Warning warning = 50704284; + +} + +// +message VpnGatewayAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of VpnGateway resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of VpnGateway resources. +message VpnGatewayList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of VpnGateway resources. + repeated VpnGateway items = 100526016; + + // [Output Only] Type of resource. Always compute#vpnGateway for VPN gateways. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// A VPN connection contains all VPN tunnels connected from this VpnGateway to the same peer gateway. The peer gateway could either be a external VPN gateway or GCP VPN gateway. +message VpnGatewayStatusVpnConnection { + // URL reference to the peer external VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + optional string peer_external_gateway = 384956173; + + // URL reference to the peer side VPN gateways to which the VPN tunnels in this VPN connection are connected. This field is mutually exclusive with peer_gcp_gateway. + optional string peer_gcp_gateway = 281867452; + + // HighAvailabilityRequirementState for the VPN connection. + optional VpnGatewayStatusHighAvailabilityRequirementState state = 109757585; + + // List of VPN tunnels that are in this VPN connection. + repeated VpnGatewayStatusTunnel tunnels = 104561931; + +} + +// +message VpnGatewayStatus { + // List of VPN connection for this VpnGateway. + repeated VpnGatewayStatusVpnConnection vpn_connections = 439334538; + +} + +// Describes the high availability requirement state for the VPN connection between this Cloud VPN gateway and a peer gateway. +message VpnGatewayStatusHighAvailabilityRequirementState { + // Indicates the high availability requirement state for the VPN connection. Valid values are CONNECTION_REDUNDANCY_MET, CONNECTION_REDUNDANCY_NOT_MET. + enum State { + // A value indicating that the enum field is not set. + UNDEFINED_STATE = 0; + + CONNECTION_REDUNDANCY_MET = 505242907; + + CONNECTION_REDUNDANCY_NOT_MET = 511863311; + + } + + // Indicates the reason why the VPN connection does not meet the high availability redundancy criteria/requirement. Valid values is INCOMPLETE_TUNNELS_COVERAGE. + enum UnsatisfiedReason { + // A value indicating that the enum field is not set. + UNDEFINED_UNSATISFIED_REASON = 0; + + INCOMPLETE_TUNNELS_COVERAGE = 55917437; + + } + + // Indicates the high availability requirement state for the VPN connection. Valid values are CONNECTION_REDUNDANCY_MET, CONNECTION_REDUNDANCY_NOT_MET. + optional State state = 109757585; + + // Indicates the reason why the VPN connection does not meet the high availability redundancy criteria/requirement. Valid values is INCOMPLETE_TUNNELS_COVERAGE. + optional UnsatisfiedReason unsatisfied_reason = 55016330; + +} + +// Contains some information about a VPN tunnel. +message VpnGatewayStatusTunnel { + // The VPN gateway interface this VPN tunnel is associated with. + optional uint32 local_gateway_interface = 158764330; + + // The peer gateway interface this VPN tunnel is connected to, the peer gateway could either be an external VPN gateway or GCP VPN gateway. + optional uint32 peer_gateway_interface = 214380385; + + // URL reference to the VPN tunnel. + optional string tunnel_url = 78975256; + +} + +// +message VpnGatewaysGetStatusResponse { + optional VpnGatewayStatus result = 139315229; + +} + +// Represents a Cloud VPN Tunnel resource. +// +// For more information about VPN, read the the Cloud VPN Overview. (== resource_for {$api_version}.vpnTunnels ==) +message VpnTunnel { + // [Output Only] The status of the VPN tunnel, which can be one of the following: + // - PROVISIONING: Resource is being allocated for the VPN tunnel. + // - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. + // - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. + // - ESTABLISHED: Secure session is successfully established with the peer VPN. + // - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS + // - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). + // - NEGOTIATION_FAILURE: Handshake failed. + // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. + // - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. + // - NO_INCOMING_PACKETS: No incoming packets from peer. + // - REJECTED: Tunnel configuration was rejected, can be result of being denied access. + // - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources. + // - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state. + // - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT. + // - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + ALLOCATING_RESOURCES = 320922816; + + AUTHORIZATION_ERROR = 23580290; + + DEPROVISIONING = 428935662; + + ESTABLISHED = 88852344; + + FAILED = 455706685; + + FIRST_HANDSHAKE = 191393000; + + NEGOTIATION_FAILURE = 360325868; + + NETWORK_ERROR = 193912951; + + NO_INCOMING_PACKETS = 119983216; + + PROVISIONING = 290896621; + + REJECTED = 174130302; + + STOPPED = 444276141; + + WAITING_FOR_FULL_CONFIG = 41640522; + + } + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // An optional description of this resource. Provide this property when you create the resource. + optional string description = 422937596; + + // [Output Only] Detailed status message for the VPN tunnel. + optional string detailed_status = 333501025; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // IKE protocol version to use when establishing the VPN tunnel with the peer VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2. + optional int32 ike_version = 218376220; + + // [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + optional string kind = 3292052; + + // Local traffic selector to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported. + repeated string local_traffic_selector = 317314613; + + // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + optional string name = 3373707; + + // URL of the peer side external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field is exclusive with the field peerGcpGateway. + optional string peer_external_gateway = 384956173; + + // The interface ID of the external VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. + optional int32 peer_external_gateway_interface = 452768391; + + // URL of the peer side HA GCP VPN gateway to which this VPN tunnel is connected. Provided by the client when the VPN tunnel is created. This field can be used when creating highly available VPN from VPC network to VPC network, the field is exclusive with the field peerExternalGateway. If provided, the VPN tunnel will automatically use the same vpnGatewayInterface ID in the peer GCP VPN gateway. + optional string peer_gcp_gateway = 281867452; + + // IP address of the peer VPN gateway. Only IPv4 is supported. + optional string peer_ip = 383249700; + + // [Output Only] URL of the region where the VPN tunnel resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + optional string region = 138946292; + + // Remote traffic selectors to use when establishing the VPN tunnel with the peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + repeated string remote_traffic_selector = 358887098; + + // URL of the router resource to be used for dynamic routing. + optional string router = 148608841; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // Shared secret used to set the secure session between the Cloud VPN gateway and the peer VPN gateway. + optional string shared_secret = 381932490; + + // Hash of the shared secret. + optional string shared_secret_hash = 398881891; + + // [Output Only] The status of the VPN tunnel, which can be one of the following: + // - PROVISIONING: Resource is being allocated for the VPN tunnel. + // - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related configs from the user. Network, TargetVpnGateway, VpnTunnel, ForwardingRule, and Route resources are needed to setup the VPN tunnel. + // - FIRST_HANDSHAKE: Successful first handshake with the peer VPN. + // - ESTABLISHED: Secure session is successfully established with the peer VPN. + // - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS + // - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret). + // - NEGOTIATION_FAILURE: Handshake failed. + // - DEPROVISIONING: Resources are being deallocated for the VPN tunnel. + // - FAILED: Tunnel creation has failed and the tunnel is not ready to be used. + // - NO_INCOMING_PACKETS: No incoming packets from peer. + // - REJECTED: Tunnel configuration was rejected, can be result of being denied access. + // - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all required resources. + // - STOPPED: Tunnel is stopped due to its Forwarding Rules being deleted for Classic VPN tunnels or the project is in frozen state. + // - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP, probably behind NAT. + // - TS_NARROWING_NOT_ALLOWED: Traffic selector narrowing not allowed for an HA-VPN tunnel. + optional Status status = 181260274; + + // URL of the Target VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. + optional string target_vpn_gateway = 532512843; + + // URL of the VPN gateway with which this VPN tunnel is associated. Provided by the client when the VPN tunnel is created. This must be used (instead of target_vpn_gateway) if a High Availability VPN gateway resource is created. + optional string vpn_gateway = 406684153; + + // The interface ID of the VPN gateway with which this VPN tunnel is associated. + optional int32 vpn_gateway_interface = 95979123; + +} + +// +message VpnTunnelsScopedList { + // A list of VPN tunnels contained in this scope. + repeated VpnTunnel vpn_tunnels = 163494080; + + // Informational warning which replaces the list of addresses when the list is empty. + optional Warning warning = 50704284; + +} + +// +message VpnTunnelAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of VpnTunnelsScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Contains a list of VpnTunnel resources. +message VpnTunnelList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of VpnTunnel resources. + repeated VpnTunnel items = 100526016; + + // [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message WafExpressionSetExpression { + // Expression ID should uniquely identify the origin of the expression. E.g. owasp-crs-v020901-id973337 identifies Owasp core rule set version 2.9.1 rule id 973337. The ID could be used to determine the individual attack definition that has been detected. It could also be used to exclude it from the policy in case of false positive. + optional string id = 3355; + +} + +// +message XpnHostList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // [Output Only] A list of shared VPC host project URLs. + repeated Project items = 100526016; + + // [Output Only] Type of resource. Always compute#xpnHostList for lists of shared VPC hosts. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// Represents a Zone resource. +// +// A zone is a deployment area. These deployment areas are subsets of a region. For example the zone us-east1-a is located in the us-east1 region. For more information, read Regions and Zones. (== resource_for {$api_version}.zones ==) +message Zone { + // [Output Only] Status of the zone, either UP or DOWN. + enum Status { + // A value indicating that the enum field is not set. + UNDEFINED_STATUS = 0; + + DOWN = 2104482; + + UP = 2715; + + } + + // [Output Only] Available cpu/platform selections for the zone. + repeated string available_cpu_platforms = 175536531; + + // [Output Only] Creation timestamp in RFC3339 text format. + optional string creation_timestamp = 30525366; + + // [Output Only] The deprecation status associated with this zone. + optional DeprecationStatus deprecated = 515138995; + + // [Output Only] Textual description of the resource. + optional string description = 422937596; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional uint64 id = 3355; + + // [Output Only] Type of the resource. Always compute#zone for zones. + optional string kind = 3292052; + + // [Output Only] Name of the resource. + optional string name = 3373707; + + // [Output Only] Full URL reference to the region which hosts the zone. + optional string region = 138946292; + + // [Output Only] Server-defined URL for the resource. + optional string self_link = 456214797; + + // [Output Only] Status of the zone, either UP or DOWN. + optional Status status = 181260274; + + // [Output Only] Reserved for future use. + optional bool supports_pzs = 83983214; + +} + +// Contains a list of zone resources. +message ZoneList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of Zone resources. + repeated Zone items = 100526016; + + // Type of resource. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message ZoneSetLabelsRequest { + // The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels. Make a get() request to the resource to get the latest fingerprint. + optional string label_fingerprint = 178124825; + + // The labels to set for this resource. + map labels = 500195327; + +} + +// +message ZoneSetPolicyRequest { + // Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings. + repeated Binding bindings = 403251854; + + // Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag. + optional string etag = 3123477; + + // 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 in general a valid policy but certain services (like Projects) might reject them. + optional Policy policy = 91071794; + +} + +// A request message for AcceleratorTypes.AggregatedList. See the method description for details. +message AggregatedListAcceleratorTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for AcceleratorTypes.Get. See the method description for details. +message GetAcceleratorTypeRequest { + // Name of the accelerator type to return. + string accelerator_type = 138031246 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for AcceleratorTypes.List. See the method description for details. +message ListAcceleratorTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Addresses.AggregatedList. See the method description for details. +message AggregatedListAddressesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Addresses.Delete. See the method description for details. +message DeleteAddressRequest { + // Name of the address resource to delete. + string address = 462920692 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Addresses.Get. See the method description for details. +message GetAddressRequest { + // Name of the address resource to return. + string address = 462920692 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Addresses.Insert. See the method description for details. +message InsertAddressRequest { + // The body resource for this request + Address address_resource = 483888121 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Addresses.List. See the method description for details. +message ListAddressesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Autoscalers.AggregatedList. See the method description for details. +message AggregatedListAutoscalersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Autoscalers.Delete. See the method description for details. +message DeleteAutoscalerRequest { + // Name of the autoscaler to delete. + string autoscaler = 517258967 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Autoscalers.Get. See the method description for details. +message GetAutoscalerRequest { + // Name of the autoscaler to return. + string autoscaler = 517258967 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Autoscalers.Insert. See the method description for details. +message InsertAutoscalerRequest { + // The body resource for this request + Autoscaler autoscaler_resource = 207616118 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Autoscalers.List. See the method description for details. +message ListAutoscalersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Autoscalers.Patch. See the method description for details. +message PatchAutoscalerRequest { + // Name of the autoscaler to patch. + optional string autoscaler = 517258967; + + // The body resource for this request + Autoscaler autoscaler_resource = 207616118 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Autoscalers.Update. See the method description for details. +message UpdateAutoscalerRequest { + // Name of the autoscaler to update. + optional string autoscaler = 517258967; + + // The body resource for this request + Autoscaler autoscaler_resource = 207616118 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for BackendBuckets.AddSignedUrlKey. See the method description for details. +message AddSignedUrlKeyBackendBucketRequest { + // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + string backend_bucket = 91714037 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SignedUrlKey signed_url_key_resource = 457625985 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for BackendBuckets.Delete. See the method description for details. +message DeleteBackendBucketRequest { + // Name of the BackendBucket resource to delete. + string backend_bucket = 91714037 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendBuckets.DeleteSignedUrlKey. See the method description for details. +message DeleteSignedUrlKeyBackendBucketRequest { + // Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + string backend_bucket = 91714037 [(google.api.field_behavior) = REQUIRED]; + + // The name of the Signed URL Key to delete. + string key_name = 500938859 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendBuckets.Get. See the method description for details. +message GetBackendBucketRequest { + // Name of the BackendBucket resource to return. + string backend_bucket = 91714037 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for BackendBuckets.Insert. See the method description for details. +message InsertBackendBucketRequest { + // The body resource for this request + BackendBucket backend_bucket_resource = 380757784 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendBuckets.List. See the method description for details. +message ListBackendBucketsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for BackendBuckets.Patch. See the method description for details. +message PatchBackendBucketRequest { + // Name of the BackendBucket resource to patch. + string backend_bucket = 91714037 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + BackendBucket backend_bucket_resource = 380757784 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendBuckets.Update. See the method description for details. +message UpdateBackendBucketRequest { + // Name of the BackendBucket resource to update. + string backend_bucket = 91714037 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + BackendBucket backend_bucket_resource = 380757784 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendServices.AddSignedUrlKey. See the method description for details. +message AddSignedUrlKeyBackendServiceRequest { + // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SignedUrlKey signed_url_key_resource = 457625985 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for BackendServices.AggregatedList. See the method description for details. +message AggregatedListBackendServicesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Name of the project scoping this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for BackendServices.Delete. See the method description for details. +message DeleteBackendServiceRequest { + // Name of the BackendService resource to delete. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendServices.DeleteSignedUrlKey. See the method description for details. +message DeleteSignedUrlKeyBackendServiceRequest { + // Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // The name of the Signed URL Key to delete. + string key_name = 500938859 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendServices.Get. See the method description for details. +message GetBackendServiceRequest { + // Name of the BackendService resource to return. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for BackendServices.GetHealth. See the method description for details. +message GetHealthBackendServiceRequest { + // Name of the BackendService resource to which the queried instance belongs. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ResourceGroupReference resource_group_reference_resource = 112951123 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for BackendServices.Insert. See the method description for details. +message InsertBackendServiceRequest { + // The body resource for this request + BackendService backend_service_resource = 347586723 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendServices.List. See the method description for details. +message ListBackendServicesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for BackendServices.Patch. See the method description for details. +message PatchBackendServiceRequest { + // Name of the BackendService resource to patch. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + BackendService backend_service_resource = 347586723 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for BackendServices.SetSecurityPolicy. See the method description for details. +message SetSecurityPolicyBackendServiceRequest { + // Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SecurityPolicyReference security_policy_reference_resource = 204135024 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for BackendServices.Update. See the method description for details. +message UpdateBackendServiceRequest { + // Name of the BackendService resource to update. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + BackendService backend_service_resource = 347586723 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for DiskTypes.AggregatedList. See the method description for details. +message AggregatedListDiskTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for DiskTypes.Get. See the method description for details. +message GetDiskTypeRequest { + // Name of the disk type to return. + string disk_type = 93009052 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for DiskTypes.List. See the method description for details. +message ListDiskTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.AddResourcePolicies. See the method description for details. +message AddResourcePoliciesDiskRequest { + // The disk name for this request. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + DisksAddResourcePoliciesRequest disks_add_resource_policies_request_resource = 496483363 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.AggregatedList. See the method description for details. +message AggregatedListDisksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Disks.CreateSnapshot. See the method description for details. +message CreateSnapshotDiskRequest { + // Name of the persistent disk to snapshot. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // [Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS). + optional bool guest_flush = 385550813; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Snapshot snapshot_resource = 481319977 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.Delete. See the method description for details. +message DeleteDiskRequest { + // Name of the persistent disk to delete. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.Get. See the method description for details. +message GetDiskRequest { + // Name of the persistent disk to return. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.GetIamPolicy. See the method description for details. +message GetIamPolicyDiskRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.Insert. See the method description for details. +message InsertDiskRequest { + // The body resource for this request + Disk disk_resource = 25880688 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Source image to restore onto a disk. This field is optional. + optional string source_image = 50443319; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.List. See the method description for details. +message ListDisksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.RemoveResourcePolicies. See the method description for details. +message RemoveResourcePoliciesDiskRequest { + // The disk name for this request. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + DisksRemoveResourcePoliciesRequest disks_remove_resource_policies_request_resource = 436756718 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.Resize. See the method description for details. +message ResizeDiskRequest { + // The name of the persistent disk. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + DisksResizeRequest disks_resize_request_resource = 78307616 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.SetIamPolicy. See the method description for details. +message SetIamPolicyDiskRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.SetLabels. See the method description for details. +message SetLabelsDiskRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ZoneSetLabelsRequest zone_set_labels_request_resource = 364950798 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Disks.TestIamPermissions. See the method description for details. +message TestIamPermissionsDiskRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ExternalVpnGateways.Delete. See the method description for details. +message DeleteExternalVpnGatewayRequest { + // Name of the externalVpnGateways to delete. + string external_vpn_gateway = 109898629 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for ExternalVpnGateways.Get. See the method description for details. +message GetExternalVpnGatewayRequest { + // Name of the externalVpnGateway to return. + string external_vpn_gateway = 109898629 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ExternalVpnGateways.Insert. See the method description for details. +message InsertExternalVpnGatewayRequest { + // The body resource for this request + ExternalVpnGateway external_vpn_gateway_resource = 486813576 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for ExternalVpnGateways.List. See the method description for details. +message ListExternalVpnGatewaysRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for ExternalVpnGateways.SetLabels. See the method description for details. +message SetLabelsExternalVpnGatewayRequest { + // The body resource for this request + GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ExternalVpnGateways.TestIamPermissions. See the method description for details. +message TestIamPermissionsExternalVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for FirewallPolicies.AddAssociation. See the method description for details. +message AddAssociationFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + FirewallPolicyAssociation firewall_policy_association_resource = 259546170 [(google.api.field_behavior) = REQUIRED]; + + // Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + optional bool replace_existing_association = 209541240; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.AddRule. See the method description for details. +message AddRuleFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.CloneRules. See the method description for details. +message CloneRulesFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The firewall policy from which to copy rules. + optional string source_firewall_policy = 25013549; + +} + +// A request message for FirewallPolicies.Delete. See the method description for details. +message DeleteFirewallPolicyRequest { + // Name of the firewall policy to delete. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.Get. See the method description for details. +message GetFirewallPolicyRequest { + // Name of the firewall policy to get. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for FirewallPolicies.GetAssociation. See the method description for details. +message GetAssociationFirewallPolicyRequest { + // Name of the firewall policy to which the queried rule belongs. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The name of the association to get from the firewall policy. + optional string name = 3373707; + +} + +// A request message for FirewallPolicies.GetIamPolicy. See the method description for details. +message GetIamPolicyFirewallPolicyRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for FirewallPolicies.GetRule. See the method description for details. +message GetRuleFirewallPolicyRequest { + // Name of the firewall policy to which the queried rule belongs. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The priority of the rule to get from the firewall policy. + optional int32 priority = 445151652; + +} + +// A request message for FirewallPolicies.Insert. See the method description for details. +message InsertFirewallPolicyRequest { + // The body resource for this request + FirewallPolicy firewall_policy_resource = 495049532 [(google.api.field_behavior) = REQUIRED]; + + // Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. + optional string parent_id = 459714768; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.List. See the method description for details. +message ListFirewallPoliciesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Parent ID for this request. + optional string parent_id = 459714768; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for FirewallPolicies.ListAssociations. See the method description for details. +message ListAssociationsFirewallPolicyRequest { + // The target resource to list associations. It is an organization, or a folder. + optional string target_resource = 467318524; + +} + +// A request message for FirewallPolicies.Move. See the method description for details. +message MoveFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The new parent of the firewall policy. + optional string parent_id = 459714768; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.Patch. See the method description for details. +message PatchFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + FirewallPolicy firewall_policy_resource = 495049532 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.PatchRule. See the method description for details. +message PatchRuleFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(google.api.field_behavior) = REQUIRED]; + + // The priority of the rule to patch. + optional int32 priority = 445151652; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.RemoveAssociation. See the method description for details. +message RemoveAssociationFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // Name for the attachment that will be removed. + optional string name = 3373707; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.RemoveRule. See the method description for details. +message RemoveRuleFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The priority of the rule to remove from the firewall policy. + optional int32 priority = 445151652; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for FirewallPolicies.SetIamPolicy. See the method description for details. +message SetIamPolicyFirewallPolicyRequest { + // The body resource for this request + GlobalOrganizationSetPolicyRequest global_organization_set_policy_request_resource = 177408606 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for FirewallPolicies.TestIamPermissions. See the method description for details. +message TestIamPermissionsFirewallPolicyRequest { + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Firewalls.Delete. See the method description for details. +message DeleteFirewallRequest { + // Name of the firewall rule to delete. + string firewall = 511016192 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Firewalls.Get. See the method description for details. +message GetFirewallRequest { + // Name of the firewall rule to return. + string firewall = 511016192 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Firewalls.Insert. See the method description for details. +message InsertFirewallRequest { + // The body resource for this request + Firewall firewall_resource = 41425005 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Firewalls.List. See the method description for details. +message ListFirewallsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Firewalls.Patch. See the method description for details. +message PatchFirewallRequest { + // Name of the firewall rule to patch. + string firewall = 511016192 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Firewall firewall_resource = 41425005 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Firewalls.Update. See the method description for details. +message UpdateFirewallRequest { + // Name of the firewall rule to update. + string firewall = 511016192 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Firewall firewall_resource = 41425005 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for ForwardingRules.AggregatedList. See the method description for details. +message AggregatedListForwardingRulesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for ForwardingRules.Delete. See the method description for details. +message DeleteForwardingRuleRequest { + // Name of the ForwardingRule resource to delete. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for ForwardingRules.Get. See the method description for details. +message GetForwardingRuleRequest { + // Name of the ForwardingRule resource to return. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ForwardingRules.Insert. See the method description for details. +message InsertForwardingRuleRequest { + // The body resource for this request + ForwardingRule forwarding_rule_resource = 301211695 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for ForwardingRules.List. See the method description for details. +message ListForwardingRulesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for ForwardingRules.Patch. See the method description for details. +message PatchForwardingRuleRequest { + // Name of the ForwardingRule resource to patch. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ForwardingRule forwarding_rule_resource = 301211695 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for ForwardingRules.SetLabels. See the method description for details. +message SetLabelsForwardingRuleRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ForwardingRules.SetTarget. See the method description for details. +message SetTargetForwardingRuleRequest { + // Name of the ForwardingRule resource in which target is to be set. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetReference target_reference_resource = 523721712 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalAddresses.Delete. See the method description for details. +message DeleteGlobalAddressRequest { + // Name of the address resource to delete. + string address = 462920692 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalAddresses.Get. See the method description for details. +message GetGlobalAddressRequest { + // Name of the address resource to return. + string address = 462920692 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalAddresses.Insert. See the method description for details. +message InsertGlobalAddressRequest { + // The body resource for this request + Address address_resource = 483888121 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalAddresses.List. See the method description for details. +message ListGlobalAddressesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalForwardingRules.Delete. See the method description for details. +message DeleteGlobalForwardingRuleRequest { + // Name of the ForwardingRule resource to delete. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalForwardingRules.Get. See the method description for details. +message GetGlobalForwardingRuleRequest { + // Name of the ForwardingRule resource to return. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalForwardingRules.Insert. See the method description for details. +message InsertGlobalForwardingRuleRequest { + // The body resource for this request + ForwardingRule forwarding_rule_resource = 301211695 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalForwardingRules.List. See the method description for details. +message ListGlobalForwardingRulesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalForwardingRules.Patch. See the method description for details. +message PatchGlobalForwardingRuleRequest { + // Name of the ForwardingRule resource to patch. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ForwardingRule forwarding_rule_resource = 301211695 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalForwardingRules.SetLabels. See the method description for details. +message SetLabelsGlobalForwardingRuleRequest { + // The body resource for this request + GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalForwardingRules.SetTarget. See the method description for details. +message SetTargetGlobalForwardingRuleRequest { + // Name of the ForwardingRule resource in which target is to be set. + string forwarding_rule = 269964030 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetReference target_reference_resource = 523721712 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalNetworkEndpointGroups.AttachNetworkEndpoints. See the method description for details. +message AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest { + // The body resource for this request + GlobalNetworkEndpointGroupsAttachEndpointsRequest global_network_endpoint_groups_attach_endpoints_request_resource = 30691563 [(google.api.field_behavior) = REQUIRED]; + + // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalNetworkEndpointGroups.Delete. See the method description for details. +message DeleteGlobalNetworkEndpointGroupRequest { + // The name of the network endpoint group to delete. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalNetworkEndpointGroups.DetachNetworkEndpoints. See the method description for details. +message DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest { + // The body resource for this request + GlobalNetworkEndpointGroupsDetachEndpointsRequest global_network_endpoint_groups_detach_endpoints_request_resource = 8898269 [(google.api.field_behavior) = REQUIRED]; + + // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalNetworkEndpointGroups.Get. See the method description for details. +message GetGlobalNetworkEndpointGroupRequest { + // The name of the network endpoint group. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalNetworkEndpointGroups.Insert. See the method description for details. +message InsertGlobalNetworkEndpointGroupRequest { + // The body resource for this request + NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalNetworkEndpointGroups.List. See the method description for details. +message ListGlobalNetworkEndpointGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalNetworkEndpointGroups.ListNetworkEndpoints. See the method description for details. +message ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalOperations.AggregatedList. See the method description for details. +message AggregatedListGlobalOperationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalOperations.Delete. See the method description for details. +message DeleteGlobalOperationRequest { + // Name of the Operations resource to delete. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A response message for GlobalOperations.Delete. See the method description for details. +message DeleteGlobalOperationResponse { +} + +// A request message for GlobalOperations.Get. See the method description for details. +message GetGlobalOperationRequest { + // Name of the Operations resource to return. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalOperations.List. See the method description for details. +message ListGlobalOperationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalOperations.Wait. See the method description for details. +message WaitGlobalOperationRequest { + // Name of the Operations resource to return. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalOrganizationOperations.Delete. See the method description for details. +message DeleteGlobalOrganizationOperationRequest { + // Name of the Operations resource to delete. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Parent ID for this request. + optional string parent_id = 459714768; + +} + +// A response message for GlobalOrganizationOperations.Delete. See the method description for details. +message DeleteGlobalOrganizationOperationResponse { +} + +// A request message for GlobalOrganizationOperations.Get. See the method description for details. +message GetGlobalOrganizationOperationRequest { + // Name of the Operations resource to return. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Parent ID for this request. + optional string parent_id = 459714768; + +} + +// A request message for GlobalOrganizationOperations.List. See the method description for details. +message ListGlobalOrganizationOperationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Parent ID for this request. + optional string parent_id = 459714768; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalPublicDelegatedPrefixes.Delete. See the method description for details. +message DeleteGlobalPublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicDelegatedPrefix resource to delete. + string public_delegated_prefix = 204238440 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalPublicDelegatedPrefixes.Get. See the method description for details. +message GetGlobalPublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicDelegatedPrefix resource to return. + string public_delegated_prefix = 204238440 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for GlobalPublicDelegatedPrefixes.Insert. See the method description for details. +message InsertGlobalPublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for GlobalPublicDelegatedPrefixes.List. See the method description for details. +message ListGlobalPublicDelegatedPrefixesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for GlobalPublicDelegatedPrefixes.Patch. See the method description for details. +message PatchGlobalPublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicDelegatedPrefix resource to patch. + string public_delegated_prefix = 204238440 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for HealthChecks.AggregatedList. See the method description for details. +message AggregatedListHealthChecksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Name of the project scoping this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for HealthChecks.Delete. See the method description for details. +message DeleteHealthCheckRequest { + // Name of the HealthCheck resource to delete. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for HealthChecks.Get. See the method description for details. +message GetHealthCheckRequest { + // Name of the HealthCheck resource to return. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for HealthChecks.Insert. See the method description for details. +message InsertHealthCheckRequest { + // The body resource for this request + HealthCheck health_check_resource = 201925032 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for HealthChecks.List. See the method description for details. +message ListHealthChecksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for HealthChecks.Patch. See the method description for details. +message PatchHealthCheckRequest { + // Name of the HealthCheck resource to patch. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + HealthCheck health_check_resource = 201925032 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for HealthChecks.Update. See the method description for details. +message UpdateHealthCheckRequest { + // Name of the HealthCheck resource to update. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + HealthCheck health_check_resource = 201925032 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Images.Delete. See the method description for details. +message DeleteImageRequest { + // Name of the image resource to delete. + string image = 100313435 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Images.Deprecate. See the method description for details. +message DeprecateImageRequest { + // The body resource for this request + DeprecationStatus deprecation_status_resource = 333006064 [(google.api.field_behavior) = REQUIRED]; + + // Image name. + string image = 100313435 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Images.Get. See the method description for details. +message GetImageRequest { + // Name of the image resource to return. + string image = 100313435 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Images.GetFromFamily. See the method description for details. +message GetFromFamilyImageRequest { + // Name of the image family to search for. + string family = 328751972 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Images.GetIamPolicy. See the method description for details. +message GetIamPolicyImageRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Images.Insert. See the method description for details. +message InsertImageRequest { + // Force image creation if true. + optional bool force_create = 197723344; + + // The body resource for this request + Image image_resource = 371171954 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Images.List. See the method description for details. +message ListImagesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Images.Patch. See the method description for details. +message PatchImageRequest { + // Name of the image resource to patch. + string image = 100313435 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Image image_resource = 371171954 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Images.SetIamPolicy. See the method description for details. +message SetIamPolicyImageRequest { + // The body resource for this request + GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Images.SetLabels. See the method description for details. +message SetLabelsImageRequest { + // The body resource for this request + GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Images.TestIamPermissions. See the method description for details. +message TestIamPermissionsImageRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.AbandonInstances. See the method description for details. +message AbandonInstancesInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersAbandonInstancesRequest instance_group_managers_abandon_instances_request_resource = 320929016 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.AggregatedList. See the method description for details. +message AggregatedListInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for InstanceGroupManagers.ApplyUpdatesToInstances. See the method description for details. +message ApplyUpdatesToInstancesInstanceGroupManagerRequest { + // The name of the managed instance group, should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersApplyUpdatesRequest instance_group_managers_apply_updates_request_resource = 259242835 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone where the managed instance group is located. Should conform to RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.CreateInstances. See the method description for details. +message CreateInstancesInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersCreateInstancesRequest instance_group_managers_create_instances_request_resource = 24558867 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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. + // + // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. It should conform to RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.Delete. See the method description for details. +message DeleteInstanceGroupManagerRequest { + // The name of the managed instance group to delete. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.DeleteInstances. See the method description for details. +message DeleteInstancesInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersDeleteInstancesRequest instance_group_managers_delete_instances_request_resource = 166421252 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.DeletePerInstanceConfigs. See the method description for details. +message DeletePerInstanceConfigsInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersDeletePerInstanceConfigsReq instance_group_managers_delete_per_instance_configs_req_resource = 362427680 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone where the managed instance group is located. It should conform to RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.Get. See the method description for details. +message GetInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.Insert. See the method description for details. +message InsertInstanceGroupManagerRequest { + // The body resource for this request + InstanceGroupManager instance_group_manager_resource = 261063946 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where you want to create the managed instance group. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.List. See the method description for details. +message ListInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.ListErrors. See the method description for details. +message ListErrorsInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the managed instance group is located. It should conform to RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.ListManagedInstances. See the method description for details. +message ListManagedInstancesInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.ListPerInstanceConfigs. See the method description for details. +message ListPerInstanceConfigsInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the managed instance group is located. It should conform to RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.Patch. See the method description for details. +message PatchInstanceGroupManagerRequest { + // The name of the instance group manager. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManager instance_group_manager_resource = 261063946 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where you want to create the managed instance group. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.PatchPerInstanceConfigs. See the method description for details. +message PatchPerInstanceConfigsInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersPatchPerInstanceConfigsReq instance_group_managers_patch_per_instance_configs_req_resource = 356650495 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. It should conform to RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.RecreateInstances. See the method description for details. +message RecreateInstancesInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersRecreateInstancesRequest instance_group_managers_recreate_instances_request_resource = 21405952 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.Resize. See the method description for details. +message ResizeInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + int32 size = 3530753 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.SetInstanceTemplate. See the method description for details. +message SetInstanceTemplateInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersSetInstanceTemplateRequest instance_group_managers_set_instance_template_request_resource = 9809093 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.SetTargetPools. See the method description for details. +message SetTargetPoolsInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersSetTargetPoolsRequest instance_group_managers_set_target_pools_request_resource = 281150216 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroupManagers.UpdatePerInstanceConfigs. See the method description for details. +message UpdatePerInstanceConfigsInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManagersUpdatePerInstanceConfigsReq instance_group_managers_update_per_instance_configs_req_resource = 141402302 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the managed instance group is located. It should conform to RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.AddInstances. See the method description for details. +message AddInstancesInstanceGroupRequest { + // The name of the instance group where you are adding instances. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupsAddInstancesRequest instance_groups_add_instances_request_resource = 453713246 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.AggregatedList. See the method description for details. +message AggregatedListInstanceGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for InstanceGroups.Delete. See the method description for details. +message DeleteInstanceGroupRequest { + // The name of the instance group to delete. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.Get. See the method description for details. +message GetInstanceGroupRequest { + // The name of the instance group. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone where the instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.Insert. See the method description for details. +message InsertInstanceGroupRequest { + // The body resource for this request + InstanceGroup instance_group_resource = 286612152 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where you want to create the instance group. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.List. See the method description for details. +message ListInstanceGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.ListInstances. See the method description for details. +message ListInstancesInstanceGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The name of the instance group from which you want to generate a list of included instances. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupsListInstancesRequest instance_groups_list_instances_request_resource = 476255263 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.RemoveInstances. See the method description for details. +message RemoveInstancesInstanceGroupRequest { + // The name of the instance group where the specified instances will be removed. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupsRemoveInstancesRequest instance_groups_remove_instances_request_resource = 390981817 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceGroups.SetNamedPorts. See the method description for details. +message SetNamedPortsInstanceGroupRequest { + // The name of the instance group where the named ports are updated. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupsSetNamedPortsRequest instance_groups_set_named_ports_request_resource = 385151535 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the instance group is located. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceTemplates.Delete. See the method description for details. +message DeleteInstanceTemplateRequest { + // The name of the instance template to delete. + string instance_template = 309248228 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for InstanceTemplates.Get. See the method description for details. +message GetInstanceTemplateRequest { + // The name of the instance template. + string instance_template = 309248228 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceTemplates.GetIamPolicy. See the method description for details. +message GetIamPolicyInstanceTemplateRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceTemplates.Insert. See the method description for details. +message InsertInstanceTemplateRequest { + // The body resource for this request + InstanceTemplate instance_template_resource = 10679561 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for InstanceTemplates.List. See the method description for details. +message ListInstanceTemplatesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for InstanceTemplates.SetIamPolicy. See the method description for details. +message SetIamPolicyInstanceTemplateRequest { + // The body resource for this request + GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InstanceTemplates.TestIamPermissions. See the method description for details. +message TestIamPermissionsInstanceTemplateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.AddAccessConfig. See the method description for details. +message AddAccessConfigInstanceRequest { + // The body resource for this request + AccessConfig access_config_resource = 387825552 [(google.api.field_behavior) = REQUIRED]; + + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The name of the network interface to add to this instance. + string network_interface = 365387880 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.AddResourcePolicies. See the method description for details. +message AddResourcePoliciesInstanceRequest { + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesAddResourcePoliciesRequest instances_add_resource_policies_request_resource = 489351963 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.AggregatedList. See the method description for details. +message AggregatedListInstancesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Instances.AttachDisk. See the method description for details. +message AttachDiskInstanceRequest { + // The body resource for this request + AttachedDisk attached_disk_resource = 90605845 [(google.api.field_behavior) = REQUIRED]; + + // Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + optional bool force_attach = 142758425; + + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.BulkInsert. See the method description for details. +message BulkInsertInstanceRequest { + // The body resource for this request + BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.Delete. See the method description for details. +message DeleteInstanceRequest { + // Name of the instance resource to delete. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.DeleteAccessConfig. See the method description for details. +message DeleteAccessConfigInstanceRequest { + // The name of the access config to delete. + string access_config = 72856189 [(google.api.field_behavior) = REQUIRED]; + + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The name of the network interface. + string network_interface = 365387880 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.DetachDisk. See the method description for details. +message DetachDiskInstanceRequest { + // The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + string device_name = 67541716 [(google.api.field_behavior) = REQUIRED]; + + // Instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.Get. See the method description for details. +message GetInstanceRequest { + // Name of the instance resource to return. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.GetEffectiveFirewalls. See the method description for details. +message GetEffectiveFirewallsInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The name of the network interface to get the effective firewalls. + string network_interface = 365387880 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.GetGuestAttributes. See the method description for details. +message GetGuestAttributesInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the guest attributes path to be queried. + optional string query_path = 368591164; + + // Specifies the key for the guest attributes entry. + optional string variable_key = 164364828; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.GetIamPolicy. See the method description for details. +message GetIamPolicyInstanceRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.GetScreenshot. See the method description for details. +message GetScreenshotInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.GetSerialPortOutput. See the method description for details. +message GetSerialPortOutputInstanceRequest { + // Name of the instance for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Specifies which COM or serial port to retrieve data from. + optional int32 port = 3446913; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. + // + // If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. + // + // You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. + optional int64 start = 109757538; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.GetShieldedInstanceIdentity. See the method description for details. +message GetShieldedInstanceIdentityInstanceRequest { + // Name or id of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.Insert. See the method description for details. +message InsertInstanceRequest { + // The body resource for this request + Instance instance_resource = 215988344 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Specifies instance template to create the instance. + // + // This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + // - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate + // - projects/project/global/instanceTemplates/instanceTemplate + // - global/instanceTemplates/instanceTemplate + optional string source_instance_template = 332423616; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.List. See the method description for details. +message ListInstancesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.ListReferrers. See the method description for details. +message ListReferrersInstancesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.RemoveResourcePolicies. See the method description for details. +message RemoveResourcePoliciesInstanceRequest { + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesRemoveResourcePoliciesRequest instances_remove_resource_policies_request_resource = 49229558 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.Reset. See the method description for details. +message ResetInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetDeletionProtection. See the method description for details. +message SetDeletionProtectionInstanceRequest { + // Whether the resource should be protected against deletion. + optional bool deletion_protection = 458014698; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetDiskAutoDelete. See the method description for details. +message SetDiskAutoDeleteInstanceRequest { + // Whether to auto-delete the disk when the instance is deleted. + bool auto_delete = 464761403 [(google.api.field_behavior) = REQUIRED]; + + // The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + string device_name = 67541716 [(google.api.field_behavior) = REQUIRED]; + + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetIamPolicy. See the method description for details. +message SetIamPolicyInstanceRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetLabels. See the method description for details. +message SetLabelsInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesSetLabelsRequest instances_set_labels_request_resource = 207749344 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetMachineResources. See the method description for details. +message SetMachineResourcesInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesSetMachineResourcesRequest instances_set_machine_resources_request_resource = 196286318 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetMachineType. See the method description for details. +message SetMachineTypeInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesSetMachineTypeRequest instances_set_machine_type_request_resource = 254157709 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetMetadata. See the method description for details. +message SetMetadataInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Metadata metadata_resource = 291086110 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetMinCpuPlatform. See the method description for details. +message SetMinCpuPlatformInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesSetMinCpuPlatformRequest instances_set_min_cpu_platform_request_resource = 148459368 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetScheduling. See the method description for details. +message SetSchedulingInstanceRequest { + // Instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Scheduling scheduling_resource = 463181401 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetServiceAccount. See the method description for details. +message SetServiceAccountInstanceRequest { + // Name of the instance resource to start. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesSetServiceAccountRequest instances_set_service_account_request_resource = 275550008 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetShieldedInstanceIntegrityPolicy. See the method description for details. +message SetShieldedInstanceIntegrityPolicyInstanceRequest { + // Name or id of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + ShieldedInstanceIntegrityPolicy shielded_instance_integrity_policy_resource = 409169462 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SetTags. See the method description for details. +message SetTagsInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Tags tags_resource = 331435380 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.SimulateMaintenanceEvent. See the method description for details. +message SimulateMaintenanceEventInstanceRequest { + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.Start. See the method description for details. +message StartInstanceRequest { + // Name of the instance resource to start. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.StartWithEncryptionKey. See the method description for details. +message StartWithEncryptionKeyInstanceRequest { + // Name of the instance resource to start. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstancesStartWithEncryptionKeyRequest instances_start_with_encryption_key_request_resource = 441712511 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.Stop. See the method description for details. +message StopInstanceRequest { + // Name of the instance resource to stop. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.TestIamPermissions. See the method description for details. +message TestIamPermissionsInstanceRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.Update. See the method description for details. +message UpdateInstanceRequest { + // Name of the instance resource to update. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Instance instance_resource = 215988344 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + optional string minimal_action = 270567060; + + // Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + optional string most_disruptive_allowed_action = 66103053; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.UpdateAccessConfig. See the method description for details. +message UpdateAccessConfigInstanceRequest { + // The body resource for this request + AccessConfig access_config_resource = 387825552 [(google.api.field_behavior) = REQUIRED]; + + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The name of the network interface where the access config is attached. + string network_interface = 365387880 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.UpdateDisplayDevice. See the method description for details. +message UpdateDisplayDeviceInstanceRequest { + // The body resource for this request + DisplayDevice display_device_resource = 289686106 [(google.api.field_behavior) = REQUIRED]; + + // Name of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.UpdateNetworkInterface. See the method description for details. +message UpdateNetworkInterfaceInstanceRequest { + // The instance name for this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // The name of the network interface to update. + string network_interface = 365387880 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NetworkInterface network_interface_resource = 325814789 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Instances.UpdateShieldedInstanceConfig. See the method description for details. +message UpdateShieldedInstanceConfigInstanceRequest { + // Name or id of the instance scoping this request. + string instance = 18257045 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + ShieldedInstanceConfig shielded_instance_config_resource = 272059224 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InterconnectAttachments.AggregatedList. See the method description for details. +message AggregatedListInterconnectAttachmentsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for InterconnectAttachments.Delete. See the method description for details. +message DeleteInterconnectAttachmentRequest { + // Name of the interconnect attachment to delete. + string interconnect_attachment = 308135284 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for InterconnectAttachments.Get. See the method description for details. +message GetInterconnectAttachmentRequest { + // Name of the interconnect attachment to return. + string interconnect_attachment = 308135284 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InterconnectAttachments.Insert. See the method description for details. +message InsertInterconnectAttachmentRequest { + // The body resource for this request + InterconnectAttachment interconnect_attachment_resource = 212341369 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // If true, the request will not be committed. + optional bool validate_only = 242744629; + +} + +// A request message for InterconnectAttachments.List. See the method description for details. +message ListInterconnectAttachmentsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for InterconnectAttachments.Patch. See the method description for details. +message PatchInterconnectAttachmentRequest { + // Name of the interconnect attachment to patch. + string interconnect_attachment = 308135284 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InterconnectAttachment interconnect_attachment_resource = 212341369 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for InterconnectLocations.Get. See the method description for details. +message GetInterconnectLocationRequest { + // Name of the interconnect location to return. + string interconnect_location = 492235846 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for InterconnectLocations.List. See the method description for details. +message ListInterconnectLocationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Interconnects.Delete. See the method description for details. +message DeleteInterconnectRequest { + // Name of the interconnect to delete. + string interconnect = 224601230 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Interconnects.Get. See the method description for details. +message GetInterconnectRequest { + // Name of the interconnect to return. + string interconnect = 224601230 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Interconnects.GetDiagnostics. See the method description for details. +message GetDiagnosticsInterconnectRequest { + // Name of the interconnect resource to query. + string interconnect = 224601230 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Interconnects.Insert. See the method description for details. +message InsertInterconnectRequest { + // The body resource for this request + Interconnect interconnect_resource = 397611167 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Interconnects.List. See the method description for details. +message ListInterconnectsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Interconnects.Patch. See the method description for details. +message PatchInterconnectRequest { + // Name of the interconnect to update. + string interconnect = 224601230 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Interconnect interconnect_resource = 397611167 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for LicenseCodes.Get. See the method description for details. +message GetLicenseCodeRequest { + // Number corresponding to the License code resource to return. + string license_code = 1467179 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for LicenseCodes.TestIamPermissions. See the method description for details. +message TestIamPermissionsLicenseCodeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Licenses.Delete. See the method description for details. +message DeleteLicenseRequest { + // Name of the license resource to delete. + string license = 166757441 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Licenses.Get. See the method description for details. +message GetLicenseRequest { + // Name of the License resource to return. + string license = 166757441 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Licenses.GetIamPolicy. See the method description for details. +message GetIamPolicyLicenseRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Licenses.Insert. See the method description for details. +message InsertLicenseRequest { + // The body resource for this request + License license_resource = 437955148 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Licenses.List. See the method description for details. +message ListLicensesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Licenses.SetIamPolicy. See the method description for details. +message SetIamPolicyLicenseRequest { + // The body resource for this request + GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Licenses.TestIamPermissions. See the method description for details. +message TestIamPermissionsLicenseRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for MachineTypes.AggregatedList. See the method description for details. +message AggregatedListMachineTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for MachineTypes.Get. See the method description for details. +message GetMachineTypeRequest { + // Name of the machine type to return. + string machine_type = 227711026 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for MachineTypes.List. See the method description for details. +message ListMachineTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.AggregatedList. See the method description for details. +message AggregatedListNetworkEndpointGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for NetworkEndpointGroups.AttachNetworkEndpoints. See the method description for details. +message AttachNetworkEndpointsNetworkEndpointGroupRequest { + // The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NetworkEndpointGroupsAttachEndpointsRequest network_endpoint_groups_attach_endpoints_request_resource = 531079 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.Delete. See the method description for details. +message DeleteNetworkEndpointGroupRequest { + // The name of the network endpoint group to delete. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.DetachNetworkEndpoints. See the method description for details. +message DetachNetworkEndpointsNetworkEndpointGroupRequest { + // The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NetworkEndpointGroupsDetachEndpointsRequest network_endpoint_groups_detach_endpoints_request_resource = 515608697 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.Get. See the method description for details. +message GetNetworkEndpointGroupRequest { + // The name of the network endpoint group. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.Insert. See the method description for details. +message InsertNetworkEndpointGroupRequest { + // The body resource for this request + NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.List. See the method description for details. +message ListNetworkEndpointGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.ListNetworkEndpoints. See the method description for details. +message ListNetworkEndpointsNetworkEndpointGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NetworkEndpointGroupsListEndpointsRequest network_endpoint_groups_list_endpoints_request_resource = 59493390 [(google.api.field_behavior) = REQUIRED]; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone where the network endpoint group is located. It should comply with RFC1035. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NetworkEndpointGroups.TestIamPermissions. See the method description for details. +message TestIamPermissionsNetworkEndpointGroupRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Networks.AddPeering. See the method description for details. +message AddPeeringNetworkRequest { + // Name of the network resource to add peering to. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NetworksAddPeeringRequest networks_add_peering_request_resource = 388810421 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Networks.Delete. See the method description for details. +message DeleteNetworkRequest { + // Name of the network to delete. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Networks.Get. See the method description for details. +message GetNetworkRequest { + // Name of the network to return. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Networks.GetEffectiveFirewalls. See the method description for details. +message GetEffectiveFirewallsNetworkRequest { + // Name of the network for this request. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Networks.Insert. See the method description for details. +message InsertNetworkRequest { + // The body resource for this request + Network network_resource = 122105599 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Networks.List. See the method description for details. +message ListNetworksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Networks.ListPeeringRoutes. See the method description for details. +message ListPeeringRoutesNetworksRequest { + // The direction of the exchanged routes. + enum Direction { + // A value indicating that the enum field is not set. + UNDEFINED_DIRECTION = 0; + + INCOMING = 338552870; + + OUTGOING = 307438444; + + } + + // The direction of the exchanged routes. + optional Direction direction = 111150975; + + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Name of the network for this request. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // The response will show routes exchanged over the given peering connection. + optional string peering_name = 249571370; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + optional string region = 138946292; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Networks.Patch. See the method description for details. +message PatchNetworkRequest { + // Name of the network to update. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Network network_resource = 122105599 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Networks.RemovePeering. See the method description for details. +message RemovePeeringNetworkRequest { + // Name of the network resource to remove peering from. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NetworksRemovePeeringRequest networks_remove_peering_request_resource = 421162494 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Networks.SwitchToCustomMode. See the method description for details. +message SwitchToCustomModeNetworkRequest { + // Name of the network to be updated. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Networks.UpdatePeering. See the method description for details. +message UpdatePeeringNetworkRequest { + // Name of the network resource which the updated peering is belonging to. + string network = 232872494 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NetworksUpdatePeeringRequest networks_update_peering_request_resource = 224433497 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for NodeGroups.AddNodes. See the method description for details. +message AddNodesNodeGroupRequest { + // Name of the NodeGroup resource. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NodeGroupsAddNodesRequest node_groups_add_nodes_request_resource = 131263288 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.AggregatedList. See the method description for details. +message AggregatedListNodeGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for NodeGroups.Delete. See the method description for details. +message DeleteNodeGroupRequest { + // Name of the NodeGroup resource to delete. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.DeleteNodes. See the method description for details. +message DeleteNodesNodeGroupRequest { + // Name of the NodeGroup resource whose nodes will be deleted. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NodeGroupsDeleteNodesRequest node_groups_delete_nodes_request_resource = 183298962 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.Get. See the method description for details. +message GetNodeGroupRequest { + // Name of the node group to return. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.GetIamPolicy. See the method description for details. +message GetIamPolicyNodeGroupRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.Insert. See the method description for details. +message InsertNodeGroupRequest { + // Initial count of nodes in the node group. + int32 initial_node_count = 71951469 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NodeGroup node_group_resource = 505321899 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.List. See the method description for details. +message ListNodeGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.ListNodes. See the method description for details. +message ListNodesNodeGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Name of the NodeGroup resource whose nodes you want to list. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.Patch. See the method description for details. +message PatchNodeGroupRequest { + // Name of the NodeGroup resource to update. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NodeGroup node_group_resource = 505321899 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.SetIamPolicy. See the method description for details. +message SetIamPolicyNodeGroupRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.SetNodeTemplate. See the method description for details. +message SetNodeTemplateNodeGroupRequest { + // Name of the NodeGroup resource to update. + string node_group = 469958146 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + NodeGroupsSetNodeTemplateRequest node_groups_set_node_template_request_resource = 117382321 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeGroups.TestIamPermissions. See the method description for details. +message TestIamPermissionsNodeGroupRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeTemplates.AggregatedList. See the method description for details. +message AggregatedListNodeTemplatesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for NodeTemplates.Delete. See the method description for details. +message DeleteNodeTemplateRequest { + // Name of the NodeTemplate resource to delete. + string node_template = 323154455 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for NodeTemplates.Get. See the method description for details. +message GetNodeTemplateRequest { + // Name of the node template to return. + string node_template = 323154455 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeTemplates.GetIamPolicy. See the method description for details. +message GetIamPolicyNodeTemplateRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeTemplates.Insert. See the method description for details. +message InsertNodeTemplateRequest { + // The body resource for this request + NodeTemplate node_template_resource = 127364406 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for NodeTemplates.List. See the method description for details. +message ListNodeTemplatesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for NodeTemplates.SetIamPolicy. See the method description for details. +message SetIamPolicyNodeTemplateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeTemplates.TestIamPermissions. See the method description for details. +message TestIamPermissionsNodeTemplateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeTypes.AggregatedList. See the method description for details. +message AggregatedListNodeTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for NodeTypes.Get. See the method description for details. +message GetNodeTypeRequest { + // Name of the node type to return. + string node_type = 465832791 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for NodeTypes.List. See the method description for details. +message ListNodeTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for PacketMirrorings.AggregatedList. See the method description for details. +message AggregatedListPacketMirroringsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for PacketMirrorings.Delete. See the method description for details. +message DeletePacketMirroringRequest { + // Name of the PacketMirroring resource to delete. + string packet_mirroring = 22305996 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PacketMirrorings.Get. See the method description for details. +message GetPacketMirroringRequest { + // Name of the PacketMirroring resource to return. + string packet_mirroring = 22305996 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for PacketMirrorings.Insert. See the method description for details. +message InsertPacketMirroringRequest { + // The body resource for this request + PacketMirroring packet_mirroring_resource = 493501985 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PacketMirrorings.List. See the method description for details. +message ListPacketMirroringsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for PacketMirrorings.Patch. See the method description for details. +message PatchPacketMirroringRequest { + // Name of the PacketMirroring resource to patch. + string packet_mirroring = 22305996 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + PacketMirroring packet_mirroring_resource = 493501985 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PacketMirrorings.TestIamPermissions. See the method description for details. +message TestIamPermissionsPacketMirroringRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Projects.DisableXpnHost. See the method description for details. +message DisableXpnHostProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.DisableXpnResource. See the method description for details. +message DisableXpnResourceProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ProjectsDisableXpnResourceRequest projects_disable_xpn_resource_request_resource = 209136170 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.EnableXpnHost. See the method description for details. +message EnableXpnHostProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.EnableXpnResource. See the method description for details. +message EnableXpnResourceProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ProjectsEnableXpnResourceRequest projects_enable_xpn_resource_request_resource = 421980207 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.Get. See the method description for details. +message GetProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Projects.GetXpnHost. See the method description for details. +message GetXpnHostProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Projects.GetXpnResources. See the method description for details. +message GetXpnResourcesProjectsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Projects.ListXpnHosts. See the method description for details. +message ListXpnHostsProjectsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ProjectsListXpnHostsRequest projects_list_xpn_hosts_request_resource = 238266391 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Projects.MoveDisk. See the method description for details. +message MoveDiskProjectRequest { + // The body resource for this request + DiskMoveRequest disk_move_request_resource = 313008458 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.MoveInstance. See the method description for details. +message MoveInstanceProjectRequest { + // The body resource for this request + InstanceMoveRequest instance_move_request_resource = 311664194 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.SetCommonInstanceMetadata. See the method description for details. +message SetCommonInstanceMetadataProjectRequest { + // The body resource for this request + Metadata metadata_resource = 291086110 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.SetDefaultNetworkTier. See the method description for details. +message SetDefaultNetworkTierProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ProjectsSetDefaultNetworkTierRequest projects_set_default_network_tier_request_resource = 126410762 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for Projects.SetUsageExportBucket. See the method description for details. +message SetUsageExportBucketProjectRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + UsageExportLocation usage_export_location_resource = 20260459 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for PublicAdvertisedPrefixes.Delete. See the method description for details. +message DeletePublicAdvertisedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicAdvertisedPrefix resource to delete. + string public_advertised_prefix = 101874590 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PublicAdvertisedPrefixes.Get. See the method description for details. +message GetPublicAdvertisedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicAdvertisedPrefix resource to return. + string public_advertised_prefix = 101874590 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for PublicAdvertisedPrefixes.Insert. See the method description for details. +message InsertPublicAdvertisedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PublicAdvertisedPrefixes.List. See the method description for details. +message ListPublicAdvertisedPrefixesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for PublicAdvertisedPrefixes.Patch. See the method description for details. +message PatchPublicAdvertisedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicAdvertisedPrefix resource to patch. + string public_advertised_prefix = 101874590 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + PublicAdvertisedPrefix public_advertised_prefix_resource = 233614223 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PublicDelegatedPrefixes.AggregatedList. See the method description for details. +message AggregatedListPublicDelegatedPrefixesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Name of the project scoping this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for PublicDelegatedPrefixes.Delete. See the method description for details. +message DeletePublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicDelegatedPrefix resource to delete. + string public_delegated_prefix = 204238440 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region of this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PublicDelegatedPrefixes.Get. See the method description for details. +message GetPublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicDelegatedPrefix resource to return. + string public_delegated_prefix = 204238440 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region of this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for PublicDelegatedPrefixes.Insert. See the method description for details. +message InsertPublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region of this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for PublicDelegatedPrefixes.List. See the method description for details. +message ListPublicDelegatedPrefixesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region of this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for PublicDelegatedPrefixes.Patch. See the method description for details. +message PatchPublicDelegatedPrefixeRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the PublicDelegatedPrefix resource to patch. + string public_delegated_prefix = 204238440 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + PublicDelegatedPrefix public_delegated_prefix_resource = 47594501 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionAutoscalers.Delete. See the method description for details. +message DeleteRegionAutoscalerRequest { + // Name of the autoscaler to delete. + string autoscaler = 517258967 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionAutoscalers.Get. See the method description for details. +message GetRegionAutoscalerRequest { + // Name of the autoscaler to return. + string autoscaler = 517258967 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionAutoscalers.Insert. See the method description for details. +message InsertRegionAutoscalerRequest { + // The body resource for this request + Autoscaler autoscaler_resource = 207616118 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionAutoscalers.List. See the method description for details. +message ListRegionAutoscalersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionAutoscalers.Patch. See the method description for details. +message PatchRegionAutoscalerRequest { + // Name of the autoscaler to patch. + optional string autoscaler = 517258967; + + // The body resource for this request + Autoscaler autoscaler_resource = 207616118 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionAutoscalers.Update. See the method description for details. +message UpdateRegionAutoscalerRequest { + // Name of the autoscaler to update. + optional string autoscaler = 517258967; + + // The body resource for this request + Autoscaler autoscaler_resource = 207616118 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionBackendServices.Delete. See the method description for details. +message DeleteRegionBackendServiceRequest { + // Name of the BackendService resource to delete. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionBackendServices.Get. See the method description for details. +message GetRegionBackendServiceRequest { + // Name of the BackendService resource to return. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionBackendServices.GetHealth. See the method description for details. +message GetHealthRegionBackendServiceRequest { + // Name of the BackendService resource for which to get health. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ResourceGroupReference resource_group_reference_resource = 112951123 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionBackendServices.Insert. See the method description for details. +message InsertRegionBackendServiceRequest { + // The body resource for this request + BackendService backend_service_resource = 347586723 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionBackendServices.List. See the method description for details. +message ListRegionBackendServicesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionBackendServices.Patch. See the method description for details. +message PatchRegionBackendServiceRequest { + // Name of the BackendService resource to patch. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + BackendService backend_service_resource = 347586723 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionBackendServices.Update. See the method description for details. +message UpdateRegionBackendServiceRequest { + // Name of the BackendService resource to update. + string backend_service = 306946058 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + BackendService backend_service_resource = 347586723 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionCommitments.AggregatedList. See the method description for details. +message AggregatedListRegionCommitmentsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionCommitments.Get. See the method description for details. +message GetRegionCommitmentRequest { + // Name of the commitment to return. + string commitment = 482134805 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionCommitments.Insert. See the method description for details. +message InsertRegionCommitmentRequest { + // The body resource for this request + Commitment commitment_resource = 244240888 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionCommitments.List. See the method description for details. +message ListRegionCommitmentsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionDiskTypes.Get. See the method description for details. +message GetRegionDiskTypeRequest { + // Name of the disk type to return. + string disk_type = 93009052 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionDiskTypes.List. See the method description for details. +message ListRegionDiskTypesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionDisks.AddResourcePolicies. See the method description for details. +message AddResourcePoliciesRegionDiskRequest { + // The disk name for this request. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionDisksAddResourcePoliciesRequest region_disks_add_resource_policies_request_resource = 284196750 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionDisks.CreateSnapshot. See the method description for details. +message CreateSnapshotRegionDiskRequest { + // Name of the regional persistent disk to snapshot. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Snapshot snapshot_resource = 481319977 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionDisks.Delete. See the method description for details. +message DeleteRegionDiskRequest { + // Name of the regional persistent disk to delete. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionDisks.Get. See the method description for details. +message GetRegionDiskRequest { + // Name of the regional persistent disk to return. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionDisks.GetIamPolicy. See the method description for details. +message GetIamPolicyRegionDiskRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionDisks.Insert. See the method description for details. +message InsertRegionDiskRequest { + // The body resource for this request + Disk disk_resource = 25880688 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Source image to restore onto a disk. This field is optional. + optional string source_image = 50443319; + +} + +// A request message for RegionDisks.List. See the method description for details. +message ListRegionDisksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionDisks.RemoveResourcePolicies. See the method description for details. +message RemoveResourcePoliciesRegionDiskRequest { + // The disk name for this request. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionDisksRemoveResourcePoliciesRequest region_disks_remove_resource_policies_request_resource = 8741283 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionDisks.Resize. See the method description for details. +message ResizeRegionDiskRequest { + // Name of the regional persistent disk. + string disk = 3083677 [(google.api.field_behavior) = REQUIRED]; + + // The project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionDisksResizeRequest region_disks_resize_request_resource = 446633237 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionDisks.SetIamPolicy. See the method description for details. +message SetIamPolicyRegionDiskRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionDisks.SetLabels. See the method description for details. +message SetLabelsRegionDiskRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionDisks.TestIamPermissions. See the method description for details. +message TestIamPermissionsRegionDiskRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionHealthCheckServices.Delete. See the method description for details. +message DeleteRegionHealthCheckServiceRequest { + // Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + string health_check_service = 408374747 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionHealthCheckServices.Get. See the method description for details. +message GetRegionHealthCheckServiceRequest { + // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + string health_check_service = 408374747 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionHealthCheckServices.Insert. See the method description for details. +message InsertRegionHealthCheckServiceRequest { + // The body resource for this request + HealthCheckService health_check_service_resource = 477367794 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionHealthCheckServices.List. See the method description for details. +message ListRegionHealthCheckServicesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionHealthCheckServices.Patch. See the method description for details. +message PatchRegionHealthCheckServiceRequest { + // Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + string health_check_service = 408374747 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + HealthCheckService health_check_service_resource = 477367794 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionHealthChecks.Delete. See the method description for details. +message DeleteRegionHealthCheckRequest { + // Name of the HealthCheck resource to delete. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionHealthChecks.Get. See the method description for details. +message GetRegionHealthCheckRequest { + // Name of the HealthCheck resource to return. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionHealthChecks.Insert. See the method description for details. +message InsertRegionHealthCheckRequest { + // The body resource for this request + HealthCheck health_check_resource = 201925032 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionHealthChecks.List. See the method description for details. +message ListRegionHealthChecksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionHealthChecks.Patch. See the method description for details. +message PatchRegionHealthCheckRequest { + // Name of the HealthCheck resource to patch. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + HealthCheck health_check_resource = 201925032 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionHealthChecks.Update. See the method description for details. +message UpdateRegionHealthCheckRequest { + // Name of the HealthCheck resource to update. + string health_check = 308876645 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + HealthCheck health_check_resource = 201925032 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.AbandonInstances. See the method description for details. +message AbandonInstancesRegionInstanceGroupManagerRequest { + // Name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagersAbandonInstancesRequest region_instance_group_managers_abandon_instances_request_resource = 488499491 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.ApplyUpdatesToInstances. See the method description for details. +message ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest { + // The name of the managed instance group, should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request, should conform to RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagersApplyUpdatesRequest region_instance_group_managers_apply_updates_request_resource = 76248318 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionInstanceGroupManagers.CreateInstances. See the method description for details. +message CreateInstancesRegionInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region where the managed instance group is located. It should conform to RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagersCreateInstancesRequest region_instance_group_managers_create_instances_request_resource = 359014280 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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. + // + // The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.Delete. See the method description for details. +message DeleteRegionInstanceGroupManagerRequest { + // Name of the managed instance group to delete. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.DeleteInstances. See the method description for details. +message DeleteInstancesRegionInstanceGroupManagerRequest { + // Name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagersDeleteInstancesRequest region_instance_group_managers_delete_instances_request_resource = 500876665 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.DeletePerInstanceConfigs. See the method description for details. +message DeletePerInstanceConfigsRegionInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request, should conform to RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagerDeleteInstanceConfigReq region_instance_group_manager_delete_instance_config_req_resource = 740741 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionInstanceGroupManagers.Get. See the method description for details. +message GetRegionInstanceGroupManagerRequest { + // Name of the managed instance group to return. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionInstanceGroupManagers.Insert. See the method description for details. +message InsertRegionInstanceGroupManagerRequest { + // The body resource for this request + InstanceGroupManager instance_group_manager_resource = 261063946 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.List. See the method description for details. +message ListRegionInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionInstanceGroupManagers.ListErrors. See the method description for details. +message ListErrorsRegionInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9][0-9]{0,19}. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. This should conform to RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionInstanceGroupManagers.ListManagedInstances. See the method description for details. +message ListManagedInstancesRegionInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionInstanceGroupManagers.ListPerInstanceConfigs. See the method description for details. +message ListPerInstanceConfigsRegionInstanceGroupManagersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request, should conform to RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionInstanceGroupManagers.Patch. See the method description for details. +message PatchRegionInstanceGroupManagerRequest { + // The name of the instance group manager. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + InstanceGroupManager instance_group_manager_resource = 261063946 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.PatchPerInstanceConfigs. See the method description for details. +message PatchPerInstanceConfigsRegionInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request, should conform to RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagerPatchInstanceConfigReq region_instance_group_manager_patch_instance_config_req_resource = 197682890 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.RecreateInstances. See the method description for details. +message RecreateInstancesRegionInstanceGroupManagerRequest { + // Name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagersRecreateRequest region_instance_group_managers_recreate_request_resource = 170999316 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.Resize. See the method description for details. +message ResizeRegionInstanceGroupManagerRequest { + // Name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Number of instances that should exist in this instance group manager. + int32 size = 3530753 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionInstanceGroupManagers.SetInstanceTemplate. See the method description for details. +message SetInstanceTemplateRegionInstanceGroupManagerRequest { + // The name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagersSetTemplateRequest region_instance_group_managers_set_template_request_resource = 187310412 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.SetTargetPools. See the method description for details. +message SetTargetPoolsRegionInstanceGroupManagerRequest { + // Name of the managed instance group. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagersSetTargetPoolsRequest region_instance_group_managers_set_target_pools_request_resource = 78734717 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroupManagers.UpdatePerInstanceConfigs. See the method description for details. +message UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest { + // The name of the managed instance group. It should conform to RFC1035. + string instance_group_manager = 249363395 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request, should conform to RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupManagerUpdateInstanceConfigReq region_instance_group_manager_update_instance_config_req_resource = 89036583 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstanceGroups.Get. See the method description for details. +message GetRegionInstanceGroupRequest { + // Name of the instance group resource to return. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionInstanceGroups.List. See the method description for details. +message ListRegionInstanceGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionInstanceGroups.ListInstances. See the method description for details. +message ListInstancesRegionInstanceGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Name of the regional instance group for which we want to list the instances. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupsListInstancesRequest region_instance_groups_list_instances_request_resource = 48239828 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionInstanceGroups.SetNamedPorts. See the method description for details. +message SetNamedPortsRegionInstanceGroupRequest { + // The name of the regional instance group where the named ports are updated. + string instance_group = 81095253 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionInstanceGroupsSetNamedPortsRequest region_instance_groups_set_named_ports_request_resource = 1574938 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionInstances.BulkInsert. See the method description for details. +message BulkInsertRegionInstanceRequest { + // The body resource for this request + BulkInsertInstanceResource bulk_insert_instance_resource_resource = 41427278 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionNetworkEndpointGroups.Delete. See the method description for details. +message DeleteRegionNetworkEndpointGroupRequest { + // The name of the network endpoint group to delete. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region where the network endpoint group is located. It should comply with RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionNetworkEndpointGroups.Get. See the method description for details. +message GetRegionNetworkEndpointGroupRequest { + // The name of the network endpoint group. It should comply with RFC1035. + string network_endpoint_group = 433907078 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region where the network endpoint group is located. It should comply with RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionNetworkEndpointGroups.Insert. See the method description for details. +message InsertRegionNetworkEndpointGroupRequest { + // The body resource for this request + NetworkEndpointGroup network_endpoint_group_resource = 525788839 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionNetworkEndpointGroups.List. See the method description for details. +message ListRegionNetworkEndpointGroupsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region where the network endpoint group is located. It should comply with RFC1035. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionNotificationEndpoints.Delete. See the method description for details. +message DeleteRegionNotificationEndpointRequest { + // Name of the NotificationEndpoint resource to delete. + string notification_endpoint = 376807017 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionNotificationEndpoints.Get. See the method description for details. +message GetRegionNotificationEndpointRequest { + // Name of the NotificationEndpoint resource to return. + string notification_endpoint = 376807017 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionNotificationEndpoints.Insert. See the method description for details. +message InsertRegionNotificationEndpointRequest { + // The body resource for this request + NotificationEndpoint notification_endpoint_resource = 338459940 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + +} + +// A request message for RegionNotificationEndpoints.List. See the method description for details. +message ListRegionNotificationEndpointsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionOperations.Delete. See the method description for details. +message DeleteRegionOperationRequest { + // Name of the Operations resource to delete. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A response message for RegionOperations.Delete. See the method description for details. +message DeleteRegionOperationResponse { +} + +// A request message for RegionOperations.Get. See the method description for details. +message GetRegionOperationRequest { + // Name of the Operations resource to return. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionOperations.List. See the method description for details. +message ListRegionOperationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionOperations.Wait. See the method description for details. +message WaitRegionOperationRequest { + // Name of the Operations resource to return. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionSslCertificates.Delete. See the method description for details. +message DeleteRegionSslCertificateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the SslCertificate resource to delete. + string ssl_certificate = 46443492 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionSslCertificates.Get. See the method description for details. +message GetRegionSslCertificateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the SslCertificate resource to return. + string ssl_certificate = 46443492 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionSslCertificates.Insert. See the method description for details. +message InsertRegionSslCertificateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SslCertificate ssl_certificate_resource = 180709897 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionSslCertificates.List. See the method description for details. +message ListRegionSslCertificatesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionTargetHttpProxies.Delete. See the method description for details. +message DeleteRegionTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpProxy resource to delete. + string target_http_proxy = 206872421 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpProxies.Get. See the method description for details. +message GetRegionTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetHttpProxy resource to return. + string target_http_proxy = 206872421 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpProxies.Insert. See the method description for details. +message InsertRegionTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetHttpProxy target_http_proxy_resource = 24696744 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpProxies.List. See the method description for details. +message ListRegionTargetHttpProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionTargetHttpProxies.SetUrlMap. See the method description for details. +message SetUrlMapRegionTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpProxy to set a URL map for. + string target_http_proxy = 206872421 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMapReference url_map_reference_resource = 398701333 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpsProxies.Delete. See the method description for details. +message DeleteRegionTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpsProxy resource to delete. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpsProxies.Get. See the method description for details. +message GetRegionTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetHttpsProxy resource to return. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpsProxies.Insert. See the method description for details. +message InsertRegionTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetHttpsProxy target_https_proxy_resource = 433657473 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpsProxies.List. See the method description for details. +message ListRegionTargetHttpsProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionTargetHttpsProxies.SetSslCertificates. See the method description for details. +message SetSslCertificatesRegionTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionTargetHttpsProxiesSetSslCertificatesRequest region_target_https_proxies_set_ssl_certificates_request_resource = 390693383 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionTargetHttpsProxies.SetUrlMap. See the method description for details. +message SetUrlMapRegionTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpsProxy to set a URL map for. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMapReference url_map_reference_resource = 398701333 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionUrlMaps.Delete. See the method description for details. +message DeleteRegionUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + optional string request_id = 37109963; + + // Name of the UrlMap resource to delete. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionUrlMaps.Get. See the method description for details. +message GetRegionUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the UrlMap resource to return. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionUrlMaps.Insert. See the method description for details. +message InsertRegionUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + optional string request_id = 37109963; + + // The body resource for this request + UrlMap url_map_resource = 168675425 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionUrlMaps.List. See the method description for details. +message ListRegionUrlMapsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for RegionUrlMaps.Patch. See the method description for details. +message PatchRegionUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + optional string request_id = 37109963; + + // Name of the UrlMap resource to patch. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMap url_map_resource = 168675425 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionUrlMaps.Update. See the method description for details. +message UpdateRegionUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + optional string request_id = 37109963; + + // Name of the UrlMap resource to update. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMap url_map_resource = 168675425 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for RegionUrlMaps.Validate. See the method description for details. +message ValidateRegionUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionUrlMapsValidateRequest region_url_maps_validate_request_resource = 56632858 [(google.api.field_behavior) = REQUIRED]; + + // Name of the UrlMap resource to be validated as. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Regions.Get. See the method description for details. +message GetRegionRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region resource to return. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Regions.List. See the method description for details. +message ListRegionsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Reservations.AggregatedList. See the method description for details. +message AggregatedListReservationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Reservations.Delete. See the method description for details. +message DeleteReservationRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the reservation to delete. + string reservation = 47530956 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Reservations.Get. See the method description for details. +message GetReservationRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the reservation to retrieve. + string reservation = 47530956 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Reservations.GetIamPolicy. See the method description for details. +message GetIamPolicyReservationRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Reservations.Insert. See the method description for details. +message InsertReservationRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Reservation reservation_resource = 285030177 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Reservations.List. See the method description for details. +message ListReservationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Reservations.Resize. See the method description for details. +message ResizeReservationRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the reservation to update. + string reservation = 47530956 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ReservationsResizeRequest reservations_resize_request_resource = 389262801 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Reservations.SetIamPolicy. See the method description for details. +message SetIamPolicyReservationRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + ZoneSetPolicyRequest zone_set_policy_request_resource = 382082107 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Reservations.TestIamPermissions. See the method description for details. +message TestIamPermissionsReservationRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + + // The name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ResourcePolicies.AggregatedList. See the method description for details. +message AggregatedListResourcePoliciesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for ResourcePolicies.Delete. See the method description for details. +message DeleteResourcePolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the resource policy to delete. + string resource_policy = 159240835 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ResourcePolicies.Get. See the method description for details. +message GetResourcePolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the resource policy to retrieve. + string resource_policy = 159240835 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ResourcePolicies.GetIamPolicy. See the method description for details. +message GetIamPolicyResourcePolicyRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ResourcePolicies.Insert. See the method description for details. +message InsertResourcePolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + ResourcePolicy resource_policy_resource = 76826186 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ResourcePolicies.List. See the method description for details. +message ListResourcePoliciesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for ResourcePolicies.SetIamPolicy. See the method description for details. +message SetIamPolicyResourcePolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ResourcePolicies.TestIamPermissions. See the method description for details. +message TestIamPermissionsResourcePolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.AggregatedList. See the method description for details. +message AggregatedListRoutersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Routers.Delete. See the method description for details. +message DeleteRouterRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Router resource to delete. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.Get. See the method description for details. +message GetRouterRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Router resource to return. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.GetNatMappingInfo. See the method description for details. +message GetNatMappingInfoRoutersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // Name of the Router resource to query for Nat Mapping information of VM endpoints. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.GetRouterStatus. See the method description for details. +message GetRouterStatusRouterRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Router resource to query. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.Insert. See the method description for details. +message InsertRouterRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Router router_resource = 155222084 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.List. See the method description for details. +message ListRoutersRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Routers.Patch. See the method description for details. +message PatchRouterRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Router resource to patch. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Router router_resource = 155222084 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.Preview. See the method description for details. +message PreviewRouterRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Router resource to query. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Router router_resource = 155222084 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routers.Update. See the method description for details. +message UpdateRouterRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Router resource to update. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Router router_resource = 155222084 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routes.Delete. See the method description for details. +message DeleteRouteRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Route resource to delete. + string route = 108704329 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routes.Get. See the method description for details. +message GetRouteRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Route resource to return. + string route = 108704329 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routes.Insert. See the method description for details. +message InsertRouteRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Route route_resource = 225428804 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Routes.List. See the method description for details. +message ListRoutesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for SecurityPolicies.AddRule. See the method description for details. +message AddRuleSecurityPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the security policy to update. + string security_policy = 171082513 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + SecurityPolicyRule security_policy_rule_resource = 402693443 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SecurityPolicies.Delete. See the method description for details. +message DeleteSecurityPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the security policy to delete. + string security_policy = 171082513 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SecurityPolicies.Get. See the method description for details. +message GetSecurityPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the security policy to get. + string security_policy = 171082513 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SecurityPolicies.GetRule. See the method description for details. +message GetRuleSecurityPolicyRequest { + // The priority of the rule to get from the security policy. + optional int32 priority = 445151652; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the security policy to which the queried rule belongs. + string security_policy = 171082513 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SecurityPolicies.Insert. See the method description for details. +message InsertSecurityPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SecurityPolicy security_policy_resource = 216159612 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SecurityPolicies.List. See the method description for details. +message ListSecurityPoliciesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for SecurityPolicies.ListPreconfiguredExpressionSets. See the method description for details. +message ListPreconfiguredExpressionSetsSecurityPoliciesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for SecurityPolicies.Patch. See the method description for details. +message PatchSecurityPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the security policy to update. + string security_policy = 171082513 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + SecurityPolicy security_policy_resource = 216159612 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SecurityPolicies.PatchRule. See the method description for details. +message PatchRuleSecurityPolicyRequest { + // The priority of the rule to patch. + optional int32 priority = 445151652; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the security policy to update. + string security_policy = 171082513 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + SecurityPolicyRule security_policy_rule_resource = 402693443 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SecurityPolicies.RemoveRule. See the method description for details. +message RemoveRuleSecurityPolicyRequest { + // The priority of the rule to remove from the security policy. + optional int32 priority = 445151652; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the security policy to update. + string security_policy = 171082513 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Snapshots.Delete. See the method description for details. +message DeleteSnapshotRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Snapshot resource to delete. + string snapshot = 284874180 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Snapshots.Get. See the method description for details. +message GetSnapshotRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Snapshot resource to return. + string snapshot = 284874180 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Snapshots.GetIamPolicy. See the method description for details. +message GetIamPolicySnapshotRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Snapshots.List. See the method description for details. +message ListSnapshotsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Snapshots.SetIamPolicy. See the method description for details. +message SetIamPolicySnapshotRequest { + // The body resource for this request + GlobalSetPolicyRequest global_set_policy_request_resource = 337048498 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Snapshots.SetLabels. See the method description for details. +message SetLabelsSnapshotRequest { + // The body resource for this request + GlobalSetLabelsRequest global_set_labels_request_resource = 319917189 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Snapshots.TestIamPermissions. See the method description for details. +message TestIamPermissionsSnapshotRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SslCertificates.AggregatedList. See the method description for details. +message AggregatedListSslCertificatesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Name of the project scoping this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for SslCertificates.Delete. See the method description for details. +message DeleteSslCertificateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the SslCertificate resource to delete. + string ssl_certificate = 46443492 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SslCertificates.Get. See the method description for details. +message GetSslCertificateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the SslCertificate resource to return. + string ssl_certificate = 46443492 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SslCertificates.Insert. See the method description for details. +message InsertSslCertificateRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SslCertificate ssl_certificate_resource = 180709897 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SslCertificates.List. See the method description for details. +message ListSslCertificatesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for SslPolicies.Delete. See the method description for details. +message DeleteSslPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + string ssl_policy = 295190213 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SslPolicies.Get. See the method description for details. +message GetSslPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + string ssl_policy = 295190213 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SslPolicies.Insert. See the method description for details. +message InsertSslPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SslPolicy ssl_policy_resource = 274891848 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for SslPolicies.List. See the method description for details. +message ListSslPoliciesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for SslPolicies.ListAvailableFeatures. See the method description for details. +message ListAvailableFeaturesSslPoliciesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for SslPolicies.Patch. See the method description for details. +message PatchSslPolicyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + string ssl_policy = 295190213 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + SslPolicy ssl_policy_resource = 274891848 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.AggregatedList. See the method description for details. +message AggregatedListSubnetworksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Subnetworks.Delete. See the method description for details. +message DeleteSubnetworkRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Subnetwork resource to delete. + string subnetwork = 307827694 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.ExpandIpCidrRange. See the method description for details. +message ExpandIpCidrRangeSubnetworkRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Subnetwork resource to update. + string subnetwork = 307827694 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + SubnetworksExpandIpCidrRangeRequest subnetworks_expand_ip_cidr_range_request_resource = 477014110 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.Get. See the method description for details. +message GetSubnetworkRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Subnetwork resource to return. + string subnetwork = 307827694 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.GetIamPolicy. See the method description for details. +message GetIamPolicySubnetworkRequest { + // Requested IAM Policy version. + optional int32 options_requested_policy_version = 499220029; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.Insert. See the method description for details. +message InsertSubnetworkRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + Subnetwork subnetwork_resource = 42233151 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.List. See the method description for details. +message ListSubnetworksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Subnetworks.ListUsable. See the method description for details. +message ListUsableSubnetworksRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for Subnetworks.Patch. See the method description for details. +message PatchSubnetworkRequest { + // The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + optional int32 drain_timeout_seconds = 357707098; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Subnetwork resource to patch. + string subnetwork = 307827694 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + Subnetwork subnetwork_resource = 42233151 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.SetIamPolicy. See the method description for details. +message SetIamPolicySubnetworkRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionSetPolicyRequest region_set_policy_request_resource = 276489091 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.SetPrivateIpGoogleAccess. See the method description for details. +message SetPrivateIpGoogleAccessSubnetworkRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the Subnetwork resource. + string subnetwork = 307827694 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + SubnetworksSetPrivateIpGoogleAccessRequest subnetworks_set_private_ip_google_access_request_resource = 268920696 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Subnetworks.TestIamPermissions. See the method description for details. +message TestIamPermissionsSubnetworkRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetGrpcProxies.Delete. See the method description for details. +message DeleteTargetGrpcProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetGrpcProxy resource to delete. + string target_grpc_proxy = 5020283 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetGrpcProxies.Get. See the method description for details. +message GetTargetGrpcProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetGrpcProxy resource to return. + string target_grpc_proxy = 5020283 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetGrpcProxies.Insert. See the method description for details. +message InsertTargetGrpcProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetGrpcProxies.List. See the method description for details. +message ListTargetGrpcProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetGrpcProxies.Patch. See the method description for details. +message PatchTargetGrpcProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetGrpcProxy resource to patch. + string target_grpc_proxy = 5020283 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetGrpcProxy target_grpc_proxy_resource = 328922450 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpProxies.AggregatedList. See the method description for details. +message AggregatedListTargetHttpProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Name of the project scoping this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetHttpProxies.Delete. See the method description for details. +message DeleteTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpProxy resource to delete. + string target_http_proxy = 206872421 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpProxies.Get. See the method description for details. +message GetTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetHttpProxy resource to return. + string target_http_proxy = 206872421 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpProxies.Insert. See the method description for details. +message InsertTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetHttpProxy target_http_proxy_resource = 24696744 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpProxies.List. See the method description for details. +message ListTargetHttpProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetHttpProxies.Patch. See the method description for details. +message PatchTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpProxy resource to patch. + string target_http_proxy = 206872421 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetHttpProxy target_http_proxy_resource = 24696744 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpProxies.SetUrlMap. See the method description for details. +message SetUrlMapTargetHttpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpProxy to set a URL map for. + string target_http_proxy = 206872421 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMapReference url_map_reference_resource = 398701333 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.AggregatedList. See the method description for details. +message AggregatedListTargetHttpsProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Name of the project scoping this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetHttpsProxies.Delete. See the method description for details. +message DeleteTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpsProxy resource to delete. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.Get. See the method description for details. +message GetTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetHttpsProxy resource to return. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.Insert. See the method description for details. +message InsertTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetHttpsProxy target_https_proxy_resource = 433657473 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.List. See the method description for details. +message ListTargetHttpsProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetHttpsProxies.Patch. See the method description for details. +message PatchTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpsProxy resource to patch. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetHttpsProxy target_https_proxy_resource = 433657473 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.SetQuicOverride. See the method description for details. +message SetQuicOverrideTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetHttpsProxiesSetQuicOverrideRequest target_https_proxies_set_quic_override_request_resource = 72940258 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.SetSslCertificates. See the method description for details. +message SetSslCertificatesTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetHttpsProxiesSetSslCertificatesRequest target_https_proxies_set_ssl_certificates_request_resource = 223122908 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.SetSslPolicy. See the method description for details. +message SetSslPolicyTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SslPolicyReference ssl_policy_reference_resource = 235403836 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetHttpsProxies.SetUrlMap. See the method description for details. +message SetUrlMapTargetHttpsProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetHttpsProxy resource whose URL map is to be set. + string target_https_proxy = 52336748 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMapReference url_map_reference_resource = 398701333 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetInstances.AggregatedList. See the method description for details. +message AggregatedListTargetInstancesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetInstances.Delete. See the method description for details. +message DeleteTargetInstanceRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetInstance resource to delete. + string target_instance = 289769347 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone scoping this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetInstances.Get. See the method description for details. +message GetTargetInstanceRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetInstance resource to return. + string target_instance = 289769347 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone scoping this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetInstances.Insert. See the method description for details. +message InsertTargetInstanceRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetInstance target_instance_resource = 430453066 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone scoping this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetInstances.List. See the method description for details. +message ListTargetInstancesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // Name of the zone scoping this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.AddHealthCheck. See the method description for details. +message AddHealthCheckTargetPoolRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the target pool to add a health check to. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetPoolsAddHealthCheckRequest target_pools_add_health_check_request_resource = 269573412 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.AddInstance. See the method description for details. +message AddInstanceTargetPoolRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetPool resource to add instances to. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetPoolsAddInstanceRequest target_pools_add_instance_request_resource = 428796404 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.AggregatedList. See the method description for details. +message AggregatedListTargetPoolsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetPools.Delete. See the method description for details. +message DeleteTargetPoolRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetPool resource to delete. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.Get. See the method description for details. +message GetTargetPoolRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetPool resource to return. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.GetHealth. See the method description for details. +message GetHealthTargetPoolRequest { + // The body resource for this request + InstanceReference instance_reference_resource = 292926060 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetPool resource to which the queried instance belongs. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.Insert. See the method description for details. +message InsertTargetPoolRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetPool target_pool_resource = 101281443 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.List. See the method description for details. +message ListTargetPoolsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetPools.RemoveHealthCheck. See the method description for details. +message RemoveHealthCheckTargetPoolRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the target pool to remove health checks from. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetPoolsRemoveHealthCheckRequest target_pools_remove_health_check_request_resource = 304985011 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.RemoveInstance. See the method description for details. +message RemoveInstanceTargetPoolRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetPool resource to remove instances from. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetPoolsRemoveInstanceRequest target_pools_remove_instance_request_resource = 29548547 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetPools.SetBackup. See the method description for details. +message SetBackupTargetPoolRequest { + // New failoverRatio value for the target pool. + optional float failover_ratio = 212667006; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region scoping this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetPool resource to set a backup pool for. + string target_pool = 62796298 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TargetReference target_reference_resource = 523721712 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetSslProxies.Delete. See the method description for details. +message DeleteTargetSslProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetSslProxy resource to delete. + string target_ssl_proxy = 338795853 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetSslProxies.Get. See the method description for details. +message GetTargetSslProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetSslProxy resource to return. + string target_ssl_proxy = 338795853 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetSslProxies.Insert. See the method description for details. +message InsertTargetSslProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetSslProxy target_ssl_proxy_resource = 142016192 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetSslProxies.List. See the method description for details. +message ListTargetSslProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetSslProxies.SetBackendService. See the method description for details. +message SetBackendServiceTargetSslProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetSslProxiesSetBackendServiceRequest target_ssl_proxies_set_backend_service_request_resource = 139080868 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetSslProxy resource whose BackendService resource is to be set. + string target_ssl_proxy = 338795853 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetSslProxies.SetProxyHeader. See the method description for details. +message SetProxyHeaderTargetSslProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetSslProxiesSetProxyHeaderRequest target_ssl_proxies_set_proxy_header_request_resource = 205284526 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetSslProxy resource whose ProxyHeader is to be set. + string target_ssl_proxy = 338795853 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetSslProxies.SetSslCertificates. See the method description for details. +message SetSslCertificatesTargetSslProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetSslProxiesSetSslCertificatesRequest target_ssl_proxies_set_ssl_certificates_request_resource = 147940797 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + string target_ssl_proxy = 338795853 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetSslProxies.SetSslPolicy. See the method description for details. +message SetSslPolicyTargetSslProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + SslPolicyReference ssl_policy_reference_resource = 235403836 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + string target_ssl_proxy = 338795853 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetTcpProxies.Delete. See the method description for details. +message DeleteTargetTcpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the TargetTcpProxy resource to delete. + string target_tcp_proxy = 503065442 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetTcpProxies.Get. See the method description for details. +message GetTargetTcpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetTcpProxy resource to return. + string target_tcp_proxy = 503065442 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetTcpProxies.Insert. See the method description for details. +message InsertTargetTcpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetTcpProxy target_tcp_proxy_resource = 145913931 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetTcpProxies.List. See the method description for details. +message ListTargetTcpProxiesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetTcpProxies.SetBackendService. See the method description for details. +message SetBackendServiceTargetTcpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetTcpProxiesSetBackendServiceRequest target_tcp_proxies_set_backend_service_request_resource = 273721583 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetTcpProxy resource whose BackendService resource is to be set. + string target_tcp_proxy = 503065442 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetTcpProxies.SetProxyHeader. See the method description for details. +message SetProxyHeaderTargetTcpProxyRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetTcpProxiesSetProxyHeaderRequest target_tcp_proxies_set_proxy_header_request_resource = 219958339 [(google.api.field_behavior) = REQUIRED]; + + // Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + string target_tcp_proxy = 503065442 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetVpnGateways.AggregatedList. See the method description for details. +message AggregatedListTargetVpnGatewaysRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for TargetVpnGateways.Delete. See the method description for details. +message DeleteTargetVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the target VPN gateway to delete. + string target_vpn_gateway = 532512843 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetVpnGateways.Get. See the method description for details. +message GetTargetVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the target VPN gateway to return. + string target_vpn_gateway = 532512843 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetVpnGateways.Insert. See the method description for details. +message InsertTargetVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + TargetVpnGateway target_vpn_gateway_resource = 498050 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for TargetVpnGateways.List. See the method description for details. +message ListTargetVpnGatewaysRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for UrlMaps.AggregatedList. See the method description for details. +message AggregatedListUrlMapsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Name of the project scoping this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for UrlMaps.Delete. See the method description for details. +message DeleteUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the UrlMap resource to delete. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for UrlMaps.Get. See the method description for details. +message GetUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the UrlMap resource to return. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for UrlMaps.Insert. See the method description for details. +message InsertUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + UrlMap url_map_resource = 168675425 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for UrlMaps.InvalidateCache. See the method description for details. +message InvalidateCacheUrlMapRequest { + // The body resource for this request + CacheInvalidationRule cache_invalidation_rule_resource = 312795565 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the UrlMap scoping this request. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for UrlMaps.List. See the method description for details. +message ListUrlMapsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for UrlMaps.Patch. See the method description for details. +message PatchUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the UrlMap resource to patch. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMap url_map_resource = 168675425 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for UrlMaps.Update. See the method description for details. +message UpdateUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the UrlMap resource to update. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMap url_map_resource = 168675425 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for UrlMaps.Validate. See the method description for details. +message ValidateUrlMapRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the UrlMap resource to be validated as. + string url_map = 367020684 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + UrlMapsValidateRequest url_maps_validate_request_resource = 395913455 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnGateways.AggregatedList. See the method description for details. +message AggregatedListVpnGatewaysRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for VpnGateways.Delete. See the method description for details. +message DeleteVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the VPN gateway to delete. + string vpn_gateway = 406684153 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnGateways.Get. See the method description for details. +message GetVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the VPN gateway to return. + string vpn_gateway = 406684153 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnGateways.GetStatus. See the method description for details. +message GetStatusVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the VPN gateway to return. + string vpn_gateway = 406684153 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnGateways.Insert. See the method description for details. +message InsertVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + VpnGateway vpn_gateway_resource = 182688660 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnGateways.List. See the method description for details. +message ListVpnGatewaysRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for VpnGateways.SetLabels. See the method description for details. +message SetLabelsVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + RegionSetLabelsRequest region_set_labels_request_resource = 259357782 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnGateways.TestIamPermissions. See the method description for details. +message TestIamPermissionsVpnGatewayRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // The name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name or id of the resource for this request. + string resource = 195806222 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + TestPermissionsRequest test_permissions_request_resource = 439214758 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnTunnels.AggregatedList. See the method description for details. +message AggregatedListVpnTunnelsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for VpnTunnels.Delete. See the method description for details. +message DeleteVpnTunnelRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // Name of the VpnTunnel resource to delete. + string vpn_tunnel = 143821331 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnTunnels.Get. See the method description for details. +message GetVpnTunnelRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the VpnTunnel resource to return. + string vpn_tunnel = 143821331 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnTunnels.Insert. See the method description for details. +message InsertVpnTunnelRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // An optional 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. + // + // 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). + optional string request_id = 37109963; + + // The body resource for this request + VpnTunnel vpn_tunnel_resource = 86839482 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for VpnTunnels.List. See the method description for details. +message ListVpnTunnelsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// A request message for ZoneOperations.Delete. See the method description for details. +message DeleteZoneOperationRequest { + // Name of the Operations resource to delete. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A response message for ZoneOperations.Delete. See the method description for details. +message DeleteZoneOperationResponse { +} + +// A request message for ZoneOperations.Get. See the method description for details. +message GetZoneOperationRequest { + // Name of the Operations resource to return. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ZoneOperations.List. See the method description for details. +message ListZoneOperationsRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + + // Name of the zone for request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for ZoneOperations.Wait. See the method description for details. +message WaitZoneOperationRequest { + // Name of the Operations resource to return. + string operation = 52090215 [(google.api.field_behavior) = REQUIRED]; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone for this request. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Zones.Get. See the method description for details. +message GetZoneRequest { + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the zone resource to return. + string zone = 3744684 [(google.api.field_behavior) = REQUIRED]; + +} + +// A request message for Zones.List. See the method description for details. +message ListZonesRequest { + // A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + // + // You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + // + // To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + // + // You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + // + // Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + optional bool return_partial_success = 517198390; + +} + +// +// Services +// +// The AcceleratorTypes API. +service AcceleratorTypes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of accelerator types. + rpc AggregatedList(AggregatedListAcceleratorTypesRequest) returns (AcceleratorTypeAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/acceleratorTypes" + }; + option (google.api.method_signature) = "project"; + } + + // Returns the specified accelerator type. + rpc Get(GetAcceleratorTypeRequest) returns (AcceleratorType) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes/{accelerator_type}" + }; + option (google.api.method_signature) = "project,zone,accelerator_type"; + } + + // Retrieves a list of accelerator types that are available to the specified project. + rpc List(ListAcceleratorTypesRequest) returns (AcceleratorTypeList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes" + }; + option (google.api.method_signature) = "project,zone"; + } + +} + +// The Addresses API. +service Addresses { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of addresses. + rpc AggregatedList(AggregatedListAddressesRequest) returns (AddressAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/addresses" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified address resource. + rpc Delete(DeleteAddressRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/addresses/{address}" + }; + option (google.api.method_signature) = "project,region,address"; + } + + // Returns the specified address resource. + rpc Get(GetAddressRequest) returns (Address) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/addresses/{address}" + }; + option (google.api.method_signature) = "project,region,address"; + } + + // Creates an address resource in the specified project by using the data included in the request. + rpc Insert(InsertAddressRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/addresses" + body: "address_resource" + }; + option (google.api.method_signature) = "project,region,address_resource"; + } + + // Retrieves a list of addresses contained within the specified region. + rpc List(ListAddressesRequest) returns (AddressList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/addresses" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The Autoscalers API. +service Autoscalers { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of autoscalers. + rpc AggregatedList(AggregatedListAutoscalersRequest) returns (AutoscalerAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/autoscalers" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified autoscaler. + rpc Delete(DeleteAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}" + }; + option (google.api.method_signature) = "project,zone,autoscaler"; + } + + // Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. + rpc Get(GetAutoscalerRequest) returns (Autoscaler) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}" + }; + option (google.api.method_signature) = "project,zone,autoscaler"; + } + + // Creates an autoscaler in the specified project using the data included in the request. + rpc Insert(InsertAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/autoscalers" + body: "autoscaler_resource" + }; + option (google.api.method_signature) = "project,zone,autoscaler_resource"; + } + + // Retrieves a list of autoscalers contained within the specified zone. + rpc List(ListAutoscalersRequest) returns (AutoscalerList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/autoscalers" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/zones/{zone}/autoscalers" + body: "autoscaler_resource" + }; + option (google.api.method_signature) = "project,zone,autoscaler_resource"; + } + + // Updates an autoscaler in the specified project using the data included in the request. + rpc Update(UpdateAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/zones/{zone}/autoscalers" + body: "autoscaler_resource" + }; + option (google.api.method_signature) = "project,zone,autoscaler_resource"; + } + +} + +// The BackendBuckets API. +service BackendBuckets { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds a key for validating requests with signed URLs for this backend bucket. + rpc AddSignedUrlKey(AddSignedUrlKeyBackendBucketRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/addSignedUrlKey" + body: "signed_url_key_resource" + }; + option (google.api.method_signature) = "project,backend_bucket,signed_url_key_resource"; + } + + // Deletes the specified BackendBucket resource. + rpc Delete(DeleteBackendBucketRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}" + }; + option (google.api.method_signature) = "project,backend_bucket"; + } + + // Deletes a key for validating requests with signed URLs for this backend bucket. + rpc DeleteSignedUrlKey(DeleteSignedUrlKeyBackendBucketRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/deleteSignedUrlKey" + }; + option (google.api.method_signature) = "project,backend_bucket,key_name"; + } + + // Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. + rpc Get(GetBackendBucketRequest) returns (BackendBucket) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}" + }; + option (google.api.method_signature) = "project,backend_bucket"; + } + + // Creates a BackendBucket resource in the specified project using the data included in the request. + rpc Insert(InsertBackendBucketRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendBuckets" + body: "backend_bucket_resource" + }; + option (google.api.method_signature) = "project,backend_bucket_resource"; + } + + // Retrieves the list of BackendBucket resources available to the specified project. + rpc List(ListBackendBucketsRequest) returns (BackendBucketList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/backendBuckets" + }; + option (google.api.method_signature) = "project"; + } + + // Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchBackendBucketRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}" + body: "backend_bucket_resource" + }; + option (google.api.method_signature) = "project,backend_bucket,backend_bucket_resource"; + } + + // Updates the specified BackendBucket resource with the data included in the request. + rpc Update(UpdateBackendBucketRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}" + body: "backend_bucket_resource" + }; + option (google.api.method_signature) = "project,backend_bucket,backend_bucket_resource"; + } + +} + +// The BackendServices API. +service BackendServices { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds a key for validating requests with signed URLs for this backend service. + rpc AddSignedUrlKey(AddSignedUrlKeyBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/addSignedUrlKey" + body: "signed_url_key_resource" + }; + option (google.api.method_signature) = "project,backend_service,signed_url_key_resource"; + } + + // Retrieves the list of all BackendService resources, regional and global, available to the specified project. + rpc AggregatedList(AggregatedListBackendServicesRequest) returns (BackendServiceAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/backendServices" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified BackendService resource. + rpc Delete(DeleteBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/backendServices/{backend_service}" + }; + option (google.api.method_signature) = "project,backend_service"; + } + + // Deletes a key for validating requests with signed URLs for this backend service. + rpc DeleteSignedUrlKey(DeleteSignedUrlKeyBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/deleteSignedUrlKey" + }; + option (google.api.method_signature) = "project,backend_service,key_name"; + } + + // Returns the specified BackendService resource. Gets a list of available backend services. + rpc Get(GetBackendServiceRequest) returns (BackendService) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/backendServices/{backend_service}" + }; + option (google.api.method_signature) = "project,backend_service"; + } + + // Gets the most recent health check results for this BackendService. + // + // Example request body: + // + // { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" } + rpc GetHealth(GetHealthBackendServiceRequest) returns (BackendServiceGroupHealth) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/getHealth" + body: "resource_group_reference_resource" + }; + option (google.api.method_signature) = "project,backend_service,resource_group_reference_resource"; + } + + // Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. + rpc Insert(InsertBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendServices" + body: "backend_service_resource" + }; + option (google.api.method_signature) = "project,backend_service_resource"; + } + + // Retrieves the list of BackendService resources available to the specified project. + rpc List(ListBackendServicesRequest) returns (BackendServiceList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/backendServices" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/backendServices/{backend_service}" + body: "backend_service_resource" + }; + option (google.api.method_signature) = "project,backend_service,backend_service_resource"; + } + + // Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview + rpc SetSecurityPolicy(SetSecurityPolicyBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/setSecurityPolicy" + body: "security_policy_reference_resource" + }; + option (google.api.method_signature) = "project,backend_service,security_policy_reference_resource"; + } + + // Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview. + rpc Update(UpdateBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/global/backendServices/{backend_service}" + body: "backend_service_resource" + }; + option (google.api.method_signature) = "project,backend_service,backend_service_resource"; + } + +} + +// The DiskTypes API. +service DiskTypes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of disk types. + rpc AggregatedList(AggregatedListDiskTypesRequest) returns (DiskTypeAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/diskTypes" + }; + option (google.api.method_signature) = "project"; + } + + // Returns the specified disk type. Gets a list of available disk types by making a list() request. + rpc Get(GetDiskTypeRequest) returns (DiskType) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/diskTypes/{disk_type}" + }; + option (google.api.method_signature) = "project,zone,disk_type"; + } + + // Retrieves a list of disk types available to the specified project. + rpc List(ListDiskTypesRequest) returns (DiskTypeList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/diskTypes" + }; + option (google.api.method_signature) = "project,zone"; + } + +} + +// The Disks API. +service Disks { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + rpc AddResourcePolicies(AddResourcePoliciesDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies" + body: "disks_add_resource_policies_request_resource" + }; + option (google.api.method_signature) = "project,zone,disk,disks_add_resource_policies_request_resource"; + } + + // Retrieves an aggregated list of persistent disks. + rpc AggregatedList(AggregatedListDisksRequest) returns (DiskAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/disks" + }; + option (google.api.method_signature) = "project"; + } + + // Creates a snapshot of a specified persistent disk. + rpc CreateSnapshot(CreateSnapshotDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot" + body: "snapshot_resource" + }; + option (google.api.method_signature) = "project,zone,disk,snapshot_resource"; + } + + // Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + rpc Delete(DeleteDiskRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}" + }; + option (google.api.method_signature) = "project,zone,disk"; + } + + // Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. + rpc Get(GetDiskRequest) returns (Disk) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}" + }; + option (google.api.method_signature) = "project,zone,disk"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyDiskRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,zone,resource"; + } + + // Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. + rpc Insert(InsertDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks" + body: "disk_resource" + }; + option (google.api.method_signature) = "project,zone,disk_resource"; + } + + // Retrieves a list of persistent disks contained within the specified zone. + rpc List(ListDisksRequest) returns (DiskList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/disks" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Removes resource policies from a disk. + rpc RemoveResourcePolicies(RemoveResourcePoliciesDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies" + body: "disks_remove_resource_policies_request_resource" + }; + option (google.api.method_signature) = "project,zone,disk,disks_remove_resource_policies_request_resource"; + } + + // Resizes the specified persistent disk. You can only increase the size of the disk. + rpc Resize(ResizeDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/resize" + body: "disks_resize_request_resource" + }; + option (google.api.method_signature) = "project,zone,disk,disks_resize_request_resource"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyDiskRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy" + body: "zone_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,zone_set_policy_request_resource"; + } + + // Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setLabels" + body: "zone_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,zone_set_labels_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsDiskRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,test_permissions_request_resource"; + } + +} + +// The ExternalVpnGateways API. +service ExternalVpnGateways { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified externalVpnGateway. + rpc Delete(DeleteExternalVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}" + }; + option (google.api.method_signature) = "project,external_vpn_gateway"; + } + + // Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. + rpc Get(GetExternalVpnGatewayRequest) returns (ExternalVpnGateway) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}" + }; + option (google.api.method_signature) = "project,external_vpn_gateway"; + } + + // Creates a ExternalVpnGateway in the specified project using the data included in the request. + rpc Insert(InsertExternalVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/externalVpnGateways" + body: "external_vpn_gateway_resource" + }; + option (google.api.method_signature) = "project,external_vpn_gateway_resource"; + } + + // Retrieves the list of ExternalVpnGateway available to the specified project. + rpc List(ListExternalVpnGatewaysRequest) returns (ExternalVpnGatewayList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/externalVpnGateways" + }; + option (google.api.method_signature) = "project"; + } + + // Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsExternalVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/setLabels" + body: "global_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_labels_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsExternalVpnGatewayRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,resource,test_permissions_request_resource"; + } + +} + +// The FirewallPolicies API. +service FirewallPolicies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Inserts an association for the specified firewall policy. + rpc AddAssociation(AddAssociationFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addAssociation" + body: "firewall_policy_association_resource" + }; + option (google.api.method_signature) = "firewall_policy,firewall_policy_association_resource"; + } + + // Inserts a rule into a firewall policy. + rpc AddRule(AddRuleFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addRule" + body: "firewall_policy_rule_resource" + }; + option (google.api.method_signature) = "firewall_policy,firewall_policy_rule_resource"; + } + + // Copies rules to the specified firewall policy. + rpc CloneRules(CloneRulesFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/cloneRules" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Deletes the specified policy. + rpc Delete(DeleteFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Returns the specified firewall policy. + rpc Get(GetFirewallPolicyRequest) returns (FirewallPolicy) { + option (google.api.http) = { + get: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Gets an association with the specified name. + rpc GetAssociation(GetAssociationFirewallPolicyRequest) returns (FirewallPolicyAssociation) { + option (google.api.http) = { + get: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getAssociation" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyFirewallPolicyRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/locations/global/firewallPolicies/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "resource"; + } + + // Gets a rule of the specified priority. + rpc GetRule(GetRuleFirewallPolicyRequest) returns (FirewallPolicyRule) { + option (google.api.http) = { + get: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getRule" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Creates a new policy in the specified project using the data included in the request. + rpc Insert(InsertFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies" + body: "firewall_policy_resource" + }; + option (google.api.method_signature) = "firewall_policy_resource"; + } + + // Lists all the policies that have been configured for the specified project. + rpc List(ListFirewallPoliciesRequest) returns (FirewallPolicyList) { + option (google.api.http) = { + get: "/compute/v1/locations/global/firewallPolicies" + }; + option (google.api.method_signature) = ""; + } + + // Lists associations of a specified target, i.e., organization or folder. + rpc ListAssociations(ListAssociationsFirewallPolicyRequest) returns (FirewallPoliciesListAssociationsResponse) { + option (google.api.http) = { + get: "/compute/v1/locations/global/firewallPolicies/listAssociations" + }; + option (google.api.method_signature) = ""; + } + + // Moves the specified firewall policy. + rpc Move(MoveFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/move" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Patches the specified policy with the data included in the request. + rpc Patch(PatchFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}" + body: "firewall_policy_resource" + }; + option (google.api.method_signature) = "firewall_policy,firewall_policy_resource"; + } + + // Patches a rule of the specified priority. + rpc PatchRule(PatchRuleFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/patchRule" + body: "firewall_policy_rule_resource" + }; + option (google.api.method_signature) = "firewall_policy,firewall_policy_rule_resource"; + } + + // Removes an association for the specified firewall policy. + rpc RemoveAssociation(RemoveAssociationFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeAssociation" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Deletes a rule of the specified priority. + rpc RemoveRule(RemoveRuleFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeRule" + }; + option (google.api.method_signature) = "firewall_policy"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyFirewallPolicyRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{resource}/setIamPolicy" + body: "global_organization_set_policy_request_resource" + }; + option (google.api.method_signature) = "resource,global_organization_set_policy_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsFirewallPolicyRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/locations/global/firewallPolicies/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "resource,test_permissions_request_resource"; + } + +} + +// The Firewalls API. +service Firewalls { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified firewall. + rpc Delete(DeleteFirewallRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/firewalls/{firewall}" + }; + option (google.api.method_signature) = "project,firewall"; + } + + // Returns the specified firewall. + rpc Get(GetFirewallRequest) returns (Firewall) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/firewalls/{firewall}" + }; + option (google.api.method_signature) = "project,firewall"; + } + + // Creates a firewall rule in the specified project using the data included in the request. + rpc Insert(InsertFirewallRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/firewalls" + body: "firewall_resource" + }; + option (google.api.method_signature) = "project,firewall_resource"; + } + + // Retrieves the list of firewall rules available to the specified project. + rpc List(ListFirewallsRequest) returns (FirewallList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/firewalls" + }; + option (google.api.method_signature) = "project"; + } + + // Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchFirewallRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/firewalls/{firewall}" + body: "firewall_resource" + }; + option (google.api.method_signature) = "project,firewall,firewall_resource"; + } + + // Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. + rpc Update(UpdateFirewallRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/global/firewalls/{firewall}" + body: "firewall_resource" + }; + option (google.api.method_signature) = "project,firewall,firewall_resource"; + } + +} + +// The ForwardingRules API. +service ForwardingRules { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of forwarding rules. + rpc AggregatedList(AggregatedListForwardingRulesRequest) returns (ForwardingRuleAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/forwardingRules" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified ForwardingRule resource. + rpc Delete(DeleteForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" + }; + option (google.api.method_signature) = "project,region,forwarding_rule"; + } + + // Returns the specified ForwardingRule resource. + rpc Get(GetForwardingRuleRequest) returns (ForwardingRule) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" + }; + option (google.api.method_signature) = "project,region,forwarding_rule"; + } + + // Creates a ForwardingRule resource in the specified project and region using the data included in the request. + rpc Insert(InsertForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/forwardingRules" + body: "forwarding_rule_resource" + }; + option (google.api.method_signature) = "project,region,forwarding_rule_resource"; + } + + // Retrieves a list of ForwardingRule resources available to the specified project and region. + rpc List(ListForwardingRulesRequest) returns (ForwardingRuleList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/forwardingRules" + }; + option (google.api.method_signature) = "project,region"; + } + + // Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + rpc Patch(PatchForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" + body: "forwarding_rule_resource" + }; + option (google.api.method_signature) = "project,region,forwarding_rule,forwarding_rule_resource"; + } + + // Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels" + body: "region_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,region_set_labels_request_resource"; + } + + // Changes target URL for forwarding rule. The new target should be of the same type as the old target. + rpc SetTarget(SetTargetForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}/setTarget" + body: "target_reference_resource" + }; + option (google.api.method_signature) = "project,region,forwarding_rule,target_reference_resource"; + } + +} + +// The GlobalAddresses API. +service GlobalAddresses { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified address resource. + rpc Delete(DeleteGlobalAddressRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/addresses/{address}" + }; + option (google.api.method_signature) = "project,address"; + } + + // Returns the specified address resource. Gets a list of available addresses by making a list() request. + rpc Get(GetGlobalAddressRequest) returns (Address) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/addresses/{address}" + }; + option (google.api.method_signature) = "project,address"; + } + + // Creates an address resource in the specified project by using the data included in the request. + rpc Insert(InsertGlobalAddressRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/addresses" + body: "address_resource" + }; + option (google.api.method_signature) = "project,address_resource"; + } + + // Retrieves a list of global addresses. + rpc List(ListGlobalAddressesRequest) returns (AddressList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/addresses" + }; + option (google.api.method_signature) = "project"; + } + +} + +// The GlobalForwardingRules API. +service GlobalForwardingRules { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified GlobalForwardingRule resource. + rpc Delete(DeleteGlobalForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}" + }; + option (google.api.method_signature) = "project,forwarding_rule"; + } + + // Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. + rpc Get(GetGlobalForwardingRuleRequest) returns (ForwardingRule) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}" + }; + option (google.api.method_signature) = "project,forwarding_rule"; + } + + // Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + rpc Insert(InsertGlobalForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/forwardingRules" + body: "forwarding_rule_resource" + }; + option (google.api.method_signature) = "project,forwarding_rule_resource"; + } + + // Retrieves a list of GlobalForwardingRule resources available to the specified project. + rpc List(ListGlobalForwardingRulesRequest) returns (ForwardingRuleList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/forwardingRules" + }; + option (google.api.method_signature) = "project"; + } + + // Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + rpc Patch(PatchGlobalForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}" + body: "forwarding_rule_resource" + }; + option (google.api.method_signature) = "project,forwarding_rule,forwarding_rule_resource"; + } + + // Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsGlobalForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/forwardingRules/{resource}/setLabels" + body: "global_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_labels_request_resource"; + } + + // Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + rpc SetTarget(SetTargetGlobalForwardingRuleRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}/setTarget" + body: "target_reference_resource" + }; + option (google.api.method_signature) = "project,forwarding_rule,target_reference_resource"; + } + +} + +// The GlobalNetworkEndpointGroups API. +service GlobalNetworkEndpointGroups { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Attach a network endpoint to the specified network endpoint group. + rpc AttachNetworkEndpoints(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints" + body: "global_network_endpoint_groups_attach_endpoints_request_resource" + }; + option (google.api.method_signature) = "project,network_endpoint_group,global_network_endpoint_groups_attach_endpoints_request_resource"; + } + + // Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + rpc Delete(DeleteGlobalNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}" + }; + option (google.api.method_signature) = "project,network_endpoint_group"; + } + + // Detach the network endpoint from the specified network endpoint group. + rpc DetachNetworkEndpoints(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints" + body: "global_network_endpoint_groups_detach_endpoints_request_resource" + }; + option (google.api.method_signature) = "project,network_endpoint_group,global_network_endpoint_groups_detach_endpoints_request_resource"; + } + + // Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + rpc Get(GetGlobalNetworkEndpointGroupRequest) returns (NetworkEndpointGroup) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}" + }; + option (google.api.method_signature) = "project,network_endpoint_group"; + } + + // Creates a network endpoint group in the specified project using the parameters that are included in the request. + rpc Insert(InsertGlobalNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networkEndpointGroups" + body: "network_endpoint_group_resource" + }; + option (google.api.method_signature) = "project,network_endpoint_group_resource"; + } + + // Retrieves the list of network endpoint groups that are located in the specified project. + rpc List(ListGlobalNetworkEndpointGroupsRequest) returns (NetworkEndpointGroupList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/networkEndpointGroups" + }; + option (google.api.method_signature) = "project"; + } + + // Lists the network endpoints in the specified network endpoint group. + rpc ListNetworkEndpoints(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest) returns (NetworkEndpointGroupsListNetworkEndpoints) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints" + }; + option (google.api.method_signature) = "project,network_endpoint_group"; + } + +} + +// The GlobalOperations API. +service GlobalOperations { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of all operations. + rpc AggregatedList(AggregatedListGlobalOperationsRequest) returns (OperationAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/operations" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified Operations resource. + rpc Delete(DeleteGlobalOperationRequest) returns (DeleteGlobalOperationResponse) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/operations/{operation}" + }; + option (google.api.method_signature) = "project,operation"; + } + + // Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + rpc Get(GetGlobalOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/operations/{operation}" + }; + option (google.api.method_signature) = "project,operation"; + } + + // Retrieves a list of Operation resources contained within the specified project. + rpc List(ListGlobalOperationsRequest) returns (OperationList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/operations" + }; + option (google.api.method_signature) = "project"; + } + + // Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + // + // This method is called on a best-effort basis. Specifically: + // - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + // - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + rpc Wait(WaitGlobalOperationRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/operations/{operation}/wait" + }; + option (google.api.method_signature) = "project,operation"; + } + +} + +// The GlobalOrganizationOperations API. +service GlobalOrganizationOperations { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified Operations resource. + rpc Delete(DeleteGlobalOrganizationOperationRequest) returns (DeleteGlobalOrganizationOperationResponse) { + option (google.api.http) = { + delete: "/compute/v1/locations/global/operations/{operation}" + }; + option (google.api.method_signature) = "operation"; + } + + // Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + rpc Get(GetGlobalOrganizationOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/compute/v1/locations/global/operations/{operation}" + }; + option (google.api.method_signature) = "operation"; + } + + // Retrieves a list of Operation resources contained within the specified organization. + rpc List(ListGlobalOrganizationOperationsRequest) returns (OperationList) { + option (google.api.http) = { + get: "/compute/v1/locations/global/operations" + }; + option (google.api.method_signature) = ""; + } + +} + +// The GlobalPublicDelegatedPrefixes API. +service GlobalPublicDelegatedPrefixes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified global PublicDelegatedPrefix. + rpc Delete(DeleteGlobalPublicDelegatedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}" + }; + option (google.api.method_signature) = "project,public_delegated_prefix"; + } + + // Returns the specified global PublicDelegatedPrefix resource. + rpc Get(GetGlobalPublicDelegatedPrefixeRequest) returns (PublicDelegatedPrefix) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}" + }; + option (google.api.method_signature) = "project,public_delegated_prefix"; + } + + // Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. + rpc Insert(InsertGlobalPublicDelegatedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/publicDelegatedPrefixes" + body: "public_delegated_prefix_resource" + }; + option (google.api.method_signature) = "project,public_delegated_prefix_resource"; + } + + // Lists the global PublicDelegatedPrefixes for a project. + rpc List(ListGlobalPublicDelegatedPrefixesRequest) returns (PublicDelegatedPrefixList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/publicDelegatedPrefixes" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + rpc Patch(PatchGlobalPublicDelegatedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}" + body: "public_delegated_prefix_resource" + }; + option (google.api.method_signature) = "project,public_delegated_prefix,public_delegated_prefix_resource"; + } + +} + +// The HealthChecks API. +service HealthChecks { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. + rpc AggregatedList(AggregatedListHealthChecksRequest) returns (HealthChecksAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/healthChecks" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified HealthCheck resource. + rpc Delete(DeleteHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/healthChecks/{health_check}" + }; + option (google.api.method_signature) = "project,health_check"; + } + + // Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + rpc Get(GetHealthCheckRequest) returns (HealthCheck) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/healthChecks/{health_check}" + }; + option (google.api.method_signature) = "project,health_check"; + } + + // Creates a HealthCheck resource in the specified project using the data included in the request. + rpc Insert(InsertHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/healthChecks" + body: "health_check_resource" + }; + option (google.api.method_signature) = "project,health_check_resource"; + } + + // Retrieves the list of HealthCheck resources available to the specified project. + rpc List(ListHealthChecksRequest) returns (HealthCheckList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/healthChecks" + }; + option (google.api.method_signature) = "project"; + } + + // Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/healthChecks/{health_check}" + body: "health_check_resource" + }; + option (google.api.method_signature) = "project,health_check,health_check_resource"; + } + + // Updates a HealthCheck resource in the specified project using the data included in the request. + rpc Update(UpdateHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/global/healthChecks/{health_check}" + body: "health_check_resource" + }; + option (google.api.method_signature) = "project,health_check,health_check_resource"; + } + +} + +// The Images API. +service Images { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified image. + rpc Delete(DeleteImageRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/images/{image}" + }; + option (google.api.method_signature) = "project,image"; + } + + // Sets the deprecation status of an image. + // + // If an empty request body is given, clears the deprecation status instead. + rpc Deprecate(DeprecateImageRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/images/{image}/deprecate" + body: "deprecation_status_resource" + }; + option (google.api.method_signature) = "project,image,deprecation_status_resource"; + } + + // Returns the specified image. Gets a list of available images by making a list() request. + rpc Get(GetImageRequest) returns (Image) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/images/{image}" + }; + option (google.api.method_signature) = "project,image"; + } + + // Returns the latest image that is part of an image family and is not deprecated. + rpc GetFromFamily(GetFromFamilyImageRequest) returns (Image) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/images/family/{family}" + }; + option (google.api.method_signature) = "project,family"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyImageRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/images/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,resource"; + } + + // Creates an image in the specified project using the data included in the request. + rpc Insert(InsertImageRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/images" + body: "image_resource" + }; + option (google.api.method_signature) = "project,image_resource"; + } + + // Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + rpc List(ListImagesRequest) returns (ImageList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/images" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. + rpc Patch(PatchImageRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/images/{image}" + body: "image_resource" + }; + option (google.api.method_signature) = "project,image,image_resource"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyImageRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/images/{resource}/setIamPolicy" + body: "global_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_policy_request_resource"; + } + + // Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsImageRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/images/{resource}/setLabels" + body: "global_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_labels_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsImageRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/images/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,resource,test_permissions_request_resource"; + } + +} + +// The InstanceGroupManagers API. +service InstanceGroupManagers { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + // + // You can specify a maximum of 1000 instances with this method per request. + rpc AbandonInstances(AbandonInstancesInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/abandonInstances" + body: "instance_group_managers_abandon_instances_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_abandon_instances_request_resource"; + } + + // Retrieves the list of managed instance groups and groups them by zone. + rpc AggregatedList(AggregatedListInstanceGroupManagersRequest) returns (InstanceGroupManagerAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/instanceGroupManagers" + }; + option (google.api.method_signature) = "project"; + } + + // Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + rpc ApplyUpdatesToInstances(ApplyUpdatesToInstancesInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances" + body: "instance_group_managers_apply_updates_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_apply_updates_request_resource"; + } + + // Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + rpc CreateInstances(CreateInstancesInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/createInstances" + body: "instance_group_managers_create_instances_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_create_instances_request_resource"; + } + + // Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. + rpc Delete(DeleteInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager"; + } + + // Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + // + // You can specify a maximum of 1000 instances with this method per request. + rpc DeleteInstances(DeleteInstancesInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deleteInstances" + body: "instance_group_managers_delete_instances_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_delete_instances_request_resource"; + } + + // Deletes selected per-instance configs for the managed instance group. + rpc DeletePerInstanceConfigs(DeletePerInstanceConfigsInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs" + body: "instance_group_managers_delete_per_instance_configs_req_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_delete_per_instance_configs_req_resource"; + } + + // Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. + rpc Get(GetInstanceGroupManagerRequest) returns (InstanceGroupManager) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager"; + } + + // Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + // + // A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + rpc Insert(InsertInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers" + body: "instance_group_manager_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager_resource"; + } + + // Retrieves a list of managed instance groups that are contained within the specified project and zone. + rpc List(ListInstanceGroupManagersRequest) returns (InstanceGroupManagerList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported. + rpc ListErrors(ListErrorsInstanceGroupManagersRequest) returns (InstanceGroupManagersListErrorsResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listErrors" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager"; + } + + // Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. + rpc ListManagedInstances(ListManagedInstancesInstanceGroupManagersRequest) returns (InstanceGroupManagersListManagedInstancesResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listManagedInstances" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager"; + } + + // Lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. + rpc ListPerInstanceConfigs(ListPerInstanceConfigsInstanceGroupManagersRequest) returns (InstanceGroupManagersListPerInstanceConfigsResp) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager"; + } + + // Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}" + body: "instance_group_manager_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_manager_resource"; + } + + // Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + rpc PatchPerInstanceConfigs(PatchPerInstanceConfigsInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs" + body: "instance_group_managers_patch_per_instance_configs_req_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_patch_per_instance_configs_req_resource"; + } + + // Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + // + // You can specify a maximum of 1000 instances with this method per request. + rpc RecreateInstances(RecreateInstancesInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/recreateInstances" + body: "instance_group_managers_recreate_instances_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_recreate_instances_request_resource"; + } + + // Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + // + // When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + // + // + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. + // + // This list is subject to change. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + rpc Resize(ResizeInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resize" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,size"; + } + + // Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + rpc SetInstanceTemplate(SetInstanceTemplateInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate" + body: "instance_group_managers_set_instance_template_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_set_instance_template_request_resource"; + } + + // Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + rpc SetTargetPools(SetTargetPoolsInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setTargetPools" + body: "instance_group_managers_set_target_pools_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_set_target_pools_request_resource"; + } + + // Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + rpc UpdatePerInstanceConfigs(UpdatePerInstanceConfigsInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs" + body: "instance_group_managers_update_per_instance_configs_req_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_manager,instance_group_managers_update_per_instance_configs_req_resource"; + } + +} + +// The InstanceGroups API. +service InstanceGroups { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. + rpc AddInstances(AddInstancesInstanceGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/addInstances" + body: "instance_groups_add_instances_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group,instance_groups_add_instances_request_resource"; + } + + // Retrieves the list of instance groups and sorts them by zone. + rpc AggregatedList(AggregatedListInstanceGroupsRequest) returns (InstanceGroupAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/instanceGroups" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. + rpc Delete(DeleteInstanceGroupRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}" + }; + option (google.api.method_signature) = "project,zone,instance_group"; + } + + // Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. + // + // For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + rpc Get(GetInstanceGroupRequest) returns (InstanceGroup) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}" + }; + option (google.api.method_signature) = "project,zone,instance_group"; + } + + // Creates an instance group in the specified project using the parameters that are included in the request. + rpc Insert(InsertInstanceGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups" + body: "instance_group_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group_resource"; + } + + // Retrieves the list of zonal instance group resources contained within the specified zone. + // + // For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + rpc List(ListInstanceGroupsRequest) returns (InstanceGroupList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Lists the instances in the specified instance group. The orderBy query parameter is not supported. + rpc ListInstances(ListInstancesInstanceGroupsRequest) returns (InstanceGroupsListInstances) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/listInstances" + body: "instance_groups_list_instances_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group,instance_groups_list_instances_request_resource"; + } + + // Removes one or more instances from the specified instance group, but does not delete those instances. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. + rpc RemoveInstances(RemoveInstancesInstanceGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/removeInstances" + body: "instance_groups_remove_instances_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group,instance_groups_remove_instances_request_resource"; + } + + // Sets the named ports for the specified instance group. + rpc SetNamedPorts(SetNamedPortsInstanceGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/setNamedPorts" + body: "instance_groups_set_named_ports_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance_group,instance_groups_set_named_ports_request_resource"; + } + +} + +// The InstanceTemplates API. +service InstanceTemplates { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. + rpc Delete(DeleteInstanceTemplateRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}" + }; + option (google.api.method_signature) = "project,instance_template"; + } + + // Returns the specified instance template. Gets a list of available instance templates by making a list() request. + rpc Get(GetInstanceTemplateRequest) returns (InstanceTemplate) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}" + }; + option (google.api.method_signature) = "project,instance_template"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyInstanceTemplateRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,resource"; + } + + // Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + rpc Insert(InsertInstanceTemplateRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/instanceTemplates" + body: "instance_template_resource" + }; + option (google.api.method_signature) = "project,instance_template_resource"; + } + + // Retrieves a list of instance templates that are contained within the specified project. + rpc List(ListInstanceTemplatesRequest) returns (InstanceTemplateList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/instanceTemplates" + }; + option (google.api.method_signature) = "project"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyInstanceTemplateRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/setIamPolicy" + body: "global_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_policy_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsInstanceTemplateRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,resource,test_permissions_request_resource"; + } + +} + +// The Instances API. +service Instances { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds an access config to an instance's network interface. + rpc AddAccessConfig(AddAccessConfigInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig" + body: "access_config_resource" + }; + option (google.api.method_signature) = "project,zone,instance,network_interface,access_config_resource"; + } + + // Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + rpc AddResourcePolicies(AddResourcePoliciesInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies" + body: "instances_add_resource_policies_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_add_resource_policies_request_resource"; + } + + // Retrieves aggregated list of all of the instances in your project across all regions and zones. + rpc AggregatedList(AggregatedListInstancesRequest) returns (InstanceAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/instances" + }; + option (google.api.method_signature) = "project"; + } + + // Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. + rpc AttachDisk(AttachDiskInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk" + body: "attached_disk_resource" + }; + option (google.api.method_signature) = "project,zone,instance,attached_disk_resource"; + } + + // Creates multiple instances. Count specifies the number of instances to create. + rpc BulkInsert(BulkInsertInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/bulkInsert" + body: "bulk_insert_instance_resource_resource" + }; + option (google.api.method_signature) = "project,zone,bulk_insert_instance_resource_resource"; + } + + // Deletes the specified Instance resource. For more information, see Deleting an instance. + rpc Delete(DeleteInstanceRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Deletes an access config from an instance's network interface. + rpc DeleteAccessConfig(DeleteAccessConfigInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig" + }; + option (google.api.method_signature) = "project,zone,instance,access_config,network_interface"; + } + + // Detaches a disk from an instance. + rpc DetachDisk(DetachDiskInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/detachDisk" + }; + option (google.api.method_signature) = "project,zone,instance,device_name"; + } + + // Returns the specified Instance resource. Gets a list of available instances by making a list() request. + rpc Get(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Returns effective firewalls applied to an interface of the instance. + rpc GetEffectiveFirewalls(GetEffectiveFirewallsInstanceRequest) returns (InstancesGetEffectiveFirewallsResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls" + }; + option (google.api.method_signature) = "project,zone,instance,network_interface"; + } + + // Returns the specified guest attributes entry. + rpc GetGuestAttributes(GetGuestAttributesInstanceRequest) returns (GuestAttributes) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyInstanceRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,zone,resource"; + } + + // Returns the screenshot from the specified instance. + rpc GetScreenshot(GetScreenshotInstanceRequest) returns (Screenshot) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/screenshot" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Returns the last 1 MB of serial port output from the specified instance. + rpc GetSerialPortOutput(GetSerialPortOutputInstanceRequest) returns (SerialPortOutput) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Returns the Shielded Instance Identity of an instance + rpc GetShieldedInstanceIdentity(GetShieldedInstanceIdentityInstanceRequest) returns (ShieldedInstanceIdentity) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Creates an instance resource in the specified project using the data included in the request. + rpc Insert(InsertInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances" + body: "instance_resource" + }; + option (google.api.method_signature) = "project,zone,instance_resource"; + } + + // Retrieves the list of instances contained within the specified zone. + rpc List(ListInstancesRequest) returns (InstanceList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. + rpc ListReferrers(ListReferrersInstancesRequest) returns (InstanceListReferrers) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/referrers" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Removes resource policies from an instance. + rpc RemoveResourcePolicies(RemoveResourcePoliciesInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies" + body: "instances_remove_resource_policies_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_remove_resource_policies_request_resource"; + } + + // Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. + rpc Reset(ResetInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reset" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Sets deletion protection on the instance. + rpc SetDeletionProtection(SetDeletionProtectionInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection" + }; + option (google.api.method_signature) = "project,zone,resource"; + } + + // Sets the auto-delete flag for a disk attached to an instance. + rpc SetDiskAutoDelete(SetDiskAutoDeleteInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete" + }; + option (google.api.method_signature) = "project,zone,instance,auto_delete,device_name"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyInstanceRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy" + body: "zone_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,zone_set_policy_request_resource"; + } + + // Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setLabels" + body: "instances_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_set_labels_request_resource"; + } + + // Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + rpc SetMachineResources(SetMachineResourcesInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources" + body: "instances_set_machine_resources_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_set_machine_resources_request_resource"; + } + + // Changes the machine type for a stopped instance to the machine type specified in the request. + rpc SetMachineType(SetMachineTypeInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineType" + body: "instances_set_machine_type_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_set_machine_type_request_resource"; + } + + // Sets metadata for the specified instance to the data included in the request. + rpc SetMetadata(SetMetadataInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata" + body: "metadata_resource" + }; + option (google.api.method_signature) = "project,zone,instance,metadata_resource"; + } + + // Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. + rpc SetMinCpuPlatform(SetMinCpuPlatformInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform" + body: "instances_set_min_cpu_platform_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_set_min_cpu_platform_request_resource"; + } + + // Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. + rpc SetScheduling(SetSchedulingInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setScheduling" + body: "scheduling_resource" + }; + option (google.api.method_signature) = "project,zone,instance,scheduling_resource"; + } + + // Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + rpc SetServiceAccount(SetServiceAccountInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount" + body: "instances_set_service_account_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_set_service_account_request_resource"; + } + + // Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc SetShieldedInstanceIntegrityPolicy(SetShieldedInstanceIntegrityPolicyInstanceRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy" + body: "shielded_instance_integrity_policy_resource" + }; + option (google.api.method_signature) = "project,zone,instance,shielded_instance_integrity_policy_resource"; + } + + // Sets network tags for the specified instance to the data included in the request. + rpc SetTags(SetTagsInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setTags" + body: "tags_resource" + }; + option (google.api.method_signature) = "project,zone,instance,tags_resource"; + } + + // Simulates a maintenance event on the instance. + rpc SimulateMaintenanceEvent(SimulateMaintenanceEventInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + rpc Start(StartInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/start" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + rpc StartWithEncryptionKey(StartWithEncryptionKeyInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey" + body: "instances_start_with_encryption_key_request_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instances_start_with_encryption_key_request_resource"; + } + + // Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + rpc Stop(StopInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop" + }; + option (google.api.method_signature) = "project,zone,instance"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsInstanceRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,test_permissions_request_resource"; + } + + // Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + rpc Update(UpdateInstanceRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}" + body: "instance_resource" + }; + option (google.api.method_signature) = "project,zone,instance,instance_resource"; + } + + // Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc UpdateAccessConfig(UpdateAccessConfigInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig" + body: "access_config_resource" + }; + option (google.api.method_signature) = "project,zone,instance,network_interface,access_config_resource"; + } + + // Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc UpdateDisplayDevice(UpdateDisplayDeviceInstanceRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice" + body: "display_device_resource" + }; + option (google.api.method_signature) = "project,zone,instance,display_device_resource"; + } + + // Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. + rpc UpdateNetworkInterface(UpdateNetworkInterfaceInstanceRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface" + body: "network_interface_resource" + }; + option (google.api.method_signature) = "project,zone,instance,network_interface,network_interface_resource"; + } + + // Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc UpdateShieldedInstanceConfig(UpdateShieldedInstanceConfigInstanceRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig" + body: "shielded_instance_config_resource" + }; + option (google.api.method_signature) = "project,zone,instance,shielded_instance_config_resource"; + } + +} + +// The InterconnectAttachments API. +service InterconnectAttachments { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of interconnect attachments. + rpc AggregatedList(AggregatedListInterconnectAttachmentsRequest) returns (InterconnectAttachmentAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/interconnectAttachments" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified interconnect attachment. + rpc Delete(DeleteInterconnectAttachmentRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}" + }; + option (google.api.method_signature) = "project,region,interconnect_attachment"; + } + + // Returns the specified interconnect attachment. + rpc Get(GetInterconnectAttachmentRequest) returns (InterconnectAttachment) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}" + }; + option (google.api.method_signature) = "project,region,interconnect_attachment"; + } + + // Creates an InterconnectAttachment in the specified project using the data included in the request. + rpc Insert(InsertInterconnectAttachmentRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments" + body: "interconnect_attachment_resource" + }; + option (google.api.method_signature) = "project,region,interconnect_attachment_resource"; + } + + // Retrieves the list of interconnect attachments contained within the specified region. + rpc List(ListInterconnectAttachmentsRequest) returns (InterconnectAttachmentList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments" + }; + option (google.api.method_signature) = "project,region"; + } + + // Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchInterconnectAttachmentRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}" + body: "interconnect_attachment_resource" + }; + option (google.api.method_signature) = "project,region,interconnect_attachment,interconnect_attachment_resource"; + } + +} + +// The InterconnectLocations API. +service InterconnectLocations { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. + rpc Get(GetInterconnectLocationRequest) returns (InterconnectLocation) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/interconnectLocations/{interconnect_location}" + }; + option (google.api.method_signature) = "project,interconnect_location"; + } + + // Retrieves the list of interconnect locations available to the specified project. + rpc List(ListInterconnectLocationsRequest) returns (InterconnectLocationList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/interconnectLocations" + }; + option (google.api.method_signature) = "project"; + } + +} + +// The Interconnects API. +service Interconnects { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified interconnect. + rpc Delete(DeleteInterconnectRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/interconnects/{interconnect}" + }; + option (google.api.method_signature) = "project,interconnect"; + } + + // Returns the specified interconnect. Get a list of available interconnects by making a list() request. + rpc Get(GetInterconnectRequest) returns (Interconnect) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/interconnects/{interconnect}" + }; + option (google.api.method_signature) = "project,interconnect"; + } + + // Returns the interconnectDiagnostics for the specified interconnect. + rpc GetDiagnostics(GetDiagnosticsInterconnectRequest) returns (InterconnectsGetDiagnosticsResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/interconnects/{interconnect}/getDiagnostics" + }; + option (google.api.method_signature) = "project,interconnect"; + } + + // Creates a Interconnect in the specified project using the data included in the request. + rpc Insert(InsertInterconnectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/interconnects" + body: "interconnect_resource" + }; + option (google.api.method_signature) = "project,interconnect_resource"; + } + + // Retrieves the list of interconnect available to the specified project. + rpc List(ListInterconnectsRequest) returns (InterconnectList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/interconnects" + }; + option (google.api.method_signature) = "project"; + } + + // Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchInterconnectRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/interconnects/{interconnect}" + body: "interconnect_resource" + }; + option (google.api.method_signature) = "project,interconnect,interconnect_resource"; + } + +} + +// The LicenseCodes API. +service LicenseCodes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc Get(GetLicenseCodeRequest) returns (LicenseCode) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/licenseCodes/{license_code}" + }; + option (google.api.method_signature) = "project,license_code"; + } + + // Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc TestIamPermissions(TestIamPermissionsLicenseCodeRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/licenseCodes/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,resource,test_permissions_request_resource"; + } + +} + +// The Licenses API. +service Licenses { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc Delete(DeleteLicenseRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/licenses/{license}" + }; + option (google.api.method_signature) = "project,license"; + } + + // Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc Get(GetLicenseRequest) returns (License) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/licenses/{license}" + }; + option (google.api.method_signature) = "project,license"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc GetIamPolicy(GetIamPolicyLicenseRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/licenses/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,resource"; + } + + // Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc Insert(InsertLicenseRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/licenses" + body: "license_resource" + }; + option (google.api.method_signature) = "project,license_resource"; + } + + // Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc List(ListLicensesRequest) returns (LicensesListResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/licenses" + }; + option (google.api.method_signature) = "project"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc SetIamPolicy(SetIamPolicyLicenseRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/licenses/{resource}/setIamPolicy" + body: "global_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_policy_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + rpc TestIamPermissions(TestIamPermissionsLicenseRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/licenses/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,resource,test_permissions_request_resource"; + } + +} + +// The MachineTypes API. +service MachineTypes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of machine types. + rpc AggregatedList(AggregatedListMachineTypesRequest) returns (MachineTypeAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/machineTypes" + }; + option (google.api.method_signature) = "project"; + } + + // Returns the specified machine type. Gets a list of available machine types by making a list() request. + rpc Get(GetMachineTypeRequest) returns (MachineType) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/machineTypes/{machine_type}" + }; + option (google.api.method_signature) = "project,zone,machine_type"; + } + + // Retrieves a list of machine types available to the specified project. + rpc List(ListMachineTypesRequest) returns (MachineTypeList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/machineTypes" + }; + option (google.api.method_signature) = "project,zone"; + } + +} + +// The NetworkEndpointGroups API. +service NetworkEndpointGroups { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the list of network endpoint groups and sorts them by zone. + rpc AggregatedList(AggregatedListNetworkEndpointGroupsRequest) returns (NetworkEndpointGroupAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/networkEndpointGroups" + }; + option (google.api.method_signature) = "project"; + } + + // Attach a list of network endpoints to the specified network endpoint group. + rpc AttachNetworkEndpoints(AttachNetworkEndpointsNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints" + body: "network_endpoint_groups_attach_endpoints_request_resource" + }; + option (google.api.method_signature) = "project,zone,network_endpoint_group,network_endpoint_groups_attach_endpoints_request_resource"; + } + + // Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. + rpc Delete(DeleteNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}" + }; + option (google.api.method_signature) = "project,zone,network_endpoint_group"; + } + + // Detach a list of network endpoints from the specified network endpoint group. + rpc DetachNetworkEndpoints(DetachNetworkEndpointsNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints" + body: "network_endpoint_groups_detach_endpoints_request_resource" + }; + option (google.api.method_signature) = "project,zone,network_endpoint_group,network_endpoint_groups_detach_endpoints_request_resource"; + } + + // Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + rpc Get(GetNetworkEndpointGroupRequest) returns (NetworkEndpointGroup) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}" + }; + option (google.api.method_signature) = "project,zone,network_endpoint_group"; + } + + // Creates a network endpoint group in the specified project using the parameters that are included in the request. + rpc Insert(InsertNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups" + body: "network_endpoint_group_resource" + }; + option (google.api.method_signature) = "project,zone,network_endpoint_group_resource"; + } + + // Retrieves the list of network endpoint groups that are located in the specified project and zone. + rpc List(ListNetworkEndpointGroupsRequest) returns (NetworkEndpointGroupList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Lists the network endpoints in the specified network endpoint group. + rpc ListNetworkEndpoints(ListNetworkEndpointsNetworkEndpointGroupsRequest) returns (NetworkEndpointGroupsListNetworkEndpoints) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints" + body: "network_endpoint_groups_list_endpoints_request_resource" + }; + option (google.api.method_signature) = "project,zone,network_endpoint_group,network_endpoint_groups_list_endpoints_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsNetworkEndpointGroupRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,test_permissions_request_resource"; + } + +} + +// The Networks API. +service Networks { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds a peering to the specified network. + rpc AddPeering(AddPeeringNetworkRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networks/{network}/addPeering" + body: "networks_add_peering_request_resource" + }; + option (google.api.method_signature) = "project,network,networks_add_peering_request_resource"; + } + + // Deletes the specified network. + rpc Delete(DeleteNetworkRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/networks/{network}" + }; + option (google.api.method_signature) = "project,network"; + } + + // Returns the specified network. Gets a list of available networks by making a list() request. + rpc Get(GetNetworkRequest) returns (Network) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/networks/{network}" + }; + option (google.api.method_signature) = "project,network"; + } + + // Returns the effective firewalls on a given network. + rpc GetEffectiveFirewalls(GetEffectiveFirewallsNetworkRequest) returns (NetworksGetEffectiveFirewallsResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/networks/{network}/getEffectiveFirewalls" + }; + option (google.api.method_signature) = "project,network"; + } + + // Creates a network in the specified project using the data included in the request. + rpc Insert(InsertNetworkRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networks" + body: "network_resource" + }; + option (google.api.method_signature) = "project,network_resource"; + } + + // Retrieves the list of networks available to the specified project. + rpc List(ListNetworksRequest) returns (NetworkList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/networks" + }; + option (google.api.method_signature) = "project"; + } + + // Lists the peering routes exchanged over peering connection. + rpc ListPeeringRoutes(ListPeeringRoutesNetworksRequest) returns (ExchangedPeeringRoutesList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/networks/{network}/listPeeringRoutes" + }; + option (google.api.method_signature) = "project,network"; + } + + // Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + rpc Patch(PatchNetworkRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/networks/{network}" + body: "network_resource" + }; + option (google.api.method_signature) = "project,network,network_resource"; + } + + // Removes a peering from the specified network. + rpc RemovePeering(RemovePeeringNetworkRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networks/{network}/removePeering" + body: "networks_remove_peering_request_resource" + }; + option (google.api.method_signature) = "project,network,networks_remove_peering_request_resource"; + } + + // Switches the network mode from auto subnet mode to custom subnet mode. + rpc SwitchToCustomMode(SwitchToCustomModeNetworkRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/networks/{network}/switchToCustomMode" + }; + option (google.api.method_signature) = "project,network"; + } + + // Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes + rpc UpdatePeering(UpdatePeeringNetworkRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/networks/{network}/updatePeering" + body: "networks_update_peering_request_resource" + }; + option (google.api.method_signature) = "project,network,networks_update_peering_request_resource"; + } + +} + +// The NodeGroups API. +service NodeGroups { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds specified number of nodes to the node group. + rpc AddNodes(AddNodesNodeGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/addNodes" + body: "node_groups_add_nodes_request_resource" + }; + option (google.api.method_signature) = "project,zone,node_group,node_groups_add_nodes_request_resource"; + } + + // Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. + rpc AggregatedList(AggregatedListNodeGroupsRequest) returns (NodeGroupAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/nodeGroups" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified NodeGroup resource. + rpc Delete(DeleteNodeGroupRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}" + }; + option (google.api.method_signature) = "project,zone,node_group"; + } + + // Deletes specified nodes from the node group. + rpc DeleteNodes(DeleteNodesNodeGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/deleteNodes" + body: "node_groups_delete_nodes_request_resource" + }; + option (google.api.method_signature) = "project,zone,node_group,node_groups_delete_nodes_request_resource"; + } + + // Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + rpc Get(GetNodeGroupRequest) returns (NodeGroup) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}" + }; + option (google.api.method_signature) = "project,zone,node_group"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyNodeGroupRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,zone,resource"; + } + + // Creates a NodeGroup resource in the specified project using the data included in the request. + rpc Insert(InsertNodeGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups" + body: "node_group_resource" + }; + option (google.api.method_signature) = "project,zone,initial_node_count,node_group_resource"; + } + + // Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. + rpc List(ListNodeGroupsRequest) returns (NodeGroupList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Lists nodes in the node group. + rpc ListNodes(ListNodesNodeGroupsRequest) returns (NodeGroupsListNodes) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/listNodes" + }; + option (google.api.method_signature) = "project,zone,node_group"; + } + + // Updates the specified node group. + rpc Patch(PatchNodeGroupRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}" + body: "node_group_resource" + }; + option (google.api.method_signature) = "project,zone,node_group,node_group_resource"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyNodeGroupRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy" + body: "zone_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,zone_set_policy_request_resource"; + } + + // Updates the node template of the node group. + rpc SetNodeTemplate(SetNodeTemplateNodeGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/setNodeTemplate" + body: "node_groups_set_node_template_request_resource" + }; + option (google.api.method_signature) = "project,zone,node_group,node_groups_set_node_template_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsNodeGroupRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,test_permissions_request_resource"; + } + +} + +// The NodeTemplates API. +service NodeTemplates { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of node templates. + rpc AggregatedList(AggregatedListNodeTemplatesRequest) returns (NodeTemplateAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/nodeTemplates" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified NodeTemplate resource. + rpc Delete(DeleteNodeTemplateRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}" + }; + option (google.api.method_signature) = "project,region,node_template"; + } + + // Returns the specified node template. Gets a list of available node templates by making a list() request. + rpc Get(GetNodeTemplateRequest) returns (NodeTemplate) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}" + }; + option (google.api.method_signature) = "project,region,node_template"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyNodeTemplateRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,region,resource"; + } + + // Creates a NodeTemplate resource in the specified project using the data included in the request. + rpc Insert(InsertNodeTemplateRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/nodeTemplates" + body: "node_template_resource" + }; + option (google.api.method_signature) = "project,region,node_template_resource"; + } + + // Retrieves a list of node templates available to the specified project. + rpc List(ListNodeTemplatesRequest) returns (NodeTemplateList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/nodeTemplates" + }; + option (google.api.method_signature) = "project,region"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyNodeTemplateRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy" + body: "region_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,region_set_policy_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsNodeTemplateRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,test_permissions_request_resource"; + } + +} + +// The NodeTypes API. +service NodeTypes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of node types. + rpc AggregatedList(AggregatedListNodeTypesRequest) returns (NodeTypeAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/nodeTypes" + }; + option (google.api.method_signature) = "project"; + } + + // Returns the specified node type. Gets a list of available node types by making a list() request. + rpc Get(GetNodeTypeRequest) returns (NodeType) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/nodeTypes/{node_type}" + }; + option (google.api.method_signature) = "project,zone,node_type"; + } + + // Retrieves a list of node types available to the specified project. + rpc List(ListNodeTypesRequest) returns (NodeTypeList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/nodeTypes" + }; + option (google.api.method_signature) = "project,zone"; + } + +} + +// The PacketMirrorings API. +service PacketMirrorings { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of packetMirrorings. + rpc AggregatedList(AggregatedListPacketMirroringsRequest) returns (PacketMirroringAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/packetMirrorings" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified PacketMirroring resource. + rpc Delete(DeletePacketMirroringRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}" + }; + option (google.api.method_signature) = "project,region,packet_mirroring"; + } + + // Returns the specified PacketMirroring resource. + rpc Get(GetPacketMirroringRequest) returns (PacketMirroring) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}" + }; + option (google.api.method_signature) = "project,region,packet_mirroring"; + } + + // Creates a PacketMirroring resource in the specified project and region using the data included in the request. + rpc Insert(InsertPacketMirroringRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/packetMirrorings" + body: "packet_mirroring_resource" + }; + option (google.api.method_signature) = "project,region,packet_mirroring_resource"; + } + + // Retrieves a list of PacketMirroring resources available to the specified project and region. + rpc List(ListPacketMirroringsRequest) returns (PacketMirroringList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/packetMirrorings" + }; + option (google.api.method_signature) = "project,region"; + } + + // Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + rpc Patch(PatchPacketMirroringRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}" + body: "packet_mirroring_resource" + }; + option (google.api.method_signature) = "project,region,packet_mirroring,packet_mirroring_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsPacketMirroringRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,test_permissions_request_resource"; + } + +} + +// The Projects API. +service Projects { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Disable this project as a shared VPC host project. + rpc DisableXpnHost(DisableXpnHostProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/disableXpnHost" + }; + option (google.api.method_signature) = "project"; + } + + // Disable a service resource (also known as service project) associated with this host project. + rpc DisableXpnResource(DisableXpnResourceProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/disableXpnResource" + body: "projects_disable_xpn_resource_request_resource" + }; + option (google.api.method_signature) = "project,projects_disable_xpn_resource_request_resource"; + } + + // Enable this project as a shared VPC host project. + rpc EnableXpnHost(EnableXpnHostProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/enableXpnHost" + }; + option (google.api.method_signature) = "project"; + } + + // Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. + rpc EnableXpnResource(EnableXpnResourceProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/enableXpnResource" + body: "projects_enable_xpn_resource_request_resource" + }; + option (google.api.method_signature) = "project,projects_enable_xpn_resource_request_resource"; + } + + // Returns the specified Project resource. + rpc Get(GetProjectRequest) returns (Project) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}" + }; + option (google.api.method_signature) = "project"; + } + + // Gets the shared VPC host project that this project links to. May be empty if no link exists. + rpc GetXpnHost(GetXpnHostProjectRequest) returns (Project) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/getXpnHost" + }; + option (google.api.method_signature) = "project"; + } + + // Gets service resources (a.k.a service project) associated with this host project. + rpc GetXpnResources(GetXpnResourcesProjectsRequest) returns (ProjectsGetXpnResources) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/getXpnResources" + }; + option (google.api.method_signature) = "project"; + } + + // Lists all shared VPC host projects visible to the user in an organization. + rpc ListXpnHosts(ListXpnHostsProjectsRequest) returns (XpnHostList) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/listXpnHosts" + body: "projects_list_xpn_hosts_request_resource" + }; + option (google.api.method_signature) = "project,projects_list_xpn_hosts_request_resource"; + } + + // Moves a persistent disk from one zone to another. + rpc MoveDisk(MoveDiskProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/moveDisk" + body: "disk_move_request_resource" + }; + option (google.api.method_signature) = "project,disk_move_request_resource"; + } + + // Moves an instance and its attached persistent disks from one zone to another. + rpc MoveInstance(MoveInstanceProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/moveInstance" + body: "instance_move_request_resource" + }; + option (google.api.method_signature) = "project,instance_move_request_resource"; + } + + // Sets metadata common to all instances within the specified project using the data included in the request. + rpc SetCommonInstanceMetadata(SetCommonInstanceMetadataProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/setCommonInstanceMetadata" + body: "metadata_resource" + }; + option (google.api.method_signature) = "project,metadata_resource"; + } + + // Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + rpc SetDefaultNetworkTier(SetDefaultNetworkTierProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/setDefaultNetworkTier" + body: "projects_set_default_network_tier_request_resource" + }; + option (google.api.method_signature) = "project,projects_set_default_network_tier_request_resource"; + } + + // Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. + rpc SetUsageExportBucket(SetUsageExportBucketProjectRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/setUsageExportBucket" + body: "usage_export_location_resource" + }; + option (google.api.method_signature) = "project,usage_export_location_resource"; + } + +} + +// The PublicAdvertisedPrefixes API. +service PublicAdvertisedPrefixes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified PublicAdvertisedPrefix + rpc Delete(DeletePublicAdvertisedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}" + }; + option (google.api.method_signature) = "project,public_advertised_prefix"; + } + + // Returns the specified PublicAdvertisedPrefix resource. + rpc Get(GetPublicAdvertisedPrefixeRequest) returns (PublicAdvertisedPrefix) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}" + }; + option (google.api.method_signature) = "project,public_advertised_prefix"; + } + + // Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. + rpc Insert(InsertPublicAdvertisedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes" + body: "public_advertised_prefix_resource" + }; + option (google.api.method_signature) = "project,public_advertised_prefix_resource"; + } + + // Lists the PublicAdvertisedPrefixes for a project. + rpc List(ListPublicAdvertisedPrefixesRequest) returns (PublicAdvertisedPrefixList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + rpc Patch(PatchPublicAdvertisedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}" + body: "public_advertised_prefix_resource" + }; + option (google.api.method_signature) = "project,public_advertised_prefix,public_advertised_prefix_resource"; + } + +} + +// The PublicDelegatedPrefixes API. +service PublicDelegatedPrefixes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all PublicDelegatedPrefix resources owned by the specific project across all scopes. + rpc AggregatedList(AggregatedListPublicDelegatedPrefixesRequest) returns (PublicDelegatedPrefixAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/publicDelegatedPrefixes" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified PublicDelegatedPrefix in the given region. + rpc Delete(DeletePublicDelegatedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}" + }; + option (google.api.method_signature) = "project,region,public_delegated_prefix"; + } + + // Returns the specified PublicDelegatedPrefix resource in the given region. + rpc Get(GetPublicDelegatedPrefixeRequest) returns (PublicDelegatedPrefix) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}" + }; + option (google.api.method_signature) = "project,region,public_delegated_prefix"; + } + + // Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. + rpc Insert(InsertPublicDelegatedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes" + body: "public_delegated_prefix_resource" + }; + option (google.api.method_signature) = "project,region,public_delegated_prefix_resource"; + } + + // Lists the PublicDelegatedPrefixes for a project in the given region. + rpc List(ListPublicDelegatedPrefixesRequest) returns (PublicDelegatedPrefixList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes" + }; + option (google.api.method_signature) = "project,region"; + } + + // Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + rpc Patch(PatchPublicDelegatedPrefixeRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}" + body: "public_delegated_prefix_resource" + }; + option (google.api.method_signature) = "project,region,public_delegated_prefix,public_delegated_prefix_resource"; + } + +} + +// The RegionAutoscalers API. +service RegionAutoscalers { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified autoscaler. + rpc Delete(DeleteRegionAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}" + }; + option (google.api.method_signature) = "project,region,autoscaler"; + } + + // Returns the specified autoscaler. + rpc Get(GetRegionAutoscalerRequest) returns (Autoscaler) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}" + }; + option (google.api.method_signature) = "project,region,autoscaler"; + } + + // Creates an autoscaler in the specified project using the data included in the request. + rpc Insert(InsertRegionAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/autoscalers" + body: "autoscaler_resource" + }; + option (google.api.method_signature) = "project,region,autoscaler_resource"; + } + + // Retrieves a list of autoscalers contained within the specified region. + rpc List(ListRegionAutoscalersRequest) returns (RegionAutoscalerList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/autoscalers" + }; + option (google.api.method_signature) = "project,region"; + } + + // Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchRegionAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/autoscalers" + body: "autoscaler_resource" + }; + option (google.api.method_signature) = "project,region,autoscaler_resource"; + } + + // Updates an autoscaler in the specified project using the data included in the request. + rpc Update(UpdateRegionAutoscalerRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/regions/{region}/autoscalers" + body: "autoscaler_resource" + }; + option (google.api.method_signature) = "project,region,autoscaler_resource"; + } + +} + +// The RegionBackendServices API. +service RegionBackendServices { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified regional BackendService resource. + rpc Delete(DeleteRegionBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}" + }; + option (google.api.method_signature) = "project,region,backend_service"; + } + + // Returns the specified regional BackendService resource. + rpc Get(GetRegionBackendServiceRequest) returns (BackendService) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}" + }; + option (google.api.method_signature) = "project,region,backend_service"; + } + + // Gets the most recent health check results for this regional BackendService. + rpc GetHealth(GetHealthRegionBackendServiceRequest) returns (BackendServiceGroupHealth) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}/getHealth" + body: "resource_group_reference_resource" + }; + option (google.api.method_signature) = "project,region,backend_service,resource_group_reference_resource"; + } + + // Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. + rpc Insert(InsertRegionBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/backendServices" + body: "backend_service_resource" + }; + option (google.api.method_signature) = "project,region,backend_service_resource"; + } + + // Retrieves the list of regional BackendService resources available to the specified project in the given region. + rpc List(ListRegionBackendServicesRequest) returns (BackendServiceList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/backendServices" + }; + option (google.api.method_signature) = "project,region"; + } + + // Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchRegionBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}" + body: "backend_service_resource" + }; + option (google.api.method_signature) = "project,region,backend_service,backend_service_resource"; + } + + // Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview. + rpc Update(UpdateRegionBackendServiceRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}" + body: "backend_service_resource" + }; + option (google.api.method_signature) = "project,region,backend_service,backend_service_resource"; + } + +} + +// The RegionCommitments API. +service RegionCommitments { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of commitments. + rpc AggregatedList(AggregatedListRegionCommitmentsRequest) returns (CommitmentAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/commitments" + }; + option (google.api.method_signature) = "project"; + } + + // Returns the specified commitment resource. Gets a list of available commitments by making a list() request. + rpc Get(GetRegionCommitmentRequest) returns (Commitment) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}" + }; + option (google.api.method_signature) = "project,region,commitment"; + } + + // Creates a commitment in the specified project using the data included in the request. + rpc Insert(InsertRegionCommitmentRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/commitments" + body: "commitment_resource" + }; + option (google.api.method_signature) = "project,region,commitment_resource"; + } + + // Retrieves a list of commitments contained within the specified region. + rpc List(ListRegionCommitmentsRequest) returns (CommitmentList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/commitments" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The RegionDiskTypes API. +service RegionDiskTypes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the specified regional disk type. Gets a list of available disk types by making a list() request. + rpc Get(GetRegionDiskTypeRequest) returns (DiskType) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/diskTypes/{disk_type}" + }; + option (google.api.method_signature) = "project,region,disk_type"; + } + + // Retrieves a list of regional disk types available to the specified project. + rpc List(ListRegionDiskTypesRequest) returns (RegionDiskTypeList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/diskTypes" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The RegionDisks API. +service RegionDisks { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + rpc AddResourcePolicies(AddResourcePoliciesRegionDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies" + body: "region_disks_add_resource_policies_request_resource" + }; + option (google.api.method_signature) = "project,region,disk,region_disks_add_resource_policies_request_resource"; + } + + // Creates a snapshot of this regional disk. + rpc CreateSnapshot(CreateSnapshotRegionDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/createSnapshot" + body: "snapshot_resource" + }; + option (google.api.method_signature) = "project,region,disk,snapshot_resource"; + } + + // Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + rpc Delete(DeleteRegionDiskRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/disks/{disk}" + }; + option (google.api.method_signature) = "project,region,disk"; + } + + // Returns a specified regional persistent disk. + rpc Get(GetRegionDiskRequest) returns (Disk) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/disks/{disk}" + }; + option (google.api.method_signature) = "project,region,disk"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyRegionDiskRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,region,resource"; + } + + // Creates a persistent regional disk in the specified project using the data included in the request. + rpc Insert(InsertRegionDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks" + body: "disk_resource" + }; + option (google.api.method_signature) = "project,region,disk_resource"; + } + + // Retrieves the list of persistent disks contained within the specified region. + rpc List(ListRegionDisksRequest) returns (DiskList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/disks" + }; + option (google.api.method_signature) = "project,region"; + } + + // Removes resource policies from a regional disk. + rpc RemoveResourcePolicies(RemoveResourcePoliciesRegionDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies" + body: "region_disks_remove_resource_policies_request_resource" + }; + option (google.api.method_signature) = "project,region,disk,region_disks_remove_resource_policies_request_resource"; + } + + // Resizes the specified regional persistent disk. + rpc Resize(ResizeRegionDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/resize" + body: "region_disks_resize_request_resource" + }; + option (google.api.method_signature) = "project,region,disk,region_disks_resize_request_resource"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyRegionDiskRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setIamPolicy" + body: "region_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,region_set_policy_request_resource"; + } + + // Sets the labels on the target regional disk. + rpc SetLabels(SetLabelsRegionDiskRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setLabels" + body: "region_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,region_set_labels_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsRegionDiskRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,test_permissions_request_resource"; + } + +} + +// The RegionHealthCheckServices API. +service RegionHealthCheckServices { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified regional HealthCheckService. + rpc Delete(DeleteRegionHealthCheckServiceRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}" + }; + option (google.api.method_signature) = "project,region,health_check_service"; + } + + // Returns the specified regional HealthCheckService resource. + rpc Get(GetRegionHealthCheckServiceRequest) returns (HealthCheckService) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}" + }; + option (google.api.method_signature) = "project,region,health_check_service"; + } + + // Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. + rpc Insert(InsertRegionHealthCheckServiceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/healthCheckServices" + body: "health_check_service_resource" + }; + option (google.api.method_signature) = "project,region,health_check_service_resource"; + } + + // Lists all the HealthCheckService resources that have been configured for the specified project in the given region. + rpc List(ListRegionHealthCheckServicesRequest) returns (HealthCheckServicesList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/healthCheckServices" + }; + option (google.api.method_signature) = "project,region"; + } + + // Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchRegionHealthCheckServiceRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}" + body: "health_check_service_resource" + }; + option (google.api.method_signature) = "project,region,health_check_service,health_check_service_resource"; + } + +} + +// The RegionHealthChecks API. +service RegionHealthChecks { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified HealthCheck resource. + rpc Delete(DeleteRegionHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}" + }; + option (google.api.method_signature) = "project,region,health_check"; + } + + // Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + rpc Get(GetRegionHealthCheckRequest) returns (HealthCheck) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}" + }; + option (google.api.method_signature) = "project,region,health_check"; + } + + // Creates a HealthCheck resource in the specified project using the data included in the request. + rpc Insert(InsertRegionHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/healthChecks" + body: "health_check_resource" + }; + option (google.api.method_signature) = "project,region,health_check_resource"; + } + + // Retrieves the list of HealthCheck resources available to the specified project. + rpc List(ListRegionHealthChecksRequest) returns (HealthCheckList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/healthChecks" + }; + option (google.api.method_signature) = "project,region"; + } + + // Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchRegionHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}" + body: "health_check_resource" + }; + option (google.api.method_signature) = "project,region,health_check,health_check_resource"; + } + + // Updates a HealthCheck resource in the specified project using the data included in the request. + rpc Update(UpdateRegionHealthCheckRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}" + body: "health_check_resource" + }; + option (google.api.method_signature) = "project,region,health_check,health_check_resource"; + } + +} + +// The RegionInstanceGroupManagers API. +service RegionInstanceGroupManagers { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + // + // You can specify a maximum of 1000 instances with this method per request. + rpc AbandonInstances(AbandonInstancesRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/abandonInstances" + body: "region_instance_group_managers_abandon_instances_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_managers_abandon_instances_request_resource"; + } + + // Apply updates to selected instances the managed instance group. + rpc ApplyUpdatesToInstances(ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances" + body: "region_instance_group_managers_apply_updates_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_managers_apply_updates_request_resource"; + } + + // Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + rpc CreateInstances(CreateInstancesRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/createInstances" + body: "region_instance_group_managers_create_instances_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_managers_create_instances_request_resource"; + } + + // Deletes the specified managed instance group and all of the instances in that group. + rpc Delete(DeleteRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}" + }; + option (google.api.method_signature) = "project,region,instance_group_manager"; + } + + // Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + // + // You can specify a maximum of 1000 instances with this method per request. + rpc DeleteInstances(DeleteInstancesRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deleteInstances" + body: "region_instance_group_managers_delete_instances_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_managers_delete_instances_request_resource"; + } + + // Deletes selected per-instance configs for the managed instance group. + rpc DeletePerInstanceConfigs(DeletePerInstanceConfigsRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs" + body: "region_instance_group_manager_delete_instance_config_req_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_manager_delete_instance_config_req_resource"; + } + + // Returns all of the details about the specified managed instance group. + rpc Get(GetRegionInstanceGroupManagerRequest) returns (InstanceGroupManager) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}" + }; + option (google.api.method_signature) = "project,region,instance_group_manager"; + } + + // Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + // + // A regional managed instance group can contain up to 2000 instances. + rpc Insert(InsertRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers" + body: "instance_group_manager_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager_resource"; + } + + // Retrieves the list of managed instance groups that are contained within the specified region. + rpc List(ListRegionInstanceGroupManagersRequest) returns (RegionInstanceGroupManagerList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers" + }; + option (google.api.method_signature) = "project,region"; + } + + // Lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported. + rpc ListErrors(ListErrorsRegionInstanceGroupManagersRequest) returns (RegionInstanceGroupManagersListErrorsResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listErrors" + }; + option (google.api.method_signature) = "project,region,instance_group_manager"; + } + + // Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. + rpc ListManagedInstances(ListManagedInstancesRegionInstanceGroupManagersRequest) returns (RegionInstanceGroupManagersListInstancesResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listManagedInstances" + }; + option (google.api.method_signature) = "project,region,instance_group_manager"; + } + + // Lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. + rpc ListPerInstanceConfigs(ListPerInstanceConfigsRegionInstanceGroupManagersRequest) returns (RegionInstanceGroupManagersListInstanceConfigsResp) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs" + }; + option (google.api.method_signature) = "project,region,instance_group_manager"; + } + + // Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}" + body: "instance_group_manager_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,instance_group_manager_resource"; + } + + // Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + rpc PatchPerInstanceConfigs(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs" + body: "region_instance_group_manager_patch_instance_config_req_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_manager_patch_instance_config_req_resource"; + } + + // Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + // + // You can specify a maximum of 1000 instances with this method per request. + rpc RecreateInstances(RecreateInstancesRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/recreateInstances" + body: "region_instance_group_managers_recreate_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_managers_recreate_request_resource"; + } + + // Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. + // + // The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + // + // If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + rpc Resize(ResizeRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/resize" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,size"; + } + + // Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + rpc SetInstanceTemplate(SetInstanceTemplateRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate" + body: "region_instance_group_managers_set_template_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_managers_set_template_request_resource"; + } + + // Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + rpc SetTargetPools(SetTargetPoolsRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setTargetPools" + body: "region_instance_group_managers_set_target_pools_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_managers_set_target_pools_request_resource"; + } + + // Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + rpc UpdatePerInstanceConfigs(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs" + body: "region_instance_group_manager_update_instance_config_req_resource" + }; + option (google.api.method_signature) = "project,region,instance_group_manager,region_instance_group_manager_update_instance_config_req_resource"; + } + +} + +// The RegionInstanceGroups API. +service RegionInstanceGroups { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the specified instance group resource. + rpc Get(GetRegionInstanceGroupRequest) returns (InstanceGroup) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}" + }; + option (google.api.method_signature) = "project,region,instance_group"; + } + + // Retrieves the list of instance group resources contained within the specified region. + rpc List(ListRegionInstanceGroupsRequest) returns (RegionInstanceGroupList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/instanceGroups" + }; + option (google.api.method_signature) = "project,region"; + } + + // Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported. + rpc ListInstances(ListInstancesRegionInstanceGroupsRequest) returns (RegionInstanceGroupsListInstances) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/listInstances" + body: "region_instance_groups_list_instances_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group,region_instance_groups_list_instances_request_resource"; + } + + // Sets the named ports for the specified regional instance group. + rpc SetNamedPorts(SetNamedPortsRegionInstanceGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/setNamedPorts" + body: "region_instance_groups_set_named_ports_request_resource" + }; + option (google.api.method_signature) = "project,region,instance_group,region_instance_groups_set_named_ports_request_resource"; + } + +} + +// The RegionInstances API. +service RegionInstances { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates multiple instances in a given region. Count specifies the number of instances to create. + rpc BulkInsert(BulkInsertRegionInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/instances/bulkInsert" + body: "bulk_insert_instance_resource_resource" + }; + option (google.api.method_signature) = "project,region,bulk_insert_instance_resource_resource"; + } + +} + +// The RegionNetworkEndpointGroups API. +service RegionNetworkEndpointGroups { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service. + rpc Delete(DeleteRegionNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}" + }; + option (google.api.method_signature) = "project,region,network_endpoint_group"; + } + + // Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + rpc Get(GetRegionNetworkEndpointGroupRequest) returns (NetworkEndpointGroup) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}" + }; + option (google.api.method_signature) = "project,region,network_endpoint_group"; + } + + // Creates a network endpoint group in the specified project using the parameters that are included in the request. + rpc Insert(InsertRegionNetworkEndpointGroupRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups" + body: "network_endpoint_group_resource" + }; + option (google.api.method_signature) = "project,region,network_endpoint_group_resource"; + } + + // Retrieves the list of regional network endpoint groups available to the specified project in the given region. + rpc List(ListRegionNetworkEndpointGroupsRequest) returns (NetworkEndpointGroupList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The RegionNotificationEndpoints API. +service RegionNotificationEndpoints { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified NotificationEndpoint in the given region + rpc Delete(DeleteRegionNotificationEndpointRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}" + }; + option (google.api.method_signature) = "project,region,notification_endpoint"; + } + + // Returns the specified NotificationEndpoint resource in the given region. + rpc Get(GetRegionNotificationEndpointRequest) returns (NotificationEndpoint) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}" + }; + option (google.api.method_signature) = "project,region,notification_endpoint"; + } + + // Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. + rpc Insert(InsertRegionNotificationEndpointRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints" + body: "notification_endpoint_resource" + }; + option (google.api.method_signature) = "project,region,notification_endpoint_resource"; + } + + // Lists the NotificationEndpoints for a project in the given region. + rpc List(ListRegionNotificationEndpointsRequest) returns (NotificationEndpointList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The RegionOperations API. +service RegionOperations { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified region-specific Operations resource. + rpc Delete(DeleteRegionOperationRequest) returns (DeleteRegionOperationResponse) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/operations/{operation}" + }; + option (google.api.method_signature) = "project,region,operation"; + } + + // Retrieves the specified region-specific Operations resource. + rpc Get(GetRegionOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/operations/{operation}" + }; + option (google.api.method_signature) = "project,region,operation"; + } + + // Retrieves a list of Operation resources contained within the specified region. + rpc List(ListRegionOperationsRequest) returns (OperationList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/operations" + }; + option (google.api.method_signature) = "project,region"; + } + + // Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + // + // This method is called on a best-effort basis. Specifically: + // - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + // - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + rpc Wait(WaitRegionOperationRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/operations/{operation}/wait" + }; + option (google.api.method_signature) = "project,region,operation"; + } + +} + +// The RegionSslCertificates API. +service RegionSslCertificates { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified SslCertificate resource in the region. + rpc Delete(DeleteRegionSslCertificateRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}" + }; + option (google.api.method_signature) = "project,region,ssl_certificate"; + } + + // Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + rpc Get(GetRegionSslCertificateRequest) returns (SslCertificate) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}" + }; + option (google.api.method_signature) = "project,region,ssl_certificate"; + } + + // Creates a SslCertificate resource in the specified project and region using the data included in the request + rpc Insert(InsertRegionSslCertificateRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/sslCertificates" + body: "ssl_certificate_resource" + }; + option (google.api.method_signature) = "project,region,ssl_certificate_resource"; + } + + // Retrieves the list of SslCertificate resources available to the specified project in the specified region. + rpc List(ListRegionSslCertificatesRequest) returns (SslCertificateList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/sslCertificates" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The RegionTargetHttpProxies API. +service RegionTargetHttpProxies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified TargetHttpProxy resource. + rpc Delete(DeleteRegionTargetHttpProxyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}" + }; + option (google.api.method_signature) = "project,region,target_http_proxy"; + } + + // Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + rpc Get(GetRegionTargetHttpProxyRequest) returns (TargetHttpProxy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}" + }; + option (google.api.method_signature) = "project,region,target_http_proxy"; + } + + // Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + rpc Insert(InsertRegionTargetHttpProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies" + body: "target_http_proxy_resource" + }; + option (google.api.method_signature) = "project,region,target_http_proxy_resource"; + } + + // Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. + rpc List(ListRegionTargetHttpProxiesRequest) returns (TargetHttpProxyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies" + }; + option (google.api.method_signature) = "project,region"; + } + + // Changes the URL map for TargetHttpProxy. + rpc SetUrlMap(SetUrlMapRegionTargetHttpProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}/setUrlMap" + body: "url_map_reference_resource" + }; + option (google.api.method_signature) = "project,region,target_http_proxy,url_map_reference_resource"; + } + +} + +// The RegionTargetHttpsProxies API. +service RegionTargetHttpsProxies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified TargetHttpsProxy resource. + rpc Delete(DeleteRegionTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}" + }; + option (google.api.method_signature) = "project,region,target_https_proxy"; + } + + // Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + rpc Get(GetRegionTargetHttpsProxyRequest) returns (TargetHttpsProxy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}" + }; + option (google.api.method_signature) = "project,region,target_https_proxy"; + } + + // Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + rpc Insert(InsertRegionTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies" + body: "target_https_proxy_resource" + }; + option (google.api.method_signature) = "project,region,target_https_proxy_resource"; + } + + // Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. + rpc List(ListRegionTargetHttpsProxiesRequest) returns (TargetHttpsProxyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies" + }; + option (google.api.method_signature) = "project,region"; + } + + // Replaces SslCertificates for TargetHttpsProxy. + rpc SetSslCertificates(SetSslCertificatesRegionTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setSslCertificates" + body: "region_target_https_proxies_set_ssl_certificates_request_resource" + }; + option (google.api.method_signature) = "project,region,target_https_proxy,region_target_https_proxies_set_ssl_certificates_request_resource"; + } + + // Changes the URL map for TargetHttpsProxy. + rpc SetUrlMap(SetUrlMapRegionTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setUrlMap" + body: "url_map_reference_resource" + }; + option (google.api.method_signature) = "project,region,target_https_proxy,url_map_reference_resource"; + } + +} + +// The RegionUrlMaps API. +service RegionUrlMaps { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified UrlMap resource. + rpc Delete(DeleteRegionUrlMapRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}" + }; + option (google.api.method_signature) = "project,region,url_map"; + } + + // Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + rpc Get(GetRegionUrlMapRequest) returns (UrlMap) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}" + }; + option (google.api.method_signature) = "project,region,url_map"; + } + + // Creates a UrlMap resource in the specified project using the data included in the request. + rpc Insert(InsertRegionUrlMapRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/urlMaps" + body: "url_map_resource" + }; + option (google.api.method_signature) = "project,region,url_map_resource"; + } + + // Retrieves the list of UrlMap resources available to the specified project in the specified region. + rpc List(ListRegionUrlMapsRequest) returns (UrlMapList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/urlMaps" + }; + option (google.api.method_signature) = "project,region"; + } + + // Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + rpc Patch(PatchRegionUrlMapRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}" + body: "url_map_resource" + }; + option (google.api.method_signature) = "project,region,url_map,url_map_resource"; + } + + // Updates the specified UrlMap resource with the data included in the request. + rpc Update(UpdateRegionUrlMapRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}" + body: "url_map_resource" + }; + option (google.api.method_signature) = "project,region,url_map,url_map_resource"; + } + + // Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + rpc Validate(ValidateRegionUrlMapRequest) returns (UrlMapsValidateResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}/validate" + body: "region_url_maps_validate_request_resource" + }; + option (google.api.method_signature) = "project,region,url_map,region_url_maps_validate_request_resource"; + } + +} + +// The Regions API. +service Regions { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the specified Region resource. Gets a list of available regions by making a list() request. + rpc Get(GetRegionRequest) returns (Region) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}" + }; + option (google.api.method_signature) = "project,region"; + } + + // Retrieves the list of region resources available to the specified project. + rpc List(ListRegionsRequest) returns (RegionList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions" + }; + option (google.api.method_signature) = "project"; + } + +} + +// The Reservations API. +service Reservations { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of reservations. + rpc AggregatedList(AggregatedListReservationsRequest) returns (ReservationAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/reservations" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified reservation. + rpc Delete(DeleteReservationRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}" + }; + option (google.api.method_signature) = "project,zone,reservation"; + } + + // Retrieves information about the specified reservation. + rpc Get(GetReservationRequest) returns (Reservation) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}" + }; + option (google.api.method_signature) = "project,zone,reservation"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyReservationRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,zone,resource"; + } + + // Creates a new reservation. For more information, read Reserving zonal resources. + rpc Insert(InsertReservationRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/reservations" + body: "reservation_resource" + }; + option (google.api.method_signature) = "project,zone,reservation_resource"; + } + + // A list of all the reservations that have been configured for the specified project in specified zone. + rpc List(ListReservationsRequest) returns (ReservationList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/reservations" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. + rpc Resize(ResizeReservationRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}/resize" + body: "reservations_resize_request_resource" + }; + option (google.api.method_signature) = "project,zone,reservation,reservations_resize_request_resource"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyReservationRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/setIamPolicy" + body: "zone_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,zone_set_policy_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsReservationRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,zone,resource,test_permissions_request_resource"; + } + +} + +// The ResourcePolicies API. +service ResourcePolicies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of resource policies. + rpc AggregatedList(AggregatedListResourcePoliciesRequest) returns (ResourcePolicyAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/resourcePolicies" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified resource policy. + rpc Delete(DeleteResourcePolicyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}" + }; + option (google.api.method_signature) = "project,region,resource_policy"; + } + + // Retrieves all information of the specified resource policy. + rpc Get(GetResourcePolicyRequest) returns (ResourcePolicy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}" + }; + option (google.api.method_signature) = "project,region,resource_policy"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicyResourcePolicyRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,region,resource"; + } + + // Creates a new resource policy. + rpc Insert(InsertResourcePolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies" + body: "resource_policy_resource" + }; + option (google.api.method_signature) = "project,region,resource_policy_resource"; + } + + // A list all the resource policies that have been configured for the specified project in specified region. + rpc List(ListResourcePoliciesRequest) returns (ResourcePolicyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies" + }; + option (google.api.method_signature) = "project,region"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicyResourcePolicyRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy" + body: "region_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,region_set_policy_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsResourcePolicyRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,test_permissions_request_resource"; + } + +} + +// The Routers API. +service Routers { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of routers. + rpc AggregatedList(AggregatedListRoutersRequest) returns (RouterAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/routers" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified Router resource. + rpc Delete(DeleteRouterRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/routers/{router}" + }; + option (google.api.method_signature) = "project,region,router"; + } + + // Returns the specified Router resource. Gets a list of available routers by making a list() request. + rpc Get(GetRouterRequest) returns (Router) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/routers/{router}" + }; + option (google.api.method_signature) = "project,region,router"; + } + + // Retrieves runtime Nat mapping information of VM endpoints. + rpc GetNatMappingInfo(GetNatMappingInfoRoutersRequest) returns (VmEndpointNatMappingsList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo" + }; + option (google.api.method_signature) = "project,region,router"; + } + + // Retrieves runtime information of the specified router. + rpc GetRouterStatus(GetRouterStatusRouterRequest) returns (RouterStatusResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getRouterStatus" + }; + option (google.api.method_signature) = "project,region,router"; + } + + // Creates a Router resource in the specified project and region using the data included in the request. + rpc Insert(InsertRouterRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/routers" + body: "router_resource" + }; + option (google.api.method_signature) = "project,region,router_resource"; + } + + // Retrieves a list of Router resources available to the specified project. + rpc List(ListRoutersRequest) returns (RouterList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/routers" + }; + option (google.api.method_signature) = "project,region"; + } + + // Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + rpc Patch(PatchRouterRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/routers/{router}" + body: "router_resource" + }; + option (google.api.method_signature) = "project,region,router,router_resource"; + } + + // Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + rpc Preview(PreviewRouterRequest) returns (RoutersPreviewResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/preview" + body: "router_resource" + }; + option (google.api.method_signature) = "project,region,router,router_resource"; + } + + // Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. + rpc Update(UpdateRouterRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/regions/{region}/routers/{router}" + body: "router_resource" + }; + option (google.api.method_signature) = "project,region,router,router_resource"; + } + +} + +// The Routes API. +service Routes { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified Route resource. + rpc Delete(DeleteRouteRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/routes/{route}" + }; + option (google.api.method_signature) = "project,route"; + } + + // Returns the specified Route resource. Gets a list of available routes by making a list() request. + rpc Get(GetRouteRequest) returns (Route) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/routes/{route}" + }; + option (google.api.method_signature) = "project,route"; + } + + // Creates a Route resource in the specified project using the data included in the request. + rpc Insert(InsertRouteRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/routes" + body: "route_resource" + }; + option (google.api.method_signature) = "project,route_resource"; + } + + // Retrieves the list of Route resources available to the specified project. + rpc List(ListRoutesRequest) returns (RouteList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/routes" + }; + option (google.api.method_signature) = "project"; + } + +} + +// The SecurityPolicies API. +service SecurityPolicies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Inserts a rule into a security policy. + rpc AddRule(AddRuleSecurityPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/addRule" + body: "security_policy_rule_resource" + }; + option (google.api.method_signature) = "project,security_policy,security_policy_rule_resource"; + } + + // Deletes the specified policy. + rpc Delete(DeleteSecurityPolicyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}" + }; + option (google.api.method_signature) = "project,security_policy"; + } + + // List all of the ordered rules present in a single specified policy. + rpc Get(GetSecurityPolicyRequest) returns (SecurityPolicy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}" + }; + option (google.api.method_signature) = "project,security_policy"; + } + + // Gets a rule at the specified priority. + rpc GetRule(GetRuleSecurityPolicyRequest) returns (SecurityPolicyRule) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/getRule" + }; + option (google.api.method_signature) = "project,security_policy"; + } + + // Creates a new policy in the specified project using the data included in the request. + rpc Insert(InsertSecurityPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/securityPolicies" + body: "security_policy_resource" + }; + option (google.api.method_signature) = "project,security_policy_resource"; + } + + // List all the policies that have been configured for the specified project. + rpc List(ListSecurityPoliciesRequest) returns (SecurityPolicyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/securityPolicies" + }; + option (google.api.method_signature) = "project"; + } + + // Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + rpc ListPreconfiguredExpressionSets(ListPreconfiguredExpressionSetsSecurityPoliciesRequest) returns (SecurityPoliciesListPreconfiguredExpressionSetsResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. + rpc Patch(PatchSecurityPolicyRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}" + body: "security_policy_resource" + }; + option (google.api.method_signature) = "project,security_policy,security_policy_resource"; + } + + // Patches a rule at the specified priority. + rpc PatchRule(PatchRuleSecurityPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/patchRule" + body: "security_policy_rule_resource" + }; + option (google.api.method_signature) = "project,security_policy,security_policy_rule_resource"; + } + + // Deletes a rule at the specified priority. + rpc RemoveRule(RemoveRuleSecurityPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/removeRule" + }; + option (google.api.method_signature) = "project,security_policy"; + } + +} + +// The Snapshots API. +service Snapshots { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + // + // For more information, see Deleting snapshots. + rpc Delete(DeleteSnapshotRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/snapshots/{snapshot}" + }; + option (google.api.method_signature) = "project,snapshot"; + } + + // Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. + rpc Get(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/snapshots/{snapshot}" + }; + option (google.api.method_signature) = "project,snapshot"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicySnapshotRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/snapshots/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,resource"; + } + + // Retrieves the list of Snapshot resources contained within the specified project. + rpc List(ListSnapshotsRequest) returns (SnapshotList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/snapshots" + }; + option (google.api.method_signature) = "project"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicySnapshotRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/snapshots/{resource}/setIamPolicy" + body: "global_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_policy_request_resource"; + } + + // Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsSnapshotRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/snapshots/{resource}/setLabels" + body: "global_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,resource,global_set_labels_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsSnapshotRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/snapshots/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,resource,test_permissions_request_resource"; + } + +} + +// The SslCertificates API. +service SslCertificates { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the list of all SslCertificate resources, regional and global, available to the specified project. + rpc AggregatedList(AggregatedListSslCertificatesRequest) returns (SslCertificateAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/sslCertificates" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified SslCertificate resource. + rpc Delete(DeleteSslCertificateRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}" + }; + option (google.api.method_signature) = "project,ssl_certificate"; + } + + // Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. + rpc Get(GetSslCertificateRequest) returns (SslCertificate) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}" + }; + option (google.api.method_signature) = "project,ssl_certificate"; + } + + // Creates a SslCertificate resource in the specified project using the data included in the request. + rpc Insert(InsertSslCertificateRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/sslCertificates" + body: "ssl_certificate_resource" + }; + option (google.api.method_signature) = "project,ssl_certificate_resource"; + } + + // Retrieves the list of SslCertificate resources available to the specified project. + rpc List(ListSslCertificatesRequest) returns (SslCertificateList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/sslCertificates" + }; + option (google.api.method_signature) = "project"; + } + +} + +// The SslPolicies API. +service SslPolicies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + rpc Delete(DeleteSslPolicyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}" + }; + option (google.api.method_signature) = "project,ssl_policy"; + } + + // Lists all of the ordered rules present in a single specified policy. + rpc Get(GetSslPolicyRequest) returns (SslPolicy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}" + }; + option (google.api.method_signature) = "project,ssl_policy"; + } + + // Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. + rpc Insert(InsertSslPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/sslPolicies" + body: "ssl_policy_resource" + }; + option (google.api.method_signature) = "project,ssl_policy_resource"; + } + + // Lists all the SSL policies that have been configured for the specified project. + rpc List(ListSslPoliciesRequest) returns (SslPoliciesList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/sslPolicies" + }; + option (google.api.method_signature) = "project"; + } + + // Lists all features that can be specified in the SSL policy when using custom profile. + rpc ListAvailableFeatures(ListAvailableFeaturesSslPoliciesRequest) returns (SslPoliciesListAvailableFeaturesResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/sslPolicies/listAvailableFeatures" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified SSL policy with the data included in the request. + rpc Patch(PatchSslPolicyRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}" + body: "ssl_policy_resource" + }; + option (google.api.method_signature) = "project,ssl_policy,ssl_policy_resource"; + } + +} + +// The Subnetworks API. +service Subnetworks { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of subnetworks. + rpc AggregatedList(AggregatedListSubnetworksRequest) returns (SubnetworkAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/subnetworks" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified subnetwork. + rpc Delete(DeleteSubnetworkRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}" + }; + option (google.api.method_signature) = "project,region,subnetwork"; + } + + // Expands the IP CIDR range of the subnetwork to a specified value. + rpc ExpandIpCidrRange(ExpandIpCidrRangeSubnetworkRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange" + body: "subnetworks_expand_ip_cidr_range_request_resource" + }; + option (google.api.method_signature) = "project,region,subnetwork,subnetworks_expand_ip_cidr_range_request_resource"; + } + + // Returns the specified subnetwork. Gets a list of available subnetworks list() request. + rpc Get(GetSubnetworkRequest) returns (Subnetwork) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}" + }; + option (google.api.method_signature) = "project,region,subnetwork"; + } + + // Gets the access control policy for a resource. May be empty if no such policy or resource exists. + rpc GetIamPolicy(GetIamPolicySubnetworkRequest) returns (Policy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy" + }; + option (google.api.method_signature) = "project,region,resource"; + } + + // Creates a subnetwork in the specified project using the data included in the request. + rpc Insert(InsertSubnetworkRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/subnetworks" + body: "subnetwork_resource" + }; + option (google.api.method_signature) = "project,region,subnetwork_resource"; + } + + // Retrieves a list of subnetworks available to the specified project. + rpc List(ListSubnetworksRequest) returns (SubnetworkList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/subnetworks" + }; + option (google.api.method_signature) = "project,region"; + } + + // Retrieves an aggregated list of all usable subnetworks in the project. + rpc ListUsable(ListUsableSubnetworksRequest) returns (UsableSubnetworksAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/subnetworks/listUsable" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. + rpc Patch(PatchSubnetworkRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}" + body: "subnetwork_resource" + }; + option (google.api.method_signature) = "project,region,subnetwork,subnetwork_resource"; + } + + // Sets the access control policy on the specified resource. Replaces any existing policy. + rpc SetIamPolicy(SetIamPolicySubnetworkRequest) returns (Policy) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy" + body: "region_set_policy_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,region_set_policy_request_resource"; + } + + // Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + rpc SetPrivateIpGoogleAccess(SetPrivateIpGoogleAccessSubnetworkRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess" + body: "subnetworks_set_private_ip_google_access_request_resource" + }; + option (google.api.method_signature) = "project,region,subnetwork,subnetworks_set_private_ip_google_access_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsSubnetworkRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,test_permissions_request_resource"; + } + +} + +// The TargetGrpcProxies API. +service TargetGrpcProxies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified TargetGrpcProxy in the given scope + rpc Delete(DeleteTargetGrpcProxyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}" + }; + option (google.api.method_signature) = "project,target_grpc_proxy"; + } + + // Returns the specified TargetGrpcProxy resource in the given scope. + rpc Get(GetTargetGrpcProxyRequest) returns (TargetGrpcProxy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}" + }; + option (google.api.method_signature) = "project,target_grpc_proxy"; + } + + // Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. + rpc Insert(InsertTargetGrpcProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetGrpcProxies" + body: "target_grpc_proxy_resource" + }; + option (google.api.method_signature) = "project,target_grpc_proxy_resource"; + } + + // Lists the TargetGrpcProxies for a project in the given scope. + rpc List(ListTargetGrpcProxiesRequest) returns (TargetGrpcProxyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetGrpcProxies" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + rpc Patch(PatchTargetGrpcProxyRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}" + body: "target_grpc_proxy_resource" + }; + option (google.api.method_signature) = "project,target_grpc_proxy,target_grpc_proxy_resource"; + } + +} + +// The TargetHttpProxies API. +service TargetHttpProxies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the list of all TargetHttpProxy resources, regional and global, available to the specified project. + rpc AggregatedList(AggregatedListTargetHttpProxiesRequest) returns (TargetHttpProxyAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/targetHttpProxies" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified TargetHttpProxy resource. + rpc Delete(DeleteTargetHttpProxyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}" + }; + option (google.api.method_signature) = "project,target_http_proxy"; + } + + // Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. + rpc Get(GetTargetHttpProxyRequest) returns (TargetHttpProxy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}" + }; + option (google.api.method_signature) = "project,target_http_proxy"; + } + + // Creates a TargetHttpProxy resource in the specified project using the data included in the request. + rpc Insert(InsertTargetHttpProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetHttpProxies" + body: "target_http_proxy_resource" + }; + option (google.api.method_signature) = "project,target_http_proxy_resource"; + } + + // Retrieves the list of TargetHttpProxy resources available to the specified project. + rpc List(ListTargetHttpProxiesRequest) returns (TargetHttpProxyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetHttpProxies" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) + rpc Patch(PatchTargetHttpProxyRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}" + body: "target_http_proxy_resource" + }; + option (google.api.method_signature) = "project,target_http_proxy,target_http_proxy_resource"; + } + + // Changes the URL map for TargetHttpProxy. + rpc SetUrlMap(SetUrlMapTargetHttpProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/targetHttpProxies/{target_http_proxy}/setUrlMap" + body: "url_map_reference_resource" + }; + option (google.api.method_signature) = "project,target_http_proxy,url_map_reference_resource"; + } + +} + +// The TargetHttpsProxies API. +service TargetHttpsProxies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the list of all TargetHttpsProxy resources, regional and global, available to the specified project. + rpc AggregatedList(AggregatedListTargetHttpsProxiesRequest) returns (TargetHttpsProxyAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/targetHttpsProxies" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified TargetHttpsProxy resource. + rpc Delete(DeleteTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}" + }; + option (google.api.method_signature) = "project,target_https_proxy"; + } + + // Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. + rpc Get(GetTargetHttpsProxyRequest) returns (TargetHttpsProxy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}" + }; + option (google.api.method_signature) = "project,target_https_proxy"; + } + + // Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + rpc Insert(InsertTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetHttpsProxies" + body: "target_https_proxy_resource" + }; + option (google.api.method_signature) = "project,target_https_proxy_resource"; + } + + // Retrieves the list of TargetHttpsProxy resources available to the specified project. + rpc List(ListTargetHttpsProxiesRequest) returns (TargetHttpsProxyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetHttpsProxies" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) + rpc Patch(PatchTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}" + body: "target_https_proxy_resource" + }; + option (google.api.method_signature) = "project,target_https_proxy,target_https_proxy_resource"; + } + + // Sets the QUIC override policy for TargetHttpsProxy. + rpc SetQuicOverride(SetQuicOverrideTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride" + body: "target_https_proxies_set_quic_override_request_resource" + }; + option (google.api.method_signature) = "project,target_https_proxy,target_https_proxies_set_quic_override_request_resource"; + } + + // Replaces SslCertificates for TargetHttpsProxy. + rpc SetSslCertificates(SetSslCertificatesTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates" + body: "target_https_proxies_set_ssl_certificates_request_resource" + }; + option (google.api.method_signature) = "project,target_https_proxy,target_https_proxies_set_ssl_certificates_request_resource"; + } + + // Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. + rpc SetSslPolicy(SetSslPolicyTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setSslPolicy" + body: "ssl_policy_reference_resource" + }; + option (google.api.method_signature) = "project,target_https_proxy,ssl_policy_reference_resource"; + } + + // Changes the URL map for TargetHttpsProxy. + rpc SetUrlMap(SetUrlMapTargetHttpsProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setUrlMap" + body: "url_map_reference_resource" + }; + option (google.api.method_signature) = "project,target_https_proxy,url_map_reference_resource"; + } + +} + +// The TargetInstances API. +service TargetInstances { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of target instances. + rpc AggregatedList(AggregatedListTargetInstancesRequest) returns (TargetInstanceAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/targetInstances" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified TargetInstance resource. + rpc Delete(DeleteTargetInstanceRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}" + }; + option (google.api.method_signature) = "project,zone,target_instance"; + } + + // Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. + rpc Get(GetTargetInstanceRequest) returns (TargetInstance) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}" + }; + option (google.api.method_signature) = "project,zone,target_instance"; + } + + // Creates a TargetInstance resource in the specified project and zone using the data included in the request. + rpc Insert(InsertTargetInstanceRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/targetInstances" + body: "target_instance_resource" + }; + option (google.api.method_signature) = "project,zone,target_instance_resource"; + } + + // Retrieves a list of TargetInstance resources available to the specified project and zone. + rpc List(ListTargetInstancesRequest) returns (TargetInstanceList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/targetInstances" + }; + option (google.api.method_signature) = "project,zone"; + } + +} + +// The TargetPools API. +service TargetPools { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Adds health check URLs to a target pool. + rpc AddHealthCheck(AddHealthCheckTargetPoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addHealthCheck" + body: "target_pools_add_health_check_request_resource" + }; + option (google.api.method_signature) = "project,region,target_pool,target_pools_add_health_check_request_resource"; + } + + // Adds an instance to a target pool. + rpc AddInstance(AddInstanceTargetPoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addInstance" + body: "target_pools_add_instance_request_resource" + }; + option (google.api.method_signature) = "project,region,target_pool,target_pools_add_instance_request_resource"; + } + + // Retrieves an aggregated list of target pools. + rpc AggregatedList(AggregatedListTargetPoolsRequest) returns (TargetPoolAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/targetPools" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified target pool. + rpc Delete(DeleteTargetPoolRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}" + }; + option (google.api.method_signature) = "project,region,target_pool"; + } + + // Returns the specified target pool. Gets a list of available target pools by making a list() request. + rpc Get(GetTargetPoolRequest) returns (TargetPool) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}" + }; + option (google.api.method_signature) = "project,region,target_pool"; + } + + // Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + rpc GetHealth(GetHealthTargetPoolRequest) returns (TargetPoolInstanceHealth) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/getHealth" + body: "instance_reference_resource" + }; + option (google.api.method_signature) = "project,region,target_pool,instance_reference_resource"; + } + + // Creates a target pool in the specified project and region using the data included in the request. + rpc Insert(InsertTargetPoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetPools" + body: "target_pool_resource" + }; + option (google.api.method_signature) = "project,region,target_pool_resource"; + } + + // Retrieves a list of target pools available to the specified project and region. + rpc List(ListTargetPoolsRequest) returns (TargetPoolList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetPools" + }; + option (google.api.method_signature) = "project,region"; + } + + // Removes health check URL from a target pool. + rpc RemoveHealthCheck(RemoveHealthCheckTargetPoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeHealthCheck" + body: "target_pools_remove_health_check_request_resource" + }; + option (google.api.method_signature) = "project,region,target_pool,target_pools_remove_health_check_request_resource"; + } + + // Removes instance URL from a target pool. + rpc RemoveInstance(RemoveInstanceTargetPoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeInstance" + body: "target_pools_remove_instance_request_resource" + }; + option (google.api.method_signature) = "project,region,target_pool,target_pools_remove_instance_request_resource"; + } + + // Changes a backup target pool's configurations. + rpc SetBackup(SetBackupTargetPoolRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/setBackup" + body: "target_reference_resource" + }; + option (google.api.method_signature) = "project,region,target_pool,target_reference_resource"; + } + +} + +// The TargetSslProxies API. +service TargetSslProxies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified TargetSslProxy resource. + rpc Delete(DeleteTargetSslProxyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}" + }; + option (google.api.method_signature) = "project,target_ssl_proxy"; + } + + // Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. + rpc Get(GetTargetSslProxyRequest) returns (TargetSslProxy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}" + }; + option (google.api.method_signature) = "project,target_ssl_proxy"; + } + + // Creates a TargetSslProxy resource in the specified project using the data included in the request. + rpc Insert(InsertTargetSslProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetSslProxies" + body: "target_ssl_proxy_resource" + }; + option (google.api.method_signature) = "project,target_ssl_proxy_resource"; + } + + // Retrieves the list of TargetSslProxy resources available to the specified project. + rpc List(ListTargetSslProxiesRequest) returns (TargetSslProxyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetSslProxies" + }; + option (google.api.method_signature) = "project"; + } + + // Changes the BackendService for TargetSslProxy. + rpc SetBackendService(SetBackendServiceTargetSslProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setBackendService" + body: "target_ssl_proxies_set_backend_service_request_resource" + }; + option (google.api.method_signature) = "project,target_ssl_proxy,target_ssl_proxies_set_backend_service_request_resource"; + } + + // Changes the ProxyHeaderType for TargetSslProxy. + rpc SetProxyHeader(SetProxyHeaderTargetSslProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader" + body: "target_ssl_proxies_set_proxy_header_request_resource" + }; + option (google.api.method_signature) = "project,target_ssl_proxy,target_ssl_proxies_set_proxy_header_request_resource"; + } + + // Changes SslCertificates for TargetSslProxy. + rpc SetSslCertificates(SetSslCertificatesTargetSslProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates" + body: "target_ssl_proxies_set_ssl_certificates_request_resource" + }; + option (google.api.method_signature) = "project,target_ssl_proxy,target_ssl_proxies_set_ssl_certificates_request_resource"; + } + + // Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. + rpc SetSslPolicy(SetSslPolicyTargetSslProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslPolicy" + body: "ssl_policy_reference_resource" + }; + option (google.api.method_signature) = "project,target_ssl_proxy,ssl_policy_reference_resource"; + } + +} + +// The TargetTcpProxies API. +service TargetTcpProxies { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified TargetTcpProxy resource. + rpc Delete(DeleteTargetTcpProxyRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}" + }; + option (google.api.method_signature) = "project,target_tcp_proxy"; + } + + // Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. + rpc Get(GetTargetTcpProxyRequest) returns (TargetTcpProxy) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}" + }; + option (google.api.method_signature) = "project,target_tcp_proxy"; + } + + // Creates a TargetTcpProxy resource in the specified project using the data included in the request. + rpc Insert(InsertTargetTcpProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetTcpProxies" + body: "target_tcp_proxy_resource" + }; + option (google.api.method_signature) = "project,target_tcp_proxy_resource"; + } + + // Retrieves the list of TargetTcpProxy resources available to the specified project. + rpc List(ListTargetTcpProxiesRequest) returns (TargetTcpProxyList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/targetTcpProxies" + }; + option (google.api.method_signature) = "project"; + } + + // Changes the BackendService for TargetTcpProxy. + rpc SetBackendService(SetBackendServiceTargetTcpProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setBackendService" + body: "target_tcp_proxies_set_backend_service_request_resource" + }; + option (google.api.method_signature) = "project,target_tcp_proxy,target_tcp_proxies_set_backend_service_request_resource"; + } + + // Changes the ProxyHeaderType for TargetTcpProxy. + rpc SetProxyHeader(SetProxyHeaderTargetTcpProxyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setProxyHeader" + body: "target_tcp_proxies_set_proxy_header_request_resource" + }; + option (google.api.method_signature) = "project,target_tcp_proxy,target_tcp_proxies_set_proxy_header_request_resource"; + } + +} + +// The TargetVpnGateways API. +service TargetVpnGateways { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of target VPN gateways. + rpc AggregatedList(AggregatedListTargetVpnGatewaysRequest) returns (TargetVpnGatewayAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/targetVpnGateways" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified target VPN gateway. + rpc Delete(DeleteTargetVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}" + }; + option (google.api.method_signature) = "project,region,target_vpn_gateway"; + } + + // Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. + rpc Get(GetTargetVpnGatewayRequest) returns (TargetVpnGateway) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}" + }; + option (google.api.method_signature) = "project,region,target_vpn_gateway"; + } + + // Creates a target VPN gateway in the specified project and region using the data included in the request. + rpc Insert(InsertTargetVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways" + body: "target_vpn_gateway_resource" + }; + option (google.api.method_signature) = "project,region,target_vpn_gateway_resource"; + } + + // Retrieves a list of target VPN gateways available to the specified project and region. + rpc List(ListTargetVpnGatewaysRequest) returns (TargetVpnGatewayList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The UrlMaps API. +service UrlMaps { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves the list of all UrlMap resources, regional and global, available to the specified project. + rpc AggregatedList(AggregatedListUrlMapsRequest) returns (UrlMapsAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/urlMaps" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified UrlMap resource. + rpc Delete(DeleteUrlMapRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/global/urlMaps/{url_map}" + }; + option (google.api.method_signature) = "project,url_map"; + } + + // Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + rpc Get(GetUrlMapRequest) returns (UrlMap) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/urlMaps/{url_map}" + }; + option (google.api.method_signature) = "project,url_map"; + } + + // Creates a UrlMap resource in the specified project using the data included in the request. + rpc Insert(InsertUrlMapRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/urlMaps" + body: "url_map_resource" + }; + option (google.api.method_signature) = "project,url_map_resource"; + } + + // Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + // + // For more information, see [Invalidating cached content](/cdn/docs/invalidating-cached-content). + rpc InvalidateCache(InvalidateCacheUrlMapRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/urlMaps/{url_map}/invalidateCache" + body: "cache_invalidation_rule_resource" + }; + option (google.api.method_signature) = "project,url_map,cache_invalidation_rule_resource"; + } + + // Retrieves the list of UrlMap resources available to the specified project. + rpc List(ListUrlMapsRequest) returns (UrlMapList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/urlMaps" + }; + option (google.api.method_signature) = "project"; + } + + // Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + rpc Patch(PatchUrlMapRequest) returns (Operation) { + option (google.api.http) = { + patch: "/compute/v1/projects/{project}/global/urlMaps/{url_map}" + body: "url_map_resource" + }; + option (google.api.method_signature) = "project,url_map,url_map_resource"; + } + + // Updates the specified UrlMap resource with the data included in the request. + rpc Update(UpdateUrlMapRequest) returns (Operation) { + option (google.api.http) = { + put: "/compute/v1/projects/{project}/global/urlMaps/{url_map}" + body: "url_map_resource" + }; + option (google.api.method_signature) = "project,url_map,url_map_resource"; + } + + // Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + rpc Validate(ValidateUrlMapRequest) returns (UrlMapsValidateResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/urlMaps/{url_map}/validate" + body: "url_maps_validate_request_resource" + }; + option (google.api.method_signature) = "project,url_map,url_maps_validate_request_resource"; + } + +} + +// The VpnGateways API. +service VpnGateways { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of VPN gateways. + rpc AggregatedList(AggregatedListVpnGatewaysRequest) returns (VpnGatewayAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/vpnGateways" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified VPN gateway. + rpc Delete(DeleteVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}" + }; + option (google.api.method_signature) = "project,region,vpn_gateway"; + } + + // Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + rpc Get(GetVpnGatewayRequest) returns (VpnGateway) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}" + }; + option (google.api.method_signature) = "project,region,vpn_gateway"; + } + + // Returns the status for the specified VPN gateway. + rpc GetStatus(GetStatusVpnGatewayRequest) returns (VpnGatewaysGetStatusResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}/getStatus" + }; + option (google.api.method_signature) = "project,region,vpn_gateway"; + } + + // Creates a VPN gateway in the specified project and region using the data included in the request. + rpc Insert(InsertVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/vpnGateways" + body: "vpn_gateway_resource" + }; + option (google.api.method_signature) = "project,region,vpn_gateway_resource"; + } + + // Retrieves a list of VPN gateways available to the specified project and region. + rpc List(ListVpnGatewaysRequest) returns (VpnGatewayList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/vpnGateways" + }; + option (google.api.method_signature) = "project,region"; + } + + // Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + rpc SetLabels(SetLabelsVpnGatewayRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/setLabels" + body: "region_set_labels_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,region_set_labels_request_resource"; + } + + // Returns permissions that a caller has on the specified resource. + rpc TestIamPermissions(TestIamPermissionsVpnGatewayRequest) returns (TestPermissionsResponse) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions" + body: "test_permissions_request_resource" + }; + option (google.api.method_signature) = "project,region,resource,test_permissions_request_resource"; + } + +} + +// The VpnTunnels API. +service VpnTunnels { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves an aggregated list of VPN tunnels. + rpc AggregatedList(AggregatedListVpnTunnelsRequest) returns (VpnTunnelAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/vpnTunnels" + }; + option (google.api.method_signature) = "project"; + } + + // Deletes the specified VpnTunnel resource. + rpc Delete(DeleteVpnTunnelRequest) returns (Operation) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}" + }; + option (google.api.method_signature) = "project,region,vpn_tunnel"; + } + + // Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. + rpc Get(GetVpnTunnelRequest) returns (VpnTunnel) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}" + }; + option (google.api.method_signature) = "project,region,vpn_tunnel"; + } + + // Creates a VpnTunnel resource in the specified project and region using the data included in the request. + rpc Insert(InsertVpnTunnelRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/vpnTunnels" + body: "vpn_tunnel_resource" + }; + option (google.api.method_signature) = "project,region,vpn_tunnel_resource"; + } + + // Retrieves a list of VpnTunnel resources contained in the specified project and region. + rpc List(ListVpnTunnelsRequest) returns (VpnTunnelList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/vpnTunnels" + }; + option (google.api.method_signature) = "project,region"; + } + +} + +// The ZoneOperations API. +service ZoneOperations { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Deletes the specified zone-specific Operations resource. + rpc Delete(DeleteZoneOperationRequest) returns (DeleteZoneOperationResponse) { + option (google.api.http) = { + delete: "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}" + }; + option (google.api.method_signature) = "project,zone,operation"; + } + + // Retrieves the specified zone-specific Operations resource. + rpc Get(GetZoneOperationRequest) returns (Operation) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}" + }; + option (google.api.method_signature) = "project,zone,operation"; + } + + // Retrieves a list of Operation resources contained within the specified zone. + rpc List(ListZoneOperationsRequest) returns (OperationList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}/operations" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + // + // This method is called on a best-effort basis. Specifically: + // - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + // - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + rpc Wait(WaitZoneOperationRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait" + }; + option (google.api.method_signature) = "project,zone,operation"; + } + +} + +// The Zones API. +service Zones { + option (google.api.default_host) = + "compute.googleapis.com"; + + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/compute.readonly," + "https://www.googleapis.com/auth/compute," + "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the specified Zone resource. Gets a list of available zones by making a list() request. + rpc Get(GetZoneRequest) returns (Zone) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones/{zone}" + }; + option (google.api.method_signature) = "project,zone"; + } + + // Retrieves the list of Zone resources available to the specified project. + rpc List(ListZonesRequest) returns (ZoneList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/zones" + }; + option (google.api.method_signature) = "project"; + } + +} + diff --git a/protos/protos.d.ts b/protos/protos.d.ts new file mode 100644 index 00000000..cc7993d3 --- /dev/null +++ b/protos/protos.d.ts @@ -0,0 +1,155773 @@ +// 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. + +import * as Long from "long"; +import {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace compute. */ + namespace compute { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AcceleratorConfig. */ + interface IAcceleratorConfig { + + /** AcceleratorConfig acceleratorCount */ + acceleratorCount?: (number|null); + + /** AcceleratorConfig acceleratorType */ + acceleratorType?: (string|null); + } + + /** Represents an AcceleratorConfig. */ + class AcceleratorConfig implements IAcceleratorConfig { + + /** + * Constructs a new AcceleratorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAcceleratorConfig); + + /** AcceleratorConfig acceleratorCount. */ + public acceleratorCount?: (number|null); + + /** AcceleratorConfig acceleratorType. */ + public acceleratorType?: (string|null); + + /** AcceleratorConfig _acceleratorCount. */ + public _acceleratorCount?: "acceleratorCount"; + + /** AcceleratorConfig _acceleratorType. */ + public _acceleratorType?: "acceleratorType"; + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IAcceleratorConfig): google.cloud.compute.v1.AcceleratorConfig; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AcceleratorConfig; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AcceleratorConfig; + + /** + * Verifies an AcceleratorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AcceleratorConfig; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @param message AcceleratorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AcceleratorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeprecationStatus. */ + interface IDeprecationStatus { + + /** DeprecationStatus deleted */ + deleted?: (string|null); + + /** DeprecationStatus deprecated */ + deprecated?: (string|null); + + /** DeprecationStatus obsolete */ + obsolete?: (string|null); + + /** DeprecationStatus replacement */ + replacement?: (string|null); + + /** DeprecationStatus state */ + state?: (google.cloud.compute.v1.DeprecationStatus.State|keyof typeof google.cloud.compute.v1.DeprecationStatus.State|null); + } + + /** Represents a DeprecationStatus. */ + class DeprecationStatus implements IDeprecationStatus { + + /** + * Constructs a new DeprecationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeprecationStatus); + + /** DeprecationStatus deleted. */ + public deleted?: (string|null); + + /** DeprecationStatus deprecated. */ + public deprecated?: (string|null); + + /** DeprecationStatus obsolete. */ + public obsolete?: (string|null); + + /** DeprecationStatus replacement. */ + public replacement?: (string|null); + + /** DeprecationStatus state. */ + public state?: (google.cloud.compute.v1.DeprecationStatus.State|keyof typeof google.cloud.compute.v1.DeprecationStatus.State|null); + + /** DeprecationStatus _deleted. */ + public _deleted?: "deleted"; + + /** DeprecationStatus _deprecated. */ + public _deprecated?: "deprecated"; + + /** DeprecationStatus _obsolete. */ + public _obsolete?: "obsolete"; + + /** DeprecationStatus _replacement. */ + public _replacement?: "replacement"; + + /** DeprecationStatus _state. */ + public _state?: "state"; + + /** + * Creates a new DeprecationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns DeprecationStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IDeprecationStatus): google.cloud.compute.v1.DeprecationStatus; + + /** + * Encodes the specified DeprecationStatus message. Does not implicitly {@link google.cloud.compute.v1.DeprecationStatus.verify|verify} messages. + * @param message DeprecationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeprecationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeprecationStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeprecationStatus.verify|verify} messages. + * @param message DeprecationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeprecationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeprecationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeprecationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeprecationStatus; + + /** + * Decodes a DeprecationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeprecationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeprecationStatus; + + /** + * Verifies a DeprecationStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeprecationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeprecationStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeprecationStatus; + + /** + * Creates a plain object from a DeprecationStatus message. Also converts values to other types if specified. + * @param message DeprecationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeprecationStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeprecationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DeprecationStatus { + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + ACTIVE = 314733318, + DELETED = 120962041, + DEPRECATED = 463360435, + OBSOLETE = 66532761 + } + } + + /** Properties of an AcceleratorType. */ + interface IAcceleratorType { + + /** AcceleratorType creationTimestamp */ + creationTimestamp?: (string|null); + + /** AcceleratorType deprecated */ + deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** AcceleratorType description */ + description?: (string|null); + + /** AcceleratorType id */ + id?: (number|Long|string|null); + + /** AcceleratorType kind */ + kind?: (string|null); + + /** AcceleratorType maximumCardsPerInstance */ + maximumCardsPerInstance?: (number|null); + + /** AcceleratorType name */ + name?: (string|null); + + /** AcceleratorType selfLink */ + selfLink?: (string|null); + + /** AcceleratorType zone */ + zone?: (string|null); + } + + /** Represents an AcceleratorType. */ + class AcceleratorType implements IAcceleratorType { + + /** + * Constructs a new AcceleratorType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAcceleratorType); + + /** AcceleratorType creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** AcceleratorType deprecated. */ + public deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** AcceleratorType description. */ + public description?: (string|null); + + /** AcceleratorType id. */ + public id?: (number|Long|string|null); + + /** AcceleratorType kind. */ + public kind?: (string|null); + + /** AcceleratorType maximumCardsPerInstance. */ + public maximumCardsPerInstance?: (number|null); + + /** AcceleratorType name. */ + public name?: (string|null); + + /** AcceleratorType selfLink. */ + public selfLink?: (string|null); + + /** AcceleratorType zone. */ + public zone?: (string|null); + + /** AcceleratorType _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** AcceleratorType _deprecated. */ + public _deprecated?: "deprecated"; + + /** AcceleratorType _description. */ + public _description?: "description"; + + /** AcceleratorType _id. */ + public _id?: "id"; + + /** AcceleratorType _kind. */ + public _kind?: "kind"; + + /** AcceleratorType _maximumCardsPerInstance. */ + public _maximumCardsPerInstance?: "maximumCardsPerInstance"; + + /** AcceleratorType _name. */ + public _name?: "name"; + + /** AcceleratorType _selfLink. */ + public _selfLink?: "selfLink"; + + /** AcceleratorType _zone. */ + public _zone?: "zone"; + + /** + * Creates a new AcceleratorType instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorType instance + */ + public static create(properties?: google.cloud.compute.v1.IAcceleratorType): google.cloud.compute.v1.AcceleratorType; + + /** + * Encodes the specified AcceleratorType message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorType.verify|verify} messages. + * @param message AcceleratorType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAcceleratorType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorType.verify|verify} messages. + * @param message AcceleratorType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAcceleratorType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AcceleratorType; + + /** + * Decodes an AcceleratorType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AcceleratorType; + + /** + * Verifies an AcceleratorType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AcceleratorType; + + /** + * Creates a plain object from an AcceleratorType message. Also converts values to other types if specified. + * @param message AcceleratorType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AcceleratorType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AcceleratorTypesScopedList. */ + interface IAcceleratorTypesScopedList { + + /** AcceleratorTypesScopedList acceleratorTypes */ + acceleratorTypes?: (google.cloud.compute.v1.IAcceleratorType[]|null); + + /** AcceleratorTypesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AcceleratorTypesScopedList. */ + class AcceleratorTypesScopedList implements IAcceleratorTypesScopedList { + + /** + * Constructs a new AcceleratorTypesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAcceleratorTypesScopedList); + + /** AcceleratorTypesScopedList acceleratorTypes. */ + public acceleratorTypes: google.cloud.compute.v1.IAcceleratorType[]; + + /** AcceleratorTypesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AcceleratorTypesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AcceleratorTypesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorTypesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IAcceleratorTypesScopedList): google.cloud.compute.v1.AcceleratorTypesScopedList; + + /** + * Encodes the specified AcceleratorTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypesScopedList.verify|verify} messages. + * @param message AcceleratorTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAcceleratorTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypesScopedList.verify|verify} messages. + * @param message AcceleratorTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAcceleratorTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorTypesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AcceleratorTypesScopedList; + + /** + * Decodes an AcceleratorTypesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AcceleratorTypesScopedList; + + /** + * Verifies an AcceleratorTypesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorTypesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AcceleratorTypesScopedList; + + /** + * Creates a plain object from an AcceleratorTypesScopedList message. Also converts values to other types if specified. + * @param message AcceleratorTypesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AcceleratorTypesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorTypesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Data. */ + interface IData { + + /** Data key */ + key?: (string|null); + + /** Data value */ + value?: (string|null); + } + + /** Represents a Data. */ + class Data implements IData { + + /** + * Constructs a new Data. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IData); + + /** Data key. */ + public key?: (string|null); + + /** Data value. */ + public value?: (string|null); + + /** Data _key. */ + public _key?: "key"; + + /** Data _value. */ + public _value?: "value"; + + /** + * Creates a new Data instance using the specified properties. + * @param [properties] Properties to set + * @returns Data instance + */ + public static create(properties?: google.cloud.compute.v1.IData): google.cloud.compute.v1.Data; + + /** + * Encodes the specified Data message. Does not implicitly {@link google.cloud.compute.v1.Data.verify|verify} messages. + * @param message Data message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Data.verify|verify} messages. + * @param message Data message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Data message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Data; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Data; + + /** + * Verifies a Data message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Data + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Data; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @param message Data + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Data, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Data to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Warning. */ + interface IWarning { + + /** Warning code */ + code?: (google.cloud.compute.v1.Warning.Code|keyof typeof google.cloud.compute.v1.Warning.Code|null); + + /** Warning data */ + data?: (google.cloud.compute.v1.IData[]|null); + + /** Warning message */ + message?: (string|null); + } + + /** Represents a Warning. */ + class Warning implements IWarning { + + /** + * Constructs a new Warning. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWarning); + + /** Warning code. */ + public code?: (google.cloud.compute.v1.Warning.Code|keyof typeof google.cloud.compute.v1.Warning.Code|null); + + /** Warning data. */ + public data: google.cloud.compute.v1.IData[]; + + /** Warning message. */ + public message?: (string|null); + + /** Warning _code. */ + public _code?: "code"; + + /** Warning _message. */ + public _message?: "message"; + + /** + * Creates a new Warning instance using the specified properties. + * @param [properties] Properties to set + * @returns Warning instance + */ + public static create(properties?: google.cloud.compute.v1.IWarning): google.cloud.compute.v1.Warning; + + /** + * Encodes the specified Warning message. Does not implicitly {@link google.cloud.compute.v1.Warning.verify|verify} messages. + * @param message Warning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWarning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Warning message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Warning.verify|verify} messages. + * @param message Warning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWarning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Warning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Warning; + + /** + * Decodes a Warning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Warning; + + /** + * Verifies a Warning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Warning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Warning + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Warning; + + /** + * Creates a plain object from a Warning message. Also converts values to other types if specified. + * @param message Warning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Warning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Warning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Warning { + + /** Code enum. */ + enum Code { + UNDEFINED_CODE = 0, + CLEANUP_FAILED = 150308440, + DEPRECATED_RESOURCE_USED = 391835586, + DEPRECATED_TYPE_USED = 346526230, + DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967, + EXPERIMENTAL_TYPE_USED = 451954443, + EXTERNAL_API_WARNING = 175546307, + FIELD_VALUE_OVERRIDEN = 329669423, + INJECTED_KERNELS_DEPRECATED = 417377419, + LARGE_DEPLOYMENT_WARNING = 481440678, + MISSING_TYPE_DEPENDENCY = 344505463, + NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999, + NEXT_HOP_CANNOT_IP_FORWARD = 383382887, + NEXT_HOP_INSTANCE_NOT_FOUND = 464250446, + NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146, + NEXT_HOP_NOT_RUNNING = 417081265, + NOT_CRITICAL_ERROR = 105763924, + NO_RESULTS_ON_PAGE = 30036744, + PARTIAL_SUCCESS = 39966469, + REQUIRED_TOS_AGREEMENT = 3745539, + RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641, + RESOURCE_NOT_DELETED = 168598460, + SCHEMA_VALIDATION_IGNORED = 275245642, + SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617, + UNDECLARED_PROPERTIES = 390513439, + UNREACHABLE = 13328052 + } + } + + /** Properties of an AcceleratorTypeAggregatedList. */ + interface IAcceleratorTypeAggregatedList { + + /** AcceleratorTypeAggregatedList id */ + id?: (string|null); + + /** AcceleratorTypeAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IAcceleratorTypesScopedList }|null); + + /** AcceleratorTypeAggregatedList kind */ + kind?: (string|null); + + /** AcceleratorTypeAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** AcceleratorTypeAggregatedList selfLink */ + selfLink?: (string|null); + + /** AcceleratorTypeAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** AcceleratorTypeAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AcceleratorTypeAggregatedList. */ + class AcceleratorTypeAggregatedList implements IAcceleratorTypeAggregatedList { + + /** + * Constructs a new AcceleratorTypeAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAcceleratorTypeAggregatedList); + + /** AcceleratorTypeAggregatedList id. */ + public id?: (string|null); + + /** AcceleratorTypeAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IAcceleratorTypesScopedList }; + + /** AcceleratorTypeAggregatedList kind. */ + public kind?: (string|null); + + /** AcceleratorTypeAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** AcceleratorTypeAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** AcceleratorTypeAggregatedList unreachables. */ + public unreachables: string[]; + + /** AcceleratorTypeAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AcceleratorTypeAggregatedList _id. */ + public _id?: "id"; + + /** AcceleratorTypeAggregatedList _kind. */ + public _kind?: "kind"; + + /** AcceleratorTypeAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** AcceleratorTypeAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** AcceleratorTypeAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AcceleratorTypeAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorTypeAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IAcceleratorTypeAggregatedList): google.cloud.compute.v1.AcceleratorTypeAggregatedList; + + /** + * Encodes the specified AcceleratorTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeAggregatedList.verify|verify} messages. + * @param message AcceleratorTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAcceleratorTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeAggregatedList.verify|verify} messages. + * @param message AcceleratorTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAcceleratorTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorTypeAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AcceleratorTypeAggregatedList; + + /** + * Decodes an AcceleratorTypeAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AcceleratorTypeAggregatedList; + + /** + * Verifies an AcceleratorTypeAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorTypeAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AcceleratorTypeAggregatedList; + + /** + * Creates a plain object from an AcceleratorTypeAggregatedList message. Also converts values to other types if specified. + * @param message AcceleratorTypeAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AcceleratorTypeAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorTypeAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AcceleratorTypeList. */ + interface IAcceleratorTypeList { + + /** AcceleratorTypeList id */ + id?: (string|null); + + /** AcceleratorTypeList items */ + items?: (google.cloud.compute.v1.IAcceleratorType[]|null); + + /** AcceleratorTypeList kind */ + kind?: (string|null); + + /** AcceleratorTypeList nextPageToken */ + nextPageToken?: (string|null); + + /** AcceleratorTypeList selfLink */ + selfLink?: (string|null); + + /** AcceleratorTypeList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AcceleratorTypeList. */ + class AcceleratorTypeList implements IAcceleratorTypeList { + + /** + * Constructs a new AcceleratorTypeList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAcceleratorTypeList); + + /** AcceleratorTypeList id. */ + public id?: (string|null); + + /** AcceleratorTypeList items. */ + public items: google.cloud.compute.v1.IAcceleratorType[]; + + /** AcceleratorTypeList kind. */ + public kind?: (string|null); + + /** AcceleratorTypeList nextPageToken. */ + public nextPageToken?: (string|null); + + /** AcceleratorTypeList selfLink. */ + public selfLink?: (string|null); + + /** AcceleratorTypeList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AcceleratorTypeList _id. */ + public _id?: "id"; + + /** AcceleratorTypeList _kind. */ + public _kind?: "kind"; + + /** AcceleratorTypeList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** AcceleratorTypeList _selfLink. */ + public _selfLink?: "selfLink"; + + /** AcceleratorTypeList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AcceleratorTypeList instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorTypeList instance + */ + public static create(properties?: google.cloud.compute.v1.IAcceleratorTypeList): google.cloud.compute.v1.AcceleratorTypeList; + + /** + * Encodes the specified AcceleratorTypeList message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeList.verify|verify} messages. + * @param message AcceleratorTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAcceleratorTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeList.verify|verify} messages. + * @param message AcceleratorTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAcceleratorTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorTypeList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AcceleratorTypeList; + + /** + * Decodes an AcceleratorTypeList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AcceleratorTypeList; + + /** + * Verifies an AcceleratorTypeList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorTypeList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorTypeList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AcceleratorTypeList; + + /** + * Creates a plain object from an AcceleratorTypeList message. Also converts values to other types if specified. + * @param message AcceleratorTypeList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AcceleratorTypeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorTypeList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AccessConfig. */ + interface IAccessConfig { + + /** AccessConfig kind */ + kind?: (string|null); + + /** AccessConfig name */ + name?: (string|null); + + /** AccessConfig natIP */ + natIP?: (string|null); + + /** AccessConfig networkTier */ + networkTier?: (google.cloud.compute.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.compute.v1.AccessConfig.NetworkTier|null); + + /** AccessConfig publicPtrDomainName */ + publicPtrDomainName?: (string|null); + + /** AccessConfig setPublicPtr */ + setPublicPtr?: (boolean|null); + + /** AccessConfig type */ + type?: (google.cloud.compute.v1.AccessConfig.Type|keyof typeof google.cloud.compute.v1.AccessConfig.Type|null); + } + + /** Represents an AccessConfig. */ + class AccessConfig implements IAccessConfig { + + /** + * Constructs a new AccessConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAccessConfig); + + /** AccessConfig kind. */ + public kind?: (string|null); + + /** AccessConfig name. */ + public name?: (string|null); + + /** AccessConfig natIP. */ + public natIP?: (string|null); + + /** AccessConfig networkTier. */ + public networkTier?: (google.cloud.compute.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.compute.v1.AccessConfig.NetworkTier|null); + + /** AccessConfig publicPtrDomainName. */ + public publicPtrDomainName?: (string|null); + + /** AccessConfig setPublicPtr. */ + public setPublicPtr?: (boolean|null); + + /** AccessConfig type. */ + public type?: (google.cloud.compute.v1.AccessConfig.Type|keyof typeof google.cloud.compute.v1.AccessConfig.Type|null); + + /** AccessConfig _kind. */ + public _kind?: "kind"; + + /** AccessConfig _name. */ + public _name?: "name"; + + /** AccessConfig _natIP. */ + public _natIP?: "natIP"; + + /** AccessConfig _networkTier. */ + public _networkTier?: "networkTier"; + + /** AccessConfig _publicPtrDomainName. */ + public _publicPtrDomainName?: "publicPtrDomainName"; + + /** AccessConfig _setPublicPtr. */ + public _setPublicPtr?: "setPublicPtr"; + + /** AccessConfig _type. */ + public _type?: "type"; + + /** + * Creates a new AccessConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IAccessConfig): google.cloud.compute.v1.AccessConfig; + + /** + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.compute.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AccessConfig; + + /** + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AccessConfig; + + /** + * Verifies an AccessConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AccessConfig; + + /** + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @param message AccessConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AccessConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AccessConfig { + + /** NetworkTier enum. */ + enum NetworkTier { + UNDEFINED_NETWORK_TIER = 0, + PREMIUM = 399530551, + STANDARD = 484642493 + } + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + ONE_TO_ONE_NAT = 84090205 + } + } + + /** Properties of an Address. */ + interface IAddress { + + /** Address address */ + address?: (string|null); + + /** Address addressType */ + addressType?: (google.cloud.compute.v1.Address.AddressType|keyof typeof google.cloud.compute.v1.Address.AddressType|null); + + /** Address creationTimestamp */ + creationTimestamp?: (string|null); + + /** Address description */ + description?: (string|null); + + /** Address id */ + id?: (number|Long|string|null); + + /** Address ipVersion */ + ipVersion?: (google.cloud.compute.v1.Address.IpVersion|keyof typeof google.cloud.compute.v1.Address.IpVersion|null); + + /** Address kind */ + kind?: (string|null); + + /** Address name */ + name?: (string|null); + + /** Address network */ + network?: (string|null); + + /** Address networkTier */ + networkTier?: (google.cloud.compute.v1.Address.NetworkTier|keyof typeof google.cloud.compute.v1.Address.NetworkTier|null); + + /** Address prefixLength */ + prefixLength?: (number|null); + + /** Address purpose */ + purpose?: (google.cloud.compute.v1.Address.Purpose|keyof typeof google.cloud.compute.v1.Address.Purpose|null); + + /** Address region */ + region?: (string|null); + + /** Address selfLink */ + selfLink?: (string|null); + + /** Address status */ + status?: (google.cloud.compute.v1.Address.Status|keyof typeof google.cloud.compute.v1.Address.Status|null); + + /** Address subnetwork */ + subnetwork?: (string|null); + + /** Address users */ + users?: (string[]|null); + } + + /** Represents an Address. */ + class Address implements IAddress { + + /** + * Constructs a new Address. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddress); + + /** Address address. */ + public address?: (string|null); + + /** Address addressType. */ + public addressType?: (google.cloud.compute.v1.Address.AddressType|keyof typeof google.cloud.compute.v1.Address.AddressType|null); + + /** Address creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Address description. */ + public description?: (string|null); + + /** Address id. */ + public id?: (number|Long|string|null); + + /** Address ipVersion. */ + public ipVersion?: (google.cloud.compute.v1.Address.IpVersion|keyof typeof google.cloud.compute.v1.Address.IpVersion|null); + + /** Address kind. */ + public kind?: (string|null); + + /** Address name. */ + public name?: (string|null); + + /** Address network. */ + public network?: (string|null); + + /** Address networkTier. */ + public networkTier?: (google.cloud.compute.v1.Address.NetworkTier|keyof typeof google.cloud.compute.v1.Address.NetworkTier|null); + + /** Address prefixLength. */ + public prefixLength?: (number|null); + + /** Address purpose. */ + public purpose?: (google.cloud.compute.v1.Address.Purpose|keyof typeof google.cloud.compute.v1.Address.Purpose|null); + + /** Address region. */ + public region?: (string|null); + + /** Address selfLink. */ + public selfLink?: (string|null); + + /** Address status. */ + public status?: (google.cloud.compute.v1.Address.Status|keyof typeof google.cloud.compute.v1.Address.Status|null); + + /** Address subnetwork. */ + public subnetwork?: (string|null); + + /** Address users. */ + public users: string[]; + + /** Address _address. */ + public _address?: "address"; + + /** Address _addressType. */ + public _addressType?: "addressType"; + + /** Address _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Address _description. */ + public _description?: "description"; + + /** Address _id. */ + public _id?: "id"; + + /** Address _ipVersion. */ + public _ipVersion?: "ipVersion"; + + /** Address _kind. */ + public _kind?: "kind"; + + /** Address _name. */ + public _name?: "name"; + + /** Address _network. */ + public _network?: "network"; + + /** Address _networkTier. */ + public _networkTier?: "networkTier"; + + /** Address _prefixLength. */ + public _prefixLength?: "prefixLength"; + + /** Address _purpose. */ + public _purpose?: "purpose"; + + /** Address _region. */ + public _region?: "region"; + + /** Address _selfLink. */ + public _selfLink?: "selfLink"; + + /** Address _status. */ + public _status?: "status"; + + /** Address _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** + * Creates a new Address instance using the specified properties. + * @param [properties] Properties to set + * @returns Address instance + */ + public static create(properties?: google.cloud.compute.v1.IAddress): google.cloud.compute.v1.Address; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.cloud.compute.v1.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Address.verify|verify} messages. + * @param message Address message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddress, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Address message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Address; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Address; + + /** + * Verifies an Address message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Address message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Address + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Address; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @param message Address + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Address, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Address to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Address { + + /** AddressType enum. */ + enum AddressType { + UNDEFINED_ADDRESS_TYPE = 0, + EXTERNAL = 35607499, + INTERNAL = 279295677, + UNSPECIFIED_TYPE = 53933922 + } + + /** IpVersion enum. */ + enum IpVersion { + UNDEFINED_IP_VERSION = 0, + IPV4 = 2254341, + IPV6 = 2254343, + UNSPECIFIED_VERSION = 21850000 + } + + /** NetworkTier enum. */ + enum NetworkTier { + UNDEFINED_NETWORK_TIER = 0, + PREMIUM = 399530551, + STANDARD = 484642493 + } + + /** Purpose enum. */ + enum Purpose { + UNDEFINED_PURPOSE = 0, + DNS_RESOLVER = 476114556, + GCE_ENDPOINT = 230515243, + IPSEC_INTERCONNECT = 340437251, + NAT_AUTO = 163666477, + PRIVATE_SERVICE_CONNECT = 48134724, + SHARED_LOADBALANCER_VIP = 294447572, + VPC_PEERING = 400800170 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + IN_USE = 17393485, + RESERVED = 432241448, + RESERVING = 514587225 + } + } + + /** Properties of an AddressesScopedList. */ + interface IAddressesScopedList { + + /** AddressesScopedList addresses */ + addresses?: (google.cloud.compute.v1.IAddress[]|null); + + /** AddressesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AddressesScopedList. */ + class AddressesScopedList implements IAddressesScopedList { + + /** + * Constructs a new AddressesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddressesScopedList); + + /** AddressesScopedList addresses. */ + public addresses: google.cloud.compute.v1.IAddress[]; + + /** AddressesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AddressesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AddressesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns AddressesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IAddressesScopedList): google.cloud.compute.v1.AddressesScopedList; + + /** + * Encodes the specified AddressesScopedList message. Does not implicitly {@link google.cloud.compute.v1.AddressesScopedList.verify|verify} messages. + * @param message AddressesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddressesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddressesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddressesScopedList.verify|verify} messages. + * @param message AddressesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddressesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddressesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddressesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddressesScopedList; + + /** + * Decodes an AddressesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddressesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddressesScopedList; + + /** + * Verifies an AddressesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddressesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddressesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddressesScopedList; + + /** + * Creates a plain object from an AddressesScopedList message. Also converts values to other types if specified. + * @param message AddressesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddressesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddressesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddressAggregatedList. */ + interface IAddressAggregatedList { + + /** AddressAggregatedList id */ + id?: (string|null); + + /** AddressAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IAddressesScopedList }|null); + + /** AddressAggregatedList kind */ + kind?: (string|null); + + /** AddressAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** AddressAggregatedList selfLink */ + selfLink?: (string|null); + + /** AddressAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** AddressAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AddressAggregatedList. */ + class AddressAggregatedList implements IAddressAggregatedList { + + /** + * Constructs a new AddressAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddressAggregatedList); + + /** AddressAggregatedList id. */ + public id?: (string|null); + + /** AddressAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IAddressesScopedList }; + + /** AddressAggregatedList kind. */ + public kind?: (string|null); + + /** AddressAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** AddressAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** AddressAggregatedList unreachables. */ + public unreachables: string[]; + + /** AddressAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AddressAggregatedList _id. */ + public _id?: "id"; + + /** AddressAggregatedList _kind. */ + public _kind?: "kind"; + + /** AddressAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** AddressAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** AddressAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AddressAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns AddressAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IAddressAggregatedList): google.cloud.compute.v1.AddressAggregatedList; + + /** + * Encodes the specified AddressAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.AddressAggregatedList.verify|verify} messages. + * @param message AddressAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddressAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddressAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddressAggregatedList.verify|verify} messages. + * @param message AddressAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddressAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddressAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddressAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddressAggregatedList; + + /** + * Decodes an AddressAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddressAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddressAggregatedList; + + /** + * Verifies an AddressAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddressAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddressAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddressAggregatedList; + + /** + * Creates a plain object from an AddressAggregatedList message. Also converts values to other types if specified. + * @param message AddressAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddressAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddressAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddressList. */ + interface IAddressList { + + /** AddressList id */ + id?: (string|null); + + /** AddressList items */ + items?: (google.cloud.compute.v1.IAddress[]|null); + + /** AddressList kind */ + kind?: (string|null); + + /** AddressList nextPageToken */ + nextPageToken?: (string|null); + + /** AddressList selfLink */ + selfLink?: (string|null); + + /** AddressList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AddressList. */ + class AddressList implements IAddressList { + + /** + * Constructs a new AddressList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddressList); + + /** AddressList id. */ + public id?: (string|null); + + /** AddressList items. */ + public items: google.cloud.compute.v1.IAddress[]; + + /** AddressList kind. */ + public kind?: (string|null); + + /** AddressList nextPageToken. */ + public nextPageToken?: (string|null); + + /** AddressList selfLink. */ + public selfLink?: (string|null); + + /** AddressList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AddressList _id. */ + public _id?: "id"; + + /** AddressList _kind. */ + public _kind?: "kind"; + + /** AddressList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** AddressList _selfLink. */ + public _selfLink?: "selfLink"; + + /** AddressList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AddressList instance using the specified properties. + * @param [properties] Properties to set + * @returns AddressList instance + */ + public static create(properties?: google.cloud.compute.v1.IAddressList): google.cloud.compute.v1.AddressList; + + /** + * Encodes the specified AddressList message. Does not implicitly {@link google.cloud.compute.v1.AddressList.verify|verify} messages. + * @param message AddressList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddressList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddressList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddressList.verify|verify} messages. + * @param message AddressList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddressList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddressList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddressList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddressList; + + /** + * Decodes an AddressList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddressList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddressList; + + /** + * Verifies an AddressList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddressList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddressList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddressList; + + /** + * Creates a plain object from an AddressList message. Also converts values to other types if specified. + * @param message AddressList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddressList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddressList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AdvancedMachineFeatures. */ + interface IAdvancedMachineFeatures { + + /** AdvancedMachineFeatures enableNestedVirtualization */ + enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore */ + threadsPerCore?: (number|null); + } + + /** Represents an AdvancedMachineFeatures. */ + class AdvancedMachineFeatures implements IAdvancedMachineFeatures { + + /** + * Constructs a new AdvancedMachineFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAdvancedMachineFeatures); + + /** AdvancedMachineFeatures enableNestedVirtualization. */ + public enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore. */ + public threadsPerCore?: (number|null); + + /** AdvancedMachineFeatures _enableNestedVirtualization. */ + public _enableNestedVirtualization?: "enableNestedVirtualization"; + + /** AdvancedMachineFeatures _threadsPerCore. */ + public _threadsPerCore?: "threadsPerCore"; + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedMachineFeatures instance + */ + public static create(properties?: google.cloud.compute.v1.IAdvancedMachineFeatures): google.cloud.compute.v1.AdvancedMachineFeatures; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.compute.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AdvancedMachineFeatures; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AdvancedMachineFeatures; + + /** + * Verifies an AdvancedMachineFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedMachineFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AdvancedMachineFeatures; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @param message AdvancedMachineFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AdvancedMachineFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AliasIpRange. */ + interface IAliasIpRange { + + /** AliasIpRange ipCidrRange */ + ipCidrRange?: (string|null); + + /** AliasIpRange subnetworkRangeName */ + subnetworkRangeName?: (string|null); + } + + /** Represents an AliasIpRange. */ + class AliasIpRange implements IAliasIpRange { + + /** + * Constructs a new AliasIpRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAliasIpRange); + + /** AliasIpRange ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** AliasIpRange subnetworkRangeName. */ + public subnetworkRangeName?: (string|null); + + /** AliasIpRange _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** AliasIpRange _subnetworkRangeName. */ + public _subnetworkRangeName?: "subnetworkRangeName"; + + /** + * Creates a new AliasIpRange instance using the specified properties. + * @param [properties] Properties to set + * @returns AliasIpRange instance + */ + public static create(properties?: google.cloud.compute.v1.IAliasIpRange): google.cloud.compute.v1.AliasIpRange; + + /** + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.compute.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AliasIpRange; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AliasIpRange; + + /** + * Verifies an AliasIpRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AliasIpRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AliasIpRange; + + /** + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @param message AliasIpRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AliasIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AliasIpRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk. */ + interface IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { + + /** AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk interface */ + "interface"?: (google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface|keyof typeof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface|null); + } + + /** Represents an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk. */ + class AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk implements IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { + + /** + * Constructs a new AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk); + + /** AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk interface. */ + public interface?: (google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface|keyof typeof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface|null); + + /** AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk _interface. */ + public _interface?: "interface"; + + /** + * Creates a new AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk instance + */ + public static create(properties?: google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk): google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk; + + /** + * Encodes the specified AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.verify|verify} messages. + * @param message AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.verify|verify} messages. + * @param message AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk; + + /** + * Decodes an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk; + + /** + * Verifies an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk; + + /** + * Creates a plain object from an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message. Also converts values to other types if specified. + * @param message AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk { + + /** Interface enum. */ + enum Interface { + UNDEFINED_INTERFACE = 0, + NVME = 2408800, + SCSI = 2539686 + } + } + + /** Properties of an AllocationSpecificSKUAllocationReservedInstanceProperties. */ + interface IAllocationSpecificSKUAllocationReservedInstanceProperties { + + /** AllocationSpecificSKUAllocationReservedInstanceProperties guestAccelerators */ + guestAccelerators?: (google.cloud.compute.v1.IAcceleratorConfig[]|null); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties localSsds */ + localSsds?: (google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk[]|null); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties locationHint */ + locationHint?: (string|null); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties machineType */ + machineType?: (string|null); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + } + + /** Represents an AllocationSpecificSKUAllocationReservedInstanceProperties. */ + class AllocationSpecificSKUAllocationReservedInstanceProperties implements IAllocationSpecificSKUAllocationReservedInstanceProperties { + + /** + * Constructs a new AllocationSpecificSKUAllocationReservedInstanceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties guestAccelerators. */ + public guestAccelerators: google.cloud.compute.v1.IAcceleratorConfig[]; + + /** AllocationSpecificSKUAllocationReservedInstanceProperties localSsds. */ + public localSsds: google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk[]; + + /** AllocationSpecificSKUAllocationReservedInstanceProperties locationHint. */ + public locationHint?: (string|null); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties machineType. */ + public machineType?: (string|null); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** AllocationSpecificSKUAllocationReservedInstanceProperties _locationHint. */ + public _locationHint?: "locationHint"; + + /** AllocationSpecificSKUAllocationReservedInstanceProperties _machineType. */ + public _machineType?: "machineType"; + + /** AllocationSpecificSKUAllocationReservedInstanceProperties _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** + * Creates a new AllocationSpecificSKUAllocationReservedInstanceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationSpecificSKUAllocationReservedInstanceProperties instance + */ + public static create(properties?: google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties): google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties; + + /** + * Encodes the specified AllocationSpecificSKUAllocationReservedInstanceProperties message. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.verify|verify} messages. + * @param message AllocationSpecificSKUAllocationReservedInstanceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationSpecificSKUAllocationReservedInstanceProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.verify|verify} messages. + * @param message AllocationSpecificSKUAllocationReservedInstanceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationSpecificSKUAllocationReservedInstanceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationSpecificSKUAllocationReservedInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties; + + /** + * Decodes an AllocationSpecificSKUAllocationReservedInstanceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationSpecificSKUAllocationReservedInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties; + + /** + * Verifies an AllocationSpecificSKUAllocationReservedInstanceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationSpecificSKUAllocationReservedInstanceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationSpecificSKUAllocationReservedInstanceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties; + + /** + * Creates a plain object from an AllocationSpecificSKUAllocationReservedInstanceProperties message. Also converts values to other types if specified. + * @param message AllocationSpecificSKUAllocationReservedInstanceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationSpecificSKUAllocationReservedInstanceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AllocationSpecificSKUReservation. */ + interface IAllocationSpecificSKUReservation { + + /** AllocationSpecificSKUReservation count */ + count?: (number|Long|string|null); + + /** AllocationSpecificSKUReservation inUseCount */ + inUseCount?: (number|Long|string|null); + + /** AllocationSpecificSKUReservation instanceProperties */ + instanceProperties?: (google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties|null); + } + + /** Represents an AllocationSpecificSKUReservation. */ + class AllocationSpecificSKUReservation implements IAllocationSpecificSKUReservation { + + /** + * Constructs a new AllocationSpecificSKUReservation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAllocationSpecificSKUReservation); + + /** AllocationSpecificSKUReservation count. */ + public count?: (number|Long|string|null); + + /** AllocationSpecificSKUReservation inUseCount. */ + public inUseCount?: (number|Long|string|null); + + /** AllocationSpecificSKUReservation instanceProperties. */ + public instanceProperties?: (google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties|null); + + /** AllocationSpecificSKUReservation _count. */ + public _count?: "count"; + + /** AllocationSpecificSKUReservation _inUseCount. */ + public _inUseCount?: "inUseCount"; + + /** AllocationSpecificSKUReservation _instanceProperties. */ + public _instanceProperties?: "instanceProperties"; + + /** + * Creates a new AllocationSpecificSKUReservation instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationSpecificSKUReservation instance + */ + public static create(properties?: google.cloud.compute.v1.IAllocationSpecificSKUReservation): google.cloud.compute.v1.AllocationSpecificSKUReservation; + + /** + * Encodes the specified AllocationSpecificSKUReservation message. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUReservation.verify|verify} messages. + * @param message AllocationSpecificSKUReservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAllocationSpecificSKUReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationSpecificSKUReservation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUReservation.verify|verify} messages. + * @param message AllocationSpecificSKUReservation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAllocationSpecificSKUReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationSpecificSKUReservation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationSpecificSKUReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AllocationSpecificSKUReservation; + + /** + * Decodes an AllocationSpecificSKUReservation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationSpecificSKUReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AllocationSpecificSKUReservation; + + /** + * Verifies an AllocationSpecificSKUReservation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationSpecificSKUReservation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationSpecificSKUReservation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AllocationSpecificSKUReservation; + + /** + * Creates a plain object from an AllocationSpecificSKUReservation message. Also converts values to other types if specified. + * @param message AllocationSpecificSKUReservation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AllocationSpecificSKUReservation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationSpecificSKUReservation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomerEncryptionKey. */ + interface ICustomerEncryptionKey { + + /** CustomerEncryptionKey kmsKeyName */ + kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount */ + kmsKeyServiceAccount?: (string|null); + + /** CustomerEncryptionKey rawKey */ + rawKey?: (string|null); + + /** CustomerEncryptionKey sha256 */ + sha256?: (string|null); + } + + /** Represents a CustomerEncryptionKey. */ + class CustomerEncryptionKey implements ICustomerEncryptionKey { + + /** + * Constructs a new CustomerEncryptionKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICustomerEncryptionKey); + + /** CustomerEncryptionKey kmsKeyName. */ + public kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount. */ + public kmsKeyServiceAccount?: (string|null); + + /** CustomerEncryptionKey rawKey. */ + public rawKey?: (string|null); + + /** CustomerEncryptionKey sha256. */ + public sha256?: (string|null); + + /** CustomerEncryptionKey _kmsKeyName. */ + public _kmsKeyName?: "kmsKeyName"; + + /** CustomerEncryptionKey _kmsKeyServiceAccount. */ + public _kmsKeyServiceAccount?: "kmsKeyServiceAccount"; + + /** CustomerEncryptionKey _rawKey. */ + public _rawKey?: "rawKey"; + + /** CustomerEncryptionKey _sha256. */ + public _sha256?: "sha256"; + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEncryptionKey instance + */ + public static create(properties?: google.cloud.compute.v1.ICustomerEncryptionKey): google.cloud.compute.v1.CustomerEncryptionKey; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CustomerEncryptionKey; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CustomerEncryptionKey; + + /** + * Verifies a CustomerEncryptionKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEncryptionKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CustomerEncryptionKey; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @param message CustomerEncryptionKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CustomerEncryptionKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GuestOsFeature. */ + interface IGuestOsFeature { + + /** GuestOsFeature type */ + type?: (google.cloud.compute.v1.GuestOsFeature.Type|keyof typeof google.cloud.compute.v1.GuestOsFeature.Type|null); + } + + /** Represents a GuestOsFeature. */ + class GuestOsFeature implements IGuestOsFeature { + + /** + * Constructs a new GuestOsFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGuestOsFeature); + + /** GuestOsFeature type. */ + public type?: (google.cloud.compute.v1.GuestOsFeature.Type|keyof typeof google.cloud.compute.v1.GuestOsFeature.Type|null); + + /** GuestOsFeature _type. */ + public _type?: "type"; + + /** + * Creates a new GuestOsFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns GuestOsFeature instance + */ + public static create(properties?: google.cloud.compute.v1.IGuestOsFeature): google.cloud.compute.v1.GuestOsFeature; + + /** + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.compute.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GuestOsFeature; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GuestOsFeature; + + /** + * Verifies a GuestOsFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuestOsFeature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GuestOsFeature; + + /** + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @param message GuestOsFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GuestOsFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuestOsFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GuestOsFeature { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + FEATURE_TYPE_UNSPECIFIED = 531767259, + GVNIC = 68209305, + MULTI_IP_SUBNET = 151776719, + SECURE_BOOT = 376811194, + SEV_CAPABLE = 87083793, + UEFI_COMPATIBLE = 195865408, + VIRTIO_SCSI_MULTIQUEUE = 201597069, + WINDOWS = 456863331 + } + } + + /** Properties of an AttachedDiskInitializeParams. */ + interface IAttachedDiskInitializeParams { + + /** AttachedDiskInitializeParams description */ + description?: (string|null); + + /** AttachedDiskInitializeParams diskName */ + diskName?: (string|null); + + /** AttachedDiskInitializeParams diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** AttachedDiskInitializeParams diskType */ + diskType?: (string|null); + + /** AttachedDiskInitializeParams labels */ + labels?: ({ [k: string]: string }|null); + + /** AttachedDiskInitializeParams onUpdateAction */ + onUpdateAction?: (google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction|keyof typeof google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction|null); + + /** AttachedDiskInitializeParams provisionedIops */ + provisionedIops?: (number|Long|string|null); + + /** AttachedDiskInitializeParams resourcePolicies */ + resourcePolicies?: (string[]|null); + + /** AttachedDiskInitializeParams sourceImage */ + sourceImage?: (string|null); + + /** AttachedDiskInitializeParams sourceImageEncryptionKey */ + sourceImageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** AttachedDiskInitializeParams sourceSnapshot */ + sourceSnapshot?: (string|null); + + /** AttachedDiskInitializeParams sourceSnapshotEncryptionKey */ + sourceSnapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + } + + /** Represents an AttachedDiskInitializeParams. */ + class AttachedDiskInitializeParams implements IAttachedDiskInitializeParams { + + /** + * Constructs a new AttachedDiskInitializeParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAttachedDiskInitializeParams); + + /** AttachedDiskInitializeParams description. */ + public description?: (string|null); + + /** AttachedDiskInitializeParams diskName. */ + public diskName?: (string|null); + + /** AttachedDiskInitializeParams diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** AttachedDiskInitializeParams diskType. */ + public diskType?: (string|null); + + /** AttachedDiskInitializeParams labels. */ + public labels: { [k: string]: string }; + + /** AttachedDiskInitializeParams onUpdateAction. */ + public onUpdateAction?: (google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction|keyof typeof google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction|null); + + /** AttachedDiskInitializeParams provisionedIops. */ + public provisionedIops?: (number|Long|string|null); + + /** AttachedDiskInitializeParams resourcePolicies. */ + public resourcePolicies: string[]; + + /** AttachedDiskInitializeParams sourceImage. */ + public sourceImage?: (string|null); + + /** AttachedDiskInitializeParams sourceImageEncryptionKey. */ + public sourceImageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** AttachedDiskInitializeParams sourceSnapshot. */ + public sourceSnapshot?: (string|null); + + /** AttachedDiskInitializeParams sourceSnapshotEncryptionKey. */ + public sourceSnapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** AttachedDiskInitializeParams _description. */ + public _description?: "description"; + + /** AttachedDiskInitializeParams _diskName. */ + public _diskName?: "diskName"; + + /** AttachedDiskInitializeParams _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** AttachedDiskInitializeParams _diskType. */ + public _diskType?: "diskType"; + + /** AttachedDiskInitializeParams _onUpdateAction. */ + public _onUpdateAction?: "onUpdateAction"; + + /** AttachedDiskInitializeParams _provisionedIops. */ + public _provisionedIops?: "provisionedIops"; + + /** AttachedDiskInitializeParams _sourceImage. */ + public _sourceImage?: "sourceImage"; + + /** AttachedDiskInitializeParams _sourceImageEncryptionKey. */ + public _sourceImageEncryptionKey?: "sourceImageEncryptionKey"; + + /** AttachedDiskInitializeParams _sourceSnapshot. */ + public _sourceSnapshot?: "sourceSnapshot"; + + /** AttachedDiskInitializeParams _sourceSnapshotEncryptionKey. */ + public _sourceSnapshotEncryptionKey?: "sourceSnapshotEncryptionKey"; + + /** + * Creates a new AttachedDiskInitializeParams instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedDiskInitializeParams instance + */ + public static create(properties?: google.cloud.compute.v1.IAttachedDiskInitializeParams): google.cloud.compute.v1.AttachedDiskInitializeParams; + + /** + * Encodes the specified AttachedDiskInitializeParams message. Does not implicitly {@link google.cloud.compute.v1.AttachedDiskInitializeParams.verify|verify} messages. + * @param message AttachedDiskInitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAttachedDiskInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedDiskInitializeParams message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachedDiskInitializeParams.verify|verify} messages. + * @param message AttachedDiskInitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAttachedDiskInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedDiskInitializeParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedDiskInitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AttachedDiskInitializeParams; + + /** + * Decodes an AttachedDiskInitializeParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedDiskInitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AttachedDiskInitializeParams; + + /** + * Verifies an AttachedDiskInitializeParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedDiskInitializeParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedDiskInitializeParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AttachedDiskInitializeParams; + + /** + * Creates a plain object from an AttachedDiskInitializeParams message. Also converts values to other types if specified. + * @param message AttachedDiskInitializeParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AttachedDiskInitializeParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedDiskInitializeParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AttachedDiskInitializeParams { + + /** OnUpdateAction enum. */ + enum OnUpdateAction { + UNDEFINED_ON_UPDATE_ACTION = 0, + RECREATE_DISK = 494767853, + RECREATE_DISK_IF_SOURCE_CHANGED = 398099712, + USE_EXISTING_DISK = 232682233 + } + } + + /** Properties of an InitialStateConfig. */ + interface IInitialStateConfig { + + /** InitialStateConfig dbs */ + dbs?: (google.cloud.compute.v1.IFileContentBuffer[]|null); + + /** InitialStateConfig dbxs */ + dbxs?: (google.cloud.compute.v1.IFileContentBuffer[]|null); + + /** InitialStateConfig keks */ + keks?: (google.cloud.compute.v1.IFileContentBuffer[]|null); + + /** InitialStateConfig pk */ + pk?: (google.cloud.compute.v1.IFileContentBuffer|null); + } + + /** Represents an InitialStateConfig. */ + class InitialStateConfig implements IInitialStateConfig { + + /** + * Constructs a new InitialStateConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInitialStateConfig); + + /** InitialStateConfig dbs. */ + public dbs: google.cloud.compute.v1.IFileContentBuffer[]; + + /** InitialStateConfig dbxs. */ + public dbxs: google.cloud.compute.v1.IFileContentBuffer[]; + + /** InitialStateConfig keks. */ + public keks: google.cloud.compute.v1.IFileContentBuffer[]; + + /** InitialStateConfig pk. */ + public pk?: (google.cloud.compute.v1.IFileContentBuffer|null); + + /** InitialStateConfig _pk. */ + public _pk?: "pk"; + + /** + * Creates a new InitialStateConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InitialStateConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IInitialStateConfig): google.cloud.compute.v1.InitialStateConfig; + + /** + * Encodes the specified InitialStateConfig message. Does not implicitly {@link google.cloud.compute.v1.InitialStateConfig.verify|verify} messages. + * @param message InitialStateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInitialStateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitialStateConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InitialStateConfig.verify|verify} messages. + * @param message InitialStateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInitialStateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitialStateConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitialStateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InitialStateConfig; + + /** + * Decodes an InitialStateConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitialStateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InitialStateConfig; + + /** + * Verifies an InitialStateConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitialStateConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitialStateConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InitialStateConfig; + + /** + * Creates a plain object from an InitialStateConfig message. Also converts values to other types if specified. + * @param message InitialStateConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InitialStateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitialStateConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { + + /** AttachedDisk autoDelete */ + autoDelete?: (boolean|null); + + /** AttachedDisk boot */ + boot?: (boolean|null); + + /** AttachedDisk deviceName */ + deviceName?: (string|null); + + /** AttachedDisk diskEncryptionKey */ + diskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk guestOsFeatures */ + guestOsFeatures?: (google.cloud.compute.v1.IGuestOsFeature[]|null); + + /** AttachedDisk index */ + index?: (number|null); + + /** AttachedDisk initializeParams */ + initializeParams?: (google.cloud.compute.v1.IAttachedDiskInitializeParams|null); + + /** AttachedDisk interface */ + "interface"?: (google.cloud.compute.v1.AttachedDisk.Interface|keyof typeof google.cloud.compute.v1.AttachedDisk.Interface|null); + + /** AttachedDisk kind */ + kind?: (string|null); + + /** AttachedDisk licenses */ + licenses?: (string[]|null); + + /** AttachedDisk mode */ + mode?: (google.cloud.compute.v1.AttachedDisk.Mode|keyof typeof google.cloud.compute.v1.AttachedDisk.Mode|null); + + /** AttachedDisk shieldedInstanceInitialState */ + shieldedInstanceInitialState?: (google.cloud.compute.v1.IInitialStateConfig|null); + + /** AttachedDisk source */ + source?: (string|null); + + /** AttachedDisk type */ + type?: (google.cloud.compute.v1.AttachedDisk.Type|keyof typeof google.cloud.compute.v1.AttachedDisk.Type|null); + } + + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { + + /** + * Constructs a new AttachedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAttachedDisk); + + /** AttachedDisk autoDelete. */ + public autoDelete?: (boolean|null); + + /** AttachedDisk boot. */ + public boot?: (boolean|null); + + /** AttachedDisk deviceName. */ + public deviceName?: (string|null); + + /** AttachedDisk diskEncryptionKey. */ + public diskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk guestOsFeatures. */ + public guestOsFeatures: google.cloud.compute.v1.IGuestOsFeature[]; + + /** AttachedDisk index. */ + public index?: (number|null); + + /** AttachedDisk initializeParams. */ + public initializeParams?: (google.cloud.compute.v1.IAttachedDiskInitializeParams|null); + + /** AttachedDisk interface. */ + public interface?: (google.cloud.compute.v1.AttachedDisk.Interface|keyof typeof google.cloud.compute.v1.AttachedDisk.Interface|null); + + /** AttachedDisk kind. */ + public kind?: (string|null); + + /** AttachedDisk licenses. */ + public licenses: string[]; + + /** AttachedDisk mode. */ + public mode?: (google.cloud.compute.v1.AttachedDisk.Mode|keyof typeof google.cloud.compute.v1.AttachedDisk.Mode|null); + + /** AttachedDisk shieldedInstanceInitialState. */ + public shieldedInstanceInitialState?: (google.cloud.compute.v1.IInitialStateConfig|null); + + /** AttachedDisk source. */ + public source?: (string|null); + + /** AttachedDisk type. */ + public type?: (google.cloud.compute.v1.AttachedDisk.Type|keyof typeof google.cloud.compute.v1.AttachedDisk.Type|null); + + /** AttachedDisk _autoDelete. */ + public _autoDelete?: "autoDelete"; + + /** AttachedDisk _boot. */ + public _boot?: "boot"; + + /** AttachedDisk _deviceName. */ + public _deviceName?: "deviceName"; + + /** AttachedDisk _diskEncryptionKey. */ + public _diskEncryptionKey?: "diskEncryptionKey"; + + /** AttachedDisk _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** AttachedDisk _index. */ + public _index?: "index"; + + /** AttachedDisk _initializeParams. */ + public _initializeParams?: "initializeParams"; + + /** AttachedDisk _interface. */ + public _interface?: "interface"; + + /** AttachedDisk _kind. */ + public _kind?: "kind"; + + /** AttachedDisk _mode. */ + public _mode?: "mode"; + + /** AttachedDisk _shieldedInstanceInitialState. */ + public _shieldedInstanceInitialState?: "shieldedInstanceInitialState"; + + /** AttachedDisk _source. */ + public _source?: "source"; + + /** AttachedDisk _type. */ + public _type?: "type"; + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedDisk instance + */ + public static create(properties?: google.cloud.compute.v1.IAttachedDisk): google.cloud.compute.v1.AttachedDisk; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.compute.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AttachedDisk; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AttachedDisk; + + /** + * Verifies an AttachedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AttachedDisk; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AttachedDisk { + + /** Interface enum. */ + enum Interface { + UNDEFINED_INTERFACE = 0, + NVME = 2408800, + SCSI = 2539686 + } + + /** Mode enum. */ + enum Mode { + UNDEFINED_MODE = 0, + READ_ONLY = 91950261, + READ_WRITE = 173607894 + } + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + PERSISTENT = 460683927, + SCRATCH = 496778970 + } + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + + /** AuditLogConfig ignoreChildExemptions */ + ignoreChildExemptions?: (boolean|null); + + /** AuditLogConfig logType */ + logType?: (google.cloud.compute.v1.AuditLogConfig.LogType|keyof typeof google.cloud.compute.v1.AuditLogConfig.LogType|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAuditLogConfig); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** AuditLogConfig ignoreChildExemptions. */ + public ignoreChildExemptions?: (boolean|null); + + /** AuditLogConfig logType. */ + public logType?: (google.cloud.compute.v1.AuditLogConfig.LogType|keyof typeof google.cloud.compute.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig _ignoreChildExemptions. */ + public _ignoreChildExemptions?: "ignoreChildExemptions"; + + /** AuditLogConfig _logType. */ + public _logType?: "logType"; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IAuditLogConfig): google.cloud.compute.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.cloud.compute.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.cloud.compute.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + UNDEFINED_LOG_TYPE = 0, + ADMIN_READ = 128951462, + DATA_READ = 305224971, + DATA_WRITE = 340181738, + LOG_TYPE_UNSPECIFIED = 154527053 + } + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.cloud.compute.v1.IAuditLogConfig[]|null); + + /** AuditConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + + /** AuditConfig service */ + service?: (string|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAuditConfig); + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.cloud.compute.v1.IAuditLogConfig[]; + + /** AuditConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** AuditConfig service. */ + public service?: (string|null); + + /** AuditConfig _service. */ + public _service?: "service"; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IAuditConfig): google.cloud.compute.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.cloud.compute.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.cloud.compute.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AuthorizationLoggingOptions. */ + interface IAuthorizationLoggingOptions { + + /** AuthorizationLoggingOptions permissionType */ + permissionType?: (google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType|keyof typeof google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType|null); + } + + /** Represents an AuthorizationLoggingOptions. */ + class AuthorizationLoggingOptions implements IAuthorizationLoggingOptions { + + /** + * Constructs a new AuthorizationLoggingOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAuthorizationLoggingOptions); + + /** AuthorizationLoggingOptions permissionType. */ + public permissionType?: (google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType|keyof typeof google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType|null); + + /** AuthorizationLoggingOptions _permissionType. */ + public _permissionType?: "permissionType"; + + /** + * Creates a new AuthorizationLoggingOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthorizationLoggingOptions instance + */ + public static create(properties?: google.cloud.compute.v1.IAuthorizationLoggingOptions): google.cloud.compute.v1.AuthorizationLoggingOptions; + + /** + * Encodes the specified AuthorizationLoggingOptions message. Does not implicitly {@link google.cloud.compute.v1.AuthorizationLoggingOptions.verify|verify} messages. + * @param message AuthorizationLoggingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAuthorizationLoggingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthorizationLoggingOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AuthorizationLoggingOptions.verify|verify} messages. + * @param message AuthorizationLoggingOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAuthorizationLoggingOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthorizationLoggingOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthorizationLoggingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AuthorizationLoggingOptions; + + /** + * Decodes an AuthorizationLoggingOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthorizationLoggingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AuthorizationLoggingOptions; + + /** + * Verifies an AuthorizationLoggingOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthorizationLoggingOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthorizationLoggingOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AuthorizationLoggingOptions; + + /** + * Creates a plain object from an AuthorizationLoggingOptions message. Also converts values to other types if specified. + * @param message AuthorizationLoggingOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AuthorizationLoggingOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthorizationLoggingOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AuthorizationLoggingOptions { + + /** PermissionType enum. */ + enum PermissionType { + UNDEFINED_PERMISSION_TYPE = 0, + ADMIN_READ = 128951462, + ADMIN_WRITE = 244412079, + DATA_READ = 305224971, + DATA_WRITE = 340181738, + PERMISSION_TYPE_UNSPECIFIED = 440313346 + } + } + + /** Properties of an AutoscalingPolicy. */ + interface IAutoscalingPolicy { + + /** AutoscalingPolicy coolDownPeriodSec */ + coolDownPeriodSec?: (number|null); + + /** AutoscalingPolicy cpuUtilization */ + cpuUtilization?: (google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization|null); + + /** AutoscalingPolicy customMetricUtilizations */ + customMetricUtilizations?: (google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization[]|null); + + /** AutoscalingPolicy loadBalancingUtilization */ + loadBalancingUtilization?: (google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization|null); + + /** AutoscalingPolicy maxNumReplicas */ + maxNumReplicas?: (number|null); + + /** AutoscalingPolicy minNumReplicas */ + minNumReplicas?: (number|null); + + /** AutoscalingPolicy mode */ + mode?: (google.cloud.compute.v1.AutoscalingPolicy.Mode|keyof typeof google.cloud.compute.v1.AutoscalingPolicy.Mode|null); + + /** AutoscalingPolicy scaleInControl */ + scaleInControl?: (google.cloud.compute.v1.IAutoscalingPolicyScaleInControl|null); + + /** AutoscalingPolicy scalingSchedules */ + scalingSchedules?: ({ [k: string]: google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule }|null); + } + + /** Represents an AutoscalingPolicy. */ + class AutoscalingPolicy implements IAutoscalingPolicy { + + /** + * Constructs a new AutoscalingPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalingPolicy); + + /** AutoscalingPolicy coolDownPeriodSec. */ + public coolDownPeriodSec?: (number|null); + + /** AutoscalingPolicy cpuUtilization. */ + public cpuUtilization?: (google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization|null); + + /** AutoscalingPolicy customMetricUtilizations. */ + public customMetricUtilizations: google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization[]; + + /** AutoscalingPolicy loadBalancingUtilization. */ + public loadBalancingUtilization?: (google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization|null); + + /** AutoscalingPolicy maxNumReplicas. */ + public maxNumReplicas?: (number|null); + + /** AutoscalingPolicy minNumReplicas. */ + public minNumReplicas?: (number|null); + + /** AutoscalingPolicy mode. */ + public mode?: (google.cloud.compute.v1.AutoscalingPolicy.Mode|keyof typeof google.cloud.compute.v1.AutoscalingPolicy.Mode|null); + + /** AutoscalingPolicy scaleInControl. */ + public scaleInControl?: (google.cloud.compute.v1.IAutoscalingPolicyScaleInControl|null); + + /** AutoscalingPolicy scalingSchedules. */ + public scalingSchedules: { [k: string]: google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule }; + + /** AutoscalingPolicy _coolDownPeriodSec. */ + public _coolDownPeriodSec?: "coolDownPeriodSec"; + + /** AutoscalingPolicy _cpuUtilization. */ + public _cpuUtilization?: "cpuUtilization"; + + /** AutoscalingPolicy _loadBalancingUtilization. */ + public _loadBalancingUtilization?: "loadBalancingUtilization"; + + /** AutoscalingPolicy _maxNumReplicas. */ + public _maxNumReplicas?: "maxNumReplicas"; + + /** AutoscalingPolicy _minNumReplicas. */ + public _minNumReplicas?: "minNumReplicas"; + + /** AutoscalingPolicy _mode. */ + public _mode?: "mode"; + + /** AutoscalingPolicy _scaleInControl. */ + public _scaleInControl?: "scaleInControl"; + + /** + * Creates a new AutoscalingPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalingPolicy): google.cloud.compute.v1.AutoscalingPolicy; + + /** + * Encodes the specified AutoscalingPolicy message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicy.verify|verify} messages. + * @param message AutoscalingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicy.verify|verify} messages. + * @param message AutoscalingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalingPolicy; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalingPolicy; + + /** + * Verifies an AutoscalingPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalingPolicy; + + /** + * Creates a plain object from an AutoscalingPolicy message. Also converts values to other types if specified. + * @param message AutoscalingPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AutoscalingPolicy { + + /** Mode enum. */ + enum Mode { + UNDEFINED_MODE = 0, + OFF = 78159, + ON = 2527, + ONLY_SCALE_OUT = 152713670, + ONLY_UP = 478095374 + } + } + + /** Properties of a ScalingScheduleStatus. */ + interface IScalingScheduleStatus { + + /** ScalingScheduleStatus lastStartTime */ + lastStartTime?: (string|null); + + /** ScalingScheduleStatus nextStartTime */ + nextStartTime?: (string|null); + + /** ScalingScheduleStatus state */ + state?: (google.cloud.compute.v1.ScalingScheduleStatus.State|keyof typeof google.cloud.compute.v1.ScalingScheduleStatus.State|null); + } + + /** Represents a ScalingScheduleStatus. */ + class ScalingScheduleStatus implements IScalingScheduleStatus { + + /** + * Constructs a new ScalingScheduleStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IScalingScheduleStatus); + + /** ScalingScheduleStatus lastStartTime. */ + public lastStartTime?: (string|null); + + /** ScalingScheduleStatus nextStartTime. */ + public nextStartTime?: (string|null); + + /** ScalingScheduleStatus state. */ + public state?: (google.cloud.compute.v1.ScalingScheduleStatus.State|keyof typeof google.cloud.compute.v1.ScalingScheduleStatus.State|null); + + /** ScalingScheduleStatus _lastStartTime. */ + public _lastStartTime?: "lastStartTime"; + + /** ScalingScheduleStatus _nextStartTime. */ + public _nextStartTime?: "nextStartTime"; + + /** ScalingScheduleStatus _state. */ + public _state?: "state"; + + /** + * Creates a new ScalingScheduleStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ScalingScheduleStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IScalingScheduleStatus): google.cloud.compute.v1.ScalingScheduleStatus; + + /** + * Encodes the specified ScalingScheduleStatus message. Does not implicitly {@link google.cloud.compute.v1.ScalingScheduleStatus.verify|verify} messages. + * @param message ScalingScheduleStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IScalingScheduleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScalingScheduleStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ScalingScheduleStatus.verify|verify} messages. + * @param message ScalingScheduleStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IScalingScheduleStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScalingScheduleStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScalingScheduleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ScalingScheduleStatus; + + /** + * Decodes a ScalingScheduleStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScalingScheduleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ScalingScheduleStatus; + + /** + * Verifies a ScalingScheduleStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScalingScheduleStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScalingScheduleStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ScalingScheduleStatus; + + /** + * Creates a plain object from a ScalingScheduleStatus message. Also converts values to other types if specified. + * @param message ScalingScheduleStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ScalingScheduleStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScalingScheduleStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ScalingScheduleStatus { + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + ACTIVE = 314733318, + DISABLED = 516696700, + OBSOLETE = 66532761, + READY = 77848963 + } + } + + /** Properties of an AutoscalerStatusDetails. */ + interface IAutoscalerStatusDetails { + + /** AutoscalerStatusDetails message */ + message?: (string|null); + + /** AutoscalerStatusDetails type */ + type?: (google.cloud.compute.v1.AutoscalerStatusDetails.Type|keyof typeof google.cloud.compute.v1.AutoscalerStatusDetails.Type|null); + } + + /** Represents an AutoscalerStatusDetails. */ + class AutoscalerStatusDetails implements IAutoscalerStatusDetails { + + /** + * Constructs a new AutoscalerStatusDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalerStatusDetails); + + /** AutoscalerStatusDetails message. */ + public message?: (string|null); + + /** AutoscalerStatusDetails type. */ + public type?: (google.cloud.compute.v1.AutoscalerStatusDetails.Type|keyof typeof google.cloud.compute.v1.AutoscalerStatusDetails.Type|null); + + /** AutoscalerStatusDetails _message. */ + public _message?: "message"; + + /** AutoscalerStatusDetails _type. */ + public _type?: "type"; + + /** + * Creates a new AutoscalerStatusDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalerStatusDetails instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalerStatusDetails): google.cloud.compute.v1.AutoscalerStatusDetails; + + /** + * Encodes the specified AutoscalerStatusDetails message. Does not implicitly {@link google.cloud.compute.v1.AutoscalerStatusDetails.verify|verify} messages. + * @param message AutoscalerStatusDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalerStatusDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalerStatusDetails message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalerStatusDetails.verify|verify} messages. + * @param message AutoscalerStatusDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalerStatusDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalerStatusDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalerStatusDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalerStatusDetails; + + /** + * Decodes an AutoscalerStatusDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalerStatusDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalerStatusDetails; + + /** + * Verifies an AutoscalerStatusDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalerStatusDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalerStatusDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalerStatusDetails; + + /** + * Creates a plain object from an AutoscalerStatusDetails message. Also converts values to other types if specified. + * @param message AutoscalerStatusDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalerStatusDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalerStatusDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AutoscalerStatusDetails { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + ALL_INSTANCES_UNHEALTHY = 404965477, + BACKEND_SERVICE_DOES_NOT_EXIST = 191417626, + CAPPED_AT_MAX_NUM_REPLICAS = 518617, + CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE = 328964659, + CUSTOM_METRIC_INVALID = 204430550, + MIN_EQUALS_MAX = 2821361, + MISSING_CUSTOM_METRIC_DATA_POINTS = 94885086, + MISSING_LOAD_BALANCING_DATA_POINTS = 509858898, + MODE_OFF = 164169907, + MODE_ONLY_SCALE_OUT = 3840994, + MODE_ONLY_UP = 100969842, + MORE_THAN_ONE_BACKEND_SERVICE = 151922141, + NOT_ENOUGH_QUOTA_AVAILABLE = 403101631, + REGION_RESOURCE_STOCKOUT = 528622846, + SCALING_TARGET_DOES_NOT_EXIST = 122636699, + SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX = 29275586, + SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN = 398287669, + UNKNOWN = 433141802, + UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION = 330845009, + ZONE_RESOURCE_STOCKOUT = 210200502 + } + } + + /** Properties of an Autoscaler. */ + interface IAutoscaler { + + /** Autoscaler autoscalingPolicy */ + autoscalingPolicy?: (google.cloud.compute.v1.IAutoscalingPolicy|null); + + /** Autoscaler creationTimestamp */ + creationTimestamp?: (string|null); + + /** Autoscaler description */ + description?: (string|null); + + /** Autoscaler id */ + id?: (number|Long|string|null); + + /** Autoscaler kind */ + kind?: (string|null); + + /** Autoscaler name */ + name?: (string|null); + + /** Autoscaler recommendedSize */ + recommendedSize?: (number|null); + + /** Autoscaler region */ + region?: (string|null); + + /** Autoscaler scalingScheduleStatus */ + scalingScheduleStatus?: ({ [k: string]: google.cloud.compute.v1.IScalingScheduleStatus }|null); + + /** Autoscaler selfLink */ + selfLink?: (string|null); + + /** Autoscaler status */ + status?: (google.cloud.compute.v1.Autoscaler.Status|keyof typeof google.cloud.compute.v1.Autoscaler.Status|null); + + /** Autoscaler statusDetails */ + statusDetails?: (google.cloud.compute.v1.IAutoscalerStatusDetails[]|null); + + /** Autoscaler target */ + target?: (string|null); + + /** Autoscaler zone */ + zone?: (string|null); + } + + /** Represents an Autoscaler. */ + class Autoscaler implements IAutoscaler { + + /** + * Constructs a new Autoscaler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscaler); + + /** Autoscaler autoscalingPolicy. */ + public autoscalingPolicy?: (google.cloud.compute.v1.IAutoscalingPolicy|null); + + /** Autoscaler creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Autoscaler description. */ + public description?: (string|null); + + /** Autoscaler id. */ + public id?: (number|Long|string|null); + + /** Autoscaler kind. */ + public kind?: (string|null); + + /** Autoscaler name. */ + public name?: (string|null); + + /** Autoscaler recommendedSize. */ + public recommendedSize?: (number|null); + + /** Autoscaler region. */ + public region?: (string|null); + + /** Autoscaler scalingScheduleStatus. */ + public scalingScheduleStatus: { [k: string]: google.cloud.compute.v1.IScalingScheduleStatus }; + + /** Autoscaler selfLink. */ + public selfLink?: (string|null); + + /** Autoscaler status. */ + public status?: (google.cloud.compute.v1.Autoscaler.Status|keyof typeof google.cloud.compute.v1.Autoscaler.Status|null); + + /** Autoscaler statusDetails. */ + public statusDetails: google.cloud.compute.v1.IAutoscalerStatusDetails[]; + + /** Autoscaler target. */ + public target?: (string|null); + + /** Autoscaler zone. */ + public zone?: (string|null); + + /** Autoscaler _autoscalingPolicy. */ + public _autoscalingPolicy?: "autoscalingPolicy"; + + /** Autoscaler _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Autoscaler _description. */ + public _description?: "description"; + + /** Autoscaler _id. */ + public _id?: "id"; + + /** Autoscaler _kind. */ + public _kind?: "kind"; + + /** Autoscaler _name. */ + public _name?: "name"; + + /** Autoscaler _recommendedSize. */ + public _recommendedSize?: "recommendedSize"; + + /** Autoscaler _region. */ + public _region?: "region"; + + /** Autoscaler _selfLink. */ + public _selfLink?: "selfLink"; + + /** Autoscaler _status. */ + public _status?: "status"; + + /** Autoscaler _target. */ + public _target?: "target"; + + /** Autoscaler _zone. */ + public _zone?: "zone"; + + /** + * Creates a new Autoscaler instance using the specified properties. + * @param [properties] Properties to set + * @returns Autoscaler instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscaler): google.cloud.compute.v1.Autoscaler; + + /** + * Encodes the specified Autoscaler message. Does not implicitly {@link google.cloud.compute.v1.Autoscaler.verify|verify} messages. + * @param message Autoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Autoscaler message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Autoscaler.verify|verify} messages. + * @param message Autoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Autoscaler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Autoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Autoscaler; + + /** + * Decodes an Autoscaler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Autoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Autoscaler; + + /** + * Verifies an Autoscaler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Autoscaler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Autoscaler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Autoscaler; + + /** + * Creates a plain object from an Autoscaler message. Also converts values to other types if specified. + * @param message Autoscaler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Autoscaler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Autoscaler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Autoscaler { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + ACTIVE = 314733318, + DELETING = 528602024, + ERROR = 66247144, + PENDING = 35394935 + } + } + + /** Properties of an AutoscalersScopedList. */ + interface IAutoscalersScopedList { + + /** AutoscalersScopedList autoscalers */ + autoscalers?: (google.cloud.compute.v1.IAutoscaler[]|null); + + /** AutoscalersScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AutoscalersScopedList. */ + class AutoscalersScopedList implements IAutoscalersScopedList { + + /** + * Constructs a new AutoscalersScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalersScopedList); + + /** AutoscalersScopedList autoscalers. */ + public autoscalers: google.cloud.compute.v1.IAutoscaler[]; + + /** AutoscalersScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AutoscalersScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AutoscalersScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalersScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalersScopedList): google.cloud.compute.v1.AutoscalersScopedList; + + /** + * Encodes the specified AutoscalersScopedList message. Does not implicitly {@link google.cloud.compute.v1.AutoscalersScopedList.verify|verify} messages. + * @param message AutoscalersScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalersScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalersScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalersScopedList.verify|verify} messages. + * @param message AutoscalersScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalersScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalersScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalersScopedList; + + /** + * Decodes an AutoscalersScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalersScopedList; + + /** + * Verifies an AutoscalersScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalersScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalersScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalersScopedList; + + /** + * Creates a plain object from an AutoscalersScopedList message. Also converts values to other types if specified. + * @param message AutoscalersScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalersScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalersScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AutoscalerAggregatedList. */ + interface IAutoscalerAggregatedList { + + /** AutoscalerAggregatedList id */ + id?: (string|null); + + /** AutoscalerAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IAutoscalersScopedList }|null); + + /** AutoscalerAggregatedList kind */ + kind?: (string|null); + + /** AutoscalerAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** AutoscalerAggregatedList selfLink */ + selfLink?: (string|null); + + /** AutoscalerAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** AutoscalerAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AutoscalerAggregatedList. */ + class AutoscalerAggregatedList implements IAutoscalerAggregatedList { + + /** + * Constructs a new AutoscalerAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalerAggregatedList); + + /** AutoscalerAggregatedList id. */ + public id?: (string|null); + + /** AutoscalerAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IAutoscalersScopedList }; + + /** AutoscalerAggregatedList kind. */ + public kind?: (string|null); + + /** AutoscalerAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** AutoscalerAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** AutoscalerAggregatedList unreachables. */ + public unreachables: string[]; + + /** AutoscalerAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AutoscalerAggregatedList _id. */ + public _id?: "id"; + + /** AutoscalerAggregatedList _kind. */ + public _kind?: "kind"; + + /** AutoscalerAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** AutoscalerAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** AutoscalerAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AutoscalerAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalerAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalerAggregatedList): google.cloud.compute.v1.AutoscalerAggregatedList; + + /** + * Encodes the specified AutoscalerAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.AutoscalerAggregatedList.verify|verify} messages. + * @param message AutoscalerAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalerAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalerAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalerAggregatedList.verify|verify} messages. + * @param message AutoscalerAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalerAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalerAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalerAggregatedList; + + /** + * Decodes an AutoscalerAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalerAggregatedList; + + /** + * Verifies an AutoscalerAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalerAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalerAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalerAggregatedList; + + /** + * Creates a plain object from an AutoscalerAggregatedList message. Also converts values to other types if specified. + * @param message AutoscalerAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalerAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalerAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AutoscalerList. */ + interface IAutoscalerList { + + /** AutoscalerList id */ + id?: (string|null); + + /** AutoscalerList items */ + items?: (google.cloud.compute.v1.IAutoscaler[]|null); + + /** AutoscalerList kind */ + kind?: (string|null); + + /** AutoscalerList nextPageToken */ + nextPageToken?: (string|null); + + /** AutoscalerList selfLink */ + selfLink?: (string|null); + + /** AutoscalerList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an AutoscalerList. */ + class AutoscalerList implements IAutoscalerList { + + /** + * Constructs a new AutoscalerList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalerList); + + /** AutoscalerList id. */ + public id?: (string|null); + + /** AutoscalerList items. */ + public items: google.cloud.compute.v1.IAutoscaler[]; + + /** AutoscalerList kind. */ + public kind?: (string|null); + + /** AutoscalerList nextPageToken. */ + public nextPageToken?: (string|null); + + /** AutoscalerList selfLink. */ + public selfLink?: (string|null); + + /** AutoscalerList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** AutoscalerList _id. */ + public _id?: "id"; + + /** AutoscalerList _kind. */ + public _kind?: "kind"; + + /** AutoscalerList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** AutoscalerList _selfLink. */ + public _selfLink?: "selfLink"; + + /** AutoscalerList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new AutoscalerList instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalerList instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalerList): google.cloud.compute.v1.AutoscalerList; + + /** + * Encodes the specified AutoscalerList message. Does not implicitly {@link google.cloud.compute.v1.AutoscalerList.verify|verify} messages. + * @param message AutoscalerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalerList.verify|verify} messages. + * @param message AutoscalerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalerList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalerList; + + /** + * Decodes an AutoscalerList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalerList; + + /** + * Verifies an AutoscalerList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalerList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalerList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalerList; + + /** + * Creates a plain object from an AutoscalerList message. Also converts values to other types if specified. + * @param message AutoscalerList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalerList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalerList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AutoscalingPolicyCpuUtilization. */ + interface IAutoscalingPolicyCpuUtilization { + + /** AutoscalingPolicyCpuUtilization predictiveMethod */ + predictiveMethod?: (google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod|keyof typeof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod|null); + + /** AutoscalingPolicyCpuUtilization utilizationTarget */ + utilizationTarget?: (number|null); + } + + /** Represents an AutoscalingPolicyCpuUtilization. */ + class AutoscalingPolicyCpuUtilization implements IAutoscalingPolicyCpuUtilization { + + /** + * Constructs a new AutoscalingPolicyCpuUtilization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization); + + /** AutoscalingPolicyCpuUtilization predictiveMethod. */ + public predictiveMethod?: (google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod|keyof typeof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod|null); + + /** AutoscalingPolicyCpuUtilization utilizationTarget. */ + public utilizationTarget?: (number|null); + + /** AutoscalingPolicyCpuUtilization _predictiveMethod. */ + public _predictiveMethod?: "predictiveMethod"; + + /** AutoscalingPolicyCpuUtilization _utilizationTarget. */ + public _utilizationTarget?: "utilizationTarget"; + + /** + * Creates a new AutoscalingPolicyCpuUtilization instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingPolicyCpuUtilization instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization): google.cloud.compute.v1.AutoscalingPolicyCpuUtilization; + + /** + * Encodes the specified AutoscalingPolicyCpuUtilization message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.verify|verify} messages. + * @param message AutoscalingPolicyCpuUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingPolicyCpuUtilization message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.verify|verify} messages. + * @param message AutoscalingPolicyCpuUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingPolicyCpuUtilization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingPolicyCpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalingPolicyCpuUtilization; + + /** + * Decodes an AutoscalingPolicyCpuUtilization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingPolicyCpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalingPolicyCpuUtilization; + + /** + * Verifies an AutoscalingPolicyCpuUtilization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingPolicyCpuUtilization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingPolicyCpuUtilization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalingPolicyCpuUtilization; + + /** + * Creates a plain object from an AutoscalingPolicyCpuUtilization message. Also converts values to other types if specified. + * @param message AutoscalingPolicyCpuUtilization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalingPolicyCpuUtilization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingPolicyCpuUtilization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AutoscalingPolicyCpuUtilization { + + /** PredictiveMethod enum. */ + enum PredictiveMethod { + UNDEFINED_PREDICTIVE_METHOD = 0, + NONE = 2402104, + OPTIMIZE_AVAILABILITY = 11629437 + } + } + + /** Properties of an AutoscalingPolicyCustomMetricUtilization. */ + interface IAutoscalingPolicyCustomMetricUtilization { + + /** AutoscalingPolicyCustomMetricUtilization filter */ + filter?: (string|null); + + /** AutoscalingPolicyCustomMetricUtilization metric */ + metric?: (string|null); + + /** AutoscalingPolicyCustomMetricUtilization singleInstanceAssignment */ + singleInstanceAssignment?: (number|null); + + /** AutoscalingPolicyCustomMetricUtilization utilizationTarget */ + utilizationTarget?: (number|null); + + /** AutoscalingPolicyCustomMetricUtilization utilizationTargetType */ + utilizationTargetType?: (google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType|keyof typeof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType|null); + } + + /** Represents an AutoscalingPolicyCustomMetricUtilization. */ + class AutoscalingPolicyCustomMetricUtilization implements IAutoscalingPolicyCustomMetricUtilization { + + /** + * Constructs a new AutoscalingPolicyCustomMetricUtilization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization); + + /** AutoscalingPolicyCustomMetricUtilization filter. */ + public filter?: (string|null); + + /** AutoscalingPolicyCustomMetricUtilization metric. */ + public metric?: (string|null); + + /** AutoscalingPolicyCustomMetricUtilization singleInstanceAssignment. */ + public singleInstanceAssignment?: (number|null); + + /** AutoscalingPolicyCustomMetricUtilization utilizationTarget. */ + public utilizationTarget?: (number|null); + + /** AutoscalingPolicyCustomMetricUtilization utilizationTargetType. */ + public utilizationTargetType?: (google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType|keyof typeof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType|null); + + /** AutoscalingPolicyCustomMetricUtilization _filter. */ + public _filter?: "filter"; + + /** AutoscalingPolicyCustomMetricUtilization _metric. */ + public _metric?: "metric"; + + /** AutoscalingPolicyCustomMetricUtilization _singleInstanceAssignment. */ + public _singleInstanceAssignment?: "singleInstanceAssignment"; + + /** AutoscalingPolicyCustomMetricUtilization _utilizationTarget. */ + public _utilizationTarget?: "utilizationTarget"; + + /** AutoscalingPolicyCustomMetricUtilization _utilizationTargetType. */ + public _utilizationTargetType?: "utilizationTargetType"; + + /** + * Creates a new AutoscalingPolicyCustomMetricUtilization instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingPolicyCustomMetricUtilization instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization): google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization; + + /** + * Encodes the specified AutoscalingPolicyCustomMetricUtilization message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.verify|verify} messages. + * @param message AutoscalingPolicyCustomMetricUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingPolicyCustomMetricUtilization message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.verify|verify} messages. + * @param message AutoscalingPolicyCustomMetricUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingPolicyCustomMetricUtilization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingPolicyCustomMetricUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization; + + /** + * Decodes an AutoscalingPolicyCustomMetricUtilization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingPolicyCustomMetricUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization; + + /** + * Verifies an AutoscalingPolicyCustomMetricUtilization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingPolicyCustomMetricUtilization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingPolicyCustomMetricUtilization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization; + + /** + * Creates a plain object from an AutoscalingPolicyCustomMetricUtilization message. Also converts values to other types if specified. + * @param message AutoscalingPolicyCustomMetricUtilization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingPolicyCustomMetricUtilization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AutoscalingPolicyCustomMetricUtilization { + + /** UtilizationTargetType enum. */ + enum UtilizationTargetType { + UNDEFINED_UTILIZATION_TARGET_TYPE = 0, + DELTA_PER_MINUTE = 87432861, + DELTA_PER_SECOND = 255180029, + GAUGE = 67590361 + } + } + + /** Properties of an AutoscalingPolicyLoadBalancingUtilization. */ + interface IAutoscalingPolicyLoadBalancingUtilization { + + /** AutoscalingPolicyLoadBalancingUtilization utilizationTarget */ + utilizationTarget?: (number|null); + } + + /** Represents an AutoscalingPolicyLoadBalancingUtilization. */ + class AutoscalingPolicyLoadBalancingUtilization implements IAutoscalingPolicyLoadBalancingUtilization { + + /** + * Constructs a new AutoscalingPolicyLoadBalancingUtilization. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization); + + /** AutoscalingPolicyLoadBalancingUtilization utilizationTarget. */ + public utilizationTarget?: (number|null); + + /** AutoscalingPolicyLoadBalancingUtilization _utilizationTarget. */ + public _utilizationTarget?: "utilizationTarget"; + + /** + * Creates a new AutoscalingPolicyLoadBalancingUtilization instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingPolicyLoadBalancingUtilization instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization): google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization; + + /** + * Encodes the specified AutoscalingPolicyLoadBalancingUtilization message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.verify|verify} messages. + * @param message AutoscalingPolicyLoadBalancingUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingPolicyLoadBalancingUtilization message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.verify|verify} messages. + * @param message AutoscalingPolicyLoadBalancingUtilization message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingPolicyLoadBalancingUtilization message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingPolicyLoadBalancingUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization; + + /** + * Decodes an AutoscalingPolicyLoadBalancingUtilization message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingPolicyLoadBalancingUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization; + + /** + * Verifies an AutoscalingPolicyLoadBalancingUtilization message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingPolicyLoadBalancingUtilization message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingPolicyLoadBalancingUtilization + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization; + + /** + * Creates a plain object from an AutoscalingPolicyLoadBalancingUtilization message. Also converts values to other types if specified. + * @param message AutoscalingPolicyLoadBalancingUtilization + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingPolicyLoadBalancingUtilization to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AutoscalingPolicyScaleInControl. */ + interface IAutoscalingPolicyScaleInControl { + + /** AutoscalingPolicyScaleInControl maxScaledInReplicas */ + maxScaledInReplicas?: (google.cloud.compute.v1.IFixedOrPercent|null); + + /** AutoscalingPolicyScaleInControl timeWindowSec */ + timeWindowSec?: (number|null); + } + + /** Represents an AutoscalingPolicyScaleInControl. */ + class AutoscalingPolicyScaleInControl implements IAutoscalingPolicyScaleInControl { + + /** + * Constructs a new AutoscalingPolicyScaleInControl. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalingPolicyScaleInControl); + + /** AutoscalingPolicyScaleInControl maxScaledInReplicas. */ + public maxScaledInReplicas?: (google.cloud.compute.v1.IFixedOrPercent|null); + + /** AutoscalingPolicyScaleInControl timeWindowSec. */ + public timeWindowSec?: (number|null); + + /** AutoscalingPolicyScaleInControl _maxScaledInReplicas. */ + public _maxScaledInReplicas?: "maxScaledInReplicas"; + + /** AutoscalingPolicyScaleInControl _timeWindowSec. */ + public _timeWindowSec?: "timeWindowSec"; + + /** + * Creates a new AutoscalingPolicyScaleInControl instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingPolicyScaleInControl instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalingPolicyScaleInControl): google.cloud.compute.v1.AutoscalingPolicyScaleInControl; + + /** + * Encodes the specified AutoscalingPolicyScaleInControl message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScaleInControl.verify|verify} messages. + * @param message AutoscalingPolicyScaleInControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalingPolicyScaleInControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingPolicyScaleInControl message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScaleInControl.verify|verify} messages. + * @param message AutoscalingPolicyScaleInControl message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalingPolicyScaleInControl, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingPolicyScaleInControl message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingPolicyScaleInControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalingPolicyScaleInControl; + + /** + * Decodes an AutoscalingPolicyScaleInControl message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingPolicyScaleInControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalingPolicyScaleInControl; + + /** + * Verifies an AutoscalingPolicyScaleInControl message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingPolicyScaleInControl message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingPolicyScaleInControl + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalingPolicyScaleInControl; + + /** + * Creates a plain object from an AutoscalingPolicyScaleInControl message. Also converts values to other types if specified. + * @param message AutoscalingPolicyScaleInControl + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalingPolicyScaleInControl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingPolicyScaleInControl to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AutoscalingPolicyScalingSchedule. */ + interface IAutoscalingPolicyScalingSchedule { + + /** AutoscalingPolicyScalingSchedule description */ + description?: (string|null); + + /** AutoscalingPolicyScalingSchedule disabled */ + disabled?: (boolean|null); + + /** AutoscalingPolicyScalingSchedule durationSec */ + durationSec?: (number|null); + + /** AutoscalingPolicyScalingSchedule minRequiredReplicas */ + minRequiredReplicas?: (number|null); + + /** AutoscalingPolicyScalingSchedule schedule */ + schedule?: (string|null); + + /** AutoscalingPolicyScalingSchedule timeZone */ + timeZone?: (string|null); + } + + /** Represents an AutoscalingPolicyScalingSchedule. */ + class AutoscalingPolicyScalingSchedule implements IAutoscalingPolicyScalingSchedule { + + /** + * Constructs a new AutoscalingPolicyScalingSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule); + + /** AutoscalingPolicyScalingSchedule description. */ + public description?: (string|null); + + /** AutoscalingPolicyScalingSchedule disabled. */ + public disabled?: (boolean|null); + + /** AutoscalingPolicyScalingSchedule durationSec. */ + public durationSec?: (number|null); + + /** AutoscalingPolicyScalingSchedule minRequiredReplicas. */ + public minRequiredReplicas?: (number|null); + + /** AutoscalingPolicyScalingSchedule schedule. */ + public schedule?: (string|null); + + /** AutoscalingPolicyScalingSchedule timeZone. */ + public timeZone?: (string|null); + + /** AutoscalingPolicyScalingSchedule _description. */ + public _description?: "description"; + + /** AutoscalingPolicyScalingSchedule _disabled. */ + public _disabled?: "disabled"; + + /** AutoscalingPolicyScalingSchedule _durationSec. */ + public _durationSec?: "durationSec"; + + /** AutoscalingPolicyScalingSchedule _minRequiredReplicas. */ + public _minRequiredReplicas?: "minRequiredReplicas"; + + /** AutoscalingPolicyScalingSchedule _schedule. */ + public _schedule?: "schedule"; + + /** AutoscalingPolicyScalingSchedule _timeZone. */ + public _timeZone?: "timeZone"; + + /** + * Creates a new AutoscalingPolicyScalingSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingPolicyScalingSchedule instance + */ + public static create(properties?: google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule): google.cloud.compute.v1.AutoscalingPolicyScalingSchedule; + + /** + * Encodes the specified AutoscalingPolicyScalingSchedule message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.verify|verify} messages. + * @param message AutoscalingPolicyScalingSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingPolicyScalingSchedule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.verify|verify} messages. + * @param message AutoscalingPolicyScalingSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingPolicyScalingSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingPolicyScalingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AutoscalingPolicyScalingSchedule; + + /** + * Decodes an AutoscalingPolicyScalingSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingPolicyScalingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AutoscalingPolicyScalingSchedule; + + /** + * Verifies an AutoscalingPolicyScalingSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingPolicyScalingSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingPolicyScalingSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AutoscalingPolicyScalingSchedule; + + /** + * Creates a plain object from an AutoscalingPolicyScalingSchedule message. Also converts values to other types if specified. + * @param message AutoscalingPolicyScalingSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AutoscalingPolicyScalingSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingPolicyScalingSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FixedOrPercent. */ + interface IFixedOrPercent { + + /** FixedOrPercent calculated */ + calculated?: (number|null); + + /** FixedOrPercent fixed */ + fixed?: (number|null); + + /** FixedOrPercent percent */ + percent?: (number|null); + } + + /** Represents a FixedOrPercent. */ + class FixedOrPercent implements IFixedOrPercent { + + /** + * Constructs a new FixedOrPercent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFixedOrPercent); + + /** FixedOrPercent calculated. */ + public calculated?: (number|null); + + /** FixedOrPercent fixed. */ + public fixed?: (number|null); + + /** FixedOrPercent percent. */ + public percent?: (number|null); + + /** FixedOrPercent _calculated. */ + public _calculated?: "calculated"; + + /** FixedOrPercent _fixed. */ + public _fixed?: "fixed"; + + /** FixedOrPercent _percent. */ + public _percent?: "percent"; + + /** + * Creates a new FixedOrPercent instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedOrPercent instance + */ + public static create(properties?: google.cloud.compute.v1.IFixedOrPercent): google.cloud.compute.v1.FixedOrPercent; + + /** + * Encodes the specified FixedOrPercent message. Does not implicitly {@link google.cloud.compute.v1.FixedOrPercent.verify|verify} messages. + * @param message FixedOrPercent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFixedOrPercent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FixedOrPercent message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FixedOrPercent.verify|verify} messages. + * @param message FixedOrPercent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFixedOrPercent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FixedOrPercent; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FixedOrPercent; + + /** + * Verifies a FixedOrPercent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FixedOrPercent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FixedOrPercent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FixedOrPercent; + + /** + * Creates a plain object from a FixedOrPercent message. Also converts values to other types if specified. + * @param message FixedOrPercent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FixedOrPercent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FixedOrPercent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Backend. */ + interface IBackend { + + /** Backend balancingMode */ + balancingMode?: (google.cloud.compute.v1.Backend.BalancingMode|keyof typeof google.cloud.compute.v1.Backend.BalancingMode|null); + + /** Backend capacityScaler */ + capacityScaler?: (number|null); + + /** Backend description */ + description?: (string|null); + + /** Backend failover */ + failover?: (boolean|null); + + /** Backend group */ + group?: (string|null); + + /** Backend maxConnections */ + maxConnections?: (number|null); + + /** Backend maxConnectionsPerEndpoint */ + maxConnectionsPerEndpoint?: (number|null); + + /** Backend maxConnectionsPerInstance */ + maxConnectionsPerInstance?: (number|null); + + /** Backend maxRate */ + maxRate?: (number|null); + + /** Backend maxRatePerEndpoint */ + maxRatePerEndpoint?: (number|null); + + /** Backend maxRatePerInstance */ + maxRatePerInstance?: (number|null); + + /** Backend maxUtilization */ + maxUtilization?: (number|null); + } + + /** Represents a Backend. */ + class Backend implements IBackend { + + /** + * Constructs a new Backend. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackend); + + /** Backend balancingMode. */ + public balancingMode?: (google.cloud.compute.v1.Backend.BalancingMode|keyof typeof google.cloud.compute.v1.Backend.BalancingMode|null); + + /** Backend capacityScaler. */ + public capacityScaler?: (number|null); + + /** Backend description. */ + public description?: (string|null); + + /** Backend failover. */ + public failover?: (boolean|null); + + /** Backend group. */ + public group?: (string|null); + + /** Backend maxConnections. */ + public maxConnections?: (number|null); + + /** Backend maxConnectionsPerEndpoint. */ + public maxConnectionsPerEndpoint?: (number|null); + + /** Backend maxConnectionsPerInstance. */ + public maxConnectionsPerInstance?: (number|null); + + /** Backend maxRate. */ + public maxRate?: (number|null); + + /** Backend maxRatePerEndpoint. */ + public maxRatePerEndpoint?: (number|null); + + /** Backend maxRatePerInstance. */ + public maxRatePerInstance?: (number|null); + + /** Backend maxUtilization. */ + public maxUtilization?: (number|null); + + /** Backend _balancingMode. */ + public _balancingMode?: "balancingMode"; + + /** Backend _capacityScaler. */ + public _capacityScaler?: "capacityScaler"; + + /** Backend _description. */ + public _description?: "description"; + + /** Backend _failover. */ + public _failover?: "failover"; + + /** Backend _group. */ + public _group?: "group"; + + /** Backend _maxConnections. */ + public _maxConnections?: "maxConnections"; + + /** Backend _maxConnectionsPerEndpoint. */ + public _maxConnectionsPerEndpoint?: "maxConnectionsPerEndpoint"; + + /** Backend _maxConnectionsPerInstance. */ + public _maxConnectionsPerInstance?: "maxConnectionsPerInstance"; + + /** Backend _maxRate. */ + public _maxRate?: "maxRate"; + + /** Backend _maxRatePerEndpoint. */ + public _maxRatePerEndpoint?: "maxRatePerEndpoint"; + + /** Backend _maxRatePerInstance. */ + public _maxRatePerInstance?: "maxRatePerInstance"; + + /** Backend _maxUtilization. */ + public _maxUtilization?: "maxUtilization"; + + /** + * Creates a new Backend instance using the specified properties. + * @param [properties] Properties to set + * @returns Backend instance + */ + public static create(properties?: google.cloud.compute.v1.IBackend): google.cloud.compute.v1.Backend; + + /** + * Encodes the specified Backend message. Does not implicitly {@link google.cloud.compute.v1.Backend.verify|verify} messages. + * @param message Backend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backend message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Backend.verify|verify} messages. + * @param message Backend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backend message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Backend; + + /** + * Decodes a Backend message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Backend; + + /** + * Verifies a Backend message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backend message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backend + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Backend; + + /** + * Creates a plain object from a Backend message. Also converts values to other types if specified. + * @param message Backend + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Backend, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backend to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Backend { + + /** BalancingMode enum. */ + enum BalancingMode { + UNDEFINED_BALANCING_MODE = 0, + CONNECTION = 246311646, + RATE = 2508000, + UTILIZATION = 157008386 + } + } + + /** Properties of a BackendBucketCdnPolicy. */ + interface IBackendBucketCdnPolicy { + + /** BackendBucketCdnPolicy bypassCacheOnRequestHeaders */ + bypassCacheOnRequestHeaders?: (google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader[]|null); + + /** BackendBucketCdnPolicy cacheMode */ + cacheMode?: (google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode|keyof typeof google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode|null); + + /** BackendBucketCdnPolicy clientTtl */ + clientTtl?: (number|null); + + /** BackendBucketCdnPolicy defaultTtl */ + defaultTtl?: (number|null); + + /** BackendBucketCdnPolicy maxTtl */ + maxTtl?: (number|null); + + /** BackendBucketCdnPolicy negativeCaching */ + negativeCaching?: (boolean|null); + + /** BackendBucketCdnPolicy negativeCachingPolicy */ + negativeCachingPolicy?: (google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy[]|null); + + /** BackendBucketCdnPolicy requestCoalescing */ + requestCoalescing?: (boolean|null); + + /** BackendBucketCdnPolicy serveWhileStale */ + serveWhileStale?: (number|null); + + /** BackendBucketCdnPolicy signedUrlCacheMaxAgeSec */ + signedUrlCacheMaxAgeSec?: (number|Long|string|null); + + /** BackendBucketCdnPolicy signedUrlKeyNames */ + signedUrlKeyNames?: (string[]|null); + } + + /** Represents a BackendBucketCdnPolicy. */ + class BackendBucketCdnPolicy implements IBackendBucketCdnPolicy { + + /** + * Constructs a new BackendBucketCdnPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendBucketCdnPolicy); + + /** BackendBucketCdnPolicy bypassCacheOnRequestHeaders. */ + public bypassCacheOnRequestHeaders: google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader[]; + + /** BackendBucketCdnPolicy cacheMode. */ + public cacheMode?: (google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode|keyof typeof google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode|null); + + /** BackendBucketCdnPolicy clientTtl. */ + public clientTtl?: (number|null); + + /** BackendBucketCdnPolicy defaultTtl. */ + public defaultTtl?: (number|null); + + /** BackendBucketCdnPolicy maxTtl. */ + public maxTtl?: (number|null); + + /** BackendBucketCdnPolicy negativeCaching. */ + public negativeCaching?: (boolean|null); + + /** BackendBucketCdnPolicy negativeCachingPolicy. */ + public negativeCachingPolicy: google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy[]; + + /** BackendBucketCdnPolicy requestCoalescing. */ + public requestCoalescing?: (boolean|null); + + /** BackendBucketCdnPolicy serveWhileStale. */ + public serveWhileStale?: (number|null); + + /** BackendBucketCdnPolicy signedUrlCacheMaxAgeSec. */ + public signedUrlCacheMaxAgeSec?: (number|Long|string|null); + + /** BackendBucketCdnPolicy signedUrlKeyNames. */ + public signedUrlKeyNames: string[]; + + /** BackendBucketCdnPolicy _cacheMode. */ + public _cacheMode?: "cacheMode"; + + /** BackendBucketCdnPolicy _clientTtl. */ + public _clientTtl?: "clientTtl"; + + /** BackendBucketCdnPolicy _defaultTtl. */ + public _defaultTtl?: "defaultTtl"; + + /** BackendBucketCdnPolicy _maxTtl. */ + public _maxTtl?: "maxTtl"; + + /** BackendBucketCdnPolicy _negativeCaching. */ + public _negativeCaching?: "negativeCaching"; + + /** BackendBucketCdnPolicy _requestCoalescing. */ + public _requestCoalescing?: "requestCoalescing"; + + /** BackendBucketCdnPolicy _serveWhileStale. */ + public _serveWhileStale?: "serveWhileStale"; + + /** BackendBucketCdnPolicy _signedUrlCacheMaxAgeSec. */ + public _signedUrlCacheMaxAgeSec?: "signedUrlCacheMaxAgeSec"; + + /** + * Creates a new BackendBucketCdnPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendBucketCdnPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendBucketCdnPolicy): google.cloud.compute.v1.BackendBucketCdnPolicy; + + /** + * Encodes the specified BackendBucketCdnPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicy.verify|verify} messages. + * @param message BackendBucketCdnPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendBucketCdnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendBucketCdnPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicy.verify|verify} messages. + * @param message BackendBucketCdnPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendBucketCdnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendBucketCdnPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendBucketCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendBucketCdnPolicy; + + /** + * Decodes a BackendBucketCdnPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendBucketCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendBucketCdnPolicy; + + /** + * Verifies a BackendBucketCdnPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendBucketCdnPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendBucketCdnPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendBucketCdnPolicy; + + /** + * Creates a plain object from a BackendBucketCdnPolicy message. Also converts values to other types if specified. + * @param message BackendBucketCdnPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendBucketCdnPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendBucketCdnPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BackendBucketCdnPolicy { + + /** CacheMode enum. */ + enum CacheMode { + UNDEFINED_CACHE_MODE = 0, + CACHE_ALL_STATIC = 355027945, + FORCE_CACHE_ALL = 486026928, + INVALID_CACHE_MODE = 381295560, + USE_ORIGIN_HEADERS = 55380261 + } + } + + /** Properties of a BackendBucket. */ + interface IBackendBucket { + + /** BackendBucket bucketName */ + bucketName?: (string|null); + + /** BackendBucket cdnPolicy */ + cdnPolicy?: (google.cloud.compute.v1.IBackendBucketCdnPolicy|null); + + /** BackendBucket creationTimestamp */ + creationTimestamp?: (string|null); + + /** BackendBucket customResponseHeaders */ + customResponseHeaders?: (string[]|null); + + /** BackendBucket description */ + description?: (string|null); + + /** BackendBucket enableCdn */ + enableCdn?: (boolean|null); + + /** BackendBucket id */ + id?: (number|Long|string|null); + + /** BackendBucket kind */ + kind?: (string|null); + + /** BackendBucket name */ + name?: (string|null); + + /** BackendBucket selfLink */ + selfLink?: (string|null); + } + + /** Represents a BackendBucket. */ + class BackendBucket implements IBackendBucket { + + /** + * Constructs a new BackendBucket. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendBucket); + + /** BackendBucket bucketName. */ + public bucketName?: (string|null); + + /** BackendBucket cdnPolicy. */ + public cdnPolicy?: (google.cloud.compute.v1.IBackendBucketCdnPolicy|null); + + /** BackendBucket creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** BackendBucket customResponseHeaders. */ + public customResponseHeaders: string[]; + + /** BackendBucket description. */ + public description?: (string|null); + + /** BackendBucket enableCdn. */ + public enableCdn?: (boolean|null); + + /** BackendBucket id. */ + public id?: (number|Long|string|null); + + /** BackendBucket kind. */ + public kind?: (string|null); + + /** BackendBucket name. */ + public name?: (string|null); + + /** BackendBucket selfLink. */ + public selfLink?: (string|null); + + /** BackendBucket _bucketName. */ + public _bucketName?: "bucketName"; + + /** BackendBucket _cdnPolicy. */ + public _cdnPolicy?: "cdnPolicy"; + + /** BackendBucket _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** BackendBucket _description. */ + public _description?: "description"; + + /** BackendBucket _enableCdn. */ + public _enableCdn?: "enableCdn"; + + /** BackendBucket _id. */ + public _id?: "id"; + + /** BackendBucket _kind. */ + public _kind?: "kind"; + + /** BackendBucket _name. */ + public _name?: "name"; + + /** BackendBucket _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new BackendBucket instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendBucket instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendBucket): google.cloud.compute.v1.BackendBucket; + + /** + * Encodes the specified BackendBucket message. Does not implicitly {@link google.cloud.compute.v1.BackendBucket.verify|verify} messages. + * @param message BackendBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendBucket message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucket.verify|verify} messages. + * @param message BackendBucket message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendBucket, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendBucket message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendBucket; + + /** + * Decodes a BackendBucket message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendBucket; + + /** + * Verifies a BackendBucket message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendBucket message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendBucket + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendBucket; + + /** + * Creates a plain object from a BackendBucket message. Also converts values to other types if specified. + * @param message BackendBucket + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendBucket, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendBucket to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendBucketCdnPolicyBypassCacheOnRequestHeader. */ + interface IBackendBucketCdnPolicyBypassCacheOnRequestHeader { + + /** BackendBucketCdnPolicyBypassCacheOnRequestHeader headerName */ + headerName?: (string|null); + } + + /** Represents a BackendBucketCdnPolicyBypassCacheOnRequestHeader. */ + class BackendBucketCdnPolicyBypassCacheOnRequestHeader implements IBackendBucketCdnPolicyBypassCacheOnRequestHeader { + + /** + * Constructs a new BackendBucketCdnPolicyBypassCacheOnRequestHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader); + + /** BackendBucketCdnPolicyBypassCacheOnRequestHeader headerName. */ + public headerName?: (string|null); + + /** BackendBucketCdnPolicyBypassCacheOnRequestHeader _headerName. */ + public _headerName?: "headerName"; + + /** + * Creates a new BackendBucketCdnPolicyBypassCacheOnRequestHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendBucketCdnPolicyBypassCacheOnRequestHeader instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader): google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader; + + /** + * Encodes the specified BackendBucketCdnPolicyBypassCacheOnRequestHeader message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @param message BackendBucketCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendBucketCdnPolicyBypassCacheOnRequestHeader message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @param message BackendBucketCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendBucketCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader; + + /** + * Decodes a BackendBucketCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader; + + /** + * Verifies a BackendBucketCdnPolicyBypassCacheOnRequestHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendBucketCdnPolicyBypassCacheOnRequestHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendBucketCdnPolicyBypassCacheOnRequestHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader; + + /** + * Creates a plain object from a BackendBucketCdnPolicyBypassCacheOnRequestHeader message. Also converts values to other types if specified. + * @param message BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendBucketCdnPolicyBypassCacheOnRequestHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendBucketCdnPolicyNegativeCachingPolicy. */ + interface IBackendBucketCdnPolicyNegativeCachingPolicy { + + /** BackendBucketCdnPolicyNegativeCachingPolicy code */ + code?: (number|null); + + /** BackendBucketCdnPolicyNegativeCachingPolicy ttl */ + ttl?: (number|null); + } + + /** Represents a BackendBucketCdnPolicyNegativeCachingPolicy. */ + class BackendBucketCdnPolicyNegativeCachingPolicy implements IBackendBucketCdnPolicyNegativeCachingPolicy { + + /** + * Constructs a new BackendBucketCdnPolicyNegativeCachingPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy); + + /** BackendBucketCdnPolicyNegativeCachingPolicy code. */ + public code?: (number|null); + + /** BackendBucketCdnPolicyNegativeCachingPolicy ttl. */ + public ttl?: (number|null); + + /** BackendBucketCdnPolicyNegativeCachingPolicy _code. */ + public _code?: "code"; + + /** BackendBucketCdnPolicyNegativeCachingPolicy _ttl. */ + public _ttl?: "ttl"; + + /** + * Creates a new BackendBucketCdnPolicyNegativeCachingPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendBucketCdnPolicyNegativeCachingPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy): google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy; + + /** + * Encodes the specified BackendBucketCdnPolicyNegativeCachingPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @param message BackendBucketCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendBucketCdnPolicyNegativeCachingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @param message BackendBucketCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendBucketCdnPolicyNegativeCachingPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendBucketCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy; + + /** + * Decodes a BackendBucketCdnPolicyNegativeCachingPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendBucketCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy; + + /** + * Verifies a BackendBucketCdnPolicyNegativeCachingPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendBucketCdnPolicyNegativeCachingPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendBucketCdnPolicyNegativeCachingPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy; + + /** + * Creates a plain object from a BackendBucketCdnPolicyNegativeCachingPolicy message. Also converts values to other types if specified. + * @param message BackendBucketCdnPolicyNegativeCachingPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendBucketCdnPolicyNegativeCachingPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendBucketList. */ + interface IBackendBucketList { + + /** BackendBucketList id */ + id?: (string|null); + + /** BackendBucketList items */ + items?: (google.cloud.compute.v1.IBackendBucket[]|null); + + /** BackendBucketList kind */ + kind?: (string|null); + + /** BackendBucketList nextPageToken */ + nextPageToken?: (string|null); + + /** BackendBucketList selfLink */ + selfLink?: (string|null); + + /** BackendBucketList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a BackendBucketList. */ + class BackendBucketList implements IBackendBucketList { + + /** + * Constructs a new BackendBucketList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendBucketList); + + /** BackendBucketList id. */ + public id?: (string|null); + + /** BackendBucketList items. */ + public items: google.cloud.compute.v1.IBackendBucket[]; + + /** BackendBucketList kind. */ + public kind?: (string|null); + + /** BackendBucketList nextPageToken. */ + public nextPageToken?: (string|null); + + /** BackendBucketList selfLink. */ + public selfLink?: (string|null); + + /** BackendBucketList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** BackendBucketList _id. */ + public _id?: "id"; + + /** BackendBucketList _kind. */ + public _kind?: "kind"; + + /** BackendBucketList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** BackendBucketList _selfLink. */ + public _selfLink?: "selfLink"; + + /** BackendBucketList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new BackendBucketList instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendBucketList instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendBucketList): google.cloud.compute.v1.BackendBucketList; + + /** + * Encodes the specified BackendBucketList message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketList.verify|verify} messages. + * @param message BackendBucketList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendBucketList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendBucketList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketList.verify|verify} messages. + * @param message BackendBucketList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendBucketList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendBucketList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendBucketList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendBucketList; + + /** + * Decodes a BackendBucketList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendBucketList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendBucketList; + + /** + * Verifies a BackendBucketList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendBucketList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendBucketList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendBucketList; + + /** + * Creates a plain object from a BackendBucketList message. Also converts values to other types if specified. + * @param message BackendBucketList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendBucketList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendBucketList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceCdnPolicy. */ + interface IBackendServiceCdnPolicy { + + /** BackendServiceCdnPolicy bypassCacheOnRequestHeaders */ + bypassCacheOnRequestHeaders?: (google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader[]|null); + + /** BackendServiceCdnPolicy cacheKeyPolicy */ + cacheKeyPolicy?: (google.cloud.compute.v1.ICacheKeyPolicy|null); + + /** BackendServiceCdnPolicy cacheMode */ + cacheMode?: (google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode|keyof typeof google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode|null); + + /** BackendServiceCdnPolicy clientTtl */ + clientTtl?: (number|null); + + /** BackendServiceCdnPolicy defaultTtl */ + defaultTtl?: (number|null); + + /** BackendServiceCdnPolicy maxTtl */ + maxTtl?: (number|null); + + /** BackendServiceCdnPolicy negativeCaching */ + negativeCaching?: (boolean|null); + + /** BackendServiceCdnPolicy negativeCachingPolicy */ + negativeCachingPolicy?: (google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy[]|null); + + /** BackendServiceCdnPolicy requestCoalescing */ + requestCoalescing?: (boolean|null); + + /** BackendServiceCdnPolicy serveWhileStale */ + serveWhileStale?: (number|null); + + /** BackendServiceCdnPolicy signedUrlCacheMaxAgeSec */ + signedUrlCacheMaxAgeSec?: (number|Long|string|null); + + /** BackendServiceCdnPolicy signedUrlKeyNames */ + signedUrlKeyNames?: (string[]|null); + } + + /** Represents a BackendServiceCdnPolicy. */ + class BackendServiceCdnPolicy implements IBackendServiceCdnPolicy { + + /** + * Constructs a new BackendServiceCdnPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceCdnPolicy); + + /** BackendServiceCdnPolicy bypassCacheOnRequestHeaders. */ + public bypassCacheOnRequestHeaders: google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader[]; + + /** BackendServiceCdnPolicy cacheKeyPolicy. */ + public cacheKeyPolicy?: (google.cloud.compute.v1.ICacheKeyPolicy|null); + + /** BackendServiceCdnPolicy cacheMode. */ + public cacheMode?: (google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode|keyof typeof google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode|null); + + /** BackendServiceCdnPolicy clientTtl. */ + public clientTtl?: (number|null); + + /** BackendServiceCdnPolicy defaultTtl. */ + public defaultTtl?: (number|null); + + /** BackendServiceCdnPolicy maxTtl. */ + public maxTtl?: (number|null); + + /** BackendServiceCdnPolicy negativeCaching. */ + public negativeCaching?: (boolean|null); + + /** BackendServiceCdnPolicy negativeCachingPolicy. */ + public negativeCachingPolicy: google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy[]; + + /** BackendServiceCdnPolicy requestCoalescing. */ + public requestCoalescing?: (boolean|null); + + /** BackendServiceCdnPolicy serveWhileStale. */ + public serveWhileStale?: (number|null); + + /** BackendServiceCdnPolicy signedUrlCacheMaxAgeSec. */ + public signedUrlCacheMaxAgeSec?: (number|Long|string|null); + + /** BackendServiceCdnPolicy signedUrlKeyNames. */ + public signedUrlKeyNames: string[]; + + /** BackendServiceCdnPolicy _cacheKeyPolicy. */ + public _cacheKeyPolicy?: "cacheKeyPolicy"; + + /** BackendServiceCdnPolicy _cacheMode. */ + public _cacheMode?: "cacheMode"; + + /** BackendServiceCdnPolicy _clientTtl. */ + public _clientTtl?: "clientTtl"; + + /** BackendServiceCdnPolicy _defaultTtl. */ + public _defaultTtl?: "defaultTtl"; + + /** BackendServiceCdnPolicy _maxTtl. */ + public _maxTtl?: "maxTtl"; + + /** BackendServiceCdnPolicy _negativeCaching. */ + public _negativeCaching?: "negativeCaching"; + + /** BackendServiceCdnPolicy _requestCoalescing. */ + public _requestCoalescing?: "requestCoalescing"; + + /** BackendServiceCdnPolicy _serveWhileStale. */ + public _serveWhileStale?: "serveWhileStale"; + + /** BackendServiceCdnPolicy _signedUrlCacheMaxAgeSec. */ + public _signedUrlCacheMaxAgeSec?: "signedUrlCacheMaxAgeSec"; + + /** + * Creates a new BackendServiceCdnPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceCdnPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceCdnPolicy): google.cloud.compute.v1.BackendServiceCdnPolicy; + + /** + * Encodes the specified BackendServiceCdnPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicy.verify|verify} messages. + * @param message BackendServiceCdnPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceCdnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceCdnPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicy.verify|verify} messages. + * @param message BackendServiceCdnPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceCdnPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceCdnPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceCdnPolicy; + + /** + * Decodes a BackendServiceCdnPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceCdnPolicy; + + /** + * Verifies a BackendServiceCdnPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceCdnPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceCdnPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceCdnPolicy; + + /** + * Creates a plain object from a BackendServiceCdnPolicy message. Also converts values to other types if specified. + * @param message BackendServiceCdnPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceCdnPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceCdnPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BackendServiceCdnPolicy { + + /** CacheMode enum. */ + enum CacheMode { + UNDEFINED_CACHE_MODE = 0, + CACHE_ALL_STATIC = 355027945, + FORCE_CACHE_ALL = 486026928, + INVALID_CACHE_MODE = 381295560, + USE_ORIGIN_HEADERS = 55380261 + } + } + + /** Properties of a CircuitBreakers. */ + interface ICircuitBreakers { + + /** CircuitBreakers maxConnections */ + maxConnections?: (number|null); + + /** CircuitBreakers maxPendingRequests */ + maxPendingRequests?: (number|null); + + /** CircuitBreakers maxRequests */ + maxRequests?: (number|null); + + /** CircuitBreakers maxRequestsPerConnection */ + maxRequestsPerConnection?: (number|null); + + /** CircuitBreakers maxRetries */ + maxRetries?: (number|null); + } + + /** Represents a CircuitBreakers. */ + class CircuitBreakers implements ICircuitBreakers { + + /** + * Constructs a new CircuitBreakers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICircuitBreakers); + + /** CircuitBreakers maxConnections. */ + public maxConnections?: (number|null); + + /** CircuitBreakers maxPendingRequests. */ + public maxPendingRequests?: (number|null); + + /** CircuitBreakers maxRequests. */ + public maxRequests?: (number|null); + + /** CircuitBreakers maxRequestsPerConnection. */ + public maxRequestsPerConnection?: (number|null); + + /** CircuitBreakers maxRetries. */ + public maxRetries?: (number|null); + + /** CircuitBreakers _maxConnections. */ + public _maxConnections?: "maxConnections"; + + /** CircuitBreakers _maxPendingRequests. */ + public _maxPendingRequests?: "maxPendingRequests"; + + /** CircuitBreakers _maxRequests. */ + public _maxRequests?: "maxRequests"; + + /** CircuitBreakers _maxRequestsPerConnection. */ + public _maxRequestsPerConnection?: "maxRequestsPerConnection"; + + /** CircuitBreakers _maxRetries. */ + public _maxRetries?: "maxRetries"; + + /** + * Creates a new CircuitBreakers instance using the specified properties. + * @param [properties] Properties to set + * @returns CircuitBreakers instance + */ + public static create(properties?: google.cloud.compute.v1.ICircuitBreakers): google.cloud.compute.v1.CircuitBreakers; + + /** + * Encodes the specified CircuitBreakers message. Does not implicitly {@link google.cloud.compute.v1.CircuitBreakers.verify|verify} messages. + * @param message CircuitBreakers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICircuitBreakers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CircuitBreakers message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CircuitBreakers.verify|verify} messages. + * @param message CircuitBreakers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICircuitBreakers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CircuitBreakers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CircuitBreakers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CircuitBreakers; + + /** + * Decodes a CircuitBreakers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CircuitBreakers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CircuitBreakers; + + /** + * Verifies a CircuitBreakers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CircuitBreakers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CircuitBreakers + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CircuitBreakers; + + /** + * Creates a plain object from a CircuitBreakers message. Also converts values to other types if specified. + * @param message CircuitBreakers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CircuitBreakers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CircuitBreakers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConnectionDraining. */ + interface IConnectionDraining { + + /** ConnectionDraining drainingTimeoutSec */ + drainingTimeoutSec?: (number|null); + } + + /** Represents a ConnectionDraining. */ + class ConnectionDraining implements IConnectionDraining { + + /** + * Constructs a new ConnectionDraining. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IConnectionDraining); + + /** ConnectionDraining drainingTimeoutSec. */ + public drainingTimeoutSec?: (number|null); + + /** ConnectionDraining _drainingTimeoutSec. */ + public _drainingTimeoutSec?: "drainingTimeoutSec"; + + /** + * Creates a new ConnectionDraining instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectionDraining instance + */ + public static create(properties?: google.cloud.compute.v1.IConnectionDraining): google.cloud.compute.v1.ConnectionDraining; + + /** + * Encodes the specified ConnectionDraining message. Does not implicitly {@link google.cloud.compute.v1.ConnectionDraining.verify|verify} messages. + * @param message ConnectionDraining message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IConnectionDraining, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectionDraining message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConnectionDraining.verify|verify} messages. + * @param message ConnectionDraining message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IConnectionDraining, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectionDraining message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectionDraining + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ConnectionDraining; + + /** + * Decodes a ConnectionDraining message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectionDraining + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ConnectionDraining; + + /** + * Verifies a ConnectionDraining message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectionDraining message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectionDraining + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ConnectionDraining; + + /** + * Creates a plain object from a ConnectionDraining message. Also converts values to other types if specified. + * @param message ConnectionDraining + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ConnectionDraining, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectionDraining to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConsistentHashLoadBalancerSettings. */ + interface IConsistentHashLoadBalancerSettings { + + /** ConsistentHashLoadBalancerSettings httpCookie */ + httpCookie?: (google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie|null); + + /** ConsistentHashLoadBalancerSettings httpHeaderName */ + httpHeaderName?: (string|null); + + /** ConsistentHashLoadBalancerSettings minimumRingSize */ + minimumRingSize?: (number|Long|string|null); + } + + /** Represents a ConsistentHashLoadBalancerSettings. */ + class ConsistentHashLoadBalancerSettings implements IConsistentHashLoadBalancerSettings { + + /** + * Constructs a new ConsistentHashLoadBalancerSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IConsistentHashLoadBalancerSettings); + + /** ConsistentHashLoadBalancerSettings httpCookie. */ + public httpCookie?: (google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie|null); + + /** ConsistentHashLoadBalancerSettings httpHeaderName. */ + public httpHeaderName?: (string|null); + + /** ConsistentHashLoadBalancerSettings minimumRingSize. */ + public minimumRingSize?: (number|Long|string|null); + + /** ConsistentHashLoadBalancerSettings _httpCookie. */ + public _httpCookie?: "httpCookie"; + + /** ConsistentHashLoadBalancerSettings _httpHeaderName. */ + public _httpHeaderName?: "httpHeaderName"; + + /** ConsistentHashLoadBalancerSettings _minimumRingSize. */ + public _minimumRingSize?: "minimumRingSize"; + + /** + * Creates a new ConsistentHashLoadBalancerSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsistentHashLoadBalancerSettings instance + */ + public static create(properties?: google.cloud.compute.v1.IConsistentHashLoadBalancerSettings): google.cloud.compute.v1.ConsistentHashLoadBalancerSettings; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettings message. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.verify|verify} messages. + * @param message ConsistentHashLoadBalancerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IConsistentHashLoadBalancerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.verify|verify} messages. + * @param message ConsistentHashLoadBalancerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IConsistentHashLoadBalancerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsistentHashLoadBalancerSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConsistentHashLoadBalancerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ConsistentHashLoadBalancerSettings; + + /** + * Decodes a ConsistentHashLoadBalancerSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConsistentHashLoadBalancerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ConsistentHashLoadBalancerSettings; + + /** + * Verifies a ConsistentHashLoadBalancerSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConsistentHashLoadBalancerSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConsistentHashLoadBalancerSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ConsistentHashLoadBalancerSettings; + + /** + * Creates a plain object from a ConsistentHashLoadBalancerSettings message. Also converts values to other types if specified. + * @param message ConsistentHashLoadBalancerSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ConsistentHashLoadBalancerSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConsistentHashLoadBalancerSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceFailoverPolicy. */ + interface IBackendServiceFailoverPolicy { + + /** BackendServiceFailoverPolicy disableConnectionDrainOnFailover */ + disableConnectionDrainOnFailover?: (boolean|null); + + /** BackendServiceFailoverPolicy dropTrafficIfUnhealthy */ + dropTrafficIfUnhealthy?: (boolean|null); + + /** BackendServiceFailoverPolicy failoverRatio */ + failoverRatio?: (number|null); + } + + /** Represents a BackendServiceFailoverPolicy. */ + class BackendServiceFailoverPolicy implements IBackendServiceFailoverPolicy { + + /** + * Constructs a new BackendServiceFailoverPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceFailoverPolicy); + + /** BackendServiceFailoverPolicy disableConnectionDrainOnFailover. */ + public disableConnectionDrainOnFailover?: (boolean|null); + + /** BackendServiceFailoverPolicy dropTrafficIfUnhealthy. */ + public dropTrafficIfUnhealthy?: (boolean|null); + + /** BackendServiceFailoverPolicy failoverRatio. */ + public failoverRatio?: (number|null); + + /** BackendServiceFailoverPolicy _disableConnectionDrainOnFailover. */ + public _disableConnectionDrainOnFailover?: "disableConnectionDrainOnFailover"; + + /** BackendServiceFailoverPolicy _dropTrafficIfUnhealthy. */ + public _dropTrafficIfUnhealthy?: "dropTrafficIfUnhealthy"; + + /** BackendServiceFailoverPolicy _failoverRatio. */ + public _failoverRatio?: "failoverRatio"; + + /** + * Creates a new BackendServiceFailoverPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceFailoverPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceFailoverPolicy): google.cloud.compute.v1.BackendServiceFailoverPolicy; + + /** + * Encodes the specified BackendServiceFailoverPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceFailoverPolicy.verify|verify} messages. + * @param message BackendServiceFailoverPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceFailoverPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceFailoverPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceFailoverPolicy.verify|verify} messages. + * @param message BackendServiceFailoverPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceFailoverPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceFailoverPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceFailoverPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceFailoverPolicy; + + /** + * Decodes a BackendServiceFailoverPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceFailoverPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceFailoverPolicy; + + /** + * Verifies a BackendServiceFailoverPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceFailoverPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceFailoverPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceFailoverPolicy; + + /** + * Creates a plain object from a BackendServiceFailoverPolicy message. Also converts values to other types if specified. + * @param message BackendServiceFailoverPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceFailoverPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceFailoverPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceIAP. */ + interface IBackendServiceIAP { + + /** BackendServiceIAP enabled */ + enabled?: (boolean|null); + + /** BackendServiceIAP oauth2ClientId */ + oauth2ClientId?: (string|null); + + /** BackendServiceIAP oauth2ClientSecret */ + oauth2ClientSecret?: (string|null); + + /** BackendServiceIAP oauth2ClientSecretSha256 */ + oauth2ClientSecretSha256?: (string|null); + } + + /** Represents a BackendServiceIAP. */ + class BackendServiceIAP implements IBackendServiceIAP { + + /** + * Constructs a new BackendServiceIAP. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceIAP); + + /** BackendServiceIAP enabled. */ + public enabled?: (boolean|null); + + /** BackendServiceIAP oauth2ClientId. */ + public oauth2ClientId?: (string|null); + + /** BackendServiceIAP oauth2ClientSecret. */ + public oauth2ClientSecret?: (string|null); + + /** BackendServiceIAP oauth2ClientSecretSha256. */ + public oauth2ClientSecretSha256?: (string|null); + + /** BackendServiceIAP _enabled. */ + public _enabled?: "enabled"; + + /** BackendServiceIAP _oauth2ClientId. */ + public _oauth2ClientId?: "oauth2ClientId"; + + /** BackendServiceIAP _oauth2ClientSecret. */ + public _oauth2ClientSecret?: "oauth2ClientSecret"; + + /** BackendServiceIAP _oauth2ClientSecretSha256. */ + public _oauth2ClientSecretSha256?: "oauth2ClientSecretSha256"; + + /** + * Creates a new BackendServiceIAP instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceIAP instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceIAP): google.cloud.compute.v1.BackendServiceIAP; + + /** + * Encodes the specified BackendServiceIAP message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceIAP.verify|verify} messages. + * @param message BackendServiceIAP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceIAP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceIAP message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceIAP.verify|verify} messages. + * @param message BackendServiceIAP message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceIAP, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceIAP message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceIAP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceIAP; + + /** + * Decodes a BackendServiceIAP message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceIAP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceIAP; + + /** + * Verifies a BackendServiceIAP message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceIAP message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceIAP + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceIAP; + + /** + * Creates a plain object from a BackendServiceIAP message. Also converts values to other types if specified. + * @param message BackendServiceIAP + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceIAP, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceIAP to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceLogConfig. */ + interface IBackendServiceLogConfig { + + /** BackendServiceLogConfig enable */ + enable?: (boolean|null); + + /** BackendServiceLogConfig sampleRate */ + sampleRate?: (number|null); + } + + /** Represents a BackendServiceLogConfig. */ + class BackendServiceLogConfig implements IBackendServiceLogConfig { + + /** + * Constructs a new BackendServiceLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceLogConfig); + + /** BackendServiceLogConfig enable. */ + public enable?: (boolean|null); + + /** BackendServiceLogConfig sampleRate. */ + public sampleRate?: (number|null); + + /** BackendServiceLogConfig _enable. */ + public _enable?: "enable"; + + /** BackendServiceLogConfig _sampleRate. */ + public _sampleRate?: "sampleRate"; + + /** + * Creates a new BackendServiceLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceLogConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceLogConfig): google.cloud.compute.v1.BackendServiceLogConfig; + + /** + * Encodes the specified BackendServiceLogConfig message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceLogConfig.verify|verify} messages. + * @param message BackendServiceLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceLogConfig.verify|verify} messages. + * @param message BackendServiceLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceLogConfig; + + /** + * Decodes a BackendServiceLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceLogConfig; + + /** + * Verifies a BackendServiceLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceLogConfig; + + /** + * Creates a plain object from a BackendServiceLogConfig message. Also converts values to other types if specified. + * @param message BackendServiceLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration nanos */ + nanos?: (number|null); + + /** Duration seconds */ + seconds?: (number|Long|string|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDuration); + + /** Duration nanos. */ + public nanos?: (number|null); + + /** Duration seconds. */ + public seconds?: (number|Long|string|null); + + /** Duration _nanos. */ + public _nanos?: "nanos"; + + /** Duration _seconds. */ + public _seconds?: "seconds"; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.cloud.compute.v1.IDuration): google.cloud.compute.v1.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.cloud.compute.v1.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.cloud.compute.v1.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutlierDetection. */ + interface IOutlierDetection { + + /** OutlierDetection baseEjectionTime */ + baseEjectionTime?: (google.cloud.compute.v1.IDuration|null); + + /** OutlierDetection consecutiveErrors */ + consecutiveErrors?: (number|null); + + /** OutlierDetection consecutiveGatewayFailure */ + consecutiveGatewayFailure?: (number|null); + + /** OutlierDetection enforcingConsecutiveErrors */ + enforcingConsecutiveErrors?: (number|null); + + /** OutlierDetection enforcingConsecutiveGatewayFailure */ + enforcingConsecutiveGatewayFailure?: (number|null); + + /** OutlierDetection enforcingSuccessRate */ + enforcingSuccessRate?: (number|null); + + /** OutlierDetection interval */ + interval?: (google.cloud.compute.v1.IDuration|null); + + /** OutlierDetection maxEjectionPercent */ + maxEjectionPercent?: (number|null); + + /** OutlierDetection successRateMinimumHosts */ + successRateMinimumHosts?: (number|null); + + /** OutlierDetection successRateRequestVolume */ + successRateRequestVolume?: (number|null); + + /** OutlierDetection successRateStdevFactor */ + successRateStdevFactor?: (number|null); + } + + /** Represents an OutlierDetection. */ + class OutlierDetection implements IOutlierDetection { + + /** + * Constructs a new OutlierDetection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IOutlierDetection); + + /** OutlierDetection baseEjectionTime. */ + public baseEjectionTime?: (google.cloud.compute.v1.IDuration|null); + + /** OutlierDetection consecutiveErrors. */ + public consecutiveErrors?: (number|null); + + /** OutlierDetection consecutiveGatewayFailure. */ + public consecutiveGatewayFailure?: (number|null); + + /** OutlierDetection enforcingConsecutiveErrors. */ + public enforcingConsecutiveErrors?: (number|null); + + /** OutlierDetection enforcingConsecutiveGatewayFailure. */ + public enforcingConsecutiveGatewayFailure?: (number|null); + + /** OutlierDetection enforcingSuccessRate. */ + public enforcingSuccessRate?: (number|null); + + /** OutlierDetection interval. */ + public interval?: (google.cloud.compute.v1.IDuration|null); + + /** OutlierDetection maxEjectionPercent. */ + public maxEjectionPercent?: (number|null); + + /** OutlierDetection successRateMinimumHosts. */ + public successRateMinimumHosts?: (number|null); + + /** OutlierDetection successRateRequestVolume. */ + public successRateRequestVolume?: (number|null); + + /** OutlierDetection successRateStdevFactor. */ + public successRateStdevFactor?: (number|null); + + /** OutlierDetection _baseEjectionTime. */ + public _baseEjectionTime?: "baseEjectionTime"; + + /** OutlierDetection _consecutiveErrors. */ + public _consecutiveErrors?: "consecutiveErrors"; + + /** OutlierDetection _consecutiveGatewayFailure. */ + public _consecutiveGatewayFailure?: "consecutiveGatewayFailure"; + + /** OutlierDetection _enforcingConsecutiveErrors. */ + public _enforcingConsecutiveErrors?: "enforcingConsecutiveErrors"; + + /** OutlierDetection _enforcingConsecutiveGatewayFailure. */ + public _enforcingConsecutiveGatewayFailure?: "enforcingConsecutiveGatewayFailure"; + + /** OutlierDetection _enforcingSuccessRate. */ + public _enforcingSuccessRate?: "enforcingSuccessRate"; + + /** OutlierDetection _interval. */ + public _interval?: "interval"; + + /** OutlierDetection _maxEjectionPercent. */ + public _maxEjectionPercent?: "maxEjectionPercent"; + + /** OutlierDetection _successRateMinimumHosts. */ + public _successRateMinimumHosts?: "successRateMinimumHosts"; + + /** OutlierDetection _successRateRequestVolume. */ + public _successRateRequestVolume?: "successRateRequestVolume"; + + /** OutlierDetection _successRateStdevFactor. */ + public _successRateStdevFactor?: "successRateStdevFactor"; + + /** + * Creates a new OutlierDetection instance using the specified properties. + * @param [properties] Properties to set + * @returns OutlierDetection instance + */ + public static create(properties?: google.cloud.compute.v1.IOutlierDetection): google.cloud.compute.v1.OutlierDetection; + + /** + * Encodes the specified OutlierDetection message. Does not implicitly {@link google.cloud.compute.v1.OutlierDetection.verify|verify} messages. + * @param message OutlierDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IOutlierDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutlierDetection message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OutlierDetection.verify|verify} messages. + * @param message OutlierDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IOutlierDetection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutlierDetection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutlierDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.OutlierDetection; + + /** + * Decodes an OutlierDetection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutlierDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.OutlierDetection; + + /** + * Verifies an OutlierDetection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutlierDetection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutlierDetection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.OutlierDetection; + + /** + * Creates a plain object from an OutlierDetection message. Also converts values to other types if specified. + * @param message OutlierDetection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.OutlierDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutlierDetection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecuritySettings. */ + interface ISecuritySettings { + + /** SecuritySettings clientTlsPolicy */ + clientTlsPolicy?: (string|null); + + /** SecuritySettings subjectAltNames */ + subjectAltNames?: (string[]|null); + } + + /** Represents a SecuritySettings. */ + class SecuritySettings implements ISecuritySettings { + + /** + * Constructs a new SecuritySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecuritySettings); + + /** SecuritySettings clientTlsPolicy. */ + public clientTlsPolicy?: (string|null); + + /** SecuritySettings subjectAltNames. */ + public subjectAltNames: string[]; + + /** SecuritySettings _clientTlsPolicy. */ + public _clientTlsPolicy?: "clientTlsPolicy"; + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SecuritySettings instance + */ + public static create(properties?: google.cloud.compute.v1.ISecuritySettings): google.cloud.compute.v1.SecuritySettings; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.compute.v1.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecuritySettings.verify|verify} messages. + * @param message SecuritySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecuritySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecuritySettings; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecuritySettings; + + /** + * Verifies a SecuritySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecuritySettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecuritySettings; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @param message SecuritySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecuritySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecuritySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendService. */ + interface IBackendService { + + /** BackendService affinityCookieTtlSec */ + affinityCookieTtlSec?: (number|null); + + /** BackendService backends */ + backends?: (google.cloud.compute.v1.IBackend[]|null); + + /** BackendService cdnPolicy */ + cdnPolicy?: (google.cloud.compute.v1.IBackendServiceCdnPolicy|null); + + /** BackendService circuitBreakers */ + circuitBreakers?: (google.cloud.compute.v1.ICircuitBreakers|null); + + /** BackendService connectionDraining */ + connectionDraining?: (google.cloud.compute.v1.IConnectionDraining|null); + + /** BackendService consistentHash */ + consistentHash?: (google.cloud.compute.v1.IConsistentHashLoadBalancerSettings|null); + + /** BackendService creationTimestamp */ + creationTimestamp?: (string|null); + + /** BackendService customRequestHeaders */ + customRequestHeaders?: (string[]|null); + + /** BackendService customResponseHeaders */ + customResponseHeaders?: (string[]|null); + + /** BackendService description */ + description?: (string|null); + + /** BackendService enableCDN */ + enableCDN?: (boolean|null); + + /** BackendService failoverPolicy */ + failoverPolicy?: (google.cloud.compute.v1.IBackendServiceFailoverPolicy|null); + + /** BackendService fingerprint */ + fingerprint?: (string|null); + + /** BackendService healthChecks */ + healthChecks?: (string[]|null); + + /** BackendService iap */ + iap?: (google.cloud.compute.v1.IBackendServiceIAP|null); + + /** BackendService id */ + id?: (number|Long|string|null); + + /** BackendService kind */ + kind?: (string|null); + + /** BackendService loadBalancingScheme */ + loadBalancingScheme?: (google.cloud.compute.v1.BackendService.LoadBalancingScheme|keyof typeof google.cloud.compute.v1.BackendService.LoadBalancingScheme|null); + + /** BackendService localityLbPolicy */ + localityLbPolicy?: (google.cloud.compute.v1.BackendService.LocalityLbPolicy|keyof typeof google.cloud.compute.v1.BackendService.LocalityLbPolicy|null); + + /** BackendService logConfig */ + logConfig?: (google.cloud.compute.v1.IBackendServiceLogConfig|null); + + /** BackendService maxStreamDuration */ + maxStreamDuration?: (google.cloud.compute.v1.IDuration|null); + + /** BackendService name */ + name?: (string|null); + + /** BackendService network */ + network?: (string|null); + + /** BackendService outlierDetection */ + outlierDetection?: (google.cloud.compute.v1.IOutlierDetection|null); + + /** BackendService port */ + port?: (number|null); + + /** BackendService portName */ + portName?: (string|null); + + /** BackendService protocol */ + protocol?: (google.cloud.compute.v1.BackendService.Protocol|keyof typeof google.cloud.compute.v1.BackendService.Protocol|null); + + /** BackendService region */ + region?: (string|null); + + /** BackendService securityPolicy */ + securityPolicy?: (string|null); + + /** BackendService securitySettings */ + securitySettings?: (google.cloud.compute.v1.ISecuritySettings|null); + + /** BackendService selfLink */ + selfLink?: (string|null); + + /** BackendService sessionAffinity */ + sessionAffinity?: (google.cloud.compute.v1.BackendService.SessionAffinity|keyof typeof google.cloud.compute.v1.BackendService.SessionAffinity|null); + + /** BackendService timeoutSec */ + timeoutSec?: (number|null); + } + + /** Represents a BackendService. */ + class BackendService implements IBackendService { + + /** + * Constructs a new BackendService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendService); + + /** BackendService affinityCookieTtlSec. */ + public affinityCookieTtlSec?: (number|null); + + /** BackendService backends. */ + public backends: google.cloud.compute.v1.IBackend[]; + + /** BackendService cdnPolicy. */ + public cdnPolicy?: (google.cloud.compute.v1.IBackendServiceCdnPolicy|null); + + /** BackendService circuitBreakers. */ + public circuitBreakers?: (google.cloud.compute.v1.ICircuitBreakers|null); + + /** BackendService connectionDraining. */ + public connectionDraining?: (google.cloud.compute.v1.IConnectionDraining|null); + + /** BackendService consistentHash. */ + public consistentHash?: (google.cloud.compute.v1.IConsistentHashLoadBalancerSettings|null); + + /** BackendService creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** BackendService customRequestHeaders. */ + public customRequestHeaders: string[]; + + /** BackendService customResponseHeaders. */ + public customResponseHeaders: string[]; + + /** BackendService description. */ + public description?: (string|null); + + /** BackendService enableCDN. */ + public enableCDN?: (boolean|null); + + /** BackendService failoverPolicy. */ + public failoverPolicy?: (google.cloud.compute.v1.IBackendServiceFailoverPolicy|null); + + /** BackendService fingerprint. */ + public fingerprint?: (string|null); + + /** BackendService healthChecks. */ + public healthChecks: string[]; + + /** BackendService iap. */ + public iap?: (google.cloud.compute.v1.IBackendServiceIAP|null); + + /** BackendService id. */ + public id?: (number|Long|string|null); + + /** BackendService kind. */ + public kind?: (string|null); + + /** BackendService loadBalancingScheme. */ + public loadBalancingScheme?: (google.cloud.compute.v1.BackendService.LoadBalancingScheme|keyof typeof google.cloud.compute.v1.BackendService.LoadBalancingScheme|null); + + /** BackendService localityLbPolicy. */ + public localityLbPolicy?: (google.cloud.compute.v1.BackendService.LocalityLbPolicy|keyof typeof google.cloud.compute.v1.BackendService.LocalityLbPolicy|null); + + /** BackendService logConfig. */ + public logConfig?: (google.cloud.compute.v1.IBackendServiceLogConfig|null); + + /** BackendService maxStreamDuration. */ + public maxStreamDuration?: (google.cloud.compute.v1.IDuration|null); + + /** BackendService name. */ + public name?: (string|null); + + /** BackendService network. */ + public network?: (string|null); + + /** BackendService outlierDetection. */ + public outlierDetection?: (google.cloud.compute.v1.IOutlierDetection|null); + + /** BackendService port. */ + public port?: (number|null); + + /** BackendService portName. */ + public portName?: (string|null); + + /** BackendService protocol. */ + public protocol?: (google.cloud.compute.v1.BackendService.Protocol|keyof typeof google.cloud.compute.v1.BackendService.Protocol|null); + + /** BackendService region. */ + public region?: (string|null); + + /** BackendService securityPolicy. */ + public securityPolicy?: (string|null); + + /** BackendService securitySettings. */ + public securitySettings?: (google.cloud.compute.v1.ISecuritySettings|null); + + /** BackendService selfLink. */ + public selfLink?: (string|null); + + /** BackendService sessionAffinity. */ + public sessionAffinity?: (google.cloud.compute.v1.BackendService.SessionAffinity|keyof typeof google.cloud.compute.v1.BackendService.SessionAffinity|null); + + /** BackendService timeoutSec. */ + public timeoutSec?: (number|null); + + /** BackendService _affinityCookieTtlSec. */ + public _affinityCookieTtlSec?: "affinityCookieTtlSec"; + + /** BackendService _cdnPolicy. */ + public _cdnPolicy?: "cdnPolicy"; + + /** BackendService _circuitBreakers. */ + public _circuitBreakers?: "circuitBreakers"; + + /** BackendService _connectionDraining. */ + public _connectionDraining?: "connectionDraining"; + + /** BackendService _consistentHash. */ + public _consistentHash?: "consistentHash"; + + /** BackendService _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** BackendService _description. */ + public _description?: "description"; + + /** BackendService _enableCDN. */ + public _enableCDN?: "enableCDN"; + + /** BackendService _failoverPolicy. */ + public _failoverPolicy?: "failoverPolicy"; + + /** BackendService _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** BackendService _iap. */ + public _iap?: "iap"; + + /** BackendService _id. */ + public _id?: "id"; + + /** BackendService _kind. */ + public _kind?: "kind"; + + /** BackendService _loadBalancingScheme. */ + public _loadBalancingScheme?: "loadBalancingScheme"; + + /** BackendService _localityLbPolicy. */ + public _localityLbPolicy?: "localityLbPolicy"; + + /** BackendService _logConfig. */ + public _logConfig?: "logConfig"; + + /** BackendService _maxStreamDuration. */ + public _maxStreamDuration?: "maxStreamDuration"; + + /** BackendService _name. */ + public _name?: "name"; + + /** BackendService _network. */ + public _network?: "network"; + + /** BackendService _outlierDetection. */ + public _outlierDetection?: "outlierDetection"; + + /** BackendService _port. */ + public _port?: "port"; + + /** BackendService _portName. */ + public _portName?: "portName"; + + /** BackendService _protocol. */ + public _protocol?: "protocol"; + + /** BackendService _region. */ + public _region?: "region"; + + /** BackendService _securityPolicy. */ + public _securityPolicy?: "securityPolicy"; + + /** BackendService _securitySettings. */ + public _securitySettings?: "securitySettings"; + + /** BackendService _selfLink. */ + public _selfLink?: "selfLink"; + + /** BackendService _sessionAffinity. */ + public _sessionAffinity?: "sessionAffinity"; + + /** BackendService _timeoutSec. */ + public _timeoutSec?: "timeoutSec"; + + /** + * Creates a new BackendService instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendService instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendService): google.cloud.compute.v1.BackendService; + + /** + * Encodes the specified BackendService message. Does not implicitly {@link google.cloud.compute.v1.BackendService.verify|verify} messages. + * @param message BackendService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendService message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendService.verify|verify} messages. + * @param message BackendService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendService; + + /** + * Decodes a BackendService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendService; + + /** + * Verifies a BackendService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendService; + + /** + * Creates a plain object from a BackendService message. Also converts values to other types if specified. + * @param message BackendService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BackendService { + + /** LoadBalancingScheme enum. */ + enum LoadBalancingScheme { + UNDEFINED_LOAD_BALANCING_SCHEME = 0, + EXTERNAL = 35607499, + INTERNAL = 279295677, + INTERNAL_MANAGED = 37350397, + INTERNAL_SELF_MANAGED = 236211150, + INVALID_LOAD_BALANCING_SCHEME = 275352060 + } + + /** LocalityLbPolicy enum. */ + enum LocalityLbPolicy { + UNDEFINED_LOCALITY_LB_POLICY = 0, + INVALID_LB_POLICY = 323318707, + LEAST_REQUEST = 46604921, + MAGLEV = 119180266, + ORIGINAL_DESTINATION = 166297216, + RANDOM = 262527171, + RING_HASH = 432795069, + ROUND_ROBIN = 153895801 + } + + /** Protocol enum. */ + enum Protocol { + UNDEFINED_PROTOCOL = 0, + GRPC = 2196510, + HTTP = 2228360, + HTTP2 = 69079210, + HTTPS = 69079243, + SSL = 82412, + TCP = 82881, + UDP = 83873 + } + + /** SessionAffinity enum. */ + enum SessionAffinity { + UNDEFINED_SESSION_AFFINITY = 0, + CLIENT_IP = 345665051, + CLIENT_IP_NO_DESTINATION = 106122516, + CLIENT_IP_PORT_PROTO = 221722926, + CLIENT_IP_PROTO = 25322148, + GENERATED_COOKIE = 370321204, + HEADER_FIELD = 200737960, + HTTP_COOKIE = 494981627, + NONE = 2402104 + } + } + + /** Properties of a BackendServicesScopedList. */ + interface IBackendServicesScopedList { + + /** BackendServicesScopedList backendServices */ + backendServices?: (google.cloud.compute.v1.IBackendService[]|null); + + /** BackendServicesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a BackendServicesScopedList. */ + class BackendServicesScopedList implements IBackendServicesScopedList { + + /** + * Constructs a new BackendServicesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServicesScopedList); + + /** BackendServicesScopedList backendServices. */ + public backendServices: google.cloud.compute.v1.IBackendService[]; + + /** BackendServicesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** BackendServicesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new BackendServicesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServicesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServicesScopedList): google.cloud.compute.v1.BackendServicesScopedList; + + /** + * Encodes the specified BackendServicesScopedList message. Does not implicitly {@link google.cloud.compute.v1.BackendServicesScopedList.verify|verify} messages. + * @param message BackendServicesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServicesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServicesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServicesScopedList.verify|verify} messages. + * @param message BackendServicesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServicesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServicesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServicesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServicesScopedList; + + /** + * Decodes a BackendServicesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServicesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServicesScopedList; + + /** + * Verifies a BackendServicesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServicesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServicesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServicesScopedList; + + /** + * Creates a plain object from a BackendServicesScopedList message. Also converts values to other types if specified. + * @param message BackendServicesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServicesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServicesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceAggregatedList. */ + interface IBackendServiceAggregatedList { + + /** BackendServiceAggregatedList id */ + id?: (string|null); + + /** BackendServiceAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IBackendServicesScopedList }|null); + + /** BackendServiceAggregatedList kind */ + kind?: (string|null); + + /** BackendServiceAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** BackendServiceAggregatedList selfLink */ + selfLink?: (string|null); + + /** BackendServiceAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** BackendServiceAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a BackendServiceAggregatedList. */ + class BackendServiceAggregatedList implements IBackendServiceAggregatedList { + + /** + * Constructs a new BackendServiceAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceAggregatedList); + + /** BackendServiceAggregatedList id. */ + public id?: (string|null); + + /** BackendServiceAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IBackendServicesScopedList }; + + /** BackendServiceAggregatedList kind. */ + public kind?: (string|null); + + /** BackendServiceAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** BackendServiceAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** BackendServiceAggregatedList unreachables. */ + public unreachables: string[]; + + /** BackendServiceAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** BackendServiceAggregatedList _id. */ + public _id?: "id"; + + /** BackendServiceAggregatedList _kind. */ + public _kind?: "kind"; + + /** BackendServiceAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** BackendServiceAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** BackendServiceAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new BackendServiceAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceAggregatedList): google.cloud.compute.v1.BackendServiceAggregatedList; + + /** + * Encodes the specified BackendServiceAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceAggregatedList.verify|verify} messages. + * @param message BackendServiceAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceAggregatedList.verify|verify} messages. + * @param message BackendServiceAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceAggregatedList; + + /** + * Decodes a BackendServiceAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceAggregatedList; + + /** + * Verifies a BackendServiceAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceAggregatedList; + + /** + * Creates a plain object from a BackendServiceAggregatedList message. Also converts values to other types if specified. + * @param message BackendServiceAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceCdnPolicyBypassCacheOnRequestHeader. */ + interface IBackendServiceCdnPolicyBypassCacheOnRequestHeader { + + /** BackendServiceCdnPolicyBypassCacheOnRequestHeader headerName */ + headerName?: (string|null); + } + + /** Represents a BackendServiceCdnPolicyBypassCacheOnRequestHeader. */ + class BackendServiceCdnPolicyBypassCacheOnRequestHeader implements IBackendServiceCdnPolicyBypassCacheOnRequestHeader { + + /** + * Constructs a new BackendServiceCdnPolicyBypassCacheOnRequestHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader); + + /** BackendServiceCdnPolicyBypassCacheOnRequestHeader headerName. */ + public headerName?: (string|null); + + /** BackendServiceCdnPolicyBypassCacheOnRequestHeader _headerName. */ + public _headerName?: "headerName"; + + /** + * Creates a new BackendServiceCdnPolicyBypassCacheOnRequestHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceCdnPolicyBypassCacheOnRequestHeader instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader): google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader; + + /** + * Encodes the specified BackendServiceCdnPolicyBypassCacheOnRequestHeader message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @param message BackendServiceCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceCdnPolicyBypassCacheOnRequestHeader message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @param message BackendServiceCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader; + + /** + * Decodes a BackendServiceCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader; + + /** + * Verifies a BackendServiceCdnPolicyBypassCacheOnRequestHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceCdnPolicyBypassCacheOnRequestHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceCdnPolicyBypassCacheOnRequestHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader; + + /** + * Creates a plain object from a BackendServiceCdnPolicyBypassCacheOnRequestHeader message. Also converts values to other types if specified. + * @param message BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceCdnPolicyBypassCacheOnRequestHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CacheKeyPolicy. */ + interface ICacheKeyPolicy { + + /** CacheKeyPolicy includeHost */ + includeHost?: (boolean|null); + + /** CacheKeyPolicy includeProtocol */ + includeProtocol?: (boolean|null); + + /** CacheKeyPolicy includeQueryString */ + includeQueryString?: (boolean|null); + + /** CacheKeyPolicy queryStringBlacklist */ + queryStringBlacklist?: (string[]|null); + + /** CacheKeyPolicy queryStringWhitelist */ + queryStringWhitelist?: (string[]|null); + } + + /** Represents a CacheKeyPolicy. */ + class CacheKeyPolicy implements ICacheKeyPolicy { + + /** + * Constructs a new CacheKeyPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICacheKeyPolicy); + + /** CacheKeyPolicy includeHost. */ + public includeHost?: (boolean|null); + + /** CacheKeyPolicy includeProtocol. */ + public includeProtocol?: (boolean|null); + + /** CacheKeyPolicy includeQueryString. */ + public includeQueryString?: (boolean|null); + + /** CacheKeyPolicy queryStringBlacklist. */ + public queryStringBlacklist: string[]; + + /** CacheKeyPolicy queryStringWhitelist. */ + public queryStringWhitelist: string[]; + + /** CacheKeyPolicy _includeHost. */ + public _includeHost?: "includeHost"; + + /** CacheKeyPolicy _includeProtocol. */ + public _includeProtocol?: "includeProtocol"; + + /** CacheKeyPolicy _includeQueryString. */ + public _includeQueryString?: "includeQueryString"; + + /** + * Creates a new CacheKeyPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns CacheKeyPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.ICacheKeyPolicy): google.cloud.compute.v1.CacheKeyPolicy; + + /** + * Encodes the specified CacheKeyPolicy message. Does not implicitly {@link google.cloud.compute.v1.CacheKeyPolicy.verify|verify} messages. + * @param message CacheKeyPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICacheKeyPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CacheKeyPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CacheKeyPolicy.verify|verify} messages. + * @param message CacheKeyPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICacheKeyPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CacheKeyPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CacheKeyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CacheKeyPolicy; + + /** + * Decodes a CacheKeyPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CacheKeyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CacheKeyPolicy; + + /** + * Verifies a CacheKeyPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CacheKeyPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CacheKeyPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CacheKeyPolicy; + + /** + * Creates a plain object from a CacheKeyPolicy message. Also converts values to other types if specified. + * @param message CacheKeyPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CacheKeyPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CacheKeyPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceCdnPolicyNegativeCachingPolicy. */ + interface IBackendServiceCdnPolicyNegativeCachingPolicy { + + /** BackendServiceCdnPolicyNegativeCachingPolicy code */ + code?: (number|null); + + /** BackendServiceCdnPolicyNegativeCachingPolicy ttl */ + ttl?: (number|null); + } + + /** Represents a BackendServiceCdnPolicyNegativeCachingPolicy. */ + class BackendServiceCdnPolicyNegativeCachingPolicy implements IBackendServiceCdnPolicyNegativeCachingPolicy { + + /** + * Constructs a new BackendServiceCdnPolicyNegativeCachingPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy); + + /** BackendServiceCdnPolicyNegativeCachingPolicy code. */ + public code?: (number|null); + + /** BackendServiceCdnPolicyNegativeCachingPolicy ttl. */ + public ttl?: (number|null); + + /** BackendServiceCdnPolicyNegativeCachingPolicy _code. */ + public _code?: "code"; + + /** BackendServiceCdnPolicyNegativeCachingPolicy _ttl. */ + public _ttl?: "ttl"; + + /** + * Creates a new BackendServiceCdnPolicyNegativeCachingPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceCdnPolicyNegativeCachingPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy): google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy; + + /** + * Encodes the specified BackendServiceCdnPolicyNegativeCachingPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @param message BackendServiceCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceCdnPolicyNegativeCachingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @param message BackendServiceCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceCdnPolicyNegativeCachingPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy; + + /** + * Decodes a BackendServiceCdnPolicyNegativeCachingPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy; + + /** + * Verifies a BackendServiceCdnPolicyNegativeCachingPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceCdnPolicyNegativeCachingPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceCdnPolicyNegativeCachingPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy; + + /** + * Creates a plain object from a BackendServiceCdnPolicyNegativeCachingPolicy message. Also converts values to other types if specified. + * @param message BackendServiceCdnPolicyNegativeCachingPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceCdnPolicyNegativeCachingPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HealthStatus. */ + interface IHealthStatus { + + /** HealthStatus annotations */ + annotations?: ({ [k: string]: string }|null); + + /** HealthStatus forwardingRule */ + forwardingRule?: (string|null); + + /** HealthStatus forwardingRuleIp */ + forwardingRuleIp?: (string|null); + + /** HealthStatus healthState */ + healthState?: (google.cloud.compute.v1.HealthStatus.HealthState|keyof typeof google.cloud.compute.v1.HealthStatus.HealthState|null); + + /** HealthStatus instance */ + instance?: (string|null); + + /** HealthStatus ipAddress */ + ipAddress?: (string|null); + + /** HealthStatus port */ + port?: (number|null); + + /** HealthStatus weight */ + weight?: (string|null); + + /** HealthStatus weightError */ + weightError?: (google.cloud.compute.v1.HealthStatus.WeightError|keyof typeof google.cloud.compute.v1.HealthStatus.WeightError|null); + } + + /** Represents a HealthStatus. */ + class HealthStatus implements IHealthStatus { + + /** + * Constructs a new HealthStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthStatus); + + /** HealthStatus annotations. */ + public annotations: { [k: string]: string }; + + /** HealthStatus forwardingRule. */ + public forwardingRule?: (string|null); + + /** HealthStatus forwardingRuleIp. */ + public forwardingRuleIp?: (string|null); + + /** HealthStatus healthState. */ + public healthState?: (google.cloud.compute.v1.HealthStatus.HealthState|keyof typeof google.cloud.compute.v1.HealthStatus.HealthState|null); + + /** HealthStatus instance. */ + public instance?: (string|null); + + /** HealthStatus ipAddress. */ + public ipAddress?: (string|null); + + /** HealthStatus port. */ + public port?: (number|null); + + /** HealthStatus weight. */ + public weight?: (string|null); + + /** HealthStatus weightError. */ + public weightError?: (google.cloud.compute.v1.HealthStatus.WeightError|keyof typeof google.cloud.compute.v1.HealthStatus.WeightError|null); + + /** HealthStatus _forwardingRule. */ + public _forwardingRule?: "forwardingRule"; + + /** HealthStatus _forwardingRuleIp. */ + public _forwardingRuleIp?: "forwardingRuleIp"; + + /** HealthStatus _healthState. */ + public _healthState?: "healthState"; + + /** HealthStatus _instance. */ + public _instance?: "instance"; + + /** HealthStatus _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** HealthStatus _port. */ + public _port?: "port"; + + /** HealthStatus _weight. */ + public _weight?: "weight"; + + /** HealthStatus _weightError. */ + public _weightError?: "weightError"; + + /** + * Creates a new HealthStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthStatus): google.cloud.compute.v1.HealthStatus; + + /** + * Encodes the specified HealthStatus message. Does not implicitly {@link google.cloud.compute.v1.HealthStatus.verify|verify} messages. + * @param message HealthStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthStatus.verify|verify} messages. + * @param message HealthStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthStatus; + + /** + * Decodes a HealthStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthStatus; + + /** + * Verifies a HealthStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthStatus; + + /** + * Creates a plain object from a HealthStatus message. Also converts values to other types if specified. + * @param message HealthStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HealthStatus { + + /** HealthState enum. */ + enum HealthState { + UNDEFINED_HEALTH_STATE = 0, + HEALTHY = 439801213, + UNHEALTHY = 462118084 + } + + /** WeightError enum. */ + enum WeightError { + UNDEFINED_WEIGHT_ERROR = 0, + INVALID_WEIGHT = 383698400, + MISSING_WEIGHT = 384027537, + UNAVAILABLE_WEIGHT = 439464295, + WEIGHT_NONE = 502428831 + } + } + + /** Properties of a BackendServiceGroupHealth. */ + interface IBackendServiceGroupHealth { + + /** BackendServiceGroupHealth annotations */ + annotations?: ({ [k: string]: string }|null); + + /** BackendServiceGroupHealth healthStatus */ + healthStatus?: (google.cloud.compute.v1.IHealthStatus[]|null); + + /** BackendServiceGroupHealth kind */ + kind?: (string|null); + } + + /** Represents a BackendServiceGroupHealth. */ + class BackendServiceGroupHealth implements IBackendServiceGroupHealth { + + /** + * Constructs a new BackendServiceGroupHealth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceGroupHealth); + + /** BackendServiceGroupHealth annotations. */ + public annotations: { [k: string]: string }; + + /** BackendServiceGroupHealth healthStatus. */ + public healthStatus: google.cloud.compute.v1.IHealthStatus[]; + + /** BackendServiceGroupHealth kind. */ + public kind?: (string|null); + + /** BackendServiceGroupHealth _kind. */ + public _kind?: "kind"; + + /** + * Creates a new BackendServiceGroupHealth instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceGroupHealth instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceGroupHealth): google.cloud.compute.v1.BackendServiceGroupHealth; + + /** + * Encodes the specified BackendServiceGroupHealth message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceGroupHealth.verify|verify} messages. + * @param message BackendServiceGroupHealth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceGroupHealth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceGroupHealth message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceGroupHealth.verify|verify} messages. + * @param message BackendServiceGroupHealth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceGroupHealth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceGroupHealth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceGroupHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceGroupHealth; + + /** + * Decodes a BackendServiceGroupHealth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceGroupHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceGroupHealth; + + /** + * Verifies a BackendServiceGroupHealth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceGroupHealth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceGroupHealth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceGroupHealth; + + /** + * Creates a plain object from a BackendServiceGroupHealth message. Also converts values to other types if specified. + * @param message BackendServiceGroupHealth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceGroupHealth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceGroupHealth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceList. */ + interface IBackendServiceList { + + /** BackendServiceList id */ + id?: (string|null); + + /** BackendServiceList items */ + items?: (google.cloud.compute.v1.IBackendService[]|null); + + /** BackendServiceList kind */ + kind?: (string|null); + + /** BackendServiceList nextPageToken */ + nextPageToken?: (string|null); + + /** BackendServiceList selfLink */ + selfLink?: (string|null); + + /** BackendServiceList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a BackendServiceList. */ + class BackendServiceList implements IBackendServiceList { + + /** + * Constructs a new BackendServiceList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceList); + + /** BackendServiceList id. */ + public id?: (string|null); + + /** BackendServiceList items. */ + public items: google.cloud.compute.v1.IBackendService[]; + + /** BackendServiceList kind. */ + public kind?: (string|null); + + /** BackendServiceList nextPageToken. */ + public nextPageToken?: (string|null); + + /** BackendServiceList selfLink. */ + public selfLink?: (string|null); + + /** BackendServiceList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** BackendServiceList _id. */ + public _id?: "id"; + + /** BackendServiceList _kind. */ + public _kind?: "kind"; + + /** BackendServiceList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** BackendServiceList _selfLink. */ + public _selfLink?: "selfLink"; + + /** BackendServiceList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new BackendServiceList instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceList instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceList): google.cloud.compute.v1.BackendServiceList; + + /** + * Encodes the specified BackendServiceList message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceList.verify|verify} messages. + * @param message BackendServiceList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceList.verify|verify} messages. + * @param message BackendServiceList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceList; + + /** + * Decodes a BackendServiceList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceList; + + /** + * Verifies a BackendServiceList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceList; + + /** + * Creates a plain object from a BackendServiceList message. Also converts values to other types if specified. + * @param message BackendServiceList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BackendServiceReference. */ + interface IBackendServiceReference { + + /** BackendServiceReference backendService */ + backendService?: (string|null); + } + + /** Represents a BackendServiceReference. */ + class BackendServiceReference implements IBackendServiceReference { + + /** + * Constructs a new BackendServiceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBackendServiceReference); + + /** BackendServiceReference backendService. */ + public backendService?: (string|null); + + /** BackendServiceReference _backendService. */ + public _backendService?: "backendService"; + + /** + * Creates a new BackendServiceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns BackendServiceReference instance + */ + public static create(properties?: google.cloud.compute.v1.IBackendServiceReference): google.cloud.compute.v1.BackendServiceReference; + + /** + * Encodes the specified BackendServiceReference message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceReference.verify|verify} messages. + * @param message BackendServiceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBackendServiceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackendServiceReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceReference.verify|verify} messages. + * @param message BackendServiceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBackendServiceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackendServiceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackendServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BackendServiceReference; + + /** + * Decodes a BackendServiceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackendServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BackendServiceReference; + + /** + * Verifies a BackendServiceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackendServiceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackendServiceReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BackendServiceReference; + + /** + * Creates a plain object from a BackendServiceReference message. Also converts values to other types if specified. + * @param message BackendServiceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BackendServiceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackendServiceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr description */ + description?: (string|null); + + /** Expr expression */ + expression?: (string|null); + + /** Expr location */ + location?: (string|null); + + /** Expr title */ + title?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IExpr); + + /** Expr description. */ + public description?: (string|null); + + /** Expr expression. */ + public expression?: (string|null); + + /** Expr location. */ + public location?: (string|null); + + /** Expr title. */ + public title?: (string|null); + + /** Expr _description. */ + public _description?: "description"; + + /** Expr _expression. */ + public _expression?: "expression"; + + /** Expr _location. */ + public _location?: "location"; + + /** Expr _title. */ + public _title?: "title"; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.cloud.compute.v1.IExpr): google.cloud.compute.v1.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.cloud.compute.v1.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.cloud.compute.v1.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding bindingId */ + bindingId?: (string|null); + + /** Binding condition */ + condition?: (google.cloud.compute.v1.IExpr|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding role */ + role?: (string|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBinding); + + /** Binding bindingId. */ + public bindingId?: (string|null); + + /** Binding condition. */ + public condition?: (google.cloud.compute.v1.IExpr|null); + + /** Binding members. */ + public members: string[]; + + /** Binding role. */ + public role?: (string|null); + + /** Binding _bindingId. */ + public _bindingId?: "bindingId"; + + /** Binding _condition. */ + public _condition?: "condition"; + + /** Binding _role. */ + public _role?: "role"; + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.cloud.compute.v1.IBinding): google.cloud.compute.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.compute.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.cloud.compute.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceProperties. */ + interface IInstanceProperties { + + /** InstanceProperties advancedMachineFeatures */ + advancedMachineFeatures?: (google.cloud.compute.v1.IAdvancedMachineFeatures|null); + + /** InstanceProperties canIpForward */ + canIpForward?: (boolean|null); + + /** InstanceProperties confidentialInstanceConfig */ + confidentialInstanceConfig?: (google.cloud.compute.v1.IConfidentialInstanceConfig|null); + + /** InstanceProperties description */ + description?: (string|null); + + /** InstanceProperties disks */ + disks?: (google.cloud.compute.v1.IAttachedDisk[]|null); + + /** InstanceProperties guestAccelerators */ + guestAccelerators?: (google.cloud.compute.v1.IAcceleratorConfig[]|null); + + /** InstanceProperties labels */ + labels?: ({ [k: string]: string }|null); + + /** InstanceProperties machineType */ + machineType?: (string|null); + + /** InstanceProperties metadata */ + metadata?: (google.cloud.compute.v1.IMetadata|null); + + /** InstanceProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** InstanceProperties networkInterfaces */ + networkInterfaces?: (google.cloud.compute.v1.INetworkInterface[]|null); + + /** InstanceProperties privateIpv6GoogleAccess */ + privateIpv6GoogleAccess?: (google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess|keyof typeof google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess|null); + + /** InstanceProperties reservationAffinity */ + reservationAffinity?: (google.cloud.compute.v1.IReservationAffinity|null); + + /** InstanceProperties resourcePolicies */ + resourcePolicies?: (string[]|null); + + /** InstanceProperties scheduling */ + scheduling?: (google.cloud.compute.v1.IScheduling|null); + + /** InstanceProperties serviceAccounts */ + serviceAccounts?: (google.cloud.compute.v1.IServiceAccount[]|null); + + /** InstanceProperties shieldedInstanceConfig */ + shieldedInstanceConfig?: (google.cloud.compute.v1.IShieldedInstanceConfig|null); + + /** InstanceProperties tags */ + tags?: (google.cloud.compute.v1.ITags|null); + } + + /** Represents an InstanceProperties. */ + class InstanceProperties implements IInstanceProperties { + + /** + * Constructs a new InstanceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceProperties); + + /** InstanceProperties advancedMachineFeatures. */ + public advancedMachineFeatures?: (google.cloud.compute.v1.IAdvancedMachineFeatures|null); + + /** InstanceProperties canIpForward. */ + public canIpForward?: (boolean|null); + + /** InstanceProperties confidentialInstanceConfig. */ + public confidentialInstanceConfig?: (google.cloud.compute.v1.IConfidentialInstanceConfig|null); + + /** InstanceProperties description. */ + public description?: (string|null); + + /** InstanceProperties disks. */ + public disks: google.cloud.compute.v1.IAttachedDisk[]; + + /** InstanceProperties guestAccelerators. */ + public guestAccelerators: google.cloud.compute.v1.IAcceleratorConfig[]; + + /** InstanceProperties labels. */ + public labels: { [k: string]: string }; + + /** InstanceProperties machineType. */ + public machineType?: (string|null); + + /** InstanceProperties metadata. */ + public metadata?: (google.cloud.compute.v1.IMetadata|null); + + /** InstanceProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** InstanceProperties networkInterfaces. */ + public networkInterfaces: google.cloud.compute.v1.INetworkInterface[]; + + /** InstanceProperties privateIpv6GoogleAccess. */ + public privateIpv6GoogleAccess?: (google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess|keyof typeof google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess|null); + + /** InstanceProperties reservationAffinity. */ + public reservationAffinity?: (google.cloud.compute.v1.IReservationAffinity|null); + + /** InstanceProperties resourcePolicies. */ + public resourcePolicies: string[]; + + /** InstanceProperties scheduling. */ + public scheduling?: (google.cloud.compute.v1.IScheduling|null); + + /** InstanceProperties serviceAccounts. */ + public serviceAccounts: google.cloud.compute.v1.IServiceAccount[]; + + /** InstanceProperties shieldedInstanceConfig. */ + public shieldedInstanceConfig?: (google.cloud.compute.v1.IShieldedInstanceConfig|null); + + /** InstanceProperties tags. */ + public tags?: (google.cloud.compute.v1.ITags|null); + + /** InstanceProperties _advancedMachineFeatures. */ + public _advancedMachineFeatures?: "advancedMachineFeatures"; + + /** InstanceProperties _canIpForward. */ + public _canIpForward?: "canIpForward"; + + /** InstanceProperties _confidentialInstanceConfig. */ + public _confidentialInstanceConfig?: "confidentialInstanceConfig"; + + /** InstanceProperties _description. */ + public _description?: "description"; + + /** InstanceProperties _machineType. */ + public _machineType?: "machineType"; + + /** InstanceProperties _metadata. */ + public _metadata?: "metadata"; + + /** InstanceProperties _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** InstanceProperties _privateIpv6GoogleAccess. */ + public _privateIpv6GoogleAccess?: "privateIpv6GoogleAccess"; + + /** InstanceProperties _reservationAffinity. */ + public _reservationAffinity?: "reservationAffinity"; + + /** InstanceProperties _scheduling. */ + public _scheduling?: "scheduling"; + + /** InstanceProperties _shieldedInstanceConfig. */ + public _shieldedInstanceConfig?: "shieldedInstanceConfig"; + + /** InstanceProperties _tags. */ + public _tags?: "tags"; + + /** + * Creates a new InstanceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceProperties instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceProperties): google.cloud.compute.v1.InstanceProperties; + + /** + * Encodes the specified InstanceProperties message. Does not implicitly {@link google.cloud.compute.v1.InstanceProperties.verify|verify} messages. + * @param message InstanceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceProperties.verify|verify} messages. + * @param message InstanceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceProperties; + + /** + * Decodes an InstanceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceProperties; + + /** + * Verifies an InstanceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceProperties; + + /** + * Creates a plain object from an InstanceProperties message. Also converts values to other types if specified. + * @param message InstanceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InstanceProperties { + + /** PrivateIpv6GoogleAccess enum. */ + enum PrivateIpv6GoogleAccess { + UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0, + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994, + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263, + INHERIT_FROM_SUBNETWORK = 530256959 + } + } + + /** Properties of a LocationPolicy. */ + interface ILocationPolicy { + + /** LocationPolicy locations */ + locations?: ({ [k: string]: google.cloud.compute.v1.ILocationPolicyLocation }|null); + } + + /** Represents a LocationPolicy. */ + class LocationPolicy implements ILocationPolicy { + + /** + * Constructs a new LocationPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILocationPolicy); + + /** LocationPolicy locations. */ + public locations: { [k: string]: google.cloud.compute.v1.ILocationPolicyLocation }; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.ILocationPolicy): google.cloud.compute.v1.LocationPolicy; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.compute.v1.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LocationPolicy.verify|verify} messages. + * @param message LocationPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILocationPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LocationPolicy; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LocationPolicy; + + /** + * Verifies a LocationPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LocationPolicy; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @param message LocationPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LocationPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BulkInsertInstanceResourcePerInstanceProperties. */ + interface IBulkInsertInstanceResourcePerInstanceProperties { + + /** BulkInsertInstanceResourcePerInstanceProperties name */ + name?: (string|null); + } + + /** Represents a BulkInsertInstanceResourcePerInstanceProperties. */ + class BulkInsertInstanceResourcePerInstanceProperties implements IBulkInsertInstanceResourcePerInstanceProperties { + + /** + * Constructs a new BulkInsertInstanceResourcePerInstanceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties); + + /** BulkInsertInstanceResourcePerInstanceProperties name. */ + public name?: (string|null); + + /** BulkInsertInstanceResourcePerInstanceProperties _name. */ + public _name?: "name"; + + /** + * Creates a new BulkInsertInstanceResourcePerInstanceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkInsertInstanceResourcePerInstanceProperties instance + */ + public static create(properties?: google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties): google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties; + + /** + * Encodes the specified BulkInsertInstanceResourcePerInstanceProperties message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.verify|verify} messages. + * @param message BulkInsertInstanceResourcePerInstanceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkInsertInstanceResourcePerInstanceProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.verify|verify} messages. + * @param message BulkInsertInstanceResourcePerInstanceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkInsertInstanceResourcePerInstanceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkInsertInstanceResourcePerInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties; + + /** + * Decodes a BulkInsertInstanceResourcePerInstanceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkInsertInstanceResourcePerInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties; + + /** + * Verifies a BulkInsertInstanceResourcePerInstanceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkInsertInstanceResourcePerInstanceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkInsertInstanceResourcePerInstanceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties; + + /** + * Creates a plain object from a BulkInsertInstanceResourcePerInstanceProperties message. Also converts values to other types if specified. + * @param message BulkInsertInstanceResourcePerInstanceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkInsertInstanceResourcePerInstanceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BulkInsertInstanceResource. */ + interface IBulkInsertInstanceResource { + + /** BulkInsertInstanceResource count */ + count?: (number|Long|string|null); + + /** BulkInsertInstanceResource instanceProperties */ + instanceProperties?: (google.cloud.compute.v1.IInstanceProperties|null); + + /** BulkInsertInstanceResource locationPolicy */ + locationPolicy?: (google.cloud.compute.v1.ILocationPolicy|null); + + /** BulkInsertInstanceResource minCount */ + minCount?: (number|Long|string|null); + + /** BulkInsertInstanceResource namePattern */ + namePattern?: (string|null); + + /** BulkInsertInstanceResource perInstanceProperties */ + perInstanceProperties?: ({ [k: string]: google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties }|null); + + /** BulkInsertInstanceResource sourceInstanceTemplate */ + sourceInstanceTemplate?: (string|null); + } + + /** Represents a BulkInsertInstanceResource. */ + class BulkInsertInstanceResource implements IBulkInsertInstanceResource { + + /** + * Constructs a new BulkInsertInstanceResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBulkInsertInstanceResource); + + /** BulkInsertInstanceResource count. */ + public count?: (number|Long|string|null); + + /** BulkInsertInstanceResource instanceProperties. */ + public instanceProperties?: (google.cloud.compute.v1.IInstanceProperties|null); + + /** BulkInsertInstanceResource locationPolicy. */ + public locationPolicy?: (google.cloud.compute.v1.ILocationPolicy|null); + + /** BulkInsertInstanceResource minCount. */ + public minCount?: (number|Long|string|null); + + /** BulkInsertInstanceResource namePattern. */ + public namePattern?: (string|null); + + /** BulkInsertInstanceResource perInstanceProperties. */ + public perInstanceProperties: { [k: string]: google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties }; + + /** BulkInsertInstanceResource sourceInstanceTemplate. */ + public sourceInstanceTemplate?: (string|null); + + /** BulkInsertInstanceResource _count. */ + public _count?: "count"; + + /** BulkInsertInstanceResource _instanceProperties. */ + public _instanceProperties?: "instanceProperties"; + + /** BulkInsertInstanceResource _locationPolicy. */ + public _locationPolicy?: "locationPolicy"; + + /** BulkInsertInstanceResource _minCount. */ + public _minCount?: "minCount"; + + /** BulkInsertInstanceResource _namePattern. */ + public _namePattern?: "namePattern"; + + /** BulkInsertInstanceResource _sourceInstanceTemplate. */ + public _sourceInstanceTemplate?: "sourceInstanceTemplate"; + + /** + * Creates a new BulkInsertInstanceResource instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkInsertInstanceResource instance + */ + public static create(properties?: google.cloud.compute.v1.IBulkInsertInstanceResource): google.cloud.compute.v1.BulkInsertInstanceResource; + + /** + * Encodes the specified BulkInsertInstanceResource message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResource.verify|verify} messages. + * @param message BulkInsertInstanceResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBulkInsertInstanceResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkInsertInstanceResource message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResource.verify|verify} messages. + * @param message BulkInsertInstanceResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBulkInsertInstanceResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkInsertInstanceResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkInsertInstanceResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BulkInsertInstanceResource; + + /** + * Decodes a BulkInsertInstanceResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkInsertInstanceResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BulkInsertInstanceResource; + + /** + * Verifies a BulkInsertInstanceResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkInsertInstanceResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkInsertInstanceResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BulkInsertInstanceResource; + + /** + * Creates a plain object from a BulkInsertInstanceResource message. Also converts values to other types if specified. + * @param message BulkInsertInstanceResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BulkInsertInstanceResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkInsertInstanceResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CacheInvalidationRule. */ + interface ICacheInvalidationRule { + + /** CacheInvalidationRule host */ + host?: (string|null); + + /** CacheInvalidationRule path */ + path?: (string|null); + } + + /** Represents a CacheInvalidationRule. */ + class CacheInvalidationRule implements ICacheInvalidationRule { + + /** + * Constructs a new CacheInvalidationRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICacheInvalidationRule); + + /** CacheInvalidationRule host. */ + public host?: (string|null); + + /** CacheInvalidationRule path. */ + public path?: (string|null); + + /** CacheInvalidationRule _host. */ + public _host?: "host"; + + /** CacheInvalidationRule _path. */ + public _path?: "path"; + + /** + * Creates a new CacheInvalidationRule instance using the specified properties. + * @param [properties] Properties to set + * @returns CacheInvalidationRule instance + */ + public static create(properties?: google.cloud.compute.v1.ICacheInvalidationRule): google.cloud.compute.v1.CacheInvalidationRule; + + /** + * Encodes the specified CacheInvalidationRule message. Does not implicitly {@link google.cloud.compute.v1.CacheInvalidationRule.verify|verify} messages. + * @param message CacheInvalidationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICacheInvalidationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CacheInvalidationRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CacheInvalidationRule.verify|verify} messages. + * @param message CacheInvalidationRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICacheInvalidationRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CacheInvalidationRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CacheInvalidationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CacheInvalidationRule; + + /** + * Decodes a CacheInvalidationRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CacheInvalidationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CacheInvalidationRule; + + /** + * Verifies a CacheInvalidationRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CacheInvalidationRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CacheInvalidationRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CacheInvalidationRule; + + /** + * Creates a plain object from a CacheInvalidationRule message. Also converts values to other types if specified. + * @param message CacheInvalidationRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CacheInvalidationRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CacheInvalidationRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LicenseResourceCommitment. */ + interface ILicenseResourceCommitment { + + /** LicenseResourceCommitment amount */ + amount?: (number|Long|string|null); + + /** LicenseResourceCommitment coresPerLicense */ + coresPerLicense?: (string|null); + + /** LicenseResourceCommitment license */ + license?: (string|null); + } + + /** Represents a LicenseResourceCommitment. */ + class LicenseResourceCommitment implements ILicenseResourceCommitment { + + /** + * Constructs a new LicenseResourceCommitment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILicenseResourceCommitment); + + /** LicenseResourceCommitment amount. */ + public amount?: (number|Long|string|null); + + /** LicenseResourceCommitment coresPerLicense. */ + public coresPerLicense?: (string|null); + + /** LicenseResourceCommitment license. */ + public license?: (string|null); + + /** LicenseResourceCommitment _amount. */ + public _amount?: "amount"; + + /** LicenseResourceCommitment _coresPerLicense. */ + public _coresPerLicense?: "coresPerLicense"; + + /** LicenseResourceCommitment _license. */ + public _license?: "license"; + + /** + * Creates a new LicenseResourceCommitment instance using the specified properties. + * @param [properties] Properties to set + * @returns LicenseResourceCommitment instance + */ + public static create(properties?: google.cloud.compute.v1.ILicenseResourceCommitment): google.cloud.compute.v1.LicenseResourceCommitment; + + /** + * Encodes the specified LicenseResourceCommitment message. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceCommitment.verify|verify} messages. + * @param message LicenseResourceCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILicenseResourceCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LicenseResourceCommitment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceCommitment.verify|verify} messages. + * @param message LicenseResourceCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILicenseResourceCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LicenseResourceCommitment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LicenseResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LicenseResourceCommitment; + + /** + * Decodes a LicenseResourceCommitment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LicenseResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LicenseResourceCommitment; + + /** + * Verifies a LicenseResourceCommitment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LicenseResourceCommitment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LicenseResourceCommitment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LicenseResourceCommitment; + + /** + * Creates a plain object from a LicenseResourceCommitment message. Also converts values to other types if specified. + * @param message LicenseResourceCommitment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LicenseResourceCommitment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LicenseResourceCommitment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Reservation. */ + interface IReservation { + + /** Reservation commitment */ + commitment?: (string|null); + + /** Reservation creationTimestamp */ + creationTimestamp?: (string|null); + + /** Reservation description */ + description?: (string|null); + + /** Reservation id */ + id?: (number|Long|string|null); + + /** Reservation kind */ + kind?: (string|null); + + /** Reservation name */ + name?: (string|null); + + /** Reservation satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Reservation selfLink */ + selfLink?: (string|null); + + /** Reservation specificReservation */ + specificReservation?: (google.cloud.compute.v1.IAllocationSpecificSKUReservation|null); + + /** Reservation specificReservationRequired */ + specificReservationRequired?: (boolean|null); + + /** Reservation status */ + status?: (google.cloud.compute.v1.Reservation.Status|keyof typeof google.cloud.compute.v1.Reservation.Status|null); + + /** Reservation zone */ + zone?: (string|null); + } + + /** Represents a Reservation. */ + class Reservation implements IReservation { + + /** + * Constructs a new Reservation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IReservation); + + /** Reservation commitment. */ + public commitment?: (string|null); + + /** Reservation creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Reservation description. */ + public description?: (string|null); + + /** Reservation id. */ + public id?: (number|Long|string|null); + + /** Reservation kind. */ + public kind?: (string|null); + + /** Reservation name. */ + public name?: (string|null); + + /** Reservation satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Reservation selfLink. */ + public selfLink?: (string|null); + + /** Reservation specificReservation. */ + public specificReservation?: (google.cloud.compute.v1.IAllocationSpecificSKUReservation|null); + + /** Reservation specificReservationRequired. */ + public specificReservationRequired?: (boolean|null); + + /** Reservation status. */ + public status?: (google.cloud.compute.v1.Reservation.Status|keyof typeof google.cloud.compute.v1.Reservation.Status|null); + + /** Reservation zone. */ + public zone?: (string|null); + + /** Reservation _commitment. */ + public _commitment?: "commitment"; + + /** Reservation _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Reservation _description. */ + public _description?: "description"; + + /** Reservation _id. */ + public _id?: "id"; + + /** Reservation _kind. */ + public _kind?: "kind"; + + /** Reservation _name. */ + public _name?: "name"; + + /** Reservation _satisfiesPzs. */ + public _satisfiesPzs?: "satisfiesPzs"; + + /** Reservation _selfLink. */ + public _selfLink?: "selfLink"; + + /** Reservation _specificReservation. */ + public _specificReservation?: "specificReservation"; + + /** Reservation _specificReservationRequired. */ + public _specificReservationRequired?: "specificReservationRequired"; + + /** Reservation _status. */ + public _status?: "status"; + + /** Reservation _zone. */ + public _zone?: "zone"; + + /** + * Creates a new Reservation instance using the specified properties. + * @param [properties] Properties to set + * @returns Reservation instance + */ + public static create(properties?: google.cloud.compute.v1.IReservation): google.cloud.compute.v1.Reservation; + + /** + * Encodes the specified Reservation message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IReservation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reservation message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.Reservation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reservation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Reservation { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + INVALID = 530283991, + READY = 77848963, + UPDATING = 494614342 + } + } + + /** Properties of a ResourceCommitment. */ + interface IResourceCommitment { + + /** ResourceCommitment acceleratorType */ + acceleratorType?: (string|null); + + /** ResourceCommitment amount */ + amount?: (number|Long|string|null); + + /** ResourceCommitment type */ + type?: (google.cloud.compute.v1.ResourceCommitment.Type|keyof typeof google.cloud.compute.v1.ResourceCommitment.Type|null); + } + + /** Represents a ResourceCommitment. */ + class ResourceCommitment implements IResourceCommitment { + + /** + * Constructs a new ResourceCommitment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourceCommitment); + + /** ResourceCommitment acceleratorType. */ + public acceleratorType?: (string|null); + + /** ResourceCommitment amount. */ + public amount?: (number|Long|string|null); + + /** ResourceCommitment type. */ + public type?: (google.cloud.compute.v1.ResourceCommitment.Type|keyof typeof google.cloud.compute.v1.ResourceCommitment.Type|null); + + /** ResourceCommitment _acceleratorType. */ + public _acceleratorType?: "acceleratorType"; + + /** ResourceCommitment _amount. */ + public _amount?: "amount"; + + /** ResourceCommitment _type. */ + public _type?: "type"; + + /** + * Creates a new ResourceCommitment instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceCommitment instance + */ + public static create(properties?: google.cloud.compute.v1.IResourceCommitment): google.cloud.compute.v1.ResourceCommitment; + + /** + * Encodes the specified ResourceCommitment message. Does not implicitly {@link google.cloud.compute.v1.ResourceCommitment.verify|verify} messages. + * @param message ResourceCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourceCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceCommitment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourceCommitment.verify|verify} messages. + * @param message ResourceCommitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourceCommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceCommitment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourceCommitment; + + /** + * Decodes a ResourceCommitment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourceCommitment; + + /** + * Verifies a ResourceCommitment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceCommitment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceCommitment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourceCommitment; + + /** + * Creates a plain object from a ResourceCommitment message. Also converts values to other types if specified. + * @param message ResourceCommitment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourceCommitment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceCommitment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourceCommitment { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + ACCELERATOR = 429815371, + LOCAL_SSD = 508934896, + MEMORY = 123056385, + UNSPECIFIED = 526786327, + VCPU = 2628978 + } + } + + /** Properties of a Commitment. */ + interface ICommitment { + + /** Commitment category */ + category?: (google.cloud.compute.v1.Commitment.Category|keyof typeof google.cloud.compute.v1.Commitment.Category|null); + + /** Commitment creationTimestamp */ + creationTimestamp?: (string|null); + + /** Commitment description */ + description?: (string|null); + + /** Commitment endTimestamp */ + endTimestamp?: (string|null); + + /** Commitment id */ + id?: (number|Long|string|null); + + /** Commitment kind */ + kind?: (string|null); + + /** Commitment licenseResource */ + licenseResource?: (google.cloud.compute.v1.ILicenseResourceCommitment|null); + + /** Commitment name */ + name?: (string|null); + + /** Commitment plan */ + plan?: (google.cloud.compute.v1.Commitment.Plan|keyof typeof google.cloud.compute.v1.Commitment.Plan|null); + + /** Commitment region */ + region?: (string|null); + + /** Commitment reservations */ + reservations?: (google.cloud.compute.v1.IReservation[]|null); + + /** Commitment resources */ + resources?: (google.cloud.compute.v1.IResourceCommitment[]|null); + + /** Commitment selfLink */ + selfLink?: (string|null); + + /** Commitment startTimestamp */ + startTimestamp?: (string|null); + + /** Commitment status */ + status?: (google.cloud.compute.v1.Commitment.Status|keyof typeof google.cloud.compute.v1.Commitment.Status|null); + + /** Commitment statusMessage */ + statusMessage?: (string|null); + } + + /** Represents a Commitment. */ + class Commitment implements ICommitment { + + /** + * Constructs a new Commitment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICommitment); + + /** Commitment category. */ + public category?: (google.cloud.compute.v1.Commitment.Category|keyof typeof google.cloud.compute.v1.Commitment.Category|null); + + /** Commitment creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Commitment description. */ + public description?: (string|null); + + /** Commitment endTimestamp. */ + public endTimestamp?: (string|null); + + /** Commitment id. */ + public id?: (number|Long|string|null); + + /** Commitment kind. */ + public kind?: (string|null); + + /** Commitment licenseResource. */ + public licenseResource?: (google.cloud.compute.v1.ILicenseResourceCommitment|null); + + /** Commitment name. */ + public name?: (string|null); + + /** Commitment plan. */ + public plan?: (google.cloud.compute.v1.Commitment.Plan|keyof typeof google.cloud.compute.v1.Commitment.Plan|null); + + /** Commitment region. */ + public region?: (string|null); + + /** Commitment reservations. */ + public reservations: google.cloud.compute.v1.IReservation[]; + + /** Commitment resources. */ + public resources: google.cloud.compute.v1.IResourceCommitment[]; + + /** Commitment selfLink. */ + public selfLink?: (string|null); + + /** Commitment startTimestamp. */ + public startTimestamp?: (string|null); + + /** Commitment status. */ + public status?: (google.cloud.compute.v1.Commitment.Status|keyof typeof google.cloud.compute.v1.Commitment.Status|null); + + /** Commitment statusMessage. */ + public statusMessage?: (string|null); + + /** Commitment _category. */ + public _category?: "category"; + + /** Commitment _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Commitment _description. */ + public _description?: "description"; + + /** Commitment _endTimestamp. */ + public _endTimestamp?: "endTimestamp"; + + /** Commitment _id. */ + public _id?: "id"; + + /** Commitment _kind. */ + public _kind?: "kind"; + + /** Commitment _licenseResource. */ + public _licenseResource?: "licenseResource"; + + /** Commitment _name. */ + public _name?: "name"; + + /** Commitment _plan. */ + public _plan?: "plan"; + + /** Commitment _region. */ + public _region?: "region"; + + /** Commitment _selfLink. */ + public _selfLink?: "selfLink"; + + /** Commitment _startTimestamp. */ + public _startTimestamp?: "startTimestamp"; + + /** Commitment _status. */ + public _status?: "status"; + + /** Commitment _statusMessage. */ + public _statusMessage?: "statusMessage"; + + /** + * Creates a new Commitment instance using the specified properties. + * @param [properties] Properties to set + * @returns Commitment instance + */ + public static create(properties?: google.cloud.compute.v1.ICommitment): google.cloud.compute.v1.Commitment; + + /** + * Encodes the specified Commitment message. Does not implicitly {@link google.cloud.compute.v1.Commitment.verify|verify} messages. + * @param message Commitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Commitment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Commitment.verify|verify} messages. + * @param message Commitment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICommitment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Commitment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Commitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Commitment; + + /** + * Decodes a Commitment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Commitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Commitment; + + /** + * Verifies a Commitment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Commitment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Commitment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Commitment; + + /** + * Creates a plain object from a Commitment message. Also converts values to other types if specified. + * @param message Commitment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Commitment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Commitment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Commitment { + + /** Category enum. */ + enum Category { + UNDEFINED_CATEGORY = 0, + CATEGORY_UNSPECIFIED = 509189462, + LICENSE = 347869217, + MACHINE = 469553191 + } + + /** Plan enum. */ + enum Plan { + UNDEFINED_PLAN = 0, + INVALID = 530283991, + THIRTY_SIX_MONTH = 266295942, + TWELVE_MONTH = 173083962 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + ACTIVE = 314733318, + CREATING = 455564985, + EXPIRED = 482489093, + NOT_YET_ACTIVE = 20607337 + } + } + + /** Properties of a CommitmentsScopedList. */ + interface ICommitmentsScopedList { + + /** CommitmentsScopedList commitments */ + commitments?: (google.cloud.compute.v1.ICommitment[]|null); + + /** CommitmentsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a CommitmentsScopedList. */ + class CommitmentsScopedList implements ICommitmentsScopedList { + + /** + * Constructs a new CommitmentsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICommitmentsScopedList); + + /** CommitmentsScopedList commitments. */ + public commitments: google.cloud.compute.v1.ICommitment[]; + + /** CommitmentsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** CommitmentsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new CommitmentsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitmentsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ICommitmentsScopedList): google.cloud.compute.v1.CommitmentsScopedList; + + /** + * Encodes the specified CommitmentsScopedList message. Does not implicitly {@link google.cloud.compute.v1.CommitmentsScopedList.verify|verify} messages. + * @param message CommitmentsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICommitmentsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitmentsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CommitmentsScopedList.verify|verify} messages. + * @param message CommitmentsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICommitmentsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitmentsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CommitmentsScopedList; + + /** + * Decodes a CommitmentsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CommitmentsScopedList; + + /** + * Verifies a CommitmentsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitmentsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitmentsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CommitmentsScopedList; + + /** + * Creates a plain object from a CommitmentsScopedList message. Also converts values to other types if specified. + * @param message CommitmentsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CommitmentsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitmentsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CommitmentAggregatedList. */ + interface ICommitmentAggregatedList { + + /** CommitmentAggregatedList id */ + id?: (string|null); + + /** CommitmentAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ICommitmentsScopedList }|null); + + /** CommitmentAggregatedList kind */ + kind?: (string|null); + + /** CommitmentAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** CommitmentAggregatedList selfLink */ + selfLink?: (string|null); + + /** CommitmentAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** CommitmentAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a CommitmentAggregatedList. */ + class CommitmentAggregatedList implements ICommitmentAggregatedList { + + /** + * Constructs a new CommitmentAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICommitmentAggregatedList); + + /** CommitmentAggregatedList id. */ + public id?: (string|null); + + /** CommitmentAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ICommitmentsScopedList }; + + /** CommitmentAggregatedList kind. */ + public kind?: (string|null); + + /** CommitmentAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** CommitmentAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** CommitmentAggregatedList unreachables. */ + public unreachables: string[]; + + /** CommitmentAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** CommitmentAggregatedList _id. */ + public _id?: "id"; + + /** CommitmentAggregatedList _kind. */ + public _kind?: "kind"; + + /** CommitmentAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** CommitmentAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** CommitmentAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new CommitmentAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitmentAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ICommitmentAggregatedList): google.cloud.compute.v1.CommitmentAggregatedList; + + /** + * Encodes the specified CommitmentAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.CommitmentAggregatedList.verify|verify} messages. + * @param message CommitmentAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICommitmentAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitmentAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CommitmentAggregatedList.verify|verify} messages. + * @param message CommitmentAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICommitmentAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitmentAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CommitmentAggregatedList; + + /** + * Decodes a CommitmentAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CommitmentAggregatedList; + + /** + * Verifies a CommitmentAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitmentAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitmentAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CommitmentAggregatedList; + + /** + * Creates a plain object from a CommitmentAggregatedList message. Also converts values to other types if specified. + * @param message CommitmentAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CommitmentAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitmentAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CommitmentList. */ + interface ICommitmentList { + + /** CommitmentList id */ + id?: (string|null); + + /** CommitmentList items */ + items?: (google.cloud.compute.v1.ICommitment[]|null); + + /** CommitmentList kind */ + kind?: (string|null); + + /** CommitmentList nextPageToken */ + nextPageToken?: (string|null); + + /** CommitmentList selfLink */ + selfLink?: (string|null); + + /** CommitmentList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a CommitmentList. */ + class CommitmentList implements ICommitmentList { + + /** + * Constructs a new CommitmentList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICommitmentList); + + /** CommitmentList id. */ + public id?: (string|null); + + /** CommitmentList items. */ + public items: google.cloud.compute.v1.ICommitment[]; + + /** CommitmentList kind. */ + public kind?: (string|null); + + /** CommitmentList nextPageToken. */ + public nextPageToken?: (string|null); + + /** CommitmentList selfLink. */ + public selfLink?: (string|null); + + /** CommitmentList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** CommitmentList _id. */ + public _id?: "id"; + + /** CommitmentList _kind. */ + public _kind?: "kind"; + + /** CommitmentList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** CommitmentList _selfLink. */ + public _selfLink?: "selfLink"; + + /** CommitmentList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new CommitmentList instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitmentList instance + */ + public static create(properties?: google.cloud.compute.v1.ICommitmentList): google.cloud.compute.v1.CommitmentList; + + /** + * Encodes the specified CommitmentList message. Does not implicitly {@link google.cloud.compute.v1.CommitmentList.verify|verify} messages. + * @param message CommitmentList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICommitmentList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommitmentList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CommitmentList.verify|verify} messages. + * @param message CommitmentList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICommitmentList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommitmentList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommitmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CommitmentList; + + /** + * Decodes a CommitmentList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommitmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CommitmentList; + + /** + * Verifies a CommitmentList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommitmentList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommitmentList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CommitmentList; + + /** + * Creates a plain object from a CommitmentList message. Also converts values to other types if specified. + * @param message CommitmentList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CommitmentList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommitmentList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition iam */ + iam?: (string|null); + + /** Condition op */ + op?: (string|null); + + /** Condition svc */ + svc?: (string|null); + + /** Condition sys */ + sys?: (string|null); + + /** Condition values */ + values?: (string[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICondition); + + /** Condition iam. */ + public iam?: (string|null); + + /** Condition op. */ + public op?: (string|null); + + /** Condition svc. */ + public svc?: (string|null); + + /** Condition sys. */ + public sys?: (string|null); + + /** Condition values. */ + public values: string[]; + + /** Condition _iam. */ + public _iam?: "iam"; + + /** Condition _op. */ + public _op?: "op"; + + /** Condition _svc. */ + public _svc?: "svc"; + + /** Condition _sys. */ + public _sys?: "sys"; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.cloud.compute.v1.ICondition): google.cloud.compute.v1.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.compute.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Condition; + + /** + * Verifies a Condition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConfidentialInstanceConfig. */ + interface IConfidentialInstanceConfig { + + /** ConfidentialInstanceConfig enableConfidentialCompute */ + enableConfidentialCompute?: (boolean|null); + } + + /** Represents a ConfidentialInstanceConfig. */ + class ConfidentialInstanceConfig implements IConfidentialInstanceConfig { + + /** + * Constructs a new ConfidentialInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IConfidentialInstanceConfig); + + /** ConfidentialInstanceConfig enableConfidentialCompute. */ + public enableConfidentialCompute?: (boolean|null); + + /** ConfidentialInstanceConfig _enableConfidentialCompute. */ + public _enableConfidentialCompute?: "enableConfidentialCompute"; + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidentialInstanceConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IConfidentialInstanceConfig): google.cloud.compute.v1.ConfidentialInstanceConfig; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.compute.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ConfidentialInstanceConfig; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ConfidentialInstanceConfig; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidentialInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ConfidentialInstanceConfig; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @param message ConfidentialInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ConfidentialInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConsistentHashLoadBalancerSettingsHttpCookie. */ + interface IConsistentHashLoadBalancerSettingsHttpCookie { + + /** ConsistentHashLoadBalancerSettingsHttpCookie name */ + name?: (string|null); + + /** ConsistentHashLoadBalancerSettingsHttpCookie path */ + path?: (string|null); + + /** ConsistentHashLoadBalancerSettingsHttpCookie ttl */ + ttl?: (google.cloud.compute.v1.IDuration|null); + } + + /** Represents a ConsistentHashLoadBalancerSettingsHttpCookie. */ + class ConsistentHashLoadBalancerSettingsHttpCookie implements IConsistentHashLoadBalancerSettingsHttpCookie { + + /** + * Constructs a new ConsistentHashLoadBalancerSettingsHttpCookie. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie); + + /** ConsistentHashLoadBalancerSettingsHttpCookie name. */ + public name?: (string|null); + + /** ConsistentHashLoadBalancerSettingsHttpCookie path. */ + public path?: (string|null); + + /** ConsistentHashLoadBalancerSettingsHttpCookie ttl. */ + public ttl?: (google.cloud.compute.v1.IDuration|null); + + /** ConsistentHashLoadBalancerSettingsHttpCookie _name. */ + public _name?: "name"; + + /** ConsistentHashLoadBalancerSettingsHttpCookie _path. */ + public _path?: "path"; + + /** ConsistentHashLoadBalancerSettingsHttpCookie _ttl. */ + public _ttl?: "ttl"; + + /** + * Creates a new ConsistentHashLoadBalancerSettingsHttpCookie instance using the specified properties. + * @param [properties] Properties to set + * @returns ConsistentHashLoadBalancerSettingsHttpCookie instance + */ + public static create(properties?: google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie): google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettingsHttpCookie message. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.verify|verify} messages. + * @param message ConsistentHashLoadBalancerSettingsHttpCookie message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettingsHttpCookie message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.verify|verify} messages. + * @param message ConsistentHashLoadBalancerSettingsHttpCookie message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConsistentHashLoadBalancerSettingsHttpCookie message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConsistentHashLoadBalancerSettingsHttpCookie + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie; + + /** + * Decodes a ConsistentHashLoadBalancerSettingsHttpCookie message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConsistentHashLoadBalancerSettingsHttpCookie + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie; + + /** + * Verifies a ConsistentHashLoadBalancerSettingsHttpCookie message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConsistentHashLoadBalancerSettingsHttpCookie message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConsistentHashLoadBalancerSettingsHttpCookie + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie; + + /** + * Creates a plain object from a ConsistentHashLoadBalancerSettingsHttpCookie message. Also converts values to other types if specified. + * @param message ConsistentHashLoadBalancerSettingsHttpCookie + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConsistentHashLoadBalancerSettingsHttpCookie to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CorsPolicy. */ + interface ICorsPolicy { + + /** CorsPolicy allowCredentials */ + allowCredentials?: (boolean|null); + + /** CorsPolicy allowHeaders */ + allowHeaders?: (string[]|null); + + /** CorsPolicy allowMethods */ + allowMethods?: (string[]|null); + + /** CorsPolicy allowOriginRegexes */ + allowOriginRegexes?: (string[]|null); + + /** CorsPolicy allowOrigins */ + allowOrigins?: (string[]|null); + + /** CorsPolicy disabled */ + disabled?: (boolean|null); + + /** CorsPolicy exposeHeaders */ + exposeHeaders?: (string[]|null); + + /** CorsPolicy maxAge */ + maxAge?: (number|null); + } + + /** Represents a CorsPolicy. */ + class CorsPolicy implements ICorsPolicy { + + /** + * Constructs a new CorsPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICorsPolicy); + + /** CorsPolicy allowCredentials. */ + public allowCredentials?: (boolean|null); + + /** CorsPolicy allowHeaders. */ + public allowHeaders: string[]; + + /** CorsPolicy allowMethods. */ + public allowMethods: string[]; + + /** CorsPolicy allowOriginRegexes. */ + public allowOriginRegexes: string[]; + + /** CorsPolicy allowOrigins. */ + public allowOrigins: string[]; + + /** CorsPolicy disabled. */ + public disabled?: (boolean|null); + + /** CorsPolicy exposeHeaders. */ + public exposeHeaders: string[]; + + /** CorsPolicy maxAge. */ + public maxAge?: (number|null); + + /** CorsPolicy _allowCredentials. */ + public _allowCredentials?: "allowCredentials"; + + /** CorsPolicy _disabled. */ + public _disabled?: "disabled"; + + /** CorsPolicy _maxAge. */ + public _maxAge?: "maxAge"; + + /** + * Creates a new CorsPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns CorsPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.ICorsPolicy): google.cloud.compute.v1.CorsPolicy; + + /** + * Encodes the specified CorsPolicy message. Does not implicitly {@link google.cloud.compute.v1.CorsPolicy.verify|verify} messages. + * @param message CorsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICorsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorsPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CorsPolicy.verify|verify} messages. + * @param message CorsPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICorsPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CorsPolicy; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CorsPolicy; + + /** + * Verifies a CorsPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorsPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorsPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CorsPolicy; + + /** + * Creates a plain object from a CorsPolicy message. Also converts values to other types if specified. + * @param message CorsPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CorsPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorsPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CustomerEncryptionKeyProtectedDisk. */ + interface ICustomerEncryptionKeyProtectedDisk { + + /** CustomerEncryptionKeyProtectedDisk diskEncryptionKey */ + diskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** CustomerEncryptionKeyProtectedDisk source */ + source?: (string|null); + } + + /** Represents a CustomerEncryptionKeyProtectedDisk. */ + class CustomerEncryptionKeyProtectedDisk implements ICustomerEncryptionKeyProtectedDisk { + + /** + * Constructs a new CustomerEncryptionKeyProtectedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk); + + /** CustomerEncryptionKeyProtectedDisk diskEncryptionKey. */ + public diskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** CustomerEncryptionKeyProtectedDisk source. */ + public source?: (string|null); + + /** CustomerEncryptionKeyProtectedDisk _diskEncryptionKey. */ + public _diskEncryptionKey?: "diskEncryptionKey"; + + /** CustomerEncryptionKeyProtectedDisk _source. */ + public _source?: "source"; + + /** + * Creates a new CustomerEncryptionKeyProtectedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEncryptionKeyProtectedDisk instance + */ + public static create(properties?: google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk): google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk; + + /** + * Encodes the specified CustomerEncryptionKeyProtectedDisk message. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.verify|verify} messages. + * @param message CustomerEncryptionKeyProtectedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEncryptionKeyProtectedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.verify|verify} messages. + * @param message CustomerEncryptionKeyProtectedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEncryptionKeyProtectedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEncryptionKeyProtectedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk; + + /** + * Decodes a CustomerEncryptionKeyProtectedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEncryptionKeyProtectedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk; + + /** + * Verifies a CustomerEncryptionKeyProtectedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEncryptionKeyProtectedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEncryptionKeyProtectedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk; + + /** + * Creates a plain object from a CustomerEncryptionKeyProtectedDisk message. Also converts values to other types if specified. + * @param message CustomerEncryptionKeyProtectedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEncryptionKeyProtectedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Disk. */ + interface IDisk { + + /** Disk creationTimestamp */ + creationTimestamp?: (string|null); + + /** Disk description */ + description?: (string|null); + + /** Disk diskEncryptionKey */ + diskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Disk guestOsFeatures */ + guestOsFeatures?: (google.cloud.compute.v1.IGuestOsFeature[]|null); + + /** Disk id */ + id?: (number|Long|string|null); + + /** Disk kind */ + kind?: (string|null); + + /** Disk labelFingerprint */ + labelFingerprint?: (string|null); + + /** Disk labels */ + labels?: ({ [k: string]: string }|null); + + /** Disk lastAttachTimestamp */ + lastAttachTimestamp?: (string|null); + + /** Disk lastDetachTimestamp */ + lastDetachTimestamp?: (string|null); + + /** Disk licenseCodes */ + licenseCodes?: ((number|Long|string)[]|null); + + /** Disk licenses */ + licenses?: (string[]|null); + + /** Disk locationHint */ + locationHint?: (string|null); + + /** Disk name */ + name?: (string|null); + + /** Disk options */ + options?: (string|null); + + /** Disk physicalBlockSizeBytes */ + physicalBlockSizeBytes?: (number|Long|string|null); + + /** Disk provisionedIops */ + provisionedIops?: (number|Long|string|null); + + /** Disk region */ + region?: (string|null); + + /** Disk replicaZones */ + replicaZones?: (string[]|null); + + /** Disk resourcePolicies */ + resourcePolicies?: (string[]|null); + + /** Disk satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Disk selfLink */ + selfLink?: (string|null); + + /** Disk sizeGb */ + sizeGb?: (number|Long|string|null); + + /** Disk sourceDisk */ + sourceDisk?: (string|null); + + /** Disk sourceDiskId */ + sourceDiskId?: (string|null); + + /** Disk sourceImage */ + sourceImage?: (string|null); + + /** Disk sourceImageEncryptionKey */ + sourceImageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Disk sourceImageId */ + sourceImageId?: (string|null); + + /** Disk sourceSnapshot */ + sourceSnapshot?: (string|null); + + /** Disk sourceSnapshotEncryptionKey */ + sourceSnapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Disk sourceSnapshotId */ + sourceSnapshotId?: (string|null); + + /** Disk sourceStorageObject */ + sourceStorageObject?: (string|null); + + /** Disk status */ + status?: (google.cloud.compute.v1.Disk.Status|keyof typeof google.cloud.compute.v1.Disk.Status|null); + + /** Disk type */ + type?: (string|null); + + /** Disk users */ + users?: (string[]|null); + + /** Disk zone */ + zone?: (string|null); + } + + /** Represents a Disk. */ + class Disk implements IDisk { + + /** + * Constructs a new Disk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisk); + + /** Disk creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Disk description. */ + public description?: (string|null); + + /** Disk diskEncryptionKey. */ + public diskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Disk guestOsFeatures. */ + public guestOsFeatures: google.cloud.compute.v1.IGuestOsFeature[]; + + /** Disk id. */ + public id?: (number|Long|string|null); + + /** Disk kind. */ + public kind?: (string|null); + + /** Disk labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** Disk labels. */ + public labels: { [k: string]: string }; + + /** Disk lastAttachTimestamp. */ + public lastAttachTimestamp?: (string|null); + + /** Disk lastDetachTimestamp. */ + public lastDetachTimestamp?: (string|null); + + /** Disk licenseCodes. */ + public licenseCodes: (number|Long|string)[]; + + /** Disk licenses. */ + public licenses: string[]; + + /** Disk locationHint. */ + public locationHint?: (string|null); + + /** Disk name. */ + public name?: (string|null); + + /** Disk options. */ + public options?: (string|null); + + /** Disk physicalBlockSizeBytes. */ + public physicalBlockSizeBytes?: (number|Long|string|null); + + /** Disk provisionedIops. */ + public provisionedIops?: (number|Long|string|null); + + /** Disk region. */ + public region?: (string|null); + + /** Disk replicaZones. */ + public replicaZones: string[]; + + /** Disk resourcePolicies. */ + public resourcePolicies: string[]; + + /** Disk satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Disk selfLink. */ + public selfLink?: (string|null); + + /** Disk sizeGb. */ + public sizeGb?: (number|Long|string|null); + + /** Disk sourceDisk. */ + public sourceDisk?: (string|null); + + /** Disk sourceDiskId. */ + public sourceDiskId?: (string|null); + + /** Disk sourceImage. */ + public sourceImage?: (string|null); + + /** Disk sourceImageEncryptionKey. */ + public sourceImageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Disk sourceImageId. */ + public sourceImageId?: (string|null); + + /** Disk sourceSnapshot. */ + public sourceSnapshot?: (string|null); + + /** Disk sourceSnapshotEncryptionKey. */ + public sourceSnapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Disk sourceSnapshotId. */ + public sourceSnapshotId?: (string|null); + + /** Disk sourceStorageObject. */ + public sourceStorageObject?: (string|null); + + /** Disk status. */ + public status?: (google.cloud.compute.v1.Disk.Status|keyof typeof google.cloud.compute.v1.Disk.Status|null); + + /** Disk type. */ + public type?: (string|null); + + /** Disk users. */ + public users: string[]; + + /** Disk zone. */ + public zone?: (string|null); + + /** Disk _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Disk _description. */ + public _description?: "description"; + + /** Disk _diskEncryptionKey. */ + public _diskEncryptionKey?: "diskEncryptionKey"; + + /** Disk _id. */ + public _id?: "id"; + + /** Disk _kind. */ + public _kind?: "kind"; + + /** Disk _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** Disk _lastAttachTimestamp. */ + public _lastAttachTimestamp?: "lastAttachTimestamp"; + + /** Disk _lastDetachTimestamp. */ + public _lastDetachTimestamp?: "lastDetachTimestamp"; + + /** Disk _locationHint. */ + public _locationHint?: "locationHint"; + + /** Disk _name. */ + public _name?: "name"; + + /** Disk _options. */ + public _options?: "options"; + + /** Disk _physicalBlockSizeBytes. */ + public _physicalBlockSizeBytes?: "physicalBlockSizeBytes"; + + /** Disk _provisionedIops. */ + public _provisionedIops?: "provisionedIops"; + + /** Disk _region. */ + public _region?: "region"; + + /** Disk _satisfiesPzs. */ + public _satisfiesPzs?: "satisfiesPzs"; + + /** Disk _selfLink. */ + public _selfLink?: "selfLink"; + + /** Disk _sizeGb. */ + public _sizeGb?: "sizeGb"; + + /** Disk _sourceDisk. */ + public _sourceDisk?: "sourceDisk"; + + /** Disk _sourceDiskId. */ + public _sourceDiskId?: "sourceDiskId"; + + /** Disk _sourceImage. */ + public _sourceImage?: "sourceImage"; + + /** Disk _sourceImageEncryptionKey. */ + public _sourceImageEncryptionKey?: "sourceImageEncryptionKey"; + + /** Disk _sourceImageId. */ + public _sourceImageId?: "sourceImageId"; + + /** Disk _sourceSnapshot. */ + public _sourceSnapshot?: "sourceSnapshot"; + + /** Disk _sourceSnapshotEncryptionKey. */ + public _sourceSnapshotEncryptionKey?: "sourceSnapshotEncryptionKey"; + + /** Disk _sourceSnapshotId. */ + public _sourceSnapshotId?: "sourceSnapshotId"; + + /** Disk _sourceStorageObject. */ + public _sourceStorageObject?: "sourceStorageObject"; + + /** Disk _status. */ + public _status?: "status"; + + /** Disk _type. */ + public _type?: "type"; + + /** Disk _zone. */ + public _zone?: "zone"; + + /** + * Creates a new Disk instance using the specified properties. + * @param [properties] Properties to set + * @returns Disk instance + */ + public static create(properties?: google.cloud.compute.v1.IDisk): google.cloud.compute.v1.Disk; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.compute.v1.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Disk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Disk.verify|verify} messages. + * @param message Disk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Disk; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Disk; + + /** + * Verifies a Disk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Disk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Disk; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @param message Disk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Disk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Disk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Disk { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + FAILED = 455706685, + READY = 77848963, + RESTORING = 404263851 + } + } + + /** Properties of a DisksScopedList. */ + interface IDisksScopedList { + + /** DisksScopedList disks */ + disks?: (google.cloud.compute.v1.IDisk[]|null); + + /** DisksScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a DisksScopedList. */ + class DisksScopedList implements IDisksScopedList { + + /** + * Constructs a new DisksScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisksScopedList); + + /** DisksScopedList disks. */ + public disks: google.cloud.compute.v1.IDisk[]; + + /** DisksScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** DisksScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new DisksScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns DisksScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IDisksScopedList): google.cloud.compute.v1.DisksScopedList; + + /** + * Encodes the specified DisksScopedList message. Does not implicitly {@link google.cloud.compute.v1.DisksScopedList.verify|verify} messages. + * @param message DisksScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisksScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisksScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksScopedList.verify|verify} messages. + * @param message DisksScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisksScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisksScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DisksScopedList; + + /** + * Decodes a DisksScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DisksScopedList; + + /** + * Verifies a DisksScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisksScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisksScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DisksScopedList; + + /** + * Creates a plain object from a DisksScopedList message. Also converts values to other types if specified. + * @param message DisksScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DisksScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisksScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DiskAggregatedList. */ + interface IDiskAggregatedList { + + /** DiskAggregatedList id */ + id?: (string|null); + + /** DiskAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IDisksScopedList }|null); + + /** DiskAggregatedList kind */ + kind?: (string|null); + + /** DiskAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** DiskAggregatedList selfLink */ + selfLink?: (string|null); + + /** DiskAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** DiskAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a DiskAggregatedList. */ + class DiskAggregatedList implements IDiskAggregatedList { + + /** + * Constructs a new DiskAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskAggregatedList); + + /** DiskAggregatedList id. */ + public id?: (string|null); + + /** DiskAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IDisksScopedList }; + + /** DiskAggregatedList kind. */ + public kind?: (string|null); + + /** DiskAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** DiskAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** DiskAggregatedList unreachables. */ + public unreachables: string[]; + + /** DiskAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** DiskAggregatedList _id. */ + public _id?: "id"; + + /** DiskAggregatedList _kind. */ + public _kind?: "kind"; + + /** DiskAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** DiskAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** DiskAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new DiskAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskAggregatedList): google.cloud.compute.v1.DiskAggregatedList; + + /** + * Encodes the specified DiskAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.DiskAggregatedList.verify|verify} messages. + * @param message DiskAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskAggregatedList.verify|verify} messages. + * @param message DiskAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskAggregatedList; + + /** + * Decodes a DiskAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskAggregatedList; + + /** + * Verifies a DiskAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskAggregatedList; + + /** + * Creates a plain object from a DiskAggregatedList message. Also converts values to other types if specified. + * @param message DiskAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DiskInstantiationConfig. */ + interface IDiskInstantiationConfig { + + /** DiskInstantiationConfig autoDelete */ + autoDelete?: (boolean|null); + + /** DiskInstantiationConfig customImage */ + customImage?: (string|null); + + /** DiskInstantiationConfig deviceName */ + deviceName?: (string|null); + + /** DiskInstantiationConfig instantiateFrom */ + instantiateFrom?: (google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom|keyof typeof google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom|null); + } + + /** Represents a DiskInstantiationConfig. */ + class DiskInstantiationConfig implements IDiskInstantiationConfig { + + /** + * Constructs a new DiskInstantiationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskInstantiationConfig); + + /** DiskInstantiationConfig autoDelete. */ + public autoDelete?: (boolean|null); + + /** DiskInstantiationConfig customImage. */ + public customImage?: (string|null); + + /** DiskInstantiationConfig deviceName. */ + public deviceName?: (string|null); + + /** DiskInstantiationConfig instantiateFrom. */ + public instantiateFrom?: (google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom|keyof typeof google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom|null); + + /** DiskInstantiationConfig _autoDelete. */ + public _autoDelete?: "autoDelete"; + + /** DiskInstantiationConfig _customImage. */ + public _customImage?: "customImage"; + + /** DiskInstantiationConfig _deviceName. */ + public _deviceName?: "deviceName"; + + /** DiskInstantiationConfig _instantiateFrom. */ + public _instantiateFrom?: "instantiateFrom"; + + /** + * Creates a new DiskInstantiationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskInstantiationConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskInstantiationConfig): google.cloud.compute.v1.DiskInstantiationConfig; + + /** + * Encodes the specified DiskInstantiationConfig message. Does not implicitly {@link google.cloud.compute.v1.DiskInstantiationConfig.verify|verify} messages. + * @param message DiskInstantiationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskInstantiationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskInstantiationConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskInstantiationConfig.verify|verify} messages. + * @param message DiskInstantiationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskInstantiationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskInstantiationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskInstantiationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskInstantiationConfig; + + /** + * Decodes a DiskInstantiationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskInstantiationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskInstantiationConfig; + + /** + * Verifies a DiskInstantiationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskInstantiationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskInstantiationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskInstantiationConfig; + + /** + * Creates a plain object from a DiskInstantiationConfig message. Also converts values to other types if specified. + * @param message DiskInstantiationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskInstantiationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskInstantiationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DiskInstantiationConfig { + + /** InstantiateFrom enum. */ + enum InstantiateFrom { + UNDEFINED_INSTANTIATE_FROM = 0, + ATTACH_READ_ONLY = 513775419, + BLANK = 63281460, + CUSTOM_IMAGE = 196311789, + DEFAULT = 115302945, + DO_NOT_INCLUDE = 104218952, + SOURCE_IMAGE = 62631959, + SOURCE_IMAGE_FAMILY = 76850316 + } + } + + /** Properties of a DiskList. */ + interface IDiskList { + + /** DiskList id */ + id?: (string|null); + + /** DiskList items */ + items?: (google.cloud.compute.v1.IDisk[]|null); + + /** DiskList kind */ + kind?: (string|null); + + /** DiskList nextPageToken */ + nextPageToken?: (string|null); + + /** DiskList selfLink */ + selfLink?: (string|null); + + /** DiskList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a DiskList. */ + class DiskList implements IDiskList { + + /** + * Constructs a new DiskList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskList); + + /** DiskList id. */ + public id?: (string|null); + + /** DiskList items. */ + public items: google.cloud.compute.v1.IDisk[]; + + /** DiskList kind. */ + public kind?: (string|null); + + /** DiskList nextPageToken. */ + public nextPageToken?: (string|null); + + /** DiskList selfLink. */ + public selfLink?: (string|null); + + /** DiskList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** DiskList _id. */ + public _id?: "id"; + + /** DiskList _kind. */ + public _kind?: "kind"; + + /** DiskList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** DiskList _selfLink. */ + public _selfLink?: "selfLink"; + + /** DiskList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new DiskList instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskList instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskList): google.cloud.compute.v1.DiskList; + + /** + * Encodes the specified DiskList message. Does not implicitly {@link google.cloud.compute.v1.DiskList.verify|verify} messages. + * @param message DiskList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskList.verify|verify} messages. + * @param message DiskList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskList; + + /** + * Decodes a DiskList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskList; + + /** + * Verifies a DiskList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskList; + + /** + * Creates a plain object from a DiskList message. Also converts values to other types if specified. + * @param message DiskList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DiskMoveRequest. */ + interface IDiskMoveRequest { + + /** DiskMoveRequest destinationZone */ + destinationZone?: (string|null); + + /** DiskMoveRequest targetDisk */ + targetDisk?: (string|null); + } + + /** Represents a DiskMoveRequest. */ + class DiskMoveRequest implements IDiskMoveRequest { + + /** + * Constructs a new DiskMoveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskMoveRequest); + + /** DiskMoveRequest destinationZone. */ + public destinationZone?: (string|null); + + /** DiskMoveRequest targetDisk. */ + public targetDisk?: (string|null); + + /** DiskMoveRequest _destinationZone. */ + public _destinationZone?: "destinationZone"; + + /** DiskMoveRequest _targetDisk. */ + public _targetDisk?: "targetDisk"; + + /** + * Creates a new DiskMoveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskMoveRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskMoveRequest): google.cloud.compute.v1.DiskMoveRequest; + + /** + * Encodes the specified DiskMoveRequest message. Does not implicitly {@link google.cloud.compute.v1.DiskMoveRequest.verify|verify} messages. + * @param message DiskMoveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskMoveRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskMoveRequest.verify|verify} messages. + * @param message DiskMoveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskMoveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskMoveRequest; + + /** + * Decodes a DiskMoveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskMoveRequest; + + /** + * Verifies a DiskMoveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskMoveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskMoveRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskMoveRequest; + + /** + * Creates a plain object from a DiskMoveRequest message. Also converts values to other types if specified. + * @param message DiskMoveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskMoveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DiskType. */ + interface IDiskType { + + /** DiskType creationTimestamp */ + creationTimestamp?: (string|null); + + /** DiskType defaultDiskSizeGb */ + defaultDiskSizeGb?: (number|Long|string|null); + + /** DiskType deprecated */ + deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** DiskType description */ + description?: (string|null); + + /** DiskType id */ + id?: (number|Long|string|null); + + /** DiskType kind */ + kind?: (string|null); + + /** DiskType name */ + name?: (string|null); + + /** DiskType region */ + region?: (string|null); + + /** DiskType selfLink */ + selfLink?: (string|null); + + /** DiskType validDiskSize */ + validDiskSize?: (string|null); + + /** DiskType zone */ + zone?: (string|null); + } + + /** Represents a DiskType. */ + class DiskType implements IDiskType { + + /** + * Constructs a new DiskType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskType); + + /** DiskType creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** DiskType defaultDiskSizeGb. */ + public defaultDiskSizeGb?: (number|Long|string|null); + + /** DiskType deprecated. */ + public deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** DiskType description. */ + public description?: (string|null); + + /** DiskType id. */ + public id?: (number|Long|string|null); + + /** DiskType kind. */ + public kind?: (string|null); + + /** DiskType name. */ + public name?: (string|null); + + /** DiskType region. */ + public region?: (string|null); + + /** DiskType selfLink. */ + public selfLink?: (string|null); + + /** DiskType validDiskSize. */ + public validDiskSize?: (string|null); + + /** DiskType zone. */ + public zone?: (string|null); + + /** DiskType _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** DiskType _defaultDiskSizeGb. */ + public _defaultDiskSizeGb?: "defaultDiskSizeGb"; + + /** DiskType _deprecated. */ + public _deprecated?: "deprecated"; + + /** DiskType _description. */ + public _description?: "description"; + + /** DiskType _id. */ + public _id?: "id"; + + /** DiskType _kind. */ + public _kind?: "kind"; + + /** DiskType _name. */ + public _name?: "name"; + + /** DiskType _region. */ + public _region?: "region"; + + /** DiskType _selfLink. */ + public _selfLink?: "selfLink"; + + /** DiskType _validDiskSize. */ + public _validDiskSize?: "validDiskSize"; + + /** DiskType _zone. */ + public _zone?: "zone"; + + /** + * Creates a new DiskType instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskType instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskType): google.cloud.compute.v1.DiskType; + + /** + * Encodes the specified DiskType message. Does not implicitly {@link google.cloud.compute.v1.DiskType.verify|verify} messages. + * @param message DiskType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskType.verify|verify} messages. + * @param message DiskType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskType; + + /** + * Decodes a DiskType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskType; + + /** + * Verifies a DiskType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskType; + + /** + * Creates a plain object from a DiskType message. Also converts values to other types if specified. + * @param message DiskType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DiskTypesScopedList. */ + interface IDiskTypesScopedList { + + /** DiskTypesScopedList diskTypes */ + diskTypes?: (google.cloud.compute.v1.IDiskType[]|null); + + /** DiskTypesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a DiskTypesScopedList. */ + class DiskTypesScopedList implements IDiskTypesScopedList { + + /** + * Constructs a new DiskTypesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskTypesScopedList); + + /** DiskTypesScopedList diskTypes. */ + public diskTypes: google.cloud.compute.v1.IDiskType[]; + + /** DiskTypesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** DiskTypesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new DiskTypesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskTypesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskTypesScopedList): google.cloud.compute.v1.DiskTypesScopedList; + + /** + * Encodes the specified DiskTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.DiskTypesScopedList.verify|verify} messages. + * @param message DiskTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskTypesScopedList.verify|verify} messages. + * @param message DiskTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskTypesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskTypesScopedList; + + /** + * Decodes a DiskTypesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskTypesScopedList; + + /** + * Verifies a DiskTypesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskTypesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskTypesScopedList; + + /** + * Creates a plain object from a DiskTypesScopedList message. Also converts values to other types if specified. + * @param message DiskTypesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskTypesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskTypesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DiskTypeAggregatedList. */ + interface IDiskTypeAggregatedList { + + /** DiskTypeAggregatedList id */ + id?: (string|null); + + /** DiskTypeAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IDiskTypesScopedList }|null); + + /** DiskTypeAggregatedList kind */ + kind?: (string|null); + + /** DiskTypeAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** DiskTypeAggregatedList selfLink */ + selfLink?: (string|null); + + /** DiskTypeAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** DiskTypeAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a DiskTypeAggregatedList. */ + class DiskTypeAggregatedList implements IDiskTypeAggregatedList { + + /** + * Constructs a new DiskTypeAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskTypeAggregatedList); + + /** DiskTypeAggregatedList id. */ + public id?: (string|null); + + /** DiskTypeAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IDiskTypesScopedList }; + + /** DiskTypeAggregatedList kind. */ + public kind?: (string|null); + + /** DiskTypeAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** DiskTypeAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** DiskTypeAggregatedList unreachables. */ + public unreachables: string[]; + + /** DiskTypeAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** DiskTypeAggregatedList _id. */ + public _id?: "id"; + + /** DiskTypeAggregatedList _kind. */ + public _kind?: "kind"; + + /** DiskTypeAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** DiskTypeAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** DiskTypeAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new DiskTypeAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskTypeAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskTypeAggregatedList): google.cloud.compute.v1.DiskTypeAggregatedList; + + /** + * Encodes the specified DiskTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.DiskTypeAggregatedList.verify|verify} messages. + * @param message DiskTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskTypeAggregatedList.verify|verify} messages. + * @param message DiskTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskTypeAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskTypeAggregatedList; + + /** + * Decodes a DiskTypeAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskTypeAggregatedList; + + /** + * Verifies a DiskTypeAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskTypeAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskTypeAggregatedList; + + /** + * Creates a plain object from a DiskTypeAggregatedList message. Also converts values to other types if specified. + * @param message DiskTypeAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskTypeAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskTypeAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DiskTypeList. */ + interface IDiskTypeList { + + /** DiskTypeList id */ + id?: (string|null); + + /** DiskTypeList items */ + items?: (google.cloud.compute.v1.IDiskType[]|null); + + /** DiskTypeList kind */ + kind?: (string|null); + + /** DiskTypeList nextPageToken */ + nextPageToken?: (string|null); + + /** DiskTypeList selfLink */ + selfLink?: (string|null); + + /** DiskTypeList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a DiskTypeList. */ + class DiskTypeList implements IDiskTypeList { + + /** + * Constructs a new DiskTypeList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDiskTypeList); + + /** DiskTypeList id. */ + public id?: (string|null); + + /** DiskTypeList items. */ + public items: google.cloud.compute.v1.IDiskType[]; + + /** DiskTypeList kind. */ + public kind?: (string|null); + + /** DiskTypeList nextPageToken. */ + public nextPageToken?: (string|null); + + /** DiskTypeList selfLink. */ + public selfLink?: (string|null); + + /** DiskTypeList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** DiskTypeList _id. */ + public _id?: "id"; + + /** DiskTypeList _kind. */ + public _kind?: "kind"; + + /** DiskTypeList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** DiskTypeList _selfLink. */ + public _selfLink?: "selfLink"; + + /** DiskTypeList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new DiskTypeList instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskTypeList instance + */ + public static create(properties?: google.cloud.compute.v1.IDiskTypeList): google.cloud.compute.v1.DiskTypeList; + + /** + * Encodes the specified DiskTypeList message. Does not implicitly {@link google.cloud.compute.v1.DiskTypeList.verify|verify} messages. + * @param message DiskTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDiskTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskTypeList.verify|verify} messages. + * @param message DiskTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDiskTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskTypeList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DiskTypeList; + + /** + * Decodes a DiskTypeList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DiskTypeList; + + /** + * Verifies a DiskTypeList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskTypeList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskTypeList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DiskTypeList; + + /** + * Creates a plain object from a DiskTypeList message. Also converts values to other types if specified. + * @param message DiskTypeList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DiskTypeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskTypeList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DisksAddResourcePoliciesRequest. */ + interface IDisksAddResourcePoliciesRequest { + + /** DisksAddResourcePoliciesRequest resourcePolicies */ + resourcePolicies?: (string[]|null); + } + + /** Represents a DisksAddResourcePoliciesRequest. */ + class DisksAddResourcePoliciesRequest implements IDisksAddResourcePoliciesRequest { + + /** + * Constructs a new DisksAddResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisksAddResourcePoliciesRequest); + + /** DisksAddResourcePoliciesRequest resourcePolicies. */ + public resourcePolicies: string[]; + + /** + * Creates a new DisksAddResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisksAddResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDisksAddResourcePoliciesRequest): google.cloud.compute.v1.DisksAddResourcePoliciesRequest; + + /** + * Encodes the specified DisksAddResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.DisksAddResourcePoliciesRequest.verify|verify} messages. + * @param message DisksAddResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisksAddResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisksAddResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksAddResourcePoliciesRequest.verify|verify} messages. + * @param message DisksAddResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisksAddResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisksAddResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DisksAddResourcePoliciesRequest; + + /** + * Decodes a DisksAddResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DisksAddResourcePoliciesRequest; + + /** + * Verifies a DisksAddResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisksAddResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisksAddResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DisksAddResourcePoliciesRequest; + + /** + * Creates a plain object from a DisksAddResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message DisksAddResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DisksAddResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisksAddResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DisksRemoveResourcePoliciesRequest. */ + interface IDisksRemoveResourcePoliciesRequest { + + /** DisksRemoveResourcePoliciesRequest resourcePolicies */ + resourcePolicies?: (string[]|null); + } + + /** Represents a DisksRemoveResourcePoliciesRequest. */ + class DisksRemoveResourcePoliciesRequest implements IDisksRemoveResourcePoliciesRequest { + + /** + * Constructs a new DisksRemoveResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest); + + /** DisksRemoveResourcePoliciesRequest resourcePolicies. */ + public resourcePolicies: string[]; + + /** + * Creates a new DisksRemoveResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisksRemoveResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest): google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest; + + /** + * Encodes the specified DisksRemoveResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @param message DisksRemoveResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisksRemoveResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @param message DisksRemoveResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisksRemoveResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest; + + /** + * Decodes a DisksRemoveResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest; + + /** + * Verifies a DisksRemoveResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisksRemoveResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisksRemoveResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest; + + /** + * Creates a plain object from a DisksRemoveResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message DisksRemoveResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisksRemoveResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DisksResizeRequest. */ + interface IDisksResizeRequest { + + /** DisksResizeRequest sizeGb */ + sizeGb?: (number|Long|string|null); + } + + /** Represents a DisksResizeRequest. */ + class DisksResizeRequest implements IDisksResizeRequest { + + /** + * Constructs a new DisksResizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisksResizeRequest); + + /** DisksResizeRequest sizeGb. */ + public sizeGb?: (number|Long|string|null); + + /** DisksResizeRequest _sizeGb. */ + public _sizeGb?: "sizeGb"; + + /** + * Creates a new DisksResizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisksResizeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDisksResizeRequest): google.cloud.compute.v1.DisksResizeRequest; + + /** + * Encodes the specified DisksResizeRequest message. Does not implicitly {@link google.cloud.compute.v1.DisksResizeRequest.verify|verify} messages. + * @param message DisksResizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisksResizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisksResizeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksResizeRequest.verify|verify} messages. + * @param message DisksResizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisksResizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisksResizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DisksResizeRequest; + + /** + * Decodes a DisksResizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DisksResizeRequest; + + /** + * Verifies a DisksResizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisksResizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisksResizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DisksResizeRequest; + + /** + * Creates a plain object from a DisksResizeRequest message. Also converts values to other types if specified. + * @param message DisksResizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DisksResizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisksResizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DisplayDevice. */ + interface IDisplayDevice { + + /** DisplayDevice enableDisplay */ + enableDisplay?: (boolean|null); + } + + /** Represents a DisplayDevice. */ + class DisplayDevice implements IDisplayDevice { + + /** + * Constructs a new DisplayDevice. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisplayDevice); + + /** DisplayDevice enableDisplay. */ + public enableDisplay?: (boolean|null); + + /** DisplayDevice _enableDisplay. */ + public _enableDisplay?: "enableDisplay"; + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @param [properties] Properties to set + * @returns DisplayDevice instance + */ + public static create(properties?: google.cloud.compute.v1.IDisplayDevice): google.cloud.compute.v1.DisplayDevice; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.compute.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DisplayDevice; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DisplayDevice; + + /** + * Verifies a DisplayDevice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisplayDevice + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DisplayDevice; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @param message DisplayDevice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DisplayDevice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisplayDevice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DistributionPolicyZoneConfiguration. */ + interface IDistributionPolicyZoneConfiguration { + + /** DistributionPolicyZoneConfiguration zone */ + zone?: (string|null); + } + + /** Represents a DistributionPolicyZoneConfiguration. */ + class DistributionPolicyZoneConfiguration implements IDistributionPolicyZoneConfiguration { + + /** + * Constructs a new DistributionPolicyZoneConfiguration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDistributionPolicyZoneConfiguration); + + /** DistributionPolicyZoneConfiguration zone. */ + public zone?: (string|null); + + /** DistributionPolicyZoneConfiguration _zone. */ + public _zone?: "zone"; + + /** + * Creates a new DistributionPolicyZoneConfiguration instance using the specified properties. + * @param [properties] Properties to set + * @returns DistributionPolicyZoneConfiguration instance + */ + public static create(properties?: google.cloud.compute.v1.IDistributionPolicyZoneConfiguration): google.cloud.compute.v1.DistributionPolicyZoneConfiguration; + + /** + * Encodes the specified DistributionPolicyZoneConfiguration message. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicyZoneConfiguration.verify|verify} messages. + * @param message DistributionPolicyZoneConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDistributionPolicyZoneConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DistributionPolicyZoneConfiguration message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicyZoneConfiguration.verify|verify} messages. + * @param message DistributionPolicyZoneConfiguration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDistributionPolicyZoneConfiguration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DistributionPolicyZoneConfiguration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DistributionPolicyZoneConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DistributionPolicyZoneConfiguration; + + /** + * Decodes a DistributionPolicyZoneConfiguration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DistributionPolicyZoneConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DistributionPolicyZoneConfiguration; + + /** + * Verifies a DistributionPolicyZoneConfiguration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DistributionPolicyZoneConfiguration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DistributionPolicyZoneConfiguration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DistributionPolicyZoneConfiguration; + + /** + * Creates a plain object from a DistributionPolicyZoneConfiguration message. Also converts values to other types if specified. + * @param message DistributionPolicyZoneConfiguration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DistributionPolicyZoneConfiguration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DistributionPolicyZoneConfiguration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DistributionPolicy. */ + interface IDistributionPolicy { + + /** DistributionPolicy targetShape */ + targetShape?: (google.cloud.compute.v1.DistributionPolicy.TargetShape|keyof typeof google.cloud.compute.v1.DistributionPolicy.TargetShape|null); + + /** DistributionPolicy zones */ + zones?: (google.cloud.compute.v1.IDistributionPolicyZoneConfiguration[]|null); + } + + /** Represents a DistributionPolicy. */ + class DistributionPolicy implements IDistributionPolicy { + + /** + * Constructs a new DistributionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDistributionPolicy); + + /** DistributionPolicy targetShape. */ + public targetShape?: (google.cloud.compute.v1.DistributionPolicy.TargetShape|keyof typeof google.cloud.compute.v1.DistributionPolicy.TargetShape|null); + + /** DistributionPolicy zones. */ + public zones: google.cloud.compute.v1.IDistributionPolicyZoneConfiguration[]; + + /** DistributionPolicy _targetShape. */ + public _targetShape?: "targetShape"; + + /** + * Creates a new DistributionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DistributionPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IDistributionPolicy): google.cloud.compute.v1.DistributionPolicy; + + /** + * Encodes the specified DistributionPolicy message. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicy.verify|verify} messages. + * @param message DistributionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDistributionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DistributionPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicy.verify|verify} messages. + * @param message DistributionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDistributionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DistributionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DistributionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DistributionPolicy; + + /** + * Decodes a DistributionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DistributionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DistributionPolicy; + + /** + * Verifies a DistributionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DistributionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DistributionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DistributionPolicy; + + /** + * Creates a plain object from a DistributionPolicy message. Also converts values to other types if specified. + * @param message DistributionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DistributionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DistributionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DistributionPolicy { + + /** TargetShape enum. */ + enum TargetShape { + UNDEFINED_TARGET_SHAPE = 0, + ANY = 64972, + BALANCED = 468409608, + EVEN = 2140442 + } + } + + /** Properties of an ExchangedPeeringRoute. */ + interface IExchangedPeeringRoute { + + /** ExchangedPeeringRoute destRange */ + destRange?: (string|null); + + /** ExchangedPeeringRoute imported */ + imported?: (boolean|null); + + /** ExchangedPeeringRoute nextHopRegion */ + nextHopRegion?: (string|null); + + /** ExchangedPeeringRoute priority */ + priority?: (number|null); + + /** ExchangedPeeringRoute type */ + type?: (google.cloud.compute.v1.ExchangedPeeringRoute.Type|keyof typeof google.cloud.compute.v1.ExchangedPeeringRoute.Type|null); + } + + /** Represents an ExchangedPeeringRoute. */ + class ExchangedPeeringRoute implements IExchangedPeeringRoute { + + /** + * Constructs a new ExchangedPeeringRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IExchangedPeeringRoute); + + /** ExchangedPeeringRoute destRange. */ + public destRange?: (string|null); + + /** ExchangedPeeringRoute imported. */ + public imported?: (boolean|null); + + /** ExchangedPeeringRoute nextHopRegion. */ + public nextHopRegion?: (string|null); + + /** ExchangedPeeringRoute priority. */ + public priority?: (number|null); + + /** ExchangedPeeringRoute type. */ + public type?: (google.cloud.compute.v1.ExchangedPeeringRoute.Type|keyof typeof google.cloud.compute.v1.ExchangedPeeringRoute.Type|null); + + /** ExchangedPeeringRoute _destRange. */ + public _destRange?: "destRange"; + + /** ExchangedPeeringRoute _imported. */ + public _imported?: "imported"; + + /** ExchangedPeeringRoute _nextHopRegion. */ + public _nextHopRegion?: "nextHopRegion"; + + /** ExchangedPeeringRoute _priority. */ + public _priority?: "priority"; + + /** ExchangedPeeringRoute _type. */ + public _type?: "type"; + + /** + * Creates a new ExchangedPeeringRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns ExchangedPeeringRoute instance + */ + public static create(properties?: google.cloud.compute.v1.IExchangedPeeringRoute): google.cloud.compute.v1.ExchangedPeeringRoute; + + /** + * Encodes the specified ExchangedPeeringRoute message. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoute.verify|verify} messages. + * @param message ExchangedPeeringRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IExchangedPeeringRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExchangedPeeringRoute message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoute.verify|verify} messages. + * @param message ExchangedPeeringRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IExchangedPeeringRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExchangedPeeringRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExchangedPeeringRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ExchangedPeeringRoute; + + /** + * Decodes an ExchangedPeeringRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExchangedPeeringRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ExchangedPeeringRoute; + + /** + * Verifies an ExchangedPeeringRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExchangedPeeringRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExchangedPeeringRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ExchangedPeeringRoute; + + /** + * Creates a plain object from an ExchangedPeeringRoute message. Also converts values to other types if specified. + * @param message ExchangedPeeringRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ExchangedPeeringRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExchangedPeeringRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExchangedPeeringRoute { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + DYNAMIC_PEERING_ROUTE = 469794858, + STATIC_PEERING_ROUTE = 473407545, + SUBNET_PEERING_ROUTE = 465782504 + } + } + + /** Properties of an ExchangedPeeringRoutesList. */ + interface IExchangedPeeringRoutesList { + + /** ExchangedPeeringRoutesList id */ + id?: (string|null); + + /** ExchangedPeeringRoutesList items */ + items?: (google.cloud.compute.v1.IExchangedPeeringRoute[]|null); + + /** ExchangedPeeringRoutesList kind */ + kind?: (string|null); + + /** ExchangedPeeringRoutesList nextPageToken */ + nextPageToken?: (string|null); + + /** ExchangedPeeringRoutesList selfLink */ + selfLink?: (string|null); + + /** ExchangedPeeringRoutesList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an ExchangedPeeringRoutesList. */ + class ExchangedPeeringRoutesList implements IExchangedPeeringRoutesList { + + /** + * Constructs a new ExchangedPeeringRoutesList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IExchangedPeeringRoutesList); + + /** ExchangedPeeringRoutesList id. */ + public id?: (string|null); + + /** ExchangedPeeringRoutesList items. */ + public items: google.cloud.compute.v1.IExchangedPeeringRoute[]; + + /** ExchangedPeeringRoutesList kind. */ + public kind?: (string|null); + + /** ExchangedPeeringRoutesList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ExchangedPeeringRoutesList selfLink. */ + public selfLink?: (string|null); + + /** ExchangedPeeringRoutesList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ExchangedPeeringRoutesList _id. */ + public _id?: "id"; + + /** ExchangedPeeringRoutesList _kind. */ + public _kind?: "kind"; + + /** ExchangedPeeringRoutesList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ExchangedPeeringRoutesList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ExchangedPeeringRoutesList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ExchangedPeeringRoutesList instance using the specified properties. + * @param [properties] Properties to set + * @returns ExchangedPeeringRoutesList instance + */ + public static create(properties?: google.cloud.compute.v1.IExchangedPeeringRoutesList): google.cloud.compute.v1.ExchangedPeeringRoutesList; + + /** + * Encodes the specified ExchangedPeeringRoutesList message. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoutesList.verify|verify} messages. + * @param message ExchangedPeeringRoutesList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IExchangedPeeringRoutesList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExchangedPeeringRoutesList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoutesList.verify|verify} messages. + * @param message ExchangedPeeringRoutesList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IExchangedPeeringRoutesList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExchangedPeeringRoutesList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExchangedPeeringRoutesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ExchangedPeeringRoutesList; + + /** + * Decodes an ExchangedPeeringRoutesList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExchangedPeeringRoutesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ExchangedPeeringRoutesList; + + /** + * Verifies an ExchangedPeeringRoutesList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExchangedPeeringRoutesList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExchangedPeeringRoutesList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ExchangedPeeringRoutesList; + + /** + * Creates a plain object from an ExchangedPeeringRoutesList message. Also converts values to other types if specified. + * @param message ExchangedPeeringRoutesList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ExchangedPeeringRoutesList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExchangedPeeringRoutesList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExternalVpnGatewayInterface. */ + interface IExternalVpnGatewayInterface { + + /** ExternalVpnGatewayInterface id */ + id?: (number|null); + + /** ExternalVpnGatewayInterface ipAddress */ + ipAddress?: (string|null); + } + + /** Represents an ExternalVpnGatewayInterface. */ + class ExternalVpnGatewayInterface implements IExternalVpnGatewayInterface { + + /** + * Constructs a new ExternalVpnGatewayInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IExternalVpnGatewayInterface); + + /** ExternalVpnGatewayInterface id. */ + public id?: (number|null); + + /** ExternalVpnGatewayInterface ipAddress. */ + public ipAddress?: (string|null); + + /** ExternalVpnGatewayInterface _id. */ + public _id?: "id"; + + /** ExternalVpnGatewayInterface _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** + * Creates a new ExternalVpnGatewayInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalVpnGatewayInterface instance + */ + public static create(properties?: google.cloud.compute.v1.IExternalVpnGatewayInterface): google.cloud.compute.v1.ExternalVpnGatewayInterface; + + /** + * Encodes the specified ExternalVpnGatewayInterface message. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayInterface.verify|verify} messages. + * @param message ExternalVpnGatewayInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IExternalVpnGatewayInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalVpnGatewayInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayInterface.verify|verify} messages. + * @param message ExternalVpnGatewayInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IExternalVpnGatewayInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalVpnGatewayInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ExternalVpnGatewayInterface; + + /** + * Decodes an ExternalVpnGatewayInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ExternalVpnGatewayInterface; + + /** + * Verifies an ExternalVpnGatewayInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalVpnGatewayInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalVpnGatewayInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ExternalVpnGatewayInterface; + + /** + * Creates a plain object from an ExternalVpnGatewayInterface message. Also converts values to other types if specified. + * @param message ExternalVpnGatewayInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ExternalVpnGatewayInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalVpnGatewayInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExternalVpnGateway. */ + interface IExternalVpnGateway { + + /** ExternalVpnGateway creationTimestamp */ + creationTimestamp?: (string|null); + + /** ExternalVpnGateway description */ + description?: (string|null); + + /** ExternalVpnGateway id */ + id?: (number|Long|string|null); + + /** ExternalVpnGateway interfaces */ + interfaces?: (google.cloud.compute.v1.IExternalVpnGatewayInterface[]|null); + + /** ExternalVpnGateway kind */ + kind?: (string|null); + + /** ExternalVpnGateway labelFingerprint */ + labelFingerprint?: (string|null); + + /** ExternalVpnGateway labels */ + labels?: ({ [k: string]: string }|null); + + /** ExternalVpnGateway name */ + name?: (string|null); + + /** ExternalVpnGateway redundancyType */ + redundancyType?: (google.cloud.compute.v1.ExternalVpnGateway.RedundancyType|keyof typeof google.cloud.compute.v1.ExternalVpnGateway.RedundancyType|null); + + /** ExternalVpnGateway selfLink */ + selfLink?: (string|null); + } + + /** Represents an ExternalVpnGateway. */ + class ExternalVpnGateway implements IExternalVpnGateway { + + /** + * Constructs a new ExternalVpnGateway. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IExternalVpnGateway); + + /** ExternalVpnGateway creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** ExternalVpnGateway description. */ + public description?: (string|null); + + /** ExternalVpnGateway id. */ + public id?: (number|Long|string|null); + + /** ExternalVpnGateway interfaces. */ + public interfaces: google.cloud.compute.v1.IExternalVpnGatewayInterface[]; + + /** ExternalVpnGateway kind. */ + public kind?: (string|null); + + /** ExternalVpnGateway labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** ExternalVpnGateway labels. */ + public labels: { [k: string]: string }; + + /** ExternalVpnGateway name. */ + public name?: (string|null); + + /** ExternalVpnGateway redundancyType. */ + public redundancyType?: (google.cloud.compute.v1.ExternalVpnGateway.RedundancyType|keyof typeof google.cloud.compute.v1.ExternalVpnGateway.RedundancyType|null); + + /** ExternalVpnGateway selfLink. */ + public selfLink?: (string|null); + + /** ExternalVpnGateway _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** ExternalVpnGateway _description. */ + public _description?: "description"; + + /** ExternalVpnGateway _id. */ + public _id?: "id"; + + /** ExternalVpnGateway _kind. */ + public _kind?: "kind"; + + /** ExternalVpnGateway _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** ExternalVpnGateway _name. */ + public _name?: "name"; + + /** ExternalVpnGateway _redundancyType. */ + public _redundancyType?: "redundancyType"; + + /** ExternalVpnGateway _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new ExternalVpnGateway instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalVpnGateway instance + */ + public static create(properties?: google.cloud.compute.v1.IExternalVpnGateway): google.cloud.compute.v1.ExternalVpnGateway; + + /** + * Encodes the specified ExternalVpnGateway message. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGateway.verify|verify} messages. + * @param message ExternalVpnGateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IExternalVpnGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalVpnGateway message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGateway.verify|verify} messages. + * @param message ExternalVpnGateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IExternalVpnGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalVpnGateway message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ExternalVpnGateway; + + /** + * Decodes an ExternalVpnGateway message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ExternalVpnGateway; + + /** + * Verifies an ExternalVpnGateway message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalVpnGateway message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalVpnGateway + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ExternalVpnGateway; + + /** + * Creates a plain object from an ExternalVpnGateway message. Also converts values to other types if specified. + * @param message ExternalVpnGateway + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ExternalVpnGateway, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalVpnGateway to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ExternalVpnGateway { + + /** RedundancyType enum. */ + enum RedundancyType { + UNDEFINED_REDUNDANCY_TYPE = 0, + FOUR_IPS_REDUNDANCY = 520087913, + SINGLE_IP_INTERNALLY_REDUNDANT = 133914873, + TWO_IPS_REDUNDANCY = 367049635 + } + } + + /** Properties of an ExternalVpnGatewayList. */ + interface IExternalVpnGatewayList { + + /** ExternalVpnGatewayList etag */ + etag?: (string|null); + + /** ExternalVpnGatewayList id */ + id?: (string|null); + + /** ExternalVpnGatewayList items */ + items?: (google.cloud.compute.v1.IExternalVpnGateway[]|null); + + /** ExternalVpnGatewayList kind */ + kind?: (string|null); + + /** ExternalVpnGatewayList nextPageToken */ + nextPageToken?: (string|null); + + /** ExternalVpnGatewayList selfLink */ + selfLink?: (string|null); + + /** ExternalVpnGatewayList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an ExternalVpnGatewayList. */ + class ExternalVpnGatewayList implements IExternalVpnGatewayList { + + /** + * Constructs a new ExternalVpnGatewayList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IExternalVpnGatewayList); + + /** ExternalVpnGatewayList etag. */ + public etag?: (string|null); + + /** ExternalVpnGatewayList id. */ + public id?: (string|null); + + /** ExternalVpnGatewayList items. */ + public items: google.cloud.compute.v1.IExternalVpnGateway[]; + + /** ExternalVpnGatewayList kind. */ + public kind?: (string|null); + + /** ExternalVpnGatewayList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ExternalVpnGatewayList selfLink. */ + public selfLink?: (string|null); + + /** ExternalVpnGatewayList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ExternalVpnGatewayList _etag. */ + public _etag?: "etag"; + + /** ExternalVpnGatewayList _id. */ + public _id?: "id"; + + /** ExternalVpnGatewayList _kind. */ + public _kind?: "kind"; + + /** ExternalVpnGatewayList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ExternalVpnGatewayList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ExternalVpnGatewayList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ExternalVpnGatewayList instance using the specified properties. + * @param [properties] Properties to set + * @returns ExternalVpnGatewayList instance + */ + public static create(properties?: google.cloud.compute.v1.IExternalVpnGatewayList): google.cloud.compute.v1.ExternalVpnGatewayList; + + /** + * Encodes the specified ExternalVpnGatewayList message. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayList.verify|verify} messages. + * @param message ExternalVpnGatewayList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IExternalVpnGatewayList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExternalVpnGatewayList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayList.verify|verify} messages. + * @param message ExternalVpnGatewayList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IExternalVpnGatewayList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExternalVpnGatewayList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExternalVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ExternalVpnGatewayList; + + /** + * Decodes an ExternalVpnGatewayList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExternalVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ExternalVpnGatewayList; + + /** + * Verifies an ExternalVpnGatewayList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExternalVpnGatewayList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExternalVpnGatewayList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ExternalVpnGatewayList; + + /** + * Creates a plain object from an ExternalVpnGatewayList message. Also converts values to other types if specified. + * @param message ExternalVpnGatewayList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ExternalVpnGatewayList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExternalVpnGatewayList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileContentBuffer. */ + interface IFileContentBuffer { + + /** FileContentBuffer content */ + content?: (string|null); + + /** FileContentBuffer fileType */ + fileType?: (google.cloud.compute.v1.FileContentBuffer.FileType|keyof typeof google.cloud.compute.v1.FileContentBuffer.FileType|null); + } + + /** Represents a FileContentBuffer. */ + class FileContentBuffer implements IFileContentBuffer { + + /** + * Constructs a new FileContentBuffer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFileContentBuffer); + + /** FileContentBuffer content. */ + public content?: (string|null); + + /** FileContentBuffer fileType. */ + public fileType?: (google.cloud.compute.v1.FileContentBuffer.FileType|keyof typeof google.cloud.compute.v1.FileContentBuffer.FileType|null); + + /** FileContentBuffer _content. */ + public _content?: "content"; + + /** FileContentBuffer _fileType. */ + public _fileType?: "fileType"; + + /** + * Creates a new FileContentBuffer instance using the specified properties. + * @param [properties] Properties to set + * @returns FileContentBuffer instance + */ + public static create(properties?: google.cloud.compute.v1.IFileContentBuffer): google.cloud.compute.v1.FileContentBuffer; + + /** + * Encodes the specified FileContentBuffer message. Does not implicitly {@link google.cloud.compute.v1.FileContentBuffer.verify|verify} messages. + * @param message FileContentBuffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFileContentBuffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileContentBuffer message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FileContentBuffer.verify|verify} messages. + * @param message FileContentBuffer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFileContentBuffer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileContentBuffer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileContentBuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FileContentBuffer; + + /** + * Decodes a FileContentBuffer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileContentBuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FileContentBuffer; + + /** + * Verifies a FileContentBuffer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileContentBuffer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileContentBuffer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FileContentBuffer; + + /** + * Creates a plain object from a FileContentBuffer message. Also converts values to other types if specified. + * @param message FileContentBuffer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FileContentBuffer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileContentBuffer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileContentBuffer { + + /** FileType enum. */ + enum FileType { + UNDEFINED_FILE_TYPE = 0, + BIN = 65767, + UNDEFINED = 137851184, + X509 = 2674086 + } + } + + /** Properties of an Allowed. */ + interface IAllowed { + + /** Allowed IPProtocol */ + IPProtocol?: (string|null); + + /** Allowed ports */ + ports?: (string[]|null); + } + + /** Represents an Allowed. */ + class Allowed implements IAllowed { + + /** + * Constructs a new Allowed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAllowed); + + /** Allowed IPProtocol. */ + public IPProtocol?: (string|null); + + /** Allowed ports. */ + public ports: string[]; + + /** Allowed _IPProtocol. */ + public _IPProtocol?: "IPProtocol"; + + /** + * Creates a new Allowed instance using the specified properties. + * @param [properties] Properties to set + * @returns Allowed instance + */ + public static create(properties?: google.cloud.compute.v1.IAllowed): google.cloud.compute.v1.Allowed; + + /** + * Encodes the specified Allowed message. Does not implicitly {@link google.cloud.compute.v1.Allowed.verify|verify} messages. + * @param message Allowed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAllowed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Allowed message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Allowed.verify|verify} messages. + * @param message Allowed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAllowed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Allowed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Allowed; + + /** + * Decodes an Allowed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Allowed; + + /** + * Verifies an Allowed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Allowed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Allowed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Allowed; + + /** + * Creates a plain object from an Allowed message. Also converts values to other types if specified. + * @param message Allowed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Allowed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Allowed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Denied. */ + interface IDenied { + + /** Denied IPProtocol */ + IPProtocol?: (string|null); + + /** Denied ports */ + ports?: (string[]|null); + } + + /** Represents a Denied. */ + class Denied implements IDenied { + + /** + * Constructs a new Denied. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDenied); + + /** Denied IPProtocol. */ + public IPProtocol?: (string|null); + + /** Denied ports. */ + public ports: string[]; + + /** Denied _IPProtocol. */ + public _IPProtocol?: "IPProtocol"; + + /** + * Creates a new Denied instance using the specified properties. + * @param [properties] Properties to set + * @returns Denied instance + */ + public static create(properties?: google.cloud.compute.v1.IDenied): google.cloud.compute.v1.Denied; + + /** + * Encodes the specified Denied message. Does not implicitly {@link google.cloud.compute.v1.Denied.verify|verify} messages. + * @param message Denied message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDenied, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Denied message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Denied.verify|verify} messages. + * @param message Denied message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDenied, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Denied message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Denied; + + /** + * Decodes a Denied message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Denied; + + /** + * Verifies a Denied message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Denied message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Denied + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Denied; + + /** + * Creates a plain object from a Denied message. Also converts values to other types if specified. + * @param message Denied + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Denied, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Denied to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FirewallLogConfig. */ + interface IFirewallLogConfig { + + /** FirewallLogConfig enable */ + enable?: (boolean|null); + + /** FirewallLogConfig metadata */ + metadata?: (google.cloud.compute.v1.FirewallLogConfig.Metadata|keyof typeof google.cloud.compute.v1.FirewallLogConfig.Metadata|null); + } + + /** Represents a FirewallLogConfig. */ + class FirewallLogConfig implements IFirewallLogConfig { + + /** + * Constructs a new FirewallLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallLogConfig); + + /** FirewallLogConfig enable. */ + public enable?: (boolean|null); + + /** FirewallLogConfig metadata. */ + public metadata?: (google.cloud.compute.v1.FirewallLogConfig.Metadata|keyof typeof google.cloud.compute.v1.FirewallLogConfig.Metadata|null); + + /** FirewallLogConfig _enable. */ + public _enable?: "enable"; + + /** FirewallLogConfig _metadata. */ + public _metadata?: "metadata"; + + /** + * Creates a new FirewallLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallLogConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallLogConfig): google.cloud.compute.v1.FirewallLogConfig; + + /** + * Encodes the specified FirewallLogConfig message. Does not implicitly {@link google.cloud.compute.v1.FirewallLogConfig.verify|verify} messages. + * @param message FirewallLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallLogConfig.verify|verify} messages. + * @param message FirewallLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallLogConfig; + + /** + * Decodes a FirewallLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallLogConfig; + + /** + * Verifies a FirewallLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallLogConfig; + + /** + * Creates a plain object from a FirewallLogConfig message. Also converts values to other types if specified. + * @param message FirewallLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FirewallLogConfig { + + /** Metadata enum. */ + enum Metadata { + UNDEFINED_METADATA = 0, + EXCLUDE_ALL_METADATA = 334519954, + INCLUDE_ALL_METADATA = 164619908 + } + } + + /** Properties of a Firewall. */ + interface IFirewall { + + /** Firewall allowed */ + allowed?: (google.cloud.compute.v1.IAllowed[]|null); + + /** Firewall creationTimestamp */ + creationTimestamp?: (string|null); + + /** Firewall denied */ + denied?: (google.cloud.compute.v1.IDenied[]|null); + + /** Firewall description */ + description?: (string|null); + + /** Firewall destinationRanges */ + destinationRanges?: (string[]|null); + + /** Firewall direction */ + direction?: (google.cloud.compute.v1.Firewall.Direction|keyof typeof google.cloud.compute.v1.Firewall.Direction|null); + + /** Firewall disabled */ + disabled?: (boolean|null); + + /** Firewall id */ + id?: (number|Long|string|null); + + /** Firewall kind */ + kind?: (string|null); + + /** Firewall logConfig */ + logConfig?: (google.cloud.compute.v1.IFirewallLogConfig|null); + + /** Firewall name */ + name?: (string|null); + + /** Firewall network */ + network?: (string|null); + + /** Firewall priority */ + priority?: (number|null); + + /** Firewall selfLink */ + selfLink?: (string|null); + + /** Firewall sourceRanges */ + sourceRanges?: (string[]|null); + + /** Firewall sourceServiceAccounts */ + sourceServiceAccounts?: (string[]|null); + + /** Firewall sourceTags */ + sourceTags?: (string[]|null); + + /** Firewall targetServiceAccounts */ + targetServiceAccounts?: (string[]|null); + + /** Firewall targetTags */ + targetTags?: (string[]|null); + } + + /** Represents a Firewall. */ + class Firewall implements IFirewall { + + /** + * Constructs a new Firewall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewall); + + /** Firewall allowed. */ + public allowed: google.cloud.compute.v1.IAllowed[]; + + /** Firewall creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Firewall denied. */ + public denied: google.cloud.compute.v1.IDenied[]; + + /** Firewall description. */ + public description?: (string|null); + + /** Firewall destinationRanges. */ + public destinationRanges: string[]; + + /** Firewall direction. */ + public direction?: (google.cloud.compute.v1.Firewall.Direction|keyof typeof google.cloud.compute.v1.Firewall.Direction|null); + + /** Firewall disabled. */ + public disabled?: (boolean|null); + + /** Firewall id. */ + public id?: (number|Long|string|null); + + /** Firewall kind. */ + public kind?: (string|null); + + /** Firewall logConfig. */ + public logConfig?: (google.cloud.compute.v1.IFirewallLogConfig|null); + + /** Firewall name. */ + public name?: (string|null); + + /** Firewall network. */ + public network?: (string|null); + + /** Firewall priority. */ + public priority?: (number|null); + + /** Firewall selfLink. */ + public selfLink?: (string|null); + + /** Firewall sourceRanges. */ + public sourceRanges: string[]; + + /** Firewall sourceServiceAccounts. */ + public sourceServiceAccounts: string[]; + + /** Firewall sourceTags. */ + public sourceTags: string[]; + + /** Firewall targetServiceAccounts. */ + public targetServiceAccounts: string[]; + + /** Firewall targetTags. */ + public targetTags: string[]; + + /** Firewall _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Firewall _description. */ + public _description?: "description"; + + /** Firewall _direction. */ + public _direction?: "direction"; + + /** Firewall _disabled. */ + public _disabled?: "disabled"; + + /** Firewall _id. */ + public _id?: "id"; + + /** Firewall _kind. */ + public _kind?: "kind"; + + /** Firewall _logConfig. */ + public _logConfig?: "logConfig"; + + /** Firewall _name. */ + public _name?: "name"; + + /** Firewall _network. */ + public _network?: "network"; + + /** Firewall _priority. */ + public _priority?: "priority"; + + /** Firewall _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new Firewall instance using the specified properties. + * @param [properties] Properties to set + * @returns Firewall instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewall): google.cloud.compute.v1.Firewall; + + /** + * Encodes the specified Firewall message. Does not implicitly {@link google.cloud.compute.v1.Firewall.verify|verify} messages. + * @param message Firewall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Firewall message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Firewall.verify|verify} messages. + * @param message Firewall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Firewall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Firewall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Firewall; + + /** + * Decodes a Firewall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Firewall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Firewall; + + /** + * Verifies a Firewall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Firewall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Firewall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Firewall; + + /** + * Creates a plain object from a Firewall message. Also converts values to other types if specified. + * @param message Firewall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Firewall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Firewall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Firewall { + + /** Direction enum. */ + enum Direction { + UNDEFINED_DIRECTION = 0, + EGRESS = 432880501, + INGRESS = 516931221 + } + } + + /** Properties of a FirewallList. */ + interface IFirewallList { + + /** FirewallList id */ + id?: (string|null); + + /** FirewallList items */ + items?: (google.cloud.compute.v1.IFirewall[]|null); + + /** FirewallList kind */ + kind?: (string|null); + + /** FirewallList nextPageToken */ + nextPageToken?: (string|null); + + /** FirewallList selfLink */ + selfLink?: (string|null); + + /** FirewallList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a FirewallList. */ + class FirewallList implements IFirewallList { + + /** + * Constructs a new FirewallList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallList); + + /** FirewallList id. */ + public id?: (string|null); + + /** FirewallList items. */ + public items: google.cloud.compute.v1.IFirewall[]; + + /** FirewallList kind. */ + public kind?: (string|null); + + /** FirewallList nextPageToken. */ + public nextPageToken?: (string|null); + + /** FirewallList selfLink. */ + public selfLink?: (string|null); + + /** FirewallList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** FirewallList _id. */ + public _id?: "id"; + + /** FirewallList _kind. */ + public _kind?: "kind"; + + /** FirewallList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** FirewallList _selfLink. */ + public _selfLink?: "selfLink"; + + /** FirewallList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new FirewallList instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallList instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallList): google.cloud.compute.v1.FirewallList; + + /** + * Encodes the specified FirewallList message. Does not implicitly {@link google.cloud.compute.v1.FirewallList.verify|verify} messages. + * @param message FirewallList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallList.verify|verify} messages. + * @param message FirewallList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallList; + + /** + * Decodes a FirewallList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallList; + + /** + * Verifies a FirewallList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallList; + + /** + * Creates a plain object from a FirewallList message. Also converts values to other types if specified. + * @param message FirewallList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FirewallPolicyAssociation. */ + interface IFirewallPolicyAssociation { + + /** FirewallPolicyAssociation attachmentTarget */ + attachmentTarget?: (string|null); + + /** FirewallPolicyAssociation displayName */ + displayName?: (string|null); + + /** FirewallPolicyAssociation firewallPolicyId */ + firewallPolicyId?: (string|null); + + /** FirewallPolicyAssociation name */ + name?: (string|null); + + /** FirewallPolicyAssociation shortName */ + shortName?: (string|null); + } + + /** Represents a FirewallPolicyAssociation. */ + class FirewallPolicyAssociation implements IFirewallPolicyAssociation { + + /** + * Constructs a new FirewallPolicyAssociation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPolicyAssociation); + + /** FirewallPolicyAssociation attachmentTarget. */ + public attachmentTarget?: (string|null); + + /** FirewallPolicyAssociation displayName. */ + public displayName?: (string|null); + + /** FirewallPolicyAssociation firewallPolicyId. */ + public firewallPolicyId?: (string|null); + + /** FirewallPolicyAssociation name. */ + public name?: (string|null); + + /** FirewallPolicyAssociation shortName. */ + public shortName?: (string|null); + + /** FirewallPolicyAssociation _attachmentTarget. */ + public _attachmentTarget?: "attachmentTarget"; + + /** FirewallPolicyAssociation _displayName. */ + public _displayName?: "displayName"; + + /** FirewallPolicyAssociation _firewallPolicyId. */ + public _firewallPolicyId?: "firewallPolicyId"; + + /** FirewallPolicyAssociation _name. */ + public _name?: "name"; + + /** FirewallPolicyAssociation _shortName. */ + public _shortName?: "shortName"; + + /** + * Creates a new FirewallPolicyAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPolicyAssociation instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPolicyAssociation): google.cloud.compute.v1.FirewallPolicyAssociation; + + /** + * Encodes the specified FirewallPolicyAssociation message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyAssociation.verify|verify} messages. + * @param message FirewallPolicyAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPolicyAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPolicyAssociation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyAssociation.verify|verify} messages. + * @param message FirewallPolicyAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPolicyAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPolicyAssociation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPolicyAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPolicyAssociation; + + /** + * Decodes a FirewallPolicyAssociation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPolicyAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPolicyAssociation; + + /** + * Verifies a FirewallPolicyAssociation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPolicyAssociation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPolicyAssociation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPolicyAssociation; + + /** + * Creates a plain object from a FirewallPolicyAssociation message. Also converts values to other types if specified. + * @param message FirewallPolicyAssociation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPolicyAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPolicyAssociation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FirewallPoliciesListAssociationsResponse. */ + interface IFirewallPoliciesListAssociationsResponse { + + /** FirewallPoliciesListAssociationsResponse associations */ + associations?: (google.cloud.compute.v1.IFirewallPolicyAssociation[]|null); + + /** FirewallPoliciesListAssociationsResponse kind */ + kind?: (string|null); + } + + /** Represents a FirewallPoliciesListAssociationsResponse. */ + class FirewallPoliciesListAssociationsResponse implements IFirewallPoliciesListAssociationsResponse { + + /** + * Constructs a new FirewallPoliciesListAssociationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse); + + /** FirewallPoliciesListAssociationsResponse associations. */ + public associations: google.cloud.compute.v1.IFirewallPolicyAssociation[]; + + /** FirewallPoliciesListAssociationsResponse kind. */ + public kind?: (string|null); + + /** FirewallPoliciesListAssociationsResponse _kind. */ + public _kind?: "kind"; + + /** + * Creates a new FirewallPoliciesListAssociationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPoliciesListAssociationsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse): google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse; + + /** + * Encodes the specified FirewallPoliciesListAssociationsResponse message. Does not implicitly {@link google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse.verify|verify} messages. + * @param message FirewallPoliciesListAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPoliciesListAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse.verify|verify} messages. + * @param message FirewallPoliciesListAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPoliciesListAssociationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPoliciesListAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse; + + /** + * Decodes a FirewallPoliciesListAssociationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPoliciesListAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse; + + /** + * Verifies a FirewallPoliciesListAssociationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPoliciesListAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPoliciesListAssociationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse; + + /** + * Creates a plain object from a FirewallPoliciesListAssociationsResponse message. Also converts values to other types if specified. + * @param message FirewallPoliciesListAssociationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPoliciesListAssociationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FirewallPolicyRule. */ + interface IFirewallPolicyRule { + + /** FirewallPolicyRule action */ + action?: (string|null); + + /** FirewallPolicyRule description */ + description?: (string|null); + + /** FirewallPolicyRule direction */ + direction?: (google.cloud.compute.v1.FirewallPolicyRule.Direction|keyof typeof google.cloud.compute.v1.FirewallPolicyRule.Direction|null); + + /** FirewallPolicyRule disabled */ + disabled?: (boolean|null); + + /** FirewallPolicyRule enableLogging */ + enableLogging?: (boolean|null); + + /** FirewallPolicyRule kind */ + kind?: (string|null); + + /** FirewallPolicyRule match */ + match?: (google.cloud.compute.v1.IFirewallPolicyRuleMatcher|null); + + /** FirewallPolicyRule priority */ + priority?: (number|null); + + /** FirewallPolicyRule ruleTupleCount */ + ruleTupleCount?: (number|null); + + /** FirewallPolicyRule targetResources */ + targetResources?: (string[]|null); + + /** FirewallPolicyRule targetServiceAccounts */ + targetServiceAccounts?: (string[]|null); + } + + /** Represents a FirewallPolicyRule. */ + class FirewallPolicyRule implements IFirewallPolicyRule { + + /** + * Constructs a new FirewallPolicyRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPolicyRule); + + /** FirewallPolicyRule action. */ + public action?: (string|null); + + /** FirewallPolicyRule description. */ + public description?: (string|null); + + /** FirewallPolicyRule direction. */ + public direction?: (google.cloud.compute.v1.FirewallPolicyRule.Direction|keyof typeof google.cloud.compute.v1.FirewallPolicyRule.Direction|null); + + /** FirewallPolicyRule disabled. */ + public disabled?: (boolean|null); + + /** FirewallPolicyRule enableLogging. */ + public enableLogging?: (boolean|null); + + /** FirewallPolicyRule kind. */ + public kind?: (string|null); + + /** FirewallPolicyRule match. */ + public match?: (google.cloud.compute.v1.IFirewallPolicyRuleMatcher|null); + + /** FirewallPolicyRule priority. */ + public priority?: (number|null); + + /** FirewallPolicyRule ruleTupleCount. */ + public ruleTupleCount?: (number|null); + + /** FirewallPolicyRule targetResources. */ + public targetResources: string[]; + + /** FirewallPolicyRule targetServiceAccounts. */ + public targetServiceAccounts: string[]; + + /** FirewallPolicyRule _action. */ + public _action?: "action"; + + /** FirewallPolicyRule _description. */ + public _description?: "description"; + + /** FirewallPolicyRule _direction. */ + public _direction?: "direction"; + + /** FirewallPolicyRule _disabled. */ + public _disabled?: "disabled"; + + /** FirewallPolicyRule _enableLogging. */ + public _enableLogging?: "enableLogging"; + + /** FirewallPolicyRule _kind. */ + public _kind?: "kind"; + + /** FirewallPolicyRule _match. */ + public _match?: "match"; + + /** FirewallPolicyRule _priority. */ + public _priority?: "priority"; + + /** FirewallPolicyRule _ruleTupleCount. */ + public _ruleTupleCount?: "ruleTupleCount"; + + /** + * Creates a new FirewallPolicyRule instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPolicyRule instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPolicyRule): google.cloud.compute.v1.FirewallPolicyRule; + + /** + * Encodes the specified FirewallPolicyRule message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRule.verify|verify} messages. + * @param message FirewallPolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPolicyRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRule.verify|verify} messages. + * @param message FirewallPolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPolicyRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPolicyRule; + + /** + * Decodes a FirewallPolicyRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPolicyRule; + + /** + * Verifies a FirewallPolicyRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPolicyRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPolicyRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPolicyRule; + + /** + * Creates a plain object from a FirewallPolicyRule message. Also converts values to other types if specified. + * @param message FirewallPolicyRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPolicyRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPolicyRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FirewallPolicyRule { + + /** Direction enum. */ + enum Direction { + UNDEFINED_DIRECTION = 0, + EGRESS = 432880501, + INGRESS = 516931221 + } + } + + /** Properties of a FirewallPolicy. */ + interface IFirewallPolicy { + + /** FirewallPolicy associations */ + associations?: (google.cloud.compute.v1.IFirewallPolicyAssociation[]|null); + + /** FirewallPolicy creationTimestamp */ + creationTimestamp?: (string|null); + + /** FirewallPolicy description */ + description?: (string|null); + + /** FirewallPolicy displayName */ + displayName?: (string|null); + + /** FirewallPolicy fingerprint */ + fingerprint?: (string|null); + + /** FirewallPolicy id */ + id?: (number|Long|string|null); + + /** FirewallPolicy kind */ + kind?: (string|null); + + /** FirewallPolicy name */ + name?: (string|null); + + /** FirewallPolicy parent */ + parent?: (string|null); + + /** FirewallPolicy ruleTupleCount */ + ruleTupleCount?: (number|null); + + /** FirewallPolicy rules */ + rules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); + + /** FirewallPolicy selfLink */ + selfLink?: (string|null); + + /** FirewallPolicy selfLinkWithId */ + selfLinkWithId?: (string|null); + + /** FirewallPolicy shortName */ + shortName?: (string|null); + } + + /** Represents a FirewallPolicy. */ + class FirewallPolicy implements IFirewallPolicy { + + /** + * Constructs a new FirewallPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPolicy); + + /** FirewallPolicy associations. */ + public associations: google.cloud.compute.v1.IFirewallPolicyAssociation[]; + + /** FirewallPolicy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** FirewallPolicy description. */ + public description?: (string|null); + + /** FirewallPolicy displayName. */ + public displayName?: (string|null); + + /** FirewallPolicy fingerprint. */ + public fingerprint?: (string|null); + + /** FirewallPolicy id. */ + public id?: (number|Long|string|null); + + /** FirewallPolicy kind. */ + public kind?: (string|null); + + /** FirewallPolicy name. */ + public name?: (string|null); + + /** FirewallPolicy parent. */ + public parent?: (string|null); + + /** FirewallPolicy ruleTupleCount. */ + public ruleTupleCount?: (number|null); + + /** FirewallPolicy rules. */ + public rules: google.cloud.compute.v1.IFirewallPolicyRule[]; + + /** FirewallPolicy selfLink. */ + public selfLink?: (string|null); + + /** FirewallPolicy selfLinkWithId. */ + public selfLinkWithId?: (string|null); + + /** FirewallPolicy shortName. */ + public shortName?: (string|null); + + /** FirewallPolicy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** FirewallPolicy _description. */ + public _description?: "description"; + + /** FirewallPolicy _displayName. */ + public _displayName?: "displayName"; + + /** FirewallPolicy _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** FirewallPolicy _id. */ + public _id?: "id"; + + /** FirewallPolicy _kind. */ + public _kind?: "kind"; + + /** FirewallPolicy _name. */ + public _name?: "name"; + + /** FirewallPolicy _parent. */ + public _parent?: "parent"; + + /** FirewallPolicy _ruleTupleCount. */ + public _ruleTupleCount?: "ruleTupleCount"; + + /** FirewallPolicy _selfLink. */ + public _selfLink?: "selfLink"; + + /** FirewallPolicy _selfLinkWithId. */ + public _selfLinkWithId?: "selfLinkWithId"; + + /** FirewallPolicy _shortName. */ + public _shortName?: "shortName"; + + /** + * Creates a new FirewallPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPolicy): google.cloud.compute.v1.FirewallPolicy; + + /** + * Encodes the specified FirewallPolicy message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicy.verify|verify} messages. + * @param message FirewallPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicy.verify|verify} messages. + * @param message FirewallPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPolicy; + + /** + * Decodes a FirewallPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPolicy; + + /** + * Verifies a FirewallPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPolicy; + + /** + * Creates a plain object from a FirewallPolicy message. Also converts values to other types if specified. + * @param message FirewallPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FirewallPolicyList. */ + interface IFirewallPolicyList { + + /** FirewallPolicyList id */ + id?: (string|null); + + /** FirewallPolicyList items */ + items?: (google.cloud.compute.v1.IFirewallPolicy[]|null); + + /** FirewallPolicyList kind */ + kind?: (string|null); + + /** FirewallPolicyList nextPageToken */ + nextPageToken?: (string|null); + + /** FirewallPolicyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a FirewallPolicyList. */ + class FirewallPolicyList implements IFirewallPolicyList { + + /** + * Constructs a new FirewallPolicyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPolicyList); + + /** FirewallPolicyList id. */ + public id?: (string|null); + + /** FirewallPolicyList items. */ + public items: google.cloud.compute.v1.IFirewallPolicy[]; + + /** FirewallPolicyList kind. */ + public kind?: (string|null); + + /** FirewallPolicyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** FirewallPolicyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** FirewallPolicyList _id. */ + public _id?: "id"; + + /** FirewallPolicyList _kind. */ + public _kind?: "kind"; + + /** FirewallPolicyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** FirewallPolicyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new FirewallPolicyList instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPolicyList instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPolicyList): google.cloud.compute.v1.FirewallPolicyList; + + /** + * Encodes the specified FirewallPolicyList message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyList.verify|verify} messages. + * @param message FirewallPolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPolicyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyList.verify|verify} messages. + * @param message FirewallPolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPolicyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPolicyList; + + /** + * Decodes a FirewallPolicyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPolicyList; + + /** + * Verifies a FirewallPolicyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPolicyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPolicyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPolicyList; + + /** + * Creates a plain object from a FirewallPolicyList message. Also converts values to other types if specified. + * @param message FirewallPolicyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPolicyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPolicyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FirewallPolicyRuleMatcher. */ + interface IFirewallPolicyRuleMatcher { + + /** FirewallPolicyRuleMatcher destIpRanges */ + destIpRanges?: (string[]|null); + + /** FirewallPolicyRuleMatcher layer4Configs */ + layer4Configs?: (google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config[]|null); + + /** FirewallPolicyRuleMatcher srcIpRanges */ + srcIpRanges?: (string[]|null); + } + + /** Represents a FirewallPolicyRuleMatcher. */ + class FirewallPolicyRuleMatcher implements IFirewallPolicyRuleMatcher { + + /** + * Constructs a new FirewallPolicyRuleMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPolicyRuleMatcher); + + /** FirewallPolicyRuleMatcher destIpRanges. */ + public destIpRanges: string[]; + + /** FirewallPolicyRuleMatcher layer4Configs. */ + public layer4Configs: google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config[]; + + /** FirewallPolicyRuleMatcher srcIpRanges. */ + public srcIpRanges: string[]; + + /** + * Creates a new FirewallPolicyRuleMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPolicyRuleMatcher instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPolicyRuleMatcher): google.cloud.compute.v1.FirewallPolicyRuleMatcher; + + /** + * Encodes the specified FirewallPolicyRuleMatcher message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcher.verify|verify} messages. + * @param message FirewallPolicyRuleMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPolicyRuleMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPolicyRuleMatcher message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcher.verify|verify} messages. + * @param message FirewallPolicyRuleMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPolicyRuleMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPolicyRuleMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPolicyRuleMatcher; + + /** + * Decodes a FirewallPolicyRuleMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPolicyRuleMatcher; + + /** + * Verifies a FirewallPolicyRuleMatcher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPolicyRuleMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPolicyRuleMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPolicyRuleMatcher; + + /** + * Creates a plain object from a FirewallPolicyRuleMatcher message. Also converts values to other types if specified. + * @param message FirewallPolicyRuleMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPolicyRuleMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPolicyRuleMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FirewallPolicyRuleMatcherLayer4Config. */ + interface IFirewallPolicyRuleMatcherLayer4Config { + + /** FirewallPolicyRuleMatcherLayer4Config ipProtocol */ + ipProtocol?: (string|null); + + /** FirewallPolicyRuleMatcherLayer4Config ports */ + ports?: (string[]|null); + } + + /** Represents a FirewallPolicyRuleMatcherLayer4Config. */ + class FirewallPolicyRuleMatcherLayer4Config implements IFirewallPolicyRuleMatcherLayer4Config { + + /** + * Constructs a new FirewallPolicyRuleMatcherLayer4Config. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config); + + /** FirewallPolicyRuleMatcherLayer4Config ipProtocol. */ + public ipProtocol?: (string|null); + + /** FirewallPolicyRuleMatcherLayer4Config ports. */ + public ports: string[]; + + /** FirewallPolicyRuleMatcherLayer4Config _ipProtocol. */ + public _ipProtocol?: "ipProtocol"; + + /** + * Creates a new FirewallPolicyRuleMatcherLayer4Config instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPolicyRuleMatcherLayer4Config instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config): google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config; + + /** + * Encodes the specified FirewallPolicyRuleMatcherLayer4Config message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.verify|verify} messages. + * @param message FirewallPolicyRuleMatcherLayer4Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPolicyRuleMatcherLayer4Config message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.verify|verify} messages. + * @param message FirewallPolicyRuleMatcherLayer4Config message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPolicyRuleMatcherLayer4Config message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPolicyRuleMatcherLayer4Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config; + + /** + * Decodes a FirewallPolicyRuleMatcherLayer4Config message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPolicyRuleMatcherLayer4Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config; + + /** + * Verifies a FirewallPolicyRuleMatcherLayer4Config message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPolicyRuleMatcherLayer4Config message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPolicyRuleMatcherLayer4Config + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config; + + /** + * Creates a plain object from a FirewallPolicyRuleMatcherLayer4Config message. Also converts values to other types if specified. + * @param message FirewallPolicyRuleMatcherLayer4Config + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPolicyRuleMatcherLayer4Config to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MetadataFilter. */ + interface IMetadataFilter { + + /** MetadataFilter filterLabels */ + filterLabels?: (google.cloud.compute.v1.IMetadataFilterLabelMatch[]|null); + + /** MetadataFilter filterMatchCriteria */ + filterMatchCriteria?: (google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria|keyof typeof google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria|null); + } + + /** Represents a MetadataFilter. */ + class MetadataFilter implements IMetadataFilter { + + /** + * Constructs a new MetadataFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMetadataFilter); + + /** MetadataFilter filterLabels. */ + public filterLabels: google.cloud.compute.v1.IMetadataFilterLabelMatch[]; + + /** MetadataFilter filterMatchCriteria. */ + public filterMatchCriteria?: (google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria|keyof typeof google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria|null); + + /** MetadataFilter _filterMatchCriteria. */ + public _filterMatchCriteria?: "filterMatchCriteria"; + + /** + * Creates a new MetadataFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataFilter instance + */ + public static create(properties?: google.cloud.compute.v1.IMetadataFilter): google.cloud.compute.v1.MetadataFilter; + + /** + * Encodes the specified MetadataFilter message. Does not implicitly {@link google.cloud.compute.v1.MetadataFilter.verify|verify} messages. + * @param message MetadataFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMetadataFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataFilter message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MetadataFilter.verify|verify} messages. + * @param message MetadataFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMetadataFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MetadataFilter; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MetadataFilter; + + /** + * Verifies a MetadataFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MetadataFilter; + + /** + * Creates a plain object from a MetadataFilter message. Also converts values to other types if specified. + * @param message MetadataFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MetadataFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MetadataFilter { + + /** FilterMatchCriteria enum. */ + enum FilterMatchCriteria { + UNDEFINED_FILTER_MATCH_CRITERIA = 0, + MATCH_ALL = 180663271, + MATCH_ANY = 180663346, + NOT_SET = 163646646 + } + } + + /** Properties of a ForwardingRuleServiceDirectoryRegistration. */ + interface IForwardingRuleServiceDirectoryRegistration { + + /** ForwardingRuleServiceDirectoryRegistration namespace */ + namespace?: (string|null); + + /** ForwardingRuleServiceDirectoryRegistration service */ + service?: (string|null); + + /** ForwardingRuleServiceDirectoryRegistration serviceDirectoryRegion */ + serviceDirectoryRegion?: (string|null); + } + + /** Represents a ForwardingRuleServiceDirectoryRegistration. */ + class ForwardingRuleServiceDirectoryRegistration implements IForwardingRuleServiceDirectoryRegistration { + + /** + * Constructs a new ForwardingRuleServiceDirectoryRegistration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration); + + /** ForwardingRuleServiceDirectoryRegistration namespace. */ + public namespace?: (string|null); + + /** ForwardingRuleServiceDirectoryRegistration service. */ + public service?: (string|null); + + /** ForwardingRuleServiceDirectoryRegistration serviceDirectoryRegion. */ + public serviceDirectoryRegion?: (string|null); + + /** ForwardingRuleServiceDirectoryRegistration _namespace. */ + public _namespace?: "namespace"; + + /** ForwardingRuleServiceDirectoryRegistration _service. */ + public _service?: "service"; + + /** ForwardingRuleServiceDirectoryRegistration _serviceDirectoryRegion. */ + public _serviceDirectoryRegion?: "serviceDirectoryRegion"; + + /** + * Creates a new ForwardingRuleServiceDirectoryRegistration instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardingRuleServiceDirectoryRegistration instance + */ + public static create(properties?: google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration): google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration; + + /** + * Encodes the specified ForwardingRuleServiceDirectoryRegistration message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.verify|verify} messages. + * @param message ForwardingRuleServiceDirectoryRegistration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForwardingRuleServiceDirectoryRegistration message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.verify|verify} messages. + * @param message ForwardingRuleServiceDirectoryRegistration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForwardingRuleServiceDirectoryRegistration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardingRuleServiceDirectoryRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration; + + /** + * Decodes a ForwardingRuleServiceDirectoryRegistration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardingRuleServiceDirectoryRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration; + + /** + * Verifies a ForwardingRuleServiceDirectoryRegistration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForwardingRuleServiceDirectoryRegistration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardingRuleServiceDirectoryRegistration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration; + + /** + * Creates a plain object from a ForwardingRuleServiceDirectoryRegistration message. Also converts values to other types if specified. + * @param message ForwardingRuleServiceDirectoryRegistration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForwardingRuleServiceDirectoryRegistration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ForwardingRule. */ + interface IForwardingRule { + + /** ForwardingRule IPAddress */ + IPAddress?: (string|null); + + /** ForwardingRule IPProtocol */ + IPProtocol?: (google.cloud.compute.v1.ForwardingRule.IPProtocol_|keyof typeof google.cloud.compute.v1.ForwardingRule.IPProtocol_|null); + + /** ForwardingRule allPorts */ + allPorts?: (boolean|null); + + /** ForwardingRule allowGlobalAccess */ + allowGlobalAccess?: (boolean|null); + + /** ForwardingRule backendService */ + backendService?: (string|null); + + /** ForwardingRule creationTimestamp */ + creationTimestamp?: (string|null); + + /** ForwardingRule description */ + description?: (string|null); + + /** ForwardingRule fingerprint */ + fingerprint?: (string|null); + + /** ForwardingRule id */ + id?: (number|Long|string|null); + + /** ForwardingRule ipVersion */ + ipVersion?: (google.cloud.compute.v1.ForwardingRule.IpVersion|keyof typeof google.cloud.compute.v1.ForwardingRule.IpVersion|null); + + /** ForwardingRule isMirroringCollector */ + isMirroringCollector?: (boolean|null); + + /** ForwardingRule kind */ + kind?: (string|null); + + /** ForwardingRule labelFingerprint */ + labelFingerprint?: (string|null); + + /** ForwardingRule labels */ + labels?: ({ [k: string]: string }|null); + + /** ForwardingRule loadBalancingScheme */ + loadBalancingScheme?: (google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme|keyof typeof google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme|null); + + /** ForwardingRule metadataFilters */ + metadataFilters?: (google.cloud.compute.v1.IMetadataFilter[]|null); + + /** ForwardingRule name */ + name?: (string|null); + + /** ForwardingRule network */ + network?: (string|null); + + /** ForwardingRule networkTier */ + networkTier?: (google.cloud.compute.v1.ForwardingRule.NetworkTier|keyof typeof google.cloud.compute.v1.ForwardingRule.NetworkTier|null); + + /** ForwardingRule portRange */ + portRange?: (string|null); + + /** ForwardingRule ports */ + ports?: (string[]|null); + + /** ForwardingRule pscConnectionId */ + pscConnectionId?: (number|Long|string|null); + + /** ForwardingRule region */ + region?: (string|null); + + /** ForwardingRule selfLink */ + selfLink?: (string|null); + + /** ForwardingRule serviceDirectoryRegistrations */ + serviceDirectoryRegistrations?: (google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration[]|null); + + /** ForwardingRule serviceLabel */ + serviceLabel?: (string|null); + + /** ForwardingRule serviceName */ + serviceName?: (string|null); + + /** ForwardingRule subnetwork */ + subnetwork?: (string|null); + + /** ForwardingRule target */ + target?: (string|null); + } + + /** Represents a ForwardingRule. */ + class ForwardingRule implements IForwardingRule { + + /** + * Constructs a new ForwardingRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IForwardingRule); + + /** ForwardingRule IPAddress. */ + public IPAddress?: (string|null); + + /** ForwardingRule IPProtocol. */ + public IPProtocol?: (google.cloud.compute.v1.ForwardingRule.IPProtocol_|keyof typeof google.cloud.compute.v1.ForwardingRule.IPProtocol_|null); + + /** ForwardingRule allPorts. */ + public allPorts?: (boolean|null); + + /** ForwardingRule allowGlobalAccess. */ + public allowGlobalAccess?: (boolean|null); + + /** ForwardingRule backendService. */ + public backendService?: (string|null); + + /** ForwardingRule creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** ForwardingRule description. */ + public description?: (string|null); + + /** ForwardingRule fingerprint. */ + public fingerprint?: (string|null); + + /** ForwardingRule id. */ + public id?: (number|Long|string|null); + + /** ForwardingRule ipVersion. */ + public ipVersion?: (google.cloud.compute.v1.ForwardingRule.IpVersion|keyof typeof google.cloud.compute.v1.ForwardingRule.IpVersion|null); + + /** ForwardingRule isMirroringCollector. */ + public isMirroringCollector?: (boolean|null); + + /** ForwardingRule kind. */ + public kind?: (string|null); + + /** ForwardingRule labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** ForwardingRule labels. */ + public labels: { [k: string]: string }; + + /** ForwardingRule loadBalancingScheme. */ + public loadBalancingScheme?: (google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme|keyof typeof google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme|null); + + /** ForwardingRule metadataFilters. */ + public metadataFilters: google.cloud.compute.v1.IMetadataFilter[]; + + /** ForwardingRule name. */ + public name?: (string|null); + + /** ForwardingRule network. */ + public network?: (string|null); + + /** ForwardingRule networkTier. */ + public networkTier?: (google.cloud.compute.v1.ForwardingRule.NetworkTier|keyof typeof google.cloud.compute.v1.ForwardingRule.NetworkTier|null); + + /** ForwardingRule portRange. */ + public portRange?: (string|null); + + /** ForwardingRule ports. */ + public ports: string[]; + + /** ForwardingRule pscConnectionId. */ + public pscConnectionId?: (number|Long|string|null); + + /** ForwardingRule region. */ + public region?: (string|null); + + /** ForwardingRule selfLink. */ + public selfLink?: (string|null); + + /** ForwardingRule serviceDirectoryRegistrations. */ + public serviceDirectoryRegistrations: google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration[]; + + /** ForwardingRule serviceLabel. */ + public serviceLabel?: (string|null); + + /** ForwardingRule serviceName. */ + public serviceName?: (string|null); + + /** ForwardingRule subnetwork. */ + public subnetwork?: (string|null); + + /** ForwardingRule target. */ + public target?: (string|null); + + /** ForwardingRule _IPAddress. */ + public _IPAddress?: "IPAddress"; + + /** ForwardingRule _IPProtocol. */ + public _IPProtocol?: "IPProtocol"; + + /** ForwardingRule _allPorts. */ + public _allPorts?: "allPorts"; + + /** ForwardingRule _allowGlobalAccess. */ + public _allowGlobalAccess?: "allowGlobalAccess"; + + /** ForwardingRule _backendService. */ + public _backendService?: "backendService"; + + /** ForwardingRule _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** ForwardingRule _description. */ + public _description?: "description"; + + /** ForwardingRule _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** ForwardingRule _id. */ + public _id?: "id"; + + /** ForwardingRule _ipVersion. */ + public _ipVersion?: "ipVersion"; + + /** ForwardingRule _isMirroringCollector. */ + public _isMirroringCollector?: "isMirroringCollector"; + + /** ForwardingRule _kind. */ + public _kind?: "kind"; + + /** ForwardingRule _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** ForwardingRule _loadBalancingScheme. */ + public _loadBalancingScheme?: "loadBalancingScheme"; + + /** ForwardingRule _name. */ + public _name?: "name"; + + /** ForwardingRule _network. */ + public _network?: "network"; + + /** ForwardingRule _networkTier. */ + public _networkTier?: "networkTier"; + + /** ForwardingRule _portRange. */ + public _portRange?: "portRange"; + + /** ForwardingRule _pscConnectionId. */ + public _pscConnectionId?: "pscConnectionId"; + + /** ForwardingRule _region. */ + public _region?: "region"; + + /** ForwardingRule _selfLink. */ + public _selfLink?: "selfLink"; + + /** ForwardingRule _serviceLabel. */ + public _serviceLabel?: "serviceLabel"; + + /** ForwardingRule _serviceName. */ + public _serviceName?: "serviceName"; + + /** ForwardingRule _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** ForwardingRule _target. */ + public _target?: "target"; + + /** + * Creates a new ForwardingRule instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardingRule instance + */ + public static create(properties?: google.cloud.compute.v1.IForwardingRule): google.cloud.compute.v1.ForwardingRule; + + /** + * Encodes the specified ForwardingRule message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRule.verify|verify} messages. + * @param message ForwardingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IForwardingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForwardingRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRule.verify|verify} messages. + * @param message ForwardingRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IForwardingRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForwardingRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ForwardingRule; + + /** + * Decodes a ForwardingRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ForwardingRule; + + /** + * Verifies a ForwardingRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForwardingRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardingRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ForwardingRule; + + /** + * Creates a plain object from a ForwardingRule message. Also converts values to other types if specified. + * @param message ForwardingRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ForwardingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForwardingRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ForwardingRule { + + /** IPProtocol_ enum. */ + enum IPProtocol_ { + UNDEFINED_I_P_PROTOCOL = 0, + AH = 2087, + ESP = 68962, + ICMP = 2241597, + SCTP = 2539724, + TCP = 82881, + UDP = 83873 + } + + /** IpVersion enum. */ + enum IpVersion { + UNDEFINED_IP_VERSION = 0, + IPV4 = 2254341, + IPV6 = 2254343, + UNSPECIFIED_VERSION = 21850000 + } + + /** LoadBalancingScheme enum. */ + enum LoadBalancingScheme { + UNDEFINED_LOAD_BALANCING_SCHEME = 0, + EXTERNAL = 35607499, + INTERNAL = 279295677, + INTERNAL_MANAGED = 37350397, + INTERNAL_SELF_MANAGED = 236211150, + INVALID = 530283991 + } + + /** NetworkTier enum. */ + enum NetworkTier { + UNDEFINED_NETWORK_TIER = 0, + PREMIUM = 399530551, + STANDARD = 484642493 + } + } + + /** Properties of a ForwardingRulesScopedList. */ + interface IForwardingRulesScopedList { + + /** ForwardingRulesScopedList forwardingRules */ + forwardingRules?: (google.cloud.compute.v1.IForwardingRule[]|null); + + /** ForwardingRulesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ForwardingRulesScopedList. */ + class ForwardingRulesScopedList implements IForwardingRulesScopedList { + + /** + * Constructs a new ForwardingRulesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IForwardingRulesScopedList); + + /** ForwardingRulesScopedList forwardingRules. */ + public forwardingRules: google.cloud.compute.v1.IForwardingRule[]; + + /** ForwardingRulesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ForwardingRulesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ForwardingRulesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardingRulesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IForwardingRulesScopedList): google.cloud.compute.v1.ForwardingRulesScopedList; + + /** + * Encodes the specified ForwardingRulesScopedList message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRulesScopedList.verify|verify} messages. + * @param message ForwardingRulesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IForwardingRulesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForwardingRulesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRulesScopedList.verify|verify} messages. + * @param message ForwardingRulesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IForwardingRulesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForwardingRulesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardingRulesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ForwardingRulesScopedList; + + /** + * Decodes a ForwardingRulesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardingRulesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ForwardingRulesScopedList; + + /** + * Verifies a ForwardingRulesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForwardingRulesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardingRulesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ForwardingRulesScopedList; + + /** + * Creates a plain object from a ForwardingRulesScopedList message. Also converts values to other types if specified. + * @param message ForwardingRulesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ForwardingRulesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForwardingRulesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ForwardingRuleAggregatedList. */ + interface IForwardingRuleAggregatedList { + + /** ForwardingRuleAggregatedList id */ + id?: (string|null); + + /** ForwardingRuleAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IForwardingRulesScopedList }|null); + + /** ForwardingRuleAggregatedList kind */ + kind?: (string|null); + + /** ForwardingRuleAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** ForwardingRuleAggregatedList selfLink */ + selfLink?: (string|null); + + /** ForwardingRuleAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** ForwardingRuleAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ForwardingRuleAggregatedList. */ + class ForwardingRuleAggregatedList implements IForwardingRuleAggregatedList { + + /** + * Constructs a new ForwardingRuleAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IForwardingRuleAggregatedList); + + /** ForwardingRuleAggregatedList id. */ + public id?: (string|null); + + /** ForwardingRuleAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IForwardingRulesScopedList }; + + /** ForwardingRuleAggregatedList kind. */ + public kind?: (string|null); + + /** ForwardingRuleAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ForwardingRuleAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** ForwardingRuleAggregatedList unreachables. */ + public unreachables: string[]; + + /** ForwardingRuleAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ForwardingRuleAggregatedList _id. */ + public _id?: "id"; + + /** ForwardingRuleAggregatedList _kind. */ + public _kind?: "kind"; + + /** ForwardingRuleAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ForwardingRuleAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ForwardingRuleAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ForwardingRuleAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardingRuleAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IForwardingRuleAggregatedList): google.cloud.compute.v1.ForwardingRuleAggregatedList; + + /** + * Encodes the specified ForwardingRuleAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleAggregatedList.verify|verify} messages. + * @param message ForwardingRuleAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IForwardingRuleAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForwardingRuleAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleAggregatedList.verify|verify} messages. + * @param message ForwardingRuleAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IForwardingRuleAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForwardingRuleAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardingRuleAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ForwardingRuleAggregatedList; + + /** + * Decodes a ForwardingRuleAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardingRuleAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ForwardingRuleAggregatedList; + + /** + * Verifies a ForwardingRuleAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForwardingRuleAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardingRuleAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ForwardingRuleAggregatedList; + + /** + * Creates a plain object from a ForwardingRuleAggregatedList message. Also converts values to other types if specified. + * @param message ForwardingRuleAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ForwardingRuleAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForwardingRuleAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ForwardingRuleList. */ + interface IForwardingRuleList { + + /** ForwardingRuleList id */ + id?: (string|null); + + /** ForwardingRuleList items */ + items?: (google.cloud.compute.v1.IForwardingRule[]|null); + + /** ForwardingRuleList kind */ + kind?: (string|null); + + /** ForwardingRuleList nextPageToken */ + nextPageToken?: (string|null); + + /** ForwardingRuleList selfLink */ + selfLink?: (string|null); + + /** ForwardingRuleList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ForwardingRuleList. */ + class ForwardingRuleList implements IForwardingRuleList { + + /** + * Constructs a new ForwardingRuleList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IForwardingRuleList); + + /** ForwardingRuleList id. */ + public id?: (string|null); + + /** ForwardingRuleList items. */ + public items: google.cloud.compute.v1.IForwardingRule[]; + + /** ForwardingRuleList kind. */ + public kind?: (string|null); + + /** ForwardingRuleList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ForwardingRuleList selfLink. */ + public selfLink?: (string|null); + + /** ForwardingRuleList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ForwardingRuleList _id. */ + public _id?: "id"; + + /** ForwardingRuleList _kind. */ + public _kind?: "kind"; + + /** ForwardingRuleList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ForwardingRuleList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ForwardingRuleList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ForwardingRuleList instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardingRuleList instance + */ + public static create(properties?: google.cloud.compute.v1.IForwardingRuleList): google.cloud.compute.v1.ForwardingRuleList; + + /** + * Encodes the specified ForwardingRuleList message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleList.verify|verify} messages. + * @param message ForwardingRuleList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IForwardingRuleList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForwardingRuleList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleList.verify|verify} messages. + * @param message ForwardingRuleList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IForwardingRuleList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForwardingRuleList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardingRuleList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ForwardingRuleList; + + /** + * Decodes a ForwardingRuleList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardingRuleList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ForwardingRuleList; + + /** + * Verifies a ForwardingRuleList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForwardingRuleList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardingRuleList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ForwardingRuleList; + + /** + * Creates a plain object from a ForwardingRuleList message. Also converts values to other types if specified. + * @param message ForwardingRuleList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ForwardingRuleList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForwardingRuleList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ForwardingRuleReference. */ + interface IForwardingRuleReference { + + /** ForwardingRuleReference forwardingRule */ + forwardingRule?: (string|null); + } + + /** Represents a ForwardingRuleReference. */ + class ForwardingRuleReference implements IForwardingRuleReference { + + /** + * Constructs a new ForwardingRuleReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IForwardingRuleReference); + + /** ForwardingRuleReference forwardingRule. */ + public forwardingRule?: (string|null); + + /** ForwardingRuleReference _forwardingRule. */ + public _forwardingRule?: "forwardingRule"; + + /** + * Creates a new ForwardingRuleReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ForwardingRuleReference instance + */ + public static create(properties?: google.cloud.compute.v1.IForwardingRuleReference): google.cloud.compute.v1.ForwardingRuleReference; + + /** + * Encodes the specified ForwardingRuleReference message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleReference.verify|verify} messages. + * @param message ForwardingRuleReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IForwardingRuleReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ForwardingRuleReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleReference.verify|verify} messages. + * @param message ForwardingRuleReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IForwardingRuleReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ForwardingRuleReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ForwardingRuleReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ForwardingRuleReference; + + /** + * Decodes a ForwardingRuleReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ForwardingRuleReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ForwardingRuleReference; + + /** + * Verifies a ForwardingRuleReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ForwardingRuleReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ForwardingRuleReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ForwardingRuleReference; + + /** + * Creates a plain object from a ForwardingRuleReference message. Also converts values to other types if specified. + * @param message ForwardingRuleReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ForwardingRuleReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ForwardingRuleReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GRPCHealthCheck. */ + interface IGRPCHealthCheck { + + /** GRPCHealthCheck grpcServiceName */ + grpcServiceName?: (string|null); + + /** GRPCHealthCheck port */ + port?: (number|null); + + /** GRPCHealthCheck portName */ + portName?: (string|null); + + /** GRPCHealthCheck portSpecification */ + portSpecification?: (google.cloud.compute.v1.GRPCHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.GRPCHealthCheck.PortSpecification|null); + } + + /** Represents a GRPCHealthCheck. */ + class GRPCHealthCheck implements IGRPCHealthCheck { + + /** + * Constructs a new GRPCHealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGRPCHealthCheck); + + /** GRPCHealthCheck grpcServiceName. */ + public grpcServiceName?: (string|null); + + /** GRPCHealthCheck port. */ + public port?: (number|null); + + /** GRPCHealthCheck portName. */ + public portName?: (string|null); + + /** GRPCHealthCheck portSpecification. */ + public portSpecification?: (google.cloud.compute.v1.GRPCHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.GRPCHealthCheck.PortSpecification|null); + + /** GRPCHealthCheck _grpcServiceName. */ + public _grpcServiceName?: "grpcServiceName"; + + /** GRPCHealthCheck _port. */ + public _port?: "port"; + + /** GRPCHealthCheck _portName. */ + public _portName?: "portName"; + + /** GRPCHealthCheck _portSpecification. */ + public _portSpecification?: "portSpecification"; + + /** + * Creates a new GRPCHealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns GRPCHealthCheck instance + */ + public static create(properties?: google.cloud.compute.v1.IGRPCHealthCheck): google.cloud.compute.v1.GRPCHealthCheck; + + /** + * Encodes the specified GRPCHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.GRPCHealthCheck.verify|verify} messages. + * @param message GRPCHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGRPCHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GRPCHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GRPCHealthCheck.verify|verify} messages. + * @param message GRPCHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGRPCHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GRPCHealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GRPCHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GRPCHealthCheck; + + /** + * Decodes a GRPCHealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GRPCHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GRPCHealthCheck; + + /** + * Verifies a GRPCHealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GRPCHealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GRPCHealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GRPCHealthCheck; + + /** + * Creates a plain object from a GRPCHealthCheck message. Also converts values to other types if specified. + * @param message GRPCHealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GRPCHealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GRPCHealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GRPCHealthCheck { + + /** PortSpecification enum. */ + enum PortSpecification { + UNDEFINED_PORT_SPECIFICATION = 0, + USE_FIXED_PORT = 190235748, + USE_NAMED_PORT = 349300671, + USE_SERVING_PORT = 362637516 + } + } + + /** Properties of a NetworkEndpoint. */ + interface INetworkEndpoint { + + /** NetworkEndpoint annotations */ + annotations?: ({ [k: string]: string }|null); + + /** NetworkEndpoint fqdn */ + fqdn?: (string|null); + + /** NetworkEndpoint instance */ + instance?: (string|null); + + /** NetworkEndpoint ipAddress */ + ipAddress?: (string|null); + + /** NetworkEndpoint port */ + port?: (number|null); + } + + /** Represents a NetworkEndpoint. */ + class NetworkEndpoint implements INetworkEndpoint { + + /** + * Constructs a new NetworkEndpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpoint); + + /** NetworkEndpoint annotations. */ + public annotations: { [k: string]: string }; + + /** NetworkEndpoint fqdn. */ + public fqdn?: (string|null); + + /** NetworkEndpoint instance. */ + public instance?: (string|null); + + /** NetworkEndpoint ipAddress. */ + public ipAddress?: (string|null); + + /** NetworkEndpoint port. */ + public port?: (number|null); + + /** NetworkEndpoint _fqdn. */ + public _fqdn?: "fqdn"; + + /** NetworkEndpoint _instance. */ + public _instance?: "instance"; + + /** NetworkEndpoint _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** NetworkEndpoint _port. */ + public _port?: "port"; + + /** + * Creates a new NetworkEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpoint instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpoint): google.cloud.compute.v1.NetworkEndpoint; + + /** + * Encodes the specified NetworkEndpoint message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpoint.verify|verify} messages. + * @param message NetworkEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpoint message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpoint.verify|verify} messages. + * @param message NetworkEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpoint; + + /** + * Decodes a NetworkEndpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpoint; + + /** + * Verifies a NetworkEndpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpoint; + + /** + * Creates a plain object from a NetworkEndpoint message. Also converts values to other types if specified. + * @param message NetworkEndpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlobalNetworkEndpointGroupsAttachEndpointsRequest. */ + interface IGlobalNetworkEndpointGroupsAttachEndpointsRequest { + + /** GlobalNetworkEndpointGroupsAttachEndpointsRequest networkEndpoints */ + networkEndpoints?: (google.cloud.compute.v1.INetworkEndpoint[]|null); + } + + /** Represents a GlobalNetworkEndpointGroupsAttachEndpointsRequest. */ + class GlobalNetworkEndpointGroupsAttachEndpointsRequest implements IGlobalNetworkEndpointGroupsAttachEndpointsRequest { + + /** + * Constructs a new GlobalNetworkEndpointGroupsAttachEndpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest); + + /** GlobalNetworkEndpointGroupsAttachEndpointsRequest networkEndpoints. */ + public networkEndpoints: google.cloud.compute.v1.INetworkEndpoint[]; + + /** + * Creates a new GlobalNetworkEndpointGroupsAttachEndpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GlobalNetworkEndpointGroupsAttachEndpointsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest): google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsAttachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @param message GlobalNetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsAttachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @param message GlobalNetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlobalNetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Decodes a GlobalNetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Verifies a GlobalNetworkEndpointGroupsAttachEndpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlobalNetworkEndpointGroupsAttachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlobalNetworkEndpointGroupsAttachEndpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Creates a plain object from a GlobalNetworkEndpointGroupsAttachEndpointsRequest message. Also converts values to other types if specified. + * @param message GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlobalNetworkEndpointGroupsAttachEndpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlobalNetworkEndpointGroupsDetachEndpointsRequest. */ + interface IGlobalNetworkEndpointGroupsDetachEndpointsRequest { + + /** GlobalNetworkEndpointGroupsDetachEndpointsRequest networkEndpoints */ + networkEndpoints?: (google.cloud.compute.v1.INetworkEndpoint[]|null); + } + + /** Represents a GlobalNetworkEndpointGroupsDetachEndpointsRequest. */ + class GlobalNetworkEndpointGroupsDetachEndpointsRequest implements IGlobalNetworkEndpointGroupsDetachEndpointsRequest { + + /** + * Constructs a new GlobalNetworkEndpointGroupsDetachEndpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest); + + /** GlobalNetworkEndpointGroupsDetachEndpointsRequest networkEndpoints. */ + public networkEndpoints: google.cloud.compute.v1.INetworkEndpoint[]; + + /** + * Creates a new GlobalNetworkEndpointGroupsDetachEndpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GlobalNetworkEndpointGroupsDetachEndpointsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest): google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsDetachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @param message GlobalNetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsDetachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @param message GlobalNetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlobalNetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Decodes a GlobalNetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Verifies a GlobalNetworkEndpointGroupsDetachEndpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlobalNetworkEndpointGroupsDetachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlobalNetworkEndpointGroupsDetachEndpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Creates a plain object from a GlobalNetworkEndpointGroupsDetachEndpointsRequest message. Also converts values to other types if specified. + * @param message GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlobalNetworkEndpointGroupsDetachEndpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy auditConfigs */ + auditConfigs?: (google.cloud.compute.v1.IAuditConfig[]|null); + + /** Policy bindings */ + bindings?: (google.cloud.compute.v1.IBinding[]|null); + + /** Policy etag */ + etag?: (string|null); + + /** Policy iamOwned */ + iamOwned?: (boolean|null); + + /** Policy rules */ + rules?: (google.cloud.compute.v1.IRule[]|null); + + /** Policy version */ + version?: (number|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPolicy); + + /** Policy auditConfigs. */ + public auditConfigs: google.cloud.compute.v1.IAuditConfig[]; + + /** Policy bindings. */ + public bindings: google.cloud.compute.v1.IBinding[]; + + /** Policy etag. */ + public etag?: (string|null); + + /** Policy iamOwned. */ + public iamOwned?: (boolean|null); + + /** Policy rules. */ + public rules: google.cloud.compute.v1.IRule[]; + + /** Policy version. */ + public version?: (number|null); + + /** Policy _etag. */ + public _etag?: "etag"; + + /** Policy _iamOwned. */ + public _iamOwned?: "iamOwned"; + + /** Policy _version. */ + public _version?: "version"; + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.cloud.compute.v1.IPolicy): google.cloud.compute.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.compute.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.cloud.compute.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.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.cloud.compute.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlobalOrganizationSetPolicyRequest. */ + interface IGlobalOrganizationSetPolicyRequest { + + /** GlobalOrganizationSetPolicyRequest bindings */ + bindings?: (google.cloud.compute.v1.IBinding[]|null); + + /** GlobalOrganizationSetPolicyRequest etag */ + etag?: (string|null); + + /** GlobalOrganizationSetPolicyRequest policy */ + policy?: (google.cloud.compute.v1.IPolicy|null); + } + + /** Represents a GlobalOrganizationSetPolicyRequest. */ + class GlobalOrganizationSetPolicyRequest implements IGlobalOrganizationSetPolicyRequest { + + /** + * Constructs a new GlobalOrganizationSetPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest); + + /** GlobalOrganizationSetPolicyRequest bindings. */ + public bindings: google.cloud.compute.v1.IBinding[]; + + /** GlobalOrganizationSetPolicyRequest etag. */ + public etag?: (string|null); + + /** GlobalOrganizationSetPolicyRequest policy. */ + public policy?: (google.cloud.compute.v1.IPolicy|null); + + /** GlobalOrganizationSetPolicyRequest _etag. */ + public _etag?: "etag"; + + /** GlobalOrganizationSetPolicyRequest _policy. */ + public _policy?: "policy"; + + /** + * Creates a new GlobalOrganizationSetPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GlobalOrganizationSetPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest): google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest; + + /** + * Encodes the specified GlobalOrganizationSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.verify|verify} messages. + * @param message GlobalOrganizationSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlobalOrganizationSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.verify|verify} messages. + * @param message GlobalOrganizationSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlobalOrganizationSetPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlobalOrganizationSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest; + + /** + * Decodes a GlobalOrganizationSetPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlobalOrganizationSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest; + + /** + * Verifies a GlobalOrganizationSetPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlobalOrganizationSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlobalOrganizationSetPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest; + + /** + * Creates a plain object from a GlobalOrganizationSetPolicyRequest message. Also converts values to other types if specified. + * @param message GlobalOrganizationSetPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlobalOrganizationSetPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlobalSetLabelsRequest. */ + interface IGlobalSetLabelsRequest { + + /** GlobalSetLabelsRequest labelFingerprint */ + labelFingerprint?: (string|null); + + /** GlobalSetLabelsRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a GlobalSetLabelsRequest. */ + class GlobalSetLabelsRequest implements IGlobalSetLabelsRequest { + + /** + * Constructs a new GlobalSetLabelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGlobalSetLabelsRequest); + + /** GlobalSetLabelsRequest labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** GlobalSetLabelsRequest labels. */ + public labels: { [k: string]: string }; + + /** GlobalSetLabelsRequest _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** + * Creates a new GlobalSetLabelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GlobalSetLabelsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGlobalSetLabelsRequest): google.cloud.compute.v1.GlobalSetLabelsRequest; + + /** + * Encodes the specified GlobalSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalSetLabelsRequest.verify|verify} messages. + * @param message GlobalSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGlobalSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlobalSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalSetLabelsRequest.verify|verify} messages. + * @param message GlobalSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGlobalSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlobalSetLabelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlobalSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GlobalSetLabelsRequest; + + /** + * Decodes a GlobalSetLabelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlobalSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GlobalSetLabelsRequest; + + /** + * Verifies a GlobalSetLabelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlobalSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlobalSetLabelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GlobalSetLabelsRequest; + + /** + * Creates a plain object from a GlobalSetLabelsRequest message. Also converts values to other types if specified. + * @param message GlobalSetLabelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GlobalSetLabelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlobalSetLabelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GlobalSetPolicyRequest. */ + interface IGlobalSetPolicyRequest { + + /** GlobalSetPolicyRequest bindings */ + bindings?: (google.cloud.compute.v1.IBinding[]|null); + + /** GlobalSetPolicyRequest etag */ + etag?: (string|null); + + /** GlobalSetPolicyRequest policy */ + policy?: (google.cloud.compute.v1.IPolicy|null); + } + + /** Represents a GlobalSetPolicyRequest. */ + class GlobalSetPolicyRequest implements IGlobalSetPolicyRequest { + + /** + * Constructs a new GlobalSetPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGlobalSetPolicyRequest); + + /** GlobalSetPolicyRequest bindings. */ + public bindings: google.cloud.compute.v1.IBinding[]; + + /** GlobalSetPolicyRequest etag. */ + public etag?: (string|null); + + /** GlobalSetPolicyRequest policy. */ + public policy?: (google.cloud.compute.v1.IPolicy|null); + + /** GlobalSetPolicyRequest _etag. */ + public _etag?: "etag"; + + /** GlobalSetPolicyRequest _policy. */ + public _policy?: "policy"; + + /** + * Creates a new GlobalSetPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GlobalSetPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGlobalSetPolicyRequest): google.cloud.compute.v1.GlobalSetPolicyRequest; + + /** + * Encodes the specified GlobalSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalSetPolicyRequest.verify|verify} messages. + * @param message GlobalSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGlobalSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GlobalSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalSetPolicyRequest.verify|verify} messages. + * @param message GlobalSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGlobalSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GlobalSetPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GlobalSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GlobalSetPolicyRequest; + + /** + * Decodes a GlobalSetPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GlobalSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GlobalSetPolicyRequest; + + /** + * Verifies a GlobalSetPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GlobalSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GlobalSetPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GlobalSetPolicyRequest; + + /** + * Creates a plain object from a GlobalSetPolicyRequest message. Also converts values to other types if specified. + * @param message GlobalSetPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GlobalSetPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GlobalSetPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GuestAttributesValue. */ + interface IGuestAttributesValue { + + /** GuestAttributesValue items */ + items?: (google.cloud.compute.v1.IGuestAttributesEntry[]|null); + } + + /** Represents a GuestAttributesValue. */ + class GuestAttributesValue implements IGuestAttributesValue { + + /** + * Constructs a new GuestAttributesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGuestAttributesValue); + + /** GuestAttributesValue items. */ + public items: google.cloud.compute.v1.IGuestAttributesEntry[]; + + /** + * Creates a new GuestAttributesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns GuestAttributesValue instance + */ + public static create(properties?: google.cloud.compute.v1.IGuestAttributesValue): google.cloud.compute.v1.GuestAttributesValue; + + /** + * Encodes the specified GuestAttributesValue message. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesValue.verify|verify} messages. + * @param message GuestAttributesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGuestAttributesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuestAttributesValue message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesValue.verify|verify} messages. + * @param message GuestAttributesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGuestAttributesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuestAttributesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuestAttributesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GuestAttributesValue; + + /** + * Decodes a GuestAttributesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuestAttributesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GuestAttributesValue; + + /** + * Verifies a GuestAttributesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuestAttributesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuestAttributesValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GuestAttributesValue; + + /** + * Creates a plain object from a GuestAttributesValue message. Also converts values to other types if specified. + * @param message GuestAttributesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GuestAttributesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuestAttributesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GuestAttributes. */ + interface IGuestAttributes { + + /** GuestAttributes kind */ + kind?: (string|null); + + /** GuestAttributes queryPath */ + queryPath?: (string|null); + + /** GuestAttributes queryValue */ + queryValue?: (google.cloud.compute.v1.IGuestAttributesValue|null); + + /** GuestAttributes selfLink */ + selfLink?: (string|null); + + /** GuestAttributes variableKey */ + variableKey?: (string|null); + + /** GuestAttributes variableValue */ + variableValue?: (string|null); + } + + /** Represents a GuestAttributes. */ + class GuestAttributes implements IGuestAttributes { + + /** + * Constructs a new GuestAttributes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGuestAttributes); + + /** GuestAttributes kind. */ + public kind?: (string|null); + + /** GuestAttributes queryPath. */ + public queryPath?: (string|null); + + /** GuestAttributes queryValue. */ + public queryValue?: (google.cloud.compute.v1.IGuestAttributesValue|null); + + /** GuestAttributes selfLink. */ + public selfLink?: (string|null); + + /** GuestAttributes variableKey. */ + public variableKey?: (string|null); + + /** GuestAttributes variableValue. */ + public variableValue?: (string|null); + + /** GuestAttributes _kind. */ + public _kind?: "kind"; + + /** GuestAttributes _queryPath. */ + public _queryPath?: "queryPath"; + + /** GuestAttributes _queryValue. */ + public _queryValue?: "queryValue"; + + /** GuestAttributes _selfLink. */ + public _selfLink?: "selfLink"; + + /** GuestAttributes _variableKey. */ + public _variableKey?: "variableKey"; + + /** GuestAttributes _variableValue. */ + public _variableValue?: "variableValue"; + + /** + * Creates a new GuestAttributes instance using the specified properties. + * @param [properties] Properties to set + * @returns GuestAttributes instance + */ + public static create(properties?: google.cloud.compute.v1.IGuestAttributes): google.cloud.compute.v1.GuestAttributes; + + /** + * Encodes the specified GuestAttributes message. Does not implicitly {@link google.cloud.compute.v1.GuestAttributes.verify|verify} messages. + * @param message GuestAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGuestAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuestAttributes message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestAttributes.verify|verify} messages. + * @param message GuestAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGuestAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuestAttributes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuestAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GuestAttributes; + + /** + * Decodes a GuestAttributes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuestAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GuestAttributes; + + /** + * Verifies a GuestAttributes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuestAttributes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuestAttributes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GuestAttributes; + + /** + * Creates a plain object from a GuestAttributes message. Also converts values to other types if specified. + * @param message GuestAttributes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GuestAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuestAttributes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GuestAttributesEntry. */ + interface IGuestAttributesEntry { + + /** GuestAttributesEntry key */ + key?: (string|null); + + /** GuestAttributesEntry namespace */ + namespace?: (string|null); + + /** GuestAttributesEntry value */ + value?: (string|null); + } + + /** Represents a GuestAttributesEntry. */ + class GuestAttributesEntry implements IGuestAttributesEntry { + + /** + * Constructs a new GuestAttributesEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGuestAttributesEntry); + + /** GuestAttributesEntry key. */ + public key?: (string|null); + + /** GuestAttributesEntry namespace. */ + public namespace?: (string|null); + + /** GuestAttributesEntry value. */ + public value?: (string|null); + + /** GuestAttributesEntry _key. */ + public _key?: "key"; + + /** GuestAttributesEntry _namespace. */ + public _namespace?: "namespace"; + + /** GuestAttributesEntry _value. */ + public _value?: "value"; + + /** + * Creates a new GuestAttributesEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns GuestAttributesEntry instance + */ + public static create(properties?: google.cloud.compute.v1.IGuestAttributesEntry): google.cloud.compute.v1.GuestAttributesEntry; + + /** + * Encodes the specified GuestAttributesEntry message. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesEntry.verify|verify} messages. + * @param message GuestAttributesEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGuestAttributesEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuestAttributesEntry message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesEntry.verify|verify} messages. + * @param message GuestAttributesEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGuestAttributesEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuestAttributesEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuestAttributesEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GuestAttributesEntry; + + /** + * Decodes a GuestAttributesEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuestAttributesEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GuestAttributesEntry; + + /** + * Verifies a GuestAttributesEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuestAttributesEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuestAttributesEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GuestAttributesEntry; + + /** + * Creates a plain object from a GuestAttributesEntry message. Also converts values to other types if specified. + * @param message GuestAttributesEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GuestAttributesEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuestAttributesEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HTTP2HealthCheck. */ + interface IHTTP2HealthCheck { + + /** HTTP2HealthCheck host */ + host?: (string|null); + + /** HTTP2HealthCheck port */ + port?: (number|null); + + /** HTTP2HealthCheck portName */ + portName?: (string|null); + + /** HTTP2HealthCheck portSpecification */ + portSpecification?: (google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification|null); + + /** HTTP2HealthCheck proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader|null); + + /** HTTP2HealthCheck requestPath */ + requestPath?: (string|null); + + /** HTTP2HealthCheck response */ + response?: (string|null); + } + + /** Represents a HTTP2HealthCheck. */ + class HTTP2HealthCheck implements IHTTP2HealthCheck { + + /** + * Constructs a new HTTP2HealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHTTP2HealthCheck); + + /** HTTP2HealthCheck host. */ + public host?: (string|null); + + /** HTTP2HealthCheck port. */ + public port?: (number|null); + + /** HTTP2HealthCheck portName. */ + public portName?: (string|null); + + /** HTTP2HealthCheck portSpecification. */ + public portSpecification?: (google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification|null); + + /** HTTP2HealthCheck proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader|null); + + /** HTTP2HealthCheck requestPath. */ + public requestPath?: (string|null); + + /** HTTP2HealthCheck response. */ + public response?: (string|null); + + /** HTTP2HealthCheck _host. */ + public _host?: "host"; + + /** HTTP2HealthCheck _port. */ + public _port?: "port"; + + /** HTTP2HealthCheck _portName. */ + public _portName?: "portName"; + + /** HTTP2HealthCheck _portSpecification. */ + public _portSpecification?: "portSpecification"; + + /** HTTP2HealthCheck _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** HTTP2HealthCheck _requestPath. */ + public _requestPath?: "requestPath"; + + /** HTTP2HealthCheck _response. */ + public _response?: "response"; + + /** + * Creates a new HTTP2HealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns HTTP2HealthCheck instance + */ + public static create(properties?: google.cloud.compute.v1.IHTTP2HealthCheck): google.cloud.compute.v1.HTTP2HealthCheck; + + /** + * Encodes the specified HTTP2HealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HTTP2HealthCheck.verify|verify} messages. + * @param message HTTP2HealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHTTP2HealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HTTP2HealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HTTP2HealthCheck.verify|verify} messages. + * @param message HTTP2HealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHTTP2HealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HTTP2HealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HTTP2HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HTTP2HealthCheck; + + /** + * Decodes a HTTP2HealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HTTP2HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HTTP2HealthCheck; + + /** + * Verifies a HTTP2HealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HTTP2HealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HTTP2HealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HTTP2HealthCheck; + + /** + * Creates a plain object from a HTTP2HealthCheck message. Also converts values to other types if specified. + * @param message HTTP2HealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HTTP2HealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HTTP2HealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HTTP2HealthCheck { + + /** PortSpecification enum. */ + enum PortSpecification { + UNDEFINED_PORT_SPECIFICATION = 0, + USE_FIXED_PORT = 190235748, + USE_NAMED_PORT = 349300671, + USE_SERVING_PORT = 362637516 + } + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a HTTPHealthCheck. */ + interface IHTTPHealthCheck { + + /** HTTPHealthCheck host */ + host?: (string|null); + + /** HTTPHealthCheck port */ + port?: (number|null); + + /** HTTPHealthCheck portName */ + portName?: (string|null); + + /** HTTPHealthCheck portSpecification */ + portSpecification?: (google.cloud.compute.v1.HTTPHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.HTTPHealthCheck.PortSpecification|null); + + /** HTTPHealthCheck proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader|null); + + /** HTTPHealthCheck requestPath */ + requestPath?: (string|null); + + /** HTTPHealthCheck response */ + response?: (string|null); + } + + /** Represents a HTTPHealthCheck. */ + class HTTPHealthCheck implements IHTTPHealthCheck { + + /** + * Constructs a new HTTPHealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHTTPHealthCheck); + + /** HTTPHealthCheck host. */ + public host?: (string|null); + + /** HTTPHealthCheck port. */ + public port?: (number|null); + + /** HTTPHealthCheck portName. */ + public portName?: (string|null); + + /** HTTPHealthCheck portSpecification. */ + public portSpecification?: (google.cloud.compute.v1.HTTPHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.HTTPHealthCheck.PortSpecification|null); + + /** HTTPHealthCheck proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader|null); + + /** HTTPHealthCheck requestPath. */ + public requestPath?: (string|null); + + /** HTTPHealthCheck response. */ + public response?: (string|null); + + /** HTTPHealthCheck _host. */ + public _host?: "host"; + + /** HTTPHealthCheck _port. */ + public _port?: "port"; + + /** HTTPHealthCheck _portName. */ + public _portName?: "portName"; + + /** HTTPHealthCheck _portSpecification. */ + public _portSpecification?: "portSpecification"; + + /** HTTPHealthCheck _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** HTTPHealthCheck _requestPath. */ + public _requestPath?: "requestPath"; + + /** HTTPHealthCheck _response. */ + public _response?: "response"; + + /** + * Creates a new HTTPHealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns HTTPHealthCheck instance + */ + public static create(properties?: google.cloud.compute.v1.IHTTPHealthCheck): google.cloud.compute.v1.HTTPHealthCheck; + + /** + * Encodes the specified HTTPHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HTTPHealthCheck.verify|verify} messages. + * @param message HTTPHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHTTPHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HTTPHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HTTPHealthCheck.verify|verify} messages. + * @param message HTTPHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHTTPHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HTTPHealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HTTPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HTTPHealthCheck; + + /** + * Decodes a HTTPHealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HTTPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HTTPHealthCheck; + + /** + * Verifies a HTTPHealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HTTPHealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HTTPHealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HTTPHealthCheck; + + /** + * Creates a plain object from a HTTPHealthCheck message. Also converts values to other types if specified. + * @param message HTTPHealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HTTPHealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HTTPHealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HTTPHealthCheck { + + /** PortSpecification enum. */ + enum PortSpecification { + UNDEFINED_PORT_SPECIFICATION = 0, + USE_FIXED_PORT = 190235748, + USE_NAMED_PORT = 349300671, + USE_SERVING_PORT = 362637516 + } + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a HTTPSHealthCheck. */ + interface IHTTPSHealthCheck { + + /** HTTPSHealthCheck host */ + host?: (string|null); + + /** HTTPSHealthCheck port */ + port?: (number|null); + + /** HTTPSHealthCheck portName */ + portName?: (string|null); + + /** HTTPSHealthCheck portSpecification */ + portSpecification?: (google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification|null); + + /** HTTPSHealthCheck proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader|null); + + /** HTTPSHealthCheck requestPath */ + requestPath?: (string|null); + + /** HTTPSHealthCheck response */ + response?: (string|null); + } + + /** Represents a HTTPSHealthCheck. */ + class HTTPSHealthCheck implements IHTTPSHealthCheck { + + /** + * Constructs a new HTTPSHealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHTTPSHealthCheck); + + /** HTTPSHealthCheck host. */ + public host?: (string|null); + + /** HTTPSHealthCheck port. */ + public port?: (number|null); + + /** HTTPSHealthCheck portName. */ + public portName?: (string|null); + + /** HTTPSHealthCheck portSpecification. */ + public portSpecification?: (google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification|null); + + /** HTTPSHealthCheck proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader|null); + + /** HTTPSHealthCheck requestPath. */ + public requestPath?: (string|null); + + /** HTTPSHealthCheck response. */ + public response?: (string|null); + + /** HTTPSHealthCheck _host. */ + public _host?: "host"; + + /** HTTPSHealthCheck _port. */ + public _port?: "port"; + + /** HTTPSHealthCheck _portName. */ + public _portName?: "portName"; + + /** HTTPSHealthCheck _portSpecification. */ + public _portSpecification?: "portSpecification"; + + /** HTTPSHealthCheck _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** HTTPSHealthCheck _requestPath. */ + public _requestPath?: "requestPath"; + + /** HTTPSHealthCheck _response. */ + public _response?: "response"; + + /** + * Creates a new HTTPSHealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns HTTPSHealthCheck instance + */ + public static create(properties?: google.cloud.compute.v1.IHTTPSHealthCheck): google.cloud.compute.v1.HTTPSHealthCheck; + + /** + * Encodes the specified HTTPSHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HTTPSHealthCheck.verify|verify} messages. + * @param message HTTPSHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHTTPSHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HTTPSHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HTTPSHealthCheck.verify|verify} messages. + * @param message HTTPSHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHTTPSHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HTTPSHealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HTTPSHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HTTPSHealthCheck; + + /** + * Decodes a HTTPSHealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HTTPSHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HTTPSHealthCheck; + + /** + * Verifies a HTTPSHealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HTTPSHealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HTTPSHealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HTTPSHealthCheck; + + /** + * Creates a plain object from a HTTPSHealthCheck message. Also converts values to other types if specified. + * @param message HTTPSHealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HTTPSHealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HTTPSHealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HTTPSHealthCheck { + + /** PortSpecification enum. */ + enum PortSpecification { + UNDEFINED_PORT_SPECIFICATION = 0, + USE_FIXED_PORT = 190235748, + USE_NAMED_PORT = 349300671, + USE_SERVING_PORT = 362637516 + } + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a HealthCheckLogConfig. */ + interface IHealthCheckLogConfig { + + /** HealthCheckLogConfig enable */ + enable?: (boolean|null); + } + + /** Represents a HealthCheckLogConfig. */ + class HealthCheckLogConfig implements IHealthCheckLogConfig { + + /** + * Constructs a new HealthCheckLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthCheckLogConfig); + + /** HealthCheckLogConfig enable. */ + public enable?: (boolean|null); + + /** HealthCheckLogConfig _enable. */ + public _enable?: "enable"; + + /** + * Creates a new HealthCheckLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheckLogConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthCheckLogConfig): google.cloud.compute.v1.HealthCheckLogConfig; + + /** + * Encodes the specified HealthCheckLogConfig message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckLogConfig.verify|verify} messages. + * @param message HealthCheckLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthCheckLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheckLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckLogConfig.verify|verify} messages. + * @param message HealthCheckLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthCheckLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheckLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheckLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthCheckLogConfig; + + /** + * Decodes a HealthCheckLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheckLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthCheckLogConfig; + + /** + * Verifies a HealthCheckLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheckLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheckLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthCheckLogConfig; + + /** + * Creates a plain object from a HealthCheckLogConfig message. Also converts values to other types if specified. + * @param message HealthCheckLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthCheckLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheckLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SSLHealthCheck. */ + interface ISSLHealthCheck { + + /** SSLHealthCheck port */ + port?: (number|null); + + /** SSLHealthCheck portName */ + portName?: (string|null); + + /** SSLHealthCheck portSpecification */ + portSpecification?: (google.cloud.compute.v1.SSLHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.SSLHealthCheck.PortSpecification|null); + + /** SSLHealthCheck proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.SSLHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.SSLHealthCheck.ProxyHeader|null); + + /** SSLHealthCheck request */ + request?: (string|null); + + /** SSLHealthCheck response */ + response?: (string|null); + } + + /** Represents a SSLHealthCheck. */ + class SSLHealthCheck implements ISSLHealthCheck { + + /** + * Constructs a new SSLHealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISSLHealthCheck); + + /** SSLHealthCheck port. */ + public port?: (number|null); + + /** SSLHealthCheck portName. */ + public portName?: (string|null); + + /** SSLHealthCheck portSpecification. */ + public portSpecification?: (google.cloud.compute.v1.SSLHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.SSLHealthCheck.PortSpecification|null); + + /** SSLHealthCheck proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.SSLHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.SSLHealthCheck.ProxyHeader|null); + + /** SSLHealthCheck request. */ + public request?: (string|null); + + /** SSLHealthCheck response. */ + public response?: (string|null); + + /** SSLHealthCheck _port. */ + public _port?: "port"; + + /** SSLHealthCheck _portName. */ + public _portName?: "portName"; + + /** SSLHealthCheck _portSpecification. */ + public _portSpecification?: "portSpecification"; + + /** SSLHealthCheck _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** SSLHealthCheck _request. */ + public _request?: "request"; + + /** SSLHealthCheck _response. */ + public _response?: "response"; + + /** + * Creates a new SSLHealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns SSLHealthCheck instance + */ + public static create(properties?: google.cloud.compute.v1.ISSLHealthCheck): google.cloud.compute.v1.SSLHealthCheck; + + /** + * Encodes the specified SSLHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.SSLHealthCheck.verify|verify} messages. + * @param message SSLHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISSLHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SSLHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SSLHealthCheck.verify|verify} messages. + * @param message SSLHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISSLHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SSLHealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SSLHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SSLHealthCheck; + + /** + * Decodes a SSLHealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SSLHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SSLHealthCheck; + + /** + * Verifies a SSLHealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SSLHealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SSLHealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SSLHealthCheck; + + /** + * Creates a plain object from a SSLHealthCheck message. Also converts values to other types if specified. + * @param message SSLHealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SSLHealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SSLHealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SSLHealthCheck { + + /** PortSpecification enum. */ + enum PortSpecification { + UNDEFINED_PORT_SPECIFICATION = 0, + USE_FIXED_PORT = 190235748, + USE_NAMED_PORT = 349300671, + USE_SERVING_PORT = 362637516 + } + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a TCPHealthCheck. */ + interface ITCPHealthCheck { + + /** TCPHealthCheck port */ + port?: (number|null); + + /** TCPHealthCheck portName */ + portName?: (string|null); + + /** TCPHealthCheck portSpecification */ + portSpecification?: (google.cloud.compute.v1.TCPHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.TCPHealthCheck.PortSpecification|null); + + /** TCPHealthCheck proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.TCPHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.TCPHealthCheck.ProxyHeader|null); + + /** TCPHealthCheck request */ + request?: (string|null); + + /** TCPHealthCheck response */ + response?: (string|null); + } + + /** Represents a TCPHealthCheck. */ + class TCPHealthCheck implements ITCPHealthCheck { + + /** + * Constructs a new TCPHealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITCPHealthCheck); + + /** TCPHealthCheck port. */ + public port?: (number|null); + + /** TCPHealthCheck portName. */ + public portName?: (string|null); + + /** TCPHealthCheck portSpecification. */ + public portSpecification?: (google.cloud.compute.v1.TCPHealthCheck.PortSpecification|keyof typeof google.cloud.compute.v1.TCPHealthCheck.PortSpecification|null); + + /** TCPHealthCheck proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.TCPHealthCheck.ProxyHeader|keyof typeof google.cloud.compute.v1.TCPHealthCheck.ProxyHeader|null); + + /** TCPHealthCheck request. */ + public request?: (string|null); + + /** TCPHealthCheck response. */ + public response?: (string|null); + + /** TCPHealthCheck _port. */ + public _port?: "port"; + + /** TCPHealthCheck _portName. */ + public _portName?: "portName"; + + /** TCPHealthCheck _portSpecification. */ + public _portSpecification?: "portSpecification"; + + /** TCPHealthCheck _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** TCPHealthCheck _request. */ + public _request?: "request"; + + /** TCPHealthCheck _response. */ + public _response?: "response"; + + /** + * Creates a new TCPHealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns TCPHealthCheck instance + */ + public static create(properties?: google.cloud.compute.v1.ITCPHealthCheck): google.cloud.compute.v1.TCPHealthCheck; + + /** + * Encodes the specified TCPHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.TCPHealthCheck.verify|verify} messages. + * @param message TCPHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITCPHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TCPHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TCPHealthCheck.verify|verify} messages. + * @param message TCPHealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITCPHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TCPHealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TCPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TCPHealthCheck; + + /** + * Decodes a TCPHealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TCPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TCPHealthCheck; + + /** + * Verifies a TCPHealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TCPHealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TCPHealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TCPHealthCheck; + + /** + * Creates a plain object from a TCPHealthCheck message. Also converts values to other types if specified. + * @param message TCPHealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TCPHealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TCPHealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TCPHealthCheck { + + /** PortSpecification enum. */ + enum PortSpecification { + UNDEFINED_PORT_SPECIFICATION = 0, + USE_FIXED_PORT = 190235748, + USE_NAMED_PORT = 349300671, + USE_SERVING_PORT = 362637516 + } + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a HealthCheck. */ + interface IHealthCheck { + + /** HealthCheck checkIntervalSec */ + checkIntervalSec?: (number|null); + + /** HealthCheck creationTimestamp */ + creationTimestamp?: (string|null); + + /** HealthCheck description */ + description?: (string|null); + + /** HealthCheck grpcHealthCheck */ + grpcHealthCheck?: (google.cloud.compute.v1.IGRPCHealthCheck|null); + + /** HealthCheck healthyThreshold */ + healthyThreshold?: (number|null); + + /** HealthCheck http2HealthCheck */ + http2HealthCheck?: (google.cloud.compute.v1.IHTTP2HealthCheck|null); + + /** HealthCheck httpHealthCheck */ + httpHealthCheck?: (google.cloud.compute.v1.IHTTPHealthCheck|null); + + /** HealthCheck httpsHealthCheck */ + httpsHealthCheck?: (google.cloud.compute.v1.IHTTPSHealthCheck|null); + + /** HealthCheck id */ + id?: (number|Long|string|null); + + /** HealthCheck kind */ + kind?: (string|null); + + /** HealthCheck logConfig */ + logConfig?: (google.cloud.compute.v1.IHealthCheckLogConfig|null); + + /** HealthCheck name */ + name?: (string|null); + + /** HealthCheck region */ + region?: (string|null); + + /** HealthCheck selfLink */ + selfLink?: (string|null); + + /** HealthCheck sslHealthCheck */ + sslHealthCheck?: (google.cloud.compute.v1.ISSLHealthCheck|null); + + /** HealthCheck tcpHealthCheck */ + tcpHealthCheck?: (google.cloud.compute.v1.ITCPHealthCheck|null); + + /** HealthCheck timeoutSec */ + timeoutSec?: (number|null); + + /** HealthCheck type */ + type?: (google.cloud.compute.v1.HealthCheck.Type|keyof typeof google.cloud.compute.v1.HealthCheck.Type|null); + + /** HealthCheck unhealthyThreshold */ + unhealthyThreshold?: (number|null); + } + + /** Represents a HealthCheck. */ + class HealthCheck implements IHealthCheck { + + /** + * Constructs a new HealthCheck. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthCheck); + + /** HealthCheck checkIntervalSec. */ + public checkIntervalSec?: (number|null); + + /** HealthCheck creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** HealthCheck description. */ + public description?: (string|null); + + /** HealthCheck grpcHealthCheck. */ + public grpcHealthCheck?: (google.cloud.compute.v1.IGRPCHealthCheck|null); + + /** HealthCheck healthyThreshold. */ + public healthyThreshold?: (number|null); + + /** HealthCheck http2HealthCheck. */ + public http2HealthCheck?: (google.cloud.compute.v1.IHTTP2HealthCheck|null); + + /** HealthCheck httpHealthCheck. */ + public httpHealthCheck?: (google.cloud.compute.v1.IHTTPHealthCheck|null); + + /** HealthCheck httpsHealthCheck. */ + public httpsHealthCheck?: (google.cloud.compute.v1.IHTTPSHealthCheck|null); + + /** HealthCheck id. */ + public id?: (number|Long|string|null); + + /** HealthCheck kind. */ + public kind?: (string|null); + + /** HealthCheck logConfig. */ + public logConfig?: (google.cloud.compute.v1.IHealthCheckLogConfig|null); + + /** HealthCheck name. */ + public name?: (string|null); + + /** HealthCheck region. */ + public region?: (string|null); + + /** HealthCheck selfLink. */ + public selfLink?: (string|null); + + /** HealthCheck sslHealthCheck. */ + public sslHealthCheck?: (google.cloud.compute.v1.ISSLHealthCheck|null); + + /** HealthCheck tcpHealthCheck. */ + public tcpHealthCheck?: (google.cloud.compute.v1.ITCPHealthCheck|null); + + /** HealthCheck timeoutSec. */ + public timeoutSec?: (number|null); + + /** HealthCheck type. */ + public type?: (google.cloud.compute.v1.HealthCheck.Type|keyof typeof google.cloud.compute.v1.HealthCheck.Type|null); + + /** HealthCheck unhealthyThreshold. */ + public unhealthyThreshold?: (number|null); + + /** HealthCheck _checkIntervalSec. */ + public _checkIntervalSec?: "checkIntervalSec"; + + /** HealthCheck _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** HealthCheck _description. */ + public _description?: "description"; + + /** HealthCheck _grpcHealthCheck. */ + public _grpcHealthCheck?: "grpcHealthCheck"; + + /** HealthCheck _healthyThreshold. */ + public _healthyThreshold?: "healthyThreshold"; + + /** HealthCheck _http2HealthCheck. */ + public _http2HealthCheck?: "http2HealthCheck"; + + /** HealthCheck _httpHealthCheck. */ + public _httpHealthCheck?: "httpHealthCheck"; + + /** HealthCheck _httpsHealthCheck. */ + public _httpsHealthCheck?: "httpsHealthCheck"; + + /** HealthCheck _id. */ + public _id?: "id"; + + /** HealthCheck _kind. */ + public _kind?: "kind"; + + /** HealthCheck _logConfig. */ + public _logConfig?: "logConfig"; + + /** HealthCheck _name. */ + public _name?: "name"; + + /** HealthCheck _region. */ + public _region?: "region"; + + /** HealthCheck _selfLink. */ + public _selfLink?: "selfLink"; + + /** HealthCheck _sslHealthCheck. */ + public _sslHealthCheck?: "sslHealthCheck"; + + /** HealthCheck _tcpHealthCheck. */ + public _tcpHealthCheck?: "tcpHealthCheck"; + + /** HealthCheck _timeoutSec. */ + public _timeoutSec?: "timeoutSec"; + + /** HealthCheck _type. */ + public _type?: "type"; + + /** HealthCheck _unhealthyThreshold. */ + public _unhealthyThreshold?: "unhealthyThreshold"; + + /** + * Creates a new HealthCheck instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheck instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthCheck): google.cloud.compute.v1.HealthCheck; + + /** + * Encodes the specified HealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HealthCheck.verify|verify} messages. + * @param message HealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheck.verify|verify} messages. + * @param message HealthCheck message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthCheck, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheck message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthCheck; + + /** + * Decodes a HealthCheck message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthCheck; + + /** + * Verifies a HealthCheck message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheck message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheck + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthCheck; + + /** + * Creates a plain object from a HealthCheck message. Also converts values to other types if specified. + * @param message HealthCheck + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthCheck, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheck to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HealthCheck { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + GRPC = 2196510, + HTTP = 2228360, + HTTP2 = 69079210, + HTTPS = 69079243, + INVALID = 530283991, + SSL = 82412, + TCP = 82881 + } + } + + /** Properties of a HealthCheckList. */ + interface IHealthCheckList { + + /** HealthCheckList id */ + id?: (string|null); + + /** HealthCheckList items */ + items?: (google.cloud.compute.v1.IHealthCheck[]|null); + + /** HealthCheckList kind */ + kind?: (string|null); + + /** HealthCheckList nextPageToken */ + nextPageToken?: (string|null); + + /** HealthCheckList selfLink */ + selfLink?: (string|null); + + /** HealthCheckList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a HealthCheckList. */ + class HealthCheckList implements IHealthCheckList { + + /** + * Constructs a new HealthCheckList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthCheckList); + + /** HealthCheckList id. */ + public id?: (string|null); + + /** HealthCheckList items. */ + public items: google.cloud.compute.v1.IHealthCheck[]; + + /** HealthCheckList kind. */ + public kind?: (string|null); + + /** HealthCheckList nextPageToken. */ + public nextPageToken?: (string|null); + + /** HealthCheckList selfLink. */ + public selfLink?: (string|null); + + /** HealthCheckList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** HealthCheckList _id. */ + public _id?: "id"; + + /** HealthCheckList _kind. */ + public _kind?: "kind"; + + /** HealthCheckList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** HealthCheckList _selfLink. */ + public _selfLink?: "selfLink"; + + /** HealthCheckList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new HealthCheckList instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheckList instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthCheckList): google.cloud.compute.v1.HealthCheckList; + + /** + * Encodes the specified HealthCheckList message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckList.verify|verify} messages. + * @param message HealthCheckList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthCheckList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheckList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckList.verify|verify} messages. + * @param message HealthCheckList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthCheckList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheckList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheckList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthCheckList; + + /** + * Decodes a HealthCheckList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheckList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthCheckList; + + /** + * Verifies a HealthCheckList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheckList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheckList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthCheckList; + + /** + * Creates a plain object from a HealthCheckList message. Also converts values to other types if specified. + * @param message HealthCheckList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthCheckList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheckList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HealthCheckReference. */ + interface IHealthCheckReference { + + /** HealthCheckReference healthCheck */ + healthCheck?: (string|null); + } + + /** Represents a HealthCheckReference. */ + class HealthCheckReference implements IHealthCheckReference { + + /** + * Constructs a new HealthCheckReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthCheckReference); + + /** HealthCheckReference healthCheck. */ + public healthCheck?: (string|null); + + /** HealthCheckReference _healthCheck. */ + public _healthCheck?: "healthCheck"; + + /** + * Creates a new HealthCheckReference instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheckReference instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthCheckReference): google.cloud.compute.v1.HealthCheckReference; + + /** + * Encodes the specified HealthCheckReference message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckReference.verify|verify} messages. + * @param message HealthCheckReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthCheckReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheckReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckReference.verify|verify} messages. + * @param message HealthCheckReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthCheckReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheckReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheckReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthCheckReference; + + /** + * Decodes a HealthCheckReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheckReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthCheckReference; + + /** + * Verifies a HealthCheckReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheckReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheckReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthCheckReference; + + /** + * Creates a plain object from a HealthCheckReference message. Also converts values to other types if specified. + * @param message HealthCheckReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthCheckReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheckReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HealthCheckService. */ + interface IHealthCheckService { + + /** HealthCheckService creationTimestamp */ + creationTimestamp?: (string|null); + + /** HealthCheckService description */ + description?: (string|null); + + /** HealthCheckService fingerprint */ + fingerprint?: (string|null); + + /** HealthCheckService healthChecks */ + healthChecks?: (string[]|null); + + /** HealthCheckService healthStatusAggregationPolicy */ + healthStatusAggregationPolicy?: (google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy|keyof typeof google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy|null); + + /** HealthCheckService id */ + id?: (number|Long|string|null); + + /** HealthCheckService kind */ + kind?: (string|null); + + /** HealthCheckService name */ + name?: (string|null); + + /** HealthCheckService networkEndpointGroups */ + networkEndpointGroups?: (string[]|null); + + /** HealthCheckService notificationEndpoints */ + notificationEndpoints?: (string[]|null); + + /** HealthCheckService region */ + region?: (string|null); + + /** HealthCheckService selfLink */ + selfLink?: (string|null); + } + + /** Represents a HealthCheckService. */ + class HealthCheckService implements IHealthCheckService { + + /** + * Constructs a new HealthCheckService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthCheckService); + + /** HealthCheckService creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** HealthCheckService description. */ + public description?: (string|null); + + /** HealthCheckService fingerprint. */ + public fingerprint?: (string|null); + + /** HealthCheckService healthChecks. */ + public healthChecks: string[]; + + /** HealthCheckService healthStatusAggregationPolicy. */ + public healthStatusAggregationPolicy?: (google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy|keyof typeof google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy|null); + + /** HealthCheckService id. */ + public id?: (number|Long|string|null); + + /** HealthCheckService kind. */ + public kind?: (string|null); + + /** HealthCheckService name. */ + public name?: (string|null); + + /** HealthCheckService networkEndpointGroups. */ + public networkEndpointGroups: string[]; + + /** HealthCheckService notificationEndpoints. */ + public notificationEndpoints: string[]; + + /** HealthCheckService region. */ + public region?: (string|null); + + /** HealthCheckService selfLink. */ + public selfLink?: (string|null); + + /** HealthCheckService _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** HealthCheckService _description. */ + public _description?: "description"; + + /** HealthCheckService _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** HealthCheckService _healthStatusAggregationPolicy. */ + public _healthStatusAggregationPolicy?: "healthStatusAggregationPolicy"; + + /** HealthCheckService _id. */ + public _id?: "id"; + + /** HealthCheckService _kind. */ + public _kind?: "kind"; + + /** HealthCheckService _name. */ + public _name?: "name"; + + /** HealthCheckService _region. */ + public _region?: "region"; + + /** HealthCheckService _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new HealthCheckService instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheckService instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthCheckService): google.cloud.compute.v1.HealthCheckService; + + /** + * Encodes the specified HealthCheckService message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckService.verify|verify} messages. + * @param message HealthCheckService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthCheckService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheckService message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckService.verify|verify} messages. + * @param message HealthCheckService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthCheckService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheckService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheckService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthCheckService; + + /** + * Decodes a HealthCheckService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheckService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthCheckService; + + /** + * Verifies a HealthCheckService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheckService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheckService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthCheckService; + + /** + * Creates a plain object from a HealthCheckService message. Also converts values to other types if specified. + * @param message HealthCheckService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthCheckService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheckService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HealthCheckService { + + /** HealthStatusAggregationPolicy enum. */ + enum HealthStatusAggregationPolicy { + UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY = 0, + AND = 64951, + NO_AGGREGATION = 426445124 + } + } + + /** Properties of a HealthCheckServiceReference. */ + interface IHealthCheckServiceReference { + + /** HealthCheckServiceReference healthCheckService */ + healthCheckService?: (string|null); + } + + /** Represents a HealthCheckServiceReference. */ + class HealthCheckServiceReference implements IHealthCheckServiceReference { + + /** + * Constructs a new HealthCheckServiceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthCheckServiceReference); + + /** HealthCheckServiceReference healthCheckService. */ + public healthCheckService?: (string|null); + + /** HealthCheckServiceReference _healthCheckService. */ + public _healthCheckService?: "healthCheckService"; + + /** + * Creates a new HealthCheckServiceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheckServiceReference instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthCheckServiceReference): google.cloud.compute.v1.HealthCheckServiceReference; + + /** + * Encodes the specified HealthCheckServiceReference message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServiceReference.verify|verify} messages. + * @param message HealthCheckServiceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthCheckServiceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheckServiceReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServiceReference.verify|verify} messages. + * @param message HealthCheckServiceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthCheckServiceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheckServiceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheckServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthCheckServiceReference; + + /** + * Decodes a HealthCheckServiceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheckServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthCheckServiceReference; + + /** + * Verifies a HealthCheckServiceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheckServiceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheckServiceReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthCheckServiceReference; + + /** + * Creates a plain object from a HealthCheckServiceReference message. Also converts values to other types if specified. + * @param message HealthCheckServiceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthCheckServiceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheckServiceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HealthCheckServicesList. */ + interface IHealthCheckServicesList { + + /** HealthCheckServicesList id */ + id?: (string|null); + + /** HealthCheckServicesList items */ + items?: (google.cloud.compute.v1.IHealthCheckService[]|null); + + /** HealthCheckServicesList kind */ + kind?: (string|null); + + /** HealthCheckServicesList nextPageToken */ + nextPageToken?: (string|null); + + /** HealthCheckServicesList selfLink */ + selfLink?: (string|null); + + /** HealthCheckServicesList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a HealthCheckServicesList. */ + class HealthCheckServicesList implements IHealthCheckServicesList { + + /** + * Constructs a new HealthCheckServicesList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthCheckServicesList); + + /** HealthCheckServicesList id. */ + public id?: (string|null); + + /** HealthCheckServicesList items. */ + public items: google.cloud.compute.v1.IHealthCheckService[]; + + /** HealthCheckServicesList kind. */ + public kind?: (string|null); + + /** HealthCheckServicesList nextPageToken. */ + public nextPageToken?: (string|null); + + /** HealthCheckServicesList selfLink. */ + public selfLink?: (string|null); + + /** HealthCheckServicesList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** HealthCheckServicesList _id. */ + public _id?: "id"; + + /** HealthCheckServicesList _kind. */ + public _kind?: "kind"; + + /** HealthCheckServicesList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** HealthCheckServicesList _selfLink. */ + public _selfLink?: "selfLink"; + + /** HealthCheckServicesList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new HealthCheckServicesList instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthCheckServicesList instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthCheckServicesList): google.cloud.compute.v1.HealthCheckServicesList; + + /** + * Encodes the specified HealthCheckServicesList message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServicesList.verify|verify} messages. + * @param message HealthCheckServicesList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthCheckServicesList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthCheckServicesList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServicesList.verify|verify} messages. + * @param message HealthCheckServicesList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthCheckServicesList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthCheckServicesList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthCheckServicesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthCheckServicesList; + + /** + * Decodes a HealthCheckServicesList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthCheckServicesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthCheckServicesList; + + /** + * Verifies a HealthCheckServicesList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthCheckServicesList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthCheckServicesList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthCheckServicesList; + + /** + * Creates a plain object from a HealthCheckServicesList message. Also converts values to other types if specified. + * @param message HealthCheckServicesList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthCheckServicesList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthCheckServicesList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HealthChecksScopedList. */ + interface IHealthChecksScopedList { + + /** HealthChecksScopedList healthChecks */ + healthChecks?: (google.cloud.compute.v1.IHealthCheck[]|null); + + /** HealthChecksScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a HealthChecksScopedList. */ + class HealthChecksScopedList implements IHealthChecksScopedList { + + /** + * Constructs a new HealthChecksScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthChecksScopedList); + + /** HealthChecksScopedList healthChecks. */ + public healthChecks: google.cloud.compute.v1.IHealthCheck[]; + + /** HealthChecksScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** HealthChecksScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new HealthChecksScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthChecksScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthChecksScopedList): google.cloud.compute.v1.HealthChecksScopedList; + + /** + * Encodes the specified HealthChecksScopedList message. Does not implicitly {@link google.cloud.compute.v1.HealthChecksScopedList.verify|verify} messages. + * @param message HealthChecksScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthChecksScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthChecksScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthChecksScopedList.verify|verify} messages. + * @param message HealthChecksScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthChecksScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthChecksScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthChecksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthChecksScopedList; + + /** + * Decodes a HealthChecksScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthChecksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthChecksScopedList; + + /** + * Verifies a HealthChecksScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthChecksScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthChecksScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthChecksScopedList; + + /** + * Creates a plain object from a HealthChecksScopedList message. Also converts values to other types if specified. + * @param message HealthChecksScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthChecksScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthChecksScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HealthChecksAggregatedList. */ + interface IHealthChecksAggregatedList { + + /** HealthChecksAggregatedList id */ + id?: (string|null); + + /** HealthChecksAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IHealthChecksScopedList }|null); + + /** HealthChecksAggregatedList kind */ + kind?: (string|null); + + /** HealthChecksAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** HealthChecksAggregatedList selfLink */ + selfLink?: (string|null); + + /** HealthChecksAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** HealthChecksAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a HealthChecksAggregatedList. */ + class HealthChecksAggregatedList implements IHealthChecksAggregatedList { + + /** + * Constructs a new HealthChecksAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthChecksAggregatedList); + + /** HealthChecksAggregatedList id. */ + public id?: (string|null); + + /** HealthChecksAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IHealthChecksScopedList }; + + /** HealthChecksAggregatedList kind. */ + public kind?: (string|null); + + /** HealthChecksAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** HealthChecksAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** HealthChecksAggregatedList unreachables. */ + public unreachables: string[]; + + /** HealthChecksAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** HealthChecksAggregatedList _id. */ + public _id?: "id"; + + /** HealthChecksAggregatedList _kind. */ + public _kind?: "kind"; + + /** HealthChecksAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** HealthChecksAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** HealthChecksAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new HealthChecksAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthChecksAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthChecksAggregatedList): google.cloud.compute.v1.HealthChecksAggregatedList; + + /** + * Encodes the specified HealthChecksAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.HealthChecksAggregatedList.verify|verify} messages. + * @param message HealthChecksAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthChecksAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthChecksAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthChecksAggregatedList.verify|verify} messages. + * @param message HealthChecksAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthChecksAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthChecksAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthChecksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthChecksAggregatedList; + + /** + * Decodes a HealthChecksAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthChecksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthChecksAggregatedList; + + /** + * Verifies a HealthChecksAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthChecksAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthChecksAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthChecksAggregatedList; + + /** + * Creates a plain object from a HealthChecksAggregatedList message. Also converts values to other types if specified. + * @param message HealthChecksAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthChecksAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthChecksAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HealthStatusForNetworkEndpoint. */ + interface IHealthStatusForNetworkEndpoint { + + /** HealthStatusForNetworkEndpoint backendService */ + backendService?: (google.cloud.compute.v1.IBackendServiceReference|null); + + /** HealthStatusForNetworkEndpoint forwardingRule */ + forwardingRule?: (google.cloud.compute.v1.IForwardingRuleReference|null); + + /** HealthStatusForNetworkEndpoint healthCheck */ + healthCheck?: (google.cloud.compute.v1.IHealthCheckReference|null); + + /** HealthStatusForNetworkEndpoint healthCheckService */ + healthCheckService?: (google.cloud.compute.v1.IHealthCheckServiceReference|null); + + /** HealthStatusForNetworkEndpoint healthState */ + healthState?: (google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState|keyof typeof google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState|null); + } + + /** Represents a HealthStatusForNetworkEndpoint. */ + class HealthStatusForNetworkEndpoint implements IHealthStatusForNetworkEndpoint { + + /** + * Constructs a new HealthStatusForNetworkEndpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHealthStatusForNetworkEndpoint); + + /** HealthStatusForNetworkEndpoint backendService. */ + public backendService?: (google.cloud.compute.v1.IBackendServiceReference|null); + + /** HealthStatusForNetworkEndpoint forwardingRule. */ + public forwardingRule?: (google.cloud.compute.v1.IForwardingRuleReference|null); + + /** HealthStatusForNetworkEndpoint healthCheck. */ + public healthCheck?: (google.cloud.compute.v1.IHealthCheckReference|null); + + /** HealthStatusForNetworkEndpoint healthCheckService. */ + public healthCheckService?: (google.cloud.compute.v1.IHealthCheckServiceReference|null); + + /** HealthStatusForNetworkEndpoint healthState. */ + public healthState?: (google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState|keyof typeof google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState|null); + + /** HealthStatusForNetworkEndpoint _backendService. */ + public _backendService?: "backendService"; + + /** HealthStatusForNetworkEndpoint _forwardingRule. */ + public _forwardingRule?: "forwardingRule"; + + /** HealthStatusForNetworkEndpoint _healthCheck. */ + public _healthCheck?: "healthCheck"; + + /** HealthStatusForNetworkEndpoint _healthCheckService. */ + public _healthCheckService?: "healthCheckService"; + + /** HealthStatusForNetworkEndpoint _healthState. */ + public _healthState?: "healthState"; + + /** + * Creates a new HealthStatusForNetworkEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns HealthStatusForNetworkEndpoint instance + */ + public static create(properties?: google.cloud.compute.v1.IHealthStatusForNetworkEndpoint): google.cloud.compute.v1.HealthStatusForNetworkEndpoint; + + /** + * Encodes the specified HealthStatusForNetworkEndpoint message. Does not implicitly {@link google.cloud.compute.v1.HealthStatusForNetworkEndpoint.verify|verify} messages. + * @param message HealthStatusForNetworkEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHealthStatusForNetworkEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HealthStatusForNetworkEndpoint message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthStatusForNetworkEndpoint.verify|verify} messages. + * @param message HealthStatusForNetworkEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHealthStatusForNetworkEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HealthStatusForNetworkEndpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HealthStatusForNetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HealthStatusForNetworkEndpoint; + + /** + * Decodes a HealthStatusForNetworkEndpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HealthStatusForNetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HealthStatusForNetworkEndpoint; + + /** + * Verifies a HealthStatusForNetworkEndpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HealthStatusForNetworkEndpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HealthStatusForNetworkEndpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HealthStatusForNetworkEndpoint; + + /** + * Creates a plain object from a HealthStatusForNetworkEndpoint message. Also converts values to other types if specified. + * @param message HealthStatusForNetworkEndpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HealthStatusForNetworkEndpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HealthStatusForNetworkEndpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HealthStatusForNetworkEndpoint { + + /** HealthState enum. */ + enum HealthState { + UNDEFINED_HEALTH_STATE = 0, + DRAINING = 480455402, + HEALTHY = 439801213, + UNHEALTHY = 462118084, + UNKNOWN = 433141802 + } + } + + /** Properties of a HostRule. */ + interface IHostRule { + + /** HostRule description */ + description?: (string|null); + + /** HostRule hosts */ + hosts?: (string[]|null); + + /** HostRule pathMatcher */ + pathMatcher?: (string|null); + } + + /** Represents a HostRule. */ + class HostRule implements IHostRule { + + /** + * Constructs a new HostRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHostRule); + + /** HostRule description. */ + public description?: (string|null); + + /** HostRule hosts. */ + public hosts: string[]; + + /** HostRule pathMatcher. */ + public pathMatcher?: (string|null); + + /** HostRule _description. */ + public _description?: "description"; + + /** HostRule _pathMatcher. */ + public _pathMatcher?: "pathMatcher"; + + /** + * Creates a new HostRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HostRule instance + */ + public static create(properties?: google.cloud.compute.v1.IHostRule): google.cloud.compute.v1.HostRule; + + /** + * Encodes the specified HostRule message. Does not implicitly {@link google.cloud.compute.v1.HostRule.verify|verify} messages. + * @param message HostRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHostRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HostRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HostRule.verify|verify} messages. + * @param message HostRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHostRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HostRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HostRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HostRule; + + /** + * Decodes a HostRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HostRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HostRule; + + /** + * Verifies a HostRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HostRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HostRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HostRule; + + /** + * Creates a plain object from a HostRule message. Also converts values to other types if specified. + * @param message HostRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HostRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HostRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpFaultAbort. */ + interface IHttpFaultAbort { + + /** HttpFaultAbort httpStatus */ + httpStatus?: (number|null); + + /** HttpFaultAbort percentage */ + percentage?: (number|null); + } + + /** Represents a HttpFaultAbort. */ + class HttpFaultAbort implements IHttpFaultAbort { + + /** + * Constructs a new HttpFaultAbort. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpFaultAbort); + + /** HttpFaultAbort httpStatus. */ + public httpStatus?: (number|null); + + /** HttpFaultAbort percentage. */ + public percentage?: (number|null); + + /** HttpFaultAbort _httpStatus. */ + public _httpStatus?: "httpStatus"; + + /** HttpFaultAbort _percentage. */ + public _percentage?: "percentage"; + + /** + * Creates a new HttpFaultAbort instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpFaultAbort instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpFaultAbort): google.cloud.compute.v1.HttpFaultAbort; + + /** + * Encodes the specified HttpFaultAbort message. Does not implicitly {@link google.cloud.compute.v1.HttpFaultAbort.verify|verify} messages. + * @param message HttpFaultAbort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpFaultAbort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpFaultAbort message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpFaultAbort.verify|verify} messages. + * @param message HttpFaultAbort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpFaultAbort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpFaultAbort message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpFaultAbort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpFaultAbort; + + /** + * Decodes a HttpFaultAbort message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpFaultAbort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpFaultAbort; + + /** + * Verifies a HttpFaultAbort message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpFaultAbort message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpFaultAbort + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpFaultAbort; + + /** + * Creates a plain object from a HttpFaultAbort message. Also converts values to other types if specified. + * @param message HttpFaultAbort + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpFaultAbort, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpFaultAbort to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpFaultDelay. */ + interface IHttpFaultDelay { + + /** HttpFaultDelay fixedDelay */ + fixedDelay?: (google.cloud.compute.v1.IDuration|null); + + /** HttpFaultDelay percentage */ + percentage?: (number|null); + } + + /** Represents a HttpFaultDelay. */ + class HttpFaultDelay implements IHttpFaultDelay { + + /** + * Constructs a new HttpFaultDelay. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpFaultDelay); + + /** HttpFaultDelay fixedDelay. */ + public fixedDelay?: (google.cloud.compute.v1.IDuration|null); + + /** HttpFaultDelay percentage. */ + public percentage?: (number|null); + + /** HttpFaultDelay _fixedDelay. */ + public _fixedDelay?: "fixedDelay"; + + /** HttpFaultDelay _percentage. */ + public _percentage?: "percentage"; + + /** + * Creates a new HttpFaultDelay instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpFaultDelay instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpFaultDelay): google.cloud.compute.v1.HttpFaultDelay; + + /** + * Encodes the specified HttpFaultDelay message. Does not implicitly {@link google.cloud.compute.v1.HttpFaultDelay.verify|verify} messages. + * @param message HttpFaultDelay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpFaultDelay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpFaultDelay message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpFaultDelay.verify|verify} messages. + * @param message HttpFaultDelay message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpFaultDelay, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpFaultDelay message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpFaultDelay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpFaultDelay; + + /** + * Decodes a HttpFaultDelay message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpFaultDelay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpFaultDelay; + + /** + * Verifies a HttpFaultDelay message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpFaultDelay message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpFaultDelay + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpFaultDelay; + + /** + * Creates a plain object from a HttpFaultDelay message. Also converts values to other types if specified. + * @param message HttpFaultDelay + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpFaultDelay, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpFaultDelay to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpFaultInjection. */ + interface IHttpFaultInjection { + + /** HttpFaultInjection abort */ + abort?: (google.cloud.compute.v1.IHttpFaultAbort|null); + + /** HttpFaultInjection delay */ + delay?: (google.cloud.compute.v1.IHttpFaultDelay|null); + } + + /** Represents a HttpFaultInjection. */ + class HttpFaultInjection implements IHttpFaultInjection { + + /** + * Constructs a new HttpFaultInjection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpFaultInjection); + + /** HttpFaultInjection abort. */ + public abort?: (google.cloud.compute.v1.IHttpFaultAbort|null); + + /** HttpFaultInjection delay. */ + public delay?: (google.cloud.compute.v1.IHttpFaultDelay|null); + + /** HttpFaultInjection _abort. */ + public _abort?: "abort"; + + /** HttpFaultInjection _delay. */ + public _delay?: "delay"; + + /** + * Creates a new HttpFaultInjection instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpFaultInjection instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpFaultInjection): google.cloud.compute.v1.HttpFaultInjection; + + /** + * Encodes the specified HttpFaultInjection message. Does not implicitly {@link google.cloud.compute.v1.HttpFaultInjection.verify|verify} messages. + * @param message HttpFaultInjection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpFaultInjection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpFaultInjection message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpFaultInjection.verify|verify} messages. + * @param message HttpFaultInjection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpFaultInjection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpFaultInjection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpFaultInjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpFaultInjection; + + /** + * Decodes a HttpFaultInjection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpFaultInjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpFaultInjection; + + /** + * Verifies a HttpFaultInjection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpFaultInjection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpFaultInjection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpFaultInjection; + + /** + * Creates a plain object from a HttpFaultInjection message. Also converts values to other types if specified. + * @param message HttpFaultInjection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpFaultInjection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpFaultInjection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpHeaderOption. */ + interface IHttpHeaderOption { + + /** HttpHeaderOption headerName */ + headerName?: (string|null); + + /** HttpHeaderOption headerValue */ + headerValue?: (string|null); + + /** HttpHeaderOption replace */ + replace?: (boolean|null); + } + + /** Represents a HttpHeaderOption. */ + class HttpHeaderOption implements IHttpHeaderOption { + + /** + * Constructs a new HttpHeaderOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpHeaderOption); + + /** HttpHeaderOption headerName. */ + public headerName?: (string|null); + + /** HttpHeaderOption headerValue. */ + public headerValue?: (string|null); + + /** HttpHeaderOption replace. */ + public replace?: (boolean|null); + + /** HttpHeaderOption _headerName. */ + public _headerName?: "headerName"; + + /** HttpHeaderOption _headerValue. */ + public _headerValue?: "headerValue"; + + /** HttpHeaderOption _replace. */ + public _replace?: "replace"; + + /** + * Creates a new HttpHeaderOption instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpHeaderOption instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpHeaderOption): google.cloud.compute.v1.HttpHeaderOption; + + /** + * Encodes the specified HttpHeaderOption message. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderOption.verify|verify} messages. + * @param message HttpHeaderOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpHeaderOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpHeaderOption message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderOption.verify|verify} messages. + * @param message HttpHeaderOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpHeaderOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpHeaderOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpHeaderOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpHeaderOption; + + /** + * Decodes a HttpHeaderOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpHeaderOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpHeaderOption; + + /** + * Verifies a HttpHeaderOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpHeaderOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpHeaderOption + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpHeaderOption; + + /** + * Creates a plain object from a HttpHeaderOption message. Also converts values to other types if specified. + * @param message HttpHeaderOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpHeaderOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpHeaderOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpHeaderAction. */ + interface IHttpHeaderAction { + + /** HttpHeaderAction requestHeadersToAdd */ + requestHeadersToAdd?: (google.cloud.compute.v1.IHttpHeaderOption[]|null); + + /** HttpHeaderAction requestHeadersToRemove */ + requestHeadersToRemove?: (string[]|null); + + /** HttpHeaderAction responseHeadersToAdd */ + responseHeadersToAdd?: (google.cloud.compute.v1.IHttpHeaderOption[]|null); + + /** HttpHeaderAction responseHeadersToRemove */ + responseHeadersToRemove?: (string[]|null); + } + + /** Represents a HttpHeaderAction. */ + class HttpHeaderAction implements IHttpHeaderAction { + + /** + * Constructs a new HttpHeaderAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpHeaderAction); + + /** HttpHeaderAction requestHeadersToAdd. */ + public requestHeadersToAdd: google.cloud.compute.v1.IHttpHeaderOption[]; + + /** HttpHeaderAction requestHeadersToRemove. */ + public requestHeadersToRemove: string[]; + + /** HttpHeaderAction responseHeadersToAdd. */ + public responseHeadersToAdd: google.cloud.compute.v1.IHttpHeaderOption[]; + + /** HttpHeaderAction responseHeadersToRemove. */ + public responseHeadersToRemove: string[]; + + /** + * Creates a new HttpHeaderAction instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpHeaderAction instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpHeaderAction): google.cloud.compute.v1.HttpHeaderAction; + + /** + * Encodes the specified HttpHeaderAction message. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderAction.verify|verify} messages. + * @param message HttpHeaderAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpHeaderAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpHeaderAction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderAction.verify|verify} messages. + * @param message HttpHeaderAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpHeaderAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpHeaderAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpHeaderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpHeaderAction; + + /** + * Decodes a HttpHeaderAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpHeaderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpHeaderAction; + + /** + * Verifies a HttpHeaderAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpHeaderAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpHeaderAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpHeaderAction; + + /** + * Creates a plain object from a HttpHeaderAction message. Also converts values to other types if specified. + * @param message HttpHeaderAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpHeaderAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpHeaderAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int64RangeMatch. */ + interface IInt64RangeMatch { + + /** Int64RangeMatch rangeEnd */ + rangeEnd?: (number|Long|string|null); + + /** Int64RangeMatch rangeStart */ + rangeStart?: (number|Long|string|null); + } + + /** Represents an Int64RangeMatch. */ + class Int64RangeMatch implements IInt64RangeMatch { + + /** + * Constructs a new Int64RangeMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInt64RangeMatch); + + /** Int64RangeMatch rangeEnd. */ + public rangeEnd?: (number|Long|string|null); + + /** Int64RangeMatch rangeStart. */ + public rangeStart?: (number|Long|string|null); + + /** Int64RangeMatch _rangeEnd. */ + public _rangeEnd?: "rangeEnd"; + + /** Int64RangeMatch _rangeStart. */ + public _rangeStart?: "rangeStart"; + + /** + * Creates a new Int64RangeMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64RangeMatch instance + */ + public static create(properties?: google.cloud.compute.v1.IInt64RangeMatch): google.cloud.compute.v1.Int64RangeMatch; + + /** + * Encodes the specified Int64RangeMatch message. Does not implicitly {@link google.cloud.compute.v1.Int64RangeMatch.verify|verify} messages. + * @param message Int64RangeMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInt64RangeMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64RangeMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Int64RangeMatch.verify|verify} messages. + * @param message Int64RangeMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInt64RangeMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64RangeMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64RangeMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Int64RangeMatch; + + /** + * Decodes an Int64RangeMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64RangeMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Int64RangeMatch; + + /** + * Verifies an Int64RangeMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64RangeMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64RangeMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Int64RangeMatch; + + /** + * Creates a plain object from an Int64RangeMatch message. Also converts values to other types if specified. + * @param message Int64RangeMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Int64RangeMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64RangeMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpHeaderMatch. */ + interface IHttpHeaderMatch { + + /** HttpHeaderMatch exactMatch */ + exactMatch?: (string|null); + + /** HttpHeaderMatch headerName */ + headerName?: (string|null); + + /** HttpHeaderMatch invertMatch */ + invertMatch?: (boolean|null); + + /** HttpHeaderMatch prefixMatch */ + prefixMatch?: (string|null); + + /** HttpHeaderMatch presentMatch */ + presentMatch?: (boolean|null); + + /** HttpHeaderMatch rangeMatch */ + rangeMatch?: (google.cloud.compute.v1.IInt64RangeMatch|null); + + /** HttpHeaderMatch regexMatch */ + regexMatch?: (string|null); + + /** HttpHeaderMatch suffixMatch */ + suffixMatch?: (string|null); + } + + /** Represents a HttpHeaderMatch. */ + class HttpHeaderMatch implements IHttpHeaderMatch { + + /** + * Constructs a new HttpHeaderMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpHeaderMatch); + + /** HttpHeaderMatch exactMatch. */ + public exactMatch?: (string|null); + + /** HttpHeaderMatch headerName. */ + public headerName?: (string|null); + + /** HttpHeaderMatch invertMatch. */ + public invertMatch?: (boolean|null); + + /** HttpHeaderMatch prefixMatch. */ + public prefixMatch?: (string|null); + + /** HttpHeaderMatch presentMatch. */ + public presentMatch?: (boolean|null); + + /** HttpHeaderMatch rangeMatch. */ + public rangeMatch?: (google.cloud.compute.v1.IInt64RangeMatch|null); + + /** HttpHeaderMatch regexMatch. */ + public regexMatch?: (string|null); + + /** HttpHeaderMatch suffixMatch. */ + public suffixMatch?: (string|null); + + /** HttpHeaderMatch _exactMatch. */ + public _exactMatch?: "exactMatch"; + + /** HttpHeaderMatch _headerName. */ + public _headerName?: "headerName"; + + /** HttpHeaderMatch _invertMatch. */ + public _invertMatch?: "invertMatch"; + + /** HttpHeaderMatch _prefixMatch. */ + public _prefixMatch?: "prefixMatch"; + + /** HttpHeaderMatch _presentMatch. */ + public _presentMatch?: "presentMatch"; + + /** HttpHeaderMatch _rangeMatch. */ + public _rangeMatch?: "rangeMatch"; + + /** HttpHeaderMatch _regexMatch. */ + public _regexMatch?: "regexMatch"; + + /** HttpHeaderMatch _suffixMatch. */ + public _suffixMatch?: "suffixMatch"; + + /** + * Creates a new HttpHeaderMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpHeaderMatch instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpHeaderMatch): google.cloud.compute.v1.HttpHeaderMatch; + + /** + * Encodes the specified HttpHeaderMatch message. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderMatch.verify|verify} messages. + * @param message HttpHeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpHeaderMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderMatch.verify|verify} messages. + * @param message HttpHeaderMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpHeaderMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpHeaderMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpHeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpHeaderMatch; + + /** + * Decodes a HttpHeaderMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpHeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpHeaderMatch; + + /** + * Verifies a HttpHeaderMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpHeaderMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpHeaderMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpHeaderMatch; + + /** + * Creates a plain object from a HttpHeaderMatch message. Also converts values to other types if specified. + * @param message HttpHeaderMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpHeaderMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpHeaderMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpQueryParameterMatch. */ + interface IHttpQueryParameterMatch { + + /** HttpQueryParameterMatch exactMatch */ + exactMatch?: (string|null); + + /** HttpQueryParameterMatch name */ + name?: (string|null); + + /** HttpQueryParameterMatch presentMatch */ + presentMatch?: (boolean|null); + + /** HttpQueryParameterMatch regexMatch */ + regexMatch?: (string|null); + } + + /** Represents a HttpQueryParameterMatch. */ + class HttpQueryParameterMatch implements IHttpQueryParameterMatch { + + /** + * Constructs a new HttpQueryParameterMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpQueryParameterMatch); + + /** HttpQueryParameterMatch exactMatch. */ + public exactMatch?: (string|null); + + /** HttpQueryParameterMatch name. */ + public name?: (string|null); + + /** HttpQueryParameterMatch presentMatch. */ + public presentMatch?: (boolean|null); + + /** HttpQueryParameterMatch regexMatch. */ + public regexMatch?: (string|null); + + /** HttpQueryParameterMatch _exactMatch. */ + public _exactMatch?: "exactMatch"; + + /** HttpQueryParameterMatch _name. */ + public _name?: "name"; + + /** HttpQueryParameterMatch _presentMatch. */ + public _presentMatch?: "presentMatch"; + + /** HttpQueryParameterMatch _regexMatch. */ + public _regexMatch?: "regexMatch"; + + /** + * Creates a new HttpQueryParameterMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpQueryParameterMatch instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpQueryParameterMatch): google.cloud.compute.v1.HttpQueryParameterMatch; + + /** + * Encodes the specified HttpQueryParameterMatch message. Does not implicitly {@link google.cloud.compute.v1.HttpQueryParameterMatch.verify|verify} messages. + * @param message HttpQueryParameterMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpQueryParameterMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpQueryParameterMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpQueryParameterMatch.verify|verify} messages. + * @param message HttpQueryParameterMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpQueryParameterMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpQueryParameterMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpQueryParameterMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpQueryParameterMatch; + + /** + * Decodes a HttpQueryParameterMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpQueryParameterMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpQueryParameterMatch; + + /** + * Verifies a HttpQueryParameterMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpQueryParameterMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpQueryParameterMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpQueryParameterMatch; + + /** + * Creates a plain object from a HttpQueryParameterMatch message. Also converts values to other types if specified. + * @param message HttpQueryParameterMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpQueryParameterMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpQueryParameterMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRedirectAction. */ + interface IHttpRedirectAction { + + /** HttpRedirectAction hostRedirect */ + hostRedirect?: (string|null); + + /** HttpRedirectAction httpsRedirect */ + httpsRedirect?: (boolean|null); + + /** HttpRedirectAction pathRedirect */ + pathRedirect?: (string|null); + + /** HttpRedirectAction prefixRedirect */ + prefixRedirect?: (string|null); + + /** HttpRedirectAction redirectResponseCode */ + redirectResponseCode?: (google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode|keyof typeof google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode|null); + + /** HttpRedirectAction stripQuery */ + stripQuery?: (boolean|null); + } + + /** Represents a HttpRedirectAction. */ + class HttpRedirectAction implements IHttpRedirectAction { + + /** + * Constructs a new HttpRedirectAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpRedirectAction); + + /** HttpRedirectAction hostRedirect. */ + public hostRedirect?: (string|null); + + /** HttpRedirectAction httpsRedirect. */ + public httpsRedirect?: (boolean|null); + + /** HttpRedirectAction pathRedirect. */ + public pathRedirect?: (string|null); + + /** HttpRedirectAction prefixRedirect. */ + public prefixRedirect?: (string|null); + + /** HttpRedirectAction redirectResponseCode. */ + public redirectResponseCode?: (google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode|keyof typeof google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode|null); + + /** HttpRedirectAction stripQuery. */ + public stripQuery?: (boolean|null); + + /** HttpRedirectAction _hostRedirect. */ + public _hostRedirect?: "hostRedirect"; + + /** HttpRedirectAction _httpsRedirect. */ + public _httpsRedirect?: "httpsRedirect"; + + /** HttpRedirectAction _pathRedirect. */ + public _pathRedirect?: "pathRedirect"; + + /** HttpRedirectAction _prefixRedirect. */ + public _prefixRedirect?: "prefixRedirect"; + + /** HttpRedirectAction _redirectResponseCode. */ + public _redirectResponseCode?: "redirectResponseCode"; + + /** HttpRedirectAction _stripQuery. */ + public _stripQuery?: "stripQuery"; + + /** + * Creates a new HttpRedirectAction instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRedirectAction instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpRedirectAction): google.cloud.compute.v1.HttpRedirectAction; + + /** + * Encodes the specified HttpRedirectAction message. Does not implicitly {@link google.cloud.compute.v1.HttpRedirectAction.verify|verify} messages. + * @param message HttpRedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRedirectAction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRedirectAction.verify|verify} messages. + * @param message HttpRedirectAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpRedirectAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRedirectAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpRedirectAction; + + /** + * Decodes a HttpRedirectAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpRedirectAction; + + /** + * Verifies a HttpRedirectAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRedirectAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRedirectAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpRedirectAction; + + /** + * Creates a plain object from a HttpRedirectAction message. Also converts values to other types if specified. + * @param message HttpRedirectAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpRedirectAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRedirectAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HttpRedirectAction { + + /** RedirectResponseCode enum. */ + enum RedirectResponseCode { + UNDEFINED_REDIRECT_RESPONSE_CODE = 0, + FOUND = 67084130, + MOVED_PERMANENTLY_DEFAULT = 386698449, + PERMANENT_REDIRECT = 382006381, + SEE_OTHER = 445380580, + TEMPORARY_REDIRECT = 489550378 + } + } + + /** Properties of a HttpRetryPolicy. */ + interface IHttpRetryPolicy { + + /** HttpRetryPolicy numRetries */ + numRetries?: (number|null); + + /** HttpRetryPolicy perTryTimeout */ + perTryTimeout?: (google.cloud.compute.v1.IDuration|null); + + /** HttpRetryPolicy retryConditions */ + retryConditions?: (string[]|null); + } + + /** Represents a HttpRetryPolicy. */ + class HttpRetryPolicy implements IHttpRetryPolicy { + + /** + * Constructs a new HttpRetryPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpRetryPolicy); + + /** HttpRetryPolicy numRetries. */ + public numRetries?: (number|null); + + /** HttpRetryPolicy perTryTimeout. */ + public perTryTimeout?: (google.cloud.compute.v1.IDuration|null); + + /** HttpRetryPolicy retryConditions. */ + public retryConditions: string[]; + + /** HttpRetryPolicy _numRetries. */ + public _numRetries?: "numRetries"; + + /** HttpRetryPolicy _perTryTimeout. */ + public _perTryTimeout?: "perTryTimeout"; + + /** + * Creates a new HttpRetryPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRetryPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpRetryPolicy): google.cloud.compute.v1.HttpRetryPolicy; + + /** + * Encodes the specified HttpRetryPolicy message. Does not implicitly {@link google.cloud.compute.v1.HttpRetryPolicy.verify|verify} messages. + * @param message HttpRetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRetryPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRetryPolicy.verify|verify} messages. + * @param message HttpRetryPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpRetryPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRetryPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpRetryPolicy; + + /** + * Decodes a HttpRetryPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpRetryPolicy; + + /** + * Verifies a HttpRetryPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRetryPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRetryPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpRetryPolicy; + + /** + * Creates a plain object from a HttpRetryPolicy message. Also converts values to other types if specified. + * @param message HttpRetryPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpRetryPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRetryPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RequestMirrorPolicy. */ + interface IRequestMirrorPolicy { + + /** RequestMirrorPolicy backendService */ + backendService?: (string|null); + } + + /** Represents a RequestMirrorPolicy. */ + class RequestMirrorPolicy implements IRequestMirrorPolicy { + + /** + * Constructs a new RequestMirrorPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRequestMirrorPolicy); + + /** RequestMirrorPolicy backendService. */ + public backendService?: (string|null); + + /** RequestMirrorPolicy _backendService. */ + public _backendService?: "backendService"; + + /** + * Creates a new RequestMirrorPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RequestMirrorPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IRequestMirrorPolicy): google.cloud.compute.v1.RequestMirrorPolicy; + + /** + * Encodes the specified RequestMirrorPolicy message. Does not implicitly {@link google.cloud.compute.v1.RequestMirrorPolicy.verify|verify} messages. + * @param message RequestMirrorPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRequestMirrorPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RequestMirrorPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RequestMirrorPolicy.verify|verify} messages. + * @param message RequestMirrorPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRequestMirrorPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestMirrorPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RequestMirrorPolicy; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestMirrorPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RequestMirrorPolicy; + + /** + * Verifies a RequestMirrorPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RequestMirrorPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestMirrorPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RequestMirrorPolicy; + + /** + * Creates a plain object from a RequestMirrorPolicy message. Also converts values to other types if specified. + * @param message RequestMirrorPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RequestMirrorPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RequestMirrorPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlRewrite. */ + interface IUrlRewrite { + + /** UrlRewrite hostRewrite */ + hostRewrite?: (string|null); + + /** UrlRewrite pathPrefixRewrite */ + pathPrefixRewrite?: (string|null); + } + + /** Represents an UrlRewrite. */ + class UrlRewrite implements IUrlRewrite { + + /** + * Constructs a new UrlRewrite. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlRewrite); + + /** UrlRewrite hostRewrite. */ + public hostRewrite?: (string|null); + + /** UrlRewrite pathPrefixRewrite. */ + public pathPrefixRewrite?: (string|null); + + /** UrlRewrite _hostRewrite. */ + public _hostRewrite?: "hostRewrite"; + + /** UrlRewrite _pathPrefixRewrite. */ + public _pathPrefixRewrite?: "pathPrefixRewrite"; + + /** + * Creates a new UrlRewrite instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlRewrite instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlRewrite): google.cloud.compute.v1.UrlRewrite; + + /** + * Encodes the specified UrlRewrite message. Does not implicitly {@link google.cloud.compute.v1.UrlRewrite.verify|verify} messages. + * @param message UrlRewrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlRewrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlRewrite message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlRewrite.verify|verify} messages. + * @param message UrlRewrite message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlRewrite, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlRewrite message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlRewrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlRewrite; + + /** + * Decodes an UrlRewrite message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlRewrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlRewrite; + + /** + * Verifies an UrlRewrite message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlRewrite message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlRewrite + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlRewrite; + + /** + * Creates a plain object from an UrlRewrite message. Also converts values to other types if specified. + * @param message UrlRewrite + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlRewrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlRewrite to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WeightedBackendService. */ + interface IWeightedBackendService { + + /** WeightedBackendService backendService */ + backendService?: (string|null); + + /** WeightedBackendService headerAction */ + headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** WeightedBackendService weight */ + weight?: (number|null); + } + + /** Represents a WeightedBackendService. */ + class WeightedBackendService implements IWeightedBackendService { + + /** + * Constructs a new WeightedBackendService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWeightedBackendService); + + /** WeightedBackendService backendService. */ + public backendService?: (string|null); + + /** WeightedBackendService headerAction. */ + public headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** WeightedBackendService weight. */ + public weight?: (number|null); + + /** WeightedBackendService _backendService. */ + public _backendService?: "backendService"; + + /** WeightedBackendService _headerAction. */ + public _headerAction?: "headerAction"; + + /** WeightedBackendService _weight. */ + public _weight?: "weight"; + + /** + * Creates a new WeightedBackendService instance using the specified properties. + * @param [properties] Properties to set + * @returns WeightedBackendService instance + */ + public static create(properties?: google.cloud.compute.v1.IWeightedBackendService): google.cloud.compute.v1.WeightedBackendService; + + /** + * Encodes the specified WeightedBackendService message. Does not implicitly {@link google.cloud.compute.v1.WeightedBackendService.verify|verify} messages. + * @param message WeightedBackendService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWeightedBackendService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeightedBackendService message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WeightedBackendService.verify|verify} messages. + * @param message WeightedBackendService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWeightedBackendService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeightedBackendService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeightedBackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.WeightedBackendService; + + /** + * Decodes a WeightedBackendService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeightedBackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.WeightedBackendService; + + /** + * Verifies a WeightedBackendService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeightedBackendService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeightedBackendService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.WeightedBackendService; + + /** + * Creates a plain object from a WeightedBackendService message. Also converts values to other types if specified. + * @param message WeightedBackendService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.WeightedBackendService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeightedBackendService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRouteAction. */ + interface IHttpRouteAction { + + /** HttpRouteAction corsPolicy */ + corsPolicy?: (google.cloud.compute.v1.ICorsPolicy|null); + + /** HttpRouteAction faultInjectionPolicy */ + faultInjectionPolicy?: (google.cloud.compute.v1.IHttpFaultInjection|null); + + /** HttpRouteAction maxStreamDuration */ + maxStreamDuration?: (google.cloud.compute.v1.IDuration|null); + + /** HttpRouteAction requestMirrorPolicy */ + requestMirrorPolicy?: (google.cloud.compute.v1.IRequestMirrorPolicy|null); + + /** HttpRouteAction retryPolicy */ + retryPolicy?: (google.cloud.compute.v1.IHttpRetryPolicy|null); + + /** HttpRouteAction timeout */ + timeout?: (google.cloud.compute.v1.IDuration|null); + + /** HttpRouteAction urlRewrite */ + urlRewrite?: (google.cloud.compute.v1.IUrlRewrite|null); + + /** HttpRouteAction weightedBackendServices */ + weightedBackendServices?: (google.cloud.compute.v1.IWeightedBackendService[]|null); + } + + /** Represents a HttpRouteAction. */ + class HttpRouteAction implements IHttpRouteAction { + + /** + * Constructs a new HttpRouteAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpRouteAction); + + /** HttpRouteAction corsPolicy. */ + public corsPolicy?: (google.cloud.compute.v1.ICorsPolicy|null); + + /** HttpRouteAction faultInjectionPolicy. */ + public faultInjectionPolicy?: (google.cloud.compute.v1.IHttpFaultInjection|null); + + /** HttpRouteAction maxStreamDuration. */ + public maxStreamDuration?: (google.cloud.compute.v1.IDuration|null); + + /** HttpRouteAction requestMirrorPolicy. */ + public requestMirrorPolicy?: (google.cloud.compute.v1.IRequestMirrorPolicy|null); + + /** HttpRouteAction retryPolicy. */ + public retryPolicy?: (google.cloud.compute.v1.IHttpRetryPolicy|null); + + /** HttpRouteAction timeout. */ + public timeout?: (google.cloud.compute.v1.IDuration|null); + + /** HttpRouteAction urlRewrite. */ + public urlRewrite?: (google.cloud.compute.v1.IUrlRewrite|null); + + /** HttpRouteAction weightedBackendServices. */ + public weightedBackendServices: google.cloud.compute.v1.IWeightedBackendService[]; + + /** HttpRouteAction _corsPolicy. */ + public _corsPolicy?: "corsPolicy"; + + /** HttpRouteAction _faultInjectionPolicy. */ + public _faultInjectionPolicy?: "faultInjectionPolicy"; + + /** HttpRouteAction _maxStreamDuration. */ + public _maxStreamDuration?: "maxStreamDuration"; + + /** HttpRouteAction _requestMirrorPolicy. */ + public _requestMirrorPolicy?: "requestMirrorPolicy"; + + /** HttpRouteAction _retryPolicy. */ + public _retryPolicy?: "retryPolicy"; + + /** HttpRouteAction _timeout. */ + public _timeout?: "timeout"; + + /** HttpRouteAction _urlRewrite. */ + public _urlRewrite?: "urlRewrite"; + + /** + * Creates a new HttpRouteAction instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRouteAction instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpRouteAction): google.cloud.compute.v1.HttpRouteAction; + + /** + * Encodes the specified HttpRouteAction message. Does not implicitly {@link google.cloud.compute.v1.HttpRouteAction.verify|verify} messages. + * @param message HttpRouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRouteAction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRouteAction.verify|verify} messages. + * @param message HttpRouteAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpRouteAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRouteAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpRouteAction; + + /** + * Decodes a HttpRouteAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpRouteAction; + + /** + * Verifies a HttpRouteAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRouteAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRouteAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpRouteAction; + + /** + * Creates a plain object from a HttpRouteAction message. Also converts values to other types if specified. + * @param message HttpRouteAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpRouteAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRouteAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRouteRuleMatch. */ + interface IHttpRouteRuleMatch { + + /** HttpRouteRuleMatch fullPathMatch */ + fullPathMatch?: (string|null); + + /** HttpRouteRuleMatch headerMatches */ + headerMatches?: (google.cloud.compute.v1.IHttpHeaderMatch[]|null); + + /** HttpRouteRuleMatch ignoreCase */ + ignoreCase?: (boolean|null); + + /** HttpRouteRuleMatch metadataFilters */ + metadataFilters?: (google.cloud.compute.v1.IMetadataFilter[]|null); + + /** HttpRouteRuleMatch prefixMatch */ + prefixMatch?: (string|null); + + /** HttpRouteRuleMatch queryParameterMatches */ + queryParameterMatches?: (google.cloud.compute.v1.IHttpQueryParameterMatch[]|null); + + /** HttpRouteRuleMatch regexMatch */ + regexMatch?: (string|null); + } + + /** Represents a HttpRouteRuleMatch. */ + class HttpRouteRuleMatch implements IHttpRouteRuleMatch { + + /** + * Constructs a new HttpRouteRuleMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpRouteRuleMatch); + + /** HttpRouteRuleMatch fullPathMatch. */ + public fullPathMatch?: (string|null); + + /** HttpRouteRuleMatch headerMatches. */ + public headerMatches: google.cloud.compute.v1.IHttpHeaderMatch[]; + + /** HttpRouteRuleMatch ignoreCase. */ + public ignoreCase?: (boolean|null); + + /** HttpRouteRuleMatch metadataFilters. */ + public metadataFilters: google.cloud.compute.v1.IMetadataFilter[]; + + /** HttpRouteRuleMatch prefixMatch. */ + public prefixMatch?: (string|null); + + /** HttpRouteRuleMatch queryParameterMatches. */ + public queryParameterMatches: google.cloud.compute.v1.IHttpQueryParameterMatch[]; + + /** HttpRouteRuleMatch regexMatch. */ + public regexMatch?: (string|null); + + /** HttpRouteRuleMatch _fullPathMatch. */ + public _fullPathMatch?: "fullPathMatch"; + + /** HttpRouteRuleMatch _ignoreCase. */ + public _ignoreCase?: "ignoreCase"; + + /** HttpRouteRuleMatch _prefixMatch. */ + public _prefixMatch?: "prefixMatch"; + + /** HttpRouteRuleMatch _regexMatch. */ + public _regexMatch?: "regexMatch"; + + /** + * Creates a new HttpRouteRuleMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRouteRuleMatch instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpRouteRuleMatch): google.cloud.compute.v1.HttpRouteRuleMatch; + + /** + * Encodes the specified HttpRouteRuleMatch message. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRuleMatch.verify|verify} messages. + * @param message HttpRouteRuleMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpRouteRuleMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRouteRuleMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRuleMatch.verify|verify} messages. + * @param message HttpRouteRuleMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpRouteRuleMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRouteRuleMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRouteRuleMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpRouteRuleMatch; + + /** + * Decodes a HttpRouteRuleMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRouteRuleMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpRouteRuleMatch; + + /** + * Verifies a HttpRouteRuleMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRouteRuleMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRouteRuleMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpRouteRuleMatch; + + /** + * Creates a plain object from a HttpRouteRuleMatch message. Also converts values to other types if specified. + * @param message HttpRouteRuleMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpRouteRuleMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRouteRuleMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HttpRouteRule. */ + interface IHttpRouteRule { + + /** HttpRouteRule description */ + description?: (string|null); + + /** HttpRouteRule headerAction */ + headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** HttpRouteRule matchRules */ + matchRules?: (google.cloud.compute.v1.IHttpRouteRuleMatch[]|null); + + /** HttpRouteRule priority */ + priority?: (number|null); + + /** HttpRouteRule routeAction */ + routeAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** HttpRouteRule service */ + service?: (string|null); + + /** HttpRouteRule urlRedirect */ + urlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + } + + /** Represents a HttpRouteRule. */ + class HttpRouteRule implements IHttpRouteRule { + + /** + * Constructs a new HttpRouteRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IHttpRouteRule); + + /** HttpRouteRule description. */ + public description?: (string|null); + + /** HttpRouteRule headerAction. */ + public headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** HttpRouteRule matchRules. */ + public matchRules: google.cloud.compute.v1.IHttpRouteRuleMatch[]; + + /** HttpRouteRule priority. */ + public priority?: (number|null); + + /** HttpRouteRule routeAction. */ + public routeAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** HttpRouteRule service. */ + public service?: (string|null); + + /** HttpRouteRule urlRedirect. */ + public urlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + + /** HttpRouteRule _description. */ + public _description?: "description"; + + /** HttpRouteRule _headerAction. */ + public _headerAction?: "headerAction"; + + /** HttpRouteRule _priority. */ + public _priority?: "priority"; + + /** HttpRouteRule _routeAction. */ + public _routeAction?: "routeAction"; + + /** HttpRouteRule _service. */ + public _service?: "service"; + + /** HttpRouteRule _urlRedirect. */ + public _urlRedirect?: "urlRedirect"; + + /** + * Creates a new HttpRouteRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRouteRule instance + */ + public static create(properties?: google.cloud.compute.v1.IHttpRouteRule): google.cloud.compute.v1.HttpRouteRule; + + /** + * Encodes the specified HttpRouteRule message. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRule.verify|verify} messages. + * @param message HttpRouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IHttpRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRouteRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRule.verify|verify} messages. + * @param message HttpRouteRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IHttpRouteRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRouteRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.HttpRouteRule; + + /** + * Decodes a HttpRouteRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.HttpRouteRule; + + /** + * Verifies a HttpRouteRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRouteRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRouteRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.HttpRouteRule; + + /** + * Creates a plain object from a HttpRouteRule message. Also converts values to other types if specified. + * @param message HttpRouteRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.HttpRouteRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRouteRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RawDisk. */ + interface IRawDisk { + + /** RawDisk containerType */ + containerType?: (google.cloud.compute.v1.RawDisk.ContainerType|keyof typeof google.cloud.compute.v1.RawDisk.ContainerType|null); + + /** RawDisk sha1Checksum */ + sha1Checksum?: (string|null); + + /** RawDisk source */ + source?: (string|null); + } + + /** Represents a RawDisk. */ + class RawDisk implements IRawDisk { + + /** + * Constructs a new RawDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRawDisk); + + /** RawDisk containerType. */ + public containerType?: (google.cloud.compute.v1.RawDisk.ContainerType|keyof typeof google.cloud.compute.v1.RawDisk.ContainerType|null); + + /** RawDisk sha1Checksum. */ + public sha1Checksum?: (string|null); + + /** RawDisk source. */ + public source?: (string|null); + + /** RawDisk _containerType. */ + public _containerType?: "containerType"; + + /** RawDisk _sha1Checksum. */ + public _sha1Checksum?: "sha1Checksum"; + + /** RawDisk _source. */ + public _source?: "source"; + + /** + * Creates a new RawDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns RawDisk instance + */ + public static create(properties?: google.cloud.compute.v1.IRawDisk): google.cloud.compute.v1.RawDisk; + + /** + * Encodes the specified RawDisk message. Does not implicitly {@link google.cloud.compute.v1.RawDisk.verify|verify} messages. + * @param message RawDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRawDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RawDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RawDisk.verify|verify} messages. + * @param message RawDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRawDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RawDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RawDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RawDisk; + + /** + * Decodes a RawDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RawDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RawDisk; + + /** + * Verifies a RawDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RawDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RawDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RawDisk; + + /** + * Creates a plain object from a RawDisk message. Also converts values to other types if specified. + * @param message RawDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RawDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RawDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RawDisk { + + /** ContainerType enum. */ + enum ContainerType { + UNDEFINED_CONTAINER_TYPE = 0, + TAR = 82821 + } + } + + /** Properties of an Image. */ + interface IImage { + + /** Image archiveSizeBytes */ + archiveSizeBytes?: (number|Long|string|null); + + /** Image creationTimestamp */ + creationTimestamp?: (string|null); + + /** Image deprecated */ + deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** Image description */ + description?: (string|null); + + /** Image diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** Image family */ + family?: (string|null); + + /** Image guestOsFeatures */ + guestOsFeatures?: (google.cloud.compute.v1.IGuestOsFeature[]|null); + + /** Image id */ + id?: (number|Long|string|null); + + /** Image imageEncryptionKey */ + imageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image kind */ + kind?: (string|null); + + /** Image labelFingerprint */ + labelFingerprint?: (string|null); + + /** Image labels */ + labels?: ({ [k: string]: string }|null); + + /** Image licenseCodes */ + licenseCodes?: ((number|Long|string)[]|null); + + /** Image licenses */ + licenses?: (string[]|null); + + /** Image name */ + name?: (string|null); + + /** Image rawDisk */ + rawDisk?: (google.cloud.compute.v1.IRawDisk|null); + + /** Image satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Image selfLink */ + selfLink?: (string|null); + + /** Image shieldedInstanceInitialState */ + shieldedInstanceInitialState?: (google.cloud.compute.v1.IInitialStateConfig|null); + + /** Image sourceDisk */ + sourceDisk?: (string|null); + + /** Image sourceDiskEncryptionKey */ + sourceDiskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image sourceDiskId */ + sourceDiskId?: (string|null); + + /** Image sourceImage */ + sourceImage?: (string|null); + + /** Image sourceImageEncryptionKey */ + sourceImageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image sourceImageId */ + sourceImageId?: (string|null); + + /** Image sourceSnapshot */ + sourceSnapshot?: (string|null); + + /** Image sourceSnapshotEncryptionKey */ + sourceSnapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image sourceSnapshotId */ + sourceSnapshotId?: (string|null); + + /** Image sourceType */ + sourceType?: (google.cloud.compute.v1.Image.SourceType|keyof typeof google.cloud.compute.v1.Image.SourceType|null); + + /** Image status */ + status?: (google.cloud.compute.v1.Image.Status|keyof typeof google.cloud.compute.v1.Image.Status|null); + + /** Image storageLocations */ + storageLocations?: (string[]|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IImage); + + /** Image archiveSizeBytes. */ + public archiveSizeBytes?: (number|Long|string|null); + + /** Image creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Image deprecated. */ + public deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** Image description. */ + public description?: (string|null); + + /** Image diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** Image family. */ + public family?: (string|null); + + /** Image guestOsFeatures. */ + public guestOsFeatures: google.cloud.compute.v1.IGuestOsFeature[]; + + /** Image id. */ + public id?: (number|Long|string|null); + + /** Image imageEncryptionKey. */ + public imageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image kind. */ + public kind?: (string|null); + + /** Image labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** Image labels. */ + public labels: { [k: string]: string }; + + /** Image licenseCodes. */ + public licenseCodes: (number|Long|string)[]; + + /** Image licenses. */ + public licenses: string[]; + + /** Image name. */ + public name?: (string|null); + + /** Image rawDisk. */ + public rawDisk?: (google.cloud.compute.v1.IRawDisk|null); + + /** Image satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Image selfLink. */ + public selfLink?: (string|null); + + /** Image shieldedInstanceInitialState. */ + public shieldedInstanceInitialState?: (google.cloud.compute.v1.IInitialStateConfig|null); + + /** Image sourceDisk. */ + public sourceDisk?: (string|null); + + /** Image sourceDiskEncryptionKey. */ + public sourceDiskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image sourceDiskId. */ + public sourceDiskId?: (string|null); + + /** Image sourceImage. */ + public sourceImage?: (string|null); + + /** Image sourceImageEncryptionKey. */ + public sourceImageEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image sourceImageId. */ + public sourceImageId?: (string|null); + + /** Image sourceSnapshot. */ + public sourceSnapshot?: (string|null); + + /** Image sourceSnapshotEncryptionKey. */ + public sourceSnapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Image sourceSnapshotId. */ + public sourceSnapshotId?: (string|null); + + /** Image sourceType. */ + public sourceType?: (google.cloud.compute.v1.Image.SourceType|keyof typeof google.cloud.compute.v1.Image.SourceType|null); + + /** Image status. */ + public status?: (google.cloud.compute.v1.Image.Status|keyof typeof google.cloud.compute.v1.Image.Status|null); + + /** Image storageLocations. */ + public storageLocations: string[]; + + /** Image _archiveSizeBytes. */ + public _archiveSizeBytes?: "archiveSizeBytes"; + + /** Image _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Image _deprecated. */ + public _deprecated?: "deprecated"; + + /** Image _description. */ + public _description?: "description"; + + /** Image _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** Image _family. */ + public _family?: "family"; + + /** Image _id. */ + public _id?: "id"; + + /** Image _imageEncryptionKey. */ + public _imageEncryptionKey?: "imageEncryptionKey"; + + /** Image _kind. */ + public _kind?: "kind"; + + /** Image _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** Image _name. */ + public _name?: "name"; + + /** Image _rawDisk. */ + public _rawDisk?: "rawDisk"; + + /** Image _satisfiesPzs. */ + public _satisfiesPzs?: "satisfiesPzs"; + + /** Image _selfLink. */ + public _selfLink?: "selfLink"; + + /** Image _shieldedInstanceInitialState. */ + public _shieldedInstanceInitialState?: "shieldedInstanceInitialState"; + + /** Image _sourceDisk. */ + public _sourceDisk?: "sourceDisk"; + + /** Image _sourceDiskEncryptionKey. */ + public _sourceDiskEncryptionKey?: "sourceDiskEncryptionKey"; + + /** Image _sourceDiskId. */ + public _sourceDiskId?: "sourceDiskId"; + + /** Image _sourceImage. */ + public _sourceImage?: "sourceImage"; + + /** Image _sourceImageEncryptionKey. */ + public _sourceImageEncryptionKey?: "sourceImageEncryptionKey"; + + /** Image _sourceImageId. */ + public _sourceImageId?: "sourceImageId"; + + /** Image _sourceSnapshot. */ + public _sourceSnapshot?: "sourceSnapshot"; + + /** Image _sourceSnapshotEncryptionKey. */ + public _sourceSnapshotEncryptionKey?: "sourceSnapshotEncryptionKey"; + + /** Image _sourceSnapshotId. */ + public _sourceSnapshotId?: "sourceSnapshotId"; + + /** Image _sourceType. */ + public _sourceType?: "sourceType"; + + /** Image _status. */ + public _status?: "status"; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.compute.v1.IImage): google.cloud.compute.v1.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.compute.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Image { + + /** SourceType enum. */ + enum SourceType { + UNDEFINED_SOURCE_TYPE = 0, + RAW = 80904 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + DELETING = 528602024, + FAILED = 455706685, + PENDING = 35394935, + READY = 77848963 + } + } + + /** Properties of an ImageList. */ + interface IImageList { + + /** ImageList id */ + id?: (string|null); + + /** ImageList items */ + items?: (google.cloud.compute.v1.IImage[]|null); + + /** ImageList kind */ + kind?: (string|null); + + /** ImageList nextPageToken */ + nextPageToken?: (string|null); + + /** ImageList selfLink */ + selfLink?: (string|null); + + /** ImageList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an ImageList. */ + class ImageList implements IImageList { + + /** + * Constructs a new ImageList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IImageList); + + /** ImageList id. */ + public id?: (string|null); + + /** ImageList items. */ + public items: google.cloud.compute.v1.IImage[]; + + /** ImageList kind. */ + public kind?: (string|null); + + /** ImageList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ImageList selfLink. */ + public selfLink?: (string|null); + + /** ImageList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ImageList _id. */ + public _id?: "id"; + + /** ImageList _kind. */ + public _kind?: "kind"; + + /** ImageList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ImageList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ImageList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ImageList instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageList instance + */ + public static create(properties?: google.cloud.compute.v1.IImageList): google.cloud.compute.v1.ImageList; + + /** + * Encodes the specified ImageList message. Does not implicitly {@link google.cloud.compute.v1.ImageList.verify|verify} messages. + * @param message ImageList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IImageList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImageList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ImageList.verify|verify} messages. + * @param message ImageList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IImageList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ImageList; + + /** + * Decodes an ImageList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ImageList; + + /** + * Verifies an ImageList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImageList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ImageList; + + /** + * Creates a plain object from an ImageList message. Also converts values to other types if specified. + * @param message ImageList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ImageList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImageList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata fingerprint */ + fingerprint?: (string|null); + + /** Metadata items */ + items?: (google.cloud.compute.v1.IItems[]|null); + + /** Metadata kind */ + kind?: (string|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMetadata); + + /** Metadata fingerprint. */ + public fingerprint?: (string|null); + + /** Metadata items. */ + public items: google.cloud.compute.v1.IItems[]; + + /** Metadata kind. */ + public kind?: (string|null); + + /** Metadata _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** Metadata _kind. */ + public _kind?: "kind"; + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.compute.v1.IMetadata): google.cloud.compute.v1.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface accessConfigs */ + accessConfigs?: (google.cloud.compute.v1.IAccessConfig[]|null); + + /** NetworkInterface aliasIpRanges */ + aliasIpRanges?: (google.cloud.compute.v1.IAliasIpRange[]|null); + + /** NetworkInterface fingerprint */ + fingerprint?: (string|null); + + /** NetworkInterface ipv6Address */ + ipv6Address?: (string|null); + + /** NetworkInterface kind */ + kind?: (string|null); + + /** NetworkInterface name */ + name?: (string|null); + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface networkIP */ + networkIP?: (string|null); + + /** NetworkInterface nicType */ + nicType?: (google.cloud.compute.v1.NetworkInterface.NicType|keyof typeof google.cloud.compute.v1.NetworkInterface.NicType|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkInterface); + + /** NetworkInterface accessConfigs. */ + public accessConfigs: google.cloud.compute.v1.IAccessConfig[]; + + /** NetworkInterface aliasIpRanges. */ + public aliasIpRanges: google.cloud.compute.v1.IAliasIpRange[]; + + /** NetworkInterface fingerprint. */ + public fingerprint?: (string|null); + + /** NetworkInterface ipv6Address. */ + public ipv6Address?: (string|null); + + /** NetworkInterface kind. */ + public kind?: (string|null); + + /** NetworkInterface name. */ + public name?: (string|null); + + /** NetworkInterface network. */ + public network?: (string|null); + + /** NetworkInterface networkIP. */ + public networkIP?: (string|null); + + /** NetworkInterface nicType. */ + public nicType?: (google.cloud.compute.v1.NetworkInterface.NicType|keyof typeof google.cloud.compute.v1.NetworkInterface.NicType|null); + + /** NetworkInterface subnetwork. */ + public subnetwork?: (string|null); + + /** NetworkInterface _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** NetworkInterface _ipv6Address. */ + public _ipv6Address?: "ipv6Address"; + + /** NetworkInterface _kind. */ + public _kind?: "kind"; + + /** NetworkInterface _name. */ + public _name?: "name"; + + /** NetworkInterface _network. */ + public _network?: "network"; + + /** NetworkInterface _networkIP. */ + public _networkIP?: "networkIP"; + + /** NetworkInterface _nicType. */ + public _nicType?: "nicType"; + + /** NetworkInterface _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkInterface): google.cloud.compute.v1.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.compute.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkInterface { + + /** NicType enum. */ + enum NicType { + UNDEFINED_NIC_TYPE = 0, + GVNIC = 68209305, + UNSPECIFIED_NIC_TYPE = 67411801, + VIRTIO_NET = 452123481 + } + } + + /** Properties of a ReservationAffinity. */ + interface IReservationAffinity { + + /** ReservationAffinity consumeReservationType */ + consumeReservationType?: (google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType|keyof typeof google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType|null); + + /** ReservationAffinity key */ + key?: (string|null); + + /** ReservationAffinity values */ + values?: (string[]|null); + } + + /** Represents a ReservationAffinity. */ + class ReservationAffinity implements IReservationAffinity { + + /** + * Constructs a new ReservationAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IReservationAffinity); + + /** ReservationAffinity consumeReservationType. */ + public consumeReservationType?: (google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType|keyof typeof google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType|null); + + /** ReservationAffinity key. */ + public key?: (string|null); + + /** ReservationAffinity values. */ + public values: string[]; + + /** ReservationAffinity _consumeReservationType. */ + public _consumeReservationType?: "consumeReservationType"; + + /** ReservationAffinity _key. */ + public _key?: "key"; + + /** + * Creates a new ReservationAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservationAffinity instance + */ + public static create(properties?: google.cloud.compute.v1.IReservationAffinity): google.cloud.compute.v1.ReservationAffinity; + + /** + * Encodes the specified ReservationAffinity message. Does not implicitly {@link google.cloud.compute.v1.ReservationAffinity.verify|verify} messages. + * @param message ReservationAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IReservationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservationAffinity message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationAffinity.verify|verify} messages. + * @param message ReservationAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IReservationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ReservationAffinity; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ReservationAffinity; + + /** + * Verifies a ReservationAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservationAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservationAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ReservationAffinity; + + /** + * Creates a plain object from a ReservationAffinity message. Also converts values to other types if specified. + * @param message ReservationAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ReservationAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservationAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ReservationAffinity { + + /** ConsumeReservationType enum. */ + enum ConsumeReservationType { + UNDEFINED_CONSUME_RESERVATION_TYPE = 0, + ANY_RESERVATION = 200008121, + NO_RESERVATION = 169322030, + SPECIFIC_RESERVATION = 229889055, + UNSPECIFIED = 526786327 + } + } + + /** Properties of a Scheduling. */ + interface IScheduling { + + /** Scheduling automaticRestart */ + automaticRestart?: (boolean|null); + + /** Scheduling locationHint */ + locationHint?: (string|null); + + /** Scheduling minNodeCpus */ + minNodeCpus?: (number|null); + + /** Scheduling nodeAffinities */ + nodeAffinities?: (google.cloud.compute.v1.ISchedulingNodeAffinity[]|null); + + /** Scheduling onHostMaintenance */ + onHostMaintenance?: (google.cloud.compute.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.compute.v1.Scheduling.OnHostMaintenance|null); + + /** Scheduling preemptible */ + preemptible?: (boolean|null); + } + + /** Represents a Scheduling. */ + class Scheduling implements IScheduling { + + /** + * Constructs a new Scheduling. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IScheduling); + + /** Scheduling automaticRestart. */ + public automaticRestart?: (boolean|null); + + /** Scheduling locationHint. */ + public locationHint?: (string|null); + + /** Scheduling minNodeCpus. */ + public minNodeCpus?: (number|null); + + /** Scheduling nodeAffinities. */ + public nodeAffinities: google.cloud.compute.v1.ISchedulingNodeAffinity[]; + + /** Scheduling onHostMaintenance. */ + public onHostMaintenance?: (google.cloud.compute.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.compute.v1.Scheduling.OnHostMaintenance|null); + + /** Scheduling preemptible. */ + public preemptible?: (boolean|null); + + /** Scheduling _automaticRestart. */ + public _automaticRestart?: "automaticRestart"; + + /** Scheduling _locationHint. */ + public _locationHint?: "locationHint"; + + /** Scheduling _minNodeCpus. */ + public _minNodeCpus?: "minNodeCpus"; + + /** Scheduling _onHostMaintenance. */ + public _onHostMaintenance?: "onHostMaintenance"; + + /** Scheduling _preemptible. */ + public _preemptible?: "preemptible"; + + /** + * Creates a new Scheduling instance using the specified properties. + * @param [properties] Properties to set + * @returns Scheduling instance + */ + public static create(properties?: google.cloud.compute.v1.IScheduling): google.cloud.compute.v1.Scheduling; + + /** + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.compute.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Scheduling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Scheduling; + + /** + * Decodes a Scheduling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Scheduling; + + /** + * Verifies a Scheduling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Scheduling + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Scheduling; + + /** + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @param message Scheduling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Scheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Scheduling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Scheduling { + + /** OnHostMaintenance enum. */ + enum OnHostMaintenance { + UNDEFINED_ON_HOST_MAINTENANCE = 0, + MIGRATE = 165699979, + TERMINATE = 527617601 + } + } + + /** Properties of a ServiceAccount. */ + interface IServiceAccount { + + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { + + /** + * Constructs a new ServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IServiceAccount); + + /** ServiceAccount email. */ + public email?: (string|null); + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** ServiceAccount _email. */ + public _email?: "email"; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccount instance + */ + public static create(properties?: google.cloud.compute.v1.IServiceAccount): google.cloud.compute.v1.ServiceAccount; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ShieldedInstanceConfig. */ + interface IShieldedInstanceConfig { + + /** ShieldedInstanceConfig enableIntegrityMonitoring */ + enableIntegrityMonitoring?: (boolean|null); + + /** ShieldedInstanceConfig enableSecureBoot */ + enableSecureBoot?: (boolean|null); + + /** ShieldedInstanceConfig enableVtpm */ + enableVtpm?: (boolean|null); + } + + /** Represents a ShieldedInstanceConfig. */ + class ShieldedInstanceConfig implements IShieldedInstanceConfig { + + /** + * Constructs a new ShieldedInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IShieldedInstanceConfig); + + /** ShieldedInstanceConfig enableIntegrityMonitoring. */ + public enableIntegrityMonitoring?: (boolean|null); + + /** ShieldedInstanceConfig enableSecureBoot. */ + public enableSecureBoot?: (boolean|null); + + /** ShieldedInstanceConfig enableVtpm. */ + public enableVtpm?: (boolean|null); + + /** ShieldedInstanceConfig _enableIntegrityMonitoring. */ + public _enableIntegrityMonitoring?: "enableIntegrityMonitoring"; + + /** ShieldedInstanceConfig _enableSecureBoot. */ + public _enableSecureBoot?: "enableSecureBoot"; + + /** ShieldedInstanceConfig _enableVtpm. */ + public _enableVtpm?: "enableVtpm"; + + /** + * Creates a new ShieldedInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShieldedInstanceConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IShieldedInstanceConfig): google.cloud.compute.v1.ShieldedInstanceConfig; + + /** + * Encodes the specified ShieldedInstanceConfig message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceConfig.verify|verify} messages. + * @param message ShieldedInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceConfig.verify|verify} messages. + * @param message ShieldedInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ShieldedInstanceConfig; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ShieldedInstanceConfig; + + /** + * Verifies a ShieldedInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShieldedInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ShieldedInstanceConfig; + + /** + * Creates a plain object from a ShieldedInstanceConfig message. Also converts values to other types if specified. + * @param message ShieldedInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ShieldedInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShieldedInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ShieldedInstanceIntegrityPolicy. */ + interface IShieldedInstanceIntegrityPolicy { + + /** ShieldedInstanceIntegrityPolicy updateAutoLearnPolicy */ + updateAutoLearnPolicy?: (boolean|null); + } + + /** Represents a ShieldedInstanceIntegrityPolicy. */ + class ShieldedInstanceIntegrityPolicy implements IShieldedInstanceIntegrityPolicy { + + /** + * Constructs a new ShieldedInstanceIntegrityPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy); + + /** ShieldedInstanceIntegrityPolicy updateAutoLearnPolicy. */ + public updateAutoLearnPolicy?: (boolean|null); + + /** ShieldedInstanceIntegrityPolicy _updateAutoLearnPolicy. */ + public _updateAutoLearnPolicy?: "updateAutoLearnPolicy"; + + /** + * Creates a new ShieldedInstanceIntegrityPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ShieldedInstanceIntegrityPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy): google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy; + + /** + * Encodes the specified ShieldedInstanceIntegrityPolicy message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.verify|verify} messages. + * @param message ShieldedInstanceIntegrityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShieldedInstanceIntegrityPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.verify|verify} messages. + * @param message ShieldedInstanceIntegrityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShieldedInstanceIntegrityPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShieldedInstanceIntegrityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy; + + /** + * Decodes a ShieldedInstanceIntegrityPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShieldedInstanceIntegrityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy; + + /** + * Verifies a ShieldedInstanceIntegrityPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShieldedInstanceIntegrityPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShieldedInstanceIntegrityPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy; + + /** + * Creates a plain object from a ShieldedInstanceIntegrityPolicy message. Also converts values to other types if specified. + * @param message ShieldedInstanceIntegrityPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShieldedInstanceIntegrityPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Tags. */ + interface ITags { + + /** Tags fingerprint */ + fingerprint?: (string|null); + + /** Tags items */ + items?: (string[]|null); + } + + /** Represents a Tags. */ + class Tags implements ITags { + + /** + * Constructs a new Tags. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITags); + + /** Tags fingerprint. */ + public fingerprint?: (string|null); + + /** Tags items. */ + public items: string[]; + + /** Tags _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** + * Creates a new Tags instance using the specified properties. + * @param [properties] Properties to set + * @returns Tags instance + */ + public static create(properties?: google.cloud.compute.v1.ITags): google.cloud.compute.v1.Tags; + + /** + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.compute.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tags message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Tags; + + /** + * Decodes a Tags message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Tags; + + /** + * Verifies a Tags message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tags message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tags + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Tags; + + /** + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @param message Tags + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Tags, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tags to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance advancedMachineFeatures */ + advancedMachineFeatures?: (google.cloud.compute.v1.IAdvancedMachineFeatures|null); + + /** Instance canIpForward */ + canIpForward?: (boolean|null); + + /** Instance confidentialInstanceConfig */ + confidentialInstanceConfig?: (google.cloud.compute.v1.IConfidentialInstanceConfig|null); + + /** Instance cpuPlatform */ + cpuPlatform?: (string|null); + + /** Instance creationTimestamp */ + creationTimestamp?: (string|null); + + /** Instance deletionProtection */ + deletionProtection?: (boolean|null); + + /** Instance description */ + description?: (string|null); + + /** Instance disks */ + disks?: (google.cloud.compute.v1.IAttachedDisk[]|null); + + /** Instance displayDevice */ + displayDevice?: (google.cloud.compute.v1.IDisplayDevice|null); + + /** Instance fingerprint */ + fingerprint?: (string|null); + + /** Instance guestAccelerators */ + guestAccelerators?: (google.cloud.compute.v1.IAcceleratorConfig[]|null); + + /** Instance hostname */ + hostname?: (string|null); + + /** Instance id */ + id?: (number|Long|string|null); + + /** Instance kind */ + kind?: (string|null); + + /** Instance labelFingerprint */ + labelFingerprint?: (string|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance lastStartTimestamp */ + lastStartTimestamp?: (string|null); + + /** Instance lastStopTimestamp */ + lastStopTimestamp?: (string|null); + + /** Instance lastSuspendedTimestamp */ + lastSuspendedTimestamp?: (string|null); + + /** Instance machineType */ + machineType?: (string|null); + + /** Instance metadata */ + metadata?: (google.cloud.compute.v1.IMetadata|null); + + /** Instance minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** Instance name */ + name?: (string|null); + + /** Instance networkInterfaces */ + networkInterfaces?: (google.cloud.compute.v1.INetworkInterface[]|null); + + /** Instance privateIpv6GoogleAccess */ + privateIpv6GoogleAccess?: (google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess|keyof typeof google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess|null); + + /** Instance reservationAffinity */ + reservationAffinity?: (google.cloud.compute.v1.IReservationAffinity|null); + + /** Instance resourcePolicies */ + resourcePolicies?: (string[]|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Instance scheduling */ + scheduling?: (google.cloud.compute.v1.IScheduling|null); + + /** Instance selfLink */ + selfLink?: (string|null); + + /** Instance serviceAccounts */ + serviceAccounts?: (google.cloud.compute.v1.IServiceAccount[]|null); + + /** Instance shieldedInstanceConfig */ + shieldedInstanceConfig?: (google.cloud.compute.v1.IShieldedInstanceConfig|null); + + /** Instance shieldedInstanceIntegrityPolicy */ + shieldedInstanceIntegrityPolicy?: (google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null); + + /** Instance startRestricted */ + startRestricted?: (boolean|null); + + /** Instance status */ + status?: (google.cloud.compute.v1.Instance.Status|keyof typeof google.cloud.compute.v1.Instance.Status|null); + + /** Instance statusMessage */ + statusMessage?: (string|null); + + /** Instance tags */ + tags?: (google.cloud.compute.v1.ITags|null); + + /** Instance zone */ + zone?: (string|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstance); + + /** Instance advancedMachineFeatures. */ + public advancedMachineFeatures?: (google.cloud.compute.v1.IAdvancedMachineFeatures|null); + + /** Instance canIpForward. */ + public canIpForward?: (boolean|null); + + /** Instance confidentialInstanceConfig. */ + public confidentialInstanceConfig?: (google.cloud.compute.v1.IConfidentialInstanceConfig|null); + + /** Instance cpuPlatform. */ + public cpuPlatform?: (string|null); + + /** Instance creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Instance deletionProtection. */ + public deletionProtection?: (boolean|null); + + /** Instance description. */ + public description?: (string|null); + + /** Instance disks. */ + public disks: google.cloud.compute.v1.IAttachedDisk[]; + + /** Instance displayDevice. */ + public displayDevice?: (google.cloud.compute.v1.IDisplayDevice|null); + + /** Instance fingerprint. */ + public fingerprint?: (string|null); + + /** Instance guestAccelerators. */ + public guestAccelerators: google.cloud.compute.v1.IAcceleratorConfig[]; + + /** Instance hostname. */ + public hostname?: (string|null); + + /** Instance id. */ + public id?: (number|Long|string|null); + + /** Instance kind. */ + public kind?: (string|null); + + /** Instance labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance lastStartTimestamp. */ + public lastStartTimestamp?: (string|null); + + /** Instance lastStopTimestamp. */ + public lastStopTimestamp?: (string|null); + + /** Instance lastSuspendedTimestamp. */ + public lastSuspendedTimestamp?: (string|null); + + /** Instance machineType. */ + public machineType?: (string|null); + + /** Instance metadata. */ + public metadata?: (google.cloud.compute.v1.IMetadata|null); + + /** Instance minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** Instance name. */ + public name?: (string|null); + + /** Instance networkInterfaces. */ + public networkInterfaces: google.cloud.compute.v1.INetworkInterface[]; + + /** Instance privateIpv6GoogleAccess. */ + public privateIpv6GoogleAccess?: (google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess|keyof typeof google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess|null); + + /** Instance reservationAffinity. */ + public reservationAffinity?: (google.cloud.compute.v1.IReservationAffinity|null); + + /** Instance resourcePolicies. */ + public resourcePolicies: string[]; + + /** Instance satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Instance scheduling. */ + public scheduling?: (google.cloud.compute.v1.IScheduling|null); + + /** Instance selfLink. */ + public selfLink?: (string|null); + + /** Instance serviceAccounts. */ + public serviceAccounts: google.cloud.compute.v1.IServiceAccount[]; + + /** Instance shieldedInstanceConfig. */ + public shieldedInstanceConfig?: (google.cloud.compute.v1.IShieldedInstanceConfig|null); + + /** Instance shieldedInstanceIntegrityPolicy. */ + public shieldedInstanceIntegrityPolicy?: (google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null); + + /** Instance startRestricted. */ + public startRestricted?: (boolean|null); + + /** Instance status. */ + public status?: (google.cloud.compute.v1.Instance.Status|keyof typeof google.cloud.compute.v1.Instance.Status|null); + + /** Instance statusMessage. */ + public statusMessage?: (string|null); + + /** Instance tags. */ + public tags?: (google.cloud.compute.v1.ITags|null); + + /** Instance zone. */ + public zone?: (string|null); + + /** Instance _advancedMachineFeatures. */ + public _advancedMachineFeatures?: "advancedMachineFeatures"; + + /** Instance _canIpForward. */ + public _canIpForward?: "canIpForward"; + + /** Instance _confidentialInstanceConfig. */ + public _confidentialInstanceConfig?: "confidentialInstanceConfig"; + + /** Instance _cpuPlatform. */ + public _cpuPlatform?: "cpuPlatform"; + + /** Instance _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Instance _deletionProtection. */ + public _deletionProtection?: "deletionProtection"; + + /** Instance _description. */ + public _description?: "description"; + + /** Instance _displayDevice. */ + public _displayDevice?: "displayDevice"; + + /** Instance _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** Instance _hostname. */ + public _hostname?: "hostname"; + + /** Instance _id. */ + public _id?: "id"; + + /** Instance _kind. */ + public _kind?: "kind"; + + /** Instance _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** Instance _lastStartTimestamp. */ + public _lastStartTimestamp?: "lastStartTimestamp"; + + /** Instance _lastStopTimestamp. */ + public _lastStopTimestamp?: "lastStopTimestamp"; + + /** Instance _lastSuspendedTimestamp. */ + public _lastSuspendedTimestamp?: "lastSuspendedTimestamp"; + + /** Instance _machineType. */ + public _machineType?: "machineType"; + + /** Instance _metadata. */ + public _metadata?: "metadata"; + + /** Instance _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** Instance _name. */ + public _name?: "name"; + + /** Instance _privateIpv6GoogleAccess. */ + public _privateIpv6GoogleAccess?: "privateIpv6GoogleAccess"; + + /** Instance _reservationAffinity. */ + public _reservationAffinity?: "reservationAffinity"; + + /** Instance _satisfiesPzs. */ + public _satisfiesPzs?: "satisfiesPzs"; + + /** Instance _scheduling. */ + public _scheduling?: "scheduling"; + + /** Instance _selfLink. */ + public _selfLink?: "selfLink"; + + /** Instance _shieldedInstanceConfig. */ + public _shieldedInstanceConfig?: "shieldedInstanceConfig"; + + /** Instance _shieldedInstanceIntegrityPolicy. */ + public _shieldedInstanceIntegrityPolicy?: "shieldedInstanceIntegrityPolicy"; + + /** Instance _startRestricted. */ + public _startRestricted?: "startRestricted"; + + /** Instance _status. */ + public _status?: "status"; + + /** Instance _statusMessage. */ + public _statusMessage?: "statusMessage"; + + /** Instance _tags. */ + public _tags?: "tags"; + + /** Instance _zone. */ + public _zone?: "zone"; + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.compute.v1.IInstance): google.cloud.compute.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Instance { + + /** PrivateIpv6GoogleAccess enum. */ + enum PrivateIpv6GoogleAccess { + UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0, + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994, + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263, + INHERIT_FROM_SUBNETWORK = 530256959 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + DEPROVISIONING = 428935662, + PROVISIONING = 290896621, + REPAIRING = 413483285, + RUNNING = 121282975, + STAGING = 431072283, + STOPPED = 444276141, + STOPPING = 350791796, + SUSPENDED = 51223995, + SUSPENDING = 514206246, + TERMINATED = 250018339 + } + } + + /** Properties of an InstancesScopedList. */ + interface IInstancesScopedList { + + /** InstancesScopedList instances */ + instances?: (google.cloud.compute.v1.IInstance[]|null); + + /** InstancesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstancesScopedList. */ + class InstancesScopedList implements IInstancesScopedList { + + /** + * Constructs a new InstancesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesScopedList); + + /** InstancesScopedList instances. */ + public instances: google.cloud.compute.v1.IInstance[]; + + /** InstancesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstancesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstancesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesScopedList): google.cloud.compute.v1.InstancesScopedList; + + /** + * Encodes the specified InstancesScopedList message. Does not implicitly {@link google.cloud.compute.v1.InstancesScopedList.verify|verify} messages. + * @param message InstancesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesScopedList.verify|verify} messages. + * @param message InstancesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesScopedList; + + /** + * Decodes an InstancesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesScopedList; + + /** + * Verifies an InstancesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesScopedList; + + /** + * Creates a plain object from an InstancesScopedList message. Also converts values to other types if specified. + * @param message InstancesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceAggregatedList. */ + interface IInstanceAggregatedList { + + /** InstanceAggregatedList id */ + id?: (string|null); + + /** InstanceAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IInstancesScopedList }|null); + + /** InstanceAggregatedList kind */ + kind?: (string|null); + + /** InstanceAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceAggregatedList selfLink */ + selfLink?: (string|null); + + /** InstanceAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** InstanceAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceAggregatedList. */ + class InstanceAggregatedList implements IInstanceAggregatedList { + + /** + * Constructs a new InstanceAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceAggregatedList); + + /** InstanceAggregatedList id. */ + public id?: (string|null); + + /** InstanceAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IInstancesScopedList }; + + /** InstanceAggregatedList kind. */ + public kind?: (string|null); + + /** InstanceAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** InstanceAggregatedList unreachables. */ + public unreachables: string[]; + + /** InstanceAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceAggregatedList _id. */ + public _id?: "id"; + + /** InstanceAggregatedList _kind. */ + public _kind?: "kind"; + + /** InstanceAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceAggregatedList): google.cloud.compute.v1.InstanceAggregatedList; + + /** + * Encodes the specified InstanceAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceAggregatedList.verify|verify} messages. + * @param message InstanceAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceAggregatedList.verify|verify} messages. + * @param message InstanceAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceAggregatedList; + + /** + * Decodes an InstanceAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceAggregatedList; + + /** + * Verifies an InstanceAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceAggregatedList; + + /** + * Creates a plain object from an InstanceAggregatedList message. Also converts values to other types if specified. + * @param message InstanceAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NamedPort. */ + interface INamedPort { + + /** NamedPort name */ + name?: (string|null); + + /** NamedPort port */ + port?: (number|null); + } + + /** Represents a NamedPort. */ + class NamedPort implements INamedPort { + + /** + * Constructs a new NamedPort. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INamedPort); + + /** NamedPort name. */ + public name?: (string|null); + + /** NamedPort port. */ + public port?: (number|null); + + /** NamedPort _name. */ + public _name?: "name"; + + /** NamedPort _port. */ + public _port?: "port"; + + /** + * Creates a new NamedPort instance using the specified properties. + * @param [properties] Properties to set + * @returns NamedPort instance + */ + public static create(properties?: google.cloud.compute.v1.INamedPort): google.cloud.compute.v1.NamedPort; + + /** + * Encodes the specified NamedPort message. Does not implicitly {@link google.cloud.compute.v1.NamedPort.verify|verify} messages. + * @param message NamedPort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INamedPort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamedPort message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NamedPort.verify|verify} messages. + * @param message NamedPort message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INamedPort, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamedPort message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamedPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NamedPort; + + /** + * Decodes a NamedPort message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamedPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NamedPort; + + /** + * Verifies a NamedPort message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamedPort message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamedPort + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NamedPort; + + /** + * Creates a plain object from a NamedPort message. Also converts values to other types if specified. + * @param message NamedPort + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NamedPort, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamedPort to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroup. */ + interface IInstanceGroup { + + /** InstanceGroup creationTimestamp */ + creationTimestamp?: (string|null); + + /** InstanceGroup description */ + description?: (string|null); + + /** InstanceGroup fingerprint */ + fingerprint?: (string|null); + + /** InstanceGroup id */ + id?: (number|Long|string|null); + + /** InstanceGroup kind */ + kind?: (string|null); + + /** InstanceGroup name */ + name?: (string|null); + + /** InstanceGroup namedPorts */ + namedPorts?: (google.cloud.compute.v1.INamedPort[]|null); + + /** InstanceGroup network */ + network?: (string|null); + + /** InstanceGroup region */ + region?: (string|null); + + /** InstanceGroup selfLink */ + selfLink?: (string|null); + + /** InstanceGroup size */ + size?: (number|null); + + /** InstanceGroup subnetwork */ + subnetwork?: (string|null); + + /** InstanceGroup zone */ + zone?: (string|null); + } + + /** Represents an InstanceGroup. */ + class InstanceGroup implements IInstanceGroup { + + /** + * Constructs a new InstanceGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroup); + + /** InstanceGroup creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** InstanceGroup description. */ + public description?: (string|null); + + /** InstanceGroup fingerprint. */ + public fingerprint?: (string|null); + + /** InstanceGroup id. */ + public id?: (number|Long|string|null); + + /** InstanceGroup kind. */ + public kind?: (string|null); + + /** InstanceGroup name. */ + public name?: (string|null); + + /** InstanceGroup namedPorts. */ + public namedPorts: google.cloud.compute.v1.INamedPort[]; + + /** InstanceGroup network. */ + public network?: (string|null); + + /** InstanceGroup region. */ + public region?: (string|null); + + /** InstanceGroup selfLink. */ + public selfLink?: (string|null); + + /** InstanceGroup size. */ + public size?: (number|null); + + /** InstanceGroup subnetwork. */ + public subnetwork?: (string|null); + + /** InstanceGroup zone. */ + public zone?: (string|null); + + /** InstanceGroup _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** InstanceGroup _description. */ + public _description?: "description"; + + /** InstanceGroup _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** InstanceGroup _id. */ + public _id?: "id"; + + /** InstanceGroup _kind. */ + public _kind?: "kind"; + + /** InstanceGroup _name. */ + public _name?: "name"; + + /** InstanceGroup _network. */ + public _network?: "network"; + + /** InstanceGroup _region. */ + public _region?: "region"; + + /** InstanceGroup _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceGroup _size. */ + public _size?: "size"; + + /** InstanceGroup _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** InstanceGroup _zone. */ + public _zone?: "zone"; + + /** + * Creates a new InstanceGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroup instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroup): google.cloud.compute.v1.InstanceGroup; + + /** + * Encodes the specified InstanceGroup message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroup.verify|verify} messages. + * @param message InstanceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroup message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroup.verify|verify} messages. + * @param message InstanceGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroup; + + /** + * Decodes an InstanceGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroup; + + /** + * Verifies an InstanceGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroup; + + /** + * Creates a plain object from an InstanceGroup message. Also converts values to other types if specified. + * @param message InstanceGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupsScopedList. */ + interface IInstanceGroupsScopedList { + + /** InstanceGroupsScopedList instanceGroups */ + instanceGroups?: (google.cloud.compute.v1.IInstanceGroup[]|null); + + /** InstanceGroupsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupsScopedList. */ + class InstanceGroupsScopedList implements IInstanceGroupsScopedList { + + /** + * Constructs a new InstanceGroupsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupsScopedList); + + /** InstanceGroupsScopedList instanceGroups. */ + public instanceGroups: google.cloud.compute.v1.IInstanceGroup[]; + + /** InstanceGroupsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupsScopedList): google.cloud.compute.v1.InstanceGroupsScopedList; + + /** + * Encodes the specified InstanceGroupsScopedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsScopedList.verify|verify} messages. + * @param message InstanceGroupsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsScopedList.verify|verify} messages. + * @param message InstanceGroupsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupsScopedList; + + /** + * Decodes an InstanceGroupsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupsScopedList; + + /** + * Verifies an InstanceGroupsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupsScopedList; + + /** + * Creates a plain object from an InstanceGroupsScopedList message. Also converts values to other types if specified. + * @param message InstanceGroupsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupAggregatedList. */ + interface IInstanceGroupAggregatedList { + + /** InstanceGroupAggregatedList id */ + id?: (string|null); + + /** InstanceGroupAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IInstanceGroupsScopedList }|null); + + /** InstanceGroupAggregatedList kind */ + kind?: (string|null); + + /** InstanceGroupAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceGroupAggregatedList selfLink */ + selfLink?: (string|null); + + /** InstanceGroupAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** InstanceGroupAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupAggregatedList. */ + class InstanceGroupAggregatedList implements IInstanceGroupAggregatedList { + + /** + * Constructs a new InstanceGroupAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupAggregatedList); + + /** InstanceGroupAggregatedList id. */ + public id?: (string|null); + + /** InstanceGroupAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IInstanceGroupsScopedList }; + + /** InstanceGroupAggregatedList kind. */ + public kind?: (string|null); + + /** InstanceGroupAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** InstanceGroupAggregatedList unreachables. */ + public unreachables: string[]; + + /** InstanceGroupAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupAggregatedList _id. */ + public _id?: "id"; + + /** InstanceGroupAggregatedList _kind. */ + public _kind?: "kind"; + + /** InstanceGroupAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceGroupAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceGroupAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupAggregatedList): google.cloud.compute.v1.InstanceGroupAggregatedList; + + /** + * Encodes the specified InstanceGroupAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupAggregatedList.verify|verify} messages. + * @param message InstanceGroupAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupAggregatedList.verify|verify} messages. + * @param message InstanceGroupAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupAggregatedList; + + /** + * Decodes an InstanceGroupAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupAggregatedList; + + /** + * Verifies an InstanceGroupAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupAggregatedList; + + /** + * Creates a plain object from an InstanceGroupAggregatedList message. Also converts values to other types if specified. + * @param message InstanceGroupAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupList. */ + interface IInstanceGroupList { + + /** InstanceGroupList id */ + id?: (string|null); + + /** InstanceGroupList items */ + items?: (google.cloud.compute.v1.IInstanceGroup[]|null); + + /** InstanceGroupList kind */ + kind?: (string|null); + + /** InstanceGroupList nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceGroupList selfLink */ + selfLink?: (string|null); + + /** InstanceGroupList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupList. */ + class InstanceGroupList implements IInstanceGroupList { + + /** + * Constructs a new InstanceGroupList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupList); + + /** InstanceGroupList id. */ + public id?: (string|null); + + /** InstanceGroupList items. */ + public items: google.cloud.compute.v1.IInstanceGroup[]; + + /** InstanceGroupList kind. */ + public kind?: (string|null); + + /** InstanceGroupList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupList selfLink. */ + public selfLink?: (string|null); + + /** InstanceGroupList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupList _id. */ + public _id?: "id"; + + /** InstanceGroupList _kind. */ + public _kind?: "kind"; + + /** InstanceGroupList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceGroupList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceGroupList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupList): google.cloud.compute.v1.InstanceGroupList; + + /** + * Encodes the specified InstanceGroupList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupList.verify|verify} messages. + * @param message InstanceGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupList.verify|verify} messages. + * @param message InstanceGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupList; + + /** + * Decodes an InstanceGroupList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupList; + + /** + * Verifies an InstanceGroupList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupList; + + /** + * Creates a plain object from an InstanceGroupList message. Also converts values to other types if specified. + * @param message InstanceGroupList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerAutoHealingPolicy. */ + interface IInstanceGroupManagerAutoHealingPolicy { + + /** InstanceGroupManagerAutoHealingPolicy healthCheck */ + healthCheck?: (string|null); + + /** InstanceGroupManagerAutoHealingPolicy initialDelaySec */ + initialDelaySec?: (number|null); + } + + /** Represents an InstanceGroupManagerAutoHealingPolicy. */ + class InstanceGroupManagerAutoHealingPolicy implements IInstanceGroupManagerAutoHealingPolicy { + + /** + * Constructs a new InstanceGroupManagerAutoHealingPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy); + + /** InstanceGroupManagerAutoHealingPolicy healthCheck. */ + public healthCheck?: (string|null); + + /** InstanceGroupManagerAutoHealingPolicy initialDelaySec. */ + public initialDelaySec?: (number|null); + + /** InstanceGroupManagerAutoHealingPolicy _healthCheck. */ + public _healthCheck?: "healthCheck"; + + /** InstanceGroupManagerAutoHealingPolicy _initialDelaySec. */ + public _initialDelaySec?: "initialDelaySec"; + + /** + * Creates a new InstanceGroupManagerAutoHealingPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerAutoHealingPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy): google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy; + + /** + * Encodes the specified InstanceGroupManagerAutoHealingPolicy message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.verify|verify} messages. + * @param message InstanceGroupManagerAutoHealingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerAutoHealingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.verify|verify} messages. + * @param message InstanceGroupManagerAutoHealingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerAutoHealingPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerAutoHealingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy; + + /** + * Decodes an InstanceGroupManagerAutoHealingPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerAutoHealingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy; + + /** + * Verifies an InstanceGroupManagerAutoHealingPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerAutoHealingPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerAutoHealingPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy; + + /** + * Creates a plain object from an InstanceGroupManagerAutoHealingPolicy message. Also converts values to other types if specified. + * @param message InstanceGroupManagerAutoHealingPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerAutoHealingPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerActionsSummary. */ + interface IInstanceGroupManagerActionsSummary { + + /** InstanceGroupManagerActionsSummary abandoning */ + abandoning?: (number|null); + + /** InstanceGroupManagerActionsSummary creating */ + creating?: (number|null); + + /** InstanceGroupManagerActionsSummary creatingWithoutRetries */ + creatingWithoutRetries?: (number|null); + + /** InstanceGroupManagerActionsSummary deleting */ + deleting?: (number|null); + + /** InstanceGroupManagerActionsSummary none */ + none?: (number|null); + + /** InstanceGroupManagerActionsSummary recreating */ + recreating?: (number|null); + + /** InstanceGroupManagerActionsSummary refreshing */ + refreshing?: (number|null); + + /** InstanceGroupManagerActionsSummary restarting */ + restarting?: (number|null); + + /** InstanceGroupManagerActionsSummary verifying */ + verifying?: (number|null); + } + + /** Represents an InstanceGroupManagerActionsSummary. */ + class InstanceGroupManagerActionsSummary implements IInstanceGroupManagerActionsSummary { + + /** + * Constructs a new InstanceGroupManagerActionsSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerActionsSummary); + + /** InstanceGroupManagerActionsSummary abandoning. */ + public abandoning?: (number|null); + + /** InstanceGroupManagerActionsSummary creating. */ + public creating?: (number|null); + + /** InstanceGroupManagerActionsSummary creatingWithoutRetries. */ + public creatingWithoutRetries?: (number|null); + + /** InstanceGroupManagerActionsSummary deleting. */ + public deleting?: (number|null); + + /** InstanceGroupManagerActionsSummary none. */ + public none?: (number|null); + + /** InstanceGroupManagerActionsSummary recreating. */ + public recreating?: (number|null); + + /** InstanceGroupManagerActionsSummary refreshing. */ + public refreshing?: (number|null); + + /** InstanceGroupManagerActionsSummary restarting. */ + public restarting?: (number|null); + + /** InstanceGroupManagerActionsSummary verifying. */ + public verifying?: (number|null); + + /** InstanceGroupManagerActionsSummary _abandoning. */ + public _abandoning?: "abandoning"; + + /** InstanceGroupManagerActionsSummary _creating. */ + public _creating?: "creating"; + + /** InstanceGroupManagerActionsSummary _creatingWithoutRetries. */ + public _creatingWithoutRetries?: "creatingWithoutRetries"; + + /** InstanceGroupManagerActionsSummary _deleting. */ + public _deleting?: "deleting"; + + /** InstanceGroupManagerActionsSummary _none. */ + public _none?: "none"; + + /** InstanceGroupManagerActionsSummary _recreating. */ + public _recreating?: "recreating"; + + /** InstanceGroupManagerActionsSummary _refreshing. */ + public _refreshing?: "refreshing"; + + /** InstanceGroupManagerActionsSummary _restarting. */ + public _restarting?: "restarting"; + + /** InstanceGroupManagerActionsSummary _verifying. */ + public _verifying?: "verifying"; + + /** + * Creates a new InstanceGroupManagerActionsSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerActionsSummary instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerActionsSummary): google.cloud.compute.v1.InstanceGroupManagerActionsSummary; + + /** + * Encodes the specified InstanceGroupManagerActionsSummary message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerActionsSummary.verify|verify} messages. + * @param message InstanceGroupManagerActionsSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerActionsSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerActionsSummary message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerActionsSummary.verify|verify} messages. + * @param message InstanceGroupManagerActionsSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerActionsSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerActionsSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerActionsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerActionsSummary; + + /** + * Decodes an InstanceGroupManagerActionsSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerActionsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerActionsSummary; + + /** + * Verifies an InstanceGroupManagerActionsSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerActionsSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerActionsSummary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerActionsSummary; + + /** + * Creates a plain object from an InstanceGroupManagerActionsSummary message. Also converts values to other types if specified. + * @param message InstanceGroupManagerActionsSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerActionsSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerActionsSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StatefulPolicy. */ + interface IStatefulPolicy { + + /** StatefulPolicy preservedState */ + preservedState?: (google.cloud.compute.v1.IStatefulPolicyPreservedState|null); + } + + /** Represents a StatefulPolicy. */ + class StatefulPolicy implements IStatefulPolicy { + + /** + * Constructs a new StatefulPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IStatefulPolicy); + + /** StatefulPolicy preservedState. */ + public preservedState?: (google.cloud.compute.v1.IStatefulPolicyPreservedState|null); + + /** StatefulPolicy _preservedState. */ + public _preservedState?: "preservedState"; + + /** + * Creates a new StatefulPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns StatefulPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IStatefulPolicy): google.cloud.compute.v1.StatefulPolicy; + + /** + * Encodes the specified StatefulPolicy message. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicy.verify|verify} messages. + * @param message StatefulPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IStatefulPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatefulPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicy.verify|verify} messages. + * @param message StatefulPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IStatefulPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatefulPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatefulPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.StatefulPolicy; + + /** + * Decodes a StatefulPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatefulPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.StatefulPolicy; + + /** + * Verifies a StatefulPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatefulPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatefulPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.StatefulPolicy; + + /** + * Creates a plain object from a StatefulPolicy message. Also converts values to other types if specified. + * @param message StatefulPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.StatefulPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatefulPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerStatus. */ + interface IInstanceGroupManagerStatus { + + /** InstanceGroupManagerStatus autoscaler */ + autoscaler?: (string|null); + + /** InstanceGroupManagerStatus isStable */ + isStable?: (boolean|null); + + /** InstanceGroupManagerStatus stateful */ + stateful?: (google.cloud.compute.v1.IInstanceGroupManagerStatusStateful|null); + + /** InstanceGroupManagerStatus versionTarget */ + versionTarget?: (google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget|null); + } + + /** Represents an InstanceGroupManagerStatus. */ + class InstanceGroupManagerStatus implements IInstanceGroupManagerStatus { + + /** + * Constructs a new InstanceGroupManagerStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatus); + + /** InstanceGroupManagerStatus autoscaler. */ + public autoscaler?: (string|null); + + /** InstanceGroupManagerStatus isStable. */ + public isStable?: (boolean|null); + + /** InstanceGroupManagerStatus stateful. */ + public stateful?: (google.cloud.compute.v1.IInstanceGroupManagerStatusStateful|null); + + /** InstanceGroupManagerStatus versionTarget. */ + public versionTarget?: (google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget|null); + + /** InstanceGroupManagerStatus _autoscaler. */ + public _autoscaler?: "autoscaler"; + + /** InstanceGroupManagerStatus _isStable. */ + public _isStable?: "isStable"; + + /** InstanceGroupManagerStatus _stateful. */ + public _stateful?: "stateful"; + + /** InstanceGroupManagerStatus _versionTarget. */ + public _versionTarget?: "versionTarget"; + + /** + * Creates a new InstanceGroupManagerStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatus): google.cloud.compute.v1.InstanceGroupManagerStatus; + + /** + * Encodes the specified InstanceGroupManagerStatus message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatus.verify|verify} messages. + * @param message InstanceGroupManagerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatus.verify|verify} messages. + * @param message InstanceGroupManagerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerStatus; + + /** + * Decodes an InstanceGroupManagerStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerStatus; + + /** + * Verifies an InstanceGroupManagerStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerStatus; + + /** + * Creates a plain object from an InstanceGroupManagerStatus message. Also converts values to other types if specified. + * @param message InstanceGroupManagerStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerUpdatePolicy. */ + interface IInstanceGroupManagerUpdatePolicy { + + /** InstanceGroupManagerUpdatePolicy instanceRedistributionType */ + instanceRedistributionType?: (string|null); + + /** InstanceGroupManagerUpdatePolicy maxSurge */ + maxSurge?: (google.cloud.compute.v1.IFixedOrPercent|null); + + /** InstanceGroupManagerUpdatePolicy maxUnavailable */ + maxUnavailable?: (google.cloud.compute.v1.IFixedOrPercent|null); + + /** InstanceGroupManagerUpdatePolicy minimalAction */ + minimalAction?: (string|null); + + /** InstanceGroupManagerUpdatePolicy replacementMethod */ + replacementMethod?: (string|null); + + /** InstanceGroupManagerUpdatePolicy type */ + type?: (string|null); + } + + /** Represents an InstanceGroupManagerUpdatePolicy. */ + class InstanceGroupManagerUpdatePolicy implements IInstanceGroupManagerUpdatePolicy { + + /** + * Constructs a new InstanceGroupManagerUpdatePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy); + + /** InstanceGroupManagerUpdatePolicy instanceRedistributionType. */ + public instanceRedistributionType?: (string|null); + + /** InstanceGroupManagerUpdatePolicy maxSurge. */ + public maxSurge?: (google.cloud.compute.v1.IFixedOrPercent|null); + + /** InstanceGroupManagerUpdatePolicy maxUnavailable. */ + public maxUnavailable?: (google.cloud.compute.v1.IFixedOrPercent|null); + + /** InstanceGroupManagerUpdatePolicy minimalAction. */ + public minimalAction?: (string|null); + + /** InstanceGroupManagerUpdatePolicy replacementMethod. */ + public replacementMethod?: (string|null); + + /** InstanceGroupManagerUpdatePolicy type. */ + public type?: (string|null); + + /** InstanceGroupManagerUpdatePolicy _instanceRedistributionType. */ + public _instanceRedistributionType?: "instanceRedistributionType"; + + /** InstanceGroupManagerUpdatePolicy _maxSurge. */ + public _maxSurge?: "maxSurge"; + + /** InstanceGroupManagerUpdatePolicy _maxUnavailable. */ + public _maxUnavailable?: "maxUnavailable"; + + /** InstanceGroupManagerUpdatePolicy _minimalAction. */ + public _minimalAction?: "minimalAction"; + + /** InstanceGroupManagerUpdatePolicy _replacementMethod. */ + public _replacementMethod?: "replacementMethod"; + + /** InstanceGroupManagerUpdatePolicy _type. */ + public _type?: "type"; + + /** + * Creates a new InstanceGroupManagerUpdatePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerUpdatePolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy): google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy; + + /** + * Encodes the specified InstanceGroupManagerUpdatePolicy message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.verify|verify} messages. + * @param message InstanceGroupManagerUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.verify|verify} messages. + * @param message InstanceGroupManagerUpdatePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerUpdatePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy; + + /** + * Decodes an InstanceGroupManagerUpdatePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy; + + /** + * Verifies an InstanceGroupManagerUpdatePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerUpdatePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy; + + /** + * Creates a plain object from an InstanceGroupManagerUpdatePolicy message. Also converts values to other types if specified. + * @param message InstanceGroupManagerUpdatePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerUpdatePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerVersion. */ + interface IInstanceGroupManagerVersion { + + /** InstanceGroupManagerVersion instanceTemplate */ + instanceTemplate?: (string|null); + + /** InstanceGroupManagerVersion name */ + name?: (string|null); + + /** InstanceGroupManagerVersion targetSize */ + targetSize?: (google.cloud.compute.v1.IFixedOrPercent|null); + } + + /** Represents an InstanceGroupManagerVersion. */ + class InstanceGroupManagerVersion implements IInstanceGroupManagerVersion { + + /** + * Constructs a new InstanceGroupManagerVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerVersion); + + /** InstanceGroupManagerVersion instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** InstanceGroupManagerVersion name. */ + public name?: (string|null); + + /** InstanceGroupManagerVersion targetSize. */ + public targetSize?: (google.cloud.compute.v1.IFixedOrPercent|null); + + /** InstanceGroupManagerVersion _instanceTemplate. */ + public _instanceTemplate?: "instanceTemplate"; + + /** InstanceGroupManagerVersion _name. */ + public _name?: "name"; + + /** InstanceGroupManagerVersion _targetSize. */ + public _targetSize?: "targetSize"; + + /** + * Creates a new InstanceGroupManagerVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerVersion instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerVersion): google.cloud.compute.v1.InstanceGroupManagerVersion; + + /** + * Encodes the specified InstanceGroupManagerVersion message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerVersion.verify|verify} messages. + * @param message InstanceGroupManagerVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerVersion message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerVersion.verify|verify} messages. + * @param message InstanceGroupManagerVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerVersion; + + /** + * Decodes an InstanceGroupManagerVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerVersion; + + /** + * Verifies an InstanceGroupManagerVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerVersion; + + /** + * Creates a plain object from an InstanceGroupManagerVersion message. Also converts values to other types if specified. + * @param message InstanceGroupManagerVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManager. */ + interface IInstanceGroupManager { + + /** InstanceGroupManager autoHealingPolicies */ + autoHealingPolicies?: (google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy[]|null); + + /** InstanceGroupManager baseInstanceName */ + baseInstanceName?: (string|null); + + /** InstanceGroupManager creationTimestamp */ + creationTimestamp?: (string|null); + + /** InstanceGroupManager currentActions */ + currentActions?: (google.cloud.compute.v1.IInstanceGroupManagerActionsSummary|null); + + /** InstanceGroupManager description */ + description?: (string|null); + + /** InstanceGroupManager distributionPolicy */ + distributionPolicy?: (google.cloud.compute.v1.IDistributionPolicy|null); + + /** InstanceGroupManager fingerprint */ + fingerprint?: (string|null); + + /** InstanceGroupManager id */ + id?: (number|Long|string|null); + + /** InstanceGroupManager instanceGroup */ + instanceGroup?: (string|null); + + /** InstanceGroupManager instanceTemplate */ + instanceTemplate?: (string|null); + + /** InstanceGroupManager kind */ + kind?: (string|null); + + /** InstanceGroupManager name */ + name?: (string|null); + + /** InstanceGroupManager namedPorts */ + namedPorts?: (google.cloud.compute.v1.INamedPort[]|null); + + /** InstanceGroupManager region */ + region?: (string|null); + + /** InstanceGroupManager selfLink */ + selfLink?: (string|null); + + /** InstanceGroupManager statefulPolicy */ + statefulPolicy?: (google.cloud.compute.v1.IStatefulPolicy|null); + + /** InstanceGroupManager status */ + status?: (google.cloud.compute.v1.IInstanceGroupManagerStatus|null); + + /** InstanceGroupManager targetPools */ + targetPools?: (string[]|null); + + /** InstanceGroupManager targetSize */ + targetSize?: (number|null); + + /** InstanceGroupManager updatePolicy */ + updatePolicy?: (google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy|null); + + /** InstanceGroupManager versions */ + versions?: (google.cloud.compute.v1.IInstanceGroupManagerVersion[]|null); + + /** InstanceGroupManager zone */ + zone?: (string|null); + } + + /** Represents an InstanceGroupManager. */ + class InstanceGroupManager implements IInstanceGroupManager { + + /** + * Constructs a new InstanceGroupManager. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManager); + + /** InstanceGroupManager autoHealingPolicies. */ + public autoHealingPolicies: google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy[]; + + /** InstanceGroupManager baseInstanceName. */ + public baseInstanceName?: (string|null); + + /** InstanceGroupManager creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** InstanceGroupManager currentActions. */ + public currentActions?: (google.cloud.compute.v1.IInstanceGroupManagerActionsSummary|null); + + /** InstanceGroupManager description. */ + public description?: (string|null); + + /** InstanceGroupManager distributionPolicy. */ + public distributionPolicy?: (google.cloud.compute.v1.IDistributionPolicy|null); + + /** InstanceGroupManager fingerprint. */ + public fingerprint?: (string|null); + + /** InstanceGroupManager id. */ + public id?: (number|Long|string|null); + + /** InstanceGroupManager instanceGroup. */ + public instanceGroup?: (string|null); + + /** InstanceGroupManager instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** InstanceGroupManager kind. */ + public kind?: (string|null); + + /** InstanceGroupManager name. */ + public name?: (string|null); + + /** InstanceGroupManager namedPorts. */ + public namedPorts: google.cloud.compute.v1.INamedPort[]; + + /** InstanceGroupManager region. */ + public region?: (string|null); + + /** InstanceGroupManager selfLink. */ + public selfLink?: (string|null); + + /** InstanceGroupManager statefulPolicy. */ + public statefulPolicy?: (google.cloud.compute.v1.IStatefulPolicy|null); + + /** InstanceGroupManager status. */ + public status?: (google.cloud.compute.v1.IInstanceGroupManagerStatus|null); + + /** InstanceGroupManager targetPools. */ + public targetPools: string[]; + + /** InstanceGroupManager targetSize. */ + public targetSize?: (number|null); + + /** InstanceGroupManager updatePolicy. */ + public updatePolicy?: (google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy|null); + + /** InstanceGroupManager versions. */ + public versions: google.cloud.compute.v1.IInstanceGroupManagerVersion[]; + + /** InstanceGroupManager zone. */ + public zone?: (string|null); + + /** InstanceGroupManager _baseInstanceName. */ + public _baseInstanceName?: "baseInstanceName"; + + /** InstanceGroupManager _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** InstanceGroupManager _currentActions. */ + public _currentActions?: "currentActions"; + + /** InstanceGroupManager _description. */ + public _description?: "description"; + + /** InstanceGroupManager _distributionPolicy. */ + public _distributionPolicy?: "distributionPolicy"; + + /** InstanceGroupManager _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** InstanceGroupManager _id. */ + public _id?: "id"; + + /** InstanceGroupManager _instanceGroup. */ + public _instanceGroup?: "instanceGroup"; + + /** InstanceGroupManager _instanceTemplate. */ + public _instanceTemplate?: "instanceTemplate"; + + /** InstanceGroupManager _kind. */ + public _kind?: "kind"; + + /** InstanceGroupManager _name. */ + public _name?: "name"; + + /** InstanceGroupManager _region. */ + public _region?: "region"; + + /** InstanceGroupManager _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceGroupManager _statefulPolicy. */ + public _statefulPolicy?: "statefulPolicy"; + + /** InstanceGroupManager _status. */ + public _status?: "status"; + + /** InstanceGroupManager _targetSize. */ + public _targetSize?: "targetSize"; + + /** InstanceGroupManager _updatePolicy. */ + public _updatePolicy?: "updatePolicy"; + + /** InstanceGroupManager _zone. */ + public _zone?: "zone"; + + /** + * Creates a new InstanceGroupManager instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManager instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManager): google.cloud.compute.v1.InstanceGroupManager; + + /** + * Encodes the specified InstanceGroupManager message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManager.verify|verify} messages. + * @param message InstanceGroupManager message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManager, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManager message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManager.verify|verify} messages. + * @param message InstanceGroupManager message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManager, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManager message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManager + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManager; + + /** + * Decodes an InstanceGroupManager message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManager + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManager; + + /** + * Verifies an InstanceGroupManager message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManager message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManager + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManager; + + /** + * Creates a plain object from an InstanceGroupManager message. Also converts values to other types if specified. + * @param message InstanceGroupManager + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManager, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManager to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersScopedList. */ + interface IInstanceGroupManagersScopedList { + + /** InstanceGroupManagersScopedList instanceGroupManagers */ + instanceGroupManagers?: (google.cloud.compute.v1.IInstanceGroupManager[]|null); + + /** InstanceGroupManagersScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupManagersScopedList. */ + class InstanceGroupManagersScopedList implements IInstanceGroupManagersScopedList { + + /** + * Constructs a new InstanceGroupManagersScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersScopedList); + + /** InstanceGroupManagersScopedList instanceGroupManagers. */ + public instanceGroupManagers: google.cloud.compute.v1.IInstanceGroupManager[]; + + /** InstanceGroupManagersScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupManagersScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupManagersScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersScopedList): google.cloud.compute.v1.InstanceGroupManagersScopedList; + + /** + * Encodes the specified InstanceGroupManagersScopedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersScopedList.verify|verify} messages. + * @param message InstanceGroupManagersScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersScopedList.verify|verify} messages. + * @param message InstanceGroupManagersScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersScopedList; + + /** + * Decodes an InstanceGroupManagersScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersScopedList; + + /** + * Verifies an InstanceGroupManagersScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersScopedList; + + /** + * Creates a plain object from an InstanceGroupManagersScopedList message. Also converts values to other types if specified. + * @param message InstanceGroupManagersScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerAggregatedList. */ + interface IInstanceGroupManagerAggregatedList { + + /** InstanceGroupManagerAggregatedList id */ + id?: (string|null); + + /** InstanceGroupManagerAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IInstanceGroupManagersScopedList }|null); + + /** InstanceGroupManagerAggregatedList kind */ + kind?: (string|null); + + /** InstanceGroupManagerAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceGroupManagerAggregatedList selfLink */ + selfLink?: (string|null); + + /** InstanceGroupManagerAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** InstanceGroupManagerAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupManagerAggregatedList. */ + class InstanceGroupManagerAggregatedList implements IInstanceGroupManagerAggregatedList { + + /** + * Constructs a new InstanceGroupManagerAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerAggregatedList); + + /** InstanceGroupManagerAggregatedList id. */ + public id?: (string|null); + + /** InstanceGroupManagerAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IInstanceGroupManagersScopedList }; + + /** InstanceGroupManagerAggregatedList kind. */ + public kind?: (string|null); + + /** InstanceGroupManagerAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupManagerAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** InstanceGroupManagerAggregatedList unreachables. */ + public unreachables: string[]; + + /** InstanceGroupManagerAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupManagerAggregatedList _id. */ + public _id?: "id"; + + /** InstanceGroupManagerAggregatedList _kind. */ + public _kind?: "kind"; + + /** InstanceGroupManagerAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceGroupManagerAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceGroupManagerAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupManagerAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerAggregatedList): google.cloud.compute.v1.InstanceGroupManagerAggregatedList; + + /** + * Encodes the specified InstanceGroupManagerAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAggregatedList.verify|verify} messages. + * @param message InstanceGroupManagerAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAggregatedList.verify|verify} messages. + * @param message InstanceGroupManagerAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerAggregatedList; + + /** + * Decodes an InstanceGroupManagerAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerAggregatedList; + + /** + * Verifies an InstanceGroupManagerAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerAggregatedList; + + /** + * Creates a plain object from an InstanceGroupManagerAggregatedList message. Also converts values to other types if specified. + * @param message InstanceGroupManagerAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerList. */ + interface IInstanceGroupManagerList { + + /** InstanceGroupManagerList id */ + id?: (string|null); + + /** InstanceGroupManagerList items */ + items?: (google.cloud.compute.v1.IInstanceGroupManager[]|null); + + /** InstanceGroupManagerList kind */ + kind?: (string|null); + + /** InstanceGroupManagerList nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceGroupManagerList selfLink */ + selfLink?: (string|null); + + /** InstanceGroupManagerList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupManagerList. */ + class InstanceGroupManagerList implements IInstanceGroupManagerList { + + /** + * Constructs a new InstanceGroupManagerList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerList); + + /** InstanceGroupManagerList id. */ + public id?: (string|null); + + /** InstanceGroupManagerList items. */ + public items: google.cloud.compute.v1.IInstanceGroupManager[]; + + /** InstanceGroupManagerList kind. */ + public kind?: (string|null); + + /** InstanceGroupManagerList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupManagerList selfLink. */ + public selfLink?: (string|null); + + /** InstanceGroupManagerList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupManagerList _id. */ + public _id?: "id"; + + /** InstanceGroupManagerList _kind. */ + public _kind?: "kind"; + + /** InstanceGroupManagerList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceGroupManagerList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceGroupManagerList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupManagerList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerList): google.cloud.compute.v1.InstanceGroupManagerList; + + /** + * Encodes the specified InstanceGroupManagerList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerList.verify|verify} messages. + * @param message InstanceGroupManagerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerList.verify|verify} messages. + * @param message InstanceGroupManagerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerList; + + /** + * Decodes an InstanceGroupManagerList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerList; + + /** + * Verifies an InstanceGroupManagerList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerList; + + /** + * Creates a plain object from an InstanceGroupManagerList message. Also converts values to other types if specified. + * @param message InstanceGroupManagerList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerStatusStateful. */ + interface IInstanceGroupManagerStatusStateful { + + /** InstanceGroupManagerStatusStateful hasStatefulConfig */ + hasStatefulConfig?: (boolean|null); + + /** InstanceGroupManagerStatusStateful perInstanceConfigs */ + perInstanceConfigs?: (google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs|null); + } + + /** Represents an InstanceGroupManagerStatusStateful. */ + class InstanceGroupManagerStatusStateful implements IInstanceGroupManagerStatusStateful { + + /** + * Constructs a new InstanceGroupManagerStatusStateful. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatusStateful); + + /** InstanceGroupManagerStatusStateful hasStatefulConfig. */ + public hasStatefulConfig?: (boolean|null); + + /** InstanceGroupManagerStatusStateful perInstanceConfigs. */ + public perInstanceConfigs?: (google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs|null); + + /** InstanceGroupManagerStatusStateful _hasStatefulConfig. */ + public _hasStatefulConfig?: "hasStatefulConfig"; + + /** InstanceGroupManagerStatusStateful _perInstanceConfigs. */ + public _perInstanceConfigs?: "perInstanceConfigs"; + + /** + * Creates a new InstanceGroupManagerStatusStateful instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerStatusStateful instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatusStateful): google.cloud.compute.v1.InstanceGroupManagerStatusStateful; + + /** + * Encodes the specified InstanceGroupManagerStatusStateful message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStateful.verify|verify} messages. + * @param message InstanceGroupManagerStatusStateful message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerStatusStateful, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerStatusStateful message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStateful.verify|verify} messages. + * @param message InstanceGroupManagerStatusStateful message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerStatusStateful, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerStatusStateful message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerStatusStateful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerStatusStateful; + + /** + * Decodes an InstanceGroupManagerStatusStateful message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerStatusStateful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerStatusStateful; + + /** + * Verifies an InstanceGroupManagerStatusStateful message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerStatusStateful message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerStatusStateful + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerStatusStateful; + + /** + * Creates a plain object from an InstanceGroupManagerStatusStateful message. Also converts values to other types if specified. + * @param message InstanceGroupManagerStatusStateful + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerStatusStateful, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerStatusStateful to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerStatusVersionTarget. */ + interface IInstanceGroupManagerStatusVersionTarget { + + /** InstanceGroupManagerStatusVersionTarget isReached */ + isReached?: (boolean|null); + } + + /** Represents an InstanceGroupManagerStatusVersionTarget. */ + class InstanceGroupManagerStatusVersionTarget implements IInstanceGroupManagerStatusVersionTarget { + + /** + * Constructs a new InstanceGroupManagerStatusVersionTarget. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget); + + /** InstanceGroupManagerStatusVersionTarget isReached. */ + public isReached?: (boolean|null); + + /** InstanceGroupManagerStatusVersionTarget _isReached. */ + public _isReached?: "isReached"; + + /** + * Creates a new InstanceGroupManagerStatusVersionTarget instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerStatusVersionTarget instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget): google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget; + + /** + * Encodes the specified InstanceGroupManagerStatusVersionTarget message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.verify|verify} messages. + * @param message InstanceGroupManagerStatusVersionTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerStatusVersionTarget message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.verify|verify} messages. + * @param message InstanceGroupManagerStatusVersionTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerStatusVersionTarget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerStatusVersionTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget; + + /** + * Decodes an InstanceGroupManagerStatusVersionTarget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerStatusVersionTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget; + + /** + * Verifies an InstanceGroupManagerStatusVersionTarget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerStatusVersionTarget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerStatusVersionTarget + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget; + + /** + * Creates a plain object from an InstanceGroupManagerStatusVersionTarget message. Also converts values to other types if specified. + * @param message InstanceGroupManagerStatusVersionTarget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerStatusVersionTarget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagerStatusStatefulPerInstanceConfigs. */ + interface IInstanceGroupManagerStatusStatefulPerInstanceConfigs { + + /** InstanceGroupManagerStatusStatefulPerInstanceConfigs allEffective */ + allEffective?: (boolean|null); + } + + /** Represents an InstanceGroupManagerStatusStatefulPerInstanceConfigs. */ + class InstanceGroupManagerStatusStatefulPerInstanceConfigs implements IInstanceGroupManagerStatusStatefulPerInstanceConfigs { + + /** + * Constructs a new InstanceGroupManagerStatusStatefulPerInstanceConfigs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs); + + /** InstanceGroupManagerStatusStatefulPerInstanceConfigs allEffective. */ + public allEffective?: (boolean|null); + + /** InstanceGroupManagerStatusStatefulPerInstanceConfigs _allEffective. */ + public _allEffective?: "allEffective"; + + /** + * Creates a new InstanceGroupManagerStatusStatefulPerInstanceConfigs instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagerStatusStatefulPerInstanceConfigs instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs): google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs; + + /** + * Encodes the specified InstanceGroupManagerStatusStatefulPerInstanceConfigs message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.verify|verify} messages. + * @param message InstanceGroupManagerStatusStatefulPerInstanceConfigs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagerStatusStatefulPerInstanceConfigs message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.verify|verify} messages. + * @param message InstanceGroupManagerStatusStatefulPerInstanceConfigs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagerStatusStatefulPerInstanceConfigs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs; + + /** + * Decodes an InstanceGroupManagerStatusStatefulPerInstanceConfigs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs; + + /** + * Verifies an InstanceGroupManagerStatusStatefulPerInstanceConfigs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagerStatusStatefulPerInstanceConfigs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagerStatusStatefulPerInstanceConfigs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs; + + /** + * Creates a plain object from an InstanceGroupManagerStatusStatefulPerInstanceConfigs message. Also converts values to other types if specified. + * @param message InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagerStatusStatefulPerInstanceConfigs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersAbandonInstancesRequest. */ + interface IInstanceGroupManagersAbandonInstancesRequest { + + /** InstanceGroupManagersAbandonInstancesRequest instances */ + instances?: (string[]|null); + } + + /** Represents an InstanceGroupManagersAbandonInstancesRequest. */ + class InstanceGroupManagersAbandonInstancesRequest implements IInstanceGroupManagersAbandonInstancesRequest { + + /** + * Constructs a new InstanceGroupManagersAbandonInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest); + + /** InstanceGroupManagersAbandonInstancesRequest instances. */ + public instances: string[]; + + /** + * Creates a new InstanceGroupManagersAbandonInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersAbandonInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest): google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; + + /** + * Encodes the specified InstanceGroupManagersAbandonInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersAbandonInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; + + /** + * Decodes an InstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; + + /** + * Verifies an InstanceGroupManagersAbandonInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersAbandonInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersAbandonInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest; + + /** + * Creates a plain object from an InstanceGroupManagersAbandonInstancesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupManagersAbandonInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersAbandonInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersApplyUpdatesRequest. */ + interface IInstanceGroupManagersApplyUpdatesRequest { + + /** InstanceGroupManagersApplyUpdatesRequest allInstances */ + allInstances?: (boolean|null); + + /** InstanceGroupManagersApplyUpdatesRequest instances */ + instances?: (string[]|null); + + /** InstanceGroupManagersApplyUpdatesRequest minimalAction */ + minimalAction?: (string|null); + + /** InstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction */ + mostDisruptiveAllowedAction?: (string|null); + } + + /** Represents an InstanceGroupManagersApplyUpdatesRequest. */ + class InstanceGroupManagersApplyUpdatesRequest implements IInstanceGroupManagersApplyUpdatesRequest { + + /** + * Constructs a new InstanceGroupManagersApplyUpdatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest); + + /** InstanceGroupManagersApplyUpdatesRequest allInstances. */ + public allInstances?: (boolean|null); + + /** InstanceGroupManagersApplyUpdatesRequest instances. */ + public instances: string[]; + + /** InstanceGroupManagersApplyUpdatesRequest minimalAction. */ + public minimalAction?: (string|null); + + /** InstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction. */ + public mostDisruptiveAllowedAction?: (string|null); + + /** InstanceGroupManagersApplyUpdatesRequest _allInstances. */ + public _allInstances?: "allInstances"; + + /** InstanceGroupManagersApplyUpdatesRequest _minimalAction. */ + public _minimalAction?: "minimalAction"; + + /** InstanceGroupManagersApplyUpdatesRequest _mostDisruptiveAllowedAction. */ + public _mostDisruptiveAllowedAction?: "mostDisruptiveAllowedAction"; + + /** + * Creates a new InstanceGroupManagersApplyUpdatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersApplyUpdatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest): google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest; + + /** + * Encodes the specified InstanceGroupManagersApplyUpdatesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @param message InstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersApplyUpdatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @param message InstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest; + + /** + * Decodes an InstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest; + + /** + * Verifies an InstanceGroupManagersApplyUpdatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersApplyUpdatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersApplyUpdatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest; + + /** + * Creates a plain object from an InstanceGroupManagersApplyUpdatesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupManagersApplyUpdatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersApplyUpdatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PerInstanceConfig. */ + interface IPerInstanceConfig { + + /** PerInstanceConfig fingerprint */ + fingerprint?: (string|null); + + /** PerInstanceConfig name */ + name?: (string|null); + + /** PerInstanceConfig preservedState */ + preservedState?: (google.cloud.compute.v1.IPreservedState|null); + + /** PerInstanceConfig status */ + status?: (google.cloud.compute.v1.PerInstanceConfig.Status|keyof typeof google.cloud.compute.v1.PerInstanceConfig.Status|null); + } + + /** Represents a PerInstanceConfig. */ + class PerInstanceConfig implements IPerInstanceConfig { + + /** + * Constructs a new PerInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPerInstanceConfig); + + /** PerInstanceConfig fingerprint. */ + public fingerprint?: (string|null); + + /** PerInstanceConfig name. */ + public name?: (string|null); + + /** PerInstanceConfig preservedState. */ + public preservedState?: (google.cloud.compute.v1.IPreservedState|null); + + /** PerInstanceConfig status. */ + public status?: (google.cloud.compute.v1.PerInstanceConfig.Status|keyof typeof google.cloud.compute.v1.PerInstanceConfig.Status|null); + + /** PerInstanceConfig _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** PerInstanceConfig _name. */ + public _name?: "name"; + + /** PerInstanceConfig _preservedState. */ + public _preservedState?: "preservedState"; + + /** PerInstanceConfig _status. */ + public _status?: "status"; + + /** + * Creates a new PerInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PerInstanceConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IPerInstanceConfig): google.cloud.compute.v1.PerInstanceConfig; + + /** + * Encodes the specified PerInstanceConfig message. Does not implicitly {@link google.cloud.compute.v1.PerInstanceConfig.verify|verify} messages. + * @param message PerInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPerInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PerInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PerInstanceConfig.verify|verify} messages. + * @param message PerInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPerInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PerInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PerInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PerInstanceConfig; + + /** + * Decodes a PerInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PerInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PerInstanceConfig; + + /** + * Verifies a PerInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PerInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PerInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PerInstanceConfig; + + /** + * Creates a plain object from a PerInstanceConfig message. Also converts values to other types if specified. + * @param message PerInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PerInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PerInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PerInstanceConfig { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + APPLYING = 352003508, + DELETING = 528602024, + EFFECTIVE = 244201863, + NONE = 2402104, + UNAPPLIED = 483935140, + UNAPPLIED_DELETION = 313956873 + } + } + + /** Properties of an InstanceGroupManagersCreateInstancesRequest. */ + interface IInstanceGroupManagersCreateInstancesRequest { + + /** InstanceGroupManagersCreateInstancesRequest instances */ + instances?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + } + + /** Represents an InstanceGroupManagersCreateInstancesRequest. */ + class InstanceGroupManagersCreateInstancesRequest implements IInstanceGroupManagersCreateInstancesRequest { + + /** + * Constructs a new InstanceGroupManagersCreateInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest); + + /** InstanceGroupManagersCreateInstancesRequest instances. */ + public instances: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** + * Creates a new InstanceGroupManagersCreateInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersCreateInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest): google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest; + + /** + * Encodes the specified InstanceGroupManagersCreateInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest; + + /** + * Decodes an InstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest; + + /** + * Verifies an InstanceGroupManagersCreateInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersCreateInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest; + + /** + * Creates a plain object from an InstanceGroupManagersCreateInstancesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupManagersCreateInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersCreateInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersDeleteInstancesRequest. */ + interface IInstanceGroupManagersDeleteInstancesRequest { + + /** InstanceGroupManagersDeleteInstancesRequest instances */ + instances?: (string[]|null); + } + + /** Represents an InstanceGroupManagersDeleteInstancesRequest. */ + class InstanceGroupManagersDeleteInstancesRequest implements IInstanceGroupManagersDeleteInstancesRequest { + + /** + * Constructs a new InstanceGroupManagersDeleteInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest); + + /** InstanceGroupManagersDeleteInstancesRequest instances. */ + public instances: string[]; + + /** + * Creates a new InstanceGroupManagersDeleteInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersDeleteInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest): google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; + + /** + * Encodes the specified InstanceGroupManagersDeleteInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersDeleteInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; + + /** + * Decodes an InstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; + + /** + * Verifies an InstanceGroupManagersDeleteInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersDeleteInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersDeleteInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest; + + /** + * Creates a plain object from an InstanceGroupManagersDeleteInstancesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupManagersDeleteInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersDeleteInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersDeletePerInstanceConfigsReq. */ + interface IInstanceGroupManagersDeletePerInstanceConfigsReq { + + /** InstanceGroupManagersDeletePerInstanceConfigsReq names */ + names?: (string[]|null); + } + + /** Represents an InstanceGroupManagersDeletePerInstanceConfigsReq. */ + class InstanceGroupManagersDeletePerInstanceConfigsReq implements IInstanceGroupManagersDeletePerInstanceConfigsReq { + + /** + * Constructs a new InstanceGroupManagersDeletePerInstanceConfigsReq. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq); + + /** InstanceGroupManagersDeletePerInstanceConfigsReq names. */ + public names: string[]; + + /** + * Creates a new InstanceGroupManagersDeletePerInstanceConfigsReq instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersDeletePerInstanceConfigsReq instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq): google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq; + + /** + * Encodes the specified InstanceGroupManagersDeletePerInstanceConfigsReq message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.verify|verify} messages. + * @param message InstanceGroupManagersDeletePerInstanceConfigsReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersDeletePerInstanceConfigsReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.verify|verify} messages. + * @param message InstanceGroupManagersDeletePerInstanceConfigsReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersDeletePerInstanceConfigsReq message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersDeletePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq; + + /** + * Decodes an InstanceGroupManagersDeletePerInstanceConfigsReq message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersDeletePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq; + + /** + * Verifies an InstanceGroupManagersDeletePerInstanceConfigsReq message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersDeletePerInstanceConfigsReq message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersDeletePerInstanceConfigsReq + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq; + + /** + * Creates a plain object from an InstanceGroupManagersDeletePerInstanceConfigsReq message. Also converts values to other types if specified. + * @param message InstanceGroupManagersDeletePerInstanceConfigsReq + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersDeletePerInstanceConfigsReq to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceManagedByIgmError. */ + interface IInstanceManagedByIgmError { + + /** InstanceManagedByIgmError error */ + error?: (google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError|null); + + /** InstanceManagedByIgmError instanceActionDetails */ + instanceActionDetails?: (google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails|null); + + /** InstanceManagedByIgmError timestamp */ + timestamp?: (string|null); + } + + /** Represents an InstanceManagedByIgmError. */ + class InstanceManagedByIgmError implements IInstanceManagedByIgmError { + + /** + * Constructs a new InstanceManagedByIgmError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceManagedByIgmError); + + /** InstanceManagedByIgmError error. */ + public error?: (google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError|null); + + /** InstanceManagedByIgmError instanceActionDetails. */ + public instanceActionDetails?: (google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails|null); + + /** InstanceManagedByIgmError timestamp. */ + public timestamp?: (string|null); + + /** InstanceManagedByIgmError _error. */ + public _error?: "error"; + + /** InstanceManagedByIgmError _instanceActionDetails. */ + public _instanceActionDetails?: "instanceActionDetails"; + + /** InstanceManagedByIgmError _timestamp. */ + public _timestamp?: "timestamp"; + + /** + * Creates a new InstanceManagedByIgmError instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceManagedByIgmError instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceManagedByIgmError): google.cloud.compute.v1.InstanceManagedByIgmError; + + /** + * Encodes the specified InstanceManagedByIgmError message. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmError.verify|verify} messages. + * @param message InstanceManagedByIgmError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceManagedByIgmError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceManagedByIgmError message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmError.verify|verify} messages. + * @param message InstanceManagedByIgmError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceManagedByIgmError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceManagedByIgmError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceManagedByIgmError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceManagedByIgmError; + + /** + * Decodes an InstanceManagedByIgmError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceManagedByIgmError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceManagedByIgmError; + + /** + * Verifies an InstanceManagedByIgmError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceManagedByIgmError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceManagedByIgmError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceManagedByIgmError; + + /** + * Creates a plain object from an InstanceManagedByIgmError message. Also converts values to other types if specified. + * @param message InstanceManagedByIgmError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceManagedByIgmError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceManagedByIgmError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersListErrorsResponse. */ + interface IInstanceGroupManagersListErrorsResponse { + + /** InstanceGroupManagersListErrorsResponse items */ + items?: (google.cloud.compute.v1.IInstanceManagedByIgmError[]|null); + + /** InstanceGroupManagersListErrorsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents an InstanceGroupManagersListErrorsResponse. */ + class InstanceGroupManagersListErrorsResponse implements IInstanceGroupManagersListErrorsResponse { + + /** + * Constructs a new InstanceGroupManagersListErrorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse); + + /** InstanceGroupManagersListErrorsResponse items. */ + public items: google.cloud.compute.v1.IInstanceManagedByIgmError[]; + + /** InstanceGroupManagersListErrorsResponse nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupManagersListErrorsResponse _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** + * Creates a new InstanceGroupManagersListErrorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersListErrorsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse): google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse; + + /** + * Encodes the specified InstanceGroupManagersListErrorsResponse message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @param message InstanceGroupManagersListErrorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersListErrorsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @param message InstanceGroupManagersListErrorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersListErrorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse; + + /** + * Decodes an InstanceGroupManagersListErrorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse; + + /** + * Verifies an InstanceGroupManagersListErrorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersListErrorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersListErrorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse; + + /** + * Creates a plain object from an InstanceGroupManagersListErrorsResponse message. Also converts values to other types if specified. + * @param message InstanceGroupManagersListErrorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersListErrorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ManagedInstance. */ + interface IManagedInstance { + + /** ManagedInstance currentAction */ + currentAction?: (google.cloud.compute.v1.ManagedInstance.CurrentAction|keyof typeof google.cloud.compute.v1.ManagedInstance.CurrentAction|null); + + /** ManagedInstance id */ + id?: (number|Long|string|null); + + /** ManagedInstance instance */ + instance?: (string|null); + + /** ManagedInstance instanceHealth */ + instanceHealth?: (google.cloud.compute.v1.IManagedInstanceInstanceHealth[]|null); + + /** ManagedInstance instanceStatus */ + instanceStatus?: (google.cloud.compute.v1.ManagedInstance.InstanceStatus|keyof typeof google.cloud.compute.v1.ManagedInstance.InstanceStatus|null); + + /** ManagedInstance lastAttempt */ + lastAttempt?: (google.cloud.compute.v1.IManagedInstanceLastAttempt|null); + + /** ManagedInstance preservedStateFromConfig */ + preservedStateFromConfig?: (google.cloud.compute.v1.IPreservedState|null); + + /** ManagedInstance preservedStateFromPolicy */ + preservedStateFromPolicy?: (google.cloud.compute.v1.IPreservedState|null); + + /** ManagedInstance version */ + version?: (google.cloud.compute.v1.IManagedInstanceVersion|null); + } + + /** Represents a ManagedInstance. */ + class ManagedInstance implements IManagedInstance { + + /** + * Constructs a new ManagedInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IManagedInstance); + + /** ManagedInstance currentAction. */ + public currentAction?: (google.cloud.compute.v1.ManagedInstance.CurrentAction|keyof typeof google.cloud.compute.v1.ManagedInstance.CurrentAction|null); + + /** ManagedInstance id. */ + public id?: (number|Long|string|null); + + /** ManagedInstance instance. */ + public instance?: (string|null); + + /** ManagedInstance instanceHealth. */ + public instanceHealth: google.cloud.compute.v1.IManagedInstanceInstanceHealth[]; + + /** ManagedInstance instanceStatus. */ + public instanceStatus?: (google.cloud.compute.v1.ManagedInstance.InstanceStatus|keyof typeof google.cloud.compute.v1.ManagedInstance.InstanceStatus|null); + + /** ManagedInstance lastAttempt. */ + public lastAttempt?: (google.cloud.compute.v1.IManagedInstanceLastAttempt|null); + + /** ManagedInstance preservedStateFromConfig. */ + public preservedStateFromConfig?: (google.cloud.compute.v1.IPreservedState|null); + + /** ManagedInstance preservedStateFromPolicy. */ + public preservedStateFromPolicy?: (google.cloud.compute.v1.IPreservedState|null); + + /** ManagedInstance version. */ + public version?: (google.cloud.compute.v1.IManagedInstanceVersion|null); + + /** ManagedInstance _currentAction. */ + public _currentAction?: "currentAction"; + + /** ManagedInstance _id. */ + public _id?: "id"; + + /** ManagedInstance _instance. */ + public _instance?: "instance"; + + /** ManagedInstance _instanceStatus. */ + public _instanceStatus?: "instanceStatus"; + + /** ManagedInstance _lastAttempt. */ + public _lastAttempt?: "lastAttempt"; + + /** ManagedInstance _preservedStateFromConfig. */ + public _preservedStateFromConfig?: "preservedStateFromConfig"; + + /** ManagedInstance _preservedStateFromPolicy. */ + public _preservedStateFromPolicy?: "preservedStateFromPolicy"; + + /** ManagedInstance _version. */ + public _version?: "version"; + + /** + * Creates a new ManagedInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedInstance instance + */ + public static create(properties?: google.cloud.compute.v1.IManagedInstance): google.cloud.compute.v1.ManagedInstance; + + /** + * Encodes the specified ManagedInstance message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstance.verify|verify} messages. + * @param message ManagedInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IManagedInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedInstance message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstance.verify|verify} messages. + * @param message ManagedInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IManagedInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ManagedInstance; + + /** + * Decodes a ManagedInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ManagedInstance; + + /** + * Verifies a ManagedInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ManagedInstance; + + /** + * Creates a plain object from a ManagedInstance message. Also converts values to other types if specified. + * @param message ManagedInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ManagedInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ManagedInstance { + + /** CurrentAction enum. */ + enum CurrentAction { + UNDEFINED_CURRENT_ACTION = 0, + ABANDONING = 388244813, + CREATING = 455564985, + CREATING_WITHOUT_RETRIES = 428843785, + DELETING = 528602024, + NONE = 2402104, + RECREATING = 287278572, + REFRESHING = 163266343, + RESTARTING = 320534387, + VERIFYING = 16982185 + } + + /** InstanceStatus enum. */ + enum InstanceStatus { + UNDEFINED_INSTANCE_STATUS = 0, + DEPROVISIONING = 428935662, + PROVISIONING = 290896621, + REPAIRING = 413483285, + RUNNING = 121282975, + STAGING = 431072283, + STOPPED = 444276141, + STOPPING = 350791796, + SUSPENDED = 51223995, + SUSPENDING = 514206246, + TERMINATED = 250018339 + } + } + + /** Properties of an InstanceGroupManagersListManagedInstancesResponse. */ + interface IInstanceGroupManagersListManagedInstancesResponse { + + /** InstanceGroupManagersListManagedInstancesResponse managedInstances */ + managedInstances?: (google.cloud.compute.v1.IManagedInstance[]|null); + + /** InstanceGroupManagersListManagedInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents an InstanceGroupManagersListManagedInstancesResponse. */ + class InstanceGroupManagersListManagedInstancesResponse implements IInstanceGroupManagersListManagedInstancesResponse { + + /** + * Constructs a new InstanceGroupManagersListManagedInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse); + + /** InstanceGroupManagersListManagedInstancesResponse managedInstances. */ + public managedInstances: google.cloud.compute.v1.IManagedInstance[]; + + /** InstanceGroupManagersListManagedInstancesResponse nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupManagersListManagedInstancesResponse _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** + * Creates a new InstanceGroupManagersListManagedInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersListManagedInstancesResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse): google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; + + /** + * Encodes the specified InstanceGroupManagersListManagedInstancesResponse message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse.verify|verify} messages. + * @param message InstanceGroupManagersListManagedInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersListManagedInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse.verify|verify} messages. + * @param message InstanceGroupManagersListManagedInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersListManagedInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersListManagedInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; + + /** + * Decodes an InstanceGroupManagersListManagedInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersListManagedInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; + + /** + * Verifies an InstanceGroupManagersListManagedInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersListManagedInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersListManagedInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse; + + /** + * Creates a plain object from an InstanceGroupManagersListManagedInstancesResponse message. Also converts values to other types if specified. + * @param message InstanceGroupManagersListManagedInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersListManagedInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersListPerInstanceConfigsResp. */ + interface IInstanceGroupManagersListPerInstanceConfigsResp { + + /** InstanceGroupManagersListPerInstanceConfigsResp items */ + items?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + + /** InstanceGroupManagersListPerInstanceConfigsResp nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceGroupManagersListPerInstanceConfigsResp warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupManagersListPerInstanceConfigsResp. */ + class InstanceGroupManagersListPerInstanceConfigsResp implements IInstanceGroupManagersListPerInstanceConfigsResp { + + /** + * Constructs a new InstanceGroupManagersListPerInstanceConfigsResp. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp); + + /** InstanceGroupManagersListPerInstanceConfigsResp items. */ + public items: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** InstanceGroupManagersListPerInstanceConfigsResp nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupManagersListPerInstanceConfigsResp warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupManagersListPerInstanceConfigsResp _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceGroupManagersListPerInstanceConfigsResp _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupManagersListPerInstanceConfigsResp instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersListPerInstanceConfigsResp instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp): google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp; + + /** + * Encodes the specified InstanceGroupManagersListPerInstanceConfigsResp message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp.verify|verify} messages. + * @param message InstanceGroupManagersListPerInstanceConfigsResp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersListPerInstanceConfigsResp message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp.verify|verify} messages. + * @param message InstanceGroupManagersListPerInstanceConfigsResp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersListPerInstanceConfigsResp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersListPerInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp; + + /** + * Decodes an InstanceGroupManagersListPerInstanceConfigsResp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersListPerInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp; + + /** + * Verifies an InstanceGroupManagersListPerInstanceConfigsResp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersListPerInstanceConfigsResp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersListPerInstanceConfigsResp + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp; + + /** + * Creates a plain object from an InstanceGroupManagersListPerInstanceConfigsResp message. Also converts values to other types if specified. + * @param message InstanceGroupManagersListPerInstanceConfigsResp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersListPerInstanceConfigsResp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersPatchPerInstanceConfigsReq. */ + interface IInstanceGroupManagersPatchPerInstanceConfigsReq { + + /** InstanceGroupManagersPatchPerInstanceConfigsReq perInstanceConfigs */ + perInstanceConfigs?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + } + + /** Represents an InstanceGroupManagersPatchPerInstanceConfigsReq. */ + class InstanceGroupManagersPatchPerInstanceConfigsReq implements IInstanceGroupManagersPatchPerInstanceConfigsReq { + + /** + * Constructs a new InstanceGroupManagersPatchPerInstanceConfigsReq. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq); + + /** InstanceGroupManagersPatchPerInstanceConfigsReq perInstanceConfigs. */ + public perInstanceConfigs: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** + * Creates a new InstanceGroupManagersPatchPerInstanceConfigsReq instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersPatchPerInstanceConfigsReq instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq): google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq; + + /** + * Encodes the specified InstanceGroupManagersPatchPerInstanceConfigsReq message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.verify|verify} messages. + * @param message InstanceGroupManagersPatchPerInstanceConfigsReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersPatchPerInstanceConfigsReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.verify|verify} messages. + * @param message InstanceGroupManagersPatchPerInstanceConfigsReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersPatchPerInstanceConfigsReq message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersPatchPerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq; + + /** + * Decodes an InstanceGroupManagersPatchPerInstanceConfigsReq message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersPatchPerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq; + + /** + * Verifies an InstanceGroupManagersPatchPerInstanceConfigsReq message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersPatchPerInstanceConfigsReq message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersPatchPerInstanceConfigsReq + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq; + + /** + * Creates a plain object from an InstanceGroupManagersPatchPerInstanceConfigsReq message. Also converts values to other types if specified. + * @param message InstanceGroupManagersPatchPerInstanceConfigsReq + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersPatchPerInstanceConfigsReq to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersRecreateInstancesRequest. */ + interface IInstanceGroupManagersRecreateInstancesRequest { + + /** InstanceGroupManagersRecreateInstancesRequest instances */ + instances?: (string[]|null); + } + + /** Represents an InstanceGroupManagersRecreateInstancesRequest. */ + class InstanceGroupManagersRecreateInstancesRequest implements IInstanceGroupManagersRecreateInstancesRequest { + + /** + * Constructs a new InstanceGroupManagersRecreateInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest); + + /** InstanceGroupManagersRecreateInstancesRequest instances. */ + public instances: string[]; + + /** + * Creates a new InstanceGroupManagersRecreateInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersRecreateInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest): google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; + + /** + * Encodes the specified InstanceGroupManagersRecreateInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersRecreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersRecreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.verify|verify} messages. + * @param message InstanceGroupManagersRecreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersRecreateInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersRecreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; + + /** + * Decodes an InstanceGroupManagersRecreateInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersRecreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; + + /** + * Verifies an InstanceGroupManagersRecreateInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersRecreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersRecreateInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest; + + /** + * Creates a plain object from an InstanceGroupManagersRecreateInstancesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupManagersRecreateInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersRecreateInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersSetInstanceTemplateRequest. */ + interface IInstanceGroupManagersSetInstanceTemplateRequest { + + /** InstanceGroupManagersSetInstanceTemplateRequest instanceTemplate */ + instanceTemplate?: (string|null); + } + + /** Represents an InstanceGroupManagersSetInstanceTemplateRequest. */ + class InstanceGroupManagersSetInstanceTemplateRequest implements IInstanceGroupManagersSetInstanceTemplateRequest { + + /** + * Constructs a new InstanceGroupManagersSetInstanceTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest); + + /** InstanceGroupManagersSetInstanceTemplateRequest instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** InstanceGroupManagersSetInstanceTemplateRequest _instanceTemplate. */ + public _instanceTemplate?: "instanceTemplate"; + + /** + * Creates a new InstanceGroupManagersSetInstanceTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersSetInstanceTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest): google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; + + /** + * Encodes the specified InstanceGroupManagersSetInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.verify|verify} messages. + * @param message InstanceGroupManagersSetInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersSetInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.verify|verify} messages. + * @param message InstanceGroupManagersSetInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersSetInstanceTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersSetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; + + /** + * Decodes an InstanceGroupManagersSetInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersSetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; + + /** + * Verifies an InstanceGroupManagersSetInstanceTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersSetInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersSetInstanceTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest; + + /** + * Creates a plain object from an InstanceGroupManagersSetInstanceTemplateRequest message. Also converts values to other types if specified. + * @param message InstanceGroupManagersSetInstanceTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersSetInstanceTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersSetTargetPoolsRequest. */ + interface IInstanceGroupManagersSetTargetPoolsRequest { + + /** InstanceGroupManagersSetTargetPoolsRequest fingerprint */ + fingerprint?: (string|null); + + /** InstanceGroupManagersSetTargetPoolsRequest targetPools */ + targetPools?: (string[]|null); + } + + /** Represents an InstanceGroupManagersSetTargetPoolsRequest. */ + class InstanceGroupManagersSetTargetPoolsRequest implements IInstanceGroupManagersSetTargetPoolsRequest { + + /** + * Constructs a new InstanceGroupManagersSetTargetPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest); + + /** InstanceGroupManagersSetTargetPoolsRequest fingerprint. */ + public fingerprint?: (string|null); + + /** InstanceGroupManagersSetTargetPoolsRequest targetPools. */ + public targetPools: string[]; + + /** InstanceGroupManagersSetTargetPoolsRequest _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** + * Creates a new InstanceGroupManagersSetTargetPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersSetTargetPoolsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest): google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; + + /** + * Encodes the specified InstanceGroupManagersSetTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @param message InstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersSetTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @param message InstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; + + /** + * Decodes an InstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; + + /** + * Verifies an InstanceGroupManagersSetTargetPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersSetTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersSetTargetPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest; + + /** + * Creates a plain object from an InstanceGroupManagersSetTargetPoolsRequest message. Also converts values to other types if specified. + * @param message InstanceGroupManagersSetTargetPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersSetTargetPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupManagersUpdatePerInstanceConfigsReq. */ + interface IInstanceGroupManagersUpdatePerInstanceConfigsReq { + + /** InstanceGroupManagersUpdatePerInstanceConfigsReq perInstanceConfigs */ + perInstanceConfigs?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + } + + /** Represents an InstanceGroupManagersUpdatePerInstanceConfigsReq. */ + class InstanceGroupManagersUpdatePerInstanceConfigsReq implements IInstanceGroupManagersUpdatePerInstanceConfigsReq { + + /** + * Constructs a new InstanceGroupManagersUpdatePerInstanceConfigsReq. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq); + + /** InstanceGroupManagersUpdatePerInstanceConfigsReq perInstanceConfigs. */ + public perInstanceConfigs: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** + * Creates a new InstanceGroupManagersUpdatePerInstanceConfigsReq instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupManagersUpdatePerInstanceConfigsReq instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq): google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq; + + /** + * Encodes the specified InstanceGroupManagersUpdatePerInstanceConfigsReq message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.verify|verify} messages. + * @param message InstanceGroupManagersUpdatePerInstanceConfigsReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupManagersUpdatePerInstanceConfigsReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.verify|verify} messages. + * @param message InstanceGroupManagersUpdatePerInstanceConfigsReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupManagersUpdatePerInstanceConfigsReq message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupManagersUpdatePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq; + + /** + * Decodes an InstanceGroupManagersUpdatePerInstanceConfigsReq message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupManagersUpdatePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq; + + /** + * Verifies an InstanceGroupManagersUpdatePerInstanceConfigsReq message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupManagersUpdatePerInstanceConfigsReq message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupManagersUpdatePerInstanceConfigsReq + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq; + + /** + * Creates a plain object from an InstanceGroupManagersUpdatePerInstanceConfigsReq message. Also converts values to other types if specified. + * @param message InstanceGroupManagersUpdatePerInstanceConfigsReq + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupManagersUpdatePerInstanceConfigsReq to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceReference. */ + interface IInstanceReference { + + /** InstanceReference instance */ + instance?: (string|null); + } + + /** Represents an InstanceReference. */ + class InstanceReference implements IInstanceReference { + + /** + * Constructs a new InstanceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceReference); + + /** InstanceReference instance. */ + public instance?: (string|null); + + /** InstanceReference _instance. */ + public _instance?: "instance"; + + /** + * Creates a new InstanceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceReference instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceReference): google.cloud.compute.v1.InstanceReference; + + /** + * Encodes the specified InstanceReference message. Does not implicitly {@link google.cloud.compute.v1.InstanceReference.verify|verify} messages. + * @param message InstanceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceReference.verify|verify} messages. + * @param message InstanceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceReference; + + /** + * Decodes an InstanceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceReference; + + /** + * Verifies an InstanceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceReference; + + /** + * Creates a plain object from an InstanceReference message. Also converts values to other types if specified. + * @param message InstanceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupsAddInstancesRequest. */ + interface IInstanceGroupsAddInstancesRequest { + + /** InstanceGroupsAddInstancesRequest instances */ + instances?: (google.cloud.compute.v1.IInstanceReference[]|null); + } + + /** Represents an InstanceGroupsAddInstancesRequest. */ + class InstanceGroupsAddInstancesRequest implements IInstanceGroupsAddInstancesRequest { + + /** + * Constructs a new InstanceGroupsAddInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest); + + /** InstanceGroupsAddInstancesRequest instances. */ + public instances: google.cloud.compute.v1.IInstanceReference[]; + + /** + * Creates a new InstanceGroupsAddInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupsAddInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest): google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; + + /** + * Encodes the specified InstanceGroupsAddInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.verify|verify} messages. + * @param message InstanceGroupsAddInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupsAddInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.verify|verify} messages. + * @param message InstanceGroupsAddInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupsAddInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupsAddInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; + + /** + * Decodes an InstanceGroupsAddInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupsAddInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; + + /** + * Verifies an InstanceGroupsAddInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupsAddInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupsAddInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupsAddInstancesRequest; + + /** + * Creates a plain object from an InstanceGroupsAddInstancesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupsAddInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupsAddInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupsAddInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceWithNamedPorts. */ + interface IInstanceWithNamedPorts { + + /** InstanceWithNamedPorts instance */ + instance?: (string|null); + + /** InstanceWithNamedPorts namedPorts */ + namedPorts?: (google.cloud.compute.v1.INamedPort[]|null); + + /** InstanceWithNamedPorts status */ + status?: (google.cloud.compute.v1.InstanceWithNamedPorts.Status|keyof typeof google.cloud.compute.v1.InstanceWithNamedPorts.Status|null); + } + + /** Represents an InstanceWithNamedPorts. */ + class InstanceWithNamedPorts implements IInstanceWithNamedPorts { + + /** + * Constructs a new InstanceWithNamedPorts. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceWithNamedPorts); + + /** InstanceWithNamedPorts instance. */ + public instance?: (string|null); + + /** InstanceWithNamedPorts namedPorts. */ + public namedPorts: google.cloud.compute.v1.INamedPort[]; + + /** InstanceWithNamedPorts status. */ + public status?: (google.cloud.compute.v1.InstanceWithNamedPorts.Status|keyof typeof google.cloud.compute.v1.InstanceWithNamedPorts.Status|null); + + /** InstanceWithNamedPorts _instance. */ + public _instance?: "instance"; + + /** InstanceWithNamedPorts _status. */ + public _status?: "status"; + + /** + * Creates a new InstanceWithNamedPorts instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceWithNamedPorts instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceWithNamedPorts): google.cloud.compute.v1.InstanceWithNamedPorts; + + /** + * Encodes the specified InstanceWithNamedPorts message. Does not implicitly {@link google.cloud.compute.v1.InstanceWithNamedPorts.verify|verify} messages. + * @param message InstanceWithNamedPorts message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceWithNamedPorts, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceWithNamedPorts message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceWithNamedPorts.verify|verify} messages. + * @param message InstanceWithNamedPorts message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceWithNamedPorts, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceWithNamedPorts message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceWithNamedPorts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceWithNamedPorts; + + /** + * Decodes an InstanceWithNamedPorts message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceWithNamedPorts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceWithNamedPorts; + + /** + * Verifies an InstanceWithNamedPorts message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceWithNamedPorts message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceWithNamedPorts + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceWithNamedPorts; + + /** + * Creates a plain object from an InstanceWithNamedPorts message. Also converts values to other types if specified. + * @param message InstanceWithNamedPorts + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceWithNamedPorts, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceWithNamedPorts to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InstanceWithNamedPorts { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + DEPROVISIONING = 428935662, + PROVISIONING = 290896621, + REPAIRING = 413483285, + RUNNING = 121282975, + STAGING = 431072283, + STOPPED = 444276141, + STOPPING = 350791796, + SUSPENDED = 51223995, + SUSPENDING = 514206246, + TERMINATED = 250018339 + } + } + + /** Properties of an InstanceGroupsListInstances. */ + interface IInstanceGroupsListInstances { + + /** InstanceGroupsListInstances id */ + id?: (string|null); + + /** InstanceGroupsListInstances items */ + items?: (google.cloud.compute.v1.IInstanceWithNamedPorts[]|null); + + /** InstanceGroupsListInstances kind */ + kind?: (string|null); + + /** InstanceGroupsListInstances nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceGroupsListInstances selfLink */ + selfLink?: (string|null); + + /** InstanceGroupsListInstances warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceGroupsListInstances. */ + class InstanceGroupsListInstances implements IInstanceGroupsListInstances { + + /** + * Constructs a new InstanceGroupsListInstances. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupsListInstances); + + /** InstanceGroupsListInstances id. */ + public id?: (string|null); + + /** InstanceGroupsListInstances items. */ + public items: google.cloud.compute.v1.IInstanceWithNamedPorts[]; + + /** InstanceGroupsListInstances kind. */ + public kind?: (string|null); + + /** InstanceGroupsListInstances nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceGroupsListInstances selfLink. */ + public selfLink?: (string|null); + + /** InstanceGroupsListInstances warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceGroupsListInstances _id. */ + public _id?: "id"; + + /** InstanceGroupsListInstances _kind. */ + public _kind?: "kind"; + + /** InstanceGroupsListInstances _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceGroupsListInstances _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceGroupsListInstances _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceGroupsListInstances instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupsListInstances instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupsListInstances): google.cloud.compute.v1.InstanceGroupsListInstances; + + /** + * Encodes the specified InstanceGroupsListInstances message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstances.verify|verify} messages. + * @param message InstanceGroupsListInstances message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupsListInstances, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupsListInstances message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstances.verify|verify} messages. + * @param message InstanceGroupsListInstances message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupsListInstances, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupsListInstances message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupsListInstances; + + /** + * Decodes an InstanceGroupsListInstances message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupsListInstances; + + /** + * Verifies an InstanceGroupsListInstances message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupsListInstances message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupsListInstances + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupsListInstances; + + /** + * Creates a plain object from an InstanceGroupsListInstances message. Also converts values to other types if specified. + * @param message InstanceGroupsListInstances + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupsListInstances, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupsListInstances to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupsListInstancesRequest. */ + interface IInstanceGroupsListInstancesRequest { + + /** InstanceGroupsListInstancesRequest instanceState */ + instanceState?: (google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState|keyof typeof google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState|null); + } + + /** Represents an InstanceGroupsListInstancesRequest. */ + class InstanceGroupsListInstancesRequest implements IInstanceGroupsListInstancesRequest { + + /** + * Constructs a new InstanceGroupsListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupsListInstancesRequest); + + /** InstanceGroupsListInstancesRequest instanceState. */ + public instanceState?: (google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState|keyof typeof google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState|null); + + /** InstanceGroupsListInstancesRequest _instanceState. */ + public _instanceState?: "instanceState"; + + /** + * Creates a new InstanceGroupsListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupsListInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupsListInstancesRequest): google.cloud.compute.v1.InstanceGroupsListInstancesRequest; + + /** + * Encodes the specified InstanceGroupsListInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstancesRequest.verify|verify} messages. + * @param message InstanceGroupsListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupsListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupsListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstancesRequest.verify|verify} messages. + * @param message InstanceGroupsListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupsListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupsListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupsListInstancesRequest; + + /** + * Decodes an InstanceGroupsListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupsListInstancesRequest; + + /** + * Verifies an InstanceGroupsListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupsListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupsListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupsListInstancesRequest; + + /** + * Creates a plain object from an InstanceGroupsListInstancesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupsListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupsListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupsListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InstanceGroupsListInstancesRequest { + + /** InstanceState enum. */ + enum InstanceState { + UNDEFINED_INSTANCE_STATE = 0, + ALL = 64897, + RUNNING = 121282975 + } + } + + /** Properties of an InstanceGroupsRemoveInstancesRequest. */ + interface IInstanceGroupsRemoveInstancesRequest { + + /** InstanceGroupsRemoveInstancesRequest instances */ + instances?: (google.cloud.compute.v1.IInstanceReference[]|null); + } + + /** Represents an InstanceGroupsRemoveInstancesRequest. */ + class InstanceGroupsRemoveInstancesRequest implements IInstanceGroupsRemoveInstancesRequest { + + /** + * Constructs a new InstanceGroupsRemoveInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest); + + /** InstanceGroupsRemoveInstancesRequest instances. */ + public instances: google.cloud.compute.v1.IInstanceReference[]; + + /** + * Creates a new InstanceGroupsRemoveInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupsRemoveInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest): google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; + + /** + * Encodes the specified InstanceGroupsRemoveInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.verify|verify} messages. + * @param message InstanceGroupsRemoveInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupsRemoveInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.verify|verify} messages. + * @param message InstanceGroupsRemoveInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupsRemoveInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupsRemoveInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; + + /** + * Decodes an InstanceGroupsRemoveInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupsRemoveInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; + + /** + * Verifies an InstanceGroupsRemoveInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupsRemoveInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupsRemoveInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest; + + /** + * Creates a plain object from an InstanceGroupsRemoveInstancesRequest message. Also converts values to other types if specified. + * @param message InstanceGroupsRemoveInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupsRemoveInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceGroupsSetNamedPortsRequest. */ + interface IInstanceGroupsSetNamedPortsRequest { + + /** InstanceGroupsSetNamedPortsRequest fingerprint */ + fingerprint?: (string|null); + + /** InstanceGroupsSetNamedPortsRequest namedPorts */ + namedPorts?: (google.cloud.compute.v1.INamedPort[]|null); + } + + /** Represents an InstanceGroupsSetNamedPortsRequest. */ + class InstanceGroupsSetNamedPortsRequest implements IInstanceGroupsSetNamedPortsRequest { + + /** + * Constructs a new InstanceGroupsSetNamedPortsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest); + + /** InstanceGroupsSetNamedPortsRequest fingerprint. */ + public fingerprint?: (string|null); + + /** InstanceGroupsSetNamedPortsRequest namedPorts. */ + public namedPorts: google.cloud.compute.v1.INamedPort[]; + + /** InstanceGroupsSetNamedPortsRequest _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** + * Creates a new InstanceGroupsSetNamedPortsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupsSetNamedPortsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest): google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; + + /** + * Encodes the specified InstanceGroupsSetNamedPortsRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @param message InstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupsSetNamedPortsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @param message InstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupsSetNamedPortsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; + + /** + * Decodes an InstanceGroupsSetNamedPortsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; + + /** + * Verifies an InstanceGroupsSetNamedPortsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupsSetNamedPortsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupsSetNamedPortsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest; + + /** + * Creates a plain object from an InstanceGroupsSetNamedPortsRequest message. Also converts values to other types if specified. + * @param message InstanceGroupsSetNamedPortsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupsSetNamedPortsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceList. */ + interface IInstanceList { + + /** InstanceList id */ + id?: (string|null); + + /** InstanceList items */ + items?: (google.cloud.compute.v1.IInstance[]|null); + + /** InstanceList kind */ + kind?: (string|null); + + /** InstanceList nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceList selfLink */ + selfLink?: (string|null); + + /** InstanceList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceList. */ + class InstanceList implements IInstanceList { + + /** + * Constructs a new InstanceList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceList); + + /** InstanceList id. */ + public id?: (string|null); + + /** InstanceList items. */ + public items: google.cloud.compute.v1.IInstance[]; + + /** InstanceList kind. */ + public kind?: (string|null); + + /** InstanceList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceList selfLink. */ + public selfLink?: (string|null); + + /** InstanceList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceList _id. */ + public _id?: "id"; + + /** InstanceList _kind. */ + public _kind?: "kind"; + + /** InstanceList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceList): google.cloud.compute.v1.InstanceList; + + /** + * Encodes the specified InstanceList message. Does not implicitly {@link google.cloud.compute.v1.InstanceList.verify|verify} messages. + * @param message InstanceList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceList.verify|verify} messages. + * @param message InstanceList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceList; + + /** + * Decodes an InstanceList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceList; + + /** + * Verifies an InstanceList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceList; + + /** + * Creates a plain object from an InstanceList message. Also converts values to other types if specified. + * @param message InstanceList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Reference. */ + interface IReference { + + /** Reference kind */ + kind?: (string|null); + + /** Reference referenceType */ + referenceType?: (string|null); + + /** Reference referrer */ + referrer?: (string|null); + + /** Reference target */ + target?: (string|null); + } + + /** Represents a Reference. */ + class Reference implements IReference { + + /** + * Constructs a new Reference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IReference); + + /** Reference kind. */ + public kind?: (string|null); + + /** Reference referenceType. */ + public referenceType?: (string|null); + + /** Reference referrer. */ + public referrer?: (string|null); + + /** Reference target. */ + public target?: (string|null); + + /** Reference _kind. */ + public _kind?: "kind"; + + /** Reference _referenceType. */ + public _referenceType?: "referenceType"; + + /** Reference _referrer. */ + public _referrer?: "referrer"; + + /** Reference _target. */ + public _target?: "target"; + + /** + * Creates a new Reference instance using the specified properties. + * @param [properties] Properties to set + * @returns Reference instance + */ + public static create(properties?: google.cloud.compute.v1.IReference): google.cloud.compute.v1.Reference; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.compute.v1.Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Reference; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Reference; + + /** + * Verifies a Reference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Reference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Reference; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @param message Reference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Reference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceListReferrers. */ + interface IInstanceListReferrers { + + /** InstanceListReferrers id */ + id?: (string|null); + + /** InstanceListReferrers items */ + items?: (google.cloud.compute.v1.IReference[]|null); + + /** InstanceListReferrers kind */ + kind?: (string|null); + + /** InstanceListReferrers nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceListReferrers selfLink */ + selfLink?: (string|null); + + /** InstanceListReferrers warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceListReferrers. */ + class InstanceListReferrers implements IInstanceListReferrers { + + /** + * Constructs a new InstanceListReferrers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceListReferrers); + + /** InstanceListReferrers id. */ + public id?: (string|null); + + /** InstanceListReferrers items. */ + public items: google.cloud.compute.v1.IReference[]; + + /** InstanceListReferrers kind. */ + public kind?: (string|null); + + /** InstanceListReferrers nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceListReferrers selfLink. */ + public selfLink?: (string|null); + + /** InstanceListReferrers warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceListReferrers _id. */ + public _id?: "id"; + + /** InstanceListReferrers _kind. */ + public _kind?: "kind"; + + /** InstanceListReferrers _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceListReferrers _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceListReferrers _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceListReferrers instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceListReferrers instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceListReferrers): google.cloud.compute.v1.InstanceListReferrers; + + /** + * Encodes the specified InstanceListReferrers message. Does not implicitly {@link google.cloud.compute.v1.InstanceListReferrers.verify|verify} messages. + * @param message InstanceListReferrers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceListReferrers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceListReferrers message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceListReferrers.verify|verify} messages. + * @param message InstanceListReferrers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceListReferrers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceListReferrers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceListReferrers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceListReferrers; + + /** + * Decodes an InstanceListReferrers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceListReferrers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceListReferrers; + + /** + * Verifies an InstanceListReferrers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceListReferrers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceListReferrers + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceListReferrers; + + /** + * Creates a plain object from an InstanceListReferrers message. Also converts values to other types if specified. + * @param message InstanceListReferrers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceListReferrers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceListReferrers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceManagedByIgmErrorManagedInstanceError. */ + interface IInstanceManagedByIgmErrorManagedInstanceError { + + /** InstanceManagedByIgmErrorManagedInstanceError code */ + code?: (string|null); + + /** InstanceManagedByIgmErrorManagedInstanceError message */ + message?: (string|null); + } + + /** Represents an InstanceManagedByIgmErrorManagedInstanceError. */ + class InstanceManagedByIgmErrorManagedInstanceError implements IInstanceManagedByIgmErrorManagedInstanceError { + + /** + * Constructs a new InstanceManagedByIgmErrorManagedInstanceError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError); + + /** InstanceManagedByIgmErrorManagedInstanceError code. */ + public code?: (string|null); + + /** InstanceManagedByIgmErrorManagedInstanceError message. */ + public message?: (string|null); + + /** InstanceManagedByIgmErrorManagedInstanceError _code. */ + public _code?: "code"; + + /** InstanceManagedByIgmErrorManagedInstanceError _message. */ + public _message?: "message"; + + /** + * Creates a new InstanceManagedByIgmErrorManagedInstanceError instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceManagedByIgmErrorManagedInstanceError instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError): google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError; + + /** + * Encodes the specified InstanceManagedByIgmErrorManagedInstanceError message. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.verify|verify} messages. + * @param message InstanceManagedByIgmErrorManagedInstanceError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceManagedByIgmErrorManagedInstanceError message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.verify|verify} messages. + * @param message InstanceManagedByIgmErrorManagedInstanceError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceManagedByIgmErrorManagedInstanceError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceManagedByIgmErrorManagedInstanceError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError; + + /** + * Decodes an InstanceManagedByIgmErrorManagedInstanceError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceManagedByIgmErrorManagedInstanceError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError; + + /** + * Verifies an InstanceManagedByIgmErrorManagedInstanceError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceManagedByIgmErrorManagedInstanceError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceManagedByIgmErrorManagedInstanceError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError; + + /** + * Creates a plain object from an InstanceManagedByIgmErrorManagedInstanceError message. Also converts values to other types if specified. + * @param message InstanceManagedByIgmErrorManagedInstanceError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceManagedByIgmErrorManagedInstanceError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceManagedByIgmErrorInstanceActionDetails. */ + interface IInstanceManagedByIgmErrorInstanceActionDetails { + + /** InstanceManagedByIgmErrorInstanceActionDetails action */ + action?: (google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action|keyof typeof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action|null); + + /** InstanceManagedByIgmErrorInstanceActionDetails instance */ + instance?: (string|null); + + /** InstanceManagedByIgmErrorInstanceActionDetails version */ + version?: (google.cloud.compute.v1.IManagedInstanceVersion|null); + } + + /** Represents an InstanceManagedByIgmErrorInstanceActionDetails. */ + class InstanceManagedByIgmErrorInstanceActionDetails implements IInstanceManagedByIgmErrorInstanceActionDetails { + + /** + * Constructs a new InstanceManagedByIgmErrorInstanceActionDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails); + + /** InstanceManagedByIgmErrorInstanceActionDetails action. */ + public action?: (google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action|keyof typeof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action|null); + + /** InstanceManagedByIgmErrorInstanceActionDetails instance. */ + public instance?: (string|null); + + /** InstanceManagedByIgmErrorInstanceActionDetails version. */ + public version?: (google.cloud.compute.v1.IManagedInstanceVersion|null); + + /** InstanceManagedByIgmErrorInstanceActionDetails _action. */ + public _action?: "action"; + + /** InstanceManagedByIgmErrorInstanceActionDetails _instance. */ + public _instance?: "instance"; + + /** InstanceManagedByIgmErrorInstanceActionDetails _version. */ + public _version?: "version"; + + /** + * Creates a new InstanceManagedByIgmErrorInstanceActionDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceManagedByIgmErrorInstanceActionDetails instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails): google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails; + + /** + * Encodes the specified InstanceManagedByIgmErrorInstanceActionDetails message. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.verify|verify} messages. + * @param message InstanceManagedByIgmErrorInstanceActionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceManagedByIgmErrorInstanceActionDetails message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.verify|verify} messages. + * @param message InstanceManagedByIgmErrorInstanceActionDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceManagedByIgmErrorInstanceActionDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceManagedByIgmErrorInstanceActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails; + + /** + * Decodes an InstanceManagedByIgmErrorInstanceActionDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceManagedByIgmErrorInstanceActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails; + + /** + * Verifies an InstanceManagedByIgmErrorInstanceActionDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceManagedByIgmErrorInstanceActionDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceManagedByIgmErrorInstanceActionDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails; + + /** + * Creates a plain object from an InstanceManagedByIgmErrorInstanceActionDetails message. Also converts values to other types if specified. + * @param message InstanceManagedByIgmErrorInstanceActionDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceManagedByIgmErrorInstanceActionDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InstanceManagedByIgmErrorInstanceActionDetails { + + /** Action enum. */ + enum Action { + UNDEFINED_ACTION = 0, + ABANDONING = 388244813, + CREATING = 455564985, + CREATING_WITHOUT_RETRIES = 428843785, + DELETING = 528602024, + NONE = 2402104, + RECREATING = 287278572, + REFRESHING = 163266343, + RESTARTING = 320534387, + VERIFYING = 16982185 + } + } + + /** Properties of a ManagedInstanceVersion. */ + interface IManagedInstanceVersion { + + /** ManagedInstanceVersion instanceTemplate */ + instanceTemplate?: (string|null); + + /** ManagedInstanceVersion name */ + name?: (string|null); + } + + /** Represents a ManagedInstanceVersion. */ + class ManagedInstanceVersion implements IManagedInstanceVersion { + + /** + * Constructs a new ManagedInstanceVersion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IManagedInstanceVersion); + + /** ManagedInstanceVersion instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** ManagedInstanceVersion name. */ + public name?: (string|null); + + /** ManagedInstanceVersion _instanceTemplate. */ + public _instanceTemplate?: "instanceTemplate"; + + /** ManagedInstanceVersion _name. */ + public _name?: "name"; + + /** + * Creates a new ManagedInstanceVersion instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedInstanceVersion instance + */ + public static create(properties?: google.cloud.compute.v1.IManagedInstanceVersion): google.cloud.compute.v1.ManagedInstanceVersion; + + /** + * Encodes the specified ManagedInstanceVersion message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceVersion.verify|verify} messages. + * @param message ManagedInstanceVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IManagedInstanceVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedInstanceVersion message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceVersion.verify|verify} messages. + * @param message ManagedInstanceVersion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IManagedInstanceVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedInstanceVersion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedInstanceVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ManagedInstanceVersion; + + /** + * Decodes a ManagedInstanceVersion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedInstanceVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ManagedInstanceVersion; + + /** + * Verifies a ManagedInstanceVersion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedInstanceVersion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedInstanceVersion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ManagedInstanceVersion; + + /** + * Creates a plain object from a ManagedInstanceVersion message. Also converts values to other types if specified. + * @param message ManagedInstanceVersion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ManagedInstanceVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedInstanceVersion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceMoveRequest. */ + interface IInstanceMoveRequest { + + /** InstanceMoveRequest destinationZone */ + destinationZone?: (string|null); + + /** InstanceMoveRequest targetInstance */ + targetInstance?: (string|null); + } + + /** Represents an InstanceMoveRequest. */ + class InstanceMoveRequest implements IInstanceMoveRequest { + + /** + * Constructs a new InstanceMoveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceMoveRequest); + + /** InstanceMoveRequest destinationZone. */ + public destinationZone?: (string|null); + + /** InstanceMoveRequest targetInstance. */ + public targetInstance?: (string|null); + + /** InstanceMoveRequest _destinationZone. */ + public _destinationZone?: "destinationZone"; + + /** InstanceMoveRequest _targetInstance. */ + public _targetInstance?: "targetInstance"; + + /** + * Creates a new InstanceMoveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceMoveRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceMoveRequest): google.cloud.compute.v1.InstanceMoveRequest; + + /** + * Encodes the specified InstanceMoveRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceMoveRequest.verify|verify} messages. + * @param message InstanceMoveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceMoveRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceMoveRequest.verify|verify} messages. + * @param message InstanceMoveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceMoveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceMoveRequest; + + /** + * Decodes an InstanceMoveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceMoveRequest; + + /** + * Verifies an InstanceMoveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceMoveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceMoveRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceMoveRequest; + + /** + * Creates a plain object from an InstanceMoveRequest message. Also converts values to other types if specified. + * @param message InstanceMoveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceMoveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SourceInstanceParams. */ + interface ISourceInstanceParams { + + /** SourceInstanceParams diskConfigs */ + diskConfigs?: (google.cloud.compute.v1.IDiskInstantiationConfig[]|null); + } + + /** Represents a SourceInstanceParams. */ + class SourceInstanceParams implements ISourceInstanceParams { + + /** + * Constructs a new SourceInstanceParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISourceInstanceParams); + + /** SourceInstanceParams diskConfigs. */ + public diskConfigs: google.cloud.compute.v1.IDiskInstantiationConfig[]; + + /** + * Creates a new SourceInstanceParams instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceInstanceParams instance + */ + public static create(properties?: google.cloud.compute.v1.ISourceInstanceParams): google.cloud.compute.v1.SourceInstanceParams; + + /** + * Encodes the specified SourceInstanceParams message. Does not implicitly {@link google.cloud.compute.v1.SourceInstanceParams.verify|verify} messages. + * @param message SourceInstanceParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISourceInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceInstanceParams message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SourceInstanceParams.verify|verify} messages. + * @param message SourceInstanceParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISourceInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceInstanceParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceInstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SourceInstanceParams; + + /** + * Decodes a SourceInstanceParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceInstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SourceInstanceParams; + + /** + * Verifies a SourceInstanceParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceInstanceParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceInstanceParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SourceInstanceParams; + + /** + * Creates a plain object from a SourceInstanceParams message. Also converts values to other types if specified. + * @param message SourceInstanceParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SourceInstanceParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceInstanceParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceTemplate. */ + interface IInstanceTemplate { + + /** InstanceTemplate creationTimestamp */ + creationTimestamp?: (string|null); + + /** InstanceTemplate description */ + description?: (string|null); + + /** InstanceTemplate id */ + id?: (number|Long|string|null); + + /** InstanceTemplate kind */ + kind?: (string|null); + + /** InstanceTemplate name */ + name?: (string|null); + + /** InstanceTemplate properties */ + properties?: (google.cloud.compute.v1.IInstanceProperties|null); + + /** InstanceTemplate selfLink */ + selfLink?: (string|null); + + /** InstanceTemplate sourceInstance */ + sourceInstance?: (string|null); + + /** InstanceTemplate sourceInstanceParams */ + sourceInstanceParams?: (google.cloud.compute.v1.ISourceInstanceParams|null); + } + + /** Represents an InstanceTemplate. */ + class InstanceTemplate implements IInstanceTemplate { + + /** + * Constructs a new InstanceTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceTemplate); + + /** InstanceTemplate creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** InstanceTemplate description. */ + public description?: (string|null); + + /** InstanceTemplate id. */ + public id?: (number|Long|string|null); + + /** InstanceTemplate kind. */ + public kind?: (string|null); + + /** InstanceTemplate name. */ + public name?: (string|null); + + /** InstanceTemplate properties. */ + public properties?: (google.cloud.compute.v1.IInstanceProperties|null); + + /** InstanceTemplate selfLink. */ + public selfLink?: (string|null); + + /** InstanceTemplate sourceInstance. */ + public sourceInstance?: (string|null); + + /** InstanceTemplate sourceInstanceParams. */ + public sourceInstanceParams?: (google.cloud.compute.v1.ISourceInstanceParams|null); + + /** InstanceTemplate _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** InstanceTemplate _description. */ + public _description?: "description"; + + /** InstanceTemplate _id. */ + public _id?: "id"; + + /** InstanceTemplate _kind. */ + public _kind?: "kind"; + + /** InstanceTemplate _name. */ + public _name?: "name"; + + /** InstanceTemplate _properties. */ + public _properties?: "properties"; + + /** InstanceTemplate _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceTemplate _sourceInstance. */ + public _sourceInstance?: "sourceInstance"; + + /** InstanceTemplate _sourceInstanceParams. */ + public _sourceInstanceParams?: "sourceInstanceParams"; + + /** + * Creates a new InstanceTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceTemplate instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceTemplate): google.cloud.compute.v1.InstanceTemplate; + + /** + * Encodes the specified InstanceTemplate message. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplate.verify|verify} messages. + * @param message InstanceTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceTemplate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplate.verify|verify} messages. + * @param message InstanceTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceTemplate; + + /** + * Decodes an InstanceTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceTemplate; + + /** + * Verifies an InstanceTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceTemplate; + + /** + * Creates a plain object from an InstanceTemplate message. Also converts values to other types if specified. + * @param message InstanceTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstanceTemplateList. */ + interface IInstanceTemplateList { + + /** InstanceTemplateList id */ + id?: (string|null); + + /** InstanceTemplateList items */ + items?: (google.cloud.compute.v1.IInstanceTemplate[]|null); + + /** InstanceTemplateList kind */ + kind?: (string|null); + + /** InstanceTemplateList nextPageToken */ + nextPageToken?: (string|null); + + /** InstanceTemplateList selfLink */ + selfLink?: (string|null); + + /** InstanceTemplateList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InstanceTemplateList. */ + class InstanceTemplateList implements IInstanceTemplateList { + + /** + * Constructs a new InstanceTemplateList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstanceTemplateList); + + /** InstanceTemplateList id. */ + public id?: (string|null); + + /** InstanceTemplateList items. */ + public items: google.cloud.compute.v1.IInstanceTemplate[]; + + /** InstanceTemplateList kind. */ + public kind?: (string|null); + + /** InstanceTemplateList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InstanceTemplateList selfLink. */ + public selfLink?: (string|null); + + /** InstanceTemplateList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InstanceTemplateList _id. */ + public _id?: "id"; + + /** InstanceTemplateList _kind. */ + public _kind?: "kind"; + + /** InstanceTemplateList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InstanceTemplateList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InstanceTemplateList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InstanceTemplateList instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceTemplateList instance + */ + public static create(properties?: google.cloud.compute.v1.IInstanceTemplateList): google.cloud.compute.v1.InstanceTemplateList; + + /** + * Encodes the specified InstanceTemplateList message. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplateList.verify|verify} messages. + * @param message InstanceTemplateList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstanceTemplateList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceTemplateList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplateList.verify|verify} messages. + * @param message InstanceTemplateList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstanceTemplateList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceTemplateList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstanceTemplateList; + + /** + * Decodes an InstanceTemplateList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstanceTemplateList; + + /** + * Verifies an InstanceTemplateList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceTemplateList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceTemplateList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstanceTemplateList; + + /** + * Creates a plain object from an InstanceTemplateList message. Also converts values to other types if specified. + * @param message InstanceTemplateList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstanceTemplateList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceTemplateList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesAddResourcePoliciesRequest. */ + interface IInstancesAddResourcePoliciesRequest { + + /** InstancesAddResourcePoliciesRequest resourcePolicies */ + resourcePolicies?: (string[]|null); + } + + /** Represents an InstancesAddResourcePoliciesRequest. */ + class InstancesAddResourcePoliciesRequest implements IInstancesAddResourcePoliciesRequest { + + /** + * Constructs a new InstancesAddResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest); + + /** InstancesAddResourcePoliciesRequest resourcePolicies. */ + public resourcePolicies: string[]; + + /** + * Creates a new InstancesAddResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesAddResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest): google.cloud.compute.v1.InstancesAddResourcePoliciesRequest; + + /** + * Encodes the specified InstancesAddResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.verify|verify} messages. + * @param message InstancesAddResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesAddResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.verify|verify} messages. + * @param message InstancesAddResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesAddResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesAddResourcePoliciesRequest; + + /** + * Decodes an InstancesAddResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesAddResourcePoliciesRequest; + + /** + * Verifies an InstancesAddResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesAddResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesAddResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesAddResourcePoliciesRequest; + + /** + * Creates a plain object from an InstancesAddResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message InstancesAddResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesAddResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesAddResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy. */ + interface IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName */ + displayName?: (string|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name */ + name?: (string|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules */ + rules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName */ + shortName?: (string|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy type */ + type?: (google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|keyof typeof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null); + } + + /** Represents an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy. */ + class InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy implements IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + + /** + * Constructs a new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName. */ + public displayName?: (string|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name. */ + public name?: (string|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules. */ + public rules: google.cloud.compute.v1.IFirewallPolicyRule[]; + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName. */ + public shortName?: (string|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy type. */ + public type?: (google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|keyof typeof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null); + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _displayName. */ + public _displayName?: "displayName"; + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _name. */ + public _name?: "name"; + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _shortName. */ + public _shortName?: "shortName"; + + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _type. */ + public _type?: "type"; + + /** + * Creates a new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @param message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @param message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Verifies an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Creates a plain object from an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Also converts values to other types if specified. + * @param message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + HIERARCHY = 69902869, + UNSPECIFIED = 526786327 + } + } + + /** Properties of an InstancesGetEffectiveFirewallsResponse. */ + interface IInstancesGetEffectiveFirewallsResponse { + + /** InstancesGetEffectiveFirewallsResponse firewallPolicys */ + firewallPolicys?: (google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy[]|null); + + /** InstancesGetEffectiveFirewallsResponse firewalls */ + firewalls?: (google.cloud.compute.v1.IFirewall[]|null); + } + + /** Represents an InstancesGetEffectiveFirewallsResponse. */ + class InstancesGetEffectiveFirewallsResponse implements IInstancesGetEffectiveFirewallsResponse { + + /** + * Constructs a new InstancesGetEffectiveFirewallsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse); + + /** InstancesGetEffectiveFirewallsResponse firewallPolicys. */ + public firewallPolicys: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy[]; + + /** InstancesGetEffectiveFirewallsResponse firewalls. */ + public firewalls: google.cloud.compute.v1.IFirewall[]; + + /** + * Creates a new InstancesGetEffectiveFirewallsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesGetEffectiveFirewallsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponse message. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.verify|verify} messages. + * @param message InstancesGetEffectiveFirewallsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.verify|verify} messages. + * @param message InstancesGetEffectiveFirewallsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse; + + /** + * Verifies an InstancesGetEffectiveFirewallsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesGetEffectiveFirewallsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesGetEffectiveFirewallsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse; + + /** + * Creates a plain object from an InstancesGetEffectiveFirewallsResponse message. Also converts values to other types if specified. + * @param message InstancesGetEffectiveFirewallsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesGetEffectiveFirewallsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesRemoveResourcePoliciesRequest. */ + interface IInstancesRemoveResourcePoliciesRequest { + + /** InstancesRemoveResourcePoliciesRequest resourcePolicies */ + resourcePolicies?: (string[]|null); + } + + /** Represents an InstancesRemoveResourcePoliciesRequest. */ + class InstancesRemoveResourcePoliciesRequest implements IInstancesRemoveResourcePoliciesRequest { + + /** + * Constructs a new InstancesRemoveResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest); + + /** InstancesRemoveResourcePoliciesRequest resourcePolicies. */ + public resourcePolicies: string[]; + + /** + * Creates a new InstancesRemoveResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesRemoveResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest): google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest; + + /** + * Encodes the specified InstancesRemoveResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.verify|verify} messages. + * @param message InstancesRemoveResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesRemoveResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.verify|verify} messages. + * @param message InstancesRemoveResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesRemoveResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest; + + /** + * Decodes an InstancesRemoveResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest; + + /** + * Verifies an InstancesRemoveResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesRemoveResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesRemoveResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest; + + /** + * Creates a plain object from an InstancesRemoveResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message InstancesRemoveResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesRemoveResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesSetLabelsRequest. */ + interface IInstancesSetLabelsRequest { + + /** InstancesSetLabelsRequest labelFingerprint */ + labelFingerprint?: (string|null); + + /** InstancesSetLabelsRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents an InstancesSetLabelsRequest. */ + class InstancesSetLabelsRequest implements IInstancesSetLabelsRequest { + + /** + * Constructs a new InstancesSetLabelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesSetLabelsRequest); + + /** InstancesSetLabelsRequest labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** InstancesSetLabelsRequest labels. */ + public labels: { [k: string]: string }; + + /** InstancesSetLabelsRequest _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** + * Creates a new InstancesSetLabelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesSetLabelsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesSetLabelsRequest): google.cloud.compute.v1.InstancesSetLabelsRequest; + + /** + * Encodes the specified InstancesSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetLabelsRequest.verify|verify} messages. + * @param message InstancesSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetLabelsRequest.verify|verify} messages. + * @param message InstancesSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesSetLabelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesSetLabelsRequest; + + /** + * Decodes an InstancesSetLabelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesSetLabelsRequest; + + /** + * Verifies an InstancesSetLabelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesSetLabelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesSetLabelsRequest; + + /** + * Creates a plain object from an InstancesSetLabelsRequest message. Also converts values to other types if specified. + * @param message InstancesSetLabelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesSetLabelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesSetLabelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesSetMachineResourcesRequest. */ + interface IInstancesSetMachineResourcesRequest { + + /** InstancesSetMachineResourcesRequest guestAccelerators */ + guestAccelerators?: (google.cloud.compute.v1.IAcceleratorConfig[]|null); + } + + /** Represents an InstancesSetMachineResourcesRequest. */ + class InstancesSetMachineResourcesRequest implements IInstancesSetMachineResourcesRequest { + + /** + * Constructs a new InstancesSetMachineResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesSetMachineResourcesRequest); + + /** InstancesSetMachineResourcesRequest guestAccelerators. */ + public guestAccelerators: google.cloud.compute.v1.IAcceleratorConfig[]; + + /** + * Creates a new InstancesSetMachineResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesSetMachineResourcesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesSetMachineResourcesRequest): google.cloud.compute.v1.InstancesSetMachineResourcesRequest; + + /** + * Encodes the specified InstancesSetMachineResourcesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineResourcesRequest.verify|verify} messages. + * @param message InstancesSetMachineResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesSetMachineResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesSetMachineResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineResourcesRequest.verify|verify} messages. + * @param message InstancesSetMachineResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesSetMachineResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesSetMachineResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesSetMachineResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesSetMachineResourcesRequest; + + /** + * Decodes an InstancesSetMachineResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesSetMachineResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesSetMachineResourcesRequest; + + /** + * Verifies an InstancesSetMachineResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesSetMachineResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesSetMachineResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesSetMachineResourcesRequest; + + /** + * Creates a plain object from an InstancesSetMachineResourcesRequest message. Also converts values to other types if specified. + * @param message InstancesSetMachineResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesSetMachineResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesSetMachineResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesSetMachineTypeRequest. */ + interface IInstancesSetMachineTypeRequest { + + /** InstancesSetMachineTypeRequest machineType */ + machineType?: (string|null); + } + + /** Represents an InstancesSetMachineTypeRequest. */ + class InstancesSetMachineTypeRequest implements IInstancesSetMachineTypeRequest { + + /** + * Constructs a new InstancesSetMachineTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesSetMachineTypeRequest); + + /** InstancesSetMachineTypeRequest machineType. */ + public machineType?: (string|null); + + /** InstancesSetMachineTypeRequest _machineType. */ + public _machineType?: "machineType"; + + /** + * Creates a new InstancesSetMachineTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesSetMachineTypeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesSetMachineTypeRequest): google.cloud.compute.v1.InstancesSetMachineTypeRequest; + + /** + * Encodes the specified InstancesSetMachineTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineTypeRequest.verify|verify} messages. + * @param message InstancesSetMachineTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesSetMachineTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesSetMachineTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineTypeRequest.verify|verify} messages. + * @param message InstancesSetMachineTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesSetMachineTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesSetMachineTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesSetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesSetMachineTypeRequest; + + /** + * Decodes an InstancesSetMachineTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesSetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesSetMachineTypeRequest; + + /** + * Verifies an InstancesSetMachineTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesSetMachineTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesSetMachineTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesSetMachineTypeRequest; + + /** + * Creates a plain object from an InstancesSetMachineTypeRequest message. Also converts values to other types if specified. + * @param message InstancesSetMachineTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesSetMachineTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesSetMachineTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesSetMinCpuPlatformRequest. */ + interface IInstancesSetMinCpuPlatformRequest { + + /** InstancesSetMinCpuPlatformRequest minCpuPlatform */ + minCpuPlatform?: (string|null); + } + + /** Represents an InstancesSetMinCpuPlatformRequest. */ + class InstancesSetMinCpuPlatformRequest implements IInstancesSetMinCpuPlatformRequest { + + /** + * Constructs a new InstancesSetMinCpuPlatformRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest); + + /** InstancesSetMinCpuPlatformRequest minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** InstancesSetMinCpuPlatformRequest _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** + * Creates a new InstancesSetMinCpuPlatformRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesSetMinCpuPlatformRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest): google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; + + /** + * Encodes the specified InstancesSetMinCpuPlatformRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.verify|verify} messages. + * @param message InstancesSetMinCpuPlatformRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesSetMinCpuPlatformRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.verify|verify} messages. + * @param message InstancesSetMinCpuPlatformRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesSetMinCpuPlatformRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesSetMinCpuPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; + + /** + * Decodes an InstancesSetMinCpuPlatformRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesSetMinCpuPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; + + /** + * Verifies an InstancesSetMinCpuPlatformRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesSetMinCpuPlatformRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesSetMinCpuPlatformRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest; + + /** + * Creates a plain object from an InstancesSetMinCpuPlatformRequest message. Also converts values to other types if specified. + * @param message InstancesSetMinCpuPlatformRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesSetMinCpuPlatformRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesSetServiceAccountRequest. */ + interface IInstancesSetServiceAccountRequest { + + /** InstancesSetServiceAccountRequest email */ + email?: (string|null); + + /** InstancesSetServiceAccountRequest scopes */ + scopes?: (string[]|null); + } + + /** Represents an InstancesSetServiceAccountRequest. */ + class InstancesSetServiceAccountRequest implements IInstancesSetServiceAccountRequest { + + /** + * Constructs a new InstancesSetServiceAccountRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesSetServiceAccountRequest); + + /** InstancesSetServiceAccountRequest email. */ + public email?: (string|null); + + /** InstancesSetServiceAccountRequest scopes. */ + public scopes: string[]; + + /** InstancesSetServiceAccountRequest _email. */ + public _email?: "email"; + + /** + * Creates a new InstancesSetServiceAccountRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesSetServiceAccountRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesSetServiceAccountRequest): google.cloud.compute.v1.InstancesSetServiceAccountRequest; + + /** + * Encodes the specified InstancesSetServiceAccountRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetServiceAccountRequest.verify|verify} messages. + * @param message InstancesSetServiceAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesSetServiceAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesSetServiceAccountRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetServiceAccountRequest.verify|verify} messages. + * @param message InstancesSetServiceAccountRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesSetServiceAccountRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesSetServiceAccountRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesSetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesSetServiceAccountRequest; + + /** + * Decodes an InstancesSetServiceAccountRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesSetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesSetServiceAccountRequest; + + /** + * Verifies an InstancesSetServiceAccountRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesSetServiceAccountRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesSetServiceAccountRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesSetServiceAccountRequest; + + /** + * Creates a plain object from an InstancesSetServiceAccountRequest message. Also converts values to other types if specified. + * @param message InstancesSetServiceAccountRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesSetServiceAccountRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesSetServiceAccountRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InstancesStartWithEncryptionKeyRequest. */ + interface IInstancesStartWithEncryptionKeyRequest { + + /** InstancesStartWithEncryptionKeyRequest disks */ + disks?: (google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk[]|null); + } + + /** Represents an InstancesStartWithEncryptionKeyRequest. */ + class InstancesStartWithEncryptionKeyRequest implements IInstancesStartWithEncryptionKeyRequest { + + /** + * Constructs a new InstancesStartWithEncryptionKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest); + + /** InstancesStartWithEncryptionKeyRequest disks. */ + public disks: google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk[]; + + /** + * Creates a new InstancesStartWithEncryptionKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstancesStartWithEncryptionKeyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest): google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; + + /** + * Encodes the specified InstancesStartWithEncryptionKeyRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.verify|verify} messages. + * @param message InstancesStartWithEncryptionKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstancesStartWithEncryptionKeyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.verify|verify} messages. + * @param message InstancesStartWithEncryptionKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstancesStartWithEncryptionKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstancesStartWithEncryptionKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; + + /** + * Decodes an InstancesStartWithEncryptionKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstancesStartWithEncryptionKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; + + /** + * Verifies an InstancesStartWithEncryptionKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstancesStartWithEncryptionKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstancesStartWithEncryptionKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest; + + /** + * Creates a plain object from an InstancesStartWithEncryptionKeyRequest message. Also converts values to other types if specified. + * @param message InstancesStartWithEncryptionKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstancesStartWithEncryptionKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectCircuitInfo. */ + interface IInterconnectCircuitInfo { + + /** InterconnectCircuitInfo customerDemarcId */ + customerDemarcId?: (string|null); + + /** InterconnectCircuitInfo googleCircuitId */ + googleCircuitId?: (string|null); + + /** InterconnectCircuitInfo googleDemarcId */ + googleDemarcId?: (string|null); + } + + /** Represents an InterconnectCircuitInfo. */ + class InterconnectCircuitInfo implements IInterconnectCircuitInfo { + + /** + * Constructs a new InterconnectCircuitInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectCircuitInfo); + + /** InterconnectCircuitInfo customerDemarcId. */ + public customerDemarcId?: (string|null); + + /** InterconnectCircuitInfo googleCircuitId. */ + public googleCircuitId?: (string|null); + + /** InterconnectCircuitInfo googleDemarcId. */ + public googleDemarcId?: (string|null); + + /** InterconnectCircuitInfo _customerDemarcId. */ + public _customerDemarcId?: "customerDemarcId"; + + /** InterconnectCircuitInfo _googleCircuitId. */ + public _googleCircuitId?: "googleCircuitId"; + + /** InterconnectCircuitInfo _googleDemarcId. */ + public _googleDemarcId?: "googleDemarcId"; + + /** + * Creates a new InterconnectCircuitInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectCircuitInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectCircuitInfo): google.cloud.compute.v1.InterconnectCircuitInfo; + + /** + * Encodes the specified InterconnectCircuitInfo message. Does not implicitly {@link google.cloud.compute.v1.InterconnectCircuitInfo.verify|verify} messages. + * @param message InterconnectCircuitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectCircuitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectCircuitInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectCircuitInfo.verify|verify} messages. + * @param message InterconnectCircuitInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectCircuitInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectCircuitInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectCircuitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectCircuitInfo; + + /** + * Decodes an InterconnectCircuitInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectCircuitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectCircuitInfo; + + /** + * Verifies an InterconnectCircuitInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectCircuitInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectCircuitInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectCircuitInfo; + + /** + * Creates a plain object from an InterconnectCircuitInfo message. Also converts values to other types if specified. + * @param message InterconnectCircuitInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectCircuitInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectCircuitInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectOutageNotification. */ + interface IInterconnectOutageNotification { + + /** InterconnectOutageNotification affectedCircuits */ + affectedCircuits?: (string[]|null); + + /** InterconnectOutageNotification description */ + description?: (string|null); + + /** InterconnectOutageNotification endTime */ + endTime?: (number|Long|string|null); + + /** InterconnectOutageNotification issueType */ + issueType?: (google.cloud.compute.v1.InterconnectOutageNotification.IssueType|keyof typeof google.cloud.compute.v1.InterconnectOutageNotification.IssueType|null); + + /** InterconnectOutageNotification name */ + name?: (string|null); + + /** InterconnectOutageNotification source */ + source?: (google.cloud.compute.v1.InterconnectOutageNotification.Source|keyof typeof google.cloud.compute.v1.InterconnectOutageNotification.Source|null); + + /** InterconnectOutageNotification startTime */ + startTime?: (number|Long|string|null); + + /** InterconnectOutageNotification state */ + state?: (google.cloud.compute.v1.InterconnectOutageNotification.State|keyof typeof google.cloud.compute.v1.InterconnectOutageNotification.State|null); + } + + /** Represents an InterconnectOutageNotification. */ + class InterconnectOutageNotification implements IInterconnectOutageNotification { + + /** + * Constructs a new InterconnectOutageNotification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectOutageNotification); + + /** InterconnectOutageNotification affectedCircuits. */ + public affectedCircuits: string[]; + + /** InterconnectOutageNotification description. */ + public description?: (string|null); + + /** InterconnectOutageNotification endTime. */ + public endTime?: (number|Long|string|null); + + /** InterconnectOutageNotification issueType. */ + public issueType?: (google.cloud.compute.v1.InterconnectOutageNotification.IssueType|keyof typeof google.cloud.compute.v1.InterconnectOutageNotification.IssueType|null); + + /** InterconnectOutageNotification name. */ + public name?: (string|null); + + /** InterconnectOutageNotification source. */ + public source?: (google.cloud.compute.v1.InterconnectOutageNotification.Source|keyof typeof google.cloud.compute.v1.InterconnectOutageNotification.Source|null); + + /** InterconnectOutageNotification startTime. */ + public startTime?: (number|Long|string|null); + + /** InterconnectOutageNotification state. */ + public state?: (google.cloud.compute.v1.InterconnectOutageNotification.State|keyof typeof google.cloud.compute.v1.InterconnectOutageNotification.State|null); + + /** InterconnectOutageNotification _description. */ + public _description?: "description"; + + /** InterconnectOutageNotification _endTime. */ + public _endTime?: "endTime"; + + /** InterconnectOutageNotification _issueType. */ + public _issueType?: "issueType"; + + /** InterconnectOutageNotification _name. */ + public _name?: "name"; + + /** InterconnectOutageNotification _source. */ + public _source?: "source"; + + /** InterconnectOutageNotification _startTime. */ + public _startTime?: "startTime"; + + /** InterconnectOutageNotification _state. */ + public _state?: "state"; + + /** + * Creates a new InterconnectOutageNotification instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectOutageNotification instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectOutageNotification): google.cloud.compute.v1.InterconnectOutageNotification; + + /** + * Encodes the specified InterconnectOutageNotification message. Does not implicitly {@link google.cloud.compute.v1.InterconnectOutageNotification.verify|verify} messages. + * @param message InterconnectOutageNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectOutageNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectOutageNotification message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectOutageNotification.verify|verify} messages. + * @param message InterconnectOutageNotification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectOutageNotification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectOutageNotification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectOutageNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectOutageNotification; + + /** + * Decodes an InterconnectOutageNotification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectOutageNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectOutageNotification; + + /** + * Verifies an InterconnectOutageNotification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectOutageNotification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectOutageNotification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectOutageNotification; + + /** + * Creates a plain object from an InterconnectOutageNotification message. Also converts values to other types if specified. + * @param message InterconnectOutageNotification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectOutageNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectOutageNotification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterconnectOutageNotification { + + /** IssueType enum. */ + enum IssueType { + UNDEFINED_ISSUE_TYPE = 0, + IT_OUTAGE = 175779973, + IT_PARTIAL_OUTAGE = 92103971, + OUTAGE = 195285745, + PARTIAL_OUTAGE = 147053455 + } + + /** Source enum. */ + enum Source { + UNDEFINED_SOURCE = 0, + GOOGLE = 497439289, + NSRC_GOOGLE = 510574562 + } + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + ACTIVE = 314733318, + CANCELLED = 41957681, + COMPLETED = 309921323, + NS_ACTIVE = 252563136, + NS_CANCELED = 506579411 + } + } + + /** Properties of an Interconnect. */ + interface IInterconnect { + + /** Interconnect adminEnabled */ + adminEnabled?: (boolean|null); + + /** Interconnect circuitInfos */ + circuitInfos?: (google.cloud.compute.v1.IInterconnectCircuitInfo[]|null); + + /** Interconnect creationTimestamp */ + creationTimestamp?: (string|null); + + /** Interconnect customerName */ + customerName?: (string|null); + + /** Interconnect description */ + description?: (string|null); + + /** Interconnect expectedOutages */ + expectedOutages?: (google.cloud.compute.v1.IInterconnectOutageNotification[]|null); + + /** Interconnect googleIpAddress */ + googleIpAddress?: (string|null); + + /** Interconnect googleReferenceId */ + googleReferenceId?: (string|null); + + /** Interconnect id */ + id?: (number|Long|string|null); + + /** Interconnect interconnectAttachments */ + interconnectAttachments?: (string[]|null); + + /** Interconnect interconnectType */ + interconnectType?: (google.cloud.compute.v1.Interconnect.InterconnectType|keyof typeof google.cloud.compute.v1.Interconnect.InterconnectType|null); + + /** Interconnect kind */ + kind?: (string|null); + + /** Interconnect linkType */ + linkType?: (google.cloud.compute.v1.Interconnect.LinkType|keyof typeof google.cloud.compute.v1.Interconnect.LinkType|null); + + /** Interconnect location */ + location?: (string|null); + + /** Interconnect name */ + name?: (string|null); + + /** Interconnect nocContactEmail */ + nocContactEmail?: (string|null); + + /** Interconnect operationalStatus */ + operationalStatus?: (google.cloud.compute.v1.Interconnect.OperationalStatus|keyof typeof google.cloud.compute.v1.Interconnect.OperationalStatus|null); + + /** Interconnect peerIpAddress */ + peerIpAddress?: (string|null); + + /** Interconnect provisionedLinkCount */ + provisionedLinkCount?: (number|null); + + /** Interconnect requestedLinkCount */ + requestedLinkCount?: (number|null); + + /** Interconnect selfLink */ + selfLink?: (string|null); + + /** Interconnect state */ + state?: (google.cloud.compute.v1.Interconnect.State|keyof typeof google.cloud.compute.v1.Interconnect.State|null); + } + + /** Represents an Interconnect. */ + class Interconnect implements IInterconnect { + + /** + * Constructs a new Interconnect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnect); + + /** Interconnect adminEnabled. */ + public adminEnabled?: (boolean|null); + + /** Interconnect circuitInfos. */ + public circuitInfos: google.cloud.compute.v1.IInterconnectCircuitInfo[]; + + /** Interconnect creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Interconnect customerName. */ + public customerName?: (string|null); + + /** Interconnect description. */ + public description?: (string|null); + + /** Interconnect expectedOutages. */ + public expectedOutages: google.cloud.compute.v1.IInterconnectOutageNotification[]; + + /** Interconnect googleIpAddress. */ + public googleIpAddress?: (string|null); + + /** Interconnect googleReferenceId. */ + public googleReferenceId?: (string|null); + + /** Interconnect id. */ + public id?: (number|Long|string|null); + + /** Interconnect interconnectAttachments. */ + public interconnectAttachments: string[]; + + /** Interconnect interconnectType. */ + public interconnectType?: (google.cloud.compute.v1.Interconnect.InterconnectType|keyof typeof google.cloud.compute.v1.Interconnect.InterconnectType|null); + + /** Interconnect kind. */ + public kind?: (string|null); + + /** Interconnect linkType. */ + public linkType?: (google.cloud.compute.v1.Interconnect.LinkType|keyof typeof google.cloud.compute.v1.Interconnect.LinkType|null); + + /** Interconnect location. */ + public location?: (string|null); + + /** Interconnect name. */ + public name?: (string|null); + + /** Interconnect nocContactEmail. */ + public nocContactEmail?: (string|null); + + /** Interconnect operationalStatus. */ + public operationalStatus?: (google.cloud.compute.v1.Interconnect.OperationalStatus|keyof typeof google.cloud.compute.v1.Interconnect.OperationalStatus|null); + + /** Interconnect peerIpAddress. */ + public peerIpAddress?: (string|null); + + /** Interconnect provisionedLinkCount. */ + public provisionedLinkCount?: (number|null); + + /** Interconnect requestedLinkCount. */ + public requestedLinkCount?: (number|null); + + /** Interconnect selfLink. */ + public selfLink?: (string|null); + + /** Interconnect state. */ + public state?: (google.cloud.compute.v1.Interconnect.State|keyof typeof google.cloud.compute.v1.Interconnect.State|null); + + /** Interconnect _adminEnabled. */ + public _adminEnabled?: "adminEnabled"; + + /** Interconnect _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Interconnect _customerName. */ + public _customerName?: "customerName"; + + /** Interconnect _description. */ + public _description?: "description"; + + /** Interconnect _googleIpAddress. */ + public _googleIpAddress?: "googleIpAddress"; + + /** Interconnect _googleReferenceId. */ + public _googleReferenceId?: "googleReferenceId"; + + /** Interconnect _id. */ + public _id?: "id"; + + /** Interconnect _interconnectType. */ + public _interconnectType?: "interconnectType"; + + /** Interconnect _kind. */ + public _kind?: "kind"; + + /** Interconnect _linkType. */ + public _linkType?: "linkType"; + + /** Interconnect _location. */ + public _location?: "location"; + + /** Interconnect _name. */ + public _name?: "name"; + + /** Interconnect _nocContactEmail. */ + public _nocContactEmail?: "nocContactEmail"; + + /** Interconnect _operationalStatus. */ + public _operationalStatus?: "operationalStatus"; + + /** Interconnect _peerIpAddress. */ + public _peerIpAddress?: "peerIpAddress"; + + /** Interconnect _provisionedLinkCount. */ + public _provisionedLinkCount?: "provisionedLinkCount"; + + /** Interconnect _requestedLinkCount. */ + public _requestedLinkCount?: "requestedLinkCount"; + + /** Interconnect _selfLink. */ + public _selfLink?: "selfLink"; + + /** Interconnect _state. */ + public _state?: "state"; + + /** + * Creates a new Interconnect instance using the specified properties. + * @param [properties] Properties to set + * @returns Interconnect instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnect): google.cloud.compute.v1.Interconnect; + + /** + * Encodes the specified Interconnect message. Does not implicitly {@link google.cloud.compute.v1.Interconnect.verify|verify} messages. + * @param message Interconnect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interconnect message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Interconnect.verify|verify} messages. + * @param message Interconnect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interconnect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interconnect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Interconnect; + + /** + * Decodes an Interconnect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interconnect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Interconnect; + + /** + * Verifies an Interconnect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interconnect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interconnect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Interconnect; + + /** + * Creates a plain object from an Interconnect message. Also converts values to other types if specified. + * @param message Interconnect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Interconnect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interconnect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Interconnect { + + /** InterconnectType enum. */ + enum InterconnectType { + UNDEFINED_INTERCONNECT_TYPE = 0, + DEDICATED = 258411983, + IT_PRIVATE = 335677007, + PARTNER = 461924520 + } + + /** LinkType enum. */ + enum LinkType { + UNDEFINED_LINK_TYPE = 0, + LINK_TYPE_ETHERNET_100G_LR = 337672551, + LINK_TYPE_ETHERNET_10G_LR = 236739749 + } + + /** OperationalStatus enum. */ + enum OperationalStatus { + UNDEFINED_OPERATIONAL_STATUS = 0, + OS_ACTIVE = 55721409, + OS_UNPROVISIONED = 239771840 + } + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + ACTIVE = 314733318, + UNPROVISIONED = 517333979 + } + } + + /** Properties of an InterconnectAttachmentPartnerMetadata. */ + interface IInterconnectAttachmentPartnerMetadata { + + /** InterconnectAttachmentPartnerMetadata interconnectName */ + interconnectName?: (string|null); + + /** InterconnectAttachmentPartnerMetadata partnerName */ + partnerName?: (string|null); + + /** InterconnectAttachmentPartnerMetadata portalUrl */ + portalUrl?: (string|null); + } + + /** Represents an InterconnectAttachmentPartnerMetadata. */ + class InterconnectAttachmentPartnerMetadata implements IInterconnectAttachmentPartnerMetadata { + + /** + * Constructs a new InterconnectAttachmentPartnerMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata); + + /** InterconnectAttachmentPartnerMetadata interconnectName. */ + public interconnectName?: (string|null); + + /** InterconnectAttachmentPartnerMetadata partnerName. */ + public partnerName?: (string|null); + + /** InterconnectAttachmentPartnerMetadata portalUrl. */ + public portalUrl?: (string|null); + + /** InterconnectAttachmentPartnerMetadata _interconnectName. */ + public _interconnectName?: "interconnectName"; + + /** InterconnectAttachmentPartnerMetadata _partnerName. */ + public _partnerName?: "partnerName"; + + /** InterconnectAttachmentPartnerMetadata _portalUrl. */ + public _portalUrl?: "portalUrl"; + + /** + * Creates a new InterconnectAttachmentPartnerMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectAttachmentPartnerMetadata instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata): google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata; + + /** + * Encodes the specified InterconnectAttachmentPartnerMetadata message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.verify|verify} messages. + * @param message InterconnectAttachmentPartnerMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectAttachmentPartnerMetadata message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.verify|verify} messages. + * @param message InterconnectAttachmentPartnerMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectAttachmentPartnerMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectAttachmentPartnerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata; + + /** + * Decodes an InterconnectAttachmentPartnerMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectAttachmentPartnerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata; + + /** + * Verifies an InterconnectAttachmentPartnerMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectAttachmentPartnerMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectAttachmentPartnerMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata; + + /** + * Creates a plain object from an InterconnectAttachmentPartnerMetadata message. Also converts values to other types if specified. + * @param message InterconnectAttachmentPartnerMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectAttachmentPartnerMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectAttachmentPrivateInfo. */ + interface IInterconnectAttachmentPrivateInfo { + + /** InterconnectAttachmentPrivateInfo tag8021q */ + tag8021q?: (number|null); + } + + /** Represents an InterconnectAttachmentPrivateInfo. */ + class InterconnectAttachmentPrivateInfo implements IInterconnectAttachmentPrivateInfo { + + /** + * Constructs a new InterconnectAttachmentPrivateInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo); + + /** InterconnectAttachmentPrivateInfo tag8021q. */ + public tag8021q?: (number|null); + + /** InterconnectAttachmentPrivateInfo _tag8021q. */ + public _tag8021q?: "tag8021q"; + + /** + * Creates a new InterconnectAttachmentPrivateInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectAttachmentPrivateInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo): google.cloud.compute.v1.InterconnectAttachmentPrivateInfo; + + /** + * Encodes the specified InterconnectAttachmentPrivateInfo message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.verify|verify} messages. + * @param message InterconnectAttachmentPrivateInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectAttachmentPrivateInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.verify|verify} messages. + * @param message InterconnectAttachmentPrivateInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectAttachmentPrivateInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectAttachmentPrivateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectAttachmentPrivateInfo; + + /** + * Decodes an InterconnectAttachmentPrivateInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectAttachmentPrivateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectAttachmentPrivateInfo; + + /** + * Verifies an InterconnectAttachmentPrivateInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectAttachmentPrivateInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectAttachmentPrivateInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectAttachmentPrivateInfo; + + /** + * Creates a plain object from an InterconnectAttachmentPrivateInfo message. Also converts values to other types if specified. + * @param message InterconnectAttachmentPrivateInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectAttachmentPrivateInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectAttachmentPrivateInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectAttachment. */ + interface IInterconnectAttachment { + + /** InterconnectAttachment adminEnabled */ + adminEnabled?: (boolean|null); + + /** InterconnectAttachment bandwidth */ + bandwidth?: (google.cloud.compute.v1.InterconnectAttachment.Bandwidth|keyof typeof google.cloud.compute.v1.InterconnectAttachment.Bandwidth|null); + + /** InterconnectAttachment candidateSubnets */ + candidateSubnets?: (string[]|null); + + /** InterconnectAttachment cloudRouterIpAddress */ + cloudRouterIpAddress?: (string|null); + + /** InterconnectAttachment creationTimestamp */ + creationTimestamp?: (string|null); + + /** InterconnectAttachment customerRouterIpAddress */ + customerRouterIpAddress?: (string|null); + + /** InterconnectAttachment dataplaneVersion */ + dataplaneVersion?: (number|null); + + /** InterconnectAttachment description */ + description?: (string|null); + + /** InterconnectAttachment edgeAvailabilityDomain */ + edgeAvailabilityDomain?: (google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain|keyof typeof google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain|null); + + /** InterconnectAttachment encryption */ + encryption?: (google.cloud.compute.v1.InterconnectAttachment.Encryption|keyof typeof google.cloud.compute.v1.InterconnectAttachment.Encryption|null); + + /** InterconnectAttachment googleReferenceId */ + googleReferenceId?: (string|null); + + /** InterconnectAttachment id */ + id?: (number|Long|string|null); + + /** InterconnectAttachment interconnect */ + interconnect?: (string|null); + + /** InterconnectAttachment ipsecInternalAddresses */ + ipsecInternalAddresses?: (string[]|null); + + /** InterconnectAttachment kind */ + kind?: (string|null); + + /** InterconnectAttachment mtu */ + mtu?: (number|null); + + /** InterconnectAttachment name */ + name?: (string|null); + + /** InterconnectAttachment operationalStatus */ + operationalStatus?: (google.cloud.compute.v1.InterconnectAttachment.OperationalStatus|keyof typeof google.cloud.compute.v1.InterconnectAttachment.OperationalStatus|null); + + /** InterconnectAttachment pairingKey */ + pairingKey?: (string|null); + + /** InterconnectAttachment partnerAsn */ + partnerAsn?: (number|Long|string|null); + + /** InterconnectAttachment partnerMetadata */ + partnerMetadata?: (google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata|null); + + /** InterconnectAttachment privateInterconnectInfo */ + privateInterconnectInfo?: (google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo|null); + + /** InterconnectAttachment region */ + region?: (string|null); + + /** InterconnectAttachment router */ + router?: (string|null); + + /** InterconnectAttachment selfLink */ + selfLink?: (string|null); + + /** InterconnectAttachment state */ + state?: (google.cloud.compute.v1.InterconnectAttachment.State|keyof typeof google.cloud.compute.v1.InterconnectAttachment.State|null); + + /** InterconnectAttachment type */ + type?: (google.cloud.compute.v1.InterconnectAttachment.Type|keyof typeof google.cloud.compute.v1.InterconnectAttachment.Type|null); + + /** InterconnectAttachment vlanTag8021q */ + vlanTag8021q?: (number|null); + } + + /** Represents an InterconnectAttachment. */ + class InterconnectAttachment implements IInterconnectAttachment { + + /** + * Constructs a new InterconnectAttachment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectAttachment); + + /** InterconnectAttachment adminEnabled. */ + public adminEnabled?: (boolean|null); + + /** InterconnectAttachment bandwidth. */ + public bandwidth?: (google.cloud.compute.v1.InterconnectAttachment.Bandwidth|keyof typeof google.cloud.compute.v1.InterconnectAttachment.Bandwidth|null); + + /** InterconnectAttachment candidateSubnets. */ + public candidateSubnets: string[]; + + /** InterconnectAttachment cloudRouterIpAddress. */ + public cloudRouterIpAddress?: (string|null); + + /** InterconnectAttachment creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** InterconnectAttachment customerRouterIpAddress. */ + public customerRouterIpAddress?: (string|null); + + /** InterconnectAttachment dataplaneVersion. */ + public dataplaneVersion?: (number|null); + + /** InterconnectAttachment description. */ + public description?: (string|null); + + /** InterconnectAttachment edgeAvailabilityDomain. */ + public edgeAvailabilityDomain?: (google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain|keyof typeof google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain|null); + + /** InterconnectAttachment encryption. */ + public encryption?: (google.cloud.compute.v1.InterconnectAttachment.Encryption|keyof typeof google.cloud.compute.v1.InterconnectAttachment.Encryption|null); + + /** InterconnectAttachment googleReferenceId. */ + public googleReferenceId?: (string|null); + + /** InterconnectAttachment id. */ + public id?: (number|Long|string|null); + + /** InterconnectAttachment interconnect. */ + public interconnect?: (string|null); + + /** InterconnectAttachment ipsecInternalAddresses. */ + public ipsecInternalAddresses: string[]; + + /** InterconnectAttachment kind. */ + public kind?: (string|null); + + /** InterconnectAttachment mtu. */ + public mtu?: (number|null); + + /** InterconnectAttachment name. */ + public name?: (string|null); + + /** InterconnectAttachment operationalStatus. */ + public operationalStatus?: (google.cloud.compute.v1.InterconnectAttachment.OperationalStatus|keyof typeof google.cloud.compute.v1.InterconnectAttachment.OperationalStatus|null); + + /** InterconnectAttachment pairingKey. */ + public pairingKey?: (string|null); + + /** InterconnectAttachment partnerAsn. */ + public partnerAsn?: (number|Long|string|null); + + /** InterconnectAttachment partnerMetadata. */ + public partnerMetadata?: (google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata|null); + + /** InterconnectAttachment privateInterconnectInfo. */ + public privateInterconnectInfo?: (google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo|null); + + /** InterconnectAttachment region. */ + public region?: (string|null); + + /** InterconnectAttachment router. */ + public router?: (string|null); + + /** InterconnectAttachment selfLink. */ + public selfLink?: (string|null); + + /** InterconnectAttachment state. */ + public state?: (google.cloud.compute.v1.InterconnectAttachment.State|keyof typeof google.cloud.compute.v1.InterconnectAttachment.State|null); + + /** InterconnectAttachment type. */ + public type?: (google.cloud.compute.v1.InterconnectAttachment.Type|keyof typeof google.cloud.compute.v1.InterconnectAttachment.Type|null); + + /** InterconnectAttachment vlanTag8021q. */ + public vlanTag8021q?: (number|null); + + /** InterconnectAttachment _adminEnabled. */ + public _adminEnabled?: "adminEnabled"; + + /** InterconnectAttachment _bandwidth. */ + public _bandwidth?: "bandwidth"; + + /** InterconnectAttachment _cloudRouterIpAddress. */ + public _cloudRouterIpAddress?: "cloudRouterIpAddress"; + + /** InterconnectAttachment _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** InterconnectAttachment _customerRouterIpAddress. */ + public _customerRouterIpAddress?: "customerRouterIpAddress"; + + /** InterconnectAttachment _dataplaneVersion. */ + public _dataplaneVersion?: "dataplaneVersion"; + + /** InterconnectAttachment _description. */ + public _description?: "description"; + + /** InterconnectAttachment _edgeAvailabilityDomain. */ + public _edgeAvailabilityDomain?: "edgeAvailabilityDomain"; + + /** InterconnectAttachment _encryption. */ + public _encryption?: "encryption"; + + /** InterconnectAttachment _googleReferenceId. */ + public _googleReferenceId?: "googleReferenceId"; + + /** InterconnectAttachment _id. */ + public _id?: "id"; + + /** InterconnectAttachment _interconnect. */ + public _interconnect?: "interconnect"; + + /** InterconnectAttachment _kind. */ + public _kind?: "kind"; + + /** InterconnectAttachment _mtu. */ + public _mtu?: "mtu"; + + /** InterconnectAttachment _name. */ + public _name?: "name"; + + /** InterconnectAttachment _operationalStatus. */ + public _operationalStatus?: "operationalStatus"; + + /** InterconnectAttachment _pairingKey. */ + public _pairingKey?: "pairingKey"; + + /** InterconnectAttachment _partnerAsn. */ + public _partnerAsn?: "partnerAsn"; + + /** InterconnectAttachment _partnerMetadata. */ + public _partnerMetadata?: "partnerMetadata"; + + /** InterconnectAttachment _privateInterconnectInfo. */ + public _privateInterconnectInfo?: "privateInterconnectInfo"; + + /** InterconnectAttachment _region. */ + public _region?: "region"; + + /** InterconnectAttachment _router. */ + public _router?: "router"; + + /** InterconnectAttachment _selfLink. */ + public _selfLink?: "selfLink"; + + /** InterconnectAttachment _state. */ + public _state?: "state"; + + /** InterconnectAttachment _type. */ + public _type?: "type"; + + /** InterconnectAttachment _vlanTag8021q. */ + public _vlanTag8021q?: "vlanTag8021q"; + + /** + * Creates a new InterconnectAttachment instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectAttachment instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectAttachment): google.cloud.compute.v1.InterconnectAttachment; + + /** + * Encodes the specified InterconnectAttachment message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachment.verify|verify} messages. + * @param message InterconnectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectAttachment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachment.verify|verify} messages. + * @param message InterconnectAttachment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectAttachment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectAttachment; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectAttachment; + + /** + * Verifies an InterconnectAttachment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectAttachment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectAttachment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectAttachment; + + /** + * Creates a plain object from an InterconnectAttachment message. Also converts values to other types if specified. + * @param message InterconnectAttachment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectAttachment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectAttachment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterconnectAttachment { + + /** Bandwidth enum. */ + enum Bandwidth { + UNDEFINED_BANDWIDTH = 0, + BPS_100M = 49547958, + BPS_10G = 278693006, + BPS_1G = 355358448, + BPS_200M = 49577749, + BPS_20G = 278693967, + BPS_2G = 355358479, + BPS_300M = 49607540, + BPS_400M = 49637331, + BPS_500M = 49667122, + BPS_50G = 278696850, + BPS_50M = 278696856, + BPS_5G = 355358572 + } + + /** EdgeAvailabilityDomain enum. */ + enum EdgeAvailabilityDomain { + UNDEFINED_EDGE_AVAILABILITY_DOMAIN = 0, + AVAILABILITY_DOMAIN_1 = 349552090, + AVAILABILITY_DOMAIN_2 = 349552091, + AVAILABILITY_DOMAIN_ANY = 375256373 + } + + /** Encryption enum. */ + enum Encryption { + UNDEFINED_ENCRYPTION = 0, + IPSEC = 69882282, + NONE = 2402104 + } + + /** OperationalStatus enum. */ + enum OperationalStatus { + UNDEFINED_OPERATIONAL_STATUS = 0, + OS_ACTIVE = 55721409, + OS_UNPROVISIONED = 239771840 + } + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + ACTIVE = 314733318, + DEFUNCT = 115891759, + PARTNER_REQUEST_RECEIVED = 513587304, + PENDING_CUSTOMER = 167494054, + PENDING_PARTNER = 387890656, + STATE_UNSPECIFIED = 470755401, + UNPROVISIONED = 517333979 + } + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + DEDICATED = 258411983, + PARTNER = 461924520, + PARTNER_PROVIDER = 483261352 + } + } + + /** Properties of an InterconnectAttachmentsScopedList. */ + interface IInterconnectAttachmentsScopedList { + + /** InterconnectAttachmentsScopedList interconnectAttachments */ + interconnectAttachments?: (google.cloud.compute.v1.IInterconnectAttachment[]|null); + + /** InterconnectAttachmentsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InterconnectAttachmentsScopedList. */ + class InterconnectAttachmentsScopedList implements IInterconnectAttachmentsScopedList { + + /** + * Constructs a new InterconnectAttachmentsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectAttachmentsScopedList); + + /** InterconnectAttachmentsScopedList interconnectAttachments. */ + public interconnectAttachments: google.cloud.compute.v1.IInterconnectAttachment[]; + + /** InterconnectAttachmentsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InterconnectAttachmentsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InterconnectAttachmentsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectAttachmentsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectAttachmentsScopedList): google.cloud.compute.v1.InterconnectAttachmentsScopedList; + + /** + * Encodes the specified InterconnectAttachmentsScopedList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentsScopedList.verify|verify} messages. + * @param message InterconnectAttachmentsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectAttachmentsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectAttachmentsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentsScopedList.verify|verify} messages. + * @param message InterconnectAttachmentsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectAttachmentsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectAttachmentsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectAttachmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectAttachmentsScopedList; + + /** + * Decodes an InterconnectAttachmentsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectAttachmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectAttachmentsScopedList; + + /** + * Verifies an InterconnectAttachmentsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectAttachmentsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectAttachmentsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectAttachmentsScopedList; + + /** + * Creates a plain object from an InterconnectAttachmentsScopedList message. Also converts values to other types if specified. + * @param message InterconnectAttachmentsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectAttachmentsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectAttachmentsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectAttachmentAggregatedList. */ + interface IInterconnectAttachmentAggregatedList { + + /** InterconnectAttachmentAggregatedList id */ + id?: (string|null); + + /** InterconnectAttachmentAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IInterconnectAttachmentsScopedList }|null); + + /** InterconnectAttachmentAggregatedList kind */ + kind?: (string|null); + + /** InterconnectAttachmentAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** InterconnectAttachmentAggregatedList selfLink */ + selfLink?: (string|null); + + /** InterconnectAttachmentAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** InterconnectAttachmentAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InterconnectAttachmentAggregatedList. */ + class InterconnectAttachmentAggregatedList implements IInterconnectAttachmentAggregatedList { + + /** + * Constructs a new InterconnectAttachmentAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectAttachmentAggregatedList); + + /** InterconnectAttachmentAggregatedList id. */ + public id?: (string|null); + + /** InterconnectAttachmentAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IInterconnectAttachmentsScopedList }; + + /** InterconnectAttachmentAggregatedList kind. */ + public kind?: (string|null); + + /** InterconnectAttachmentAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InterconnectAttachmentAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** InterconnectAttachmentAggregatedList unreachables. */ + public unreachables: string[]; + + /** InterconnectAttachmentAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InterconnectAttachmentAggregatedList _id. */ + public _id?: "id"; + + /** InterconnectAttachmentAggregatedList _kind. */ + public _kind?: "kind"; + + /** InterconnectAttachmentAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InterconnectAttachmentAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InterconnectAttachmentAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InterconnectAttachmentAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectAttachmentAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectAttachmentAggregatedList): google.cloud.compute.v1.InterconnectAttachmentAggregatedList; + + /** + * Encodes the specified InterconnectAttachmentAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentAggregatedList.verify|verify} messages. + * @param message InterconnectAttachmentAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectAttachmentAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectAttachmentAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentAggregatedList.verify|verify} messages. + * @param message InterconnectAttachmentAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectAttachmentAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectAttachmentAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectAttachmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectAttachmentAggregatedList; + + /** + * Decodes an InterconnectAttachmentAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectAttachmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectAttachmentAggregatedList; + + /** + * Verifies an InterconnectAttachmentAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectAttachmentAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectAttachmentAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectAttachmentAggregatedList; + + /** + * Creates a plain object from an InterconnectAttachmentAggregatedList message. Also converts values to other types if specified. + * @param message InterconnectAttachmentAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectAttachmentAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectAttachmentAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectAttachmentList. */ + interface IInterconnectAttachmentList { + + /** InterconnectAttachmentList id */ + id?: (string|null); + + /** InterconnectAttachmentList items */ + items?: (google.cloud.compute.v1.IInterconnectAttachment[]|null); + + /** InterconnectAttachmentList kind */ + kind?: (string|null); + + /** InterconnectAttachmentList nextPageToken */ + nextPageToken?: (string|null); + + /** InterconnectAttachmentList selfLink */ + selfLink?: (string|null); + + /** InterconnectAttachmentList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InterconnectAttachmentList. */ + class InterconnectAttachmentList implements IInterconnectAttachmentList { + + /** + * Constructs a new InterconnectAttachmentList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectAttachmentList); + + /** InterconnectAttachmentList id. */ + public id?: (string|null); + + /** InterconnectAttachmentList items. */ + public items: google.cloud.compute.v1.IInterconnectAttachment[]; + + /** InterconnectAttachmentList kind. */ + public kind?: (string|null); + + /** InterconnectAttachmentList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InterconnectAttachmentList selfLink. */ + public selfLink?: (string|null); + + /** InterconnectAttachmentList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InterconnectAttachmentList _id. */ + public _id?: "id"; + + /** InterconnectAttachmentList _kind. */ + public _kind?: "kind"; + + /** InterconnectAttachmentList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InterconnectAttachmentList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InterconnectAttachmentList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InterconnectAttachmentList instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectAttachmentList instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectAttachmentList): google.cloud.compute.v1.InterconnectAttachmentList; + + /** + * Encodes the specified InterconnectAttachmentList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentList.verify|verify} messages. + * @param message InterconnectAttachmentList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectAttachmentList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectAttachmentList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentList.verify|verify} messages. + * @param message InterconnectAttachmentList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectAttachmentList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectAttachmentList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectAttachmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectAttachmentList; + + /** + * Decodes an InterconnectAttachmentList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectAttachmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectAttachmentList; + + /** + * Verifies an InterconnectAttachmentList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectAttachmentList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectAttachmentList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectAttachmentList; + + /** + * Creates a plain object from an InterconnectAttachmentList message. Also converts values to other types if specified. + * @param message InterconnectAttachmentList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectAttachmentList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectAttachmentList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectDiagnosticsARPEntry. */ + interface IInterconnectDiagnosticsARPEntry { + + /** InterconnectDiagnosticsARPEntry ipAddress */ + ipAddress?: (string|null); + + /** InterconnectDiagnosticsARPEntry macAddress */ + macAddress?: (string|null); + } + + /** Represents an InterconnectDiagnosticsARPEntry. */ + class InterconnectDiagnosticsARPEntry implements IInterconnectDiagnosticsARPEntry { + + /** + * Constructs a new InterconnectDiagnosticsARPEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry); + + /** InterconnectDiagnosticsARPEntry ipAddress. */ + public ipAddress?: (string|null); + + /** InterconnectDiagnosticsARPEntry macAddress. */ + public macAddress?: (string|null); + + /** InterconnectDiagnosticsARPEntry _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** InterconnectDiagnosticsARPEntry _macAddress. */ + public _macAddress?: "macAddress"; + + /** + * Creates a new InterconnectDiagnosticsARPEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectDiagnosticsARPEntry instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry): google.cloud.compute.v1.InterconnectDiagnosticsARPEntry; + + /** + * Encodes the specified InterconnectDiagnosticsARPEntry message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.verify|verify} messages. + * @param message InterconnectDiagnosticsARPEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectDiagnosticsARPEntry message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.verify|verify} messages. + * @param message InterconnectDiagnosticsARPEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectDiagnosticsARPEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectDiagnosticsARPEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectDiagnosticsARPEntry; + + /** + * Decodes an InterconnectDiagnosticsARPEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectDiagnosticsARPEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectDiagnosticsARPEntry; + + /** + * Verifies an InterconnectDiagnosticsARPEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectDiagnosticsARPEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectDiagnosticsARPEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectDiagnosticsARPEntry; + + /** + * Creates a plain object from an InterconnectDiagnosticsARPEntry message. Also converts values to other types if specified. + * @param message InterconnectDiagnosticsARPEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectDiagnosticsARPEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectDiagnosticsARPEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectDiagnosticsLinkStatus. */ + interface IInterconnectDiagnosticsLinkStatus { + + /** InterconnectDiagnosticsLinkStatus arpCaches */ + arpCaches?: (google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry[]|null); + + /** InterconnectDiagnosticsLinkStatus circuitId */ + circuitId?: (string|null); + + /** InterconnectDiagnosticsLinkStatus googleDemarc */ + googleDemarc?: (string|null); + + /** InterconnectDiagnosticsLinkStatus lacpStatus */ + lacpStatus?: (google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus|null); + + /** InterconnectDiagnosticsLinkStatus receivingOpticalPower */ + receivingOpticalPower?: (google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null); + + /** InterconnectDiagnosticsLinkStatus transmittingOpticalPower */ + transmittingOpticalPower?: (google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null); + } + + /** Represents an InterconnectDiagnosticsLinkStatus. */ + class InterconnectDiagnosticsLinkStatus implements IInterconnectDiagnosticsLinkStatus { + + /** + * Constructs a new InterconnectDiagnosticsLinkStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus); + + /** InterconnectDiagnosticsLinkStatus arpCaches. */ + public arpCaches: google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry[]; + + /** InterconnectDiagnosticsLinkStatus circuitId. */ + public circuitId?: (string|null); + + /** InterconnectDiagnosticsLinkStatus googleDemarc. */ + public googleDemarc?: (string|null); + + /** InterconnectDiagnosticsLinkStatus lacpStatus. */ + public lacpStatus?: (google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus|null); + + /** InterconnectDiagnosticsLinkStatus receivingOpticalPower. */ + public receivingOpticalPower?: (google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null); + + /** InterconnectDiagnosticsLinkStatus transmittingOpticalPower. */ + public transmittingOpticalPower?: (google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null); + + /** InterconnectDiagnosticsLinkStatus _circuitId. */ + public _circuitId?: "circuitId"; + + /** InterconnectDiagnosticsLinkStatus _googleDemarc. */ + public _googleDemarc?: "googleDemarc"; + + /** InterconnectDiagnosticsLinkStatus _lacpStatus. */ + public _lacpStatus?: "lacpStatus"; + + /** InterconnectDiagnosticsLinkStatus _receivingOpticalPower. */ + public _receivingOpticalPower?: "receivingOpticalPower"; + + /** InterconnectDiagnosticsLinkStatus _transmittingOpticalPower. */ + public _transmittingOpticalPower?: "transmittingOpticalPower"; + + /** + * Creates a new InterconnectDiagnosticsLinkStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectDiagnosticsLinkStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus): google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus; + + /** + * Encodes the specified InterconnectDiagnosticsLinkStatus message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.verify|verify} messages. + * @param message InterconnectDiagnosticsLinkStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectDiagnosticsLinkStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.verify|verify} messages. + * @param message InterconnectDiagnosticsLinkStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectDiagnosticsLinkStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectDiagnosticsLinkStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus; + + /** + * Decodes an InterconnectDiagnosticsLinkStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectDiagnosticsLinkStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus; + + /** + * Verifies an InterconnectDiagnosticsLinkStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectDiagnosticsLinkStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectDiagnosticsLinkStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus; + + /** + * Creates a plain object from an InterconnectDiagnosticsLinkStatus message. Also converts values to other types if specified. + * @param message InterconnectDiagnosticsLinkStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectDiagnosticsLinkStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectDiagnostics. */ + interface IInterconnectDiagnostics { + + /** InterconnectDiagnostics arpCaches */ + arpCaches?: (google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry[]|null); + + /** InterconnectDiagnostics links */ + links?: (google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus[]|null); + + /** InterconnectDiagnostics macAddress */ + macAddress?: (string|null); + } + + /** Represents an InterconnectDiagnostics. */ + class InterconnectDiagnostics implements IInterconnectDiagnostics { + + /** + * Constructs a new InterconnectDiagnostics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectDiagnostics); + + /** InterconnectDiagnostics arpCaches. */ + public arpCaches: google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry[]; + + /** InterconnectDiagnostics links. */ + public links: google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus[]; + + /** InterconnectDiagnostics macAddress. */ + public macAddress?: (string|null); + + /** InterconnectDiagnostics _macAddress. */ + public _macAddress?: "macAddress"; + + /** + * Creates a new InterconnectDiagnostics instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectDiagnostics instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectDiagnostics): google.cloud.compute.v1.InterconnectDiagnostics; + + /** + * Encodes the specified InterconnectDiagnostics message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnostics.verify|verify} messages. + * @param message InterconnectDiagnostics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectDiagnostics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectDiagnostics message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnostics.verify|verify} messages. + * @param message InterconnectDiagnostics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectDiagnostics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectDiagnostics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectDiagnostics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectDiagnostics; + + /** + * Decodes an InterconnectDiagnostics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectDiagnostics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectDiagnostics; + + /** + * Verifies an InterconnectDiagnostics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectDiagnostics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectDiagnostics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectDiagnostics; + + /** + * Creates a plain object from an InterconnectDiagnostics message. Also converts values to other types if specified. + * @param message InterconnectDiagnostics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectDiagnostics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectDiagnostics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectDiagnosticsLinkLACPStatus. */ + interface IInterconnectDiagnosticsLinkLACPStatus { + + /** InterconnectDiagnosticsLinkLACPStatus googleSystemId */ + googleSystemId?: (string|null); + + /** InterconnectDiagnosticsLinkLACPStatus neighborSystemId */ + neighborSystemId?: (string|null); + + /** InterconnectDiagnosticsLinkLACPStatus state */ + state?: (google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State|keyof typeof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State|null); + } + + /** Represents an InterconnectDiagnosticsLinkLACPStatus. */ + class InterconnectDiagnosticsLinkLACPStatus implements IInterconnectDiagnosticsLinkLACPStatus { + + /** + * Constructs a new InterconnectDiagnosticsLinkLACPStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus); + + /** InterconnectDiagnosticsLinkLACPStatus googleSystemId. */ + public googleSystemId?: (string|null); + + /** InterconnectDiagnosticsLinkLACPStatus neighborSystemId. */ + public neighborSystemId?: (string|null); + + /** InterconnectDiagnosticsLinkLACPStatus state. */ + public state?: (google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State|keyof typeof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State|null); + + /** InterconnectDiagnosticsLinkLACPStatus _googleSystemId. */ + public _googleSystemId?: "googleSystemId"; + + /** InterconnectDiagnosticsLinkLACPStatus _neighborSystemId. */ + public _neighborSystemId?: "neighborSystemId"; + + /** InterconnectDiagnosticsLinkLACPStatus _state. */ + public _state?: "state"; + + /** + * Creates a new InterconnectDiagnosticsLinkLACPStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectDiagnosticsLinkLACPStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus): google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus; + + /** + * Encodes the specified InterconnectDiagnosticsLinkLACPStatus message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.verify|verify} messages. + * @param message InterconnectDiagnosticsLinkLACPStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectDiagnosticsLinkLACPStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.verify|verify} messages. + * @param message InterconnectDiagnosticsLinkLACPStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectDiagnosticsLinkLACPStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectDiagnosticsLinkLACPStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus; + + /** + * Decodes an InterconnectDiagnosticsLinkLACPStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectDiagnosticsLinkLACPStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus; + + /** + * Verifies an InterconnectDiagnosticsLinkLACPStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectDiagnosticsLinkLACPStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectDiagnosticsLinkLACPStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus; + + /** + * Creates a plain object from an InterconnectDiagnosticsLinkLACPStatus message. Also converts values to other types if specified. + * @param message InterconnectDiagnosticsLinkLACPStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectDiagnosticsLinkLACPStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterconnectDiagnosticsLinkLACPStatus { + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + ACTIVE = 314733318, + DETACHED = 216562546 + } + } + + /** Properties of an InterconnectDiagnosticsLinkOpticalPower. */ + interface IInterconnectDiagnosticsLinkOpticalPower { + + /** InterconnectDiagnosticsLinkOpticalPower state */ + state?: (google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State|keyof typeof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State|null); + + /** InterconnectDiagnosticsLinkOpticalPower value */ + value?: (number|null); + } + + /** Represents an InterconnectDiagnosticsLinkOpticalPower. */ + class InterconnectDiagnosticsLinkOpticalPower implements IInterconnectDiagnosticsLinkOpticalPower { + + /** + * Constructs a new InterconnectDiagnosticsLinkOpticalPower. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower); + + /** InterconnectDiagnosticsLinkOpticalPower state. */ + public state?: (google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State|keyof typeof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State|null); + + /** InterconnectDiagnosticsLinkOpticalPower value. */ + public value?: (number|null); + + /** InterconnectDiagnosticsLinkOpticalPower _state. */ + public _state?: "state"; + + /** InterconnectDiagnosticsLinkOpticalPower _value. */ + public _value?: "value"; + + /** + * Creates a new InterconnectDiagnosticsLinkOpticalPower instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectDiagnosticsLinkOpticalPower instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower): google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower; + + /** + * Encodes the specified InterconnectDiagnosticsLinkOpticalPower message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.verify|verify} messages. + * @param message InterconnectDiagnosticsLinkOpticalPower message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectDiagnosticsLinkOpticalPower message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.verify|verify} messages. + * @param message InterconnectDiagnosticsLinkOpticalPower message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectDiagnosticsLinkOpticalPower message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectDiagnosticsLinkOpticalPower + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower; + + /** + * Decodes an InterconnectDiagnosticsLinkOpticalPower message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectDiagnosticsLinkOpticalPower + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower; + + /** + * Verifies an InterconnectDiagnosticsLinkOpticalPower message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectDiagnosticsLinkOpticalPower message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectDiagnosticsLinkOpticalPower + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower; + + /** + * Creates a plain object from an InterconnectDiagnosticsLinkOpticalPower message. Also converts values to other types if specified. + * @param message InterconnectDiagnosticsLinkOpticalPower + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectDiagnosticsLinkOpticalPower to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterconnectDiagnosticsLinkOpticalPower { + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + HIGH_ALARM = 305363284, + HIGH_WARNING = 220984799, + LOW_ALARM = 316659046, + LOW_WARNING = 338793841, + OK = 2524 + } + } + + /** Properties of an InterconnectList. */ + interface IInterconnectList { + + /** InterconnectList id */ + id?: (string|null); + + /** InterconnectList items */ + items?: (google.cloud.compute.v1.IInterconnect[]|null); + + /** InterconnectList kind */ + kind?: (string|null); + + /** InterconnectList nextPageToken */ + nextPageToken?: (string|null); + + /** InterconnectList selfLink */ + selfLink?: (string|null); + + /** InterconnectList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InterconnectList. */ + class InterconnectList implements IInterconnectList { + + /** + * Constructs a new InterconnectList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectList); + + /** InterconnectList id. */ + public id?: (string|null); + + /** InterconnectList items. */ + public items: google.cloud.compute.v1.IInterconnect[]; + + /** InterconnectList kind. */ + public kind?: (string|null); + + /** InterconnectList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InterconnectList selfLink. */ + public selfLink?: (string|null); + + /** InterconnectList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InterconnectList _id. */ + public _id?: "id"; + + /** InterconnectList _kind. */ + public _kind?: "kind"; + + /** InterconnectList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InterconnectList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InterconnectList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InterconnectList instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectList instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectList): google.cloud.compute.v1.InterconnectList; + + /** + * Encodes the specified InterconnectList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectList.verify|verify} messages. + * @param message InterconnectList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectList.verify|verify} messages. + * @param message InterconnectList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectList; + + /** + * Decodes an InterconnectList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectList; + + /** + * Verifies an InterconnectList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectList; + + /** + * Creates a plain object from an InterconnectList message. Also converts values to other types if specified. + * @param message InterconnectList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectLocationRegionInfo. */ + interface IInterconnectLocationRegionInfo { + + /** InterconnectLocationRegionInfo expectedRttMs */ + expectedRttMs?: (number|Long|string|null); + + /** InterconnectLocationRegionInfo locationPresence */ + locationPresence?: (google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence|keyof typeof google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence|null); + + /** InterconnectLocationRegionInfo region */ + region?: (string|null); + } + + /** Represents an InterconnectLocationRegionInfo. */ + class InterconnectLocationRegionInfo implements IInterconnectLocationRegionInfo { + + /** + * Constructs a new InterconnectLocationRegionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectLocationRegionInfo); + + /** InterconnectLocationRegionInfo expectedRttMs. */ + public expectedRttMs?: (number|Long|string|null); + + /** InterconnectLocationRegionInfo locationPresence. */ + public locationPresence?: (google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence|keyof typeof google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence|null); + + /** InterconnectLocationRegionInfo region. */ + public region?: (string|null); + + /** InterconnectLocationRegionInfo _expectedRttMs. */ + public _expectedRttMs?: "expectedRttMs"; + + /** InterconnectLocationRegionInfo _locationPresence. */ + public _locationPresence?: "locationPresence"; + + /** InterconnectLocationRegionInfo _region. */ + public _region?: "region"; + + /** + * Creates a new InterconnectLocationRegionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectLocationRegionInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectLocationRegionInfo): google.cloud.compute.v1.InterconnectLocationRegionInfo; + + /** + * Encodes the specified InterconnectLocationRegionInfo message. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationRegionInfo.verify|verify} messages. + * @param message InterconnectLocationRegionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectLocationRegionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectLocationRegionInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationRegionInfo.verify|verify} messages. + * @param message InterconnectLocationRegionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectLocationRegionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectLocationRegionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectLocationRegionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectLocationRegionInfo; + + /** + * Decodes an InterconnectLocationRegionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectLocationRegionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectLocationRegionInfo; + + /** + * Verifies an InterconnectLocationRegionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectLocationRegionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectLocationRegionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectLocationRegionInfo; + + /** + * Creates a plain object from an InterconnectLocationRegionInfo message. Also converts values to other types if specified. + * @param message InterconnectLocationRegionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectLocationRegionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectLocationRegionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterconnectLocationRegionInfo { + + /** LocationPresence enum. */ + enum LocationPresence { + UNDEFINED_LOCATION_PRESENCE = 0, + GLOBAL = 494663587, + LOCAL_REGION = 403535464, + LP_GLOBAL = 429584062, + LP_LOCAL_REGION = 488598851 + } + } + + /** Properties of an InterconnectLocation. */ + interface IInterconnectLocation { + + /** InterconnectLocation address */ + address?: (string|null); + + /** InterconnectLocation availabilityZone */ + availabilityZone?: (string|null); + + /** InterconnectLocation city */ + city?: (string|null); + + /** InterconnectLocation continent */ + continent?: (google.cloud.compute.v1.InterconnectLocation.Continent|keyof typeof google.cloud.compute.v1.InterconnectLocation.Continent|null); + + /** InterconnectLocation creationTimestamp */ + creationTimestamp?: (string|null); + + /** InterconnectLocation description */ + description?: (string|null); + + /** InterconnectLocation facilityProvider */ + facilityProvider?: (string|null); + + /** InterconnectLocation facilityProviderFacilityId */ + facilityProviderFacilityId?: (string|null); + + /** InterconnectLocation id */ + id?: (number|Long|string|null); + + /** InterconnectLocation kind */ + kind?: (string|null); + + /** InterconnectLocation name */ + name?: (string|null); + + /** InterconnectLocation peeringdbFacilityId */ + peeringdbFacilityId?: (string|null); + + /** InterconnectLocation regionInfos */ + regionInfos?: (google.cloud.compute.v1.IInterconnectLocationRegionInfo[]|null); + + /** InterconnectLocation selfLink */ + selfLink?: (string|null); + + /** InterconnectLocation status */ + status?: (google.cloud.compute.v1.InterconnectLocation.Status|keyof typeof google.cloud.compute.v1.InterconnectLocation.Status|null); + } + + /** Represents an InterconnectLocation. */ + class InterconnectLocation implements IInterconnectLocation { + + /** + * Constructs a new InterconnectLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectLocation); + + /** InterconnectLocation address. */ + public address?: (string|null); + + /** InterconnectLocation availabilityZone. */ + public availabilityZone?: (string|null); + + /** InterconnectLocation city. */ + public city?: (string|null); + + /** InterconnectLocation continent. */ + public continent?: (google.cloud.compute.v1.InterconnectLocation.Continent|keyof typeof google.cloud.compute.v1.InterconnectLocation.Continent|null); + + /** InterconnectLocation creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** InterconnectLocation description. */ + public description?: (string|null); + + /** InterconnectLocation facilityProvider. */ + public facilityProvider?: (string|null); + + /** InterconnectLocation facilityProviderFacilityId. */ + public facilityProviderFacilityId?: (string|null); + + /** InterconnectLocation id. */ + public id?: (number|Long|string|null); + + /** InterconnectLocation kind. */ + public kind?: (string|null); + + /** InterconnectLocation name. */ + public name?: (string|null); + + /** InterconnectLocation peeringdbFacilityId. */ + public peeringdbFacilityId?: (string|null); + + /** InterconnectLocation regionInfos. */ + public regionInfos: google.cloud.compute.v1.IInterconnectLocationRegionInfo[]; + + /** InterconnectLocation selfLink. */ + public selfLink?: (string|null); + + /** InterconnectLocation status. */ + public status?: (google.cloud.compute.v1.InterconnectLocation.Status|keyof typeof google.cloud.compute.v1.InterconnectLocation.Status|null); + + /** InterconnectLocation _address. */ + public _address?: "address"; + + /** InterconnectLocation _availabilityZone. */ + public _availabilityZone?: "availabilityZone"; + + /** InterconnectLocation _city. */ + public _city?: "city"; + + /** InterconnectLocation _continent. */ + public _continent?: "continent"; + + /** InterconnectLocation _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** InterconnectLocation _description. */ + public _description?: "description"; + + /** InterconnectLocation _facilityProvider. */ + public _facilityProvider?: "facilityProvider"; + + /** InterconnectLocation _facilityProviderFacilityId. */ + public _facilityProviderFacilityId?: "facilityProviderFacilityId"; + + /** InterconnectLocation _id. */ + public _id?: "id"; + + /** InterconnectLocation _kind. */ + public _kind?: "kind"; + + /** InterconnectLocation _name. */ + public _name?: "name"; + + /** InterconnectLocation _peeringdbFacilityId. */ + public _peeringdbFacilityId?: "peeringdbFacilityId"; + + /** InterconnectLocation _selfLink. */ + public _selfLink?: "selfLink"; + + /** InterconnectLocation _status. */ + public _status?: "status"; + + /** + * Creates a new InterconnectLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectLocation instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectLocation): google.cloud.compute.v1.InterconnectLocation; + + /** + * Encodes the specified InterconnectLocation message. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocation.verify|verify} messages. + * @param message InterconnectLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectLocation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocation.verify|verify} messages. + * @param message InterconnectLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectLocation; + + /** + * Decodes an InterconnectLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectLocation; + + /** + * Verifies an InterconnectLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectLocation; + + /** + * Creates a plain object from an InterconnectLocation message. Also converts values to other types if specified. + * @param message InterconnectLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace InterconnectLocation { + + /** Continent enum. */ + enum Continent { + UNDEFINED_CONTINENT = 0, + AFRICA = 317443706, + ASIA_PAC = 119782269, + C_AFRICA = 71993846, + C_ASIA_PAC = 465668089, + C_EUROPE = 200369438, + C_NORTH_AMERICA = 275697048, + C_SOUTH_AMERICA = 397149792, + EUROPE = 445819298, + NORTH_AMERICA = 448015508, + SOUTH_AMERICA = 32597340 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + AVAILABLE = 442079913, + CLOSED = 380163436 + } + } + + /** Properties of an InterconnectLocationList. */ + interface IInterconnectLocationList { + + /** InterconnectLocationList id */ + id?: (string|null); + + /** InterconnectLocationList items */ + items?: (google.cloud.compute.v1.IInterconnectLocation[]|null); + + /** InterconnectLocationList kind */ + kind?: (string|null); + + /** InterconnectLocationList nextPageToken */ + nextPageToken?: (string|null); + + /** InterconnectLocationList selfLink */ + selfLink?: (string|null); + + /** InterconnectLocationList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an InterconnectLocationList. */ + class InterconnectLocationList implements IInterconnectLocationList { + + /** + * Constructs a new InterconnectLocationList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectLocationList); + + /** InterconnectLocationList id. */ + public id?: (string|null); + + /** InterconnectLocationList items. */ + public items: google.cloud.compute.v1.IInterconnectLocation[]; + + /** InterconnectLocationList kind. */ + public kind?: (string|null); + + /** InterconnectLocationList nextPageToken. */ + public nextPageToken?: (string|null); + + /** InterconnectLocationList selfLink. */ + public selfLink?: (string|null); + + /** InterconnectLocationList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** InterconnectLocationList _id. */ + public _id?: "id"; + + /** InterconnectLocationList _kind. */ + public _kind?: "kind"; + + /** InterconnectLocationList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** InterconnectLocationList _selfLink. */ + public _selfLink?: "selfLink"; + + /** InterconnectLocationList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new InterconnectLocationList instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectLocationList instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectLocationList): google.cloud.compute.v1.InterconnectLocationList; + + /** + * Encodes the specified InterconnectLocationList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationList.verify|verify} messages. + * @param message InterconnectLocationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectLocationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectLocationList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationList.verify|verify} messages. + * @param message InterconnectLocationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectLocationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectLocationList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectLocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectLocationList; + + /** + * Decodes an InterconnectLocationList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectLocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectLocationList; + + /** + * Verifies an InterconnectLocationList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectLocationList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectLocationList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectLocationList; + + /** + * Creates a plain object from an InterconnectLocationList message. Also converts values to other types if specified. + * @param message InterconnectLocationList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectLocationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectLocationList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InterconnectsGetDiagnosticsResponse. */ + interface IInterconnectsGetDiagnosticsResponse { + + /** InterconnectsGetDiagnosticsResponse result */ + result?: (google.cloud.compute.v1.IInterconnectDiagnostics|null); + } + + /** Represents an InterconnectsGetDiagnosticsResponse. */ + class InterconnectsGetDiagnosticsResponse implements IInterconnectsGetDiagnosticsResponse { + + /** + * Constructs a new InterconnectsGetDiagnosticsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse); + + /** InterconnectsGetDiagnosticsResponse result. */ + public result?: (google.cloud.compute.v1.IInterconnectDiagnostics|null); + + /** InterconnectsGetDiagnosticsResponse _result. */ + public _result?: "result"; + + /** + * Creates a new InterconnectsGetDiagnosticsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InterconnectsGetDiagnosticsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse): google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse; + + /** + * Encodes the specified InterconnectsGetDiagnosticsResponse message. Does not implicitly {@link google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse.verify|verify} messages. + * @param message InterconnectsGetDiagnosticsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InterconnectsGetDiagnosticsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse.verify|verify} messages. + * @param message InterconnectsGetDiagnosticsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InterconnectsGetDiagnosticsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InterconnectsGetDiagnosticsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse; + + /** + * Decodes an InterconnectsGetDiagnosticsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InterconnectsGetDiagnosticsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse; + + /** + * Verifies an InterconnectsGetDiagnosticsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InterconnectsGetDiagnosticsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InterconnectsGetDiagnosticsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse; + + /** + * Creates a plain object from an InterconnectsGetDiagnosticsResponse message. Also converts values to other types if specified. + * @param message InterconnectsGetDiagnosticsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InterconnectsGetDiagnosticsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LicenseResourceRequirements. */ + interface ILicenseResourceRequirements { + + /** LicenseResourceRequirements minGuestCpuCount */ + minGuestCpuCount?: (number|null); + + /** LicenseResourceRequirements minMemoryMb */ + minMemoryMb?: (number|null); + } + + /** Represents a LicenseResourceRequirements. */ + class LicenseResourceRequirements implements ILicenseResourceRequirements { + + /** + * Constructs a new LicenseResourceRequirements. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILicenseResourceRequirements); + + /** LicenseResourceRequirements minGuestCpuCount. */ + public minGuestCpuCount?: (number|null); + + /** LicenseResourceRequirements minMemoryMb. */ + public minMemoryMb?: (number|null); + + /** LicenseResourceRequirements _minGuestCpuCount. */ + public _minGuestCpuCount?: "minGuestCpuCount"; + + /** LicenseResourceRequirements _minMemoryMb. */ + public _minMemoryMb?: "minMemoryMb"; + + /** + * Creates a new LicenseResourceRequirements instance using the specified properties. + * @param [properties] Properties to set + * @returns LicenseResourceRequirements instance + */ + public static create(properties?: google.cloud.compute.v1.ILicenseResourceRequirements): google.cloud.compute.v1.LicenseResourceRequirements; + + /** + * Encodes the specified LicenseResourceRequirements message. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceRequirements.verify|verify} messages. + * @param message LicenseResourceRequirements message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILicenseResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LicenseResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceRequirements.verify|verify} messages. + * @param message LicenseResourceRequirements message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILicenseResourceRequirements, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LicenseResourceRequirements message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LicenseResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LicenseResourceRequirements; + + /** + * Decodes a LicenseResourceRequirements message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LicenseResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LicenseResourceRequirements; + + /** + * Verifies a LicenseResourceRequirements message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LicenseResourceRequirements message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LicenseResourceRequirements + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LicenseResourceRequirements; + + /** + * Creates a plain object from a LicenseResourceRequirements message. Also converts values to other types if specified. + * @param message LicenseResourceRequirements + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LicenseResourceRequirements, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LicenseResourceRequirements to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a License. */ + interface ILicense { + + /** License chargesUseFee */ + chargesUseFee?: (boolean|null); + + /** License creationTimestamp */ + creationTimestamp?: (string|null); + + /** License description */ + description?: (string|null); + + /** License id */ + id?: (number|Long|string|null); + + /** License kind */ + kind?: (string|null); + + /** License licenseCode */ + licenseCode?: (number|Long|string|null); + + /** License name */ + name?: (string|null); + + /** License resourceRequirements */ + resourceRequirements?: (google.cloud.compute.v1.ILicenseResourceRequirements|null); + + /** License selfLink */ + selfLink?: (string|null); + + /** License transferable */ + transferable?: (boolean|null); + } + + /** Represents a License. */ + class License implements ILicense { + + /** + * Constructs a new License. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILicense); + + /** License chargesUseFee. */ + public chargesUseFee?: (boolean|null); + + /** License creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** License description. */ + public description?: (string|null); + + /** License id. */ + public id?: (number|Long|string|null); + + /** License kind. */ + public kind?: (string|null); + + /** License licenseCode. */ + public licenseCode?: (number|Long|string|null); + + /** License name. */ + public name?: (string|null); + + /** License resourceRequirements. */ + public resourceRequirements?: (google.cloud.compute.v1.ILicenseResourceRequirements|null); + + /** License selfLink. */ + public selfLink?: (string|null); + + /** License transferable. */ + public transferable?: (boolean|null); + + /** License _chargesUseFee. */ + public _chargesUseFee?: "chargesUseFee"; + + /** License _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** License _description. */ + public _description?: "description"; + + /** License _id. */ + public _id?: "id"; + + /** License _kind. */ + public _kind?: "kind"; + + /** License _licenseCode. */ + public _licenseCode?: "licenseCode"; + + /** License _name. */ + public _name?: "name"; + + /** License _resourceRequirements. */ + public _resourceRequirements?: "resourceRequirements"; + + /** License _selfLink. */ + public _selfLink?: "selfLink"; + + /** License _transferable. */ + public _transferable?: "transferable"; + + /** + * Creates a new License instance using the specified properties. + * @param [properties] Properties to set + * @returns License instance + */ + public static create(properties?: google.cloud.compute.v1.ILicense): google.cloud.compute.v1.License; + + /** + * Encodes the specified License message. Does not implicitly {@link google.cloud.compute.v1.License.verify|verify} messages. + * @param message License message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified License message, length delimited. Does not implicitly {@link google.cloud.compute.v1.License.verify|verify} messages. + * @param message License message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILicense, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a License message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns License + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.License; + + /** + * Decodes a License message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns License + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.License; + + /** + * Verifies a License message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a License message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns License + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.License; + + /** + * Creates a plain object from a License message. Also converts values to other types if specified. + * @param message License + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.License, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this License to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LicenseCodeLicenseAlias. */ + interface ILicenseCodeLicenseAlias { + + /** LicenseCodeLicenseAlias description */ + description?: (string|null); + + /** LicenseCodeLicenseAlias selfLink */ + selfLink?: (string|null); + } + + /** Represents a LicenseCodeLicenseAlias. */ + class LicenseCodeLicenseAlias implements ILicenseCodeLicenseAlias { + + /** + * Constructs a new LicenseCodeLicenseAlias. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILicenseCodeLicenseAlias); + + /** LicenseCodeLicenseAlias description. */ + public description?: (string|null); + + /** LicenseCodeLicenseAlias selfLink. */ + public selfLink?: (string|null); + + /** LicenseCodeLicenseAlias _description. */ + public _description?: "description"; + + /** LicenseCodeLicenseAlias _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new LicenseCodeLicenseAlias instance using the specified properties. + * @param [properties] Properties to set + * @returns LicenseCodeLicenseAlias instance + */ + public static create(properties?: google.cloud.compute.v1.ILicenseCodeLicenseAlias): google.cloud.compute.v1.LicenseCodeLicenseAlias; + + /** + * Encodes the specified LicenseCodeLicenseAlias message. Does not implicitly {@link google.cloud.compute.v1.LicenseCodeLicenseAlias.verify|verify} messages. + * @param message LicenseCodeLicenseAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILicenseCodeLicenseAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LicenseCodeLicenseAlias message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseCodeLicenseAlias.verify|verify} messages. + * @param message LicenseCodeLicenseAlias message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILicenseCodeLicenseAlias, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LicenseCodeLicenseAlias message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LicenseCodeLicenseAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LicenseCodeLicenseAlias; + + /** + * Decodes a LicenseCodeLicenseAlias message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LicenseCodeLicenseAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LicenseCodeLicenseAlias; + + /** + * Verifies a LicenseCodeLicenseAlias message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LicenseCodeLicenseAlias message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LicenseCodeLicenseAlias + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LicenseCodeLicenseAlias; + + /** + * Creates a plain object from a LicenseCodeLicenseAlias message. Also converts values to other types if specified. + * @param message LicenseCodeLicenseAlias + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LicenseCodeLicenseAlias, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LicenseCodeLicenseAlias to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LicenseCode. */ + interface ILicenseCode { + + /** LicenseCode creationTimestamp */ + creationTimestamp?: (string|null); + + /** LicenseCode description */ + description?: (string|null); + + /** LicenseCode id */ + id?: (number|Long|string|null); + + /** LicenseCode kind */ + kind?: (string|null); + + /** LicenseCode licenseAlias */ + licenseAlias?: (google.cloud.compute.v1.ILicenseCodeLicenseAlias[]|null); + + /** LicenseCode name */ + name?: (string|null); + + /** LicenseCode selfLink */ + selfLink?: (string|null); + + /** LicenseCode state */ + state?: (google.cloud.compute.v1.LicenseCode.State|keyof typeof google.cloud.compute.v1.LicenseCode.State|null); + + /** LicenseCode transferable */ + transferable?: (boolean|null); + } + + /** Represents a LicenseCode. */ + class LicenseCode implements ILicenseCode { + + /** + * Constructs a new LicenseCode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILicenseCode); + + /** LicenseCode creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** LicenseCode description. */ + public description?: (string|null); + + /** LicenseCode id. */ + public id?: (number|Long|string|null); + + /** LicenseCode kind. */ + public kind?: (string|null); + + /** LicenseCode licenseAlias. */ + public licenseAlias: google.cloud.compute.v1.ILicenseCodeLicenseAlias[]; + + /** LicenseCode name. */ + public name?: (string|null); + + /** LicenseCode selfLink. */ + public selfLink?: (string|null); + + /** LicenseCode state. */ + public state?: (google.cloud.compute.v1.LicenseCode.State|keyof typeof google.cloud.compute.v1.LicenseCode.State|null); + + /** LicenseCode transferable. */ + public transferable?: (boolean|null); + + /** LicenseCode _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** LicenseCode _description. */ + public _description?: "description"; + + /** LicenseCode _id. */ + public _id?: "id"; + + /** LicenseCode _kind. */ + public _kind?: "kind"; + + /** LicenseCode _name. */ + public _name?: "name"; + + /** LicenseCode _selfLink. */ + public _selfLink?: "selfLink"; + + /** LicenseCode _state. */ + public _state?: "state"; + + /** LicenseCode _transferable. */ + public _transferable?: "transferable"; + + /** + * Creates a new LicenseCode instance using the specified properties. + * @param [properties] Properties to set + * @returns LicenseCode instance + */ + public static create(properties?: google.cloud.compute.v1.ILicenseCode): google.cloud.compute.v1.LicenseCode; + + /** + * Encodes the specified LicenseCode message. Does not implicitly {@link google.cloud.compute.v1.LicenseCode.verify|verify} messages. + * @param message LicenseCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILicenseCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LicenseCode message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseCode.verify|verify} messages. + * @param message LicenseCode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILicenseCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LicenseCode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LicenseCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LicenseCode; + + /** + * Decodes a LicenseCode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LicenseCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LicenseCode; + + /** + * Verifies a LicenseCode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LicenseCode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LicenseCode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LicenseCode; + + /** + * Creates a plain object from a LicenseCode message. Also converts values to other types if specified. + * @param message LicenseCode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LicenseCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LicenseCode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace LicenseCode { + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + DISABLED = 516696700, + ENABLED = 182130465, + RESTRICTED = 261551195, + STATE_UNSPECIFIED = 470755401, + TERMINATED = 250018339 + } + } + + /** Properties of a LicensesListResponse. */ + interface ILicensesListResponse { + + /** LicensesListResponse id */ + id?: (string|null); + + /** LicensesListResponse items */ + items?: (google.cloud.compute.v1.ILicense[]|null); + + /** LicensesListResponse nextPageToken */ + nextPageToken?: (string|null); + + /** LicensesListResponse selfLink */ + selfLink?: (string|null); + + /** LicensesListResponse warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a LicensesListResponse. */ + class LicensesListResponse implements ILicensesListResponse { + + /** + * Constructs a new LicensesListResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILicensesListResponse); + + /** LicensesListResponse id. */ + public id?: (string|null); + + /** LicensesListResponse items. */ + public items: google.cloud.compute.v1.ILicense[]; + + /** LicensesListResponse nextPageToken. */ + public nextPageToken?: (string|null); + + /** LicensesListResponse selfLink. */ + public selfLink?: (string|null); + + /** LicensesListResponse warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** LicensesListResponse _id. */ + public _id?: "id"; + + /** LicensesListResponse _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** LicensesListResponse _selfLink. */ + public _selfLink?: "selfLink"; + + /** LicensesListResponse _warning. */ + public _warning?: "warning"; + + /** + * Creates a new LicensesListResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LicensesListResponse instance + */ + public static create(properties?: google.cloud.compute.v1.ILicensesListResponse): google.cloud.compute.v1.LicensesListResponse; + + /** + * Encodes the specified LicensesListResponse message. Does not implicitly {@link google.cloud.compute.v1.LicensesListResponse.verify|verify} messages. + * @param message LicensesListResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILicensesListResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LicensesListResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicensesListResponse.verify|verify} messages. + * @param message LicensesListResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILicensesListResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LicensesListResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LicensesListResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LicensesListResponse; + + /** + * Decodes a LicensesListResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LicensesListResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LicensesListResponse; + + /** + * Verifies a LicensesListResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LicensesListResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LicensesListResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LicensesListResponse; + + /** + * Creates a plain object from a LicensesListResponse message. Also converts values to other types if specified. + * @param message LicensesListResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LicensesListResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LicensesListResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LocalDisk. */ + interface ILocalDisk { + + /** LocalDisk diskCount */ + diskCount?: (number|null); + + /** LocalDisk diskSizeGb */ + diskSizeGb?: (number|null); + + /** LocalDisk diskType */ + diskType?: (string|null); + } + + /** Represents a LocalDisk. */ + class LocalDisk implements ILocalDisk { + + /** + * Constructs a new LocalDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILocalDisk); + + /** LocalDisk diskCount. */ + public diskCount?: (number|null); + + /** LocalDisk diskSizeGb. */ + public diskSizeGb?: (number|null); + + /** LocalDisk diskType. */ + public diskType?: (string|null); + + /** LocalDisk _diskCount. */ + public _diskCount?: "diskCount"; + + /** LocalDisk _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** LocalDisk _diskType. */ + public _diskType?: "diskType"; + + /** + * Creates a new LocalDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns LocalDisk instance + */ + public static create(properties?: google.cloud.compute.v1.ILocalDisk): google.cloud.compute.v1.LocalDisk; + + /** + * Encodes the specified LocalDisk message. Does not implicitly {@link google.cloud.compute.v1.LocalDisk.verify|verify} messages. + * @param message LocalDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILocalDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocalDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LocalDisk.verify|verify} messages. + * @param message LocalDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILocalDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocalDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocalDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LocalDisk; + + /** + * Decodes a LocalDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocalDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LocalDisk; + + /** + * Verifies a LocalDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocalDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocalDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LocalDisk; + + /** + * Creates a plain object from a LocalDisk message. Also converts values to other types if specified. + * @param message LocalDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LocalDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocalDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LocationPolicyLocation. */ + interface ILocationPolicyLocation { + + /** LocationPolicyLocation preference */ + preference?: (google.cloud.compute.v1.LocationPolicyLocation.Preference|keyof typeof google.cloud.compute.v1.LocationPolicyLocation.Preference|null); + } + + /** Represents a LocationPolicyLocation. */ + class LocationPolicyLocation implements ILocationPolicyLocation { + + /** + * Constructs a new LocationPolicyLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILocationPolicyLocation); + + /** LocationPolicyLocation preference. */ + public preference?: (google.cloud.compute.v1.LocationPolicyLocation.Preference|keyof typeof google.cloud.compute.v1.LocationPolicyLocation.Preference|null); + + /** LocationPolicyLocation _preference. */ + public _preference?: "preference"; + + /** + * Creates a new LocationPolicyLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationPolicyLocation instance + */ + public static create(properties?: google.cloud.compute.v1.ILocationPolicyLocation): google.cloud.compute.v1.LocationPolicyLocation; + + /** + * Encodes the specified LocationPolicyLocation message. Does not implicitly {@link google.cloud.compute.v1.LocationPolicyLocation.verify|verify} messages. + * @param message LocationPolicyLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILocationPolicyLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationPolicyLocation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LocationPolicyLocation.verify|verify} messages. + * @param message LocationPolicyLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILocationPolicyLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationPolicyLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationPolicyLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LocationPolicyLocation; + + /** + * Decodes a LocationPolicyLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationPolicyLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LocationPolicyLocation; + + /** + * Verifies a LocationPolicyLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LocationPolicyLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationPolicyLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LocationPolicyLocation; + + /** + * Creates a plain object from a LocationPolicyLocation message. Also converts values to other types if specified. + * @param message LocationPolicyLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LocationPolicyLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationPolicyLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace LocationPolicyLocation { + + /** Preference enum. */ + enum Preference { + UNDEFINED_PREFERENCE = 0, + ALLOW = 62368553, + DENY = 2094604, + PREFERENCE_UNSPECIFIED = 496219571 + } + } + + /** Properties of a LogConfigCloudAuditOptions. */ + interface ILogConfigCloudAuditOptions { + + /** LogConfigCloudAuditOptions authorizationLoggingOptions */ + authorizationLoggingOptions?: (google.cloud.compute.v1.IAuthorizationLoggingOptions|null); + + /** LogConfigCloudAuditOptions logName */ + logName?: (google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName|keyof typeof google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName|null); + } + + /** Represents a LogConfigCloudAuditOptions. */ + class LogConfigCloudAuditOptions implements ILogConfigCloudAuditOptions { + + /** + * Constructs a new LogConfigCloudAuditOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILogConfigCloudAuditOptions); + + /** LogConfigCloudAuditOptions authorizationLoggingOptions. */ + public authorizationLoggingOptions?: (google.cloud.compute.v1.IAuthorizationLoggingOptions|null); + + /** LogConfigCloudAuditOptions logName. */ + public logName?: (google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName|keyof typeof google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName|null); + + /** LogConfigCloudAuditOptions _authorizationLoggingOptions. */ + public _authorizationLoggingOptions?: "authorizationLoggingOptions"; + + /** LogConfigCloudAuditOptions _logName. */ + public _logName?: "logName"; + + /** + * Creates a new LogConfigCloudAuditOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns LogConfigCloudAuditOptions instance + */ + public static create(properties?: google.cloud.compute.v1.ILogConfigCloudAuditOptions): google.cloud.compute.v1.LogConfigCloudAuditOptions; + + /** + * Encodes the specified LogConfigCloudAuditOptions message. Does not implicitly {@link google.cloud.compute.v1.LogConfigCloudAuditOptions.verify|verify} messages. + * @param message LogConfigCloudAuditOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILogConfigCloudAuditOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogConfigCloudAuditOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigCloudAuditOptions.verify|verify} messages. + * @param message LogConfigCloudAuditOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILogConfigCloudAuditOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogConfigCloudAuditOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogConfigCloudAuditOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LogConfigCloudAuditOptions; + + /** + * Decodes a LogConfigCloudAuditOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogConfigCloudAuditOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LogConfigCloudAuditOptions; + + /** + * Verifies a LogConfigCloudAuditOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogConfigCloudAuditOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogConfigCloudAuditOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LogConfigCloudAuditOptions; + + /** + * Creates a plain object from a LogConfigCloudAuditOptions message. Also converts values to other types if specified. + * @param message LogConfigCloudAuditOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LogConfigCloudAuditOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogConfigCloudAuditOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace LogConfigCloudAuditOptions { + + /** LogName enum. */ + enum LogName { + UNDEFINED_LOG_NAME = 0, + ADMIN_ACTIVITY = 427503135, + DATA_ACCESS = 238070681, + UNSPECIFIED_LOG_NAME = 410515182 + } + } + + /** Properties of a LogConfigCounterOptions. */ + interface ILogConfigCounterOptions { + + /** LogConfigCounterOptions customFields */ + customFields?: (google.cloud.compute.v1.ILogConfigCounterOptionsCustomField[]|null); + + /** LogConfigCounterOptions field */ + field?: (string|null); + + /** LogConfigCounterOptions metric */ + metric?: (string|null); + } + + /** Represents a LogConfigCounterOptions. */ + class LogConfigCounterOptions implements ILogConfigCounterOptions { + + /** + * Constructs a new LogConfigCounterOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILogConfigCounterOptions); + + /** LogConfigCounterOptions customFields. */ + public customFields: google.cloud.compute.v1.ILogConfigCounterOptionsCustomField[]; + + /** LogConfigCounterOptions field. */ + public field?: (string|null); + + /** LogConfigCounterOptions metric. */ + public metric?: (string|null); + + /** LogConfigCounterOptions _field. */ + public _field?: "field"; + + /** LogConfigCounterOptions _metric. */ + public _metric?: "metric"; + + /** + * Creates a new LogConfigCounterOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns LogConfigCounterOptions instance + */ + public static create(properties?: google.cloud.compute.v1.ILogConfigCounterOptions): google.cloud.compute.v1.LogConfigCounterOptions; + + /** + * Encodes the specified LogConfigCounterOptions message. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptions.verify|verify} messages. + * @param message LogConfigCounterOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILogConfigCounterOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogConfigCounterOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptions.verify|verify} messages. + * @param message LogConfigCounterOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILogConfigCounterOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogConfigCounterOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogConfigCounterOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LogConfigCounterOptions; + + /** + * Decodes a LogConfigCounterOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogConfigCounterOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LogConfigCounterOptions; + + /** + * Verifies a LogConfigCounterOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogConfigCounterOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogConfigCounterOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LogConfigCounterOptions; + + /** + * Creates a plain object from a LogConfigCounterOptions message. Also converts values to other types if specified. + * @param message LogConfigCounterOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LogConfigCounterOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogConfigCounterOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LogConfigDataAccessOptions. */ + interface ILogConfigDataAccessOptions { + + /** LogConfigDataAccessOptions logMode */ + logMode?: (google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode|keyof typeof google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode|null); + } + + /** Represents a LogConfigDataAccessOptions. */ + class LogConfigDataAccessOptions implements ILogConfigDataAccessOptions { + + /** + * Constructs a new LogConfigDataAccessOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILogConfigDataAccessOptions); + + /** LogConfigDataAccessOptions logMode. */ + public logMode?: (google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode|keyof typeof google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode|null); + + /** LogConfigDataAccessOptions _logMode. */ + public _logMode?: "logMode"; + + /** + * Creates a new LogConfigDataAccessOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns LogConfigDataAccessOptions instance + */ + public static create(properties?: google.cloud.compute.v1.ILogConfigDataAccessOptions): google.cloud.compute.v1.LogConfigDataAccessOptions; + + /** + * Encodes the specified LogConfigDataAccessOptions message. Does not implicitly {@link google.cloud.compute.v1.LogConfigDataAccessOptions.verify|verify} messages. + * @param message LogConfigDataAccessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILogConfigDataAccessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogConfigDataAccessOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigDataAccessOptions.verify|verify} messages. + * @param message LogConfigDataAccessOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILogConfigDataAccessOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogConfigDataAccessOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogConfigDataAccessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LogConfigDataAccessOptions; + + /** + * Decodes a LogConfigDataAccessOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogConfigDataAccessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LogConfigDataAccessOptions; + + /** + * Verifies a LogConfigDataAccessOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogConfigDataAccessOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogConfigDataAccessOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LogConfigDataAccessOptions; + + /** + * Creates a plain object from a LogConfigDataAccessOptions message. Also converts values to other types if specified. + * @param message LogConfigDataAccessOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LogConfigDataAccessOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogConfigDataAccessOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace LogConfigDataAccessOptions { + + /** LogMode enum. */ + enum LogMode { + UNDEFINED_LOG_MODE = 0, + LOG_FAIL_CLOSED = 360469778, + LOG_MODE_UNSPECIFIED = 88160822 + } + } + + /** Properties of a LogConfig. */ + interface ILogConfig { + + /** LogConfig cloudAudit */ + cloudAudit?: (google.cloud.compute.v1.ILogConfigCloudAuditOptions|null); + + /** LogConfig counter */ + counter?: (google.cloud.compute.v1.ILogConfigCounterOptions|null); + + /** LogConfig dataAccess */ + dataAccess?: (google.cloud.compute.v1.ILogConfigDataAccessOptions|null); + } + + /** Represents a LogConfig. */ + class LogConfig implements ILogConfig { + + /** + * Constructs a new LogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILogConfig); + + /** LogConfig cloudAudit. */ + public cloudAudit?: (google.cloud.compute.v1.ILogConfigCloudAuditOptions|null); + + /** LogConfig counter. */ + public counter?: (google.cloud.compute.v1.ILogConfigCounterOptions|null); + + /** LogConfig dataAccess. */ + public dataAccess?: (google.cloud.compute.v1.ILogConfigDataAccessOptions|null); + + /** LogConfig _cloudAudit. */ + public _cloudAudit?: "cloudAudit"; + + /** LogConfig _counter. */ + public _counter?: "counter"; + + /** LogConfig _dataAccess. */ + public _dataAccess?: "dataAccess"; + + /** + * Creates a new LogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LogConfig instance + */ + public static create(properties?: google.cloud.compute.v1.ILogConfig): google.cloud.compute.v1.LogConfig; + + /** + * Encodes the specified LogConfig message. Does not implicitly {@link google.cloud.compute.v1.LogConfig.verify|verify} messages. + * @param message LogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfig.verify|verify} messages. + * @param message LogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LogConfig; + + /** + * Decodes a LogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LogConfig; + + /** + * Verifies a LogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LogConfig; + + /** + * Creates a plain object from a LogConfig message. Also converts values to other types if specified. + * @param message LogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LogConfigCounterOptionsCustomField. */ + interface ILogConfigCounterOptionsCustomField { + + /** LogConfigCounterOptionsCustomField name */ + name?: (string|null); + + /** LogConfigCounterOptionsCustomField value */ + value?: (string|null); + } + + /** Represents a LogConfigCounterOptionsCustomField. */ + class LogConfigCounterOptionsCustomField implements ILogConfigCounterOptionsCustomField { + + /** + * Constructs a new LogConfigCounterOptionsCustomField. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ILogConfigCounterOptionsCustomField); + + /** LogConfigCounterOptionsCustomField name. */ + public name?: (string|null); + + /** LogConfigCounterOptionsCustomField value. */ + public value?: (string|null); + + /** LogConfigCounterOptionsCustomField _name. */ + public _name?: "name"; + + /** LogConfigCounterOptionsCustomField _value. */ + public _value?: "value"; + + /** + * Creates a new LogConfigCounterOptionsCustomField instance using the specified properties. + * @param [properties] Properties to set + * @returns LogConfigCounterOptionsCustomField instance + */ + public static create(properties?: google.cloud.compute.v1.ILogConfigCounterOptionsCustomField): google.cloud.compute.v1.LogConfigCounterOptionsCustomField; + + /** + * Encodes the specified LogConfigCounterOptionsCustomField message. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptionsCustomField.verify|verify} messages. + * @param message LogConfigCounterOptionsCustomField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ILogConfigCounterOptionsCustomField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogConfigCounterOptionsCustomField message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptionsCustomField.verify|verify} messages. + * @param message LogConfigCounterOptionsCustomField message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ILogConfigCounterOptionsCustomField, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogConfigCounterOptionsCustomField message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogConfigCounterOptionsCustomField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.LogConfigCounterOptionsCustomField; + + /** + * Decodes a LogConfigCounterOptionsCustomField message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogConfigCounterOptionsCustomField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.LogConfigCounterOptionsCustomField; + + /** + * Verifies a LogConfigCounterOptionsCustomField message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogConfigCounterOptionsCustomField message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogConfigCounterOptionsCustomField + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.LogConfigCounterOptionsCustomField; + + /** + * Creates a plain object from a LogConfigCounterOptionsCustomField message. Also converts values to other types if specified. + * @param message LogConfigCounterOptionsCustomField + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.LogConfigCounterOptionsCustomField, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogConfigCounterOptionsCustomField to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Accelerators. */ + interface IAccelerators { + + /** Accelerators guestAcceleratorCount */ + guestAcceleratorCount?: (number|null); + + /** Accelerators guestAcceleratorType */ + guestAcceleratorType?: (string|null); + } + + /** Represents an Accelerators. */ + class Accelerators implements IAccelerators { + + /** + * Constructs a new Accelerators. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAccelerators); + + /** Accelerators guestAcceleratorCount. */ + public guestAcceleratorCount?: (number|null); + + /** Accelerators guestAcceleratorType. */ + public guestAcceleratorType?: (string|null); + + /** Accelerators _guestAcceleratorCount. */ + public _guestAcceleratorCount?: "guestAcceleratorCount"; + + /** Accelerators _guestAcceleratorType. */ + public _guestAcceleratorType?: "guestAcceleratorType"; + + /** + * Creates a new Accelerators instance using the specified properties. + * @param [properties] Properties to set + * @returns Accelerators instance + */ + public static create(properties?: google.cloud.compute.v1.IAccelerators): google.cloud.compute.v1.Accelerators; + + /** + * Encodes the specified Accelerators message. Does not implicitly {@link google.cloud.compute.v1.Accelerators.verify|verify} messages. + * @param message Accelerators message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAccelerators, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accelerators message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Accelerators.verify|verify} messages. + * @param message Accelerators message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAccelerators, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accelerators message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accelerators + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Accelerators; + + /** + * Decodes an Accelerators message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accelerators + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Accelerators; + + /** + * Verifies an Accelerators message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Accelerators message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accelerators + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Accelerators; + + /** + * Creates a plain object from an Accelerators message. Also converts values to other types if specified. + * @param message Accelerators + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Accelerators, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accelerators to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ScratchDisks. */ + interface IScratchDisks { + + /** ScratchDisks diskGb */ + diskGb?: (number|null); + } + + /** Represents a ScratchDisks. */ + class ScratchDisks implements IScratchDisks { + + /** + * Constructs a new ScratchDisks. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IScratchDisks); + + /** ScratchDisks diskGb. */ + public diskGb?: (number|null); + + /** ScratchDisks _diskGb. */ + public _diskGb?: "diskGb"; + + /** + * Creates a new ScratchDisks instance using the specified properties. + * @param [properties] Properties to set + * @returns ScratchDisks instance + */ + public static create(properties?: google.cloud.compute.v1.IScratchDisks): google.cloud.compute.v1.ScratchDisks; + + /** + * Encodes the specified ScratchDisks message. Does not implicitly {@link google.cloud.compute.v1.ScratchDisks.verify|verify} messages. + * @param message ScratchDisks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IScratchDisks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScratchDisks message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ScratchDisks.verify|verify} messages. + * @param message ScratchDisks message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IScratchDisks, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScratchDisks message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScratchDisks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ScratchDisks; + + /** + * Decodes a ScratchDisks message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScratchDisks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ScratchDisks; + + /** + * Verifies a ScratchDisks message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScratchDisks message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScratchDisks + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ScratchDisks; + + /** + * Creates a plain object from a ScratchDisks message. Also converts values to other types if specified. + * @param message ScratchDisks + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ScratchDisks, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScratchDisks to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MachineType. */ + interface IMachineType { + + /** MachineType accelerators */ + accelerators?: (google.cloud.compute.v1.IAccelerators[]|null); + + /** MachineType creationTimestamp */ + creationTimestamp?: (string|null); + + /** MachineType deprecated */ + deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** MachineType description */ + description?: (string|null); + + /** MachineType guestCpus */ + guestCpus?: (number|null); + + /** MachineType id */ + id?: (number|Long|string|null); + + /** MachineType imageSpaceGb */ + imageSpaceGb?: (number|null); + + /** MachineType isSharedCpu */ + isSharedCpu?: (boolean|null); + + /** MachineType kind */ + kind?: (string|null); + + /** MachineType maximumPersistentDisks */ + maximumPersistentDisks?: (number|null); + + /** MachineType maximumPersistentDisksSizeGb */ + maximumPersistentDisksSizeGb?: (number|Long|string|null); + + /** MachineType memoryMb */ + memoryMb?: (number|null); + + /** MachineType name */ + name?: (string|null); + + /** MachineType scratchDisks */ + scratchDisks?: (google.cloud.compute.v1.IScratchDisks[]|null); + + /** MachineType selfLink */ + selfLink?: (string|null); + + /** MachineType zone */ + zone?: (string|null); + } + + /** Represents a MachineType. */ + class MachineType implements IMachineType { + + /** + * Constructs a new MachineType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMachineType); + + /** MachineType accelerators. */ + public accelerators: google.cloud.compute.v1.IAccelerators[]; + + /** MachineType creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** MachineType deprecated. */ + public deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** MachineType description. */ + public description?: (string|null); + + /** MachineType guestCpus. */ + public guestCpus?: (number|null); + + /** MachineType id. */ + public id?: (number|Long|string|null); + + /** MachineType imageSpaceGb. */ + public imageSpaceGb?: (number|null); + + /** MachineType isSharedCpu. */ + public isSharedCpu?: (boolean|null); + + /** MachineType kind. */ + public kind?: (string|null); + + /** MachineType maximumPersistentDisks. */ + public maximumPersistentDisks?: (number|null); + + /** MachineType maximumPersistentDisksSizeGb. */ + public maximumPersistentDisksSizeGb?: (number|Long|string|null); + + /** MachineType memoryMb. */ + public memoryMb?: (number|null); + + /** MachineType name. */ + public name?: (string|null); + + /** MachineType scratchDisks. */ + public scratchDisks: google.cloud.compute.v1.IScratchDisks[]; + + /** MachineType selfLink. */ + public selfLink?: (string|null); + + /** MachineType zone. */ + public zone?: (string|null); + + /** MachineType _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** MachineType _deprecated. */ + public _deprecated?: "deprecated"; + + /** MachineType _description. */ + public _description?: "description"; + + /** MachineType _guestCpus. */ + public _guestCpus?: "guestCpus"; + + /** MachineType _id. */ + public _id?: "id"; + + /** MachineType _imageSpaceGb. */ + public _imageSpaceGb?: "imageSpaceGb"; + + /** MachineType _isSharedCpu. */ + public _isSharedCpu?: "isSharedCpu"; + + /** MachineType _kind. */ + public _kind?: "kind"; + + /** MachineType _maximumPersistentDisks. */ + public _maximumPersistentDisks?: "maximumPersistentDisks"; + + /** MachineType _maximumPersistentDisksSizeGb. */ + public _maximumPersistentDisksSizeGb?: "maximumPersistentDisksSizeGb"; + + /** MachineType _memoryMb. */ + public _memoryMb?: "memoryMb"; + + /** MachineType _name. */ + public _name?: "name"; + + /** MachineType _selfLink. */ + public _selfLink?: "selfLink"; + + /** MachineType _zone. */ + public _zone?: "zone"; + + /** + * Creates a new MachineType instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineType instance + */ + public static create(properties?: google.cloud.compute.v1.IMachineType): google.cloud.compute.v1.MachineType; + + /** + * Encodes the specified MachineType message. Does not implicitly {@link google.cloud.compute.v1.MachineType.verify|verify} messages. + * @param message MachineType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMachineType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineType.verify|verify} messages. + * @param message MachineType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMachineType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MachineType; + + /** + * Decodes a MachineType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MachineType; + + /** + * Verifies a MachineType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MachineType; + + /** + * Creates a plain object from a MachineType message. Also converts values to other types if specified. + * @param message MachineType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MachineType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MachineTypesScopedList. */ + interface IMachineTypesScopedList { + + /** MachineTypesScopedList machineTypes */ + machineTypes?: (google.cloud.compute.v1.IMachineType[]|null); + + /** MachineTypesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a MachineTypesScopedList. */ + class MachineTypesScopedList implements IMachineTypesScopedList { + + /** + * Constructs a new MachineTypesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMachineTypesScopedList); + + /** MachineTypesScopedList machineTypes. */ + public machineTypes: google.cloud.compute.v1.IMachineType[]; + + /** MachineTypesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** MachineTypesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new MachineTypesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineTypesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IMachineTypesScopedList): google.cloud.compute.v1.MachineTypesScopedList; + + /** + * Encodes the specified MachineTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.MachineTypesScopedList.verify|verify} messages. + * @param message MachineTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMachineTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineTypesScopedList.verify|verify} messages. + * @param message MachineTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMachineTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineTypesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MachineTypesScopedList; + + /** + * Decodes a MachineTypesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MachineTypesScopedList; + + /** + * Verifies a MachineTypesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineTypesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MachineTypesScopedList; + + /** + * Creates a plain object from a MachineTypesScopedList message. Also converts values to other types if specified. + * @param message MachineTypesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MachineTypesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineTypesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MachineTypeAggregatedList. */ + interface IMachineTypeAggregatedList { + + /** MachineTypeAggregatedList id */ + id?: (string|null); + + /** MachineTypeAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IMachineTypesScopedList }|null); + + /** MachineTypeAggregatedList kind */ + kind?: (string|null); + + /** MachineTypeAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** MachineTypeAggregatedList selfLink */ + selfLink?: (string|null); + + /** MachineTypeAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** MachineTypeAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a MachineTypeAggregatedList. */ + class MachineTypeAggregatedList implements IMachineTypeAggregatedList { + + /** + * Constructs a new MachineTypeAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMachineTypeAggregatedList); + + /** MachineTypeAggregatedList id. */ + public id?: (string|null); + + /** MachineTypeAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IMachineTypesScopedList }; + + /** MachineTypeAggregatedList kind. */ + public kind?: (string|null); + + /** MachineTypeAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** MachineTypeAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** MachineTypeAggregatedList unreachables. */ + public unreachables: string[]; + + /** MachineTypeAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** MachineTypeAggregatedList _id. */ + public _id?: "id"; + + /** MachineTypeAggregatedList _kind. */ + public _kind?: "kind"; + + /** MachineTypeAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** MachineTypeAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** MachineTypeAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new MachineTypeAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineTypeAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IMachineTypeAggregatedList): google.cloud.compute.v1.MachineTypeAggregatedList; + + /** + * Encodes the specified MachineTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.MachineTypeAggregatedList.verify|verify} messages. + * @param message MachineTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMachineTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineTypeAggregatedList.verify|verify} messages. + * @param message MachineTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMachineTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineTypeAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MachineTypeAggregatedList; + + /** + * Decodes a MachineTypeAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MachineTypeAggregatedList; + + /** + * Verifies a MachineTypeAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineTypeAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MachineTypeAggregatedList; + + /** + * Creates a plain object from a MachineTypeAggregatedList message. Also converts values to other types if specified. + * @param message MachineTypeAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MachineTypeAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineTypeAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MachineTypeList. */ + interface IMachineTypeList { + + /** MachineTypeList id */ + id?: (string|null); + + /** MachineTypeList items */ + items?: (google.cloud.compute.v1.IMachineType[]|null); + + /** MachineTypeList kind */ + kind?: (string|null); + + /** MachineTypeList nextPageToken */ + nextPageToken?: (string|null); + + /** MachineTypeList selfLink */ + selfLink?: (string|null); + + /** MachineTypeList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a MachineTypeList. */ + class MachineTypeList implements IMachineTypeList { + + /** + * Constructs a new MachineTypeList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMachineTypeList); + + /** MachineTypeList id. */ + public id?: (string|null); + + /** MachineTypeList items. */ + public items: google.cloud.compute.v1.IMachineType[]; + + /** MachineTypeList kind. */ + public kind?: (string|null); + + /** MachineTypeList nextPageToken. */ + public nextPageToken?: (string|null); + + /** MachineTypeList selfLink. */ + public selfLink?: (string|null); + + /** MachineTypeList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** MachineTypeList _id. */ + public _id?: "id"; + + /** MachineTypeList _kind. */ + public _kind?: "kind"; + + /** MachineTypeList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** MachineTypeList _selfLink. */ + public _selfLink?: "selfLink"; + + /** MachineTypeList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new MachineTypeList instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineTypeList instance + */ + public static create(properties?: google.cloud.compute.v1.IMachineTypeList): google.cloud.compute.v1.MachineTypeList; + + /** + * Encodes the specified MachineTypeList message. Does not implicitly {@link google.cloud.compute.v1.MachineTypeList.verify|verify} messages. + * @param message MachineTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMachineTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineTypeList.verify|verify} messages. + * @param message MachineTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMachineTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineTypeList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MachineTypeList; + + /** + * Decodes a MachineTypeList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MachineTypeList; + + /** + * Verifies a MachineTypeList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineTypeList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineTypeList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MachineTypeList; + + /** + * Creates a plain object from a MachineTypeList message. Also converts values to other types if specified. + * @param message MachineTypeList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MachineTypeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineTypeList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ManagedInstanceInstanceHealth. */ + interface IManagedInstanceInstanceHealth { + + /** ManagedInstanceInstanceHealth detailedHealthState */ + detailedHealthState?: (google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState|keyof typeof google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState|null); + + /** ManagedInstanceInstanceHealth healthCheck */ + healthCheck?: (string|null); + } + + /** Represents a ManagedInstanceInstanceHealth. */ + class ManagedInstanceInstanceHealth implements IManagedInstanceInstanceHealth { + + /** + * Constructs a new ManagedInstanceInstanceHealth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IManagedInstanceInstanceHealth); + + /** ManagedInstanceInstanceHealth detailedHealthState. */ + public detailedHealthState?: (google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState|keyof typeof google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState|null); + + /** ManagedInstanceInstanceHealth healthCheck. */ + public healthCheck?: (string|null); + + /** ManagedInstanceInstanceHealth _detailedHealthState. */ + public _detailedHealthState?: "detailedHealthState"; + + /** ManagedInstanceInstanceHealth _healthCheck. */ + public _healthCheck?: "healthCheck"; + + /** + * Creates a new ManagedInstanceInstanceHealth instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedInstanceInstanceHealth instance + */ + public static create(properties?: google.cloud.compute.v1.IManagedInstanceInstanceHealth): google.cloud.compute.v1.ManagedInstanceInstanceHealth; + + /** + * Encodes the specified ManagedInstanceInstanceHealth message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceInstanceHealth.verify|verify} messages. + * @param message ManagedInstanceInstanceHealth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IManagedInstanceInstanceHealth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedInstanceInstanceHealth message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceInstanceHealth.verify|verify} messages. + * @param message ManagedInstanceInstanceHealth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IManagedInstanceInstanceHealth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedInstanceInstanceHealth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedInstanceInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ManagedInstanceInstanceHealth; + + /** + * Decodes a ManagedInstanceInstanceHealth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedInstanceInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ManagedInstanceInstanceHealth; + + /** + * Verifies a ManagedInstanceInstanceHealth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedInstanceInstanceHealth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedInstanceInstanceHealth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ManagedInstanceInstanceHealth; + + /** + * Creates a plain object from a ManagedInstanceInstanceHealth message. Also converts values to other types if specified. + * @param message ManagedInstanceInstanceHealth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ManagedInstanceInstanceHealth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedInstanceInstanceHealth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ManagedInstanceInstanceHealth { + + /** DetailedHealthState enum. */ + enum DetailedHealthState { + UNDEFINED_DETAILED_HEALTH_STATE = 0, + DRAINING = 480455402, + HEALTHY = 439801213, + TIMEOUT = 477813057, + UNHEALTHY = 462118084, + UNKNOWN = 433141802 + } + } + + /** Properties of a ManagedInstanceLastAttempt. */ + interface IManagedInstanceLastAttempt { + + /** ManagedInstanceLastAttempt errors */ + errors?: (google.cloud.compute.v1.IErrors|null); + } + + /** Represents a ManagedInstanceLastAttempt. */ + class ManagedInstanceLastAttempt implements IManagedInstanceLastAttempt { + + /** + * Constructs a new ManagedInstanceLastAttempt. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IManagedInstanceLastAttempt); + + /** ManagedInstanceLastAttempt errors. */ + public errors?: (google.cloud.compute.v1.IErrors|null); + + /** ManagedInstanceLastAttempt _errors. */ + public _errors?: "errors"; + + /** + * Creates a new ManagedInstanceLastAttempt instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedInstanceLastAttempt instance + */ + public static create(properties?: google.cloud.compute.v1.IManagedInstanceLastAttempt): google.cloud.compute.v1.ManagedInstanceLastAttempt; + + /** + * Encodes the specified ManagedInstanceLastAttempt message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceLastAttempt.verify|verify} messages. + * @param message ManagedInstanceLastAttempt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IManagedInstanceLastAttempt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedInstanceLastAttempt message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceLastAttempt.verify|verify} messages. + * @param message ManagedInstanceLastAttempt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IManagedInstanceLastAttempt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedInstanceLastAttempt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedInstanceLastAttempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ManagedInstanceLastAttempt; + + /** + * Decodes a ManagedInstanceLastAttempt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedInstanceLastAttempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ManagedInstanceLastAttempt; + + /** + * Verifies a ManagedInstanceLastAttempt message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedInstanceLastAttempt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedInstanceLastAttempt + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ManagedInstanceLastAttempt; + + /** + * Creates a plain object from a ManagedInstanceLastAttempt message. Also converts values to other types if specified. + * @param message ManagedInstanceLastAttempt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ManagedInstanceLastAttempt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedInstanceLastAttempt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PreservedState. */ + interface IPreservedState { + + /** PreservedState disks */ + disks?: ({ [k: string]: google.cloud.compute.v1.IPreservedStatePreservedDisk }|null); + + /** PreservedState metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a PreservedState. */ + class PreservedState implements IPreservedState { + + /** + * Constructs a new PreservedState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPreservedState); + + /** PreservedState disks. */ + public disks: { [k: string]: google.cloud.compute.v1.IPreservedStatePreservedDisk }; + + /** PreservedState metadata. */ + public metadata: { [k: string]: string }; + + /** + * Creates a new PreservedState instance using the specified properties. + * @param [properties] Properties to set + * @returns PreservedState instance + */ + public static create(properties?: google.cloud.compute.v1.IPreservedState): google.cloud.compute.v1.PreservedState; + + /** + * Encodes the specified PreservedState message. Does not implicitly {@link google.cloud.compute.v1.PreservedState.verify|verify} messages. + * @param message PreservedState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPreservedState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreservedState message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreservedState.verify|verify} messages. + * @param message PreservedState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPreservedState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreservedState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PreservedState; + + /** + * Decodes a PreservedState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PreservedState; + + /** + * Verifies a PreservedState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreservedState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreservedState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PreservedState; + + /** + * Creates a plain object from a PreservedState message. Also converts values to other types if specified. + * @param message PreservedState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PreservedState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreservedState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Errors. */ + interface IErrors { + + /** Errors code */ + code?: (string|null); + + /** Errors location */ + location?: (string|null); + + /** Errors message */ + message?: (string|null); + } + + /** Represents an Errors. */ + class Errors implements IErrors { + + /** + * Constructs a new Errors. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IErrors); + + /** Errors code. */ + public code?: (string|null); + + /** Errors location. */ + public location?: (string|null); + + /** Errors message. */ + public message?: (string|null); + + /** Errors _code. */ + public _code?: "code"; + + /** Errors _location. */ + public _location?: "location"; + + /** Errors _message. */ + public _message?: "message"; + + /** + * Creates a new Errors instance using the specified properties. + * @param [properties] Properties to set + * @returns Errors instance + */ + public static create(properties?: google.cloud.compute.v1.IErrors): google.cloud.compute.v1.Errors; + + /** + * Encodes the specified Errors message. Does not implicitly {@link google.cloud.compute.v1.Errors.verify|verify} messages. + * @param message Errors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IErrors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Errors message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Errors.verify|verify} messages. + * @param message Errors message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IErrors, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Errors message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Errors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Errors; + + /** + * Decodes an Errors message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Errors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Errors; + + /** + * Verifies an Errors message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Errors message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Errors + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Errors; + + /** + * Creates a plain object from an Errors message. Also converts values to other types if specified. + * @param message Errors + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Errors, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Errors to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Items. */ + interface IItems { + + /** Items key */ + key?: (string|null); + + /** Items value */ + value?: (string|null); + } + + /** Represents an Items. */ + class Items implements IItems { + + /** + * Constructs a new Items. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IItems); + + /** Items key. */ + public key?: (string|null); + + /** Items value. */ + public value?: (string|null); + + /** Items _key. */ + public _key?: "key"; + + /** Items _value. */ + public _value?: "value"; + + /** + * Creates a new Items instance using the specified properties. + * @param [properties] Properties to set + * @returns Items instance + */ + public static create(properties?: google.cloud.compute.v1.IItems): google.cloud.compute.v1.Items; + + /** + * Encodes the specified Items message. Does not implicitly {@link google.cloud.compute.v1.Items.verify|verify} messages. + * @param message Items message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IItems, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Items message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Items.verify|verify} messages. + * @param message Items message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IItems, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Items message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Items + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Items; + + /** + * Decodes an Items message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Items + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Items; + + /** + * Verifies an Items message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Items message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Items + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Items; + + /** + * Creates a plain object from an Items message. Also converts values to other types if specified. + * @param message Items + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Items, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Items to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MetadataFilterLabelMatch. */ + interface IMetadataFilterLabelMatch { + + /** MetadataFilterLabelMatch name */ + name?: (string|null); + + /** MetadataFilterLabelMatch value */ + value?: (string|null); + } + + /** Represents a MetadataFilterLabelMatch. */ + class MetadataFilterLabelMatch implements IMetadataFilterLabelMatch { + + /** + * Constructs a new MetadataFilterLabelMatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMetadataFilterLabelMatch); + + /** MetadataFilterLabelMatch name. */ + public name?: (string|null); + + /** MetadataFilterLabelMatch value. */ + public value?: (string|null); + + /** MetadataFilterLabelMatch _name. */ + public _name?: "name"; + + /** MetadataFilterLabelMatch _value. */ + public _value?: "value"; + + /** + * Creates a new MetadataFilterLabelMatch instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataFilterLabelMatch instance + */ + public static create(properties?: google.cloud.compute.v1.IMetadataFilterLabelMatch): google.cloud.compute.v1.MetadataFilterLabelMatch; + + /** + * Encodes the specified MetadataFilterLabelMatch message. Does not implicitly {@link google.cloud.compute.v1.MetadataFilterLabelMatch.verify|verify} messages. + * @param message MetadataFilterLabelMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMetadataFilterLabelMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataFilterLabelMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MetadataFilterLabelMatch.verify|verify} messages. + * @param message MetadataFilterLabelMatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMetadataFilterLabelMatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataFilterLabelMatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataFilterLabelMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MetadataFilterLabelMatch; + + /** + * Decodes a MetadataFilterLabelMatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataFilterLabelMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MetadataFilterLabelMatch; + + /** + * Verifies a MetadataFilterLabelMatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataFilterLabelMatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataFilterLabelMatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MetadataFilterLabelMatch; + + /** + * Creates a plain object from a MetadataFilterLabelMatch message. Also converts values to other types if specified. + * @param message MetadataFilterLabelMatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MetadataFilterLabelMatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataFilterLabelMatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkPeering. */ + interface INetworkPeering { + + /** NetworkPeering autoCreateRoutes */ + autoCreateRoutes?: (boolean|null); + + /** NetworkPeering exchangeSubnetRoutes */ + exchangeSubnetRoutes?: (boolean|null); + + /** NetworkPeering exportCustomRoutes */ + exportCustomRoutes?: (boolean|null); + + /** NetworkPeering exportSubnetRoutesWithPublicIp */ + exportSubnetRoutesWithPublicIp?: (boolean|null); + + /** NetworkPeering importCustomRoutes */ + importCustomRoutes?: (boolean|null); + + /** NetworkPeering importSubnetRoutesWithPublicIp */ + importSubnetRoutesWithPublicIp?: (boolean|null); + + /** NetworkPeering name */ + name?: (string|null); + + /** NetworkPeering network */ + network?: (string|null); + + /** NetworkPeering peerMtu */ + peerMtu?: (number|null); + + /** NetworkPeering state */ + state?: (google.cloud.compute.v1.NetworkPeering.State|keyof typeof google.cloud.compute.v1.NetworkPeering.State|null); + + /** NetworkPeering stateDetails */ + stateDetails?: (string|null); + } + + /** Represents a NetworkPeering. */ + class NetworkPeering implements INetworkPeering { + + /** + * Constructs a new NetworkPeering. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkPeering); + + /** NetworkPeering autoCreateRoutes. */ + public autoCreateRoutes?: (boolean|null); + + /** NetworkPeering exchangeSubnetRoutes. */ + public exchangeSubnetRoutes?: (boolean|null); + + /** NetworkPeering exportCustomRoutes. */ + public exportCustomRoutes?: (boolean|null); + + /** NetworkPeering exportSubnetRoutesWithPublicIp. */ + public exportSubnetRoutesWithPublicIp?: (boolean|null); + + /** NetworkPeering importCustomRoutes. */ + public importCustomRoutes?: (boolean|null); + + /** NetworkPeering importSubnetRoutesWithPublicIp. */ + public importSubnetRoutesWithPublicIp?: (boolean|null); + + /** NetworkPeering name. */ + public name?: (string|null); + + /** NetworkPeering network. */ + public network?: (string|null); + + /** NetworkPeering peerMtu. */ + public peerMtu?: (number|null); + + /** NetworkPeering state. */ + public state?: (google.cloud.compute.v1.NetworkPeering.State|keyof typeof google.cloud.compute.v1.NetworkPeering.State|null); + + /** NetworkPeering stateDetails. */ + public stateDetails?: (string|null); + + /** NetworkPeering _autoCreateRoutes. */ + public _autoCreateRoutes?: "autoCreateRoutes"; + + /** NetworkPeering _exchangeSubnetRoutes. */ + public _exchangeSubnetRoutes?: "exchangeSubnetRoutes"; + + /** NetworkPeering _exportCustomRoutes. */ + public _exportCustomRoutes?: "exportCustomRoutes"; + + /** NetworkPeering _exportSubnetRoutesWithPublicIp. */ + public _exportSubnetRoutesWithPublicIp?: "exportSubnetRoutesWithPublicIp"; + + /** NetworkPeering _importCustomRoutes. */ + public _importCustomRoutes?: "importCustomRoutes"; + + /** NetworkPeering _importSubnetRoutesWithPublicIp. */ + public _importSubnetRoutesWithPublicIp?: "importSubnetRoutesWithPublicIp"; + + /** NetworkPeering _name. */ + public _name?: "name"; + + /** NetworkPeering _network. */ + public _network?: "network"; + + /** NetworkPeering _peerMtu. */ + public _peerMtu?: "peerMtu"; + + /** NetworkPeering _state. */ + public _state?: "state"; + + /** NetworkPeering _stateDetails. */ + public _stateDetails?: "stateDetails"; + + /** + * Creates a new NetworkPeering instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkPeering instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkPeering): google.cloud.compute.v1.NetworkPeering; + + /** + * Encodes the specified NetworkPeering message. Does not implicitly {@link google.cloud.compute.v1.NetworkPeering.verify|verify} messages. + * @param message NetworkPeering message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkPeering, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkPeering message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkPeering.verify|verify} messages. + * @param message NetworkPeering message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkPeering, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkPeering message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkPeering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkPeering; + + /** + * Decodes a NetworkPeering message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkPeering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkPeering; + + /** + * Verifies a NetworkPeering message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkPeering message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkPeering + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkPeering; + + /** + * Creates a plain object from a NetworkPeering message. Also converts values to other types if specified. + * @param message NetworkPeering + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkPeering, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkPeering to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkPeering { + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + ACTIVE = 314733318, + INACTIVE = 270421099 + } + } + + /** Properties of a NetworkRoutingConfig. */ + interface INetworkRoutingConfig { + + /** NetworkRoutingConfig routingMode */ + routingMode?: (google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode|keyof typeof google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode|null); + } + + /** Represents a NetworkRoutingConfig. */ + class NetworkRoutingConfig implements INetworkRoutingConfig { + + /** + * Constructs a new NetworkRoutingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkRoutingConfig); + + /** NetworkRoutingConfig routingMode. */ + public routingMode?: (google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode|keyof typeof google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode|null); + + /** NetworkRoutingConfig _routingMode. */ + public _routingMode?: "routingMode"; + + /** + * Creates a new NetworkRoutingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkRoutingConfig instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkRoutingConfig): google.cloud.compute.v1.NetworkRoutingConfig; + + /** + * Encodes the specified NetworkRoutingConfig message. Does not implicitly {@link google.cloud.compute.v1.NetworkRoutingConfig.verify|verify} messages. + * @param message NetworkRoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkRoutingConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkRoutingConfig.verify|verify} messages. + * @param message NetworkRoutingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkRoutingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkRoutingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkRoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkRoutingConfig; + + /** + * Decodes a NetworkRoutingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkRoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkRoutingConfig; + + /** + * Verifies a NetworkRoutingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkRoutingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkRoutingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkRoutingConfig; + + /** + * Creates a plain object from a NetworkRoutingConfig message. Also converts values to other types if specified. + * @param message NetworkRoutingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkRoutingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkRoutingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkRoutingConfig { + + /** RoutingMode enum. */ + enum RoutingMode { + UNDEFINED_ROUTING_MODE = 0, + GLOBAL = 494663587, + REGIONAL = 92288543 + } + } + + /** Properties of a Network. */ + interface INetwork { + + /** Network IPv4Range */ + IPv4Range?: (string|null); + + /** Network autoCreateSubnetworks */ + autoCreateSubnetworks?: (boolean|null); + + /** Network creationTimestamp */ + creationTimestamp?: (string|null); + + /** Network description */ + description?: (string|null); + + /** Network gatewayIPv4 */ + gatewayIPv4?: (string|null); + + /** Network id */ + id?: (number|Long|string|null); + + /** Network kind */ + kind?: (string|null); + + /** Network mtu */ + mtu?: (number|null); + + /** Network name */ + name?: (string|null); + + /** Network peerings */ + peerings?: (google.cloud.compute.v1.INetworkPeering[]|null); + + /** Network routingConfig */ + routingConfig?: (google.cloud.compute.v1.INetworkRoutingConfig|null); + + /** Network selfLink */ + selfLink?: (string|null); + + /** Network subnetworks */ + subnetworks?: (string[]|null); + } + + /** Represents a Network. */ + class Network implements INetwork { + + /** + * Constructs a new Network. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetwork); + + /** Network IPv4Range. */ + public IPv4Range?: (string|null); + + /** Network autoCreateSubnetworks. */ + public autoCreateSubnetworks?: (boolean|null); + + /** Network creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Network description. */ + public description?: (string|null); + + /** Network gatewayIPv4. */ + public gatewayIPv4?: (string|null); + + /** Network id. */ + public id?: (number|Long|string|null); + + /** Network kind. */ + public kind?: (string|null); + + /** Network mtu. */ + public mtu?: (number|null); + + /** Network name. */ + public name?: (string|null); + + /** Network peerings. */ + public peerings: google.cloud.compute.v1.INetworkPeering[]; + + /** Network routingConfig. */ + public routingConfig?: (google.cloud.compute.v1.INetworkRoutingConfig|null); + + /** Network selfLink. */ + public selfLink?: (string|null); + + /** Network subnetworks. */ + public subnetworks: string[]; + + /** Network _IPv4Range. */ + public _IPv4Range?: "IPv4Range"; + + /** Network _autoCreateSubnetworks. */ + public _autoCreateSubnetworks?: "autoCreateSubnetworks"; + + /** Network _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Network _description. */ + public _description?: "description"; + + /** Network _gatewayIPv4. */ + public _gatewayIPv4?: "gatewayIPv4"; + + /** Network _id. */ + public _id?: "id"; + + /** Network _kind. */ + public _kind?: "kind"; + + /** Network _mtu. */ + public _mtu?: "mtu"; + + /** Network _name. */ + public _name?: "name"; + + /** Network _routingConfig. */ + public _routingConfig?: "routingConfig"; + + /** Network _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new Network instance using the specified properties. + * @param [properties] Properties to set + * @returns Network instance + */ + public static create(properties?: google.cloud.compute.v1.INetwork): google.cloud.compute.v1.Network; + + /** + * Encodes the specified Network message. Does not implicitly {@link google.cloud.compute.v1.Network.verify|verify} messages. + * @param message Network message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Network.verify|verify} messages. + * @param message Network message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Network message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Network; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Network; + + /** + * Verifies a Network message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Network + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Network; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @param message Network + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Network, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Network to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupAppEngine. */ + interface INetworkEndpointGroupAppEngine { + + /** NetworkEndpointGroupAppEngine service */ + service?: (string|null); + + /** NetworkEndpointGroupAppEngine urlMask */ + urlMask?: (string|null); + + /** NetworkEndpointGroupAppEngine version */ + version?: (string|null); + } + + /** Represents a NetworkEndpointGroupAppEngine. */ + class NetworkEndpointGroupAppEngine implements INetworkEndpointGroupAppEngine { + + /** + * Constructs a new NetworkEndpointGroupAppEngine. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupAppEngine); + + /** NetworkEndpointGroupAppEngine service. */ + public service?: (string|null); + + /** NetworkEndpointGroupAppEngine urlMask. */ + public urlMask?: (string|null); + + /** NetworkEndpointGroupAppEngine version. */ + public version?: (string|null); + + /** NetworkEndpointGroupAppEngine _service. */ + public _service?: "service"; + + /** NetworkEndpointGroupAppEngine _urlMask. */ + public _urlMask?: "urlMask"; + + /** NetworkEndpointGroupAppEngine _version. */ + public _version?: "version"; + + /** + * Creates a new NetworkEndpointGroupAppEngine instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupAppEngine instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupAppEngine): google.cloud.compute.v1.NetworkEndpointGroupAppEngine; + + /** + * Encodes the specified NetworkEndpointGroupAppEngine message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAppEngine.verify|verify} messages. + * @param message NetworkEndpointGroupAppEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupAppEngine message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAppEngine.verify|verify} messages. + * @param message NetworkEndpointGroupAppEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupAppEngine, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupAppEngine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupAppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupAppEngine; + + /** + * Decodes a NetworkEndpointGroupAppEngine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupAppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupAppEngine; + + /** + * Verifies a NetworkEndpointGroupAppEngine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupAppEngine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupAppEngine + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupAppEngine; + + /** + * Creates a plain object from a NetworkEndpointGroupAppEngine message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupAppEngine + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupAppEngine, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupAppEngine to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupCloudFunction. */ + interface INetworkEndpointGroupCloudFunction { + + /** NetworkEndpointGroupCloudFunction function */ + "function"?: (string|null); + + /** NetworkEndpointGroupCloudFunction urlMask */ + urlMask?: (string|null); + } + + /** Represents a NetworkEndpointGroupCloudFunction. */ + class NetworkEndpointGroupCloudFunction implements INetworkEndpointGroupCloudFunction { + + /** + * Constructs a new NetworkEndpointGroupCloudFunction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupCloudFunction); + + /** NetworkEndpointGroupCloudFunction function. */ + public function?: (string|null); + + /** NetworkEndpointGroupCloudFunction urlMask. */ + public urlMask?: (string|null); + + /** NetworkEndpointGroupCloudFunction _function. */ + public _function?: "Function"; + + /** NetworkEndpointGroupCloudFunction _urlMask. */ + public _urlMask?: "urlMask"; + + /** + * Creates a new NetworkEndpointGroupCloudFunction instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupCloudFunction instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupCloudFunction): google.cloud.compute.v1.NetworkEndpointGroupCloudFunction; + + /** + * Encodes the specified NetworkEndpointGroupCloudFunction message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.verify|verify} messages. + * @param message NetworkEndpointGroupCloudFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupCloudFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupCloudFunction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.verify|verify} messages. + * @param message NetworkEndpointGroupCloudFunction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupCloudFunction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupCloudFunction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupCloudFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupCloudFunction; + + /** + * Decodes a NetworkEndpointGroupCloudFunction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupCloudFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupCloudFunction; + + /** + * Verifies a NetworkEndpointGroupCloudFunction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupCloudFunction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupCloudFunction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupCloudFunction; + + /** + * Creates a plain object from a NetworkEndpointGroupCloudFunction message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupCloudFunction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupCloudFunction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupCloudFunction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupCloudRun. */ + interface INetworkEndpointGroupCloudRun { + + /** NetworkEndpointGroupCloudRun service */ + service?: (string|null); + + /** NetworkEndpointGroupCloudRun tag */ + tag?: (string|null); + + /** NetworkEndpointGroupCloudRun urlMask */ + urlMask?: (string|null); + } + + /** Represents a NetworkEndpointGroupCloudRun. */ + class NetworkEndpointGroupCloudRun implements INetworkEndpointGroupCloudRun { + + /** + * Constructs a new NetworkEndpointGroupCloudRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupCloudRun); + + /** NetworkEndpointGroupCloudRun service. */ + public service?: (string|null); + + /** NetworkEndpointGroupCloudRun tag. */ + public tag?: (string|null); + + /** NetworkEndpointGroupCloudRun urlMask. */ + public urlMask?: (string|null); + + /** NetworkEndpointGroupCloudRun _service. */ + public _service?: "service"; + + /** NetworkEndpointGroupCloudRun _tag. */ + public _tag?: "tag"; + + /** NetworkEndpointGroupCloudRun _urlMask. */ + public _urlMask?: "urlMask"; + + /** + * Creates a new NetworkEndpointGroupCloudRun instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupCloudRun instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupCloudRun): google.cloud.compute.v1.NetworkEndpointGroupCloudRun; + + /** + * Encodes the specified NetworkEndpointGroupCloudRun message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudRun.verify|verify} messages. + * @param message NetworkEndpointGroupCloudRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupCloudRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupCloudRun message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudRun.verify|verify} messages. + * @param message NetworkEndpointGroupCloudRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupCloudRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupCloudRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupCloudRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupCloudRun; + + /** + * Decodes a NetworkEndpointGroupCloudRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupCloudRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupCloudRun; + + /** + * Verifies a NetworkEndpointGroupCloudRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupCloudRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupCloudRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupCloudRun; + + /** + * Creates a plain object from a NetworkEndpointGroupCloudRun message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupCloudRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupCloudRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupCloudRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroup. */ + interface INetworkEndpointGroup { + + /** NetworkEndpointGroup annotations */ + annotations?: ({ [k: string]: string }|null); + + /** NetworkEndpointGroup appEngine */ + appEngine?: (google.cloud.compute.v1.INetworkEndpointGroupAppEngine|null); + + /** NetworkEndpointGroup cloudFunction */ + cloudFunction?: (google.cloud.compute.v1.INetworkEndpointGroupCloudFunction|null); + + /** NetworkEndpointGroup cloudRun */ + cloudRun?: (google.cloud.compute.v1.INetworkEndpointGroupCloudRun|null); + + /** NetworkEndpointGroup creationTimestamp */ + creationTimestamp?: (string|null); + + /** NetworkEndpointGroup defaultPort */ + defaultPort?: (number|null); + + /** NetworkEndpointGroup description */ + description?: (string|null); + + /** NetworkEndpointGroup id */ + id?: (number|Long|string|null); + + /** NetworkEndpointGroup kind */ + kind?: (string|null); + + /** NetworkEndpointGroup name */ + name?: (string|null); + + /** NetworkEndpointGroup network */ + network?: (string|null); + + /** NetworkEndpointGroup networkEndpointType */ + networkEndpointType?: (google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType|keyof typeof google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType|null); + + /** NetworkEndpointGroup region */ + region?: (string|null); + + /** NetworkEndpointGroup selfLink */ + selfLink?: (string|null); + + /** NetworkEndpointGroup size */ + size?: (number|null); + + /** NetworkEndpointGroup subnetwork */ + subnetwork?: (string|null); + + /** NetworkEndpointGroup zone */ + zone?: (string|null); + } + + /** Represents a NetworkEndpointGroup. */ + class NetworkEndpointGroup implements INetworkEndpointGroup { + + /** + * Constructs a new NetworkEndpointGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroup); + + /** NetworkEndpointGroup annotations. */ + public annotations: { [k: string]: string }; + + /** NetworkEndpointGroup appEngine. */ + public appEngine?: (google.cloud.compute.v1.INetworkEndpointGroupAppEngine|null); + + /** NetworkEndpointGroup cloudFunction. */ + public cloudFunction?: (google.cloud.compute.v1.INetworkEndpointGroupCloudFunction|null); + + /** NetworkEndpointGroup cloudRun. */ + public cloudRun?: (google.cloud.compute.v1.INetworkEndpointGroupCloudRun|null); + + /** NetworkEndpointGroup creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** NetworkEndpointGroup defaultPort. */ + public defaultPort?: (number|null); + + /** NetworkEndpointGroup description. */ + public description?: (string|null); + + /** NetworkEndpointGroup id. */ + public id?: (number|Long|string|null); + + /** NetworkEndpointGroup kind. */ + public kind?: (string|null); + + /** NetworkEndpointGroup name. */ + public name?: (string|null); + + /** NetworkEndpointGroup network. */ + public network?: (string|null); + + /** NetworkEndpointGroup networkEndpointType. */ + public networkEndpointType?: (google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType|keyof typeof google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType|null); + + /** NetworkEndpointGroup region. */ + public region?: (string|null); + + /** NetworkEndpointGroup selfLink. */ + public selfLink?: (string|null); + + /** NetworkEndpointGroup size. */ + public size?: (number|null); + + /** NetworkEndpointGroup subnetwork. */ + public subnetwork?: (string|null); + + /** NetworkEndpointGroup zone. */ + public zone?: (string|null); + + /** NetworkEndpointGroup _appEngine. */ + public _appEngine?: "appEngine"; + + /** NetworkEndpointGroup _cloudFunction. */ + public _cloudFunction?: "cloudFunction"; + + /** NetworkEndpointGroup _cloudRun. */ + public _cloudRun?: "cloudRun"; + + /** NetworkEndpointGroup _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** NetworkEndpointGroup _defaultPort. */ + public _defaultPort?: "defaultPort"; + + /** NetworkEndpointGroup _description. */ + public _description?: "description"; + + /** NetworkEndpointGroup _id. */ + public _id?: "id"; + + /** NetworkEndpointGroup _kind. */ + public _kind?: "kind"; + + /** NetworkEndpointGroup _name. */ + public _name?: "name"; + + /** NetworkEndpointGroup _network. */ + public _network?: "network"; + + /** NetworkEndpointGroup _networkEndpointType. */ + public _networkEndpointType?: "networkEndpointType"; + + /** NetworkEndpointGroup _region. */ + public _region?: "region"; + + /** NetworkEndpointGroup _selfLink. */ + public _selfLink?: "selfLink"; + + /** NetworkEndpointGroup _size. */ + public _size?: "size"; + + /** NetworkEndpointGroup _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** NetworkEndpointGroup _zone. */ + public _zone?: "zone"; + + /** + * Creates a new NetworkEndpointGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroup instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroup): google.cloud.compute.v1.NetworkEndpointGroup; + + /** + * Encodes the specified NetworkEndpointGroup message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroup.verify|verify} messages. + * @param message NetworkEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroup.verify|verify} messages. + * @param message NetworkEndpointGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroup; + + /** + * Decodes a NetworkEndpointGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroup; + + /** + * Verifies a NetworkEndpointGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroup; + + /** + * Creates a plain object from a NetworkEndpointGroup message. Also converts values to other types if specified. + * @param message NetworkEndpointGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkEndpointGroup { + + /** NetworkEndpointType enum. */ + enum NetworkEndpointType { + UNDEFINED_NETWORK_ENDPOINT_TYPE = 0, + GCE_VM_IP = 401880793, + GCE_VM_IP_PORT = 501838375, + INTERNET_FQDN_PORT = 404154477, + INTERNET_IP_PORT = 477719963, + NON_GCP_PRIVATE_IP_PORT = 336447968, + SERVERLESS = 270492508 + } + } + + /** Properties of a NetworkEndpointGroupsScopedList. */ + interface INetworkEndpointGroupsScopedList { + + /** NetworkEndpointGroupsScopedList networkEndpointGroups */ + networkEndpointGroups?: (google.cloud.compute.v1.INetworkEndpointGroup[]|null); + + /** NetworkEndpointGroupsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NetworkEndpointGroupsScopedList. */ + class NetworkEndpointGroupsScopedList implements INetworkEndpointGroupsScopedList { + + /** + * Constructs a new NetworkEndpointGroupsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupsScopedList); + + /** NetworkEndpointGroupsScopedList networkEndpointGroups. */ + public networkEndpointGroups: google.cloud.compute.v1.INetworkEndpointGroup[]; + + /** NetworkEndpointGroupsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NetworkEndpointGroupsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NetworkEndpointGroupsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupsScopedList): google.cloud.compute.v1.NetworkEndpointGroupsScopedList; + + /** + * Encodes the specified NetworkEndpointGroupsScopedList message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsScopedList.verify|verify} messages. + * @param message NetworkEndpointGroupsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsScopedList.verify|verify} messages. + * @param message NetworkEndpointGroupsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupsScopedList; + + /** + * Decodes a NetworkEndpointGroupsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupsScopedList; + + /** + * Verifies a NetworkEndpointGroupsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupsScopedList; + + /** + * Creates a plain object from a NetworkEndpointGroupsScopedList message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupAggregatedList. */ + interface INetworkEndpointGroupAggregatedList { + + /** NetworkEndpointGroupAggregatedList id */ + id?: (string|null); + + /** NetworkEndpointGroupAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.INetworkEndpointGroupsScopedList }|null); + + /** NetworkEndpointGroupAggregatedList kind */ + kind?: (string|null); + + /** NetworkEndpointGroupAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** NetworkEndpointGroupAggregatedList selfLink */ + selfLink?: (string|null); + + /** NetworkEndpointGroupAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** NetworkEndpointGroupAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NetworkEndpointGroupAggregatedList. */ + class NetworkEndpointGroupAggregatedList implements INetworkEndpointGroupAggregatedList { + + /** + * Constructs a new NetworkEndpointGroupAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupAggregatedList); + + /** NetworkEndpointGroupAggregatedList id. */ + public id?: (string|null); + + /** NetworkEndpointGroupAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.INetworkEndpointGroupsScopedList }; + + /** NetworkEndpointGroupAggregatedList kind. */ + public kind?: (string|null); + + /** NetworkEndpointGroupAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NetworkEndpointGroupAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** NetworkEndpointGroupAggregatedList unreachables. */ + public unreachables: string[]; + + /** NetworkEndpointGroupAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NetworkEndpointGroupAggregatedList _id. */ + public _id?: "id"; + + /** NetworkEndpointGroupAggregatedList _kind. */ + public _kind?: "kind"; + + /** NetworkEndpointGroupAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NetworkEndpointGroupAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NetworkEndpointGroupAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NetworkEndpointGroupAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupAggregatedList): google.cloud.compute.v1.NetworkEndpointGroupAggregatedList; + + /** + * Encodes the specified NetworkEndpointGroupAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.verify|verify} messages. + * @param message NetworkEndpointGroupAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.verify|verify} messages. + * @param message NetworkEndpointGroupAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupAggregatedList; + + /** + * Decodes a NetworkEndpointGroupAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupAggregatedList; + + /** + * Verifies a NetworkEndpointGroupAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupAggregatedList; + + /** + * Creates a plain object from a NetworkEndpointGroupAggregatedList message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupList. */ + interface INetworkEndpointGroupList { + + /** NetworkEndpointGroupList id */ + id?: (string|null); + + /** NetworkEndpointGroupList items */ + items?: (google.cloud.compute.v1.INetworkEndpointGroup[]|null); + + /** NetworkEndpointGroupList kind */ + kind?: (string|null); + + /** NetworkEndpointGroupList nextPageToken */ + nextPageToken?: (string|null); + + /** NetworkEndpointGroupList selfLink */ + selfLink?: (string|null); + + /** NetworkEndpointGroupList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NetworkEndpointGroupList. */ + class NetworkEndpointGroupList implements INetworkEndpointGroupList { + + /** + * Constructs a new NetworkEndpointGroupList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupList); + + /** NetworkEndpointGroupList id. */ + public id?: (string|null); + + /** NetworkEndpointGroupList items. */ + public items: google.cloud.compute.v1.INetworkEndpointGroup[]; + + /** NetworkEndpointGroupList kind. */ + public kind?: (string|null); + + /** NetworkEndpointGroupList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NetworkEndpointGroupList selfLink. */ + public selfLink?: (string|null); + + /** NetworkEndpointGroupList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NetworkEndpointGroupList _id. */ + public _id?: "id"; + + /** NetworkEndpointGroupList _kind. */ + public _kind?: "kind"; + + /** NetworkEndpointGroupList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NetworkEndpointGroupList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NetworkEndpointGroupList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NetworkEndpointGroupList instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupList instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupList): google.cloud.compute.v1.NetworkEndpointGroupList; + + /** + * Encodes the specified NetworkEndpointGroupList message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupList.verify|verify} messages. + * @param message NetworkEndpointGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupList.verify|verify} messages. + * @param message NetworkEndpointGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupList; + + /** + * Decodes a NetworkEndpointGroupList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupList; + + /** + * Verifies a NetworkEndpointGroupList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupList; + + /** + * Creates a plain object from a NetworkEndpointGroupList message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupsAttachEndpointsRequest. */ + interface INetworkEndpointGroupsAttachEndpointsRequest { + + /** NetworkEndpointGroupsAttachEndpointsRequest networkEndpoints */ + networkEndpoints?: (google.cloud.compute.v1.INetworkEndpoint[]|null); + } + + /** Represents a NetworkEndpointGroupsAttachEndpointsRequest. */ + class NetworkEndpointGroupsAttachEndpointsRequest implements INetworkEndpointGroupsAttachEndpointsRequest { + + /** + * Constructs a new NetworkEndpointGroupsAttachEndpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest); + + /** NetworkEndpointGroupsAttachEndpointsRequest networkEndpoints. */ + public networkEndpoints: google.cloud.compute.v1.INetworkEndpoint[]; + + /** + * Creates a new NetworkEndpointGroupsAttachEndpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupsAttachEndpointsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest): google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Encodes the specified NetworkEndpointGroupsAttachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @param message NetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupsAttachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @param message NetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Decodes a NetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Verifies a NetworkEndpointGroupsAttachEndpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupsAttachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupsAttachEndpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest; + + /** + * Creates a plain object from a NetworkEndpointGroupsAttachEndpointsRequest message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupsAttachEndpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupsAttachEndpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupsDetachEndpointsRequest. */ + interface INetworkEndpointGroupsDetachEndpointsRequest { + + /** NetworkEndpointGroupsDetachEndpointsRequest networkEndpoints */ + networkEndpoints?: (google.cloud.compute.v1.INetworkEndpoint[]|null); + } + + /** Represents a NetworkEndpointGroupsDetachEndpointsRequest. */ + class NetworkEndpointGroupsDetachEndpointsRequest implements INetworkEndpointGroupsDetachEndpointsRequest { + + /** + * Constructs a new NetworkEndpointGroupsDetachEndpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest); + + /** NetworkEndpointGroupsDetachEndpointsRequest networkEndpoints. */ + public networkEndpoints: google.cloud.compute.v1.INetworkEndpoint[]; + + /** + * Creates a new NetworkEndpointGroupsDetachEndpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupsDetachEndpointsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest): google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Encodes the specified NetworkEndpointGroupsDetachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @param message NetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupsDetachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @param message NetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Decodes a NetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Verifies a NetworkEndpointGroupsDetachEndpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupsDetachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupsDetachEndpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest; + + /** + * Creates a plain object from a NetworkEndpointGroupsDetachEndpointsRequest message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupsDetachEndpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupsDetachEndpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupsListEndpointsRequest. */ + interface INetworkEndpointGroupsListEndpointsRequest { + + /** NetworkEndpointGroupsListEndpointsRequest healthStatus */ + healthStatus?: (google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus|keyof typeof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus|null); + } + + /** Represents a NetworkEndpointGroupsListEndpointsRequest. */ + class NetworkEndpointGroupsListEndpointsRequest implements INetworkEndpointGroupsListEndpointsRequest { + + /** + * Constructs a new NetworkEndpointGroupsListEndpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest); + + /** NetworkEndpointGroupsListEndpointsRequest healthStatus. */ + public healthStatus?: (google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus|keyof typeof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus|null); + + /** NetworkEndpointGroupsListEndpointsRequest _healthStatus. */ + public _healthStatus?: "healthStatus"; + + /** + * Creates a new NetworkEndpointGroupsListEndpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupsListEndpointsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest): google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest; + + /** + * Encodes the specified NetworkEndpointGroupsListEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.verify|verify} messages. + * @param message NetworkEndpointGroupsListEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupsListEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.verify|verify} messages. + * @param message NetworkEndpointGroupsListEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupsListEndpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupsListEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest; + + /** + * Decodes a NetworkEndpointGroupsListEndpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupsListEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest; + + /** + * Verifies a NetworkEndpointGroupsListEndpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupsListEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupsListEndpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest; + + /** + * Creates a plain object from a NetworkEndpointGroupsListEndpointsRequest message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupsListEndpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupsListEndpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkEndpointGroupsListEndpointsRequest { + + /** HealthStatus enum. */ + enum HealthStatus { + UNDEFINED_HEALTH_STATUS = 0, + SHOW = 2544381, + SKIP = 2547071 + } + } + + /** Properties of a NetworkEndpointWithHealthStatus. */ + interface INetworkEndpointWithHealthStatus { + + /** NetworkEndpointWithHealthStatus healths */ + healths?: (google.cloud.compute.v1.IHealthStatusForNetworkEndpoint[]|null); + + /** NetworkEndpointWithHealthStatus networkEndpoint */ + networkEndpoint?: (google.cloud.compute.v1.INetworkEndpoint|null); + } + + /** Represents a NetworkEndpointWithHealthStatus. */ + class NetworkEndpointWithHealthStatus implements INetworkEndpointWithHealthStatus { + + /** + * Constructs a new NetworkEndpointWithHealthStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointWithHealthStatus); + + /** NetworkEndpointWithHealthStatus healths. */ + public healths: google.cloud.compute.v1.IHealthStatusForNetworkEndpoint[]; + + /** NetworkEndpointWithHealthStatus networkEndpoint. */ + public networkEndpoint?: (google.cloud.compute.v1.INetworkEndpoint|null); + + /** NetworkEndpointWithHealthStatus _networkEndpoint. */ + public _networkEndpoint?: "networkEndpoint"; + + /** + * Creates a new NetworkEndpointWithHealthStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointWithHealthStatus instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointWithHealthStatus): google.cloud.compute.v1.NetworkEndpointWithHealthStatus; + + /** + * Encodes the specified NetworkEndpointWithHealthStatus message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus.verify|verify} messages. + * @param message NetworkEndpointWithHealthStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointWithHealthStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointWithHealthStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus.verify|verify} messages. + * @param message NetworkEndpointWithHealthStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointWithHealthStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointWithHealthStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointWithHealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointWithHealthStatus; + + /** + * Decodes a NetworkEndpointWithHealthStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointWithHealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointWithHealthStatus; + + /** + * Verifies a NetworkEndpointWithHealthStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointWithHealthStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointWithHealthStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointWithHealthStatus; + + /** + * Creates a plain object from a NetworkEndpointWithHealthStatus message. Also converts values to other types if specified. + * @param message NetworkEndpointWithHealthStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointWithHealthStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointWithHealthStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkEndpointGroupsListNetworkEndpoints. */ + interface INetworkEndpointGroupsListNetworkEndpoints { + + /** NetworkEndpointGroupsListNetworkEndpoints id */ + id?: (string|null); + + /** NetworkEndpointGroupsListNetworkEndpoints items */ + items?: (google.cloud.compute.v1.INetworkEndpointWithHealthStatus[]|null); + + /** NetworkEndpointGroupsListNetworkEndpoints kind */ + kind?: (string|null); + + /** NetworkEndpointGroupsListNetworkEndpoints nextPageToken */ + nextPageToken?: (string|null); + + /** NetworkEndpointGroupsListNetworkEndpoints warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NetworkEndpointGroupsListNetworkEndpoints. */ + class NetworkEndpointGroupsListNetworkEndpoints implements INetworkEndpointGroupsListNetworkEndpoints { + + /** + * Constructs a new NetworkEndpointGroupsListNetworkEndpoints. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints); + + /** NetworkEndpointGroupsListNetworkEndpoints id. */ + public id?: (string|null); + + /** NetworkEndpointGroupsListNetworkEndpoints items. */ + public items: google.cloud.compute.v1.INetworkEndpointWithHealthStatus[]; + + /** NetworkEndpointGroupsListNetworkEndpoints kind. */ + public kind?: (string|null); + + /** NetworkEndpointGroupsListNetworkEndpoints nextPageToken. */ + public nextPageToken?: (string|null); + + /** NetworkEndpointGroupsListNetworkEndpoints warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NetworkEndpointGroupsListNetworkEndpoints _id. */ + public _id?: "id"; + + /** NetworkEndpointGroupsListNetworkEndpoints _kind. */ + public _kind?: "kind"; + + /** NetworkEndpointGroupsListNetworkEndpoints _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NetworkEndpointGroupsListNetworkEndpoints _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NetworkEndpointGroupsListNetworkEndpoints instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkEndpointGroupsListNetworkEndpoints instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints): google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints; + + /** + * Encodes the specified NetworkEndpointGroupsListNetworkEndpoints message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints.verify|verify} messages. + * @param message NetworkEndpointGroupsListNetworkEndpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkEndpointGroupsListNetworkEndpoints message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints.verify|verify} messages. + * @param message NetworkEndpointGroupsListNetworkEndpoints message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkEndpointGroupsListNetworkEndpoints message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkEndpointGroupsListNetworkEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints; + + /** + * Decodes a NetworkEndpointGroupsListNetworkEndpoints message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkEndpointGroupsListNetworkEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints; + + /** + * Verifies a NetworkEndpointGroupsListNetworkEndpoints message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkEndpointGroupsListNetworkEndpoints message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkEndpointGroupsListNetworkEndpoints + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints; + + /** + * Creates a plain object from a NetworkEndpointGroupsListNetworkEndpoints message. Also converts values to other types if specified. + * @param message NetworkEndpointGroupsListNetworkEndpoints + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkEndpointGroupsListNetworkEndpoints to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkList. */ + interface INetworkList { + + /** NetworkList id */ + id?: (string|null); + + /** NetworkList items */ + items?: (google.cloud.compute.v1.INetwork[]|null); + + /** NetworkList kind */ + kind?: (string|null); + + /** NetworkList nextPageToken */ + nextPageToken?: (string|null); + + /** NetworkList selfLink */ + selfLink?: (string|null); + + /** NetworkList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NetworkList. */ + class NetworkList implements INetworkList { + + /** + * Constructs a new NetworkList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkList); + + /** NetworkList id. */ + public id?: (string|null); + + /** NetworkList items. */ + public items: google.cloud.compute.v1.INetwork[]; + + /** NetworkList kind. */ + public kind?: (string|null); + + /** NetworkList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NetworkList selfLink. */ + public selfLink?: (string|null); + + /** NetworkList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NetworkList _id. */ + public _id?: "id"; + + /** NetworkList _kind. */ + public _kind?: "kind"; + + /** NetworkList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NetworkList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NetworkList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NetworkList instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkList instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkList): google.cloud.compute.v1.NetworkList; + + /** + * Encodes the specified NetworkList message. Does not implicitly {@link google.cloud.compute.v1.NetworkList.verify|verify} messages. + * @param message NetworkList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkList.verify|verify} messages. + * @param message NetworkList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkList; + + /** + * Decodes a NetworkList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkList; + + /** + * Verifies a NetworkList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkList; + + /** + * Creates a plain object from a NetworkList message. Also converts values to other types if specified. + * @param message NetworkList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworksAddPeeringRequest. */ + interface INetworksAddPeeringRequest { + + /** NetworksAddPeeringRequest autoCreateRoutes */ + autoCreateRoutes?: (boolean|null); + + /** NetworksAddPeeringRequest name */ + name?: (string|null); + + /** NetworksAddPeeringRequest networkPeering */ + networkPeering?: (google.cloud.compute.v1.INetworkPeering|null); + + /** NetworksAddPeeringRequest peerNetwork */ + peerNetwork?: (string|null); + } + + /** Represents a NetworksAddPeeringRequest. */ + class NetworksAddPeeringRequest implements INetworksAddPeeringRequest { + + /** + * Constructs a new NetworksAddPeeringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworksAddPeeringRequest); + + /** NetworksAddPeeringRequest autoCreateRoutes. */ + public autoCreateRoutes?: (boolean|null); + + /** NetworksAddPeeringRequest name. */ + public name?: (string|null); + + /** NetworksAddPeeringRequest networkPeering. */ + public networkPeering?: (google.cloud.compute.v1.INetworkPeering|null); + + /** NetworksAddPeeringRequest peerNetwork. */ + public peerNetwork?: (string|null); + + /** NetworksAddPeeringRequest _autoCreateRoutes. */ + public _autoCreateRoutes?: "autoCreateRoutes"; + + /** NetworksAddPeeringRequest _name. */ + public _name?: "name"; + + /** NetworksAddPeeringRequest _networkPeering. */ + public _networkPeering?: "networkPeering"; + + /** NetworksAddPeeringRequest _peerNetwork. */ + public _peerNetwork?: "peerNetwork"; + + /** + * Creates a new NetworksAddPeeringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworksAddPeeringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INetworksAddPeeringRequest): google.cloud.compute.v1.NetworksAddPeeringRequest; + + /** + * Encodes the specified NetworksAddPeeringRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworksAddPeeringRequest.verify|verify} messages. + * @param message NetworksAddPeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworksAddPeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworksAddPeeringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksAddPeeringRequest.verify|verify} messages. + * @param message NetworksAddPeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworksAddPeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworksAddPeeringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworksAddPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworksAddPeeringRequest; + + /** + * Decodes a NetworksAddPeeringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworksAddPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworksAddPeeringRequest; + + /** + * Verifies a NetworksAddPeeringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworksAddPeeringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworksAddPeeringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworksAddPeeringRequest; + + /** + * Creates a plain object from a NetworksAddPeeringRequest message. Also converts values to other types if specified. + * @param message NetworksAddPeeringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworksAddPeeringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworksAddPeeringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy. */ + interface INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName */ + displayName?: (string|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy name */ + name?: (string|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules */ + rules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName */ + shortName?: (string|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy type */ + type?: (google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|keyof typeof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null); + } + + /** Represents a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy. */ + class NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy implements INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + + /** + * Constructs a new NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName. */ + public displayName?: (string|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy name. */ + public name?: (string|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules. */ + public rules: google.cloud.compute.v1.IFirewallPolicyRule[]; + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName. */ + public shortName?: (string|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy type. */ + public type?: (google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|keyof typeof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null); + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _displayName. */ + public _displayName?: "displayName"; + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _name. */ + public _name?: "name"; + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _shortName. */ + public _shortName?: "shortName"; + + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _type. */ + public _type?: "type"; + + /** + * Creates a new NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @param message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @param message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Verifies a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + + /** + * Creates a plain object from a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Also converts values to other types if specified. + * @param message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + HIERARCHY = 69902869, + NETWORK = 413984270, + UNSPECIFIED = 526786327 + } + } + + /** Properties of a NetworksGetEffectiveFirewallsResponse. */ + interface INetworksGetEffectiveFirewallsResponse { + + /** NetworksGetEffectiveFirewallsResponse firewallPolicys */ + firewallPolicys?: (google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy[]|null); + + /** NetworksGetEffectiveFirewallsResponse firewalls */ + firewalls?: (google.cloud.compute.v1.IFirewall[]|null); + } + + /** Represents a NetworksGetEffectiveFirewallsResponse. */ + class NetworksGetEffectiveFirewallsResponse implements INetworksGetEffectiveFirewallsResponse { + + /** + * Constructs a new NetworksGetEffectiveFirewallsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse); + + /** NetworksGetEffectiveFirewallsResponse firewallPolicys. */ + public firewallPolicys: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy[]; + + /** NetworksGetEffectiveFirewallsResponse firewalls. */ + public firewalls: google.cloud.compute.v1.IFirewall[]; + + /** + * Creates a new NetworksGetEffectiveFirewallsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworksGetEffectiveFirewallsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponse message. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.verify|verify} messages. + * @param message NetworksGetEffectiveFirewallsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.verify|verify} messages. + * @param message NetworksGetEffectiveFirewallsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworksGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworksGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse; + + /** + * Verifies a NetworksGetEffectiveFirewallsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworksGetEffectiveFirewallsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworksGetEffectiveFirewallsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse; + + /** + * Creates a plain object from a NetworksGetEffectiveFirewallsResponse message. Also converts values to other types if specified. + * @param message NetworksGetEffectiveFirewallsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworksGetEffectiveFirewallsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworksRemovePeeringRequest. */ + interface INetworksRemovePeeringRequest { + + /** NetworksRemovePeeringRequest name */ + name?: (string|null); + } + + /** Represents a NetworksRemovePeeringRequest. */ + class NetworksRemovePeeringRequest implements INetworksRemovePeeringRequest { + + /** + * Constructs a new NetworksRemovePeeringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworksRemovePeeringRequest); + + /** NetworksRemovePeeringRequest name. */ + public name?: (string|null); + + /** NetworksRemovePeeringRequest _name. */ + public _name?: "name"; + + /** + * Creates a new NetworksRemovePeeringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworksRemovePeeringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INetworksRemovePeeringRequest): google.cloud.compute.v1.NetworksRemovePeeringRequest; + + /** + * Encodes the specified NetworksRemovePeeringRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworksRemovePeeringRequest.verify|verify} messages. + * @param message NetworksRemovePeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworksRemovePeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworksRemovePeeringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksRemovePeeringRequest.verify|verify} messages. + * @param message NetworksRemovePeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworksRemovePeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworksRemovePeeringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworksRemovePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworksRemovePeeringRequest; + + /** + * Decodes a NetworksRemovePeeringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworksRemovePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworksRemovePeeringRequest; + + /** + * Verifies a NetworksRemovePeeringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworksRemovePeeringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworksRemovePeeringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworksRemovePeeringRequest; + + /** + * Creates a plain object from a NetworksRemovePeeringRequest message. Also converts values to other types if specified. + * @param message NetworksRemovePeeringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworksRemovePeeringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworksRemovePeeringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworksUpdatePeeringRequest. */ + interface INetworksUpdatePeeringRequest { + + /** NetworksUpdatePeeringRequest networkPeering */ + networkPeering?: (google.cloud.compute.v1.INetworkPeering|null); + } + + /** Represents a NetworksUpdatePeeringRequest. */ + class NetworksUpdatePeeringRequest implements INetworksUpdatePeeringRequest { + + /** + * Constructs a new NetworksUpdatePeeringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworksUpdatePeeringRequest); + + /** NetworksUpdatePeeringRequest networkPeering. */ + public networkPeering?: (google.cloud.compute.v1.INetworkPeering|null); + + /** NetworksUpdatePeeringRequest _networkPeering. */ + public _networkPeering?: "networkPeering"; + + /** + * Creates a new NetworksUpdatePeeringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworksUpdatePeeringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INetworksUpdatePeeringRequest): google.cloud.compute.v1.NetworksUpdatePeeringRequest; + + /** + * Encodes the specified NetworksUpdatePeeringRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworksUpdatePeeringRequest.verify|verify} messages. + * @param message NetworksUpdatePeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworksUpdatePeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworksUpdatePeeringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksUpdatePeeringRequest.verify|verify} messages. + * @param message NetworksUpdatePeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworksUpdatePeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworksUpdatePeeringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworksUpdatePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworksUpdatePeeringRequest; + + /** + * Decodes a NetworksUpdatePeeringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworksUpdatePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworksUpdatePeeringRequest; + + /** + * Verifies a NetworksUpdatePeeringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworksUpdatePeeringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworksUpdatePeeringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworksUpdatePeeringRequest; + + /** + * Creates a plain object from a NetworksUpdatePeeringRequest message. Also converts values to other types if specified. + * @param message NetworksUpdatePeeringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworksUpdatePeeringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworksUpdatePeeringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeGroupAutoscalingPolicy. */ + interface INodeGroupAutoscalingPolicy { + + /** NodeGroupAutoscalingPolicy maxNodes */ + maxNodes?: (number|null); + + /** NodeGroupAutoscalingPolicy minNodes */ + minNodes?: (number|null); + + /** NodeGroupAutoscalingPolicy mode */ + mode?: (google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode|keyof typeof google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode|null); + } + + /** Represents a NodeGroupAutoscalingPolicy. */ + class NodeGroupAutoscalingPolicy implements INodeGroupAutoscalingPolicy { + + /** + * Constructs a new NodeGroupAutoscalingPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupAutoscalingPolicy); + + /** NodeGroupAutoscalingPolicy maxNodes. */ + public maxNodes?: (number|null); + + /** NodeGroupAutoscalingPolicy minNodes. */ + public minNodes?: (number|null); + + /** NodeGroupAutoscalingPolicy mode. */ + public mode?: (google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode|keyof typeof google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode|null); + + /** NodeGroupAutoscalingPolicy _maxNodes. */ + public _maxNodes?: "maxNodes"; + + /** NodeGroupAutoscalingPolicy _minNodes. */ + public _minNodes?: "minNodes"; + + /** NodeGroupAutoscalingPolicy _mode. */ + public _mode?: "mode"; + + /** + * Creates a new NodeGroupAutoscalingPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupAutoscalingPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupAutoscalingPolicy): google.cloud.compute.v1.NodeGroupAutoscalingPolicy; + + /** + * Encodes the specified NodeGroupAutoscalingPolicy message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAutoscalingPolicy.verify|verify} messages. + * @param message NodeGroupAutoscalingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupAutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAutoscalingPolicy.verify|verify} messages. + * @param message NodeGroupAutoscalingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupAutoscalingPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupAutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupAutoscalingPolicy; + + /** + * Decodes a NodeGroupAutoscalingPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupAutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupAutoscalingPolicy; + + /** + * Verifies a NodeGroupAutoscalingPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupAutoscalingPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupAutoscalingPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupAutoscalingPolicy; + + /** + * Creates a plain object from a NodeGroupAutoscalingPolicy message. Also converts values to other types if specified. + * @param message NodeGroupAutoscalingPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupAutoscalingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupAutoscalingPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NodeGroupAutoscalingPolicy { + + /** Mode enum. */ + enum Mode { + UNDEFINED_MODE = 0, + MODE_UNSPECIFIED = 371348091, + OFF = 78159, + ON = 2527, + ONLY_SCALE_OUT = 152713670 + } + } + + /** Properties of a NodeGroupMaintenanceWindow. */ + interface INodeGroupMaintenanceWindow { + + /** NodeGroupMaintenanceWindow maintenanceDuration */ + maintenanceDuration?: (google.cloud.compute.v1.IDuration|null); + + /** NodeGroupMaintenanceWindow startTime */ + startTime?: (string|null); + } + + /** Represents a NodeGroupMaintenanceWindow. */ + class NodeGroupMaintenanceWindow implements INodeGroupMaintenanceWindow { + + /** + * Constructs a new NodeGroupMaintenanceWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupMaintenanceWindow); + + /** NodeGroupMaintenanceWindow maintenanceDuration. */ + public maintenanceDuration?: (google.cloud.compute.v1.IDuration|null); + + /** NodeGroupMaintenanceWindow startTime. */ + public startTime?: (string|null); + + /** NodeGroupMaintenanceWindow _maintenanceDuration. */ + public _maintenanceDuration?: "maintenanceDuration"; + + /** NodeGroupMaintenanceWindow _startTime. */ + public _startTime?: "startTime"; + + /** + * Creates a new NodeGroupMaintenanceWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupMaintenanceWindow instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupMaintenanceWindow): google.cloud.compute.v1.NodeGroupMaintenanceWindow; + + /** + * Encodes the specified NodeGroupMaintenanceWindow message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupMaintenanceWindow.verify|verify} messages. + * @param message NodeGroupMaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupMaintenanceWindow.verify|verify} messages. + * @param message NodeGroupMaintenanceWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupMaintenanceWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupMaintenanceWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupMaintenanceWindow; + + /** + * Decodes a NodeGroupMaintenanceWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupMaintenanceWindow; + + /** + * Verifies a NodeGroupMaintenanceWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupMaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupMaintenanceWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupMaintenanceWindow; + + /** + * Creates a plain object from a NodeGroupMaintenanceWindow message. Also converts values to other types if specified. + * @param message NodeGroupMaintenanceWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupMaintenanceWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupMaintenanceWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeGroup. */ + interface INodeGroup { + + /** NodeGroup autoscalingPolicy */ + autoscalingPolicy?: (google.cloud.compute.v1.INodeGroupAutoscalingPolicy|null); + + /** NodeGroup creationTimestamp */ + creationTimestamp?: (string|null); + + /** NodeGroup description */ + description?: (string|null); + + /** NodeGroup fingerprint */ + fingerprint?: (string|null); + + /** NodeGroup id */ + id?: (number|Long|string|null); + + /** NodeGroup kind */ + kind?: (string|null); + + /** NodeGroup locationHint */ + locationHint?: (string|null); + + /** NodeGroup maintenancePolicy */ + maintenancePolicy?: (google.cloud.compute.v1.NodeGroup.MaintenancePolicy|keyof typeof google.cloud.compute.v1.NodeGroup.MaintenancePolicy|null); + + /** NodeGroup maintenanceWindow */ + maintenanceWindow?: (google.cloud.compute.v1.INodeGroupMaintenanceWindow|null); + + /** NodeGroup name */ + name?: (string|null); + + /** NodeGroup nodeTemplate */ + nodeTemplate?: (string|null); + + /** NodeGroup selfLink */ + selfLink?: (string|null); + + /** NodeGroup size */ + size?: (number|null); + + /** NodeGroup status */ + status?: (google.cloud.compute.v1.NodeGroup.Status|keyof typeof google.cloud.compute.v1.NodeGroup.Status|null); + + /** NodeGroup zone */ + zone?: (string|null); + } + + /** Represents a NodeGroup. */ + class NodeGroup implements INodeGroup { + + /** + * Constructs a new NodeGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroup); + + /** NodeGroup autoscalingPolicy. */ + public autoscalingPolicy?: (google.cloud.compute.v1.INodeGroupAutoscalingPolicy|null); + + /** NodeGroup creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** NodeGroup description. */ + public description?: (string|null); + + /** NodeGroup fingerprint. */ + public fingerprint?: (string|null); + + /** NodeGroup id. */ + public id?: (number|Long|string|null); + + /** NodeGroup kind. */ + public kind?: (string|null); + + /** NodeGroup locationHint. */ + public locationHint?: (string|null); + + /** NodeGroup maintenancePolicy. */ + public maintenancePolicy?: (google.cloud.compute.v1.NodeGroup.MaintenancePolicy|keyof typeof google.cloud.compute.v1.NodeGroup.MaintenancePolicy|null); + + /** NodeGroup maintenanceWindow. */ + public maintenanceWindow?: (google.cloud.compute.v1.INodeGroupMaintenanceWindow|null); + + /** NodeGroup name. */ + public name?: (string|null); + + /** NodeGroup nodeTemplate. */ + public nodeTemplate?: (string|null); + + /** NodeGroup selfLink. */ + public selfLink?: (string|null); + + /** NodeGroup size. */ + public size?: (number|null); + + /** NodeGroup status. */ + public status?: (google.cloud.compute.v1.NodeGroup.Status|keyof typeof google.cloud.compute.v1.NodeGroup.Status|null); + + /** NodeGroup zone. */ + public zone?: (string|null); + + /** NodeGroup _autoscalingPolicy. */ + public _autoscalingPolicy?: "autoscalingPolicy"; + + /** NodeGroup _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** NodeGroup _description. */ + public _description?: "description"; + + /** NodeGroup _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** NodeGroup _id. */ + public _id?: "id"; + + /** NodeGroup _kind. */ + public _kind?: "kind"; + + /** NodeGroup _locationHint. */ + public _locationHint?: "locationHint"; + + /** NodeGroup _maintenancePolicy. */ + public _maintenancePolicy?: "maintenancePolicy"; + + /** NodeGroup _maintenanceWindow. */ + public _maintenanceWindow?: "maintenanceWindow"; + + /** NodeGroup _name. */ + public _name?: "name"; + + /** NodeGroup _nodeTemplate. */ + public _nodeTemplate?: "nodeTemplate"; + + /** NodeGroup _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeGroup _size. */ + public _size?: "size"; + + /** NodeGroup _status. */ + public _status?: "status"; + + /** NodeGroup _zone. */ + public _zone?: "zone"; + + /** + * Creates a new NodeGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroup instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroup): google.cloud.compute.v1.NodeGroup; + + /** + * Encodes the specified NodeGroup message. Does not implicitly {@link google.cloud.compute.v1.NodeGroup.verify|verify} messages. + * @param message NodeGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroup message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroup.verify|verify} messages. + * @param message NodeGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroup; + + /** + * Decodes a NodeGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroup; + + /** + * Verifies a NodeGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroup; + + /** + * Creates a plain object from a NodeGroup message. Also converts values to other types if specified. + * @param message NodeGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NodeGroup { + + /** MaintenancePolicy enum. */ + enum MaintenancePolicy { + UNDEFINED_MAINTENANCE_POLICY = 0, + DEFAULT = 115302945, + MAINTENANCE_POLICY_UNSPECIFIED = 72964182, + MIGRATE_WITHIN_NODE_GROUP = 153483394, + RESTART_IN_PLACE = 228647325 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + INVALID = 530283991, + READY = 77848963 + } + } + + /** Properties of a NodeGroupsScopedList. */ + interface INodeGroupsScopedList { + + /** NodeGroupsScopedList nodeGroups */ + nodeGroups?: (google.cloud.compute.v1.INodeGroup[]|null); + + /** NodeGroupsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeGroupsScopedList. */ + class NodeGroupsScopedList implements INodeGroupsScopedList { + + /** + * Constructs a new NodeGroupsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupsScopedList); + + /** NodeGroupsScopedList nodeGroups. */ + public nodeGroups: google.cloud.compute.v1.INodeGroup[]; + + /** NodeGroupsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeGroupsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeGroupsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupsScopedList): google.cloud.compute.v1.NodeGroupsScopedList; + + /** + * Encodes the specified NodeGroupsScopedList message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsScopedList.verify|verify} messages. + * @param message NodeGroupsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsScopedList.verify|verify} messages. + * @param message NodeGroupsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupsScopedList; + + /** + * Decodes a NodeGroupsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupsScopedList; + + /** + * Verifies a NodeGroupsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupsScopedList; + + /** + * Creates a plain object from a NodeGroupsScopedList message. Also converts values to other types if specified. + * @param message NodeGroupsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeGroupAggregatedList. */ + interface INodeGroupAggregatedList { + + /** NodeGroupAggregatedList id */ + id?: (string|null); + + /** NodeGroupAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.INodeGroupsScopedList }|null); + + /** NodeGroupAggregatedList kind */ + kind?: (string|null); + + /** NodeGroupAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** NodeGroupAggregatedList selfLink */ + selfLink?: (string|null); + + /** NodeGroupAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** NodeGroupAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeGroupAggregatedList. */ + class NodeGroupAggregatedList implements INodeGroupAggregatedList { + + /** + * Constructs a new NodeGroupAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupAggregatedList); + + /** NodeGroupAggregatedList id. */ + public id?: (string|null); + + /** NodeGroupAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.INodeGroupsScopedList }; + + /** NodeGroupAggregatedList kind. */ + public kind?: (string|null); + + /** NodeGroupAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NodeGroupAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** NodeGroupAggregatedList unreachables. */ + public unreachables: string[]; + + /** NodeGroupAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeGroupAggregatedList _id. */ + public _id?: "id"; + + /** NodeGroupAggregatedList _kind. */ + public _kind?: "kind"; + + /** NodeGroupAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NodeGroupAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeGroupAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeGroupAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupAggregatedList): google.cloud.compute.v1.NodeGroupAggregatedList; + + /** + * Encodes the specified NodeGroupAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAggregatedList.verify|verify} messages. + * @param message NodeGroupAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAggregatedList.verify|verify} messages. + * @param message NodeGroupAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupAggregatedList; + + /** + * Decodes a NodeGroupAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupAggregatedList; + + /** + * Verifies a NodeGroupAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupAggregatedList; + + /** + * Creates a plain object from a NodeGroupAggregatedList message. Also converts values to other types if specified. + * @param message NodeGroupAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeGroupList. */ + interface INodeGroupList { + + /** NodeGroupList id */ + id?: (string|null); + + /** NodeGroupList items */ + items?: (google.cloud.compute.v1.INodeGroup[]|null); + + /** NodeGroupList kind */ + kind?: (string|null); + + /** NodeGroupList nextPageToken */ + nextPageToken?: (string|null); + + /** NodeGroupList selfLink */ + selfLink?: (string|null); + + /** NodeGroupList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeGroupList. */ + class NodeGroupList implements INodeGroupList { + + /** + * Constructs a new NodeGroupList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupList); + + /** NodeGroupList id. */ + public id?: (string|null); + + /** NodeGroupList items. */ + public items: google.cloud.compute.v1.INodeGroup[]; + + /** NodeGroupList kind. */ + public kind?: (string|null); + + /** NodeGroupList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NodeGroupList selfLink. */ + public selfLink?: (string|null); + + /** NodeGroupList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeGroupList _id. */ + public _id?: "id"; + + /** NodeGroupList _kind. */ + public _kind?: "kind"; + + /** NodeGroupList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NodeGroupList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeGroupList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeGroupList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupList): google.cloud.compute.v1.NodeGroupList; + + /** + * Encodes the specified NodeGroupList message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupList.verify|verify} messages. + * @param message NodeGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupList.verify|verify} messages. + * @param message NodeGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupList; + + /** + * Decodes a NodeGroupList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupList; + + /** + * Verifies a NodeGroupList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupList; + + /** + * Creates a plain object from a NodeGroupList message. Also converts values to other types if specified. + * @param message NodeGroupList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServerBinding. */ + interface IServerBinding { + + /** ServerBinding type */ + type?: (google.cloud.compute.v1.ServerBinding.Type|keyof typeof google.cloud.compute.v1.ServerBinding.Type|null); + } + + /** Represents a ServerBinding. */ + class ServerBinding implements IServerBinding { + + /** + * Constructs a new ServerBinding. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IServerBinding); + + /** ServerBinding type. */ + public type?: (google.cloud.compute.v1.ServerBinding.Type|keyof typeof google.cloud.compute.v1.ServerBinding.Type|null); + + /** ServerBinding _type. */ + public _type?: "type"; + + /** + * Creates a new ServerBinding instance using the specified properties. + * @param [properties] Properties to set + * @returns ServerBinding instance + */ + public static create(properties?: google.cloud.compute.v1.IServerBinding): google.cloud.compute.v1.ServerBinding; + + /** + * Encodes the specified ServerBinding message. Does not implicitly {@link google.cloud.compute.v1.ServerBinding.verify|verify} messages. + * @param message ServerBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IServerBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServerBinding message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ServerBinding.verify|verify} messages. + * @param message ServerBinding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IServerBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServerBinding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServerBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ServerBinding; + + /** + * Decodes a ServerBinding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServerBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ServerBinding; + + /** + * Verifies a ServerBinding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServerBinding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServerBinding + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ServerBinding; + + /** + * Creates a plain object from a ServerBinding message. Also converts values to other types if specified. + * @param message ServerBinding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ServerBinding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServerBinding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ServerBinding { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + RESTART_NODE_ON_ANY_SERVER = 502950985, + RESTART_NODE_ON_MINIMAL_SERVERS = 204166495, + SERVER_BINDING_TYPE_UNSPECIFIED = 180825512 + } + } + + /** Properties of a NodeGroupNode. */ + interface INodeGroupNode { + + /** NodeGroupNode accelerators */ + accelerators?: (google.cloud.compute.v1.IAcceleratorConfig[]|null); + + /** NodeGroupNode cpuOvercommitType */ + cpuOvercommitType?: (google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType|keyof typeof google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType|null); + + /** NodeGroupNode disks */ + disks?: (google.cloud.compute.v1.ILocalDisk[]|null); + + /** NodeGroupNode instances */ + instances?: (string[]|null); + + /** NodeGroupNode name */ + name?: (string|null); + + /** NodeGroupNode nodeType */ + nodeType?: (string|null); + + /** NodeGroupNode satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** NodeGroupNode serverBinding */ + serverBinding?: (google.cloud.compute.v1.IServerBinding|null); + + /** NodeGroupNode serverId */ + serverId?: (string|null); + + /** NodeGroupNode status */ + status?: (google.cloud.compute.v1.NodeGroupNode.Status|keyof typeof google.cloud.compute.v1.NodeGroupNode.Status|null); + } + + /** Represents a NodeGroupNode. */ + class NodeGroupNode implements INodeGroupNode { + + /** + * Constructs a new NodeGroupNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupNode); + + /** NodeGroupNode accelerators. */ + public accelerators: google.cloud.compute.v1.IAcceleratorConfig[]; + + /** NodeGroupNode cpuOvercommitType. */ + public cpuOvercommitType?: (google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType|keyof typeof google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType|null); + + /** NodeGroupNode disks. */ + public disks: google.cloud.compute.v1.ILocalDisk[]; + + /** NodeGroupNode instances. */ + public instances: string[]; + + /** NodeGroupNode name. */ + public name?: (string|null); + + /** NodeGroupNode nodeType. */ + public nodeType?: (string|null); + + /** NodeGroupNode satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** NodeGroupNode serverBinding. */ + public serverBinding?: (google.cloud.compute.v1.IServerBinding|null); + + /** NodeGroupNode serverId. */ + public serverId?: (string|null); + + /** NodeGroupNode status. */ + public status?: (google.cloud.compute.v1.NodeGroupNode.Status|keyof typeof google.cloud.compute.v1.NodeGroupNode.Status|null); + + /** NodeGroupNode _cpuOvercommitType. */ + public _cpuOvercommitType?: "cpuOvercommitType"; + + /** NodeGroupNode _name. */ + public _name?: "name"; + + /** NodeGroupNode _nodeType. */ + public _nodeType?: "nodeType"; + + /** NodeGroupNode _satisfiesPzs. */ + public _satisfiesPzs?: "satisfiesPzs"; + + /** NodeGroupNode _serverBinding. */ + public _serverBinding?: "serverBinding"; + + /** NodeGroupNode _serverId. */ + public _serverId?: "serverId"; + + /** NodeGroupNode _status. */ + public _status?: "status"; + + /** + * Creates a new NodeGroupNode instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupNode instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupNode): google.cloud.compute.v1.NodeGroupNode; + + /** + * Encodes the specified NodeGroupNode message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupNode.verify|verify} messages. + * @param message NodeGroupNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupNode message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupNode.verify|verify} messages. + * @param message NodeGroupNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupNode; + + /** + * Decodes a NodeGroupNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupNode; + + /** + * Verifies a NodeGroupNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupNode; + + /** + * Creates a plain object from a NodeGroupNode message. Also converts values to other types if specified. + * @param message NodeGroupNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NodeGroupNode { + + /** CpuOvercommitType enum. */ + enum CpuOvercommitType { + UNDEFINED_CPU_OVERCOMMIT_TYPE = 0, + CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615, + ENABLED = 182130465, + NONE = 2402104 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + INVALID = 530283991, + READY = 77848963, + REPAIRING = 413483285 + } + } + + /** Properties of a NodeGroupsAddNodesRequest. */ + interface INodeGroupsAddNodesRequest { + + /** NodeGroupsAddNodesRequest additionalNodeCount */ + additionalNodeCount?: (number|null); + } + + /** Represents a NodeGroupsAddNodesRequest. */ + class NodeGroupsAddNodesRequest implements INodeGroupsAddNodesRequest { + + /** + * Constructs a new NodeGroupsAddNodesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupsAddNodesRequest); + + /** NodeGroupsAddNodesRequest additionalNodeCount. */ + public additionalNodeCount?: (number|null); + + /** NodeGroupsAddNodesRequest _additionalNodeCount. */ + public _additionalNodeCount?: "additionalNodeCount"; + + /** + * Creates a new NodeGroupsAddNodesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupsAddNodesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupsAddNodesRequest): google.cloud.compute.v1.NodeGroupsAddNodesRequest; + + /** + * Encodes the specified NodeGroupsAddNodesRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsAddNodesRequest.verify|verify} messages. + * @param message NodeGroupsAddNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupsAddNodesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupsAddNodesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsAddNodesRequest.verify|verify} messages. + * @param message NodeGroupsAddNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupsAddNodesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupsAddNodesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupsAddNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupsAddNodesRequest; + + /** + * Decodes a NodeGroupsAddNodesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupsAddNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupsAddNodesRequest; + + /** + * Verifies a NodeGroupsAddNodesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupsAddNodesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupsAddNodesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupsAddNodesRequest; + + /** + * Creates a plain object from a NodeGroupsAddNodesRequest message. Also converts values to other types if specified. + * @param message NodeGroupsAddNodesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupsAddNodesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupsAddNodesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeGroupsDeleteNodesRequest. */ + interface INodeGroupsDeleteNodesRequest { + + /** NodeGroupsDeleteNodesRequest nodes */ + nodes?: (string[]|null); + } + + /** Represents a NodeGroupsDeleteNodesRequest. */ + class NodeGroupsDeleteNodesRequest implements INodeGroupsDeleteNodesRequest { + + /** + * Constructs a new NodeGroupsDeleteNodesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupsDeleteNodesRequest); + + /** NodeGroupsDeleteNodesRequest nodes. */ + public nodes: string[]; + + /** + * Creates a new NodeGroupsDeleteNodesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupsDeleteNodesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupsDeleteNodesRequest): google.cloud.compute.v1.NodeGroupsDeleteNodesRequest; + + /** + * Encodes the specified NodeGroupsDeleteNodesRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.verify|verify} messages. + * @param message NodeGroupsDeleteNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupsDeleteNodesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupsDeleteNodesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.verify|verify} messages. + * @param message NodeGroupsDeleteNodesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupsDeleteNodesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupsDeleteNodesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupsDeleteNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupsDeleteNodesRequest; + + /** + * Decodes a NodeGroupsDeleteNodesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupsDeleteNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupsDeleteNodesRequest; + + /** + * Verifies a NodeGroupsDeleteNodesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupsDeleteNodesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupsDeleteNodesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupsDeleteNodesRequest; + + /** + * Creates a plain object from a NodeGroupsDeleteNodesRequest message. Also converts values to other types if specified. + * @param message NodeGroupsDeleteNodesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupsDeleteNodesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupsDeleteNodesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeGroupsListNodes. */ + interface INodeGroupsListNodes { + + /** NodeGroupsListNodes id */ + id?: (string|null); + + /** NodeGroupsListNodes items */ + items?: (google.cloud.compute.v1.INodeGroupNode[]|null); + + /** NodeGroupsListNodes kind */ + kind?: (string|null); + + /** NodeGroupsListNodes nextPageToken */ + nextPageToken?: (string|null); + + /** NodeGroupsListNodes selfLink */ + selfLink?: (string|null); + + /** NodeGroupsListNodes warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeGroupsListNodes. */ + class NodeGroupsListNodes implements INodeGroupsListNodes { + + /** + * Constructs a new NodeGroupsListNodes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupsListNodes); + + /** NodeGroupsListNodes id. */ + public id?: (string|null); + + /** NodeGroupsListNodes items. */ + public items: google.cloud.compute.v1.INodeGroupNode[]; + + /** NodeGroupsListNodes kind. */ + public kind?: (string|null); + + /** NodeGroupsListNodes nextPageToken. */ + public nextPageToken?: (string|null); + + /** NodeGroupsListNodes selfLink. */ + public selfLink?: (string|null); + + /** NodeGroupsListNodes warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeGroupsListNodes _id. */ + public _id?: "id"; + + /** NodeGroupsListNodes _kind. */ + public _kind?: "kind"; + + /** NodeGroupsListNodes _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NodeGroupsListNodes _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeGroupsListNodes _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeGroupsListNodes instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupsListNodes instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupsListNodes): google.cloud.compute.v1.NodeGroupsListNodes; + + /** + * Encodes the specified NodeGroupsListNodes message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsListNodes.verify|verify} messages. + * @param message NodeGroupsListNodes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupsListNodes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupsListNodes message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsListNodes.verify|verify} messages. + * @param message NodeGroupsListNodes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupsListNodes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupsListNodes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupsListNodes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupsListNodes; + + /** + * Decodes a NodeGroupsListNodes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupsListNodes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupsListNodes; + + /** + * Verifies a NodeGroupsListNodes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupsListNodes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupsListNodes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupsListNodes; + + /** + * Creates a plain object from a NodeGroupsListNodes message. Also converts values to other types if specified. + * @param message NodeGroupsListNodes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupsListNodes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupsListNodes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeGroupsSetNodeTemplateRequest. */ + interface INodeGroupsSetNodeTemplateRequest { + + /** NodeGroupsSetNodeTemplateRequest nodeTemplate */ + nodeTemplate?: (string|null); + } + + /** Represents a NodeGroupsSetNodeTemplateRequest. */ + class NodeGroupsSetNodeTemplateRequest implements INodeGroupsSetNodeTemplateRequest { + + /** + * Constructs a new NodeGroupsSetNodeTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest); + + /** NodeGroupsSetNodeTemplateRequest nodeTemplate. */ + public nodeTemplate?: (string|null); + + /** NodeGroupsSetNodeTemplateRequest _nodeTemplate. */ + public _nodeTemplate?: "nodeTemplate"; + + /** + * Creates a new NodeGroupsSetNodeTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupsSetNodeTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest): google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest; + + /** + * Encodes the specified NodeGroupsSetNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.verify|verify} messages. + * @param message NodeGroupsSetNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupsSetNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.verify|verify} messages. + * @param message NodeGroupsSetNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupsSetNodeTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupsSetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest; + + /** + * Decodes a NodeGroupsSetNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupsSetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest; + + /** + * Verifies a NodeGroupsSetNodeTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupsSetNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupsSetNodeTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest; + + /** + * Creates a plain object from a NodeGroupsSetNodeTemplateRequest message. Also converts values to other types if specified. + * @param message NodeGroupsSetNodeTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupsSetNodeTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeTemplateNodeTypeFlexibility. */ + interface INodeTemplateNodeTypeFlexibility { + + /** NodeTemplateNodeTypeFlexibility cpus */ + cpus?: (string|null); + + /** NodeTemplateNodeTypeFlexibility localSsd */ + localSsd?: (string|null); + + /** NodeTemplateNodeTypeFlexibility memory */ + memory?: (string|null); + } + + /** Represents a NodeTemplateNodeTypeFlexibility. */ + class NodeTemplateNodeTypeFlexibility implements INodeTemplateNodeTypeFlexibility { + + /** + * Constructs a new NodeTemplateNodeTypeFlexibility. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility); + + /** NodeTemplateNodeTypeFlexibility cpus. */ + public cpus?: (string|null); + + /** NodeTemplateNodeTypeFlexibility localSsd. */ + public localSsd?: (string|null); + + /** NodeTemplateNodeTypeFlexibility memory. */ + public memory?: (string|null); + + /** NodeTemplateNodeTypeFlexibility _cpus. */ + public _cpus?: "cpus"; + + /** NodeTemplateNodeTypeFlexibility _localSsd. */ + public _localSsd?: "localSsd"; + + /** NodeTemplateNodeTypeFlexibility _memory. */ + public _memory?: "memory"; + + /** + * Creates a new NodeTemplateNodeTypeFlexibility instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTemplateNodeTypeFlexibility instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility): google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility; + + /** + * Encodes the specified NodeTemplateNodeTypeFlexibility message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.verify|verify} messages. + * @param message NodeTemplateNodeTypeFlexibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTemplateNodeTypeFlexibility message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.verify|verify} messages. + * @param message NodeTemplateNodeTypeFlexibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTemplateNodeTypeFlexibility message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTemplateNodeTypeFlexibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility; + + /** + * Decodes a NodeTemplateNodeTypeFlexibility message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTemplateNodeTypeFlexibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility; + + /** + * Verifies a NodeTemplateNodeTypeFlexibility message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTemplateNodeTypeFlexibility message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTemplateNodeTypeFlexibility + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility; + + /** + * Creates a plain object from a NodeTemplateNodeTypeFlexibility message. Also converts values to other types if specified. + * @param message NodeTemplateNodeTypeFlexibility + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTemplateNodeTypeFlexibility to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeTemplate. */ + interface INodeTemplate { + + /** NodeTemplate accelerators */ + accelerators?: (google.cloud.compute.v1.IAcceleratorConfig[]|null); + + /** NodeTemplate cpuOvercommitType */ + cpuOvercommitType?: (google.cloud.compute.v1.NodeTemplate.CpuOvercommitType|keyof typeof google.cloud.compute.v1.NodeTemplate.CpuOvercommitType|null); + + /** NodeTemplate creationTimestamp */ + creationTimestamp?: (string|null); + + /** NodeTemplate description */ + description?: (string|null); + + /** NodeTemplate disks */ + disks?: (google.cloud.compute.v1.ILocalDisk[]|null); + + /** NodeTemplate id */ + id?: (number|Long|string|null); + + /** NodeTemplate kind */ + kind?: (string|null); + + /** NodeTemplate name */ + name?: (string|null); + + /** NodeTemplate nodeAffinityLabels */ + nodeAffinityLabels?: ({ [k: string]: string }|null); + + /** NodeTemplate nodeType */ + nodeType?: (string|null); + + /** NodeTemplate nodeTypeFlexibility */ + nodeTypeFlexibility?: (google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility|null); + + /** NodeTemplate region */ + region?: (string|null); + + /** NodeTemplate selfLink */ + selfLink?: (string|null); + + /** NodeTemplate serverBinding */ + serverBinding?: (google.cloud.compute.v1.IServerBinding|null); + + /** NodeTemplate status */ + status?: (google.cloud.compute.v1.NodeTemplate.Status|keyof typeof google.cloud.compute.v1.NodeTemplate.Status|null); + + /** NodeTemplate statusMessage */ + statusMessage?: (string|null); + } + + /** Represents a NodeTemplate. */ + class NodeTemplate implements INodeTemplate { + + /** + * Constructs a new NodeTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTemplate); + + /** NodeTemplate accelerators. */ + public accelerators: google.cloud.compute.v1.IAcceleratorConfig[]; + + /** NodeTemplate cpuOvercommitType. */ + public cpuOvercommitType?: (google.cloud.compute.v1.NodeTemplate.CpuOvercommitType|keyof typeof google.cloud.compute.v1.NodeTemplate.CpuOvercommitType|null); + + /** NodeTemplate creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** NodeTemplate description. */ + public description?: (string|null); + + /** NodeTemplate disks. */ + public disks: google.cloud.compute.v1.ILocalDisk[]; + + /** NodeTemplate id. */ + public id?: (number|Long|string|null); + + /** NodeTemplate kind. */ + public kind?: (string|null); + + /** NodeTemplate name. */ + public name?: (string|null); + + /** NodeTemplate nodeAffinityLabels. */ + public nodeAffinityLabels: { [k: string]: string }; + + /** NodeTemplate nodeType. */ + public nodeType?: (string|null); + + /** NodeTemplate nodeTypeFlexibility. */ + public nodeTypeFlexibility?: (google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility|null); + + /** NodeTemplate region. */ + public region?: (string|null); + + /** NodeTemplate selfLink. */ + public selfLink?: (string|null); + + /** NodeTemplate serverBinding. */ + public serverBinding?: (google.cloud.compute.v1.IServerBinding|null); + + /** NodeTemplate status. */ + public status?: (google.cloud.compute.v1.NodeTemplate.Status|keyof typeof google.cloud.compute.v1.NodeTemplate.Status|null); + + /** NodeTemplate statusMessage. */ + public statusMessage?: (string|null); + + /** NodeTemplate _cpuOvercommitType. */ + public _cpuOvercommitType?: "cpuOvercommitType"; + + /** NodeTemplate _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** NodeTemplate _description. */ + public _description?: "description"; + + /** NodeTemplate _id. */ + public _id?: "id"; + + /** NodeTemplate _kind. */ + public _kind?: "kind"; + + /** NodeTemplate _name. */ + public _name?: "name"; + + /** NodeTemplate _nodeType. */ + public _nodeType?: "nodeType"; + + /** NodeTemplate _nodeTypeFlexibility. */ + public _nodeTypeFlexibility?: "nodeTypeFlexibility"; + + /** NodeTemplate _region. */ + public _region?: "region"; + + /** NodeTemplate _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeTemplate _serverBinding. */ + public _serverBinding?: "serverBinding"; + + /** NodeTemplate _status. */ + public _status?: "status"; + + /** NodeTemplate _statusMessage. */ + public _statusMessage?: "statusMessage"; + + /** + * Creates a new NodeTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTemplate instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTemplate): google.cloud.compute.v1.NodeTemplate; + + /** + * Encodes the specified NodeTemplate message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplate.verify|verify} messages. + * @param message NodeTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTemplate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplate.verify|verify} messages. + * @param message NodeTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTemplate; + + /** + * Decodes a NodeTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTemplate; + + /** + * Verifies a NodeTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTemplate; + + /** + * Creates a plain object from a NodeTemplate message. Also converts values to other types if specified. + * @param message NodeTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NodeTemplate { + + /** CpuOvercommitType enum. */ + enum CpuOvercommitType { + UNDEFINED_CPU_OVERCOMMIT_TYPE = 0, + CPU_OVERCOMMIT_TYPE_UNSPECIFIED = 520665615, + ENABLED = 182130465, + NONE = 2402104 + } + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + INVALID = 530283991, + READY = 77848963 + } + } + + /** Properties of a NodeTemplatesScopedList. */ + interface INodeTemplatesScopedList { + + /** NodeTemplatesScopedList nodeTemplates */ + nodeTemplates?: (google.cloud.compute.v1.INodeTemplate[]|null); + + /** NodeTemplatesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeTemplatesScopedList. */ + class NodeTemplatesScopedList implements INodeTemplatesScopedList { + + /** + * Constructs a new NodeTemplatesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTemplatesScopedList); + + /** NodeTemplatesScopedList nodeTemplates. */ + public nodeTemplates: google.cloud.compute.v1.INodeTemplate[]; + + /** NodeTemplatesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeTemplatesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeTemplatesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTemplatesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTemplatesScopedList): google.cloud.compute.v1.NodeTemplatesScopedList; + + /** + * Encodes the specified NodeTemplatesScopedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplatesScopedList.verify|verify} messages. + * @param message NodeTemplatesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTemplatesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTemplatesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplatesScopedList.verify|verify} messages. + * @param message NodeTemplatesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTemplatesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTemplatesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTemplatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTemplatesScopedList; + + /** + * Decodes a NodeTemplatesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTemplatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTemplatesScopedList; + + /** + * Verifies a NodeTemplatesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTemplatesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTemplatesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTemplatesScopedList; + + /** + * Creates a plain object from a NodeTemplatesScopedList message. Also converts values to other types if specified. + * @param message NodeTemplatesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTemplatesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTemplatesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeTemplateAggregatedList. */ + interface INodeTemplateAggregatedList { + + /** NodeTemplateAggregatedList id */ + id?: (string|null); + + /** NodeTemplateAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.INodeTemplatesScopedList }|null); + + /** NodeTemplateAggregatedList kind */ + kind?: (string|null); + + /** NodeTemplateAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** NodeTemplateAggregatedList selfLink */ + selfLink?: (string|null); + + /** NodeTemplateAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** NodeTemplateAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeTemplateAggregatedList. */ + class NodeTemplateAggregatedList implements INodeTemplateAggregatedList { + + /** + * Constructs a new NodeTemplateAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTemplateAggregatedList); + + /** NodeTemplateAggregatedList id. */ + public id?: (string|null); + + /** NodeTemplateAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.INodeTemplatesScopedList }; + + /** NodeTemplateAggregatedList kind. */ + public kind?: (string|null); + + /** NodeTemplateAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NodeTemplateAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** NodeTemplateAggregatedList unreachables. */ + public unreachables: string[]; + + /** NodeTemplateAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeTemplateAggregatedList _id. */ + public _id?: "id"; + + /** NodeTemplateAggregatedList _kind. */ + public _kind?: "kind"; + + /** NodeTemplateAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NodeTemplateAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeTemplateAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeTemplateAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTemplateAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTemplateAggregatedList): google.cloud.compute.v1.NodeTemplateAggregatedList; + + /** + * Encodes the specified NodeTemplateAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateAggregatedList.verify|verify} messages. + * @param message NodeTemplateAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTemplateAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTemplateAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateAggregatedList.verify|verify} messages. + * @param message NodeTemplateAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTemplateAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTemplateAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTemplateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTemplateAggregatedList; + + /** + * Decodes a NodeTemplateAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTemplateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTemplateAggregatedList; + + /** + * Verifies a NodeTemplateAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTemplateAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTemplateAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTemplateAggregatedList; + + /** + * Creates a plain object from a NodeTemplateAggregatedList message. Also converts values to other types if specified. + * @param message NodeTemplateAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTemplateAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTemplateAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeTemplateList. */ + interface INodeTemplateList { + + /** NodeTemplateList id */ + id?: (string|null); + + /** NodeTemplateList items */ + items?: (google.cloud.compute.v1.INodeTemplate[]|null); + + /** NodeTemplateList kind */ + kind?: (string|null); + + /** NodeTemplateList nextPageToken */ + nextPageToken?: (string|null); + + /** NodeTemplateList selfLink */ + selfLink?: (string|null); + + /** NodeTemplateList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeTemplateList. */ + class NodeTemplateList implements INodeTemplateList { + + /** + * Constructs a new NodeTemplateList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTemplateList); + + /** NodeTemplateList id. */ + public id?: (string|null); + + /** NodeTemplateList items. */ + public items: google.cloud.compute.v1.INodeTemplate[]; + + /** NodeTemplateList kind. */ + public kind?: (string|null); + + /** NodeTemplateList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NodeTemplateList selfLink. */ + public selfLink?: (string|null); + + /** NodeTemplateList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeTemplateList _id. */ + public _id?: "id"; + + /** NodeTemplateList _kind. */ + public _kind?: "kind"; + + /** NodeTemplateList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NodeTemplateList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeTemplateList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeTemplateList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTemplateList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTemplateList): google.cloud.compute.v1.NodeTemplateList; + + /** + * Encodes the specified NodeTemplateList message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateList.verify|verify} messages. + * @param message NodeTemplateList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTemplateList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTemplateList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateList.verify|verify} messages. + * @param message NodeTemplateList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTemplateList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTemplateList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTemplateList; + + /** + * Decodes a NodeTemplateList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTemplateList; + + /** + * Verifies a NodeTemplateList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTemplateList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTemplateList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTemplateList; + + /** + * Creates a plain object from a NodeTemplateList message. Also converts values to other types if specified. + * @param message NodeTemplateList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTemplateList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTemplateList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeType. */ + interface INodeType { + + /** NodeType cpuPlatform */ + cpuPlatform?: (string|null); + + /** NodeType creationTimestamp */ + creationTimestamp?: (string|null); + + /** NodeType deprecated */ + deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** NodeType description */ + description?: (string|null); + + /** NodeType guestCpus */ + guestCpus?: (number|null); + + /** NodeType id */ + id?: (number|Long|string|null); + + /** NodeType kind */ + kind?: (string|null); + + /** NodeType localSsdGb */ + localSsdGb?: (number|null); + + /** NodeType memoryMb */ + memoryMb?: (number|null); + + /** NodeType name */ + name?: (string|null); + + /** NodeType selfLink */ + selfLink?: (string|null); + + /** NodeType zone */ + zone?: (string|null); + } + + /** Represents a NodeType. */ + class NodeType implements INodeType { + + /** + * Constructs a new NodeType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeType); + + /** NodeType cpuPlatform. */ + public cpuPlatform?: (string|null); + + /** NodeType creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** NodeType deprecated. */ + public deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** NodeType description. */ + public description?: (string|null); + + /** NodeType guestCpus. */ + public guestCpus?: (number|null); + + /** NodeType id. */ + public id?: (number|Long|string|null); + + /** NodeType kind. */ + public kind?: (string|null); + + /** NodeType localSsdGb. */ + public localSsdGb?: (number|null); + + /** NodeType memoryMb. */ + public memoryMb?: (number|null); + + /** NodeType name. */ + public name?: (string|null); + + /** NodeType selfLink. */ + public selfLink?: (string|null); + + /** NodeType zone. */ + public zone?: (string|null); + + /** NodeType _cpuPlatform. */ + public _cpuPlatform?: "cpuPlatform"; + + /** NodeType _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** NodeType _deprecated. */ + public _deprecated?: "deprecated"; + + /** NodeType _description. */ + public _description?: "description"; + + /** NodeType _guestCpus. */ + public _guestCpus?: "guestCpus"; + + /** NodeType _id. */ + public _id?: "id"; + + /** NodeType _kind. */ + public _kind?: "kind"; + + /** NodeType _localSsdGb. */ + public _localSsdGb?: "localSsdGb"; + + /** NodeType _memoryMb. */ + public _memoryMb?: "memoryMb"; + + /** NodeType _name. */ + public _name?: "name"; + + /** NodeType _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeType _zone. */ + public _zone?: "zone"; + + /** + * Creates a new NodeType instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeType instance + */ + public static create(properties?: google.cloud.compute.v1.INodeType): google.cloud.compute.v1.NodeType; + + /** + * Encodes the specified NodeType message. Does not implicitly {@link google.cloud.compute.v1.NodeType.verify|verify} messages. + * @param message NodeType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeType.verify|verify} messages. + * @param message NodeType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeType; + + /** + * Decodes a NodeType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeType; + + /** + * Verifies a NodeType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeType; + + /** + * Creates a plain object from a NodeType message. Also converts values to other types if specified. + * @param message NodeType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeTypesScopedList. */ + interface INodeTypesScopedList { + + /** NodeTypesScopedList nodeTypes */ + nodeTypes?: (google.cloud.compute.v1.INodeType[]|null); + + /** NodeTypesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeTypesScopedList. */ + class NodeTypesScopedList implements INodeTypesScopedList { + + /** + * Constructs a new NodeTypesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTypesScopedList); + + /** NodeTypesScopedList nodeTypes. */ + public nodeTypes: google.cloud.compute.v1.INodeType[]; + + /** NodeTypesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeTypesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeTypesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTypesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTypesScopedList): google.cloud.compute.v1.NodeTypesScopedList; + + /** + * Encodes the specified NodeTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTypesScopedList.verify|verify} messages. + * @param message NodeTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTypesScopedList.verify|verify} messages. + * @param message NodeTypesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTypesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTypesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTypesScopedList; + + /** + * Decodes a NodeTypesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTypesScopedList; + + /** + * Verifies a NodeTypesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTypesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTypesScopedList; + + /** + * Creates a plain object from a NodeTypesScopedList message. Also converts values to other types if specified. + * @param message NodeTypesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTypesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTypesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeTypeAggregatedList. */ + interface INodeTypeAggregatedList { + + /** NodeTypeAggregatedList id */ + id?: (string|null); + + /** NodeTypeAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.INodeTypesScopedList }|null); + + /** NodeTypeAggregatedList kind */ + kind?: (string|null); + + /** NodeTypeAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** NodeTypeAggregatedList selfLink */ + selfLink?: (string|null); + + /** NodeTypeAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** NodeTypeAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeTypeAggregatedList. */ + class NodeTypeAggregatedList implements INodeTypeAggregatedList { + + /** + * Constructs a new NodeTypeAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTypeAggregatedList); + + /** NodeTypeAggregatedList id. */ + public id?: (string|null); + + /** NodeTypeAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.INodeTypesScopedList }; + + /** NodeTypeAggregatedList kind. */ + public kind?: (string|null); + + /** NodeTypeAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NodeTypeAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** NodeTypeAggregatedList unreachables. */ + public unreachables: string[]; + + /** NodeTypeAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeTypeAggregatedList _id. */ + public _id?: "id"; + + /** NodeTypeAggregatedList _kind. */ + public _kind?: "kind"; + + /** NodeTypeAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NodeTypeAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeTypeAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeTypeAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTypeAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTypeAggregatedList): google.cloud.compute.v1.NodeTypeAggregatedList; + + /** + * Encodes the specified NodeTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTypeAggregatedList.verify|verify} messages. + * @param message NodeTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTypeAggregatedList.verify|verify} messages. + * @param message NodeTypeAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTypeAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTypeAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTypeAggregatedList; + + /** + * Decodes a NodeTypeAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTypeAggregatedList; + + /** + * Verifies a NodeTypeAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTypeAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTypeAggregatedList; + + /** + * Creates a plain object from a NodeTypeAggregatedList message. Also converts values to other types if specified. + * @param message NodeTypeAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTypeAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTypeAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NodeTypeList. */ + interface INodeTypeList { + + /** NodeTypeList id */ + id?: (string|null); + + /** NodeTypeList items */ + items?: (google.cloud.compute.v1.INodeType[]|null); + + /** NodeTypeList kind */ + kind?: (string|null); + + /** NodeTypeList nextPageToken */ + nextPageToken?: (string|null); + + /** NodeTypeList selfLink */ + selfLink?: (string|null); + + /** NodeTypeList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NodeTypeList. */ + class NodeTypeList implements INodeTypeList { + + /** + * Constructs a new NodeTypeList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INodeTypeList); + + /** NodeTypeList id. */ + public id?: (string|null); + + /** NodeTypeList items. */ + public items: google.cloud.compute.v1.INodeType[]; + + /** NodeTypeList kind. */ + public kind?: (string|null); + + /** NodeTypeList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NodeTypeList selfLink. */ + public selfLink?: (string|null); + + /** NodeTypeList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NodeTypeList _id. */ + public _id?: "id"; + + /** NodeTypeList _kind. */ + public _kind?: "kind"; + + /** NodeTypeList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NodeTypeList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NodeTypeList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NodeTypeList instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTypeList instance + */ + public static create(properties?: google.cloud.compute.v1.INodeTypeList): google.cloud.compute.v1.NodeTypeList; + + /** + * Encodes the specified NodeTypeList message. Does not implicitly {@link google.cloud.compute.v1.NodeTypeList.verify|verify} messages. + * @param message NodeTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INodeTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTypeList.verify|verify} messages. + * @param message NodeTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INodeTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTypeList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NodeTypeList; + + /** + * Decodes a NodeTypeList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NodeTypeList; + + /** + * Verifies a NodeTypeList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTypeList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTypeList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NodeTypeList; + + /** + * Creates a plain object from a NodeTypeList message. Also converts values to other types if specified. + * @param message NodeTypeList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NodeTypeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTypeList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NotificationEndpointGrpcSettings. */ + interface INotificationEndpointGrpcSettings { + + /** NotificationEndpointGrpcSettings authority */ + authority?: (string|null); + + /** NotificationEndpointGrpcSettings endpoint */ + endpoint?: (string|null); + + /** NotificationEndpointGrpcSettings payloadName */ + payloadName?: (string|null); + + /** NotificationEndpointGrpcSettings resendInterval */ + resendInterval?: (google.cloud.compute.v1.IDuration|null); + + /** NotificationEndpointGrpcSettings retryDurationSec */ + retryDurationSec?: (number|null); + } + + /** Represents a NotificationEndpointGrpcSettings. */ + class NotificationEndpointGrpcSettings implements INotificationEndpointGrpcSettings { + + /** + * Constructs a new NotificationEndpointGrpcSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INotificationEndpointGrpcSettings); + + /** NotificationEndpointGrpcSettings authority. */ + public authority?: (string|null); + + /** NotificationEndpointGrpcSettings endpoint. */ + public endpoint?: (string|null); + + /** NotificationEndpointGrpcSettings payloadName. */ + public payloadName?: (string|null); + + /** NotificationEndpointGrpcSettings resendInterval. */ + public resendInterval?: (google.cloud.compute.v1.IDuration|null); + + /** NotificationEndpointGrpcSettings retryDurationSec. */ + public retryDurationSec?: (number|null); + + /** NotificationEndpointGrpcSettings _authority. */ + public _authority?: "authority"; + + /** NotificationEndpointGrpcSettings _endpoint. */ + public _endpoint?: "endpoint"; + + /** NotificationEndpointGrpcSettings _payloadName. */ + public _payloadName?: "payloadName"; + + /** NotificationEndpointGrpcSettings _resendInterval. */ + public _resendInterval?: "resendInterval"; + + /** NotificationEndpointGrpcSettings _retryDurationSec. */ + public _retryDurationSec?: "retryDurationSec"; + + /** + * Creates a new NotificationEndpointGrpcSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationEndpointGrpcSettings instance + */ + public static create(properties?: google.cloud.compute.v1.INotificationEndpointGrpcSettings): google.cloud.compute.v1.NotificationEndpointGrpcSettings; + + /** + * Encodes the specified NotificationEndpointGrpcSettings message. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointGrpcSettings.verify|verify} messages. + * @param message NotificationEndpointGrpcSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INotificationEndpointGrpcSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationEndpointGrpcSettings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointGrpcSettings.verify|verify} messages. + * @param message NotificationEndpointGrpcSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INotificationEndpointGrpcSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationEndpointGrpcSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationEndpointGrpcSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NotificationEndpointGrpcSettings; + + /** + * Decodes a NotificationEndpointGrpcSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationEndpointGrpcSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NotificationEndpointGrpcSettings; + + /** + * Verifies a NotificationEndpointGrpcSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationEndpointGrpcSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationEndpointGrpcSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NotificationEndpointGrpcSettings; + + /** + * Creates a plain object from a NotificationEndpointGrpcSettings message. Also converts values to other types if specified. + * @param message NotificationEndpointGrpcSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NotificationEndpointGrpcSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationEndpointGrpcSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NotificationEndpoint. */ + interface INotificationEndpoint { + + /** NotificationEndpoint creationTimestamp */ + creationTimestamp?: (string|null); + + /** NotificationEndpoint description */ + description?: (string|null); + + /** NotificationEndpoint grpcSettings */ + grpcSettings?: (google.cloud.compute.v1.INotificationEndpointGrpcSettings|null); + + /** NotificationEndpoint id */ + id?: (number|Long|string|null); + + /** NotificationEndpoint kind */ + kind?: (string|null); + + /** NotificationEndpoint name */ + name?: (string|null); + + /** NotificationEndpoint region */ + region?: (string|null); + + /** NotificationEndpoint selfLink */ + selfLink?: (string|null); + } + + /** Represents a NotificationEndpoint. */ + class NotificationEndpoint implements INotificationEndpoint { + + /** + * Constructs a new NotificationEndpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INotificationEndpoint); + + /** NotificationEndpoint creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** NotificationEndpoint description. */ + public description?: (string|null); + + /** NotificationEndpoint grpcSettings. */ + public grpcSettings?: (google.cloud.compute.v1.INotificationEndpointGrpcSettings|null); + + /** NotificationEndpoint id. */ + public id?: (number|Long|string|null); + + /** NotificationEndpoint kind. */ + public kind?: (string|null); + + /** NotificationEndpoint name. */ + public name?: (string|null); + + /** NotificationEndpoint region. */ + public region?: (string|null); + + /** NotificationEndpoint selfLink. */ + public selfLink?: (string|null); + + /** NotificationEndpoint _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** NotificationEndpoint _description. */ + public _description?: "description"; + + /** NotificationEndpoint _grpcSettings. */ + public _grpcSettings?: "grpcSettings"; + + /** NotificationEndpoint _id. */ + public _id?: "id"; + + /** NotificationEndpoint _kind. */ + public _kind?: "kind"; + + /** NotificationEndpoint _name. */ + public _name?: "name"; + + /** NotificationEndpoint _region. */ + public _region?: "region"; + + /** NotificationEndpoint _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new NotificationEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationEndpoint instance + */ + public static create(properties?: google.cloud.compute.v1.INotificationEndpoint): google.cloud.compute.v1.NotificationEndpoint; + + /** + * Encodes the specified NotificationEndpoint message. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpoint.verify|verify} messages. + * @param message NotificationEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INotificationEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationEndpoint message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpoint.verify|verify} messages. + * @param message NotificationEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INotificationEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationEndpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NotificationEndpoint; + + /** + * Decodes a NotificationEndpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NotificationEndpoint; + + /** + * Verifies a NotificationEndpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationEndpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationEndpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NotificationEndpoint; + + /** + * Creates a plain object from a NotificationEndpoint message. Also converts values to other types if specified. + * @param message NotificationEndpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NotificationEndpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationEndpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NotificationEndpointList. */ + interface INotificationEndpointList { + + /** NotificationEndpointList id */ + id?: (string|null); + + /** NotificationEndpointList items */ + items?: (google.cloud.compute.v1.INotificationEndpoint[]|null); + + /** NotificationEndpointList kind */ + kind?: (string|null); + + /** NotificationEndpointList nextPageToken */ + nextPageToken?: (string|null); + + /** NotificationEndpointList selfLink */ + selfLink?: (string|null); + + /** NotificationEndpointList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NotificationEndpointList. */ + class NotificationEndpointList implements INotificationEndpointList { + + /** + * Constructs a new NotificationEndpointList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INotificationEndpointList); + + /** NotificationEndpointList id. */ + public id?: (string|null); + + /** NotificationEndpointList items. */ + public items: google.cloud.compute.v1.INotificationEndpoint[]; + + /** NotificationEndpointList kind. */ + public kind?: (string|null); + + /** NotificationEndpointList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NotificationEndpointList selfLink. */ + public selfLink?: (string|null); + + /** NotificationEndpointList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NotificationEndpointList _id. */ + public _id?: "id"; + + /** NotificationEndpointList _kind. */ + public _kind?: "kind"; + + /** NotificationEndpointList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NotificationEndpointList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NotificationEndpointList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NotificationEndpointList instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationEndpointList instance + */ + public static create(properties?: google.cloud.compute.v1.INotificationEndpointList): google.cloud.compute.v1.NotificationEndpointList; + + /** + * Encodes the specified NotificationEndpointList message. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointList.verify|verify} messages. + * @param message NotificationEndpointList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INotificationEndpointList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationEndpointList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointList.verify|verify} messages. + * @param message NotificationEndpointList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INotificationEndpointList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationEndpointList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationEndpointList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NotificationEndpointList; + + /** + * Decodes a NotificationEndpointList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationEndpointList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NotificationEndpointList; + + /** + * Verifies a NotificationEndpointList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationEndpointList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationEndpointList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NotificationEndpointList; + + /** + * Creates a plain object from a NotificationEndpointList message. Also converts values to other types if specified. + * @param message NotificationEndpointList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NotificationEndpointList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationEndpointList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Error. */ + interface IError { + + /** Error errors */ + errors?: (google.cloud.compute.v1.IErrors[]|null); + } + + /** Represents an Error. */ + class Error implements IError { + + /** + * Constructs a new Error. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IError); + + /** Error errors. */ + public errors: google.cloud.compute.v1.IErrors[]; + + /** + * Creates a new Error instance using the specified properties. + * @param [properties] Properties to set + * @returns Error instance + */ + public static create(properties?: google.cloud.compute.v1.IError): google.cloud.compute.v1.Error; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.compute.v1.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Error.verify|verify} messages. + * @param message Error message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Error message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Error; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Error; + + /** + * Verifies an Error message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Error + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Error; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @param message Error + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Error, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Error to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Warnings. */ + interface IWarnings { + + /** Warnings code */ + code?: (google.cloud.compute.v1.Warnings.Code|keyof typeof google.cloud.compute.v1.Warnings.Code|null); + + /** Warnings data */ + data?: (google.cloud.compute.v1.IData[]|null); + + /** Warnings message */ + message?: (string|null); + } + + /** Represents a Warnings. */ + class Warnings implements IWarnings { + + /** + * Constructs a new Warnings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWarnings); + + /** Warnings code. */ + public code?: (google.cloud.compute.v1.Warnings.Code|keyof typeof google.cloud.compute.v1.Warnings.Code|null); + + /** Warnings data. */ + public data: google.cloud.compute.v1.IData[]; + + /** Warnings message. */ + public message?: (string|null); + + /** Warnings _code. */ + public _code?: "code"; + + /** Warnings _message. */ + public _message?: "message"; + + /** + * Creates a new Warnings instance using the specified properties. + * @param [properties] Properties to set + * @returns Warnings instance + */ + public static create(properties?: google.cloud.compute.v1.IWarnings): google.cloud.compute.v1.Warnings; + + /** + * Encodes the specified Warnings message. Does not implicitly {@link google.cloud.compute.v1.Warnings.verify|verify} messages. + * @param message Warnings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWarnings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Warnings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Warnings.verify|verify} messages. + * @param message Warnings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWarnings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Warnings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Warnings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Warnings; + + /** + * Decodes a Warnings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Warnings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Warnings; + + /** + * Verifies a Warnings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Warnings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Warnings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Warnings; + + /** + * Creates a plain object from a Warnings message. Also converts values to other types if specified. + * @param message Warnings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Warnings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Warnings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Warnings { + + /** Code enum. */ + enum Code { + UNDEFINED_CODE = 0, + CLEANUP_FAILED = 150308440, + DEPRECATED_RESOURCE_USED = 391835586, + DEPRECATED_TYPE_USED = 346526230, + DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 369442967, + EXPERIMENTAL_TYPE_USED = 451954443, + EXTERNAL_API_WARNING = 175546307, + FIELD_VALUE_OVERRIDEN = 329669423, + INJECTED_KERNELS_DEPRECATED = 417377419, + LARGE_DEPLOYMENT_WARNING = 481440678, + MISSING_TYPE_DEPENDENCY = 344505463, + NEXT_HOP_ADDRESS_NOT_ASSIGNED = 324964999, + NEXT_HOP_CANNOT_IP_FORWARD = 383382887, + NEXT_HOP_INSTANCE_NOT_FOUND = 464250446, + NEXT_HOP_INSTANCE_NOT_ON_NETWORK = 243758146, + NEXT_HOP_NOT_RUNNING = 417081265, + NOT_CRITICAL_ERROR = 105763924, + NO_RESULTS_ON_PAGE = 30036744, + PARTIAL_SUCCESS = 39966469, + REQUIRED_TOS_AGREEMENT = 3745539, + RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING = 496728641, + RESOURCE_NOT_DELETED = 168598460, + SCHEMA_VALIDATION_IGNORED = 275245642, + SINGLE_INSTANCE_PROPERTY_TEMPLATE = 268305617, + UNDECLARED_PROPERTIES = 390513439, + UNREACHABLE = 13328052 + } + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation clientOperationId */ + clientOperationId?: (string|null); + + /** Operation creationTimestamp */ + creationTimestamp?: (string|null); + + /** Operation description */ + description?: (string|null); + + /** Operation endTime */ + endTime?: (string|null); + + /** Operation error */ + error?: (google.cloud.compute.v1.IError|null); + + /** Operation httpErrorMessage */ + httpErrorMessage?: (string|null); + + /** Operation httpErrorStatusCode */ + httpErrorStatusCode?: (number|null); + + /** Operation id */ + id?: (number|Long|string|null); + + /** Operation insertTime */ + insertTime?: (string|null); + + /** Operation kind */ + kind?: (string|null); + + /** Operation name */ + name?: (string|null); + + /** Operation operationGroupId */ + operationGroupId?: (string|null); + + /** Operation operationType */ + operationType?: (string|null); + + /** Operation progress */ + progress?: (number|null); + + /** Operation region */ + region?: (string|null); + + /** Operation selfLink */ + selfLink?: (string|null); + + /** Operation startTime */ + startTime?: (string|null); + + /** Operation status */ + status?: (google.cloud.compute.v1.Operation.Status|keyof typeof google.cloud.compute.v1.Operation.Status|null); + + /** Operation statusMessage */ + statusMessage?: (string|null); + + /** Operation targetId */ + targetId?: (number|Long|string|null); + + /** Operation targetLink */ + targetLink?: (string|null); + + /** Operation user */ + user?: (string|null); + + /** Operation warnings */ + warnings?: (google.cloud.compute.v1.IWarnings[]|null); + + /** Operation zone */ + zone?: (string|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IOperation); + + /** Operation clientOperationId. */ + public clientOperationId?: (string|null); + + /** Operation creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Operation description. */ + public description?: (string|null); + + /** Operation endTime. */ + public endTime?: (string|null); + + /** Operation error. */ + public error?: (google.cloud.compute.v1.IError|null); + + /** Operation httpErrorMessage. */ + public httpErrorMessage?: (string|null); + + /** Operation httpErrorStatusCode. */ + public httpErrorStatusCode?: (number|null); + + /** Operation id. */ + public id?: (number|Long|string|null); + + /** Operation insertTime. */ + public insertTime?: (string|null); + + /** Operation kind. */ + public kind?: (string|null); + + /** Operation name. */ + public name?: (string|null); + + /** Operation operationGroupId. */ + public operationGroupId?: (string|null); + + /** Operation operationType. */ + public operationType?: (string|null); + + /** Operation progress. */ + public progress?: (number|null); + + /** Operation region. */ + public region?: (string|null); + + /** Operation selfLink. */ + public selfLink?: (string|null); + + /** Operation startTime. */ + public startTime?: (string|null); + + /** Operation status. */ + public status?: (google.cloud.compute.v1.Operation.Status|keyof typeof google.cloud.compute.v1.Operation.Status|null); + + /** Operation statusMessage. */ + public statusMessage?: (string|null); + + /** Operation targetId. */ + public targetId?: (number|Long|string|null); + + /** Operation targetLink. */ + public targetLink?: (string|null); + + /** Operation user. */ + public user?: (string|null); + + /** Operation warnings. */ + public warnings: google.cloud.compute.v1.IWarnings[]; + + /** Operation zone. */ + public zone?: (string|null); + + /** Operation _clientOperationId. */ + public _clientOperationId?: "clientOperationId"; + + /** Operation _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Operation _description. */ + public _description?: "description"; + + /** Operation _endTime. */ + public _endTime?: "endTime"; + + /** Operation _error. */ + public _error?: "error"; + + /** Operation _httpErrorMessage. */ + public _httpErrorMessage?: "httpErrorMessage"; + + /** Operation _httpErrorStatusCode. */ + public _httpErrorStatusCode?: "httpErrorStatusCode"; + + /** Operation _id. */ + public _id?: "id"; + + /** Operation _insertTime. */ + public _insertTime?: "insertTime"; + + /** Operation _kind. */ + public _kind?: "kind"; + + /** Operation _name. */ + public _name?: "name"; + + /** Operation _operationGroupId. */ + public _operationGroupId?: "operationGroupId"; + + /** Operation _operationType. */ + public _operationType?: "operationType"; + + /** Operation _progress. */ + public _progress?: "progress"; + + /** Operation _region. */ + public _region?: "region"; + + /** Operation _selfLink. */ + public _selfLink?: "selfLink"; + + /** Operation _startTime. */ + public _startTime?: "startTime"; + + /** Operation _status. */ + public _status?: "status"; + + /** Operation _statusMessage. */ + public _statusMessage?: "statusMessage"; + + /** Operation _targetId. */ + public _targetId?: "targetId"; + + /** Operation _targetLink. */ + public _targetLink?: "targetLink"; + + /** Operation _user. */ + public _user?: "user"; + + /** Operation _zone. */ + public _zone?: "zone"; + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.cloud.compute.v1.IOperation): google.cloud.compute.v1.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Operation { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + DONE = 2104194, + PENDING = 35394935, + RUNNING = 121282975 + } + } + + /** Properties of an OperationsScopedList. */ + interface IOperationsScopedList { + + /** OperationsScopedList operations */ + operations?: (google.cloud.compute.v1.IOperation[]|null); + + /** OperationsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an OperationsScopedList. */ + class OperationsScopedList implements IOperationsScopedList { + + /** + * Constructs a new OperationsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IOperationsScopedList); + + /** OperationsScopedList operations. */ + public operations: google.cloud.compute.v1.IOperation[]; + + /** OperationsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** OperationsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new OperationsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IOperationsScopedList): google.cloud.compute.v1.OperationsScopedList; + + /** + * Encodes the specified OperationsScopedList message. Does not implicitly {@link google.cloud.compute.v1.OperationsScopedList.verify|verify} messages. + * @param message OperationsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IOperationsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OperationsScopedList.verify|verify} messages. + * @param message OperationsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IOperationsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.OperationsScopedList; + + /** + * Decodes an OperationsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.OperationsScopedList; + + /** + * Verifies an OperationsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.OperationsScopedList; + + /** + * Creates a plain object from an OperationsScopedList message. Also converts values to other types if specified. + * @param message OperationsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.OperationsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationAggregatedList. */ + interface IOperationAggregatedList { + + /** OperationAggregatedList id */ + id?: (string|null); + + /** OperationAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IOperationsScopedList }|null); + + /** OperationAggregatedList kind */ + kind?: (string|null); + + /** OperationAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** OperationAggregatedList selfLink */ + selfLink?: (string|null); + + /** OperationAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** OperationAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an OperationAggregatedList. */ + class OperationAggregatedList implements IOperationAggregatedList { + + /** + * Constructs a new OperationAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IOperationAggregatedList); + + /** OperationAggregatedList id. */ + public id?: (string|null); + + /** OperationAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IOperationsScopedList }; + + /** OperationAggregatedList kind. */ + public kind?: (string|null); + + /** OperationAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** OperationAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** OperationAggregatedList unreachables. */ + public unreachables: string[]; + + /** OperationAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** OperationAggregatedList _id. */ + public _id?: "id"; + + /** OperationAggregatedList _kind. */ + public _kind?: "kind"; + + /** OperationAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** OperationAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** OperationAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new OperationAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IOperationAggregatedList): google.cloud.compute.v1.OperationAggregatedList; + + /** + * Encodes the specified OperationAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.OperationAggregatedList.verify|verify} messages. + * @param message OperationAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IOperationAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OperationAggregatedList.verify|verify} messages. + * @param message OperationAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IOperationAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.OperationAggregatedList; + + /** + * Decodes an OperationAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.OperationAggregatedList; + + /** + * Verifies an OperationAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.OperationAggregatedList; + + /** + * Creates a plain object from an OperationAggregatedList message. Also converts values to other types if specified. + * @param message OperationAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.OperationAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OperationList. */ + interface IOperationList { + + /** OperationList id */ + id?: (string|null); + + /** OperationList items */ + items?: (google.cloud.compute.v1.IOperation[]|null); + + /** OperationList kind */ + kind?: (string|null); + + /** OperationList nextPageToken */ + nextPageToken?: (string|null); + + /** OperationList selfLink */ + selfLink?: (string|null); + + /** OperationList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an OperationList. */ + class OperationList implements IOperationList { + + /** + * Constructs a new OperationList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IOperationList); + + /** OperationList id. */ + public id?: (string|null); + + /** OperationList items. */ + public items: google.cloud.compute.v1.IOperation[]; + + /** OperationList kind. */ + public kind?: (string|null); + + /** OperationList nextPageToken. */ + public nextPageToken?: (string|null); + + /** OperationList selfLink. */ + public selfLink?: (string|null); + + /** OperationList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** OperationList _id. */ + public _id?: "id"; + + /** OperationList _kind. */ + public _kind?: "kind"; + + /** OperationList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** OperationList _selfLink. */ + public _selfLink?: "selfLink"; + + /** OperationList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new OperationList instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationList instance + */ + public static create(properties?: google.cloud.compute.v1.IOperationList): google.cloud.compute.v1.OperationList; + + /** + * Encodes the specified OperationList message. Does not implicitly {@link google.cloud.compute.v1.OperationList.verify|verify} messages. + * @param message OperationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IOperationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OperationList.verify|verify} messages. + * @param message OperationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IOperationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.OperationList; + + /** + * Decodes an OperationList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.OperationList; + + /** + * Verifies an OperationList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.OperationList; + + /** + * Creates a plain object from an OperationList message. Also converts values to other types if specified. + * @param message OperationList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.OperationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroringForwardingRuleInfo. */ + interface IPacketMirroringForwardingRuleInfo { + + /** PacketMirroringForwardingRuleInfo canonicalUrl */ + canonicalUrl?: (string|null); + + /** PacketMirroringForwardingRuleInfo url */ + url?: (string|null); + } + + /** Represents a PacketMirroringForwardingRuleInfo. */ + class PacketMirroringForwardingRuleInfo implements IPacketMirroringForwardingRuleInfo { + + /** + * Constructs a new PacketMirroringForwardingRuleInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo); + + /** PacketMirroringForwardingRuleInfo canonicalUrl. */ + public canonicalUrl?: (string|null); + + /** PacketMirroringForwardingRuleInfo url. */ + public url?: (string|null); + + /** PacketMirroringForwardingRuleInfo _canonicalUrl. */ + public _canonicalUrl?: "canonicalUrl"; + + /** PacketMirroringForwardingRuleInfo _url. */ + public _url?: "url"; + + /** + * Creates a new PacketMirroringForwardingRuleInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringForwardingRuleInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo): google.cloud.compute.v1.PacketMirroringForwardingRuleInfo; + + /** + * Encodes the specified PacketMirroringForwardingRuleInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.verify|verify} messages. + * @param message PacketMirroringForwardingRuleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringForwardingRuleInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.verify|verify} messages. + * @param message PacketMirroringForwardingRuleInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringForwardingRuleInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringForwardingRuleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringForwardingRuleInfo; + + /** + * Decodes a PacketMirroringForwardingRuleInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringForwardingRuleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringForwardingRuleInfo; + + /** + * Verifies a PacketMirroringForwardingRuleInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringForwardingRuleInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringForwardingRuleInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringForwardingRuleInfo; + + /** + * Creates a plain object from a PacketMirroringForwardingRuleInfo message. Also converts values to other types if specified. + * @param message PacketMirroringForwardingRuleInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringForwardingRuleInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringForwardingRuleInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroringFilter. */ + interface IPacketMirroringFilter { + + /** PacketMirroringFilter IPProtocols */ + IPProtocols?: (string[]|null); + + /** PacketMirroringFilter cidrRanges */ + cidrRanges?: (string[]|null); + + /** PacketMirroringFilter direction */ + direction?: (google.cloud.compute.v1.PacketMirroringFilter.Direction|keyof typeof google.cloud.compute.v1.PacketMirroringFilter.Direction|null); + } + + /** Represents a PacketMirroringFilter. */ + class PacketMirroringFilter implements IPacketMirroringFilter { + + /** + * Constructs a new PacketMirroringFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringFilter); + + /** PacketMirroringFilter IPProtocols. */ + public IPProtocols: string[]; + + /** PacketMirroringFilter cidrRanges. */ + public cidrRanges: string[]; + + /** PacketMirroringFilter direction. */ + public direction?: (google.cloud.compute.v1.PacketMirroringFilter.Direction|keyof typeof google.cloud.compute.v1.PacketMirroringFilter.Direction|null); + + /** PacketMirroringFilter _direction. */ + public _direction?: "direction"; + + /** + * Creates a new PacketMirroringFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringFilter instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringFilter): google.cloud.compute.v1.PacketMirroringFilter; + + /** + * Encodes the specified PacketMirroringFilter message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringFilter.verify|verify} messages. + * @param message PacketMirroringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringFilter message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringFilter.verify|verify} messages. + * @param message PacketMirroringFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringFilter; + + /** + * Decodes a PacketMirroringFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringFilter; + + /** + * Verifies a PacketMirroringFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringFilter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringFilter; + + /** + * Creates a plain object from a PacketMirroringFilter message. Also converts values to other types if specified. + * @param message PacketMirroringFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PacketMirroringFilter { + + /** Direction enum. */ + enum Direction { + UNDEFINED_DIRECTION = 0, + BOTH = 2044801, + EGRESS = 432880501, + INGRESS = 516931221 + } + } + + /** Properties of a PacketMirroringMirroredResourceInfo. */ + interface IPacketMirroringMirroredResourceInfo { + + /** PacketMirroringMirroredResourceInfo instances */ + instances?: (google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo[]|null); + + /** PacketMirroringMirroredResourceInfo subnetworks */ + subnetworks?: (google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo[]|null); + + /** PacketMirroringMirroredResourceInfo tags */ + tags?: (string[]|null); + } + + /** Represents a PacketMirroringMirroredResourceInfo. */ + class PacketMirroringMirroredResourceInfo implements IPacketMirroringMirroredResourceInfo { + + /** + * Constructs a new PacketMirroringMirroredResourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo); + + /** PacketMirroringMirroredResourceInfo instances. */ + public instances: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo[]; + + /** PacketMirroringMirroredResourceInfo subnetworks. */ + public subnetworks: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo[]; + + /** PacketMirroringMirroredResourceInfo tags. */ + public tags: string[]; + + /** + * Creates a new PacketMirroringMirroredResourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringMirroredResourceInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo): google.cloud.compute.v1.PacketMirroringMirroredResourceInfo; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.verify|verify} messages. + * @param message PacketMirroringMirroredResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.verify|verify} messages. + * @param message PacketMirroringMirroredResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringMirroredResourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringMirroredResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringMirroredResourceInfo; + + /** + * Decodes a PacketMirroringMirroredResourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringMirroredResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringMirroredResourceInfo; + + /** + * Verifies a PacketMirroringMirroredResourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringMirroredResourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringMirroredResourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringMirroredResourceInfo; + + /** + * Creates a plain object from a PacketMirroringMirroredResourceInfo message. Also converts values to other types if specified. + * @param message PacketMirroringMirroredResourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringMirroredResourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringMirroredResourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroringNetworkInfo. */ + interface IPacketMirroringNetworkInfo { + + /** PacketMirroringNetworkInfo canonicalUrl */ + canonicalUrl?: (string|null); + + /** PacketMirroringNetworkInfo url */ + url?: (string|null); + } + + /** Represents a PacketMirroringNetworkInfo. */ + class PacketMirroringNetworkInfo implements IPacketMirroringNetworkInfo { + + /** + * Constructs a new PacketMirroringNetworkInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringNetworkInfo); + + /** PacketMirroringNetworkInfo canonicalUrl. */ + public canonicalUrl?: (string|null); + + /** PacketMirroringNetworkInfo url. */ + public url?: (string|null); + + /** PacketMirroringNetworkInfo _canonicalUrl. */ + public _canonicalUrl?: "canonicalUrl"; + + /** PacketMirroringNetworkInfo _url. */ + public _url?: "url"; + + /** + * Creates a new PacketMirroringNetworkInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringNetworkInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringNetworkInfo): google.cloud.compute.v1.PacketMirroringNetworkInfo; + + /** + * Encodes the specified PacketMirroringNetworkInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringNetworkInfo.verify|verify} messages. + * @param message PacketMirroringNetworkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringNetworkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringNetworkInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringNetworkInfo.verify|verify} messages. + * @param message PacketMirroringNetworkInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringNetworkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringNetworkInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringNetworkInfo; + + /** + * Decodes a PacketMirroringNetworkInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringNetworkInfo; + + /** + * Verifies a PacketMirroringNetworkInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringNetworkInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringNetworkInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringNetworkInfo; + + /** + * Creates a plain object from a PacketMirroringNetworkInfo message. Also converts values to other types if specified. + * @param message PacketMirroringNetworkInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringNetworkInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringNetworkInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroring. */ + interface IPacketMirroring { + + /** PacketMirroring collectorIlb */ + collectorIlb?: (google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo|null); + + /** PacketMirroring creationTimestamp */ + creationTimestamp?: (string|null); + + /** PacketMirroring description */ + description?: (string|null); + + /** PacketMirroring enable */ + enable?: (google.cloud.compute.v1.PacketMirroring.Enable|keyof typeof google.cloud.compute.v1.PacketMirroring.Enable|null); + + /** PacketMirroring filter */ + filter?: (google.cloud.compute.v1.IPacketMirroringFilter|null); + + /** PacketMirroring id */ + id?: (number|Long|string|null); + + /** PacketMirroring kind */ + kind?: (string|null); + + /** PacketMirroring mirroredResources */ + mirroredResources?: (google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo|null); + + /** PacketMirroring name */ + name?: (string|null); + + /** PacketMirroring network */ + network?: (google.cloud.compute.v1.IPacketMirroringNetworkInfo|null); + + /** PacketMirroring priority */ + priority?: (number|null); + + /** PacketMirroring region */ + region?: (string|null); + + /** PacketMirroring selfLink */ + selfLink?: (string|null); + } + + /** Represents a PacketMirroring. */ + class PacketMirroring implements IPacketMirroring { + + /** + * Constructs a new PacketMirroring. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroring); + + /** PacketMirroring collectorIlb. */ + public collectorIlb?: (google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo|null); + + /** PacketMirroring creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** PacketMirroring description. */ + public description?: (string|null); + + /** PacketMirroring enable. */ + public enable?: (google.cloud.compute.v1.PacketMirroring.Enable|keyof typeof google.cloud.compute.v1.PacketMirroring.Enable|null); + + /** PacketMirroring filter. */ + public filter?: (google.cloud.compute.v1.IPacketMirroringFilter|null); + + /** PacketMirroring id. */ + public id?: (number|Long|string|null); + + /** PacketMirroring kind. */ + public kind?: (string|null); + + /** PacketMirroring mirroredResources. */ + public mirroredResources?: (google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo|null); + + /** PacketMirroring name. */ + public name?: (string|null); + + /** PacketMirroring network. */ + public network?: (google.cloud.compute.v1.IPacketMirroringNetworkInfo|null); + + /** PacketMirroring priority. */ + public priority?: (number|null); + + /** PacketMirroring region. */ + public region?: (string|null); + + /** PacketMirroring selfLink. */ + public selfLink?: (string|null); + + /** PacketMirroring _collectorIlb. */ + public _collectorIlb?: "collectorIlb"; + + /** PacketMirroring _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** PacketMirroring _description. */ + public _description?: "description"; + + /** PacketMirroring _enable. */ + public _enable?: "enable"; + + /** PacketMirroring _filter. */ + public _filter?: "filter"; + + /** PacketMirroring _id. */ + public _id?: "id"; + + /** PacketMirroring _kind. */ + public _kind?: "kind"; + + /** PacketMirroring _mirroredResources. */ + public _mirroredResources?: "mirroredResources"; + + /** PacketMirroring _name. */ + public _name?: "name"; + + /** PacketMirroring _network. */ + public _network?: "network"; + + /** PacketMirroring _priority. */ + public _priority?: "priority"; + + /** PacketMirroring _region. */ + public _region?: "region"; + + /** PacketMirroring _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new PacketMirroring instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroring instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroring): google.cloud.compute.v1.PacketMirroring; + + /** + * Encodes the specified PacketMirroring message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroring.verify|verify} messages. + * @param message PacketMirroring message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroring, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroring message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroring.verify|verify} messages. + * @param message PacketMirroring message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroring, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroring message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroring + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroring; + + /** + * Decodes a PacketMirroring message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroring + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroring; + + /** + * Verifies a PacketMirroring message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroring message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroring + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroring; + + /** + * Creates a plain object from a PacketMirroring message. Also converts values to other types if specified. + * @param message PacketMirroring + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroring, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroring to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PacketMirroring { + + /** Enable enum. */ + enum Enable { + UNDEFINED_ENABLE = 0, + FALSE = 66658563, + TRUE = 2583950 + } + } + + /** Properties of a PacketMirroringsScopedList. */ + interface IPacketMirroringsScopedList { + + /** PacketMirroringsScopedList packetMirrorings */ + packetMirrorings?: (google.cloud.compute.v1.IPacketMirroring[]|null); + + /** PacketMirroringsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a PacketMirroringsScopedList. */ + class PacketMirroringsScopedList implements IPacketMirroringsScopedList { + + /** + * Constructs a new PacketMirroringsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringsScopedList); + + /** PacketMirroringsScopedList packetMirrorings. */ + public packetMirrorings: google.cloud.compute.v1.IPacketMirroring[]; + + /** PacketMirroringsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** PacketMirroringsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new PacketMirroringsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringsScopedList): google.cloud.compute.v1.PacketMirroringsScopedList; + + /** + * Encodes the specified PacketMirroringsScopedList message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringsScopedList.verify|verify} messages. + * @param message PacketMirroringsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringsScopedList.verify|verify} messages. + * @param message PacketMirroringsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringsScopedList; + + /** + * Decodes a PacketMirroringsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringsScopedList; + + /** + * Verifies a PacketMirroringsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringsScopedList; + + /** + * Creates a plain object from a PacketMirroringsScopedList message. Also converts values to other types if specified. + * @param message PacketMirroringsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroringAggregatedList. */ + interface IPacketMirroringAggregatedList { + + /** PacketMirroringAggregatedList id */ + id?: (string|null); + + /** PacketMirroringAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IPacketMirroringsScopedList }|null); + + /** PacketMirroringAggregatedList kind */ + kind?: (string|null); + + /** PacketMirroringAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** PacketMirroringAggregatedList selfLink */ + selfLink?: (string|null); + + /** PacketMirroringAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** PacketMirroringAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a PacketMirroringAggregatedList. */ + class PacketMirroringAggregatedList implements IPacketMirroringAggregatedList { + + /** + * Constructs a new PacketMirroringAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringAggregatedList); + + /** PacketMirroringAggregatedList id. */ + public id?: (string|null); + + /** PacketMirroringAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IPacketMirroringsScopedList }; + + /** PacketMirroringAggregatedList kind. */ + public kind?: (string|null); + + /** PacketMirroringAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** PacketMirroringAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** PacketMirroringAggregatedList unreachables. */ + public unreachables: string[]; + + /** PacketMirroringAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** PacketMirroringAggregatedList _id. */ + public _id?: "id"; + + /** PacketMirroringAggregatedList _kind. */ + public _kind?: "kind"; + + /** PacketMirroringAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** PacketMirroringAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** PacketMirroringAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new PacketMirroringAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringAggregatedList): google.cloud.compute.v1.PacketMirroringAggregatedList; + + /** + * Encodes the specified PacketMirroringAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringAggregatedList.verify|verify} messages. + * @param message PacketMirroringAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringAggregatedList.verify|verify} messages. + * @param message PacketMirroringAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringAggregatedList; + + /** + * Decodes a PacketMirroringAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringAggregatedList; + + /** + * Verifies a PacketMirroringAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringAggregatedList; + + /** + * Creates a plain object from a PacketMirroringAggregatedList message. Also converts values to other types if specified. + * @param message PacketMirroringAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroringList. */ + interface IPacketMirroringList { + + /** PacketMirroringList id */ + id?: (string|null); + + /** PacketMirroringList items */ + items?: (google.cloud.compute.v1.IPacketMirroring[]|null); + + /** PacketMirroringList kind */ + kind?: (string|null); + + /** PacketMirroringList nextPageToken */ + nextPageToken?: (string|null); + + /** PacketMirroringList selfLink */ + selfLink?: (string|null); + + /** PacketMirroringList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a PacketMirroringList. */ + class PacketMirroringList implements IPacketMirroringList { + + /** + * Constructs a new PacketMirroringList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringList); + + /** PacketMirroringList id. */ + public id?: (string|null); + + /** PacketMirroringList items. */ + public items: google.cloud.compute.v1.IPacketMirroring[]; + + /** PacketMirroringList kind. */ + public kind?: (string|null); + + /** PacketMirroringList nextPageToken. */ + public nextPageToken?: (string|null); + + /** PacketMirroringList selfLink. */ + public selfLink?: (string|null); + + /** PacketMirroringList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** PacketMirroringList _id. */ + public _id?: "id"; + + /** PacketMirroringList _kind. */ + public _kind?: "kind"; + + /** PacketMirroringList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** PacketMirroringList _selfLink. */ + public _selfLink?: "selfLink"; + + /** PacketMirroringList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new PacketMirroringList instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringList instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringList): google.cloud.compute.v1.PacketMirroringList; + + /** + * Encodes the specified PacketMirroringList message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringList.verify|verify} messages. + * @param message PacketMirroringList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringList.verify|verify} messages. + * @param message PacketMirroringList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringList; + + /** + * Decodes a PacketMirroringList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringList; + + /** + * Verifies a PacketMirroringList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringList; + + /** + * Creates a plain object from a PacketMirroringList message. Also converts values to other types if specified. + * @param message PacketMirroringList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroringMirroredResourceInfoInstanceInfo. */ + interface IPacketMirroringMirroredResourceInfoInstanceInfo { + + /** PacketMirroringMirroredResourceInfoInstanceInfo canonicalUrl */ + canonicalUrl?: (string|null); + + /** PacketMirroringMirroredResourceInfoInstanceInfo url */ + url?: (string|null); + } + + /** Represents a PacketMirroringMirroredResourceInfoInstanceInfo. */ + class PacketMirroringMirroredResourceInfoInstanceInfo implements IPacketMirroringMirroredResourceInfoInstanceInfo { + + /** + * Constructs a new PacketMirroringMirroredResourceInfoInstanceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo); + + /** PacketMirroringMirroredResourceInfoInstanceInfo canonicalUrl. */ + public canonicalUrl?: (string|null); + + /** PacketMirroringMirroredResourceInfoInstanceInfo url. */ + public url?: (string|null); + + /** PacketMirroringMirroredResourceInfoInstanceInfo _canonicalUrl. */ + public _canonicalUrl?: "canonicalUrl"; + + /** PacketMirroringMirroredResourceInfoInstanceInfo _url. */ + public _url?: "url"; + + /** + * Creates a new PacketMirroringMirroredResourceInfoInstanceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringMirroredResourceInfoInstanceInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoInstanceInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.verify|verify} messages. + * @param message PacketMirroringMirroredResourceInfoInstanceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoInstanceInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.verify|verify} messages. + * @param message PacketMirroringMirroredResourceInfoInstanceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringMirroredResourceInfoInstanceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringMirroredResourceInfoInstanceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo; + + /** + * Decodes a PacketMirroringMirroredResourceInfoInstanceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringMirroredResourceInfoInstanceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo; + + /** + * Verifies a PacketMirroringMirroredResourceInfoInstanceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringMirroredResourceInfoInstanceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringMirroredResourceInfoInstanceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo; + + /** + * Creates a plain object from a PacketMirroringMirroredResourceInfoInstanceInfo message. Also converts values to other types if specified. + * @param message PacketMirroringMirroredResourceInfoInstanceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringMirroredResourceInfoInstanceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PacketMirroringMirroredResourceInfoSubnetInfo. */ + interface IPacketMirroringMirroredResourceInfoSubnetInfo { + + /** PacketMirroringMirroredResourceInfoSubnetInfo canonicalUrl */ + canonicalUrl?: (string|null); + + /** PacketMirroringMirroredResourceInfoSubnetInfo url */ + url?: (string|null); + } + + /** Represents a PacketMirroringMirroredResourceInfoSubnetInfo. */ + class PacketMirroringMirroredResourceInfoSubnetInfo implements IPacketMirroringMirroredResourceInfoSubnetInfo { + + /** + * Constructs a new PacketMirroringMirroredResourceInfoSubnetInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo); + + /** PacketMirroringMirroredResourceInfoSubnetInfo canonicalUrl. */ + public canonicalUrl?: (string|null); + + /** PacketMirroringMirroredResourceInfoSubnetInfo url. */ + public url?: (string|null); + + /** PacketMirroringMirroredResourceInfoSubnetInfo _canonicalUrl. */ + public _canonicalUrl?: "canonicalUrl"; + + /** PacketMirroringMirroredResourceInfoSubnetInfo _url. */ + public _url?: "url"; + + /** + * Creates a new PacketMirroringMirroredResourceInfoSubnetInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PacketMirroringMirroredResourceInfoSubnetInfo instance + */ + public static create(properties?: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoSubnetInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.verify|verify} messages. + * @param message PacketMirroringMirroredResourceInfoSubnetInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoSubnetInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.verify|verify} messages. + * @param message PacketMirroringMirroredResourceInfoSubnetInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PacketMirroringMirroredResourceInfoSubnetInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PacketMirroringMirroredResourceInfoSubnetInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo; + + /** + * Decodes a PacketMirroringMirroredResourceInfoSubnetInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PacketMirroringMirroredResourceInfoSubnetInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo; + + /** + * Verifies a PacketMirroringMirroredResourceInfoSubnetInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PacketMirroringMirroredResourceInfoSubnetInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PacketMirroringMirroredResourceInfoSubnetInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo; + + /** + * Creates a plain object from a PacketMirroringMirroredResourceInfoSubnetInfo message. Also converts values to other types if specified. + * @param message PacketMirroringMirroredResourceInfoSubnetInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PacketMirroringMirroredResourceInfoSubnetInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PathRule. */ + interface IPathRule { + + /** PathRule paths */ + paths?: (string[]|null); + + /** PathRule routeAction */ + routeAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** PathRule service */ + service?: (string|null); + + /** PathRule urlRedirect */ + urlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + } + + /** Represents a PathRule. */ + class PathRule implements IPathRule { + + /** + * Constructs a new PathRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPathRule); + + /** PathRule paths. */ + public paths: string[]; + + /** PathRule routeAction. */ + public routeAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** PathRule service. */ + public service?: (string|null); + + /** PathRule urlRedirect. */ + public urlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + + /** PathRule _routeAction. */ + public _routeAction?: "routeAction"; + + /** PathRule _service. */ + public _service?: "service"; + + /** PathRule _urlRedirect. */ + public _urlRedirect?: "urlRedirect"; + + /** + * Creates a new PathRule instance using the specified properties. + * @param [properties] Properties to set + * @returns PathRule instance + */ + public static create(properties?: google.cloud.compute.v1.IPathRule): google.cloud.compute.v1.PathRule; + + /** + * Encodes the specified PathRule message. Does not implicitly {@link google.cloud.compute.v1.PathRule.verify|verify} messages. + * @param message PathRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPathRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PathRule.verify|verify} messages. + * @param message PathRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPathRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PathRule; + + /** + * Decodes a PathRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PathRule; + + /** + * Verifies a PathRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PathRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PathRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PathRule; + + /** + * Creates a plain object from a PathRule message. Also converts values to other types if specified. + * @param message PathRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PathRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PathMatcher. */ + interface IPathMatcher { + + /** PathMatcher defaultRouteAction */ + defaultRouteAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** PathMatcher defaultService */ + defaultService?: (string|null); + + /** PathMatcher defaultUrlRedirect */ + defaultUrlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + + /** PathMatcher description */ + description?: (string|null); + + /** PathMatcher headerAction */ + headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** PathMatcher name */ + name?: (string|null); + + /** PathMatcher pathRules */ + pathRules?: (google.cloud.compute.v1.IPathRule[]|null); + + /** PathMatcher routeRules */ + routeRules?: (google.cloud.compute.v1.IHttpRouteRule[]|null); + } + + /** Represents a PathMatcher. */ + class PathMatcher implements IPathMatcher { + + /** + * Constructs a new PathMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPathMatcher); + + /** PathMatcher defaultRouteAction. */ + public defaultRouteAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** PathMatcher defaultService. */ + public defaultService?: (string|null); + + /** PathMatcher defaultUrlRedirect. */ + public defaultUrlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + + /** PathMatcher description. */ + public description?: (string|null); + + /** PathMatcher headerAction. */ + public headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** PathMatcher name. */ + public name?: (string|null); + + /** PathMatcher pathRules. */ + public pathRules: google.cloud.compute.v1.IPathRule[]; + + /** PathMatcher routeRules. */ + public routeRules: google.cloud.compute.v1.IHttpRouteRule[]; + + /** PathMatcher _defaultRouteAction. */ + public _defaultRouteAction?: "defaultRouteAction"; + + /** PathMatcher _defaultService. */ + public _defaultService?: "defaultService"; + + /** PathMatcher _defaultUrlRedirect. */ + public _defaultUrlRedirect?: "defaultUrlRedirect"; + + /** PathMatcher _description. */ + public _description?: "description"; + + /** PathMatcher _headerAction. */ + public _headerAction?: "headerAction"; + + /** PathMatcher _name. */ + public _name?: "name"; + + /** + * Creates a new PathMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns PathMatcher instance + */ + public static create(properties?: google.cloud.compute.v1.IPathMatcher): google.cloud.compute.v1.PathMatcher; + + /** + * Encodes the specified PathMatcher message. Does not implicitly {@link google.cloud.compute.v1.PathMatcher.verify|verify} messages. + * @param message PathMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPathMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathMatcher message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PathMatcher.verify|verify} messages. + * @param message PathMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPathMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PathMatcher; + + /** + * Decodes a PathMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PathMatcher; + + /** + * Verifies a PathMatcher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PathMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PathMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PathMatcher; + + /** + * Creates a plain object from a PathMatcher message. Also converts values to other types if specified. + * @param message PathMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PathMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Rule. */ + interface IRule { + + /** Rule action */ + action?: (google.cloud.compute.v1.Rule.Action|keyof typeof google.cloud.compute.v1.Rule.Action|null); + + /** Rule conditions */ + conditions?: (google.cloud.compute.v1.ICondition[]|null); + + /** Rule description */ + description?: (string|null); + + /** Rule ins */ + ins?: (string[]|null); + + /** Rule logConfigs */ + logConfigs?: (google.cloud.compute.v1.ILogConfig[]|null); + + /** Rule notIns */ + notIns?: (string[]|null); + + /** Rule permissions */ + permissions?: (string[]|null); + } + + /** Represents a Rule. */ + class Rule implements IRule { + + /** + * Constructs a new Rule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRule); + + /** Rule action. */ + public action?: (google.cloud.compute.v1.Rule.Action|keyof typeof google.cloud.compute.v1.Rule.Action|null); + + /** Rule conditions. */ + public conditions: google.cloud.compute.v1.ICondition[]; + + /** Rule description. */ + public description?: (string|null); + + /** Rule ins. */ + public ins: string[]; + + /** Rule logConfigs. */ + public logConfigs: google.cloud.compute.v1.ILogConfig[]; + + /** Rule notIns. */ + public notIns: string[]; + + /** Rule permissions. */ + public permissions: string[]; + + /** Rule _action. */ + public _action?: "action"; + + /** Rule _description. */ + public _description?: "description"; + + /** + * Creates a new Rule instance using the specified properties. + * @param [properties] Properties to set + * @returns Rule instance + */ + public static create(properties?: google.cloud.compute.v1.IRule): google.cloud.compute.v1.Rule; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.compute.v1.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Rule; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Rule; + + /** + * Verifies a Rule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Rule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Rule; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @param message Rule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Rule { + + /** Action enum. */ + enum Action { + UNDEFINED_ACTION = 0, + ALLOW = 62368553, + ALLOW_WITH_LOG = 76034177, + DENY = 2094604, + DENY_WITH_LOG = 351433982, + LOG = 75556, + NO_ACTION = 260643444 + } + } + + /** Properties of a WafExpressionSet. */ + interface IWafExpressionSet { + + /** WafExpressionSet aliases */ + aliases?: (string[]|null); + + /** WafExpressionSet expressions */ + expressions?: (google.cloud.compute.v1.IWafExpressionSetExpression[]|null); + + /** WafExpressionSet id */ + id?: (string|null); + } + + /** Represents a WafExpressionSet. */ + class WafExpressionSet implements IWafExpressionSet { + + /** + * Constructs a new WafExpressionSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWafExpressionSet); + + /** WafExpressionSet aliases. */ + public aliases: string[]; + + /** WafExpressionSet expressions. */ + public expressions: google.cloud.compute.v1.IWafExpressionSetExpression[]; + + /** WafExpressionSet id. */ + public id?: (string|null); + + /** WafExpressionSet _id. */ + public _id?: "id"; + + /** + * Creates a new WafExpressionSet instance using the specified properties. + * @param [properties] Properties to set + * @returns WafExpressionSet instance + */ + public static create(properties?: google.cloud.compute.v1.IWafExpressionSet): google.cloud.compute.v1.WafExpressionSet; + + /** + * Encodes the specified WafExpressionSet message. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSet.verify|verify} messages. + * @param message WafExpressionSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWafExpressionSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WafExpressionSet message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSet.verify|verify} messages. + * @param message WafExpressionSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWafExpressionSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WafExpressionSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WafExpressionSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.WafExpressionSet; + + /** + * Decodes a WafExpressionSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WafExpressionSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.WafExpressionSet; + + /** + * Verifies a WafExpressionSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WafExpressionSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WafExpressionSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.WafExpressionSet; + + /** + * Creates a plain object from a WafExpressionSet message. Also converts values to other types if specified. + * @param message WafExpressionSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.WafExpressionSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WafExpressionSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PreconfiguredWafSet. */ + interface IPreconfiguredWafSet { + + /** PreconfiguredWafSet expressionSets */ + expressionSets?: (google.cloud.compute.v1.IWafExpressionSet[]|null); + } + + /** Represents a PreconfiguredWafSet. */ + class PreconfiguredWafSet implements IPreconfiguredWafSet { + + /** + * Constructs a new PreconfiguredWafSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPreconfiguredWafSet); + + /** PreconfiguredWafSet expressionSets. */ + public expressionSets: google.cloud.compute.v1.IWafExpressionSet[]; + + /** + * Creates a new PreconfiguredWafSet instance using the specified properties. + * @param [properties] Properties to set + * @returns PreconfiguredWafSet instance + */ + public static create(properties?: google.cloud.compute.v1.IPreconfiguredWafSet): google.cloud.compute.v1.PreconfiguredWafSet; + + /** + * Encodes the specified PreconfiguredWafSet message. Does not implicitly {@link google.cloud.compute.v1.PreconfiguredWafSet.verify|verify} messages. + * @param message PreconfiguredWafSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPreconfiguredWafSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreconfiguredWafSet message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreconfiguredWafSet.verify|verify} messages. + * @param message PreconfiguredWafSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPreconfiguredWafSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreconfiguredWafSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreconfiguredWafSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PreconfiguredWafSet; + + /** + * Decodes a PreconfiguredWafSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreconfiguredWafSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PreconfiguredWafSet; + + /** + * Verifies a PreconfiguredWafSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreconfiguredWafSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreconfiguredWafSet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PreconfiguredWafSet; + + /** + * Creates a plain object from a PreconfiguredWafSet message. Also converts values to other types if specified. + * @param message PreconfiguredWafSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PreconfiguredWafSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreconfiguredWafSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PreservedStatePreservedDisk. */ + interface IPreservedStatePreservedDisk { + + /** PreservedStatePreservedDisk autoDelete */ + autoDelete?: (google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete|keyof typeof google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete|null); + + /** PreservedStatePreservedDisk mode */ + mode?: (google.cloud.compute.v1.PreservedStatePreservedDisk.Mode|keyof typeof google.cloud.compute.v1.PreservedStatePreservedDisk.Mode|null); + + /** PreservedStatePreservedDisk source */ + source?: (string|null); + } + + /** Represents a PreservedStatePreservedDisk. */ + class PreservedStatePreservedDisk implements IPreservedStatePreservedDisk { + + /** + * Constructs a new PreservedStatePreservedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPreservedStatePreservedDisk); + + /** PreservedStatePreservedDisk autoDelete. */ + public autoDelete?: (google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete|keyof typeof google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete|null); + + /** PreservedStatePreservedDisk mode. */ + public mode?: (google.cloud.compute.v1.PreservedStatePreservedDisk.Mode|keyof typeof google.cloud.compute.v1.PreservedStatePreservedDisk.Mode|null); + + /** PreservedStatePreservedDisk source. */ + public source?: (string|null); + + /** PreservedStatePreservedDisk _autoDelete. */ + public _autoDelete?: "autoDelete"; + + /** PreservedStatePreservedDisk _mode. */ + public _mode?: "mode"; + + /** PreservedStatePreservedDisk _source. */ + public _source?: "source"; + + /** + * Creates a new PreservedStatePreservedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns PreservedStatePreservedDisk instance + */ + public static create(properties?: google.cloud.compute.v1.IPreservedStatePreservedDisk): google.cloud.compute.v1.PreservedStatePreservedDisk; + + /** + * Encodes the specified PreservedStatePreservedDisk message. Does not implicitly {@link google.cloud.compute.v1.PreservedStatePreservedDisk.verify|verify} messages. + * @param message PreservedStatePreservedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPreservedStatePreservedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreservedStatePreservedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreservedStatePreservedDisk.verify|verify} messages. + * @param message PreservedStatePreservedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPreservedStatePreservedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreservedStatePreservedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreservedStatePreservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PreservedStatePreservedDisk; + + /** + * Decodes a PreservedStatePreservedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreservedStatePreservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PreservedStatePreservedDisk; + + /** + * Verifies a PreservedStatePreservedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreservedStatePreservedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreservedStatePreservedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PreservedStatePreservedDisk; + + /** + * Creates a plain object from a PreservedStatePreservedDisk message. Also converts values to other types if specified. + * @param message PreservedStatePreservedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PreservedStatePreservedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreservedStatePreservedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PreservedStatePreservedDisk { + + /** AutoDelete enum. */ + enum AutoDelete { + UNDEFINED_AUTO_DELETE = 0, + NEVER = 74175084, + ON_PERMANENT_INSTANCE_DELETION = 95727719 + } + + /** Mode enum. */ + enum Mode { + UNDEFINED_MODE = 0, + READ_ONLY = 91950261, + READ_WRITE = 173607894 + } + } + + /** Properties of a Quota. */ + interface IQuota { + + /** Quota limit */ + limit?: (number|null); + + /** Quota metric */ + metric?: (google.cloud.compute.v1.Quota.Metric|keyof typeof google.cloud.compute.v1.Quota.Metric|null); + + /** Quota owner */ + owner?: (string|null); + + /** Quota usage */ + usage?: (number|null); + } + + /** Represents a Quota. */ + class Quota implements IQuota { + + /** + * Constructs a new Quota. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IQuota); + + /** Quota limit. */ + public limit?: (number|null); + + /** Quota metric. */ + public metric?: (google.cloud.compute.v1.Quota.Metric|keyof typeof google.cloud.compute.v1.Quota.Metric|null); + + /** Quota owner. */ + public owner?: (string|null); + + /** Quota usage. */ + public usage?: (number|null); + + /** Quota _limit. */ + public _limit?: "limit"; + + /** Quota _metric. */ + public _metric?: "metric"; + + /** Quota _owner. */ + public _owner?: "owner"; + + /** Quota _usage. */ + public _usage?: "usage"; + + /** + * Creates a new Quota instance using the specified properties. + * @param [properties] Properties to set + * @returns Quota instance + */ + public static create(properties?: google.cloud.compute.v1.IQuota): google.cloud.compute.v1.Quota; + + /** + * Encodes the specified Quota message. Does not implicitly {@link google.cloud.compute.v1.Quota.verify|verify} messages. + * @param message Quota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Quota message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Quota.verify|verify} messages. + * @param message Quota message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IQuota, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Quota message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Quota; + + /** + * Decodes a Quota message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Quota; + + /** + * Verifies a Quota message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Quota message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Quota + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Quota; + + /** + * Creates a plain object from a Quota message. Also converts values to other types if specified. + * @param message Quota + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Quota, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Quota to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Quota { + + /** Metric enum. */ + enum Metric { + UNDEFINED_METRIC = 0, + A2_CPUS = 153206585, + AFFINITY_GROUPS = 108303563, + AUTOSCALERS = 471248988, + BACKEND_BUCKETS = 137626846, + BACKEND_SERVICES = 269623753, + C2D_CPUS = 508182517, + C2_CPUS = 317601211, + COMMITMENTS = 456141790, + COMMITTED_A2_CPUS = 59330902, + COMMITTED_C2D_CPUS = 282390904, + COMMITTED_C2_CPUS = 223725528, + COMMITTED_CPUS = 292394702, + COMMITTED_E2_CPUS = 388120154, + COMMITTED_LICENSES = 357606869, + COMMITTED_LOCAL_SSD_TOTAL_GB = 308393480, + COMMITTED_MEMORY_OPTIMIZED_CPUS = 489057886, + COMMITTED_N2A_CPUS = 40064304, + COMMITTED_N2D_CPUS = 125951757, + COMMITTED_N2_CPUS = 322589603, + COMMITTED_NVIDIA_A100_GPUS = 375799445, + COMMITTED_NVIDIA_K80_GPUS = 3857188, + COMMITTED_NVIDIA_P100_GPUS = 107528100, + COMMITTED_NVIDIA_P4_GPUS = 347952897, + COMMITTED_NVIDIA_T4_GPUS = 139871237, + COMMITTED_NVIDIA_V100_GPUS = 219562, + CPUS = 2075595, + CPUS_ALL_REGIONS = 470911149, + DISKS_TOTAL_GB = 353520543, + E2_CPUS = 481995837, + EXTERNAL_NETWORK_LB_FORWARDING_RULES = 374298265, + EXTERNAL_PROTOCOL_FORWARDING_RULES = 63478888, + EXTERNAL_VPN_GATEWAYS = 272457134, + FIREWALLS = 374485843, + FORWARDING_RULES = 432668949, + GLOBAL_INTERNAL_ADDRESSES = 42738332, + GPUS_ALL_REGIONS = 39387177, + HEALTH_CHECKS = 289347502, + IMAGES = 15562360, + INSTANCES = 131337822, + INSTANCE_GROUPS = 355919038, + INSTANCE_GROUP_MANAGERS = 101798192, + INSTANCE_TEMPLATES = 226188271, + INTERCONNECTS = 415204741, + INTERCONNECT_ATTACHMENTS_PER_REGION = 159968086, + INTERCONNECT_ATTACHMENTS_TOTAL_MBPS = 425090419, + INTERCONNECT_TOTAL_GBPS = 285341866, + INTERNAL_ADDRESSES = 197899392, + INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES = 266433668, + IN_PLACE_SNAPSHOTS = 151359133, + IN_USE_ADDRESSES = 402125072, + IN_USE_BACKUP_SCHEDULES = 32786705, + IN_USE_SNAPSHOT_SCHEDULES = 462104083, + LOCAL_SSD_TOTAL_GB = 330878021, + M1_CPUS = 37203366, + M2_CPUS = 65832517, + MACHINE_IMAGES = 446986640, + N2A_CPUS = 265855917, + N2D_CPUS = 351743370, + N2_CPUS = 416465286, + NETWORKS = 485481477, + NETWORK_ENDPOINT_GROUPS = 102144909, + NETWORK_FIREWALL_POLICIES = 101117374, + NODE_GROUPS = 24624817, + NODE_TEMPLATES = 474896668, + NVIDIA_A100_GPUS = 504872978, + NVIDIA_K80_GPUS = 163886599, + NVIDIA_P100_GPUS = 236601633, + NVIDIA_P100_VWS_GPUS = 213970574, + NVIDIA_P4_GPUS = 283841470, + NVIDIA_P4_VWS_GPUS = 528296619, + NVIDIA_T4_GPUS = 75759810, + NVIDIA_T4_VWS_GPUS = 319813039, + NVIDIA_V100_GPUS = 129293095, + PACKET_MIRRORINGS = 15578407, + PD_EXTREME_TOTAL_PROVISIONED_IOPS = 69593965, + PREEMPTIBLE_CPUS = 251184841, + PREEMPTIBLE_LOCAL_SSD_GB = 260819336, + PREEMPTIBLE_NVIDIA_A100_GPUS = 68832784, + PREEMPTIBLE_NVIDIA_K80_GPUS = 374960201, + PREEMPTIBLE_NVIDIA_P100_GPUS = 337432351, + PREEMPTIBLE_NVIDIA_P100_VWS_GPUS = 313544076, + PREEMPTIBLE_NVIDIA_P4_GPUS = 429197628, + PREEMPTIBLE_NVIDIA_P4_VWS_GPUS = 252981545, + PREEMPTIBLE_NVIDIA_T4_GPUS = 221115968, + PREEMPTIBLE_NVIDIA_T4_VWS_GPUS = 44497965, + PREEMPTIBLE_NVIDIA_V100_GPUS = 230123813, + PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK = 231164291, + PUBLIC_ADVERTISED_PREFIXES = 471371980, + PUBLIC_DELEGATED_PREFIXES = 532465974, + REGIONAL_AUTOSCALERS = 29363772, + REGIONAL_INSTANCE_GROUP_MANAGERS = 37543696, + RESERVATIONS = 32644647, + RESOURCE_POLICIES = 83955297, + ROUTERS = 493018666, + ROUTES = 275680074, + SECURITY_POLICIES = 189518703, + SECURITY_POLICY_CEVAL_RULES = 470815689, + SECURITY_POLICY_RULES = 203549225, + SNAPSHOTS = 343405327, + SSD_TOTAL_GB = 161732561, + SSL_CERTIFICATES = 378372399, + STATIC_ADDRESSES = 93624049, + STATIC_BYOIP_ADDRESSES = 275809649, + SUBNETWORKS = 421330469, + TARGET_HTTPS_PROXIES = 219522506, + TARGET_HTTP_PROXIES = 164117155, + TARGET_INSTANCES = 284519728, + TARGET_POOLS = 348261257, + TARGET_SSL_PROXIES = 159216235, + TARGET_TCP_PROXIES = 182243136, + TARGET_VPN_GATEWAYS = 75029928, + URL_MAPS = 378660743, + VPN_GATEWAYS = 35620282, + VPN_TUNNELS = 104327296, + XPN_SERVICE_PROJECTS = 95191981 + } + } + + /** Properties of a UsageExportLocation. */ + interface IUsageExportLocation { + + /** UsageExportLocation bucketName */ + bucketName?: (string|null); + + /** UsageExportLocation reportNamePrefix */ + reportNamePrefix?: (string|null); + } + + /** Represents a UsageExportLocation. */ + class UsageExportLocation implements IUsageExportLocation { + + /** + * Constructs a new UsageExportLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUsageExportLocation); + + /** UsageExportLocation bucketName. */ + public bucketName?: (string|null); + + /** UsageExportLocation reportNamePrefix. */ + public reportNamePrefix?: (string|null); + + /** UsageExportLocation _bucketName. */ + public _bucketName?: "bucketName"; + + /** UsageExportLocation _reportNamePrefix. */ + public _reportNamePrefix?: "reportNamePrefix"; + + /** + * Creates a new UsageExportLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageExportLocation instance + */ + public static create(properties?: google.cloud.compute.v1.IUsageExportLocation): google.cloud.compute.v1.UsageExportLocation; + + /** + * Encodes the specified UsageExportLocation message. Does not implicitly {@link google.cloud.compute.v1.UsageExportLocation.verify|verify} messages. + * @param message UsageExportLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUsageExportLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageExportLocation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsageExportLocation.verify|verify} messages. + * @param message UsageExportLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUsageExportLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageExportLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageExportLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UsageExportLocation; + + /** + * Decodes a UsageExportLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageExportLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UsageExportLocation; + + /** + * Verifies a UsageExportLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageExportLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageExportLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UsageExportLocation; + + /** + * Creates a plain object from a UsageExportLocation message. Also converts values to other types if specified. + * @param message UsageExportLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UsageExportLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageExportLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Project. */ + interface IProject { + + /** Project commonInstanceMetadata */ + commonInstanceMetadata?: (google.cloud.compute.v1.IMetadata|null); + + /** Project creationTimestamp */ + creationTimestamp?: (string|null); + + /** Project defaultNetworkTier */ + defaultNetworkTier?: (google.cloud.compute.v1.Project.DefaultNetworkTier|keyof typeof google.cloud.compute.v1.Project.DefaultNetworkTier|null); + + /** Project defaultServiceAccount */ + defaultServiceAccount?: (string|null); + + /** Project description */ + description?: (string|null); + + /** Project enabledFeatures */ + enabledFeatures?: (string[]|null); + + /** Project id */ + id?: (number|Long|string|null); + + /** Project kind */ + kind?: (string|null); + + /** Project name */ + name?: (string|null); + + /** Project quotas */ + quotas?: (google.cloud.compute.v1.IQuota[]|null); + + /** Project selfLink */ + selfLink?: (string|null); + + /** Project usageExportLocation */ + usageExportLocation?: (google.cloud.compute.v1.IUsageExportLocation|null); + + /** Project xpnProjectStatus */ + xpnProjectStatus?: (google.cloud.compute.v1.Project.XpnProjectStatus|keyof typeof google.cloud.compute.v1.Project.XpnProjectStatus|null); + } + + /** Represents a Project. */ + class Project implements IProject { + + /** + * Constructs a new Project. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IProject); + + /** Project commonInstanceMetadata. */ + public commonInstanceMetadata?: (google.cloud.compute.v1.IMetadata|null); + + /** Project creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Project defaultNetworkTier. */ + public defaultNetworkTier?: (google.cloud.compute.v1.Project.DefaultNetworkTier|keyof typeof google.cloud.compute.v1.Project.DefaultNetworkTier|null); + + /** Project defaultServiceAccount. */ + public defaultServiceAccount?: (string|null); + + /** Project description. */ + public description?: (string|null); + + /** Project enabledFeatures. */ + public enabledFeatures: string[]; + + /** Project id. */ + public id?: (number|Long|string|null); + + /** Project kind. */ + public kind?: (string|null); + + /** Project name. */ + public name?: (string|null); + + /** Project quotas. */ + public quotas: google.cloud.compute.v1.IQuota[]; + + /** Project selfLink. */ + public selfLink?: (string|null); + + /** Project usageExportLocation. */ + public usageExportLocation?: (google.cloud.compute.v1.IUsageExportLocation|null); + + /** Project xpnProjectStatus. */ + public xpnProjectStatus?: (google.cloud.compute.v1.Project.XpnProjectStatus|keyof typeof google.cloud.compute.v1.Project.XpnProjectStatus|null); + + /** Project _commonInstanceMetadata. */ + public _commonInstanceMetadata?: "commonInstanceMetadata"; + + /** Project _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Project _defaultNetworkTier. */ + public _defaultNetworkTier?: "defaultNetworkTier"; + + /** Project _defaultServiceAccount. */ + public _defaultServiceAccount?: "defaultServiceAccount"; + + /** Project _description. */ + public _description?: "description"; + + /** Project _id. */ + public _id?: "id"; + + /** Project _kind. */ + public _kind?: "kind"; + + /** Project _name. */ + public _name?: "name"; + + /** Project _selfLink. */ + public _selfLink?: "selfLink"; + + /** Project _usageExportLocation. */ + public _usageExportLocation?: "usageExportLocation"; + + /** Project _xpnProjectStatus. */ + public _xpnProjectStatus?: "xpnProjectStatus"; + + /** + * Creates a new Project instance using the specified properties. + * @param [properties] Properties to set + * @returns Project instance + */ + public static create(properties?: google.cloud.compute.v1.IProject): google.cloud.compute.v1.Project; + + /** + * Encodes the specified Project message. Does not implicitly {@link google.cloud.compute.v1.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.compute.v1.IProject, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Project message, length delimited. Does not implicitly {@link google.cloud.compute.v1.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.compute.v1.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.compute.v1.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.compute.v1.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.compute.v1.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.compute.v1.Project, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Project to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Project { + + /** DefaultNetworkTier enum. */ + enum DefaultNetworkTier { + UNDEFINED_DEFAULT_NETWORK_TIER = 0, + PREMIUM = 399530551, + STANDARD = 484642493 + } + + /** XpnProjectStatus enum. */ + enum XpnProjectStatus { + UNDEFINED_XPN_PROJECT_STATUS = 0, + HOST = 2223528, + UNSPECIFIED_XPN_PROJECT_STATUS = 340393257 + } + } + + /** Properties of a XpnResourceId. */ + interface IXpnResourceId { + + /** XpnResourceId id */ + id?: (string|null); + + /** XpnResourceId type */ + type?: (google.cloud.compute.v1.XpnResourceId.Type|keyof typeof google.cloud.compute.v1.XpnResourceId.Type|null); + } + + /** Represents a XpnResourceId. */ + class XpnResourceId implements IXpnResourceId { + + /** + * Constructs a new XpnResourceId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IXpnResourceId); + + /** XpnResourceId id. */ + public id?: (string|null); + + /** XpnResourceId type. */ + public type?: (google.cloud.compute.v1.XpnResourceId.Type|keyof typeof google.cloud.compute.v1.XpnResourceId.Type|null); + + /** XpnResourceId _id. */ + public _id?: "id"; + + /** XpnResourceId _type. */ + public _type?: "type"; + + /** + * Creates a new XpnResourceId instance using the specified properties. + * @param [properties] Properties to set + * @returns XpnResourceId instance + */ + public static create(properties?: google.cloud.compute.v1.IXpnResourceId): google.cloud.compute.v1.XpnResourceId; + + /** + * Encodes the specified XpnResourceId message. Does not implicitly {@link google.cloud.compute.v1.XpnResourceId.verify|verify} messages. + * @param message XpnResourceId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IXpnResourceId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified XpnResourceId message, length delimited. Does not implicitly {@link google.cloud.compute.v1.XpnResourceId.verify|verify} messages. + * @param message XpnResourceId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IXpnResourceId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a XpnResourceId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns XpnResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.XpnResourceId; + + /** + * Decodes a XpnResourceId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns XpnResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.XpnResourceId; + + /** + * Verifies a XpnResourceId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a XpnResourceId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns XpnResourceId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.XpnResourceId; + + /** + * Creates a plain object from a XpnResourceId message. Also converts values to other types if specified. + * @param message XpnResourceId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.XpnResourceId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this XpnResourceId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace XpnResourceId { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + PROJECT = 408671993, + XPN_RESOURCE_TYPE_UNSPECIFIED = 151607034 + } + } + + /** Properties of a ProjectsDisableXpnResourceRequest. */ + interface IProjectsDisableXpnResourceRequest { + + /** ProjectsDisableXpnResourceRequest xpnResource */ + xpnResource?: (google.cloud.compute.v1.IXpnResourceId|null); + } + + /** Represents a ProjectsDisableXpnResourceRequest. */ + class ProjectsDisableXpnResourceRequest implements IProjectsDisableXpnResourceRequest { + + /** + * Constructs a new ProjectsDisableXpnResourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IProjectsDisableXpnResourceRequest); + + /** ProjectsDisableXpnResourceRequest xpnResource. */ + public xpnResource?: (google.cloud.compute.v1.IXpnResourceId|null); + + /** ProjectsDisableXpnResourceRequest _xpnResource. */ + public _xpnResource?: "xpnResource"; + + /** + * Creates a new ProjectsDisableXpnResourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ProjectsDisableXpnResourceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IProjectsDisableXpnResourceRequest): google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; + + /** + * Encodes the specified ProjectsDisableXpnResourceRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.verify|verify} messages. + * @param message ProjectsDisableXpnResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IProjectsDisableXpnResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProjectsDisableXpnResourceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.verify|verify} messages. + * @param message ProjectsDisableXpnResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IProjectsDisableXpnResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProjectsDisableXpnResourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProjectsDisableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; + + /** + * Decodes a ProjectsDisableXpnResourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProjectsDisableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; + + /** + * Verifies a ProjectsDisableXpnResourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProjectsDisableXpnResourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProjectsDisableXpnResourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ProjectsDisableXpnResourceRequest; + + /** + * Creates a plain object from a ProjectsDisableXpnResourceRequest message. Also converts values to other types if specified. + * @param message ProjectsDisableXpnResourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ProjectsDisableXpnResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProjectsDisableXpnResourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProjectsEnableXpnResourceRequest. */ + interface IProjectsEnableXpnResourceRequest { + + /** ProjectsEnableXpnResourceRequest xpnResource */ + xpnResource?: (google.cloud.compute.v1.IXpnResourceId|null); + } + + /** Represents a ProjectsEnableXpnResourceRequest. */ + class ProjectsEnableXpnResourceRequest implements IProjectsEnableXpnResourceRequest { + + /** + * Constructs a new ProjectsEnableXpnResourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IProjectsEnableXpnResourceRequest); + + /** ProjectsEnableXpnResourceRequest xpnResource. */ + public xpnResource?: (google.cloud.compute.v1.IXpnResourceId|null); + + /** ProjectsEnableXpnResourceRequest _xpnResource. */ + public _xpnResource?: "xpnResource"; + + /** + * Creates a new ProjectsEnableXpnResourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ProjectsEnableXpnResourceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IProjectsEnableXpnResourceRequest): google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; + + /** + * Encodes the specified ProjectsEnableXpnResourceRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.verify|verify} messages. + * @param message ProjectsEnableXpnResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IProjectsEnableXpnResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProjectsEnableXpnResourceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.verify|verify} messages. + * @param message ProjectsEnableXpnResourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IProjectsEnableXpnResourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProjectsEnableXpnResourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProjectsEnableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; + + /** + * Decodes a ProjectsEnableXpnResourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProjectsEnableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; + + /** + * Verifies a ProjectsEnableXpnResourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProjectsEnableXpnResourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProjectsEnableXpnResourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ProjectsEnableXpnResourceRequest; + + /** + * Creates a plain object from a ProjectsEnableXpnResourceRequest message. Also converts values to other types if specified. + * @param message ProjectsEnableXpnResourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ProjectsEnableXpnResourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProjectsEnableXpnResourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProjectsGetXpnResources. */ + interface IProjectsGetXpnResources { + + /** ProjectsGetXpnResources kind */ + kind?: (string|null); + + /** ProjectsGetXpnResources nextPageToken */ + nextPageToken?: (string|null); + + /** ProjectsGetXpnResources resources */ + resources?: (google.cloud.compute.v1.IXpnResourceId[]|null); + } + + /** Represents a ProjectsGetXpnResources. */ + class ProjectsGetXpnResources implements IProjectsGetXpnResources { + + /** + * Constructs a new ProjectsGetXpnResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IProjectsGetXpnResources); + + /** ProjectsGetXpnResources kind. */ + public kind?: (string|null); + + /** ProjectsGetXpnResources nextPageToken. */ + public nextPageToken?: (string|null); + + /** ProjectsGetXpnResources resources. */ + public resources: google.cloud.compute.v1.IXpnResourceId[]; + + /** ProjectsGetXpnResources _kind. */ + public _kind?: "kind"; + + /** ProjectsGetXpnResources _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** + * Creates a new ProjectsGetXpnResources instance using the specified properties. + * @param [properties] Properties to set + * @returns ProjectsGetXpnResources instance + */ + public static create(properties?: google.cloud.compute.v1.IProjectsGetXpnResources): google.cloud.compute.v1.ProjectsGetXpnResources; + + /** + * Encodes the specified ProjectsGetXpnResources message. Does not implicitly {@link google.cloud.compute.v1.ProjectsGetXpnResources.verify|verify} messages. + * @param message ProjectsGetXpnResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IProjectsGetXpnResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProjectsGetXpnResources message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsGetXpnResources.verify|verify} messages. + * @param message ProjectsGetXpnResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IProjectsGetXpnResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProjectsGetXpnResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProjectsGetXpnResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ProjectsGetXpnResources; + + /** + * Decodes a ProjectsGetXpnResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProjectsGetXpnResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ProjectsGetXpnResources; + + /** + * Verifies a ProjectsGetXpnResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProjectsGetXpnResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProjectsGetXpnResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ProjectsGetXpnResources; + + /** + * Creates a plain object from a ProjectsGetXpnResources message. Also converts values to other types if specified. + * @param message ProjectsGetXpnResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ProjectsGetXpnResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProjectsGetXpnResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProjectsListXpnHostsRequest. */ + interface IProjectsListXpnHostsRequest { + + /** ProjectsListXpnHostsRequest organization */ + organization?: (string|null); + } + + /** Represents a ProjectsListXpnHostsRequest. */ + class ProjectsListXpnHostsRequest implements IProjectsListXpnHostsRequest { + + /** + * Constructs a new ProjectsListXpnHostsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IProjectsListXpnHostsRequest); + + /** ProjectsListXpnHostsRequest organization. */ + public organization?: (string|null); + + /** ProjectsListXpnHostsRequest _organization. */ + public _organization?: "organization"; + + /** + * Creates a new ProjectsListXpnHostsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ProjectsListXpnHostsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IProjectsListXpnHostsRequest): google.cloud.compute.v1.ProjectsListXpnHostsRequest; + + /** + * Encodes the specified ProjectsListXpnHostsRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsListXpnHostsRequest.verify|verify} messages. + * @param message ProjectsListXpnHostsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IProjectsListXpnHostsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProjectsListXpnHostsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsListXpnHostsRequest.verify|verify} messages. + * @param message ProjectsListXpnHostsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IProjectsListXpnHostsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProjectsListXpnHostsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProjectsListXpnHostsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ProjectsListXpnHostsRequest; + + /** + * Decodes a ProjectsListXpnHostsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProjectsListXpnHostsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ProjectsListXpnHostsRequest; + + /** + * Verifies a ProjectsListXpnHostsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProjectsListXpnHostsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProjectsListXpnHostsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ProjectsListXpnHostsRequest; + + /** + * Creates a plain object from a ProjectsListXpnHostsRequest message. Also converts values to other types if specified. + * @param message ProjectsListXpnHostsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ProjectsListXpnHostsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProjectsListXpnHostsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProjectsSetDefaultNetworkTierRequest. */ + interface IProjectsSetDefaultNetworkTierRequest { + + /** ProjectsSetDefaultNetworkTierRequest networkTier */ + networkTier?: (google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier|keyof typeof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier|null); + } + + /** Represents a ProjectsSetDefaultNetworkTierRequest. */ + class ProjectsSetDefaultNetworkTierRequest implements IProjectsSetDefaultNetworkTierRequest { + + /** + * Constructs a new ProjectsSetDefaultNetworkTierRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest); + + /** ProjectsSetDefaultNetworkTierRequest networkTier. */ + public networkTier?: (google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier|keyof typeof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier|null); + + /** ProjectsSetDefaultNetworkTierRequest _networkTier. */ + public _networkTier?: "networkTier"; + + /** + * Creates a new ProjectsSetDefaultNetworkTierRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ProjectsSetDefaultNetworkTierRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest): google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest; + + /** + * Encodes the specified ProjectsSetDefaultNetworkTierRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.verify|verify} messages. + * @param message ProjectsSetDefaultNetworkTierRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProjectsSetDefaultNetworkTierRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.verify|verify} messages. + * @param message ProjectsSetDefaultNetworkTierRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProjectsSetDefaultNetworkTierRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProjectsSetDefaultNetworkTierRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest; + + /** + * Decodes a ProjectsSetDefaultNetworkTierRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProjectsSetDefaultNetworkTierRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest; + + /** + * Verifies a ProjectsSetDefaultNetworkTierRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProjectsSetDefaultNetworkTierRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProjectsSetDefaultNetworkTierRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest; + + /** + * Creates a plain object from a ProjectsSetDefaultNetworkTierRequest message. Also converts values to other types if specified. + * @param message ProjectsSetDefaultNetworkTierRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProjectsSetDefaultNetworkTierRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ProjectsSetDefaultNetworkTierRequest { + + /** NetworkTier enum. */ + enum NetworkTier { + UNDEFINED_NETWORK_TIER = 0, + PREMIUM = 399530551, + STANDARD = 484642493 + } + } + + /** Properties of a PublicAdvertisedPrefixPublicDelegatedPrefix. */ + interface IPublicAdvertisedPrefixPublicDelegatedPrefix { + + /** PublicAdvertisedPrefixPublicDelegatedPrefix ipRange */ + ipRange?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix name */ + name?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix project */ + project?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix region */ + region?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix status */ + status?: (string|null); + } + + /** Represents a PublicAdvertisedPrefixPublicDelegatedPrefix. */ + class PublicAdvertisedPrefixPublicDelegatedPrefix implements IPublicAdvertisedPrefixPublicDelegatedPrefix { + + /** + * Constructs a new PublicAdvertisedPrefixPublicDelegatedPrefix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix ipRange. */ + public ipRange?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix name. */ + public name?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix project. */ + public project?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix region. */ + public region?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix status. */ + public status?: (string|null); + + /** PublicAdvertisedPrefixPublicDelegatedPrefix _ipRange. */ + public _ipRange?: "ipRange"; + + /** PublicAdvertisedPrefixPublicDelegatedPrefix _name. */ + public _name?: "name"; + + /** PublicAdvertisedPrefixPublicDelegatedPrefix _project. */ + public _project?: "project"; + + /** PublicAdvertisedPrefixPublicDelegatedPrefix _region. */ + public _region?: "region"; + + /** PublicAdvertisedPrefixPublicDelegatedPrefix _status. */ + public _status?: "status"; + + /** + * Creates a new PublicAdvertisedPrefixPublicDelegatedPrefix instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicAdvertisedPrefixPublicDelegatedPrefix instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix): google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix; + + /** + * Encodes the specified PublicAdvertisedPrefixPublicDelegatedPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.verify|verify} messages. + * @param message PublicAdvertisedPrefixPublicDelegatedPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicAdvertisedPrefixPublicDelegatedPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.verify|verify} messages. + * @param message PublicAdvertisedPrefixPublicDelegatedPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicAdvertisedPrefixPublicDelegatedPrefix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicAdvertisedPrefixPublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix; + + /** + * Decodes a PublicAdvertisedPrefixPublicDelegatedPrefix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicAdvertisedPrefixPublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix; + + /** + * Verifies a PublicAdvertisedPrefixPublicDelegatedPrefix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicAdvertisedPrefixPublicDelegatedPrefix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicAdvertisedPrefixPublicDelegatedPrefix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix; + + /** + * Creates a plain object from a PublicAdvertisedPrefixPublicDelegatedPrefix message. Also converts values to other types if specified. + * @param message PublicAdvertisedPrefixPublicDelegatedPrefix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicAdvertisedPrefixPublicDelegatedPrefix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublicAdvertisedPrefix. */ + interface IPublicAdvertisedPrefix { + + /** PublicAdvertisedPrefix creationTimestamp */ + creationTimestamp?: (string|null); + + /** PublicAdvertisedPrefix description */ + description?: (string|null); + + /** PublicAdvertisedPrefix dnsVerificationIp */ + dnsVerificationIp?: (string|null); + + /** PublicAdvertisedPrefix fingerprint */ + fingerprint?: (string|null); + + /** PublicAdvertisedPrefix id */ + id?: (number|Long|string|null); + + /** PublicAdvertisedPrefix ipCidrRange */ + ipCidrRange?: (string|null); + + /** PublicAdvertisedPrefix kind */ + kind?: (string|null); + + /** PublicAdvertisedPrefix name */ + name?: (string|null); + + /** PublicAdvertisedPrefix publicDelegatedPrefixs */ + publicDelegatedPrefixs?: (google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix[]|null); + + /** PublicAdvertisedPrefix selfLink */ + selfLink?: (string|null); + + /** PublicAdvertisedPrefix sharedSecret */ + sharedSecret?: (string|null); + + /** PublicAdvertisedPrefix status */ + status?: (google.cloud.compute.v1.PublicAdvertisedPrefix.Status|keyof typeof google.cloud.compute.v1.PublicAdvertisedPrefix.Status|null); + } + + /** Represents a PublicAdvertisedPrefix. */ + class PublicAdvertisedPrefix implements IPublicAdvertisedPrefix { + + /** + * Constructs a new PublicAdvertisedPrefix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicAdvertisedPrefix); + + /** PublicAdvertisedPrefix creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** PublicAdvertisedPrefix description. */ + public description?: (string|null); + + /** PublicAdvertisedPrefix dnsVerificationIp. */ + public dnsVerificationIp?: (string|null); + + /** PublicAdvertisedPrefix fingerprint. */ + public fingerprint?: (string|null); + + /** PublicAdvertisedPrefix id. */ + public id?: (number|Long|string|null); + + /** PublicAdvertisedPrefix ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** PublicAdvertisedPrefix kind. */ + public kind?: (string|null); + + /** PublicAdvertisedPrefix name. */ + public name?: (string|null); + + /** PublicAdvertisedPrefix publicDelegatedPrefixs. */ + public publicDelegatedPrefixs: google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix[]; + + /** PublicAdvertisedPrefix selfLink. */ + public selfLink?: (string|null); + + /** PublicAdvertisedPrefix sharedSecret. */ + public sharedSecret?: (string|null); + + /** PublicAdvertisedPrefix status. */ + public status?: (google.cloud.compute.v1.PublicAdvertisedPrefix.Status|keyof typeof google.cloud.compute.v1.PublicAdvertisedPrefix.Status|null); + + /** PublicAdvertisedPrefix _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** PublicAdvertisedPrefix _description. */ + public _description?: "description"; + + /** PublicAdvertisedPrefix _dnsVerificationIp. */ + public _dnsVerificationIp?: "dnsVerificationIp"; + + /** PublicAdvertisedPrefix _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** PublicAdvertisedPrefix _id. */ + public _id?: "id"; + + /** PublicAdvertisedPrefix _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** PublicAdvertisedPrefix _kind. */ + public _kind?: "kind"; + + /** PublicAdvertisedPrefix _name. */ + public _name?: "name"; + + /** PublicAdvertisedPrefix _selfLink. */ + public _selfLink?: "selfLink"; + + /** PublicAdvertisedPrefix _sharedSecret. */ + public _sharedSecret?: "sharedSecret"; + + /** PublicAdvertisedPrefix _status. */ + public _status?: "status"; + + /** + * Creates a new PublicAdvertisedPrefix instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicAdvertisedPrefix instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicAdvertisedPrefix): google.cloud.compute.v1.PublicAdvertisedPrefix; + + /** + * Encodes the specified PublicAdvertisedPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefix.verify|verify} messages. + * @param message PublicAdvertisedPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicAdvertisedPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicAdvertisedPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefix.verify|verify} messages. + * @param message PublicAdvertisedPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicAdvertisedPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicAdvertisedPrefix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicAdvertisedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicAdvertisedPrefix; + + /** + * Decodes a PublicAdvertisedPrefix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicAdvertisedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicAdvertisedPrefix; + + /** + * Verifies a PublicAdvertisedPrefix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicAdvertisedPrefix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicAdvertisedPrefix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicAdvertisedPrefix; + + /** + * Creates a plain object from a PublicAdvertisedPrefix message. Also converts values to other types if specified. + * @param message PublicAdvertisedPrefix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicAdvertisedPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicAdvertisedPrefix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PublicAdvertisedPrefix { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + INITIAL = 518841124, + PREFIX_CONFIGURATION_COMPLETE = 480889551, + PREFIX_CONFIGURATION_IN_PROGRESS = 378550961, + PREFIX_REMOVAL_IN_PROGRESS = 284375783, + PTR_CONFIGURED = 513497167, + REVERSE_DNS_LOOKUP_FAILED = 295755183, + VALIDATED = 66197998 + } + } + + /** Properties of a PublicAdvertisedPrefixList. */ + interface IPublicAdvertisedPrefixList { + + /** PublicAdvertisedPrefixList id */ + id?: (string|null); + + /** PublicAdvertisedPrefixList items */ + items?: (google.cloud.compute.v1.IPublicAdvertisedPrefix[]|null); + + /** PublicAdvertisedPrefixList kind */ + kind?: (string|null); + + /** PublicAdvertisedPrefixList nextPageToken */ + nextPageToken?: (string|null); + + /** PublicAdvertisedPrefixList selfLink */ + selfLink?: (string|null); + + /** PublicAdvertisedPrefixList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a PublicAdvertisedPrefixList. */ + class PublicAdvertisedPrefixList implements IPublicAdvertisedPrefixList { + + /** + * Constructs a new PublicAdvertisedPrefixList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicAdvertisedPrefixList); + + /** PublicAdvertisedPrefixList id. */ + public id?: (string|null); + + /** PublicAdvertisedPrefixList items. */ + public items: google.cloud.compute.v1.IPublicAdvertisedPrefix[]; + + /** PublicAdvertisedPrefixList kind. */ + public kind?: (string|null); + + /** PublicAdvertisedPrefixList nextPageToken. */ + public nextPageToken?: (string|null); + + /** PublicAdvertisedPrefixList selfLink. */ + public selfLink?: (string|null); + + /** PublicAdvertisedPrefixList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** PublicAdvertisedPrefixList _id. */ + public _id?: "id"; + + /** PublicAdvertisedPrefixList _kind. */ + public _kind?: "kind"; + + /** PublicAdvertisedPrefixList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** PublicAdvertisedPrefixList _selfLink. */ + public _selfLink?: "selfLink"; + + /** PublicAdvertisedPrefixList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new PublicAdvertisedPrefixList instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicAdvertisedPrefixList instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicAdvertisedPrefixList): google.cloud.compute.v1.PublicAdvertisedPrefixList; + + /** + * Encodes the specified PublicAdvertisedPrefixList message. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixList.verify|verify} messages. + * @param message PublicAdvertisedPrefixList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicAdvertisedPrefixList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicAdvertisedPrefixList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixList.verify|verify} messages. + * @param message PublicAdvertisedPrefixList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicAdvertisedPrefixList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicAdvertisedPrefixList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicAdvertisedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicAdvertisedPrefixList; + + /** + * Decodes a PublicAdvertisedPrefixList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicAdvertisedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicAdvertisedPrefixList; + + /** + * Verifies a PublicAdvertisedPrefixList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicAdvertisedPrefixList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicAdvertisedPrefixList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicAdvertisedPrefixList; + + /** + * Creates a plain object from a PublicAdvertisedPrefixList message. Also converts values to other types if specified. + * @param message PublicAdvertisedPrefixList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicAdvertisedPrefixList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicAdvertisedPrefixList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublicDelegatedPrefixPublicDelegatedSubPrefix. */ + interface IPublicDelegatedPrefixPublicDelegatedSubPrefix { + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix delegateeProject */ + delegateeProject?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix description */ + description?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix ipCidrRange */ + ipCidrRange?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix isAddress */ + isAddress?: (boolean|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix name */ + name?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix region */ + region?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix status */ + status?: (google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status|keyof typeof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status|null); + } + + /** Represents a PublicDelegatedPrefixPublicDelegatedSubPrefix. */ + class PublicDelegatedPrefixPublicDelegatedSubPrefix implements IPublicDelegatedPrefixPublicDelegatedSubPrefix { + + /** + * Constructs a new PublicDelegatedPrefixPublicDelegatedSubPrefix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix delegateeProject. */ + public delegateeProject?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix description. */ + public description?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix isAddress. */ + public isAddress?: (boolean|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix name. */ + public name?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix region. */ + public region?: (string|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix status. */ + public status?: (google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status|keyof typeof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status|null); + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix _delegateeProject. */ + public _delegateeProject?: "delegateeProject"; + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix _description. */ + public _description?: "description"; + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix _isAddress. */ + public _isAddress?: "isAddress"; + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix _name. */ + public _name?: "name"; + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix _region. */ + public _region?: "region"; + + /** PublicDelegatedPrefixPublicDelegatedSubPrefix _status. */ + public _status?: "status"; + + /** + * Creates a new PublicDelegatedPrefixPublicDelegatedSubPrefix instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicDelegatedPrefixPublicDelegatedSubPrefix instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix): google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix; + + /** + * Encodes the specified PublicDelegatedPrefixPublicDelegatedSubPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.verify|verify} messages. + * @param message PublicDelegatedPrefixPublicDelegatedSubPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicDelegatedPrefixPublicDelegatedSubPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.verify|verify} messages. + * @param message PublicDelegatedPrefixPublicDelegatedSubPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicDelegatedPrefixPublicDelegatedSubPrefix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicDelegatedPrefixPublicDelegatedSubPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix; + + /** + * Decodes a PublicDelegatedPrefixPublicDelegatedSubPrefix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicDelegatedPrefixPublicDelegatedSubPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix; + + /** + * Verifies a PublicDelegatedPrefixPublicDelegatedSubPrefix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicDelegatedPrefixPublicDelegatedSubPrefix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicDelegatedPrefixPublicDelegatedSubPrefix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix; + + /** + * Creates a plain object from a PublicDelegatedPrefixPublicDelegatedSubPrefix message. Also converts values to other types if specified. + * @param message PublicDelegatedPrefixPublicDelegatedSubPrefix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicDelegatedPrefixPublicDelegatedSubPrefix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PublicDelegatedPrefixPublicDelegatedSubPrefix { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + ACTIVE = 314733318, + INACTIVE = 270421099 + } + } + + /** Properties of a PublicDelegatedPrefix. */ + interface IPublicDelegatedPrefix { + + /** PublicDelegatedPrefix creationTimestamp */ + creationTimestamp?: (string|null); + + /** PublicDelegatedPrefix description */ + description?: (string|null); + + /** PublicDelegatedPrefix fingerprint */ + fingerprint?: (string|null); + + /** PublicDelegatedPrefix id */ + id?: (number|Long|string|null); + + /** PublicDelegatedPrefix ipCidrRange */ + ipCidrRange?: (string|null); + + /** PublicDelegatedPrefix isLiveMigration */ + isLiveMigration?: (boolean|null); + + /** PublicDelegatedPrefix kind */ + kind?: (string|null); + + /** PublicDelegatedPrefix name */ + name?: (string|null); + + /** PublicDelegatedPrefix parentPrefix */ + parentPrefix?: (string|null); + + /** PublicDelegatedPrefix publicDelegatedSubPrefixs */ + publicDelegatedSubPrefixs?: (google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix[]|null); + + /** PublicDelegatedPrefix region */ + region?: (string|null); + + /** PublicDelegatedPrefix selfLink */ + selfLink?: (string|null); + + /** PublicDelegatedPrefix status */ + status?: (google.cloud.compute.v1.PublicDelegatedPrefix.Status|keyof typeof google.cloud.compute.v1.PublicDelegatedPrefix.Status|null); + } + + /** Represents a PublicDelegatedPrefix. */ + class PublicDelegatedPrefix implements IPublicDelegatedPrefix { + + /** + * Constructs a new PublicDelegatedPrefix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicDelegatedPrefix); + + /** PublicDelegatedPrefix creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** PublicDelegatedPrefix description. */ + public description?: (string|null); + + /** PublicDelegatedPrefix fingerprint. */ + public fingerprint?: (string|null); + + /** PublicDelegatedPrefix id. */ + public id?: (number|Long|string|null); + + /** PublicDelegatedPrefix ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** PublicDelegatedPrefix isLiveMigration. */ + public isLiveMigration?: (boolean|null); + + /** PublicDelegatedPrefix kind. */ + public kind?: (string|null); + + /** PublicDelegatedPrefix name. */ + public name?: (string|null); + + /** PublicDelegatedPrefix parentPrefix. */ + public parentPrefix?: (string|null); + + /** PublicDelegatedPrefix publicDelegatedSubPrefixs. */ + public publicDelegatedSubPrefixs: google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix[]; + + /** PublicDelegatedPrefix region. */ + public region?: (string|null); + + /** PublicDelegatedPrefix selfLink. */ + public selfLink?: (string|null); + + /** PublicDelegatedPrefix status. */ + public status?: (google.cloud.compute.v1.PublicDelegatedPrefix.Status|keyof typeof google.cloud.compute.v1.PublicDelegatedPrefix.Status|null); + + /** PublicDelegatedPrefix _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** PublicDelegatedPrefix _description. */ + public _description?: "description"; + + /** PublicDelegatedPrefix _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** PublicDelegatedPrefix _id. */ + public _id?: "id"; + + /** PublicDelegatedPrefix _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** PublicDelegatedPrefix _isLiveMigration. */ + public _isLiveMigration?: "isLiveMigration"; + + /** PublicDelegatedPrefix _kind. */ + public _kind?: "kind"; + + /** PublicDelegatedPrefix _name. */ + public _name?: "name"; + + /** PublicDelegatedPrefix _parentPrefix. */ + public _parentPrefix?: "parentPrefix"; + + /** PublicDelegatedPrefix _region. */ + public _region?: "region"; + + /** PublicDelegatedPrefix _selfLink. */ + public _selfLink?: "selfLink"; + + /** PublicDelegatedPrefix _status. */ + public _status?: "status"; + + /** + * Creates a new PublicDelegatedPrefix instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicDelegatedPrefix instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicDelegatedPrefix): google.cloud.compute.v1.PublicDelegatedPrefix; + + /** + * Encodes the specified PublicDelegatedPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefix.verify|verify} messages. + * @param message PublicDelegatedPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicDelegatedPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicDelegatedPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefix.verify|verify} messages. + * @param message PublicDelegatedPrefix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicDelegatedPrefix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicDelegatedPrefix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicDelegatedPrefix; + + /** + * Decodes a PublicDelegatedPrefix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicDelegatedPrefix; + + /** + * Verifies a PublicDelegatedPrefix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicDelegatedPrefix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicDelegatedPrefix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicDelegatedPrefix; + + /** + * Creates a plain object from a PublicDelegatedPrefix message. Also converts values to other types if specified. + * @param message PublicDelegatedPrefix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicDelegatedPrefix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicDelegatedPrefix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PublicDelegatedPrefix { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + ANNOUNCED = 365103355, + DELETING = 528602024, + INITIALIZING = 306588749 + } + } + + /** Properties of a PublicDelegatedPrefixesScopedList. */ + interface IPublicDelegatedPrefixesScopedList { + + /** PublicDelegatedPrefixesScopedList publicDelegatedPrefixes */ + publicDelegatedPrefixes?: (google.cloud.compute.v1.IPublicDelegatedPrefix[]|null); + + /** PublicDelegatedPrefixesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a PublicDelegatedPrefixesScopedList. */ + class PublicDelegatedPrefixesScopedList implements IPublicDelegatedPrefixesScopedList { + + /** + * Constructs a new PublicDelegatedPrefixesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList); + + /** PublicDelegatedPrefixesScopedList publicDelegatedPrefixes. */ + public publicDelegatedPrefixes: google.cloud.compute.v1.IPublicDelegatedPrefix[]; + + /** PublicDelegatedPrefixesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** PublicDelegatedPrefixesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new PublicDelegatedPrefixesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicDelegatedPrefixesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList): google.cloud.compute.v1.PublicDelegatedPrefixesScopedList; + + /** + * Encodes the specified PublicDelegatedPrefixesScopedList message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.verify|verify} messages. + * @param message PublicDelegatedPrefixesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicDelegatedPrefixesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.verify|verify} messages. + * @param message PublicDelegatedPrefixesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicDelegatedPrefixesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicDelegatedPrefixesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicDelegatedPrefixesScopedList; + + /** + * Decodes a PublicDelegatedPrefixesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicDelegatedPrefixesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicDelegatedPrefixesScopedList; + + /** + * Verifies a PublicDelegatedPrefixesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicDelegatedPrefixesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicDelegatedPrefixesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicDelegatedPrefixesScopedList; + + /** + * Creates a plain object from a PublicDelegatedPrefixesScopedList message. Also converts values to other types if specified. + * @param message PublicDelegatedPrefixesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicDelegatedPrefixesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicDelegatedPrefixesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublicDelegatedPrefixAggregatedList. */ + interface IPublicDelegatedPrefixAggregatedList { + + /** PublicDelegatedPrefixAggregatedList id */ + id?: (string|null); + + /** PublicDelegatedPrefixAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList }|null); + + /** PublicDelegatedPrefixAggregatedList kind */ + kind?: (string|null); + + /** PublicDelegatedPrefixAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** PublicDelegatedPrefixAggregatedList selfLink */ + selfLink?: (string|null); + + /** PublicDelegatedPrefixAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** PublicDelegatedPrefixAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a PublicDelegatedPrefixAggregatedList. */ + class PublicDelegatedPrefixAggregatedList implements IPublicDelegatedPrefixAggregatedList { + + /** + * Constructs a new PublicDelegatedPrefixAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList); + + /** PublicDelegatedPrefixAggregatedList id. */ + public id?: (string|null); + + /** PublicDelegatedPrefixAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList }; + + /** PublicDelegatedPrefixAggregatedList kind. */ + public kind?: (string|null); + + /** PublicDelegatedPrefixAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** PublicDelegatedPrefixAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** PublicDelegatedPrefixAggregatedList unreachables. */ + public unreachables: string[]; + + /** PublicDelegatedPrefixAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** PublicDelegatedPrefixAggregatedList _id. */ + public _id?: "id"; + + /** PublicDelegatedPrefixAggregatedList _kind. */ + public _kind?: "kind"; + + /** PublicDelegatedPrefixAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** PublicDelegatedPrefixAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** PublicDelegatedPrefixAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new PublicDelegatedPrefixAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicDelegatedPrefixAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList): google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList; + + /** + * Encodes the specified PublicDelegatedPrefixAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.verify|verify} messages. + * @param message PublicDelegatedPrefixAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicDelegatedPrefixAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.verify|verify} messages. + * @param message PublicDelegatedPrefixAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicDelegatedPrefixAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicDelegatedPrefixAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList; + + /** + * Decodes a PublicDelegatedPrefixAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicDelegatedPrefixAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList; + + /** + * Verifies a PublicDelegatedPrefixAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicDelegatedPrefixAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicDelegatedPrefixAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList; + + /** + * Creates a plain object from a PublicDelegatedPrefixAggregatedList message. Also converts values to other types if specified. + * @param message PublicDelegatedPrefixAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicDelegatedPrefixAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PublicDelegatedPrefixList. */ + interface IPublicDelegatedPrefixList { + + /** PublicDelegatedPrefixList id */ + id?: (string|null); + + /** PublicDelegatedPrefixList items */ + items?: (google.cloud.compute.v1.IPublicDelegatedPrefix[]|null); + + /** PublicDelegatedPrefixList kind */ + kind?: (string|null); + + /** PublicDelegatedPrefixList nextPageToken */ + nextPageToken?: (string|null); + + /** PublicDelegatedPrefixList selfLink */ + selfLink?: (string|null); + + /** PublicDelegatedPrefixList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a PublicDelegatedPrefixList. */ + class PublicDelegatedPrefixList implements IPublicDelegatedPrefixList { + + /** + * Constructs a new PublicDelegatedPrefixList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixList); + + /** PublicDelegatedPrefixList id. */ + public id?: (string|null); + + /** PublicDelegatedPrefixList items. */ + public items: google.cloud.compute.v1.IPublicDelegatedPrefix[]; + + /** PublicDelegatedPrefixList kind. */ + public kind?: (string|null); + + /** PublicDelegatedPrefixList nextPageToken. */ + public nextPageToken?: (string|null); + + /** PublicDelegatedPrefixList selfLink. */ + public selfLink?: (string|null); + + /** PublicDelegatedPrefixList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** PublicDelegatedPrefixList _id. */ + public _id?: "id"; + + /** PublicDelegatedPrefixList _kind. */ + public _kind?: "kind"; + + /** PublicDelegatedPrefixList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** PublicDelegatedPrefixList _selfLink. */ + public _selfLink?: "selfLink"; + + /** PublicDelegatedPrefixList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new PublicDelegatedPrefixList instance using the specified properties. + * @param [properties] Properties to set + * @returns PublicDelegatedPrefixList instance + */ + public static create(properties?: google.cloud.compute.v1.IPublicDelegatedPrefixList): google.cloud.compute.v1.PublicDelegatedPrefixList; + + /** + * Encodes the specified PublicDelegatedPrefixList message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixList.verify|verify} messages. + * @param message PublicDelegatedPrefixList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPublicDelegatedPrefixList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublicDelegatedPrefixList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixList.verify|verify} messages. + * @param message PublicDelegatedPrefixList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPublicDelegatedPrefixList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublicDelegatedPrefixList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublicDelegatedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PublicDelegatedPrefixList; + + /** + * Decodes a PublicDelegatedPrefixList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublicDelegatedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PublicDelegatedPrefixList; + + /** + * Verifies a PublicDelegatedPrefixList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PublicDelegatedPrefixList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublicDelegatedPrefixList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PublicDelegatedPrefixList; + + /** + * Creates a plain object from a PublicDelegatedPrefixList message. Also converts values to other types if specified. + * @param message PublicDelegatedPrefixList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PublicDelegatedPrefixList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublicDelegatedPrefixList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Region. */ + interface IRegion { + + /** Region creationTimestamp */ + creationTimestamp?: (string|null); + + /** Region deprecated */ + deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** Region description */ + description?: (string|null); + + /** Region id */ + id?: (number|Long|string|null); + + /** Region kind */ + kind?: (string|null); + + /** Region name */ + name?: (string|null); + + /** Region quotas */ + quotas?: (google.cloud.compute.v1.IQuota[]|null); + + /** Region selfLink */ + selfLink?: (string|null); + + /** Region status */ + status?: (google.cloud.compute.v1.Region.Status|keyof typeof google.cloud.compute.v1.Region.Status|null); + + /** Region supportsPzs */ + supportsPzs?: (boolean|null); + + /** Region zones */ + zones?: (string[]|null); + } + + /** Represents a Region. */ + class Region implements IRegion { + + /** + * Constructs a new Region. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegion); + + /** Region creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Region deprecated. */ + public deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** Region description. */ + public description?: (string|null); + + /** Region id. */ + public id?: (number|Long|string|null); + + /** Region kind. */ + public kind?: (string|null); + + /** Region name. */ + public name?: (string|null); + + /** Region quotas. */ + public quotas: google.cloud.compute.v1.IQuota[]; + + /** Region selfLink. */ + public selfLink?: (string|null); + + /** Region status. */ + public status?: (google.cloud.compute.v1.Region.Status|keyof typeof google.cloud.compute.v1.Region.Status|null); + + /** Region supportsPzs. */ + public supportsPzs?: (boolean|null); + + /** Region zones. */ + public zones: string[]; + + /** Region _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Region _deprecated. */ + public _deprecated?: "deprecated"; + + /** Region _description. */ + public _description?: "description"; + + /** Region _id. */ + public _id?: "id"; + + /** Region _kind. */ + public _kind?: "kind"; + + /** Region _name. */ + public _name?: "name"; + + /** Region _selfLink. */ + public _selfLink?: "selfLink"; + + /** Region _status. */ + public _status?: "status"; + + /** Region _supportsPzs. */ + public _supportsPzs?: "supportsPzs"; + + /** + * Creates a new Region instance using the specified properties. + * @param [properties] Properties to set + * @returns Region instance + */ + public static create(properties?: google.cloud.compute.v1.IRegion): google.cloud.compute.v1.Region; + + /** + * Encodes the specified Region message. Does not implicitly {@link google.cloud.compute.v1.Region.verify|verify} messages. + * @param message Region message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Region message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Region.verify|verify} messages. + * @param message Region message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Region message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Region + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Region; + + /** + * Decodes a Region message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Region + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Region; + + /** + * Verifies a Region message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Region message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Region + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Region; + + /** + * Creates a plain object from a Region message. Also converts values to other types if specified. + * @param message Region + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Region, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Region to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Region { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + DOWN = 2104482, + UP = 2715 + } + } + + /** Properties of a RegionAutoscalerList. */ + interface IRegionAutoscalerList { + + /** RegionAutoscalerList id */ + id?: (string|null); + + /** RegionAutoscalerList items */ + items?: (google.cloud.compute.v1.IAutoscaler[]|null); + + /** RegionAutoscalerList kind */ + kind?: (string|null); + + /** RegionAutoscalerList nextPageToken */ + nextPageToken?: (string|null); + + /** RegionAutoscalerList selfLink */ + selfLink?: (string|null); + + /** RegionAutoscalerList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RegionAutoscalerList. */ + class RegionAutoscalerList implements IRegionAutoscalerList { + + /** + * Constructs a new RegionAutoscalerList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionAutoscalerList); + + /** RegionAutoscalerList id. */ + public id?: (string|null); + + /** RegionAutoscalerList items. */ + public items: google.cloud.compute.v1.IAutoscaler[]; + + /** RegionAutoscalerList kind. */ + public kind?: (string|null); + + /** RegionAutoscalerList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionAutoscalerList selfLink. */ + public selfLink?: (string|null); + + /** RegionAutoscalerList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RegionAutoscalerList _id. */ + public _id?: "id"; + + /** RegionAutoscalerList _kind. */ + public _kind?: "kind"; + + /** RegionAutoscalerList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RegionAutoscalerList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RegionAutoscalerList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RegionAutoscalerList instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionAutoscalerList instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionAutoscalerList): google.cloud.compute.v1.RegionAutoscalerList; + + /** + * Encodes the specified RegionAutoscalerList message. Does not implicitly {@link google.cloud.compute.v1.RegionAutoscalerList.verify|verify} messages. + * @param message RegionAutoscalerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionAutoscalerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionAutoscalerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionAutoscalerList.verify|verify} messages. + * @param message RegionAutoscalerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionAutoscalerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionAutoscalerList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionAutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionAutoscalerList; + + /** + * Decodes a RegionAutoscalerList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionAutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionAutoscalerList; + + /** + * Verifies a RegionAutoscalerList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionAutoscalerList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionAutoscalerList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionAutoscalerList; + + /** + * Creates a plain object from a RegionAutoscalerList message. Also converts values to other types if specified. + * @param message RegionAutoscalerList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionAutoscalerList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionAutoscalerList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionDiskTypeList. */ + interface IRegionDiskTypeList { + + /** RegionDiskTypeList id */ + id?: (string|null); + + /** RegionDiskTypeList items */ + items?: (google.cloud.compute.v1.IDiskType[]|null); + + /** RegionDiskTypeList kind */ + kind?: (string|null); + + /** RegionDiskTypeList nextPageToken */ + nextPageToken?: (string|null); + + /** RegionDiskTypeList selfLink */ + selfLink?: (string|null); + + /** RegionDiskTypeList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RegionDiskTypeList. */ + class RegionDiskTypeList implements IRegionDiskTypeList { + + /** + * Constructs a new RegionDiskTypeList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionDiskTypeList); + + /** RegionDiskTypeList id. */ + public id?: (string|null); + + /** RegionDiskTypeList items. */ + public items: google.cloud.compute.v1.IDiskType[]; + + /** RegionDiskTypeList kind. */ + public kind?: (string|null); + + /** RegionDiskTypeList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionDiskTypeList selfLink. */ + public selfLink?: (string|null); + + /** RegionDiskTypeList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RegionDiskTypeList _id. */ + public _id?: "id"; + + /** RegionDiskTypeList _kind. */ + public _kind?: "kind"; + + /** RegionDiskTypeList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RegionDiskTypeList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RegionDiskTypeList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RegionDiskTypeList instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionDiskTypeList instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionDiskTypeList): google.cloud.compute.v1.RegionDiskTypeList; + + /** + * Encodes the specified RegionDiskTypeList message. Does not implicitly {@link google.cloud.compute.v1.RegionDiskTypeList.verify|verify} messages. + * @param message RegionDiskTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionDiskTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionDiskTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDiskTypeList.verify|verify} messages. + * @param message RegionDiskTypeList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionDiskTypeList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionDiskTypeList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionDiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionDiskTypeList; + + /** + * Decodes a RegionDiskTypeList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionDiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionDiskTypeList; + + /** + * Verifies a RegionDiskTypeList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionDiskTypeList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionDiskTypeList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionDiskTypeList; + + /** + * Creates a plain object from a RegionDiskTypeList message. Also converts values to other types if specified. + * @param message RegionDiskTypeList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionDiskTypeList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionDiskTypeList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionDisksAddResourcePoliciesRequest. */ + interface IRegionDisksAddResourcePoliciesRequest { + + /** RegionDisksAddResourcePoliciesRequest resourcePolicies */ + resourcePolicies?: (string[]|null); + } + + /** Represents a RegionDisksAddResourcePoliciesRequest. */ + class RegionDisksAddResourcePoliciesRequest implements IRegionDisksAddResourcePoliciesRequest { + + /** + * Constructs a new RegionDisksAddResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest); + + /** RegionDisksAddResourcePoliciesRequest resourcePolicies. */ + public resourcePolicies: string[]; + + /** + * Creates a new RegionDisksAddResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionDisksAddResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest): google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest; + + /** + * Encodes the specified RegionDisksAddResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.verify|verify} messages. + * @param message RegionDisksAddResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionDisksAddResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.verify|verify} messages. + * @param message RegionDisksAddResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionDisksAddResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionDisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest; + + /** + * Decodes a RegionDisksAddResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionDisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest; + + /** + * Verifies a RegionDisksAddResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionDisksAddResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionDisksAddResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest; + + /** + * Creates a plain object from a RegionDisksAddResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message RegionDisksAddResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionDisksAddResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionDisksRemoveResourcePoliciesRequest. */ + interface IRegionDisksRemoveResourcePoliciesRequest { + + /** RegionDisksRemoveResourcePoliciesRequest resourcePolicies */ + resourcePolicies?: (string[]|null); + } + + /** Represents a RegionDisksRemoveResourcePoliciesRequest. */ + class RegionDisksRemoveResourcePoliciesRequest implements IRegionDisksRemoveResourcePoliciesRequest { + + /** + * Constructs a new RegionDisksRemoveResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest); + + /** RegionDisksRemoveResourcePoliciesRequest resourcePolicies. */ + public resourcePolicies: string[]; + + /** + * Creates a new RegionDisksRemoveResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionDisksRemoveResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest): google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest; + + /** + * Encodes the specified RegionDisksRemoveResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @param message RegionDisksRemoveResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionDisksRemoveResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @param message RegionDisksRemoveResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionDisksRemoveResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionDisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest; + + /** + * Decodes a RegionDisksRemoveResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionDisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest; + + /** + * Verifies a RegionDisksRemoveResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionDisksRemoveResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionDisksRemoveResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest; + + /** + * Creates a plain object from a RegionDisksRemoveResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message RegionDisksRemoveResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionDisksRemoveResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionDisksResizeRequest. */ + interface IRegionDisksResizeRequest { + + /** RegionDisksResizeRequest sizeGb */ + sizeGb?: (number|Long|string|null); + } + + /** Represents a RegionDisksResizeRequest. */ + class RegionDisksResizeRequest implements IRegionDisksResizeRequest { + + /** + * Constructs a new RegionDisksResizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionDisksResizeRequest); + + /** RegionDisksResizeRequest sizeGb. */ + public sizeGb?: (number|Long|string|null); + + /** RegionDisksResizeRequest _sizeGb. */ + public _sizeGb?: "sizeGb"; + + /** + * Creates a new RegionDisksResizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionDisksResizeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionDisksResizeRequest): google.cloud.compute.v1.RegionDisksResizeRequest; + + /** + * Encodes the specified RegionDisksResizeRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionDisksResizeRequest.verify|verify} messages. + * @param message RegionDisksResizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionDisksResizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionDisksResizeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDisksResizeRequest.verify|verify} messages. + * @param message RegionDisksResizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionDisksResizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionDisksResizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionDisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionDisksResizeRequest; + + /** + * Decodes a RegionDisksResizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionDisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionDisksResizeRequest; + + /** + * Verifies a RegionDisksResizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionDisksResizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionDisksResizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionDisksResizeRequest; + + /** + * Creates a plain object from a RegionDisksResizeRequest message. Also converts values to other types if specified. + * @param message RegionDisksResizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionDisksResizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionDisksResizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupList. */ + interface IRegionInstanceGroupList { + + /** RegionInstanceGroupList id */ + id?: (string|null); + + /** RegionInstanceGroupList items */ + items?: (google.cloud.compute.v1.IInstanceGroup[]|null); + + /** RegionInstanceGroupList kind */ + kind?: (string|null); + + /** RegionInstanceGroupList nextPageToken */ + nextPageToken?: (string|null); + + /** RegionInstanceGroupList selfLink */ + selfLink?: (string|null); + + /** RegionInstanceGroupList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RegionInstanceGroupList. */ + class RegionInstanceGroupList implements IRegionInstanceGroupList { + + /** + * Constructs a new RegionInstanceGroupList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupList); + + /** RegionInstanceGroupList id. */ + public id?: (string|null); + + /** RegionInstanceGroupList items. */ + public items: google.cloud.compute.v1.IInstanceGroup[]; + + /** RegionInstanceGroupList kind. */ + public kind?: (string|null); + + /** RegionInstanceGroupList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionInstanceGroupList selfLink. */ + public selfLink?: (string|null); + + /** RegionInstanceGroupList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RegionInstanceGroupList _id. */ + public _id?: "id"; + + /** RegionInstanceGroupList _kind. */ + public _kind?: "kind"; + + /** RegionInstanceGroupList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RegionInstanceGroupList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RegionInstanceGroupList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RegionInstanceGroupList instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupList instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupList): google.cloud.compute.v1.RegionInstanceGroupList; + + /** + * Encodes the specified RegionInstanceGroupList message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupList.verify|verify} messages. + * @param message RegionInstanceGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupList.verify|verify} messages. + * @param message RegionInstanceGroupList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupList; + + /** + * Decodes a RegionInstanceGroupList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupList; + + /** + * Verifies a RegionInstanceGroupList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupList; + + /** + * Creates a plain object from a RegionInstanceGroupList message. Also converts values to other types if specified. + * @param message RegionInstanceGroupList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagerDeleteInstanceConfigReq. */ + interface IRegionInstanceGroupManagerDeleteInstanceConfigReq { + + /** RegionInstanceGroupManagerDeleteInstanceConfigReq names */ + names?: (string[]|null); + } + + /** Represents a RegionInstanceGroupManagerDeleteInstanceConfigReq. */ + class RegionInstanceGroupManagerDeleteInstanceConfigReq implements IRegionInstanceGroupManagerDeleteInstanceConfigReq { + + /** + * Constructs a new RegionInstanceGroupManagerDeleteInstanceConfigReq. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq); + + /** RegionInstanceGroupManagerDeleteInstanceConfigReq names. */ + public names: string[]; + + /** + * Creates a new RegionInstanceGroupManagerDeleteInstanceConfigReq instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagerDeleteInstanceConfigReq instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq): google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq; + + /** + * Encodes the specified RegionInstanceGroupManagerDeleteInstanceConfigReq message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.verify|verify} messages. + * @param message RegionInstanceGroupManagerDeleteInstanceConfigReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagerDeleteInstanceConfigReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.verify|verify} messages. + * @param message RegionInstanceGroupManagerDeleteInstanceConfigReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagerDeleteInstanceConfigReq message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagerDeleteInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq; + + /** + * Decodes a RegionInstanceGroupManagerDeleteInstanceConfigReq message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagerDeleteInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq; + + /** + * Verifies a RegionInstanceGroupManagerDeleteInstanceConfigReq message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagerDeleteInstanceConfigReq message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagerDeleteInstanceConfigReq + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq; + + /** + * Creates a plain object from a RegionInstanceGroupManagerDeleteInstanceConfigReq message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagerDeleteInstanceConfigReq + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagerDeleteInstanceConfigReq to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagerList. */ + interface IRegionInstanceGroupManagerList { + + /** RegionInstanceGroupManagerList id */ + id?: (string|null); + + /** RegionInstanceGroupManagerList items */ + items?: (google.cloud.compute.v1.IInstanceGroupManager[]|null); + + /** RegionInstanceGroupManagerList kind */ + kind?: (string|null); + + /** RegionInstanceGroupManagerList nextPageToken */ + nextPageToken?: (string|null); + + /** RegionInstanceGroupManagerList selfLink */ + selfLink?: (string|null); + + /** RegionInstanceGroupManagerList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RegionInstanceGroupManagerList. */ + class RegionInstanceGroupManagerList implements IRegionInstanceGroupManagerList { + + /** + * Constructs a new RegionInstanceGroupManagerList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerList); + + /** RegionInstanceGroupManagerList id. */ + public id?: (string|null); + + /** RegionInstanceGroupManagerList items. */ + public items: google.cloud.compute.v1.IInstanceGroupManager[]; + + /** RegionInstanceGroupManagerList kind. */ + public kind?: (string|null); + + /** RegionInstanceGroupManagerList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionInstanceGroupManagerList selfLink. */ + public selfLink?: (string|null); + + /** RegionInstanceGroupManagerList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RegionInstanceGroupManagerList _id. */ + public _id?: "id"; + + /** RegionInstanceGroupManagerList _kind. */ + public _kind?: "kind"; + + /** RegionInstanceGroupManagerList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RegionInstanceGroupManagerList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RegionInstanceGroupManagerList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RegionInstanceGroupManagerList instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagerList instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerList): google.cloud.compute.v1.RegionInstanceGroupManagerList; + + /** + * Encodes the specified RegionInstanceGroupManagerList message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerList.verify|verify} messages. + * @param message RegionInstanceGroupManagerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerList.verify|verify} messages. + * @param message RegionInstanceGroupManagerList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagerList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagerList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagerList; + + /** + * Decodes a RegionInstanceGroupManagerList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagerList; + + /** + * Verifies a RegionInstanceGroupManagerList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagerList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagerList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagerList; + + /** + * Creates a plain object from a RegionInstanceGroupManagerList message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagerList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagerList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagerList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagerPatchInstanceConfigReq. */ + interface IRegionInstanceGroupManagerPatchInstanceConfigReq { + + /** RegionInstanceGroupManagerPatchInstanceConfigReq perInstanceConfigs */ + perInstanceConfigs?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + } + + /** Represents a RegionInstanceGroupManagerPatchInstanceConfigReq. */ + class RegionInstanceGroupManagerPatchInstanceConfigReq implements IRegionInstanceGroupManagerPatchInstanceConfigReq { + + /** + * Constructs a new RegionInstanceGroupManagerPatchInstanceConfigReq. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq); + + /** RegionInstanceGroupManagerPatchInstanceConfigReq perInstanceConfigs. */ + public perInstanceConfigs: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** + * Creates a new RegionInstanceGroupManagerPatchInstanceConfigReq instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagerPatchInstanceConfigReq instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq): google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq; + + /** + * Encodes the specified RegionInstanceGroupManagerPatchInstanceConfigReq message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.verify|verify} messages. + * @param message RegionInstanceGroupManagerPatchInstanceConfigReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagerPatchInstanceConfigReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.verify|verify} messages. + * @param message RegionInstanceGroupManagerPatchInstanceConfigReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagerPatchInstanceConfigReq message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagerPatchInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq; + + /** + * Decodes a RegionInstanceGroupManagerPatchInstanceConfigReq message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagerPatchInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq; + + /** + * Verifies a RegionInstanceGroupManagerPatchInstanceConfigReq message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagerPatchInstanceConfigReq message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagerPatchInstanceConfigReq + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq; + + /** + * Creates a plain object from a RegionInstanceGroupManagerPatchInstanceConfigReq message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagerPatchInstanceConfigReq + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagerPatchInstanceConfigReq to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagerUpdateInstanceConfigReq. */ + interface IRegionInstanceGroupManagerUpdateInstanceConfigReq { + + /** RegionInstanceGroupManagerUpdateInstanceConfigReq perInstanceConfigs */ + perInstanceConfigs?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + } + + /** Represents a RegionInstanceGroupManagerUpdateInstanceConfigReq. */ + class RegionInstanceGroupManagerUpdateInstanceConfigReq implements IRegionInstanceGroupManagerUpdateInstanceConfigReq { + + /** + * Constructs a new RegionInstanceGroupManagerUpdateInstanceConfigReq. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq); + + /** RegionInstanceGroupManagerUpdateInstanceConfigReq perInstanceConfigs. */ + public perInstanceConfigs: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** + * Creates a new RegionInstanceGroupManagerUpdateInstanceConfigReq instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagerUpdateInstanceConfigReq instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq): google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq; + + /** + * Encodes the specified RegionInstanceGroupManagerUpdateInstanceConfigReq message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.verify|verify} messages. + * @param message RegionInstanceGroupManagerUpdateInstanceConfigReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagerUpdateInstanceConfigReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.verify|verify} messages. + * @param message RegionInstanceGroupManagerUpdateInstanceConfigReq message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagerUpdateInstanceConfigReq message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagerUpdateInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq; + + /** + * Decodes a RegionInstanceGroupManagerUpdateInstanceConfigReq message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagerUpdateInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq; + + /** + * Verifies a RegionInstanceGroupManagerUpdateInstanceConfigReq message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagerUpdateInstanceConfigReq message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagerUpdateInstanceConfigReq + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq; + + /** + * Creates a plain object from a RegionInstanceGroupManagerUpdateInstanceConfigReq message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagerUpdateInstanceConfigReq + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagerUpdateInstanceConfigReq to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersAbandonInstancesRequest. */ + interface IRegionInstanceGroupManagersAbandonInstancesRequest { + + /** RegionInstanceGroupManagersAbandonInstancesRequest instances */ + instances?: (string[]|null); + } + + /** Represents a RegionInstanceGroupManagersAbandonInstancesRequest. */ + class RegionInstanceGroupManagersAbandonInstancesRequest implements IRegionInstanceGroupManagersAbandonInstancesRequest { + + /** + * Constructs a new RegionInstanceGroupManagersAbandonInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest); + + /** RegionInstanceGroupManagersAbandonInstancesRequest instances. */ + public instances: string[]; + + /** + * Creates a new RegionInstanceGroupManagersAbandonInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersAbandonInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest): google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; + + /** + * Encodes the specified RegionInstanceGroupManagersAbandonInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersAbandonInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; + + /** + * Decodes a RegionInstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; + + /** + * Verifies a RegionInstanceGroupManagersAbandonInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersAbandonInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersAbandonInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest; + + /** + * Creates a plain object from a RegionInstanceGroupManagersAbandonInstancesRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersAbandonInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersAbandonInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersApplyUpdatesRequest. */ + interface IRegionInstanceGroupManagersApplyUpdatesRequest { + + /** RegionInstanceGroupManagersApplyUpdatesRequest allInstances */ + allInstances?: (boolean|null); + + /** RegionInstanceGroupManagersApplyUpdatesRequest instances */ + instances?: (string[]|null); + + /** RegionInstanceGroupManagersApplyUpdatesRequest minimalAction */ + minimalAction?: (string|null); + + /** RegionInstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction */ + mostDisruptiveAllowedAction?: (string|null); + } + + /** Represents a RegionInstanceGroupManagersApplyUpdatesRequest. */ + class RegionInstanceGroupManagersApplyUpdatesRequest implements IRegionInstanceGroupManagersApplyUpdatesRequest { + + /** + * Constructs a new RegionInstanceGroupManagersApplyUpdatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest); + + /** RegionInstanceGroupManagersApplyUpdatesRequest allInstances. */ + public allInstances?: (boolean|null); + + /** RegionInstanceGroupManagersApplyUpdatesRequest instances. */ + public instances: string[]; + + /** RegionInstanceGroupManagersApplyUpdatesRequest minimalAction. */ + public minimalAction?: (string|null); + + /** RegionInstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction. */ + public mostDisruptiveAllowedAction?: (string|null); + + /** RegionInstanceGroupManagersApplyUpdatesRequest _allInstances. */ + public _allInstances?: "allInstances"; + + /** RegionInstanceGroupManagersApplyUpdatesRequest _minimalAction. */ + public _minimalAction?: "minimalAction"; + + /** RegionInstanceGroupManagersApplyUpdatesRequest _mostDisruptiveAllowedAction. */ + public _mostDisruptiveAllowedAction?: "mostDisruptiveAllowedAction"; + + /** + * Creates a new RegionInstanceGroupManagersApplyUpdatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersApplyUpdatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest): google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest; + + /** + * Encodes the specified RegionInstanceGroupManagersApplyUpdatesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersApplyUpdatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest; + + /** + * Decodes a RegionInstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest; + + /** + * Verifies a RegionInstanceGroupManagersApplyUpdatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersApplyUpdatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersApplyUpdatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest; + + /** + * Creates a plain object from a RegionInstanceGroupManagersApplyUpdatesRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersApplyUpdatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersApplyUpdatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersCreateInstancesRequest. */ + interface IRegionInstanceGroupManagersCreateInstancesRequest { + + /** RegionInstanceGroupManagersCreateInstancesRequest instances */ + instances?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + } + + /** Represents a RegionInstanceGroupManagersCreateInstancesRequest. */ + class RegionInstanceGroupManagersCreateInstancesRequest implements IRegionInstanceGroupManagersCreateInstancesRequest { + + /** + * Constructs a new RegionInstanceGroupManagersCreateInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest); + + /** RegionInstanceGroupManagersCreateInstancesRequest instances. */ + public instances: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** + * Creates a new RegionInstanceGroupManagersCreateInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersCreateInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest): google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest; + + /** + * Encodes the specified RegionInstanceGroupManagersCreateInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest; + + /** + * Decodes a RegionInstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest; + + /** + * Verifies a RegionInstanceGroupManagersCreateInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersCreateInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest; + + /** + * Creates a plain object from a RegionInstanceGroupManagersCreateInstancesRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersCreateInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersCreateInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersDeleteInstancesRequest. */ + interface IRegionInstanceGroupManagersDeleteInstancesRequest { + + /** RegionInstanceGroupManagersDeleteInstancesRequest instances */ + instances?: (string[]|null); + } + + /** Represents a RegionInstanceGroupManagersDeleteInstancesRequest. */ + class RegionInstanceGroupManagersDeleteInstancesRequest implements IRegionInstanceGroupManagersDeleteInstancesRequest { + + /** + * Constructs a new RegionInstanceGroupManagersDeleteInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest); + + /** RegionInstanceGroupManagersDeleteInstancesRequest instances. */ + public instances: string[]; + + /** + * Creates a new RegionInstanceGroupManagersDeleteInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersDeleteInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest): google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; + + /** + * Encodes the specified RegionInstanceGroupManagersDeleteInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersDeleteInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; + + /** + * Decodes a RegionInstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; + + /** + * Verifies a RegionInstanceGroupManagersDeleteInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersDeleteInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersDeleteInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest; + + /** + * Creates a plain object from a RegionInstanceGroupManagersDeleteInstancesRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersDeleteInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersDeleteInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersListErrorsResponse. */ + interface IRegionInstanceGroupManagersListErrorsResponse { + + /** RegionInstanceGroupManagersListErrorsResponse items */ + items?: (google.cloud.compute.v1.IInstanceManagedByIgmError[]|null); + + /** RegionInstanceGroupManagersListErrorsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a RegionInstanceGroupManagersListErrorsResponse. */ + class RegionInstanceGroupManagersListErrorsResponse implements IRegionInstanceGroupManagersListErrorsResponse { + + /** + * Constructs a new RegionInstanceGroupManagersListErrorsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse); + + /** RegionInstanceGroupManagersListErrorsResponse items. */ + public items: google.cloud.compute.v1.IInstanceManagedByIgmError[]; + + /** RegionInstanceGroupManagersListErrorsResponse nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionInstanceGroupManagersListErrorsResponse _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** + * Creates a new RegionInstanceGroupManagersListErrorsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersListErrorsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse): google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse; + + /** + * Encodes the specified RegionInstanceGroupManagersListErrorsResponse message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @param message RegionInstanceGroupManagersListErrorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersListErrorsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @param message RegionInstanceGroupManagersListErrorsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersListErrorsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse; + + /** + * Decodes a RegionInstanceGroupManagersListErrorsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse; + + /** + * Verifies a RegionInstanceGroupManagersListErrorsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersListErrorsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersListErrorsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse; + + /** + * Creates a plain object from a RegionInstanceGroupManagersListErrorsResponse message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersListErrorsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersListErrorsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersListInstanceConfigsResp. */ + interface IRegionInstanceGroupManagersListInstanceConfigsResp { + + /** RegionInstanceGroupManagersListInstanceConfigsResp items */ + items?: (google.cloud.compute.v1.IPerInstanceConfig[]|null); + + /** RegionInstanceGroupManagersListInstanceConfigsResp nextPageToken */ + nextPageToken?: (string|null); + + /** RegionInstanceGroupManagersListInstanceConfigsResp warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RegionInstanceGroupManagersListInstanceConfigsResp. */ + class RegionInstanceGroupManagersListInstanceConfigsResp implements IRegionInstanceGroupManagersListInstanceConfigsResp { + + /** + * Constructs a new RegionInstanceGroupManagersListInstanceConfigsResp. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp); + + /** RegionInstanceGroupManagersListInstanceConfigsResp items. */ + public items: google.cloud.compute.v1.IPerInstanceConfig[]; + + /** RegionInstanceGroupManagersListInstanceConfigsResp nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionInstanceGroupManagersListInstanceConfigsResp warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RegionInstanceGroupManagersListInstanceConfigsResp _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RegionInstanceGroupManagersListInstanceConfigsResp _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RegionInstanceGroupManagersListInstanceConfigsResp instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersListInstanceConfigsResp instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp): google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstanceConfigsResp message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp.verify|verify} messages. + * @param message RegionInstanceGroupManagersListInstanceConfigsResp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstanceConfigsResp message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp.verify|verify} messages. + * @param message RegionInstanceGroupManagersListInstanceConfigsResp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersListInstanceConfigsResp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersListInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp; + + /** + * Decodes a RegionInstanceGroupManagersListInstanceConfigsResp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersListInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp; + + /** + * Verifies a RegionInstanceGroupManagersListInstanceConfigsResp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersListInstanceConfigsResp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersListInstanceConfigsResp + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp; + + /** + * Creates a plain object from a RegionInstanceGroupManagersListInstanceConfigsResp message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersListInstanceConfigsResp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersListInstanceConfigsResp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersListInstancesResponse. */ + interface IRegionInstanceGroupManagersListInstancesResponse { + + /** RegionInstanceGroupManagersListInstancesResponse managedInstances */ + managedInstances?: (google.cloud.compute.v1.IManagedInstance[]|null); + + /** RegionInstanceGroupManagersListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a RegionInstanceGroupManagersListInstancesResponse. */ + class RegionInstanceGroupManagersListInstancesResponse implements IRegionInstanceGroupManagersListInstancesResponse { + + /** + * Constructs a new RegionInstanceGroupManagersListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse); + + /** RegionInstanceGroupManagersListInstancesResponse managedInstances. */ + public managedInstances: google.cloud.compute.v1.IManagedInstance[]; + + /** RegionInstanceGroupManagersListInstancesResponse nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionInstanceGroupManagersListInstancesResponse _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** + * Creates a new RegionInstanceGroupManagersListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersListInstancesResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse): google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstancesResponse message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse.verify|verify} messages. + * @param message RegionInstanceGroupManagersListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse.verify|verify} messages. + * @param message RegionInstanceGroupManagersListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; + + /** + * Decodes a RegionInstanceGroupManagersListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; + + /** + * Verifies a RegionInstanceGroupManagersListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse; + + /** + * Creates a plain object from a RegionInstanceGroupManagersListInstancesResponse message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersRecreateRequest. */ + interface IRegionInstanceGroupManagersRecreateRequest { + + /** RegionInstanceGroupManagersRecreateRequest instances */ + instances?: (string[]|null); + } + + /** Represents a RegionInstanceGroupManagersRecreateRequest. */ + class RegionInstanceGroupManagersRecreateRequest implements IRegionInstanceGroupManagersRecreateRequest { + + /** + * Constructs a new RegionInstanceGroupManagersRecreateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest); + + /** RegionInstanceGroupManagersRecreateRequest instances. */ + public instances: string[]; + + /** + * Creates a new RegionInstanceGroupManagersRecreateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersRecreateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest): google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; + + /** + * Encodes the specified RegionInstanceGroupManagersRecreateRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersRecreateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersRecreateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersRecreateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersRecreateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersRecreateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; + + /** + * Decodes a RegionInstanceGroupManagersRecreateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersRecreateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; + + /** + * Verifies a RegionInstanceGroupManagersRecreateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersRecreateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersRecreateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest; + + /** + * Creates a plain object from a RegionInstanceGroupManagersRecreateRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersRecreateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersRecreateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersSetTargetPoolsRequest. */ + interface IRegionInstanceGroupManagersSetTargetPoolsRequest { + + /** RegionInstanceGroupManagersSetTargetPoolsRequest fingerprint */ + fingerprint?: (string|null); + + /** RegionInstanceGroupManagersSetTargetPoolsRequest targetPools */ + targetPools?: (string[]|null); + } + + /** Represents a RegionInstanceGroupManagersSetTargetPoolsRequest. */ + class RegionInstanceGroupManagersSetTargetPoolsRequest implements IRegionInstanceGroupManagersSetTargetPoolsRequest { + + /** + * Constructs a new RegionInstanceGroupManagersSetTargetPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest); + + /** RegionInstanceGroupManagersSetTargetPoolsRequest fingerprint. */ + public fingerprint?: (string|null); + + /** RegionInstanceGroupManagersSetTargetPoolsRequest targetPools. */ + public targetPools: string[]; + + /** RegionInstanceGroupManagersSetTargetPoolsRequest _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** + * Creates a new RegionInstanceGroupManagersSetTargetPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersSetTargetPoolsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest): google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; + + /** + * Decodes a RegionInstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; + + /** + * Verifies a RegionInstanceGroupManagersSetTargetPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersSetTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersSetTargetPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest; + + /** + * Creates a plain object from a RegionInstanceGroupManagersSetTargetPoolsRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersSetTargetPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersSetTargetPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupManagersSetTemplateRequest. */ + interface IRegionInstanceGroupManagersSetTemplateRequest { + + /** RegionInstanceGroupManagersSetTemplateRequest instanceTemplate */ + instanceTemplate?: (string|null); + } + + /** Represents a RegionInstanceGroupManagersSetTemplateRequest. */ + class RegionInstanceGroupManagersSetTemplateRequest implements IRegionInstanceGroupManagersSetTemplateRequest { + + /** + * Constructs a new RegionInstanceGroupManagersSetTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest); + + /** RegionInstanceGroupManagersSetTemplateRequest instanceTemplate. */ + public instanceTemplate?: (string|null); + + /** RegionInstanceGroupManagersSetTemplateRequest _instanceTemplate. */ + public _instanceTemplate?: "instanceTemplate"; + + /** + * Creates a new RegionInstanceGroupManagersSetTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupManagersSetTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest): google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersSetTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.verify|verify} messages. + * @param message RegionInstanceGroupManagersSetTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupManagersSetTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupManagersSetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; + + /** + * Decodes a RegionInstanceGroupManagersSetTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupManagersSetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; + + /** + * Verifies a RegionInstanceGroupManagersSetTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupManagersSetTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupManagersSetTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest; + + /** + * Creates a plain object from a RegionInstanceGroupManagersSetTemplateRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupManagersSetTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupManagersSetTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupsListInstances. */ + interface IRegionInstanceGroupsListInstances { + + /** RegionInstanceGroupsListInstances id */ + id?: (string|null); + + /** RegionInstanceGroupsListInstances items */ + items?: (google.cloud.compute.v1.IInstanceWithNamedPorts[]|null); + + /** RegionInstanceGroupsListInstances kind */ + kind?: (string|null); + + /** RegionInstanceGroupsListInstances nextPageToken */ + nextPageToken?: (string|null); + + /** RegionInstanceGroupsListInstances selfLink */ + selfLink?: (string|null); + + /** RegionInstanceGroupsListInstances warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RegionInstanceGroupsListInstances. */ + class RegionInstanceGroupsListInstances implements IRegionInstanceGroupsListInstances { + + /** + * Constructs a new RegionInstanceGroupsListInstances. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupsListInstances); + + /** RegionInstanceGroupsListInstances id. */ + public id?: (string|null); + + /** RegionInstanceGroupsListInstances items. */ + public items: google.cloud.compute.v1.IInstanceWithNamedPorts[]; + + /** RegionInstanceGroupsListInstances kind. */ + public kind?: (string|null); + + /** RegionInstanceGroupsListInstances nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionInstanceGroupsListInstances selfLink. */ + public selfLink?: (string|null); + + /** RegionInstanceGroupsListInstances warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RegionInstanceGroupsListInstances _id. */ + public _id?: "id"; + + /** RegionInstanceGroupsListInstances _kind. */ + public _kind?: "kind"; + + /** RegionInstanceGroupsListInstances _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RegionInstanceGroupsListInstances _selfLink. */ + public _selfLink?: "selfLink"; + + /** RegionInstanceGroupsListInstances _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RegionInstanceGroupsListInstances instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupsListInstances instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupsListInstances): google.cloud.compute.v1.RegionInstanceGroupsListInstances; + + /** + * Encodes the specified RegionInstanceGroupsListInstances message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstances.verify|verify} messages. + * @param message RegionInstanceGroupsListInstances message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupsListInstances, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupsListInstances message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstances.verify|verify} messages. + * @param message RegionInstanceGroupsListInstances message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupsListInstances, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupsListInstances message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupsListInstances; + + /** + * Decodes a RegionInstanceGroupsListInstances message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupsListInstances; + + /** + * Verifies a RegionInstanceGroupsListInstances message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupsListInstances message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupsListInstances + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupsListInstances; + + /** + * Creates a plain object from a RegionInstanceGroupsListInstances message. Also converts values to other types if specified. + * @param message RegionInstanceGroupsListInstances + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupsListInstances, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupsListInstances to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionInstanceGroupsListInstancesRequest. */ + interface IRegionInstanceGroupsListInstancesRequest { + + /** RegionInstanceGroupsListInstancesRequest instanceState */ + instanceState?: (google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState|keyof typeof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState|null); + + /** RegionInstanceGroupsListInstancesRequest portName */ + portName?: (string|null); + } + + /** Represents a RegionInstanceGroupsListInstancesRequest. */ + class RegionInstanceGroupsListInstancesRequest implements IRegionInstanceGroupsListInstancesRequest { + + /** + * Constructs a new RegionInstanceGroupsListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest); + + /** RegionInstanceGroupsListInstancesRequest instanceState. */ + public instanceState?: (google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState|keyof typeof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState|null); + + /** RegionInstanceGroupsListInstancesRequest portName. */ + public portName?: (string|null); + + /** RegionInstanceGroupsListInstancesRequest _instanceState. */ + public _instanceState?: "instanceState"; + + /** RegionInstanceGroupsListInstancesRequest _portName. */ + public _portName?: "portName"; + + /** + * Creates a new RegionInstanceGroupsListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupsListInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest): google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; + + /** + * Encodes the specified RegionInstanceGroupsListInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupsListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupsListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.verify|verify} messages. + * @param message RegionInstanceGroupsListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupsListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; + + /** + * Decodes a RegionInstanceGroupsListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; + + /** + * Verifies a RegionInstanceGroupsListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupsListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupsListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest; + + /** + * Creates a plain object from a RegionInstanceGroupsListInstancesRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupsListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupsListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RegionInstanceGroupsListInstancesRequest { + + /** InstanceState enum. */ + enum InstanceState { + UNDEFINED_INSTANCE_STATE = 0, + ALL = 64897, + RUNNING = 121282975 + } + } + + /** Properties of a RegionInstanceGroupsSetNamedPortsRequest. */ + interface IRegionInstanceGroupsSetNamedPortsRequest { + + /** RegionInstanceGroupsSetNamedPortsRequest fingerprint */ + fingerprint?: (string|null); + + /** RegionInstanceGroupsSetNamedPortsRequest namedPorts */ + namedPorts?: (google.cloud.compute.v1.INamedPort[]|null); + } + + /** Represents a RegionInstanceGroupsSetNamedPortsRequest. */ + class RegionInstanceGroupsSetNamedPortsRequest implements IRegionInstanceGroupsSetNamedPortsRequest { + + /** + * Constructs a new RegionInstanceGroupsSetNamedPortsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest); + + /** RegionInstanceGroupsSetNamedPortsRequest fingerprint. */ + public fingerprint?: (string|null); + + /** RegionInstanceGroupsSetNamedPortsRequest namedPorts. */ + public namedPorts: google.cloud.compute.v1.INamedPort[]; + + /** RegionInstanceGroupsSetNamedPortsRequest _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** + * Creates a new RegionInstanceGroupsSetNamedPortsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionInstanceGroupsSetNamedPortsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest): google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; + + /** + * Encodes the specified RegionInstanceGroupsSetNamedPortsRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @param message RegionInstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionInstanceGroupsSetNamedPortsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @param message RegionInstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionInstanceGroupsSetNamedPortsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionInstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; + + /** + * Decodes a RegionInstanceGroupsSetNamedPortsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionInstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; + + /** + * Verifies a RegionInstanceGroupsSetNamedPortsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionInstanceGroupsSetNamedPortsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionInstanceGroupsSetNamedPortsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest; + + /** + * Creates a plain object from a RegionInstanceGroupsSetNamedPortsRequest message. Also converts values to other types if specified. + * @param message RegionInstanceGroupsSetNamedPortsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionInstanceGroupsSetNamedPortsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionList. */ + interface IRegionList { + + /** RegionList id */ + id?: (string|null); + + /** RegionList items */ + items?: (google.cloud.compute.v1.IRegion[]|null); + + /** RegionList kind */ + kind?: (string|null); + + /** RegionList nextPageToken */ + nextPageToken?: (string|null); + + /** RegionList selfLink */ + selfLink?: (string|null); + + /** RegionList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RegionList. */ + class RegionList implements IRegionList { + + /** + * Constructs a new RegionList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionList); + + /** RegionList id. */ + public id?: (string|null); + + /** RegionList items. */ + public items: google.cloud.compute.v1.IRegion[]; + + /** RegionList kind. */ + public kind?: (string|null); + + /** RegionList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RegionList selfLink. */ + public selfLink?: (string|null); + + /** RegionList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RegionList _id. */ + public _id?: "id"; + + /** RegionList _kind. */ + public _kind?: "kind"; + + /** RegionList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RegionList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RegionList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RegionList instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionList instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionList): google.cloud.compute.v1.RegionList; + + /** + * Encodes the specified RegionList message. Does not implicitly {@link google.cloud.compute.v1.RegionList.verify|verify} messages. + * @param message RegionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionList.verify|verify} messages. + * @param message RegionList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionList; + + /** + * Decodes a RegionList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionList; + + /** + * Verifies a RegionList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionList; + + /** + * Creates a plain object from a RegionList message. Also converts values to other types if specified. + * @param message RegionList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionSetLabelsRequest. */ + interface IRegionSetLabelsRequest { + + /** RegionSetLabelsRequest labelFingerprint */ + labelFingerprint?: (string|null); + + /** RegionSetLabelsRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a RegionSetLabelsRequest. */ + class RegionSetLabelsRequest implements IRegionSetLabelsRequest { + + /** + * Constructs a new RegionSetLabelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionSetLabelsRequest); + + /** RegionSetLabelsRequest labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** RegionSetLabelsRequest labels. */ + public labels: { [k: string]: string }; + + /** RegionSetLabelsRequest _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** + * Creates a new RegionSetLabelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionSetLabelsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionSetLabelsRequest): google.cloud.compute.v1.RegionSetLabelsRequest; + + /** + * Encodes the specified RegionSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionSetLabelsRequest.verify|verify} messages. + * @param message RegionSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionSetLabelsRequest.verify|verify} messages. + * @param message RegionSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionSetLabelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionSetLabelsRequest; + + /** + * Decodes a RegionSetLabelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionSetLabelsRequest; + + /** + * Verifies a RegionSetLabelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionSetLabelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionSetLabelsRequest; + + /** + * Creates a plain object from a RegionSetLabelsRequest message. Also converts values to other types if specified. + * @param message RegionSetLabelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionSetLabelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionSetLabelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionSetPolicyRequest. */ + interface IRegionSetPolicyRequest { + + /** RegionSetPolicyRequest bindings */ + bindings?: (google.cloud.compute.v1.IBinding[]|null); + + /** RegionSetPolicyRequest etag */ + etag?: (string|null); + + /** RegionSetPolicyRequest policy */ + policy?: (google.cloud.compute.v1.IPolicy|null); + } + + /** Represents a RegionSetPolicyRequest. */ + class RegionSetPolicyRequest implements IRegionSetPolicyRequest { + + /** + * Constructs a new RegionSetPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionSetPolicyRequest); + + /** RegionSetPolicyRequest bindings. */ + public bindings: google.cloud.compute.v1.IBinding[]; + + /** RegionSetPolicyRequest etag. */ + public etag?: (string|null); + + /** RegionSetPolicyRequest policy. */ + public policy?: (google.cloud.compute.v1.IPolicy|null); + + /** RegionSetPolicyRequest _etag. */ + public _etag?: "etag"; + + /** RegionSetPolicyRequest _policy. */ + public _policy?: "policy"; + + /** + * Creates a new RegionSetPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionSetPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionSetPolicyRequest): google.cloud.compute.v1.RegionSetPolicyRequest; + + /** + * Encodes the specified RegionSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionSetPolicyRequest.verify|verify} messages. + * @param message RegionSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionSetPolicyRequest.verify|verify} messages. + * @param message RegionSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionSetPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionSetPolicyRequest; + + /** + * Decodes a RegionSetPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionSetPolicyRequest; + + /** + * Verifies a RegionSetPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionSetPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionSetPolicyRequest; + + /** + * Creates a plain object from a RegionSetPolicyRequest message. Also converts values to other types if specified. + * @param message RegionSetPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionSetPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionSetPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionTargetHttpsProxiesSetSslCertificatesRequest. */ + interface IRegionTargetHttpsProxiesSetSslCertificatesRequest { + + /** RegionTargetHttpsProxiesSetSslCertificatesRequest sslCertificates */ + sslCertificates?: (string[]|null); + } + + /** Represents a RegionTargetHttpsProxiesSetSslCertificatesRequest. */ + class RegionTargetHttpsProxiesSetSslCertificatesRequest implements IRegionTargetHttpsProxiesSetSslCertificatesRequest { + + /** + * Constructs a new RegionTargetHttpsProxiesSetSslCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest); + + /** RegionTargetHttpsProxiesSetSslCertificatesRequest sslCertificates. */ + public sslCertificates: string[]; + + /** + * Creates a new RegionTargetHttpsProxiesSetSslCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionTargetHttpsProxiesSetSslCertificatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest): google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Encodes the specified RegionTargetHttpsProxiesSetSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @param message RegionTargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionTargetHttpsProxiesSetSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @param message RegionTargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionTargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionTargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Decodes a RegionTargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionTargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Verifies a RegionTargetHttpsProxiesSetSslCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionTargetHttpsProxiesSetSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionTargetHttpsProxiesSetSslCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Creates a plain object from a RegionTargetHttpsProxiesSetSslCertificatesRequest message. Also converts values to other types if specified. + * @param message RegionTargetHttpsProxiesSetSslCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionTargetHttpsProxiesSetSslCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMap. */ + interface IUrlMap { + + /** UrlMap creationTimestamp */ + creationTimestamp?: (string|null); + + /** UrlMap defaultRouteAction */ + defaultRouteAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** UrlMap defaultService */ + defaultService?: (string|null); + + /** UrlMap defaultUrlRedirect */ + defaultUrlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + + /** UrlMap description */ + description?: (string|null); + + /** UrlMap fingerprint */ + fingerprint?: (string|null); + + /** UrlMap headerAction */ + headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** UrlMap hostRules */ + hostRules?: (google.cloud.compute.v1.IHostRule[]|null); + + /** UrlMap id */ + id?: (number|Long|string|null); + + /** UrlMap kind */ + kind?: (string|null); + + /** UrlMap name */ + name?: (string|null); + + /** UrlMap pathMatchers */ + pathMatchers?: (google.cloud.compute.v1.IPathMatcher[]|null); + + /** UrlMap region */ + region?: (string|null); + + /** UrlMap selfLink */ + selfLink?: (string|null); + + /** UrlMap tests */ + tests?: (google.cloud.compute.v1.IUrlMapTest[]|null); + } + + /** Represents an UrlMap. */ + class UrlMap implements IUrlMap { + + /** + * Constructs a new UrlMap. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMap); + + /** UrlMap creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** UrlMap defaultRouteAction. */ + public defaultRouteAction?: (google.cloud.compute.v1.IHttpRouteAction|null); + + /** UrlMap defaultService. */ + public defaultService?: (string|null); + + /** UrlMap defaultUrlRedirect. */ + public defaultUrlRedirect?: (google.cloud.compute.v1.IHttpRedirectAction|null); + + /** UrlMap description. */ + public description?: (string|null); + + /** UrlMap fingerprint. */ + public fingerprint?: (string|null); + + /** UrlMap headerAction. */ + public headerAction?: (google.cloud.compute.v1.IHttpHeaderAction|null); + + /** UrlMap hostRules. */ + public hostRules: google.cloud.compute.v1.IHostRule[]; + + /** UrlMap id. */ + public id?: (number|Long|string|null); + + /** UrlMap kind. */ + public kind?: (string|null); + + /** UrlMap name. */ + public name?: (string|null); + + /** UrlMap pathMatchers. */ + public pathMatchers: google.cloud.compute.v1.IPathMatcher[]; + + /** UrlMap region. */ + public region?: (string|null); + + /** UrlMap selfLink. */ + public selfLink?: (string|null); + + /** UrlMap tests. */ + public tests: google.cloud.compute.v1.IUrlMapTest[]; + + /** UrlMap _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** UrlMap _defaultRouteAction. */ + public _defaultRouteAction?: "defaultRouteAction"; + + /** UrlMap _defaultService. */ + public _defaultService?: "defaultService"; + + /** UrlMap _defaultUrlRedirect. */ + public _defaultUrlRedirect?: "defaultUrlRedirect"; + + /** UrlMap _description. */ + public _description?: "description"; + + /** UrlMap _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** UrlMap _headerAction. */ + public _headerAction?: "headerAction"; + + /** UrlMap _id. */ + public _id?: "id"; + + /** UrlMap _kind. */ + public _kind?: "kind"; + + /** UrlMap _name. */ + public _name?: "name"; + + /** UrlMap _region. */ + public _region?: "region"; + + /** UrlMap _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new UrlMap instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMap instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMap): google.cloud.compute.v1.UrlMap; + + /** + * Encodes the specified UrlMap message. Does not implicitly {@link google.cloud.compute.v1.UrlMap.verify|verify} messages. + * @param message UrlMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMap message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMap.verify|verify} messages. + * @param message UrlMap message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMap, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMap message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMap; + + /** + * Decodes an UrlMap message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMap; + + /** + * Verifies an UrlMap message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMap message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMap + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMap; + + /** + * Creates a plain object from an UrlMap message. Also converts values to other types if specified. + * @param message UrlMap + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMap, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMap to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RegionUrlMapsValidateRequest. */ + interface IRegionUrlMapsValidateRequest { + + /** RegionUrlMapsValidateRequest resource */ + resource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents a RegionUrlMapsValidateRequest. */ + class RegionUrlMapsValidateRequest implements IRegionUrlMapsValidateRequest { + + /** + * Constructs a new RegionUrlMapsValidateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRegionUrlMapsValidateRequest); + + /** RegionUrlMapsValidateRequest resource. */ + public resource?: (google.cloud.compute.v1.IUrlMap|null); + + /** RegionUrlMapsValidateRequest _resource. */ + public _resource?: "resource"; + + /** + * Creates a new RegionUrlMapsValidateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionUrlMapsValidateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRegionUrlMapsValidateRequest): google.cloud.compute.v1.RegionUrlMapsValidateRequest; + + /** + * Encodes the specified RegionUrlMapsValidateRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionUrlMapsValidateRequest.verify|verify} messages. + * @param message RegionUrlMapsValidateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRegionUrlMapsValidateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionUrlMapsValidateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionUrlMapsValidateRequest.verify|verify} messages. + * @param message RegionUrlMapsValidateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRegionUrlMapsValidateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionUrlMapsValidateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionUrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RegionUrlMapsValidateRequest; + + /** + * Decodes a RegionUrlMapsValidateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionUrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RegionUrlMapsValidateRequest; + + /** + * Verifies a RegionUrlMapsValidateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionUrlMapsValidateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionUrlMapsValidateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RegionUrlMapsValidateRequest; + + /** + * Creates a plain object from a RegionUrlMapsValidateRequest message. Also converts values to other types if specified. + * @param message RegionUrlMapsValidateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RegionUrlMapsValidateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionUrlMapsValidateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservationsScopedList. */ + interface IReservationsScopedList { + + /** ReservationsScopedList reservations */ + reservations?: (google.cloud.compute.v1.IReservation[]|null); + + /** ReservationsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ReservationsScopedList. */ + class ReservationsScopedList implements IReservationsScopedList { + + /** + * Constructs a new ReservationsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IReservationsScopedList); + + /** ReservationsScopedList reservations. */ + public reservations: google.cloud.compute.v1.IReservation[]; + + /** ReservationsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ReservationsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ReservationsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservationsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IReservationsScopedList): google.cloud.compute.v1.ReservationsScopedList; + + /** + * Encodes the specified ReservationsScopedList message. Does not implicitly {@link google.cloud.compute.v1.ReservationsScopedList.verify|verify} messages. + * @param message ReservationsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IReservationsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservationsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationsScopedList.verify|verify} messages. + * @param message ReservationsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IReservationsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservationsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ReservationsScopedList; + + /** + * Decodes a ReservationsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ReservationsScopedList; + + /** + * Verifies a ReservationsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservationsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservationsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ReservationsScopedList; + + /** + * Creates a plain object from a ReservationsScopedList message. Also converts values to other types if specified. + * @param message ReservationsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ReservationsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservationsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservationAggregatedList. */ + interface IReservationAggregatedList { + + /** ReservationAggregatedList id */ + id?: (string|null); + + /** ReservationAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IReservationsScopedList }|null); + + /** ReservationAggregatedList kind */ + kind?: (string|null); + + /** ReservationAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** ReservationAggregatedList selfLink */ + selfLink?: (string|null); + + /** ReservationAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** ReservationAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ReservationAggregatedList. */ + class ReservationAggregatedList implements IReservationAggregatedList { + + /** + * Constructs a new ReservationAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IReservationAggregatedList); + + /** ReservationAggregatedList id. */ + public id?: (string|null); + + /** ReservationAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IReservationsScopedList }; + + /** ReservationAggregatedList kind. */ + public kind?: (string|null); + + /** ReservationAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ReservationAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** ReservationAggregatedList unreachables. */ + public unreachables: string[]; + + /** ReservationAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ReservationAggregatedList _id. */ + public _id?: "id"; + + /** ReservationAggregatedList _kind. */ + public _kind?: "kind"; + + /** ReservationAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ReservationAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ReservationAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ReservationAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservationAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IReservationAggregatedList): google.cloud.compute.v1.ReservationAggregatedList; + + /** + * Encodes the specified ReservationAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.ReservationAggregatedList.verify|verify} messages. + * @param message ReservationAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IReservationAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservationAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationAggregatedList.verify|verify} messages. + * @param message ReservationAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IReservationAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservationAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ReservationAggregatedList; + + /** + * Decodes a ReservationAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ReservationAggregatedList; + + /** + * Verifies a ReservationAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservationAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservationAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ReservationAggregatedList; + + /** + * Creates a plain object from a ReservationAggregatedList message. Also converts values to other types if specified. + * @param message ReservationAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ReservationAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservationAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservationList. */ + interface IReservationList { + + /** ReservationList id */ + id?: (string|null); + + /** ReservationList items */ + items?: (google.cloud.compute.v1.IReservation[]|null); + + /** ReservationList kind */ + kind?: (string|null); + + /** ReservationList nextPageToken */ + nextPageToken?: (string|null); + + /** ReservationList selfLink */ + selfLink?: (string|null); + + /** ReservationList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ReservationList. */ + class ReservationList implements IReservationList { + + /** + * Constructs a new ReservationList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IReservationList); + + /** ReservationList id. */ + public id?: (string|null); + + /** ReservationList items. */ + public items: google.cloud.compute.v1.IReservation[]; + + /** ReservationList kind. */ + public kind?: (string|null); + + /** ReservationList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ReservationList selfLink. */ + public selfLink?: (string|null); + + /** ReservationList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ReservationList _id. */ + public _id?: "id"; + + /** ReservationList _kind. */ + public _kind?: "kind"; + + /** ReservationList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ReservationList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ReservationList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ReservationList instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservationList instance + */ + public static create(properties?: google.cloud.compute.v1.IReservationList): google.cloud.compute.v1.ReservationList; + + /** + * Encodes the specified ReservationList message. Does not implicitly {@link google.cloud.compute.v1.ReservationList.verify|verify} messages. + * @param message ReservationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IReservationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservationList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationList.verify|verify} messages. + * @param message ReservationList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IReservationList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservationList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ReservationList; + + /** + * Decodes a ReservationList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ReservationList; + + /** + * Verifies a ReservationList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservationList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservationList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ReservationList; + + /** + * Creates a plain object from a ReservationList message. Also converts values to other types if specified. + * @param message ReservationList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ReservationList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservationList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservationsResizeRequest. */ + interface IReservationsResizeRequest { + + /** ReservationsResizeRequest specificSkuCount */ + specificSkuCount?: (number|Long|string|null); + } + + /** Represents a ReservationsResizeRequest. */ + class ReservationsResizeRequest implements IReservationsResizeRequest { + + /** + * Constructs a new ReservationsResizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IReservationsResizeRequest); + + /** ReservationsResizeRequest specificSkuCount. */ + public specificSkuCount?: (number|Long|string|null); + + /** ReservationsResizeRequest _specificSkuCount. */ + public _specificSkuCount?: "specificSkuCount"; + + /** + * Creates a new ReservationsResizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservationsResizeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IReservationsResizeRequest): google.cloud.compute.v1.ReservationsResizeRequest; + + /** + * Encodes the specified ReservationsResizeRequest message. Does not implicitly {@link google.cloud.compute.v1.ReservationsResizeRequest.verify|verify} messages. + * @param message ReservationsResizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IReservationsResizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservationsResizeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationsResizeRequest.verify|verify} messages. + * @param message ReservationsResizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IReservationsResizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservationsResizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservationsResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ReservationsResizeRequest; + + /** + * Decodes a ReservationsResizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservationsResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ReservationsResizeRequest; + + /** + * Verifies a ReservationsResizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservationsResizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservationsResizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ReservationsResizeRequest; + + /** + * Creates a plain object from a ReservationsResizeRequest message. Also converts values to other types if specified. + * @param message ReservationsResizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ReservationsResizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservationsResizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourceGroupReference. */ + interface IResourceGroupReference { + + /** ResourceGroupReference group */ + group?: (string|null); + } + + /** Represents a ResourceGroupReference. */ + class ResourceGroupReference implements IResourceGroupReference { + + /** + * Constructs a new ResourceGroupReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourceGroupReference); + + /** ResourceGroupReference group. */ + public group?: (string|null); + + /** ResourceGroupReference _group. */ + public _group?: "group"; + + /** + * Creates a new ResourceGroupReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceGroupReference instance + */ + public static create(properties?: google.cloud.compute.v1.IResourceGroupReference): google.cloud.compute.v1.ResourceGroupReference; + + /** + * Encodes the specified ResourceGroupReference message. Does not implicitly {@link google.cloud.compute.v1.ResourceGroupReference.verify|verify} messages. + * @param message ResourceGroupReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourceGroupReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceGroupReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourceGroupReference.verify|verify} messages. + * @param message ResourceGroupReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourceGroupReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceGroupReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceGroupReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourceGroupReference; + + /** + * Decodes a ResourceGroupReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceGroupReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourceGroupReference; + + /** + * Verifies a ResourceGroupReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceGroupReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceGroupReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourceGroupReference; + + /** + * Creates a plain object from a ResourceGroupReference message. Also converts values to other types if specified. + * @param message ResourceGroupReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourceGroupReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceGroupReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicy. */ + interface IResourcePolicy { + + /** ResourcePolicy creationTimestamp */ + creationTimestamp?: (string|null); + + /** ResourcePolicy description */ + description?: (string|null); + + /** ResourcePolicy groupPlacementPolicy */ + groupPlacementPolicy?: (google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy|null); + + /** ResourcePolicy id */ + id?: (number|Long|string|null); + + /** ResourcePolicy instanceSchedulePolicy */ + instanceSchedulePolicy?: (google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy|null); + + /** ResourcePolicy kind */ + kind?: (string|null); + + /** ResourcePolicy name */ + name?: (string|null); + + /** ResourcePolicy region */ + region?: (string|null); + + /** ResourcePolicy resourceStatus */ + resourceStatus?: (google.cloud.compute.v1.IResourcePolicyResourceStatus|null); + + /** ResourcePolicy selfLink */ + selfLink?: (string|null); + + /** ResourcePolicy snapshotSchedulePolicy */ + snapshotSchedulePolicy?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy|null); + + /** ResourcePolicy status */ + status?: (google.cloud.compute.v1.ResourcePolicy.Status|keyof typeof google.cloud.compute.v1.ResourcePolicy.Status|null); + } + + /** Represents a ResourcePolicy. */ + class ResourcePolicy implements IResourcePolicy { + + /** + * Constructs a new ResourcePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicy); + + /** ResourcePolicy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** ResourcePolicy description. */ + public description?: (string|null); + + /** ResourcePolicy groupPlacementPolicy. */ + public groupPlacementPolicy?: (google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy|null); + + /** ResourcePolicy id. */ + public id?: (number|Long|string|null); + + /** ResourcePolicy instanceSchedulePolicy. */ + public instanceSchedulePolicy?: (google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy|null); + + /** ResourcePolicy kind. */ + public kind?: (string|null); + + /** ResourcePolicy name. */ + public name?: (string|null); + + /** ResourcePolicy region. */ + public region?: (string|null); + + /** ResourcePolicy resourceStatus. */ + public resourceStatus?: (google.cloud.compute.v1.IResourcePolicyResourceStatus|null); + + /** ResourcePolicy selfLink. */ + public selfLink?: (string|null); + + /** ResourcePolicy snapshotSchedulePolicy. */ + public snapshotSchedulePolicy?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy|null); + + /** ResourcePolicy status. */ + public status?: (google.cloud.compute.v1.ResourcePolicy.Status|keyof typeof google.cloud.compute.v1.ResourcePolicy.Status|null); + + /** ResourcePolicy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** ResourcePolicy _description. */ + public _description?: "description"; + + /** ResourcePolicy _groupPlacementPolicy. */ + public _groupPlacementPolicy?: "groupPlacementPolicy"; + + /** ResourcePolicy _id. */ + public _id?: "id"; + + /** ResourcePolicy _instanceSchedulePolicy. */ + public _instanceSchedulePolicy?: "instanceSchedulePolicy"; + + /** ResourcePolicy _kind. */ + public _kind?: "kind"; + + /** ResourcePolicy _name. */ + public _name?: "name"; + + /** ResourcePolicy _region. */ + public _region?: "region"; + + /** ResourcePolicy _resourceStatus. */ + public _resourceStatus?: "resourceStatus"; + + /** ResourcePolicy _selfLink. */ + public _selfLink?: "selfLink"; + + /** ResourcePolicy _snapshotSchedulePolicy. */ + public _snapshotSchedulePolicy?: "snapshotSchedulePolicy"; + + /** ResourcePolicy _status. */ + public _status?: "status"; + + /** + * Creates a new ResourcePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicy): google.cloud.compute.v1.ResourcePolicy; + + /** + * Encodes the specified ResourcePolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicy.verify|verify} messages. + * @param message ResourcePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicy.verify|verify} messages. + * @param message ResourcePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicy; + + /** + * Decodes a ResourcePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicy; + + /** + * Verifies a ResourcePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicy; + + /** + * Creates a plain object from a ResourcePolicy message. Also converts values to other types if specified. + * @param message ResourcePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourcePolicy { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + EXPIRED = 482489093, + INVALID = 530283991, + READY = 77848963 + } + } + + /** Properties of a ResourcePoliciesScopedList. */ + interface IResourcePoliciesScopedList { + + /** ResourcePoliciesScopedList resourcePolicies */ + resourcePolicies?: (google.cloud.compute.v1.IResourcePolicy[]|null); + + /** ResourcePoliciesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ResourcePoliciesScopedList. */ + class ResourcePoliciesScopedList implements IResourcePoliciesScopedList { + + /** + * Constructs a new ResourcePoliciesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePoliciesScopedList); + + /** ResourcePoliciesScopedList resourcePolicies. */ + public resourcePolicies: google.cloud.compute.v1.IResourcePolicy[]; + + /** ResourcePoliciesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ResourcePoliciesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ResourcePoliciesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePoliciesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePoliciesScopedList): google.cloud.compute.v1.ResourcePoliciesScopedList; + + /** + * Encodes the specified ResourcePoliciesScopedList message. Does not implicitly {@link google.cloud.compute.v1.ResourcePoliciesScopedList.verify|verify} messages. + * @param message ResourcePoliciesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePoliciesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePoliciesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePoliciesScopedList.verify|verify} messages. + * @param message ResourcePoliciesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePoliciesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePoliciesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePoliciesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePoliciesScopedList; + + /** + * Decodes a ResourcePoliciesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePoliciesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePoliciesScopedList; + + /** + * Verifies a ResourcePoliciesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePoliciesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePoliciesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePoliciesScopedList; + + /** + * Creates a plain object from a ResourcePoliciesScopedList message. Also converts values to other types if specified. + * @param message ResourcePoliciesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePoliciesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePoliciesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyGroupPlacementPolicy. */ + interface IResourcePolicyGroupPlacementPolicy { + + /** ResourcePolicyGroupPlacementPolicy availabilityDomainCount */ + availabilityDomainCount?: (number|null); + + /** ResourcePolicyGroupPlacementPolicy collocation */ + collocation?: (google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation|keyof typeof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation|null); + + /** ResourcePolicyGroupPlacementPolicy vmCount */ + vmCount?: (number|null); + } + + /** Represents a ResourcePolicyGroupPlacementPolicy. */ + class ResourcePolicyGroupPlacementPolicy implements IResourcePolicyGroupPlacementPolicy { + + /** + * Constructs a new ResourcePolicyGroupPlacementPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy); + + /** ResourcePolicyGroupPlacementPolicy availabilityDomainCount. */ + public availabilityDomainCount?: (number|null); + + /** ResourcePolicyGroupPlacementPolicy collocation. */ + public collocation?: (google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation|keyof typeof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation|null); + + /** ResourcePolicyGroupPlacementPolicy vmCount. */ + public vmCount?: (number|null); + + /** ResourcePolicyGroupPlacementPolicy _availabilityDomainCount. */ + public _availabilityDomainCount?: "availabilityDomainCount"; + + /** ResourcePolicyGroupPlacementPolicy _collocation. */ + public _collocation?: "collocation"; + + /** ResourcePolicyGroupPlacementPolicy _vmCount. */ + public _vmCount?: "vmCount"; + + /** + * Creates a new ResourcePolicyGroupPlacementPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyGroupPlacementPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy): google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy; + + /** + * Encodes the specified ResourcePolicyGroupPlacementPolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.verify|verify} messages. + * @param message ResourcePolicyGroupPlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyGroupPlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.verify|verify} messages. + * @param message ResourcePolicyGroupPlacementPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyGroupPlacementPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyGroupPlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy; + + /** + * Decodes a ResourcePolicyGroupPlacementPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyGroupPlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy; + + /** + * Verifies a ResourcePolicyGroupPlacementPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyGroupPlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyGroupPlacementPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy; + + /** + * Creates a plain object from a ResourcePolicyGroupPlacementPolicy message. Also converts values to other types if specified. + * @param message ResourcePolicyGroupPlacementPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyGroupPlacementPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourcePolicyGroupPlacementPolicy { + + /** Collocation enum. */ + enum Collocation { + UNDEFINED_COLLOCATION = 0, + COLLOCATED = 103257554, + UNSPECIFIED_COLLOCATION = 464308205 + } + } + + /** Properties of a ResourcePolicyInstanceSchedulePolicy. */ + interface IResourcePolicyInstanceSchedulePolicy { + + /** ResourcePolicyInstanceSchedulePolicy expirationTime */ + expirationTime?: (string|null); + + /** ResourcePolicyInstanceSchedulePolicy startTime */ + startTime?: (string|null); + + /** ResourcePolicyInstanceSchedulePolicy timeZone */ + timeZone?: (string|null); + + /** ResourcePolicyInstanceSchedulePolicy vmStartSchedule */ + vmStartSchedule?: (google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null); + + /** ResourcePolicyInstanceSchedulePolicy vmStopSchedule */ + vmStopSchedule?: (google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null); + } + + /** Represents a ResourcePolicyInstanceSchedulePolicy. */ + class ResourcePolicyInstanceSchedulePolicy implements IResourcePolicyInstanceSchedulePolicy { + + /** + * Constructs a new ResourcePolicyInstanceSchedulePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy); + + /** ResourcePolicyInstanceSchedulePolicy expirationTime. */ + public expirationTime?: (string|null); + + /** ResourcePolicyInstanceSchedulePolicy startTime. */ + public startTime?: (string|null); + + /** ResourcePolicyInstanceSchedulePolicy timeZone. */ + public timeZone?: (string|null); + + /** ResourcePolicyInstanceSchedulePolicy vmStartSchedule. */ + public vmStartSchedule?: (google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null); + + /** ResourcePolicyInstanceSchedulePolicy vmStopSchedule. */ + public vmStopSchedule?: (google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null); + + /** ResourcePolicyInstanceSchedulePolicy _expirationTime. */ + public _expirationTime?: "expirationTime"; + + /** ResourcePolicyInstanceSchedulePolicy _startTime. */ + public _startTime?: "startTime"; + + /** ResourcePolicyInstanceSchedulePolicy _timeZone. */ + public _timeZone?: "timeZone"; + + /** ResourcePolicyInstanceSchedulePolicy _vmStartSchedule. */ + public _vmStartSchedule?: "vmStartSchedule"; + + /** ResourcePolicyInstanceSchedulePolicy _vmStopSchedule. */ + public _vmStopSchedule?: "vmStopSchedule"; + + /** + * Creates a new ResourcePolicyInstanceSchedulePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyInstanceSchedulePolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.verify|verify} messages. + * @param message ResourcePolicyInstanceSchedulePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.verify|verify} messages. + * @param message ResourcePolicyInstanceSchedulePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyInstanceSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyInstanceSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy; + + /** + * Verifies a ResourcePolicyInstanceSchedulePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyInstanceSchedulePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyInstanceSchedulePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy; + + /** + * Creates a plain object from a ResourcePolicyInstanceSchedulePolicy message. Also converts values to other types if specified. + * @param message ResourcePolicyInstanceSchedulePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyInstanceSchedulePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyResourceStatus. */ + interface IResourcePolicyResourceStatus { + + /** ResourcePolicyResourceStatus instanceSchedulePolicy */ + instanceSchedulePolicy?: (google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus|null); + } + + /** Represents a ResourcePolicyResourceStatus. */ + class ResourcePolicyResourceStatus implements IResourcePolicyResourceStatus { + + /** + * Constructs a new ResourcePolicyResourceStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyResourceStatus); + + /** ResourcePolicyResourceStatus instanceSchedulePolicy. */ + public instanceSchedulePolicy?: (google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus|null); + + /** ResourcePolicyResourceStatus _instanceSchedulePolicy. */ + public _instanceSchedulePolicy?: "instanceSchedulePolicy"; + + /** + * Creates a new ResourcePolicyResourceStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyResourceStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyResourceStatus): google.cloud.compute.v1.ResourcePolicyResourceStatus; + + /** + * Encodes the specified ResourcePolicyResourceStatus message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatus.verify|verify} messages. + * @param message ResourcePolicyResourceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyResourceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyResourceStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatus.verify|verify} messages. + * @param message ResourcePolicyResourceStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyResourceStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyResourceStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyResourceStatus; + + /** + * Decodes a ResourcePolicyResourceStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyResourceStatus; + + /** + * Verifies a ResourcePolicyResourceStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyResourceStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyResourceStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyResourceStatus; + + /** + * Creates a plain object from a ResourcePolicyResourceStatus message. Also converts values to other types if specified. + * @param message ResourcePolicyResourceStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyResourceStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyResourceStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicySnapshotSchedulePolicy. */ + interface IResourcePolicySnapshotSchedulePolicy { + + /** ResourcePolicySnapshotSchedulePolicy retentionPolicy */ + retentionPolicy?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy|null); + + /** ResourcePolicySnapshotSchedulePolicy schedule */ + schedule?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule|null); + + /** ResourcePolicySnapshotSchedulePolicy snapshotProperties */ + snapshotProperties?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties|null); + } + + /** Represents a ResourcePolicySnapshotSchedulePolicy. */ + class ResourcePolicySnapshotSchedulePolicy implements IResourcePolicySnapshotSchedulePolicy { + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy); + + /** ResourcePolicySnapshotSchedulePolicy retentionPolicy. */ + public retentionPolicy?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy|null); + + /** ResourcePolicySnapshotSchedulePolicy schedule. */ + public schedule?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule|null); + + /** ResourcePolicySnapshotSchedulePolicy snapshotProperties. */ + public snapshotProperties?: (google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties|null); + + /** ResourcePolicySnapshotSchedulePolicy _retentionPolicy. */ + public _retentionPolicy?: "retentionPolicy"; + + /** ResourcePolicySnapshotSchedulePolicy _schedule. */ + public _schedule?: "schedule"; + + /** ResourcePolicySnapshotSchedulePolicy _snapshotProperties. */ + public _snapshotProperties?: "snapshotProperties"; + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicySnapshotSchedulePolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicySnapshotSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicySnapshotSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicySnapshotSchedulePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicySnapshotSchedulePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicy message. Also converts values to other types if specified. + * @param message ResourcePolicySnapshotSchedulePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicySnapshotSchedulePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyAggregatedList. */ + interface IResourcePolicyAggregatedList { + + /** ResourcePolicyAggregatedList etag */ + etag?: (string|null); + + /** ResourcePolicyAggregatedList id */ + id?: (string|null); + + /** ResourcePolicyAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IResourcePoliciesScopedList }|null); + + /** ResourcePolicyAggregatedList kind */ + kind?: (string|null); + + /** ResourcePolicyAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** ResourcePolicyAggregatedList selfLink */ + selfLink?: (string|null); + + /** ResourcePolicyAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** ResourcePolicyAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ResourcePolicyAggregatedList. */ + class ResourcePolicyAggregatedList implements IResourcePolicyAggregatedList { + + /** + * Constructs a new ResourcePolicyAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyAggregatedList); + + /** ResourcePolicyAggregatedList etag. */ + public etag?: (string|null); + + /** ResourcePolicyAggregatedList id. */ + public id?: (string|null); + + /** ResourcePolicyAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IResourcePoliciesScopedList }; + + /** ResourcePolicyAggregatedList kind. */ + public kind?: (string|null); + + /** ResourcePolicyAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ResourcePolicyAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** ResourcePolicyAggregatedList unreachables. */ + public unreachables: string[]; + + /** ResourcePolicyAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ResourcePolicyAggregatedList _etag. */ + public _etag?: "etag"; + + /** ResourcePolicyAggregatedList _id. */ + public _id?: "id"; + + /** ResourcePolicyAggregatedList _kind. */ + public _kind?: "kind"; + + /** ResourcePolicyAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ResourcePolicyAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ResourcePolicyAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ResourcePolicyAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyAggregatedList): google.cloud.compute.v1.ResourcePolicyAggregatedList; + + /** + * Encodes the specified ResourcePolicyAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyAggregatedList.verify|verify} messages. + * @param message ResourcePolicyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyAggregatedList.verify|verify} messages. + * @param message ResourcePolicyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyAggregatedList; + + /** + * Decodes a ResourcePolicyAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyAggregatedList; + + /** + * Verifies a ResourcePolicyAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyAggregatedList; + + /** + * Creates a plain object from a ResourcePolicyAggregatedList message. Also converts values to other types if specified. + * @param message ResourcePolicyAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyDailyCycle. */ + interface IResourcePolicyDailyCycle { + + /** ResourcePolicyDailyCycle daysInCycle */ + daysInCycle?: (number|null); + + /** ResourcePolicyDailyCycle duration */ + duration?: (string|null); + + /** ResourcePolicyDailyCycle startTime */ + startTime?: (string|null); + } + + /** Represents a ResourcePolicyDailyCycle. */ + class ResourcePolicyDailyCycle implements IResourcePolicyDailyCycle { + + /** + * Constructs a new ResourcePolicyDailyCycle. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyDailyCycle); + + /** ResourcePolicyDailyCycle daysInCycle. */ + public daysInCycle?: (number|null); + + /** ResourcePolicyDailyCycle duration. */ + public duration?: (string|null); + + /** ResourcePolicyDailyCycle startTime. */ + public startTime?: (string|null); + + /** ResourcePolicyDailyCycle _daysInCycle. */ + public _daysInCycle?: "daysInCycle"; + + /** ResourcePolicyDailyCycle _duration. */ + public _duration?: "duration"; + + /** ResourcePolicyDailyCycle _startTime. */ + public _startTime?: "startTime"; + + /** + * Creates a new ResourcePolicyDailyCycle instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyDailyCycle instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyDailyCycle): google.cloud.compute.v1.ResourcePolicyDailyCycle; + + /** + * Encodes the specified ResourcePolicyDailyCycle message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyDailyCycle.verify|verify} messages. + * @param message ResourcePolicyDailyCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyDailyCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyDailyCycle message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyDailyCycle.verify|verify} messages. + * @param message ResourcePolicyDailyCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyDailyCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyDailyCycle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyDailyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyDailyCycle; + + /** + * Decodes a ResourcePolicyDailyCycle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyDailyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyDailyCycle; + + /** + * Verifies a ResourcePolicyDailyCycle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyDailyCycle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyDailyCycle + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyDailyCycle; + + /** + * Creates a plain object from a ResourcePolicyDailyCycle message. Also converts values to other types if specified. + * @param message ResourcePolicyDailyCycle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyDailyCycle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyDailyCycle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyHourlyCycle. */ + interface IResourcePolicyHourlyCycle { + + /** ResourcePolicyHourlyCycle duration */ + duration?: (string|null); + + /** ResourcePolicyHourlyCycle hoursInCycle */ + hoursInCycle?: (number|null); + + /** ResourcePolicyHourlyCycle startTime */ + startTime?: (string|null); + } + + /** Represents a ResourcePolicyHourlyCycle. */ + class ResourcePolicyHourlyCycle implements IResourcePolicyHourlyCycle { + + /** + * Constructs a new ResourcePolicyHourlyCycle. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyHourlyCycle); + + /** ResourcePolicyHourlyCycle duration. */ + public duration?: (string|null); + + /** ResourcePolicyHourlyCycle hoursInCycle. */ + public hoursInCycle?: (number|null); + + /** ResourcePolicyHourlyCycle startTime. */ + public startTime?: (string|null); + + /** ResourcePolicyHourlyCycle _duration. */ + public _duration?: "duration"; + + /** ResourcePolicyHourlyCycle _hoursInCycle. */ + public _hoursInCycle?: "hoursInCycle"; + + /** ResourcePolicyHourlyCycle _startTime. */ + public _startTime?: "startTime"; + + /** + * Creates a new ResourcePolicyHourlyCycle instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyHourlyCycle instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyHourlyCycle): google.cloud.compute.v1.ResourcePolicyHourlyCycle; + + /** + * Encodes the specified ResourcePolicyHourlyCycle message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyHourlyCycle.verify|verify} messages. + * @param message ResourcePolicyHourlyCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyHourlyCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyHourlyCycle message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyHourlyCycle.verify|verify} messages. + * @param message ResourcePolicyHourlyCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyHourlyCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyHourlyCycle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyHourlyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyHourlyCycle; + + /** + * Decodes a ResourcePolicyHourlyCycle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyHourlyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyHourlyCycle; + + /** + * Verifies a ResourcePolicyHourlyCycle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyHourlyCycle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyHourlyCycle + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyHourlyCycle; + + /** + * Creates a plain object from a ResourcePolicyHourlyCycle message. Also converts values to other types if specified. + * @param message ResourcePolicyHourlyCycle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyHourlyCycle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyHourlyCycle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyInstanceSchedulePolicySchedule. */ + interface IResourcePolicyInstanceSchedulePolicySchedule { + + /** ResourcePolicyInstanceSchedulePolicySchedule schedule */ + schedule?: (string|null); + } + + /** Represents a ResourcePolicyInstanceSchedulePolicySchedule. */ + class ResourcePolicyInstanceSchedulePolicySchedule implements IResourcePolicyInstanceSchedulePolicySchedule { + + /** + * Constructs a new ResourcePolicyInstanceSchedulePolicySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule); + + /** ResourcePolicyInstanceSchedulePolicySchedule schedule. */ + public schedule?: (string|null); + + /** ResourcePolicyInstanceSchedulePolicySchedule _schedule. */ + public _schedule?: "schedule"; + + /** + * Creates a new ResourcePolicyInstanceSchedulePolicySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyInstanceSchedulePolicySchedule instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicySchedule message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.verify|verify} messages. + * @param message ResourcePolicyInstanceSchedulePolicySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicySchedule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.verify|verify} messages. + * @param message ResourcePolicyInstanceSchedulePolicySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyInstanceSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyInstanceSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule; + + /** + * Verifies a ResourcePolicyInstanceSchedulePolicySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyInstanceSchedulePolicySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyInstanceSchedulePolicySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule; + + /** + * Creates a plain object from a ResourcePolicyInstanceSchedulePolicySchedule message. Also converts values to other types if specified. + * @param message ResourcePolicyInstanceSchedulePolicySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyInstanceSchedulePolicySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyList. */ + interface IResourcePolicyList { + + /** ResourcePolicyList etag */ + etag?: (string|null); + + /** ResourcePolicyList id */ + id?: (string|null); + + /** ResourcePolicyList items */ + items?: (google.cloud.compute.v1.IResourcePolicy[]|null); + + /** ResourcePolicyList kind */ + kind?: (string|null); + + /** ResourcePolicyList nextPageToken */ + nextPageToken?: (string|null); + + /** ResourcePolicyList selfLink */ + selfLink?: (string|null); + + /** ResourcePolicyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ResourcePolicyList. */ + class ResourcePolicyList implements IResourcePolicyList { + + /** + * Constructs a new ResourcePolicyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyList); + + /** ResourcePolicyList etag. */ + public etag?: (string|null); + + /** ResourcePolicyList id. */ + public id?: (string|null); + + /** ResourcePolicyList items. */ + public items: google.cloud.compute.v1.IResourcePolicy[]; + + /** ResourcePolicyList kind. */ + public kind?: (string|null); + + /** ResourcePolicyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ResourcePolicyList selfLink. */ + public selfLink?: (string|null); + + /** ResourcePolicyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ResourcePolicyList _etag. */ + public _etag?: "etag"; + + /** ResourcePolicyList _id. */ + public _id?: "id"; + + /** ResourcePolicyList _kind. */ + public _kind?: "kind"; + + /** ResourcePolicyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ResourcePolicyList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ResourcePolicyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ResourcePolicyList instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyList instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyList): google.cloud.compute.v1.ResourcePolicyList; + + /** + * Encodes the specified ResourcePolicyList message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyList.verify|verify} messages. + * @param message ResourcePolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyList.verify|verify} messages. + * @param message ResourcePolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyList; + + /** + * Decodes a ResourcePolicyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyList; + + /** + * Verifies a ResourcePolicyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyList; + + /** + * Creates a plain object from a ResourcePolicyList message. Also converts values to other types if specified. + * @param message ResourcePolicyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus. */ + interface IResourcePolicyResourceStatusInstanceSchedulePolicyStatus { + + /** ResourcePolicyResourceStatusInstanceSchedulePolicyStatus lastRunStartTime */ + lastRunStartTime?: (string|null); + + /** ResourcePolicyResourceStatusInstanceSchedulePolicyStatus nextRunStartTime */ + nextRunStartTime?: (string|null); + } + + /** Represents a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus. */ + class ResourcePolicyResourceStatusInstanceSchedulePolicyStatus implements IResourcePolicyResourceStatusInstanceSchedulePolicyStatus { + + /** + * Constructs a new ResourcePolicyResourceStatusInstanceSchedulePolicyStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus); + + /** ResourcePolicyResourceStatusInstanceSchedulePolicyStatus lastRunStartTime. */ + public lastRunStartTime?: (string|null); + + /** ResourcePolicyResourceStatusInstanceSchedulePolicyStatus nextRunStartTime. */ + public nextRunStartTime?: (string|null); + + /** ResourcePolicyResourceStatusInstanceSchedulePolicyStatus _lastRunStartTime. */ + public _lastRunStartTime?: "lastRunStartTime"; + + /** ResourcePolicyResourceStatusInstanceSchedulePolicyStatus _nextRunStartTime. */ + public _nextRunStartTime?: "nextRunStartTime"; + + /** + * Creates a new ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus): google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus; + + /** + * Encodes the specified ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.verify|verify} messages. + * @param message ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.verify|verify} messages. + * @param message ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus; + + /** + * Decodes a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus; + + /** + * Verifies a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus; + + /** + * Creates a plain object from a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message. Also converts values to other types if specified. + * @param message ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyResourceStatusInstanceSchedulePolicyStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicySnapshotSchedulePolicyRetentionPolicy. */ + interface IResourcePolicySnapshotSchedulePolicyRetentionPolicy { + + /** ResourcePolicySnapshotSchedulePolicyRetentionPolicy maxRetentionDays */ + maxRetentionDays?: (number|null); + + /** ResourcePolicySnapshotSchedulePolicyRetentionPolicy onSourceDiskDelete */ + onSourceDiskDelete?: (google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete|keyof typeof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete|null); + } + + /** Represents a ResourcePolicySnapshotSchedulePolicyRetentionPolicy. */ + class ResourcePolicySnapshotSchedulePolicyRetentionPolicy implements IResourcePolicySnapshotSchedulePolicyRetentionPolicy { + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicyRetentionPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy); + + /** ResourcePolicySnapshotSchedulePolicyRetentionPolicy maxRetentionDays. */ + public maxRetentionDays?: (number|null); + + /** ResourcePolicySnapshotSchedulePolicyRetentionPolicy onSourceDiskDelete. */ + public onSourceDiskDelete?: (google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete|keyof typeof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete|null); + + /** ResourcePolicySnapshotSchedulePolicyRetentionPolicy _maxRetentionDays. */ + public _maxRetentionDays?: "maxRetentionDays"; + + /** ResourcePolicySnapshotSchedulePolicyRetentionPolicy _onSourceDiskDelete. */ + public _onSourceDiskDelete?: "onSourceDiskDelete"; + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicyRetentionPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicySnapshotSchedulePolicyRetentionPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicyRetentionPolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicyRetentionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicyRetentionPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicyRetentionPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicySnapshotSchedulePolicyRetentionPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message. Also converts values to other types if specified. + * @param message ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicySnapshotSchedulePolicyRetentionPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourcePolicySnapshotSchedulePolicyRetentionPolicy { + + /** OnSourceDiskDelete enum. */ + enum OnSourceDiskDelete { + UNDEFINED_ON_SOURCE_DISK_DELETE = 0, + APPLY_RETENTION_POLICY = 535071332, + KEEP_AUTO_SNAPSHOTS = 258925689, + UNSPECIFIED_ON_SOURCE_DISK_DELETE = 239140769 + } + } + + /** Properties of a ResourcePolicySnapshotSchedulePolicySchedule. */ + interface IResourcePolicySnapshotSchedulePolicySchedule { + + /** ResourcePolicySnapshotSchedulePolicySchedule dailySchedule */ + dailySchedule?: (google.cloud.compute.v1.IResourcePolicyDailyCycle|null); + + /** ResourcePolicySnapshotSchedulePolicySchedule hourlySchedule */ + hourlySchedule?: (google.cloud.compute.v1.IResourcePolicyHourlyCycle|null); + + /** ResourcePolicySnapshotSchedulePolicySchedule weeklySchedule */ + weeklySchedule?: (google.cloud.compute.v1.IResourcePolicyWeeklyCycle|null); + } + + /** Represents a ResourcePolicySnapshotSchedulePolicySchedule. */ + class ResourcePolicySnapshotSchedulePolicySchedule implements IResourcePolicySnapshotSchedulePolicySchedule { + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicySchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule); + + /** ResourcePolicySnapshotSchedulePolicySchedule dailySchedule. */ + public dailySchedule?: (google.cloud.compute.v1.IResourcePolicyDailyCycle|null); + + /** ResourcePolicySnapshotSchedulePolicySchedule hourlySchedule. */ + public hourlySchedule?: (google.cloud.compute.v1.IResourcePolicyHourlyCycle|null); + + /** ResourcePolicySnapshotSchedulePolicySchedule weeklySchedule. */ + public weeklySchedule?: (google.cloud.compute.v1.IResourcePolicyWeeklyCycle|null); + + /** ResourcePolicySnapshotSchedulePolicySchedule _dailySchedule. */ + public _dailySchedule?: "dailySchedule"; + + /** ResourcePolicySnapshotSchedulePolicySchedule _hourlySchedule. */ + public _hourlySchedule?: "hourlySchedule"; + + /** ResourcePolicySnapshotSchedulePolicySchedule _weeklySchedule. */ + public _weeklySchedule?: "weeklySchedule"; + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicySchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicySnapshotSchedulePolicySchedule instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicySchedule message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicySchedule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicySchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicySnapshotSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicySnapshotSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicySchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicySnapshotSchedulePolicySchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicySnapshotSchedulePolicySchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicySchedule message. Also converts values to other types if specified. + * @param message ResourcePolicySnapshotSchedulePolicySchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicySnapshotSchedulePolicySchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicySnapshotSchedulePolicySnapshotProperties. */ + interface IResourcePolicySnapshotSchedulePolicySnapshotProperties { + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties chainName */ + chainName?: (string|null); + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties guestFlush */ + guestFlush?: (boolean|null); + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties storageLocations */ + storageLocations?: (string[]|null); + } + + /** Represents a ResourcePolicySnapshotSchedulePolicySnapshotProperties. */ + class ResourcePolicySnapshotSchedulePolicySnapshotProperties implements IResourcePolicySnapshotSchedulePolicySnapshotProperties { + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicySnapshotProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties); + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties chainName. */ + public chainName?: (string|null); + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties guestFlush. */ + public guestFlush?: (boolean|null); + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties labels. */ + public labels: { [k: string]: string }; + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties storageLocations. */ + public storageLocations: string[]; + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties _chainName. */ + public _chainName?: "chainName"; + + /** ResourcePolicySnapshotSchedulePolicySnapshotProperties _guestFlush. */ + public _guestFlush?: "guestFlush"; + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicySnapshotProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicySnapshotSchedulePolicySnapshotProperties instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicySnapshotProperties message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicySnapshotProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicySnapshotProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.verify|verify} messages. + * @param message ResourcePolicySnapshotSchedulePolicySnapshotProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySnapshotProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySnapshotProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicySnapshotProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicySnapshotSchedulePolicySnapshotProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicySnapshotSchedulePolicySnapshotProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicySnapshotProperties message. Also converts values to other types if specified. + * @param message ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicySnapshotSchedulePolicySnapshotProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyWeeklyCycle. */ + interface IResourcePolicyWeeklyCycle { + + /** ResourcePolicyWeeklyCycle dayOfWeeks */ + dayOfWeeks?: (google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek[]|null); + } + + /** Represents a ResourcePolicyWeeklyCycle. */ + class ResourcePolicyWeeklyCycle implements IResourcePolicyWeeklyCycle { + + /** + * Constructs a new ResourcePolicyWeeklyCycle. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyWeeklyCycle); + + /** ResourcePolicyWeeklyCycle dayOfWeeks. */ + public dayOfWeeks: google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek[]; + + /** + * Creates a new ResourcePolicyWeeklyCycle instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyWeeklyCycle instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyWeeklyCycle): google.cloud.compute.v1.ResourcePolicyWeeklyCycle; + + /** + * Encodes the specified ResourcePolicyWeeklyCycle message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycle.verify|verify} messages. + * @param message ResourcePolicyWeeklyCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyWeeklyCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyWeeklyCycle message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycle.verify|verify} messages. + * @param message ResourcePolicyWeeklyCycle message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyWeeklyCycle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyWeeklyCycle message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyWeeklyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyWeeklyCycle; + + /** + * Decodes a ResourcePolicyWeeklyCycle message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyWeeklyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyWeeklyCycle; + + /** + * Verifies a ResourcePolicyWeeklyCycle message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyWeeklyCycle message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyWeeklyCycle + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyWeeklyCycle; + + /** + * Creates a plain object from a ResourcePolicyWeeklyCycle message. Also converts values to other types if specified. + * @param message ResourcePolicyWeeklyCycle + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyWeeklyCycle, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyWeeklyCycle to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResourcePolicyWeeklyCycleDayOfWeek. */ + interface IResourcePolicyWeeklyCycleDayOfWeek { + + /** ResourcePolicyWeeklyCycleDayOfWeek day */ + day?: (google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day|keyof typeof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day|null); + + /** ResourcePolicyWeeklyCycleDayOfWeek duration */ + duration?: (string|null); + + /** ResourcePolicyWeeklyCycleDayOfWeek startTime */ + startTime?: (string|null); + } + + /** Represents a ResourcePolicyWeeklyCycleDayOfWeek. */ + class ResourcePolicyWeeklyCycleDayOfWeek implements IResourcePolicyWeeklyCycleDayOfWeek { + + /** + * Constructs a new ResourcePolicyWeeklyCycleDayOfWeek. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek); + + /** ResourcePolicyWeeklyCycleDayOfWeek day. */ + public day?: (google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day|keyof typeof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day|null); + + /** ResourcePolicyWeeklyCycleDayOfWeek duration. */ + public duration?: (string|null); + + /** ResourcePolicyWeeklyCycleDayOfWeek startTime. */ + public startTime?: (string|null); + + /** ResourcePolicyWeeklyCycleDayOfWeek _day. */ + public _day?: "day"; + + /** ResourcePolicyWeeklyCycleDayOfWeek _duration. */ + public _duration?: "duration"; + + /** ResourcePolicyWeeklyCycleDayOfWeek _startTime. */ + public _startTime?: "startTime"; + + /** + * Creates a new ResourcePolicyWeeklyCycleDayOfWeek instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcePolicyWeeklyCycleDayOfWeek instance + */ + public static create(properties?: google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek): google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek; + + /** + * Encodes the specified ResourcePolicyWeeklyCycleDayOfWeek message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.verify|verify} messages. + * @param message ResourcePolicyWeeklyCycleDayOfWeek message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcePolicyWeeklyCycleDayOfWeek message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.verify|verify} messages. + * @param message ResourcePolicyWeeklyCycleDayOfWeek message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcePolicyWeeklyCycleDayOfWeek message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcePolicyWeeklyCycleDayOfWeek + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek; + + /** + * Decodes a ResourcePolicyWeeklyCycleDayOfWeek message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcePolicyWeeklyCycleDayOfWeek + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek; + + /** + * Verifies a ResourcePolicyWeeklyCycleDayOfWeek message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcePolicyWeeklyCycleDayOfWeek message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcePolicyWeeklyCycleDayOfWeek + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek; + + /** + * Creates a plain object from a ResourcePolicyWeeklyCycleDayOfWeek message. Also converts values to other types if specified. + * @param message ResourcePolicyWeeklyCycleDayOfWeek + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcePolicyWeeklyCycleDayOfWeek to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResourcePolicyWeeklyCycleDayOfWeek { + + /** Day enum. */ + enum Day { + UNDEFINED_DAY = 0, + FRIDAY = 471398751, + INVALID = 530283991, + MONDAY = 132310288, + SATURDAY = 279037881, + SUNDAY = 309626320, + THURSDAY = 207198682, + TUESDAY = 277509677, + WEDNESDAY = 422029110 + } + } + + /** Properties of a Route. */ + interface IRoute { + + /** Route creationTimestamp */ + creationTimestamp?: (string|null); + + /** Route description */ + description?: (string|null); + + /** Route destRange */ + destRange?: (string|null); + + /** Route id */ + id?: (number|Long|string|null); + + /** Route kind */ + kind?: (string|null); + + /** Route name */ + name?: (string|null); + + /** Route network */ + network?: (string|null); + + /** Route nextHopGateway */ + nextHopGateway?: (string|null); + + /** Route nextHopIlb */ + nextHopIlb?: (string|null); + + /** Route nextHopInstance */ + nextHopInstance?: (string|null); + + /** Route nextHopIp */ + nextHopIp?: (string|null); + + /** Route nextHopNetwork */ + nextHopNetwork?: (string|null); + + /** Route nextHopPeering */ + nextHopPeering?: (string|null); + + /** Route nextHopVpnTunnel */ + nextHopVpnTunnel?: (string|null); + + /** Route priority */ + priority?: (number|null); + + /** Route selfLink */ + selfLink?: (string|null); + + /** Route tags */ + tags?: (string[]|null); + + /** Route warnings */ + warnings?: (google.cloud.compute.v1.IWarnings[]|null); + } + + /** Represents a Route. */ + class Route implements IRoute { + + /** + * Constructs a new Route. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoute); + + /** Route creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Route description. */ + public description?: (string|null); + + /** Route destRange. */ + public destRange?: (string|null); + + /** Route id. */ + public id?: (number|Long|string|null); + + /** Route kind. */ + public kind?: (string|null); + + /** Route name. */ + public name?: (string|null); + + /** Route network. */ + public network?: (string|null); + + /** Route nextHopGateway. */ + public nextHopGateway?: (string|null); + + /** Route nextHopIlb. */ + public nextHopIlb?: (string|null); + + /** Route nextHopInstance. */ + public nextHopInstance?: (string|null); + + /** Route nextHopIp. */ + public nextHopIp?: (string|null); + + /** Route nextHopNetwork. */ + public nextHopNetwork?: (string|null); + + /** Route nextHopPeering. */ + public nextHopPeering?: (string|null); + + /** Route nextHopVpnTunnel. */ + public nextHopVpnTunnel?: (string|null); + + /** Route priority. */ + public priority?: (number|null); + + /** Route selfLink. */ + public selfLink?: (string|null); + + /** Route tags. */ + public tags: string[]; + + /** Route warnings. */ + public warnings: google.cloud.compute.v1.IWarnings[]; + + /** Route _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Route _description. */ + public _description?: "description"; + + /** Route _destRange. */ + public _destRange?: "destRange"; + + /** Route _id. */ + public _id?: "id"; + + /** Route _kind. */ + public _kind?: "kind"; + + /** Route _name. */ + public _name?: "name"; + + /** Route _network. */ + public _network?: "network"; + + /** Route _nextHopGateway. */ + public _nextHopGateway?: "nextHopGateway"; + + /** Route _nextHopIlb. */ + public _nextHopIlb?: "nextHopIlb"; + + /** Route _nextHopInstance. */ + public _nextHopInstance?: "nextHopInstance"; + + /** Route _nextHopIp. */ + public _nextHopIp?: "nextHopIp"; + + /** Route _nextHopNetwork. */ + public _nextHopNetwork?: "nextHopNetwork"; + + /** Route _nextHopPeering. */ + public _nextHopPeering?: "nextHopPeering"; + + /** Route _nextHopVpnTunnel. */ + public _nextHopVpnTunnel?: "nextHopVpnTunnel"; + + /** Route _priority. */ + public _priority?: "priority"; + + /** Route _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new Route instance using the specified properties. + * @param [properties] Properties to set + * @returns Route instance + */ + public static create(properties?: google.cloud.compute.v1.IRoute): google.cloud.compute.v1.Route; + + /** + * Encodes the specified Route message. Does not implicitly {@link google.cloud.compute.v1.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.cloud.compute.v1.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.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.cloud.compute.v1.Route, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Route to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouteList. */ + interface IRouteList { + + /** RouteList id */ + id?: (string|null); + + /** RouteList items */ + items?: (google.cloud.compute.v1.IRoute[]|null); + + /** RouteList kind */ + kind?: (string|null); + + /** RouteList nextPageToken */ + nextPageToken?: (string|null); + + /** RouteList selfLink */ + selfLink?: (string|null); + + /** RouteList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RouteList. */ + class RouteList implements IRouteList { + + /** + * Constructs a new RouteList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouteList); + + /** RouteList id. */ + public id?: (string|null); + + /** RouteList items. */ + public items: google.cloud.compute.v1.IRoute[]; + + /** RouteList kind. */ + public kind?: (string|null); + + /** RouteList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RouteList selfLink. */ + public selfLink?: (string|null); + + /** RouteList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RouteList _id. */ + public _id?: "id"; + + /** RouteList _kind. */ + public _kind?: "kind"; + + /** RouteList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RouteList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RouteList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RouteList instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteList instance + */ + public static create(properties?: google.cloud.compute.v1.IRouteList): google.cloud.compute.v1.RouteList; + + /** + * Encodes the specified RouteList message. Does not implicitly {@link google.cloud.compute.v1.RouteList.verify|verify} messages. + * @param message RouteList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouteList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouteList.verify|verify} messages. + * @param message RouteList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouteList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouteList; + + /** + * Decodes a RouteList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouteList; + + /** + * Verifies a RouteList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouteList; + + /** + * Creates a plain object from a RouteList message. Also converts values to other types if specified. + * @param message RouteList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouteList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouterBgp. */ + interface IRouterBgp { + + /** RouterBgp advertiseMode */ + advertiseMode?: (google.cloud.compute.v1.RouterBgp.AdvertiseMode|keyof typeof google.cloud.compute.v1.RouterBgp.AdvertiseMode|null); + + /** RouterBgp advertisedGroups */ + advertisedGroups?: (google.cloud.compute.v1.RouterBgp.AdvertisedGroups[]|null); + + /** RouterBgp advertisedIpRanges */ + advertisedIpRanges?: (google.cloud.compute.v1.IRouterAdvertisedIpRange[]|null); + + /** RouterBgp asn */ + asn?: (number|null); + } + + /** Represents a RouterBgp. */ + class RouterBgp implements IRouterBgp { + + /** + * Constructs a new RouterBgp. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterBgp); + + /** RouterBgp advertiseMode. */ + public advertiseMode?: (google.cloud.compute.v1.RouterBgp.AdvertiseMode|keyof typeof google.cloud.compute.v1.RouterBgp.AdvertiseMode|null); + + /** RouterBgp advertisedGroups. */ + public advertisedGroups: google.cloud.compute.v1.RouterBgp.AdvertisedGroups[]; + + /** RouterBgp advertisedIpRanges. */ + public advertisedIpRanges: google.cloud.compute.v1.IRouterAdvertisedIpRange[]; + + /** RouterBgp asn. */ + public asn?: (number|null); + + /** RouterBgp _advertiseMode. */ + public _advertiseMode?: "advertiseMode"; + + /** RouterBgp _asn. */ + public _asn?: "asn"; + + /** + * Creates a new RouterBgp instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterBgp instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterBgp): google.cloud.compute.v1.RouterBgp; + + /** + * Encodes the specified RouterBgp message. Does not implicitly {@link google.cloud.compute.v1.RouterBgp.verify|verify} messages. + * @param message RouterBgp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterBgp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterBgp message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterBgp.verify|verify} messages. + * @param message RouterBgp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterBgp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterBgp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterBgp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterBgp; + + /** + * Decodes a RouterBgp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterBgp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterBgp; + + /** + * Verifies a RouterBgp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterBgp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterBgp + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterBgp; + + /** + * Creates a plain object from a RouterBgp message. Also converts values to other types if specified. + * @param message RouterBgp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterBgp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterBgp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RouterBgp { + + /** AdvertiseMode enum. */ + enum AdvertiseMode { + UNDEFINED_ADVERTISE_MODE = 0, + CUSTOM = 388595569, + DEFAULT = 115302945 + } + + /** AdvertisedGroups enum. */ + enum AdvertisedGroups { + UNDEFINED_ADVERTISED_GROUPS = 0, + ALL_SUBNETS = 3622872 + } + } + + /** Properties of a RouterBgpPeer. */ + interface IRouterBgpPeer { + + /** RouterBgpPeer advertiseMode */ + advertiseMode?: (google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode|keyof typeof google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode|null); + + /** RouterBgpPeer advertisedGroups */ + advertisedGroups?: (google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups[]|null); + + /** RouterBgpPeer advertisedIpRanges */ + advertisedIpRanges?: (google.cloud.compute.v1.IRouterAdvertisedIpRange[]|null); + + /** RouterBgpPeer advertisedRoutePriority */ + advertisedRoutePriority?: (number|null); + + /** RouterBgpPeer interfaceName */ + interfaceName?: (string|null); + + /** RouterBgpPeer ipAddress */ + ipAddress?: (string|null); + + /** RouterBgpPeer managementType */ + managementType?: (google.cloud.compute.v1.RouterBgpPeer.ManagementType|keyof typeof google.cloud.compute.v1.RouterBgpPeer.ManagementType|null); + + /** RouterBgpPeer name */ + name?: (string|null); + + /** RouterBgpPeer peerAsn */ + peerAsn?: (number|null); + + /** RouterBgpPeer peerIpAddress */ + peerIpAddress?: (string|null); + } + + /** Represents a RouterBgpPeer. */ + class RouterBgpPeer implements IRouterBgpPeer { + + /** + * Constructs a new RouterBgpPeer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterBgpPeer); + + /** RouterBgpPeer advertiseMode. */ + public advertiseMode?: (google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode|keyof typeof google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode|null); + + /** RouterBgpPeer advertisedGroups. */ + public advertisedGroups: google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups[]; + + /** RouterBgpPeer advertisedIpRanges. */ + public advertisedIpRanges: google.cloud.compute.v1.IRouterAdvertisedIpRange[]; + + /** RouterBgpPeer advertisedRoutePriority. */ + public advertisedRoutePriority?: (number|null); + + /** RouterBgpPeer interfaceName. */ + public interfaceName?: (string|null); + + /** RouterBgpPeer ipAddress. */ + public ipAddress?: (string|null); + + /** RouterBgpPeer managementType. */ + public managementType?: (google.cloud.compute.v1.RouterBgpPeer.ManagementType|keyof typeof google.cloud.compute.v1.RouterBgpPeer.ManagementType|null); + + /** RouterBgpPeer name. */ + public name?: (string|null); + + /** RouterBgpPeer peerAsn. */ + public peerAsn?: (number|null); + + /** RouterBgpPeer peerIpAddress. */ + public peerIpAddress?: (string|null); + + /** RouterBgpPeer _advertiseMode. */ + public _advertiseMode?: "advertiseMode"; + + /** RouterBgpPeer _advertisedRoutePriority. */ + public _advertisedRoutePriority?: "advertisedRoutePriority"; + + /** RouterBgpPeer _interfaceName. */ + public _interfaceName?: "interfaceName"; + + /** RouterBgpPeer _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** RouterBgpPeer _managementType. */ + public _managementType?: "managementType"; + + /** RouterBgpPeer _name. */ + public _name?: "name"; + + /** RouterBgpPeer _peerAsn. */ + public _peerAsn?: "peerAsn"; + + /** RouterBgpPeer _peerIpAddress. */ + public _peerIpAddress?: "peerIpAddress"; + + /** + * Creates a new RouterBgpPeer instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterBgpPeer instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterBgpPeer): google.cloud.compute.v1.RouterBgpPeer; + + /** + * Encodes the specified RouterBgpPeer message. Does not implicitly {@link google.cloud.compute.v1.RouterBgpPeer.verify|verify} messages. + * @param message RouterBgpPeer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterBgpPeer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterBgpPeer message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterBgpPeer.verify|verify} messages. + * @param message RouterBgpPeer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterBgpPeer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterBgpPeer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterBgpPeer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterBgpPeer; + + /** + * Decodes a RouterBgpPeer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterBgpPeer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterBgpPeer; + + /** + * Verifies a RouterBgpPeer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterBgpPeer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterBgpPeer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterBgpPeer; + + /** + * Creates a plain object from a RouterBgpPeer message. Also converts values to other types if specified. + * @param message RouterBgpPeer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterBgpPeer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterBgpPeer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RouterBgpPeer { + + /** AdvertiseMode enum. */ + enum AdvertiseMode { + UNDEFINED_ADVERTISE_MODE = 0, + CUSTOM = 388595569, + DEFAULT = 115302945 + } + + /** AdvertisedGroups enum. */ + enum AdvertisedGroups { + UNDEFINED_ADVERTISED_GROUPS = 0, + ALL_SUBNETS = 3622872 + } + + /** ManagementType enum. */ + enum ManagementType { + UNDEFINED_MANAGEMENT_TYPE = 0, + MANAGED_BY_ATTACHMENT = 458926411, + MANAGED_BY_USER = 317294067 + } + } + + /** Properties of a RouterInterface. */ + interface IRouterInterface { + + /** RouterInterface ipRange */ + ipRange?: (string|null); + + /** RouterInterface linkedInterconnectAttachment */ + linkedInterconnectAttachment?: (string|null); + + /** RouterInterface linkedVpnTunnel */ + linkedVpnTunnel?: (string|null); + + /** RouterInterface managementType */ + managementType?: (google.cloud.compute.v1.RouterInterface.ManagementType|keyof typeof google.cloud.compute.v1.RouterInterface.ManagementType|null); + + /** RouterInterface name */ + name?: (string|null); + } + + /** Represents a RouterInterface. */ + class RouterInterface implements IRouterInterface { + + /** + * Constructs a new RouterInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterInterface); + + /** RouterInterface ipRange. */ + public ipRange?: (string|null); + + /** RouterInterface linkedInterconnectAttachment. */ + public linkedInterconnectAttachment?: (string|null); + + /** RouterInterface linkedVpnTunnel. */ + public linkedVpnTunnel?: (string|null); + + /** RouterInterface managementType. */ + public managementType?: (google.cloud.compute.v1.RouterInterface.ManagementType|keyof typeof google.cloud.compute.v1.RouterInterface.ManagementType|null); + + /** RouterInterface name. */ + public name?: (string|null); + + /** RouterInterface _ipRange. */ + public _ipRange?: "ipRange"; + + /** RouterInterface _linkedInterconnectAttachment. */ + public _linkedInterconnectAttachment?: "linkedInterconnectAttachment"; + + /** RouterInterface _linkedVpnTunnel. */ + public _linkedVpnTunnel?: "linkedVpnTunnel"; + + /** RouterInterface _managementType. */ + public _managementType?: "managementType"; + + /** RouterInterface _name. */ + public _name?: "name"; + + /** + * Creates a new RouterInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterInterface instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterInterface): google.cloud.compute.v1.RouterInterface; + + /** + * Encodes the specified RouterInterface message. Does not implicitly {@link google.cloud.compute.v1.RouterInterface.verify|verify} messages. + * @param message RouterInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterInterface.verify|verify} messages. + * @param message RouterInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterInterface; + + /** + * Decodes a RouterInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterInterface; + + /** + * Verifies a RouterInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterInterface; + + /** + * Creates a plain object from a RouterInterface message. Also converts values to other types if specified. + * @param message RouterInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RouterInterface { + + /** ManagementType enum. */ + enum ManagementType { + UNDEFINED_MANAGEMENT_TYPE = 0, + MANAGED_BY_ATTACHMENT = 458926411, + MANAGED_BY_USER = 317294067 + } + } + + /** Properties of a RouterNat. */ + interface IRouterNat { + + /** RouterNat drainNatIps */ + drainNatIps?: (string[]|null); + + /** RouterNat enableEndpointIndependentMapping */ + enableEndpointIndependentMapping?: (boolean|null); + + /** RouterNat icmpIdleTimeoutSec */ + icmpIdleTimeoutSec?: (number|null); + + /** RouterNat logConfig */ + logConfig?: (google.cloud.compute.v1.IRouterNatLogConfig|null); + + /** RouterNat minPortsPerVm */ + minPortsPerVm?: (number|null); + + /** RouterNat name */ + name?: (string|null); + + /** RouterNat natIpAllocateOption */ + natIpAllocateOption?: (google.cloud.compute.v1.RouterNat.NatIpAllocateOption|keyof typeof google.cloud.compute.v1.RouterNat.NatIpAllocateOption|null); + + /** RouterNat natIps */ + natIps?: (string[]|null); + + /** RouterNat sourceSubnetworkIpRangesToNat */ + sourceSubnetworkIpRangesToNat?: (google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat|keyof typeof google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat|null); + + /** RouterNat subnetworks */ + subnetworks?: (google.cloud.compute.v1.IRouterNatSubnetworkToNat[]|null); + + /** RouterNat tcpEstablishedIdleTimeoutSec */ + tcpEstablishedIdleTimeoutSec?: (number|null); + + /** RouterNat tcpTransitoryIdleTimeoutSec */ + tcpTransitoryIdleTimeoutSec?: (number|null); + + /** RouterNat udpIdleTimeoutSec */ + udpIdleTimeoutSec?: (number|null); + } + + /** Represents a RouterNat. */ + class RouterNat implements IRouterNat { + + /** + * Constructs a new RouterNat. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterNat); + + /** RouterNat drainNatIps. */ + public drainNatIps: string[]; + + /** RouterNat enableEndpointIndependentMapping. */ + public enableEndpointIndependentMapping?: (boolean|null); + + /** RouterNat icmpIdleTimeoutSec. */ + public icmpIdleTimeoutSec?: (number|null); + + /** RouterNat logConfig. */ + public logConfig?: (google.cloud.compute.v1.IRouterNatLogConfig|null); + + /** RouterNat minPortsPerVm. */ + public minPortsPerVm?: (number|null); + + /** RouterNat name. */ + public name?: (string|null); + + /** RouterNat natIpAllocateOption. */ + public natIpAllocateOption?: (google.cloud.compute.v1.RouterNat.NatIpAllocateOption|keyof typeof google.cloud.compute.v1.RouterNat.NatIpAllocateOption|null); + + /** RouterNat natIps. */ + public natIps: string[]; + + /** RouterNat sourceSubnetworkIpRangesToNat. */ + public sourceSubnetworkIpRangesToNat?: (google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat|keyof typeof google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat|null); + + /** RouterNat subnetworks. */ + public subnetworks: google.cloud.compute.v1.IRouterNatSubnetworkToNat[]; + + /** RouterNat tcpEstablishedIdleTimeoutSec. */ + public tcpEstablishedIdleTimeoutSec?: (number|null); + + /** RouterNat tcpTransitoryIdleTimeoutSec. */ + public tcpTransitoryIdleTimeoutSec?: (number|null); + + /** RouterNat udpIdleTimeoutSec. */ + public udpIdleTimeoutSec?: (number|null); + + /** RouterNat _enableEndpointIndependentMapping. */ + public _enableEndpointIndependentMapping?: "enableEndpointIndependentMapping"; + + /** RouterNat _icmpIdleTimeoutSec. */ + public _icmpIdleTimeoutSec?: "icmpIdleTimeoutSec"; + + /** RouterNat _logConfig. */ + public _logConfig?: "logConfig"; + + /** RouterNat _minPortsPerVm. */ + public _minPortsPerVm?: "minPortsPerVm"; + + /** RouterNat _name. */ + public _name?: "name"; + + /** RouterNat _natIpAllocateOption. */ + public _natIpAllocateOption?: "natIpAllocateOption"; + + /** RouterNat _sourceSubnetworkIpRangesToNat. */ + public _sourceSubnetworkIpRangesToNat?: "sourceSubnetworkIpRangesToNat"; + + /** RouterNat _tcpEstablishedIdleTimeoutSec. */ + public _tcpEstablishedIdleTimeoutSec?: "tcpEstablishedIdleTimeoutSec"; + + /** RouterNat _tcpTransitoryIdleTimeoutSec. */ + public _tcpTransitoryIdleTimeoutSec?: "tcpTransitoryIdleTimeoutSec"; + + /** RouterNat _udpIdleTimeoutSec. */ + public _udpIdleTimeoutSec?: "udpIdleTimeoutSec"; + + /** + * Creates a new RouterNat instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterNat instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterNat): google.cloud.compute.v1.RouterNat; + + /** + * Encodes the specified RouterNat message. Does not implicitly {@link google.cloud.compute.v1.RouterNat.verify|verify} messages. + * @param message RouterNat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterNat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterNat message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterNat.verify|verify} messages. + * @param message RouterNat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterNat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterNat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterNat; + + /** + * Decodes a RouterNat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterNat; + + /** + * Verifies a RouterNat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterNat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterNat + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterNat; + + /** + * Creates a plain object from a RouterNat message. Also converts values to other types if specified. + * @param message RouterNat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterNat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterNat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RouterNat { + + /** NatIpAllocateOption enum. */ + enum NatIpAllocateOption { + UNDEFINED_NAT_IP_ALLOCATE_OPTION = 0, + AUTO_ONLY = 182333500, + MANUAL_ONLY = 261251205 + } + + /** SourceSubnetworkIpRangesToNat enum. */ + enum SourceSubnetworkIpRangesToNat { + UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT = 0, + ALL_SUBNETWORKS_ALL_IP_RANGES = 179964376, + ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES = 185573819, + LIST_OF_SUBNETWORKS = 517542270 + } + } + + /** Properties of a Router. */ + interface IRouter { + + /** Router bgp */ + bgp?: (google.cloud.compute.v1.IRouterBgp|null); + + /** Router bgpPeers */ + bgpPeers?: (google.cloud.compute.v1.IRouterBgpPeer[]|null); + + /** Router creationTimestamp */ + creationTimestamp?: (string|null); + + /** Router description */ + description?: (string|null); + + /** Router encryptedInterconnectRouter */ + encryptedInterconnectRouter?: (boolean|null); + + /** Router id */ + id?: (number|Long|string|null); + + /** Router interfaces */ + interfaces?: (google.cloud.compute.v1.IRouterInterface[]|null); + + /** Router kind */ + kind?: (string|null); + + /** Router name */ + name?: (string|null); + + /** Router nats */ + nats?: (google.cloud.compute.v1.IRouterNat[]|null); + + /** Router network */ + network?: (string|null); + + /** Router region */ + region?: (string|null); + + /** Router selfLink */ + selfLink?: (string|null); + } + + /** Represents a Router. */ + class Router implements IRouter { + + /** + * Constructs a new Router. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouter); + + /** Router bgp. */ + public bgp?: (google.cloud.compute.v1.IRouterBgp|null); + + /** Router bgpPeers. */ + public bgpPeers: google.cloud.compute.v1.IRouterBgpPeer[]; + + /** Router creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Router description. */ + public description?: (string|null); + + /** Router encryptedInterconnectRouter. */ + public encryptedInterconnectRouter?: (boolean|null); + + /** Router id. */ + public id?: (number|Long|string|null); + + /** Router interfaces. */ + public interfaces: google.cloud.compute.v1.IRouterInterface[]; + + /** Router kind. */ + public kind?: (string|null); + + /** Router name. */ + public name?: (string|null); + + /** Router nats. */ + public nats: google.cloud.compute.v1.IRouterNat[]; + + /** Router network. */ + public network?: (string|null); + + /** Router region. */ + public region?: (string|null); + + /** Router selfLink. */ + public selfLink?: (string|null); + + /** Router _bgp. */ + public _bgp?: "bgp"; + + /** Router _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Router _description. */ + public _description?: "description"; + + /** Router _encryptedInterconnectRouter. */ + public _encryptedInterconnectRouter?: "encryptedInterconnectRouter"; + + /** Router _id. */ + public _id?: "id"; + + /** Router _kind. */ + public _kind?: "kind"; + + /** Router _name. */ + public _name?: "name"; + + /** Router _network. */ + public _network?: "network"; + + /** Router _region. */ + public _region?: "region"; + + /** Router _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new Router instance using the specified properties. + * @param [properties] Properties to set + * @returns Router instance + */ + public static create(properties?: google.cloud.compute.v1.IRouter): google.cloud.compute.v1.Router; + + /** + * Encodes the specified Router message. Does not implicitly {@link google.cloud.compute.v1.Router.verify|verify} messages. + * @param message Router message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Router message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Router.verify|verify} messages. + * @param message Router message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Router message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Router + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Router; + + /** + * Decodes a Router message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Router + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Router; + + /** + * Verifies a Router message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Router message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Router + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Router; + + /** + * Creates a plain object from a Router message. Also converts values to other types if specified. + * @param message Router + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Router, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Router to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouterAdvertisedIpRange. */ + interface IRouterAdvertisedIpRange { + + /** RouterAdvertisedIpRange description */ + description?: (string|null); + + /** RouterAdvertisedIpRange range */ + range?: (string|null); + } + + /** Represents a RouterAdvertisedIpRange. */ + class RouterAdvertisedIpRange implements IRouterAdvertisedIpRange { + + /** + * Constructs a new RouterAdvertisedIpRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterAdvertisedIpRange); + + /** RouterAdvertisedIpRange description. */ + public description?: (string|null); + + /** RouterAdvertisedIpRange range. */ + public range?: (string|null); + + /** RouterAdvertisedIpRange _description. */ + public _description?: "description"; + + /** RouterAdvertisedIpRange _range. */ + public _range?: "range"; + + /** + * Creates a new RouterAdvertisedIpRange instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterAdvertisedIpRange instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterAdvertisedIpRange): google.cloud.compute.v1.RouterAdvertisedIpRange; + + /** + * Encodes the specified RouterAdvertisedIpRange message. Does not implicitly {@link google.cloud.compute.v1.RouterAdvertisedIpRange.verify|verify} messages. + * @param message RouterAdvertisedIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterAdvertisedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterAdvertisedIpRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterAdvertisedIpRange.verify|verify} messages. + * @param message RouterAdvertisedIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterAdvertisedIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterAdvertisedIpRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterAdvertisedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterAdvertisedIpRange; + + /** + * Decodes a RouterAdvertisedIpRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterAdvertisedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterAdvertisedIpRange; + + /** + * Verifies a RouterAdvertisedIpRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterAdvertisedIpRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterAdvertisedIpRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterAdvertisedIpRange; + + /** + * Creates a plain object from a RouterAdvertisedIpRange message. Also converts values to other types if specified. + * @param message RouterAdvertisedIpRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterAdvertisedIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterAdvertisedIpRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RoutersScopedList. */ + interface IRoutersScopedList { + + /** RoutersScopedList routers */ + routers?: (google.cloud.compute.v1.IRouter[]|null); + + /** RoutersScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RoutersScopedList. */ + class RoutersScopedList implements IRoutersScopedList { + + /** + * Constructs a new RoutersScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoutersScopedList); + + /** RoutersScopedList routers. */ + public routers: google.cloud.compute.v1.IRouter[]; + + /** RoutersScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RoutersScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RoutersScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutersScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IRoutersScopedList): google.cloud.compute.v1.RoutersScopedList; + + /** + * Encodes the specified RoutersScopedList message. Does not implicitly {@link google.cloud.compute.v1.RoutersScopedList.verify|verify} messages. + * @param message RoutersScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRoutersScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutersScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutersScopedList.verify|verify} messages. + * @param message RoutersScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRoutersScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutersScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RoutersScopedList; + + /** + * Decodes a RoutersScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RoutersScopedList; + + /** + * Verifies a RoutersScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutersScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutersScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RoutersScopedList; + + /** + * Creates a plain object from a RoutersScopedList message. Also converts values to other types if specified. + * @param message RoutersScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RoutersScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutersScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouterAggregatedList. */ + interface IRouterAggregatedList { + + /** RouterAggregatedList id */ + id?: (string|null); + + /** RouterAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IRoutersScopedList }|null); + + /** RouterAggregatedList kind */ + kind?: (string|null); + + /** RouterAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** RouterAggregatedList selfLink */ + selfLink?: (string|null); + + /** RouterAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** RouterAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RouterAggregatedList. */ + class RouterAggregatedList implements IRouterAggregatedList { + + /** + * Constructs a new RouterAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterAggregatedList); + + /** RouterAggregatedList id. */ + public id?: (string|null); + + /** RouterAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IRoutersScopedList }; + + /** RouterAggregatedList kind. */ + public kind?: (string|null); + + /** RouterAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RouterAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** RouterAggregatedList unreachables. */ + public unreachables: string[]; + + /** RouterAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RouterAggregatedList _id. */ + public _id?: "id"; + + /** RouterAggregatedList _kind. */ + public _kind?: "kind"; + + /** RouterAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RouterAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RouterAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RouterAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterAggregatedList): google.cloud.compute.v1.RouterAggregatedList; + + /** + * Encodes the specified RouterAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.RouterAggregatedList.verify|verify} messages. + * @param message RouterAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterAggregatedList.verify|verify} messages. + * @param message RouterAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterAggregatedList; + + /** + * Decodes a RouterAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterAggregatedList; + + /** + * Verifies a RouterAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterAggregatedList; + + /** + * Creates a plain object from a RouterAggregatedList message. Also converts values to other types if specified. + * @param message RouterAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouterList. */ + interface IRouterList { + + /** RouterList id */ + id?: (string|null); + + /** RouterList items */ + items?: (google.cloud.compute.v1.IRouter[]|null); + + /** RouterList kind */ + kind?: (string|null); + + /** RouterList nextPageToken */ + nextPageToken?: (string|null); + + /** RouterList selfLink */ + selfLink?: (string|null); + + /** RouterList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RouterList. */ + class RouterList implements IRouterList { + + /** + * Constructs a new RouterList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterList); + + /** RouterList id. */ + public id?: (string|null); + + /** RouterList items. */ + public items: google.cloud.compute.v1.IRouter[]; + + /** RouterList kind. */ + public kind?: (string|null); + + /** RouterList nextPageToken. */ + public nextPageToken?: (string|null); + + /** RouterList selfLink. */ + public selfLink?: (string|null); + + /** RouterList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RouterList _id. */ + public _id?: "id"; + + /** RouterList _kind. */ + public _kind?: "kind"; + + /** RouterList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RouterList _selfLink. */ + public _selfLink?: "selfLink"; + + /** RouterList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RouterList instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterList instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterList): google.cloud.compute.v1.RouterList; + + /** + * Encodes the specified RouterList message. Does not implicitly {@link google.cloud.compute.v1.RouterList.verify|verify} messages. + * @param message RouterList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterList.verify|verify} messages. + * @param message RouterList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterList; + + /** + * Decodes a RouterList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterList; + + /** + * Verifies a RouterList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterList; + + /** + * Creates a plain object from a RouterList message. Also converts values to other types if specified. + * @param message RouterList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouterNatLogConfig. */ + interface IRouterNatLogConfig { + + /** RouterNatLogConfig enable */ + enable?: (boolean|null); + + /** RouterNatLogConfig filter */ + filter?: (google.cloud.compute.v1.RouterNatLogConfig.Filter|keyof typeof google.cloud.compute.v1.RouterNatLogConfig.Filter|null); + } + + /** Represents a RouterNatLogConfig. */ + class RouterNatLogConfig implements IRouterNatLogConfig { + + /** + * Constructs a new RouterNatLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterNatLogConfig); + + /** RouterNatLogConfig enable. */ + public enable?: (boolean|null); + + /** RouterNatLogConfig filter. */ + public filter?: (google.cloud.compute.v1.RouterNatLogConfig.Filter|keyof typeof google.cloud.compute.v1.RouterNatLogConfig.Filter|null); + + /** RouterNatLogConfig _enable. */ + public _enable?: "enable"; + + /** RouterNatLogConfig _filter. */ + public _filter?: "filter"; + + /** + * Creates a new RouterNatLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterNatLogConfig instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterNatLogConfig): google.cloud.compute.v1.RouterNatLogConfig; + + /** + * Encodes the specified RouterNatLogConfig message. Does not implicitly {@link google.cloud.compute.v1.RouterNatLogConfig.verify|verify} messages. + * @param message RouterNatLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterNatLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterNatLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterNatLogConfig.verify|verify} messages. + * @param message RouterNatLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterNatLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterNatLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterNatLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterNatLogConfig; + + /** + * Decodes a RouterNatLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterNatLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterNatLogConfig; + + /** + * Verifies a RouterNatLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterNatLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterNatLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterNatLogConfig; + + /** + * Creates a plain object from a RouterNatLogConfig message. Also converts values to other types if specified. + * @param message RouterNatLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterNatLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterNatLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RouterNatLogConfig { + + /** Filter enum. */ + enum Filter { + UNDEFINED_FILTER = 0, + ALL = 64897, + ERRORS_ONLY = 307484672, + TRANSLATIONS_ONLY = 357212649 + } + } + + /** Properties of a RouterNatSubnetworkToNat. */ + interface IRouterNatSubnetworkToNat { + + /** RouterNatSubnetworkToNat name */ + name?: (string|null); + + /** RouterNatSubnetworkToNat secondaryIpRangeNames */ + secondaryIpRangeNames?: (string[]|null); + + /** RouterNatSubnetworkToNat sourceIpRangesToNat */ + sourceIpRangesToNat?: (google.cloud.compute.v1.RouterNatSubnetworkToNat.SourceIpRangesToNat[]|null); + } + + /** Represents a RouterNatSubnetworkToNat. */ + class RouterNatSubnetworkToNat implements IRouterNatSubnetworkToNat { + + /** + * Constructs a new RouterNatSubnetworkToNat. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterNatSubnetworkToNat); + + /** RouterNatSubnetworkToNat name. */ + public name?: (string|null); + + /** RouterNatSubnetworkToNat secondaryIpRangeNames. */ + public secondaryIpRangeNames: string[]; + + /** RouterNatSubnetworkToNat sourceIpRangesToNat. */ + public sourceIpRangesToNat: google.cloud.compute.v1.RouterNatSubnetworkToNat.SourceIpRangesToNat[]; + + /** RouterNatSubnetworkToNat _name. */ + public _name?: "name"; + + /** + * Creates a new RouterNatSubnetworkToNat instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterNatSubnetworkToNat instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterNatSubnetworkToNat): google.cloud.compute.v1.RouterNatSubnetworkToNat; + + /** + * Encodes the specified RouterNatSubnetworkToNat message. Does not implicitly {@link google.cloud.compute.v1.RouterNatSubnetworkToNat.verify|verify} messages. + * @param message RouterNatSubnetworkToNat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterNatSubnetworkToNat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterNatSubnetworkToNat message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterNatSubnetworkToNat.verify|verify} messages. + * @param message RouterNatSubnetworkToNat message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterNatSubnetworkToNat, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterNatSubnetworkToNat message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterNatSubnetworkToNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterNatSubnetworkToNat; + + /** + * Decodes a RouterNatSubnetworkToNat message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterNatSubnetworkToNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterNatSubnetworkToNat; + + /** + * Verifies a RouterNatSubnetworkToNat message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterNatSubnetworkToNat message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterNatSubnetworkToNat + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterNatSubnetworkToNat; + + /** + * Creates a plain object from a RouterNatSubnetworkToNat message. Also converts values to other types if specified. + * @param message RouterNatSubnetworkToNat + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterNatSubnetworkToNat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterNatSubnetworkToNat to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RouterNatSubnetworkToNat { + + /** SourceIpRangesToNat enum. */ + enum SourceIpRangesToNat { + UNDEFINED_SOURCE_IP_RANGES_TO_NAT = 0, + ALL_IP_RANGES = 35608496, + LIST_OF_SECONDARY_IP_RANGES = 192289308, + PRIMARY_IP_RANGE = 297109954 + } + } + + /** Properties of a RouterStatusBgpPeerStatus. */ + interface IRouterStatusBgpPeerStatus { + + /** RouterStatusBgpPeerStatus advertisedRoutes */ + advertisedRoutes?: (google.cloud.compute.v1.IRoute[]|null); + + /** RouterStatusBgpPeerStatus ipAddress */ + ipAddress?: (string|null); + + /** RouterStatusBgpPeerStatus linkedVpnTunnel */ + linkedVpnTunnel?: (string|null); + + /** RouterStatusBgpPeerStatus name */ + name?: (string|null); + + /** RouterStatusBgpPeerStatus numLearnedRoutes */ + numLearnedRoutes?: (number|null); + + /** RouterStatusBgpPeerStatus peerIpAddress */ + peerIpAddress?: (string|null); + + /** RouterStatusBgpPeerStatus state */ + state?: (string|null); + + /** RouterStatusBgpPeerStatus status */ + status?: (google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status|keyof typeof google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status|null); + + /** RouterStatusBgpPeerStatus uptime */ + uptime?: (string|null); + + /** RouterStatusBgpPeerStatus uptimeSeconds */ + uptimeSeconds?: (string|null); + } + + /** Represents a RouterStatusBgpPeerStatus. */ + class RouterStatusBgpPeerStatus implements IRouterStatusBgpPeerStatus { + + /** + * Constructs a new RouterStatusBgpPeerStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterStatusBgpPeerStatus); + + /** RouterStatusBgpPeerStatus advertisedRoutes. */ + public advertisedRoutes: google.cloud.compute.v1.IRoute[]; + + /** RouterStatusBgpPeerStatus ipAddress. */ + public ipAddress?: (string|null); + + /** RouterStatusBgpPeerStatus linkedVpnTunnel. */ + public linkedVpnTunnel?: (string|null); + + /** RouterStatusBgpPeerStatus name. */ + public name?: (string|null); + + /** RouterStatusBgpPeerStatus numLearnedRoutes. */ + public numLearnedRoutes?: (number|null); + + /** RouterStatusBgpPeerStatus peerIpAddress. */ + public peerIpAddress?: (string|null); + + /** RouterStatusBgpPeerStatus state. */ + public state?: (string|null); + + /** RouterStatusBgpPeerStatus status. */ + public status?: (google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status|keyof typeof google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status|null); + + /** RouterStatusBgpPeerStatus uptime. */ + public uptime?: (string|null); + + /** RouterStatusBgpPeerStatus uptimeSeconds. */ + public uptimeSeconds?: (string|null); + + /** RouterStatusBgpPeerStatus _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** RouterStatusBgpPeerStatus _linkedVpnTunnel. */ + public _linkedVpnTunnel?: "linkedVpnTunnel"; + + /** RouterStatusBgpPeerStatus _name. */ + public _name?: "name"; + + /** RouterStatusBgpPeerStatus _numLearnedRoutes. */ + public _numLearnedRoutes?: "numLearnedRoutes"; + + /** RouterStatusBgpPeerStatus _peerIpAddress. */ + public _peerIpAddress?: "peerIpAddress"; + + /** RouterStatusBgpPeerStatus _state. */ + public _state?: "state"; + + /** RouterStatusBgpPeerStatus _status. */ + public _status?: "status"; + + /** RouterStatusBgpPeerStatus _uptime. */ + public _uptime?: "uptime"; + + /** RouterStatusBgpPeerStatus _uptimeSeconds. */ + public _uptimeSeconds?: "uptimeSeconds"; + + /** + * Creates a new RouterStatusBgpPeerStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterStatusBgpPeerStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterStatusBgpPeerStatus): google.cloud.compute.v1.RouterStatusBgpPeerStatus; + + /** + * Encodes the specified RouterStatusBgpPeerStatus message. Does not implicitly {@link google.cloud.compute.v1.RouterStatusBgpPeerStatus.verify|verify} messages. + * @param message RouterStatusBgpPeerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterStatusBgpPeerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterStatusBgpPeerStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatusBgpPeerStatus.verify|verify} messages. + * @param message RouterStatusBgpPeerStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterStatusBgpPeerStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterStatusBgpPeerStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterStatusBgpPeerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterStatusBgpPeerStatus; + + /** + * Decodes a RouterStatusBgpPeerStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterStatusBgpPeerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterStatusBgpPeerStatus; + + /** + * Verifies a RouterStatusBgpPeerStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterStatusBgpPeerStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterStatusBgpPeerStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterStatusBgpPeerStatus; + + /** + * Creates a plain object from a RouterStatusBgpPeerStatus message. Also converts values to other types if specified. + * @param message RouterStatusBgpPeerStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterStatusBgpPeerStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterStatusBgpPeerStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace RouterStatusBgpPeerStatus { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + DOWN = 2104482, + UNKNOWN = 433141802, + UP = 2715 + } + } + + /** Properties of a RouterStatusNatStatus. */ + interface IRouterStatusNatStatus { + + /** RouterStatusNatStatus autoAllocatedNatIps */ + autoAllocatedNatIps?: (string[]|null); + + /** RouterStatusNatStatus drainAutoAllocatedNatIps */ + drainAutoAllocatedNatIps?: (string[]|null); + + /** RouterStatusNatStatus drainUserAllocatedNatIps */ + drainUserAllocatedNatIps?: (string[]|null); + + /** RouterStatusNatStatus minExtraNatIpsNeeded */ + minExtraNatIpsNeeded?: (number|null); + + /** RouterStatusNatStatus name */ + name?: (string|null); + + /** RouterStatusNatStatus numVmEndpointsWithNatMappings */ + numVmEndpointsWithNatMappings?: (number|null); + + /** RouterStatusNatStatus userAllocatedNatIpResources */ + userAllocatedNatIpResources?: (string[]|null); + + /** RouterStatusNatStatus userAllocatedNatIps */ + userAllocatedNatIps?: (string[]|null); + } + + /** Represents a RouterStatusNatStatus. */ + class RouterStatusNatStatus implements IRouterStatusNatStatus { + + /** + * Constructs a new RouterStatusNatStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterStatusNatStatus); + + /** RouterStatusNatStatus autoAllocatedNatIps. */ + public autoAllocatedNatIps: string[]; + + /** RouterStatusNatStatus drainAutoAllocatedNatIps. */ + public drainAutoAllocatedNatIps: string[]; + + /** RouterStatusNatStatus drainUserAllocatedNatIps. */ + public drainUserAllocatedNatIps: string[]; + + /** RouterStatusNatStatus minExtraNatIpsNeeded. */ + public minExtraNatIpsNeeded?: (number|null); + + /** RouterStatusNatStatus name. */ + public name?: (string|null); + + /** RouterStatusNatStatus numVmEndpointsWithNatMappings. */ + public numVmEndpointsWithNatMappings?: (number|null); + + /** RouterStatusNatStatus userAllocatedNatIpResources. */ + public userAllocatedNatIpResources: string[]; + + /** RouterStatusNatStatus userAllocatedNatIps. */ + public userAllocatedNatIps: string[]; + + /** RouterStatusNatStatus _minExtraNatIpsNeeded. */ + public _minExtraNatIpsNeeded?: "minExtraNatIpsNeeded"; + + /** RouterStatusNatStatus _name. */ + public _name?: "name"; + + /** RouterStatusNatStatus _numVmEndpointsWithNatMappings. */ + public _numVmEndpointsWithNatMappings?: "numVmEndpointsWithNatMappings"; + + /** + * Creates a new RouterStatusNatStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterStatusNatStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterStatusNatStatus): google.cloud.compute.v1.RouterStatusNatStatus; + + /** + * Encodes the specified RouterStatusNatStatus message. Does not implicitly {@link google.cloud.compute.v1.RouterStatusNatStatus.verify|verify} messages. + * @param message RouterStatusNatStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterStatusNatStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterStatusNatStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatusNatStatus.verify|verify} messages. + * @param message RouterStatusNatStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterStatusNatStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterStatusNatStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterStatusNatStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterStatusNatStatus; + + /** + * Decodes a RouterStatusNatStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterStatusNatStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterStatusNatStatus; + + /** + * Verifies a RouterStatusNatStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterStatusNatStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterStatusNatStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterStatusNatStatus; + + /** + * Creates a plain object from a RouterStatusNatStatus message. Also converts values to other types if specified. + * @param message RouterStatusNatStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterStatusNatStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterStatusNatStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouterStatus. */ + interface IRouterStatus { + + /** RouterStatus bestRoutes */ + bestRoutes?: (google.cloud.compute.v1.IRoute[]|null); + + /** RouterStatus bestRoutesForRouter */ + bestRoutesForRouter?: (google.cloud.compute.v1.IRoute[]|null); + + /** RouterStatus bgpPeerStatus */ + bgpPeerStatus?: (google.cloud.compute.v1.IRouterStatusBgpPeerStatus[]|null); + + /** RouterStatus natStatus */ + natStatus?: (google.cloud.compute.v1.IRouterStatusNatStatus[]|null); + + /** RouterStatus network */ + network?: (string|null); + } + + /** Represents a RouterStatus. */ + class RouterStatus implements IRouterStatus { + + /** + * Constructs a new RouterStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterStatus); + + /** RouterStatus bestRoutes. */ + public bestRoutes: google.cloud.compute.v1.IRoute[]; + + /** RouterStatus bestRoutesForRouter. */ + public bestRoutesForRouter: google.cloud.compute.v1.IRoute[]; + + /** RouterStatus bgpPeerStatus. */ + public bgpPeerStatus: google.cloud.compute.v1.IRouterStatusBgpPeerStatus[]; + + /** RouterStatus natStatus. */ + public natStatus: google.cloud.compute.v1.IRouterStatusNatStatus[]; + + /** RouterStatus network. */ + public network?: (string|null); + + /** RouterStatus _network. */ + public _network?: "network"; + + /** + * Creates a new RouterStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterStatus): google.cloud.compute.v1.RouterStatus; + + /** + * Encodes the specified RouterStatus message. Does not implicitly {@link google.cloud.compute.v1.RouterStatus.verify|verify} messages. + * @param message RouterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatus.verify|verify} messages. + * @param message RouterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterStatus; + + /** + * Decodes a RouterStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterStatus; + + /** + * Verifies a RouterStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterStatus; + + /** + * Creates a plain object from a RouterStatus message. Also converts values to other types if specified. + * @param message RouterStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RouterStatusResponse. */ + interface IRouterStatusResponse { + + /** RouterStatusResponse kind */ + kind?: (string|null); + + /** RouterStatusResponse result */ + result?: (google.cloud.compute.v1.IRouterStatus|null); + } + + /** Represents a RouterStatusResponse. */ + class RouterStatusResponse implements IRouterStatusResponse { + + /** + * Constructs a new RouterStatusResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRouterStatusResponse); + + /** RouterStatusResponse kind. */ + public kind?: (string|null); + + /** RouterStatusResponse result. */ + public result?: (google.cloud.compute.v1.IRouterStatus|null); + + /** RouterStatusResponse _kind. */ + public _kind?: "kind"; + + /** RouterStatusResponse _result. */ + public _result?: "result"; + + /** + * Creates a new RouterStatusResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterStatusResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IRouterStatusResponse): google.cloud.compute.v1.RouterStatusResponse; + + /** + * Encodes the specified RouterStatusResponse message. Does not implicitly {@link google.cloud.compute.v1.RouterStatusResponse.verify|verify} messages. + * @param message RouterStatusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRouterStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterStatusResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatusResponse.verify|verify} messages. + * @param message RouterStatusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRouterStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterStatusResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RouterStatusResponse; + + /** + * Decodes a RouterStatusResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RouterStatusResponse; + + /** + * Verifies a RouterStatusResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouterStatusResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterStatusResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RouterStatusResponse; + + /** + * Creates a plain object from a RouterStatusResponse message. Also converts values to other types if specified. + * @param message RouterStatusResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RouterStatusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterStatusResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RoutersPreviewResponse. */ + interface IRoutersPreviewResponse { + + /** RoutersPreviewResponse resource */ + resource?: (google.cloud.compute.v1.IRouter|null); + } + + /** Represents a RoutersPreviewResponse. */ + class RoutersPreviewResponse implements IRoutersPreviewResponse { + + /** + * Constructs a new RoutersPreviewResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoutersPreviewResponse); + + /** RoutersPreviewResponse resource. */ + public resource?: (google.cloud.compute.v1.IRouter|null); + + /** RoutersPreviewResponse _resource. */ + public _resource?: "resource"; + + /** + * Creates a new RoutersPreviewResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutersPreviewResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IRoutersPreviewResponse): google.cloud.compute.v1.RoutersPreviewResponse; + + /** + * Encodes the specified RoutersPreviewResponse message. Does not implicitly {@link google.cloud.compute.v1.RoutersPreviewResponse.verify|verify} messages. + * @param message RoutersPreviewResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRoutersPreviewResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutersPreviewResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutersPreviewResponse.verify|verify} messages. + * @param message RoutersPreviewResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRoutersPreviewResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutersPreviewResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutersPreviewResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RoutersPreviewResponse; + + /** + * Decodes a RoutersPreviewResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutersPreviewResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RoutersPreviewResponse; + + /** + * Verifies a RoutersPreviewResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutersPreviewResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutersPreviewResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RoutersPreviewResponse; + + /** + * Creates a plain object from a RoutersPreviewResponse message. Also converts values to other types if specified. + * @param message RoutersPreviewResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RoutersPreviewResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutersPreviewResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SchedulingNodeAffinity. */ + interface ISchedulingNodeAffinity { + + /** SchedulingNodeAffinity key */ + key?: (string|null); + + /** SchedulingNodeAffinity operator */ + operator?: (google.cloud.compute.v1.SchedulingNodeAffinity.Operator|keyof typeof google.cloud.compute.v1.SchedulingNodeAffinity.Operator|null); + + /** SchedulingNodeAffinity values */ + values?: (string[]|null); + } + + /** Represents a SchedulingNodeAffinity. */ + class SchedulingNodeAffinity implements ISchedulingNodeAffinity { + + /** + * Constructs a new SchedulingNodeAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISchedulingNodeAffinity); + + /** SchedulingNodeAffinity key. */ + public key?: (string|null); + + /** SchedulingNodeAffinity operator. */ + public operator?: (google.cloud.compute.v1.SchedulingNodeAffinity.Operator|keyof typeof google.cloud.compute.v1.SchedulingNodeAffinity.Operator|null); + + /** SchedulingNodeAffinity values. */ + public values: string[]; + + /** SchedulingNodeAffinity _key. */ + public _key?: "key"; + + /** SchedulingNodeAffinity _operator. */ + public _operator?: "operator"; + + /** + * Creates a new SchedulingNodeAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulingNodeAffinity instance + */ + public static create(properties?: google.cloud.compute.v1.ISchedulingNodeAffinity): google.cloud.compute.v1.SchedulingNodeAffinity; + + /** + * Encodes the specified SchedulingNodeAffinity message. Does not implicitly {@link google.cloud.compute.v1.SchedulingNodeAffinity.verify|verify} messages. + * @param message SchedulingNodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISchedulingNodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulingNodeAffinity message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SchedulingNodeAffinity.verify|verify} messages. + * @param message SchedulingNodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISchedulingNodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulingNodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SchedulingNodeAffinity; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulingNodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SchedulingNodeAffinity; + + /** + * Verifies a SchedulingNodeAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchedulingNodeAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulingNodeAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SchedulingNodeAffinity; + + /** + * Creates a plain object from a SchedulingNodeAffinity message. Also converts values to other types if specified. + * @param message SchedulingNodeAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SchedulingNodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulingNodeAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SchedulingNodeAffinity { + + /** Operator enum. */ + enum Operator { + UNDEFINED_OPERATOR = 0, + IN = 2341, + NOT_IN = 161144369, + OPERATOR_UNSPECIFIED = 128892924 + } + } + + /** Properties of a Screenshot. */ + interface IScreenshot { + + /** Screenshot contents */ + contents?: (string|null); + + /** Screenshot kind */ + kind?: (string|null); + } + + /** Represents a Screenshot. */ + class Screenshot implements IScreenshot { + + /** + * Constructs a new Screenshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IScreenshot); + + /** Screenshot contents. */ + public contents?: (string|null); + + /** Screenshot kind. */ + public kind?: (string|null); + + /** Screenshot _contents. */ + public _contents?: "contents"; + + /** Screenshot _kind. */ + public _kind?: "kind"; + + /** + * Creates a new Screenshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Screenshot instance + */ + public static create(properties?: google.cloud.compute.v1.IScreenshot): google.cloud.compute.v1.Screenshot; + + /** + * Encodes the specified Screenshot message. Does not implicitly {@link google.cloud.compute.v1.Screenshot.verify|verify} messages. + * @param message Screenshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IScreenshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Screenshot message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Screenshot.verify|verify} messages. + * @param message Screenshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IScreenshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Screenshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Screenshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Screenshot; + + /** + * Decodes a Screenshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Screenshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Screenshot; + + /** + * Verifies a Screenshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Screenshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Screenshot + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Screenshot; + + /** + * Creates a plain object from a Screenshot message. Also converts values to other types if specified. + * @param message Screenshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Screenshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Screenshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecurityPoliciesWafConfig. */ + interface ISecurityPoliciesWafConfig { + + /** SecurityPoliciesWafConfig wafRules */ + wafRules?: (google.cloud.compute.v1.IPreconfiguredWafSet|null); + } + + /** Represents a SecurityPoliciesWafConfig. */ + class SecurityPoliciesWafConfig implements ISecurityPoliciesWafConfig { + + /** + * Constructs a new SecurityPoliciesWafConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPoliciesWafConfig); + + /** SecurityPoliciesWafConfig wafRules. */ + public wafRules?: (google.cloud.compute.v1.IPreconfiguredWafSet|null); + + /** SecurityPoliciesWafConfig _wafRules. */ + public _wafRules?: "wafRules"; + + /** + * Creates a new SecurityPoliciesWafConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPoliciesWafConfig instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPoliciesWafConfig): google.cloud.compute.v1.SecurityPoliciesWafConfig; + + /** + * Encodes the specified SecurityPoliciesWafConfig message. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesWafConfig.verify|verify} messages. + * @param message SecurityPoliciesWafConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPoliciesWafConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPoliciesWafConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesWafConfig.verify|verify} messages. + * @param message SecurityPoliciesWafConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPoliciesWafConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPoliciesWafConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPoliciesWafConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPoliciesWafConfig; + + /** + * Decodes a SecurityPoliciesWafConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPoliciesWafConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPoliciesWafConfig; + + /** + * Verifies a SecurityPoliciesWafConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPoliciesWafConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPoliciesWafConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPoliciesWafConfig; + + /** + * Creates a plain object from a SecurityPoliciesWafConfig message. Also converts values to other types if specified. + * @param message SecurityPoliciesWafConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPoliciesWafConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPoliciesWafConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecurityPoliciesListPreconfiguredExpressionSetsResponse. */ + interface ISecurityPoliciesListPreconfiguredExpressionSetsResponse { + + /** SecurityPoliciesListPreconfiguredExpressionSetsResponse preconfiguredExpressionSets */ + preconfiguredExpressionSets?: (google.cloud.compute.v1.ISecurityPoliciesWafConfig|null); + } + + /** Represents a SecurityPoliciesListPreconfiguredExpressionSetsResponse. */ + class SecurityPoliciesListPreconfiguredExpressionSetsResponse implements ISecurityPoliciesListPreconfiguredExpressionSetsResponse { + + /** + * Constructs a new SecurityPoliciesListPreconfiguredExpressionSetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse); + + /** SecurityPoliciesListPreconfiguredExpressionSetsResponse preconfiguredExpressionSets. */ + public preconfiguredExpressionSets?: (google.cloud.compute.v1.ISecurityPoliciesWafConfig|null); + + /** SecurityPoliciesListPreconfiguredExpressionSetsResponse _preconfiguredExpressionSets. */ + public _preconfiguredExpressionSets?: "preconfiguredExpressionSets"; + + /** + * Creates a new SecurityPoliciesListPreconfiguredExpressionSetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPoliciesListPreconfiguredExpressionSetsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse): google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse; + + /** + * Encodes the specified SecurityPoliciesListPreconfiguredExpressionSetsResponse message. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse.verify|verify} messages. + * @param message SecurityPoliciesListPreconfiguredExpressionSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPoliciesListPreconfiguredExpressionSetsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse.verify|verify} messages. + * @param message SecurityPoliciesListPreconfiguredExpressionSetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPoliciesListPreconfiguredExpressionSetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse; + + /** + * Decodes a SecurityPoliciesListPreconfiguredExpressionSetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse; + + /** + * Verifies a SecurityPoliciesListPreconfiguredExpressionSetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPoliciesListPreconfiguredExpressionSetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPoliciesListPreconfiguredExpressionSetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse; + + /** + * Creates a plain object from a SecurityPoliciesListPreconfiguredExpressionSetsResponse message. Also converts values to other types if specified. + * @param message SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPoliciesListPreconfiguredExpressionSetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecurityPolicyRule. */ + interface ISecurityPolicyRule { + + /** SecurityPolicyRule action */ + action?: (string|null); + + /** SecurityPolicyRule description */ + description?: (string|null); + + /** SecurityPolicyRule kind */ + kind?: (string|null); + + /** SecurityPolicyRule match */ + match?: (google.cloud.compute.v1.ISecurityPolicyRuleMatcher|null); + + /** SecurityPolicyRule preview */ + preview?: (boolean|null); + + /** SecurityPolicyRule priority */ + priority?: (number|null); + } + + /** Represents a SecurityPolicyRule. */ + class SecurityPolicyRule implements ISecurityPolicyRule { + + /** + * Constructs a new SecurityPolicyRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPolicyRule); + + /** SecurityPolicyRule action. */ + public action?: (string|null); + + /** SecurityPolicyRule description. */ + public description?: (string|null); + + /** SecurityPolicyRule kind. */ + public kind?: (string|null); + + /** SecurityPolicyRule match. */ + public match?: (google.cloud.compute.v1.ISecurityPolicyRuleMatcher|null); + + /** SecurityPolicyRule preview. */ + public preview?: (boolean|null); + + /** SecurityPolicyRule priority. */ + public priority?: (number|null); + + /** SecurityPolicyRule _action. */ + public _action?: "action"; + + /** SecurityPolicyRule _description. */ + public _description?: "description"; + + /** SecurityPolicyRule _kind. */ + public _kind?: "kind"; + + /** SecurityPolicyRule _match. */ + public _match?: "match"; + + /** SecurityPolicyRule _preview. */ + public _preview?: "preview"; + + /** SecurityPolicyRule _priority. */ + public _priority?: "priority"; + + /** + * Creates a new SecurityPolicyRule instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicyRule instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPolicyRule): google.cloud.compute.v1.SecurityPolicyRule; + + /** + * Encodes the specified SecurityPolicyRule message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRule.verify|verify} messages. + * @param message SecurityPolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicyRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRule.verify|verify} messages. + * @param message SecurityPolicyRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPolicyRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicyRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPolicyRule; + + /** + * Decodes a SecurityPolicyRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPolicyRule; + + /** + * Verifies a SecurityPolicyRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicyRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicyRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPolicyRule; + + /** + * Creates a plain object from a SecurityPolicyRule message. Also converts values to other types if specified. + * @param message SecurityPolicyRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPolicyRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicyRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecurityPolicy. */ + interface ISecurityPolicy { + + /** SecurityPolicy creationTimestamp */ + creationTimestamp?: (string|null); + + /** SecurityPolicy description */ + description?: (string|null); + + /** SecurityPolicy fingerprint */ + fingerprint?: (string|null); + + /** SecurityPolicy id */ + id?: (number|Long|string|null); + + /** SecurityPolicy kind */ + kind?: (string|null); + + /** SecurityPolicy name */ + name?: (string|null); + + /** SecurityPolicy rules */ + rules?: (google.cloud.compute.v1.ISecurityPolicyRule[]|null); + + /** SecurityPolicy selfLink */ + selfLink?: (string|null); + } + + /** Represents a SecurityPolicy. */ + class SecurityPolicy implements ISecurityPolicy { + + /** + * Constructs a new SecurityPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPolicy); + + /** SecurityPolicy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** SecurityPolicy description. */ + public description?: (string|null); + + /** SecurityPolicy fingerprint. */ + public fingerprint?: (string|null); + + /** SecurityPolicy id. */ + public id?: (number|Long|string|null); + + /** SecurityPolicy kind. */ + public kind?: (string|null); + + /** SecurityPolicy name. */ + public name?: (string|null); + + /** SecurityPolicy rules. */ + public rules: google.cloud.compute.v1.ISecurityPolicyRule[]; + + /** SecurityPolicy selfLink. */ + public selfLink?: (string|null); + + /** SecurityPolicy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** SecurityPolicy _description. */ + public _description?: "description"; + + /** SecurityPolicy _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** SecurityPolicy _id. */ + public _id?: "id"; + + /** SecurityPolicy _kind. */ + public _kind?: "kind"; + + /** SecurityPolicy _name. */ + public _name?: "name"; + + /** SecurityPolicy _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new SecurityPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPolicy): google.cloud.compute.v1.SecurityPolicy; + + /** + * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicy.verify|verify} messages. + * @param message SecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicy.verify|verify} messages. + * @param message SecurityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPolicy; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPolicy; + + /** + * Verifies a SecurityPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPolicy; + + /** + * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. + * @param message SecurityPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecurityPolicyList. */ + interface ISecurityPolicyList { + + /** SecurityPolicyList id */ + id?: (string|null); + + /** SecurityPolicyList items */ + items?: (google.cloud.compute.v1.ISecurityPolicy[]|null); + + /** SecurityPolicyList kind */ + kind?: (string|null); + + /** SecurityPolicyList nextPageToken */ + nextPageToken?: (string|null); + + /** SecurityPolicyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SecurityPolicyList. */ + class SecurityPolicyList implements ISecurityPolicyList { + + /** + * Constructs a new SecurityPolicyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPolicyList); + + /** SecurityPolicyList id. */ + public id?: (string|null); + + /** SecurityPolicyList items. */ + public items: google.cloud.compute.v1.ISecurityPolicy[]; + + /** SecurityPolicyList kind. */ + public kind?: (string|null); + + /** SecurityPolicyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** SecurityPolicyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SecurityPolicyList _id. */ + public _id?: "id"; + + /** SecurityPolicyList _kind. */ + public _kind?: "kind"; + + /** SecurityPolicyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** SecurityPolicyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SecurityPolicyList instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicyList instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPolicyList): google.cloud.compute.v1.SecurityPolicyList; + + /** + * Encodes the specified SecurityPolicyList message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyList.verify|verify} messages. + * @param message SecurityPolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyList.verify|verify} messages. + * @param message SecurityPolicyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPolicyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPolicyList; + + /** + * Decodes a SecurityPolicyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPolicyList; + + /** + * Verifies a SecurityPolicyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPolicyList; + + /** + * Creates a plain object from a SecurityPolicyList message. Also converts values to other types if specified. + * @param message SecurityPolicyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPolicyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecurityPolicyReference. */ + interface ISecurityPolicyReference { + + /** SecurityPolicyReference securityPolicy */ + securityPolicy?: (string|null); + } + + /** Represents a SecurityPolicyReference. */ + class SecurityPolicyReference implements ISecurityPolicyReference { + + /** + * Constructs a new SecurityPolicyReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPolicyReference); + + /** SecurityPolicyReference securityPolicy. */ + public securityPolicy?: (string|null); + + /** SecurityPolicyReference _securityPolicy. */ + public _securityPolicy?: "securityPolicy"; + + /** + * Creates a new SecurityPolicyReference instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicyReference instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPolicyReference): google.cloud.compute.v1.SecurityPolicyReference; + + /** + * Encodes the specified SecurityPolicyReference message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyReference.verify|verify} messages. + * @param message SecurityPolicyReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPolicyReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicyReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyReference.verify|verify} messages. + * @param message SecurityPolicyReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPolicyReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicyReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPolicyReference; + + /** + * Decodes a SecurityPolicyReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPolicyReference; + + /** + * Verifies a SecurityPolicyReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicyReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicyReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPolicyReference; + + /** + * Creates a plain object from a SecurityPolicyReference message. Also converts values to other types if specified. + * @param message SecurityPolicyReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPolicyReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicyReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SecurityPolicyRuleMatcher. */ + interface ISecurityPolicyRuleMatcher { + + /** SecurityPolicyRuleMatcher config */ + config?: (google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig|null); + + /** SecurityPolicyRuleMatcher expr */ + expr?: (google.cloud.compute.v1.IExpr|null); + + /** SecurityPolicyRuleMatcher versionedExpr */ + versionedExpr?: (google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr|keyof typeof google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr|null); + } + + /** Represents a SecurityPolicyRuleMatcher. */ + class SecurityPolicyRuleMatcher implements ISecurityPolicyRuleMatcher { + + /** + * Constructs a new SecurityPolicyRuleMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPolicyRuleMatcher); + + /** SecurityPolicyRuleMatcher config. */ + public config?: (google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig|null); + + /** SecurityPolicyRuleMatcher expr. */ + public expr?: (google.cloud.compute.v1.IExpr|null); + + /** SecurityPolicyRuleMatcher versionedExpr. */ + public versionedExpr?: (google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr|keyof typeof google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr|null); + + /** SecurityPolicyRuleMatcher _config. */ + public _config?: "config"; + + /** SecurityPolicyRuleMatcher _expr. */ + public _expr?: "expr"; + + /** SecurityPolicyRuleMatcher _versionedExpr. */ + public _versionedExpr?: "versionedExpr"; + + /** + * Creates a new SecurityPolicyRuleMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicyRuleMatcher instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPolicyRuleMatcher): google.cloud.compute.v1.SecurityPolicyRuleMatcher; + + /** + * Encodes the specified SecurityPolicyRuleMatcher message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcher.verify|verify} messages. + * @param message SecurityPolicyRuleMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPolicyRuleMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicyRuleMatcher message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcher.verify|verify} messages. + * @param message SecurityPolicyRuleMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPolicyRuleMatcher, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicyRuleMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPolicyRuleMatcher; + + /** + * Decodes a SecurityPolicyRuleMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPolicyRuleMatcher; + + /** + * Verifies a SecurityPolicyRuleMatcher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicyRuleMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicyRuleMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPolicyRuleMatcher; + + /** + * Creates a plain object from a SecurityPolicyRuleMatcher message. Also converts values to other types if specified. + * @param message SecurityPolicyRuleMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPolicyRuleMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicyRuleMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SecurityPolicyRuleMatcher { + + /** VersionedExpr enum. */ + enum VersionedExpr { + UNDEFINED_VERSIONED_EXPR = 0, + SRC_IPS_V1 = 70925961 + } + } + + /** Properties of a SecurityPolicyRuleMatcherConfig. */ + interface ISecurityPolicyRuleMatcherConfig { + + /** SecurityPolicyRuleMatcherConfig srcIpRanges */ + srcIpRanges?: (string[]|null); + } + + /** Represents a SecurityPolicyRuleMatcherConfig. */ + class SecurityPolicyRuleMatcherConfig implements ISecurityPolicyRuleMatcherConfig { + + /** + * Constructs a new SecurityPolicyRuleMatcherConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig); + + /** SecurityPolicyRuleMatcherConfig srcIpRanges. */ + public srcIpRanges: string[]; + + /** + * Creates a new SecurityPolicyRuleMatcherConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityPolicyRuleMatcherConfig instance + */ + public static create(properties?: google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig): google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig; + + /** + * Encodes the specified SecurityPolicyRuleMatcherConfig message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.verify|verify} messages. + * @param message SecurityPolicyRuleMatcherConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityPolicyRuleMatcherConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.verify|verify} messages. + * @param message SecurityPolicyRuleMatcherConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityPolicyRuleMatcherConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityPolicyRuleMatcherConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig; + + /** + * Decodes a SecurityPolicyRuleMatcherConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityPolicyRuleMatcherConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig; + + /** + * Verifies a SecurityPolicyRuleMatcherConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityPolicyRuleMatcherConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityPolicyRuleMatcherConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig; + + /** + * Creates a plain object from a SecurityPolicyRuleMatcherConfig message. Also converts values to other types if specified. + * @param message SecurityPolicyRuleMatcherConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityPolicyRuleMatcherConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SerialPortOutput. */ + interface ISerialPortOutput { + + /** SerialPortOutput contents */ + contents?: (string|null); + + /** SerialPortOutput kind */ + kind?: (string|null); + + /** SerialPortOutput next */ + next?: (number|Long|string|null); + + /** SerialPortOutput selfLink */ + selfLink?: (string|null); + + /** SerialPortOutput start */ + start?: (number|Long|string|null); + } + + /** Represents a SerialPortOutput. */ + class SerialPortOutput implements ISerialPortOutput { + + /** + * Constructs a new SerialPortOutput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISerialPortOutput); + + /** SerialPortOutput contents. */ + public contents?: (string|null); + + /** SerialPortOutput kind. */ + public kind?: (string|null); + + /** SerialPortOutput next. */ + public next?: (number|Long|string|null); + + /** SerialPortOutput selfLink. */ + public selfLink?: (string|null); + + /** SerialPortOutput start. */ + public start?: (number|Long|string|null); + + /** SerialPortOutput _contents. */ + public _contents?: "contents"; + + /** SerialPortOutput _kind. */ + public _kind?: "kind"; + + /** SerialPortOutput _next. */ + public _next?: "next"; + + /** SerialPortOutput _selfLink. */ + public _selfLink?: "selfLink"; + + /** SerialPortOutput _start. */ + public _start?: "start"; + + /** + * Creates a new SerialPortOutput instance using the specified properties. + * @param [properties] Properties to set + * @returns SerialPortOutput instance + */ + public static create(properties?: google.cloud.compute.v1.ISerialPortOutput): google.cloud.compute.v1.SerialPortOutput; + + /** + * Encodes the specified SerialPortOutput message. Does not implicitly {@link google.cloud.compute.v1.SerialPortOutput.verify|verify} messages. + * @param message SerialPortOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISerialPortOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SerialPortOutput message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SerialPortOutput.verify|verify} messages. + * @param message SerialPortOutput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISerialPortOutput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SerialPortOutput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SerialPortOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SerialPortOutput; + + /** + * Decodes a SerialPortOutput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SerialPortOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SerialPortOutput; + + /** + * Verifies a SerialPortOutput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SerialPortOutput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SerialPortOutput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SerialPortOutput; + + /** + * Creates a plain object from a SerialPortOutput message. Also converts values to other types if specified. + * @param message SerialPortOutput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SerialPortOutput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SerialPortOutput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ShieldedInstanceIdentityEntry. */ + interface IShieldedInstanceIdentityEntry { + + /** ShieldedInstanceIdentityEntry ekCert */ + ekCert?: (string|null); + + /** ShieldedInstanceIdentityEntry ekPub */ + ekPub?: (string|null); + } + + /** Represents a ShieldedInstanceIdentityEntry. */ + class ShieldedInstanceIdentityEntry implements IShieldedInstanceIdentityEntry { + + /** + * Constructs a new ShieldedInstanceIdentityEntry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IShieldedInstanceIdentityEntry); + + /** ShieldedInstanceIdentityEntry ekCert. */ + public ekCert?: (string|null); + + /** ShieldedInstanceIdentityEntry ekPub. */ + public ekPub?: (string|null); + + /** ShieldedInstanceIdentityEntry _ekCert. */ + public _ekCert?: "ekCert"; + + /** ShieldedInstanceIdentityEntry _ekPub. */ + public _ekPub?: "ekPub"; + + /** + * Creates a new ShieldedInstanceIdentityEntry instance using the specified properties. + * @param [properties] Properties to set + * @returns ShieldedInstanceIdentityEntry instance + */ + public static create(properties?: google.cloud.compute.v1.IShieldedInstanceIdentityEntry): google.cloud.compute.v1.ShieldedInstanceIdentityEntry; + + /** + * Encodes the specified ShieldedInstanceIdentityEntry message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentityEntry.verify|verify} messages. + * @param message ShieldedInstanceIdentityEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IShieldedInstanceIdentityEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShieldedInstanceIdentityEntry message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentityEntry.verify|verify} messages. + * @param message ShieldedInstanceIdentityEntry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IShieldedInstanceIdentityEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShieldedInstanceIdentityEntry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShieldedInstanceIdentityEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ShieldedInstanceIdentityEntry; + + /** + * Decodes a ShieldedInstanceIdentityEntry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShieldedInstanceIdentityEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ShieldedInstanceIdentityEntry; + + /** + * Verifies a ShieldedInstanceIdentityEntry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShieldedInstanceIdentityEntry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShieldedInstanceIdentityEntry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ShieldedInstanceIdentityEntry; + + /** + * Creates a plain object from a ShieldedInstanceIdentityEntry message. Also converts values to other types if specified. + * @param message ShieldedInstanceIdentityEntry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ShieldedInstanceIdentityEntry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShieldedInstanceIdentityEntry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ShieldedInstanceIdentity. */ + interface IShieldedInstanceIdentity { + + /** ShieldedInstanceIdentity encryptionKey */ + encryptionKey?: (google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null); + + /** ShieldedInstanceIdentity kind */ + kind?: (string|null); + + /** ShieldedInstanceIdentity signingKey */ + signingKey?: (google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null); + } + + /** Represents a ShieldedInstanceIdentity. */ + class ShieldedInstanceIdentity implements IShieldedInstanceIdentity { + + /** + * Constructs a new ShieldedInstanceIdentity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IShieldedInstanceIdentity); + + /** ShieldedInstanceIdentity encryptionKey. */ + public encryptionKey?: (google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null); + + /** ShieldedInstanceIdentity kind. */ + public kind?: (string|null); + + /** ShieldedInstanceIdentity signingKey. */ + public signingKey?: (google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null); + + /** ShieldedInstanceIdentity _encryptionKey. */ + public _encryptionKey?: "encryptionKey"; + + /** ShieldedInstanceIdentity _kind. */ + public _kind?: "kind"; + + /** ShieldedInstanceIdentity _signingKey. */ + public _signingKey?: "signingKey"; + + /** + * Creates a new ShieldedInstanceIdentity instance using the specified properties. + * @param [properties] Properties to set + * @returns ShieldedInstanceIdentity instance + */ + public static create(properties?: google.cloud.compute.v1.IShieldedInstanceIdentity): google.cloud.compute.v1.ShieldedInstanceIdentity; + + /** + * Encodes the specified ShieldedInstanceIdentity message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentity.verify|verify} messages. + * @param message ShieldedInstanceIdentity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IShieldedInstanceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShieldedInstanceIdentity message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentity.verify|verify} messages. + * @param message ShieldedInstanceIdentity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IShieldedInstanceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShieldedInstanceIdentity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShieldedInstanceIdentity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ShieldedInstanceIdentity; + + /** + * Decodes a ShieldedInstanceIdentity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShieldedInstanceIdentity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ShieldedInstanceIdentity; + + /** + * Verifies a ShieldedInstanceIdentity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShieldedInstanceIdentity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShieldedInstanceIdentity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ShieldedInstanceIdentity; + + /** + * Creates a plain object from a ShieldedInstanceIdentity message. Also converts values to other types if specified. + * @param message ShieldedInstanceIdentity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ShieldedInstanceIdentity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShieldedInstanceIdentity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SignedUrlKey. */ + interface ISignedUrlKey { + + /** SignedUrlKey keyName */ + keyName?: (string|null); + + /** SignedUrlKey keyValue */ + keyValue?: (string|null); + } + + /** Represents a SignedUrlKey. */ + class SignedUrlKey implements ISignedUrlKey { + + /** + * Constructs a new SignedUrlKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISignedUrlKey); + + /** SignedUrlKey keyName. */ + public keyName?: (string|null); + + /** SignedUrlKey keyValue. */ + public keyValue?: (string|null); + + /** SignedUrlKey _keyName. */ + public _keyName?: "keyName"; + + /** SignedUrlKey _keyValue. */ + public _keyValue?: "keyValue"; + + /** + * Creates a new SignedUrlKey instance using the specified properties. + * @param [properties] Properties to set + * @returns SignedUrlKey instance + */ + public static create(properties?: google.cloud.compute.v1.ISignedUrlKey): google.cloud.compute.v1.SignedUrlKey; + + /** + * Encodes the specified SignedUrlKey message. Does not implicitly {@link google.cloud.compute.v1.SignedUrlKey.verify|verify} messages. + * @param message SignedUrlKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISignedUrlKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SignedUrlKey message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SignedUrlKey.verify|verify} messages. + * @param message SignedUrlKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISignedUrlKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SignedUrlKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SignedUrlKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SignedUrlKey; + + /** + * Decodes a SignedUrlKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SignedUrlKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SignedUrlKey; + + /** + * Verifies a SignedUrlKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SignedUrlKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SignedUrlKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SignedUrlKey; + + /** + * Creates a plain object from a SignedUrlKey message. Also converts values to other types if specified. + * @param message SignedUrlKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SignedUrlKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SignedUrlKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Snapshot. */ + interface ISnapshot { + + /** Snapshot autoCreated */ + autoCreated?: (boolean|null); + + /** Snapshot chainName */ + chainName?: (string|null); + + /** Snapshot creationTimestamp */ + creationTimestamp?: (string|null); + + /** Snapshot description */ + description?: (string|null); + + /** Snapshot diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** Snapshot downloadBytes */ + downloadBytes?: (number|Long|string|null); + + /** Snapshot id */ + id?: (number|Long|string|null); + + /** Snapshot kind */ + kind?: (string|null); + + /** Snapshot labelFingerprint */ + labelFingerprint?: (string|null); + + /** Snapshot labels */ + labels?: ({ [k: string]: string }|null); + + /** Snapshot licenseCodes */ + licenseCodes?: ((number|Long|string)[]|null); + + /** Snapshot licenses */ + licenses?: (string[]|null); + + /** Snapshot locationHint */ + locationHint?: (string|null); + + /** Snapshot name */ + name?: (string|null); + + /** Snapshot satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Snapshot selfLink */ + selfLink?: (string|null); + + /** Snapshot snapshotEncryptionKey */ + snapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Snapshot sourceDisk */ + sourceDisk?: (string|null); + + /** Snapshot sourceDiskEncryptionKey */ + sourceDiskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Snapshot sourceDiskId */ + sourceDiskId?: (string|null); + + /** Snapshot status */ + status?: (google.cloud.compute.v1.Snapshot.Status|keyof typeof google.cloud.compute.v1.Snapshot.Status|null); + + /** Snapshot storageBytes */ + storageBytes?: (number|Long|string|null); + + /** Snapshot storageBytesStatus */ + storageBytesStatus?: (google.cloud.compute.v1.Snapshot.StorageBytesStatus|keyof typeof google.cloud.compute.v1.Snapshot.StorageBytesStatus|null); + + /** Snapshot storageLocations */ + storageLocations?: (string[]|null); + } + + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { + + /** + * Constructs a new Snapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISnapshot); + + /** Snapshot autoCreated. */ + public autoCreated?: (boolean|null); + + /** Snapshot chainName. */ + public chainName?: (string|null); + + /** Snapshot creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Snapshot description. */ + public description?: (string|null); + + /** Snapshot diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** Snapshot downloadBytes. */ + public downloadBytes?: (number|Long|string|null); + + /** Snapshot id. */ + public id?: (number|Long|string|null); + + /** Snapshot kind. */ + public kind?: (string|null); + + /** Snapshot labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** Snapshot labels. */ + public labels: { [k: string]: string }; + + /** Snapshot licenseCodes. */ + public licenseCodes: (number|Long|string)[]; + + /** Snapshot licenses. */ + public licenses: string[]; + + /** Snapshot locationHint. */ + public locationHint?: (string|null); + + /** Snapshot name. */ + public name?: (string|null); + + /** Snapshot satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Snapshot selfLink. */ + public selfLink?: (string|null); + + /** Snapshot snapshotEncryptionKey. */ + public snapshotEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Snapshot sourceDisk. */ + public sourceDisk?: (string|null); + + /** Snapshot sourceDiskEncryptionKey. */ + public sourceDiskEncryptionKey?: (google.cloud.compute.v1.ICustomerEncryptionKey|null); + + /** Snapshot sourceDiskId. */ + public sourceDiskId?: (string|null); + + /** Snapshot status. */ + public status?: (google.cloud.compute.v1.Snapshot.Status|keyof typeof google.cloud.compute.v1.Snapshot.Status|null); + + /** Snapshot storageBytes. */ + public storageBytes?: (number|Long|string|null); + + /** Snapshot storageBytesStatus. */ + public storageBytesStatus?: (google.cloud.compute.v1.Snapshot.StorageBytesStatus|keyof typeof google.cloud.compute.v1.Snapshot.StorageBytesStatus|null); + + /** Snapshot storageLocations. */ + public storageLocations: string[]; + + /** Snapshot _autoCreated. */ + public _autoCreated?: "autoCreated"; + + /** Snapshot _chainName. */ + public _chainName?: "chainName"; + + /** Snapshot _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Snapshot _description. */ + public _description?: "description"; + + /** Snapshot _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** Snapshot _downloadBytes. */ + public _downloadBytes?: "downloadBytes"; + + /** Snapshot _id. */ + public _id?: "id"; + + /** Snapshot _kind. */ + public _kind?: "kind"; + + /** Snapshot _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** Snapshot _locationHint. */ + public _locationHint?: "locationHint"; + + /** Snapshot _name. */ + public _name?: "name"; + + /** Snapshot _satisfiesPzs. */ + public _satisfiesPzs?: "satisfiesPzs"; + + /** Snapshot _selfLink. */ + public _selfLink?: "selfLink"; + + /** Snapshot _snapshotEncryptionKey. */ + public _snapshotEncryptionKey?: "snapshotEncryptionKey"; + + /** Snapshot _sourceDisk. */ + public _sourceDisk?: "sourceDisk"; + + /** Snapshot _sourceDiskEncryptionKey. */ + public _sourceDiskEncryptionKey?: "sourceDiskEncryptionKey"; + + /** Snapshot _sourceDiskId. */ + public _sourceDiskId?: "sourceDiskId"; + + /** Snapshot _status. */ + public _status?: "status"; + + /** Snapshot _storageBytes. */ + public _storageBytes?: "storageBytes"; + + /** Snapshot _storageBytesStatus. */ + public _storageBytesStatus?: "storageBytesStatus"; + + /** + * Creates a new Snapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Snapshot instance + */ + public static create(properties?: google.cloud.compute.v1.ISnapshot): google.cloud.compute.v1.Snapshot; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.cloud.compute.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Snapshot; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Snapshot; + + /** + * Verifies a Snapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Snapshot + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Snapshot; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Snapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Snapshot { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + FAILED = 455706685, + READY = 77848963, + UPLOADING = 267603489 + } + + /** StorageBytesStatus enum. */ + enum StorageBytesStatus { + UNDEFINED_STORAGE_BYTES_STATUS = 0, + UPDATING = 494614342, + UP_TO_DATE = 101306702 + } + } + + /** Properties of a SnapshotList. */ + interface ISnapshotList { + + /** SnapshotList id */ + id?: (string|null); + + /** SnapshotList items */ + items?: (google.cloud.compute.v1.ISnapshot[]|null); + + /** SnapshotList kind */ + kind?: (string|null); + + /** SnapshotList nextPageToken */ + nextPageToken?: (string|null); + + /** SnapshotList selfLink */ + selfLink?: (string|null); + + /** SnapshotList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SnapshotList. */ + class SnapshotList implements ISnapshotList { + + /** + * Constructs a new SnapshotList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISnapshotList); + + /** SnapshotList id. */ + public id?: (string|null); + + /** SnapshotList items. */ + public items: google.cloud.compute.v1.ISnapshot[]; + + /** SnapshotList kind. */ + public kind?: (string|null); + + /** SnapshotList nextPageToken. */ + public nextPageToken?: (string|null); + + /** SnapshotList selfLink. */ + public selfLink?: (string|null); + + /** SnapshotList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SnapshotList _id. */ + public _id?: "id"; + + /** SnapshotList _kind. */ + public _kind?: "kind"; + + /** SnapshotList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** SnapshotList _selfLink. */ + public _selfLink?: "selfLink"; + + /** SnapshotList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SnapshotList instance using the specified properties. + * @param [properties] Properties to set + * @returns SnapshotList instance + */ + public static create(properties?: google.cloud.compute.v1.ISnapshotList): google.cloud.compute.v1.SnapshotList; + + /** + * Encodes the specified SnapshotList message. Does not implicitly {@link google.cloud.compute.v1.SnapshotList.verify|verify} messages. + * @param message SnapshotList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISnapshotList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SnapshotList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SnapshotList.verify|verify} messages. + * @param message SnapshotList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISnapshotList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SnapshotList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SnapshotList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SnapshotList; + + /** + * Decodes a SnapshotList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SnapshotList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SnapshotList; + + /** + * Verifies a SnapshotList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SnapshotList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SnapshotList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SnapshotList; + + /** + * Creates a plain object from a SnapshotList message. Also converts values to other types if specified. + * @param message SnapshotList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SnapshotList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SnapshotList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SslCertificateManagedSslCertificate. */ + interface ISslCertificateManagedSslCertificate { + + /** SslCertificateManagedSslCertificate domainStatus */ + domainStatus?: ({ [k: string]: string }|null); + + /** SslCertificateManagedSslCertificate domains */ + domains?: (string[]|null); + + /** SslCertificateManagedSslCertificate status */ + status?: (google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status|keyof typeof google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status|null); + } + + /** Represents a SslCertificateManagedSslCertificate. */ + class SslCertificateManagedSslCertificate implements ISslCertificateManagedSslCertificate { + + /** + * Constructs a new SslCertificateManagedSslCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslCertificateManagedSslCertificate); + + /** SslCertificateManagedSslCertificate domainStatus. */ + public domainStatus: { [k: string]: string }; + + /** SslCertificateManagedSslCertificate domains. */ + public domains: string[]; + + /** SslCertificateManagedSslCertificate status. */ + public status?: (google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status|keyof typeof google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status|null); + + /** SslCertificateManagedSslCertificate _status. */ + public _status?: "status"; + + /** + * Creates a new SslCertificateManagedSslCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns SslCertificateManagedSslCertificate instance + */ + public static create(properties?: google.cloud.compute.v1.ISslCertificateManagedSslCertificate): google.cloud.compute.v1.SslCertificateManagedSslCertificate; + + /** + * Encodes the specified SslCertificateManagedSslCertificate message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateManagedSslCertificate.verify|verify} messages. + * @param message SslCertificateManagedSslCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslCertificateManagedSslCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslCertificateManagedSslCertificate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateManagedSslCertificate.verify|verify} messages. + * @param message SslCertificateManagedSslCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslCertificateManagedSslCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslCertificateManagedSslCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslCertificateManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslCertificateManagedSslCertificate; + + /** + * Decodes a SslCertificateManagedSslCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslCertificateManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslCertificateManagedSslCertificate; + + /** + * Verifies a SslCertificateManagedSslCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslCertificateManagedSslCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslCertificateManagedSslCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslCertificateManagedSslCertificate; + + /** + * Creates a plain object from a SslCertificateManagedSslCertificate message. Also converts values to other types if specified. + * @param message SslCertificateManagedSslCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslCertificateManagedSslCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslCertificateManagedSslCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SslCertificateManagedSslCertificate { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + ACTIVE = 314733318, + MANAGED_CERTIFICATE_STATUS_UNSPECIFIED = 474800850, + PROVISIONING = 290896621, + PROVISIONING_FAILED = 76813775, + PROVISIONING_FAILED_PERMANENTLY = 275036203, + RENEWAL_FAILED = 434659076 + } + } + + /** Properties of a SslCertificateSelfManagedSslCertificate. */ + interface ISslCertificateSelfManagedSslCertificate { + + /** SslCertificateSelfManagedSslCertificate certificate */ + certificate?: (string|null); + + /** SslCertificateSelfManagedSslCertificate privateKey */ + privateKey?: (string|null); + } + + /** Represents a SslCertificateSelfManagedSslCertificate. */ + class SslCertificateSelfManagedSslCertificate implements ISslCertificateSelfManagedSslCertificate { + + /** + * Constructs a new SslCertificateSelfManagedSslCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate); + + /** SslCertificateSelfManagedSslCertificate certificate. */ + public certificate?: (string|null); + + /** SslCertificateSelfManagedSslCertificate privateKey. */ + public privateKey?: (string|null); + + /** SslCertificateSelfManagedSslCertificate _certificate. */ + public _certificate?: "certificate"; + + /** SslCertificateSelfManagedSslCertificate _privateKey. */ + public _privateKey?: "privateKey"; + + /** + * Creates a new SslCertificateSelfManagedSslCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns SslCertificateSelfManagedSslCertificate instance + */ + public static create(properties?: google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate): google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate; + + /** + * Encodes the specified SslCertificateSelfManagedSslCertificate message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.verify|verify} messages. + * @param message SslCertificateSelfManagedSslCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslCertificateSelfManagedSslCertificate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.verify|verify} messages. + * @param message SslCertificateSelfManagedSslCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslCertificateSelfManagedSslCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslCertificateSelfManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate; + + /** + * Decodes a SslCertificateSelfManagedSslCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslCertificateSelfManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate; + + /** + * Verifies a SslCertificateSelfManagedSslCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslCertificateSelfManagedSslCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslCertificateSelfManagedSslCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate; + + /** + * Creates a plain object from a SslCertificateSelfManagedSslCertificate message. Also converts values to other types if specified. + * @param message SslCertificateSelfManagedSslCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslCertificateSelfManagedSslCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SslCertificate. */ + interface ISslCertificate { + + /** SslCertificate certificate */ + certificate?: (string|null); + + /** SslCertificate creationTimestamp */ + creationTimestamp?: (string|null); + + /** SslCertificate description */ + description?: (string|null); + + /** SslCertificate expireTime */ + expireTime?: (string|null); + + /** SslCertificate id */ + id?: (number|Long|string|null); + + /** SslCertificate kind */ + kind?: (string|null); + + /** SslCertificate managed */ + managed?: (google.cloud.compute.v1.ISslCertificateManagedSslCertificate|null); + + /** SslCertificate name */ + name?: (string|null); + + /** SslCertificate privateKey */ + privateKey?: (string|null); + + /** SslCertificate region */ + region?: (string|null); + + /** SslCertificate selfLink */ + selfLink?: (string|null); + + /** SslCertificate selfManaged */ + selfManaged?: (google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate|null); + + /** SslCertificate subjectAlternativeNames */ + subjectAlternativeNames?: (string[]|null); + + /** SslCertificate type */ + type?: (google.cloud.compute.v1.SslCertificate.Type|keyof typeof google.cloud.compute.v1.SslCertificate.Type|null); + } + + /** Represents a SslCertificate. */ + class SslCertificate implements ISslCertificate { + + /** + * Constructs a new SslCertificate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslCertificate); + + /** SslCertificate certificate. */ + public certificate?: (string|null); + + /** SslCertificate creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** SslCertificate description. */ + public description?: (string|null); + + /** SslCertificate expireTime. */ + public expireTime?: (string|null); + + /** SslCertificate id. */ + public id?: (number|Long|string|null); + + /** SslCertificate kind. */ + public kind?: (string|null); + + /** SslCertificate managed. */ + public managed?: (google.cloud.compute.v1.ISslCertificateManagedSslCertificate|null); + + /** SslCertificate name. */ + public name?: (string|null); + + /** SslCertificate privateKey. */ + public privateKey?: (string|null); + + /** SslCertificate region. */ + public region?: (string|null); + + /** SslCertificate selfLink. */ + public selfLink?: (string|null); + + /** SslCertificate selfManaged. */ + public selfManaged?: (google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate|null); + + /** SslCertificate subjectAlternativeNames. */ + public subjectAlternativeNames: string[]; + + /** SslCertificate type. */ + public type?: (google.cloud.compute.v1.SslCertificate.Type|keyof typeof google.cloud.compute.v1.SslCertificate.Type|null); + + /** SslCertificate _certificate. */ + public _certificate?: "certificate"; + + /** SslCertificate _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** SslCertificate _description. */ + public _description?: "description"; + + /** SslCertificate _expireTime. */ + public _expireTime?: "expireTime"; + + /** SslCertificate _id. */ + public _id?: "id"; + + /** SslCertificate _kind. */ + public _kind?: "kind"; + + /** SslCertificate _managed. */ + public _managed?: "managed"; + + /** SslCertificate _name. */ + public _name?: "name"; + + /** SslCertificate _privateKey. */ + public _privateKey?: "privateKey"; + + /** SslCertificate _region. */ + public _region?: "region"; + + /** SslCertificate _selfLink. */ + public _selfLink?: "selfLink"; + + /** SslCertificate _selfManaged. */ + public _selfManaged?: "selfManaged"; + + /** SslCertificate _type. */ + public _type?: "type"; + + /** + * Creates a new SslCertificate instance using the specified properties. + * @param [properties] Properties to set + * @returns SslCertificate instance + */ + public static create(properties?: google.cloud.compute.v1.ISslCertificate): google.cloud.compute.v1.SslCertificate; + + /** + * Encodes the specified SslCertificate message. Does not implicitly {@link google.cloud.compute.v1.SslCertificate.verify|verify} messages. + * @param message SslCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslCertificate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificate.verify|verify} messages. + * @param message SslCertificate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslCertificate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslCertificate; + + /** + * Decodes a SslCertificate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslCertificate; + + /** + * Verifies a SslCertificate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslCertificate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslCertificate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslCertificate; + + /** + * Creates a plain object from a SslCertificate message. Also converts values to other types if specified. + * @param message SslCertificate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslCertificate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SslCertificate { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + MANAGED = 479501183, + SELF_MANAGED = 434437516, + TYPE_UNSPECIFIED = 437714322 + } + } + + /** Properties of a SslCertificatesScopedList. */ + interface ISslCertificatesScopedList { + + /** SslCertificatesScopedList sslCertificates */ + sslCertificates?: (google.cloud.compute.v1.ISslCertificate[]|null); + + /** SslCertificatesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SslCertificatesScopedList. */ + class SslCertificatesScopedList implements ISslCertificatesScopedList { + + /** + * Constructs a new SslCertificatesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslCertificatesScopedList); + + /** SslCertificatesScopedList sslCertificates. */ + public sslCertificates: google.cloud.compute.v1.ISslCertificate[]; + + /** SslCertificatesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SslCertificatesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SslCertificatesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns SslCertificatesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ISslCertificatesScopedList): google.cloud.compute.v1.SslCertificatesScopedList; + + /** + * Encodes the specified SslCertificatesScopedList message. Does not implicitly {@link google.cloud.compute.v1.SslCertificatesScopedList.verify|verify} messages. + * @param message SslCertificatesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslCertificatesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslCertificatesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificatesScopedList.verify|verify} messages. + * @param message SslCertificatesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslCertificatesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslCertificatesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslCertificatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslCertificatesScopedList; + + /** + * Decodes a SslCertificatesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslCertificatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslCertificatesScopedList; + + /** + * Verifies a SslCertificatesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslCertificatesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslCertificatesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslCertificatesScopedList; + + /** + * Creates a plain object from a SslCertificatesScopedList message. Also converts values to other types if specified. + * @param message SslCertificatesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslCertificatesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslCertificatesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SslCertificateAggregatedList. */ + interface ISslCertificateAggregatedList { + + /** SslCertificateAggregatedList id */ + id?: (string|null); + + /** SslCertificateAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ISslCertificatesScopedList }|null); + + /** SslCertificateAggregatedList kind */ + kind?: (string|null); + + /** SslCertificateAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** SslCertificateAggregatedList selfLink */ + selfLink?: (string|null); + + /** SslCertificateAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** SslCertificateAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SslCertificateAggregatedList. */ + class SslCertificateAggregatedList implements ISslCertificateAggregatedList { + + /** + * Constructs a new SslCertificateAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslCertificateAggregatedList); + + /** SslCertificateAggregatedList id. */ + public id?: (string|null); + + /** SslCertificateAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ISslCertificatesScopedList }; + + /** SslCertificateAggregatedList kind. */ + public kind?: (string|null); + + /** SslCertificateAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** SslCertificateAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** SslCertificateAggregatedList unreachables. */ + public unreachables: string[]; + + /** SslCertificateAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SslCertificateAggregatedList _id. */ + public _id?: "id"; + + /** SslCertificateAggregatedList _kind. */ + public _kind?: "kind"; + + /** SslCertificateAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** SslCertificateAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** SslCertificateAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SslCertificateAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns SslCertificateAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ISslCertificateAggregatedList): google.cloud.compute.v1.SslCertificateAggregatedList; + + /** + * Encodes the specified SslCertificateAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateAggregatedList.verify|verify} messages. + * @param message SslCertificateAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslCertificateAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslCertificateAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateAggregatedList.verify|verify} messages. + * @param message SslCertificateAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslCertificateAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslCertificateAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslCertificateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslCertificateAggregatedList; + + /** + * Decodes a SslCertificateAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslCertificateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslCertificateAggregatedList; + + /** + * Verifies a SslCertificateAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslCertificateAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslCertificateAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslCertificateAggregatedList; + + /** + * Creates a plain object from a SslCertificateAggregatedList message. Also converts values to other types if specified. + * @param message SslCertificateAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslCertificateAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslCertificateAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SslCertificateList. */ + interface ISslCertificateList { + + /** SslCertificateList id */ + id?: (string|null); + + /** SslCertificateList items */ + items?: (google.cloud.compute.v1.ISslCertificate[]|null); + + /** SslCertificateList kind */ + kind?: (string|null); + + /** SslCertificateList nextPageToken */ + nextPageToken?: (string|null); + + /** SslCertificateList selfLink */ + selfLink?: (string|null); + + /** SslCertificateList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SslCertificateList. */ + class SslCertificateList implements ISslCertificateList { + + /** + * Constructs a new SslCertificateList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslCertificateList); + + /** SslCertificateList id. */ + public id?: (string|null); + + /** SslCertificateList items. */ + public items: google.cloud.compute.v1.ISslCertificate[]; + + /** SslCertificateList kind. */ + public kind?: (string|null); + + /** SslCertificateList nextPageToken. */ + public nextPageToken?: (string|null); + + /** SslCertificateList selfLink. */ + public selfLink?: (string|null); + + /** SslCertificateList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SslCertificateList _id. */ + public _id?: "id"; + + /** SslCertificateList _kind. */ + public _kind?: "kind"; + + /** SslCertificateList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** SslCertificateList _selfLink. */ + public _selfLink?: "selfLink"; + + /** SslCertificateList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SslCertificateList instance using the specified properties. + * @param [properties] Properties to set + * @returns SslCertificateList instance + */ + public static create(properties?: google.cloud.compute.v1.ISslCertificateList): google.cloud.compute.v1.SslCertificateList; + + /** + * Encodes the specified SslCertificateList message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateList.verify|verify} messages. + * @param message SslCertificateList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslCertificateList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslCertificateList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateList.verify|verify} messages. + * @param message SslCertificateList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslCertificateList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslCertificateList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslCertificateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslCertificateList; + + /** + * Decodes a SslCertificateList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslCertificateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslCertificateList; + + /** + * Verifies a SslCertificateList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslCertificateList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslCertificateList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslCertificateList; + + /** + * Creates a plain object from a SslCertificateList message. Also converts values to other types if specified. + * @param message SslCertificateList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslCertificateList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslCertificateList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SslPolicy. */ + interface ISslPolicy { + + /** SslPolicy creationTimestamp */ + creationTimestamp?: (string|null); + + /** SslPolicy customFeatures */ + customFeatures?: (string[]|null); + + /** SslPolicy description */ + description?: (string|null); + + /** SslPolicy enabledFeatures */ + enabledFeatures?: (string[]|null); + + /** SslPolicy fingerprint */ + fingerprint?: (string|null); + + /** SslPolicy id */ + id?: (number|Long|string|null); + + /** SslPolicy kind */ + kind?: (string|null); + + /** SslPolicy minTlsVersion */ + minTlsVersion?: (google.cloud.compute.v1.SslPolicy.MinTlsVersion|keyof typeof google.cloud.compute.v1.SslPolicy.MinTlsVersion|null); + + /** SslPolicy name */ + name?: (string|null); + + /** SslPolicy profile */ + profile?: (google.cloud.compute.v1.SslPolicy.Profile|keyof typeof google.cloud.compute.v1.SslPolicy.Profile|null); + + /** SslPolicy selfLink */ + selfLink?: (string|null); + + /** SslPolicy warnings */ + warnings?: (google.cloud.compute.v1.IWarnings[]|null); + } + + /** Represents a SslPolicy. */ + class SslPolicy implements ISslPolicy { + + /** + * Constructs a new SslPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslPolicy); + + /** SslPolicy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** SslPolicy customFeatures. */ + public customFeatures: string[]; + + /** SslPolicy description. */ + public description?: (string|null); + + /** SslPolicy enabledFeatures. */ + public enabledFeatures: string[]; + + /** SslPolicy fingerprint. */ + public fingerprint?: (string|null); + + /** SslPolicy id. */ + public id?: (number|Long|string|null); + + /** SslPolicy kind. */ + public kind?: (string|null); + + /** SslPolicy minTlsVersion. */ + public minTlsVersion?: (google.cloud.compute.v1.SslPolicy.MinTlsVersion|keyof typeof google.cloud.compute.v1.SslPolicy.MinTlsVersion|null); + + /** SslPolicy name. */ + public name?: (string|null); + + /** SslPolicy profile. */ + public profile?: (google.cloud.compute.v1.SslPolicy.Profile|keyof typeof google.cloud.compute.v1.SslPolicy.Profile|null); + + /** SslPolicy selfLink. */ + public selfLink?: (string|null); + + /** SslPolicy warnings. */ + public warnings: google.cloud.compute.v1.IWarnings[]; + + /** SslPolicy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** SslPolicy _description. */ + public _description?: "description"; + + /** SslPolicy _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** SslPolicy _id. */ + public _id?: "id"; + + /** SslPolicy _kind. */ + public _kind?: "kind"; + + /** SslPolicy _minTlsVersion. */ + public _minTlsVersion?: "minTlsVersion"; + + /** SslPolicy _name. */ + public _name?: "name"; + + /** SslPolicy _profile. */ + public _profile?: "profile"; + + /** SslPolicy _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new SslPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns SslPolicy instance + */ + public static create(properties?: google.cloud.compute.v1.ISslPolicy): google.cloud.compute.v1.SslPolicy; + + /** + * Encodes the specified SslPolicy message. Does not implicitly {@link google.cloud.compute.v1.SslPolicy.verify|verify} messages. + * @param message SslPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPolicy.verify|verify} messages. + * @param message SslPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslPolicy; + + /** + * Decodes a SslPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslPolicy; + + /** + * Verifies a SslPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslPolicy; + + /** + * Creates a plain object from a SslPolicy message. Also converts values to other types if specified. + * @param message SslPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SslPolicy { + + /** MinTlsVersion enum. */ + enum MinTlsVersion { + UNDEFINED_MIN_TLS_VERSION = 0, + TLS_1_0 = 33116734, + TLS_1_1 = 33116735, + TLS_1_2 = 33116736 + } + + /** Profile enum. */ + enum Profile { + UNDEFINED_PROFILE = 0, + COMPATIBLE = 179357396, + CUSTOM = 388595569, + MODERN = 132013855, + RESTRICTED = 261551195 + } + } + + /** Properties of a SslPoliciesList. */ + interface ISslPoliciesList { + + /** SslPoliciesList id */ + id?: (string|null); + + /** SslPoliciesList items */ + items?: (google.cloud.compute.v1.ISslPolicy[]|null); + + /** SslPoliciesList kind */ + kind?: (string|null); + + /** SslPoliciesList nextPageToken */ + nextPageToken?: (string|null); + + /** SslPoliciesList selfLink */ + selfLink?: (string|null); + + /** SslPoliciesList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SslPoliciesList. */ + class SslPoliciesList implements ISslPoliciesList { + + /** + * Constructs a new SslPoliciesList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslPoliciesList); + + /** SslPoliciesList id. */ + public id?: (string|null); + + /** SslPoliciesList items. */ + public items: google.cloud.compute.v1.ISslPolicy[]; + + /** SslPoliciesList kind. */ + public kind?: (string|null); + + /** SslPoliciesList nextPageToken. */ + public nextPageToken?: (string|null); + + /** SslPoliciesList selfLink. */ + public selfLink?: (string|null); + + /** SslPoliciesList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SslPoliciesList _id. */ + public _id?: "id"; + + /** SslPoliciesList _kind. */ + public _kind?: "kind"; + + /** SslPoliciesList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** SslPoliciesList _selfLink. */ + public _selfLink?: "selfLink"; + + /** SslPoliciesList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SslPoliciesList instance using the specified properties. + * @param [properties] Properties to set + * @returns SslPoliciesList instance + */ + public static create(properties?: google.cloud.compute.v1.ISslPoliciesList): google.cloud.compute.v1.SslPoliciesList; + + /** + * Encodes the specified SslPoliciesList message. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesList.verify|verify} messages. + * @param message SslPoliciesList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslPoliciesList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslPoliciesList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesList.verify|verify} messages. + * @param message SslPoliciesList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslPoliciesList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslPoliciesList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslPoliciesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslPoliciesList; + + /** + * Decodes a SslPoliciesList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslPoliciesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslPoliciesList; + + /** + * Verifies a SslPoliciesList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslPoliciesList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslPoliciesList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslPoliciesList; + + /** + * Creates a plain object from a SslPoliciesList message. Also converts values to other types if specified. + * @param message SslPoliciesList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslPoliciesList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslPoliciesList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SslPoliciesListAvailableFeaturesResponse. */ + interface ISslPoliciesListAvailableFeaturesResponse { + + /** SslPoliciesListAvailableFeaturesResponse features */ + features?: (string[]|null); + } + + /** Represents a SslPoliciesListAvailableFeaturesResponse. */ + class SslPoliciesListAvailableFeaturesResponse implements ISslPoliciesListAvailableFeaturesResponse { + + /** + * Constructs a new SslPoliciesListAvailableFeaturesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse); + + /** SslPoliciesListAvailableFeaturesResponse features. */ + public features: string[]; + + /** + * Creates a new SslPoliciesListAvailableFeaturesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SslPoliciesListAvailableFeaturesResponse instance + */ + public static create(properties?: google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse): google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse; + + /** + * Encodes the specified SslPoliciesListAvailableFeaturesResponse message. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse.verify|verify} messages. + * @param message SslPoliciesListAvailableFeaturesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslPoliciesListAvailableFeaturesResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse.verify|verify} messages. + * @param message SslPoliciesListAvailableFeaturesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslPoliciesListAvailableFeaturesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslPoliciesListAvailableFeaturesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse; + + /** + * Decodes a SslPoliciesListAvailableFeaturesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslPoliciesListAvailableFeaturesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse; + + /** + * Verifies a SslPoliciesListAvailableFeaturesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslPoliciesListAvailableFeaturesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslPoliciesListAvailableFeaturesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse; + + /** + * Creates a plain object from a SslPoliciesListAvailableFeaturesResponse message. Also converts values to other types if specified. + * @param message SslPoliciesListAvailableFeaturesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslPoliciesListAvailableFeaturesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SslPolicyReference. */ + interface ISslPolicyReference { + + /** SslPolicyReference sslPolicy */ + sslPolicy?: (string|null); + } + + /** Represents a SslPolicyReference. */ + class SslPolicyReference implements ISslPolicyReference { + + /** + * Constructs a new SslPolicyReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISslPolicyReference); + + /** SslPolicyReference sslPolicy. */ + public sslPolicy?: (string|null); + + /** SslPolicyReference _sslPolicy. */ + public _sslPolicy?: "sslPolicy"; + + /** + * Creates a new SslPolicyReference instance using the specified properties. + * @param [properties] Properties to set + * @returns SslPolicyReference instance + */ + public static create(properties?: google.cloud.compute.v1.ISslPolicyReference): google.cloud.compute.v1.SslPolicyReference; + + /** + * Encodes the specified SslPolicyReference message. Does not implicitly {@link google.cloud.compute.v1.SslPolicyReference.verify|verify} messages. + * @param message SslPolicyReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISslPolicyReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SslPolicyReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPolicyReference.verify|verify} messages. + * @param message SslPolicyReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISslPolicyReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SslPolicyReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SslPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SslPolicyReference; + + /** + * Decodes a SslPolicyReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SslPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SslPolicyReference; + + /** + * Verifies a SslPolicyReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SslPolicyReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SslPolicyReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SslPolicyReference; + + /** + * Creates a plain object from a SslPolicyReference message. Also converts values to other types if specified. + * @param message SslPolicyReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SslPolicyReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SslPolicyReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StatefulPolicyPreservedState. */ + interface IStatefulPolicyPreservedState { + + /** StatefulPolicyPreservedState disks */ + disks?: ({ [k: string]: google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice }|null); + } + + /** Represents a StatefulPolicyPreservedState. */ + class StatefulPolicyPreservedState implements IStatefulPolicyPreservedState { + + /** + * Constructs a new StatefulPolicyPreservedState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IStatefulPolicyPreservedState); + + /** StatefulPolicyPreservedState disks. */ + public disks: { [k: string]: google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice }; + + /** + * Creates a new StatefulPolicyPreservedState instance using the specified properties. + * @param [properties] Properties to set + * @returns StatefulPolicyPreservedState instance + */ + public static create(properties?: google.cloud.compute.v1.IStatefulPolicyPreservedState): google.cloud.compute.v1.StatefulPolicyPreservedState; + + /** + * Encodes the specified StatefulPolicyPreservedState message. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedState.verify|verify} messages. + * @param message StatefulPolicyPreservedState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IStatefulPolicyPreservedState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatefulPolicyPreservedState message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedState.verify|verify} messages. + * @param message StatefulPolicyPreservedState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IStatefulPolicyPreservedState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatefulPolicyPreservedState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatefulPolicyPreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.StatefulPolicyPreservedState; + + /** + * Decodes a StatefulPolicyPreservedState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatefulPolicyPreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.StatefulPolicyPreservedState; + + /** + * Verifies a StatefulPolicyPreservedState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatefulPolicyPreservedState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatefulPolicyPreservedState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.StatefulPolicyPreservedState; + + /** + * Creates a plain object from a StatefulPolicyPreservedState message. Also converts values to other types if specified. + * @param message StatefulPolicyPreservedState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.StatefulPolicyPreservedState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatefulPolicyPreservedState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StatefulPolicyPreservedStateDiskDevice. */ + interface IStatefulPolicyPreservedStateDiskDevice { + + /** StatefulPolicyPreservedStateDiskDevice autoDelete */ + autoDelete?: (google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete|keyof typeof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete|null); + } + + /** Represents a StatefulPolicyPreservedStateDiskDevice. */ + class StatefulPolicyPreservedStateDiskDevice implements IStatefulPolicyPreservedStateDiskDevice { + + /** + * Constructs a new StatefulPolicyPreservedStateDiskDevice. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice); + + /** StatefulPolicyPreservedStateDiskDevice autoDelete. */ + public autoDelete?: (google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete|keyof typeof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete|null); + + /** StatefulPolicyPreservedStateDiskDevice _autoDelete. */ + public _autoDelete?: "autoDelete"; + + /** + * Creates a new StatefulPolicyPreservedStateDiskDevice instance using the specified properties. + * @param [properties] Properties to set + * @returns StatefulPolicyPreservedStateDiskDevice instance + */ + public static create(properties?: google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice): google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice; + + /** + * Encodes the specified StatefulPolicyPreservedStateDiskDevice message. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.verify|verify} messages. + * @param message StatefulPolicyPreservedStateDiskDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StatefulPolicyPreservedStateDiskDevice message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.verify|verify} messages. + * @param message StatefulPolicyPreservedStateDiskDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StatefulPolicyPreservedStateDiskDevice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StatefulPolicyPreservedStateDiskDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice; + + /** + * Decodes a StatefulPolicyPreservedStateDiskDevice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StatefulPolicyPreservedStateDiskDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice; + + /** + * Verifies a StatefulPolicyPreservedStateDiskDevice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StatefulPolicyPreservedStateDiskDevice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StatefulPolicyPreservedStateDiskDevice + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice; + + /** + * Creates a plain object from a StatefulPolicyPreservedStateDiskDevice message. Also converts values to other types if specified. + * @param message StatefulPolicyPreservedStateDiskDevice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StatefulPolicyPreservedStateDiskDevice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace StatefulPolicyPreservedStateDiskDevice { + + /** AutoDelete enum. */ + enum AutoDelete { + UNDEFINED_AUTO_DELETE = 0, + NEVER = 74175084, + ON_PERMANENT_INSTANCE_DELETION = 95727719 + } + } + + /** Properties of a SubnetworkLogConfig. */ + interface ISubnetworkLogConfig { + + /** SubnetworkLogConfig aggregationInterval */ + aggregationInterval?: (google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval|keyof typeof google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval|null); + + /** SubnetworkLogConfig enable */ + enable?: (boolean|null); + + /** SubnetworkLogConfig filterExpr */ + filterExpr?: (string|null); + + /** SubnetworkLogConfig flowSampling */ + flowSampling?: (number|null); + + /** SubnetworkLogConfig metadata */ + metadata?: (google.cloud.compute.v1.SubnetworkLogConfig.Metadata|keyof typeof google.cloud.compute.v1.SubnetworkLogConfig.Metadata|null); + + /** SubnetworkLogConfig metadataFields */ + metadataFields?: (string[]|null); + } + + /** Represents a SubnetworkLogConfig. */ + class SubnetworkLogConfig implements ISubnetworkLogConfig { + + /** + * Constructs a new SubnetworkLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetworkLogConfig); + + /** SubnetworkLogConfig aggregationInterval. */ + public aggregationInterval?: (google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval|keyof typeof google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval|null); + + /** SubnetworkLogConfig enable. */ + public enable?: (boolean|null); + + /** SubnetworkLogConfig filterExpr. */ + public filterExpr?: (string|null); + + /** SubnetworkLogConfig flowSampling. */ + public flowSampling?: (number|null); + + /** SubnetworkLogConfig metadata. */ + public metadata?: (google.cloud.compute.v1.SubnetworkLogConfig.Metadata|keyof typeof google.cloud.compute.v1.SubnetworkLogConfig.Metadata|null); + + /** SubnetworkLogConfig metadataFields. */ + public metadataFields: string[]; + + /** SubnetworkLogConfig _aggregationInterval. */ + public _aggregationInterval?: "aggregationInterval"; + + /** SubnetworkLogConfig _enable. */ + public _enable?: "enable"; + + /** SubnetworkLogConfig _filterExpr. */ + public _filterExpr?: "filterExpr"; + + /** SubnetworkLogConfig _flowSampling. */ + public _flowSampling?: "flowSampling"; + + /** SubnetworkLogConfig _metadata. */ + public _metadata?: "metadata"; + + /** + * Creates a new SubnetworkLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SubnetworkLogConfig instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetworkLogConfig): google.cloud.compute.v1.SubnetworkLogConfig; + + /** + * Encodes the specified SubnetworkLogConfig message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkLogConfig.verify|verify} messages. + * @param message SubnetworkLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetworkLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubnetworkLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkLogConfig.verify|verify} messages. + * @param message SubnetworkLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetworkLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubnetworkLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubnetworkLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SubnetworkLogConfig; + + /** + * Decodes a SubnetworkLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubnetworkLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SubnetworkLogConfig; + + /** + * Verifies a SubnetworkLogConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubnetworkLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubnetworkLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SubnetworkLogConfig; + + /** + * Creates a plain object from a SubnetworkLogConfig message. Also converts values to other types if specified. + * @param message SubnetworkLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SubnetworkLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubnetworkLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SubnetworkLogConfig { + + /** AggregationInterval enum. */ + enum AggregationInterval { + UNDEFINED_AGGREGATION_INTERVAL = 0, + INTERVAL_10_MIN = 487155916, + INTERVAL_15_MIN = 491773521, + INTERVAL_1_MIN = 69052714, + INTERVAL_30_SEC = 7548937, + INTERVAL_5_MIN = 72746798, + INTERVAL_5_SEC = 72752429 + } + + /** Metadata enum. */ + enum Metadata { + UNDEFINED_METADATA = 0, + CUSTOM_METADATA = 62450749, + EXCLUDE_ALL_METADATA = 334519954, + INCLUDE_ALL_METADATA = 164619908 + } + } + + /** Properties of a SubnetworkSecondaryRange. */ + interface ISubnetworkSecondaryRange { + + /** SubnetworkSecondaryRange ipCidrRange */ + ipCidrRange?: (string|null); + + /** SubnetworkSecondaryRange rangeName */ + rangeName?: (string|null); + } + + /** Represents a SubnetworkSecondaryRange. */ + class SubnetworkSecondaryRange implements ISubnetworkSecondaryRange { + + /** + * Constructs a new SubnetworkSecondaryRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetworkSecondaryRange); + + /** SubnetworkSecondaryRange ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** SubnetworkSecondaryRange rangeName. */ + public rangeName?: (string|null); + + /** SubnetworkSecondaryRange _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** SubnetworkSecondaryRange _rangeName. */ + public _rangeName?: "rangeName"; + + /** + * Creates a new SubnetworkSecondaryRange instance using the specified properties. + * @param [properties] Properties to set + * @returns SubnetworkSecondaryRange instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetworkSecondaryRange): google.cloud.compute.v1.SubnetworkSecondaryRange; + + /** + * Encodes the specified SubnetworkSecondaryRange message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkSecondaryRange.verify|verify} messages. + * @param message SubnetworkSecondaryRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetworkSecondaryRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubnetworkSecondaryRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkSecondaryRange.verify|verify} messages. + * @param message SubnetworkSecondaryRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetworkSecondaryRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubnetworkSecondaryRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SubnetworkSecondaryRange; + + /** + * Decodes a SubnetworkSecondaryRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SubnetworkSecondaryRange; + + /** + * Verifies a SubnetworkSecondaryRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubnetworkSecondaryRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubnetworkSecondaryRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SubnetworkSecondaryRange; + + /** + * Creates a plain object from a SubnetworkSecondaryRange message. Also converts values to other types if specified. + * @param message SubnetworkSecondaryRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SubnetworkSecondaryRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubnetworkSecondaryRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Subnetwork. */ + interface ISubnetwork { + + /** Subnetwork creationTimestamp */ + creationTimestamp?: (string|null); + + /** Subnetwork description */ + description?: (string|null); + + /** Subnetwork enableFlowLogs */ + enableFlowLogs?: (boolean|null); + + /** Subnetwork fingerprint */ + fingerprint?: (string|null); + + /** Subnetwork gatewayAddress */ + gatewayAddress?: (string|null); + + /** Subnetwork id */ + id?: (number|Long|string|null); + + /** Subnetwork ipCidrRange */ + ipCidrRange?: (string|null); + + /** Subnetwork ipv6CidrRange */ + ipv6CidrRange?: (string|null); + + /** Subnetwork kind */ + kind?: (string|null); + + /** Subnetwork logConfig */ + logConfig?: (google.cloud.compute.v1.ISubnetworkLogConfig|null); + + /** Subnetwork name */ + name?: (string|null); + + /** Subnetwork network */ + network?: (string|null); + + /** Subnetwork privateIpGoogleAccess */ + privateIpGoogleAccess?: (boolean|null); + + /** Subnetwork privateIpv6GoogleAccess */ + privateIpv6GoogleAccess?: (google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess|keyof typeof google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess|null); + + /** Subnetwork purpose */ + purpose?: (google.cloud.compute.v1.Subnetwork.Purpose|keyof typeof google.cloud.compute.v1.Subnetwork.Purpose|null); + + /** Subnetwork region */ + region?: (string|null); + + /** Subnetwork role */ + role?: (google.cloud.compute.v1.Subnetwork.Role|keyof typeof google.cloud.compute.v1.Subnetwork.Role|null); + + /** Subnetwork secondaryIpRanges */ + secondaryIpRanges?: (google.cloud.compute.v1.ISubnetworkSecondaryRange[]|null); + + /** Subnetwork selfLink */ + selfLink?: (string|null); + + /** Subnetwork state */ + state?: (google.cloud.compute.v1.Subnetwork.State|keyof typeof google.cloud.compute.v1.Subnetwork.State|null); + } + + /** Represents a Subnetwork. */ + class Subnetwork implements ISubnetwork { + + /** + * Constructs a new Subnetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetwork); + + /** Subnetwork creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Subnetwork description. */ + public description?: (string|null); + + /** Subnetwork enableFlowLogs. */ + public enableFlowLogs?: (boolean|null); + + /** Subnetwork fingerprint. */ + public fingerprint?: (string|null); + + /** Subnetwork gatewayAddress. */ + public gatewayAddress?: (string|null); + + /** Subnetwork id. */ + public id?: (number|Long|string|null); + + /** Subnetwork ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** Subnetwork ipv6CidrRange. */ + public ipv6CidrRange?: (string|null); + + /** Subnetwork kind. */ + public kind?: (string|null); + + /** Subnetwork logConfig. */ + public logConfig?: (google.cloud.compute.v1.ISubnetworkLogConfig|null); + + /** Subnetwork name. */ + public name?: (string|null); + + /** Subnetwork network. */ + public network?: (string|null); + + /** Subnetwork privateIpGoogleAccess. */ + public privateIpGoogleAccess?: (boolean|null); + + /** Subnetwork privateIpv6GoogleAccess. */ + public privateIpv6GoogleAccess?: (google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess|keyof typeof google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess|null); + + /** Subnetwork purpose. */ + public purpose?: (google.cloud.compute.v1.Subnetwork.Purpose|keyof typeof google.cloud.compute.v1.Subnetwork.Purpose|null); + + /** Subnetwork region. */ + public region?: (string|null); + + /** Subnetwork role. */ + public role?: (google.cloud.compute.v1.Subnetwork.Role|keyof typeof google.cloud.compute.v1.Subnetwork.Role|null); + + /** Subnetwork secondaryIpRanges. */ + public secondaryIpRanges: google.cloud.compute.v1.ISubnetworkSecondaryRange[]; + + /** Subnetwork selfLink. */ + public selfLink?: (string|null); + + /** Subnetwork state. */ + public state?: (google.cloud.compute.v1.Subnetwork.State|keyof typeof google.cloud.compute.v1.Subnetwork.State|null); + + /** Subnetwork _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Subnetwork _description. */ + public _description?: "description"; + + /** Subnetwork _enableFlowLogs. */ + public _enableFlowLogs?: "enableFlowLogs"; + + /** Subnetwork _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** Subnetwork _gatewayAddress. */ + public _gatewayAddress?: "gatewayAddress"; + + /** Subnetwork _id. */ + public _id?: "id"; + + /** Subnetwork _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** Subnetwork _ipv6CidrRange. */ + public _ipv6CidrRange?: "ipv6CidrRange"; + + /** Subnetwork _kind. */ + public _kind?: "kind"; + + /** Subnetwork _logConfig. */ + public _logConfig?: "logConfig"; + + /** Subnetwork _name. */ + public _name?: "name"; + + /** Subnetwork _network. */ + public _network?: "network"; + + /** Subnetwork _privateIpGoogleAccess. */ + public _privateIpGoogleAccess?: "privateIpGoogleAccess"; + + /** Subnetwork _privateIpv6GoogleAccess. */ + public _privateIpv6GoogleAccess?: "privateIpv6GoogleAccess"; + + /** Subnetwork _purpose. */ + public _purpose?: "purpose"; + + /** Subnetwork _region. */ + public _region?: "region"; + + /** Subnetwork _role. */ + public _role?: "role"; + + /** Subnetwork _selfLink. */ + public _selfLink?: "selfLink"; + + /** Subnetwork _state. */ + public _state?: "state"; + + /** + * Creates a new Subnetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns Subnetwork instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetwork): google.cloud.compute.v1.Subnetwork; + + /** + * Encodes the specified Subnetwork message. Does not implicitly {@link google.cloud.compute.v1.Subnetwork.verify|verify} messages. + * @param message Subnetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subnetwork message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Subnetwork.verify|verify} messages. + * @param message Subnetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subnetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.Subnetwork; + + /** + * Decodes a Subnetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.Subnetwork; + + /** + * Verifies a Subnetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Subnetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subnetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.Subnetwork; + + /** + * Creates a plain object from a Subnetwork message. Also converts values to other types if specified. + * @param message Subnetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.Subnetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subnetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Subnetwork { + + /** PrivateIpv6GoogleAccess enum. */ + enum PrivateIpv6GoogleAccess { + UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS = 0, + DISABLE_GOOGLE_ACCESS = 450958579, + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 427975994, + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 288210263 + } + + /** Purpose enum. */ + enum Purpose { + UNDEFINED_PURPOSE = 0, + INTERNAL_HTTPS_LOAD_BALANCER = 248748889, + PRIVATE = 403485027, + PRIVATE_RFC_1918 = 254902107 + } + + /** Role enum. */ + enum Role { + UNDEFINED_ROLE = 0, + ACTIVE = 314733318, + BACKUP = 341010882 + } + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + DRAINING = 480455402, + READY = 77848963 + } + } + + /** Properties of a SubnetworksScopedList. */ + interface ISubnetworksScopedList { + + /** SubnetworksScopedList subnetworks */ + subnetworks?: (google.cloud.compute.v1.ISubnetwork[]|null); + + /** SubnetworksScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SubnetworksScopedList. */ + class SubnetworksScopedList implements ISubnetworksScopedList { + + /** + * Constructs a new SubnetworksScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetworksScopedList); + + /** SubnetworksScopedList subnetworks. */ + public subnetworks: google.cloud.compute.v1.ISubnetwork[]; + + /** SubnetworksScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SubnetworksScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SubnetworksScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns SubnetworksScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetworksScopedList): google.cloud.compute.v1.SubnetworksScopedList; + + /** + * Encodes the specified SubnetworksScopedList message. Does not implicitly {@link google.cloud.compute.v1.SubnetworksScopedList.verify|verify} messages. + * @param message SubnetworksScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetworksScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubnetworksScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworksScopedList.verify|verify} messages. + * @param message SubnetworksScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetworksScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubnetworksScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubnetworksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SubnetworksScopedList; + + /** + * Decodes a SubnetworksScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubnetworksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SubnetworksScopedList; + + /** + * Verifies a SubnetworksScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubnetworksScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubnetworksScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SubnetworksScopedList; + + /** + * Creates a plain object from a SubnetworksScopedList message. Also converts values to other types if specified. + * @param message SubnetworksScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SubnetworksScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubnetworksScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SubnetworkAggregatedList. */ + interface ISubnetworkAggregatedList { + + /** SubnetworkAggregatedList id */ + id?: (string|null); + + /** SubnetworkAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ISubnetworksScopedList }|null); + + /** SubnetworkAggregatedList kind */ + kind?: (string|null); + + /** SubnetworkAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** SubnetworkAggregatedList selfLink */ + selfLink?: (string|null); + + /** SubnetworkAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** SubnetworkAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SubnetworkAggregatedList. */ + class SubnetworkAggregatedList implements ISubnetworkAggregatedList { + + /** + * Constructs a new SubnetworkAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetworkAggregatedList); + + /** SubnetworkAggregatedList id. */ + public id?: (string|null); + + /** SubnetworkAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ISubnetworksScopedList }; + + /** SubnetworkAggregatedList kind. */ + public kind?: (string|null); + + /** SubnetworkAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** SubnetworkAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** SubnetworkAggregatedList unreachables. */ + public unreachables: string[]; + + /** SubnetworkAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SubnetworkAggregatedList _id. */ + public _id?: "id"; + + /** SubnetworkAggregatedList _kind. */ + public _kind?: "kind"; + + /** SubnetworkAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** SubnetworkAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** SubnetworkAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SubnetworkAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns SubnetworkAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetworkAggregatedList): google.cloud.compute.v1.SubnetworkAggregatedList; + + /** + * Encodes the specified SubnetworkAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkAggregatedList.verify|verify} messages. + * @param message SubnetworkAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetworkAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubnetworkAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkAggregatedList.verify|verify} messages. + * @param message SubnetworkAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetworkAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubnetworkAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubnetworkAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SubnetworkAggregatedList; + + /** + * Decodes a SubnetworkAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubnetworkAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SubnetworkAggregatedList; + + /** + * Verifies a SubnetworkAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubnetworkAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubnetworkAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SubnetworkAggregatedList; + + /** + * Creates a plain object from a SubnetworkAggregatedList message. Also converts values to other types if specified. + * @param message SubnetworkAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SubnetworkAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubnetworkAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SubnetworkList. */ + interface ISubnetworkList { + + /** SubnetworkList id */ + id?: (string|null); + + /** SubnetworkList items */ + items?: (google.cloud.compute.v1.ISubnetwork[]|null); + + /** SubnetworkList kind */ + kind?: (string|null); + + /** SubnetworkList nextPageToken */ + nextPageToken?: (string|null); + + /** SubnetworkList selfLink */ + selfLink?: (string|null); + + /** SubnetworkList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a SubnetworkList. */ + class SubnetworkList implements ISubnetworkList { + + /** + * Constructs a new SubnetworkList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetworkList); + + /** SubnetworkList id. */ + public id?: (string|null); + + /** SubnetworkList items. */ + public items: google.cloud.compute.v1.ISubnetwork[]; + + /** SubnetworkList kind. */ + public kind?: (string|null); + + /** SubnetworkList nextPageToken. */ + public nextPageToken?: (string|null); + + /** SubnetworkList selfLink. */ + public selfLink?: (string|null); + + /** SubnetworkList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** SubnetworkList _id. */ + public _id?: "id"; + + /** SubnetworkList _kind. */ + public _kind?: "kind"; + + /** SubnetworkList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** SubnetworkList _selfLink. */ + public _selfLink?: "selfLink"; + + /** SubnetworkList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new SubnetworkList instance using the specified properties. + * @param [properties] Properties to set + * @returns SubnetworkList instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetworkList): google.cloud.compute.v1.SubnetworkList; + + /** + * Encodes the specified SubnetworkList message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkList.verify|verify} messages. + * @param message SubnetworkList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetworkList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubnetworkList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkList.verify|verify} messages. + * @param message SubnetworkList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetworkList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubnetworkList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubnetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SubnetworkList; + + /** + * Decodes a SubnetworkList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubnetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SubnetworkList; + + /** + * Verifies a SubnetworkList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubnetworkList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubnetworkList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SubnetworkList; + + /** + * Creates a plain object from a SubnetworkList message. Also converts values to other types if specified. + * @param message SubnetworkList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SubnetworkList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubnetworkList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SubnetworksExpandIpCidrRangeRequest. */ + interface ISubnetworksExpandIpCidrRangeRequest { + + /** SubnetworksExpandIpCidrRangeRequest ipCidrRange */ + ipCidrRange?: (string|null); + } + + /** Represents a SubnetworksExpandIpCidrRangeRequest. */ + class SubnetworksExpandIpCidrRangeRequest implements ISubnetworksExpandIpCidrRangeRequest { + + /** + * Constructs a new SubnetworksExpandIpCidrRangeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest); + + /** SubnetworksExpandIpCidrRangeRequest ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** SubnetworksExpandIpCidrRangeRequest _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** + * Creates a new SubnetworksExpandIpCidrRangeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubnetworksExpandIpCidrRangeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest): google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; + + /** + * Encodes the specified SubnetworksExpandIpCidrRangeRequest message. Does not implicitly {@link google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.verify|verify} messages. + * @param message SubnetworksExpandIpCidrRangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubnetworksExpandIpCidrRangeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.verify|verify} messages. + * @param message SubnetworksExpandIpCidrRangeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubnetworksExpandIpCidrRangeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubnetworksExpandIpCidrRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; + + /** + * Decodes a SubnetworksExpandIpCidrRangeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubnetworksExpandIpCidrRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; + + /** + * Verifies a SubnetworksExpandIpCidrRangeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubnetworksExpandIpCidrRangeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubnetworksExpandIpCidrRangeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest; + + /** + * Creates a plain object from a SubnetworksExpandIpCidrRangeRequest message. Also converts values to other types if specified. + * @param message SubnetworksExpandIpCidrRangeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubnetworksExpandIpCidrRangeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SubnetworksSetPrivateIpGoogleAccessRequest. */ + interface ISubnetworksSetPrivateIpGoogleAccessRequest { + + /** SubnetworksSetPrivateIpGoogleAccessRequest privateIpGoogleAccess */ + privateIpGoogleAccess?: (boolean|null); + } + + /** Represents a SubnetworksSetPrivateIpGoogleAccessRequest. */ + class SubnetworksSetPrivateIpGoogleAccessRequest implements ISubnetworksSetPrivateIpGoogleAccessRequest { + + /** + * Constructs a new SubnetworksSetPrivateIpGoogleAccessRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest); + + /** SubnetworksSetPrivateIpGoogleAccessRequest privateIpGoogleAccess. */ + public privateIpGoogleAccess?: (boolean|null); + + /** SubnetworksSetPrivateIpGoogleAccessRequest _privateIpGoogleAccess. */ + public _privateIpGoogleAccess?: "privateIpGoogleAccess"; + + /** + * Creates a new SubnetworksSetPrivateIpGoogleAccessRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubnetworksSetPrivateIpGoogleAccessRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest): google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; + + /** + * Encodes the specified SubnetworksSetPrivateIpGoogleAccessRequest message. Does not implicitly {@link google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.verify|verify} messages. + * @param message SubnetworksSetPrivateIpGoogleAccessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubnetworksSetPrivateIpGoogleAccessRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.verify|verify} messages. + * @param message SubnetworksSetPrivateIpGoogleAccessRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubnetworksSetPrivateIpGoogleAccessRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubnetworksSetPrivateIpGoogleAccessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; + + /** + * Decodes a SubnetworksSetPrivateIpGoogleAccessRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubnetworksSetPrivateIpGoogleAccessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; + + /** + * Verifies a SubnetworksSetPrivateIpGoogleAccessRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubnetworksSetPrivateIpGoogleAccessRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubnetworksSetPrivateIpGoogleAccessRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest; + + /** + * Creates a plain object from a SubnetworksSetPrivateIpGoogleAccessRequest message. Also converts values to other types if specified. + * @param message SubnetworksSetPrivateIpGoogleAccessRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubnetworksSetPrivateIpGoogleAccessRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetGrpcProxy. */ + interface ITargetGrpcProxy { + + /** TargetGrpcProxy creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetGrpcProxy description */ + description?: (string|null); + + /** TargetGrpcProxy fingerprint */ + fingerprint?: (string|null); + + /** TargetGrpcProxy id */ + id?: (number|Long|string|null); + + /** TargetGrpcProxy kind */ + kind?: (string|null); + + /** TargetGrpcProxy name */ + name?: (string|null); + + /** TargetGrpcProxy selfLink */ + selfLink?: (string|null); + + /** TargetGrpcProxy selfLinkWithId */ + selfLinkWithId?: (string|null); + + /** TargetGrpcProxy urlMap */ + urlMap?: (string|null); + + /** TargetGrpcProxy validateForProxyless */ + validateForProxyless?: (boolean|null); + } + + /** Represents a TargetGrpcProxy. */ + class TargetGrpcProxy implements ITargetGrpcProxy { + + /** + * Constructs a new TargetGrpcProxy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetGrpcProxy); + + /** TargetGrpcProxy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetGrpcProxy description. */ + public description?: (string|null); + + /** TargetGrpcProxy fingerprint. */ + public fingerprint?: (string|null); + + /** TargetGrpcProxy id. */ + public id?: (number|Long|string|null); + + /** TargetGrpcProxy kind. */ + public kind?: (string|null); + + /** TargetGrpcProxy name. */ + public name?: (string|null); + + /** TargetGrpcProxy selfLink. */ + public selfLink?: (string|null); + + /** TargetGrpcProxy selfLinkWithId. */ + public selfLinkWithId?: (string|null); + + /** TargetGrpcProxy urlMap. */ + public urlMap?: (string|null); + + /** TargetGrpcProxy validateForProxyless. */ + public validateForProxyless?: (boolean|null); + + /** TargetGrpcProxy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetGrpcProxy _description. */ + public _description?: "description"; + + /** TargetGrpcProxy _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** TargetGrpcProxy _id. */ + public _id?: "id"; + + /** TargetGrpcProxy _kind. */ + public _kind?: "kind"; + + /** TargetGrpcProxy _name. */ + public _name?: "name"; + + /** TargetGrpcProxy _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetGrpcProxy _selfLinkWithId. */ + public _selfLinkWithId?: "selfLinkWithId"; + + /** TargetGrpcProxy _urlMap. */ + public _urlMap?: "urlMap"; + + /** TargetGrpcProxy _validateForProxyless. */ + public _validateForProxyless?: "validateForProxyless"; + + /** + * Creates a new TargetGrpcProxy instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetGrpcProxy instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetGrpcProxy): google.cloud.compute.v1.TargetGrpcProxy; + + /** + * Encodes the specified TargetGrpcProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxy.verify|verify} messages. + * @param message TargetGrpcProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetGrpcProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetGrpcProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxy.verify|verify} messages. + * @param message TargetGrpcProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetGrpcProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetGrpcProxy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetGrpcProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetGrpcProxy; + + /** + * Decodes a TargetGrpcProxy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetGrpcProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetGrpcProxy; + + /** + * Verifies a TargetGrpcProxy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetGrpcProxy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetGrpcProxy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetGrpcProxy; + + /** + * Creates a plain object from a TargetGrpcProxy message. Also converts values to other types if specified. + * @param message TargetGrpcProxy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetGrpcProxy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetGrpcProxy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetGrpcProxyList. */ + interface ITargetGrpcProxyList { + + /** TargetGrpcProxyList id */ + id?: (string|null); + + /** TargetGrpcProxyList items */ + items?: (google.cloud.compute.v1.ITargetGrpcProxy[]|null); + + /** TargetGrpcProxyList kind */ + kind?: (string|null); + + /** TargetGrpcProxyList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetGrpcProxyList selfLink */ + selfLink?: (string|null); + + /** TargetGrpcProxyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetGrpcProxyList. */ + class TargetGrpcProxyList implements ITargetGrpcProxyList { + + /** + * Constructs a new TargetGrpcProxyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetGrpcProxyList); + + /** TargetGrpcProxyList id. */ + public id?: (string|null); + + /** TargetGrpcProxyList items. */ + public items: google.cloud.compute.v1.ITargetGrpcProxy[]; + + /** TargetGrpcProxyList kind. */ + public kind?: (string|null); + + /** TargetGrpcProxyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetGrpcProxyList selfLink. */ + public selfLink?: (string|null); + + /** TargetGrpcProxyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetGrpcProxyList _id. */ + public _id?: "id"; + + /** TargetGrpcProxyList _kind. */ + public _kind?: "kind"; + + /** TargetGrpcProxyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetGrpcProxyList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetGrpcProxyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetGrpcProxyList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetGrpcProxyList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetGrpcProxyList): google.cloud.compute.v1.TargetGrpcProxyList; + + /** + * Encodes the specified TargetGrpcProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxyList.verify|verify} messages. + * @param message TargetGrpcProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetGrpcProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetGrpcProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxyList.verify|verify} messages. + * @param message TargetGrpcProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetGrpcProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetGrpcProxyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetGrpcProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetGrpcProxyList; + + /** + * Decodes a TargetGrpcProxyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetGrpcProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetGrpcProxyList; + + /** + * Verifies a TargetGrpcProxyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetGrpcProxyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetGrpcProxyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetGrpcProxyList; + + /** + * Creates a plain object from a TargetGrpcProxyList message. Also converts values to other types if specified. + * @param message TargetGrpcProxyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetGrpcProxyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetGrpcProxyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpProxy. */ + interface ITargetHttpProxy { + + /** TargetHttpProxy creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetHttpProxy description */ + description?: (string|null); + + /** TargetHttpProxy fingerprint */ + fingerprint?: (string|null); + + /** TargetHttpProxy id */ + id?: (number|Long|string|null); + + /** TargetHttpProxy kind */ + kind?: (string|null); + + /** TargetHttpProxy name */ + name?: (string|null); + + /** TargetHttpProxy proxyBind */ + proxyBind?: (boolean|null); + + /** TargetHttpProxy region */ + region?: (string|null); + + /** TargetHttpProxy selfLink */ + selfLink?: (string|null); + + /** TargetHttpProxy urlMap */ + urlMap?: (string|null); + } + + /** Represents a TargetHttpProxy. */ + class TargetHttpProxy implements ITargetHttpProxy { + + /** + * Constructs a new TargetHttpProxy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpProxy); + + /** TargetHttpProxy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetHttpProxy description. */ + public description?: (string|null); + + /** TargetHttpProxy fingerprint. */ + public fingerprint?: (string|null); + + /** TargetHttpProxy id. */ + public id?: (number|Long|string|null); + + /** TargetHttpProxy kind. */ + public kind?: (string|null); + + /** TargetHttpProxy name. */ + public name?: (string|null); + + /** TargetHttpProxy proxyBind. */ + public proxyBind?: (boolean|null); + + /** TargetHttpProxy region. */ + public region?: (string|null); + + /** TargetHttpProxy selfLink. */ + public selfLink?: (string|null); + + /** TargetHttpProxy urlMap. */ + public urlMap?: (string|null); + + /** TargetHttpProxy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetHttpProxy _description. */ + public _description?: "description"; + + /** TargetHttpProxy _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** TargetHttpProxy _id. */ + public _id?: "id"; + + /** TargetHttpProxy _kind. */ + public _kind?: "kind"; + + /** TargetHttpProxy _name. */ + public _name?: "name"; + + /** TargetHttpProxy _proxyBind. */ + public _proxyBind?: "proxyBind"; + + /** TargetHttpProxy _region. */ + public _region?: "region"; + + /** TargetHttpProxy _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetHttpProxy _urlMap. */ + public _urlMap?: "urlMap"; + + /** + * Creates a new TargetHttpProxy instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpProxy instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpProxy): google.cloud.compute.v1.TargetHttpProxy; + + /** + * Encodes the specified TargetHttpProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxy.verify|verify} messages. + * @param message TargetHttpProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxy.verify|verify} messages. + * @param message TargetHttpProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpProxy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpProxy; + + /** + * Decodes a TargetHttpProxy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpProxy; + + /** + * Verifies a TargetHttpProxy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpProxy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpProxy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpProxy; + + /** + * Creates a plain object from a TargetHttpProxy message. Also converts values to other types if specified. + * @param message TargetHttpProxy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpProxy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpProxy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpProxiesScopedList. */ + interface ITargetHttpProxiesScopedList { + + /** TargetHttpProxiesScopedList targetHttpProxies */ + targetHttpProxies?: (google.cloud.compute.v1.ITargetHttpProxy[]|null); + + /** TargetHttpProxiesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetHttpProxiesScopedList. */ + class TargetHttpProxiesScopedList implements ITargetHttpProxiesScopedList { + + /** + * Constructs a new TargetHttpProxiesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpProxiesScopedList); + + /** TargetHttpProxiesScopedList targetHttpProxies. */ + public targetHttpProxies: google.cloud.compute.v1.ITargetHttpProxy[]; + + /** TargetHttpProxiesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetHttpProxiesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetHttpProxiesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpProxiesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpProxiesScopedList): google.cloud.compute.v1.TargetHttpProxiesScopedList; + + /** + * Encodes the specified TargetHttpProxiesScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxiesScopedList.verify|verify} messages. + * @param message TargetHttpProxiesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpProxiesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpProxiesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxiesScopedList.verify|verify} messages. + * @param message TargetHttpProxiesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpProxiesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpProxiesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpProxiesScopedList; + + /** + * Decodes a TargetHttpProxiesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpProxiesScopedList; + + /** + * Verifies a TargetHttpProxiesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpProxiesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpProxiesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpProxiesScopedList; + + /** + * Creates a plain object from a TargetHttpProxiesScopedList message. Also converts values to other types if specified. + * @param message TargetHttpProxiesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpProxiesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpProxiesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpProxyAggregatedList. */ + interface ITargetHttpProxyAggregatedList { + + /** TargetHttpProxyAggregatedList id */ + id?: (string|null); + + /** TargetHttpProxyAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ITargetHttpProxiesScopedList }|null); + + /** TargetHttpProxyAggregatedList kind */ + kind?: (string|null); + + /** TargetHttpProxyAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetHttpProxyAggregatedList selfLink */ + selfLink?: (string|null); + + /** TargetHttpProxyAggregatedList unreachables */ + unreachables?: (string[]|null); + } + + /** Represents a TargetHttpProxyAggregatedList. */ + class TargetHttpProxyAggregatedList implements ITargetHttpProxyAggregatedList { + + /** + * Constructs a new TargetHttpProxyAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpProxyAggregatedList); + + /** TargetHttpProxyAggregatedList id. */ + public id?: (string|null); + + /** TargetHttpProxyAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ITargetHttpProxiesScopedList }; + + /** TargetHttpProxyAggregatedList kind. */ + public kind?: (string|null); + + /** TargetHttpProxyAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetHttpProxyAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** TargetHttpProxyAggregatedList unreachables. */ + public unreachables: string[]; + + /** TargetHttpProxyAggregatedList _id. */ + public _id?: "id"; + + /** TargetHttpProxyAggregatedList _kind. */ + public _kind?: "kind"; + + /** TargetHttpProxyAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetHttpProxyAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new TargetHttpProxyAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpProxyAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpProxyAggregatedList): google.cloud.compute.v1.TargetHttpProxyAggregatedList; + + /** + * Encodes the specified TargetHttpProxyAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyAggregatedList.verify|verify} messages. + * @param message TargetHttpProxyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpProxyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpProxyAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyAggregatedList.verify|verify} messages. + * @param message TargetHttpProxyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpProxyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpProxyAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpProxyAggregatedList; + + /** + * Decodes a TargetHttpProxyAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpProxyAggregatedList; + + /** + * Verifies a TargetHttpProxyAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpProxyAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpProxyAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpProxyAggregatedList; + + /** + * Creates a plain object from a TargetHttpProxyAggregatedList message. Also converts values to other types if specified. + * @param message TargetHttpProxyAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpProxyAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpProxyAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpProxyList. */ + interface ITargetHttpProxyList { + + /** TargetHttpProxyList id */ + id?: (string|null); + + /** TargetHttpProxyList items */ + items?: (google.cloud.compute.v1.ITargetHttpProxy[]|null); + + /** TargetHttpProxyList kind */ + kind?: (string|null); + + /** TargetHttpProxyList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetHttpProxyList selfLink */ + selfLink?: (string|null); + + /** TargetHttpProxyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetHttpProxyList. */ + class TargetHttpProxyList implements ITargetHttpProxyList { + + /** + * Constructs a new TargetHttpProxyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpProxyList); + + /** TargetHttpProxyList id. */ + public id?: (string|null); + + /** TargetHttpProxyList items. */ + public items: google.cloud.compute.v1.ITargetHttpProxy[]; + + /** TargetHttpProxyList kind. */ + public kind?: (string|null); + + /** TargetHttpProxyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetHttpProxyList selfLink. */ + public selfLink?: (string|null); + + /** TargetHttpProxyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetHttpProxyList _id. */ + public _id?: "id"; + + /** TargetHttpProxyList _kind. */ + public _kind?: "kind"; + + /** TargetHttpProxyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetHttpProxyList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetHttpProxyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetHttpProxyList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpProxyList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpProxyList): google.cloud.compute.v1.TargetHttpProxyList; + + /** + * Encodes the specified TargetHttpProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyList.verify|verify} messages. + * @param message TargetHttpProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyList.verify|verify} messages. + * @param message TargetHttpProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpProxyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpProxyList; + + /** + * Decodes a TargetHttpProxyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpProxyList; + + /** + * Verifies a TargetHttpProxyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpProxyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpProxyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpProxyList; + + /** + * Creates a plain object from a TargetHttpProxyList message. Also converts values to other types if specified. + * @param message TargetHttpProxyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpProxyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpProxyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpsProxy. */ + interface ITargetHttpsProxy { + + /** TargetHttpsProxy authorizationPolicy */ + authorizationPolicy?: (string|null); + + /** TargetHttpsProxy creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetHttpsProxy description */ + description?: (string|null); + + /** TargetHttpsProxy fingerprint */ + fingerprint?: (string|null); + + /** TargetHttpsProxy id */ + id?: (number|Long|string|null); + + /** TargetHttpsProxy kind */ + kind?: (string|null); + + /** TargetHttpsProxy name */ + name?: (string|null); + + /** TargetHttpsProxy proxyBind */ + proxyBind?: (boolean|null); + + /** TargetHttpsProxy quicOverride */ + quicOverride?: (google.cloud.compute.v1.TargetHttpsProxy.QuicOverride|keyof typeof google.cloud.compute.v1.TargetHttpsProxy.QuicOverride|null); + + /** TargetHttpsProxy region */ + region?: (string|null); + + /** TargetHttpsProxy selfLink */ + selfLink?: (string|null); + + /** TargetHttpsProxy serverTlsPolicy */ + serverTlsPolicy?: (string|null); + + /** TargetHttpsProxy sslCertificates */ + sslCertificates?: (string[]|null); + + /** TargetHttpsProxy sslPolicy */ + sslPolicy?: (string|null); + + /** TargetHttpsProxy urlMap */ + urlMap?: (string|null); + } + + /** Represents a TargetHttpsProxy. */ + class TargetHttpsProxy implements ITargetHttpsProxy { + + /** + * Constructs a new TargetHttpsProxy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpsProxy); + + /** TargetHttpsProxy authorizationPolicy. */ + public authorizationPolicy?: (string|null); + + /** TargetHttpsProxy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetHttpsProxy description. */ + public description?: (string|null); + + /** TargetHttpsProxy fingerprint. */ + public fingerprint?: (string|null); + + /** TargetHttpsProxy id. */ + public id?: (number|Long|string|null); + + /** TargetHttpsProxy kind. */ + public kind?: (string|null); + + /** TargetHttpsProxy name. */ + public name?: (string|null); + + /** TargetHttpsProxy proxyBind. */ + public proxyBind?: (boolean|null); + + /** TargetHttpsProxy quicOverride. */ + public quicOverride?: (google.cloud.compute.v1.TargetHttpsProxy.QuicOverride|keyof typeof google.cloud.compute.v1.TargetHttpsProxy.QuicOverride|null); + + /** TargetHttpsProxy region. */ + public region?: (string|null); + + /** TargetHttpsProxy selfLink. */ + public selfLink?: (string|null); + + /** TargetHttpsProxy serverTlsPolicy. */ + public serverTlsPolicy?: (string|null); + + /** TargetHttpsProxy sslCertificates. */ + public sslCertificates: string[]; + + /** TargetHttpsProxy sslPolicy. */ + public sslPolicy?: (string|null); + + /** TargetHttpsProxy urlMap. */ + public urlMap?: (string|null); + + /** TargetHttpsProxy _authorizationPolicy. */ + public _authorizationPolicy?: "authorizationPolicy"; + + /** TargetHttpsProxy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetHttpsProxy _description. */ + public _description?: "description"; + + /** TargetHttpsProxy _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** TargetHttpsProxy _id. */ + public _id?: "id"; + + /** TargetHttpsProxy _kind. */ + public _kind?: "kind"; + + /** TargetHttpsProxy _name. */ + public _name?: "name"; + + /** TargetHttpsProxy _proxyBind. */ + public _proxyBind?: "proxyBind"; + + /** TargetHttpsProxy _quicOverride. */ + public _quicOverride?: "quicOverride"; + + /** TargetHttpsProxy _region. */ + public _region?: "region"; + + /** TargetHttpsProxy _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetHttpsProxy _serverTlsPolicy. */ + public _serverTlsPolicy?: "serverTlsPolicy"; + + /** TargetHttpsProxy _sslPolicy. */ + public _sslPolicy?: "sslPolicy"; + + /** TargetHttpsProxy _urlMap. */ + public _urlMap?: "urlMap"; + + /** + * Creates a new TargetHttpsProxy instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpsProxy instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpsProxy): google.cloud.compute.v1.TargetHttpsProxy; + + /** + * Encodes the specified TargetHttpsProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxy.verify|verify} messages. + * @param message TargetHttpsProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpsProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpsProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxy.verify|verify} messages. + * @param message TargetHttpsProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpsProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpsProxy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpsProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpsProxy; + + /** + * Decodes a TargetHttpsProxy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpsProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpsProxy; + + /** + * Verifies a TargetHttpsProxy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpsProxy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpsProxy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpsProxy; + + /** + * Creates a plain object from a TargetHttpsProxy message. Also converts values to other types if specified. + * @param message TargetHttpsProxy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpsProxy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpsProxy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetHttpsProxy { + + /** QuicOverride enum. */ + enum QuicOverride { + UNDEFINED_QUIC_OVERRIDE = 0, + DISABLE = 241807048, + ENABLE = 438835587, + NONE = 2402104 + } + } + + /** Properties of a TargetHttpsProxiesScopedList. */ + interface ITargetHttpsProxiesScopedList { + + /** TargetHttpsProxiesScopedList targetHttpsProxies */ + targetHttpsProxies?: (google.cloud.compute.v1.ITargetHttpsProxy[]|null); + + /** TargetHttpsProxiesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetHttpsProxiesScopedList. */ + class TargetHttpsProxiesScopedList implements ITargetHttpsProxiesScopedList { + + /** + * Constructs a new TargetHttpsProxiesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpsProxiesScopedList); + + /** TargetHttpsProxiesScopedList targetHttpsProxies. */ + public targetHttpsProxies: google.cloud.compute.v1.ITargetHttpsProxy[]; + + /** TargetHttpsProxiesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetHttpsProxiesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetHttpsProxiesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpsProxiesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpsProxiesScopedList): google.cloud.compute.v1.TargetHttpsProxiesScopedList; + + /** + * Encodes the specified TargetHttpsProxiesScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesScopedList.verify|verify} messages. + * @param message TargetHttpsProxiesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpsProxiesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpsProxiesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesScopedList.verify|verify} messages. + * @param message TargetHttpsProxiesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpsProxiesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpsProxiesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpsProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpsProxiesScopedList; + + /** + * Decodes a TargetHttpsProxiesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpsProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpsProxiesScopedList; + + /** + * Verifies a TargetHttpsProxiesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpsProxiesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpsProxiesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpsProxiesScopedList; + + /** + * Creates a plain object from a TargetHttpsProxiesScopedList message. Also converts values to other types if specified. + * @param message TargetHttpsProxiesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpsProxiesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpsProxiesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpsProxiesSetQuicOverrideRequest. */ + interface ITargetHttpsProxiesSetQuicOverrideRequest { + + /** TargetHttpsProxiesSetQuicOverrideRequest quicOverride */ + quicOverride?: (google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride|keyof typeof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride|null); + } + + /** Represents a TargetHttpsProxiesSetQuicOverrideRequest. */ + class TargetHttpsProxiesSetQuicOverrideRequest implements ITargetHttpsProxiesSetQuicOverrideRequest { + + /** + * Constructs a new TargetHttpsProxiesSetQuicOverrideRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest); + + /** TargetHttpsProxiesSetQuicOverrideRequest quicOverride. */ + public quicOverride?: (google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride|keyof typeof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride|null); + + /** TargetHttpsProxiesSetQuicOverrideRequest _quicOverride. */ + public _quicOverride?: "quicOverride"; + + /** + * Creates a new TargetHttpsProxiesSetQuicOverrideRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpsProxiesSetQuicOverrideRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest): google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest; + + /** + * Encodes the specified TargetHttpsProxiesSetQuicOverrideRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.verify|verify} messages. + * @param message TargetHttpsProxiesSetQuicOverrideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpsProxiesSetQuicOverrideRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.verify|verify} messages. + * @param message TargetHttpsProxiesSetQuicOverrideRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpsProxiesSetQuicOverrideRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpsProxiesSetQuicOverrideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest; + + /** + * Decodes a TargetHttpsProxiesSetQuicOverrideRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpsProxiesSetQuicOverrideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest; + + /** + * Verifies a TargetHttpsProxiesSetQuicOverrideRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpsProxiesSetQuicOverrideRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpsProxiesSetQuicOverrideRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest; + + /** + * Creates a plain object from a TargetHttpsProxiesSetQuicOverrideRequest message. Also converts values to other types if specified. + * @param message TargetHttpsProxiesSetQuicOverrideRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpsProxiesSetQuicOverrideRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetHttpsProxiesSetQuicOverrideRequest { + + /** QuicOverride enum. */ + enum QuicOverride { + UNDEFINED_QUIC_OVERRIDE = 0, + DISABLE = 241807048, + ENABLE = 438835587, + NONE = 2402104 + } + } + + /** Properties of a TargetHttpsProxiesSetSslCertificatesRequest. */ + interface ITargetHttpsProxiesSetSslCertificatesRequest { + + /** TargetHttpsProxiesSetSslCertificatesRequest sslCertificates */ + sslCertificates?: (string[]|null); + } + + /** Represents a TargetHttpsProxiesSetSslCertificatesRequest. */ + class TargetHttpsProxiesSetSslCertificatesRequest implements ITargetHttpsProxiesSetSslCertificatesRequest { + + /** + * Constructs a new TargetHttpsProxiesSetSslCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest); + + /** TargetHttpsProxiesSetSslCertificatesRequest sslCertificates. */ + public sslCertificates: string[]; + + /** + * Creates a new TargetHttpsProxiesSetSslCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpsProxiesSetSslCertificatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest): google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Encodes the specified TargetHttpsProxiesSetSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @param message TargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpsProxiesSetSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @param message TargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Decodes a TargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Verifies a TargetHttpsProxiesSetSslCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpsProxiesSetSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpsProxiesSetSslCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest; + + /** + * Creates a plain object from a TargetHttpsProxiesSetSslCertificatesRequest message. Also converts values to other types if specified. + * @param message TargetHttpsProxiesSetSslCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpsProxiesSetSslCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpsProxyAggregatedList. */ + interface ITargetHttpsProxyAggregatedList { + + /** TargetHttpsProxyAggregatedList id */ + id?: (string|null); + + /** TargetHttpsProxyAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ITargetHttpsProxiesScopedList }|null); + + /** TargetHttpsProxyAggregatedList kind */ + kind?: (string|null); + + /** TargetHttpsProxyAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetHttpsProxyAggregatedList selfLink */ + selfLink?: (string|null); + + /** TargetHttpsProxyAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** TargetHttpsProxyAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetHttpsProxyAggregatedList. */ + class TargetHttpsProxyAggregatedList implements ITargetHttpsProxyAggregatedList { + + /** + * Constructs a new TargetHttpsProxyAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpsProxyAggregatedList); + + /** TargetHttpsProxyAggregatedList id. */ + public id?: (string|null); + + /** TargetHttpsProxyAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ITargetHttpsProxiesScopedList }; + + /** TargetHttpsProxyAggregatedList kind. */ + public kind?: (string|null); + + /** TargetHttpsProxyAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetHttpsProxyAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** TargetHttpsProxyAggregatedList unreachables. */ + public unreachables: string[]; + + /** TargetHttpsProxyAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetHttpsProxyAggregatedList _id. */ + public _id?: "id"; + + /** TargetHttpsProxyAggregatedList _kind. */ + public _kind?: "kind"; + + /** TargetHttpsProxyAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetHttpsProxyAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetHttpsProxyAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetHttpsProxyAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpsProxyAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpsProxyAggregatedList): google.cloud.compute.v1.TargetHttpsProxyAggregatedList; + + /** + * Encodes the specified TargetHttpsProxyAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyAggregatedList.verify|verify} messages. + * @param message TargetHttpsProxyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpsProxyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpsProxyAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyAggregatedList.verify|verify} messages. + * @param message TargetHttpsProxyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpsProxyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpsProxyAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpsProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpsProxyAggregatedList; + + /** + * Decodes a TargetHttpsProxyAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpsProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpsProxyAggregatedList; + + /** + * Verifies a TargetHttpsProxyAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpsProxyAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpsProxyAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpsProxyAggregatedList; + + /** + * Creates a plain object from a TargetHttpsProxyAggregatedList message. Also converts values to other types if specified. + * @param message TargetHttpsProxyAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpsProxyAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpsProxyAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetHttpsProxyList. */ + interface ITargetHttpsProxyList { + + /** TargetHttpsProxyList id */ + id?: (string|null); + + /** TargetHttpsProxyList items */ + items?: (google.cloud.compute.v1.ITargetHttpsProxy[]|null); + + /** TargetHttpsProxyList kind */ + kind?: (string|null); + + /** TargetHttpsProxyList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetHttpsProxyList selfLink */ + selfLink?: (string|null); + + /** TargetHttpsProxyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetHttpsProxyList. */ + class TargetHttpsProxyList implements ITargetHttpsProxyList { + + /** + * Constructs a new TargetHttpsProxyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetHttpsProxyList); + + /** TargetHttpsProxyList id. */ + public id?: (string|null); + + /** TargetHttpsProxyList items. */ + public items: google.cloud.compute.v1.ITargetHttpsProxy[]; + + /** TargetHttpsProxyList kind. */ + public kind?: (string|null); + + /** TargetHttpsProxyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetHttpsProxyList selfLink. */ + public selfLink?: (string|null); + + /** TargetHttpsProxyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetHttpsProxyList _id. */ + public _id?: "id"; + + /** TargetHttpsProxyList _kind. */ + public _kind?: "kind"; + + /** TargetHttpsProxyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetHttpsProxyList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetHttpsProxyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetHttpsProxyList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetHttpsProxyList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetHttpsProxyList): google.cloud.compute.v1.TargetHttpsProxyList; + + /** + * Encodes the specified TargetHttpsProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyList.verify|verify} messages. + * @param message TargetHttpsProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetHttpsProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetHttpsProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyList.verify|verify} messages. + * @param message TargetHttpsProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetHttpsProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetHttpsProxyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetHttpsProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetHttpsProxyList; + + /** + * Decodes a TargetHttpsProxyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetHttpsProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetHttpsProxyList; + + /** + * Verifies a TargetHttpsProxyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetHttpsProxyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetHttpsProxyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetHttpsProxyList; + + /** + * Creates a plain object from a TargetHttpsProxyList message. Also converts values to other types if specified. + * @param message TargetHttpsProxyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetHttpsProxyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetHttpsProxyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetInstance. */ + interface ITargetInstance { + + /** TargetInstance creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetInstance description */ + description?: (string|null); + + /** TargetInstance id */ + id?: (number|Long|string|null); + + /** TargetInstance instance */ + instance?: (string|null); + + /** TargetInstance kind */ + kind?: (string|null); + + /** TargetInstance name */ + name?: (string|null); + + /** TargetInstance natPolicy */ + natPolicy?: (google.cloud.compute.v1.TargetInstance.NatPolicy|keyof typeof google.cloud.compute.v1.TargetInstance.NatPolicy|null); + + /** TargetInstance selfLink */ + selfLink?: (string|null); + + /** TargetInstance zone */ + zone?: (string|null); + } + + /** Represents a TargetInstance. */ + class TargetInstance implements ITargetInstance { + + /** + * Constructs a new TargetInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetInstance); + + /** TargetInstance creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetInstance description. */ + public description?: (string|null); + + /** TargetInstance id. */ + public id?: (number|Long|string|null); + + /** TargetInstance instance. */ + public instance?: (string|null); + + /** TargetInstance kind. */ + public kind?: (string|null); + + /** TargetInstance name. */ + public name?: (string|null); + + /** TargetInstance natPolicy. */ + public natPolicy?: (google.cloud.compute.v1.TargetInstance.NatPolicy|keyof typeof google.cloud.compute.v1.TargetInstance.NatPolicy|null); + + /** TargetInstance selfLink. */ + public selfLink?: (string|null); + + /** TargetInstance zone. */ + public zone?: (string|null); + + /** TargetInstance _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetInstance _description. */ + public _description?: "description"; + + /** TargetInstance _id. */ + public _id?: "id"; + + /** TargetInstance _instance. */ + public _instance?: "instance"; + + /** TargetInstance _kind. */ + public _kind?: "kind"; + + /** TargetInstance _name. */ + public _name?: "name"; + + /** TargetInstance _natPolicy. */ + public _natPolicy?: "natPolicy"; + + /** TargetInstance _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetInstance _zone. */ + public _zone?: "zone"; + + /** + * Creates a new TargetInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetInstance instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetInstance): google.cloud.compute.v1.TargetInstance; + + /** + * Encodes the specified TargetInstance message. Does not implicitly {@link google.cloud.compute.v1.TargetInstance.verify|verify} messages. + * @param message TargetInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetInstance message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstance.verify|verify} messages. + * @param message TargetInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetInstance; + + /** + * Decodes a TargetInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetInstance; + + /** + * Verifies a TargetInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetInstance; + + /** + * Creates a plain object from a TargetInstance message. Also converts values to other types if specified. + * @param message TargetInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetInstance { + + /** NatPolicy enum. */ + enum NatPolicy { + UNDEFINED_NAT_POLICY = 0, + NO_NAT = 161455491 + } + } + + /** Properties of a TargetInstancesScopedList. */ + interface ITargetInstancesScopedList { + + /** TargetInstancesScopedList targetInstances */ + targetInstances?: (google.cloud.compute.v1.ITargetInstance[]|null); + + /** TargetInstancesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetInstancesScopedList. */ + class TargetInstancesScopedList implements ITargetInstancesScopedList { + + /** + * Constructs a new TargetInstancesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetInstancesScopedList); + + /** TargetInstancesScopedList targetInstances. */ + public targetInstances: google.cloud.compute.v1.ITargetInstance[]; + + /** TargetInstancesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetInstancesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetInstancesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetInstancesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetInstancesScopedList): google.cloud.compute.v1.TargetInstancesScopedList; + + /** + * Encodes the specified TargetInstancesScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetInstancesScopedList.verify|verify} messages. + * @param message TargetInstancesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetInstancesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetInstancesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstancesScopedList.verify|verify} messages. + * @param message TargetInstancesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetInstancesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetInstancesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetInstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetInstancesScopedList; + + /** + * Decodes a TargetInstancesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetInstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetInstancesScopedList; + + /** + * Verifies a TargetInstancesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetInstancesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetInstancesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetInstancesScopedList; + + /** + * Creates a plain object from a TargetInstancesScopedList message. Also converts values to other types if specified. + * @param message TargetInstancesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetInstancesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetInstancesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetInstanceAggregatedList. */ + interface ITargetInstanceAggregatedList { + + /** TargetInstanceAggregatedList id */ + id?: (string|null); + + /** TargetInstanceAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ITargetInstancesScopedList }|null); + + /** TargetInstanceAggregatedList kind */ + kind?: (string|null); + + /** TargetInstanceAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetInstanceAggregatedList selfLink */ + selfLink?: (string|null); + + /** TargetInstanceAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** TargetInstanceAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetInstanceAggregatedList. */ + class TargetInstanceAggregatedList implements ITargetInstanceAggregatedList { + + /** + * Constructs a new TargetInstanceAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetInstanceAggregatedList); + + /** TargetInstanceAggregatedList id. */ + public id?: (string|null); + + /** TargetInstanceAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ITargetInstancesScopedList }; + + /** TargetInstanceAggregatedList kind. */ + public kind?: (string|null); + + /** TargetInstanceAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetInstanceAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** TargetInstanceAggregatedList unreachables. */ + public unreachables: string[]; + + /** TargetInstanceAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetInstanceAggregatedList _id. */ + public _id?: "id"; + + /** TargetInstanceAggregatedList _kind. */ + public _kind?: "kind"; + + /** TargetInstanceAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetInstanceAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetInstanceAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetInstanceAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetInstanceAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetInstanceAggregatedList): google.cloud.compute.v1.TargetInstanceAggregatedList; + + /** + * Encodes the specified TargetInstanceAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceAggregatedList.verify|verify} messages. + * @param message TargetInstanceAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetInstanceAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetInstanceAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceAggregatedList.verify|verify} messages. + * @param message TargetInstanceAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetInstanceAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetInstanceAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetInstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetInstanceAggregatedList; + + /** + * Decodes a TargetInstanceAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetInstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetInstanceAggregatedList; + + /** + * Verifies a TargetInstanceAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetInstanceAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetInstanceAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetInstanceAggregatedList; + + /** + * Creates a plain object from a TargetInstanceAggregatedList message. Also converts values to other types if specified. + * @param message TargetInstanceAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetInstanceAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetInstanceAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetInstanceList. */ + interface ITargetInstanceList { + + /** TargetInstanceList id */ + id?: (string|null); + + /** TargetInstanceList items */ + items?: (google.cloud.compute.v1.ITargetInstance[]|null); + + /** TargetInstanceList kind */ + kind?: (string|null); + + /** TargetInstanceList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetInstanceList selfLink */ + selfLink?: (string|null); + + /** TargetInstanceList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetInstanceList. */ + class TargetInstanceList implements ITargetInstanceList { + + /** + * Constructs a new TargetInstanceList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetInstanceList); + + /** TargetInstanceList id. */ + public id?: (string|null); + + /** TargetInstanceList items. */ + public items: google.cloud.compute.v1.ITargetInstance[]; + + /** TargetInstanceList kind. */ + public kind?: (string|null); + + /** TargetInstanceList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetInstanceList selfLink. */ + public selfLink?: (string|null); + + /** TargetInstanceList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetInstanceList _id. */ + public _id?: "id"; + + /** TargetInstanceList _kind. */ + public _kind?: "kind"; + + /** TargetInstanceList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetInstanceList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetInstanceList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetInstanceList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetInstanceList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetInstanceList): google.cloud.compute.v1.TargetInstanceList; + + /** + * Encodes the specified TargetInstanceList message. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceList.verify|verify} messages. + * @param message TargetInstanceList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetInstanceList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetInstanceList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceList.verify|verify} messages. + * @param message TargetInstanceList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetInstanceList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetInstanceList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetInstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetInstanceList; + + /** + * Decodes a TargetInstanceList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetInstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetInstanceList; + + /** + * Verifies a TargetInstanceList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetInstanceList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetInstanceList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetInstanceList; + + /** + * Creates a plain object from a TargetInstanceList message. Also converts values to other types if specified. + * @param message TargetInstanceList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetInstanceList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetInstanceList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPool. */ + interface ITargetPool { + + /** TargetPool backupPool */ + backupPool?: (string|null); + + /** TargetPool creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetPool description */ + description?: (string|null); + + /** TargetPool failoverRatio */ + failoverRatio?: (number|null); + + /** TargetPool healthChecks */ + healthChecks?: (string[]|null); + + /** TargetPool id */ + id?: (number|Long|string|null); + + /** TargetPool instances */ + instances?: (string[]|null); + + /** TargetPool kind */ + kind?: (string|null); + + /** TargetPool name */ + name?: (string|null); + + /** TargetPool region */ + region?: (string|null); + + /** TargetPool selfLink */ + selfLink?: (string|null); + + /** TargetPool sessionAffinity */ + sessionAffinity?: (google.cloud.compute.v1.TargetPool.SessionAffinity|keyof typeof google.cloud.compute.v1.TargetPool.SessionAffinity|null); + } + + /** Represents a TargetPool. */ + class TargetPool implements ITargetPool { + + /** + * Constructs a new TargetPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPool); + + /** TargetPool backupPool. */ + public backupPool?: (string|null); + + /** TargetPool creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetPool description. */ + public description?: (string|null); + + /** TargetPool failoverRatio. */ + public failoverRatio?: (number|null); + + /** TargetPool healthChecks. */ + public healthChecks: string[]; + + /** TargetPool id. */ + public id?: (number|Long|string|null); + + /** TargetPool instances. */ + public instances: string[]; + + /** TargetPool kind. */ + public kind?: (string|null); + + /** TargetPool name. */ + public name?: (string|null); + + /** TargetPool region. */ + public region?: (string|null); + + /** TargetPool selfLink. */ + public selfLink?: (string|null); + + /** TargetPool sessionAffinity. */ + public sessionAffinity?: (google.cloud.compute.v1.TargetPool.SessionAffinity|keyof typeof google.cloud.compute.v1.TargetPool.SessionAffinity|null); + + /** TargetPool _backupPool. */ + public _backupPool?: "backupPool"; + + /** TargetPool _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetPool _description. */ + public _description?: "description"; + + /** TargetPool _failoverRatio. */ + public _failoverRatio?: "failoverRatio"; + + /** TargetPool _id. */ + public _id?: "id"; + + /** TargetPool _kind. */ + public _kind?: "kind"; + + /** TargetPool _name. */ + public _name?: "name"; + + /** TargetPool _region. */ + public _region?: "region"; + + /** TargetPool _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetPool _sessionAffinity. */ + public _sessionAffinity?: "sessionAffinity"; + + /** + * Creates a new TargetPool instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPool instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPool): google.cloud.compute.v1.TargetPool; + + /** + * Encodes the specified TargetPool message. Does not implicitly {@link google.cloud.compute.v1.TargetPool.verify|verify} messages. + * @param message TargetPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPool message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPool.verify|verify} messages. + * @param message TargetPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPool; + + /** + * Decodes a TargetPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPool; + + /** + * Verifies a TargetPool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPool; + + /** + * Creates a plain object from a TargetPool message. Also converts values to other types if specified. + * @param message TargetPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetPool { + + /** SessionAffinity enum. */ + enum SessionAffinity { + UNDEFINED_SESSION_AFFINITY = 0, + CLIENT_IP = 345665051, + CLIENT_IP_NO_DESTINATION = 106122516, + CLIENT_IP_PORT_PROTO = 221722926, + CLIENT_IP_PROTO = 25322148, + GENERATED_COOKIE = 370321204, + HEADER_FIELD = 200737960, + HTTP_COOKIE = 494981627, + NONE = 2402104 + } + } + + /** Properties of a TargetPoolsScopedList. */ + interface ITargetPoolsScopedList { + + /** TargetPoolsScopedList targetPools */ + targetPools?: (google.cloud.compute.v1.ITargetPool[]|null); + + /** TargetPoolsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetPoolsScopedList. */ + class TargetPoolsScopedList implements ITargetPoolsScopedList { + + /** + * Constructs a new TargetPoolsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolsScopedList); + + /** TargetPoolsScopedList targetPools. */ + public targetPools: google.cloud.compute.v1.ITargetPool[]; + + /** TargetPoolsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetPoolsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetPoolsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolsScopedList): google.cloud.compute.v1.TargetPoolsScopedList; + + /** + * Encodes the specified TargetPoolsScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsScopedList.verify|verify} messages. + * @param message TargetPoolsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsScopedList.verify|verify} messages. + * @param message TargetPoolsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolsScopedList; + + /** + * Decodes a TargetPoolsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolsScopedList; + + /** + * Verifies a TargetPoolsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolsScopedList; + + /** + * Creates a plain object from a TargetPoolsScopedList message. Also converts values to other types if specified. + * @param message TargetPoolsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPoolAggregatedList. */ + interface ITargetPoolAggregatedList { + + /** TargetPoolAggregatedList id */ + id?: (string|null); + + /** TargetPoolAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ITargetPoolsScopedList }|null); + + /** TargetPoolAggregatedList kind */ + kind?: (string|null); + + /** TargetPoolAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetPoolAggregatedList selfLink */ + selfLink?: (string|null); + + /** TargetPoolAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** TargetPoolAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetPoolAggregatedList. */ + class TargetPoolAggregatedList implements ITargetPoolAggregatedList { + + /** + * Constructs a new TargetPoolAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolAggregatedList); + + /** TargetPoolAggregatedList id. */ + public id?: (string|null); + + /** TargetPoolAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ITargetPoolsScopedList }; + + /** TargetPoolAggregatedList kind. */ + public kind?: (string|null); + + /** TargetPoolAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetPoolAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** TargetPoolAggregatedList unreachables. */ + public unreachables: string[]; + + /** TargetPoolAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetPoolAggregatedList _id. */ + public _id?: "id"; + + /** TargetPoolAggregatedList _kind. */ + public _kind?: "kind"; + + /** TargetPoolAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetPoolAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetPoolAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetPoolAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolAggregatedList): google.cloud.compute.v1.TargetPoolAggregatedList; + + /** + * Encodes the specified TargetPoolAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolAggregatedList.verify|verify} messages. + * @param message TargetPoolAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolAggregatedList.verify|verify} messages. + * @param message TargetPoolAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolAggregatedList; + + /** + * Decodes a TargetPoolAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolAggregatedList; + + /** + * Verifies a TargetPoolAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolAggregatedList; + + /** + * Creates a plain object from a TargetPoolAggregatedList message. Also converts values to other types if specified. + * @param message TargetPoolAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPoolInstanceHealth. */ + interface ITargetPoolInstanceHealth { + + /** TargetPoolInstanceHealth healthStatus */ + healthStatus?: (google.cloud.compute.v1.IHealthStatus[]|null); + + /** TargetPoolInstanceHealth kind */ + kind?: (string|null); + } + + /** Represents a TargetPoolInstanceHealth. */ + class TargetPoolInstanceHealth implements ITargetPoolInstanceHealth { + + /** + * Constructs a new TargetPoolInstanceHealth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolInstanceHealth); + + /** TargetPoolInstanceHealth healthStatus. */ + public healthStatus: google.cloud.compute.v1.IHealthStatus[]; + + /** TargetPoolInstanceHealth kind. */ + public kind?: (string|null); + + /** TargetPoolInstanceHealth _kind. */ + public _kind?: "kind"; + + /** + * Creates a new TargetPoolInstanceHealth instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolInstanceHealth instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolInstanceHealth): google.cloud.compute.v1.TargetPoolInstanceHealth; + + /** + * Encodes the specified TargetPoolInstanceHealth message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolInstanceHealth.verify|verify} messages. + * @param message TargetPoolInstanceHealth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolInstanceHealth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolInstanceHealth message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolInstanceHealth.verify|verify} messages. + * @param message TargetPoolInstanceHealth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolInstanceHealth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolInstanceHealth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolInstanceHealth; + + /** + * Decodes a TargetPoolInstanceHealth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolInstanceHealth; + + /** + * Verifies a TargetPoolInstanceHealth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolInstanceHealth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolInstanceHealth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolInstanceHealth; + + /** + * Creates a plain object from a TargetPoolInstanceHealth message. Also converts values to other types if specified. + * @param message TargetPoolInstanceHealth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolInstanceHealth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolInstanceHealth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPoolList. */ + interface ITargetPoolList { + + /** TargetPoolList id */ + id?: (string|null); + + /** TargetPoolList items */ + items?: (google.cloud.compute.v1.ITargetPool[]|null); + + /** TargetPoolList kind */ + kind?: (string|null); + + /** TargetPoolList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetPoolList selfLink */ + selfLink?: (string|null); + + /** TargetPoolList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetPoolList. */ + class TargetPoolList implements ITargetPoolList { + + /** + * Constructs a new TargetPoolList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolList); + + /** TargetPoolList id. */ + public id?: (string|null); + + /** TargetPoolList items. */ + public items: google.cloud.compute.v1.ITargetPool[]; + + /** TargetPoolList kind. */ + public kind?: (string|null); + + /** TargetPoolList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetPoolList selfLink. */ + public selfLink?: (string|null); + + /** TargetPoolList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetPoolList _id. */ + public _id?: "id"; + + /** TargetPoolList _kind. */ + public _kind?: "kind"; + + /** TargetPoolList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetPoolList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetPoolList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetPoolList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolList): google.cloud.compute.v1.TargetPoolList; + + /** + * Encodes the specified TargetPoolList message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolList.verify|verify} messages. + * @param message TargetPoolList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolList.verify|verify} messages. + * @param message TargetPoolList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolList; + + /** + * Decodes a TargetPoolList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolList; + + /** + * Verifies a TargetPoolList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolList; + + /** + * Creates a plain object from a TargetPoolList message. Also converts values to other types if specified. + * @param message TargetPoolList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPoolsAddHealthCheckRequest. */ + interface ITargetPoolsAddHealthCheckRequest { + + /** TargetPoolsAddHealthCheckRequest healthChecks */ + healthChecks?: (google.cloud.compute.v1.IHealthCheckReference[]|null); + } + + /** Represents a TargetPoolsAddHealthCheckRequest. */ + class TargetPoolsAddHealthCheckRequest implements ITargetPoolsAddHealthCheckRequest { + + /** + * Constructs a new TargetPoolsAddHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest); + + /** TargetPoolsAddHealthCheckRequest healthChecks. */ + public healthChecks: google.cloud.compute.v1.IHealthCheckReference[]; + + /** + * Creates a new TargetPoolsAddHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolsAddHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest): google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; + + /** + * Encodes the specified TargetPoolsAddHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.verify|verify} messages. + * @param message TargetPoolsAddHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolsAddHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.verify|verify} messages. + * @param message TargetPoolsAddHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolsAddHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolsAddHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; + + /** + * Decodes a TargetPoolsAddHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolsAddHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; + + /** + * Verifies a TargetPoolsAddHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolsAddHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolsAddHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest; + + /** + * Creates a plain object from a TargetPoolsAddHealthCheckRequest message. Also converts values to other types if specified. + * @param message TargetPoolsAddHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolsAddHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPoolsAddInstanceRequest. */ + interface ITargetPoolsAddInstanceRequest { + + /** TargetPoolsAddInstanceRequest instances */ + instances?: (google.cloud.compute.v1.IInstanceReference[]|null); + } + + /** Represents a TargetPoolsAddInstanceRequest. */ + class TargetPoolsAddInstanceRequest implements ITargetPoolsAddInstanceRequest { + + /** + * Constructs a new TargetPoolsAddInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolsAddInstanceRequest); + + /** TargetPoolsAddInstanceRequest instances. */ + public instances: google.cloud.compute.v1.IInstanceReference[]; + + /** + * Creates a new TargetPoolsAddInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolsAddInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolsAddInstanceRequest): google.cloud.compute.v1.TargetPoolsAddInstanceRequest; + + /** + * Encodes the specified TargetPoolsAddInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddInstanceRequest.verify|verify} messages. + * @param message TargetPoolsAddInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolsAddInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolsAddInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddInstanceRequest.verify|verify} messages. + * @param message TargetPoolsAddInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolsAddInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolsAddInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolsAddInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolsAddInstanceRequest; + + /** + * Decodes a TargetPoolsAddInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolsAddInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolsAddInstanceRequest; + + /** + * Verifies a TargetPoolsAddInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolsAddInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolsAddInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolsAddInstanceRequest; + + /** + * Creates a plain object from a TargetPoolsAddInstanceRequest message. Also converts values to other types if specified. + * @param message TargetPoolsAddInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolsAddInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolsAddInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPoolsRemoveHealthCheckRequest. */ + interface ITargetPoolsRemoveHealthCheckRequest { + + /** TargetPoolsRemoveHealthCheckRequest healthChecks */ + healthChecks?: (google.cloud.compute.v1.IHealthCheckReference[]|null); + } + + /** Represents a TargetPoolsRemoveHealthCheckRequest. */ + class TargetPoolsRemoveHealthCheckRequest implements ITargetPoolsRemoveHealthCheckRequest { + + /** + * Constructs a new TargetPoolsRemoveHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest); + + /** TargetPoolsRemoveHealthCheckRequest healthChecks. */ + public healthChecks: google.cloud.compute.v1.IHealthCheckReference[]; + + /** + * Creates a new TargetPoolsRemoveHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolsRemoveHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest): google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; + + /** + * Encodes the specified TargetPoolsRemoveHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.verify|verify} messages. + * @param message TargetPoolsRemoveHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolsRemoveHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.verify|verify} messages. + * @param message TargetPoolsRemoveHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolsRemoveHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolsRemoveHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; + + /** + * Decodes a TargetPoolsRemoveHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolsRemoveHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; + + /** + * Verifies a TargetPoolsRemoveHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolsRemoveHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolsRemoveHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest; + + /** + * Creates a plain object from a TargetPoolsRemoveHealthCheckRequest message. Also converts values to other types if specified. + * @param message TargetPoolsRemoveHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolsRemoveHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetPoolsRemoveInstanceRequest. */ + interface ITargetPoolsRemoveInstanceRequest { + + /** TargetPoolsRemoveInstanceRequest instances */ + instances?: (google.cloud.compute.v1.IInstanceReference[]|null); + } + + /** Represents a TargetPoolsRemoveInstanceRequest. */ + class TargetPoolsRemoveInstanceRequest implements ITargetPoolsRemoveInstanceRequest { + + /** + * Constructs a new TargetPoolsRemoveInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest); + + /** TargetPoolsRemoveInstanceRequest instances. */ + public instances: google.cloud.compute.v1.IInstanceReference[]; + + /** + * Creates a new TargetPoolsRemoveInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetPoolsRemoveInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest): google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; + + /** + * Encodes the specified TargetPoolsRemoveInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.verify|verify} messages. + * @param message TargetPoolsRemoveInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetPoolsRemoveInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.verify|verify} messages. + * @param message TargetPoolsRemoveInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetPoolsRemoveInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetPoolsRemoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; + + /** + * Decodes a TargetPoolsRemoveInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetPoolsRemoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; + + /** + * Verifies a TargetPoolsRemoveInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetPoolsRemoveInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetPoolsRemoveInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest; + + /** + * Creates a plain object from a TargetPoolsRemoveInstanceRequest message. Also converts values to other types if specified. + * @param message TargetPoolsRemoveInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetPoolsRemoveInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetReference. */ + interface ITargetReference { + + /** TargetReference target */ + target?: (string|null); + } + + /** Represents a TargetReference. */ + class TargetReference implements ITargetReference { + + /** + * Constructs a new TargetReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetReference); + + /** TargetReference target. */ + public target?: (string|null); + + /** TargetReference _target. */ + public _target?: "target"; + + /** + * Creates a new TargetReference instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetReference instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetReference): google.cloud.compute.v1.TargetReference; + + /** + * Encodes the specified TargetReference message. Does not implicitly {@link google.cloud.compute.v1.TargetReference.verify|verify} messages. + * @param message TargetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetReference.verify|verify} messages. + * @param message TargetReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetReference; + + /** + * Decodes a TargetReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetReference; + + /** + * Verifies a TargetReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetReference; + + /** + * Creates a plain object from a TargetReference message. Also converts values to other types if specified. + * @param message TargetReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetSslProxiesSetBackendServiceRequest. */ + interface ITargetSslProxiesSetBackendServiceRequest { + + /** TargetSslProxiesSetBackendServiceRequest service */ + service?: (string|null); + } + + /** Represents a TargetSslProxiesSetBackendServiceRequest. */ + class TargetSslProxiesSetBackendServiceRequest implements ITargetSslProxiesSetBackendServiceRequest { + + /** + * Constructs a new TargetSslProxiesSetBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest); + + /** TargetSslProxiesSetBackendServiceRequest service. */ + public service?: (string|null); + + /** TargetSslProxiesSetBackendServiceRequest _service. */ + public _service?: "service"; + + /** + * Creates a new TargetSslProxiesSetBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetSslProxiesSetBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest): google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; + + /** + * Encodes the specified TargetSslProxiesSetBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.verify|verify} messages. + * @param message TargetSslProxiesSetBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetSslProxiesSetBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.verify|verify} messages. + * @param message TargetSslProxiesSetBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetSslProxiesSetBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetSslProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; + + /** + * Decodes a TargetSslProxiesSetBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetSslProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; + + /** + * Verifies a TargetSslProxiesSetBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetSslProxiesSetBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetSslProxiesSetBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest; + + /** + * Creates a plain object from a TargetSslProxiesSetBackendServiceRequest message. Also converts values to other types if specified. + * @param message TargetSslProxiesSetBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetSslProxiesSetBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetSslProxiesSetProxyHeaderRequest. */ + interface ITargetSslProxiesSetProxyHeaderRequest { + + /** TargetSslProxiesSetProxyHeaderRequest proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader|null); + } + + /** Represents a TargetSslProxiesSetProxyHeaderRequest. */ + class TargetSslProxiesSetProxyHeaderRequest implements ITargetSslProxiesSetProxyHeaderRequest { + + /** + * Constructs a new TargetSslProxiesSetProxyHeaderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest); + + /** TargetSslProxiesSetProxyHeaderRequest proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader|null); + + /** TargetSslProxiesSetProxyHeaderRequest _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** + * Creates a new TargetSslProxiesSetProxyHeaderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetSslProxiesSetProxyHeaderRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest): google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; + + /** + * Encodes the specified TargetSslProxiesSetProxyHeaderRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.verify|verify} messages. + * @param message TargetSslProxiesSetProxyHeaderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetSslProxiesSetProxyHeaderRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.verify|verify} messages. + * @param message TargetSslProxiesSetProxyHeaderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetSslProxiesSetProxyHeaderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetSslProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; + + /** + * Decodes a TargetSslProxiesSetProxyHeaderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetSslProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; + + /** + * Verifies a TargetSslProxiesSetProxyHeaderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetSslProxiesSetProxyHeaderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetSslProxiesSetProxyHeaderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest; + + /** + * Creates a plain object from a TargetSslProxiesSetProxyHeaderRequest message. Also converts values to other types if specified. + * @param message TargetSslProxiesSetProxyHeaderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetSslProxiesSetProxyHeaderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetSslProxiesSetProxyHeaderRequest { + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a TargetSslProxiesSetSslCertificatesRequest. */ + interface ITargetSslProxiesSetSslCertificatesRequest { + + /** TargetSslProxiesSetSslCertificatesRequest sslCertificates */ + sslCertificates?: (string[]|null); + } + + /** Represents a TargetSslProxiesSetSslCertificatesRequest. */ + class TargetSslProxiesSetSslCertificatesRequest implements ITargetSslProxiesSetSslCertificatesRequest { + + /** + * Constructs a new TargetSslProxiesSetSslCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest); + + /** TargetSslProxiesSetSslCertificatesRequest sslCertificates. */ + public sslCertificates: string[]; + + /** + * Creates a new TargetSslProxiesSetSslCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetSslProxiesSetSslCertificatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest): google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; + + /** + * Encodes the specified TargetSslProxiesSetSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.verify|verify} messages. + * @param message TargetSslProxiesSetSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetSslProxiesSetSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.verify|verify} messages. + * @param message TargetSslProxiesSetSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetSslProxiesSetSslCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetSslProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; + + /** + * Decodes a TargetSslProxiesSetSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetSslProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; + + /** + * Verifies a TargetSslProxiesSetSslCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetSslProxiesSetSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetSslProxiesSetSslCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest; + + /** + * Creates a plain object from a TargetSslProxiesSetSslCertificatesRequest message. Also converts values to other types if specified. + * @param message TargetSslProxiesSetSslCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetSslProxiesSetSslCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetSslProxy. */ + interface ITargetSslProxy { + + /** TargetSslProxy creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetSslProxy description */ + description?: (string|null); + + /** TargetSslProxy id */ + id?: (number|Long|string|null); + + /** TargetSslProxy kind */ + kind?: (string|null); + + /** TargetSslProxy name */ + name?: (string|null); + + /** TargetSslProxy proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.TargetSslProxy.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetSslProxy.ProxyHeader|null); + + /** TargetSslProxy selfLink */ + selfLink?: (string|null); + + /** TargetSslProxy service */ + service?: (string|null); + + /** TargetSslProxy sslCertificates */ + sslCertificates?: (string[]|null); + + /** TargetSslProxy sslPolicy */ + sslPolicy?: (string|null); + } + + /** Represents a TargetSslProxy. */ + class TargetSslProxy implements ITargetSslProxy { + + /** + * Constructs a new TargetSslProxy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetSslProxy); + + /** TargetSslProxy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetSslProxy description. */ + public description?: (string|null); + + /** TargetSslProxy id. */ + public id?: (number|Long|string|null); + + /** TargetSslProxy kind. */ + public kind?: (string|null); + + /** TargetSslProxy name. */ + public name?: (string|null); + + /** TargetSslProxy proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.TargetSslProxy.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetSslProxy.ProxyHeader|null); + + /** TargetSslProxy selfLink. */ + public selfLink?: (string|null); + + /** TargetSslProxy service. */ + public service?: (string|null); + + /** TargetSslProxy sslCertificates. */ + public sslCertificates: string[]; + + /** TargetSslProxy sslPolicy. */ + public sslPolicy?: (string|null); + + /** TargetSslProxy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetSslProxy _description. */ + public _description?: "description"; + + /** TargetSslProxy _id. */ + public _id?: "id"; + + /** TargetSslProxy _kind. */ + public _kind?: "kind"; + + /** TargetSslProxy _name. */ + public _name?: "name"; + + /** TargetSslProxy _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** TargetSslProxy _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetSslProxy _service. */ + public _service?: "service"; + + /** TargetSslProxy _sslPolicy. */ + public _sslPolicy?: "sslPolicy"; + + /** + * Creates a new TargetSslProxy instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetSslProxy instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetSslProxy): google.cloud.compute.v1.TargetSslProxy; + + /** + * Encodes the specified TargetSslProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxy.verify|verify} messages. + * @param message TargetSslProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetSslProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetSslProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxy.verify|verify} messages. + * @param message TargetSslProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetSslProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetSslProxy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetSslProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetSslProxy; + + /** + * Decodes a TargetSslProxy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetSslProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetSslProxy; + + /** + * Verifies a TargetSslProxy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetSslProxy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetSslProxy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetSslProxy; + + /** + * Creates a plain object from a TargetSslProxy message. Also converts values to other types if specified. + * @param message TargetSslProxy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetSslProxy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetSslProxy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetSslProxy { + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a TargetSslProxyList. */ + interface ITargetSslProxyList { + + /** TargetSslProxyList id */ + id?: (string|null); + + /** TargetSslProxyList items */ + items?: (google.cloud.compute.v1.ITargetSslProxy[]|null); + + /** TargetSslProxyList kind */ + kind?: (string|null); + + /** TargetSslProxyList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetSslProxyList selfLink */ + selfLink?: (string|null); + + /** TargetSslProxyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetSslProxyList. */ + class TargetSslProxyList implements ITargetSslProxyList { + + /** + * Constructs a new TargetSslProxyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetSslProxyList); + + /** TargetSslProxyList id. */ + public id?: (string|null); + + /** TargetSslProxyList items. */ + public items: google.cloud.compute.v1.ITargetSslProxy[]; + + /** TargetSslProxyList kind. */ + public kind?: (string|null); + + /** TargetSslProxyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetSslProxyList selfLink. */ + public selfLink?: (string|null); + + /** TargetSslProxyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetSslProxyList _id. */ + public _id?: "id"; + + /** TargetSslProxyList _kind. */ + public _kind?: "kind"; + + /** TargetSslProxyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetSslProxyList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetSslProxyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetSslProxyList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetSslProxyList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetSslProxyList): google.cloud.compute.v1.TargetSslProxyList; + + /** + * Encodes the specified TargetSslProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxyList.verify|verify} messages. + * @param message TargetSslProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetSslProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetSslProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxyList.verify|verify} messages. + * @param message TargetSslProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetSslProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetSslProxyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetSslProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetSslProxyList; + + /** + * Decodes a TargetSslProxyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetSslProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetSslProxyList; + + /** + * Verifies a TargetSslProxyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetSslProxyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetSslProxyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetSslProxyList; + + /** + * Creates a plain object from a TargetSslProxyList message. Also converts values to other types if specified. + * @param message TargetSslProxyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetSslProxyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetSslProxyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetTcpProxiesSetBackendServiceRequest. */ + interface ITargetTcpProxiesSetBackendServiceRequest { + + /** TargetTcpProxiesSetBackendServiceRequest service */ + service?: (string|null); + } + + /** Represents a TargetTcpProxiesSetBackendServiceRequest. */ + class TargetTcpProxiesSetBackendServiceRequest implements ITargetTcpProxiesSetBackendServiceRequest { + + /** + * Constructs a new TargetTcpProxiesSetBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest); + + /** TargetTcpProxiesSetBackendServiceRequest service. */ + public service?: (string|null); + + /** TargetTcpProxiesSetBackendServiceRequest _service. */ + public _service?: "service"; + + /** + * Creates a new TargetTcpProxiesSetBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetTcpProxiesSetBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest): google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; + + /** + * Encodes the specified TargetTcpProxiesSetBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.verify|verify} messages. + * @param message TargetTcpProxiesSetBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetTcpProxiesSetBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.verify|verify} messages. + * @param message TargetTcpProxiesSetBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetTcpProxiesSetBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetTcpProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; + + /** + * Decodes a TargetTcpProxiesSetBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetTcpProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; + + /** + * Verifies a TargetTcpProxiesSetBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetTcpProxiesSetBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetTcpProxiesSetBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest; + + /** + * Creates a plain object from a TargetTcpProxiesSetBackendServiceRequest message. Also converts values to other types if specified. + * @param message TargetTcpProxiesSetBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetTcpProxiesSetBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetTcpProxiesSetProxyHeaderRequest. */ + interface ITargetTcpProxiesSetProxyHeaderRequest { + + /** TargetTcpProxiesSetProxyHeaderRequest proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader|null); + } + + /** Represents a TargetTcpProxiesSetProxyHeaderRequest. */ + class TargetTcpProxiesSetProxyHeaderRequest implements ITargetTcpProxiesSetProxyHeaderRequest { + + /** + * Constructs a new TargetTcpProxiesSetProxyHeaderRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest); + + /** TargetTcpProxiesSetProxyHeaderRequest proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader|null); + + /** TargetTcpProxiesSetProxyHeaderRequest _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** + * Creates a new TargetTcpProxiesSetProxyHeaderRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetTcpProxiesSetProxyHeaderRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest): google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; + + /** + * Encodes the specified TargetTcpProxiesSetProxyHeaderRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.verify|verify} messages. + * @param message TargetTcpProxiesSetProxyHeaderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetTcpProxiesSetProxyHeaderRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.verify|verify} messages. + * @param message TargetTcpProxiesSetProxyHeaderRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetTcpProxiesSetProxyHeaderRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetTcpProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; + + /** + * Decodes a TargetTcpProxiesSetProxyHeaderRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetTcpProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; + + /** + * Verifies a TargetTcpProxiesSetProxyHeaderRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetTcpProxiesSetProxyHeaderRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetTcpProxiesSetProxyHeaderRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest; + + /** + * Creates a plain object from a TargetTcpProxiesSetProxyHeaderRequest message. Also converts values to other types if specified. + * @param message TargetTcpProxiesSetProxyHeaderRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetTcpProxiesSetProxyHeaderRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetTcpProxiesSetProxyHeaderRequest { + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a TargetTcpProxy. */ + interface ITargetTcpProxy { + + /** TargetTcpProxy creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetTcpProxy description */ + description?: (string|null); + + /** TargetTcpProxy id */ + id?: (number|Long|string|null); + + /** TargetTcpProxy kind */ + kind?: (string|null); + + /** TargetTcpProxy name */ + name?: (string|null); + + /** TargetTcpProxy proxyBind */ + proxyBind?: (boolean|null); + + /** TargetTcpProxy proxyHeader */ + proxyHeader?: (google.cloud.compute.v1.TargetTcpProxy.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetTcpProxy.ProxyHeader|null); + + /** TargetTcpProxy selfLink */ + selfLink?: (string|null); + + /** TargetTcpProxy service */ + service?: (string|null); + } + + /** Represents a TargetTcpProxy. */ + class TargetTcpProxy implements ITargetTcpProxy { + + /** + * Constructs a new TargetTcpProxy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetTcpProxy); + + /** TargetTcpProxy creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetTcpProxy description. */ + public description?: (string|null); + + /** TargetTcpProxy id. */ + public id?: (number|Long|string|null); + + /** TargetTcpProxy kind. */ + public kind?: (string|null); + + /** TargetTcpProxy name. */ + public name?: (string|null); + + /** TargetTcpProxy proxyBind. */ + public proxyBind?: (boolean|null); + + /** TargetTcpProxy proxyHeader. */ + public proxyHeader?: (google.cloud.compute.v1.TargetTcpProxy.ProxyHeader|keyof typeof google.cloud.compute.v1.TargetTcpProxy.ProxyHeader|null); + + /** TargetTcpProxy selfLink. */ + public selfLink?: (string|null); + + /** TargetTcpProxy service. */ + public service?: (string|null); + + /** TargetTcpProxy _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetTcpProxy _description. */ + public _description?: "description"; + + /** TargetTcpProxy _id. */ + public _id?: "id"; + + /** TargetTcpProxy _kind. */ + public _kind?: "kind"; + + /** TargetTcpProxy _name. */ + public _name?: "name"; + + /** TargetTcpProxy _proxyBind. */ + public _proxyBind?: "proxyBind"; + + /** TargetTcpProxy _proxyHeader. */ + public _proxyHeader?: "proxyHeader"; + + /** TargetTcpProxy _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetTcpProxy _service. */ + public _service?: "service"; + + /** + * Creates a new TargetTcpProxy instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetTcpProxy instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetTcpProxy): google.cloud.compute.v1.TargetTcpProxy; + + /** + * Encodes the specified TargetTcpProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxy.verify|verify} messages. + * @param message TargetTcpProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetTcpProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetTcpProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxy.verify|verify} messages. + * @param message TargetTcpProxy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetTcpProxy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetTcpProxy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetTcpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetTcpProxy; + + /** + * Decodes a TargetTcpProxy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetTcpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetTcpProxy; + + /** + * Verifies a TargetTcpProxy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetTcpProxy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetTcpProxy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetTcpProxy; + + /** + * Creates a plain object from a TargetTcpProxy message. Also converts values to other types if specified. + * @param message TargetTcpProxy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetTcpProxy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetTcpProxy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetTcpProxy { + + /** ProxyHeader enum. */ + enum ProxyHeader { + UNDEFINED_PROXY_HEADER = 0, + NONE = 2402104, + PROXY_V1 = 334352940 + } + } + + /** Properties of a TargetTcpProxyList. */ + interface ITargetTcpProxyList { + + /** TargetTcpProxyList id */ + id?: (string|null); + + /** TargetTcpProxyList items */ + items?: (google.cloud.compute.v1.ITargetTcpProxy[]|null); + + /** TargetTcpProxyList kind */ + kind?: (string|null); + + /** TargetTcpProxyList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetTcpProxyList selfLink */ + selfLink?: (string|null); + + /** TargetTcpProxyList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetTcpProxyList. */ + class TargetTcpProxyList implements ITargetTcpProxyList { + + /** + * Constructs a new TargetTcpProxyList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetTcpProxyList); + + /** TargetTcpProxyList id. */ + public id?: (string|null); + + /** TargetTcpProxyList items. */ + public items: google.cloud.compute.v1.ITargetTcpProxy[]; + + /** TargetTcpProxyList kind. */ + public kind?: (string|null); + + /** TargetTcpProxyList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetTcpProxyList selfLink. */ + public selfLink?: (string|null); + + /** TargetTcpProxyList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetTcpProxyList _id. */ + public _id?: "id"; + + /** TargetTcpProxyList _kind. */ + public _kind?: "kind"; + + /** TargetTcpProxyList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetTcpProxyList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetTcpProxyList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetTcpProxyList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetTcpProxyList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetTcpProxyList): google.cloud.compute.v1.TargetTcpProxyList; + + /** + * Encodes the specified TargetTcpProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxyList.verify|verify} messages. + * @param message TargetTcpProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetTcpProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetTcpProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxyList.verify|verify} messages. + * @param message TargetTcpProxyList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetTcpProxyList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetTcpProxyList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetTcpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetTcpProxyList; + + /** + * Decodes a TargetTcpProxyList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetTcpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetTcpProxyList; + + /** + * Verifies a TargetTcpProxyList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetTcpProxyList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetTcpProxyList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetTcpProxyList; + + /** + * Creates a plain object from a TargetTcpProxyList message. Also converts values to other types if specified. + * @param message TargetTcpProxyList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetTcpProxyList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetTcpProxyList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetVpnGateway. */ + interface ITargetVpnGateway { + + /** TargetVpnGateway creationTimestamp */ + creationTimestamp?: (string|null); + + /** TargetVpnGateway description */ + description?: (string|null); + + /** TargetVpnGateway forwardingRules */ + forwardingRules?: (string[]|null); + + /** TargetVpnGateway id */ + id?: (number|Long|string|null); + + /** TargetVpnGateway kind */ + kind?: (string|null); + + /** TargetVpnGateway name */ + name?: (string|null); + + /** TargetVpnGateway network */ + network?: (string|null); + + /** TargetVpnGateway region */ + region?: (string|null); + + /** TargetVpnGateway selfLink */ + selfLink?: (string|null); + + /** TargetVpnGateway status */ + status?: (google.cloud.compute.v1.TargetVpnGateway.Status|keyof typeof google.cloud.compute.v1.TargetVpnGateway.Status|null); + + /** TargetVpnGateway tunnels */ + tunnels?: (string[]|null); + } + + /** Represents a TargetVpnGateway. */ + class TargetVpnGateway implements ITargetVpnGateway { + + /** + * Constructs a new TargetVpnGateway. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetVpnGateway); + + /** TargetVpnGateway creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** TargetVpnGateway description. */ + public description?: (string|null); + + /** TargetVpnGateway forwardingRules. */ + public forwardingRules: string[]; + + /** TargetVpnGateway id. */ + public id?: (number|Long|string|null); + + /** TargetVpnGateway kind. */ + public kind?: (string|null); + + /** TargetVpnGateway name. */ + public name?: (string|null); + + /** TargetVpnGateway network. */ + public network?: (string|null); + + /** TargetVpnGateway region. */ + public region?: (string|null); + + /** TargetVpnGateway selfLink. */ + public selfLink?: (string|null); + + /** TargetVpnGateway status. */ + public status?: (google.cloud.compute.v1.TargetVpnGateway.Status|keyof typeof google.cloud.compute.v1.TargetVpnGateway.Status|null); + + /** TargetVpnGateway tunnels. */ + public tunnels: string[]; + + /** TargetVpnGateway _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** TargetVpnGateway _description. */ + public _description?: "description"; + + /** TargetVpnGateway _id. */ + public _id?: "id"; + + /** TargetVpnGateway _kind. */ + public _kind?: "kind"; + + /** TargetVpnGateway _name. */ + public _name?: "name"; + + /** TargetVpnGateway _network. */ + public _network?: "network"; + + /** TargetVpnGateway _region. */ + public _region?: "region"; + + /** TargetVpnGateway _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetVpnGateway _status. */ + public _status?: "status"; + + /** + * Creates a new TargetVpnGateway instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetVpnGateway instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetVpnGateway): google.cloud.compute.v1.TargetVpnGateway; + + /** + * Encodes the specified TargetVpnGateway message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGateway.verify|verify} messages. + * @param message TargetVpnGateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetVpnGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetVpnGateway message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGateway.verify|verify} messages. + * @param message TargetVpnGateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetVpnGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetVpnGateway message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetVpnGateway; + + /** + * Decodes a TargetVpnGateway message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetVpnGateway; + + /** + * Verifies a TargetVpnGateway message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetVpnGateway message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetVpnGateway + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetVpnGateway; + + /** + * Creates a plain object from a TargetVpnGateway message. Also converts values to other types if specified. + * @param message TargetVpnGateway + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetVpnGateway, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetVpnGateway to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TargetVpnGateway { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + CREATING = 455564985, + DELETING = 528602024, + FAILED = 455706685, + READY = 77848963 + } + } + + /** Properties of a TargetVpnGatewaysScopedList. */ + interface ITargetVpnGatewaysScopedList { + + /** TargetVpnGatewaysScopedList targetVpnGateways */ + targetVpnGateways?: (google.cloud.compute.v1.ITargetVpnGateway[]|null); + + /** TargetVpnGatewaysScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetVpnGatewaysScopedList. */ + class TargetVpnGatewaysScopedList implements ITargetVpnGatewaysScopedList { + + /** + * Constructs a new TargetVpnGatewaysScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetVpnGatewaysScopedList); + + /** TargetVpnGatewaysScopedList targetVpnGateways. */ + public targetVpnGateways: google.cloud.compute.v1.ITargetVpnGateway[]; + + /** TargetVpnGatewaysScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetVpnGatewaysScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetVpnGatewaysScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetVpnGatewaysScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetVpnGatewaysScopedList): google.cloud.compute.v1.TargetVpnGatewaysScopedList; + + /** + * Encodes the specified TargetVpnGatewaysScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewaysScopedList.verify|verify} messages. + * @param message TargetVpnGatewaysScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetVpnGatewaysScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetVpnGatewaysScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewaysScopedList.verify|verify} messages. + * @param message TargetVpnGatewaysScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetVpnGatewaysScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetVpnGatewaysScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetVpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetVpnGatewaysScopedList; + + /** + * Decodes a TargetVpnGatewaysScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetVpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetVpnGatewaysScopedList; + + /** + * Verifies a TargetVpnGatewaysScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetVpnGatewaysScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetVpnGatewaysScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetVpnGatewaysScopedList; + + /** + * Creates a plain object from a TargetVpnGatewaysScopedList message. Also converts values to other types if specified. + * @param message TargetVpnGatewaysScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetVpnGatewaysScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetVpnGatewaysScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetVpnGatewayAggregatedList. */ + interface ITargetVpnGatewayAggregatedList { + + /** TargetVpnGatewayAggregatedList id */ + id?: (string|null); + + /** TargetVpnGatewayAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.ITargetVpnGatewaysScopedList }|null); + + /** TargetVpnGatewayAggregatedList kind */ + kind?: (string|null); + + /** TargetVpnGatewayAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetVpnGatewayAggregatedList selfLink */ + selfLink?: (string|null); + + /** TargetVpnGatewayAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** TargetVpnGatewayAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetVpnGatewayAggregatedList. */ + class TargetVpnGatewayAggregatedList implements ITargetVpnGatewayAggregatedList { + + /** + * Constructs a new TargetVpnGatewayAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetVpnGatewayAggregatedList); + + /** TargetVpnGatewayAggregatedList id. */ + public id?: (string|null); + + /** TargetVpnGatewayAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.ITargetVpnGatewaysScopedList }; + + /** TargetVpnGatewayAggregatedList kind. */ + public kind?: (string|null); + + /** TargetVpnGatewayAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetVpnGatewayAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** TargetVpnGatewayAggregatedList unreachables. */ + public unreachables: string[]; + + /** TargetVpnGatewayAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetVpnGatewayAggregatedList _id. */ + public _id?: "id"; + + /** TargetVpnGatewayAggregatedList _kind. */ + public _kind?: "kind"; + + /** TargetVpnGatewayAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetVpnGatewayAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetVpnGatewayAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetVpnGatewayAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetVpnGatewayAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetVpnGatewayAggregatedList): google.cloud.compute.v1.TargetVpnGatewayAggregatedList; + + /** + * Encodes the specified TargetVpnGatewayAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayAggregatedList.verify|verify} messages. + * @param message TargetVpnGatewayAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetVpnGatewayAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetVpnGatewayAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayAggregatedList.verify|verify} messages. + * @param message TargetVpnGatewayAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetVpnGatewayAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetVpnGatewayAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetVpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetVpnGatewayAggregatedList; + + /** + * Decodes a TargetVpnGatewayAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetVpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetVpnGatewayAggregatedList; + + /** + * Verifies a TargetVpnGatewayAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetVpnGatewayAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetVpnGatewayAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetVpnGatewayAggregatedList; + + /** + * Creates a plain object from a TargetVpnGatewayAggregatedList message. Also converts values to other types if specified. + * @param message TargetVpnGatewayAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetVpnGatewayAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetVpnGatewayAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TargetVpnGatewayList. */ + interface ITargetVpnGatewayList { + + /** TargetVpnGatewayList id */ + id?: (string|null); + + /** TargetVpnGatewayList items */ + items?: (google.cloud.compute.v1.ITargetVpnGateway[]|null); + + /** TargetVpnGatewayList kind */ + kind?: (string|null); + + /** TargetVpnGatewayList nextPageToken */ + nextPageToken?: (string|null); + + /** TargetVpnGatewayList selfLink */ + selfLink?: (string|null); + + /** TargetVpnGatewayList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a TargetVpnGatewayList. */ + class TargetVpnGatewayList implements ITargetVpnGatewayList { + + /** + * Constructs a new TargetVpnGatewayList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITargetVpnGatewayList); + + /** TargetVpnGatewayList id. */ + public id?: (string|null); + + /** TargetVpnGatewayList items. */ + public items: google.cloud.compute.v1.ITargetVpnGateway[]; + + /** TargetVpnGatewayList kind. */ + public kind?: (string|null); + + /** TargetVpnGatewayList nextPageToken. */ + public nextPageToken?: (string|null); + + /** TargetVpnGatewayList selfLink. */ + public selfLink?: (string|null); + + /** TargetVpnGatewayList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** TargetVpnGatewayList _id. */ + public _id?: "id"; + + /** TargetVpnGatewayList _kind. */ + public _kind?: "kind"; + + /** TargetVpnGatewayList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** TargetVpnGatewayList _selfLink. */ + public _selfLink?: "selfLink"; + + /** TargetVpnGatewayList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new TargetVpnGatewayList instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetVpnGatewayList instance + */ + public static create(properties?: google.cloud.compute.v1.ITargetVpnGatewayList): google.cloud.compute.v1.TargetVpnGatewayList; + + /** + * Encodes the specified TargetVpnGatewayList message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayList.verify|verify} messages. + * @param message TargetVpnGatewayList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITargetVpnGatewayList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetVpnGatewayList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayList.verify|verify} messages. + * @param message TargetVpnGatewayList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITargetVpnGatewayList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetVpnGatewayList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TargetVpnGatewayList; + + /** + * Decodes a TargetVpnGatewayList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TargetVpnGatewayList; + + /** + * Verifies a TargetVpnGatewayList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetVpnGatewayList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetVpnGatewayList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TargetVpnGatewayList; + + /** + * Creates a plain object from a TargetVpnGatewayList message. Also converts values to other types if specified. + * @param message TargetVpnGatewayList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TargetVpnGatewayList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetVpnGatewayList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapTestHeader. */ + interface IUrlMapTestHeader { + + /** UrlMapTestHeader name */ + name?: (string|null); + + /** UrlMapTestHeader value */ + value?: (string|null); + } + + /** Represents an UrlMapTestHeader. */ + class UrlMapTestHeader implements IUrlMapTestHeader { + + /** + * Constructs a new UrlMapTestHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapTestHeader); + + /** UrlMapTestHeader name. */ + public name?: (string|null); + + /** UrlMapTestHeader value. */ + public value?: (string|null); + + /** UrlMapTestHeader _name. */ + public _name?: "name"; + + /** UrlMapTestHeader _value. */ + public _value?: "value"; + + /** + * Creates a new UrlMapTestHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapTestHeader instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapTestHeader): google.cloud.compute.v1.UrlMapTestHeader; + + /** + * Encodes the specified UrlMapTestHeader message. Does not implicitly {@link google.cloud.compute.v1.UrlMapTestHeader.verify|verify} messages. + * @param message UrlMapTestHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapTestHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapTestHeader message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapTestHeader.verify|verify} messages. + * @param message UrlMapTestHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapTestHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapTestHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapTestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapTestHeader; + + /** + * Decodes an UrlMapTestHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapTestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapTestHeader; + + /** + * Verifies an UrlMapTestHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapTestHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapTestHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapTestHeader; + + /** + * Creates a plain object from an UrlMapTestHeader message. Also converts values to other types if specified. + * @param message UrlMapTestHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapTestHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapTestHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestFailure. */ + interface ITestFailure { + + /** TestFailure actualOutputUrl */ + actualOutputUrl?: (string|null); + + /** TestFailure actualRedirectResponseCode */ + actualRedirectResponseCode?: (number|null); + + /** TestFailure actualService */ + actualService?: (string|null); + + /** TestFailure expectedOutputUrl */ + expectedOutputUrl?: (string|null); + + /** TestFailure expectedRedirectResponseCode */ + expectedRedirectResponseCode?: (number|null); + + /** TestFailure expectedService */ + expectedService?: (string|null); + + /** TestFailure headers */ + headers?: (google.cloud.compute.v1.IUrlMapTestHeader[]|null); + + /** TestFailure host */ + host?: (string|null); + + /** TestFailure path */ + path?: (string|null); + } + + /** Represents a TestFailure. */ + class TestFailure implements ITestFailure { + + /** + * Constructs a new TestFailure. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestFailure); + + /** TestFailure actualOutputUrl. */ + public actualOutputUrl?: (string|null); + + /** TestFailure actualRedirectResponseCode. */ + public actualRedirectResponseCode?: (number|null); + + /** TestFailure actualService. */ + public actualService?: (string|null); + + /** TestFailure expectedOutputUrl. */ + public expectedOutputUrl?: (string|null); + + /** TestFailure expectedRedirectResponseCode. */ + public expectedRedirectResponseCode?: (number|null); + + /** TestFailure expectedService. */ + public expectedService?: (string|null); + + /** TestFailure headers. */ + public headers: google.cloud.compute.v1.IUrlMapTestHeader[]; + + /** TestFailure host. */ + public host?: (string|null); + + /** TestFailure path. */ + public path?: (string|null); + + /** TestFailure _actualOutputUrl. */ + public _actualOutputUrl?: "actualOutputUrl"; + + /** TestFailure _actualRedirectResponseCode. */ + public _actualRedirectResponseCode?: "actualRedirectResponseCode"; + + /** TestFailure _actualService. */ + public _actualService?: "actualService"; + + /** TestFailure _expectedOutputUrl. */ + public _expectedOutputUrl?: "expectedOutputUrl"; + + /** TestFailure _expectedRedirectResponseCode. */ + public _expectedRedirectResponseCode?: "expectedRedirectResponseCode"; + + /** TestFailure _expectedService. */ + public _expectedService?: "expectedService"; + + /** TestFailure _host. */ + public _host?: "host"; + + /** TestFailure _path. */ + public _path?: "path"; + + /** + * Creates a new TestFailure instance using the specified properties. + * @param [properties] Properties to set + * @returns TestFailure instance + */ + public static create(properties?: google.cloud.compute.v1.ITestFailure): google.cloud.compute.v1.TestFailure; + + /** + * Encodes the specified TestFailure message. Does not implicitly {@link google.cloud.compute.v1.TestFailure.verify|verify} messages. + * @param message TestFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestFailure message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestFailure.verify|verify} messages. + * @param message TestFailure message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestFailure, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestFailure message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestFailure; + + /** + * Decodes a TestFailure message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestFailure; + + /** + * Verifies a TestFailure message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestFailure message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestFailure + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestFailure; + + /** + * Creates a plain object from a TestFailure message. Also converts values to other types if specified. + * @param message TestFailure + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestFailure, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestFailure to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestPermissionsRequest. */ + interface ITestPermissionsRequest { + + /** TestPermissionsRequest permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestPermissionsRequest. */ + class TestPermissionsRequest implements ITestPermissionsRequest { + + /** + * Constructs a new TestPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestPermissionsRequest); + + /** TestPermissionsRequest permissions. */ + public permissions: string[]; + + /** + * Creates a new TestPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestPermissionsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestPermissionsRequest): google.cloud.compute.v1.TestPermissionsRequest; + + /** + * Encodes the specified TestPermissionsRequest message. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsRequest.verify|verify} messages. + * @param message TestPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestPermissionsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsRequest.verify|verify} messages. + * @param message TestPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestPermissionsRequest; + + /** + * Decodes a TestPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestPermissionsRequest; + + /** + * Verifies a TestPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestPermissionsRequest; + + /** + * Creates a plain object from a TestPermissionsRequest message. Also converts values to other types if specified. + * @param message TestPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestPermissionsResponse. */ + interface ITestPermissionsResponse { + + /** TestPermissionsResponse permissions */ + permissions?: (string[]|null); + } + + /** Represents a TestPermissionsResponse. */ + class TestPermissionsResponse implements ITestPermissionsResponse { + + /** + * Constructs a new TestPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestPermissionsResponse); + + /** TestPermissionsResponse permissions. */ + public permissions: string[]; + + /** + * Creates a new TestPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TestPermissionsResponse instance + */ + public static create(properties?: google.cloud.compute.v1.ITestPermissionsResponse): google.cloud.compute.v1.TestPermissionsResponse; + + /** + * Encodes the specified TestPermissionsResponse message. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsResponse.verify|verify} messages. + * @param message TestPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestPermissionsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsResponse.verify|verify} messages. + * @param message TestPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestPermissionsResponse; + + /** + * Decodes a TestPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestPermissionsResponse; + + /** + * Verifies a TestPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestPermissionsResponse; + + /** + * Creates a plain object from a TestPermissionsResponse message. Also converts values to other types if specified. + * @param message TestPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapTest. */ + interface IUrlMapTest { + + /** UrlMapTest description */ + description?: (string|null); + + /** UrlMapTest expectedOutputUrl */ + expectedOutputUrl?: (string|null); + + /** UrlMapTest expectedRedirectResponseCode */ + expectedRedirectResponseCode?: (number|null); + + /** UrlMapTest headers */ + headers?: (google.cloud.compute.v1.IUrlMapTestHeader[]|null); + + /** UrlMapTest host */ + host?: (string|null); + + /** UrlMapTest path */ + path?: (string|null); + + /** UrlMapTest service */ + service?: (string|null); + } + + /** Represents an UrlMapTest. */ + class UrlMapTest implements IUrlMapTest { + + /** + * Constructs a new UrlMapTest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapTest); + + /** UrlMapTest description. */ + public description?: (string|null); + + /** UrlMapTest expectedOutputUrl. */ + public expectedOutputUrl?: (string|null); + + /** UrlMapTest expectedRedirectResponseCode. */ + public expectedRedirectResponseCode?: (number|null); + + /** UrlMapTest headers. */ + public headers: google.cloud.compute.v1.IUrlMapTestHeader[]; + + /** UrlMapTest host. */ + public host?: (string|null); + + /** UrlMapTest path. */ + public path?: (string|null); + + /** UrlMapTest service. */ + public service?: (string|null); + + /** UrlMapTest _description. */ + public _description?: "description"; + + /** UrlMapTest _expectedOutputUrl. */ + public _expectedOutputUrl?: "expectedOutputUrl"; + + /** UrlMapTest _expectedRedirectResponseCode. */ + public _expectedRedirectResponseCode?: "expectedRedirectResponseCode"; + + /** UrlMapTest _host. */ + public _host?: "host"; + + /** UrlMapTest _path. */ + public _path?: "path"; + + /** UrlMapTest _service. */ + public _service?: "service"; + + /** + * Creates a new UrlMapTest instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapTest instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapTest): google.cloud.compute.v1.UrlMapTest; + + /** + * Encodes the specified UrlMapTest message. Does not implicitly {@link google.cloud.compute.v1.UrlMapTest.verify|verify} messages. + * @param message UrlMapTest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapTest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapTest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapTest.verify|verify} messages. + * @param message UrlMapTest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapTest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapTest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapTest; + + /** + * Decodes an UrlMapTest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapTest; + + /** + * Verifies an UrlMapTest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapTest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapTest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapTest; + + /** + * Creates a plain object from an UrlMapTest message. Also converts values to other types if specified. + * @param message UrlMapTest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapTest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapTest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapList. */ + interface IUrlMapList { + + /** UrlMapList id */ + id?: (string|null); + + /** UrlMapList items */ + items?: (google.cloud.compute.v1.IUrlMap[]|null); + + /** UrlMapList kind */ + kind?: (string|null); + + /** UrlMapList nextPageToken */ + nextPageToken?: (string|null); + + /** UrlMapList selfLink */ + selfLink?: (string|null); + + /** UrlMapList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an UrlMapList. */ + class UrlMapList implements IUrlMapList { + + /** + * Constructs a new UrlMapList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapList); + + /** UrlMapList id. */ + public id?: (string|null); + + /** UrlMapList items. */ + public items: google.cloud.compute.v1.IUrlMap[]; + + /** UrlMapList kind. */ + public kind?: (string|null); + + /** UrlMapList nextPageToken. */ + public nextPageToken?: (string|null); + + /** UrlMapList selfLink. */ + public selfLink?: (string|null); + + /** UrlMapList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** UrlMapList _id. */ + public _id?: "id"; + + /** UrlMapList _kind. */ + public _kind?: "kind"; + + /** UrlMapList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** UrlMapList _selfLink. */ + public _selfLink?: "selfLink"; + + /** UrlMapList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new UrlMapList instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapList instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapList): google.cloud.compute.v1.UrlMapList; + + /** + * Encodes the specified UrlMapList message. Does not implicitly {@link google.cloud.compute.v1.UrlMapList.verify|verify} messages. + * @param message UrlMapList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapList.verify|verify} messages. + * @param message UrlMapList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapList; + + /** + * Decodes an UrlMapList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapList; + + /** + * Verifies an UrlMapList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapList; + + /** + * Creates a plain object from an UrlMapList message. Also converts values to other types if specified. + * @param message UrlMapList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapReference. */ + interface IUrlMapReference { + + /** UrlMapReference urlMap */ + urlMap?: (string|null); + } + + /** Represents an UrlMapReference. */ + class UrlMapReference implements IUrlMapReference { + + /** + * Constructs a new UrlMapReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapReference); + + /** UrlMapReference urlMap. */ + public urlMap?: (string|null); + + /** UrlMapReference _urlMap. */ + public _urlMap?: "urlMap"; + + /** + * Creates a new UrlMapReference instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapReference instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapReference): google.cloud.compute.v1.UrlMapReference; + + /** + * Encodes the specified UrlMapReference message. Does not implicitly {@link google.cloud.compute.v1.UrlMapReference.verify|verify} messages. + * @param message UrlMapReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapReference.verify|verify} messages. + * @param message UrlMapReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapReference; + + /** + * Decodes an UrlMapReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapReference; + + /** + * Verifies an UrlMapReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapReference; + + /** + * Creates a plain object from an UrlMapReference message. Also converts values to other types if specified. + * @param message UrlMapReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapValidationResult. */ + interface IUrlMapValidationResult { + + /** UrlMapValidationResult loadErrors */ + loadErrors?: (string[]|null); + + /** UrlMapValidationResult loadSucceeded */ + loadSucceeded?: (boolean|null); + + /** UrlMapValidationResult testFailures */ + testFailures?: (google.cloud.compute.v1.ITestFailure[]|null); + + /** UrlMapValidationResult testPassed */ + testPassed?: (boolean|null); + } + + /** Represents an UrlMapValidationResult. */ + class UrlMapValidationResult implements IUrlMapValidationResult { + + /** + * Constructs a new UrlMapValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapValidationResult); + + /** UrlMapValidationResult loadErrors. */ + public loadErrors: string[]; + + /** UrlMapValidationResult loadSucceeded. */ + public loadSucceeded?: (boolean|null); + + /** UrlMapValidationResult testFailures. */ + public testFailures: google.cloud.compute.v1.ITestFailure[]; + + /** UrlMapValidationResult testPassed. */ + public testPassed?: (boolean|null); + + /** UrlMapValidationResult _loadSucceeded. */ + public _loadSucceeded?: "loadSucceeded"; + + /** UrlMapValidationResult _testPassed. */ + public _testPassed?: "testPassed"; + + /** + * Creates a new UrlMapValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapValidationResult instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapValidationResult): google.cloud.compute.v1.UrlMapValidationResult; + + /** + * Encodes the specified UrlMapValidationResult message. Does not implicitly {@link google.cloud.compute.v1.UrlMapValidationResult.verify|verify} messages. + * @param message UrlMapValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapValidationResult message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapValidationResult.verify|verify} messages. + * @param message UrlMapValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapValidationResult; + + /** + * Decodes an UrlMapValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapValidationResult; + + /** + * Verifies an UrlMapValidationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapValidationResult; + + /** + * Creates a plain object from an UrlMapValidationResult message. Also converts values to other types if specified. + * @param message UrlMapValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapsScopedList. */ + interface IUrlMapsScopedList { + + /** UrlMapsScopedList urlMaps */ + urlMaps?: (google.cloud.compute.v1.IUrlMap[]|null); + + /** UrlMapsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an UrlMapsScopedList. */ + class UrlMapsScopedList implements IUrlMapsScopedList { + + /** + * Constructs a new UrlMapsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapsScopedList); + + /** UrlMapsScopedList urlMaps. */ + public urlMaps: google.cloud.compute.v1.IUrlMap[]; + + /** UrlMapsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** UrlMapsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new UrlMapsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapsScopedList): google.cloud.compute.v1.UrlMapsScopedList; + + /** + * Encodes the specified UrlMapsScopedList message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsScopedList.verify|verify} messages. + * @param message UrlMapsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsScopedList.verify|verify} messages. + * @param message UrlMapsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapsScopedList; + + /** + * Decodes an UrlMapsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapsScopedList; + + /** + * Verifies an UrlMapsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapsScopedList; + + /** + * Creates a plain object from an UrlMapsScopedList message. Also converts values to other types if specified. + * @param message UrlMapsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapsAggregatedList. */ + interface IUrlMapsAggregatedList { + + /** UrlMapsAggregatedList id */ + id?: (string|null); + + /** UrlMapsAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IUrlMapsScopedList }|null); + + /** UrlMapsAggregatedList kind */ + kind?: (string|null); + + /** UrlMapsAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** UrlMapsAggregatedList selfLink */ + selfLink?: (string|null); + + /** UrlMapsAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** UrlMapsAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents an UrlMapsAggregatedList. */ + class UrlMapsAggregatedList implements IUrlMapsAggregatedList { + + /** + * Constructs a new UrlMapsAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapsAggregatedList); + + /** UrlMapsAggregatedList id. */ + public id?: (string|null); + + /** UrlMapsAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IUrlMapsScopedList }; + + /** UrlMapsAggregatedList kind. */ + public kind?: (string|null); + + /** UrlMapsAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** UrlMapsAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** UrlMapsAggregatedList unreachables. */ + public unreachables: string[]; + + /** UrlMapsAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** UrlMapsAggregatedList _id. */ + public _id?: "id"; + + /** UrlMapsAggregatedList _kind. */ + public _kind?: "kind"; + + /** UrlMapsAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** UrlMapsAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** UrlMapsAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new UrlMapsAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapsAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapsAggregatedList): google.cloud.compute.v1.UrlMapsAggregatedList; + + /** + * Encodes the specified UrlMapsAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsAggregatedList.verify|verify} messages. + * @param message UrlMapsAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapsAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapsAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsAggregatedList.verify|verify} messages. + * @param message UrlMapsAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapsAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapsAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapsAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapsAggregatedList; + + /** + * Decodes an UrlMapsAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapsAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapsAggregatedList; + + /** + * Verifies an UrlMapsAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapsAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapsAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapsAggregatedList; + + /** + * Creates a plain object from an UrlMapsAggregatedList message. Also converts values to other types if specified. + * @param message UrlMapsAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapsAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapsAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapsValidateRequest. */ + interface IUrlMapsValidateRequest { + + /** UrlMapsValidateRequest resource */ + resource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents an UrlMapsValidateRequest. */ + class UrlMapsValidateRequest implements IUrlMapsValidateRequest { + + /** + * Constructs a new UrlMapsValidateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapsValidateRequest); + + /** UrlMapsValidateRequest resource. */ + public resource?: (google.cloud.compute.v1.IUrlMap|null); + + /** UrlMapsValidateRequest _resource. */ + public _resource?: "resource"; + + /** + * Creates a new UrlMapsValidateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapsValidateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapsValidateRequest): google.cloud.compute.v1.UrlMapsValidateRequest; + + /** + * Encodes the specified UrlMapsValidateRequest message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateRequest.verify|verify} messages. + * @param message UrlMapsValidateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapsValidateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapsValidateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateRequest.verify|verify} messages. + * @param message UrlMapsValidateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapsValidateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapsValidateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapsValidateRequest; + + /** + * Decodes an UrlMapsValidateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapsValidateRequest; + + /** + * Verifies an UrlMapsValidateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapsValidateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapsValidateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapsValidateRequest; + + /** + * Creates a plain object from an UrlMapsValidateRequest message. Also converts values to other types if specified. + * @param message UrlMapsValidateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapsValidateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapsValidateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UrlMapsValidateResponse. */ + interface IUrlMapsValidateResponse { + + /** UrlMapsValidateResponse result */ + result?: (google.cloud.compute.v1.IUrlMapValidationResult|null); + } + + /** Represents an UrlMapsValidateResponse. */ + class UrlMapsValidateResponse implements IUrlMapsValidateResponse { + + /** + * Constructs a new UrlMapsValidateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUrlMapsValidateResponse); + + /** UrlMapsValidateResponse result. */ + public result?: (google.cloud.compute.v1.IUrlMapValidationResult|null); + + /** UrlMapsValidateResponse _result. */ + public _result?: "result"; + + /** + * Creates a new UrlMapsValidateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns UrlMapsValidateResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IUrlMapsValidateResponse): google.cloud.compute.v1.UrlMapsValidateResponse; + + /** + * Encodes the specified UrlMapsValidateResponse message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateResponse.verify|verify} messages. + * @param message UrlMapsValidateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUrlMapsValidateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UrlMapsValidateResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateResponse.verify|verify} messages. + * @param message UrlMapsValidateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUrlMapsValidateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UrlMapsValidateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UrlMapsValidateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UrlMapsValidateResponse; + + /** + * Decodes an UrlMapsValidateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UrlMapsValidateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UrlMapsValidateResponse; + + /** + * Verifies an UrlMapsValidateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UrlMapsValidateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UrlMapsValidateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UrlMapsValidateResponse; + + /** + * Creates a plain object from an UrlMapsValidateResponse message. Also converts values to other types if specified. + * @param message UrlMapsValidateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UrlMapsValidateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UrlMapsValidateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UsableSubnetworkSecondaryRange. */ + interface IUsableSubnetworkSecondaryRange { + + /** UsableSubnetworkSecondaryRange ipCidrRange */ + ipCidrRange?: (string|null); + + /** UsableSubnetworkSecondaryRange rangeName */ + rangeName?: (string|null); + } + + /** Represents a UsableSubnetworkSecondaryRange. */ + class UsableSubnetworkSecondaryRange implements IUsableSubnetworkSecondaryRange { + + /** + * Constructs a new UsableSubnetworkSecondaryRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUsableSubnetworkSecondaryRange); + + /** UsableSubnetworkSecondaryRange ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** UsableSubnetworkSecondaryRange rangeName. */ + public rangeName?: (string|null); + + /** UsableSubnetworkSecondaryRange _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** UsableSubnetworkSecondaryRange _rangeName. */ + public _rangeName?: "rangeName"; + + /** + * Creates a new UsableSubnetworkSecondaryRange instance using the specified properties. + * @param [properties] Properties to set + * @returns UsableSubnetworkSecondaryRange instance + */ + public static create(properties?: google.cloud.compute.v1.IUsableSubnetworkSecondaryRange): google.cloud.compute.v1.UsableSubnetworkSecondaryRange; + + /** + * Encodes the specified UsableSubnetworkSecondaryRange message. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworkSecondaryRange.verify|verify} messages. + * @param message UsableSubnetworkSecondaryRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUsableSubnetworkSecondaryRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsableSubnetworkSecondaryRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworkSecondaryRange.verify|verify} messages. + * @param message UsableSubnetworkSecondaryRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUsableSubnetworkSecondaryRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsableSubnetworkSecondaryRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsableSubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UsableSubnetworkSecondaryRange; + + /** + * Decodes a UsableSubnetworkSecondaryRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsableSubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UsableSubnetworkSecondaryRange; + + /** + * Verifies a UsableSubnetworkSecondaryRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsableSubnetworkSecondaryRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsableSubnetworkSecondaryRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UsableSubnetworkSecondaryRange; + + /** + * Creates a plain object from a UsableSubnetworkSecondaryRange message. Also converts values to other types if specified. + * @param message UsableSubnetworkSecondaryRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UsableSubnetworkSecondaryRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsableSubnetworkSecondaryRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UsableSubnetwork. */ + interface IUsableSubnetwork { + + /** UsableSubnetwork ipCidrRange */ + ipCidrRange?: (string|null); + + /** UsableSubnetwork network */ + network?: (string|null); + + /** UsableSubnetwork secondaryIpRanges */ + secondaryIpRanges?: (google.cloud.compute.v1.IUsableSubnetworkSecondaryRange[]|null); + + /** UsableSubnetwork subnetwork */ + subnetwork?: (string|null); + } + + /** Represents a UsableSubnetwork. */ + class UsableSubnetwork implements IUsableSubnetwork { + + /** + * Constructs a new UsableSubnetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUsableSubnetwork); + + /** UsableSubnetwork ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** UsableSubnetwork network. */ + public network?: (string|null); + + /** UsableSubnetwork secondaryIpRanges. */ + public secondaryIpRanges: google.cloud.compute.v1.IUsableSubnetworkSecondaryRange[]; + + /** UsableSubnetwork subnetwork. */ + public subnetwork?: (string|null); + + /** UsableSubnetwork _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** UsableSubnetwork _network. */ + public _network?: "network"; + + /** UsableSubnetwork _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** + * Creates a new UsableSubnetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns UsableSubnetwork instance + */ + public static create(properties?: google.cloud.compute.v1.IUsableSubnetwork): google.cloud.compute.v1.UsableSubnetwork; + + /** + * Encodes the specified UsableSubnetwork message. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetwork.verify|verify} messages. + * @param message UsableSubnetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUsableSubnetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsableSubnetwork message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetwork.verify|verify} messages. + * @param message UsableSubnetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUsableSubnetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsableSubnetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsableSubnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UsableSubnetwork; + + /** + * Decodes a UsableSubnetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsableSubnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UsableSubnetwork; + + /** + * Verifies a UsableSubnetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsableSubnetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsableSubnetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UsableSubnetwork; + + /** + * Creates a plain object from a UsableSubnetwork message. Also converts values to other types if specified. + * @param message UsableSubnetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UsableSubnetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsableSubnetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UsableSubnetworksAggregatedList. */ + interface IUsableSubnetworksAggregatedList { + + /** UsableSubnetworksAggregatedList id */ + id?: (string|null); + + /** UsableSubnetworksAggregatedList items */ + items?: (google.cloud.compute.v1.IUsableSubnetwork[]|null); + + /** UsableSubnetworksAggregatedList kind */ + kind?: (string|null); + + /** UsableSubnetworksAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** UsableSubnetworksAggregatedList selfLink */ + selfLink?: (string|null); + + /** UsableSubnetworksAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a UsableSubnetworksAggregatedList. */ + class UsableSubnetworksAggregatedList implements IUsableSubnetworksAggregatedList { + + /** + * Constructs a new UsableSubnetworksAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUsableSubnetworksAggregatedList); + + /** UsableSubnetworksAggregatedList id. */ + public id?: (string|null); + + /** UsableSubnetworksAggregatedList items. */ + public items: google.cloud.compute.v1.IUsableSubnetwork[]; + + /** UsableSubnetworksAggregatedList kind. */ + public kind?: (string|null); + + /** UsableSubnetworksAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** UsableSubnetworksAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** UsableSubnetworksAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** UsableSubnetworksAggregatedList _id. */ + public _id?: "id"; + + /** UsableSubnetworksAggregatedList _kind. */ + public _kind?: "kind"; + + /** UsableSubnetworksAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** UsableSubnetworksAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** UsableSubnetworksAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new UsableSubnetworksAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns UsableSubnetworksAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IUsableSubnetworksAggregatedList): google.cloud.compute.v1.UsableSubnetworksAggregatedList; + + /** + * Encodes the specified UsableSubnetworksAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworksAggregatedList.verify|verify} messages. + * @param message UsableSubnetworksAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUsableSubnetworksAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsableSubnetworksAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworksAggregatedList.verify|verify} messages. + * @param message UsableSubnetworksAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUsableSubnetworksAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsableSubnetworksAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsableSubnetworksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UsableSubnetworksAggregatedList; + + /** + * Decodes a UsableSubnetworksAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsableSubnetworksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UsableSubnetworksAggregatedList; + + /** + * Verifies a UsableSubnetworksAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsableSubnetworksAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsableSubnetworksAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UsableSubnetworksAggregatedList; + + /** + * Creates a plain object from a UsableSubnetworksAggregatedList message. Also converts values to other types if specified. + * @param message UsableSubnetworksAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UsableSubnetworksAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsableSubnetworksAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VmEndpointNatMappingsInterfaceNatMappings. */ + interface IVmEndpointNatMappingsInterfaceNatMappings { + + /** VmEndpointNatMappingsInterfaceNatMappings drainNatIpPortRanges */ + drainNatIpPortRanges?: (string[]|null); + + /** VmEndpointNatMappingsInterfaceNatMappings natIpPortRanges */ + natIpPortRanges?: (string[]|null); + + /** VmEndpointNatMappingsInterfaceNatMappings numTotalDrainNatPorts */ + numTotalDrainNatPorts?: (number|null); + + /** VmEndpointNatMappingsInterfaceNatMappings numTotalNatPorts */ + numTotalNatPorts?: (number|null); + + /** VmEndpointNatMappingsInterfaceNatMappings sourceAliasIpRange */ + sourceAliasIpRange?: (string|null); + + /** VmEndpointNatMappingsInterfaceNatMappings sourceVirtualIp */ + sourceVirtualIp?: (string|null); + } + + /** Represents a VmEndpointNatMappingsInterfaceNatMappings. */ + class VmEndpointNatMappingsInterfaceNatMappings implements IVmEndpointNatMappingsInterfaceNatMappings { + + /** + * Constructs a new VmEndpointNatMappingsInterfaceNatMappings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings); + + /** VmEndpointNatMappingsInterfaceNatMappings drainNatIpPortRanges. */ + public drainNatIpPortRanges: string[]; + + /** VmEndpointNatMappingsInterfaceNatMappings natIpPortRanges. */ + public natIpPortRanges: string[]; + + /** VmEndpointNatMappingsInterfaceNatMappings numTotalDrainNatPorts. */ + public numTotalDrainNatPorts?: (number|null); + + /** VmEndpointNatMappingsInterfaceNatMappings numTotalNatPorts. */ + public numTotalNatPorts?: (number|null); + + /** VmEndpointNatMappingsInterfaceNatMappings sourceAliasIpRange. */ + public sourceAliasIpRange?: (string|null); + + /** VmEndpointNatMappingsInterfaceNatMappings sourceVirtualIp. */ + public sourceVirtualIp?: (string|null); + + /** VmEndpointNatMappingsInterfaceNatMappings _numTotalDrainNatPorts. */ + public _numTotalDrainNatPorts?: "numTotalDrainNatPorts"; + + /** VmEndpointNatMappingsInterfaceNatMappings _numTotalNatPorts. */ + public _numTotalNatPorts?: "numTotalNatPorts"; + + /** VmEndpointNatMappingsInterfaceNatMappings _sourceAliasIpRange. */ + public _sourceAliasIpRange?: "sourceAliasIpRange"; + + /** VmEndpointNatMappingsInterfaceNatMappings _sourceVirtualIp. */ + public _sourceVirtualIp?: "sourceVirtualIp"; + + /** + * Creates a new VmEndpointNatMappingsInterfaceNatMappings instance using the specified properties. + * @param [properties] Properties to set + * @returns VmEndpointNatMappingsInterfaceNatMappings instance + */ + public static create(properties?: google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings): google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings; + + /** + * Encodes the specified VmEndpointNatMappingsInterfaceNatMappings message. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.verify|verify} messages. + * @param message VmEndpointNatMappingsInterfaceNatMappings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmEndpointNatMappingsInterfaceNatMappings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.verify|verify} messages. + * @param message VmEndpointNatMappingsInterfaceNatMappings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmEndpointNatMappingsInterfaceNatMappings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmEndpointNatMappingsInterfaceNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings; + + /** + * Decodes a VmEndpointNatMappingsInterfaceNatMappings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmEndpointNatMappingsInterfaceNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings; + + /** + * Verifies a VmEndpointNatMappingsInterfaceNatMappings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmEndpointNatMappingsInterfaceNatMappings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmEndpointNatMappingsInterfaceNatMappings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings; + + /** + * Creates a plain object from a VmEndpointNatMappingsInterfaceNatMappings message. Also converts values to other types if specified. + * @param message VmEndpointNatMappingsInterfaceNatMappings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmEndpointNatMappingsInterfaceNatMappings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VmEndpointNatMappings. */ + interface IVmEndpointNatMappings { + + /** VmEndpointNatMappings instanceName */ + instanceName?: (string|null); + + /** VmEndpointNatMappings interfaceNatMappings */ + interfaceNatMappings?: (google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings[]|null); + } + + /** Represents a VmEndpointNatMappings. */ + class VmEndpointNatMappings implements IVmEndpointNatMappings { + + /** + * Constructs a new VmEndpointNatMappings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVmEndpointNatMappings); + + /** VmEndpointNatMappings instanceName. */ + public instanceName?: (string|null); + + /** VmEndpointNatMappings interfaceNatMappings. */ + public interfaceNatMappings: google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings[]; + + /** VmEndpointNatMappings _instanceName. */ + public _instanceName?: "instanceName"; + + /** + * Creates a new VmEndpointNatMappings instance using the specified properties. + * @param [properties] Properties to set + * @returns VmEndpointNatMappings instance + */ + public static create(properties?: google.cloud.compute.v1.IVmEndpointNatMappings): google.cloud.compute.v1.VmEndpointNatMappings; + + /** + * Encodes the specified VmEndpointNatMappings message. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappings.verify|verify} messages. + * @param message VmEndpointNatMappings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVmEndpointNatMappings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmEndpointNatMappings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappings.verify|verify} messages. + * @param message VmEndpointNatMappings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVmEndpointNatMappings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmEndpointNatMappings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmEndpointNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VmEndpointNatMappings; + + /** + * Decodes a VmEndpointNatMappings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmEndpointNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VmEndpointNatMappings; + + /** + * Verifies a VmEndpointNatMappings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmEndpointNatMappings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmEndpointNatMappings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VmEndpointNatMappings; + + /** + * Creates a plain object from a VmEndpointNatMappings message. Also converts values to other types if specified. + * @param message VmEndpointNatMappings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VmEndpointNatMappings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmEndpointNatMappings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VmEndpointNatMappingsList. */ + interface IVmEndpointNatMappingsList { + + /** VmEndpointNatMappingsList id */ + id?: (string|null); + + /** VmEndpointNatMappingsList kind */ + kind?: (string|null); + + /** VmEndpointNatMappingsList nextPageToken */ + nextPageToken?: (string|null); + + /** VmEndpointNatMappingsList result */ + result?: (google.cloud.compute.v1.IVmEndpointNatMappings[]|null); + + /** VmEndpointNatMappingsList selfLink */ + selfLink?: (string|null); + + /** VmEndpointNatMappingsList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a VmEndpointNatMappingsList. */ + class VmEndpointNatMappingsList implements IVmEndpointNatMappingsList { + + /** + * Constructs a new VmEndpointNatMappingsList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVmEndpointNatMappingsList); + + /** VmEndpointNatMappingsList id. */ + public id?: (string|null); + + /** VmEndpointNatMappingsList kind. */ + public kind?: (string|null); + + /** VmEndpointNatMappingsList nextPageToken. */ + public nextPageToken?: (string|null); + + /** VmEndpointNatMappingsList result. */ + public result: google.cloud.compute.v1.IVmEndpointNatMappings[]; + + /** VmEndpointNatMappingsList selfLink. */ + public selfLink?: (string|null); + + /** VmEndpointNatMappingsList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** VmEndpointNatMappingsList _id. */ + public _id?: "id"; + + /** VmEndpointNatMappingsList _kind. */ + public _kind?: "kind"; + + /** VmEndpointNatMappingsList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** VmEndpointNatMappingsList _selfLink. */ + public _selfLink?: "selfLink"; + + /** VmEndpointNatMappingsList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new VmEndpointNatMappingsList instance using the specified properties. + * @param [properties] Properties to set + * @returns VmEndpointNatMappingsList instance + */ + public static create(properties?: google.cloud.compute.v1.IVmEndpointNatMappingsList): google.cloud.compute.v1.VmEndpointNatMappingsList; + + /** + * Encodes the specified VmEndpointNatMappingsList message. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsList.verify|verify} messages. + * @param message VmEndpointNatMappingsList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVmEndpointNatMappingsList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmEndpointNatMappingsList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsList.verify|verify} messages. + * @param message VmEndpointNatMappingsList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVmEndpointNatMappingsList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmEndpointNatMappingsList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmEndpointNatMappingsList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VmEndpointNatMappingsList; + + /** + * Decodes a VmEndpointNatMappingsList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmEndpointNatMappingsList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VmEndpointNatMappingsList; + + /** + * Verifies a VmEndpointNatMappingsList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmEndpointNatMappingsList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmEndpointNatMappingsList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VmEndpointNatMappingsList; + + /** + * Creates a plain object from a VmEndpointNatMappingsList message. Also converts values to other types if specified. + * @param message VmEndpointNatMappingsList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VmEndpointNatMappingsList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmEndpointNatMappingsList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewayVpnGatewayInterface. */ + interface IVpnGatewayVpnGatewayInterface { + + /** VpnGatewayVpnGatewayInterface id */ + id?: (number|null); + + /** VpnGatewayVpnGatewayInterface interconnectAttachment */ + interconnectAttachment?: (string|null); + + /** VpnGatewayVpnGatewayInterface ipAddress */ + ipAddress?: (string|null); + } + + /** Represents a VpnGatewayVpnGatewayInterface. */ + class VpnGatewayVpnGatewayInterface implements IVpnGatewayVpnGatewayInterface { + + /** + * Constructs a new VpnGatewayVpnGatewayInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface); + + /** VpnGatewayVpnGatewayInterface id. */ + public id?: (number|null); + + /** VpnGatewayVpnGatewayInterface interconnectAttachment. */ + public interconnectAttachment?: (string|null); + + /** VpnGatewayVpnGatewayInterface ipAddress. */ + public ipAddress?: (string|null); + + /** VpnGatewayVpnGatewayInterface _id. */ + public _id?: "id"; + + /** VpnGatewayVpnGatewayInterface _interconnectAttachment. */ + public _interconnectAttachment?: "interconnectAttachment"; + + /** VpnGatewayVpnGatewayInterface _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** + * Creates a new VpnGatewayVpnGatewayInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewayVpnGatewayInterface instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface): google.cloud.compute.v1.VpnGatewayVpnGatewayInterface; + + /** + * Encodes the specified VpnGatewayVpnGatewayInterface message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.verify|verify} messages. + * @param message VpnGatewayVpnGatewayInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewayVpnGatewayInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.verify|verify} messages. + * @param message VpnGatewayVpnGatewayInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewayVpnGatewayInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewayVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewayVpnGatewayInterface; + + /** + * Decodes a VpnGatewayVpnGatewayInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewayVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewayVpnGatewayInterface; + + /** + * Verifies a VpnGatewayVpnGatewayInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewayVpnGatewayInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewayVpnGatewayInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewayVpnGatewayInterface; + + /** + * Creates a plain object from a VpnGatewayVpnGatewayInterface message. Also converts values to other types if specified. + * @param message VpnGatewayVpnGatewayInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewayVpnGatewayInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewayVpnGatewayInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGateway. */ + interface IVpnGateway { + + /** VpnGateway creationTimestamp */ + creationTimestamp?: (string|null); + + /** VpnGateway description */ + description?: (string|null); + + /** VpnGateway id */ + id?: (number|Long|string|null); + + /** VpnGateway kind */ + kind?: (string|null); + + /** VpnGateway labelFingerprint */ + labelFingerprint?: (string|null); + + /** VpnGateway labels */ + labels?: ({ [k: string]: string }|null); + + /** VpnGateway name */ + name?: (string|null); + + /** VpnGateway network */ + network?: (string|null); + + /** VpnGateway region */ + region?: (string|null); + + /** VpnGateway selfLink */ + selfLink?: (string|null); + + /** VpnGateway vpnInterfaces */ + vpnInterfaces?: (google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface[]|null); + } + + /** Represents a VpnGateway. */ + class VpnGateway implements IVpnGateway { + + /** + * Constructs a new VpnGateway. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGateway); + + /** VpnGateway creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** VpnGateway description. */ + public description?: (string|null); + + /** VpnGateway id. */ + public id?: (number|Long|string|null); + + /** VpnGateway kind. */ + public kind?: (string|null); + + /** VpnGateway labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** VpnGateway labels. */ + public labels: { [k: string]: string }; + + /** VpnGateway name. */ + public name?: (string|null); + + /** VpnGateway network. */ + public network?: (string|null); + + /** VpnGateway region. */ + public region?: (string|null); + + /** VpnGateway selfLink. */ + public selfLink?: (string|null); + + /** VpnGateway vpnInterfaces. */ + public vpnInterfaces: google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface[]; + + /** VpnGateway _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** VpnGateway _description. */ + public _description?: "description"; + + /** VpnGateway _id. */ + public _id?: "id"; + + /** VpnGateway _kind. */ + public _kind?: "kind"; + + /** VpnGateway _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** VpnGateway _name. */ + public _name?: "name"; + + /** VpnGateway _network. */ + public _network?: "network"; + + /** VpnGateway _region. */ + public _region?: "region"; + + /** VpnGateway _selfLink. */ + public _selfLink?: "selfLink"; + + /** + * Creates a new VpnGateway instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGateway instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGateway): google.cloud.compute.v1.VpnGateway; + + /** + * Encodes the specified VpnGateway message. Does not implicitly {@link google.cloud.compute.v1.VpnGateway.verify|verify} messages. + * @param message VpnGateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGateway message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGateway.verify|verify} messages. + * @param message VpnGateway message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGateway, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGateway message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGateway; + + /** + * Decodes a VpnGateway message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGateway; + + /** + * Verifies a VpnGateway message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGateway message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGateway + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGateway; + + /** + * Creates a plain object from a VpnGateway message. Also converts values to other types if specified. + * @param message VpnGateway + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGateway, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGateway to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewaysScopedList. */ + interface IVpnGatewaysScopedList { + + /** VpnGatewaysScopedList vpnGateways */ + vpnGateways?: (google.cloud.compute.v1.IVpnGateway[]|null); + + /** VpnGatewaysScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a VpnGatewaysScopedList. */ + class VpnGatewaysScopedList implements IVpnGatewaysScopedList { + + /** + * Constructs a new VpnGatewaysScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewaysScopedList); + + /** VpnGatewaysScopedList vpnGateways. */ + public vpnGateways: google.cloud.compute.v1.IVpnGateway[]; + + /** VpnGatewaysScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** VpnGatewaysScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new VpnGatewaysScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewaysScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewaysScopedList): google.cloud.compute.v1.VpnGatewaysScopedList; + + /** + * Encodes the specified VpnGatewaysScopedList message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysScopedList.verify|verify} messages. + * @param message VpnGatewaysScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewaysScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewaysScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysScopedList.verify|verify} messages. + * @param message VpnGatewaysScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewaysScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewaysScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewaysScopedList; + + /** + * Decodes a VpnGatewaysScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewaysScopedList; + + /** + * Verifies a VpnGatewaysScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewaysScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewaysScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewaysScopedList; + + /** + * Creates a plain object from a VpnGatewaysScopedList message. Also converts values to other types if specified. + * @param message VpnGatewaysScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewaysScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewaysScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewayAggregatedList. */ + interface IVpnGatewayAggregatedList { + + /** VpnGatewayAggregatedList id */ + id?: (string|null); + + /** VpnGatewayAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IVpnGatewaysScopedList }|null); + + /** VpnGatewayAggregatedList kind */ + kind?: (string|null); + + /** VpnGatewayAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** VpnGatewayAggregatedList selfLink */ + selfLink?: (string|null); + + /** VpnGatewayAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** VpnGatewayAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a VpnGatewayAggregatedList. */ + class VpnGatewayAggregatedList implements IVpnGatewayAggregatedList { + + /** + * Constructs a new VpnGatewayAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewayAggregatedList); + + /** VpnGatewayAggregatedList id. */ + public id?: (string|null); + + /** VpnGatewayAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IVpnGatewaysScopedList }; + + /** VpnGatewayAggregatedList kind. */ + public kind?: (string|null); + + /** VpnGatewayAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** VpnGatewayAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** VpnGatewayAggregatedList unreachables. */ + public unreachables: string[]; + + /** VpnGatewayAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** VpnGatewayAggregatedList _id. */ + public _id?: "id"; + + /** VpnGatewayAggregatedList _kind. */ + public _kind?: "kind"; + + /** VpnGatewayAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** VpnGatewayAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** VpnGatewayAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new VpnGatewayAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewayAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewayAggregatedList): google.cloud.compute.v1.VpnGatewayAggregatedList; + + /** + * Encodes the specified VpnGatewayAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayAggregatedList.verify|verify} messages. + * @param message VpnGatewayAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewayAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewayAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayAggregatedList.verify|verify} messages. + * @param message VpnGatewayAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewayAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewayAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewayAggregatedList; + + /** + * Decodes a VpnGatewayAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewayAggregatedList; + + /** + * Verifies a VpnGatewayAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewayAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewayAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewayAggregatedList; + + /** + * Creates a plain object from a VpnGatewayAggregatedList message. Also converts values to other types if specified. + * @param message VpnGatewayAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewayAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewayAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewayList. */ + interface IVpnGatewayList { + + /** VpnGatewayList id */ + id?: (string|null); + + /** VpnGatewayList items */ + items?: (google.cloud.compute.v1.IVpnGateway[]|null); + + /** VpnGatewayList kind */ + kind?: (string|null); + + /** VpnGatewayList nextPageToken */ + nextPageToken?: (string|null); + + /** VpnGatewayList selfLink */ + selfLink?: (string|null); + + /** VpnGatewayList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a VpnGatewayList. */ + class VpnGatewayList implements IVpnGatewayList { + + /** + * Constructs a new VpnGatewayList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewayList); + + /** VpnGatewayList id. */ + public id?: (string|null); + + /** VpnGatewayList items. */ + public items: google.cloud.compute.v1.IVpnGateway[]; + + /** VpnGatewayList kind. */ + public kind?: (string|null); + + /** VpnGatewayList nextPageToken. */ + public nextPageToken?: (string|null); + + /** VpnGatewayList selfLink. */ + public selfLink?: (string|null); + + /** VpnGatewayList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** VpnGatewayList _id. */ + public _id?: "id"; + + /** VpnGatewayList _kind. */ + public _kind?: "kind"; + + /** VpnGatewayList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** VpnGatewayList _selfLink. */ + public _selfLink?: "selfLink"; + + /** VpnGatewayList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new VpnGatewayList instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewayList instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewayList): google.cloud.compute.v1.VpnGatewayList; + + /** + * Encodes the specified VpnGatewayList message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayList.verify|verify} messages. + * @param message VpnGatewayList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewayList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewayList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayList.verify|verify} messages. + * @param message VpnGatewayList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewayList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewayList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewayList; + + /** + * Decodes a VpnGatewayList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewayList; + + /** + * Verifies a VpnGatewayList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewayList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewayList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewayList; + + /** + * Creates a plain object from a VpnGatewayList message. Also converts values to other types if specified. + * @param message VpnGatewayList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewayList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewayList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewayStatusVpnConnection. */ + interface IVpnGatewayStatusVpnConnection { + + /** VpnGatewayStatusVpnConnection peerExternalGateway */ + peerExternalGateway?: (string|null); + + /** VpnGatewayStatusVpnConnection peerGcpGateway */ + peerGcpGateway?: (string|null); + + /** VpnGatewayStatusVpnConnection state */ + state?: (google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState|null); + + /** VpnGatewayStatusVpnConnection tunnels */ + tunnels?: (google.cloud.compute.v1.IVpnGatewayStatusTunnel[]|null); + } + + /** Represents a VpnGatewayStatusVpnConnection. */ + class VpnGatewayStatusVpnConnection implements IVpnGatewayStatusVpnConnection { + + /** + * Constructs a new VpnGatewayStatusVpnConnection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewayStatusVpnConnection); + + /** VpnGatewayStatusVpnConnection peerExternalGateway. */ + public peerExternalGateway?: (string|null); + + /** VpnGatewayStatusVpnConnection peerGcpGateway. */ + public peerGcpGateway?: (string|null); + + /** VpnGatewayStatusVpnConnection state. */ + public state?: (google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState|null); + + /** VpnGatewayStatusVpnConnection tunnels. */ + public tunnels: google.cloud.compute.v1.IVpnGatewayStatusTunnel[]; + + /** VpnGatewayStatusVpnConnection _peerExternalGateway. */ + public _peerExternalGateway?: "peerExternalGateway"; + + /** VpnGatewayStatusVpnConnection _peerGcpGateway. */ + public _peerGcpGateway?: "peerGcpGateway"; + + /** VpnGatewayStatusVpnConnection _state. */ + public _state?: "state"; + + /** + * Creates a new VpnGatewayStatusVpnConnection instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewayStatusVpnConnection instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewayStatusVpnConnection): google.cloud.compute.v1.VpnGatewayStatusVpnConnection; + + /** + * Encodes the specified VpnGatewayStatusVpnConnection message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusVpnConnection.verify|verify} messages. + * @param message VpnGatewayStatusVpnConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewayStatusVpnConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewayStatusVpnConnection message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusVpnConnection.verify|verify} messages. + * @param message VpnGatewayStatusVpnConnection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewayStatusVpnConnection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewayStatusVpnConnection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewayStatusVpnConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewayStatusVpnConnection; + + /** + * Decodes a VpnGatewayStatusVpnConnection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewayStatusVpnConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewayStatusVpnConnection; + + /** + * Verifies a VpnGatewayStatusVpnConnection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewayStatusVpnConnection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewayStatusVpnConnection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewayStatusVpnConnection; + + /** + * Creates a plain object from a VpnGatewayStatusVpnConnection message. Also converts values to other types if specified. + * @param message VpnGatewayStatusVpnConnection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewayStatusVpnConnection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewayStatusVpnConnection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewayStatus. */ + interface IVpnGatewayStatus { + + /** VpnGatewayStatus vpnConnections */ + vpnConnections?: (google.cloud.compute.v1.IVpnGatewayStatusVpnConnection[]|null); + } + + /** Represents a VpnGatewayStatus. */ + class VpnGatewayStatus implements IVpnGatewayStatus { + + /** + * Constructs a new VpnGatewayStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewayStatus); + + /** VpnGatewayStatus vpnConnections. */ + public vpnConnections: google.cloud.compute.v1.IVpnGatewayStatusVpnConnection[]; + + /** + * Creates a new VpnGatewayStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewayStatus instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewayStatus): google.cloud.compute.v1.VpnGatewayStatus; + + /** + * Encodes the specified VpnGatewayStatus message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatus.verify|verify} messages. + * @param message VpnGatewayStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewayStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewayStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatus.verify|verify} messages. + * @param message VpnGatewayStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewayStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewayStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewayStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewayStatus; + + /** + * Decodes a VpnGatewayStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewayStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewayStatus; + + /** + * Verifies a VpnGatewayStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewayStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewayStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewayStatus; + + /** + * Creates a plain object from a VpnGatewayStatus message. Also converts values to other types if specified. + * @param message VpnGatewayStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewayStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewayStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewayStatusHighAvailabilityRequirementState. */ + interface IVpnGatewayStatusHighAvailabilityRequirementState { + + /** VpnGatewayStatusHighAvailabilityRequirementState state */ + state?: (google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State|keyof typeof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State|null); + + /** VpnGatewayStatusHighAvailabilityRequirementState unsatisfiedReason */ + unsatisfiedReason?: (google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason|keyof typeof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason|null); + } + + /** Represents a VpnGatewayStatusHighAvailabilityRequirementState. */ + class VpnGatewayStatusHighAvailabilityRequirementState implements IVpnGatewayStatusHighAvailabilityRequirementState { + + /** + * Constructs a new VpnGatewayStatusHighAvailabilityRequirementState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState); + + /** VpnGatewayStatusHighAvailabilityRequirementState state. */ + public state?: (google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State|keyof typeof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State|null); + + /** VpnGatewayStatusHighAvailabilityRequirementState unsatisfiedReason. */ + public unsatisfiedReason?: (google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason|keyof typeof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason|null); + + /** VpnGatewayStatusHighAvailabilityRequirementState _state. */ + public _state?: "state"; + + /** VpnGatewayStatusHighAvailabilityRequirementState _unsatisfiedReason. */ + public _unsatisfiedReason?: "unsatisfiedReason"; + + /** + * Creates a new VpnGatewayStatusHighAvailabilityRequirementState instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewayStatusHighAvailabilityRequirementState instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState): google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState; + + /** + * Encodes the specified VpnGatewayStatusHighAvailabilityRequirementState message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.verify|verify} messages. + * @param message VpnGatewayStatusHighAvailabilityRequirementState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewayStatusHighAvailabilityRequirementState message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.verify|verify} messages. + * @param message VpnGatewayStatusHighAvailabilityRequirementState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewayStatusHighAvailabilityRequirementState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewayStatusHighAvailabilityRequirementState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState; + + /** + * Decodes a VpnGatewayStatusHighAvailabilityRequirementState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewayStatusHighAvailabilityRequirementState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState; + + /** + * Verifies a VpnGatewayStatusHighAvailabilityRequirementState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewayStatusHighAvailabilityRequirementState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewayStatusHighAvailabilityRequirementState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState; + + /** + * Creates a plain object from a VpnGatewayStatusHighAvailabilityRequirementState message. Also converts values to other types if specified. + * @param message VpnGatewayStatusHighAvailabilityRequirementState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewayStatusHighAvailabilityRequirementState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace VpnGatewayStatusHighAvailabilityRequirementState { + + /** State enum. */ + enum State { + UNDEFINED_STATE = 0, + CONNECTION_REDUNDANCY_MET = 505242907, + CONNECTION_REDUNDANCY_NOT_MET = 511863311 + } + + /** UnsatisfiedReason enum. */ + enum UnsatisfiedReason { + UNDEFINED_UNSATISFIED_REASON = 0, + INCOMPLETE_TUNNELS_COVERAGE = 55917437 + } + } + + /** Properties of a VpnGatewayStatusTunnel. */ + interface IVpnGatewayStatusTunnel { + + /** VpnGatewayStatusTunnel localGatewayInterface */ + localGatewayInterface?: (number|null); + + /** VpnGatewayStatusTunnel peerGatewayInterface */ + peerGatewayInterface?: (number|null); + + /** VpnGatewayStatusTunnel tunnelUrl */ + tunnelUrl?: (string|null); + } + + /** Represents a VpnGatewayStatusTunnel. */ + class VpnGatewayStatusTunnel implements IVpnGatewayStatusTunnel { + + /** + * Constructs a new VpnGatewayStatusTunnel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewayStatusTunnel); + + /** VpnGatewayStatusTunnel localGatewayInterface. */ + public localGatewayInterface?: (number|null); + + /** VpnGatewayStatusTunnel peerGatewayInterface. */ + public peerGatewayInterface?: (number|null); + + /** VpnGatewayStatusTunnel tunnelUrl. */ + public tunnelUrl?: (string|null); + + /** VpnGatewayStatusTunnel _localGatewayInterface. */ + public _localGatewayInterface?: "localGatewayInterface"; + + /** VpnGatewayStatusTunnel _peerGatewayInterface. */ + public _peerGatewayInterface?: "peerGatewayInterface"; + + /** VpnGatewayStatusTunnel _tunnelUrl. */ + public _tunnelUrl?: "tunnelUrl"; + + /** + * Creates a new VpnGatewayStatusTunnel instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewayStatusTunnel instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewayStatusTunnel): google.cloud.compute.v1.VpnGatewayStatusTunnel; + + /** + * Encodes the specified VpnGatewayStatusTunnel message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusTunnel.verify|verify} messages. + * @param message VpnGatewayStatusTunnel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewayStatusTunnel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewayStatusTunnel message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusTunnel.verify|verify} messages. + * @param message VpnGatewayStatusTunnel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewayStatusTunnel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewayStatusTunnel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewayStatusTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewayStatusTunnel; + + /** + * Decodes a VpnGatewayStatusTunnel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewayStatusTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewayStatusTunnel; + + /** + * Verifies a VpnGatewayStatusTunnel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewayStatusTunnel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewayStatusTunnel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewayStatusTunnel; + + /** + * Creates a plain object from a VpnGatewayStatusTunnel message. Also converts values to other types if specified. + * @param message VpnGatewayStatusTunnel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewayStatusTunnel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewayStatusTunnel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnGatewaysGetStatusResponse. */ + interface IVpnGatewaysGetStatusResponse { + + /** VpnGatewaysGetStatusResponse result */ + result?: (google.cloud.compute.v1.IVpnGatewayStatus|null); + } + + /** Represents a VpnGatewaysGetStatusResponse. */ + class VpnGatewaysGetStatusResponse implements IVpnGatewaysGetStatusResponse { + + /** + * Constructs a new VpnGatewaysGetStatusResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnGatewaysGetStatusResponse); + + /** VpnGatewaysGetStatusResponse result. */ + public result?: (google.cloud.compute.v1.IVpnGatewayStatus|null); + + /** VpnGatewaysGetStatusResponse _result. */ + public _result?: "result"; + + /** + * Creates a new VpnGatewaysGetStatusResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnGatewaysGetStatusResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnGatewaysGetStatusResponse): google.cloud.compute.v1.VpnGatewaysGetStatusResponse; + + /** + * Encodes the specified VpnGatewaysGetStatusResponse message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysGetStatusResponse.verify|verify} messages. + * @param message VpnGatewaysGetStatusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnGatewaysGetStatusResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysGetStatusResponse.verify|verify} messages. + * @param message VpnGatewaysGetStatusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnGatewaysGetStatusResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnGatewaysGetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnGatewaysGetStatusResponse; + + /** + * Decodes a VpnGatewaysGetStatusResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnGatewaysGetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnGatewaysGetStatusResponse; + + /** + * Verifies a VpnGatewaysGetStatusResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnGatewaysGetStatusResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnGatewaysGetStatusResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnGatewaysGetStatusResponse; + + /** + * Creates a plain object from a VpnGatewaysGetStatusResponse message. Also converts values to other types if specified. + * @param message VpnGatewaysGetStatusResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnGatewaysGetStatusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnGatewaysGetStatusResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnTunnel. */ + interface IVpnTunnel { + + /** VpnTunnel creationTimestamp */ + creationTimestamp?: (string|null); + + /** VpnTunnel description */ + description?: (string|null); + + /** VpnTunnel detailedStatus */ + detailedStatus?: (string|null); + + /** VpnTunnel id */ + id?: (number|Long|string|null); + + /** VpnTunnel ikeVersion */ + ikeVersion?: (number|null); + + /** VpnTunnel kind */ + kind?: (string|null); + + /** VpnTunnel localTrafficSelector */ + localTrafficSelector?: (string[]|null); + + /** VpnTunnel name */ + name?: (string|null); + + /** VpnTunnel peerExternalGateway */ + peerExternalGateway?: (string|null); + + /** VpnTunnel peerExternalGatewayInterface */ + peerExternalGatewayInterface?: (number|null); + + /** VpnTunnel peerGcpGateway */ + peerGcpGateway?: (string|null); + + /** VpnTunnel peerIp */ + peerIp?: (string|null); + + /** VpnTunnel region */ + region?: (string|null); + + /** VpnTunnel remoteTrafficSelector */ + remoteTrafficSelector?: (string[]|null); + + /** VpnTunnel router */ + router?: (string|null); + + /** VpnTunnel selfLink */ + selfLink?: (string|null); + + /** VpnTunnel sharedSecret */ + sharedSecret?: (string|null); + + /** VpnTunnel sharedSecretHash */ + sharedSecretHash?: (string|null); + + /** VpnTunnel status */ + status?: (google.cloud.compute.v1.VpnTunnel.Status|keyof typeof google.cloud.compute.v1.VpnTunnel.Status|null); + + /** VpnTunnel targetVpnGateway */ + targetVpnGateway?: (string|null); + + /** VpnTunnel vpnGateway */ + vpnGateway?: (string|null); + + /** VpnTunnel vpnGatewayInterface */ + vpnGatewayInterface?: (number|null); + } + + /** Represents a VpnTunnel. */ + class VpnTunnel implements IVpnTunnel { + + /** + * Constructs a new VpnTunnel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnTunnel); + + /** VpnTunnel creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** VpnTunnel description. */ + public description?: (string|null); + + /** VpnTunnel detailedStatus. */ + public detailedStatus?: (string|null); + + /** VpnTunnel id. */ + public id?: (number|Long|string|null); + + /** VpnTunnel ikeVersion. */ + public ikeVersion?: (number|null); + + /** VpnTunnel kind. */ + public kind?: (string|null); + + /** VpnTunnel localTrafficSelector. */ + public localTrafficSelector: string[]; + + /** VpnTunnel name. */ + public name?: (string|null); + + /** VpnTunnel peerExternalGateway. */ + public peerExternalGateway?: (string|null); + + /** VpnTunnel peerExternalGatewayInterface. */ + public peerExternalGatewayInterface?: (number|null); + + /** VpnTunnel peerGcpGateway. */ + public peerGcpGateway?: (string|null); + + /** VpnTunnel peerIp. */ + public peerIp?: (string|null); + + /** VpnTunnel region. */ + public region?: (string|null); + + /** VpnTunnel remoteTrafficSelector. */ + public remoteTrafficSelector: string[]; + + /** VpnTunnel router. */ + public router?: (string|null); + + /** VpnTunnel selfLink. */ + public selfLink?: (string|null); + + /** VpnTunnel sharedSecret. */ + public sharedSecret?: (string|null); + + /** VpnTunnel sharedSecretHash. */ + public sharedSecretHash?: (string|null); + + /** VpnTunnel status. */ + public status?: (google.cloud.compute.v1.VpnTunnel.Status|keyof typeof google.cloud.compute.v1.VpnTunnel.Status|null); + + /** VpnTunnel targetVpnGateway. */ + public targetVpnGateway?: (string|null); + + /** VpnTunnel vpnGateway. */ + public vpnGateway?: (string|null); + + /** VpnTunnel vpnGatewayInterface. */ + public vpnGatewayInterface?: (number|null); + + /** VpnTunnel _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** VpnTunnel _description. */ + public _description?: "description"; + + /** VpnTunnel _detailedStatus. */ + public _detailedStatus?: "detailedStatus"; + + /** VpnTunnel _id. */ + public _id?: "id"; + + /** VpnTunnel _ikeVersion. */ + public _ikeVersion?: "ikeVersion"; + + /** VpnTunnel _kind. */ + public _kind?: "kind"; + + /** VpnTunnel _name. */ + public _name?: "name"; + + /** VpnTunnel _peerExternalGateway. */ + public _peerExternalGateway?: "peerExternalGateway"; + + /** VpnTunnel _peerExternalGatewayInterface. */ + public _peerExternalGatewayInterface?: "peerExternalGatewayInterface"; + + /** VpnTunnel _peerGcpGateway. */ + public _peerGcpGateway?: "peerGcpGateway"; + + /** VpnTunnel _peerIp. */ + public _peerIp?: "peerIp"; + + /** VpnTunnel _region. */ + public _region?: "region"; + + /** VpnTunnel _router. */ + public _router?: "router"; + + /** VpnTunnel _selfLink. */ + public _selfLink?: "selfLink"; + + /** VpnTunnel _sharedSecret. */ + public _sharedSecret?: "sharedSecret"; + + /** VpnTunnel _sharedSecretHash. */ + public _sharedSecretHash?: "sharedSecretHash"; + + /** VpnTunnel _status. */ + public _status?: "status"; + + /** VpnTunnel _targetVpnGateway. */ + public _targetVpnGateway?: "targetVpnGateway"; + + /** VpnTunnel _vpnGateway. */ + public _vpnGateway?: "vpnGateway"; + + /** VpnTunnel _vpnGatewayInterface. */ + public _vpnGatewayInterface?: "vpnGatewayInterface"; + + /** + * Creates a new VpnTunnel instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnTunnel instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnTunnel): google.cloud.compute.v1.VpnTunnel; + + /** + * Encodes the specified VpnTunnel message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnel.verify|verify} messages. + * @param message VpnTunnel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnTunnel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnTunnel message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnel.verify|verify} messages. + * @param message VpnTunnel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnTunnel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnTunnel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnTunnel; + + /** + * Decodes a VpnTunnel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnTunnel; + + /** + * Verifies a VpnTunnel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnTunnel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnTunnel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnTunnel; + + /** + * Creates a plain object from a VpnTunnel message. Also converts values to other types if specified. + * @param message VpnTunnel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnTunnel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnTunnel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace VpnTunnel { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + ALLOCATING_RESOURCES = 320922816, + AUTHORIZATION_ERROR = 23580290, + DEPROVISIONING = 428935662, + ESTABLISHED = 88852344, + FAILED = 455706685, + FIRST_HANDSHAKE = 191393000, + NEGOTIATION_FAILURE = 360325868, + NETWORK_ERROR = 193912951, + NO_INCOMING_PACKETS = 119983216, + PROVISIONING = 290896621, + REJECTED = 174130302, + STOPPED = 444276141, + WAITING_FOR_FULL_CONFIG = 41640522 + } + } + + /** Properties of a VpnTunnelsScopedList. */ + interface IVpnTunnelsScopedList { + + /** VpnTunnelsScopedList vpnTunnels */ + vpnTunnels?: (google.cloud.compute.v1.IVpnTunnel[]|null); + + /** VpnTunnelsScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a VpnTunnelsScopedList. */ + class VpnTunnelsScopedList implements IVpnTunnelsScopedList { + + /** + * Constructs a new VpnTunnelsScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnTunnelsScopedList); + + /** VpnTunnelsScopedList vpnTunnels. */ + public vpnTunnels: google.cloud.compute.v1.IVpnTunnel[]; + + /** VpnTunnelsScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** VpnTunnelsScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new VpnTunnelsScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnTunnelsScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnTunnelsScopedList): google.cloud.compute.v1.VpnTunnelsScopedList; + + /** + * Encodes the specified VpnTunnelsScopedList message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelsScopedList.verify|verify} messages. + * @param message VpnTunnelsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnTunnelsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnTunnelsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelsScopedList.verify|verify} messages. + * @param message VpnTunnelsScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnTunnelsScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnTunnelsScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnTunnelsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnTunnelsScopedList; + + /** + * Decodes a VpnTunnelsScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnTunnelsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnTunnelsScopedList; + + /** + * Verifies a VpnTunnelsScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnTunnelsScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnTunnelsScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnTunnelsScopedList; + + /** + * Creates a plain object from a VpnTunnelsScopedList message. Also converts values to other types if specified. + * @param message VpnTunnelsScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnTunnelsScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnTunnelsScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnTunnelAggregatedList. */ + interface IVpnTunnelAggregatedList { + + /** VpnTunnelAggregatedList id */ + id?: (string|null); + + /** VpnTunnelAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IVpnTunnelsScopedList }|null); + + /** VpnTunnelAggregatedList kind */ + kind?: (string|null); + + /** VpnTunnelAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** VpnTunnelAggregatedList selfLink */ + selfLink?: (string|null); + + /** VpnTunnelAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** VpnTunnelAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a VpnTunnelAggregatedList. */ + class VpnTunnelAggregatedList implements IVpnTunnelAggregatedList { + + /** + * Constructs a new VpnTunnelAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnTunnelAggregatedList); + + /** VpnTunnelAggregatedList id. */ + public id?: (string|null); + + /** VpnTunnelAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IVpnTunnelsScopedList }; + + /** VpnTunnelAggregatedList kind. */ + public kind?: (string|null); + + /** VpnTunnelAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** VpnTunnelAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** VpnTunnelAggregatedList unreachables. */ + public unreachables: string[]; + + /** VpnTunnelAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** VpnTunnelAggregatedList _id. */ + public _id?: "id"; + + /** VpnTunnelAggregatedList _kind. */ + public _kind?: "kind"; + + /** VpnTunnelAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** VpnTunnelAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** VpnTunnelAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new VpnTunnelAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnTunnelAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnTunnelAggregatedList): google.cloud.compute.v1.VpnTunnelAggregatedList; + + /** + * Encodes the specified VpnTunnelAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelAggregatedList.verify|verify} messages. + * @param message VpnTunnelAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnTunnelAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnTunnelAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelAggregatedList.verify|verify} messages. + * @param message VpnTunnelAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnTunnelAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnTunnelAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnTunnelAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnTunnelAggregatedList; + + /** + * Decodes a VpnTunnelAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnTunnelAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnTunnelAggregatedList; + + /** + * Verifies a VpnTunnelAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnTunnelAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnTunnelAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnTunnelAggregatedList; + + /** + * Creates a plain object from a VpnTunnelAggregatedList message. Also converts values to other types if specified. + * @param message VpnTunnelAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnTunnelAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnTunnelAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VpnTunnelList. */ + interface IVpnTunnelList { + + /** VpnTunnelList id */ + id?: (string|null); + + /** VpnTunnelList items */ + items?: (google.cloud.compute.v1.IVpnTunnel[]|null); + + /** VpnTunnelList kind */ + kind?: (string|null); + + /** VpnTunnelList nextPageToken */ + nextPageToken?: (string|null); + + /** VpnTunnelList selfLink */ + selfLink?: (string|null); + + /** VpnTunnelList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a VpnTunnelList. */ + class VpnTunnelList implements IVpnTunnelList { + + /** + * Constructs a new VpnTunnelList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IVpnTunnelList); + + /** VpnTunnelList id. */ + public id?: (string|null); + + /** VpnTunnelList items. */ + public items: google.cloud.compute.v1.IVpnTunnel[]; + + /** VpnTunnelList kind. */ + public kind?: (string|null); + + /** VpnTunnelList nextPageToken. */ + public nextPageToken?: (string|null); + + /** VpnTunnelList selfLink. */ + public selfLink?: (string|null); + + /** VpnTunnelList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** VpnTunnelList _id. */ + public _id?: "id"; + + /** VpnTunnelList _kind. */ + public _kind?: "kind"; + + /** VpnTunnelList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** VpnTunnelList _selfLink. */ + public _selfLink?: "selfLink"; + + /** VpnTunnelList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new VpnTunnelList instance using the specified properties. + * @param [properties] Properties to set + * @returns VpnTunnelList instance + */ + public static create(properties?: google.cloud.compute.v1.IVpnTunnelList): google.cloud.compute.v1.VpnTunnelList; + + /** + * Encodes the specified VpnTunnelList message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelList.verify|verify} messages. + * @param message VpnTunnelList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IVpnTunnelList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpnTunnelList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelList.verify|verify} messages. + * @param message VpnTunnelList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IVpnTunnelList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpnTunnelList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpnTunnelList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.VpnTunnelList; + + /** + * Decodes a VpnTunnelList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpnTunnelList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.VpnTunnelList; + + /** + * Verifies a VpnTunnelList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpnTunnelList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpnTunnelList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.VpnTunnelList; + + /** + * Creates a plain object from a VpnTunnelList message. Also converts values to other types if specified. + * @param message VpnTunnelList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.VpnTunnelList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpnTunnelList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WafExpressionSetExpression. */ + interface IWafExpressionSetExpression { + + /** WafExpressionSetExpression id */ + id?: (string|null); + } + + /** Represents a WafExpressionSetExpression. */ + class WafExpressionSetExpression implements IWafExpressionSetExpression { + + /** + * Constructs a new WafExpressionSetExpression. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWafExpressionSetExpression); + + /** WafExpressionSetExpression id. */ + public id?: (string|null); + + /** WafExpressionSetExpression _id. */ + public _id?: "id"; + + /** + * Creates a new WafExpressionSetExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns WafExpressionSetExpression instance + */ + public static create(properties?: google.cloud.compute.v1.IWafExpressionSetExpression): google.cloud.compute.v1.WafExpressionSetExpression; + + /** + * Encodes the specified WafExpressionSetExpression message. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSetExpression.verify|verify} messages. + * @param message WafExpressionSetExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWafExpressionSetExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WafExpressionSetExpression message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSetExpression.verify|verify} messages. + * @param message WafExpressionSetExpression message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWafExpressionSetExpression, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WafExpressionSetExpression message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WafExpressionSetExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.WafExpressionSetExpression; + + /** + * Decodes a WafExpressionSetExpression message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WafExpressionSetExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.WafExpressionSetExpression; + + /** + * Verifies a WafExpressionSetExpression message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WafExpressionSetExpression message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WafExpressionSetExpression + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.WafExpressionSetExpression; + + /** + * Creates a plain object from a WafExpressionSetExpression message. Also converts values to other types if specified. + * @param message WafExpressionSetExpression + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.WafExpressionSetExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WafExpressionSetExpression to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a XpnHostList. */ + interface IXpnHostList { + + /** XpnHostList id */ + id?: (string|null); + + /** XpnHostList items */ + items?: (google.cloud.compute.v1.IProject[]|null); + + /** XpnHostList kind */ + kind?: (string|null); + + /** XpnHostList nextPageToken */ + nextPageToken?: (string|null); + + /** XpnHostList selfLink */ + selfLink?: (string|null); + + /** XpnHostList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a XpnHostList. */ + class XpnHostList implements IXpnHostList { + + /** + * Constructs a new XpnHostList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IXpnHostList); + + /** XpnHostList id. */ + public id?: (string|null); + + /** XpnHostList items. */ + public items: google.cloud.compute.v1.IProject[]; + + /** XpnHostList kind. */ + public kind?: (string|null); + + /** XpnHostList nextPageToken. */ + public nextPageToken?: (string|null); + + /** XpnHostList selfLink. */ + public selfLink?: (string|null); + + /** XpnHostList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** XpnHostList _id. */ + public _id?: "id"; + + /** XpnHostList _kind. */ + public _kind?: "kind"; + + /** XpnHostList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** XpnHostList _selfLink. */ + public _selfLink?: "selfLink"; + + /** XpnHostList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new XpnHostList instance using the specified properties. + * @param [properties] Properties to set + * @returns XpnHostList instance + */ + public static create(properties?: google.cloud.compute.v1.IXpnHostList): google.cloud.compute.v1.XpnHostList; + + /** + * Encodes the specified XpnHostList message. Does not implicitly {@link google.cloud.compute.v1.XpnHostList.verify|verify} messages. + * @param message XpnHostList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IXpnHostList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified XpnHostList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.XpnHostList.verify|verify} messages. + * @param message XpnHostList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IXpnHostList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a XpnHostList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns XpnHostList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.XpnHostList; + + /** + * Decodes a XpnHostList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns XpnHostList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.XpnHostList; + + /** + * Verifies a XpnHostList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a XpnHostList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns XpnHostList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.XpnHostList; + + /** + * Creates a plain object from a XpnHostList message. Also converts values to other types if specified. + * @param message XpnHostList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.XpnHostList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this XpnHostList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Zone. */ + interface IZone { + + /** Zone availableCpuPlatforms */ + availableCpuPlatforms?: (string[]|null); + + /** Zone creationTimestamp */ + creationTimestamp?: (string|null); + + /** Zone deprecated */ + deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** Zone description */ + description?: (string|null); + + /** Zone id */ + id?: (number|Long|string|null); + + /** Zone kind */ + kind?: (string|null); + + /** Zone name */ + name?: (string|null); + + /** Zone region */ + region?: (string|null); + + /** Zone selfLink */ + selfLink?: (string|null); + + /** Zone status */ + status?: (google.cloud.compute.v1.Zone.Status|keyof typeof google.cloud.compute.v1.Zone.Status|null); + + /** Zone supportsPzs */ + supportsPzs?: (boolean|null); + } + + /** Represents a Zone. */ + class Zone implements IZone { + + /** + * Constructs a new Zone. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IZone); + + /** Zone availableCpuPlatforms. */ + public availableCpuPlatforms: string[]; + + /** Zone creationTimestamp. */ + public creationTimestamp?: (string|null); + + /** Zone deprecated. */ + public deprecated?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** Zone description. */ + public description?: (string|null); + + /** Zone id. */ + public id?: (number|Long|string|null); + + /** Zone kind. */ + public kind?: (string|null); + + /** Zone name. */ + public name?: (string|null); + + /** Zone region. */ + public region?: (string|null); + + /** Zone selfLink. */ + public selfLink?: (string|null); + + /** Zone status. */ + public status?: (google.cloud.compute.v1.Zone.Status|keyof typeof google.cloud.compute.v1.Zone.Status|null); + + /** Zone supportsPzs. */ + public supportsPzs?: (boolean|null); + + /** Zone _creationTimestamp. */ + public _creationTimestamp?: "creationTimestamp"; + + /** Zone _deprecated. */ + public _deprecated?: "deprecated"; + + /** Zone _description. */ + public _description?: "description"; + + /** Zone _id. */ + public _id?: "id"; + + /** Zone _kind. */ + public _kind?: "kind"; + + /** Zone _name. */ + public _name?: "name"; + + /** Zone _region. */ + public _region?: "region"; + + /** Zone _selfLink. */ + public _selfLink?: "selfLink"; + + /** Zone _status. */ + public _status?: "status"; + + /** Zone _supportsPzs. */ + public _supportsPzs?: "supportsPzs"; + + /** + * Creates a new Zone instance using the specified properties. + * @param [properties] Properties to set + * @returns Zone instance + */ + public static create(properties?: google.cloud.compute.v1.IZone): google.cloud.compute.v1.Zone; + + /** + * Encodes the specified Zone message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IZone, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Zone message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.Zone, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Zone to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Zone { + + /** Status enum. */ + enum Status { + UNDEFINED_STATUS = 0, + DOWN = 2104482, + UP = 2715 + } + } + + /** Properties of a ZoneList. */ + interface IZoneList { + + /** ZoneList id */ + id?: (string|null); + + /** ZoneList items */ + items?: (google.cloud.compute.v1.IZone[]|null); + + /** ZoneList kind */ + kind?: (string|null); + + /** ZoneList nextPageToken */ + nextPageToken?: (string|null); + + /** ZoneList selfLink */ + selfLink?: (string|null); + + /** ZoneList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a ZoneList. */ + class ZoneList implements IZoneList { + + /** + * Constructs a new ZoneList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IZoneList); + + /** ZoneList id. */ + public id?: (string|null); + + /** ZoneList items. */ + public items: google.cloud.compute.v1.IZone[]; + + /** ZoneList kind. */ + public kind?: (string|null); + + /** ZoneList nextPageToken. */ + public nextPageToken?: (string|null); + + /** ZoneList selfLink. */ + public selfLink?: (string|null); + + /** ZoneList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** ZoneList _id. */ + public _id?: "id"; + + /** ZoneList _kind. */ + public _kind?: "kind"; + + /** ZoneList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** ZoneList _selfLink. */ + public _selfLink?: "selfLink"; + + /** ZoneList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new ZoneList instance using the specified properties. + * @param [properties] Properties to set + * @returns ZoneList instance + */ + public static create(properties?: google.cloud.compute.v1.IZoneList): google.cloud.compute.v1.ZoneList; + + /** + * Encodes the specified ZoneList message. Does not implicitly {@link google.cloud.compute.v1.ZoneList.verify|verify} messages. + * @param message ZoneList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IZoneList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZoneList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ZoneList.verify|verify} messages. + * @param message ZoneList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IZoneList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZoneList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZoneList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ZoneList; + + /** + * Decodes a ZoneList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZoneList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ZoneList; + + /** + * Verifies a ZoneList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZoneList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZoneList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ZoneList; + + /** + * Creates a plain object from a ZoneList message. Also converts values to other types if specified. + * @param message ZoneList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ZoneList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZoneList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ZoneSetLabelsRequest. */ + interface IZoneSetLabelsRequest { + + /** ZoneSetLabelsRequest labelFingerprint */ + labelFingerprint?: (string|null); + + /** ZoneSetLabelsRequest labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a ZoneSetLabelsRequest. */ + class ZoneSetLabelsRequest implements IZoneSetLabelsRequest { + + /** + * Constructs a new ZoneSetLabelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IZoneSetLabelsRequest); + + /** ZoneSetLabelsRequest labelFingerprint. */ + public labelFingerprint?: (string|null); + + /** ZoneSetLabelsRequest labels. */ + public labels: { [k: string]: string }; + + /** ZoneSetLabelsRequest _labelFingerprint. */ + public _labelFingerprint?: "labelFingerprint"; + + /** + * Creates a new ZoneSetLabelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ZoneSetLabelsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IZoneSetLabelsRequest): google.cloud.compute.v1.ZoneSetLabelsRequest; + + /** + * Encodes the specified ZoneSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.ZoneSetLabelsRequest.verify|verify} messages. + * @param message ZoneSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IZoneSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZoneSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ZoneSetLabelsRequest.verify|verify} messages. + * @param message ZoneSetLabelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IZoneSetLabelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZoneSetLabelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZoneSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ZoneSetLabelsRequest; + + /** + * Decodes a ZoneSetLabelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZoneSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ZoneSetLabelsRequest; + + /** + * Verifies a ZoneSetLabelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZoneSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZoneSetLabelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ZoneSetLabelsRequest; + + /** + * Creates a plain object from a ZoneSetLabelsRequest message. Also converts values to other types if specified. + * @param message ZoneSetLabelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ZoneSetLabelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZoneSetLabelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ZoneSetPolicyRequest. */ + interface IZoneSetPolicyRequest { + + /** ZoneSetPolicyRequest bindings */ + bindings?: (google.cloud.compute.v1.IBinding[]|null); + + /** ZoneSetPolicyRequest etag */ + etag?: (string|null); + + /** ZoneSetPolicyRequest policy */ + policy?: (google.cloud.compute.v1.IPolicy|null); + } + + /** Represents a ZoneSetPolicyRequest. */ + class ZoneSetPolicyRequest implements IZoneSetPolicyRequest { + + /** + * Constructs a new ZoneSetPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IZoneSetPolicyRequest); + + /** ZoneSetPolicyRequest bindings. */ + public bindings: google.cloud.compute.v1.IBinding[]; + + /** ZoneSetPolicyRequest etag. */ + public etag?: (string|null); + + /** ZoneSetPolicyRequest policy. */ + public policy?: (google.cloud.compute.v1.IPolicy|null); + + /** ZoneSetPolicyRequest _etag. */ + public _etag?: "etag"; + + /** ZoneSetPolicyRequest _policy. */ + public _policy?: "policy"; + + /** + * Creates a new ZoneSetPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ZoneSetPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IZoneSetPolicyRequest): google.cloud.compute.v1.ZoneSetPolicyRequest; + + /** + * Encodes the specified ZoneSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.ZoneSetPolicyRequest.verify|verify} messages. + * @param message ZoneSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IZoneSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZoneSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ZoneSetPolicyRequest.verify|verify} messages. + * @param message ZoneSetPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IZoneSetPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZoneSetPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZoneSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ZoneSetPolicyRequest; + + /** + * Decodes a ZoneSetPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZoneSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ZoneSetPolicyRequest; + + /** + * Verifies a ZoneSetPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ZoneSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZoneSetPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ZoneSetPolicyRequest; + + /** + * Creates a plain object from a ZoneSetPolicyRequest message. Also converts values to other types if specified. + * @param message ZoneSetPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ZoneSetPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZoneSetPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListAcceleratorTypesRequest. */ + interface IAggregatedListAcceleratorTypesRequest { + + /** AggregatedListAcceleratorTypesRequest filter */ + filter?: (string|null); + + /** AggregatedListAcceleratorTypesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListAcceleratorTypesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListAcceleratorTypesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListAcceleratorTypesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListAcceleratorTypesRequest project */ + project?: (string|null); + + /** AggregatedListAcceleratorTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListAcceleratorTypesRequest. */ + class AggregatedListAcceleratorTypesRequest implements IAggregatedListAcceleratorTypesRequest { + + /** + * Constructs a new AggregatedListAcceleratorTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest); + + /** AggregatedListAcceleratorTypesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListAcceleratorTypesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListAcceleratorTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListAcceleratorTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListAcceleratorTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListAcceleratorTypesRequest project. */ + public project: string; + + /** AggregatedListAcceleratorTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListAcceleratorTypesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListAcceleratorTypesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListAcceleratorTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListAcceleratorTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListAcceleratorTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListAcceleratorTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListAcceleratorTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListAcceleratorTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest): google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest; + + /** + * Encodes the specified AggregatedListAcceleratorTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest.verify|verify} messages. + * @param message AggregatedListAcceleratorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListAcceleratorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest.verify|verify} messages. + * @param message AggregatedListAcceleratorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListAcceleratorTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest; + + /** + * Decodes an AggregatedListAcceleratorTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest; + + /** + * Verifies an AggregatedListAcceleratorTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListAcceleratorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListAcceleratorTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest; + + /** + * Creates a plain object from an AggregatedListAcceleratorTypesRequest message. Also converts values to other types if specified. + * @param message AggregatedListAcceleratorTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListAcceleratorTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetAcceleratorTypeRequest. */ + interface IGetAcceleratorTypeRequest { + + /** GetAcceleratorTypeRequest acceleratorType */ + acceleratorType?: (string|null); + + /** GetAcceleratorTypeRequest project */ + project?: (string|null); + + /** GetAcceleratorTypeRequest zone */ + zone?: (string|null); + } + + /** Represents a GetAcceleratorTypeRequest. */ + class GetAcceleratorTypeRequest implements IGetAcceleratorTypeRequest { + + /** + * Constructs a new GetAcceleratorTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetAcceleratorTypeRequest); + + /** GetAcceleratorTypeRequest acceleratorType. */ + public acceleratorType: string; + + /** GetAcceleratorTypeRequest project. */ + public project: string; + + /** GetAcceleratorTypeRequest zone. */ + public zone: string; + + /** + * Creates a new GetAcceleratorTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAcceleratorTypeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetAcceleratorTypeRequest): google.cloud.compute.v1.GetAcceleratorTypeRequest; + + /** + * Encodes the specified GetAcceleratorTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAcceleratorTypeRequest.verify|verify} messages. + * @param message GetAcceleratorTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetAcceleratorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAcceleratorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAcceleratorTypeRequest.verify|verify} messages. + * @param message GetAcceleratorTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetAcceleratorTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAcceleratorTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAcceleratorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetAcceleratorTypeRequest; + + /** + * Decodes a GetAcceleratorTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAcceleratorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetAcceleratorTypeRequest; + + /** + * Verifies a GetAcceleratorTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAcceleratorTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAcceleratorTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetAcceleratorTypeRequest; + + /** + * Creates a plain object from a GetAcceleratorTypeRequest message. Also converts values to other types if specified. + * @param message GetAcceleratorTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetAcceleratorTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAcceleratorTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAcceleratorTypesRequest. */ + interface IListAcceleratorTypesRequest { + + /** ListAcceleratorTypesRequest filter */ + filter?: (string|null); + + /** ListAcceleratorTypesRequest maxResults */ + maxResults?: (number|null); + + /** ListAcceleratorTypesRequest orderBy */ + orderBy?: (string|null); + + /** ListAcceleratorTypesRequest pageToken */ + pageToken?: (string|null); + + /** ListAcceleratorTypesRequest project */ + project?: (string|null); + + /** ListAcceleratorTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListAcceleratorTypesRequest zone */ + zone?: (string|null); + } + + /** Represents a ListAcceleratorTypesRequest. */ + class ListAcceleratorTypesRequest implements IListAcceleratorTypesRequest { + + /** + * Constructs a new ListAcceleratorTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListAcceleratorTypesRequest); + + /** ListAcceleratorTypesRequest filter. */ + public filter?: (string|null); + + /** ListAcceleratorTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListAcceleratorTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListAcceleratorTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListAcceleratorTypesRequest project. */ + public project: string; + + /** ListAcceleratorTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListAcceleratorTypesRequest zone. */ + public zone: string; + + /** ListAcceleratorTypesRequest _filter. */ + public _filter?: "filter"; + + /** ListAcceleratorTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListAcceleratorTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListAcceleratorTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListAcceleratorTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListAcceleratorTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAcceleratorTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListAcceleratorTypesRequest): google.cloud.compute.v1.ListAcceleratorTypesRequest; + + /** + * Encodes the specified ListAcceleratorTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAcceleratorTypesRequest.verify|verify} messages. + * @param message ListAcceleratorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListAcceleratorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAcceleratorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAcceleratorTypesRequest.verify|verify} messages. + * @param message ListAcceleratorTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListAcceleratorTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAcceleratorTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListAcceleratorTypesRequest; + + /** + * Decodes a ListAcceleratorTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListAcceleratorTypesRequest; + + /** + * Verifies a ListAcceleratorTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAcceleratorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAcceleratorTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListAcceleratorTypesRequest; + + /** + * Creates a plain object from a ListAcceleratorTypesRequest message. Also converts values to other types if specified. + * @param message ListAcceleratorTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListAcceleratorTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAcceleratorTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListAddressesRequest. */ + interface IAggregatedListAddressesRequest { + + /** AggregatedListAddressesRequest filter */ + filter?: (string|null); + + /** AggregatedListAddressesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListAddressesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListAddressesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListAddressesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListAddressesRequest project */ + project?: (string|null); + + /** AggregatedListAddressesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListAddressesRequest. */ + class AggregatedListAddressesRequest implements IAggregatedListAddressesRequest { + + /** + * Constructs a new AggregatedListAddressesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListAddressesRequest); + + /** AggregatedListAddressesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListAddressesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListAddressesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListAddressesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListAddressesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListAddressesRequest project. */ + public project: string; + + /** AggregatedListAddressesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListAddressesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListAddressesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListAddressesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListAddressesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListAddressesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListAddressesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListAddressesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListAddressesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListAddressesRequest): google.cloud.compute.v1.AggregatedListAddressesRequest; + + /** + * Encodes the specified AggregatedListAddressesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAddressesRequest.verify|verify} messages. + * @param message AggregatedListAddressesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListAddressesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListAddressesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAddressesRequest.verify|verify} messages. + * @param message AggregatedListAddressesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListAddressesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListAddressesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListAddressesRequest; + + /** + * Decodes an AggregatedListAddressesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListAddressesRequest; + + /** + * Verifies an AggregatedListAddressesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListAddressesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListAddressesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListAddressesRequest; + + /** + * Creates a plain object from an AggregatedListAddressesRequest message. Also converts values to other types if specified. + * @param message AggregatedListAddressesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListAddressesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListAddressesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteAddressRequest. */ + interface IDeleteAddressRequest { + + /** DeleteAddressRequest address */ + address?: (string|null); + + /** DeleteAddressRequest project */ + project?: (string|null); + + /** DeleteAddressRequest region */ + region?: (string|null); + + /** DeleteAddressRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteAddressRequest. */ + class DeleteAddressRequest implements IDeleteAddressRequest { + + /** + * Constructs a new DeleteAddressRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteAddressRequest); + + /** DeleteAddressRequest address. */ + public address: string; + + /** DeleteAddressRequest project. */ + public project: string; + + /** DeleteAddressRequest region. */ + public region: string; + + /** DeleteAddressRequest requestId. */ + public requestId?: (string|null); + + /** DeleteAddressRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteAddressRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAddressRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteAddressRequest): google.cloud.compute.v1.DeleteAddressRequest; + + /** + * Encodes the specified DeleteAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteAddressRequest.verify|verify} messages. + * @param message DeleteAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteAddressRequest.verify|verify} messages. + * @param message DeleteAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAddressRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteAddressRequest; + + /** + * Decodes a DeleteAddressRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteAddressRequest; + + /** + * Verifies a DeleteAddressRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAddressRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAddressRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteAddressRequest; + + /** + * Creates a plain object from a DeleteAddressRequest message. Also converts values to other types if specified. + * @param message DeleteAddressRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAddressRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetAddressRequest. */ + interface IGetAddressRequest { + + /** GetAddressRequest address */ + address?: (string|null); + + /** GetAddressRequest project */ + project?: (string|null); + + /** GetAddressRequest region */ + region?: (string|null); + } + + /** Represents a GetAddressRequest. */ + class GetAddressRequest implements IGetAddressRequest { + + /** + * Constructs a new GetAddressRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetAddressRequest); + + /** GetAddressRequest address. */ + public address: string; + + /** GetAddressRequest project. */ + public project: string; + + /** GetAddressRequest region. */ + public region: string; + + /** + * Creates a new GetAddressRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAddressRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetAddressRequest): google.cloud.compute.v1.GetAddressRequest; + + /** + * Encodes the specified GetAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAddressRequest.verify|verify} messages. + * @param message GetAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAddressRequest.verify|verify} messages. + * @param message GetAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAddressRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetAddressRequest; + + /** + * Decodes a GetAddressRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetAddressRequest; + + /** + * Verifies a GetAddressRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAddressRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAddressRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetAddressRequest; + + /** + * Creates a plain object from a GetAddressRequest message. Also converts values to other types if specified. + * @param message GetAddressRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAddressRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertAddressRequest. */ + interface IInsertAddressRequest { + + /** InsertAddressRequest addressResource */ + addressResource?: (google.cloud.compute.v1.IAddress|null); + + /** InsertAddressRequest project */ + project?: (string|null); + + /** InsertAddressRequest region */ + region?: (string|null); + + /** InsertAddressRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertAddressRequest. */ + class InsertAddressRequest implements IInsertAddressRequest { + + /** + * Constructs a new InsertAddressRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertAddressRequest); + + /** InsertAddressRequest addressResource. */ + public addressResource?: (google.cloud.compute.v1.IAddress|null); + + /** InsertAddressRequest project. */ + public project: string; + + /** InsertAddressRequest region. */ + public region: string; + + /** InsertAddressRequest requestId. */ + public requestId?: (string|null); + + /** InsertAddressRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertAddressRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertAddressRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertAddressRequest): google.cloud.compute.v1.InsertAddressRequest; + + /** + * Encodes the specified InsertAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertAddressRequest.verify|verify} messages. + * @param message InsertAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertAddressRequest.verify|verify} messages. + * @param message InsertAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertAddressRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertAddressRequest; + + /** + * Decodes an InsertAddressRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertAddressRequest; + + /** + * Verifies an InsertAddressRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertAddressRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertAddressRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertAddressRequest; + + /** + * Creates a plain object from an InsertAddressRequest message. Also converts values to other types if specified. + * @param message InsertAddressRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertAddressRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAddressesRequest. */ + interface IListAddressesRequest { + + /** ListAddressesRequest filter */ + filter?: (string|null); + + /** ListAddressesRequest maxResults */ + maxResults?: (number|null); + + /** ListAddressesRequest orderBy */ + orderBy?: (string|null); + + /** ListAddressesRequest pageToken */ + pageToken?: (string|null); + + /** ListAddressesRequest project */ + project?: (string|null); + + /** ListAddressesRequest region */ + region?: (string|null); + + /** ListAddressesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListAddressesRequest. */ + class ListAddressesRequest implements IListAddressesRequest { + + /** + * Constructs a new ListAddressesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListAddressesRequest); + + /** ListAddressesRequest filter. */ + public filter?: (string|null); + + /** ListAddressesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListAddressesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListAddressesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListAddressesRequest project. */ + public project: string; + + /** ListAddressesRequest region. */ + public region: string; + + /** ListAddressesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListAddressesRequest _filter. */ + public _filter?: "filter"; + + /** ListAddressesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListAddressesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListAddressesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListAddressesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListAddressesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAddressesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListAddressesRequest): google.cloud.compute.v1.ListAddressesRequest; + + /** + * Encodes the specified ListAddressesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAddressesRequest.verify|verify} messages. + * @param message ListAddressesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListAddressesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAddressesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAddressesRequest.verify|verify} messages. + * @param message ListAddressesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListAddressesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAddressesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListAddressesRequest; + + /** + * Decodes a ListAddressesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListAddressesRequest; + + /** + * Verifies a ListAddressesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAddressesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAddressesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListAddressesRequest; + + /** + * Creates a plain object from a ListAddressesRequest message. Also converts values to other types if specified. + * @param message ListAddressesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListAddressesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAddressesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListAutoscalersRequest. */ + interface IAggregatedListAutoscalersRequest { + + /** AggregatedListAutoscalersRequest filter */ + filter?: (string|null); + + /** AggregatedListAutoscalersRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListAutoscalersRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListAutoscalersRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListAutoscalersRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListAutoscalersRequest project */ + project?: (string|null); + + /** AggregatedListAutoscalersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListAutoscalersRequest. */ + class AggregatedListAutoscalersRequest implements IAggregatedListAutoscalersRequest { + + /** + * Constructs a new AggregatedListAutoscalersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListAutoscalersRequest); + + /** AggregatedListAutoscalersRequest filter. */ + public filter?: (string|null); + + /** AggregatedListAutoscalersRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListAutoscalersRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListAutoscalersRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListAutoscalersRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListAutoscalersRequest project. */ + public project: string; + + /** AggregatedListAutoscalersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListAutoscalersRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListAutoscalersRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListAutoscalersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListAutoscalersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListAutoscalersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListAutoscalersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListAutoscalersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListAutoscalersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListAutoscalersRequest): google.cloud.compute.v1.AggregatedListAutoscalersRequest; + + /** + * Encodes the specified AggregatedListAutoscalersRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAutoscalersRequest.verify|verify} messages. + * @param message AggregatedListAutoscalersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListAutoscalersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListAutoscalersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAutoscalersRequest.verify|verify} messages. + * @param message AggregatedListAutoscalersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListAutoscalersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListAutoscalersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListAutoscalersRequest; + + /** + * Decodes an AggregatedListAutoscalersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListAutoscalersRequest; + + /** + * Verifies an AggregatedListAutoscalersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListAutoscalersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListAutoscalersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListAutoscalersRequest; + + /** + * Creates a plain object from an AggregatedListAutoscalersRequest message. Also converts values to other types if specified. + * @param message AggregatedListAutoscalersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListAutoscalersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListAutoscalersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteAutoscalerRequest. */ + interface IDeleteAutoscalerRequest { + + /** DeleteAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** DeleteAutoscalerRequest project */ + project?: (string|null); + + /** DeleteAutoscalerRequest requestId */ + requestId?: (string|null); + + /** DeleteAutoscalerRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteAutoscalerRequest. */ + class DeleteAutoscalerRequest implements IDeleteAutoscalerRequest { + + /** + * Constructs a new DeleteAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteAutoscalerRequest); + + /** DeleteAutoscalerRequest autoscaler. */ + public autoscaler: string; + + /** DeleteAutoscalerRequest project. */ + public project: string; + + /** DeleteAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** DeleteAutoscalerRequest zone. */ + public zone: string; + + /** DeleteAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteAutoscalerRequest): google.cloud.compute.v1.DeleteAutoscalerRequest; + + /** + * Encodes the specified DeleteAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteAutoscalerRequest.verify|verify} messages. + * @param message DeleteAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteAutoscalerRequest.verify|verify} messages. + * @param message DeleteAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteAutoscalerRequest; + + /** + * Decodes a DeleteAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteAutoscalerRequest; + + /** + * Verifies a DeleteAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteAutoscalerRequest; + + /** + * Creates a plain object from a DeleteAutoscalerRequest message. Also converts values to other types if specified. + * @param message DeleteAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetAutoscalerRequest. */ + interface IGetAutoscalerRequest { + + /** GetAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** GetAutoscalerRequest project */ + project?: (string|null); + + /** GetAutoscalerRequest zone */ + zone?: (string|null); + } + + /** Represents a GetAutoscalerRequest. */ + class GetAutoscalerRequest implements IGetAutoscalerRequest { + + /** + * Constructs a new GetAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetAutoscalerRequest); + + /** GetAutoscalerRequest autoscaler. */ + public autoscaler: string; + + /** GetAutoscalerRequest project. */ + public project: string; + + /** GetAutoscalerRequest zone. */ + public zone: string; + + /** + * Creates a new GetAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetAutoscalerRequest): google.cloud.compute.v1.GetAutoscalerRequest; + + /** + * Encodes the specified GetAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAutoscalerRequest.verify|verify} messages. + * @param message GetAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAutoscalerRequest.verify|verify} messages. + * @param message GetAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetAutoscalerRequest; + + /** + * Decodes a GetAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetAutoscalerRequest; + + /** + * Verifies a GetAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetAutoscalerRequest; + + /** + * Creates a plain object from a GetAutoscalerRequest message. Also converts values to other types if specified. + * @param message GetAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertAutoscalerRequest. */ + interface IInsertAutoscalerRequest { + + /** InsertAutoscalerRequest autoscalerResource */ + autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** InsertAutoscalerRequest project */ + project?: (string|null); + + /** InsertAutoscalerRequest requestId */ + requestId?: (string|null); + + /** InsertAutoscalerRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertAutoscalerRequest. */ + class InsertAutoscalerRequest implements IInsertAutoscalerRequest { + + /** + * Constructs a new InsertAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertAutoscalerRequest); + + /** InsertAutoscalerRequest autoscalerResource. */ + public autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** InsertAutoscalerRequest project. */ + public project: string; + + /** InsertAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** InsertAutoscalerRequest zone. */ + public zone: string; + + /** InsertAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertAutoscalerRequest): google.cloud.compute.v1.InsertAutoscalerRequest; + + /** + * Encodes the specified InsertAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertAutoscalerRequest.verify|verify} messages. + * @param message InsertAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertAutoscalerRequest.verify|verify} messages. + * @param message InsertAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertAutoscalerRequest; + + /** + * Decodes an InsertAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertAutoscalerRequest; + + /** + * Verifies an InsertAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertAutoscalerRequest; + + /** + * Creates a plain object from an InsertAutoscalerRequest message. Also converts values to other types if specified. + * @param message InsertAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAutoscalersRequest. */ + interface IListAutoscalersRequest { + + /** ListAutoscalersRequest filter */ + filter?: (string|null); + + /** ListAutoscalersRequest maxResults */ + maxResults?: (number|null); + + /** ListAutoscalersRequest orderBy */ + orderBy?: (string|null); + + /** ListAutoscalersRequest pageToken */ + pageToken?: (string|null); + + /** ListAutoscalersRequest project */ + project?: (string|null); + + /** ListAutoscalersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListAutoscalersRequest zone */ + zone?: (string|null); + } + + /** Represents a ListAutoscalersRequest. */ + class ListAutoscalersRequest implements IListAutoscalersRequest { + + /** + * Constructs a new ListAutoscalersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListAutoscalersRequest); + + /** ListAutoscalersRequest filter. */ + public filter?: (string|null); + + /** ListAutoscalersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListAutoscalersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListAutoscalersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListAutoscalersRequest project. */ + public project: string; + + /** ListAutoscalersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListAutoscalersRequest zone. */ + public zone: string; + + /** ListAutoscalersRequest _filter. */ + public _filter?: "filter"; + + /** ListAutoscalersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListAutoscalersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListAutoscalersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListAutoscalersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListAutoscalersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAutoscalersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListAutoscalersRequest): google.cloud.compute.v1.ListAutoscalersRequest; + + /** + * Encodes the specified ListAutoscalersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAutoscalersRequest.verify|verify} messages. + * @param message ListAutoscalersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListAutoscalersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAutoscalersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAutoscalersRequest.verify|verify} messages. + * @param message ListAutoscalersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListAutoscalersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAutoscalersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListAutoscalersRequest; + + /** + * Decodes a ListAutoscalersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListAutoscalersRequest; + + /** + * Verifies a ListAutoscalersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAutoscalersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAutoscalersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListAutoscalersRequest; + + /** + * Creates a plain object from a ListAutoscalersRequest message. Also converts values to other types if specified. + * @param message ListAutoscalersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListAutoscalersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAutoscalersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchAutoscalerRequest. */ + interface IPatchAutoscalerRequest { + + /** PatchAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** PatchAutoscalerRequest autoscalerResource */ + autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** PatchAutoscalerRequest project */ + project?: (string|null); + + /** PatchAutoscalerRequest requestId */ + requestId?: (string|null); + + /** PatchAutoscalerRequest zone */ + zone?: (string|null); + } + + /** Represents a PatchAutoscalerRequest. */ + class PatchAutoscalerRequest implements IPatchAutoscalerRequest { + + /** + * Constructs a new PatchAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchAutoscalerRequest); + + /** PatchAutoscalerRequest autoscaler. */ + public autoscaler?: (string|null); + + /** PatchAutoscalerRequest autoscalerResource. */ + public autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** PatchAutoscalerRequest project. */ + public project: string; + + /** PatchAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** PatchAutoscalerRequest zone. */ + public zone: string; + + /** PatchAutoscalerRequest _autoscaler. */ + public _autoscaler?: "autoscaler"; + + /** PatchAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchAutoscalerRequest): google.cloud.compute.v1.PatchAutoscalerRequest; + + /** + * Encodes the specified PatchAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchAutoscalerRequest.verify|verify} messages. + * @param message PatchAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchAutoscalerRequest.verify|verify} messages. + * @param message PatchAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchAutoscalerRequest; + + /** + * Decodes a PatchAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchAutoscalerRequest; + + /** + * Verifies a PatchAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchAutoscalerRequest; + + /** + * Creates a plain object from a PatchAutoscalerRequest message. Also converts values to other types if specified. + * @param message PatchAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateAutoscalerRequest. */ + interface IUpdateAutoscalerRequest { + + /** UpdateAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** UpdateAutoscalerRequest autoscalerResource */ + autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** UpdateAutoscalerRequest project */ + project?: (string|null); + + /** UpdateAutoscalerRequest requestId */ + requestId?: (string|null); + + /** UpdateAutoscalerRequest zone */ + zone?: (string|null); + } + + /** Represents an UpdateAutoscalerRequest. */ + class UpdateAutoscalerRequest implements IUpdateAutoscalerRequest { + + /** + * Constructs a new UpdateAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateAutoscalerRequest); + + /** UpdateAutoscalerRequest autoscaler. */ + public autoscaler?: (string|null); + + /** UpdateAutoscalerRequest autoscalerResource. */ + public autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** UpdateAutoscalerRequest project. */ + public project: string; + + /** UpdateAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** UpdateAutoscalerRequest zone. */ + public zone: string; + + /** UpdateAutoscalerRequest _autoscaler. */ + public _autoscaler?: "autoscaler"; + + /** UpdateAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateAutoscalerRequest): google.cloud.compute.v1.UpdateAutoscalerRequest; + + /** + * Encodes the specified UpdateAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateAutoscalerRequest.verify|verify} messages. + * @param message UpdateAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateAutoscalerRequest.verify|verify} messages. + * @param message UpdateAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateAutoscalerRequest; + + /** + * Decodes an UpdateAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateAutoscalerRequest; + + /** + * Verifies an UpdateAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateAutoscalerRequest; + + /** + * Creates a plain object from an UpdateAutoscalerRequest message. Also converts values to other types if specified. + * @param message UpdateAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddSignedUrlKeyBackendBucketRequest. */ + interface IAddSignedUrlKeyBackendBucketRequest { + + /** AddSignedUrlKeyBackendBucketRequest backendBucket */ + backendBucket?: (string|null); + + /** AddSignedUrlKeyBackendBucketRequest project */ + project?: (string|null); + + /** AddSignedUrlKeyBackendBucketRequest requestId */ + requestId?: (string|null); + + /** AddSignedUrlKeyBackendBucketRequest signedUrlKeyResource */ + signedUrlKeyResource?: (google.cloud.compute.v1.ISignedUrlKey|null); + } + + /** Represents an AddSignedUrlKeyBackendBucketRequest. */ + class AddSignedUrlKeyBackendBucketRequest implements IAddSignedUrlKeyBackendBucketRequest { + + /** + * Constructs a new AddSignedUrlKeyBackendBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest); + + /** AddSignedUrlKeyBackendBucketRequest backendBucket. */ + public backendBucket: string; + + /** AddSignedUrlKeyBackendBucketRequest project. */ + public project: string; + + /** AddSignedUrlKeyBackendBucketRequest requestId. */ + public requestId?: (string|null); + + /** AddSignedUrlKeyBackendBucketRequest signedUrlKeyResource. */ + public signedUrlKeyResource?: (google.cloud.compute.v1.ISignedUrlKey|null); + + /** AddSignedUrlKeyBackendBucketRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddSignedUrlKeyBackendBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddSignedUrlKeyBackendBucketRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest): google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest; + + /** + * Encodes the specified AddSignedUrlKeyBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @param message AddSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddSignedUrlKeyBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @param message AddSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddSignedUrlKeyBackendBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest; + + /** + * Decodes an AddSignedUrlKeyBackendBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest; + + /** + * Verifies an AddSignedUrlKeyBackendBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddSignedUrlKeyBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddSignedUrlKeyBackendBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest; + + /** + * Creates a plain object from an AddSignedUrlKeyBackendBucketRequest message. Also converts values to other types if specified. + * @param message AddSignedUrlKeyBackendBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddSignedUrlKeyBackendBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteBackendBucketRequest. */ + interface IDeleteBackendBucketRequest { + + /** DeleteBackendBucketRequest backendBucket */ + backendBucket?: (string|null); + + /** DeleteBackendBucketRequest project */ + project?: (string|null); + + /** DeleteBackendBucketRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackendBucketRequest. */ + class DeleteBackendBucketRequest implements IDeleteBackendBucketRequest { + + /** + * Constructs a new DeleteBackendBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteBackendBucketRequest); + + /** DeleteBackendBucketRequest backendBucket. */ + public backendBucket: string; + + /** DeleteBackendBucketRequest project. */ + public project: string; + + /** DeleteBackendBucketRequest requestId. */ + public requestId?: (string|null); + + /** DeleteBackendBucketRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteBackendBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackendBucketRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteBackendBucketRequest): google.cloud.compute.v1.DeleteBackendBucketRequest; + + /** + * Encodes the specified DeleteBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendBucketRequest.verify|verify} messages. + * @param message DeleteBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendBucketRequest.verify|verify} messages. + * @param message DeleteBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackendBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteBackendBucketRequest; + + /** + * Decodes a DeleteBackendBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteBackendBucketRequest; + + /** + * Verifies a DeleteBackendBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackendBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteBackendBucketRequest; + + /** + * Creates a plain object from a DeleteBackendBucketRequest message. Also converts values to other types if specified. + * @param message DeleteBackendBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteBackendBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackendBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSignedUrlKeyBackendBucketRequest. */ + interface IDeleteSignedUrlKeyBackendBucketRequest { + + /** DeleteSignedUrlKeyBackendBucketRequest backendBucket */ + backendBucket?: (string|null); + + /** DeleteSignedUrlKeyBackendBucketRequest keyName */ + keyName?: (string|null); + + /** DeleteSignedUrlKeyBackendBucketRequest project */ + project?: (string|null); + + /** DeleteSignedUrlKeyBackendBucketRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteSignedUrlKeyBackendBucketRequest. */ + class DeleteSignedUrlKeyBackendBucketRequest implements IDeleteSignedUrlKeyBackendBucketRequest { + + /** + * Constructs a new DeleteSignedUrlKeyBackendBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest); + + /** DeleteSignedUrlKeyBackendBucketRequest backendBucket. */ + public backendBucket: string; + + /** DeleteSignedUrlKeyBackendBucketRequest keyName. */ + public keyName: string; + + /** DeleteSignedUrlKeyBackendBucketRequest project. */ + public project: string; + + /** DeleteSignedUrlKeyBackendBucketRequest requestId. */ + public requestId?: (string|null); + + /** DeleteSignedUrlKeyBackendBucketRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteSignedUrlKeyBackendBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSignedUrlKeyBackendBucketRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest): google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @param message DeleteSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @param message DeleteSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSignedUrlKeyBackendBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest; + + /** + * Decodes a DeleteSignedUrlKeyBackendBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest; + + /** + * Verifies a DeleteSignedUrlKeyBackendBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSignedUrlKeyBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSignedUrlKeyBackendBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest; + + /** + * Creates a plain object from a DeleteSignedUrlKeyBackendBucketRequest message. Also converts values to other types if specified. + * @param message DeleteSignedUrlKeyBackendBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSignedUrlKeyBackendBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetBackendBucketRequest. */ + interface IGetBackendBucketRequest { + + /** GetBackendBucketRequest backendBucket */ + backendBucket?: (string|null); + + /** GetBackendBucketRequest project */ + project?: (string|null); + } + + /** Represents a GetBackendBucketRequest. */ + class GetBackendBucketRequest implements IGetBackendBucketRequest { + + /** + * Constructs a new GetBackendBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetBackendBucketRequest); + + /** GetBackendBucketRequest backendBucket. */ + public backendBucket: string; + + /** GetBackendBucketRequest project. */ + public project: string; + + /** + * Creates a new GetBackendBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackendBucketRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetBackendBucketRequest): google.cloud.compute.v1.GetBackendBucketRequest; + + /** + * Encodes the specified GetBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.GetBackendBucketRequest.verify|verify} messages. + * @param message GetBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetBackendBucketRequest.verify|verify} messages. + * @param message GetBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackendBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetBackendBucketRequest; + + /** + * Decodes a GetBackendBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetBackendBucketRequest; + + /** + * Verifies a GetBackendBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackendBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetBackendBucketRequest; + + /** + * Creates a plain object from a GetBackendBucketRequest message. Also converts values to other types if specified. + * @param message GetBackendBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetBackendBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackendBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertBackendBucketRequest. */ + interface IInsertBackendBucketRequest { + + /** InsertBackendBucketRequest backendBucketResource */ + backendBucketResource?: (google.cloud.compute.v1.IBackendBucket|null); + + /** InsertBackendBucketRequest project */ + project?: (string|null); + + /** InsertBackendBucketRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertBackendBucketRequest. */ + class InsertBackendBucketRequest implements IInsertBackendBucketRequest { + + /** + * Constructs a new InsertBackendBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertBackendBucketRequest); + + /** InsertBackendBucketRequest backendBucketResource. */ + public backendBucketResource?: (google.cloud.compute.v1.IBackendBucket|null); + + /** InsertBackendBucketRequest project. */ + public project: string; + + /** InsertBackendBucketRequest requestId. */ + public requestId?: (string|null); + + /** InsertBackendBucketRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertBackendBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertBackendBucketRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertBackendBucketRequest): google.cloud.compute.v1.InsertBackendBucketRequest; + + /** + * Encodes the specified InsertBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertBackendBucketRequest.verify|verify} messages. + * @param message InsertBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertBackendBucketRequest.verify|verify} messages. + * @param message InsertBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertBackendBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertBackendBucketRequest; + + /** + * Decodes an InsertBackendBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertBackendBucketRequest; + + /** + * Verifies an InsertBackendBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertBackendBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertBackendBucketRequest; + + /** + * Creates a plain object from an InsertBackendBucketRequest message. Also converts values to other types if specified. + * @param message InsertBackendBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertBackendBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertBackendBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListBackendBucketsRequest. */ + interface IListBackendBucketsRequest { + + /** ListBackendBucketsRequest filter */ + filter?: (string|null); + + /** ListBackendBucketsRequest maxResults */ + maxResults?: (number|null); + + /** ListBackendBucketsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackendBucketsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackendBucketsRequest project */ + project?: (string|null); + + /** ListBackendBucketsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListBackendBucketsRequest. */ + class ListBackendBucketsRequest implements IListBackendBucketsRequest { + + /** + * Constructs a new ListBackendBucketsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListBackendBucketsRequest); + + /** ListBackendBucketsRequest filter. */ + public filter?: (string|null); + + /** ListBackendBucketsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListBackendBucketsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListBackendBucketsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListBackendBucketsRequest project. */ + public project: string; + + /** ListBackendBucketsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListBackendBucketsRequest _filter. */ + public _filter?: "filter"; + + /** ListBackendBucketsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListBackendBucketsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListBackendBucketsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListBackendBucketsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListBackendBucketsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackendBucketsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListBackendBucketsRequest): google.cloud.compute.v1.ListBackendBucketsRequest; + + /** + * Encodes the specified ListBackendBucketsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListBackendBucketsRequest.verify|verify} messages. + * @param message ListBackendBucketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListBackendBucketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackendBucketsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListBackendBucketsRequest.verify|verify} messages. + * @param message ListBackendBucketsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListBackendBucketsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackendBucketsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackendBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListBackendBucketsRequest; + + /** + * Decodes a ListBackendBucketsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackendBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListBackendBucketsRequest; + + /** + * Verifies a ListBackendBucketsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackendBucketsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackendBucketsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListBackendBucketsRequest; + + /** + * Creates a plain object from a ListBackendBucketsRequest message. Also converts values to other types if specified. + * @param message ListBackendBucketsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListBackendBucketsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackendBucketsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchBackendBucketRequest. */ + interface IPatchBackendBucketRequest { + + /** PatchBackendBucketRequest backendBucket */ + backendBucket?: (string|null); + + /** PatchBackendBucketRequest backendBucketResource */ + backendBucketResource?: (google.cloud.compute.v1.IBackendBucket|null); + + /** PatchBackendBucketRequest project */ + project?: (string|null); + + /** PatchBackendBucketRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchBackendBucketRequest. */ + class PatchBackendBucketRequest implements IPatchBackendBucketRequest { + + /** + * Constructs a new PatchBackendBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchBackendBucketRequest); + + /** PatchBackendBucketRequest backendBucket. */ + public backendBucket: string; + + /** PatchBackendBucketRequest backendBucketResource. */ + public backendBucketResource?: (google.cloud.compute.v1.IBackendBucket|null); + + /** PatchBackendBucketRequest project. */ + public project: string; + + /** PatchBackendBucketRequest requestId. */ + public requestId?: (string|null); + + /** PatchBackendBucketRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchBackendBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchBackendBucketRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchBackendBucketRequest): google.cloud.compute.v1.PatchBackendBucketRequest; + + /** + * Encodes the specified PatchBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchBackendBucketRequest.verify|verify} messages. + * @param message PatchBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchBackendBucketRequest.verify|verify} messages. + * @param message PatchBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchBackendBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchBackendBucketRequest; + + /** + * Decodes a PatchBackendBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchBackendBucketRequest; + + /** + * Verifies a PatchBackendBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchBackendBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchBackendBucketRequest; + + /** + * Creates a plain object from a PatchBackendBucketRequest message. Also converts values to other types if specified. + * @param message PatchBackendBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchBackendBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchBackendBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateBackendBucketRequest. */ + interface IUpdateBackendBucketRequest { + + /** UpdateBackendBucketRequest backendBucket */ + backendBucket?: (string|null); + + /** UpdateBackendBucketRequest backendBucketResource */ + backendBucketResource?: (google.cloud.compute.v1.IBackendBucket|null); + + /** UpdateBackendBucketRequest project */ + project?: (string|null); + + /** UpdateBackendBucketRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateBackendBucketRequest. */ + class UpdateBackendBucketRequest implements IUpdateBackendBucketRequest { + + /** + * Constructs a new UpdateBackendBucketRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateBackendBucketRequest); + + /** UpdateBackendBucketRequest backendBucket. */ + public backendBucket: string; + + /** UpdateBackendBucketRequest backendBucketResource. */ + public backendBucketResource?: (google.cloud.compute.v1.IBackendBucket|null); + + /** UpdateBackendBucketRequest project. */ + public project: string; + + /** UpdateBackendBucketRequest requestId. */ + public requestId?: (string|null); + + /** UpdateBackendBucketRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateBackendBucketRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackendBucketRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateBackendBucketRequest): google.cloud.compute.v1.UpdateBackendBucketRequest; + + /** + * Encodes the specified UpdateBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendBucketRequest.verify|verify} messages. + * @param message UpdateBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendBucketRequest.verify|verify} messages. + * @param message UpdateBackendBucketRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateBackendBucketRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackendBucketRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateBackendBucketRequest; + + /** + * Decodes an UpdateBackendBucketRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateBackendBucketRequest; + + /** + * Verifies an UpdateBackendBucketRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackendBucketRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateBackendBucketRequest; + + /** + * Creates a plain object from an UpdateBackendBucketRequest message. Also converts values to other types if specified. + * @param message UpdateBackendBucketRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateBackendBucketRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackendBucketRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddSignedUrlKeyBackendServiceRequest. */ + interface IAddSignedUrlKeyBackendServiceRequest { + + /** AddSignedUrlKeyBackendServiceRequest backendService */ + backendService?: (string|null); + + /** AddSignedUrlKeyBackendServiceRequest project */ + project?: (string|null); + + /** AddSignedUrlKeyBackendServiceRequest requestId */ + requestId?: (string|null); + + /** AddSignedUrlKeyBackendServiceRequest signedUrlKeyResource */ + signedUrlKeyResource?: (google.cloud.compute.v1.ISignedUrlKey|null); + } + + /** Represents an AddSignedUrlKeyBackendServiceRequest. */ + class AddSignedUrlKeyBackendServiceRequest implements IAddSignedUrlKeyBackendServiceRequest { + + /** + * Constructs a new AddSignedUrlKeyBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest); + + /** AddSignedUrlKeyBackendServiceRequest backendService. */ + public backendService: string; + + /** AddSignedUrlKeyBackendServiceRequest project. */ + public project: string; + + /** AddSignedUrlKeyBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** AddSignedUrlKeyBackendServiceRequest signedUrlKeyResource. */ + public signedUrlKeyResource?: (google.cloud.compute.v1.ISignedUrlKey|null); + + /** AddSignedUrlKeyBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddSignedUrlKeyBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddSignedUrlKeyBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest): google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest; + + /** + * Encodes the specified AddSignedUrlKeyBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @param message AddSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddSignedUrlKeyBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @param message AddSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddSignedUrlKeyBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest; + + /** + * Decodes an AddSignedUrlKeyBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest; + + /** + * Verifies an AddSignedUrlKeyBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddSignedUrlKeyBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddSignedUrlKeyBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest; + + /** + * Creates a plain object from an AddSignedUrlKeyBackendServiceRequest message. Also converts values to other types if specified. + * @param message AddSignedUrlKeyBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddSignedUrlKeyBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListBackendServicesRequest. */ + interface IAggregatedListBackendServicesRequest { + + /** AggregatedListBackendServicesRequest filter */ + filter?: (string|null); + + /** AggregatedListBackendServicesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListBackendServicesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListBackendServicesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListBackendServicesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListBackendServicesRequest project */ + project?: (string|null); + + /** AggregatedListBackendServicesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListBackendServicesRequest. */ + class AggregatedListBackendServicesRequest implements IAggregatedListBackendServicesRequest { + + /** + * Constructs a new AggregatedListBackendServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListBackendServicesRequest); + + /** AggregatedListBackendServicesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListBackendServicesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListBackendServicesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListBackendServicesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListBackendServicesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListBackendServicesRequest project. */ + public project: string; + + /** AggregatedListBackendServicesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListBackendServicesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListBackendServicesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListBackendServicesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListBackendServicesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListBackendServicesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListBackendServicesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListBackendServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListBackendServicesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListBackendServicesRequest): google.cloud.compute.v1.AggregatedListBackendServicesRequest; + + /** + * Encodes the specified AggregatedListBackendServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListBackendServicesRequest.verify|verify} messages. + * @param message AggregatedListBackendServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListBackendServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListBackendServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListBackendServicesRequest.verify|verify} messages. + * @param message AggregatedListBackendServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListBackendServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListBackendServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListBackendServicesRequest; + + /** + * Decodes an AggregatedListBackendServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListBackendServicesRequest; + + /** + * Verifies an AggregatedListBackendServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListBackendServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListBackendServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListBackendServicesRequest; + + /** + * Creates a plain object from an AggregatedListBackendServicesRequest message. Also converts values to other types if specified. + * @param message AggregatedListBackendServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListBackendServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListBackendServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteBackendServiceRequest. */ + interface IDeleteBackendServiceRequest { + + /** DeleteBackendServiceRequest backendService */ + backendService?: (string|null); + + /** DeleteBackendServiceRequest project */ + project?: (string|null); + + /** DeleteBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackendServiceRequest. */ + class DeleteBackendServiceRequest implements IDeleteBackendServiceRequest { + + /** + * Constructs a new DeleteBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteBackendServiceRequest); + + /** DeleteBackendServiceRequest backendService. */ + public backendService: string; + + /** DeleteBackendServiceRequest project. */ + public project: string; + + /** DeleteBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** DeleteBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteBackendServiceRequest): google.cloud.compute.v1.DeleteBackendServiceRequest; + + /** + * Encodes the specified DeleteBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendServiceRequest.verify|verify} messages. + * @param message DeleteBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendServiceRequest.verify|verify} messages. + * @param message DeleteBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteBackendServiceRequest; + + /** + * Decodes a DeleteBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteBackendServiceRequest; + + /** + * Verifies a DeleteBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteBackendServiceRequest; + + /** + * Creates a plain object from a DeleteBackendServiceRequest message. Also converts values to other types if specified. + * @param message DeleteBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSignedUrlKeyBackendServiceRequest. */ + interface IDeleteSignedUrlKeyBackendServiceRequest { + + /** DeleteSignedUrlKeyBackendServiceRequest backendService */ + backendService?: (string|null); + + /** DeleteSignedUrlKeyBackendServiceRequest keyName */ + keyName?: (string|null); + + /** DeleteSignedUrlKeyBackendServiceRequest project */ + project?: (string|null); + + /** DeleteSignedUrlKeyBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteSignedUrlKeyBackendServiceRequest. */ + class DeleteSignedUrlKeyBackendServiceRequest implements IDeleteSignedUrlKeyBackendServiceRequest { + + /** + * Constructs a new DeleteSignedUrlKeyBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest); + + /** DeleteSignedUrlKeyBackendServiceRequest backendService. */ + public backendService: string; + + /** DeleteSignedUrlKeyBackendServiceRequest keyName. */ + public keyName: string; + + /** DeleteSignedUrlKeyBackendServiceRequest project. */ + public project: string; + + /** DeleteSignedUrlKeyBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** DeleteSignedUrlKeyBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteSignedUrlKeyBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSignedUrlKeyBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest): google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @param message DeleteSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @param message DeleteSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSignedUrlKeyBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest; + + /** + * Decodes a DeleteSignedUrlKeyBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest; + + /** + * Verifies a DeleteSignedUrlKeyBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSignedUrlKeyBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSignedUrlKeyBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest; + + /** + * Creates a plain object from a DeleteSignedUrlKeyBackendServiceRequest message. Also converts values to other types if specified. + * @param message DeleteSignedUrlKeyBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSignedUrlKeyBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetBackendServiceRequest. */ + interface IGetBackendServiceRequest { + + /** GetBackendServiceRequest backendService */ + backendService?: (string|null); + + /** GetBackendServiceRequest project */ + project?: (string|null); + } + + /** Represents a GetBackendServiceRequest. */ + class GetBackendServiceRequest implements IGetBackendServiceRequest { + + /** + * Constructs a new GetBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetBackendServiceRequest); + + /** GetBackendServiceRequest backendService. */ + public backendService: string; + + /** GetBackendServiceRequest project. */ + public project: string; + + /** + * Creates a new GetBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetBackendServiceRequest): google.cloud.compute.v1.GetBackendServiceRequest; + + /** + * Encodes the specified GetBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetBackendServiceRequest.verify|verify} messages. + * @param message GetBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetBackendServiceRequest.verify|verify} messages. + * @param message GetBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetBackendServiceRequest; + + /** + * Decodes a GetBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetBackendServiceRequest; + + /** + * Verifies a GetBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetBackendServiceRequest; + + /** + * Creates a plain object from a GetBackendServiceRequest message. Also converts values to other types if specified. + * @param message GetBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetHealthBackendServiceRequest. */ + interface IGetHealthBackendServiceRequest { + + /** GetHealthBackendServiceRequest backendService */ + backendService?: (string|null); + + /** GetHealthBackendServiceRequest project */ + project?: (string|null); + + /** GetHealthBackendServiceRequest resourceGroupReferenceResource */ + resourceGroupReferenceResource?: (google.cloud.compute.v1.IResourceGroupReference|null); + } + + /** Represents a GetHealthBackendServiceRequest. */ + class GetHealthBackendServiceRequest implements IGetHealthBackendServiceRequest { + + /** + * Constructs a new GetHealthBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetHealthBackendServiceRequest); + + /** GetHealthBackendServiceRequest backendService. */ + public backendService: string; + + /** GetHealthBackendServiceRequest project. */ + public project: string; + + /** GetHealthBackendServiceRequest resourceGroupReferenceResource. */ + public resourceGroupReferenceResource?: (google.cloud.compute.v1.IResourceGroupReference|null); + + /** + * Creates a new GetHealthBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHealthBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetHealthBackendServiceRequest): google.cloud.compute.v1.GetHealthBackendServiceRequest; + + /** + * Encodes the specified GetHealthBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthBackendServiceRequest.verify|verify} messages. + * @param message GetHealthBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetHealthBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHealthBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthBackendServiceRequest.verify|verify} messages. + * @param message GetHealthBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetHealthBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHealthBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHealthBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetHealthBackendServiceRequest; + + /** + * Decodes a GetHealthBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHealthBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetHealthBackendServiceRequest; + + /** + * Verifies a GetHealthBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHealthBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHealthBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetHealthBackendServiceRequest; + + /** + * Creates a plain object from a GetHealthBackendServiceRequest message. Also converts values to other types if specified. + * @param message GetHealthBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetHealthBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHealthBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertBackendServiceRequest. */ + interface IInsertBackendServiceRequest { + + /** InsertBackendServiceRequest backendServiceResource */ + backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** InsertBackendServiceRequest project */ + project?: (string|null); + + /** InsertBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertBackendServiceRequest. */ + class InsertBackendServiceRequest implements IInsertBackendServiceRequest { + + /** + * Constructs a new InsertBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertBackendServiceRequest); + + /** InsertBackendServiceRequest backendServiceResource. */ + public backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** InsertBackendServiceRequest project. */ + public project: string; + + /** InsertBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** InsertBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertBackendServiceRequest): google.cloud.compute.v1.InsertBackendServiceRequest; + + /** + * Encodes the specified InsertBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertBackendServiceRequest.verify|verify} messages. + * @param message InsertBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertBackendServiceRequest.verify|verify} messages. + * @param message InsertBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertBackendServiceRequest; + + /** + * Decodes an InsertBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertBackendServiceRequest; + + /** + * Verifies an InsertBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertBackendServiceRequest; + + /** + * Creates a plain object from an InsertBackendServiceRequest message. Also converts values to other types if specified. + * @param message InsertBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListBackendServicesRequest. */ + interface IListBackendServicesRequest { + + /** ListBackendServicesRequest filter */ + filter?: (string|null); + + /** ListBackendServicesRequest maxResults */ + maxResults?: (number|null); + + /** ListBackendServicesRequest orderBy */ + orderBy?: (string|null); + + /** ListBackendServicesRequest pageToken */ + pageToken?: (string|null); + + /** ListBackendServicesRequest project */ + project?: (string|null); + + /** ListBackendServicesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListBackendServicesRequest. */ + class ListBackendServicesRequest implements IListBackendServicesRequest { + + /** + * Constructs a new ListBackendServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListBackendServicesRequest); + + /** ListBackendServicesRequest filter. */ + public filter?: (string|null); + + /** ListBackendServicesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListBackendServicesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListBackendServicesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListBackendServicesRequest project. */ + public project: string; + + /** ListBackendServicesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListBackendServicesRequest _filter. */ + public _filter?: "filter"; + + /** ListBackendServicesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListBackendServicesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListBackendServicesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListBackendServicesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListBackendServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackendServicesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListBackendServicesRequest): google.cloud.compute.v1.ListBackendServicesRequest; + + /** + * Encodes the specified ListBackendServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListBackendServicesRequest.verify|verify} messages. + * @param message ListBackendServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListBackendServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackendServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListBackendServicesRequest.verify|verify} messages. + * @param message ListBackendServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListBackendServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackendServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListBackendServicesRequest; + + /** + * Decodes a ListBackendServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListBackendServicesRequest; + + /** + * Verifies a ListBackendServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackendServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackendServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListBackendServicesRequest; + + /** + * Creates a plain object from a ListBackendServicesRequest message. Also converts values to other types if specified. + * @param message ListBackendServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListBackendServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackendServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchBackendServiceRequest. */ + interface IPatchBackendServiceRequest { + + /** PatchBackendServiceRequest backendService */ + backendService?: (string|null); + + /** PatchBackendServiceRequest backendServiceResource */ + backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** PatchBackendServiceRequest project */ + project?: (string|null); + + /** PatchBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchBackendServiceRequest. */ + class PatchBackendServiceRequest implements IPatchBackendServiceRequest { + + /** + * Constructs a new PatchBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchBackendServiceRequest); + + /** PatchBackendServiceRequest backendService. */ + public backendService: string; + + /** PatchBackendServiceRequest backendServiceResource. */ + public backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** PatchBackendServiceRequest project. */ + public project: string; + + /** PatchBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** PatchBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchBackendServiceRequest): google.cloud.compute.v1.PatchBackendServiceRequest; + + /** + * Encodes the specified PatchBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchBackendServiceRequest.verify|verify} messages. + * @param message PatchBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchBackendServiceRequest.verify|verify} messages. + * @param message PatchBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchBackendServiceRequest; + + /** + * Decodes a PatchBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchBackendServiceRequest; + + /** + * Verifies a PatchBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchBackendServiceRequest; + + /** + * Creates a plain object from a PatchBackendServiceRequest message. Also converts values to other types if specified. + * @param message PatchBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetSecurityPolicyBackendServiceRequest. */ + interface ISetSecurityPolicyBackendServiceRequest { + + /** SetSecurityPolicyBackendServiceRequest backendService */ + backendService?: (string|null); + + /** SetSecurityPolicyBackendServiceRequest project */ + project?: (string|null); + + /** SetSecurityPolicyBackendServiceRequest requestId */ + requestId?: (string|null); + + /** SetSecurityPolicyBackendServiceRequest securityPolicyReferenceResource */ + securityPolicyReferenceResource?: (google.cloud.compute.v1.ISecurityPolicyReference|null); + } + + /** Represents a SetSecurityPolicyBackendServiceRequest. */ + class SetSecurityPolicyBackendServiceRequest implements ISetSecurityPolicyBackendServiceRequest { + + /** + * Constructs a new SetSecurityPolicyBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest); + + /** SetSecurityPolicyBackendServiceRequest backendService. */ + public backendService: string; + + /** SetSecurityPolicyBackendServiceRequest project. */ + public project: string; + + /** SetSecurityPolicyBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** SetSecurityPolicyBackendServiceRequest securityPolicyReferenceResource. */ + public securityPolicyReferenceResource?: (google.cloud.compute.v1.ISecurityPolicyReference|null); + + /** SetSecurityPolicyBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetSecurityPolicyBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetSecurityPolicyBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest): google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest; + + /** + * Encodes the specified SetSecurityPolicyBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest.verify|verify} messages. + * @param message SetSecurityPolicyBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetSecurityPolicyBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest.verify|verify} messages. + * @param message SetSecurityPolicyBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetSecurityPolicyBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetSecurityPolicyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest; + + /** + * Decodes a SetSecurityPolicyBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetSecurityPolicyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest; + + /** + * Verifies a SetSecurityPolicyBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetSecurityPolicyBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetSecurityPolicyBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest; + + /** + * Creates a plain object from a SetSecurityPolicyBackendServiceRequest message. Also converts values to other types if specified. + * @param message SetSecurityPolicyBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetSecurityPolicyBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateBackendServiceRequest. */ + interface IUpdateBackendServiceRequest { + + /** UpdateBackendServiceRequest backendService */ + backendService?: (string|null); + + /** UpdateBackendServiceRequest backendServiceResource */ + backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** UpdateBackendServiceRequest project */ + project?: (string|null); + + /** UpdateBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateBackendServiceRequest. */ + class UpdateBackendServiceRequest implements IUpdateBackendServiceRequest { + + /** + * Constructs a new UpdateBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateBackendServiceRequest); + + /** UpdateBackendServiceRequest backendService. */ + public backendService: string; + + /** UpdateBackendServiceRequest backendServiceResource. */ + public backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** UpdateBackendServiceRequest project. */ + public project: string; + + /** UpdateBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** UpdateBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateBackendServiceRequest): google.cloud.compute.v1.UpdateBackendServiceRequest; + + /** + * Encodes the specified UpdateBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendServiceRequest.verify|verify} messages. + * @param message UpdateBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendServiceRequest.verify|verify} messages. + * @param message UpdateBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateBackendServiceRequest; + + /** + * Decodes an UpdateBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateBackendServiceRequest; + + /** + * Verifies an UpdateBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateBackendServiceRequest; + + /** + * Creates a plain object from an UpdateBackendServiceRequest message. Also converts values to other types if specified. + * @param message UpdateBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListDiskTypesRequest. */ + interface IAggregatedListDiskTypesRequest { + + /** AggregatedListDiskTypesRequest filter */ + filter?: (string|null); + + /** AggregatedListDiskTypesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListDiskTypesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListDiskTypesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListDiskTypesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListDiskTypesRequest project */ + project?: (string|null); + + /** AggregatedListDiskTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListDiskTypesRequest. */ + class AggregatedListDiskTypesRequest implements IAggregatedListDiskTypesRequest { + + /** + * Constructs a new AggregatedListDiskTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListDiskTypesRequest); + + /** AggregatedListDiskTypesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListDiskTypesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListDiskTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListDiskTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListDiskTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListDiskTypesRequest project. */ + public project: string; + + /** AggregatedListDiskTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListDiskTypesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListDiskTypesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListDiskTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListDiskTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListDiskTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListDiskTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListDiskTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListDiskTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListDiskTypesRequest): google.cloud.compute.v1.AggregatedListDiskTypesRequest; + + /** + * Encodes the specified AggregatedListDiskTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDiskTypesRequest.verify|verify} messages. + * @param message AggregatedListDiskTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListDiskTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListDiskTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDiskTypesRequest.verify|verify} messages. + * @param message AggregatedListDiskTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListDiskTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListDiskTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListDiskTypesRequest; + + /** + * Decodes an AggregatedListDiskTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListDiskTypesRequest; + + /** + * Verifies an AggregatedListDiskTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListDiskTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListDiskTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListDiskTypesRequest; + + /** + * Creates a plain object from an AggregatedListDiskTypesRequest message. Also converts values to other types if specified. + * @param message AggregatedListDiskTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListDiskTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListDiskTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetDiskTypeRequest. */ + interface IGetDiskTypeRequest { + + /** GetDiskTypeRequest diskType */ + diskType?: (string|null); + + /** GetDiskTypeRequest project */ + project?: (string|null); + + /** GetDiskTypeRequest zone */ + zone?: (string|null); + } + + /** Represents a GetDiskTypeRequest. */ + class GetDiskTypeRequest implements IGetDiskTypeRequest { + + /** + * Constructs a new GetDiskTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetDiskTypeRequest); + + /** GetDiskTypeRequest diskType. */ + public diskType: string; + + /** GetDiskTypeRequest project. */ + public project: string; + + /** GetDiskTypeRequest zone. */ + public zone: string; + + /** + * Creates a new GetDiskTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDiskTypeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetDiskTypeRequest): google.cloud.compute.v1.GetDiskTypeRequest; + + /** + * Encodes the specified GetDiskTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetDiskTypeRequest.verify|verify} messages. + * @param message GetDiskTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetDiskTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDiskTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetDiskTypeRequest.verify|verify} messages. + * @param message GetDiskTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetDiskTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDiskTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetDiskTypeRequest; + + /** + * Decodes a GetDiskTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetDiskTypeRequest; + + /** + * Verifies a GetDiskTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDiskTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDiskTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetDiskTypeRequest; + + /** + * Creates a plain object from a GetDiskTypeRequest message. Also converts values to other types if specified. + * @param message GetDiskTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetDiskTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDiskTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDiskTypesRequest. */ + interface IListDiskTypesRequest { + + /** ListDiskTypesRequest filter */ + filter?: (string|null); + + /** ListDiskTypesRequest maxResults */ + maxResults?: (number|null); + + /** ListDiskTypesRequest orderBy */ + orderBy?: (string|null); + + /** ListDiskTypesRequest pageToken */ + pageToken?: (string|null); + + /** ListDiskTypesRequest project */ + project?: (string|null); + + /** ListDiskTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListDiskTypesRequest zone */ + zone?: (string|null); + } + + /** Represents a ListDiskTypesRequest. */ + class ListDiskTypesRequest implements IListDiskTypesRequest { + + /** + * Constructs a new ListDiskTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListDiskTypesRequest); + + /** ListDiskTypesRequest filter. */ + public filter?: (string|null); + + /** ListDiskTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListDiskTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListDiskTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListDiskTypesRequest project. */ + public project: string; + + /** ListDiskTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListDiskTypesRequest zone. */ + public zone: string; + + /** ListDiskTypesRequest _filter. */ + public _filter?: "filter"; + + /** ListDiskTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListDiskTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListDiskTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListDiskTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListDiskTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDiskTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListDiskTypesRequest): google.cloud.compute.v1.ListDiskTypesRequest; + + /** + * Encodes the specified ListDiskTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListDiskTypesRequest.verify|verify} messages. + * @param message ListDiskTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListDiskTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDiskTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListDiskTypesRequest.verify|verify} messages. + * @param message ListDiskTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListDiskTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDiskTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListDiskTypesRequest; + + /** + * Decodes a ListDiskTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListDiskTypesRequest; + + /** + * Verifies a ListDiskTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDiskTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDiskTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListDiskTypesRequest; + + /** + * Creates a plain object from a ListDiskTypesRequest message. Also converts values to other types if specified. + * @param message ListDiskTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListDiskTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDiskTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddResourcePoliciesDiskRequest. */ + interface IAddResourcePoliciesDiskRequest { + + /** AddResourcePoliciesDiskRequest disk */ + disk?: (string|null); + + /** AddResourcePoliciesDiskRequest disksAddResourcePoliciesRequestResource */ + disksAddResourcePoliciesRequestResource?: (google.cloud.compute.v1.IDisksAddResourcePoliciesRequest|null); + + /** AddResourcePoliciesDiskRequest project */ + project?: (string|null); + + /** AddResourcePoliciesDiskRequest requestId */ + requestId?: (string|null); + + /** AddResourcePoliciesDiskRequest zone */ + zone?: (string|null); + } + + /** Represents an AddResourcePoliciesDiskRequest. */ + class AddResourcePoliciesDiskRequest implements IAddResourcePoliciesDiskRequest { + + /** + * Constructs a new AddResourcePoliciesDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddResourcePoliciesDiskRequest); + + /** AddResourcePoliciesDiskRequest disk. */ + public disk: string; + + /** AddResourcePoliciesDiskRequest disksAddResourcePoliciesRequestResource. */ + public disksAddResourcePoliciesRequestResource?: (google.cloud.compute.v1.IDisksAddResourcePoliciesRequest|null); + + /** AddResourcePoliciesDiskRequest project. */ + public project: string; + + /** AddResourcePoliciesDiskRequest requestId. */ + public requestId?: (string|null); + + /** AddResourcePoliciesDiskRequest zone. */ + public zone: string; + + /** AddResourcePoliciesDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddResourcePoliciesDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddResourcePoliciesDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddResourcePoliciesDiskRequest): google.cloud.compute.v1.AddResourcePoliciesDiskRequest; + + /** + * Encodes the specified AddResourcePoliciesDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesDiskRequest.verify|verify} messages. + * @param message AddResourcePoliciesDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddResourcePoliciesDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesDiskRequest.verify|verify} messages. + * @param message AddResourcePoliciesDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddResourcePoliciesDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddResourcePoliciesDiskRequest; + + /** + * Decodes an AddResourcePoliciesDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddResourcePoliciesDiskRequest; + + /** + * Verifies an AddResourcePoliciesDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddResourcePoliciesDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddResourcePoliciesDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddResourcePoliciesDiskRequest; + + /** + * Creates a plain object from an AddResourcePoliciesDiskRequest message. Also converts values to other types if specified. + * @param message AddResourcePoliciesDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddResourcePoliciesDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddResourcePoliciesDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListDisksRequest. */ + interface IAggregatedListDisksRequest { + + /** AggregatedListDisksRequest filter */ + filter?: (string|null); + + /** AggregatedListDisksRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListDisksRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListDisksRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListDisksRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListDisksRequest project */ + project?: (string|null); + + /** AggregatedListDisksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListDisksRequest. */ + class AggregatedListDisksRequest implements IAggregatedListDisksRequest { + + /** + * Constructs a new AggregatedListDisksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListDisksRequest); + + /** AggregatedListDisksRequest filter. */ + public filter?: (string|null); + + /** AggregatedListDisksRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListDisksRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListDisksRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListDisksRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListDisksRequest project. */ + public project: string; + + /** AggregatedListDisksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListDisksRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListDisksRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListDisksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListDisksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListDisksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListDisksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListDisksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListDisksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListDisksRequest): google.cloud.compute.v1.AggregatedListDisksRequest; + + /** + * Encodes the specified AggregatedListDisksRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDisksRequest.verify|verify} messages. + * @param message AggregatedListDisksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListDisksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListDisksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDisksRequest.verify|verify} messages. + * @param message AggregatedListDisksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListDisksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListDisksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListDisksRequest; + + /** + * Decodes an AggregatedListDisksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListDisksRequest; + + /** + * Verifies an AggregatedListDisksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListDisksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListDisksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListDisksRequest; + + /** + * Creates a plain object from an AggregatedListDisksRequest message. Also converts values to other types if specified. + * @param message AggregatedListDisksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListDisksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListDisksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateSnapshotDiskRequest. */ + interface ICreateSnapshotDiskRequest { + + /** CreateSnapshotDiskRequest disk */ + disk?: (string|null); + + /** CreateSnapshotDiskRequest guestFlush */ + guestFlush?: (boolean|null); + + /** CreateSnapshotDiskRequest project */ + project?: (string|null); + + /** CreateSnapshotDiskRequest requestId */ + requestId?: (string|null); + + /** CreateSnapshotDiskRequest snapshotResource */ + snapshotResource?: (google.cloud.compute.v1.ISnapshot|null); + + /** CreateSnapshotDiskRequest zone */ + zone?: (string|null); + } + + /** Represents a CreateSnapshotDiskRequest. */ + class CreateSnapshotDiskRequest implements ICreateSnapshotDiskRequest { + + /** + * Constructs a new CreateSnapshotDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICreateSnapshotDiskRequest); + + /** CreateSnapshotDiskRequest disk. */ + public disk: string; + + /** CreateSnapshotDiskRequest guestFlush. */ + public guestFlush?: (boolean|null); + + /** CreateSnapshotDiskRequest project. */ + public project: string; + + /** CreateSnapshotDiskRequest requestId. */ + public requestId?: (string|null); + + /** CreateSnapshotDiskRequest snapshotResource. */ + public snapshotResource?: (google.cloud.compute.v1.ISnapshot|null); + + /** CreateSnapshotDiskRequest zone. */ + public zone: string; + + /** CreateSnapshotDiskRequest _guestFlush. */ + public _guestFlush?: "guestFlush"; + + /** CreateSnapshotDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new CreateSnapshotDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSnapshotDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ICreateSnapshotDiskRequest): google.cloud.compute.v1.CreateSnapshotDiskRequest; + + /** + * Encodes the specified CreateSnapshotDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotDiskRequest.verify|verify} messages. + * @param message CreateSnapshotDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICreateSnapshotDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSnapshotDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotDiskRequest.verify|verify} messages. + * @param message CreateSnapshotDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICreateSnapshotDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSnapshotDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSnapshotDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CreateSnapshotDiskRequest; + + /** + * Decodes a CreateSnapshotDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSnapshotDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CreateSnapshotDiskRequest; + + /** + * Verifies a CreateSnapshotDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSnapshotDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSnapshotDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CreateSnapshotDiskRequest; + + /** + * Creates a plain object from a CreateSnapshotDiskRequest message. Also converts values to other types if specified. + * @param message CreateSnapshotDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CreateSnapshotDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSnapshotDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteDiskRequest. */ + interface IDeleteDiskRequest { + + /** DeleteDiskRequest disk */ + disk?: (string|null); + + /** DeleteDiskRequest project */ + project?: (string|null); + + /** DeleteDiskRequest requestId */ + requestId?: (string|null); + + /** DeleteDiskRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteDiskRequest. */ + class DeleteDiskRequest implements IDeleteDiskRequest { + + /** + * Constructs a new DeleteDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteDiskRequest); + + /** DeleteDiskRequest disk. */ + public disk: string; + + /** DeleteDiskRequest project. */ + public project: string; + + /** DeleteDiskRequest requestId. */ + public requestId?: (string|null); + + /** DeleteDiskRequest zone. */ + public zone: string; + + /** DeleteDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteDiskRequest): google.cloud.compute.v1.DeleteDiskRequest; + + /** + * Encodes the specified DeleteDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteDiskRequest.verify|verify} messages. + * @param message DeleteDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteDiskRequest.verify|verify} messages. + * @param message DeleteDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteDiskRequest; + + /** + * Decodes a DeleteDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteDiskRequest; + + /** + * Verifies a DeleteDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteDiskRequest; + + /** + * Creates a plain object from a DeleteDiskRequest message. Also converts values to other types if specified. + * @param message DeleteDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetDiskRequest. */ + interface IGetDiskRequest { + + /** GetDiskRequest disk */ + disk?: (string|null); + + /** GetDiskRequest project */ + project?: (string|null); + + /** GetDiskRequest zone */ + zone?: (string|null); + } + + /** Represents a GetDiskRequest. */ + class GetDiskRequest implements IGetDiskRequest { + + /** + * Constructs a new GetDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetDiskRequest); + + /** GetDiskRequest disk. */ + public disk: string; + + /** GetDiskRequest project. */ + public project: string; + + /** GetDiskRequest zone. */ + public zone: string; + + /** + * Creates a new GetDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetDiskRequest): google.cloud.compute.v1.GetDiskRequest; + + /** + * Encodes the specified GetDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetDiskRequest.verify|verify} messages. + * @param message GetDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetDiskRequest.verify|verify} messages. + * @param message GetDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetDiskRequest; + + /** + * Decodes a GetDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetDiskRequest; + + /** + * Verifies a GetDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetDiskRequest; + + /** + * Creates a plain object from a GetDiskRequest message. Also converts values to other types if specified. + * @param message GetDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyDiskRequest. */ + interface IGetIamPolicyDiskRequest { + + /** GetIamPolicyDiskRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyDiskRequest project */ + project?: (string|null); + + /** GetIamPolicyDiskRequest resource */ + resource?: (string|null); + + /** GetIamPolicyDiskRequest zone */ + zone?: (string|null); + } + + /** Represents a GetIamPolicyDiskRequest. */ + class GetIamPolicyDiskRequest implements IGetIamPolicyDiskRequest { + + /** + * Constructs a new GetIamPolicyDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyDiskRequest); + + /** GetIamPolicyDiskRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyDiskRequest project. */ + public project: string; + + /** GetIamPolicyDiskRequest resource. */ + public resource: string; + + /** GetIamPolicyDiskRequest zone. */ + public zone: string; + + /** GetIamPolicyDiskRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyDiskRequest): google.cloud.compute.v1.GetIamPolicyDiskRequest; + + /** + * Encodes the specified GetIamPolicyDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyDiskRequest.verify|verify} messages. + * @param message GetIamPolicyDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyDiskRequest.verify|verify} messages. + * @param message GetIamPolicyDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyDiskRequest; + + /** + * Decodes a GetIamPolicyDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyDiskRequest; + + /** + * Verifies a GetIamPolicyDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyDiskRequest; + + /** + * Creates a plain object from a GetIamPolicyDiskRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertDiskRequest. */ + interface IInsertDiskRequest { + + /** InsertDiskRequest diskResource */ + diskResource?: (google.cloud.compute.v1.IDisk|null); + + /** InsertDiskRequest project */ + project?: (string|null); + + /** InsertDiskRequest requestId */ + requestId?: (string|null); + + /** InsertDiskRequest sourceImage */ + sourceImage?: (string|null); + + /** InsertDiskRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertDiskRequest. */ + class InsertDiskRequest implements IInsertDiskRequest { + + /** + * Constructs a new InsertDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertDiskRequest); + + /** InsertDiskRequest diskResource. */ + public diskResource?: (google.cloud.compute.v1.IDisk|null); + + /** InsertDiskRequest project. */ + public project: string; + + /** InsertDiskRequest requestId. */ + public requestId?: (string|null); + + /** InsertDiskRequest sourceImage. */ + public sourceImage?: (string|null); + + /** InsertDiskRequest zone. */ + public zone: string; + + /** InsertDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** InsertDiskRequest _sourceImage. */ + public _sourceImage?: "sourceImage"; + + /** + * Creates a new InsertDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertDiskRequest): google.cloud.compute.v1.InsertDiskRequest; + + /** + * Encodes the specified InsertDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertDiskRequest.verify|verify} messages. + * @param message InsertDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertDiskRequest.verify|verify} messages. + * @param message InsertDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertDiskRequest; + + /** + * Decodes an InsertDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertDiskRequest; + + /** + * Verifies an InsertDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertDiskRequest; + + /** + * Creates a plain object from an InsertDiskRequest message. Also converts values to other types if specified. + * @param message InsertDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDisksRequest. */ + interface IListDisksRequest { + + /** ListDisksRequest filter */ + filter?: (string|null); + + /** ListDisksRequest maxResults */ + maxResults?: (number|null); + + /** ListDisksRequest orderBy */ + orderBy?: (string|null); + + /** ListDisksRequest pageToken */ + pageToken?: (string|null); + + /** ListDisksRequest project */ + project?: (string|null); + + /** ListDisksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListDisksRequest zone */ + zone?: (string|null); + } + + /** Represents a ListDisksRequest. */ + class ListDisksRequest implements IListDisksRequest { + + /** + * Constructs a new ListDisksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListDisksRequest); + + /** ListDisksRequest filter. */ + public filter?: (string|null); + + /** ListDisksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListDisksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListDisksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListDisksRequest project. */ + public project: string; + + /** ListDisksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListDisksRequest zone. */ + public zone: string; + + /** ListDisksRequest _filter. */ + public _filter?: "filter"; + + /** ListDisksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListDisksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListDisksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListDisksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListDisksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDisksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListDisksRequest): google.cloud.compute.v1.ListDisksRequest; + + /** + * Encodes the specified ListDisksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListDisksRequest.verify|verify} messages. + * @param message ListDisksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListDisksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDisksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListDisksRequest.verify|verify} messages. + * @param message ListDisksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListDisksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDisksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListDisksRequest; + + /** + * Decodes a ListDisksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListDisksRequest; + + /** + * Verifies a ListDisksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDisksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDisksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListDisksRequest; + + /** + * Creates a plain object from a ListDisksRequest message. Also converts values to other types if specified. + * @param message ListDisksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListDisksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDisksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveResourcePoliciesDiskRequest. */ + interface IRemoveResourcePoliciesDiskRequest { + + /** RemoveResourcePoliciesDiskRequest disk */ + disk?: (string|null); + + /** RemoveResourcePoliciesDiskRequest disksRemoveResourcePoliciesRequestResource */ + disksRemoveResourcePoliciesRequestResource?: (google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest|null); + + /** RemoveResourcePoliciesDiskRequest project */ + project?: (string|null); + + /** RemoveResourcePoliciesDiskRequest requestId */ + requestId?: (string|null); + + /** RemoveResourcePoliciesDiskRequest zone */ + zone?: (string|null); + } + + /** Represents a RemoveResourcePoliciesDiskRequest. */ + class RemoveResourcePoliciesDiskRequest implements IRemoveResourcePoliciesDiskRequest { + + /** + * Constructs a new RemoveResourcePoliciesDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest); + + /** RemoveResourcePoliciesDiskRequest disk. */ + public disk: string; + + /** RemoveResourcePoliciesDiskRequest disksRemoveResourcePoliciesRequestResource. */ + public disksRemoveResourcePoliciesRequestResource?: (google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest|null); + + /** RemoveResourcePoliciesDiskRequest project. */ + public project: string; + + /** RemoveResourcePoliciesDiskRequest requestId. */ + public requestId?: (string|null); + + /** RemoveResourcePoliciesDiskRequest zone. */ + public zone: string; + + /** RemoveResourcePoliciesDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveResourcePoliciesDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveResourcePoliciesDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest): google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest; + + /** + * Encodes the specified RemoveResourcePoliciesDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest.verify|verify} messages. + * @param message RemoveResourcePoliciesDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveResourcePoliciesDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest.verify|verify} messages. + * @param message RemoveResourcePoliciesDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveResourcePoliciesDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest; + + /** + * Decodes a RemoveResourcePoliciesDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest; + + /** + * Verifies a RemoveResourcePoliciesDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveResourcePoliciesDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveResourcePoliciesDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest; + + /** + * Creates a plain object from a RemoveResourcePoliciesDiskRequest message. Also converts values to other types if specified. + * @param message RemoveResourcePoliciesDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveResourcePoliciesDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResizeDiskRequest. */ + interface IResizeDiskRequest { + + /** ResizeDiskRequest disk */ + disk?: (string|null); + + /** ResizeDiskRequest disksResizeRequestResource */ + disksResizeRequestResource?: (google.cloud.compute.v1.IDisksResizeRequest|null); + + /** ResizeDiskRequest project */ + project?: (string|null); + + /** ResizeDiskRequest requestId */ + requestId?: (string|null); + + /** ResizeDiskRequest zone */ + zone?: (string|null); + } + + /** Represents a ResizeDiskRequest. */ + class ResizeDiskRequest implements IResizeDiskRequest { + + /** + * Constructs a new ResizeDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResizeDiskRequest); + + /** ResizeDiskRequest disk. */ + public disk: string; + + /** ResizeDiskRequest disksResizeRequestResource. */ + public disksResizeRequestResource?: (google.cloud.compute.v1.IDisksResizeRequest|null); + + /** ResizeDiskRequest project. */ + public project: string; + + /** ResizeDiskRequest requestId. */ + public requestId?: (string|null); + + /** ResizeDiskRequest zone. */ + public zone: string; + + /** ResizeDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new ResizeDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResizeDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IResizeDiskRequest): google.cloud.compute.v1.ResizeDiskRequest; + + /** + * Encodes the specified ResizeDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeDiskRequest.verify|verify} messages. + * @param message ResizeDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResizeDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResizeDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeDiskRequest.verify|verify} messages. + * @param message ResizeDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResizeDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResizeDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResizeDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResizeDiskRequest; + + /** + * Decodes a ResizeDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResizeDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResizeDiskRequest; + + /** + * Verifies a ResizeDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResizeDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResizeDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResizeDiskRequest; + + /** + * Creates a plain object from a ResizeDiskRequest message. Also converts values to other types if specified. + * @param message ResizeDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResizeDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResizeDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyDiskRequest. */ + interface ISetIamPolicyDiskRequest { + + /** SetIamPolicyDiskRequest project */ + project?: (string|null); + + /** SetIamPolicyDiskRequest resource */ + resource?: (string|null); + + /** SetIamPolicyDiskRequest zone */ + zone?: (string|null); + + /** SetIamPolicyDiskRequest zoneSetPolicyRequestResource */ + zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + } + + /** Represents a SetIamPolicyDiskRequest. */ + class SetIamPolicyDiskRequest implements ISetIamPolicyDiskRequest { + + /** + * Constructs a new SetIamPolicyDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyDiskRequest); + + /** SetIamPolicyDiskRequest project. */ + public project: string; + + /** SetIamPolicyDiskRequest resource. */ + public resource: string; + + /** SetIamPolicyDiskRequest zone. */ + public zone: string; + + /** SetIamPolicyDiskRequest zoneSetPolicyRequestResource. */ + public zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + + /** + * Creates a new SetIamPolicyDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyDiskRequest): google.cloud.compute.v1.SetIamPolicyDiskRequest; + + /** + * Encodes the specified SetIamPolicyDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyDiskRequest.verify|verify} messages. + * @param message SetIamPolicyDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyDiskRequest.verify|verify} messages. + * @param message SetIamPolicyDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyDiskRequest; + + /** + * Decodes a SetIamPolicyDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyDiskRequest; + + /** + * Verifies a SetIamPolicyDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyDiskRequest; + + /** + * Creates a plain object from a SetIamPolicyDiskRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsDiskRequest. */ + interface ISetLabelsDiskRequest { + + /** SetLabelsDiskRequest project */ + project?: (string|null); + + /** SetLabelsDiskRequest requestId */ + requestId?: (string|null); + + /** SetLabelsDiskRequest resource */ + resource?: (string|null); + + /** SetLabelsDiskRequest zone */ + zone?: (string|null); + + /** SetLabelsDiskRequest zoneSetLabelsRequestResource */ + zoneSetLabelsRequestResource?: (google.cloud.compute.v1.IZoneSetLabelsRequest|null); + } + + /** Represents a SetLabelsDiskRequest. */ + class SetLabelsDiskRequest implements ISetLabelsDiskRequest { + + /** + * Constructs a new SetLabelsDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsDiskRequest); + + /** SetLabelsDiskRequest project. */ + public project: string; + + /** SetLabelsDiskRequest requestId. */ + public requestId?: (string|null); + + /** SetLabelsDiskRequest resource. */ + public resource: string; + + /** SetLabelsDiskRequest zone. */ + public zone: string; + + /** SetLabelsDiskRequest zoneSetLabelsRequestResource. */ + public zoneSetLabelsRequestResource?: (google.cloud.compute.v1.IZoneSetLabelsRequest|null); + + /** SetLabelsDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetLabelsDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsDiskRequest): google.cloud.compute.v1.SetLabelsDiskRequest; + + /** + * Encodes the specified SetLabelsDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsDiskRequest.verify|verify} messages. + * @param message SetLabelsDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsDiskRequest.verify|verify} messages. + * @param message SetLabelsDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsDiskRequest; + + /** + * Decodes a SetLabelsDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsDiskRequest; + + /** + * Verifies a SetLabelsDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsDiskRequest; + + /** + * Creates a plain object from a SetLabelsDiskRequest message. Also converts values to other types if specified. + * @param message SetLabelsDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsDiskRequest. */ + interface ITestIamPermissionsDiskRequest { + + /** TestIamPermissionsDiskRequest project */ + project?: (string|null); + + /** TestIamPermissionsDiskRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsDiskRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsDiskRequest zone */ + zone?: (string|null); + } + + /** Represents a TestIamPermissionsDiskRequest. */ + class TestIamPermissionsDiskRequest implements ITestIamPermissionsDiskRequest { + + /** + * Constructs a new TestIamPermissionsDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsDiskRequest); + + /** TestIamPermissionsDiskRequest project. */ + public project: string; + + /** TestIamPermissionsDiskRequest resource. */ + public resource: string; + + /** TestIamPermissionsDiskRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsDiskRequest zone. */ + public zone: string; + + /** + * Creates a new TestIamPermissionsDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsDiskRequest): google.cloud.compute.v1.TestIamPermissionsDiskRequest; + + /** + * Encodes the specified TestIamPermissionsDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsDiskRequest.verify|verify} messages. + * @param message TestIamPermissionsDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsDiskRequest.verify|verify} messages. + * @param message TestIamPermissionsDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsDiskRequest; + + /** + * Decodes a TestIamPermissionsDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsDiskRequest; + + /** + * Verifies a TestIamPermissionsDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsDiskRequest; + + /** + * Creates a plain object from a TestIamPermissionsDiskRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteExternalVpnGatewayRequest. */ + interface IDeleteExternalVpnGatewayRequest { + + /** DeleteExternalVpnGatewayRequest externalVpnGateway */ + externalVpnGateway?: (string|null); + + /** DeleteExternalVpnGatewayRequest project */ + project?: (string|null); + + /** DeleteExternalVpnGatewayRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteExternalVpnGatewayRequest. */ + class DeleteExternalVpnGatewayRequest implements IDeleteExternalVpnGatewayRequest { + + /** + * Constructs a new DeleteExternalVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest); + + /** DeleteExternalVpnGatewayRequest externalVpnGateway. */ + public externalVpnGateway: string; + + /** DeleteExternalVpnGatewayRequest project. */ + public project: string; + + /** DeleteExternalVpnGatewayRequest requestId. */ + public requestId?: (string|null); + + /** DeleteExternalVpnGatewayRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteExternalVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteExternalVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest): google.cloud.compute.v1.DeleteExternalVpnGatewayRequest; + + /** + * Encodes the specified DeleteExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteExternalVpnGatewayRequest.verify|verify} messages. + * @param message DeleteExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteExternalVpnGatewayRequest.verify|verify} messages. + * @param message DeleteExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteExternalVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteExternalVpnGatewayRequest; + + /** + * Decodes a DeleteExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteExternalVpnGatewayRequest; + + /** + * Verifies a DeleteExternalVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteExternalVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteExternalVpnGatewayRequest; + + /** + * Creates a plain object from a DeleteExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @param message DeleteExternalVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteExternalVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteExternalVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetExternalVpnGatewayRequest. */ + interface IGetExternalVpnGatewayRequest { + + /** GetExternalVpnGatewayRequest externalVpnGateway */ + externalVpnGateway?: (string|null); + + /** GetExternalVpnGatewayRequest project */ + project?: (string|null); + } + + /** Represents a GetExternalVpnGatewayRequest. */ + class GetExternalVpnGatewayRequest implements IGetExternalVpnGatewayRequest { + + /** + * Constructs a new GetExternalVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetExternalVpnGatewayRequest); + + /** GetExternalVpnGatewayRequest externalVpnGateway. */ + public externalVpnGateway: string; + + /** GetExternalVpnGatewayRequest project. */ + public project: string; + + /** + * Creates a new GetExternalVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetExternalVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetExternalVpnGatewayRequest): google.cloud.compute.v1.GetExternalVpnGatewayRequest; + + /** + * Encodes the specified GetExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetExternalVpnGatewayRequest.verify|verify} messages. + * @param message GetExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetExternalVpnGatewayRequest.verify|verify} messages. + * @param message GetExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetExternalVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetExternalVpnGatewayRequest; + + /** + * Decodes a GetExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetExternalVpnGatewayRequest; + + /** + * Verifies a GetExternalVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetExternalVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetExternalVpnGatewayRequest; + + /** + * Creates a plain object from a GetExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @param message GetExternalVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetExternalVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetExternalVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertExternalVpnGatewayRequest. */ + interface IInsertExternalVpnGatewayRequest { + + /** InsertExternalVpnGatewayRequest externalVpnGatewayResource */ + externalVpnGatewayResource?: (google.cloud.compute.v1.IExternalVpnGateway|null); + + /** InsertExternalVpnGatewayRequest project */ + project?: (string|null); + + /** InsertExternalVpnGatewayRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertExternalVpnGatewayRequest. */ + class InsertExternalVpnGatewayRequest implements IInsertExternalVpnGatewayRequest { + + /** + * Constructs a new InsertExternalVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertExternalVpnGatewayRequest); + + /** InsertExternalVpnGatewayRequest externalVpnGatewayResource. */ + public externalVpnGatewayResource?: (google.cloud.compute.v1.IExternalVpnGateway|null); + + /** InsertExternalVpnGatewayRequest project. */ + public project: string; + + /** InsertExternalVpnGatewayRequest requestId. */ + public requestId?: (string|null); + + /** InsertExternalVpnGatewayRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertExternalVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertExternalVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertExternalVpnGatewayRequest): google.cloud.compute.v1.InsertExternalVpnGatewayRequest; + + /** + * Encodes the specified InsertExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertExternalVpnGatewayRequest.verify|verify} messages. + * @param message InsertExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertExternalVpnGatewayRequest.verify|verify} messages. + * @param message InsertExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertExternalVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertExternalVpnGatewayRequest; + + /** + * Decodes an InsertExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertExternalVpnGatewayRequest; + + /** + * Verifies an InsertExternalVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertExternalVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertExternalVpnGatewayRequest; + + /** + * Creates a plain object from an InsertExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @param message InsertExternalVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertExternalVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertExternalVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListExternalVpnGatewaysRequest. */ + interface IListExternalVpnGatewaysRequest { + + /** ListExternalVpnGatewaysRequest filter */ + filter?: (string|null); + + /** ListExternalVpnGatewaysRequest maxResults */ + maxResults?: (number|null); + + /** ListExternalVpnGatewaysRequest orderBy */ + orderBy?: (string|null); + + /** ListExternalVpnGatewaysRequest pageToken */ + pageToken?: (string|null); + + /** ListExternalVpnGatewaysRequest project */ + project?: (string|null); + + /** ListExternalVpnGatewaysRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListExternalVpnGatewaysRequest. */ + class ListExternalVpnGatewaysRequest implements IListExternalVpnGatewaysRequest { + + /** + * Constructs a new ListExternalVpnGatewaysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListExternalVpnGatewaysRequest); + + /** ListExternalVpnGatewaysRequest filter. */ + public filter?: (string|null); + + /** ListExternalVpnGatewaysRequest maxResults. */ + public maxResults?: (number|null); + + /** ListExternalVpnGatewaysRequest orderBy. */ + public orderBy?: (string|null); + + /** ListExternalVpnGatewaysRequest pageToken. */ + public pageToken?: (string|null); + + /** ListExternalVpnGatewaysRequest project. */ + public project: string; + + /** ListExternalVpnGatewaysRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListExternalVpnGatewaysRequest _filter. */ + public _filter?: "filter"; + + /** ListExternalVpnGatewaysRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListExternalVpnGatewaysRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListExternalVpnGatewaysRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListExternalVpnGatewaysRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListExternalVpnGatewaysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListExternalVpnGatewaysRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListExternalVpnGatewaysRequest): google.cloud.compute.v1.ListExternalVpnGatewaysRequest; + + /** + * Encodes the specified ListExternalVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.ListExternalVpnGatewaysRequest.verify|verify} messages. + * @param message ListExternalVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListExternalVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListExternalVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListExternalVpnGatewaysRequest.verify|verify} messages. + * @param message ListExternalVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListExternalVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListExternalVpnGatewaysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListExternalVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListExternalVpnGatewaysRequest; + + /** + * Decodes a ListExternalVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListExternalVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListExternalVpnGatewaysRequest; + + /** + * Verifies a ListExternalVpnGatewaysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListExternalVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListExternalVpnGatewaysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListExternalVpnGatewaysRequest; + + /** + * Creates a plain object from a ListExternalVpnGatewaysRequest message. Also converts values to other types if specified. + * @param message ListExternalVpnGatewaysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListExternalVpnGatewaysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListExternalVpnGatewaysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsExternalVpnGatewayRequest. */ + interface ISetLabelsExternalVpnGatewayRequest { + + /** SetLabelsExternalVpnGatewayRequest globalSetLabelsRequestResource */ + globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsExternalVpnGatewayRequest project */ + project?: (string|null); + + /** SetLabelsExternalVpnGatewayRequest resource */ + resource?: (string|null); + } + + /** Represents a SetLabelsExternalVpnGatewayRequest. */ + class SetLabelsExternalVpnGatewayRequest implements ISetLabelsExternalVpnGatewayRequest { + + /** + * Constructs a new SetLabelsExternalVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest); + + /** SetLabelsExternalVpnGatewayRequest globalSetLabelsRequestResource. */ + public globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsExternalVpnGatewayRequest project. */ + public project: string; + + /** SetLabelsExternalVpnGatewayRequest resource. */ + public resource: string; + + /** + * Creates a new SetLabelsExternalVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsExternalVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest): google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest; + + /** + * Encodes the specified SetLabelsExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest.verify|verify} messages. + * @param message SetLabelsExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest.verify|verify} messages. + * @param message SetLabelsExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsExternalVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest; + + /** + * Decodes a SetLabelsExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest; + + /** + * Verifies a SetLabelsExternalVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsExternalVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest; + + /** + * Creates a plain object from a SetLabelsExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @param message SetLabelsExternalVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsExternalVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsExternalVpnGatewayRequest. */ + interface ITestIamPermissionsExternalVpnGatewayRequest { + + /** TestIamPermissionsExternalVpnGatewayRequest project */ + project?: (string|null); + + /** TestIamPermissionsExternalVpnGatewayRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsExternalVpnGatewayRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsExternalVpnGatewayRequest. */ + class TestIamPermissionsExternalVpnGatewayRequest implements ITestIamPermissionsExternalVpnGatewayRequest { + + /** + * Constructs a new TestIamPermissionsExternalVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest); + + /** TestIamPermissionsExternalVpnGatewayRequest project. */ + public project: string; + + /** TestIamPermissionsExternalVpnGatewayRequest resource. */ + public resource: string; + + /** TestIamPermissionsExternalVpnGatewayRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsExternalVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsExternalVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest): google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest; + + /** + * Encodes the specified TestIamPermissionsExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest.verify|verify} messages. + * @param message TestIamPermissionsExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest.verify|verify} messages. + * @param message TestIamPermissionsExternalVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsExternalVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest; + + /** + * Decodes a TestIamPermissionsExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest; + + /** + * Verifies a TestIamPermissionsExternalVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsExternalVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest; + + /** + * Creates a plain object from a TestIamPermissionsExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsExternalVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsExternalVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddAssociationFirewallPolicyRequest. */ + interface IAddAssociationFirewallPolicyRequest { + + /** AddAssociationFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** AddAssociationFirewallPolicyRequest firewallPolicyAssociationResource */ + firewallPolicyAssociationResource?: (google.cloud.compute.v1.IFirewallPolicyAssociation|null); + + /** AddAssociationFirewallPolicyRequest replaceExistingAssociation */ + replaceExistingAssociation?: (boolean|null); + + /** AddAssociationFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AddAssociationFirewallPolicyRequest. */ + class AddAssociationFirewallPolicyRequest implements IAddAssociationFirewallPolicyRequest { + + /** + * Constructs a new AddAssociationFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest); + + /** AddAssociationFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** AddAssociationFirewallPolicyRequest firewallPolicyAssociationResource. */ + public firewallPolicyAssociationResource?: (google.cloud.compute.v1.IFirewallPolicyAssociation|null); + + /** AddAssociationFirewallPolicyRequest replaceExistingAssociation. */ + public replaceExistingAssociation?: (boolean|null); + + /** AddAssociationFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** AddAssociationFirewallPolicyRequest _replaceExistingAssociation. */ + public _replaceExistingAssociation?: "replaceExistingAssociation"; + + /** AddAssociationFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddAssociationFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddAssociationFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest): google.cloud.compute.v1.AddAssociationFirewallPolicyRequest; + + /** + * Encodes the specified AddAssociationFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.AddAssociationFirewallPolicyRequest.verify|verify} messages. + * @param message AddAssociationFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddAssociationFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddAssociationFirewallPolicyRequest.verify|verify} messages. + * @param message AddAssociationFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddAssociationFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddAssociationFirewallPolicyRequest; + + /** + * Decodes an AddAssociationFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddAssociationFirewallPolicyRequest; + + /** + * Verifies an AddAssociationFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddAssociationFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddAssociationFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddAssociationFirewallPolicyRequest; + + /** + * Creates a plain object from an AddAssociationFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message AddAssociationFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddAssociationFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddAssociationFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddRuleFirewallPolicyRequest. */ + interface IAddRuleFirewallPolicyRequest { + + /** AddRuleFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** AddRuleFirewallPolicyRequest firewallPolicyRuleResource */ + firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** AddRuleFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AddRuleFirewallPolicyRequest. */ + class AddRuleFirewallPolicyRequest implements IAddRuleFirewallPolicyRequest { + + /** + * Constructs a new AddRuleFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddRuleFirewallPolicyRequest); + + /** AddRuleFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** AddRuleFirewallPolicyRequest firewallPolicyRuleResource. */ + public firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** AddRuleFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** AddRuleFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddRuleFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddRuleFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddRuleFirewallPolicyRequest): google.cloud.compute.v1.AddRuleFirewallPolicyRequest; + + /** + * Encodes the specified AddRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.AddRuleFirewallPolicyRequest.verify|verify} messages. + * @param message AddRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddRuleFirewallPolicyRequest.verify|verify} messages. + * @param message AddRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddRuleFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddRuleFirewallPolicyRequest; + + /** + * Decodes an AddRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddRuleFirewallPolicyRequest; + + /** + * Verifies an AddRuleFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddRuleFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddRuleFirewallPolicyRequest; + + /** + * Creates a plain object from an AddRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message AddRuleFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddRuleFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddRuleFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CloneRulesFirewallPolicyRequest. */ + interface ICloneRulesFirewallPolicyRequest { + + /** CloneRulesFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** CloneRulesFirewallPolicyRequest requestId */ + requestId?: (string|null); + + /** CloneRulesFirewallPolicyRequest sourceFirewallPolicy */ + sourceFirewallPolicy?: (string|null); + } + + /** Represents a CloneRulesFirewallPolicyRequest. */ + class CloneRulesFirewallPolicyRequest implements ICloneRulesFirewallPolicyRequest { + + /** + * Constructs a new CloneRulesFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest); + + /** CloneRulesFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** CloneRulesFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** CloneRulesFirewallPolicyRequest sourceFirewallPolicy. */ + public sourceFirewallPolicy?: (string|null); + + /** CloneRulesFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** CloneRulesFirewallPolicyRequest _sourceFirewallPolicy. */ + public _sourceFirewallPolicy?: "sourceFirewallPolicy"; + + /** + * Creates a new CloneRulesFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CloneRulesFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest): google.cloud.compute.v1.CloneRulesFirewallPolicyRequest; + + /** + * Encodes the specified CloneRulesFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.CloneRulesFirewallPolicyRequest.verify|verify} messages. + * @param message CloneRulesFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloneRulesFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CloneRulesFirewallPolicyRequest.verify|verify} messages. + * @param message CloneRulesFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloneRulesFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloneRulesFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CloneRulesFirewallPolicyRequest; + + /** + * Decodes a CloneRulesFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloneRulesFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CloneRulesFirewallPolicyRequest; + + /** + * Verifies a CloneRulesFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloneRulesFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloneRulesFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CloneRulesFirewallPolicyRequest; + + /** + * Creates a plain object from a CloneRulesFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message CloneRulesFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CloneRulesFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloneRulesFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteFirewallPolicyRequest. */ + interface IDeleteFirewallPolicyRequest { + + /** DeleteFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** DeleteFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteFirewallPolicyRequest. */ + class DeleteFirewallPolicyRequest implements IDeleteFirewallPolicyRequest { + + /** + * Constructs a new DeleteFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteFirewallPolicyRequest); + + /** DeleteFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** DeleteFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteFirewallPolicyRequest): google.cloud.compute.v1.DeleteFirewallPolicyRequest; + + /** + * Encodes the specified DeleteFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallPolicyRequest.verify|verify} messages. + * @param message DeleteFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallPolicyRequest.verify|verify} messages. + * @param message DeleteFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteFirewallPolicyRequest; + + /** + * Decodes a DeleteFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteFirewallPolicyRequest; + + /** + * Verifies a DeleteFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteFirewallPolicyRequest; + + /** + * Creates a plain object from a DeleteFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetFirewallPolicyRequest. */ + interface IGetFirewallPolicyRequest { + + /** GetFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + } + + /** Represents a GetFirewallPolicyRequest. */ + class GetFirewallPolicyRequest implements IGetFirewallPolicyRequest { + + /** + * Constructs a new GetFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetFirewallPolicyRequest); + + /** GetFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** + * Creates a new GetFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetFirewallPolicyRequest): google.cloud.compute.v1.GetFirewallPolicyRequest; + + /** + * Encodes the specified GetFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetFirewallPolicyRequest.verify|verify} messages. + * @param message GetFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetFirewallPolicyRequest.verify|verify} messages. + * @param message GetFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetFirewallPolicyRequest; + + /** + * Decodes a GetFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetFirewallPolicyRequest; + + /** + * Verifies a GetFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetFirewallPolicyRequest; + + /** + * Creates a plain object from a GetFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message GetFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetAssociationFirewallPolicyRequest. */ + interface IGetAssociationFirewallPolicyRequest { + + /** GetAssociationFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** GetAssociationFirewallPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetAssociationFirewallPolicyRequest. */ + class GetAssociationFirewallPolicyRequest implements IGetAssociationFirewallPolicyRequest { + + /** + * Constructs a new GetAssociationFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest); + + /** GetAssociationFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** GetAssociationFirewallPolicyRequest name. */ + public name?: (string|null); + + /** GetAssociationFirewallPolicyRequest _name. */ + public _name?: "name"; + + /** + * Creates a new GetAssociationFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAssociationFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest): google.cloud.compute.v1.GetAssociationFirewallPolicyRequest; + + /** + * Encodes the specified GetAssociationFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAssociationFirewallPolicyRequest.verify|verify} messages. + * @param message GetAssociationFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAssociationFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAssociationFirewallPolicyRequest.verify|verify} messages. + * @param message GetAssociationFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAssociationFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetAssociationFirewallPolicyRequest; + + /** + * Decodes a GetAssociationFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetAssociationFirewallPolicyRequest; + + /** + * Verifies a GetAssociationFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAssociationFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAssociationFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetAssociationFirewallPolicyRequest; + + /** + * Creates a plain object from a GetAssociationFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message GetAssociationFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetAssociationFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAssociationFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyFirewallPolicyRequest. */ + interface IGetIamPolicyFirewallPolicyRequest { + + /** GetIamPolicyFirewallPolicyRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyFirewallPolicyRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicyFirewallPolicyRequest. */ + class GetIamPolicyFirewallPolicyRequest implements IGetIamPolicyFirewallPolicyRequest { + + /** + * Constructs a new GetIamPolicyFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest); + + /** GetIamPolicyFirewallPolicyRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyFirewallPolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyFirewallPolicyRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest): google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest; + + /** + * Encodes the specified GetIamPolicyFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @param message GetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest; + + /** + * Decodes a GetIamPolicyFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest; + + /** + * Verifies a GetIamPolicyFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRuleFirewallPolicyRequest. */ + interface IGetRuleFirewallPolicyRequest { + + /** GetRuleFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** GetRuleFirewallPolicyRequest priority */ + priority?: (number|null); + } + + /** Represents a GetRuleFirewallPolicyRequest. */ + class GetRuleFirewallPolicyRequest implements IGetRuleFirewallPolicyRequest { + + /** + * Constructs a new GetRuleFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRuleFirewallPolicyRequest); + + /** GetRuleFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** GetRuleFirewallPolicyRequest priority. */ + public priority?: (number|null); + + /** GetRuleFirewallPolicyRequest _priority. */ + public _priority?: "priority"; + + /** + * Creates a new GetRuleFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRuleFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRuleFirewallPolicyRequest): google.cloud.compute.v1.GetRuleFirewallPolicyRequest; + + /** + * Encodes the specified GetRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRuleFirewallPolicyRequest.verify|verify} messages. + * @param message GetRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRuleFirewallPolicyRequest.verify|verify} messages. + * @param message GetRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRuleFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRuleFirewallPolicyRequest; + + /** + * Decodes a GetRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRuleFirewallPolicyRequest; + + /** + * Verifies a GetRuleFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRuleFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRuleFirewallPolicyRequest; + + /** + * Creates a plain object from a GetRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message GetRuleFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRuleFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRuleFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertFirewallPolicyRequest. */ + interface IInsertFirewallPolicyRequest { + + /** InsertFirewallPolicyRequest firewallPolicyResource */ + firewallPolicyResource?: (google.cloud.compute.v1.IFirewallPolicy|null); + + /** InsertFirewallPolicyRequest parentId */ + parentId?: (string|null); + + /** InsertFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertFirewallPolicyRequest. */ + class InsertFirewallPolicyRequest implements IInsertFirewallPolicyRequest { + + /** + * Constructs a new InsertFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertFirewallPolicyRequest); + + /** InsertFirewallPolicyRequest firewallPolicyResource. */ + public firewallPolicyResource?: (google.cloud.compute.v1.IFirewallPolicy|null); + + /** InsertFirewallPolicyRequest parentId. */ + public parentId?: (string|null); + + /** InsertFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** InsertFirewallPolicyRequest _parentId. */ + public _parentId?: "parentId"; + + /** InsertFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertFirewallPolicyRequest): google.cloud.compute.v1.InsertFirewallPolicyRequest; + + /** + * Encodes the specified InsertFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallPolicyRequest.verify|verify} messages. + * @param message InsertFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallPolicyRequest.verify|verify} messages. + * @param message InsertFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertFirewallPolicyRequest; + + /** + * Decodes an InsertFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertFirewallPolicyRequest; + + /** + * Verifies an InsertFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertFirewallPolicyRequest; + + /** + * Creates a plain object from an InsertFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message InsertFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFirewallPoliciesRequest. */ + interface IListFirewallPoliciesRequest { + + /** ListFirewallPoliciesRequest filter */ + filter?: (string|null); + + /** ListFirewallPoliciesRequest maxResults */ + maxResults?: (number|null); + + /** ListFirewallPoliciesRequest orderBy */ + orderBy?: (string|null); + + /** ListFirewallPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListFirewallPoliciesRequest parentId */ + parentId?: (string|null); + + /** ListFirewallPoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListFirewallPoliciesRequest. */ + class ListFirewallPoliciesRequest implements IListFirewallPoliciesRequest { + + /** + * Constructs a new ListFirewallPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListFirewallPoliciesRequest); + + /** ListFirewallPoliciesRequest filter. */ + public filter?: (string|null); + + /** ListFirewallPoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListFirewallPoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListFirewallPoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListFirewallPoliciesRequest parentId. */ + public parentId?: (string|null); + + /** ListFirewallPoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListFirewallPoliciesRequest _filter. */ + public _filter?: "filter"; + + /** ListFirewallPoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListFirewallPoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListFirewallPoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListFirewallPoliciesRequest _parentId. */ + public _parentId?: "parentId"; + + /** ListFirewallPoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListFirewallPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFirewallPoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListFirewallPoliciesRequest): google.cloud.compute.v1.ListFirewallPoliciesRequest; + + /** + * Encodes the specified ListFirewallPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListFirewallPoliciesRequest.verify|verify} messages. + * @param message ListFirewallPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListFirewallPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFirewallPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListFirewallPoliciesRequest.verify|verify} messages. + * @param message ListFirewallPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListFirewallPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFirewallPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFirewallPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListFirewallPoliciesRequest; + + /** + * Decodes a ListFirewallPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFirewallPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListFirewallPoliciesRequest; + + /** + * Verifies a ListFirewallPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFirewallPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFirewallPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListFirewallPoliciesRequest; + + /** + * Creates a plain object from a ListFirewallPoliciesRequest message. Also converts values to other types if specified. + * @param message ListFirewallPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListFirewallPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFirewallPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAssociationsFirewallPolicyRequest. */ + interface IListAssociationsFirewallPolicyRequest { + + /** ListAssociationsFirewallPolicyRequest targetResource */ + targetResource?: (string|null); + } + + /** Represents a ListAssociationsFirewallPolicyRequest. */ + class ListAssociationsFirewallPolicyRequest implements IListAssociationsFirewallPolicyRequest { + + /** + * Constructs a new ListAssociationsFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest); + + /** ListAssociationsFirewallPolicyRequest targetResource. */ + public targetResource?: (string|null); + + /** ListAssociationsFirewallPolicyRequest _targetResource. */ + public _targetResource?: "targetResource"; + + /** + * Creates a new ListAssociationsFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssociationsFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest): google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest; + + /** + * Encodes the specified ListAssociationsFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest.verify|verify} messages. + * @param message ListAssociationsFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssociationsFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest.verify|verify} messages. + * @param message ListAssociationsFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssociationsFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssociationsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest; + + /** + * Decodes a ListAssociationsFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssociationsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest; + + /** + * Verifies a ListAssociationsFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAssociationsFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssociationsFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest; + + /** + * Creates a plain object from a ListAssociationsFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message ListAssociationsFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssociationsFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MoveFirewallPolicyRequest. */ + interface IMoveFirewallPolicyRequest { + + /** MoveFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** MoveFirewallPolicyRequest parentId */ + parentId?: (string|null); + + /** MoveFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a MoveFirewallPolicyRequest. */ + class MoveFirewallPolicyRequest implements IMoveFirewallPolicyRequest { + + /** + * Constructs a new MoveFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMoveFirewallPolicyRequest); + + /** MoveFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** MoveFirewallPolicyRequest parentId. */ + public parentId?: (string|null); + + /** MoveFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** MoveFirewallPolicyRequest _parentId. */ + public _parentId?: "parentId"; + + /** MoveFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new MoveFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IMoveFirewallPolicyRequest): google.cloud.compute.v1.MoveFirewallPolicyRequest; + + /** + * Encodes the specified MoveFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.MoveFirewallPolicyRequest.verify|verify} messages. + * @param message MoveFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMoveFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MoveFirewallPolicyRequest.verify|verify} messages. + * @param message MoveFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMoveFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MoveFirewallPolicyRequest; + + /** + * Decodes a MoveFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MoveFirewallPolicyRequest; + + /** + * Verifies a MoveFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MoveFirewallPolicyRequest; + + /** + * Creates a plain object from a MoveFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message MoveFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MoveFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchFirewallPolicyRequest. */ + interface IPatchFirewallPolicyRequest { + + /** PatchFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** PatchFirewallPolicyRequest firewallPolicyResource */ + firewallPolicyResource?: (google.cloud.compute.v1.IFirewallPolicy|null); + + /** PatchFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchFirewallPolicyRequest. */ + class PatchFirewallPolicyRequest implements IPatchFirewallPolicyRequest { + + /** + * Constructs a new PatchFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchFirewallPolicyRequest); + + /** PatchFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** PatchFirewallPolicyRequest firewallPolicyResource. */ + public firewallPolicyResource?: (google.cloud.compute.v1.IFirewallPolicy|null); + + /** PatchFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** PatchFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchFirewallPolicyRequest): google.cloud.compute.v1.PatchFirewallPolicyRequest; + + /** + * Encodes the specified PatchFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallPolicyRequest.verify|verify} messages. + * @param message PatchFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallPolicyRequest.verify|verify} messages. + * @param message PatchFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchFirewallPolicyRequest; + + /** + * Decodes a PatchFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchFirewallPolicyRequest; + + /** + * Verifies a PatchFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchFirewallPolicyRequest; + + /** + * Creates a plain object from a PatchFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message PatchFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRuleFirewallPolicyRequest. */ + interface IPatchRuleFirewallPolicyRequest { + + /** PatchRuleFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** PatchRuleFirewallPolicyRequest firewallPolicyRuleResource */ + firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** PatchRuleFirewallPolicyRequest priority */ + priority?: (number|null); + + /** PatchRuleFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchRuleFirewallPolicyRequest. */ + class PatchRuleFirewallPolicyRequest implements IPatchRuleFirewallPolicyRequest { + + /** + * Constructs a new PatchRuleFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest); + + /** PatchRuleFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** PatchRuleFirewallPolicyRequest firewallPolicyRuleResource. */ + public firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** PatchRuleFirewallPolicyRequest priority. */ + public priority?: (number|null); + + /** PatchRuleFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** PatchRuleFirewallPolicyRequest _priority. */ + public _priority?: "priority"; + + /** PatchRuleFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRuleFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRuleFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest): google.cloud.compute.v1.PatchRuleFirewallPolicyRequest; + + /** + * Encodes the specified PatchRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRuleFirewallPolicyRequest.verify|verify} messages. + * @param message PatchRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRuleFirewallPolicyRequest.verify|verify} messages. + * @param message PatchRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRuleFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRuleFirewallPolicyRequest; + + /** + * Decodes a PatchRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRuleFirewallPolicyRequest; + + /** + * Verifies a PatchRuleFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRuleFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRuleFirewallPolicyRequest; + + /** + * Creates a plain object from a PatchRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message PatchRuleFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRuleFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRuleFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveAssociationFirewallPolicyRequest. */ + interface IRemoveAssociationFirewallPolicyRequest { + + /** RemoveAssociationFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** RemoveAssociationFirewallPolicyRequest name */ + name?: (string|null); + + /** RemoveAssociationFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RemoveAssociationFirewallPolicyRequest. */ + class RemoveAssociationFirewallPolicyRequest implements IRemoveAssociationFirewallPolicyRequest { + + /** + * Constructs a new RemoveAssociationFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest); + + /** RemoveAssociationFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** RemoveAssociationFirewallPolicyRequest name. */ + public name?: (string|null); + + /** RemoveAssociationFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** RemoveAssociationFirewallPolicyRequest _name. */ + public _name?: "name"; + + /** RemoveAssociationFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveAssociationFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveAssociationFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest): google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest; + + /** + * Encodes the specified RemoveAssociationFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest.verify|verify} messages. + * @param message RemoveAssociationFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveAssociationFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest.verify|verify} messages. + * @param message RemoveAssociationFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveAssociationFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest; + + /** + * Decodes a RemoveAssociationFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest; + + /** + * Verifies a RemoveAssociationFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveAssociationFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveAssociationFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest; + + /** + * Creates a plain object from a RemoveAssociationFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message RemoveAssociationFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveAssociationFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveRuleFirewallPolicyRequest. */ + interface IRemoveRuleFirewallPolicyRequest { + + /** RemoveRuleFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** RemoveRuleFirewallPolicyRequest priority */ + priority?: (number|null); + + /** RemoveRuleFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RemoveRuleFirewallPolicyRequest. */ + class RemoveRuleFirewallPolicyRequest implements IRemoveRuleFirewallPolicyRequest { + + /** + * Constructs a new RemoveRuleFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest); + + /** RemoveRuleFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** RemoveRuleFirewallPolicyRequest priority. */ + public priority?: (number|null); + + /** RemoveRuleFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** RemoveRuleFirewallPolicyRequest _priority. */ + public _priority?: "priority"; + + /** RemoveRuleFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveRuleFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveRuleFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest): google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest; + + /** + * Encodes the specified RemoveRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest.verify|verify} messages. + * @param message RemoveRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest.verify|verify} messages. + * @param message RemoveRuleFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveRuleFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest; + + /** + * Decodes a RemoveRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest; + + /** + * Verifies a RemoveRuleFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveRuleFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest; + + /** + * Creates a plain object from a RemoveRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message RemoveRuleFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveRuleFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyFirewallPolicyRequest. */ + interface ISetIamPolicyFirewallPolicyRequest { + + /** SetIamPolicyFirewallPolicyRequest globalOrganizationSetPolicyRequestResource */ + globalOrganizationSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest|null); + + /** SetIamPolicyFirewallPolicyRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicyFirewallPolicyRequest. */ + class SetIamPolicyFirewallPolicyRequest implements ISetIamPolicyFirewallPolicyRequest { + + /** + * Constructs a new SetIamPolicyFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest); + + /** SetIamPolicyFirewallPolicyRequest globalOrganizationSetPolicyRequestResource. */ + public globalOrganizationSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest|null); + + /** SetIamPolicyFirewallPolicyRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicyFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest): google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest; + + /** + * Encodes the specified SetIamPolicyFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @param message SetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest; + + /** + * Decodes a SetIamPolicyFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest; + + /** + * Verifies a SetIamPolicyFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsFirewallPolicyRequest. */ + interface ITestIamPermissionsFirewallPolicyRequest { + + /** TestIamPermissionsFirewallPolicyRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsFirewallPolicyRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsFirewallPolicyRequest. */ + class TestIamPermissionsFirewallPolicyRequest implements ITestIamPermissionsFirewallPolicyRequest { + + /** + * Constructs a new TestIamPermissionsFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest); + + /** TestIamPermissionsFirewallPolicyRequest resource. */ + public resource: string; + + /** TestIamPermissionsFirewallPolicyRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest): google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest; + + /** + * Encodes the specified TestIamPermissionsFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest.verify|verify} messages. + * @param message TestIamPermissionsFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest.verify|verify} messages. + * @param message TestIamPermissionsFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest; + + /** + * Decodes a TestIamPermissionsFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest; + + /** + * Verifies a TestIamPermissionsFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest; + + /** + * Creates a plain object from a TestIamPermissionsFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteFirewallRequest. */ + interface IDeleteFirewallRequest { + + /** DeleteFirewallRequest firewall */ + firewall?: (string|null); + + /** DeleteFirewallRequest project */ + project?: (string|null); + + /** DeleteFirewallRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteFirewallRequest. */ + class DeleteFirewallRequest implements IDeleteFirewallRequest { + + /** + * Constructs a new DeleteFirewallRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteFirewallRequest); + + /** DeleteFirewallRequest firewall. */ + public firewall: string; + + /** DeleteFirewallRequest project. */ + public project: string; + + /** DeleteFirewallRequest requestId. */ + public requestId?: (string|null); + + /** DeleteFirewallRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteFirewallRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFirewallRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteFirewallRequest): google.cloud.compute.v1.DeleteFirewallRequest; + + /** + * Encodes the specified DeleteFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallRequest.verify|verify} messages. + * @param message DeleteFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallRequest.verify|verify} messages. + * @param message DeleteFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFirewallRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteFirewallRequest; + + /** + * Decodes a DeleteFirewallRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteFirewallRequest; + + /** + * Verifies a DeleteFirewallRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFirewallRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteFirewallRequest; + + /** + * Creates a plain object from a DeleteFirewallRequest message. Also converts values to other types if specified. + * @param message DeleteFirewallRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteFirewallRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFirewallRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetFirewallRequest. */ + interface IGetFirewallRequest { + + /** GetFirewallRequest firewall */ + firewall?: (string|null); + + /** GetFirewallRequest project */ + project?: (string|null); + } + + /** Represents a GetFirewallRequest. */ + class GetFirewallRequest implements IGetFirewallRequest { + + /** + * Constructs a new GetFirewallRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetFirewallRequest); + + /** GetFirewallRequest firewall. */ + public firewall: string; + + /** GetFirewallRequest project. */ + public project: string; + + /** + * Creates a new GetFirewallRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFirewallRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetFirewallRequest): google.cloud.compute.v1.GetFirewallRequest; + + /** + * Encodes the specified GetFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.GetFirewallRequest.verify|verify} messages. + * @param message GetFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetFirewallRequest.verify|verify} messages. + * @param message GetFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFirewallRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetFirewallRequest; + + /** + * Decodes a GetFirewallRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetFirewallRequest; + + /** + * Verifies a GetFirewallRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFirewallRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetFirewallRequest; + + /** + * Creates a plain object from a GetFirewallRequest message. Also converts values to other types if specified. + * @param message GetFirewallRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetFirewallRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFirewallRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertFirewallRequest. */ + interface IInsertFirewallRequest { + + /** InsertFirewallRequest firewallResource */ + firewallResource?: (google.cloud.compute.v1.IFirewall|null); + + /** InsertFirewallRequest project */ + project?: (string|null); + + /** InsertFirewallRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertFirewallRequest. */ + class InsertFirewallRequest implements IInsertFirewallRequest { + + /** + * Constructs a new InsertFirewallRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertFirewallRequest); + + /** InsertFirewallRequest firewallResource. */ + public firewallResource?: (google.cloud.compute.v1.IFirewall|null); + + /** InsertFirewallRequest project. */ + public project: string; + + /** InsertFirewallRequest requestId. */ + public requestId?: (string|null); + + /** InsertFirewallRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertFirewallRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertFirewallRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertFirewallRequest): google.cloud.compute.v1.InsertFirewallRequest; + + /** + * Encodes the specified InsertFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallRequest.verify|verify} messages. + * @param message InsertFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallRequest.verify|verify} messages. + * @param message InsertFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertFirewallRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertFirewallRequest; + + /** + * Decodes an InsertFirewallRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertFirewallRequest; + + /** + * Verifies an InsertFirewallRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertFirewallRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertFirewallRequest; + + /** + * Creates a plain object from an InsertFirewallRequest message. Also converts values to other types if specified. + * @param message InsertFirewallRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertFirewallRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertFirewallRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListFirewallsRequest. */ + interface IListFirewallsRequest { + + /** ListFirewallsRequest filter */ + filter?: (string|null); + + /** ListFirewallsRequest maxResults */ + maxResults?: (number|null); + + /** ListFirewallsRequest orderBy */ + orderBy?: (string|null); + + /** ListFirewallsRequest pageToken */ + pageToken?: (string|null); + + /** ListFirewallsRequest project */ + project?: (string|null); + + /** ListFirewallsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListFirewallsRequest. */ + class ListFirewallsRequest implements IListFirewallsRequest { + + /** + * Constructs a new ListFirewallsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListFirewallsRequest); + + /** ListFirewallsRequest filter. */ + public filter?: (string|null); + + /** ListFirewallsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListFirewallsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListFirewallsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListFirewallsRequest project. */ + public project: string; + + /** ListFirewallsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListFirewallsRequest _filter. */ + public _filter?: "filter"; + + /** ListFirewallsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListFirewallsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListFirewallsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListFirewallsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListFirewallsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFirewallsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListFirewallsRequest): google.cloud.compute.v1.ListFirewallsRequest; + + /** + * Encodes the specified ListFirewallsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListFirewallsRequest.verify|verify} messages. + * @param message ListFirewallsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListFirewallsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFirewallsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListFirewallsRequest.verify|verify} messages. + * @param message ListFirewallsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListFirewallsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFirewallsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFirewallsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListFirewallsRequest; + + /** + * Decodes a ListFirewallsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFirewallsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListFirewallsRequest; + + /** + * Verifies a ListFirewallsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFirewallsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFirewallsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListFirewallsRequest; + + /** + * Creates a plain object from a ListFirewallsRequest message. Also converts values to other types if specified. + * @param message ListFirewallsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListFirewallsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFirewallsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchFirewallRequest. */ + interface IPatchFirewallRequest { + + /** PatchFirewallRequest firewall */ + firewall?: (string|null); + + /** PatchFirewallRequest firewallResource */ + firewallResource?: (google.cloud.compute.v1.IFirewall|null); + + /** PatchFirewallRequest project */ + project?: (string|null); + + /** PatchFirewallRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchFirewallRequest. */ + class PatchFirewallRequest implements IPatchFirewallRequest { + + /** + * Constructs a new PatchFirewallRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchFirewallRequest); + + /** PatchFirewallRequest firewall. */ + public firewall: string; + + /** PatchFirewallRequest firewallResource. */ + public firewallResource?: (google.cloud.compute.v1.IFirewall|null); + + /** PatchFirewallRequest project. */ + public project: string; + + /** PatchFirewallRequest requestId. */ + public requestId?: (string|null); + + /** PatchFirewallRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchFirewallRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchFirewallRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchFirewallRequest): google.cloud.compute.v1.PatchFirewallRequest; + + /** + * Encodes the specified PatchFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallRequest.verify|verify} messages. + * @param message PatchFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallRequest.verify|verify} messages. + * @param message PatchFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchFirewallRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchFirewallRequest; + + /** + * Decodes a PatchFirewallRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchFirewallRequest; + + /** + * Verifies a PatchFirewallRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchFirewallRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchFirewallRequest; + + /** + * Creates a plain object from a PatchFirewallRequest message. Also converts values to other types if specified. + * @param message PatchFirewallRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchFirewallRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchFirewallRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateFirewallRequest. */ + interface IUpdateFirewallRequest { + + /** UpdateFirewallRequest firewall */ + firewall?: (string|null); + + /** UpdateFirewallRequest firewallResource */ + firewallResource?: (google.cloud.compute.v1.IFirewall|null); + + /** UpdateFirewallRequest project */ + project?: (string|null); + + /** UpdateFirewallRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateFirewallRequest. */ + class UpdateFirewallRequest implements IUpdateFirewallRequest { + + /** + * Constructs a new UpdateFirewallRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateFirewallRequest); + + /** UpdateFirewallRequest firewall. */ + public firewall: string; + + /** UpdateFirewallRequest firewallResource. */ + public firewallResource?: (google.cloud.compute.v1.IFirewall|null); + + /** UpdateFirewallRequest project. */ + public project: string; + + /** UpdateFirewallRequest requestId. */ + public requestId?: (string|null); + + /** UpdateFirewallRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateFirewallRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFirewallRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateFirewallRequest): google.cloud.compute.v1.UpdateFirewallRequest; + + /** + * Encodes the specified UpdateFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateFirewallRequest.verify|verify} messages. + * @param message UpdateFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateFirewallRequest.verify|verify} messages. + * @param message UpdateFirewallRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateFirewallRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFirewallRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateFirewallRequest; + + /** + * Decodes an UpdateFirewallRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateFirewallRequest; + + /** + * Verifies an UpdateFirewallRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFirewallRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateFirewallRequest; + + /** + * Creates a plain object from an UpdateFirewallRequest message. Also converts values to other types if specified. + * @param message UpdateFirewallRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateFirewallRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFirewallRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListForwardingRulesRequest. */ + interface IAggregatedListForwardingRulesRequest { + + /** AggregatedListForwardingRulesRequest filter */ + filter?: (string|null); + + /** AggregatedListForwardingRulesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListForwardingRulesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListForwardingRulesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListForwardingRulesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListForwardingRulesRequest project */ + project?: (string|null); + + /** AggregatedListForwardingRulesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListForwardingRulesRequest. */ + class AggregatedListForwardingRulesRequest implements IAggregatedListForwardingRulesRequest { + + /** + * Constructs a new AggregatedListForwardingRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListForwardingRulesRequest); + + /** AggregatedListForwardingRulesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListForwardingRulesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListForwardingRulesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListForwardingRulesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListForwardingRulesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListForwardingRulesRequest project. */ + public project: string; + + /** AggregatedListForwardingRulesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListForwardingRulesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListForwardingRulesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListForwardingRulesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListForwardingRulesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListForwardingRulesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListForwardingRulesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListForwardingRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListForwardingRulesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListForwardingRulesRequest): google.cloud.compute.v1.AggregatedListForwardingRulesRequest; + + /** + * Encodes the specified AggregatedListForwardingRulesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListForwardingRulesRequest.verify|verify} messages. + * @param message AggregatedListForwardingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListForwardingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListForwardingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListForwardingRulesRequest.verify|verify} messages. + * @param message AggregatedListForwardingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListForwardingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListForwardingRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListForwardingRulesRequest; + + /** + * Decodes an AggregatedListForwardingRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListForwardingRulesRequest; + + /** + * Verifies an AggregatedListForwardingRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListForwardingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListForwardingRulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListForwardingRulesRequest; + + /** + * Creates a plain object from an AggregatedListForwardingRulesRequest message. Also converts values to other types if specified. + * @param message AggregatedListForwardingRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListForwardingRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListForwardingRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteForwardingRuleRequest. */ + interface IDeleteForwardingRuleRequest { + + /** DeleteForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** DeleteForwardingRuleRequest project */ + project?: (string|null); + + /** DeleteForwardingRuleRequest region */ + region?: (string|null); + + /** DeleteForwardingRuleRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteForwardingRuleRequest. */ + class DeleteForwardingRuleRequest implements IDeleteForwardingRuleRequest { + + /** + * Constructs a new DeleteForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteForwardingRuleRequest); + + /** DeleteForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** DeleteForwardingRuleRequest project. */ + public project: string; + + /** DeleteForwardingRuleRequest region. */ + public region: string; + + /** DeleteForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** DeleteForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteForwardingRuleRequest): google.cloud.compute.v1.DeleteForwardingRuleRequest; + + /** + * Encodes the specified DeleteForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteForwardingRuleRequest.verify|verify} messages. + * @param message DeleteForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteForwardingRuleRequest.verify|verify} messages. + * @param message DeleteForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteForwardingRuleRequest; + + /** + * Decodes a DeleteForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteForwardingRuleRequest; + + /** + * Verifies a DeleteForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteForwardingRuleRequest; + + /** + * Creates a plain object from a DeleteForwardingRuleRequest message. Also converts values to other types if specified. + * @param message DeleteForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetForwardingRuleRequest. */ + interface IGetForwardingRuleRequest { + + /** GetForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** GetForwardingRuleRequest project */ + project?: (string|null); + + /** GetForwardingRuleRequest region */ + region?: (string|null); + } + + /** Represents a GetForwardingRuleRequest. */ + class GetForwardingRuleRequest implements IGetForwardingRuleRequest { + + /** + * Constructs a new GetForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetForwardingRuleRequest); + + /** GetForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** GetForwardingRuleRequest project. */ + public project: string; + + /** GetForwardingRuleRequest region. */ + public region: string; + + /** + * Creates a new GetForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetForwardingRuleRequest): google.cloud.compute.v1.GetForwardingRuleRequest; + + /** + * Encodes the specified GetForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.GetForwardingRuleRequest.verify|verify} messages. + * @param message GetForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetForwardingRuleRequest.verify|verify} messages. + * @param message GetForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetForwardingRuleRequest; + + /** + * Decodes a GetForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetForwardingRuleRequest; + + /** + * Verifies a GetForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetForwardingRuleRequest; + + /** + * Creates a plain object from a GetForwardingRuleRequest message. Also converts values to other types if specified. + * @param message GetForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertForwardingRuleRequest. */ + interface IInsertForwardingRuleRequest { + + /** InsertForwardingRuleRequest forwardingRuleResource */ + forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** InsertForwardingRuleRequest project */ + project?: (string|null); + + /** InsertForwardingRuleRequest region */ + region?: (string|null); + + /** InsertForwardingRuleRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertForwardingRuleRequest. */ + class InsertForwardingRuleRequest implements IInsertForwardingRuleRequest { + + /** + * Constructs a new InsertForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertForwardingRuleRequest); + + /** InsertForwardingRuleRequest forwardingRuleResource. */ + public forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** InsertForwardingRuleRequest project. */ + public project: string; + + /** InsertForwardingRuleRequest region. */ + public region: string; + + /** InsertForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** InsertForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertForwardingRuleRequest): google.cloud.compute.v1.InsertForwardingRuleRequest; + + /** + * Encodes the specified InsertForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertForwardingRuleRequest.verify|verify} messages. + * @param message InsertForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertForwardingRuleRequest.verify|verify} messages. + * @param message InsertForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertForwardingRuleRequest; + + /** + * Decodes an InsertForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertForwardingRuleRequest; + + /** + * Verifies an InsertForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertForwardingRuleRequest; + + /** + * Creates a plain object from an InsertForwardingRuleRequest message. Also converts values to other types if specified. + * @param message InsertForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListForwardingRulesRequest. */ + interface IListForwardingRulesRequest { + + /** ListForwardingRulesRequest filter */ + filter?: (string|null); + + /** ListForwardingRulesRequest maxResults */ + maxResults?: (number|null); + + /** ListForwardingRulesRequest orderBy */ + orderBy?: (string|null); + + /** ListForwardingRulesRequest pageToken */ + pageToken?: (string|null); + + /** ListForwardingRulesRequest project */ + project?: (string|null); + + /** ListForwardingRulesRequest region */ + region?: (string|null); + + /** ListForwardingRulesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListForwardingRulesRequest. */ + class ListForwardingRulesRequest implements IListForwardingRulesRequest { + + /** + * Constructs a new ListForwardingRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListForwardingRulesRequest); + + /** ListForwardingRulesRequest filter. */ + public filter?: (string|null); + + /** ListForwardingRulesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListForwardingRulesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListForwardingRulesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListForwardingRulesRequest project. */ + public project: string; + + /** ListForwardingRulesRequest region. */ + public region: string; + + /** ListForwardingRulesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListForwardingRulesRequest _filter. */ + public _filter?: "filter"; + + /** ListForwardingRulesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListForwardingRulesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListForwardingRulesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListForwardingRulesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListForwardingRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListForwardingRulesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListForwardingRulesRequest): google.cloud.compute.v1.ListForwardingRulesRequest; + + /** + * Encodes the specified ListForwardingRulesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListForwardingRulesRequest.verify|verify} messages. + * @param message ListForwardingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListForwardingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListForwardingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListForwardingRulesRequest.verify|verify} messages. + * @param message ListForwardingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListForwardingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListForwardingRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListForwardingRulesRequest; + + /** + * Decodes a ListForwardingRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListForwardingRulesRequest; + + /** + * Verifies a ListForwardingRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListForwardingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListForwardingRulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListForwardingRulesRequest; + + /** + * Creates a plain object from a ListForwardingRulesRequest message. Also converts values to other types if specified. + * @param message ListForwardingRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListForwardingRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListForwardingRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchForwardingRuleRequest. */ + interface IPatchForwardingRuleRequest { + + /** PatchForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** PatchForwardingRuleRequest forwardingRuleResource */ + forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** PatchForwardingRuleRequest project */ + project?: (string|null); + + /** PatchForwardingRuleRequest region */ + region?: (string|null); + + /** PatchForwardingRuleRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchForwardingRuleRequest. */ + class PatchForwardingRuleRequest implements IPatchForwardingRuleRequest { + + /** + * Constructs a new PatchForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchForwardingRuleRequest); + + /** PatchForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** PatchForwardingRuleRequest forwardingRuleResource. */ + public forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** PatchForwardingRuleRequest project. */ + public project: string; + + /** PatchForwardingRuleRequest region. */ + public region: string; + + /** PatchForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** PatchForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchForwardingRuleRequest): google.cloud.compute.v1.PatchForwardingRuleRequest; + + /** + * Encodes the specified PatchForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchForwardingRuleRequest.verify|verify} messages. + * @param message PatchForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchForwardingRuleRequest.verify|verify} messages. + * @param message PatchForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchForwardingRuleRequest; + + /** + * Decodes a PatchForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchForwardingRuleRequest; + + /** + * Verifies a PatchForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchForwardingRuleRequest; + + /** + * Creates a plain object from a PatchForwardingRuleRequest message. Also converts values to other types if specified. + * @param message PatchForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsForwardingRuleRequest. */ + interface ISetLabelsForwardingRuleRequest { + + /** SetLabelsForwardingRuleRequest project */ + project?: (string|null); + + /** SetLabelsForwardingRuleRequest region */ + region?: (string|null); + + /** SetLabelsForwardingRuleRequest regionSetLabelsRequestResource */ + regionSetLabelsRequestResource?: (google.cloud.compute.v1.IRegionSetLabelsRequest|null); + + /** SetLabelsForwardingRuleRequest requestId */ + requestId?: (string|null); + + /** SetLabelsForwardingRuleRequest resource */ + resource?: (string|null); + } + + /** Represents a SetLabelsForwardingRuleRequest. */ + class SetLabelsForwardingRuleRequest implements ISetLabelsForwardingRuleRequest { + + /** + * Constructs a new SetLabelsForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsForwardingRuleRequest); + + /** SetLabelsForwardingRuleRequest project. */ + public project: string; + + /** SetLabelsForwardingRuleRequest region. */ + public region: string; + + /** SetLabelsForwardingRuleRequest regionSetLabelsRequestResource. */ + public regionSetLabelsRequestResource?: (google.cloud.compute.v1.IRegionSetLabelsRequest|null); + + /** SetLabelsForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** SetLabelsForwardingRuleRequest resource. */ + public resource: string; + + /** SetLabelsForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetLabelsForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsForwardingRuleRequest): google.cloud.compute.v1.SetLabelsForwardingRuleRequest; + + /** + * Encodes the specified SetLabelsForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsForwardingRuleRequest.verify|verify} messages. + * @param message SetLabelsForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsForwardingRuleRequest.verify|verify} messages. + * @param message SetLabelsForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsForwardingRuleRequest; + + /** + * Decodes a SetLabelsForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsForwardingRuleRequest; + + /** + * Verifies a SetLabelsForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsForwardingRuleRequest; + + /** + * Creates a plain object from a SetLabelsForwardingRuleRequest message. Also converts values to other types if specified. + * @param message SetLabelsForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetTargetForwardingRuleRequest. */ + interface ISetTargetForwardingRuleRequest { + + /** SetTargetForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** SetTargetForwardingRuleRequest project */ + project?: (string|null); + + /** SetTargetForwardingRuleRequest region */ + region?: (string|null); + + /** SetTargetForwardingRuleRequest requestId */ + requestId?: (string|null); + + /** SetTargetForwardingRuleRequest targetReferenceResource */ + targetReferenceResource?: (google.cloud.compute.v1.ITargetReference|null); + } + + /** Represents a SetTargetForwardingRuleRequest. */ + class SetTargetForwardingRuleRequest implements ISetTargetForwardingRuleRequest { + + /** + * Constructs a new SetTargetForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetTargetForwardingRuleRequest); + + /** SetTargetForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** SetTargetForwardingRuleRequest project. */ + public project: string; + + /** SetTargetForwardingRuleRequest region. */ + public region: string; + + /** SetTargetForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** SetTargetForwardingRuleRequest targetReferenceResource. */ + public targetReferenceResource?: (google.cloud.compute.v1.ITargetReference|null); + + /** SetTargetForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetTargetForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetTargetForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetTargetForwardingRuleRequest): google.cloud.compute.v1.SetTargetForwardingRuleRequest; + + /** + * Encodes the specified SetTargetForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetForwardingRuleRequest.verify|verify} messages. + * @param message SetTargetForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetTargetForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetTargetForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetForwardingRuleRequest.verify|verify} messages. + * @param message SetTargetForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetTargetForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetTargetForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetTargetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetTargetForwardingRuleRequest; + + /** + * Decodes a SetTargetForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetTargetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetTargetForwardingRuleRequest; + + /** + * Verifies a SetTargetForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetTargetForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetTargetForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetTargetForwardingRuleRequest; + + /** + * Creates a plain object from a SetTargetForwardingRuleRequest message. Also converts values to other types if specified. + * @param message SetTargetForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetTargetForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetTargetForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalAddressRequest. */ + interface IDeleteGlobalAddressRequest { + + /** DeleteGlobalAddressRequest address */ + address?: (string|null); + + /** DeleteGlobalAddressRequest project */ + project?: (string|null); + + /** DeleteGlobalAddressRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteGlobalAddressRequest. */ + class DeleteGlobalAddressRequest implements IDeleteGlobalAddressRequest { + + /** + * Constructs a new DeleteGlobalAddressRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalAddressRequest); + + /** DeleteGlobalAddressRequest address. */ + public address: string; + + /** DeleteGlobalAddressRequest project. */ + public project: string; + + /** DeleteGlobalAddressRequest requestId. */ + public requestId?: (string|null); + + /** DeleteGlobalAddressRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteGlobalAddressRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalAddressRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalAddressRequest): google.cloud.compute.v1.DeleteGlobalAddressRequest; + + /** + * Encodes the specified DeleteGlobalAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalAddressRequest.verify|verify} messages. + * @param message DeleteGlobalAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalAddressRequest.verify|verify} messages. + * @param message DeleteGlobalAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalAddressRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalAddressRequest; + + /** + * Decodes a DeleteGlobalAddressRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalAddressRequest; + + /** + * Verifies a DeleteGlobalAddressRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalAddressRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalAddressRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalAddressRequest; + + /** + * Creates a plain object from a DeleteGlobalAddressRequest message. Also converts values to other types if specified. + * @param message DeleteGlobalAddressRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalAddressRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlobalAddressRequest. */ + interface IGetGlobalAddressRequest { + + /** GetGlobalAddressRequest address */ + address?: (string|null); + + /** GetGlobalAddressRequest project */ + project?: (string|null); + } + + /** Represents a GetGlobalAddressRequest. */ + class GetGlobalAddressRequest implements IGetGlobalAddressRequest { + + /** + * Constructs a new GetGlobalAddressRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetGlobalAddressRequest); + + /** GetGlobalAddressRequest address. */ + public address: string; + + /** GetGlobalAddressRequest project. */ + public project: string; + + /** + * Creates a new GetGlobalAddressRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalAddressRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetGlobalAddressRequest): google.cloud.compute.v1.GetGlobalAddressRequest; + + /** + * Encodes the specified GetGlobalAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalAddressRequest.verify|verify} messages. + * @param message GetGlobalAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetGlobalAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalAddressRequest.verify|verify} messages. + * @param message GetGlobalAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetGlobalAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalAddressRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetGlobalAddressRequest; + + /** + * Decodes a GetGlobalAddressRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetGlobalAddressRequest; + + /** + * Verifies a GetGlobalAddressRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlobalAddressRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalAddressRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetGlobalAddressRequest; + + /** + * Creates a plain object from a GetGlobalAddressRequest message. Also converts values to other types if specified. + * @param message GetGlobalAddressRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetGlobalAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalAddressRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertGlobalAddressRequest. */ + interface IInsertGlobalAddressRequest { + + /** InsertGlobalAddressRequest addressResource */ + addressResource?: (google.cloud.compute.v1.IAddress|null); + + /** InsertGlobalAddressRequest project */ + project?: (string|null); + + /** InsertGlobalAddressRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertGlobalAddressRequest. */ + class InsertGlobalAddressRequest implements IInsertGlobalAddressRequest { + + /** + * Constructs a new InsertGlobalAddressRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertGlobalAddressRequest); + + /** InsertGlobalAddressRequest addressResource. */ + public addressResource?: (google.cloud.compute.v1.IAddress|null); + + /** InsertGlobalAddressRequest project. */ + public project: string; + + /** InsertGlobalAddressRequest requestId. */ + public requestId?: (string|null); + + /** InsertGlobalAddressRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertGlobalAddressRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertGlobalAddressRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertGlobalAddressRequest): google.cloud.compute.v1.InsertGlobalAddressRequest; + + /** + * Encodes the specified InsertGlobalAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalAddressRequest.verify|verify} messages. + * @param message InsertGlobalAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertGlobalAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertGlobalAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalAddressRequest.verify|verify} messages. + * @param message InsertGlobalAddressRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertGlobalAddressRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertGlobalAddressRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertGlobalAddressRequest; + + /** + * Decodes an InsertGlobalAddressRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertGlobalAddressRequest; + + /** + * Verifies an InsertGlobalAddressRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertGlobalAddressRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertGlobalAddressRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertGlobalAddressRequest; + + /** + * Creates a plain object from an InsertGlobalAddressRequest message. Also converts values to other types if specified. + * @param message InsertGlobalAddressRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertGlobalAddressRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertGlobalAddressRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlobalAddressesRequest. */ + interface IListGlobalAddressesRequest { + + /** ListGlobalAddressesRequest filter */ + filter?: (string|null); + + /** ListGlobalAddressesRequest maxResults */ + maxResults?: (number|null); + + /** ListGlobalAddressesRequest orderBy */ + orderBy?: (string|null); + + /** ListGlobalAddressesRequest pageToken */ + pageToken?: (string|null); + + /** ListGlobalAddressesRequest project */ + project?: (string|null); + + /** ListGlobalAddressesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListGlobalAddressesRequest. */ + class ListGlobalAddressesRequest implements IListGlobalAddressesRequest { + + /** + * Constructs a new ListGlobalAddressesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListGlobalAddressesRequest); + + /** ListGlobalAddressesRequest filter. */ + public filter?: (string|null); + + /** ListGlobalAddressesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListGlobalAddressesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListGlobalAddressesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListGlobalAddressesRequest project. */ + public project: string; + + /** ListGlobalAddressesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListGlobalAddressesRequest _filter. */ + public _filter?: "filter"; + + /** ListGlobalAddressesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListGlobalAddressesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListGlobalAddressesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListGlobalAddressesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListGlobalAddressesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlobalAddressesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListGlobalAddressesRequest): google.cloud.compute.v1.ListGlobalAddressesRequest; + + /** + * Encodes the specified ListGlobalAddressesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalAddressesRequest.verify|verify} messages. + * @param message ListGlobalAddressesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListGlobalAddressesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlobalAddressesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalAddressesRequest.verify|verify} messages. + * @param message ListGlobalAddressesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListGlobalAddressesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlobalAddressesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlobalAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListGlobalAddressesRequest; + + /** + * Decodes a ListGlobalAddressesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlobalAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListGlobalAddressesRequest; + + /** + * Verifies a ListGlobalAddressesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlobalAddressesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlobalAddressesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListGlobalAddressesRequest; + + /** + * Creates a plain object from a ListGlobalAddressesRequest message. Also converts values to other types if specified. + * @param message ListGlobalAddressesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListGlobalAddressesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlobalAddressesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalForwardingRuleRequest. */ + interface IDeleteGlobalForwardingRuleRequest { + + /** DeleteGlobalForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** DeleteGlobalForwardingRuleRequest project */ + project?: (string|null); + + /** DeleteGlobalForwardingRuleRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteGlobalForwardingRuleRequest. */ + class DeleteGlobalForwardingRuleRequest implements IDeleteGlobalForwardingRuleRequest { + + /** + * Constructs a new DeleteGlobalForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest); + + /** DeleteGlobalForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** DeleteGlobalForwardingRuleRequest project. */ + public project: string; + + /** DeleteGlobalForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** DeleteGlobalForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteGlobalForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest): google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest; + + /** + * Encodes the specified DeleteGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest.verify|verify} messages. + * @param message DeleteGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest.verify|verify} messages. + * @param message DeleteGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest; + + /** + * Decodes a DeleteGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest; + + /** + * Verifies a DeleteGlobalForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest; + + /** + * Creates a plain object from a DeleteGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @param message DeleteGlobalForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlobalForwardingRuleRequest. */ + interface IGetGlobalForwardingRuleRequest { + + /** GetGlobalForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** GetGlobalForwardingRuleRequest project */ + project?: (string|null); + } + + /** Represents a GetGlobalForwardingRuleRequest. */ + class GetGlobalForwardingRuleRequest implements IGetGlobalForwardingRuleRequest { + + /** + * Constructs a new GetGlobalForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetGlobalForwardingRuleRequest); + + /** GetGlobalForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** GetGlobalForwardingRuleRequest project. */ + public project: string; + + /** + * Creates a new GetGlobalForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetGlobalForwardingRuleRequest): google.cloud.compute.v1.GetGlobalForwardingRuleRequest; + + /** + * Encodes the specified GetGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalForwardingRuleRequest.verify|verify} messages. + * @param message GetGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalForwardingRuleRequest.verify|verify} messages. + * @param message GetGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetGlobalForwardingRuleRequest; + + /** + * Decodes a GetGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetGlobalForwardingRuleRequest; + + /** + * Verifies a GetGlobalForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetGlobalForwardingRuleRequest; + + /** + * Creates a plain object from a GetGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @param message GetGlobalForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetGlobalForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertGlobalForwardingRuleRequest. */ + interface IInsertGlobalForwardingRuleRequest { + + /** InsertGlobalForwardingRuleRequest forwardingRuleResource */ + forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** InsertGlobalForwardingRuleRequest project */ + project?: (string|null); + + /** InsertGlobalForwardingRuleRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertGlobalForwardingRuleRequest. */ + class InsertGlobalForwardingRuleRequest implements IInsertGlobalForwardingRuleRequest { + + /** + * Constructs a new InsertGlobalForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest); + + /** InsertGlobalForwardingRuleRequest forwardingRuleResource. */ + public forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** InsertGlobalForwardingRuleRequest project. */ + public project: string; + + /** InsertGlobalForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** InsertGlobalForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertGlobalForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertGlobalForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest): google.cloud.compute.v1.InsertGlobalForwardingRuleRequest; + + /** + * Encodes the specified InsertGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalForwardingRuleRequest.verify|verify} messages. + * @param message InsertGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalForwardingRuleRequest.verify|verify} messages. + * @param message InsertGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertGlobalForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertGlobalForwardingRuleRequest; + + /** + * Decodes an InsertGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertGlobalForwardingRuleRequest; + + /** + * Verifies an InsertGlobalForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertGlobalForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertGlobalForwardingRuleRequest; + + /** + * Creates a plain object from an InsertGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @param message InsertGlobalForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertGlobalForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertGlobalForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlobalForwardingRulesRequest. */ + interface IListGlobalForwardingRulesRequest { + + /** ListGlobalForwardingRulesRequest filter */ + filter?: (string|null); + + /** ListGlobalForwardingRulesRequest maxResults */ + maxResults?: (number|null); + + /** ListGlobalForwardingRulesRequest orderBy */ + orderBy?: (string|null); + + /** ListGlobalForwardingRulesRequest pageToken */ + pageToken?: (string|null); + + /** ListGlobalForwardingRulesRequest project */ + project?: (string|null); + + /** ListGlobalForwardingRulesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListGlobalForwardingRulesRequest. */ + class ListGlobalForwardingRulesRequest implements IListGlobalForwardingRulesRequest { + + /** + * Constructs a new ListGlobalForwardingRulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListGlobalForwardingRulesRequest); + + /** ListGlobalForwardingRulesRequest filter. */ + public filter?: (string|null); + + /** ListGlobalForwardingRulesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListGlobalForwardingRulesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListGlobalForwardingRulesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListGlobalForwardingRulesRequest project. */ + public project: string; + + /** ListGlobalForwardingRulesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListGlobalForwardingRulesRequest _filter. */ + public _filter?: "filter"; + + /** ListGlobalForwardingRulesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListGlobalForwardingRulesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListGlobalForwardingRulesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListGlobalForwardingRulesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListGlobalForwardingRulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlobalForwardingRulesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListGlobalForwardingRulesRequest): google.cloud.compute.v1.ListGlobalForwardingRulesRequest; + + /** + * Encodes the specified ListGlobalForwardingRulesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalForwardingRulesRequest.verify|verify} messages. + * @param message ListGlobalForwardingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListGlobalForwardingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlobalForwardingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalForwardingRulesRequest.verify|verify} messages. + * @param message ListGlobalForwardingRulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListGlobalForwardingRulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlobalForwardingRulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlobalForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListGlobalForwardingRulesRequest; + + /** + * Decodes a ListGlobalForwardingRulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlobalForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListGlobalForwardingRulesRequest; + + /** + * Verifies a ListGlobalForwardingRulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlobalForwardingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlobalForwardingRulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListGlobalForwardingRulesRequest; + + /** + * Creates a plain object from a ListGlobalForwardingRulesRequest message. Also converts values to other types if specified. + * @param message ListGlobalForwardingRulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListGlobalForwardingRulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlobalForwardingRulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchGlobalForwardingRuleRequest. */ + interface IPatchGlobalForwardingRuleRequest { + + /** PatchGlobalForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** PatchGlobalForwardingRuleRequest forwardingRuleResource */ + forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** PatchGlobalForwardingRuleRequest project */ + project?: (string|null); + + /** PatchGlobalForwardingRuleRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchGlobalForwardingRuleRequest. */ + class PatchGlobalForwardingRuleRequest implements IPatchGlobalForwardingRuleRequest { + + /** + * Constructs a new PatchGlobalForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest); + + /** PatchGlobalForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** PatchGlobalForwardingRuleRequest forwardingRuleResource. */ + public forwardingRuleResource?: (google.cloud.compute.v1.IForwardingRule|null); + + /** PatchGlobalForwardingRuleRequest project. */ + public project: string; + + /** PatchGlobalForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** PatchGlobalForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchGlobalForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchGlobalForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest): google.cloud.compute.v1.PatchGlobalForwardingRuleRequest; + + /** + * Encodes the specified PatchGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalForwardingRuleRequest.verify|verify} messages. + * @param message PatchGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalForwardingRuleRequest.verify|verify} messages. + * @param message PatchGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchGlobalForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchGlobalForwardingRuleRequest; + + /** + * Decodes a PatchGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchGlobalForwardingRuleRequest; + + /** + * Verifies a PatchGlobalForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchGlobalForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchGlobalForwardingRuleRequest; + + /** + * Creates a plain object from a PatchGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @param message PatchGlobalForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchGlobalForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchGlobalForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsGlobalForwardingRuleRequest. */ + interface ISetLabelsGlobalForwardingRuleRequest { + + /** SetLabelsGlobalForwardingRuleRequest globalSetLabelsRequestResource */ + globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsGlobalForwardingRuleRequest project */ + project?: (string|null); + + /** SetLabelsGlobalForwardingRuleRequest resource */ + resource?: (string|null); + } + + /** Represents a SetLabelsGlobalForwardingRuleRequest. */ + class SetLabelsGlobalForwardingRuleRequest implements ISetLabelsGlobalForwardingRuleRequest { + + /** + * Constructs a new SetLabelsGlobalForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest); + + /** SetLabelsGlobalForwardingRuleRequest globalSetLabelsRequestResource. */ + public globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsGlobalForwardingRuleRequest project. */ + public project: string; + + /** SetLabelsGlobalForwardingRuleRequest resource. */ + public resource: string; + + /** + * Creates a new SetLabelsGlobalForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsGlobalForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest): google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest; + + /** + * Encodes the specified SetLabelsGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest.verify|verify} messages. + * @param message SetLabelsGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest.verify|verify} messages. + * @param message SetLabelsGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsGlobalForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest; + + /** + * Decodes a SetLabelsGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest; + + /** + * Verifies a SetLabelsGlobalForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsGlobalForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest; + + /** + * Creates a plain object from a SetLabelsGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @param message SetLabelsGlobalForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsGlobalForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetTargetGlobalForwardingRuleRequest. */ + interface ISetTargetGlobalForwardingRuleRequest { + + /** SetTargetGlobalForwardingRuleRequest forwardingRule */ + forwardingRule?: (string|null); + + /** SetTargetGlobalForwardingRuleRequest project */ + project?: (string|null); + + /** SetTargetGlobalForwardingRuleRequest requestId */ + requestId?: (string|null); + + /** SetTargetGlobalForwardingRuleRequest targetReferenceResource */ + targetReferenceResource?: (google.cloud.compute.v1.ITargetReference|null); + } + + /** Represents a SetTargetGlobalForwardingRuleRequest. */ + class SetTargetGlobalForwardingRuleRequest implements ISetTargetGlobalForwardingRuleRequest { + + /** + * Constructs a new SetTargetGlobalForwardingRuleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest); + + /** SetTargetGlobalForwardingRuleRequest forwardingRule. */ + public forwardingRule: string; + + /** SetTargetGlobalForwardingRuleRequest project. */ + public project: string; + + /** SetTargetGlobalForwardingRuleRequest requestId. */ + public requestId?: (string|null); + + /** SetTargetGlobalForwardingRuleRequest targetReferenceResource. */ + public targetReferenceResource?: (google.cloud.compute.v1.ITargetReference|null); + + /** SetTargetGlobalForwardingRuleRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetTargetGlobalForwardingRuleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetTargetGlobalForwardingRuleRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest): google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest; + + /** + * Encodes the specified SetTargetGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest.verify|verify} messages. + * @param message SetTargetGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetTargetGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest.verify|verify} messages. + * @param message SetTargetGlobalForwardingRuleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetTargetGlobalForwardingRuleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetTargetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest; + + /** + * Decodes a SetTargetGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetTargetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest; + + /** + * Verifies a SetTargetGlobalForwardingRuleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetTargetGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetTargetGlobalForwardingRuleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest; + + /** + * Creates a plain object from a SetTargetGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @param message SetTargetGlobalForwardingRuleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetTargetGlobalForwardingRuleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest. */ + interface IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest { + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource */ + globalNetworkEndpointGroupsAttachEndpointsRequestResource?: (google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest|null); + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest. */ + class AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest implements IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest { + + /** + * Constructs a new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest); + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource. */ + public globalNetworkEndpointGroupsAttachEndpointsRequestResource?: (google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest|null); + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest project. */ + public project: string; + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest): google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Encodes the specified AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Decodes an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Verifies an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Creates a plain object from an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalNetworkEndpointGroupRequest. */ + interface IDeleteGlobalNetworkEndpointGroupRequest { + + /** DeleteGlobalNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** DeleteGlobalNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** DeleteGlobalNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteGlobalNetworkEndpointGroupRequest. */ + class DeleteGlobalNetworkEndpointGroupRequest implements IDeleteGlobalNetworkEndpointGroupRequest { + + /** + * Constructs a new DeleteGlobalNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest); + + /** DeleteGlobalNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** DeleteGlobalNetworkEndpointGroupRequest project. */ + public project: string; + + /** DeleteGlobalNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** DeleteGlobalNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest): google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest; + + /** + * Encodes the specified DeleteGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DeleteGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DeleteGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest; + + /** + * Decodes a DeleteGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest; + + /** + * Verifies a DeleteGlobalNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a DeleteGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message DeleteGlobalNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest. */ + interface IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest { + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource */ + globalNetworkEndpointGroupsDetachEndpointsRequestResource?: (google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest|null); + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest. */ + class DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest implements IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest { + + /** + * Constructs a new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest); + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource. */ + public globalNetworkEndpointGroupsDetachEndpointsRequestResource?: (google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest|null); + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest project. */ + public project: string; + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest): google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Encodes the specified DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Decodes a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Verifies a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlobalNetworkEndpointGroupRequest. */ + interface IGetGlobalNetworkEndpointGroupRequest { + + /** GetGlobalNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** GetGlobalNetworkEndpointGroupRequest project */ + project?: (string|null); + } + + /** Represents a GetGlobalNetworkEndpointGroupRequest. */ + class GetGlobalNetworkEndpointGroupRequest implements IGetGlobalNetworkEndpointGroupRequest { + + /** + * Constructs a new GetGlobalNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest); + + /** GetGlobalNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** GetGlobalNetworkEndpointGroupRequest project. */ + public project: string; + + /** + * Creates a new GetGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest): google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest; + + /** + * Encodes the specified GetGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message GetGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message GetGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest; + + /** + * Decodes a GetGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest; + + /** + * Verifies a GetGlobalNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a GetGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message GetGlobalNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertGlobalNetworkEndpointGroupRequest. */ + interface IInsertGlobalNetworkEndpointGroupRequest { + + /** InsertGlobalNetworkEndpointGroupRequest networkEndpointGroupResource */ + networkEndpointGroupResource?: (google.cloud.compute.v1.INetworkEndpointGroup|null); + + /** InsertGlobalNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** InsertGlobalNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertGlobalNetworkEndpointGroupRequest. */ + class InsertGlobalNetworkEndpointGroupRequest implements IInsertGlobalNetworkEndpointGroupRequest { + + /** + * Constructs a new InsertGlobalNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest); + + /** InsertGlobalNetworkEndpointGroupRequest networkEndpointGroupResource. */ + public networkEndpointGroupResource?: (google.cloud.compute.v1.INetworkEndpointGroup|null); + + /** InsertGlobalNetworkEndpointGroupRequest project. */ + public project: string; + + /** InsertGlobalNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** InsertGlobalNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertGlobalNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest): google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest; + + /** + * Encodes the specified InsertGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message InsertGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @param message InsertGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest; + + /** + * Decodes an InsertGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest; + + /** + * Verifies an InsertGlobalNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertGlobalNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest; + + /** + * Creates a plain object from an InsertGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message InsertGlobalNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertGlobalNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlobalNetworkEndpointGroupsRequest. */ + interface IListGlobalNetworkEndpointGroupsRequest { + + /** ListGlobalNetworkEndpointGroupsRequest filter */ + filter?: (string|null); + + /** ListGlobalNetworkEndpointGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListGlobalNetworkEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListGlobalNetworkEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListGlobalNetworkEndpointGroupsRequest project */ + project?: (string|null); + + /** ListGlobalNetworkEndpointGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListGlobalNetworkEndpointGroupsRequest. */ + class ListGlobalNetworkEndpointGroupsRequest implements IListGlobalNetworkEndpointGroupsRequest { + + /** + * Constructs a new ListGlobalNetworkEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest); + + /** ListGlobalNetworkEndpointGroupsRequest filter. */ + public filter?: (string|null); + + /** ListGlobalNetworkEndpointGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListGlobalNetworkEndpointGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListGlobalNetworkEndpointGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListGlobalNetworkEndpointGroupsRequest project. */ + public project: string; + + /** ListGlobalNetworkEndpointGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListGlobalNetworkEndpointGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListGlobalNetworkEndpointGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListGlobalNetworkEndpointGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListGlobalNetworkEndpointGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListGlobalNetworkEndpointGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListGlobalNetworkEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlobalNetworkEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest): google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest; + + /** + * Encodes the specified ListGlobalNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlobalNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest; + + /** + * Decodes a ListGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest; + + /** + * Verifies a ListGlobalNetworkEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlobalNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlobalNetworkEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest; + + /** + * Creates a plain object from a ListGlobalNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message ListGlobalNetworkEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlobalNetworkEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest. */ + interface IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest { + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest filter */ + filter?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest project */ + project?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest. */ + class ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest implements IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest { + + /** + * Constructs a new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest filter. */ + public filter?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest project. */ + public project: string; + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest): google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest; + + /** + * Encodes the specified ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest; + + /** + * Decodes a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest; + + /** + * Verifies a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest; + + /** + * Creates a plain object from a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListGlobalOperationsRequest. */ + interface IAggregatedListGlobalOperationsRequest { + + /** AggregatedListGlobalOperationsRequest filter */ + filter?: (string|null); + + /** AggregatedListGlobalOperationsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListGlobalOperationsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListGlobalOperationsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListGlobalOperationsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListGlobalOperationsRequest project */ + project?: (string|null); + + /** AggregatedListGlobalOperationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListGlobalOperationsRequest. */ + class AggregatedListGlobalOperationsRequest implements IAggregatedListGlobalOperationsRequest { + + /** + * Constructs a new AggregatedListGlobalOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest); + + /** AggregatedListGlobalOperationsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListGlobalOperationsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListGlobalOperationsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListGlobalOperationsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListGlobalOperationsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListGlobalOperationsRequest project. */ + public project: string; + + /** AggregatedListGlobalOperationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListGlobalOperationsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListGlobalOperationsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListGlobalOperationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListGlobalOperationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListGlobalOperationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListGlobalOperationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListGlobalOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListGlobalOperationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest): google.cloud.compute.v1.AggregatedListGlobalOperationsRequest; + + /** + * Encodes the specified AggregatedListGlobalOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListGlobalOperationsRequest.verify|verify} messages. + * @param message AggregatedListGlobalOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListGlobalOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListGlobalOperationsRequest.verify|verify} messages. + * @param message AggregatedListGlobalOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListGlobalOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListGlobalOperationsRequest; + + /** + * Decodes an AggregatedListGlobalOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListGlobalOperationsRequest; + + /** + * Verifies an AggregatedListGlobalOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListGlobalOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListGlobalOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListGlobalOperationsRequest; + + /** + * Creates a plain object from an AggregatedListGlobalOperationsRequest message. Also converts values to other types if specified. + * @param message AggregatedListGlobalOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListGlobalOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListGlobalOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalOperationRequest. */ + interface IDeleteGlobalOperationRequest { + + /** DeleteGlobalOperationRequest operation */ + operation?: (string|null); + + /** DeleteGlobalOperationRequest project */ + project?: (string|null); + } + + /** Represents a DeleteGlobalOperationRequest. */ + class DeleteGlobalOperationRequest implements IDeleteGlobalOperationRequest { + + /** + * Constructs a new DeleteGlobalOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalOperationRequest); + + /** DeleteGlobalOperationRequest operation. */ + public operation: string; + + /** DeleteGlobalOperationRequest project. */ + public project: string; + + /** + * Creates a new DeleteGlobalOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalOperationRequest): google.cloud.compute.v1.DeleteGlobalOperationRequest; + + /** + * Encodes the specified DeleteGlobalOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationRequest.verify|verify} messages. + * @param message DeleteGlobalOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationRequest.verify|verify} messages. + * @param message DeleteGlobalOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalOperationRequest; + + /** + * Decodes a DeleteGlobalOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalOperationRequest; + + /** + * Verifies a DeleteGlobalOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalOperationRequest; + + /** + * Creates a plain object from a DeleteGlobalOperationRequest message. Also converts values to other types if specified. + * @param message DeleteGlobalOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalOperationResponse. */ + interface IDeleteGlobalOperationResponse { + } + + /** Represents a DeleteGlobalOperationResponse. */ + class DeleteGlobalOperationResponse implements IDeleteGlobalOperationResponse { + + /** + * Constructs a new DeleteGlobalOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalOperationResponse); + + /** + * Creates a new DeleteGlobalOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalOperationResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalOperationResponse): google.cloud.compute.v1.DeleteGlobalOperationResponse; + + /** + * Encodes the specified DeleteGlobalOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationResponse.verify|verify} messages. + * @param message DeleteGlobalOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationResponse.verify|verify} messages. + * @param message DeleteGlobalOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalOperationResponse; + + /** + * Decodes a DeleteGlobalOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalOperationResponse; + + /** + * Verifies a DeleteGlobalOperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalOperationResponse; + + /** + * Creates a plain object from a DeleteGlobalOperationResponse message. Also converts values to other types if specified. + * @param message DeleteGlobalOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlobalOperationRequest. */ + interface IGetGlobalOperationRequest { + + /** GetGlobalOperationRequest operation */ + operation?: (string|null); + + /** GetGlobalOperationRequest project */ + project?: (string|null); + } + + /** Represents a GetGlobalOperationRequest. */ + class GetGlobalOperationRequest implements IGetGlobalOperationRequest { + + /** + * Constructs a new GetGlobalOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetGlobalOperationRequest); + + /** GetGlobalOperationRequest operation. */ + public operation: string; + + /** GetGlobalOperationRequest project. */ + public project: string; + + /** + * Creates a new GetGlobalOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetGlobalOperationRequest): google.cloud.compute.v1.GetGlobalOperationRequest; + + /** + * Encodes the specified GetGlobalOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOperationRequest.verify|verify} messages. + * @param message GetGlobalOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetGlobalOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOperationRequest.verify|verify} messages. + * @param message GetGlobalOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetGlobalOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetGlobalOperationRequest; + + /** + * Decodes a GetGlobalOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetGlobalOperationRequest; + + /** + * Verifies a GetGlobalOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlobalOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetGlobalOperationRequest; + + /** + * Creates a plain object from a GetGlobalOperationRequest message. Also converts values to other types if specified. + * @param message GetGlobalOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetGlobalOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlobalOperationsRequest. */ + interface IListGlobalOperationsRequest { + + /** ListGlobalOperationsRequest filter */ + filter?: (string|null); + + /** ListGlobalOperationsRequest maxResults */ + maxResults?: (number|null); + + /** ListGlobalOperationsRequest orderBy */ + orderBy?: (string|null); + + /** ListGlobalOperationsRequest pageToken */ + pageToken?: (string|null); + + /** ListGlobalOperationsRequest project */ + project?: (string|null); + + /** ListGlobalOperationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListGlobalOperationsRequest. */ + class ListGlobalOperationsRequest implements IListGlobalOperationsRequest { + + /** + * Constructs a new ListGlobalOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListGlobalOperationsRequest); + + /** ListGlobalOperationsRequest filter. */ + public filter?: (string|null); + + /** ListGlobalOperationsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListGlobalOperationsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListGlobalOperationsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListGlobalOperationsRequest project. */ + public project: string; + + /** ListGlobalOperationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListGlobalOperationsRequest _filter. */ + public _filter?: "filter"; + + /** ListGlobalOperationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListGlobalOperationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListGlobalOperationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListGlobalOperationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListGlobalOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlobalOperationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListGlobalOperationsRequest): google.cloud.compute.v1.ListGlobalOperationsRequest; + + /** + * Encodes the specified ListGlobalOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOperationsRequest.verify|verify} messages. + * @param message ListGlobalOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListGlobalOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlobalOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOperationsRequest.verify|verify} messages. + * @param message ListGlobalOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListGlobalOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlobalOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListGlobalOperationsRequest; + + /** + * Decodes a ListGlobalOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListGlobalOperationsRequest; + + /** + * Verifies a ListGlobalOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlobalOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlobalOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListGlobalOperationsRequest; + + /** + * Creates a plain object from a ListGlobalOperationsRequest message. Also converts values to other types if specified. + * @param message ListGlobalOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListGlobalOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlobalOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitGlobalOperationRequest. */ + interface IWaitGlobalOperationRequest { + + /** WaitGlobalOperationRequest operation */ + operation?: (string|null); + + /** WaitGlobalOperationRequest project */ + project?: (string|null); + } + + /** Represents a WaitGlobalOperationRequest. */ + class WaitGlobalOperationRequest implements IWaitGlobalOperationRequest { + + /** + * Constructs a new WaitGlobalOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWaitGlobalOperationRequest); + + /** WaitGlobalOperationRequest operation. */ + public operation: string; + + /** WaitGlobalOperationRequest project. */ + public project: string; + + /** + * Creates a new WaitGlobalOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitGlobalOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IWaitGlobalOperationRequest): google.cloud.compute.v1.WaitGlobalOperationRequest; + + /** + * Encodes the specified WaitGlobalOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.WaitGlobalOperationRequest.verify|verify} messages. + * @param message WaitGlobalOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWaitGlobalOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitGlobalOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WaitGlobalOperationRequest.verify|verify} messages. + * @param message WaitGlobalOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWaitGlobalOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitGlobalOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.WaitGlobalOperationRequest; + + /** + * Decodes a WaitGlobalOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.WaitGlobalOperationRequest; + + /** + * Verifies a WaitGlobalOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitGlobalOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitGlobalOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.WaitGlobalOperationRequest; + + /** + * Creates a plain object from a WaitGlobalOperationRequest message. Also converts values to other types if specified. + * @param message WaitGlobalOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.WaitGlobalOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitGlobalOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalOrganizationOperationRequest. */ + interface IDeleteGlobalOrganizationOperationRequest { + + /** DeleteGlobalOrganizationOperationRequest operation */ + operation?: (string|null); + + /** DeleteGlobalOrganizationOperationRequest parentId */ + parentId?: (string|null); + } + + /** Represents a DeleteGlobalOrganizationOperationRequest. */ + class DeleteGlobalOrganizationOperationRequest implements IDeleteGlobalOrganizationOperationRequest { + + /** + * Constructs a new DeleteGlobalOrganizationOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest); + + /** DeleteGlobalOrganizationOperationRequest operation. */ + public operation: string; + + /** DeleteGlobalOrganizationOperationRequest parentId. */ + public parentId?: (string|null); + + /** DeleteGlobalOrganizationOperationRequest _parentId. */ + public _parentId?: "parentId"; + + /** + * Creates a new DeleteGlobalOrganizationOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalOrganizationOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest): google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest.verify|verify} messages. + * @param message DeleteGlobalOrganizationOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest.verify|verify} messages. + * @param message DeleteGlobalOrganizationOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalOrganizationOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest; + + /** + * Decodes a DeleteGlobalOrganizationOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest; + + /** + * Verifies a DeleteGlobalOrganizationOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalOrganizationOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalOrganizationOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest; + + /** + * Creates a plain object from a DeleteGlobalOrganizationOperationRequest message. Also converts values to other types if specified. + * @param message DeleteGlobalOrganizationOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalOrganizationOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalOrganizationOperationResponse. */ + interface IDeleteGlobalOrganizationOperationResponse { + } + + /** Represents a DeleteGlobalOrganizationOperationResponse. */ + class DeleteGlobalOrganizationOperationResponse implements IDeleteGlobalOrganizationOperationResponse { + + /** + * Constructs a new DeleteGlobalOrganizationOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse); + + /** + * Creates a new DeleteGlobalOrganizationOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalOrganizationOperationResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse): google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse.verify|verify} messages. + * @param message DeleteGlobalOrganizationOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse.verify|verify} messages. + * @param message DeleteGlobalOrganizationOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalOrganizationOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalOrganizationOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse; + + /** + * Decodes a DeleteGlobalOrganizationOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalOrganizationOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse; + + /** + * Verifies a DeleteGlobalOrganizationOperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalOrganizationOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalOrganizationOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse; + + /** + * Creates a plain object from a DeleteGlobalOrganizationOperationResponse message. Also converts values to other types if specified. + * @param message DeleteGlobalOrganizationOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalOrganizationOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlobalOrganizationOperationRequest. */ + interface IGetGlobalOrganizationOperationRequest { + + /** GetGlobalOrganizationOperationRequest operation */ + operation?: (string|null); + + /** GetGlobalOrganizationOperationRequest parentId */ + parentId?: (string|null); + } + + /** Represents a GetGlobalOrganizationOperationRequest. */ + class GetGlobalOrganizationOperationRequest implements IGetGlobalOrganizationOperationRequest { + + /** + * Constructs a new GetGlobalOrganizationOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest); + + /** GetGlobalOrganizationOperationRequest operation. */ + public operation: string; + + /** GetGlobalOrganizationOperationRequest parentId. */ + public parentId?: (string|null); + + /** GetGlobalOrganizationOperationRequest _parentId. */ + public _parentId?: "parentId"; + + /** + * Creates a new GetGlobalOrganizationOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalOrganizationOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest): google.cloud.compute.v1.GetGlobalOrganizationOperationRequest; + + /** + * Encodes the specified GetGlobalOrganizationOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOrganizationOperationRequest.verify|verify} messages. + * @param message GetGlobalOrganizationOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalOrganizationOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOrganizationOperationRequest.verify|verify} messages. + * @param message GetGlobalOrganizationOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalOrganizationOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetGlobalOrganizationOperationRequest; + + /** + * Decodes a GetGlobalOrganizationOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetGlobalOrganizationOperationRequest; + + /** + * Verifies a GetGlobalOrganizationOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlobalOrganizationOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalOrganizationOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetGlobalOrganizationOperationRequest; + + /** + * Creates a plain object from a GetGlobalOrganizationOperationRequest message. Also converts values to other types if specified. + * @param message GetGlobalOrganizationOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetGlobalOrganizationOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalOrganizationOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlobalOrganizationOperationsRequest. */ + interface IListGlobalOrganizationOperationsRequest { + + /** ListGlobalOrganizationOperationsRequest filter */ + filter?: (string|null); + + /** ListGlobalOrganizationOperationsRequest maxResults */ + maxResults?: (number|null); + + /** ListGlobalOrganizationOperationsRequest orderBy */ + orderBy?: (string|null); + + /** ListGlobalOrganizationOperationsRequest pageToken */ + pageToken?: (string|null); + + /** ListGlobalOrganizationOperationsRequest parentId */ + parentId?: (string|null); + + /** ListGlobalOrganizationOperationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListGlobalOrganizationOperationsRequest. */ + class ListGlobalOrganizationOperationsRequest implements IListGlobalOrganizationOperationsRequest { + + /** + * Constructs a new ListGlobalOrganizationOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest); + + /** ListGlobalOrganizationOperationsRequest filter. */ + public filter?: (string|null); + + /** ListGlobalOrganizationOperationsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListGlobalOrganizationOperationsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListGlobalOrganizationOperationsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListGlobalOrganizationOperationsRequest parentId. */ + public parentId?: (string|null); + + /** ListGlobalOrganizationOperationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListGlobalOrganizationOperationsRequest _filter. */ + public _filter?: "filter"; + + /** ListGlobalOrganizationOperationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListGlobalOrganizationOperationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListGlobalOrganizationOperationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListGlobalOrganizationOperationsRequest _parentId. */ + public _parentId?: "parentId"; + + /** ListGlobalOrganizationOperationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListGlobalOrganizationOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlobalOrganizationOperationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest): google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest; + + /** + * Encodes the specified ListGlobalOrganizationOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest.verify|verify} messages. + * @param message ListGlobalOrganizationOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlobalOrganizationOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest.verify|verify} messages. + * @param message ListGlobalOrganizationOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlobalOrganizationOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlobalOrganizationOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest; + + /** + * Decodes a ListGlobalOrganizationOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlobalOrganizationOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest; + + /** + * Verifies a ListGlobalOrganizationOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlobalOrganizationOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlobalOrganizationOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest; + + /** + * Creates a plain object from a ListGlobalOrganizationOperationsRequest message. Also converts values to other types if specified. + * @param message ListGlobalOrganizationOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlobalOrganizationOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteGlobalPublicDelegatedPrefixeRequest. */ + interface IDeleteGlobalPublicDelegatedPrefixeRequest { + + /** DeleteGlobalPublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** DeleteGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix */ + publicDelegatedPrefix?: (string|null); + + /** DeleteGlobalPublicDelegatedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteGlobalPublicDelegatedPrefixeRequest. */ + class DeleteGlobalPublicDelegatedPrefixeRequest implements IDeleteGlobalPublicDelegatedPrefixeRequest { + + /** + * Constructs a new DeleteGlobalPublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest); + + /** DeleteGlobalPublicDelegatedPrefixeRequest project. */ + public project: string; + + /** DeleteGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix. */ + public publicDelegatedPrefix: string; + + /** DeleteGlobalPublicDelegatedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** DeleteGlobalPublicDelegatedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGlobalPublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest): google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest; + + /** + * Encodes the specified DeleteGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message DeleteGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message DeleteGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest; + + /** + * Decodes a DeleteGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest; + + /** + * Verifies a DeleteGlobalPublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGlobalPublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from a DeleteGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message DeleteGlobalPublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGlobalPublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGlobalPublicDelegatedPrefixeRequest. */ + interface IGetGlobalPublicDelegatedPrefixeRequest { + + /** GetGlobalPublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** GetGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix */ + publicDelegatedPrefix?: (string|null); + } + + /** Represents a GetGlobalPublicDelegatedPrefixeRequest. */ + class GetGlobalPublicDelegatedPrefixeRequest implements IGetGlobalPublicDelegatedPrefixeRequest { + + /** + * Constructs a new GetGlobalPublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest); + + /** GetGlobalPublicDelegatedPrefixeRequest project. */ + public project: string; + + /** GetGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix. */ + public publicDelegatedPrefix: string; + + /** + * Creates a new GetGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGlobalPublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest): google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest; + + /** + * Encodes the specified GetGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message GetGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message GetGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest; + + /** + * Decodes a GetGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest; + + /** + * Verifies a GetGlobalPublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGlobalPublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from a GetGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message GetGlobalPublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGlobalPublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertGlobalPublicDelegatedPrefixeRequest. */ + interface IInsertGlobalPublicDelegatedPrefixeRequest { + + /** InsertGlobalPublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** InsertGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource */ + publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** InsertGlobalPublicDelegatedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertGlobalPublicDelegatedPrefixeRequest. */ + class InsertGlobalPublicDelegatedPrefixeRequest implements IInsertGlobalPublicDelegatedPrefixeRequest { + + /** + * Constructs a new InsertGlobalPublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest); + + /** InsertGlobalPublicDelegatedPrefixeRequest project. */ + public project: string; + + /** InsertGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. */ + public publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** InsertGlobalPublicDelegatedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** InsertGlobalPublicDelegatedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertGlobalPublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest): google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest; + + /** + * Encodes the specified InsertGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message InsertGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message InsertGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest; + + /** + * Decodes an InsertGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest; + + /** + * Verifies an InsertGlobalPublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertGlobalPublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from an InsertGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message InsertGlobalPublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertGlobalPublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListGlobalPublicDelegatedPrefixesRequest. */ + interface IListGlobalPublicDelegatedPrefixesRequest { + + /** ListGlobalPublicDelegatedPrefixesRequest filter */ + filter?: (string|null); + + /** ListGlobalPublicDelegatedPrefixesRequest maxResults */ + maxResults?: (number|null); + + /** ListGlobalPublicDelegatedPrefixesRequest orderBy */ + orderBy?: (string|null); + + /** ListGlobalPublicDelegatedPrefixesRequest pageToken */ + pageToken?: (string|null); + + /** ListGlobalPublicDelegatedPrefixesRequest project */ + project?: (string|null); + + /** ListGlobalPublicDelegatedPrefixesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListGlobalPublicDelegatedPrefixesRequest. */ + class ListGlobalPublicDelegatedPrefixesRequest implements IListGlobalPublicDelegatedPrefixesRequest { + + /** + * Constructs a new ListGlobalPublicDelegatedPrefixesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest); + + /** ListGlobalPublicDelegatedPrefixesRequest filter. */ + public filter?: (string|null); + + /** ListGlobalPublicDelegatedPrefixesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListGlobalPublicDelegatedPrefixesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListGlobalPublicDelegatedPrefixesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListGlobalPublicDelegatedPrefixesRequest project. */ + public project: string; + + /** ListGlobalPublicDelegatedPrefixesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListGlobalPublicDelegatedPrefixesRequest _filter. */ + public _filter?: "filter"; + + /** ListGlobalPublicDelegatedPrefixesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListGlobalPublicDelegatedPrefixesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListGlobalPublicDelegatedPrefixesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListGlobalPublicDelegatedPrefixesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListGlobalPublicDelegatedPrefixesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGlobalPublicDelegatedPrefixesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest): google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest; + + /** + * Encodes the specified ListGlobalPublicDelegatedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest.verify|verify} messages. + * @param message ListGlobalPublicDelegatedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGlobalPublicDelegatedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest.verify|verify} messages. + * @param message ListGlobalPublicDelegatedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGlobalPublicDelegatedPrefixesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGlobalPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest; + + /** + * Decodes a ListGlobalPublicDelegatedPrefixesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGlobalPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest; + + /** + * Verifies a ListGlobalPublicDelegatedPrefixesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGlobalPublicDelegatedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGlobalPublicDelegatedPrefixesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest; + + /** + * Creates a plain object from a ListGlobalPublicDelegatedPrefixesRequest message. Also converts values to other types if specified. + * @param message ListGlobalPublicDelegatedPrefixesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGlobalPublicDelegatedPrefixesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchGlobalPublicDelegatedPrefixeRequest. */ + interface IPatchGlobalPublicDelegatedPrefixeRequest { + + /** PatchGlobalPublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix */ + publicDelegatedPrefix?: (string|null); + + /** PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource */ + publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** PatchGlobalPublicDelegatedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchGlobalPublicDelegatedPrefixeRequest. */ + class PatchGlobalPublicDelegatedPrefixeRequest implements IPatchGlobalPublicDelegatedPrefixeRequest { + + /** + * Constructs a new PatchGlobalPublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest); + + /** PatchGlobalPublicDelegatedPrefixeRequest project. */ + public project: string; + + /** PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix. */ + public publicDelegatedPrefix: string; + + /** PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. */ + public publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** PatchGlobalPublicDelegatedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** PatchGlobalPublicDelegatedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchGlobalPublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest): google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest; + + /** + * Encodes the specified PatchGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message PatchGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message PatchGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest; + + /** + * Decodes a PatchGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest; + + /** + * Verifies a PatchGlobalPublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchGlobalPublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from a PatchGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message PatchGlobalPublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchGlobalPublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListHealthChecksRequest. */ + interface IAggregatedListHealthChecksRequest { + + /** AggregatedListHealthChecksRequest filter */ + filter?: (string|null); + + /** AggregatedListHealthChecksRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListHealthChecksRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListHealthChecksRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListHealthChecksRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListHealthChecksRequest project */ + project?: (string|null); + + /** AggregatedListHealthChecksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListHealthChecksRequest. */ + class AggregatedListHealthChecksRequest implements IAggregatedListHealthChecksRequest { + + /** + * Constructs a new AggregatedListHealthChecksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListHealthChecksRequest); + + /** AggregatedListHealthChecksRequest filter. */ + public filter?: (string|null); + + /** AggregatedListHealthChecksRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListHealthChecksRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListHealthChecksRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListHealthChecksRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListHealthChecksRequest project. */ + public project: string; + + /** AggregatedListHealthChecksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListHealthChecksRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListHealthChecksRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListHealthChecksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListHealthChecksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListHealthChecksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListHealthChecksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListHealthChecksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListHealthChecksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListHealthChecksRequest): google.cloud.compute.v1.AggregatedListHealthChecksRequest; + + /** + * Encodes the specified AggregatedListHealthChecksRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListHealthChecksRequest.verify|verify} messages. + * @param message AggregatedListHealthChecksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListHealthChecksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListHealthChecksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListHealthChecksRequest.verify|verify} messages. + * @param message AggregatedListHealthChecksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListHealthChecksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListHealthChecksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListHealthChecksRequest; + + /** + * Decodes an AggregatedListHealthChecksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListHealthChecksRequest; + + /** + * Verifies an AggregatedListHealthChecksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListHealthChecksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListHealthChecksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListHealthChecksRequest; + + /** + * Creates a plain object from an AggregatedListHealthChecksRequest message. Also converts values to other types if specified. + * @param message AggregatedListHealthChecksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListHealthChecksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListHealthChecksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteHealthCheckRequest. */ + interface IDeleteHealthCheckRequest { + + /** DeleteHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** DeleteHealthCheckRequest project */ + project?: (string|null); + + /** DeleteHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteHealthCheckRequest. */ + class DeleteHealthCheckRequest implements IDeleteHealthCheckRequest { + + /** + * Constructs a new DeleteHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteHealthCheckRequest); + + /** DeleteHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** DeleteHealthCheckRequest project. */ + public project: string; + + /** DeleteHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** DeleteHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteHealthCheckRequest): google.cloud.compute.v1.DeleteHealthCheckRequest; + + /** + * Encodes the specified DeleteHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteHealthCheckRequest.verify|verify} messages. + * @param message DeleteHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteHealthCheckRequest.verify|verify} messages. + * @param message DeleteHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteHealthCheckRequest; + + /** + * Decodes a DeleteHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteHealthCheckRequest; + + /** + * Verifies a DeleteHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteHealthCheckRequest; + + /** + * Creates a plain object from a DeleteHealthCheckRequest message. Also converts values to other types if specified. + * @param message DeleteHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetHealthCheckRequest. */ + interface IGetHealthCheckRequest { + + /** GetHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** GetHealthCheckRequest project */ + project?: (string|null); + } + + /** Represents a GetHealthCheckRequest. */ + class GetHealthCheckRequest implements IGetHealthCheckRequest { + + /** + * Constructs a new GetHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetHealthCheckRequest); + + /** GetHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** GetHealthCheckRequest project. */ + public project: string; + + /** + * Creates a new GetHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetHealthCheckRequest): google.cloud.compute.v1.GetHealthCheckRequest; + + /** + * Encodes the specified GetHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthCheckRequest.verify|verify} messages. + * @param message GetHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthCheckRequest.verify|verify} messages. + * @param message GetHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetHealthCheckRequest; + + /** + * Decodes a GetHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetHealthCheckRequest; + + /** + * Verifies a GetHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetHealthCheckRequest; + + /** + * Creates a plain object from a GetHealthCheckRequest message. Also converts values to other types if specified. + * @param message GetHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertHealthCheckRequest. */ + interface IInsertHealthCheckRequest { + + /** InsertHealthCheckRequest healthCheckResource */ + healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** InsertHealthCheckRequest project */ + project?: (string|null); + + /** InsertHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertHealthCheckRequest. */ + class InsertHealthCheckRequest implements IInsertHealthCheckRequest { + + /** + * Constructs a new InsertHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertHealthCheckRequest); + + /** InsertHealthCheckRequest healthCheckResource. */ + public healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** InsertHealthCheckRequest project. */ + public project: string; + + /** InsertHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** InsertHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertHealthCheckRequest): google.cloud.compute.v1.InsertHealthCheckRequest; + + /** + * Encodes the specified InsertHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertHealthCheckRequest.verify|verify} messages. + * @param message InsertHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertHealthCheckRequest.verify|verify} messages. + * @param message InsertHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertHealthCheckRequest; + + /** + * Decodes an InsertHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertHealthCheckRequest; + + /** + * Verifies an InsertHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertHealthCheckRequest; + + /** + * Creates a plain object from an InsertHealthCheckRequest message. Also converts values to other types if specified. + * @param message InsertHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListHealthChecksRequest. */ + interface IListHealthChecksRequest { + + /** ListHealthChecksRequest filter */ + filter?: (string|null); + + /** ListHealthChecksRequest maxResults */ + maxResults?: (number|null); + + /** ListHealthChecksRequest orderBy */ + orderBy?: (string|null); + + /** ListHealthChecksRequest pageToken */ + pageToken?: (string|null); + + /** ListHealthChecksRequest project */ + project?: (string|null); + + /** ListHealthChecksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListHealthChecksRequest. */ + class ListHealthChecksRequest implements IListHealthChecksRequest { + + /** + * Constructs a new ListHealthChecksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListHealthChecksRequest); + + /** ListHealthChecksRequest filter. */ + public filter?: (string|null); + + /** ListHealthChecksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListHealthChecksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListHealthChecksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListHealthChecksRequest project. */ + public project: string; + + /** ListHealthChecksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListHealthChecksRequest _filter. */ + public _filter?: "filter"; + + /** ListHealthChecksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListHealthChecksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListHealthChecksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListHealthChecksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListHealthChecksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHealthChecksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListHealthChecksRequest): google.cloud.compute.v1.ListHealthChecksRequest; + + /** + * Encodes the specified ListHealthChecksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListHealthChecksRequest.verify|verify} messages. + * @param message ListHealthChecksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListHealthChecksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHealthChecksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListHealthChecksRequest.verify|verify} messages. + * @param message ListHealthChecksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListHealthChecksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHealthChecksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListHealthChecksRequest; + + /** + * Decodes a ListHealthChecksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListHealthChecksRequest; + + /** + * Verifies a ListHealthChecksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHealthChecksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHealthChecksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListHealthChecksRequest; + + /** + * Creates a plain object from a ListHealthChecksRequest message. Also converts values to other types if specified. + * @param message ListHealthChecksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListHealthChecksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHealthChecksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchHealthCheckRequest. */ + interface IPatchHealthCheckRequest { + + /** PatchHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** PatchHealthCheckRequest healthCheckResource */ + healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** PatchHealthCheckRequest project */ + project?: (string|null); + + /** PatchHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchHealthCheckRequest. */ + class PatchHealthCheckRequest implements IPatchHealthCheckRequest { + + /** + * Constructs a new PatchHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchHealthCheckRequest); + + /** PatchHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** PatchHealthCheckRequest healthCheckResource. */ + public healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** PatchHealthCheckRequest project. */ + public project: string; + + /** PatchHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** PatchHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchHealthCheckRequest): google.cloud.compute.v1.PatchHealthCheckRequest; + + /** + * Encodes the specified PatchHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchHealthCheckRequest.verify|verify} messages. + * @param message PatchHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchHealthCheckRequest.verify|verify} messages. + * @param message PatchHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchHealthCheckRequest; + + /** + * Decodes a PatchHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchHealthCheckRequest; + + /** + * Verifies a PatchHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchHealthCheckRequest; + + /** + * Creates a plain object from a PatchHealthCheckRequest message. Also converts values to other types if specified. + * @param message PatchHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateHealthCheckRequest. */ + interface IUpdateHealthCheckRequest { + + /** UpdateHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** UpdateHealthCheckRequest healthCheckResource */ + healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** UpdateHealthCheckRequest project */ + project?: (string|null); + + /** UpdateHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateHealthCheckRequest. */ + class UpdateHealthCheckRequest implements IUpdateHealthCheckRequest { + + /** + * Constructs a new UpdateHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateHealthCheckRequest); + + /** UpdateHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** UpdateHealthCheckRequest healthCheckResource. */ + public healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** UpdateHealthCheckRequest project. */ + public project: string; + + /** UpdateHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** UpdateHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateHealthCheckRequest): google.cloud.compute.v1.UpdateHealthCheckRequest; + + /** + * Encodes the specified UpdateHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateHealthCheckRequest.verify|verify} messages. + * @param message UpdateHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateHealthCheckRequest.verify|verify} messages. + * @param message UpdateHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateHealthCheckRequest; + + /** + * Decodes an UpdateHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateHealthCheckRequest; + + /** + * Verifies an UpdateHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateHealthCheckRequest; + + /** + * Creates a plain object from an UpdateHealthCheckRequest message. Also converts values to other types if specified. + * @param message UpdateHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteImageRequest. */ + interface IDeleteImageRequest { + + /** DeleteImageRequest image */ + image?: (string|null); + + /** DeleteImageRequest project */ + project?: (string|null); + + /** DeleteImageRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteImageRequest. */ + class DeleteImageRequest implements IDeleteImageRequest { + + /** + * Constructs a new DeleteImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteImageRequest); + + /** DeleteImageRequest image. */ + public image: string; + + /** DeleteImageRequest project. */ + public project: string; + + /** DeleteImageRequest requestId. */ + public requestId?: (string|null); + + /** DeleteImageRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteImageRequest): google.cloud.compute.v1.DeleteImageRequest; + + /** + * Encodes the specified DeleteImageRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteImageRequest.verify|verify} messages. + * @param message DeleteImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteImageRequest.verify|verify} messages. + * @param message DeleteImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteImageRequest; + + /** + * Decodes a DeleteImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteImageRequest; + + /** + * Verifies a DeleteImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteImageRequest; + + /** + * Creates a plain object from a DeleteImageRequest message. Also converts values to other types if specified. + * @param message DeleteImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeprecateImageRequest. */ + interface IDeprecateImageRequest { + + /** DeprecateImageRequest deprecationStatusResource */ + deprecationStatusResource?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** DeprecateImageRequest image */ + image?: (string|null); + + /** DeprecateImageRequest project */ + project?: (string|null); + + /** DeprecateImageRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeprecateImageRequest. */ + class DeprecateImageRequest implements IDeprecateImageRequest { + + /** + * Constructs a new DeprecateImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeprecateImageRequest); + + /** DeprecateImageRequest deprecationStatusResource. */ + public deprecationStatusResource?: (google.cloud.compute.v1.IDeprecationStatus|null); + + /** DeprecateImageRequest image. */ + public image: string; + + /** DeprecateImageRequest project. */ + public project: string; + + /** DeprecateImageRequest requestId. */ + public requestId?: (string|null); + + /** DeprecateImageRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeprecateImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeprecateImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeprecateImageRequest): google.cloud.compute.v1.DeprecateImageRequest; + + /** + * Encodes the specified DeprecateImageRequest message. Does not implicitly {@link google.cloud.compute.v1.DeprecateImageRequest.verify|verify} messages. + * @param message DeprecateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeprecateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeprecateImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeprecateImageRequest.verify|verify} messages. + * @param message DeprecateImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeprecateImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeprecateImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeprecateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeprecateImageRequest; + + /** + * Decodes a DeprecateImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeprecateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeprecateImageRequest; + + /** + * Verifies a DeprecateImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeprecateImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeprecateImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeprecateImageRequest; + + /** + * Creates a plain object from a DeprecateImageRequest message. Also converts values to other types if specified. + * @param message DeprecateImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeprecateImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeprecateImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetImageRequest. */ + interface IGetImageRequest { + + /** GetImageRequest image */ + image?: (string|null); + + /** GetImageRequest project */ + project?: (string|null); + } + + /** Represents a GetImageRequest. */ + class GetImageRequest implements IGetImageRequest { + + /** + * Constructs a new GetImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetImageRequest); + + /** GetImageRequest image. */ + public image: string; + + /** GetImageRequest project. */ + public project: string; + + /** + * Creates a new GetImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetImageRequest): google.cloud.compute.v1.GetImageRequest; + + /** + * Encodes the specified GetImageRequest message. Does not implicitly {@link google.cloud.compute.v1.GetImageRequest.verify|verify} messages. + * @param message GetImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetImageRequest.verify|verify} messages. + * @param message GetImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetImageRequest; + + /** + * Decodes a GetImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetImageRequest; + + /** + * Verifies a GetImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetImageRequest; + + /** + * Creates a plain object from a GetImageRequest message. Also converts values to other types if specified. + * @param message GetImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetFromFamilyImageRequest. */ + interface IGetFromFamilyImageRequest { + + /** GetFromFamilyImageRequest family */ + family?: (string|null); + + /** GetFromFamilyImageRequest project */ + project?: (string|null); + } + + /** Represents a GetFromFamilyImageRequest. */ + class GetFromFamilyImageRequest implements IGetFromFamilyImageRequest { + + /** + * Constructs a new GetFromFamilyImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetFromFamilyImageRequest); + + /** GetFromFamilyImageRequest family. */ + public family: string; + + /** GetFromFamilyImageRequest project. */ + public project: string; + + /** + * Creates a new GetFromFamilyImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFromFamilyImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetFromFamilyImageRequest): google.cloud.compute.v1.GetFromFamilyImageRequest; + + /** + * Encodes the specified GetFromFamilyImageRequest message. Does not implicitly {@link google.cloud.compute.v1.GetFromFamilyImageRequest.verify|verify} messages. + * @param message GetFromFamilyImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetFromFamilyImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFromFamilyImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetFromFamilyImageRequest.verify|verify} messages. + * @param message GetFromFamilyImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetFromFamilyImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFromFamilyImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFromFamilyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetFromFamilyImageRequest; + + /** + * Decodes a GetFromFamilyImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFromFamilyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetFromFamilyImageRequest; + + /** + * Verifies a GetFromFamilyImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFromFamilyImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFromFamilyImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetFromFamilyImageRequest; + + /** + * Creates a plain object from a GetFromFamilyImageRequest message. Also converts values to other types if specified. + * @param message GetFromFamilyImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetFromFamilyImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFromFamilyImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyImageRequest. */ + interface IGetIamPolicyImageRequest { + + /** GetIamPolicyImageRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyImageRequest project */ + project?: (string|null); + + /** GetIamPolicyImageRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicyImageRequest. */ + class GetIamPolicyImageRequest implements IGetIamPolicyImageRequest { + + /** + * Constructs a new GetIamPolicyImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyImageRequest); + + /** GetIamPolicyImageRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyImageRequest project. */ + public project: string; + + /** GetIamPolicyImageRequest resource. */ + public resource: string; + + /** GetIamPolicyImageRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyImageRequest): google.cloud.compute.v1.GetIamPolicyImageRequest; + + /** + * Encodes the specified GetIamPolicyImageRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyImageRequest.verify|verify} messages. + * @param message GetIamPolicyImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyImageRequest.verify|verify} messages. + * @param message GetIamPolicyImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyImageRequest; + + /** + * Decodes a GetIamPolicyImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyImageRequest; + + /** + * Verifies a GetIamPolicyImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyImageRequest; + + /** + * Creates a plain object from a GetIamPolicyImageRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertImageRequest. */ + interface IInsertImageRequest { + + /** InsertImageRequest forceCreate */ + forceCreate?: (boolean|null); + + /** InsertImageRequest imageResource */ + imageResource?: (google.cloud.compute.v1.IImage|null); + + /** InsertImageRequest project */ + project?: (string|null); + + /** InsertImageRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertImageRequest. */ + class InsertImageRequest implements IInsertImageRequest { + + /** + * Constructs a new InsertImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertImageRequest); + + /** InsertImageRequest forceCreate. */ + public forceCreate?: (boolean|null); + + /** InsertImageRequest imageResource. */ + public imageResource?: (google.cloud.compute.v1.IImage|null); + + /** InsertImageRequest project. */ + public project: string; + + /** InsertImageRequest requestId. */ + public requestId?: (string|null); + + /** InsertImageRequest _forceCreate. */ + public _forceCreate?: "forceCreate"; + + /** InsertImageRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertImageRequest): google.cloud.compute.v1.InsertImageRequest; + + /** + * Encodes the specified InsertImageRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertImageRequest.verify|verify} messages. + * @param message InsertImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertImageRequest.verify|verify} messages. + * @param message InsertImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertImageRequest; + + /** + * Decodes an InsertImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertImageRequest; + + /** + * Verifies an InsertImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertImageRequest; + + /** + * Creates a plain object from an InsertImageRequest message. Also converts values to other types if specified. + * @param message InsertImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListImagesRequest. */ + interface IListImagesRequest { + + /** ListImagesRequest filter */ + filter?: (string|null); + + /** ListImagesRequest maxResults */ + maxResults?: (number|null); + + /** ListImagesRequest orderBy */ + orderBy?: (string|null); + + /** ListImagesRequest pageToken */ + pageToken?: (string|null); + + /** ListImagesRequest project */ + project?: (string|null); + + /** ListImagesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListImagesRequest. */ + class ListImagesRequest implements IListImagesRequest { + + /** + * Constructs a new ListImagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListImagesRequest); + + /** ListImagesRequest filter. */ + public filter?: (string|null); + + /** ListImagesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListImagesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListImagesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListImagesRequest project. */ + public project: string; + + /** ListImagesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListImagesRequest _filter. */ + public _filter?: "filter"; + + /** ListImagesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListImagesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListImagesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListImagesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListImagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListImagesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListImagesRequest): google.cloud.compute.v1.ListImagesRequest; + + /** + * Encodes the specified ListImagesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListImagesRequest.verify|verify} messages. + * @param message ListImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListImagesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListImagesRequest.verify|verify} messages. + * @param message ListImagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListImagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListImagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListImagesRequest; + + /** + * Decodes a ListImagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListImagesRequest; + + /** + * Verifies a ListImagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListImagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListImagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListImagesRequest; + + /** + * Creates a plain object from a ListImagesRequest message. Also converts values to other types if specified. + * @param message ListImagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListImagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListImagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchImageRequest. */ + interface IPatchImageRequest { + + /** PatchImageRequest image */ + image?: (string|null); + + /** PatchImageRequest imageResource */ + imageResource?: (google.cloud.compute.v1.IImage|null); + + /** PatchImageRequest project */ + project?: (string|null); + + /** PatchImageRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchImageRequest. */ + class PatchImageRequest implements IPatchImageRequest { + + /** + * Constructs a new PatchImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchImageRequest); + + /** PatchImageRequest image. */ + public image: string; + + /** PatchImageRequest imageResource. */ + public imageResource?: (google.cloud.compute.v1.IImage|null); + + /** PatchImageRequest project. */ + public project: string; + + /** PatchImageRequest requestId. */ + public requestId?: (string|null); + + /** PatchImageRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchImageRequest): google.cloud.compute.v1.PatchImageRequest; + + /** + * Encodes the specified PatchImageRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchImageRequest.verify|verify} messages. + * @param message PatchImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchImageRequest.verify|verify} messages. + * @param message PatchImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchImageRequest; + + /** + * Decodes a PatchImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchImageRequest; + + /** + * Verifies a PatchImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchImageRequest; + + /** + * Creates a plain object from a PatchImageRequest message. Also converts values to other types if specified. + * @param message PatchImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyImageRequest. */ + interface ISetIamPolicyImageRequest { + + /** SetIamPolicyImageRequest globalSetPolicyRequestResource */ + globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicyImageRequest project */ + project?: (string|null); + + /** SetIamPolicyImageRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicyImageRequest. */ + class SetIamPolicyImageRequest implements ISetIamPolicyImageRequest { + + /** + * Constructs a new SetIamPolicyImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyImageRequest); + + /** SetIamPolicyImageRequest globalSetPolicyRequestResource. */ + public globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicyImageRequest project. */ + public project: string; + + /** SetIamPolicyImageRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicyImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyImageRequest): google.cloud.compute.v1.SetIamPolicyImageRequest; + + /** + * Encodes the specified SetIamPolicyImageRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyImageRequest.verify|verify} messages. + * @param message SetIamPolicyImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyImageRequest.verify|verify} messages. + * @param message SetIamPolicyImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyImageRequest; + + /** + * Decodes a SetIamPolicyImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyImageRequest; + + /** + * Verifies a SetIamPolicyImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyImageRequest; + + /** + * Creates a plain object from a SetIamPolicyImageRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsImageRequest. */ + interface ISetLabelsImageRequest { + + /** SetLabelsImageRequest globalSetLabelsRequestResource */ + globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsImageRequest project */ + project?: (string|null); + + /** SetLabelsImageRequest resource */ + resource?: (string|null); + } + + /** Represents a SetLabelsImageRequest. */ + class SetLabelsImageRequest implements ISetLabelsImageRequest { + + /** + * Constructs a new SetLabelsImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsImageRequest); + + /** SetLabelsImageRequest globalSetLabelsRequestResource. */ + public globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsImageRequest project. */ + public project: string; + + /** SetLabelsImageRequest resource. */ + public resource: string; + + /** + * Creates a new SetLabelsImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsImageRequest): google.cloud.compute.v1.SetLabelsImageRequest; + + /** + * Encodes the specified SetLabelsImageRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsImageRequest.verify|verify} messages. + * @param message SetLabelsImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsImageRequest.verify|verify} messages. + * @param message SetLabelsImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsImageRequest; + + /** + * Decodes a SetLabelsImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsImageRequest; + + /** + * Verifies a SetLabelsImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsImageRequest; + + /** + * Creates a plain object from a SetLabelsImageRequest message. Also converts values to other types if specified. + * @param message SetLabelsImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsImageRequest. */ + interface ITestIamPermissionsImageRequest { + + /** TestIamPermissionsImageRequest project */ + project?: (string|null); + + /** TestIamPermissionsImageRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsImageRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsImageRequest. */ + class TestIamPermissionsImageRequest implements ITestIamPermissionsImageRequest { + + /** + * Constructs a new TestIamPermissionsImageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsImageRequest); + + /** TestIamPermissionsImageRequest project. */ + public project: string; + + /** TestIamPermissionsImageRequest resource. */ + public resource: string; + + /** TestIamPermissionsImageRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsImageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsImageRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsImageRequest): google.cloud.compute.v1.TestIamPermissionsImageRequest; + + /** + * Encodes the specified TestIamPermissionsImageRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsImageRequest.verify|verify} messages. + * @param message TestIamPermissionsImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsImageRequest.verify|verify} messages. + * @param message TestIamPermissionsImageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsImageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsImageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsImageRequest; + + /** + * Decodes a TestIamPermissionsImageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsImageRequest; + + /** + * Verifies a TestIamPermissionsImageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsImageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsImageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsImageRequest; + + /** + * Creates a plain object from a TestIamPermissionsImageRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsImageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsImageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsImageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AbandonInstancesInstanceGroupManagerRequest. */ + interface IAbandonInstancesInstanceGroupManagerRequest { + + /** AbandonInstancesInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** AbandonInstancesInstanceGroupManagerRequest instanceGroupManagersAbandonInstancesRequestResource */ + instanceGroupManagersAbandonInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest|null); + + /** AbandonInstancesInstanceGroupManagerRequest project */ + project?: (string|null); + + /** AbandonInstancesInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** AbandonInstancesInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents an AbandonInstancesInstanceGroupManagerRequest. */ + class AbandonInstancesInstanceGroupManagerRequest implements IAbandonInstancesInstanceGroupManagerRequest { + + /** + * Constructs a new AbandonInstancesInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest); + + /** AbandonInstancesInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** AbandonInstancesInstanceGroupManagerRequest instanceGroupManagersAbandonInstancesRequestResource. */ + public instanceGroupManagersAbandonInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest|null); + + /** AbandonInstancesInstanceGroupManagerRequest project. */ + public project: string; + + /** AbandonInstancesInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** AbandonInstancesInstanceGroupManagerRequest zone. */ + public zone: string; + + /** AbandonInstancesInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AbandonInstancesInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AbandonInstancesInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest): google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest; + + /** + * Encodes the specified AbandonInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message AbandonInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AbandonInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message AbandonInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AbandonInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AbandonInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest; + + /** + * Decodes an AbandonInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AbandonInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest; + + /** + * Verifies an AbandonInstancesInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AbandonInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AbandonInstancesInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest; + + /** + * Creates a plain object from an AbandonInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message AbandonInstancesInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AbandonInstancesInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListInstanceGroupManagersRequest. */ + interface IAggregatedListInstanceGroupManagersRequest { + + /** AggregatedListInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** AggregatedListInstanceGroupManagersRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListInstanceGroupManagersRequest project */ + project?: (string|null); + + /** AggregatedListInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListInstanceGroupManagersRequest. */ + class AggregatedListInstanceGroupManagersRequest implements IAggregatedListInstanceGroupManagersRequest { + + /** + * Constructs a new AggregatedListInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest); + + /** AggregatedListInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** AggregatedListInstanceGroupManagersRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListInstanceGroupManagersRequest project. */ + public project: string; + + /** AggregatedListInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListInstanceGroupManagersRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest): google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest; + + /** + * Encodes the specified AggregatedListInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest.verify|verify} messages. + * @param message AggregatedListInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest.verify|verify} messages. + * @param message AggregatedListInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest; + + /** + * Decodes an AggregatedListInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest; + + /** + * Verifies an AggregatedListInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest; + + /** + * Creates a plain object from an AggregatedListInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message AggregatedListInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ApplyUpdatesToInstancesInstanceGroupManagerRequest. */ + interface IApplyUpdatesToInstancesInstanceGroupManagerRequest { + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManagersApplyUpdatesRequestResource */ + instanceGroupManagersApplyUpdatesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest|null); + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest project */ + project?: (string|null); + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents an ApplyUpdatesToInstancesInstanceGroupManagerRequest. */ + class ApplyUpdatesToInstancesInstanceGroupManagerRequest implements IApplyUpdatesToInstancesInstanceGroupManagerRequest { + + /** + * Constructs a new ApplyUpdatesToInstancesInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest); + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManagersApplyUpdatesRequestResource. */ + public instanceGroupManagersApplyUpdatesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest|null); + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest project. */ + public project: string; + + /** ApplyUpdatesToInstancesInstanceGroupManagerRequest zone. */ + public zone: string; + + /** + * Creates a new ApplyUpdatesToInstancesInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyUpdatesToInstancesInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest): google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest; + + /** + * Encodes the specified ApplyUpdatesToInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyUpdatesToInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyUpdatesToInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest; + + /** + * Decodes an ApplyUpdatesToInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest; + + /** + * Verifies an ApplyUpdatesToInstancesInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplyUpdatesToInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyUpdatesToInstancesInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest; + + /** + * Creates a plain object from an ApplyUpdatesToInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyUpdatesToInstancesInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateInstancesInstanceGroupManagerRequest. */ + interface ICreateInstancesInstanceGroupManagerRequest { + + /** CreateInstancesInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** CreateInstancesInstanceGroupManagerRequest instanceGroupManagersCreateInstancesRequestResource */ + instanceGroupManagersCreateInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest|null); + + /** CreateInstancesInstanceGroupManagerRequest project */ + project?: (string|null); + + /** CreateInstancesInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** CreateInstancesInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a CreateInstancesInstanceGroupManagerRequest. */ + class CreateInstancesInstanceGroupManagerRequest implements ICreateInstancesInstanceGroupManagerRequest { + + /** + * Constructs a new CreateInstancesInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest); + + /** CreateInstancesInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** CreateInstancesInstanceGroupManagerRequest instanceGroupManagersCreateInstancesRequestResource. */ + public instanceGroupManagersCreateInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest|null); + + /** CreateInstancesInstanceGroupManagerRequest project. */ + public project: string; + + /** CreateInstancesInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** CreateInstancesInstanceGroupManagerRequest zone. */ + public zone: string; + + /** CreateInstancesInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new CreateInstancesInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstancesInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest): google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest; + + /** + * Encodes the specified CreateInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message CreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message CreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest; + + /** + * Decodes a CreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest; + + /** + * Verifies a CreateInstancesInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstancesInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest; + + /** + * Creates a plain object from a CreateInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message CreateInstancesInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstancesInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstanceGroupManagerRequest. */ + interface IDeleteInstanceGroupManagerRequest { + + /** DeleteInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** DeleteInstanceGroupManagerRequest project */ + project?: (string|null); + + /** DeleteInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** DeleteInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteInstanceGroupManagerRequest. */ + class DeleteInstanceGroupManagerRequest implements IDeleteInstanceGroupManagerRequest { + + /** + * Constructs a new DeleteInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest); + + /** DeleteInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** DeleteInstanceGroupManagerRequest project. */ + public project: string; + + /** DeleteInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInstanceGroupManagerRequest zone. */ + public zone: string; + + /** DeleteInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest): google.cloud.compute.v1.DeleteInstanceGroupManagerRequest; + + /** + * Encodes the specified DeleteInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteInstanceGroupManagerRequest; + + /** + * Decodes a DeleteInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteInstanceGroupManagerRequest; + + /** + * Verifies a DeleteInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteInstanceGroupManagerRequest; + + /** + * Creates a plain object from a DeleteInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstancesInstanceGroupManagerRequest. */ + interface IDeleteInstancesInstanceGroupManagerRequest { + + /** DeleteInstancesInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** DeleteInstancesInstanceGroupManagerRequest instanceGroupManagersDeleteInstancesRequestResource */ + instanceGroupManagersDeleteInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest|null); + + /** DeleteInstancesInstanceGroupManagerRequest project */ + project?: (string|null); + + /** DeleteInstancesInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** DeleteInstancesInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteInstancesInstanceGroupManagerRequest. */ + class DeleteInstancesInstanceGroupManagerRequest implements IDeleteInstancesInstanceGroupManagerRequest { + + /** + * Constructs a new DeleteInstancesInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest); + + /** DeleteInstancesInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** DeleteInstancesInstanceGroupManagerRequest instanceGroupManagersDeleteInstancesRequestResource. */ + public instanceGroupManagersDeleteInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest|null); + + /** DeleteInstancesInstanceGroupManagerRequest project. */ + public project: string; + + /** DeleteInstancesInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInstancesInstanceGroupManagerRequest zone. */ + public zone: string; + + /** DeleteInstancesInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInstancesInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstancesInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest): google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest; + + /** + * Encodes the specified DeleteInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest; + + /** + * Decodes a DeleteInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest; + + /** + * Verifies a DeleteInstancesInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstancesInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest; + + /** + * Creates a plain object from a DeleteInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message DeleteInstancesInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstancesInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeletePerInstanceConfigsInstanceGroupManagerRequest. */ + interface IDeletePerInstanceConfigsInstanceGroupManagerRequest { + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersDeletePerInstanceConfigsReqResource */ + instanceGroupManagersDeletePerInstanceConfigsReqResource?: (google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq|null); + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest project */ + project?: (string|null); + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a DeletePerInstanceConfigsInstanceGroupManagerRequest. */ + class DeletePerInstanceConfigsInstanceGroupManagerRequest implements IDeletePerInstanceConfigsInstanceGroupManagerRequest { + + /** + * Constructs a new DeletePerInstanceConfigsInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest); + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersDeletePerInstanceConfigsReqResource. */ + public instanceGroupManagersDeletePerInstanceConfigsReqResource?: (google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq|null); + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest project. */ + public project: string; + + /** DeletePerInstanceConfigsInstanceGroupManagerRequest zone. */ + public zone: string; + + /** + * Creates a new DeletePerInstanceConfigsInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePerInstanceConfigsInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest): google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Encodes the specified DeletePerInstanceConfigsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePerInstanceConfigsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Decodes a DeletePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Verifies a DeletePerInstanceConfigsInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePerInstanceConfigsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePerInstanceConfigsInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Creates a plain object from a DeletePerInstanceConfigsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message DeletePerInstanceConfigsInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePerInstanceConfigsInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInstanceGroupManagerRequest. */ + interface IGetInstanceGroupManagerRequest { + + /** GetInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** GetInstanceGroupManagerRequest project */ + project?: (string|null); + + /** GetInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a GetInstanceGroupManagerRequest. */ + class GetInstanceGroupManagerRequest implements IGetInstanceGroupManagerRequest { + + /** + * Constructs a new GetInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetInstanceGroupManagerRequest); + + /** GetInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** GetInstanceGroupManagerRequest project. */ + public project: string; + + /** GetInstanceGroupManagerRequest zone. */ + public zone: string; + + /** + * Creates a new GetInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetInstanceGroupManagerRequest): google.cloud.compute.v1.GetInstanceGroupManagerRequest; + + /** + * Encodes the specified GetInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupManagerRequest.verify|verify} messages. + * @param message GetInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupManagerRequest.verify|verify} messages. + * @param message GetInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetInstanceGroupManagerRequest; + + /** + * Decodes a GetInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetInstanceGroupManagerRequest; + + /** + * Verifies a GetInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetInstanceGroupManagerRequest; + + /** + * Creates a plain object from a GetInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message GetInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertInstanceGroupManagerRequest. */ + interface IInsertInstanceGroupManagerRequest { + + /** InsertInstanceGroupManagerRequest instanceGroupManagerResource */ + instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** InsertInstanceGroupManagerRequest project */ + project?: (string|null); + + /** InsertInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** InsertInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertInstanceGroupManagerRequest. */ + class InsertInstanceGroupManagerRequest implements IInsertInstanceGroupManagerRequest { + + /** + * Constructs a new InsertInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertInstanceGroupManagerRequest); + + /** InsertInstanceGroupManagerRequest instanceGroupManagerResource. */ + public instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** InsertInstanceGroupManagerRequest project. */ + public project: string; + + /** InsertInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** InsertInstanceGroupManagerRequest zone. */ + public zone: string; + + /** InsertInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertInstanceGroupManagerRequest): google.cloud.compute.v1.InsertInstanceGroupManagerRequest; + + /** + * Encodes the specified InsertInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupManagerRequest.verify|verify} messages. + * @param message InsertInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupManagerRequest.verify|verify} messages. + * @param message InsertInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertInstanceGroupManagerRequest; + + /** + * Decodes an InsertInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertInstanceGroupManagerRequest; + + /** + * Verifies an InsertInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertInstanceGroupManagerRequest; + + /** + * Creates a plain object from an InsertInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message InsertInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstanceGroupManagersRequest. */ + interface IListInstanceGroupManagersRequest { + + /** ListInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListInstanceGroupManagersRequest zone */ + zone?: (string|null); + } + + /** Represents a ListInstanceGroupManagersRequest. */ + class ListInstanceGroupManagersRequest implements IListInstanceGroupManagersRequest { + + /** + * Constructs a new ListInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInstanceGroupManagersRequest); + + /** ListInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInstanceGroupManagersRequest project. */ + public project: string; + + /** ListInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInstanceGroupManagersRequest zone. */ + public zone: string; + + /** ListInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInstanceGroupManagersRequest): google.cloud.compute.v1.ListInstanceGroupManagersRequest; + + /** + * Encodes the specified ListInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInstanceGroupManagersRequest; + + /** + * Decodes a ListInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInstanceGroupManagersRequest; + + /** + * Verifies a ListInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListErrorsInstanceGroupManagersRequest. */ + interface IListErrorsInstanceGroupManagersRequest { + + /** ListErrorsInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListErrorsInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListErrorsInstanceGroupManagersRequest zone */ + zone?: (string|null); + } + + /** Represents a ListErrorsInstanceGroupManagersRequest. */ + class ListErrorsInstanceGroupManagersRequest implements IListErrorsInstanceGroupManagersRequest { + + /** + * Constructs a new ListErrorsInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest); + + /** ListErrorsInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ListErrorsInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListErrorsInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListErrorsInstanceGroupManagersRequest project. */ + public project: string; + + /** ListErrorsInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListErrorsInstanceGroupManagersRequest zone. */ + public zone: string; + + /** ListErrorsInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListErrorsInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListErrorsInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListErrorsInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListErrorsInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListErrorsInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListErrorsInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest): google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest; + + /** + * Encodes the specified ListErrorsInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListErrorsInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListErrorsInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListErrorsInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListErrorsInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListErrorsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest; + + /** + * Decodes a ListErrorsInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListErrorsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest; + + /** + * Verifies a ListErrorsInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListErrorsInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListErrorsInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListErrorsInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListErrorsInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListErrorsInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListManagedInstancesInstanceGroupManagersRequest. */ + interface IListManagedInstancesInstanceGroupManagersRequest { + + /** ListManagedInstancesInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListManagedInstancesInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListManagedInstancesInstanceGroupManagersRequest zone */ + zone?: (string|null); + } + + /** Represents a ListManagedInstancesInstanceGroupManagersRequest. */ + class ListManagedInstancesInstanceGroupManagersRequest implements IListManagedInstancesInstanceGroupManagersRequest { + + /** + * Constructs a new ListManagedInstancesInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest); + + /** ListManagedInstancesInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ListManagedInstancesInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListManagedInstancesInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListManagedInstancesInstanceGroupManagersRequest project. */ + public project: string; + + /** ListManagedInstancesInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListManagedInstancesInstanceGroupManagersRequest zone. */ + public zone: string; + + /** ListManagedInstancesInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListManagedInstancesInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListManagedInstancesInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListManagedInstancesInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListManagedInstancesInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListManagedInstancesInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagedInstancesInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest): google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest; + + /** + * Encodes the specified ListManagedInstancesInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListManagedInstancesInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagedInstancesInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListManagedInstancesInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagedInstancesInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagedInstancesInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest; + + /** + * Decodes a ListManagedInstancesInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagedInstancesInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest; + + /** + * Verifies a ListManagedInstancesInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagedInstancesInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagedInstancesInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListManagedInstancesInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListManagedInstancesInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagedInstancesInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPerInstanceConfigsInstanceGroupManagersRequest. */ + interface IListPerInstanceConfigsInstanceGroupManagersRequest { + + /** ListPerInstanceConfigsInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest zone */ + zone?: (string|null); + } + + /** Represents a ListPerInstanceConfigsInstanceGroupManagersRequest. */ + class ListPerInstanceConfigsInstanceGroupManagersRequest implements IListPerInstanceConfigsInstanceGroupManagersRequest { + + /** + * Constructs a new ListPerInstanceConfigsInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ListPerInstanceConfigsInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest project. */ + public project: string; + + /** ListPerInstanceConfigsInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListPerInstanceConfigsInstanceGroupManagersRequest zone. */ + public zone: string; + + /** ListPerInstanceConfigsInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListPerInstanceConfigsInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListPerInstanceConfigsInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListPerInstanceConfigsInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListPerInstanceConfigsInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListPerInstanceConfigsInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPerInstanceConfigsInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest): google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest; + + /** + * Encodes the specified ListPerInstanceConfigsInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPerInstanceConfigsInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPerInstanceConfigsInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPerInstanceConfigsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest; + + /** + * Decodes a ListPerInstanceConfigsInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPerInstanceConfigsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest; + + /** + * Verifies a ListPerInstanceConfigsInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPerInstanceConfigsInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPerInstanceConfigsInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListPerInstanceConfigsInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListPerInstanceConfigsInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPerInstanceConfigsInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchInstanceGroupManagerRequest. */ + interface IPatchInstanceGroupManagerRequest { + + /** PatchInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** PatchInstanceGroupManagerRequest instanceGroupManagerResource */ + instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** PatchInstanceGroupManagerRequest project */ + project?: (string|null); + + /** PatchInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** PatchInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a PatchInstanceGroupManagerRequest. */ + class PatchInstanceGroupManagerRequest implements IPatchInstanceGroupManagerRequest { + + /** + * Constructs a new PatchInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchInstanceGroupManagerRequest); + + /** PatchInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** PatchInstanceGroupManagerRequest instanceGroupManagerResource. */ + public instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** PatchInstanceGroupManagerRequest project. */ + public project: string; + + /** PatchInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** PatchInstanceGroupManagerRequest zone. */ + public zone: string; + + /** PatchInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchInstanceGroupManagerRequest): google.cloud.compute.v1.PatchInstanceGroupManagerRequest; + + /** + * Encodes the specified PatchInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchInstanceGroupManagerRequest; + + /** + * Decodes a PatchInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchInstanceGroupManagerRequest; + + /** + * Verifies a PatchInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchInstanceGroupManagerRequest; + + /** + * Creates a plain object from a PatchInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message PatchInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchPerInstanceConfigsInstanceGroupManagerRequest. */ + interface IPatchPerInstanceConfigsInstanceGroupManagerRequest { + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersPatchPerInstanceConfigsReqResource */ + instanceGroupManagersPatchPerInstanceConfigsReqResource?: (google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq|null); + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest project */ + project?: (string|null); + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a PatchPerInstanceConfigsInstanceGroupManagerRequest. */ + class PatchPerInstanceConfigsInstanceGroupManagerRequest implements IPatchPerInstanceConfigsInstanceGroupManagerRequest { + + /** + * Constructs a new PatchPerInstanceConfigsInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest); + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersPatchPerInstanceConfigsReqResource. */ + public instanceGroupManagersPatchPerInstanceConfigsReqResource?: (google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq|null); + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest project. */ + public project: string; + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest zone. */ + public zone: string; + + /** PatchPerInstanceConfigsInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchPerInstanceConfigsInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchPerInstanceConfigsInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest): google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Encodes the specified PatchPerInstanceConfigsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchPerInstanceConfigsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchPerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchPerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Decodes a PatchPerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchPerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Verifies a PatchPerInstanceConfigsInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchPerInstanceConfigsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchPerInstanceConfigsInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Creates a plain object from a PatchPerInstanceConfigsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message PatchPerInstanceConfigsInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchPerInstanceConfigsInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RecreateInstancesInstanceGroupManagerRequest. */ + interface IRecreateInstancesInstanceGroupManagerRequest { + + /** RecreateInstancesInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** RecreateInstancesInstanceGroupManagerRequest instanceGroupManagersRecreateInstancesRequestResource */ + instanceGroupManagersRecreateInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest|null); + + /** RecreateInstancesInstanceGroupManagerRequest project */ + project?: (string|null); + + /** RecreateInstancesInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** RecreateInstancesInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a RecreateInstancesInstanceGroupManagerRequest. */ + class RecreateInstancesInstanceGroupManagerRequest implements IRecreateInstancesInstanceGroupManagerRequest { + + /** + * Constructs a new RecreateInstancesInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest); + + /** RecreateInstancesInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** RecreateInstancesInstanceGroupManagerRequest instanceGroupManagersRecreateInstancesRequestResource. */ + public instanceGroupManagersRecreateInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest|null); + + /** RecreateInstancesInstanceGroupManagerRequest project. */ + public project: string; + + /** RecreateInstancesInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** RecreateInstancesInstanceGroupManagerRequest zone. */ + public zone: string; + + /** RecreateInstancesInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RecreateInstancesInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RecreateInstancesInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest): google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest; + + /** + * Encodes the specified RecreateInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message RecreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecreateInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @param message RecreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest; + + /** + * Decodes a RecreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest; + + /** + * Verifies a RecreateInstancesInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecreateInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecreateInstancesInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest; + + /** + * Creates a plain object from a RecreateInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message RecreateInstancesInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecreateInstancesInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResizeInstanceGroupManagerRequest. */ + interface IResizeInstanceGroupManagerRequest { + + /** ResizeInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ResizeInstanceGroupManagerRequest project */ + project?: (string|null); + + /** ResizeInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** ResizeInstanceGroupManagerRequest size */ + size?: (number|null); + + /** ResizeInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a ResizeInstanceGroupManagerRequest. */ + class ResizeInstanceGroupManagerRequest implements IResizeInstanceGroupManagerRequest { + + /** + * Constructs a new ResizeInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResizeInstanceGroupManagerRequest); + + /** ResizeInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ResizeInstanceGroupManagerRequest project. */ + public project: string; + + /** ResizeInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** ResizeInstanceGroupManagerRequest size. */ + public size: number; + + /** ResizeInstanceGroupManagerRequest zone. */ + public zone: string; + + /** ResizeInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new ResizeInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResizeInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IResizeInstanceGroupManagerRequest): google.cloud.compute.v1.ResizeInstanceGroupManagerRequest; + + /** + * Encodes the specified ResizeInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeInstanceGroupManagerRequest.verify|verify} messages. + * @param message ResizeInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResizeInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeInstanceGroupManagerRequest.verify|verify} messages. + * @param message ResizeInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResizeInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResizeInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResizeInstanceGroupManagerRequest; + + /** + * Decodes a ResizeInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResizeInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResizeInstanceGroupManagerRequest; + + /** + * Verifies a ResizeInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResizeInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResizeInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResizeInstanceGroupManagerRequest; + + /** + * Creates a plain object from a ResizeInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message ResizeInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResizeInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResizeInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetInstanceTemplateInstanceGroupManagerRequest. */ + interface ISetInstanceTemplateInstanceGroupManagerRequest { + + /** SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManagersSetInstanceTemplateRequestResource */ + instanceGroupManagersSetInstanceTemplateRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest|null); + + /** SetInstanceTemplateInstanceGroupManagerRequest project */ + project?: (string|null); + + /** SetInstanceTemplateInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** SetInstanceTemplateInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a SetInstanceTemplateInstanceGroupManagerRequest. */ + class SetInstanceTemplateInstanceGroupManagerRequest implements ISetInstanceTemplateInstanceGroupManagerRequest { + + /** + * Constructs a new SetInstanceTemplateInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest); + + /** SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManagersSetInstanceTemplateRequestResource. */ + public instanceGroupManagersSetInstanceTemplateRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest|null); + + /** SetInstanceTemplateInstanceGroupManagerRequest project. */ + public project: string; + + /** SetInstanceTemplateInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** SetInstanceTemplateInstanceGroupManagerRequest zone. */ + public zone: string; + + /** SetInstanceTemplateInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetInstanceTemplateInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetInstanceTemplateInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest): google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest; + + /** + * Encodes the specified SetInstanceTemplateInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetInstanceTemplateInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetInstanceTemplateInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetInstanceTemplateInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetInstanceTemplateInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetInstanceTemplateInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest; + + /** + * Decodes a SetInstanceTemplateInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetInstanceTemplateInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest; + + /** + * Verifies a SetInstanceTemplateInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetInstanceTemplateInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetInstanceTemplateInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest; + + /** + * Creates a plain object from a SetInstanceTemplateInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message SetInstanceTemplateInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetInstanceTemplateInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetTargetPoolsInstanceGroupManagerRequest. */ + interface ISetTargetPoolsInstanceGroupManagerRequest { + + /** SetTargetPoolsInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** SetTargetPoolsInstanceGroupManagerRequest instanceGroupManagersSetTargetPoolsRequestResource */ + instanceGroupManagersSetTargetPoolsRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest|null); + + /** SetTargetPoolsInstanceGroupManagerRequest project */ + project?: (string|null); + + /** SetTargetPoolsInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** SetTargetPoolsInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents a SetTargetPoolsInstanceGroupManagerRequest. */ + class SetTargetPoolsInstanceGroupManagerRequest implements ISetTargetPoolsInstanceGroupManagerRequest { + + /** + * Constructs a new SetTargetPoolsInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest); + + /** SetTargetPoolsInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** SetTargetPoolsInstanceGroupManagerRequest instanceGroupManagersSetTargetPoolsRequestResource. */ + public instanceGroupManagersSetTargetPoolsRequestResource?: (google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest|null); + + /** SetTargetPoolsInstanceGroupManagerRequest project. */ + public project: string; + + /** SetTargetPoolsInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** SetTargetPoolsInstanceGroupManagerRequest zone. */ + public zone: string; + + /** SetTargetPoolsInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetTargetPoolsInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetTargetPoolsInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest): google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest; + + /** + * Encodes the specified SetTargetPoolsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetTargetPoolsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetTargetPoolsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetTargetPoolsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetTargetPoolsInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetTargetPoolsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest; + + /** + * Decodes a SetTargetPoolsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetTargetPoolsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest; + + /** + * Verifies a SetTargetPoolsInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetTargetPoolsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetTargetPoolsInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest; + + /** + * Creates a plain object from a SetTargetPoolsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message SetTargetPoolsInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetTargetPoolsInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdatePerInstanceConfigsInstanceGroupManagerRequest. */ + interface IUpdatePerInstanceConfigsInstanceGroupManagerRequest { + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersUpdatePerInstanceConfigsReqResource */ + instanceGroupManagersUpdatePerInstanceConfigsReqResource?: (google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq|null); + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest project */ + project?: (string|null); + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest zone */ + zone?: (string|null); + } + + /** Represents an UpdatePerInstanceConfigsInstanceGroupManagerRequest. */ + class UpdatePerInstanceConfigsInstanceGroupManagerRequest implements IUpdatePerInstanceConfigsInstanceGroupManagerRequest { + + /** + * Constructs a new UpdatePerInstanceConfigsInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest); + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersUpdatePerInstanceConfigsReqResource. */ + public instanceGroupManagersUpdatePerInstanceConfigsReqResource?: (google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq|null); + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest project. */ + public project: string; + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest zone. */ + public zone: string; + + /** UpdatePerInstanceConfigsInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdatePerInstanceConfigsInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePerInstanceConfigsInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest): google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Encodes the specified UpdatePerInstanceConfigsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @param message UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePerInstanceConfigsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @param message UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Decodes an UpdatePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Verifies an UpdatePerInstanceConfigsInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePerInstanceConfigsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePerInstanceConfigsInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest; + + /** + * Creates a plain object from an UpdatePerInstanceConfigsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePerInstanceConfigsInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddInstancesInstanceGroupRequest. */ + interface IAddInstancesInstanceGroupRequest { + + /** AddInstancesInstanceGroupRequest instanceGroup */ + instanceGroup?: (string|null); + + /** AddInstancesInstanceGroupRequest instanceGroupsAddInstancesRequestResource */ + instanceGroupsAddInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest|null); + + /** AddInstancesInstanceGroupRequest project */ + project?: (string|null); + + /** AddInstancesInstanceGroupRequest requestId */ + requestId?: (string|null); + + /** AddInstancesInstanceGroupRequest zone */ + zone?: (string|null); + } + + /** Represents an AddInstancesInstanceGroupRequest. */ + class AddInstancesInstanceGroupRequest implements IAddInstancesInstanceGroupRequest { + + /** + * Constructs a new AddInstancesInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddInstancesInstanceGroupRequest); + + /** AddInstancesInstanceGroupRequest instanceGroup. */ + public instanceGroup: string; + + /** AddInstancesInstanceGroupRequest instanceGroupsAddInstancesRequestResource. */ + public instanceGroupsAddInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest|null); + + /** AddInstancesInstanceGroupRequest project. */ + public project: string; + + /** AddInstancesInstanceGroupRequest requestId. */ + public requestId?: (string|null); + + /** AddInstancesInstanceGroupRequest zone. */ + public zone: string; + + /** AddInstancesInstanceGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddInstancesInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddInstancesInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddInstancesInstanceGroupRequest): google.cloud.compute.v1.AddInstancesInstanceGroupRequest; + + /** + * Encodes the specified AddInstancesInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AddInstancesInstanceGroupRequest.verify|verify} messages. + * @param message AddInstancesInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddInstancesInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddInstancesInstanceGroupRequest.verify|verify} messages. + * @param message AddInstancesInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddInstancesInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddInstancesInstanceGroupRequest; + + /** + * Decodes an AddInstancesInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddInstancesInstanceGroupRequest; + + /** + * Verifies an AddInstancesInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddInstancesInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddInstancesInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddInstancesInstanceGroupRequest; + + /** + * Creates a plain object from an AddInstancesInstanceGroupRequest message. Also converts values to other types if specified. + * @param message AddInstancesInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddInstancesInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddInstancesInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListInstanceGroupsRequest. */ + interface IAggregatedListInstanceGroupsRequest { + + /** AggregatedListInstanceGroupsRequest filter */ + filter?: (string|null); + + /** AggregatedListInstanceGroupsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListInstanceGroupsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListInstanceGroupsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListInstanceGroupsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListInstanceGroupsRequest project */ + project?: (string|null); + + /** AggregatedListInstanceGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListInstanceGroupsRequest. */ + class AggregatedListInstanceGroupsRequest implements IAggregatedListInstanceGroupsRequest { + + /** + * Constructs a new AggregatedListInstanceGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest); + + /** AggregatedListInstanceGroupsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListInstanceGroupsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListInstanceGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListInstanceGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListInstanceGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListInstanceGroupsRequest project. */ + public project: string; + + /** AggregatedListInstanceGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListInstanceGroupsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListInstanceGroupsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListInstanceGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListInstanceGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListInstanceGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListInstanceGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListInstanceGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListInstanceGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest): google.cloud.compute.v1.AggregatedListInstanceGroupsRequest; + + /** + * Encodes the specified AggregatedListInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupsRequest.verify|verify} messages. + * @param message AggregatedListInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupsRequest.verify|verify} messages. + * @param message AggregatedListInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListInstanceGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListInstanceGroupsRequest; + + /** + * Decodes an AggregatedListInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListInstanceGroupsRequest; + + /** + * Verifies an AggregatedListInstanceGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListInstanceGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListInstanceGroupsRequest; + + /** + * Creates a plain object from an AggregatedListInstanceGroupsRequest message. Also converts values to other types if specified. + * @param message AggregatedListInstanceGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListInstanceGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListInstanceGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstanceGroupRequest. */ + interface IDeleteInstanceGroupRequest { + + /** DeleteInstanceGroupRequest instanceGroup */ + instanceGroup?: (string|null); + + /** DeleteInstanceGroupRequest project */ + project?: (string|null); + + /** DeleteInstanceGroupRequest requestId */ + requestId?: (string|null); + + /** DeleteInstanceGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteInstanceGroupRequest. */ + class DeleteInstanceGroupRequest implements IDeleteInstanceGroupRequest { + + /** + * Constructs a new DeleteInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInstanceGroupRequest); + + /** DeleteInstanceGroupRequest instanceGroup. */ + public instanceGroup: string; + + /** DeleteInstanceGroupRequest project. */ + public project: string; + + /** DeleteInstanceGroupRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInstanceGroupRequest zone. */ + public zone: string; + + /** DeleteInstanceGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInstanceGroupRequest): google.cloud.compute.v1.DeleteInstanceGroupRequest; + + /** + * Encodes the specified DeleteInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupRequest.verify|verify} messages. + * @param message DeleteInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupRequest.verify|verify} messages. + * @param message DeleteInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteInstanceGroupRequest; + + /** + * Decodes a DeleteInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteInstanceGroupRequest; + + /** + * Verifies a DeleteInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteInstanceGroupRequest; + + /** + * Creates a plain object from a DeleteInstanceGroupRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInstanceGroupRequest. */ + interface IGetInstanceGroupRequest { + + /** GetInstanceGroupRequest instanceGroup */ + instanceGroup?: (string|null); + + /** GetInstanceGroupRequest project */ + project?: (string|null); + + /** GetInstanceGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a GetInstanceGroupRequest. */ + class GetInstanceGroupRequest implements IGetInstanceGroupRequest { + + /** + * Constructs a new GetInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetInstanceGroupRequest); + + /** GetInstanceGroupRequest instanceGroup. */ + public instanceGroup: string; + + /** GetInstanceGroupRequest project. */ + public project: string; + + /** GetInstanceGroupRequest zone. */ + public zone: string; + + /** + * Creates a new GetInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetInstanceGroupRequest): google.cloud.compute.v1.GetInstanceGroupRequest; + + /** + * Encodes the specified GetInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupRequest.verify|verify} messages. + * @param message GetInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupRequest.verify|verify} messages. + * @param message GetInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetInstanceGroupRequest; + + /** + * Decodes a GetInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetInstanceGroupRequest; + + /** + * Verifies a GetInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetInstanceGroupRequest; + + /** + * Creates a plain object from a GetInstanceGroupRequest message. Also converts values to other types if specified. + * @param message GetInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertInstanceGroupRequest. */ + interface IInsertInstanceGroupRequest { + + /** InsertInstanceGroupRequest instanceGroupResource */ + instanceGroupResource?: (google.cloud.compute.v1.IInstanceGroup|null); + + /** InsertInstanceGroupRequest project */ + project?: (string|null); + + /** InsertInstanceGroupRequest requestId */ + requestId?: (string|null); + + /** InsertInstanceGroupRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertInstanceGroupRequest. */ + class InsertInstanceGroupRequest implements IInsertInstanceGroupRequest { + + /** + * Constructs a new InsertInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertInstanceGroupRequest); + + /** InsertInstanceGroupRequest instanceGroupResource. */ + public instanceGroupResource?: (google.cloud.compute.v1.IInstanceGroup|null); + + /** InsertInstanceGroupRequest project. */ + public project: string; + + /** InsertInstanceGroupRequest requestId. */ + public requestId?: (string|null); + + /** InsertInstanceGroupRequest zone. */ + public zone: string; + + /** InsertInstanceGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertInstanceGroupRequest): google.cloud.compute.v1.InsertInstanceGroupRequest; + + /** + * Encodes the specified InsertInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupRequest.verify|verify} messages. + * @param message InsertInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupRequest.verify|verify} messages. + * @param message InsertInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertInstanceGroupRequest; + + /** + * Decodes an InsertInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertInstanceGroupRequest; + + /** + * Verifies an InsertInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertInstanceGroupRequest; + + /** + * Creates a plain object from an InsertInstanceGroupRequest message. Also converts values to other types if specified. + * @param message InsertInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstanceGroupsRequest. */ + interface IListInstanceGroupsRequest { + + /** ListInstanceGroupsRequest filter */ + filter?: (string|null); + + /** ListInstanceGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListInstanceGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListInstanceGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListInstanceGroupsRequest project */ + project?: (string|null); + + /** ListInstanceGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListInstanceGroupsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListInstanceGroupsRequest. */ + class ListInstanceGroupsRequest implements IListInstanceGroupsRequest { + + /** + * Constructs a new ListInstanceGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInstanceGroupsRequest); + + /** ListInstanceGroupsRequest filter. */ + public filter?: (string|null); + + /** ListInstanceGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInstanceGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInstanceGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInstanceGroupsRequest project. */ + public project: string; + + /** ListInstanceGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInstanceGroupsRequest zone. */ + public zone: string; + + /** ListInstanceGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListInstanceGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInstanceGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInstanceGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInstanceGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInstanceGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInstanceGroupsRequest): google.cloud.compute.v1.ListInstanceGroupsRequest; + + /** + * Encodes the specified ListInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupsRequest.verify|verify} messages. + * @param message ListInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupsRequest.verify|verify} messages. + * @param message ListInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInstanceGroupsRequest; + + /** + * Decodes a ListInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInstanceGroupsRequest; + + /** + * Verifies a ListInstanceGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInstanceGroupsRequest; + + /** + * Creates a plain object from a ListInstanceGroupsRequest message. Also converts values to other types if specified. + * @param message ListInstanceGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInstanceGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesInstanceGroupsRequest. */ + interface IListInstancesInstanceGroupsRequest { + + /** ListInstancesInstanceGroupsRequest filter */ + filter?: (string|null); + + /** ListInstancesInstanceGroupsRequest instanceGroup */ + instanceGroup?: (string|null); + + /** ListInstancesInstanceGroupsRequest instanceGroupsListInstancesRequestResource */ + instanceGroupsListInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupsListInstancesRequest|null); + + /** ListInstancesInstanceGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListInstancesInstanceGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListInstancesInstanceGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesInstanceGroupsRequest project */ + project?: (string|null); + + /** ListInstancesInstanceGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListInstancesInstanceGroupsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListInstancesInstanceGroupsRequest. */ + class ListInstancesInstanceGroupsRequest implements IListInstancesInstanceGroupsRequest { + + /** + * Constructs a new ListInstancesInstanceGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInstancesInstanceGroupsRequest); + + /** ListInstancesInstanceGroupsRequest filter. */ + public filter?: (string|null); + + /** ListInstancesInstanceGroupsRequest instanceGroup. */ + public instanceGroup: string; + + /** ListInstancesInstanceGroupsRequest instanceGroupsListInstancesRequestResource. */ + public instanceGroupsListInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupsListInstancesRequest|null); + + /** ListInstancesInstanceGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInstancesInstanceGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInstancesInstanceGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInstancesInstanceGroupsRequest project. */ + public project: string; + + /** ListInstancesInstanceGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInstancesInstanceGroupsRequest zone. */ + public zone: string; + + /** ListInstancesInstanceGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListInstancesInstanceGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInstancesInstanceGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInstancesInstanceGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInstancesInstanceGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInstancesInstanceGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesInstanceGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInstancesInstanceGroupsRequest): google.cloud.compute.v1.ListInstancesInstanceGroupsRequest; + + /** + * Encodes the specified ListInstancesInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstancesInstanceGroupsRequest.verify|verify} messages. + * @param message ListInstancesInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstancesInstanceGroupsRequest.verify|verify} messages. + * @param message ListInstancesInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesInstanceGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInstancesInstanceGroupsRequest; + + /** + * Decodes a ListInstancesInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInstancesInstanceGroupsRequest; + + /** + * Verifies a ListInstancesInstanceGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesInstanceGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInstancesInstanceGroupsRequest; + + /** + * Creates a plain object from a ListInstancesInstanceGroupsRequest message. Also converts values to other types if specified. + * @param message ListInstancesInstanceGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInstancesInstanceGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesInstanceGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveInstancesInstanceGroupRequest. */ + interface IRemoveInstancesInstanceGroupRequest { + + /** RemoveInstancesInstanceGroupRequest instanceGroup */ + instanceGroup?: (string|null); + + /** RemoveInstancesInstanceGroupRequest instanceGroupsRemoveInstancesRequestResource */ + instanceGroupsRemoveInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest|null); + + /** RemoveInstancesInstanceGroupRequest project */ + project?: (string|null); + + /** RemoveInstancesInstanceGroupRequest requestId */ + requestId?: (string|null); + + /** RemoveInstancesInstanceGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a RemoveInstancesInstanceGroupRequest. */ + class RemoveInstancesInstanceGroupRequest implements IRemoveInstancesInstanceGroupRequest { + + /** + * Constructs a new RemoveInstancesInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest); + + /** RemoveInstancesInstanceGroupRequest instanceGroup. */ + public instanceGroup: string; + + /** RemoveInstancesInstanceGroupRequest instanceGroupsRemoveInstancesRequestResource. */ + public instanceGroupsRemoveInstancesRequestResource?: (google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest|null); + + /** RemoveInstancesInstanceGroupRequest project. */ + public project: string; + + /** RemoveInstancesInstanceGroupRequest requestId. */ + public requestId?: (string|null); + + /** RemoveInstancesInstanceGroupRequest zone. */ + public zone: string; + + /** RemoveInstancesInstanceGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveInstancesInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveInstancesInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest): google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest; + + /** + * Encodes the specified RemoveInstancesInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest.verify|verify} messages. + * @param message RemoveInstancesInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveInstancesInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest.verify|verify} messages. + * @param message RemoveInstancesInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveInstancesInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest; + + /** + * Decodes a RemoveInstancesInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest; + + /** + * Verifies a RemoveInstancesInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveInstancesInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveInstancesInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest; + + /** + * Creates a plain object from a RemoveInstancesInstanceGroupRequest message. Also converts values to other types if specified. + * @param message RemoveInstancesInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveInstancesInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetNamedPortsInstanceGroupRequest. */ + interface ISetNamedPortsInstanceGroupRequest { + + /** SetNamedPortsInstanceGroupRequest instanceGroup */ + instanceGroup?: (string|null); + + /** SetNamedPortsInstanceGroupRequest instanceGroupsSetNamedPortsRequestResource */ + instanceGroupsSetNamedPortsRequestResource?: (google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest|null); + + /** SetNamedPortsInstanceGroupRequest project */ + project?: (string|null); + + /** SetNamedPortsInstanceGroupRequest requestId */ + requestId?: (string|null); + + /** SetNamedPortsInstanceGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a SetNamedPortsInstanceGroupRequest. */ + class SetNamedPortsInstanceGroupRequest implements ISetNamedPortsInstanceGroupRequest { + + /** + * Constructs a new SetNamedPortsInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest); + + /** SetNamedPortsInstanceGroupRequest instanceGroup. */ + public instanceGroup: string; + + /** SetNamedPortsInstanceGroupRequest instanceGroupsSetNamedPortsRequestResource. */ + public instanceGroupsSetNamedPortsRequestResource?: (google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest|null); + + /** SetNamedPortsInstanceGroupRequest project. */ + public project: string; + + /** SetNamedPortsInstanceGroupRequest requestId. */ + public requestId?: (string|null); + + /** SetNamedPortsInstanceGroupRequest zone. */ + public zone: string; + + /** SetNamedPortsInstanceGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetNamedPortsInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetNamedPortsInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest): google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest; + + /** + * Encodes the specified SetNamedPortsInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest.verify|verify} messages. + * @param message SetNamedPortsInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetNamedPortsInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest.verify|verify} messages. + * @param message SetNamedPortsInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetNamedPortsInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetNamedPortsInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest; + + /** + * Decodes a SetNamedPortsInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetNamedPortsInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest; + + /** + * Verifies a SetNamedPortsInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetNamedPortsInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetNamedPortsInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest; + + /** + * Creates a plain object from a SetNamedPortsInstanceGroupRequest message. Also converts values to other types if specified. + * @param message SetNamedPortsInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetNamedPortsInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstanceTemplateRequest. */ + interface IDeleteInstanceTemplateRequest { + + /** DeleteInstanceTemplateRequest instanceTemplate */ + instanceTemplate?: (string|null); + + /** DeleteInstanceTemplateRequest project */ + project?: (string|null); + + /** DeleteInstanceTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInstanceTemplateRequest. */ + class DeleteInstanceTemplateRequest implements IDeleteInstanceTemplateRequest { + + /** + * Constructs a new DeleteInstanceTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInstanceTemplateRequest); + + /** DeleteInstanceTemplateRequest instanceTemplate. */ + public instanceTemplate: string; + + /** DeleteInstanceTemplateRequest project. */ + public project: string; + + /** DeleteInstanceTemplateRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInstanceTemplateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInstanceTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInstanceTemplateRequest): google.cloud.compute.v1.DeleteInstanceTemplateRequest; + + /** + * Encodes the specified DeleteInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceTemplateRequest.verify|verify} messages. + * @param message DeleteInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceTemplateRequest.verify|verify} messages. + * @param message DeleteInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteInstanceTemplateRequest; + + /** + * Decodes a DeleteInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteInstanceTemplateRequest; + + /** + * Verifies a DeleteInstanceTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteInstanceTemplateRequest; + + /** + * Creates a plain object from a DeleteInstanceTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteInstanceTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInstanceTemplateRequest. */ + interface IGetInstanceTemplateRequest { + + /** GetInstanceTemplateRequest instanceTemplate */ + instanceTemplate?: (string|null); + + /** GetInstanceTemplateRequest project */ + project?: (string|null); + } + + /** Represents a GetInstanceTemplateRequest. */ + class GetInstanceTemplateRequest implements IGetInstanceTemplateRequest { + + /** + * Constructs a new GetInstanceTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetInstanceTemplateRequest); + + /** GetInstanceTemplateRequest instanceTemplate. */ + public instanceTemplate: string; + + /** GetInstanceTemplateRequest project. */ + public project: string; + + /** + * Creates a new GetInstanceTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetInstanceTemplateRequest): google.cloud.compute.v1.GetInstanceTemplateRequest; + + /** + * Encodes the specified GetInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInstanceTemplateRequest.verify|verify} messages. + * @param message GetInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInstanceTemplateRequest.verify|verify} messages. + * @param message GetInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetInstanceTemplateRequest; + + /** + * Decodes a GetInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetInstanceTemplateRequest; + + /** + * Verifies a GetInstanceTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetInstanceTemplateRequest; + + /** + * Creates a plain object from a GetInstanceTemplateRequest message. Also converts values to other types if specified. + * @param message GetInstanceTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetInstanceTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyInstanceTemplateRequest. */ + interface IGetIamPolicyInstanceTemplateRequest { + + /** GetIamPolicyInstanceTemplateRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyInstanceTemplateRequest project */ + project?: (string|null); + + /** GetIamPolicyInstanceTemplateRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicyInstanceTemplateRequest. */ + class GetIamPolicyInstanceTemplateRequest implements IGetIamPolicyInstanceTemplateRequest { + + /** + * Constructs a new GetIamPolicyInstanceTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest); + + /** GetIamPolicyInstanceTemplateRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyInstanceTemplateRequest project. */ + public project: string; + + /** GetIamPolicyInstanceTemplateRequest resource. */ + public resource: string; + + /** GetIamPolicyInstanceTemplateRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyInstanceTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyInstanceTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest): google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest; + + /** + * Encodes the specified GetIamPolicyInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @param message GetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @param message GetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyInstanceTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest; + + /** + * Decodes a GetIamPolicyInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest; + + /** + * Verifies a GetIamPolicyInstanceTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyInstanceTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest; + + /** + * Creates a plain object from a GetIamPolicyInstanceTemplateRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyInstanceTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyInstanceTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertInstanceTemplateRequest. */ + interface IInsertInstanceTemplateRequest { + + /** InsertInstanceTemplateRequest instanceTemplateResource */ + instanceTemplateResource?: (google.cloud.compute.v1.IInstanceTemplate|null); + + /** InsertInstanceTemplateRequest project */ + project?: (string|null); + + /** InsertInstanceTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertInstanceTemplateRequest. */ + class InsertInstanceTemplateRequest implements IInsertInstanceTemplateRequest { + + /** + * Constructs a new InsertInstanceTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertInstanceTemplateRequest); + + /** InsertInstanceTemplateRequest instanceTemplateResource. */ + public instanceTemplateResource?: (google.cloud.compute.v1.IInstanceTemplate|null); + + /** InsertInstanceTemplateRequest project. */ + public project: string; + + /** InsertInstanceTemplateRequest requestId. */ + public requestId?: (string|null); + + /** InsertInstanceTemplateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertInstanceTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertInstanceTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertInstanceTemplateRequest): google.cloud.compute.v1.InsertInstanceTemplateRequest; + + /** + * Encodes the specified InsertInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceTemplateRequest.verify|verify} messages. + * @param message InsertInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceTemplateRequest.verify|verify} messages. + * @param message InsertInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertInstanceTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertInstanceTemplateRequest; + + /** + * Decodes an InsertInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertInstanceTemplateRequest; + + /** + * Verifies an InsertInstanceTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertInstanceTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertInstanceTemplateRequest; + + /** + * Creates a plain object from an InsertInstanceTemplateRequest message. Also converts values to other types if specified. + * @param message InsertInstanceTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertInstanceTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertInstanceTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstanceTemplatesRequest. */ + interface IListInstanceTemplatesRequest { + + /** ListInstanceTemplatesRequest filter */ + filter?: (string|null); + + /** ListInstanceTemplatesRequest maxResults */ + maxResults?: (number|null); + + /** ListInstanceTemplatesRequest orderBy */ + orderBy?: (string|null); + + /** ListInstanceTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstanceTemplatesRequest project */ + project?: (string|null); + + /** ListInstanceTemplatesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListInstanceTemplatesRequest. */ + class ListInstanceTemplatesRequest implements IListInstanceTemplatesRequest { + + /** + * Constructs a new ListInstanceTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInstanceTemplatesRequest); + + /** ListInstanceTemplatesRequest filter. */ + public filter?: (string|null); + + /** ListInstanceTemplatesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInstanceTemplatesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInstanceTemplatesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInstanceTemplatesRequest project. */ + public project: string; + + /** ListInstanceTemplatesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInstanceTemplatesRequest _filter. */ + public _filter?: "filter"; + + /** ListInstanceTemplatesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInstanceTemplatesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInstanceTemplatesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInstanceTemplatesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInstanceTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstanceTemplatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInstanceTemplatesRequest): google.cloud.compute.v1.ListInstanceTemplatesRequest; + + /** + * Encodes the specified ListInstanceTemplatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstanceTemplatesRequest.verify|verify} messages. + * @param message ListInstanceTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInstanceTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstanceTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstanceTemplatesRequest.verify|verify} messages. + * @param message ListInstanceTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInstanceTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstanceTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstanceTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInstanceTemplatesRequest; + + /** + * Decodes a ListInstanceTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstanceTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInstanceTemplatesRequest; + + /** + * Verifies a ListInstanceTemplatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstanceTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstanceTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInstanceTemplatesRequest; + + /** + * Creates a plain object from a ListInstanceTemplatesRequest message. Also converts values to other types if specified. + * @param message ListInstanceTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInstanceTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstanceTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyInstanceTemplateRequest. */ + interface ISetIamPolicyInstanceTemplateRequest { + + /** SetIamPolicyInstanceTemplateRequest globalSetPolicyRequestResource */ + globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicyInstanceTemplateRequest project */ + project?: (string|null); + + /** SetIamPolicyInstanceTemplateRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicyInstanceTemplateRequest. */ + class SetIamPolicyInstanceTemplateRequest implements ISetIamPolicyInstanceTemplateRequest { + + /** + * Constructs a new SetIamPolicyInstanceTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest); + + /** SetIamPolicyInstanceTemplateRequest globalSetPolicyRequestResource. */ + public globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicyInstanceTemplateRequest project. */ + public project: string; + + /** SetIamPolicyInstanceTemplateRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicyInstanceTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyInstanceTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest): google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest; + + /** + * Encodes the specified SetIamPolicyInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @param message SetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @param message SetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyInstanceTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest; + + /** + * Decodes a SetIamPolicyInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest; + + /** + * Verifies a SetIamPolicyInstanceTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyInstanceTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest; + + /** + * Creates a plain object from a SetIamPolicyInstanceTemplateRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyInstanceTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyInstanceTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsInstanceTemplateRequest. */ + interface ITestIamPermissionsInstanceTemplateRequest { + + /** TestIamPermissionsInstanceTemplateRequest project */ + project?: (string|null); + + /** TestIamPermissionsInstanceTemplateRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsInstanceTemplateRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsInstanceTemplateRequest. */ + class TestIamPermissionsInstanceTemplateRequest implements ITestIamPermissionsInstanceTemplateRequest { + + /** + * Constructs a new TestIamPermissionsInstanceTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest); + + /** TestIamPermissionsInstanceTemplateRequest project. */ + public project: string; + + /** TestIamPermissionsInstanceTemplateRequest resource. */ + public resource: string; + + /** TestIamPermissionsInstanceTemplateRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsInstanceTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsInstanceTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest): google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest; + + /** + * Encodes the specified TestIamPermissionsInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest.verify|verify} messages. + * @param message TestIamPermissionsInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest.verify|verify} messages. + * @param message TestIamPermissionsInstanceTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsInstanceTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest; + + /** + * Decodes a TestIamPermissionsInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest; + + /** + * Verifies a TestIamPermissionsInstanceTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsInstanceTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest; + + /** + * Creates a plain object from a TestIamPermissionsInstanceTemplateRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsInstanceTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsInstanceTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddAccessConfigInstanceRequest. */ + interface IAddAccessConfigInstanceRequest { + + /** AddAccessConfigInstanceRequest accessConfigResource */ + accessConfigResource?: (google.cloud.compute.v1.IAccessConfig|null); + + /** AddAccessConfigInstanceRequest instance */ + instance?: (string|null); + + /** AddAccessConfigInstanceRequest networkInterface */ + networkInterface?: (string|null); + + /** AddAccessConfigInstanceRequest project */ + project?: (string|null); + + /** AddAccessConfigInstanceRequest requestId */ + requestId?: (string|null); + + /** AddAccessConfigInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an AddAccessConfigInstanceRequest. */ + class AddAccessConfigInstanceRequest implements IAddAccessConfigInstanceRequest { + + /** + * Constructs a new AddAccessConfigInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddAccessConfigInstanceRequest); + + /** AddAccessConfigInstanceRequest accessConfigResource. */ + public accessConfigResource?: (google.cloud.compute.v1.IAccessConfig|null); + + /** AddAccessConfigInstanceRequest instance. */ + public instance: string; + + /** AddAccessConfigInstanceRequest networkInterface. */ + public networkInterface: string; + + /** AddAccessConfigInstanceRequest project. */ + public project: string; + + /** AddAccessConfigInstanceRequest requestId. */ + public requestId?: (string|null); + + /** AddAccessConfigInstanceRequest zone. */ + public zone: string; + + /** AddAccessConfigInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddAccessConfigInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddAccessConfigInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddAccessConfigInstanceRequest): google.cloud.compute.v1.AddAccessConfigInstanceRequest; + + /** + * Encodes the specified AddAccessConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.AddAccessConfigInstanceRequest.verify|verify} messages. + * @param message AddAccessConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddAccessConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddAccessConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddAccessConfigInstanceRequest.verify|verify} messages. + * @param message AddAccessConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddAccessConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddAccessConfigInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddAccessConfigInstanceRequest; + + /** + * Decodes an AddAccessConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddAccessConfigInstanceRequest; + + /** + * Verifies an AddAccessConfigInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddAccessConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddAccessConfigInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddAccessConfigInstanceRequest; + + /** + * Creates a plain object from an AddAccessConfigInstanceRequest message. Also converts values to other types if specified. + * @param message AddAccessConfigInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddAccessConfigInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddAccessConfigInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddResourcePoliciesInstanceRequest. */ + interface IAddResourcePoliciesInstanceRequest { + + /** AddResourcePoliciesInstanceRequest instance */ + instance?: (string|null); + + /** AddResourcePoliciesInstanceRequest instancesAddResourcePoliciesRequestResource */ + instancesAddResourcePoliciesRequestResource?: (google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest|null); + + /** AddResourcePoliciesInstanceRequest project */ + project?: (string|null); + + /** AddResourcePoliciesInstanceRequest requestId */ + requestId?: (string|null); + + /** AddResourcePoliciesInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an AddResourcePoliciesInstanceRequest. */ + class AddResourcePoliciesInstanceRequest implements IAddResourcePoliciesInstanceRequest { + + /** + * Constructs a new AddResourcePoliciesInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest); + + /** AddResourcePoliciesInstanceRequest instance. */ + public instance: string; + + /** AddResourcePoliciesInstanceRequest instancesAddResourcePoliciesRequestResource. */ + public instancesAddResourcePoliciesRequestResource?: (google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest|null); + + /** AddResourcePoliciesInstanceRequest project. */ + public project: string; + + /** AddResourcePoliciesInstanceRequest requestId. */ + public requestId?: (string|null); + + /** AddResourcePoliciesInstanceRequest zone. */ + public zone: string; + + /** AddResourcePoliciesInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddResourcePoliciesInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddResourcePoliciesInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest): google.cloud.compute.v1.AddResourcePoliciesInstanceRequest; + + /** + * Encodes the specified AddResourcePoliciesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesInstanceRequest.verify|verify} messages. + * @param message AddResourcePoliciesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddResourcePoliciesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesInstanceRequest.verify|verify} messages. + * @param message AddResourcePoliciesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddResourcePoliciesInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddResourcePoliciesInstanceRequest; + + /** + * Decodes an AddResourcePoliciesInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddResourcePoliciesInstanceRequest; + + /** + * Verifies an AddResourcePoliciesInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddResourcePoliciesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddResourcePoliciesInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddResourcePoliciesInstanceRequest; + + /** + * Creates a plain object from an AddResourcePoliciesInstanceRequest message. Also converts values to other types if specified. + * @param message AddResourcePoliciesInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddResourcePoliciesInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddResourcePoliciesInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListInstancesRequest. */ + interface IAggregatedListInstancesRequest { + + /** AggregatedListInstancesRequest filter */ + filter?: (string|null); + + /** AggregatedListInstancesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListInstancesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListInstancesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListInstancesRequest project */ + project?: (string|null); + + /** AggregatedListInstancesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListInstancesRequest. */ + class AggregatedListInstancesRequest implements IAggregatedListInstancesRequest { + + /** + * Constructs a new AggregatedListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListInstancesRequest); + + /** AggregatedListInstancesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListInstancesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListInstancesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListInstancesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListInstancesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListInstancesRequest project. */ + public project: string; + + /** AggregatedListInstancesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListInstancesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListInstancesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListInstancesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListInstancesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListInstancesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListInstancesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListInstancesRequest): google.cloud.compute.v1.AggregatedListInstancesRequest; + + /** + * Encodes the specified AggregatedListInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstancesRequest.verify|verify} messages. + * @param message AggregatedListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstancesRequest.verify|verify} messages. + * @param message AggregatedListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListInstancesRequest; + + /** + * Decodes an AggregatedListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListInstancesRequest; + + /** + * Verifies an AggregatedListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListInstancesRequest; + + /** + * Creates a plain object from an AggregatedListInstancesRequest message. Also converts values to other types if specified. + * @param message AggregatedListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttachDiskInstanceRequest. */ + interface IAttachDiskInstanceRequest { + + /** AttachDiskInstanceRequest attachedDiskResource */ + attachedDiskResource?: (google.cloud.compute.v1.IAttachedDisk|null); + + /** AttachDiskInstanceRequest forceAttach */ + forceAttach?: (boolean|null); + + /** AttachDiskInstanceRequest instance */ + instance?: (string|null); + + /** AttachDiskInstanceRequest project */ + project?: (string|null); + + /** AttachDiskInstanceRequest requestId */ + requestId?: (string|null); + + /** AttachDiskInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an AttachDiskInstanceRequest. */ + class AttachDiskInstanceRequest implements IAttachDiskInstanceRequest { + + /** + * Constructs a new AttachDiskInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAttachDiskInstanceRequest); + + /** AttachDiskInstanceRequest attachedDiskResource. */ + public attachedDiskResource?: (google.cloud.compute.v1.IAttachedDisk|null); + + /** AttachDiskInstanceRequest forceAttach. */ + public forceAttach?: (boolean|null); + + /** AttachDiskInstanceRequest instance. */ + public instance: string; + + /** AttachDiskInstanceRequest project. */ + public project: string; + + /** AttachDiskInstanceRequest requestId. */ + public requestId?: (string|null); + + /** AttachDiskInstanceRequest zone. */ + public zone: string; + + /** AttachDiskInstanceRequest _forceAttach. */ + public _forceAttach?: "forceAttach"; + + /** AttachDiskInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AttachDiskInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachDiskInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAttachDiskInstanceRequest): google.cloud.compute.v1.AttachDiskInstanceRequest; + + /** + * Encodes the specified AttachDiskInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.AttachDiskInstanceRequest.verify|verify} messages. + * @param message AttachDiskInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAttachDiskInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachDiskInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachDiskInstanceRequest.verify|verify} messages. + * @param message AttachDiskInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAttachDiskInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachDiskInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AttachDiskInstanceRequest; + + /** + * Decodes an AttachDiskInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AttachDiskInstanceRequest; + + /** + * Verifies an AttachDiskInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachDiskInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachDiskInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AttachDiskInstanceRequest; + + /** + * Creates a plain object from an AttachDiskInstanceRequest message. Also converts values to other types if specified. + * @param message AttachDiskInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AttachDiskInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachDiskInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BulkInsertInstanceRequest. */ + interface IBulkInsertInstanceRequest { + + /** BulkInsertInstanceRequest bulkInsertInstanceResourceResource */ + bulkInsertInstanceResourceResource?: (google.cloud.compute.v1.IBulkInsertInstanceResource|null); + + /** BulkInsertInstanceRequest project */ + project?: (string|null); + + /** BulkInsertInstanceRequest requestId */ + requestId?: (string|null); + + /** BulkInsertInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a BulkInsertInstanceRequest. */ + class BulkInsertInstanceRequest implements IBulkInsertInstanceRequest { + + /** + * Constructs a new BulkInsertInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBulkInsertInstanceRequest); + + /** BulkInsertInstanceRequest bulkInsertInstanceResourceResource. */ + public bulkInsertInstanceResourceResource?: (google.cloud.compute.v1.IBulkInsertInstanceResource|null); + + /** BulkInsertInstanceRequest project. */ + public project: string; + + /** BulkInsertInstanceRequest requestId. */ + public requestId?: (string|null); + + /** BulkInsertInstanceRequest zone. */ + public zone: string; + + /** BulkInsertInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new BulkInsertInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkInsertInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IBulkInsertInstanceRequest): google.cloud.compute.v1.BulkInsertInstanceRequest; + + /** + * Encodes the specified BulkInsertInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceRequest.verify|verify} messages. + * @param message BulkInsertInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBulkInsertInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkInsertInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceRequest.verify|verify} messages. + * @param message BulkInsertInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBulkInsertInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkInsertInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkInsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BulkInsertInstanceRequest; + + /** + * Decodes a BulkInsertInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkInsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BulkInsertInstanceRequest; + + /** + * Verifies a BulkInsertInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkInsertInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkInsertInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BulkInsertInstanceRequest; + + /** + * Creates a plain object from a BulkInsertInstanceRequest message. Also converts values to other types if specified. + * @param message BulkInsertInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BulkInsertInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkInsertInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest instance */ + instance?: (string|null); + + /** DeleteInstanceRequest project */ + project?: (string|null); + + /** DeleteInstanceRequest requestId */ + requestId?: (string|null); + + /** DeleteInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest instance. */ + public instance: string; + + /** DeleteInstanceRequest project. */ + public project: string; + + /** DeleteInstanceRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInstanceRequest zone. */ + public zone: string; + + /** DeleteInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInstanceRequest): google.cloud.compute.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteAccessConfigInstanceRequest. */ + interface IDeleteAccessConfigInstanceRequest { + + /** DeleteAccessConfigInstanceRequest accessConfig */ + accessConfig?: (string|null); + + /** DeleteAccessConfigInstanceRequest instance */ + instance?: (string|null); + + /** DeleteAccessConfigInstanceRequest networkInterface */ + networkInterface?: (string|null); + + /** DeleteAccessConfigInstanceRequest project */ + project?: (string|null); + + /** DeleteAccessConfigInstanceRequest requestId */ + requestId?: (string|null); + + /** DeleteAccessConfigInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteAccessConfigInstanceRequest. */ + class DeleteAccessConfigInstanceRequest implements IDeleteAccessConfigInstanceRequest { + + /** + * Constructs a new DeleteAccessConfigInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest); + + /** DeleteAccessConfigInstanceRequest accessConfig. */ + public accessConfig: string; + + /** DeleteAccessConfigInstanceRequest instance. */ + public instance: string; + + /** DeleteAccessConfigInstanceRequest networkInterface. */ + public networkInterface: string; + + /** DeleteAccessConfigInstanceRequest project. */ + public project: string; + + /** DeleteAccessConfigInstanceRequest requestId. */ + public requestId?: (string|null); + + /** DeleteAccessConfigInstanceRequest zone. */ + public zone: string; + + /** DeleteAccessConfigInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteAccessConfigInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAccessConfigInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest): google.cloud.compute.v1.DeleteAccessConfigInstanceRequest; + + /** + * Encodes the specified DeleteAccessConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteAccessConfigInstanceRequest.verify|verify} messages. + * @param message DeleteAccessConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAccessConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteAccessConfigInstanceRequest.verify|verify} messages. + * @param message DeleteAccessConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAccessConfigInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteAccessConfigInstanceRequest; + + /** + * Decodes a DeleteAccessConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteAccessConfigInstanceRequest; + + /** + * Verifies a DeleteAccessConfigInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAccessConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAccessConfigInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteAccessConfigInstanceRequest; + + /** + * Creates a plain object from a DeleteAccessConfigInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteAccessConfigInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteAccessConfigInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAccessConfigInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetachDiskInstanceRequest. */ + interface IDetachDiskInstanceRequest { + + /** DetachDiskInstanceRequest deviceName */ + deviceName?: (string|null); + + /** DetachDiskInstanceRequest instance */ + instance?: (string|null); + + /** DetachDiskInstanceRequest project */ + project?: (string|null); + + /** DetachDiskInstanceRequest requestId */ + requestId?: (string|null); + + /** DetachDiskInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a DetachDiskInstanceRequest. */ + class DetachDiskInstanceRequest implements IDetachDiskInstanceRequest { + + /** + * Constructs a new DetachDiskInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDetachDiskInstanceRequest); + + /** DetachDiskInstanceRequest deviceName. */ + public deviceName: string; + + /** DetachDiskInstanceRequest instance. */ + public instance: string; + + /** DetachDiskInstanceRequest project. */ + public project: string; + + /** DetachDiskInstanceRequest requestId. */ + public requestId?: (string|null); + + /** DetachDiskInstanceRequest zone. */ + public zone: string; + + /** DetachDiskInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DetachDiskInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetachDiskInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDetachDiskInstanceRequest): google.cloud.compute.v1.DetachDiskInstanceRequest; + + /** + * Encodes the specified DetachDiskInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.DetachDiskInstanceRequest.verify|verify} messages. + * @param message DetachDiskInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDetachDiskInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetachDiskInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DetachDiskInstanceRequest.verify|verify} messages. + * @param message DetachDiskInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDetachDiskInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetachDiskInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DetachDiskInstanceRequest; + + /** + * Decodes a DetachDiskInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DetachDiskInstanceRequest; + + /** + * Verifies a DetachDiskInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetachDiskInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetachDiskInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DetachDiskInstanceRequest; + + /** + * Creates a plain object from a DetachDiskInstanceRequest message. Also converts values to other types if specified. + * @param message DetachDiskInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DetachDiskInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetachDiskInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest instance */ + instance?: (string|null); + + /** GetInstanceRequest project */ + project?: (string|null); + + /** GetInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetInstanceRequest); + + /** GetInstanceRequest instance. */ + public instance: string; + + /** GetInstanceRequest project. */ + public project: string; + + /** GetInstanceRequest zone. */ + public zone: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetInstanceRequest): google.cloud.compute.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetEffectiveFirewallsInstanceRequest. */ + interface IGetEffectiveFirewallsInstanceRequest { + + /** GetEffectiveFirewallsInstanceRequest instance */ + instance?: (string|null); + + /** GetEffectiveFirewallsInstanceRequest networkInterface */ + networkInterface?: (string|null); + + /** GetEffectiveFirewallsInstanceRequest project */ + project?: (string|null); + + /** GetEffectiveFirewallsInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetEffectiveFirewallsInstanceRequest. */ + class GetEffectiveFirewallsInstanceRequest implements IGetEffectiveFirewallsInstanceRequest { + + /** + * Constructs a new GetEffectiveFirewallsInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest); + + /** GetEffectiveFirewallsInstanceRequest instance. */ + public instance: string; + + /** GetEffectiveFirewallsInstanceRequest networkInterface. */ + public networkInterface: string; + + /** GetEffectiveFirewallsInstanceRequest project. */ + public project: string; + + /** GetEffectiveFirewallsInstanceRequest zone. */ + public zone: string; + + /** + * Creates a new GetEffectiveFirewallsInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEffectiveFirewallsInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest): google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest; + + /** + * Encodes the specified GetEffectiveFirewallsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest.verify|verify} messages. + * @param message GetEffectiveFirewallsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEffectiveFirewallsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest.verify|verify} messages. + * @param message GetEffectiveFirewallsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEffectiveFirewallsInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEffectiveFirewallsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest; + + /** + * Decodes a GetEffectiveFirewallsInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEffectiveFirewallsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest; + + /** + * Verifies a GetEffectiveFirewallsInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEffectiveFirewallsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEffectiveFirewallsInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest; + + /** + * Creates a plain object from a GetEffectiveFirewallsInstanceRequest message. Also converts values to other types if specified. + * @param message GetEffectiveFirewallsInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEffectiveFirewallsInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetGuestAttributesInstanceRequest. */ + interface IGetGuestAttributesInstanceRequest { + + /** GetGuestAttributesInstanceRequest instance */ + instance?: (string|null); + + /** GetGuestAttributesInstanceRequest project */ + project?: (string|null); + + /** GetGuestAttributesInstanceRequest queryPath */ + queryPath?: (string|null); + + /** GetGuestAttributesInstanceRequest variableKey */ + variableKey?: (string|null); + + /** GetGuestAttributesInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetGuestAttributesInstanceRequest. */ + class GetGuestAttributesInstanceRequest implements IGetGuestAttributesInstanceRequest { + + /** + * Constructs a new GetGuestAttributesInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetGuestAttributesInstanceRequest); + + /** GetGuestAttributesInstanceRequest instance. */ + public instance: string; + + /** GetGuestAttributesInstanceRequest project. */ + public project: string; + + /** GetGuestAttributesInstanceRequest queryPath. */ + public queryPath?: (string|null); + + /** GetGuestAttributesInstanceRequest variableKey. */ + public variableKey?: (string|null); + + /** GetGuestAttributesInstanceRequest zone. */ + public zone: string; + + /** GetGuestAttributesInstanceRequest _queryPath. */ + public _queryPath?: "queryPath"; + + /** GetGuestAttributesInstanceRequest _variableKey. */ + public _variableKey?: "variableKey"; + + /** + * Creates a new GetGuestAttributesInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGuestAttributesInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetGuestAttributesInstanceRequest): google.cloud.compute.v1.GetGuestAttributesInstanceRequest; + + /** + * Encodes the specified GetGuestAttributesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGuestAttributesInstanceRequest.verify|verify} messages. + * @param message GetGuestAttributesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetGuestAttributesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGuestAttributesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGuestAttributesInstanceRequest.verify|verify} messages. + * @param message GetGuestAttributesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetGuestAttributesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGuestAttributesInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGuestAttributesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetGuestAttributesInstanceRequest; + + /** + * Decodes a GetGuestAttributesInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGuestAttributesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetGuestAttributesInstanceRequest; + + /** + * Verifies a GetGuestAttributesInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGuestAttributesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGuestAttributesInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetGuestAttributesInstanceRequest; + + /** + * Creates a plain object from a GetGuestAttributesInstanceRequest message. Also converts values to other types if specified. + * @param message GetGuestAttributesInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetGuestAttributesInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGuestAttributesInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyInstanceRequest. */ + interface IGetIamPolicyInstanceRequest { + + /** GetIamPolicyInstanceRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyInstanceRequest project */ + project?: (string|null); + + /** GetIamPolicyInstanceRequest resource */ + resource?: (string|null); + + /** GetIamPolicyInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetIamPolicyInstanceRequest. */ + class GetIamPolicyInstanceRequest implements IGetIamPolicyInstanceRequest { + + /** + * Constructs a new GetIamPolicyInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyInstanceRequest); + + /** GetIamPolicyInstanceRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyInstanceRequest project. */ + public project: string; + + /** GetIamPolicyInstanceRequest resource. */ + public resource: string; + + /** GetIamPolicyInstanceRequest zone. */ + public zone: string; + + /** GetIamPolicyInstanceRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyInstanceRequest): google.cloud.compute.v1.GetIamPolicyInstanceRequest; + + /** + * Encodes the specified GetIamPolicyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceRequest.verify|verify} messages. + * @param message GetIamPolicyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceRequest.verify|verify} messages. + * @param message GetIamPolicyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyInstanceRequest; + + /** + * Decodes a GetIamPolicyInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyInstanceRequest; + + /** + * Verifies a GetIamPolicyInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyInstanceRequest; + + /** + * Creates a plain object from a GetIamPolicyInstanceRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetScreenshotInstanceRequest. */ + interface IGetScreenshotInstanceRequest { + + /** GetScreenshotInstanceRequest instance */ + instance?: (string|null); + + /** GetScreenshotInstanceRequest project */ + project?: (string|null); + + /** GetScreenshotInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetScreenshotInstanceRequest. */ + class GetScreenshotInstanceRequest implements IGetScreenshotInstanceRequest { + + /** + * Constructs a new GetScreenshotInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetScreenshotInstanceRequest); + + /** GetScreenshotInstanceRequest instance. */ + public instance: string; + + /** GetScreenshotInstanceRequest project. */ + public project: string; + + /** GetScreenshotInstanceRequest zone. */ + public zone: string; + + /** + * Creates a new GetScreenshotInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScreenshotInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetScreenshotInstanceRequest): google.cloud.compute.v1.GetScreenshotInstanceRequest; + + /** + * Encodes the specified GetScreenshotInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetScreenshotInstanceRequest.verify|verify} messages. + * @param message GetScreenshotInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetScreenshotInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetScreenshotInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetScreenshotInstanceRequest.verify|verify} messages. + * @param message GetScreenshotInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetScreenshotInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetScreenshotInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScreenshotInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetScreenshotInstanceRequest; + + /** + * Decodes a GetScreenshotInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScreenshotInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetScreenshotInstanceRequest; + + /** + * Verifies a GetScreenshotInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetScreenshotInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScreenshotInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetScreenshotInstanceRequest; + + /** + * Creates a plain object from a GetScreenshotInstanceRequest message. Also converts values to other types if specified. + * @param message GetScreenshotInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetScreenshotInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetScreenshotInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSerialPortOutputInstanceRequest. */ + interface IGetSerialPortOutputInstanceRequest { + + /** GetSerialPortOutputInstanceRequest instance */ + instance?: (string|null); + + /** GetSerialPortOutputInstanceRequest port */ + port?: (number|null); + + /** GetSerialPortOutputInstanceRequest project */ + project?: (string|null); + + /** GetSerialPortOutputInstanceRequest start */ + start?: (number|Long|string|null); + + /** GetSerialPortOutputInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetSerialPortOutputInstanceRequest. */ + class GetSerialPortOutputInstanceRequest implements IGetSerialPortOutputInstanceRequest { + + /** + * Constructs a new GetSerialPortOutputInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest); + + /** GetSerialPortOutputInstanceRequest instance. */ + public instance: string; + + /** GetSerialPortOutputInstanceRequest port. */ + public port?: (number|null); + + /** GetSerialPortOutputInstanceRequest project. */ + public project: string; + + /** GetSerialPortOutputInstanceRequest start. */ + public start?: (number|Long|string|null); + + /** GetSerialPortOutputInstanceRequest zone. */ + public zone: string; + + /** GetSerialPortOutputInstanceRequest _port. */ + public _port?: "port"; + + /** GetSerialPortOutputInstanceRequest _start. */ + public _start?: "start"; + + /** + * Creates a new GetSerialPortOutputInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSerialPortOutputInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest): google.cloud.compute.v1.GetSerialPortOutputInstanceRequest; + + /** + * Encodes the specified GetSerialPortOutputInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSerialPortOutputInstanceRequest.verify|verify} messages. + * @param message GetSerialPortOutputInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSerialPortOutputInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSerialPortOutputInstanceRequest.verify|verify} messages. + * @param message GetSerialPortOutputInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSerialPortOutputInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSerialPortOutputInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetSerialPortOutputInstanceRequest; + + /** + * Decodes a GetSerialPortOutputInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSerialPortOutputInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetSerialPortOutputInstanceRequest; + + /** + * Verifies a GetSerialPortOutputInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSerialPortOutputInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSerialPortOutputInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetSerialPortOutputInstanceRequest; + + /** + * Creates a plain object from a GetSerialPortOutputInstanceRequest message. Also converts values to other types if specified. + * @param message GetSerialPortOutputInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetSerialPortOutputInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSerialPortOutputInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetShieldedInstanceIdentityInstanceRequest. */ + interface IGetShieldedInstanceIdentityInstanceRequest { + + /** GetShieldedInstanceIdentityInstanceRequest instance */ + instance?: (string|null); + + /** GetShieldedInstanceIdentityInstanceRequest project */ + project?: (string|null); + + /** GetShieldedInstanceIdentityInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetShieldedInstanceIdentityInstanceRequest. */ + class GetShieldedInstanceIdentityInstanceRequest implements IGetShieldedInstanceIdentityInstanceRequest { + + /** + * Constructs a new GetShieldedInstanceIdentityInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest); + + /** GetShieldedInstanceIdentityInstanceRequest instance. */ + public instance: string; + + /** GetShieldedInstanceIdentityInstanceRequest project. */ + public project: string; + + /** GetShieldedInstanceIdentityInstanceRequest zone. */ + public zone: string; + + /** + * Creates a new GetShieldedInstanceIdentityInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetShieldedInstanceIdentityInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest): google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest; + + /** + * Encodes the specified GetShieldedInstanceIdentityInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest.verify|verify} messages. + * @param message GetShieldedInstanceIdentityInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetShieldedInstanceIdentityInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest.verify|verify} messages. + * @param message GetShieldedInstanceIdentityInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetShieldedInstanceIdentityInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetShieldedInstanceIdentityInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest; + + /** + * Decodes a GetShieldedInstanceIdentityInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetShieldedInstanceIdentityInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest; + + /** + * Verifies a GetShieldedInstanceIdentityInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetShieldedInstanceIdentityInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetShieldedInstanceIdentityInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest; + + /** + * Creates a plain object from a GetShieldedInstanceIdentityInstanceRequest message. Also converts values to other types if specified. + * @param message GetShieldedInstanceIdentityInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetShieldedInstanceIdentityInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertInstanceRequest. */ + interface IInsertInstanceRequest { + + /** InsertInstanceRequest instanceResource */ + instanceResource?: (google.cloud.compute.v1.IInstance|null); + + /** InsertInstanceRequest project */ + project?: (string|null); + + /** InsertInstanceRequest requestId */ + requestId?: (string|null); + + /** InsertInstanceRequest sourceInstanceTemplate */ + sourceInstanceTemplate?: (string|null); + + /** InsertInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertInstanceRequest. */ + class InsertInstanceRequest implements IInsertInstanceRequest { + + /** + * Constructs a new InsertInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertInstanceRequest); + + /** InsertInstanceRequest instanceResource. */ + public instanceResource?: (google.cloud.compute.v1.IInstance|null); + + /** InsertInstanceRequest project. */ + public project: string; + + /** InsertInstanceRequest requestId. */ + public requestId?: (string|null); + + /** InsertInstanceRequest sourceInstanceTemplate. */ + public sourceInstanceTemplate?: (string|null); + + /** InsertInstanceRequest zone. */ + public zone: string; + + /** InsertInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** InsertInstanceRequest _sourceInstanceTemplate. */ + public _sourceInstanceTemplate?: "sourceInstanceTemplate"; + + /** + * Creates a new InsertInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertInstanceRequest): google.cloud.compute.v1.InsertInstanceRequest; + + /** + * Encodes the specified InsertInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceRequest.verify|verify} messages. + * @param message InsertInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceRequest.verify|verify} messages. + * @param message InsertInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertInstanceRequest; + + /** + * Decodes an InsertInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertInstanceRequest; + + /** + * Verifies an InsertInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertInstanceRequest; + + /** + * Creates a plain object from an InsertInstanceRequest message. Also converts values to other types if specified. + * @param message InsertInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest maxResults */ + maxResults?: (number|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest project */ + project?: (string|null); + + /** ListInstancesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListInstancesRequest zone */ + zone?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInstancesRequest); + + /** ListInstancesRequest filter. */ + public filter?: (string|null); + + /** ListInstancesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInstancesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInstancesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInstancesRequest project. */ + public project: string; + + /** ListInstancesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInstancesRequest zone. */ + public zone: string; + + /** ListInstancesRequest _filter. */ + public _filter?: "filter"; + + /** ListInstancesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInstancesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInstancesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInstancesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInstancesRequest): google.cloud.compute.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReferrersInstancesRequest. */ + interface IListReferrersInstancesRequest { + + /** ListReferrersInstancesRequest filter */ + filter?: (string|null); + + /** ListReferrersInstancesRequest instance */ + instance?: (string|null); + + /** ListReferrersInstancesRequest maxResults */ + maxResults?: (number|null); + + /** ListReferrersInstancesRequest orderBy */ + orderBy?: (string|null); + + /** ListReferrersInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListReferrersInstancesRequest project */ + project?: (string|null); + + /** ListReferrersInstancesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListReferrersInstancesRequest zone */ + zone?: (string|null); + } + + /** Represents a ListReferrersInstancesRequest. */ + class ListReferrersInstancesRequest implements IListReferrersInstancesRequest { + + /** + * Constructs a new ListReferrersInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListReferrersInstancesRequest); + + /** ListReferrersInstancesRequest filter. */ + public filter?: (string|null); + + /** ListReferrersInstancesRequest instance. */ + public instance: string; + + /** ListReferrersInstancesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListReferrersInstancesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListReferrersInstancesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListReferrersInstancesRequest project. */ + public project: string; + + /** ListReferrersInstancesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListReferrersInstancesRequest zone. */ + public zone: string; + + /** ListReferrersInstancesRequest _filter. */ + public _filter?: "filter"; + + /** ListReferrersInstancesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListReferrersInstancesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListReferrersInstancesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListReferrersInstancesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListReferrersInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReferrersInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListReferrersInstancesRequest): google.cloud.compute.v1.ListReferrersInstancesRequest; + + /** + * Encodes the specified ListReferrersInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListReferrersInstancesRequest.verify|verify} messages. + * @param message ListReferrersInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListReferrersInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReferrersInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListReferrersInstancesRequest.verify|verify} messages. + * @param message ListReferrersInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListReferrersInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListReferrersInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReferrersInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListReferrersInstancesRequest; + + /** + * Decodes a ListReferrersInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReferrersInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListReferrersInstancesRequest; + + /** + * Verifies a ListReferrersInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListReferrersInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReferrersInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListReferrersInstancesRequest; + + /** + * Creates a plain object from a ListReferrersInstancesRequest message. Also converts values to other types if specified. + * @param message ListReferrersInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListReferrersInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReferrersInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveResourcePoliciesInstanceRequest. */ + interface IRemoveResourcePoliciesInstanceRequest { + + /** RemoveResourcePoliciesInstanceRequest instance */ + instance?: (string|null); + + /** RemoveResourcePoliciesInstanceRequest instancesRemoveResourcePoliciesRequestResource */ + instancesRemoveResourcePoliciesRequestResource?: (google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest|null); + + /** RemoveResourcePoliciesInstanceRequest project */ + project?: (string|null); + + /** RemoveResourcePoliciesInstanceRequest requestId */ + requestId?: (string|null); + + /** RemoveResourcePoliciesInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a RemoveResourcePoliciesInstanceRequest. */ + class RemoveResourcePoliciesInstanceRequest implements IRemoveResourcePoliciesInstanceRequest { + + /** + * Constructs a new RemoveResourcePoliciesInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest); + + /** RemoveResourcePoliciesInstanceRequest instance. */ + public instance: string; + + /** RemoveResourcePoliciesInstanceRequest instancesRemoveResourcePoliciesRequestResource. */ + public instancesRemoveResourcePoliciesRequestResource?: (google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest|null); + + /** RemoveResourcePoliciesInstanceRequest project. */ + public project: string; + + /** RemoveResourcePoliciesInstanceRequest requestId. */ + public requestId?: (string|null); + + /** RemoveResourcePoliciesInstanceRequest zone. */ + public zone: string; + + /** RemoveResourcePoliciesInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveResourcePoliciesInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveResourcePoliciesInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest): google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest; + + /** + * Encodes the specified RemoveResourcePoliciesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest.verify|verify} messages. + * @param message RemoveResourcePoliciesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveResourcePoliciesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest.verify|verify} messages. + * @param message RemoveResourcePoliciesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveResourcePoliciesInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest; + + /** + * Decodes a RemoveResourcePoliciesInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest; + + /** + * Verifies a RemoveResourcePoliciesInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveResourcePoliciesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveResourcePoliciesInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest; + + /** + * Creates a plain object from a RemoveResourcePoliciesInstanceRequest message. Also converts values to other types if specified. + * @param message RemoveResourcePoliciesInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveResourcePoliciesInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResetInstanceRequest. */ + interface IResetInstanceRequest { + + /** ResetInstanceRequest instance */ + instance?: (string|null); + + /** ResetInstanceRequest project */ + project?: (string|null); + + /** ResetInstanceRequest requestId */ + requestId?: (string|null); + + /** ResetInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a ResetInstanceRequest. */ + class ResetInstanceRequest implements IResetInstanceRequest { + + /** + * Constructs a new ResetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResetInstanceRequest); + + /** ResetInstanceRequest instance. */ + public instance: string; + + /** ResetInstanceRequest project. */ + public project: string; + + /** ResetInstanceRequest requestId. */ + public requestId?: (string|null); + + /** ResetInstanceRequest zone. */ + public zone: string; + + /** ResetInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new ResetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResetInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IResetInstanceRequest): google.cloud.compute.v1.ResetInstanceRequest; + + /** + * Encodes the specified ResetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.ResetInstanceRequest.verify|verify} messages. + * @param message ResetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResetInstanceRequest.verify|verify} messages. + * @param message ResetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResetInstanceRequest; + + /** + * Decodes a ResetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResetInstanceRequest; + + /** + * Verifies a ResetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResetInstanceRequest; + + /** + * Creates a plain object from a ResetInstanceRequest message. Also converts values to other types if specified. + * @param message ResetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetDeletionProtectionInstanceRequest. */ + interface ISetDeletionProtectionInstanceRequest { + + /** SetDeletionProtectionInstanceRequest deletionProtection */ + deletionProtection?: (boolean|null); + + /** SetDeletionProtectionInstanceRequest project */ + project?: (string|null); + + /** SetDeletionProtectionInstanceRequest requestId */ + requestId?: (string|null); + + /** SetDeletionProtectionInstanceRequest resource */ + resource?: (string|null); + + /** SetDeletionProtectionInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetDeletionProtectionInstanceRequest. */ + class SetDeletionProtectionInstanceRequest implements ISetDeletionProtectionInstanceRequest { + + /** + * Constructs a new SetDeletionProtectionInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest); + + /** SetDeletionProtectionInstanceRequest deletionProtection. */ + public deletionProtection?: (boolean|null); + + /** SetDeletionProtectionInstanceRequest project. */ + public project: string; + + /** SetDeletionProtectionInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetDeletionProtectionInstanceRequest resource. */ + public resource: string; + + /** SetDeletionProtectionInstanceRequest zone. */ + public zone: string; + + /** SetDeletionProtectionInstanceRequest _deletionProtection. */ + public _deletionProtection?: "deletionProtection"; + + /** SetDeletionProtectionInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetDeletionProtectionInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDeletionProtectionInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest): google.cloud.compute.v1.SetDeletionProtectionInstanceRequest; + + /** + * Encodes the specified SetDeletionProtectionInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetDeletionProtectionInstanceRequest.verify|verify} messages. + * @param message SetDeletionProtectionInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDeletionProtectionInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetDeletionProtectionInstanceRequest.verify|verify} messages. + * @param message SetDeletionProtectionInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDeletionProtectionInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDeletionProtectionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetDeletionProtectionInstanceRequest; + + /** + * Decodes a SetDeletionProtectionInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDeletionProtectionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetDeletionProtectionInstanceRequest; + + /** + * Verifies a SetDeletionProtectionInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDeletionProtectionInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDeletionProtectionInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetDeletionProtectionInstanceRequest; + + /** + * Creates a plain object from a SetDeletionProtectionInstanceRequest message. Also converts values to other types if specified. + * @param message SetDeletionProtectionInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetDeletionProtectionInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDeletionProtectionInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetDiskAutoDeleteInstanceRequest. */ + interface ISetDiskAutoDeleteInstanceRequest { + + /** SetDiskAutoDeleteInstanceRequest autoDelete */ + autoDelete?: (boolean|null); + + /** SetDiskAutoDeleteInstanceRequest deviceName */ + deviceName?: (string|null); + + /** SetDiskAutoDeleteInstanceRequest instance */ + instance?: (string|null); + + /** SetDiskAutoDeleteInstanceRequest project */ + project?: (string|null); + + /** SetDiskAutoDeleteInstanceRequest requestId */ + requestId?: (string|null); + + /** SetDiskAutoDeleteInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetDiskAutoDeleteInstanceRequest. */ + class SetDiskAutoDeleteInstanceRequest implements ISetDiskAutoDeleteInstanceRequest { + + /** + * Constructs a new SetDiskAutoDeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest); + + /** SetDiskAutoDeleteInstanceRequest autoDelete. */ + public autoDelete: boolean; + + /** SetDiskAutoDeleteInstanceRequest deviceName. */ + public deviceName: string; + + /** SetDiskAutoDeleteInstanceRequest instance. */ + public instance: string; + + /** SetDiskAutoDeleteInstanceRequest project. */ + public project: string; + + /** SetDiskAutoDeleteInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetDiskAutoDeleteInstanceRequest zone. */ + public zone: string; + + /** SetDiskAutoDeleteInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetDiskAutoDeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDiskAutoDeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest): google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest; + + /** + * Encodes the specified SetDiskAutoDeleteInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest.verify|verify} messages. + * @param message SetDiskAutoDeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDiskAutoDeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest.verify|verify} messages. + * @param message SetDiskAutoDeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDiskAutoDeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDiskAutoDeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest; + + /** + * Decodes a SetDiskAutoDeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDiskAutoDeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest; + + /** + * Verifies a SetDiskAutoDeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDiskAutoDeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDiskAutoDeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest; + + /** + * Creates a plain object from a SetDiskAutoDeleteInstanceRequest message. Also converts values to other types if specified. + * @param message SetDiskAutoDeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDiskAutoDeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyInstanceRequest. */ + interface ISetIamPolicyInstanceRequest { + + /** SetIamPolicyInstanceRequest project */ + project?: (string|null); + + /** SetIamPolicyInstanceRequest resource */ + resource?: (string|null); + + /** SetIamPolicyInstanceRequest zone */ + zone?: (string|null); + + /** SetIamPolicyInstanceRequest zoneSetPolicyRequestResource */ + zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + } + + /** Represents a SetIamPolicyInstanceRequest. */ + class SetIamPolicyInstanceRequest implements ISetIamPolicyInstanceRequest { + + /** + * Constructs a new SetIamPolicyInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyInstanceRequest); + + /** SetIamPolicyInstanceRequest project. */ + public project: string; + + /** SetIamPolicyInstanceRequest resource. */ + public resource: string; + + /** SetIamPolicyInstanceRequest zone. */ + public zone: string; + + /** SetIamPolicyInstanceRequest zoneSetPolicyRequestResource. */ + public zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + + /** + * Creates a new SetIamPolicyInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyInstanceRequest): google.cloud.compute.v1.SetIamPolicyInstanceRequest; + + /** + * Encodes the specified SetIamPolicyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceRequest.verify|verify} messages. + * @param message SetIamPolicyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceRequest.verify|verify} messages. + * @param message SetIamPolicyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyInstanceRequest; + + /** + * Decodes a SetIamPolicyInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyInstanceRequest; + + /** + * Verifies a SetIamPolicyInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyInstanceRequest; + + /** + * Creates a plain object from a SetIamPolicyInstanceRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsInstanceRequest. */ + interface ISetLabelsInstanceRequest { + + /** SetLabelsInstanceRequest instance */ + instance?: (string|null); + + /** SetLabelsInstanceRequest instancesSetLabelsRequestResource */ + instancesSetLabelsRequestResource?: (google.cloud.compute.v1.IInstancesSetLabelsRequest|null); + + /** SetLabelsInstanceRequest project */ + project?: (string|null); + + /** SetLabelsInstanceRequest requestId */ + requestId?: (string|null); + + /** SetLabelsInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetLabelsInstanceRequest. */ + class SetLabelsInstanceRequest implements ISetLabelsInstanceRequest { + + /** + * Constructs a new SetLabelsInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsInstanceRequest); + + /** SetLabelsInstanceRequest instance. */ + public instance: string; + + /** SetLabelsInstanceRequest instancesSetLabelsRequestResource. */ + public instancesSetLabelsRequestResource?: (google.cloud.compute.v1.IInstancesSetLabelsRequest|null); + + /** SetLabelsInstanceRequest project. */ + public project: string; + + /** SetLabelsInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetLabelsInstanceRequest zone. */ + public zone: string; + + /** SetLabelsInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetLabelsInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsInstanceRequest): google.cloud.compute.v1.SetLabelsInstanceRequest; + + /** + * Encodes the specified SetLabelsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsInstanceRequest.verify|verify} messages. + * @param message SetLabelsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsInstanceRequest.verify|verify} messages. + * @param message SetLabelsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsInstanceRequest; + + /** + * Decodes a SetLabelsInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsInstanceRequest; + + /** + * Verifies a SetLabelsInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsInstanceRequest; + + /** + * Creates a plain object from a SetLabelsInstanceRequest message. Also converts values to other types if specified. + * @param message SetLabelsInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetMachineResourcesInstanceRequest. */ + interface ISetMachineResourcesInstanceRequest { + + /** SetMachineResourcesInstanceRequest instance */ + instance?: (string|null); + + /** SetMachineResourcesInstanceRequest instancesSetMachineResourcesRequestResource */ + instancesSetMachineResourcesRequestResource?: (google.cloud.compute.v1.IInstancesSetMachineResourcesRequest|null); + + /** SetMachineResourcesInstanceRequest project */ + project?: (string|null); + + /** SetMachineResourcesInstanceRequest requestId */ + requestId?: (string|null); + + /** SetMachineResourcesInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetMachineResourcesInstanceRequest. */ + class SetMachineResourcesInstanceRequest implements ISetMachineResourcesInstanceRequest { + + /** + * Constructs a new SetMachineResourcesInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetMachineResourcesInstanceRequest); + + /** SetMachineResourcesInstanceRequest instance. */ + public instance: string; + + /** SetMachineResourcesInstanceRequest instancesSetMachineResourcesRequestResource. */ + public instancesSetMachineResourcesRequestResource?: (google.cloud.compute.v1.IInstancesSetMachineResourcesRequest|null); + + /** SetMachineResourcesInstanceRequest project. */ + public project: string; + + /** SetMachineResourcesInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetMachineResourcesInstanceRequest zone. */ + public zone: string; + + /** SetMachineResourcesInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetMachineResourcesInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetMachineResourcesInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetMachineResourcesInstanceRequest): google.cloud.compute.v1.SetMachineResourcesInstanceRequest; + + /** + * Encodes the specified SetMachineResourcesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMachineResourcesInstanceRequest.verify|verify} messages. + * @param message SetMachineResourcesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMachineResourcesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMachineResourcesInstanceRequest.verify|verify} messages. + * @param message SetMachineResourcesInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetMachineResourcesInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetMachineResourcesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetMachineResourcesInstanceRequest; + + /** + * Decodes a SetMachineResourcesInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetMachineResourcesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetMachineResourcesInstanceRequest; + + /** + * Verifies a SetMachineResourcesInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetMachineResourcesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetMachineResourcesInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetMachineResourcesInstanceRequest; + + /** + * Creates a plain object from a SetMachineResourcesInstanceRequest message. Also converts values to other types if specified. + * @param message SetMachineResourcesInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetMachineResourcesInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMachineResourcesInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetMachineTypeInstanceRequest. */ + interface ISetMachineTypeInstanceRequest { + + /** SetMachineTypeInstanceRequest instance */ + instance?: (string|null); + + /** SetMachineTypeInstanceRequest instancesSetMachineTypeRequestResource */ + instancesSetMachineTypeRequestResource?: (google.cloud.compute.v1.IInstancesSetMachineTypeRequest|null); + + /** SetMachineTypeInstanceRequest project */ + project?: (string|null); + + /** SetMachineTypeInstanceRequest requestId */ + requestId?: (string|null); + + /** SetMachineTypeInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetMachineTypeInstanceRequest. */ + class SetMachineTypeInstanceRequest implements ISetMachineTypeInstanceRequest { + + /** + * Constructs a new SetMachineTypeInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetMachineTypeInstanceRequest); + + /** SetMachineTypeInstanceRequest instance. */ + public instance: string; + + /** SetMachineTypeInstanceRequest instancesSetMachineTypeRequestResource. */ + public instancesSetMachineTypeRequestResource?: (google.cloud.compute.v1.IInstancesSetMachineTypeRequest|null); + + /** SetMachineTypeInstanceRequest project. */ + public project: string; + + /** SetMachineTypeInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetMachineTypeInstanceRequest zone. */ + public zone: string; + + /** SetMachineTypeInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetMachineTypeInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetMachineTypeInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetMachineTypeInstanceRequest): google.cloud.compute.v1.SetMachineTypeInstanceRequest; + + /** + * Encodes the specified SetMachineTypeInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMachineTypeInstanceRequest.verify|verify} messages. + * @param message SetMachineTypeInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetMachineTypeInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMachineTypeInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMachineTypeInstanceRequest.verify|verify} messages. + * @param message SetMachineTypeInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetMachineTypeInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetMachineTypeInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetMachineTypeInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetMachineTypeInstanceRequest; + + /** + * Decodes a SetMachineTypeInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetMachineTypeInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetMachineTypeInstanceRequest; + + /** + * Verifies a SetMachineTypeInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetMachineTypeInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetMachineTypeInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetMachineTypeInstanceRequest; + + /** + * Creates a plain object from a SetMachineTypeInstanceRequest message. Also converts values to other types if specified. + * @param message SetMachineTypeInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetMachineTypeInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMachineTypeInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetMetadataInstanceRequest. */ + interface ISetMetadataInstanceRequest { + + /** SetMetadataInstanceRequest instance */ + instance?: (string|null); + + /** SetMetadataInstanceRequest metadataResource */ + metadataResource?: (google.cloud.compute.v1.IMetadata|null); + + /** SetMetadataInstanceRequest project */ + project?: (string|null); + + /** SetMetadataInstanceRequest requestId */ + requestId?: (string|null); + + /** SetMetadataInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetMetadataInstanceRequest. */ + class SetMetadataInstanceRequest implements ISetMetadataInstanceRequest { + + /** + * Constructs a new SetMetadataInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetMetadataInstanceRequest); + + /** SetMetadataInstanceRequest instance. */ + public instance: string; + + /** SetMetadataInstanceRequest metadataResource. */ + public metadataResource?: (google.cloud.compute.v1.IMetadata|null); + + /** SetMetadataInstanceRequest project. */ + public project: string; + + /** SetMetadataInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetMetadataInstanceRequest zone. */ + public zone: string; + + /** SetMetadataInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetMetadataInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetMetadataInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetMetadataInstanceRequest): google.cloud.compute.v1.SetMetadataInstanceRequest; + + /** + * Encodes the specified SetMetadataInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMetadataInstanceRequest.verify|verify} messages. + * @param message SetMetadataInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetMetadataInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMetadataInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMetadataInstanceRequest.verify|verify} messages. + * @param message SetMetadataInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetMetadataInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetMetadataInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetMetadataInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetMetadataInstanceRequest; + + /** + * Decodes a SetMetadataInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetMetadataInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetMetadataInstanceRequest; + + /** + * Verifies a SetMetadataInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetMetadataInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetMetadataInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetMetadataInstanceRequest; + + /** + * Creates a plain object from a SetMetadataInstanceRequest message. Also converts values to other types if specified. + * @param message SetMetadataInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetMetadataInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMetadataInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetMinCpuPlatformInstanceRequest. */ + interface ISetMinCpuPlatformInstanceRequest { + + /** SetMinCpuPlatformInstanceRequest instance */ + instance?: (string|null); + + /** SetMinCpuPlatformInstanceRequest instancesSetMinCpuPlatformRequestResource */ + instancesSetMinCpuPlatformRequestResource?: (google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest|null); + + /** SetMinCpuPlatformInstanceRequest project */ + project?: (string|null); + + /** SetMinCpuPlatformInstanceRequest requestId */ + requestId?: (string|null); + + /** SetMinCpuPlatformInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetMinCpuPlatformInstanceRequest. */ + class SetMinCpuPlatformInstanceRequest implements ISetMinCpuPlatformInstanceRequest { + + /** + * Constructs a new SetMinCpuPlatformInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest); + + /** SetMinCpuPlatformInstanceRequest instance. */ + public instance: string; + + /** SetMinCpuPlatformInstanceRequest instancesSetMinCpuPlatformRequestResource. */ + public instancesSetMinCpuPlatformRequestResource?: (google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest|null); + + /** SetMinCpuPlatformInstanceRequest project. */ + public project: string; + + /** SetMinCpuPlatformInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetMinCpuPlatformInstanceRequest zone. */ + public zone: string; + + /** SetMinCpuPlatformInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetMinCpuPlatformInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetMinCpuPlatformInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest): google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest; + + /** + * Encodes the specified SetMinCpuPlatformInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest.verify|verify} messages. + * @param message SetMinCpuPlatformInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetMinCpuPlatformInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest.verify|verify} messages. + * @param message SetMinCpuPlatformInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetMinCpuPlatformInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetMinCpuPlatformInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest; + + /** + * Decodes a SetMinCpuPlatformInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetMinCpuPlatformInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest; + + /** + * Verifies a SetMinCpuPlatformInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetMinCpuPlatformInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetMinCpuPlatformInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest; + + /** + * Creates a plain object from a SetMinCpuPlatformInstanceRequest message. Also converts values to other types if specified. + * @param message SetMinCpuPlatformInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetMinCpuPlatformInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetSchedulingInstanceRequest. */ + interface ISetSchedulingInstanceRequest { + + /** SetSchedulingInstanceRequest instance */ + instance?: (string|null); + + /** SetSchedulingInstanceRequest project */ + project?: (string|null); + + /** SetSchedulingInstanceRequest requestId */ + requestId?: (string|null); + + /** SetSchedulingInstanceRequest schedulingResource */ + schedulingResource?: (google.cloud.compute.v1.IScheduling|null); + + /** SetSchedulingInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetSchedulingInstanceRequest. */ + class SetSchedulingInstanceRequest implements ISetSchedulingInstanceRequest { + + /** + * Constructs a new SetSchedulingInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetSchedulingInstanceRequest); + + /** SetSchedulingInstanceRequest instance. */ + public instance: string; + + /** SetSchedulingInstanceRequest project. */ + public project: string; + + /** SetSchedulingInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetSchedulingInstanceRequest schedulingResource. */ + public schedulingResource?: (google.cloud.compute.v1.IScheduling|null); + + /** SetSchedulingInstanceRequest zone. */ + public zone: string; + + /** SetSchedulingInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetSchedulingInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetSchedulingInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetSchedulingInstanceRequest): google.cloud.compute.v1.SetSchedulingInstanceRequest; + + /** + * Encodes the specified SetSchedulingInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSchedulingInstanceRequest.verify|verify} messages. + * @param message SetSchedulingInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetSchedulingInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetSchedulingInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSchedulingInstanceRequest.verify|verify} messages. + * @param message SetSchedulingInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetSchedulingInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetSchedulingInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetSchedulingInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetSchedulingInstanceRequest; + + /** + * Decodes a SetSchedulingInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetSchedulingInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetSchedulingInstanceRequest; + + /** + * Verifies a SetSchedulingInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetSchedulingInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetSchedulingInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetSchedulingInstanceRequest; + + /** + * Creates a plain object from a SetSchedulingInstanceRequest message. Also converts values to other types if specified. + * @param message SetSchedulingInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetSchedulingInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetSchedulingInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetServiceAccountInstanceRequest. */ + interface ISetServiceAccountInstanceRequest { + + /** SetServiceAccountInstanceRequest instance */ + instance?: (string|null); + + /** SetServiceAccountInstanceRequest instancesSetServiceAccountRequestResource */ + instancesSetServiceAccountRequestResource?: (google.cloud.compute.v1.IInstancesSetServiceAccountRequest|null); + + /** SetServiceAccountInstanceRequest project */ + project?: (string|null); + + /** SetServiceAccountInstanceRequest requestId */ + requestId?: (string|null); + + /** SetServiceAccountInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetServiceAccountInstanceRequest. */ + class SetServiceAccountInstanceRequest implements ISetServiceAccountInstanceRequest { + + /** + * Constructs a new SetServiceAccountInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetServiceAccountInstanceRequest); + + /** SetServiceAccountInstanceRequest instance. */ + public instance: string; + + /** SetServiceAccountInstanceRequest instancesSetServiceAccountRequestResource. */ + public instancesSetServiceAccountRequestResource?: (google.cloud.compute.v1.IInstancesSetServiceAccountRequest|null); + + /** SetServiceAccountInstanceRequest project. */ + public project: string; + + /** SetServiceAccountInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetServiceAccountInstanceRequest zone. */ + public zone: string; + + /** SetServiceAccountInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetServiceAccountInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetServiceAccountInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetServiceAccountInstanceRequest): google.cloud.compute.v1.SetServiceAccountInstanceRequest; + + /** + * Encodes the specified SetServiceAccountInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetServiceAccountInstanceRequest.verify|verify} messages. + * @param message SetServiceAccountInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetServiceAccountInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetServiceAccountInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetServiceAccountInstanceRequest.verify|verify} messages. + * @param message SetServiceAccountInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetServiceAccountInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetServiceAccountInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetServiceAccountInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetServiceAccountInstanceRequest; + + /** + * Decodes a SetServiceAccountInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetServiceAccountInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetServiceAccountInstanceRequest; + + /** + * Verifies a SetServiceAccountInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetServiceAccountInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetServiceAccountInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetServiceAccountInstanceRequest; + + /** + * Creates a plain object from a SetServiceAccountInstanceRequest message. Also converts values to other types if specified. + * @param message SetServiceAccountInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetServiceAccountInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetServiceAccountInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetShieldedInstanceIntegrityPolicyInstanceRequest. */ + interface ISetShieldedInstanceIntegrityPolicyInstanceRequest { + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest instance */ + instance?: (string|null); + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest project */ + project?: (string|null); + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest requestId */ + requestId?: (string|null); + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest shieldedInstanceIntegrityPolicyResource */ + shieldedInstanceIntegrityPolicyResource?: (google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null); + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetShieldedInstanceIntegrityPolicyInstanceRequest. */ + class SetShieldedInstanceIntegrityPolicyInstanceRequest implements ISetShieldedInstanceIntegrityPolicyInstanceRequest { + + /** + * Constructs a new SetShieldedInstanceIntegrityPolicyInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest); + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest instance. */ + public instance: string; + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest project. */ + public project: string; + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest shieldedInstanceIntegrityPolicyResource. */ + public shieldedInstanceIntegrityPolicyResource?: (google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null); + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest zone. */ + public zone: string; + + /** SetShieldedInstanceIntegrityPolicyInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetShieldedInstanceIntegrityPolicyInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetShieldedInstanceIntegrityPolicyInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest): google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest; + + /** + * Encodes the specified SetShieldedInstanceIntegrityPolicyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest.verify|verify} messages. + * @param message SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetShieldedInstanceIntegrityPolicyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest.verify|verify} messages. + * @param message SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetShieldedInstanceIntegrityPolicyInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetShieldedInstanceIntegrityPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest; + + /** + * Decodes a SetShieldedInstanceIntegrityPolicyInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetShieldedInstanceIntegrityPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest; + + /** + * Verifies a SetShieldedInstanceIntegrityPolicyInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetShieldedInstanceIntegrityPolicyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetShieldedInstanceIntegrityPolicyInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest; + + /** + * Creates a plain object from a SetShieldedInstanceIntegrityPolicyInstanceRequest message. Also converts values to other types if specified. + * @param message SetShieldedInstanceIntegrityPolicyInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetShieldedInstanceIntegrityPolicyInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetTagsInstanceRequest. */ + interface ISetTagsInstanceRequest { + + /** SetTagsInstanceRequest instance */ + instance?: (string|null); + + /** SetTagsInstanceRequest project */ + project?: (string|null); + + /** SetTagsInstanceRequest requestId */ + requestId?: (string|null); + + /** SetTagsInstanceRequest tagsResource */ + tagsResource?: (google.cloud.compute.v1.ITags|null); + + /** SetTagsInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SetTagsInstanceRequest. */ + class SetTagsInstanceRequest implements ISetTagsInstanceRequest { + + /** + * Constructs a new SetTagsInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetTagsInstanceRequest); + + /** SetTagsInstanceRequest instance. */ + public instance: string; + + /** SetTagsInstanceRequest project. */ + public project: string; + + /** SetTagsInstanceRequest requestId. */ + public requestId?: (string|null); + + /** SetTagsInstanceRequest tagsResource. */ + public tagsResource?: (google.cloud.compute.v1.ITags|null); + + /** SetTagsInstanceRequest zone. */ + public zone: string; + + /** SetTagsInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetTagsInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetTagsInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetTagsInstanceRequest): google.cloud.compute.v1.SetTagsInstanceRequest; + + /** + * Encodes the specified SetTagsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTagsInstanceRequest.verify|verify} messages. + * @param message SetTagsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetTagsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetTagsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTagsInstanceRequest.verify|verify} messages. + * @param message SetTagsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetTagsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetTagsInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetTagsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetTagsInstanceRequest; + + /** + * Decodes a SetTagsInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetTagsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetTagsInstanceRequest; + + /** + * Verifies a SetTagsInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetTagsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetTagsInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetTagsInstanceRequest; + + /** + * Creates a plain object from a SetTagsInstanceRequest message. Also converts values to other types if specified. + * @param message SetTagsInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetTagsInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetTagsInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SimulateMaintenanceEventInstanceRequest. */ + interface ISimulateMaintenanceEventInstanceRequest { + + /** SimulateMaintenanceEventInstanceRequest instance */ + instance?: (string|null); + + /** SimulateMaintenanceEventInstanceRequest project */ + project?: (string|null); + + /** SimulateMaintenanceEventInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a SimulateMaintenanceEventInstanceRequest. */ + class SimulateMaintenanceEventInstanceRequest implements ISimulateMaintenanceEventInstanceRequest { + + /** + * Constructs a new SimulateMaintenanceEventInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest); + + /** SimulateMaintenanceEventInstanceRequest instance. */ + public instance: string; + + /** SimulateMaintenanceEventInstanceRequest project. */ + public project: string; + + /** SimulateMaintenanceEventInstanceRequest zone. */ + public zone: string; + + /** + * Creates a new SimulateMaintenanceEventInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SimulateMaintenanceEventInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest): google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest; + + /** + * Encodes the specified SimulateMaintenanceEventInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest.verify|verify} messages. + * @param message SimulateMaintenanceEventInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimulateMaintenanceEventInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest.verify|verify} messages. + * @param message SimulateMaintenanceEventInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimulateMaintenanceEventInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimulateMaintenanceEventInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest; + + /** + * Decodes a SimulateMaintenanceEventInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimulateMaintenanceEventInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest; + + /** + * Verifies a SimulateMaintenanceEventInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SimulateMaintenanceEventInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimulateMaintenanceEventInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest; + + /** + * Creates a plain object from a SimulateMaintenanceEventInstanceRequest message. Also converts values to other types if specified. + * @param message SimulateMaintenanceEventInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimulateMaintenanceEventInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StartInstanceRequest. */ + interface IStartInstanceRequest { + + /** StartInstanceRequest instance */ + instance?: (string|null); + + /** StartInstanceRequest project */ + project?: (string|null); + + /** StartInstanceRequest requestId */ + requestId?: (string|null); + + /** StartInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a StartInstanceRequest. */ + class StartInstanceRequest implements IStartInstanceRequest { + + /** + * Constructs a new StartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IStartInstanceRequest); + + /** StartInstanceRequest instance. */ + public instance: string; + + /** StartInstanceRequest project. */ + public project: string; + + /** StartInstanceRequest requestId. */ + public requestId?: (string|null); + + /** StartInstanceRequest zone. */ + public zone: string; + + /** StartInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IStartInstanceRequest): google.cloud.compute.v1.StartInstanceRequest; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StartInstanceRequest.verify|verify} messages. + * @param message StartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IStartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.StartInstanceRequest; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.StartInstanceRequest; + + /** + * Verifies a StartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.StartInstanceRequest; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @param message StartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.StartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StartWithEncryptionKeyInstanceRequest. */ + interface IStartWithEncryptionKeyInstanceRequest { + + /** StartWithEncryptionKeyInstanceRequest instance */ + instance?: (string|null); + + /** StartWithEncryptionKeyInstanceRequest instancesStartWithEncryptionKeyRequestResource */ + instancesStartWithEncryptionKeyRequestResource?: (google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest|null); + + /** StartWithEncryptionKeyInstanceRequest project */ + project?: (string|null); + + /** StartWithEncryptionKeyInstanceRequest requestId */ + requestId?: (string|null); + + /** StartWithEncryptionKeyInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a StartWithEncryptionKeyInstanceRequest. */ + class StartWithEncryptionKeyInstanceRequest implements IStartWithEncryptionKeyInstanceRequest { + + /** + * Constructs a new StartWithEncryptionKeyInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest); + + /** StartWithEncryptionKeyInstanceRequest instance. */ + public instance: string; + + /** StartWithEncryptionKeyInstanceRequest instancesStartWithEncryptionKeyRequestResource. */ + public instancesStartWithEncryptionKeyRequestResource?: (google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest|null); + + /** StartWithEncryptionKeyInstanceRequest project. */ + public project: string; + + /** StartWithEncryptionKeyInstanceRequest requestId. */ + public requestId?: (string|null); + + /** StartWithEncryptionKeyInstanceRequest zone. */ + public zone: string; + + /** StartWithEncryptionKeyInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new StartWithEncryptionKeyInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartWithEncryptionKeyInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest): google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest; + + /** + * Encodes the specified StartWithEncryptionKeyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest.verify|verify} messages. + * @param message StartWithEncryptionKeyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartWithEncryptionKeyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest.verify|verify} messages. + * @param message StartWithEncryptionKeyInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartWithEncryptionKeyInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartWithEncryptionKeyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest; + + /** + * Decodes a StartWithEncryptionKeyInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartWithEncryptionKeyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest; + + /** + * Verifies a StartWithEncryptionKeyInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartWithEncryptionKeyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartWithEncryptionKeyInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest; + + /** + * Creates a plain object from a StartWithEncryptionKeyInstanceRequest message. Also converts values to other types if specified. + * @param message StartWithEncryptionKeyInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartWithEncryptionKeyInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StopInstanceRequest. */ + interface IStopInstanceRequest { + + /** StopInstanceRequest instance */ + instance?: (string|null); + + /** StopInstanceRequest project */ + project?: (string|null); + + /** StopInstanceRequest requestId */ + requestId?: (string|null); + + /** StopInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a StopInstanceRequest. */ + class StopInstanceRequest implements IStopInstanceRequest { + + /** + * Constructs a new StopInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IStopInstanceRequest); + + /** StopInstanceRequest instance. */ + public instance: string; + + /** StopInstanceRequest project. */ + public project: string; + + /** StopInstanceRequest requestId. */ + public requestId?: (string|null); + + /** StopInstanceRequest zone. */ + public zone: string; + + /** StopInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IStopInstanceRequest): google.cloud.compute.v1.StopInstanceRequest; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StopInstanceRequest.verify|verify} messages. + * @param message StopInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IStopInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.StopInstanceRequest; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.StopInstanceRequest; + + /** + * Verifies a StopInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.StopInstanceRequest; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @param message StopInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.StopInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsInstanceRequest. */ + interface ITestIamPermissionsInstanceRequest { + + /** TestIamPermissionsInstanceRequest project */ + project?: (string|null); + + /** TestIamPermissionsInstanceRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsInstanceRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a TestIamPermissionsInstanceRequest. */ + class TestIamPermissionsInstanceRequest implements ITestIamPermissionsInstanceRequest { + + /** + * Constructs a new TestIamPermissionsInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsInstanceRequest); + + /** TestIamPermissionsInstanceRequest project. */ + public project: string; + + /** TestIamPermissionsInstanceRequest resource. */ + public resource: string; + + /** TestIamPermissionsInstanceRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsInstanceRequest zone. */ + public zone: string; + + /** + * Creates a new TestIamPermissionsInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsInstanceRequest): google.cloud.compute.v1.TestIamPermissionsInstanceRequest; + + /** + * Encodes the specified TestIamPermissionsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceRequest.verify|verify} messages. + * @param message TestIamPermissionsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceRequest.verify|verify} messages. + * @param message TestIamPermissionsInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsInstanceRequest; + + /** + * Decodes a TestIamPermissionsInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsInstanceRequest; + + /** + * Verifies a TestIamPermissionsInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsInstanceRequest; + + /** + * Creates a plain object from a TestIamPermissionsInstanceRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest instance */ + instance?: (string|null); + + /** UpdateInstanceRequest instanceResource */ + instanceResource?: (google.cloud.compute.v1.IInstance|null); + + /** UpdateInstanceRequest minimalAction */ + minimalAction?: (string|null); + + /** UpdateInstanceRequest mostDisruptiveAllowedAction */ + mostDisruptiveAllowedAction?: (string|null); + + /** UpdateInstanceRequest project */ + project?: (string|null); + + /** UpdateInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest instance. */ + public instance: string; + + /** UpdateInstanceRequest instanceResource. */ + public instanceResource?: (google.cloud.compute.v1.IInstance|null); + + /** UpdateInstanceRequest minimalAction. */ + public minimalAction?: (string|null); + + /** UpdateInstanceRequest mostDisruptiveAllowedAction. */ + public mostDisruptiveAllowedAction?: (string|null); + + /** UpdateInstanceRequest project. */ + public project: string; + + /** UpdateInstanceRequest requestId. */ + public requestId?: (string|null); + + /** UpdateInstanceRequest zone. */ + public zone: string; + + /** UpdateInstanceRequest _minimalAction. */ + public _minimalAction?: "minimalAction"; + + /** UpdateInstanceRequest _mostDisruptiveAllowedAction. */ + public _mostDisruptiveAllowedAction?: "mostDisruptiveAllowedAction"; + + /** UpdateInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateInstanceRequest): google.cloud.compute.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateAccessConfigInstanceRequest. */ + interface IUpdateAccessConfigInstanceRequest { + + /** UpdateAccessConfigInstanceRequest accessConfigResource */ + accessConfigResource?: (google.cloud.compute.v1.IAccessConfig|null); + + /** UpdateAccessConfigInstanceRequest instance */ + instance?: (string|null); + + /** UpdateAccessConfigInstanceRequest networkInterface */ + networkInterface?: (string|null); + + /** UpdateAccessConfigInstanceRequest project */ + project?: (string|null); + + /** UpdateAccessConfigInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateAccessConfigInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an UpdateAccessConfigInstanceRequest. */ + class UpdateAccessConfigInstanceRequest implements IUpdateAccessConfigInstanceRequest { + + /** + * Constructs a new UpdateAccessConfigInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest); + + /** UpdateAccessConfigInstanceRequest accessConfigResource. */ + public accessConfigResource?: (google.cloud.compute.v1.IAccessConfig|null); + + /** UpdateAccessConfigInstanceRequest instance. */ + public instance: string; + + /** UpdateAccessConfigInstanceRequest networkInterface. */ + public networkInterface: string; + + /** UpdateAccessConfigInstanceRequest project. */ + public project: string; + + /** UpdateAccessConfigInstanceRequest requestId. */ + public requestId?: (string|null); + + /** UpdateAccessConfigInstanceRequest zone. */ + public zone: string; + + /** UpdateAccessConfigInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateAccessConfigInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAccessConfigInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest): google.cloud.compute.v1.UpdateAccessConfigInstanceRequest; + + /** + * Encodes the specified UpdateAccessConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateAccessConfigInstanceRequest.verify|verify} messages. + * @param message UpdateAccessConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAccessConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateAccessConfigInstanceRequest.verify|verify} messages. + * @param message UpdateAccessConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAccessConfigInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateAccessConfigInstanceRequest; + + /** + * Decodes an UpdateAccessConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateAccessConfigInstanceRequest; + + /** + * Verifies an UpdateAccessConfigInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAccessConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAccessConfigInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateAccessConfigInstanceRequest; + + /** + * Creates a plain object from an UpdateAccessConfigInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateAccessConfigInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateAccessConfigInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAccessConfigInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateDisplayDeviceInstanceRequest. */ + interface IUpdateDisplayDeviceInstanceRequest { + + /** UpdateDisplayDeviceInstanceRequest displayDeviceResource */ + displayDeviceResource?: (google.cloud.compute.v1.IDisplayDevice|null); + + /** UpdateDisplayDeviceInstanceRequest instance */ + instance?: (string|null); + + /** UpdateDisplayDeviceInstanceRequest project */ + project?: (string|null); + + /** UpdateDisplayDeviceInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateDisplayDeviceInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an UpdateDisplayDeviceInstanceRequest. */ + class UpdateDisplayDeviceInstanceRequest implements IUpdateDisplayDeviceInstanceRequest { + + /** + * Constructs a new UpdateDisplayDeviceInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest); + + /** UpdateDisplayDeviceInstanceRequest displayDeviceResource. */ + public displayDeviceResource?: (google.cloud.compute.v1.IDisplayDevice|null); + + /** UpdateDisplayDeviceInstanceRequest instance. */ + public instance: string; + + /** UpdateDisplayDeviceInstanceRequest project. */ + public project: string; + + /** UpdateDisplayDeviceInstanceRequest requestId. */ + public requestId?: (string|null); + + /** UpdateDisplayDeviceInstanceRequest zone. */ + public zone: string; + + /** UpdateDisplayDeviceInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateDisplayDeviceInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDisplayDeviceInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest): google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest; + + /** + * Encodes the specified UpdateDisplayDeviceInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest.verify|verify} messages. + * @param message UpdateDisplayDeviceInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDisplayDeviceInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest.verify|verify} messages. + * @param message UpdateDisplayDeviceInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDisplayDeviceInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDisplayDeviceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest; + + /** + * Decodes an UpdateDisplayDeviceInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDisplayDeviceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest; + + /** + * Verifies an UpdateDisplayDeviceInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDisplayDeviceInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDisplayDeviceInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest; + + /** + * Creates a plain object from an UpdateDisplayDeviceInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateDisplayDeviceInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDisplayDeviceInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateNetworkInterfaceInstanceRequest. */ + interface IUpdateNetworkInterfaceInstanceRequest { + + /** UpdateNetworkInterfaceInstanceRequest instance */ + instance?: (string|null); + + /** UpdateNetworkInterfaceInstanceRequest networkInterface */ + networkInterface?: (string|null); + + /** UpdateNetworkInterfaceInstanceRequest networkInterfaceResource */ + networkInterfaceResource?: (google.cloud.compute.v1.INetworkInterface|null); + + /** UpdateNetworkInterfaceInstanceRequest project */ + project?: (string|null); + + /** UpdateNetworkInterfaceInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateNetworkInterfaceInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an UpdateNetworkInterfaceInstanceRequest. */ + class UpdateNetworkInterfaceInstanceRequest implements IUpdateNetworkInterfaceInstanceRequest { + + /** + * Constructs a new UpdateNetworkInterfaceInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest); + + /** UpdateNetworkInterfaceInstanceRequest instance. */ + public instance: string; + + /** UpdateNetworkInterfaceInstanceRequest networkInterface. */ + public networkInterface: string; + + /** UpdateNetworkInterfaceInstanceRequest networkInterfaceResource. */ + public networkInterfaceResource?: (google.cloud.compute.v1.INetworkInterface|null); + + /** UpdateNetworkInterfaceInstanceRequest project. */ + public project: string; + + /** UpdateNetworkInterfaceInstanceRequest requestId. */ + public requestId?: (string|null); + + /** UpdateNetworkInterfaceInstanceRequest zone. */ + public zone: string; + + /** UpdateNetworkInterfaceInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateNetworkInterfaceInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateNetworkInterfaceInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest): google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest; + + /** + * Encodes the specified UpdateNetworkInterfaceInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest.verify|verify} messages. + * @param message UpdateNetworkInterfaceInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNetworkInterfaceInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest.verify|verify} messages. + * @param message UpdateNetworkInterfaceInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateNetworkInterfaceInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateNetworkInterfaceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest; + + /** + * Decodes an UpdateNetworkInterfaceInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateNetworkInterfaceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest; + + /** + * Verifies an UpdateNetworkInterfaceInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateNetworkInterfaceInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateNetworkInterfaceInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest; + + /** + * Creates a plain object from an UpdateNetworkInterfaceInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateNetworkInterfaceInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNetworkInterfaceInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateShieldedInstanceConfigInstanceRequest. */ + interface IUpdateShieldedInstanceConfigInstanceRequest { + + /** UpdateShieldedInstanceConfigInstanceRequest instance */ + instance?: (string|null); + + /** UpdateShieldedInstanceConfigInstanceRequest project */ + project?: (string|null); + + /** UpdateShieldedInstanceConfigInstanceRequest requestId */ + requestId?: (string|null); + + /** UpdateShieldedInstanceConfigInstanceRequest shieldedInstanceConfigResource */ + shieldedInstanceConfigResource?: (google.cloud.compute.v1.IShieldedInstanceConfig|null); + + /** UpdateShieldedInstanceConfigInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an UpdateShieldedInstanceConfigInstanceRequest. */ + class UpdateShieldedInstanceConfigInstanceRequest implements IUpdateShieldedInstanceConfigInstanceRequest { + + /** + * Constructs a new UpdateShieldedInstanceConfigInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest); + + /** UpdateShieldedInstanceConfigInstanceRequest instance. */ + public instance: string; + + /** UpdateShieldedInstanceConfigInstanceRequest project. */ + public project: string; + + /** UpdateShieldedInstanceConfigInstanceRequest requestId. */ + public requestId?: (string|null); + + /** UpdateShieldedInstanceConfigInstanceRequest shieldedInstanceConfigResource. */ + public shieldedInstanceConfigResource?: (google.cloud.compute.v1.IShieldedInstanceConfig|null); + + /** UpdateShieldedInstanceConfigInstanceRequest zone. */ + public zone: string; + + /** UpdateShieldedInstanceConfigInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateShieldedInstanceConfigInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateShieldedInstanceConfigInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest): google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest; + + /** + * Encodes the specified UpdateShieldedInstanceConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest.verify|verify} messages. + * @param message UpdateShieldedInstanceConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateShieldedInstanceConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest.verify|verify} messages. + * @param message UpdateShieldedInstanceConfigInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateShieldedInstanceConfigInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateShieldedInstanceConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest; + + /** + * Decodes an UpdateShieldedInstanceConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateShieldedInstanceConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest; + + /** + * Verifies an UpdateShieldedInstanceConfigInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateShieldedInstanceConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateShieldedInstanceConfigInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest; + + /** + * Creates a plain object from an UpdateShieldedInstanceConfigInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateShieldedInstanceConfigInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateShieldedInstanceConfigInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListInterconnectAttachmentsRequest. */ + interface IAggregatedListInterconnectAttachmentsRequest { + + /** AggregatedListInterconnectAttachmentsRequest filter */ + filter?: (string|null); + + /** AggregatedListInterconnectAttachmentsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListInterconnectAttachmentsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListInterconnectAttachmentsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListInterconnectAttachmentsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListInterconnectAttachmentsRequest project */ + project?: (string|null); + + /** AggregatedListInterconnectAttachmentsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListInterconnectAttachmentsRequest. */ + class AggregatedListInterconnectAttachmentsRequest implements IAggregatedListInterconnectAttachmentsRequest { + + /** + * Constructs a new AggregatedListInterconnectAttachmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest); + + /** AggregatedListInterconnectAttachmentsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListInterconnectAttachmentsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListInterconnectAttachmentsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListInterconnectAttachmentsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListInterconnectAttachmentsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListInterconnectAttachmentsRequest project. */ + public project: string; + + /** AggregatedListInterconnectAttachmentsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListInterconnectAttachmentsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListInterconnectAttachmentsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListInterconnectAttachmentsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListInterconnectAttachmentsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListInterconnectAttachmentsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListInterconnectAttachmentsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListInterconnectAttachmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListInterconnectAttachmentsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest): google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest; + + /** + * Encodes the specified AggregatedListInterconnectAttachmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest.verify|verify} messages. + * @param message AggregatedListInterconnectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListInterconnectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest.verify|verify} messages. + * @param message AggregatedListInterconnectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListInterconnectAttachmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest; + + /** + * Decodes an AggregatedListInterconnectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest; + + /** + * Verifies an AggregatedListInterconnectAttachmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListInterconnectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListInterconnectAttachmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest; + + /** + * Creates a plain object from an AggregatedListInterconnectAttachmentsRequest message. Also converts values to other types if specified. + * @param message AggregatedListInterconnectAttachmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListInterconnectAttachmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInterconnectAttachmentRequest. */ + interface IDeleteInterconnectAttachmentRequest { + + /** DeleteInterconnectAttachmentRequest interconnectAttachment */ + interconnectAttachment?: (string|null); + + /** DeleteInterconnectAttachmentRequest project */ + project?: (string|null); + + /** DeleteInterconnectAttachmentRequest region */ + region?: (string|null); + + /** DeleteInterconnectAttachmentRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInterconnectAttachmentRequest. */ + class DeleteInterconnectAttachmentRequest implements IDeleteInterconnectAttachmentRequest { + + /** + * Constructs a new DeleteInterconnectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest); + + /** DeleteInterconnectAttachmentRequest interconnectAttachment. */ + public interconnectAttachment: string; + + /** DeleteInterconnectAttachmentRequest project. */ + public project: string; + + /** DeleteInterconnectAttachmentRequest region. */ + public region: string; + + /** DeleteInterconnectAttachmentRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInterconnectAttachmentRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInterconnectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInterconnectAttachmentRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest): google.cloud.compute.v1.DeleteInterconnectAttachmentRequest; + + /** + * Encodes the specified DeleteInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectAttachmentRequest.verify|verify} messages. + * @param message DeleteInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectAttachmentRequest.verify|verify} messages. + * @param message DeleteInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInterconnectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteInterconnectAttachmentRequest; + + /** + * Decodes a DeleteInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteInterconnectAttachmentRequest; + + /** + * Verifies a DeleteInterconnectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInterconnectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteInterconnectAttachmentRequest; + + /** + * Creates a plain object from a DeleteInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @param message DeleteInterconnectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteInterconnectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInterconnectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInterconnectAttachmentRequest. */ + interface IGetInterconnectAttachmentRequest { + + /** GetInterconnectAttachmentRequest interconnectAttachment */ + interconnectAttachment?: (string|null); + + /** GetInterconnectAttachmentRequest project */ + project?: (string|null); + + /** GetInterconnectAttachmentRequest region */ + region?: (string|null); + } + + /** Represents a GetInterconnectAttachmentRequest. */ + class GetInterconnectAttachmentRequest implements IGetInterconnectAttachmentRequest { + + /** + * Constructs a new GetInterconnectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetInterconnectAttachmentRequest); + + /** GetInterconnectAttachmentRequest interconnectAttachment. */ + public interconnectAttachment: string; + + /** GetInterconnectAttachmentRequest project. */ + public project: string; + + /** GetInterconnectAttachmentRequest region. */ + public region: string; + + /** + * Creates a new GetInterconnectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInterconnectAttachmentRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetInterconnectAttachmentRequest): google.cloud.compute.v1.GetInterconnectAttachmentRequest; + + /** + * Encodes the specified GetInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectAttachmentRequest.verify|verify} messages. + * @param message GetInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectAttachmentRequest.verify|verify} messages. + * @param message GetInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInterconnectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetInterconnectAttachmentRequest; + + /** + * Decodes a GetInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetInterconnectAttachmentRequest; + + /** + * Verifies a GetInterconnectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInterconnectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetInterconnectAttachmentRequest; + + /** + * Creates a plain object from a GetInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @param message GetInterconnectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetInterconnectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInterconnectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertInterconnectAttachmentRequest. */ + interface IInsertInterconnectAttachmentRequest { + + /** InsertInterconnectAttachmentRequest interconnectAttachmentResource */ + interconnectAttachmentResource?: (google.cloud.compute.v1.IInterconnectAttachment|null); + + /** InsertInterconnectAttachmentRequest project */ + project?: (string|null); + + /** InsertInterconnectAttachmentRequest region */ + region?: (string|null); + + /** InsertInterconnectAttachmentRequest requestId */ + requestId?: (string|null); + + /** InsertInterconnectAttachmentRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an InsertInterconnectAttachmentRequest. */ + class InsertInterconnectAttachmentRequest implements IInsertInterconnectAttachmentRequest { + + /** + * Constructs a new InsertInterconnectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertInterconnectAttachmentRequest); + + /** InsertInterconnectAttachmentRequest interconnectAttachmentResource. */ + public interconnectAttachmentResource?: (google.cloud.compute.v1.IInterconnectAttachment|null); + + /** InsertInterconnectAttachmentRequest project. */ + public project: string; + + /** InsertInterconnectAttachmentRequest region. */ + public region: string; + + /** InsertInterconnectAttachmentRequest requestId. */ + public requestId?: (string|null); + + /** InsertInterconnectAttachmentRequest validateOnly. */ + public validateOnly?: (boolean|null); + + /** InsertInterconnectAttachmentRequest _requestId. */ + public _requestId?: "requestId"; + + /** InsertInterconnectAttachmentRequest _validateOnly. */ + public _validateOnly?: "validateOnly"; + + /** + * Creates a new InsertInterconnectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertInterconnectAttachmentRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertInterconnectAttachmentRequest): google.cloud.compute.v1.InsertInterconnectAttachmentRequest; + + /** + * Encodes the specified InsertInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectAttachmentRequest.verify|verify} messages. + * @param message InsertInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectAttachmentRequest.verify|verify} messages. + * @param message InsertInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertInterconnectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertInterconnectAttachmentRequest; + + /** + * Decodes an InsertInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertInterconnectAttachmentRequest; + + /** + * Verifies an InsertInterconnectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertInterconnectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertInterconnectAttachmentRequest; + + /** + * Creates a plain object from an InsertInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @param message InsertInterconnectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertInterconnectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertInterconnectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInterconnectAttachmentsRequest. */ + interface IListInterconnectAttachmentsRequest { + + /** ListInterconnectAttachmentsRequest filter */ + filter?: (string|null); + + /** ListInterconnectAttachmentsRequest maxResults */ + maxResults?: (number|null); + + /** ListInterconnectAttachmentsRequest orderBy */ + orderBy?: (string|null); + + /** ListInterconnectAttachmentsRequest pageToken */ + pageToken?: (string|null); + + /** ListInterconnectAttachmentsRequest project */ + project?: (string|null); + + /** ListInterconnectAttachmentsRequest region */ + region?: (string|null); + + /** ListInterconnectAttachmentsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListInterconnectAttachmentsRequest. */ + class ListInterconnectAttachmentsRequest implements IListInterconnectAttachmentsRequest { + + /** + * Constructs a new ListInterconnectAttachmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInterconnectAttachmentsRequest); + + /** ListInterconnectAttachmentsRequest filter. */ + public filter?: (string|null); + + /** ListInterconnectAttachmentsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInterconnectAttachmentsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInterconnectAttachmentsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInterconnectAttachmentsRequest project. */ + public project: string; + + /** ListInterconnectAttachmentsRequest region. */ + public region: string; + + /** ListInterconnectAttachmentsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInterconnectAttachmentsRequest _filter. */ + public _filter?: "filter"; + + /** ListInterconnectAttachmentsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInterconnectAttachmentsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInterconnectAttachmentsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInterconnectAttachmentsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInterconnectAttachmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterconnectAttachmentsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInterconnectAttachmentsRequest): google.cloud.compute.v1.ListInterconnectAttachmentsRequest; + + /** + * Encodes the specified ListInterconnectAttachmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectAttachmentsRequest.verify|verify} messages. + * @param message ListInterconnectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInterconnectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterconnectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectAttachmentsRequest.verify|verify} messages. + * @param message ListInterconnectAttachmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInterconnectAttachmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterconnectAttachmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInterconnectAttachmentsRequest; + + /** + * Decodes a ListInterconnectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInterconnectAttachmentsRequest; + + /** + * Verifies a ListInterconnectAttachmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterconnectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterconnectAttachmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInterconnectAttachmentsRequest; + + /** + * Creates a plain object from a ListInterconnectAttachmentsRequest message. Also converts values to other types if specified. + * @param message ListInterconnectAttachmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInterconnectAttachmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterconnectAttachmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchInterconnectAttachmentRequest. */ + interface IPatchInterconnectAttachmentRequest { + + /** PatchInterconnectAttachmentRequest interconnectAttachment */ + interconnectAttachment?: (string|null); + + /** PatchInterconnectAttachmentRequest interconnectAttachmentResource */ + interconnectAttachmentResource?: (google.cloud.compute.v1.IInterconnectAttachment|null); + + /** PatchInterconnectAttachmentRequest project */ + project?: (string|null); + + /** PatchInterconnectAttachmentRequest region */ + region?: (string|null); + + /** PatchInterconnectAttachmentRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchInterconnectAttachmentRequest. */ + class PatchInterconnectAttachmentRequest implements IPatchInterconnectAttachmentRequest { + + /** + * Constructs a new PatchInterconnectAttachmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchInterconnectAttachmentRequest); + + /** PatchInterconnectAttachmentRequest interconnectAttachment. */ + public interconnectAttachment: string; + + /** PatchInterconnectAttachmentRequest interconnectAttachmentResource. */ + public interconnectAttachmentResource?: (google.cloud.compute.v1.IInterconnectAttachment|null); + + /** PatchInterconnectAttachmentRequest project. */ + public project: string; + + /** PatchInterconnectAttachmentRequest region. */ + public region: string; + + /** PatchInterconnectAttachmentRequest requestId. */ + public requestId?: (string|null); + + /** PatchInterconnectAttachmentRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchInterconnectAttachmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchInterconnectAttachmentRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchInterconnectAttachmentRequest): google.cloud.compute.v1.PatchInterconnectAttachmentRequest; + + /** + * Encodes the specified PatchInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectAttachmentRequest.verify|verify} messages. + * @param message PatchInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectAttachmentRequest.verify|verify} messages. + * @param message PatchInterconnectAttachmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchInterconnectAttachmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchInterconnectAttachmentRequest; + + /** + * Decodes a PatchInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchInterconnectAttachmentRequest; + + /** + * Verifies a PatchInterconnectAttachmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchInterconnectAttachmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchInterconnectAttachmentRequest; + + /** + * Creates a plain object from a PatchInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @param message PatchInterconnectAttachmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchInterconnectAttachmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchInterconnectAttachmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInterconnectLocationRequest. */ + interface IGetInterconnectLocationRequest { + + /** GetInterconnectLocationRequest interconnectLocation */ + interconnectLocation?: (string|null); + + /** GetInterconnectLocationRequest project */ + project?: (string|null); + } + + /** Represents a GetInterconnectLocationRequest. */ + class GetInterconnectLocationRequest implements IGetInterconnectLocationRequest { + + /** + * Constructs a new GetInterconnectLocationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetInterconnectLocationRequest); + + /** GetInterconnectLocationRequest interconnectLocation. */ + public interconnectLocation: string; + + /** GetInterconnectLocationRequest project. */ + public project: string; + + /** + * Creates a new GetInterconnectLocationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInterconnectLocationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetInterconnectLocationRequest): google.cloud.compute.v1.GetInterconnectLocationRequest; + + /** + * Encodes the specified GetInterconnectLocationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectLocationRequest.verify|verify} messages. + * @param message GetInterconnectLocationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetInterconnectLocationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInterconnectLocationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectLocationRequest.verify|verify} messages. + * @param message GetInterconnectLocationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetInterconnectLocationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInterconnectLocationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInterconnectLocationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetInterconnectLocationRequest; + + /** + * Decodes a GetInterconnectLocationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInterconnectLocationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetInterconnectLocationRequest; + + /** + * Verifies a GetInterconnectLocationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInterconnectLocationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInterconnectLocationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetInterconnectLocationRequest; + + /** + * Creates a plain object from a GetInterconnectLocationRequest message. Also converts values to other types if specified. + * @param message GetInterconnectLocationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetInterconnectLocationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInterconnectLocationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInterconnectLocationsRequest. */ + interface IListInterconnectLocationsRequest { + + /** ListInterconnectLocationsRequest filter */ + filter?: (string|null); + + /** ListInterconnectLocationsRequest maxResults */ + maxResults?: (number|null); + + /** ListInterconnectLocationsRequest orderBy */ + orderBy?: (string|null); + + /** ListInterconnectLocationsRequest pageToken */ + pageToken?: (string|null); + + /** ListInterconnectLocationsRequest project */ + project?: (string|null); + + /** ListInterconnectLocationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListInterconnectLocationsRequest. */ + class ListInterconnectLocationsRequest implements IListInterconnectLocationsRequest { + + /** + * Constructs a new ListInterconnectLocationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInterconnectLocationsRequest); + + /** ListInterconnectLocationsRequest filter. */ + public filter?: (string|null); + + /** ListInterconnectLocationsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInterconnectLocationsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInterconnectLocationsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInterconnectLocationsRequest project. */ + public project: string; + + /** ListInterconnectLocationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInterconnectLocationsRequest _filter. */ + public _filter?: "filter"; + + /** ListInterconnectLocationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInterconnectLocationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInterconnectLocationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInterconnectLocationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInterconnectLocationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterconnectLocationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInterconnectLocationsRequest): google.cloud.compute.v1.ListInterconnectLocationsRequest; + + /** + * Encodes the specified ListInterconnectLocationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectLocationsRequest.verify|verify} messages. + * @param message ListInterconnectLocationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInterconnectLocationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterconnectLocationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectLocationsRequest.verify|verify} messages. + * @param message ListInterconnectLocationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInterconnectLocationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterconnectLocationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterconnectLocationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInterconnectLocationsRequest; + + /** + * Decodes a ListInterconnectLocationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterconnectLocationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInterconnectLocationsRequest; + + /** + * Verifies a ListInterconnectLocationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterconnectLocationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterconnectLocationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInterconnectLocationsRequest; + + /** + * Creates a plain object from a ListInterconnectLocationsRequest message. Also converts values to other types if specified. + * @param message ListInterconnectLocationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInterconnectLocationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterconnectLocationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInterconnectRequest. */ + interface IDeleteInterconnectRequest { + + /** DeleteInterconnectRequest interconnect */ + interconnect?: (string|null); + + /** DeleteInterconnectRequest project */ + project?: (string|null); + + /** DeleteInterconnectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInterconnectRequest. */ + class DeleteInterconnectRequest implements IDeleteInterconnectRequest { + + /** + * Constructs a new DeleteInterconnectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInterconnectRequest); + + /** DeleteInterconnectRequest interconnect. */ + public interconnect: string; + + /** DeleteInterconnectRequest project. */ + public project: string; + + /** DeleteInterconnectRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInterconnectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInterconnectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInterconnectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInterconnectRequest): google.cloud.compute.v1.DeleteInterconnectRequest; + + /** + * Encodes the specified DeleteInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectRequest.verify|verify} messages. + * @param message DeleteInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectRequest.verify|verify} messages. + * @param message DeleteInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInterconnectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteInterconnectRequest; + + /** + * Decodes a DeleteInterconnectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteInterconnectRequest; + + /** + * Verifies a DeleteInterconnectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInterconnectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteInterconnectRequest; + + /** + * Creates a plain object from a DeleteInterconnectRequest message. Also converts values to other types if specified. + * @param message DeleteInterconnectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteInterconnectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInterconnectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInterconnectRequest. */ + interface IGetInterconnectRequest { + + /** GetInterconnectRequest interconnect */ + interconnect?: (string|null); + + /** GetInterconnectRequest project */ + project?: (string|null); + } + + /** Represents a GetInterconnectRequest. */ + class GetInterconnectRequest implements IGetInterconnectRequest { + + /** + * Constructs a new GetInterconnectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetInterconnectRequest); + + /** GetInterconnectRequest interconnect. */ + public interconnect: string; + + /** GetInterconnectRequest project. */ + public project: string; + + /** + * Creates a new GetInterconnectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInterconnectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetInterconnectRequest): google.cloud.compute.v1.GetInterconnectRequest; + + /** + * Encodes the specified GetInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectRequest.verify|verify} messages. + * @param message GetInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectRequest.verify|verify} messages. + * @param message GetInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInterconnectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetInterconnectRequest; + + /** + * Decodes a GetInterconnectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetInterconnectRequest; + + /** + * Verifies a GetInterconnectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInterconnectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetInterconnectRequest; + + /** + * Creates a plain object from a GetInterconnectRequest message. Also converts values to other types if specified. + * @param message GetInterconnectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetInterconnectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInterconnectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetDiagnosticsInterconnectRequest. */ + interface IGetDiagnosticsInterconnectRequest { + + /** GetDiagnosticsInterconnectRequest interconnect */ + interconnect?: (string|null); + + /** GetDiagnosticsInterconnectRequest project */ + project?: (string|null); + } + + /** Represents a GetDiagnosticsInterconnectRequest. */ + class GetDiagnosticsInterconnectRequest implements IGetDiagnosticsInterconnectRequest { + + /** + * Constructs a new GetDiagnosticsInterconnectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest); + + /** GetDiagnosticsInterconnectRequest interconnect. */ + public interconnect: string; + + /** GetDiagnosticsInterconnectRequest project. */ + public project: string; + + /** + * Creates a new GetDiagnosticsInterconnectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDiagnosticsInterconnectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest): google.cloud.compute.v1.GetDiagnosticsInterconnectRequest; + + /** + * Encodes the specified GetDiagnosticsInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.GetDiagnosticsInterconnectRequest.verify|verify} messages. + * @param message GetDiagnosticsInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDiagnosticsInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetDiagnosticsInterconnectRequest.verify|verify} messages. + * @param message GetDiagnosticsInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDiagnosticsInterconnectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDiagnosticsInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetDiagnosticsInterconnectRequest; + + /** + * Decodes a GetDiagnosticsInterconnectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDiagnosticsInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetDiagnosticsInterconnectRequest; + + /** + * Verifies a GetDiagnosticsInterconnectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDiagnosticsInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDiagnosticsInterconnectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetDiagnosticsInterconnectRequest; + + /** + * Creates a plain object from a GetDiagnosticsInterconnectRequest message. Also converts values to other types if specified. + * @param message GetDiagnosticsInterconnectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetDiagnosticsInterconnectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDiagnosticsInterconnectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertInterconnectRequest. */ + interface IInsertInterconnectRequest { + + /** InsertInterconnectRequest interconnectResource */ + interconnectResource?: (google.cloud.compute.v1.IInterconnect|null); + + /** InsertInterconnectRequest project */ + project?: (string|null); + + /** InsertInterconnectRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertInterconnectRequest. */ + class InsertInterconnectRequest implements IInsertInterconnectRequest { + + /** + * Constructs a new InsertInterconnectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertInterconnectRequest); + + /** InsertInterconnectRequest interconnectResource. */ + public interconnectResource?: (google.cloud.compute.v1.IInterconnect|null); + + /** InsertInterconnectRequest project. */ + public project: string; + + /** InsertInterconnectRequest requestId. */ + public requestId?: (string|null); + + /** InsertInterconnectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertInterconnectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertInterconnectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertInterconnectRequest): google.cloud.compute.v1.InsertInterconnectRequest; + + /** + * Encodes the specified InsertInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectRequest.verify|verify} messages. + * @param message InsertInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectRequest.verify|verify} messages. + * @param message InsertInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertInterconnectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertInterconnectRequest; + + /** + * Decodes an InsertInterconnectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertInterconnectRequest; + + /** + * Verifies an InsertInterconnectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertInterconnectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertInterconnectRequest; + + /** + * Creates a plain object from an InsertInterconnectRequest message. Also converts values to other types if specified. + * @param message InsertInterconnectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertInterconnectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertInterconnectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInterconnectsRequest. */ + interface IListInterconnectsRequest { + + /** ListInterconnectsRequest filter */ + filter?: (string|null); + + /** ListInterconnectsRequest maxResults */ + maxResults?: (number|null); + + /** ListInterconnectsRequest orderBy */ + orderBy?: (string|null); + + /** ListInterconnectsRequest pageToken */ + pageToken?: (string|null); + + /** ListInterconnectsRequest project */ + project?: (string|null); + + /** ListInterconnectsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListInterconnectsRequest. */ + class ListInterconnectsRequest implements IListInterconnectsRequest { + + /** + * Constructs a new ListInterconnectsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInterconnectsRequest); + + /** ListInterconnectsRequest filter. */ + public filter?: (string|null); + + /** ListInterconnectsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInterconnectsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInterconnectsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInterconnectsRequest project. */ + public project: string; + + /** ListInterconnectsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInterconnectsRequest _filter. */ + public _filter?: "filter"; + + /** ListInterconnectsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInterconnectsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInterconnectsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInterconnectsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInterconnectsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInterconnectsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInterconnectsRequest): google.cloud.compute.v1.ListInterconnectsRequest; + + /** + * Encodes the specified ListInterconnectsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectsRequest.verify|verify} messages. + * @param message ListInterconnectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInterconnectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInterconnectsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectsRequest.verify|verify} messages. + * @param message ListInterconnectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInterconnectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInterconnectsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInterconnectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInterconnectsRequest; + + /** + * Decodes a ListInterconnectsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInterconnectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInterconnectsRequest; + + /** + * Verifies a ListInterconnectsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInterconnectsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInterconnectsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInterconnectsRequest; + + /** + * Creates a plain object from a ListInterconnectsRequest message. Also converts values to other types if specified. + * @param message ListInterconnectsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInterconnectsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInterconnectsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchInterconnectRequest. */ + interface IPatchInterconnectRequest { + + /** PatchInterconnectRequest interconnect */ + interconnect?: (string|null); + + /** PatchInterconnectRequest interconnectResource */ + interconnectResource?: (google.cloud.compute.v1.IInterconnect|null); + + /** PatchInterconnectRequest project */ + project?: (string|null); + + /** PatchInterconnectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchInterconnectRequest. */ + class PatchInterconnectRequest implements IPatchInterconnectRequest { + + /** + * Constructs a new PatchInterconnectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchInterconnectRequest); + + /** PatchInterconnectRequest interconnect. */ + public interconnect: string; + + /** PatchInterconnectRequest interconnectResource. */ + public interconnectResource?: (google.cloud.compute.v1.IInterconnect|null); + + /** PatchInterconnectRequest project. */ + public project: string; + + /** PatchInterconnectRequest requestId. */ + public requestId?: (string|null); + + /** PatchInterconnectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchInterconnectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchInterconnectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchInterconnectRequest): google.cloud.compute.v1.PatchInterconnectRequest; + + /** + * Encodes the specified PatchInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectRequest.verify|verify} messages. + * @param message PatchInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectRequest.verify|verify} messages. + * @param message PatchInterconnectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchInterconnectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchInterconnectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchInterconnectRequest; + + /** + * Decodes a PatchInterconnectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchInterconnectRequest; + + /** + * Verifies a PatchInterconnectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchInterconnectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchInterconnectRequest; + + /** + * Creates a plain object from a PatchInterconnectRequest message. Also converts values to other types if specified. + * @param message PatchInterconnectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchInterconnectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchInterconnectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetLicenseCodeRequest. */ + interface IGetLicenseCodeRequest { + + /** GetLicenseCodeRequest licenseCode */ + licenseCode?: (string|null); + + /** GetLicenseCodeRequest project */ + project?: (string|null); + } + + /** Represents a GetLicenseCodeRequest. */ + class GetLicenseCodeRequest implements IGetLicenseCodeRequest { + + /** + * Constructs a new GetLicenseCodeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetLicenseCodeRequest); + + /** GetLicenseCodeRequest licenseCode. */ + public licenseCode: string; + + /** GetLicenseCodeRequest project. */ + public project: string; + + /** + * Creates a new GetLicenseCodeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLicenseCodeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetLicenseCodeRequest): google.cloud.compute.v1.GetLicenseCodeRequest; + + /** + * Encodes the specified GetLicenseCodeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetLicenseCodeRequest.verify|verify} messages. + * @param message GetLicenseCodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetLicenseCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLicenseCodeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetLicenseCodeRequest.verify|verify} messages. + * @param message GetLicenseCodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetLicenseCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLicenseCodeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetLicenseCodeRequest; + + /** + * Decodes a GetLicenseCodeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetLicenseCodeRequest; + + /** + * Verifies a GetLicenseCodeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLicenseCodeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLicenseCodeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetLicenseCodeRequest; + + /** + * Creates a plain object from a GetLicenseCodeRequest message. Also converts values to other types if specified. + * @param message GetLicenseCodeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetLicenseCodeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLicenseCodeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsLicenseCodeRequest. */ + interface ITestIamPermissionsLicenseCodeRequest { + + /** TestIamPermissionsLicenseCodeRequest project */ + project?: (string|null); + + /** TestIamPermissionsLicenseCodeRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsLicenseCodeRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsLicenseCodeRequest. */ + class TestIamPermissionsLicenseCodeRequest implements ITestIamPermissionsLicenseCodeRequest { + + /** + * Constructs a new TestIamPermissionsLicenseCodeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest); + + /** TestIamPermissionsLicenseCodeRequest project. */ + public project: string; + + /** TestIamPermissionsLicenseCodeRequest resource. */ + public resource: string; + + /** TestIamPermissionsLicenseCodeRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsLicenseCodeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsLicenseCodeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest): google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest; + + /** + * Encodes the specified TestIamPermissionsLicenseCodeRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest.verify|verify} messages. + * @param message TestIamPermissionsLicenseCodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsLicenseCodeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest.verify|verify} messages. + * @param message TestIamPermissionsLicenseCodeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsLicenseCodeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest; + + /** + * Decodes a TestIamPermissionsLicenseCodeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest; + + /** + * Verifies a TestIamPermissionsLicenseCodeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsLicenseCodeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsLicenseCodeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest; + + /** + * Creates a plain object from a TestIamPermissionsLicenseCodeRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsLicenseCodeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsLicenseCodeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteLicenseRequest. */ + interface IDeleteLicenseRequest { + + /** DeleteLicenseRequest license */ + license?: (string|null); + + /** DeleteLicenseRequest project */ + project?: (string|null); + + /** DeleteLicenseRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteLicenseRequest. */ + class DeleteLicenseRequest implements IDeleteLicenseRequest { + + /** + * Constructs a new DeleteLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteLicenseRequest); + + /** DeleteLicenseRequest license. */ + public license: string; + + /** DeleteLicenseRequest project. */ + public project: string; + + /** DeleteLicenseRequest requestId. */ + public requestId?: (string|null); + + /** DeleteLicenseRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteLicenseRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteLicenseRequest): google.cloud.compute.v1.DeleteLicenseRequest; + + /** + * Encodes the specified DeleteLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteLicenseRequest.verify|verify} messages. + * @param message DeleteLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteLicenseRequest.verify|verify} messages. + * @param message DeleteLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteLicenseRequest; + + /** + * Decodes a DeleteLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteLicenseRequest; + + /** + * Verifies a DeleteLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteLicenseRequest; + + /** + * Creates a plain object from a DeleteLicenseRequest message. Also converts values to other types if specified. + * @param message DeleteLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetLicenseRequest. */ + interface IGetLicenseRequest { + + /** GetLicenseRequest license */ + license?: (string|null); + + /** GetLicenseRequest project */ + project?: (string|null); + } + + /** Represents a GetLicenseRequest. */ + class GetLicenseRequest implements IGetLicenseRequest { + + /** + * Constructs a new GetLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetLicenseRequest); + + /** GetLicenseRequest license. */ + public license: string; + + /** GetLicenseRequest project. */ + public project: string; + + /** + * Creates a new GetLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetLicenseRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetLicenseRequest): google.cloud.compute.v1.GetLicenseRequest; + + /** + * Encodes the specified GetLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.GetLicenseRequest.verify|verify} messages. + * @param message GetLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetLicenseRequest.verify|verify} messages. + * @param message GetLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetLicenseRequest; + + /** + * Decodes a GetLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetLicenseRequest; + + /** + * Verifies a GetLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetLicenseRequest; + + /** + * Creates a plain object from a GetLicenseRequest message. Also converts values to other types if specified. + * @param message GetLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyLicenseRequest. */ + interface IGetIamPolicyLicenseRequest { + + /** GetIamPolicyLicenseRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyLicenseRequest project */ + project?: (string|null); + + /** GetIamPolicyLicenseRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicyLicenseRequest. */ + class GetIamPolicyLicenseRequest implements IGetIamPolicyLicenseRequest { + + /** + * Constructs a new GetIamPolicyLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyLicenseRequest); + + /** GetIamPolicyLicenseRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyLicenseRequest project. */ + public project: string; + + /** GetIamPolicyLicenseRequest resource. */ + public resource: string; + + /** GetIamPolicyLicenseRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyLicenseRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyLicenseRequest): google.cloud.compute.v1.GetIamPolicyLicenseRequest; + + /** + * Encodes the specified GetIamPolicyLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyLicenseRequest.verify|verify} messages. + * @param message GetIamPolicyLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyLicenseRequest.verify|verify} messages. + * @param message GetIamPolicyLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyLicenseRequest; + + /** + * Decodes a GetIamPolicyLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyLicenseRequest; + + /** + * Verifies a GetIamPolicyLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyLicenseRequest; + + /** + * Creates a plain object from a GetIamPolicyLicenseRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertLicenseRequest. */ + interface IInsertLicenseRequest { + + /** InsertLicenseRequest licenseResource */ + licenseResource?: (google.cloud.compute.v1.ILicense|null); + + /** InsertLicenseRequest project */ + project?: (string|null); + + /** InsertLicenseRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertLicenseRequest. */ + class InsertLicenseRequest implements IInsertLicenseRequest { + + /** + * Constructs a new InsertLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertLicenseRequest); + + /** InsertLicenseRequest licenseResource. */ + public licenseResource?: (google.cloud.compute.v1.ILicense|null); + + /** InsertLicenseRequest project. */ + public project: string; + + /** InsertLicenseRequest requestId. */ + public requestId?: (string|null); + + /** InsertLicenseRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertLicenseRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertLicenseRequest): google.cloud.compute.v1.InsertLicenseRequest; + + /** + * Encodes the specified InsertLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertLicenseRequest.verify|verify} messages. + * @param message InsertLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertLicenseRequest.verify|verify} messages. + * @param message InsertLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertLicenseRequest; + + /** + * Decodes an InsertLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertLicenseRequest; + + /** + * Verifies an InsertLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertLicenseRequest; + + /** + * Creates a plain object from an InsertLicenseRequest message. Also converts values to other types if specified. + * @param message InsertLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListLicensesRequest. */ + interface IListLicensesRequest { + + /** ListLicensesRequest filter */ + filter?: (string|null); + + /** ListLicensesRequest maxResults */ + maxResults?: (number|null); + + /** ListLicensesRequest orderBy */ + orderBy?: (string|null); + + /** ListLicensesRequest pageToken */ + pageToken?: (string|null); + + /** ListLicensesRequest project */ + project?: (string|null); + + /** ListLicensesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListLicensesRequest. */ + class ListLicensesRequest implements IListLicensesRequest { + + /** + * Constructs a new ListLicensesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListLicensesRequest); + + /** ListLicensesRequest filter. */ + public filter?: (string|null); + + /** ListLicensesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListLicensesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListLicensesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListLicensesRequest project. */ + public project: string; + + /** ListLicensesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListLicensesRequest _filter. */ + public _filter?: "filter"; + + /** ListLicensesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListLicensesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListLicensesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListLicensesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListLicensesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListLicensesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListLicensesRequest): google.cloud.compute.v1.ListLicensesRequest; + + /** + * Encodes the specified ListLicensesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListLicensesRequest.verify|verify} messages. + * @param message ListLicensesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListLicensesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListLicensesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListLicensesRequest.verify|verify} messages. + * @param message ListLicensesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListLicensesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListLicensesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListLicensesRequest; + + /** + * Decodes a ListLicensesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListLicensesRequest; + + /** + * Verifies a ListLicensesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListLicensesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListLicensesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListLicensesRequest; + + /** + * Creates a plain object from a ListLicensesRequest message. Also converts values to other types if specified. + * @param message ListLicensesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListLicensesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListLicensesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyLicenseRequest. */ + interface ISetIamPolicyLicenseRequest { + + /** SetIamPolicyLicenseRequest globalSetPolicyRequestResource */ + globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicyLicenseRequest project */ + project?: (string|null); + + /** SetIamPolicyLicenseRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicyLicenseRequest. */ + class SetIamPolicyLicenseRequest implements ISetIamPolicyLicenseRequest { + + /** + * Constructs a new SetIamPolicyLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyLicenseRequest); + + /** SetIamPolicyLicenseRequest globalSetPolicyRequestResource. */ + public globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicyLicenseRequest project. */ + public project: string; + + /** SetIamPolicyLicenseRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicyLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyLicenseRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyLicenseRequest): google.cloud.compute.v1.SetIamPolicyLicenseRequest; + + /** + * Encodes the specified SetIamPolicyLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyLicenseRequest.verify|verify} messages. + * @param message SetIamPolicyLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyLicenseRequest.verify|verify} messages. + * @param message SetIamPolicyLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyLicenseRequest; + + /** + * Decodes a SetIamPolicyLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyLicenseRequest; + + /** + * Verifies a SetIamPolicyLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyLicenseRequest; + + /** + * Creates a plain object from a SetIamPolicyLicenseRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsLicenseRequest. */ + interface ITestIamPermissionsLicenseRequest { + + /** TestIamPermissionsLicenseRequest project */ + project?: (string|null); + + /** TestIamPermissionsLicenseRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsLicenseRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsLicenseRequest. */ + class TestIamPermissionsLicenseRequest implements ITestIamPermissionsLicenseRequest { + + /** + * Constructs a new TestIamPermissionsLicenseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsLicenseRequest); + + /** TestIamPermissionsLicenseRequest project. */ + public project: string; + + /** TestIamPermissionsLicenseRequest resource. */ + public resource: string; + + /** TestIamPermissionsLicenseRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsLicenseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsLicenseRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsLicenseRequest): google.cloud.compute.v1.TestIamPermissionsLicenseRequest; + + /** + * Encodes the specified TestIamPermissionsLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseRequest.verify|verify} messages. + * @param message TestIamPermissionsLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseRequest.verify|verify} messages. + * @param message TestIamPermissionsLicenseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsLicenseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsLicenseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsLicenseRequest; + + /** + * Decodes a TestIamPermissionsLicenseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsLicenseRequest; + + /** + * Verifies a TestIamPermissionsLicenseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsLicenseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsLicenseRequest; + + /** + * Creates a plain object from a TestIamPermissionsLicenseRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsLicenseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsLicenseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsLicenseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListMachineTypesRequest. */ + interface IAggregatedListMachineTypesRequest { + + /** AggregatedListMachineTypesRequest filter */ + filter?: (string|null); + + /** AggregatedListMachineTypesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListMachineTypesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListMachineTypesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListMachineTypesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListMachineTypesRequest project */ + project?: (string|null); + + /** AggregatedListMachineTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListMachineTypesRequest. */ + class AggregatedListMachineTypesRequest implements IAggregatedListMachineTypesRequest { + + /** + * Constructs a new AggregatedListMachineTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListMachineTypesRequest); + + /** AggregatedListMachineTypesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListMachineTypesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListMachineTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListMachineTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListMachineTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListMachineTypesRequest project. */ + public project: string; + + /** AggregatedListMachineTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListMachineTypesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListMachineTypesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListMachineTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListMachineTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListMachineTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListMachineTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListMachineTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListMachineTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListMachineTypesRequest): google.cloud.compute.v1.AggregatedListMachineTypesRequest; + + /** + * Encodes the specified AggregatedListMachineTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListMachineTypesRequest.verify|verify} messages. + * @param message AggregatedListMachineTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListMachineTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListMachineTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListMachineTypesRequest.verify|verify} messages. + * @param message AggregatedListMachineTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListMachineTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListMachineTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListMachineTypesRequest; + + /** + * Decodes an AggregatedListMachineTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListMachineTypesRequest; + + /** + * Verifies an AggregatedListMachineTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListMachineTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListMachineTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListMachineTypesRequest; + + /** + * Creates a plain object from an AggregatedListMachineTypesRequest message. Also converts values to other types if specified. + * @param message AggregatedListMachineTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListMachineTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListMachineTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetMachineTypeRequest. */ + interface IGetMachineTypeRequest { + + /** GetMachineTypeRequest machineType */ + machineType?: (string|null); + + /** GetMachineTypeRequest project */ + project?: (string|null); + + /** GetMachineTypeRequest zone */ + zone?: (string|null); + } + + /** Represents a GetMachineTypeRequest. */ + class GetMachineTypeRequest implements IGetMachineTypeRequest { + + /** + * Constructs a new GetMachineTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetMachineTypeRequest); + + /** GetMachineTypeRequest machineType. */ + public machineType: string; + + /** GetMachineTypeRequest project. */ + public project: string; + + /** GetMachineTypeRequest zone. */ + public zone: string; + + /** + * Creates a new GetMachineTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMachineTypeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetMachineTypeRequest): google.cloud.compute.v1.GetMachineTypeRequest; + + /** + * Encodes the specified GetMachineTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetMachineTypeRequest.verify|verify} messages. + * @param message GetMachineTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetMachineTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMachineTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetMachineTypeRequest.verify|verify} messages. + * @param message GetMachineTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetMachineTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMachineTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetMachineTypeRequest; + + /** + * Decodes a GetMachineTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetMachineTypeRequest; + + /** + * Verifies a GetMachineTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMachineTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMachineTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetMachineTypeRequest; + + /** + * Creates a plain object from a GetMachineTypeRequest message. Also converts values to other types if specified. + * @param message GetMachineTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetMachineTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMachineTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListMachineTypesRequest. */ + interface IListMachineTypesRequest { + + /** ListMachineTypesRequest filter */ + filter?: (string|null); + + /** ListMachineTypesRequest maxResults */ + maxResults?: (number|null); + + /** ListMachineTypesRequest orderBy */ + orderBy?: (string|null); + + /** ListMachineTypesRequest pageToken */ + pageToken?: (string|null); + + /** ListMachineTypesRequest project */ + project?: (string|null); + + /** ListMachineTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListMachineTypesRequest zone */ + zone?: (string|null); + } + + /** Represents a ListMachineTypesRequest. */ + class ListMachineTypesRequest implements IListMachineTypesRequest { + + /** + * Constructs a new ListMachineTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListMachineTypesRequest); + + /** ListMachineTypesRequest filter. */ + public filter?: (string|null); + + /** ListMachineTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListMachineTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListMachineTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListMachineTypesRequest project. */ + public project: string; + + /** ListMachineTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListMachineTypesRequest zone. */ + public zone: string; + + /** ListMachineTypesRequest _filter. */ + public _filter?: "filter"; + + /** ListMachineTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListMachineTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListMachineTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListMachineTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListMachineTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMachineTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListMachineTypesRequest): google.cloud.compute.v1.ListMachineTypesRequest; + + /** + * Encodes the specified ListMachineTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListMachineTypesRequest.verify|verify} messages. + * @param message ListMachineTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListMachineTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMachineTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListMachineTypesRequest.verify|verify} messages. + * @param message ListMachineTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListMachineTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMachineTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListMachineTypesRequest; + + /** + * Decodes a ListMachineTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListMachineTypesRequest; + + /** + * Verifies a ListMachineTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMachineTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMachineTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListMachineTypesRequest; + + /** + * Creates a plain object from a ListMachineTypesRequest message. Also converts values to other types if specified. + * @param message ListMachineTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListMachineTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMachineTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListNetworkEndpointGroupsRequest. */ + interface IAggregatedListNetworkEndpointGroupsRequest { + + /** AggregatedListNetworkEndpointGroupsRequest filter */ + filter?: (string|null); + + /** AggregatedListNetworkEndpointGroupsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListNetworkEndpointGroupsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListNetworkEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListNetworkEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListNetworkEndpointGroupsRequest project */ + project?: (string|null); + + /** AggregatedListNetworkEndpointGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListNetworkEndpointGroupsRequest. */ + class AggregatedListNetworkEndpointGroupsRequest implements IAggregatedListNetworkEndpointGroupsRequest { + + /** + * Constructs a new AggregatedListNetworkEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest); + + /** AggregatedListNetworkEndpointGroupsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListNetworkEndpointGroupsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListNetworkEndpointGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListNetworkEndpointGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListNetworkEndpointGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListNetworkEndpointGroupsRequest project. */ + public project: string; + + /** AggregatedListNetworkEndpointGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListNetworkEndpointGroupsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListNetworkEndpointGroupsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListNetworkEndpointGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListNetworkEndpointGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListNetworkEndpointGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListNetworkEndpointGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListNetworkEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListNetworkEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest): google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest; + + /** + * Encodes the specified AggregatedListNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message AggregatedListNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message AggregatedListNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest; + + /** + * Decodes an AggregatedListNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest; + + /** + * Verifies an AggregatedListNetworkEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListNetworkEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest; + + /** + * Creates a plain object from an AggregatedListNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message AggregatedListNetworkEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListNetworkEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttachNetworkEndpointsNetworkEndpointGroupRequest. */ + interface IAttachNetworkEndpointsNetworkEndpointGroupRequest { + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsAttachEndpointsRequestResource */ + networkEndpointGroupsAttachEndpointsRequestResource?: (google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest|null); + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest zone */ + zone?: (string|null); + } + + /** Represents an AttachNetworkEndpointsNetworkEndpointGroupRequest. */ + class AttachNetworkEndpointsNetworkEndpointGroupRequest implements IAttachNetworkEndpointsNetworkEndpointGroupRequest { + + /** + * Constructs a new AttachNetworkEndpointsNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest); + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsAttachEndpointsRequestResource. */ + public networkEndpointGroupsAttachEndpointsRequestResource?: (google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest|null); + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest project. */ + public project: string; + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest zone. */ + public zone: string; + + /** AttachNetworkEndpointsNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AttachNetworkEndpointsNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachNetworkEndpointsNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest): google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Encodes the specified AttachNetworkEndpointsNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @param message AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachNetworkEndpointsNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @param message AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Decodes an AttachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Verifies an AttachNetworkEndpointsNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachNetworkEndpointsNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachNetworkEndpointsNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Creates a plain object from an AttachNetworkEndpointsNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message AttachNetworkEndpointsNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachNetworkEndpointsNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteNetworkEndpointGroupRequest. */ + interface IDeleteNetworkEndpointGroupRequest { + + /** DeleteNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** DeleteNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** DeleteNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + + /** DeleteNetworkEndpointGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteNetworkEndpointGroupRequest. */ + class DeleteNetworkEndpointGroupRequest implements IDeleteNetworkEndpointGroupRequest { + + /** + * Constructs a new DeleteNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest); + + /** DeleteNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** DeleteNetworkEndpointGroupRequest project. */ + public project: string; + + /** DeleteNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** DeleteNetworkEndpointGroupRequest zone. */ + public zone: string; + + /** DeleteNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest): google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest; + + /** + * Encodes the specified DeleteNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DeleteNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DeleteNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest; + + /** + * Decodes a DeleteNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest; + + /** + * Verifies a DeleteNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a DeleteNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message DeleteNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetachNetworkEndpointsNetworkEndpointGroupRequest. */ + interface IDetachNetworkEndpointsNetworkEndpointGroupRequest { + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsDetachEndpointsRequestResource */ + networkEndpointGroupsDetachEndpointsRequestResource?: (google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest|null); + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a DetachNetworkEndpointsNetworkEndpointGroupRequest. */ + class DetachNetworkEndpointsNetworkEndpointGroupRequest implements IDetachNetworkEndpointsNetworkEndpointGroupRequest { + + /** + * Constructs a new DetachNetworkEndpointsNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest); + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsDetachEndpointsRequestResource. */ + public networkEndpointGroupsDetachEndpointsRequestResource?: (google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest|null); + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest project. */ + public project: string; + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest zone. */ + public zone: string; + + /** DetachNetworkEndpointsNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DetachNetworkEndpointsNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetachNetworkEndpointsNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest): google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Encodes the specified DetachNetworkEndpointsNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetachNetworkEndpointsNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Decodes a DetachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Verifies a DetachNetworkEndpointsNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetachNetworkEndpointsNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetachNetworkEndpointsNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a DetachNetworkEndpointsNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message DetachNetworkEndpointsNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetachNetworkEndpointsNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNetworkEndpointGroupRequest. */ + interface IGetNetworkEndpointGroupRequest { + + /** GetNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** GetNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** GetNetworkEndpointGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a GetNetworkEndpointGroupRequest. */ + class GetNetworkEndpointGroupRequest implements IGetNetworkEndpointGroupRequest { + + /** + * Constructs a new GetNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetNetworkEndpointGroupRequest); + + /** GetNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** GetNetworkEndpointGroupRequest project. */ + public project: string; + + /** GetNetworkEndpointGroupRequest zone. */ + public zone: string; + + /** + * Creates a new GetNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetNetworkEndpointGroupRequest): google.cloud.compute.v1.GetNetworkEndpointGroupRequest; + + /** + * Encodes the specified GetNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNetworkEndpointGroupRequest.verify|verify} messages. + * @param message GetNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNetworkEndpointGroupRequest.verify|verify} messages. + * @param message GetNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetNetworkEndpointGroupRequest; + + /** + * Decodes a GetNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetNetworkEndpointGroupRequest; + + /** + * Verifies a GetNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a GetNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message GetNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertNetworkEndpointGroupRequest. */ + interface IInsertNetworkEndpointGroupRequest { + + /** InsertNetworkEndpointGroupRequest networkEndpointGroupResource */ + networkEndpointGroupResource?: (google.cloud.compute.v1.INetworkEndpointGroup|null); + + /** InsertNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** InsertNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + + /** InsertNetworkEndpointGroupRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertNetworkEndpointGroupRequest. */ + class InsertNetworkEndpointGroupRequest implements IInsertNetworkEndpointGroupRequest { + + /** + * Constructs a new InsertNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest); + + /** InsertNetworkEndpointGroupRequest networkEndpointGroupResource. */ + public networkEndpointGroupResource?: (google.cloud.compute.v1.INetworkEndpointGroup|null); + + /** InsertNetworkEndpointGroupRequest project. */ + public project: string; + + /** InsertNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** InsertNetworkEndpointGroupRequest zone. */ + public zone: string; + + /** InsertNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest): google.cloud.compute.v1.InsertNetworkEndpointGroupRequest; + + /** + * Encodes the specified InsertNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkEndpointGroupRequest.verify|verify} messages. + * @param message InsertNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkEndpointGroupRequest.verify|verify} messages. + * @param message InsertNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertNetworkEndpointGroupRequest; + + /** + * Decodes an InsertNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertNetworkEndpointGroupRequest; + + /** + * Verifies an InsertNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertNetworkEndpointGroupRequest; + + /** + * Creates a plain object from an InsertNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message InsertNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNetworkEndpointGroupsRequest. */ + interface IListNetworkEndpointGroupsRequest { + + /** ListNetworkEndpointGroupsRequest filter */ + filter?: (string|null); + + /** ListNetworkEndpointGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListNetworkEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListNetworkEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListNetworkEndpointGroupsRequest project */ + project?: (string|null); + + /** ListNetworkEndpointGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListNetworkEndpointGroupsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListNetworkEndpointGroupsRequest. */ + class ListNetworkEndpointGroupsRequest implements IListNetworkEndpointGroupsRequest { + + /** + * Constructs a new ListNetworkEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNetworkEndpointGroupsRequest); + + /** ListNetworkEndpointGroupsRequest filter. */ + public filter?: (string|null); + + /** ListNetworkEndpointGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNetworkEndpointGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNetworkEndpointGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNetworkEndpointGroupsRequest project. */ + public project: string; + + /** ListNetworkEndpointGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNetworkEndpointGroupsRequest zone. */ + public zone: string; + + /** ListNetworkEndpointGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListNetworkEndpointGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNetworkEndpointGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNetworkEndpointGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNetworkEndpointGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNetworkEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNetworkEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNetworkEndpointGroupsRequest): google.cloud.compute.v1.ListNetworkEndpointGroupsRequest; + + /** + * Encodes the specified ListNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNetworkEndpointGroupsRequest; + + /** + * Decodes a ListNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNetworkEndpointGroupsRequest; + + /** + * Verifies a ListNetworkEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNetworkEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNetworkEndpointGroupsRequest; + + /** + * Creates a plain object from a ListNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message ListNetworkEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNetworkEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNetworkEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNetworkEndpointsNetworkEndpointGroupsRequest. */ + interface IListNetworkEndpointsNetworkEndpointGroupsRequest { + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest filter */ + filter?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroupsListEndpointsRequestResource */ + networkEndpointGroupsListEndpointsRequestResource?: (google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest project */ + project?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListNetworkEndpointsNetworkEndpointGroupsRequest. */ + class ListNetworkEndpointsNetworkEndpointGroupsRequest implements IListNetworkEndpointsNetworkEndpointGroupsRequest { + + /** + * Constructs a new ListNetworkEndpointsNetworkEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest filter. */ + public filter?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroupsListEndpointsRequestResource. */ + public networkEndpointGroupsListEndpointsRequestResource?: (google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest project. */ + public project: string; + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest zone. */ + public zone: string; + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNetworkEndpointsNetworkEndpointGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNetworkEndpointsNetworkEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNetworkEndpointsNetworkEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest): google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest; + + /** + * Encodes the specified ListNetworkEndpointsNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNetworkEndpointsNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNetworkEndpointsNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNetworkEndpointsNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest; + + /** + * Decodes a ListNetworkEndpointsNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNetworkEndpointsNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest; + + /** + * Verifies a ListNetworkEndpointsNetworkEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNetworkEndpointsNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNetworkEndpointsNetworkEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest; + + /** + * Creates a plain object from a ListNetworkEndpointsNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message ListNetworkEndpointsNetworkEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNetworkEndpointsNetworkEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsNetworkEndpointGroupRequest. */ + interface ITestIamPermissionsNetworkEndpointGroupRequest { + + /** TestIamPermissionsNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** TestIamPermissionsNetworkEndpointGroupRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsNetworkEndpointGroupRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsNetworkEndpointGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a TestIamPermissionsNetworkEndpointGroupRequest. */ + class TestIamPermissionsNetworkEndpointGroupRequest implements ITestIamPermissionsNetworkEndpointGroupRequest { + + /** + * Constructs a new TestIamPermissionsNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest); + + /** TestIamPermissionsNetworkEndpointGroupRequest project. */ + public project: string; + + /** TestIamPermissionsNetworkEndpointGroupRequest resource. */ + public resource: string; + + /** TestIamPermissionsNetworkEndpointGroupRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsNetworkEndpointGroupRequest zone. */ + public zone: string; + + /** + * Creates a new TestIamPermissionsNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest): google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest; + + /** + * Encodes the specified TestIamPermissionsNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest.verify|verify} messages. + * @param message TestIamPermissionsNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest.verify|verify} messages. + * @param message TestIamPermissionsNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest; + + /** + * Decodes a TestIamPermissionsNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest; + + /** + * Verifies a TestIamPermissionsNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a TestIamPermissionsNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddPeeringNetworkRequest. */ + interface IAddPeeringNetworkRequest { + + /** AddPeeringNetworkRequest network */ + network?: (string|null); + + /** AddPeeringNetworkRequest networksAddPeeringRequestResource */ + networksAddPeeringRequestResource?: (google.cloud.compute.v1.INetworksAddPeeringRequest|null); + + /** AddPeeringNetworkRequest project */ + project?: (string|null); + + /** AddPeeringNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AddPeeringNetworkRequest. */ + class AddPeeringNetworkRequest implements IAddPeeringNetworkRequest { + + /** + * Constructs a new AddPeeringNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddPeeringNetworkRequest); + + /** AddPeeringNetworkRequest network. */ + public network: string; + + /** AddPeeringNetworkRequest networksAddPeeringRequestResource. */ + public networksAddPeeringRequestResource?: (google.cloud.compute.v1.INetworksAddPeeringRequest|null); + + /** AddPeeringNetworkRequest project. */ + public project: string; + + /** AddPeeringNetworkRequest requestId. */ + public requestId?: (string|null); + + /** AddPeeringNetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddPeeringNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddPeeringNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddPeeringNetworkRequest): google.cloud.compute.v1.AddPeeringNetworkRequest; + + /** + * Encodes the specified AddPeeringNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.AddPeeringNetworkRequest.verify|verify} messages. + * @param message AddPeeringNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddPeeringNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddPeeringNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddPeeringNetworkRequest.verify|verify} messages. + * @param message AddPeeringNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddPeeringNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddPeeringNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddPeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddPeeringNetworkRequest; + + /** + * Decodes an AddPeeringNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddPeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddPeeringNetworkRequest; + + /** + * Verifies an AddPeeringNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddPeeringNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddPeeringNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddPeeringNetworkRequest; + + /** + * Creates a plain object from an AddPeeringNetworkRequest message. Also converts values to other types if specified. + * @param message AddPeeringNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddPeeringNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddPeeringNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteNetworkRequest. */ + interface IDeleteNetworkRequest { + + /** DeleteNetworkRequest network */ + network?: (string|null); + + /** DeleteNetworkRequest project */ + project?: (string|null); + + /** DeleteNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteNetworkRequest. */ + class DeleteNetworkRequest implements IDeleteNetworkRequest { + + /** + * Constructs a new DeleteNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteNetworkRequest); + + /** DeleteNetworkRequest network. */ + public network: string; + + /** DeleteNetworkRequest project. */ + public project: string; + + /** DeleteNetworkRequest requestId. */ + public requestId?: (string|null); + + /** DeleteNetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteNetworkRequest): google.cloud.compute.v1.DeleteNetworkRequest; + + /** + * Encodes the specified DeleteNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkRequest.verify|verify} messages. + * @param message DeleteNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkRequest.verify|verify} messages. + * @param message DeleteNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteNetworkRequest; + + /** + * Decodes a DeleteNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteNetworkRequest; + + /** + * Verifies a DeleteNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteNetworkRequest; + + /** + * Creates a plain object from a DeleteNetworkRequest message. Also converts values to other types if specified. + * @param message DeleteNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNetworkRequest. */ + interface IGetNetworkRequest { + + /** GetNetworkRequest network */ + network?: (string|null); + + /** GetNetworkRequest project */ + project?: (string|null); + } + + /** Represents a GetNetworkRequest. */ + class GetNetworkRequest implements IGetNetworkRequest { + + /** + * Constructs a new GetNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetNetworkRequest); + + /** GetNetworkRequest network. */ + public network: string; + + /** GetNetworkRequest project. */ + public project: string; + + /** + * Creates a new GetNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetNetworkRequest): google.cloud.compute.v1.GetNetworkRequest; + + /** + * Encodes the specified GetNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNetworkRequest.verify|verify} messages. + * @param message GetNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNetworkRequest.verify|verify} messages. + * @param message GetNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetNetworkRequest; + + /** + * Decodes a GetNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetNetworkRequest; + + /** + * Verifies a GetNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetNetworkRequest; + + /** + * Creates a plain object from a GetNetworkRequest message. Also converts values to other types if specified. + * @param message GetNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetEffectiveFirewallsNetworkRequest. */ + interface IGetEffectiveFirewallsNetworkRequest { + + /** GetEffectiveFirewallsNetworkRequest network */ + network?: (string|null); + + /** GetEffectiveFirewallsNetworkRequest project */ + project?: (string|null); + } + + /** Represents a GetEffectiveFirewallsNetworkRequest. */ + class GetEffectiveFirewallsNetworkRequest implements IGetEffectiveFirewallsNetworkRequest { + + /** + * Constructs a new GetEffectiveFirewallsNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest); + + /** GetEffectiveFirewallsNetworkRequest network. */ + public network: string; + + /** GetEffectiveFirewallsNetworkRequest project. */ + public project: string; + + /** + * Creates a new GetEffectiveFirewallsNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEffectiveFirewallsNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest): google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest; + + /** + * Encodes the specified GetEffectiveFirewallsNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest.verify|verify} messages. + * @param message GetEffectiveFirewallsNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetEffectiveFirewallsNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest.verify|verify} messages. + * @param message GetEffectiveFirewallsNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetEffectiveFirewallsNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEffectiveFirewallsNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest; + + /** + * Decodes a GetEffectiveFirewallsNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEffectiveFirewallsNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest; + + /** + * Verifies a GetEffectiveFirewallsNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetEffectiveFirewallsNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEffectiveFirewallsNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest; + + /** + * Creates a plain object from a GetEffectiveFirewallsNetworkRequest message. Also converts values to other types if specified. + * @param message GetEffectiveFirewallsNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetEffectiveFirewallsNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertNetworkRequest. */ + interface IInsertNetworkRequest { + + /** InsertNetworkRequest networkResource */ + networkResource?: (google.cloud.compute.v1.INetwork|null); + + /** InsertNetworkRequest project */ + project?: (string|null); + + /** InsertNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertNetworkRequest. */ + class InsertNetworkRequest implements IInsertNetworkRequest { + + /** + * Constructs a new InsertNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertNetworkRequest); + + /** InsertNetworkRequest networkResource. */ + public networkResource?: (google.cloud.compute.v1.INetwork|null); + + /** InsertNetworkRequest project. */ + public project: string; + + /** InsertNetworkRequest requestId. */ + public requestId?: (string|null); + + /** InsertNetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertNetworkRequest): google.cloud.compute.v1.InsertNetworkRequest; + + /** + * Encodes the specified InsertNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkRequest.verify|verify} messages. + * @param message InsertNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkRequest.verify|verify} messages. + * @param message InsertNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertNetworkRequest; + + /** + * Decodes an InsertNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertNetworkRequest; + + /** + * Verifies an InsertNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertNetworkRequest; + + /** + * Creates a plain object from an InsertNetworkRequest message. Also converts values to other types if specified. + * @param message InsertNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNetworksRequest. */ + interface IListNetworksRequest { + + /** ListNetworksRequest filter */ + filter?: (string|null); + + /** ListNetworksRequest maxResults */ + maxResults?: (number|null); + + /** ListNetworksRequest orderBy */ + orderBy?: (string|null); + + /** ListNetworksRequest pageToken */ + pageToken?: (string|null); + + /** ListNetworksRequest project */ + project?: (string|null); + + /** ListNetworksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListNetworksRequest. */ + class ListNetworksRequest implements IListNetworksRequest { + + /** + * Constructs a new ListNetworksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNetworksRequest); + + /** ListNetworksRequest filter. */ + public filter?: (string|null); + + /** ListNetworksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNetworksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNetworksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNetworksRequest project. */ + public project: string; + + /** ListNetworksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNetworksRequest _filter. */ + public _filter?: "filter"; + + /** ListNetworksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNetworksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNetworksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNetworksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNetworksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNetworksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNetworksRequest): google.cloud.compute.v1.ListNetworksRequest; + + /** + * Encodes the specified ListNetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworksRequest.verify|verify} messages. + * @param message ListNetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworksRequest.verify|verify} messages. + * @param message ListNetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNetworksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNetworksRequest; + + /** + * Decodes a ListNetworksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNetworksRequest; + + /** + * Verifies a ListNetworksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNetworksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNetworksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNetworksRequest; + + /** + * Creates a plain object from a ListNetworksRequest message. Also converts values to other types if specified. + * @param message ListNetworksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNetworksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNetworksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPeeringRoutesNetworksRequest. */ + interface IListPeeringRoutesNetworksRequest { + + /** ListPeeringRoutesNetworksRequest direction */ + direction?: (google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction|keyof typeof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction|null); + + /** ListPeeringRoutesNetworksRequest filter */ + filter?: (string|null); + + /** ListPeeringRoutesNetworksRequest maxResults */ + maxResults?: (number|null); + + /** ListPeeringRoutesNetworksRequest network */ + network?: (string|null); + + /** ListPeeringRoutesNetworksRequest orderBy */ + orderBy?: (string|null); + + /** ListPeeringRoutesNetworksRequest pageToken */ + pageToken?: (string|null); + + /** ListPeeringRoutesNetworksRequest peeringName */ + peeringName?: (string|null); + + /** ListPeeringRoutesNetworksRequest project */ + project?: (string|null); + + /** ListPeeringRoutesNetworksRequest region */ + region?: (string|null); + + /** ListPeeringRoutesNetworksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListPeeringRoutesNetworksRequest. */ + class ListPeeringRoutesNetworksRequest implements IListPeeringRoutesNetworksRequest { + + /** + * Constructs a new ListPeeringRoutesNetworksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListPeeringRoutesNetworksRequest); + + /** ListPeeringRoutesNetworksRequest direction. */ + public direction?: (google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction|keyof typeof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction|null); + + /** ListPeeringRoutesNetworksRequest filter. */ + public filter?: (string|null); + + /** ListPeeringRoutesNetworksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListPeeringRoutesNetworksRequest network. */ + public network: string; + + /** ListPeeringRoutesNetworksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListPeeringRoutesNetworksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListPeeringRoutesNetworksRequest peeringName. */ + public peeringName?: (string|null); + + /** ListPeeringRoutesNetworksRequest project. */ + public project: string; + + /** ListPeeringRoutesNetworksRequest region. */ + public region?: (string|null); + + /** ListPeeringRoutesNetworksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListPeeringRoutesNetworksRequest _direction. */ + public _direction?: "direction"; + + /** ListPeeringRoutesNetworksRequest _filter. */ + public _filter?: "filter"; + + /** ListPeeringRoutesNetworksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListPeeringRoutesNetworksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListPeeringRoutesNetworksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListPeeringRoutesNetworksRequest _peeringName. */ + public _peeringName?: "peeringName"; + + /** ListPeeringRoutesNetworksRequest _region. */ + public _region?: "region"; + + /** ListPeeringRoutesNetworksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListPeeringRoutesNetworksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPeeringRoutesNetworksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListPeeringRoutesNetworksRequest): google.cloud.compute.v1.ListPeeringRoutesNetworksRequest; + + /** + * Encodes the specified ListPeeringRoutesNetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.verify|verify} messages. + * @param message ListPeeringRoutesNetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPeeringRoutesNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.verify|verify} messages. + * @param message ListPeeringRoutesNetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPeeringRoutesNetworksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPeeringRoutesNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListPeeringRoutesNetworksRequest; + + /** + * Decodes a ListPeeringRoutesNetworksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPeeringRoutesNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListPeeringRoutesNetworksRequest; + + /** + * Verifies a ListPeeringRoutesNetworksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPeeringRoutesNetworksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPeeringRoutesNetworksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListPeeringRoutesNetworksRequest; + + /** + * Creates a plain object from a ListPeeringRoutesNetworksRequest message. Also converts values to other types if specified. + * @param message ListPeeringRoutesNetworksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListPeeringRoutesNetworksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPeeringRoutesNetworksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListPeeringRoutesNetworksRequest { + + /** Direction enum. */ + enum Direction { + UNDEFINED_DIRECTION = 0, + INCOMING = 338552870, + OUTGOING = 307438444 + } + } + + /** Properties of a PatchNetworkRequest. */ + interface IPatchNetworkRequest { + + /** PatchNetworkRequest network */ + network?: (string|null); + + /** PatchNetworkRequest networkResource */ + networkResource?: (google.cloud.compute.v1.INetwork|null); + + /** PatchNetworkRequest project */ + project?: (string|null); + + /** PatchNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchNetworkRequest. */ + class PatchNetworkRequest implements IPatchNetworkRequest { + + /** + * Constructs a new PatchNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchNetworkRequest); + + /** PatchNetworkRequest network. */ + public network: string; + + /** PatchNetworkRequest networkResource. */ + public networkResource?: (google.cloud.compute.v1.INetwork|null); + + /** PatchNetworkRequest project. */ + public project: string; + + /** PatchNetworkRequest requestId. */ + public requestId?: (string|null); + + /** PatchNetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchNetworkRequest): google.cloud.compute.v1.PatchNetworkRequest; + + /** + * Encodes the specified PatchNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchNetworkRequest.verify|verify} messages. + * @param message PatchNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchNetworkRequest.verify|verify} messages. + * @param message PatchNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchNetworkRequest; + + /** + * Decodes a PatchNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchNetworkRequest; + + /** + * Verifies a PatchNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchNetworkRequest; + + /** + * Creates a plain object from a PatchNetworkRequest message. Also converts values to other types if specified. + * @param message PatchNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemovePeeringNetworkRequest. */ + interface IRemovePeeringNetworkRequest { + + /** RemovePeeringNetworkRequest network */ + network?: (string|null); + + /** RemovePeeringNetworkRequest networksRemovePeeringRequestResource */ + networksRemovePeeringRequestResource?: (google.cloud.compute.v1.INetworksRemovePeeringRequest|null); + + /** RemovePeeringNetworkRequest project */ + project?: (string|null); + + /** RemovePeeringNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RemovePeeringNetworkRequest. */ + class RemovePeeringNetworkRequest implements IRemovePeeringNetworkRequest { + + /** + * Constructs a new RemovePeeringNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemovePeeringNetworkRequest); + + /** RemovePeeringNetworkRequest network. */ + public network: string; + + /** RemovePeeringNetworkRequest networksRemovePeeringRequestResource. */ + public networksRemovePeeringRequestResource?: (google.cloud.compute.v1.INetworksRemovePeeringRequest|null); + + /** RemovePeeringNetworkRequest project. */ + public project: string; + + /** RemovePeeringNetworkRequest requestId. */ + public requestId?: (string|null); + + /** RemovePeeringNetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemovePeeringNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemovePeeringNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemovePeeringNetworkRequest): google.cloud.compute.v1.RemovePeeringNetworkRequest; + + /** + * Encodes the specified RemovePeeringNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.RemovePeeringNetworkRequest.verify|verify} messages. + * @param message RemovePeeringNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemovePeeringNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemovePeeringNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemovePeeringNetworkRequest.verify|verify} messages. + * @param message RemovePeeringNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemovePeeringNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemovePeeringNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemovePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemovePeeringNetworkRequest; + + /** + * Decodes a RemovePeeringNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemovePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemovePeeringNetworkRequest; + + /** + * Verifies a RemovePeeringNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemovePeeringNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemovePeeringNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemovePeeringNetworkRequest; + + /** + * Creates a plain object from a RemovePeeringNetworkRequest message. Also converts values to other types if specified. + * @param message RemovePeeringNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemovePeeringNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemovePeeringNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SwitchToCustomModeNetworkRequest. */ + interface ISwitchToCustomModeNetworkRequest { + + /** SwitchToCustomModeNetworkRequest network */ + network?: (string|null); + + /** SwitchToCustomModeNetworkRequest project */ + project?: (string|null); + + /** SwitchToCustomModeNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SwitchToCustomModeNetworkRequest. */ + class SwitchToCustomModeNetworkRequest implements ISwitchToCustomModeNetworkRequest { + + /** + * Constructs a new SwitchToCustomModeNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest); + + /** SwitchToCustomModeNetworkRequest network. */ + public network: string; + + /** SwitchToCustomModeNetworkRequest project. */ + public project: string; + + /** SwitchToCustomModeNetworkRequest requestId. */ + public requestId?: (string|null); + + /** SwitchToCustomModeNetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SwitchToCustomModeNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SwitchToCustomModeNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest): google.cloud.compute.v1.SwitchToCustomModeNetworkRequest; + + /** + * Encodes the specified SwitchToCustomModeNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.SwitchToCustomModeNetworkRequest.verify|verify} messages. + * @param message SwitchToCustomModeNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SwitchToCustomModeNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SwitchToCustomModeNetworkRequest.verify|verify} messages. + * @param message SwitchToCustomModeNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SwitchToCustomModeNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SwitchToCustomModeNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SwitchToCustomModeNetworkRequest; + + /** + * Decodes a SwitchToCustomModeNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SwitchToCustomModeNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SwitchToCustomModeNetworkRequest; + + /** + * Verifies a SwitchToCustomModeNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SwitchToCustomModeNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SwitchToCustomModeNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SwitchToCustomModeNetworkRequest; + + /** + * Creates a plain object from a SwitchToCustomModeNetworkRequest message. Also converts values to other types if specified. + * @param message SwitchToCustomModeNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SwitchToCustomModeNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SwitchToCustomModeNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdatePeeringNetworkRequest. */ + interface IUpdatePeeringNetworkRequest { + + /** UpdatePeeringNetworkRequest network */ + network?: (string|null); + + /** UpdatePeeringNetworkRequest networksUpdatePeeringRequestResource */ + networksUpdatePeeringRequestResource?: (google.cloud.compute.v1.INetworksUpdatePeeringRequest|null); + + /** UpdatePeeringNetworkRequest project */ + project?: (string|null); + + /** UpdatePeeringNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdatePeeringNetworkRequest. */ + class UpdatePeeringNetworkRequest implements IUpdatePeeringNetworkRequest { + + /** + * Constructs a new UpdatePeeringNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdatePeeringNetworkRequest); + + /** UpdatePeeringNetworkRequest network. */ + public network: string; + + /** UpdatePeeringNetworkRequest networksUpdatePeeringRequestResource. */ + public networksUpdatePeeringRequestResource?: (google.cloud.compute.v1.INetworksUpdatePeeringRequest|null); + + /** UpdatePeeringNetworkRequest project. */ + public project: string; + + /** UpdatePeeringNetworkRequest requestId. */ + public requestId?: (string|null); + + /** UpdatePeeringNetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdatePeeringNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePeeringNetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdatePeeringNetworkRequest): google.cloud.compute.v1.UpdatePeeringNetworkRequest; + + /** + * Encodes the specified UpdatePeeringNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdatePeeringNetworkRequest.verify|verify} messages. + * @param message UpdatePeeringNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdatePeeringNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePeeringNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdatePeeringNetworkRequest.verify|verify} messages. + * @param message UpdatePeeringNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdatePeeringNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePeeringNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdatePeeringNetworkRequest; + + /** + * Decodes an UpdatePeeringNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdatePeeringNetworkRequest; + + /** + * Verifies an UpdatePeeringNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePeeringNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePeeringNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdatePeeringNetworkRequest; + + /** + * Creates a plain object from an UpdatePeeringNetworkRequest message. Also converts values to other types if specified. + * @param message UpdatePeeringNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdatePeeringNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePeeringNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddNodesNodeGroupRequest. */ + interface IAddNodesNodeGroupRequest { + + /** AddNodesNodeGroupRequest nodeGroup */ + nodeGroup?: (string|null); + + /** AddNodesNodeGroupRequest nodeGroupsAddNodesRequestResource */ + nodeGroupsAddNodesRequestResource?: (google.cloud.compute.v1.INodeGroupsAddNodesRequest|null); + + /** AddNodesNodeGroupRequest project */ + project?: (string|null); + + /** AddNodesNodeGroupRequest requestId */ + requestId?: (string|null); + + /** AddNodesNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents an AddNodesNodeGroupRequest. */ + class AddNodesNodeGroupRequest implements IAddNodesNodeGroupRequest { + + /** + * Constructs a new AddNodesNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddNodesNodeGroupRequest); + + /** AddNodesNodeGroupRequest nodeGroup. */ + public nodeGroup: string; + + /** AddNodesNodeGroupRequest nodeGroupsAddNodesRequestResource. */ + public nodeGroupsAddNodesRequestResource?: (google.cloud.compute.v1.INodeGroupsAddNodesRequest|null); + + /** AddNodesNodeGroupRequest project. */ + public project: string; + + /** AddNodesNodeGroupRequest requestId. */ + public requestId?: (string|null); + + /** AddNodesNodeGroupRequest zone. */ + public zone: string; + + /** AddNodesNodeGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddNodesNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddNodesNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddNodesNodeGroupRequest): google.cloud.compute.v1.AddNodesNodeGroupRequest; + + /** + * Encodes the specified AddNodesNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AddNodesNodeGroupRequest.verify|verify} messages. + * @param message AddNodesNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddNodesNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddNodesNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddNodesNodeGroupRequest.verify|verify} messages. + * @param message AddNodesNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddNodesNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddNodesNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddNodesNodeGroupRequest; + + /** + * Decodes an AddNodesNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddNodesNodeGroupRequest; + + /** + * Verifies an AddNodesNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddNodesNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddNodesNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddNodesNodeGroupRequest; + + /** + * Creates a plain object from an AddNodesNodeGroupRequest message. Also converts values to other types if specified. + * @param message AddNodesNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddNodesNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddNodesNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListNodeGroupsRequest. */ + interface IAggregatedListNodeGroupsRequest { + + /** AggregatedListNodeGroupsRequest filter */ + filter?: (string|null); + + /** AggregatedListNodeGroupsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListNodeGroupsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListNodeGroupsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListNodeGroupsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListNodeGroupsRequest project */ + project?: (string|null); + + /** AggregatedListNodeGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListNodeGroupsRequest. */ + class AggregatedListNodeGroupsRequest implements IAggregatedListNodeGroupsRequest { + + /** + * Constructs a new AggregatedListNodeGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListNodeGroupsRequest); + + /** AggregatedListNodeGroupsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListNodeGroupsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListNodeGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListNodeGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListNodeGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListNodeGroupsRequest project. */ + public project: string; + + /** AggregatedListNodeGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListNodeGroupsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListNodeGroupsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListNodeGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListNodeGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListNodeGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListNodeGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListNodeGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListNodeGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListNodeGroupsRequest): google.cloud.compute.v1.AggregatedListNodeGroupsRequest; + + /** + * Encodes the specified AggregatedListNodeGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeGroupsRequest.verify|verify} messages. + * @param message AggregatedListNodeGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListNodeGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListNodeGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeGroupsRequest.verify|verify} messages. + * @param message AggregatedListNodeGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListNodeGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListNodeGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListNodeGroupsRequest; + + /** + * Decodes an AggregatedListNodeGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListNodeGroupsRequest; + + /** + * Verifies an AggregatedListNodeGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListNodeGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListNodeGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListNodeGroupsRequest; + + /** + * Creates a plain object from an AggregatedListNodeGroupsRequest message. Also converts values to other types if specified. + * @param message AggregatedListNodeGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListNodeGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListNodeGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteNodeGroupRequest. */ + interface IDeleteNodeGroupRequest { + + /** DeleteNodeGroupRequest nodeGroup */ + nodeGroup?: (string|null); + + /** DeleteNodeGroupRequest project */ + project?: (string|null); + + /** DeleteNodeGroupRequest requestId */ + requestId?: (string|null); + + /** DeleteNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteNodeGroupRequest. */ + class DeleteNodeGroupRequest implements IDeleteNodeGroupRequest { + + /** + * Constructs a new DeleteNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteNodeGroupRequest); + + /** DeleteNodeGroupRequest nodeGroup. */ + public nodeGroup: string; + + /** DeleteNodeGroupRequest project. */ + public project: string; + + /** DeleteNodeGroupRequest requestId. */ + public requestId?: (string|null); + + /** DeleteNodeGroupRequest zone. */ + public zone: string; + + /** DeleteNodeGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteNodeGroupRequest): google.cloud.compute.v1.DeleteNodeGroupRequest; + + /** + * Encodes the specified DeleteNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeGroupRequest.verify|verify} messages. + * @param message DeleteNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeGroupRequest.verify|verify} messages. + * @param message DeleteNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteNodeGroupRequest; + + /** + * Decodes a DeleteNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteNodeGroupRequest; + + /** + * Verifies a DeleteNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteNodeGroupRequest; + + /** + * Creates a plain object from a DeleteNodeGroupRequest message. Also converts values to other types if specified. + * @param message DeleteNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteNodesNodeGroupRequest. */ + interface IDeleteNodesNodeGroupRequest { + + /** DeleteNodesNodeGroupRequest nodeGroup */ + nodeGroup?: (string|null); + + /** DeleteNodesNodeGroupRequest nodeGroupsDeleteNodesRequestResource */ + nodeGroupsDeleteNodesRequestResource?: (google.cloud.compute.v1.INodeGroupsDeleteNodesRequest|null); + + /** DeleteNodesNodeGroupRequest project */ + project?: (string|null); + + /** DeleteNodesNodeGroupRequest requestId */ + requestId?: (string|null); + + /** DeleteNodesNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteNodesNodeGroupRequest. */ + class DeleteNodesNodeGroupRequest implements IDeleteNodesNodeGroupRequest { + + /** + * Constructs a new DeleteNodesNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteNodesNodeGroupRequest); + + /** DeleteNodesNodeGroupRequest nodeGroup. */ + public nodeGroup: string; + + /** DeleteNodesNodeGroupRequest nodeGroupsDeleteNodesRequestResource. */ + public nodeGroupsDeleteNodesRequestResource?: (google.cloud.compute.v1.INodeGroupsDeleteNodesRequest|null); + + /** DeleteNodesNodeGroupRequest project. */ + public project: string; + + /** DeleteNodesNodeGroupRequest requestId. */ + public requestId?: (string|null); + + /** DeleteNodesNodeGroupRequest zone. */ + public zone: string; + + /** DeleteNodesNodeGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteNodesNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNodesNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteNodesNodeGroupRequest): google.cloud.compute.v1.DeleteNodesNodeGroupRequest; + + /** + * Encodes the specified DeleteNodesNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNodesNodeGroupRequest.verify|verify} messages. + * @param message DeleteNodesNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNodesNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNodesNodeGroupRequest.verify|verify} messages. + * @param message DeleteNodesNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNodesNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteNodesNodeGroupRequest; + + /** + * Decodes a DeleteNodesNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteNodesNodeGroupRequest; + + /** + * Verifies a DeleteNodesNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNodesNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNodesNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteNodesNodeGroupRequest; + + /** + * Creates a plain object from a DeleteNodesNodeGroupRequest message. Also converts values to other types if specified. + * @param message DeleteNodesNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteNodesNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNodesNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNodeGroupRequest. */ + interface IGetNodeGroupRequest { + + /** GetNodeGroupRequest nodeGroup */ + nodeGroup?: (string|null); + + /** GetNodeGroupRequest project */ + project?: (string|null); + + /** GetNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a GetNodeGroupRequest. */ + class GetNodeGroupRequest implements IGetNodeGroupRequest { + + /** + * Constructs a new GetNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetNodeGroupRequest); + + /** GetNodeGroupRequest nodeGroup. */ + public nodeGroup: string; + + /** GetNodeGroupRequest project. */ + public project: string; + + /** GetNodeGroupRequest zone. */ + public zone: string; + + /** + * Creates a new GetNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetNodeGroupRequest): google.cloud.compute.v1.GetNodeGroupRequest; + + /** + * Encodes the specified GetNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNodeGroupRequest.verify|verify} messages. + * @param message GetNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNodeGroupRequest.verify|verify} messages. + * @param message GetNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetNodeGroupRequest; + + /** + * Decodes a GetNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetNodeGroupRequest; + + /** + * Verifies a GetNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetNodeGroupRequest; + + /** + * Creates a plain object from a GetNodeGroupRequest message. Also converts values to other types if specified. + * @param message GetNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyNodeGroupRequest. */ + interface IGetIamPolicyNodeGroupRequest { + + /** GetIamPolicyNodeGroupRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyNodeGroupRequest project */ + project?: (string|null); + + /** GetIamPolicyNodeGroupRequest resource */ + resource?: (string|null); + + /** GetIamPolicyNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a GetIamPolicyNodeGroupRequest. */ + class GetIamPolicyNodeGroupRequest implements IGetIamPolicyNodeGroupRequest { + + /** + * Constructs a new GetIamPolicyNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest); + + /** GetIamPolicyNodeGroupRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyNodeGroupRequest project. */ + public project: string; + + /** GetIamPolicyNodeGroupRequest resource. */ + public resource: string; + + /** GetIamPolicyNodeGroupRequest zone. */ + public zone: string; + + /** GetIamPolicyNodeGroupRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest): google.cloud.compute.v1.GetIamPolicyNodeGroupRequest; + + /** + * Encodes the specified GetIamPolicyNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeGroupRequest.verify|verify} messages. + * @param message GetIamPolicyNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeGroupRequest.verify|verify} messages. + * @param message GetIamPolicyNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyNodeGroupRequest; + + /** + * Decodes a GetIamPolicyNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyNodeGroupRequest; + + /** + * Verifies a GetIamPolicyNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyNodeGroupRequest; + + /** + * Creates a plain object from a GetIamPolicyNodeGroupRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertNodeGroupRequest. */ + interface IInsertNodeGroupRequest { + + /** InsertNodeGroupRequest initialNodeCount */ + initialNodeCount?: (number|null); + + /** InsertNodeGroupRequest nodeGroupResource */ + nodeGroupResource?: (google.cloud.compute.v1.INodeGroup|null); + + /** InsertNodeGroupRequest project */ + project?: (string|null); + + /** InsertNodeGroupRequest requestId */ + requestId?: (string|null); + + /** InsertNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertNodeGroupRequest. */ + class InsertNodeGroupRequest implements IInsertNodeGroupRequest { + + /** + * Constructs a new InsertNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertNodeGroupRequest); + + /** InsertNodeGroupRequest initialNodeCount. */ + public initialNodeCount: number; + + /** InsertNodeGroupRequest nodeGroupResource. */ + public nodeGroupResource?: (google.cloud.compute.v1.INodeGroup|null); + + /** InsertNodeGroupRequest project. */ + public project: string; + + /** InsertNodeGroupRequest requestId. */ + public requestId?: (string|null); + + /** InsertNodeGroupRequest zone. */ + public zone: string; + + /** InsertNodeGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertNodeGroupRequest): google.cloud.compute.v1.InsertNodeGroupRequest; + + /** + * Encodes the specified InsertNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNodeGroupRequest.verify|verify} messages. + * @param message InsertNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNodeGroupRequest.verify|verify} messages. + * @param message InsertNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertNodeGroupRequest; + + /** + * Decodes an InsertNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertNodeGroupRequest; + + /** + * Verifies an InsertNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertNodeGroupRequest; + + /** + * Creates a plain object from an InsertNodeGroupRequest message. Also converts values to other types if specified. + * @param message InsertNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNodeGroupsRequest. */ + interface IListNodeGroupsRequest { + + /** ListNodeGroupsRequest filter */ + filter?: (string|null); + + /** ListNodeGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListNodeGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListNodeGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListNodeGroupsRequest project */ + project?: (string|null); + + /** ListNodeGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListNodeGroupsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListNodeGroupsRequest. */ + class ListNodeGroupsRequest implements IListNodeGroupsRequest { + + /** + * Constructs a new ListNodeGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNodeGroupsRequest); + + /** ListNodeGroupsRequest filter. */ + public filter?: (string|null); + + /** ListNodeGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNodeGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNodeGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNodeGroupsRequest project. */ + public project: string; + + /** ListNodeGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNodeGroupsRequest zone. */ + public zone: string; + + /** ListNodeGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListNodeGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNodeGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNodeGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNodeGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNodeGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodeGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNodeGroupsRequest): google.cloud.compute.v1.ListNodeGroupsRequest; + + /** + * Encodes the specified ListNodeGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodeGroupsRequest.verify|verify} messages. + * @param message ListNodeGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNodeGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodeGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodeGroupsRequest.verify|verify} messages. + * @param message ListNodeGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNodeGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodeGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNodeGroupsRequest; + + /** + * Decodes a ListNodeGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNodeGroupsRequest; + + /** + * Verifies a ListNodeGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodeGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodeGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNodeGroupsRequest; + + /** + * Creates a plain object from a ListNodeGroupsRequest message. Also converts values to other types if specified. + * @param message ListNodeGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNodeGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodeGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNodesNodeGroupsRequest. */ + interface IListNodesNodeGroupsRequest { + + /** ListNodesNodeGroupsRequest filter */ + filter?: (string|null); + + /** ListNodesNodeGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListNodesNodeGroupsRequest nodeGroup */ + nodeGroup?: (string|null); + + /** ListNodesNodeGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListNodesNodeGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListNodesNodeGroupsRequest project */ + project?: (string|null); + + /** ListNodesNodeGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListNodesNodeGroupsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListNodesNodeGroupsRequest. */ + class ListNodesNodeGroupsRequest implements IListNodesNodeGroupsRequest { + + /** + * Constructs a new ListNodesNodeGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNodesNodeGroupsRequest); + + /** ListNodesNodeGroupsRequest filter. */ + public filter?: (string|null); + + /** ListNodesNodeGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNodesNodeGroupsRequest nodeGroup. */ + public nodeGroup: string; + + /** ListNodesNodeGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNodesNodeGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNodesNodeGroupsRequest project. */ + public project: string; + + /** ListNodesNodeGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNodesNodeGroupsRequest zone. */ + public zone: string; + + /** ListNodesNodeGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListNodesNodeGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNodesNodeGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNodesNodeGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNodesNodeGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNodesNodeGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodesNodeGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNodesNodeGroupsRequest): google.cloud.compute.v1.ListNodesNodeGroupsRequest; + + /** + * Encodes the specified ListNodesNodeGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodesNodeGroupsRequest.verify|verify} messages. + * @param message ListNodesNodeGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNodesNodeGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodesNodeGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodesNodeGroupsRequest.verify|verify} messages. + * @param message ListNodesNodeGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNodesNodeGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodesNodeGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodesNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNodesNodeGroupsRequest; + + /** + * Decodes a ListNodesNodeGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodesNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNodesNodeGroupsRequest; + + /** + * Verifies a ListNodesNodeGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodesNodeGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodesNodeGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNodesNodeGroupsRequest; + + /** + * Creates a plain object from a ListNodesNodeGroupsRequest message. Also converts values to other types if specified. + * @param message ListNodesNodeGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNodesNodeGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodesNodeGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchNodeGroupRequest. */ + interface IPatchNodeGroupRequest { + + /** PatchNodeGroupRequest nodeGroup */ + nodeGroup?: (string|null); + + /** PatchNodeGroupRequest nodeGroupResource */ + nodeGroupResource?: (google.cloud.compute.v1.INodeGroup|null); + + /** PatchNodeGroupRequest project */ + project?: (string|null); + + /** PatchNodeGroupRequest requestId */ + requestId?: (string|null); + + /** PatchNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a PatchNodeGroupRequest. */ + class PatchNodeGroupRequest implements IPatchNodeGroupRequest { + + /** + * Constructs a new PatchNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchNodeGroupRequest); + + /** PatchNodeGroupRequest nodeGroup. */ + public nodeGroup: string; + + /** PatchNodeGroupRequest nodeGroupResource. */ + public nodeGroupResource?: (google.cloud.compute.v1.INodeGroup|null); + + /** PatchNodeGroupRequest project. */ + public project: string; + + /** PatchNodeGroupRequest requestId. */ + public requestId?: (string|null); + + /** PatchNodeGroupRequest zone. */ + public zone: string; + + /** PatchNodeGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchNodeGroupRequest): google.cloud.compute.v1.PatchNodeGroupRequest; + + /** + * Encodes the specified PatchNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchNodeGroupRequest.verify|verify} messages. + * @param message PatchNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchNodeGroupRequest.verify|verify} messages. + * @param message PatchNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchNodeGroupRequest; + + /** + * Decodes a PatchNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchNodeGroupRequest; + + /** + * Verifies a PatchNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchNodeGroupRequest; + + /** + * Creates a plain object from a PatchNodeGroupRequest message. Also converts values to other types if specified. + * @param message PatchNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyNodeGroupRequest. */ + interface ISetIamPolicyNodeGroupRequest { + + /** SetIamPolicyNodeGroupRequest project */ + project?: (string|null); + + /** SetIamPolicyNodeGroupRequest resource */ + resource?: (string|null); + + /** SetIamPolicyNodeGroupRequest zone */ + zone?: (string|null); + + /** SetIamPolicyNodeGroupRequest zoneSetPolicyRequestResource */ + zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + } + + /** Represents a SetIamPolicyNodeGroupRequest. */ + class SetIamPolicyNodeGroupRequest implements ISetIamPolicyNodeGroupRequest { + + /** + * Constructs a new SetIamPolicyNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest); + + /** SetIamPolicyNodeGroupRequest project. */ + public project: string; + + /** SetIamPolicyNodeGroupRequest resource. */ + public resource: string; + + /** SetIamPolicyNodeGroupRequest zone. */ + public zone: string; + + /** SetIamPolicyNodeGroupRequest zoneSetPolicyRequestResource. */ + public zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + + /** + * Creates a new SetIamPolicyNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest): google.cloud.compute.v1.SetIamPolicyNodeGroupRequest; + + /** + * Encodes the specified SetIamPolicyNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeGroupRequest.verify|verify} messages. + * @param message SetIamPolicyNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeGroupRequest.verify|verify} messages. + * @param message SetIamPolicyNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyNodeGroupRequest; + + /** + * Decodes a SetIamPolicyNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyNodeGroupRequest; + + /** + * Verifies a SetIamPolicyNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyNodeGroupRequest; + + /** + * Creates a plain object from a SetIamPolicyNodeGroupRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetNodeTemplateNodeGroupRequest. */ + interface ISetNodeTemplateNodeGroupRequest { + + /** SetNodeTemplateNodeGroupRequest nodeGroup */ + nodeGroup?: (string|null); + + /** SetNodeTemplateNodeGroupRequest nodeGroupsSetNodeTemplateRequestResource */ + nodeGroupsSetNodeTemplateRequestResource?: (google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest|null); + + /** SetNodeTemplateNodeGroupRequest project */ + project?: (string|null); + + /** SetNodeTemplateNodeGroupRequest requestId */ + requestId?: (string|null); + + /** SetNodeTemplateNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a SetNodeTemplateNodeGroupRequest. */ + class SetNodeTemplateNodeGroupRequest implements ISetNodeTemplateNodeGroupRequest { + + /** + * Constructs a new SetNodeTemplateNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest); + + /** SetNodeTemplateNodeGroupRequest nodeGroup. */ + public nodeGroup: string; + + /** SetNodeTemplateNodeGroupRequest nodeGroupsSetNodeTemplateRequestResource. */ + public nodeGroupsSetNodeTemplateRequestResource?: (google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest|null); + + /** SetNodeTemplateNodeGroupRequest project. */ + public project: string; + + /** SetNodeTemplateNodeGroupRequest requestId. */ + public requestId?: (string|null); + + /** SetNodeTemplateNodeGroupRequest zone. */ + public zone: string; + + /** SetNodeTemplateNodeGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetNodeTemplateNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetNodeTemplateNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest): google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest; + + /** + * Encodes the specified SetNodeTemplateNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest.verify|verify} messages. + * @param message SetNodeTemplateNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetNodeTemplateNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest.verify|verify} messages. + * @param message SetNodeTemplateNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetNodeTemplateNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetNodeTemplateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest; + + /** + * Decodes a SetNodeTemplateNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetNodeTemplateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest; + + /** + * Verifies a SetNodeTemplateNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetNodeTemplateNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetNodeTemplateNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest; + + /** + * Creates a plain object from a SetNodeTemplateNodeGroupRequest message. Also converts values to other types if specified. + * @param message SetNodeTemplateNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetNodeTemplateNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsNodeGroupRequest. */ + interface ITestIamPermissionsNodeGroupRequest { + + /** TestIamPermissionsNodeGroupRequest project */ + project?: (string|null); + + /** TestIamPermissionsNodeGroupRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsNodeGroupRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsNodeGroupRequest zone */ + zone?: (string|null); + } + + /** Represents a TestIamPermissionsNodeGroupRequest. */ + class TestIamPermissionsNodeGroupRequest implements ITestIamPermissionsNodeGroupRequest { + + /** + * Constructs a new TestIamPermissionsNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest); + + /** TestIamPermissionsNodeGroupRequest project. */ + public project: string; + + /** TestIamPermissionsNodeGroupRequest resource. */ + public resource: string; + + /** TestIamPermissionsNodeGroupRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsNodeGroupRequest zone. */ + public zone: string; + + /** + * Creates a new TestIamPermissionsNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsNodeGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest): google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest; + + /** + * Encodes the specified TestIamPermissionsNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest.verify|verify} messages. + * @param message TestIamPermissionsNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest.verify|verify} messages. + * @param message TestIamPermissionsNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest; + + /** + * Decodes a TestIamPermissionsNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest; + + /** + * Verifies a TestIamPermissionsNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest; + + /** + * Creates a plain object from a TestIamPermissionsNodeGroupRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListNodeTemplatesRequest. */ + interface IAggregatedListNodeTemplatesRequest { + + /** AggregatedListNodeTemplatesRequest filter */ + filter?: (string|null); + + /** AggregatedListNodeTemplatesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListNodeTemplatesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListNodeTemplatesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListNodeTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListNodeTemplatesRequest project */ + project?: (string|null); + + /** AggregatedListNodeTemplatesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListNodeTemplatesRequest. */ + class AggregatedListNodeTemplatesRequest implements IAggregatedListNodeTemplatesRequest { + + /** + * Constructs a new AggregatedListNodeTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest); + + /** AggregatedListNodeTemplatesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListNodeTemplatesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListNodeTemplatesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListNodeTemplatesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListNodeTemplatesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListNodeTemplatesRequest project. */ + public project: string; + + /** AggregatedListNodeTemplatesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListNodeTemplatesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListNodeTemplatesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListNodeTemplatesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListNodeTemplatesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListNodeTemplatesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListNodeTemplatesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListNodeTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListNodeTemplatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest): google.cloud.compute.v1.AggregatedListNodeTemplatesRequest; + + /** + * Encodes the specified AggregatedListNodeTemplatesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTemplatesRequest.verify|verify} messages. + * @param message AggregatedListNodeTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListNodeTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTemplatesRequest.verify|verify} messages. + * @param message AggregatedListNodeTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListNodeTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListNodeTemplatesRequest; + + /** + * Decodes an AggregatedListNodeTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListNodeTemplatesRequest; + + /** + * Verifies an AggregatedListNodeTemplatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListNodeTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListNodeTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListNodeTemplatesRequest; + + /** + * Creates a plain object from an AggregatedListNodeTemplatesRequest message. Also converts values to other types if specified. + * @param message AggregatedListNodeTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListNodeTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListNodeTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteNodeTemplateRequest. */ + interface IDeleteNodeTemplateRequest { + + /** DeleteNodeTemplateRequest nodeTemplate */ + nodeTemplate?: (string|null); + + /** DeleteNodeTemplateRequest project */ + project?: (string|null); + + /** DeleteNodeTemplateRequest region */ + region?: (string|null); + + /** DeleteNodeTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteNodeTemplateRequest. */ + class DeleteNodeTemplateRequest implements IDeleteNodeTemplateRequest { + + /** + * Constructs a new DeleteNodeTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteNodeTemplateRequest); + + /** DeleteNodeTemplateRequest nodeTemplate. */ + public nodeTemplate: string; + + /** DeleteNodeTemplateRequest project. */ + public project: string; + + /** DeleteNodeTemplateRequest region. */ + public region: string; + + /** DeleteNodeTemplateRequest requestId. */ + public requestId?: (string|null); + + /** DeleteNodeTemplateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteNodeTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNodeTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteNodeTemplateRequest): google.cloud.compute.v1.DeleteNodeTemplateRequest; + + /** + * Encodes the specified DeleteNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeTemplateRequest.verify|verify} messages. + * @param message DeleteNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeTemplateRequest.verify|verify} messages. + * @param message DeleteNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNodeTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteNodeTemplateRequest; + + /** + * Decodes a DeleteNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteNodeTemplateRequest; + + /** + * Verifies a DeleteNodeTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNodeTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteNodeTemplateRequest; + + /** + * Creates a plain object from a DeleteNodeTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteNodeTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteNodeTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNodeTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNodeTemplateRequest. */ + interface IGetNodeTemplateRequest { + + /** GetNodeTemplateRequest nodeTemplate */ + nodeTemplate?: (string|null); + + /** GetNodeTemplateRequest project */ + project?: (string|null); + + /** GetNodeTemplateRequest region */ + region?: (string|null); + } + + /** Represents a GetNodeTemplateRequest. */ + class GetNodeTemplateRequest implements IGetNodeTemplateRequest { + + /** + * Constructs a new GetNodeTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetNodeTemplateRequest); + + /** GetNodeTemplateRequest nodeTemplate. */ + public nodeTemplate: string; + + /** GetNodeTemplateRequest project. */ + public project: string; + + /** GetNodeTemplateRequest region. */ + public region: string; + + /** + * Creates a new GetNodeTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetNodeTemplateRequest): google.cloud.compute.v1.GetNodeTemplateRequest; + + /** + * Encodes the specified GetNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNodeTemplateRequest.verify|verify} messages. + * @param message GetNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNodeTemplateRequest.verify|verify} messages. + * @param message GetNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNodeTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetNodeTemplateRequest; + + /** + * Decodes a GetNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetNodeTemplateRequest; + + /** + * Verifies a GetNodeTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetNodeTemplateRequest; + + /** + * Creates a plain object from a GetNodeTemplateRequest message. Also converts values to other types if specified. + * @param message GetNodeTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetNodeTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNodeTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyNodeTemplateRequest. */ + interface IGetIamPolicyNodeTemplateRequest { + + /** GetIamPolicyNodeTemplateRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyNodeTemplateRequest project */ + project?: (string|null); + + /** GetIamPolicyNodeTemplateRequest region */ + region?: (string|null); + + /** GetIamPolicyNodeTemplateRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicyNodeTemplateRequest. */ + class GetIamPolicyNodeTemplateRequest implements IGetIamPolicyNodeTemplateRequest { + + /** + * Constructs a new GetIamPolicyNodeTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest); + + /** GetIamPolicyNodeTemplateRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyNodeTemplateRequest project. */ + public project: string; + + /** GetIamPolicyNodeTemplateRequest region. */ + public region: string; + + /** GetIamPolicyNodeTemplateRequest resource. */ + public resource: string; + + /** GetIamPolicyNodeTemplateRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyNodeTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyNodeTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest): google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest; + + /** + * Encodes the specified GetIamPolicyNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @param message GetIamPolicyNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @param message GetIamPolicyNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyNodeTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest; + + /** + * Decodes a GetIamPolicyNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest; + + /** + * Verifies a GetIamPolicyNodeTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyNodeTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest; + + /** + * Creates a plain object from a GetIamPolicyNodeTemplateRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyNodeTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyNodeTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertNodeTemplateRequest. */ + interface IInsertNodeTemplateRequest { + + /** InsertNodeTemplateRequest nodeTemplateResource */ + nodeTemplateResource?: (google.cloud.compute.v1.INodeTemplate|null); + + /** InsertNodeTemplateRequest project */ + project?: (string|null); + + /** InsertNodeTemplateRequest region */ + region?: (string|null); + + /** InsertNodeTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertNodeTemplateRequest. */ + class InsertNodeTemplateRequest implements IInsertNodeTemplateRequest { + + /** + * Constructs a new InsertNodeTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertNodeTemplateRequest); + + /** InsertNodeTemplateRequest nodeTemplateResource. */ + public nodeTemplateResource?: (google.cloud.compute.v1.INodeTemplate|null); + + /** InsertNodeTemplateRequest project. */ + public project: string; + + /** InsertNodeTemplateRequest region. */ + public region: string; + + /** InsertNodeTemplateRequest requestId. */ + public requestId?: (string|null); + + /** InsertNodeTemplateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertNodeTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertNodeTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertNodeTemplateRequest): google.cloud.compute.v1.InsertNodeTemplateRequest; + + /** + * Encodes the specified InsertNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNodeTemplateRequest.verify|verify} messages. + * @param message InsertNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNodeTemplateRequest.verify|verify} messages. + * @param message InsertNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertNodeTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertNodeTemplateRequest; + + /** + * Decodes an InsertNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertNodeTemplateRequest; + + /** + * Verifies an InsertNodeTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertNodeTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertNodeTemplateRequest; + + /** + * Creates a plain object from an InsertNodeTemplateRequest message. Also converts values to other types if specified. + * @param message InsertNodeTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertNodeTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertNodeTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNodeTemplatesRequest. */ + interface IListNodeTemplatesRequest { + + /** ListNodeTemplatesRequest filter */ + filter?: (string|null); + + /** ListNodeTemplatesRequest maxResults */ + maxResults?: (number|null); + + /** ListNodeTemplatesRequest orderBy */ + orderBy?: (string|null); + + /** ListNodeTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** ListNodeTemplatesRequest project */ + project?: (string|null); + + /** ListNodeTemplatesRequest region */ + region?: (string|null); + + /** ListNodeTemplatesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListNodeTemplatesRequest. */ + class ListNodeTemplatesRequest implements IListNodeTemplatesRequest { + + /** + * Constructs a new ListNodeTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNodeTemplatesRequest); + + /** ListNodeTemplatesRequest filter. */ + public filter?: (string|null); + + /** ListNodeTemplatesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNodeTemplatesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNodeTemplatesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNodeTemplatesRequest project. */ + public project: string; + + /** ListNodeTemplatesRequest region. */ + public region: string; + + /** ListNodeTemplatesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNodeTemplatesRequest _filter. */ + public _filter?: "filter"; + + /** ListNodeTemplatesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNodeTemplatesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNodeTemplatesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNodeTemplatesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNodeTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodeTemplatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNodeTemplatesRequest): google.cloud.compute.v1.ListNodeTemplatesRequest; + + /** + * Encodes the specified ListNodeTemplatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodeTemplatesRequest.verify|verify} messages. + * @param message ListNodeTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNodeTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodeTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodeTemplatesRequest.verify|verify} messages. + * @param message ListNodeTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNodeTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodeTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNodeTemplatesRequest; + + /** + * Decodes a ListNodeTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNodeTemplatesRequest; + + /** + * Verifies a ListNodeTemplatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodeTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodeTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNodeTemplatesRequest; + + /** + * Creates a plain object from a ListNodeTemplatesRequest message. Also converts values to other types if specified. + * @param message ListNodeTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNodeTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodeTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyNodeTemplateRequest. */ + interface ISetIamPolicyNodeTemplateRequest { + + /** SetIamPolicyNodeTemplateRequest project */ + project?: (string|null); + + /** SetIamPolicyNodeTemplateRequest region */ + region?: (string|null); + + /** SetIamPolicyNodeTemplateRequest regionSetPolicyRequestResource */ + regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicyNodeTemplateRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicyNodeTemplateRequest. */ + class SetIamPolicyNodeTemplateRequest implements ISetIamPolicyNodeTemplateRequest { + + /** + * Constructs a new SetIamPolicyNodeTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest); + + /** SetIamPolicyNodeTemplateRequest project. */ + public project: string; + + /** SetIamPolicyNodeTemplateRequest region. */ + public region: string; + + /** SetIamPolicyNodeTemplateRequest regionSetPolicyRequestResource. */ + public regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicyNodeTemplateRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicyNodeTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyNodeTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest): google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest; + + /** + * Encodes the specified SetIamPolicyNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @param message SetIamPolicyNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @param message SetIamPolicyNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyNodeTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest; + + /** + * Decodes a SetIamPolicyNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest; + + /** + * Verifies a SetIamPolicyNodeTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyNodeTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest; + + /** + * Creates a plain object from a SetIamPolicyNodeTemplateRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyNodeTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyNodeTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsNodeTemplateRequest. */ + interface ITestIamPermissionsNodeTemplateRequest { + + /** TestIamPermissionsNodeTemplateRequest project */ + project?: (string|null); + + /** TestIamPermissionsNodeTemplateRequest region */ + region?: (string|null); + + /** TestIamPermissionsNodeTemplateRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsNodeTemplateRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsNodeTemplateRequest. */ + class TestIamPermissionsNodeTemplateRequest implements ITestIamPermissionsNodeTemplateRequest { + + /** + * Constructs a new TestIamPermissionsNodeTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest); + + /** TestIamPermissionsNodeTemplateRequest project. */ + public project: string; + + /** TestIamPermissionsNodeTemplateRequest region. */ + public region: string; + + /** TestIamPermissionsNodeTemplateRequest resource. */ + public resource: string; + + /** TestIamPermissionsNodeTemplateRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsNodeTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsNodeTemplateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest): google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest; + + /** + * Encodes the specified TestIamPermissionsNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest.verify|verify} messages. + * @param message TestIamPermissionsNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest.verify|verify} messages. + * @param message TestIamPermissionsNodeTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsNodeTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest; + + /** + * Decodes a TestIamPermissionsNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest; + + /** + * Verifies a TestIamPermissionsNodeTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsNodeTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest; + + /** + * Creates a plain object from a TestIamPermissionsNodeTemplateRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsNodeTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsNodeTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListNodeTypesRequest. */ + interface IAggregatedListNodeTypesRequest { + + /** AggregatedListNodeTypesRequest filter */ + filter?: (string|null); + + /** AggregatedListNodeTypesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListNodeTypesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListNodeTypesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListNodeTypesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListNodeTypesRequest project */ + project?: (string|null); + + /** AggregatedListNodeTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListNodeTypesRequest. */ + class AggregatedListNodeTypesRequest implements IAggregatedListNodeTypesRequest { + + /** + * Constructs a new AggregatedListNodeTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListNodeTypesRequest); + + /** AggregatedListNodeTypesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListNodeTypesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListNodeTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListNodeTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListNodeTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListNodeTypesRequest project. */ + public project: string; + + /** AggregatedListNodeTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListNodeTypesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListNodeTypesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListNodeTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListNodeTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListNodeTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListNodeTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListNodeTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListNodeTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListNodeTypesRequest): google.cloud.compute.v1.AggregatedListNodeTypesRequest; + + /** + * Encodes the specified AggregatedListNodeTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTypesRequest.verify|verify} messages. + * @param message AggregatedListNodeTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListNodeTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTypesRequest.verify|verify} messages. + * @param message AggregatedListNodeTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListNodeTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListNodeTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListNodeTypesRequest; + + /** + * Decodes an AggregatedListNodeTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListNodeTypesRequest; + + /** + * Verifies an AggregatedListNodeTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListNodeTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListNodeTypesRequest; + + /** + * Creates a plain object from an AggregatedListNodeTypesRequest message. Also converts values to other types if specified. + * @param message AggregatedListNodeTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListNodeTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListNodeTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNodeTypeRequest. */ + interface IGetNodeTypeRequest { + + /** GetNodeTypeRequest nodeType */ + nodeType?: (string|null); + + /** GetNodeTypeRequest project */ + project?: (string|null); + + /** GetNodeTypeRequest zone */ + zone?: (string|null); + } + + /** Represents a GetNodeTypeRequest. */ + class GetNodeTypeRequest implements IGetNodeTypeRequest { + + /** + * Constructs a new GetNodeTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetNodeTypeRequest); + + /** GetNodeTypeRequest nodeType. */ + public nodeType: string; + + /** GetNodeTypeRequest project. */ + public project: string; + + /** GetNodeTypeRequest zone. */ + public zone: string; + + /** + * Creates a new GetNodeTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeTypeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetNodeTypeRequest): google.cloud.compute.v1.GetNodeTypeRequest; + + /** + * Encodes the specified GetNodeTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNodeTypeRequest.verify|verify} messages. + * @param message GetNodeTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetNodeTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNodeTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNodeTypeRequest.verify|verify} messages. + * @param message GetNodeTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetNodeTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNodeTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetNodeTypeRequest; + + /** + * Decodes a GetNodeTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetNodeTypeRequest; + + /** + * Verifies a GetNodeTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNodeTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetNodeTypeRequest; + + /** + * Creates a plain object from a GetNodeTypeRequest message. Also converts values to other types if specified. + * @param message GetNodeTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetNodeTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNodeTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNodeTypesRequest. */ + interface IListNodeTypesRequest { + + /** ListNodeTypesRequest filter */ + filter?: (string|null); + + /** ListNodeTypesRequest maxResults */ + maxResults?: (number|null); + + /** ListNodeTypesRequest orderBy */ + orderBy?: (string|null); + + /** ListNodeTypesRequest pageToken */ + pageToken?: (string|null); + + /** ListNodeTypesRequest project */ + project?: (string|null); + + /** ListNodeTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListNodeTypesRequest zone */ + zone?: (string|null); + } + + /** Represents a ListNodeTypesRequest. */ + class ListNodeTypesRequest implements IListNodeTypesRequest { + + /** + * Constructs a new ListNodeTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListNodeTypesRequest); + + /** ListNodeTypesRequest filter. */ + public filter?: (string|null); + + /** ListNodeTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListNodeTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListNodeTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListNodeTypesRequest project. */ + public project: string; + + /** ListNodeTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListNodeTypesRequest zone. */ + public zone: string; + + /** ListNodeTypesRequest _filter. */ + public _filter?: "filter"; + + /** ListNodeTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListNodeTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListNodeTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListNodeTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListNodeTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodeTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListNodeTypesRequest): google.cloud.compute.v1.ListNodeTypesRequest; + + /** + * Encodes the specified ListNodeTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodeTypesRequest.verify|verify} messages. + * @param message ListNodeTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListNodeTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodeTypesRequest.verify|verify} messages. + * @param message ListNodeTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListNodeTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListNodeTypesRequest; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListNodeTypesRequest; + + /** + * Verifies a ListNodeTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodeTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListNodeTypesRequest; + + /** + * Creates a plain object from a ListNodeTypesRequest message. Also converts values to other types if specified. + * @param message ListNodeTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListNodeTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodeTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListPacketMirroringsRequest. */ + interface IAggregatedListPacketMirroringsRequest { + + /** AggregatedListPacketMirroringsRequest filter */ + filter?: (string|null); + + /** AggregatedListPacketMirroringsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListPacketMirroringsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListPacketMirroringsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListPacketMirroringsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListPacketMirroringsRequest project */ + project?: (string|null); + + /** AggregatedListPacketMirroringsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListPacketMirroringsRequest. */ + class AggregatedListPacketMirroringsRequest implements IAggregatedListPacketMirroringsRequest { + + /** + * Constructs a new AggregatedListPacketMirroringsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest); + + /** AggregatedListPacketMirroringsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListPacketMirroringsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListPacketMirroringsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListPacketMirroringsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListPacketMirroringsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListPacketMirroringsRequest project. */ + public project: string; + + /** AggregatedListPacketMirroringsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListPacketMirroringsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListPacketMirroringsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListPacketMirroringsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListPacketMirroringsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListPacketMirroringsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListPacketMirroringsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListPacketMirroringsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListPacketMirroringsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest): google.cloud.compute.v1.AggregatedListPacketMirroringsRequest; + + /** + * Encodes the specified AggregatedListPacketMirroringsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPacketMirroringsRequest.verify|verify} messages. + * @param message AggregatedListPacketMirroringsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListPacketMirroringsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPacketMirroringsRequest.verify|verify} messages. + * @param message AggregatedListPacketMirroringsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListPacketMirroringsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListPacketMirroringsRequest; + + /** + * Decodes an AggregatedListPacketMirroringsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListPacketMirroringsRequest; + + /** + * Verifies an AggregatedListPacketMirroringsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListPacketMirroringsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListPacketMirroringsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListPacketMirroringsRequest; + + /** + * Creates a plain object from an AggregatedListPacketMirroringsRequest message. Also converts values to other types if specified. + * @param message AggregatedListPacketMirroringsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListPacketMirroringsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListPacketMirroringsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeletePacketMirroringRequest. */ + interface IDeletePacketMirroringRequest { + + /** DeletePacketMirroringRequest packetMirroring */ + packetMirroring?: (string|null); + + /** DeletePacketMirroringRequest project */ + project?: (string|null); + + /** DeletePacketMirroringRequest region */ + region?: (string|null); + + /** DeletePacketMirroringRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeletePacketMirroringRequest. */ + class DeletePacketMirroringRequest implements IDeletePacketMirroringRequest { + + /** + * Constructs a new DeletePacketMirroringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeletePacketMirroringRequest); + + /** DeletePacketMirroringRequest packetMirroring. */ + public packetMirroring: string; + + /** DeletePacketMirroringRequest project. */ + public project: string; + + /** DeletePacketMirroringRequest region. */ + public region: string; + + /** DeletePacketMirroringRequest requestId. */ + public requestId?: (string|null); + + /** DeletePacketMirroringRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeletePacketMirroringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePacketMirroringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeletePacketMirroringRequest): google.cloud.compute.v1.DeletePacketMirroringRequest; + + /** + * Encodes the specified DeletePacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePacketMirroringRequest.verify|verify} messages. + * @param message DeletePacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeletePacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePacketMirroringRequest.verify|verify} messages. + * @param message DeletePacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeletePacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePacketMirroringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeletePacketMirroringRequest; + + /** + * Decodes a DeletePacketMirroringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeletePacketMirroringRequest; + + /** + * Verifies a DeletePacketMirroringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePacketMirroringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeletePacketMirroringRequest; + + /** + * Creates a plain object from a DeletePacketMirroringRequest message. Also converts values to other types if specified. + * @param message DeletePacketMirroringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeletePacketMirroringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePacketMirroringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetPacketMirroringRequest. */ + interface IGetPacketMirroringRequest { + + /** GetPacketMirroringRequest packetMirroring */ + packetMirroring?: (string|null); + + /** GetPacketMirroringRequest project */ + project?: (string|null); + + /** GetPacketMirroringRequest region */ + region?: (string|null); + } + + /** Represents a GetPacketMirroringRequest. */ + class GetPacketMirroringRequest implements IGetPacketMirroringRequest { + + /** + * Constructs a new GetPacketMirroringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetPacketMirroringRequest); + + /** GetPacketMirroringRequest packetMirroring. */ + public packetMirroring: string; + + /** GetPacketMirroringRequest project. */ + public project: string; + + /** GetPacketMirroringRequest region. */ + public region: string; + + /** + * Creates a new GetPacketMirroringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPacketMirroringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetPacketMirroringRequest): google.cloud.compute.v1.GetPacketMirroringRequest; + + /** + * Encodes the specified GetPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.GetPacketMirroringRequest.verify|verify} messages. + * @param message GetPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetPacketMirroringRequest.verify|verify} messages. + * @param message GetPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPacketMirroringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetPacketMirroringRequest; + + /** + * Decodes a GetPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetPacketMirroringRequest; + + /** + * Verifies a GetPacketMirroringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPacketMirroringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetPacketMirroringRequest; + + /** + * Creates a plain object from a GetPacketMirroringRequest message. Also converts values to other types if specified. + * @param message GetPacketMirroringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetPacketMirroringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPacketMirroringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertPacketMirroringRequest. */ + interface IInsertPacketMirroringRequest { + + /** InsertPacketMirroringRequest packetMirroringResource */ + packetMirroringResource?: (google.cloud.compute.v1.IPacketMirroring|null); + + /** InsertPacketMirroringRequest project */ + project?: (string|null); + + /** InsertPacketMirroringRequest region */ + region?: (string|null); + + /** InsertPacketMirroringRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertPacketMirroringRequest. */ + class InsertPacketMirroringRequest implements IInsertPacketMirroringRequest { + + /** + * Constructs a new InsertPacketMirroringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertPacketMirroringRequest); + + /** InsertPacketMirroringRequest packetMirroringResource. */ + public packetMirroringResource?: (google.cloud.compute.v1.IPacketMirroring|null); + + /** InsertPacketMirroringRequest project. */ + public project: string; + + /** InsertPacketMirroringRequest region. */ + public region: string; + + /** InsertPacketMirroringRequest requestId. */ + public requestId?: (string|null); + + /** InsertPacketMirroringRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertPacketMirroringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertPacketMirroringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertPacketMirroringRequest): google.cloud.compute.v1.InsertPacketMirroringRequest; + + /** + * Encodes the specified InsertPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertPacketMirroringRequest.verify|verify} messages. + * @param message InsertPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertPacketMirroringRequest.verify|verify} messages. + * @param message InsertPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertPacketMirroringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertPacketMirroringRequest; + + /** + * Decodes an InsertPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertPacketMirroringRequest; + + /** + * Verifies an InsertPacketMirroringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertPacketMirroringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertPacketMirroringRequest; + + /** + * Creates a plain object from an InsertPacketMirroringRequest message. Also converts values to other types if specified. + * @param message InsertPacketMirroringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertPacketMirroringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertPacketMirroringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPacketMirroringsRequest. */ + interface IListPacketMirroringsRequest { + + /** ListPacketMirroringsRequest filter */ + filter?: (string|null); + + /** ListPacketMirroringsRequest maxResults */ + maxResults?: (number|null); + + /** ListPacketMirroringsRequest orderBy */ + orderBy?: (string|null); + + /** ListPacketMirroringsRequest pageToken */ + pageToken?: (string|null); + + /** ListPacketMirroringsRequest project */ + project?: (string|null); + + /** ListPacketMirroringsRequest region */ + region?: (string|null); + + /** ListPacketMirroringsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListPacketMirroringsRequest. */ + class ListPacketMirroringsRequest implements IListPacketMirroringsRequest { + + /** + * Constructs a new ListPacketMirroringsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListPacketMirroringsRequest); + + /** ListPacketMirroringsRequest filter. */ + public filter?: (string|null); + + /** ListPacketMirroringsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListPacketMirroringsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListPacketMirroringsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListPacketMirroringsRequest project. */ + public project: string; + + /** ListPacketMirroringsRequest region. */ + public region: string; + + /** ListPacketMirroringsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListPacketMirroringsRequest _filter. */ + public _filter?: "filter"; + + /** ListPacketMirroringsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListPacketMirroringsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListPacketMirroringsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListPacketMirroringsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListPacketMirroringsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPacketMirroringsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListPacketMirroringsRequest): google.cloud.compute.v1.ListPacketMirroringsRequest; + + /** + * Encodes the specified ListPacketMirroringsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPacketMirroringsRequest.verify|verify} messages. + * @param message ListPacketMirroringsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListPacketMirroringsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPacketMirroringsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPacketMirroringsRequest.verify|verify} messages. + * @param message ListPacketMirroringsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListPacketMirroringsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPacketMirroringsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListPacketMirroringsRequest; + + /** + * Decodes a ListPacketMirroringsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListPacketMirroringsRequest; + + /** + * Verifies a ListPacketMirroringsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPacketMirroringsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPacketMirroringsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListPacketMirroringsRequest; + + /** + * Creates a plain object from a ListPacketMirroringsRequest message. Also converts values to other types if specified. + * @param message ListPacketMirroringsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListPacketMirroringsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPacketMirroringsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchPacketMirroringRequest. */ + interface IPatchPacketMirroringRequest { + + /** PatchPacketMirroringRequest packetMirroring */ + packetMirroring?: (string|null); + + /** PatchPacketMirroringRequest packetMirroringResource */ + packetMirroringResource?: (google.cloud.compute.v1.IPacketMirroring|null); + + /** PatchPacketMirroringRequest project */ + project?: (string|null); + + /** PatchPacketMirroringRequest region */ + region?: (string|null); + + /** PatchPacketMirroringRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchPacketMirroringRequest. */ + class PatchPacketMirroringRequest implements IPatchPacketMirroringRequest { + + /** + * Constructs a new PatchPacketMirroringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchPacketMirroringRequest); + + /** PatchPacketMirroringRequest packetMirroring. */ + public packetMirroring: string; + + /** PatchPacketMirroringRequest packetMirroringResource. */ + public packetMirroringResource?: (google.cloud.compute.v1.IPacketMirroring|null); + + /** PatchPacketMirroringRequest project. */ + public project: string; + + /** PatchPacketMirroringRequest region. */ + public region: string; + + /** PatchPacketMirroringRequest requestId. */ + public requestId?: (string|null); + + /** PatchPacketMirroringRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchPacketMirroringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchPacketMirroringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchPacketMirroringRequest): google.cloud.compute.v1.PatchPacketMirroringRequest; + + /** + * Encodes the specified PatchPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPacketMirroringRequest.verify|verify} messages. + * @param message PatchPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPacketMirroringRequest.verify|verify} messages. + * @param message PatchPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchPacketMirroringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchPacketMirroringRequest; + + /** + * Decodes a PatchPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchPacketMirroringRequest; + + /** + * Verifies a PatchPacketMirroringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchPacketMirroringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchPacketMirroringRequest; + + /** + * Creates a plain object from a PatchPacketMirroringRequest message. Also converts values to other types if specified. + * @param message PatchPacketMirroringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchPacketMirroringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchPacketMirroringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsPacketMirroringRequest. */ + interface ITestIamPermissionsPacketMirroringRequest { + + /** TestIamPermissionsPacketMirroringRequest project */ + project?: (string|null); + + /** TestIamPermissionsPacketMirroringRequest region */ + region?: (string|null); + + /** TestIamPermissionsPacketMirroringRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsPacketMirroringRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsPacketMirroringRequest. */ + class TestIamPermissionsPacketMirroringRequest implements ITestIamPermissionsPacketMirroringRequest { + + /** + * Constructs a new TestIamPermissionsPacketMirroringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest); + + /** TestIamPermissionsPacketMirroringRequest project. */ + public project: string; + + /** TestIamPermissionsPacketMirroringRequest region. */ + public region: string; + + /** TestIamPermissionsPacketMirroringRequest resource. */ + public resource: string; + + /** TestIamPermissionsPacketMirroringRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsPacketMirroringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsPacketMirroringRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest): google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest; + + /** + * Encodes the specified TestIamPermissionsPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest.verify|verify} messages. + * @param message TestIamPermissionsPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest.verify|verify} messages. + * @param message TestIamPermissionsPacketMirroringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsPacketMirroringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest; + + /** + * Decodes a TestIamPermissionsPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest; + + /** + * Verifies a TestIamPermissionsPacketMirroringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsPacketMirroringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest; + + /** + * Creates a plain object from a TestIamPermissionsPacketMirroringRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsPacketMirroringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsPacketMirroringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DisableXpnHostProjectRequest. */ + interface IDisableXpnHostProjectRequest { + + /** DisableXpnHostProjectRequest project */ + project?: (string|null); + + /** DisableXpnHostProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DisableXpnHostProjectRequest. */ + class DisableXpnHostProjectRequest implements IDisableXpnHostProjectRequest { + + /** + * Constructs a new DisableXpnHostProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisableXpnHostProjectRequest); + + /** DisableXpnHostProjectRequest project. */ + public project: string; + + /** DisableXpnHostProjectRequest requestId. */ + public requestId?: (string|null); + + /** DisableXpnHostProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DisableXpnHostProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableXpnHostProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDisableXpnHostProjectRequest): google.cloud.compute.v1.DisableXpnHostProjectRequest; + + /** + * Encodes the specified DisableXpnHostProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.DisableXpnHostProjectRequest.verify|verify} messages. + * @param message DisableXpnHostProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisableXpnHostProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableXpnHostProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisableXpnHostProjectRequest.verify|verify} messages. + * @param message DisableXpnHostProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisableXpnHostProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableXpnHostProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DisableXpnHostProjectRequest; + + /** + * Decodes a DisableXpnHostProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DisableXpnHostProjectRequest; + + /** + * Verifies a DisableXpnHostProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableXpnHostProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableXpnHostProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DisableXpnHostProjectRequest; + + /** + * Creates a plain object from a DisableXpnHostProjectRequest message. Also converts values to other types if specified. + * @param message DisableXpnHostProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DisableXpnHostProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableXpnHostProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DisableXpnResourceProjectRequest. */ + interface IDisableXpnResourceProjectRequest { + + /** DisableXpnResourceProjectRequest project */ + project?: (string|null); + + /** DisableXpnResourceProjectRequest projectsDisableXpnResourceRequestResource */ + projectsDisableXpnResourceRequestResource?: (google.cloud.compute.v1.IProjectsDisableXpnResourceRequest|null); + + /** DisableXpnResourceProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DisableXpnResourceProjectRequest. */ + class DisableXpnResourceProjectRequest implements IDisableXpnResourceProjectRequest { + + /** + * Constructs a new DisableXpnResourceProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDisableXpnResourceProjectRequest); + + /** DisableXpnResourceProjectRequest project. */ + public project: string; + + /** DisableXpnResourceProjectRequest projectsDisableXpnResourceRequestResource. */ + public projectsDisableXpnResourceRequestResource?: (google.cloud.compute.v1.IProjectsDisableXpnResourceRequest|null); + + /** DisableXpnResourceProjectRequest requestId. */ + public requestId?: (string|null); + + /** DisableXpnResourceProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DisableXpnResourceProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DisableXpnResourceProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDisableXpnResourceProjectRequest): google.cloud.compute.v1.DisableXpnResourceProjectRequest; + + /** + * Encodes the specified DisableXpnResourceProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.DisableXpnResourceProjectRequest.verify|verify} messages. + * @param message DisableXpnResourceProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDisableXpnResourceProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisableXpnResourceProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisableXpnResourceProjectRequest.verify|verify} messages. + * @param message DisableXpnResourceProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDisableXpnResourceProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisableXpnResourceProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DisableXpnResourceProjectRequest; + + /** + * Decodes a DisableXpnResourceProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DisableXpnResourceProjectRequest; + + /** + * Verifies a DisableXpnResourceProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisableXpnResourceProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisableXpnResourceProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DisableXpnResourceProjectRequest; + + /** + * Creates a plain object from a DisableXpnResourceProjectRequest message. Also converts values to other types if specified. + * @param message DisableXpnResourceProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DisableXpnResourceProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisableXpnResourceProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnableXpnHostProjectRequest. */ + interface IEnableXpnHostProjectRequest { + + /** EnableXpnHostProjectRequest project */ + project?: (string|null); + + /** EnableXpnHostProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents an EnableXpnHostProjectRequest. */ + class EnableXpnHostProjectRequest implements IEnableXpnHostProjectRequest { + + /** + * Constructs a new EnableXpnHostProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IEnableXpnHostProjectRequest); + + /** EnableXpnHostProjectRequest project. */ + public project: string; + + /** EnableXpnHostProjectRequest requestId. */ + public requestId?: (string|null); + + /** EnableXpnHostProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new EnableXpnHostProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableXpnHostProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IEnableXpnHostProjectRequest): google.cloud.compute.v1.EnableXpnHostProjectRequest; + + /** + * Encodes the specified EnableXpnHostProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.EnableXpnHostProjectRequest.verify|verify} messages. + * @param message EnableXpnHostProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IEnableXpnHostProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableXpnHostProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.EnableXpnHostProjectRequest.verify|verify} messages. + * @param message EnableXpnHostProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IEnableXpnHostProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableXpnHostProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.EnableXpnHostProjectRequest; + + /** + * Decodes an EnableXpnHostProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.EnableXpnHostProjectRequest; + + /** + * Verifies an EnableXpnHostProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnableXpnHostProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableXpnHostProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.EnableXpnHostProjectRequest; + + /** + * Creates a plain object from an EnableXpnHostProjectRequest message. Also converts values to other types if specified. + * @param message EnableXpnHostProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.EnableXpnHostProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableXpnHostProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnableXpnResourceProjectRequest. */ + interface IEnableXpnResourceProjectRequest { + + /** EnableXpnResourceProjectRequest project */ + project?: (string|null); + + /** EnableXpnResourceProjectRequest projectsEnableXpnResourceRequestResource */ + projectsEnableXpnResourceRequestResource?: (google.cloud.compute.v1.IProjectsEnableXpnResourceRequest|null); + + /** EnableXpnResourceProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents an EnableXpnResourceProjectRequest. */ + class EnableXpnResourceProjectRequest implements IEnableXpnResourceProjectRequest { + + /** + * Constructs a new EnableXpnResourceProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IEnableXpnResourceProjectRequest); + + /** EnableXpnResourceProjectRequest project. */ + public project: string; + + /** EnableXpnResourceProjectRequest projectsEnableXpnResourceRequestResource. */ + public projectsEnableXpnResourceRequestResource?: (google.cloud.compute.v1.IProjectsEnableXpnResourceRequest|null); + + /** EnableXpnResourceProjectRequest requestId. */ + public requestId?: (string|null); + + /** EnableXpnResourceProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new EnableXpnResourceProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EnableXpnResourceProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IEnableXpnResourceProjectRequest): google.cloud.compute.v1.EnableXpnResourceProjectRequest; + + /** + * Encodes the specified EnableXpnResourceProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.EnableXpnResourceProjectRequest.verify|verify} messages. + * @param message EnableXpnResourceProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IEnableXpnResourceProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnableXpnResourceProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.EnableXpnResourceProjectRequest.verify|verify} messages. + * @param message EnableXpnResourceProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IEnableXpnResourceProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnableXpnResourceProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.EnableXpnResourceProjectRequest; + + /** + * Decodes an EnableXpnResourceProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.EnableXpnResourceProjectRequest; + + /** + * Verifies an EnableXpnResourceProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnableXpnResourceProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnableXpnResourceProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.EnableXpnResourceProjectRequest; + + /** + * Creates a plain object from an EnableXpnResourceProjectRequest message. Also converts values to other types if specified. + * @param message EnableXpnResourceProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.EnableXpnResourceProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnableXpnResourceProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetProjectRequest. */ + interface IGetProjectRequest { + + /** GetProjectRequest project */ + project?: (string|null); + } + + /** Represents a GetProjectRequest. */ + class GetProjectRequest implements IGetProjectRequest { + + /** + * Constructs a new GetProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetProjectRequest); + + /** GetProjectRequest project. */ + public project: string; + + /** + * Creates a new GetProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetProjectRequest): google.cloud.compute.v1.GetProjectRequest; + + /** + * Encodes the specified GetProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.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.compute.v1.IGetProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.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.compute.v1.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.compute.v1.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.compute.v1.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.compute.v1.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.compute.v1.GetProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetXpnHostProjectRequest. */ + interface IGetXpnHostProjectRequest { + + /** GetXpnHostProjectRequest project */ + project?: (string|null); + } + + /** Represents a GetXpnHostProjectRequest. */ + class GetXpnHostProjectRequest implements IGetXpnHostProjectRequest { + + /** + * Constructs a new GetXpnHostProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetXpnHostProjectRequest); + + /** GetXpnHostProjectRequest project. */ + public project: string; + + /** + * Creates a new GetXpnHostProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetXpnHostProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetXpnHostProjectRequest): google.cloud.compute.v1.GetXpnHostProjectRequest; + + /** + * Encodes the specified GetXpnHostProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.GetXpnHostProjectRequest.verify|verify} messages. + * @param message GetXpnHostProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetXpnHostProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetXpnHostProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetXpnHostProjectRequest.verify|verify} messages. + * @param message GetXpnHostProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetXpnHostProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetXpnHostProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetXpnHostProjectRequest; + + /** + * Decodes a GetXpnHostProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetXpnHostProjectRequest; + + /** + * Verifies a GetXpnHostProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetXpnHostProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetXpnHostProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetXpnHostProjectRequest; + + /** + * Creates a plain object from a GetXpnHostProjectRequest message. Also converts values to other types if specified. + * @param message GetXpnHostProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetXpnHostProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetXpnHostProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetXpnResourcesProjectsRequest. */ + interface IGetXpnResourcesProjectsRequest { + + /** GetXpnResourcesProjectsRequest filter */ + filter?: (string|null); + + /** GetXpnResourcesProjectsRequest maxResults */ + maxResults?: (number|null); + + /** GetXpnResourcesProjectsRequest orderBy */ + orderBy?: (string|null); + + /** GetXpnResourcesProjectsRequest pageToken */ + pageToken?: (string|null); + + /** GetXpnResourcesProjectsRequest project */ + project?: (string|null); + + /** GetXpnResourcesProjectsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a GetXpnResourcesProjectsRequest. */ + class GetXpnResourcesProjectsRequest implements IGetXpnResourcesProjectsRequest { + + /** + * Constructs a new GetXpnResourcesProjectsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetXpnResourcesProjectsRequest); + + /** GetXpnResourcesProjectsRequest filter. */ + public filter?: (string|null); + + /** GetXpnResourcesProjectsRequest maxResults. */ + public maxResults?: (number|null); + + /** GetXpnResourcesProjectsRequest orderBy. */ + public orderBy?: (string|null); + + /** GetXpnResourcesProjectsRequest pageToken. */ + public pageToken?: (string|null); + + /** GetXpnResourcesProjectsRequest project. */ + public project: string; + + /** GetXpnResourcesProjectsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** GetXpnResourcesProjectsRequest _filter. */ + public _filter?: "filter"; + + /** GetXpnResourcesProjectsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** GetXpnResourcesProjectsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** GetXpnResourcesProjectsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** GetXpnResourcesProjectsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new GetXpnResourcesProjectsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetXpnResourcesProjectsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetXpnResourcesProjectsRequest): google.cloud.compute.v1.GetXpnResourcesProjectsRequest; + + /** + * Encodes the specified GetXpnResourcesProjectsRequest message. Does not implicitly {@link google.cloud.compute.v1.GetXpnResourcesProjectsRequest.verify|verify} messages. + * @param message GetXpnResourcesProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetXpnResourcesProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetXpnResourcesProjectsRequest.verify|verify} messages. + * @param message GetXpnResourcesProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetXpnResourcesProjectsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetXpnResourcesProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetXpnResourcesProjectsRequest; + + /** + * Decodes a GetXpnResourcesProjectsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetXpnResourcesProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetXpnResourcesProjectsRequest; + + /** + * Verifies a GetXpnResourcesProjectsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetXpnResourcesProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetXpnResourcesProjectsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetXpnResourcesProjectsRequest; + + /** + * Creates a plain object from a GetXpnResourcesProjectsRequest message. Also converts values to other types if specified. + * @param message GetXpnResourcesProjectsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetXpnResourcesProjectsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetXpnResourcesProjectsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListXpnHostsProjectsRequest. */ + interface IListXpnHostsProjectsRequest { + + /** ListXpnHostsProjectsRequest filter */ + filter?: (string|null); + + /** ListXpnHostsProjectsRequest maxResults */ + maxResults?: (number|null); + + /** ListXpnHostsProjectsRequest orderBy */ + orderBy?: (string|null); + + /** ListXpnHostsProjectsRequest pageToken */ + pageToken?: (string|null); + + /** ListXpnHostsProjectsRequest project */ + project?: (string|null); + + /** ListXpnHostsProjectsRequest projectsListXpnHostsRequestResource */ + projectsListXpnHostsRequestResource?: (google.cloud.compute.v1.IProjectsListXpnHostsRequest|null); + + /** ListXpnHostsProjectsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListXpnHostsProjectsRequest. */ + class ListXpnHostsProjectsRequest implements IListXpnHostsProjectsRequest { + + /** + * Constructs a new ListXpnHostsProjectsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListXpnHostsProjectsRequest); + + /** ListXpnHostsProjectsRequest filter. */ + public filter?: (string|null); + + /** ListXpnHostsProjectsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListXpnHostsProjectsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListXpnHostsProjectsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListXpnHostsProjectsRequest project. */ + public project: string; + + /** ListXpnHostsProjectsRequest projectsListXpnHostsRequestResource. */ + public projectsListXpnHostsRequestResource?: (google.cloud.compute.v1.IProjectsListXpnHostsRequest|null); + + /** ListXpnHostsProjectsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListXpnHostsProjectsRequest _filter. */ + public _filter?: "filter"; + + /** ListXpnHostsProjectsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListXpnHostsProjectsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListXpnHostsProjectsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListXpnHostsProjectsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListXpnHostsProjectsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListXpnHostsProjectsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListXpnHostsProjectsRequest): google.cloud.compute.v1.ListXpnHostsProjectsRequest; + + /** + * Encodes the specified ListXpnHostsProjectsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListXpnHostsProjectsRequest.verify|verify} messages. + * @param message ListXpnHostsProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListXpnHostsProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListXpnHostsProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListXpnHostsProjectsRequest.verify|verify} messages. + * @param message ListXpnHostsProjectsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListXpnHostsProjectsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListXpnHostsProjectsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListXpnHostsProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListXpnHostsProjectsRequest; + + /** + * Decodes a ListXpnHostsProjectsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListXpnHostsProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListXpnHostsProjectsRequest; + + /** + * Verifies a ListXpnHostsProjectsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListXpnHostsProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListXpnHostsProjectsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListXpnHostsProjectsRequest; + + /** + * Creates a plain object from a ListXpnHostsProjectsRequest message. Also converts values to other types if specified. + * @param message ListXpnHostsProjectsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListXpnHostsProjectsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListXpnHostsProjectsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MoveDiskProjectRequest. */ + interface IMoveDiskProjectRequest { + + /** MoveDiskProjectRequest diskMoveRequestResource */ + diskMoveRequestResource?: (google.cloud.compute.v1.IDiskMoveRequest|null); + + /** MoveDiskProjectRequest project */ + project?: (string|null); + + /** MoveDiskProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a MoveDiskProjectRequest. */ + class MoveDiskProjectRequest implements IMoveDiskProjectRequest { + + /** + * Constructs a new MoveDiskProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMoveDiskProjectRequest); + + /** MoveDiskProjectRequest diskMoveRequestResource. */ + public diskMoveRequestResource?: (google.cloud.compute.v1.IDiskMoveRequest|null); + + /** MoveDiskProjectRequest project. */ + public project: string; + + /** MoveDiskProjectRequest requestId. */ + public requestId?: (string|null); + + /** MoveDiskProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new MoveDiskProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveDiskProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IMoveDiskProjectRequest): google.cloud.compute.v1.MoveDiskProjectRequest; + + /** + * Encodes the specified MoveDiskProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.MoveDiskProjectRequest.verify|verify} messages. + * @param message MoveDiskProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMoveDiskProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveDiskProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MoveDiskProjectRequest.verify|verify} messages. + * @param message MoveDiskProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMoveDiskProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveDiskProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveDiskProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MoveDiskProjectRequest; + + /** + * Decodes a MoveDiskProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveDiskProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MoveDiskProjectRequest; + + /** + * Verifies a MoveDiskProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveDiskProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveDiskProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MoveDiskProjectRequest; + + /** + * Creates a plain object from a MoveDiskProjectRequest message. Also converts values to other types if specified. + * @param message MoveDiskProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MoveDiskProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveDiskProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MoveInstanceProjectRequest. */ + interface IMoveInstanceProjectRequest { + + /** MoveInstanceProjectRequest instanceMoveRequestResource */ + instanceMoveRequestResource?: (google.cloud.compute.v1.IInstanceMoveRequest|null); + + /** MoveInstanceProjectRequest project */ + project?: (string|null); + + /** MoveInstanceProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a MoveInstanceProjectRequest. */ + class MoveInstanceProjectRequest implements IMoveInstanceProjectRequest { + + /** + * Constructs a new MoveInstanceProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IMoveInstanceProjectRequest); + + /** MoveInstanceProjectRequest instanceMoveRequestResource. */ + public instanceMoveRequestResource?: (google.cloud.compute.v1.IInstanceMoveRequest|null); + + /** MoveInstanceProjectRequest project. */ + public project: string; + + /** MoveInstanceProjectRequest requestId. */ + public requestId?: (string|null); + + /** MoveInstanceProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new MoveInstanceProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveInstanceProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IMoveInstanceProjectRequest): google.cloud.compute.v1.MoveInstanceProjectRequest; + + /** + * Encodes the specified MoveInstanceProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.MoveInstanceProjectRequest.verify|verify} messages. + * @param message MoveInstanceProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IMoveInstanceProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveInstanceProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MoveInstanceProjectRequest.verify|verify} messages. + * @param message MoveInstanceProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IMoveInstanceProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveInstanceProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveInstanceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.MoveInstanceProjectRequest; + + /** + * Decodes a MoveInstanceProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveInstanceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.MoveInstanceProjectRequest; + + /** + * Verifies a MoveInstanceProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveInstanceProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveInstanceProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.MoveInstanceProjectRequest; + + /** + * Creates a plain object from a MoveInstanceProjectRequest message. Also converts values to other types if specified. + * @param message MoveInstanceProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.MoveInstanceProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveInstanceProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetCommonInstanceMetadataProjectRequest. */ + interface ISetCommonInstanceMetadataProjectRequest { + + /** SetCommonInstanceMetadataProjectRequest metadataResource */ + metadataResource?: (google.cloud.compute.v1.IMetadata|null); + + /** SetCommonInstanceMetadataProjectRequest project */ + project?: (string|null); + + /** SetCommonInstanceMetadataProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SetCommonInstanceMetadataProjectRequest. */ + class SetCommonInstanceMetadataProjectRequest implements ISetCommonInstanceMetadataProjectRequest { + + /** + * Constructs a new SetCommonInstanceMetadataProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest); + + /** SetCommonInstanceMetadataProjectRequest metadataResource. */ + public metadataResource?: (google.cloud.compute.v1.IMetadata|null); + + /** SetCommonInstanceMetadataProjectRequest project. */ + public project: string; + + /** SetCommonInstanceMetadataProjectRequest requestId. */ + public requestId?: (string|null); + + /** SetCommonInstanceMetadataProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetCommonInstanceMetadataProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetCommonInstanceMetadataProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest): google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest; + + /** + * Encodes the specified SetCommonInstanceMetadataProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest.verify|verify} messages. + * @param message SetCommonInstanceMetadataProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetCommonInstanceMetadataProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest.verify|verify} messages. + * @param message SetCommonInstanceMetadataProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetCommonInstanceMetadataProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetCommonInstanceMetadataProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest; + + /** + * Decodes a SetCommonInstanceMetadataProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetCommonInstanceMetadataProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest; + + /** + * Verifies a SetCommonInstanceMetadataProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetCommonInstanceMetadataProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetCommonInstanceMetadataProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest; + + /** + * Creates a plain object from a SetCommonInstanceMetadataProjectRequest message. Also converts values to other types if specified. + * @param message SetCommonInstanceMetadataProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetCommonInstanceMetadataProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetDefaultNetworkTierProjectRequest. */ + interface ISetDefaultNetworkTierProjectRequest { + + /** SetDefaultNetworkTierProjectRequest project */ + project?: (string|null); + + /** SetDefaultNetworkTierProjectRequest projectsSetDefaultNetworkTierRequestResource */ + projectsSetDefaultNetworkTierRequestResource?: (google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest|null); + + /** SetDefaultNetworkTierProjectRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SetDefaultNetworkTierProjectRequest. */ + class SetDefaultNetworkTierProjectRequest implements ISetDefaultNetworkTierProjectRequest { + + /** + * Constructs a new SetDefaultNetworkTierProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest); + + /** SetDefaultNetworkTierProjectRequest project. */ + public project: string; + + /** SetDefaultNetworkTierProjectRequest projectsSetDefaultNetworkTierRequestResource. */ + public projectsSetDefaultNetworkTierRequestResource?: (google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest|null); + + /** SetDefaultNetworkTierProjectRequest requestId. */ + public requestId?: (string|null); + + /** SetDefaultNetworkTierProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetDefaultNetworkTierProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetDefaultNetworkTierProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest): google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest; + + /** + * Encodes the specified SetDefaultNetworkTierProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest.verify|verify} messages. + * @param message SetDefaultNetworkTierProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetDefaultNetworkTierProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest.verify|verify} messages. + * @param message SetDefaultNetworkTierProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetDefaultNetworkTierProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetDefaultNetworkTierProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest; + + /** + * Decodes a SetDefaultNetworkTierProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetDefaultNetworkTierProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest; + + /** + * Verifies a SetDefaultNetworkTierProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetDefaultNetworkTierProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetDefaultNetworkTierProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest; + + /** + * Creates a plain object from a SetDefaultNetworkTierProjectRequest message. Also converts values to other types if specified. + * @param message SetDefaultNetworkTierProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetDefaultNetworkTierProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetUsageExportBucketProjectRequest. */ + interface ISetUsageExportBucketProjectRequest { + + /** SetUsageExportBucketProjectRequest project */ + project?: (string|null); + + /** SetUsageExportBucketProjectRequest requestId */ + requestId?: (string|null); + + /** SetUsageExportBucketProjectRequest usageExportLocationResource */ + usageExportLocationResource?: (google.cloud.compute.v1.IUsageExportLocation|null); + } + + /** Represents a SetUsageExportBucketProjectRequest. */ + class SetUsageExportBucketProjectRequest implements ISetUsageExportBucketProjectRequest { + + /** + * Constructs a new SetUsageExportBucketProjectRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetUsageExportBucketProjectRequest); + + /** SetUsageExportBucketProjectRequest project. */ + public project: string; + + /** SetUsageExportBucketProjectRequest requestId. */ + public requestId?: (string|null); + + /** SetUsageExportBucketProjectRequest usageExportLocationResource. */ + public usageExportLocationResource?: (google.cloud.compute.v1.IUsageExportLocation|null); + + /** SetUsageExportBucketProjectRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetUsageExportBucketProjectRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetUsageExportBucketProjectRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetUsageExportBucketProjectRequest): google.cloud.compute.v1.SetUsageExportBucketProjectRequest; + + /** + * Encodes the specified SetUsageExportBucketProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUsageExportBucketProjectRequest.verify|verify} messages. + * @param message SetUsageExportBucketProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetUsageExportBucketProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUsageExportBucketProjectRequest.verify|verify} messages. + * @param message SetUsageExportBucketProjectRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetUsageExportBucketProjectRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetUsageExportBucketProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetUsageExportBucketProjectRequest; + + /** + * Decodes a SetUsageExportBucketProjectRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetUsageExportBucketProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetUsageExportBucketProjectRequest; + + /** + * Verifies a SetUsageExportBucketProjectRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetUsageExportBucketProjectRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetUsageExportBucketProjectRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetUsageExportBucketProjectRequest; + + /** + * Creates a plain object from a SetUsageExportBucketProjectRequest message. Also converts values to other types if specified. + * @param message SetUsageExportBucketProjectRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetUsageExportBucketProjectRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetUsageExportBucketProjectRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeletePublicAdvertisedPrefixeRequest. */ + interface IDeletePublicAdvertisedPrefixeRequest { + + /** DeletePublicAdvertisedPrefixeRequest project */ + project?: (string|null); + + /** DeletePublicAdvertisedPrefixeRequest publicAdvertisedPrefix */ + publicAdvertisedPrefix?: (string|null); + + /** DeletePublicAdvertisedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeletePublicAdvertisedPrefixeRequest. */ + class DeletePublicAdvertisedPrefixeRequest implements IDeletePublicAdvertisedPrefixeRequest { + + /** + * Constructs a new DeletePublicAdvertisedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest); + + /** DeletePublicAdvertisedPrefixeRequest project. */ + public project: string; + + /** DeletePublicAdvertisedPrefixeRequest publicAdvertisedPrefix. */ + public publicAdvertisedPrefix: string; + + /** DeletePublicAdvertisedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** DeletePublicAdvertisedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeletePublicAdvertisedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePublicAdvertisedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest): google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest; + + /** + * Encodes the specified DeletePublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message DeletePublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message DeletePublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest; + + /** + * Decodes a DeletePublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest; + + /** + * Verifies a DeletePublicAdvertisedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePublicAdvertisedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest; + + /** + * Creates a plain object from a DeletePublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @param message DeletePublicAdvertisedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePublicAdvertisedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetPublicAdvertisedPrefixeRequest. */ + interface IGetPublicAdvertisedPrefixeRequest { + + /** GetPublicAdvertisedPrefixeRequest project */ + project?: (string|null); + + /** GetPublicAdvertisedPrefixeRequest publicAdvertisedPrefix */ + publicAdvertisedPrefix?: (string|null); + } + + /** Represents a GetPublicAdvertisedPrefixeRequest. */ + class GetPublicAdvertisedPrefixeRequest implements IGetPublicAdvertisedPrefixeRequest { + + /** + * Constructs a new GetPublicAdvertisedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest); + + /** GetPublicAdvertisedPrefixeRequest project. */ + public project: string; + + /** GetPublicAdvertisedPrefixeRequest publicAdvertisedPrefix. */ + public publicAdvertisedPrefix: string; + + /** + * Creates a new GetPublicAdvertisedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPublicAdvertisedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest): google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest; + + /** + * Encodes the specified GetPublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message GetPublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message GetPublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest; + + /** + * Decodes a GetPublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest; + + /** + * Verifies a GetPublicAdvertisedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPublicAdvertisedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest; + + /** + * Creates a plain object from a GetPublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @param message GetPublicAdvertisedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPublicAdvertisedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertPublicAdvertisedPrefixeRequest. */ + interface IInsertPublicAdvertisedPrefixeRequest { + + /** InsertPublicAdvertisedPrefixeRequest project */ + project?: (string|null); + + /** InsertPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource */ + publicAdvertisedPrefixResource?: (google.cloud.compute.v1.IPublicAdvertisedPrefix|null); + + /** InsertPublicAdvertisedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertPublicAdvertisedPrefixeRequest. */ + class InsertPublicAdvertisedPrefixeRequest implements IInsertPublicAdvertisedPrefixeRequest { + + /** + * Constructs a new InsertPublicAdvertisedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest); + + /** InsertPublicAdvertisedPrefixeRequest project. */ + public project: string; + + /** InsertPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource. */ + public publicAdvertisedPrefixResource?: (google.cloud.compute.v1.IPublicAdvertisedPrefix|null); + + /** InsertPublicAdvertisedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** InsertPublicAdvertisedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertPublicAdvertisedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertPublicAdvertisedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest): google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest; + + /** + * Encodes the specified InsertPublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message InsertPublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertPublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message InsertPublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertPublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest; + + /** + * Decodes an InsertPublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest; + + /** + * Verifies an InsertPublicAdvertisedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertPublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertPublicAdvertisedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest; + + /** + * Creates a plain object from an InsertPublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @param message InsertPublicAdvertisedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertPublicAdvertisedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPublicAdvertisedPrefixesRequest. */ + interface IListPublicAdvertisedPrefixesRequest { + + /** ListPublicAdvertisedPrefixesRequest filter */ + filter?: (string|null); + + /** ListPublicAdvertisedPrefixesRequest maxResults */ + maxResults?: (number|null); + + /** ListPublicAdvertisedPrefixesRequest orderBy */ + orderBy?: (string|null); + + /** ListPublicAdvertisedPrefixesRequest pageToken */ + pageToken?: (string|null); + + /** ListPublicAdvertisedPrefixesRequest project */ + project?: (string|null); + + /** ListPublicAdvertisedPrefixesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListPublicAdvertisedPrefixesRequest. */ + class ListPublicAdvertisedPrefixesRequest implements IListPublicAdvertisedPrefixesRequest { + + /** + * Constructs a new ListPublicAdvertisedPrefixesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest); + + /** ListPublicAdvertisedPrefixesRequest filter. */ + public filter?: (string|null); + + /** ListPublicAdvertisedPrefixesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListPublicAdvertisedPrefixesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListPublicAdvertisedPrefixesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListPublicAdvertisedPrefixesRequest project. */ + public project: string; + + /** ListPublicAdvertisedPrefixesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListPublicAdvertisedPrefixesRequest _filter. */ + public _filter?: "filter"; + + /** ListPublicAdvertisedPrefixesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListPublicAdvertisedPrefixesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListPublicAdvertisedPrefixesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListPublicAdvertisedPrefixesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListPublicAdvertisedPrefixesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPublicAdvertisedPrefixesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest): google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest; + + /** + * Encodes the specified ListPublicAdvertisedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest.verify|verify} messages. + * @param message ListPublicAdvertisedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPublicAdvertisedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest.verify|verify} messages. + * @param message ListPublicAdvertisedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPublicAdvertisedPrefixesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPublicAdvertisedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest; + + /** + * Decodes a ListPublicAdvertisedPrefixesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPublicAdvertisedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest; + + /** + * Verifies a ListPublicAdvertisedPrefixesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPublicAdvertisedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPublicAdvertisedPrefixesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest; + + /** + * Creates a plain object from a ListPublicAdvertisedPrefixesRequest message. Also converts values to other types if specified. + * @param message ListPublicAdvertisedPrefixesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPublicAdvertisedPrefixesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchPublicAdvertisedPrefixeRequest. */ + interface IPatchPublicAdvertisedPrefixeRequest { + + /** PatchPublicAdvertisedPrefixeRequest project */ + project?: (string|null); + + /** PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefix */ + publicAdvertisedPrefix?: (string|null); + + /** PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource */ + publicAdvertisedPrefixResource?: (google.cloud.compute.v1.IPublicAdvertisedPrefix|null); + + /** PatchPublicAdvertisedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchPublicAdvertisedPrefixeRequest. */ + class PatchPublicAdvertisedPrefixeRequest implements IPatchPublicAdvertisedPrefixeRequest { + + /** + * Constructs a new PatchPublicAdvertisedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest); + + /** PatchPublicAdvertisedPrefixeRequest project. */ + public project: string; + + /** PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefix. */ + public publicAdvertisedPrefix: string; + + /** PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource. */ + public publicAdvertisedPrefixResource?: (google.cloud.compute.v1.IPublicAdvertisedPrefix|null); + + /** PatchPublicAdvertisedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** PatchPublicAdvertisedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchPublicAdvertisedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchPublicAdvertisedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest): google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest; + + /** + * Encodes the specified PatchPublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message PatchPublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchPublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @param message PatchPublicAdvertisedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchPublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest; + + /** + * Decodes a PatchPublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest; + + /** + * Verifies a PatchPublicAdvertisedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchPublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchPublicAdvertisedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest; + + /** + * Creates a plain object from a PatchPublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @param message PatchPublicAdvertisedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchPublicAdvertisedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListPublicDelegatedPrefixesRequest. */ + interface IAggregatedListPublicDelegatedPrefixesRequest { + + /** AggregatedListPublicDelegatedPrefixesRequest filter */ + filter?: (string|null); + + /** AggregatedListPublicDelegatedPrefixesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListPublicDelegatedPrefixesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListPublicDelegatedPrefixesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListPublicDelegatedPrefixesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListPublicDelegatedPrefixesRequest project */ + project?: (string|null); + + /** AggregatedListPublicDelegatedPrefixesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListPublicDelegatedPrefixesRequest. */ + class AggregatedListPublicDelegatedPrefixesRequest implements IAggregatedListPublicDelegatedPrefixesRequest { + + /** + * Constructs a new AggregatedListPublicDelegatedPrefixesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest); + + /** AggregatedListPublicDelegatedPrefixesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListPublicDelegatedPrefixesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListPublicDelegatedPrefixesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListPublicDelegatedPrefixesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListPublicDelegatedPrefixesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListPublicDelegatedPrefixesRequest project. */ + public project: string; + + /** AggregatedListPublicDelegatedPrefixesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListPublicDelegatedPrefixesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListPublicDelegatedPrefixesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListPublicDelegatedPrefixesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListPublicDelegatedPrefixesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListPublicDelegatedPrefixesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListPublicDelegatedPrefixesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListPublicDelegatedPrefixesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListPublicDelegatedPrefixesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest): google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest; + + /** + * Encodes the specified AggregatedListPublicDelegatedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @param message AggregatedListPublicDelegatedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListPublicDelegatedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @param message AggregatedListPublicDelegatedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListPublicDelegatedPrefixesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest; + + /** + * Decodes an AggregatedListPublicDelegatedPrefixesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest; + + /** + * Verifies an AggregatedListPublicDelegatedPrefixesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListPublicDelegatedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListPublicDelegatedPrefixesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest; + + /** + * Creates a plain object from an AggregatedListPublicDelegatedPrefixesRequest message. Also converts values to other types if specified. + * @param message AggregatedListPublicDelegatedPrefixesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListPublicDelegatedPrefixesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeletePublicDelegatedPrefixeRequest. */ + interface IDeletePublicDelegatedPrefixeRequest { + + /** DeletePublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** DeletePublicDelegatedPrefixeRequest publicDelegatedPrefix */ + publicDelegatedPrefix?: (string|null); + + /** DeletePublicDelegatedPrefixeRequest region */ + region?: (string|null); + + /** DeletePublicDelegatedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeletePublicDelegatedPrefixeRequest. */ + class DeletePublicDelegatedPrefixeRequest implements IDeletePublicDelegatedPrefixeRequest { + + /** + * Constructs a new DeletePublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest); + + /** DeletePublicDelegatedPrefixeRequest project. */ + public project: string; + + /** DeletePublicDelegatedPrefixeRequest publicDelegatedPrefix. */ + public publicDelegatedPrefix: string; + + /** DeletePublicDelegatedPrefixeRequest region. */ + public region: string; + + /** DeletePublicDelegatedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** DeletePublicDelegatedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeletePublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest): google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest; + + /** + * Encodes the specified DeletePublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message DeletePublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message DeletePublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest; + + /** + * Decodes a DeletePublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest; + + /** + * Verifies a DeletePublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from a DeletePublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message DeletePublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetPublicDelegatedPrefixeRequest. */ + interface IGetPublicDelegatedPrefixeRequest { + + /** GetPublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** GetPublicDelegatedPrefixeRequest publicDelegatedPrefix */ + publicDelegatedPrefix?: (string|null); + + /** GetPublicDelegatedPrefixeRequest region */ + region?: (string|null); + } + + /** Represents a GetPublicDelegatedPrefixeRequest. */ + class GetPublicDelegatedPrefixeRequest implements IGetPublicDelegatedPrefixeRequest { + + /** + * Constructs a new GetPublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest); + + /** GetPublicDelegatedPrefixeRequest project. */ + public project: string; + + /** GetPublicDelegatedPrefixeRequest publicDelegatedPrefix. */ + public publicDelegatedPrefix: string; + + /** GetPublicDelegatedPrefixeRequest region. */ + public region: string; + + /** + * Creates a new GetPublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest): google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest; + + /** + * Encodes the specified GetPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message GetPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message GetPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest; + + /** + * Decodes a GetPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest; + + /** + * Verifies a GetPublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from a GetPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message GetPublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertPublicDelegatedPrefixeRequest. */ + interface IInsertPublicDelegatedPrefixeRequest { + + /** InsertPublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** InsertPublicDelegatedPrefixeRequest publicDelegatedPrefixResource */ + publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** InsertPublicDelegatedPrefixeRequest region */ + region?: (string|null); + + /** InsertPublicDelegatedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertPublicDelegatedPrefixeRequest. */ + class InsertPublicDelegatedPrefixeRequest implements IInsertPublicDelegatedPrefixeRequest { + + /** + * Constructs a new InsertPublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest); + + /** InsertPublicDelegatedPrefixeRequest project. */ + public project: string; + + /** InsertPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. */ + public publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** InsertPublicDelegatedPrefixeRequest region. */ + public region: string; + + /** InsertPublicDelegatedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** InsertPublicDelegatedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertPublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertPublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest): google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest; + + /** + * Encodes the specified InsertPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message InsertPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message InsertPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest; + + /** + * Decodes an InsertPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest; + + /** + * Verifies an InsertPublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertPublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from an InsertPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message InsertPublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertPublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPublicDelegatedPrefixesRequest. */ + interface IListPublicDelegatedPrefixesRequest { + + /** ListPublicDelegatedPrefixesRequest filter */ + filter?: (string|null); + + /** ListPublicDelegatedPrefixesRequest maxResults */ + maxResults?: (number|null); + + /** ListPublicDelegatedPrefixesRequest orderBy */ + orderBy?: (string|null); + + /** ListPublicDelegatedPrefixesRequest pageToken */ + pageToken?: (string|null); + + /** ListPublicDelegatedPrefixesRequest project */ + project?: (string|null); + + /** ListPublicDelegatedPrefixesRequest region */ + region?: (string|null); + + /** ListPublicDelegatedPrefixesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListPublicDelegatedPrefixesRequest. */ + class ListPublicDelegatedPrefixesRequest implements IListPublicDelegatedPrefixesRequest { + + /** + * Constructs a new ListPublicDelegatedPrefixesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest); + + /** ListPublicDelegatedPrefixesRequest filter. */ + public filter?: (string|null); + + /** ListPublicDelegatedPrefixesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListPublicDelegatedPrefixesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListPublicDelegatedPrefixesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListPublicDelegatedPrefixesRequest project. */ + public project: string; + + /** ListPublicDelegatedPrefixesRequest region. */ + public region: string; + + /** ListPublicDelegatedPrefixesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListPublicDelegatedPrefixesRequest _filter. */ + public _filter?: "filter"; + + /** ListPublicDelegatedPrefixesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListPublicDelegatedPrefixesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListPublicDelegatedPrefixesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListPublicDelegatedPrefixesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListPublicDelegatedPrefixesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPublicDelegatedPrefixesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest): google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest; + + /** + * Encodes the specified ListPublicDelegatedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @param message ListPublicDelegatedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPublicDelegatedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @param message ListPublicDelegatedPrefixesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPublicDelegatedPrefixesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest; + + /** + * Decodes a ListPublicDelegatedPrefixesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest; + + /** + * Verifies a ListPublicDelegatedPrefixesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPublicDelegatedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPublicDelegatedPrefixesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest; + + /** + * Creates a plain object from a ListPublicDelegatedPrefixesRequest message. Also converts values to other types if specified. + * @param message ListPublicDelegatedPrefixesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPublicDelegatedPrefixesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchPublicDelegatedPrefixeRequest. */ + interface IPatchPublicDelegatedPrefixeRequest { + + /** PatchPublicDelegatedPrefixeRequest project */ + project?: (string|null); + + /** PatchPublicDelegatedPrefixeRequest publicDelegatedPrefix */ + publicDelegatedPrefix?: (string|null); + + /** PatchPublicDelegatedPrefixeRequest publicDelegatedPrefixResource */ + publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** PatchPublicDelegatedPrefixeRequest region */ + region?: (string|null); + + /** PatchPublicDelegatedPrefixeRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchPublicDelegatedPrefixeRequest. */ + class PatchPublicDelegatedPrefixeRequest implements IPatchPublicDelegatedPrefixeRequest { + + /** + * Constructs a new PatchPublicDelegatedPrefixeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest); + + /** PatchPublicDelegatedPrefixeRequest project. */ + public project: string; + + /** PatchPublicDelegatedPrefixeRequest publicDelegatedPrefix. */ + public publicDelegatedPrefix: string; + + /** PatchPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. */ + public publicDelegatedPrefixResource?: (google.cloud.compute.v1.IPublicDelegatedPrefix|null); + + /** PatchPublicDelegatedPrefixeRequest region. */ + public region: string; + + /** PatchPublicDelegatedPrefixeRequest requestId. */ + public requestId?: (string|null); + + /** PatchPublicDelegatedPrefixeRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchPublicDelegatedPrefixeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchPublicDelegatedPrefixeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest): google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest; + + /** + * Encodes the specified PatchPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message PatchPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest.verify|verify} messages. + * @param message PatchPublicDelegatedPrefixeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest; + + /** + * Decodes a PatchPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest; + + /** + * Verifies a PatchPublicDelegatedPrefixeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchPublicDelegatedPrefixeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest; + + /** + * Creates a plain object from a PatchPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @param message PatchPublicDelegatedPrefixeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchPublicDelegatedPrefixeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionAutoscalerRequest. */ + interface IDeleteRegionAutoscalerRequest { + + /** DeleteRegionAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** DeleteRegionAutoscalerRequest project */ + project?: (string|null); + + /** DeleteRegionAutoscalerRequest region */ + region?: (string|null); + + /** DeleteRegionAutoscalerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionAutoscalerRequest. */ + class DeleteRegionAutoscalerRequest implements IDeleteRegionAutoscalerRequest { + + /** + * Constructs a new DeleteRegionAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionAutoscalerRequest); + + /** DeleteRegionAutoscalerRequest autoscaler. */ + public autoscaler: string; + + /** DeleteRegionAutoscalerRequest project. */ + public project: string; + + /** DeleteRegionAutoscalerRequest region. */ + public region: string; + + /** DeleteRegionAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionAutoscalerRequest): google.cloud.compute.v1.DeleteRegionAutoscalerRequest; + + /** + * Encodes the specified DeleteRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionAutoscalerRequest.verify|verify} messages. + * @param message DeleteRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionAutoscalerRequest.verify|verify} messages. + * @param message DeleteRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionAutoscalerRequest; + + /** + * Decodes a DeleteRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionAutoscalerRequest; + + /** + * Verifies a DeleteRegionAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionAutoscalerRequest; + + /** + * Creates a plain object from a DeleteRegionAutoscalerRequest message. Also converts values to other types if specified. + * @param message DeleteRegionAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionAutoscalerRequest. */ + interface IGetRegionAutoscalerRequest { + + /** GetRegionAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** GetRegionAutoscalerRequest project */ + project?: (string|null); + + /** GetRegionAutoscalerRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionAutoscalerRequest. */ + class GetRegionAutoscalerRequest implements IGetRegionAutoscalerRequest { + + /** + * Constructs a new GetRegionAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionAutoscalerRequest); + + /** GetRegionAutoscalerRequest autoscaler. */ + public autoscaler: string; + + /** GetRegionAutoscalerRequest project. */ + public project: string; + + /** GetRegionAutoscalerRequest region. */ + public region: string; + + /** + * Creates a new GetRegionAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionAutoscalerRequest): google.cloud.compute.v1.GetRegionAutoscalerRequest; + + /** + * Encodes the specified GetRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionAutoscalerRequest.verify|verify} messages. + * @param message GetRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionAutoscalerRequest.verify|verify} messages. + * @param message GetRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionAutoscalerRequest; + + /** + * Decodes a GetRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionAutoscalerRequest; + + /** + * Verifies a GetRegionAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionAutoscalerRequest; + + /** + * Creates a plain object from a GetRegionAutoscalerRequest message. Also converts values to other types if specified. + * @param message GetRegionAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionAutoscalerRequest. */ + interface IInsertRegionAutoscalerRequest { + + /** InsertRegionAutoscalerRequest autoscalerResource */ + autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** InsertRegionAutoscalerRequest project */ + project?: (string|null); + + /** InsertRegionAutoscalerRequest region */ + region?: (string|null); + + /** InsertRegionAutoscalerRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionAutoscalerRequest. */ + class InsertRegionAutoscalerRequest implements IInsertRegionAutoscalerRequest { + + /** + * Constructs a new InsertRegionAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionAutoscalerRequest); + + /** InsertRegionAutoscalerRequest autoscalerResource. */ + public autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** InsertRegionAutoscalerRequest project. */ + public project: string; + + /** InsertRegionAutoscalerRequest region. */ + public region: string; + + /** InsertRegionAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionAutoscalerRequest): google.cloud.compute.v1.InsertRegionAutoscalerRequest; + + /** + * Encodes the specified InsertRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionAutoscalerRequest.verify|verify} messages. + * @param message InsertRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionAutoscalerRequest.verify|verify} messages. + * @param message InsertRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionAutoscalerRequest; + + /** + * Decodes an InsertRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionAutoscalerRequest; + + /** + * Verifies an InsertRegionAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionAutoscalerRequest; + + /** + * Creates a plain object from an InsertRegionAutoscalerRequest message. Also converts values to other types if specified. + * @param message InsertRegionAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionAutoscalersRequest. */ + interface IListRegionAutoscalersRequest { + + /** ListRegionAutoscalersRequest filter */ + filter?: (string|null); + + /** ListRegionAutoscalersRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionAutoscalersRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionAutoscalersRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionAutoscalersRequest project */ + project?: (string|null); + + /** ListRegionAutoscalersRequest region */ + region?: (string|null); + + /** ListRegionAutoscalersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionAutoscalersRequest. */ + class ListRegionAutoscalersRequest implements IListRegionAutoscalersRequest { + + /** + * Constructs a new ListRegionAutoscalersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionAutoscalersRequest); + + /** ListRegionAutoscalersRequest filter. */ + public filter?: (string|null); + + /** ListRegionAutoscalersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionAutoscalersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionAutoscalersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionAutoscalersRequest project. */ + public project: string; + + /** ListRegionAutoscalersRequest region. */ + public region: string; + + /** ListRegionAutoscalersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionAutoscalersRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionAutoscalersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionAutoscalersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionAutoscalersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionAutoscalersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionAutoscalersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionAutoscalersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionAutoscalersRequest): google.cloud.compute.v1.ListRegionAutoscalersRequest; + + /** + * Encodes the specified ListRegionAutoscalersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionAutoscalersRequest.verify|verify} messages. + * @param message ListRegionAutoscalersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionAutoscalersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionAutoscalersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionAutoscalersRequest.verify|verify} messages. + * @param message ListRegionAutoscalersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionAutoscalersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionAutoscalersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionAutoscalersRequest; + + /** + * Decodes a ListRegionAutoscalersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionAutoscalersRequest; + + /** + * Verifies a ListRegionAutoscalersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionAutoscalersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionAutoscalersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionAutoscalersRequest; + + /** + * Creates a plain object from a ListRegionAutoscalersRequest message. Also converts values to other types if specified. + * @param message ListRegionAutoscalersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionAutoscalersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionAutoscalersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRegionAutoscalerRequest. */ + interface IPatchRegionAutoscalerRequest { + + /** PatchRegionAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** PatchRegionAutoscalerRequest autoscalerResource */ + autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** PatchRegionAutoscalerRequest project */ + project?: (string|null); + + /** PatchRegionAutoscalerRequest region */ + region?: (string|null); + + /** PatchRegionAutoscalerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchRegionAutoscalerRequest. */ + class PatchRegionAutoscalerRequest implements IPatchRegionAutoscalerRequest { + + /** + * Constructs a new PatchRegionAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRegionAutoscalerRequest); + + /** PatchRegionAutoscalerRequest autoscaler. */ + public autoscaler?: (string|null); + + /** PatchRegionAutoscalerRequest autoscalerResource. */ + public autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** PatchRegionAutoscalerRequest project. */ + public project: string; + + /** PatchRegionAutoscalerRequest region. */ + public region: string; + + /** PatchRegionAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** PatchRegionAutoscalerRequest _autoscaler. */ + public _autoscaler?: "autoscaler"; + + /** PatchRegionAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRegionAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRegionAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRegionAutoscalerRequest): google.cloud.compute.v1.PatchRegionAutoscalerRequest; + + /** + * Encodes the specified PatchRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionAutoscalerRequest.verify|verify} messages. + * @param message PatchRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionAutoscalerRequest.verify|verify} messages. + * @param message PatchRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRegionAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRegionAutoscalerRequest; + + /** + * Decodes a PatchRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRegionAutoscalerRequest; + + /** + * Verifies a PatchRegionAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRegionAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRegionAutoscalerRequest; + + /** + * Creates a plain object from a PatchRegionAutoscalerRequest message. Also converts values to other types if specified. + * @param message PatchRegionAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRegionAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRegionAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateRegionAutoscalerRequest. */ + interface IUpdateRegionAutoscalerRequest { + + /** UpdateRegionAutoscalerRequest autoscaler */ + autoscaler?: (string|null); + + /** UpdateRegionAutoscalerRequest autoscalerResource */ + autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** UpdateRegionAutoscalerRequest project */ + project?: (string|null); + + /** UpdateRegionAutoscalerRequest region */ + region?: (string|null); + + /** UpdateRegionAutoscalerRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateRegionAutoscalerRequest. */ + class UpdateRegionAutoscalerRequest implements IUpdateRegionAutoscalerRequest { + + /** + * Constructs a new UpdateRegionAutoscalerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateRegionAutoscalerRequest); + + /** UpdateRegionAutoscalerRequest autoscaler. */ + public autoscaler?: (string|null); + + /** UpdateRegionAutoscalerRequest autoscalerResource. */ + public autoscalerResource?: (google.cloud.compute.v1.IAutoscaler|null); + + /** UpdateRegionAutoscalerRequest project. */ + public project: string; + + /** UpdateRegionAutoscalerRequest region. */ + public region: string; + + /** UpdateRegionAutoscalerRequest requestId. */ + public requestId?: (string|null); + + /** UpdateRegionAutoscalerRequest _autoscaler. */ + public _autoscaler?: "autoscaler"; + + /** UpdateRegionAutoscalerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateRegionAutoscalerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRegionAutoscalerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateRegionAutoscalerRequest): google.cloud.compute.v1.UpdateRegionAutoscalerRequest; + + /** + * Encodes the specified UpdateRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionAutoscalerRequest.verify|verify} messages. + * @param message UpdateRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionAutoscalerRequest.verify|verify} messages. + * @param message UpdateRegionAutoscalerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRegionAutoscalerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateRegionAutoscalerRequest; + + /** + * Decodes an UpdateRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateRegionAutoscalerRequest; + + /** + * Verifies an UpdateRegionAutoscalerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRegionAutoscalerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateRegionAutoscalerRequest; + + /** + * Creates a plain object from an UpdateRegionAutoscalerRequest message. Also converts values to other types if specified. + * @param message UpdateRegionAutoscalerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateRegionAutoscalerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRegionAutoscalerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionBackendServiceRequest. */ + interface IDeleteRegionBackendServiceRequest { + + /** DeleteRegionBackendServiceRequest backendService */ + backendService?: (string|null); + + /** DeleteRegionBackendServiceRequest project */ + project?: (string|null); + + /** DeleteRegionBackendServiceRequest region */ + region?: (string|null); + + /** DeleteRegionBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionBackendServiceRequest. */ + class DeleteRegionBackendServiceRequest implements IDeleteRegionBackendServiceRequest { + + /** + * Constructs a new DeleteRegionBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionBackendServiceRequest); + + /** DeleteRegionBackendServiceRequest backendService. */ + public backendService: string; + + /** DeleteRegionBackendServiceRequest project. */ + public project: string; + + /** DeleteRegionBackendServiceRequest region. */ + public region: string; + + /** DeleteRegionBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionBackendServiceRequest): google.cloud.compute.v1.DeleteRegionBackendServiceRequest; + + /** + * Encodes the specified DeleteRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionBackendServiceRequest.verify|verify} messages. + * @param message DeleteRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionBackendServiceRequest.verify|verify} messages. + * @param message DeleteRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionBackendServiceRequest; + + /** + * Decodes a DeleteRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionBackendServiceRequest; + + /** + * Verifies a DeleteRegionBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionBackendServiceRequest; + + /** + * Creates a plain object from a DeleteRegionBackendServiceRequest message. Also converts values to other types if specified. + * @param message DeleteRegionBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionBackendServiceRequest. */ + interface IGetRegionBackendServiceRequest { + + /** GetRegionBackendServiceRequest backendService */ + backendService?: (string|null); + + /** GetRegionBackendServiceRequest project */ + project?: (string|null); + + /** GetRegionBackendServiceRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionBackendServiceRequest. */ + class GetRegionBackendServiceRequest implements IGetRegionBackendServiceRequest { + + /** + * Constructs a new GetRegionBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionBackendServiceRequest); + + /** GetRegionBackendServiceRequest backendService. */ + public backendService: string; + + /** GetRegionBackendServiceRequest project. */ + public project: string; + + /** GetRegionBackendServiceRequest region. */ + public region: string; + + /** + * Creates a new GetRegionBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionBackendServiceRequest): google.cloud.compute.v1.GetRegionBackendServiceRequest; + + /** + * Encodes the specified GetRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionBackendServiceRequest.verify|verify} messages. + * @param message GetRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionBackendServiceRequest.verify|verify} messages. + * @param message GetRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionBackendServiceRequest; + + /** + * Decodes a GetRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionBackendServiceRequest; + + /** + * Verifies a GetRegionBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionBackendServiceRequest; + + /** + * Creates a plain object from a GetRegionBackendServiceRequest message. Also converts values to other types if specified. + * @param message GetRegionBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetHealthRegionBackendServiceRequest. */ + interface IGetHealthRegionBackendServiceRequest { + + /** GetHealthRegionBackendServiceRequest backendService */ + backendService?: (string|null); + + /** GetHealthRegionBackendServiceRequest project */ + project?: (string|null); + + /** GetHealthRegionBackendServiceRequest region */ + region?: (string|null); + + /** GetHealthRegionBackendServiceRequest resourceGroupReferenceResource */ + resourceGroupReferenceResource?: (google.cloud.compute.v1.IResourceGroupReference|null); + } + + /** Represents a GetHealthRegionBackendServiceRequest. */ + class GetHealthRegionBackendServiceRequest implements IGetHealthRegionBackendServiceRequest { + + /** + * Constructs a new GetHealthRegionBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest); + + /** GetHealthRegionBackendServiceRequest backendService. */ + public backendService: string; + + /** GetHealthRegionBackendServiceRequest project. */ + public project: string; + + /** GetHealthRegionBackendServiceRequest region. */ + public region: string; + + /** GetHealthRegionBackendServiceRequest resourceGroupReferenceResource. */ + public resourceGroupReferenceResource?: (google.cloud.compute.v1.IResourceGroupReference|null); + + /** + * Creates a new GetHealthRegionBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHealthRegionBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest): google.cloud.compute.v1.GetHealthRegionBackendServiceRequest; + + /** + * Encodes the specified GetHealthRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthRegionBackendServiceRequest.verify|verify} messages. + * @param message GetHealthRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHealthRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthRegionBackendServiceRequest.verify|verify} messages. + * @param message GetHealthRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHealthRegionBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHealthRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetHealthRegionBackendServiceRequest; + + /** + * Decodes a GetHealthRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHealthRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetHealthRegionBackendServiceRequest; + + /** + * Verifies a GetHealthRegionBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHealthRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHealthRegionBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetHealthRegionBackendServiceRequest; + + /** + * Creates a plain object from a GetHealthRegionBackendServiceRequest message. Also converts values to other types if specified. + * @param message GetHealthRegionBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetHealthRegionBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHealthRegionBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionBackendServiceRequest. */ + interface IInsertRegionBackendServiceRequest { + + /** InsertRegionBackendServiceRequest backendServiceResource */ + backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** InsertRegionBackendServiceRequest project */ + project?: (string|null); + + /** InsertRegionBackendServiceRequest region */ + region?: (string|null); + + /** InsertRegionBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionBackendServiceRequest. */ + class InsertRegionBackendServiceRequest implements IInsertRegionBackendServiceRequest { + + /** + * Constructs a new InsertRegionBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionBackendServiceRequest); + + /** InsertRegionBackendServiceRequest backendServiceResource. */ + public backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** InsertRegionBackendServiceRequest project. */ + public project: string; + + /** InsertRegionBackendServiceRequest region. */ + public region: string; + + /** InsertRegionBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionBackendServiceRequest): google.cloud.compute.v1.InsertRegionBackendServiceRequest; + + /** + * Encodes the specified InsertRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionBackendServiceRequest.verify|verify} messages. + * @param message InsertRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionBackendServiceRequest.verify|verify} messages. + * @param message InsertRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionBackendServiceRequest; + + /** + * Decodes an InsertRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionBackendServiceRequest; + + /** + * Verifies an InsertRegionBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionBackendServiceRequest; + + /** + * Creates a plain object from an InsertRegionBackendServiceRequest message. Also converts values to other types if specified. + * @param message InsertRegionBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionBackendServicesRequest. */ + interface IListRegionBackendServicesRequest { + + /** ListRegionBackendServicesRequest filter */ + filter?: (string|null); + + /** ListRegionBackendServicesRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionBackendServicesRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionBackendServicesRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionBackendServicesRequest project */ + project?: (string|null); + + /** ListRegionBackendServicesRequest region */ + region?: (string|null); + + /** ListRegionBackendServicesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionBackendServicesRequest. */ + class ListRegionBackendServicesRequest implements IListRegionBackendServicesRequest { + + /** + * Constructs a new ListRegionBackendServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionBackendServicesRequest); + + /** ListRegionBackendServicesRequest filter. */ + public filter?: (string|null); + + /** ListRegionBackendServicesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionBackendServicesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionBackendServicesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionBackendServicesRequest project. */ + public project: string; + + /** ListRegionBackendServicesRequest region. */ + public region: string; + + /** ListRegionBackendServicesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionBackendServicesRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionBackendServicesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionBackendServicesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionBackendServicesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionBackendServicesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionBackendServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionBackendServicesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionBackendServicesRequest): google.cloud.compute.v1.ListRegionBackendServicesRequest; + + /** + * Encodes the specified ListRegionBackendServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionBackendServicesRequest.verify|verify} messages. + * @param message ListRegionBackendServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionBackendServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionBackendServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionBackendServicesRequest.verify|verify} messages. + * @param message ListRegionBackendServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionBackendServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionBackendServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionBackendServicesRequest; + + /** + * Decodes a ListRegionBackendServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionBackendServicesRequest; + + /** + * Verifies a ListRegionBackendServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionBackendServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionBackendServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionBackendServicesRequest; + + /** + * Creates a plain object from a ListRegionBackendServicesRequest message. Also converts values to other types if specified. + * @param message ListRegionBackendServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionBackendServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionBackendServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRegionBackendServiceRequest. */ + interface IPatchRegionBackendServiceRequest { + + /** PatchRegionBackendServiceRequest backendService */ + backendService?: (string|null); + + /** PatchRegionBackendServiceRequest backendServiceResource */ + backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** PatchRegionBackendServiceRequest project */ + project?: (string|null); + + /** PatchRegionBackendServiceRequest region */ + region?: (string|null); + + /** PatchRegionBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchRegionBackendServiceRequest. */ + class PatchRegionBackendServiceRequest implements IPatchRegionBackendServiceRequest { + + /** + * Constructs a new PatchRegionBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRegionBackendServiceRequest); + + /** PatchRegionBackendServiceRequest backendService. */ + public backendService: string; + + /** PatchRegionBackendServiceRequest backendServiceResource. */ + public backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** PatchRegionBackendServiceRequest project. */ + public project: string; + + /** PatchRegionBackendServiceRequest region. */ + public region: string; + + /** PatchRegionBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** PatchRegionBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRegionBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRegionBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRegionBackendServiceRequest): google.cloud.compute.v1.PatchRegionBackendServiceRequest; + + /** + * Encodes the specified PatchRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionBackendServiceRequest.verify|verify} messages. + * @param message PatchRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionBackendServiceRequest.verify|verify} messages. + * @param message PatchRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRegionBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRegionBackendServiceRequest; + + /** + * Decodes a PatchRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRegionBackendServiceRequest; + + /** + * Verifies a PatchRegionBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRegionBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRegionBackendServiceRequest; + + /** + * Creates a plain object from a PatchRegionBackendServiceRequest message. Also converts values to other types if specified. + * @param message PatchRegionBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRegionBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRegionBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateRegionBackendServiceRequest. */ + interface IUpdateRegionBackendServiceRequest { + + /** UpdateRegionBackendServiceRequest backendService */ + backendService?: (string|null); + + /** UpdateRegionBackendServiceRequest backendServiceResource */ + backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** UpdateRegionBackendServiceRequest project */ + project?: (string|null); + + /** UpdateRegionBackendServiceRequest region */ + region?: (string|null); + + /** UpdateRegionBackendServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateRegionBackendServiceRequest. */ + class UpdateRegionBackendServiceRequest implements IUpdateRegionBackendServiceRequest { + + /** + * Constructs a new UpdateRegionBackendServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateRegionBackendServiceRequest); + + /** UpdateRegionBackendServiceRequest backendService. */ + public backendService: string; + + /** UpdateRegionBackendServiceRequest backendServiceResource. */ + public backendServiceResource?: (google.cloud.compute.v1.IBackendService|null); + + /** UpdateRegionBackendServiceRequest project. */ + public project: string; + + /** UpdateRegionBackendServiceRequest region. */ + public region: string; + + /** UpdateRegionBackendServiceRequest requestId. */ + public requestId?: (string|null); + + /** UpdateRegionBackendServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateRegionBackendServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRegionBackendServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateRegionBackendServiceRequest): google.cloud.compute.v1.UpdateRegionBackendServiceRequest; + + /** + * Encodes the specified UpdateRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionBackendServiceRequest.verify|verify} messages. + * @param message UpdateRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionBackendServiceRequest.verify|verify} messages. + * @param message UpdateRegionBackendServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRegionBackendServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateRegionBackendServiceRequest; + + /** + * Decodes an UpdateRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateRegionBackendServiceRequest; + + /** + * Verifies an UpdateRegionBackendServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRegionBackendServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateRegionBackendServiceRequest; + + /** + * Creates a plain object from an UpdateRegionBackendServiceRequest message. Also converts values to other types if specified. + * @param message UpdateRegionBackendServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateRegionBackendServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRegionBackendServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListRegionCommitmentsRequest. */ + interface IAggregatedListRegionCommitmentsRequest { + + /** AggregatedListRegionCommitmentsRequest filter */ + filter?: (string|null); + + /** AggregatedListRegionCommitmentsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListRegionCommitmentsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListRegionCommitmentsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListRegionCommitmentsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListRegionCommitmentsRequest project */ + project?: (string|null); + + /** AggregatedListRegionCommitmentsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListRegionCommitmentsRequest. */ + class AggregatedListRegionCommitmentsRequest implements IAggregatedListRegionCommitmentsRequest { + + /** + * Constructs a new AggregatedListRegionCommitmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest); + + /** AggregatedListRegionCommitmentsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListRegionCommitmentsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListRegionCommitmentsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListRegionCommitmentsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListRegionCommitmentsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListRegionCommitmentsRequest project. */ + public project: string; + + /** AggregatedListRegionCommitmentsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListRegionCommitmentsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListRegionCommitmentsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListRegionCommitmentsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListRegionCommitmentsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListRegionCommitmentsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListRegionCommitmentsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListRegionCommitmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListRegionCommitmentsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest): google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest; + + /** + * Encodes the specified AggregatedListRegionCommitmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest.verify|verify} messages. + * @param message AggregatedListRegionCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListRegionCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest.verify|verify} messages. + * @param message AggregatedListRegionCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListRegionCommitmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest; + + /** + * Decodes an AggregatedListRegionCommitmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest; + + /** + * Verifies an AggregatedListRegionCommitmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListRegionCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListRegionCommitmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest; + + /** + * Creates a plain object from an AggregatedListRegionCommitmentsRequest message. Also converts values to other types if specified. + * @param message AggregatedListRegionCommitmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListRegionCommitmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionCommitmentRequest. */ + interface IGetRegionCommitmentRequest { + + /** GetRegionCommitmentRequest commitment */ + commitment?: (string|null); + + /** GetRegionCommitmentRequest project */ + project?: (string|null); + + /** GetRegionCommitmentRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionCommitmentRequest. */ + class GetRegionCommitmentRequest implements IGetRegionCommitmentRequest { + + /** + * Constructs a new GetRegionCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionCommitmentRequest); + + /** GetRegionCommitmentRequest commitment. */ + public commitment: string; + + /** GetRegionCommitmentRequest project. */ + public project: string; + + /** GetRegionCommitmentRequest region. */ + public region: string; + + /** + * Creates a new GetRegionCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionCommitmentRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionCommitmentRequest): google.cloud.compute.v1.GetRegionCommitmentRequest; + + /** + * Encodes the specified GetRegionCommitmentRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionCommitmentRequest.verify|verify} messages. + * @param message GetRegionCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionCommitmentRequest.verify|verify} messages. + * @param message GetRegionCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionCommitmentRequest; + + /** + * Decodes a GetRegionCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionCommitmentRequest; + + /** + * Verifies a GetRegionCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionCommitmentRequest; + + /** + * Creates a plain object from a GetRegionCommitmentRequest message. Also converts values to other types if specified. + * @param message GetRegionCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionCommitmentRequest. */ + interface IInsertRegionCommitmentRequest { + + /** InsertRegionCommitmentRequest commitmentResource */ + commitmentResource?: (google.cloud.compute.v1.ICommitment|null); + + /** InsertRegionCommitmentRequest project */ + project?: (string|null); + + /** InsertRegionCommitmentRequest region */ + region?: (string|null); + + /** InsertRegionCommitmentRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionCommitmentRequest. */ + class InsertRegionCommitmentRequest implements IInsertRegionCommitmentRequest { + + /** + * Constructs a new InsertRegionCommitmentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionCommitmentRequest); + + /** InsertRegionCommitmentRequest commitmentResource. */ + public commitmentResource?: (google.cloud.compute.v1.ICommitment|null); + + /** InsertRegionCommitmentRequest project. */ + public project: string; + + /** InsertRegionCommitmentRequest region. */ + public region: string; + + /** InsertRegionCommitmentRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionCommitmentRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionCommitmentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionCommitmentRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionCommitmentRequest): google.cloud.compute.v1.InsertRegionCommitmentRequest; + + /** + * Encodes the specified InsertRegionCommitmentRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionCommitmentRequest.verify|verify} messages. + * @param message InsertRegionCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionCommitmentRequest.verify|verify} messages. + * @param message InsertRegionCommitmentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionCommitmentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionCommitmentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionCommitmentRequest; + + /** + * Decodes an InsertRegionCommitmentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionCommitmentRequest; + + /** + * Verifies an InsertRegionCommitmentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionCommitmentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionCommitmentRequest; + + /** + * Creates a plain object from an InsertRegionCommitmentRequest message. Also converts values to other types if specified. + * @param message InsertRegionCommitmentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionCommitmentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionCommitmentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionCommitmentsRequest. */ + interface IListRegionCommitmentsRequest { + + /** ListRegionCommitmentsRequest filter */ + filter?: (string|null); + + /** ListRegionCommitmentsRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionCommitmentsRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionCommitmentsRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionCommitmentsRequest project */ + project?: (string|null); + + /** ListRegionCommitmentsRequest region */ + region?: (string|null); + + /** ListRegionCommitmentsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionCommitmentsRequest. */ + class ListRegionCommitmentsRequest implements IListRegionCommitmentsRequest { + + /** + * Constructs a new ListRegionCommitmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionCommitmentsRequest); + + /** ListRegionCommitmentsRequest filter. */ + public filter?: (string|null); + + /** ListRegionCommitmentsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionCommitmentsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionCommitmentsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionCommitmentsRequest project. */ + public project: string; + + /** ListRegionCommitmentsRequest region. */ + public region: string; + + /** ListRegionCommitmentsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionCommitmentsRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionCommitmentsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionCommitmentsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionCommitmentsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionCommitmentsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionCommitmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionCommitmentsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionCommitmentsRequest): google.cloud.compute.v1.ListRegionCommitmentsRequest; + + /** + * Encodes the specified ListRegionCommitmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionCommitmentsRequest.verify|verify} messages. + * @param message ListRegionCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionCommitmentsRequest.verify|verify} messages. + * @param message ListRegionCommitmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionCommitmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionCommitmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionCommitmentsRequest; + + /** + * Decodes a ListRegionCommitmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionCommitmentsRequest; + + /** + * Verifies a ListRegionCommitmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionCommitmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionCommitmentsRequest; + + /** + * Creates a plain object from a ListRegionCommitmentsRequest message. Also converts values to other types if specified. + * @param message ListRegionCommitmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionCommitmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionCommitmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionDiskTypeRequest. */ + interface IGetRegionDiskTypeRequest { + + /** GetRegionDiskTypeRequest diskType */ + diskType?: (string|null); + + /** GetRegionDiskTypeRequest project */ + project?: (string|null); + + /** GetRegionDiskTypeRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionDiskTypeRequest. */ + class GetRegionDiskTypeRequest implements IGetRegionDiskTypeRequest { + + /** + * Constructs a new GetRegionDiskTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionDiskTypeRequest); + + /** GetRegionDiskTypeRequest diskType. */ + public diskType: string; + + /** GetRegionDiskTypeRequest project. */ + public project: string; + + /** GetRegionDiskTypeRequest region. */ + public region: string; + + /** + * Creates a new GetRegionDiskTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionDiskTypeRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionDiskTypeRequest): google.cloud.compute.v1.GetRegionDiskTypeRequest; + + /** + * Encodes the specified GetRegionDiskTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskTypeRequest.verify|verify} messages. + * @param message GetRegionDiskTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionDiskTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionDiskTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskTypeRequest.verify|verify} messages. + * @param message GetRegionDiskTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionDiskTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionDiskTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionDiskTypeRequest; + + /** + * Decodes a GetRegionDiskTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionDiskTypeRequest; + + /** + * Verifies a GetRegionDiskTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionDiskTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionDiskTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionDiskTypeRequest; + + /** + * Creates a plain object from a GetRegionDiskTypeRequest message. Also converts values to other types if specified. + * @param message GetRegionDiskTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionDiskTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionDiskTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionDiskTypesRequest. */ + interface IListRegionDiskTypesRequest { + + /** ListRegionDiskTypesRequest filter */ + filter?: (string|null); + + /** ListRegionDiskTypesRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionDiskTypesRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionDiskTypesRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionDiskTypesRequest project */ + project?: (string|null); + + /** ListRegionDiskTypesRequest region */ + region?: (string|null); + + /** ListRegionDiskTypesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionDiskTypesRequest. */ + class ListRegionDiskTypesRequest implements IListRegionDiskTypesRequest { + + /** + * Constructs a new ListRegionDiskTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionDiskTypesRequest); + + /** ListRegionDiskTypesRequest filter. */ + public filter?: (string|null); + + /** ListRegionDiskTypesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionDiskTypesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionDiskTypesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionDiskTypesRequest project. */ + public project: string; + + /** ListRegionDiskTypesRequest region. */ + public region: string; + + /** ListRegionDiskTypesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionDiskTypesRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionDiskTypesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionDiskTypesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionDiskTypesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionDiskTypesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionDiskTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionDiskTypesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionDiskTypesRequest): google.cloud.compute.v1.ListRegionDiskTypesRequest; + + /** + * Encodes the specified ListRegionDiskTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionDiskTypesRequest.verify|verify} messages. + * @param message ListRegionDiskTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionDiskTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionDiskTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionDiskTypesRequest.verify|verify} messages. + * @param message ListRegionDiskTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionDiskTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionDiskTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionDiskTypesRequest; + + /** + * Decodes a ListRegionDiskTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionDiskTypesRequest; + + /** + * Verifies a ListRegionDiskTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionDiskTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionDiskTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionDiskTypesRequest; + + /** + * Creates a plain object from a ListRegionDiskTypesRequest message. Also converts values to other types if specified. + * @param message ListRegionDiskTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionDiskTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionDiskTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddResourcePoliciesRegionDiskRequest. */ + interface IAddResourcePoliciesRegionDiskRequest { + + /** AddResourcePoliciesRegionDiskRequest disk */ + disk?: (string|null); + + /** AddResourcePoliciesRegionDiskRequest project */ + project?: (string|null); + + /** AddResourcePoliciesRegionDiskRequest region */ + region?: (string|null); + + /** AddResourcePoliciesRegionDiskRequest regionDisksAddResourcePoliciesRequestResource */ + regionDisksAddResourcePoliciesRequestResource?: (google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest|null); + + /** AddResourcePoliciesRegionDiskRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AddResourcePoliciesRegionDiskRequest. */ + class AddResourcePoliciesRegionDiskRequest implements IAddResourcePoliciesRegionDiskRequest { + + /** + * Constructs a new AddResourcePoliciesRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest); + + /** AddResourcePoliciesRegionDiskRequest disk. */ + public disk: string; + + /** AddResourcePoliciesRegionDiskRequest project. */ + public project: string; + + /** AddResourcePoliciesRegionDiskRequest region. */ + public region: string; + + /** AddResourcePoliciesRegionDiskRequest regionDisksAddResourcePoliciesRequestResource. */ + public regionDisksAddResourcePoliciesRequestResource?: (google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest|null); + + /** AddResourcePoliciesRegionDiskRequest requestId. */ + public requestId?: (string|null); + + /** AddResourcePoliciesRegionDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddResourcePoliciesRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddResourcePoliciesRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest): google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest; + + /** + * Encodes the specified AddResourcePoliciesRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @param message AddResourcePoliciesRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddResourcePoliciesRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @param message AddResourcePoliciesRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddResourcePoliciesRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest; + + /** + * Decodes an AddResourcePoliciesRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest; + + /** + * Verifies an AddResourcePoliciesRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddResourcePoliciesRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddResourcePoliciesRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest; + + /** + * Creates a plain object from an AddResourcePoliciesRegionDiskRequest message. Also converts values to other types if specified. + * @param message AddResourcePoliciesRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddResourcePoliciesRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateSnapshotRegionDiskRequest. */ + interface ICreateSnapshotRegionDiskRequest { + + /** CreateSnapshotRegionDiskRequest disk */ + disk?: (string|null); + + /** CreateSnapshotRegionDiskRequest project */ + project?: (string|null); + + /** CreateSnapshotRegionDiskRequest region */ + region?: (string|null); + + /** CreateSnapshotRegionDiskRequest requestId */ + requestId?: (string|null); + + /** CreateSnapshotRegionDiskRequest snapshotResource */ + snapshotResource?: (google.cloud.compute.v1.ISnapshot|null); + } + + /** Represents a CreateSnapshotRegionDiskRequest. */ + class CreateSnapshotRegionDiskRequest implements ICreateSnapshotRegionDiskRequest { + + /** + * Constructs a new CreateSnapshotRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest); + + /** CreateSnapshotRegionDiskRequest disk. */ + public disk: string; + + /** CreateSnapshotRegionDiskRequest project. */ + public project: string; + + /** CreateSnapshotRegionDiskRequest region. */ + public region: string; + + /** CreateSnapshotRegionDiskRequest requestId. */ + public requestId?: (string|null); + + /** CreateSnapshotRegionDiskRequest snapshotResource. */ + public snapshotResource?: (google.cloud.compute.v1.ISnapshot|null); + + /** CreateSnapshotRegionDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new CreateSnapshotRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSnapshotRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest): google.cloud.compute.v1.CreateSnapshotRegionDiskRequest; + + /** + * Encodes the specified CreateSnapshotRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotRegionDiskRequest.verify|verify} messages. + * @param message CreateSnapshotRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSnapshotRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotRegionDiskRequest.verify|verify} messages. + * @param message CreateSnapshotRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSnapshotRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSnapshotRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CreateSnapshotRegionDiskRequest; + + /** + * Decodes a CreateSnapshotRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSnapshotRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CreateSnapshotRegionDiskRequest; + + /** + * Verifies a CreateSnapshotRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSnapshotRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSnapshotRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CreateSnapshotRegionDiskRequest; + + /** + * Creates a plain object from a CreateSnapshotRegionDiskRequest message. Also converts values to other types if specified. + * @param message CreateSnapshotRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CreateSnapshotRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSnapshotRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionDiskRequest. */ + interface IDeleteRegionDiskRequest { + + /** DeleteRegionDiskRequest disk */ + disk?: (string|null); + + /** DeleteRegionDiskRequest project */ + project?: (string|null); + + /** DeleteRegionDiskRequest region */ + region?: (string|null); + + /** DeleteRegionDiskRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionDiskRequest. */ + class DeleteRegionDiskRequest implements IDeleteRegionDiskRequest { + + /** + * Constructs a new DeleteRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionDiskRequest); + + /** DeleteRegionDiskRequest disk. */ + public disk: string; + + /** DeleteRegionDiskRequest project. */ + public project: string; + + /** DeleteRegionDiskRequest region. */ + public region: string; + + /** DeleteRegionDiskRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionDiskRequest): google.cloud.compute.v1.DeleteRegionDiskRequest; + + /** + * Encodes the specified DeleteRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionDiskRequest.verify|verify} messages. + * @param message DeleteRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionDiskRequest.verify|verify} messages. + * @param message DeleteRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionDiskRequest; + + /** + * Decodes a DeleteRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionDiskRequest; + + /** + * Verifies a DeleteRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionDiskRequest; + + /** + * Creates a plain object from a DeleteRegionDiskRequest message. Also converts values to other types if specified. + * @param message DeleteRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionDiskRequest. */ + interface IGetRegionDiskRequest { + + /** GetRegionDiskRequest disk */ + disk?: (string|null); + + /** GetRegionDiskRequest project */ + project?: (string|null); + + /** GetRegionDiskRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionDiskRequest. */ + class GetRegionDiskRequest implements IGetRegionDiskRequest { + + /** + * Constructs a new GetRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionDiskRequest); + + /** GetRegionDiskRequest disk. */ + public disk: string; + + /** GetRegionDiskRequest project. */ + public project: string; + + /** GetRegionDiskRequest region. */ + public region: string; + + /** + * Creates a new GetRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionDiskRequest): google.cloud.compute.v1.GetRegionDiskRequest; + + /** + * Encodes the specified GetRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskRequest.verify|verify} messages. + * @param message GetRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskRequest.verify|verify} messages. + * @param message GetRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionDiskRequest; + + /** + * Decodes a GetRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionDiskRequest; + + /** + * Verifies a GetRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionDiskRequest; + + /** + * Creates a plain object from a GetRegionDiskRequest message. Also converts values to other types if specified. + * @param message GetRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyRegionDiskRequest. */ + interface IGetIamPolicyRegionDiskRequest { + + /** GetIamPolicyRegionDiskRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyRegionDiskRequest project */ + project?: (string|null); + + /** GetIamPolicyRegionDiskRequest region */ + region?: (string|null); + + /** GetIamPolicyRegionDiskRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicyRegionDiskRequest. */ + class GetIamPolicyRegionDiskRequest implements IGetIamPolicyRegionDiskRequest { + + /** + * Constructs a new GetIamPolicyRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest); + + /** GetIamPolicyRegionDiskRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyRegionDiskRequest project. */ + public project: string; + + /** GetIamPolicyRegionDiskRequest region. */ + public region: string; + + /** GetIamPolicyRegionDiskRequest resource. */ + public resource: string; + + /** GetIamPolicyRegionDiskRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest): google.cloud.compute.v1.GetIamPolicyRegionDiskRequest; + + /** + * Encodes the specified GetIamPolicyRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyRegionDiskRequest.verify|verify} messages. + * @param message GetIamPolicyRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyRegionDiskRequest.verify|verify} messages. + * @param message GetIamPolicyRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyRegionDiskRequest; + + /** + * Decodes a GetIamPolicyRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyRegionDiskRequest; + + /** + * Verifies a GetIamPolicyRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyRegionDiskRequest; + + /** + * Creates a plain object from a GetIamPolicyRegionDiskRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionDiskRequest. */ + interface IInsertRegionDiskRequest { + + /** InsertRegionDiskRequest diskResource */ + diskResource?: (google.cloud.compute.v1.IDisk|null); + + /** InsertRegionDiskRequest project */ + project?: (string|null); + + /** InsertRegionDiskRequest region */ + region?: (string|null); + + /** InsertRegionDiskRequest requestId */ + requestId?: (string|null); + + /** InsertRegionDiskRequest sourceImage */ + sourceImage?: (string|null); + } + + /** Represents an InsertRegionDiskRequest. */ + class InsertRegionDiskRequest implements IInsertRegionDiskRequest { + + /** + * Constructs a new InsertRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionDiskRequest); + + /** InsertRegionDiskRequest diskResource. */ + public diskResource?: (google.cloud.compute.v1.IDisk|null); + + /** InsertRegionDiskRequest project. */ + public project: string; + + /** InsertRegionDiskRequest region. */ + public region: string; + + /** InsertRegionDiskRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionDiskRequest sourceImage. */ + public sourceImage?: (string|null); + + /** InsertRegionDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** InsertRegionDiskRequest _sourceImage. */ + public _sourceImage?: "sourceImage"; + + /** + * Creates a new InsertRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionDiskRequest): google.cloud.compute.v1.InsertRegionDiskRequest; + + /** + * Encodes the specified InsertRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionDiskRequest.verify|verify} messages. + * @param message InsertRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionDiskRequest.verify|verify} messages. + * @param message InsertRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionDiskRequest; + + /** + * Decodes an InsertRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionDiskRequest; + + /** + * Verifies an InsertRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionDiskRequest; + + /** + * Creates a plain object from an InsertRegionDiskRequest message. Also converts values to other types if specified. + * @param message InsertRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionDisksRequest. */ + interface IListRegionDisksRequest { + + /** ListRegionDisksRequest filter */ + filter?: (string|null); + + /** ListRegionDisksRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionDisksRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionDisksRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionDisksRequest project */ + project?: (string|null); + + /** ListRegionDisksRequest region */ + region?: (string|null); + + /** ListRegionDisksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionDisksRequest. */ + class ListRegionDisksRequest implements IListRegionDisksRequest { + + /** + * Constructs a new ListRegionDisksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionDisksRequest); + + /** ListRegionDisksRequest filter. */ + public filter?: (string|null); + + /** ListRegionDisksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionDisksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionDisksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionDisksRequest project. */ + public project: string; + + /** ListRegionDisksRequest region. */ + public region: string; + + /** ListRegionDisksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionDisksRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionDisksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionDisksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionDisksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionDisksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionDisksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionDisksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionDisksRequest): google.cloud.compute.v1.ListRegionDisksRequest; + + /** + * Encodes the specified ListRegionDisksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionDisksRequest.verify|verify} messages. + * @param message ListRegionDisksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionDisksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionDisksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionDisksRequest.verify|verify} messages. + * @param message ListRegionDisksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionDisksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionDisksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionDisksRequest; + + /** + * Decodes a ListRegionDisksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionDisksRequest; + + /** + * Verifies a ListRegionDisksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionDisksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionDisksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionDisksRequest; + + /** + * Creates a plain object from a ListRegionDisksRequest message. Also converts values to other types if specified. + * @param message ListRegionDisksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionDisksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionDisksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveResourcePoliciesRegionDiskRequest. */ + interface IRemoveResourcePoliciesRegionDiskRequest { + + /** RemoveResourcePoliciesRegionDiskRequest disk */ + disk?: (string|null); + + /** RemoveResourcePoliciesRegionDiskRequest project */ + project?: (string|null); + + /** RemoveResourcePoliciesRegionDiskRequest region */ + region?: (string|null); + + /** RemoveResourcePoliciesRegionDiskRequest regionDisksRemoveResourcePoliciesRequestResource */ + regionDisksRemoveResourcePoliciesRequestResource?: (google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest|null); + + /** RemoveResourcePoliciesRegionDiskRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RemoveResourcePoliciesRegionDiskRequest. */ + class RemoveResourcePoliciesRegionDiskRequest implements IRemoveResourcePoliciesRegionDiskRequest { + + /** + * Constructs a new RemoveResourcePoliciesRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest); + + /** RemoveResourcePoliciesRegionDiskRequest disk. */ + public disk: string; + + /** RemoveResourcePoliciesRegionDiskRequest project. */ + public project: string; + + /** RemoveResourcePoliciesRegionDiskRequest region. */ + public region: string; + + /** RemoveResourcePoliciesRegionDiskRequest regionDisksRemoveResourcePoliciesRequestResource. */ + public regionDisksRemoveResourcePoliciesRequestResource?: (google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest|null); + + /** RemoveResourcePoliciesRegionDiskRequest requestId. */ + public requestId?: (string|null); + + /** RemoveResourcePoliciesRegionDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveResourcePoliciesRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveResourcePoliciesRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest): google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest; + + /** + * Encodes the specified RemoveResourcePoliciesRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @param message RemoveResourcePoliciesRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveResourcePoliciesRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @param message RemoveResourcePoliciesRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveResourcePoliciesRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest; + + /** + * Decodes a RemoveResourcePoliciesRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest; + + /** + * Verifies a RemoveResourcePoliciesRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveResourcePoliciesRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveResourcePoliciesRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest; + + /** + * Creates a plain object from a RemoveResourcePoliciesRegionDiskRequest message. Also converts values to other types if specified. + * @param message RemoveResourcePoliciesRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveResourcePoliciesRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResizeRegionDiskRequest. */ + interface IResizeRegionDiskRequest { + + /** ResizeRegionDiskRequest disk */ + disk?: (string|null); + + /** ResizeRegionDiskRequest project */ + project?: (string|null); + + /** ResizeRegionDiskRequest region */ + region?: (string|null); + + /** ResizeRegionDiskRequest regionDisksResizeRequestResource */ + regionDisksResizeRequestResource?: (google.cloud.compute.v1.IRegionDisksResizeRequest|null); + + /** ResizeRegionDiskRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ResizeRegionDiskRequest. */ + class ResizeRegionDiskRequest implements IResizeRegionDiskRequest { + + /** + * Constructs a new ResizeRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResizeRegionDiskRequest); + + /** ResizeRegionDiskRequest disk. */ + public disk: string; + + /** ResizeRegionDiskRequest project. */ + public project: string; + + /** ResizeRegionDiskRequest region. */ + public region: string; + + /** ResizeRegionDiskRequest regionDisksResizeRequestResource. */ + public regionDisksResizeRequestResource?: (google.cloud.compute.v1.IRegionDisksResizeRequest|null); + + /** ResizeRegionDiskRequest requestId. */ + public requestId?: (string|null); + + /** ResizeRegionDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new ResizeRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResizeRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IResizeRegionDiskRequest): google.cloud.compute.v1.ResizeRegionDiskRequest; + + /** + * Encodes the specified ResizeRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionDiskRequest.verify|verify} messages. + * @param message ResizeRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResizeRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResizeRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionDiskRequest.verify|verify} messages. + * @param message ResizeRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResizeRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResizeRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResizeRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResizeRegionDiskRequest; + + /** + * Decodes a ResizeRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResizeRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResizeRegionDiskRequest; + + /** + * Verifies a ResizeRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResizeRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResizeRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResizeRegionDiskRequest; + + /** + * Creates a plain object from a ResizeRegionDiskRequest message. Also converts values to other types if specified. + * @param message ResizeRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResizeRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResizeRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyRegionDiskRequest. */ + interface ISetIamPolicyRegionDiskRequest { + + /** SetIamPolicyRegionDiskRequest project */ + project?: (string|null); + + /** SetIamPolicyRegionDiskRequest region */ + region?: (string|null); + + /** SetIamPolicyRegionDiskRequest regionSetPolicyRequestResource */ + regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicyRegionDiskRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicyRegionDiskRequest. */ + class SetIamPolicyRegionDiskRequest implements ISetIamPolicyRegionDiskRequest { + + /** + * Constructs a new SetIamPolicyRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest); + + /** SetIamPolicyRegionDiskRequest project. */ + public project: string; + + /** SetIamPolicyRegionDiskRequest region. */ + public region: string; + + /** SetIamPolicyRegionDiskRequest regionSetPolicyRequestResource. */ + public regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicyRegionDiskRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicyRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest): google.cloud.compute.v1.SetIamPolicyRegionDiskRequest; + + /** + * Encodes the specified SetIamPolicyRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyRegionDiskRequest.verify|verify} messages. + * @param message SetIamPolicyRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyRegionDiskRequest.verify|verify} messages. + * @param message SetIamPolicyRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyRegionDiskRequest; + + /** + * Decodes a SetIamPolicyRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyRegionDiskRequest; + + /** + * Verifies a SetIamPolicyRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyRegionDiskRequest; + + /** + * Creates a plain object from a SetIamPolicyRegionDiskRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsRegionDiskRequest. */ + interface ISetLabelsRegionDiskRequest { + + /** SetLabelsRegionDiskRequest project */ + project?: (string|null); + + /** SetLabelsRegionDiskRequest region */ + region?: (string|null); + + /** SetLabelsRegionDiskRequest regionSetLabelsRequestResource */ + regionSetLabelsRequestResource?: (google.cloud.compute.v1.IRegionSetLabelsRequest|null); + + /** SetLabelsRegionDiskRequest requestId */ + requestId?: (string|null); + + /** SetLabelsRegionDiskRequest resource */ + resource?: (string|null); + } + + /** Represents a SetLabelsRegionDiskRequest. */ + class SetLabelsRegionDiskRequest implements ISetLabelsRegionDiskRequest { + + /** + * Constructs a new SetLabelsRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsRegionDiskRequest); + + /** SetLabelsRegionDiskRequest project. */ + public project: string; + + /** SetLabelsRegionDiskRequest region. */ + public region: string; + + /** SetLabelsRegionDiskRequest regionSetLabelsRequestResource. */ + public regionSetLabelsRequestResource?: (google.cloud.compute.v1.IRegionSetLabelsRequest|null); + + /** SetLabelsRegionDiskRequest requestId. */ + public requestId?: (string|null); + + /** SetLabelsRegionDiskRequest resource. */ + public resource: string; + + /** SetLabelsRegionDiskRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetLabelsRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsRegionDiskRequest): google.cloud.compute.v1.SetLabelsRegionDiskRequest; + + /** + * Encodes the specified SetLabelsRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsRegionDiskRequest.verify|verify} messages. + * @param message SetLabelsRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsRegionDiskRequest.verify|verify} messages. + * @param message SetLabelsRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsRegionDiskRequest; + + /** + * Decodes a SetLabelsRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsRegionDiskRequest; + + /** + * Verifies a SetLabelsRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsRegionDiskRequest; + + /** + * Creates a plain object from a SetLabelsRegionDiskRequest message. Also converts values to other types if specified. + * @param message SetLabelsRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsRegionDiskRequest. */ + interface ITestIamPermissionsRegionDiskRequest { + + /** TestIamPermissionsRegionDiskRequest project */ + project?: (string|null); + + /** TestIamPermissionsRegionDiskRequest region */ + region?: (string|null); + + /** TestIamPermissionsRegionDiskRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsRegionDiskRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsRegionDiskRequest. */ + class TestIamPermissionsRegionDiskRequest implements ITestIamPermissionsRegionDiskRequest { + + /** + * Constructs a new TestIamPermissionsRegionDiskRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest); + + /** TestIamPermissionsRegionDiskRequest project. */ + public project: string; + + /** TestIamPermissionsRegionDiskRequest region. */ + public region: string; + + /** TestIamPermissionsRegionDiskRequest resource. */ + public resource: string; + + /** TestIamPermissionsRegionDiskRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsRegionDiskRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsRegionDiskRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest): google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest; + + /** + * Encodes the specified TestIamPermissionsRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest.verify|verify} messages. + * @param message TestIamPermissionsRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest.verify|verify} messages. + * @param message TestIamPermissionsRegionDiskRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsRegionDiskRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest; + + /** + * Decodes a TestIamPermissionsRegionDiskRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest; + + /** + * Verifies a TestIamPermissionsRegionDiskRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsRegionDiskRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest; + + /** + * Creates a plain object from a TestIamPermissionsRegionDiskRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsRegionDiskRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsRegionDiskRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionHealthCheckServiceRequest. */ + interface IDeleteRegionHealthCheckServiceRequest { + + /** DeleteRegionHealthCheckServiceRequest healthCheckService */ + healthCheckService?: (string|null); + + /** DeleteRegionHealthCheckServiceRequest project */ + project?: (string|null); + + /** DeleteRegionHealthCheckServiceRequest region */ + region?: (string|null); + + /** DeleteRegionHealthCheckServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionHealthCheckServiceRequest. */ + class DeleteRegionHealthCheckServiceRequest implements IDeleteRegionHealthCheckServiceRequest { + + /** + * Constructs a new DeleteRegionHealthCheckServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest); + + /** DeleteRegionHealthCheckServiceRequest healthCheckService. */ + public healthCheckService: string; + + /** DeleteRegionHealthCheckServiceRequest project. */ + public project: string; + + /** DeleteRegionHealthCheckServiceRequest region. */ + public region: string; + + /** DeleteRegionHealthCheckServiceRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionHealthCheckServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionHealthCheckServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionHealthCheckServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest): google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest; + + /** + * Encodes the specified DeleteRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message DeleteRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message DeleteRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest; + + /** + * Decodes a DeleteRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest; + + /** + * Verifies a DeleteRegionHealthCheckServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionHealthCheckServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest; + + /** + * Creates a plain object from a DeleteRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @param message DeleteRegionHealthCheckServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionHealthCheckServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionHealthCheckServiceRequest. */ + interface IGetRegionHealthCheckServiceRequest { + + /** GetRegionHealthCheckServiceRequest healthCheckService */ + healthCheckService?: (string|null); + + /** GetRegionHealthCheckServiceRequest project */ + project?: (string|null); + + /** GetRegionHealthCheckServiceRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionHealthCheckServiceRequest. */ + class GetRegionHealthCheckServiceRequest implements IGetRegionHealthCheckServiceRequest { + + /** + * Constructs a new GetRegionHealthCheckServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest); + + /** GetRegionHealthCheckServiceRequest healthCheckService. */ + public healthCheckService: string; + + /** GetRegionHealthCheckServiceRequest project. */ + public project: string; + + /** GetRegionHealthCheckServiceRequest region. */ + public region: string; + + /** + * Creates a new GetRegionHealthCheckServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionHealthCheckServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest): google.cloud.compute.v1.GetRegionHealthCheckServiceRequest; + + /** + * Encodes the specified GetRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message GetRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message GetRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionHealthCheckServiceRequest; + + /** + * Decodes a GetRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionHealthCheckServiceRequest; + + /** + * Verifies a GetRegionHealthCheckServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionHealthCheckServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionHealthCheckServiceRequest; + + /** + * Creates a plain object from a GetRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @param message GetRegionHealthCheckServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionHealthCheckServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionHealthCheckServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionHealthCheckServiceRequest. */ + interface IInsertRegionHealthCheckServiceRequest { + + /** InsertRegionHealthCheckServiceRequest healthCheckServiceResource */ + healthCheckServiceResource?: (google.cloud.compute.v1.IHealthCheckService|null); + + /** InsertRegionHealthCheckServiceRequest project */ + project?: (string|null); + + /** InsertRegionHealthCheckServiceRequest region */ + region?: (string|null); + + /** InsertRegionHealthCheckServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionHealthCheckServiceRequest. */ + class InsertRegionHealthCheckServiceRequest implements IInsertRegionHealthCheckServiceRequest { + + /** + * Constructs a new InsertRegionHealthCheckServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest); + + /** InsertRegionHealthCheckServiceRequest healthCheckServiceResource. */ + public healthCheckServiceResource?: (google.cloud.compute.v1.IHealthCheckService|null); + + /** InsertRegionHealthCheckServiceRequest project. */ + public project: string; + + /** InsertRegionHealthCheckServiceRequest region. */ + public region: string; + + /** InsertRegionHealthCheckServiceRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionHealthCheckServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionHealthCheckServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionHealthCheckServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest): google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest; + + /** + * Encodes the specified InsertRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message InsertRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message InsertRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest; + + /** + * Decodes an InsertRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest; + + /** + * Verifies an InsertRegionHealthCheckServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionHealthCheckServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest; + + /** + * Creates a plain object from an InsertRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @param message InsertRegionHealthCheckServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionHealthCheckServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionHealthCheckServicesRequest. */ + interface IListRegionHealthCheckServicesRequest { + + /** ListRegionHealthCheckServicesRequest filter */ + filter?: (string|null); + + /** ListRegionHealthCheckServicesRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionHealthCheckServicesRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionHealthCheckServicesRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionHealthCheckServicesRequest project */ + project?: (string|null); + + /** ListRegionHealthCheckServicesRequest region */ + region?: (string|null); + + /** ListRegionHealthCheckServicesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionHealthCheckServicesRequest. */ + class ListRegionHealthCheckServicesRequest implements IListRegionHealthCheckServicesRequest { + + /** + * Constructs a new ListRegionHealthCheckServicesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionHealthCheckServicesRequest); + + /** ListRegionHealthCheckServicesRequest filter. */ + public filter?: (string|null); + + /** ListRegionHealthCheckServicesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionHealthCheckServicesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionHealthCheckServicesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionHealthCheckServicesRequest project. */ + public project: string; + + /** ListRegionHealthCheckServicesRequest region. */ + public region: string; + + /** ListRegionHealthCheckServicesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionHealthCheckServicesRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionHealthCheckServicesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionHealthCheckServicesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionHealthCheckServicesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionHealthCheckServicesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionHealthCheckServicesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionHealthCheckServicesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionHealthCheckServicesRequest): google.cloud.compute.v1.ListRegionHealthCheckServicesRequest; + + /** + * Encodes the specified ListRegionHealthCheckServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthCheckServicesRequest.verify|verify} messages. + * @param message ListRegionHealthCheckServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionHealthCheckServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthCheckServicesRequest.verify|verify} messages. + * @param message ListRegionHealthCheckServicesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionHealthCheckServicesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionHealthCheckServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionHealthCheckServicesRequest; + + /** + * Decodes a ListRegionHealthCheckServicesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionHealthCheckServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionHealthCheckServicesRequest; + + /** + * Verifies a ListRegionHealthCheckServicesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionHealthCheckServicesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionHealthCheckServicesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionHealthCheckServicesRequest; + + /** + * Creates a plain object from a ListRegionHealthCheckServicesRequest message. Also converts values to other types if specified. + * @param message ListRegionHealthCheckServicesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionHealthCheckServicesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionHealthCheckServicesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRegionHealthCheckServiceRequest. */ + interface IPatchRegionHealthCheckServiceRequest { + + /** PatchRegionHealthCheckServiceRequest healthCheckService */ + healthCheckService?: (string|null); + + /** PatchRegionHealthCheckServiceRequest healthCheckServiceResource */ + healthCheckServiceResource?: (google.cloud.compute.v1.IHealthCheckService|null); + + /** PatchRegionHealthCheckServiceRequest project */ + project?: (string|null); + + /** PatchRegionHealthCheckServiceRequest region */ + region?: (string|null); + + /** PatchRegionHealthCheckServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchRegionHealthCheckServiceRequest. */ + class PatchRegionHealthCheckServiceRequest implements IPatchRegionHealthCheckServiceRequest { + + /** + * Constructs a new PatchRegionHealthCheckServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest); + + /** PatchRegionHealthCheckServiceRequest healthCheckService. */ + public healthCheckService: string; + + /** PatchRegionHealthCheckServiceRequest healthCheckServiceResource. */ + public healthCheckServiceResource?: (google.cloud.compute.v1.IHealthCheckService|null); + + /** PatchRegionHealthCheckServiceRequest project. */ + public project: string; + + /** PatchRegionHealthCheckServiceRequest region. */ + public region: string; + + /** PatchRegionHealthCheckServiceRequest requestId. */ + public requestId?: (string|null); + + /** PatchRegionHealthCheckServiceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRegionHealthCheckServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRegionHealthCheckServiceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest): google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest; + + /** + * Encodes the specified PatchRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message PatchRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest.verify|verify} messages. + * @param message PatchRegionHealthCheckServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest; + + /** + * Decodes a PatchRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest; + + /** + * Verifies a PatchRegionHealthCheckServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRegionHealthCheckServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest; + + /** + * Creates a plain object from a PatchRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @param message PatchRegionHealthCheckServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRegionHealthCheckServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionHealthCheckRequest. */ + interface IDeleteRegionHealthCheckRequest { + + /** DeleteRegionHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** DeleteRegionHealthCheckRequest project */ + project?: (string|null); + + /** DeleteRegionHealthCheckRequest region */ + region?: (string|null); + + /** DeleteRegionHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionHealthCheckRequest. */ + class DeleteRegionHealthCheckRequest implements IDeleteRegionHealthCheckRequest { + + /** + * Constructs a new DeleteRegionHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionHealthCheckRequest); + + /** DeleteRegionHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** DeleteRegionHealthCheckRequest project. */ + public project: string; + + /** DeleteRegionHealthCheckRequest region. */ + public region: string; + + /** DeleteRegionHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionHealthCheckRequest): google.cloud.compute.v1.DeleteRegionHealthCheckRequest; + + /** + * Encodes the specified DeleteRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckRequest.verify|verify} messages. + * @param message DeleteRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckRequest.verify|verify} messages. + * @param message DeleteRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionHealthCheckRequest; + + /** + * Decodes a DeleteRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionHealthCheckRequest; + + /** + * Verifies a DeleteRegionHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionHealthCheckRequest; + + /** + * Creates a plain object from a DeleteRegionHealthCheckRequest message. Also converts values to other types if specified. + * @param message DeleteRegionHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionHealthCheckRequest. */ + interface IGetRegionHealthCheckRequest { + + /** GetRegionHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** GetRegionHealthCheckRequest project */ + project?: (string|null); + + /** GetRegionHealthCheckRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionHealthCheckRequest. */ + class GetRegionHealthCheckRequest implements IGetRegionHealthCheckRequest { + + /** + * Constructs a new GetRegionHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionHealthCheckRequest); + + /** GetRegionHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** GetRegionHealthCheckRequest project. */ + public project: string; + + /** GetRegionHealthCheckRequest region. */ + public region: string; + + /** + * Creates a new GetRegionHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionHealthCheckRequest): google.cloud.compute.v1.GetRegionHealthCheckRequest; + + /** + * Encodes the specified GetRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckRequest.verify|verify} messages. + * @param message GetRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckRequest.verify|verify} messages. + * @param message GetRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionHealthCheckRequest; + + /** + * Decodes a GetRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionHealthCheckRequest; + + /** + * Verifies a GetRegionHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionHealthCheckRequest; + + /** + * Creates a plain object from a GetRegionHealthCheckRequest message. Also converts values to other types if specified. + * @param message GetRegionHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionHealthCheckRequest. */ + interface IInsertRegionHealthCheckRequest { + + /** InsertRegionHealthCheckRequest healthCheckResource */ + healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** InsertRegionHealthCheckRequest project */ + project?: (string|null); + + /** InsertRegionHealthCheckRequest region */ + region?: (string|null); + + /** InsertRegionHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionHealthCheckRequest. */ + class InsertRegionHealthCheckRequest implements IInsertRegionHealthCheckRequest { + + /** + * Constructs a new InsertRegionHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionHealthCheckRequest); + + /** InsertRegionHealthCheckRequest healthCheckResource. */ + public healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** InsertRegionHealthCheckRequest project. */ + public project: string; + + /** InsertRegionHealthCheckRequest region. */ + public region: string; + + /** InsertRegionHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionHealthCheckRequest): google.cloud.compute.v1.InsertRegionHealthCheckRequest; + + /** + * Encodes the specified InsertRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckRequest.verify|verify} messages. + * @param message InsertRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckRequest.verify|verify} messages. + * @param message InsertRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionHealthCheckRequest; + + /** + * Decodes an InsertRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionHealthCheckRequest; + + /** + * Verifies an InsertRegionHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionHealthCheckRequest; + + /** + * Creates a plain object from an InsertRegionHealthCheckRequest message. Also converts values to other types if specified. + * @param message InsertRegionHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionHealthChecksRequest. */ + interface IListRegionHealthChecksRequest { + + /** ListRegionHealthChecksRequest filter */ + filter?: (string|null); + + /** ListRegionHealthChecksRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionHealthChecksRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionHealthChecksRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionHealthChecksRequest project */ + project?: (string|null); + + /** ListRegionHealthChecksRequest region */ + region?: (string|null); + + /** ListRegionHealthChecksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionHealthChecksRequest. */ + class ListRegionHealthChecksRequest implements IListRegionHealthChecksRequest { + + /** + * Constructs a new ListRegionHealthChecksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionHealthChecksRequest); + + /** ListRegionHealthChecksRequest filter. */ + public filter?: (string|null); + + /** ListRegionHealthChecksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionHealthChecksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionHealthChecksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionHealthChecksRequest project. */ + public project: string; + + /** ListRegionHealthChecksRequest region. */ + public region: string; + + /** ListRegionHealthChecksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionHealthChecksRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionHealthChecksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionHealthChecksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionHealthChecksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionHealthChecksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionHealthChecksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionHealthChecksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionHealthChecksRequest): google.cloud.compute.v1.ListRegionHealthChecksRequest; + + /** + * Encodes the specified ListRegionHealthChecksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthChecksRequest.verify|verify} messages. + * @param message ListRegionHealthChecksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionHealthChecksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionHealthChecksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthChecksRequest.verify|verify} messages. + * @param message ListRegionHealthChecksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionHealthChecksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionHealthChecksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionHealthChecksRequest; + + /** + * Decodes a ListRegionHealthChecksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionHealthChecksRequest; + + /** + * Verifies a ListRegionHealthChecksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionHealthChecksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionHealthChecksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionHealthChecksRequest; + + /** + * Creates a plain object from a ListRegionHealthChecksRequest message. Also converts values to other types if specified. + * @param message ListRegionHealthChecksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionHealthChecksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionHealthChecksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRegionHealthCheckRequest. */ + interface IPatchRegionHealthCheckRequest { + + /** PatchRegionHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** PatchRegionHealthCheckRequest healthCheckResource */ + healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** PatchRegionHealthCheckRequest project */ + project?: (string|null); + + /** PatchRegionHealthCheckRequest region */ + region?: (string|null); + + /** PatchRegionHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchRegionHealthCheckRequest. */ + class PatchRegionHealthCheckRequest implements IPatchRegionHealthCheckRequest { + + /** + * Constructs a new PatchRegionHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRegionHealthCheckRequest); + + /** PatchRegionHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** PatchRegionHealthCheckRequest healthCheckResource. */ + public healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** PatchRegionHealthCheckRequest project. */ + public project: string; + + /** PatchRegionHealthCheckRequest region. */ + public region: string; + + /** PatchRegionHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** PatchRegionHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRegionHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRegionHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRegionHealthCheckRequest): google.cloud.compute.v1.PatchRegionHealthCheckRequest; + + /** + * Encodes the specified PatchRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckRequest.verify|verify} messages. + * @param message PatchRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckRequest.verify|verify} messages. + * @param message PatchRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRegionHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRegionHealthCheckRequest; + + /** + * Decodes a PatchRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRegionHealthCheckRequest; + + /** + * Verifies a PatchRegionHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRegionHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRegionHealthCheckRequest; + + /** + * Creates a plain object from a PatchRegionHealthCheckRequest message. Also converts values to other types if specified. + * @param message PatchRegionHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRegionHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRegionHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateRegionHealthCheckRequest. */ + interface IUpdateRegionHealthCheckRequest { + + /** UpdateRegionHealthCheckRequest healthCheck */ + healthCheck?: (string|null); + + /** UpdateRegionHealthCheckRequest healthCheckResource */ + healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** UpdateRegionHealthCheckRequest project */ + project?: (string|null); + + /** UpdateRegionHealthCheckRequest region */ + region?: (string|null); + + /** UpdateRegionHealthCheckRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateRegionHealthCheckRequest. */ + class UpdateRegionHealthCheckRequest implements IUpdateRegionHealthCheckRequest { + + /** + * Constructs a new UpdateRegionHealthCheckRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateRegionHealthCheckRequest); + + /** UpdateRegionHealthCheckRequest healthCheck. */ + public healthCheck: string; + + /** UpdateRegionHealthCheckRequest healthCheckResource. */ + public healthCheckResource?: (google.cloud.compute.v1.IHealthCheck|null); + + /** UpdateRegionHealthCheckRequest project. */ + public project: string; + + /** UpdateRegionHealthCheckRequest region. */ + public region: string; + + /** UpdateRegionHealthCheckRequest requestId. */ + public requestId?: (string|null); + + /** UpdateRegionHealthCheckRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateRegionHealthCheckRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRegionHealthCheckRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateRegionHealthCheckRequest): google.cloud.compute.v1.UpdateRegionHealthCheckRequest; + + /** + * Encodes the specified UpdateRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionHealthCheckRequest.verify|verify} messages. + * @param message UpdateRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionHealthCheckRequest.verify|verify} messages. + * @param message UpdateRegionHealthCheckRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRegionHealthCheckRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateRegionHealthCheckRequest; + + /** + * Decodes an UpdateRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateRegionHealthCheckRequest; + + /** + * Verifies an UpdateRegionHealthCheckRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRegionHealthCheckRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateRegionHealthCheckRequest; + + /** + * Creates a plain object from an UpdateRegionHealthCheckRequest message. Also converts values to other types if specified. + * @param message UpdateRegionHealthCheckRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateRegionHealthCheckRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRegionHealthCheckRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AbandonInstancesRegionInstanceGroupManagerRequest. */ + interface IAbandonInstancesRegionInstanceGroupManagerRequest { + + /** AbandonInstancesRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** AbandonInstancesRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** AbandonInstancesRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** AbandonInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersAbandonInstancesRequestResource */ + regionInstanceGroupManagersAbandonInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest|null); + + /** AbandonInstancesRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AbandonInstancesRegionInstanceGroupManagerRequest. */ + class AbandonInstancesRegionInstanceGroupManagerRequest implements IAbandonInstancesRegionInstanceGroupManagerRequest { + + /** + * Constructs a new AbandonInstancesRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest); + + /** AbandonInstancesRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** AbandonInstancesRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** AbandonInstancesRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** AbandonInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersAbandonInstancesRequestResource. */ + public regionInstanceGroupManagersAbandonInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest|null); + + /** AbandonInstancesRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** AbandonInstancesRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AbandonInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AbandonInstancesRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest): google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified AbandonInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message AbandonInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AbandonInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message AbandonInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AbandonInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AbandonInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest; + + /** + * Decodes an AbandonInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AbandonInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest; + + /** + * Verifies an AbandonInstancesRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AbandonInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AbandonInstancesRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from an AbandonInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message AbandonInstancesRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AbandonInstancesRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest. */ + interface IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest { + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersApplyUpdatesRequestResource */ + regionInstanceGroupManagersApplyUpdatesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest|null); + } + + /** Represents an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest. */ + class ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest implements IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest { + + /** + * Constructs a new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest); + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersApplyUpdatesRequestResource. */ + public regionInstanceGroupManagersApplyUpdatesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest|null); + + /** + * Creates a new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest): google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest; + + /** + * Decodes an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest; + + /** + * Verifies an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateInstancesRegionInstanceGroupManagerRequest. */ + interface ICreateInstancesRegionInstanceGroupManagerRequest { + + /** CreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** CreateInstancesRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** CreateInstancesRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** CreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersCreateInstancesRequestResource */ + regionInstanceGroupManagersCreateInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest|null); + + /** CreateInstancesRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateInstancesRegionInstanceGroupManagerRequest. */ + class CreateInstancesRegionInstanceGroupManagerRequest implements ICreateInstancesRegionInstanceGroupManagerRequest { + + /** + * Constructs a new CreateInstancesRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest); + + /** CreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** CreateInstancesRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** CreateInstancesRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** CreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersCreateInstancesRequestResource. */ + public regionInstanceGroupManagersCreateInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest|null); + + /** CreateInstancesRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** CreateInstancesRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new CreateInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstancesRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest): google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified CreateInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message CreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message CreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Decodes a CreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Verifies a CreateInstancesRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstancesRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a CreateInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message CreateInstancesRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstancesRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionInstanceGroupManagerRequest. */ + interface IDeleteRegionInstanceGroupManagerRequest { + + /** DeleteRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** DeleteRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** DeleteRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** DeleteRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionInstanceGroupManagerRequest. */ + class DeleteRegionInstanceGroupManagerRequest implements IDeleteRegionInstanceGroupManagerRequest { + + /** + * Constructs a new DeleteRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest); + + /** DeleteRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** DeleteRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** DeleteRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** DeleteRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest): google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified DeleteRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest; + + /** + * Decodes a DeleteRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest; + + /** + * Verifies a DeleteRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a DeleteRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message DeleteRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstancesRegionInstanceGroupManagerRequest. */ + interface IDeleteInstancesRegionInstanceGroupManagerRequest { + + /** DeleteInstancesRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** DeleteInstancesRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** DeleteInstancesRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** DeleteInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersDeleteInstancesRequestResource */ + regionInstanceGroupManagersDeleteInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest|null); + + /** DeleteInstancesRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteInstancesRegionInstanceGroupManagerRequest. */ + class DeleteInstancesRegionInstanceGroupManagerRequest implements IDeleteInstancesRegionInstanceGroupManagerRequest { + + /** + * Constructs a new DeleteInstancesRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest); + + /** DeleteInstancesRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** DeleteInstancesRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** DeleteInstancesRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** DeleteInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersDeleteInstancesRequestResource. */ + public regionInstanceGroupManagersDeleteInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest|null); + + /** DeleteInstancesRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** DeleteInstancesRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstancesRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest): google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified DeleteInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeleteInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest; + + /** + * Decodes a DeleteInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest; + + /** + * Verifies a DeleteInstancesRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstancesRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a DeleteInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message DeleteInstancesRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstancesRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest. */ + interface IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest { + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerDeleteInstanceConfigReqResource */ + regionInstanceGroupManagerDeleteInstanceConfigReqResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq|null); + } + + /** Represents a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest. */ + class DeletePerInstanceConfigsRegionInstanceGroupManagerRequest implements IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest { + + /** + * Constructs a new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest); + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** DeletePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerDeleteInstanceConfigReqResource. */ + public regionInstanceGroupManagerDeleteInstanceConfigReqResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq|null); + + /** + * Creates a new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest): google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Decodes a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Verifies a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePerInstanceConfigsRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionInstanceGroupManagerRequest. */ + interface IGetRegionInstanceGroupManagerRequest { + + /** GetRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** GetRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** GetRegionInstanceGroupManagerRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionInstanceGroupManagerRequest. */ + class GetRegionInstanceGroupManagerRequest implements IGetRegionInstanceGroupManagerRequest { + + /** + * Constructs a new GetRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest); + + /** GetRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** GetRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** GetRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** + * Creates a new GetRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest): google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified GetRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message GetRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message GetRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest; + + /** + * Decodes a GetRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest; + + /** + * Verifies a GetRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a GetRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message GetRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionInstanceGroupManagerRequest. */ + interface IInsertRegionInstanceGroupManagerRequest { + + /** InsertRegionInstanceGroupManagerRequest instanceGroupManagerResource */ + instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** InsertRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** InsertRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** InsertRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionInstanceGroupManagerRequest. */ + class InsertRegionInstanceGroupManagerRequest implements IInsertRegionInstanceGroupManagerRequest { + + /** + * Constructs a new InsertRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest); + + /** InsertRegionInstanceGroupManagerRequest instanceGroupManagerResource. */ + public instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** InsertRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** InsertRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** InsertRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest): google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified InsertRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message InsertRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message InsertRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest; + + /** + * Decodes an InsertRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest; + + /** + * Verifies an InsertRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from an InsertRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message InsertRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionInstanceGroupManagersRequest. */ + interface IListRegionInstanceGroupManagersRequest { + + /** ListRegionInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListRegionInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListRegionInstanceGroupManagersRequest region */ + region?: (string|null); + + /** ListRegionInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionInstanceGroupManagersRequest. */ + class ListRegionInstanceGroupManagersRequest implements IListRegionInstanceGroupManagersRequest { + + /** + * Constructs a new ListRegionInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest); + + /** ListRegionInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListRegionInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionInstanceGroupManagersRequest project. */ + public project: string; + + /** ListRegionInstanceGroupManagersRequest region. */ + public region: string; + + /** ListRegionInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest): google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest; + + /** + * Encodes the specified ListRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest; + + /** + * Decodes a ListRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest; + + /** + * Verifies a ListRegionInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListRegionInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListErrorsRegionInstanceGroupManagersRequest. */ + interface IListErrorsRegionInstanceGroupManagersRequest { + + /** ListErrorsRegionInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListErrorsRegionInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest region */ + region?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListErrorsRegionInstanceGroupManagersRequest. */ + class ListErrorsRegionInstanceGroupManagersRequest implements IListErrorsRegionInstanceGroupManagersRequest { + + /** + * Constructs a new ListErrorsRegionInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest); + + /** ListErrorsRegionInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ListErrorsRegionInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListErrorsRegionInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListErrorsRegionInstanceGroupManagersRequest project. */ + public project: string; + + /** ListErrorsRegionInstanceGroupManagersRequest region. */ + public region: string; + + /** ListErrorsRegionInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListErrorsRegionInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListErrorsRegionInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListErrorsRegionInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListErrorsRegionInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListErrorsRegionInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListErrorsRegionInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListErrorsRegionInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest): google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest; + + /** + * Encodes the specified ListErrorsRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListErrorsRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListErrorsRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListErrorsRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListErrorsRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListErrorsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest; + + /** + * Decodes a ListErrorsRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListErrorsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest; + + /** + * Verifies a ListErrorsRegionInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListErrorsRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListErrorsRegionInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListErrorsRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListErrorsRegionInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListErrorsRegionInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListManagedInstancesRegionInstanceGroupManagersRequest. */ + interface IListManagedInstancesRegionInstanceGroupManagersRequest { + + /** ListManagedInstancesRegionInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest region */ + region?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListManagedInstancesRegionInstanceGroupManagersRequest. */ + class ListManagedInstancesRegionInstanceGroupManagersRequest implements IListManagedInstancesRegionInstanceGroupManagersRequest { + + /** + * Constructs a new ListManagedInstancesRegionInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ListManagedInstancesRegionInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest project. */ + public project: string; + + /** ListManagedInstancesRegionInstanceGroupManagersRequest region. */ + public region: string; + + /** ListManagedInstancesRegionInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListManagedInstancesRegionInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListManagedInstancesRegionInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListManagedInstancesRegionInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListManagedInstancesRegionInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListManagedInstancesRegionInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListManagedInstancesRegionInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagedInstancesRegionInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest): google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest; + + /** + * Encodes the specified ListManagedInstancesRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagedInstancesRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagedInstancesRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagedInstancesRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest; + + /** + * Decodes a ListManagedInstancesRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagedInstancesRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest; + + /** + * Verifies a ListManagedInstancesRegionInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagedInstancesRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagedInstancesRegionInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListManagedInstancesRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListManagedInstancesRegionInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagedInstancesRegionInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPerInstanceConfigsRegionInstanceGroupManagersRequest. */ + interface IListPerInstanceConfigsRegionInstanceGroupManagersRequest { + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest filter */ + filter?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest maxResults */ + maxResults?: (number|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest orderBy */ + orderBy?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest pageToken */ + pageToken?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest project */ + project?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest region */ + region?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListPerInstanceConfigsRegionInstanceGroupManagersRequest. */ + class ListPerInstanceConfigsRegionInstanceGroupManagersRequest implements IListPerInstanceConfigsRegionInstanceGroupManagersRequest { + + /** + * Constructs a new ListPerInstanceConfigsRegionInstanceGroupManagersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest filter. */ + public filter?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest project. */ + public project: string; + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest region. */ + public region: string; + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest _filter. */ + public _filter?: "filter"; + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListPerInstanceConfigsRegionInstanceGroupManagersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListPerInstanceConfigsRegionInstanceGroupManagersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPerInstanceConfigsRegionInstanceGroupManagersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest): google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest; + + /** + * Encodes the specified ListPerInstanceConfigsRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPerInstanceConfigsRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @param message ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest; + + /** + * Decodes a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest; + + /** + * Verifies a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPerInstanceConfigsRegionInstanceGroupManagersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest; + + /** + * Creates a plain object from a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @param message ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPerInstanceConfigsRegionInstanceGroupManagersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRegionInstanceGroupManagerRequest. */ + interface IPatchRegionInstanceGroupManagerRequest { + + /** PatchRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** PatchRegionInstanceGroupManagerRequest instanceGroupManagerResource */ + instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** PatchRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** PatchRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** PatchRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchRegionInstanceGroupManagerRequest. */ + class PatchRegionInstanceGroupManagerRequest implements IPatchRegionInstanceGroupManagerRequest { + + /** + * Constructs a new PatchRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest); + + /** PatchRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** PatchRegionInstanceGroupManagerRequest instanceGroupManagerResource. */ + public instanceGroupManagerResource?: (google.cloud.compute.v1.IInstanceGroupManager|null); + + /** PatchRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** PatchRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** PatchRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** PatchRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest): google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified PatchRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest; + + /** + * Decodes a PatchRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest; + + /** + * Verifies a PatchRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a PatchRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message PatchRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest. */ + interface IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest { + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerPatchInstanceConfigReqResource */ + regionInstanceGroupManagerPatchInstanceConfigReqResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq|null); + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest. */ + class PatchPerInstanceConfigsRegionInstanceGroupManagerRequest implements IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest { + + /** + * Constructs a new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest); + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerPatchInstanceConfigReqResource. */ + public regionInstanceGroupManagerPatchInstanceConfigReqResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq|null); + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** PatchPerInstanceConfigsRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest): google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Decodes a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Verifies a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchPerInstanceConfigsRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RecreateInstancesRegionInstanceGroupManagerRequest. */ + interface IRecreateInstancesRegionInstanceGroupManagerRequest { + + /** RecreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** RecreateInstancesRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** RecreateInstancesRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** RecreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersRecreateRequestResource */ + regionInstanceGroupManagersRecreateRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest|null); + + /** RecreateInstancesRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RecreateInstancesRegionInstanceGroupManagerRequest. */ + class RecreateInstancesRegionInstanceGroupManagerRequest implements IRecreateInstancesRegionInstanceGroupManagerRequest { + + /** + * Constructs a new RecreateInstancesRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest); + + /** RecreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** RecreateInstancesRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** RecreateInstancesRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** RecreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersRecreateRequestResource. */ + public regionInstanceGroupManagersRecreateRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest|null); + + /** RecreateInstancesRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** RecreateInstancesRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RecreateInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RecreateInstancesRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest): google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified RecreateInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message RecreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecreateInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message RecreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Decodes a RecreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Verifies a RecreateInstancesRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecreateInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecreateInstancesRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a RecreateInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message RecreateInstancesRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecreateInstancesRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResizeRegionInstanceGroupManagerRequest. */ + interface IResizeRegionInstanceGroupManagerRequest { + + /** ResizeRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** ResizeRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** ResizeRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** ResizeRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + + /** ResizeRegionInstanceGroupManagerRequest size */ + size?: (number|null); + } + + /** Represents a ResizeRegionInstanceGroupManagerRequest. */ + class ResizeRegionInstanceGroupManagerRequest implements IResizeRegionInstanceGroupManagerRequest { + + /** + * Constructs a new ResizeRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest); + + /** ResizeRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** ResizeRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** ResizeRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** ResizeRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** ResizeRegionInstanceGroupManagerRequest size. */ + public size: number; + + /** ResizeRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new ResizeRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResizeRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest): google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified ResizeRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message ResizeRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResizeRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message ResizeRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResizeRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResizeRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest; + + /** + * Decodes a ResizeRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResizeRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest; + + /** + * Verifies a ResizeRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResizeRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResizeRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a ResizeRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message ResizeRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResizeRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetInstanceTemplateRegionInstanceGroupManagerRequest. */ + interface ISetInstanceTemplateRegionInstanceGroupManagerRequest { + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTemplateRequestResource */ + regionInstanceGroupManagersSetTemplateRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest|null); + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SetInstanceTemplateRegionInstanceGroupManagerRequest. */ + class SetInstanceTemplateRegionInstanceGroupManagerRequest implements ISetInstanceTemplateRegionInstanceGroupManagerRequest { + + /** + * Constructs a new SetInstanceTemplateRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest); + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTemplateRequestResource. */ + public regionInstanceGroupManagersSetTemplateRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest|null); + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** SetInstanceTemplateRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetInstanceTemplateRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetInstanceTemplateRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest): google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified SetInstanceTemplateRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetInstanceTemplateRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetInstanceTemplateRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetInstanceTemplateRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest; + + /** + * Decodes a SetInstanceTemplateRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetInstanceTemplateRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest; + + /** + * Verifies a SetInstanceTemplateRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetInstanceTemplateRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetInstanceTemplateRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a SetInstanceTemplateRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message SetInstanceTemplateRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetInstanceTemplateRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetTargetPoolsRegionInstanceGroupManagerRequest. */ + interface ISetTargetPoolsRegionInstanceGroupManagerRequest { + + /** SetTargetPoolsRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** SetTargetPoolsRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** SetTargetPoolsRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** SetTargetPoolsRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTargetPoolsRequestResource */ + regionInstanceGroupManagersSetTargetPoolsRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest|null); + + /** SetTargetPoolsRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SetTargetPoolsRegionInstanceGroupManagerRequest. */ + class SetTargetPoolsRegionInstanceGroupManagerRequest implements ISetTargetPoolsRegionInstanceGroupManagerRequest { + + /** + * Constructs a new SetTargetPoolsRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest); + + /** SetTargetPoolsRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** SetTargetPoolsRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** SetTargetPoolsRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** SetTargetPoolsRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTargetPoolsRequestResource. */ + public regionInstanceGroupManagersSetTargetPoolsRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest|null); + + /** SetTargetPoolsRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** SetTargetPoolsRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetTargetPoolsRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetTargetPoolsRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest): google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified SetTargetPoolsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetTargetPoolsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetTargetPoolsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetTargetPoolsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest; + + /** + * Decodes a SetTargetPoolsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetTargetPoolsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest; + + /** + * Verifies a SetTargetPoolsRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetTargetPoolsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetTargetPoolsRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from a SetTargetPoolsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message SetTargetPoolsRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetTargetPoolsRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest. */ + interface IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest { + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager */ + instanceGroupManager?: (string|null); + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest project */ + project?: (string|null); + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest region */ + region?: (string|null); + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerUpdateInstanceConfigReqResource */ + regionInstanceGroupManagerUpdateInstanceConfigReqResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq|null); + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest. */ + class UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest implements IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest { + + /** + * Constructs a new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest); + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager. */ + public instanceGroupManager: string; + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest project. */ + public project: string; + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest region. */ + public region: string; + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerUpdateInstanceConfigReqResource. */ + public regionInstanceGroupManagerUpdateInstanceConfigReqResource?: (google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq|null); + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest requestId. */ + public requestId?: (string|null); + + /** UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest): google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Encodes the specified UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @param message UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Decodes an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Verifies an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest; + + /** + * Creates a plain object from an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @param message UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionInstanceGroupRequest. */ + interface IGetRegionInstanceGroupRequest { + + /** GetRegionInstanceGroupRequest instanceGroup */ + instanceGroup?: (string|null); + + /** GetRegionInstanceGroupRequest project */ + project?: (string|null); + + /** GetRegionInstanceGroupRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionInstanceGroupRequest. */ + class GetRegionInstanceGroupRequest implements IGetRegionInstanceGroupRequest { + + /** + * Constructs a new GetRegionInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionInstanceGroupRequest); + + /** GetRegionInstanceGroupRequest instanceGroup. */ + public instanceGroup: string; + + /** GetRegionInstanceGroupRequest project. */ + public project: string; + + /** GetRegionInstanceGroupRequest region. */ + public region: string; + + /** + * Creates a new GetRegionInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionInstanceGroupRequest): google.cloud.compute.v1.GetRegionInstanceGroupRequest; + + /** + * Encodes the specified GetRegionInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupRequest.verify|verify} messages. + * @param message GetRegionInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupRequest.verify|verify} messages. + * @param message GetRegionInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionInstanceGroupRequest; + + /** + * Decodes a GetRegionInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionInstanceGroupRequest; + + /** + * Verifies a GetRegionInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionInstanceGroupRequest; + + /** + * Creates a plain object from a GetRegionInstanceGroupRequest message. Also converts values to other types if specified. + * @param message GetRegionInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionInstanceGroupsRequest. */ + interface IListRegionInstanceGroupsRequest { + + /** ListRegionInstanceGroupsRequest filter */ + filter?: (string|null); + + /** ListRegionInstanceGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionInstanceGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionInstanceGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionInstanceGroupsRequest project */ + project?: (string|null); + + /** ListRegionInstanceGroupsRequest region */ + region?: (string|null); + + /** ListRegionInstanceGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionInstanceGroupsRequest. */ + class ListRegionInstanceGroupsRequest implements IListRegionInstanceGroupsRequest { + + /** + * Constructs a new ListRegionInstanceGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionInstanceGroupsRequest); + + /** ListRegionInstanceGroupsRequest filter. */ + public filter?: (string|null); + + /** ListRegionInstanceGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionInstanceGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionInstanceGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionInstanceGroupsRequest project. */ + public project: string; + + /** ListRegionInstanceGroupsRequest region. */ + public region: string; + + /** ListRegionInstanceGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionInstanceGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionInstanceGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionInstanceGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionInstanceGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionInstanceGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionInstanceGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionInstanceGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionInstanceGroupsRequest): google.cloud.compute.v1.ListRegionInstanceGroupsRequest; + + /** + * Encodes the specified ListRegionInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupsRequest.verify|verify} messages. + * @param message ListRegionInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupsRequest.verify|verify} messages. + * @param message ListRegionInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionInstanceGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionInstanceGroupsRequest; + + /** + * Decodes a ListRegionInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionInstanceGroupsRequest; + + /** + * Verifies a ListRegionInstanceGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionInstanceGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionInstanceGroupsRequest; + + /** + * Creates a plain object from a ListRegionInstanceGroupsRequest message. Also converts values to other types if specified. + * @param message ListRegionInstanceGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionInstanceGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionInstanceGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesRegionInstanceGroupsRequest. */ + interface IListInstancesRegionInstanceGroupsRequest { + + /** ListInstancesRegionInstanceGroupsRequest filter */ + filter?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest instanceGroup */ + instanceGroup?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListInstancesRegionInstanceGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest project */ + project?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest region */ + region?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest regionInstanceGroupsListInstancesRequestResource */ + regionInstanceGroupsListInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest|null); + + /** ListInstancesRegionInstanceGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListInstancesRegionInstanceGroupsRequest. */ + class ListInstancesRegionInstanceGroupsRequest implements IListInstancesRegionInstanceGroupsRequest { + + /** + * Constructs a new ListInstancesRegionInstanceGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest); + + /** ListInstancesRegionInstanceGroupsRequest filter. */ + public filter?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest instanceGroup. */ + public instanceGroup: string; + + /** ListInstancesRegionInstanceGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListInstancesRegionInstanceGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListInstancesRegionInstanceGroupsRequest project. */ + public project: string; + + /** ListInstancesRegionInstanceGroupsRequest region. */ + public region: string; + + /** ListInstancesRegionInstanceGroupsRequest regionInstanceGroupsListInstancesRequestResource. */ + public regionInstanceGroupsListInstancesRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest|null); + + /** ListInstancesRegionInstanceGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListInstancesRegionInstanceGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListInstancesRegionInstanceGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListInstancesRegionInstanceGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListInstancesRegionInstanceGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListInstancesRegionInstanceGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListInstancesRegionInstanceGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRegionInstanceGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest): google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest; + + /** + * Encodes the specified ListInstancesRegionInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest.verify|verify} messages. + * @param message ListInstancesRegionInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRegionInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest.verify|verify} messages. + * @param message ListInstancesRegionInstanceGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRegionInstanceGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest; + + /** + * Decodes a ListInstancesRegionInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest; + + /** + * Verifies a ListInstancesRegionInstanceGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRegionInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRegionInstanceGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest; + + /** + * Creates a plain object from a ListInstancesRegionInstanceGroupsRequest message. Also converts values to other types if specified. + * @param message ListInstancesRegionInstanceGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRegionInstanceGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetNamedPortsRegionInstanceGroupRequest. */ + interface ISetNamedPortsRegionInstanceGroupRequest { + + /** SetNamedPortsRegionInstanceGroupRequest instanceGroup */ + instanceGroup?: (string|null); + + /** SetNamedPortsRegionInstanceGroupRequest project */ + project?: (string|null); + + /** SetNamedPortsRegionInstanceGroupRequest region */ + region?: (string|null); + + /** SetNamedPortsRegionInstanceGroupRequest regionInstanceGroupsSetNamedPortsRequestResource */ + regionInstanceGroupsSetNamedPortsRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest|null); + + /** SetNamedPortsRegionInstanceGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SetNamedPortsRegionInstanceGroupRequest. */ + class SetNamedPortsRegionInstanceGroupRequest implements ISetNamedPortsRegionInstanceGroupRequest { + + /** + * Constructs a new SetNamedPortsRegionInstanceGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest); + + /** SetNamedPortsRegionInstanceGroupRequest instanceGroup. */ + public instanceGroup: string; + + /** SetNamedPortsRegionInstanceGroupRequest project. */ + public project: string; + + /** SetNamedPortsRegionInstanceGroupRequest region. */ + public region: string; + + /** SetNamedPortsRegionInstanceGroupRequest regionInstanceGroupsSetNamedPortsRequestResource. */ + public regionInstanceGroupsSetNamedPortsRequestResource?: (google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest|null); + + /** SetNamedPortsRegionInstanceGroupRequest requestId. */ + public requestId?: (string|null); + + /** SetNamedPortsRegionInstanceGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetNamedPortsRegionInstanceGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetNamedPortsRegionInstanceGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest): google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest; + + /** + * Encodes the specified SetNamedPortsRegionInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest.verify|verify} messages. + * @param message SetNamedPortsRegionInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetNamedPortsRegionInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest.verify|verify} messages. + * @param message SetNamedPortsRegionInstanceGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetNamedPortsRegionInstanceGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetNamedPortsRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest; + + /** + * Decodes a SetNamedPortsRegionInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetNamedPortsRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest; + + /** + * Verifies a SetNamedPortsRegionInstanceGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetNamedPortsRegionInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetNamedPortsRegionInstanceGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest; + + /** + * Creates a plain object from a SetNamedPortsRegionInstanceGroupRequest message. Also converts values to other types if specified. + * @param message SetNamedPortsRegionInstanceGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetNamedPortsRegionInstanceGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BulkInsertRegionInstanceRequest. */ + interface IBulkInsertRegionInstanceRequest { + + /** BulkInsertRegionInstanceRequest bulkInsertInstanceResourceResource */ + bulkInsertInstanceResourceResource?: (google.cloud.compute.v1.IBulkInsertInstanceResource|null); + + /** BulkInsertRegionInstanceRequest project */ + project?: (string|null); + + /** BulkInsertRegionInstanceRequest region */ + region?: (string|null); + + /** BulkInsertRegionInstanceRequest requestId */ + requestId?: (string|null); + } + + /** Represents a BulkInsertRegionInstanceRequest. */ + class BulkInsertRegionInstanceRequest implements IBulkInsertRegionInstanceRequest { + + /** + * Constructs a new BulkInsertRegionInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBulkInsertRegionInstanceRequest); + + /** BulkInsertRegionInstanceRequest bulkInsertInstanceResourceResource. */ + public bulkInsertInstanceResourceResource?: (google.cloud.compute.v1.IBulkInsertInstanceResource|null); + + /** BulkInsertRegionInstanceRequest project. */ + public project: string; + + /** BulkInsertRegionInstanceRequest region. */ + public region: string; + + /** BulkInsertRegionInstanceRequest requestId. */ + public requestId?: (string|null); + + /** BulkInsertRegionInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new BulkInsertRegionInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BulkInsertRegionInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IBulkInsertRegionInstanceRequest): google.cloud.compute.v1.BulkInsertRegionInstanceRequest; + + /** + * Encodes the specified BulkInsertRegionInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertRegionInstanceRequest.verify|verify} messages. + * @param message BulkInsertRegionInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BulkInsertRegionInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertRegionInstanceRequest.verify|verify} messages. + * @param message BulkInsertRegionInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BulkInsertRegionInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BulkInsertRegionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BulkInsertRegionInstanceRequest; + + /** + * Decodes a BulkInsertRegionInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BulkInsertRegionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BulkInsertRegionInstanceRequest; + + /** + * Verifies a BulkInsertRegionInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BulkInsertRegionInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BulkInsertRegionInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BulkInsertRegionInstanceRequest; + + /** + * Creates a plain object from a BulkInsertRegionInstanceRequest message. Also converts values to other types if specified. + * @param message BulkInsertRegionInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BulkInsertRegionInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BulkInsertRegionInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionNetworkEndpointGroupRequest. */ + interface IDeleteRegionNetworkEndpointGroupRequest { + + /** DeleteRegionNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** DeleteRegionNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** DeleteRegionNetworkEndpointGroupRequest region */ + region?: (string|null); + + /** DeleteRegionNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionNetworkEndpointGroupRequest. */ + class DeleteRegionNetworkEndpointGroupRequest implements IDeleteRegionNetworkEndpointGroupRequest { + + /** + * Constructs a new DeleteRegionNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest); + + /** DeleteRegionNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** DeleteRegionNetworkEndpointGroupRequest project. */ + public project: string; + + /** DeleteRegionNetworkEndpointGroupRequest region. */ + public region: string; + + /** DeleteRegionNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest): google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest; + + /** + * Encodes the specified DeleteRegionNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DeleteRegionNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @param message DeleteRegionNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest; + + /** + * Decodes a DeleteRegionNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest; + + /** + * Verifies a DeleteRegionNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a DeleteRegionNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message DeleteRegionNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionNetworkEndpointGroupRequest. */ + interface IGetRegionNetworkEndpointGroupRequest { + + /** GetRegionNetworkEndpointGroupRequest networkEndpointGroup */ + networkEndpointGroup?: (string|null); + + /** GetRegionNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** GetRegionNetworkEndpointGroupRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionNetworkEndpointGroupRequest. */ + class GetRegionNetworkEndpointGroupRequest implements IGetRegionNetworkEndpointGroupRequest { + + /** + * Constructs a new GetRegionNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest); + + /** GetRegionNetworkEndpointGroupRequest networkEndpointGroup. */ + public networkEndpointGroup: string; + + /** GetRegionNetworkEndpointGroupRequest project. */ + public project: string; + + /** GetRegionNetworkEndpointGroupRequest region. */ + public region: string; + + /** + * Creates a new GetRegionNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest): google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest; + + /** + * Encodes the specified GetRegionNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @param message GetRegionNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @param message GetRegionNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest; + + /** + * Decodes a GetRegionNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest; + + /** + * Verifies a GetRegionNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest; + + /** + * Creates a plain object from a GetRegionNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message GetRegionNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionNetworkEndpointGroupRequest. */ + interface IInsertRegionNetworkEndpointGroupRequest { + + /** InsertRegionNetworkEndpointGroupRequest networkEndpointGroupResource */ + networkEndpointGroupResource?: (google.cloud.compute.v1.INetworkEndpointGroup|null); + + /** InsertRegionNetworkEndpointGroupRequest project */ + project?: (string|null); + + /** InsertRegionNetworkEndpointGroupRequest region */ + region?: (string|null); + + /** InsertRegionNetworkEndpointGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionNetworkEndpointGroupRequest. */ + class InsertRegionNetworkEndpointGroupRequest implements IInsertRegionNetworkEndpointGroupRequest { + + /** + * Constructs a new InsertRegionNetworkEndpointGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest); + + /** InsertRegionNetworkEndpointGroupRequest networkEndpointGroupResource. */ + public networkEndpointGroupResource?: (google.cloud.compute.v1.INetworkEndpointGroup|null); + + /** InsertRegionNetworkEndpointGroupRequest project. */ + public project: string; + + /** InsertRegionNetworkEndpointGroupRequest region. */ + public region: string; + + /** InsertRegionNetworkEndpointGroupRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionNetworkEndpointGroupRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionNetworkEndpointGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionNetworkEndpointGroupRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest): google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest; + + /** + * Encodes the specified InsertRegionNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @param message InsertRegionNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @param message InsertRegionNetworkEndpointGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionNetworkEndpointGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest; + + /** + * Decodes an InsertRegionNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest; + + /** + * Verifies an InsertRegionNetworkEndpointGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionNetworkEndpointGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest; + + /** + * Creates a plain object from an InsertRegionNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @param message InsertRegionNetworkEndpointGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionNetworkEndpointGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionNetworkEndpointGroupsRequest. */ + interface IListRegionNetworkEndpointGroupsRequest { + + /** ListRegionNetworkEndpointGroupsRequest filter */ + filter?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionNetworkEndpointGroupsRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest project */ + project?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest region */ + region?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionNetworkEndpointGroupsRequest. */ + class ListRegionNetworkEndpointGroupsRequest implements IListRegionNetworkEndpointGroupsRequest { + + /** + * Constructs a new ListRegionNetworkEndpointGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest); + + /** ListRegionNetworkEndpointGroupsRequest filter. */ + public filter?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionNetworkEndpointGroupsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionNetworkEndpointGroupsRequest project. */ + public project: string; + + /** ListRegionNetworkEndpointGroupsRequest region. */ + public region: string; + + /** ListRegionNetworkEndpointGroupsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionNetworkEndpointGroupsRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionNetworkEndpointGroupsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionNetworkEndpointGroupsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionNetworkEndpointGroupsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionNetworkEndpointGroupsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionNetworkEndpointGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionNetworkEndpointGroupsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest): google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest; + + /** + * Encodes the specified ListRegionNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListRegionNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest.verify|verify} messages. + * @param message ListRegionNetworkEndpointGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest; + + /** + * Decodes a ListRegionNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest; + + /** + * Verifies a ListRegionNetworkEndpointGroupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionNetworkEndpointGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest; + + /** + * Creates a plain object from a ListRegionNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @param message ListRegionNetworkEndpointGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionNetworkEndpointGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionNotificationEndpointRequest. */ + interface IDeleteRegionNotificationEndpointRequest { + + /** DeleteRegionNotificationEndpointRequest notificationEndpoint */ + notificationEndpoint?: (string|null); + + /** DeleteRegionNotificationEndpointRequest project */ + project?: (string|null); + + /** DeleteRegionNotificationEndpointRequest region */ + region?: (string|null); + + /** DeleteRegionNotificationEndpointRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteRegionNotificationEndpointRequest. */ + class DeleteRegionNotificationEndpointRequest implements IDeleteRegionNotificationEndpointRequest { + + /** + * Constructs a new DeleteRegionNotificationEndpointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest); + + /** DeleteRegionNotificationEndpointRequest notificationEndpoint. */ + public notificationEndpoint: string; + + /** DeleteRegionNotificationEndpointRequest project. */ + public project: string; + + /** DeleteRegionNotificationEndpointRequest region. */ + public region: string; + + /** DeleteRegionNotificationEndpointRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionNotificationEndpointRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionNotificationEndpointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionNotificationEndpointRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest): google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest; + + /** + * Encodes the specified DeleteRegionNotificationEndpointRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest.verify|verify} messages. + * @param message DeleteRegionNotificationEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionNotificationEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest.verify|verify} messages. + * @param message DeleteRegionNotificationEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionNotificationEndpointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest; + + /** + * Decodes a DeleteRegionNotificationEndpointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest; + + /** + * Verifies a DeleteRegionNotificationEndpointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionNotificationEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionNotificationEndpointRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest; + + /** + * Creates a plain object from a DeleteRegionNotificationEndpointRequest message. Also converts values to other types if specified. + * @param message DeleteRegionNotificationEndpointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionNotificationEndpointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionNotificationEndpointRequest. */ + interface IGetRegionNotificationEndpointRequest { + + /** GetRegionNotificationEndpointRequest notificationEndpoint */ + notificationEndpoint?: (string|null); + + /** GetRegionNotificationEndpointRequest project */ + project?: (string|null); + + /** GetRegionNotificationEndpointRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionNotificationEndpointRequest. */ + class GetRegionNotificationEndpointRequest implements IGetRegionNotificationEndpointRequest { + + /** + * Constructs a new GetRegionNotificationEndpointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionNotificationEndpointRequest); + + /** GetRegionNotificationEndpointRequest notificationEndpoint. */ + public notificationEndpoint: string; + + /** GetRegionNotificationEndpointRequest project. */ + public project: string; + + /** GetRegionNotificationEndpointRequest region. */ + public region: string; + + /** + * Creates a new GetRegionNotificationEndpointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionNotificationEndpointRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionNotificationEndpointRequest): google.cloud.compute.v1.GetRegionNotificationEndpointRequest; + + /** + * Encodes the specified GetRegionNotificationEndpointRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionNotificationEndpointRequest.verify|verify} messages. + * @param message GetRegionNotificationEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionNotificationEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionNotificationEndpointRequest.verify|verify} messages. + * @param message GetRegionNotificationEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionNotificationEndpointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionNotificationEndpointRequest; + + /** + * Decodes a GetRegionNotificationEndpointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionNotificationEndpointRequest; + + /** + * Verifies a GetRegionNotificationEndpointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionNotificationEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionNotificationEndpointRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionNotificationEndpointRequest; + + /** + * Creates a plain object from a GetRegionNotificationEndpointRequest message. Also converts values to other types if specified. + * @param message GetRegionNotificationEndpointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionNotificationEndpointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionNotificationEndpointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionNotificationEndpointRequest. */ + interface IInsertRegionNotificationEndpointRequest { + + /** InsertRegionNotificationEndpointRequest notificationEndpointResource */ + notificationEndpointResource?: (google.cloud.compute.v1.INotificationEndpoint|null); + + /** InsertRegionNotificationEndpointRequest project */ + project?: (string|null); + + /** InsertRegionNotificationEndpointRequest region */ + region?: (string|null); + + /** InsertRegionNotificationEndpointRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InsertRegionNotificationEndpointRequest. */ + class InsertRegionNotificationEndpointRequest implements IInsertRegionNotificationEndpointRequest { + + /** + * Constructs a new InsertRegionNotificationEndpointRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest); + + /** InsertRegionNotificationEndpointRequest notificationEndpointResource. */ + public notificationEndpointResource?: (google.cloud.compute.v1.INotificationEndpoint|null); + + /** InsertRegionNotificationEndpointRequest project. */ + public project: string; + + /** InsertRegionNotificationEndpointRequest region. */ + public region: string; + + /** InsertRegionNotificationEndpointRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionNotificationEndpointRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionNotificationEndpointRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionNotificationEndpointRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest): google.cloud.compute.v1.InsertRegionNotificationEndpointRequest; + + /** + * Encodes the specified InsertRegionNotificationEndpointRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNotificationEndpointRequest.verify|verify} messages. + * @param message InsertRegionNotificationEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionNotificationEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNotificationEndpointRequest.verify|verify} messages. + * @param message InsertRegionNotificationEndpointRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionNotificationEndpointRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionNotificationEndpointRequest; + + /** + * Decodes an InsertRegionNotificationEndpointRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionNotificationEndpointRequest; + + /** + * Verifies an InsertRegionNotificationEndpointRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionNotificationEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionNotificationEndpointRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionNotificationEndpointRequest; + + /** + * Creates a plain object from an InsertRegionNotificationEndpointRequest message. Also converts values to other types if specified. + * @param message InsertRegionNotificationEndpointRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionNotificationEndpointRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionNotificationEndpointRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionNotificationEndpointsRequest. */ + interface IListRegionNotificationEndpointsRequest { + + /** ListRegionNotificationEndpointsRequest filter */ + filter?: (string|null); + + /** ListRegionNotificationEndpointsRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionNotificationEndpointsRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionNotificationEndpointsRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionNotificationEndpointsRequest project */ + project?: (string|null); + + /** ListRegionNotificationEndpointsRequest region */ + region?: (string|null); + + /** ListRegionNotificationEndpointsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionNotificationEndpointsRequest. */ + class ListRegionNotificationEndpointsRequest implements IListRegionNotificationEndpointsRequest { + + /** + * Constructs a new ListRegionNotificationEndpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionNotificationEndpointsRequest); + + /** ListRegionNotificationEndpointsRequest filter. */ + public filter?: (string|null); + + /** ListRegionNotificationEndpointsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionNotificationEndpointsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionNotificationEndpointsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionNotificationEndpointsRequest project. */ + public project: string; + + /** ListRegionNotificationEndpointsRequest region. */ + public region: string; + + /** ListRegionNotificationEndpointsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionNotificationEndpointsRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionNotificationEndpointsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionNotificationEndpointsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionNotificationEndpointsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionNotificationEndpointsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionNotificationEndpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionNotificationEndpointsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionNotificationEndpointsRequest): google.cloud.compute.v1.ListRegionNotificationEndpointsRequest; + + /** + * Encodes the specified ListRegionNotificationEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionNotificationEndpointsRequest.verify|verify} messages. + * @param message ListRegionNotificationEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionNotificationEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionNotificationEndpointsRequest.verify|verify} messages. + * @param message ListRegionNotificationEndpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionNotificationEndpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionNotificationEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionNotificationEndpointsRequest; + + /** + * Decodes a ListRegionNotificationEndpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionNotificationEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionNotificationEndpointsRequest; + + /** + * Verifies a ListRegionNotificationEndpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionNotificationEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionNotificationEndpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionNotificationEndpointsRequest; + + /** + * Creates a plain object from a ListRegionNotificationEndpointsRequest message. Also converts values to other types if specified. + * @param message ListRegionNotificationEndpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionNotificationEndpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionNotificationEndpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionOperationRequest. */ + interface IDeleteRegionOperationRequest { + + /** DeleteRegionOperationRequest operation */ + operation?: (string|null); + + /** DeleteRegionOperationRequest project */ + project?: (string|null); + + /** DeleteRegionOperationRequest region */ + region?: (string|null); + } + + /** Represents a DeleteRegionOperationRequest. */ + class DeleteRegionOperationRequest implements IDeleteRegionOperationRequest { + + /** + * Constructs a new DeleteRegionOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionOperationRequest); + + /** DeleteRegionOperationRequest operation. */ + public operation: string; + + /** DeleteRegionOperationRequest project. */ + public project: string; + + /** DeleteRegionOperationRequest region. */ + public region: string; + + /** + * Creates a new DeleteRegionOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionOperationRequest): google.cloud.compute.v1.DeleteRegionOperationRequest; + + /** + * Encodes the specified DeleteRegionOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationRequest.verify|verify} messages. + * @param message DeleteRegionOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationRequest.verify|verify} messages. + * @param message DeleteRegionOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionOperationRequest; + + /** + * Decodes a DeleteRegionOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionOperationRequest; + + /** + * Verifies a DeleteRegionOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionOperationRequest; + + /** + * Creates a plain object from a DeleteRegionOperationRequest message. Also converts values to other types if specified. + * @param message DeleteRegionOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionOperationResponse. */ + interface IDeleteRegionOperationResponse { + } + + /** Represents a DeleteRegionOperationResponse. */ + class DeleteRegionOperationResponse implements IDeleteRegionOperationResponse { + + /** + * Constructs a new DeleteRegionOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionOperationResponse); + + /** + * Creates a new DeleteRegionOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionOperationResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionOperationResponse): google.cloud.compute.v1.DeleteRegionOperationResponse; + + /** + * Encodes the specified DeleteRegionOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationResponse.verify|verify} messages. + * @param message DeleteRegionOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationResponse.verify|verify} messages. + * @param message DeleteRegionOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionOperationResponse; + + /** + * Decodes a DeleteRegionOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionOperationResponse; + + /** + * Verifies a DeleteRegionOperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionOperationResponse; + + /** + * Creates a plain object from a DeleteRegionOperationResponse message. Also converts values to other types if specified. + * @param message DeleteRegionOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionOperationRequest. */ + interface IGetRegionOperationRequest { + + /** GetRegionOperationRequest operation */ + operation?: (string|null); + + /** GetRegionOperationRequest project */ + project?: (string|null); + + /** GetRegionOperationRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionOperationRequest. */ + class GetRegionOperationRequest implements IGetRegionOperationRequest { + + /** + * Constructs a new GetRegionOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionOperationRequest); + + /** GetRegionOperationRequest operation. */ + public operation: string; + + /** GetRegionOperationRequest project. */ + public project: string; + + /** GetRegionOperationRequest region. */ + public region: string; + + /** + * Creates a new GetRegionOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionOperationRequest): google.cloud.compute.v1.GetRegionOperationRequest; + + /** + * Encodes the specified GetRegionOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionOperationRequest.verify|verify} messages. + * @param message GetRegionOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionOperationRequest.verify|verify} messages. + * @param message GetRegionOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionOperationRequest; + + /** + * Decodes a GetRegionOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionOperationRequest; + + /** + * Verifies a GetRegionOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionOperationRequest; + + /** + * Creates a plain object from a GetRegionOperationRequest message. Also converts values to other types if specified. + * @param message GetRegionOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionOperationsRequest. */ + interface IListRegionOperationsRequest { + + /** ListRegionOperationsRequest filter */ + filter?: (string|null); + + /** ListRegionOperationsRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionOperationsRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionOperationsRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionOperationsRequest project */ + project?: (string|null); + + /** ListRegionOperationsRequest region */ + region?: (string|null); + + /** ListRegionOperationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionOperationsRequest. */ + class ListRegionOperationsRequest implements IListRegionOperationsRequest { + + /** + * Constructs a new ListRegionOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionOperationsRequest); + + /** ListRegionOperationsRequest filter. */ + public filter?: (string|null); + + /** ListRegionOperationsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionOperationsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionOperationsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionOperationsRequest project. */ + public project: string; + + /** ListRegionOperationsRequest region. */ + public region: string; + + /** ListRegionOperationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionOperationsRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionOperationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionOperationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionOperationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionOperationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionOperationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionOperationsRequest): google.cloud.compute.v1.ListRegionOperationsRequest; + + /** + * Encodes the specified ListRegionOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionOperationsRequest.verify|verify} messages. + * @param message ListRegionOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionOperationsRequest.verify|verify} messages. + * @param message ListRegionOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionOperationsRequest; + + /** + * Decodes a ListRegionOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionOperationsRequest; + + /** + * Verifies a ListRegionOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionOperationsRequest; + + /** + * Creates a plain object from a ListRegionOperationsRequest message. Also converts values to other types if specified. + * @param message ListRegionOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitRegionOperationRequest. */ + interface IWaitRegionOperationRequest { + + /** WaitRegionOperationRequest operation */ + operation?: (string|null); + + /** WaitRegionOperationRequest project */ + project?: (string|null); + + /** WaitRegionOperationRequest region */ + region?: (string|null); + } + + /** Represents a WaitRegionOperationRequest. */ + class WaitRegionOperationRequest implements IWaitRegionOperationRequest { + + /** + * Constructs a new WaitRegionOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWaitRegionOperationRequest); + + /** WaitRegionOperationRequest operation. */ + public operation: string; + + /** WaitRegionOperationRequest project. */ + public project: string; + + /** WaitRegionOperationRequest region. */ + public region: string; + + /** + * Creates a new WaitRegionOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitRegionOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IWaitRegionOperationRequest): google.cloud.compute.v1.WaitRegionOperationRequest; + + /** + * Encodes the specified WaitRegionOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.WaitRegionOperationRequest.verify|verify} messages. + * @param message WaitRegionOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWaitRegionOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitRegionOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WaitRegionOperationRequest.verify|verify} messages. + * @param message WaitRegionOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWaitRegionOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitRegionOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.WaitRegionOperationRequest; + + /** + * Decodes a WaitRegionOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.WaitRegionOperationRequest; + + /** + * Verifies a WaitRegionOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitRegionOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitRegionOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.WaitRegionOperationRequest; + + /** + * Creates a plain object from a WaitRegionOperationRequest message. Also converts values to other types if specified. + * @param message WaitRegionOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.WaitRegionOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitRegionOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionSslCertificateRequest. */ + interface IDeleteRegionSslCertificateRequest { + + /** DeleteRegionSslCertificateRequest project */ + project?: (string|null); + + /** DeleteRegionSslCertificateRequest region */ + region?: (string|null); + + /** DeleteRegionSslCertificateRequest requestId */ + requestId?: (string|null); + + /** DeleteRegionSslCertificateRequest sslCertificate */ + sslCertificate?: (string|null); + } + + /** Represents a DeleteRegionSslCertificateRequest. */ + class DeleteRegionSslCertificateRequest implements IDeleteRegionSslCertificateRequest { + + /** + * Constructs a new DeleteRegionSslCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionSslCertificateRequest); + + /** DeleteRegionSslCertificateRequest project. */ + public project: string; + + /** DeleteRegionSslCertificateRequest region. */ + public region: string; + + /** DeleteRegionSslCertificateRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionSslCertificateRequest sslCertificate. */ + public sslCertificate: string; + + /** DeleteRegionSslCertificateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionSslCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionSslCertificateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionSslCertificateRequest): google.cloud.compute.v1.DeleteRegionSslCertificateRequest; + + /** + * Encodes the specified DeleteRegionSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionSslCertificateRequest.verify|verify} messages. + * @param message DeleteRegionSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionSslCertificateRequest.verify|verify} messages. + * @param message DeleteRegionSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionSslCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionSslCertificateRequest; + + /** + * Decodes a DeleteRegionSslCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionSslCertificateRequest; + + /** + * Verifies a DeleteRegionSslCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionSslCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionSslCertificateRequest; + + /** + * Creates a plain object from a DeleteRegionSslCertificateRequest message. Also converts values to other types if specified. + * @param message DeleteRegionSslCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionSslCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionSslCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionSslCertificateRequest. */ + interface IGetRegionSslCertificateRequest { + + /** GetRegionSslCertificateRequest project */ + project?: (string|null); + + /** GetRegionSslCertificateRequest region */ + region?: (string|null); + + /** GetRegionSslCertificateRequest sslCertificate */ + sslCertificate?: (string|null); + } + + /** Represents a GetRegionSslCertificateRequest. */ + class GetRegionSslCertificateRequest implements IGetRegionSslCertificateRequest { + + /** + * Constructs a new GetRegionSslCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionSslCertificateRequest); + + /** GetRegionSslCertificateRequest project. */ + public project: string; + + /** GetRegionSslCertificateRequest region. */ + public region: string; + + /** GetRegionSslCertificateRequest sslCertificate. */ + public sslCertificate: string; + + /** + * Creates a new GetRegionSslCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionSslCertificateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionSslCertificateRequest): google.cloud.compute.v1.GetRegionSslCertificateRequest; + + /** + * Encodes the specified GetRegionSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionSslCertificateRequest.verify|verify} messages. + * @param message GetRegionSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionSslCertificateRequest.verify|verify} messages. + * @param message GetRegionSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionSslCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionSslCertificateRequest; + + /** + * Decodes a GetRegionSslCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionSslCertificateRequest; + + /** + * Verifies a GetRegionSslCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionSslCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionSslCertificateRequest; + + /** + * Creates a plain object from a GetRegionSslCertificateRequest message. Also converts values to other types if specified. + * @param message GetRegionSslCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionSslCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionSslCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionSslCertificateRequest. */ + interface IInsertRegionSslCertificateRequest { + + /** InsertRegionSslCertificateRequest project */ + project?: (string|null); + + /** InsertRegionSslCertificateRequest region */ + region?: (string|null); + + /** InsertRegionSslCertificateRequest requestId */ + requestId?: (string|null); + + /** InsertRegionSslCertificateRequest sslCertificateResource */ + sslCertificateResource?: (google.cloud.compute.v1.ISslCertificate|null); + } + + /** Represents an InsertRegionSslCertificateRequest. */ + class InsertRegionSslCertificateRequest implements IInsertRegionSslCertificateRequest { + + /** + * Constructs a new InsertRegionSslCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionSslCertificateRequest); + + /** InsertRegionSslCertificateRequest project. */ + public project: string; + + /** InsertRegionSslCertificateRequest region. */ + public region: string; + + /** InsertRegionSslCertificateRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionSslCertificateRequest sslCertificateResource. */ + public sslCertificateResource?: (google.cloud.compute.v1.ISslCertificate|null); + + /** InsertRegionSslCertificateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionSslCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionSslCertificateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionSslCertificateRequest): google.cloud.compute.v1.InsertRegionSslCertificateRequest; + + /** + * Encodes the specified InsertRegionSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionSslCertificateRequest.verify|verify} messages. + * @param message InsertRegionSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionSslCertificateRequest.verify|verify} messages. + * @param message InsertRegionSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionSslCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionSslCertificateRequest; + + /** + * Decodes an InsertRegionSslCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionSslCertificateRequest; + + /** + * Verifies an InsertRegionSslCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionSslCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionSslCertificateRequest; + + /** + * Creates a plain object from an InsertRegionSslCertificateRequest message. Also converts values to other types if specified. + * @param message InsertRegionSslCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionSslCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionSslCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionSslCertificatesRequest. */ + interface IListRegionSslCertificatesRequest { + + /** ListRegionSslCertificatesRequest filter */ + filter?: (string|null); + + /** ListRegionSslCertificatesRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionSslCertificatesRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionSslCertificatesRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionSslCertificatesRequest project */ + project?: (string|null); + + /** ListRegionSslCertificatesRequest region */ + region?: (string|null); + + /** ListRegionSslCertificatesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionSslCertificatesRequest. */ + class ListRegionSslCertificatesRequest implements IListRegionSslCertificatesRequest { + + /** + * Constructs a new ListRegionSslCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionSslCertificatesRequest); + + /** ListRegionSslCertificatesRequest filter. */ + public filter?: (string|null); + + /** ListRegionSslCertificatesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionSslCertificatesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionSslCertificatesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionSslCertificatesRequest project. */ + public project: string; + + /** ListRegionSslCertificatesRequest region. */ + public region: string; + + /** ListRegionSslCertificatesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionSslCertificatesRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionSslCertificatesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionSslCertificatesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionSslCertificatesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionSslCertificatesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionSslCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionSslCertificatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionSslCertificatesRequest): google.cloud.compute.v1.ListRegionSslCertificatesRequest; + + /** + * Encodes the specified ListRegionSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionSslCertificatesRequest.verify|verify} messages. + * @param message ListRegionSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionSslCertificatesRequest.verify|verify} messages. + * @param message ListRegionSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionSslCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionSslCertificatesRequest; + + /** + * Decodes a ListRegionSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionSslCertificatesRequest; + + /** + * Verifies a ListRegionSslCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionSslCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionSslCertificatesRequest; + + /** + * Creates a plain object from a ListRegionSslCertificatesRequest message. Also converts values to other types if specified. + * @param message ListRegionSslCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionSslCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionSslCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionTargetHttpProxyRequest. */ + interface IDeleteRegionTargetHttpProxyRequest { + + /** DeleteRegionTargetHttpProxyRequest project */ + project?: (string|null); + + /** DeleteRegionTargetHttpProxyRequest region */ + region?: (string|null); + + /** DeleteRegionTargetHttpProxyRequest requestId */ + requestId?: (string|null); + + /** DeleteRegionTargetHttpProxyRequest targetHttpProxy */ + targetHttpProxy?: (string|null); + } + + /** Represents a DeleteRegionTargetHttpProxyRequest. */ + class DeleteRegionTargetHttpProxyRequest implements IDeleteRegionTargetHttpProxyRequest { + + /** + * Constructs a new DeleteRegionTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest); + + /** DeleteRegionTargetHttpProxyRequest project. */ + public project: string; + + /** DeleteRegionTargetHttpProxyRequest region. */ + public region: string; + + /** DeleteRegionTargetHttpProxyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionTargetHttpProxyRequest targetHttpProxy. */ + public targetHttpProxy: string; + + /** DeleteRegionTargetHttpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest): google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest; + + /** + * Encodes the specified DeleteRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message DeleteRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message DeleteRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest; + + /** + * Decodes a DeleteRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest; + + /** + * Verifies a DeleteRegionTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest; + + /** + * Creates a plain object from a DeleteRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message DeleteRegionTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionTargetHttpProxyRequest. */ + interface IGetRegionTargetHttpProxyRequest { + + /** GetRegionTargetHttpProxyRequest project */ + project?: (string|null); + + /** GetRegionTargetHttpProxyRequest region */ + region?: (string|null); + + /** GetRegionTargetHttpProxyRequest targetHttpProxy */ + targetHttpProxy?: (string|null); + } + + /** Represents a GetRegionTargetHttpProxyRequest. */ + class GetRegionTargetHttpProxyRequest implements IGetRegionTargetHttpProxyRequest { + + /** + * Constructs a new GetRegionTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest); + + /** GetRegionTargetHttpProxyRequest project. */ + public project: string; + + /** GetRegionTargetHttpProxyRequest region. */ + public region: string; + + /** GetRegionTargetHttpProxyRequest targetHttpProxy. */ + public targetHttpProxy: string; + + /** + * Creates a new GetRegionTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest): google.cloud.compute.v1.GetRegionTargetHttpProxyRequest; + + /** + * Encodes the specified GetRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message GetRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message GetRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionTargetHttpProxyRequest; + + /** + * Decodes a GetRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionTargetHttpProxyRequest; + + /** + * Verifies a GetRegionTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionTargetHttpProxyRequest; + + /** + * Creates a plain object from a GetRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message GetRegionTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionTargetHttpProxyRequest. */ + interface IInsertRegionTargetHttpProxyRequest { + + /** InsertRegionTargetHttpProxyRequest project */ + project?: (string|null); + + /** InsertRegionTargetHttpProxyRequest region */ + region?: (string|null); + + /** InsertRegionTargetHttpProxyRequest requestId */ + requestId?: (string|null); + + /** InsertRegionTargetHttpProxyRequest targetHttpProxyResource */ + targetHttpProxyResource?: (google.cloud.compute.v1.ITargetHttpProxy|null); + } + + /** Represents an InsertRegionTargetHttpProxyRequest. */ + class InsertRegionTargetHttpProxyRequest implements IInsertRegionTargetHttpProxyRequest { + + /** + * Constructs a new InsertRegionTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest); + + /** InsertRegionTargetHttpProxyRequest project. */ + public project: string; + + /** InsertRegionTargetHttpProxyRequest region. */ + public region: string; + + /** InsertRegionTargetHttpProxyRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionTargetHttpProxyRequest targetHttpProxyResource. */ + public targetHttpProxyResource?: (google.cloud.compute.v1.ITargetHttpProxy|null); + + /** InsertRegionTargetHttpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest): google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest; + + /** + * Encodes the specified InsertRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message InsertRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message InsertRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest; + + /** + * Decodes an InsertRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest; + + /** + * Verifies an InsertRegionTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest; + + /** + * Creates a plain object from an InsertRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message InsertRegionTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionTargetHttpProxiesRequest. */ + interface IListRegionTargetHttpProxiesRequest { + + /** ListRegionTargetHttpProxiesRequest filter */ + filter?: (string|null); + + /** ListRegionTargetHttpProxiesRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionTargetHttpProxiesRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionTargetHttpProxiesRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionTargetHttpProxiesRequest project */ + project?: (string|null); + + /** ListRegionTargetHttpProxiesRequest region */ + region?: (string|null); + + /** ListRegionTargetHttpProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionTargetHttpProxiesRequest. */ + class ListRegionTargetHttpProxiesRequest implements IListRegionTargetHttpProxiesRequest { + + /** + * Constructs a new ListRegionTargetHttpProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest); + + /** ListRegionTargetHttpProxiesRequest filter. */ + public filter?: (string|null); + + /** ListRegionTargetHttpProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionTargetHttpProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionTargetHttpProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionTargetHttpProxiesRequest project. */ + public project: string; + + /** ListRegionTargetHttpProxiesRequest region. */ + public region: string; + + /** ListRegionTargetHttpProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionTargetHttpProxiesRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionTargetHttpProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionTargetHttpProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionTargetHttpProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionTargetHttpProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionTargetHttpProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionTargetHttpProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest): google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest; + + /** + * Encodes the specified ListRegionTargetHttpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest.verify|verify} messages. + * @param message ListRegionTargetHttpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionTargetHttpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest.verify|verify} messages. + * @param message ListRegionTargetHttpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionTargetHttpProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest; + + /** + * Decodes a ListRegionTargetHttpProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest; + + /** + * Verifies a ListRegionTargetHttpProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionTargetHttpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionTargetHttpProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest; + + /** + * Creates a plain object from a ListRegionTargetHttpProxiesRequest message. Also converts values to other types if specified. + * @param message ListRegionTargetHttpProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionTargetHttpProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetUrlMapRegionTargetHttpProxyRequest. */ + interface ISetUrlMapRegionTargetHttpProxyRequest { + + /** SetUrlMapRegionTargetHttpProxyRequest project */ + project?: (string|null); + + /** SetUrlMapRegionTargetHttpProxyRequest region */ + region?: (string|null); + + /** SetUrlMapRegionTargetHttpProxyRequest requestId */ + requestId?: (string|null); + + /** SetUrlMapRegionTargetHttpProxyRequest targetHttpProxy */ + targetHttpProxy?: (string|null); + + /** SetUrlMapRegionTargetHttpProxyRequest urlMapReferenceResource */ + urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + } + + /** Represents a SetUrlMapRegionTargetHttpProxyRequest. */ + class SetUrlMapRegionTargetHttpProxyRequest implements ISetUrlMapRegionTargetHttpProxyRequest { + + /** + * Constructs a new SetUrlMapRegionTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest); + + /** SetUrlMapRegionTargetHttpProxyRequest project. */ + public project: string; + + /** SetUrlMapRegionTargetHttpProxyRequest region. */ + public region: string; + + /** SetUrlMapRegionTargetHttpProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetUrlMapRegionTargetHttpProxyRequest targetHttpProxy. */ + public targetHttpProxy: string; + + /** SetUrlMapRegionTargetHttpProxyRequest urlMapReferenceResource. */ + public urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + + /** SetUrlMapRegionTargetHttpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetUrlMapRegionTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetUrlMapRegionTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest): google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message SetUrlMapRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest.verify|verify} messages. + * @param message SetUrlMapRegionTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetUrlMapRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetUrlMapRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest; + + /** + * Decodes a SetUrlMapRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetUrlMapRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest; + + /** + * Verifies a SetUrlMapRegionTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetUrlMapRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetUrlMapRegionTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest; + + /** + * Creates a plain object from a SetUrlMapRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message SetUrlMapRegionTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetUrlMapRegionTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionTargetHttpsProxyRequest. */ + interface IDeleteRegionTargetHttpsProxyRequest { + + /** DeleteRegionTargetHttpsProxyRequest project */ + project?: (string|null); + + /** DeleteRegionTargetHttpsProxyRequest region */ + region?: (string|null); + + /** DeleteRegionTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** DeleteRegionTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a DeleteRegionTargetHttpsProxyRequest. */ + class DeleteRegionTargetHttpsProxyRequest implements IDeleteRegionTargetHttpsProxyRequest { + + /** + * Constructs a new DeleteRegionTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest); + + /** DeleteRegionTargetHttpsProxyRequest project. */ + public project: string; + + /** DeleteRegionTargetHttpsProxyRequest region. */ + public region: string; + + /** DeleteRegionTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** DeleteRegionTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest): google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest; + + /** + * Encodes the specified DeleteRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message DeleteRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message DeleteRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest; + + /** + * Decodes a DeleteRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest; + + /** + * Verifies a DeleteRegionTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest; + + /** + * Creates a plain object from a DeleteRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message DeleteRegionTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionTargetHttpsProxyRequest. */ + interface IGetRegionTargetHttpsProxyRequest { + + /** GetRegionTargetHttpsProxyRequest project */ + project?: (string|null); + + /** GetRegionTargetHttpsProxyRequest region */ + region?: (string|null); + + /** GetRegionTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a GetRegionTargetHttpsProxyRequest. */ + class GetRegionTargetHttpsProxyRequest implements IGetRegionTargetHttpsProxyRequest { + + /** + * Constructs a new GetRegionTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest); + + /** GetRegionTargetHttpsProxyRequest project. */ + public project: string; + + /** GetRegionTargetHttpsProxyRequest region. */ + public region: string; + + /** GetRegionTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** + * Creates a new GetRegionTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest): google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest; + + /** + * Encodes the specified GetRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message GetRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message GetRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest; + + /** + * Decodes a GetRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest; + + /** + * Verifies a GetRegionTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest; + + /** + * Creates a plain object from a GetRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message GetRegionTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionTargetHttpsProxyRequest. */ + interface IInsertRegionTargetHttpsProxyRequest { + + /** InsertRegionTargetHttpsProxyRequest project */ + project?: (string|null); + + /** InsertRegionTargetHttpsProxyRequest region */ + region?: (string|null); + + /** InsertRegionTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** InsertRegionTargetHttpsProxyRequest targetHttpsProxyResource */ + targetHttpsProxyResource?: (google.cloud.compute.v1.ITargetHttpsProxy|null); + } + + /** Represents an InsertRegionTargetHttpsProxyRequest. */ + class InsertRegionTargetHttpsProxyRequest implements IInsertRegionTargetHttpsProxyRequest { + + /** + * Constructs a new InsertRegionTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest); + + /** InsertRegionTargetHttpsProxyRequest project. */ + public project: string; + + /** InsertRegionTargetHttpsProxyRequest region. */ + public region: string; + + /** InsertRegionTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionTargetHttpsProxyRequest targetHttpsProxyResource. */ + public targetHttpsProxyResource?: (google.cloud.compute.v1.ITargetHttpsProxy|null); + + /** InsertRegionTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest): google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest; + + /** + * Encodes the specified InsertRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message InsertRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message InsertRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest; + + /** + * Decodes an InsertRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest; + + /** + * Verifies an InsertRegionTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest; + + /** + * Creates a plain object from an InsertRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message InsertRegionTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionTargetHttpsProxiesRequest. */ + interface IListRegionTargetHttpsProxiesRequest { + + /** ListRegionTargetHttpsProxiesRequest filter */ + filter?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionTargetHttpsProxiesRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest project */ + project?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest region */ + region?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionTargetHttpsProxiesRequest. */ + class ListRegionTargetHttpsProxiesRequest implements IListRegionTargetHttpsProxiesRequest { + + /** + * Constructs a new ListRegionTargetHttpsProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest); + + /** ListRegionTargetHttpsProxiesRequest filter. */ + public filter?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionTargetHttpsProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionTargetHttpsProxiesRequest project. */ + public project: string; + + /** ListRegionTargetHttpsProxiesRequest region. */ + public region: string; + + /** ListRegionTargetHttpsProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionTargetHttpsProxiesRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionTargetHttpsProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionTargetHttpsProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionTargetHttpsProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionTargetHttpsProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionTargetHttpsProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionTargetHttpsProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest): google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest; + + /** + * Encodes the specified ListRegionTargetHttpsProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest.verify|verify} messages. + * @param message ListRegionTargetHttpsProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionTargetHttpsProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest.verify|verify} messages. + * @param message ListRegionTargetHttpsProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionTargetHttpsProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest; + + /** + * Decodes a ListRegionTargetHttpsProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest; + + /** + * Verifies a ListRegionTargetHttpsProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionTargetHttpsProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionTargetHttpsProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest; + + /** + * Creates a plain object from a ListRegionTargetHttpsProxiesRequest message. Also converts values to other types if specified. + * @param message ListRegionTargetHttpsProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionTargetHttpsProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetSslCertificatesRegionTargetHttpsProxyRequest. */ + interface ISetSslCertificatesRegionTargetHttpsProxyRequest { + + /** SetSslCertificatesRegionTargetHttpsProxyRequest project */ + project?: (string|null); + + /** SetSslCertificatesRegionTargetHttpsProxyRequest region */ + region?: (string|null); + + /** SetSslCertificatesRegionTargetHttpsProxyRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource */ + regionTargetHttpsProxiesSetSslCertificatesRequestResource?: (google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest|null); + + /** SetSslCertificatesRegionTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** SetSslCertificatesRegionTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a SetSslCertificatesRegionTargetHttpsProxyRequest. */ + class SetSslCertificatesRegionTargetHttpsProxyRequest implements ISetSslCertificatesRegionTargetHttpsProxyRequest { + + /** + * Constructs a new SetSslCertificatesRegionTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest); + + /** SetSslCertificatesRegionTargetHttpsProxyRequest project. */ + public project: string; + + /** SetSslCertificatesRegionTargetHttpsProxyRequest region. */ + public region: string; + + /** SetSslCertificatesRegionTargetHttpsProxyRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource. */ + public regionTargetHttpsProxiesSetSslCertificatesRequestResource?: (google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest|null); + + /** SetSslCertificatesRegionTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetSslCertificatesRegionTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** SetSslCertificatesRegionTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetSslCertificatesRegionTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetSslCertificatesRegionTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest): google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest; + + /** + * Encodes the specified SetSslCertificatesRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetSslCertificatesRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetSslCertificatesRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetSslCertificatesRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest; + + /** + * Decodes a SetSslCertificatesRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetSslCertificatesRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest; + + /** + * Verifies a SetSslCertificatesRegionTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetSslCertificatesRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetSslCertificatesRegionTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest; + + /** + * Creates a plain object from a SetSslCertificatesRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message SetSslCertificatesRegionTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetSslCertificatesRegionTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetUrlMapRegionTargetHttpsProxyRequest. */ + interface ISetUrlMapRegionTargetHttpsProxyRequest { + + /** SetUrlMapRegionTargetHttpsProxyRequest project */ + project?: (string|null); + + /** SetUrlMapRegionTargetHttpsProxyRequest region */ + region?: (string|null); + + /** SetUrlMapRegionTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** SetUrlMapRegionTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + + /** SetUrlMapRegionTargetHttpsProxyRequest urlMapReferenceResource */ + urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + } + + /** Represents a SetUrlMapRegionTargetHttpsProxyRequest. */ + class SetUrlMapRegionTargetHttpsProxyRequest implements ISetUrlMapRegionTargetHttpsProxyRequest { + + /** + * Constructs a new SetUrlMapRegionTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest); + + /** SetUrlMapRegionTargetHttpsProxyRequest project. */ + public project: string; + + /** SetUrlMapRegionTargetHttpsProxyRequest region. */ + public region: string; + + /** SetUrlMapRegionTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetUrlMapRegionTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** SetUrlMapRegionTargetHttpsProxyRequest urlMapReferenceResource. */ + public urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + + /** SetUrlMapRegionTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetUrlMapRegionTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetUrlMapRegionTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest): google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetUrlMapRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetUrlMapRegionTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetUrlMapRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetUrlMapRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest; + + /** + * Decodes a SetUrlMapRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetUrlMapRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest; + + /** + * Verifies a SetUrlMapRegionTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetUrlMapRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetUrlMapRegionTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest; + + /** + * Creates a plain object from a SetUrlMapRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message SetUrlMapRegionTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetUrlMapRegionTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRegionUrlMapRequest. */ + interface IDeleteRegionUrlMapRequest { + + /** DeleteRegionUrlMapRequest project */ + project?: (string|null); + + /** DeleteRegionUrlMapRequest region */ + region?: (string|null); + + /** DeleteRegionUrlMapRequest requestId */ + requestId?: (string|null); + + /** DeleteRegionUrlMapRequest urlMap */ + urlMap?: (string|null); + } + + /** Represents a DeleteRegionUrlMapRequest. */ + class DeleteRegionUrlMapRequest implements IDeleteRegionUrlMapRequest { + + /** + * Constructs a new DeleteRegionUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRegionUrlMapRequest); + + /** DeleteRegionUrlMapRequest project. */ + public project: string; + + /** DeleteRegionUrlMapRequest region. */ + public region: string; + + /** DeleteRegionUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRegionUrlMapRequest urlMap. */ + public urlMap: string; + + /** DeleteRegionUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRegionUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRegionUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRegionUrlMapRequest): google.cloud.compute.v1.DeleteRegionUrlMapRequest; + + /** + * Encodes the specified DeleteRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionUrlMapRequest.verify|verify} messages. + * @param message DeleteRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionUrlMapRequest.verify|verify} messages. + * @param message DeleteRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRegionUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRegionUrlMapRequest; + + /** + * Decodes a DeleteRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRegionUrlMapRequest; + + /** + * Verifies a DeleteRegionUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRegionUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRegionUrlMapRequest; + + /** + * Creates a plain object from a DeleteRegionUrlMapRequest message. Also converts values to other types if specified. + * @param message DeleteRegionUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRegionUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRegionUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionUrlMapRequest. */ + interface IGetRegionUrlMapRequest { + + /** GetRegionUrlMapRequest project */ + project?: (string|null); + + /** GetRegionUrlMapRequest region */ + region?: (string|null); + + /** GetRegionUrlMapRequest urlMap */ + urlMap?: (string|null); + } + + /** Represents a GetRegionUrlMapRequest. */ + class GetRegionUrlMapRequest implements IGetRegionUrlMapRequest { + + /** + * Constructs a new GetRegionUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionUrlMapRequest); + + /** GetRegionUrlMapRequest project. */ + public project: string; + + /** GetRegionUrlMapRequest region. */ + public region: string; + + /** GetRegionUrlMapRequest urlMap. */ + public urlMap: string; + + /** + * Creates a new GetRegionUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionUrlMapRequest): google.cloud.compute.v1.GetRegionUrlMapRequest; + + /** + * Encodes the specified GetRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionUrlMapRequest.verify|verify} messages. + * @param message GetRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionUrlMapRequest.verify|verify} messages. + * @param message GetRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionUrlMapRequest; + + /** + * Decodes a GetRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionUrlMapRequest; + + /** + * Verifies a GetRegionUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionUrlMapRequest; + + /** + * Creates a plain object from a GetRegionUrlMapRequest message. Also converts values to other types if specified. + * @param message GetRegionUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRegionUrlMapRequest. */ + interface IInsertRegionUrlMapRequest { + + /** InsertRegionUrlMapRequest project */ + project?: (string|null); + + /** InsertRegionUrlMapRequest region */ + region?: (string|null); + + /** InsertRegionUrlMapRequest requestId */ + requestId?: (string|null); + + /** InsertRegionUrlMapRequest urlMapResource */ + urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents an InsertRegionUrlMapRequest. */ + class InsertRegionUrlMapRequest implements IInsertRegionUrlMapRequest { + + /** + * Constructs a new InsertRegionUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRegionUrlMapRequest); + + /** InsertRegionUrlMapRequest project. */ + public project: string; + + /** InsertRegionUrlMapRequest region. */ + public region: string; + + /** InsertRegionUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** InsertRegionUrlMapRequest urlMapResource. */ + public urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + + /** InsertRegionUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRegionUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRegionUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRegionUrlMapRequest): google.cloud.compute.v1.InsertRegionUrlMapRequest; + + /** + * Encodes the specified InsertRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionUrlMapRequest.verify|verify} messages. + * @param message InsertRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionUrlMapRequest.verify|verify} messages. + * @param message InsertRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRegionUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRegionUrlMapRequest; + + /** + * Decodes an InsertRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRegionUrlMapRequest; + + /** + * Verifies an InsertRegionUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRegionUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRegionUrlMapRequest; + + /** + * Creates a plain object from an InsertRegionUrlMapRequest message. Also converts values to other types if specified. + * @param message InsertRegionUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRegionUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRegionUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionUrlMapsRequest. */ + interface IListRegionUrlMapsRequest { + + /** ListRegionUrlMapsRequest filter */ + filter?: (string|null); + + /** ListRegionUrlMapsRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionUrlMapsRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionUrlMapsRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionUrlMapsRequest project */ + project?: (string|null); + + /** ListRegionUrlMapsRequest region */ + region?: (string|null); + + /** ListRegionUrlMapsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionUrlMapsRequest. */ + class ListRegionUrlMapsRequest implements IListRegionUrlMapsRequest { + + /** + * Constructs a new ListRegionUrlMapsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionUrlMapsRequest); + + /** ListRegionUrlMapsRequest filter. */ + public filter?: (string|null); + + /** ListRegionUrlMapsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionUrlMapsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionUrlMapsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionUrlMapsRequest project. */ + public project: string; + + /** ListRegionUrlMapsRequest region. */ + public region: string; + + /** ListRegionUrlMapsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionUrlMapsRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionUrlMapsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionUrlMapsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionUrlMapsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionUrlMapsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionUrlMapsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionUrlMapsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionUrlMapsRequest): google.cloud.compute.v1.ListRegionUrlMapsRequest; + + /** + * Encodes the specified ListRegionUrlMapsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionUrlMapsRequest.verify|verify} messages. + * @param message ListRegionUrlMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionUrlMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionUrlMapsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionUrlMapsRequest.verify|verify} messages. + * @param message ListRegionUrlMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionUrlMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionUrlMapsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionUrlMapsRequest; + + /** + * Decodes a ListRegionUrlMapsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionUrlMapsRequest; + + /** + * Verifies a ListRegionUrlMapsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionUrlMapsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionUrlMapsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionUrlMapsRequest; + + /** + * Creates a plain object from a ListRegionUrlMapsRequest message. Also converts values to other types if specified. + * @param message ListRegionUrlMapsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionUrlMapsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionUrlMapsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRegionUrlMapRequest. */ + interface IPatchRegionUrlMapRequest { + + /** PatchRegionUrlMapRequest project */ + project?: (string|null); + + /** PatchRegionUrlMapRequest region */ + region?: (string|null); + + /** PatchRegionUrlMapRequest requestId */ + requestId?: (string|null); + + /** PatchRegionUrlMapRequest urlMap */ + urlMap?: (string|null); + + /** PatchRegionUrlMapRequest urlMapResource */ + urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents a PatchRegionUrlMapRequest. */ + class PatchRegionUrlMapRequest implements IPatchRegionUrlMapRequest { + + /** + * Constructs a new PatchRegionUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRegionUrlMapRequest); + + /** PatchRegionUrlMapRequest project. */ + public project: string; + + /** PatchRegionUrlMapRequest region. */ + public region: string; + + /** PatchRegionUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** PatchRegionUrlMapRequest urlMap. */ + public urlMap: string; + + /** PatchRegionUrlMapRequest urlMapResource. */ + public urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + + /** PatchRegionUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRegionUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRegionUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRegionUrlMapRequest): google.cloud.compute.v1.PatchRegionUrlMapRequest; + + /** + * Encodes the specified PatchRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionUrlMapRequest.verify|verify} messages. + * @param message PatchRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionUrlMapRequest.verify|verify} messages. + * @param message PatchRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRegionUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRegionUrlMapRequest; + + /** + * Decodes a PatchRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRegionUrlMapRequest; + + /** + * Verifies a PatchRegionUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRegionUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRegionUrlMapRequest; + + /** + * Creates a plain object from a PatchRegionUrlMapRequest message. Also converts values to other types if specified. + * @param message PatchRegionUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRegionUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRegionUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateRegionUrlMapRequest. */ + interface IUpdateRegionUrlMapRequest { + + /** UpdateRegionUrlMapRequest project */ + project?: (string|null); + + /** UpdateRegionUrlMapRequest region */ + region?: (string|null); + + /** UpdateRegionUrlMapRequest requestId */ + requestId?: (string|null); + + /** UpdateRegionUrlMapRequest urlMap */ + urlMap?: (string|null); + + /** UpdateRegionUrlMapRequest urlMapResource */ + urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents an UpdateRegionUrlMapRequest. */ + class UpdateRegionUrlMapRequest implements IUpdateRegionUrlMapRequest { + + /** + * Constructs a new UpdateRegionUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateRegionUrlMapRequest); + + /** UpdateRegionUrlMapRequest project. */ + public project: string; + + /** UpdateRegionUrlMapRequest region. */ + public region: string; + + /** UpdateRegionUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** UpdateRegionUrlMapRequest urlMap. */ + public urlMap: string; + + /** UpdateRegionUrlMapRequest urlMapResource. */ + public urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + + /** UpdateRegionUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateRegionUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRegionUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateRegionUrlMapRequest): google.cloud.compute.v1.UpdateRegionUrlMapRequest; + + /** + * Encodes the specified UpdateRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionUrlMapRequest.verify|verify} messages. + * @param message UpdateRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionUrlMapRequest.verify|verify} messages. + * @param message UpdateRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRegionUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateRegionUrlMapRequest; + + /** + * Decodes an UpdateRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateRegionUrlMapRequest; + + /** + * Verifies an UpdateRegionUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRegionUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateRegionUrlMapRequest; + + /** + * Creates a plain object from an UpdateRegionUrlMapRequest message. Also converts values to other types if specified. + * @param message UpdateRegionUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateRegionUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRegionUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ValidateRegionUrlMapRequest. */ + interface IValidateRegionUrlMapRequest { + + /** ValidateRegionUrlMapRequest project */ + project?: (string|null); + + /** ValidateRegionUrlMapRequest region */ + region?: (string|null); + + /** ValidateRegionUrlMapRequest regionUrlMapsValidateRequestResource */ + regionUrlMapsValidateRequestResource?: (google.cloud.compute.v1.IRegionUrlMapsValidateRequest|null); + + /** ValidateRegionUrlMapRequest urlMap */ + urlMap?: (string|null); + } + + /** Represents a ValidateRegionUrlMapRequest. */ + class ValidateRegionUrlMapRequest implements IValidateRegionUrlMapRequest { + + /** + * Constructs a new ValidateRegionUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IValidateRegionUrlMapRequest); + + /** ValidateRegionUrlMapRequest project. */ + public project: string; + + /** ValidateRegionUrlMapRequest region. */ + public region: string; + + /** ValidateRegionUrlMapRequest regionUrlMapsValidateRequestResource. */ + public regionUrlMapsValidateRequestResource?: (google.cloud.compute.v1.IRegionUrlMapsValidateRequest|null); + + /** ValidateRegionUrlMapRequest urlMap. */ + public urlMap: string; + + /** + * Creates a new ValidateRegionUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateRegionUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IValidateRegionUrlMapRequest): google.cloud.compute.v1.ValidateRegionUrlMapRequest; + + /** + * Encodes the specified ValidateRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.ValidateRegionUrlMapRequest.verify|verify} messages. + * @param message ValidateRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IValidateRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ValidateRegionUrlMapRequest.verify|verify} messages. + * @param message ValidateRegionUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IValidateRegionUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateRegionUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ValidateRegionUrlMapRequest; + + /** + * Decodes a ValidateRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ValidateRegionUrlMapRequest; + + /** + * Verifies a ValidateRegionUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateRegionUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ValidateRegionUrlMapRequest; + + /** + * Creates a plain object from a ValidateRegionUrlMapRequest message. Also converts values to other types if specified. + * @param message ValidateRegionUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ValidateRegionUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateRegionUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRegionRequest. */ + interface IGetRegionRequest { + + /** GetRegionRequest project */ + project?: (string|null); + + /** GetRegionRequest region */ + region?: (string|null); + } + + /** Represents a GetRegionRequest. */ + class GetRegionRequest implements IGetRegionRequest { + + /** + * Constructs a new GetRegionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRegionRequest); + + /** GetRegionRequest project. */ + public project: string; + + /** GetRegionRequest region. */ + public region: string; + + /** + * Creates a new GetRegionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRegionRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRegionRequest): google.cloud.compute.v1.GetRegionRequest; + + /** + * Encodes the specified GetRegionRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionRequest.verify|verify} messages. + * @param message GetRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRegionRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionRequest.verify|verify} messages. + * @param message GetRegionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRegionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRegionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRegionRequest; + + /** + * Decodes a GetRegionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRegionRequest; + + /** + * Verifies a GetRegionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRegionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRegionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRegionRequest; + + /** + * Creates a plain object from a GetRegionRequest message. Also converts values to other types if specified. + * @param message GetRegionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRegionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRegionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRegionsRequest. */ + interface IListRegionsRequest { + + /** ListRegionsRequest filter */ + filter?: (string|null); + + /** ListRegionsRequest maxResults */ + maxResults?: (number|null); + + /** ListRegionsRequest orderBy */ + orderBy?: (string|null); + + /** ListRegionsRequest pageToken */ + pageToken?: (string|null); + + /** ListRegionsRequest project */ + project?: (string|null); + + /** ListRegionsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRegionsRequest. */ + class ListRegionsRequest implements IListRegionsRequest { + + /** + * Constructs a new ListRegionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRegionsRequest); + + /** ListRegionsRequest filter. */ + public filter?: (string|null); + + /** ListRegionsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRegionsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRegionsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRegionsRequest project. */ + public project: string; + + /** ListRegionsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRegionsRequest _filter. */ + public _filter?: "filter"; + + /** ListRegionsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRegionsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRegionsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRegionsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRegionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRegionsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRegionsRequest): google.cloud.compute.v1.ListRegionsRequest; + + /** + * Encodes the specified ListRegionsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionsRequest.verify|verify} messages. + * @param message ListRegionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRegionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRegionsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionsRequest.verify|verify} messages. + * @param message ListRegionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRegionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRegionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRegionsRequest; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRegionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRegionsRequest; + + /** + * Verifies a ListRegionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRegionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRegionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRegionsRequest; + + /** + * Creates a plain object from a ListRegionsRequest message. Also converts values to other types if specified. + * @param message ListRegionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRegionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRegionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListReservationsRequest. */ + interface IAggregatedListReservationsRequest { + + /** AggregatedListReservationsRequest filter */ + filter?: (string|null); + + /** AggregatedListReservationsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListReservationsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListReservationsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListReservationsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListReservationsRequest project */ + project?: (string|null); + + /** AggregatedListReservationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListReservationsRequest. */ + class AggregatedListReservationsRequest implements IAggregatedListReservationsRequest { + + /** + * Constructs a new AggregatedListReservationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListReservationsRequest); + + /** AggregatedListReservationsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListReservationsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListReservationsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListReservationsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListReservationsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListReservationsRequest project. */ + public project: string; + + /** AggregatedListReservationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListReservationsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListReservationsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListReservationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListReservationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListReservationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListReservationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListReservationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListReservationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListReservationsRequest): google.cloud.compute.v1.AggregatedListReservationsRequest; + + /** + * Encodes the specified AggregatedListReservationsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListReservationsRequest.verify|verify} messages. + * @param message AggregatedListReservationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListReservationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListReservationsRequest.verify|verify} messages. + * @param message AggregatedListReservationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListReservationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListReservationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListReservationsRequest; + + /** + * Decodes an AggregatedListReservationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListReservationsRequest; + + /** + * Verifies an AggregatedListReservationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListReservationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListReservationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListReservationsRequest; + + /** + * Creates a plain object from an AggregatedListReservationsRequest message. Also converts values to other types if specified. + * @param message AggregatedListReservationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListReservationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListReservationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteReservationRequest. */ + interface IDeleteReservationRequest { + + /** DeleteReservationRequest project */ + project?: (string|null); + + /** DeleteReservationRequest requestId */ + requestId?: (string|null); + + /** DeleteReservationRequest reservation */ + reservation?: (string|null); + + /** DeleteReservationRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteReservationRequest. */ + class DeleteReservationRequest implements IDeleteReservationRequest { + + /** + * Constructs a new DeleteReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteReservationRequest); + + /** DeleteReservationRequest project. */ + public project: string; + + /** DeleteReservationRequest requestId. */ + public requestId?: (string|null); + + /** DeleteReservationRequest reservation. */ + public reservation: string; + + /** DeleteReservationRequest zone. */ + public zone: string; + + /** DeleteReservationRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReservationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteReservationRequest): google.cloud.compute.v1.DeleteReservationRequest; + + /** + * Encodes the specified DeleteReservationRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IDeleteReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.DeleteReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetReservationRequest. */ + interface IGetReservationRequest { + + /** GetReservationRequest project */ + project?: (string|null); + + /** GetReservationRequest reservation */ + reservation?: (string|null); + + /** GetReservationRequest zone */ + zone?: (string|null); + } + + /** Represents a GetReservationRequest. */ + class GetReservationRequest implements IGetReservationRequest { + + /** + * Constructs a new GetReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetReservationRequest); + + /** GetReservationRequest project. */ + public project: string; + + /** GetReservationRequest reservation. */ + public reservation: string; + + /** GetReservationRequest zone. */ + public zone: string; + + /** + * Creates a new GetReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetReservationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetReservationRequest): google.cloud.compute.v1.GetReservationRequest; + + /** + * Encodes the specified GetReservationRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IGetReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.GetReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyReservationRequest. */ + interface IGetIamPolicyReservationRequest { + + /** GetIamPolicyReservationRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyReservationRequest project */ + project?: (string|null); + + /** GetIamPolicyReservationRequest resource */ + resource?: (string|null); + + /** GetIamPolicyReservationRequest zone */ + zone?: (string|null); + } + + /** Represents a GetIamPolicyReservationRequest. */ + class GetIamPolicyReservationRequest implements IGetIamPolicyReservationRequest { + + /** + * Constructs a new GetIamPolicyReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyReservationRequest); + + /** GetIamPolicyReservationRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyReservationRequest project. */ + public project: string; + + /** GetIamPolicyReservationRequest resource. */ + public resource: string; + + /** GetIamPolicyReservationRequest zone. */ + public zone: string; + + /** GetIamPolicyReservationRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyReservationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyReservationRequest): google.cloud.compute.v1.GetIamPolicyReservationRequest; + + /** + * Encodes the specified GetIamPolicyReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyReservationRequest.verify|verify} messages. + * @param message GetIamPolicyReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyReservationRequest.verify|verify} messages. + * @param message GetIamPolicyReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyReservationRequest; + + /** + * Decodes a GetIamPolicyReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyReservationRequest; + + /** + * Verifies a GetIamPolicyReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyReservationRequest; + + /** + * Creates a plain object from a GetIamPolicyReservationRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertReservationRequest. */ + interface IInsertReservationRequest { + + /** InsertReservationRequest project */ + project?: (string|null); + + /** InsertReservationRequest requestId */ + requestId?: (string|null); + + /** InsertReservationRequest reservationResource */ + reservationResource?: (google.cloud.compute.v1.IReservation|null); + + /** InsertReservationRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertReservationRequest. */ + class InsertReservationRequest implements IInsertReservationRequest { + + /** + * Constructs a new InsertReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertReservationRequest); + + /** InsertReservationRequest project. */ + public project: string; + + /** InsertReservationRequest requestId. */ + public requestId?: (string|null); + + /** InsertReservationRequest reservationResource. */ + public reservationResource?: (google.cloud.compute.v1.IReservation|null); + + /** InsertReservationRequest zone. */ + public zone: string; + + /** InsertReservationRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertReservationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertReservationRequest): google.cloud.compute.v1.InsertReservationRequest; + + /** + * Encodes the specified InsertReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertReservationRequest.verify|verify} messages. + * @param message InsertReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertReservationRequest.verify|verify} messages. + * @param message InsertReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertReservationRequest; + + /** + * Decodes an InsertReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertReservationRequest; + + /** + * Verifies an InsertReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertReservationRequest; + + /** + * Creates a plain object from an InsertReservationRequest message. Also converts values to other types if specified. + * @param message InsertReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListReservationsRequest. */ + interface IListReservationsRequest { + + /** ListReservationsRequest filter */ + filter?: (string|null); + + /** ListReservationsRequest maxResults */ + maxResults?: (number|null); + + /** ListReservationsRequest orderBy */ + orderBy?: (string|null); + + /** ListReservationsRequest pageToken */ + pageToken?: (string|null); + + /** ListReservationsRequest project */ + project?: (string|null); + + /** ListReservationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListReservationsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListReservationsRequest. */ + class ListReservationsRequest implements IListReservationsRequest { + + /** + * Constructs a new ListReservationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListReservationsRequest); + + /** ListReservationsRequest filter. */ + public filter?: (string|null); + + /** ListReservationsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListReservationsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListReservationsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListReservationsRequest project. */ + public project: string; + + /** ListReservationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListReservationsRequest zone. */ + public zone: string; + + /** ListReservationsRequest _filter. */ + public _filter?: "filter"; + + /** ListReservationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListReservationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListReservationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListReservationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListReservationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReservationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListReservationsRequest): google.cloud.compute.v1.ListReservationsRequest; + + /** + * Encodes the specified ListReservationsRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IListReservationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.ListReservationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListReservationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResizeReservationRequest. */ + interface IResizeReservationRequest { + + /** ResizeReservationRequest project */ + project?: (string|null); + + /** ResizeReservationRequest requestId */ + requestId?: (string|null); + + /** ResizeReservationRequest reservation */ + reservation?: (string|null); + + /** ResizeReservationRequest reservationsResizeRequestResource */ + reservationsResizeRequestResource?: (google.cloud.compute.v1.IReservationsResizeRequest|null); + + /** ResizeReservationRequest zone */ + zone?: (string|null); + } + + /** Represents a ResizeReservationRequest. */ + class ResizeReservationRequest implements IResizeReservationRequest { + + /** + * Constructs a new ResizeReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IResizeReservationRequest); + + /** ResizeReservationRequest project. */ + public project: string; + + /** ResizeReservationRequest requestId. */ + public requestId?: (string|null); + + /** ResizeReservationRequest reservation. */ + public reservation: string; + + /** ResizeReservationRequest reservationsResizeRequestResource. */ + public reservationsResizeRequestResource?: (google.cloud.compute.v1.IReservationsResizeRequest|null); + + /** ResizeReservationRequest zone. */ + public zone: string; + + /** ResizeReservationRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new ResizeReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResizeReservationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IResizeReservationRequest): google.cloud.compute.v1.ResizeReservationRequest; + + /** + * Encodes the specified ResizeReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeReservationRequest.verify|verify} messages. + * @param message ResizeReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IResizeReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResizeReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeReservationRequest.verify|verify} messages. + * @param message ResizeReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IResizeReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResizeReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResizeReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ResizeReservationRequest; + + /** + * Decodes a ResizeReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResizeReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ResizeReservationRequest; + + /** + * Verifies a ResizeReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResizeReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResizeReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ResizeReservationRequest; + + /** + * Creates a plain object from a ResizeReservationRequest message. Also converts values to other types if specified. + * @param message ResizeReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ResizeReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResizeReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyReservationRequest. */ + interface ISetIamPolicyReservationRequest { + + /** SetIamPolicyReservationRequest project */ + project?: (string|null); + + /** SetIamPolicyReservationRequest resource */ + resource?: (string|null); + + /** SetIamPolicyReservationRequest zone */ + zone?: (string|null); + + /** SetIamPolicyReservationRequest zoneSetPolicyRequestResource */ + zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + } + + /** Represents a SetIamPolicyReservationRequest. */ + class SetIamPolicyReservationRequest implements ISetIamPolicyReservationRequest { + + /** + * Constructs a new SetIamPolicyReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyReservationRequest); + + /** SetIamPolicyReservationRequest project. */ + public project: string; + + /** SetIamPolicyReservationRequest resource. */ + public resource: string; + + /** SetIamPolicyReservationRequest zone. */ + public zone: string; + + /** SetIamPolicyReservationRequest zoneSetPolicyRequestResource. */ + public zoneSetPolicyRequestResource?: (google.cloud.compute.v1.IZoneSetPolicyRequest|null); + + /** + * Creates a new SetIamPolicyReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyReservationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyReservationRequest): google.cloud.compute.v1.SetIamPolicyReservationRequest; + + /** + * Encodes the specified SetIamPolicyReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyReservationRequest.verify|verify} messages. + * @param message SetIamPolicyReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyReservationRequest.verify|verify} messages. + * @param message SetIamPolicyReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyReservationRequest; + + /** + * Decodes a SetIamPolicyReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyReservationRequest; + + /** + * Verifies a SetIamPolicyReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyReservationRequest; + + /** + * Creates a plain object from a SetIamPolicyReservationRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsReservationRequest. */ + interface ITestIamPermissionsReservationRequest { + + /** TestIamPermissionsReservationRequest project */ + project?: (string|null); + + /** TestIamPermissionsReservationRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsReservationRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsReservationRequest zone */ + zone?: (string|null); + } + + /** Represents a TestIamPermissionsReservationRequest. */ + class TestIamPermissionsReservationRequest implements ITestIamPermissionsReservationRequest { + + /** + * Constructs a new TestIamPermissionsReservationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsReservationRequest); + + /** TestIamPermissionsReservationRequest project. */ + public project: string; + + /** TestIamPermissionsReservationRequest resource. */ + public resource: string; + + /** TestIamPermissionsReservationRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** TestIamPermissionsReservationRequest zone. */ + public zone: string; + + /** + * Creates a new TestIamPermissionsReservationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsReservationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsReservationRequest): google.cloud.compute.v1.TestIamPermissionsReservationRequest; + + /** + * Encodes the specified TestIamPermissionsReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsReservationRequest.verify|verify} messages. + * @param message TestIamPermissionsReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsReservationRequest.verify|verify} messages. + * @param message TestIamPermissionsReservationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsReservationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsReservationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsReservationRequest; + + /** + * Decodes a TestIamPermissionsReservationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsReservationRequest; + + /** + * Verifies a TestIamPermissionsReservationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsReservationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsReservationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsReservationRequest; + + /** + * Creates a plain object from a TestIamPermissionsReservationRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsReservationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsReservationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsReservationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListResourcePoliciesRequest. */ + interface IAggregatedListResourcePoliciesRequest { + + /** AggregatedListResourcePoliciesRequest filter */ + filter?: (string|null); + + /** AggregatedListResourcePoliciesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListResourcePoliciesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListResourcePoliciesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListResourcePoliciesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListResourcePoliciesRequest project */ + project?: (string|null); + + /** AggregatedListResourcePoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListResourcePoliciesRequest. */ + class AggregatedListResourcePoliciesRequest implements IAggregatedListResourcePoliciesRequest { + + /** + * Constructs a new AggregatedListResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest); + + /** AggregatedListResourcePoliciesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListResourcePoliciesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListResourcePoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListResourcePoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListResourcePoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListResourcePoliciesRequest project. */ + public project: string; + + /** AggregatedListResourcePoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListResourcePoliciesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListResourcePoliciesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListResourcePoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListResourcePoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListResourcePoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListResourcePoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest): google.cloud.compute.v1.AggregatedListResourcePoliciesRequest; + + /** + * Encodes the specified AggregatedListResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListResourcePoliciesRequest.verify|verify} messages. + * @param message AggregatedListResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListResourcePoliciesRequest.verify|verify} messages. + * @param message AggregatedListResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListResourcePoliciesRequest; + + /** + * Decodes an AggregatedListResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListResourcePoliciesRequest; + + /** + * Verifies an AggregatedListResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListResourcePoliciesRequest; + + /** + * Creates a plain object from an AggregatedListResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message AggregatedListResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteResourcePolicyRequest. */ + interface IDeleteResourcePolicyRequest { + + /** DeleteResourcePolicyRequest project */ + project?: (string|null); + + /** DeleteResourcePolicyRequest region */ + region?: (string|null); + + /** DeleteResourcePolicyRequest requestId */ + requestId?: (string|null); + + /** DeleteResourcePolicyRequest resourcePolicy */ + resourcePolicy?: (string|null); + } + + /** Represents a DeleteResourcePolicyRequest. */ + class DeleteResourcePolicyRequest implements IDeleteResourcePolicyRequest { + + /** + * Constructs a new DeleteResourcePolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteResourcePolicyRequest); + + /** DeleteResourcePolicyRequest project. */ + public project: string; + + /** DeleteResourcePolicyRequest region. */ + public region: string; + + /** DeleteResourcePolicyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteResourcePolicyRequest resourcePolicy. */ + public resourcePolicy: string; + + /** DeleteResourcePolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteResourcePolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteResourcePolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteResourcePolicyRequest): google.cloud.compute.v1.DeleteResourcePolicyRequest; + + /** + * Encodes the specified DeleteResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteResourcePolicyRequest.verify|verify} messages. + * @param message DeleteResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteResourcePolicyRequest.verify|verify} messages. + * @param message DeleteResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteResourcePolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteResourcePolicyRequest; + + /** + * Decodes a DeleteResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteResourcePolicyRequest; + + /** + * Verifies a DeleteResourcePolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteResourcePolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteResourcePolicyRequest; + + /** + * Creates a plain object from a DeleteResourcePolicyRequest message. Also converts values to other types if specified. + * @param message DeleteResourcePolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteResourcePolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteResourcePolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetResourcePolicyRequest. */ + interface IGetResourcePolicyRequest { + + /** GetResourcePolicyRequest project */ + project?: (string|null); + + /** GetResourcePolicyRequest region */ + region?: (string|null); + + /** GetResourcePolicyRequest resourcePolicy */ + resourcePolicy?: (string|null); + } + + /** Represents a GetResourcePolicyRequest. */ + class GetResourcePolicyRequest implements IGetResourcePolicyRequest { + + /** + * Constructs a new GetResourcePolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetResourcePolicyRequest); + + /** GetResourcePolicyRequest project. */ + public project: string; + + /** GetResourcePolicyRequest region. */ + public region: string; + + /** GetResourcePolicyRequest resourcePolicy. */ + public resourcePolicy: string; + + /** + * Creates a new GetResourcePolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetResourcePolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetResourcePolicyRequest): google.cloud.compute.v1.GetResourcePolicyRequest; + + /** + * Encodes the specified GetResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetResourcePolicyRequest.verify|verify} messages. + * @param message GetResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetResourcePolicyRequest.verify|verify} messages. + * @param message GetResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetResourcePolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetResourcePolicyRequest; + + /** + * Decodes a GetResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetResourcePolicyRequest; + + /** + * Verifies a GetResourcePolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetResourcePolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetResourcePolicyRequest; + + /** + * Creates a plain object from a GetResourcePolicyRequest message. Also converts values to other types if specified. + * @param message GetResourcePolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetResourcePolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetResourcePolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicyResourcePolicyRequest. */ + interface IGetIamPolicyResourcePolicyRequest { + + /** GetIamPolicyResourcePolicyRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyResourcePolicyRequest project */ + project?: (string|null); + + /** GetIamPolicyResourcePolicyRequest region */ + region?: (string|null); + + /** GetIamPolicyResourcePolicyRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicyResourcePolicyRequest. */ + class GetIamPolicyResourcePolicyRequest implements IGetIamPolicyResourcePolicyRequest { + + /** + * Constructs a new GetIamPolicyResourcePolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest); + + /** GetIamPolicyResourcePolicyRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicyResourcePolicyRequest project. */ + public project: string; + + /** GetIamPolicyResourcePolicyRequest region. */ + public region: string; + + /** GetIamPolicyResourcePolicyRequest resource. */ + public resource: string; + + /** GetIamPolicyResourcePolicyRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicyResourcePolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicyResourcePolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest): google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest; + + /** + * Encodes the specified GetIamPolicyResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @param message GetIamPolicyResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicyResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @param message GetIamPolicyResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicyResourcePolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest; + + /** + * Decodes a GetIamPolicyResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest; + + /** + * Verifies a GetIamPolicyResourcePolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicyResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicyResourcePolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest; + + /** + * Creates a plain object from a GetIamPolicyResourcePolicyRequest message. Also converts values to other types if specified. + * @param message GetIamPolicyResourcePolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicyResourcePolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertResourcePolicyRequest. */ + interface IInsertResourcePolicyRequest { + + /** InsertResourcePolicyRequest project */ + project?: (string|null); + + /** InsertResourcePolicyRequest region */ + region?: (string|null); + + /** InsertResourcePolicyRequest requestId */ + requestId?: (string|null); + + /** InsertResourcePolicyRequest resourcePolicyResource */ + resourcePolicyResource?: (google.cloud.compute.v1.IResourcePolicy|null); + } + + /** Represents an InsertResourcePolicyRequest. */ + class InsertResourcePolicyRequest implements IInsertResourcePolicyRequest { + + /** + * Constructs a new InsertResourcePolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertResourcePolicyRequest); + + /** InsertResourcePolicyRequest project. */ + public project: string; + + /** InsertResourcePolicyRequest region. */ + public region: string; + + /** InsertResourcePolicyRequest requestId. */ + public requestId?: (string|null); + + /** InsertResourcePolicyRequest resourcePolicyResource. */ + public resourcePolicyResource?: (google.cloud.compute.v1.IResourcePolicy|null); + + /** InsertResourcePolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertResourcePolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertResourcePolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertResourcePolicyRequest): google.cloud.compute.v1.InsertResourcePolicyRequest; + + /** + * Encodes the specified InsertResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertResourcePolicyRequest.verify|verify} messages. + * @param message InsertResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertResourcePolicyRequest.verify|verify} messages. + * @param message InsertResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertResourcePolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertResourcePolicyRequest; + + /** + * Decodes an InsertResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertResourcePolicyRequest; + + /** + * Verifies an InsertResourcePolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertResourcePolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertResourcePolicyRequest; + + /** + * Creates a plain object from an InsertResourcePolicyRequest message. Also converts values to other types if specified. + * @param message InsertResourcePolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertResourcePolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertResourcePolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListResourcePoliciesRequest. */ + interface IListResourcePoliciesRequest { + + /** ListResourcePoliciesRequest filter */ + filter?: (string|null); + + /** ListResourcePoliciesRequest maxResults */ + maxResults?: (number|null); + + /** ListResourcePoliciesRequest orderBy */ + orderBy?: (string|null); + + /** ListResourcePoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListResourcePoliciesRequest project */ + project?: (string|null); + + /** ListResourcePoliciesRequest region */ + region?: (string|null); + + /** ListResourcePoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListResourcePoliciesRequest. */ + class ListResourcePoliciesRequest implements IListResourcePoliciesRequest { + + /** + * Constructs a new ListResourcePoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListResourcePoliciesRequest); + + /** ListResourcePoliciesRequest filter. */ + public filter?: (string|null); + + /** ListResourcePoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListResourcePoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListResourcePoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListResourcePoliciesRequest project. */ + public project: string; + + /** ListResourcePoliciesRequest region. */ + public region: string; + + /** ListResourcePoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListResourcePoliciesRequest _filter. */ + public _filter?: "filter"; + + /** ListResourcePoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListResourcePoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListResourcePoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListResourcePoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListResourcePoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourcePoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListResourcePoliciesRequest): google.cloud.compute.v1.ListResourcePoliciesRequest; + + /** + * Encodes the specified ListResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListResourcePoliciesRequest.verify|verify} messages. + * @param message ListResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListResourcePoliciesRequest.verify|verify} messages. + * @param message ListResourcePoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListResourcePoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourcePoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListResourcePoliciesRequest; + + /** + * Decodes a ListResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListResourcePoliciesRequest; + + /** + * Verifies a ListResourcePoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourcePoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListResourcePoliciesRequest; + + /** + * Creates a plain object from a ListResourcePoliciesRequest message. Also converts values to other types if specified. + * @param message ListResourcePoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListResourcePoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourcePoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicyResourcePolicyRequest. */ + interface ISetIamPolicyResourcePolicyRequest { + + /** SetIamPolicyResourcePolicyRequest project */ + project?: (string|null); + + /** SetIamPolicyResourcePolicyRequest region */ + region?: (string|null); + + /** SetIamPolicyResourcePolicyRequest regionSetPolicyRequestResource */ + regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicyResourcePolicyRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicyResourcePolicyRequest. */ + class SetIamPolicyResourcePolicyRequest implements ISetIamPolicyResourcePolicyRequest { + + /** + * Constructs a new SetIamPolicyResourcePolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest); + + /** SetIamPolicyResourcePolicyRequest project. */ + public project: string; + + /** SetIamPolicyResourcePolicyRequest region. */ + public region: string; + + /** SetIamPolicyResourcePolicyRequest regionSetPolicyRequestResource. */ + public regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicyResourcePolicyRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicyResourcePolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicyResourcePolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest): google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest; + + /** + * Encodes the specified SetIamPolicyResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @param message SetIamPolicyResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicyResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @param message SetIamPolicyResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicyResourcePolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest; + + /** + * Decodes a SetIamPolicyResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest; + + /** + * Verifies a SetIamPolicyResourcePolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicyResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicyResourcePolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest; + + /** + * Creates a plain object from a SetIamPolicyResourcePolicyRequest message. Also converts values to other types if specified. + * @param message SetIamPolicyResourcePolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicyResourcePolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsResourcePolicyRequest. */ + interface ITestIamPermissionsResourcePolicyRequest { + + /** TestIamPermissionsResourcePolicyRequest project */ + project?: (string|null); + + /** TestIamPermissionsResourcePolicyRequest region */ + region?: (string|null); + + /** TestIamPermissionsResourcePolicyRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsResourcePolicyRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsResourcePolicyRequest. */ + class TestIamPermissionsResourcePolicyRequest implements ITestIamPermissionsResourcePolicyRequest { + + /** + * Constructs a new TestIamPermissionsResourcePolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest); + + /** TestIamPermissionsResourcePolicyRequest project. */ + public project: string; + + /** TestIamPermissionsResourcePolicyRequest region. */ + public region: string; + + /** TestIamPermissionsResourcePolicyRequest resource. */ + public resource: string; + + /** TestIamPermissionsResourcePolicyRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsResourcePolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsResourcePolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest): google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest; + + /** + * Encodes the specified TestIamPermissionsResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest.verify|verify} messages. + * @param message TestIamPermissionsResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest.verify|verify} messages. + * @param message TestIamPermissionsResourcePolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsResourcePolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest; + + /** + * Decodes a TestIamPermissionsResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest; + + /** + * Verifies a TestIamPermissionsResourcePolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsResourcePolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest; + + /** + * Creates a plain object from a TestIamPermissionsResourcePolicyRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsResourcePolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsResourcePolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListRoutersRequest. */ + interface IAggregatedListRoutersRequest { + + /** AggregatedListRoutersRequest filter */ + filter?: (string|null); + + /** AggregatedListRoutersRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListRoutersRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListRoutersRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListRoutersRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListRoutersRequest project */ + project?: (string|null); + + /** AggregatedListRoutersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListRoutersRequest. */ + class AggregatedListRoutersRequest implements IAggregatedListRoutersRequest { + + /** + * Constructs a new AggregatedListRoutersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListRoutersRequest); + + /** AggregatedListRoutersRequest filter. */ + public filter?: (string|null); + + /** AggregatedListRoutersRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListRoutersRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListRoutersRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListRoutersRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListRoutersRequest project. */ + public project: string; + + /** AggregatedListRoutersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListRoutersRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListRoutersRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListRoutersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListRoutersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListRoutersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListRoutersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListRoutersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListRoutersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListRoutersRequest): google.cloud.compute.v1.AggregatedListRoutersRequest; + + /** + * Encodes the specified AggregatedListRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRoutersRequest.verify|verify} messages. + * @param message AggregatedListRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRoutersRequest.verify|verify} messages. + * @param message AggregatedListRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListRoutersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListRoutersRequest; + + /** + * Decodes an AggregatedListRoutersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListRoutersRequest; + + /** + * Verifies an AggregatedListRoutersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListRoutersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListRoutersRequest; + + /** + * Creates a plain object from an AggregatedListRoutersRequest message. Also converts values to other types if specified. + * @param message AggregatedListRoutersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListRoutersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListRoutersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRouterRequest. */ + interface IDeleteRouterRequest { + + /** DeleteRouterRequest project */ + project?: (string|null); + + /** DeleteRouterRequest region */ + region?: (string|null); + + /** DeleteRouterRequest requestId */ + requestId?: (string|null); + + /** DeleteRouterRequest router */ + router?: (string|null); + } + + /** Represents a DeleteRouterRequest. */ + class DeleteRouterRequest implements IDeleteRouterRequest { + + /** + * Constructs a new DeleteRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRouterRequest); + + /** DeleteRouterRequest project. */ + public project: string; + + /** DeleteRouterRequest region. */ + public region: string; + + /** DeleteRouterRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRouterRequest router. */ + public router: string; + + /** DeleteRouterRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRouterRequest): google.cloud.compute.v1.DeleteRouterRequest; + + /** + * Encodes the specified DeleteRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRouterRequest.verify|verify} messages. + * @param message DeleteRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRouterRequest.verify|verify} messages. + * @param message DeleteRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRouterRequest; + + /** + * Decodes a DeleteRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRouterRequest; + + /** + * Verifies a DeleteRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRouterRequest; + + /** + * Creates a plain object from a DeleteRouterRequest message. Also converts values to other types if specified. + * @param message DeleteRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRouterRequest. */ + interface IGetRouterRequest { + + /** GetRouterRequest project */ + project?: (string|null); + + /** GetRouterRequest region */ + region?: (string|null); + + /** GetRouterRequest router */ + router?: (string|null); + } + + /** Represents a GetRouterRequest. */ + class GetRouterRequest implements IGetRouterRequest { + + /** + * Constructs a new GetRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRouterRequest); + + /** GetRouterRequest project. */ + public project: string; + + /** GetRouterRequest region. */ + public region: string; + + /** GetRouterRequest router. */ + public router: string; + + /** + * Creates a new GetRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRouterRequest): google.cloud.compute.v1.GetRouterRequest; + + /** + * Encodes the specified GetRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRouterRequest.verify|verify} messages. + * @param message GetRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRouterRequest.verify|verify} messages. + * @param message GetRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRouterRequest; + + /** + * Decodes a GetRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRouterRequest; + + /** + * Verifies a GetRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRouterRequest; + + /** + * Creates a plain object from a GetRouterRequest message. Also converts values to other types if specified. + * @param message GetRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetNatMappingInfoRoutersRequest. */ + interface IGetNatMappingInfoRoutersRequest { + + /** GetNatMappingInfoRoutersRequest filter */ + filter?: (string|null); + + /** GetNatMappingInfoRoutersRequest maxResults */ + maxResults?: (number|null); + + /** GetNatMappingInfoRoutersRequest orderBy */ + orderBy?: (string|null); + + /** GetNatMappingInfoRoutersRequest pageToken */ + pageToken?: (string|null); + + /** GetNatMappingInfoRoutersRequest project */ + project?: (string|null); + + /** GetNatMappingInfoRoutersRequest region */ + region?: (string|null); + + /** GetNatMappingInfoRoutersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** GetNatMappingInfoRoutersRequest router */ + router?: (string|null); + } + + /** Represents a GetNatMappingInfoRoutersRequest. */ + class GetNatMappingInfoRoutersRequest implements IGetNatMappingInfoRoutersRequest { + + /** + * Constructs a new GetNatMappingInfoRoutersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest); + + /** GetNatMappingInfoRoutersRequest filter. */ + public filter?: (string|null); + + /** GetNatMappingInfoRoutersRequest maxResults. */ + public maxResults?: (number|null); + + /** GetNatMappingInfoRoutersRequest orderBy. */ + public orderBy?: (string|null); + + /** GetNatMappingInfoRoutersRequest pageToken. */ + public pageToken?: (string|null); + + /** GetNatMappingInfoRoutersRequest project. */ + public project: string; + + /** GetNatMappingInfoRoutersRequest region. */ + public region: string; + + /** GetNatMappingInfoRoutersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** GetNatMappingInfoRoutersRequest router. */ + public router: string; + + /** GetNatMappingInfoRoutersRequest _filter. */ + public _filter?: "filter"; + + /** GetNatMappingInfoRoutersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** GetNatMappingInfoRoutersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** GetNatMappingInfoRoutersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** GetNatMappingInfoRoutersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new GetNatMappingInfoRoutersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNatMappingInfoRoutersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest): google.cloud.compute.v1.GetNatMappingInfoRoutersRequest; + + /** + * Encodes the specified GetNatMappingInfoRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNatMappingInfoRoutersRequest.verify|verify} messages. + * @param message GetNatMappingInfoRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNatMappingInfoRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNatMappingInfoRoutersRequest.verify|verify} messages. + * @param message GetNatMappingInfoRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNatMappingInfoRoutersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNatMappingInfoRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetNatMappingInfoRoutersRequest; + + /** + * Decodes a GetNatMappingInfoRoutersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNatMappingInfoRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetNatMappingInfoRoutersRequest; + + /** + * Verifies a GetNatMappingInfoRoutersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNatMappingInfoRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNatMappingInfoRoutersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetNatMappingInfoRoutersRequest; + + /** + * Creates a plain object from a GetNatMappingInfoRoutersRequest message. Also converts values to other types if specified. + * @param message GetNatMappingInfoRoutersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetNatMappingInfoRoutersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNatMappingInfoRoutersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRouterStatusRouterRequest. */ + interface IGetRouterStatusRouterRequest { + + /** GetRouterStatusRouterRequest project */ + project?: (string|null); + + /** GetRouterStatusRouterRequest region */ + region?: (string|null); + + /** GetRouterStatusRouterRequest router */ + router?: (string|null); + } + + /** Represents a GetRouterStatusRouterRequest. */ + class GetRouterStatusRouterRequest implements IGetRouterStatusRouterRequest { + + /** + * Constructs a new GetRouterStatusRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRouterStatusRouterRequest); + + /** GetRouterStatusRouterRequest project. */ + public project: string; + + /** GetRouterStatusRouterRequest region. */ + public region: string; + + /** GetRouterStatusRouterRequest router. */ + public router: string; + + /** + * Creates a new GetRouterStatusRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRouterStatusRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRouterStatusRouterRequest): google.cloud.compute.v1.GetRouterStatusRouterRequest; + + /** + * Encodes the specified GetRouterStatusRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRouterStatusRouterRequest.verify|verify} messages. + * @param message GetRouterStatusRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRouterStatusRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRouterStatusRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRouterStatusRouterRequest.verify|verify} messages. + * @param message GetRouterStatusRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRouterStatusRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRouterStatusRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRouterStatusRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRouterStatusRouterRequest; + + /** + * Decodes a GetRouterStatusRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRouterStatusRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRouterStatusRouterRequest; + + /** + * Verifies a GetRouterStatusRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRouterStatusRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRouterStatusRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRouterStatusRouterRequest; + + /** + * Creates a plain object from a GetRouterStatusRouterRequest message. Also converts values to other types if specified. + * @param message GetRouterStatusRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRouterStatusRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRouterStatusRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRouterRequest. */ + interface IInsertRouterRequest { + + /** InsertRouterRequest project */ + project?: (string|null); + + /** InsertRouterRequest region */ + region?: (string|null); + + /** InsertRouterRequest requestId */ + requestId?: (string|null); + + /** InsertRouterRequest routerResource */ + routerResource?: (google.cloud.compute.v1.IRouter|null); + } + + /** Represents an InsertRouterRequest. */ + class InsertRouterRequest implements IInsertRouterRequest { + + /** + * Constructs a new InsertRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRouterRequest); + + /** InsertRouterRequest project. */ + public project: string; + + /** InsertRouterRequest region. */ + public region: string; + + /** InsertRouterRequest requestId. */ + public requestId?: (string|null); + + /** InsertRouterRequest routerResource. */ + public routerResource?: (google.cloud.compute.v1.IRouter|null); + + /** InsertRouterRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRouterRequest): google.cloud.compute.v1.InsertRouterRequest; + + /** + * Encodes the specified InsertRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRouterRequest.verify|verify} messages. + * @param message InsertRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRouterRequest.verify|verify} messages. + * @param message InsertRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRouterRequest; + + /** + * Decodes an InsertRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRouterRequest; + + /** + * Verifies an InsertRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRouterRequest; + + /** + * Creates a plain object from an InsertRouterRequest message. Also converts values to other types if specified. + * @param message InsertRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRoutersRequest. */ + interface IListRoutersRequest { + + /** ListRoutersRequest filter */ + filter?: (string|null); + + /** ListRoutersRequest maxResults */ + maxResults?: (number|null); + + /** ListRoutersRequest orderBy */ + orderBy?: (string|null); + + /** ListRoutersRequest pageToken */ + pageToken?: (string|null); + + /** ListRoutersRequest project */ + project?: (string|null); + + /** ListRoutersRequest region */ + region?: (string|null); + + /** ListRoutersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRoutersRequest. */ + class ListRoutersRequest implements IListRoutersRequest { + + /** + * Constructs a new ListRoutersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRoutersRequest); + + /** ListRoutersRequest filter. */ + public filter?: (string|null); + + /** ListRoutersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRoutersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRoutersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRoutersRequest project. */ + public project: string; + + /** ListRoutersRequest region. */ + public region: string; + + /** ListRoutersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRoutersRequest _filter. */ + public _filter?: "filter"; + + /** ListRoutersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRoutersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRoutersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRoutersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRoutersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRoutersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRoutersRequest): google.cloud.compute.v1.ListRoutersRequest; + + /** + * Encodes the specified ListRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRoutersRequest.verify|verify} messages. + * @param message ListRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRoutersRequest.verify|verify} messages. + * @param message ListRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRoutersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRoutersRequest; + + /** + * Decodes a ListRoutersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRoutersRequest; + + /** + * Verifies a ListRoutersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRoutersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRoutersRequest; + + /** + * Creates a plain object from a ListRoutersRequest message. Also converts values to other types if specified. + * @param message ListRoutersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRoutersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRoutersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRouterRequest. */ + interface IPatchRouterRequest { + + /** PatchRouterRequest project */ + project?: (string|null); + + /** PatchRouterRequest region */ + region?: (string|null); + + /** PatchRouterRequest requestId */ + requestId?: (string|null); + + /** PatchRouterRequest router */ + router?: (string|null); + + /** PatchRouterRequest routerResource */ + routerResource?: (google.cloud.compute.v1.IRouter|null); + } + + /** Represents a PatchRouterRequest. */ + class PatchRouterRequest implements IPatchRouterRequest { + + /** + * Constructs a new PatchRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRouterRequest); + + /** PatchRouterRequest project. */ + public project: string; + + /** PatchRouterRequest region. */ + public region: string; + + /** PatchRouterRequest requestId. */ + public requestId?: (string|null); + + /** PatchRouterRequest router. */ + public router: string; + + /** PatchRouterRequest routerResource. */ + public routerResource?: (google.cloud.compute.v1.IRouter|null); + + /** PatchRouterRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRouterRequest): google.cloud.compute.v1.PatchRouterRequest; + + /** + * Encodes the specified PatchRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRouterRequest.verify|verify} messages. + * @param message PatchRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRouterRequest.verify|verify} messages. + * @param message PatchRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRouterRequest; + + /** + * Decodes a PatchRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRouterRequest; + + /** + * Verifies a PatchRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRouterRequest; + + /** + * Creates a plain object from a PatchRouterRequest message. Also converts values to other types if specified. + * @param message PatchRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PreviewRouterRequest. */ + interface IPreviewRouterRequest { + + /** PreviewRouterRequest project */ + project?: (string|null); + + /** PreviewRouterRequest region */ + region?: (string|null); + + /** PreviewRouterRequest router */ + router?: (string|null); + + /** PreviewRouterRequest routerResource */ + routerResource?: (google.cloud.compute.v1.IRouter|null); + } + + /** Represents a PreviewRouterRequest. */ + class PreviewRouterRequest implements IPreviewRouterRequest { + + /** + * Constructs a new PreviewRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPreviewRouterRequest); + + /** PreviewRouterRequest project. */ + public project: string; + + /** PreviewRouterRequest region. */ + public region: string; + + /** PreviewRouterRequest router. */ + public router: string; + + /** PreviewRouterRequest routerResource. */ + public routerResource?: (google.cloud.compute.v1.IRouter|null); + + /** + * Creates a new PreviewRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPreviewRouterRequest): google.cloud.compute.v1.PreviewRouterRequest; + + /** + * Encodes the specified PreviewRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.PreviewRouterRequest.verify|verify} messages. + * @param message PreviewRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPreviewRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreviewRouterRequest.verify|verify} messages. + * @param message PreviewRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPreviewRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PreviewRouterRequest; + + /** + * Decodes a PreviewRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PreviewRouterRequest; + + /** + * Verifies a PreviewRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PreviewRouterRequest; + + /** + * Creates a plain object from a PreviewRouterRequest message. Also converts values to other types if specified. + * @param message PreviewRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PreviewRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateRouterRequest. */ + interface IUpdateRouterRequest { + + /** UpdateRouterRequest project */ + project?: (string|null); + + /** UpdateRouterRequest region */ + region?: (string|null); + + /** UpdateRouterRequest requestId */ + requestId?: (string|null); + + /** UpdateRouterRequest router */ + router?: (string|null); + + /** UpdateRouterRequest routerResource */ + routerResource?: (google.cloud.compute.v1.IRouter|null); + } + + /** Represents an UpdateRouterRequest. */ + class UpdateRouterRequest implements IUpdateRouterRequest { + + /** + * Constructs a new UpdateRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateRouterRequest); + + /** UpdateRouterRequest project. */ + public project: string; + + /** UpdateRouterRequest region. */ + public region: string; + + /** UpdateRouterRequest requestId. */ + public requestId?: (string|null); + + /** UpdateRouterRequest router. */ + public router: string; + + /** UpdateRouterRequest routerResource. */ + public routerResource?: (google.cloud.compute.v1.IRouter|null); + + /** UpdateRouterRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateRouterRequest): google.cloud.compute.v1.UpdateRouterRequest; + + /** + * Encodes the specified UpdateRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRouterRequest.verify|verify} messages. + * @param message UpdateRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRouterRequest.verify|verify} messages. + * @param message UpdateRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateRouterRequest; + + /** + * Decodes an UpdateRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateRouterRequest; + + /** + * Verifies an UpdateRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateRouterRequest; + + /** + * Creates a plain object from an UpdateRouterRequest message. Also converts values to other types if specified. + * @param message UpdateRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteRouteRequest. */ + interface IDeleteRouteRequest { + + /** DeleteRouteRequest project */ + project?: (string|null); + + /** DeleteRouteRequest requestId */ + requestId?: (string|null); + + /** DeleteRouteRequest route */ + route?: (string|null); + } + + /** Represents a DeleteRouteRequest. */ + class DeleteRouteRequest implements IDeleteRouteRequest { + + /** + * Constructs a new DeleteRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRouteRequest); + + /** DeleteRouteRequest project. */ + public project: string; + + /** DeleteRouteRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRouteRequest route. */ + public route: string; + + /** DeleteRouteRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRouteRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRouteRequest): google.cloud.compute.v1.DeleteRouteRequest; + + /** + * Encodes the specified DeleteRouteRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRouteRequest.verify|verify} messages. + * @param message DeleteRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRouteRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRouteRequest.verify|verify} messages. + * @param message DeleteRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRouteRequest; + + /** + * Decodes a DeleteRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRouteRequest; + + /** + * Verifies a DeleteRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRouteRequest; + + /** + * Creates a plain object from a DeleteRouteRequest message. Also converts values to other types if specified. + * @param message DeleteRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRouteRequest. */ + interface IGetRouteRequest { + + /** GetRouteRequest project */ + project?: (string|null); + + /** GetRouteRequest route */ + route?: (string|null); + } + + /** Represents a GetRouteRequest. */ + class GetRouteRequest implements IGetRouteRequest { + + /** + * Constructs a new GetRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRouteRequest); + + /** GetRouteRequest project. */ + public project: string; + + /** GetRouteRequest route. */ + public route: string; + + /** + * Creates a new GetRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRouteRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRouteRequest): google.cloud.compute.v1.GetRouteRequest; + + /** + * Encodes the specified GetRouteRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRouteRequest.verify|verify} messages. + * @param message GetRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRouteRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRouteRequest.verify|verify} messages. + * @param message GetRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRouteRequest; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRouteRequest; + + /** + * Verifies a GetRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRouteRequest; + + /** + * Creates a plain object from a GetRouteRequest message. Also converts values to other types if specified. + * @param message GetRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertRouteRequest. */ + interface IInsertRouteRequest { + + /** InsertRouteRequest project */ + project?: (string|null); + + /** InsertRouteRequest requestId */ + requestId?: (string|null); + + /** InsertRouteRequest routeResource */ + routeResource?: (google.cloud.compute.v1.IRoute|null); + } + + /** Represents an InsertRouteRequest. */ + class InsertRouteRequest implements IInsertRouteRequest { + + /** + * Constructs a new InsertRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertRouteRequest); + + /** InsertRouteRequest project. */ + public project: string; + + /** InsertRouteRequest requestId. */ + public requestId?: (string|null); + + /** InsertRouteRequest routeResource. */ + public routeResource?: (google.cloud.compute.v1.IRoute|null); + + /** InsertRouteRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertRouteRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertRouteRequest): google.cloud.compute.v1.InsertRouteRequest; + + /** + * Encodes the specified InsertRouteRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRouteRequest.verify|verify} messages. + * @param message InsertRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertRouteRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRouteRequest.verify|verify} messages. + * @param message InsertRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertRouteRequest; + + /** + * Decodes an InsertRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertRouteRequest; + + /** + * Verifies an InsertRouteRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertRouteRequest; + + /** + * Creates a plain object from an InsertRouteRequest message. Also converts values to other types if specified. + * @param message InsertRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListRoutesRequest. */ + interface IListRoutesRequest { + + /** ListRoutesRequest filter */ + filter?: (string|null); + + /** ListRoutesRequest maxResults */ + maxResults?: (number|null); + + /** ListRoutesRequest orderBy */ + orderBy?: (string|null); + + /** ListRoutesRequest pageToken */ + pageToken?: (string|null); + + /** ListRoutesRequest project */ + project?: (string|null); + + /** ListRoutesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListRoutesRequest. */ + class ListRoutesRequest implements IListRoutesRequest { + + /** + * Constructs a new ListRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRoutesRequest); + + /** ListRoutesRequest filter. */ + public filter?: (string|null); + + /** ListRoutesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRoutesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRoutesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRoutesRequest project. */ + public project: string; + + /** ListRoutesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRoutesRequest _filter. */ + public _filter?: "filter"; + + /** ListRoutesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRoutesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRoutesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRoutesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRoutesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRoutesRequest): google.cloud.compute.v1.ListRoutesRequest; + + /** + * Encodes the specified ListRoutesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRoutesRequest.verify|verify} messages. + * @param message ListRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRoutesRequest.verify|verify} messages. + * @param message ListRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRoutesRequest; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRoutesRequest; + + /** + * Verifies a ListRoutesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRoutesRequest; + + /** + * Creates a plain object from a ListRoutesRequest message. Also converts values to other types if specified. + * @param message ListRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddRuleSecurityPolicyRequest. */ + interface IAddRuleSecurityPolicyRequest { + + /** AddRuleSecurityPolicyRequest project */ + project?: (string|null); + + /** AddRuleSecurityPolicyRequest securityPolicy */ + securityPolicy?: (string|null); + + /** AddRuleSecurityPolicyRequest securityPolicyRuleResource */ + securityPolicyRuleResource?: (google.cloud.compute.v1.ISecurityPolicyRule|null); + } + + /** Represents an AddRuleSecurityPolicyRequest. */ + class AddRuleSecurityPolicyRequest implements IAddRuleSecurityPolicyRequest { + + /** + * Constructs a new AddRuleSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddRuleSecurityPolicyRequest); + + /** AddRuleSecurityPolicyRequest project. */ + public project: string; + + /** AddRuleSecurityPolicyRequest securityPolicy. */ + public securityPolicy: string; + + /** AddRuleSecurityPolicyRequest securityPolicyRuleResource. */ + public securityPolicyRuleResource?: (google.cloud.compute.v1.ISecurityPolicyRule|null); + + /** + * Creates a new AddRuleSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddRuleSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddRuleSecurityPolicyRequest): google.cloud.compute.v1.AddRuleSecurityPolicyRequest; + + /** + * Encodes the specified AddRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.AddRuleSecurityPolicyRequest.verify|verify} messages. + * @param message AddRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddRuleSecurityPolicyRequest.verify|verify} messages. + * @param message AddRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddRuleSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddRuleSecurityPolicyRequest; + + /** + * Decodes an AddRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddRuleSecurityPolicyRequest; + + /** + * Verifies an AddRuleSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddRuleSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddRuleSecurityPolicyRequest; + + /** + * Creates a plain object from an AddRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message AddRuleSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddRuleSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddRuleSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSecurityPolicyRequest. */ + interface IDeleteSecurityPolicyRequest { + + /** DeleteSecurityPolicyRequest project */ + project?: (string|null); + + /** DeleteSecurityPolicyRequest requestId */ + requestId?: (string|null); + + /** DeleteSecurityPolicyRequest securityPolicy */ + securityPolicy?: (string|null); + } + + /** Represents a DeleteSecurityPolicyRequest. */ + class DeleteSecurityPolicyRequest implements IDeleteSecurityPolicyRequest { + + /** + * Constructs a new DeleteSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteSecurityPolicyRequest); + + /** DeleteSecurityPolicyRequest project. */ + public project: string; + + /** DeleteSecurityPolicyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteSecurityPolicyRequest securityPolicy. */ + public securityPolicy: string; + + /** DeleteSecurityPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteSecurityPolicyRequest): google.cloud.compute.v1.DeleteSecurityPolicyRequest; + + /** + * Encodes the specified DeleteSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSecurityPolicyRequest.verify|verify} messages. + * @param message DeleteSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSecurityPolicyRequest.verify|verify} messages. + * @param message DeleteSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteSecurityPolicyRequest; + + /** + * Decodes a DeleteSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteSecurityPolicyRequest; + + /** + * Verifies a DeleteSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteSecurityPolicyRequest; + + /** + * Creates a plain object from a DeleteSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSecurityPolicyRequest. */ + interface IGetSecurityPolicyRequest { + + /** GetSecurityPolicyRequest project */ + project?: (string|null); + + /** GetSecurityPolicyRequest securityPolicy */ + securityPolicy?: (string|null); + } + + /** Represents a GetSecurityPolicyRequest. */ + class GetSecurityPolicyRequest implements IGetSecurityPolicyRequest { + + /** + * Constructs a new GetSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetSecurityPolicyRequest); + + /** GetSecurityPolicyRequest project. */ + public project: string; + + /** GetSecurityPolicyRequest securityPolicy. */ + public securityPolicy: string; + + /** + * Creates a new GetSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetSecurityPolicyRequest): google.cloud.compute.v1.GetSecurityPolicyRequest; + + /** + * Encodes the specified GetSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSecurityPolicyRequest.verify|verify} messages. + * @param message GetSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSecurityPolicyRequest.verify|verify} messages. + * @param message GetSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetSecurityPolicyRequest; + + /** + * Decodes a GetSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetSecurityPolicyRequest; + + /** + * Verifies a GetSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetSecurityPolicyRequest; + + /** + * Creates a plain object from a GetSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message GetSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetRuleSecurityPolicyRequest. */ + interface IGetRuleSecurityPolicyRequest { + + /** GetRuleSecurityPolicyRequest priority */ + priority?: (number|null); + + /** GetRuleSecurityPolicyRequest project */ + project?: (string|null); + + /** GetRuleSecurityPolicyRequest securityPolicy */ + securityPolicy?: (string|null); + } + + /** Represents a GetRuleSecurityPolicyRequest. */ + class GetRuleSecurityPolicyRequest implements IGetRuleSecurityPolicyRequest { + + /** + * Constructs a new GetRuleSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRuleSecurityPolicyRequest); + + /** GetRuleSecurityPolicyRequest priority. */ + public priority?: (number|null); + + /** GetRuleSecurityPolicyRequest project. */ + public project: string; + + /** GetRuleSecurityPolicyRequest securityPolicy. */ + public securityPolicy: string; + + /** GetRuleSecurityPolicyRequest _priority. */ + public _priority?: "priority"; + + /** + * Creates a new GetRuleSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRuleSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRuleSecurityPolicyRequest): google.cloud.compute.v1.GetRuleSecurityPolicyRequest; + + /** + * Encodes the specified GetRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRuleSecurityPolicyRequest.verify|verify} messages. + * @param message GetRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRuleSecurityPolicyRequest.verify|verify} messages. + * @param message GetRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRuleSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRuleSecurityPolicyRequest; + + /** + * Decodes a GetRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRuleSecurityPolicyRequest; + + /** + * Verifies a GetRuleSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRuleSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRuleSecurityPolicyRequest; + + /** + * Creates a plain object from a GetRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message GetRuleSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRuleSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRuleSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertSecurityPolicyRequest. */ + interface IInsertSecurityPolicyRequest { + + /** InsertSecurityPolicyRequest project */ + project?: (string|null); + + /** InsertSecurityPolicyRequest requestId */ + requestId?: (string|null); + + /** InsertSecurityPolicyRequest securityPolicyResource */ + securityPolicyResource?: (google.cloud.compute.v1.ISecurityPolicy|null); + } + + /** Represents an InsertSecurityPolicyRequest. */ + class InsertSecurityPolicyRequest implements IInsertSecurityPolicyRequest { + + /** + * Constructs a new InsertSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertSecurityPolicyRequest); + + /** InsertSecurityPolicyRequest project. */ + public project: string; + + /** InsertSecurityPolicyRequest requestId. */ + public requestId?: (string|null); + + /** InsertSecurityPolicyRequest securityPolicyResource. */ + public securityPolicyResource?: (google.cloud.compute.v1.ISecurityPolicy|null); + + /** InsertSecurityPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertSecurityPolicyRequest): google.cloud.compute.v1.InsertSecurityPolicyRequest; + + /** + * Encodes the specified InsertSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSecurityPolicyRequest.verify|verify} messages. + * @param message InsertSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSecurityPolicyRequest.verify|verify} messages. + * @param message InsertSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertSecurityPolicyRequest; + + /** + * Decodes an InsertSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertSecurityPolicyRequest; + + /** + * Verifies an InsertSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertSecurityPolicyRequest; + + /** + * Creates a plain object from an InsertSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message InsertSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSecurityPoliciesRequest. */ + interface IListSecurityPoliciesRequest { + + /** ListSecurityPoliciesRequest filter */ + filter?: (string|null); + + /** ListSecurityPoliciesRequest maxResults */ + maxResults?: (number|null); + + /** ListSecurityPoliciesRequest orderBy */ + orderBy?: (string|null); + + /** ListSecurityPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListSecurityPoliciesRequest project */ + project?: (string|null); + + /** ListSecurityPoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListSecurityPoliciesRequest. */ + class ListSecurityPoliciesRequest implements IListSecurityPoliciesRequest { + + /** + * Constructs a new ListSecurityPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListSecurityPoliciesRequest); + + /** ListSecurityPoliciesRequest filter. */ + public filter?: (string|null); + + /** ListSecurityPoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListSecurityPoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListSecurityPoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListSecurityPoliciesRequest project. */ + public project: string; + + /** ListSecurityPoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListSecurityPoliciesRequest _filter. */ + public _filter?: "filter"; + + /** ListSecurityPoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListSecurityPoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListSecurityPoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListSecurityPoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListSecurityPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSecurityPoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListSecurityPoliciesRequest): google.cloud.compute.v1.ListSecurityPoliciesRequest; + + /** + * Encodes the specified ListSecurityPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSecurityPoliciesRequest.verify|verify} messages. + * @param message ListSecurityPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListSecurityPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSecurityPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSecurityPoliciesRequest.verify|verify} messages. + * @param message ListSecurityPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListSecurityPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSecurityPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListSecurityPoliciesRequest; + + /** + * Decodes a ListSecurityPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListSecurityPoliciesRequest; + + /** + * Verifies a ListSecurityPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSecurityPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSecurityPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListSecurityPoliciesRequest; + + /** + * Creates a plain object from a ListSecurityPoliciesRequest message. Also converts values to other types if specified. + * @param message ListSecurityPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListSecurityPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSecurityPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListPreconfiguredExpressionSetsSecurityPoliciesRequest. */ + interface IListPreconfiguredExpressionSetsSecurityPoliciesRequest { + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest filter */ + filter?: (string|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest maxResults */ + maxResults?: (number|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest orderBy */ + orderBy?: (string|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest project */ + project?: (string|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListPreconfiguredExpressionSetsSecurityPoliciesRequest. */ + class ListPreconfiguredExpressionSetsSecurityPoliciesRequest implements IListPreconfiguredExpressionSetsSecurityPoliciesRequest { + + /** + * Constructs a new ListPreconfiguredExpressionSetsSecurityPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest filter. */ + public filter?: (string|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest project. */ + public project: string; + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest _filter. */ + public _filter?: "filter"; + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListPreconfiguredExpressionSetsSecurityPoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListPreconfiguredExpressionSetsSecurityPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPreconfiguredExpressionSetsSecurityPoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest): google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest; + + /** + * Encodes the specified ListPreconfiguredExpressionSetsSecurityPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest.verify|verify} messages. + * @param message ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPreconfiguredExpressionSetsSecurityPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest.verify|verify} messages. + * @param message ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest; + + /** + * Decodes a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest; + + /** + * Verifies a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPreconfiguredExpressionSetsSecurityPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest; + + /** + * Creates a plain object from a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message. Also converts values to other types if specified. + * @param message ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPreconfiguredExpressionSetsSecurityPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchSecurityPolicyRequest. */ + interface IPatchSecurityPolicyRequest { + + /** PatchSecurityPolicyRequest project */ + project?: (string|null); + + /** PatchSecurityPolicyRequest requestId */ + requestId?: (string|null); + + /** PatchSecurityPolicyRequest securityPolicy */ + securityPolicy?: (string|null); + + /** PatchSecurityPolicyRequest securityPolicyResource */ + securityPolicyResource?: (google.cloud.compute.v1.ISecurityPolicy|null); + } + + /** Represents a PatchSecurityPolicyRequest. */ + class PatchSecurityPolicyRequest implements IPatchSecurityPolicyRequest { + + /** + * Constructs a new PatchSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchSecurityPolicyRequest); + + /** PatchSecurityPolicyRequest project. */ + public project: string; + + /** PatchSecurityPolicyRequest requestId. */ + public requestId?: (string|null); + + /** PatchSecurityPolicyRequest securityPolicy. */ + public securityPolicy: string; + + /** PatchSecurityPolicyRequest securityPolicyResource. */ + public securityPolicyResource?: (google.cloud.compute.v1.ISecurityPolicy|null); + + /** PatchSecurityPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchSecurityPolicyRequest): google.cloud.compute.v1.PatchSecurityPolicyRequest; + + /** + * Encodes the specified PatchSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchSecurityPolicyRequest.verify|verify} messages. + * @param message PatchSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchSecurityPolicyRequest.verify|verify} messages. + * @param message PatchSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchSecurityPolicyRequest; + + /** + * Decodes a PatchSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchSecurityPolicyRequest; + + /** + * Verifies a PatchSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchSecurityPolicyRequest; + + /** + * Creates a plain object from a PatchSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message PatchSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchRuleSecurityPolicyRequest. */ + interface IPatchRuleSecurityPolicyRequest { + + /** PatchRuleSecurityPolicyRequest priority */ + priority?: (number|null); + + /** PatchRuleSecurityPolicyRequest project */ + project?: (string|null); + + /** PatchRuleSecurityPolicyRequest securityPolicy */ + securityPolicy?: (string|null); + + /** PatchRuleSecurityPolicyRequest securityPolicyRuleResource */ + securityPolicyRuleResource?: (google.cloud.compute.v1.ISecurityPolicyRule|null); + } + + /** Represents a PatchRuleSecurityPolicyRequest. */ + class PatchRuleSecurityPolicyRequest implements IPatchRuleSecurityPolicyRequest { + + /** + * Constructs a new PatchRuleSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest); + + /** PatchRuleSecurityPolicyRequest priority. */ + public priority?: (number|null); + + /** PatchRuleSecurityPolicyRequest project. */ + public project: string; + + /** PatchRuleSecurityPolicyRequest securityPolicy. */ + public securityPolicy: string; + + /** PatchRuleSecurityPolicyRequest securityPolicyRuleResource. */ + public securityPolicyRuleResource?: (google.cloud.compute.v1.ISecurityPolicyRule|null); + + /** PatchRuleSecurityPolicyRequest _priority. */ + public _priority?: "priority"; + + /** + * Creates a new PatchRuleSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRuleSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest): google.cloud.compute.v1.PatchRuleSecurityPolicyRequest; + + /** + * Encodes the specified PatchRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRuleSecurityPolicyRequest.verify|verify} messages. + * @param message PatchRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRuleSecurityPolicyRequest.verify|verify} messages. + * @param message PatchRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRuleSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRuleSecurityPolicyRequest; + + /** + * Decodes a PatchRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRuleSecurityPolicyRequest; + + /** + * Verifies a PatchRuleSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRuleSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRuleSecurityPolicyRequest; + + /** + * Creates a plain object from a PatchRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message PatchRuleSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRuleSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRuleSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveRuleSecurityPolicyRequest. */ + interface IRemoveRuleSecurityPolicyRequest { + + /** RemoveRuleSecurityPolicyRequest priority */ + priority?: (number|null); + + /** RemoveRuleSecurityPolicyRequest project */ + project?: (string|null); + + /** RemoveRuleSecurityPolicyRequest securityPolicy */ + securityPolicy?: (string|null); + } + + /** Represents a RemoveRuleSecurityPolicyRequest. */ + class RemoveRuleSecurityPolicyRequest implements IRemoveRuleSecurityPolicyRequest { + + /** + * Constructs a new RemoveRuleSecurityPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest); + + /** RemoveRuleSecurityPolicyRequest priority. */ + public priority?: (number|null); + + /** RemoveRuleSecurityPolicyRequest project. */ + public project: string; + + /** RemoveRuleSecurityPolicyRequest securityPolicy. */ + public securityPolicy: string; + + /** RemoveRuleSecurityPolicyRequest _priority. */ + public _priority?: "priority"; + + /** + * Creates a new RemoveRuleSecurityPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveRuleSecurityPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest): google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest; + + /** + * Encodes the specified RemoveRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest.verify|verify} messages. + * @param message RemoveRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest.verify|verify} messages. + * @param message RemoveRuleSecurityPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveRuleSecurityPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest; + + /** + * Decodes a RemoveRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest; + + /** + * Verifies a RemoveRuleSecurityPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveRuleSecurityPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest; + + /** + * Creates a plain object from a RemoveRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @param message RemoveRuleSecurityPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveRuleSecurityPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { + + /** DeleteSnapshotRequest project */ + project?: (string|null); + + /** DeleteSnapshotRequest requestId */ + requestId?: (string|null); + + /** DeleteSnapshotRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + + /** + * Constructs a new DeleteSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteSnapshotRequest); + + /** DeleteSnapshotRequest project. */ + public project: string; + + /** DeleteSnapshotRequest requestId. */ + public requestId?: (string|null); + + /** DeleteSnapshotRequest snapshot. */ + public snapshot: string; + + /** DeleteSnapshotRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteSnapshotRequest): google.cloud.compute.v1.DeleteSnapshotRequest; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteSnapshotRequest; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteSnapshotRequest; + + /** + * Verifies a DeleteSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteSnapshotRequest; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { + + /** GetSnapshotRequest project */ + project?: (string|null); + + /** GetSnapshotRequest snapshot */ + snapshot?: (string|null); + } + + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { + + /** + * Constructs a new GetSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetSnapshotRequest); + + /** GetSnapshotRequest project. */ + public project: string; + + /** GetSnapshotRequest snapshot. */ + public snapshot: string; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSnapshotRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetSnapshotRequest): google.cloud.compute.v1.GetSnapshotRequest; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetSnapshotRequest; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetSnapshotRequest; + + /** + * Verifies a GetSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetSnapshotRequest; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicySnapshotRequest. */ + interface IGetIamPolicySnapshotRequest { + + /** GetIamPolicySnapshotRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicySnapshotRequest project */ + project?: (string|null); + + /** GetIamPolicySnapshotRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicySnapshotRequest. */ + class GetIamPolicySnapshotRequest implements IGetIamPolicySnapshotRequest { + + /** + * Constructs a new GetIamPolicySnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicySnapshotRequest); + + /** GetIamPolicySnapshotRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicySnapshotRequest project. */ + public project: string; + + /** GetIamPolicySnapshotRequest resource. */ + public resource: string; + + /** GetIamPolicySnapshotRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicySnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicySnapshotRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicySnapshotRequest): google.cloud.compute.v1.GetIamPolicySnapshotRequest; + + /** + * Encodes the specified GetIamPolicySnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySnapshotRequest.verify|verify} messages. + * @param message GetIamPolicySnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicySnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicySnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySnapshotRequest.verify|verify} messages. + * @param message GetIamPolicySnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicySnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicySnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicySnapshotRequest; + + /** + * Decodes a GetIamPolicySnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicySnapshotRequest; + + /** + * Verifies a GetIamPolicySnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicySnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicySnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicySnapshotRequest; + + /** + * Creates a plain object from a GetIamPolicySnapshotRequest message. Also converts values to other types if specified. + * @param message GetIamPolicySnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicySnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicySnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { + + /** ListSnapshotsRequest filter */ + filter?: (string|null); + + /** ListSnapshotsRequest maxResults */ + maxResults?: (number|null); + + /** ListSnapshotsRequest orderBy */ + orderBy?: (string|null); + + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); + + /** ListSnapshotsRequest project */ + project?: (string|null); + + /** ListSnapshotsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { + + /** + * Constructs a new ListSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListSnapshotsRequest); + + /** ListSnapshotsRequest filter. */ + public filter?: (string|null); + + /** ListSnapshotsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListSnapshotsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListSnapshotsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListSnapshotsRequest project. */ + public project: string; + + /** ListSnapshotsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListSnapshotsRequest _filter. */ + public _filter?: "filter"; + + /** ListSnapshotsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListSnapshotsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListSnapshotsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListSnapshotsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListSnapshotsRequest): google.cloud.compute.v1.ListSnapshotsRequest; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListSnapshotsRequest; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListSnapshotsRequest; + + /** + * Verifies a ListSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListSnapshotsRequest; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicySnapshotRequest. */ + interface ISetIamPolicySnapshotRequest { + + /** SetIamPolicySnapshotRequest globalSetPolicyRequestResource */ + globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicySnapshotRequest project */ + project?: (string|null); + + /** SetIamPolicySnapshotRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicySnapshotRequest. */ + class SetIamPolicySnapshotRequest implements ISetIamPolicySnapshotRequest { + + /** + * Constructs a new SetIamPolicySnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicySnapshotRequest); + + /** SetIamPolicySnapshotRequest globalSetPolicyRequestResource. */ + public globalSetPolicyRequestResource?: (google.cloud.compute.v1.IGlobalSetPolicyRequest|null); + + /** SetIamPolicySnapshotRequest project. */ + public project: string; + + /** SetIamPolicySnapshotRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicySnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicySnapshotRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicySnapshotRequest): google.cloud.compute.v1.SetIamPolicySnapshotRequest; + + /** + * Encodes the specified SetIamPolicySnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySnapshotRequest.verify|verify} messages. + * @param message SetIamPolicySnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicySnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicySnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySnapshotRequest.verify|verify} messages. + * @param message SetIamPolicySnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicySnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicySnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicySnapshotRequest; + + /** + * Decodes a SetIamPolicySnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicySnapshotRequest; + + /** + * Verifies a SetIamPolicySnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicySnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicySnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicySnapshotRequest; + + /** + * Creates a plain object from a SetIamPolicySnapshotRequest message. Also converts values to other types if specified. + * @param message SetIamPolicySnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicySnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicySnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsSnapshotRequest. */ + interface ISetLabelsSnapshotRequest { + + /** SetLabelsSnapshotRequest globalSetLabelsRequestResource */ + globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsSnapshotRequest project */ + project?: (string|null); + + /** SetLabelsSnapshotRequest resource */ + resource?: (string|null); + } + + /** Represents a SetLabelsSnapshotRequest. */ + class SetLabelsSnapshotRequest implements ISetLabelsSnapshotRequest { + + /** + * Constructs a new SetLabelsSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsSnapshotRequest); + + /** SetLabelsSnapshotRequest globalSetLabelsRequestResource. */ + public globalSetLabelsRequestResource?: (google.cloud.compute.v1.IGlobalSetLabelsRequest|null); + + /** SetLabelsSnapshotRequest project. */ + public project: string; + + /** SetLabelsSnapshotRequest resource. */ + public resource: string; + + /** + * Creates a new SetLabelsSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsSnapshotRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsSnapshotRequest): google.cloud.compute.v1.SetLabelsSnapshotRequest; + + /** + * Encodes the specified SetLabelsSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsSnapshotRequest.verify|verify} messages. + * @param message SetLabelsSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsSnapshotRequest.verify|verify} messages. + * @param message SetLabelsSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsSnapshotRequest; + + /** + * Decodes a SetLabelsSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsSnapshotRequest; + + /** + * Verifies a SetLabelsSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsSnapshotRequest; + + /** + * Creates a plain object from a SetLabelsSnapshotRequest message. Also converts values to other types if specified. + * @param message SetLabelsSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsSnapshotRequest. */ + interface ITestIamPermissionsSnapshotRequest { + + /** TestIamPermissionsSnapshotRequest project */ + project?: (string|null); + + /** TestIamPermissionsSnapshotRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsSnapshotRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsSnapshotRequest. */ + class TestIamPermissionsSnapshotRequest implements ITestIamPermissionsSnapshotRequest { + + /** + * Constructs a new TestIamPermissionsSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest); + + /** TestIamPermissionsSnapshotRequest project. */ + public project: string; + + /** TestIamPermissionsSnapshotRequest resource. */ + public resource: string; + + /** TestIamPermissionsSnapshotRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsSnapshotRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest): google.cloud.compute.v1.TestIamPermissionsSnapshotRequest; + + /** + * Encodes the specified TestIamPermissionsSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSnapshotRequest.verify|verify} messages. + * @param message TestIamPermissionsSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSnapshotRequest.verify|verify} messages. + * @param message TestIamPermissionsSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsSnapshotRequest; + + /** + * Decodes a TestIamPermissionsSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsSnapshotRequest; + + /** + * Verifies a TestIamPermissionsSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsSnapshotRequest; + + /** + * Creates a plain object from a TestIamPermissionsSnapshotRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListSslCertificatesRequest. */ + interface IAggregatedListSslCertificatesRequest { + + /** AggregatedListSslCertificatesRequest filter */ + filter?: (string|null); + + /** AggregatedListSslCertificatesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListSslCertificatesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListSslCertificatesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListSslCertificatesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListSslCertificatesRequest project */ + project?: (string|null); + + /** AggregatedListSslCertificatesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListSslCertificatesRequest. */ + class AggregatedListSslCertificatesRequest implements IAggregatedListSslCertificatesRequest { + + /** + * Constructs a new AggregatedListSslCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListSslCertificatesRequest); + + /** AggregatedListSslCertificatesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListSslCertificatesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListSslCertificatesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListSslCertificatesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListSslCertificatesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListSslCertificatesRequest project. */ + public project: string; + + /** AggregatedListSslCertificatesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListSslCertificatesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListSslCertificatesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListSslCertificatesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListSslCertificatesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListSslCertificatesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListSslCertificatesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListSslCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListSslCertificatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListSslCertificatesRequest): google.cloud.compute.v1.AggregatedListSslCertificatesRequest; + + /** + * Encodes the specified AggregatedListSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSslCertificatesRequest.verify|verify} messages. + * @param message AggregatedListSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSslCertificatesRequest.verify|verify} messages. + * @param message AggregatedListSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListSslCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListSslCertificatesRequest; + + /** + * Decodes an AggregatedListSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListSslCertificatesRequest; + + /** + * Verifies an AggregatedListSslCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListSslCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListSslCertificatesRequest; + + /** + * Creates a plain object from an AggregatedListSslCertificatesRequest message. Also converts values to other types if specified. + * @param message AggregatedListSslCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListSslCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListSslCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSslCertificateRequest. */ + interface IDeleteSslCertificateRequest { + + /** DeleteSslCertificateRequest project */ + project?: (string|null); + + /** DeleteSslCertificateRequest requestId */ + requestId?: (string|null); + + /** DeleteSslCertificateRequest sslCertificate */ + sslCertificate?: (string|null); + } + + /** Represents a DeleteSslCertificateRequest. */ + class DeleteSslCertificateRequest implements IDeleteSslCertificateRequest { + + /** + * Constructs a new DeleteSslCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteSslCertificateRequest); + + /** DeleteSslCertificateRequest project. */ + public project: string; + + /** DeleteSslCertificateRequest requestId. */ + public requestId?: (string|null); + + /** DeleteSslCertificateRequest sslCertificate. */ + public sslCertificate: string; + + /** DeleteSslCertificateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteSslCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSslCertificateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteSslCertificateRequest): google.cloud.compute.v1.DeleteSslCertificateRequest; + + /** + * Encodes the specified DeleteSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSslCertificateRequest.verify|verify} messages. + * @param message DeleteSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSslCertificateRequest.verify|verify} messages. + * @param message DeleteSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSslCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteSslCertificateRequest; + + /** + * Decodes a DeleteSslCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteSslCertificateRequest; + + /** + * Verifies a DeleteSslCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSslCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteSslCertificateRequest; + + /** + * Creates a plain object from a DeleteSslCertificateRequest message. Also converts values to other types if specified. + * @param message DeleteSslCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteSslCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSslCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSslCertificateRequest. */ + interface IGetSslCertificateRequest { + + /** GetSslCertificateRequest project */ + project?: (string|null); + + /** GetSslCertificateRequest sslCertificate */ + sslCertificate?: (string|null); + } + + /** Represents a GetSslCertificateRequest. */ + class GetSslCertificateRequest implements IGetSslCertificateRequest { + + /** + * Constructs a new GetSslCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetSslCertificateRequest); + + /** GetSslCertificateRequest project. */ + public project: string; + + /** GetSslCertificateRequest sslCertificate. */ + public sslCertificate: string; + + /** + * Creates a new GetSslCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSslCertificateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetSslCertificateRequest): google.cloud.compute.v1.GetSslCertificateRequest; + + /** + * Encodes the specified GetSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSslCertificateRequest.verify|verify} messages. + * @param message GetSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSslCertificateRequest.verify|verify} messages. + * @param message GetSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSslCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetSslCertificateRequest; + + /** + * Decodes a GetSslCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetSslCertificateRequest; + + /** + * Verifies a GetSslCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSslCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetSslCertificateRequest; + + /** + * Creates a plain object from a GetSslCertificateRequest message. Also converts values to other types if specified. + * @param message GetSslCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetSslCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSslCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertSslCertificateRequest. */ + interface IInsertSslCertificateRequest { + + /** InsertSslCertificateRequest project */ + project?: (string|null); + + /** InsertSslCertificateRequest requestId */ + requestId?: (string|null); + + /** InsertSslCertificateRequest sslCertificateResource */ + sslCertificateResource?: (google.cloud.compute.v1.ISslCertificate|null); + } + + /** Represents an InsertSslCertificateRequest. */ + class InsertSslCertificateRequest implements IInsertSslCertificateRequest { + + /** + * Constructs a new InsertSslCertificateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertSslCertificateRequest); + + /** InsertSslCertificateRequest project. */ + public project: string; + + /** InsertSslCertificateRequest requestId. */ + public requestId?: (string|null); + + /** InsertSslCertificateRequest sslCertificateResource. */ + public sslCertificateResource?: (google.cloud.compute.v1.ISslCertificate|null); + + /** InsertSslCertificateRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertSslCertificateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertSslCertificateRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertSslCertificateRequest): google.cloud.compute.v1.InsertSslCertificateRequest; + + /** + * Encodes the specified InsertSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSslCertificateRequest.verify|verify} messages. + * @param message InsertSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSslCertificateRequest.verify|verify} messages. + * @param message InsertSslCertificateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertSslCertificateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertSslCertificateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertSslCertificateRequest; + + /** + * Decodes an InsertSslCertificateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertSslCertificateRequest; + + /** + * Verifies an InsertSslCertificateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertSslCertificateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertSslCertificateRequest; + + /** + * Creates a plain object from an InsertSslCertificateRequest message. Also converts values to other types if specified. + * @param message InsertSslCertificateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertSslCertificateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertSslCertificateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSslCertificatesRequest. */ + interface IListSslCertificatesRequest { + + /** ListSslCertificatesRequest filter */ + filter?: (string|null); + + /** ListSslCertificatesRequest maxResults */ + maxResults?: (number|null); + + /** ListSslCertificatesRequest orderBy */ + orderBy?: (string|null); + + /** ListSslCertificatesRequest pageToken */ + pageToken?: (string|null); + + /** ListSslCertificatesRequest project */ + project?: (string|null); + + /** ListSslCertificatesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListSslCertificatesRequest. */ + class ListSslCertificatesRequest implements IListSslCertificatesRequest { + + /** + * Constructs a new ListSslCertificatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListSslCertificatesRequest); + + /** ListSslCertificatesRequest filter. */ + public filter?: (string|null); + + /** ListSslCertificatesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListSslCertificatesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListSslCertificatesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListSslCertificatesRequest project. */ + public project: string; + + /** ListSslCertificatesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListSslCertificatesRequest _filter. */ + public _filter?: "filter"; + + /** ListSslCertificatesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListSslCertificatesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListSslCertificatesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListSslCertificatesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListSslCertificatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSslCertificatesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListSslCertificatesRequest): google.cloud.compute.v1.ListSslCertificatesRequest; + + /** + * Encodes the specified ListSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSslCertificatesRequest.verify|verify} messages. + * @param message ListSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSslCertificatesRequest.verify|verify} messages. + * @param message ListSslCertificatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListSslCertificatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSslCertificatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListSslCertificatesRequest; + + /** + * Decodes a ListSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListSslCertificatesRequest; + + /** + * Verifies a ListSslCertificatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSslCertificatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListSslCertificatesRequest; + + /** + * Creates a plain object from a ListSslCertificatesRequest message. Also converts values to other types if specified. + * @param message ListSslCertificatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListSslCertificatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSslCertificatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSslPolicyRequest. */ + interface IDeleteSslPolicyRequest { + + /** DeleteSslPolicyRequest project */ + project?: (string|null); + + /** DeleteSslPolicyRequest requestId */ + requestId?: (string|null); + + /** DeleteSslPolicyRequest sslPolicy */ + sslPolicy?: (string|null); + } + + /** Represents a DeleteSslPolicyRequest. */ + class DeleteSslPolicyRequest implements IDeleteSslPolicyRequest { + + /** + * Constructs a new DeleteSslPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteSslPolicyRequest); + + /** DeleteSslPolicyRequest project. */ + public project: string; + + /** DeleteSslPolicyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteSslPolicyRequest sslPolicy. */ + public sslPolicy: string; + + /** DeleteSslPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteSslPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSslPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteSslPolicyRequest): google.cloud.compute.v1.DeleteSslPolicyRequest; + + /** + * Encodes the specified DeleteSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSslPolicyRequest.verify|verify} messages. + * @param message DeleteSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSslPolicyRequest.verify|verify} messages. + * @param message DeleteSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSslPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteSslPolicyRequest; + + /** + * Decodes a DeleteSslPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteSslPolicyRequest; + + /** + * Verifies a DeleteSslPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSslPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteSslPolicyRequest; + + /** + * Creates a plain object from a DeleteSslPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteSslPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteSslPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSslPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSslPolicyRequest. */ + interface IGetSslPolicyRequest { + + /** GetSslPolicyRequest project */ + project?: (string|null); + + /** GetSslPolicyRequest sslPolicy */ + sslPolicy?: (string|null); + } + + /** Represents a GetSslPolicyRequest. */ + class GetSslPolicyRequest implements IGetSslPolicyRequest { + + /** + * Constructs a new GetSslPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetSslPolicyRequest); + + /** GetSslPolicyRequest project. */ + public project: string; + + /** GetSslPolicyRequest sslPolicy. */ + public sslPolicy: string; + + /** + * Creates a new GetSslPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSslPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetSslPolicyRequest): google.cloud.compute.v1.GetSslPolicyRequest; + + /** + * Encodes the specified GetSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSslPolicyRequest.verify|verify} messages. + * @param message GetSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSslPolicyRequest.verify|verify} messages. + * @param message GetSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSslPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetSslPolicyRequest; + + /** + * Decodes a GetSslPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetSslPolicyRequest; + + /** + * Verifies a GetSslPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSslPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetSslPolicyRequest; + + /** + * Creates a plain object from a GetSslPolicyRequest message. Also converts values to other types if specified. + * @param message GetSslPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetSslPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSslPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertSslPolicyRequest. */ + interface IInsertSslPolicyRequest { + + /** InsertSslPolicyRequest project */ + project?: (string|null); + + /** InsertSslPolicyRequest requestId */ + requestId?: (string|null); + + /** InsertSslPolicyRequest sslPolicyResource */ + sslPolicyResource?: (google.cloud.compute.v1.ISslPolicy|null); + } + + /** Represents an InsertSslPolicyRequest. */ + class InsertSslPolicyRequest implements IInsertSslPolicyRequest { + + /** + * Constructs a new InsertSslPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertSslPolicyRequest); + + /** InsertSslPolicyRequest project. */ + public project: string; + + /** InsertSslPolicyRequest requestId. */ + public requestId?: (string|null); + + /** InsertSslPolicyRequest sslPolicyResource. */ + public sslPolicyResource?: (google.cloud.compute.v1.ISslPolicy|null); + + /** InsertSslPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertSslPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertSslPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertSslPolicyRequest): google.cloud.compute.v1.InsertSslPolicyRequest; + + /** + * Encodes the specified InsertSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSslPolicyRequest.verify|verify} messages. + * @param message InsertSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSslPolicyRequest.verify|verify} messages. + * @param message InsertSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertSslPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertSslPolicyRequest; + + /** + * Decodes an InsertSslPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertSslPolicyRequest; + + /** + * Verifies an InsertSslPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertSslPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertSslPolicyRequest; + + /** + * Creates a plain object from an InsertSslPolicyRequest message. Also converts values to other types if specified. + * @param message InsertSslPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertSslPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertSslPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSslPoliciesRequest. */ + interface IListSslPoliciesRequest { + + /** ListSslPoliciesRequest filter */ + filter?: (string|null); + + /** ListSslPoliciesRequest maxResults */ + maxResults?: (number|null); + + /** ListSslPoliciesRequest orderBy */ + orderBy?: (string|null); + + /** ListSslPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListSslPoliciesRequest project */ + project?: (string|null); + + /** ListSslPoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListSslPoliciesRequest. */ + class ListSslPoliciesRequest implements IListSslPoliciesRequest { + + /** + * Constructs a new ListSslPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListSslPoliciesRequest); + + /** ListSslPoliciesRequest filter. */ + public filter?: (string|null); + + /** ListSslPoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListSslPoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListSslPoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListSslPoliciesRequest project. */ + public project: string; + + /** ListSslPoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListSslPoliciesRequest _filter. */ + public _filter?: "filter"; + + /** ListSslPoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListSslPoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListSslPoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListSslPoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListSslPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSslPoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListSslPoliciesRequest): google.cloud.compute.v1.ListSslPoliciesRequest; + + /** + * Encodes the specified ListSslPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSslPoliciesRequest.verify|verify} messages. + * @param message ListSslPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListSslPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSslPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSslPoliciesRequest.verify|verify} messages. + * @param message ListSslPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListSslPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSslPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListSslPoliciesRequest; + + /** + * Decodes a ListSslPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListSslPoliciesRequest; + + /** + * Verifies a ListSslPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSslPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSslPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListSslPoliciesRequest; + + /** + * Creates a plain object from a ListSslPoliciesRequest message. Also converts values to other types if specified. + * @param message ListSslPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListSslPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSslPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAvailableFeaturesSslPoliciesRequest. */ + interface IListAvailableFeaturesSslPoliciesRequest { + + /** ListAvailableFeaturesSslPoliciesRequest filter */ + filter?: (string|null); + + /** ListAvailableFeaturesSslPoliciesRequest maxResults */ + maxResults?: (number|null); + + /** ListAvailableFeaturesSslPoliciesRequest orderBy */ + orderBy?: (string|null); + + /** ListAvailableFeaturesSslPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListAvailableFeaturesSslPoliciesRequest project */ + project?: (string|null); + + /** ListAvailableFeaturesSslPoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListAvailableFeaturesSslPoliciesRequest. */ + class ListAvailableFeaturesSslPoliciesRequest implements IListAvailableFeaturesSslPoliciesRequest { + + /** + * Constructs a new ListAvailableFeaturesSslPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest); + + /** ListAvailableFeaturesSslPoliciesRequest filter. */ + public filter?: (string|null); + + /** ListAvailableFeaturesSslPoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListAvailableFeaturesSslPoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListAvailableFeaturesSslPoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListAvailableFeaturesSslPoliciesRequest project. */ + public project: string; + + /** ListAvailableFeaturesSslPoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListAvailableFeaturesSslPoliciesRequest _filter. */ + public _filter?: "filter"; + + /** ListAvailableFeaturesSslPoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListAvailableFeaturesSslPoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListAvailableFeaturesSslPoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListAvailableFeaturesSslPoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListAvailableFeaturesSslPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAvailableFeaturesSslPoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest): google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest; + + /** + * Encodes the specified ListAvailableFeaturesSslPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest.verify|verify} messages. + * @param message ListAvailableFeaturesSslPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAvailableFeaturesSslPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest.verify|verify} messages. + * @param message ListAvailableFeaturesSslPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAvailableFeaturesSslPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAvailableFeaturesSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest; + + /** + * Decodes a ListAvailableFeaturesSslPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAvailableFeaturesSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest; + + /** + * Verifies a ListAvailableFeaturesSslPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAvailableFeaturesSslPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAvailableFeaturesSslPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest; + + /** + * Creates a plain object from a ListAvailableFeaturesSslPoliciesRequest message. Also converts values to other types if specified. + * @param message ListAvailableFeaturesSslPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAvailableFeaturesSslPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchSslPolicyRequest. */ + interface IPatchSslPolicyRequest { + + /** PatchSslPolicyRequest project */ + project?: (string|null); + + /** PatchSslPolicyRequest requestId */ + requestId?: (string|null); + + /** PatchSslPolicyRequest sslPolicy */ + sslPolicy?: (string|null); + + /** PatchSslPolicyRequest sslPolicyResource */ + sslPolicyResource?: (google.cloud.compute.v1.ISslPolicy|null); + } + + /** Represents a PatchSslPolicyRequest. */ + class PatchSslPolicyRequest implements IPatchSslPolicyRequest { + + /** + * Constructs a new PatchSslPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchSslPolicyRequest); + + /** PatchSslPolicyRequest project. */ + public project: string; + + /** PatchSslPolicyRequest requestId. */ + public requestId?: (string|null); + + /** PatchSslPolicyRequest sslPolicy. */ + public sslPolicy: string; + + /** PatchSslPolicyRequest sslPolicyResource. */ + public sslPolicyResource?: (google.cloud.compute.v1.ISslPolicy|null); + + /** PatchSslPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchSslPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchSslPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchSslPolicyRequest): google.cloud.compute.v1.PatchSslPolicyRequest; + + /** + * Encodes the specified PatchSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchSslPolicyRequest.verify|verify} messages. + * @param message PatchSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchSslPolicyRequest.verify|verify} messages. + * @param message PatchSslPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchSslPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchSslPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchSslPolicyRequest; + + /** + * Decodes a PatchSslPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchSslPolicyRequest; + + /** + * Verifies a PatchSslPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchSslPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchSslPolicyRequest; + + /** + * Creates a plain object from a PatchSslPolicyRequest message. Also converts values to other types if specified. + * @param message PatchSslPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchSslPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchSslPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListSubnetworksRequest. */ + interface IAggregatedListSubnetworksRequest { + + /** AggregatedListSubnetworksRequest filter */ + filter?: (string|null); + + /** AggregatedListSubnetworksRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListSubnetworksRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListSubnetworksRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListSubnetworksRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListSubnetworksRequest project */ + project?: (string|null); + + /** AggregatedListSubnetworksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListSubnetworksRequest. */ + class AggregatedListSubnetworksRequest implements IAggregatedListSubnetworksRequest { + + /** + * Constructs a new AggregatedListSubnetworksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListSubnetworksRequest); + + /** AggregatedListSubnetworksRequest filter. */ + public filter?: (string|null); + + /** AggregatedListSubnetworksRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListSubnetworksRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListSubnetworksRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListSubnetworksRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListSubnetworksRequest project. */ + public project: string; + + /** AggregatedListSubnetworksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListSubnetworksRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListSubnetworksRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListSubnetworksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListSubnetworksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListSubnetworksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListSubnetworksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListSubnetworksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListSubnetworksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListSubnetworksRequest): google.cloud.compute.v1.AggregatedListSubnetworksRequest; + + /** + * Encodes the specified AggregatedListSubnetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSubnetworksRequest.verify|verify} messages. + * @param message AggregatedListSubnetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListSubnetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListSubnetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSubnetworksRequest.verify|verify} messages. + * @param message AggregatedListSubnetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListSubnetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListSubnetworksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListSubnetworksRequest; + + /** + * Decodes an AggregatedListSubnetworksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListSubnetworksRequest; + + /** + * Verifies an AggregatedListSubnetworksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListSubnetworksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListSubnetworksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListSubnetworksRequest; + + /** + * Creates a plain object from an AggregatedListSubnetworksRequest message. Also converts values to other types if specified. + * @param message AggregatedListSubnetworksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListSubnetworksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListSubnetworksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteSubnetworkRequest. */ + interface IDeleteSubnetworkRequest { + + /** DeleteSubnetworkRequest project */ + project?: (string|null); + + /** DeleteSubnetworkRequest region */ + region?: (string|null); + + /** DeleteSubnetworkRequest requestId */ + requestId?: (string|null); + + /** DeleteSubnetworkRequest subnetwork */ + subnetwork?: (string|null); + } + + /** Represents a DeleteSubnetworkRequest. */ + class DeleteSubnetworkRequest implements IDeleteSubnetworkRequest { + + /** + * Constructs a new DeleteSubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteSubnetworkRequest); + + /** DeleteSubnetworkRequest project. */ + public project: string; + + /** DeleteSubnetworkRequest region. */ + public region: string; + + /** DeleteSubnetworkRequest requestId. */ + public requestId?: (string|null); + + /** DeleteSubnetworkRequest subnetwork. */ + public subnetwork: string; + + /** DeleteSubnetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteSubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteSubnetworkRequest): google.cloud.compute.v1.DeleteSubnetworkRequest; + + /** + * Encodes the specified DeleteSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSubnetworkRequest.verify|verify} messages. + * @param message DeleteSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSubnetworkRequest.verify|verify} messages. + * @param message DeleteSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteSubnetworkRequest; + + /** + * Decodes a DeleteSubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteSubnetworkRequest; + + /** + * Verifies a DeleteSubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteSubnetworkRequest; + + /** + * Creates a plain object from a DeleteSubnetworkRequest message. Also converts values to other types if specified. + * @param message DeleteSubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteSubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExpandIpCidrRangeSubnetworkRequest. */ + interface IExpandIpCidrRangeSubnetworkRequest { + + /** ExpandIpCidrRangeSubnetworkRequest project */ + project?: (string|null); + + /** ExpandIpCidrRangeSubnetworkRequest region */ + region?: (string|null); + + /** ExpandIpCidrRangeSubnetworkRequest requestId */ + requestId?: (string|null); + + /** ExpandIpCidrRangeSubnetworkRequest subnetwork */ + subnetwork?: (string|null); + + /** ExpandIpCidrRangeSubnetworkRequest subnetworksExpandIpCidrRangeRequestResource */ + subnetworksExpandIpCidrRangeRequestResource?: (google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest|null); + } + + /** Represents an ExpandIpCidrRangeSubnetworkRequest. */ + class ExpandIpCidrRangeSubnetworkRequest implements IExpandIpCidrRangeSubnetworkRequest { + + /** + * Constructs a new ExpandIpCidrRangeSubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest); + + /** ExpandIpCidrRangeSubnetworkRequest project. */ + public project: string; + + /** ExpandIpCidrRangeSubnetworkRequest region. */ + public region: string; + + /** ExpandIpCidrRangeSubnetworkRequest requestId. */ + public requestId?: (string|null); + + /** ExpandIpCidrRangeSubnetworkRequest subnetwork. */ + public subnetwork: string; + + /** ExpandIpCidrRangeSubnetworkRequest subnetworksExpandIpCidrRangeRequestResource. */ + public subnetworksExpandIpCidrRangeRequestResource?: (google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest|null); + + /** ExpandIpCidrRangeSubnetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new ExpandIpCidrRangeSubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExpandIpCidrRangeSubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest): google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest; + + /** + * Encodes the specified ExpandIpCidrRangeSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest.verify|verify} messages. + * @param message ExpandIpCidrRangeSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExpandIpCidrRangeSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest.verify|verify} messages. + * @param message ExpandIpCidrRangeSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExpandIpCidrRangeSubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExpandIpCidrRangeSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest; + + /** + * Decodes an ExpandIpCidrRangeSubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExpandIpCidrRangeSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest; + + /** + * Verifies an ExpandIpCidrRangeSubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExpandIpCidrRangeSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExpandIpCidrRangeSubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest; + + /** + * Creates a plain object from an ExpandIpCidrRangeSubnetworkRequest message. Also converts values to other types if specified. + * @param message ExpandIpCidrRangeSubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExpandIpCidrRangeSubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetSubnetworkRequest. */ + interface IGetSubnetworkRequest { + + /** GetSubnetworkRequest project */ + project?: (string|null); + + /** GetSubnetworkRequest region */ + region?: (string|null); + + /** GetSubnetworkRequest subnetwork */ + subnetwork?: (string|null); + } + + /** Represents a GetSubnetworkRequest. */ + class GetSubnetworkRequest implements IGetSubnetworkRequest { + + /** + * Constructs a new GetSubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetSubnetworkRequest); + + /** GetSubnetworkRequest project. */ + public project: string; + + /** GetSubnetworkRequest region. */ + public region: string; + + /** GetSubnetworkRequest subnetwork. */ + public subnetwork: string; + + /** + * Creates a new GetSubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetSubnetworkRequest): google.cloud.compute.v1.GetSubnetworkRequest; + + /** + * Encodes the specified GetSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSubnetworkRequest.verify|verify} messages. + * @param message GetSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSubnetworkRequest.verify|verify} messages. + * @param message GetSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetSubnetworkRequest; + + /** + * Decodes a GetSubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetSubnetworkRequest; + + /** + * Verifies a GetSubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetSubnetworkRequest; + + /** + * Creates a plain object from a GetSubnetworkRequest message. Also converts values to other types if specified. + * @param message GetSubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetSubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetIamPolicySubnetworkRequest. */ + interface IGetIamPolicySubnetworkRequest { + + /** GetIamPolicySubnetworkRequest optionsRequestedPolicyVersion */ + optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicySubnetworkRequest project */ + project?: (string|null); + + /** GetIamPolicySubnetworkRequest region */ + region?: (string|null); + + /** GetIamPolicySubnetworkRequest resource */ + resource?: (string|null); + } + + /** Represents a GetIamPolicySubnetworkRequest. */ + class GetIamPolicySubnetworkRequest implements IGetIamPolicySubnetworkRequest { + + /** + * Constructs a new GetIamPolicySubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetIamPolicySubnetworkRequest); + + /** GetIamPolicySubnetworkRequest optionsRequestedPolicyVersion. */ + public optionsRequestedPolicyVersion?: (number|null); + + /** GetIamPolicySubnetworkRequest project. */ + public project: string; + + /** GetIamPolicySubnetworkRequest region. */ + public region: string; + + /** GetIamPolicySubnetworkRequest resource. */ + public resource: string; + + /** GetIamPolicySubnetworkRequest _optionsRequestedPolicyVersion. */ + public _optionsRequestedPolicyVersion?: "optionsRequestedPolicyVersion"; + + /** + * Creates a new GetIamPolicySubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIamPolicySubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetIamPolicySubnetworkRequest): google.cloud.compute.v1.GetIamPolicySubnetworkRequest; + + /** + * Encodes the specified GetIamPolicySubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySubnetworkRequest.verify|verify} messages. + * @param message GetIamPolicySubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetIamPolicySubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetIamPolicySubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySubnetworkRequest.verify|verify} messages. + * @param message GetIamPolicySubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetIamPolicySubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetIamPolicySubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetIamPolicySubnetworkRequest; + + /** + * Decodes a GetIamPolicySubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetIamPolicySubnetworkRequest; + + /** + * Verifies a GetIamPolicySubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetIamPolicySubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIamPolicySubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetIamPolicySubnetworkRequest; + + /** + * Creates a plain object from a GetIamPolicySubnetworkRequest message. Also converts values to other types if specified. + * @param message GetIamPolicySubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetIamPolicySubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetIamPolicySubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertSubnetworkRequest. */ + interface IInsertSubnetworkRequest { + + /** InsertSubnetworkRequest project */ + project?: (string|null); + + /** InsertSubnetworkRequest region */ + region?: (string|null); + + /** InsertSubnetworkRequest requestId */ + requestId?: (string|null); + + /** InsertSubnetworkRequest subnetworkResource */ + subnetworkResource?: (google.cloud.compute.v1.ISubnetwork|null); + } + + /** Represents an InsertSubnetworkRequest. */ + class InsertSubnetworkRequest implements IInsertSubnetworkRequest { + + /** + * Constructs a new InsertSubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertSubnetworkRequest); + + /** InsertSubnetworkRequest project. */ + public project: string; + + /** InsertSubnetworkRequest region. */ + public region: string; + + /** InsertSubnetworkRequest requestId. */ + public requestId?: (string|null); + + /** InsertSubnetworkRequest subnetworkResource. */ + public subnetworkResource?: (google.cloud.compute.v1.ISubnetwork|null); + + /** InsertSubnetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertSubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertSubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertSubnetworkRequest): google.cloud.compute.v1.InsertSubnetworkRequest; + + /** + * Encodes the specified InsertSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSubnetworkRequest.verify|verify} messages. + * @param message InsertSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSubnetworkRequest.verify|verify} messages. + * @param message InsertSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertSubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertSubnetworkRequest; + + /** + * Decodes an InsertSubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertSubnetworkRequest; + + /** + * Verifies an InsertSubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertSubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertSubnetworkRequest; + + /** + * Creates a plain object from an InsertSubnetworkRequest message. Also converts values to other types if specified. + * @param message InsertSubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertSubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertSubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSubnetworksRequest. */ + interface IListSubnetworksRequest { + + /** ListSubnetworksRequest filter */ + filter?: (string|null); + + /** ListSubnetworksRequest maxResults */ + maxResults?: (number|null); + + /** ListSubnetworksRequest orderBy */ + orderBy?: (string|null); + + /** ListSubnetworksRequest pageToken */ + pageToken?: (string|null); + + /** ListSubnetworksRequest project */ + project?: (string|null); + + /** ListSubnetworksRequest region */ + region?: (string|null); + + /** ListSubnetworksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListSubnetworksRequest. */ + class ListSubnetworksRequest implements IListSubnetworksRequest { + + /** + * Constructs a new ListSubnetworksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListSubnetworksRequest); + + /** ListSubnetworksRequest filter. */ + public filter?: (string|null); + + /** ListSubnetworksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListSubnetworksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListSubnetworksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListSubnetworksRequest project. */ + public project: string; + + /** ListSubnetworksRequest region. */ + public region: string; + + /** ListSubnetworksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListSubnetworksRequest _filter. */ + public _filter?: "filter"; + + /** ListSubnetworksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListSubnetworksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListSubnetworksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListSubnetworksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListSubnetworksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubnetworksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListSubnetworksRequest): google.cloud.compute.v1.ListSubnetworksRequest; + + /** + * Encodes the specified ListSubnetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSubnetworksRequest.verify|verify} messages. + * @param message ListSubnetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListSubnetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubnetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSubnetworksRequest.verify|verify} messages. + * @param message ListSubnetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListSubnetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubnetworksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListSubnetworksRequest; + + /** + * Decodes a ListSubnetworksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListSubnetworksRequest; + + /** + * Verifies a ListSubnetworksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSubnetworksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubnetworksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListSubnetworksRequest; + + /** + * Creates a plain object from a ListSubnetworksRequest message. Also converts values to other types if specified. + * @param message ListSubnetworksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListSubnetworksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubnetworksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListUsableSubnetworksRequest. */ + interface IListUsableSubnetworksRequest { + + /** ListUsableSubnetworksRequest filter */ + filter?: (string|null); + + /** ListUsableSubnetworksRequest maxResults */ + maxResults?: (number|null); + + /** ListUsableSubnetworksRequest orderBy */ + orderBy?: (string|null); + + /** ListUsableSubnetworksRequest pageToken */ + pageToken?: (string|null); + + /** ListUsableSubnetworksRequest project */ + project?: (string|null); + + /** ListUsableSubnetworksRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListUsableSubnetworksRequest. */ + class ListUsableSubnetworksRequest implements IListUsableSubnetworksRequest { + + /** + * Constructs a new ListUsableSubnetworksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListUsableSubnetworksRequest); + + /** ListUsableSubnetworksRequest filter. */ + public filter?: (string|null); + + /** ListUsableSubnetworksRequest maxResults. */ + public maxResults?: (number|null); + + /** ListUsableSubnetworksRequest orderBy. */ + public orderBy?: (string|null); + + /** ListUsableSubnetworksRequest pageToken. */ + public pageToken?: (string|null); + + /** ListUsableSubnetworksRequest project. */ + public project: string; + + /** ListUsableSubnetworksRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListUsableSubnetworksRequest _filter. */ + public _filter?: "filter"; + + /** ListUsableSubnetworksRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListUsableSubnetworksRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListUsableSubnetworksRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListUsableSubnetworksRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListUsableSubnetworksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsableSubnetworksRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListUsableSubnetworksRequest): google.cloud.compute.v1.ListUsableSubnetworksRequest; + + /** + * Encodes the specified ListUsableSubnetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListUsableSubnetworksRequest.verify|verify} messages. + * @param message ListUsableSubnetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListUsableSubnetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsableSubnetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListUsableSubnetworksRequest.verify|verify} messages. + * @param message ListUsableSubnetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListUsableSubnetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsableSubnetworksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsableSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListUsableSubnetworksRequest; + + /** + * Decodes a ListUsableSubnetworksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsableSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListUsableSubnetworksRequest; + + /** + * Verifies a ListUsableSubnetworksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsableSubnetworksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsableSubnetworksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListUsableSubnetworksRequest; + + /** + * Creates a plain object from a ListUsableSubnetworksRequest message. Also converts values to other types if specified. + * @param message ListUsableSubnetworksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListUsableSubnetworksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsableSubnetworksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchSubnetworkRequest. */ + interface IPatchSubnetworkRequest { + + /** PatchSubnetworkRequest drainTimeoutSeconds */ + drainTimeoutSeconds?: (number|null); + + /** PatchSubnetworkRequest project */ + project?: (string|null); + + /** PatchSubnetworkRequest region */ + region?: (string|null); + + /** PatchSubnetworkRequest requestId */ + requestId?: (string|null); + + /** PatchSubnetworkRequest subnetwork */ + subnetwork?: (string|null); + + /** PatchSubnetworkRequest subnetworkResource */ + subnetworkResource?: (google.cloud.compute.v1.ISubnetwork|null); + } + + /** Represents a PatchSubnetworkRequest. */ + class PatchSubnetworkRequest implements IPatchSubnetworkRequest { + + /** + * Constructs a new PatchSubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchSubnetworkRequest); + + /** PatchSubnetworkRequest drainTimeoutSeconds. */ + public drainTimeoutSeconds?: (number|null); + + /** PatchSubnetworkRequest project. */ + public project: string; + + /** PatchSubnetworkRequest region. */ + public region: string; + + /** PatchSubnetworkRequest requestId. */ + public requestId?: (string|null); + + /** PatchSubnetworkRequest subnetwork. */ + public subnetwork: string; + + /** PatchSubnetworkRequest subnetworkResource. */ + public subnetworkResource?: (google.cloud.compute.v1.ISubnetwork|null); + + /** PatchSubnetworkRequest _drainTimeoutSeconds. */ + public _drainTimeoutSeconds?: "drainTimeoutSeconds"; + + /** PatchSubnetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchSubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchSubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchSubnetworkRequest): google.cloud.compute.v1.PatchSubnetworkRequest; + + /** + * Encodes the specified PatchSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchSubnetworkRequest.verify|verify} messages. + * @param message PatchSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchSubnetworkRequest.verify|verify} messages. + * @param message PatchSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchSubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchSubnetworkRequest; + + /** + * Decodes a PatchSubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchSubnetworkRequest; + + /** + * Verifies a PatchSubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchSubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchSubnetworkRequest; + + /** + * Creates a plain object from a PatchSubnetworkRequest message. Also converts values to other types if specified. + * @param message PatchSubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchSubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchSubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetIamPolicySubnetworkRequest. */ + interface ISetIamPolicySubnetworkRequest { + + /** SetIamPolicySubnetworkRequest project */ + project?: (string|null); + + /** SetIamPolicySubnetworkRequest region */ + region?: (string|null); + + /** SetIamPolicySubnetworkRequest regionSetPolicyRequestResource */ + regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicySubnetworkRequest resource */ + resource?: (string|null); + } + + /** Represents a SetIamPolicySubnetworkRequest. */ + class SetIamPolicySubnetworkRequest implements ISetIamPolicySubnetworkRequest { + + /** + * Constructs a new SetIamPolicySubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetIamPolicySubnetworkRequest); + + /** SetIamPolicySubnetworkRequest project. */ + public project: string; + + /** SetIamPolicySubnetworkRequest region. */ + public region: string; + + /** SetIamPolicySubnetworkRequest regionSetPolicyRequestResource. */ + public regionSetPolicyRequestResource?: (google.cloud.compute.v1.IRegionSetPolicyRequest|null); + + /** SetIamPolicySubnetworkRequest resource. */ + public resource: string; + + /** + * Creates a new SetIamPolicySubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetIamPolicySubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetIamPolicySubnetworkRequest): google.cloud.compute.v1.SetIamPolicySubnetworkRequest; + + /** + * Encodes the specified SetIamPolicySubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySubnetworkRequest.verify|verify} messages. + * @param message SetIamPolicySubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetIamPolicySubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySubnetworkRequest.verify|verify} messages. + * @param message SetIamPolicySubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetIamPolicySubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetIamPolicySubnetworkRequest; + + /** + * Decodes a SetIamPolicySubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetIamPolicySubnetworkRequest; + + /** + * Verifies a SetIamPolicySubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetIamPolicySubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetIamPolicySubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetIamPolicySubnetworkRequest; + + /** + * Creates a plain object from a SetIamPolicySubnetworkRequest message. Also converts values to other types if specified. + * @param message SetIamPolicySubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetIamPolicySubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetIamPolicySubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetPrivateIpGoogleAccessSubnetworkRequest. */ + interface ISetPrivateIpGoogleAccessSubnetworkRequest { + + /** SetPrivateIpGoogleAccessSubnetworkRequest project */ + project?: (string|null); + + /** SetPrivateIpGoogleAccessSubnetworkRequest region */ + region?: (string|null); + + /** SetPrivateIpGoogleAccessSubnetworkRequest requestId */ + requestId?: (string|null); + + /** SetPrivateIpGoogleAccessSubnetworkRequest subnetwork */ + subnetwork?: (string|null); + + /** SetPrivateIpGoogleAccessSubnetworkRequest subnetworksSetPrivateIpGoogleAccessRequestResource */ + subnetworksSetPrivateIpGoogleAccessRequestResource?: (google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest|null); + } + + /** Represents a SetPrivateIpGoogleAccessSubnetworkRequest. */ + class SetPrivateIpGoogleAccessSubnetworkRequest implements ISetPrivateIpGoogleAccessSubnetworkRequest { + + /** + * Constructs a new SetPrivateIpGoogleAccessSubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest); + + /** SetPrivateIpGoogleAccessSubnetworkRequest project. */ + public project: string; + + /** SetPrivateIpGoogleAccessSubnetworkRequest region. */ + public region: string; + + /** SetPrivateIpGoogleAccessSubnetworkRequest requestId. */ + public requestId?: (string|null); + + /** SetPrivateIpGoogleAccessSubnetworkRequest subnetwork. */ + public subnetwork: string; + + /** SetPrivateIpGoogleAccessSubnetworkRequest subnetworksSetPrivateIpGoogleAccessRequestResource. */ + public subnetworksSetPrivateIpGoogleAccessRequestResource?: (google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest|null); + + /** SetPrivateIpGoogleAccessSubnetworkRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetPrivateIpGoogleAccessSubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetPrivateIpGoogleAccessSubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest): google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest; + + /** + * Encodes the specified SetPrivateIpGoogleAccessSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest.verify|verify} messages. + * @param message SetPrivateIpGoogleAccessSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetPrivateIpGoogleAccessSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest.verify|verify} messages. + * @param message SetPrivateIpGoogleAccessSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetPrivateIpGoogleAccessSubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetPrivateIpGoogleAccessSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest; + + /** + * Decodes a SetPrivateIpGoogleAccessSubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetPrivateIpGoogleAccessSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest; + + /** + * Verifies a SetPrivateIpGoogleAccessSubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetPrivateIpGoogleAccessSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetPrivateIpGoogleAccessSubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest; + + /** + * Creates a plain object from a SetPrivateIpGoogleAccessSubnetworkRequest message. Also converts values to other types if specified. + * @param message SetPrivateIpGoogleAccessSubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetPrivateIpGoogleAccessSubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsSubnetworkRequest. */ + interface ITestIamPermissionsSubnetworkRequest { + + /** TestIamPermissionsSubnetworkRequest project */ + project?: (string|null); + + /** TestIamPermissionsSubnetworkRequest region */ + region?: (string|null); + + /** TestIamPermissionsSubnetworkRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsSubnetworkRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsSubnetworkRequest. */ + class TestIamPermissionsSubnetworkRequest implements ITestIamPermissionsSubnetworkRequest { + + /** + * Constructs a new TestIamPermissionsSubnetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest); + + /** TestIamPermissionsSubnetworkRequest project. */ + public project: string; + + /** TestIamPermissionsSubnetworkRequest region. */ + public region: string; + + /** TestIamPermissionsSubnetworkRequest resource. */ + public resource: string; + + /** TestIamPermissionsSubnetworkRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsSubnetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsSubnetworkRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest): google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest; + + /** + * Encodes the specified TestIamPermissionsSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest.verify|verify} messages. + * @param message TestIamPermissionsSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest.verify|verify} messages. + * @param message TestIamPermissionsSubnetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsSubnetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest; + + /** + * Decodes a TestIamPermissionsSubnetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest; + + /** + * Verifies a TestIamPermissionsSubnetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsSubnetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest; + + /** + * Creates a plain object from a TestIamPermissionsSubnetworkRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsSubnetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsSubnetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetGrpcProxyRequest. */ + interface IDeleteTargetGrpcProxyRequest { + + /** DeleteTargetGrpcProxyRequest project */ + project?: (string|null); + + /** DeleteTargetGrpcProxyRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetGrpcProxyRequest targetGrpcProxy */ + targetGrpcProxy?: (string|null); + } + + /** Represents a DeleteTargetGrpcProxyRequest. */ + class DeleteTargetGrpcProxyRequest implements IDeleteTargetGrpcProxyRequest { + + /** + * Constructs a new DeleteTargetGrpcProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest); + + /** DeleteTargetGrpcProxyRequest project. */ + public project: string; + + /** DeleteTargetGrpcProxyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetGrpcProxyRequest targetGrpcProxy. */ + public targetGrpcProxy: string; + + /** DeleteTargetGrpcProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetGrpcProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetGrpcProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest): google.cloud.compute.v1.DeleteTargetGrpcProxyRequest; + + /** + * Encodes the specified DeleteTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetGrpcProxyRequest.verify|verify} messages. + * @param message DeleteTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetGrpcProxyRequest.verify|verify} messages. + * @param message DeleteTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetGrpcProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetGrpcProxyRequest; + + /** + * Decodes a DeleteTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetGrpcProxyRequest; + + /** + * Verifies a DeleteTargetGrpcProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetGrpcProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetGrpcProxyRequest; + + /** + * Creates a plain object from a DeleteTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @param message DeleteTargetGrpcProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetGrpcProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetGrpcProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetGrpcProxyRequest. */ + interface IGetTargetGrpcProxyRequest { + + /** GetTargetGrpcProxyRequest project */ + project?: (string|null); + + /** GetTargetGrpcProxyRequest targetGrpcProxy */ + targetGrpcProxy?: (string|null); + } + + /** Represents a GetTargetGrpcProxyRequest. */ + class GetTargetGrpcProxyRequest implements IGetTargetGrpcProxyRequest { + + /** + * Constructs a new GetTargetGrpcProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetGrpcProxyRequest); + + /** GetTargetGrpcProxyRequest project. */ + public project: string; + + /** GetTargetGrpcProxyRequest targetGrpcProxy. */ + public targetGrpcProxy: string; + + /** + * Creates a new GetTargetGrpcProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetGrpcProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetGrpcProxyRequest): google.cloud.compute.v1.GetTargetGrpcProxyRequest; + + /** + * Encodes the specified GetTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetGrpcProxyRequest.verify|verify} messages. + * @param message GetTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetGrpcProxyRequest.verify|verify} messages. + * @param message GetTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetGrpcProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetGrpcProxyRequest; + + /** + * Decodes a GetTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetGrpcProxyRequest; + + /** + * Verifies a GetTargetGrpcProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetGrpcProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetGrpcProxyRequest; + + /** + * Creates a plain object from a GetTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @param message GetTargetGrpcProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetGrpcProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetGrpcProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetGrpcProxyRequest. */ + interface IInsertTargetGrpcProxyRequest { + + /** InsertTargetGrpcProxyRequest project */ + project?: (string|null); + + /** InsertTargetGrpcProxyRequest requestId */ + requestId?: (string|null); + + /** InsertTargetGrpcProxyRequest targetGrpcProxyResource */ + targetGrpcProxyResource?: (google.cloud.compute.v1.ITargetGrpcProxy|null); + } + + /** Represents an InsertTargetGrpcProxyRequest. */ + class InsertTargetGrpcProxyRequest implements IInsertTargetGrpcProxyRequest { + + /** + * Constructs a new InsertTargetGrpcProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetGrpcProxyRequest); + + /** InsertTargetGrpcProxyRequest project. */ + public project: string; + + /** InsertTargetGrpcProxyRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetGrpcProxyRequest targetGrpcProxyResource. */ + public targetGrpcProxyResource?: (google.cloud.compute.v1.ITargetGrpcProxy|null); + + /** InsertTargetGrpcProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetGrpcProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetGrpcProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetGrpcProxyRequest): google.cloud.compute.v1.InsertTargetGrpcProxyRequest; + + /** + * Encodes the specified InsertTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetGrpcProxyRequest.verify|verify} messages. + * @param message InsertTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetGrpcProxyRequest.verify|verify} messages. + * @param message InsertTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetGrpcProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetGrpcProxyRequest; + + /** + * Decodes an InsertTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetGrpcProxyRequest; + + /** + * Verifies an InsertTargetGrpcProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetGrpcProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetGrpcProxyRequest; + + /** + * Creates a plain object from an InsertTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @param message InsertTargetGrpcProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetGrpcProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetGrpcProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetGrpcProxiesRequest. */ + interface IListTargetGrpcProxiesRequest { + + /** ListTargetGrpcProxiesRequest filter */ + filter?: (string|null); + + /** ListTargetGrpcProxiesRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetGrpcProxiesRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetGrpcProxiesRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetGrpcProxiesRequest project */ + project?: (string|null); + + /** ListTargetGrpcProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListTargetGrpcProxiesRequest. */ + class ListTargetGrpcProxiesRequest implements IListTargetGrpcProxiesRequest { + + /** + * Constructs a new ListTargetGrpcProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetGrpcProxiesRequest); + + /** ListTargetGrpcProxiesRequest filter. */ + public filter?: (string|null); + + /** ListTargetGrpcProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetGrpcProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetGrpcProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetGrpcProxiesRequest project. */ + public project: string; + + /** ListTargetGrpcProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetGrpcProxiesRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetGrpcProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetGrpcProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetGrpcProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetGrpcProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetGrpcProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetGrpcProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetGrpcProxiesRequest): google.cloud.compute.v1.ListTargetGrpcProxiesRequest; + + /** + * Encodes the specified ListTargetGrpcProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetGrpcProxiesRequest.verify|verify} messages. + * @param message ListTargetGrpcProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetGrpcProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetGrpcProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetGrpcProxiesRequest.verify|verify} messages. + * @param message ListTargetGrpcProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetGrpcProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetGrpcProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetGrpcProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetGrpcProxiesRequest; + + /** + * Decodes a ListTargetGrpcProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetGrpcProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetGrpcProxiesRequest; + + /** + * Verifies a ListTargetGrpcProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetGrpcProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetGrpcProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetGrpcProxiesRequest; + + /** + * Creates a plain object from a ListTargetGrpcProxiesRequest message. Also converts values to other types if specified. + * @param message ListTargetGrpcProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetGrpcProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetGrpcProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchTargetGrpcProxyRequest. */ + interface IPatchTargetGrpcProxyRequest { + + /** PatchTargetGrpcProxyRequest project */ + project?: (string|null); + + /** PatchTargetGrpcProxyRequest requestId */ + requestId?: (string|null); + + /** PatchTargetGrpcProxyRequest targetGrpcProxy */ + targetGrpcProxy?: (string|null); + + /** PatchTargetGrpcProxyRequest targetGrpcProxyResource */ + targetGrpcProxyResource?: (google.cloud.compute.v1.ITargetGrpcProxy|null); + } + + /** Represents a PatchTargetGrpcProxyRequest. */ + class PatchTargetGrpcProxyRequest implements IPatchTargetGrpcProxyRequest { + + /** + * Constructs a new PatchTargetGrpcProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchTargetGrpcProxyRequest); + + /** PatchTargetGrpcProxyRequest project. */ + public project: string; + + /** PatchTargetGrpcProxyRequest requestId. */ + public requestId?: (string|null); + + /** PatchTargetGrpcProxyRequest targetGrpcProxy. */ + public targetGrpcProxy: string; + + /** PatchTargetGrpcProxyRequest targetGrpcProxyResource. */ + public targetGrpcProxyResource?: (google.cloud.compute.v1.ITargetGrpcProxy|null); + + /** PatchTargetGrpcProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchTargetGrpcProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchTargetGrpcProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchTargetGrpcProxyRequest): google.cloud.compute.v1.PatchTargetGrpcProxyRequest; + + /** + * Encodes the specified PatchTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchTargetGrpcProxyRequest.verify|verify} messages. + * @param message PatchTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchTargetGrpcProxyRequest.verify|verify} messages. + * @param message PatchTargetGrpcProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchTargetGrpcProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchTargetGrpcProxyRequest; + + /** + * Decodes a PatchTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchTargetGrpcProxyRequest; + + /** + * Verifies a PatchTargetGrpcProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchTargetGrpcProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchTargetGrpcProxyRequest; + + /** + * Creates a plain object from a PatchTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @param message PatchTargetGrpcProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchTargetGrpcProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchTargetGrpcProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListTargetHttpProxiesRequest. */ + interface IAggregatedListTargetHttpProxiesRequest { + + /** AggregatedListTargetHttpProxiesRequest filter */ + filter?: (string|null); + + /** AggregatedListTargetHttpProxiesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListTargetHttpProxiesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListTargetHttpProxiesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListTargetHttpProxiesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListTargetHttpProxiesRequest project */ + project?: (string|null); + + /** AggregatedListTargetHttpProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListTargetHttpProxiesRequest. */ + class AggregatedListTargetHttpProxiesRequest implements IAggregatedListTargetHttpProxiesRequest { + + /** + * Constructs a new AggregatedListTargetHttpProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest); + + /** AggregatedListTargetHttpProxiesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListTargetHttpProxiesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListTargetHttpProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListTargetHttpProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListTargetHttpProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListTargetHttpProxiesRequest project. */ + public project: string; + + /** AggregatedListTargetHttpProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListTargetHttpProxiesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListTargetHttpProxiesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListTargetHttpProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListTargetHttpProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListTargetHttpProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListTargetHttpProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListTargetHttpProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListTargetHttpProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest): google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest; + + /** + * Encodes the specified AggregatedListTargetHttpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest.verify|verify} messages. + * @param message AggregatedListTargetHttpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListTargetHttpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest.verify|verify} messages. + * @param message AggregatedListTargetHttpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListTargetHttpProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest; + + /** + * Decodes an AggregatedListTargetHttpProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest; + + /** + * Verifies an AggregatedListTargetHttpProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListTargetHttpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListTargetHttpProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest; + + /** + * Creates a plain object from an AggregatedListTargetHttpProxiesRequest message. Also converts values to other types if specified. + * @param message AggregatedListTargetHttpProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListTargetHttpProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetHttpProxyRequest. */ + interface IDeleteTargetHttpProxyRequest { + + /** DeleteTargetHttpProxyRequest project */ + project?: (string|null); + + /** DeleteTargetHttpProxyRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetHttpProxyRequest targetHttpProxy */ + targetHttpProxy?: (string|null); + } + + /** Represents a DeleteTargetHttpProxyRequest. */ + class DeleteTargetHttpProxyRequest implements IDeleteTargetHttpProxyRequest { + + /** + * Constructs a new DeleteTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetHttpProxyRequest); + + /** DeleteTargetHttpProxyRequest project. */ + public project: string; + + /** DeleteTargetHttpProxyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetHttpProxyRequest targetHttpProxy. */ + public targetHttpProxy: string; + + /** DeleteTargetHttpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetHttpProxyRequest): google.cloud.compute.v1.DeleteTargetHttpProxyRequest; + + /** + * Encodes the specified DeleteTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpProxyRequest.verify|verify} messages. + * @param message DeleteTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpProxyRequest.verify|verify} messages. + * @param message DeleteTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetHttpProxyRequest; + + /** + * Decodes a DeleteTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetHttpProxyRequest; + + /** + * Verifies a DeleteTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetHttpProxyRequest; + + /** + * Creates a plain object from a DeleteTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message DeleteTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetHttpProxyRequest. */ + interface IGetTargetHttpProxyRequest { + + /** GetTargetHttpProxyRequest project */ + project?: (string|null); + + /** GetTargetHttpProxyRequest targetHttpProxy */ + targetHttpProxy?: (string|null); + } + + /** Represents a GetTargetHttpProxyRequest. */ + class GetTargetHttpProxyRequest implements IGetTargetHttpProxyRequest { + + /** + * Constructs a new GetTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetHttpProxyRequest); + + /** GetTargetHttpProxyRequest project. */ + public project: string; + + /** GetTargetHttpProxyRequest targetHttpProxy. */ + public targetHttpProxy: string; + + /** + * Creates a new GetTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetHttpProxyRequest): google.cloud.compute.v1.GetTargetHttpProxyRequest; + + /** + * Encodes the specified GetTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpProxyRequest.verify|verify} messages. + * @param message GetTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpProxyRequest.verify|verify} messages. + * @param message GetTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetHttpProxyRequest; + + /** + * Decodes a GetTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetHttpProxyRequest; + + /** + * Verifies a GetTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetHttpProxyRequest; + + /** + * Creates a plain object from a GetTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message GetTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetHttpProxyRequest. */ + interface IInsertTargetHttpProxyRequest { + + /** InsertTargetHttpProxyRequest project */ + project?: (string|null); + + /** InsertTargetHttpProxyRequest requestId */ + requestId?: (string|null); + + /** InsertTargetHttpProxyRequest targetHttpProxyResource */ + targetHttpProxyResource?: (google.cloud.compute.v1.ITargetHttpProxy|null); + } + + /** Represents an InsertTargetHttpProxyRequest. */ + class InsertTargetHttpProxyRequest implements IInsertTargetHttpProxyRequest { + + /** + * Constructs a new InsertTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetHttpProxyRequest); + + /** InsertTargetHttpProxyRequest project. */ + public project: string; + + /** InsertTargetHttpProxyRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetHttpProxyRequest targetHttpProxyResource. */ + public targetHttpProxyResource?: (google.cloud.compute.v1.ITargetHttpProxy|null); + + /** InsertTargetHttpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetHttpProxyRequest): google.cloud.compute.v1.InsertTargetHttpProxyRequest; + + /** + * Encodes the specified InsertTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpProxyRequest.verify|verify} messages. + * @param message InsertTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpProxyRequest.verify|verify} messages. + * @param message InsertTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetHttpProxyRequest; + + /** + * Decodes an InsertTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetHttpProxyRequest; + + /** + * Verifies an InsertTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetHttpProxyRequest; + + /** + * Creates a plain object from an InsertTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message InsertTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetHttpProxiesRequest. */ + interface IListTargetHttpProxiesRequest { + + /** ListTargetHttpProxiesRequest filter */ + filter?: (string|null); + + /** ListTargetHttpProxiesRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetHttpProxiesRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetHttpProxiesRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetHttpProxiesRequest project */ + project?: (string|null); + + /** ListTargetHttpProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListTargetHttpProxiesRequest. */ + class ListTargetHttpProxiesRequest implements IListTargetHttpProxiesRequest { + + /** + * Constructs a new ListTargetHttpProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetHttpProxiesRequest); + + /** ListTargetHttpProxiesRequest filter. */ + public filter?: (string|null); + + /** ListTargetHttpProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetHttpProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetHttpProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetHttpProxiesRequest project. */ + public project: string; + + /** ListTargetHttpProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetHttpProxiesRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetHttpProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetHttpProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetHttpProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetHttpProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetHttpProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetHttpProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetHttpProxiesRequest): google.cloud.compute.v1.ListTargetHttpProxiesRequest; + + /** + * Encodes the specified ListTargetHttpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpProxiesRequest.verify|verify} messages. + * @param message ListTargetHttpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetHttpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetHttpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpProxiesRequest.verify|verify} messages. + * @param message ListTargetHttpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetHttpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetHttpProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetHttpProxiesRequest; + + /** + * Decodes a ListTargetHttpProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetHttpProxiesRequest; + + /** + * Verifies a ListTargetHttpProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetHttpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetHttpProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetHttpProxiesRequest; + + /** + * Creates a plain object from a ListTargetHttpProxiesRequest message. Also converts values to other types if specified. + * @param message ListTargetHttpProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetHttpProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetHttpProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchTargetHttpProxyRequest. */ + interface IPatchTargetHttpProxyRequest { + + /** PatchTargetHttpProxyRequest project */ + project?: (string|null); + + /** PatchTargetHttpProxyRequest requestId */ + requestId?: (string|null); + + /** PatchTargetHttpProxyRequest targetHttpProxy */ + targetHttpProxy?: (string|null); + + /** PatchTargetHttpProxyRequest targetHttpProxyResource */ + targetHttpProxyResource?: (google.cloud.compute.v1.ITargetHttpProxy|null); + } + + /** Represents a PatchTargetHttpProxyRequest. */ + class PatchTargetHttpProxyRequest implements IPatchTargetHttpProxyRequest { + + /** + * Constructs a new PatchTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchTargetHttpProxyRequest); + + /** PatchTargetHttpProxyRequest project. */ + public project: string; + + /** PatchTargetHttpProxyRequest requestId. */ + public requestId?: (string|null); + + /** PatchTargetHttpProxyRequest targetHttpProxy. */ + public targetHttpProxy: string; + + /** PatchTargetHttpProxyRequest targetHttpProxyResource. */ + public targetHttpProxyResource?: (google.cloud.compute.v1.ITargetHttpProxy|null); + + /** PatchTargetHttpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchTargetHttpProxyRequest): google.cloud.compute.v1.PatchTargetHttpProxyRequest; + + /** + * Encodes the specified PatchTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpProxyRequest.verify|verify} messages. + * @param message PatchTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpProxyRequest.verify|verify} messages. + * @param message PatchTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchTargetHttpProxyRequest; + + /** + * Decodes a PatchTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchTargetHttpProxyRequest; + + /** + * Verifies a PatchTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchTargetHttpProxyRequest; + + /** + * Creates a plain object from a PatchTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message PatchTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetUrlMapTargetHttpProxyRequest. */ + interface ISetUrlMapTargetHttpProxyRequest { + + /** SetUrlMapTargetHttpProxyRequest project */ + project?: (string|null); + + /** SetUrlMapTargetHttpProxyRequest requestId */ + requestId?: (string|null); + + /** SetUrlMapTargetHttpProxyRequest targetHttpProxy */ + targetHttpProxy?: (string|null); + + /** SetUrlMapTargetHttpProxyRequest urlMapReferenceResource */ + urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + } + + /** Represents a SetUrlMapTargetHttpProxyRequest. */ + class SetUrlMapTargetHttpProxyRequest implements ISetUrlMapTargetHttpProxyRequest { + + /** + * Constructs a new SetUrlMapTargetHttpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest); + + /** SetUrlMapTargetHttpProxyRequest project. */ + public project: string; + + /** SetUrlMapTargetHttpProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetUrlMapTargetHttpProxyRequest targetHttpProxy. */ + public targetHttpProxy: string; + + /** SetUrlMapTargetHttpProxyRequest urlMapReferenceResource. */ + public urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + + /** SetUrlMapTargetHttpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetUrlMapTargetHttpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetUrlMapTargetHttpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest): google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest; + + /** + * Encodes the specified SetUrlMapTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest.verify|verify} messages. + * @param message SetUrlMapTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetUrlMapTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest.verify|verify} messages. + * @param message SetUrlMapTargetHttpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetUrlMapTargetHttpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetUrlMapTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest; + + /** + * Decodes a SetUrlMapTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetUrlMapTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest; + + /** + * Verifies a SetUrlMapTargetHttpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetUrlMapTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetUrlMapTargetHttpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest; + + /** + * Creates a plain object from a SetUrlMapTargetHttpProxyRequest message. Also converts values to other types if specified. + * @param message SetUrlMapTargetHttpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetUrlMapTargetHttpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListTargetHttpsProxiesRequest. */ + interface IAggregatedListTargetHttpsProxiesRequest { + + /** AggregatedListTargetHttpsProxiesRequest filter */ + filter?: (string|null); + + /** AggregatedListTargetHttpsProxiesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListTargetHttpsProxiesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListTargetHttpsProxiesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListTargetHttpsProxiesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListTargetHttpsProxiesRequest project */ + project?: (string|null); + + /** AggregatedListTargetHttpsProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListTargetHttpsProxiesRequest. */ + class AggregatedListTargetHttpsProxiesRequest implements IAggregatedListTargetHttpsProxiesRequest { + + /** + * Constructs a new AggregatedListTargetHttpsProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest); + + /** AggregatedListTargetHttpsProxiesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListTargetHttpsProxiesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListTargetHttpsProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListTargetHttpsProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListTargetHttpsProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListTargetHttpsProxiesRequest project. */ + public project: string; + + /** AggregatedListTargetHttpsProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListTargetHttpsProxiesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListTargetHttpsProxiesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListTargetHttpsProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListTargetHttpsProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListTargetHttpsProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListTargetHttpsProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListTargetHttpsProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListTargetHttpsProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest): google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest; + + /** + * Encodes the specified AggregatedListTargetHttpsProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest.verify|verify} messages. + * @param message AggregatedListTargetHttpsProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListTargetHttpsProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest.verify|verify} messages. + * @param message AggregatedListTargetHttpsProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListTargetHttpsProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest; + + /** + * Decodes an AggregatedListTargetHttpsProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest; + + /** + * Verifies an AggregatedListTargetHttpsProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListTargetHttpsProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListTargetHttpsProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest; + + /** + * Creates a plain object from an AggregatedListTargetHttpsProxiesRequest message. Also converts values to other types if specified. + * @param message AggregatedListTargetHttpsProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListTargetHttpsProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetHttpsProxyRequest. */ + interface IDeleteTargetHttpsProxyRequest { + + /** DeleteTargetHttpsProxyRequest project */ + project?: (string|null); + + /** DeleteTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a DeleteTargetHttpsProxyRequest. */ + class DeleteTargetHttpsProxyRequest implements IDeleteTargetHttpsProxyRequest { + + /** + * Constructs a new DeleteTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest); + + /** DeleteTargetHttpsProxyRequest project. */ + public project: string; + + /** DeleteTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** DeleteTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest): google.cloud.compute.v1.DeleteTargetHttpsProxyRequest; + + /** + * Encodes the specified DeleteTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpsProxyRequest.verify|verify} messages. + * @param message DeleteTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpsProxyRequest.verify|verify} messages. + * @param message DeleteTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetHttpsProxyRequest; + + /** + * Decodes a DeleteTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetHttpsProxyRequest; + + /** + * Verifies a DeleteTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetHttpsProxyRequest; + + /** + * Creates a plain object from a DeleteTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message DeleteTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetHttpsProxyRequest. */ + interface IGetTargetHttpsProxyRequest { + + /** GetTargetHttpsProxyRequest project */ + project?: (string|null); + + /** GetTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a GetTargetHttpsProxyRequest. */ + class GetTargetHttpsProxyRequest implements IGetTargetHttpsProxyRequest { + + /** + * Constructs a new GetTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetHttpsProxyRequest); + + /** GetTargetHttpsProxyRequest project. */ + public project: string; + + /** GetTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** + * Creates a new GetTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetHttpsProxyRequest): google.cloud.compute.v1.GetTargetHttpsProxyRequest; + + /** + * Encodes the specified GetTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpsProxyRequest.verify|verify} messages. + * @param message GetTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpsProxyRequest.verify|verify} messages. + * @param message GetTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetHttpsProxyRequest; + + /** + * Decodes a GetTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetHttpsProxyRequest; + + /** + * Verifies a GetTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetHttpsProxyRequest; + + /** + * Creates a plain object from a GetTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message GetTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetHttpsProxyRequest. */ + interface IInsertTargetHttpsProxyRequest { + + /** InsertTargetHttpsProxyRequest project */ + project?: (string|null); + + /** InsertTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** InsertTargetHttpsProxyRequest targetHttpsProxyResource */ + targetHttpsProxyResource?: (google.cloud.compute.v1.ITargetHttpsProxy|null); + } + + /** Represents an InsertTargetHttpsProxyRequest. */ + class InsertTargetHttpsProxyRequest implements IInsertTargetHttpsProxyRequest { + + /** + * Constructs a new InsertTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetHttpsProxyRequest); + + /** InsertTargetHttpsProxyRequest project. */ + public project: string; + + /** InsertTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetHttpsProxyRequest targetHttpsProxyResource. */ + public targetHttpsProxyResource?: (google.cloud.compute.v1.ITargetHttpsProxy|null); + + /** InsertTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetHttpsProxyRequest): google.cloud.compute.v1.InsertTargetHttpsProxyRequest; + + /** + * Encodes the specified InsertTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpsProxyRequest.verify|verify} messages. + * @param message InsertTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpsProxyRequest.verify|verify} messages. + * @param message InsertTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetHttpsProxyRequest; + + /** + * Decodes an InsertTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetHttpsProxyRequest; + + /** + * Verifies an InsertTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetHttpsProxyRequest; + + /** + * Creates a plain object from an InsertTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message InsertTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetHttpsProxiesRequest. */ + interface IListTargetHttpsProxiesRequest { + + /** ListTargetHttpsProxiesRequest filter */ + filter?: (string|null); + + /** ListTargetHttpsProxiesRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetHttpsProxiesRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetHttpsProxiesRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetHttpsProxiesRequest project */ + project?: (string|null); + + /** ListTargetHttpsProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListTargetHttpsProxiesRequest. */ + class ListTargetHttpsProxiesRequest implements IListTargetHttpsProxiesRequest { + + /** + * Constructs a new ListTargetHttpsProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetHttpsProxiesRequest); + + /** ListTargetHttpsProxiesRequest filter. */ + public filter?: (string|null); + + /** ListTargetHttpsProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetHttpsProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetHttpsProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetHttpsProxiesRequest project. */ + public project: string; + + /** ListTargetHttpsProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetHttpsProxiesRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetHttpsProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetHttpsProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetHttpsProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetHttpsProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetHttpsProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetHttpsProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetHttpsProxiesRequest): google.cloud.compute.v1.ListTargetHttpsProxiesRequest; + + /** + * Encodes the specified ListTargetHttpsProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpsProxiesRequest.verify|verify} messages. + * @param message ListTargetHttpsProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetHttpsProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetHttpsProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpsProxiesRequest.verify|verify} messages. + * @param message ListTargetHttpsProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetHttpsProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetHttpsProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetHttpsProxiesRequest; + + /** + * Decodes a ListTargetHttpsProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetHttpsProxiesRequest; + + /** + * Verifies a ListTargetHttpsProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetHttpsProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetHttpsProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetHttpsProxiesRequest; + + /** + * Creates a plain object from a ListTargetHttpsProxiesRequest message. Also converts values to other types if specified. + * @param message ListTargetHttpsProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetHttpsProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetHttpsProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchTargetHttpsProxyRequest. */ + interface IPatchTargetHttpsProxyRequest { + + /** PatchTargetHttpsProxyRequest project */ + project?: (string|null); + + /** PatchTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** PatchTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + + /** PatchTargetHttpsProxyRequest targetHttpsProxyResource */ + targetHttpsProxyResource?: (google.cloud.compute.v1.ITargetHttpsProxy|null); + } + + /** Represents a PatchTargetHttpsProxyRequest. */ + class PatchTargetHttpsProxyRequest implements IPatchTargetHttpsProxyRequest { + + /** + * Constructs a new PatchTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchTargetHttpsProxyRequest); + + /** PatchTargetHttpsProxyRequest project. */ + public project: string; + + /** PatchTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** PatchTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** PatchTargetHttpsProxyRequest targetHttpsProxyResource. */ + public targetHttpsProxyResource?: (google.cloud.compute.v1.ITargetHttpsProxy|null); + + /** PatchTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchTargetHttpsProxyRequest): google.cloud.compute.v1.PatchTargetHttpsProxyRequest; + + /** + * Encodes the specified PatchTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpsProxyRequest.verify|verify} messages. + * @param message PatchTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpsProxyRequest.verify|verify} messages. + * @param message PatchTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchTargetHttpsProxyRequest; + + /** + * Decodes a PatchTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchTargetHttpsProxyRequest; + + /** + * Verifies a PatchTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchTargetHttpsProxyRequest; + + /** + * Creates a plain object from a PatchTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message PatchTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetQuicOverrideTargetHttpsProxyRequest. */ + interface ISetQuicOverrideTargetHttpsProxyRequest { + + /** SetQuicOverrideTargetHttpsProxyRequest project */ + project?: (string|null); + + /** SetQuicOverrideTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxiesSetQuicOverrideRequestResource */ + targetHttpsProxiesSetQuicOverrideRequestResource?: (google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest|null); + + /** SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a SetQuicOverrideTargetHttpsProxyRequest. */ + class SetQuicOverrideTargetHttpsProxyRequest implements ISetQuicOverrideTargetHttpsProxyRequest { + + /** + * Constructs a new SetQuicOverrideTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest); + + /** SetQuicOverrideTargetHttpsProxyRequest project. */ + public project: string; + + /** SetQuicOverrideTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxiesSetQuicOverrideRequestResource. */ + public targetHttpsProxiesSetQuicOverrideRequestResource?: (google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest|null); + + /** SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** SetQuicOverrideTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetQuicOverrideTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetQuicOverrideTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest): google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest; + + /** + * Encodes the specified SetQuicOverrideTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetQuicOverrideTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetQuicOverrideTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetQuicOverrideTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetQuicOverrideTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetQuicOverrideTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest; + + /** + * Decodes a SetQuicOverrideTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetQuicOverrideTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest; + + /** + * Verifies a SetQuicOverrideTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetQuicOverrideTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetQuicOverrideTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest; + + /** + * Creates a plain object from a SetQuicOverrideTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message SetQuicOverrideTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetQuicOverrideTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetSslCertificatesTargetHttpsProxyRequest. */ + interface ISetSslCertificatesTargetHttpsProxyRequest { + + /** SetSslCertificatesTargetHttpsProxyRequest project */ + project?: (string|null); + + /** SetSslCertificatesTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxiesSetSslCertificatesRequestResource */ + targetHttpsProxiesSetSslCertificatesRequestResource?: (google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest|null); + + /** SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a SetSslCertificatesTargetHttpsProxyRequest. */ + class SetSslCertificatesTargetHttpsProxyRequest implements ISetSslCertificatesTargetHttpsProxyRequest { + + /** + * Constructs a new SetSslCertificatesTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest); + + /** SetSslCertificatesTargetHttpsProxyRequest project. */ + public project: string; + + /** SetSslCertificatesTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxiesSetSslCertificatesRequestResource. */ + public targetHttpsProxiesSetSslCertificatesRequestResource?: (google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest|null); + + /** SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** SetSslCertificatesTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetSslCertificatesTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetSslCertificatesTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest): google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest; + + /** + * Encodes the specified SetSslCertificatesTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetSslCertificatesTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetSslCertificatesTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetSslCertificatesTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetSslCertificatesTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetSslCertificatesTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest; + + /** + * Decodes a SetSslCertificatesTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetSslCertificatesTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest; + + /** + * Verifies a SetSslCertificatesTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetSslCertificatesTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetSslCertificatesTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest; + + /** + * Creates a plain object from a SetSslCertificatesTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message SetSslCertificatesTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetSslCertificatesTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetSslPolicyTargetHttpsProxyRequest. */ + interface ISetSslPolicyTargetHttpsProxyRequest { + + /** SetSslPolicyTargetHttpsProxyRequest project */ + project?: (string|null); + + /** SetSslPolicyTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** SetSslPolicyTargetHttpsProxyRequest sslPolicyReferenceResource */ + sslPolicyReferenceResource?: (google.cloud.compute.v1.ISslPolicyReference|null); + + /** SetSslPolicyTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + } + + /** Represents a SetSslPolicyTargetHttpsProxyRequest. */ + class SetSslPolicyTargetHttpsProxyRequest implements ISetSslPolicyTargetHttpsProxyRequest { + + /** + * Constructs a new SetSslPolicyTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest); + + /** SetSslPolicyTargetHttpsProxyRequest project. */ + public project: string; + + /** SetSslPolicyTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetSslPolicyTargetHttpsProxyRequest sslPolicyReferenceResource. */ + public sslPolicyReferenceResource?: (google.cloud.compute.v1.ISslPolicyReference|null); + + /** SetSslPolicyTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** SetSslPolicyTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetSslPolicyTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetSslPolicyTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest): google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest; + + /** + * Encodes the specified SetSslPolicyTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetSslPolicyTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetSslPolicyTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetSslPolicyTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetSslPolicyTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetSslPolicyTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest; + + /** + * Decodes a SetSslPolicyTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetSslPolicyTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest; + + /** + * Verifies a SetSslPolicyTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetSslPolicyTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetSslPolicyTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest; + + /** + * Creates a plain object from a SetSslPolicyTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message SetSslPolicyTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetSslPolicyTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetUrlMapTargetHttpsProxyRequest. */ + interface ISetUrlMapTargetHttpsProxyRequest { + + /** SetUrlMapTargetHttpsProxyRequest project */ + project?: (string|null); + + /** SetUrlMapTargetHttpsProxyRequest requestId */ + requestId?: (string|null); + + /** SetUrlMapTargetHttpsProxyRequest targetHttpsProxy */ + targetHttpsProxy?: (string|null); + + /** SetUrlMapTargetHttpsProxyRequest urlMapReferenceResource */ + urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + } + + /** Represents a SetUrlMapTargetHttpsProxyRequest. */ + class SetUrlMapTargetHttpsProxyRequest implements ISetUrlMapTargetHttpsProxyRequest { + + /** + * Constructs a new SetUrlMapTargetHttpsProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest); + + /** SetUrlMapTargetHttpsProxyRequest project. */ + public project: string; + + /** SetUrlMapTargetHttpsProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetUrlMapTargetHttpsProxyRequest targetHttpsProxy. */ + public targetHttpsProxy: string; + + /** SetUrlMapTargetHttpsProxyRequest urlMapReferenceResource. */ + public urlMapReferenceResource?: (google.cloud.compute.v1.IUrlMapReference|null); + + /** SetUrlMapTargetHttpsProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetUrlMapTargetHttpsProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetUrlMapTargetHttpsProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest): google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest; + + /** + * Encodes the specified SetUrlMapTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetUrlMapTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetUrlMapTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest.verify|verify} messages. + * @param message SetUrlMapTargetHttpsProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetUrlMapTargetHttpsProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetUrlMapTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest; + + /** + * Decodes a SetUrlMapTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetUrlMapTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest; + + /** + * Verifies a SetUrlMapTargetHttpsProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetUrlMapTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetUrlMapTargetHttpsProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest; + + /** + * Creates a plain object from a SetUrlMapTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @param message SetUrlMapTargetHttpsProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetUrlMapTargetHttpsProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListTargetInstancesRequest. */ + interface IAggregatedListTargetInstancesRequest { + + /** AggregatedListTargetInstancesRequest filter */ + filter?: (string|null); + + /** AggregatedListTargetInstancesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListTargetInstancesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListTargetInstancesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListTargetInstancesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListTargetInstancesRequest project */ + project?: (string|null); + + /** AggregatedListTargetInstancesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListTargetInstancesRequest. */ + class AggregatedListTargetInstancesRequest implements IAggregatedListTargetInstancesRequest { + + /** + * Constructs a new AggregatedListTargetInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListTargetInstancesRequest); + + /** AggregatedListTargetInstancesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListTargetInstancesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListTargetInstancesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListTargetInstancesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListTargetInstancesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListTargetInstancesRequest project. */ + public project: string; + + /** AggregatedListTargetInstancesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListTargetInstancesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListTargetInstancesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListTargetInstancesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListTargetInstancesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListTargetInstancesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListTargetInstancesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListTargetInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListTargetInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListTargetInstancesRequest): google.cloud.compute.v1.AggregatedListTargetInstancesRequest; + + /** + * Encodes the specified AggregatedListTargetInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetInstancesRequest.verify|verify} messages. + * @param message AggregatedListTargetInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListTargetInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListTargetInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetInstancesRequest.verify|verify} messages. + * @param message AggregatedListTargetInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListTargetInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListTargetInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListTargetInstancesRequest; + + /** + * Decodes an AggregatedListTargetInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListTargetInstancesRequest; + + /** + * Verifies an AggregatedListTargetInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListTargetInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListTargetInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListTargetInstancesRequest; + + /** + * Creates a plain object from an AggregatedListTargetInstancesRequest message. Also converts values to other types if specified. + * @param message AggregatedListTargetInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListTargetInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListTargetInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetInstanceRequest. */ + interface IDeleteTargetInstanceRequest { + + /** DeleteTargetInstanceRequest project */ + project?: (string|null); + + /** DeleteTargetInstanceRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetInstanceRequest targetInstance */ + targetInstance?: (string|null); + + /** DeleteTargetInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteTargetInstanceRequest. */ + class DeleteTargetInstanceRequest implements IDeleteTargetInstanceRequest { + + /** + * Constructs a new DeleteTargetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetInstanceRequest); + + /** DeleteTargetInstanceRequest project. */ + public project: string; + + /** DeleteTargetInstanceRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetInstanceRequest targetInstance. */ + public targetInstance: string; + + /** DeleteTargetInstanceRequest zone. */ + public zone: string; + + /** DeleteTargetInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetInstanceRequest): google.cloud.compute.v1.DeleteTargetInstanceRequest; + + /** + * Encodes the specified DeleteTargetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetInstanceRequest.verify|verify} messages. + * @param message DeleteTargetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetInstanceRequest.verify|verify} messages. + * @param message DeleteTargetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetInstanceRequest; + + /** + * Decodes a DeleteTargetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetInstanceRequest; + + /** + * Verifies a DeleteTargetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetInstanceRequest; + + /** + * Creates a plain object from a DeleteTargetInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteTargetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetInstanceRequest. */ + interface IGetTargetInstanceRequest { + + /** GetTargetInstanceRequest project */ + project?: (string|null); + + /** GetTargetInstanceRequest targetInstance */ + targetInstance?: (string|null); + + /** GetTargetInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents a GetTargetInstanceRequest. */ + class GetTargetInstanceRequest implements IGetTargetInstanceRequest { + + /** + * Constructs a new GetTargetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetInstanceRequest); + + /** GetTargetInstanceRequest project. */ + public project: string; + + /** GetTargetInstanceRequest targetInstance. */ + public targetInstance: string; + + /** GetTargetInstanceRequest zone. */ + public zone: string; + + /** + * Creates a new GetTargetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetInstanceRequest): google.cloud.compute.v1.GetTargetInstanceRequest; + + /** + * Encodes the specified GetTargetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetInstanceRequest.verify|verify} messages. + * @param message GetTargetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetInstanceRequest.verify|verify} messages. + * @param message GetTargetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetInstanceRequest; + + /** + * Decodes a GetTargetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetInstanceRequest; + + /** + * Verifies a GetTargetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetInstanceRequest; + + /** + * Creates a plain object from a GetTargetInstanceRequest message. Also converts values to other types if specified. + * @param message GetTargetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetInstanceRequest. */ + interface IInsertTargetInstanceRequest { + + /** InsertTargetInstanceRequest project */ + project?: (string|null); + + /** InsertTargetInstanceRequest requestId */ + requestId?: (string|null); + + /** InsertTargetInstanceRequest targetInstanceResource */ + targetInstanceResource?: (google.cloud.compute.v1.ITargetInstance|null); + + /** InsertTargetInstanceRequest zone */ + zone?: (string|null); + } + + /** Represents an InsertTargetInstanceRequest. */ + class InsertTargetInstanceRequest implements IInsertTargetInstanceRequest { + + /** + * Constructs a new InsertTargetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetInstanceRequest); + + /** InsertTargetInstanceRequest project. */ + public project: string; + + /** InsertTargetInstanceRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetInstanceRequest targetInstanceResource. */ + public targetInstanceResource?: (google.cloud.compute.v1.ITargetInstance|null); + + /** InsertTargetInstanceRequest zone. */ + public zone: string; + + /** InsertTargetInstanceRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetInstanceRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetInstanceRequest): google.cloud.compute.v1.InsertTargetInstanceRequest; + + /** + * Encodes the specified InsertTargetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetInstanceRequest.verify|verify} messages. + * @param message InsertTargetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetInstanceRequest.verify|verify} messages. + * @param message InsertTargetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetInstanceRequest; + + /** + * Decodes an InsertTargetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetInstanceRequest; + + /** + * Verifies an InsertTargetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetInstanceRequest; + + /** + * Creates a plain object from an InsertTargetInstanceRequest message. Also converts values to other types if specified. + * @param message InsertTargetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetInstancesRequest. */ + interface IListTargetInstancesRequest { + + /** ListTargetInstancesRequest filter */ + filter?: (string|null); + + /** ListTargetInstancesRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetInstancesRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetInstancesRequest project */ + project?: (string|null); + + /** ListTargetInstancesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListTargetInstancesRequest zone */ + zone?: (string|null); + } + + /** Represents a ListTargetInstancesRequest. */ + class ListTargetInstancesRequest implements IListTargetInstancesRequest { + + /** + * Constructs a new ListTargetInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetInstancesRequest); + + /** ListTargetInstancesRequest filter. */ + public filter?: (string|null); + + /** ListTargetInstancesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetInstancesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetInstancesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetInstancesRequest project. */ + public project: string; + + /** ListTargetInstancesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetInstancesRequest zone. */ + public zone: string; + + /** ListTargetInstancesRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetInstancesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetInstancesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetInstancesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetInstancesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetInstancesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetInstancesRequest): google.cloud.compute.v1.ListTargetInstancesRequest; + + /** + * Encodes the specified ListTargetInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetInstancesRequest.verify|verify} messages. + * @param message ListTargetInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetInstancesRequest.verify|verify} messages. + * @param message ListTargetInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetInstancesRequest; + + /** + * Decodes a ListTargetInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetInstancesRequest; + + /** + * Verifies a ListTargetInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetInstancesRequest; + + /** + * Creates a plain object from a ListTargetInstancesRequest message. Also converts values to other types if specified. + * @param message ListTargetInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddHealthCheckTargetPoolRequest. */ + interface IAddHealthCheckTargetPoolRequest { + + /** AddHealthCheckTargetPoolRequest project */ + project?: (string|null); + + /** AddHealthCheckTargetPoolRequest region */ + region?: (string|null); + + /** AddHealthCheckTargetPoolRequest requestId */ + requestId?: (string|null); + + /** AddHealthCheckTargetPoolRequest targetPool */ + targetPool?: (string|null); + + /** AddHealthCheckTargetPoolRequest targetPoolsAddHealthCheckRequestResource */ + targetPoolsAddHealthCheckRequestResource?: (google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest|null); + } + + /** Represents an AddHealthCheckTargetPoolRequest. */ + class AddHealthCheckTargetPoolRequest implements IAddHealthCheckTargetPoolRequest { + + /** + * Constructs a new AddHealthCheckTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest); + + /** AddHealthCheckTargetPoolRequest project. */ + public project: string; + + /** AddHealthCheckTargetPoolRequest region. */ + public region: string; + + /** AddHealthCheckTargetPoolRequest requestId. */ + public requestId?: (string|null); + + /** AddHealthCheckTargetPoolRequest targetPool. */ + public targetPool: string; + + /** AddHealthCheckTargetPoolRequest targetPoolsAddHealthCheckRequestResource. */ + public targetPoolsAddHealthCheckRequestResource?: (google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest|null); + + /** AddHealthCheckTargetPoolRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddHealthCheckTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddHealthCheckTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest): google.cloud.compute.v1.AddHealthCheckTargetPoolRequest; + + /** + * Encodes the specified AddHealthCheckTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.AddHealthCheckTargetPoolRequest.verify|verify} messages. + * @param message AddHealthCheckTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddHealthCheckTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddHealthCheckTargetPoolRequest.verify|verify} messages. + * @param message AddHealthCheckTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddHealthCheckTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddHealthCheckTargetPoolRequest; + + /** + * Decodes an AddHealthCheckTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddHealthCheckTargetPoolRequest; + + /** + * Verifies an AddHealthCheckTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddHealthCheckTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddHealthCheckTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddHealthCheckTargetPoolRequest; + + /** + * Creates a plain object from an AddHealthCheckTargetPoolRequest message. Also converts values to other types if specified. + * @param message AddHealthCheckTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddHealthCheckTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddHealthCheckTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddInstanceTargetPoolRequest. */ + interface IAddInstanceTargetPoolRequest { + + /** AddInstanceTargetPoolRequest project */ + project?: (string|null); + + /** AddInstanceTargetPoolRequest region */ + region?: (string|null); + + /** AddInstanceTargetPoolRequest requestId */ + requestId?: (string|null); + + /** AddInstanceTargetPoolRequest targetPool */ + targetPool?: (string|null); + + /** AddInstanceTargetPoolRequest targetPoolsAddInstanceRequestResource */ + targetPoolsAddInstanceRequestResource?: (google.cloud.compute.v1.ITargetPoolsAddInstanceRequest|null); + } + + /** Represents an AddInstanceTargetPoolRequest. */ + class AddInstanceTargetPoolRequest implements IAddInstanceTargetPoolRequest { + + /** + * Constructs a new AddInstanceTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddInstanceTargetPoolRequest); + + /** AddInstanceTargetPoolRequest project. */ + public project: string; + + /** AddInstanceTargetPoolRequest region. */ + public region: string; + + /** AddInstanceTargetPoolRequest requestId. */ + public requestId?: (string|null); + + /** AddInstanceTargetPoolRequest targetPool. */ + public targetPool: string; + + /** AddInstanceTargetPoolRequest targetPoolsAddInstanceRequestResource. */ + public targetPoolsAddInstanceRequestResource?: (google.cloud.compute.v1.ITargetPoolsAddInstanceRequest|null); + + /** AddInstanceTargetPoolRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddInstanceTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddInstanceTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddInstanceTargetPoolRequest): google.cloud.compute.v1.AddInstanceTargetPoolRequest; + + /** + * Encodes the specified AddInstanceTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.AddInstanceTargetPoolRequest.verify|verify} messages. + * @param message AddInstanceTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddInstanceTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddInstanceTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddInstanceTargetPoolRequest.verify|verify} messages. + * @param message AddInstanceTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddInstanceTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddInstanceTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddInstanceTargetPoolRequest; + + /** + * Decodes an AddInstanceTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddInstanceTargetPoolRequest; + + /** + * Verifies an AddInstanceTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddInstanceTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddInstanceTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddInstanceTargetPoolRequest; + + /** + * Creates a plain object from an AddInstanceTargetPoolRequest message. Also converts values to other types if specified. + * @param message AddInstanceTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddInstanceTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddInstanceTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListTargetPoolsRequest. */ + interface IAggregatedListTargetPoolsRequest { + + /** AggregatedListTargetPoolsRequest filter */ + filter?: (string|null); + + /** AggregatedListTargetPoolsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListTargetPoolsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListTargetPoolsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListTargetPoolsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListTargetPoolsRequest project */ + project?: (string|null); + + /** AggregatedListTargetPoolsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListTargetPoolsRequest. */ + class AggregatedListTargetPoolsRequest implements IAggregatedListTargetPoolsRequest { + + /** + * Constructs a new AggregatedListTargetPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListTargetPoolsRequest); + + /** AggregatedListTargetPoolsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListTargetPoolsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListTargetPoolsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListTargetPoolsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListTargetPoolsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListTargetPoolsRequest project. */ + public project: string; + + /** AggregatedListTargetPoolsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListTargetPoolsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListTargetPoolsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListTargetPoolsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListTargetPoolsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListTargetPoolsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListTargetPoolsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListTargetPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListTargetPoolsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListTargetPoolsRequest): google.cloud.compute.v1.AggregatedListTargetPoolsRequest; + + /** + * Encodes the specified AggregatedListTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetPoolsRequest.verify|verify} messages. + * @param message AggregatedListTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetPoolsRequest.verify|verify} messages. + * @param message AggregatedListTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListTargetPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListTargetPoolsRequest; + + /** + * Decodes an AggregatedListTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListTargetPoolsRequest; + + /** + * Verifies an AggregatedListTargetPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListTargetPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListTargetPoolsRequest; + + /** + * Creates a plain object from an AggregatedListTargetPoolsRequest message. Also converts values to other types if specified. + * @param message AggregatedListTargetPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListTargetPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListTargetPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetPoolRequest. */ + interface IDeleteTargetPoolRequest { + + /** DeleteTargetPoolRequest project */ + project?: (string|null); + + /** DeleteTargetPoolRequest region */ + region?: (string|null); + + /** DeleteTargetPoolRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetPoolRequest targetPool */ + targetPool?: (string|null); + } + + /** Represents a DeleteTargetPoolRequest. */ + class DeleteTargetPoolRequest implements IDeleteTargetPoolRequest { + + /** + * Constructs a new DeleteTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetPoolRequest); + + /** DeleteTargetPoolRequest project. */ + public project: string; + + /** DeleteTargetPoolRequest region. */ + public region: string; + + /** DeleteTargetPoolRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetPoolRequest targetPool. */ + public targetPool: string; + + /** DeleteTargetPoolRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetPoolRequest): google.cloud.compute.v1.DeleteTargetPoolRequest; + + /** + * Encodes the specified DeleteTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetPoolRequest.verify|verify} messages. + * @param message DeleteTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetPoolRequest.verify|verify} messages. + * @param message DeleteTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetPoolRequest; + + /** + * Decodes a DeleteTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetPoolRequest; + + /** + * Verifies a DeleteTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetPoolRequest; + + /** + * Creates a plain object from a DeleteTargetPoolRequest message. Also converts values to other types if specified. + * @param message DeleteTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetPoolRequest. */ + interface IGetTargetPoolRequest { + + /** GetTargetPoolRequest project */ + project?: (string|null); + + /** GetTargetPoolRequest region */ + region?: (string|null); + + /** GetTargetPoolRequest targetPool */ + targetPool?: (string|null); + } + + /** Represents a GetTargetPoolRequest. */ + class GetTargetPoolRequest implements IGetTargetPoolRequest { + + /** + * Constructs a new GetTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetPoolRequest); + + /** GetTargetPoolRequest project. */ + public project: string; + + /** GetTargetPoolRequest region. */ + public region: string; + + /** GetTargetPoolRequest targetPool. */ + public targetPool: string; + + /** + * Creates a new GetTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetPoolRequest): google.cloud.compute.v1.GetTargetPoolRequest; + + /** + * Encodes the specified GetTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetPoolRequest.verify|verify} messages. + * @param message GetTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetPoolRequest.verify|verify} messages. + * @param message GetTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetPoolRequest; + + /** + * Decodes a GetTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetPoolRequest; + + /** + * Verifies a GetTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetPoolRequest; + + /** + * Creates a plain object from a GetTargetPoolRequest message. Also converts values to other types if specified. + * @param message GetTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetHealthTargetPoolRequest. */ + interface IGetHealthTargetPoolRequest { + + /** GetHealthTargetPoolRequest instanceReferenceResource */ + instanceReferenceResource?: (google.cloud.compute.v1.IInstanceReference|null); + + /** GetHealthTargetPoolRequest project */ + project?: (string|null); + + /** GetHealthTargetPoolRequest region */ + region?: (string|null); + + /** GetHealthTargetPoolRequest targetPool */ + targetPool?: (string|null); + } + + /** Represents a GetHealthTargetPoolRequest. */ + class GetHealthTargetPoolRequest implements IGetHealthTargetPoolRequest { + + /** + * Constructs a new GetHealthTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetHealthTargetPoolRequest); + + /** GetHealthTargetPoolRequest instanceReferenceResource. */ + public instanceReferenceResource?: (google.cloud.compute.v1.IInstanceReference|null); + + /** GetHealthTargetPoolRequest project. */ + public project: string; + + /** GetHealthTargetPoolRequest region. */ + public region: string; + + /** GetHealthTargetPoolRequest targetPool. */ + public targetPool: string; + + /** + * Creates a new GetHealthTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHealthTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetHealthTargetPoolRequest): google.cloud.compute.v1.GetHealthTargetPoolRequest; + + /** + * Encodes the specified GetHealthTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthTargetPoolRequest.verify|verify} messages. + * @param message GetHealthTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetHealthTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHealthTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthTargetPoolRequest.verify|verify} messages. + * @param message GetHealthTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetHealthTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHealthTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHealthTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetHealthTargetPoolRequest; + + /** + * Decodes a GetHealthTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHealthTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetHealthTargetPoolRequest; + + /** + * Verifies a GetHealthTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHealthTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHealthTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetHealthTargetPoolRequest; + + /** + * Creates a plain object from a GetHealthTargetPoolRequest message. Also converts values to other types if specified. + * @param message GetHealthTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetHealthTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHealthTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetPoolRequest. */ + interface IInsertTargetPoolRequest { + + /** InsertTargetPoolRequest project */ + project?: (string|null); + + /** InsertTargetPoolRequest region */ + region?: (string|null); + + /** InsertTargetPoolRequest requestId */ + requestId?: (string|null); + + /** InsertTargetPoolRequest targetPoolResource */ + targetPoolResource?: (google.cloud.compute.v1.ITargetPool|null); + } + + /** Represents an InsertTargetPoolRequest. */ + class InsertTargetPoolRequest implements IInsertTargetPoolRequest { + + /** + * Constructs a new InsertTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetPoolRequest); + + /** InsertTargetPoolRequest project. */ + public project: string; + + /** InsertTargetPoolRequest region. */ + public region: string; + + /** InsertTargetPoolRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetPoolRequest targetPoolResource. */ + public targetPoolResource?: (google.cloud.compute.v1.ITargetPool|null); + + /** InsertTargetPoolRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetPoolRequest): google.cloud.compute.v1.InsertTargetPoolRequest; + + /** + * Encodes the specified InsertTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetPoolRequest.verify|verify} messages. + * @param message InsertTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetPoolRequest.verify|verify} messages. + * @param message InsertTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetPoolRequest; + + /** + * Decodes an InsertTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetPoolRequest; + + /** + * Verifies an InsertTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetPoolRequest; + + /** + * Creates a plain object from an InsertTargetPoolRequest message. Also converts values to other types if specified. + * @param message InsertTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetPoolsRequest. */ + interface IListTargetPoolsRequest { + + /** ListTargetPoolsRequest filter */ + filter?: (string|null); + + /** ListTargetPoolsRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetPoolsRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetPoolsRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetPoolsRequest project */ + project?: (string|null); + + /** ListTargetPoolsRequest region */ + region?: (string|null); + + /** ListTargetPoolsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListTargetPoolsRequest. */ + class ListTargetPoolsRequest implements IListTargetPoolsRequest { + + /** + * Constructs a new ListTargetPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetPoolsRequest); + + /** ListTargetPoolsRequest filter. */ + public filter?: (string|null); + + /** ListTargetPoolsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetPoolsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetPoolsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetPoolsRequest project. */ + public project: string; + + /** ListTargetPoolsRequest region. */ + public region: string; + + /** ListTargetPoolsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetPoolsRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetPoolsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetPoolsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetPoolsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetPoolsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetPoolsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetPoolsRequest): google.cloud.compute.v1.ListTargetPoolsRequest; + + /** + * Encodes the specified ListTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetPoolsRequest.verify|verify} messages. + * @param message ListTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetPoolsRequest.verify|verify} messages. + * @param message ListTargetPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetPoolsRequest; + + /** + * Decodes a ListTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetPoolsRequest; + + /** + * Verifies a ListTargetPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetPoolsRequest; + + /** + * Creates a plain object from a ListTargetPoolsRequest message. Also converts values to other types if specified. + * @param message ListTargetPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveHealthCheckTargetPoolRequest. */ + interface IRemoveHealthCheckTargetPoolRequest { + + /** RemoveHealthCheckTargetPoolRequest project */ + project?: (string|null); + + /** RemoveHealthCheckTargetPoolRequest region */ + region?: (string|null); + + /** RemoveHealthCheckTargetPoolRequest requestId */ + requestId?: (string|null); + + /** RemoveHealthCheckTargetPoolRequest targetPool */ + targetPool?: (string|null); + + /** RemoveHealthCheckTargetPoolRequest targetPoolsRemoveHealthCheckRequestResource */ + targetPoolsRemoveHealthCheckRequestResource?: (google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest|null); + } + + /** Represents a RemoveHealthCheckTargetPoolRequest. */ + class RemoveHealthCheckTargetPoolRequest implements IRemoveHealthCheckTargetPoolRequest { + + /** + * Constructs a new RemoveHealthCheckTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest); + + /** RemoveHealthCheckTargetPoolRequest project. */ + public project: string; + + /** RemoveHealthCheckTargetPoolRequest region. */ + public region: string; + + /** RemoveHealthCheckTargetPoolRequest requestId. */ + public requestId?: (string|null); + + /** RemoveHealthCheckTargetPoolRequest targetPool. */ + public targetPool: string; + + /** RemoveHealthCheckTargetPoolRequest targetPoolsRemoveHealthCheckRequestResource. */ + public targetPoolsRemoveHealthCheckRequestResource?: (google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest|null); + + /** RemoveHealthCheckTargetPoolRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveHealthCheckTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveHealthCheckTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest): google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest; + + /** + * Encodes the specified RemoveHealthCheckTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest.verify|verify} messages. + * @param message RemoveHealthCheckTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveHealthCheckTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest.verify|verify} messages. + * @param message RemoveHealthCheckTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveHealthCheckTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest; + + /** + * Decodes a RemoveHealthCheckTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest; + + /** + * Verifies a RemoveHealthCheckTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveHealthCheckTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveHealthCheckTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest; + + /** + * Creates a plain object from a RemoveHealthCheckTargetPoolRequest message. Also converts values to other types if specified. + * @param message RemoveHealthCheckTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveHealthCheckTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveInstanceTargetPoolRequest. */ + interface IRemoveInstanceTargetPoolRequest { + + /** RemoveInstanceTargetPoolRequest project */ + project?: (string|null); + + /** RemoveInstanceTargetPoolRequest region */ + region?: (string|null); + + /** RemoveInstanceTargetPoolRequest requestId */ + requestId?: (string|null); + + /** RemoveInstanceTargetPoolRequest targetPool */ + targetPool?: (string|null); + + /** RemoveInstanceTargetPoolRequest targetPoolsRemoveInstanceRequestResource */ + targetPoolsRemoveInstanceRequestResource?: (google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest|null); + } + + /** Represents a RemoveInstanceTargetPoolRequest. */ + class RemoveInstanceTargetPoolRequest implements IRemoveInstanceTargetPoolRequest { + + /** + * Constructs a new RemoveInstanceTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest); + + /** RemoveInstanceTargetPoolRequest project. */ + public project: string; + + /** RemoveInstanceTargetPoolRequest region. */ + public region: string; + + /** RemoveInstanceTargetPoolRequest requestId. */ + public requestId?: (string|null); + + /** RemoveInstanceTargetPoolRequest targetPool. */ + public targetPool: string; + + /** RemoveInstanceTargetPoolRequest targetPoolsRemoveInstanceRequestResource. */ + public targetPoolsRemoveInstanceRequestResource?: (google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest|null); + + /** RemoveInstanceTargetPoolRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemoveInstanceTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveInstanceTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest): google.cloud.compute.v1.RemoveInstanceTargetPoolRequest; + + /** + * Encodes the specified RemoveInstanceTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveInstanceTargetPoolRequest.verify|verify} messages. + * @param message RemoveInstanceTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveInstanceTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveInstanceTargetPoolRequest.verify|verify} messages. + * @param message RemoveInstanceTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveInstanceTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemoveInstanceTargetPoolRequest; + + /** + * Decodes a RemoveInstanceTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemoveInstanceTargetPoolRequest; + + /** + * Verifies a RemoveInstanceTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveInstanceTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveInstanceTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemoveInstanceTargetPoolRequest; + + /** + * Creates a plain object from a RemoveInstanceTargetPoolRequest message. Also converts values to other types if specified. + * @param message RemoveInstanceTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemoveInstanceTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveInstanceTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetBackupTargetPoolRequest. */ + interface ISetBackupTargetPoolRequest { + + /** SetBackupTargetPoolRequest failoverRatio */ + failoverRatio?: (number|null); + + /** SetBackupTargetPoolRequest project */ + project?: (string|null); + + /** SetBackupTargetPoolRequest region */ + region?: (string|null); + + /** SetBackupTargetPoolRequest requestId */ + requestId?: (string|null); + + /** SetBackupTargetPoolRequest targetPool */ + targetPool?: (string|null); + + /** SetBackupTargetPoolRequest targetReferenceResource */ + targetReferenceResource?: (google.cloud.compute.v1.ITargetReference|null); + } + + /** Represents a SetBackupTargetPoolRequest. */ + class SetBackupTargetPoolRequest implements ISetBackupTargetPoolRequest { + + /** + * Constructs a new SetBackupTargetPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetBackupTargetPoolRequest); + + /** SetBackupTargetPoolRequest failoverRatio. */ + public failoverRatio?: (number|null); + + /** SetBackupTargetPoolRequest project. */ + public project: string; + + /** SetBackupTargetPoolRequest region. */ + public region: string; + + /** SetBackupTargetPoolRequest requestId. */ + public requestId?: (string|null); + + /** SetBackupTargetPoolRequest targetPool. */ + public targetPool: string; + + /** SetBackupTargetPoolRequest targetReferenceResource. */ + public targetReferenceResource?: (google.cloud.compute.v1.ITargetReference|null); + + /** SetBackupTargetPoolRequest _failoverRatio. */ + public _failoverRatio?: "failoverRatio"; + + /** SetBackupTargetPoolRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetBackupTargetPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetBackupTargetPoolRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetBackupTargetPoolRequest): google.cloud.compute.v1.SetBackupTargetPoolRequest; + + /** + * Encodes the specified SetBackupTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.SetBackupTargetPoolRequest.verify|verify} messages. + * @param message SetBackupTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetBackupTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetBackupTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetBackupTargetPoolRequest.verify|verify} messages. + * @param message SetBackupTargetPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetBackupTargetPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetBackupTargetPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetBackupTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetBackupTargetPoolRequest; + + /** + * Decodes a SetBackupTargetPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetBackupTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetBackupTargetPoolRequest; + + /** + * Verifies a SetBackupTargetPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetBackupTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetBackupTargetPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetBackupTargetPoolRequest; + + /** + * Creates a plain object from a SetBackupTargetPoolRequest message. Also converts values to other types if specified. + * @param message SetBackupTargetPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetBackupTargetPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetBackupTargetPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetSslProxyRequest. */ + interface IDeleteTargetSslProxyRequest { + + /** DeleteTargetSslProxyRequest project */ + project?: (string|null); + + /** DeleteTargetSslProxyRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetSslProxyRequest targetSslProxy */ + targetSslProxy?: (string|null); + } + + /** Represents a DeleteTargetSslProxyRequest. */ + class DeleteTargetSslProxyRequest implements IDeleteTargetSslProxyRequest { + + /** + * Constructs a new DeleteTargetSslProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetSslProxyRequest); + + /** DeleteTargetSslProxyRequest project. */ + public project: string; + + /** DeleteTargetSslProxyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetSslProxyRequest targetSslProxy. */ + public targetSslProxy: string; + + /** DeleteTargetSslProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetSslProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetSslProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetSslProxyRequest): google.cloud.compute.v1.DeleteTargetSslProxyRequest; + + /** + * Encodes the specified DeleteTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetSslProxyRequest.verify|verify} messages. + * @param message DeleteTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetSslProxyRequest.verify|verify} messages. + * @param message DeleteTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetSslProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetSslProxyRequest; + + /** + * Decodes a DeleteTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetSslProxyRequest; + + /** + * Verifies a DeleteTargetSslProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetSslProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetSslProxyRequest; + + /** + * Creates a plain object from a DeleteTargetSslProxyRequest message. Also converts values to other types if specified. + * @param message DeleteTargetSslProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetSslProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetSslProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetSslProxyRequest. */ + interface IGetTargetSslProxyRequest { + + /** GetTargetSslProxyRequest project */ + project?: (string|null); + + /** GetTargetSslProxyRequest targetSslProxy */ + targetSslProxy?: (string|null); + } + + /** Represents a GetTargetSslProxyRequest. */ + class GetTargetSslProxyRequest implements IGetTargetSslProxyRequest { + + /** + * Constructs a new GetTargetSslProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetSslProxyRequest); + + /** GetTargetSslProxyRequest project. */ + public project: string; + + /** GetTargetSslProxyRequest targetSslProxy. */ + public targetSslProxy: string; + + /** + * Creates a new GetTargetSslProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetSslProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetSslProxyRequest): google.cloud.compute.v1.GetTargetSslProxyRequest; + + /** + * Encodes the specified GetTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetSslProxyRequest.verify|verify} messages. + * @param message GetTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetSslProxyRequest.verify|verify} messages. + * @param message GetTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetSslProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetSslProxyRequest; + + /** + * Decodes a GetTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetSslProxyRequest; + + /** + * Verifies a GetTargetSslProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetSslProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetSslProxyRequest; + + /** + * Creates a plain object from a GetTargetSslProxyRequest message. Also converts values to other types if specified. + * @param message GetTargetSslProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetSslProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetSslProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetSslProxyRequest. */ + interface IInsertTargetSslProxyRequest { + + /** InsertTargetSslProxyRequest project */ + project?: (string|null); + + /** InsertTargetSslProxyRequest requestId */ + requestId?: (string|null); + + /** InsertTargetSslProxyRequest targetSslProxyResource */ + targetSslProxyResource?: (google.cloud.compute.v1.ITargetSslProxy|null); + } + + /** Represents an InsertTargetSslProxyRequest. */ + class InsertTargetSslProxyRequest implements IInsertTargetSslProxyRequest { + + /** + * Constructs a new InsertTargetSslProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetSslProxyRequest); + + /** InsertTargetSslProxyRequest project. */ + public project: string; + + /** InsertTargetSslProxyRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetSslProxyRequest targetSslProxyResource. */ + public targetSslProxyResource?: (google.cloud.compute.v1.ITargetSslProxy|null); + + /** InsertTargetSslProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetSslProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetSslProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetSslProxyRequest): google.cloud.compute.v1.InsertTargetSslProxyRequest; + + /** + * Encodes the specified InsertTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetSslProxyRequest.verify|verify} messages. + * @param message InsertTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetSslProxyRequest.verify|verify} messages. + * @param message InsertTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetSslProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetSslProxyRequest; + + /** + * Decodes an InsertTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetSslProxyRequest; + + /** + * Verifies an InsertTargetSslProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetSslProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetSslProxyRequest; + + /** + * Creates a plain object from an InsertTargetSslProxyRequest message. Also converts values to other types if specified. + * @param message InsertTargetSslProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetSslProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetSslProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetSslProxiesRequest. */ + interface IListTargetSslProxiesRequest { + + /** ListTargetSslProxiesRequest filter */ + filter?: (string|null); + + /** ListTargetSslProxiesRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetSslProxiesRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetSslProxiesRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetSslProxiesRequest project */ + project?: (string|null); + + /** ListTargetSslProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListTargetSslProxiesRequest. */ + class ListTargetSslProxiesRequest implements IListTargetSslProxiesRequest { + + /** + * Constructs a new ListTargetSslProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetSslProxiesRequest); + + /** ListTargetSslProxiesRequest filter. */ + public filter?: (string|null); + + /** ListTargetSslProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetSslProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetSslProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetSslProxiesRequest project. */ + public project: string; + + /** ListTargetSslProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetSslProxiesRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetSslProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetSslProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetSslProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetSslProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetSslProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetSslProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetSslProxiesRequest): google.cloud.compute.v1.ListTargetSslProxiesRequest; + + /** + * Encodes the specified ListTargetSslProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetSslProxiesRequest.verify|verify} messages. + * @param message ListTargetSslProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetSslProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetSslProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetSslProxiesRequest.verify|verify} messages. + * @param message ListTargetSslProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetSslProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetSslProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetSslProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetSslProxiesRequest; + + /** + * Decodes a ListTargetSslProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetSslProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetSslProxiesRequest; + + /** + * Verifies a ListTargetSslProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetSslProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetSslProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetSslProxiesRequest; + + /** + * Creates a plain object from a ListTargetSslProxiesRequest message. Also converts values to other types if specified. + * @param message ListTargetSslProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetSslProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetSslProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetBackendServiceTargetSslProxyRequest. */ + interface ISetBackendServiceTargetSslProxyRequest { + + /** SetBackendServiceTargetSslProxyRequest project */ + project?: (string|null); + + /** SetBackendServiceTargetSslProxyRequest requestId */ + requestId?: (string|null); + + /** SetBackendServiceTargetSslProxyRequest targetSslProxiesSetBackendServiceRequestResource */ + targetSslProxiesSetBackendServiceRequestResource?: (google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest|null); + + /** SetBackendServiceTargetSslProxyRequest targetSslProxy */ + targetSslProxy?: (string|null); + } + + /** Represents a SetBackendServiceTargetSslProxyRequest. */ + class SetBackendServiceTargetSslProxyRequest implements ISetBackendServiceTargetSslProxyRequest { + + /** + * Constructs a new SetBackendServiceTargetSslProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest); + + /** SetBackendServiceTargetSslProxyRequest project. */ + public project: string; + + /** SetBackendServiceTargetSslProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetBackendServiceTargetSslProxyRequest targetSslProxiesSetBackendServiceRequestResource. */ + public targetSslProxiesSetBackendServiceRequestResource?: (google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest|null); + + /** SetBackendServiceTargetSslProxyRequest targetSslProxy. */ + public targetSslProxy: string; + + /** SetBackendServiceTargetSslProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetBackendServiceTargetSslProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetBackendServiceTargetSslProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest): google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest; + + /** + * Encodes the specified SetBackendServiceTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest.verify|verify} messages. + * @param message SetBackendServiceTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetBackendServiceTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest.verify|verify} messages. + * @param message SetBackendServiceTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetBackendServiceTargetSslProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetBackendServiceTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest; + + /** + * Decodes a SetBackendServiceTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetBackendServiceTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest; + + /** + * Verifies a SetBackendServiceTargetSslProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetBackendServiceTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetBackendServiceTargetSslProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest; + + /** + * Creates a plain object from a SetBackendServiceTargetSslProxyRequest message. Also converts values to other types if specified. + * @param message SetBackendServiceTargetSslProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetBackendServiceTargetSslProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetProxyHeaderTargetSslProxyRequest. */ + interface ISetProxyHeaderTargetSslProxyRequest { + + /** SetProxyHeaderTargetSslProxyRequest project */ + project?: (string|null); + + /** SetProxyHeaderTargetSslProxyRequest requestId */ + requestId?: (string|null); + + /** SetProxyHeaderTargetSslProxyRequest targetSslProxiesSetProxyHeaderRequestResource */ + targetSslProxiesSetProxyHeaderRequestResource?: (google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest|null); + + /** SetProxyHeaderTargetSslProxyRequest targetSslProxy */ + targetSslProxy?: (string|null); + } + + /** Represents a SetProxyHeaderTargetSslProxyRequest. */ + class SetProxyHeaderTargetSslProxyRequest implements ISetProxyHeaderTargetSslProxyRequest { + + /** + * Constructs a new SetProxyHeaderTargetSslProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest); + + /** SetProxyHeaderTargetSslProxyRequest project. */ + public project: string; + + /** SetProxyHeaderTargetSslProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetProxyHeaderTargetSslProxyRequest targetSslProxiesSetProxyHeaderRequestResource. */ + public targetSslProxiesSetProxyHeaderRequestResource?: (google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest|null); + + /** SetProxyHeaderTargetSslProxyRequest targetSslProxy. */ + public targetSslProxy: string; + + /** SetProxyHeaderTargetSslProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetProxyHeaderTargetSslProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetProxyHeaderTargetSslProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest): google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest; + + /** + * Encodes the specified SetProxyHeaderTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest.verify|verify} messages. + * @param message SetProxyHeaderTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetProxyHeaderTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest.verify|verify} messages. + * @param message SetProxyHeaderTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetProxyHeaderTargetSslProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetProxyHeaderTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest; + + /** + * Decodes a SetProxyHeaderTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetProxyHeaderTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest; + + /** + * Verifies a SetProxyHeaderTargetSslProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetProxyHeaderTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetProxyHeaderTargetSslProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest; + + /** + * Creates a plain object from a SetProxyHeaderTargetSslProxyRequest message. Also converts values to other types if specified. + * @param message SetProxyHeaderTargetSslProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetProxyHeaderTargetSslProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetSslCertificatesTargetSslProxyRequest. */ + interface ISetSslCertificatesTargetSslProxyRequest { + + /** SetSslCertificatesTargetSslProxyRequest project */ + project?: (string|null); + + /** SetSslCertificatesTargetSslProxyRequest requestId */ + requestId?: (string|null); + + /** SetSslCertificatesTargetSslProxyRequest targetSslProxiesSetSslCertificatesRequestResource */ + targetSslProxiesSetSslCertificatesRequestResource?: (google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest|null); + + /** SetSslCertificatesTargetSslProxyRequest targetSslProxy */ + targetSslProxy?: (string|null); + } + + /** Represents a SetSslCertificatesTargetSslProxyRequest. */ + class SetSslCertificatesTargetSslProxyRequest implements ISetSslCertificatesTargetSslProxyRequest { + + /** + * Constructs a new SetSslCertificatesTargetSslProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest); + + /** SetSslCertificatesTargetSslProxyRequest project. */ + public project: string; + + /** SetSslCertificatesTargetSslProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetSslCertificatesTargetSslProxyRequest targetSslProxiesSetSslCertificatesRequestResource. */ + public targetSslProxiesSetSslCertificatesRequestResource?: (google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest|null); + + /** SetSslCertificatesTargetSslProxyRequest targetSslProxy. */ + public targetSslProxy: string; + + /** SetSslCertificatesTargetSslProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetSslCertificatesTargetSslProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetSslCertificatesTargetSslProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest): google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest; + + /** + * Encodes the specified SetSslCertificatesTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest.verify|verify} messages. + * @param message SetSslCertificatesTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetSslCertificatesTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest.verify|verify} messages. + * @param message SetSslCertificatesTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetSslCertificatesTargetSslProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetSslCertificatesTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest; + + /** + * Decodes a SetSslCertificatesTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetSslCertificatesTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest; + + /** + * Verifies a SetSslCertificatesTargetSslProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetSslCertificatesTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetSslCertificatesTargetSslProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest; + + /** + * Creates a plain object from a SetSslCertificatesTargetSslProxyRequest message. Also converts values to other types if specified. + * @param message SetSslCertificatesTargetSslProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetSslCertificatesTargetSslProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetSslPolicyTargetSslProxyRequest. */ + interface ISetSslPolicyTargetSslProxyRequest { + + /** SetSslPolicyTargetSslProxyRequest project */ + project?: (string|null); + + /** SetSslPolicyTargetSslProxyRequest requestId */ + requestId?: (string|null); + + /** SetSslPolicyTargetSslProxyRequest sslPolicyReferenceResource */ + sslPolicyReferenceResource?: (google.cloud.compute.v1.ISslPolicyReference|null); + + /** SetSslPolicyTargetSslProxyRequest targetSslProxy */ + targetSslProxy?: (string|null); + } + + /** Represents a SetSslPolicyTargetSslProxyRequest. */ + class SetSslPolicyTargetSslProxyRequest implements ISetSslPolicyTargetSslProxyRequest { + + /** + * Constructs a new SetSslPolicyTargetSslProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest); + + /** SetSslPolicyTargetSslProxyRequest project. */ + public project: string; + + /** SetSslPolicyTargetSslProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetSslPolicyTargetSslProxyRequest sslPolicyReferenceResource. */ + public sslPolicyReferenceResource?: (google.cloud.compute.v1.ISslPolicyReference|null); + + /** SetSslPolicyTargetSslProxyRequest targetSslProxy. */ + public targetSslProxy: string; + + /** SetSslPolicyTargetSslProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetSslPolicyTargetSslProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetSslPolicyTargetSslProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest): google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest; + + /** + * Encodes the specified SetSslPolicyTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest.verify|verify} messages. + * @param message SetSslPolicyTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetSslPolicyTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest.verify|verify} messages. + * @param message SetSslPolicyTargetSslProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetSslPolicyTargetSslProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetSslPolicyTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest; + + /** + * Decodes a SetSslPolicyTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetSslPolicyTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest; + + /** + * Verifies a SetSslPolicyTargetSslProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetSslPolicyTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetSslPolicyTargetSslProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest; + + /** + * Creates a plain object from a SetSslPolicyTargetSslProxyRequest message. Also converts values to other types if specified. + * @param message SetSslPolicyTargetSslProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetSslPolicyTargetSslProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetTcpProxyRequest. */ + interface IDeleteTargetTcpProxyRequest { + + /** DeleteTargetTcpProxyRequest project */ + project?: (string|null); + + /** DeleteTargetTcpProxyRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetTcpProxyRequest targetTcpProxy */ + targetTcpProxy?: (string|null); + } + + /** Represents a DeleteTargetTcpProxyRequest. */ + class DeleteTargetTcpProxyRequest implements IDeleteTargetTcpProxyRequest { + + /** + * Constructs a new DeleteTargetTcpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetTcpProxyRequest); + + /** DeleteTargetTcpProxyRequest project. */ + public project: string; + + /** DeleteTargetTcpProxyRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetTcpProxyRequest targetTcpProxy. */ + public targetTcpProxy: string; + + /** DeleteTargetTcpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetTcpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetTcpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetTcpProxyRequest): google.cloud.compute.v1.DeleteTargetTcpProxyRequest; + + /** + * Encodes the specified DeleteTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetTcpProxyRequest.verify|verify} messages. + * @param message DeleteTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetTcpProxyRequest.verify|verify} messages. + * @param message DeleteTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetTcpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetTcpProxyRequest; + + /** + * Decodes a DeleteTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetTcpProxyRequest; + + /** + * Verifies a DeleteTargetTcpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetTcpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetTcpProxyRequest; + + /** + * Creates a plain object from a DeleteTargetTcpProxyRequest message. Also converts values to other types if specified. + * @param message DeleteTargetTcpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetTcpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetTcpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetTcpProxyRequest. */ + interface IGetTargetTcpProxyRequest { + + /** GetTargetTcpProxyRequest project */ + project?: (string|null); + + /** GetTargetTcpProxyRequest targetTcpProxy */ + targetTcpProxy?: (string|null); + } + + /** Represents a GetTargetTcpProxyRequest. */ + class GetTargetTcpProxyRequest implements IGetTargetTcpProxyRequest { + + /** + * Constructs a new GetTargetTcpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetTcpProxyRequest); + + /** GetTargetTcpProxyRequest project. */ + public project: string; + + /** GetTargetTcpProxyRequest targetTcpProxy. */ + public targetTcpProxy: string; + + /** + * Creates a new GetTargetTcpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetTcpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetTcpProxyRequest): google.cloud.compute.v1.GetTargetTcpProxyRequest; + + /** + * Encodes the specified GetTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetTcpProxyRequest.verify|verify} messages. + * @param message GetTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetTcpProxyRequest.verify|verify} messages. + * @param message GetTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetTcpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetTcpProxyRequest; + + /** + * Decodes a GetTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetTcpProxyRequest; + + /** + * Verifies a GetTargetTcpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetTcpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetTcpProxyRequest; + + /** + * Creates a plain object from a GetTargetTcpProxyRequest message. Also converts values to other types if specified. + * @param message GetTargetTcpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetTcpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetTcpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetTcpProxyRequest. */ + interface IInsertTargetTcpProxyRequest { + + /** InsertTargetTcpProxyRequest project */ + project?: (string|null); + + /** InsertTargetTcpProxyRequest requestId */ + requestId?: (string|null); + + /** InsertTargetTcpProxyRequest targetTcpProxyResource */ + targetTcpProxyResource?: (google.cloud.compute.v1.ITargetTcpProxy|null); + } + + /** Represents an InsertTargetTcpProxyRequest. */ + class InsertTargetTcpProxyRequest implements IInsertTargetTcpProxyRequest { + + /** + * Constructs a new InsertTargetTcpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetTcpProxyRequest); + + /** InsertTargetTcpProxyRequest project. */ + public project: string; + + /** InsertTargetTcpProxyRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetTcpProxyRequest targetTcpProxyResource. */ + public targetTcpProxyResource?: (google.cloud.compute.v1.ITargetTcpProxy|null); + + /** InsertTargetTcpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetTcpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetTcpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetTcpProxyRequest): google.cloud.compute.v1.InsertTargetTcpProxyRequest; + + /** + * Encodes the specified InsertTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetTcpProxyRequest.verify|verify} messages. + * @param message InsertTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetTcpProxyRequest.verify|verify} messages. + * @param message InsertTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetTcpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetTcpProxyRequest; + + /** + * Decodes an InsertTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetTcpProxyRequest; + + /** + * Verifies an InsertTargetTcpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetTcpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetTcpProxyRequest; + + /** + * Creates a plain object from an InsertTargetTcpProxyRequest message. Also converts values to other types if specified. + * @param message InsertTargetTcpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetTcpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetTcpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetTcpProxiesRequest. */ + interface IListTargetTcpProxiesRequest { + + /** ListTargetTcpProxiesRequest filter */ + filter?: (string|null); + + /** ListTargetTcpProxiesRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetTcpProxiesRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetTcpProxiesRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetTcpProxiesRequest project */ + project?: (string|null); + + /** ListTargetTcpProxiesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListTargetTcpProxiesRequest. */ + class ListTargetTcpProxiesRequest implements IListTargetTcpProxiesRequest { + + /** + * Constructs a new ListTargetTcpProxiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetTcpProxiesRequest); + + /** ListTargetTcpProxiesRequest filter. */ + public filter?: (string|null); + + /** ListTargetTcpProxiesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetTcpProxiesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetTcpProxiesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetTcpProxiesRequest project. */ + public project: string; + + /** ListTargetTcpProxiesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetTcpProxiesRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetTcpProxiesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetTcpProxiesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetTcpProxiesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetTcpProxiesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetTcpProxiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetTcpProxiesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetTcpProxiesRequest): google.cloud.compute.v1.ListTargetTcpProxiesRequest; + + /** + * Encodes the specified ListTargetTcpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetTcpProxiesRequest.verify|verify} messages. + * @param message ListTargetTcpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetTcpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetTcpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetTcpProxiesRequest.verify|verify} messages. + * @param message ListTargetTcpProxiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetTcpProxiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetTcpProxiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetTcpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetTcpProxiesRequest; + + /** + * Decodes a ListTargetTcpProxiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetTcpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetTcpProxiesRequest; + + /** + * Verifies a ListTargetTcpProxiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetTcpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetTcpProxiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetTcpProxiesRequest; + + /** + * Creates a plain object from a ListTargetTcpProxiesRequest message. Also converts values to other types if specified. + * @param message ListTargetTcpProxiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetTcpProxiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetTcpProxiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetBackendServiceTargetTcpProxyRequest. */ + interface ISetBackendServiceTargetTcpProxyRequest { + + /** SetBackendServiceTargetTcpProxyRequest project */ + project?: (string|null); + + /** SetBackendServiceTargetTcpProxyRequest requestId */ + requestId?: (string|null); + + /** SetBackendServiceTargetTcpProxyRequest targetTcpProxiesSetBackendServiceRequestResource */ + targetTcpProxiesSetBackendServiceRequestResource?: (google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest|null); + + /** SetBackendServiceTargetTcpProxyRequest targetTcpProxy */ + targetTcpProxy?: (string|null); + } + + /** Represents a SetBackendServiceTargetTcpProxyRequest. */ + class SetBackendServiceTargetTcpProxyRequest implements ISetBackendServiceTargetTcpProxyRequest { + + /** + * Constructs a new SetBackendServiceTargetTcpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest); + + /** SetBackendServiceTargetTcpProxyRequest project. */ + public project: string; + + /** SetBackendServiceTargetTcpProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetBackendServiceTargetTcpProxyRequest targetTcpProxiesSetBackendServiceRequestResource. */ + public targetTcpProxiesSetBackendServiceRequestResource?: (google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest|null); + + /** SetBackendServiceTargetTcpProxyRequest targetTcpProxy. */ + public targetTcpProxy: string; + + /** SetBackendServiceTargetTcpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetBackendServiceTargetTcpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetBackendServiceTargetTcpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest): google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest; + + /** + * Encodes the specified SetBackendServiceTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest.verify|verify} messages. + * @param message SetBackendServiceTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetBackendServiceTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest.verify|verify} messages. + * @param message SetBackendServiceTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetBackendServiceTargetTcpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetBackendServiceTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest; + + /** + * Decodes a SetBackendServiceTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetBackendServiceTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest; + + /** + * Verifies a SetBackendServiceTargetTcpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetBackendServiceTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetBackendServiceTargetTcpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest; + + /** + * Creates a plain object from a SetBackendServiceTargetTcpProxyRequest message. Also converts values to other types if specified. + * @param message SetBackendServiceTargetTcpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetBackendServiceTargetTcpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetProxyHeaderTargetTcpProxyRequest. */ + interface ISetProxyHeaderTargetTcpProxyRequest { + + /** SetProxyHeaderTargetTcpProxyRequest project */ + project?: (string|null); + + /** SetProxyHeaderTargetTcpProxyRequest requestId */ + requestId?: (string|null); + + /** SetProxyHeaderTargetTcpProxyRequest targetTcpProxiesSetProxyHeaderRequestResource */ + targetTcpProxiesSetProxyHeaderRequestResource?: (google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest|null); + + /** SetProxyHeaderTargetTcpProxyRequest targetTcpProxy */ + targetTcpProxy?: (string|null); + } + + /** Represents a SetProxyHeaderTargetTcpProxyRequest. */ + class SetProxyHeaderTargetTcpProxyRequest implements ISetProxyHeaderTargetTcpProxyRequest { + + /** + * Constructs a new SetProxyHeaderTargetTcpProxyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest); + + /** SetProxyHeaderTargetTcpProxyRequest project. */ + public project: string; + + /** SetProxyHeaderTargetTcpProxyRequest requestId. */ + public requestId?: (string|null); + + /** SetProxyHeaderTargetTcpProxyRequest targetTcpProxiesSetProxyHeaderRequestResource. */ + public targetTcpProxiesSetProxyHeaderRequestResource?: (google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest|null); + + /** SetProxyHeaderTargetTcpProxyRequest targetTcpProxy. */ + public targetTcpProxy: string; + + /** SetProxyHeaderTargetTcpProxyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetProxyHeaderTargetTcpProxyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetProxyHeaderTargetTcpProxyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest): google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest; + + /** + * Encodes the specified SetProxyHeaderTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest.verify|verify} messages. + * @param message SetProxyHeaderTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetProxyHeaderTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest.verify|verify} messages. + * @param message SetProxyHeaderTargetTcpProxyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetProxyHeaderTargetTcpProxyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetProxyHeaderTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest; + + /** + * Decodes a SetProxyHeaderTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetProxyHeaderTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest; + + /** + * Verifies a SetProxyHeaderTargetTcpProxyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetProxyHeaderTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetProxyHeaderTargetTcpProxyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest; + + /** + * Creates a plain object from a SetProxyHeaderTargetTcpProxyRequest message. Also converts values to other types if specified. + * @param message SetProxyHeaderTargetTcpProxyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetProxyHeaderTargetTcpProxyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListTargetVpnGatewaysRequest. */ + interface IAggregatedListTargetVpnGatewaysRequest { + + /** AggregatedListTargetVpnGatewaysRequest filter */ + filter?: (string|null); + + /** AggregatedListTargetVpnGatewaysRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListTargetVpnGatewaysRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListTargetVpnGatewaysRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListTargetVpnGatewaysRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListTargetVpnGatewaysRequest project */ + project?: (string|null); + + /** AggregatedListTargetVpnGatewaysRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListTargetVpnGatewaysRequest. */ + class AggregatedListTargetVpnGatewaysRequest implements IAggregatedListTargetVpnGatewaysRequest { + + /** + * Constructs a new AggregatedListTargetVpnGatewaysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest); + + /** AggregatedListTargetVpnGatewaysRequest filter. */ + public filter?: (string|null); + + /** AggregatedListTargetVpnGatewaysRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListTargetVpnGatewaysRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListTargetVpnGatewaysRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListTargetVpnGatewaysRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListTargetVpnGatewaysRequest project. */ + public project: string; + + /** AggregatedListTargetVpnGatewaysRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListTargetVpnGatewaysRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListTargetVpnGatewaysRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListTargetVpnGatewaysRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListTargetVpnGatewaysRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListTargetVpnGatewaysRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListTargetVpnGatewaysRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListTargetVpnGatewaysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListTargetVpnGatewaysRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest): google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest; + + /** + * Encodes the specified AggregatedListTargetVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest.verify|verify} messages. + * @param message AggregatedListTargetVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListTargetVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest.verify|verify} messages. + * @param message AggregatedListTargetVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListTargetVpnGatewaysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest; + + /** + * Decodes an AggregatedListTargetVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest; + + /** + * Verifies an AggregatedListTargetVpnGatewaysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListTargetVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListTargetVpnGatewaysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest; + + /** + * Creates a plain object from an AggregatedListTargetVpnGatewaysRequest message. Also converts values to other types if specified. + * @param message AggregatedListTargetVpnGatewaysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListTargetVpnGatewaysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteTargetVpnGatewayRequest. */ + interface IDeleteTargetVpnGatewayRequest { + + /** DeleteTargetVpnGatewayRequest project */ + project?: (string|null); + + /** DeleteTargetVpnGatewayRequest region */ + region?: (string|null); + + /** DeleteTargetVpnGatewayRequest requestId */ + requestId?: (string|null); + + /** DeleteTargetVpnGatewayRequest targetVpnGateway */ + targetVpnGateway?: (string|null); + } + + /** Represents a DeleteTargetVpnGatewayRequest. */ + class DeleteTargetVpnGatewayRequest implements IDeleteTargetVpnGatewayRequest { + + /** + * Constructs a new DeleteTargetVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest); + + /** DeleteTargetVpnGatewayRequest project. */ + public project: string; + + /** DeleteTargetVpnGatewayRequest region. */ + public region: string; + + /** DeleteTargetVpnGatewayRequest requestId. */ + public requestId?: (string|null); + + /** DeleteTargetVpnGatewayRequest targetVpnGateway. */ + public targetVpnGateway: string; + + /** DeleteTargetVpnGatewayRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteTargetVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTargetVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest): google.cloud.compute.v1.DeleteTargetVpnGatewayRequest; + + /** + * Encodes the specified DeleteTargetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetVpnGatewayRequest.verify|verify} messages. + * @param message DeleteTargetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTargetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetVpnGatewayRequest.verify|verify} messages. + * @param message DeleteTargetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTargetVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteTargetVpnGatewayRequest; + + /** + * Decodes a DeleteTargetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteTargetVpnGatewayRequest; + + /** + * Verifies a DeleteTargetVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTargetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTargetVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteTargetVpnGatewayRequest; + + /** + * Creates a plain object from a DeleteTargetVpnGatewayRequest message. Also converts values to other types if specified. + * @param message DeleteTargetVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteTargetVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTargetVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetTargetVpnGatewayRequest. */ + interface IGetTargetVpnGatewayRequest { + + /** GetTargetVpnGatewayRequest project */ + project?: (string|null); + + /** GetTargetVpnGatewayRequest region */ + region?: (string|null); + + /** GetTargetVpnGatewayRequest targetVpnGateway */ + targetVpnGateway?: (string|null); + } + + /** Represents a GetTargetVpnGatewayRequest. */ + class GetTargetVpnGatewayRequest implements IGetTargetVpnGatewayRequest { + + /** + * Constructs a new GetTargetVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetTargetVpnGatewayRequest); + + /** GetTargetVpnGatewayRequest project. */ + public project: string; + + /** GetTargetVpnGatewayRequest region. */ + public region: string; + + /** GetTargetVpnGatewayRequest targetVpnGateway. */ + public targetVpnGateway: string; + + /** + * Creates a new GetTargetVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTargetVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetTargetVpnGatewayRequest): google.cloud.compute.v1.GetTargetVpnGatewayRequest; + + /** + * Encodes the specified GetTargetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetVpnGatewayRequest.verify|verify} messages. + * @param message GetTargetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetTargetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTargetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetVpnGatewayRequest.verify|verify} messages. + * @param message GetTargetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetTargetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTargetVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetTargetVpnGatewayRequest; + + /** + * Decodes a GetTargetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetTargetVpnGatewayRequest; + + /** + * Verifies a GetTargetVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTargetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTargetVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetTargetVpnGatewayRequest; + + /** + * Creates a plain object from a GetTargetVpnGatewayRequest message. Also converts values to other types if specified. + * @param message GetTargetVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetTargetVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTargetVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertTargetVpnGatewayRequest. */ + interface IInsertTargetVpnGatewayRequest { + + /** InsertTargetVpnGatewayRequest project */ + project?: (string|null); + + /** InsertTargetVpnGatewayRequest region */ + region?: (string|null); + + /** InsertTargetVpnGatewayRequest requestId */ + requestId?: (string|null); + + /** InsertTargetVpnGatewayRequest targetVpnGatewayResource */ + targetVpnGatewayResource?: (google.cloud.compute.v1.ITargetVpnGateway|null); + } + + /** Represents an InsertTargetVpnGatewayRequest. */ + class InsertTargetVpnGatewayRequest implements IInsertTargetVpnGatewayRequest { + + /** + * Constructs a new InsertTargetVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertTargetVpnGatewayRequest); + + /** InsertTargetVpnGatewayRequest project. */ + public project: string; + + /** InsertTargetVpnGatewayRequest region. */ + public region: string; + + /** InsertTargetVpnGatewayRequest requestId. */ + public requestId?: (string|null); + + /** InsertTargetVpnGatewayRequest targetVpnGatewayResource. */ + public targetVpnGatewayResource?: (google.cloud.compute.v1.ITargetVpnGateway|null); + + /** InsertTargetVpnGatewayRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertTargetVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertTargetVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertTargetVpnGatewayRequest): google.cloud.compute.v1.InsertTargetVpnGatewayRequest; + + /** + * Encodes the specified InsertTargetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetVpnGatewayRequest.verify|verify} messages. + * @param message InsertTargetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertTargetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetVpnGatewayRequest.verify|verify} messages. + * @param message InsertTargetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertTargetVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertTargetVpnGatewayRequest; + + /** + * Decodes an InsertTargetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertTargetVpnGatewayRequest; + + /** + * Verifies an InsertTargetVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertTargetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertTargetVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertTargetVpnGatewayRequest; + + /** + * Creates a plain object from an InsertTargetVpnGatewayRequest message. Also converts values to other types if specified. + * @param message InsertTargetVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertTargetVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertTargetVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListTargetVpnGatewaysRequest. */ + interface IListTargetVpnGatewaysRequest { + + /** ListTargetVpnGatewaysRequest filter */ + filter?: (string|null); + + /** ListTargetVpnGatewaysRequest maxResults */ + maxResults?: (number|null); + + /** ListTargetVpnGatewaysRequest orderBy */ + orderBy?: (string|null); + + /** ListTargetVpnGatewaysRequest pageToken */ + pageToken?: (string|null); + + /** ListTargetVpnGatewaysRequest project */ + project?: (string|null); + + /** ListTargetVpnGatewaysRequest region */ + region?: (string|null); + + /** ListTargetVpnGatewaysRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListTargetVpnGatewaysRequest. */ + class ListTargetVpnGatewaysRequest implements IListTargetVpnGatewaysRequest { + + /** + * Constructs a new ListTargetVpnGatewaysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListTargetVpnGatewaysRequest); + + /** ListTargetVpnGatewaysRequest filter. */ + public filter?: (string|null); + + /** ListTargetVpnGatewaysRequest maxResults. */ + public maxResults?: (number|null); + + /** ListTargetVpnGatewaysRequest orderBy. */ + public orderBy?: (string|null); + + /** ListTargetVpnGatewaysRequest pageToken. */ + public pageToken?: (string|null); + + /** ListTargetVpnGatewaysRequest project. */ + public project: string; + + /** ListTargetVpnGatewaysRequest region. */ + public region: string; + + /** ListTargetVpnGatewaysRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListTargetVpnGatewaysRequest _filter. */ + public _filter?: "filter"; + + /** ListTargetVpnGatewaysRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListTargetVpnGatewaysRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListTargetVpnGatewaysRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListTargetVpnGatewaysRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListTargetVpnGatewaysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTargetVpnGatewaysRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListTargetVpnGatewaysRequest): google.cloud.compute.v1.ListTargetVpnGatewaysRequest; + + /** + * Encodes the specified ListTargetVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetVpnGatewaysRequest.verify|verify} messages. + * @param message ListTargetVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListTargetVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTargetVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetVpnGatewaysRequest.verify|verify} messages. + * @param message ListTargetVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListTargetVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTargetVpnGatewaysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListTargetVpnGatewaysRequest; + + /** + * Decodes a ListTargetVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListTargetVpnGatewaysRequest; + + /** + * Verifies a ListTargetVpnGatewaysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTargetVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTargetVpnGatewaysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListTargetVpnGatewaysRequest; + + /** + * Creates a plain object from a ListTargetVpnGatewaysRequest message. Also converts values to other types if specified. + * @param message ListTargetVpnGatewaysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListTargetVpnGatewaysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTargetVpnGatewaysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListUrlMapsRequest. */ + interface IAggregatedListUrlMapsRequest { + + /** AggregatedListUrlMapsRequest filter */ + filter?: (string|null); + + /** AggregatedListUrlMapsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListUrlMapsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListUrlMapsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListUrlMapsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListUrlMapsRequest project */ + project?: (string|null); + + /** AggregatedListUrlMapsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListUrlMapsRequest. */ + class AggregatedListUrlMapsRequest implements IAggregatedListUrlMapsRequest { + + /** + * Constructs a new AggregatedListUrlMapsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListUrlMapsRequest); + + /** AggregatedListUrlMapsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListUrlMapsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListUrlMapsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListUrlMapsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListUrlMapsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListUrlMapsRequest project. */ + public project: string; + + /** AggregatedListUrlMapsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListUrlMapsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListUrlMapsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListUrlMapsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListUrlMapsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListUrlMapsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListUrlMapsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListUrlMapsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListUrlMapsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListUrlMapsRequest): google.cloud.compute.v1.AggregatedListUrlMapsRequest; + + /** + * Encodes the specified AggregatedListUrlMapsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListUrlMapsRequest.verify|verify} messages. + * @param message AggregatedListUrlMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListUrlMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListUrlMapsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListUrlMapsRequest.verify|verify} messages. + * @param message AggregatedListUrlMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListUrlMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListUrlMapsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListUrlMapsRequest; + + /** + * Decodes an AggregatedListUrlMapsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListUrlMapsRequest; + + /** + * Verifies an AggregatedListUrlMapsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListUrlMapsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListUrlMapsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListUrlMapsRequest; + + /** + * Creates a plain object from an AggregatedListUrlMapsRequest message. Also converts values to other types if specified. + * @param message AggregatedListUrlMapsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListUrlMapsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListUrlMapsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteUrlMapRequest. */ + interface IDeleteUrlMapRequest { + + /** DeleteUrlMapRequest project */ + project?: (string|null); + + /** DeleteUrlMapRequest requestId */ + requestId?: (string|null); + + /** DeleteUrlMapRequest urlMap */ + urlMap?: (string|null); + } + + /** Represents a DeleteUrlMapRequest. */ + class DeleteUrlMapRequest implements IDeleteUrlMapRequest { + + /** + * Constructs a new DeleteUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteUrlMapRequest); + + /** DeleteUrlMapRequest project. */ + public project: string; + + /** DeleteUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** DeleteUrlMapRequest urlMap. */ + public urlMap: string; + + /** DeleteUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteUrlMapRequest): google.cloud.compute.v1.DeleteUrlMapRequest; + + /** + * Encodes the specified DeleteUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteUrlMapRequest.verify|verify} messages. + * @param message DeleteUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteUrlMapRequest.verify|verify} messages. + * @param message DeleteUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteUrlMapRequest; + + /** + * Decodes a DeleteUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteUrlMapRequest; + + /** + * Verifies a DeleteUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteUrlMapRequest; + + /** + * Creates a plain object from a DeleteUrlMapRequest message. Also converts values to other types if specified. + * @param message DeleteUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetUrlMapRequest. */ + interface IGetUrlMapRequest { + + /** GetUrlMapRequest project */ + project?: (string|null); + + /** GetUrlMapRequest urlMap */ + urlMap?: (string|null); + } + + /** Represents a GetUrlMapRequest. */ + class GetUrlMapRequest implements IGetUrlMapRequest { + + /** + * Constructs a new GetUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetUrlMapRequest); + + /** GetUrlMapRequest project. */ + public project: string; + + /** GetUrlMapRequest urlMap. */ + public urlMap: string; + + /** + * Creates a new GetUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetUrlMapRequest): google.cloud.compute.v1.GetUrlMapRequest; + + /** + * Encodes the specified GetUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.GetUrlMapRequest.verify|verify} messages. + * @param message GetUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetUrlMapRequest.verify|verify} messages. + * @param message GetUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetUrlMapRequest; + + /** + * Decodes a GetUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetUrlMapRequest; + + /** + * Verifies a GetUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetUrlMapRequest; + + /** + * Creates a plain object from a GetUrlMapRequest message. Also converts values to other types if specified. + * @param message GetUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertUrlMapRequest. */ + interface IInsertUrlMapRequest { + + /** InsertUrlMapRequest project */ + project?: (string|null); + + /** InsertUrlMapRequest requestId */ + requestId?: (string|null); + + /** InsertUrlMapRequest urlMapResource */ + urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents an InsertUrlMapRequest. */ + class InsertUrlMapRequest implements IInsertUrlMapRequest { + + /** + * Constructs a new InsertUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertUrlMapRequest); + + /** InsertUrlMapRequest project. */ + public project: string; + + /** InsertUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** InsertUrlMapRequest urlMapResource. */ + public urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + + /** InsertUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertUrlMapRequest): google.cloud.compute.v1.InsertUrlMapRequest; + + /** + * Encodes the specified InsertUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertUrlMapRequest.verify|verify} messages. + * @param message InsertUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertUrlMapRequest.verify|verify} messages. + * @param message InsertUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertUrlMapRequest; + + /** + * Decodes an InsertUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertUrlMapRequest; + + /** + * Verifies an InsertUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertUrlMapRequest; + + /** + * Creates a plain object from an InsertUrlMapRequest message. Also converts values to other types if specified. + * @param message InsertUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InvalidateCacheUrlMapRequest. */ + interface IInvalidateCacheUrlMapRequest { + + /** InvalidateCacheUrlMapRequest cacheInvalidationRuleResource */ + cacheInvalidationRuleResource?: (google.cloud.compute.v1.ICacheInvalidationRule|null); + + /** InvalidateCacheUrlMapRequest project */ + project?: (string|null); + + /** InvalidateCacheUrlMapRequest requestId */ + requestId?: (string|null); + + /** InvalidateCacheUrlMapRequest urlMap */ + urlMap?: (string|null); + } + + /** Represents an InvalidateCacheUrlMapRequest. */ + class InvalidateCacheUrlMapRequest implements IInvalidateCacheUrlMapRequest { + + /** + * Constructs a new InvalidateCacheUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInvalidateCacheUrlMapRequest); + + /** InvalidateCacheUrlMapRequest cacheInvalidationRuleResource. */ + public cacheInvalidationRuleResource?: (google.cloud.compute.v1.ICacheInvalidationRule|null); + + /** InvalidateCacheUrlMapRequest project. */ + public project: string; + + /** InvalidateCacheUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** InvalidateCacheUrlMapRequest urlMap. */ + public urlMap: string; + + /** InvalidateCacheUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InvalidateCacheUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InvalidateCacheUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInvalidateCacheUrlMapRequest): google.cloud.compute.v1.InvalidateCacheUrlMapRequest; + + /** + * Encodes the specified InvalidateCacheUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.InvalidateCacheUrlMapRequest.verify|verify} messages. + * @param message InvalidateCacheUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InvalidateCacheUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InvalidateCacheUrlMapRequest.verify|verify} messages. + * @param message InvalidateCacheUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InvalidateCacheUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InvalidateCacheUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InvalidateCacheUrlMapRequest; + + /** + * Decodes an InvalidateCacheUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InvalidateCacheUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InvalidateCacheUrlMapRequest; + + /** + * Verifies an InvalidateCacheUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InvalidateCacheUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InvalidateCacheUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InvalidateCacheUrlMapRequest; + + /** + * Creates a plain object from an InvalidateCacheUrlMapRequest message. Also converts values to other types if specified. + * @param message InvalidateCacheUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InvalidateCacheUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InvalidateCacheUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListUrlMapsRequest. */ + interface IListUrlMapsRequest { + + /** ListUrlMapsRequest filter */ + filter?: (string|null); + + /** ListUrlMapsRequest maxResults */ + maxResults?: (number|null); + + /** ListUrlMapsRequest orderBy */ + orderBy?: (string|null); + + /** ListUrlMapsRequest pageToken */ + pageToken?: (string|null); + + /** ListUrlMapsRequest project */ + project?: (string|null); + + /** ListUrlMapsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListUrlMapsRequest. */ + class ListUrlMapsRequest implements IListUrlMapsRequest { + + /** + * Constructs a new ListUrlMapsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListUrlMapsRequest); + + /** ListUrlMapsRequest filter. */ + public filter?: (string|null); + + /** ListUrlMapsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListUrlMapsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListUrlMapsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListUrlMapsRequest project. */ + public project: string; + + /** ListUrlMapsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListUrlMapsRequest _filter. */ + public _filter?: "filter"; + + /** ListUrlMapsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListUrlMapsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListUrlMapsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListUrlMapsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListUrlMapsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUrlMapsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListUrlMapsRequest): google.cloud.compute.v1.ListUrlMapsRequest; + + /** + * Encodes the specified ListUrlMapsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListUrlMapsRequest.verify|verify} messages. + * @param message ListUrlMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListUrlMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUrlMapsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListUrlMapsRequest.verify|verify} messages. + * @param message ListUrlMapsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListUrlMapsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUrlMapsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListUrlMapsRequest; + + /** + * Decodes a ListUrlMapsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListUrlMapsRequest; + + /** + * Verifies a ListUrlMapsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUrlMapsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUrlMapsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListUrlMapsRequest; + + /** + * Creates a plain object from a ListUrlMapsRequest message. Also converts values to other types if specified. + * @param message ListUrlMapsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListUrlMapsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUrlMapsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PatchUrlMapRequest. */ + interface IPatchUrlMapRequest { + + /** PatchUrlMapRequest project */ + project?: (string|null); + + /** PatchUrlMapRequest requestId */ + requestId?: (string|null); + + /** PatchUrlMapRequest urlMap */ + urlMap?: (string|null); + + /** PatchUrlMapRequest urlMapResource */ + urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents a PatchUrlMapRequest. */ + class PatchUrlMapRequest implements IPatchUrlMapRequest { + + /** + * Constructs a new PatchUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchUrlMapRequest); + + /** PatchUrlMapRequest project. */ + public project: string; + + /** PatchUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** PatchUrlMapRequest urlMap. */ + public urlMap: string; + + /** PatchUrlMapRequest urlMapResource. */ + public urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + + /** PatchUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchUrlMapRequest): google.cloud.compute.v1.PatchUrlMapRequest; + + /** + * Encodes the specified PatchUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchUrlMapRequest.verify|verify} messages. + * @param message PatchUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchUrlMapRequest.verify|verify} messages. + * @param message PatchUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchUrlMapRequest; + + /** + * Decodes a PatchUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchUrlMapRequest; + + /** + * Verifies a PatchUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchUrlMapRequest; + + /** + * Creates a plain object from a PatchUrlMapRequest message. Also converts values to other types if specified. + * @param message PatchUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateUrlMapRequest. */ + interface IUpdateUrlMapRequest { + + /** UpdateUrlMapRequest project */ + project?: (string|null); + + /** UpdateUrlMapRequest requestId */ + requestId?: (string|null); + + /** UpdateUrlMapRequest urlMap */ + urlMap?: (string|null); + + /** UpdateUrlMapRequest urlMapResource */ + urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + } + + /** Represents an UpdateUrlMapRequest. */ + class UpdateUrlMapRequest implements IUpdateUrlMapRequest { + + /** + * Constructs a new UpdateUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateUrlMapRequest); + + /** UpdateUrlMapRequest project. */ + public project: string; + + /** UpdateUrlMapRequest requestId. */ + public requestId?: (string|null); + + /** UpdateUrlMapRequest urlMap. */ + public urlMap: string; + + /** UpdateUrlMapRequest urlMapResource. */ + public urlMapResource?: (google.cloud.compute.v1.IUrlMap|null); + + /** UpdateUrlMapRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateUrlMapRequest): google.cloud.compute.v1.UpdateUrlMapRequest; + + /** + * Encodes the specified UpdateUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateUrlMapRequest.verify|verify} messages. + * @param message UpdateUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateUrlMapRequest.verify|verify} messages. + * @param message UpdateUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateUrlMapRequest; + + /** + * Decodes an UpdateUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateUrlMapRequest; + + /** + * Verifies an UpdateUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateUrlMapRequest; + + /** + * Creates a plain object from an UpdateUrlMapRequest message. Also converts values to other types if specified. + * @param message UpdateUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ValidateUrlMapRequest. */ + interface IValidateUrlMapRequest { + + /** ValidateUrlMapRequest project */ + project?: (string|null); + + /** ValidateUrlMapRequest urlMap */ + urlMap?: (string|null); + + /** ValidateUrlMapRequest urlMapsValidateRequestResource */ + urlMapsValidateRequestResource?: (google.cloud.compute.v1.IUrlMapsValidateRequest|null); + } + + /** Represents a ValidateUrlMapRequest. */ + class ValidateUrlMapRequest implements IValidateUrlMapRequest { + + /** + * Constructs a new ValidateUrlMapRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IValidateUrlMapRequest); + + /** ValidateUrlMapRequest project. */ + public project: string; + + /** ValidateUrlMapRequest urlMap. */ + public urlMap: string; + + /** ValidateUrlMapRequest urlMapsValidateRequestResource. */ + public urlMapsValidateRequestResource?: (google.cloud.compute.v1.IUrlMapsValidateRequest|null); + + /** + * Creates a new ValidateUrlMapRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidateUrlMapRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IValidateUrlMapRequest): google.cloud.compute.v1.ValidateUrlMapRequest; + + /** + * Encodes the specified ValidateUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.ValidateUrlMapRequest.verify|verify} messages. + * @param message ValidateUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IValidateUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidateUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ValidateUrlMapRequest.verify|verify} messages. + * @param message ValidateUrlMapRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IValidateUrlMapRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidateUrlMapRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ValidateUrlMapRequest; + + /** + * Decodes a ValidateUrlMapRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ValidateUrlMapRequest; + + /** + * Verifies a ValidateUrlMapRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidateUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidateUrlMapRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ValidateUrlMapRequest; + + /** + * Creates a plain object from a ValidateUrlMapRequest message. Also converts values to other types if specified. + * @param message ValidateUrlMapRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ValidateUrlMapRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidateUrlMapRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListVpnGatewaysRequest. */ + interface IAggregatedListVpnGatewaysRequest { + + /** AggregatedListVpnGatewaysRequest filter */ + filter?: (string|null); + + /** AggregatedListVpnGatewaysRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListVpnGatewaysRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListVpnGatewaysRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListVpnGatewaysRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListVpnGatewaysRequest project */ + project?: (string|null); + + /** AggregatedListVpnGatewaysRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListVpnGatewaysRequest. */ + class AggregatedListVpnGatewaysRequest implements IAggregatedListVpnGatewaysRequest { + + /** + * Constructs a new AggregatedListVpnGatewaysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest); + + /** AggregatedListVpnGatewaysRequest filter. */ + public filter?: (string|null); + + /** AggregatedListVpnGatewaysRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListVpnGatewaysRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListVpnGatewaysRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListVpnGatewaysRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListVpnGatewaysRequest project. */ + public project: string; + + /** AggregatedListVpnGatewaysRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListVpnGatewaysRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListVpnGatewaysRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListVpnGatewaysRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListVpnGatewaysRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListVpnGatewaysRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListVpnGatewaysRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListVpnGatewaysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListVpnGatewaysRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest): google.cloud.compute.v1.AggregatedListVpnGatewaysRequest; + + /** + * Encodes the specified AggregatedListVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnGatewaysRequest.verify|verify} messages. + * @param message AggregatedListVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnGatewaysRequest.verify|verify} messages. + * @param message AggregatedListVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListVpnGatewaysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListVpnGatewaysRequest; + + /** + * Decodes an AggregatedListVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListVpnGatewaysRequest; + + /** + * Verifies an AggregatedListVpnGatewaysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListVpnGatewaysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListVpnGatewaysRequest; + + /** + * Creates a plain object from an AggregatedListVpnGatewaysRequest message. Also converts values to other types if specified. + * @param message AggregatedListVpnGatewaysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListVpnGatewaysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListVpnGatewaysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteVpnGatewayRequest. */ + interface IDeleteVpnGatewayRequest { + + /** DeleteVpnGatewayRequest project */ + project?: (string|null); + + /** DeleteVpnGatewayRequest region */ + region?: (string|null); + + /** DeleteVpnGatewayRequest requestId */ + requestId?: (string|null); + + /** DeleteVpnGatewayRequest vpnGateway */ + vpnGateway?: (string|null); + } + + /** Represents a DeleteVpnGatewayRequest. */ + class DeleteVpnGatewayRequest implements IDeleteVpnGatewayRequest { + + /** + * Constructs a new DeleteVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteVpnGatewayRequest); + + /** DeleteVpnGatewayRequest project. */ + public project: string; + + /** DeleteVpnGatewayRequest region. */ + public region: string; + + /** DeleteVpnGatewayRequest requestId. */ + public requestId?: (string|null); + + /** DeleteVpnGatewayRequest vpnGateway. */ + public vpnGateway: string; + + /** DeleteVpnGatewayRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteVpnGatewayRequest): google.cloud.compute.v1.DeleteVpnGatewayRequest; + + /** + * Encodes the specified DeleteVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnGatewayRequest.verify|verify} messages. + * @param message DeleteVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnGatewayRequest.verify|verify} messages. + * @param message DeleteVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteVpnGatewayRequest; + + /** + * Decodes a DeleteVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteVpnGatewayRequest; + + /** + * Verifies a DeleteVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteVpnGatewayRequest; + + /** + * Creates a plain object from a DeleteVpnGatewayRequest message. Also converts values to other types if specified. + * @param message DeleteVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetVpnGatewayRequest. */ + interface IGetVpnGatewayRequest { + + /** GetVpnGatewayRequest project */ + project?: (string|null); + + /** GetVpnGatewayRequest region */ + region?: (string|null); + + /** GetVpnGatewayRequest vpnGateway */ + vpnGateway?: (string|null); + } + + /** Represents a GetVpnGatewayRequest. */ + class GetVpnGatewayRequest implements IGetVpnGatewayRequest { + + /** + * Constructs a new GetVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetVpnGatewayRequest); + + /** GetVpnGatewayRequest project. */ + public project: string; + + /** GetVpnGatewayRequest region. */ + public region: string; + + /** GetVpnGatewayRequest vpnGateway. */ + public vpnGateway: string; + + /** + * Creates a new GetVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetVpnGatewayRequest): google.cloud.compute.v1.GetVpnGatewayRequest; + + /** + * Encodes the specified GetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetVpnGatewayRequest.verify|verify} messages. + * @param message GetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetVpnGatewayRequest.verify|verify} messages. + * @param message GetVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetVpnGatewayRequest; + + /** + * Decodes a GetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetVpnGatewayRequest; + + /** + * Verifies a GetVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetVpnGatewayRequest; + + /** + * Creates a plain object from a GetVpnGatewayRequest message. Also converts values to other types if specified. + * @param message GetVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetStatusVpnGatewayRequest. */ + interface IGetStatusVpnGatewayRequest { + + /** GetStatusVpnGatewayRequest project */ + project?: (string|null); + + /** GetStatusVpnGatewayRequest region */ + region?: (string|null); + + /** GetStatusVpnGatewayRequest vpnGateway */ + vpnGateway?: (string|null); + } + + /** Represents a GetStatusVpnGatewayRequest. */ + class GetStatusVpnGatewayRequest implements IGetStatusVpnGatewayRequest { + + /** + * Constructs a new GetStatusVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetStatusVpnGatewayRequest); + + /** GetStatusVpnGatewayRequest project. */ + public project: string; + + /** GetStatusVpnGatewayRequest region. */ + public region: string; + + /** GetStatusVpnGatewayRequest vpnGateway. */ + public vpnGateway: string; + + /** + * Creates a new GetStatusVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetStatusVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetStatusVpnGatewayRequest): google.cloud.compute.v1.GetStatusVpnGatewayRequest; + + /** + * Encodes the specified GetStatusVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetStatusVpnGatewayRequest.verify|verify} messages. + * @param message GetStatusVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetStatusVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetStatusVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetStatusVpnGatewayRequest.verify|verify} messages. + * @param message GetStatusVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetStatusVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetStatusVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetStatusVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetStatusVpnGatewayRequest; + + /** + * Decodes a GetStatusVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetStatusVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetStatusVpnGatewayRequest; + + /** + * Verifies a GetStatusVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetStatusVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetStatusVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetStatusVpnGatewayRequest; + + /** + * Creates a plain object from a GetStatusVpnGatewayRequest message. Also converts values to other types if specified. + * @param message GetStatusVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetStatusVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetStatusVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertVpnGatewayRequest. */ + interface IInsertVpnGatewayRequest { + + /** InsertVpnGatewayRequest project */ + project?: (string|null); + + /** InsertVpnGatewayRequest region */ + region?: (string|null); + + /** InsertVpnGatewayRequest requestId */ + requestId?: (string|null); + + /** InsertVpnGatewayRequest vpnGatewayResource */ + vpnGatewayResource?: (google.cloud.compute.v1.IVpnGateway|null); + } + + /** Represents an InsertVpnGatewayRequest. */ + class InsertVpnGatewayRequest implements IInsertVpnGatewayRequest { + + /** + * Constructs a new InsertVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertVpnGatewayRequest); + + /** InsertVpnGatewayRequest project. */ + public project: string; + + /** InsertVpnGatewayRequest region. */ + public region: string; + + /** InsertVpnGatewayRequest requestId. */ + public requestId?: (string|null); + + /** InsertVpnGatewayRequest vpnGatewayResource. */ + public vpnGatewayResource?: (google.cloud.compute.v1.IVpnGateway|null); + + /** InsertVpnGatewayRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertVpnGatewayRequest): google.cloud.compute.v1.InsertVpnGatewayRequest; + + /** + * Encodes the specified InsertVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertVpnGatewayRequest.verify|verify} messages. + * @param message InsertVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertVpnGatewayRequest.verify|verify} messages. + * @param message InsertVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertVpnGatewayRequest; + + /** + * Decodes an InsertVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertVpnGatewayRequest; + + /** + * Verifies an InsertVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertVpnGatewayRequest; + + /** + * Creates a plain object from an InsertVpnGatewayRequest message. Also converts values to other types if specified. + * @param message InsertVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListVpnGatewaysRequest. */ + interface IListVpnGatewaysRequest { + + /** ListVpnGatewaysRequest filter */ + filter?: (string|null); + + /** ListVpnGatewaysRequest maxResults */ + maxResults?: (number|null); + + /** ListVpnGatewaysRequest orderBy */ + orderBy?: (string|null); + + /** ListVpnGatewaysRequest pageToken */ + pageToken?: (string|null); + + /** ListVpnGatewaysRequest project */ + project?: (string|null); + + /** ListVpnGatewaysRequest region */ + region?: (string|null); + + /** ListVpnGatewaysRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListVpnGatewaysRequest. */ + class ListVpnGatewaysRequest implements IListVpnGatewaysRequest { + + /** + * Constructs a new ListVpnGatewaysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListVpnGatewaysRequest); + + /** ListVpnGatewaysRequest filter. */ + public filter?: (string|null); + + /** ListVpnGatewaysRequest maxResults. */ + public maxResults?: (number|null); + + /** ListVpnGatewaysRequest orderBy. */ + public orderBy?: (string|null); + + /** ListVpnGatewaysRequest pageToken. */ + public pageToken?: (string|null); + + /** ListVpnGatewaysRequest project. */ + public project: string; + + /** ListVpnGatewaysRequest region. */ + public region: string; + + /** ListVpnGatewaysRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListVpnGatewaysRequest _filter. */ + public _filter?: "filter"; + + /** ListVpnGatewaysRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListVpnGatewaysRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListVpnGatewaysRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListVpnGatewaysRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListVpnGatewaysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVpnGatewaysRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListVpnGatewaysRequest): google.cloud.compute.v1.ListVpnGatewaysRequest; + + /** + * Encodes the specified ListVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.ListVpnGatewaysRequest.verify|verify} messages. + * @param message ListVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListVpnGatewaysRequest.verify|verify} messages. + * @param message ListVpnGatewaysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListVpnGatewaysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVpnGatewaysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListVpnGatewaysRequest; + + /** + * Decodes a ListVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListVpnGatewaysRequest; + + /** + * Verifies a ListVpnGatewaysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVpnGatewaysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListVpnGatewaysRequest; + + /** + * Creates a plain object from a ListVpnGatewaysRequest message. Also converts values to other types if specified. + * @param message ListVpnGatewaysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListVpnGatewaysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVpnGatewaysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetLabelsVpnGatewayRequest. */ + interface ISetLabelsVpnGatewayRequest { + + /** SetLabelsVpnGatewayRequest project */ + project?: (string|null); + + /** SetLabelsVpnGatewayRequest region */ + region?: (string|null); + + /** SetLabelsVpnGatewayRequest regionSetLabelsRequestResource */ + regionSetLabelsRequestResource?: (google.cloud.compute.v1.IRegionSetLabelsRequest|null); + + /** SetLabelsVpnGatewayRequest requestId */ + requestId?: (string|null); + + /** SetLabelsVpnGatewayRequest resource */ + resource?: (string|null); + } + + /** Represents a SetLabelsVpnGatewayRequest. */ + class SetLabelsVpnGatewayRequest implements ISetLabelsVpnGatewayRequest { + + /** + * Constructs a new SetLabelsVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ISetLabelsVpnGatewayRequest); + + /** SetLabelsVpnGatewayRequest project. */ + public project: string; + + /** SetLabelsVpnGatewayRequest region. */ + public region: string; + + /** SetLabelsVpnGatewayRequest regionSetLabelsRequestResource. */ + public regionSetLabelsRequestResource?: (google.cloud.compute.v1.IRegionSetLabelsRequest|null); + + /** SetLabelsVpnGatewayRequest requestId. */ + public requestId?: (string|null); + + /** SetLabelsVpnGatewayRequest resource. */ + public resource: string; + + /** SetLabelsVpnGatewayRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new SetLabelsVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetLabelsVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ISetLabelsVpnGatewayRequest): google.cloud.compute.v1.SetLabelsVpnGatewayRequest; + + /** + * Encodes the specified SetLabelsVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsVpnGatewayRequest.verify|verify} messages. + * @param message SetLabelsVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetLabelsVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsVpnGatewayRequest.verify|verify} messages. + * @param message SetLabelsVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetLabelsVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetLabelsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.SetLabelsVpnGatewayRequest; + + /** + * Decodes a SetLabelsVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetLabelsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.SetLabelsVpnGatewayRequest; + + /** + * Verifies a SetLabelsVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetLabelsVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetLabelsVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.SetLabelsVpnGatewayRequest; + + /** + * Creates a plain object from a SetLabelsVpnGatewayRequest message. Also converts values to other types if specified. + * @param message SetLabelsVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.SetLabelsVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetLabelsVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TestIamPermissionsVpnGatewayRequest. */ + interface ITestIamPermissionsVpnGatewayRequest { + + /** TestIamPermissionsVpnGatewayRequest project */ + project?: (string|null); + + /** TestIamPermissionsVpnGatewayRequest region */ + region?: (string|null); + + /** TestIamPermissionsVpnGatewayRequest resource */ + resource?: (string|null); + + /** TestIamPermissionsVpnGatewayRequest testPermissionsRequestResource */ + testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + } + + /** Represents a TestIamPermissionsVpnGatewayRequest. */ + class TestIamPermissionsVpnGatewayRequest implements ITestIamPermissionsVpnGatewayRequest { + + /** + * Constructs a new TestIamPermissionsVpnGatewayRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest); + + /** TestIamPermissionsVpnGatewayRequest project. */ + public project: string; + + /** TestIamPermissionsVpnGatewayRequest region. */ + public region: string; + + /** TestIamPermissionsVpnGatewayRequest resource. */ + public resource: string; + + /** TestIamPermissionsVpnGatewayRequest testPermissionsRequestResource. */ + public testPermissionsRequestResource?: (google.cloud.compute.v1.ITestPermissionsRequest|null); + + /** + * Creates a new TestIamPermissionsVpnGatewayRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TestIamPermissionsVpnGatewayRequest instance + */ + public static create(properties?: google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest): google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest; + + /** + * Encodes the specified TestIamPermissionsVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest.verify|verify} messages. + * @param message TestIamPermissionsVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TestIamPermissionsVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest.verify|verify} messages. + * @param message TestIamPermissionsVpnGatewayRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TestIamPermissionsVpnGatewayRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TestIamPermissionsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest; + + /** + * Decodes a TestIamPermissionsVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TestIamPermissionsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest; + + /** + * Verifies a TestIamPermissionsVpnGatewayRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TestIamPermissionsVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TestIamPermissionsVpnGatewayRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest; + + /** + * Creates a plain object from a TestIamPermissionsVpnGatewayRequest message. Also converts values to other types if specified. + * @param message TestIamPermissionsVpnGatewayRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TestIamPermissionsVpnGatewayRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AggregatedListVpnTunnelsRequest. */ + interface IAggregatedListVpnTunnelsRequest { + + /** AggregatedListVpnTunnelsRequest filter */ + filter?: (string|null); + + /** AggregatedListVpnTunnelsRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListVpnTunnelsRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListVpnTunnelsRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListVpnTunnelsRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListVpnTunnelsRequest project */ + project?: (string|null); + + /** AggregatedListVpnTunnelsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents an AggregatedListVpnTunnelsRequest. */ + class AggregatedListVpnTunnelsRequest implements IAggregatedListVpnTunnelsRequest { + + /** + * Constructs a new AggregatedListVpnTunnelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest); + + /** AggregatedListVpnTunnelsRequest filter. */ + public filter?: (string|null); + + /** AggregatedListVpnTunnelsRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListVpnTunnelsRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListVpnTunnelsRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListVpnTunnelsRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListVpnTunnelsRequest project. */ + public project: string; + + /** AggregatedListVpnTunnelsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListVpnTunnelsRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListVpnTunnelsRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListVpnTunnelsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListVpnTunnelsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListVpnTunnelsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListVpnTunnelsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new AggregatedListVpnTunnelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListVpnTunnelsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest): google.cloud.compute.v1.AggregatedListVpnTunnelsRequest; + + /** + * Encodes the specified AggregatedListVpnTunnelsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnTunnelsRequest.verify|verify} messages. + * @param message AggregatedListVpnTunnelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListVpnTunnelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnTunnelsRequest.verify|verify} messages. + * @param message AggregatedListVpnTunnelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListVpnTunnelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListVpnTunnelsRequest; + + /** + * Decodes an AggregatedListVpnTunnelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListVpnTunnelsRequest; + + /** + * Verifies an AggregatedListVpnTunnelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListVpnTunnelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListVpnTunnelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListVpnTunnelsRequest; + + /** + * Creates a plain object from an AggregatedListVpnTunnelsRequest message. Also converts values to other types if specified. + * @param message AggregatedListVpnTunnelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListVpnTunnelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListVpnTunnelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteVpnTunnelRequest. */ + interface IDeleteVpnTunnelRequest { + + /** DeleteVpnTunnelRequest project */ + project?: (string|null); + + /** DeleteVpnTunnelRequest region */ + region?: (string|null); + + /** DeleteVpnTunnelRequest requestId */ + requestId?: (string|null); + + /** DeleteVpnTunnelRequest vpnTunnel */ + vpnTunnel?: (string|null); + } + + /** Represents a DeleteVpnTunnelRequest. */ + class DeleteVpnTunnelRequest implements IDeleteVpnTunnelRequest { + + /** + * Constructs a new DeleteVpnTunnelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteVpnTunnelRequest); + + /** DeleteVpnTunnelRequest project. */ + public project: string; + + /** DeleteVpnTunnelRequest region. */ + public region: string; + + /** DeleteVpnTunnelRequest requestId. */ + public requestId?: (string|null); + + /** DeleteVpnTunnelRequest vpnTunnel. */ + public vpnTunnel: string; + + /** DeleteVpnTunnelRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteVpnTunnelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVpnTunnelRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteVpnTunnelRequest): google.cloud.compute.v1.DeleteVpnTunnelRequest; + + /** + * Encodes the specified DeleteVpnTunnelRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnTunnelRequest.verify|verify} messages. + * @param message DeleteVpnTunnelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteVpnTunnelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVpnTunnelRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnTunnelRequest.verify|verify} messages. + * @param message DeleteVpnTunnelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteVpnTunnelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVpnTunnelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteVpnTunnelRequest; + + /** + * Decodes a DeleteVpnTunnelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteVpnTunnelRequest; + + /** + * Verifies a DeleteVpnTunnelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteVpnTunnelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVpnTunnelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteVpnTunnelRequest; + + /** + * Creates a plain object from a DeleteVpnTunnelRequest message. Also converts values to other types if specified. + * @param message DeleteVpnTunnelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteVpnTunnelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVpnTunnelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetVpnTunnelRequest. */ + interface IGetVpnTunnelRequest { + + /** GetVpnTunnelRequest project */ + project?: (string|null); + + /** GetVpnTunnelRequest region */ + region?: (string|null); + + /** GetVpnTunnelRequest vpnTunnel */ + vpnTunnel?: (string|null); + } + + /** Represents a GetVpnTunnelRequest. */ + class GetVpnTunnelRequest implements IGetVpnTunnelRequest { + + /** + * Constructs a new GetVpnTunnelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetVpnTunnelRequest); + + /** GetVpnTunnelRequest project. */ + public project: string; + + /** GetVpnTunnelRequest region. */ + public region: string; + + /** GetVpnTunnelRequest vpnTunnel. */ + public vpnTunnel: string; + + /** + * Creates a new GetVpnTunnelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVpnTunnelRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetVpnTunnelRequest): google.cloud.compute.v1.GetVpnTunnelRequest; + + /** + * Encodes the specified GetVpnTunnelRequest message. Does not implicitly {@link google.cloud.compute.v1.GetVpnTunnelRequest.verify|verify} messages. + * @param message GetVpnTunnelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetVpnTunnelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVpnTunnelRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetVpnTunnelRequest.verify|verify} messages. + * @param message GetVpnTunnelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetVpnTunnelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVpnTunnelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetVpnTunnelRequest; + + /** + * Decodes a GetVpnTunnelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetVpnTunnelRequest; + + /** + * Verifies a GetVpnTunnelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVpnTunnelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVpnTunnelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetVpnTunnelRequest; + + /** + * Creates a plain object from a GetVpnTunnelRequest message. Also converts values to other types if specified. + * @param message GetVpnTunnelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetVpnTunnelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVpnTunnelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InsertVpnTunnelRequest. */ + interface IInsertVpnTunnelRequest { + + /** InsertVpnTunnelRequest project */ + project?: (string|null); + + /** InsertVpnTunnelRequest region */ + region?: (string|null); + + /** InsertVpnTunnelRequest requestId */ + requestId?: (string|null); + + /** InsertVpnTunnelRequest vpnTunnelResource */ + vpnTunnelResource?: (google.cloud.compute.v1.IVpnTunnel|null); + } + + /** Represents an InsertVpnTunnelRequest. */ + class InsertVpnTunnelRequest implements IInsertVpnTunnelRequest { + + /** + * Constructs a new InsertVpnTunnelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IInsertVpnTunnelRequest); + + /** InsertVpnTunnelRequest project. */ + public project: string; + + /** InsertVpnTunnelRequest region. */ + public region: string; + + /** InsertVpnTunnelRequest requestId. */ + public requestId?: (string|null); + + /** InsertVpnTunnelRequest vpnTunnelResource. */ + public vpnTunnelResource?: (google.cloud.compute.v1.IVpnTunnel|null); + + /** InsertVpnTunnelRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new InsertVpnTunnelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InsertVpnTunnelRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IInsertVpnTunnelRequest): google.cloud.compute.v1.InsertVpnTunnelRequest; + + /** + * Encodes the specified InsertVpnTunnelRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertVpnTunnelRequest.verify|verify} messages. + * @param message InsertVpnTunnelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IInsertVpnTunnelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InsertVpnTunnelRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertVpnTunnelRequest.verify|verify} messages. + * @param message InsertVpnTunnelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IInsertVpnTunnelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InsertVpnTunnelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InsertVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.InsertVpnTunnelRequest; + + /** + * Decodes an InsertVpnTunnelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InsertVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.InsertVpnTunnelRequest; + + /** + * Verifies an InsertVpnTunnelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InsertVpnTunnelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InsertVpnTunnelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.InsertVpnTunnelRequest; + + /** + * Creates a plain object from an InsertVpnTunnelRequest message. Also converts values to other types if specified. + * @param message InsertVpnTunnelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.InsertVpnTunnelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InsertVpnTunnelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListVpnTunnelsRequest. */ + interface IListVpnTunnelsRequest { + + /** ListVpnTunnelsRequest filter */ + filter?: (string|null); + + /** ListVpnTunnelsRequest maxResults */ + maxResults?: (number|null); + + /** ListVpnTunnelsRequest orderBy */ + orderBy?: (string|null); + + /** ListVpnTunnelsRequest pageToken */ + pageToken?: (string|null); + + /** ListVpnTunnelsRequest project */ + project?: (string|null); + + /** ListVpnTunnelsRequest region */ + region?: (string|null); + + /** ListVpnTunnelsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListVpnTunnelsRequest. */ + class ListVpnTunnelsRequest implements IListVpnTunnelsRequest { + + /** + * Constructs a new ListVpnTunnelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListVpnTunnelsRequest); + + /** ListVpnTunnelsRequest filter. */ + public filter?: (string|null); + + /** ListVpnTunnelsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListVpnTunnelsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListVpnTunnelsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListVpnTunnelsRequest project. */ + public project: string; + + /** ListVpnTunnelsRequest region. */ + public region: string; + + /** ListVpnTunnelsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListVpnTunnelsRequest _filter. */ + public _filter?: "filter"; + + /** ListVpnTunnelsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListVpnTunnelsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListVpnTunnelsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListVpnTunnelsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListVpnTunnelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVpnTunnelsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListVpnTunnelsRequest): google.cloud.compute.v1.ListVpnTunnelsRequest; + + /** + * Encodes the specified ListVpnTunnelsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListVpnTunnelsRequest.verify|verify} messages. + * @param message ListVpnTunnelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListVpnTunnelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVpnTunnelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListVpnTunnelsRequest.verify|verify} messages. + * @param message ListVpnTunnelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListVpnTunnelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVpnTunnelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListVpnTunnelsRequest; + + /** + * Decodes a ListVpnTunnelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListVpnTunnelsRequest; + + /** + * Verifies a ListVpnTunnelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVpnTunnelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVpnTunnelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListVpnTunnelsRequest; + + /** + * Creates a plain object from a ListVpnTunnelsRequest message. Also converts values to other types if specified. + * @param message ListVpnTunnelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListVpnTunnelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVpnTunnelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteZoneOperationRequest. */ + interface IDeleteZoneOperationRequest { + + /** DeleteZoneOperationRequest operation */ + operation?: (string|null); + + /** DeleteZoneOperationRequest project */ + project?: (string|null); + + /** DeleteZoneOperationRequest zone */ + zone?: (string|null); + } + + /** Represents a DeleteZoneOperationRequest. */ + class DeleteZoneOperationRequest implements IDeleteZoneOperationRequest { + + /** + * Constructs a new DeleteZoneOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteZoneOperationRequest); + + /** DeleteZoneOperationRequest operation. */ + public operation: string; + + /** DeleteZoneOperationRequest project. */ + public project: string; + + /** DeleteZoneOperationRequest zone. */ + public zone: string; + + /** + * Creates a new DeleteZoneOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteZoneOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteZoneOperationRequest): google.cloud.compute.v1.DeleteZoneOperationRequest; + + /** + * Encodes the specified DeleteZoneOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationRequest.verify|verify} messages. + * @param message DeleteZoneOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteZoneOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteZoneOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationRequest.verify|verify} messages. + * @param message DeleteZoneOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteZoneOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteZoneOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteZoneOperationRequest; + + /** + * Decodes a DeleteZoneOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteZoneOperationRequest; + + /** + * Verifies a DeleteZoneOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteZoneOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteZoneOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteZoneOperationRequest; + + /** + * Creates a plain object from a DeleteZoneOperationRequest message. Also converts values to other types if specified. + * @param message DeleteZoneOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteZoneOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteZoneOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteZoneOperationResponse. */ + interface IDeleteZoneOperationResponse { + } + + /** Represents a DeleteZoneOperationResponse. */ + class DeleteZoneOperationResponse implements IDeleteZoneOperationResponse { + + /** + * Constructs a new DeleteZoneOperationResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteZoneOperationResponse); + + /** + * Creates a new DeleteZoneOperationResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteZoneOperationResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteZoneOperationResponse): google.cloud.compute.v1.DeleteZoneOperationResponse; + + /** + * Encodes the specified DeleteZoneOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationResponse.verify|verify} messages. + * @param message DeleteZoneOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteZoneOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteZoneOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationResponse.verify|verify} messages. + * @param message DeleteZoneOperationResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteZoneOperationResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteZoneOperationResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteZoneOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteZoneOperationResponse; + + /** + * Decodes a DeleteZoneOperationResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteZoneOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteZoneOperationResponse; + + /** + * Verifies a DeleteZoneOperationResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteZoneOperationResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteZoneOperationResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteZoneOperationResponse; + + /** + * Creates a plain object from a DeleteZoneOperationResponse message. Also converts values to other types if specified. + * @param message DeleteZoneOperationResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteZoneOperationResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteZoneOperationResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetZoneOperationRequest. */ + interface IGetZoneOperationRequest { + + /** GetZoneOperationRequest operation */ + operation?: (string|null); + + /** GetZoneOperationRequest project */ + project?: (string|null); + + /** GetZoneOperationRequest zone */ + zone?: (string|null); + } + + /** Represents a GetZoneOperationRequest. */ + class GetZoneOperationRequest implements IGetZoneOperationRequest { + + /** + * Constructs a new GetZoneOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetZoneOperationRequest); + + /** GetZoneOperationRequest operation. */ + public operation: string; + + /** GetZoneOperationRequest project. */ + public project: string; + + /** GetZoneOperationRequest zone. */ + public zone: string; + + /** + * Creates a new GetZoneOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetZoneOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetZoneOperationRequest): google.cloud.compute.v1.GetZoneOperationRequest; + + /** + * Encodes the specified GetZoneOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetZoneOperationRequest.verify|verify} messages. + * @param message GetZoneOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetZoneOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetZoneOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetZoneOperationRequest.verify|verify} messages. + * @param message GetZoneOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetZoneOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetZoneOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetZoneOperationRequest; + + /** + * Decodes a GetZoneOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetZoneOperationRequest; + + /** + * Verifies a GetZoneOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetZoneOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetZoneOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetZoneOperationRequest; + + /** + * Creates a plain object from a GetZoneOperationRequest message. Also converts values to other types if specified. + * @param message GetZoneOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetZoneOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetZoneOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListZoneOperationsRequest. */ + interface IListZoneOperationsRequest { + + /** ListZoneOperationsRequest filter */ + filter?: (string|null); + + /** ListZoneOperationsRequest maxResults */ + maxResults?: (number|null); + + /** ListZoneOperationsRequest orderBy */ + orderBy?: (string|null); + + /** ListZoneOperationsRequest pageToken */ + pageToken?: (string|null); + + /** ListZoneOperationsRequest project */ + project?: (string|null); + + /** ListZoneOperationsRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListZoneOperationsRequest zone */ + zone?: (string|null); + } + + /** Represents a ListZoneOperationsRequest. */ + class ListZoneOperationsRequest implements IListZoneOperationsRequest { + + /** + * Constructs a new ListZoneOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListZoneOperationsRequest); + + /** ListZoneOperationsRequest filter. */ + public filter?: (string|null); + + /** ListZoneOperationsRequest maxResults. */ + public maxResults?: (number|null); + + /** ListZoneOperationsRequest orderBy. */ + public orderBy?: (string|null); + + /** ListZoneOperationsRequest pageToken. */ + public pageToken?: (string|null); + + /** ListZoneOperationsRequest project. */ + public project: string; + + /** ListZoneOperationsRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListZoneOperationsRequest zone. */ + public zone: string; + + /** ListZoneOperationsRequest _filter. */ + public _filter?: "filter"; + + /** ListZoneOperationsRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListZoneOperationsRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListZoneOperationsRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListZoneOperationsRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListZoneOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListZoneOperationsRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListZoneOperationsRequest): google.cloud.compute.v1.ListZoneOperationsRequest; + + /** + * Encodes the specified ListZoneOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListZoneOperationsRequest.verify|verify} messages. + * @param message ListZoneOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListZoneOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListZoneOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListZoneOperationsRequest.verify|verify} messages. + * @param message ListZoneOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListZoneOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListZoneOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListZoneOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListZoneOperationsRequest; + + /** + * Decodes a ListZoneOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListZoneOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListZoneOperationsRequest; + + /** + * Verifies a ListZoneOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListZoneOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListZoneOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListZoneOperationsRequest; + + /** + * Creates a plain object from a ListZoneOperationsRequest message. Also converts values to other types if specified. + * @param message ListZoneOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListZoneOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListZoneOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WaitZoneOperationRequest. */ + interface IWaitZoneOperationRequest { + + /** WaitZoneOperationRequest operation */ + operation?: (string|null); + + /** WaitZoneOperationRequest project */ + project?: (string|null); + + /** WaitZoneOperationRequest zone */ + zone?: (string|null); + } + + /** Represents a WaitZoneOperationRequest. */ + class WaitZoneOperationRequest implements IWaitZoneOperationRequest { + + /** + * Constructs a new WaitZoneOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IWaitZoneOperationRequest); + + /** WaitZoneOperationRequest operation. */ + public operation: string; + + /** WaitZoneOperationRequest project. */ + public project: string; + + /** WaitZoneOperationRequest zone. */ + public zone: string; + + /** + * Creates a new WaitZoneOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitZoneOperationRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IWaitZoneOperationRequest): google.cloud.compute.v1.WaitZoneOperationRequest; + + /** + * Encodes the specified WaitZoneOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.WaitZoneOperationRequest.verify|verify} messages. + * @param message WaitZoneOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IWaitZoneOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitZoneOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WaitZoneOperationRequest.verify|verify} messages. + * @param message WaitZoneOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IWaitZoneOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitZoneOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.WaitZoneOperationRequest; + + /** + * Decodes a WaitZoneOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.WaitZoneOperationRequest; + + /** + * Verifies a WaitZoneOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitZoneOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitZoneOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.WaitZoneOperationRequest; + + /** + * Creates a plain object from a WaitZoneOperationRequest message. Also converts values to other types if specified. + * @param message WaitZoneOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.WaitZoneOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitZoneOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetZoneRequest. */ + interface IGetZoneRequest { + + /** GetZoneRequest project */ + project?: (string|null); + + /** GetZoneRequest zone */ + zone?: (string|null); + } + + /** Represents a GetZoneRequest. */ + class GetZoneRequest implements IGetZoneRequest { + + /** + * Constructs a new GetZoneRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetZoneRequest); + + /** GetZoneRequest project. */ + public project: string; + + /** GetZoneRequest zone. */ + public zone: string; + + /** + * Creates a new GetZoneRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetZoneRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetZoneRequest): google.cloud.compute.v1.GetZoneRequest; + + /** + * Encodes the specified GetZoneRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IGetZoneRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetZoneRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.GetZoneRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetZoneRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListZonesRequest. */ + interface IListZonesRequest { + + /** ListZonesRequest filter */ + filter?: (string|null); + + /** ListZonesRequest maxResults */ + maxResults?: (number|null); + + /** ListZonesRequest orderBy */ + orderBy?: (string|null); + + /** ListZonesRequest pageToken */ + pageToken?: (string|null); + + /** ListZonesRequest project */ + project?: (string|null); + + /** ListZonesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + } + + /** Represents a ListZonesRequest. */ + class ListZonesRequest implements IListZonesRequest { + + /** + * Constructs a new ListZonesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListZonesRequest); + + /** ListZonesRequest filter. */ + public filter?: (string|null); + + /** ListZonesRequest maxResults. */ + public maxResults?: (number|null); + + /** ListZonesRequest orderBy. */ + public orderBy?: (string|null); + + /** ListZonesRequest pageToken. */ + public pageToken?: (string|null); + + /** ListZonesRequest project. */ + public project: string; + + /** ListZonesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListZonesRequest _filter. */ + public _filter?: "filter"; + + /** ListZonesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListZonesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListZonesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListZonesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListZonesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListZonesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListZonesRequest): google.cloud.compute.v1.ListZonesRequest; + + /** + * Encodes the specified ListZonesRequest message. Does not implicitly {@link google.cloud.compute.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.compute.v1.IListZonesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListZonesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.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.compute.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.compute.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.compute.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.compute.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.compute.v1.ListZonesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListZonesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents an AcceleratorTypes */ + class AcceleratorTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new AcceleratorTypes 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 AcceleratorTypes 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): AcceleratorTypes; + + /** + * Calls AggregatedList. + * @param request AggregatedListAcceleratorTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AcceleratorTypeAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest, callback: google.cloud.compute.v1.AcceleratorTypes.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListAcceleratorTypesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest): Promise; + + /** + * Calls Get. + * @param request GetAcceleratorTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AcceleratorType + */ + public get(request: google.cloud.compute.v1.IGetAcceleratorTypeRequest, callback: google.cloud.compute.v1.AcceleratorTypes.GetCallback): void; + + /** + * Calls Get. + * @param request GetAcceleratorTypeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetAcceleratorTypeRequest): Promise; + + /** + * Calls List. + * @param request ListAcceleratorTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AcceleratorTypeList + */ + public list(request: google.cloud.compute.v1.IListAcceleratorTypesRequest, callback: google.cloud.compute.v1.AcceleratorTypes.ListCallback): void; + + /** + * Calls List. + * @param request ListAcceleratorTypesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListAcceleratorTypesRequest): Promise; + } + + namespace AcceleratorTypes { + + /** + * Callback as used by {@link google.cloud.compute.v1.AcceleratorTypes#aggregatedList}. + * @param error Error, if any + * @param [response] AcceleratorTypeAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.AcceleratorTypeAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.AcceleratorTypes#get}. + * @param error Error, if any + * @param [response] AcceleratorType + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.AcceleratorType) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.AcceleratorTypes#list}. + * @param error Error, if any + * @param [response] AcceleratorTypeList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.AcceleratorTypeList) => void; + } + + /** Represents an Addresses */ + class Addresses extends $protobuf.rpc.Service { + + /** + * Constructs a new Addresses 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 Addresses 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): Addresses; + + /** + * Calls AggregatedList. + * @param request AggregatedListAddressesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddressAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListAddressesRequest, callback: google.cloud.compute.v1.Addresses.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListAddressesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListAddressesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteAddressRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteAddressRequest, callback: google.cloud.compute.v1.Addresses.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteAddressRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteAddressRequest): Promise; + + /** + * Calls Get. + * @param request GetAddressRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Address + */ + public get(request: google.cloud.compute.v1.IGetAddressRequest, callback: google.cloud.compute.v1.Addresses.GetCallback): void; + + /** + * Calls Get. + * @param request GetAddressRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetAddressRequest): Promise; + + /** + * Calls Insert. + * @param request InsertAddressRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertAddressRequest, callback: google.cloud.compute.v1.Addresses.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertAddressRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertAddressRequest): Promise; + + /** + * Calls List. + * @param request ListAddressesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddressList + */ + public list(request: google.cloud.compute.v1.IListAddressesRequest, callback: google.cloud.compute.v1.Addresses.ListCallback): void; + + /** + * Calls List. + * @param request ListAddressesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListAddressesRequest): Promise; + } + + namespace Addresses { + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#aggregatedList}. + * @param error Error, if any + * @param [response] AddressAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.AddressAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#get}. + * @param error Error, if any + * @param [response] Address + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Address) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#list}. + * @param error Error, if any + * @param [response] AddressList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.AddressList) => void; + } + + /** Represents an Autoscalers */ + class Autoscalers extends $protobuf.rpc.Service { + + /** + * Constructs a new Autoscalers 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 Autoscalers 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): Autoscalers; + + /** + * Calls AggregatedList. + * @param request AggregatedListAutoscalersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutoscalerAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListAutoscalersRequest, callback: google.cloud.compute.v1.Autoscalers.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListAutoscalersRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListAutoscalersRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteAutoscalerRequest, callback: google.cloud.compute.v1.Autoscalers.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteAutoscalerRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteAutoscalerRequest): Promise; + + /** + * Calls Get. + * @param request GetAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Autoscaler + */ + public get(request: google.cloud.compute.v1.IGetAutoscalerRequest, callback: google.cloud.compute.v1.Autoscalers.GetCallback): void; + + /** + * Calls Get. + * @param request GetAutoscalerRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetAutoscalerRequest): Promise; + + /** + * Calls Insert. + * @param request InsertAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertAutoscalerRequest, callback: google.cloud.compute.v1.Autoscalers.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertAutoscalerRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertAutoscalerRequest): Promise; + + /** + * Calls List. + * @param request ListAutoscalersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutoscalerList + */ + public list(request: google.cloud.compute.v1.IListAutoscalersRequest, callback: google.cloud.compute.v1.Autoscalers.ListCallback): void; + + /** + * Calls List. + * @param request ListAutoscalersRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListAutoscalersRequest): Promise; + + /** + * Calls Patch. + * @param request PatchAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchAutoscalerRequest, callback: google.cloud.compute.v1.Autoscalers.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchAutoscalerRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchAutoscalerRequest): Promise; + + /** + * Calls Update. + * @param request UpdateAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateAutoscalerRequest, callback: google.cloud.compute.v1.Autoscalers.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateAutoscalerRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateAutoscalerRequest): Promise; + } + + namespace Autoscalers { + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#aggregatedList}. + * @param error Error, if any + * @param [response] AutoscalerAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.AutoscalerAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#get}. + * @param error Error, if any + * @param [response] Autoscaler + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Autoscaler) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#list}. + * @param error Error, if any + * @param [response] AutoscalerList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.AutoscalerList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a BackendBuckets */ + class BackendBuckets extends $protobuf.rpc.Service { + + /** + * Constructs a new BackendBuckets 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 BackendBuckets 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): BackendBuckets; + + /** + * Calls AddSignedUrlKey. + * @param request AddSignedUrlKeyBackendBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addSignedUrlKey(request: google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, callback: google.cloud.compute.v1.BackendBuckets.AddSignedUrlKeyCallback): void; + + /** + * Calls AddSignedUrlKey. + * @param request AddSignedUrlKeyBackendBucketRequest message or plain object + * @returns Promise + */ + public addSignedUrlKey(request: google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteBackendBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteBackendBucketRequest, callback: google.cloud.compute.v1.BackendBuckets.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteBackendBucketRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteBackendBucketRequest): Promise; + + /** + * Calls DeleteSignedUrlKey. + * @param request DeleteSignedUrlKeyBackendBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSignedUrlKey(request: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, callback: google.cloud.compute.v1.BackendBuckets.DeleteSignedUrlKeyCallback): void; + + /** + * Calls DeleteSignedUrlKey. + * @param request DeleteSignedUrlKeyBackendBucketRequest message or plain object + * @returns Promise + */ + public deleteSignedUrlKey(request: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest): Promise; + + /** + * Calls Get. + * @param request GetBackendBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendBucket + */ + public get(request: google.cloud.compute.v1.IGetBackendBucketRequest, callback: google.cloud.compute.v1.BackendBuckets.GetCallback): void; + + /** + * Calls Get. + * @param request GetBackendBucketRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetBackendBucketRequest): Promise; + + /** + * Calls Insert. + * @param request InsertBackendBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertBackendBucketRequest, callback: google.cloud.compute.v1.BackendBuckets.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertBackendBucketRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertBackendBucketRequest): Promise; + + /** + * Calls List. + * @param request ListBackendBucketsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendBucketList + */ + public list(request: google.cloud.compute.v1.IListBackendBucketsRequest, callback: google.cloud.compute.v1.BackendBuckets.ListCallback): void; + + /** + * Calls List. + * @param request ListBackendBucketsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListBackendBucketsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchBackendBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchBackendBucketRequest, callback: google.cloud.compute.v1.BackendBuckets.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchBackendBucketRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchBackendBucketRequest): Promise; + + /** + * Calls Update. + * @param request UpdateBackendBucketRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateBackendBucketRequest, callback: google.cloud.compute.v1.BackendBuckets.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateBackendBucketRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateBackendBucketRequest): Promise; + } + + namespace BackendBuckets { + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#addSignedUrlKey}. + * @param error Error, if any + * @param [response] Operation + */ + type AddSignedUrlKeyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#deleteSignedUrlKey}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSignedUrlKeyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#get}. + * @param error Error, if any + * @param [response] BackendBucket + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendBucket) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#list}. + * @param error Error, if any + * @param [response] BackendBucketList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendBucketList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a BackendServices */ + class BackendServices extends $protobuf.rpc.Service { + + /** + * Constructs a new BackendServices 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 BackendServices 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): BackendServices; + + /** + * Calls AddSignedUrlKey. + * @param request AddSignedUrlKeyBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addSignedUrlKey(request: google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.AddSignedUrlKeyCallback): void; + + /** + * Calls AddSignedUrlKey. + * @param request AddSignedUrlKeyBackendServiceRequest message or plain object + * @returns Promise + */ + public addSignedUrlKey(request: google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest): Promise; + + /** + * Calls AggregatedList. + * @param request AggregatedListBackendServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendServiceAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListBackendServicesRequest, callback: google.cloud.compute.v1.BackendServices.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListBackendServicesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListBackendServicesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteBackendServiceRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteBackendServiceRequest): Promise; + + /** + * Calls DeleteSignedUrlKey. + * @param request DeleteSignedUrlKeyBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSignedUrlKey(request: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.DeleteSignedUrlKeyCallback): void; + + /** + * Calls DeleteSignedUrlKey. + * @param request DeleteSignedUrlKeyBackendServiceRequest message or plain object + * @returns Promise + */ + public deleteSignedUrlKey(request: google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest): Promise; + + /** + * Calls Get. + * @param request GetBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendService + */ + public get(request: google.cloud.compute.v1.IGetBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.GetCallback): void; + + /** + * Calls Get. + * @param request GetBackendServiceRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetBackendServiceRequest): Promise; + + /** + * Calls GetHealth. + * @param request GetHealthBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendServiceGroupHealth + */ + public getHealth(request: google.cloud.compute.v1.IGetHealthBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.GetHealthCallback): void; + + /** + * Calls GetHealth. + * @param request GetHealthBackendServiceRequest message or plain object + * @returns Promise + */ + public getHealth(request: google.cloud.compute.v1.IGetHealthBackendServiceRequest): Promise; + + /** + * Calls Insert. + * @param request InsertBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertBackendServiceRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertBackendServiceRequest): Promise; + + /** + * Calls List. + * @param request ListBackendServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendServiceList + */ + public list(request: google.cloud.compute.v1.IListBackendServicesRequest, callback: google.cloud.compute.v1.BackendServices.ListCallback): void; + + /** + * Calls List. + * @param request ListBackendServicesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListBackendServicesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchBackendServiceRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchBackendServiceRequest): Promise; + + /** + * Calls SetSecurityPolicy. + * @param request SetSecurityPolicyBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setSecurityPolicy(request: google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.SetSecurityPolicyCallback): void; + + /** + * Calls SetSecurityPolicy. + * @param request SetSecurityPolicyBackendServiceRequest message or plain object + * @returns Promise + */ + public setSecurityPolicy(request: google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest): Promise; + + /** + * Calls Update. + * @param request UpdateBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateBackendServiceRequest, callback: google.cloud.compute.v1.BackendServices.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateBackendServiceRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateBackendServiceRequest): Promise; + } + + namespace BackendServices { + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#addSignedUrlKey}. + * @param error Error, if any + * @param [response] Operation + */ + type AddSignedUrlKeyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#aggregatedList}. + * @param error Error, if any + * @param [response] BackendServiceAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendServiceAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#deleteSignedUrlKey}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSignedUrlKeyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#get}. + * @param error Error, if any + * @param [response] BackendService + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendService) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#getHealth}. + * @param error Error, if any + * @param [response] BackendServiceGroupHealth + */ + type GetHealthCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendServiceGroupHealth) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#list}. + * @param error Error, if any + * @param [response] BackendServiceList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendServiceList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#setSecurityPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type SetSecurityPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a DiskTypes */ + class DiskTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new DiskTypes 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 DiskTypes 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): DiskTypes; + + /** + * Calls AggregatedList. + * @param request AggregatedListDiskTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DiskTypeAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListDiskTypesRequest, callback: google.cloud.compute.v1.DiskTypes.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListDiskTypesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListDiskTypesRequest): Promise; + + /** + * Calls Get. + * @param request GetDiskTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DiskType + */ + public get(request: google.cloud.compute.v1.IGetDiskTypeRequest, callback: google.cloud.compute.v1.DiskTypes.GetCallback): void; + + /** + * Calls Get. + * @param request GetDiskTypeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetDiskTypeRequest): Promise; + + /** + * Calls List. + * @param request ListDiskTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DiskTypeList + */ + public list(request: google.cloud.compute.v1.IListDiskTypesRequest, callback: google.cloud.compute.v1.DiskTypes.ListCallback): void; + + /** + * Calls List. + * @param request ListDiskTypesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListDiskTypesRequest): Promise; + } + + namespace DiskTypes { + + /** + * Callback as used by {@link google.cloud.compute.v1.DiskTypes#aggregatedList}. + * @param error Error, if any + * @param [response] DiskTypeAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.DiskTypeAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.DiskTypes#get}. + * @param error Error, if any + * @param [response] DiskType + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.DiskType) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.DiskTypes#list}. + * @param error Error, if any + * @param [response] DiskTypeList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.DiskTypeList) => void; + } + + /** Represents a Disks */ + class Disks extends $protobuf.rpc.Service { + + /** + * Constructs a new Disks 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 Disks 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): Disks; + + /** + * Calls AddResourcePolicies. + * @param request AddResourcePoliciesDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addResourcePolicies(request: google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, callback: google.cloud.compute.v1.Disks.AddResourcePoliciesCallback): void; + + /** + * Calls AddResourcePolicies. + * @param request AddResourcePoliciesDiskRequest message or plain object + * @returns Promise + */ + public addResourcePolicies(request: google.cloud.compute.v1.IAddResourcePoliciesDiskRequest): Promise; + + /** + * Calls AggregatedList. + * @param request AggregatedListDisksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DiskAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListDisksRequest, callback: google.cloud.compute.v1.Disks.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListDisksRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListDisksRequest): Promise; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSnapshot(request: google.cloud.compute.v1.ICreateSnapshotDiskRequest, callback: google.cloud.compute.v1.Disks.CreateSnapshotCallback): void; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotDiskRequest message or plain object + * @returns Promise + */ + public createSnapshot(request: google.cloud.compute.v1.ICreateSnapshotDiskRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteDiskRequest, callback: google.cloud.compute.v1.Disks.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteDiskRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteDiskRequest): Promise; + + /** + * Calls Get. + * @param request GetDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Disk + */ + public get(request: google.cloud.compute.v1.IGetDiskRequest, callback: google.cloud.compute.v1.Disks.GetCallback): void; + + /** + * Calls Get. + * @param request GetDiskRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetDiskRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyDiskRequest, callback: google.cloud.compute.v1.Disks.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyDiskRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyDiskRequest): Promise; + + /** + * Calls Insert. + * @param request InsertDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertDiskRequest, callback: google.cloud.compute.v1.Disks.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertDiskRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertDiskRequest): Promise; + + /** + * Calls List. + * @param request ListDisksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DiskList + */ + public list(request: google.cloud.compute.v1.IListDisksRequest, callback: google.cloud.compute.v1.Disks.ListCallback): void; + + /** + * Calls List. + * @param request ListDisksRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListDisksRequest): Promise; + + /** + * Calls RemoveResourcePolicies. + * @param request RemoveResourcePoliciesDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeResourcePolicies(request: google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, callback: google.cloud.compute.v1.Disks.RemoveResourcePoliciesCallback): void; + + /** + * Calls RemoveResourcePolicies. + * @param request RemoveResourcePoliciesDiskRequest message or plain object + * @returns Promise + */ + public removeResourcePolicies(request: google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest): Promise; + + /** + * Calls Resize. + * @param request ResizeDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resize(request: google.cloud.compute.v1.IResizeDiskRequest, callback: google.cloud.compute.v1.Disks.ResizeCallback): void; + + /** + * Calls Resize. + * @param request ResizeDiskRequest message or plain object + * @returns Promise + */ + public resize(request: google.cloud.compute.v1.IResizeDiskRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyDiskRequest, callback: google.cloud.compute.v1.Disks.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyDiskRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyDiskRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsDiskRequest, callback: google.cloud.compute.v1.Disks.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsDiskRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsDiskRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsDiskRequest, callback: google.cloud.compute.v1.Disks.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsDiskRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsDiskRequest): Promise; + } + + namespace Disks { + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#addResourcePolicies}. + * @param error Error, if any + * @param [response] Operation + */ + type AddResourcePoliciesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#aggregatedList}. + * @param error Error, if any + * @param [response] DiskAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.DiskAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#createSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSnapshotCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#get}. + * @param error Error, if any + * @param [response] Disk + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Disk) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#list}. + * @param error Error, if any + * @param [response] DiskList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.DiskList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#removeResourcePolicies}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveResourcePoliciesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#resize}. + * @param error Error, if any + * @param [response] Operation + */ + type ResizeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents an ExternalVpnGateways */ + class ExternalVpnGateways extends $protobuf.rpc.Service { + + /** + * Constructs a new ExternalVpnGateways 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 ExternalVpnGateways 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): ExternalVpnGateways; + + /** + * Calls Delete. + * @param request DeleteExternalVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, callback: google.cloud.compute.v1.ExternalVpnGateways.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteExternalVpnGatewayRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest): Promise; + + /** + * Calls Get. + * @param request GetExternalVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalVpnGateway + */ + public get(request: google.cloud.compute.v1.IGetExternalVpnGatewayRequest, callback: google.cloud.compute.v1.ExternalVpnGateways.GetCallback): void; + + /** + * Calls Get. + * @param request GetExternalVpnGatewayRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetExternalVpnGatewayRequest): Promise; + + /** + * Calls Insert. + * @param request InsertExternalVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, callback: google.cloud.compute.v1.ExternalVpnGateways.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertExternalVpnGatewayRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertExternalVpnGatewayRequest): Promise; + + /** + * Calls List. + * @param request ListExternalVpnGatewaysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExternalVpnGatewayList + */ + public list(request: google.cloud.compute.v1.IListExternalVpnGatewaysRequest, callback: google.cloud.compute.v1.ExternalVpnGateways.ListCallback): void; + + /** + * Calls List. + * @param request ListExternalVpnGatewaysRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListExternalVpnGatewaysRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsExternalVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, callback: google.cloud.compute.v1.ExternalVpnGateways.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsExternalVpnGatewayRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsExternalVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, callback: google.cloud.compute.v1.ExternalVpnGateways.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsExternalVpnGatewayRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest): Promise; + } + + namespace ExternalVpnGateways { + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#get}. + * @param error Error, if any + * @param [response] ExternalVpnGateway + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.ExternalVpnGateway) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#list}. + * @param error Error, if any + * @param [response] ExternalVpnGatewayList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ExternalVpnGatewayList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a FirewallPolicies */ + class FirewallPolicies extends $protobuf.rpc.Service { + + /** + * Constructs a new FirewallPolicies 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 FirewallPolicies 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): FirewallPolicies; + + /** + * Calls AddAssociation. + * @param request AddAssociationFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addAssociation(request: google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.AddAssociationCallback): void; + + /** + * Calls AddAssociation. + * @param request AddAssociationFirewallPolicyRequest message or plain object + * @returns Promise + */ + public addAssociation(request: google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest): Promise; + + /** + * Calls AddRule. + * @param request AddRuleFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addRule(request: google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.AddRuleCallback): void; + + /** + * Calls AddRule. + * @param request AddRuleFirewallPolicyRequest message or plain object + * @returns Promise + */ + public addRule(request: google.cloud.compute.v1.IAddRuleFirewallPolicyRequest): Promise; + + /** + * Calls CloneRules. + * @param request CloneRulesFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cloneRules(request: google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.CloneRulesCallback): void; + + /** + * Calls CloneRules. + * @param request CloneRulesFirewallPolicyRequest message or plain object + * @returns Promise + */ + public cloneRules(request: google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteFirewallPolicyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteFirewallPolicyRequest): Promise; + + /** + * Calls Get. + * @param request GetFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallPolicy + */ + public get(request: google.cloud.compute.v1.IGetFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.GetCallback): void; + + /** + * Calls Get. + * @param request GetFirewallPolicyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetFirewallPolicyRequest): Promise; + + /** + * Calls GetAssociation. + * @param request GetAssociationFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallPolicyAssociation + */ + public getAssociation(request: google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.GetAssociationCallback): void; + + /** + * Calls GetAssociation. + * @param request GetAssociationFirewallPolicyRequest message or plain object + * @returns Promise + */ + public getAssociation(request: google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyFirewallPolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest): Promise; + + /** + * Calls GetRule. + * @param request GetRuleFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallPolicyRule + */ + public getRule(request: google.cloud.compute.v1.IGetRuleFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.GetRuleCallback): void; + + /** + * Calls GetRule. + * @param request GetRuleFirewallPolicyRequest message or plain object + * @returns Promise + */ + public getRule(request: google.cloud.compute.v1.IGetRuleFirewallPolicyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertFirewallPolicyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertFirewallPolicyRequest): Promise; + + /** + * Calls List. + * @param request ListFirewallPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallPolicyList + */ + public list(request: google.cloud.compute.v1.IListFirewallPoliciesRequest, callback: google.cloud.compute.v1.FirewallPolicies.ListCallback): void; + + /** + * Calls List. + * @param request ListFirewallPoliciesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListFirewallPoliciesRequest): Promise; + + /** + * Calls ListAssociations. + * @param request ListAssociationsFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallPoliciesListAssociationsResponse + */ + public listAssociations(request: google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.ListAssociationsCallback): void; + + /** + * Calls ListAssociations. + * @param request ListAssociationsFirewallPolicyRequest message or plain object + * @returns Promise + */ + public listAssociations(request: google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest): Promise; + + /** + * Calls Move. + * @param request MoveFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public move(request: google.cloud.compute.v1.IMoveFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.MoveCallback): void; + + /** + * Calls Move. + * @param request MoveFirewallPolicyRequest message or plain object + * @returns Promise + */ + public move(request: google.cloud.compute.v1.IMoveFirewallPolicyRequest): Promise; + + /** + * Calls Patch. + * @param request PatchFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchFirewallPolicyRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchFirewallPolicyRequest): Promise; + + /** + * Calls PatchRule. + * @param request PatchRuleFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patchRule(request: google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.PatchRuleCallback): void; + + /** + * Calls PatchRule. + * @param request PatchRuleFirewallPolicyRequest message or plain object + * @returns Promise + */ + public patchRule(request: google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest): Promise; + + /** + * Calls RemoveAssociation. + * @param request RemoveAssociationFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeAssociation(request: google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.RemoveAssociationCallback): void; + + /** + * Calls RemoveAssociation. + * @param request RemoveAssociationFirewallPolicyRequest message or plain object + * @returns Promise + */ + public removeAssociation(request: google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest): Promise; + + /** + * Calls RemoveRule. + * @param request RemoveRuleFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeRule(request: google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.RemoveRuleCallback): void; + + /** + * Calls RemoveRule. + * @param request RemoveRuleFirewallPolicyRequest message or plain object + * @returns Promise + */ + public removeRule(request: google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyFirewallPolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest, callback: google.cloud.compute.v1.FirewallPolicies.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsFirewallPolicyRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest): Promise; + } + + namespace FirewallPolicies { + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#addAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type AddAssociationCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#addRule}. + * @param error Error, if any + * @param [response] Operation + */ + type AddRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#cloneRules}. + * @param error Error, if any + * @param [response] Operation + */ + type CloneRulesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#get}. + * @param error Error, if any + * @param [response] FirewallPolicy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.FirewallPolicy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#getAssociation}. + * @param error Error, if any + * @param [response] FirewallPolicyAssociation + */ + type GetAssociationCallback = (error: (Error|null), response?: google.cloud.compute.v1.FirewallPolicyAssociation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#getRule}. + * @param error Error, if any + * @param [response] FirewallPolicyRule + */ + type GetRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.FirewallPolicyRule) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#list}. + * @param error Error, if any + * @param [response] FirewallPolicyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.FirewallPolicyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#listAssociations}. + * @param error Error, if any + * @param [response] FirewallPoliciesListAssociationsResponse + */ + type ListAssociationsCallback = (error: (Error|null), response?: google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#move}. + * @param error Error, if any + * @param [response] Operation + */ + type MoveCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#patchRule}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#removeAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveAssociationCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#removeRule}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a Firewalls */ + class Firewalls extends $protobuf.rpc.Service { + + /** + * Constructs a new Firewalls 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 Firewalls 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): Firewalls; + + /** + * Calls Delete. + * @param request DeleteFirewallRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteFirewallRequest, callback: google.cloud.compute.v1.Firewalls.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteFirewallRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteFirewallRequest): Promise; + + /** + * Calls Get. + * @param request GetFirewallRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Firewall + */ + public get(request: google.cloud.compute.v1.IGetFirewallRequest, callback: google.cloud.compute.v1.Firewalls.GetCallback): void; + + /** + * Calls Get. + * @param request GetFirewallRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetFirewallRequest): Promise; + + /** + * Calls Insert. + * @param request InsertFirewallRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertFirewallRequest, callback: google.cloud.compute.v1.Firewalls.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertFirewallRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertFirewallRequest): Promise; + + /** + * Calls List. + * @param request ListFirewallsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallList + */ + public list(request: google.cloud.compute.v1.IListFirewallsRequest, callback: google.cloud.compute.v1.Firewalls.ListCallback): void; + + /** + * Calls List. + * @param request ListFirewallsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListFirewallsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchFirewallRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchFirewallRequest, callback: google.cloud.compute.v1.Firewalls.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchFirewallRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchFirewallRequest): Promise; + + /** + * Calls Update. + * @param request UpdateFirewallRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateFirewallRequest, callback: google.cloud.compute.v1.Firewalls.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateFirewallRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateFirewallRequest): Promise; + } + + namespace Firewalls { + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#get}. + * @param error Error, if any + * @param [response] Firewall + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Firewall) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#list}. + * @param error Error, if any + * @param [response] FirewallList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.FirewallList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a ForwardingRules */ + class ForwardingRules extends $protobuf.rpc.Service { + + /** + * Constructs a new ForwardingRules 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 ForwardingRules 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): ForwardingRules; + + /** + * Calls AggregatedList. + * @param request AggregatedListForwardingRulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ForwardingRuleAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListForwardingRulesRequest, callback: google.cloud.compute.v1.ForwardingRules.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListForwardingRulesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListForwardingRulesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteForwardingRuleRequest, callback: google.cloud.compute.v1.ForwardingRules.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteForwardingRuleRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteForwardingRuleRequest): Promise; + + /** + * Calls Get. + * @param request GetForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ForwardingRule + */ + public get(request: google.cloud.compute.v1.IGetForwardingRuleRequest, callback: google.cloud.compute.v1.ForwardingRules.GetCallback): void; + + /** + * Calls Get. + * @param request GetForwardingRuleRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetForwardingRuleRequest): Promise; + + /** + * Calls Insert. + * @param request InsertForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertForwardingRuleRequest, callback: google.cloud.compute.v1.ForwardingRules.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertForwardingRuleRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertForwardingRuleRequest): Promise; + + /** + * Calls List. + * @param request ListForwardingRulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ForwardingRuleList + */ + public list(request: google.cloud.compute.v1.IListForwardingRulesRequest, callback: google.cloud.compute.v1.ForwardingRules.ListCallback): void; + + /** + * Calls List. + * @param request ListForwardingRulesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListForwardingRulesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchForwardingRuleRequest, callback: google.cloud.compute.v1.ForwardingRules.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchForwardingRuleRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchForwardingRuleRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, callback: google.cloud.compute.v1.ForwardingRules.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsForwardingRuleRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsForwardingRuleRequest): Promise; + + /** + * Calls SetTarget. + * @param request SetTargetForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setTarget(request: google.cloud.compute.v1.ISetTargetForwardingRuleRequest, callback: google.cloud.compute.v1.ForwardingRules.SetTargetCallback): void; + + /** + * Calls SetTarget. + * @param request SetTargetForwardingRuleRequest message or plain object + * @returns Promise + */ + public setTarget(request: google.cloud.compute.v1.ISetTargetForwardingRuleRequest): Promise; + } + + namespace ForwardingRules { + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#aggregatedList}. + * @param error Error, if any + * @param [response] ForwardingRuleAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ForwardingRuleAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#get}. + * @param error Error, if any + * @param [response] ForwardingRule + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.ForwardingRule) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#list}. + * @param error Error, if any + * @param [response] ForwardingRuleList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ForwardingRuleList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#setTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type SetTargetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a GlobalAddresses */ + class GlobalAddresses extends $protobuf.rpc.Service { + + /** + * Constructs a new GlobalAddresses 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 GlobalAddresses 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): GlobalAddresses; + + /** + * Calls Delete. + * @param request DeleteGlobalAddressRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalAddressRequest, callback: google.cloud.compute.v1.GlobalAddresses.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteGlobalAddressRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalAddressRequest): Promise; + + /** + * Calls Get. + * @param request GetGlobalAddressRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Address + */ + public get(request: google.cloud.compute.v1.IGetGlobalAddressRequest, callback: google.cloud.compute.v1.GlobalAddresses.GetCallback): void; + + /** + * Calls Get. + * @param request GetGlobalAddressRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetGlobalAddressRequest): Promise; + + /** + * Calls Insert. + * @param request InsertGlobalAddressRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalAddressRequest, callback: google.cloud.compute.v1.GlobalAddresses.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertGlobalAddressRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalAddressRequest): Promise; + + /** + * Calls List. + * @param request ListGlobalAddressesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddressList + */ + public list(request: google.cloud.compute.v1.IListGlobalAddressesRequest, callback: google.cloud.compute.v1.GlobalAddresses.ListCallback): void; + + /** + * Calls List. + * @param request ListGlobalAddressesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListGlobalAddressesRequest): Promise; + } + + namespace GlobalAddresses { + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#get}. + * @param error Error, if any + * @param [response] Address + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Address) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#list}. + * @param error Error, if any + * @param [response] AddressList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.AddressList) => void; + } + + /** Represents a GlobalForwardingRules */ + class GlobalForwardingRules extends $protobuf.rpc.Service { + + /** + * Constructs a new GlobalForwardingRules 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 GlobalForwardingRules 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): GlobalForwardingRules; + + /** + * Calls Delete. + * @param request DeleteGlobalForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, callback: google.cloud.compute.v1.GlobalForwardingRules.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteGlobalForwardingRuleRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest): Promise; + + /** + * Calls Get. + * @param request GetGlobalForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ForwardingRule + */ + public get(request: google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, callback: google.cloud.compute.v1.GlobalForwardingRules.GetCallback): void; + + /** + * Calls Get. + * @param request GetGlobalForwardingRuleRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetGlobalForwardingRuleRequest): Promise; + + /** + * Calls Insert. + * @param request InsertGlobalForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, callback: google.cloud.compute.v1.GlobalForwardingRules.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertGlobalForwardingRuleRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest): Promise; + + /** + * Calls List. + * @param request ListGlobalForwardingRulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ForwardingRuleList + */ + public list(request: google.cloud.compute.v1.IListGlobalForwardingRulesRequest, callback: google.cloud.compute.v1.GlobalForwardingRules.ListCallback): void; + + /** + * Calls List. + * @param request ListGlobalForwardingRulesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListGlobalForwardingRulesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchGlobalForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, callback: google.cloud.compute.v1.GlobalForwardingRules.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchGlobalForwardingRuleRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsGlobalForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, callback: google.cloud.compute.v1.GlobalForwardingRules.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsGlobalForwardingRuleRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest): Promise; + + /** + * Calls SetTarget. + * @param request SetTargetGlobalForwardingRuleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setTarget(request: google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, callback: google.cloud.compute.v1.GlobalForwardingRules.SetTargetCallback): void; + + /** + * Calls SetTarget. + * @param request SetTargetGlobalForwardingRuleRequest message or plain object + * @returns Promise + */ + public setTarget(request: google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest): Promise; + } + + namespace GlobalForwardingRules { + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#get}. + * @param error Error, if any + * @param [response] ForwardingRule + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.ForwardingRule) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#list}. + * @param error Error, if any + * @param [response] ForwardingRuleList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ForwardingRuleList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#setTarget}. + * @param error Error, if any + * @param [response] Operation + */ + type SetTargetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a GlobalNetworkEndpointGroups */ + class GlobalNetworkEndpointGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new GlobalNetworkEndpointGroups 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 GlobalNetworkEndpointGroups 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): GlobalNetworkEndpointGroups; + + /** + * Calls AttachNetworkEndpoints. + * @param request AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public attachNetworkEndpoints(request: google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.GlobalNetworkEndpointGroups.AttachNetworkEndpointsCallback): void; + + /** + * Calls AttachNetworkEndpoints. + * @param request AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public attachNetworkEndpoints(request: google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteGlobalNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.GlobalNetworkEndpointGroups.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteGlobalNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest): Promise; + + /** + * Calls DetachNetworkEndpoints. + * @param request DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public detachNetworkEndpoints(request: google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.GlobalNetworkEndpointGroups.DetachNetworkEndpointsCallback): void; + + /** + * Calls DetachNetworkEndpoints. + * @param request DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public detachNetworkEndpoints(request: google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest): Promise; + + /** + * Calls Get. + * @param request GetGlobalNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroup + */ + public get(request: google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.GlobalNetworkEndpointGroups.GetCallback): void; + + /** + * Calls Get. + * @param request GetGlobalNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest): Promise; + + /** + * Calls Insert. + * @param request InsertGlobalNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.GlobalNetworkEndpointGroups.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertGlobalNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest): Promise; + + /** + * Calls List. + * @param request ListGlobalNetworkEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroupList + */ + public list(request: google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, callback: google.cloud.compute.v1.GlobalNetworkEndpointGroups.ListCallback): void; + + /** + * Calls List. + * @param request ListGlobalNetworkEndpointGroupsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest): Promise; + + /** + * Calls ListNetworkEndpoints. + * @param request ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroupsListNetworkEndpoints + */ + public listNetworkEndpoints(request: google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, callback: google.cloud.compute.v1.GlobalNetworkEndpointGroups.ListNetworkEndpointsCallback): void; + + /** + * Calls ListNetworkEndpoints. + * @param request ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object + * @returns Promise + */ + public listNetworkEndpoints(request: google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest): Promise; + } + + namespace GlobalNetworkEndpointGroups { + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#attachNetworkEndpoints}. + * @param error Error, if any + * @param [response] Operation + */ + type AttachNetworkEndpointsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#detachNetworkEndpoints}. + * @param error Error, if any + * @param [response] Operation + */ + type DetachNetworkEndpointsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#get}. + * @param error Error, if any + * @param [response] NetworkEndpointGroup + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroup) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#list}. + * @param error Error, if any + * @param [response] NetworkEndpointGroupList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroupList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#listNetworkEndpoints}. + * @param error Error, if any + * @param [response] NetworkEndpointGroupsListNetworkEndpoints + */ + type ListNetworkEndpointsCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints) => void; + } + + /** Represents a GlobalOperations */ + class GlobalOperations extends $protobuf.rpc.Service { + + /** + * Constructs a new GlobalOperations 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 GlobalOperations 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): GlobalOperations; + + /** + * Calls AggregatedList. + * @param request AggregatedListGlobalOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OperationAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest, callback: google.cloud.compute.v1.GlobalOperations.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListGlobalOperationsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteGlobalOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeleteGlobalOperationResponse + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalOperationRequest, callback: google.cloud.compute.v1.GlobalOperations.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteGlobalOperationRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalOperationRequest): Promise; + + /** + * Calls Get. + * @param request GetGlobalOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public get(request: google.cloud.compute.v1.IGetGlobalOperationRequest, callback: google.cloud.compute.v1.GlobalOperations.GetCallback): void; + + /** + * Calls Get. + * @param request GetGlobalOperationRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetGlobalOperationRequest): Promise; + + /** + * Calls List. + * @param request ListGlobalOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OperationList + */ + public list(request: google.cloud.compute.v1.IListGlobalOperationsRequest, callback: google.cloud.compute.v1.GlobalOperations.ListCallback): void; + + /** + * Calls List. + * @param request ListGlobalOperationsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListGlobalOperationsRequest): Promise; + + /** + * Calls Wait. + * @param request WaitGlobalOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public wait(request: google.cloud.compute.v1.IWaitGlobalOperationRequest, callback: google.cloud.compute.v1.GlobalOperations.WaitCallback): void; + + /** + * Calls Wait. + * @param request WaitGlobalOperationRequest message or plain object + * @returns Promise + */ + public wait(request: google.cloud.compute.v1.IWaitGlobalOperationRequest): Promise; + } + + namespace GlobalOperations { + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#aggregatedList}. + * @param error Error, if any + * @param [response] OperationAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.OperationAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#delete_}. + * @param error Error, if any + * @param [response] DeleteGlobalOperationResponse + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.DeleteGlobalOperationResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#get}. + * @param error Error, if any + * @param [response] Operation + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#list}. + * @param error Error, if any + * @param [response] OperationList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.OperationList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#wait}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a GlobalOrganizationOperations */ + class GlobalOrganizationOperations extends $protobuf.rpc.Service { + + /** + * Constructs a new GlobalOrganizationOperations 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 GlobalOrganizationOperations 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): GlobalOrganizationOperations; + + /** + * Calls Delete. + * @param request DeleteGlobalOrganizationOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeleteGlobalOrganizationOperationResponse + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest, callback: google.cloud.compute.v1.GlobalOrganizationOperations.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteGlobalOrganizationOperationRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest): Promise; + + /** + * Calls Get. + * @param request GetGlobalOrganizationOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public get(request: google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest, callback: google.cloud.compute.v1.GlobalOrganizationOperations.GetCallback): void; + + /** + * Calls Get. + * @param request GetGlobalOrganizationOperationRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest): Promise; + + /** + * Calls List. + * @param request ListGlobalOrganizationOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OperationList + */ + public list(request: google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, callback: google.cloud.compute.v1.GlobalOrganizationOperations.ListCallback): void; + + /** + * Calls List. + * @param request ListGlobalOrganizationOperationsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest): Promise; + } + + namespace GlobalOrganizationOperations { + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOrganizationOperations#delete_}. + * @param error Error, if any + * @param [response] DeleteGlobalOrganizationOperationResponse + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOrganizationOperations#get}. + * @param error Error, if any + * @param [response] Operation + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOrganizationOperations#list}. + * @param error Error, if any + * @param [response] OperationList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.OperationList) => void; + } + + /** Represents a GlobalPublicDelegatedPrefixes */ + class GlobalPublicDelegatedPrefixes extends $protobuf.rpc.Service { + + /** + * Constructs a new GlobalPublicDelegatedPrefixes 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 GlobalPublicDelegatedPrefixes 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): GlobalPublicDelegatedPrefixes; + + /** + * Calls Delete. + * @param request DeleteGlobalPublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest): Promise; + + /** + * Calls Get. + * @param request GetGlobalPublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicDelegatedPrefix + */ + public get(request: google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.GetCallback): void; + + /** + * Calls Get. + * @param request GetGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest): Promise; + + /** + * Calls Insert. + * @param request InsertGlobalPublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest): Promise; + + /** + * Calls List. + * @param request ListGlobalPublicDelegatedPrefixesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicDelegatedPrefixList + */ + public list(request: google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, callback: google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.ListCallback): void; + + /** + * Calls List. + * @param request ListGlobalPublicDelegatedPrefixesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchGlobalPublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest): Promise; + } + + namespace GlobalPublicDelegatedPrefixes { + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#get}. + * @param error Error, if any + * @param [response] PublicDelegatedPrefix + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.PublicDelegatedPrefix) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#list}. + * @param error Error, if any + * @param [response] PublicDelegatedPrefixList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.PublicDelegatedPrefixList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a HealthChecks */ + class HealthChecks extends $protobuf.rpc.Service { + + /** + * Constructs a new HealthChecks 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 HealthChecks 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): HealthChecks; + + /** + * Calls AggregatedList. + * @param request AggregatedListHealthChecksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HealthChecksAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListHealthChecksRequest, callback: google.cloud.compute.v1.HealthChecks.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListHealthChecksRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListHealthChecksRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteHealthCheckRequest, callback: google.cloud.compute.v1.HealthChecks.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteHealthCheckRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteHealthCheckRequest): Promise; + + /** + * Calls Get. + * @param request GetHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HealthCheck + */ + public get(request: google.cloud.compute.v1.IGetHealthCheckRequest, callback: google.cloud.compute.v1.HealthChecks.GetCallback): void; + + /** + * Calls Get. + * @param request GetHealthCheckRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetHealthCheckRequest): Promise; + + /** + * Calls Insert. + * @param request InsertHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertHealthCheckRequest, callback: google.cloud.compute.v1.HealthChecks.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertHealthCheckRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertHealthCheckRequest): Promise; + + /** + * Calls List. + * @param request ListHealthChecksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HealthCheckList + */ + public list(request: google.cloud.compute.v1.IListHealthChecksRequest, callback: google.cloud.compute.v1.HealthChecks.ListCallback): void; + + /** + * Calls List. + * @param request ListHealthChecksRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListHealthChecksRequest): Promise; + + /** + * Calls Patch. + * @param request PatchHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchHealthCheckRequest, callback: google.cloud.compute.v1.HealthChecks.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchHealthCheckRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchHealthCheckRequest): Promise; + + /** + * Calls Update. + * @param request UpdateHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateHealthCheckRequest, callback: google.cloud.compute.v1.HealthChecks.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateHealthCheckRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateHealthCheckRequest): Promise; + } + + namespace HealthChecks { + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#aggregatedList}. + * @param error Error, if any + * @param [response] HealthChecksAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.HealthChecksAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#get}. + * @param error Error, if any + * @param [response] HealthCheck + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.HealthCheck) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#list}. + * @param error Error, if any + * @param [response] HealthCheckList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.HealthCheckList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents an Images */ + class Images extends $protobuf.rpc.Service { + + /** + * Constructs a new Images 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 Images 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): Images; + + /** + * Calls Delete. + * @param request DeleteImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteImageRequest, callback: google.cloud.compute.v1.Images.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteImageRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteImageRequest): Promise; + + /** + * Calls Deprecate. + * @param request DeprecateImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deprecate(request: google.cloud.compute.v1.IDeprecateImageRequest, callback: google.cloud.compute.v1.Images.DeprecateCallback): void; + + /** + * Calls Deprecate. + * @param request DeprecateImageRequest message or plain object + * @returns Promise + */ + public deprecate(request: google.cloud.compute.v1.IDeprecateImageRequest): Promise; + + /** + * Calls Get. + * @param request GetImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Image + */ + public get(request: google.cloud.compute.v1.IGetImageRequest, callback: google.cloud.compute.v1.Images.GetCallback): void; + + /** + * Calls Get. + * @param request GetImageRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetImageRequest): Promise; + + /** + * Calls GetFromFamily. + * @param request GetFromFamilyImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Image + */ + public getFromFamily(request: google.cloud.compute.v1.IGetFromFamilyImageRequest, callback: google.cloud.compute.v1.Images.GetFromFamilyCallback): void; + + /** + * Calls GetFromFamily. + * @param request GetFromFamilyImageRequest message or plain object + * @returns Promise + */ + public getFromFamily(request: google.cloud.compute.v1.IGetFromFamilyImageRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyImageRequest, callback: google.cloud.compute.v1.Images.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyImageRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyImageRequest): Promise; + + /** + * Calls Insert. + * @param request InsertImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertImageRequest, callback: google.cloud.compute.v1.Images.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertImageRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertImageRequest): Promise; + + /** + * Calls List. + * @param request ListImagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ImageList + */ + public list(request: google.cloud.compute.v1.IListImagesRequest, callback: google.cloud.compute.v1.Images.ListCallback): void; + + /** + * Calls List. + * @param request ListImagesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListImagesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchImageRequest, callback: google.cloud.compute.v1.Images.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchImageRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchImageRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyImageRequest, callback: google.cloud.compute.v1.Images.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyImageRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyImageRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsImageRequest, callback: google.cloud.compute.v1.Images.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsImageRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsImageRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsImageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsImageRequest, callback: google.cloud.compute.v1.Images.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsImageRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsImageRequest): Promise; + } + + namespace Images { + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#deprecate}. + * @param error Error, if any + * @param [response] Operation + */ + type DeprecateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#get}. + * @param error Error, if any + * @param [response] Image + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Image) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#getFromFamily}. + * @param error Error, if any + * @param [response] Image + */ + type GetFromFamilyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Image) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#list}. + * @param error Error, if any + * @param [response] ImageList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ImageList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents an InstanceGroupManagers */ + class InstanceGroupManagers extends $protobuf.rpc.Service { + + /** + * Constructs a new InstanceGroupManagers 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 InstanceGroupManagers 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): InstanceGroupManagers; + + /** + * Calls AbandonInstances. + * @param request AbandonInstancesInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public abandonInstances(request: google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.AbandonInstancesCallback): void; + + /** + * Calls AbandonInstances. + * @param request AbandonInstancesInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public abandonInstances(request: google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest): Promise; + + /** + * Calls AggregatedList. + * @param request AggregatedListInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupManagerAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest): Promise; + + /** + * Calls ApplyUpdatesToInstances. + * @param request ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applyUpdatesToInstances(request: google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.ApplyUpdatesToInstancesCallback): void; + + /** + * Calls ApplyUpdatesToInstances. + * @param request ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public applyUpdatesToInstances(request: google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest): Promise; + + /** + * Calls CreateInstances. + * @param request CreateInstancesInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstances(request: google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.CreateInstancesCallback): void; + + /** + * Calls CreateInstances. + * @param request CreateInstancesInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public createInstances(request: google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest): Promise; + + /** + * Calls DeleteInstances. + * @param request DeleteInstancesInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstances(request: google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.DeleteInstancesCallback): void; + + /** + * Calls DeleteInstances. + * @param request DeleteInstancesInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public deleteInstances(request: google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest): Promise; + + /** + * Calls DeletePerInstanceConfigs. + * @param request DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deletePerInstanceConfigs(request: google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.DeletePerInstanceConfigsCallback): void; + + /** + * Calls DeletePerInstanceConfigs. + * @param request DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public deletePerInstanceConfigs(request: google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest): Promise; + + /** + * Calls Get. + * @param request GetInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupManager + */ + public get(request: google.cloud.compute.v1.IGetInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.GetCallback): void; + + /** + * Calls Get. + * @param request GetInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetInstanceGroupManagerRequest): Promise; + + /** + * Calls Insert. + * @param request InsertInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceGroupManagerRequest): Promise; + + /** + * Calls List. + * @param request ListInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupManagerList + */ + public list(request: google.cloud.compute.v1.IListInstanceGroupManagersRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.ListCallback): void; + + /** + * Calls List. + * @param request ListInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListInstanceGroupManagersRequest): Promise; + + /** + * Calls ListErrors. + * @param request ListErrorsInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupManagersListErrorsResponse + */ + public listErrors(request: google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.ListErrorsCallback): void; + + /** + * Calls ListErrors. + * @param request ListErrorsInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public listErrors(request: google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest): Promise; + + /** + * Calls ListManagedInstances. + * @param request ListManagedInstancesInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupManagersListManagedInstancesResponse + */ + public listManagedInstances(request: google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.ListManagedInstancesCallback): void; + + /** + * Calls ListManagedInstances. + * @param request ListManagedInstancesInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public listManagedInstances(request: google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest): Promise; + + /** + * Calls ListPerInstanceConfigs. + * @param request ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupManagersListPerInstanceConfigsResp + */ + public listPerInstanceConfigs(request: google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.ListPerInstanceConfigsCallback): void; + + /** + * Calls ListPerInstanceConfigs. + * @param request ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public listPerInstanceConfigs(request: google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest): Promise; + + /** + * Calls Patch. + * @param request PatchInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchInstanceGroupManagerRequest): Promise; + + /** + * Calls PatchPerInstanceConfigs. + * @param request PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patchPerInstanceConfigs(request: google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.PatchPerInstanceConfigsCallback): void; + + /** + * Calls PatchPerInstanceConfigs. + * @param request PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public patchPerInstanceConfigs(request: google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest): Promise; + + /** + * Calls RecreateInstances. + * @param request RecreateInstancesInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public recreateInstances(request: google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.RecreateInstancesCallback): void; + + /** + * Calls RecreateInstances. + * @param request RecreateInstancesInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public recreateInstances(request: google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest): Promise; + + /** + * Calls Resize. + * @param request ResizeInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resize(request: google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.ResizeCallback): void; + + /** + * Calls Resize. + * @param request ResizeInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public resize(request: google.cloud.compute.v1.IResizeInstanceGroupManagerRequest): Promise; + + /** + * Calls SetInstanceTemplate. + * @param request SetInstanceTemplateInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setInstanceTemplate(request: google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.SetInstanceTemplateCallback): void; + + /** + * Calls SetInstanceTemplate. + * @param request SetInstanceTemplateInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public setInstanceTemplate(request: google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest): Promise; + + /** + * Calls SetTargetPools. + * @param request SetTargetPoolsInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setTargetPools(request: google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.SetTargetPoolsCallback): void; + + /** + * Calls SetTargetPools. + * @param request SetTargetPoolsInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public setTargetPools(request: google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest): Promise; + + /** + * Calls UpdatePerInstanceConfigs. + * @param request UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updatePerInstanceConfigs(request: google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, callback: google.cloud.compute.v1.InstanceGroupManagers.UpdatePerInstanceConfigsCallback): void; + + /** + * Calls UpdatePerInstanceConfigs. + * @param request UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public updatePerInstanceConfigs(request: google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest): Promise; + } + + namespace InstanceGroupManagers { + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#abandonInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type AbandonInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#aggregatedList}. + * @param error Error, if any + * @param [response] InstanceGroupManagerAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupManagerAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#applyUpdatesToInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplyUpdatesToInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#createInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#deleteInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#deletePerInstanceConfigs}. + * @param error Error, if any + * @param [response] Operation + */ + type DeletePerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#get}. + * @param error Error, if any + * @param [response] InstanceGroupManager + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupManager) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#list}. + * @param error Error, if any + * @param [response] InstanceGroupManagerList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupManagerList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#listErrors}. + * @param error Error, if any + * @param [response] InstanceGroupManagersListErrorsResponse + */ + type ListErrorsCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#listManagedInstances}. + * @param error Error, if any + * @param [response] InstanceGroupManagersListManagedInstancesResponse + */ + type ListManagedInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#listPerInstanceConfigs}. + * @param error Error, if any + * @param [response] InstanceGroupManagersListPerInstanceConfigsResp + */ + type ListPerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#patchPerInstanceConfigs}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchPerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#recreateInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type RecreateInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#resize}. + * @param error Error, if any + * @param [response] Operation + */ + type ResizeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#setInstanceTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type SetInstanceTemplateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#setTargetPools}. + * @param error Error, if any + * @param [response] Operation + */ + type SetTargetPoolsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#updatePerInstanceConfigs}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdatePerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents an InstanceGroups */ + class InstanceGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new InstanceGroups 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 InstanceGroups 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): InstanceGroups; + + /** + * Calls AddInstances. + * @param request AddInstancesInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addInstances(request: google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, callback: google.cloud.compute.v1.InstanceGroups.AddInstancesCallback): void; + + /** + * Calls AddInstances. + * @param request AddInstancesInstanceGroupRequest message or plain object + * @returns Promise + */ + public addInstances(request: google.cloud.compute.v1.IAddInstancesInstanceGroupRequest): Promise; + + /** + * Calls AggregatedList. + * @param request AggregatedListInstanceGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest, callback: google.cloud.compute.v1.InstanceGroups.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListInstanceGroupsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceGroupRequest, callback: google.cloud.compute.v1.InstanceGroups.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteInstanceGroupRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceGroupRequest): Promise; + + /** + * Calls Get. + * @param request GetInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroup + */ + public get(request: google.cloud.compute.v1.IGetInstanceGroupRequest, callback: google.cloud.compute.v1.InstanceGroups.GetCallback): void; + + /** + * Calls Get. + * @param request GetInstanceGroupRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetInstanceGroupRequest): Promise; + + /** + * Calls Insert. + * @param request InsertInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceGroupRequest, callback: google.cloud.compute.v1.InstanceGroups.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertInstanceGroupRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceGroupRequest): Promise; + + /** + * Calls List. + * @param request ListInstanceGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupList + */ + public list(request: google.cloud.compute.v1.IListInstanceGroupsRequest, callback: google.cloud.compute.v1.InstanceGroups.ListCallback): void; + + /** + * Calls List. + * @param request ListInstanceGroupsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListInstanceGroupsRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesInstanceGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupsListInstances + */ + public listInstances(request: google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, callback: google.cloud.compute.v1.InstanceGroups.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesInstanceGroupsRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.compute.v1.IListInstancesInstanceGroupsRequest): Promise; + + /** + * Calls RemoveInstances. + * @param request RemoveInstancesInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeInstances(request: google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, callback: google.cloud.compute.v1.InstanceGroups.RemoveInstancesCallback): void; + + /** + * Calls RemoveInstances. + * @param request RemoveInstancesInstanceGroupRequest message or plain object + * @returns Promise + */ + public removeInstances(request: google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest): Promise; + + /** + * Calls SetNamedPorts. + * @param request SetNamedPortsInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setNamedPorts(request: google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, callback: google.cloud.compute.v1.InstanceGroups.SetNamedPortsCallback): void; + + /** + * Calls SetNamedPorts. + * @param request SetNamedPortsInstanceGroupRequest message or plain object + * @returns Promise + */ + public setNamedPorts(request: google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest): Promise; + } + + namespace InstanceGroups { + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#addInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type AddInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#aggregatedList}. + * @param error Error, if any + * @param [response] InstanceGroupAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#get}. + * @param error Error, if any + * @param [response] InstanceGroup + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroup) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#list}. + * @param error Error, if any + * @param [response] InstanceGroupList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#listInstances}. + * @param error Error, if any + * @param [response] InstanceGroupsListInstances + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupsListInstances) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#removeInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#setNamedPorts}. + * @param error Error, if any + * @param [response] Operation + */ + type SetNamedPortsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents an InstanceTemplates */ + class InstanceTemplates extends $protobuf.rpc.Service { + + /** + * Constructs a new InstanceTemplates 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 InstanceTemplates 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): InstanceTemplates; + + /** + * Calls Delete. + * @param request DeleteInstanceTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceTemplateRequest, callback: google.cloud.compute.v1.InstanceTemplates.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteInstanceTemplateRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceTemplateRequest): Promise; + + /** + * Calls Get. + * @param request GetInstanceTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceTemplate + */ + public get(request: google.cloud.compute.v1.IGetInstanceTemplateRequest, callback: google.cloud.compute.v1.InstanceTemplates.GetCallback): void; + + /** + * Calls Get. + * @param request GetInstanceTemplateRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetInstanceTemplateRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyInstanceTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest, callback: google.cloud.compute.v1.InstanceTemplates.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyInstanceTemplateRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest): Promise; + + /** + * Calls Insert. + * @param request InsertInstanceTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceTemplateRequest, callback: google.cloud.compute.v1.InstanceTemplates.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertInstanceTemplateRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceTemplateRequest): Promise; + + /** + * Calls List. + * @param request ListInstanceTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceTemplateList + */ + public list(request: google.cloud.compute.v1.IListInstanceTemplatesRequest, callback: google.cloud.compute.v1.InstanceTemplates.ListCallback): void; + + /** + * Calls List. + * @param request ListInstanceTemplatesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListInstanceTemplatesRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyInstanceTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, callback: google.cloud.compute.v1.InstanceTemplates.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyInstanceTemplateRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsInstanceTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest, callback: google.cloud.compute.v1.InstanceTemplates.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsInstanceTemplateRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest): Promise; + } + + namespace InstanceTemplates { + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#get}. + * @param error Error, if any + * @param [response] InstanceTemplate + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceTemplate) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#list}. + * @param error Error, if any + * @param [response] InstanceTemplateList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceTemplateList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents an Instances */ + class Instances extends $protobuf.rpc.Service { + + /** + * Constructs a new Instances 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 Instances 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): Instances; + + /** + * Calls AddAccessConfig. + * @param request AddAccessConfigInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addAccessConfig(request: google.cloud.compute.v1.IAddAccessConfigInstanceRequest, callback: google.cloud.compute.v1.Instances.AddAccessConfigCallback): void; + + /** + * Calls AddAccessConfig. + * @param request AddAccessConfigInstanceRequest message or plain object + * @returns Promise + */ + public addAccessConfig(request: google.cloud.compute.v1.IAddAccessConfigInstanceRequest): Promise; + + /** + * Calls AddResourcePolicies. + * @param request AddResourcePoliciesInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addResourcePolicies(request: google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, callback: google.cloud.compute.v1.Instances.AddResourcePoliciesCallback): void; + + /** + * Calls AddResourcePolicies. + * @param request AddResourcePoliciesInstanceRequest message or plain object + * @returns Promise + */ + public addResourcePolicies(request: google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest): Promise; + + /** + * Calls AggregatedList. + * @param request AggregatedListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInstancesRequest, callback: google.cloud.compute.v1.Instances.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListInstancesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInstancesRequest): Promise; + + /** + * Calls AttachDisk. + * @param request AttachDiskInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public attachDisk(request: google.cloud.compute.v1.IAttachDiskInstanceRequest, callback: google.cloud.compute.v1.Instances.AttachDiskCallback): void; + + /** + * Calls AttachDisk. + * @param request AttachDiskInstanceRequest message or plain object + * @returns Promise + */ + public attachDisk(request: google.cloud.compute.v1.IAttachDiskInstanceRequest): Promise; + + /** + * Calls BulkInsert. + * @param request BulkInsertInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public bulkInsert(request: google.cloud.compute.v1.IBulkInsertInstanceRequest, callback: google.cloud.compute.v1.Instances.BulkInsertCallback): void; + + /** + * Calls BulkInsert. + * @param request BulkInsertInstanceRequest message or plain object + * @returns Promise + */ + public bulkInsert(request: google.cloud.compute.v1.IBulkInsertInstanceRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceRequest, callback: google.cloud.compute.v1.Instances.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls DeleteAccessConfig. + * @param request DeleteAccessConfigInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteAccessConfig(request: google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, callback: google.cloud.compute.v1.Instances.DeleteAccessConfigCallback): void; + + /** + * Calls DeleteAccessConfig. + * @param request DeleteAccessConfigInstanceRequest message or plain object + * @returns Promise + */ + public deleteAccessConfig(request: google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest): Promise; + + /** + * Calls DetachDisk. + * @param request DetachDiskInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public detachDisk(request: google.cloud.compute.v1.IDetachDiskInstanceRequest, callback: google.cloud.compute.v1.Instances.DetachDiskCallback): void; + + /** + * Calls DetachDisk. + * @param request DetachDiskInstanceRequest message or plain object + * @returns Promise + */ + public detachDisk(request: google.cloud.compute.v1.IDetachDiskInstanceRequest): Promise; + + /** + * Calls Get. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public get(request: google.cloud.compute.v1.IGetInstanceRequest, callback: google.cloud.compute.v1.Instances.GetCallback): void; + + /** + * Calls Get. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetInstanceRequest): Promise; + + /** + * Calls GetEffectiveFirewalls. + * @param request GetEffectiveFirewallsInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstancesGetEffectiveFirewallsResponse + */ + public getEffectiveFirewalls(request: google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest, callback: google.cloud.compute.v1.Instances.GetEffectiveFirewallsCallback): void; + + /** + * Calls GetEffectiveFirewalls. + * @param request GetEffectiveFirewallsInstanceRequest message or plain object + * @returns Promise + */ + public getEffectiveFirewalls(request: google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest): Promise; + + /** + * Calls GetGuestAttributes. + * @param request GetGuestAttributesInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GuestAttributes + */ + public getGuestAttributes(request: google.cloud.compute.v1.IGetGuestAttributesInstanceRequest, callback: google.cloud.compute.v1.Instances.GetGuestAttributesCallback): void; + + /** + * Calls GetGuestAttributes. + * @param request GetGuestAttributesInstanceRequest message or plain object + * @returns Promise + */ + public getGuestAttributes(request: google.cloud.compute.v1.IGetGuestAttributesInstanceRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyInstanceRequest, callback: google.cloud.compute.v1.Instances.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyInstanceRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyInstanceRequest): Promise; + + /** + * Calls GetScreenshot. + * @param request GetScreenshotInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Screenshot + */ + public getScreenshot(request: google.cloud.compute.v1.IGetScreenshotInstanceRequest, callback: google.cloud.compute.v1.Instances.GetScreenshotCallback): void; + + /** + * Calls GetScreenshot. + * @param request GetScreenshotInstanceRequest message or plain object + * @returns Promise + */ + public getScreenshot(request: google.cloud.compute.v1.IGetScreenshotInstanceRequest): Promise; + + /** + * Calls GetSerialPortOutput. + * @param request GetSerialPortOutputInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SerialPortOutput + */ + public getSerialPortOutput(request: google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest, callback: google.cloud.compute.v1.Instances.GetSerialPortOutputCallback): void; + + /** + * Calls GetSerialPortOutput. + * @param request GetSerialPortOutputInstanceRequest message or plain object + * @returns Promise + */ + public getSerialPortOutput(request: google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest): Promise; + + /** + * Calls GetShieldedInstanceIdentity. + * @param request GetShieldedInstanceIdentityInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ShieldedInstanceIdentity + */ + public getShieldedInstanceIdentity(request: google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest, callback: google.cloud.compute.v1.Instances.GetShieldedInstanceIdentityCallback): void; + + /** + * Calls GetShieldedInstanceIdentity. + * @param request GetShieldedInstanceIdentityInstanceRequest message or plain object + * @returns Promise + */ + public getShieldedInstanceIdentity(request: google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest): Promise; + + /** + * Calls Insert. + * @param request InsertInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceRequest, callback: google.cloud.compute.v1.Instances.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertInstanceRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertInstanceRequest): Promise; + + /** + * Calls List. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceList + */ + public list(request: google.cloud.compute.v1.IListInstancesRequest, callback: google.cloud.compute.v1.Instances.ListCallback): void; + + /** + * Calls List. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListInstancesRequest): Promise; + + /** + * Calls ListReferrers. + * @param request ListReferrersInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceListReferrers + */ + public listReferrers(request: google.cloud.compute.v1.IListReferrersInstancesRequest, callback: google.cloud.compute.v1.Instances.ListReferrersCallback): void; + + /** + * Calls ListReferrers. + * @param request ListReferrersInstancesRequest message or plain object + * @returns Promise + */ + public listReferrers(request: google.cloud.compute.v1.IListReferrersInstancesRequest): Promise; + + /** + * Calls RemoveResourcePolicies. + * @param request RemoveResourcePoliciesInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeResourcePolicies(request: google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, callback: google.cloud.compute.v1.Instances.RemoveResourcePoliciesCallback): void; + + /** + * Calls RemoveResourcePolicies. + * @param request RemoveResourcePoliciesInstanceRequest message or plain object + * @returns Promise + */ + public removeResourcePolicies(request: google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest): Promise; + + /** + * Calls Reset. + * @param request ResetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public reset(request: google.cloud.compute.v1.IResetInstanceRequest, callback: google.cloud.compute.v1.Instances.ResetCallback): void; + + /** + * Calls Reset. + * @param request ResetInstanceRequest message or plain object + * @returns Promise + */ + public reset(request: google.cloud.compute.v1.IResetInstanceRequest): Promise; + + /** + * Calls SetDeletionProtection. + * @param request SetDeletionProtectionInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setDeletionProtection(request: google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, callback: google.cloud.compute.v1.Instances.SetDeletionProtectionCallback): void; + + /** + * Calls SetDeletionProtection. + * @param request SetDeletionProtectionInstanceRequest message or plain object + * @returns Promise + */ + public setDeletionProtection(request: google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest): Promise; + + /** + * Calls SetDiskAutoDelete. + * @param request SetDiskAutoDeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setDiskAutoDelete(request: google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, callback: google.cloud.compute.v1.Instances.SetDiskAutoDeleteCallback): void; + + /** + * Calls SetDiskAutoDelete. + * @param request SetDiskAutoDeleteInstanceRequest message or plain object + * @returns Promise + */ + public setDiskAutoDelete(request: google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyInstanceRequest, callback: google.cloud.compute.v1.Instances.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyInstanceRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyInstanceRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsInstanceRequest, callback: google.cloud.compute.v1.Instances.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsInstanceRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsInstanceRequest): Promise; + + /** + * Calls SetMachineResources. + * @param request SetMachineResourcesInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setMachineResources(request: google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, callback: google.cloud.compute.v1.Instances.SetMachineResourcesCallback): void; + + /** + * Calls SetMachineResources. + * @param request SetMachineResourcesInstanceRequest message or plain object + * @returns Promise + */ + public setMachineResources(request: google.cloud.compute.v1.ISetMachineResourcesInstanceRequest): Promise; + + /** + * Calls SetMachineType. + * @param request SetMachineTypeInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setMachineType(request: google.cloud.compute.v1.ISetMachineTypeInstanceRequest, callback: google.cloud.compute.v1.Instances.SetMachineTypeCallback): void; + + /** + * Calls SetMachineType. + * @param request SetMachineTypeInstanceRequest message or plain object + * @returns Promise + */ + public setMachineType(request: google.cloud.compute.v1.ISetMachineTypeInstanceRequest): Promise; + + /** + * Calls SetMetadata. + * @param request SetMetadataInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setMetadata(request: google.cloud.compute.v1.ISetMetadataInstanceRequest, callback: google.cloud.compute.v1.Instances.SetMetadataCallback): void; + + /** + * Calls SetMetadata. + * @param request SetMetadataInstanceRequest message or plain object + * @returns Promise + */ + public setMetadata(request: google.cloud.compute.v1.ISetMetadataInstanceRequest): Promise; + + /** + * Calls SetMinCpuPlatform. + * @param request SetMinCpuPlatformInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setMinCpuPlatform(request: google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, callback: google.cloud.compute.v1.Instances.SetMinCpuPlatformCallback): void; + + /** + * Calls SetMinCpuPlatform. + * @param request SetMinCpuPlatformInstanceRequest message or plain object + * @returns Promise + */ + public setMinCpuPlatform(request: google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest): Promise; + + /** + * Calls SetScheduling. + * @param request SetSchedulingInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setScheduling(request: google.cloud.compute.v1.ISetSchedulingInstanceRequest, callback: google.cloud.compute.v1.Instances.SetSchedulingCallback): void; + + /** + * Calls SetScheduling. + * @param request SetSchedulingInstanceRequest message or plain object + * @returns Promise + */ + public setScheduling(request: google.cloud.compute.v1.ISetSchedulingInstanceRequest): Promise; + + /** + * Calls SetServiceAccount. + * @param request SetServiceAccountInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setServiceAccount(request: google.cloud.compute.v1.ISetServiceAccountInstanceRequest, callback: google.cloud.compute.v1.Instances.SetServiceAccountCallback): void; + + /** + * Calls SetServiceAccount. + * @param request SetServiceAccountInstanceRequest message or plain object + * @returns Promise + */ + public setServiceAccount(request: google.cloud.compute.v1.ISetServiceAccountInstanceRequest): Promise; + + /** + * Calls SetShieldedInstanceIntegrityPolicy. + * @param request SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setShieldedInstanceIntegrityPolicy(request: google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, callback: google.cloud.compute.v1.Instances.SetShieldedInstanceIntegrityPolicyCallback): void; + + /** + * Calls SetShieldedInstanceIntegrityPolicy. + * @param request SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object + * @returns Promise + */ + public setShieldedInstanceIntegrityPolicy(request: google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest): Promise; + + /** + * Calls SetTags. + * @param request SetTagsInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setTags(request: google.cloud.compute.v1.ISetTagsInstanceRequest, callback: google.cloud.compute.v1.Instances.SetTagsCallback): void; + + /** + * Calls SetTags. + * @param request SetTagsInstanceRequest message or plain object + * @returns Promise + */ + public setTags(request: google.cloud.compute.v1.ISetTagsInstanceRequest): Promise; + + /** + * Calls SimulateMaintenanceEvent. + * @param request SimulateMaintenanceEventInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public simulateMaintenanceEvent(request: google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, callback: google.cloud.compute.v1.Instances.SimulateMaintenanceEventCallback): void; + + /** + * Calls SimulateMaintenanceEvent. + * @param request SimulateMaintenanceEventInstanceRequest message or plain object + * @returns Promise + */ + public simulateMaintenanceEvent(request: google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest): Promise; + + /** + * Calls Start. + * @param request StartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public start(request: google.cloud.compute.v1.IStartInstanceRequest, callback: google.cloud.compute.v1.Instances.StartCallback): void; + + /** + * Calls Start. + * @param request StartInstanceRequest message or plain object + * @returns Promise + */ + public start(request: google.cloud.compute.v1.IStartInstanceRequest): Promise; + + /** + * Calls StartWithEncryptionKey. + * @param request StartWithEncryptionKeyInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startWithEncryptionKey(request: google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, callback: google.cloud.compute.v1.Instances.StartWithEncryptionKeyCallback): void; + + /** + * Calls StartWithEncryptionKey. + * @param request StartWithEncryptionKeyInstanceRequest message or plain object + * @returns Promise + */ + public startWithEncryptionKey(request: google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest): Promise; + + /** + * Calls Stop. + * @param request StopInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stop(request: google.cloud.compute.v1.IStopInstanceRequest, callback: google.cloud.compute.v1.Instances.StopCallback): void; + + /** + * Calls Stop. + * @param request StopInstanceRequest message or plain object + * @returns Promise + */ + public stop(request: google.cloud.compute.v1.IStopInstanceRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, callback: google.cloud.compute.v1.Instances.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsInstanceRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsInstanceRequest): Promise; + + /** + * Calls Update. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateInstanceRequest, callback: google.cloud.compute.v1.Instances.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls UpdateAccessConfig. + * @param request UpdateAccessConfigInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateAccessConfig(request: google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, callback: google.cloud.compute.v1.Instances.UpdateAccessConfigCallback): void; + + /** + * Calls UpdateAccessConfig. + * @param request UpdateAccessConfigInstanceRequest message or plain object + * @returns Promise + */ + public updateAccessConfig(request: google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest): Promise; + + /** + * Calls UpdateDisplayDevice. + * @param request UpdateDisplayDeviceInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDisplayDevice(request: google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, callback: google.cloud.compute.v1.Instances.UpdateDisplayDeviceCallback): void; + + /** + * Calls UpdateDisplayDevice. + * @param request UpdateDisplayDeviceInstanceRequest message or plain object + * @returns Promise + */ + public updateDisplayDevice(request: google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest): Promise; + + /** + * Calls UpdateNetworkInterface. + * @param request UpdateNetworkInterfaceInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateNetworkInterface(request: google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, callback: google.cloud.compute.v1.Instances.UpdateNetworkInterfaceCallback): void; + + /** + * Calls UpdateNetworkInterface. + * @param request UpdateNetworkInterfaceInstanceRequest message or plain object + * @returns Promise + */ + public updateNetworkInterface(request: google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest): Promise; + + /** + * Calls UpdateShieldedInstanceConfig. + * @param request UpdateShieldedInstanceConfigInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateShieldedInstanceConfig(request: google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, callback: google.cloud.compute.v1.Instances.UpdateShieldedInstanceConfigCallback): void; + + /** + * Calls UpdateShieldedInstanceConfig. + * @param request UpdateShieldedInstanceConfigInstanceRequest message or plain object + * @returns Promise + */ + public updateShieldedInstanceConfig(request: google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest): Promise; + } + + namespace Instances { + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#addAccessConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type AddAccessConfigCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#addResourcePolicies}. + * @param error Error, if any + * @param [response] Operation + */ + type AddResourcePoliciesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#aggregatedList}. + * @param error Error, if any + * @param [response] InstanceAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#attachDisk}. + * @param error Error, if any + * @param [response] Operation + */ + type AttachDiskCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#bulkInsert}. + * @param error Error, if any + * @param [response] Operation + */ + type BulkInsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#deleteAccessConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteAccessConfigCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#detachDisk}. + * @param error Error, if any + * @param [response] Operation + */ + type DetachDiskCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#get}. + * @param error Error, if any + * @param [response] Instance + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getEffectiveFirewalls}. + * @param error Error, if any + * @param [response] InstancesGetEffectiveFirewallsResponse + */ + type GetEffectiveFirewallsCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getGuestAttributes}. + * @param error Error, if any + * @param [response] GuestAttributes + */ + type GetGuestAttributesCallback = (error: (Error|null), response?: google.cloud.compute.v1.GuestAttributes) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getScreenshot}. + * @param error Error, if any + * @param [response] Screenshot + */ + type GetScreenshotCallback = (error: (Error|null), response?: google.cloud.compute.v1.Screenshot) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getSerialPortOutput}. + * @param error Error, if any + * @param [response] SerialPortOutput + */ + type GetSerialPortOutputCallback = (error: (Error|null), response?: google.cloud.compute.v1.SerialPortOutput) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getShieldedInstanceIdentity}. + * @param error Error, if any + * @param [response] ShieldedInstanceIdentity + */ + type GetShieldedInstanceIdentityCallback = (error: (Error|null), response?: google.cloud.compute.v1.ShieldedInstanceIdentity) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#list}. + * @param error Error, if any + * @param [response] InstanceList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#listReferrers}. + * @param error Error, if any + * @param [response] InstanceListReferrers + */ + type ListReferrersCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceListReferrers) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#removeResourcePolicies}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveResourcePoliciesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#reset}. + * @param error Error, if any + * @param [response] Operation + */ + type ResetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setDeletionProtection}. + * @param error Error, if any + * @param [response] Operation + */ + type SetDeletionProtectionCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setDiskAutoDelete}. + * @param error Error, if any + * @param [response] Operation + */ + type SetDiskAutoDeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMachineResources}. + * @param error Error, if any + * @param [response] Operation + */ + type SetMachineResourcesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMachineType}. + * @param error Error, if any + * @param [response] Operation + */ + type SetMachineTypeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMetadata}. + * @param error Error, if any + * @param [response] Operation + */ + type SetMetadataCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMinCpuPlatform}. + * @param error Error, if any + * @param [response] Operation + */ + type SetMinCpuPlatformCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setScheduling}. + * @param error Error, if any + * @param [response] Operation + */ + type SetSchedulingCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setServiceAccount}. + * @param error Error, if any + * @param [response] Operation + */ + type SetServiceAccountCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setShieldedInstanceIntegrityPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type SetShieldedInstanceIntegrityPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setTags}. + * @param error Error, if any + * @param [response] Operation + */ + type SetTagsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#simulateMaintenanceEvent}. + * @param error Error, if any + * @param [response] Operation + */ + type SimulateMaintenanceEventCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#start}. + * @param error Error, if any + * @param [response] Operation + */ + type StartCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#startWithEncryptionKey}. + * @param error Error, if any + * @param [response] Operation + */ + type StartWithEncryptionKeyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#stop}. + * @param error Error, if any + * @param [response] Operation + */ + type StopCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateAccessConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateAccessConfigCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateDisplayDevice}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDisplayDeviceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateNetworkInterface}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateNetworkInterfaceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateShieldedInstanceConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateShieldedInstanceConfigCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents an InterconnectAttachments */ + class InterconnectAttachments extends $protobuf.rpc.Service { + + /** + * Constructs a new InterconnectAttachments 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 InterconnectAttachments 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): InterconnectAttachments; + + /** + * Calls AggregatedList. + * @param request AggregatedListInterconnectAttachmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterconnectAttachmentAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest, callback: google.cloud.compute.v1.InterconnectAttachments.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListInterconnectAttachmentsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteInterconnectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, callback: google.cloud.compute.v1.InterconnectAttachments.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteInterconnectAttachmentRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest): Promise; + + /** + * Calls Get. + * @param request GetInterconnectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterconnectAttachment + */ + public get(request: google.cloud.compute.v1.IGetInterconnectAttachmentRequest, callback: google.cloud.compute.v1.InterconnectAttachments.GetCallback): void; + + /** + * Calls Get. + * @param request GetInterconnectAttachmentRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetInterconnectAttachmentRequest): Promise; + + /** + * Calls Insert. + * @param request InsertInterconnectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, callback: google.cloud.compute.v1.InterconnectAttachments.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertInterconnectAttachmentRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertInterconnectAttachmentRequest): Promise; + + /** + * Calls List. + * @param request ListInterconnectAttachmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterconnectAttachmentList + */ + public list(request: google.cloud.compute.v1.IListInterconnectAttachmentsRequest, callback: google.cloud.compute.v1.InterconnectAttachments.ListCallback): void; + + /** + * Calls List. + * @param request ListInterconnectAttachmentsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListInterconnectAttachmentsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchInterconnectAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, callback: google.cloud.compute.v1.InterconnectAttachments.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchInterconnectAttachmentRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchInterconnectAttachmentRequest): Promise; + } + + namespace InterconnectAttachments { + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#aggregatedList}. + * @param error Error, if any + * @param [response] InterconnectAttachmentAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InterconnectAttachmentAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#get}. + * @param error Error, if any + * @param [response] InterconnectAttachment + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.InterconnectAttachment) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#list}. + * @param error Error, if any + * @param [response] InterconnectAttachmentList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InterconnectAttachmentList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents an InterconnectLocations */ + class InterconnectLocations extends $protobuf.rpc.Service { + + /** + * Constructs a new InterconnectLocations 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 InterconnectLocations 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): InterconnectLocations; + + /** + * Calls Get. + * @param request GetInterconnectLocationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterconnectLocation + */ + public get(request: google.cloud.compute.v1.IGetInterconnectLocationRequest, callback: google.cloud.compute.v1.InterconnectLocations.GetCallback): void; + + /** + * Calls Get. + * @param request GetInterconnectLocationRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetInterconnectLocationRequest): Promise; + + /** + * Calls List. + * @param request ListInterconnectLocationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterconnectLocationList + */ + public list(request: google.cloud.compute.v1.IListInterconnectLocationsRequest, callback: google.cloud.compute.v1.InterconnectLocations.ListCallback): void; + + /** + * Calls List. + * @param request ListInterconnectLocationsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListInterconnectLocationsRequest): Promise; + } + + namespace InterconnectLocations { + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectLocations#get}. + * @param error Error, if any + * @param [response] InterconnectLocation + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.InterconnectLocation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectLocations#list}. + * @param error Error, if any + * @param [response] InterconnectLocationList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InterconnectLocationList) => void; + } + + /** Represents an Interconnects */ + class Interconnects extends $protobuf.rpc.Service { + + /** + * Constructs a new Interconnects 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 Interconnects 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): Interconnects; + + /** + * Calls Delete. + * @param request DeleteInterconnectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteInterconnectRequest, callback: google.cloud.compute.v1.Interconnects.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteInterconnectRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteInterconnectRequest): Promise; + + /** + * Calls Get. + * @param request GetInterconnectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Interconnect + */ + public get(request: google.cloud.compute.v1.IGetInterconnectRequest, callback: google.cloud.compute.v1.Interconnects.GetCallback): void; + + /** + * Calls Get. + * @param request GetInterconnectRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetInterconnectRequest): Promise; + + /** + * Calls GetDiagnostics. + * @param request GetDiagnosticsInterconnectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterconnectsGetDiagnosticsResponse + */ + public getDiagnostics(request: google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest, callback: google.cloud.compute.v1.Interconnects.GetDiagnosticsCallback): void; + + /** + * Calls GetDiagnostics. + * @param request GetDiagnosticsInterconnectRequest message or plain object + * @returns Promise + */ + public getDiagnostics(request: google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest): Promise; + + /** + * Calls Insert. + * @param request InsertInterconnectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertInterconnectRequest, callback: google.cloud.compute.v1.Interconnects.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertInterconnectRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertInterconnectRequest): Promise; + + /** + * Calls List. + * @param request ListInterconnectsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InterconnectList + */ + public list(request: google.cloud.compute.v1.IListInterconnectsRequest, callback: google.cloud.compute.v1.Interconnects.ListCallback): void; + + /** + * Calls List. + * @param request ListInterconnectsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListInterconnectsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchInterconnectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchInterconnectRequest, callback: google.cloud.compute.v1.Interconnects.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchInterconnectRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchInterconnectRequest): Promise; + } + + namespace Interconnects { + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#get}. + * @param error Error, if any + * @param [response] Interconnect + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Interconnect) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#getDiagnostics}. + * @param error Error, if any + * @param [response] InterconnectsGetDiagnosticsResponse + */ + type GetDiagnosticsCallback = (error: (Error|null), response?: google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#list}. + * @param error Error, if any + * @param [response] InterconnectList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.InterconnectList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a LicenseCodes */ + class LicenseCodes extends $protobuf.rpc.Service { + + /** + * Constructs a new LicenseCodes 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 LicenseCodes 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): LicenseCodes; + + /** + * Calls Get. + * @param request GetLicenseCodeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LicenseCode + */ + public get(request: google.cloud.compute.v1.IGetLicenseCodeRequest, callback: google.cloud.compute.v1.LicenseCodes.GetCallback): void; + + /** + * Calls Get. + * @param request GetLicenseCodeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetLicenseCodeRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsLicenseCodeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest, callback: google.cloud.compute.v1.LicenseCodes.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsLicenseCodeRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest): Promise; + } + + namespace LicenseCodes { + + /** + * Callback as used by {@link google.cloud.compute.v1.LicenseCodes#get}. + * @param error Error, if any + * @param [response] LicenseCode + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.LicenseCode) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.LicenseCodes#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a Licenses */ + class Licenses extends $protobuf.rpc.Service { + + /** + * Constructs a new Licenses 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 Licenses 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): Licenses; + + /** + * Calls Delete. + * @param request DeleteLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteLicenseRequest, callback: google.cloud.compute.v1.Licenses.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteLicenseRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteLicenseRequest): Promise; + + /** + * Calls Get. + * @param request GetLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and License + */ + public get(request: google.cloud.compute.v1.IGetLicenseRequest, callback: google.cloud.compute.v1.Licenses.GetCallback): void; + + /** + * Calls Get. + * @param request GetLicenseRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetLicenseRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyLicenseRequest, callback: google.cloud.compute.v1.Licenses.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyLicenseRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyLicenseRequest): Promise; + + /** + * Calls Insert. + * @param request InsertLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertLicenseRequest, callback: google.cloud.compute.v1.Licenses.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertLicenseRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertLicenseRequest): Promise; + + /** + * Calls List. + * @param request ListLicensesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LicensesListResponse + */ + public list(request: google.cloud.compute.v1.IListLicensesRequest, callback: google.cloud.compute.v1.Licenses.ListCallback): void; + + /** + * Calls List. + * @param request ListLicensesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListLicensesRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyLicenseRequest, callback: google.cloud.compute.v1.Licenses.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyLicenseRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyLicenseRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsLicenseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsLicenseRequest, callback: google.cloud.compute.v1.Licenses.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsLicenseRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsLicenseRequest): Promise; + } + + namespace Licenses { + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#get}. + * @param error Error, if any + * @param [response] License + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.License) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#list}. + * @param error Error, if any + * @param [response] LicensesListResponse + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.LicensesListResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a MachineTypes */ + class MachineTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new MachineTypes 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 MachineTypes 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): MachineTypes; + + /** + * Calls AggregatedList. + * @param request AggregatedListMachineTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MachineTypeAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListMachineTypesRequest, callback: google.cloud.compute.v1.MachineTypes.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListMachineTypesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListMachineTypesRequest): Promise; + + /** + * Calls Get. + * @param request GetMachineTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MachineType + */ + public get(request: google.cloud.compute.v1.IGetMachineTypeRequest, callback: google.cloud.compute.v1.MachineTypes.GetCallback): void; + + /** + * Calls Get. + * @param request GetMachineTypeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetMachineTypeRequest): Promise; + + /** + * Calls List. + * @param request ListMachineTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and MachineTypeList + */ + public list(request: google.cloud.compute.v1.IListMachineTypesRequest, callback: google.cloud.compute.v1.MachineTypes.ListCallback): void; + + /** + * Calls List. + * @param request ListMachineTypesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListMachineTypesRequest): Promise; + } + + namespace MachineTypes { + + /** + * Callback as used by {@link google.cloud.compute.v1.MachineTypes#aggregatedList}. + * @param error Error, if any + * @param [response] MachineTypeAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.MachineTypeAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.MachineTypes#get}. + * @param error Error, if any + * @param [response] MachineType + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.MachineType) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.MachineTypes#list}. + * @param error Error, if any + * @param [response] MachineTypeList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.MachineTypeList) => void; + } + + /** Represents a NetworkEndpointGroups */ + class NetworkEndpointGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new NetworkEndpointGroups 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 NetworkEndpointGroups 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): NetworkEndpointGroups; + + /** + * Calls AggregatedList. + * @param request AggregatedListNetworkEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroupAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListNetworkEndpointGroupsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest): Promise; + + /** + * Calls AttachNetworkEndpoints. + * @param request AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public attachNetworkEndpoints(request: google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.AttachNetworkEndpointsCallback): void; + + /** + * Calls AttachNetworkEndpoints. + * @param request AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public attachNetworkEndpoints(request: google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest): Promise; + + /** + * Calls DetachNetworkEndpoints. + * @param request DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public detachNetworkEndpoints(request: google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.DetachNetworkEndpointsCallback): void; + + /** + * Calls DetachNetworkEndpoints. + * @param request DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public detachNetworkEndpoints(request: google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest): Promise; + + /** + * Calls Get. + * @param request GetNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroup + */ + public get(request: google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.GetCallback): void; + + /** + * Calls Get. + * @param request GetNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetNetworkEndpointGroupRequest): Promise; + + /** + * Calls Insert. + * @param request InsertNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest): Promise; + + /** + * Calls List. + * @param request ListNetworkEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroupList + */ + public list(request: google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.ListCallback): void; + + /** + * Calls List. + * @param request ListNetworkEndpointGroupsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListNetworkEndpointGroupsRequest): Promise; + + /** + * Calls ListNetworkEndpoints. + * @param request ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroupsListNetworkEndpoints + */ + public listNetworkEndpoints(request: google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.ListNetworkEndpointsCallback): void; + + /** + * Calls ListNetworkEndpoints. + * @param request ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object + * @returns Promise + */ + public listNetworkEndpoints(request: google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.NetworkEndpointGroups.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest): Promise; + } + + namespace NetworkEndpointGroups { + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#aggregatedList}. + * @param error Error, if any + * @param [response] NetworkEndpointGroupAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroupAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#attachNetworkEndpoints}. + * @param error Error, if any + * @param [response] Operation + */ + type AttachNetworkEndpointsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#detachNetworkEndpoints}. + * @param error Error, if any + * @param [response] Operation + */ + type DetachNetworkEndpointsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#get}. + * @param error Error, if any + * @param [response] NetworkEndpointGroup + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroup) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#list}. + * @param error Error, if any + * @param [response] NetworkEndpointGroupList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroupList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#listNetworkEndpoints}. + * @param error Error, if any + * @param [response] NetworkEndpointGroupsListNetworkEndpoints + */ + type ListNetworkEndpointsCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a Networks */ + class Networks extends $protobuf.rpc.Service { + + /** + * Constructs a new Networks 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 Networks 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): Networks; + + /** + * Calls AddPeering. + * @param request AddPeeringNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addPeering(request: google.cloud.compute.v1.IAddPeeringNetworkRequest, callback: google.cloud.compute.v1.Networks.AddPeeringCallback): void; + + /** + * Calls AddPeering. + * @param request AddPeeringNetworkRequest message or plain object + * @returns Promise + */ + public addPeering(request: google.cloud.compute.v1.IAddPeeringNetworkRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteNetworkRequest, callback: google.cloud.compute.v1.Networks.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteNetworkRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteNetworkRequest): Promise; + + /** + * Calls Get. + * @param request GetNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Network + */ + public get(request: google.cloud.compute.v1.IGetNetworkRequest, callback: google.cloud.compute.v1.Networks.GetCallback): void; + + /** + * Calls Get. + * @param request GetNetworkRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetNetworkRequest): Promise; + + /** + * Calls GetEffectiveFirewalls. + * @param request GetEffectiveFirewallsNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworksGetEffectiveFirewallsResponse + */ + public getEffectiveFirewalls(request: google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest, callback: google.cloud.compute.v1.Networks.GetEffectiveFirewallsCallback): void; + + /** + * Calls GetEffectiveFirewalls. + * @param request GetEffectiveFirewallsNetworkRequest message or plain object + * @returns Promise + */ + public getEffectiveFirewalls(request: google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest): Promise; + + /** + * Calls Insert. + * @param request InsertNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertNetworkRequest, callback: google.cloud.compute.v1.Networks.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertNetworkRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertNetworkRequest): Promise; + + /** + * Calls List. + * @param request ListNetworksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkList + */ + public list(request: google.cloud.compute.v1.IListNetworksRequest, callback: google.cloud.compute.v1.Networks.ListCallback): void; + + /** + * Calls List. + * @param request ListNetworksRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListNetworksRequest): Promise; + + /** + * Calls ListPeeringRoutes. + * @param request ListPeeringRoutesNetworksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExchangedPeeringRoutesList + */ + public listPeeringRoutes(request: google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, callback: google.cloud.compute.v1.Networks.ListPeeringRoutesCallback): void; + + /** + * Calls ListPeeringRoutes. + * @param request ListPeeringRoutesNetworksRequest message or plain object + * @returns Promise + */ + public listPeeringRoutes(request: google.cloud.compute.v1.IListPeeringRoutesNetworksRequest): Promise; + + /** + * Calls Patch. + * @param request PatchNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchNetworkRequest, callback: google.cloud.compute.v1.Networks.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchNetworkRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchNetworkRequest): Promise; + + /** + * Calls RemovePeering. + * @param request RemovePeeringNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removePeering(request: google.cloud.compute.v1.IRemovePeeringNetworkRequest, callback: google.cloud.compute.v1.Networks.RemovePeeringCallback): void; + + /** + * Calls RemovePeering. + * @param request RemovePeeringNetworkRequest message or plain object + * @returns Promise + */ + public removePeering(request: google.cloud.compute.v1.IRemovePeeringNetworkRequest): Promise; + + /** + * Calls SwitchToCustomMode. + * @param request SwitchToCustomModeNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public switchToCustomMode(request: google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, callback: google.cloud.compute.v1.Networks.SwitchToCustomModeCallback): void; + + /** + * Calls SwitchToCustomMode. + * @param request SwitchToCustomModeNetworkRequest message or plain object + * @returns Promise + */ + public switchToCustomMode(request: google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest): Promise; + + /** + * Calls UpdatePeering. + * @param request UpdatePeeringNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updatePeering(request: google.cloud.compute.v1.IUpdatePeeringNetworkRequest, callback: google.cloud.compute.v1.Networks.UpdatePeeringCallback): void; + + /** + * Calls UpdatePeering. + * @param request UpdatePeeringNetworkRequest message or plain object + * @returns Promise + */ + public updatePeering(request: google.cloud.compute.v1.IUpdatePeeringNetworkRequest): Promise; + } + + namespace Networks { + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#addPeering}. + * @param error Error, if any + * @param [response] Operation + */ + type AddPeeringCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#get}. + * @param error Error, if any + * @param [response] Network + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Network) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#getEffectiveFirewalls}. + * @param error Error, if any + * @param [response] NetworksGetEffectiveFirewallsResponse + */ + type GetEffectiveFirewallsCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#list}. + * @param error Error, if any + * @param [response] NetworkList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#listPeeringRoutes}. + * @param error Error, if any + * @param [response] ExchangedPeeringRoutesList + */ + type ListPeeringRoutesCallback = (error: (Error|null), response?: google.cloud.compute.v1.ExchangedPeeringRoutesList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#removePeering}. + * @param error Error, if any + * @param [response] Operation + */ + type RemovePeeringCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#switchToCustomMode}. + * @param error Error, if any + * @param [response] Operation + */ + type SwitchToCustomModeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#updatePeering}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdatePeeringCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a NodeGroups */ + class NodeGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new NodeGroups 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 NodeGroups 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): NodeGroups; + + /** + * Calls AddNodes. + * @param request AddNodesNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addNodes(request: google.cloud.compute.v1.IAddNodesNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.AddNodesCallback): void; + + /** + * Calls AddNodes. + * @param request AddNodesNodeGroupRequest message or plain object + * @returns Promise + */ + public addNodes(request: google.cloud.compute.v1.IAddNodesNodeGroupRequest): Promise; + + /** + * Calls AggregatedList. + * @param request AggregatedListNodeGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeGroupAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNodeGroupsRequest, callback: google.cloud.compute.v1.NodeGroups.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListNodeGroupsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNodeGroupsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteNodeGroupRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteNodeGroupRequest): Promise; + + /** + * Calls DeleteNodes. + * @param request DeleteNodesNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteNodes(request: google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.DeleteNodesCallback): void; + + /** + * Calls DeleteNodes. + * @param request DeleteNodesNodeGroupRequest message or plain object + * @returns Promise + */ + public deleteNodes(request: google.cloud.compute.v1.IDeleteNodesNodeGroupRequest): Promise; + + /** + * Calls Get. + * @param request GetNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeGroup + */ + public get(request: google.cloud.compute.v1.IGetNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.GetCallback): void; + + /** + * Calls Get. + * @param request GetNodeGroupRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetNodeGroupRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyNodeGroupRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest): Promise; + + /** + * Calls Insert. + * @param request InsertNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertNodeGroupRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertNodeGroupRequest): Promise; + + /** + * Calls List. + * @param request ListNodeGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeGroupList + */ + public list(request: google.cloud.compute.v1.IListNodeGroupsRequest, callback: google.cloud.compute.v1.NodeGroups.ListCallback): void; + + /** + * Calls List. + * @param request ListNodeGroupsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListNodeGroupsRequest): Promise; + + /** + * Calls ListNodes. + * @param request ListNodesNodeGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeGroupsListNodes + */ + public listNodes(request: google.cloud.compute.v1.IListNodesNodeGroupsRequest, callback: google.cloud.compute.v1.NodeGroups.ListNodesCallback): void; + + /** + * Calls ListNodes. + * @param request ListNodesNodeGroupsRequest message or plain object + * @returns Promise + */ + public listNodes(request: google.cloud.compute.v1.IListNodesNodeGroupsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchNodeGroupRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchNodeGroupRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyNodeGroupRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest): Promise; + + /** + * Calls SetNodeTemplate. + * @param request SetNodeTemplateNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setNodeTemplate(request: google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.SetNodeTemplateCallback): void; + + /** + * Calls SetNodeTemplate. + * @param request SetNodeTemplateNodeGroupRequest message or plain object + * @returns Promise + */ + public setNodeTemplate(request: google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, callback: google.cloud.compute.v1.NodeGroups.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsNodeGroupRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest): Promise; + } + + namespace NodeGroups { + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#addNodes}. + * @param error Error, if any + * @param [response] Operation + */ + type AddNodesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#aggregatedList}. + * @param error Error, if any + * @param [response] NodeGroupAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeGroupAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#deleteNodes}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteNodesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#get}. + * @param error Error, if any + * @param [response] NodeGroup + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeGroup) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#list}. + * @param error Error, if any + * @param [response] NodeGroupList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeGroupList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#listNodes}. + * @param error Error, if any + * @param [response] NodeGroupsListNodes + */ + type ListNodesCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeGroupsListNodes) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#setNodeTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type SetNodeTemplateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a NodeTemplates */ + class NodeTemplates extends $protobuf.rpc.Service { + + /** + * Constructs a new NodeTemplates 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 NodeTemplates 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): NodeTemplates; + + /** + * Calls AggregatedList. + * @param request AggregatedListNodeTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeTemplateAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest, callback: google.cloud.compute.v1.NodeTemplates.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListNodeTemplatesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteNodeTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteNodeTemplateRequest, callback: google.cloud.compute.v1.NodeTemplates.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteNodeTemplateRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteNodeTemplateRequest): Promise; + + /** + * Calls Get. + * @param request GetNodeTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeTemplate + */ + public get(request: google.cloud.compute.v1.IGetNodeTemplateRequest, callback: google.cloud.compute.v1.NodeTemplates.GetCallback): void; + + /** + * Calls Get. + * @param request GetNodeTemplateRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetNodeTemplateRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyNodeTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest, callback: google.cloud.compute.v1.NodeTemplates.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyNodeTemplateRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest): Promise; + + /** + * Calls Insert. + * @param request InsertNodeTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertNodeTemplateRequest, callback: google.cloud.compute.v1.NodeTemplates.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertNodeTemplateRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertNodeTemplateRequest): Promise; + + /** + * Calls List. + * @param request ListNodeTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeTemplateList + */ + public list(request: google.cloud.compute.v1.IListNodeTemplatesRequest, callback: google.cloud.compute.v1.NodeTemplates.ListCallback): void; + + /** + * Calls List. + * @param request ListNodeTemplatesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListNodeTemplatesRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyNodeTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, callback: google.cloud.compute.v1.NodeTemplates.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyNodeTemplateRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsNodeTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest, callback: google.cloud.compute.v1.NodeTemplates.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsNodeTemplateRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest): Promise; + } + + namespace NodeTemplates { + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#aggregatedList}. + * @param error Error, if any + * @param [response] NodeTemplateAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeTemplateAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#get}. + * @param error Error, if any + * @param [response] NodeTemplate + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeTemplate) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#list}. + * @param error Error, if any + * @param [response] NodeTemplateList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeTemplateList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a NodeTypes */ + class NodeTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new NodeTypes 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 NodeTypes 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): NodeTypes; + + /** + * Calls AggregatedList. + * @param request AggregatedListNodeTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeTypeAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNodeTypesRequest, callback: google.cloud.compute.v1.NodeTypes.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListNodeTypesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNodeTypesRequest): Promise; + + /** + * Calls Get. + * @param request GetNodeTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeType + */ + public get(request: google.cloud.compute.v1.IGetNodeTypeRequest, callback: google.cloud.compute.v1.NodeTypes.GetCallback): void; + + /** + * Calls Get. + * @param request GetNodeTypeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetNodeTypeRequest): Promise; + + /** + * Calls List. + * @param request ListNodeTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeTypeList + */ + public list(request: google.cloud.compute.v1.IListNodeTypesRequest, callback: google.cloud.compute.v1.NodeTypes.ListCallback): void; + + /** + * Calls List. + * @param request ListNodeTypesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListNodeTypesRequest): Promise; + } + + namespace NodeTypes { + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTypes#aggregatedList}. + * @param error Error, if any + * @param [response] NodeTypeAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeTypeAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTypes#get}. + * @param error Error, if any + * @param [response] NodeType + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeType) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTypes#list}. + * @param error Error, if any + * @param [response] NodeTypeList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NodeTypeList) => void; + } + + /** Represents a PacketMirrorings */ + class PacketMirrorings extends $protobuf.rpc.Service { + + /** + * Constructs a new PacketMirrorings 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 PacketMirrorings 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): PacketMirrorings; + + /** + * Calls AggregatedList. + * @param request AggregatedListPacketMirroringsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PacketMirroringAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest, callback: google.cloud.compute.v1.PacketMirrorings.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListPacketMirroringsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest): Promise; + + /** + * Calls Delete. + * @param request DeletePacketMirroringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeletePacketMirroringRequest, callback: google.cloud.compute.v1.PacketMirrorings.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeletePacketMirroringRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeletePacketMirroringRequest): Promise; + + /** + * Calls Get. + * @param request GetPacketMirroringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PacketMirroring + */ + public get(request: google.cloud.compute.v1.IGetPacketMirroringRequest, callback: google.cloud.compute.v1.PacketMirrorings.GetCallback): void; + + /** + * Calls Get. + * @param request GetPacketMirroringRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetPacketMirroringRequest): Promise; + + /** + * Calls Insert. + * @param request InsertPacketMirroringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertPacketMirroringRequest, callback: google.cloud.compute.v1.PacketMirrorings.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertPacketMirroringRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertPacketMirroringRequest): Promise; + + /** + * Calls List. + * @param request ListPacketMirroringsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PacketMirroringList + */ + public list(request: google.cloud.compute.v1.IListPacketMirroringsRequest, callback: google.cloud.compute.v1.PacketMirrorings.ListCallback): void; + + /** + * Calls List. + * @param request ListPacketMirroringsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListPacketMirroringsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchPacketMirroringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchPacketMirroringRequest, callback: google.cloud.compute.v1.PacketMirrorings.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchPacketMirroringRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchPacketMirroringRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsPacketMirroringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, callback: google.cloud.compute.v1.PacketMirrorings.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsPacketMirroringRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest): Promise; + } + + namespace PacketMirrorings { + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#aggregatedList}. + * @param error Error, if any + * @param [response] PacketMirroringAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.PacketMirroringAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#get}. + * @param error Error, if any + * @param [response] PacketMirroring + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.PacketMirroring) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#list}. + * @param error Error, if any + * @param [response] PacketMirroringList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.PacketMirroringList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** 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 DisableXpnHost. + * @param request DisableXpnHostProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public disableXpnHost(request: google.cloud.compute.v1.IDisableXpnHostProjectRequest, callback: google.cloud.compute.v1.Projects.DisableXpnHostCallback): void; + + /** + * Calls DisableXpnHost. + * @param request DisableXpnHostProjectRequest message or plain object + * @returns Promise + */ + public disableXpnHost(request: google.cloud.compute.v1.IDisableXpnHostProjectRequest): Promise; + + /** + * Calls DisableXpnResource. + * @param request DisableXpnResourceProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public disableXpnResource(request: google.cloud.compute.v1.IDisableXpnResourceProjectRequest, callback: google.cloud.compute.v1.Projects.DisableXpnResourceCallback): void; + + /** + * Calls DisableXpnResource. + * @param request DisableXpnResourceProjectRequest message or plain object + * @returns Promise + */ + public disableXpnResource(request: google.cloud.compute.v1.IDisableXpnResourceProjectRequest): Promise; + + /** + * Calls EnableXpnHost. + * @param request EnableXpnHostProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public enableXpnHost(request: google.cloud.compute.v1.IEnableXpnHostProjectRequest, callback: google.cloud.compute.v1.Projects.EnableXpnHostCallback): void; + + /** + * Calls EnableXpnHost. + * @param request EnableXpnHostProjectRequest message or plain object + * @returns Promise + */ + public enableXpnHost(request: google.cloud.compute.v1.IEnableXpnHostProjectRequest): Promise; + + /** + * Calls EnableXpnResource. + * @param request EnableXpnResourceProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public enableXpnResource(request: google.cloud.compute.v1.IEnableXpnResourceProjectRequest, callback: google.cloud.compute.v1.Projects.EnableXpnResourceCallback): void; + + /** + * Calls EnableXpnResource. + * @param request EnableXpnResourceProjectRequest message or plain object + * @returns Promise + */ + public enableXpnResource(request: google.cloud.compute.v1.IEnableXpnResourceProjectRequest): Promise; + + /** + * Calls Get. + * @param request GetProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Project + */ + public get(request: google.cloud.compute.v1.IGetProjectRequest, callback: google.cloud.compute.v1.Projects.GetCallback): void; + + /** + * Calls Get. + * @param request GetProjectRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetProjectRequest): Promise; + + /** + * Calls GetXpnHost. + * @param request GetXpnHostProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Project + */ + public getXpnHost(request: google.cloud.compute.v1.IGetXpnHostProjectRequest, callback: google.cloud.compute.v1.Projects.GetXpnHostCallback): void; + + /** + * Calls GetXpnHost. + * @param request GetXpnHostProjectRequest message or plain object + * @returns Promise + */ + public getXpnHost(request: google.cloud.compute.v1.IGetXpnHostProjectRequest): Promise; + + /** + * Calls GetXpnResources. + * @param request GetXpnResourcesProjectsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ProjectsGetXpnResources + */ + public getXpnResources(request: google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, callback: google.cloud.compute.v1.Projects.GetXpnResourcesCallback): void; + + /** + * Calls GetXpnResources. + * @param request GetXpnResourcesProjectsRequest message or plain object + * @returns Promise + */ + public getXpnResources(request: google.cloud.compute.v1.IGetXpnResourcesProjectsRequest): Promise; + + /** + * Calls ListXpnHosts. + * @param request ListXpnHostsProjectsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and XpnHostList + */ + public listXpnHosts(request: google.cloud.compute.v1.IListXpnHostsProjectsRequest, callback: google.cloud.compute.v1.Projects.ListXpnHostsCallback): void; + + /** + * Calls ListXpnHosts. + * @param request ListXpnHostsProjectsRequest message or plain object + * @returns Promise + */ + public listXpnHosts(request: google.cloud.compute.v1.IListXpnHostsProjectsRequest): Promise; + + /** + * Calls MoveDisk. + * @param request MoveDiskProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public moveDisk(request: google.cloud.compute.v1.IMoveDiskProjectRequest, callback: google.cloud.compute.v1.Projects.MoveDiskCallback): void; + + /** + * Calls MoveDisk. + * @param request MoveDiskProjectRequest message or plain object + * @returns Promise + */ + public moveDisk(request: google.cloud.compute.v1.IMoveDiskProjectRequest): Promise; + + /** + * Calls MoveInstance. + * @param request MoveInstanceProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public moveInstance(request: google.cloud.compute.v1.IMoveInstanceProjectRequest, callback: google.cloud.compute.v1.Projects.MoveInstanceCallback): void; + + /** + * Calls MoveInstance. + * @param request MoveInstanceProjectRequest message or plain object + * @returns Promise + */ + public moveInstance(request: google.cloud.compute.v1.IMoveInstanceProjectRequest): Promise; + + /** + * Calls SetCommonInstanceMetadata. + * @param request SetCommonInstanceMetadataProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setCommonInstanceMetadata(request: google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, callback: google.cloud.compute.v1.Projects.SetCommonInstanceMetadataCallback): void; + + /** + * Calls SetCommonInstanceMetadata. + * @param request SetCommonInstanceMetadataProjectRequest message or plain object + * @returns Promise + */ + public setCommonInstanceMetadata(request: google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest): Promise; + + /** + * Calls SetDefaultNetworkTier. + * @param request SetDefaultNetworkTierProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setDefaultNetworkTier(request: google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, callback: google.cloud.compute.v1.Projects.SetDefaultNetworkTierCallback): void; + + /** + * Calls SetDefaultNetworkTier. + * @param request SetDefaultNetworkTierProjectRequest message or plain object + * @returns Promise + */ + public setDefaultNetworkTier(request: google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest): Promise; + + /** + * Calls SetUsageExportBucket. + * @param request SetUsageExportBucketProjectRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setUsageExportBucket(request: google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, callback: google.cloud.compute.v1.Projects.SetUsageExportBucketCallback): void; + + /** + * Calls SetUsageExportBucket. + * @param request SetUsageExportBucketProjectRequest message or plain object + * @returns Promise + */ + public setUsageExportBucket(request: google.cloud.compute.v1.ISetUsageExportBucketProjectRequest): Promise; + } + + namespace Projects { + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#disableXpnHost}. + * @param error Error, if any + * @param [response] Operation + */ + type DisableXpnHostCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#disableXpnResource}. + * @param error Error, if any + * @param [response] Operation + */ + type DisableXpnResourceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#enableXpnHost}. + * @param error Error, if any + * @param [response] Operation + */ + type EnableXpnHostCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#enableXpnResource}. + * @param error Error, if any + * @param [response] Operation + */ + type EnableXpnResourceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#get}. + * @param error Error, if any + * @param [response] Project + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Project) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#getXpnHost}. + * @param error Error, if any + * @param [response] Project + */ + type GetXpnHostCallback = (error: (Error|null), response?: google.cloud.compute.v1.Project) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#getXpnResources}. + * @param error Error, if any + * @param [response] ProjectsGetXpnResources + */ + type GetXpnResourcesCallback = (error: (Error|null), response?: google.cloud.compute.v1.ProjectsGetXpnResources) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#listXpnHosts}. + * @param error Error, if any + * @param [response] XpnHostList + */ + type ListXpnHostsCallback = (error: (Error|null), response?: google.cloud.compute.v1.XpnHostList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#moveDisk}. + * @param error Error, if any + * @param [response] Operation + */ + type MoveDiskCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#moveInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type MoveInstanceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#setCommonInstanceMetadata}. + * @param error Error, if any + * @param [response] Operation + */ + type SetCommonInstanceMetadataCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#setDefaultNetworkTier}. + * @param error Error, if any + * @param [response] Operation + */ + type SetDefaultNetworkTierCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#setUsageExportBucket}. + * @param error Error, if any + * @param [response] Operation + */ + type SetUsageExportBucketCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a PublicAdvertisedPrefixes */ + class PublicAdvertisedPrefixes extends $protobuf.rpc.Service { + + /** + * Constructs a new PublicAdvertisedPrefixes 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 PublicAdvertisedPrefixes 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): PublicAdvertisedPrefixes; + + /** + * Calls Delete. + * @param request DeletePublicAdvertisedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, callback: google.cloud.compute.v1.PublicAdvertisedPrefixes.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeletePublicAdvertisedPrefixeRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest): Promise; + + /** + * Calls Get. + * @param request GetPublicAdvertisedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicAdvertisedPrefix + */ + public get(request: google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, callback: google.cloud.compute.v1.PublicAdvertisedPrefixes.GetCallback): void; + + /** + * Calls Get. + * @param request GetPublicAdvertisedPrefixeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest): Promise; + + /** + * Calls Insert. + * @param request InsertPublicAdvertisedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, callback: google.cloud.compute.v1.PublicAdvertisedPrefixes.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertPublicAdvertisedPrefixeRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest): Promise; + + /** + * Calls List. + * @param request ListPublicAdvertisedPrefixesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicAdvertisedPrefixList + */ + public list(request: google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, callback: google.cloud.compute.v1.PublicAdvertisedPrefixes.ListCallback): void; + + /** + * Calls List. + * @param request ListPublicAdvertisedPrefixesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchPublicAdvertisedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, callback: google.cloud.compute.v1.PublicAdvertisedPrefixes.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchPublicAdvertisedPrefixeRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest): Promise; + } + + namespace PublicAdvertisedPrefixes { + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#get}. + * @param error Error, if any + * @param [response] PublicAdvertisedPrefix + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.PublicAdvertisedPrefix) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#list}. + * @param error Error, if any + * @param [response] PublicAdvertisedPrefixList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.PublicAdvertisedPrefixList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a PublicDelegatedPrefixes */ + class PublicDelegatedPrefixes extends $protobuf.rpc.Service { + + /** + * Constructs a new PublicDelegatedPrefixes 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 PublicDelegatedPrefixes 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): PublicDelegatedPrefixes; + + /** + * Calls AggregatedList. + * @param request AggregatedListPublicDelegatedPrefixesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicDelegatedPrefixAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest, callback: google.cloud.compute.v1.PublicDelegatedPrefixes.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListPublicDelegatedPrefixesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest): Promise; + + /** + * Calls Delete. + * @param request DeletePublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.PublicDelegatedPrefixes.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeletePublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest): Promise; + + /** + * Calls Get. + * @param request GetPublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicDelegatedPrefix + */ + public get(request: google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.PublicDelegatedPrefixes.GetCallback): void; + + /** + * Calls Get. + * @param request GetPublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest): Promise; + + /** + * Calls Insert. + * @param request InsertPublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.PublicDelegatedPrefixes.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertPublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest): Promise; + + /** + * Calls List. + * @param request ListPublicDelegatedPrefixesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublicDelegatedPrefixList + */ + public list(request: google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, callback: google.cloud.compute.v1.PublicDelegatedPrefixes.ListCallback): void; + + /** + * Calls List. + * @param request ListPublicDelegatedPrefixesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchPublicDelegatedPrefixeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, callback: google.cloud.compute.v1.PublicDelegatedPrefixes.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchPublicDelegatedPrefixeRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest): Promise; + } + + namespace PublicDelegatedPrefixes { + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#aggregatedList}. + * @param error Error, if any + * @param [response] PublicDelegatedPrefixAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#get}. + * @param error Error, if any + * @param [response] PublicDelegatedPrefix + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.PublicDelegatedPrefix) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#list}. + * @param error Error, if any + * @param [response] PublicDelegatedPrefixList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.PublicDelegatedPrefixList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionAutoscalers */ + class RegionAutoscalers extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionAutoscalers 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 RegionAutoscalers 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): RegionAutoscalers; + + /** + * Calls Delete. + * @param request DeleteRegionAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, callback: google.cloud.compute.v1.RegionAutoscalers.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionAutoscalerRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionAutoscalerRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Autoscaler + */ + public get(request: google.cloud.compute.v1.IGetRegionAutoscalerRequest, callback: google.cloud.compute.v1.RegionAutoscalers.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionAutoscalerRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionAutoscalerRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionAutoscalerRequest, callback: google.cloud.compute.v1.RegionAutoscalers.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionAutoscalerRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionAutoscalerRequest): Promise; + + /** + * Calls List. + * @param request ListRegionAutoscalersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionAutoscalerList + */ + public list(request: google.cloud.compute.v1.IListRegionAutoscalersRequest, callback: google.cloud.compute.v1.RegionAutoscalers.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionAutoscalersRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionAutoscalersRequest): Promise; + + /** + * Calls Patch. + * @param request PatchRegionAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchRegionAutoscalerRequest, callback: google.cloud.compute.v1.RegionAutoscalers.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchRegionAutoscalerRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchRegionAutoscalerRequest): Promise; + + /** + * Calls Update. + * @param request UpdateRegionAutoscalerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, callback: google.cloud.compute.v1.RegionAutoscalers.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateRegionAutoscalerRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateRegionAutoscalerRequest): Promise; + } + + namespace RegionAutoscalers { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#get}. + * @param error Error, if any + * @param [response] Autoscaler + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Autoscaler) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#list}. + * @param error Error, if any + * @param [response] RegionAutoscalerList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionAutoscalerList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionBackendServices */ + class RegionBackendServices extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionBackendServices 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 RegionBackendServices 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): RegionBackendServices; + + /** + * Calls Delete. + * @param request DeleteRegionBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, callback: google.cloud.compute.v1.RegionBackendServices.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionBackendServiceRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionBackendServiceRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendService + */ + public get(request: google.cloud.compute.v1.IGetRegionBackendServiceRequest, callback: google.cloud.compute.v1.RegionBackendServices.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionBackendServiceRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionBackendServiceRequest): Promise; + + /** + * Calls GetHealth. + * @param request GetHealthRegionBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendServiceGroupHealth + */ + public getHealth(request: google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest, callback: google.cloud.compute.v1.RegionBackendServices.GetHealthCallback): void; + + /** + * Calls GetHealth. + * @param request GetHealthRegionBackendServiceRequest message or plain object + * @returns Promise + */ + public getHealth(request: google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionBackendServiceRequest, callback: google.cloud.compute.v1.RegionBackendServices.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionBackendServiceRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionBackendServiceRequest): Promise; + + /** + * Calls List. + * @param request ListRegionBackendServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackendServiceList + */ + public list(request: google.cloud.compute.v1.IListRegionBackendServicesRequest, callback: google.cloud.compute.v1.RegionBackendServices.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionBackendServicesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionBackendServicesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchRegionBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchRegionBackendServiceRequest, callback: google.cloud.compute.v1.RegionBackendServices.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchRegionBackendServiceRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchRegionBackendServiceRequest): Promise; + + /** + * Calls Update. + * @param request UpdateRegionBackendServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, callback: google.cloud.compute.v1.RegionBackendServices.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateRegionBackendServiceRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateRegionBackendServiceRequest): Promise; + } + + namespace RegionBackendServices { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#get}. + * @param error Error, if any + * @param [response] BackendService + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendService) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#getHealth}. + * @param error Error, if any + * @param [response] BackendServiceGroupHealth + */ + type GetHealthCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendServiceGroupHealth) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#list}. + * @param error Error, if any + * @param [response] BackendServiceList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.BackendServiceList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionCommitments */ + class RegionCommitments extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionCommitments 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 RegionCommitments 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): RegionCommitments; + + /** + * Calls AggregatedList. + * @param request AggregatedListRegionCommitmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CommitmentAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest, callback: google.cloud.compute.v1.RegionCommitments.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListRegionCommitmentsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Commitment + */ + public get(request: google.cloud.compute.v1.IGetRegionCommitmentRequest, callback: google.cloud.compute.v1.RegionCommitments.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionCommitmentRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionCommitmentRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionCommitmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionCommitmentRequest, callback: google.cloud.compute.v1.RegionCommitments.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionCommitmentRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionCommitmentRequest): Promise; + + /** + * Calls List. + * @param request ListRegionCommitmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CommitmentList + */ + public list(request: google.cloud.compute.v1.IListRegionCommitmentsRequest, callback: google.cloud.compute.v1.RegionCommitments.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionCommitmentsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionCommitmentsRequest): Promise; + } + + namespace RegionCommitments { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#aggregatedList}. + * @param error Error, if any + * @param [response] CommitmentAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.CommitmentAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#get}. + * @param error Error, if any + * @param [response] Commitment + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Commitment) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#list}. + * @param error Error, if any + * @param [response] CommitmentList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.CommitmentList) => void; + } + + /** Represents a RegionDiskTypes */ + class RegionDiskTypes extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionDiskTypes 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 RegionDiskTypes 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): RegionDiskTypes; + + /** + * Calls Get. + * @param request GetRegionDiskTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DiskType + */ + public get(request: google.cloud.compute.v1.IGetRegionDiskTypeRequest, callback: google.cloud.compute.v1.RegionDiskTypes.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionDiskTypeRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionDiskTypeRequest): Promise; + + /** + * Calls List. + * @param request ListRegionDiskTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionDiskTypeList + */ + public list(request: google.cloud.compute.v1.IListRegionDiskTypesRequest, callback: google.cloud.compute.v1.RegionDiskTypes.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionDiskTypesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionDiskTypesRequest): Promise; + } + + namespace RegionDiskTypes { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDiskTypes#get}. + * @param error Error, if any + * @param [response] DiskType + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.DiskType) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDiskTypes#list}. + * @param error Error, if any + * @param [response] RegionDiskTypeList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionDiskTypeList) => void; + } + + /** Represents a RegionDisks */ + class RegionDisks extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionDisks 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 RegionDisks 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): RegionDisks; + + /** + * Calls AddResourcePolicies. + * @param request AddResourcePoliciesRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addResourcePolicies(request: google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.AddResourcePoliciesCallback): void; + + /** + * Calls AddResourcePolicies. + * @param request AddResourcePoliciesRegionDiskRequest message or plain object + * @returns Promise + */ + public addResourcePolicies(request: google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest): Promise; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSnapshot(request: google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.CreateSnapshotCallback): void; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRegionDiskRequest message or plain object + * @returns Promise + */ + public createSnapshot(request: google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionDiskRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionDiskRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Disk + */ + public get(request: google.cloud.compute.v1.IGetRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionDiskRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionDiskRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyRegionDiskRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionDiskRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionDiskRequest): Promise; + + /** + * Calls List. + * @param request ListRegionDisksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DiskList + */ + public list(request: google.cloud.compute.v1.IListRegionDisksRequest, callback: google.cloud.compute.v1.RegionDisks.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionDisksRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionDisksRequest): Promise; + + /** + * Calls RemoveResourcePolicies. + * @param request RemoveResourcePoliciesRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeResourcePolicies(request: google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.RemoveResourcePoliciesCallback): void; + + /** + * Calls RemoveResourcePolicies. + * @param request RemoveResourcePoliciesRegionDiskRequest message or plain object + * @returns Promise + */ + public removeResourcePolicies(request: google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest): Promise; + + /** + * Calls Resize. + * @param request ResizeRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resize(request: google.cloud.compute.v1.IResizeRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.ResizeCallback): void; + + /** + * Calls Resize. + * @param request ResizeRegionDiskRequest message or plain object + * @returns Promise + */ + public resize(request: google.cloud.compute.v1.IResizeRegionDiskRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyRegionDiskRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsRegionDiskRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsRegionDiskRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRegionDiskRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, callback: google.cloud.compute.v1.RegionDisks.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsRegionDiskRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest): Promise; + } + + namespace RegionDisks { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#addResourcePolicies}. + * @param error Error, if any + * @param [response] Operation + */ + type AddResourcePoliciesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#createSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSnapshotCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#get}. + * @param error Error, if any + * @param [response] Disk + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Disk) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#list}. + * @param error Error, if any + * @param [response] DiskList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.DiskList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#removeResourcePolicies}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveResourcePoliciesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#resize}. + * @param error Error, if any + * @param [response] Operation + */ + type ResizeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a RegionHealthCheckServices */ + class RegionHealthCheckServices extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionHealthCheckServices 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 RegionHealthCheckServices 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): RegionHealthCheckServices; + + /** + * Calls Delete. + * @param request DeleteRegionHealthCheckServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, callback: google.cloud.compute.v1.RegionHealthCheckServices.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionHealthCheckServiceRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionHealthCheckServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HealthCheckService + */ + public get(request: google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, callback: google.cloud.compute.v1.RegionHealthCheckServices.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionHealthCheckServiceRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionHealthCheckServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, callback: google.cloud.compute.v1.RegionHealthCheckServices.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionHealthCheckServiceRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest): Promise; + + /** + * Calls List. + * @param request ListRegionHealthCheckServicesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HealthCheckServicesList + */ + public list(request: google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, callback: google.cloud.compute.v1.RegionHealthCheckServices.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionHealthCheckServicesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionHealthCheckServicesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchRegionHealthCheckServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, callback: google.cloud.compute.v1.RegionHealthCheckServices.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchRegionHealthCheckServiceRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest): Promise; + } + + namespace RegionHealthCheckServices { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#get}. + * @param error Error, if any + * @param [response] HealthCheckService + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.HealthCheckService) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#list}. + * @param error Error, if any + * @param [response] HealthCheckServicesList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.HealthCheckServicesList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionHealthChecks */ + class RegionHealthChecks extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionHealthChecks 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 RegionHealthChecks 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): RegionHealthChecks; + + /** + * Calls Delete. + * @param request DeleteRegionHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, callback: google.cloud.compute.v1.RegionHealthChecks.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionHealthCheckRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionHealthCheckRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HealthCheck + */ + public get(request: google.cloud.compute.v1.IGetRegionHealthCheckRequest, callback: google.cloud.compute.v1.RegionHealthChecks.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionHealthCheckRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionHealthCheckRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionHealthCheckRequest, callback: google.cloud.compute.v1.RegionHealthChecks.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionHealthCheckRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionHealthCheckRequest): Promise; + + /** + * Calls List. + * @param request ListRegionHealthChecksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HealthCheckList + */ + public list(request: google.cloud.compute.v1.IListRegionHealthChecksRequest, callback: google.cloud.compute.v1.RegionHealthChecks.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionHealthChecksRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionHealthChecksRequest): Promise; + + /** + * Calls Patch. + * @param request PatchRegionHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchRegionHealthCheckRequest, callback: google.cloud.compute.v1.RegionHealthChecks.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchRegionHealthCheckRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchRegionHealthCheckRequest): Promise; + + /** + * Calls Update. + * @param request UpdateRegionHealthCheckRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, callback: google.cloud.compute.v1.RegionHealthChecks.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateRegionHealthCheckRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateRegionHealthCheckRequest): Promise; + } + + namespace RegionHealthChecks { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#get}. + * @param error Error, if any + * @param [response] HealthCheck + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.HealthCheck) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#list}. + * @param error Error, if any + * @param [response] HealthCheckList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.HealthCheckList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionInstanceGroupManagers */ + class RegionInstanceGroupManagers extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionInstanceGroupManagers 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 RegionInstanceGroupManagers 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): RegionInstanceGroupManagers; + + /** + * Calls AbandonInstances. + * @param request AbandonInstancesRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public abandonInstances(request: google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.AbandonInstancesCallback): void; + + /** + * Calls AbandonInstances. + * @param request AbandonInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public abandonInstances(request: google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls ApplyUpdatesToInstances. + * @param request ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public applyUpdatesToInstances(request: google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.ApplyUpdatesToInstancesCallback): void; + + /** + * Calls ApplyUpdatesToInstances. + * @param request ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public applyUpdatesToInstances(request: google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls CreateInstances. + * @param request CreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstances(request: google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.CreateInstancesCallback): void; + + /** + * Calls CreateInstances. + * @param request CreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public createInstances(request: google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls DeleteInstances. + * @param request DeleteInstancesRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstances(request: google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.DeleteInstancesCallback): void; + + /** + * Calls DeleteInstances. + * @param request DeleteInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public deleteInstances(request: google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls DeletePerInstanceConfigs. + * @param request DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deletePerInstanceConfigs(request: google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.DeletePerInstanceConfigsCallback): void; + + /** + * Calls DeletePerInstanceConfigs. + * @param request DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public deletePerInstanceConfigs(request: google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroupManager + */ + public get(request: google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls List. + * @param request ListRegionInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionInstanceGroupManagerList + */ + public list(request: google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest): Promise; + + /** + * Calls ListErrors. + * @param request ListErrorsRegionInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionInstanceGroupManagersListErrorsResponse + */ + public listErrors(request: google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.ListErrorsCallback): void; + + /** + * Calls ListErrors. + * @param request ListErrorsRegionInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public listErrors(request: google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest): Promise; + + /** + * Calls ListManagedInstances. + * @param request ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionInstanceGroupManagersListInstancesResponse + */ + public listManagedInstances(request: google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.ListManagedInstancesCallback): void; + + /** + * Calls ListManagedInstances. + * @param request ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public listManagedInstances(request: google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest): Promise; + + /** + * Calls ListPerInstanceConfigs. + * @param request ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionInstanceGroupManagersListInstanceConfigsResp + */ + public listPerInstanceConfigs(request: google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.ListPerInstanceConfigsCallback): void; + + /** + * Calls ListPerInstanceConfigs. + * @param request ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object + * @returns Promise + */ + public listPerInstanceConfigs(request: google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest): Promise; + + /** + * Calls Patch. + * @param request PatchRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls PatchPerInstanceConfigs. + * @param request PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patchPerInstanceConfigs(request: google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.PatchPerInstanceConfigsCallback): void; + + /** + * Calls PatchPerInstanceConfigs. + * @param request PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public patchPerInstanceConfigs(request: google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls RecreateInstances. + * @param request RecreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public recreateInstances(request: google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.RecreateInstancesCallback): void; + + /** + * Calls RecreateInstances. + * @param request RecreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public recreateInstances(request: google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls Resize. + * @param request ResizeRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resize(request: google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.ResizeCallback): void; + + /** + * Calls Resize. + * @param request ResizeRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public resize(request: google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls SetInstanceTemplate. + * @param request SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setInstanceTemplate(request: google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.SetInstanceTemplateCallback): void; + + /** + * Calls SetInstanceTemplate. + * @param request SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public setInstanceTemplate(request: google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls SetTargetPools. + * @param request SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setTargetPools(request: google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.SetTargetPoolsCallback): void; + + /** + * Calls SetTargetPools. + * @param request SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public setTargetPools(request: google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest): Promise; + + /** + * Calls UpdatePerInstanceConfigs. + * @param request UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updatePerInstanceConfigs(request: google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, callback: google.cloud.compute.v1.RegionInstanceGroupManagers.UpdatePerInstanceConfigsCallback): void; + + /** + * Calls UpdatePerInstanceConfigs. + * @param request UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @returns Promise + */ + public updatePerInstanceConfigs(request: google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest): Promise; + } + + namespace RegionInstanceGroupManagers { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#abandonInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type AbandonInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#applyUpdatesToInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type ApplyUpdatesToInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#createInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#deleteInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#deletePerInstanceConfigs}. + * @param error Error, if any + * @param [response] Operation + */ + type DeletePerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#get}. + * @param error Error, if any + * @param [response] InstanceGroupManager + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroupManager) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#list}. + * @param error Error, if any + * @param [response] RegionInstanceGroupManagerList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionInstanceGroupManagerList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#listErrors}. + * @param error Error, if any + * @param [response] RegionInstanceGroupManagersListErrorsResponse + */ + type ListErrorsCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#listManagedInstances}. + * @param error Error, if any + * @param [response] RegionInstanceGroupManagersListInstancesResponse + */ + type ListManagedInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#listPerInstanceConfigs}. + * @param error Error, if any + * @param [response] RegionInstanceGroupManagersListInstanceConfigsResp + */ + type ListPerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#patchPerInstanceConfigs}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchPerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#recreateInstances}. + * @param error Error, if any + * @param [response] Operation + */ + type RecreateInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#resize}. + * @param error Error, if any + * @param [response] Operation + */ + type ResizeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#setInstanceTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type SetInstanceTemplateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#setTargetPools}. + * @param error Error, if any + * @param [response] Operation + */ + type SetTargetPoolsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#updatePerInstanceConfigs}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdatePerInstanceConfigsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionInstanceGroups */ + class RegionInstanceGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionInstanceGroups 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 RegionInstanceGroups 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): RegionInstanceGroups; + + /** + * Calls Get. + * @param request GetRegionInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and InstanceGroup + */ + public get(request: google.cloud.compute.v1.IGetRegionInstanceGroupRequest, callback: google.cloud.compute.v1.RegionInstanceGroups.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionInstanceGroupRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionInstanceGroupRequest): Promise; + + /** + * Calls List. + * @param request ListRegionInstanceGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionInstanceGroupList + */ + public list(request: google.cloud.compute.v1.IListRegionInstanceGroupsRequest, callback: google.cloud.compute.v1.RegionInstanceGroups.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionInstanceGroupsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionInstanceGroupsRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRegionInstanceGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionInstanceGroupsListInstances + */ + public listInstances(request: google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, callback: google.cloud.compute.v1.RegionInstanceGroups.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRegionInstanceGroupsRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest): Promise; + + /** + * Calls SetNamedPorts. + * @param request SetNamedPortsRegionInstanceGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setNamedPorts(request: google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, callback: google.cloud.compute.v1.RegionInstanceGroups.SetNamedPortsCallback): void; + + /** + * Calls SetNamedPorts. + * @param request SetNamedPortsRegionInstanceGroupRequest message or plain object + * @returns Promise + */ + public setNamedPorts(request: google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest): Promise; + } + + namespace RegionInstanceGroups { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#get}. + * @param error Error, if any + * @param [response] InstanceGroup + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.InstanceGroup) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#list}. + * @param error Error, if any + * @param [response] RegionInstanceGroupList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionInstanceGroupList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#listInstances}. + * @param error Error, if any + * @param [response] RegionInstanceGroupsListInstances + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionInstanceGroupsListInstances) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#setNamedPorts}. + * @param error Error, if any + * @param [response] Operation + */ + type SetNamedPortsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionInstances */ + class RegionInstances extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionInstances 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 RegionInstances 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): RegionInstances; + + /** + * Calls BulkInsert. + * @param request BulkInsertRegionInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public bulkInsert(request: google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, callback: google.cloud.compute.v1.RegionInstances.BulkInsertCallback): void; + + /** + * Calls BulkInsert. + * @param request BulkInsertRegionInstanceRequest message or plain object + * @returns Promise + */ + public bulkInsert(request: google.cloud.compute.v1.IBulkInsertRegionInstanceRequest): Promise; + } + + namespace RegionInstances { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstances#bulkInsert}. + * @param error Error, if any + * @param [response] Operation + */ + type BulkInsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionNetworkEndpointGroups */ + class RegionNetworkEndpointGroups extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionNetworkEndpointGroups 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 RegionNetworkEndpointGroups 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): RegionNetworkEndpointGroups; + + /** + * Calls Delete. + * @param request DeleteRegionNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.RegionNetworkEndpointGroups.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroup + */ + public get(request: google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.RegionNetworkEndpointGroups.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionNetworkEndpointGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, callback: google.cloud.compute.v1.RegionNetworkEndpointGroups.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionNetworkEndpointGroupRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest): Promise; + + /** + * Calls List. + * @param request ListRegionNetworkEndpointGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkEndpointGroupList + */ + public list(request: google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, callback: google.cloud.compute.v1.RegionNetworkEndpointGroups.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionNetworkEndpointGroupsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest): Promise; + } + + namespace RegionNetworkEndpointGroups { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#get}. + * @param error Error, if any + * @param [response] NetworkEndpointGroup + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroup) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#list}. + * @param error Error, if any + * @param [response] NetworkEndpointGroupList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkEndpointGroupList) => void; + } + + /** Represents a RegionNotificationEndpoints */ + class RegionNotificationEndpoints extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionNotificationEndpoints 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 RegionNotificationEndpoints 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): RegionNotificationEndpoints; + + /** + * Calls Delete. + * @param request DeleteRegionNotificationEndpointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, callback: google.cloud.compute.v1.RegionNotificationEndpoints.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionNotificationEndpointRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionNotificationEndpointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationEndpoint + */ + public get(request: google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, callback: google.cloud.compute.v1.RegionNotificationEndpoints.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionNotificationEndpointRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionNotificationEndpointRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionNotificationEndpointRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, callback: google.cloud.compute.v1.RegionNotificationEndpoints.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionNotificationEndpointRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest): Promise; + + /** + * Calls List. + * @param request ListRegionNotificationEndpointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NotificationEndpointList + */ + public list(request: google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, callback: google.cloud.compute.v1.RegionNotificationEndpoints.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionNotificationEndpointsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionNotificationEndpointsRequest): Promise; + } + + namespace RegionNotificationEndpoints { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#get}. + * @param error Error, if any + * @param [response] NotificationEndpoint + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.NotificationEndpoint) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#list}. + * @param error Error, if any + * @param [response] NotificationEndpointList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NotificationEndpointList) => void; + } + + /** Represents a RegionOperations */ + class RegionOperations extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionOperations 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 RegionOperations 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): RegionOperations; + + /** + * Calls Delete. + * @param request DeleteRegionOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeleteRegionOperationResponse + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionOperationRequest, callback: google.cloud.compute.v1.RegionOperations.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionOperationRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionOperationRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public get(request: google.cloud.compute.v1.IGetRegionOperationRequest, callback: google.cloud.compute.v1.RegionOperations.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionOperationRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionOperationRequest): Promise; + + /** + * Calls List. + * @param request ListRegionOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OperationList + */ + public list(request: google.cloud.compute.v1.IListRegionOperationsRequest, callback: google.cloud.compute.v1.RegionOperations.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionOperationsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionOperationsRequest): Promise; + + /** + * Calls Wait. + * @param request WaitRegionOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public wait(request: google.cloud.compute.v1.IWaitRegionOperationRequest, callback: google.cloud.compute.v1.RegionOperations.WaitCallback): void; + + /** + * Calls Wait. + * @param request WaitRegionOperationRequest message or plain object + * @returns Promise + */ + public wait(request: google.cloud.compute.v1.IWaitRegionOperationRequest): Promise; + } + + namespace RegionOperations { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#delete_}. + * @param error Error, if any + * @param [response] DeleteRegionOperationResponse + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.DeleteRegionOperationResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#get}. + * @param error Error, if any + * @param [response] Operation + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#list}. + * @param error Error, if any + * @param [response] OperationList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.OperationList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#wait}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionSslCertificates */ + class RegionSslCertificates extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionSslCertificates 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 RegionSslCertificates 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): RegionSslCertificates; + + /** + * Calls Delete. + * @param request DeleteRegionSslCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, callback: google.cloud.compute.v1.RegionSslCertificates.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionSslCertificateRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionSslCertificateRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionSslCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslCertificate + */ + public get(request: google.cloud.compute.v1.IGetRegionSslCertificateRequest, callback: google.cloud.compute.v1.RegionSslCertificates.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionSslCertificateRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionSslCertificateRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionSslCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionSslCertificateRequest, callback: google.cloud.compute.v1.RegionSslCertificates.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionSslCertificateRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionSslCertificateRequest): Promise; + + /** + * Calls List. + * @param request ListRegionSslCertificatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslCertificateList + */ + public list(request: google.cloud.compute.v1.IListRegionSslCertificatesRequest, callback: google.cloud.compute.v1.RegionSslCertificates.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionSslCertificatesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionSslCertificatesRequest): Promise; + } + + namespace RegionSslCertificates { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#get}. + * @param error Error, if any + * @param [response] SslCertificate + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslCertificate) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#list}. + * @param error Error, if any + * @param [response] SslCertificateList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslCertificateList) => void; + } + + /** Represents a RegionTargetHttpProxies */ + class RegionTargetHttpProxies extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionTargetHttpProxies 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 RegionTargetHttpProxies 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): RegionTargetHttpProxies; + + /** + * Calls Delete. + * @param request DeleteRegionTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpProxies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpProxy + */ + public get(request: google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpProxies.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpProxies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest): Promise; + + /** + * Calls List. + * @param request ListRegionTargetHttpProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpProxyList + */ + public list(request: google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, callback: google.cloud.compute.v1.RegionTargetHttpProxies.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionTargetHttpProxiesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest): Promise; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapRegionTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpProxies.SetUrlMapCallback): void; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapRegionTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest): Promise; + } + + namespace RegionTargetHttpProxies { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#get}. + * @param error Error, if any + * @param [response] TargetHttpProxy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpProxy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#list}. + * @param error Error, if any + * @param [response] TargetHttpProxyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpProxyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#setUrlMap}. + * @param error Error, if any + * @param [response] Operation + */ + type SetUrlMapCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionTargetHttpsProxies */ + class RegionTargetHttpsProxies extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionTargetHttpsProxies 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 RegionTargetHttpsProxies 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): RegionTargetHttpsProxies; + + /** + * Calls Delete. + * @param request DeleteRegionTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpsProxies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpsProxy + */ + public get(request: google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpsProxies.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpsProxies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest): Promise; + + /** + * Calls List. + * @param request ListRegionTargetHttpsProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpsProxyList + */ + public list(request: google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, callback: google.cloud.compute.v1.RegionTargetHttpsProxies.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionTargetHttpsProxiesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest): Promise; + + /** + * Calls SetSslCertificates. + * @param request SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setSslCertificates(request: google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpsProxies.SetSslCertificatesCallback): void; + + /** + * Calls SetSslCertificates. + * @param request SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public setSslCertificates(request: google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest): Promise; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapRegionTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, callback: google.cloud.compute.v1.RegionTargetHttpsProxies.SetUrlMapCallback): void; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapRegionTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest): Promise; + } + + namespace RegionTargetHttpsProxies { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#get}. + * @param error Error, if any + * @param [response] TargetHttpsProxy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpsProxy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#list}. + * @param error Error, if any + * @param [response] TargetHttpsProxyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpsProxyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#setSslCertificates}. + * @param error Error, if any + * @param [response] Operation + */ + type SetSslCertificatesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#setUrlMap}. + * @param error Error, if any + * @param [response] Operation + */ + type SetUrlMapCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a RegionUrlMaps */ + class RegionUrlMaps extends $protobuf.rpc.Service { + + /** + * Constructs a new RegionUrlMaps 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 RegionUrlMaps 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): RegionUrlMaps; + + /** + * Calls Delete. + * @param request DeleteRegionUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionUrlMapRequest, callback: google.cloud.compute.v1.RegionUrlMaps.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRegionUrlMapRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRegionUrlMapRequest): Promise; + + /** + * Calls Get. + * @param request GetRegionUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlMap + */ + public get(request: google.cloud.compute.v1.IGetRegionUrlMapRequest, callback: google.cloud.compute.v1.RegionUrlMaps.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionUrlMapRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionUrlMapRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRegionUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRegionUrlMapRequest, callback: google.cloud.compute.v1.RegionUrlMaps.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRegionUrlMapRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRegionUrlMapRequest): Promise; + + /** + * Calls List. + * @param request ListRegionUrlMapsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlMapList + */ + public list(request: google.cloud.compute.v1.IListRegionUrlMapsRequest, callback: google.cloud.compute.v1.RegionUrlMaps.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionUrlMapsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionUrlMapsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchRegionUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchRegionUrlMapRequest, callback: google.cloud.compute.v1.RegionUrlMaps.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchRegionUrlMapRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchRegionUrlMapRequest): Promise; + + /** + * Calls Update. + * @param request UpdateRegionUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateRegionUrlMapRequest, callback: google.cloud.compute.v1.RegionUrlMaps.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateRegionUrlMapRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateRegionUrlMapRequest): Promise; + + /** + * Calls Validate. + * @param request ValidateRegionUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlMapsValidateResponse + */ + public validate(request: google.cloud.compute.v1.IValidateRegionUrlMapRequest, callback: google.cloud.compute.v1.RegionUrlMaps.ValidateCallback): void; + + /** + * Calls Validate. + * @param request ValidateRegionUrlMapRequest message or plain object + * @returns Promise + */ + public validate(request: google.cloud.compute.v1.IValidateRegionUrlMapRequest): Promise; + } + + namespace RegionUrlMaps { + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#get}. + * @param error Error, if any + * @param [response] UrlMap + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.UrlMap) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#list}. + * @param error Error, if any + * @param [response] UrlMapList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.UrlMapList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#validate}. + * @param error Error, if any + * @param [response] UrlMapsValidateResponse + */ + type ValidateCallback = (error: (Error|null), response?: google.cloud.compute.v1.UrlMapsValidateResponse) => void; + } + + /** Represents a Regions */ + class Regions extends $protobuf.rpc.Service { + + /** + * Constructs a new Regions 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 Regions 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): Regions; + + /** + * Calls Get. + * @param request GetRegionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Region + */ + public get(request: google.cloud.compute.v1.IGetRegionRequest, callback: google.cloud.compute.v1.Regions.GetCallback): void; + + /** + * Calls Get. + * @param request GetRegionRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRegionRequest): Promise; + + /** + * Calls List. + * @param request ListRegionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RegionList + */ + public list(request: google.cloud.compute.v1.IListRegionsRequest, callback: google.cloud.compute.v1.Regions.ListCallback): void; + + /** + * Calls List. + * @param request ListRegionsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRegionsRequest): Promise; + } + + namespace Regions { + + /** + * Callback as used by {@link google.cloud.compute.v1.Regions#get}. + * @param error Error, if any + * @param [response] Region + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Region) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Regions#list}. + * @param error Error, if any + * @param [response] RegionList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RegionList) => void; + } + + /** Represents a Reservations */ + class Reservations extends $protobuf.rpc.Service { + + /** + * Constructs a new Reservations 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 Reservations 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): Reservations; + + /** + * Calls AggregatedList. + * @param request AggregatedListReservationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReservationAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListReservationsRequest, callback: google.cloud.compute.v1.Reservations.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListReservationsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListReservationsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteReservationRequest, callback: google.cloud.compute.v1.Reservations.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteReservationRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteReservationRequest): Promise; + + /** + * Calls Get. + * @param request GetReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reservation + */ + public get(request: google.cloud.compute.v1.IGetReservationRequest, callback: google.cloud.compute.v1.Reservations.GetCallback): void; + + /** + * Calls Get. + * @param request GetReservationRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetReservationRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyReservationRequest, callback: google.cloud.compute.v1.Reservations.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyReservationRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyReservationRequest): Promise; + + /** + * Calls Insert. + * @param request InsertReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertReservationRequest, callback: google.cloud.compute.v1.Reservations.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertReservationRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertReservationRequest): Promise; + + /** + * Calls List. + * @param request ListReservationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReservationList + */ + public list(request: google.cloud.compute.v1.IListReservationsRequest, callback: google.cloud.compute.v1.Reservations.ListCallback): void; + + /** + * Calls List. + * @param request ListReservationsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListReservationsRequest): Promise; + + /** + * Calls Resize. + * @param request ResizeReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resize(request: google.cloud.compute.v1.IResizeReservationRequest, callback: google.cloud.compute.v1.Reservations.ResizeCallback): void; + + /** + * Calls Resize. + * @param request ResizeReservationRequest message or plain object + * @returns Promise + */ + public resize(request: google.cloud.compute.v1.IResizeReservationRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyReservationRequest, callback: google.cloud.compute.v1.Reservations.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyReservationRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyReservationRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsReservationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsReservationRequest, callback: google.cloud.compute.v1.Reservations.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsReservationRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsReservationRequest): Promise; + } + + namespace Reservations { + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#aggregatedList}. + * @param error Error, if any + * @param [response] ReservationAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ReservationAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#get}. + * @param error Error, if any + * @param [response] Reservation + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Reservation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#list}. + * @param error Error, if any + * @param [response] ReservationList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ReservationList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#resize}. + * @param error Error, if any + * @param [response] Operation + */ + type ResizeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a ResourcePolicies */ + class ResourcePolicies extends $protobuf.rpc.Service { + + /** + * Constructs a new ResourcePolicies 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 ResourcePolicies 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): ResourcePolicies; + + /** + * Calls AggregatedList. + * @param request AggregatedListResourcePoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourcePolicyAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest, callback: google.cloud.compute.v1.ResourcePolicies.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListResourcePoliciesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteResourcePolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteResourcePolicyRequest, callback: google.cloud.compute.v1.ResourcePolicies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteResourcePolicyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteResourcePolicyRequest): Promise; + + /** + * Calls Get. + * @param request GetResourcePolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourcePolicy + */ + public get(request: google.cloud.compute.v1.IGetResourcePolicyRequest, callback: google.cloud.compute.v1.ResourcePolicies.GetCallback): void; + + /** + * Calls Get. + * @param request GetResourcePolicyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetResourcePolicyRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyResourcePolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest, callback: google.cloud.compute.v1.ResourcePolicies.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicyResourcePolicyRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertResourcePolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertResourcePolicyRequest, callback: google.cloud.compute.v1.ResourcePolicies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertResourcePolicyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertResourcePolicyRequest): Promise; + + /** + * Calls List. + * @param request ListResourcePoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ResourcePolicyList + */ + public list(request: google.cloud.compute.v1.IListResourcePoliciesRequest, callback: google.cloud.compute.v1.ResourcePolicies.ListCallback): void; + + /** + * Calls List. + * @param request ListResourcePoliciesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListResourcePoliciesRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyResourcePolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, callback: google.cloud.compute.v1.ResourcePolicies.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicyResourcePolicyRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsResourcePolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest, callback: google.cloud.compute.v1.ResourcePolicies.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsResourcePolicyRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest): Promise; + } + + namespace ResourcePolicies { + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#aggregatedList}. + * @param error Error, if any + * @param [response] ResourcePolicyAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ResourcePolicyAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#get}. + * @param error Error, if any + * @param [response] ResourcePolicy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.ResourcePolicy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#list}. + * @param error Error, if any + * @param [response] ResourcePolicyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ResourcePolicyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a Routers */ + class Routers extends $protobuf.rpc.Service { + + /** + * Constructs a new Routers 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 Routers 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): Routers; + + /** + * Calls AggregatedList. + * @param request AggregatedListRoutersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RouterAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListRoutersRequest, callback: google.cloud.compute.v1.Routers.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListRoutersRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListRoutersRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRouterRequest, callback: google.cloud.compute.v1.Routers.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRouterRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRouterRequest): Promise; + + /** + * Calls Get. + * @param request GetRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Router + */ + public get(request: google.cloud.compute.v1.IGetRouterRequest, callback: google.cloud.compute.v1.Routers.GetCallback): void; + + /** + * Calls Get. + * @param request GetRouterRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRouterRequest): Promise; + + /** + * Calls GetNatMappingInfo. + * @param request GetNatMappingInfoRoutersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VmEndpointNatMappingsList + */ + public getNatMappingInfo(request: google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, callback: google.cloud.compute.v1.Routers.GetNatMappingInfoCallback): void; + + /** + * Calls GetNatMappingInfo. + * @param request GetNatMappingInfoRoutersRequest message or plain object + * @returns Promise + */ + public getNatMappingInfo(request: google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest): Promise; + + /** + * Calls GetRouterStatus. + * @param request GetRouterStatusRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RouterStatusResponse + */ + public getRouterStatus(request: google.cloud.compute.v1.IGetRouterStatusRouterRequest, callback: google.cloud.compute.v1.Routers.GetRouterStatusCallback): void; + + /** + * Calls GetRouterStatus. + * @param request GetRouterStatusRouterRequest message or plain object + * @returns Promise + */ + public getRouterStatus(request: google.cloud.compute.v1.IGetRouterStatusRouterRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRouterRequest, callback: google.cloud.compute.v1.Routers.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRouterRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRouterRequest): Promise; + + /** + * Calls List. + * @param request ListRoutersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RouterList + */ + public list(request: google.cloud.compute.v1.IListRoutersRequest, callback: google.cloud.compute.v1.Routers.ListCallback): void; + + /** + * Calls List. + * @param request ListRoutersRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRoutersRequest): Promise; + + /** + * Calls Patch. + * @param request PatchRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchRouterRequest, callback: google.cloud.compute.v1.Routers.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchRouterRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchRouterRequest): Promise; + + /** + * Calls Preview. + * @param request PreviewRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RoutersPreviewResponse + */ + public preview(request: google.cloud.compute.v1.IPreviewRouterRequest, callback: google.cloud.compute.v1.Routers.PreviewCallback): void; + + /** + * Calls Preview. + * @param request PreviewRouterRequest message or plain object + * @returns Promise + */ + public preview(request: google.cloud.compute.v1.IPreviewRouterRequest): Promise; + + /** + * Calls Update. + * @param request UpdateRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateRouterRequest, callback: google.cloud.compute.v1.Routers.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateRouterRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateRouterRequest): Promise; + } + + namespace Routers { + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#aggregatedList}. + * @param error Error, if any + * @param [response] RouterAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RouterAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#get}. + * @param error Error, if any + * @param [response] Router + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Router) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#getNatMappingInfo}. + * @param error Error, if any + * @param [response] VmEndpointNatMappingsList + */ + type GetNatMappingInfoCallback = (error: (Error|null), response?: google.cloud.compute.v1.VmEndpointNatMappingsList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#getRouterStatus}. + * @param error Error, if any + * @param [response] RouterStatusResponse + */ + type GetRouterStatusCallback = (error: (Error|null), response?: google.cloud.compute.v1.RouterStatusResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#list}. + * @param error Error, if any + * @param [response] RouterList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RouterList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#preview}. + * @param error Error, if any + * @param [response] RoutersPreviewResponse + */ + type PreviewCallback = (error: (Error|null), response?: google.cloud.compute.v1.RoutersPreviewResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** 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 Delete. + * @param request DeleteRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteRouteRequest, callback: google.cloud.compute.v1.Routes.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteRouteRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteRouteRequest): Promise; + + /** + * Calls Get. + * @param request GetRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Route + */ + public get(request: google.cloud.compute.v1.IGetRouteRequest, callback: google.cloud.compute.v1.Routes.GetCallback): void; + + /** + * Calls Get. + * @param request GetRouteRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetRouteRequest): Promise; + + /** + * Calls Insert. + * @param request InsertRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertRouteRequest, callback: google.cloud.compute.v1.Routes.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertRouteRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertRouteRequest): Promise; + + /** + * Calls List. + * @param request ListRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RouteList + */ + public list(request: google.cloud.compute.v1.IListRoutesRequest, callback: google.cloud.compute.v1.Routes.ListCallback): void; + + /** + * Calls List. + * @param request ListRoutesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListRoutesRequest): Promise; + } + + namespace Routes { + + /** + * Callback as used by {@link google.cloud.compute.v1.Routes#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routes#get}. + * @param error Error, if any + * @param [response] Route + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Route) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routes#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routes#list}. + * @param error Error, if any + * @param [response] RouteList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.RouteList) => void; + } + + /** Represents a SecurityPolicies */ + class SecurityPolicies extends $protobuf.rpc.Service { + + /** + * Constructs a new SecurityPolicies 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 SecurityPolicies 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): SecurityPolicies; + + /** + * Calls AddRule. + * @param request AddRuleSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addRule(request: google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.AddRuleCallback): void; + + /** + * Calls AddRule. + * @param request AddRuleSecurityPolicyRequest message or plain object + * @returns Promise + */ + public addRule(request: google.cloud.compute.v1.IAddRuleSecurityPolicyRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteSecurityPolicyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteSecurityPolicyRequest): Promise; + + /** + * Calls Get. + * @param request GetSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityPolicy + */ + public get(request: google.cloud.compute.v1.IGetSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.GetCallback): void; + + /** + * Calls Get. + * @param request GetSecurityPolicyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetSecurityPolicyRequest): Promise; + + /** + * Calls GetRule. + * @param request GetRuleSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityPolicyRule + */ + public getRule(request: google.cloud.compute.v1.IGetRuleSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.GetRuleCallback): void; + + /** + * Calls GetRule. + * @param request GetRuleSecurityPolicyRequest message or plain object + * @returns Promise + */ + public getRule(request: google.cloud.compute.v1.IGetRuleSecurityPolicyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertSecurityPolicyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertSecurityPolicyRequest): Promise; + + /** + * Calls List. + * @param request ListSecurityPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityPolicyList + */ + public list(request: google.cloud.compute.v1.IListSecurityPoliciesRequest, callback: google.cloud.compute.v1.SecurityPolicies.ListCallback): void; + + /** + * Calls List. + * @param request ListSecurityPoliciesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListSecurityPoliciesRequest): Promise; + + /** + * Calls ListPreconfiguredExpressionSets. + * @param request ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SecurityPoliciesListPreconfiguredExpressionSetsResponse + */ + public listPreconfiguredExpressionSets(request: google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, callback: google.cloud.compute.v1.SecurityPolicies.ListPreconfiguredExpressionSetsCallback): void; + + /** + * Calls ListPreconfiguredExpressionSets. + * @param request ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object + * @returns Promise + */ + public listPreconfiguredExpressionSets(request: google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchSecurityPolicyRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchSecurityPolicyRequest): Promise; + + /** + * Calls PatchRule. + * @param request PatchRuleSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patchRule(request: google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.PatchRuleCallback): void; + + /** + * Calls PatchRule. + * @param request PatchRuleSecurityPolicyRequest message or plain object + * @returns Promise + */ + public patchRule(request: google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest): Promise; + + /** + * Calls RemoveRule. + * @param request RemoveRuleSecurityPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeRule(request: google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, callback: google.cloud.compute.v1.SecurityPolicies.RemoveRuleCallback): void; + + /** + * Calls RemoveRule. + * @param request RemoveRuleSecurityPolicyRequest message or plain object + * @returns Promise + */ + public removeRule(request: google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest): Promise; + } + + namespace SecurityPolicies { + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#addRule}. + * @param error Error, if any + * @param [response] Operation + */ + type AddRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#get}. + * @param error Error, if any + * @param [response] SecurityPolicy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.SecurityPolicy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#getRule}. + * @param error Error, if any + * @param [response] SecurityPolicyRule + */ + type GetRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.SecurityPolicyRule) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#list}. + * @param error Error, if any + * @param [response] SecurityPolicyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SecurityPolicyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#listPreconfiguredExpressionSets}. + * @param error Error, if any + * @param [response] SecurityPoliciesListPreconfiguredExpressionSetsResponse + */ + type ListPreconfiguredExpressionSetsCallback = (error: (Error|null), response?: google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#patchRule}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#removeRule}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a Snapshots */ + class Snapshots extends $protobuf.rpc.Service { + + /** + * Constructs a new Snapshots 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 Snapshots 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): Snapshots; + + /** + * Calls Delete. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteSnapshotRequest, callback: google.cloud.compute.v1.Snapshots.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteSnapshotRequest): Promise; + + /** + * Calls Get. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public get(request: google.cloud.compute.v1.IGetSnapshotRequest, callback: google.cloud.compute.v1.Snapshots.GetCallback): void; + + /** + * Calls Get. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetSnapshotRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicySnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicySnapshotRequest, callback: google.cloud.compute.v1.Snapshots.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicySnapshotRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicySnapshotRequest): Promise; + + /** + * Calls List. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SnapshotList + */ + public list(request: google.cloud.compute.v1.IListSnapshotsRequest, callback: google.cloud.compute.v1.Snapshots.ListCallback): void; + + /** + * Calls List. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListSnapshotsRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicySnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicySnapshotRequest, callback: google.cloud.compute.v1.Snapshots.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicySnapshotRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicySnapshotRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsSnapshotRequest, callback: google.cloud.compute.v1.Snapshots.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsSnapshotRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsSnapshotRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, callback: google.cloud.compute.v1.Snapshots.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsSnapshotRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest): Promise; + } + + namespace Snapshots { + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#get}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Snapshot) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#list}. + * @param error Error, if any + * @param [response] SnapshotList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SnapshotList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a SslCertificates */ + class SslCertificates extends $protobuf.rpc.Service { + + /** + * Constructs a new SslCertificates 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 SslCertificates 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): SslCertificates; + + /** + * Calls AggregatedList. + * @param request AggregatedListSslCertificatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslCertificateAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListSslCertificatesRequest, callback: google.cloud.compute.v1.SslCertificates.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListSslCertificatesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListSslCertificatesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteSslCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteSslCertificateRequest, callback: google.cloud.compute.v1.SslCertificates.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteSslCertificateRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteSslCertificateRequest): Promise; + + /** + * Calls Get. + * @param request GetSslCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslCertificate + */ + public get(request: google.cloud.compute.v1.IGetSslCertificateRequest, callback: google.cloud.compute.v1.SslCertificates.GetCallback): void; + + /** + * Calls Get. + * @param request GetSslCertificateRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetSslCertificateRequest): Promise; + + /** + * Calls Insert. + * @param request InsertSslCertificateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertSslCertificateRequest, callback: google.cloud.compute.v1.SslCertificates.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertSslCertificateRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertSslCertificateRequest): Promise; + + /** + * Calls List. + * @param request ListSslCertificatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslCertificateList + */ + public list(request: google.cloud.compute.v1.IListSslCertificatesRequest, callback: google.cloud.compute.v1.SslCertificates.ListCallback): void; + + /** + * Calls List. + * @param request ListSslCertificatesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListSslCertificatesRequest): Promise; + } + + namespace SslCertificates { + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#aggregatedList}. + * @param error Error, if any + * @param [response] SslCertificateAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslCertificateAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#get}. + * @param error Error, if any + * @param [response] SslCertificate + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslCertificate) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#list}. + * @param error Error, if any + * @param [response] SslCertificateList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslCertificateList) => void; + } + + /** Represents a SslPolicies */ + class SslPolicies extends $protobuf.rpc.Service { + + /** + * Constructs a new SslPolicies 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 SslPolicies 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): SslPolicies; + + /** + * Calls Delete. + * @param request DeleteSslPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteSslPolicyRequest, callback: google.cloud.compute.v1.SslPolicies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteSslPolicyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteSslPolicyRequest): Promise; + + /** + * Calls Get. + * @param request GetSslPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslPolicy + */ + public get(request: google.cloud.compute.v1.IGetSslPolicyRequest, callback: google.cloud.compute.v1.SslPolicies.GetCallback): void; + + /** + * Calls Get. + * @param request GetSslPolicyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetSslPolicyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertSslPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertSslPolicyRequest, callback: google.cloud.compute.v1.SslPolicies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertSslPolicyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertSslPolicyRequest): Promise; + + /** + * Calls List. + * @param request ListSslPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslPoliciesList + */ + public list(request: google.cloud.compute.v1.IListSslPoliciesRequest, callback: google.cloud.compute.v1.SslPolicies.ListCallback): void; + + /** + * Calls List. + * @param request ListSslPoliciesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListSslPoliciesRequest): Promise; + + /** + * Calls ListAvailableFeatures. + * @param request ListAvailableFeaturesSslPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SslPoliciesListAvailableFeaturesResponse + */ + public listAvailableFeatures(request: google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, callback: google.cloud.compute.v1.SslPolicies.ListAvailableFeaturesCallback): void; + + /** + * Calls ListAvailableFeatures. + * @param request ListAvailableFeaturesSslPoliciesRequest message or plain object + * @returns Promise + */ + public listAvailableFeatures(request: google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchSslPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchSslPolicyRequest, callback: google.cloud.compute.v1.SslPolicies.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchSslPolicyRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchSslPolicyRequest): Promise; + } + + namespace SslPolicies { + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#get}. + * @param error Error, if any + * @param [response] SslPolicy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslPolicy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#list}. + * @param error Error, if any + * @param [response] SslPoliciesList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslPoliciesList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#listAvailableFeatures}. + * @param error Error, if any + * @param [response] SslPoliciesListAvailableFeaturesResponse + */ + type ListAvailableFeaturesCallback = (error: (Error|null), response?: google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a Subnetworks */ + class Subnetworks extends $protobuf.rpc.Service { + + /** + * Constructs a new Subnetworks 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 Subnetworks 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): Subnetworks; + + /** + * Calls AggregatedList. + * @param request AggregatedListSubnetworksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SubnetworkAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListSubnetworksRequest, callback: google.cloud.compute.v1.Subnetworks.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListSubnetworksRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListSubnetworksRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteSubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteSubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteSubnetworkRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteSubnetworkRequest): Promise; + + /** + * Calls ExpandIpCidrRange. + * @param request ExpandIpCidrRangeSubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public expandIpCidrRange(request: google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.ExpandIpCidrRangeCallback): void; + + /** + * Calls ExpandIpCidrRange. + * @param request ExpandIpCidrRangeSubnetworkRequest message or plain object + * @returns Promise + */ + public expandIpCidrRange(request: google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest): Promise; + + /** + * Calls Get. + * @param request GetSubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Subnetwork + */ + public get(request: google.cloud.compute.v1.IGetSubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.GetCallback): void; + + /** + * Calls Get. + * @param request GetSubnetworkRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetSubnetworkRequest): Promise; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicySubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicySubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.GetIamPolicyCallback): void; + + /** + * Calls GetIamPolicy. + * @param request GetIamPolicySubnetworkRequest message or plain object + * @returns Promise + */ + public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicySubnetworkRequest): Promise; + + /** + * Calls Insert. + * @param request InsertSubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertSubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertSubnetworkRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertSubnetworkRequest): Promise; + + /** + * Calls List. + * @param request ListSubnetworksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SubnetworkList + */ + public list(request: google.cloud.compute.v1.IListSubnetworksRequest, callback: google.cloud.compute.v1.Subnetworks.ListCallback): void; + + /** + * Calls List. + * @param request ListSubnetworksRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListSubnetworksRequest): Promise; + + /** + * Calls ListUsable. + * @param request ListUsableSubnetworksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UsableSubnetworksAggregatedList + */ + public listUsable(request: google.cloud.compute.v1.IListUsableSubnetworksRequest, callback: google.cloud.compute.v1.Subnetworks.ListUsableCallback): void; + + /** + * Calls ListUsable. + * @param request ListUsableSubnetworksRequest message or plain object + * @returns Promise + */ + public listUsable(request: google.cloud.compute.v1.IListUsableSubnetworksRequest): Promise; + + /** + * Calls Patch. + * @param request PatchSubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchSubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchSubnetworkRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchSubnetworkRequest): Promise; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicySubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Policy + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.SetIamPolicyCallback): void; + + /** + * Calls SetIamPolicy. + * @param request SetIamPolicySubnetworkRequest message or plain object + * @returns Promise + */ + public setIamPolicy(request: google.cloud.compute.v1.ISetIamPolicySubnetworkRequest): Promise; + + /** + * Calls SetPrivateIpGoogleAccess. + * @param request SetPrivateIpGoogleAccessSubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setPrivateIpGoogleAccess(request: google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.SetPrivateIpGoogleAccessCallback): void; + + /** + * Calls SetPrivateIpGoogleAccess. + * @param request SetPrivateIpGoogleAccessSubnetworkRequest message or plain object + * @returns Promise + */ + public setPrivateIpGoogleAccess(request: google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsSubnetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, callback: google.cloud.compute.v1.Subnetworks.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsSubnetworkRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest): Promise; + } + + namespace Subnetworks { + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#aggregatedList}. + * @param error Error, if any + * @param [response] SubnetworkAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SubnetworkAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#expandIpCidrRange}. + * @param error Error, if any + * @param [response] Operation + */ + type ExpandIpCidrRangeCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#get}. + * @param error Error, if any + * @param [response] Subnetwork + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Subnetwork) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#getIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#list}. + * @param error Error, if any + * @param [response] SubnetworkList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.SubnetworkList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#listUsable}. + * @param error Error, if any + * @param [response] UsableSubnetworksAggregatedList + */ + type ListUsableCallback = (error: (Error|null), response?: google.cloud.compute.v1.UsableSubnetworksAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#setIamPolicy}. + * @param error Error, if any + * @param [response] Policy + */ + type SetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#setPrivateIpGoogleAccess}. + * @param error Error, if any + * @param [response] Operation + */ + type SetPrivateIpGoogleAccessCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a TargetGrpcProxies */ + class TargetGrpcProxies extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetGrpcProxies 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 TargetGrpcProxies 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): TargetGrpcProxies; + + /** + * Calls Delete. + * @param request DeleteTargetGrpcProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, callback: google.cloud.compute.v1.TargetGrpcProxies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetGrpcProxyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetGrpcProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetGrpcProxy + */ + public get(request: google.cloud.compute.v1.IGetTargetGrpcProxyRequest, callback: google.cloud.compute.v1.TargetGrpcProxies.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetGrpcProxyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetGrpcProxyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetGrpcProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, callback: google.cloud.compute.v1.TargetGrpcProxies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetGrpcProxyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetGrpcProxyRequest): Promise; + + /** + * Calls List. + * @param request ListTargetGrpcProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetGrpcProxyList + */ + public list(request: google.cloud.compute.v1.IListTargetGrpcProxiesRequest, callback: google.cloud.compute.v1.TargetGrpcProxies.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetGrpcProxiesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetGrpcProxiesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchTargetGrpcProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, callback: google.cloud.compute.v1.TargetGrpcProxies.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchTargetGrpcProxyRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchTargetGrpcProxyRequest): Promise; + } + + namespace TargetGrpcProxies { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#get}. + * @param error Error, if any + * @param [response] TargetGrpcProxy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetGrpcProxy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#list}. + * @param error Error, if any + * @param [response] TargetGrpcProxyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetGrpcProxyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a TargetHttpProxies */ + class TargetHttpProxies extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetHttpProxies 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 TargetHttpProxies 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): TargetHttpProxies; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetHttpProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpProxyAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest, callback: google.cloud.compute.v1.TargetHttpProxies.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetHttpProxiesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, callback: google.cloud.compute.v1.TargetHttpProxies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetHttpProxyRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpProxy + */ + public get(request: google.cloud.compute.v1.IGetTargetHttpProxyRequest, callback: google.cloud.compute.v1.TargetHttpProxies.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetHttpProxyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetHttpProxyRequest, callback: google.cloud.compute.v1.TargetHttpProxies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetHttpProxyRequest): Promise; + + /** + * Calls List. + * @param request ListTargetHttpProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpProxyList + */ + public list(request: google.cloud.compute.v1.IListTargetHttpProxiesRequest, callback: google.cloud.compute.v1.TargetHttpProxies.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetHttpProxiesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetHttpProxiesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchTargetHttpProxyRequest, callback: google.cloud.compute.v1.TargetHttpProxies.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchTargetHttpProxyRequest): Promise; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapTargetHttpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, callback: google.cloud.compute.v1.TargetHttpProxies.SetUrlMapCallback): void; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapTargetHttpProxyRequest message or plain object + * @returns Promise + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest): Promise; + } + + namespace TargetHttpProxies { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#aggregatedList}. + * @param error Error, if any + * @param [response] TargetHttpProxyAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpProxyAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#get}. + * @param error Error, if any + * @param [response] TargetHttpProxy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpProxy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#list}. + * @param error Error, if any + * @param [response] TargetHttpProxyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpProxyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#setUrlMap}. + * @param error Error, if any + * @param [response] Operation + */ + type SetUrlMapCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a TargetHttpsProxies */ + class TargetHttpsProxies extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetHttpsProxies 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 TargetHttpsProxies 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): TargetHttpsProxies; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetHttpsProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpsProxyAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetHttpsProxiesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpsProxy + */ + public get(request: google.cloud.compute.v1.IGetTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetHttpsProxyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetHttpsProxyRequest): Promise; + + /** + * Calls List. + * @param request ListTargetHttpsProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetHttpsProxyList + */ + public list(request: google.cloud.compute.v1.IListTargetHttpsProxiesRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetHttpsProxiesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetHttpsProxiesRequest): Promise; + + /** + * Calls Patch. + * @param request PatchTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchTargetHttpsProxyRequest): Promise; + + /** + * Calls SetQuicOverride. + * @param request SetQuicOverrideTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setQuicOverride(request: google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.SetQuicOverrideCallback): void; + + /** + * Calls SetQuicOverride. + * @param request SetQuicOverrideTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public setQuicOverride(request: google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest): Promise; + + /** + * Calls SetSslCertificates. + * @param request SetSslCertificatesTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setSslCertificates(request: google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.SetSslCertificatesCallback): void; + + /** + * Calls SetSslCertificates. + * @param request SetSslCertificatesTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public setSslCertificates(request: google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest): Promise; + + /** + * Calls SetSslPolicy. + * @param request SetSslPolicyTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setSslPolicy(request: google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.SetSslPolicyCallback): void; + + /** + * Calls SetSslPolicy. + * @param request SetSslPolicyTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public setSslPolicy(request: google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest): Promise; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapTargetHttpsProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, callback: google.cloud.compute.v1.TargetHttpsProxies.SetUrlMapCallback): void; + + /** + * Calls SetUrlMap. + * @param request SetUrlMapTargetHttpsProxyRequest message or plain object + * @returns Promise + */ + public setUrlMap(request: google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest): Promise; + } + + namespace TargetHttpsProxies { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#aggregatedList}. + * @param error Error, if any + * @param [response] TargetHttpsProxyAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpsProxyAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#get}. + * @param error Error, if any + * @param [response] TargetHttpsProxy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpsProxy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#list}. + * @param error Error, if any + * @param [response] TargetHttpsProxyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetHttpsProxyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setQuicOverride}. + * @param error Error, if any + * @param [response] Operation + */ + type SetQuicOverrideCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setSslCertificates}. + * @param error Error, if any + * @param [response] Operation + */ + type SetSslCertificatesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setSslPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type SetSslPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setUrlMap}. + * @param error Error, if any + * @param [response] Operation + */ + type SetUrlMapCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a TargetInstances */ + class TargetInstances extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetInstances 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 TargetInstances 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): TargetInstances; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetInstanceAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetInstancesRequest, callback: google.cloud.compute.v1.TargetInstances.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetInstancesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetInstancesRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteTargetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetInstanceRequest, callback: google.cloud.compute.v1.TargetInstances.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetInstanceRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetInstanceRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetInstance + */ + public get(request: google.cloud.compute.v1.IGetTargetInstanceRequest, callback: google.cloud.compute.v1.TargetInstances.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetInstanceRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetInstanceRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetInstanceRequest, callback: google.cloud.compute.v1.TargetInstances.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetInstanceRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetInstanceRequest): Promise; + + /** + * Calls List. + * @param request ListTargetInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetInstanceList + */ + public list(request: google.cloud.compute.v1.IListTargetInstancesRequest, callback: google.cloud.compute.v1.TargetInstances.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetInstancesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetInstancesRequest): Promise; + } + + namespace TargetInstances { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#aggregatedList}. + * @param error Error, if any + * @param [response] TargetInstanceAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetInstanceAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#get}. + * @param error Error, if any + * @param [response] TargetInstance + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetInstance) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#list}. + * @param error Error, if any + * @param [response] TargetInstanceList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetInstanceList) => void; + } + + /** Represents a TargetPools */ + class TargetPools extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetPools 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 TargetPools 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): TargetPools; + + /** + * Calls AddHealthCheck. + * @param request AddHealthCheckTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addHealthCheck(request: google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.AddHealthCheckCallback): void; + + /** + * Calls AddHealthCheck. + * @param request AddHealthCheckTargetPoolRequest message or plain object + * @returns Promise + */ + public addHealthCheck(request: google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest): Promise; + + /** + * Calls AddInstance. + * @param request AddInstanceTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addInstance(request: google.cloud.compute.v1.IAddInstanceTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.AddInstanceCallback): void; + + /** + * Calls AddInstance. + * @param request AddInstanceTargetPoolRequest message or plain object + * @returns Promise + */ + public addInstance(request: google.cloud.compute.v1.IAddInstanceTargetPoolRequest): Promise; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetPoolAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetPoolsRequest, callback: google.cloud.compute.v1.TargetPools.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetPoolsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetPoolsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetPoolRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetPoolRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetPool + */ + public get(request: google.cloud.compute.v1.IGetTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetPoolRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetPoolRequest): Promise; + + /** + * Calls GetHealth. + * @param request GetHealthTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetPoolInstanceHealth + */ + public getHealth(request: google.cloud.compute.v1.IGetHealthTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.GetHealthCallback): void; + + /** + * Calls GetHealth. + * @param request GetHealthTargetPoolRequest message or plain object + * @returns Promise + */ + public getHealth(request: google.cloud.compute.v1.IGetHealthTargetPoolRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetPoolRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetPoolRequest): Promise; + + /** + * Calls List. + * @param request ListTargetPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetPoolList + */ + public list(request: google.cloud.compute.v1.IListTargetPoolsRequest, callback: google.cloud.compute.v1.TargetPools.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetPoolsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetPoolsRequest): Promise; + + /** + * Calls RemoveHealthCheck. + * @param request RemoveHealthCheckTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeHealthCheck(request: google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.RemoveHealthCheckCallback): void; + + /** + * Calls RemoveHealthCheck. + * @param request RemoveHealthCheckTargetPoolRequest message or plain object + * @returns Promise + */ + public removeHealthCheck(request: google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest): Promise; + + /** + * Calls RemoveInstance. + * @param request RemoveInstanceTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removeInstance(request: google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.RemoveInstanceCallback): void; + + /** + * Calls RemoveInstance. + * @param request RemoveInstanceTargetPoolRequest message or plain object + * @returns Promise + */ + public removeInstance(request: google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest): Promise; + + /** + * Calls SetBackup. + * @param request SetBackupTargetPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setBackup(request: google.cloud.compute.v1.ISetBackupTargetPoolRequest, callback: google.cloud.compute.v1.TargetPools.SetBackupCallback): void; + + /** + * Calls SetBackup. + * @param request SetBackupTargetPoolRequest message or plain object + * @returns Promise + */ + public setBackup(request: google.cloud.compute.v1.ISetBackupTargetPoolRequest): Promise; + } + + namespace TargetPools { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#addHealthCheck}. + * @param error Error, if any + * @param [response] Operation + */ + type AddHealthCheckCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#addInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type AddInstanceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#aggregatedList}. + * @param error Error, if any + * @param [response] TargetPoolAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetPoolAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#get}. + * @param error Error, if any + * @param [response] TargetPool + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetPool) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#getHealth}. + * @param error Error, if any + * @param [response] TargetPoolInstanceHealth + */ + type GetHealthCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetPoolInstanceHealth) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#list}. + * @param error Error, if any + * @param [response] TargetPoolList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetPoolList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#removeHealthCheck}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveHealthCheckCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#removeInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RemoveInstanceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#setBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type SetBackupCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a TargetSslProxies */ + class TargetSslProxies extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetSslProxies 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 TargetSslProxies 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): TargetSslProxies; + + /** + * Calls Delete. + * @param request DeleteTargetSslProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetSslProxyRequest, callback: google.cloud.compute.v1.TargetSslProxies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetSslProxyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetSslProxyRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetSslProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetSslProxy + */ + public get(request: google.cloud.compute.v1.IGetTargetSslProxyRequest, callback: google.cloud.compute.v1.TargetSslProxies.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetSslProxyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetSslProxyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetSslProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetSslProxyRequest, callback: google.cloud.compute.v1.TargetSslProxies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetSslProxyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetSslProxyRequest): Promise; + + /** + * Calls List. + * @param request ListTargetSslProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetSslProxyList + */ + public list(request: google.cloud.compute.v1.IListTargetSslProxiesRequest, callback: google.cloud.compute.v1.TargetSslProxies.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetSslProxiesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetSslProxiesRequest): Promise; + + /** + * Calls SetBackendService. + * @param request SetBackendServiceTargetSslProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setBackendService(request: google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, callback: google.cloud.compute.v1.TargetSslProxies.SetBackendServiceCallback): void; + + /** + * Calls SetBackendService. + * @param request SetBackendServiceTargetSslProxyRequest message or plain object + * @returns Promise + */ + public setBackendService(request: google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest): Promise; + + /** + * Calls SetProxyHeader. + * @param request SetProxyHeaderTargetSslProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setProxyHeader(request: google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, callback: google.cloud.compute.v1.TargetSslProxies.SetProxyHeaderCallback): void; + + /** + * Calls SetProxyHeader. + * @param request SetProxyHeaderTargetSslProxyRequest message or plain object + * @returns Promise + */ + public setProxyHeader(request: google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest): Promise; + + /** + * Calls SetSslCertificates. + * @param request SetSslCertificatesTargetSslProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setSslCertificates(request: google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, callback: google.cloud.compute.v1.TargetSslProxies.SetSslCertificatesCallback): void; + + /** + * Calls SetSslCertificates. + * @param request SetSslCertificatesTargetSslProxyRequest message or plain object + * @returns Promise + */ + public setSslCertificates(request: google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest): Promise; + + /** + * Calls SetSslPolicy. + * @param request SetSslPolicyTargetSslProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setSslPolicy(request: google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, callback: google.cloud.compute.v1.TargetSslProxies.SetSslPolicyCallback): void; + + /** + * Calls SetSslPolicy. + * @param request SetSslPolicyTargetSslProxyRequest message or plain object + * @returns Promise + */ + public setSslPolicy(request: google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest): Promise; + } + + namespace TargetSslProxies { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#get}. + * @param error Error, if any + * @param [response] TargetSslProxy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetSslProxy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#list}. + * @param error Error, if any + * @param [response] TargetSslProxyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetSslProxyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setBackendService}. + * @param error Error, if any + * @param [response] Operation + */ + type SetBackendServiceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setProxyHeader}. + * @param error Error, if any + * @param [response] Operation + */ + type SetProxyHeaderCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setSslCertificates}. + * @param error Error, if any + * @param [response] Operation + */ + type SetSslCertificatesCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setSslPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type SetSslPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a TargetTcpProxies */ + class TargetTcpProxies extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetTcpProxies 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 TargetTcpProxies 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): TargetTcpProxies; + + /** + * Calls Delete. + * @param request DeleteTargetTcpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, callback: google.cloud.compute.v1.TargetTcpProxies.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetTcpProxyRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetTcpProxyRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetTcpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetTcpProxy + */ + public get(request: google.cloud.compute.v1.IGetTargetTcpProxyRequest, callback: google.cloud.compute.v1.TargetTcpProxies.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetTcpProxyRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetTcpProxyRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetTcpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetTcpProxyRequest, callback: google.cloud.compute.v1.TargetTcpProxies.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetTcpProxyRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetTcpProxyRequest): Promise; + + /** + * Calls List. + * @param request ListTargetTcpProxiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetTcpProxyList + */ + public list(request: google.cloud.compute.v1.IListTargetTcpProxiesRequest, callback: google.cloud.compute.v1.TargetTcpProxies.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetTcpProxiesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetTcpProxiesRequest): Promise; + + /** + * Calls SetBackendService. + * @param request SetBackendServiceTargetTcpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setBackendService(request: google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, callback: google.cloud.compute.v1.TargetTcpProxies.SetBackendServiceCallback): void; + + /** + * Calls SetBackendService. + * @param request SetBackendServiceTargetTcpProxyRequest message or plain object + * @returns Promise + */ + public setBackendService(request: google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest): Promise; + + /** + * Calls SetProxyHeader. + * @param request SetProxyHeaderTargetTcpProxyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setProxyHeader(request: google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, callback: google.cloud.compute.v1.TargetTcpProxies.SetProxyHeaderCallback): void; + + /** + * Calls SetProxyHeader. + * @param request SetProxyHeaderTargetTcpProxyRequest message or plain object + * @returns Promise + */ + public setProxyHeader(request: google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest): Promise; + } + + namespace TargetTcpProxies { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#get}. + * @param error Error, if any + * @param [response] TargetTcpProxy + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetTcpProxy) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#list}. + * @param error Error, if any + * @param [response] TargetTcpProxyList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetTcpProxyList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#setBackendService}. + * @param error Error, if any + * @param [response] Operation + */ + type SetBackendServiceCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#setProxyHeader}. + * @param error Error, if any + * @param [response] Operation + */ + type SetProxyHeaderCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a TargetVpnGateways */ + class TargetVpnGateways extends $protobuf.rpc.Service { + + /** + * Constructs a new TargetVpnGateways 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 TargetVpnGateways 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): TargetVpnGateways; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetVpnGatewaysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetVpnGatewayAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest, callback: google.cloud.compute.v1.TargetVpnGateways.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListTargetVpnGatewaysRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteTargetVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, callback: google.cloud.compute.v1.TargetVpnGateways.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteTargetVpnGatewayRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest): Promise; + + /** + * Calls Get. + * @param request GetTargetVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetVpnGateway + */ + public get(request: google.cloud.compute.v1.IGetTargetVpnGatewayRequest, callback: google.cloud.compute.v1.TargetVpnGateways.GetCallback): void; + + /** + * Calls Get. + * @param request GetTargetVpnGatewayRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetTargetVpnGatewayRequest): Promise; + + /** + * Calls Insert. + * @param request InsertTargetVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, callback: google.cloud.compute.v1.TargetVpnGateways.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertTargetVpnGatewayRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertTargetVpnGatewayRequest): Promise; + + /** + * Calls List. + * @param request ListTargetVpnGatewaysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TargetVpnGatewayList + */ + public list(request: google.cloud.compute.v1.IListTargetVpnGatewaysRequest, callback: google.cloud.compute.v1.TargetVpnGateways.ListCallback): void; + + /** + * Calls List. + * @param request ListTargetVpnGatewaysRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListTargetVpnGatewaysRequest): Promise; + } + + namespace TargetVpnGateways { + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#aggregatedList}. + * @param error Error, if any + * @param [response] TargetVpnGatewayAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetVpnGatewayAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#get}. + * @param error Error, if any + * @param [response] TargetVpnGateway + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetVpnGateway) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#list}. + * @param error Error, if any + * @param [response] TargetVpnGatewayList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.TargetVpnGatewayList) => void; + } + + /** Represents an UrlMaps */ + class UrlMaps extends $protobuf.rpc.Service { + + /** + * Constructs a new UrlMaps 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 UrlMaps 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): UrlMaps; + + /** + * Calls AggregatedList. + * @param request AggregatedListUrlMapsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlMapsAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListUrlMapsRequest, callback: google.cloud.compute.v1.UrlMaps.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListUrlMapsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListUrlMapsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteUrlMapRequest, callback: google.cloud.compute.v1.UrlMaps.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteUrlMapRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteUrlMapRequest): Promise; + + /** + * Calls Get. + * @param request GetUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlMap + */ + public get(request: google.cloud.compute.v1.IGetUrlMapRequest, callback: google.cloud.compute.v1.UrlMaps.GetCallback): void; + + /** + * Calls Get. + * @param request GetUrlMapRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetUrlMapRequest): Promise; + + /** + * Calls Insert. + * @param request InsertUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertUrlMapRequest, callback: google.cloud.compute.v1.UrlMaps.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertUrlMapRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertUrlMapRequest): Promise; + + /** + * Calls InvalidateCache. + * @param request InvalidateCacheUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public invalidateCache(request: google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, callback: google.cloud.compute.v1.UrlMaps.InvalidateCacheCallback): void; + + /** + * Calls InvalidateCache. + * @param request InvalidateCacheUrlMapRequest message or plain object + * @returns Promise + */ + public invalidateCache(request: google.cloud.compute.v1.IInvalidateCacheUrlMapRequest): Promise; + + /** + * Calls List. + * @param request ListUrlMapsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlMapList + */ + public list(request: google.cloud.compute.v1.IListUrlMapsRequest, callback: google.cloud.compute.v1.UrlMaps.ListCallback): void; + + /** + * Calls List. + * @param request ListUrlMapsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListUrlMapsRequest): Promise; + + /** + * Calls Patch. + * @param request PatchUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patch(request: google.cloud.compute.v1.IPatchUrlMapRequest, callback: google.cloud.compute.v1.UrlMaps.PatchCallback): void; + + /** + * Calls Patch. + * @param request PatchUrlMapRequest message or plain object + * @returns Promise + */ + public patch(request: google.cloud.compute.v1.IPatchUrlMapRequest): Promise; + + /** + * Calls Update. + * @param request UpdateUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public update(request: google.cloud.compute.v1.IUpdateUrlMapRequest, callback: google.cloud.compute.v1.UrlMaps.UpdateCallback): void; + + /** + * Calls Update. + * @param request UpdateUrlMapRequest message or plain object + * @returns Promise + */ + public update(request: google.cloud.compute.v1.IUpdateUrlMapRequest): Promise; + + /** + * Calls Validate. + * @param request ValidateUrlMapRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UrlMapsValidateResponse + */ + public validate(request: google.cloud.compute.v1.IValidateUrlMapRequest, callback: google.cloud.compute.v1.UrlMaps.ValidateCallback): void; + + /** + * Calls Validate. + * @param request ValidateUrlMapRequest message or plain object + * @returns Promise + */ + public validate(request: google.cloud.compute.v1.IValidateUrlMapRequest): Promise; + } + + namespace UrlMaps { + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#aggregatedList}. + * @param error Error, if any + * @param [response] UrlMapsAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.UrlMapsAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#get}. + * @param error Error, if any + * @param [response] UrlMap + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.UrlMap) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#invalidateCache}. + * @param error Error, if any + * @param [response] Operation + */ + type InvalidateCacheCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#list}. + * @param error Error, if any + * @param [response] UrlMapList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.UrlMapList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#patch}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#update}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#validate}. + * @param error Error, if any + * @param [response] UrlMapsValidateResponse + */ + type ValidateCallback = (error: (Error|null), response?: google.cloud.compute.v1.UrlMapsValidateResponse) => void; + } + + /** Represents a VpnGateways */ + class VpnGateways extends $protobuf.rpc.Service { + + /** + * Constructs a new VpnGateways 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 VpnGateways 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): VpnGateways; + + /** + * Calls AggregatedList. + * @param request AggregatedListVpnGatewaysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnGatewayAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest, callback: google.cloud.compute.v1.VpnGateways.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListVpnGatewaysRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteVpnGatewayRequest, callback: google.cloud.compute.v1.VpnGateways.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteVpnGatewayRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteVpnGatewayRequest): Promise; + + /** + * Calls Get. + * @param request GetVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnGateway + */ + public get(request: google.cloud.compute.v1.IGetVpnGatewayRequest, callback: google.cloud.compute.v1.VpnGateways.GetCallback): void; + + /** + * Calls Get. + * @param request GetVpnGatewayRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetVpnGatewayRequest): Promise; + + /** + * Calls GetStatus. + * @param request GetStatusVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnGatewaysGetStatusResponse + */ + public getStatus(request: google.cloud.compute.v1.IGetStatusVpnGatewayRequest, callback: google.cloud.compute.v1.VpnGateways.GetStatusCallback): void; + + /** + * Calls GetStatus. + * @param request GetStatusVpnGatewayRequest message or plain object + * @returns Promise + */ + public getStatus(request: google.cloud.compute.v1.IGetStatusVpnGatewayRequest): Promise; + + /** + * Calls Insert. + * @param request InsertVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertVpnGatewayRequest, callback: google.cloud.compute.v1.VpnGateways.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertVpnGatewayRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertVpnGatewayRequest): Promise; + + /** + * Calls List. + * @param request ListVpnGatewaysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnGatewayList + */ + public list(request: google.cloud.compute.v1.IListVpnGatewaysRequest, callback: google.cloud.compute.v1.VpnGateways.ListCallback): void; + + /** + * Calls List. + * @param request ListVpnGatewaysRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListVpnGatewaysRequest): Promise; + + /** + * Calls SetLabels. + * @param request SetLabelsVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, callback: google.cloud.compute.v1.VpnGateways.SetLabelsCallback): void; + + /** + * Calls SetLabels. + * @param request SetLabelsVpnGatewayRequest message or plain object + * @returns Promise + */ + public setLabels(request: google.cloud.compute.v1.ISetLabelsVpnGatewayRequest): Promise; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsVpnGatewayRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TestPermissionsResponse + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, callback: google.cloud.compute.v1.VpnGateways.TestIamPermissionsCallback): void; + + /** + * Calls TestIamPermissions. + * @param request TestIamPermissionsVpnGatewayRequest message or plain object + * @returns Promise + */ + public testIamPermissions(request: google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest): Promise; + } + + namespace VpnGateways { + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#aggregatedList}. + * @param error Error, if any + * @param [response] VpnGatewayAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.VpnGatewayAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#get}. + * @param error Error, if any + * @param [response] VpnGateway + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.VpnGateway) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#getStatus}. + * @param error Error, if any + * @param [response] VpnGatewaysGetStatusResponse + */ + type GetStatusCallback = (error: (Error|null), response?: google.cloud.compute.v1.VpnGatewaysGetStatusResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#list}. + * @param error Error, if any + * @param [response] VpnGatewayList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.VpnGatewayList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#setLabels}. + * @param error Error, if any + * @param [response] Operation + */ + type SetLabelsCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#testIamPermissions}. + * @param error Error, if any + * @param [response] TestPermissionsResponse + */ + type TestIamPermissionsCallback = (error: (Error|null), response?: google.cloud.compute.v1.TestPermissionsResponse) => void; + } + + /** Represents a VpnTunnels */ + class VpnTunnels extends $protobuf.rpc.Service { + + /** + * Constructs a new VpnTunnels 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 VpnTunnels 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): VpnTunnels; + + /** + * Calls AggregatedList. + * @param request AggregatedListVpnTunnelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnTunnelAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest, callback: google.cloud.compute.v1.VpnTunnels.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListVpnTunnelsRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest): Promise; + + /** + * Calls Delete. + * @param request DeleteVpnTunnelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public delete(request: google.cloud.compute.v1.IDeleteVpnTunnelRequest, callback: google.cloud.compute.v1.VpnTunnels.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteVpnTunnelRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteVpnTunnelRequest): Promise; + + /** + * Calls Get. + * @param request GetVpnTunnelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnTunnel + */ + public get(request: google.cloud.compute.v1.IGetVpnTunnelRequest, callback: google.cloud.compute.v1.VpnTunnels.GetCallback): void; + + /** + * Calls Get. + * @param request GetVpnTunnelRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetVpnTunnelRequest): Promise; + + /** + * Calls Insert. + * @param request InsertVpnTunnelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public insert(request: google.cloud.compute.v1.IInsertVpnTunnelRequest, callback: google.cloud.compute.v1.VpnTunnels.InsertCallback): void; + + /** + * Calls Insert. + * @param request InsertVpnTunnelRequest message or plain object + * @returns Promise + */ + public insert(request: google.cloud.compute.v1.IInsertVpnTunnelRequest): Promise; + + /** + * Calls List. + * @param request ListVpnTunnelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VpnTunnelList + */ + public list(request: google.cloud.compute.v1.IListVpnTunnelsRequest, callback: google.cloud.compute.v1.VpnTunnels.ListCallback): void; + + /** + * Calls List. + * @param request ListVpnTunnelsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListVpnTunnelsRequest): Promise; + } + + namespace VpnTunnels { + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#aggregatedList}. + * @param error Error, if any + * @param [response] VpnTunnelAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.VpnTunnelAggregatedList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#delete_}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#get}. + * @param error Error, if any + * @param [response] VpnTunnel + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.VpnTunnel) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#insert}. + * @param error Error, if any + * @param [response] Operation + */ + type InsertCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#list}. + * @param error Error, if any + * @param [response] VpnTunnelList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.VpnTunnelList) => void; + } + + /** Represents a ZoneOperations */ + class ZoneOperations extends $protobuf.rpc.Service { + + /** + * Constructs a new ZoneOperations 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 ZoneOperations 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): ZoneOperations; + + /** + * Calls Delete. + * @param request DeleteZoneOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DeleteZoneOperationResponse + */ + public delete(request: google.cloud.compute.v1.IDeleteZoneOperationRequest, callback: google.cloud.compute.v1.ZoneOperations.DeleteCallback): void; + + /** + * Calls Delete. + * @param request DeleteZoneOperationRequest message or plain object + * @returns Promise + */ + public delete(request: google.cloud.compute.v1.IDeleteZoneOperationRequest): Promise; + + /** + * Calls Get. + * @param request GetZoneOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public get(request: google.cloud.compute.v1.IGetZoneOperationRequest, callback: google.cloud.compute.v1.ZoneOperations.GetCallback): void; + + /** + * Calls Get. + * @param request GetZoneOperationRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetZoneOperationRequest): Promise; + + /** + * Calls List. + * @param request ListZoneOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and OperationList + */ + public list(request: google.cloud.compute.v1.IListZoneOperationsRequest, callback: google.cloud.compute.v1.ZoneOperations.ListCallback): void; + + /** + * Calls List. + * @param request ListZoneOperationsRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListZoneOperationsRequest): Promise; + + /** + * Calls Wait. + * @param request WaitZoneOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public wait(request: google.cloud.compute.v1.IWaitZoneOperationRequest, callback: google.cloud.compute.v1.ZoneOperations.WaitCallback): void; + + /** + * Calls Wait. + * @param request WaitZoneOperationRequest message or plain object + * @returns Promise + */ + public wait(request: google.cloud.compute.v1.IWaitZoneOperationRequest): Promise; + } + + namespace ZoneOperations { + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#delete_}. + * @param error Error, if any + * @param [response] DeleteZoneOperationResponse + */ + type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.DeleteZoneOperationResponse) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#get}. + * @param error Error, if any + * @param [response] Operation + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#list}. + * @param error Error, if any + * @param [response] OperationList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.OperationList) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#wait}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + } + + /** Represents a Zones */ + class Zones extends $protobuf.rpc.Service { + + /** + * Constructs a new Zones 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 Zones 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): Zones; + + /** + * Calls Get. + * @param request GetZoneRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Zone + */ + public get(request: google.cloud.compute.v1.IGetZoneRequest, callback: google.cloud.compute.v1.Zones.GetCallback): void; + + /** + * Calls Get. + * @param request GetZoneRequest message or plain object + * @returns Promise + */ + public get(request: google.cloud.compute.v1.IGetZoneRequest): Promise; + + /** + * Calls List. + * @param request ListZonesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ZoneList + */ + public list(request: google.cloud.compute.v1.IListZonesRequest, callback: google.cloud.compute.v1.Zones.ListCallback): void; + + /** + * Calls List. + * @param request ListZonesRequest message or plain object + * @returns Promise + */ + public list(request: google.cloud.compute.v1.IListZonesRequest): Promise; + } + + namespace Zones { + + /** + * Callback as used by {@link google.cloud.compute.v1.Zones#get}. + * @param error Error, if any + * @param [response] Zone + */ + type GetCallback = (error: (Error|null), response?: google.cloud.compute.v1.Zone) => void; + + /** + * Callback as used by {@link google.cloud.compute.v1.Zones#list}. + * @param error Error, if any + * @param [response] ZoneList + */ + type ListCallback = (error: (Error|null), response?: google.cloud.compute.v1.ZoneList) => 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6 + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 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 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 }; + } + + 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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); + } + + /** 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; + + /** + * 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 }; + } + } + } +} diff --git a/protos/protos.js b/protos/protos.js new file mode 100644 index 00000000..44bde96a --- /dev/null +++ b/protos/protos.js @@ -0,0 +1,410096 @@ +// 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. + +/*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").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_compute_protos || ($protobuf.roots._google_cloud_compute_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.compute = (function() { + + /** + * Namespace compute. + * @memberof google.cloud + * @namespace + */ + var compute = {}; + + compute.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.compute + * @namespace + */ + var v1 = {}; + + v1.AcceleratorConfig = (function() { + + /** + * Properties of an AcceleratorConfig. + * @memberof google.cloud.compute.v1 + * @interface IAcceleratorConfig + * @property {number|null} [acceleratorCount] AcceleratorConfig acceleratorCount + * @property {string|null} [acceleratorType] AcceleratorConfig acceleratorType + */ + + /** + * Constructs a new AcceleratorConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AcceleratorConfig. + * @implements IAcceleratorConfig + * @constructor + * @param {google.cloud.compute.v1.IAcceleratorConfig=} [properties] Properties to set + */ + function AcceleratorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcceleratorConfig acceleratorCount. + * @member {number|null|undefined} acceleratorCount + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorCount = null; + + /** + * AcceleratorConfig acceleratorType. + * @member {string|null|undefined} acceleratorType + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AcceleratorConfig _acceleratorCount. + * @member {"acceleratorCount"|undefined} _acceleratorCount + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorCount", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorConfig _acceleratorType. + * @member {"acceleratorType"|undefined} _acceleratorType + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorType", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {google.cloud.compute.v1.IAcceleratorConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AcceleratorConfig} AcceleratorConfig instance + */ + AcceleratorConfig.create = function create(properties) { + return new AcceleratorConfig(properties); + }; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {google.cloud.compute.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 138031246, wireType 2 =*/1104249970).string(message.acceleratorType); + if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) + writer.uint32(/* id 504879675, wireType 0 =*/4039037400).int32(message.acceleratorCount); + return writer; + }; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {google.cloud.compute.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AcceleratorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 504879675: + message.acceleratorCount = reader.int32(); + break; + case 138031246: + message.acceleratorType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorConfig message. + * @function verify + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + properties._acceleratorCount = 1; + if (!$util.isInteger(message.acceleratorCount)) + return "acceleratorCount: integer expected"; + } + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + properties._acceleratorType = 1; + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + } + return null; + }; + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AcceleratorConfig} AcceleratorConfig + */ + AcceleratorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AcceleratorConfig) + return object; + var message = new $root.google.cloud.compute.v1.AcceleratorConfig(); + if (object.acceleratorCount != null) + message.acceleratorCount = object.acceleratorCount | 0; + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + return message; + }; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @static + * @param {google.cloud.compute.v1.AcceleratorConfig} message AcceleratorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + object.acceleratorType = message.acceleratorType; + if (options.oneofs) + object._acceleratorType = "acceleratorType"; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + object.acceleratorCount = message.acceleratorCount; + if (options.oneofs) + object._acceleratorCount = "acceleratorCount"; + } + return object; + }; + + /** + * Converts this AcceleratorConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AcceleratorConfig + * @instance + * @returns {Object.} JSON object + */ + AcceleratorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AcceleratorConfig; + })(); + + v1.DeprecationStatus = (function() { + + /** + * Properties of a DeprecationStatus. + * @memberof google.cloud.compute.v1 + * @interface IDeprecationStatus + * @property {string|null} [deleted] DeprecationStatus deleted + * @property {string|null} [deprecated] DeprecationStatus deprecated + * @property {string|null} [obsolete] DeprecationStatus obsolete + * @property {string|null} [replacement] DeprecationStatus replacement + * @property {google.cloud.compute.v1.DeprecationStatus.State|null} [state] DeprecationStatus state + */ + + /** + * Constructs a new DeprecationStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeprecationStatus. + * @implements IDeprecationStatus + * @constructor + * @param {google.cloud.compute.v1.IDeprecationStatus=} [properties] Properties to set + */ + function DeprecationStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeprecationStatus deleted. + * @member {string|null|undefined} deleted + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + DeprecationStatus.prototype.deleted = null; + + /** + * DeprecationStatus deprecated. + * @member {string|null|undefined} deprecated + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + DeprecationStatus.prototype.deprecated = null; + + /** + * DeprecationStatus obsolete. + * @member {string|null|undefined} obsolete + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + DeprecationStatus.prototype.obsolete = null; + + /** + * DeprecationStatus replacement. + * @member {string|null|undefined} replacement + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + DeprecationStatus.prototype.replacement = null; + + /** + * DeprecationStatus state. + * @member {google.cloud.compute.v1.DeprecationStatus.State|null|undefined} state + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + DeprecationStatus.prototype.state = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeprecationStatus _deleted. + * @member {"deleted"|undefined} _deleted + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + Object.defineProperty(DeprecationStatus.prototype, "_deleted", { + get: $util.oneOfGetter($oneOfFields = ["deleted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeprecationStatus _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + Object.defineProperty(DeprecationStatus.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeprecationStatus _obsolete. + * @member {"obsolete"|undefined} _obsolete + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + Object.defineProperty(DeprecationStatus.prototype, "_obsolete", { + get: $util.oneOfGetter($oneOfFields = ["obsolete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeprecationStatus _replacement. + * @member {"replacement"|undefined} _replacement + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + Object.defineProperty(DeprecationStatus.prototype, "_replacement", { + get: $util.oneOfGetter($oneOfFields = ["replacement"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DeprecationStatus _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + */ + Object.defineProperty(DeprecationStatus.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeprecationStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {google.cloud.compute.v1.IDeprecationStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeprecationStatus} DeprecationStatus instance + */ + DeprecationStatus.create = function create(properties) { + return new DeprecationStatus(properties); + }; + + /** + * Encodes the specified DeprecationStatus message. Does not implicitly {@link google.cloud.compute.v1.DeprecationStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {google.cloud.compute.v1.IDeprecationStatus} message DeprecationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecationStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.obsolete != null && Object.hasOwnProperty.call(message, "obsolete")) + writer.uint32(/* id 357647769, wireType 2 =*/2861182154).string(message.obsolete); + if (message.replacement != null && Object.hasOwnProperty.call(message, "replacement")) + writer.uint32(/* id 430919186, wireType 2 =*/3447353490).string(message.replacement); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 476721177, wireType 2 =*/3813769418).string(message.deleted); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 515138995, wireType 2 =*/4121111962).string(message.deprecated); + return writer; + }; + + /** + * Encodes the specified DeprecationStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeprecationStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {google.cloud.compute.v1.IDeprecationStatus} message DeprecationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecationStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeprecationStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeprecationStatus} DeprecationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecationStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeprecationStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 476721177: + message.deleted = reader.string(); + break; + case 515138995: + message.deprecated = reader.string(); + break; + case 357647769: + message.obsolete = reader.string(); + break; + case 430919186: + message.replacement = reader.string(); + break; + case 109757585: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeprecationStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeprecationStatus} DeprecationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecationStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeprecationStatus message. + * @function verify + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeprecationStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deleted != null && message.hasOwnProperty("deleted")) { + properties._deleted = 1; + if (!$util.isString(message.deleted)) + return "deleted: string expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + if (!$util.isString(message.deprecated)) + return "deprecated: string expected"; + } + if (message.obsolete != null && message.hasOwnProperty("obsolete")) { + properties._obsolete = 1; + if (!$util.isString(message.obsolete)) + return "obsolete: string expected"; + } + if (message.replacement != null && message.hasOwnProperty("replacement")) { + properties._replacement = 1; + if (!$util.isString(message.replacement)) + return "replacement: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 314733318: + case 120962041: + case 463360435: + case 66532761: + break; + } + } + return null; + }; + + /** + * Creates a DeprecationStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeprecationStatus} DeprecationStatus + */ + DeprecationStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeprecationStatus) + return object; + var message = new $root.google.cloud.compute.v1.DeprecationStatus(); + if (object.deleted != null) + message.deleted = String(object.deleted); + if (object.deprecated != null) + message.deprecated = String(object.deprecated); + if (object.obsolete != null) + message.obsolete = String(object.obsolete); + if (object.replacement != null) + message.replacement = String(object.replacement); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 314733318: + message.state = 314733318; + break; + case "DELETED": + case 120962041: + message.state = 120962041; + break; + case "DEPRECATED": + case 463360435: + message.state = 463360435; + break; + case "OBSOLETE": + case 66532761: + message.state = 66532761; + break; + } + return message; + }; + + /** + * Creates a plain object from a DeprecationStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeprecationStatus + * @static + * @param {google.cloud.compute.v1.DeprecationStatus} message DeprecationStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeprecationStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.DeprecationStatus.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.obsolete != null && message.hasOwnProperty("obsolete")) { + object.obsolete = message.obsolete; + if (options.oneofs) + object._obsolete = "obsolete"; + } + if (message.replacement != null && message.hasOwnProperty("replacement")) { + object.replacement = message.replacement; + if (options.oneofs) + object._replacement = "replacement"; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) { + object.deleted = message.deleted; + if (options.oneofs) + object._deleted = "deleted"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = message.deprecated; + if (options.oneofs) + object._deprecated = "deprecated"; + } + return object; + }; + + /** + * Converts this DeprecationStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeprecationStatus + * @instance + * @returns {Object.} JSON object + */ + DeprecationStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.compute.v1.DeprecationStatus.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} DELETED=120962041 DELETED value + * @property {number} DEPRECATED=463360435 DEPRECATED value + * @property {number} OBSOLETE=66532761 OBSOLETE value + */ + DeprecationStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[120962041] = "DELETED"] = 120962041; + values[valuesById[463360435] = "DEPRECATED"] = 463360435; + values[valuesById[66532761] = "OBSOLETE"] = 66532761; + return values; + })(); + + return DeprecationStatus; + })(); + + v1.AcceleratorType = (function() { + + /** + * Properties of an AcceleratorType. + * @memberof google.cloud.compute.v1 + * @interface IAcceleratorType + * @property {string|null} [creationTimestamp] AcceleratorType creationTimestamp + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecated] AcceleratorType deprecated + * @property {string|null} [description] AcceleratorType description + * @property {number|Long|null} [id] AcceleratorType id + * @property {string|null} [kind] AcceleratorType kind + * @property {number|null} [maximumCardsPerInstance] AcceleratorType maximumCardsPerInstance + * @property {string|null} [name] AcceleratorType name + * @property {string|null} [selfLink] AcceleratorType selfLink + * @property {string|null} [zone] AcceleratorType zone + */ + + /** + * Constructs a new AcceleratorType. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AcceleratorType. + * @implements IAcceleratorType + * @constructor + * @param {google.cloud.compute.v1.IAcceleratorType=} [properties] Properties to set + */ + function AcceleratorType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcceleratorType creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.creationTimestamp = null; + + /** + * AcceleratorType deprecated. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecated + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.deprecated = null; + + /** + * AcceleratorType description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.description = null; + + /** + * AcceleratorType id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.id = null; + + /** + * AcceleratorType kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.kind = null; + + /** + * AcceleratorType maximumCardsPerInstance. + * @member {number|null|undefined} maximumCardsPerInstance + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.maximumCardsPerInstance = null; + + /** + * AcceleratorType name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.name = null; + + /** + * AcceleratorType selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.selfLink = null; + + /** + * AcceleratorType zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + AcceleratorType.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AcceleratorType _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _maximumCardsPerInstance. + * @member {"maximumCardsPerInstance"|undefined} _maximumCardsPerInstance + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_maximumCardsPerInstance", { + get: $util.oneOfGetter($oneOfFields = ["maximumCardsPerInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorType _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + */ + Object.defineProperty(AcceleratorType.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorType instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {google.cloud.compute.v1.IAcceleratorType=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AcceleratorType} AcceleratorType instance + */ + AcceleratorType.create = function create(properties) { + return new AcceleratorType(properties); + }; + + /** + * Encodes the specified AcceleratorType message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorType.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {google.cloud.compute.v1.IAcceleratorType} message AcceleratorType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.maximumCardsPerInstance != null && Object.hasOwnProperty.call(message, "maximumCardsPerInstance")) + writer.uint32(/* id 263814482, wireType 0 =*/2110515856).int32(message.maximumCardsPerInstance); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecated, writer.uint32(/* id 515138995, wireType 2 =*/4121111962).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AcceleratorType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {google.cloud.compute.v1.IAcceleratorType} message AcceleratorType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AcceleratorType} AcceleratorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AcceleratorType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 515138995: + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 263814482: + message.maximumCardsPerInstance = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AcceleratorType} AcceleratorType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorType message. + * @function verify + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecated); + if (error) + return "deprecated." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.maximumCardsPerInstance != null && message.hasOwnProperty("maximumCardsPerInstance")) { + properties._maximumCardsPerInstance = 1; + if (!$util.isInteger(message.maximumCardsPerInstance)) + return "maximumCardsPerInstance: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates an AcceleratorType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AcceleratorType} AcceleratorType + */ + AcceleratorType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AcceleratorType) + return object; + var message = new $root.google.cloud.compute.v1.AcceleratorType(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.deprecated != null) { + if (typeof object.deprecated !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorType.deprecated: object expected"); + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecated); + } + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.maximumCardsPerInstance != null) + message.maximumCardsPerInstance = object.maximumCardsPerInstance | 0; + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AcceleratorType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AcceleratorType + * @static + * @param {google.cloud.compute.v1.AcceleratorType} message AcceleratorType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.maximumCardsPerInstance != null && message.hasOwnProperty("maximumCardsPerInstance")) { + object.maximumCardsPerInstance = message.maximumCardsPerInstance; + if (options.oneofs) + object._maximumCardsPerInstance = "maximumCardsPerInstance"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecated, options); + if (options.oneofs) + object._deprecated = "deprecated"; + } + return object; + }; + + /** + * Converts this AcceleratorType to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AcceleratorType + * @instance + * @returns {Object.} JSON object + */ + AcceleratorType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AcceleratorType; + })(); + + v1.AcceleratorTypesScopedList = (function() { + + /** + * Properties of an AcceleratorTypesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IAcceleratorTypesScopedList + * @property {Array.|null} [acceleratorTypes] AcceleratorTypesScopedList acceleratorTypes + * @property {google.cloud.compute.v1.IWarning|null} [warning] AcceleratorTypesScopedList warning + */ + + /** + * Constructs a new AcceleratorTypesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AcceleratorTypesScopedList. + * @implements IAcceleratorTypesScopedList + * @constructor + * @param {google.cloud.compute.v1.IAcceleratorTypesScopedList=} [properties] Properties to set + */ + function AcceleratorTypesScopedList(properties) { + this.acceleratorTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcceleratorTypesScopedList acceleratorTypes. + * @member {Array.} acceleratorTypes + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @instance + */ + AcceleratorTypesScopedList.prototype.acceleratorTypes = $util.emptyArray; + + /** + * AcceleratorTypesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @instance + */ + AcceleratorTypesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AcceleratorTypesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @instance + */ + Object.defineProperty(AcceleratorTypesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorTypesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AcceleratorTypesScopedList} AcceleratorTypesScopedList instance + */ + AcceleratorTypesScopedList.create = function create(properties) { + return new AcceleratorTypesScopedList(properties); + }; + + /** + * Encodes the specified AcceleratorTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypesScopedList} message AcceleratorTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorTypesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.acceleratorTypes != null && message.acceleratorTypes.length) + for (var i = 0; i < message.acceleratorTypes.length; ++i) + $root.google.cloud.compute.v1.AcceleratorType.encode(message.acceleratorTypes[i], writer.uint32(/* id 520872357, wireType 2 =*/4166978858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AcceleratorTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypesScopedList} message AcceleratorTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorTypesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorTypesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AcceleratorTypesScopedList} AcceleratorTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorTypesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AcceleratorTypesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 520872357: + if (!(message.acceleratorTypes && message.acceleratorTypes.length)) + message.acceleratorTypes = []; + message.acceleratorTypes.push($root.google.cloud.compute.v1.AcceleratorType.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorTypesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AcceleratorTypesScopedList} AcceleratorTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorTypesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorTypesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorTypesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.acceleratorTypes != null && message.hasOwnProperty("acceleratorTypes")) { + if (!Array.isArray(message.acceleratorTypes)) + return "acceleratorTypes: array expected"; + for (var i = 0; i < message.acceleratorTypes.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorType.verify(message.acceleratorTypes[i]); + if (error) + return "acceleratorTypes." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AcceleratorTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AcceleratorTypesScopedList} AcceleratorTypesScopedList + */ + AcceleratorTypesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AcceleratorTypesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.AcceleratorTypesScopedList(); + if (object.acceleratorTypes) { + if (!Array.isArray(object.acceleratorTypes)) + throw TypeError(".google.cloud.compute.v1.AcceleratorTypesScopedList.acceleratorTypes: array expected"); + message.acceleratorTypes = []; + for (var i = 0; i < object.acceleratorTypes.length; ++i) { + if (typeof object.acceleratorTypes[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorTypesScopedList.acceleratorTypes: object expected"); + message.acceleratorTypes[i] = $root.google.cloud.compute.v1.AcceleratorType.fromObject(object.acceleratorTypes[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorTypesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AcceleratorTypesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @static + * @param {google.cloud.compute.v1.AcceleratorTypesScopedList} message AcceleratorTypesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorTypesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.acceleratorTypes = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.acceleratorTypes && message.acceleratorTypes.length) { + object.acceleratorTypes = []; + for (var j = 0; j < message.acceleratorTypes.length; ++j) + object.acceleratorTypes[j] = $root.google.cloud.compute.v1.AcceleratorType.toObject(message.acceleratorTypes[j], options); + } + return object; + }; + + /** + * Converts this AcceleratorTypesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AcceleratorTypesScopedList + * @instance + * @returns {Object.} JSON object + */ + AcceleratorTypesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AcceleratorTypesScopedList; + })(); + + v1.Data = (function() { + + /** + * Properties of a Data. + * @memberof google.cloud.compute.v1 + * @interface IData + * @property {string|null} [key] Data key + * @property {string|null} [value] Data value + */ + + /** + * Constructs a new Data. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Data. + * @implements IData + * @constructor + * @param {google.cloud.compute.v1.IData=} [properties] Properties to set + */ + function Data(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Data key. + * @member {string|null|undefined} key + * @memberof google.cloud.compute.v1.Data + * @instance + */ + Data.prototype.key = null; + + /** + * Data value. + * @member {string|null|undefined} value + * @memberof google.cloud.compute.v1.Data + * @instance + */ + Data.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Data _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.compute.v1.Data + * @instance + */ + Object.defineProperty(Data.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Data _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.compute.v1.Data + * @instance + */ + Object.defineProperty(Data.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Data instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Data + * @static + * @param {google.cloud.compute.v1.IData=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Data} Data instance + */ + Data.create = function create(properties) { + return new Data(properties); + }; + + /** + * Encodes the specified Data message. Does not implicitly {@link google.cloud.compute.v1.Data.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Data + * @static + * @param {google.cloud.compute.v1.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 106079, wireType 2 =*/848634).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 111972721, wireType 2 =*/895781770).string(message.value); + return writer; + }; + + /** + * Encodes the specified Data message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Data.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Data + * @static + * @param {google.cloud.compute.v1.IData} message Data message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Data.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Data message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Data(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 106079: + message.key = reader.string(); + break; + case 111972721: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Data message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Data + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Data} Data + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Data.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Data message. + * @function verify + * @memberof google.cloud.compute.v1.Data + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Data.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a Data message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Data + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Data} Data + */ + Data.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Data) + return object; + var message = new $root.google.cloud.compute.v1.Data(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a Data message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Data + * @static + * @param {google.cloud.compute.v1.Data} message Data + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Data.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this Data to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Data + * @instance + * @returns {Object.} JSON object + */ + Data.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Data; + })(); + + v1.Warning = (function() { + + /** + * Properties of a Warning. + * @memberof google.cloud.compute.v1 + * @interface IWarning + * @property {google.cloud.compute.v1.Warning.Code|null} [code] Warning code + * @property {Array.|null} [data] Warning data + * @property {string|null} [message] Warning message + */ + + /** + * Constructs a new Warning. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Warning. + * @implements IWarning + * @constructor + * @param {google.cloud.compute.v1.IWarning=} [properties] Properties to set + */ + function Warning(properties) { + this.data = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Warning code. + * @member {google.cloud.compute.v1.Warning.Code|null|undefined} code + * @memberof google.cloud.compute.v1.Warning + * @instance + */ + Warning.prototype.code = null; + + /** + * Warning data. + * @member {Array.} data + * @memberof google.cloud.compute.v1.Warning + * @instance + */ + Warning.prototype.data = $util.emptyArray; + + /** + * Warning message. + * @member {string|null|undefined} message + * @memberof google.cloud.compute.v1.Warning + * @instance + */ + Warning.prototype.message = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Warning _code. + * @member {"code"|undefined} _code + * @memberof google.cloud.compute.v1.Warning + * @instance + */ + Object.defineProperty(Warning.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Warning _message. + * @member {"message"|undefined} _message + * @memberof google.cloud.compute.v1.Warning + * @instance + */ + Object.defineProperty(Warning.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Warning instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {google.cloud.compute.v1.IWarning=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Warning} Warning instance + */ + Warning.create = function create(properties) { + return new Warning(properties); + }; + + /** + * Encodes the specified Warning message. Does not implicitly {@link google.cloud.compute.v1.Warning.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {google.cloud.compute.v1.IWarning} message Warning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 3059181, wireType 0 =*/24473448).int32(message.code); + if (message.data != null && message.data.length) + for (var i = 0; i < message.data.length; ++i) + $root.google.cloud.compute.v1.Data.encode(message.data[i], writer.uint32(/* id 3076010, wireType 2 =*/24608082).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 418054151, wireType 2 =*/3344433210).string(message.message); + return writer; + }; + + /** + * Encodes the specified Warning message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Warning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {google.cloud.compute.v1.IWarning} message Warning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Warning message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Warning} Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Warning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3059181: + message.code = reader.int32(); + break; + case 3076010: + if (!(message.data && message.data.length)) + message.data = []; + message.data.push($root.google.cloud.compute.v1.Data.decode(reader, reader.uint32())); + break; + case 418054151: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Warning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Warning} Warning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Warning message. + * @function verify + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Warning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.code != null && message.hasOwnProperty("code")) { + properties._code = 1; + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 150308440: + case 391835586: + case 346526230: + case 369442967: + case 451954443: + case 175546307: + case 329669423: + case 417377419: + case 481440678: + case 344505463: + case 324964999: + case 383382887: + case 464250446: + case 243758146: + case 417081265: + case 105763924: + case 30036744: + case 39966469: + case 3745539: + case 496728641: + case 168598460: + case 275245642: + case 268305617: + case 390513439: + case 13328052: + break; + } + } + if (message.data != null && message.hasOwnProperty("data")) { + if (!Array.isArray(message.data)) + return "data: array expected"; + for (var i = 0; i < message.data.length; ++i) { + var error = $root.google.cloud.compute.v1.Data.verify(message.data[i]); + if (error) + return "data." + error; + } + } + if (message.message != null && message.hasOwnProperty("message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + return null; + }; + + /** + * Creates a Warning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Warning} Warning + */ + Warning.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Warning) + return object; + var message = new $root.google.cloud.compute.v1.Warning(); + switch (object.code) { + case "UNDEFINED_CODE": + case 0: + message.code = 0; + break; + case "CLEANUP_FAILED": + case 150308440: + message.code = 150308440; + break; + case "DEPRECATED_RESOURCE_USED": + case 391835586: + message.code = 391835586; + break; + case "DEPRECATED_TYPE_USED": + case 346526230: + message.code = 346526230; + break; + case "DISK_SIZE_LARGER_THAN_IMAGE_SIZE": + case 369442967: + message.code = 369442967; + break; + case "EXPERIMENTAL_TYPE_USED": + case 451954443: + message.code = 451954443; + break; + case "EXTERNAL_API_WARNING": + case 175546307: + message.code = 175546307; + break; + case "FIELD_VALUE_OVERRIDEN": + case 329669423: + message.code = 329669423; + break; + case "INJECTED_KERNELS_DEPRECATED": + case 417377419: + message.code = 417377419; + break; + case "LARGE_DEPLOYMENT_WARNING": + case 481440678: + message.code = 481440678; + break; + case "MISSING_TYPE_DEPENDENCY": + case 344505463: + message.code = 344505463; + break; + case "NEXT_HOP_ADDRESS_NOT_ASSIGNED": + case 324964999: + message.code = 324964999; + break; + case "NEXT_HOP_CANNOT_IP_FORWARD": + case 383382887: + message.code = 383382887; + break; + case "NEXT_HOP_INSTANCE_NOT_FOUND": + case 464250446: + message.code = 464250446; + break; + case "NEXT_HOP_INSTANCE_NOT_ON_NETWORK": + case 243758146: + message.code = 243758146; + break; + case "NEXT_HOP_NOT_RUNNING": + case 417081265: + message.code = 417081265; + break; + case "NOT_CRITICAL_ERROR": + case 105763924: + message.code = 105763924; + break; + case "NO_RESULTS_ON_PAGE": + case 30036744: + message.code = 30036744; + break; + case "PARTIAL_SUCCESS": + case 39966469: + message.code = 39966469; + break; + case "REQUIRED_TOS_AGREEMENT": + case 3745539: + message.code = 3745539; + break; + case "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING": + case 496728641: + message.code = 496728641; + break; + case "RESOURCE_NOT_DELETED": + case 168598460: + message.code = 168598460; + break; + case "SCHEMA_VALIDATION_IGNORED": + case 275245642: + message.code = 275245642; + break; + case "SINGLE_INSTANCE_PROPERTY_TEMPLATE": + case 268305617: + message.code = 268305617; + break; + case "UNDECLARED_PROPERTIES": + case 390513439: + message.code = 390513439; + break; + case "UNREACHABLE": + case 13328052: + message.code = 13328052; + break; + } + if (object.data) { + if (!Array.isArray(object.data)) + throw TypeError(".google.cloud.compute.v1.Warning.data: array expected"); + message.data = []; + for (var i = 0; i < object.data.length; ++i) { + if (typeof object.data[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Warning.data: object expected"); + message.data[i] = $root.google.cloud.compute.v1.Data.fromObject(object.data[i]); + } + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a Warning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Warning + * @static + * @param {google.cloud.compute.v1.Warning} message Warning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Warning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.data = []; + if (message.code != null && message.hasOwnProperty("code")) { + object.code = options.enums === String ? $root.google.cloud.compute.v1.Warning.Code[message.code] : message.code; + if (options.oneofs) + object._code = "code"; + } + if (message.data && message.data.length) { + object.data = []; + for (var j = 0; j < message.data.length; ++j) + object.data[j] = $root.google.cloud.compute.v1.Data.toObject(message.data[j], options); + } + if (message.message != null && message.hasOwnProperty("message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; + + /** + * Converts this Warning to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Warning + * @instance + * @returns {Object.} JSON object + */ + Warning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Code enum. + * @name google.cloud.compute.v1.Warning.Code + * @enum {number} + * @property {number} UNDEFINED_CODE=0 UNDEFINED_CODE value + * @property {number} CLEANUP_FAILED=150308440 CLEANUP_FAILED value + * @property {number} DEPRECATED_RESOURCE_USED=391835586 DEPRECATED_RESOURCE_USED value + * @property {number} DEPRECATED_TYPE_USED=346526230 DEPRECATED_TYPE_USED value + * @property {number} DISK_SIZE_LARGER_THAN_IMAGE_SIZE=369442967 DISK_SIZE_LARGER_THAN_IMAGE_SIZE value + * @property {number} EXPERIMENTAL_TYPE_USED=451954443 EXPERIMENTAL_TYPE_USED value + * @property {number} EXTERNAL_API_WARNING=175546307 EXTERNAL_API_WARNING value + * @property {number} FIELD_VALUE_OVERRIDEN=329669423 FIELD_VALUE_OVERRIDEN value + * @property {number} INJECTED_KERNELS_DEPRECATED=417377419 INJECTED_KERNELS_DEPRECATED value + * @property {number} LARGE_DEPLOYMENT_WARNING=481440678 LARGE_DEPLOYMENT_WARNING value + * @property {number} MISSING_TYPE_DEPENDENCY=344505463 MISSING_TYPE_DEPENDENCY value + * @property {number} NEXT_HOP_ADDRESS_NOT_ASSIGNED=324964999 NEXT_HOP_ADDRESS_NOT_ASSIGNED value + * @property {number} NEXT_HOP_CANNOT_IP_FORWARD=383382887 NEXT_HOP_CANNOT_IP_FORWARD value + * @property {number} NEXT_HOP_INSTANCE_NOT_FOUND=464250446 NEXT_HOP_INSTANCE_NOT_FOUND value + * @property {number} NEXT_HOP_INSTANCE_NOT_ON_NETWORK=243758146 NEXT_HOP_INSTANCE_NOT_ON_NETWORK value + * @property {number} NEXT_HOP_NOT_RUNNING=417081265 NEXT_HOP_NOT_RUNNING value + * @property {number} NOT_CRITICAL_ERROR=105763924 NOT_CRITICAL_ERROR value + * @property {number} NO_RESULTS_ON_PAGE=30036744 NO_RESULTS_ON_PAGE value + * @property {number} PARTIAL_SUCCESS=39966469 PARTIAL_SUCCESS value + * @property {number} REQUIRED_TOS_AGREEMENT=3745539 REQUIRED_TOS_AGREEMENT value + * @property {number} RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING=496728641 RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING value + * @property {number} RESOURCE_NOT_DELETED=168598460 RESOURCE_NOT_DELETED value + * @property {number} SCHEMA_VALIDATION_IGNORED=275245642 SCHEMA_VALIDATION_IGNORED value + * @property {number} SINGLE_INSTANCE_PROPERTY_TEMPLATE=268305617 SINGLE_INSTANCE_PROPERTY_TEMPLATE value + * @property {number} UNDECLARED_PROPERTIES=390513439 UNDECLARED_PROPERTIES value + * @property {number} UNREACHABLE=13328052 UNREACHABLE value + */ + Warning.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CODE"] = 0; + values[valuesById[150308440] = "CLEANUP_FAILED"] = 150308440; + values[valuesById[391835586] = "DEPRECATED_RESOURCE_USED"] = 391835586; + values[valuesById[346526230] = "DEPRECATED_TYPE_USED"] = 346526230; + values[valuesById[369442967] = "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"] = 369442967; + values[valuesById[451954443] = "EXPERIMENTAL_TYPE_USED"] = 451954443; + values[valuesById[175546307] = "EXTERNAL_API_WARNING"] = 175546307; + values[valuesById[329669423] = "FIELD_VALUE_OVERRIDEN"] = 329669423; + values[valuesById[417377419] = "INJECTED_KERNELS_DEPRECATED"] = 417377419; + values[valuesById[481440678] = "LARGE_DEPLOYMENT_WARNING"] = 481440678; + values[valuesById[344505463] = "MISSING_TYPE_DEPENDENCY"] = 344505463; + values[valuesById[324964999] = "NEXT_HOP_ADDRESS_NOT_ASSIGNED"] = 324964999; + values[valuesById[383382887] = "NEXT_HOP_CANNOT_IP_FORWARD"] = 383382887; + values[valuesById[464250446] = "NEXT_HOP_INSTANCE_NOT_FOUND"] = 464250446; + values[valuesById[243758146] = "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"] = 243758146; + values[valuesById[417081265] = "NEXT_HOP_NOT_RUNNING"] = 417081265; + values[valuesById[105763924] = "NOT_CRITICAL_ERROR"] = 105763924; + values[valuesById[30036744] = "NO_RESULTS_ON_PAGE"] = 30036744; + values[valuesById[39966469] = "PARTIAL_SUCCESS"] = 39966469; + values[valuesById[3745539] = "REQUIRED_TOS_AGREEMENT"] = 3745539; + values[valuesById[496728641] = "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"] = 496728641; + values[valuesById[168598460] = "RESOURCE_NOT_DELETED"] = 168598460; + values[valuesById[275245642] = "SCHEMA_VALIDATION_IGNORED"] = 275245642; + values[valuesById[268305617] = "SINGLE_INSTANCE_PROPERTY_TEMPLATE"] = 268305617; + values[valuesById[390513439] = "UNDECLARED_PROPERTIES"] = 390513439; + values[valuesById[13328052] = "UNREACHABLE"] = 13328052; + return values; + })(); + + return Warning; + })(); + + v1.AcceleratorTypeAggregatedList = (function() { + + /** + * Properties of an AcceleratorTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IAcceleratorTypeAggregatedList + * @property {string|null} [id] AcceleratorTypeAggregatedList id + * @property {Object.|null} [items] AcceleratorTypeAggregatedList items + * @property {string|null} [kind] AcceleratorTypeAggregatedList kind + * @property {string|null} [nextPageToken] AcceleratorTypeAggregatedList nextPageToken + * @property {string|null} [selfLink] AcceleratorTypeAggregatedList selfLink + * @property {Array.|null} [unreachables] AcceleratorTypeAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] AcceleratorTypeAggregatedList warning + */ + + /** + * Constructs a new AcceleratorTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AcceleratorTypeAggregatedList. + * @implements IAcceleratorTypeAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IAcceleratorTypeAggregatedList=} [properties] Properties to set + */ + function AcceleratorTypeAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcceleratorTypeAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + AcceleratorTypeAggregatedList.prototype.id = null; + + /** + * AcceleratorTypeAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + AcceleratorTypeAggregatedList.prototype.items = $util.emptyObject; + + /** + * AcceleratorTypeAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + AcceleratorTypeAggregatedList.prototype.kind = null; + + /** + * AcceleratorTypeAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + AcceleratorTypeAggregatedList.prototype.nextPageToken = null; + + /** + * AcceleratorTypeAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + AcceleratorTypeAggregatedList.prototype.selfLink = null; + + /** + * AcceleratorTypeAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + AcceleratorTypeAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * AcceleratorTypeAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + AcceleratorTypeAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AcceleratorTypeAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + Object.defineProperty(AcceleratorTypeAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + Object.defineProperty(AcceleratorTypeAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + Object.defineProperty(AcceleratorTypeAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + Object.defineProperty(AcceleratorTypeAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + */ + Object.defineProperty(AcceleratorTypeAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorTypeAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypeAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AcceleratorTypeAggregatedList} AcceleratorTypeAggregatedList instance + */ + AcceleratorTypeAggregatedList.create = function create(properties) { + return new AcceleratorTypeAggregatedList(properties); + }; + + /** + * Encodes the specified AcceleratorTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypeAggregatedList} message AcceleratorTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorTypeAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.AcceleratorTypesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified AcceleratorTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypeAggregatedList} message AcceleratorTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorTypeAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorTypeAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AcceleratorTypeAggregatedList} AcceleratorTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorTypeAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AcceleratorTypeAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.AcceleratorTypesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorTypeAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AcceleratorTypeAggregatedList} AcceleratorTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorTypeAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorTypeAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorTypeAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorTypesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AcceleratorTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AcceleratorTypeAggregatedList} AcceleratorTypeAggregatedList + */ + AcceleratorTypeAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AcceleratorTypeAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.AcceleratorTypeAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorTypeAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorTypeAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.AcceleratorTypesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.AcceleratorTypeAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorTypeAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AcceleratorTypeAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.AcceleratorTypeAggregatedList} message AcceleratorTypeAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorTypeAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.AcceleratorTypesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this AcceleratorTypeAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AcceleratorTypeAggregatedList + * @instance + * @returns {Object.} JSON object + */ + AcceleratorTypeAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AcceleratorTypeAggregatedList; + })(); + + v1.AcceleratorTypeList = (function() { + + /** + * Properties of an AcceleratorTypeList. + * @memberof google.cloud.compute.v1 + * @interface IAcceleratorTypeList + * @property {string|null} [id] AcceleratorTypeList id + * @property {Array.|null} [items] AcceleratorTypeList items + * @property {string|null} [kind] AcceleratorTypeList kind + * @property {string|null} [nextPageToken] AcceleratorTypeList nextPageToken + * @property {string|null} [selfLink] AcceleratorTypeList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] AcceleratorTypeList warning + */ + + /** + * Constructs a new AcceleratorTypeList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AcceleratorTypeList. + * @implements IAcceleratorTypeList + * @constructor + * @param {google.cloud.compute.v1.IAcceleratorTypeList=} [properties] Properties to set + */ + function AcceleratorTypeList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcceleratorTypeList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + AcceleratorTypeList.prototype.id = null; + + /** + * AcceleratorTypeList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + AcceleratorTypeList.prototype.items = $util.emptyArray; + + /** + * AcceleratorTypeList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + AcceleratorTypeList.prototype.kind = null; + + /** + * AcceleratorTypeList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + AcceleratorTypeList.prototype.nextPageToken = null; + + /** + * AcceleratorTypeList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + AcceleratorTypeList.prototype.selfLink = null; + + /** + * AcceleratorTypeList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + AcceleratorTypeList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AcceleratorTypeList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + Object.defineProperty(AcceleratorTypeList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + Object.defineProperty(AcceleratorTypeList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + Object.defineProperty(AcceleratorTypeList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + Object.defineProperty(AcceleratorTypeList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorTypeList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + */ + Object.defineProperty(AcceleratorTypeList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorTypeList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypeList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AcceleratorTypeList} AcceleratorTypeList instance + */ + AcceleratorTypeList.create = function create(properties) { + return new AcceleratorTypeList(properties); + }; + + /** + * Encodes the specified AcceleratorTypeList message. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypeList} message AcceleratorTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorTypeList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.AcceleratorType.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified AcceleratorTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AcceleratorTypeList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {google.cloud.compute.v1.IAcceleratorTypeList} message AcceleratorTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorTypeList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorTypeList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AcceleratorTypeList} AcceleratorTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorTypeList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AcceleratorTypeList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.AcceleratorType.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorTypeList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AcceleratorTypeList} AcceleratorTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorTypeList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorTypeList message. + * @function verify + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorTypeList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorType.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AcceleratorTypeList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AcceleratorTypeList} AcceleratorTypeList + */ + AcceleratorTypeList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AcceleratorTypeList) + return object; + var message = new $root.google.cloud.compute.v1.AcceleratorTypeList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.AcceleratorTypeList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorTypeList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.AcceleratorType.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AcceleratorTypeList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AcceleratorTypeList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @static + * @param {google.cloud.compute.v1.AcceleratorTypeList} message AcceleratorTypeList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorTypeList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.AcceleratorType.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this AcceleratorTypeList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AcceleratorTypeList + * @instance + * @returns {Object.} JSON object + */ + AcceleratorTypeList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AcceleratorTypeList; + })(); + + v1.AccessConfig = (function() { + + /** + * Properties of an AccessConfig. + * @memberof google.cloud.compute.v1 + * @interface IAccessConfig + * @property {string|null} [kind] AccessConfig kind + * @property {string|null} [name] AccessConfig name + * @property {string|null} [natIP] AccessConfig natIP + * @property {google.cloud.compute.v1.AccessConfig.NetworkTier|null} [networkTier] AccessConfig networkTier + * @property {string|null} [publicPtrDomainName] AccessConfig publicPtrDomainName + * @property {boolean|null} [setPublicPtr] AccessConfig setPublicPtr + * @property {google.cloud.compute.v1.AccessConfig.Type|null} [type] AccessConfig type + */ + + /** + * Constructs a new AccessConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AccessConfig. + * @implements IAccessConfig + * @constructor + * @param {google.cloud.compute.v1.IAccessConfig=} [properties] Properties to set + */ + function AccessConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessConfig kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.kind = null; + + /** + * AccessConfig name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.name = null; + + /** + * AccessConfig natIP. + * @member {string|null|undefined} natIP + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.natIP = null; + + /** + * AccessConfig networkTier. + * @member {google.cloud.compute.v1.AccessConfig.NetworkTier|null|undefined} networkTier + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.networkTier = null; + + /** + * AccessConfig publicPtrDomainName. + * @member {string|null|undefined} publicPtrDomainName + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.publicPtrDomainName = null; + + /** + * AccessConfig setPublicPtr. + * @member {boolean|null|undefined} setPublicPtr + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.setPublicPtr = null; + + /** + * AccessConfig type. + * @member {google.cloud.compute.v1.AccessConfig.Type|null|undefined} type + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessConfig _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _natIP. + * @member {"natIP"|undefined} _natIP + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_natIP", { + get: $util.oneOfGetter($oneOfFields = ["natIP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _networkTier. + * @member {"networkTier"|undefined} _networkTier + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_networkTier", { + get: $util.oneOfGetter($oneOfFields = ["networkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _publicPtrDomainName. + * @member {"publicPtrDomainName"|undefined} _publicPtrDomainName + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_publicPtrDomainName", { + get: $util.oneOfGetter($oneOfFields = ["publicPtrDomainName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _setPublicPtr. + * @member {"setPublicPtr"|undefined} _setPublicPtr + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_setPublicPtr", { + get: $util.oneOfGetter($oneOfFields = ["setPublicPtr"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {google.cloud.compute.v1.IAccessConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AccessConfig} AccessConfig instance + */ + AccessConfig.create = function create(properties) { + return new AccessConfig(properties); + }; + + /** + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.compute.v1.AccessConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {google.cloud.compute.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.natIP != null && Object.hasOwnProperty.call(message, "natIP")) + writer.uint32(/* id 117634556, wireType 2 =*/941076450).string(message.natIP); + if (message.publicPtrDomainName != null && Object.hasOwnProperty.call(message, "publicPtrDomainName")) + writer.uint32(/* id 316599167, wireType 2 =*/2532793338).string(message.publicPtrDomainName); + if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) + writer.uint32(/* id 517397843, wireType 0 =*/4139182744).int32(message.networkTier); + if (message.setPublicPtr != null && Object.hasOwnProperty.call(message, "setPublicPtr")) + writer.uint32(/* id 523870229, wireType 0 =*/4190961832).bool(message.setPublicPtr); + return writer; + }; + + /** + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AccessConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {google.cloud.compute.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AccessConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 117634556: + message.natIP = reader.string(); + break; + case 517397843: + message.networkTier = reader.int32(); + break; + case 316599167: + message.publicPtrDomainName = reader.string(); + break; + case 523870229: + message.setPublicPtr = reader.bool(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessConfig message. + * @function verify + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.natIP != null && message.hasOwnProperty("natIP")) { + properties._natIP = 1; + if (!$util.isString(message.natIP)) + return "natIP: string expected"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + properties._networkTier = 1; + switch (message.networkTier) { + default: + return "networkTier: enum value expected"; + case 0: + case 399530551: + case 484642493: + break; + } + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + properties._publicPtrDomainName = 1; + if (!$util.isString(message.publicPtrDomainName)) + return "publicPtrDomainName: string expected"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + properties._setPublicPtr = 1; + if (typeof message.setPublicPtr !== "boolean") + return "setPublicPtr: boolean expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 84090205: + break; + } + } + return null; + }; + + /** + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AccessConfig} AccessConfig + */ + AccessConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AccessConfig) + return object; + var message = new $root.google.cloud.compute.v1.AccessConfig(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.natIP != null) + message.natIP = String(object.natIP); + switch (object.networkTier) { + case "UNDEFINED_NETWORK_TIER": + case 0: + message.networkTier = 0; + break; + case "PREMIUM": + case 399530551: + message.networkTier = 399530551; + break; + case "STANDARD": + case 484642493: + message.networkTier = 484642493; + break; + } + if (object.publicPtrDomainName != null) + message.publicPtrDomainName = String(object.publicPtrDomainName); + if (object.setPublicPtr != null) + message.setPublicPtr = Boolean(object.setPublicPtr); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "ONE_TO_ONE_NAT": + case 84090205: + message.type = 84090205; + break; + } + return message; + }; + + /** + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AccessConfig + * @static + * @param {google.cloud.compute.v1.AccessConfig} message AccessConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.AccessConfig.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.natIP != null && message.hasOwnProperty("natIP")) { + object.natIP = message.natIP; + if (options.oneofs) + object._natIP = "natIP"; + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + object.publicPtrDomainName = message.publicPtrDomainName; + if (options.oneofs) + object._publicPtrDomainName = "publicPtrDomainName"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + object.networkTier = options.enums === String ? $root.google.cloud.compute.v1.AccessConfig.NetworkTier[message.networkTier] : message.networkTier; + if (options.oneofs) + object._networkTier = "networkTier"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + object.setPublicPtr = message.setPublicPtr; + if (options.oneofs) + object._setPublicPtr = "setPublicPtr"; + } + return object; + }; + + /** + * Converts this AccessConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AccessConfig + * @instance + * @returns {Object.} JSON object + */ + AccessConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * NetworkTier enum. + * @name google.cloud.compute.v1.AccessConfig.NetworkTier + * @enum {number} + * @property {number} UNDEFINED_NETWORK_TIER=0 UNDEFINED_NETWORK_TIER value + * @property {number} PREMIUM=399530551 PREMIUM value + * @property {number} STANDARD=484642493 STANDARD value + */ + AccessConfig.NetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NETWORK_TIER"] = 0; + values[valuesById[399530551] = "PREMIUM"] = 399530551; + values[valuesById[484642493] = "STANDARD"] = 484642493; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.compute.v1.AccessConfig.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} ONE_TO_ONE_NAT=84090205 ONE_TO_ONE_NAT value + */ + AccessConfig.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[84090205] = "ONE_TO_ONE_NAT"] = 84090205; + return values; + })(); + + return AccessConfig; + })(); + + v1.Address = (function() { + + /** + * Properties of an Address. + * @memberof google.cloud.compute.v1 + * @interface IAddress + * @property {string|null} [address] Address address + * @property {google.cloud.compute.v1.Address.AddressType|null} [addressType] Address addressType + * @property {string|null} [creationTimestamp] Address creationTimestamp + * @property {string|null} [description] Address description + * @property {number|Long|null} [id] Address id + * @property {google.cloud.compute.v1.Address.IpVersion|null} [ipVersion] Address ipVersion + * @property {string|null} [kind] Address kind + * @property {string|null} [name] Address name + * @property {string|null} [network] Address network + * @property {google.cloud.compute.v1.Address.NetworkTier|null} [networkTier] Address networkTier + * @property {number|null} [prefixLength] Address prefixLength + * @property {google.cloud.compute.v1.Address.Purpose|null} [purpose] Address purpose + * @property {string|null} [region] Address region + * @property {string|null} [selfLink] Address selfLink + * @property {google.cloud.compute.v1.Address.Status|null} [status] Address status + * @property {string|null} [subnetwork] Address subnetwork + * @property {Array.|null} [users] Address users + */ + + /** + * Constructs a new Address. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Address. + * @implements IAddress + * @constructor + * @param {google.cloud.compute.v1.IAddress=} [properties] Properties to set + */ + function Address(properties) { + this.users = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Address address. + * @member {string|null|undefined} address + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.address = null; + + /** + * Address addressType. + * @member {google.cloud.compute.v1.Address.AddressType|null|undefined} addressType + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.addressType = null; + + /** + * Address creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.creationTimestamp = null; + + /** + * Address description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.description = null; + + /** + * Address id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.id = null; + + /** + * Address ipVersion. + * @member {google.cloud.compute.v1.Address.IpVersion|null|undefined} ipVersion + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.ipVersion = null; + + /** + * Address kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.kind = null; + + /** + * Address name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.name = null; + + /** + * Address network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.network = null; + + /** + * Address networkTier. + * @member {google.cloud.compute.v1.Address.NetworkTier|null|undefined} networkTier + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.networkTier = null; + + /** + * Address prefixLength. + * @member {number|null|undefined} prefixLength + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.prefixLength = null; + + /** + * Address purpose. + * @member {google.cloud.compute.v1.Address.Purpose|null|undefined} purpose + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.purpose = null; + + /** + * Address region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.region = null; + + /** + * Address selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.selfLink = null; + + /** + * Address status. + * @member {google.cloud.compute.v1.Address.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.status = null; + + /** + * Address subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.subnetwork = null; + + /** + * Address users. + * @member {Array.} users + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Address.prototype.users = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Address _address. + * @member {"address"|undefined} _address + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_address", { + get: $util.oneOfGetter($oneOfFields = ["address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _addressType. + * @member {"addressType"|undefined} _addressType + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_addressType", { + get: $util.oneOfGetter($oneOfFields = ["addressType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _ipVersion. + * @member {"ipVersion"|undefined} _ipVersion + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_ipVersion", { + get: $util.oneOfGetter($oneOfFields = ["ipVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _networkTier. + * @member {"networkTier"|undefined} _networkTier + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_networkTier", { + get: $util.oneOfGetter($oneOfFields = ["networkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _prefixLength. + * @member {"prefixLength"|undefined} _prefixLength + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_prefixLength", { + get: $util.oneOfGetter($oneOfFields = ["prefixLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _purpose. + * @member {"purpose"|undefined} _purpose + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_purpose", { + get: $util.oneOfGetter($oneOfFields = ["purpose"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Address _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.compute.v1.Address + * @instance + */ + Object.defineProperty(Address.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Address instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Address + * @static + * @param {google.cloud.compute.v1.IAddress=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Address} Address instance + */ + Address.create = function create(properties) { + return new Address(properties); + }; + + /** + * Encodes the specified Address message. Does not implicitly {@link google.cloud.compute.v1.Address.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Address + * @static + * @param {google.cloud.compute.v1.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + writer.uint32(/* id 111578632, wireType 2 =*/892629058).string(message.users[i]); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.addressType != null && Object.hasOwnProperty.call(message, "addressType")) + writer.uint32(/* id 264307877, wireType 0 =*/2114463016).int32(message.addressType); + if (message.ipVersion != null && Object.hasOwnProperty.call(message, "ipVersion")) + writer.uint32(/* id 294959552, wireType 0 =*/2359676416).int32(message.ipVersion); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose")) + writer.uint32(/* id 316407070, wireType 0 =*/2531256560).int32(message.purpose); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.prefixLength != null && Object.hasOwnProperty.call(message, "prefixLength")) + writer.uint32(/* id 453565747, wireType 0 =*/3628525976).int32(message.prefixLength); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 462920692, wireType 2 =*/3703365538).string(message.address); + if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) + writer.uint32(/* id 517397843, wireType 0 =*/4139182744).int32(message.networkTier); + return writer; + }; + + /** + * Encodes the specified Address message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Address.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Address + * @static + * @param {google.cloud.compute.v1.IAddress} message Address message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Address.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Address message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Address + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Address(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 462920692: + message.address = reader.string(); + break; + case 264307877: + message.addressType = reader.int32(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 294959552: + message.ipVersion = reader.int32(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 517397843: + message.networkTier = reader.int32(); + break; + case 453565747: + message.prefixLength = reader.int32(); + break; + case 316407070: + message.purpose = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + case 111578632: + if (!(message.users && message.users.length)) + message.users = []; + message.users.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Address message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Address + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Address} Address + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Address.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Address message. + * @function verify + * @memberof google.cloud.compute.v1.Address + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Address.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.address != null && message.hasOwnProperty("address")) { + properties._address = 1; + if (!$util.isString(message.address)) + return "address: string expected"; + } + if (message.addressType != null && message.hasOwnProperty("addressType")) { + properties._addressType = 1; + switch (message.addressType) { + default: + return "addressType: enum value expected"; + case 0: + case 35607499: + case 279295677: + case 53933922: + break; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.ipVersion != null && message.hasOwnProperty("ipVersion")) { + properties._ipVersion = 1; + switch (message.ipVersion) { + default: + return "ipVersion: enum value expected"; + case 0: + case 2254341: + case 2254343: + case 21850000: + break; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + properties._networkTier = 1; + switch (message.networkTier) { + default: + return "networkTier: enum value expected"; + case 0: + case 399530551: + case 484642493: + break; + } + } + if (message.prefixLength != null && message.hasOwnProperty("prefixLength")) { + properties._prefixLength = 1; + if (!$util.isInteger(message.prefixLength)) + return "prefixLength: integer expected"; + } + if (message.purpose != null && message.hasOwnProperty("purpose")) { + properties._purpose = 1; + switch (message.purpose) { + default: + return "purpose: enum value expected"; + case 0: + case 476114556: + case 230515243: + case 340437251: + case 163666477: + case 48134724: + case 294447572: + case 400800170: + break; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 17393485: + case 432241448: + case 514587225: + break; + } + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) + if (!$util.isString(message.users[i])) + return "users: string[] expected"; + } + return null; + }; + + /** + * Creates an Address message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Address + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Address} Address + */ + Address.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Address) + return object; + var message = new $root.google.cloud.compute.v1.Address(); + if (object.address != null) + message.address = String(object.address); + switch (object.addressType) { + case "UNDEFINED_ADDRESS_TYPE": + case 0: + message.addressType = 0; + break; + case "EXTERNAL": + case 35607499: + message.addressType = 35607499; + break; + case "INTERNAL": + case 279295677: + message.addressType = 279295677; + break; + case "UNSPECIFIED_TYPE": + case 53933922: + message.addressType = 53933922; + break; + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + switch (object.ipVersion) { + case "UNDEFINED_IP_VERSION": + case 0: + message.ipVersion = 0; + break; + case "IPV4": + case 2254341: + message.ipVersion = 2254341; + break; + case "IPV6": + case 2254343: + message.ipVersion = 2254343; + break; + case "UNSPECIFIED_VERSION": + case 21850000: + message.ipVersion = 21850000; + break; + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + switch (object.networkTier) { + case "UNDEFINED_NETWORK_TIER": + case 0: + message.networkTier = 0; + break; + case "PREMIUM": + case 399530551: + message.networkTier = 399530551; + break; + case "STANDARD": + case 484642493: + message.networkTier = 484642493; + break; + } + if (object.prefixLength != null) + message.prefixLength = object.prefixLength | 0; + switch (object.purpose) { + case "UNDEFINED_PURPOSE": + case 0: + message.purpose = 0; + break; + case "DNS_RESOLVER": + case 476114556: + message.purpose = 476114556; + break; + case "GCE_ENDPOINT": + case 230515243: + message.purpose = 230515243; + break; + case "IPSEC_INTERCONNECT": + case 340437251: + message.purpose = 340437251; + break; + case "NAT_AUTO": + case 163666477: + message.purpose = 163666477; + break; + case "PRIVATE_SERVICE_CONNECT": + case 48134724: + message.purpose = 48134724; + break; + case "SHARED_LOADBALANCER_VIP": + case 294447572: + message.purpose = 294447572; + break; + case "VPC_PEERING": + case 400800170: + message.purpose = 400800170; + break; + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "IN_USE": + case 17393485: + message.status = 17393485; + break; + case "RESERVED": + case 432241448: + message.status = 432241448; + break; + case "RESERVING": + case 514587225: + message.status = 514587225; + break; + } + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.compute.v1.Address.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) + message.users[i] = String(object.users[i]); + } + return message; + }; + + /** + * Creates a plain object from an Address message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Address + * @static + * @param {google.cloud.compute.v1.Address} message Address + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Address.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.users = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = message.users[j]; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Address.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.addressType != null && message.hasOwnProperty("addressType")) { + object.addressType = options.enums === String ? $root.google.cloud.compute.v1.Address.AddressType[message.addressType] : message.addressType; + if (options.oneofs) + object._addressType = "addressType"; + } + if (message.ipVersion != null && message.hasOwnProperty("ipVersion")) { + object.ipVersion = options.enums === String ? $root.google.cloud.compute.v1.Address.IpVersion[message.ipVersion] : message.ipVersion; + if (options.oneofs) + object._ipVersion = "ipVersion"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.purpose != null && message.hasOwnProperty("purpose")) { + object.purpose = options.enums === String ? $root.google.cloud.compute.v1.Address.Purpose[message.purpose] : message.purpose; + if (options.oneofs) + object._purpose = "purpose"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.prefixLength != null && message.hasOwnProperty("prefixLength")) { + object.prefixLength = message.prefixLength; + if (options.oneofs) + object._prefixLength = "prefixLength"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.address != null && message.hasOwnProperty("address")) { + object.address = message.address; + if (options.oneofs) + object._address = "address"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + object.networkTier = options.enums === String ? $root.google.cloud.compute.v1.Address.NetworkTier[message.networkTier] : message.networkTier; + if (options.oneofs) + object._networkTier = "networkTier"; + } + return object; + }; + + /** + * Converts this Address to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Address + * @instance + * @returns {Object.} JSON object + */ + Address.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AddressType enum. + * @name google.cloud.compute.v1.Address.AddressType + * @enum {number} + * @property {number} UNDEFINED_ADDRESS_TYPE=0 UNDEFINED_ADDRESS_TYPE value + * @property {number} EXTERNAL=35607499 EXTERNAL value + * @property {number} INTERNAL=279295677 INTERNAL value + * @property {number} UNSPECIFIED_TYPE=53933922 UNSPECIFIED_TYPE value + */ + Address.AddressType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ADDRESS_TYPE"] = 0; + values[valuesById[35607499] = "EXTERNAL"] = 35607499; + values[valuesById[279295677] = "INTERNAL"] = 279295677; + values[valuesById[53933922] = "UNSPECIFIED_TYPE"] = 53933922; + return values; + })(); + + /** + * IpVersion enum. + * @name google.cloud.compute.v1.Address.IpVersion + * @enum {number} + * @property {number} UNDEFINED_IP_VERSION=0 UNDEFINED_IP_VERSION value + * @property {number} IPV4=2254341 IPV4 value + * @property {number} IPV6=2254343 IPV6 value + * @property {number} UNSPECIFIED_VERSION=21850000 UNSPECIFIED_VERSION value + */ + Address.IpVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_IP_VERSION"] = 0; + values[valuesById[2254341] = "IPV4"] = 2254341; + values[valuesById[2254343] = "IPV6"] = 2254343; + values[valuesById[21850000] = "UNSPECIFIED_VERSION"] = 21850000; + return values; + })(); + + /** + * NetworkTier enum. + * @name google.cloud.compute.v1.Address.NetworkTier + * @enum {number} + * @property {number} UNDEFINED_NETWORK_TIER=0 UNDEFINED_NETWORK_TIER value + * @property {number} PREMIUM=399530551 PREMIUM value + * @property {number} STANDARD=484642493 STANDARD value + */ + Address.NetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NETWORK_TIER"] = 0; + values[valuesById[399530551] = "PREMIUM"] = 399530551; + values[valuesById[484642493] = "STANDARD"] = 484642493; + return values; + })(); + + /** + * Purpose enum. + * @name google.cloud.compute.v1.Address.Purpose + * @enum {number} + * @property {number} UNDEFINED_PURPOSE=0 UNDEFINED_PURPOSE value + * @property {number} DNS_RESOLVER=476114556 DNS_RESOLVER value + * @property {number} GCE_ENDPOINT=230515243 GCE_ENDPOINT value + * @property {number} IPSEC_INTERCONNECT=340437251 IPSEC_INTERCONNECT value + * @property {number} NAT_AUTO=163666477 NAT_AUTO value + * @property {number} PRIVATE_SERVICE_CONNECT=48134724 PRIVATE_SERVICE_CONNECT value + * @property {number} SHARED_LOADBALANCER_VIP=294447572 SHARED_LOADBALANCER_VIP value + * @property {number} VPC_PEERING=400800170 VPC_PEERING value + */ + Address.Purpose = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PURPOSE"] = 0; + values[valuesById[476114556] = "DNS_RESOLVER"] = 476114556; + values[valuesById[230515243] = "GCE_ENDPOINT"] = 230515243; + values[valuesById[340437251] = "IPSEC_INTERCONNECT"] = 340437251; + values[valuesById[163666477] = "NAT_AUTO"] = 163666477; + values[valuesById[48134724] = "PRIVATE_SERVICE_CONNECT"] = 48134724; + values[valuesById[294447572] = "SHARED_LOADBALANCER_VIP"] = 294447572; + values[valuesById[400800170] = "VPC_PEERING"] = 400800170; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.Address.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} IN_USE=17393485 IN_USE value + * @property {number} RESERVED=432241448 RESERVED value + * @property {number} RESERVING=514587225 RESERVING value + */ + Address.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[17393485] = "IN_USE"] = 17393485; + values[valuesById[432241448] = "RESERVED"] = 432241448; + values[valuesById[514587225] = "RESERVING"] = 514587225; + return values; + })(); + + return Address; + })(); + + v1.AddressesScopedList = (function() { + + /** + * Properties of an AddressesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IAddressesScopedList + * @property {Array.|null} [addresses] AddressesScopedList addresses + * @property {google.cloud.compute.v1.IWarning|null} [warning] AddressesScopedList warning + */ + + /** + * Constructs a new AddressesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddressesScopedList. + * @implements IAddressesScopedList + * @constructor + * @param {google.cloud.compute.v1.IAddressesScopedList=} [properties] Properties to set + */ + function AddressesScopedList(properties) { + this.addresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddressesScopedList addresses. + * @member {Array.} addresses + * @memberof google.cloud.compute.v1.AddressesScopedList + * @instance + */ + AddressesScopedList.prototype.addresses = $util.emptyArray; + + /** + * AddressesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AddressesScopedList + * @instance + */ + AddressesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddressesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AddressesScopedList + * @instance + */ + Object.defineProperty(AddressesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddressesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {google.cloud.compute.v1.IAddressesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddressesScopedList} AddressesScopedList instance + */ + AddressesScopedList.create = function create(properties) { + return new AddressesScopedList(properties); + }; + + /** + * Encodes the specified AddressesScopedList message. Does not implicitly {@link google.cloud.compute.v1.AddressesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {google.cloud.compute.v1.IAddressesScopedList} message AddressesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.addresses != null && message.addresses.length) + for (var i = 0; i < message.addresses.length; ++i) + $root.google.cloud.compute.v1.Address.encode(message.addresses[i], writer.uint32(/* id 337673122, wireType 2 =*/2701384978).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddressesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddressesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {google.cloud.compute.v1.IAddressesScopedList} message AddressesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddressesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddressesScopedList} AddressesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddressesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 337673122: + if (!(message.addresses && message.addresses.length)) + message.addresses = []; + message.addresses.push($root.google.cloud.compute.v1.Address.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddressesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddressesScopedList} AddressesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddressesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddressesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.addresses != null && message.hasOwnProperty("addresses")) { + if (!Array.isArray(message.addresses)) + return "addresses: array expected"; + for (var i = 0; i < message.addresses.length; ++i) { + var error = $root.google.cloud.compute.v1.Address.verify(message.addresses[i]); + if (error) + return "addresses." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AddressesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddressesScopedList} AddressesScopedList + */ + AddressesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddressesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.AddressesScopedList(); + if (object.addresses) { + if (!Array.isArray(object.addresses)) + throw TypeError(".google.cloud.compute.v1.AddressesScopedList.addresses: array expected"); + message.addresses = []; + for (var i = 0; i < object.addresses.length; ++i) { + if (typeof object.addresses[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AddressesScopedList.addresses: object expected"); + message.addresses[i] = $root.google.cloud.compute.v1.Address.fromObject(object.addresses[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AddressesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AddressesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddressesScopedList + * @static + * @param {google.cloud.compute.v1.AddressesScopedList} message AddressesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddressesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.addresses = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.addresses && message.addresses.length) { + object.addresses = []; + for (var j = 0; j < message.addresses.length; ++j) + object.addresses[j] = $root.google.cloud.compute.v1.Address.toObject(message.addresses[j], options); + } + return object; + }; + + /** + * Converts this AddressesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddressesScopedList + * @instance + * @returns {Object.} JSON object + */ + AddressesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddressesScopedList; + })(); + + v1.AddressAggregatedList = (function() { + + /** + * Properties of an AddressAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IAddressAggregatedList + * @property {string|null} [id] AddressAggregatedList id + * @property {Object.|null} [items] AddressAggregatedList items + * @property {string|null} [kind] AddressAggregatedList kind + * @property {string|null} [nextPageToken] AddressAggregatedList nextPageToken + * @property {string|null} [selfLink] AddressAggregatedList selfLink + * @property {Array.|null} [unreachables] AddressAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] AddressAggregatedList warning + */ + + /** + * Constructs a new AddressAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddressAggregatedList. + * @implements IAddressAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IAddressAggregatedList=} [properties] Properties to set + */ + function AddressAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddressAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + AddressAggregatedList.prototype.id = null; + + /** + * AddressAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + AddressAggregatedList.prototype.items = $util.emptyObject; + + /** + * AddressAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + AddressAggregatedList.prototype.kind = null; + + /** + * AddressAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + AddressAggregatedList.prototype.nextPageToken = null; + + /** + * AddressAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + AddressAggregatedList.prototype.selfLink = null; + + /** + * AddressAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + AddressAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * AddressAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + AddressAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddressAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + Object.defineProperty(AddressAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + Object.defineProperty(AddressAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + Object.defineProperty(AddressAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + Object.defineProperty(AddressAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + */ + Object.defineProperty(AddressAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddressAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {google.cloud.compute.v1.IAddressAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddressAggregatedList} AddressAggregatedList instance + */ + AddressAggregatedList.create = function create(properties) { + return new AddressAggregatedList(properties); + }; + + /** + * Encodes the specified AddressAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.AddressAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {google.cloud.compute.v1.IAddressAggregatedList} message AddressAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.AddressesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified AddressAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddressAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {google.cloud.compute.v1.IAddressAggregatedList} message AddressAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddressAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddressAggregatedList} AddressAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddressAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.AddressesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddressAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddressAggregatedList} AddressAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddressAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddressAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.AddressesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AddressAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddressAggregatedList} AddressAggregatedList + */ + AddressAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddressAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.AddressAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.AddressAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.AddressAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.AddressesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.AddressAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AddressAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AddressAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @static + * @param {google.cloud.compute.v1.AddressAggregatedList} message AddressAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddressAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.AddressesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this AddressAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddressAggregatedList + * @instance + * @returns {Object.} JSON object + */ + AddressAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddressAggregatedList; + })(); + + v1.AddressList = (function() { + + /** + * Properties of an AddressList. + * @memberof google.cloud.compute.v1 + * @interface IAddressList + * @property {string|null} [id] AddressList id + * @property {Array.|null} [items] AddressList items + * @property {string|null} [kind] AddressList kind + * @property {string|null} [nextPageToken] AddressList nextPageToken + * @property {string|null} [selfLink] AddressList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] AddressList warning + */ + + /** + * Constructs a new AddressList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddressList. + * @implements IAddressList + * @constructor + * @param {google.cloud.compute.v1.IAddressList=} [properties] Properties to set + */ + function AddressList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddressList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + AddressList.prototype.id = null; + + /** + * AddressList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + AddressList.prototype.items = $util.emptyArray; + + /** + * AddressList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + AddressList.prototype.kind = null; + + /** + * AddressList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + AddressList.prototype.nextPageToken = null; + + /** + * AddressList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + AddressList.prototype.selfLink = null; + + /** + * AddressList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + AddressList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddressList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + Object.defineProperty(AddressList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + Object.defineProperty(AddressList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + Object.defineProperty(AddressList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + Object.defineProperty(AddressList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddressList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AddressList + * @instance + */ + Object.defineProperty(AddressList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddressList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {google.cloud.compute.v1.IAddressList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddressList} AddressList instance + */ + AddressList.create = function create(properties) { + return new AddressList(properties); + }; + + /** + * Encodes the specified AddressList message. Does not implicitly {@link google.cloud.compute.v1.AddressList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {google.cloud.compute.v1.IAddressList} message AddressList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Address.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified AddressList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddressList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {google.cloud.compute.v1.IAddressList} message AddressList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddressList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddressList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddressList} AddressList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddressList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Address.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddressList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddressList} AddressList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddressList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddressList message. + * @function verify + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddressList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Address.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AddressList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddressList} AddressList + */ + AddressList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddressList) + return object; + var message = new $root.google.cloud.compute.v1.AddressList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.AddressList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AddressList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Address.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AddressList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AddressList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddressList + * @static + * @param {google.cloud.compute.v1.AddressList} message AddressList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddressList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Address.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this AddressList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddressList + * @instance + * @returns {Object.} JSON object + */ + AddressList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddressList; + })(); + + v1.AdvancedMachineFeatures = (function() { + + /** + * Properties of an AdvancedMachineFeatures. + * @memberof google.cloud.compute.v1 + * @interface IAdvancedMachineFeatures + * @property {boolean|null} [enableNestedVirtualization] AdvancedMachineFeatures enableNestedVirtualization + * @property {number|null} [threadsPerCore] AdvancedMachineFeatures threadsPerCore + */ + + /** + * Constructs a new AdvancedMachineFeatures. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AdvancedMachineFeatures. + * @implements IAdvancedMachineFeatures + * @constructor + * @param {google.cloud.compute.v1.IAdvancedMachineFeatures=} [properties] Properties to set + */ + function AdvancedMachineFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedMachineFeatures enableNestedVirtualization. + * @member {boolean|null|undefined} enableNestedVirtualization + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.enableNestedVirtualization = null; + + /** + * AdvancedMachineFeatures threadsPerCore. + * @member {number|null|undefined} threadsPerCore + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.threadsPerCore = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AdvancedMachineFeatures _enableNestedVirtualization. + * @member {"enableNestedVirtualization"|undefined} _enableNestedVirtualization + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableNestedVirtualization", { + get: $util.oneOfGetter($oneOfFields = ["enableNestedVirtualization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AdvancedMachineFeatures _threadsPerCore. + * @member {"threadsPerCore"|undefined} _threadsPerCore + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_threadsPerCore", { + get: $util.oneOfGetter($oneOfFields = ["threadsPerCore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.compute.v1.IAdvancedMachineFeatures=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AdvancedMachineFeatures} AdvancedMachineFeatures instance + */ + AdvancedMachineFeatures.create = function create(properties) { + return new AdvancedMachineFeatures(properties); + }; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.compute.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.compute.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableNestedVirtualization != null && Object.hasOwnProperty.call(message, "enableNestedVirtualization")) + writer.uint32(/* id 16639365, wireType 0 =*/133114920).bool(message.enableNestedVirtualization); + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) + writer.uint32(/* id 352611671, wireType 0 =*/2820893368).int32(message.threadsPerCore); + return writer; + }; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.compute.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AdvancedMachineFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 16639365: + message.enableNestedVirtualization = reader.bool(); + break; + case 352611671: + message.threadsPerCore = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedMachineFeatures message. + * @function verify + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedMachineFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + properties._enableNestedVirtualization = 1; + if (typeof message.enableNestedVirtualization !== "boolean") + return "enableNestedVirtualization: boolean expected"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + properties._threadsPerCore = 1; + if (!$util.isInteger(message.threadsPerCore)) + return "threadsPerCore: integer expected"; + } + return null; + }; + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + */ + AdvancedMachineFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AdvancedMachineFeatures) + return object; + var message = new $root.google.cloud.compute.v1.AdvancedMachineFeatures(); + if (object.enableNestedVirtualization != null) + message.enableNestedVirtualization = Boolean(object.enableNestedVirtualization); + if (object.threadsPerCore != null) + message.threadsPerCore = object.threadsPerCore | 0; + return message; + }; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.compute.v1.AdvancedMachineFeatures} message AdvancedMachineFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedMachineFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + object.enableNestedVirtualization = message.enableNestedVirtualization; + if (options.oneofs) + object._enableNestedVirtualization = "enableNestedVirtualization"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + object.threadsPerCore = message.threadsPerCore; + if (options.oneofs) + object._threadsPerCore = "threadsPerCore"; + } + return object; + }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AdvancedMachineFeatures + * @instance + * @returns {Object.} JSON object + */ + AdvancedMachineFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AdvancedMachineFeatures; + })(); + + v1.AliasIpRange = (function() { + + /** + * Properties of an AliasIpRange. + * @memberof google.cloud.compute.v1 + * @interface IAliasIpRange + * @property {string|null} [ipCidrRange] AliasIpRange ipCidrRange + * @property {string|null} [subnetworkRangeName] AliasIpRange subnetworkRangeName + */ + + /** + * Constructs a new AliasIpRange. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AliasIpRange. + * @implements IAliasIpRange + * @constructor + * @param {google.cloud.compute.v1.IAliasIpRange=} [properties] Properties to set + */ + function AliasIpRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AliasIpRange ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.ipCidrRange = null; + + /** + * AliasIpRange subnetworkRangeName. + * @member {string|null|undefined} subnetworkRangeName + * @memberof google.cloud.compute.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.subnetworkRangeName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AliasIpRange _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.AliasIpRange + * @instance + */ + Object.defineProperty(AliasIpRange.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AliasIpRange _subnetworkRangeName. + * @member {"subnetworkRangeName"|undefined} _subnetworkRangeName + * @memberof google.cloud.compute.v1.AliasIpRange + * @instance + */ + Object.defineProperty(AliasIpRange.prototype, "_subnetworkRangeName", { + get: $util.oneOfGetter($oneOfFields = ["subnetworkRangeName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AliasIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {google.cloud.compute.v1.IAliasIpRange=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AliasIpRange} AliasIpRange instance + */ + AliasIpRange.create = function create(properties) { + return new AliasIpRange(properties); + }; + + /** + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.compute.v1.AliasIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {google.cloud.compute.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.subnetworkRangeName != null && Object.hasOwnProperty.call(message, "subnetworkRangeName")) + writer.uint32(/* id 387995966, wireType 2 =*/3103967730).string(message.subnetworkRangeName); + return writer; + }; + + /** + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AliasIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {google.cloud.compute.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AliasIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 387995966: + message.subnetworkRangeName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AliasIpRange message. + * @function verify + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AliasIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + properties._subnetworkRangeName = 1; + if (!$util.isString(message.subnetworkRangeName)) + return "subnetworkRangeName: string expected"; + } + return null; + }; + + /** + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AliasIpRange} AliasIpRange + */ + AliasIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AliasIpRange) + return object; + var message = new $root.google.cloud.compute.v1.AliasIpRange(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.subnetworkRangeName != null) + message.subnetworkRangeName = String(object.subnetworkRangeName); + return message; + }; + + /** + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AliasIpRange + * @static + * @param {google.cloud.compute.v1.AliasIpRange} message AliasIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AliasIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + object.subnetworkRangeName = message.subnetworkRangeName; + if (options.oneofs) + object._subnetworkRangeName = "subnetworkRangeName"; + } + return object; + }; + + /** + * Converts this AliasIpRange to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AliasIpRange + * @instance + * @returns {Object.} JSON object + */ + AliasIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AliasIpRange; + })(); + + v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk = (function() { + + /** + * Properties of an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk. + * @memberof google.cloud.compute.v1 + * @interface IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @property {number|Long|null} [diskSizeGb] AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk diskSizeGb + * @property {google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface|null} ["interface"] AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk interface + */ + + /** + * Constructs a new AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk. + * @implements IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @constructor + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk=} [properties] Properties to set + */ + function AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @instance + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.prototype.diskSizeGb = null; + + /** + * AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk interface. + * @member {google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface|null|undefined} interface + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @instance + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.prototype["interface"] = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @instance + */ + Object.defineProperty(AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk _interface. + * @member {"interface"|undefined} _interface + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @instance + */ + Object.defineProperty(AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.prototype, "_interface", { + get: $util.oneOfGetter($oneOfFields = ["interface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk} AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk instance + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.create = function create(properties) { + return new AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(properties); + }; + + /** + * Encodes the specified AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk} message AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 316263735, wireType 0 =*/2530109880).int64(message.diskSizeGb); + if (message["interface"] != null && Object.hasOwnProperty.call(message, "interface")) + writer.uint32(/* id 502623545, wireType 0 =*/4020988360).int32(message["interface"]); + return writer; + }; + + /** + * Encodes the specified AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk} message AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk} AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 316263735: + message.diskSizeGb = reader.int64(); + break; + case 502623545: + message["interface"] = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk} AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message. + * @function verify + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message["interface"] != null && message.hasOwnProperty("interface")) { + properties._interface = 1; + switch (message["interface"]) { + default: + return "interface: enum value expected"; + case 0: + case 2408800: + case 2539686: + break; + } + } + return null; + }; + + /** + * Creates an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk} AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk) + return object; + var message = new $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk(); + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + switch (object["interface"]) { + case "UNDEFINED_INTERFACE": + case 0: + message["interface"] = 0; + break; + case "NVME": + case 2408800: + message["interface"] = 2408800; + break; + case "SCSI": + case 2539686: + message["interface"] = 2539686; + break; + } + return message; + }; + + /** + * Creates a plain object from an AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @static + * @param {google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk} message AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message["interface"] != null && message.hasOwnProperty("interface")) { + object["interface"] = options.enums === String ? $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface[message["interface"]] : message["interface"]; + if (options.oneofs) + object._interface = "interface"; + } + return object; + }; + + /** + * Converts this AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk + * @instance + * @returns {Object.} JSON object + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Interface enum. + * @name google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface + * @enum {number} + * @property {number} UNDEFINED_INTERFACE=0 UNDEFINED_INTERFACE value + * @property {number} NVME=2408800 NVME value + * @property {number} SCSI=2539686 SCSI value + */ + AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.Interface = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_INTERFACE"] = 0; + values[valuesById[2408800] = "NVME"] = 2408800; + values[valuesById[2539686] = "SCSI"] = 2539686; + return values; + })(); + + return AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk; + })(); + + v1.AllocationSpecificSKUAllocationReservedInstanceProperties = (function() { + + /** + * Properties of an AllocationSpecificSKUAllocationReservedInstanceProperties. + * @memberof google.cloud.compute.v1 + * @interface IAllocationSpecificSKUAllocationReservedInstanceProperties + * @property {Array.|null} [guestAccelerators] AllocationSpecificSKUAllocationReservedInstanceProperties guestAccelerators + * @property {Array.|null} [localSsds] AllocationSpecificSKUAllocationReservedInstanceProperties localSsds + * @property {string|null} [locationHint] AllocationSpecificSKUAllocationReservedInstanceProperties locationHint + * @property {string|null} [machineType] AllocationSpecificSKUAllocationReservedInstanceProperties machineType + * @property {string|null} [minCpuPlatform] AllocationSpecificSKUAllocationReservedInstanceProperties minCpuPlatform + */ + + /** + * Constructs a new AllocationSpecificSKUAllocationReservedInstanceProperties. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AllocationSpecificSKUAllocationReservedInstanceProperties. + * @implements IAllocationSpecificSKUAllocationReservedInstanceProperties + * @constructor + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties=} [properties] Properties to set + */ + function AllocationSpecificSKUAllocationReservedInstanceProperties(properties) { + this.guestAccelerators = []; + this.localSsds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties guestAccelerators. + * @member {Array.} guestAccelerators + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.prototype.guestAccelerators = $util.emptyArray; + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties localSsds. + * @member {Array.} localSsds + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.prototype.localSsds = $util.emptyArray; + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties locationHint. + * @member {string|null|undefined} locationHint + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.prototype.locationHint = null; + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.prototype.machineType = null; + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.prototype.minCpuPlatform = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties _locationHint. + * @member {"locationHint"|undefined} _locationHint + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + Object.defineProperty(AllocationSpecificSKUAllocationReservedInstanceProperties.prototype, "_locationHint", { + get: $util.oneOfGetter($oneOfFields = ["locationHint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + Object.defineProperty(AllocationSpecificSKUAllocationReservedInstanceProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AllocationSpecificSKUAllocationReservedInstanceProperties _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + */ + Object.defineProperty(AllocationSpecificSKUAllocationReservedInstanceProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AllocationSpecificSKUAllocationReservedInstanceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties} AllocationSpecificSKUAllocationReservedInstanceProperties instance + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.create = function create(properties) { + return new AllocationSpecificSKUAllocationReservedInstanceProperties(properties); + }; + + /** + * Encodes the specified AllocationSpecificSKUAllocationReservedInstanceProperties message. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties} message AllocationSpecificSKUAllocationReservedInstanceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 227711026, wireType 2 =*/1821688210).string(message.machineType); + if (message.localSsds != null && message.localSsds.length) + for (var i = 0; i < message.localSsds.length; ++i) + $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.encode(message.localSsds[i], writer.uint32(/* id 229951299, wireType 2 =*/1839610394).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 242912759, wireType 2 =*/1943302074).string(message.minCpuPlatform); + if (message.locationHint != null && Object.hasOwnProperty.call(message, "locationHint")) + writer.uint32(/* id 350519505, wireType 2 =*/2804156042).string(message.locationHint); + if (message.guestAccelerators != null && message.guestAccelerators.length) + for (var i = 0; i < message.guestAccelerators.length; ++i) + $root.google.cloud.compute.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 463595119, wireType 2 =*/3708760954).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AllocationSpecificSKUAllocationReservedInstanceProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties} message AllocationSpecificSKUAllocationReservedInstanceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationSpecificSKUAllocationReservedInstanceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties} AllocationSpecificSKUAllocationReservedInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 463595119: + if (!(message.guestAccelerators && message.guestAccelerators.length)) + message.guestAccelerators = []; + message.guestAccelerators.push($root.google.cloud.compute.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + case 229951299: + if (!(message.localSsds && message.localSsds.length)) + message.localSsds = []; + message.localSsds.push($root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.decode(reader, reader.uint32())); + break; + case 350519505: + message.locationHint = reader.string(); + break; + case 227711026: + message.machineType = reader.string(); + break; + case 242912759: + message.minCpuPlatform = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationSpecificSKUAllocationReservedInstanceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties} AllocationSpecificSKUAllocationReservedInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationSpecificSKUAllocationReservedInstanceProperties message. + * @function verify + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { + if (!Array.isArray(message.guestAccelerators)) + return "guestAccelerators: array expected"; + for (var i = 0; i < message.guestAccelerators.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); + if (error) + return "guestAccelerators." + error; + } + } + if (message.localSsds != null && message.hasOwnProperty("localSsds")) { + if (!Array.isArray(message.localSsds)) + return "localSsds: array expected"; + for (var i = 0; i < message.localSsds.length; ++i) { + var error = $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.verify(message.localSsds[i]); + if (error) + return "localSsds." + error; + } + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + properties._locationHint = 1; + if (!$util.isString(message.locationHint)) + return "locationHint: string expected"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + return null; + }; + + /** + * Creates an AllocationSpecificSKUAllocationReservedInstanceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties} AllocationSpecificSKUAllocationReservedInstanceProperties + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties) + return object; + var message = new $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties(); + if (object.guestAccelerators) { + if (!Array.isArray(object.guestAccelerators)) + throw TypeError(".google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.guestAccelerators: array expected"); + message.guestAccelerators = []; + for (var i = 0; i < object.guestAccelerators.length; ++i) { + if (typeof object.guestAccelerators[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.guestAccelerators: object expected"); + message.guestAccelerators[i] = $root.google.cloud.compute.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); + } + } + if (object.localSsds) { + if (!Array.isArray(object.localSsds)) + throw TypeError(".google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.localSsds: array expected"); + message.localSsds = []; + for (var i = 0; i < object.localSsds.length; ++i) { + if (typeof object.localSsds[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.localSsds: object expected"); + message.localSsds[i] = $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.fromObject(object.localSsds[i]); + } + } + if (object.locationHint != null) + message.locationHint = String(object.locationHint); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + return message; + }; + + /** + * Creates a plain object from an AllocationSpecificSKUAllocationReservedInstanceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @static + * @param {google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties} message AllocationSpecificSKUAllocationReservedInstanceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.localSsds = []; + object.guestAccelerators = []; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.localSsds && message.localSsds.length) { + object.localSsds = []; + for (var j = 0; j < message.localSsds.length; ++j) + object.localSsds[j] = $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk.toObject(message.localSsds[j], options); + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + object.locationHint = message.locationHint; + if (options.oneofs) + object._locationHint = "locationHint"; + } + if (message.guestAccelerators && message.guestAccelerators.length) { + object.guestAccelerators = []; + for (var j = 0; j < message.guestAccelerators.length; ++j) + object.guestAccelerators[j] = $root.google.cloud.compute.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); + } + return object; + }; + + /** + * Converts this AllocationSpecificSKUAllocationReservedInstanceProperties to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties + * @instance + * @returns {Object.} JSON object + */ + AllocationSpecificSKUAllocationReservedInstanceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AllocationSpecificSKUAllocationReservedInstanceProperties; + })(); + + v1.AllocationSpecificSKUReservation = (function() { + + /** + * Properties of an AllocationSpecificSKUReservation. + * @memberof google.cloud.compute.v1 + * @interface IAllocationSpecificSKUReservation + * @property {number|Long|null} [count] AllocationSpecificSKUReservation count + * @property {number|Long|null} [inUseCount] AllocationSpecificSKUReservation inUseCount + * @property {google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties|null} [instanceProperties] AllocationSpecificSKUReservation instanceProperties + */ + + /** + * Constructs a new AllocationSpecificSKUReservation. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AllocationSpecificSKUReservation. + * @implements IAllocationSpecificSKUReservation + * @constructor + * @param {google.cloud.compute.v1.IAllocationSpecificSKUReservation=} [properties] Properties to set + */ + function AllocationSpecificSKUReservation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AllocationSpecificSKUReservation count. + * @member {number|Long|null|undefined} count + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @instance + */ + AllocationSpecificSKUReservation.prototype.count = null; + + /** + * AllocationSpecificSKUReservation inUseCount. + * @member {number|Long|null|undefined} inUseCount + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @instance + */ + AllocationSpecificSKUReservation.prototype.inUseCount = null; + + /** + * AllocationSpecificSKUReservation instanceProperties. + * @member {google.cloud.compute.v1.IAllocationSpecificSKUAllocationReservedInstanceProperties|null|undefined} instanceProperties + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @instance + */ + AllocationSpecificSKUReservation.prototype.instanceProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AllocationSpecificSKUReservation _count. + * @member {"count"|undefined} _count + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @instance + */ + Object.defineProperty(AllocationSpecificSKUReservation.prototype, "_count", { + get: $util.oneOfGetter($oneOfFields = ["count"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AllocationSpecificSKUReservation _inUseCount. + * @member {"inUseCount"|undefined} _inUseCount + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @instance + */ + Object.defineProperty(AllocationSpecificSKUReservation.prototype, "_inUseCount", { + get: $util.oneOfGetter($oneOfFields = ["inUseCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AllocationSpecificSKUReservation _instanceProperties. + * @member {"instanceProperties"|undefined} _instanceProperties + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @instance + */ + Object.defineProperty(AllocationSpecificSKUReservation.prototype, "_instanceProperties", { + get: $util.oneOfGetter($oneOfFields = ["instanceProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AllocationSpecificSKUReservation instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUReservation=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AllocationSpecificSKUReservation} AllocationSpecificSKUReservation instance + */ + AllocationSpecificSKUReservation.create = function create(properties) { + return new AllocationSpecificSKUReservation(properties); + }; + + /** + * Encodes the specified AllocationSpecificSKUReservation message. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUReservation.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUReservation} message AllocationSpecificSKUReservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationSpecificSKUReservation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 94851343, wireType 0 =*/758810744).int64(message.count); + if (message.instanceProperties != null && Object.hasOwnProperty.call(message, "instanceProperties")) + $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.encode(message.instanceProperties, writer.uint32(/* id 215355165, wireType 2 =*/1722841322).fork()).ldelim(); + if (message.inUseCount != null && Object.hasOwnProperty.call(message, "inUseCount")) + writer.uint32(/* id 493458877, wireType 0 =*/3947671016).int64(message.inUseCount); + return writer; + }; + + /** + * Encodes the specified AllocationSpecificSKUReservation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AllocationSpecificSKUReservation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {google.cloud.compute.v1.IAllocationSpecificSKUReservation} message AllocationSpecificSKUReservation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationSpecificSKUReservation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationSpecificSKUReservation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AllocationSpecificSKUReservation} AllocationSpecificSKUReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationSpecificSKUReservation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AllocationSpecificSKUReservation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 94851343: + message.count = reader.int64(); + break; + case 493458877: + message.inUseCount = reader.int64(); + break; + case 215355165: + message.instanceProperties = $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationSpecificSKUReservation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AllocationSpecificSKUReservation} AllocationSpecificSKUReservation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationSpecificSKUReservation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationSpecificSKUReservation message. + * @function verify + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationSpecificSKUReservation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.count != null && message.hasOwnProperty("count")) { + properties._count = 1; + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + } + if (message.inUseCount != null && message.hasOwnProperty("inUseCount")) { + properties._inUseCount = 1; + if (!$util.isInteger(message.inUseCount) && !(message.inUseCount && $util.isInteger(message.inUseCount.low) && $util.isInteger(message.inUseCount.high))) + return "inUseCount: integer|Long expected"; + } + if (message.instanceProperties != null && message.hasOwnProperty("instanceProperties")) { + properties._instanceProperties = 1; + { + var error = $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.verify(message.instanceProperties); + if (error) + return "instanceProperties." + error; + } + } + return null; + }; + + /** + * Creates an AllocationSpecificSKUReservation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AllocationSpecificSKUReservation} AllocationSpecificSKUReservation + */ + AllocationSpecificSKUReservation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AllocationSpecificSKUReservation) + return object; + var message = new $root.google.cloud.compute.v1.AllocationSpecificSKUReservation(); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.inUseCount != null) + if ($util.Long) + (message.inUseCount = $util.Long.fromValue(object.inUseCount)).unsigned = false; + else if (typeof object.inUseCount === "string") + message.inUseCount = parseInt(object.inUseCount, 10); + else if (typeof object.inUseCount === "number") + message.inUseCount = object.inUseCount; + else if (typeof object.inUseCount === "object") + message.inUseCount = new $util.LongBits(object.inUseCount.low >>> 0, object.inUseCount.high >>> 0).toNumber(); + if (object.instanceProperties != null) { + if (typeof object.instanceProperties !== "object") + throw TypeError(".google.cloud.compute.v1.AllocationSpecificSKUReservation.instanceProperties: object expected"); + message.instanceProperties = $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.fromObject(object.instanceProperties); + } + return message; + }; + + /** + * Creates a plain object from an AllocationSpecificSKUReservation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @static + * @param {google.cloud.compute.v1.AllocationSpecificSKUReservation} message AllocationSpecificSKUReservation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationSpecificSKUReservation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.count != null && message.hasOwnProperty("count")) { + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (options.oneofs) + object._count = "count"; + } + if (message.instanceProperties != null && message.hasOwnProperty("instanceProperties")) { + object.instanceProperties = $root.google.cloud.compute.v1.AllocationSpecificSKUAllocationReservedInstanceProperties.toObject(message.instanceProperties, options); + if (options.oneofs) + object._instanceProperties = "instanceProperties"; + } + if (message.inUseCount != null && message.hasOwnProperty("inUseCount")) { + if (typeof message.inUseCount === "number") + object.inUseCount = options.longs === String ? String(message.inUseCount) : message.inUseCount; + else + object.inUseCount = options.longs === String ? $util.Long.prototype.toString.call(message.inUseCount) : options.longs === Number ? new $util.LongBits(message.inUseCount.low >>> 0, message.inUseCount.high >>> 0).toNumber() : message.inUseCount; + if (options.oneofs) + object._inUseCount = "inUseCount"; + } + return object; + }; + + /** + * Converts this AllocationSpecificSKUReservation to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AllocationSpecificSKUReservation + * @instance + * @returns {Object.} JSON object + */ + AllocationSpecificSKUReservation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AllocationSpecificSKUReservation; + })(); + + v1.CustomerEncryptionKey = (function() { + + /** + * Properties of a CustomerEncryptionKey. + * @memberof google.cloud.compute.v1 + * @interface ICustomerEncryptionKey + * @property {string|null} [kmsKeyName] CustomerEncryptionKey kmsKeyName + * @property {string|null} [kmsKeyServiceAccount] CustomerEncryptionKey kmsKeyServiceAccount + * @property {string|null} [rawKey] CustomerEncryptionKey rawKey + * @property {string|null} [sha256] CustomerEncryptionKey sha256 + */ + + /** + * Constructs a new CustomerEncryptionKey. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CustomerEncryptionKey. + * @implements ICustomerEncryptionKey + * @constructor + * @param {google.cloud.compute.v1.ICustomerEncryptionKey=} [properties] Properties to set + */ + function CustomerEncryptionKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerEncryptionKey kmsKeyName. + * @member {string|null|undefined} kmsKeyName + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyName = null; + + /** + * CustomerEncryptionKey kmsKeyServiceAccount. + * @member {string|null|undefined} kmsKeyServiceAccount + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyServiceAccount = null; + + /** + * CustomerEncryptionKey rawKey. + * @member {string|null|undefined} rawKey + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.rawKey = null; + + /** + * CustomerEncryptionKey sha256. + * @member {string|null|undefined} sha256 + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.sha256 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomerEncryptionKey _kmsKeyName. + * @member {"kmsKeyName"|undefined} _kmsKeyName + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "_kmsKeyName", { + get: $util.oneOfGetter($oneOfFields = ["kmsKeyName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerEncryptionKey _kmsKeyServiceAccount. + * @member {"kmsKeyServiceAccount"|undefined} _kmsKeyServiceAccount + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "_kmsKeyServiceAccount", { + get: $util.oneOfGetter($oneOfFields = ["kmsKeyServiceAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerEncryptionKey _rawKey. + * @member {"rawKey"|undefined} _rawKey + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "_rawKey", { + get: $util.oneOfGetter($oneOfFields = ["rawKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerEncryptionKey _sha256. + * @member {"sha256"|undefined} _sha256 + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "_sha256", { + get: $util.oneOfGetter($oneOfFields = ["sha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.compute.v1.ICustomerEncryptionKey=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CustomerEncryptionKey} CustomerEncryptionKey instance + */ + CustomerEncryptionKey.create = function create(properties) { + return new CustomerEncryptionKey(properties); + }; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.compute.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sha256 != null && Object.hasOwnProperty.call(message, "sha256")) + writer.uint32(/* id 170112551, wireType 2 =*/1360900410).string(message.sha256); + if (message.kmsKeyServiceAccount != null && Object.hasOwnProperty.call(message, "kmsKeyServiceAccount")) + writer.uint32(/* id 209986261, wireType 2 =*/1679890090).string(message.kmsKeyServiceAccount); + if (message.rawKey != null && Object.hasOwnProperty.call(message, "rawKey")) + writer.uint32(/* id 449196488, wireType 2 =*/3593571906).string(message.rawKey); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 484373913, wireType 2 =*/3874991306).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.compute.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CustomerEncryptionKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 484373913: + message.kmsKeyName = reader.string(); + break; + case 209986261: + message.kmsKeyServiceAccount = reader.string(); + break; + case 449196488: + message.rawKey = reader.string(); + break; + case 170112551: + message.sha256 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEncryptionKey message. + * @function verify + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEncryptionKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + properties._kmsKeyName = 1; + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + properties._kmsKeyServiceAccount = 1; + if (!$util.isString(message.kmsKeyServiceAccount)) + return "kmsKeyServiceAccount: string expected"; + } + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + properties._rawKey = 1; + if (!$util.isString(message.rawKey)) + return "rawKey: string expected"; + } + if (message.sha256 != null && message.hasOwnProperty("sha256")) { + properties._sha256 = 1; + if (!$util.isString(message.sha256)) + return "sha256: string expected"; + } + return null; + }; + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CustomerEncryptionKey} CustomerEncryptionKey + */ + CustomerEncryptionKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CustomerEncryptionKey) + return object; + var message = new $root.google.cloud.compute.v1.CustomerEncryptionKey(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyServiceAccount != null) + message.kmsKeyServiceAccount = String(object.kmsKeyServiceAccount); + if (object.rawKey != null) + message.rawKey = String(object.rawKey); + if (object.sha256 != null) + message.sha256 = String(object.sha256); + return message; + }; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.compute.v1.CustomerEncryptionKey} message CustomerEncryptionKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEncryptionKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sha256 != null && message.hasOwnProperty("sha256")) { + object.sha256 = message.sha256; + if (options.oneofs) + object._sha256 = "sha256"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + object.kmsKeyServiceAccount = message.kmsKeyServiceAccount; + if (options.oneofs) + object._kmsKeyServiceAccount = "kmsKeyServiceAccount"; + } + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + object.rawKey = message.rawKey; + if (options.oneofs) + object._rawKey = "rawKey"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + object.kmsKeyName = message.kmsKeyName; + if (options.oneofs) + object._kmsKeyName = "kmsKeyName"; + } + return object; + }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CustomerEncryptionKey + * @instance + * @returns {Object.} JSON object + */ + CustomerEncryptionKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomerEncryptionKey; + })(); + + v1.GuestOsFeature = (function() { + + /** + * Properties of a GuestOsFeature. + * @memberof google.cloud.compute.v1 + * @interface IGuestOsFeature + * @property {google.cloud.compute.v1.GuestOsFeature.Type|null} [type] GuestOsFeature type + */ + + /** + * Constructs a new GuestOsFeature. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GuestOsFeature. + * @implements IGuestOsFeature + * @constructor + * @param {google.cloud.compute.v1.IGuestOsFeature=} [properties] Properties to set + */ + function GuestOsFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuestOsFeature type. + * @member {google.cloud.compute.v1.GuestOsFeature.Type|null|undefined} type + * @memberof google.cloud.compute.v1.GuestOsFeature + * @instance + */ + GuestOsFeature.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GuestOsFeature _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.GuestOsFeature + * @instance + */ + Object.defineProperty(GuestOsFeature.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GuestOsFeature instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {google.cloud.compute.v1.IGuestOsFeature=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GuestOsFeature} GuestOsFeature instance + */ + GuestOsFeature.create = function create(properties) { + return new GuestOsFeature(properties); + }; + + /** + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.compute.v1.GuestOsFeature.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {google.cloud.compute.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + return writer; + }; + + /** + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestOsFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {google.cloud.compute.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GuestOsFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestOsFeature message. + * @function verify + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestOsFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 531767259: + case 68209305: + case 151776719: + case 376811194: + case 87083793: + case 195865408: + case 201597069: + case 456863331: + break; + } + } + return null; + }; + + /** + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GuestOsFeature} GuestOsFeature + */ + GuestOsFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GuestOsFeature) + return object; + var message = new $root.google.cloud.compute.v1.GuestOsFeature(); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "FEATURE_TYPE_UNSPECIFIED": + case 531767259: + message.type = 531767259; + break; + case "GVNIC": + case 68209305: + message.type = 68209305; + break; + case "MULTI_IP_SUBNET": + case 151776719: + message.type = 151776719; + break; + case "SECURE_BOOT": + case 376811194: + message.type = 376811194; + break; + case "SEV_CAPABLE": + case 87083793: + message.type = 87083793; + break; + case "UEFI_COMPATIBLE": + case 195865408: + message.type = 195865408; + break; + case "VIRTIO_SCSI_MULTIQUEUE": + case 201597069: + message.type = 201597069; + break; + case "WINDOWS": + case 456863331: + message.type = 456863331; + break; + } + return message; + }; + + /** + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GuestOsFeature + * @static + * @param {google.cloud.compute.v1.GuestOsFeature} message GuestOsFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestOsFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.GuestOsFeature.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this GuestOsFeature to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GuestOsFeature + * @instance + * @returns {Object.} JSON object + */ + GuestOsFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.GuestOsFeature.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} FEATURE_TYPE_UNSPECIFIED=531767259 FEATURE_TYPE_UNSPECIFIED value + * @property {number} GVNIC=68209305 GVNIC value + * @property {number} MULTI_IP_SUBNET=151776719 MULTI_IP_SUBNET value + * @property {number} SECURE_BOOT=376811194 SECURE_BOOT value + * @property {number} SEV_CAPABLE=87083793 SEV_CAPABLE value + * @property {number} UEFI_COMPATIBLE=195865408 UEFI_COMPATIBLE value + * @property {number} VIRTIO_SCSI_MULTIQUEUE=201597069 VIRTIO_SCSI_MULTIQUEUE value + * @property {number} WINDOWS=456863331 WINDOWS value + */ + GuestOsFeature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[531767259] = "FEATURE_TYPE_UNSPECIFIED"] = 531767259; + values[valuesById[68209305] = "GVNIC"] = 68209305; + values[valuesById[151776719] = "MULTI_IP_SUBNET"] = 151776719; + values[valuesById[376811194] = "SECURE_BOOT"] = 376811194; + values[valuesById[87083793] = "SEV_CAPABLE"] = 87083793; + values[valuesById[195865408] = "UEFI_COMPATIBLE"] = 195865408; + values[valuesById[201597069] = "VIRTIO_SCSI_MULTIQUEUE"] = 201597069; + values[valuesById[456863331] = "WINDOWS"] = 456863331; + return values; + })(); + + return GuestOsFeature; + })(); + + v1.AttachedDiskInitializeParams = (function() { + + /** + * Properties of an AttachedDiskInitializeParams. + * @memberof google.cloud.compute.v1 + * @interface IAttachedDiskInitializeParams + * @property {string|null} [description] AttachedDiskInitializeParams description + * @property {string|null} [diskName] AttachedDiskInitializeParams diskName + * @property {number|Long|null} [diskSizeGb] AttachedDiskInitializeParams diskSizeGb + * @property {string|null} [diskType] AttachedDiskInitializeParams diskType + * @property {Object.|null} [labels] AttachedDiskInitializeParams labels + * @property {google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction|null} [onUpdateAction] AttachedDiskInitializeParams onUpdateAction + * @property {number|Long|null} [provisionedIops] AttachedDiskInitializeParams provisionedIops + * @property {Array.|null} [resourcePolicies] AttachedDiskInitializeParams resourcePolicies + * @property {string|null} [sourceImage] AttachedDiskInitializeParams sourceImage + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceImageEncryptionKey] AttachedDiskInitializeParams sourceImageEncryptionKey + * @property {string|null} [sourceSnapshot] AttachedDiskInitializeParams sourceSnapshot + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceSnapshotEncryptionKey] AttachedDiskInitializeParams sourceSnapshotEncryptionKey + */ + + /** + * Constructs a new AttachedDiskInitializeParams. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AttachedDiskInitializeParams. + * @implements IAttachedDiskInitializeParams + * @constructor + * @param {google.cloud.compute.v1.IAttachedDiskInitializeParams=} [properties] Properties to set + */ + function AttachedDiskInitializeParams(properties) { + this.labels = {}; + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDiskInitializeParams description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.description = null; + + /** + * AttachedDiskInitializeParams diskName. + * @member {string|null|undefined} diskName + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.diskName = null; + + /** + * AttachedDiskInitializeParams diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.diskSizeGb = null; + + /** + * AttachedDiskInitializeParams diskType. + * @member {string|null|undefined} diskType + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.diskType = null; + + /** + * AttachedDiskInitializeParams labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.labels = $util.emptyObject; + + /** + * AttachedDiskInitializeParams onUpdateAction. + * @member {google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction|null|undefined} onUpdateAction + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.onUpdateAction = null; + + /** + * AttachedDiskInitializeParams provisionedIops. + * @member {number|Long|null|undefined} provisionedIops + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.provisionedIops = null; + + /** + * AttachedDiskInitializeParams resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.resourcePolicies = $util.emptyArray; + + /** + * AttachedDiskInitializeParams sourceImage. + * @member {string|null|undefined} sourceImage + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.sourceImage = null; + + /** + * AttachedDiskInitializeParams sourceImageEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceImageEncryptionKey + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.sourceImageEncryptionKey = null; + + /** + * AttachedDiskInitializeParams sourceSnapshot. + * @member {string|null|undefined} sourceSnapshot + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.sourceSnapshot = null; + + /** + * AttachedDiskInitializeParams sourceSnapshotEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceSnapshotEncryptionKey + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + AttachedDiskInitializeParams.prototype.sourceSnapshotEncryptionKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDiskInitializeParams _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _diskName. + * @member {"diskName"|undefined} _diskName + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_diskName", { + get: $util.oneOfGetter($oneOfFields = ["diskName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _diskType. + * @member {"diskType"|undefined} _diskType + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_diskType", { + get: $util.oneOfGetter($oneOfFields = ["diskType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _onUpdateAction. + * @member {"onUpdateAction"|undefined} _onUpdateAction + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_onUpdateAction", { + get: $util.oneOfGetter($oneOfFields = ["onUpdateAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _provisionedIops. + * @member {"provisionedIops"|undefined} _provisionedIops + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_provisionedIops", { + get: $util.oneOfGetter($oneOfFields = ["provisionedIops"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _sourceImage. + * @member {"sourceImage"|undefined} _sourceImage + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_sourceImage", { + get: $util.oneOfGetter($oneOfFields = ["sourceImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _sourceImageEncryptionKey. + * @member {"sourceImageEncryptionKey"|undefined} _sourceImageEncryptionKey + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_sourceImageEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceImageEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _sourceSnapshot. + * @member {"sourceSnapshot"|undefined} _sourceSnapshot + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_sourceSnapshot", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDiskInitializeParams _sourceSnapshotEncryptionKey. + * @member {"sourceSnapshotEncryptionKey"|undefined} _sourceSnapshotEncryptionKey + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + */ + Object.defineProperty(AttachedDiskInitializeParams.prototype, "_sourceSnapshotEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshotEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDiskInitializeParams instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {google.cloud.compute.v1.IAttachedDiskInitializeParams=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AttachedDiskInitializeParams} AttachedDiskInitializeParams instance + */ + AttachedDiskInitializeParams.create = function create(properties) { + return new AttachedDiskInitializeParams(properties); + }; + + /** + * Encodes the specified AttachedDiskInitializeParams message. Does not implicitly {@link google.cloud.compute.v1.AttachedDiskInitializeParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {google.cloud.compute.v1.IAttachedDiskInitializeParams} message AttachedDiskInitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDiskInitializeParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + if (message.sourceImage != null && Object.hasOwnProperty.call(message, "sourceImage")) + writer.uint32(/* id 50443319, wireType 2 =*/403546554).string(message.sourceImage); + if (message.diskName != null && Object.hasOwnProperty.call(message, "diskName")) + writer.uint32(/* id 92807149, wireType 2 =*/742457194).string(message.diskName); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 93009052, wireType 2 =*/744072418).string(message.diskType); + if (message.sourceSnapshot != null && Object.hasOwnProperty.call(message, "sourceSnapshot")) + writer.uint32(/* id 126061928, wireType 2 =*/1008495426).string(message.sourceSnapshot); + if (message.provisionedIops != null && Object.hasOwnProperty.call(message, "provisionedIops")) + writer.uint32(/* id 186769108, wireType 0 =*/1494152864).int64(message.provisionedIops); + if (message.onUpdateAction != null && Object.hasOwnProperty.call(message, "onUpdateAction")) + writer.uint32(/* id 202451980, wireType 0 =*/1619615840).int32(message.onUpdateAction); + if (message.sourceSnapshotEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceSnapshotEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceSnapshotEncryptionKey, writer.uint32(/* id 303679322, wireType 2 =*/2429434578).fork()).ldelim(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 316263735, wireType 0 =*/2530109880).int64(message.diskSizeGb); + if (message.sourceImageEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceImageEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceImageEncryptionKey, writer.uint32(/* id 381503659, wireType 2 =*/3052029274).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + 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 500195327, wireType 2 =*/4001562618).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 AttachedDiskInitializeParams message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachedDiskInitializeParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {google.cloud.compute.v1.IAttachedDiskInitializeParams} message AttachedDiskInitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDiskInitializeParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDiskInitializeParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AttachedDiskInitializeParams} AttachedDiskInitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDiskInitializeParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AttachedDiskInitializeParams(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 92807149: + message.diskName = reader.string(); + break; + case 316263735: + message.diskSizeGb = reader.int64(); + break; + case 93009052: + message.diskType = reader.string(); + break; + case 500195327: + 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 202451980: + message.onUpdateAction = reader.int32(); + break; + case 186769108: + message.provisionedIops = reader.int64(); + break; + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + case 50443319: + message.sourceImage = reader.string(); + break; + case 381503659: + message.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 126061928: + message.sourceSnapshot = reader.string(); + break; + case 303679322: + message.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDiskInitializeParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AttachedDiskInitializeParams} AttachedDiskInitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDiskInitializeParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDiskInitializeParams message. + * @function verify + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDiskInitializeParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.diskName != null && message.hasOwnProperty("diskName")) { + properties._diskName = 1; + if (!$util.isString(message.diskName)) + return "diskName: string expected"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + properties._diskType = 1; + if (!$util.isString(message.diskType)) + return "diskType: 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.onUpdateAction != null && message.hasOwnProperty("onUpdateAction")) { + properties._onUpdateAction = 1; + switch (message.onUpdateAction) { + default: + return "onUpdateAction: enum value expected"; + case 0: + case 494767853: + case 398099712: + case 232682233: + break; + } + } + if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { + properties._provisionedIops = 1; + if (!$util.isInteger(message.provisionedIops) && !(message.provisionedIops && $util.isInteger(message.provisionedIops.low) && $util.isInteger(message.provisionedIops.high))) + return "provisionedIops: integer|Long expected"; + } + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + properties._sourceImage = 1; + if (!$util.isString(message.sourceImage)) + return "sourceImage: string expected"; + } + if (message.sourceImageEncryptionKey != null && message.hasOwnProperty("sourceImageEncryptionKey")) { + properties._sourceImageEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceImageEncryptionKey); + if (error) + return "sourceImageEncryptionKey." + error; + } + } + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + properties._sourceSnapshot = 1; + if (!$util.isString(message.sourceSnapshot)) + return "sourceSnapshot: string expected"; + } + if (message.sourceSnapshotEncryptionKey != null && message.hasOwnProperty("sourceSnapshotEncryptionKey")) { + properties._sourceSnapshotEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceSnapshotEncryptionKey); + if (error) + return "sourceSnapshotEncryptionKey." + error; + } + } + return null; + }; + + /** + * Creates an AttachedDiskInitializeParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AttachedDiskInitializeParams} AttachedDiskInitializeParams + */ + AttachedDiskInitializeParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AttachedDiskInitializeParams) + return object; + var message = new $root.google.cloud.compute.v1.AttachedDiskInitializeParams(); + if (object.description != null) + message.description = String(object.description); + if (object.diskName != null) + message.diskName = String(object.diskName); + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + if (object.diskType != null) + message.diskType = String(object.diskType); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.AttachedDiskInitializeParams.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]]); + } + switch (object.onUpdateAction) { + case "UNDEFINED_ON_UPDATE_ACTION": + case 0: + message.onUpdateAction = 0; + break; + case "RECREATE_DISK": + case 494767853: + message.onUpdateAction = 494767853; + break; + case "RECREATE_DISK_IF_SOURCE_CHANGED": + case 398099712: + message.onUpdateAction = 398099712; + break; + case "USE_EXISTING_DISK": + case 232682233: + message.onUpdateAction = 232682233; + break; + } + if (object.provisionedIops != null) + if ($util.Long) + (message.provisionedIops = $util.Long.fromValue(object.provisionedIops)).unsigned = false; + else if (typeof object.provisionedIops === "string") + message.provisionedIops = parseInt(object.provisionedIops, 10); + else if (typeof object.provisionedIops === "number") + message.provisionedIops = object.provisionedIops; + else if (typeof object.provisionedIops === "object") + message.provisionedIops = new $util.LongBits(object.provisionedIops.low >>> 0, object.provisionedIops.high >>> 0).toNumber(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.AttachedDiskInitializeParams.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + if (object.sourceImage != null) + message.sourceImage = String(object.sourceImage); + if (object.sourceImageEncryptionKey != null) { + if (typeof object.sourceImageEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.AttachedDiskInitializeParams.sourceImageEncryptionKey: object expected"); + message.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceImageEncryptionKey); + } + if (object.sourceSnapshot != null) + message.sourceSnapshot = String(object.sourceSnapshot); + if (object.sourceSnapshotEncryptionKey != null) { + if (typeof object.sourceSnapshotEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.AttachedDiskInitializeParams.sourceSnapshotEncryptionKey: object expected"); + message.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceSnapshotEncryptionKey); + } + return message; + }; + + /** + * Creates a plain object from an AttachedDiskInitializeParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @static + * @param {google.cloud.compute.v1.AttachedDiskInitializeParams} message AttachedDiskInitializeParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDiskInitializeParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (options.objects || options.defaults) + object.labels = {}; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + object.sourceImage = message.sourceImage; + if (options.oneofs) + object._sourceImage = "sourceImage"; + } + if (message.diskName != null && message.hasOwnProperty("diskName")) { + object.diskName = message.diskName; + if (options.oneofs) + object._diskName = "diskName"; + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + object.diskType = message.diskType; + if (options.oneofs) + object._diskType = "diskType"; + } + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + object.sourceSnapshot = message.sourceSnapshot; + if (options.oneofs) + object._sourceSnapshot = "sourceSnapshot"; + } + if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { + if (typeof message.provisionedIops === "number") + object.provisionedIops = options.longs === String ? String(message.provisionedIops) : message.provisionedIops; + else + object.provisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.provisionedIops) : options.longs === Number ? new $util.LongBits(message.provisionedIops.low >>> 0, message.provisionedIops.high >>> 0).toNumber() : message.provisionedIops; + if (options.oneofs) + object._provisionedIops = "provisionedIops"; + } + if (message.onUpdateAction != null && message.hasOwnProperty("onUpdateAction")) { + object.onUpdateAction = options.enums === String ? $root.google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction[message.onUpdateAction] : message.onUpdateAction; + if (options.oneofs) + object._onUpdateAction = "onUpdateAction"; + } + if (message.sourceSnapshotEncryptionKey != null && message.hasOwnProperty("sourceSnapshotEncryptionKey")) { + object.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceSnapshotEncryptionKey, options); + if (options.oneofs) + object._sourceSnapshotEncryptionKey = "sourceSnapshotEncryptionKey"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message.sourceImageEncryptionKey != null && message.hasOwnProperty("sourceImageEncryptionKey")) { + object.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceImageEncryptionKey, options); + if (options.oneofs) + object._sourceImageEncryptionKey = "sourceImageEncryptionKey"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + 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 AttachedDiskInitializeParams to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AttachedDiskInitializeParams + * @instance + * @returns {Object.} JSON object + */ + AttachedDiskInitializeParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OnUpdateAction enum. + * @name google.cloud.compute.v1.AttachedDiskInitializeParams.OnUpdateAction + * @enum {number} + * @property {number} UNDEFINED_ON_UPDATE_ACTION=0 UNDEFINED_ON_UPDATE_ACTION value + * @property {number} RECREATE_DISK=494767853 RECREATE_DISK value + * @property {number} RECREATE_DISK_IF_SOURCE_CHANGED=398099712 RECREATE_DISK_IF_SOURCE_CHANGED value + * @property {number} USE_EXISTING_DISK=232682233 USE_EXISTING_DISK value + */ + AttachedDiskInitializeParams.OnUpdateAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ON_UPDATE_ACTION"] = 0; + values[valuesById[494767853] = "RECREATE_DISK"] = 494767853; + values[valuesById[398099712] = "RECREATE_DISK_IF_SOURCE_CHANGED"] = 398099712; + values[valuesById[232682233] = "USE_EXISTING_DISK"] = 232682233; + return values; + })(); + + return AttachedDiskInitializeParams; + })(); + + v1.InitialStateConfig = (function() { + + /** + * Properties of an InitialStateConfig. + * @memberof google.cloud.compute.v1 + * @interface IInitialStateConfig + * @property {Array.|null} [dbs] InitialStateConfig dbs + * @property {Array.|null} [dbxs] InitialStateConfig dbxs + * @property {Array.|null} [keks] InitialStateConfig keks + * @property {google.cloud.compute.v1.IFileContentBuffer|null} [pk] InitialStateConfig pk + */ + + /** + * Constructs a new InitialStateConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InitialStateConfig. + * @implements IInitialStateConfig + * @constructor + * @param {google.cloud.compute.v1.IInitialStateConfig=} [properties] Properties to set + */ + function InitialStateConfig(properties) { + this.dbs = []; + this.dbxs = []; + this.keks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InitialStateConfig dbs. + * @member {Array.} dbs + * @memberof google.cloud.compute.v1.InitialStateConfig + * @instance + */ + InitialStateConfig.prototype.dbs = $util.emptyArray; + + /** + * InitialStateConfig dbxs. + * @member {Array.} dbxs + * @memberof google.cloud.compute.v1.InitialStateConfig + * @instance + */ + InitialStateConfig.prototype.dbxs = $util.emptyArray; + + /** + * InitialStateConfig keks. + * @member {Array.} keks + * @memberof google.cloud.compute.v1.InitialStateConfig + * @instance + */ + InitialStateConfig.prototype.keks = $util.emptyArray; + + /** + * InitialStateConfig pk. + * @member {google.cloud.compute.v1.IFileContentBuffer|null|undefined} pk + * @memberof google.cloud.compute.v1.InitialStateConfig + * @instance + */ + InitialStateConfig.prototype.pk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InitialStateConfig _pk. + * @member {"pk"|undefined} _pk + * @memberof google.cloud.compute.v1.InitialStateConfig + * @instance + */ + Object.defineProperty(InitialStateConfig.prototype, "_pk", { + get: $util.oneOfGetter($oneOfFields = ["pk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InitialStateConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {google.cloud.compute.v1.IInitialStateConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InitialStateConfig} InitialStateConfig instance + */ + InitialStateConfig.create = function create(properties) { + return new InitialStateConfig(properties); + }; + + /** + * Encodes the specified InitialStateConfig message. Does not implicitly {@link google.cloud.compute.v1.InitialStateConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {google.cloud.compute.v1.IInitialStateConfig} message InitialStateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitialStateConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pk != null && Object.hasOwnProperty.call(message, "pk")) + $root.google.cloud.compute.v1.FileContentBuffer.encode(message.pk, writer.uint32(/* id 3579, wireType 2 =*/28634).fork()).ldelim(); + if (message.dbs != null && message.dbs.length) + for (var i = 0; i < message.dbs.length; ++i) + $root.google.cloud.compute.v1.FileContentBuffer.encode(message.dbs[i], writer.uint32(/* id 99253, wireType 2 =*/794026).fork()).ldelim(); + if (message.dbxs != null && message.dbxs.length) + for (var i = 0; i < message.dbxs.length; ++i) + $root.google.cloud.compute.v1.FileContentBuffer.encode(message.dbxs[i], writer.uint32(/* id 3077113, wireType 2 =*/24616906).fork()).ldelim(); + if (message.keks != null && message.keks.length) + for (var i = 0; i < message.keks.length; ++i) + $root.google.cloud.compute.v1.FileContentBuffer.encode(message.keks[i], writer.uint32(/* id 3288130, wireType 2 =*/26305042).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InitialStateConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InitialStateConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {google.cloud.compute.v1.IInitialStateConfig} message InitialStateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitialStateConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitialStateConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InitialStateConfig} InitialStateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitialStateConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InitialStateConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 99253: + if (!(message.dbs && message.dbs.length)) + message.dbs = []; + message.dbs.push($root.google.cloud.compute.v1.FileContentBuffer.decode(reader, reader.uint32())); + break; + case 3077113: + if (!(message.dbxs && message.dbxs.length)) + message.dbxs = []; + message.dbxs.push($root.google.cloud.compute.v1.FileContentBuffer.decode(reader, reader.uint32())); + break; + case 3288130: + if (!(message.keks && message.keks.length)) + message.keks = []; + message.keks.push($root.google.cloud.compute.v1.FileContentBuffer.decode(reader, reader.uint32())); + break; + case 3579: + message.pk = $root.google.cloud.compute.v1.FileContentBuffer.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitialStateConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InitialStateConfig} InitialStateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitialStateConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitialStateConfig message. + * @function verify + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitialStateConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dbs != null && message.hasOwnProperty("dbs")) { + if (!Array.isArray(message.dbs)) + return "dbs: array expected"; + for (var i = 0; i < message.dbs.length; ++i) { + var error = $root.google.cloud.compute.v1.FileContentBuffer.verify(message.dbs[i]); + if (error) + return "dbs." + error; + } + } + if (message.dbxs != null && message.hasOwnProperty("dbxs")) { + if (!Array.isArray(message.dbxs)) + return "dbxs: array expected"; + for (var i = 0; i < message.dbxs.length; ++i) { + var error = $root.google.cloud.compute.v1.FileContentBuffer.verify(message.dbxs[i]); + if (error) + return "dbxs." + error; + } + } + if (message.keks != null && message.hasOwnProperty("keks")) { + if (!Array.isArray(message.keks)) + return "keks: array expected"; + for (var i = 0; i < message.keks.length; ++i) { + var error = $root.google.cloud.compute.v1.FileContentBuffer.verify(message.keks[i]); + if (error) + return "keks." + error; + } + } + if (message.pk != null && message.hasOwnProperty("pk")) { + properties._pk = 1; + { + var error = $root.google.cloud.compute.v1.FileContentBuffer.verify(message.pk); + if (error) + return "pk." + error; + } + } + return null; + }; + + /** + * Creates an InitialStateConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InitialStateConfig} InitialStateConfig + */ + InitialStateConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InitialStateConfig) + return object; + var message = new $root.google.cloud.compute.v1.InitialStateConfig(); + if (object.dbs) { + if (!Array.isArray(object.dbs)) + throw TypeError(".google.cloud.compute.v1.InitialStateConfig.dbs: array expected"); + message.dbs = []; + for (var i = 0; i < object.dbs.length; ++i) { + if (typeof object.dbs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InitialStateConfig.dbs: object expected"); + message.dbs[i] = $root.google.cloud.compute.v1.FileContentBuffer.fromObject(object.dbs[i]); + } + } + if (object.dbxs) { + if (!Array.isArray(object.dbxs)) + throw TypeError(".google.cloud.compute.v1.InitialStateConfig.dbxs: array expected"); + message.dbxs = []; + for (var i = 0; i < object.dbxs.length; ++i) { + if (typeof object.dbxs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InitialStateConfig.dbxs: object expected"); + message.dbxs[i] = $root.google.cloud.compute.v1.FileContentBuffer.fromObject(object.dbxs[i]); + } + } + if (object.keks) { + if (!Array.isArray(object.keks)) + throw TypeError(".google.cloud.compute.v1.InitialStateConfig.keks: array expected"); + message.keks = []; + for (var i = 0; i < object.keks.length; ++i) { + if (typeof object.keks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InitialStateConfig.keks: object expected"); + message.keks[i] = $root.google.cloud.compute.v1.FileContentBuffer.fromObject(object.keks[i]); + } + } + if (object.pk != null) { + if (typeof object.pk !== "object") + throw TypeError(".google.cloud.compute.v1.InitialStateConfig.pk: object expected"); + message.pk = $root.google.cloud.compute.v1.FileContentBuffer.fromObject(object.pk); + } + return message; + }; + + /** + * Creates a plain object from an InitialStateConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InitialStateConfig + * @static + * @param {google.cloud.compute.v1.InitialStateConfig} message InitialStateConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitialStateConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dbs = []; + object.dbxs = []; + object.keks = []; + } + if (message.pk != null && message.hasOwnProperty("pk")) { + object.pk = $root.google.cloud.compute.v1.FileContentBuffer.toObject(message.pk, options); + if (options.oneofs) + object._pk = "pk"; + } + if (message.dbs && message.dbs.length) { + object.dbs = []; + for (var j = 0; j < message.dbs.length; ++j) + object.dbs[j] = $root.google.cloud.compute.v1.FileContentBuffer.toObject(message.dbs[j], options); + } + if (message.dbxs && message.dbxs.length) { + object.dbxs = []; + for (var j = 0; j < message.dbxs.length; ++j) + object.dbxs[j] = $root.google.cloud.compute.v1.FileContentBuffer.toObject(message.dbxs[j], options); + } + if (message.keks && message.keks.length) { + object.keks = []; + for (var j = 0; j < message.keks.length; ++j) + object.keks[j] = $root.google.cloud.compute.v1.FileContentBuffer.toObject(message.keks[j], options); + } + return object; + }; + + /** + * Converts this InitialStateConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InitialStateConfig + * @instance + * @returns {Object.} JSON object + */ + InitialStateConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InitialStateConfig; + })(); + + v1.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.compute.v1 + * @interface IAttachedDisk + * @property {boolean|null} [autoDelete] AttachedDisk autoDelete + * @property {boolean|null} [boot] AttachedDisk boot + * @property {string|null} [deviceName] AttachedDisk deviceName + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] AttachedDisk diskEncryptionKey + * @property {number|Long|null} [diskSizeGb] AttachedDisk diskSizeGb + * @property {Array.|null} [guestOsFeatures] AttachedDisk guestOsFeatures + * @property {number|null} [index] AttachedDisk index + * @property {google.cloud.compute.v1.IAttachedDiskInitializeParams|null} [initializeParams] AttachedDisk initializeParams + * @property {google.cloud.compute.v1.AttachedDisk.Interface|null} ["interface"] AttachedDisk interface + * @property {string|null} [kind] AttachedDisk kind + * @property {Array.|null} [licenses] AttachedDisk licenses + * @property {google.cloud.compute.v1.AttachedDisk.Mode|null} [mode] AttachedDisk mode + * @property {google.cloud.compute.v1.IInitialStateConfig|null} [shieldedInstanceInitialState] AttachedDisk shieldedInstanceInitialState + * @property {string|null} [source] AttachedDisk source + * @property {google.cloud.compute.v1.AttachedDisk.Type|null} [type] AttachedDisk type + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.compute.v1.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + this.guestOsFeatures = []; + this.licenses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDisk autoDelete. + * @member {boolean|null|undefined} autoDelete + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.autoDelete = null; + + /** + * AttachedDisk boot. + * @member {boolean|null|undefined} boot + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.boot = null; + + /** + * AttachedDisk deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = null; + + /** + * AttachedDisk diskEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskEncryptionKey = null; + + /** + * AttachedDisk diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskSizeGb = null; + + /** + * AttachedDisk guestOsFeatures. + * @member {Array.} guestOsFeatures + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.guestOsFeatures = $util.emptyArray; + + /** + * AttachedDisk index. + * @member {number|null|undefined} index + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.index = null; + + /** + * AttachedDisk initializeParams. + * @member {google.cloud.compute.v1.IAttachedDiskInitializeParams|null|undefined} initializeParams + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.initializeParams = null; + + /** + * AttachedDisk interface. + * @member {google.cloud.compute.v1.AttachedDisk.Interface|null|undefined} interface + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype["interface"] = null; + + /** + * AttachedDisk kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.kind = null; + + /** + * AttachedDisk licenses. + * @member {Array.} licenses + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.licenses = $util.emptyArray; + + /** + * AttachedDisk mode. + * @member {google.cloud.compute.v1.AttachedDisk.Mode|null|undefined} mode + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.mode = null; + + /** + * AttachedDisk shieldedInstanceInitialState. + * @member {google.cloud.compute.v1.IInitialStateConfig|null|undefined} shieldedInstanceInitialState + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.shieldedInstanceInitialState = null; + + /** + * AttachedDisk source. + * @member {string|null|undefined} source + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.source = null; + + /** + * AttachedDisk type. + * @member {google.cloud.compute.v1.AttachedDisk.Type|null|undefined} type + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDisk _autoDelete. + * @member {"autoDelete"|undefined} _autoDelete + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_autoDelete", { + get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _boot. + * @member {"boot"|undefined} _boot + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_boot", { + get: $util.oneOfGetter($oneOfFields = ["boot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _deviceName. + * @member {"deviceName"|undefined} _deviceName + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_deviceName", { + get: $util.oneOfGetter($oneOfFields = ["deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskEncryptionKey. + * @member {"diskEncryptionKey"|undefined} _diskEncryptionKey + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _index. + * @member {"index"|undefined} _index + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _initializeParams. + * @member {"initializeParams"|undefined} _initializeParams + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_initializeParams", { + get: $util.oneOfGetter($oneOfFields = ["initializeParams"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _interface. + * @member {"interface"|undefined} _interface + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_interface", { + get: $util.oneOfGetter($oneOfFields = ["interface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _mode. + * @member {"mode"|undefined} _mode + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _shieldedInstanceInitialState. + * @member {"shieldedInstanceInitialState"|undefined} _shieldedInstanceInitialState + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_shieldedInstanceInitialState", { + get: $util.oneOfGetter($oneOfFields = ["shieldedInstanceInitialState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {google.cloud.compute.v1.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.compute.v1.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {google.cloud.compute.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.boot != null && Object.hasOwnProperty.call(message, "boot")) + writer.uint32(/* id 3029746, wireType 0 =*/24237968).bool(message.boot); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3357091, wireType 0 =*/26856728).int32(message.mode); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.initializeParams != null && Object.hasOwnProperty.call(message, "initializeParams")) + $root.google.cloud.compute.v1.AttachedDiskInitializeParams.encode(message.initializeParams, writer.uint32(/* id 17697045, wireType 2 =*/141576362).fork()).ldelim(); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 67541716, wireType 2 =*/540333730).string(message.deviceName); + if (message.guestOsFeatures != null && message.guestOsFeatures.length) + for (var i = 0; i < message.guestOsFeatures.length; ++i) + $root.google.cloud.compute.v1.GuestOsFeature.encode(message.guestOsFeatures[i], writer.uint32(/* id 79294545, wireType 2 =*/634356362).fork()).ldelim(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 100346066, wireType 0 =*/802768528).int32(message.index); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 177235995, wireType 2 =*/1417887962).string(message.source); + if (message.shieldedInstanceInitialState != null && Object.hasOwnProperty.call(message, "shieldedInstanceInitialState")) + $root.google.cloud.compute.v1.InitialStateConfig.encode(message.shieldedInstanceInitialState, writer.uint32(/* id 192356867, wireType 2 =*/1538854938).fork()).ldelim(); + if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 271660677, wireType 2 =*/2173285418).fork()).ldelim(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 316263735, wireType 0 =*/2530109880).int64(message.diskSizeGb); + if (message.licenses != null && message.licenses.length) + for (var i = 0; i < message.licenses.length; ++i) + writer.uint32(/* id 337642578, wireType 2 =*/2701140626).string(message.licenses[i]); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 464761403, wireType 0 =*/3718091224).bool(message.autoDelete); + if (message["interface"] != null && Object.hasOwnProperty.call(message, "interface")) + writer.uint32(/* id 502623545, wireType 0 =*/4020988360).int32(message["interface"]); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {google.cloud.compute.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 464761403: + message.autoDelete = reader.bool(); + break; + case 3029746: + message.boot = reader.bool(); + break; + case 67541716: + message.deviceName = reader.string(); + break; + case 271660677: + message.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 316263735: + message.diskSizeGb = reader.int64(); + break; + case 79294545: + if (!(message.guestOsFeatures && message.guestOsFeatures.length)) + message.guestOsFeatures = []; + message.guestOsFeatures.push($root.google.cloud.compute.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + case 100346066: + message.index = reader.int32(); + break; + case 17697045: + message.initializeParams = $root.google.cloud.compute.v1.AttachedDiskInitializeParams.decode(reader, reader.uint32()); + break; + case 502623545: + message["interface"] = reader.int32(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 337642578: + if (!(message.licenses && message.licenses.length)) + message.licenses = []; + message.licenses.push(reader.string()); + break; + case 3357091: + message.mode = reader.int32(); + break; + case 192356867: + message.shieldedInstanceInitialState = $root.google.cloud.compute.v1.InitialStateConfig.decode(reader, reader.uint32()); + break; + case 177235995: + message.source = reader.string(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + properties._autoDelete = 1; + if (typeof message.autoDelete !== "boolean") + return "autoDelete: boolean expected"; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + properties._boot = 1; + if (typeof message.boot !== "boolean") + return "boot: boolean expected"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + properties._deviceName = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + properties._diskEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); + if (error) + return "diskEncryptionKey." + error; + } + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message.guestOsFeatures != null && message.hasOwnProperty("guestOsFeatures")) { + if (!Array.isArray(message.guestOsFeatures)) + return "guestOsFeatures: array expected"; + for (var i = 0; i < message.guestOsFeatures.length; ++i) { + var error = $root.google.cloud.compute.v1.GuestOsFeature.verify(message.guestOsFeatures[i]); + if (error) + return "guestOsFeatures." + error; + } + } + if (message.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isInteger(message.index)) + return "index: integer expected"; + } + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + properties._initializeParams = 1; + { + var error = $root.google.cloud.compute.v1.AttachedDiskInitializeParams.verify(message.initializeParams); + if (error) + return "initializeParams." + error; + } + } + if (message["interface"] != null && message.hasOwnProperty("interface")) { + properties._interface = 1; + switch (message["interface"]) { + default: + return "interface: enum value expected"; + case 0: + case 2408800: + case 2539686: + break; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.licenses != null && message.hasOwnProperty("licenses")) { + if (!Array.isArray(message.licenses)) + return "licenses: array expected"; + for (var i = 0; i < message.licenses.length; ++i) + if (!$util.isString(message.licenses[i])) + return "licenses: string[] expected"; + } + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 91950261: + case 173607894: + break; + } + } + if (message.shieldedInstanceInitialState != null && message.hasOwnProperty("shieldedInstanceInitialState")) { + properties._shieldedInstanceInitialState = 1; + { + var error = $root.google.cloud.compute.v1.InitialStateConfig.verify(message.shieldedInstanceInitialState); + if (error) + return "shieldedInstanceInitialState." + error; + } + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 460683927: + case 496778970: + break; + } + } + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AttachedDisk) + return object; + var message = new $root.google.cloud.compute.v1.AttachedDisk(); + if (object.autoDelete != null) + message.autoDelete = Boolean(object.autoDelete); + if (object.boot != null) + message.boot = Boolean(object.boot); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.diskEncryptionKey != null) { + if (typeof object.diskEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.AttachedDisk.diskEncryptionKey: object expected"); + message.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); + } + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + if (object.guestOsFeatures) { + if (!Array.isArray(object.guestOsFeatures)) + throw TypeError(".google.cloud.compute.v1.AttachedDisk.guestOsFeatures: array expected"); + message.guestOsFeatures = []; + for (var i = 0; i < object.guestOsFeatures.length; ++i) { + if (typeof object.guestOsFeatures[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AttachedDisk.guestOsFeatures: object expected"); + message.guestOsFeatures[i] = $root.google.cloud.compute.v1.GuestOsFeature.fromObject(object.guestOsFeatures[i]); + } + } + if (object.index != null) + message.index = object.index | 0; + if (object.initializeParams != null) { + if (typeof object.initializeParams !== "object") + throw TypeError(".google.cloud.compute.v1.AttachedDisk.initializeParams: object expected"); + message.initializeParams = $root.google.cloud.compute.v1.AttachedDiskInitializeParams.fromObject(object.initializeParams); + } + switch (object["interface"]) { + case "UNDEFINED_INTERFACE": + case 0: + message["interface"] = 0; + break; + case "NVME": + case 2408800: + message["interface"] = 2408800; + break; + case "SCSI": + case 2539686: + message["interface"] = 2539686; + break; + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.licenses) { + if (!Array.isArray(object.licenses)) + throw TypeError(".google.cloud.compute.v1.AttachedDisk.licenses: array expected"); + message.licenses = []; + for (var i = 0; i < object.licenses.length; ++i) + message.licenses[i] = String(object.licenses[i]); + } + switch (object.mode) { + case "UNDEFINED_MODE": + case 0: + message.mode = 0; + break; + case "READ_ONLY": + case 91950261: + message.mode = 91950261; + break; + case "READ_WRITE": + case 173607894: + message.mode = 173607894; + break; + } + if (object.shieldedInstanceInitialState != null) { + if (typeof object.shieldedInstanceInitialState !== "object") + throw TypeError(".google.cloud.compute.v1.AttachedDisk.shieldedInstanceInitialState: object expected"); + message.shieldedInstanceInitialState = $root.google.cloud.compute.v1.InitialStateConfig.fromObject(object.shieldedInstanceInitialState); + } + if (object.source != null) + message.source = String(object.source); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "PERSISTENT": + case 460683927: + message.type = 460683927; + break; + case "SCRATCH": + case 496778970: + message.type = 496778970; + break; + } + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AttachedDisk + * @static + * @param {google.cloud.compute.v1.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.guestOsFeatures = []; + object.licenses = []; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + object.boot = message.boot; + if (options.oneofs) + object._boot = "boot"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.cloud.compute.v1.AttachedDisk.Mode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.AttachedDisk.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + object.initializeParams = $root.google.cloud.compute.v1.AttachedDiskInitializeParams.toObject(message.initializeParams, options); + if (options.oneofs) + object._initializeParams = "initializeParams"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object._deviceName = "deviceName"; + } + if (message.guestOsFeatures && message.guestOsFeatures.length) { + object.guestOsFeatures = []; + for (var j = 0; j < message.guestOsFeatures.length; ++j) + object.guestOsFeatures[j] = $root.google.cloud.compute.v1.GuestOsFeature.toObject(message.guestOsFeatures[j], options); + } + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object._index = "index"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.shieldedInstanceInitialState != null && message.hasOwnProperty("shieldedInstanceInitialState")) { + object.shieldedInstanceInitialState = $root.google.cloud.compute.v1.InitialStateConfig.toObject(message.shieldedInstanceInitialState, options); + if (options.oneofs) + object._shieldedInstanceInitialState = "shieldedInstanceInitialState"; + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + object.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); + if (options.oneofs) + object._diskEncryptionKey = "diskEncryptionKey"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message.licenses && message.licenses.length) { + object.licenses = []; + for (var j = 0; j < message.licenses.length; ++j) + object.licenses[j] = message.licenses[j]; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + object.autoDelete = message.autoDelete; + if (options.oneofs) + object._autoDelete = "autoDelete"; + } + if (message["interface"] != null && message.hasOwnProperty("interface")) { + object["interface"] = options.enums === String ? $root.google.cloud.compute.v1.AttachedDisk.Interface[message["interface"]] : message["interface"]; + if (options.oneofs) + object._interface = "interface"; + } + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Interface enum. + * @name google.cloud.compute.v1.AttachedDisk.Interface + * @enum {number} + * @property {number} UNDEFINED_INTERFACE=0 UNDEFINED_INTERFACE value + * @property {number} NVME=2408800 NVME value + * @property {number} SCSI=2539686 SCSI value + */ + AttachedDisk.Interface = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_INTERFACE"] = 0; + values[valuesById[2408800] = "NVME"] = 2408800; + values[valuesById[2539686] = "SCSI"] = 2539686; + return values; + })(); + + /** + * Mode enum. + * @name google.cloud.compute.v1.AttachedDisk.Mode + * @enum {number} + * @property {number} UNDEFINED_MODE=0 UNDEFINED_MODE value + * @property {number} READ_ONLY=91950261 READ_ONLY value + * @property {number} READ_WRITE=173607894 READ_WRITE value + */ + AttachedDisk.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MODE"] = 0; + values[valuesById[91950261] = "READ_ONLY"] = 91950261; + values[valuesById[173607894] = "READ_WRITE"] = 173607894; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.compute.v1.AttachedDisk.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} PERSISTENT=460683927 PERSISTENT value + * @property {number} SCRATCH=496778970 SCRATCH value + */ + AttachedDisk.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[460683927] = "PERSISTENT"] = 460683927; + values[valuesById[496778970] = "SCRATCH"] = 496778970; + return values; + })(); + + return AttachedDisk; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.cloud.compute.v1 + * @interface IAuditLogConfig + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + * @property {boolean|null} [ignoreChildExemptions] AuditLogConfig ignoreChildExemptions + * @property {google.cloud.compute.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.cloud.compute.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 exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.cloud.compute.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * AuditLogConfig ignoreChildExemptions. + * @member {boolean|null|undefined} ignoreChildExemptions + * @memberof google.cloud.compute.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.ignoreChildExemptions = null; + + /** + * AuditLogConfig logType. + * @member {google.cloud.compute.v1.AuditLogConfig.LogType|null|undefined} logType + * @memberof google.cloud.compute.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuditLogConfig _ignoreChildExemptions. + * @member {"ignoreChildExemptions"|undefined} _ignoreChildExemptions + * @memberof google.cloud.compute.v1.AuditLogConfig + * @instance + */ + Object.defineProperty(AuditLogConfig.prototype, "_ignoreChildExemptions", { + get: $util.oneOfGetter($oneOfFields = ["ignoreChildExemptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AuditLogConfig _logType. + * @member {"logType"|undefined} _logType + * @memberof google.cloud.compute.v1.AuditLogConfig + * @instance + */ + Object.defineProperty(AuditLogConfig.prototype, "_logType", { + get: $util.oneOfGetter($oneOfFields = ["logType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AuditLogConfig + * @static + * @param {google.cloud.compute.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.cloud.compute.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AuditLogConfig + * @static + * @param {google.cloud.compute.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.ignoreChildExemptions != null && Object.hasOwnProperty.call(message, "ignoreChildExemptions")) + writer.uint32(/* id 70141850, wireType 0 =*/561134800).bool(message.ignoreChildExemptions); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 232615576, wireType 2 =*/1860924610).string(message.exemptedMembers[i]); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 403115861, wireType 0 =*/3224926888).int32(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AuditLogConfig + * @static + * @param {google.cloud.compute.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.cloud.compute.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.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.cloud.compute.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232615576: + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + case 70141850: + message.ignoreChildExemptions = reader.bool(); + break; + case 403115861: + message.logType = reader.int32(); + 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.cloud.compute.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.cloud.compute.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"; + var properties = {}; + 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"; + } + if (message.ignoreChildExemptions != null && message.hasOwnProperty("ignoreChildExemptions")) { + properties._ignoreChildExemptions = 1; + if (typeof message.ignoreChildExemptions !== "boolean") + return "ignoreChildExemptions: boolean expected"; + } + if (message.logType != null && message.hasOwnProperty("logType")) { + properties._logType = 1; + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 128951462: + case 305224971: + case 340181738: + case 154527053: + break; + } + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AuditLogConfig) + return object; + var message = new $root.google.cloud.compute.v1.AuditLogConfig(); + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.cloud.compute.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + if (object.ignoreChildExemptions != null) + message.ignoreChildExemptions = Boolean(object.ignoreChildExemptions); + switch (object.logType) { + case "UNDEFINED_LOG_TYPE": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 128951462: + message.logType = 128951462; + break; + case "DATA_READ": + case 305224971: + message.logType = 305224971; + break; + case "DATA_WRITE": + case 340181738: + message.logType = 340181738; + break; + case "LOG_TYPE_UNSPECIFIED": + case 154527053: + message.logType = 154527053; + break; + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AuditLogConfig + * @static + * @param {google.cloud.compute.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 (message.ignoreChildExemptions != null && message.hasOwnProperty("ignoreChildExemptions")) { + object.ignoreChildExemptions = message.ignoreChildExemptions; + if (options.oneofs) + object._ignoreChildExemptions = "ignoreChildExemptions"; + } + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + if (message.logType != null && message.hasOwnProperty("logType")) { + object.logType = options.enums === String ? $root.google.cloud.compute.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (options.oneofs) + object._logType = "logType"; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * LogType enum. + * @name google.cloud.compute.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} UNDEFINED_LOG_TYPE=0 UNDEFINED_LOG_TYPE value + * @property {number} ADMIN_READ=128951462 ADMIN_READ value + * @property {number} DATA_READ=305224971 DATA_READ value + * @property {number} DATA_WRITE=340181738 DATA_WRITE value + * @property {number} LOG_TYPE_UNSPECIFIED=154527053 LOG_TYPE_UNSPECIFIED value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LOG_TYPE"] = 0; + values[valuesById[128951462] = "ADMIN_READ"] = 128951462; + values[valuesById[305224971] = "DATA_READ"] = 305224971; + values[valuesById[340181738] = "DATA_WRITE"] = 340181738; + values[valuesById[154527053] = "LOG_TYPE_UNSPECIFIED"] = 154527053; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.cloud.compute.v1 + * @interface IAuditConfig + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + * @property {Array.|null} [exemptedMembers] AuditConfig exemptedMembers + * @property {string|null} [service] AuditConfig service + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.cloud.compute.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.cloud.compute.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * AuditConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.cloud.compute.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * AuditConfig service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuditConfig _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.AuditConfig + * @instance + */ + Object.defineProperty(AuditConfig.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AuditConfig + * @static + * @param {google.cloud.compute.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.cloud.compute.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AuditConfig + * @static + * @param {google.cloud.compute.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.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 232615576, wireType 2 =*/1860924610).string(message.exemptedMembers[i]); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.cloud.compute.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 488420626, wireType 2 =*/3907365010).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AuditConfig + * @static + * @param {google.cloud.compute.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.cloud.compute.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.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.cloud.compute.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 488420626: + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.cloud.compute.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + case 232615576: + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + case 373540533: + message.service = reader.string(); + 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.cloud.compute.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.cloud.compute.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"; + var properties = {}; + 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.cloud.compute.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + 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"; + } + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AuditConfig) + return object; + var message = new $root.google.cloud.compute.v1.AuditConfig(); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.cloud.compute.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.cloud.compute.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.cloud.compute.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.cloud.compute.v1.AuditConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AuditConfig + * @static + * @param {google.cloud.compute.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.exemptedMembers = []; + object.auditLogConfigs = []; + } + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.cloud.compute.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AuditConfig; + })(); + + v1.AuthorizationLoggingOptions = (function() { + + /** + * Properties of an AuthorizationLoggingOptions. + * @memberof google.cloud.compute.v1 + * @interface IAuthorizationLoggingOptions + * @property {google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType|null} [permissionType] AuthorizationLoggingOptions permissionType + */ + + /** + * Constructs a new AuthorizationLoggingOptions. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AuthorizationLoggingOptions. + * @implements IAuthorizationLoggingOptions + * @constructor + * @param {google.cloud.compute.v1.IAuthorizationLoggingOptions=} [properties] Properties to set + */ + function AuthorizationLoggingOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthorizationLoggingOptions permissionType. + * @member {google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType|null|undefined} permissionType + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @instance + */ + AuthorizationLoggingOptions.prototype.permissionType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AuthorizationLoggingOptions _permissionType. + * @member {"permissionType"|undefined} _permissionType + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @instance + */ + Object.defineProperty(AuthorizationLoggingOptions.prototype, "_permissionType", { + get: $util.oneOfGetter($oneOfFields = ["permissionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AuthorizationLoggingOptions instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {google.cloud.compute.v1.IAuthorizationLoggingOptions=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AuthorizationLoggingOptions} AuthorizationLoggingOptions instance + */ + AuthorizationLoggingOptions.create = function create(properties) { + return new AuthorizationLoggingOptions(properties); + }; + + /** + * Encodes the specified AuthorizationLoggingOptions message. Does not implicitly {@link google.cloud.compute.v1.AuthorizationLoggingOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {google.cloud.compute.v1.IAuthorizationLoggingOptions} message AuthorizationLoggingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationLoggingOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissionType != null && Object.hasOwnProperty.call(message, "permissionType")) + writer.uint32(/* id 525978538, wireType 0 =*/4207828304).int32(message.permissionType); + return writer; + }; + + /** + * Encodes the specified AuthorizationLoggingOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AuthorizationLoggingOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {google.cloud.compute.v1.IAuthorizationLoggingOptions} message AuthorizationLoggingOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthorizationLoggingOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthorizationLoggingOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AuthorizationLoggingOptions} AuthorizationLoggingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationLoggingOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AuthorizationLoggingOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 525978538: + message.permissionType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthorizationLoggingOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AuthorizationLoggingOptions} AuthorizationLoggingOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthorizationLoggingOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthorizationLoggingOptions message. + * @function verify + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthorizationLoggingOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.permissionType != null && message.hasOwnProperty("permissionType")) { + properties._permissionType = 1; + switch (message.permissionType) { + default: + return "permissionType: enum value expected"; + case 0: + case 128951462: + case 244412079: + case 305224971: + case 340181738: + case 440313346: + break; + } + } + return null; + }; + + /** + * Creates an AuthorizationLoggingOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AuthorizationLoggingOptions} AuthorizationLoggingOptions + */ + AuthorizationLoggingOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AuthorizationLoggingOptions) + return object; + var message = new $root.google.cloud.compute.v1.AuthorizationLoggingOptions(); + switch (object.permissionType) { + case "UNDEFINED_PERMISSION_TYPE": + case 0: + message.permissionType = 0; + break; + case "ADMIN_READ": + case 128951462: + message.permissionType = 128951462; + break; + case "ADMIN_WRITE": + case 244412079: + message.permissionType = 244412079; + break; + case "DATA_READ": + case 305224971: + message.permissionType = 305224971; + break; + case "DATA_WRITE": + case 340181738: + message.permissionType = 340181738; + break; + case "PERMISSION_TYPE_UNSPECIFIED": + case 440313346: + message.permissionType = 440313346; + break; + } + return message; + }; + + /** + * Creates a plain object from an AuthorizationLoggingOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @static + * @param {google.cloud.compute.v1.AuthorizationLoggingOptions} message AuthorizationLoggingOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthorizationLoggingOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.permissionType != null && message.hasOwnProperty("permissionType")) { + object.permissionType = options.enums === String ? $root.google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType[message.permissionType] : message.permissionType; + if (options.oneofs) + object._permissionType = "permissionType"; + } + return object; + }; + + /** + * Converts this AuthorizationLoggingOptions to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AuthorizationLoggingOptions + * @instance + * @returns {Object.} JSON object + */ + AuthorizationLoggingOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PermissionType enum. + * @name google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType + * @enum {number} + * @property {number} UNDEFINED_PERMISSION_TYPE=0 UNDEFINED_PERMISSION_TYPE value + * @property {number} ADMIN_READ=128951462 ADMIN_READ value + * @property {number} ADMIN_WRITE=244412079 ADMIN_WRITE value + * @property {number} DATA_READ=305224971 DATA_READ value + * @property {number} DATA_WRITE=340181738 DATA_WRITE value + * @property {number} PERMISSION_TYPE_UNSPECIFIED=440313346 PERMISSION_TYPE_UNSPECIFIED value + */ + AuthorizationLoggingOptions.PermissionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PERMISSION_TYPE"] = 0; + values[valuesById[128951462] = "ADMIN_READ"] = 128951462; + values[valuesById[244412079] = "ADMIN_WRITE"] = 244412079; + values[valuesById[305224971] = "DATA_READ"] = 305224971; + values[valuesById[340181738] = "DATA_WRITE"] = 340181738; + values[valuesById[440313346] = "PERMISSION_TYPE_UNSPECIFIED"] = 440313346; + return values; + })(); + + return AuthorizationLoggingOptions; + })(); + + v1.AutoscalingPolicy = (function() { + + /** + * Properties of an AutoscalingPolicy. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalingPolicy + * @property {number|null} [coolDownPeriodSec] AutoscalingPolicy coolDownPeriodSec + * @property {google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization|null} [cpuUtilization] AutoscalingPolicy cpuUtilization + * @property {Array.|null} [customMetricUtilizations] AutoscalingPolicy customMetricUtilizations + * @property {google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization|null} [loadBalancingUtilization] AutoscalingPolicy loadBalancingUtilization + * @property {number|null} [maxNumReplicas] AutoscalingPolicy maxNumReplicas + * @property {number|null} [minNumReplicas] AutoscalingPolicy minNumReplicas + * @property {google.cloud.compute.v1.AutoscalingPolicy.Mode|null} [mode] AutoscalingPolicy mode + * @property {google.cloud.compute.v1.IAutoscalingPolicyScaleInControl|null} [scaleInControl] AutoscalingPolicy scaleInControl + * @property {Object.|null} [scalingSchedules] AutoscalingPolicy scalingSchedules + */ + + /** + * Constructs a new AutoscalingPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalingPolicy. + * @implements IAutoscalingPolicy + * @constructor + * @param {google.cloud.compute.v1.IAutoscalingPolicy=} [properties] Properties to set + */ + function AutoscalingPolicy(properties) { + this.customMetricUtilizations = []; + this.scalingSchedules = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingPolicy coolDownPeriodSec. + * @member {number|null|undefined} coolDownPeriodSec + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.coolDownPeriodSec = null; + + /** + * AutoscalingPolicy cpuUtilization. + * @member {google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization|null|undefined} cpuUtilization + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.cpuUtilization = null; + + /** + * AutoscalingPolicy customMetricUtilizations. + * @member {Array.} customMetricUtilizations + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.customMetricUtilizations = $util.emptyArray; + + /** + * AutoscalingPolicy loadBalancingUtilization. + * @member {google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization|null|undefined} loadBalancingUtilization + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.loadBalancingUtilization = null; + + /** + * AutoscalingPolicy maxNumReplicas. + * @member {number|null|undefined} maxNumReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.maxNumReplicas = null; + + /** + * AutoscalingPolicy minNumReplicas. + * @member {number|null|undefined} minNumReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.minNumReplicas = null; + + /** + * AutoscalingPolicy mode. + * @member {google.cloud.compute.v1.AutoscalingPolicy.Mode|null|undefined} mode + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.mode = null; + + /** + * AutoscalingPolicy scaleInControl. + * @member {google.cloud.compute.v1.IAutoscalingPolicyScaleInControl|null|undefined} scaleInControl + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.scaleInControl = null; + + /** + * AutoscalingPolicy scalingSchedules. + * @member {Object.} scalingSchedules + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.scalingSchedules = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingPolicy _coolDownPeriodSec. + * @member {"coolDownPeriodSec"|undefined} _coolDownPeriodSec + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "_coolDownPeriodSec", { + get: $util.oneOfGetter($oneOfFields = ["coolDownPeriodSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicy _cpuUtilization. + * @member {"cpuUtilization"|undefined} _cpuUtilization + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "_cpuUtilization", { + get: $util.oneOfGetter($oneOfFields = ["cpuUtilization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicy _loadBalancingUtilization. + * @member {"loadBalancingUtilization"|undefined} _loadBalancingUtilization + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "_loadBalancingUtilization", { + get: $util.oneOfGetter($oneOfFields = ["loadBalancingUtilization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicy _maxNumReplicas. + * @member {"maxNumReplicas"|undefined} _maxNumReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "_maxNumReplicas", { + get: $util.oneOfGetter($oneOfFields = ["maxNumReplicas"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicy _minNumReplicas. + * @member {"minNumReplicas"|undefined} _minNumReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "_minNumReplicas", { + get: $util.oneOfGetter($oneOfFields = ["minNumReplicas"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicy _mode. + * @member {"mode"|undefined} _mode + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicy _scaleInControl. + * @member {"scaleInControl"|undefined} _scaleInControl + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "_scaleInControl", { + get: $util.oneOfGetter($oneOfFields = ["scaleInControl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalingPolicy} AutoscalingPolicy instance + */ + AutoscalingPolicy.create = function create(properties) { + return new AutoscalingPolicy(properties); + }; + + /** + * Encodes the specified AutoscalingPolicy message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicy} message AutoscalingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3357091, wireType 0 =*/26856728).int32(message.mode); + if (message.maxNumReplicas != null && Object.hasOwnProperty.call(message, "maxNumReplicas")) + writer.uint32(/* id 62327375, wireType 0 =*/498619000).int32(message.maxNumReplicas); + if (message.coolDownPeriodSec != null && Object.hasOwnProperty.call(message, "coolDownPeriodSec")) + writer.uint32(/* id 107692954, wireType 0 =*/861543632).int32(message.coolDownPeriodSec); + if (message.customMetricUtilizations != null && message.customMetricUtilizations.length) + for (var i = 0; i < message.customMetricUtilizations.length; ++i) + $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.encode(message.customMetricUtilizations[i], writer.uint32(/* id 131972850, wireType 2 =*/1055782802).fork()).ldelim(); + if (message.scalingSchedules != null && Object.hasOwnProperty.call(message, "scalingSchedules")) + for (var keys = Object.keys(message.scalingSchedules), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 355416580, wireType 2 =*/2843332642).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.encode(message.scalingSchedules[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.cpuUtilization != null && Object.hasOwnProperty.call(message, "cpuUtilization")) + $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.encode(message.cpuUtilization, writer.uint32(/* id 381211147, wireType 2 =*/3049689178).fork()).ldelim(); + if (message.loadBalancingUtilization != null && Object.hasOwnProperty.call(message, "loadBalancingUtilization")) + $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.encode(message.loadBalancingUtilization, writer.uint32(/* id 429746403, wireType 2 =*/3437971226).fork()).ldelim(); + if (message.scaleInControl != null && Object.hasOwnProperty.call(message, "scaleInControl")) + $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.encode(message.scaleInControl, writer.uint32(/* id 527670872, wireType 2 =*/4221366978).fork()).ldelim(); + if (message.minNumReplicas != null && Object.hasOwnProperty.call(message, "minNumReplicas")) + writer.uint32(/* id 535329825, wireType 0 =*/4282638600).int32(message.minNumReplicas); + return writer; + }; + + /** + * Encodes the specified AutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicy} message AutoscalingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalingPolicy} AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalingPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 107692954: + message.coolDownPeriodSec = reader.int32(); + break; + case 381211147: + message.cpuUtilization = $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.decode(reader, reader.uint32()); + break; + case 131972850: + if (!(message.customMetricUtilizations && message.customMetricUtilizations.length)) + message.customMetricUtilizations = []; + message.customMetricUtilizations.push($root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.decode(reader, reader.uint32())); + break; + case 429746403: + message.loadBalancingUtilization = $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.decode(reader, reader.uint32()); + break; + case 62327375: + message.maxNumReplicas = reader.int32(); + break; + case 535329825: + message.minNumReplicas = reader.int32(); + break; + case 3357091: + message.mode = reader.int32(); + break; + case 527670872: + message.scaleInControl = $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.decode(reader, reader.uint32()); + break; + case 355416580: + if (message.scalingSchedules === $util.emptyObject) + message.scalingSchedules = {}; + 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.compute.v1.AutoscalingPolicyScalingSchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.scalingSchedules[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalingPolicy} AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.coolDownPeriodSec != null && message.hasOwnProperty("coolDownPeriodSec")) { + properties._coolDownPeriodSec = 1; + if (!$util.isInteger(message.coolDownPeriodSec)) + return "coolDownPeriodSec: integer expected"; + } + if (message.cpuUtilization != null && message.hasOwnProperty("cpuUtilization")) { + properties._cpuUtilization = 1; + { + var error = $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.verify(message.cpuUtilization); + if (error) + return "cpuUtilization." + error; + } + } + if (message.customMetricUtilizations != null && message.hasOwnProperty("customMetricUtilizations")) { + if (!Array.isArray(message.customMetricUtilizations)) + return "customMetricUtilizations: array expected"; + for (var i = 0; i < message.customMetricUtilizations.length; ++i) { + var error = $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.verify(message.customMetricUtilizations[i]); + if (error) + return "customMetricUtilizations." + error; + } + } + if (message.loadBalancingUtilization != null && message.hasOwnProperty("loadBalancingUtilization")) { + properties._loadBalancingUtilization = 1; + { + var error = $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.verify(message.loadBalancingUtilization); + if (error) + return "loadBalancingUtilization." + error; + } + } + if (message.maxNumReplicas != null && message.hasOwnProperty("maxNumReplicas")) { + properties._maxNumReplicas = 1; + if (!$util.isInteger(message.maxNumReplicas)) + return "maxNumReplicas: integer expected"; + } + if (message.minNumReplicas != null && message.hasOwnProperty("minNumReplicas")) { + properties._minNumReplicas = 1; + if (!$util.isInteger(message.minNumReplicas)) + return "minNumReplicas: integer expected"; + } + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 78159: + case 2527: + case 152713670: + case 478095374: + break; + } + } + if (message.scaleInControl != null && message.hasOwnProperty("scaleInControl")) { + properties._scaleInControl = 1; + { + var error = $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.verify(message.scaleInControl); + if (error) + return "scaleInControl." + error; + } + } + if (message.scalingSchedules != null && message.hasOwnProperty("scalingSchedules")) { + if (!$util.isObject(message.scalingSchedules)) + return "scalingSchedules: object expected"; + var key = Object.keys(message.scalingSchedules); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.verify(message.scalingSchedules[key[i]]); + if (error) + return "scalingSchedules." + error; + } + } + return null; + }; + + /** + * Creates an AutoscalingPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalingPolicy} AutoscalingPolicy + */ + AutoscalingPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalingPolicy) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalingPolicy(); + if (object.coolDownPeriodSec != null) + message.coolDownPeriodSec = object.coolDownPeriodSec | 0; + if (object.cpuUtilization != null) { + if (typeof object.cpuUtilization !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicy.cpuUtilization: object expected"); + message.cpuUtilization = $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.fromObject(object.cpuUtilization); + } + if (object.customMetricUtilizations) { + if (!Array.isArray(object.customMetricUtilizations)) + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicy.customMetricUtilizations: array expected"); + message.customMetricUtilizations = []; + for (var i = 0; i < object.customMetricUtilizations.length; ++i) { + if (typeof object.customMetricUtilizations[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicy.customMetricUtilizations: object expected"); + message.customMetricUtilizations[i] = $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.fromObject(object.customMetricUtilizations[i]); + } + } + if (object.loadBalancingUtilization != null) { + if (typeof object.loadBalancingUtilization !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicy.loadBalancingUtilization: object expected"); + message.loadBalancingUtilization = $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.fromObject(object.loadBalancingUtilization); + } + if (object.maxNumReplicas != null) + message.maxNumReplicas = object.maxNumReplicas | 0; + if (object.minNumReplicas != null) + message.minNumReplicas = object.minNumReplicas | 0; + switch (object.mode) { + case "UNDEFINED_MODE": + case 0: + message.mode = 0; + break; + case "OFF": + case 78159: + message.mode = 78159; + break; + case "ON": + case 2527: + message.mode = 2527; + break; + case "ONLY_SCALE_OUT": + case 152713670: + message.mode = 152713670; + break; + case "ONLY_UP": + case 478095374: + message.mode = 478095374; + break; + } + if (object.scaleInControl != null) { + if (typeof object.scaleInControl !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicy.scaleInControl: object expected"); + message.scaleInControl = $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.fromObject(object.scaleInControl); + } + if (object.scalingSchedules) { + if (typeof object.scalingSchedules !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicy.scalingSchedules: object expected"); + message.scalingSchedules = {}; + for (var keys = Object.keys(object.scalingSchedules), i = 0; i < keys.length; ++i) { + if (typeof object.scalingSchedules[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicy.scalingSchedules: object expected"); + message.scalingSchedules[keys[i]] = $root.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.fromObject(object.scalingSchedules[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an AutoscalingPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.AutoscalingPolicy} message AutoscalingPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customMetricUtilizations = []; + if (options.objects || options.defaults) + object.scalingSchedules = {}; + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.cloud.compute.v1.AutoscalingPolicy.Mode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.maxNumReplicas != null && message.hasOwnProperty("maxNumReplicas")) { + object.maxNumReplicas = message.maxNumReplicas; + if (options.oneofs) + object._maxNumReplicas = "maxNumReplicas"; + } + if (message.coolDownPeriodSec != null && message.hasOwnProperty("coolDownPeriodSec")) { + object.coolDownPeriodSec = message.coolDownPeriodSec; + if (options.oneofs) + object._coolDownPeriodSec = "coolDownPeriodSec"; + } + if (message.customMetricUtilizations && message.customMetricUtilizations.length) { + object.customMetricUtilizations = []; + for (var j = 0; j < message.customMetricUtilizations.length; ++j) + object.customMetricUtilizations[j] = $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.toObject(message.customMetricUtilizations[j], options); + } + var keys2; + if (message.scalingSchedules && (keys2 = Object.keys(message.scalingSchedules)).length) { + object.scalingSchedules = {}; + for (var j = 0; j < keys2.length; ++j) + object.scalingSchedules[keys2[j]] = $root.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.toObject(message.scalingSchedules[keys2[j]], options); + } + if (message.cpuUtilization != null && message.hasOwnProperty("cpuUtilization")) { + object.cpuUtilization = $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.toObject(message.cpuUtilization, options); + if (options.oneofs) + object._cpuUtilization = "cpuUtilization"; + } + if (message.loadBalancingUtilization != null && message.hasOwnProperty("loadBalancingUtilization")) { + object.loadBalancingUtilization = $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.toObject(message.loadBalancingUtilization, options); + if (options.oneofs) + object._loadBalancingUtilization = "loadBalancingUtilization"; + } + if (message.scaleInControl != null && message.hasOwnProperty("scaleInControl")) { + object.scaleInControl = $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl.toObject(message.scaleInControl, options); + if (options.oneofs) + object._scaleInControl = "scaleInControl"; + } + if (message.minNumReplicas != null && message.hasOwnProperty("minNumReplicas")) { + object.minNumReplicas = message.minNumReplicas; + if (options.oneofs) + object._minNumReplicas = "minNumReplicas"; + } + return object; + }; + + /** + * Converts this AutoscalingPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalingPolicy + * @instance + * @returns {Object.} JSON object + */ + AutoscalingPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Mode enum. + * @name google.cloud.compute.v1.AutoscalingPolicy.Mode + * @enum {number} + * @property {number} UNDEFINED_MODE=0 UNDEFINED_MODE value + * @property {number} OFF=78159 OFF value + * @property {number} ON=2527 ON value + * @property {number} ONLY_SCALE_OUT=152713670 ONLY_SCALE_OUT value + * @property {number} ONLY_UP=478095374 ONLY_UP value + */ + AutoscalingPolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MODE"] = 0; + values[valuesById[78159] = "OFF"] = 78159; + values[valuesById[2527] = "ON"] = 2527; + values[valuesById[152713670] = "ONLY_SCALE_OUT"] = 152713670; + values[valuesById[478095374] = "ONLY_UP"] = 478095374; + return values; + })(); + + return AutoscalingPolicy; + })(); + + v1.ScalingScheduleStatus = (function() { + + /** + * Properties of a ScalingScheduleStatus. + * @memberof google.cloud.compute.v1 + * @interface IScalingScheduleStatus + * @property {string|null} [lastStartTime] ScalingScheduleStatus lastStartTime + * @property {string|null} [nextStartTime] ScalingScheduleStatus nextStartTime + * @property {google.cloud.compute.v1.ScalingScheduleStatus.State|null} [state] ScalingScheduleStatus state + */ + + /** + * Constructs a new ScalingScheduleStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ScalingScheduleStatus. + * @implements IScalingScheduleStatus + * @constructor + * @param {google.cloud.compute.v1.IScalingScheduleStatus=} [properties] Properties to set + */ + function ScalingScheduleStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScalingScheduleStatus lastStartTime. + * @member {string|null|undefined} lastStartTime + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @instance + */ + ScalingScheduleStatus.prototype.lastStartTime = null; + + /** + * ScalingScheduleStatus nextStartTime. + * @member {string|null|undefined} nextStartTime + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @instance + */ + ScalingScheduleStatus.prototype.nextStartTime = null; + + /** + * ScalingScheduleStatus state. + * @member {google.cloud.compute.v1.ScalingScheduleStatus.State|null|undefined} state + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @instance + */ + ScalingScheduleStatus.prototype.state = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ScalingScheduleStatus _lastStartTime. + * @member {"lastStartTime"|undefined} _lastStartTime + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @instance + */ + Object.defineProperty(ScalingScheduleStatus.prototype, "_lastStartTime", { + get: $util.oneOfGetter($oneOfFields = ["lastStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ScalingScheduleStatus _nextStartTime. + * @member {"nextStartTime"|undefined} _nextStartTime + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @instance + */ + Object.defineProperty(ScalingScheduleStatus.prototype, "_nextStartTime", { + get: $util.oneOfGetter($oneOfFields = ["nextStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ScalingScheduleStatus _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @instance + */ + Object.defineProperty(ScalingScheduleStatus.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScalingScheduleStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {google.cloud.compute.v1.IScalingScheduleStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ScalingScheduleStatus} ScalingScheduleStatus instance + */ + ScalingScheduleStatus.create = function create(properties) { + return new ScalingScheduleStatus(properties); + }; + + /** + * Encodes the specified ScalingScheduleStatus message. Does not implicitly {@link google.cloud.compute.v1.ScalingScheduleStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {google.cloud.compute.v1.IScalingScheduleStatus} message ScalingScheduleStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalingScheduleStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastStartTime != null && Object.hasOwnProperty.call(message, "lastStartTime")) + writer.uint32(/* id 34545107, wireType 2 =*/276360858).string(message.lastStartTime); + if (message.nextStartTime != null && Object.hasOwnProperty.call(message, "nextStartTime")) + writer.uint32(/* id 97270102, wireType 2 =*/778160818).string(message.nextStartTime); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + return writer; + }; + + /** + * Encodes the specified ScalingScheduleStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ScalingScheduleStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {google.cloud.compute.v1.IScalingScheduleStatus} message ScalingScheduleStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalingScheduleStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScalingScheduleStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ScalingScheduleStatus} ScalingScheduleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalingScheduleStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ScalingScheduleStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34545107: + message.lastStartTime = reader.string(); + break; + case 97270102: + message.nextStartTime = reader.string(); + break; + case 109757585: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScalingScheduleStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ScalingScheduleStatus} ScalingScheduleStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalingScheduleStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScalingScheduleStatus message. + * @function verify + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScalingScheduleStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lastStartTime != null && message.hasOwnProperty("lastStartTime")) { + properties._lastStartTime = 1; + if (!$util.isString(message.lastStartTime)) + return "lastStartTime: string expected"; + } + if (message.nextStartTime != null && message.hasOwnProperty("nextStartTime")) { + properties._nextStartTime = 1; + if (!$util.isString(message.nextStartTime)) + return "nextStartTime: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 314733318: + case 516696700: + case 66532761: + case 77848963: + break; + } + } + return null; + }; + + /** + * Creates a ScalingScheduleStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ScalingScheduleStatus} ScalingScheduleStatus + */ + ScalingScheduleStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ScalingScheduleStatus) + return object; + var message = new $root.google.cloud.compute.v1.ScalingScheduleStatus(); + if (object.lastStartTime != null) + message.lastStartTime = String(object.lastStartTime); + if (object.nextStartTime != null) + message.nextStartTime = String(object.nextStartTime); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 314733318: + message.state = 314733318; + break; + case "DISABLED": + case 516696700: + message.state = 516696700; + break; + case "OBSOLETE": + case 66532761: + message.state = 66532761; + break; + case "READY": + case 77848963: + message.state = 77848963; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScalingScheduleStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @static + * @param {google.cloud.compute.v1.ScalingScheduleStatus} message ScalingScheduleStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScalingScheduleStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.lastStartTime != null && message.hasOwnProperty("lastStartTime")) { + object.lastStartTime = message.lastStartTime; + if (options.oneofs) + object._lastStartTime = "lastStartTime"; + } + if (message.nextStartTime != null && message.hasOwnProperty("nextStartTime")) { + object.nextStartTime = message.nextStartTime; + if (options.oneofs) + object._nextStartTime = "nextStartTime"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.ScalingScheduleStatus.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + return object; + }; + + /** + * Converts this ScalingScheduleStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ScalingScheduleStatus + * @instance + * @returns {Object.} JSON object + */ + ScalingScheduleStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.compute.v1.ScalingScheduleStatus.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} DISABLED=516696700 DISABLED value + * @property {number} OBSOLETE=66532761 OBSOLETE value + * @property {number} READY=77848963 READY value + */ + ScalingScheduleStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[516696700] = "DISABLED"] = 516696700; + values[valuesById[66532761] = "OBSOLETE"] = 66532761; + values[valuesById[77848963] = "READY"] = 77848963; + return values; + })(); + + return ScalingScheduleStatus; + })(); + + v1.AutoscalerStatusDetails = (function() { + + /** + * Properties of an AutoscalerStatusDetails. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalerStatusDetails + * @property {string|null} [message] AutoscalerStatusDetails message + * @property {google.cloud.compute.v1.AutoscalerStatusDetails.Type|null} [type] AutoscalerStatusDetails type + */ + + /** + * Constructs a new AutoscalerStatusDetails. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalerStatusDetails. + * @implements IAutoscalerStatusDetails + * @constructor + * @param {google.cloud.compute.v1.IAutoscalerStatusDetails=} [properties] Properties to set + */ + function AutoscalerStatusDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalerStatusDetails message. + * @member {string|null|undefined} message + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @instance + */ + AutoscalerStatusDetails.prototype.message = null; + + /** + * AutoscalerStatusDetails type. + * @member {google.cloud.compute.v1.AutoscalerStatusDetails.Type|null|undefined} type + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @instance + */ + AutoscalerStatusDetails.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalerStatusDetails _message. + * @member {"message"|undefined} _message + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @instance + */ + Object.defineProperty(AutoscalerStatusDetails.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerStatusDetails _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @instance + */ + Object.defineProperty(AutoscalerStatusDetails.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalerStatusDetails instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {google.cloud.compute.v1.IAutoscalerStatusDetails=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalerStatusDetails} AutoscalerStatusDetails instance + */ + AutoscalerStatusDetails.create = function create(properties) { + return new AutoscalerStatusDetails(properties); + }; + + /** + * Encodes the specified AutoscalerStatusDetails message. Does not implicitly {@link google.cloud.compute.v1.AutoscalerStatusDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {google.cloud.compute.v1.IAutoscalerStatusDetails} message AutoscalerStatusDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalerStatusDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 418054151, wireType 2 =*/3344433210).string(message.message); + return writer; + }; + + /** + * Encodes the specified AutoscalerStatusDetails message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalerStatusDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {google.cloud.compute.v1.IAutoscalerStatusDetails} message AutoscalerStatusDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalerStatusDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalerStatusDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalerStatusDetails} AutoscalerStatusDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalerStatusDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalerStatusDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 418054151: + message.message = reader.string(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalerStatusDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalerStatusDetails} AutoscalerStatusDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalerStatusDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalerStatusDetails message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalerStatusDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.message != null && message.hasOwnProperty("message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 404965477: + case 191417626: + case 518617: + case 328964659: + case 204430550: + case 2821361: + case 94885086: + case 509858898: + case 164169907: + case 3840994: + case 100969842: + case 151922141: + case 403101631: + case 528622846: + case 122636699: + case 29275586: + case 398287669: + case 433141802: + case 330845009: + case 210200502: + break; + } + } + return null; + }; + + /** + * Creates an AutoscalerStatusDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalerStatusDetails} AutoscalerStatusDetails + */ + AutoscalerStatusDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalerStatusDetails) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalerStatusDetails(); + if (object.message != null) + message.message = String(object.message); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "ALL_INSTANCES_UNHEALTHY": + case 404965477: + message.type = 404965477; + break; + case "BACKEND_SERVICE_DOES_NOT_EXIST": + case 191417626: + message.type = 191417626; + break; + case "CAPPED_AT_MAX_NUM_REPLICAS": + case 518617: + message.type = 518617; + break; + case "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE": + case 328964659: + message.type = 328964659; + break; + case "CUSTOM_METRIC_INVALID": + case 204430550: + message.type = 204430550; + break; + case "MIN_EQUALS_MAX": + case 2821361: + message.type = 2821361; + break; + case "MISSING_CUSTOM_METRIC_DATA_POINTS": + case 94885086: + message.type = 94885086; + break; + case "MISSING_LOAD_BALANCING_DATA_POINTS": + case 509858898: + message.type = 509858898; + break; + case "MODE_OFF": + case 164169907: + message.type = 164169907; + break; + case "MODE_ONLY_SCALE_OUT": + case 3840994: + message.type = 3840994; + break; + case "MODE_ONLY_UP": + case 100969842: + message.type = 100969842; + break; + case "MORE_THAN_ONE_BACKEND_SERVICE": + case 151922141: + message.type = 151922141; + break; + case "NOT_ENOUGH_QUOTA_AVAILABLE": + case 403101631: + message.type = 403101631; + break; + case "REGION_RESOURCE_STOCKOUT": + case 528622846: + message.type = 528622846; + break; + case "SCALING_TARGET_DOES_NOT_EXIST": + case 122636699: + message.type = 122636699; + break; + case "SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX": + case 29275586: + message.type = 29275586; + break; + case "SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN": + case 398287669: + message.type = 398287669; + break; + case "UNKNOWN": + case 433141802: + message.type = 433141802; + break; + case "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION": + case 330845009: + message.type = 330845009; + break; + case "ZONE_RESOURCE_STOCKOUT": + case 210200502: + message.type = 210200502; + break; + } + return message; + }; + + /** + * Creates a plain object from an AutoscalerStatusDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @static + * @param {google.cloud.compute.v1.AutoscalerStatusDetails} message AutoscalerStatusDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalerStatusDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.AutoscalerStatusDetails.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.message != null && message.hasOwnProperty("message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; + + /** + * Converts this AutoscalerStatusDetails to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalerStatusDetails + * @instance + * @returns {Object.} JSON object + */ + AutoscalerStatusDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.AutoscalerStatusDetails.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} ALL_INSTANCES_UNHEALTHY=404965477 ALL_INSTANCES_UNHEALTHY value + * @property {number} BACKEND_SERVICE_DOES_NOT_EXIST=191417626 BACKEND_SERVICE_DOES_NOT_EXIST value + * @property {number} CAPPED_AT_MAX_NUM_REPLICAS=518617 CAPPED_AT_MAX_NUM_REPLICAS value + * @property {number} CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE=328964659 CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE value + * @property {number} CUSTOM_METRIC_INVALID=204430550 CUSTOM_METRIC_INVALID value + * @property {number} MIN_EQUALS_MAX=2821361 MIN_EQUALS_MAX value + * @property {number} MISSING_CUSTOM_METRIC_DATA_POINTS=94885086 MISSING_CUSTOM_METRIC_DATA_POINTS value + * @property {number} MISSING_LOAD_BALANCING_DATA_POINTS=509858898 MISSING_LOAD_BALANCING_DATA_POINTS value + * @property {number} MODE_OFF=164169907 MODE_OFF value + * @property {number} MODE_ONLY_SCALE_OUT=3840994 MODE_ONLY_SCALE_OUT value + * @property {number} MODE_ONLY_UP=100969842 MODE_ONLY_UP value + * @property {number} MORE_THAN_ONE_BACKEND_SERVICE=151922141 MORE_THAN_ONE_BACKEND_SERVICE value + * @property {number} NOT_ENOUGH_QUOTA_AVAILABLE=403101631 NOT_ENOUGH_QUOTA_AVAILABLE value + * @property {number} REGION_RESOURCE_STOCKOUT=528622846 REGION_RESOURCE_STOCKOUT value + * @property {number} SCALING_TARGET_DOES_NOT_EXIST=122636699 SCALING_TARGET_DOES_NOT_EXIST value + * @property {number} SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX=29275586 SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX value + * @property {number} SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN=398287669 SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN value + * @property {number} UNKNOWN=433141802 UNKNOWN value + * @property {number} UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION=330845009 UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION value + * @property {number} ZONE_RESOURCE_STOCKOUT=210200502 ZONE_RESOURCE_STOCKOUT value + */ + AutoscalerStatusDetails.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[404965477] = "ALL_INSTANCES_UNHEALTHY"] = 404965477; + values[valuesById[191417626] = "BACKEND_SERVICE_DOES_NOT_EXIST"] = 191417626; + values[valuesById[518617] = "CAPPED_AT_MAX_NUM_REPLICAS"] = 518617; + values[valuesById[328964659] = "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE"] = 328964659; + values[valuesById[204430550] = "CUSTOM_METRIC_INVALID"] = 204430550; + values[valuesById[2821361] = "MIN_EQUALS_MAX"] = 2821361; + values[valuesById[94885086] = "MISSING_CUSTOM_METRIC_DATA_POINTS"] = 94885086; + values[valuesById[509858898] = "MISSING_LOAD_BALANCING_DATA_POINTS"] = 509858898; + values[valuesById[164169907] = "MODE_OFF"] = 164169907; + values[valuesById[3840994] = "MODE_ONLY_SCALE_OUT"] = 3840994; + values[valuesById[100969842] = "MODE_ONLY_UP"] = 100969842; + values[valuesById[151922141] = "MORE_THAN_ONE_BACKEND_SERVICE"] = 151922141; + values[valuesById[403101631] = "NOT_ENOUGH_QUOTA_AVAILABLE"] = 403101631; + values[valuesById[528622846] = "REGION_RESOURCE_STOCKOUT"] = 528622846; + values[valuesById[122636699] = "SCALING_TARGET_DOES_NOT_EXIST"] = 122636699; + values[valuesById[29275586] = "SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX"] = 29275586; + values[valuesById[398287669] = "SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN"] = 398287669; + values[valuesById[433141802] = "UNKNOWN"] = 433141802; + values[valuesById[330845009] = "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION"] = 330845009; + values[valuesById[210200502] = "ZONE_RESOURCE_STOCKOUT"] = 210200502; + return values; + })(); + + return AutoscalerStatusDetails; + })(); + + v1.Autoscaler = (function() { + + /** + * Properties of an Autoscaler. + * @memberof google.cloud.compute.v1 + * @interface IAutoscaler + * @property {google.cloud.compute.v1.IAutoscalingPolicy|null} [autoscalingPolicy] Autoscaler autoscalingPolicy + * @property {string|null} [creationTimestamp] Autoscaler creationTimestamp + * @property {string|null} [description] Autoscaler description + * @property {number|Long|null} [id] Autoscaler id + * @property {string|null} [kind] Autoscaler kind + * @property {string|null} [name] Autoscaler name + * @property {number|null} [recommendedSize] Autoscaler recommendedSize + * @property {string|null} [region] Autoscaler region + * @property {Object.|null} [scalingScheduleStatus] Autoscaler scalingScheduleStatus + * @property {string|null} [selfLink] Autoscaler selfLink + * @property {google.cloud.compute.v1.Autoscaler.Status|null} [status] Autoscaler status + * @property {Array.|null} [statusDetails] Autoscaler statusDetails + * @property {string|null} [target] Autoscaler target + * @property {string|null} [zone] Autoscaler zone + */ + + /** + * Constructs a new Autoscaler. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Autoscaler. + * @implements IAutoscaler + * @constructor + * @param {google.cloud.compute.v1.IAutoscaler=} [properties] Properties to set + */ + function Autoscaler(properties) { + this.scalingScheduleStatus = {}; + this.statusDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Autoscaler autoscalingPolicy. + * @member {google.cloud.compute.v1.IAutoscalingPolicy|null|undefined} autoscalingPolicy + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.autoscalingPolicy = null; + + /** + * Autoscaler creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.creationTimestamp = null; + + /** + * Autoscaler description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.description = null; + + /** + * Autoscaler id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.id = null; + + /** + * Autoscaler kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.kind = null; + + /** + * Autoscaler name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.name = null; + + /** + * Autoscaler recommendedSize. + * @member {number|null|undefined} recommendedSize + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.recommendedSize = null; + + /** + * Autoscaler region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.region = null; + + /** + * Autoscaler scalingScheduleStatus. + * @member {Object.} scalingScheduleStatus + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.scalingScheduleStatus = $util.emptyObject; + + /** + * Autoscaler selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.selfLink = null; + + /** + * Autoscaler status. + * @member {google.cloud.compute.v1.Autoscaler.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.status = null; + + /** + * Autoscaler statusDetails. + * @member {Array.} statusDetails + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.statusDetails = $util.emptyArray; + + /** + * Autoscaler target. + * @member {string|null|undefined} target + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.target = null; + + /** + * Autoscaler zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Autoscaler.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Autoscaler _autoscalingPolicy. + * @member {"autoscalingPolicy"|undefined} _autoscalingPolicy + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_autoscalingPolicy", { + get: $util.oneOfGetter($oneOfFields = ["autoscalingPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _recommendedSize. + * @member {"recommendedSize"|undefined} _recommendedSize + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_recommendedSize", { + get: $util.oneOfGetter($oneOfFields = ["recommendedSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _target. + * @member {"target"|undefined} _target + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_target", { + get: $util.oneOfGetter($oneOfFields = ["target"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Autoscaler _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + */ + Object.defineProperty(Autoscaler.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Autoscaler instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {google.cloud.compute.v1.IAutoscaler=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Autoscaler} Autoscaler instance + */ + Autoscaler.create = function create(properties) { + return new Autoscaler(properties); + }; + + /** + * Encodes the specified Autoscaler message. Does not implicitly {@link google.cloud.compute.v1.Autoscaler.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {google.cloud.compute.v1.IAutoscaler} message Autoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Autoscaler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 192835985, wireType 2 =*/1542687882).string(message.target); + if (message.autoscalingPolicy != null && Object.hasOwnProperty.call(message, "autoscalingPolicy")) + $root.google.cloud.compute.v1.AutoscalingPolicy.encode(message.autoscalingPolicy, writer.uint32(/* id 221950041, wireType 2 =*/1775600330).fork()).ldelim(); + if (message.recommendedSize != null && Object.hasOwnProperty.call(message, "recommendedSize")) + writer.uint32(/* id 257915749, wireType 0 =*/2063325992).int32(message.recommendedSize); + if (message.statusDetails != null && message.statusDetails.length) + for (var i = 0; i < message.statusDetails.length; ++i) + $root.google.cloud.compute.v1.AutoscalerStatusDetails.encode(message.statusDetails[i], writer.uint32(/* id 363353845, wireType 2 =*/2906830762).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.scalingScheduleStatus != null && Object.hasOwnProperty.call(message, "scalingScheduleStatus")) + for (var keys = Object.keys(message.scalingScheduleStatus), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 465950178, wireType 2 =*/3727601426).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.ScalingScheduleStatus.encode(message.scalingScheduleStatus[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Autoscaler message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Autoscaler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {google.cloud.compute.v1.IAutoscaler} message Autoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Autoscaler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Autoscaler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Autoscaler} Autoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Autoscaler.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Autoscaler(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 221950041: + message.autoscalingPolicy = $root.google.cloud.compute.v1.AutoscalingPolicy.decode(reader, reader.uint32()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 257915749: + message.recommendedSize = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 465950178: + if (message.scalingScheduleStatus === $util.emptyObject) + message.scalingScheduleStatus = {}; + 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.compute.v1.ScalingScheduleStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.scalingScheduleStatus[key] = value; + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 363353845: + if (!(message.statusDetails && message.statusDetails.length)) + message.statusDetails = []; + message.statusDetails.push($root.google.cloud.compute.v1.AutoscalerStatusDetails.decode(reader, reader.uint32())); + break; + case 192835985: + message.target = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Autoscaler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Autoscaler} Autoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Autoscaler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Autoscaler message. + * @function verify + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Autoscaler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscalingPolicy != null && message.hasOwnProperty("autoscalingPolicy")) { + properties._autoscalingPolicy = 1; + { + var error = $root.google.cloud.compute.v1.AutoscalingPolicy.verify(message.autoscalingPolicy); + if (error) + return "autoscalingPolicy." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.recommendedSize != null && message.hasOwnProperty("recommendedSize")) { + properties._recommendedSize = 1; + if (!$util.isInteger(message.recommendedSize)) + return "recommendedSize: integer expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.scalingScheduleStatus != null && message.hasOwnProperty("scalingScheduleStatus")) { + if (!$util.isObject(message.scalingScheduleStatus)) + return "scalingScheduleStatus: object expected"; + var key = Object.keys(message.scalingScheduleStatus); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.ScalingScheduleStatus.verify(message.scalingScheduleStatus[key[i]]); + if (error) + return "scalingScheduleStatus." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 314733318: + case 528602024: + case 66247144: + case 35394935: + break; + } + } + if (message.statusDetails != null && message.hasOwnProperty("statusDetails")) { + if (!Array.isArray(message.statusDetails)) + return "statusDetails: array expected"; + for (var i = 0; i < message.statusDetails.length; ++i) { + var error = $root.google.cloud.compute.v1.AutoscalerStatusDetails.verify(message.statusDetails[i]); + if (error) + return "statusDetails." + error; + } + } + if (message.target != null && message.hasOwnProperty("target")) { + properties._target = 1; + if (!$util.isString(message.target)) + return "target: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates an Autoscaler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Autoscaler} Autoscaler + */ + Autoscaler.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Autoscaler) + return object; + var message = new $root.google.cloud.compute.v1.Autoscaler(); + if (object.autoscalingPolicy != null) { + if (typeof object.autoscalingPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.Autoscaler.autoscalingPolicy: object expected"); + message.autoscalingPolicy = $root.google.cloud.compute.v1.AutoscalingPolicy.fromObject(object.autoscalingPolicy); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.recommendedSize != null) + message.recommendedSize = object.recommendedSize | 0; + if (object.region != null) + message.region = String(object.region); + if (object.scalingScheduleStatus) { + if (typeof object.scalingScheduleStatus !== "object") + throw TypeError(".google.cloud.compute.v1.Autoscaler.scalingScheduleStatus: object expected"); + message.scalingScheduleStatus = {}; + for (var keys = Object.keys(object.scalingScheduleStatus), i = 0; i < keys.length; ++i) { + if (typeof object.scalingScheduleStatus[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.Autoscaler.scalingScheduleStatus: object expected"); + message.scalingScheduleStatus[keys[i]] = $root.google.cloud.compute.v1.ScalingScheduleStatus.fromObject(object.scalingScheduleStatus[keys[i]]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "ACTIVE": + case 314733318: + message.status = 314733318; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "ERROR": + case 66247144: + message.status = 66247144; + break; + case "PENDING": + case 35394935: + message.status = 35394935; + break; + } + if (object.statusDetails) { + if (!Array.isArray(object.statusDetails)) + throw TypeError(".google.cloud.compute.v1.Autoscaler.statusDetails: array expected"); + message.statusDetails = []; + for (var i = 0; i < object.statusDetails.length; ++i) { + if (typeof object.statusDetails[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Autoscaler.statusDetails: object expected"); + message.statusDetails[i] = $root.google.cloud.compute.v1.AutoscalerStatusDetails.fromObject(object.statusDetails[i]); + } + } + if (object.target != null) + message.target = String(object.target); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an Autoscaler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Autoscaler + * @static + * @param {google.cloud.compute.v1.Autoscaler} message Autoscaler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Autoscaler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusDetails = []; + if (options.objects || options.defaults) + object.scalingScheduleStatus = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Autoscaler.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.target != null && message.hasOwnProperty("target")) { + object.target = message.target; + if (options.oneofs) + object._target = "target"; + } + if (message.autoscalingPolicy != null && message.hasOwnProperty("autoscalingPolicy")) { + object.autoscalingPolicy = $root.google.cloud.compute.v1.AutoscalingPolicy.toObject(message.autoscalingPolicy, options); + if (options.oneofs) + object._autoscalingPolicy = "autoscalingPolicy"; + } + if (message.recommendedSize != null && message.hasOwnProperty("recommendedSize")) { + object.recommendedSize = message.recommendedSize; + if (options.oneofs) + object._recommendedSize = "recommendedSize"; + } + if (message.statusDetails && message.statusDetails.length) { + object.statusDetails = []; + for (var j = 0; j < message.statusDetails.length; ++j) + object.statusDetails[j] = $root.google.cloud.compute.v1.AutoscalerStatusDetails.toObject(message.statusDetails[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + var keys2; + if (message.scalingScheduleStatus && (keys2 = Object.keys(message.scalingScheduleStatus)).length) { + object.scalingScheduleStatus = {}; + for (var j = 0; j < keys2.length; ++j) + object.scalingScheduleStatus[keys2[j]] = $root.google.cloud.compute.v1.ScalingScheduleStatus.toObject(message.scalingScheduleStatus[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Autoscaler to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Autoscaler + * @instance + * @returns {Object.} JSON object + */ + Autoscaler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.Autoscaler.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} DELETING=528602024 DELETING value + * @property {number} ERROR=66247144 ERROR value + * @property {number} PENDING=35394935 PENDING value + */ + Autoscaler.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[66247144] = "ERROR"] = 66247144; + values[valuesById[35394935] = "PENDING"] = 35394935; + return values; + })(); + + return Autoscaler; + })(); + + v1.AutoscalersScopedList = (function() { + + /** + * Properties of an AutoscalersScopedList. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalersScopedList + * @property {Array.|null} [autoscalers] AutoscalersScopedList autoscalers + * @property {google.cloud.compute.v1.IWarning|null} [warning] AutoscalersScopedList warning + */ + + /** + * Constructs a new AutoscalersScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalersScopedList. + * @implements IAutoscalersScopedList + * @constructor + * @param {google.cloud.compute.v1.IAutoscalersScopedList=} [properties] Properties to set + */ + function AutoscalersScopedList(properties) { + this.autoscalers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalersScopedList autoscalers. + * @member {Array.} autoscalers + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @instance + */ + AutoscalersScopedList.prototype.autoscalers = $util.emptyArray; + + /** + * AutoscalersScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @instance + */ + AutoscalersScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalersScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @instance + */ + Object.defineProperty(AutoscalersScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalersScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {google.cloud.compute.v1.IAutoscalersScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalersScopedList} AutoscalersScopedList instance + */ + AutoscalersScopedList.create = function create(properties) { + return new AutoscalersScopedList(properties); + }; + + /** + * Encodes the specified AutoscalersScopedList message. Does not implicitly {@link google.cloud.compute.v1.AutoscalersScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {google.cloud.compute.v1.IAutoscalersScopedList} message AutoscalersScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalersScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.autoscalers != null && message.autoscalers.length) + for (var i = 0; i < message.autoscalers.length; ++i) + $root.google.cloud.compute.v1.Autoscaler.encode(message.autoscalers[i], writer.uint32(/* id 465771644, wireType 2 =*/3726173154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoscalersScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalersScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {google.cloud.compute.v1.IAutoscalersScopedList} message AutoscalersScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalersScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalersScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalersScopedList} AutoscalersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalersScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalersScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 465771644: + if (!(message.autoscalers && message.autoscalers.length)) + message.autoscalers = []; + message.autoscalers.push($root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalersScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalersScopedList} AutoscalersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalersScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalersScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalersScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscalers != null && message.hasOwnProperty("autoscalers")) { + if (!Array.isArray(message.autoscalers)) + return "autoscalers: array expected"; + for (var i = 0; i < message.autoscalers.length; ++i) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.autoscalers[i]); + if (error) + return "autoscalers." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AutoscalersScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalersScopedList} AutoscalersScopedList + */ + AutoscalersScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalersScopedList) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalersScopedList(); + if (object.autoscalers) { + if (!Array.isArray(object.autoscalers)) + throw TypeError(".google.cloud.compute.v1.AutoscalersScopedList.autoscalers: array expected"); + message.autoscalers = []; + for (var i = 0; i < object.autoscalers.length; ++i) { + if (typeof object.autoscalers[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalersScopedList.autoscalers: object expected"); + message.autoscalers[i] = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.autoscalers[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalersScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AutoscalersScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @static + * @param {google.cloud.compute.v1.AutoscalersScopedList} message AutoscalersScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalersScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoscalers = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.autoscalers && message.autoscalers.length) { + object.autoscalers = []; + for (var j = 0; j < message.autoscalers.length; ++j) + object.autoscalers[j] = $root.google.cloud.compute.v1.Autoscaler.toObject(message.autoscalers[j], options); + } + return object; + }; + + /** + * Converts this AutoscalersScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalersScopedList + * @instance + * @returns {Object.} JSON object + */ + AutoscalersScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AutoscalersScopedList; + })(); + + v1.AutoscalerAggregatedList = (function() { + + /** + * Properties of an AutoscalerAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalerAggregatedList + * @property {string|null} [id] AutoscalerAggregatedList id + * @property {Object.|null} [items] AutoscalerAggregatedList items + * @property {string|null} [kind] AutoscalerAggregatedList kind + * @property {string|null} [nextPageToken] AutoscalerAggregatedList nextPageToken + * @property {string|null} [selfLink] AutoscalerAggregatedList selfLink + * @property {Array.|null} [unreachables] AutoscalerAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] AutoscalerAggregatedList warning + */ + + /** + * Constructs a new AutoscalerAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalerAggregatedList. + * @implements IAutoscalerAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IAutoscalerAggregatedList=} [properties] Properties to set + */ + function AutoscalerAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalerAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + AutoscalerAggregatedList.prototype.id = null; + + /** + * AutoscalerAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + AutoscalerAggregatedList.prototype.items = $util.emptyObject; + + /** + * AutoscalerAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + AutoscalerAggregatedList.prototype.kind = null; + + /** + * AutoscalerAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + AutoscalerAggregatedList.prototype.nextPageToken = null; + + /** + * AutoscalerAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + AutoscalerAggregatedList.prototype.selfLink = null; + + /** + * AutoscalerAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + AutoscalerAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * AutoscalerAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + AutoscalerAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalerAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + Object.defineProperty(AutoscalerAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + Object.defineProperty(AutoscalerAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + Object.defineProperty(AutoscalerAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + Object.defineProperty(AutoscalerAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + */ + Object.defineProperty(AutoscalerAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalerAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {google.cloud.compute.v1.IAutoscalerAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalerAggregatedList} AutoscalerAggregatedList instance + */ + AutoscalerAggregatedList.create = function create(properties) { + return new AutoscalerAggregatedList(properties); + }; + + /** + * Encodes the specified AutoscalerAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.AutoscalerAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {google.cloud.compute.v1.IAutoscalerAggregatedList} message AutoscalerAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalerAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.AutoscalersScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified AutoscalerAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalerAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {google.cloud.compute.v1.IAutoscalerAggregatedList} message AutoscalerAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalerAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalerAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalerAggregatedList} AutoscalerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalerAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalerAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.AutoscalersScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalerAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalerAggregatedList} AutoscalerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalerAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalerAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalerAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.AutoscalersScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AutoscalerAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalerAggregatedList} AutoscalerAggregatedList + */ + AutoscalerAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalerAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalerAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalerAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalerAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.AutoscalersScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.AutoscalerAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalerAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AutoscalerAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @static + * @param {google.cloud.compute.v1.AutoscalerAggregatedList} message AutoscalerAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalerAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.AutoscalersScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this AutoscalerAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalerAggregatedList + * @instance + * @returns {Object.} JSON object + */ + AutoscalerAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AutoscalerAggregatedList; + })(); + + v1.AutoscalerList = (function() { + + /** + * Properties of an AutoscalerList. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalerList + * @property {string|null} [id] AutoscalerList id + * @property {Array.|null} [items] AutoscalerList items + * @property {string|null} [kind] AutoscalerList kind + * @property {string|null} [nextPageToken] AutoscalerList nextPageToken + * @property {string|null} [selfLink] AutoscalerList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] AutoscalerList warning + */ + + /** + * Constructs a new AutoscalerList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalerList. + * @implements IAutoscalerList + * @constructor + * @param {google.cloud.compute.v1.IAutoscalerList=} [properties] Properties to set + */ + function AutoscalerList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalerList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + AutoscalerList.prototype.id = null; + + /** + * AutoscalerList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + AutoscalerList.prototype.items = $util.emptyArray; + + /** + * AutoscalerList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + AutoscalerList.prototype.kind = null; + + /** + * AutoscalerList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + AutoscalerList.prototype.nextPageToken = null; + + /** + * AutoscalerList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + AutoscalerList.prototype.selfLink = null; + + /** + * AutoscalerList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + AutoscalerList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalerList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + Object.defineProperty(AutoscalerList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + Object.defineProperty(AutoscalerList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + Object.defineProperty(AutoscalerList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + Object.defineProperty(AutoscalerList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalerList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + */ + Object.defineProperty(AutoscalerList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalerList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {google.cloud.compute.v1.IAutoscalerList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalerList} AutoscalerList instance + */ + AutoscalerList.create = function create(properties) { + return new AutoscalerList(properties); + }; + + /** + * Encodes the specified AutoscalerList message. Does not implicitly {@link google.cloud.compute.v1.AutoscalerList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {google.cloud.compute.v1.IAutoscalerList} message AutoscalerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalerList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Autoscaler.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified AutoscalerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalerList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {google.cloud.compute.v1.IAutoscalerList} message AutoscalerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalerList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalerList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalerList} AutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalerList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalerList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalerList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalerList} AutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalerList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalerList message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalerList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an AutoscalerList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalerList} AutoscalerList + */ + AutoscalerList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalerList) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalerList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.AutoscalerList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalerList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalerList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an AutoscalerList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalerList + * @static + * @param {google.cloud.compute.v1.AutoscalerList} message AutoscalerList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalerList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Autoscaler.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this AutoscalerList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalerList + * @instance + * @returns {Object.} JSON object + */ + AutoscalerList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AutoscalerList; + })(); + + v1.AutoscalingPolicyCpuUtilization = (function() { + + /** + * Properties of an AutoscalingPolicyCpuUtilization. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalingPolicyCpuUtilization + * @property {google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod|null} [predictiveMethod] AutoscalingPolicyCpuUtilization predictiveMethod + * @property {number|null} [utilizationTarget] AutoscalingPolicyCpuUtilization utilizationTarget + */ + + /** + * Constructs a new AutoscalingPolicyCpuUtilization. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalingPolicyCpuUtilization. + * @implements IAutoscalingPolicyCpuUtilization + * @constructor + * @param {google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization=} [properties] Properties to set + */ + function AutoscalingPolicyCpuUtilization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingPolicyCpuUtilization predictiveMethod. + * @member {google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod|null|undefined} predictiveMethod + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @instance + */ + AutoscalingPolicyCpuUtilization.prototype.predictiveMethod = null; + + /** + * AutoscalingPolicyCpuUtilization utilizationTarget. + * @member {number|null|undefined} utilizationTarget + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @instance + */ + AutoscalingPolicyCpuUtilization.prototype.utilizationTarget = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingPolicyCpuUtilization _predictiveMethod. + * @member {"predictiveMethod"|undefined} _predictiveMethod + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyCpuUtilization.prototype, "_predictiveMethod", { + get: $util.oneOfGetter($oneOfFields = ["predictiveMethod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyCpuUtilization _utilizationTarget. + * @member {"utilizationTarget"|undefined} _utilizationTarget + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyCpuUtilization.prototype, "_utilizationTarget", { + get: $util.oneOfGetter($oneOfFields = ["utilizationTarget"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingPolicyCpuUtilization instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalingPolicyCpuUtilization} AutoscalingPolicyCpuUtilization instance + */ + AutoscalingPolicyCpuUtilization.create = function create(properties) { + return new AutoscalingPolicyCpuUtilization(properties); + }; + + /** + * Encodes the specified AutoscalingPolicyCpuUtilization message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization} message AutoscalingPolicyCpuUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyCpuUtilization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utilizationTarget != null && Object.hasOwnProperty.call(message, "utilizationTarget")) + writer.uint32(/* id 215905870, wireType 1 =*/1727246961).double(message.utilizationTarget); + if (message.predictiveMethod != null && Object.hasOwnProperty.call(message, "predictiveMethod")) + writer.uint32(/* id 390220737, wireType 0 =*/3121765896).int32(message.predictiveMethod); + return writer; + }; + + /** + * Encodes the specified AutoscalingPolicyCpuUtilization message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyCpuUtilization} message AutoscalingPolicyCpuUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyCpuUtilization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingPolicyCpuUtilization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalingPolicyCpuUtilization} AutoscalingPolicyCpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyCpuUtilization.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 390220737: + message.predictiveMethod = reader.int32(); + break; + case 215905870: + message.utilizationTarget = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingPolicyCpuUtilization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalingPolicyCpuUtilization} AutoscalingPolicyCpuUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyCpuUtilization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingPolicyCpuUtilization message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingPolicyCpuUtilization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.predictiveMethod != null && message.hasOwnProperty("predictiveMethod")) { + properties._predictiveMethod = 1; + switch (message.predictiveMethod) { + default: + return "predictiveMethod: enum value expected"; + case 0: + case 2402104: + case 11629437: + break; + } + } + if (message.utilizationTarget != null && message.hasOwnProperty("utilizationTarget")) { + properties._utilizationTarget = 1; + if (typeof message.utilizationTarget !== "number") + return "utilizationTarget: number expected"; + } + return null; + }; + + /** + * Creates an AutoscalingPolicyCpuUtilization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalingPolicyCpuUtilization} AutoscalingPolicyCpuUtilization + */ + AutoscalingPolicyCpuUtilization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization(); + switch (object.predictiveMethod) { + case "UNDEFINED_PREDICTIVE_METHOD": + case 0: + message.predictiveMethod = 0; + break; + case "NONE": + case 2402104: + message.predictiveMethod = 2402104; + break; + case "OPTIMIZE_AVAILABILITY": + case 11629437: + message.predictiveMethod = 11629437; + break; + } + if (object.utilizationTarget != null) + message.utilizationTarget = Number(object.utilizationTarget); + return message; + }; + + /** + * Creates a plain object from an AutoscalingPolicyCpuUtilization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @static + * @param {google.cloud.compute.v1.AutoscalingPolicyCpuUtilization} message AutoscalingPolicyCpuUtilization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingPolicyCpuUtilization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.utilizationTarget != null && message.hasOwnProperty("utilizationTarget")) { + object.utilizationTarget = options.json && !isFinite(message.utilizationTarget) ? String(message.utilizationTarget) : message.utilizationTarget; + if (options.oneofs) + object._utilizationTarget = "utilizationTarget"; + } + if (message.predictiveMethod != null && message.hasOwnProperty("predictiveMethod")) { + object.predictiveMethod = options.enums === String ? $root.google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod[message.predictiveMethod] : message.predictiveMethod; + if (options.oneofs) + object._predictiveMethod = "predictiveMethod"; + } + return object; + }; + + /** + * Converts this AutoscalingPolicyCpuUtilization to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalingPolicyCpuUtilization + * @instance + * @returns {Object.} JSON object + */ + AutoscalingPolicyCpuUtilization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PredictiveMethod enum. + * @name google.cloud.compute.v1.AutoscalingPolicyCpuUtilization.PredictiveMethod + * @enum {number} + * @property {number} UNDEFINED_PREDICTIVE_METHOD=0 UNDEFINED_PREDICTIVE_METHOD value + * @property {number} NONE=2402104 NONE value + * @property {number} OPTIMIZE_AVAILABILITY=11629437 OPTIMIZE_AVAILABILITY value + */ + AutoscalingPolicyCpuUtilization.PredictiveMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PREDICTIVE_METHOD"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[11629437] = "OPTIMIZE_AVAILABILITY"] = 11629437; + return values; + })(); + + return AutoscalingPolicyCpuUtilization; + })(); + + v1.AutoscalingPolicyCustomMetricUtilization = (function() { + + /** + * Properties of an AutoscalingPolicyCustomMetricUtilization. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalingPolicyCustomMetricUtilization + * @property {string|null} [filter] AutoscalingPolicyCustomMetricUtilization filter + * @property {string|null} [metric] AutoscalingPolicyCustomMetricUtilization metric + * @property {number|null} [singleInstanceAssignment] AutoscalingPolicyCustomMetricUtilization singleInstanceAssignment + * @property {number|null} [utilizationTarget] AutoscalingPolicyCustomMetricUtilization utilizationTarget + * @property {google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType|null} [utilizationTargetType] AutoscalingPolicyCustomMetricUtilization utilizationTargetType + */ + + /** + * Constructs a new AutoscalingPolicyCustomMetricUtilization. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalingPolicyCustomMetricUtilization. + * @implements IAutoscalingPolicyCustomMetricUtilization + * @constructor + * @param {google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization=} [properties] Properties to set + */ + function AutoscalingPolicyCustomMetricUtilization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingPolicyCustomMetricUtilization filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + AutoscalingPolicyCustomMetricUtilization.prototype.filter = null; + + /** + * AutoscalingPolicyCustomMetricUtilization metric. + * @member {string|null|undefined} metric + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + AutoscalingPolicyCustomMetricUtilization.prototype.metric = null; + + /** + * AutoscalingPolicyCustomMetricUtilization singleInstanceAssignment. + * @member {number|null|undefined} singleInstanceAssignment + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + AutoscalingPolicyCustomMetricUtilization.prototype.singleInstanceAssignment = null; + + /** + * AutoscalingPolicyCustomMetricUtilization utilizationTarget. + * @member {number|null|undefined} utilizationTarget + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + AutoscalingPolicyCustomMetricUtilization.prototype.utilizationTarget = null; + + /** + * AutoscalingPolicyCustomMetricUtilization utilizationTargetType. + * @member {google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType|null|undefined} utilizationTargetType + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + AutoscalingPolicyCustomMetricUtilization.prototype.utilizationTargetType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingPolicyCustomMetricUtilization _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyCustomMetricUtilization.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyCustomMetricUtilization _metric. + * @member {"metric"|undefined} _metric + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyCustomMetricUtilization.prototype, "_metric", { + get: $util.oneOfGetter($oneOfFields = ["metric"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyCustomMetricUtilization _singleInstanceAssignment. + * @member {"singleInstanceAssignment"|undefined} _singleInstanceAssignment + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyCustomMetricUtilization.prototype, "_singleInstanceAssignment", { + get: $util.oneOfGetter($oneOfFields = ["singleInstanceAssignment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyCustomMetricUtilization _utilizationTarget. + * @member {"utilizationTarget"|undefined} _utilizationTarget + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyCustomMetricUtilization.prototype, "_utilizationTarget", { + get: $util.oneOfGetter($oneOfFields = ["utilizationTarget"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyCustomMetricUtilization _utilizationTargetType. + * @member {"utilizationTargetType"|undefined} _utilizationTargetType + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyCustomMetricUtilization.prototype, "_utilizationTargetType", { + get: $util.oneOfGetter($oneOfFields = ["utilizationTargetType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingPolicyCustomMetricUtilization instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization} AutoscalingPolicyCustomMetricUtilization instance + */ + AutoscalingPolicyCustomMetricUtilization.create = function create(properties) { + return new AutoscalingPolicyCustomMetricUtilization(properties); + }; + + /** + * Encodes the specified AutoscalingPolicyCustomMetricUtilization message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization} message AutoscalingPolicyCustomMetricUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyCustomMetricUtilization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utilizationTarget != null && Object.hasOwnProperty.call(message, "utilizationTarget")) + writer.uint32(/* id 215905870, wireType 1 =*/1727246961).double(message.utilizationTarget); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.utilizationTargetType != null && Object.hasOwnProperty.call(message, "utilizationTargetType")) + writer.uint32(/* id 340169355, wireType 0 =*/2721354840).int32(message.utilizationTargetType); + if (message.singleInstanceAssignment != null && Object.hasOwnProperty.call(message, "singleInstanceAssignment")) + writer.uint32(/* id 504768064, wireType 1 =*/4038144513).double(message.singleInstanceAssignment); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + writer.uint32(/* id 533067184, wireType 2 =*/4264537474).string(message.metric); + return writer; + }; + + /** + * Encodes the specified AutoscalingPolicyCustomMetricUtilization message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyCustomMetricUtilization} message AutoscalingPolicyCustomMetricUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyCustomMetricUtilization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingPolicyCustomMetricUtilization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization} AutoscalingPolicyCustomMetricUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyCustomMetricUtilization.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 533067184: + message.metric = reader.string(); + break; + case 504768064: + message.singleInstanceAssignment = reader.double(); + break; + case 215905870: + message.utilizationTarget = reader.double(); + break; + case 340169355: + message.utilizationTargetType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingPolicyCustomMetricUtilization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization} AutoscalingPolicyCustomMetricUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyCustomMetricUtilization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingPolicyCustomMetricUtilization message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingPolicyCustomMetricUtilization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.metric != null && message.hasOwnProperty("metric")) { + properties._metric = 1; + if (!$util.isString(message.metric)) + return "metric: string expected"; + } + if (message.singleInstanceAssignment != null && message.hasOwnProperty("singleInstanceAssignment")) { + properties._singleInstanceAssignment = 1; + if (typeof message.singleInstanceAssignment !== "number") + return "singleInstanceAssignment: number expected"; + } + if (message.utilizationTarget != null && message.hasOwnProperty("utilizationTarget")) { + properties._utilizationTarget = 1; + if (typeof message.utilizationTarget !== "number") + return "utilizationTarget: number expected"; + } + if (message.utilizationTargetType != null && message.hasOwnProperty("utilizationTargetType")) { + properties._utilizationTargetType = 1; + switch (message.utilizationTargetType) { + default: + return "utilizationTargetType: enum value expected"; + case 0: + case 87432861: + case 255180029: + case 67590361: + break; + } + } + return null; + }; + + /** + * Creates an AutoscalingPolicyCustomMetricUtilization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization} AutoscalingPolicyCustomMetricUtilization + */ + AutoscalingPolicyCustomMetricUtilization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.metric != null) + message.metric = String(object.metric); + if (object.singleInstanceAssignment != null) + message.singleInstanceAssignment = Number(object.singleInstanceAssignment); + if (object.utilizationTarget != null) + message.utilizationTarget = Number(object.utilizationTarget); + switch (object.utilizationTargetType) { + case "UNDEFINED_UTILIZATION_TARGET_TYPE": + case 0: + message.utilizationTargetType = 0; + break; + case "DELTA_PER_MINUTE": + case 87432861: + message.utilizationTargetType = 87432861; + break; + case "DELTA_PER_SECOND": + case 255180029: + message.utilizationTargetType = 255180029; + break; + case "GAUGE": + case 67590361: + message.utilizationTargetType = 67590361; + break; + } + return message; + }; + + /** + * Creates a plain object from an AutoscalingPolicyCustomMetricUtilization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @static + * @param {google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization} message AutoscalingPolicyCustomMetricUtilization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingPolicyCustomMetricUtilization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.utilizationTarget != null && message.hasOwnProperty("utilizationTarget")) { + object.utilizationTarget = options.json && !isFinite(message.utilizationTarget) ? String(message.utilizationTarget) : message.utilizationTarget; + if (options.oneofs) + object._utilizationTarget = "utilizationTarget"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.utilizationTargetType != null && message.hasOwnProperty("utilizationTargetType")) { + object.utilizationTargetType = options.enums === String ? $root.google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType[message.utilizationTargetType] : message.utilizationTargetType; + if (options.oneofs) + object._utilizationTargetType = "utilizationTargetType"; + } + if (message.singleInstanceAssignment != null && message.hasOwnProperty("singleInstanceAssignment")) { + object.singleInstanceAssignment = options.json && !isFinite(message.singleInstanceAssignment) ? String(message.singleInstanceAssignment) : message.singleInstanceAssignment; + if (options.oneofs) + object._singleInstanceAssignment = "singleInstanceAssignment"; + } + if (message.metric != null && message.hasOwnProperty("metric")) { + object.metric = message.metric; + if (options.oneofs) + object._metric = "metric"; + } + return object; + }; + + /** + * Converts this AutoscalingPolicyCustomMetricUtilization to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization + * @instance + * @returns {Object.} JSON object + */ + AutoscalingPolicyCustomMetricUtilization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * UtilizationTargetType enum. + * @name google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType + * @enum {number} + * @property {number} UNDEFINED_UTILIZATION_TARGET_TYPE=0 UNDEFINED_UTILIZATION_TARGET_TYPE value + * @property {number} DELTA_PER_MINUTE=87432861 DELTA_PER_MINUTE value + * @property {number} DELTA_PER_SECOND=255180029 DELTA_PER_SECOND value + * @property {number} GAUGE=67590361 GAUGE value + */ + AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_UTILIZATION_TARGET_TYPE"] = 0; + values[valuesById[87432861] = "DELTA_PER_MINUTE"] = 87432861; + values[valuesById[255180029] = "DELTA_PER_SECOND"] = 255180029; + values[valuesById[67590361] = "GAUGE"] = 67590361; + return values; + })(); + + return AutoscalingPolicyCustomMetricUtilization; + })(); + + v1.AutoscalingPolicyLoadBalancingUtilization = (function() { + + /** + * Properties of an AutoscalingPolicyLoadBalancingUtilization. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalingPolicyLoadBalancingUtilization + * @property {number|null} [utilizationTarget] AutoscalingPolicyLoadBalancingUtilization utilizationTarget + */ + + /** + * Constructs a new AutoscalingPolicyLoadBalancingUtilization. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalingPolicyLoadBalancingUtilization. + * @implements IAutoscalingPolicyLoadBalancingUtilization + * @constructor + * @param {google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization=} [properties] Properties to set + */ + function AutoscalingPolicyLoadBalancingUtilization(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingPolicyLoadBalancingUtilization utilizationTarget. + * @member {number|null|undefined} utilizationTarget + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @instance + */ + AutoscalingPolicyLoadBalancingUtilization.prototype.utilizationTarget = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingPolicyLoadBalancingUtilization _utilizationTarget. + * @member {"utilizationTarget"|undefined} _utilizationTarget + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @instance + */ + Object.defineProperty(AutoscalingPolicyLoadBalancingUtilization.prototype, "_utilizationTarget", { + get: $util.oneOfGetter($oneOfFields = ["utilizationTarget"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingPolicyLoadBalancingUtilization instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization} AutoscalingPolicyLoadBalancingUtilization instance + */ + AutoscalingPolicyLoadBalancingUtilization.create = function create(properties) { + return new AutoscalingPolicyLoadBalancingUtilization(properties); + }; + + /** + * Encodes the specified AutoscalingPolicyLoadBalancingUtilization message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization} message AutoscalingPolicyLoadBalancingUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyLoadBalancingUtilization.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.utilizationTarget != null && Object.hasOwnProperty.call(message, "utilizationTarget")) + writer.uint32(/* id 215905870, wireType 1 =*/1727246961).double(message.utilizationTarget); + return writer; + }; + + /** + * Encodes the specified AutoscalingPolicyLoadBalancingUtilization message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyLoadBalancingUtilization} message AutoscalingPolicyLoadBalancingUtilization message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyLoadBalancingUtilization.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingPolicyLoadBalancingUtilization message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization} AutoscalingPolicyLoadBalancingUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyLoadBalancingUtilization.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 215905870: + message.utilizationTarget = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingPolicyLoadBalancingUtilization message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization} AutoscalingPolicyLoadBalancingUtilization + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyLoadBalancingUtilization.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingPolicyLoadBalancingUtilization message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingPolicyLoadBalancingUtilization.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.utilizationTarget != null && message.hasOwnProperty("utilizationTarget")) { + properties._utilizationTarget = 1; + if (typeof message.utilizationTarget !== "number") + return "utilizationTarget: number expected"; + } + return null; + }; + + /** + * Creates an AutoscalingPolicyLoadBalancingUtilization message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization} AutoscalingPolicyLoadBalancingUtilization + */ + AutoscalingPolicyLoadBalancingUtilization.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization(); + if (object.utilizationTarget != null) + message.utilizationTarget = Number(object.utilizationTarget); + return message; + }; + + /** + * Creates a plain object from an AutoscalingPolicyLoadBalancingUtilization message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @static + * @param {google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization} message AutoscalingPolicyLoadBalancingUtilization + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingPolicyLoadBalancingUtilization.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.utilizationTarget != null && message.hasOwnProperty("utilizationTarget")) { + object.utilizationTarget = options.json && !isFinite(message.utilizationTarget) ? String(message.utilizationTarget) : message.utilizationTarget; + if (options.oneofs) + object._utilizationTarget = "utilizationTarget"; + } + return object; + }; + + /** + * Converts this AutoscalingPolicyLoadBalancingUtilization to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalingPolicyLoadBalancingUtilization + * @instance + * @returns {Object.} JSON object + */ + AutoscalingPolicyLoadBalancingUtilization.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AutoscalingPolicyLoadBalancingUtilization; + })(); + + v1.AutoscalingPolicyScaleInControl = (function() { + + /** + * Properties of an AutoscalingPolicyScaleInControl. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalingPolicyScaleInControl + * @property {google.cloud.compute.v1.IFixedOrPercent|null} [maxScaledInReplicas] AutoscalingPolicyScaleInControl maxScaledInReplicas + * @property {number|null} [timeWindowSec] AutoscalingPolicyScaleInControl timeWindowSec + */ + + /** + * Constructs a new AutoscalingPolicyScaleInControl. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalingPolicyScaleInControl. + * @implements IAutoscalingPolicyScaleInControl + * @constructor + * @param {google.cloud.compute.v1.IAutoscalingPolicyScaleInControl=} [properties] Properties to set + */ + function AutoscalingPolicyScaleInControl(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingPolicyScaleInControl maxScaledInReplicas. + * @member {google.cloud.compute.v1.IFixedOrPercent|null|undefined} maxScaledInReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @instance + */ + AutoscalingPolicyScaleInControl.prototype.maxScaledInReplicas = null; + + /** + * AutoscalingPolicyScaleInControl timeWindowSec. + * @member {number|null|undefined} timeWindowSec + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @instance + */ + AutoscalingPolicyScaleInControl.prototype.timeWindowSec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingPolicyScaleInControl _maxScaledInReplicas. + * @member {"maxScaledInReplicas"|undefined} _maxScaledInReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @instance + */ + Object.defineProperty(AutoscalingPolicyScaleInControl.prototype, "_maxScaledInReplicas", { + get: $util.oneOfGetter($oneOfFields = ["maxScaledInReplicas"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyScaleInControl _timeWindowSec. + * @member {"timeWindowSec"|undefined} _timeWindowSec + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @instance + */ + Object.defineProperty(AutoscalingPolicyScaleInControl.prototype, "_timeWindowSec", { + get: $util.oneOfGetter($oneOfFields = ["timeWindowSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingPolicyScaleInControl instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyScaleInControl=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalingPolicyScaleInControl} AutoscalingPolicyScaleInControl instance + */ + AutoscalingPolicyScaleInControl.create = function create(properties) { + return new AutoscalingPolicyScaleInControl(properties); + }; + + /** + * Encodes the specified AutoscalingPolicyScaleInControl message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScaleInControl.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyScaleInControl} message AutoscalingPolicyScaleInControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyScaleInControl.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeWindowSec != null && Object.hasOwnProperty.call(message, "timeWindowSec")) + writer.uint32(/* id 36405300, wireType 0 =*/291242400).int32(message.timeWindowSec); + if (message.maxScaledInReplicas != null && Object.hasOwnProperty.call(message, "maxScaledInReplicas")) + $root.google.cloud.compute.v1.FixedOrPercent.encode(message.maxScaledInReplicas, writer.uint32(/* id 180710123, wireType 2 =*/1445680986).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoscalingPolicyScaleInControl message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScaleInControl.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyScaleInControl} message AutoscalingPolicyScaleInControl message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyScaleInControl.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingPolicyScaleInControl message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalingPolicyScaleInControl} AutoscalingPolicyScaleInControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyScaleInControl.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 180710123: + message.maxScaledInReplicas = $root.google.cloud.compute.v1.FixedOrPercent.decode(reader, reader.uint32()); + break; + case 36405300: + message.timeWindowSec = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingPolicyScaleInControl message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalingPolicyScaleInControl} AutoscalingPolicyScaleInControl + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyScaleInControl.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingPolicyScaleInControl message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingPolicyScaleInControl.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxScaledInReplicas != null && message.hasOwnProperty("maxScaledInReplicas")) { + properties._maxScaledInReplicas = 1; + { + var error = $root.google.cloud.compute.v1.FixedOrPercent.verify(message.maxScaledInReplicas); + if (error) + return "maxScaledInReplicas." + error; + } + } + if (message.timeWindowSec != null && message.hasOwnProperty("timeWindowSec")) { + properties._timeWindowSec = 1; + if (!$util.isInteger(message.timeWindowSec)) + return "timeWindowSec: integer expected"; + } + return null; + }; + + /** + * Creates an AutoscalingPolicyScaleInControl message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalingPolicyScaleInControl} AutoscalingPolicyScaleInControl + */ + AutoscalingPolicyScaleInControl.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalingPolicyScaleInControl(); + if (object.maxScaledInReplicas != null) { + if (typeof object.maxScaledInReplicas !== "object") + throw TypeError(".google.cloud.compute.v1.AutoscalingPolicyScaleInControl.maxScaledInReplicas: object expected"); + message.maxScaledInReplicas = $root.google.cloud.compute.v1.FixedOrPercent.fromObject(object.maxScaledInReplicas); + } + if (object.timeWindowSec != null) + message.timeWindowSec = object.timeWindowSec | 0; + return message; + }; + + /** + * Creates a plain object from an AutoscalingPolicyScaleInControl message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @static + * @param {google.cloud.compute.v1.AutoscalingPolicyScaleInControl} message AutoscalingPolicyScaleInControl + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingPolicyScaleInControl.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.timeWindowSec != null && message.hasOwnProperty("timeWindowSec")) { + object.timeWindowSec = message.timeWindowSec; + if (options.oneofs) + object._timeWindowSec = "timeWindowSec"; + } + if (message.maxScaledInReplicas != null && message.hasOwnProperty("maxScaledInReplicas")) { + object.maxScaledInReplicas = $root.google.cloud.compute.v1.FixedOrPercent.toObject(message.maxScaledInReplicas, options); + if (options.oneofs) + object._maxScaledInReplicas = "maxScaledInReplicas"; + } + return object; + }; + + /** + * Converts this AutoscalingPolicyScaleInControl to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalingPolicyScaleInControl + * @instance + * @returns {Object.} JSON object + */ + AutoscalingPolicyScaleInControl.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AutoscalingPolicyScaleInControl; + })(); + + v1.AutoscalingPolicyScalingSchedule = (function() { + + /** + * Properties of an AutoscalingPolicyScalingSchedule. + * @memberof google.cloud.compute.v1 + * @interface IAutoscalingPolicyScalingSchedule + * @property {string|null} [description] AutoscalingPolicyScalingSchedule description + * @property {boolean|null} [disabled] AutoscalingPolicyScalingSchedule disabled + * @property {number|null} [durationSec] AutoscalingPolicyScalingSchedule durationSec + * @property {number|null} [minRequiredReplicas] AutoscalingPolicyScalingSchedule minRequiredReplicas + * @property {string|null} [schedule] AutoscalingPolicyScalingSchedule schedule + * @property {string|null} [timeZone] AutoscalingPolicyScalingSchedule timeZone + */ + + /** + * Constructs a new AutoscalingPolicyScalingSchedule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AutoscalingPolicyScalingSchedule. + * @implements IAutoscalingPolicyScalingSchedule + * @constructor + * @param {google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule=} [properties] Properties to set + */ + function AutoscalingPolicyScalingSchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingPolicyScalingSchedule description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + AutoscalingPolicyScalingSchedule.prototype.description = null; + + /** + * AutoscalingPolicyScalingSchedule disabled. + * @member {boolean|null|undefined} disabled + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + AutoscalingPolicyScalingSchedule.prototype.disabled = null; + + /** + * AutoscalingPolicyScalingSchedule durationSec. + * @member {number|null|undefined} durationSec + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + AutoscalingPolicyScalingSchedule.prototype.durationSec = null; + + /** + * AutoscalingPolicyScalingSchedule minRequiredReplicas. + * @member {number|null|undefined} minRequiredReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + AutoscalingPolicyScalingSchedule.prototype.minRequiredReplicas = null; + + /** + * AutoscalingPolicyScalingSchedule schedule. + * @member {string|null|undefined} schedule + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + AutoscalingPolicyScalingSchedule.prototype.schedule = null; + + /** + * AutoscalingPolicyScalingSchedule timeZone. + * @member {string|null|undefined} timeZone + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + AutoscalingPolicyScalingSchedule.prototype.timeZone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingPolicyScalingSchedule _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + Object.defineProperty(AutoscalingPolicyScalingSchedule.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyScalingSchedule _disabled. + * @member {"disabled"|undefined} _disabled + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + Object.defineProperty(AutoscalingPolicyScalingSchedule.prototype, "_disabled", { + get: $util.oneOfGetter($oneOfFields = ["disabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyScalingSchedule _durationSec. + * @member {"durationSec"|undefined} _durationSec + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + Object.defineProperty(AutoscalingPolicyScalingSchedule.prototype, "_durationSec", { + get: $util.oneOfGetter($oneOfFields = ["durationSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyScalingSchedule _minRequiredReplicas. + * @member {"minRequiredReplicas"|undefined} _minRequiredReplicas + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + Object.defineProperty(AutoscalingPolicyScalingSchedule.prototype, "_minRequiredReplicas", { + get: $util.oneOfGetter($oneOfFields = ["minRequiredReplicas"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyScalingSchedule _schedule. + * @member {"schedule"|undefined} _schedule + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + Object.defineProperty(AutoscalingPolicyScalingSchedule.prototype, "_schedule", { + get: $util.oneOfGetter($oneOfFields = ["schedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoscalingPolicyScalingSchedule _timeZone. + * @member {"timeZone"|undefined} _timeZone + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + */ + Object.defineProperty(AutoscalingPolicyScalingSchedule.prototype, "_timeZone", { + get: $util.oneOfGetter($oneOfFields = ["timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingPolicyScalingSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AutoscalingPolicyScalingSchedule} AutoscalingPolicyScalingSchedule instance + */ + AutoscalingPolicyScalingSchedule.create = function create(properties) { + return new AutoscalingPolicyScalingSchedule(properties); + }; + + /** + * Encodes the specified AutoscalingPolicyScalingSchedule message. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule} message AutoscalingPolicyScalingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyScalingSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 36848094, wireType 2 =*/294784754).string(message.timeZone); + if (message.durationSec != null && Object.hasOwnProperty.call(message, "durationSec")) + writer.uint32(/* id 212356902, wireType 0 =*/1698855216).int32(message.durationSec); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 270940796, wireType 0 =*/2167526368).bool(message.disabled); + if (message.minRequiredReplicas != null && Object.hasOwnProperty.call(message, "minRequiredReplicas")) + writer.uint32(/* id 365514414, wireType 0 =*/2924115312).int32(message.minRequiredReplicas); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 375820951, wireType 2 =*/3006567610).string(message.schedule); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + return writer; + }; + + /** + * Encodes the specified AutoscalingPolicyScalingSchedule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AutoscalingPolicyScalingSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {google.cloud.compute.v1.IAutoscalingPolicyScalingSchedule} message AutoscalingPolicyScalingSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicyScalingSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingPolicyScalingSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AutoscalingPolicyScalingSchedule} AutoscalingPolicyScalingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyScalingSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 270940796: + message.disabled = reader.bool(); + break; + case 212356902: + message.durationSec = reader.int32(); + break; + case 365514414: + message.minRequiredReplicas = reader.int32(); + break; + case 375820951: + message.schedule = reader.string(); + break; + case 36848094: + message.timeZone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingPolicyScalingSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AutoscalingPolicyScalingSchedule} AutoscalingPolicyScalingSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicyScalingSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingPolicyScalingSchedule message. + * @function verify + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingPolicyScalingSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + properties._disabled = 1; + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + } + if (message.durationSec != null && message.hasOwnProperty("durationSec")) { + properties._durationSec = 1; + if (!$util.isInteger(message.durationSec)) + return "durationSec: integer expected"; + } + if (message.minRequiredReplicas != null && message.hasOwnProperty("minRequiredReplicas")) { + properties._minRequiredReplicas = 1; + if (!$util.isInteger(message.minRequiredReplicas)) + return "minRequiredReplicas: integer expected"; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + properties._schedule = 1; + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + properties._timeZone = 1; + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + } + return null; + }; + + /** + * Creates an AutoscalingPolicyScalingSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AutoscalingPolicyScalingSchedule} AutoscalingPolicyScalingSchedule + */ + AutoscalingPolicyScalingSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule) + return object; + var message = new $root.google.cloud.compute.v1.AutoscalingPolicyScalingSchedule(); + if (object.description != null) + message.description = String(object.description); + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.durationSec != null) + message.durationSec = object.durationSec | 0; + if (object.minRequiredReplicas != null) + message.minRequiredReplicas = object.minRequiredReplicas | 0; + if (object.schedule != null) + message.schedule = String(object.schedule); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from an AutoscalingPolicyScalingSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @static + * @param {google.cloud.compute.v1.AutoscalingPolicyScalingSchedule} message AutoscalingPolicyScalingSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingPolicyScalingSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = message.timeZone; + if (options.oneofs) + object._timeZone = "timeZone"; + } + if (message.durationSec != null && message.hasOwnProperty("durationSec")) { + object.durationSec = message.durationSec; + if (options.oneofs) + object._durationSec = "durationSec"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + object.disabled = message.disabled; + if (options.oneofs) + object._disabled = "disabled"; + } + if (message.minRequiredReplicas != null && message.hasOwnProperty("minRequiredReplicas")) { + object.minRequiredReplicas = message.minRequiredReplicas; + if (options.oneofs) + object._minRequiredReplicas = "minRequiredReplicas"; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + object.schedule = message.schedule; + if (options.oneofs) + object._schedule = "schedule"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + return object; + }; + + /** + * Converts this AutoscalingPolicyScalingSchedule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AutoscalingPolicyScalingSchedule + * @instance + * @returns {Object.} JSON object + */ + AutoscalingPolicyScalingSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AutoscalingPolicyScalingSchedule; + })(); + + v1.FixedOrPercent = (function() { + + /** + * Properties of a FixedOrPercent. + * @memberof google.cloud.compute.v1 + * @interface IFixedOrPercent + * @property {number|null} [calculated] FixedOrPercent calculated + * @property {number|null} [fixed] FixedOrPercent fixed + * @property {number|null} [percent] FixedOrPercent percent + */ + + /** + * Constructs a new FixedOrPercent. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FixedOrPercent. + * @implements IFixedOrPercent + * @constructor + * @param {google.cloud.compute.v1.IFixedOrPercent=} [properties] Properties to set + */ + function FixedOrPercent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FixedOrPercent calculated. + * @member {number|null|undefined} calculated + * @memberof google.cloud.compute.v1.FixedOrPercent + * @instance + */ + FixedOrPercent.prototype.calculated = null; + + /** + * FixedOrPercent fixed. + * @member {number|null|undefined} fixed + * @memberof google.cloud.compute.v1.FixedOrPercent + * @instance + */ + FixedOrPercent.prototype.fixed = null; + + /** + * FixedOrPercent percent. + * @member {number|null|undefined} percent + * @memberof google.cloud.compute.v1.FixedOrPercent + * @instance + */ + FixedOrPercent.prototype.percent = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FixedOrPercent _calculated. + * @member {"calculated"|undefined} _calculated + * @memberof google.cloud.compute.v1.FixedOrPercent + * @instance + */ + Object.defineProperty(FixedOrPercent.prototype, "_calculated", { + get: $util.oneOfGetter($oneOfFields = ["calculated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FixedOrPercent _fixed. + * @member {"fixed"|undefined} _fixed + * @memberof google.cloud.compute.v1.FixedOrPercent + * @instance + */ + Object.defineProperty(FixedOrPercent.prototype, "_fixed", { + get: $util.oneOfGetter($oneOfFields = ["fixed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FixedOrPercent _percent. + * @member {"percent"|undefined} _percent + * @memberof google.cloud.compute.v1.FixedOrPercent + * @instance + */ + Object.defineProperty(FixedOrPercent.prototype, "_percent", { + get: $util.oneOfGetter($oneOfFields = ["percent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FixedOrPercent instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {google.cloud.compute.v1.IFixedOrPercent=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FixedOrPercent} FixedOrPercent instance + */ + FixedOrPercent.create = function create(properties) { + return new FixedOrPercent(properties); + }; + + /** + * Encodes the specified FixedOrPercent message. Does not implicitly {@link google.cloud.compute.v1.FixedOrPercent.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {google.cloud.compute.v1.IFixedOrPercent} message FixedOrPercent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedOrPercent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fixed != null && Object.hasOwnProperty.call(message, "fixed")) + writer.uint32(/* id 97445748, wireType 0 =*/779565984).int32(message.fixed); + if (message.percent != null && Object.hasOwnProperty.call(message, "percent")) + writer.uint32(/* id 394814533, wireType 0 =*/3158516264).int32(message.percent); + if (message.calculated != null && Object.hasOwnProperty.call(message, "calculated")) + writer.uint32(/* id 472082878, wireType 0 =*/3776663024).int32(message.calculated); + return writer; + }; + + /** + * Encodes the specified FixedOrPercent message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FixedOrPercent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {google.cloud.compute.v1.IFixedOrPercent} message FixedOrPercent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedOrPercent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FixedOrPercent} FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedOrPercent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FixedOrPercent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 472082878: + message.calculated = reader.int32(); + break; + case 97445748: + message.fixed = reader.int32(); + break; + case 394814533: + message.percent = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FixedOrPercent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FixedOrPercent} FixedOrPercent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedOrPercent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FixedOrPercent message. + * @function verify + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FixedOrPercent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.calculated != null && message.hasOwnProperty("calculated")) { + properties._calculated = 1; + if (!$util.isInteger(message.calculated)) + return "calculated: integer expected"; + } + if (message.fixed != null && message.hasOwnProperty("fixed")) { + properties._fixed = 1; + if (!$util.isInteger(message.fixed)) + return "fixed: integer expected"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + properties._percent = 1; + if (!$util.isInteger(message.percent)) + return "percent: integer expected"; + } + return null; + }; + + /** + * Creates a FixedOrPercent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FixedOrPercent} FixedOrPercent + */ + FixedOrPercent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FixedOrPercent) + return object; + var message = new $root.google.cloud.compute.v1.FixedOrPercent(); + if (object.calculated != null) + message.calculated = object.calculated | 0; + if (object.fixed != null) + message.fixed = object.fixed | 0; + if (object.percent != null) + message.percent = object.percent | 0; + return message; + }; + + /** + * Creates a plain object from a FixedOrPercent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FixedOrPercent + * @static + * @param {google.cloud.compute.v1.FixedOrPercent} message FixedOrPercent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FixedOrPercent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fixed != null && message.hasOwnProperty("fixed")) { + object.fixed = message.fixed; + if (options.oneofs) + object._fixed = "fixed"; + } + if (message.percent != null && message.hasOwnProperty("percent")) { + object.percent = message.percent; + if (options.oneofs) + object._percent = "percent"; + } + if (message.calculated != null && message.hasOwnProperty("calculated")) { + object.calculated = message.calculated; + if (options.oneofs) + object._calculated = "calculated"; + } + return object; + }; + + /** + * Converts this FixedOrPercent to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FixedOrPercent + * @instance + * @returns {Object.} JSON object + */ + FixedOrPercent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FixedOrPercent; + })(); + + v1.Backend = (function() { + + /** + * Properties of a Backend. + * @memberof google.cloud.compute.v1 + * @interface IBackend + * @property {google.cloud.compute.v1.Backend.BalancingMode|null} [balancingMode] Backend balancingMode + * @property {number|null} [capacityScaler] Backend capacityScaler + * @property {string|null} [description] Backend description + * @property {boolean|null} [failover] Backend failover + * @property {string|null} [group] Backend group + * @property {number|null} [maxConnections] Backend maxConnections + * @property {number|null} [maxConnectionsPerEndpoint] Backend maxConnectionsPerEndpoint + * @property {number|null} [maxConnectionsPerInstance] Backend maxConnectionsPerInstance + * @property {number|null} [maxRate] Backend maxRate + * @property {number|null} [maxRatePerEndpoint] Backend maxRatePerEndpoint + * @property {number|null} [maxRatePerInstance] Backend maxRatePerInstance + * @property {number|null} [maxUtilization] Backend maxUtilization + */ + + /** + * Constructs a new Backend. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Backend. + * @implements IBackend + * @constructor + * @param {google.cloud.compute.v1.IBackend=} [properties] Properties to set + */ + function Backend(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backend balancingMode. + * @member {google.cloud.compute.v1.Backend.BalancingMode|null|undefined} balancingMode + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.balancingMode = null; + + /** + * Backend capacityScaler. + * @member {number|null|undefined} capacityScaler + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.capacityScaler = null; + + /** + * Backend description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.description = null; + + /** + * Backend failover. + * @member {boolean|null|undefined} failover + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.failover = null; + + /** + * Backend group. + * @member {string|null|undefined} group + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.group = null; + + /** + * Backend maxConnections. + * @member {number|null|undefined} maxConnections + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.maxConnections = null; + + /** + * Backend maxConnectionsPerEndpoint. + * @member {number|null|undefined} maxConnectionsPerEndpoint + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.maxConnectionsPerEndpoint = null; + + /** + * Backend maxConnectionsPerInstance. + * @member {number|null|undefined} maxConnectionsPerInstance + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.maxConnectionsPerInstance = null; + + /** + * Backend maxRate. + * @member {number|null|undefined} maxRate + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.maxRate = null; + + /** + * Backend maxRatePerEndpoint. + * @member {number|null|undefined} maxRatePerEndpoint + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.maxRatePerEndpoint = null; + + /** + * Backend maxRatePerInstance. + * @member {number|null|undefined} maxRatePerInstance + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.maxRatePerInstance = null; + + /** + * Backend maxUtilization. + * @member {number|null|undefined} maxUtilization + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Backend.prototype.maxUtilization = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Backend _balancingMode. + * @member {"balancingMode"|undefined} _balancingMode + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_balancingMode", { + get: $util.oneOfGetter($oneOfFields = ["balancingMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _capacityScaler. + * @member {"capacityScaler"|undefined} _capacityScaler + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_capacityScaler", { + get: $util.oneOfGetter($oneOfFields = ["capacityScaler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _failover. + * @member {"failover"|undefined} _failover + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_failover", { + get: $util.oneOfGetter($oneOfFields = ["failover"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _group. + * @member {"group"|undefined} _group + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_group", { + get: $util.oneOfGetter($oneOfFields = ["group"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _maxConnections. + * @member {"maxConnections"|undefined} _maxConnections + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_maxConnections", { + get: $util.oneOfGetter($oneOfFields = ["maxConnections"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _maxConnectionsPerEndpoint. + * @member {"maxConnectionsPerEndpoint"|undefined} _maxConnectionsPerEndpoint + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_maxConnectionsPerEndpoint", { + get: $util.oneOfGetter($oneOfFields = ["maxConnectionsPerEndpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _maxConnectionsPerInstance. + * @member {"maxConnectionsPerInstance"|undefined} _maxConnectionsPerInstance + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_maxConnectionsPerInstance", { + get: $util.oneOfGetter($oneOfFields = ["maxConnectionsPerInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _maxRate. + * @member {"maxRate"|undefined} _maxRate + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_maxRate", { + get: $util.oneOfGetter($oneOfFields = ["maxRate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _maxRatePerEndpoint. + * @member {"maxRatePerEndpoint"|undefined} _maxRatePerEndpoint + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_maxRatePerEndpoint", { + get: $util.oneOfGetter($oneOfFields = ["maxRatePerEndpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _maxRatePerInstance. + * @member {"maxRatePerInstance"|undefined} _maxRatePerInstance + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_maxRatePerInstance", { + get: $util.oneOfGetter($oneOfFields = ["maxRatePerInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backend _maxUtilization. + * @member {"maxUtilization"|undefined} _maxUtilization + * @memberof google.cloud.compute.v1.Backend + * @instance + */ + Object.defineProperty(Backend.prototype, "_maxUtilization", { + get: $util.oneOfGetter($oneOfFields = ["maxUtilization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Backend instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {google.cloud.compute.v1.IBackend=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Backend} Backend instance + */ + Backend.create = function create(properties) { + return new Backend(properties); + }; + + /** + * Encodes the specified Backend message. Does not implicitly {@link google.cloud.compute.v1.Backend.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {google.cloud.compute.v1.IBackend} message Backend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backend.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxRatePerInstance != null && Object.hasOwnProperty.call(message, "maxRatePerInstance")) + writer.uint32(/* id 17599579, wireType 5 =*/140796637).float(message.maxRatePerInstance); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 98629247, wireType 2 =*/789033978).string(message.group); + if (message.maxConnectionsPerInstance != null && Object.hasOwnProperty.call(message, "maxConnectionsPerInstance")) + writer.uint32(/* id 104671900, wireType 0 =*/837375200).int32(message.maxConnectionsPerInstance); + if (message.maxConnections != null && Object.hasOwnProperty.call(message, "maxConnections")) + writer.uint32(/* id 110652154, wireType 0 =*/885217232).int32(message.maxConnections); + if (message.maxRatePerEndpoint != null && Object.hasOwnProperty.call(message, "maxRatePerEndpoint")) + writer.uint32(/* id 129832283, wireType 5 =*/1038658269).float(message.maxRatePerEndpoint); + if (message.failover != null && Object.hasOwnProperty.call(message, "failover")) + writer.uint32(/* id 138892530, wireType 0 =*/1111140240).bool(message.failover); + if (message.maxUtilization != null && Object.hasOwnProperty.call(message, "maxUtilization")) + writer.uint32(/* id 148192199, wireType 5 =*/1185537597).float(message.maxUtilization); + if (message.maxConnectionsPerEndpoint != null && Object.hasOwnProperty.call(message, "maxConnectionsPerEndpoint")) + writer.uint32(/* id 216904604, wireType 0 =*/1735236832).int32(message.maxConnectionsPerEndpoint); + if (message.capacityScaler != null && Object.hasOwnProperty.call(message, "capacityScaler")) + writer.uint32(/* id 315958157, wireType 5 =*/2527665261).float(message.capacityScaler); + if (message.maxRate != null && Object.hasOwnProperty.call(message, "maxRate")) + writer.uint32(/* id 408035035, wireType 0 =*/3264280280).int32(message.maxRate); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.balancingMode != null && Object.hasOwnProperty.call(message, "balancingMode")) + writer.uint32(/* id 430286217, wireType 0 =*/3442289736).int32(message.balancingMode); + return writer; + }; + + /** + * Encodes the specified Backend message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Backend.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {google.cloud.compute.v1.IBackend} message Backend message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backend.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backend message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Backend} Backend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backend.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Backend(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 430286217: + message.balancingMode = reader.int32(); + break; + case 315958157: + message.capacityScaler = reader.float(); + break; + case 422937596: + message.description = reader.string(); + break; + case 138892530: + message.failover = reader.bool(); + break; + case 98629247: + message.group = reader.string(); + break; + case 110652154: + message.maxConnections = reader.int32(); + break; + case 216904604: + message.maxConnectionsPerEndpoint = reader.int32(); + break; + case 104671900: + message.maxConnectionsPerInstance = reader.int32(); + break; + case 408035035: + message.maxRate = reader.int32(); + break; + case 129832283: + message.maxRatePerEndpoint = reader.float(); + break; + case 17599579: + message.maxRatePerInstance = reader.float(); + break; + case 148192199: + message.maxUtilization = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backend message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Backend} Backend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backend.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backend message. + * @function verify + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backend.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.balancingMode != null && message.hasOwnProperty("balancingMode")) { + properties._balancingMode = 1; + switch (message.balancingMode) { + default: + return "balancingMode: enum value expected"; + case 0: + case 246311646: + case 2508000: + case 157008386: + break; + } + } + if (message.capacityScaler != null && message.hasOwnProperty("capacityScaler")) { + properties._capacityScaler = 1; + if (typeof message.capacityScaler !== "number") + return "capacityScaler: number expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.failover != null && message.hasOwnProperty("failover")) { + properties._failover = 1; + if (typeof message.failover !== "boolean") + return "failover: boolean expected"; + } + if (message.group != null && message.hasOwnProperty("group")) { + properties._group = 1; + if (!$util.isString(message.group)) + return "group: string expected"; + } + if (message.maxConnections != null && message.hasOwnProperty("maxConnections")) { + properties._maxConnections = 1; + if (!$util.isInteger(message.maxConnections)) + return "maxConnections: integer expected"; + } + if (message.maxConnectionsPerEndpoint != null && message.hasOwnProperty("maxConnectionsPerEndpoint")) { + properties._maxConnectionsPerEndpoint = 1; + if (!$util.isInteger(message.maxConnectionsPerEndpoint)) + return "maxConnectionsPerEndpoint: integer expected"; + } + if (message.maxConnectionsPerInstance != null && message.hasOwnProperty("maxConnectionsPerInstance")) { + properties._maxConnectionsPerInstance = 1; + if (!$util.isInteger(message.maxConnectionsPerInstance)) + return "maxConnectionsPerInstance: integer expected"; + } + if (message.maxRate != null && message.hasOwnProperty("maxRate")) { + properties._maxRate = 1; + if (!$util.isInteger(message.maxRate)) + return "maxRate: integer expected"; + } + if (message.maxRatePerEndpoint != null && message.hasOwnProperty("maxRatePerEndpoint")) { + properties._maxRatePerEndpoint = 1; + if (typeof message.maxRatePerEndpoint !== "number") + return "maxRatePerEndpoint: number expected"; + } + if (message.maxRatePerInstance != null && message.hasOwnProperty("maxRatePerInstance")) { + properties._maxRatePerInstance = 1; + if (typeof message.maxRatePerInstance !== "number") + return "maxRatePerInstance: number expected"; + } + if (message.maxUtilization != null && message.hasOwnProperty("maxUtilization")) { + properties._maxUtilization = 1; + if (typeof message.maxUtilization !== "number") + return "maxUtilization: number expected"; + } + return null; + }; + + /** + * Creates a Backend message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Backend} Backend + */ + Backend.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Backend) + return object; + var message = new $root.google.cloud.compute.v1.Backend(); + switch (object.balancingMode) { + case "UNDEFINED_BALANCING_MODE": + case 0: + message.balancingMode = 0; + break; + case "CONNECTION": + case 246311646: + message.balancingMode = 246311646; + break; + case "RATE": + case 2508000: + message.balancingMode = 2508000; + break; + case "UTILIZATION": + case 157008386: + message.balancingMode = 157008386; + break; + } + if (object.capacityScaler != null) + message.capacityScaler = Number(object.capacityScaler); + if (object.description != null) + message.description = String(object.description); + if (object.failover != null) + message.failover = Boolean(object.failover); + if (object.group != null) + message.group = String(object.group); + if (object.maxConnections != null) + message.maxConnections = object.maxConnections | 0; + if (object.maxConnectionsPerEndpoint != null) + message.maxConnectionsPerEndpoint = object.maxConnectionsPerEndpoint | 0; + if (object.maxConnectionsPerInstance != null) + message.maxConnectionsPerInstance = object.maxConnectionsPerInstance | 0; + if (object.maxRate != null) + message.maxRate = object.maxRate | 0; + if (object.maxRatePerEndpoint != null) + message.maxRatePerEndpoint = Number(object.maxRatePerEndpoint); + if (object.maxRatePerInstance != null) + message.maxRatePerInstance = Number(object.maxRatePerInstance); + if (object.maxUtilization != null) + message.maxUtilization = Number(object.maxUtilization); + return message; + }; + + /** + * Creates a plain object from a Backend message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Backend + * @static + * @param {google.cloud.compute.v1.Backend} message Backend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.maxRatePerInstance != null && message.hasOwnProperty("maxRatePerInstance")) { + object.maxRatePerInstance = options.json && !isFinite(message.maxRatePerInstance) ? String(message.maxRatePerInstance) : message.maxRatePerInstance; + if (options.oneofs) + object._maxRatePerInstance = "maxRatePerInstance"; + } + if (message.group != null && message.hasOwnProperty("group")) { + object.group = message.group; + if (options.oneofs) + object._group = "group"; + } + if (message.maxConnectionsPerInstance != null && message.hasOwnProperty("maxConnectionsPerInstance")) { + object.maxConnectionsPerInstance = message.maxConnectionsPerInstance; + if (options.oneofs) + object._maxConnectionsPerInstance = "maxConnectionsPerInstance"; + } + if (message.maxConnections != null && message.hasOwnProperty("maxConnections")) { + object.maxConnections = message.maxConnections; + if (options.oneofs) + object._maxConnections = "maxConnections"; + } + if (message.maxRatePerEndpoint != null && message.hasOwnProperty("maxRatePerEndpoint")) { + object.maxRatePerEndpoint = options.json && !isFinite(message.maxRatePerEndpoint) ? String(message.maxRatePerEndpoint) : message.maxRatePerEndpoint; + if (options.oneofs) + object._maxRatePerEndpoint = "maxRatePerEndpoint"; + } + if (message.failover != null && message.hasOwnProperty("failover")) { + object.failover = message.failover; + if (options.oneofs) + object._failover = "failover"; + } + if (message.maxUtilization != null && message.hasOwnProperty("maxUtilization")) { + object.maxUtilization = options.json && !isFinite(message.maxUtilization) ? String(message.maxUtilization) : message.maxUtilization; + if (options.oneofs) + object._maxUtilization = "maxUtilization"; + } + if (message.maxConnectionsPerEndpoint != null && message.hasOwnProperty("maxConnectionsPerEndpoint")) { + object.maxConnectionsPerEndpoint = message.maxConnectionsPerEndpoint; + if (options.oneofs) + object._maxConnectionsPerEndpoint = "maxConnectionsPerEndpoint"; + } + if (message.capacityScaler != null && message.hasOwnProperty("capacityScaler")) { + object.capacityScaler = options.json && !isFinite(message.capacityScaler) ? String(message.capacityScaler) : message.capacityScaler; + if (options.oneofs) + object._capacityScaler = "capacityScaler"; + } + if (message.maxRate != null && message.hasOwnProperty("maxRate")) { + object.maxRate = message.maxRate; + if (options.oneofs) + object._maxRate = "maxRate"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.balancingMode != null && message.hasOwnProperty("balancingMode")) { + object.balancingMode = options.enums === String ? $root.google.cloud.compute.v1.Backend.BalancingMode[message.balancingMode] : message.balancingMode; + if (options.oneofs) + object._balancingMode = "balancingMode"; + } + return object; + }; + + /** + * Converts this Backend to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Backend + * @instance + * @returns {Object.} JSON object + */ + Backend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * BalancingMode enum. + * @name google.cloud.compute.v1.Backend.BalancingMode + * @enum {number} + * @property {number} UNDEFINED_BALANCING_MODE=0 UNDEFINED_BALANCING_MODE value + * @property {number} CONNECTION=246311646 CONNECTION value + * @property {number} RATE=2508000 RATE value + * @property {number} UTILIZATION=157008386 UTILIZATION value + */ + Backend.BalancingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_BALANCING_MODE"] = 0; + values[valuesById[246311646] = "CONNECTION"] = 246311646; + values[valuesById[2508000] = "RATE"] = 2508000; + values[valuesById[157008386] = "UTILIZATION"] = 157008386; + return values; + })(); + + return Backend; + })(); + + v1.BackendBucketCdnPolicy = (function() { + + /** + * Properties of a BackendBucketCdnPolicy. + * @memberof google.cloud.compute.v1 + * @interface IBackendBucketCdnPolicy + * @property {Array.|null} [bypassCacheOnRequestHeaders] BackendBucketCdnPolicy bypassCacheOnRequestHeaders + * @property {google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode|null} [cacheMode] BackendBucketCdnPolicy cacheMode + * @property {number|null} [clientTtl] BackendBucketCdnPolicy clientTtl + * @property {number|null} [defaultTtl] BackendBucketCdnPolicy defaultTtl + * @property {number|null} [maxTtl] BackendBucketCdnPolicy maxTtl + * @property {boolean|null} [negativeCaching] BackendBucketCdnPolicy negativeCaching + * @property {Array.|null} [negativeCachingPolicy] BackendBucketCdnPolicy negativeCachingPolicy + * @property {boolean|null} [requestCoalescing] BackendBucketCdnPolicy requestCoalescing + * @property {number|null} [serveWhileStale] BackendBucketCdnPolicy serveWhileStale + * @property {number|Long|null} [signedUrlCacheMaxAgeSec] BackendBucketCdnPolicy signedUrlCacheMaxAgeSec + * @property {Array.|null} [signedUrlKeyNames] BackendBucketCdnPolicy signedUrlKeyNames + */ + + /** + * Constructs a new BackendBucketCdnPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendBucketCdnPolicy. + * @implements IBackendBucketCdnPolicy + * @constructor + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicy=} [properties] Properties to set + */ + function BackendBucketCdnPolicy(properties) { + this.bypassCacheOnRequestHeaders = []; + this.negativeCachingPolicy = []; + this.signedUrlKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendBucketCdnPolicy bypassCacheOnRequestHeaders. + * @member {Array.} bypassCacheOnRequestHeaders + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.bypassCacheOnRequestHeaders = $util.emptyArray; + + /** + * BackendBucketCdnPolicy cacheMode. + * @member {google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode|null|undefined} cacheMode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.cacheMode = null; + + /** + * BackendBucketCdnPolicy clientTtl. + * @member {number|null|undefined} clientTtl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.clientTtl = null; + + /** + * BackendBucketCdnPolicy defaultTtl. + * @member {number|null|undefined} defaultTtl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.defaultTtl = null; + + /** + * BackendBucketCdnPolicy maxTtl. + * @member {number|null|undefined} maxTtl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.maxTtl = null; + + /** + * BackendBucketCdnPolicy negativeCaching. + * @member {boolean|null|undefined} negativeCaching + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.negativeCaching = null; + + /** + * BackendBucketCdnPolicy negativeCachingPolicy. + * @member {Array.} negativeCachingPolicy + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.negativeCachingPolicy = $util.emptyArray; + + /** + * BackendBucketCdnPolicy requestCoalescing. + * @member {boolean|null|undefined} requestCoalescing + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.requestCoalescing = null; + + /** + * BackendBucketCdnPolicy serveWhileStale. + * @member {number|null|undefined} serveWhileStale + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.serveWhileStale = null; + + /** + * BackendBucketCdnPolicy signedUrlCacheMaxAgeSec. + * @member {number|Long|null|undefined} signedUrlCacheMaxAgeSec + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.signedUrlCacheMaxAgeSec = null; + + /** + * BackendBucketCdnPolicy signedUrlKeyNames. + * @member {Array.} signedUrlKeyNames + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + BackendBucketCdnPolicy.prototype.signedUrlKeyNames = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendBucketCdnPolicy _cacheMode. + * @member {"cacheMode"|undefined} _cacheMode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_cacheMode", { + get: $util.oneOfGetter($oneOfFields = ["cacheMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicy _clientTtl. + * @member {"clientTtl"|undefined} _clientTtl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_clientTtl", { + get: $util.oneOfGetter($oneOfFields = ["clientTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicy _defaultTtl. + * @member {"defaultTtl"|undefined} _defaultTtl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_defaultTtl", { + get: $util.oneOfGetter($oneOfFields = ["defaultTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicy _maxTtl. + * @member {"maxTtl"|undefined} _maxTtl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_maxTtl", { + get: $util.oneOfGetter($oneOfFields = ["maxTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicy _negativeCaching. + * @member {"negativeCaching"|undefined} _negativeCaching + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_negativeCaching", { + get: $util.oneOfGetter($oneOfFields = ["negativeCaching"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicy _requestCoalescing. + * @member {"requestCoalescing"|undefined} _requestCoalescing + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_requestCoalescing", { + get: $util.oneOfGetter($oneOfFields = ["requestCoalescing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicy _serveWhileStale. + * @member {"serveWhileStale"|undefined} _serveWhileStale + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_serveWhileStale", { + get: $util.oneOfGetter($oneOfFields = ["serveWhileStale"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicy _signedUrlCacheMaxAgeSec. + * @member {"signedUrlCacheMaxAgeSec"|undefined} _signedUrlCacheMaxAgeSec + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicy.prototype, "_signedUrlCacheMaxAgeSec", { + get: $util.oneOfGetter($oneOfFields = ["signedUrlCacheMaxAgeSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendBucketCdnPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicy} BackendBucketCdnPolicy instance + */ + BackendBucketCdnPolicy.create = function create(properties) { + return new BackendBucketCdnPolicy(properties); + }; + + /** + * Encodes the specified BackendBucketCdnPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicy} message BackendBucketCdnPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketCdnPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cacheMode != null && Object.hasOwnProperty.call(message, "cacheMode")) + writer.uint32(/* id 28877888, wireType 0 =*/231023104).int32(message.cacheMode); + if (message.clientTtl != null && Object.hasOwnProperty.call(message, "clientTtl")) + writer.uint32(/* id 29034360, wireType 0 =*/232274880).int32(message.clientTtl); + if (message.defaultTtl != null && Object.hasOwnProperty.call(message, "defaultTtl")) + writer.uint32(/* id 100253422, wireType 0 =*/802027376).int32(message.defaultTtl); + if (message.negativeCachingPolicy != null && message.negativeCachingPolicy.length) + for (var i = 0; i < message.negativeCachingPolicy.length; ++i) + $root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.encode(message.negativeCachingPolicy[i], writer.uint32(/* id 155359996, wireType 2 =*/1242879970).fork()).ldelim(); + if (message.serveWhileStale != null && Object.hasOwnProperty.call(message, "serveWhileStale")) + writer.uint32(/* id 236682203, wireType 0 =*/1893457624).int32(message.serveWhileStale); + if (message.signedUrlCacheMaxAgeSec != null && Object.hasOwnProperty.call(message, "signedUrlCacheMaxAgeSec")) + writer.uint32(/* id 269374534, wireType 0 =*/2154996272).int64(message.signedUrlCacheMaxAgeSec); + if (message.maxTtl != null && Object.hasOwnProperty.call(message, "maxTtl")) + writer.uint32(/* id 307578001, wireType 0 =*/2460624008).int32(message.maxTtl); + if (message.negativeCaching != null && Object.hasOwnProperty.call(message, "negativeCaching")) + writer.uint32(/* id 336110005, wireType 0 =*/2688880040).bool(message.negativeCaching); + if (message.signedUrlKeyNames != null && message.signedUrlKeyNames.length) + for (var i = 0; i < message.signedUrlKeyNames.length; ++i) + writer.uint32(/* id 371848885, wireType 2 =*/2974791082).string(message.signedUrlKeyNames[i]); + if (message.bypassCacheOnRequestHeaders != null && message.bypassCacheOnRequestHeaders.length) + for (var i = 0; i < message.bypassCacheOnRequestHeaders.length; ++i) + $root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.encode(message.bypassCacheOnRequestHeaders[i], writer.uint32(/* id 486203082, wireType 2 =*/3889624658).fork()).ldelim(); + if (message.requestCoalescing != null && Object.hasOwnProperty.call(message, "requestCoalescing")) + writer.uint32(/* id 532808276, wireType 0 =*/4262466208).bool(message.requestCoalescing); + return writer; + }; + + /** + * Encodes the specified BackendBucketCdnPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicy} message BackendBucketCdnPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketCdnPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendBucketCdnPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicy} BackendBucketCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketCdnPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendBucketCdnPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 486203082: + if (!(message.bypassCacheOnRequestHeaders && message.bypassCacheOnRequestHeaders.length)) + message.bypassCacheOnRequestHeaders = []; + message.bypassCacheOnRequestHeaders.push($root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.decode(reader, reader.uint32())); + break; + case 28877888: + message.cacheMode = reader.int32(); + break; + case 29034360: + message.clientTtl = reader.int32(); + break; + case 100253422: + message.defaultTtl = reader.int32(); + break; + case 307578001: + message.maxTtl = reader.int32(); + break; + case 336110005: + message.negativeCaching = reader.bool(); + break; + case 155359996: + if (!(message.negativeCachingPolicy && message.negativeCachingPolicy.length)) + message.negativeCachingPolicy = []; + message.negativeCachingPolicy.push($root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.decode(reader, reader.uint32())); + break; + case 532808276: + message.requestCoalescing = reader.bool(); + break; + case 236682203: + message.serveWhileStale = reader.int32(); + break; + case 269374534: + message.signedUrlCacheMaxAgeSec = reader.int64(); + break; + case 371848885: + if (!(message.signedUrlKeyNames && message.signedUrlKeyNames.length)) + message.signedUrlKeyNames = []; + message.signedUrlKeyNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendBucketCdnPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicy} BackendBucketCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketCdnPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendBucketCdnPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendBucketCdnPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bypassCacheOnRequestHeaders != null && message.hasOwnProperty("bypassCacheOnRequestHeaders")) { + if (!Array.isArray(message.bypassCacheOnRequestHeaders)) + return "bypassCacheOnRequestHeaders: array expected"; + for (var i = 0; i < message.bypassCacheOnRequestHeaders.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.verify(message.bypassCacheOnRequestHeaders[i]); + if (error) + return "bypassCacheOnRequestHeaders." + error; + } + } + if (message.cacheMode != null && message.hasOwnProperty("cacheMode")) { + properties._cacheMode = 1; + switch (message.cacheMode) { + default: + return "cacheMode: enum value expected"; + case 0: + case 355027945: + case 486026928: + case 381295560: + case 55380261: + break; + } + } + if (message.clientTtl != null && message.hasOwnProperty("clientTtl")) { + properties._clientTtl = 1; + if (!$util.isInteger(message.clientTtl)) + return "clientTtl: integer expected"; + } + if (message.defaultTtl != null && message.hasOwnProperty("defaultTtl")) { + properties._defaultTtl = 1; + if (!$util.isInteger(message.defaultTtl)) + return "defaultTtl: integer expected"; + } + if (message.maxTtl != null && message.hasOwnProperty("maxTtl")) { + properties._maxTtl = 1; + if (!$util.isInteger(message.maxTtl)) + return "maxTtl: integer expected"; + } + if (message.negativeCaching != null && message.hasOwnProperty("negativeCaching")) { + properties._negativeCaching = 1; + if (typeof message.negativeCaching !== "boolean") + return "negativeCaching: boolean expected"; + } + if (message.negativeCachingPolicy != null && message.hasOwnProperty("negativeCachingPolicy")) { + if (!Array.isArray(message.negativeCachingPolicy)) + return "negativeCachingPolicy: array expected"; + for (var i = 0; i < message.negativeCachingPolicy.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.verify(message.negativeCachingPolicy[i]); + if (error) + return "negativeCachingPolicy." + error; + } + } + if (message.requestCoalescing != null && message.hasOwnProperty("requestCoalescing")) { + properties._requestCoalescing = 1; + if (typeof message.requestCoalescing !== "boolean") + return "requestCoalescing: boolean expected"; + } + if (message.serveWhileStale != null && message.hasOwnProperty("serveWhileStale")) { + properties._serveWhileStale = 1; + if (!$util.isInteger(message.serveWhileStale)) + return "serveWhileStale: integer expected"; + } + if (message.signedUrlCacheMaxAgeSec != null && message.hasOwnProperty("signedUrlCacheMaxAgeSec")) { + properties._signedUrlCacheMaxAgeSec = 1; + if (!$util.isInteger(message.signedUrlCacheMaxAgeSec) && !(message.signedUrlCacheMaxAgeSec && $util.isInteger(message.signedUrlCacheMaxAgeSec.low) && $util.isInteger(message.signedUrlCacheMaxAgeSec.high))) + return "signedUrlCacheMaxAgeSec: integer|Long expected"; + } + if (message.signedUrlKeyNames != null && message.hasOwnProperty("signedUrlKeyNames")) { + if (!Array.isArray(message.signedUrlKeyNames)) + return "signedUrlKeyNames: array expected"; + for (var i = 0; i < message.signedUrlKeyNames.length; ++i) + if (!$util.isString(message.signedUrlKeyNames[i])) + return "signedUrlKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a BackendBucketCdnPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicy} BackendBucketCdnPolicy + */ + BackendBucketCdnPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendBucketCdnPolicy) + return object; + var message = new $root.google.cloud.compute.v1.BackendBucketCdnPolicy(); + if (object.bypassCacheOnRequestHeaders) { + if (!Array.isArray(object.bypassCacheOnRequestHeaders)) + throw TypeError(".google.cloud.compute.v1.BackendBucketCdnPolicy.bypassCacheOnRequestHeaders: array expected"); + message.bypassCacheOnRequestHeaders = []; + for (var i = 0; i < object.bypassCacheOnRequestHeaders.length; ++i) { + if (typeof object.bypassCacheOnRequestHeaders[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendBucketCdnPolicy.bypassCacheOnRequestHeaders: object expected"); + message.bypassCacheOnRequestHeaders[i] = $root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.fromObject(object.bypassCacheOnRequestHeaders[i]); + } + } + switch (object.cacheMode) { + case "UNDEFINED_CACHE_MODE": + case 0: + message.cacheMode = 0; + break; + case "CACHE_ALL_STATIC": + case 355027945: + message.cacheMode = 355027945; + break; + case "FORCE_CACHE_ALL": + case 486026928: + message.cacheMode = 486026928; + break; + case "INVALID_CACHE_MODE": + case 381295560: + message.cacheMode = 381295560; + break; + case "USE_ORIGIN_HEADERS": + case 55380261: + message.cacheMode = 55380261; + break; + } + if (object.clientTtl != null) + message.clientTtl = object.clientTtl | 0; + if (object.defaultTtl != null) + message.defaultTtl = object.defaultTtl | 0; + if (object.maxTtl != null) + message.maxTtl = object.maxTtl | 0; + if (object.negativeCaching != null) + message.negativeCaching = Boolean(object.negativeCaching); + if (object.negativeCachingPolicy) { + if (!Array.isArray(object.negativeCachingPolicy)) + throw TypeError(".google.cloud.compute.v1.BackendBucketCdnPolicy.negativeCachingPolicy: array expected"); + message.negativeCachingPolicy = []; + for (var i = 0; i < object.negativeCachingPolicy.length; ++i) { + if (typeof object.negativeCachingPolicy[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendBucketCdnPolicy.negativeCachingPolicy: object expected"); + message.negativeCachingPolicy[i] = $root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.fromObject(object.negativeCachingPolicy[i]); + } + } + if (object.requestCoalescing != null) + message.requestCoalescing = Boolean(object.requestCoalescing); + if (object.serveWhileStale != null) + message.serveWhileStale = object.serveWhileStale | 0; + if (object.signedUrlCacheMaxAgeSec != null) + if ($util.Long) + (message.signedUrlCacheMaxAgeSec = $util.Long.fromValue(object.signedUrlCacheMaxAgeSec)).unsigned = false; + else if (typeof object.signedUrlCacheMaxAgeSec === "string") + message.signedUrlCacheMaxAgeSec = parseInt(object.signedUrlCacheMaxAgeSec, 10); + else if (typeof object.signedUrlCacheMaxAgeSec === "number") + message.signedUrlCacheMaxAgeSec = object.signedUrlCacheMaxAgeSec; + else if (typeof object.signedUrlCacheMaxAgeSec === "object") + message.signedUrlCacheMaxAgeSec = new $util.LongBits(object.signedUrlCacheMaxAgeSec.low >>> 0, object.signedUrlCacheMaxAgeSec.high >>> 0).toNumber(); + if (object.signedUrlKeyNames) { + if (!Array.isArray(object.signedUrlKeyNames)) + throw TypeError(".google.cloud.compute.v1.BackendBucketCdnPolicy.signedUrlKeyNames: array expected"); + message.signedUrlKeyNames = []; + for (var i = 0; i < object.signedUrlKeyNames.length; ++i) + message.signedUrlKeyNames[i] = String(object.signedUrlKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a BackendBucketCdnPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @static + * @param {google.cloud.compute.v1.BackendBucketCdnPolicy} message BackendBucketCdnPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendBucketCdnPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.negativeCachingPolicy = []; + object.signedUrlKeyNames = []; + object.bypassCacheOnRequestHeaders = []; + } + if (message.cacheMode != null && message.hasOwnProperty("cacheMode")) { + object.cacheMode = options.enums === String ? $root.google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode[message.cacheMode] : message.cacheMode; + if (options.oneofs) + object._cacheMode = "cacheMode"; + } + if (message.clientTtl != null && message.hasOwnProperty("clientTtl")) { + object.clientTtl = message.clientTtl; + if (options.oneofs) + object._clientTtl = "clientTtl"; + } + if (message.defaultTtl != null && message.hasOwnProperty("defaultTtl")) { + object.defaultTtl = message.defaultTtl; + if (options.oneofs) + object._defaultTtl = "defaultTtl"; + } + if (message.negativeCachingPolicy && message.negativeCachingPolicy.length) { + object.negativeCachingPolicy = []; + for (var j = 0; j < message.negativeCachingPolicy.length; ++j) + object.negativeCachingPolicy[j] = $root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.toObject(message.negativeCachingPolicy[j], options); + } + if (message.serveWhileStale != null && message.hasOwnProperty("serveWhileStale")) { + object.serveWhileStale = message.serveWhileStale; + if (options.oneofs) + object._serveWhileStale = "serveWhileStale"; + } + if (message.signedUrlCacheMaxAgeSec != null && message.hasOwnProperty("signedUrlCacheMaxAgeSec")) { + if (typeof message.signedUrlCacheMaxAgeSec === "number") + object.signedUrlCacheMaxAgeSec = options.longs === String ? String(message.signedUrlCacheMaxAgeSec) : message.signedUrlCacheMaxAgeSec; + else + object.signedUrlCacheMaxAgeSec = options.longs === String ? $util.Long.prototype.toString.call(message.signedUrlCacheMaxAgeSec) : options.longs === Number ? new $util.LongBits(message.signedUrlCacheMaxAgeSec.low >>> 0, message.signedUrlCacheMaxAgeSec.high >>> 0).toNumber() : message.signedUrlCacheMaxAgeSec; + if (options.oneofs) + object._signedUrlCacheMaxAgeSec = "signedUrlCacheMaxAgeSec"; + } + if (message.maxTtl != null && message.hasOwnProperty("maxTtl")) { + object.maxTtl = message.maxTtl; + if (options.oneofs) + object._maxTtl = "maxTtl"; + } + if (message.negativeCaching != null && message.hasOwnProperty("negativeCaching")) { + object.negativeCaching = message.negativeCaching; + if (options.oneofs) + object._negativeCaching = "negativeCaching"; + } + if (message.signedUrlKeyNames && message.signedUrlKeyNames.length) { + object.signedUrlKeyNames = []; + for (var j = 0; j < message.signedUrlKeyNames.length; ++j) + object.signedUrlKeyNames[j] = message.signedUrlKeyNames[j]; + } + if (message.bypassCacheOnRequestHeaders && message.bypassCacheOnRequestHeaders.length) { + object.bypassCacheOnRequestHeaders = []; + for (var j = 0; j < message.bypassCacheOnRequestHeaders.length; ++j) + object.bypassCacheOnRequestHeaders[j] = $root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.toObject(message.bypassCacheOnRequestHeaders[j], options); + } + if (message.requestCoalescing != null && message.hasOwnProperty("requestCoalescing")) { + object.requestCoalescing = message.requestCoalescing; + if (options.oneofs) + object._requestCoalescing = "requestCoalescing"; + } + return object; + }; + + /** + * Converts this BackendBucketCdnPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicy + * @instance + * @returns {Object.} JSON object + */ + BackendBucketCdnPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CacheMode enum. + * @name google.cloud.compute.v1.BackendBucketCdnPolicy.CacheMode + * @enum {number} + * @property {number} UNDEFINED_CACHE_MODE=0 UNDEFINED_CACHE_MODE value + * @property {number} CACHE_ALL_STATIC=355027945 CACHE_ALL_STATIC value + * @property {number} FORCE_CACHE_ALL=486026928 FORCE_CACHE_ALL value + * @property {number} INVALID_CACHE_MODE=381295560 INVALID_CACHE_MODE value + * @property {number} USE_ORIGIN_HEADERS=55380261 USE_ORIGIN_HEADERS value + */ + BackendBucketCdnPolicy.CacheMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CACHE_MODE"] = 0; + values[valuesById[355027945] = "CACHE_ALL_STATIC"] = 355027945; + values[valuesById[486026928] = "FORCE_CACHE_ALL"] = 486026928; + values[valuesById[381295560] = "INVALID_CACHE_MODE"] = 381295560; + values[valuesById[55380261] = "USE_ORIGIN_HEADERS"] = 55380261; + return values; + })(); + + return BackendBucketCdnPolicy; + })(); + + v1.BackendBucket = (function() { + + /** + * Properties of a BackendBucket. + * @memberof google.cloud.compute.v1 + * @interface IBackendBucket + * @property {string|null} [bucketName] BackendBucket bucketName + * @property {google.cloud.compute.v1.IBackendBucketCdnPolicy|null} [cdnPolicy] BackendBucket cdnPolicy + * @property {string|null} [creationTimestamp] BackendBucket creationTimestamp + * @property {Array.|null} [customResponseHeaders] BackendBucket customResponseHeaders + * @property {string|null} [description] BackendBucket description + * @property {boolean|null} [enableCdn] BackendBucket enableCdn + * @property {number|Long|null} [id] BackendBucket id + * @property {string|null} [kind] BackendBucket kind + * @property {string|null} [name] BackendBucket name + * @property {string|null} [selfLink] BackendBucket selfLink + */ + + /** + * Constructs a new BackendBucket. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendBucket. + * @implements IBackendBucket + * @constructor + * @param {google.cloud.compute.v1.IBackendBucket=} [properties] Properties to set + */ + function BackendBucket(properties) { + this.customResponseHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendBucket bucketName. + * @member {string|null|undefined} bucketName + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.bucketName = null; + + /** + * BackendBucket cdnPolicy. + * @member {google.cloud.compute.v1.IBackendBucketCdnPolicy|null|undefined} cdnPolicy + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.cdnPolicy = null; + + /** + * BackendBucket creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.creationTimestamp = null; + + /** + * BackendBucket customResponseHeaders. + * @member {Array.} customResponseHeaders + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.customResponseHeaders = $util.emptyArray; + + /** + * BackendBucket description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.description = null; + + /** + * BackendBucket enableCdn. + * @member {boolean|null|undefined} enableCdn + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.enableCdn = null; + + /** + * BackendBucket id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.id = null; + + /** + * BackendBucket kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.kind = null; + + /** + * BackendBucket name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.name = null; + + /** + * BackendBucket selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + BackendBucket.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendBucket _bucketName. + * @member {"bucketName"|undefined} _bucketName + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_bucketName", { + get: $util.oneOfGetter($oneOfFields = ["bucketName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _cdnPolicy. + * @member {"cdnPolicy"|undefined} _cdnPolicy + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_cdnPolicy", { + get: $util.oneOfGetter($oneOfFields = ["cdnPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _enableCdn. + * @member {"enableCdn"|undefined} _enableCdn + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_enableCdn", { + get: $util.oneOfGetter($oneOfFields = ["enableCdn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucket _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + */ + Object.defineProperty(BackendBucket.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendBucket instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {google.cloud.compute.v1.IBackendBucket=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendBucket} BackendBucket instance + */ + BackendBucket.create = function create(properties) { + return new BackendBucket(properties); + }; + + /** + * Encodes the specified BackendBucket message. Does not implicitly {@link google.cloud.compute.v1.BackendBucket.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {google.cloud.compute.v1.IBackendBucket} message BackendBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucket.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.cdnPolicy != null && Object.hasOwnProperty.call(message, "cdnPolicy")) + $root.google.cloud.compute.v1.BackendBucketCdnPolicy.encode(message.cdnPolicy, writer.uint32(/* id 213976452, wireType 2 =*/1711811618).fork()).ldelim(); + if (message.enableCdn != null && Object.hasOwnProperty.call(message, "enableCdn")) + writer.uint32(/* id 282942321, wireType 0 =*/2263538568).bool(message.enableCdn); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 283610048, wireType 2 =*/2268880386).string(message.bucketName); + if (message.customResponseHeaders != null && message.customResponseHeaders.length) + for (var i = 0; i < message.customResponseHeaders.length; ++i) + writer.uint32(/* id 387539094, wireType 2 =*/3100312754).string(message.customResponseHeaders[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified BackendBucket message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucket.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {google.cloud.compute.v1.IBackendBucket} message BackendBucket message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucket.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendBucket message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendBucket} BackendBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucket.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendBucket(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 283610048: + message.bucketName = reader.string(); + break; + case 213976452: + message.cdnPolicy = $root.google.cloud.compute.v1.BackendBucketCdnPolicy.decode(reader, reader.uint32()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 387539094: + if (!(message.customResponseHeaders && message.customResponseHeaders.length)) + message.customResponseHeaders = []; + message.customResponseHeaders.push(reader.string()); + break; + case 422937596: + message.description = reader.string(); + break; + case 282942321: + message.enableCdn = reader.bool(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendBucket message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendBucket} BackendBucket + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucket.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendBucket message. + * @function verify + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendBucket.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) { + properties._bucketName = 1; + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + } + if (message.cdnPolicy != null && message.hasOwnProperty("cdnPolicy")) { + properties._cdnPolicy = 1; + { + var error = $root.google.cloud.compute.v1.BackendBucketCdnPolicy.verify(message.cdnPolicy); + if (error) + return "cdnPolicy." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.customResponseHeaders != null && message.hasOwnProperty("customResponseHeaders")) { + if (!Array.isArray(message.customResponseHeaders)) + return "customResponseHeaders: array expected"; + for (var i = 0; i < message.customResponseHeaders.length; ++i) + if (!$util.isString(message.customResponseHeaders[i])) + return "customResponseHeaders: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.enableCdn != null && message.hasOwnProperty("enableCdn")) { + properties._enableCdn = 1; + if (typeof message.enableCdn !== "boolean") + return "enableCdn: boolean expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates a BackendBucket message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendBucket} BackendBucket + */ + BackendBucket.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendBucket) + return object; + var message = new $root.google.cloud.compute.v1.BackendBucket(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.cdnPolicy != null) { + if (typeof object.cdnPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.BackendBucket.cdnPolicy: object expected"); + message.cdnPolicy = $root.google.cloud.compute.v1.BackendBucketCdnPolicy.fromObject(object.cdnPolicy); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.customResponseHeaders) { + if (!Array.isArray(object.customResponseHeaders)) + throw TypeError(".google.cloud.compute.v1.BackendBucket.customResponseHeaders: array expected"); + message.customResponseHeaders = []; + for (var i = 0; i < object.customResponseHeaders.length; ++i) + message.customResponseHeaders[i] = String(object.customResponseHeaders[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.enableCdn != null) + message.enableCdn = Boolean(object.enableCdn); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from a BackendBucket message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendBucket + * @static + * @param {google.cloud.compute.v1.BackendBucket} message BackendBucket + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendBucket.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customResponseHeaders = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.cdnPolicy != null && message.hasOwnProperty("cdnPolicy")) { + object.cdnPolicy = $root.google.cloud.compute.v1.BackendBucketCdnPolicy.toObject(message.cdnPolicy, options); + if (options.oneofs) + object._cdnPolicy = "cdnPolicy"; + } + if (message.enableCdn != null && message.hasOwnProperty("enableCdn")) { + object.enableCdn = message.enableCdn; + if (options.oneofs) + object._enableCdn = "enableCdn"; + } + if (message.bucketName != null && message.hasOwnProperty("bucketName")) { + object.bucketName = message.bucketName; + if (options.oneofs) + object._bucketName = "bucketName"; + } + if (message.customResponseHeaders && message.customResponseHeaders.length) { + object.customResponseHeaders = []; + for (var j = 0; j < message.customResponseHeaders.length; ++j) + object.customResponseHeaders[j] = message.customResponseHeaders[j]; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this BackendBucket to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendBucket + * @instance + * @returns {Object.} JSON object + */ + BackendBucket.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendBucket; + })(); + + v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader = (function() { + + /** + * Properties of a BackendBucketCdnPolicyBypassCacheOnRequestHeader. + * @memberof google.cloud.compute.v1 + * @interface IBackendBucketCdnPolicyBypassCacheOnRequestHeader + * @property {string|null} [headerName] BackendBucketCdnPolicyBypassCacheOnRequestHeader headerName + */ + + /** + * Constructs a new BackendBucketCdnPolicyBypassCacheOnRequestHeader. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendBucketCdnPolicyBypassCacheOnRequestHeader. + * @implements IBackendBucketCdnPolicyBypassCacheOnRequestHeader + * @constructor + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader=} [properties] Properties to set + */ + function BackendBucketCdnPolicyBypassCacheOnRequestHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendBucketCdnPolicyBypassCacheOnRequestHeader headerName. + * @member {string|null|undefined} headerName + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @instance + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.prototype.headerName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendBucketCdnPolicyBypassCacheOnRequestHeader _headerName. + * @member {"headerName"|undefined} _headerName + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicyBypassCacheOnRequestHeader.prototype, "_headerName", { + get: $util.oneOfGetter($oneOfFields = ["headerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendBucketCdnPolicyBypassCacheOnRequestHeader instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader} BackendBucketCdnPolicyBypassCacheOnRequestHeader instance + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.create = function create(properties) { + return new BackendBucketCdnPolicyBypassCacheOnRequestHeader(properties); + }; + + /** + * Encodes the specified BackendBucketCdnPolicyBypassCacheOnRequestHeader message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader} message BackendBucketCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headerName != null && Object.hasOwnProperty.call(message, "headerName")) + writer.uint32(/* id 110223613, wireType 2 =*/881788906).string(message.headerName); + return writer; + }; + + /** + * Encodes the specified BackendBucketCdnPolicyBypassCacheOnRequestHeader message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyBypassCacheOnRequestHeader} message BackendBucketCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendBucketCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader} BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 110223613: + message.headerName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendBucketCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader} BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendBucketCdnPolicyBypassCacheOnRequestHeader message. + * @function verify + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.headerName != null && message.hasOwnProperty("headerName")) { + properties._headerName = 1; + if (!$util.isString(message.headerName)) + return "headerName: string expected"; + } + return null; + }; + + /** + * Creates a BackendBucketCdnPolicyBypassCacheOnRequestHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader} BackendBucketCdnPolicyBypassCacheOnRequestHeader + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader) + return object; + var message = new $root.google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader(); + if (object.headerName != null) + message.headerName = String(object.headerName); + return message; + }; + + /** + * Creates a plain object from a BackendBucketCdnPolicyBypassCacheOnRequestHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader} message BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.headerName != null && message.hasOwnProperty("headerName")) { + object.headerName = message.headerName; + if (options.oneofs) + object._headerName = "headerName"; + } + return object; + }; + + /** + * Converts this BackendBucketCdnPolicyBypassCacheOnRequestHeader to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyBypassCacheOnRequestHeader + * @instance + * @returns {Object.} JSON object + */ + BackendBucketCdnPolicyBypassCacheOnRequestHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendBucketCdnPolicyBypassCacheOnRequestHeader; + })(); + + v1.BackendBucketCdnPolicyNegativeCachingPolicy = (function() { + + /** + * Properties of a BackendBucketCdnPolicyNegativeCachingPolicy. + * @memberof google.cloud.compute.v1 + * @interface IBackendBucketCdnPolicyNegativeCachingPolicy + * @property {number|null} [code] BackendBucketCdnPolicyNegativeCachingPolicy code + * @property {number|null} [ttl] BackendBucketCdnPolicyNegativeCachingPolicy ttl + */ + + /** + * Constructs a new BackendBucketCdnPolicyNegativeCachingPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendBucketCdnPolicyNegativeCachingPolicy. + * @implements IBackendBucketCdnPolicyNegativeCachingPolicy + * @constructor + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy=} [properties] Properties to set + */ + function BackendBucketCdnPolicyNegativeCachingPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendBucketCdnPolicyNegativeCachingPolicy code. + * @member {number|null|undefined} code + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @instance + */ + BackendBucketCdnPolicyNegativeCachingPolicy.prototype.code = null; + + /** + * BackendBucketCdnPolicyNegativeCachingPolicy ttl. + * @member {number|null|undefined} ttl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @instance + */ + BackendBucketCdnPolicyNegativeCachingPolicy.prototype.ttl = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendBucketCdnPolicyNegativeCachingPolicy _code. + * @member {"code"|undefined} _code + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicyNegativeCachingPolicy.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketCdnPolicyNegativeCachingPolicy _ttl. + * @member {"ttl"|undefined} _ttl + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @instance + */ + Object.defineProperty(BackendBucketCdnPolicyNegativeCachingPolicy.prototype, "_ttl", { + get: $util.oneOfGetter($oneOfFields = ["ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendBucketCdnPolicyNegativeCachingPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy} BackendBucketCdnPolicyNegativeCachingPolicy instance + */ + BackendBucketCdnPolicyNegativeCachingPolicy.create = function create(properties) { + return new BackendBucketCdnPolicyNegativeCachingPolicy(properties); + }; + + /** + * Encodes the specified BackendBucketCdnPolicyNegativeCachingPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy} message BackendBucketCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketCdnPolicyNegativeCachingPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + writer.uint32(/* id 115180, wireType 0 =*/921440).int32(message.ttl); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 3059181, wireType 0 =*/24473448).int32(message.code); + return writer; + }; + + /** + * Encodes the specified BackendBucketCdnPolicyNegativeCachingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.IBackendBucketCdnPolicyNegativeCachingPolicy} message BackendBucketCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketCdnPolicyNegativeCachingPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendBucketCdnPolicyNegativeCachingPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy} BackendBucketCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketCdnPolicyNegativeCachingPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3059181: + message.code = reader.int32(); + break; + case 115180: + message.ttl = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendBucketCdnPolicyNegativeCachingPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy} BackendBucketCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketCdnPolicyNegativeCachingPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendBucketCdnPolicyNegativeCachingPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendBucketCdnPolicyNegativeCachingPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.code != null && message.hasOwnProperty("code")) { + properties._code = 1; + if (!$util.isInteger(message.code)) + return "code: integer expected"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + properties._ttl = 1; + if (!$util.isInteger(message.ttl)) + return "ttl: integer expected"; + } + return null; + }; + + /** + * Creates a BackendBucketCdnPolicyNegativeCachingPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy} BackendBucketCdnPolicyNegativeCachingPolicy + */ + BackendBucketCdnPolicyNegativeCachingPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy) + return object; + var message = new $root.google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy(); + if (object.code != null) + message.code = object.code | 0; + if (object.ttl != null) + message.ttl = object.ttl | 0; + return message; + }; + + /** + * Creates a plain object from a BackendBucketCdnPolicyNegativeCachingPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy} message BackendBucketCdnPolicyNegativeCachingPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendBucketCdnPolicyNegativeCachingPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = message.ttl; + if (options.oneofs) + object._ttl = "ttl"; + } + if (message.code != null && message.hasOwnProperty("code")) { + object.code = message.code; + if (options.oneofs) + object._code = "code"; + } + return object; + }; + + /** + * Converts this BackendBucketCdnPolicyNegativeCachingPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendBucketCdnPolicyNegativeCachingPolicy + * @instance + * @returns {Object.} JSON object + */ + BackendBucketCdnPolicyNegativeCachingPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendBucketCdnPolicyNegativeCachingPolicy; + })(); + + v1.BackendBucketList = (function() { + + /** + * Properties of a BackendBucketList. + * @memberof google.cloud.compute.v1 + * @interface IBackendBucketList + * @property {string|null} [id] BackendBucketList id + * @property {Array.|null} [items] BackendBucketList items + * @property {string|null} [kind] BackendBucketList kind + * @property {string|null} [nextPageToken] BackendBucketList nextPageToken + * @property {string|null} [selfLink] BackendBucketList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] BackendBucketList warning + */ + + /** + * Constructs a new BackendBucketList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendBucketList. + * @implements IBackendBucketList + * @constructor + * @param {google.cloud.compute.v1.IBackendBucketList=} [properties] Properties to set + */ + function BackendBucketList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendBucketList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + BackendBucketList.prototype.id = null; + + /** + * BackendBucketList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + BackendBucketList.prototype.items = $util.emptyArray; + + /** + * BackendBucketList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + BackendBucketList.prototype.kind = null; + + /** + * BackendBucketList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + BackendBucketList.prototype.nextPageToken = null; + + /** + * BackendBucketList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + BackendBucketList.prototype.selfLink = null; + + /** + * BackendBucketList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + BackendBucketList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendBucketList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + Object.defineProperty(BackendBucketList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + Object.defineProperty(BackendBucketList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + Object.defineProperty(BackendBucketList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + Object.defineProperty(BackendBucketList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendBucketList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + */ + Object.defineProperty(BackendBucketList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendBucketList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {google.cloud.compute.v1.IBackendBucketList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendBucketList} BackendBucketList instance + */ + BackendBucketList.create = function create(properties) { + return new BackendBucketList(properties); + }; + + /** + * Encodes the specified BackendBucketList message. Does not implicitly {@link google.cloud.compute.v1.BackendBucketList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {google.cloud.compute.v1.IBackendBucketList} message BackendBucketList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.BackendBucket.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified BackendBucketList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendBucketList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {google.cloud.compute.v1.IBackendBucketList} message BackendBucketList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendBucketList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendBucketList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendBucketList} BackendBucketList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendBucketList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.BackendBucket.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendBucketList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendBucketList} BackendBucketList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendBucketList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendBucketList message. + * @function verify + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendBucketList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendBucket.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a BackendBucketList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendBucketList} BackendBucketList + */ + BackendBucketList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendBucketList) + return object; + var message = new $root.google.cloud.compute.v1.BackendBucketList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.BackendBucketList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendBucketList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.BackendBucket.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.BackendBucketList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a BackendBucketList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendBucketList + * @static + * @param {google.cloud.compute.v1.BackendBucketList} message BackendBucketList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendBucketList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.BackendBucket.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this BackendBucketList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendBucketList + * @instance + * @returns {Object.} JSON object + */ + BackendBucketList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendBucketList; + })(); + + v1.BackendServiceCdnPolicy = (function() { + + /** + * Properties of a BackendServiceCdnPolicy. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceCdnPolicy + * @property {Array.|null} [bypassCacheOnRequestHeaders] BackendServiceCdnPolicy bypassCacheOnRequestHeaders + * @property {google.cloud.compute.v1.ICacheKeyPolicy|null} [cacheKeyPolicy] BackendServiceCdnPolicy cacheKeyPolicy + * @property {google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode|null} [cacheMode] BackendServiceCdnPolicy cacheMode + * @property {number|null} [clientTtl] BackendServiceCdnPolicy clientTtl + * @property {number|null} [defaultTtl] BackendServiceCdnPolicy defaultTtl + * @property {number|null} [maxTtl] BackendServiceCdnPolicy maxTtl + * @property {boolean|null} [negativeCaching] BackendServiceCdnPolicy negativeCaching + * @property {Array.|null} [negativeCachingPolicy] BackendServiceCdnPolicy negativeCachingPolicy + * @property {boolean|null} [requestCoalescing] BackendServiceCdnPolicy requestCoalescing + * @property {number|null} [serveWhileStale] BackendServiceCdnPolicy serveWhileStale + * @property {number|Long|null} [signedUrlCacheMaxAgeSec] BackendServiceCdnPolicy signedUrlCacheMaxAgeSec + * @property {Array.|null} [signedUrlKeyNames] BackendServiceCdnPolicy signedUrlKeyNames + */ + + /** + * Constructs a new BackendServiceCdnPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceCdnPolicy. + * @implements IBackendServiceCdnPolicy + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicy=} [properties] Properties to set + */ + function BackendServiceCdnPolicy(properties) { + this.bypassCacheOnRequestHeaders = []; + this.negativeCachingPolicy = []; + this.signedUrlKeyNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceCdnPolicy bypassCacheOnRequestHeaders. + * @member {Array.} bypassCacheOnRequestHeaders + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.bypassCacheOnRequestHeaders = $util.emptyArray; + + /** + * BackendServiceCdnPolicy cacheKeyPolicy. + * @member {google.cloud.compute.v1.ICacheKeyPolicy|null|undefined} cacheKeyPolicy + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.cacheKeyPolicy = null; + + /** + * BackendServiceCdnPolicy cacheMode. + * @member {google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode|null|undefined} cacheMode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.cacheMode = null; + + /** + * BackendServiceCdnPolicy clientTtl. + * @member {number|null|undefined} clientTtl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.clientTtl = null; + + /** + * BackendServiceCdnPolicy defaultTtl. + * @member {number|null|undefined} defaultTtl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.defaultTtl = null; + + /** + * BackendServiceCdnPolicy maxTtl. + * @member {number|null|undefined} maxTtl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.maxTtl = null; + + /** + * BackendServiceCdnPolicy negativeCaching. + * @member {boolean|null|undefined} negativeCaching + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.negativeCaching = null; + + /** + * BackendServiceCdnPolicy negativeCachingPolicy. + * @member {Array.} negativeCachingPolicy + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.negativeCachingPolicy = $util.emptyArray; + + /** + * BackendServiceCdnPolicy requestCoalescing. + * @member {boolean|null|undefined} requestCoalescing + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.requestCoalescing = null; + + /** + * BackendServiceCdnPolicy serveWhileStale. + * @member {number|null|undefined} serveWhileStale + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.serveWhileStale = null; + + /** + * BackendServiceCdnPolicy signedUrlCacheMaxAgeSec. + * @member {number|Long|null|undefined} signedUrlCacheMaxAgeSec + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.signedUrlCacheMaxAgeSec = null; + + /** + * BackendServiceCdnPolicy signedUrlKeyNames. + * @member {Array.} signedUrlKeyNames + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + BackendServiceCdnPolicy.prototype.signedUrlKeyNames = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceCdnPolicy _cacheKeyPolicy. + * @member {"cacheKeyPolicy"|undefined} _cacheKeyPolicy + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_cacheKeyPolicy", { + get: $util.oneOfGetter($oneOfFields = ["cacheKeyPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _cacheMode. + * @member {"cacheMode"|undefined} _cacheMode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_cacheMode", { + get: $util.oneOfGetter($oneOfFields = ["cacheMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _clientTtl. + * @member {"clientTtl"|undefined} _clientTtl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_clientTtl", { + get: $util.oneOfGetter($oneOfFields = ["clientTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _defaultTtl. + * @member {"defaultTtl"|undefined} _defaultTtl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_defaultTtl", { + get: $util.oneOfGetter($oneOfFields = ["defaultTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _maxTtl. + * @member {"maxTtl"|undefined} _maxTtl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_maxTtl", { + get: $util.oneOfGetter($oneOfFields = ["maxTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _negativeCaching. + * @member {"negativeCaching"|undefined} _negativeCaching + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_negativeCaching", { + get: $util.oneOfGetter($oneOfFields = ["negativeCaching"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _requestCoalescing. + * @member {"requestCoalescing"|undefined} _requestCoalescing + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_requestCoalescing", { + get: $util.oneOfGetter($oneOfFields = ["requestCoalescing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _serveWhileStale. + * @member {"serveWhileStale"|undefined} _serveWhileStale + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_serveWhileStale", { + get: $util.oneOfGetter($oneOfFields = ["serveWhileStale"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicy _signedUrlCacheMaxAgeSec. + * @member {"signedUrlCacheMaxAgeSec"|undefined} _signedUrlCacheMaxAgeSec + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicy.prototype, "_signedUrlCacheMaxAgeSec", { + get: $util.oneOfGetter($oneOfFields = ["signedUrlCacheMaxAgeSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceCdnPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicy} BackendServiceCdnPolicy instance + */ + BackendServiceCdnPolicy.create = function create(properties) { + return new BackendServiceCdnPolicy(properties); + }; + + /** + * Encodes the specified BackendServiceCdnPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicy} message BackendServiceCdnPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceCdnPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cacheMode != null && Object.hasOwnProperty.call(message, "cacheMode")) + writer.uint32(/* id 28877888, wireType 0 =*/231023104).int32(message.cacheMode); + if (message.clientTtl != null && Object.hasOwnProperty.call(message, "clientTtl")) + writer.uint32(/* id 29034360, wireType 0 =*/232274880).int32(message.clientTtl); + if (message.defaultTtl != null && Object.hasOwnProperty.call(message, "defaultTtl")) + writer.uint32(/* id 100253422, wireType 0 =*/802027376).int32(message.defaultTtl); + if (message.negativeCachingPolicy != null && message.negativeCachingPolicy.length) + for (var i = 0; i < message.negativeCachingPolicy.length; ++i) + $root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.encode(message.negativeCachingPolicy[i], writer.uint32(/* id 155359996, wireType 2 =*/1242879970).fork()).ldelim(); + if (message.cacheKeyPolicy != null && Object.hasOwnProperty.call(message, "cacheKeyPolicy")) + $root.google.cloud.compute.v1.CacheKeyPolicy.encode(message.cacheKeyPolicy, writer.uint32(/* id 159263727, wireType 2 =*/1274109818).fork()).ldelim(); + if (message.serveWhileStale != null && Object.hasOwnProperty.call(message, "serveWhileStale")) + writer.uint32(/* id 236682203, wireType 0 =*/1893457624).int32(message.serveWhileStale); + if (message.signedUrlCacheMaxAgeSec != null && Object.hasOwnProperty.call(message, "signedUrlCacheMaxAgeSec")) + writer.uint32(/* id 269374534, wireType 0 =*/2154996272).int64(message.signedUrlCacheMaxAgeSec); + if (message.maxTtl != null && Object.hasOwnProperty.call(message, "maxTtl")) + writer.uint32(/* id 307578001, wireType 0 =*/2460624008).int32(message.maxTtl); + if (message.negativeCaching != null && Object.hasOwnProperty.call(message, "negativeCaching")) + writer.uint32(/* id 336110005, wireType 0 =*/2688880040).bool(message.negativeCaching); + if (message.signedUrlKeyNames != null && message.signedUrlKeyNames.length) + for (var i = 0; i < message.signedUrlKeyNames.length; ++i) + writer.uint32(/* id 371848885, wireType 2 =*/2974791082).string(message.signedUrlKeyNames[i]); + if (message.bypassCacheOnRequestHeaders != null && message.bypassCacheOnRequestHeaders.length) + for (var i = 0; i < message.bypassCacheOnRequestHeaders.length; ++i) + $root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.encode(message.bypassCacheOnRequestHeaders[i], writer.uint32(/* id 486203082, wireType 2 =*/3889624658).fork()).ldelim(); + if (message.requestCoalescing != null && Object.hasOwnProperty.call(message, "requestCoalescing")) + writer.uint32(/* id 532808276, wireType 0 =*/4262466208).bool(message.requestCoalescing); + return writer; + }; + + /** + * Encodes the specified BackendServiceCdnPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicy} message BackendServiceCdnPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceCdnPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceCdnPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicy} BackendServiceCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceCdnPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceCdnPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 486203082: + if (!(message.bypassCacheOnRequestHeaders && message.bypassCacheOnRequestHeaders.length)) + message.bypassCacheOnRequestHeaders = []; + message.bypassCacheOnRequestHeaders.push($root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.decode(reader, reader.uint32())); + break; + case 159263727: + message.cacheKeyPolicy = $root.google.cloud.compute.v1.CacheKeyPolicy.decode(reader, reader.uint32()); + break; + case 28877888: + message.cacheMode = reader.int32(); + break; + case 29034360: + message.clientTtl = reader.int32(); + break; + case 100253422: + message.defaultTtl = reader.int32(); + break; + case 307578001: + message.maxTtl = reader.int32(); + break; + case 336110005: + message.negativeCaching = reader.bool(); + break; + case 155359996: + if (!(message.negativeCachingPolicy && message.negativeCachingPolicy.length)) + message.negativeCachingPolicy = []; + message.negativeCachingPolicy.push($root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.decode(reader, reader.uint32())); + break; + case 532808276: + message.requestCoalescing = reader.bool(); + break; + case 236682203: + message.serveWhileStale = reader.int32(); + break; + case 269374534: + message.signedUrlCacheMaxAgeSec = reader.int64(); + break; + case 371848885: + if (!(message.signedUrlKeyNames && message.signedUrlKeyNames.length)) + message.signedUrlKeyNames = []; + message.signedUrlKeyNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceCdnPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicy} BackendServiceCdnPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceCdnPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceCdnPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceCdnPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bypassCacheOnRequestHeaders != null && message.hasOwnProperty("bypassCacheOnRequestHeaders")) { + if (!Array.isArray(message.bypassCacheOnRequestHeaders)) + return "bypassCacheOnRequestHeaders: array expected"; + for (var i = 0; i < message.bypassCacheOnRequestHeaders.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.verify(message.bypassCacheOnRequestHeaders[i]); + if (error) + return "bypassCacheOnRequestHeaders." + error; + } + } + if (message.cacheKeyPolicy != null && message.hasOwnProperty("cacheKeyPolicy")) { + properties._cacheKeyPolicy = 1; + { + var error = $root.google.cloud.compute.v1.CacheKeyPolicy.verify(message.cacheKeyPolicy); + if (error) + return "cacheKeyPolicy." + error; + } + } + if (message.cacheMode != null && message.hasOwnProperty("cacheMode")) { + properties._cacheMode = 1; + switch (message.cacheMode) { + default: + return "cacheMode: enum value expected"; + case 0: + case 355027945: + case 486026928: + case 381295560: + case 55380261: + break; + } + } + if (message.clientTtl != null && message.hasOwnProperty("clientTtl")) { + properties._clientTtl = 1; + if (!$util.isInteger(message.clientTtl)) + return "clientTtl: integer expected"; + } + if (message.defaultTtl != null && message.hasOwnProperty("defaultTtl")) { + properties._defaultTtl = 1; + if (!$util.isInteger(message.defaultTtl)) + return "defaultTtl: integer expected"; + } + if (message.maxTtl != null && message.hasOwnProperty("maxTtl")) { + properties._maxTtl = 1; + if (!$util.isInteger(message.maxTtl)) + return "maxTtl: integer expected"; + } + if (message.negativeCaching != null && message.hasOwnProperty("negativeCaching")) { + properties._negativeCaching = 1; + if (typeof message.negativeCaching !== "boolean") + return "negativeCaching: boolean expected"; + } + if (message.negativeCachingPolicy != null && message.hasOwnProperty("negativeCachingPolicy")) { + if (!Array.isArray(message.negativeCachingPolicy)) + return "negativeCachingPolicy: array expected"; + for (var i = 0; i < message.negativeCachingPolicy.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.verify(message.negativeCachingPolicy[i]); + if (error) + return "negativeCachingPolicy." + error; + } + } + if (message.requestCoalescing != null && message.hasOwnProperty("requestCoalescing")) { + properties._requestCoalescing = 1; + if (typeof message.requestCoalescing !== "boolean") + return "requestCoalescing: boolean expected"; + } + if (message.serveWhileStale != null && message.hasOwnProperty("serveWhileStale")) { + properties._serveWhileStale = 1; + if (!$util.isInteger(message.serveWhileStale)) + return "serveWhileStale: integer expected"; + } + if (message.signedUrlCacheMaxAgeSec != null && message.hasOwnProperty("signedUrlCacheMaxAgeSec")) { + properties._signedUrlCacheMaxAgeSec = 1; + if (!$util.isInteger(message.signedUrlCacheMaxAgeSec) && !(message.signedUrlCacheMaxAgeSec && $util.isInteger(message.signedUrlCacheMaxAgeSec.low) && $util.isInteger(message.signedUrlCacheMaxAgeSec.high))) + return "signedUrlCacheMaxAgeSec: integer|Long expected"; + } + if (message.signedUrlKeyNames != null && message.hasOwnProperty("signedUrlKeyNames")) { + if (!Array.isArray(message.signedUrlKeyNames)) + return "signedUrlKeyNames: array expected"; + for (var i = 0; i < message.signedUrlKeyNames.length; ++i) + if (!$util.isString(message.signedUrlKeyNames[i])) + return "signedUrlKeyNames: string[] expected"; + } + return null; + }; + + /** + * Creates a BackendServiceCdnPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicy} BackendServiceCdnPolicy + */ + BackendServiceCdnPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceCdnPolicy) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceCdnPolicy(); + if (object.bypassCacheOnRequestHeaders) { + if (!Array.isArray(object.bypassCacheOnRequestHeaders)) + throw TypeError(".google.cloud.compute.v1.BackendServiceCdnPolicy.bypassCacheOnRequestHeaders: array expected"); + message.bypassCacheOnRequestHeaders = []; + for (var i = 0; i < object.bypassCacheOnRequestHeaders.length; ++i) { + if (typeof object.bypassCacheOnRequestHeaders[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceCdnPolicy.bypassCacheOnRequestHeaders: object expected"); + message.bypassCacheOnRequestHeaders[i] = $root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.fromObject(object.bypassCacheOnRequestHeaders[i]); + } + } + if (object.cacheKeyPolicy != null) { + if (typeof object.cacheKeyPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceCdnPolicy.cacheKeyPolicy: object expected"); + message.cacheKeyPolicy = $root.google.cloud.compute.v1.CacheKeyPolicy.fromObject(object.cacheKeyPolicy); + } + switch (object.cacheMode) { + case "UNDEFINED_CACHE_MODE": + case 0: + message.cacheMode = 0; + break; + case "CACHE_ALL_STATIC": + case 355027945: + message.cacheMode = 355027945; + break; + case "FORCE_CACHE_ALL": + case 486026928: + message.cacheMode = 486026928; + break; + case "INVALID_CACHE_MODE": + case 381295560: + message.cacheMode = 381295560; + break; + case "USE_ORIGIN_HEADERS": + case 55380261: + message.cacheMode = 55380261; + break; + } + if (object.clientTtl != null) + message.clientTtl = object.clientTtl | 0; + if (object.defaultTtl != null) + message.defaultTtl = object.defaultTtl | 0; + if (object.maxTtl != null) + message.maxTtl = object.maxTtl | 0; + if (object.negativeCaching != null) + message.negativeCaching = Boolean(object.negativeCaching); + if (object.negativeCachingPolicy) { + if (!Array.isArray(object.negativeCachingPolicy)) + throw TypeError(".google.cloud.compute.v1.BackendServiceCdnPolicy.negativeCachingPolicy: array expected"); + message.negativeCachingPolicy = []; + for (var i = 0; i < object.negativeCachingPolicy.length; ++i) { + if (typeof object.negativeCachingPolicy[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceCdnPolicy.negativeCachingPolicy: object expected"); + message.negativeCachingPolicy[i] = $root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.fromObject(object.negativeCachingPolicy[i]); + } + } + if (object.requestCoalescing != null) + message.requestCoalescing = Boolean(object.requestCoalescing); + if (object.serveWhileStale != null) + message.serveWhileStale = object.serveWhileStale | 0; + if (object.signedUrlCacheMaxAgeSec != null) + if ($util.Long) + (message.signedUrlCacheMaxAgeSec = $util.Long.fromValue(object.signedUrlCacheMaxAgeSec)).unsigned = false; + else if (typeof object.signedUrlCacheMaxAgeSec === "string") + message.signedUrlCacheMaxAgeSec = parseInt(object.signedUrlCacheMaxAgeSec, 10); + else if (typeof object.signedUrlCacheMaxAgeSec === "number") + message.signedUrlCacheMaxAgeSec = object.signedUrlCacheMaxAgeSec; + else if (typeof object.signedUrlCacheMaxAgeSec === "object") + message.signedUrlCacheMaxAgeSec = new $util.LongBits(object.signedUrlCacheMaxAgeSec.low >>> 0, object.signedUrlCacheMaxAgeSec.high >>> 0).toNumber(); + if (object.signedUrlKeyNames) { + if (!Array.isArray(object.signedUrlKeyNames)) + throw TypeError(".google.cloud.compute.v1.BackendServiceCdnPolicy.signedUrlKeyNames: array expected"); + message.signedUrlKeyNames = []; + for (var i = 0; i < object.signedUrlKeyNames.length; ++i) + message.signedUrlKeyNames[i] = String(object.signedUrlKeyNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a BackendServiceCdnPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @static + * @param {google.cloud.compute.v1.BackendServiceCdnPolicy} message BackendServiceCdnPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceCdnPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.negativeCachingPolicy = []; + object.signedUrlKeyNames = []; + object.bypassCacheOnRequestHeaders = []; + } + if (message.cacheMode != null && message.hasOwnProperty("cacheMode")) { + object.cacheMode = options.enums === String ? $root.google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode[message.cacheMode] : message.cacheMode; + if (options.oneofs) + object._cacheMode = "cacheMode"; + } + if (message.clientTtl != null && message.hasOwnProperty("clientTtl")) { + object.clientTtl = message.clientTtl; + if (options.oneofs) + object._clientTtl = "clientTtl"; + } + if (message.defaultTtl != null && message.hasOwnProperty("defaultTtl")) { + object.defaultTtl = message.defaultTtl; + if (options.oneofs) + object._defaultTtl = "defaultTtl"; + } + if (message.negativeCachingPolicy && message.negativeCachingPolicy.length) { + object.negativeCachingPolicy = []; + for (var j = 0; j < message.negativeCachingPolicy.length; ++j) + object.negativeCachingPolicy[j] = $root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.toObject(message.negativeCachingPolicy[j], options); + } + if (message.cacheKeyPolicy != null && message.hasOwnProperty("cacheKeyPolicy")) { + object.cacheKeyPolicy = $root.google.cloud.compute.v1.CacheKeyPolicy.toObject(message.cacheKeyPolicy, options); + if (options.oneofs) + object._cacheKeyPolicy = "cacheKeyPolicy"; + } + if (message.serveWhileStale != null && message.hasOwnProperty("serveWhileStale")) { + object.serveWhileStale = message.serveWhileStale; + if (options.oneofs) + object._serveWhileStale = "serveWhileStale"; + } + if (message.signedUrlCacheMaxAgeSec != null && message.hasOwnProperty("signedUrlCacheMaxAgeSec")) { + if (typeof message.signedUrlCacheMaxAgeSec === "number") + object.signedUrlCacheMaxAgeSec = options.longs === String ? String(message.signedUrlCacheMaxAgeSec) : message.signedUrlCacheMaxAgeSec; + else + object.signedUrlCacheMaxAgeSec = options.longs === String ? $util.Long.prototype.toString.call(message.signedUrlCacheMaxAgeSec) : options.longs === Number ? new $util.LongBits(message.signedUrlCacheMaxAgeSec.low >>> 0, message.signedUrlCacheMaxAgeSec.high >>> 0).toNumber() : message.signedUrlCacheMaxAgeSec; + if (options.oneofs) + object._signedUrlCacheMaxAgeSec = "signedUrlCacheMaxAgeSec"; + } + if (message.maxTtl != null && message.hasOwnProperty("maxTtl")) { + object.maxTtl = message.maxTtl; + if (options.oneofs) + object._maxTtl = "maxTtl"; + } + if (message.negativeCaching != null && message.hasOwnProperty("negativeCaching")) { + object.negativeCaching = message.negativeCaching; + if (options.oneofs) + object._negativeCaching = "negativeCaching"; + } + if (message.signedUrlKeyNames && message.signedUrlKeyNames.length) { + object.signedUrlKeyNames = []; + for (var j = 0; j < message.signedUrlKeyNames.length; ++j) + object.signedUrlKeyNames[j] = message.signedUrlKeyNames[j]; + } + if (message.bypassCacheOnRequestHeaders && message.bypassCacheOnRequestHeaders.length) { + object.bypassCacheOnRequestHeaders = []; + for (var j = 0; j < message.bypassCacheOnRequestHeaders.length; ++j) + object.bypassCacheOnRequestHeaders[j] = $root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.toObject(message.bypassCacheOnRequestHeaders[j], options); + } + if (message.requestCoalescing != null && message.hasOwnProperty("requestCoalescing")) { + object.requestCoalescing = message.requestCoalescing; + if (options.oneofs) + object._requestCoalescing = "requestCoalescing"; + } + return object; + }; + + /** + * Converts this BackendServiceCdnPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicy + * @instance + * @returns {Object.} JSON object + */ + BackendServiceCdnPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CacheMode enum. + * @name google.cloud.compute.v1.BackendServiceCdnPolicy.CacheMode + * @enum {number} + * @property {number} UNDEFINED_CACHE_MODE=0 UNDEFINED_CACHE_MODE value + * @property {number} CACHE_ALL_STATIC=355027945 CACHE_ALL_STATIC value + * @property {number} FORCE_CACHE_ALL=486026928 FORCE_CACHE_ALL value + * @property {number} INVALID_CACHE_MODE=381295560 INVALID_CACHE_MODE value + * @property {number} USE_ORIGIN_HEADERS=55380261 USE_ORIGIN_HEADERS value + */ + BackendServiceCdnPolicy.CacheMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CACHE_MODE"] = 0; + values[valuesById[355027945] = "CACHE_ALL_STATIC"] = 355027945; + values[valuesById[486026928] = "FORCE_CACHE_ALL"] = 486026928; + values[valuesById[381295560] = "INVALID_CACHE_MODE"] = 381295560; + values[valuesById[55380261] = "USE_ORIGIN_HEADERS"] = 55380261; + return values; + })(); + + return BackendServiceCdnPolicy; + })(); + + v1.CircuitBreakers = (function() { + + /** + * Properties of a CircuitBreakers. + * @memberof google.cloud.compute.v1 + * @interface ICircuitBreakers + * @property {number|null} [maxConnections] CircuitBreakers maxConnections + * @property {number|null} [maxPendingRequests] CircuitBreakers maxPendingRequests + * @property {number|null} [maxRequests] CircuitBreakers maxRequests + * @property {number|null} [maxRequestsPerConnection] CircuitBreakers maxRequestsPerConnection + * @property {number|null} [maxRetries] CircuitBreakers maxRetries + */ + + /** + * Constructs a new CircuitBreakers. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CircuitBreakers. + * @implements ICircuitBreakers + * @constructor + * @param {google.cloud.compute.v1.ICircuitBreakers=} [properties] Properties to set + */ + function CircuitBreakers(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CircuitBreakers maxConnections. + * @member {number|null|undefined} maxConnections + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + CircuitBreakers.prototype.maxConnections = null; + + /** + * CircuitBreakers maxPendingRequests. + * @member {number|null|undefined} maxPendingRequests + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + CircuitBreakers.prototype.maxPendingRequests = null; + + /** + * CircuitBreakers maxRequests. + * @member {number|null|undefined} maxRequests + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + CircuitBreakers.prototype.maxRequests = null; + + /** + * CircuitBreakers maxRequestsPerConnection. + * @member {number|null|undefined} maxRequestsPerConnection + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + CircuitBreakers.prototype.maxRequestsPerConnection = null; + + /** + * CircuitBreakers maxRetries. + * @member {number|null|undefined} maxRetries + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + CircuitBreakers.prototype.maxRetries = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CircuitBreakers _maxConnections. + * @member {"maxConnections"|undefined} _maxConnections + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + Object.defineProperty(CircuitBreakers.prototype, "_maxConnections", { + get: $util.oneOfGetter($oneOfFields = ["maxConnections"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CircuitBreakers _maxPendingRequests. + * @member {"maxPendingRequests"|undefined} _maxPendingRequests + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + Object.defineProperty(CircuitBreakers.prototype, "_maxPendingRequests", { + get: $util.oneOfGetter($oneOfFields = ["maxPendingRequests"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CircuitBreakers _maxRequests. + * @member {"maxRequests"|undefined} _maxRequests + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + Object.defineProperty(CircuitBreakers.prototype, "_maxRequests", { + get: $util.oneOfGetter($oneOfFields = ["maxRequests"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CircuitBreakers _maxRequestsPerConnection. + * @member {"maxRequestsPerConnection"|undefined} _maxRequestsPerConnection + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + Object.defineProperty(CircuitBreakers.prototype, "_maxRequestsPerConnection", { + get: $util.oneOfGetter($oneOfFields = ["maxRequestsPerConnection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CircuitBreakers _maxRetries. + * @member {"maxRetries"|undefined} _maxRetries + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + */ + Object.defineProperty(CircuitBreakers.prototype, "_maxRetries", { + get: $util.oneOfGetter($oneOfFields = ["maxRetries"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CircuitBreakers instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {google.cloud.compute.v1.ICircuitBreakers=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CircuitBreakers} CircuitBreakers instance + */ + CircuitBreakers.create = function create(properties) { + return new CircuitBreakers(properties); + }; + + /** + * Encodes the specified CircuitBreakers message. Does not implicitly {@link google.cloud.compute.v1.CircuitBreakers.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {google.cloud.compute.v1.ICircuitBreakers} message CircuitBreakers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CircuitBreakers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxRequests != null && Object.hasOwnProperty.call(message, "maxRequests")) + writer.uint32(/* id 28097599, wireType 0 =*/224780792).int32(message.maxRequests); + if (message.maxRetries != null && Object.hasOwnProperty.call(message, "maxRetries")) + writer.uint32(/* id 55546219, wireType 0 =*/444369752).int32(message.maxRetries); + if (message.maxConnections != null && Object.hasOwnProperty.call(message, "maxConnections")) + writer.uint32(/* id 110652154, wireType 0 =*/885217232).int32(message.maxConnections); + if (message.maxRequestsPerConnection != null && Object.hasOwnProperty.call(message, "maxRequestsPerConnection")) + writer.uint32(/* id 361630528, wireType 0 =*/2893044224).int32(message.maxRequestsPerConnection); + if (message.maxPendingRequests != null && Object.hasOwnProperty.call(message, "maxPendingRequests")) + writer.uint32(/* id 375558887, wireType 0 =*/3004471096).int32(message.maxPendingRequests); + return writer; + }; + + /** + * Encodes the specified CircuitBreakers message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CircuitBreakers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {google.cloud.compute.v1.ICircuitBreakers} message CircuitBreakers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CircuitBreakers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CircuitBreakers message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CircuitBreakers} CircuitBreakers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CircuitBreakers.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CircuitBreakers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 110652154: + message.maxConnections = reader.int32(); + break; + case 375558887: + message.maxPendingRequests = reader.int32(); + break; + case 28097599: + message.maxRequests = reader.int32(); + break; + case 361630528: + message.maxRequestsPerConnection = reader.int32(); + break; + case 55546219: + message.maxRetries = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CircuitBreakers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CircuitBreakers} CircuitBreakers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CircuitBreakers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CircuitBreakers message. + * @function verify + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CircuitBreakers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxConnections != null && message.hasOwnProperty("maxConnections")) { + properties._maxConnections = 1; + if (!$util.isInteger(message.maxConnections)) + return "maxConnections: integer expected"; + } + if (message.maxPendingRequests != null && message.hasOwnProperty("maxPendingRequests")) { + properties._maxPendingRequests = 1; + if (!$util.isInteger(message.maxPendingRequests)) + return "maxPendingRequests: integer expected"; + } + if (message.maxRequests != null && message.hasOwnProperty("maxRequests")) { + properties._maxRequests = 1; + if (!$util.isInteger(message.maxRequests)) + return "maxRequests: integer expected"; + } + if (message.maxRequestsPerConnection != null && message.hasOwnProperty("maxRequestsPerConnection")) { + properties._maxRequestsPerConnection = 1; + if (!$util.isInteger(message.maxRequestsPerConnection)) + return "maxRequestsPerConnection: integer expected"; + } + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { + properties._maxRetries = 1; + if (!$util.isInteger(message.maxRetries)) + return "maxRetries: integer expected"; + } + return null; + }; + + /** + * Creates a CircuitBreakers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CircuitBreakers} CircuitBreakers + */ + CircuitBreakers.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CircuitBreakers) + return object; + var message = new $root.google.cloud.compute.v1.CircuitBreakers(); + if (object.maxConnections != null) + message.maxConnections = object.maxConnections | 0; + if (object.maxPendingRequests != null) + message.maxPendingRequests = object.maxPendingRequests | 0; + if (object.maxRequests != null) + message.maxRequests = object.maxRequests | 0; + if (object.maxRequestsPerConnection != null) + message.maxRequestsPerConnection = object.maxRequestsPerConnection | 0; + if (object.maxRetries != null) + message.maxRetries = object.maxRetries | 0; + return message; + }; + + /** + * Creates a plain object from a CircuitBreakers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CircuitBreakers + * @static + * @param {google.cloud.compute.v1.CircuitBreakers} message CircuitBreakers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CircuitBreakers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.maxRequests != null && message.hasOwnProperty("maxRequests")) { + object.maxRequests = message.maxRequests; + if (options.oneofs) + object._maxRequests = "maxRequests"; + } + if (message.maxRetries != null && message.hasOwnProperty("maxRetries")) { + object.maxRetries = message.maxRetries; + if (options.oneofs) + object._maxRetries = "maxRetries"; + } + if (message.maxConnections != null && message.hasOwnProperty("maxConnections")) { + object.maxConnections = message.maxConnections; + if (options.oneofs) + object._maxConnections = "maxConnections"; + } + if (message.maxRequestsPerConnection != null && message.hasOwnProperty("maxRequestsPerConnection")) { + object.maxRequestsPerConnection = message.maxRequestsPerConnection; + if (options.oneofs) + object._maxRequestsPerConnection = "maxRequestsPerConnection"; + } + if (message.maxPendingRequests != null && message.hasOwnProperty("maxPendingRequests")) { + object.maxPendingRequests = message.maxPendingRequests; + if (options.oneofs) + object._maxPendingRequests = "maxPendingRequests"; + } + return object; + }; + + /** + * Converts this CircuitBreakers to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CircuitBreakers + * @instance + * @returns {Object.} JSON object + */ + CircuitBreakers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CircuitBreakers; + })(); + + v1.ConnectionDraining = (function() { + + /** + * Properties of a ConnectionDraining. + * @memberof google.cloud.compute.v1 + * @interface IConnectionDraining + * @property {number|null} [drainingTimeoutSec] ConnectionDraining drainingTimeoutSec + */ + + /** + * Constructs a new ConnectionDraining. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ConnectionDraining. + * @implements IConnectionDraining + * @constructor + * @param {google.cloud.compute.v1.IConnectionDraining=} [properties] Properties to set + */ + function ConnectionDraining(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectionDraining drainingTimeoutSec. + * @member {number|null|undefined} drainingTimeoutSec + * @memberof google.cloud.compute.v1.ConnectionDraining + * @instance + */ + ConnectionDraining.prototype.drainingTimeoutSec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConnectionDraining _drainingTimeoutSec. + * @member {"drainingTimeoutSec"|undefined} _drainingTimeoutSec + * @memberof google.cloud.compute.v1.ConnectionDraining + * @instance + */ + Object.defineProperty(ConnectionDraining.prototype, "_drainingTimeoutSec", { + get: $util.oneOfGetter($oneOfFields = ["drainingTimeoutSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConnectionDraining instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {google.cloud.compute.v1.IConnectionDraining=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ConnectionDraining} ConnectionDraining instance + */ + ConnectionDraining.create = function create(properties) { + return new ConnectionDraining(properties); + }; + + /** + * Encodes the specified ConnectionDraining message. Does not implicitly {@link google.cloud.compute.v1.ConnectionDraining.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {google.cloud.compute.v1.IConnectionDraining} message ConnectionDraining message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionDraining.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.drainingTimeoutSec != null && Object.hasOwnProperty.call(message, "drainingTimeoutSec")) + writer.uint32(/* id 225127070, wireType 0 =*/1801016560).int32(message.drainingTimeoutSec); + return writer; + }; + + /** + * Encodes the specified ConnectionDraining message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConnectionDraining.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {google.cloud.compute.v1.IConnectionDraining} message ConnectionDraining message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectionDraining.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectionDraining message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ConnectionDraining} ConnectionDraining + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionDraining.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ConnectionDraining(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 225127070: + message.drainingTimeoutSec = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectionDraining message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ConnectionDraining} ConnectionDraining + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectionDraining.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectionDraining message. + * @function verify + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectionDraining.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.drainingTimeoutSec != null && message.hasOwnProperty("drainingTimeoutSec")) { + properties._drainingTimeoutSec = 1; + if (!$util.isInteger(message.drainingTimeoutSec)) + return "drainingTimeoutSec: integer expected"; + } + return null; + }; + + /** + * Creates a ConnectionDraining message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ConnectionDraining} ConnectionDraining + */ + ConnectionDraining.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ConnectionDraining) + return object; + var message = new $root.google.cloud.compute.v1.ConnectionDraining(); + if (object.drainingTimeoutSec != null) + message.drainingTimeoutSec = object.drainingTimeoutSec | 0; + return message; + }; + + /** + * Creates a plain object from a ConnectionDraining message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ConnectionDraining + * @static + * @param {google.cloud.compute.v1.ConnectionDraining} message ConnectionDraining + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectionDraining.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.drainingTimeoutSec != null && message.hasOwnProperty("drainingTimeoutSec")) { + object.drainingTimeoutSec = message.drainingTimeoutSec; + if (options.oneofs) + object._drainingTimeoutSec = "drainingTimeoutSec"; + } + return object; + }; + + /** + * Converts this ConnectionDraining to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ConnectionDraining + * @instance + * @returns {Object.} JSON object + */ + ConnectionDraining.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConnectionDraining; + })(); + + v1.ConsistentHashLoadBalancerSettings = (function() { + + /** + * Properties of a ConsistentHashLoadBalancerSettings. + * @memberof google.cloud.compute.v1 + * @interface IConsistentHashLoadBalancerSettings + * @property {google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie|null} [httpCookie] ConsistentHashLoadBalancerSettings httpCookie + * @property {string|null} [httpHeaderName] ConsistentHashLoadBalancerSettings httpHeaderName + * @property {number|Long|null} [minimumRingSize] ConsistentHashLoadBalancerSettings minimumRingSize + */ + + /** + * Constructs a new ConsistentHashLoadBalancerSettings. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ConsistentHashLoadBalancerSettings. + * @implements IConsistentHashLoadBalancerSettings + * @constructor + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettings=} [properties] Properties to set + */ + function ConsistentHashLoadBalancerSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsistentHashLoadBalancerSettings httpCookie. + * @member {google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie|null|undefined} httpCookie + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @instance + */ + ConsistentHashLoadBalancerSettings.prototype.httpCookie = null; + + /** + * ConsistentHashLoadBalancerSettings httpHeaderName. + * @member {string|null|undefined} httpHeaderName + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @instance + */ + ConsistentHashLoadBalancerSettings.prototype.httpHeaderName = null; + + /** + * ConsistentHashLoadBalancerSettings minimumRingSize. + * @member {number|Long|null|undefined} minimumRingSize + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @instance + */ + ConsistentHashLoadBalancerSettings.prototype.minimumRingSize = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConsistentHashLoadBalancerSettings _httpCookie. + * @member {"httpCookie"|undefined} _httpCookie + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @instance + */ + Object.defineProperty(ConsistentHashLoadBalancerSettings.prototype, "_httpCookie", { + get: $util.oneOfGetter($oneOfFields = ["httpCookie"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ConsistentHashLoadBalancerSettings _httpHeaderName. + * @member {"httpHeaderName"|undefined} _httpHeaderName + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @instance + */ + Object.defineProperty(ConsistentHashLoadBalancerSettings.prototype, "_httpHeaderName", { + get: $util.oneOfGetter($oneOfFields = ["httpHeaderName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ConsistentHashLoadBalancerSettings _minimumRingSize. + * @member {"minimumRingSize"|undefined} _minimumRingSize + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @instance + */ + Object.defineProperty(ConsistentHashLoadBalancerSettings.prototype, "_minimumRingSize", { + get: $util.oneOfGetter($oneOfFields = ["minimumRingSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConsistentHashLoadBalancerSettings instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettings=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettings} ConsistentHashLoadBalancerSettings instance + */ + ConsistentHashLoadBalancerSettings.create = function create(properties) { + return new ConsistentHashLoadBalancerSettings(properties); + }; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettings message. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettings} message ConsistentHashLoadBalancerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsistentHashLoadBalancerSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpCookie != null && Object.hasOwnProperty.call(message, "httpCookie")) + $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.encode(message.httpCookie, writer.uint32(/* id 6673915, wireType 2 =*/53391322).fork()).ldelim(); + if (message.minimumRingSize != null && Object.hasOwnProperty.call(message, "minimumRingSize")) + writer.uint32(/* id 234380735, wireType 0 =*/1875045880).int64(message.minimumRingSize); + if (message.httpHeaderName != null && Object.hasOwnProperty.call(message, "httpHeaderName")) + writer.uint32(/* id 234798022, wireType 2 =*/1878384178).string(message.httpHeaderName); + return writer; + }; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettings} message ConsistentHashLoadBalancerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsistentHashLoadBalancerSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsistentHashLoadBalancerSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettings} ConsistentHashLoadBalancerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsistentHashLoadBalancerSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6673915: + message.httpCookie = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.decode(reader, reader.uint32()); + break; + case 234798022: + message.httpHeaderName = reader.string(); + break; + case 234380735: + message.minimumRingSize = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsistentHashLoadBalancerSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettings} ConsistentHashLoadBalancerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsistentHashLoadBalancerSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsistentHashLoadBalancerSettings message. + * @function verify + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsistentHashLoadBalancerSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.httpCookie != null && message.hasOwnProperty("httpCookie")) { + properties._httpCookie = 1; + { + var error = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.verify(message.httpCookie); + if (error) + return "httpCookie." + error; + } + } + if (message.httpHeaderName != null && message.hasOwnProperty("httpHeaderName")) { + properties._httpHeaderName = 1; + if (!$util.isString(message.httpHeaderName)) + return "httpHeaderName: string expected"; + } + if (message.minimumRingSize != null && message.hasOwnProperty("minimumRingSize")) { + properties._minimumRingSize = 1; + if (!$util.isInteger(message.minimumRingSize) && !(message.minimumRingSize && $util.isInteger(message.minimumRingSize.low) && $util.isInteger(message.minimumRingSize.high))) + return "minimumRingSize: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ConsistentHashLoadBalancerSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettings} ConsistentHashLoadBalancerSettings + */ + ConsistentHashLoadBalancerSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings) + return object; + var message = new $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings(); + if (object.httpCookie != null) { + if (typeof object.httpCookie !== "object") + throw TypeError(".google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.httpCookie: object expected"); + message.httpCookie = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.fromObject(object.httpCookie); + } + if (object.httpHeaderName != null) + message.httpHeaderName = String(object.httpHeaderName); + if (object.minimumRingSize != null) + if ($util.Long) + (message.minimumRingSize = $util.Long.fromValue(object.minimumRingSize)).unsigned = false; + else if (typeof object.minimumRingSize === "string") + message.minimumRingSize = parseInt(object.minimumRingSize, 10); + else if (typeof object.minimumRingSize === "number") + message.minimumRingSize = object.minimumRingSize; + else if (typeof object.minimumRingSize === "object") + message.minimumRingSize = new $util.LongBits(object.minimumRingSize.low >>> 0, object.minimumRingSize.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ConsistentHashLoadBalancerSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @static + * @param {google.cloud.compute.v1.ConsistentHashLoadBalancerSettings} message ConsistentHashLoadBalancerSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsistentHashLoadBalancerSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.httpCookie != null && message.hasOwnProperty("httpCookie")) { + object.httpCookie = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.toObject(message.httpCookie, options); + if (options.oneofs) + object._httpCookie = "httpCookie"; + } + if (message.minimumRingSize != null && message.hasOwnProperty("minimumRingSize")) { + if (typeof message.minimumRingSize === "number") + object.minimumRingSize = options.longs === String ? String(message.minimumRingSize) : message.minimumRingSize; + else + object.minimumRingSize = options.longs === String ? $util.Long.prototype.toString.call(message.minimumRingSize) : options.longs === Number ? new $util.LongBits(message.minimumRingSize.low >>> 0, message.minimumRingSize.high >>> 0).toNumber() : message.minimumRingSize; + if (options.oneofs) + object._minimumRingSize = "minimumRingSize"; + } + if (message.httpHeaderName != null && message.hasOwnProperty("httpHeaderName")) { + object.httpHeaderName = message.httpHeaderName; + if (options.oneofs) + object._httpHeaderName = "httpHeaderName"; + } + return object; + }; + + /** + * Converts this ConsistentHashLoadBalancerSettings to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettings + * @instance + * @returns {Object.} JSON object + */ + ConsistentHashLoadBalancerSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsistentHashLoadBalancerSettings; + })(); + + v1.BackendServiceFailoverPolicy = (function() { + + /** + * Properties of a BackendServiceFailoverPolicy. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceFailoverPolicy + * @property {boolean|null} [disableConnectionDrainOnFailover] BackendServiceFailoverPolicy disableConnectionDrainOnFailover + * @property {boolean|null} [dropTrafficIfUnhealthy] BackendServiceFailoverPolicy dropTrafficIfUnhealthy + * @property {number|null} [failoverRatio] BackendServiceFailoverPolicy failoverRatio + */ + + /** + * Constructs a new BackendServiceFailoverPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceFailoverPolicy. + * @implements IBackendServiceFailoverPolicy + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceFailoverPolicy=} [properties] Properties to set + */ + function BackendServiceFailoverPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceFailoverPolicy disableConnectionDrainOnFailover. + * @member {boolean|null|undefined} disableConnectionDrainOnFailover + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @instance + */ + BackendServiceFailoverPolicy.prototype.disableConnectionDrainOnFailover = null; + + /** + * BackendServiceFailoverPolicy dropTrafficIfUnhealthy. + * @member {boolean|null|undefined} dropTrafficIfUnhealthy + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @instance + */ + BackendServiceFailoverPolicy.prototype.dropTrafficIfUnhealthy = null; + + /** + * BackendServiceFailoverPolicy failoverRatio. + * @member {number|null|undefined} failoverRatio + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @instance + */ + BackendServiceFailoverPolicy.prototype.failoverRatio = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceFailoverPolicy _disableConnectionDrainOnFailover. + * @member {"disableConnectionDrainOnFailover"|undefined} _disableConnectionDrainOnFailover + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @instance + */ + Object.defineProperty(BackendServiceFailoverPolicy.prototype, "_disableConnectionDrainOnFailover", { + get: $util.oneOfGetter($oneOfFields = ["disableConnectionDrainOnFailover"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceFailoverPolicy _dropTrafficIfUnhealthy. + * @member {"dropTrafficIfUnhealthy"|undefined} _dropTrafficIfUnhealthy + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @instance + */ + Object.defineProperty(BackendServiceFailoverPolicy.prototype, "_dropTrafficIfUnhealthy", { + get: $util.oneOfGetter($oneOfFields = ["dropTrafficIfUnhealthy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceFailoverPolicy _failoverRatio. + * @member {"failoverRatio"|undefined} _failoverRatio + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @instance + */ + Object.defineProperty(BackendServiceFailoverPolicy.prototype, "_failoverRatio", { + get: $util.oneOfGetter($oneOfFields = ["failoverRatio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceFailoverPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceFailoverPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceFailoverPolicy} BackendServiceFailoverPolicy instance + */ + BackendServiceFailoverPolicy.create = function create(properties) { + return new BackendServiceFailoverPolicy(properties); + }; + + /** + * Encodes the specified BackendServiceFailoverPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceFailoverPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceFailoverPolicy} message BackendServiceFailoverPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceFailoverPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dropTrafficIfUnhealthy != null && Object.hasOwnProperty.call(message, "dropTrafficIfUnhealthy")) + writer.uint32(/* id 112289428, wireType 0 =*/898315424).bool(message.dropTrafficIfUnhealthy); + if (message.disableConnectionDrainOnFailover != null && Object.hasOwnProperty.call(message, "disableConnectionDrainOnFailover")) + writer.uint32(/* id 182150753, wireType 0 =*/1457206024).bool(message.disableConnectionDrainOnFailover); + if (message.failoverRatio != null && Object.hasOwnProperty.call(message, "failoverRatio")) + writer.uint32(/* id 212667006, wireType 5 =*/1701336053).float(message.failoverRatio); + return writer; + }; + + /** + * Encodes the specified BackendServiceFailoverPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceFailoverPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceFailoverPolicy} message BackendServiceFailoverPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceFailoverPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceFailoverPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceFailoverPolicy} BackendServiceFailoverPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceFailoverPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceFailoverPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 182150753: + message.disableConnectionDrainOnFailover = reader.bool(); + break; + case 112289428: + message.dropTrafficIfUnhealthy = reader.bool(); + break; + case 212667006: + message.failoverRatio = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceFailoverPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceFailoverPolicy} BackendServiceFailoverPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceFailoverPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceFailoverPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceFailoverPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disableConnectionDrainOnFailover != null && message.hasOwnProperty("disableConnectionDrainOnFailover")) { + properties._disableConnectionDrainOnFailover = 1; + if (typeof message.disableConnectionDrainOnFailover !== "boolean") + return "disableConnectionDrainOnFailover: boolean expected"; + } + if (message.dropTrafficIfUnhealthy != null && message.hasOwnProperty("dropTrafficIfUnhealthy")) { + properties._dropTrafficIfUnhealthy = 1; + if (typeof message.dropTrafficIfUnhealthy !== "boolean") + return "dropTrafficIfUnhealthy: boolean expected"; + } + if (message.failoverRatio != null && message.hasOwnProperty("failoverRatio")) { + properties._failoverRatio = 1; + if (typeof message.failoverRatio !== "number") + return "failoverRatio: number expected"; + } + return null; + }; + + /** + * Creates a BackendServiceFailoverPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceFailoverPolicy} BackendServiceFailoverPolicy + */ + BackendServiceFailoverPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceFailoverPolicy) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceFailoverPolicy(); + if (object.disableConnectionDrainOnFailover != null) + message.disableConnectionDrainOnFailover = Boolean(object.disableConnectionDrainOnFailover); + if (object.dropTrafficIfUnhealthy != null) + message.dropTrafficIfUnhealthy = Boolean(object.dropTrafficIfUnhealthy); + if (object.failoverRatio != null) + message.failoverRatio = Number(object.failoverRatio); + return message; + }; + + /** + * Creates a plain object from a BackendServiceFailoverPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @static + * @param {google.cloud.compute.v1.BackendServiceFailoverPolicy} message BackendServiceFailoverPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceFailoverPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dropTrafficIfUnhealthy != null && message.hasOwnProperty("dropTrafficIfUnhealthy")) { + object.dropTrafficIfUnhealthy = message.dropTrafficIfUnhealthy; + if (options.oneofs) + object._dropTrafficIfUnhealthy = "dropTrafficIfUnhealthy"; + } + if (message.disableConnectionDrainOnFailover != null && message.hasOwnProperty("disableConnectionDrainOnFailover")) { + object.disableConnectionDrainOnFailover = message.disableConnectionDrainOnFailover; + if (options.oneofs) + object._disableConnectionDrainOnFailover = "disableConnectionDrainOnFailover"; + } + if (message.failoverRatio != null && message.hasOwnProperty("failoverRatio")) { + object.failoverRatio = options.json && !isFinite(message.failoverRatio) ? String(message.failoverRatio) : message.failoverRatio; + if (options.oneofs) + object._failoverRatio = "failoverRatio"; + } + return object; + }; + + /** + * Converts this BackendServiceFailoverPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceFailoverPolicy + * @instance + * @returns {Object.} JSON object + */ + BackendServiceFailoverPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceFailoverPolicy; + })(); + + v1.BackendServiceIAP = (function() { + + /** + * Properties of a BackendServiceIAP. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceIAP + * @property {boolean|null} [enabled] BackendServiceIAP enabled + * @property {string|null} [oauth2ClientId] BackendServiceIAP oauth2ClientId + * @property {string|null} [oauth2ClientSecret] BackendServiceIAP oauth2ClientSecret + * @property {string|null} [oauth2ClientSecretSha256] BackendServiceIAP oauth2ClientSecretSha256 + */ + + /** + * Constructs a new BackendServiceIAP. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceIAP. + * @implements IBackendServiceIAP + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceIAP=} [properties] Properties to set + */ + function BackendServiceIAP(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceIAP enabled. + * @member {boolean|null|undefined} enabled + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + BackendServiceIAP.prototype.enabled = null; + + /** + * BackendServiceIAP oauth2ClientId. + * @member {string|null|undefined} oauth2ClientId + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + BackendServiceIAP.prototype.oauth2ClientId = null; + + /** + * BackendServiceIAP oauth2ClientSecret. + * @member {string|null|undefined} oauth2ClientSecret + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + BackendServiceIAP.prototype.oauth2ClientSecret = null; + + /** + * BackendServiceIAP oauth2ClientSecretSha256. + * @member {string|null|undefined} oauth2ClientSecretSha256 + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + BackendServiceIAP.prototype.oauth2ClientSecretSha256 = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceIAP _enabled. + * @member {"enabled"|undefined} _enabled + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + Object.defineProperty(BackendServiceIAP.prototype, "_enabled", { + get: $util.oneOfGetter($oneOfFields = ["enabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceIAP _oauth2ClientId. + * @member {"oauth2ClientId"|undefined} _oauth2ClientId + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + Object.defineProperty(BackendServiceIAP.prototype, "_oauth2ClientId", { + get: $util.oneOfGetter($oneOfFields = ["oauth2ClientId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceIAP _oauth2ClientSecret. + * @member {"oauth2ClientSecret"|undefined} _oauth2ClientSecret + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + Object.defineProperty(BackendServiceIAP.prototype, "_oauth2ClientSecret", { + get: $util.oneOfGetter($oneOfFields = ["oauth2ClientSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceIAP _oauth2ClientSecretSha256. + * @member {"oauth2ClientSecretSha256"|undefined} _oauth2ClientSecretSha256 + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + */ + Object.defineProperty(BackendServiceIAP.prototype, "_oauth2ClientSecretSha256", { + get: $util.oneOfGetter($oneOfFields = ["oauth2ClientSecretSha256"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceIAP instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {google.cloud.compute.v1.IBackendServiceIAP=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceIAP} BackendServiceIAP instance + */ + BackendServiceIAP.create = function create(properties) { + return new BackendServiceIAP(properties); + }; + + /** + * Encodes the specified BackendServiceIAP message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceIAP.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {google.cloud.compute.v1.IBackendServiceIAP} message BackendServiceIAP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceIAP.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1018689, wireType 0 =*/8149512).bool(message.enabled); + if (message.oauth2ClientSecret != null && Object.hasOwnProperty.call(message, "oauth2ClientSecret")) + writer.uint32(/* id 50999520, wireType 2 =*/407996162).string(message.oauth2ClientSecret); + if (message.oauth2ClientSecretSha256 != null && Object.hasOwnProperty.call(message, "oauth2ClientSecretSha256")) + writer.uint32(/* id 112903782, wireType 2 =*/903230258).string(message.oauth2ClientSecretSha256); + if (message.oauth2ClientId != null && Object.hasOwnProperty.call(message, "oauth2ClientId")) + writer.uint32(/* id 314017611, wireType 2 =*/2512140890).string(message.oauth2ClientId); + return writer; + }; + + /** + * Encodes the specified BackendServiceIAP message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceIAP.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {google.cloud.compute.v1.IBackendServiceIAP} message BackendServiceIAP message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceIAP.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceIAP message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceIAP} BackendServiceIAP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceIAP.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceIAP(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1018689: + message.enabled = reader.bool(); + break; + case 314017611: + message.oauth2ClientId = reader.string(); + break; + case 50999520: + message.oauth2ClientSecret = reader.string(); + break; + case 112903782: + message.oauth2ClientSecretSha256 = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceIAP message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceIAP} BackendServiceIAP + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceIAP.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceIAP message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceIAP.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + properties._enabled = 1; + if (typeof message.enabled !== "boolean") + return "enabled: boolean expected"; + } + if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) { + properties._oauth2ClientId = 1; + if (!$util.isString(message.oauth2ClientId)) + return "oauth2ClientId: string expected"; + } + if (message.oauth2ClientSecret != null && message.hasOwnProperty("oauth2ClientSecret")) { + properties._oauth2ClientSecret = 1; + if (!$util.isString(message.oauth2ClientSecret)) + return "oauth2ClientSecret: string expected"; + } + if (message.oauth2ClientSecretSha256 != null && message.hasOwnProperty("oauth2ClientSecretSha256")) { + properties._oauth2ClientSecretSha256 = 1; + if (!$util.isString(message.oauth2ClientSecretSha256)) + return "oauth2ClientSecretSha256: string expected"; + } + return null; + }; + + /** + * Creates a BackendServiceIAP message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceIAP} BackendServiceIAP + */ + BackendServiceIAP.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceIAP) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceIAP(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + if (object.oauth2ClientId != null) + message.oauth2ClientId = String(object.oauth2ClientId); + if (object.oauth2ClientSecret != null) + message.oauth2ClientSecret = String(object.oauth2ClientSecret); + if (object.oauth2ClientSecretSha256 != null) + message.oauth2ClientSecretSha256 = String(object.oauth2ClientSecretSha256); + return message; + }; + + /** + * Creates a plain object from a BackendServiceIAP message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @static + * @param {google.cloud.compute.v1.BackendServiceIAP} message BackendServiceIAP + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceIAP.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enabled != null && message.hasOwnProperty("enabled")) { + object.enabled = message.enabled; + if (options.oneofs) + object._enabled = "enabled"; + } + if (message.oauth2ClientSecret != null && message.hasOwnProperty("oauth2ClientSecret")) { + object.oauth2ClientSecret = message.oauth2ClientSecret; + if (options.oneofs) + object._oauth2ClientSecret = "oauth2ClientSecret"; + } + if (message.oauth2ClientSecretSha256 != null && message.hasOwnProperty("oauth2ClientSecretSha256")) { + object.oauth2ClientSecretSha256 = message.oauth2ClientSecretSha256; + if (options.oneofs) + object._oauth2ClientSecretSha256 = "oauth2ClientSecretSha256"; + } + if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) { + object.oauth2ClientId = message.oauth2ClientId; + if (options.oneofs) + object._oauth2ClientId = "oauth2ClientId"; + } + return object; + }; + + /** + * Converts this BackendServiceIAP to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceIAP + * @instance + * @returns {Object.} JSON object + */ + BackendServiceIAP.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceIAP; + })(); + + v1.BackendServiceLogConfig = (function() { + + /** + * Properties of a BackendServiceLogConfig. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceLogConfig + * @property {boolean|null} [enable] BackendServiceLogConfig enable + * @property {number|null} [sampleRate] BackendServiceLogConfig sampleRate + */ + + /** + * Constructs a new BackendServiceLogConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceLogConfig. + * @implements IBackendServiceLogConfig + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceLogConfig=} [properties] Properties to set + */ + function BackendServiceLogConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceLogConfig enable. + * @member {boolean|null|undefined} enable + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @instance + */ + BackendServiceLogConfig.prototype.enable = null; + + /** + * BackendServiceLogConfig sampleRate. + * @member {number|null|undefined} sampleRate + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @instance + */ + BackendServiceLogConfig.prototype.sampleRate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceLogConfig _enable. + * @member {"enable"|undefined} _enable + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @instance + */ + Object.defineProperty(BackendServiceLogConfig.prototype, "_enable", { + get: $util.oneOfGetter($oneOfFields = ["enable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceLogConfig _sampleRate. + * @member {"sampleRate"|undefined} _sampleRate + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @instance + */ + Object.defineProperty(BackendServiceLogConfig.prototype, "_sampleRate", { + get: $util.oneOfGetter($oneOfFields = ["sampleRate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceLogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {google.cloud.compute.v1.IBackendServiceLogConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceLogConfig} BackendServiceLogConfig instance + */ + BackendServiceLogConfig.create = function create(properties) { + return new BackendServiceLogConfig(properties); + }; + + /** + * Encodes the specified BackendServiceLogConfig message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceLogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {google.cloud.compute.v1.IBackendServiceLogConfig} message BackendServiceLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sampleRate != null && Object.hasOwnProperty.call(message, "sampleRate")) + writer.uint32(/* id 153193045, wireType 5 =*/1225544365).float(message.sampleRate); + if (message.enable != null && Object.hasOwnProperty.call(message, "enable")) + writer.uint32(/* id 311764355, wireType 0 =*/2494114840).bool(message.enable); + return writer; + }; + + /** + * Encodes the specified BackendServiceLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {google.cloud.compute.v1.IBackendServiceLogConfig} message BackendServiceLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceLogConfig} BackendServiceLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 311764355: + message.enable = reader.bool(); + break; + case 153193045: + message.sampleRate = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceLogConfig} BackendServiceLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceLogConfig message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enable != null && message.hasOwnProperty("enable")) { + properties._enable = 1; + if (typeof message.enable !== "boolean") + return "enable: boolean expected"; + } + if (message.sampleRate != null && message.hasOwnProperty("sampleRate")) { + properties._sampleRate = 1; + if (typeof message.sampleRate !== "number") + return "sampleRate: number expected"; + } + return null; + }; + + /** + * Creates a BackendServiceLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceLogConfig} BackendServiceLogConfig + */ + BackendServiceLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceLogConfig) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceLogConfig(); + if (object.enable != null) + message.enable = Boolean(object.enable); + if (object.sampleRate != null) + message.sampleRate = Number(object.sampleRate); + return message; + }; + + /** + * Creates a plain object from a BackendServiceLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @static + * @param {google.cloud.compute.v1.BackendServiceLogConfig} message BackendServiceLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sampleRate != null && message.hasOwnProperty("sampleRate")) { + object.sampleRate = options.json && !isFinite(message.sampleRate) ? String(message.sampleRate) : message.sampleRate; + if (options.oneofs) + object._sampleRate = "sampleRate"; + } + if (message.enable != null && message.hasOwnProperty("enable")) { + object.enable = message.enable; + if (options.oneofs) + object._enable = "enable"; + } + return object; + }; + + /** + * Converts this BackendServiceLogConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceLogConfig + * @instance + * @returns {Object.} JSON object + */ + BackendServiceLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceLogConfig; + })(); + + v1.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.cloud.compute.v1 + * @interface IDuration + * @property {number|null} [nanos] Duration nanos + * @property {number|Long|null} [seconds] Duration seconds + */ + + /** + * Constructs a new Duration. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.cloud.compute.v1.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 nanos. + * @member {number|null|undefined} nanos + * @memberof google.cloud.compute.v1.Duration + * @instance + */ + Duration.prototype.nanos = null; + + /** + * Duration seconds. + * @member {number|Long|null|undefined} seconds + * @memberof google.cloud.compute.v1.Duration + * @instance + */ + Duration.prototype.seconds = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Duration _nanos. + * @member {"nanos"|undefined} _nanos + * @memberof google.cloud.compute.v1.Duration + * @instance + */ + Object.defineProperty(Duration.prototype, "_nanos", { + get: $util.oneOfGetter($oneOfFields = ["nanos"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Duration _seconds. + * @member {"seconds"|undefined} _seconds + * @memberof google.cloud.compute.v1.Duration + * @instance + */ + Object.defineProperty(Duration.prototype, "_seconds", { + get: $util.oneOfGetter($oneOfFields = ["seconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Duration + * @static + * @param {google.cloud.compute.v1.IDuration=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.cloud.compute.v1.Duration.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Duration + * @static + * @param {google.cloud.compute.v1.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.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 104586303, wireType 0 =*/836690424).int32(message.nanos); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 359484031, wireType 0 =*/2875872248).int64(message.seconds); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Duration + * @static + * @param {google.cloud.compute.v1.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.cloud.compute.v1.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.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.cloud.compute.v1.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 104586303: + message.nanos = reader.int32(); + break; + case 359484031: + message.seconds = reader.int64(); + 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.cloud.compute.v1.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.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.cloud.compute.v1.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"; + var properties = {}; + if (message.nanos != null && message.hasOwnProperty("nanos")) { + properties._nanos = 1; + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) { + properties._seconds = 1; + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + } + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Duration) + return object; + var message = new $root.google.cloud.compute.v1.Duration(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + 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(); + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Duration + * @static + * @param {google.cloud.compute.v1.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 (message.nanos != null && message.hasOwnProperty("nanos")) { + object.nanos = message.nanos; + if (options.oneofs) + object._nanos = "nanos"; + } + 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 (options.oneofs) + object._seconds = "seconds"; + } + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); + + v1.OutlierDetection = (function() { + + /** + * Properties of an OutlierDetection. + * @memberof google.cloud.compute.v1 + * @interface IOutlierDetection + * @property {google.cloud.compute.v1.IDuration|null} [baseEjectionTime] OutlierDetection baseEjectionTime + * @property {number|null} [consecutiveErrors] OutlierDetection consecutiveErrors + * @property {number|null} [consecutiveGatewayFailure] OutlierDetection consecutiveGatewayFailure + * @property {number|null} [enforcingConsecutiveErrors] OutlierDetection enforcingConsecutiveErrors + * @property {number|null} [enforcingConsecutiveGatewayFailure] OutlierDetection enforcingConsecutiveGatewayFailure + * @property {number|null} [enforcingSuccessRate] OutlierDetection enforcingSuccessRate + * @property {google.cloud.compute.v1.IDuration|null} [interval] OutlierDetection interval + * @property {number|null} [maxEjectionPercent] OutlierDetection maxEjectionPercent + * @property {number|null} [successRateMinimumHosts] OutlierDetection successRateMinimumHosts + * @property {number|null} [successRateRequestVolume] OutlierDetection successRateRequestVolume + * @property {number|null} [successRateStdevFactor] OutlierDetection successRateStdevFactor + */ + + /** + * Constructs a new OutlierDetection. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an OutlierDetection. + * @implements IOutlierDetection + * @constructor + * @param {google.cloud.compute.v1.IOutlierDetection=} [properties] Properties to set + */ + function OutlierDetection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutlierDetection baseEjectionTime. + * @member {google.cloud.compute.v1.IDuration|null|undefined} baseEjectionTime + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.baseEjectionTime = null; + + /** + * OutlierDetection consecutiveErrors. + * @member {number|null|undefined} consecutiveErrors + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.consecutiveErrors = null; + + /** + * OutlierDetection consecutiveGatewayFailure. + * @member {number|null|undefined} consecutiveGatewayFailure + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.consecutiveGatewayFailure = null; + + /** + * OutlierDetection enforcingConsecutiveErrors. + * @member {number|null|undefined} enforcingConsecutiveErrors + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.enforcingConsecutiveErrors = null; + + /** + * OutlierDetection enforcingConsecutiveGatewayFailure. + * @member {number|null|undefined} enforcingConsecutiveGatewayFailure + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.enforcingConsecutiveGatewayFailure = null; + + /** + * OutlierDetection enforcingSuccessRate. + * @member {number|null|undefined} enforcingSuccessRate + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.enforcingSuccessRate = null; + + /** + * OutlierDetection interval. + * @member {google.cloud.compute.v1.IDuration|null|undefined} interval + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.interval = null; + + /** + * OutlierDetection maxEjectionPercent. + * @member {number|null|undefined} maxEjectionPercent + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.maxEjectionPercent = null; + + /** + * OutlierDetection successRateMinimumHosts. + * @member {number|null|undefined} successRateMinimumHosts + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.successRateMinimumHosts = null; + + /** + * OutlierDetection successRateRequestVolume. + * @member {number|null|undefined} successRateRequestVolume + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.successRateRequestVolume = null; + + /** + * OutlierDetection successRateStdevFactor. + * @member {number|null|undefined} successRateStdevFactor + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + OutlierDetection.prototype.successRateStdevFactor = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutlierDetection _baseEjectionTime. + * @member {"baseEjectionTime"|undefined} _baseEjectionTime + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_baseEjectionTime", { + get: $util.oneOfGetter($oneOfFields = ["baseEjectionTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _consecutiveErrors. + * @member {"consecutiveErrors"|undefined} _consecutiveErrors + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_consecutiveErrors", { + get: $util.oneOfGetter($oneOfFields = ["consecutiveErrors"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _consecutiveGatewayFailure. + * @member {"consecutiveGatewayFailure"|undefined} _consecutiveGatewayFailure + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_consecutiveGatewayFailure", { + get: $util.oneOfGetter($oneOfFields = ["consecutiveGatewayFailure"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _enforcingConsecutiveErrors. + * @member {"enforcingConsecutiveErrors"|undefined} _enforcingConsecutiveErrors + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_enforcingConsecutiveErrors", { + get: $util.oneOfGetter($oneOfFields = ["enforcingConsecutiveErrors"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _enforcingConsecutiveGatewayFailure. + * @member {"enforcingConsecutiveGatewayFailure"|undefined} _enforcingConsecutiveGatewayFailure + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_enforcingConsecutiveGatewayFailure", { + get: $util.oneOfGetter($oneOfFields = ["enforcingConsecutiveGatewayFailure"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _enforcingSuccessRate. + * @member {"enforcingSuccessRate"|undefined} _enforcingSuccessRate + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_enforcingSuccessRate", { + get: $util.oneOfGetter($oneOfFields = ["enforcingSuccessRate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _interval. + * @member {"interval"|undefined} _interval + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_interval", { + get: $util.oneOfGetter($oneOfFields = ["interval"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _maxEjectionPercent. + * @member {"maxEjectionPercent"|undefined} _maxEjectionPercent + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_maxEjectionPercent", { + get: $util.oneOfGetter($oneOfFields = ["maxEjectionPercent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _successRateMinimumHosts. + * @member {"successRateMinimumHosts"|undefined} _successRateMinimumHosts + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_successRateMinimumHosts", { + get: $util.oneOfGetter($oneOfFields = ["successRateMinimumHosts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _successRateRequestVolume. + * @member {"successRateRequestVolume"|undefined} _successRateRequestVolume + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_successRateRequestVolume", { + get: $util.oneOfGetter($oneOfFields = ["successRateRequestVolume"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OutlierDetection _successRateStdevFactor. + * @member {"successRateStdevFactor"|undefined} _successRateStdevFactor + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + */ + Object.defineProperty(OutlierDetection.prototype, "_successRateStdevFactor", { + get: $util.oneOfGetter($oneOfFields = ["successRateStdevFactor"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutlierDetection instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {google.cloud.compute.v1.IOutlierDetection=} [properties] Properties to set + * @returns {google.cloud.compute.v1.OutlierDetection} OutlierDetection instance + */ + OutlierDetection.create = function create(properties) { + return new OutlierDetection(properties); + }; + + /** + * Encodes the specified OutlierDetection message. Does not implicitly {@link google.cloud.compute.v1.OutlierDetection.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {google.cloud.compute.v1.IOutlierDetection} message OutlierDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutlierDetection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxEjectionPercent != null && Object.hasOwnProperty.call(message, "maxEjectionPercent")) + writer.uint32(/* id 18436888, wireType 0 =*/147495104).int32(message.maxEjectionPercent); + if (message.interval != null && Object.hasOwnProperty.call(message, "interval")) + $root.google.cloud.compute.v1.Duration.encode(message.interval, writer.uint32(/* id 33547461, wireType 2 =*/268379690).fork()).ldelim(); + if (message.baseEjectionTime != null && Object.hasOwnProperty.call(message, "baseEjectionTime")) + $root.google.cloud.compute.v1.Duration.encode(message.baseEjectionTime, writer.uint32(/* id 80997255, wireType 2 =*/647978042).fork()).ldelim(); + if (message.successRateStdevFactor != null && Object.hasOwnProperty.call(message, "successRateStdevFactor")) + writer.uint32(/* id 174735773, wireType 0 =*/1397886184).int32(message.successRateStdevFactor); + if (message.enforcingSuccessRate != null && Object.hasOwnProperty.call(message, "enforcingSuccessRate")) + writer.uint32(/* id 194508732, wireType 0 =*/1556069856).int32(message.enforcingSuccessRate); + if (message.enforcingConsecutiveErrors != null && Object.hasOwnProperty.call(message, "enforcingConsecutiveErrors")) + writer.uint32(/* id 213133760, wireType 0 =*/1705070080).int32(message.enforcingConsecutiveErrors); + if (message.successRateRequestVolume != null && Object.hasOwnProperty.call(message, "successRateRequestVolume")) + writer.uint32(/* id 281425357, wireType 0 =*/2251402856).int32(message.successRateRequestVolume); + if (message.consecutiveErrors != null && Object.hasOwnProperty.call(message, "consecutiveErrors")) + writer.uint32(/* id 387193248, wireType 0 =*/3097545984).int32(message.consecutiveErrors); + if (message.enforcingConsecutiveGatewayFailure != null && Object.hasOwnProperty.call(message, "enforcingConsecutiveGatewayFailure")) + writer.uint32(/* id 394440666, wireType 0 =*/3155525328).int32(message.enforcingConsecutiveGatewayFailure); + if (message.consecutiveGatewayFailure != null && Object.hasOwnProperty.call(message, "consecutiveGatewayFailure")) + writer.uint32(/* id 417504250, wireType 0 =*/3340034000).int32(message.consecutiveGatewayFailure); + if (message.successRateMinimumHosts != null && Object.hasOwnProperty.call(message, "successRateMinimumHosts")) + writer.uint32(/* id 525766903, wireType 0 =*/4206135224).int32(message.successRateMinimumHosts); + return writer; + }; + + /** + * Encodes the specified OutlierDetection message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OutlierDetection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {google.cloud.compute.v1.IOutlierDetection} message OutlierDetection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutlierDetection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutlierDetection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.OutlierDetection} OutlierDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutlierDetection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.OutlierDetection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 80997255: + message.baseEjectionTime = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 387193248: + message.consecutiveErrors = reader.int32(); + break; + case 417504250: + message.consecutiveGatewayFailure = reader.int32(); + break; + case 213133760: + message.enforcingConsecutiveErrors = reader.int32(); + break; + case 394440666: + message.enforcingConsecutiveGatewayFailure = reader.int32(); + break; + case 194508732: + message.enforcingSuccessRate = reader.int32(); + break; + case 33547461: + message.interval = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 18436888: + message.maxEjectionPercent = reader.int32(); + break; + case 525766903: + message.successRateMinimumHosts = reader.int32(); + break; + case 281425357: + message.successRateRequestVolume = reader.int32(); + break; + case 174735773: + message.successRateStdevFactor = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutlierDetection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.OutlierDetection} OutlierDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutlierDetection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutlierDetection message. + * @function verify + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutlierDetection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.baseEjectionTime != null && message.hasOwnProperty("baseEjectionTime")) { + properties._baseEjectionTime = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.baseEjectionTime); + if (error) + return "baseEjectionTime." + error; + } + } + if (message.consecutiveErrors != null && message.hasOwnProperty("consecutiveErrors")) { + properties._consecutiveErrors = 1; + if (!$util.isInteger(message.consecutiveErrors)) + return "consecutiveErrors: integer expected"; + } + if (message.consecutiveGatewayFailure != null && message.hasOwnProperty("consecutiveGatewayFailure")) { + properties._consecutiveGatewayFailure = 1; + if (!$util.isInteger(message.consecutiveGatewayFailure)) + return "consecutiveGatewayFailure: integer expected"; + } + if (message.enforcingConsecutiveErrors != null && message.hasOwnProperty("enforcingConsecutiveErrors")) { + properties._enforcingConsecutiveErrors = 1; + if (!$util.isInteger(message.enforcingConsecutiveErrors)) + return "enforcingConsecutiveErrors: integer expected"; + } + if (message.enforcingConsecutiveGatewayFailure != null && message.hasOwnProperty("enforcingConsecutiveGatewayFailure")) { + properties._enforcingConsecutiveGatewayFailure = 1; + if (!$util.isInteger(message.enforcingConsecutiveGatewayFailure)) + return "enforcingConsecutiveGatewayFailure: integer expected"; + } + if (message.enforcingSuccessRate != null && message.hasOwnProperty("enforcingSuccessRate")) { + properties._enforcingSuccessRate = 1; + if (!$util.isInteger(message.enforcingSuccessRate)) + return "enforcingSuccessRate: integer expected"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + properties._interval = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.interval); + if (error) + return "interval." + error; + } + } + if (message.maxEjectionPercent != null && message.hasOwnProperty("maxEjectionPercent")) { + properties._maxEjectionPercent = 1; + if (!$util.isInteger(message.maxEjectionPercent)) + return "maxEjectionPercent: integer expected"; + } + if (message.successRateMinimumHosts != null && message.hasOwnProperty("successRateMinimumHosts")) { + properties._successRateMinimumHosts = 1; + if (!$util.isInteger(message.successRateMinimumHosts)) + return "successRateMinimumHosts: integer expected"; + } + if (message.successRateRequestVolume != null && message.hasOwnProperty("successRateRequestVolume")) { + properties._successRateRequestVolume = 1; + if (!$util.isInteger(message.successRateRequestVolume)) + return "successRateRequestVolume: integer expected"; + } + if (message.successRateStdevFactor != null && message.hasOwnProperty("successRateStdevFactor")) { + properties._successRateStdevFactor = 1; + if (!$util.isInteger(message.successRateStdevFactor)) + return "successRateStdevFactor: integer expected"; + } + return null; + }; + + /** + * Creates an OutlierDetection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.OutlierDetection} OutlierDetection + */ + OutlierDetection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.OutlierDetection) + return object; + var message = new $root.google.cloud.compute.v1.OutlierDetection(); + if (object.baseEjectionTime != null) { + if (typeof object.baseEjectionTime !== "object") + throw TypeError(".google.cloud.compute.v1.OutlierDetection.baseEjectionTime: object expected"); + message.baseEjectionTime = $root.google.cloud.compute.v1.Duration.fromObject(object.baseEjectionTime); + } + if (object.consecutiveErrors != null) + message.consecutiveErrors = object.consecutiveErrors | 0; + if (object.consecutiveGatewayFailure != null) + message.consecutiveGatewayFailure = object.consecutiveGatewayFailure | 0; + if (object.enforcingConsecutiveErrors != null) + message.enforcingConsecutiveErrors = object.enforcingConsecutiveErrors | 0; + if (object.enforcingConsecutiveGatewayFailure != null) + message.enforcingConsecutiveGatewayFailure = object.enforcingConsecutiveGatewayFailure | 0; + if (object.enforcingSuccessRate != null) + message.enforcingSuccessRate = object.enforcingSuccessRate | 0; + if (object.interval != null) { + if (typeof object.interval !== "object") + throw TypeError(".google.cloud.compute.v1.OutlierDetection.interval: object expected"); + message.interval = $root.google.cloud.compute.v1.Duration.fromObject(object.interval); + } + if (object.maxEjectionPercent != null) + message.maxEjectionPercent = object.maxEjectionPercent | 0; + if (object.successRateMinimumHosts != null) + message.successRateMinimumHosts = object.successRateMinimumHosts | 0; + if (object.successRateRequestVolume != null) + message.successRateRequestVolume = object.successRateRequestVolume | 0; + if (object.successRateStdevFactor != null) + message.successRateStdevFactor = object.successRateStdevFactor | 0; + return message; + }; + + /** + * Creates a plain object from an OutlierDetection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.OutlierDetection + * @static + * @param {google.cloud.compute.v1.OutlierDetection} message OutlierDetection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutlierDetection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.maxEjectionPercent != null && message.hasOwnProperty("maxEjectionPercent")) { + object.maxEjectionPercent = message.maxEjectionPercent; + if (options.oneofs) + object._maxEjectionPercent = "maxEjectionPercent"; + } + if (message.interval != null && message.hasOwnProperty("interval")) { + object.interval = $root.google.cloud.compute.v1.Duration.toObject(message.interval, options); + if (options.oneofs) + object._interval = "interval"; + } + if (message.baseEjectionTime != null && message.hasOwnProperty("baseEjectionTime")) { + object.baseEjectionTime = $root.google.cloud.compute.v1.Duration.toObject(message.baseEjectionTime, options); + if (options.oneofs) + object._baseEjectionTime = "baseEjectionTime"; + } + if (message.successRateStdevFactor != null && message.hasOwnProperty("successRateStdevFactor")) { + object.successRateStdevFactor = message.successRateStdevFactor; + if (options.oneofs) + object._successRateStdevFactor = "successRateStdevFactor"; + } + if (message.enforcingSuccessRate != null && message.hasOwnProperty("enforcingSuccessRate")) { + object.enforcingSuccessRate = message.enforcingSuccessRate; + if (options.oneofs) + object._enforcingSuccessRate = "enforcingSuccessRate"; + } + if (message.enforcingConsecutiveErrors != null && message.hasOwnProperty("enforcingConsecutiveErrors")) { + object.enforcingConsecutiveErrors = message.enforcingConsecutiveErrors; + if (options.oneofs) + object._enforcingConsecutiveErrors = "enforcingConsecutiveErrors"; + } + if (message.successRateRequestVolume != null && message.hasOwnProperty("successRateRequestVolume")) { + object.successRateRequestVolume = message.successRateRequestVolume; + if (options.oneofs) + object._successRateRequestVolume = "successRateRequestVolume"; + } + if (message.consecutiveErrors != null && message.hasOwnProperty("consecutiveErrors")) { + object.consecutiveErrors = message.consecutiveErrors; + if (options.oneofs) + object._consecutiveErrors = "consecutiveErrors"; + } + if (message.enforcingConsecutiveGatewayFailure != null && message.hasOwnProperty("enforcingConsecutiveGatewayFailure")) { + object.enforcingConsecutiveGatewayFailure = message.enforcingConsecutiveGatewayFailure; + if (options.oneofs) + object._enforcingConsecutiveGatewayFailure = "enforcingConsecutiveGatewayFailure"; + } + if (message.consecutiveGatewayFailure != null && message.hasOwnProperty("consecutiveGatewayFailure")) { + object.consecutiveGatewayFailure = message.consecutiveGatewayFailure; + if (options.oneofs) + object._consecutiveGatewayFailure = "consecutiveGatewayFailure"; + } + if (message.successRateMinimumHosts != null && message.hasOwnProperty("successRateMinimumHosts")) { + object.successRateMinimumHosts = message.successRateMinimumHosts; + if (options.oneofs) + object._successRateMinimumHosts = "successRateMinimumHosts"; + } + return object; + }; + + /** + * Converts this OutlierDetection to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.OutlierDetection + * @instance + * @returns {Object.} JSON object + */ + OutlierDetection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutlierDetection; + })(); + + v1.SecuritySettings = (function() { + + /** + * Properties of a SecuritySettings. + * @memberof google.cloud.compute.v1 + * @interface ISecuritySettings + * @property {string|null} [clientTlsPolicy] SecuritySettings clientTlsPolicy + * @property {Array.|null} [subjectAltNames] SecuritySettings subjectAltNames + */ + + /** + * Constructs a new SecuritySettings. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecuritySettings. + * @implements ISecuritySettings + * @constructor + * @param {google.cloud.compute.v1.ISecuritySettings=} [properties] Properties to set + */ + function SecuritySettings(properties) { + this.subjectAltNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecuritySettings clientTlsPolicy. + * @member {string|null|undefined} clientTlsPolicy + * @memberof google.cloud.compute.v1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.clientTlsPolicy = null; + + /** + * SecuritySettings subjectAltNames. + * @member {Array.} subjectAltNames + * @memberof google.cloud.compute.v1.SecuritySettings + * @instance + */ + SecuritySettings.prototype.subjectAltNames = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecuritySettings _clientTlsPolicy. + * @member {"clientTlsPolicy"|undefined} _clientTlsPolicy + * @memberof google.cloud.compute.v1.SecuritySettings + * @instance + */ + Object.defineProperty(SecuritySettings.prototype, "_clientTlsPolicy", { + get: $util.oneOfGetter($oneOfFields = ["clientTlsPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecuritySettings instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {google.cloud.compute.v1.ISecuritySettings=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecuritySettings} SecuritySettings instance + */ + SecuritySettings.create = function create(properties) { + return new SecuritySettings(properties); + }; + + /** + * Encodes the specified SecuritySettings message. Does not implicitly {@link google.cloud.compute.v1.SecuritySettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {google.cloud.compute.v1.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subjectAltNames != null && message.subjectAltNames.length) + for (var i = 0; i < message.subjectAltNames.length; ++i) + writer.uint32(/* id 330029535, wireType 2 =*/2640236282).string(message.subjectAltNames[i]); + if (message.clientTlsPolicy != null && Object.hasOwnProperty.call(message, "clientTlsPolicy")) + writer.uint32(/* id 462325226, wireType 2 =*/3698601810).string(message.clientTlsPolicy); + return writer; + }; + + /** + * Encodes the specified SecuritySettings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecuritySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {google.cloud.compute.v1.ISecuritySettings} message SecuritySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecuritySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecuritySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 462325226: + message.clientTlsPolicy = reader.string(); + break; + case 330029535: + if (!(message.subjectAltNames && message.subjectAltNames.length)) + message.subjectAltNames = []; + message.subjectAltNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecuritySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecuritySettings} SecuritySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecuritySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecuritySettings message. + * @function verify + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecuritySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) { + properties._clientTlsPolicy = 1; + if (!$util.isString(message.clientTlsPolicy)) + return "clientTlsPolicy: string expected"; + } + if (message.subjectAltNames != null && message.hasOwnProperty("subjectAltNames")) { + if (!Array.isArray(message.subjectAltNames)) + return "subjectAltNames: array expected"; + for (var i = 0; i < message.subjectAltNames.length; ++i) + if (!$util.isString(message.subjectAltNames[i])) + return "subjectAltNames: string[] expected"; + } + return null; + }; + + /** + * Creates a SecuritySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecuritySettings} SecuritySettings + */ + SecuritySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecuritySettings) + return object; + var message = new $root.google.cloud.compute.v1.SecuritySettings(); + if (object.clientTlsPolicy != null) + message.clientTlsPolicy = String(object.clientTlsPolicy); + if (object.subjectAltNames) { + if (!Array.isArray(object.subjectAltNames)) + throw TypeError(".google.cloud.compute.v1.SecuritySettings.subjectAltNames: array expected"); + message.subjectAltNames = []; + for (var i = 0; i < object.subjectAltNames.length; ++i) + message.subjectAltNames[i] = String(object.subjectAltNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecuritySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecuritySettings + * @static + * @param {google.cloud.compute.v1.SecuritySettings} message SecuritySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecuritySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subjectAltNames = []; + if (message.subjectAltNames && message.subjectAltNames.length) { + object.subjectAltNames = []; + for (var j = 0; j < message.subjectAltNames.length; ++j) + object.subjectAltNames[j] = message.subjectAltNames[j]; + } + if (message.clientTlsPolicy != null && message.hasOwnProperty("clientTlsPolicy")) { + object.clientTlsPolicy = message.clientTlsPolicy; + if (options.oneofs) + object._clientTlsPolicy = "clientTlsPolicy"; + } + return object; + }; + + /** + * Converts this SecuritySettings to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecuritySettings + * @instance + * @returns {Object.} JSON object + */ + SecuritySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecuritySettings; + })(); + + v1.BackendService = (function() { + + /** + * Properties of a BackendService. + * @memberof google.cloud.compute.v1 + * @interface IBackendService + * @property {number|null} [affinityCookieTtlSec] BackendService affinityCookieTtlSec + * @property {Array.|null} [backends] BackendService backends + * @property {google.cloud.compute.v1.IBackendServiceCdnPolicy|null} [cdnPolicy] BackendService cdnPolicy + * @property {google.cloud.compute.v1.ICircuitBreakers|null} [circuitBreakers] BackendService circuitBreakers + * @property {google.cloud.compute.v1.IConnectionDraining|null} [connectionDraining] BackendService connectionDraining + * @property {google.cloud.compute.v1.IConsistentHashLoadBalancerSettings|null} [consistentHash] BackendService consistentHash + * @property {string|null} [creationTimestamp] BackendService creationTimestamp + * @property {Array.|null} [customRequestHeaders] BackendService customRequestHeaders + * @property {Array.|null} [customResponseHeaders] BackendService customResponseHeaders + * @property {string|null} [description] BackendService description + * @property {boolean|null} [enableCDN] BackendService enableCDN + * @property {google.cloud.compute.v1.IBackendServiceFailoverPolicy|null} [failoverPolicy] BackendService failoverPolicy + * @property {string|null} [fingerprint] BackendService fingerprint + * @property {Array.|null} [healthChecks] BackendService healthChecks + * @property {google.cloud.compute.v1.IBackendServiceIAP|null} [iap] BackendService iap + * @property {number|Long|null} [id] BackendService id + * @property {string|null} [kind] BackendService kind + * @property {google.cloud.compute.v1.BackendService.LoadBalancingScheme|null} [loadBalancingScheme] BackendService loadBalancingScheme + * @property {google.cloud.compute.v1.BackendService.LocalityLbPolicy|null} [localityLbPolicy] BackendService localityLbPolicy + * @property {google.cloud.compute.v1.IBackendServiceLogConfig|null} [logConfig] BackendService logConfig + * @property {google.cloud.compute.v1.IDuration|null} [maxStreamDuration] BackendService maxStreamDuration + * @property {string|null} [name] BackendService name + * @property {string|null} [network] BackendService network + * @property {google.cloud.compute.v1.IOutlierDetection|null} [outlierDetection] BackendService outlierDetection + * @property {number|null} [port] BackendService port + * @property {string|null} [portName] BackendService portName + * @property {google.cloud.compute.v1.BackendService.Protocol|null} [protocol] BackendService protocol + * @property {string|null} [region] BackendService region + * @property {string|null} [securityPolicy] BackendService securityPolicy + * @property {google.cloud.compute.v1.ISecuritySettings|null} [securitySettings] BackendService securitySettings + * @property {string|null} [selfLink] BackendService selfLink + * @property {google.cloud.compute.v1.BackendService.SessionAffinity|null} [sessionAffinity] BackendService sessionAffinity + * @property {number|null} [timeoutSec] BackendService timeoutSec + */ + + /** + * Constructs a new BackendService. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendService. + * @implements IBackendService + * @constructor + * @param {google.cloud.compute.v1.IBackendService=} [properties] Properties to set + */ + function BackendService(properties) { + this.backends = []; + this.customRequestHeaders = []; + this.customResponseHeaders = []; + this.healthChecks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendService affinityCookieTtlSec. + * @member {number|null|undefined} affinityCookieTtlSec + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.affinityCookieTtlSec = null; + + /** + * BackendService backends. + * @member {Array.} backends + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.backends = $util.emptyArray; + + /** + * BackendService cdnPolicy. + * @member {google.cloud.compute.v1.IBackendServiceCdnPolicy|null|undefined} cdnPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.cdnPolicy = null; + + /** + * BackendService circuitBreakers. + * @member {google.cloud.compute.v1.ICircuitBreakers|null|undefined} circuitBreakers + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.circuitBreakers = null; + + /** + * BackendService connectionDraining. + * @member {google.cloud.compute.v1.IConnectionDraining|null|undefined} connectionDraining + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.connectionDraining = null; + + /** + * BackendService consistentHash. + * @member {google.cloud.compute.v1.IConsistentHashLoadBalancerSettings|null|undefined} consistentHash + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.consistentHash = null; + + /** + * BackendService creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.creationTimestamp = null; + + /** + * BackendService customRequestHeaders. + * @member {Array.} customRequestHeaders + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.customRequestHeaders = $util.emptyArray; + + /** + * BackendService customResponseHeaders. + * @member {Array.} customResponseHeaders + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.customResponseHeaders = $util.emptyArray; + + /** + * BackendService description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.description = null; + + /** + * BackendService enableCDN. + * @member {boolean|null|undefined} enableCDN + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.enableCDN = null; + + /** + * BackendService failoverPolicy. + * @member {google.cloud.compute.v1.IBackendServiceFailoverPolicy|null|undefined} failoverPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.failoverPolicy = null; + + /** + * BackendService fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.fingerprint = null; + + /** + * BackendService healthChecks. + * @member {Array.} healthChecks + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.healthChecks = $util.emptyArray; + + /** + * BackendService iap. + * @member {google.cloud.compute.v1.IBackendServiceIAP|null|undefined} iap + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.iap = null; + + /** + * BackendService id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.id = null; + + /** + * BackendService kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.kind = null; + + /** + * BackendService loadBalancingScheme. + * @member {google.cloud.compute.v1.BackendService.LoadBalancingScheme|null|undefined} loadBalancingScheme + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.loadBalancingScheme = null; + + /** + * BackendService localityLbPolicy. + * @member {google.cloud.compute.v1.BackendService.LocalityLbPolicy|null|undefined} localityLbPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.localityLbPolicy = null; + + /** + * BackendService logConfig. + * @member {google.cloud.compute.v1.IBackendServiceLogConfig|null|undefined} logConfig + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.logConfig = null; + + /** + * BackendService maxStreamDuration. + * @member {google.cloud.compute.v1.IDuration|null|undefined} maxStreamDuration + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.maxStreamDuration = null; + + /** + * BackendService name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.name = null; + + /** + * BackendService network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.network = null; + + /** + * BackendService outlierDetection. + * @member {google.cloud.compute.v1.IOutlierDetection|null|undefined} outlierDetection + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.outlierDetection = null; + + /** + * BackendService port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.port = null; + + /** + * BackendService portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.portName = null; + + /** + * BackendService protocol. + * @member {google.cloud.compute.v1.BackendService.Protocol|null|undefined} protocol + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.protocol = null; + + /** + * BackendService region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.region = null; + + /** + * BackendService securityPolicy. + * @member {string|null|undefined} securityPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.securityPolicy = null; + + /** + * BackendService securitySettings. + * @member {google.cloud.compute.v1.ISecuritySettings|null|undefined} securitySettings + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.securitySettings = null; + + /** + * BackendService selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.selfLink = null; + + /** + * BackendService sessionAffinity. + * @member {google.cloud.compute.v1.BackendService.SessionAffinity|null|undefined} sessionAffinity + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.sessionAffinity = null; + + /** + * BackendService timeoutSec. + * @member {number|null|undefined} timeoutSec + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + BackendService.prototype.timeoutSec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendService _affinityCookieTtlSec. + * @member {"affinityCookieTtlSec"|undefined} _affinityCookieTtlSec + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_affinityCookieTtlSec", { + get: $util.oneOfGetter($oneOfFields = ["affinityCookieTtlSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _cdnPolicy. + * @member {"cdnPolicy"|undefined} _cdnPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_cdnPolicy", { + get: $util.oneOfGetter($oneOfFields = ["cdnPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _circuitBreakers. + * @member {"circuitBreakers"|undefined} _circuitBreakers + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_circuitBreakers", { + get: $util.oneOfGetter($oneOfFields = ["circuitBreakers"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _connectionDraining. + * @member {"connectionDraining"|undefined} _connectionDraining + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_connectionDraining", { + get: $util.oneOfGetter($oneOfFields = ["connectionDraining"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _consistentHash. + * @member {"consistentHash"|undefined} _consistentHash + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_consistentHash", { + get: $util.oneOfGetter($oneOfFields = ["consistentHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _enableCDN. + * @member {"enableCDN"|undefined} _enableCDN + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_enableCDN", { + get: $util.oneOfGetter($oneOfFields = ["enableCDN"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _failoverPolicy. + * @member {"failoverPolicy"|undefined} _failoverPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_failoverPolicy", { + get: $util.oneOfGetter($oneOfFields = ["failoverPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _iap. + * @member {"iap"|undefined} _iap + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_iap", { + get: $util.oneOfGetter($oneOfFields = ["iap"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _loadBalancingScheme. + * @member {"loadBalancingScheme"|undefined} _loadBalancingScheme + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_loadBalancingScheme", { + get: $util.oneOfGetter($oneOfFields = ["loadBalancingScheme"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _localityLbPolicy. + * @member {"localityLbPolicy"|undefined} _localityLbPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_localityLbPolicy", { + get: $util.oneOfGetter($oneOfFields = ["localityLbPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _logConfig. + * @member {"logConfig"|undefined} _logConfig + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_logConfig", { + get: $util.oneOfGetter($oneOfFields = ["logConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _maxStreamDuration. + * @member {"maxStreamDuration"|undefined} _maxStreamDuration + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_maxStreamDuration", { + get: $util.oneOfGetter($oneOfFields = ["maxStreamDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _outlierDetection. + * @member {"outlierDetection"|undefined} _outlierDetection + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_outlierDetection", { + get: $util.oneOfGetter($oneOfFields = ["outlierDetection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _protocol. + * @member {"protocol"|undefined} _protocol + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_protocol", { + get: $util.oneOfGetter($oneOfFields = ["protocol"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _securityPolicy. + * @member {"securityPolicy"|undefined} _securityPolicy + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_securityPolicy", { + get: $util.oneOfGetter($oneOfFields = ["securityPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _securitySettings. + * @member {"securitySettings"|undefined} _securitySettings + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_securitySettings", { + get: $util.oneOfGetter($oneOfFields = ["securitySettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _sessionAffinity. + * @member {"sessionAffinity"|undefined} _sessionAffinity + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_sessionAffinity", { + get: $util.oneOfGetter($oneOfFields = ["sessionAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendService _timeoutSec. + * @member {"timeoutSec"|undefined} _timeoutSec + * @memberof google.cloud.compute.v1.BackendService + * @instance + */ + Object.defineProperty(BackendService.prototype, "_timeoutSec", { + get: $util.oneOfGetter($oneOfFields = ["timeoutSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendService instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {google.cloud.compute.v1.IBackendService=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendService} BackendService instance + */ + BackendService.create = function create(properties) { + return new BackendService(properties); + }; + + /** + * Encodes the specified BackendService message. Does not implicitly {@link google.cloud.compute.v1.BackendService.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {google.cloud.compute.v1.IBackendService} message BackendService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.iap != null && Object.hasOwnProperty.call(message, "iap")) + $root.google.cloud.compute.v1.BackendServiceIAP.encode(message.iap, writer.uint32(/* id 104024, wireType 2 =*/832194).fork()).ldelim(); + if (message.consistentHash != null && Object.hasOwnProperty.call(message, "consistentHash")) + $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.encode(message.consistentHash, writer.uint32(/* id 905883, wireType 2 =*/7247066).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.customRequestHeaders != null && message.customRequestHeaders.length) + for (var i = 0; i < message.customRequestHeaders.length; ++i) + writer.uint32(/* id 27977992, wireType 2 =*/223823938).string(message.customRequestHeaders[i]); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.maxStreamDuration != null && Object.hasOwnProperty.call(message, "maxStreamDuration")) + $root.google.cloud.compute.v1.Duration.encode(message.maxStreamDuration, writer.uint32(/* id 61428376, wireType 2 =*/491427010).fork()).ldelim(); + if (message.timeoutSec != null && Object.hasOwnProperty.call(message, "timeoutSec")) + writer.uint32(/* id 79994995, wireType 0 =*/639959960).int32(message.timeoutSec); + if (message.protocol != null && Object.hasOwnProperty.call(message, "protocol")) + writer.uint32(/* id 84577944, wireType 0 =*/676623552).int32(message.protocol); + if (message.failoverPolicy != null && Object.hasOwnProperty.call(message, "failoverPolicy")) + $root.google.cloud.compute.v1.BackendServiceFailoverPolicy.encode(message.failoverPolicy, writer.uint32(/* id 105658655, wireType 2 =*/845269242).fork()).ldelim(); + if (message.localityLbPolicy != null && Object.hasOwnProperty.call(message, "localityLbPolicy")) + writer.uint32(/* id 131431487, wireType 0 =*/1051451896).int32(message.localityLbPolicy); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.cdnPolicy != null && Object.hasOwnProperty.call(message, "cdnPolicy")) + $root.google.cloud.compute.v1.BackendServiceCdnPolicy.encode(message.cdnPolicy, writer.uint32(/* id 213976452, wireType 2 =*/1711811618).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.enableCDN != null && Object.hasOwnProperty.call(message, "enableCDN")) + writer.uint32(/* id 250733499, wireType 0 =*/2005867992).bool(message.enableCDN); + if (message.logConfig != null && Object.hasOwnProperty.call(message, "logConfig")) + $root.google.cloud.compute.v1.BackendServiceLogConfig.encode(message.logConfig, writer.uint32(/* id 351299741, wireType 2 =*/2810397930).fork()).ldelim(); + if (message.outlierDetection != null && Object.hasOwnProperty.call(message, "outlierDetection")) + $root.google.cloud.compute.v1.OutlierDetection.encode(message.outlierDetection, writer.uint32(/* id 354625086, wireType 2 =*/2837000690).fork()).ldelim(); + if (message.loadBalancingScheme != null && Object.hasOwnProperty.call(message, "loadBalancingScheme")) + writer.uint32(/* id 363890244, wireType 0 =*/2911121952).int32(message.loadBalancingScheme); + if (message.affinityCookieTtlSec != null && Object.hasOwnProperty.call(message, "affinityCookieTtlSec")) + writer.uint32(/* id 369996954, wireType 0 =*/2959975632).int32(message.affinityCookieTtlSec); + if (message.customResponseHeaders != null && message.customResponseHeaders.length) + for (var i = 0; i < message.customResponseHeaders.length; ++i) + writer.uint32(/* id 387539094, wireType 2 =*/3100312754).string(message.customResponseHeaders[i]); + if (message.circuitBreakers != null && Object.hasOwnProperty.call(message, "circuitBreakers")) + $root.google.cloud.compute.v1.CircuitBreakers.encode(message.circuitBreakers, writer.uint32(/* id 421340061, wireType 2 =*/3370720490).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.healthChecks != null && message.healthChecks.length) + for (var i = 0; i < message.healthChecks.length; ++i) + writer.uint32(/* id 448370606, wireType 2 =*/3586964850).string(message.healthChecks[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.connectionDraining != null && Object.hasOwnProperty.call(message, "connectionDraining")) + $root.google.cloud.compute.v1.ConnectionDraining.encode(message.connectionDraining, writer.uint32(/* id 461096747, wireType 2 =*/3688773978).fork()).ldelim(); + if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) + writer.uint32(/* id 463888561, wireType 0 =*/3711108488).int32(message.sessionAffinity); + if (message.securitySettings != null && Object.hasOwnProperty.call(message, "securitySettings")) + $root.google.cloud.compute.v1.SecuritySettings.encode(message.securitySettings, writer.uint32(/* id 478649922, wireType 2 =*/3829199378).fork()).ldelim(); + if (message.backends != null && message.backends.length) + for (var i = 0; i < message.backends.length; ++i) + $root.google.cloud.compute.v1.Backend.encode(message.backends[i], writer.uint32(/* id 510839903, wireType 2 =*/4086719226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackendService message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {google.cloud.compute.v1.IBackendService} message BackendService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendService} BackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendService.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 369996954: + message.affinityCookieTtlSec = reader.int32(); + break; + case 510839903: + if (!(message.backends && message.backends.length)) + message.backends = []; + message.backends.push($root.google.cloud.compute.v1.Backend.decode(reader, reader.uint32())); + break; + case 213976452: + message.cdnPolicy = $root.google.cloud.compute.v1.BackendServiceCdnPolicy.decode(reader, reader.uint32()); + break; + case 421340061: + message.circuitBreakers = $root.google.cloud.compute.v1.CircuitBreakers.decode(reader, reader.uint32()); + break; + case 461096747: + message.connectionDraining = $root.google.cloud.compute.v1.ConnectionDraining.decode(reader, reader.uint32()); + break; + case 905883: + message.consistentHash = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.decode(reader, reader.uint32()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 27977992: + if (!(message.customRequestHeaders && message.customRequestHeaders.length)) + message.customRequestHeaders = []; + message.customRequestHeaders.push(reader.string()); + break; + case 387539094: + if (!(message.customResponseHeaders && message.customResponseHeaders.length)) + message.customResponseHeaders = []; + message.customResponseHeaders.push(reader.string()); + break; + case 422937596: + message.description = reader.string(); + break; + case 250733499: + message.enableCDN = reader.bool(); + break; + case 105658655: + message.failoverPolicy = $root.google.cloud.compute.v1.BackendServiceFailoverPolicy.decode(reader, reader.uint32()); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 448370606: + if (!(message.healthChecks && message.healthChecks.length)) + message.healthChecks = []; + message.healthChecks.push(reader.string()); + break; + case 104024: + message.iap = $root.google.cloud.compute.v1.BackendServiceIAP.decode(reader, reader.uint32()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 363890244: + message.loadBalancingScheme = reader.int32(); + break; + case 131431487: + message.localityLbPolicy = reader.int32(); + break; + case 351299741: + message.logConfig = $root.google.cloud.compute.v1.BackendServiceLogConfig.decode(reader, reader.uint32()); + break; + case 61428376: + message.maxStreamDuration = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 354625086: + message.outlierDetection = $root.google.cloud.compute.v1.OutlierDetection.decode(reader, reader.uint32()); + break; + case 3446913: + message.port = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + case 84577944: + message.protocol = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + case 478649922: + message.securitySettings = $root.google.cloud.compute.v1.SecuritySettings.decode(reader, reader.uint32()); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 463888561: + message.sessionAffinity = reader.int32(); + break; + case 79994995: + message.timeoutSec = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendService} BackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendService message. + * @function verify + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.affinityCookieTtlSec != null && message.hasOwnProperty("affinityCookieTtlSec")) { + properties._affinityCookieTtlSec = 1; + if (!$util.isInteger(message.affinityCookieTtlSec)) + return "affinityCookieTtlSec: integer expected"; + } + if (message.backends != null && message.hasOwnProperty("backends")) { + if (!Array.isArray(message.backends)) + return "backends: array expected"; + for (var i = 0; i < message.backends.length; ++i) { + var error = $root.google.cloud.compute.v1.Backend.verify(message.backends[i]); + if (error) + return "backends." + error; + } + } + if (message.cdnPolicy != null && message.hasOwnProperty("cdnPolicy")) { + properties._cdnPolicy = 1; + { + var error = $root.google.cloud.compute.v1.BackendServiceCdnPolicy.verify(message.cdnPolicy); + if (error) + return "cdnPolicy." + error; + } + } + if (message.circuitBreakers != null && message.hasOwnProperty("circuitBreakers")) { + properties._circuitBreakers = 1; + { + var error = $root.google.cloud.compute.v1.CircuitBreakers.verify(message.circuitBreakers); + if (error) + return "circuitBreakers." + error; + } + } + if (message.connectionDraining != null && message.hasOwnProperty("connectionDraining")) { + properties._connectionDraining = 1; + { + var error = $root.google.cloud.compute.v1.ConnectionDraining.verify(message.connectionDraining); + if (error) + return "connectionDraining." + error; + } + } + if (message.consistentHash != null && message.hasOwnProperty("consistentHash")) { + properties._consistentHash = 1; + { + var error = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.verify(message.consistentHash); + if (error) + return "consistentHash." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.customRequestHeaders != null && message.hasOwnProperty("customRequestHeaders")) { + if (!Array.isArray(message.customRequestHeaders)) + return "customRequestHeaders: array expected"; + for (var i = 0; i < message.customRequestHeaders.length; ++i) + if (!$util.isString(message.customRequestHeaders[i])) + return "customRequestHeaders: string[] expected"; + } + if (message.customResponseHeaders != null && message.hasOwnProperty("customResponseHeaders")) { + if (!Array.isArray(message.customResponseHeaders)) + return "customResponseHeaders: array expected"; + for (var i = 0; i < message.customResponseHeaders.length; ++i) + if (!$util.isString(message.customResponseHeaders[i])) + return "customResponseHeaders: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.enableCDN != null && message.hasOwnProperty("enableCDN")) { + properties._enableCDN = 1; + if (typeof message.enableCDN !== "boolean") + return "enableCDN: boolean expected"; + } + if (message.failoverPolicy != null && message.hasOwnProperty("failoverPolicy")) { + properties._failoverPolicy = 1; + { + var error = $root.google.cloud.compute.v1.BackendServiceFailoverPolicy.verify(message.failoverPolicy); + if (error) + return "failoverPolicy." + error; + } + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.healthChecks != null && message.hasOwnProperty("healthChecks")) { + if (!Array.isArray(message.healthChecks)) + return "healthChecks: array expected"; + for (var i = 0; i < message.healthChecks.length; ++i) + if (!$util.isString(message.healthChecks[i])) + return "healthChecks: string[] expected"; + } + if (message.iap != null && message.hasOwnProperty("iap")) { + properties._iap = 1; + { + var error = $root.google.cloud.compute.v1.BackendServiceIAP.verify(message.iap); + if (error) + return "iap." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.loadBalancingScheme != null && message.hasOwnProperty("loadBalancingScheme")) { + properties._loadBalancingScheme = 1; + switch (message.loadBalancingScheme) { + default: + return "loadBalancingScheme: enum value expected"; + case 0: + case 35607499: + case 279295677: + case 37350397: + case 236211150: + case 275352060: + break; + } + } + if (message.localityLbPolicy != null && message.hasOwnProperty("localityLbPolicy")) { + properties._localityLbPolicy = 1; + switch (message.localityLbPolicy) { + default: + return "localityLbPolicy: enum value expected"; + case 0: + case 323318707: + case 46604921: + case 119180266: + case 166297216: + case 262527171: + case 432795069: + case 153895801: + break; + } + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + properties._logConfig = 1; + { + var error = $root.google.cloud.compute.v1.BackendServiceLogConfig.verify(message.logConfig); + if (error) + return "logConfig." + error; + } + } + if (message.maxStreamDuration != null && message.hasOwnProperty("maxStreamDuration")) { + properties._maxStreamDuration = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.maxStreamDuration); + if (error) + return "maxStreamDuration." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.outlierDetection != null && message.hasOwnProperty("outlierDetection")) { + properties._outlierDetection = 1; + { + var error = $root.google.cloud.compute.v1.OutlierDetection.verify(message.outlierDetection); + if (error) + return "outlierDetection." + error; + } + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) { + properties._protocol = 1; + switch (message.protocol) { + default: + return "protocol: enum value expected"; + case 0: + case 2196510: + case 2228360: + case 69079210: + case 69079243: + case 82412: + case 82881: + case 83873: + break; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { + properties._securityPolicy = 1; + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + properties._securitySettings = 1; + { + var error = $root.google.cloud.compute.v1.SecuritySettings.verify(message.securitySettings); + if (error) + return "securitySettings." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) { + properties._sessionAffinity = 1; + switch (message.sessionAffinity) { + default: + return "sessionAffinity: enum value expected"; + case 0: + case 345665051: + case 106122516: + case 221722926: + case 25322148: + case 370321204: + case 200737960: + case 494981627: + case 2402104: + break; + } + } + if (message.timeoutSec != null && message.hasOwnProperty("timeoutSec")) { + properties._timeoutSec = 1; + if (!$util.isInteger(message.timeoutSec)) + return "timeoutSec: integer expected"; + } + return null; + }; + + /** + * Creates a BackendService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendService} BackendService + */ + BackendService.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendService) + return object; + var message = new $root.google.cloud.compute.v1.BackendService(); + if (object.affinityCookieTtlSec != null) + message.affinityCookieTtlSec = object.affinityCookieTtlSec | 0; + if (object.backends) { + if (!Array.isArray(object.backends)) + throw TypeError(".google.cloud.compute.v1.BackendService.backends: array expected"); + message.backends = []; + for (var i = 0; i < object.backends.length; ++i) { + if (typeof object.backends[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.backends: object expected"); + message.backends[i] = $root.google.cloud.compute.v1.Backend.fromObject(object.backends[i]); + } + } + if (object.cdnPolicy != null) { + if (typeof object.cdnPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.cdnPolicy: object expected"); + message.cdnPolicy = $root.google.cloud.compute.v1.BackendServiceCdnPolicy.fromObject(object.cdnPolicy); + } + if (object.circuitBreakers != null) { + if (typeof object.circuitBreakers !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.circuitBreakers: object expected"); + message.circuitBreakers = $root.google.cloud.compute.v1.CircuitBreakers.fromObject(object.circuitBreakers); + } + if (object.connectionDraining != null) { + if (typeof object.connectionDraining !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.connectionDraining: object expected"); + message.connectionDraining = $root.google.cloud.compute.v1.ConnectionDraining.fromObject(object.connectionDraining); + } + if (object.consistentHash != null) { + if (typeof object.consistentHash !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.consistentHash: object expected"); + message.consistentHash = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.fromObject(object.consistentHash); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.customRequestHeaders) { + if (!Array.isArray(object.customRequestHeaders)) + throw TypeError(".google.cloud.compute.v1.BackendService.customRequestHeaders: array expected"); + message.customRequestHeaders = []; + for (var i = 0; i < object.customRequestHeaders.length; ++i) + message.customRequestHeaders[i] = String(object.customRequestHeaders[i]); + } + if (object.customResponseHeaders) { + if (!Array.isArray(object.customResponseHeaders)) + throw TypeError(".google.cloud.compute.v1.BackendService.customResponseHeaders: array expected"); + message.customResponseHeaders = []; + for (var i = 0; i < object.customResponseHeaders.length; ++i) + message.customResponseHeaders[i] = String(object.customResponseHeaders[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.enableCDN != null) + message.enableCDN = Boolean(object.enableCDN); + if (object.failoverPolicy != null) { + if (typeof object.failoverPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.failoverPolicy: object expected"); + message.failoverPolicy = $root.google.cloud.compute.v1.BackendServiceFailoverPolicy.fromObject(object.failoverPolicy); + } + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.healthChecks) { + if (!Array.isArray(object.healthChecks)) + throw TypeError(".google.cloud.compute.v1.BackendService.healthChecks: array expected"); + message.healthChecks = []; + for (var i = 0; i < object.healthChecks.length; ++i) + message.healthChecks[i] = String(object.healthChecks[i]); + } + if (object.iap != null) { + if (typeof object.iap !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.iap: object expected"); + message.iap = $root.google.cloud.compute.v1.BackendServiceIAP.fromObject(object.iap); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + switch (object.loadBalancingScheme) { + case "UNDEFINED_LOAD_BALANCING_SCHEME": + case 0: + message.loadBalancingScheme = 0; + break; + case "EXTERNAL": + case 35607499: + message.loadBalancingScheme = 35607499; + break; + case "INTERNAL": + case 279295677: + message.loadBalancingScheme = 279295677; + break; + case "INTERNAL_MANAGED": + case 37350397: + message.loadBalancingScheme = 37350397; + break; + case "INTERNAL_SELF_MANAGED": + case 236211150: + message.loadBalancingScheme = 236211150; + break; + case "INVALID_LOAD_BALANCING_SCHEME": + case 275352060: + message.loadBalancingScheme = 275352060; + break; + } + switch (object.localityLbPolicy) { + case "UNDEFINED_LOCALITY_LB_POLICY": + case 0: + message.localityLbPolicy = 0; + break; + case "INVALID_LB_POLICY": + case 323318707: + message.localityLbPolicy = 323318707; + break; + case "LEAST_REQUEST": + case 46604921: + message.localityLbPolicy = 46604921; + break; + case "MAGLEV": + case 119180266: + message.localityLbPolicy = 119180266; + break; + case "ORIGINAL_DESTINATION": + case 166297216: + message.localityLbPolicy = 166297216; + break; + case "RANDOM": + case 262527171: + message.localityLbPolicy = 262527171; + break; + case "RING_HASH": + case 432795069: + message.localityLbPolicy = 432795069; + break; + case "ROUND_ROBIN": + case 153895801: + message.localityLbPolicy = 153895801; + break; + } + if (object.logConfig != null) { + if (typeof object.logConfig !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.logConfig: object expected"); + message.logConfig = $root.google.cloud.compute.v1.BackendServiceLogConfig.fromObject(object.logConfig); + } + if (object.maxStreamDuration != null) { + if (typeof object.maxStreamDuration !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.maxStreamDuration: object expected"); + message.maxStreamDuration = $root.google.cloud.compute.v1.Duration.fromObject(object.maxStreamDuration); + } + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.outlierDetection != null) { + if (typeof object.outlierDetection !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.outlierDetection: object expected"); + message.outlierDetection = $root.google.cloud.compute.v1.OutlierDetection.fromObject(object.outlierDetection); + } + if (object.port != null) + message.port = object.port | 0; + if (object.portName != null) + message.portName = String(object.portName); + switch (object.protocol) { + case "UNDEFINED_PROTOCOL": + case 0: + message.protocol = 0; + break; + case "GRPC": + case 2196510: + message.protocol = 2196510; + break; + case "HTTP": + case 2228360: + message.protocol = 2228360; + break; + case "HTTP2": + case 69079210: + message.protocol = 69079210; + break; + case "HTTPS": + case 69079243: + message.protocol = 69079243; + break; + case "SSL": + case 82412: + message.protocol = 82412; + break; + case "TCP": + case 82881: + message.protocol = 82881; + break; + case "UDP": + case 83873: + message.protocol = 83873; + break; + } + if (object.region != null) + message.region = String(object.region); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + if (object.securitySettings != null) { + if (typeof object.securitySettings !== "object") + throw TypeError(".google.cloud.compute.v1.BackendService.securitySettings: object expected"); + message.securitySettings = $root.google.cloud.compute.v1.SecuritySettings.fromObject(object.securitySettings); + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.sessionAffinity) { + case "UNDEFINED_SESSION_AFFINITY": + case 0: + message.sessionAffinity = 0; + break; + case "CLIENT_IP": + case 345665051: + message.sessionAffinity = 345665051; + break; + case "CLIENT_IP_NO_DESTINATION": + case 106122516: + message.sessionAffinity = 106122516; + break; + case "CLIENT_IP_PORT_PROTO": + case 221722926: + message.sessionAffinity = 221722926; + break; + case "CLIENT_IP_PROTO": + case 25322148: + message.sessionAffinity = 25322148; + break; + case "GENERATED_COOKIE": + case 370321204: + message.sessionAffinity = 370321204; + break; + case "HEADER_FIELD": + case 200737960: + message.sessionAffinity = 200737960; + break; + case "HTTP_COOKIE": + case 494981627: + message.sessionAffinity = 494981627; + break; + case "NONE": + case 2402104: + message.sessionAffinity = 2402104; + break; + } + if (object.timeoutSec != null) + message.timeoutSec = object.timeoutSec | 0; + return message; + }; + + /** + * Creates a plain object from a BackendService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendService + * @static + * @param {google.cloud.compute.v1.BackendService} message BackendService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.customRequestHeaders = []; + object.customResponseHeaders = []; + object.healthChecks = []; + object.backends = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.iap != null && message.hasOwnProperty("iap")) { + object.iap = $root.google.cloud.compute.v1.BackendServiceIAP.toObject(message.iap, options); + if (options.oneofs) + object._iap = "iap"; + } + if (message.consistentHash != null && message.hasOwnProperty("consistentHash")) { + object.consistentHash = $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettings.toObject(message.consistentHash, options); + if (options.oneofs) + object._consistentHash = "consistentHash"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.customRequestHeaders && message.customRequestHeaders.length) { + object.customRequestHeaders = []; + for (var j = 0; j < message.customRequestHeaders.length; ++j) + object.customRequestHeaders[j] = message.customRequestHeaders[j]; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.maxStreamDuration != null && message.hasOwnProperty("maxStreamDuration")) { + object.maxStreamDuration = $root.google.cloud.compute.v1.Duration.toObject(message.maxStreamDuration, options); + if (options.oneofs) + object._maxStreamDuration = "maxStreamDuration"; + } + if (message.timeoutSec != null && message.hasOwnProperty("timeoutSec")) { + object.timeoutSec = message.timeoutSec; + if (options.oneofs) + object._timeoutSec = "timeoutSec"; + } + if (message.protocol != null && message.hasOwnProperty("protocol")) { + object.protocol = options.enums === String ? $root.google.cloud.compute.v1.BackendService.Protocol[message.protocol] : message.protocol; + if (options.oneofs) + object._protocol = "protocol"; + } + if (message.failoverPolicy != null && message.hasOwnProperty("failoverPolicy")) { + object.failoverPolicy = $root.google.cloud.compute.v1.BackendServiceFailoverPolicy.toObject(message.failoverPolicy, options); + if (options.oneofs) + object._failoverPolicy = "failoverPolicy"; + } + if (message.localityLbPolicy != null && message.hasOwnProperty("localityLbPolicy")) { + object.localityLbPolicy = options.enums === String ? $root.google.cloud.compute.v1.BackendService.LocalityLbPolicy[message.localityLbPolicy] : message.localityLbPolicy; + if (options.oneofs) + object._localityLbPolicy = "localityLbPolicy"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { + object.securityPolicy = message.securityPolicy; + if (options.oneofs) + object._securityPolicy = "securityPolicy"; + } + if (message.cdnPolicy != null && message.hasOwnProperty("cdnPolicy")) { + object.cdnPolicy = $root.google.cloud.compute.v1.BackendServiceCdnPolicy.toObject(message.cdnPolicy, options); + if (options.oneofs) + object._cdnPolicy = "cdnPolicy"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.enableCDN != null && message.hasOwnProperty("enableCDN")) { + object.enableCDN = message.enableCDN; + if (options.oneofs) + object._enableCDN = "enableCDN"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + object.logConfig = $root.google.cloud.compute.v1.BackendServiceLogConfig.toObject(message.logConfig, options); + if (options.oneofs) + object._logConfig = "logConfig"; + } + if (message.outlierDetection != null && message.hasOwnProperty("outlierDetection")) { + object.outlierDetection = $root.google.cloud.compute.v1.OutlierDetection.toObject(message.outlierDetection, options); + if (options.oneofs) + object._outlierDetection = "outlierDetection"; + } + if (message.loadBalancingScheme != null && message.hasOwnProperty("loadBalancingScheme")) { + object.loadBalancingScheme = options.enums === String ? $root.google.cloud.compute.v1.BackendService.LoadBalancingScheme[message.loadBalancingScheme] : message.loadBalancingScheme; + if (options.oneofs) + object._loadBalancingScheme = "loadBalancingScheme"; + } + if (message.affinityCookieTtlSec != null && message.hasOwnProperty("affinityCookieTtlSec")) { + object.affinityCookieTtlSec = message.affinityCookieTtlSec; + if (options.oneofs) + object._affinityCookieTtlSec = "affinityCookieTtlSec"; + } + if (message.customResponseHeaders && message.customResponseHeaders.length) { + object.customResponseHeaders = []; + for (var j = 0; j < message.customResponseHeaders.length; ++j) + object.customResponseHeaders[j] = message.customResponseHeaders[j]; + } + if (message.circuitBreakers != null && message.hasOwnProperty("circuitBreakers")) { + object.circuitBreakers = $root.google.cloud.compute.v1.CircuitBreakers.toObject(message.circuitBreakers, options); + if (options.oneofs) + object._circuitBreakers = "circuitBreakers"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.healthChecks && message.healthChecks.length) { + object.healthChecks = []; + for (var j = 0; j < message.healthChecks.length; ++j) + object.healthChecks[j] = message.healthChecks[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.connectionDraining != null && message.hasOwnProperty("connectionDraining")) { + object.connectionDraining = $root.google.cloud.compute.v1.ConnectionDraining.toObject(message.connectionDraining, options); + if (options.oneofs) + object._connectionDraining = "connectionDraining"; + } + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) { + object.sessionAffinity = options.enums === String ? $root.google.cloud.compute.v1.BackendService.SessionAffinity[message.sessionAffinity] : message.sessionAffinity; + if (options.oneofs) + object._sessionAffinity = "sessionAffinity"; + } + if (message.securitySettings != null && message.hasOwnProperty("securitySettings")) { + object.securitySettings = $root.google.cloud.compute.v1.SecuritySettings.toObject(message.securitySettings, options); + if (options.oneofs) + object._securitySettings = "securitySettings"; + } + if (message.backends && message.backends.length) { + object.backends = []; + for (var j = 0; j < message.backends.length; ++j) + object.backends[j] = $root.google.cloud.compute.v1.Backend.toObject(message.backends[j], options); + } + return object; + }; + + /** + * Converts this BackendService to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendService + * @instance + * @returns {Object.} JSON object + */ + BackendService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * LoadBalancingScheme enum. + * @name google.cloud.compute.v1.BackendService.LoadBalancingScheme + * @enum {number} + * @property {number} UNDEFINED_LOAD_BALANCING_SCHEME=0 UNDEFINED_LOAD_BALANCING_SCHEME value + * @property {number} EXTERNAL=35607499 EXTERNAL value + * @property {number} INTERNAL=279295677 INTERNAL value + * @property {number} INTERNAL_MANAGED=37350397 INTERNAL_MANAGED value + * @property {number} INTERNAL_SELF_MANAGED=236211150 INTERNAL_SELF_MANAGED value + * @property {number} INVALID_LOAD_BALANCING_SCHEME=275352060 INVALID_LOAD_BALANCING_SCHEME value + */ + BackendService.LoadBalancingScheme = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LOAD_BALANCING_SCHEME"] = 0; + values[valuesById[35607499] = "EXTERNAL"] = 35607499; + values[valuesById[279295677] = "INTERNAL"] = 279295677; + values[valuesById[37350397] = "INTERNAL_MANAGED"] = 37350397; + values[valuesById[236211150] = "INTERNAL_SELF_MANAGED"] = 236211150; + values[valuesById[275352060] = "INVALID_LOAD_BALANCING_SCHEME"] = 275352060; + return values; + })(); + + /** + * LocalityLbPolicy enum. + * @name google.cloud.compute.v1.BackendService.LocalityLbPolicy + * @enum {number} + * @property {number} UNDEFINED_LOCALITY_LB_POLICY=0 UNDEFINED_LOCALITY_LB_POLICY value + * @property {number} INVALID_LB_POLICY=323318707 INVALID_LB_POLICY value + * @property {number} LEAST_REQUEST=46604921 LEAST_REQUEST value + * @property {number} MAGLEV=119180266 MAGLEV value + * @property {number} ORIGINAL_DESTINATION=166297216 ORIGINAL_DESTINATION value + * @property {number} RANDOM=262527171 RANDOM value + * @property {number} RING_HASH=432795069 RING_HASH value + * @property {number} ROUND_ROBIN=153895801 ROUND_ROBIN value + */ + BackendService.LocalityLbPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LOCALITY_LB_POLICY"] = 0; + values[valuesById[323318707] = "INVALID_LB_POLICY"] = 323318707; + values[valuesById[46604921] = "LEAST_REQUEST"] = 46604921; + values[valuesById[119180266] = "MAGLEV"] = 119180266; + values[valuesById[166297216] = "ORIGINAL_DESTINATION"] = 166297216; + values[valuesById[262527171] = "RANDOM"] = 262527171; + values[valuesById[432795069] = "RING_HASH"] = 432795069; + values[valuesById[153895801] = "ROUND_ROBIN"] = 153895801; + return values; + })(); + + /** + * Protocol enum. + * @name google.cloud.compute.v1.BackendService.Protocol + * @enum {number} + * @property {number} UNDEFINED_PROTOCOL=0 UNDEFINED_PROTOCOL value + * @property {number} GRPC=2196510 GRPC value + * @property {number} HTTP=2228360 HTTP value + * @property {number} HTTP2=69079210 HTTP2 value + * @property {number} HTTPS=69079243 HTTPS value + * @property {number} SSL=82412 SSL value + * @property {number} TCP=82881 TCP value + * @property {number} UDP=83873 UDP value + */ + BackendService.Protocol = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROTOCOL"] = 0; + values[valuesById[2196510] = "GRPC"] = 2196510; + values[valuesById[2228360] = "HTTP"] = 2228360; + values[valuesById[69079210] = "HTTP2"] = 69079210; + values[valuesById[69079243] = "HTTPS"] = 69079243; + values[valuesById[82412] = "SSL"] = 82412; + values[valuesById[82881] = "TCP"] = 82881; + values[valuesById[83873] = "UDP"] = 83873; + return values; + })(); + + /** + * SessionAffinity enum. + * @name google.cloud.compute.v1.BackendService.SessionAffinity + * @enum {number} + * @property {number} UNDEFINED_SESSION_AFFINITY=0 UNDEFINED_SESSION_AFFINITY value + * @property {number} CLIENT_IP=345665051 CLIENT_IP value + * @property {number} CLIENT_IP_NO_DESTINATION=106122516 CLIENT_IP_NO_DESTINATION value + * @property {number} CLIENT_IP_PORT_PROTO=221722926 CLIENT_IP_PORT_PROTO value + * @property {number} CLIENT_IP_PROTO=25322148 CLIENT_IP_PROTO value + * @property {number} GENERATED_COOKIE=370321204 GENERATED_COOKIE value + * @property {number} HEADER_FIELD=200737960 HEADER_FIELD value + * @property {number} HTTP_COOKIE=494981627 HTTP_COOKIE value + * @property {number} NONE=2402104 NONE value + */ + BackendService.SessionAffinity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_SESSION_AFFINITY"] = 0; + values[valuesById[345665051] = "CLIENT_IP"] = 345665051; + values[valuesById[106122516] = "CLIENT_IP_NO_DESTINATION"] = 106122516; + values[valuesById[221722926] = "CLIENT_IP_PORT_PROTO"] = 221722926; + values[valuesById[25322148] = "CLIENT_IP_PROTO"] = 25322148; + values[valuesById[370321204] = "GENERATED_COOKIE"] = 370321204; + values[valuesById[200737960] = "HEADER_FIELD"] = 200737960; + values[valuesById[494981627] = "HTTP_COOKIE"] = 494981627; + values[valuesById[2402104] = "NONE"] = 2402104; + return values; + })(); + + return BackendService; + })(); + + v1.BackendServicesScopedList = (function() { + + /** + * Properties of a BackendServicesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IBackendServicesScopedList + * @property {Array.|null} [backendServices] BackendServicesScopedList backendServices + * @property {google.cloud.compute.v1.IWarning|null} [warning] BackendServicesScopedList warning + */ + + /** + * Constructs a new BackendServicesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServicesScopedList. + * @implements IBackendServicesScopedList + * @constructor + * @param {google.cloud.compute.v1.IBackendServicesScopedList=} [properties] Properties to set + */ + function BackendServicesScopedList(properties) { + this.backendServices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServicesScopedList backendServices. + * @member {Array.} backendServices + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @instance + */ + BackendServicesScopedList.prototype.backendServices = $util.emptyArray; + + /** + * BackendServicesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @instance + */ + BackendServicesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServicesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @instance + */ + Object.defineProperty(BackendServicesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServicesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {google.cloud.compute.v1.IBackendServicesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServicesScopedList} BackendServicesScopedList instance + */ + BackendServicesScopedList.create = function create(properties) { + return new BackendServicesScopedList(properties); + }; + + /** + * Encodes the specified BackendServicesScopedList message. Does not implicitly {@link google.cloud.compute.v1.BackendServicesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {google.cloud.compute.v1.IBackendServicesScopedList} message BackendServicesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServicesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.backendServices != null && message.backendServices.length) + for (var i = 0; i < message.backendServices.length; ++i) + $root.google.cloud.compute.v1.BackendService.encode(message.backendServices[i], writer.uint32(/* id 388522409, wireType 2 =*/3108179274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackendServicesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServicesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {google.cloud.compute.v1.IBackendServicesScopedList} message BackendServicesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServicesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServicesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServicesScopedList} BackendServicesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServicesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServicesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 388522409: + if (!(message.backendServices && message.backendServices.length)) + message.backendServices = []; + message.backendServices.push($root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServicesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServicesScopedList} BackendServicesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServicesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServicesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServicesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendServices != null && message.hasOwnProperty("backendServices")) { + if (!Array.isArray(message.backendServices)) + return "backendServices: array expected"; + for (var i = 0; i < message.backendServices.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.backendServices[i]); + if (error) + return "backendServices." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a BackendServicesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServicesScopedList} BackendServicesScopedList + */ + BackendServicesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServicesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.BackendServicesScopedList(); + if (object.backendServices) { + if (!Array.isArray(object.backendServices)) + throw TypeError(".google.cloud.compute.v1.BackendServicesScopedList.backendServices: array expected"); + message.backendServices = []; + for (var i = 0; i < object.backendServices.length; ++i) { + if (typeof object.backendServices[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServicesScopedList.backendServices: object expected"); + message.backendServices[i] = $root.google.cloud.compute.v1.BackendService.fromObject(object.backendServices[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServicesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a BackendServicesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @static + * @param {google.cloud.compute.v1.BackendServicesScopedList} message BackendServicesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServicesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backendServices = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.backendServices && message.backendServices.length) { + object.backendServices = []; + for (var j = 0; j < message.backendServices.length; ++j) + object.backendServices[j] = $root.google.cloud.compute.v1.BackendService.toObject(message.backendServices[j], options); + } + return object; + }; + + /** + * Converts this BackendServicesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServicesScopedList + * @instance + * @returns {Object.} JSON object + */ + BackendServicesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServicesScopedList; + })(); + + v1.BackendServiceAggregatedList = (function() { + + /** + * Properties of a BackendServiceAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceAggregatedList + * @property {string|null} [id] BackendServiceAggregatedList id + * @property {Object.|null} [items] BackendServiceAggregatedList items + * @property {string|null} [kind] BackendServiceAggregatedList kind + * @property {string|null} [nextPageToken] BackendServiceAggregatedList nextPageToken + * @property {string|null} [selfLink] BackendServiceAggregatedList selfLink + * @property {Array.|null} [unreachables] BackendServiceAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] BackendServiceAggregatedList warning + */ + + /** + * Constructs a new BackendServiceAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceAggregatedList. + * @implements IBackendServiceAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceAggregatedList=} [properties] Properties to set + */ + function BackendServiceAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + BackendServiceAggregatedList.prototype.id = null; + + /** + * BackendServiceAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + BackendServiceAggregatedList.prototype.items = $util.emptyObject; + + /** + * BackendServiceAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + BackendServiceAggregatedList.prototype.kind = null; + + /** + * BackendServiceAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + BackendServiceAggregatedList.prototype.nextPageToken = null; + + /** + * BackendServiceAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + BackendServiceAggregatedList.prototype.selfLink = null; + + /** + * BackendServiceAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + BackendServiceAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * BackendServiceAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + BackendServiceAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + Object.defineProperty(BackendServiceAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + Object.defineProperty(BackendServiceAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + Object.defineProperty(BackendServiceAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + Object.defineProperty(BackendServiceAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + */ + Object.defineProperty(BackendServiceAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {google.cloud.compute.v1.IBackendServiceAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceAggregatedList} BackendServiceAggregatedList instance + */ + BackendServiceAggregatedList.create = function create(properties) { + return new BackendServiceAggregatedList(properties); + }; + + /** + * Encodes the specified BackendServiceAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {google.cloud.compute.v1.IBackendServiceAggregatedList} message BackendServiceAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.BackendServicesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified BackendServiceAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {google.cloud.compute.v1.IBackendServiceAggregatedList} message BackendServiceAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceAggregatedList} BackendServiceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.BackendServicesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceAggregatedList} BackendServiceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendServicesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a BackendServiceAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceAggregatedList} BackendServiceAggregatedList + */ + BackendServiceAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.BackendServicesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.BackendServiceAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a BackendServiceAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @static + * @param {google.cloud.compute.v1.BackendServiceAggregatedList} message BackendServiceAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.BackendServicesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this BackendServiceAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceAggregatedList + * @instance + * @returns {Object.} JSON object + */ + BackendServiceAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceAggregatedList; + })(); + + v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader = (function() { + + /** + * Properties of a BackendServiceCdnPolicyBypassCacheOnRequestHeader. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceCdnPolicyBypassCacheOnRequestHeader + * @property {string|null} [headerName] BackendServiceCdnPolicyBypassCacheOnRequestHeader headerName + */ + + /** + * Constructs a new BackendServiceCdnPolicyBypassCacheOnRequestHeader. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceCdnPolicyBypassCacheOnRequestHeader. + * @implements IBackendServiceCdnPolicyBypassCacheOnRequestHeader + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader=} [properties] Properties to set + */ + function BackendServiceCdnPolicyBypassCacheOnRequestHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceCdnPolicyBypassCacheOnRequestHeader headerName. + * @member {string|null|undefined} headerName + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @instance + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.prototype.headerName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceCdnPolicyBypassCacheOnRequestHeader _headerName. + * @member {"headerName"|undefined} _headerName + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicyBypassCacheOnRequestHeader.prototype, "_headerName", { + get: $util.oneOfGetter($oneOfFields = ["headerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceCdnPolicyBypassCacheOnRequestHeader instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader} BackendServiceCdnPolicyBypassCacheOnRequestHeader instance + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.create = function create(properties) { + return new BackendServiceCdnPolicyBypassCacheOnRequestHeader(properties); + }; + + /** + * Encodes the specified BackendServiceCdnPolicyBypassCacheOnRequestHeader message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader} message BackendServiceCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headerName != null && Object.hasOwnProperty.call(message, "headerName")) + writer.uint32(/* id 110223613, wireType 2 =*/881788906).string(message.headerName); + return writer; + }; + + /** + * Encodes the specified BackendServiceCdnPolicyBypassCacheOnRequestHeader message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyBypassCacheOnRequestHeader} message BackendServiceCdnPolicyBypassCacheOnRequestHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader} BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 110223613: + message.headerName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceCdnPolicyBypassCacheOnRequestHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader} BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceCdnPolicyBypassCacheOnRequestHeader message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.headerName != null && message.hasOwnProperty("headerName")) { + properties._headerName = 1; + if (!$util.isString(message.headerName)) + return "headerName: string expected"; + } + return null; + }; + + /** + * Creates a BackendServiceCdnPolicyBypassCacheOnRequestHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader} BackendServiceCdnPolicyBypassCacheOnRequestHeader + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader(); + if (object.headerName != null) + message.headerName = String(object.headerName); + return message; + }; + + /** + * Creates a plain object from a BackendServiceCdnPolicyBypassCacheOnRequestHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @static + * @param {google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader} message BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.headerName != null && message.hasOwnProperty("headerName")) { + object.headerName = message.headerName; + if (options.oneofs) + object._headerName = "headerName"; + } + return object; + }; + + /** + * Converts this BackendServiceCdnPolicyBypassCacheOnRequestHeader to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyBypassCacheOnRequestHeader + * @instance + * @returns {Object.} JSON object + */ + BackendServiceCdnPolicyBypassCacheOnRequestHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceCdnPolicyBypassCacheOnRequestHeader; + })(); + + v1.CacheKeyPolicy = (function() { + + /** + * Properties of a CacheKeyPolicy. + * @memberof google.cloud.compute.v1 + * @interface ICacheKeyPolicy + * @property {boolean|null} [includeHost] CacheKeyPolicy includeHost + * @property {boolean|null} [includeProtocol] CacheKeyPolicy includeProtocol + * @property {boolean|null} [includeQueryString] CacheKeyPolicy includeQueryString + * @property {Array.|null} [queryStringBlacklist] CacheKeyPolicy queryStringBlacklist + * @property {Array.|null} [queryStringWhitelist] CacheKeyPolicy queryStringWhitelist + */ + + /** + * Constructs a new CacheKeyPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CacheKeyPolicy. + * @implements ICacheKeyPolicy + * @constructor + * @param {google.cloud.compute.v1.ICacheKeyPolicy=} [properties] Properties to set + */ + function CacheKeyPolicy(properties) { + this.queryStringBlacklist = []; + this.queryStringWhitelist = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CacheKeyPolicy includeHost. + * @member {boolean|null|undefined} includeHost + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + CacheKeyPolicy.prototype.includeHost = null; + + /** + * CacheKeyPolicy includeProtocol. + * @member {boolean|null|undefined} includeProtocol + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + CacheKeyPolicy.prototype.includeProtocol = null; + + /** + * CacheKeyPolicy includeQueryString. + * @member {boolean|null|undefined} includeQueryString + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + CacheKeyPolicy.prototype.includeQueryString = null; + + /** + * CacheKeyPolicy queryStringBlacklist. + * @member {Array.} queryStringBlacklist + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + CacheKeyPolicy.prototype.queryStringBlacklist = $util.emptyArray; + + /** + * CacheKeyPolicy queryStringWhitelist. + * @member {Array.} queryStringWhitelist + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + CacheKeyPolicy.prototype.queryStringWhitelist = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CacheKeyPolicy _includeHost. + * @member {"includeHost"|undefined} _includeHost + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + Object.defineProperty(CacheKeyPolicy.prototype, "_includeHost", { + get: $util.oneOfGetter($oneOfFields = ["includeHost"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CacheKeyPolicy _includeProtocol. + * @member {"includeProtocol"|undefined} _includeProtocol + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + Object.defineProperty(CacheKeyPolicy.prototype, "_includeProtocol", { + get: $util.oneOfGetter($oneOfFields = ["includeProtocol"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CacheKeyPolicy _includeQueryString. + * @member {"includeQueryString"|undefined} _includeQueryString + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + */ + Object.defineProperty(CacheKeyPolicy.prototype, "_includeQueryString", { + get: $util.oneOfGetter($oneOfFields = ["includeQueryString"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CacheKeyPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {google.cloud.compute.v1.ICacheKeyPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CacheKeyPolicy} CacheKeyPolicy instance + */ + CacheKeyPolicy.create = function create(properties) { + return new CacheKeyPolicy(properties); + }; + + /** + * Encodes the specified CacheKeyPolicy message. Does not implicitly {@link google.cloud.compute.v1.CacheKeyPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {google.cloud.compute.v1.ICacheKeyPolicy} message CacheKeyPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheKeyPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryStringWhitelist != null && message.queryStringWhitelist.length) + for (var i = 0; i < message.queryStringWhitelist.length; ++i) + writer.uint32(/* id 52456496, wireType 2 =*/419651970).string(message.queryStringWhitelist[i]); + if (message.includeProtocol != null && Object.hasOwnProperty.call(message, "includeProtocol")) + writer.uint32(/* id 303507535, wireType 0 =*/2428060280).bool(message.includeProtocol); + if (message.queryStringBlacklist != null && message.queryStringBlacklist.length) + for (var i = 0; i < message.queryStringBlacklist.length; ++i) + writer.uint32(/* id 354964742, wireType 2 =*/2839717938).string(message.queryStringBlacklist[i]); + if (message.includeQueryString != null && Object.hasOwnProperty.call(message, "includeQueryString")) + writer.uint32(/* id 474036639, wireType 0 =*/3792293112).bool(message.includeQueryString); + if (message.includeHost != null && Object.hasOwnProperty.call(message, "includeHost")) + writer.uint32(/* id 486867679, wireType 0 =*/3894941432).bool(message.includeHost); + return writer; + }; + + /** + * Encodes the specified CacheKeyPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CacheKeyPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {google.cloud.compute.v1.ICacheKeyPolicy} message CacheKeyPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheKeyPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CacheKeyPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CacheKeyPolicy} CacheKeyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheKeyPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CacheKeyPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 486867679: + message.includeHost = reader.bool(); + break; + case 303507535: + message.includeProtocol = reader.bool(); + break; + case 474036639: + message.includeQueryString = reader.bool(); + break; + case 354964742: + if (!(message.queryStringBlacklist && message.queryStringBlacklist.length)) + message.queryStringBlacklist = []; + message.queryStringBlacklist.push(reader.string()); + break; + case 52456496: + if (!(message.queryStringWhitelist && message.queryStringWhitelist.length)) + message.queryStringWhitelist = []; + message.queryStringWhitelist.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CacheKeyPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CacheKeyPolicy} CacheKeyPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheKeyPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CacheKeyPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CacheKeyPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.includeHost != null && message.hasOwnProperty("includeHost")) { + properties._includeHost = 1; + if (typeof message.includeHost !== "boolean") + return "includeHost: boolean expected"; + } + if (message.includeProtocol != null && message.hasOwnProperty("includeProtocol")) { + properties._includeProtocol = 1; + if (typeof message.includeProtocol !== "boolean") + return "includeProtocol: boolean expected"; + } + if (message.includeQueryString != null && message.hasOwnProperty("includeQueryString")) { + properties._includeQueryString = 1; + if (typeof message.includeQueryString !== "boolean") + return "includeQueryString: boolean expected"; + } + if (message.queryStringBlacklist != null && message.hasOwnProperty("queryStringBlacklist")) { + if (!Array.isArray(message.queryStringBlacklist)) + return "queryStringBlacklist: array expected"; + for (var i = 0; i < message.queryStringBlacklist.length; ++i) + if (!$util.isString(message.queryStringBlacklist[i])) + return "queryStringBlacklist: string[] expected"; + } + if (message.queryStringWhitelist != null && message.hasOwnProperty("queryStringWhitelist")) { + if (!Array.isArray(message.queryStringWhitelist)) + return "queryStringWhitelist: array expected"; + for (var i = 0; i < message.queryStringWhitelist.length; ++i) + if (!$util.isString(message.queryStringWhitelist[i])) + return "queryStringWhitelist: string[] expected"; + } + return null; + }; + + /** + * Creates a CacheKeyPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CacheKeyPolicy} CacheKeyPolicy + */ + CacheKeyPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CacheKeyPolicy) + return object; + var message = new $root.google.cloud.compute.v1.CacheKeyPolicy(); + if (object.includeHost != null) + message.includeHost = Boolean(object.includeHost); + if (object.includeProtocol != null) + message.includeProtocol = Boolean(object.includeProtocol); + if (object.includeQueryString != null) + message.includeQueryString = Boolean(object.includeQueryString); + if (object.queryStringBlacklist) { + if (!Array.isArray(object.queryStringBlacklist)) + throw TypeError(".google.cloud.compute.v1.CacheKeyPolicy.queryStringBlacklist: array expected"); + message.queryStringBlacklist = []; + for (var i = 0; i < object.queryStringBlacklist.length; ++i) + message.queryStringBlacklist[i] = String(object.queryStringBlacklist[i]); + } + if (object.queryStringWhitelist) { + if (!Array.isArray(object.queryStringWhitelist)) + throw TypeError(".google.cloud.compute.v1.CacheKeyPolicy.queryStringWhitelist: array expected"); + message.queryStringWhitelist = []; + for (var i = 0; i < object.queryStringWhitelist.length; ++i) + message.queryStringWhitelist[i] = String(object.queryStringWhitelist[i]); + } + return message; + }; + + /** + * Creates a plain object from a CacheKeyPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @static + * @param {google.cloud.compute.v1.CacheKeyPolicy} message CacheKeyPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CacheKeyPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.queryStringWhitelist = []; + object.queryStringBlacklist = []; + } + if (message.queryStringWhitelist && message.queryStringWhitelist.length) { + object.queryStringWhitelist = []; + for (var j = 0; j < message.queryStringWhitelist.length; ++j) + object.queryStringWhitelist[j] = message.queryStringWhitelist[j]; + } + if (message.includeProtocol != null && message.hasOwnProperty("includeProtocol")) { + object.includeProtocol = message.includeProtocol; + if (options.oneofs) + object._includeProtocol = "includeProtocol"; + } + if (message.queryStringBlacklist && message.queryStringBlacklist.length) { + object.queryStringBlacklist = []; + for (var j = 0; j < message.queryStringBlacklist.length; ++j) + object.queryStringBlacklist[j] = message.queryStringBlacklist[j]; + } + if (message.includeQueryString != null && message.hasOwnProperty("includeQueryString")) { + object.includeQueryString = message.includeQueryString; + if (options.oneofs) + object._includeQueryString = "includeQueryString"; + } + if (message.includeHost != null && message.hasOwnProperty("includeHost")) { + object.includeHost = message.includeHost; + if (options.oneofs) + object._includeHost = "includeHost"; + } + return object; + }; + + /** + * Converts this CacheKeyPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CacheKeyPolicy + * @instance + * @returns {Object.} JSON object + */ + CacheKeyPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CacheKeyPolicy; + })(); + + v1.BackendServiceCdnPolicyNegativeCachingPolicy = (function() { + + /** + * Properties of a BackendServiceCdnPolicyNegativeCachingPolicy. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceCdnPolicyNegativeCachingPolicy + * @property {number|null} [code] BackendServiceCdnPolicyNegativeCachingPolicy code + * @property {number|null} [ttl] BackendServiceCdnPolicyNegativeCachingPolicy ttl + */ + + /** + * Constructs a new BackendServiceCdnPolicyNegativeCachingPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceCdnPolicyNegativeCachingPolicy. + * @implements IBackendServiceCdnPolicyNegativeCachingPolicy + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy=} [properties] Properties to set + */ + function BackendServiceCdnPolicyNegativeCachingPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceCdnPolicyNegativeCachingPolicy code. + * @member {number|null|undefined} code + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @instance + */ + BackendServiceCdnPolicyNegativeCachingPolicy.prototype.code = null; + + /** + * BackendServiceCdnPolicyNegativeCachingPolicy ttl. + * @member {number|null|undefined} ttl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @instance + */ + BackendServiceCdnPolicyNegativeCachingPolicy.prototype.ttl = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceCdnPolicyNegativeCachingPolicy _code. + * @member {"code"|undefined} _code + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicyNegativeCachingPolicy.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceCdnPolicyNegativeCachingPolicy _ttl. + * @member {"ttl"|undefined} _ttl + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @instance + */ + Object.defineProperty(BackendServiceCdnPolicyNegativeCachingPolicy.prototype, "_ttl", { + get: $util.oneOfGetter($oneOfFields = ["ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceCdnPolicyNegativeCachingPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy} BackendServiceCdnPolicyNegativeCachingPolicy instance + */ + BackendServiceCdnPolicyNegativeCachingPolicy.create = function create(properties) { + return new BackendServiceCdnPolicyNegativeCachingPolicy(properties); + }; + + /** + * Encodes the specified BackendServiceCdnPolicyNegativeCachingPolicy message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy} message BackendServiceCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceCdnPolicyNegativeCachingPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + writer.uint32(/* id 115180, wireType 0 =*/921440).int32(message.ttl); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 3059181, wireType 0 =*/24473448).int32(message.code); + return writer; + }; + + /** + * Encodes the specified BackendServiceCdnPolicyNegativeCachingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.IBackendServiceCdnPolicyNegativeCachingPolicy} message BackendServiceCdnPolicyNegativeCachingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceCdnPolicyNegativeCachingPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceCdnPolicyNegativeCachingPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy} BackendServiceCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceCdnPolicyNegativeCachingPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3059181: + message.code = reader.int32(); + break; + case 115180: + message.ttl = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceCdnPolicyNegativeCachingPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy} BackendServiceCdnPolicyNegativeCachingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceCdnPolicyNegativeCachingPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceCdnPolicyNegativeCachingPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceCdnPolicyNegativeCachingPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.code != null && message.hasOwnProperty("code")) { + properties._code = 1; + if (!$util.isInteger(message.code)) + return "code: integer expected"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + properties._ttl = 1; + if (!$util.isInteger(message.ttl)) + return "ttl: integer expected"; + } + return null; + }; + + /** + * Creates a BackendServiceCdnPolicyNegativeCachingPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy} BackendServiceCdnPolicyNegativeCachingPolicy + */ + BackendServiceCdnPolicyNegativeCachingPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy(); + if (object.code != null) + message.code = object.code | 0; + if (object.ttl != null) + message.ttl = object.ttl | 0; + return message; + }; + + /** + * Creates a plain object from a BackendServiceCdnPolicyNegativeCachingPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @static + * @param {google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy} message BackendServiceCdnPolicyNegativeCachingPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceCdnPolicyNegativeCachingPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = message.ttl; + if (options.oneofs) + object._ttl = "ttl"; + } + if (message.code != null && message.hasOwnProperty("code")) { + object.code = message.code; + if (options.oneofs) + object._code = "code"; + } + return object; + }; + + /** + * Converts this BackendServiceCdnPolicyNegativeCachingPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceCdnPolicyNegativeCachingPolicy + * @instance + * @returns {Object.} JSON object + */ + BackendServiceCdnPolicyNegativeCachingPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceCdnPolicyNegativeCachingPolicy; + })(); + + v1.HealthStatus = (function() { + + /** + * Properties of a HealthStatus. + * @memberof google.cloud.compute.v1 + * @interface IHealthStatus + * @property {Object.|null} [annotations] HealthStatus annotations + * @property {string|null} [forwardingRule] HealthStatus forwardingRule + * @property {string|null} [forwardingRuleIp] HealthStatus forwardingRuleIp + * @property {google.cloud.compute.v1.HealthStatus.HealthState|null} [healthState] HealthStatus healthState + * @property {string|null} [instance] HealthStatus instance + * @property {string|null} [ipAddress] HealthStatus ipAddress + * @property {number|null} [port] HealthStatus port + * @property {string|null} [weight] HealthStatus weight + * @property {google.cloud.compute.v1.HealthStatus.WeightError|null} [weightError] HealthStatus weightError + */ + + /** + * Constructs a new HealthStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthStatus. + * @implements IHealthStatus + * @constructor + * @param {google.cloud.compute.v1.IHealthStatus=} [properties] Properties to set + */ + function HealthStatus(properties) { + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthStatus annotations. + * @member {Object.} annotations + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.annotations = $util.emptyObject; + + /** + * HealthStatus forwardingRule. + * @member {string|null|undefined} forwardingRule + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.forwardingRule = null; + + /** + * HealthStatus forwardingRuleIp. + * @member {string|null|undefined} forwardingRuleIp + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.forwardingRuleIp = null; + + /** + * HealthStatus healthState. + * @member {google.cloud.compute.v1.HealthStatus.HealthState|null|undefined} healthState + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.healthState = null; + + /** + * HealthStatus instance. + * @member {string|null|undefined} instance + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.instance = null; + + /** + * HealthStatus ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.ipAddress = null; + + /** + * HealthStatus port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.port = null; + + /** + * HealthStatus weight. + * @member {string|null|undefined} weight + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.weight = null; + + /** + * HealthStatus weightError. + * @member {google.cloud.compute.v1.HealthStatus.WeightError|null|undefined} weightError + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + HealthStatus.prototype.weightError = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthStatus _forwardingRule. + * @member {"forwardingRule"|undefined} _forwardingRule + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_forwardingRule", { + get: $util.oneOfGetter($oneOfFields = ["forwardingRule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatus _forwardingRuleIp. + * @member {"forwardingRuleIp"|undefined} _forwardingRuleIp + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_forwardingRuleIp", { + get: $util.oneOfGetter($oneOfFields = ["forwardingRuleIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatus _healthState. + * @member {"healthState"|undefined} _healthState + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_healthState", { + get: $util.oneOfGetter($oneOfFields = ["healthState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatus _instance. + * @member {"instance"|undefined} _instance + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_instance", { + get: $util.oneOfGetter($oneOfFields = ["instance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatus _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatus _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatus _weight. + * @member {"weight"|undefined} _weight + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_weight", { + get: $util.oneOfGetter($oneOfFields = ["weight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatus _weightError. + * @member {"weightError"|undefined} _weightError + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + */ + Object.defineProperty(HealthStatus.prototype, "_weightError", { + get: $util.oneOfGetter($oneOfFields = ["weightError"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {google.cloud.compute.v1.IHealthStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthStatus} HealthStatus instance + */ + HealthStatus.create = function create(properties) { + return new HealthStatus(properties); + }; + + /** + * Encodes the specified HealthStatus message. Does not implicitly {@link google.cloud.compute.v1.HealthStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {google.cloud.compute.v1.IHealthStatus} message HealthStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + 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 112032548, wireType 2 =*/896260386).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.forwardingRuleIp != null && Object.hasOwnProperty.call(message, "forwardingRuleIp")) + writer.uint32(/* id 172250632, wireType 2 =*/1378005058).string(message.forwardingRuleIp); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 282149496, wireType 2 =*/2257195970).string(message.weight); + if (message.healthState != null && Object.hasOwnProperty.call(message, "healthState")) + writer.uint32(/* id 324007150, wireType 0 =*/2592057200).int32(message.healthState); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 406272220, wireType 2 =*/3250177762).string(message.ipAddress); + if (message.weightError != null && Object.hasOwnProperty.call(message, "weightError")) + writer.uint32(/* id 522501505, wireType 0 =*/4180012040).int32(message.weightError); + return writer; + }; + + /** + * Encodes the specified HealthStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {google.cloud.compute.v1.IHealthStatus} message HealthStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthStatus} HealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthStatus(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 112032548: + 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 269964030: + message.forwardingRule = reader.string(); + break; + case 172250632: + message.forwardingRuleIp = reader.string(); + break; + case 324007150: + message.healthState = reader.int32(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 406272220: + message.ipAddress = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + case 282149496: + message.weight = reader.string(); + break; + case 522501505: + message.weightError = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthStatus} HealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthStatus message. + * @function verify + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.forwardingRule != null && message.hasOwnProperty("forwardingRule")) { + properties._forwardingRule = 1; + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + } + if (message.forwardingRuleIp != null && message.hasOwnProperty("forwardingRuleIp")) { + properties._forwardingRuleIp = 1; + if (!$util.isString(message.forwardingRuleIp)) + return "forwardingRuleIp: string expected"; + } + if (message.healthState != null && message.hasOwnProperty("healthState")) { + properties._healthState = 1; + switch (message.healthState) { + default: + return "healthState: enum value expected"; + case 0: + case 439801213: + case 462118084: + break; + } + } + if (message.instance != null && message.hasOwnProperty("instance")) { + properties._instance = 1; + if (!$util.isString(message.instance)) + return "instance: string expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + properties._weight = 1; + if (!$util.isString(message.weight)) + return "weight: string expected"; + } + if (message.weightError != null && message.hasOwnProperty("weightError")) { + properties._weightError = 1; + switch (message.weightError) { + default: + return "weightError: enum value expected"; + case 0: + case 383698400: + case 384027537: + case 439464295: + case 502428831: + break; + } + } + return null; + }; + + /** + * Creates a HealthStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthStatus} HealthStatus + */ + HealthStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthStatus) + return object; + var message = new $root.google.cloud.compute.v1.HealthStatus(); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.compute.v1.HealthStatus.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.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.forwardingRuleIp != null) + message.forwardingRuleIp = String(object.forwardingRuleIp); + switch (object.healthState) { + case "UNDEFINED_HEALTH_STATE": + case 0: + message.healthState = 0; + break; + case "HEALTHY": + case 439801213: + message.healthState = 439801213; + break; + case "UNHEALTHY": + case 462118084: + message.healthState = 462118084; + break; + } + if (object.instance != null) + message.instance = String(object.instance); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.port != null) + message.port = object.port | 0; + if (object.weight != null) + message.weight = String(object.weight); + switch (object.weightError) { + case "UNDEFINED_WEIGHT_ERROR": + case 0: + message.weightError = 0; + break; + case "INVALID_WEIGHT": + case 383698400: + message.weightError = 383698400; + break; + case "MISSING_WEIGHT": + case 384027537: + message.weightError = 384027537; + break; + case "UNAVAILABLE_WEIGHT": + case 439464295: + message.weightError = 439464295; + break; + case "WEIGHT_NONE": + case 502428831: + message.weightError = 502428831; + break; + } + return message; + }; + + /** + * Creates a plain object from a HealthStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthStatus + * @static + * @param {google.cloud.compute.v1.HealthStatus} message HealthStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.annotations = {}; + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + object.instance = message.instance; + if (options.oneofs) + object._instance = "instance"; + } + 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.forwardingRuleIp != null && message.hasOwnProperty("forwardingRuleIp")) { + object.forwardingRuleIp = message.forwardingRuleIp; + if (options.oneofs) + object._forwardingRuleIp = "forwardingRuleIp"; + } + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) { + object.forwardingRule = message.forwardingRule; + if (options.oneofs) + object._forwardingRule = "forwardingRule"; + } + if (message.weight != null && message.hasOwnProperty("weight")) { + object.weight = message.weight; + if (options.oneofs) + object._weight = "weight"; + } + if (message.healthState != null && message.hasOwnProperty("healthState")) { + object.healthState = options.enums === String ? $root.google.cloud.compute.v1.HealthStatus.HealthState[message.healthState] : message.healthState; + if (options.oneofs) + object._healthState = "healthState"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + if (message.weightError != null && message.hasOwnProperty("weightError")) { + object.weightError = options.enums === String ? $root.google.cloud.compute.v1.HealthStatus.WeightError[message.weightError] : message.weightError; + if (options.oneofs) + object._weightError = "weightError"; + } + return object; + }; + + /** + * Converts this HealthStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthStatus + * @instance + * @returns {Object.} JSON object + */ + HealthStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * HealthState enum. + * @name google.cloud.compute.v1.HealthStatus.HealthState + * @enum {number} + * @property {number} UNDEFINED_HEALTH_STATE=0 UNDEFINED_HEALTH_STATE value + * @property {number} HEALTHY=439801213 HEALTHY value + * @property {number} UNHEALTHY=462118084 UNHEALTHY value + */ + HealthStatus.HealthState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_HEALTH_STATE"] = 0; + values[valuesById[439801213] = "HEALTHY"] = 439801213; + values[valuesById[462118084] = "UNHEALTHY"] = 462118084; + return values; + })(); + + /** + * WeightError enum. + * @name google.cloud.compute.v1.HealthStatus.WeightError + * @enum {number} + * @property {number} UNDEFINED_WEIGHT_ERROR=0 UNDEFINED_WEIGHT_ERROR value + * @property {number} INVALID_WEIGHT=383698400 INVALID_WEIGHT value + * @property {number} MISSING_WEIGHT=384027537 MISSING_WEIGHT value + * @property {number} UNAVAILABLE_WEIGHT=439464295 UNAVAILABLE_WEIGHT value + * @property {number} WEIGHT_NONE=502428831 WEIGHT_NONE value + */ + HealthStatus.WeightError = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_WEIGHT_ERROR"] = 0; + values[valuesById[383698400] = "INVALID_WEIGHT"] = 383698400; + values[valuesById[384027537] = "MISSING_WEIGHT"] = 384027537; + values[valuesById[439464295] = "UNAVAILABLE_WEIGHT"] = 439464295; + values[valuesById[502428831] = "WEIGHT_NONE"] = 502428831; + return values; + })(); + + return HealthStatus; + })(); + + v1.BackendServiceGroupHealth = (function() { + + /** + * Properties of a BackendServiceGroupHealth. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceGroupHealth + * @property {Object.|null} [annotations] BackendServiceGroupHealth annotations + * @property {Array.|null} [healthStatus] BackendServiceGroupHealth healthStatus + * @property {string|null} [kind] BackendServiceGroupHealth kind + */ + + /** + * Constructs a new BackendServiceGroupHealth. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceGroupHealth. + * @implements IBackendServiceGroupHealth + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceGroupHealth=} [properties] Properties to set + */ + function BackendServiceGroupHealth(properties) { + this.annotations = {}; + this.healthStatus = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceGroupHealth annotations. + * @member {Object.} annotations + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @instance + */ + BackendServiceGroupHealth.prototype.annotations = $util.emptyObject; + + /** + * BackendServiceGroupHealth healthStatus. + * @member {Array.} healthStatus + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @instance + */ + BackendServiceGroupHealth.prototype.healthStatus = $util.emptyArray; + + /** + * BackendServiceGroupHealth kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @instance + */ + BackendServiceGroupHealth.prototype.kind = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceGroupHealth _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @instance + */ + Object.defineProperty(BackendServiceGroupHealth.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceGroupHealth instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {google.cloud.compute.v1.IBackendServiceGroupHealth=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceGroupHealth} BackendServiceGroupHealth instance + */ + BackendServiceGroupHealth.create = function create(properties) { + return new BackendServiceGroupHealth(properties); + }; + + /** + * Encodes the specified BackendServiceGroupHealth message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceGroupHealth.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {google.cloud.compute.v1.IBackendServiceGroupHealth} message BackendServiceGroupHealth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceGroupHealth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + 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 112032548, wireType 2 =*/896260386).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.healthStatus != null && message.healthStatus.length) + for (var i = 0; i < message.healthStatus.length; ++i) + $root.google.cloud.compute.v1.HealthStatus.encode(message.healthStatus[i], writer.uint32(/* id 380545845, wireType 2 =*/3044366762).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackendServiceGroupHealth message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceGroupHealth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {google.cloud.compute.v1.IBackendServiceGroupHealth} message BackendServiceGroupHealth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceGroupHealth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceGroupHealth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceGroupHealth} BackendServiceGroupHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceGroupHealth.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceGroupHealth(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 112032548: + 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 380545845: + if (!(message.healthStatus && message.healthStatus.length)) + message.healthStatus = []; + message.healthStatus.push($root.google.cloud.compute.v1.HealthStatus.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceGroupHealth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceGroupHealth} BackendServiceGroupHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceGroupHealth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceGroupHealth message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceGroupHealth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.healthStatus != null && message.hasOwnProperty("healthStatus")) { + if (!Array.isArray(message.healthStatus)) + return "healthStatus: array expected"; + for (var i = 0; i < message.healthStatus.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthStatus.verify(message.healthStatus[i]); + if (error) + return "healthStatus." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + return null; + }; + + /** + * Creates a BackendServiceGroupHealth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceGroupHealth} BackendServiceGroupHealth + */ + BackendServiceGroupHealth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceGroupHealth) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceGroupHealth(); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceGroupHealth.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.healthStatus) { + if (!Array.isArray(object.healthStatus)) + throw TypeError(".google.cloud.compute.v1.BackendServiceGroupHealth.healthStatus: array expected"); + message.healthStatus = []; + for (var i = 0; i < object.healthStatus.length; ++i) { + if (typeof object.healthStatus[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceGroupHealth.healthStatus: object expected"); + message.healthStatus[i] = $root.google.cloud.compute.v1.HealthStatus.fromObject(object.healthStatus[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a BackendServiceGroupHealth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @static + * @param {google.cloud.compute.v1.BackendServiceGroupHealth} message BackendServiceGroupHealth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceGroupHealth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.healthStatus = []; + if (options.objects || options.defaults) + object.annotations = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + 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.healthStatus && message.healthStatus.length) { + object.healthStatus = []; + for (var j = 0; j < message.healthStatus.length; ++j) + object.healthStatus[j] = $root.google.cloud.compute.v1.HealthStatus.toObject(message.healthStatus[j], options); + } + return object; + }; + + /** + * Converts this BackendServiceGroupHealth to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceGroupHealth + * @instance + * @returns {Object.} JSON object + */ + BackendServiceGroupHealth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceGroupHealth; + })(); + + v1.BackendServiceList = (function() { + + /** + * Properties of a BackendServiceList. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceList + * @property {string|null} [id] BackendServiceList id + * @property {Array.|null} [items] BackendServiceList items + * @property {string|null} [kind] BackendServiceList kind + * @property {string|null} [nextPageToken] BackendServiceList nextPageToken + * @property {string|null} [selfLink] BackendServiceList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] BackendServiceList warning + */ + + /** + * Constructs a new BackendServiceList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceList. + * @implements IBackendServiceList + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceList=} [properties] Properties to set + */ + function BackendServiceList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + BackendServiceList.prototype.id = null; + + /** + * BackendServiceList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + BackendServiceList.prototype.items = $util.emptyArray; + + /** + * BackendServiceList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + BackendServiceList.prototype.kind = null; + + /** + * BackendServiceList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + BackendServiceList.prototype.nextPageToken = null; + + /** + * BackendServiceList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + BackendServiceList.prototype.selfLink = null; + + /** + * BackendServiceList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + BackendServiceList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + Object.defineProperty(BackendServiceList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + Object.defineProperty(BackendServiceList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + Object.defineProperty(BackendServiceList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + Object.defineProperty(BackendServiceList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackendServiceList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + */ + Object.defineProperty(BackendServiceList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {google.cloud.compute.v1.IBackendServiceList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceList} BackendServiceList instance + */ + BackendServiceList.create = function create(properties) { + return new BackendServiceList(properties); + }; + + /** + * Encodes the specified BackendServiceList message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {google.cloud.compute.v1.IBackendServiceList} message BackendServiceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.BackendService.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified BackendServiceList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {google.cloud.compute.v1.IBackendServiceList} message BackendServiceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceList} BackendServiceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceList} BackendServiceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceList message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a BackendServiceList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceList} BackendServiceList + */ + BackendServiceList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceList) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.BackendServiceList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.BackendService.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.BackendServiceList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a BackendServiceList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceList + * @static + * @param {google.cloud.compute.v1.BackendServiceList} message BackendServiceList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.BackendService.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this BackendServiceList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceList + * @instance + * @returns {Object.} JSON object + */ + BackendServiceList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceList; + })(); + + v1.BackendServiceReference = (function() { + + /** + * Properties of a BackendServiceReference. + * @memberof google.cloud.compute.v1 + * @interface IBackendServiceReference + * @property {string|null} [backendService] BackendServiceReference backendService + */ + + /** + * Constructs a new BackendServiceReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServiceReference. + * @implements IBackendServiceReference + * @constructor + * @param {google.cloud.compute.v1.IBackendServiceReference=} [properties] Properties to set + */ + function BackendServiceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackendServiceReference backendService. + * @member {string|null|undefined} backendService + * @memberof google.cloud.compute.v1.BackendServiceReference + * @instance + */ + BackendServiceReference.prototype.backendService = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackendServiceReference _backendService. + * @member {"backendService"|undefined} _backendService + * @memberof google.cloud.compute.v1.BackendServiceReference + * @instance + */ + Object.defineProperty(BackendServiceReference.prototype, "_backendService", { + get: $util.oneOfGetter($oneOfFields = ["backendService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackendServiceReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {google.cloud.compute.v1.IBackendServiceReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BackendServiceReference} BackendServiceReference instance + */ + BackendServiceReference.create = function create(properties) { + return new BackendServiceReference(properties); + }; + + /** + * Encodes the specified BackendServiceReference message. Does not implicitly {@link google.cloud.compute.v1.BackendServiceReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {google.cloud.compute.v1.IBackendServiceReference} message BackendServiceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified BackendServiceReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BackendServiceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {google.cloud.compute.v1.IBackendServiceReference} message BackendServiceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackendServiceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackendServiceReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BackendServiceReference} BackendServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BackendServiceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackendServiceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BackendServiceReference} BackendServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackendServiceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackendServiceReference message. + * @function verify + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackendServiceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) { + properties._backendService = 1; + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + } + return null; + }; + + /** + * Creates a BackendServiceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BackendServiceReference} BackendServiceReference + */ + BackendServiceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BackendServiceReference) + return object; + var message = new $root.google.cloud.compute.v1.BackendServiceReference(); + if (object.backendService != null) + message.backendService = String(object.backendService); + return message; + }; + + /** + * Creates a plain object from a BackendServiceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BackendServiceReference + * @static + * @param {google.cloud.compute.v1.BackendServiceReference} message BackendServiceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackendServiceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) { + object.backendService = message.backendService; + if (options.oneofs) + object._backendService = "backendService"; + } + return object; + }; + + /** + * Converts this BackendServiceReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BackendServiceReference + * @instance + * @returns {Object.} JSON object + */ + BackendServiceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BackendServiceReference; + })(); + + v1.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.cloud.compute.v1 + * @interface IExpr + * @property {string|null} [description] Expr description + * @property {string|null} [expression] Expr expression + * @property {string|null} [location] Expr location + * @property {string|null} [title] Expr title + */ + + /** + * Constructs a new Expr. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.cloud.compute.v1.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 description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Expr.prototype.description = null; + + /** + * Expr expression. + * @member {string|null|undefined} expression + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Expr.prototype.expression = null; + + /** + * Expr location. + * @member {string|null|undefined} location + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Expr.prototype.location = null; + + /** + * Expr title. + * @member {string|null|undefined} title + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Expr.prototype.title = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Expr _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Object.defineProperty(Expr.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Expr _expression. + * @member {"expression"|undefined} _expression + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Object.defineProperty(Expr.prototype, "_expression", { + get: $util.oneOfGetter($oneOfFields = ["expression"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Expr _location. + * @member {"location"|undefined} _location + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Object.defineProperty(Expr.prototype, "_location", { + get: $util.oneOfGetter($oneOfFields = ["location"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Expr _title. + * @member {"title"|undefined} _title + * @memberof google.cloud.compute.v1.Expr + * @instance + */ + Object.defineProperty(Expr.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Expr + * @static + * @param {google.cloud.compute.v1.IExpr=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.cloud.compute.v1.Expr.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Expr + * @static + * @param {google.cloud.compute.v1.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.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 110371416, wireType 2 =*/882971330).string(message.title); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 290430901, wireType 2 =*/2323447210).string(message.location); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 352031384, wireType 2 =*/2816251074).string(message.expression); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Expr + * @static + * @param {google.cloud.compute.v1.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.cloud.compute.v1.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.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.cloud.compute.v1.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 352031384: + message.expression = reader.string(); + break; + case 290430901: + message.location = reader.string(); + break; + case 110371416: + message.title = 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.cloud.compute.v1.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.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.cloud.compute.v1.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"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.expression != null && message.hasOwnProperty("expression")) { + properties._expression = 1; + if (!$util.isString(message.expression)) + return "expression: string expected"; + } + if (message.location != null && message.hasOwnProperty("location")) { + properties._location = 1; + if (!$util.isString(message.location)) + return "location: string expected"; + } + if (message.title != null && message.hasOwnProperty("title")) { + properties._title = 1; + if (!$util.isString(message.title)) + return "title: string expected"; + } + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Expr) + return object; + var message = new $root.google.cloud.compute.v1.Expr(); + if (object.description != null) + message.description = String(object.description); + if (object.expression != null) + message.expression = String(object.expression); + if (object.location != null) + message.location = String(object.location); + if (object.title != null) + message.title = String(object.title); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Expr + * @static + * @param {google.cloud.compute.v1.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 (message.title != null && message.hasOwnProperty("title")) { + object.title = message.title; + if (options.oneofs) + object._title = "title"; + } + if (message.location != null && message.hasOwnProperty("location")) { + object.location = message.location; + if (options.oneofs) + object._location = "location"; + } + if (message.expression != null && message.hasOwnProperty("expression")) { + object.expression = message.expression; + if (options.oneofs) + object._expression = "expression"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Expr; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.cloud.compute.v1 + * @interface IBinding + * @property {string|null} [bindingId] Binding bindingId + * @property {google.cloud.compute.v1.IExpr|null} [condition] Binding condition + * @property {Array.|null} [members] Binding members + * @property {string|null} [role] Binding role + */ + + /** + * Constructs a new Binding. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.cloud.compute.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 bindingId. + * @member {string|null|undefined} bindingId + * @memberof google.cloud.compute.v1.Binding + * @instance + */ + Binding.prototype.bindingId = null; + + /** + * Binding condition. + * @member {google.cloud.compute.v1.IExpr|null|undefined} condition + * @memberof google.cloud.compute.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.cloud.compute.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding role. + * @member {string|null|undefined} role + * @memberof google.cloud.compute.v1.Binding + * @instance + */ + Binding.prototype.role = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Binding _bindingId. + * @member {"bindingId"|undefined} _bindingId + * @memberof google.cloud.compute.v1.Binding + * @instance + */ + Object.defineProperty(Binding.prototype, "_bindingId", { + get: $util.oneOfGetter($oneOfFields = ["bindingId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Binding _condition. + * @member {"condition"|undefined} _condition + * @memberof google.cloud.compute.v1.Binding + * @instance + */ + Object.defineProperty(Binding.prototype, "_condition", { + get: $util.oneOfGetter($oneOfFields = ["condition"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Binding _role. + * @member {"role"|undefined} _role + * @memberof google.cloud.compute.v1.Binding + * @instance + */ + Object.defineProperty(Binding.prototype, "_role", { + get: $util.oneOfGetter($oneOfFields = ["role"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Binding + * @static + * @param {google.cloud.compute.v1.IBinding=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.cloud.compute.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Binding + * @static + * @param {google.cloud.compute.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 3506294, wireType 2 =*/28050354).string(message.role); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.cloud.compute.v1.Expr.encode(message.condition, writer.uint32(/* id 212430107, wireType 2 =*/1699440858).fork()).ldelim(); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 412010777, wireType 2 =*/3296086218).string(message.members[i]); + if (message.bindingId != null && Object.hasOwnProperty.call(message, "bindingId")) + writer.uint32(/* id 441088277, wireType 2 =*/3528706218).string(message.bindingId); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Binding + * @static + * @param {google.cloud.compute.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.cloud.compute.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.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.cloud.compute.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 441088277: + message.bindingId = reader.string(); + break; + case 212430107: + message.condition = $root.google.cloud.compute.v1.Expr.decode(reader, reader.uint32()); + break; + case 412010777: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + case 3506294: + message.role = reader.string(); + 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.cloud.compute.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.cloud.compute.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"; + var properties = {}; + if (message.bindingId != null && message.hasOwnProperty("bindingId")) { + properties._bindingId = 1; + if (!$util.isString(message.bindingId)) + return "bindingId: string expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + properties._condition = 1; + { + var error = $root.google.cloud.compute.v1.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + } + 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.role != null && message.hasOwnProperty("role")) { + properties._role = 1; + if (!$util.isString(message.role)) + return "role: string expected"; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Binding) + return object; + var message = new $root.google.cloud.compute.v1.Binding(); + if (object.bindingId != null) + message.bindingId = String(object.bindingId); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.compute.v1.Binding.condition: object expected"); + message.condition = $root.google.cloud.compute.v1.Expr.fromObject(object.condition); + } + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.cloud.compute.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.role != null) + message.role = String(object.role); + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Binding + * @static + * @param {google.cloud.compute.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 (message.role != null && message.hasOwnProperty("role")) { + object.role = message.role; + if (options.oneofs) + object._role = "role"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + object.condition = $root.google.cloud.compute.v1.Expr.toObject(message.condition, options); + if (options.oneofs) + object._condition = "condition"; + } + 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.bindingId != null && message.hasOwnProperty("bindingId")) { + object.bindingId = message.bindingId; + if (options.oneofs) + object._bindingId = "bindingId"; + } + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Binding; + })(); + + v1.InstanceProperties = (function() { + + /** + * Properties of an InstanceProperties. + * @memberof google.cloud.compute.v1 + * @interface IInstanceProperties + * @property {google.cloud.compute.v1.IAdvancedMachineFeatures|null} [advancedMachineFeatures] InstanceProperties advancedMachineFeatures + * @property {boolean|null} [canIpForward] InstanceProperties canIpForward + * @property {google.cloud.compute.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] InstanceProperties confidentialInstanceConfig + * @property {string|null} [description] InstanceProperties description + * @property {Array.|null} [disks] InstanceProperties disks + * @property {Array.|null} [guestAccelerators] InstanceProperties guestAccelerators + * @property {Object.|null} [labels] InstanceProperties labels + * @property {string|null} [machineType] InstanceProperties machineType + * @property {google.cloud.compute.v1.IMetadata|null} [metadata] InstanceProperties metadata + * @property {string|null} [minCpuPlatform] InstanceProperties minCpuPlatform + * @property {Array.|null} [networkInterfaces] InstanceProperties networkInterfaces + * @property {google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] InstanceProperties privateIpv6GoogleAccess + * @property {google.cloud.compute.v1.IReservationAffinity|null} [reservationAffinity] InstanceProperties reservationAffinity + * @property {Array.|null} [resourcePolicies] InstanceProperties resourcePolicies + * @property {google.cloud.compute.v1.IScheduling|null} [scheduling] InstanceProperties scheduling + * @property {Array.|null} [serviceAccounts] InstanceProperties serviceAccounts + * @property {google.cloud.compute.v1.IShieldedInstanceConfig|null} [shieldedInstanceConfig] InstanceProperties shieldedInstanceConfig + * @property {google.cloud.compute.v1.ITags|null} [tags] InstanceProperties tags + */ + + /** + * Constructs a new InstanceProperties. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceProperties. + * @implements IInstanceProperties + * @constructor + * @param {google.cloud.compute.v1.IInstanceProperties=} [properties] Properties to set + */ + function InstanceProperties(properties) { + this.disks = []; + this.guestAccelerators = []; + this.labels = {}; + this.networkInterfaces = []; + this.resourcePolicies = []; + this.serviceAccounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceProperties advancedMachineFeatures. + * @member {google.cloud.compute.v1.IAdvancedMachineFeatures|null|undefined} advancedMachineFeatures + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.advancedMachineFeatures = null; + + /** + * InstanceProperties canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.canIpForward = null; + + /** + * InstanceProperties confidentialInstanceConfig. + * @member {google.cloud.compute.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.confidentialInstanceConfig = null; + + /** + * InstanceProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.description = null; + + /** + * InstanceProperties disks. + * @member {Array.} disks + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.disks = $util.emptyArray; + + /** + * InstanceProperties guestAccelerators. + * @member {Array.} guestAccelerators + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.guestAccelerators = $util.emptyArray; + + /** + * InstanceProperties labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.labels = $util.emptyObject; + + /** + * InstanceProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.machineType = null; + + /** + * InstanceProperties metadata. + * @member {google.cloud.compute.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.metadata = null; + + /** + * InstanceProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.minCpuPlatform = null; + + /** + * InstanceProperties networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.networkInterfaces = $util.emptyArray; + + /** + * InstanceProperties privateIpv6GoogleAccess. + * @member {google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess|null|undefined} privateIpv6GoogleAccess + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.privateIpv6GoogleAccess = null; + + /** + * InstanceProperties reservationAffinity. + * @member {google.cloud.compute.v1.IReservationAffinity|null|undefined} reservationAffinity + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.reservationAffinity = null; + + /** + * InstanceProperties resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.resourcePolicies = $util.emptyArray; + + /** + * InstanceProperties scheduling. + * @member {google.cloud.compute.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.scheduling = null; + + /** + * InstanceProperties serviceAccounts. + * @member {Array.} serviceAccounts + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.serviceAccounts = $util.emptyArray; + + /** + * InstanceProperties shieldedInstanceConfig. + * @member {google.cloud.compute.v1.IShieldedInstanceConfig|null|undefined} shieldedInstanceConfig + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.shieldedInstanceConfig = null; + + /** + * InstanceProperties tags. + * @member {google.cloud.compute.v1.ITags|null|undefined} tags + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + InstanceProperties.prototype.tags = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceProperties _advancedMachineFeatures. + * @member {"advancedMachineFeatures"|undefined} _advancedMachineFeatures + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_advancedMachineFeatures", { + get: $util.oneOfGetter($oneOfFields = ["advancedMachineFeatures"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _canIpForward. + * @member {"canIpForward"|undefined} _canIpForward + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _confidentialInstanceConfig. + * @member {"confidentialInstanceConfig"|undefined} _confidentialInstanceConfig + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_confidentialInstanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["confidentialInstanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _privateIpv6GoogleAccess. + * @member {"privateIpv6GoogleAccess"|undefined} _privateIpv6GoogleAccess + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_privateIpv6GoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpv6GoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _reservationAffinity. + * @member {"reservationAffinity"|undefined} _reservationAffinity + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_reservationAffinity", { + get: $util.oneOfGetter($oneOfFields = ["reservationAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _scheduling. + * @member {"scheduling"|undefined} _scheduling + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _shieldedInstanceConfig. + * @member {"shieldedInstanceConfig"|undefined} _shieldedInstanceConfig + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_shieldedInstanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["shieldedInstanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceProperties _tags. + * @member {"tags"|undefined} _tags + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + */ + Object.defineProperty(InstanceProperties.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {google.cloud.compute.v1.IInstanceProperties=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceProperties} InstanceProperties instance + */ + InstanceProperties.create = function create(properties) { + return new InstanceProperties(properties); + }; + + /** + * Encodes the specified InstanceProperties message. Does not implicitly {@link google.cloud.compute.v1.InstanceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {google.cloud.compute.v1.IInstanceProperties} message InstanceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.compute.v1.Tags.encode(message.tags, writer.uint32(/* id 3552281, wireType 2 =*/28418250).fork()).ldelim(); + if (message.shieldedInstanceConfig != null && Object.hasOwnProperty.call(message, "shieldedInstanceConfig")) + $root.google.cloud.compute.v1.ShieldedInstanceConfig.encode(message.shieldedInstanceConfig, writer.uint32(/* id 12862901, wireType 2 =*/102903210).fork()).ldelim(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) + writer.uint32(/* id 48277006, wireType 0 =*/386216048).int32(message.privateIpv6GoogleAccess); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.compute.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 52735243, wireType 2 =*/421881946).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.compute.v1.Metadata.encode(message.metadata, writer.uint32(/* id 86866735, wireType 2 =*/694933882).fork()).ldelim(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.compute.v1.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork()).ldelim(); + if (message.reservationAffinity != null && Object.hasOwnProperty.call(message, "reservationAffinity")) + $root.google.cloud.compute.v1.ReservationAffinity.encode(message.reservationAffinity, writer.uint32(/* id 157850683, wireType 2 =*/1262805466).fork()).ldelim(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 227711026, wireType 2 =*/1821688210).string(message.machineType); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 242912759, wireType 2 =*/1943302074).string(message.minCpuPlatform); + if (message.serviceAccounts != null && message.serviceAccounts.length) + for (var i = 0; i < message.serviceAccounts.length; ++i) + $root.google.cloud.compute.v1.ServiceAccount.encode(message.serviceAccounts[i], writer.uint32(/* id 277537328, wireType 2 =*/2220298626).fork()).ldelim(); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.compute.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 386688404, wireType 2 =*/3093507234).fork()).ldelim(); + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) + $root.google.cloud.compute.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 409646002, wireType 2 =*/3277168018).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.guestAccelerators != null && message.guestAccelerators.length) + for (var i = 0; i < message.guestAccelerators.length; ++i) + $root.google.cloud.compute.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 463595119, wireType 2 =*/3708760954).fork()).ldelim(); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 467731324, wireType 0 =*/3741850592).bool(message.canIpForward); + if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) + $root.google.cloud.compute.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 490637685, wireType 2 =*/3925101482).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 500195327, wireType 2 =*/4001562618).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 InstanceProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {google.cloud.compute.v1.IInstanceProperties} message InstanceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceProperties} InstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 409646002: + message.advancedMachineFeatures = $root.google.cloud.compute.v1.AdvancedMachineFeatures.decode(reader, reader.uint32()); + break; + case 467731324: + message.canIpForward = reader.bool(); + break; + case 490637685: + message.confidentialInstanceConfig = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 95594102: + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.compute.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + case 463595119: + if (!(message.guestAccelerators && message.guestAccelerators.length)) + message.guestAccelerators = []; + message.guestAccelerators.push($root.google.cloud.compute.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + case 500195327: + 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 227711026: + message.machineType = reader.string(); + break; + case 86866735: + message.metadata = $root.google.cloud.compute.v1.Metadata.decode(reader, reader.uint32()); + break; + case 242912759: + message.minCpuPlatform = reader.string(); + break; + case 52735243: + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.compute.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + case 48277006: + message.privateIpv6GoogleAccess = reader.int32(); + break; + case 157850683: + message.reservationAffinity = $root.google.cloud.compute.v1.ReservationAffinity.decode(reader, reader.uint32()); + break; + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + case 386688404: + message.scheduling = $root.google.cloud.compute.v1.Scheduling.decode(reader, reader.uint32()); + break; + case 277537328: + if (!(message.serviceAccounts && message.serviceAccounts.length)) + message.serviceAccounts = []; + message.serviceAccounts.push($root.google.cloud.compute.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + case 12862901: + message.shieldedInstanceConfig = $root.google.cloud.compute.v1.ShieldedInstanceConfig.decode(reader, reader.uint32()); + break; + case 3552281: + message.tags = $root.google.cloud.compute.v1.Tags.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceProperties} InstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceProperties message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + properties._advancedMachineFeatures = 1; + { + var error = $root.google.cloud.compute.v1.AdvancedMachineFeatures.verify(message.advancedMachineFeatures); + if (error) + return "advancedMachineFeatures." + error; + } + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + properties._confidentialInstanceConfig = 1; + { + var error = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); + if (error) + return "confidentialInstanceConfig." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.compute.v1.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { + if (!Array.isArray(message.guestAccelerators)) + return "guestAccelerators: array expected"; + for (var i = 0; i < message.guestAccelerators.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); + if (error) + return "guestAccelerators." + 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.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.compute.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + properties._privateIpv6GoogleAccess = 1; + switch (message.privateIpv6GoogleAccess) { + default: + return "privateIpv6GoogleAccess: enum value expected"; + case 0: + case 427975994: + case 288210263: + case 530256959: + break; + } + } + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { + properties._reservationAffinity = 1; + { + var error = $root.google.cloud.compute.v1.ReservationAffinity.verify(message.reservationAffinity); + if (error) + return "reservationAffinity." + error; + } + } + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.compute.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.serviceAccounts != null && message.hasOwnProperty("serviceAccounts")) { + if (!Array.isArray(message.serviceAccounts)) + return "serviceAccounts: array expected"; + for (var i = 0; i < message.serviceAccounts.length; ++i) { + var error = $root.google.cloud.compute.v1.ServiceAccount.verify(message.serviceAccounts[i]); + if (error) + return "serviceAccounts." + error; + } + } + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) { + properties._shieldedInstanceConfig = 1; + { + var error = $root.google.cloud.compute.v1.ShieldedInstanceConfig.verify(message.shieldedInstanceConfig); + if (error) + return "shieldedInstanceConfig." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.compute.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + return null; + }; + + /** + * Creates an InstanceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceProperties} InstanceProperties + */ + InstanceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceProperties) + return object; + var message = new $root.google.cloud.compute.v1.InstanceProperties(); + if (object.advancedMachineFeatures != null) { + if (typeof object.advancedMachineFeatures !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.advancedMachineFeatures: object expected"); + message.advancedMachineFeatures = $root.google.cloud.compute.v1.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures); + } + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.confidentialInstanceConfig != null) { + if (typeof object.confidentialInstanceConfig !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.confidentialInstanceConfig: object expected"); + message.confidentialInstanceConfig = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); + } + if (object.description != null) + message.description = String(object.description); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.compute.v1.InstanceProperties.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.disks: object expected"); + message.disks[i] = $root.google.cloud.compute.v1.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.guestAccelerators) { + if (!Array.isArray(object.guestAccelerators)) + throw TypeError(".google.cloud.compute.v1.InstanceProperties.guestAccelerators: array expected"); + message.guestAccelerators = []; + for (var i = 0; i < object.guestAccelerators.length; ++i) { + if (typeof object.guestAccelerators[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.guestAccelerators: object expected"); + message.guestAccelerators[i] = $root.google.cloud.compute.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); + } + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.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.machineType != null) + message.machineType = String(object.machineType); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.metadata: object expected"); + message.metadata = $root.google.cloud.compute.v1.Metadata.fromObject(object.metadata); + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.compute.v1.InstanceProperties.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.compute.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + switch (object.privateIpv6GoogleAccess) { + case "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS": + case 0: + message.privateIpv6GoogleAccess = 0; + break; + case "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": + case 427975994: + message.privateIpv6GoogleAccess = 427975994; + break; + case "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": + case 288210263: + message.privateIpv6GoogleAccess = 288210263; + break; + case "INHERIT_FROM_SUBNETWORK": + case 530256959: + message.privateIpv6GoogleAccess = 530256959; + break; + } + if (object.reservationAffinity != null) { + if (typeof object.reservationAffinity !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.reservationAffinity: object expected"); + message.reservationAffinity = $root.google.cloud.compute.v1.ReservationAffinity.fromObject(object.reservationAffinity); + } + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.InstanceProperties.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.scheduling: object expected"); + message.scheduling = $root.google.cloud.compute.v1.Scheduling.fromObject(object.scheduling); + } + if (object.serviceAccounts) { + if (!Array.isArray(object.serviceAccounts)) + throw TypeError(".google.cloud.compute.v1.InstanceProperties.serviceAccounts: array expected"); + message.serviceAccounts = []; + for (var i = 0; i < object.serviceAccounts.length; ++i) { + if (typeof object.serviceAccounts[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.serviceAccounts: object expected"); + message.serviceAccounts[i] = $root.google.cloud.compute.v1.ServiceAccount.fromObject(object.serviceAccounts[i]); + } + } + if (object.shieldedInstanceConfig != null) { + if (typeof object.shieldedInstanceConfig !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.shieldedInstanceConfig: object expected"); + message.shieldedInstanceConfig = $root.google.cloud.compute.v1.ShieldedInstanceConfig.fromObject(object.shieldedInstanceConfig); + } + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceProperties.tags: object expected"); + message.tags = $root.google.cloud.compute.v1.Tags.fromObject(object.tags); + } + return message; + }; + + /** + * Creates a plain object from an InstanceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceProperties + * @static + * @param {google.cloud.compute.v1.InstanceProperties} message InstanceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourcePolicies = []; + object.networkInterfaces = []; + object.disks = []; + object.serviceAccounts = []; + object.guestAccelerators = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.compute.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) { + object.shieldedInstanceConfig = $root.google.cloud.compute.v1.ShieldedInstanceConfig.toObject(message.shieldedInstanceConfig, options); + if (options.oneofs) + object._shieldedInstanceConfig = "shieldedInstanceConfig"; + } + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; + if (options.oneofs) + object._privateIpv6GoogleAccess = "privateIpv6GoogleAccess"; + } + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.compute.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.compute.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.compute.v1.AttachedDisk.toObject(message.disks[j], options); + } + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { + object.reservationAffinity = $root.google.cloud.compute.v1.ReservationAffinity.toObject(message.reservationAffinity, options); + if (options.oneofs) + object._reservationAffinity = "reservationAffinity"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.serviceAccounts && message.serviceAccounts.length) { + object.serviceAccounts = []; + for (var j = 0; j < message.serviceAccounts.length; ++j) + object.serviceAccounts[j] = $root.google.cloud.compute.v1.ServiceAccount.toObject(message.serviceAccounts[j], options); + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.compute.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + object.advancedMachineFeatures = $root.google.cloud.compute.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); + if (options.oneofs) + object._advancedMachineFeatures = "advancedMachineFeatures"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.guestAccelerators && message.guestAccelerators.length) { + object.guestAccelerators = []; + for (var j = 0; j < message.guestAccelerators.length; ++j) + object.guestAccelerators[j] = $root.google.cloud.compute.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + object.confidentialInstanceConfig = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); + if (options.oneofs) + object._confidentialInstanceConfig = "confidentialInstanceConfig"; + } + 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 InstanceProperties to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceProperties + * @instance + * @returns {Object.} JSON object + */ + InstanceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PrivateIpv6GoogleAccess enum. + * @name google.cloud.compute.v1.InstanceProperties.PrivateIpv6GoogleAccess + * @enum {number} + * @property {number} UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS=0 UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS value + * @property {number} ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE=427975994 ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE value + * @property {number} ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE=288210263 ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE value + * @property {number} INHERIT_FROM_SUBNETWORK=530256959 INHERIT_FROM_SUBNETWORK value + */ + InstanceProperties.PrivateIpv6GoogleAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS"] = 0; + values[valuesById[427975994] = "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"] = 427975994; + values[valuesById[288210263] = "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"] = 288210263; + values[valuesById[530256959] = "INHERIT_FROM_SUBNETWORK"] = 530256959; + return values; + })(); + + return InstanceProperties; + })(); + + v1.LocationPolicy = (function() { + + /** + * Properties of a LocationPolicy. + * @memberof google.cloud.compute.v1 + * @interface ILocationPolicy + * @property {Object.|null} [locations] LocationPolicy locations + */ + + /** + * Constructs a new LocationPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LocationPolicy. + * @implements ILocationPolicy + * @constructor + * @param {google.cloud.compute.v1.ILocationPolicy=} [properties] Properties to set + */ + function LocationPolicy(properties) { + this.locations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationPolicy locations. + * @member {Object.} locations + * @memberof google.cloud.compute.v1.LocationPolicy + * @instance + */ + LocationPolicy.prototype.locations = $util.emptyObject; + + /** + * Creates a new LocationPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {google.cloud.compute.v1.ILocationPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LocationPolicy} LocationPolicy instance + */ + LocationPolicy.create = function create(properties) { + return new LocationPolicy(properties); + }; + + /** + * Encodes the specified LocationPolicy message. Does not implicitly {@link google.cloud.compute.v1.LocationPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {google.cloud.compute.v1.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locations != null && Object.hasOwnProperty.call(message, "locations")) + for (var keys = Object.keys(message.locations), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 413423454, wireType 2 =*/3307387634).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.LocationPolicyLocation.encode(message.locations[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LocationPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {google.cloud.compute.v1.ILocationPolicy} message LocationPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LocationPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 413423454: + if (message.locations === $util.emptyObject) + message.locations = {}; + 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.compute.v1.LocationPolicyLocation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.locations[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LocationPolicy} LocationPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!$util.isObject(message.locations)) + return "locations: object expected"; + var key = Object.keys(message.locations); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.LocationPolicyLocation.verify(message.locations[key[i]]); + if (error) + return "locations." + error; + } + } + return null; + }; + + /** + * Creates a LocationPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LocationPolicy} LocationPolicy + */ + LocationPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LocationPolicy) + return object; + var message = new $root.google.cloud.compute.v1.LocationPolicy(); + if (object.locations) { + if (typeof object.locations !== "object") + throw TypeError(".google.cloud.compute.v1.LocationPolicy.locations: object expected"); + message.locations = {}; + for (var keys = Object.keys(object.locations), i = 0; i < keys.length; ++i) { + if (typeof object.locations[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.LocationPolicy.locations: object expected"); + message.locations[keys[i]] = $root.google.cloud.compute.v1.LocationPolicyLocation.fromObject(object.locations[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a LocationPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LocationPolicy + * @static + * @param {google.cloud.compute.v1.LocationPolicy} message LocationPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.locations = {}; + var keys2; + if (message.locations && (keys2 = Object.keys(message.locations)).length) { + object.locations = {}; + for (var j = 0; j < keys2.length; ++j) + object.locations[keys2[j]] = $root.google.cloud.compute.v1.LocationPolicyLocation.toObject(message.locations[keys2[j]], options); + } + return object; + }; + + /** + * Converts this LocationPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LocationPolicy + * @instance + * @returns {Object.} JSON object + */ + LocationPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationPolicy; + })(); + + v1.BulkInsertInstanceResourcePerInstanceProperties = (function() { + + /** + * Properties of a BulkInsertInstanceResourcePerInstanceProperties. + * @memberof google.cloud.compute.v1 + * @interface IBulkInsertInstanceResourcePerInstanceProperties + * @property {string|null} [name] BulkInsertInstanceResourcePerInstanceProperties name + */ + + /** + * Constructs a new BulkInsertInstanceResourcePerInstanceProperties. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BulkInsertInstanceResourcePerInstanceProperties. + * @implements IBulkInsertInstanceResourcePerInstanceProperties + * @constructor + * @param {google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties=} [properties] Properties to set + */ + function BulkInsertInstanceResourcePerInstanceProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BulkInsertInstanceResourcePerInstanceProperties name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @instance + */ + BulkInsertInstanceResourcePerInstanceProperties.prototype.name = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BulkInsertInstanceResourcePerInstanceProperties _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @instance + */ + Object.defineProperty(BulkInsertInstanceResourcePerInstanceProperties.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BulkInsertInstanceResourcePerInstanceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties} BulkInsertInstanceResourcePerInstanceProperties instance + */ + BulkInsertInstanceResourcePerInstanceProperties.create = function create(properties) { + return new BulkInsertInstanceResourcePerInstanceProperties(properties); + }; + + /** + * Encodes the specified BulkInsertInstanceResourcePerInstanceProperties message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties} message BulkInsertInstanceResourcePerInstanceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertInstanceResourcePerInstanceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + return writer; + }; + + /** + * Encodes the specified BulkInsertInstanceResourcePerInstanceProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceResourcePerInstanceProperties} message BulkInsertInstanceResourcePerInstanceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertInstanceResourcePerInstanceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkInsertInstanceResourcePerInstanceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties} BulkInsertInstanceResourcePerInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertInstanceResourcePerInstanceProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkInsertInstanceResourcePerInstanceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties} BulkInsertInstanceResourcePerInstanceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertInstanceResourcePerInstanceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkInsertInstanceResourcePerInstanceProperties message. + * @function verify + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkInsertInstanceResourcePerInstanceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a BulkInsertInstanceResourcePerInstanceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties} BulkInsertInstanceResourcePerInstanceProperties + */ + BulkInsertInstanceResourcePerInstanceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties) + return object; + var message = new $root.google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a BulkInsertInstanceResourcePerInstanceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @static + * @param {google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties} message BulkInsertInstanceResourcePerInstanceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkInsertInstanceResourcePerInstanceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + return object; + }; + + /** + * Converts this BulkInsertInstanceResourcePerInstanceProperties to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties + * @instance + * @returns {Object.} JSON object + */ + BulkInsertInstanceResourcePerInstanceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BulkInsertInstanceResourcePerInstanceProperties; + })(); + + v1.BulkInsertInstanceResource = (function() { + + /** + * Properties of a BulkInsertInstanceResource. + * @memberof google.cloud.compute.v1 + * @interface IBulkInsertInstanceResource + * @property {number|Long|null} [count] BulkInsertInstanceResource count + * @property {google.cloud.compute.v1.IInstanceProperties|null} [instanceProperties] BulkInsertInstanceResource instanceProperties + * @property {google.cloud.compute.v1.ILocationPolicy|null} [locationPolicy] BulkInsertInstanceResource locationPolicy + * @property {number|Long|null} [minCount] BulkInsertInstanceResource minCount + * @property {string|null} [namePattern] BulkInsertInstanceResource namePattern + * @property {Object.|null} [perInstanceProperties] BulkInsertInstanceResource perInstanceProperties + * @property {string|null} [sourceInstanceTemplate] BulkInsertInstanceResource sourceInstanceTemplate + */ + + /** + * Constructs a new BulkInsertInstanceResource. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BulkInsertInstanceResource. + * @implements IBulkInsertInstanceResource + * @constructor + * @param {google.cloud.compute.v1.IBulkInsertInstanceResource=} [properties] Properties to set + */ + function BulkInsertInstanceResource(properties) { + this.perInstanceProperties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BulkInsertInstanceResource count. + * @member {number|Long|null|undefined} count + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + BulkInsertInstanceResource.prototype.count = null; + + /** + * BulkInsertInstanceResource instanceProperties. + * @member {google.cloud.compute.v1.IInstanceProperties|null|undefined} instanceProperties + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + BulkInsertInstanceResource.prototype.instanceProperties = null; + + /** + * BulkInsertInstanceResource locationPolicy. + * @member {google.cloud.compute.v1.ILocationPolicy|null|undefined} locationPolicy + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + BulkInsertInstanceResource.prototype.locationPolicy = null; + + /** + * BulkInsertInstanceResource minCount. + * @member {number|Long|null|undefined} minCount + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + BulkInsertInstanceResource.prototype.minCount = null; + + /** + * BulkInsertInstanceResource namePattern. + * @member {string|null|undefined} namePattern + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + BulkInsertInstanceResource.prototype.namePattern = null; + + /** + * BulkInsertInstanceResource perInstanceProperties. + * @member {Object.} perInstanceProperties + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + BulkInsertInstanceResource.prototype.perInstanceProperties = $util.emptyObject; + + /** + * BulkInsertInstanceResource sourceInstanceTemplate. + * @member {string|null|undefined} sourceInstanceTemplate + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + BulkInsertInstanceResource.prototype.sourceInstanceTemplate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BulkInsertInstanceResource _count. + * @member {"count"|undefined} _count + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + Object.defineProperty(BulkInsertInstanceResource.prototype, "_count", { + get: $util.oneOfGetter($oneOfFields = ["count"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BulkInsertInstanceResource _instanceProperties. + * @member {"instanceProperties"|undefined} _instanceProperties + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + Object.defineProperty(BulkInsertInstanceResource.prototype, "_instanceProperties", { + get: $util.oneOfGetter($oneOfFields = ["instanceProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BulkInsertInstanceResource _locationPolicy. + * @member {"locationPolicy"|undefined} _locationPolicy + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + Object.defineProperty(BulkInsertInstanceResource.prototype, "_locationPolicy", { + get: $util.oneOfGetter($oneOfFields = ["locationPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BulkInsertInstanceResource _minCount. + * @member {"minCount"|undefined} _minCount + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + Object.defineProperty(BulkInsertInstanceResource.prototype, "_minCount", { + get: $util.oneOfGetter($oneOfFields = ["minCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BulkInsertInstanceResource _namePattern. + * @member {"namePattern"|undefined} _namePattern + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + Object.defineProperty(BulkInsertInstanceResource.prototype, "_namePattern", { + get: $util.oneOfGetter($oneOfFields = ["namePattern"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BulkInsertInstanceResource _sourceInstanceTemplate. + * @member {"sourceInstanceTemplate"|undefined} _sourceInstanceTemplate + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + */ + Object.defineProperty(BulkInsertInstanceResource.prototype, "_sourceInstanceTemplate", { + get: $util.oneOfGetter($oneOfFields = ["sourceInstanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BulkInsertInstanceResource instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceResource=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BulkInsertInstanceResource} BulkInsertInstanceResource instance + */ + BulkInsertInstanceResource.create = function create(properties) { + return new BulkInsertInstanceResource(properties); + }; + + /** + * Encodes the specified BulkInsertInstanceResource message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceResource} message BulkInsertInstanceResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertInstanceResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 94851343, wireType 0 =*/758810744).int64(message.count); + if (message.perInstanceProperties != null && Object.hasOwnProperty.call(message, "perInstanceProperties")) + for (var keys = Object.keys(message.perInstanceProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 108502267, wireType 2 =*/868018138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.encode(message.perInstanceProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.instanceProperties != null && Object.hasOwnProperty.call(message, "instanceProperties")) + $root.google.cloud.compute.v1.InstanceProperties.encode(message.instanceProperties, writer.uint32(/* id 215355165, wireType 2 =*/1722841322).fork()).ldelim(); + if (message.sourceInstanceTemplate != null && Object.hasOwnProperty.call(message, "sourceInstanceTemplate")) + writer.uint32(/* id 332423616, wireType 2 =*/2659388930).string(message.sourceInstanceTemplate); + if (message.namePattern != null && Object.hasOwnProperty.call(message, "namePattern")) + writer.uint32(/* id 413815260, wireType 2 =*/3310522082).string(message.namePattern); + if (message.locationPolicy != null && Object.hasOwnProperty.call(message, "locationPolicy")) + $root.google.cloud.compute.v1.LocationPolicy.encode(message.locationPolicy, writer.uint32(/* id 465689852, wireType 2 =*/3725518818).fork()).ldelim(); + if (message.minCount != null && Object.hasOwnProperty.call(message, "minCount")) + writer.uint32(/* id 523228386, wireType 0 =*/4185827088).int64(message.minCount); + return writer; + }; + + /** + * Encodes the specified BulkInsertInstanceResource message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceResource} message BulkInsertInstanceResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertInstanceResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkInsertInstanceResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BulkInsertInstanceResource} BulkInsertInstanceResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertInstanceResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BulkInsertInstanceResource(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 94851343: + message.count = reader.int64(); + break; + case 215355165: + message.instanceProperties = $root.google.cloud.compute.v1.InstanceProperties.decode(reader, reader.uint32()); + break; + case 465689852: + message.locationPolicy = $root.google.cloud.compute.v1.LocationPolicy.decode(reader, reader.uint32()); + break; + case 523228386: + message.minCount = reader.int64(); + break; + case 413815260: + message.namePattern = reader.string(); + break; + case 108502267: + if (message.perInstanceProperties === $util.emptyObject) + message.perInstanceProperties = {}; + 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.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.perInstanceProperties[key] = value; + break; + case 332423616: + message.sourceInstanceTemplate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkInsertInstanceResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BulkInsertInstanceResource} BulkInsertInstanceResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertInstanceResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkInsertInstanceResource message. + * @function verify + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkInsertInstanceResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.count != null && message.hasOwnProperty("count")) { + properties._count = 1; + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + } + if (message.instanceProperties != null && message.hasOwnProperty("instanceProperties")) { + properties._instanceProperties = 1; + { + var error = $root.google.cloud.compute.v1.InstanceProperties.verify(message.instanceProperties); + if (error) + return "instanceProperties." + error; + } + } + if (message.locationPolicy != null && message.hasOwnProperty("locationPolicy")) { + properties._locationPolicy = 1; + { + var error = $root.google.cloud.compute.v1.LocationPolicy.verify(message.locationPolicy); + if (error) + return "locationPolicy." + error; + } + } + if (message.minCount != null && message.hasOwnProperty("minCount")) { + properties._minCount = 1; + if (!$util.isInteger(message.minCount) && !(message.minCount && $util.isInteger(message.minCount.low) && $util.isInteger(message.minCount.high))) + return "minCount: integer|Long expected"; + } + if (message.namePattern != null && message.hasOwnProperty("namePattern")) { + properties._namePattern = 1; + if (!$util.isString(message.namePattern)) + return "namePattern: string expected"; + } + if (message.perInstanceProperties != null && message.hasOwnProperty("perInstanceProperties")) { + if (!$util.isObject(message.perInstanceProperties)) + return "perInstanceProperties: object expected"; + var key = Object.keys(message.perInstanceProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.verify(message.perInstanceProperties[key[i]]); + if (error) + return "perInstanceProperties." + error; + } + } + if (message.sourceInstanceTemplate != null && message.hasOwnProperty("sourceInstanceTemplate")) { + properties._sourceInstanceTemplate = 1; + if (!$util.isString(message.sourceInstanceTemplate)) + return "sourceInstanceTemplate: string expected"; + } + return null; + }; + + /** + * Creates a BulkInsertInstanceResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BulkInsertInstanceResource} BulkInsertInstanceResource + */ + BulkInsertInstanceResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BulkInsertInstanceResource) + return object; + var message = new $root.google.cloud.compute.v1.BulkInsertInstanceResource(); + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + if (object.instanceProperties != null) { + if (typeof object.instanceProperties !== "object") + throw TypeError(".google.cloud.compute.v1.BulkInsertInstanceResource.instanceProperties: object expected"); + message.instanceProperties = $root.google.cloud.compute.v1.InstanceProperties.fromObject(object.instanceProperties); + } + if (object.locationPolicy != null) { + if (typeof object.locationPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.BulkInsertInstanceResource.locationPolicy: object expected"); + message.locationPolicy = $root.google.cloud.compute.v1.LocationPolicy.fromObject(object.locationPolicy); + } + if (object.minCount != null) + if ($util.Long) + (message.minCount = $util.Long.fromValue(object.minCount)).unsigned = false; + else if (typeof object.minCount === "string") + message.minCount = parseInt(object.minCount, 10); + else if (typeof object.minCount === "number") + message.minCount = object.minCount; + else if (typeof object.minCount === "object") + message.minCount = new $util.LongBits(object.minCount.low >>> 0, object.minCount.high >>> 0).toNumber(); + if (object.namePattern != null) + message.namePattern = String(object.namePattern); + if (object.perInstanceProperties) { + if (typeof object.perInstanceProperties !== "object") + throw TypeError(".google.cloud.compute.v1.BulkInsertInstanceResource.perInstanceProperties: object expected"); + message.perInstanceProperties = {}; + for (var keys = Object.keys(object.perInstanceProperties), i = 0; i < keys.length; ++i) { + if (typeof object.perInstanceProperties[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.BulkInsertInstanceResource.perInstanceProperties: object expected"); + message.perInstanceProperties[keys[i]] = $root.google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.fromObject(object.perInstanceProperties[keys[i]]); + } + } + if (object.sourceInstanceTemplate != null) + message.sourceInstanceTemplate = String(object.sourceInstanceTemplate); + return message; + }; + + /** + * Creates a plain object from a BulkInsertInstanceResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @static + * @param {google.cloud.compute.v1.BulkInsertInstanceResource} message BulkInsertInstanceResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkInsertInstanceResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.perInstanceProperties = {}; + if (message.count != null && message.hasOwnProperty("count")) { + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + if (options.oneofs) + object._count = "count"; + } + var keys2; + if (message.perInstanceProperties && (keys2 = Object.keys(message.perInstanceProperties)).length) { + object.perInstanceProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.perInstanceProperties[keys2[j]] = $root.google.cloud.compute.v1.BulkInsertInstanceResourcePerInstanceProperties.toObject(message.perInstanceProperties[keys2[j]], options); + } + if (message.instanceProperties != null && message.hasOwnProperty("instanceProperties")) { + object.instanceProperties = $root.google.cloud.compute.v1.InstanceProperties.toObject(message.instanceProperties, options); + if (options.oneofs) + object._instanceProperties = "instanceProperties"; + } + if (message.sourceInstanceTemplate != null && message.hasOwnProperty("sourceInstanceTemplate")) { + object.sourceInstanceTemplate = message.sourceInstanceTemplate; + if (options.oneofs) + object._sourceInstanceTemplate = "sourceInstanceTemplate"; + } + if (message.namePattern != null && message.hasOwnProperty("namePattern")) { + object.namePattern = message.namePattern; + if (options.oneofs) + object._namePattern = "namePattern"; + } + if (message.locationPolicy != null && message.hasOwnProperty("locationPolicy")) { + object.locationPolicy = $root.google.cloud.compute.v1.LocationPolicy.toObject(message.locationPolicy, options); + if (options.oneofs) + object._locationPolicy = "locationPolicy"; + } + if (message.minCount != null && message.hasOwnProperty("minCount")) { + if (typeof message.minCount === "number") + object.minCount = options.longs === String ? String(message.minCount) : message.minCount; + else + object.minCount = options.longs === String ? $util.Long.prototype.toString.call(message.minCount) : options.longs === Number ? new $util.LongBits(message.minCount.low >>> 0, message.minCount.high >>> 0).toNumber() : message.minCount; + if (options.oneofs) + object._minCount = "minCount"; + } + return object; + }; + + /** + * Converts this BulkInsertInstanceResource to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BulkInsertInstanceResource + * @instance + * @returns {Object.} JSON object + */ + BulkInsertInstanceResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BulkInsertInstanceResource; + })(); + + v1.CacheInvalidationRule = (function() { + + /** + * Properties of a CacheInvalidationRule. + * @memberof google.cloud.compute.v1 + * @interface ICacheInvalidationRule + * @property {string|null} [host] CacheInvalidationRule host + * @property {string|null} [path] CacheInvalidationRule path + */ + + /** + * Constructs a new CacheInvalidationRule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CacheInvalidationRule. + * @implements ICacheInvalidationRule + * @constructor + * @param {google.cloud.compute.v1.ICacheInvalidationRule=} [properties] Properties to set + */ + function CacheInvalidationRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CacheInvalidationRule host. + * @member {string|null|undefined} host + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @instance + */ + CacheInvalidationRule.prototype.host = null; + + /** + * CacheInvalidationRule path. + * @member {string|null|undefined} path + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @instance + */ + CacheInvalidationRule.prototype.path = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CacheInvalidationRule _host. + * @member {"host"|undefined} _host + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @instance + */ + Object.defineProperty(CacheInvalidationRule.prototype, "_host", { + get: $util.oneOfGetter($oneOfFields = ["host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CacheInvalidationRule _path. + * @member {"path"|undefined} _path + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @instance + */ + Object.defineProperty(CacheInvalidationRule.prototype, "_path", { + get: $util.oneOfGetter($oneOfFields = ["path"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CacheInvalidationRule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {google.cloud.compute.v1.ICacheInvalidationRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CacheInvalidationRule} CacheInvalidationRule instance + */ + CacheInvalidationRule.create = function create(properties) { + return new CacheInvalidationRule(properties); + }; + + /** + * Encodes the specified CacheInvalidationRule message. Does not implicitly {@link google.cloud.compute.v1.CacheInvalidationRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {google.cloud.compute.v1.ICacheInvalidationRule} message CacheInvalidationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheInvalidationRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3208616, wireType 2 =*/25668930).string(message.host); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3433509, wireType 2 =*/27468074).string(message.path); + return writer; + }; + + /** + * Encodes the specified CacheInvalidationRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CacheInvalidationRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {google.cloud.compute.v1.ICacheInvalidationRule} message CacheInvalidationRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CacheInvalidationRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CacheInvalidationRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CacheInvalidationRule} CacheInvalidationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheInvalidationRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CacheInvalidationRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3208616: + message.host = reader.string(); + break; + case 3433509: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CacheInvalidationRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CacheInvalidationRule} CacheInvalidationRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CacheInvalidationRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CacheInvalidationRule message. + * @function verify + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CacheInvalidationRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.host != null && message.hasOwnProperty("host")) { + properties._host = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.path != null && message.hasOwnProperty("path")) { + properties._path = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + return null; + }; + + /** + * Creates a CacheInvalidationRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CacheInvalidationRule} CacheInvalidationRule + */ + CacheInvalidationRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CacheInvalidationRule) + return object; + var message = new $root.google.cloud.compute.v1.CacheInvalidationRule(); + if (object.host != null) + message.host = String(object.host); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CacheInvalidationRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @static + * @param {google.cloud.compute.v1.CacheInvalidationRule} message CacheInvalidationRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CacheInvalidationRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object._host = "host"; + } + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object._path = "path"; + } + return object; + }; + + /** + * Converts this CacheInvalidationRule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CacheInvalidationRule + * @instance + * @returns {Object.} JSON object + */ + CacheInvalidationRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CacheInvalidationRule; + })(); + + v1.LicenseResourceCommitment = (function() { + + /** + * Properties of a LicenseResourceCommitment. + * @memberof google.cloud.compute.v1 + * @interface ILicenseResourceCommitment + * @property {number|Long|null} [amount] LicenseResourceCommitment amount + * @property {string|null} [coresPerLicense] LicenseResourceCommitment coresPerLicense + * @property {string|null} [license] LicenseResourceCommitment license + */ + + /** + * Constructs a new LicenseResourceCommitment. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LicenseResourceCommitment. + * @implements ILicenseResourceCommitment + * @constructor + * @param {google.cloud.compute.v1.ILicenseResourceCommitment=} [properties] Properties to set + */ + function LicenseResourceCommitment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LicenseResourceCommitment amount. + * @member {number|Long|null|undefined} amount + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @instance + */ + LicenseResourceCommitment.prototype.amount = null; + + /** + * LicenseResourceCommitment coresPerLicense. + * @member {string|null|undefined} coresPerLicense + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @instance + */ + LicenseResourceCommitment.prototype.coresPerLicense = null; + + /** + * LicenseResourceCommitment license. + * @member {string|null|undefined} license + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @instance + */ + LicenseResourceCommitment.prototype.license = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LicenseResourceCommitment _amount. + * @member {"amount"|undefined} _amount + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @instance + */ + Object.defineProperty(LicenseResourceCommitment.prototype, "_amount", { + get: $util.oneOfGetter($oneOfFields = ["amount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseResourceCommitment _coresPerLicense. + * @member {"coresPerLicense"|undefined} _coresPerLicense + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @instance + */ + Object.defineProperty(LicenseResourceCommitment.prototype, "_coresPerLicense", { + get: $util.oneOfGetter($oneOfFields = ["coresPerLicense"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseResourceCommitment _license. + * @member {"license"|undefined} _license + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @instance + */ + Object.defineProperty(LicenseResourceCommitment.prototype, "_license", { + get: $util.oneOfGetter($oneOfFields = ["license"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LicenseResourceCommitment instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {google.cloud.compute.v1.ILicenseResourceCommitment=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LicenseResourceCommitment} LicenseResourceCommitment instance + */ + LicenseResourceCommitment.create = function create(properties) { + return new LicenseResourceCommitment(properties); + }; + + /** + * Encodes the specified LicenseResourceCommitment message. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceCommitment.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {google.cloud.compute.v1.ILicenseResourceCommitment} message LicenseResourceCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseResourceCommitment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.coresPerLicense != null && Object.hasOwnProperty.call(message, "coresPerLicense")) + writer.uint32(/* id 32482324, wireType 2 =*/259858594).string(message.coresPerLicense); + if (message.license != null && Object.hasOwnProperty.call(message, "license")) + writer.uint32(/* id 166757441, wireType 2 =*/1334059530).string(message.license); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 196759640, wireType 0 =*/1574077120).int64(message.amount); + return writer; + }; + + /** + * Encodes the specified LicenseResourceCommitment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceCommitment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {google.cloud.compute.v1.ILicenseResourceCommitment} message LicenseResourceCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseResourceCommitment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LicenseResourceCommitment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LicenseResourceCommitment} LicenseResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseResourceCommitment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LicenseResourceCommitment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 196759640: + message.amount = reader.int64(); + break; + case 32482324: + message.coresPerLicense = reader.string(); + break; + case 166757441: + message.license = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LicenseResourceCommitment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LicenseResourceCommitment} LicenseResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseResourceCommitment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LicenseResourceCommitment message. + * @function verify + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LicenseResourceCommitment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.amount != null && message.hasOwnProperty("amount")) { + properties._amount = 1; + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + } + if (message.coresPerLicense != null && message.hasOwnProperty("coresPerLicense")) { + properties._coresPerLicense = 1; + if (!$util.isString(message.coresPerLicense)) + return "coresPerLicense: string expected"; + } + if (message.license != null && message.hasOwnProperty("license")) { + properties._license = 1; + if (!$util.isString(message.license)) + return "license: string expected"; + } + return null; + }; + + /** + * Creates a LicenseResourceCommitment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LicenseResourceCommitment} LicenseResourceCommitment + */ + LicenseResourceCommitment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LicenseResourceCommitment) + return object; + var message = new $root.google.cloud.compute.v1.LicenseResourceCommitment(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = false; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(); + if (object.coresPerLicense != null) + message.coresPerLicense = String(object.coresPerLicense); + if (object.license != null) + message.license = String(object.license); + return message; + }; + + /** + * Creates a plain object from a LicenseResourceCommitment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @static + * @param {google.cloud.compute.v1.LicenseResourceCommitment} message LicenseResourceCommitment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LicenseResourceCommitment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.coresPerLicense != null && message.hasOwnProperty("coresPerLicense")) { + object.coresPerLicense = message.coresPerLicense; + if (options.oneofs) + object._coresPerLicense = "coresPerLicense"; + } + if (message.license != null && message.hasOwnProperty("license")) { + object.license = message.license; + if (options.oneofs) + object._license = "license"; + } + if (message.amount != null && message.hasOwnProperty("amount")) { + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount; + if (options.oneofs) + object._amount = "amount"; + } + return object; + }; + + /** + * Converts this LicenseResourceCommitment to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LicenseResourceCommitment + * @instance + * @returns {Object.} JSON object + */ + LicenseResourceCommitment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LicenseResourceCommitment; + })(); + + v1.Reservation = (function() { + + /** + * Properties of a Reservation. + * @memberof google.cloud.compute.v1 + * @interface IReservation + * @property {string|null} [commitment] Reservation commitment + * @property {string|null} [creationTimestamp] Reservation creationTimestamp + * @property {string|null} [description] Reservation description + * @property {number|Long|null} [id] Reservation id + * @property {string|null} [kind] Reservation kind + * @property {string|null} [name] Reservation name + * @property {boolean|null} [satisfiesPzs] Reservation satisfiesPzs + * @property {string|null} [selfLink] Reservation selfLink + * @property {google.cloud.compute.v1.IAllocationSpecificSKUReservation|null} [specificReservation] Reservation specificReservation + * @property {boolean|null} [specificReservationRequired] Reservation specificReservationRequired + * @property {google.cloud.compute.v1.Reservation.Status|null} [status] Reservation status + * @property {string|null} [zone] Reservation zone + */ + + /** + * Constructs a new Reservation. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Reservation. + * @implements IReservation + * @constructor + * @param {google.cloud.compute.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 commitment. + * @member {string|null|undefined} commitment + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.commitment = null; + + /** + * Reservation creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.creationTimestamp = null; + + /** + * Reservation description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.description = null; + + /** + * Reservation id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.id = null; + + /** + * Reservation kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.kind = null; + + /** + * Reservation name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.name = null; + + /** + * Reservation satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.satisfiesPzs = null; + + /** + * Reservation selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.selfLink = null; + + /** + * Reservation specificReservation. + * @member {google.cloud.compute.v1.IAllocationSpecificSKUReservation|null|undefined} specificReservation + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.specificReservation = null; + + /** + * Reservation specificReservationRequired. + * @member {boolean|null|undefined} specificReservationRequired + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.specificReservationRequired = null; + + /** + * Reservation status. + * @member {google.cloud.compute.v1.Reservation.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.status = null; + + /** + * Reservation zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Reservation.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Reservation _commitment. + * @member {"commitment"|undefined} _commitment + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_commitment", { + get: $util.oneOfGetter($oneOfFields = ["commitment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _satisfiesPzs. + * @member {"satisfiesPzs"|undefined} _satisfiesPzs + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _specificReservation. + * @member {"specificReservation"|undefined} _specificReservation + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_specificReservation", { + get: $util.oneOfGetter($oneOfFields = ["specificReservation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _specificReservationRequired. + * @member {"specificReservationRequired"|undefined} _specificReservationRequired + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_specificReservationRequired", { + get: $util.oneOfGetter($oneOfFields = ["specificReservationRequired"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reservation _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.Reservation + * @instance + */ + Object.defineProperty(Reservation.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Reservation instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Reservation + * @static + * @param {google.cloud.compute.v1.IReservation=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Reservation} Reservation instance + */ + Reservation.create = function create(properties) { + return new Reservation(properties); + }; + + /** + * Encodes the specified Reservation message. Does not implicitly {@link google.cloud.compute.v1.Reservation.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Reservation + * @static + * @param {google.cloud.compute.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.specificReservationRequired != null && Object.hasOwnProperty.call(message, "specificReservationRequired")) + writer.uint32(/* id 226550687, wireType 0 =*/1812405496).bool(message.specificReservationRequired); + if (message.specificReservation != null && Object.hasOwnProperty.call(message, "specificReservation")) + $root.google.cloud.compute.v1.AllocationSpecificSKUReservation.encode(message.specificReservation, writer.uint32(/* id 404901951, wireType 2 =*/3239215610).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 480964267, wireType 0 =*/3847714136).bool(message.satisfiesPzs); + if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) + writer.uint32(/* id 482134805, wireType 2 =*/3857078442).string(message.commitment); + return writer; + }; + + /** + * Encodes the specified Reservation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Reservation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Reservation + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.Reservation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 482134805: + message.commitment = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 480964267: + message.satisfiesPzs = reader.bool(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 404901951: + message.specificReservation = $root.google.cloud.compute.v1.AllocationSpecificSKUReservation.decode(reader, reader.uint32()); + break; + case 226550687: + message.specificReservationRequired = reader.bool(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 3744684: + message.zone = reader.string(); + 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.compute.v1.Reservation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.commitment != null && message.hasOwnProperty("commitment")) { + properties._commitment = 1; + if (!$util.isString(message.commitment)) + return "commitment: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.specificReservation != null && message.hasOwnProperty("specificReservation")) { + properties._specificReservation = 1; + { + var error = $root.google.cloud.compute.v1.AllocationSpecificSKUReservation.verify(message.specificReservation); + if (error) + return "specificReservation." + error; + } + } + if (message.specificReservationRequired != null && message.hasOwnProperty("specificReservationRequired")) { + properties._specificReservationRequired = 1; + if (typeof message.specificReservationRequired !== "boolean") + return "specificReservationRequired: boolean expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 530283991: + case 77848963: + case 494614342: + break; + } + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a Reservation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Reservation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Reservation} Reservation + */ + Reservation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Reservation) + return object; + var message = new $root.google.cloud.compute.v1.Reservation(); + if (object.commitment != null) + message.commitment = String(object.commitment); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.specificReservation != null) { + if (typeof object.specificReservation !== "object") + throw TypeError(".google.cloud.compute.v1.Reservation.specificReservation: object expected"); + message.specificReservation = $root.google.cloud.compute.v1.AllocationSpecificSKUReservation.fromObject(object.specificReservation); + } + if (object.specificReservationRequired != null) + message.specificReservationRequired = Boolean(object.specificReservationRequired); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "INVALID": + case 530283991: + message.status = 530283991; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + case "UPDATING": + case 494614342: + message.status = 494614342; + break; + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a Reservation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Reservation + * @static + * @param {google.cloud.compute.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 (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Reservation.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.specificReservationRequired != null && message.hasOwnProperty("specificReservationRequired")) { + object.specificReservationRequired = message.specificReservationRequired; + if (options.oneofs) + object._specificReservationRequired = "specificReservationRequired"; + } + if (message.specificReservation != null && message.hasOwnProperty("specificReservation")) { + object.specificReservation = $root.google.cloud.compute.v1.AllocationSpecificSKUReservation.toObject(message.specificReservation, options); + if (options.oneofs) + object._specificReservation = "specificReservation"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.commitment != null && message.hasOwnProperty("commitment")) { + object.commitment = message.commitment; + if (options.oneofs) + object._commitment = "commitment"; + } + return object; + }; + + /** + * Converts this Reservation to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Reservation + * @instance + * @returns {Object.} JSON object + */ + Reservation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.Reservation.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} INVALID=530283991 INVALID value + * @property {number} READY=77848963 READY value + * @property {number} UPDATING=494614342 UPDATING value + */ + Reservation.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[77848963] = "READY"] = 77848963; + values[valuesById[494614342] = "UPDATING"] = 494614342; + return values; + })(); + + return Reservation; + })(); + + v1.ResourceCommitment = (function() { + + /** + * Properties of a ResourceCommitment. + * @memberof google.cloud.compute.v1 + * @interface IResourceCommitment + * @property {string|null} [acceleratorType] ResourceCommitment acceleratorType + * @property {number|Long|null} [amount] ResourceCommitment amount + * @property {google.cloud.compute.v1.ResourceCommitment.Type|null} [type] ResourceCommitment type + */ + + /** + * Constructs a new ResourceCommitment. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourceCommitment. + * @implements IResourceCommitment + * @constructor + * @param {google.cloud.compute.v1.IResourceCommitment=} [properties] Properties to set + */ + function ResourceCommitment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceCommitment acceleratorType. + * @member {string|null|undefined} acceleratorType + * @memberof google.cloud.compute.v1.ResourceCommitment + * @instance + */ + ResourceCommitment.prototype.acceleratorType = null; + + /** + * ResourceCommitment amount. + * @member {number|Long|null|undefined} amount + * @memberof google.cloud.compute.v1.ResourceCommitment + * @instance + */ + ResourceCommitment.prototype.amount = null; + + /** + * ResourceCommitment type. + * @member {google.cloud.compute.v1.ResourceCommitment.Type|null|undefined} type + * @memberof google.cloud.compute.v1.ResourceCommitment + * @instance + */ + ResourceCommitment.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourceCommitment _acceleratorType. + * @member {"acceleratorType"|undefined} _acceleratorType + * @memberof google.cloud.compute.v1.ResourceCommitment + * @instance + */ + Object.defineProperty(ResourceCommitment.prototype, "_acceleratorType", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourceCommitment _amount. + * @member {"amount"|undefined} _amount + * @memberof google.cloud.compute.v1.ResourceCommitment + * @instance + */ + Object.defineProperty(ResourceCommitment.prototype, "_amount", { + get: $util.oneOfGetter($oneOfFields = ["amount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourceCommitment _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.ResourceCommitment + * @instance + */ + Object.defineProperty(ResourceCommitment.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourceCommitment instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {google.cloud.compute.v1.IResourceCommitment=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourceCommitment} ResourceCommitment instance + */ + ResourceCommitment.create = function create(properties) { + return new ResourceCommitment(properties); + }; + + /** + * Encodes the specified ResourceCommitment message. Does not implicitly {@link google.cloud.compute.v1.ResourceCommitment.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {google.cloud.compute.v1.IResourceCommitment} message ResourceCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceCommitment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 138031246, wireType 2 =*/1104249970).string(message.acceleratorType); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 196759640, wireType 0 =*/1574077120).int64(message.amount); + return writer; + }; + + /** + * Encodes the specified ResourceCommitment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourceCommitment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {google.cloud.compute.v1.IResourceCommitment} message ResourceCommitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceCommitment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceCommitment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourceCommitment} ResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceCommitment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourceCommitment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 138031246: + message.acceleratorType = reader.string(); + break; + case 196759640: + message.amount = reader.int64(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceCommitment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourceCommitment} ResourceCommitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceCommitment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceCommitment message. + * @function verify + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceCommitment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + properties._acceleratorType = 1; + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + } + if (message.amount != null && message.hasOwnProperty("amount")) { + properties._amount = 1; + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 429815371: + case 508934896: + case 123056385: + case 526786327: + case 2628978: + break; + } + } + return null; + }; + + /** + * Creates a ResourceCommitment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourceCommitment} ResourceCommitment + */ + ResourceCommitment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourceCommitment) + return object; + var message = new $root.google.cloud.compute.v1.ResourceCommitment(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = false; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "ACCELERATOR": + case 429815371: + message.type = 429815371; + break; + case "LOCAL_SSD": + case 508934896: + message.type = 508934896; + break; + case "MEMORY": + case 123056385: + message.type = 123056385; + break; + case "UNSPECIFIED": + case 526786327: + message.type = 526786327; + break; + case "VCPU": + case 2628978: + message.type = 2628978; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourceCommitment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourceCommitment + * @static + * @param {google.cloud.compute.v1.ResourceCommitment} message ResourceCommitment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceCommitment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.ResourceCommitment.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + object.acceleratorType = message.acceleratorType; + if (options.oneofs) + object._acceleratorType = "acceleratorType"; + } + if (message.amount != null && message.hasOwnProperty("amount")) { + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount; + if (options.oneofs) + object._amount = "amount"; + } + return object; + }; + + /** + * Converts this ResourceCommitment to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourceCommitment + * @instance + * @returns {Object.} JSON object + */ + ResourceCommitment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.ResourceCommitment.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} ACCELERATOR=429815371 ACCELERATOR value + * @property {number} LOCAL_SSD=508934896 LOCAL_SSD value + * @property {number} MEMORY=123056385 MEMORY value + * @property {number} UNSPECIFIED=526786327 UNSPECIFIED value + * @property {number} VCPU=2628978 VCPU value + */ + ResourceCommitment.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[429815371] = "ACCELERATOR"] = 429815371; + values[valuesById[508934896] = "LOCAL_SSD"] = 508934896; + values[valuesById[123056385] = "MEMORY"] = 123056385; + values[valuesById[526786327] = "UNSPECIFIED"] = 526786327; + values[valuesById[2628978] = "VCPU"] = 2628978; + return values; + })(); + + return ResourceCommitment; + })(); + + v1.Commitment = (function() { + + /** + * Properties of a Commitment. + * @memberof google.cloud.compute.v1 + * @interface ICommitment + * @property {google.cloud.compute.v1.Commitment.Category|null} [category] Commitment category + * @property {string|null} [creationTimestamp] Commitment creationTimestamp + * @property {string|null} [description] Commitment description + * @property {string|null} [endTimestamp] Commitment endTimestamp + * @property {number|Long|null} [id] Commitment id + * @property {string|null} [kind] Commitment kind + * @property {google.cloud.compute.v1.ILicenseResourceCommitment|null} [licenseResource] Commitment licenseResource + * @property {string|null} [name] Commitment name + * @property {google.cloud.compute.v1.Commitment.Plan|null} [plan] Commitment plan + * @property {string|null} [region] Commitment region + * @property {Array.|null} [reservations] Commitment reservations + * @property {Array.|null} [resources] Commitment resources + * @property {string|null} [selfLink] Commitment selfLink + * @property {string|null} [startTimestamp] Commitment startTimestamp + * @property {google.cloud.compute.v1.Commitment.Status|null} [status] Commitment status + * @property {string|null} [statusMessage] Commitment statusMessage + */ + + /** + * Constructs a new Commitment. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Commitment. + * @implements ICommitment + * @constructor + * @param {google.cloud.compute.v1.ICommitment=} [properties] Properties to set + */ + function Commitment(properties) { + this.reservations = []; + this.resources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Commitment category. + * @member {google.cloud.compute.v1.Commitment.Category|null|undefined} category + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.category = null; + + /** + * Commitment creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.creationTimestamp = null; + + /** + * Commitment description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.description = null; + + /** + * Commitment endTimestamp. + * @member {string|null|undefined} endTimestamp + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.endTimestamp = null; + + /** + * Commitment id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.id = null; + + /** + * Commitment kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.kind = null; + + /** + * Commitment licenseResource. + * @member {google.cloud.compute.v1.ILicenseResourceCommitment|null|undefined} licenseResource + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.licenseResource = null; + + /** + * Commitment name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.name = null; + + /** + * Commitment plan. + * @member {google.cloud.compute.v1.Commitment.Plan|null|undefined} plan + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.plan = null; + + /** + * Commitment region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.region = null; + + /** + * Commitment reservations. + * @member {Array.} reservations + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.reservations = $util.emptyArray; + + /** + * Commitment resources. + * @member {Array.} resources + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.resources = $util.emptyArray; + + /** + * Commitment selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.selfLink = null; + + /** + * Commitment startTimestamp. + * @member {string|null|undefined} startTimestamp + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.startTimestamp = null; + + /** + * Commitment status. + * @member {google.cloud.compute.v1.Commitment.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.status = null; + + /** + * Commitment statusMessage. + * @member {string|null|undefined} statusMessage + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Commitment.prototype.statusMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Commitment _category. + * @member {"category"|undefined} _category + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_category", { + get: $util.oneOfGetter($oneOfFields = ["category"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _endTimestamp. + * @member {"endTimestamp"|undefined} _endTimestamp + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_endTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["endTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _licenseResource. + * @member {"licenseResource"|undefined} _licenseResource + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_licenseResource", { + get: $util.oneOfGetter($oneOfFields = ["licenseResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _plan. + * @member {"plan"|undefined} _plan + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_plan", { + get: $util.oneOfGetter($oneOfFields = ["plan"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _startTimestamp. + * @member {"startTimestamp"|undefined} _startTimestamp + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_startTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["startTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Commitment _statusMessage. + * @member {"statusMessage"|undefined} _statusMessage + * @memberof google.cloud.compute.v1.Commitment + * @instance + */ + Object.defineProperty(Commitment.prototype, "_statusMessage", { + get: $util.oneOfGetter($oneOfFields = ["statusMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Commitment instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {google.cloud.compute.v1.ICommitment=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Commitment} Commitment instance + */ + Commitment.create = function create(properties) { + return new Commitment(properties); + }; + + /** + * Encodes the specified Commitment message. Does not implicitly {@link google.cloud.compute.v1.Commitment.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {google.cloud.compute.v1.ICommitment} message Commitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commitment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.plan != null && Object.hasOwnProperty.call(message, "plan")) + writer.uint32(/* id 3443497, wireType 0 =*/27547976).int32(message.plan); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 50511102, wireType 0 =*/404088816).int32(message.category); + if (message.startTimestamp != null && Object.hasOwnProperty.call(message, "startTimestamp")) + writer.uint32(/* id 83645817, wireType 2 =*/669166538).string(message.startTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.compute.v1.ResourceCommitment.encode(message.resources[i], writer.uint32(/* id 164412965, wireType 2 =*/1315303722).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 297428154, wireType 2 =*/2379425234).string(message.statusMessage); + if (message.reservations != null && message.reservations.length) + for (var i = 0; i < message.reservations.length; ++i) + $root.google.cloud.compute.v1.Reservation.encode(message.reservations[i], writer.uint32(/* id 399717927, wireType 2 =*/3197743418).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.licenseResource != null && Object.hasOwnProperty.call(message, "licenseResource")) + $root.google.cloud.compute.v1.LicenseResourceCommitment.encode(message.licenseResource, writer.uint32(/* id 437955148, wireType 2 =*/3503641186).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.endTimestamp != null && Object.hasOwnProperty.call(message, "endTimestamp")) + writer.uint32(/* id 468096690, wireType 2 =*/3744773522).string(message.endTimestamp); + return writer; + }; + + /** + * Encodes the specified Commitment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Commitment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {google.cloud.compute.v1.ICommitment} message Commitment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Commitment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Commitment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Commitment} Commitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commitment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Commitment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 50511102: + message.category = reader.int32(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 468096690: + message.endTimestamp = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 437955148: + message.licenseResource = $root.google.cloud.compute.v1.LicenseResourceCommitment.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 3443497: + message.plan = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 399717927: + if (!(message.reservations && message.reservations.length)) + message.reservations = []; + message.reservations.push($root.google.cloud.compute.v1.Reservation.decode(reader, reader.uint32())); + break; + case 164412965: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.compute.v1.ResourceCommitment.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 83645817: + message.startTimestamp = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 297428154: + message.statusMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Commitment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Commitment} Commitment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Commitment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Commitment message. + * @function verify + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Commitment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.category != null && message.hasOwnProperty("category")) { + properties._category = 1; + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 509189462: + case 347869217: + case 469553191: + break; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) { + properties._endTimestamp = 1; + if (!$util.isString(message.endTimestamp)) + return "endTimestamp: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.licenseResource != null && message.hasOwnProperty("licenseResource")) { + properties._licenseResource = 1; + { + var error = $root.google.cloud.compute.v1.LicenseResourceCommitment.verify(message.licenseResource); + if (error) + return "licenseResource." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.plan != null && message.hasOwnProperty("plan")) { + properties._plan = 1; + switch (message.plan) { + default: + return "plan: enum value expected"; + case 0: + case 530283991: + case 266295942: + case 173083962: + break; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string 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.compute.v1.Reservation.verify(message.reservations[i]); + if (error) + return "reservations." + error; + } + } + 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.compute.v1.ResourceCommitment.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) { + properties._startTimestamp = 1; + if (!$util.isString(message.startTimestamp)) + return "startTimestamp: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 314733318: + case 455564985: + case 482489093: + case 20607337: + break; + } + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + properties._statusMessage = 1; + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + } + return null; + }; + + /** + * Creates a Commitment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Commitment} Commitment + */ + Commitment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Commitment) + return object; + var message = new $root.google.cloud.compute.v1.Commitment(); + switch (object.category) { + case "UNDEFINED_CATEGORY": + case 0: + message.category = 0; + break; + case "CATEGORY_UNSPECIFIED": + case 509189462: + message.category = 509189462; + break; + case "LICENSE": + case 347869217: + message.category = 347869217; + break; + case "MACHINE": + case 469553191: + message.category = 469553191; + break; + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.endTimestamp != null) + message.endTimestamp = String(object.endTimestamp); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.licenseResource != null) { + if (typeof object.licenseResource !== "object") + throw TypeError(".google.cloud.compute.v1.Commitment.licenseResource: object expected"); + message.licenseResource = $root.google.cloud.compute.v1.LicenseResourceCommitment.fromObject(object.licenseResource); + } + if (object.name != null) + message.name = String(object.name); + switch (object.plan) { + case "UNDEFINED_PLAN": + case 0: + message.plan = 0; + break; + case "INVALID": + case 530283991: + message.plan = 530283991; + break; + case "THIRTY_SIX_MONTH": + case 266295942: + message.plan = 266295942; + break; + case "TWELVE_MONTH": + case 173083962: + message.plan = 173083962; + break; + } + if (object.region != null) + message.region = String(object.region); + if (object.reservations) { + if (!Array.isArray(object.reservations)) + throw TypeError(".google.cloud.compute.v1.Commitment.reservations: array expected"); + message.reservations = []; + for (var i = 0; i < object.reservations.length; ++i) { + if (typeof object.reservations[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Commitment.reservations: object expected"); + message.reservations[i] = $root.google.cloud.compute.v1.Reservation.fromObject(object.reservations[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.compute.v1.Commitment.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Commitment.resources: object expected"); + message.resources[i] = $root.google.cloud.compute.v1.ResourceCommitment.fromObject(object.resources[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.startTimestamp != null) + message.startTimestamp = String(object.startTimestamp); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "ACTIVE": + case 314733318: + message.status = 314733318; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "EXPIRED": + case 482489093: + message.status = 482489093; + break; + case "NOT_YET_ACTIVE": + case 20607337: + message.status = 20607337; + break; + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + return message; + }; + + /** + * Creates a plain object from a Commitment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Commitment + * @static + * @param {google.cloud.compute.v1.Commitment} message Commitment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Commitment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.reservations = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.plan != null && message.hasOwnProperty("plan")) { + object.plan = options.enums === String ? $root.google.cloud.compute.v1.Commitment.Plan[message.plan] : message.plan; + if (options.oneofs) + object._plan = "plan"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.category != null && message.hasOwnProperty("category")) { + object.category = options.enums === String ? $root.google.cloud.compute.v1.Commitment.Category[message.category] : message.category; + if (options.oneofs) + object._category = "category"; + } + if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) { + object.startTimestamp = message.startTimestamp; + if (options.oneofs) + object._startTimestamp = "startTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.compute.v1.ResourceCommitment.toObject(message.resources[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Commitment.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + object.statusMessage = message.statusMessage; + if (options.oneofs) + object._statusMessage = "statusMessage"; + } + if (message.reservations && message.reservations.length) { + object.reservations = []; + for (var j = 0; j < message.reservations.length; ++j) + object.reservations[j] = $root.google.cloud.compute.v1.Reservation.toObject(message.reservations[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.licenseResource != null && message.hasOwnProperty("licenseResource")) { + object.licenseResource = $root.google.cloud.compute.v1.LicenseResourceCommitment.toObject(message.licenseResource, options); + if (options.oneofs) + object._licenseResource = "licenseResource"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.endTimestamp != null && message.hasOwnProperty("endTimestamp")) { + object.endTimestamp = message.endTimestamp; + if (options.oneofs) + object._endTimestamp = "endTimestamp"; + } + return object; + }; + + /** + * Converts this Commitment to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Commitment + * @instance + * @returns {Object.} JSON object + */ + Commitment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Category enum. + * @name google.cloud.compute.v1.Commitment.Category + * @enum {number} + * @property {number} UNDEFINED_CATEGORY=0 UNDEFINED_CATEGORY value + * @property {number} CATEGORY_UNSPECIFIED=509189462 CATEGORY_UNSPECIFIED value + * @property {number} LICENSE=347869217 LICENSE value + * @property {number} MACHINE=469553191 MACHINE value + */ + Commitment.Category = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CATEGORY"] = 0; + values[valuesById[509189462] = "CATEGORY_UNSPECIFIED"] = 509189462; + values[valuesById[347869217] = "LICENSE"] = 347869217; + values[valuesById[469553191] = "MACHINE"] = 469553191; + return values; + })(); + + /** + * Plan enum. + * @name google.cloud.compute.v1.Commitment.Plan + * @enum {number} + * @property {number} UNDEFINED_PLAN=0 UNDEFINED_PLAN value + * @property {number} INVALID=530283991 INVALID value + * @property {number} THIRTY_SIX_MONTH=266295942 THIRTY_SIX_MONTH value + * @property {number} TWELVE_MONTH=173083962 TWELVE_MONTH value + */ + Commitment.Plan = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PLAN"] = 0; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[266295942] = "THIRTY_SIX_MONTH"] = 266295942; + values[valuesById[173083962] = "TWELVE_MONTH"] = 173083962; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.Commitment.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} CREATING=455564985 CREATING value + * @property {number} EXPIRED=482489093 EXPIRED value + * @property {number} NOT_YET_ACTIVE=20607337 NOT_YET_ACTIVE value + */ + Commitment.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[482489093] = "EXPIRED"] = 482489093; + values[valuesById[20607337] = "NOT_YET_ACTIVE"] = 20607337; + return values; + })(); + + return Commitment; + })(); + + v1.CommitmentsScopedList = (function() { + + /** + * Properties of a CommitmentsScopedList. + * @memberof google.cloud.compute.v1 + * @interface ICommitmentsScopedList + * @property {Array.|null} [commitments] CommitmentsScopedList commitments + * @property {google.cloud.compute.v1.IWarning|null} [warning] CommitmentsScopedList warning + */ + + /** + * Constructs a new CommitmentsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CommitmentsScopedList. + * @implements ICommitmentsScopedList + * @constructor + * @param {google.cloud.compute.v1.ICommitmentsScopedList=} [properties] Properties to set + */ + function CommitmentsScopedList(properties) { + this.commitments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitmentsScopedList commitments. + * @member {Array.} commitments + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @instance + */ + CommitmentsScopedList.prototype.commitments = $util.emptyArray; + + /** + * CommitmentsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @instance + */ + CommitmentsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitmentsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @instance + */ + Object.defineProperty(CommitmentsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitmentsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {google.cloud.compute.v1.ICommitmentsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CommitmentsScopedList} CommitmentsScopedList instance + */ + CommitmentsScopedList.create = function create(properties) { + return new CommitmentsScopedList(properties); + }; + + /** + * Encodes the specified CommitmentsScopedList message. Does not implicitly {@link google.cloud.compute.v1.CommitmentsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {google.cloud.compute.v1.ICommitmentsScopedList} message CommitmentsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.commitments != null && message.commitments.length) + for (var i = 0; i < message.commitments.length; ++i) + $root.google.cloud.compute.v1.Commitment.encode(message.commitments[i], writer.uint32(/* id 450664446, wireType 2 =*/3605315570).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitmentsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CommitmentsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {google.cloud.compute.v1.ICommitmentsScopedList} message CommitmentsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitmentsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CommitmentsScopedList} CommitmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CommitmentsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 450664446: + if (!(message.commitments && message.commitments.length)) + message.commitments = []; + message.commitments.push($root.google.cloud.compute.v1.Commitment.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitmentsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CommitmentsScopedList} CommitmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitmentsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitmentsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commitments != null && message.hasOwnProperty("commitments")) { + if (!Array.isArray(message.commitments)) + return "commitments: array expected"; + for (var i = 0; i < message.commitments.length; ++i) { + var error = $root.google.cloud.compute.v1.Commitment.verify(message.commitments[i]); + if (error) + return "commitments." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a CommitmentsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CommitmentsScopedList} CommitmentsScopedList + */ + CommitmentsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CommitmentsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.CommitmentsScopedList(); + if (object.commitments) { + if (!Array.isArray(object.commitments)) + throw TypeError(".google.cloud.compute.v1.CommitmentsScopedList.commitments: array expected"); + message.commitments = []; + for (var i = 0; i < object.commitments.length; ++i) { + if (typeof object.commitments[i] !== "object") + throw TypeError(".google.cloud.compute.v1.CommitmentsScopedList.commitments: object expected"); + message.commitments[i] = $root.google.cloud.compute.v1.Commitment.fromObject(object.commitments[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.CommitmentsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a CommitmentsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @static + * @param {google.cloud.compute.v1.CommitmentsScopedList} message CommitmentsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitmentsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.commitments = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.commitments && message.commitments.length) { + object.commitments = []; + for (var j = 0; j < message.commitments.length; ++j) + object.commitments[j] = $root.google.cloud.compute.v1.Commitment.toObject(message.commitments[j], options); + } + return object; + }; + + /** + * Converts this CommitmentsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CommitmentsScopedList + * @instance + * @returns {Object.} JSON object + */ + CommitmentsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitmentsScopedList; + })(); + + v1.CommitmentAggregatedList = (function() { + + /** + * Properties of a CommitmentAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ICommitmentAggregatedList + * @property {string|null} [id] CommitmentAggregatedList id + * @property {Object.|null} [items] CommitmentAggregatedList items + * @property {string|null} [kind] CommitmentAggregatedList kind + * @property {string|null} [nextPageToken] CommitmentAggregatedList nextPageToken + * @property {string|null} [selfLink] CommitmentAggregatedList selfLink + * @property {Array.|null} [unreachables] CommitmentAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] CommitmentAggregatedList warning + */ + + /** + * Constructs a new CommitmentAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CommitmentAggregatedList. + * @implements ICommitmentAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ICommitmentAggregatedList=} [properties] Properties to set + */ + function CommitmentAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitmentAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + CommitmentAggregatedList.prototype.id = null; + + /** + * CommitmentAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + CommitmentAggregatedList.prototype.items = $util.emptyObject; + + /** + * CommitmentAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + CommitmentAggregatedList.prototype.kind = null; + + /** + * CommitmentAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + CommitmentAggregatedList.prototype.nextPageToken = null; + + /** + * CommitmentAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + CommitmentAggregatedList.prototype.selfLink = null; + + /** + * CommitmentAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + CommitmentAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * CommitmentAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + CommitmentAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitmentAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + Object.defineProperty(CommitmentAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + Object.defineProperty(CommitmentAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + Object.defineProperty(CommitmentAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + Object.defineProperty(CommitmentAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + */ + Object.defineProperty(CommitmentAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitmentAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {google.cloud.compute.v1.ICommitmentAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CommitmentAggregatedList} CommitmentAggregatedList instance + */ + CommitmentAggregatedList.create = function create(properties) { + return new CommitmentAggregatedList(properties); + }; + + /** + * Encodes the specified CommitmentAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.CommitmentAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {google.cloud.compute.v1.ICommitmentAggregatedList} message CommitmentAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.CommitmentsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified CommitmentAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CommitmentAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {google.cloud.compute.v1.ICommitmentAggregatedList} message CommitmentAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitmentAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CommitmentAggregatedList} CommitmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CommitmentAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.CommitmentsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitmentAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CommitmentAggregatedList} CommitmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitmentAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitmentAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.CommitmentsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a CommitmentAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CommitmentAggregatedList} CommitmentAggregatedList + */ + CommitmentAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CommitmentAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.CommitmentAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.CommitmentAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.CommitmentAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.CommitmentsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.CommitmentAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.CommitmentAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a CommitmentAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @static + * @param {google.cloud.compute.v1.CommitmentAggregatedList} message CommitmentAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitmentAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.CommitmentsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this CommitmentAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CommitmentAggregatedList + * @instance + * @returns {Object.} JSON object + */ + CommitmentAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitmentAggregatedList; + })(); + + v1.CommitmentList = (function() { + + /** + * Properties of a CommitmentList. + * @memberof google.cloud.compute.v1 + * @interface ICommitmentList + * @property {string|null} [id] CommitmentList id + * @property {Array.|null} [items] CommitmentList items + * @property {string|null} [kind] CommitmentList kind + * @property {string|null} [nextPageToken] CommitmentList nextPageToken + * @property {string|null} [selfLink] CommitmentList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] CommitmentList warning + */ + + /** + * Constructs a new CommitmentList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CommitmentList. + * @implements ICommitmentList + * @constructor + * @param {google.cloud.compute.v1.ICommitmentList=} [properties] Properties to set + */ + function CommitmentList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommitmentList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + CommitmentList.prototype.id = null; + + /** + * CommitmentList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + CommitmentList.prototype.items = $util.emptyArray; + + /** + * CommitmentList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + CommitmentList.prototype.kind = null; + + /** + * CommitmentList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + CommitmentList.prototype.nextPageToken = null; + + /** + * CommitmentList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + CommitmentList.prototype.selfLink = null; + + /** + * CommitmentList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + CommitmentList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitmentList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + Object.defineProperty(CommitmentList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + Object.defineProperty(CommitmentList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + Object.defineProperty(CommitmentList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + Object.defineProperty(CommitmentList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CommitmentList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + */ + Object.defineProperty(CommitmentList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitmentList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {google.cloud.compute.v1.ICommitmentList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CommitmentList} CommitmentList instance + */ + CommitmentList.create = function create(properties) { + return new CommitmentList(properties); + }; + + /** + * Encodes the specified CommitmentList message. Does not implicitly {@link google.cloud.compute.v1.CommitmentList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {google.cloud.compute.v1.ICommitmentList} message CommitmentList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Commitment.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified CommitmentList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CommitmentList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {google.cloud.compute.v1.ICommitmentList} message CommitmentList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommitmentList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommitmentList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CommitmentList} CommitmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CommitmentList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Commitment.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommitmentList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CommitmentList} CommitmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommitmentList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommitmentList message. + * @function verify + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommitmentList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Commitment.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a CommitmentList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CommitmentList} CommitmentList + */ + CommitmentList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CommitmentList) + return object; + var message = new $root.google.cloud.compute.v1.CommitmentList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.CommitmentList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.CommitmentList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Commitment.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.CommitmentList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a CommitmentList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CommitmentList + * @static + * @param {google.cloud.compute.v1.CommitmentList} message CommitmentList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommitmentList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Commitment.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this CommitmentList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CommitmentList + * @instance + * @returns {Object.} JSON object + */ + CommitmentList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CommitmentList; + })(); + + v1.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.cloud.compute.v1 + * @interface ICondition + * @property {string|null} [iam] Condition iam + * @property {string|null} [op] Condition op + * @property {string|null} [svc] Condition svc + * @property {string|null} [sys] Condition sys + * @property {Array.|null} [values] Condition values + */ + + /** + * Constructs a new Condition. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.cloud.compute.v1.ICondition=} [properties] Properties to set + */ + function Condition(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]]; + } + + /** + * Condition iam. + * @member {string|null|undefined} iam + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Condition.prototype.iam = null; + + /** + * Condition op. + * @member {string|null|undefined} op + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Condition.prototype.op = null; + + /** + * Condition svc. + * @member {string|null|undefined} svc + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Condition.prototype.svc = null; + + /** + * Condition sys. + * @member {string|null|undefined} sys + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Condition.prototype.sys = null; + + /** + * Condition values. + * @member {Array.} values + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Condition.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Condition _iam. + * @member {"iam"|undefined} _iam + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Object.defineProperty(Condition.prototype, "_iam", { + get: $util.oneOfGetter($oneOfFields = ["iam"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Condition _op. + * @member {"op"|undefined} _op + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Object.defineProperty(Condition.prototype, "_op", { + get: $util.oneOfGetter($oneOfFields = ["op"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Condition _svc. + * @member {"svc"|undefined} _svc + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Object.defineProperty(Condition.prototype, "_svc", { + get: $util.oneOfGetter($oneOfFields = ["svc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Condition _sys. + * @member {"sys"|undefined} _sys + * @memberof google.cloud.compute.v1.Condition + * @instance + */ + Object.defineProperty(Condition.prototype, "_sys", { + get: $util.oneOfGetter($oneOfFields = ["sys"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {google.cloud.compute.v1.ICondition=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.cloud.compute.v1.Condition.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {google.cloud.compute.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 3553, wireType 2 =*/28426).string(message.op); + if (message.iam != null && Object.hasOwnProperty.call(message, "iam")) + writer.uint32(/* id 104021, wireType 2 =*/832170).string(message.iam); + if (message.svc != null && Object.hasOwnProperty.call(message, "svc")) + writer.uint32(/* id 114272, wireType 2 =*/914178).string(message.svc); + if (message.sys != null && Object.hasOwnProperty.call(message, "sys")) + writer.uint32(/* id 114381, wireType 2 =*/915050).string(message.sys); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 249928994, wireType 2 =*/1999431954).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {google.cloud.compute.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 104021: + message.iam = reader.string(); + break; + case 3553: + message.op = reader.string(); + break; + case 114272: + message.svc = reader.string(); + break; + case 114381: + message.sys = reader.string(); + break; + case 249928994: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.iam != null && message.hasOwnProperty("iam")) { + properties._iam = 1; + if (!$util.isString(message.iam)) + return "iam: string expected"; + } + if (message.op != null && message.hasOwnProperty("op")) { + properties._op = 1; + if (!$util.isString(message.op)) + return "op: string expected"; + } + if (message.svc != null && message.hasOwnProperty("svc")) { + properties._svc = 1; + if (!$util.isString(message.svc)) + return "svc: string expected"; + } + if (message.sys != null && message.hasOwnProperty("sys")) { + properties._sys = 1; + if (!$util.isString(message.sys)) + return "sys: 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"; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Condition) + return object; + var message = new $root.google.cloud.compute.v1.Condition(); + if (object.iam != null) + message.iam = String(object.iam); + if (object.op != null) + message.op = String(object.op); + if (object.svc != null) + message.svc = String(object.svc); + if (object.sys != null) + message.sys = String(object.sys); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.compute.v1.Condition.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Condition + * @static + * @param {google.cloud.compute.v1.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.op != null && message.hasOwnProperty("op")) { + object.op = message.op; + if (options.oneofs) + object._op = "op"; + } + if (message.iam != null && message.hasOwnProperty("iam")) { + object.iam = message.iam; + if (options.oneofs) + object._iam = "iam"; + } + if (message.svc != null && message.hasOwnProperty("svc")) { + object.svc = message.svc; + if (options.oneofs) + object._svc = "svc"; + } + if (message.sys != null && message.hasOwnProperty("sys")) { + object.sys = message.sys; + if (options.oneofs) + object._sys = "sys"; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Condition; + })(); + + v1.ConfidentialInstanceConfig = (function() { + + /** + * Properties of a ConfidentialInstanceConfig. + * @memberof google.cloud.compute.v1 + * @interface IConfidentialInstanceConfig + * @property {boolean|null} [enableConfidentialCompute] ConfidentialInstanceConfig enableConfidentialCompute + */ + + /** + * Constructs a new ConfidentialInstanceConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ConfidentialInstanceConfig. + * @implements IConfidentialInstanceConfig + * @constructor + * @param {google.cloud.compute.v1.IConfidentialInstanceConfig=} [properties] Properties to set + */ + function ConfidentialInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidentialInstanceConfig enableConfidentialCompute. + * @member {boolean|null|undefined} enableConfidentialCompute + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @instance + */ + ConfidentialInstanceConfig.prototype.enableConfidentialCompute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConfidentialInstanceConfig _enableConfidentialCompute. + * @member {"enableConfidentialCompute"|undefined} _enableConfidentialCompute + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @instance + */ + Object.defineProperty(ConfidentialInstanceConfig.prototype, "_enableConfidentialCompute", { + get: $util.oneOfGetter($oneOfFields = ["enableConfidentialCompute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.compute.v1.IConfidentialInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig instance + */ + ConfidentialInstanceConfig.create = function create(properties) { + return new ConfidentialInstanceConfig(properties); + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.compute.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.compute.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) + writer.uint32(/* id 102135228, wireType 0 =*/817081824).bool(message.enableConfidentialCompute); + return writer; + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.compute.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ConfidentialInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 102135228: + message.enableConfidentialCompute = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @function verify + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidentialInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + properties._enableConfidentialCompute = 1; + if (typeof message.enableConfidentialCompute !== "boolean") + return "enableConfidentialCompute: boolean expected"; + } + return null; + }; + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + */ + ConfidentialInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ConfidentialInstanceConfig) + return object; + var message = new $root.google.cloud.compute.v1.ConfidentialInstanceConfig(); + if (object.enableConfidentialCompute != null) + message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); + return message; + }; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.compute.v1.ConfidentialInstanceConfig} message ConfidentialInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidentialInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + object.enableConfidentialCompute = message.enableConfidentialCompute; + if (options.oneofs) + object._enableConfidentialCompute = "enableConfidentialCompute"; + } + return object; + }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ConfidentialInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ConfidentialInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConfidentialInstanceConfig; + })(); + + v1.ConsistentHashLoadBalancerSettingsHttpCookie = (function() { + + /** + * Properties of a ConsistentHashLoadBalancerSettingsHttpCookie. + * @memberof google.cloud.compute.v1 + * @interface IConsistentHashLoadBalancerSettingsHttpCookie + * @property {string|null} [name] ConsistentHashLoadBalancerSettingsHttpCookie name + * @property {string|null} [path] ConsistentHashLoadBalancerSettingsHttpCookie path + * @property {google.cloud.compute.v1.IDuration|null} [ttl] ConsistentHashLoadBalancerSettingsHttpCookie ttl + */ + + /** + * Constructs a new ConsistentHashLoadBalancerSettingsHttpCookie. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ConsistentHashLoadBalancerSettingsHttpCookie. + * @implements IConsistentHashLoadBalancerSettingsHttpCookie + * @constructor + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie=} [properties] Properties to set + */ + function ConsistentHashLoadBalancerSettingsHttpCookie(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsistentHashLoadBalancerSettingsHttpCookie name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @instance + */ + ConsistentHashLoadBalancerSettingsHttpCookie.prototype.name = null; + + /** + * ConsistentHashLoadBalancerSettingsHttpCookie path. + * @member {string|null|undefined} path + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @instance + */ + ConsistentHashLoadBalancerSettingsHttpCookie.prototype.path = null; + + /** + * ConsistentHashLoadBalancerSettingsHttpCookie ttl. + * @member {google.cloud.compute.v1.IDuration|null|undefined} ttl + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @instance + */ + ConsistentHashLoadBalancerSettingsHttpCookie.prototype.ttl = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConsistentHashLoadBalancerSettingsHttpCookie _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @instance + */ + Object.defineProperty(ConsistentHashLoadBalancerSettingsHttpCookie.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ConsistentHashLoadBalancerSettingsHttpCookie _path. + * @member {"path"|undefined} _path + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @instance + */ + Object.defineProperty(ConsistentHashLoadBalancerSettingsHttpCookie.prototype, "_path", { + get: $util.oneOfGetter($oneOfFields = ["path"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ConsistentHashLoadBalancerSettingsHttpCookie _ttl. + * @member {"ttl"|undefined} _ttl + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @instance + */ + Object.defineProperty(ConsistentHashLoadBalancerSettingsHttpCookie.prototype, "_ttl", { + get: $util.oneOfGetter($oneOfFields = ["ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConsistentHashLoadBalancerSettingsHttpCookie instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie} ConsistentHashLoadBalancerSettingsHttpCookie instance + */ + ConsistentHashLoadBalancerSettingsHttpCookie.create = function create(properties) { + return new ConsistentHashLoadBalancerSettingsHttpCookie(properties); + }; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettingsHttpCookie message. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie} message ConsistentHashLoadBalancerSettingsHttpCookie message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsistentHashLoadBalancerSettingsHttpCookie.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.cloud.compute.v1.Duration.encode(message.ttl, writer.uint32(/* id 115180, wireType 2 =*/921442).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3433509, wireType 2 =*/27468074).string(message.path); + return writer; + }; + + /** + * Encodes the specified ConsistentHashLoadBalancerSettingsHttpCookie message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {google.cloud.compute.v1.IConsistentHashLoadBalancerSettingsHttpCookie} message ConsistentHashLoadBalancerSettingsHttpCookie message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsistentHashLoadBalancerSettingsHttpCookie.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsistentHashLoadBalancerSettingsHttpCookie message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie} ConsistentHashLoadBalancerSettingsHttpCookie + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsistentHashLoadBalancerSettingsHttpCookie.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + case 3433509: + message.path = reader.string(); + break; + case 115180: + message.ttl = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsistentHashLoadBalancerSettingsHttpCookie message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie} ConsistentHashLoadBalancerSettingsHttpCookie + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsistentHashLoadBalancerSettingsHttpCookie.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsistentHashLoadBalancerSettingsHttpCookie message. + * @function verify + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsistentHashLoadBalancerSettingsHttpCookie.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.path != null && message.hasOwnProperty("path")) { + properties._path = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + properties._ttl = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + return null; + }; + + /** + * Creates a ConsistentHashLoadBalancerSettingsHttpCookie message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie} ConsistentHashLoadBalancerSettingsHttpCookie + */ + ConsistentHashLoadBalancerSettingsHttpCookie.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie) + return object; + var message = new $root.google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie(); + if (object.name != null) + message.name = String(object.name); + if (object.path != null) + message.path = String(object.path); + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie.ttl: object expected"); + message.ttl = $root.google.cloud.compute.v1.Duration.fromObject(object.ttl); + } + return message; + }; + + /** + * Creates a plain object from a ConsistentHashLoadBalancerSettingsHttpCookie message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @static + * @param {google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie} message ConsistentHashLoadBalancerSettingsHttpCookie + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsistentHashLoadBalancerSettingsHttpCookie.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.cloud.compute.v1.Duration.toObject(message.ttl, options); + if (options.oneofs) + object._ttl = "ttl"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object._path = "path"; + } + return object; + }; + + /** + * Converts this ConsistentHashLoadBalancerSettingsHttpCookie to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ConsistentHashLoadBalancerSettingsHttpCookie + * @instance + * @returns {Object.} JSON object + */ + ConsistentHashLoadBalancerSettingsHttpCookie.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsistentHashLoadBalancerSettingsHttpCookie; + })(); + + v1.CorsPolicy = (function() { + + /** + * Properties of a CorsPolicy. + * @memberof google.cloud.compute.v1 + * @interface ICorsPolicy + * @property {boolean|null} [allowCredentials] CorsPolicy allowCredentials + * @property {Array.|null} [allowHeaders] CorsPolicy allowHeaders + * @property {Array.|null} [allowMethods] CorsPolicy allowMethods + * @property {Array.|null} [allowOriginRegexes] CorsPolicy allowOriginRegexes + * @property {Array.|null} [allowOrigins] CorsPolicy allowOrigins + * @property {boolean|null} [disabled] CorsPolicy disabled + * @property {Array.|null} [exposeHeaders] CorsPolicy exposeHeaders + * @property {number|null} [maxAge] CorsPolicy maxAge + */ + + /** + * Constructs a new CorsPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CorsPolicy. + * @implements ICorsPolicy + * @constructor + * @param {google.cloud.compute.v1.ICorsPolicy=} [properties] Properties to set + */ + function CorsPolicy(properties) { + this.allowHeaders = []; + this.allowMethods = []; + this.allowOriginRegexes = []; + this.allowOrigins = []; + this.exposeHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorsPolicy allowCredentials. + * @member {boolean|null|undefined} allowCredentials + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowCredentials = null; + + /** + * CorsPolicy allowHeaders. + * @member {Array.} allowHeaders + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowHeaders = $util.emptyArray; + + /** + * CorsPolicy allowMethods. + * @member {Array.} allowMethods + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowMethods = $util.emptyArray; + + /** + * CorsPolicy allowOriginRegexes. + * @member {Array.} allowOriginRegexes + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowOriginRegexes = $util.emptyArray; + + /** + * CorsPolicy allowOrigins. + * @member {Array.} allowOrigins + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.allowOrigins = $util.emptyArray; + + /** + * CorsPolicy disabled. + * @member {boolean|null|undefined} disabled + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.disabled = null; + + /** + * CorsPolicy exposeHeaders. + * @member {Array.} exposeHeaders + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.exposeHeaders = $util.emptyArray; + + /** + * CorsPolicy maxAge. + * @member {number|null|undefined} maxAge + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + CorsPolicy.prototype.maxAge = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CorsPolicy _allowCredentials. + * @member {"allowCredentials"|undefined} _allowCredentials + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + Object.defineProperty(CorsPolicy.prototype, "_allowCredentials", { + get: $util.oneOfGetter($oneOfFields = ["allowCredentials"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CorsPolicy _disabled. + * @member {"disabled"|undefined} _disabled + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + Object.defineProperty(CorsPolicy.prototype, "_disabled", { + get: $util.oneOfGetter($oneOfFields = ["disabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CorsPolicy _maxAge. + * @member {"maxAge"|undefined} _maxAge + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + */ + Object.defineProperty(CorsPolicy.prototype, "_maxAge", { + get: $util.oneOfGetter($oneOfFields = ["maxAge"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CorsPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {google.cloud.compute.v1.ICorsPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CorsPolicy} CorsPolicy instance + */ + CorsPolicy.create = function create(properties) { + return new CorsPolicy(properties); + }; + + /** + * Encodes the specified CorsPolicy message. Does not implicitly {@link google.cloud.compute.v1.CorsPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {google.cloud.compute.v1.ICorsPolicy} message CorsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorsPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowHeaders != null && message.allowHeaders.length) + for (var i = 0; i < message.allowHeaders.length; ++i) + writer.uint32(/* id 45179024, wireType 2 =*/361432194).string(message.allowHeaders[i]); + if (message.allowOrigins != null && message.allowOrigins.length) + for (var i = 0; i < message.allowOrigins.length; ++i) + writer.uint32(/* id 194914071, wireType 2 =*/1559312570).string(message.allowOrigins[i]); + if (message.allowMethods != null && message.allowMethods.length) + for (var i = 0; i < message.allowMethods.length; ++i) + writer.uint32(/* id 205405372, wireType 2 =*/1643242978).string(message.allowMethods[i]); + if (message.allowOriginRegexes != null && message.allowOriginRegexes.length) + for (var i = 0; i < message.allowOriginRegexes.length; ++i) + writer.uint32(/* id 215385810, wireType 2 =*/1723086482).string(message.allowOriginRegexes[i]); + if (message.exposeHeaders != null && message.exposeHeaders.length) + for (var i = 0; i < message.exposeHeaders.length; ++i) + writer.uint32(/* id 247604747, wireType 2 =*/1980837978).string(message.exposeHeaders[i]); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 270940796, wireType 0 =*/2167526368).bool(message.disabled); + if (message.maxAge != null && Object.hasOwnProperty.call(message, "maxAge")) + writer.uint32(/* id 307559332, wireType 0 =*/2460474656).int32(message.maxAge); + if (message.allowCredentials != null && Object.hasOwnProperty.call(message, "allowCredentials")) + writer.uint32(/* id 481263366, wireType 0 =*/3850106928).bool(message.allowCredentials); + return writer; + }; + + /** + * Encodes the specified CorsPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CorsPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {google.cloud.compute.v1.ICorsPolicy} message CorsPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorsPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CorsPolicy} CorsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorsPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CorsPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 481263366: + message.allowCredentials = reader.bool(); + break; + case 45179024: + if (!(message.allowHeaders && message.allowHeaders.length)) + message.allowHeaders = []; + message.allowHeaders.push(reader.string()); + break; + case 205405372: + if (!(message.allowMethods && message.allowMethods.length)) + message.allowMethods = []; + message.allowMethods.push(reader.string()); + break; + case 215385810: + if (!(message.allowOriginRegexes && message.allowOriginRegexes.length)) + message.allowOriginRegexes = []; + message.allowOriginRegexes.push(reader.string()); + break; + case 194914071: + if (!(message.allowOrigins && message.allowOrigins.length)) + message.allowOrigins = []; + message.allowOrigins.push(reader.string()); + break; + case 270940796: + message.disabled = reader.bool(); + break; + case 247604747: + if (!(message.exposeHeaders && message.exposeHeaders.length)) + message.exposeHeaders = []; + message.exposeHeaders.push(reader.string()); + break; + case 307559332: + message.maxAge = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorsPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CorsPolicy} CorsPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorsPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorsPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorsPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allowCredentials != null && message.hasOwnProperty("allowCredentials")) { + properties._allowCredentials = 1; + if (typeof message.allowCredentials !== "boolean") + return "allowCredentials: boolean expected"; + } + if (message.allowHeaders != null && message.hasOwnProperty("allowHeaders")) { + if (!Array.isArray(message.allowHeaders)) + return "allowHeaders: array expected"; + for (var i = 0; i < message.allowHeaders.length; ++i) + if (!$util.isString(message.allowHeaders[i])) + return "allowHeaders: string[] expected"; + } + if (message.allowMethods != null && message.hasOwnProperty("allowMethods")) { + if (!Array.isArray(message.allowMethods)) + return "allowMethods: array expected"; + for (var i = 0; i < message.allowMethods.length; ++i) + if (!$util.isString(message.allowMethods[i])) + return "allowMethods: string[] expected"; + } + if (message.allowOriginRegexes != null && message.hasOwnProperty("allowOriginRegexes")) { + if (!Array.isArray(message.allowOriginRegexes)) + return "allowOriginRegexes: array expected"; + for (var i = 0; i < message.allowOriginRegexes.length; ++i) + if (!$util.isString(message.allowOriginRegexes[i])) + return "allowOriginRegexes: string[] expected"; + } + if (message.allowOrigins != null && message.hasOwnProperty("allowOrigins")) { + if (!Array.isArray(message.allowOrigins)) + return "allowOrigins: array expected"; + for (var i = 0; i < message.allowOrigins.length; ++i) + if (!$util.isString(message.allowOrigins[i])) + return "allowOrigins: string[] expected"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + properties._disabled = 1; + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + } + if (message.exposeHeaders != null && message.hasOwnProperty("exposeHeaders")) { + if (!Array.isArray(message.exposeHeaders)) + return "exposeHeaders: array expected"; + for (var i = 0; i < message.exposeHeaders.length; ++i) + if (!$util.isString(message.exposeHeaders[i])) + return "exposeHeaders: string[] expected"; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) { + properties._maxAge = 1; + if (!$util.isInteger(message.maxAge)) + return "maxAge: integer expected"; + } + return null; + }; + + /** + * Creates a CorsPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CorsPolicy} CorsPolicy + */ + CorsPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CorsPolicy) + return object; + var message = new $root.google.cloud.compute.v1.CorsPolicy(); + if (object.allowCredentials != null) + message.allowCredentials = Boolean(object.allowCredentials); + if (object.allowHeaders) { + if (!Array.isArray(object.allowHeaders)) + throw TypeError(".google.cloud.compute.v1.CorsPolicy.allowHeaders: array expected"); + message.allowHeaders = []; + for (var i = 0; i < object.allowHeaders.length; ++i) + message.allowHeaders[i] = String(object.allowHeaders[i]); + } + if (object.allowMethods) { + if (!Array.isArray(object.allowMethods)) + throw TypeError(".google.cloud.compute.v1.CorsPolicy.allowMethods: array expected"); + message.allowMethods = []; + for (var i = 0; i < object.allowMethods.length; ++i) + message.allowMethods[i] = String(object.allowMethods[i]); + } + if (object.allowOriginRegexes) { + if (!Array.isArray(object.allowOriginRegexes)) + throw TypeError(".google.cloud.compute.v1.CorsPolicy.allowOriginRegexes: array expected"); + message.allowOriginRegexes = []; + for (var i = 0; i < object.allowOriginRegexes.length; ++i) + message.allowOriginRegexes[i] = String(object.allowOriginRegexes[i]); + } + if (object.allowOrigins) { + if (!Array.isArray(object.allowOrigins)) + throw TypeError(".google.cloud.compute.v1.CorsPolicy.allowOrigins: array expected"); + message.allowOrigins = []; + for (var i = 0; i < object.allowOrigins.length; ++i) + message.allowOrigins[i] = String(object.allowOrigins[i]); + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.exposeHeaders) { + if (!Array.isArray(object.exposeHeaders)) + throw TypeError(".google.cloud.compute.v1.CorsPolicy.exposeHeaders: array expected"); + message.exposeHeaders = []; + for (var i = 0; i < object.exposeHeaders.length; ++i) + message.exposeHeaders[i] = String(object.exposeHeaders[i]); + } + if (object.maxAge != null) + message.maxAge = object.maxAge | 0; + return message; + }; + + /** + * Creates a plain object from a CorsPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CorsPolicy + * @static + * @param {google.cloud.compute.v1.CorsPolicy} message CorsPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorsPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowHeaders = []; + object.allowOrigins = []; + object.allowMethods = []; + object.allowOriginRegexes = []; + object.exposeHeaders = []; + } + if (message.allowHeaders && message.allowHeaders.length) { + object.allowHeaders = []; + for (var j = 0; j < message.allowHeaders.length; ++j) + object.allowHeaders[j] = message.allowHeaders[j]; + } + if (message.allowOrigins && message.allowOrigins.length) { + object.allowOrigins = []; + for (var j = 0; j < message.allowOrigins.length; ++j) + object.allowOrigins[j] = message.allowOrigins[j]; + } + if (message.allowMethods && message.allowMethods.length) { + object.allowMethods = []; + for (var j = 0; j < message.allowMethods.length; ++j) + object.allowMethods[j] = message.allowMethods[j]; + } + if (message.allowOriginRegexes && message.allowOriginRegexes.length) { + object.allowOriginRegexes = []; + for (var j = 0; j < message.allowOriginRegexes.length; ++j) + object.allowOriginRegexes[j] = message.allowOriginRegexes[j]; + } + if (message.exposeHeaders && message.exposeHeaders.length) { + object.exposeHeaders = []; + for (var j = 0; j < message.exposeHeaders.length; ++j) + object.exposeHeaders[j] = message.exposeHeaders[j]; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + object.disabled = message.disabled; + if (options.oneofs) + object._disabled = "disabled"; + } + if (message.maxAge != null && message.hasOwnProperty("maxAge")) { + object.maxAge = message.maxAge; + if (options.oneofs) + object._maxAge = "maxAge"; + } + if (message.allowCredentials != null && message.hasOwnProperty("allowCredentials")) { + object.allowCredentials = message.allowCredentials; + if (options.oneofs) + object._allowCredentials = "allowCredentials"; + } + return object; + }; + + /** + * Converts this CorsPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CorsPolicy + * @instance + * @returns {Object.} JSON object + */ + CorsPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CorsPolicy; + })(); + + v1.CustomerEncryptionKeyProtectedDisk = (function() { + + /** + * Properties of a CustomerEncryptionKeyProtectedDisk. + * @memberof google.cloud.compute.v1 + * @interface ICustomerEncryptionKeyProtectedDisk + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] CustomerEncryptionKeyProtectedDisk diskEncryptionKey + * @property {string|null} [source] CustomerEncryptionKeyProtectedDisk source + */ + + /** + * Constructs a new CustomerEncryptionKeyProtectedDisk. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CustomerEncryptionKeyProtectedDisk. + * @implements ICustomerEncryptionKeyProtectedDisk + * @constructor + * @param {google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk=} [properties] Properties to set + */ + function CustomerEncryptionKeyProtectedDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerEncryptionKeyProtectedDisk diskEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @instance + */ + CustomerEncryptionKeyProtectedDisk.prototype.diskEncryptionKey = null; + + /** + * CustomerEncryptionKeyProtectedDisk source. + * @member {string|null|undefined} source + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @instance + */ + CustomerEncryptionKeyProtectedDisk.prototype.source = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomerEncryptionKeyProtectedDisk _diskEncryptionKey. + * @member {"diskEncryptionKey"|undefined} _diskEncryptionKey + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @instance + */ + Object.defineProperty(CustomerEncryptionKeyProtectedDisk.prototype, "_diskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerEncryptionKeyProtectedDisk _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @instance + */ + Object.defineProperty(CustomerEncryptionKeyProtectedDisk.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerEncryptionKeyProtectedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk} CustomerEncryptionKeyProtectedDisk instance + */ + CustomerEncryptionKeyProtectedDisk.create = function create(properties) { + return new CustomerEncryptionKeyProtectedDisk(properties); + }; + + /** + * Encodes the specified CustomerEncryptionKeyProtectedDisk message. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk} message CustomerEncryptionKeyProtectedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKeyProtectedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 177235995, wireType 2 =*/1417887962).string(message.source); + if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 271660677, wireType 2 =*/2173285418).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomerEncryptionKeyProtectedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {google.cloud.compute.v1.ICustomerEncryptionKeyProtectedDisk} message CustomerEncryptionKeyProtectedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKeyProtectedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEncryptionKeyProtectedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk} CustomerEncryptionKeyProtectedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKeyProtectedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 271660677: + message.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 177235995: + message.source = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEncryptionKeyProtectedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk} CustomerEncryptionKeyProtectedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKeyProtectedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEncryptionKeyProtectedDisk message. + * @function verify + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEncryptionKeyProtectedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + properties._diskEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); + if (error) + return "diskEncryptionKey." + error; + } + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + return null; + }; + + /** + * Creates a CustomerEncryptionKeyProtectedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk} CustomerEncryptionKeyProtectedDisk + */ + CustomerEncryptionKeyProtectedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk) + return object; + var message = new $root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk(); + if (object.diskEncryptionKey != null) { + if (typeof object.diskEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.diskEncryptionKey: object expected"); + message.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); + } + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a CustomerEncryptionKeyProtectedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @static + * @param {google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk} message CustomerEncryptionKeyProtectedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEncryptionKeyProtectedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + object.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); + if (options.oneofs) + object._diskEncryptionKey = "diskEncryptionKey"; + } + return object; + }; + + /** + * Converts this CustomerEncryptionKeyProtectedDisk to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk + * @instance + * @returns {Object.} JSON object + */ + CustomerEncryptionKeyProtectedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomerEncryptionKeyProtectedDisk; + })(); + + v1.Disk = (function() { + + /** + * Properties of a Disk. + * @memberof google.cloud.compute.v1 + * @interface IDisk + * @property {string|null} [creationTimestamp] Disk creationTimestamp + * @property {string|null} [description] Disk description + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] Disk diskEncryptionKey + * @property {Array.|null} [guestOsFeatures] Disk guestOsFeatures + * @property {number|Long|null} [id] Disk id + * @property {string|null} [kind] Disk kind + * @property {string|null} [labelFingerprint] Disk labelFingerprint + * @property {Object.|null} [labels] Disk labels + * @property {string|null} [lastAttachTimestamp] Disk lastAttachTimestamp + * @property {string|null} [lastDetachTimestamp] Disk lastDetachTimestamp + * @property {Array.|null} [licenseCodes] Disk licenseCodes + * @property {Array.|null} [licenses] Disk licenses + * @property {string|null} [locationHint] Disk locationHint + * @property {string|null} [name] Disk name + * @property {string|null} [options] Disk options + * @property {number|Long|null} [physicalBlockSizeBytes] Disk physicalBlockSizeBytes + * @property {number|Long|null} [provisionedIops] Disk provisionedIops + * @property {string|null} [region] Disk region + * @property {Array.|null} [replicaZones] Disk replicaZones + * @property {Array.|null} [resourcePolicies] Disk resourcePolicies + * @property {boolean|null} [satisfiesPzs] Disk satisfiesPzs + * @property {string|null} [selfLink] Disk selfLink + * @property {number|Long|null} [sizeGb] Disk sizeGb + * @property {string|null} [sourceDisk] Disk sourceDisk + * @property {string|null} [sourceDiskId] Disk sourceDiskId + * @property {string|null} [sourceImage] Disk sourceImage + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceImageEncryptionKey] Disk sourceImageEncryptionKey + * @property {string|null} [sourceImageId] Disk sourceImageId + * @property {string|null} [sourceSnapshot] Disk sourceSnapshot + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceSnapshotEncryptionKey] Disk sourceSnapshotEncryptionKey + * @property {string|null} [sourceSnapshotId] Disk sourceSnapshotId + * @property {string|null} [sourceStorageObject] Disk sourceStorageObject + * @property {google.cloud.compute.v1.Disk.Status|null} [status] Disk status + * @property {string|null} [type] Disk type + * @property {Array.|null} [users] Disk users + * @property {string|null} [zone] Disk zone + */ + + /** + * Constructs a new Disk. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Disk. + * @implements IDisk + * @constructor + * @param {google.cloud.compute.v1.IDisk=} [properties] Properties to set + */ + function Disk(properties) { + this.guestOsFeatures = []; + this.labels = {}; + this.licenseCodes = []; + this.licenses = []; + this.replicaZones = []; + this.resourcePolicies = []; + this.users = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Disk creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.creationTimestamp = null; + + /** + * Disk description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.description = null; + + /** + * Disk diskEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.diskEncryptionKey = null; + + /** + * Disk guestOsFeatures. + * @member {Array.} guestOsFeatures + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.guestOsFeatures = $util.emptyArray; + + /** + * Disk id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.id = null; + + /** + * Disk kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.kind = null; + + /** + * Disk labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.labelFingerprint = null; + + /** + * Disk labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.labels = $util.emptyObject; + + /** + * Disk lastAttachTimestamp. + * @member {string|null|undefined} lastAttachTimestamp + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.lastAttachTimestamp = null; + + /** + * Disk lastDetachTimestamp. + * @member {string|null|undefined} lastDetachTimestamp + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.lastDetachTimestamp = null; + + /** + * Disk licenseCodes. + * @member {Array.} licenseCodes + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.licenseCodes = $util.emptyArray; + + /** + * Disk licenses. + * @member {Array.} licenses + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.licenses = $util.emptyArray; + + /** + * Disk locationHint. + * @member {string|null|undefined} locationHint + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.locationHint = null; + + /** + * Disk name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.name = null; + + /** + * Disk options. + * @member {string|null|undefined} options + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.options = null; + + /** + * Disk physicalBlockSizeBytes. + * @member {number|Long|null|undefined} physicalBlockSizeBytes + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.physicalBlockSizeBytes = null; + + /** + * Disk provisionedIops. + * @member {number|Long|null|undefined} provisionedIops + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.provisionedIops = null; + + /** + * Disk region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.region = null; + + /** + * Disk replicaZones. + * @member {Array.} replicaZones + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.replicaZones = $util.emptyArray; + + /** + * Disk resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.resourcePolicies = $util.emptyArray; + + /** + * Disk satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.satisfiesPzs = null; + + /** + * Disk selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.selfLink = null; + + /** + * Disk sizeGb. + * @member {number|Long|null|undefined} sizeGb + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sizeGb = null; + + /** + * Disk sourceDisk. + * @member {string|null|undefined} sourceDisk + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceDisk = null; + + /** + * Disk sourceDiskId. + * @member {string|null|undefined} sourceDiskId + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceDiskId = null; + + /** + * Disk sourceImage. + * @member {string|null|undefined} sourceImage + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceImage = null; + + /** + * Disk sourceImageEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceImageEncryptionKey + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceImageEncryptionKey = null; + + /** + * Disk sourceImageId. + * @member {string|null|undefined} sourceImageId + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceImageId = null; + + /** + * Disk sourceSnapshot. + * @member {string|null|undefined} sourceSnapshot + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceSnapshot = null; + + /** + * Disk sourceSnapshotEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceSnapshotEncryptionKey + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceSnapshotEncryptionKey = null; + + /** + * Disk sourceSnapshotId. + * @member {string|null|undefined} sourceSnapshotId + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceSnapshotId = null; + + /** + * Disk sourceStorageObject. + * @member {string|null|undefined} sourceStorageObject + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.sourceStorageObject = null; + + /** + * Disk status. + * @member {google.cloud.compute.v1.Disk.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.status = null; + + /** + * Disk type. + * @member {string|null|undefined} type + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.type = null; + + /** + * Disk users. + * @member {Array.} users + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.users = $util.emptyArray; + + /** + * Disk zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Disk.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Disk _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _diskEncryptionKey. + * @member {"diskEncryptionKey"|undefined} _diskEncryptionKey + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_diskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _lastAttachTimestamp. + * @member {"lastAttachTimestamp"|undefined} _lastAttachTimestamp + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_lastAttachTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastAttachTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _lastDetachTimestamp. + * @member {"lastDetachTimestamp"|undefined} _lastDetachTimestamp + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_lastDetachTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastDetachTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _locationHint. + * @member {"locationHint"|undefined} _locationHint + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_locationHint", { + get: $util.oneOfGetter($oneOfFields = ["locationHint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _options. + * @member {"options"|undefined} _options + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_options", { + get: $util.oneOfGetter($oneOfFields = ["options"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _physicalBlockSizeBytes. + * @member {"physicalBlockSizeBytes"|undefined} _physicalBlockSizeBytes + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_physicalBlockSizeBytes", { + get: $util.oneOfGetter($oneOfFields = ["physicalBlockSizeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _provisionedIops. + * @member {"provisionedIops"|undefined} _provisionedIops + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_provisionedIops", { + get: $util.oneOfGetter($oneOfFields = ["provisionedIops"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _satisfiesPzs. + * @member {"satisfiesPzs"|undefined} _satisfiesPzs + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sizeGb. + * @member {"sizeGb"|undefined} _sizeGb + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sizeGb", { + get: $util.oneOfGetter($oneOfFields = ["sizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceDisk. + * @member {"sourceDisk"|undefined} _sourceDisk + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceDisk", { + get: $util.oneOfGetter($oneOfFields = ["sourceDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceDiskId. + * @member {"sourceDiskId"|undefined} _sourceDiskId + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceDiskId", { + get: $util.oneOfGetter($oneOfFields = ["sourceDiskId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceImage. + * @member {"sourceImage"|undefined} _sourceImage + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceImage", { + get: $util.oneOfGetter($oneOfFields = ["sourceImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceImageEncryptionKey. + * @member {"sourceImageEncryptionKey"|undefined} _sourceImageEncryptionKey + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceImageEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceImageEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceImageId. + * @member {"sourceImageId"|undefined} _sourceImageId + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceImageId", { + get: $util.oneOfGetter($oneOfFields = ["sourceImageId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceSnapshot. + * @member {"sourceSnapshot"|undefined} _sourceSnapshot + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceSnapshot", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceSnapshotEncryptionKey. + * @member {"sourceSnapshotEncryptionKey"|undefined} _sourceSnapshotEncryptionKey + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceSnapshotEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshotEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceSnapshotId. + * @member {"sourceSnapshotId"|undefined} _sourceSnapshotId + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceSnapshotId", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshotId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _sourceStorageObject. + * @member {"sourceStorageObject"|undefined} _sourceStorageObject + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_sourceStorageObject", { + get: $util.oneOfGetter($oneOfFields = ["sourceStorageObject"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Disk _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.Disk + * @instance + */ + Object.defineProperty(Disk.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Disk instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {google.cloud.compute.v1.IDisk=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Disk} Disk instance + */ + Disk.create = function create(properties) { + return new Disk(properties); + }; + + /** + * Encodes the specified Disk message. Does not implicitly {@link google.cloud.compute.v1.Disk.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {google.cloud.compute.v1.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 2 =*/28604882).string(message.type); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.lastAttachTimestamp != null && Object.hasOwnProperty.call(message, "lastAttachTimestamp")) + writer.uint32(/* id 42159653, wireType 2 =*/337277226).string(message.lastAttachTimestamp); + if (message.licenseCodes != null && message.licenseCodes.length) { + writer.uint32(/* id 45482664, wireType 2 =*/363861314).fork(); + for (var i = 0; i < message.licenseCodes.length; ++i) + writer.int64(message.licenseCodes[i]); + writer.ldelim(); + } + if (message.replicaZones != null && message.replicaZones.length) + for (var i = 0; i < message.replicaZones.length; ++i) + writer.uint32(/* id 48438272, wireType 2 =*/387506178).string(message.replicaZones[i]); + if (message.sourceImage != null && Object.hasOwnProperty.call(message, "sourceImage")) + writer.uint32(/* id 50443319, wireType 2 =*/403546554).string(message.sourceImage); + if (message.sourceImageId != null && Object.hasOwnProperty.call(message, "sourceImageId")) + writer.uint32(/* id 55328291, wireType 2 =*/442626330).string(message.sourceImageId); + if (message.lastDetachTimestamp != null && Object.hasOwnProperty.call(message, "lastDetachTimestamp")) + writer.uint32(/* id 56471027, wireType 2 =*/451768218).string(message.lastDetachTimestamp); + if (message.guestOsFeatures != null && message.guestOsFeatures.length) + for (var i = 0; i < message.guestOsFeatures.length; ++i) + $root.google.cloud.compute.v1.GuestOsFeature.encode(message.guestOsFeatures[i], writer.uint32(/* id 79294545, wireType 2 =*/634356362).fork()).ldelim(); + if (message.sourceSnapshotId != null && Object.hasOwnProperty.call(message, "sourceSnapshotId")) + writer.uint32(/* id 98962258, wireType 2 =*/791698066).string(message.sourceSnapshotId); + if (message.users != null && message.users.length) + for (var i = 0; i < message.users.length; ++i) + writer.uint32(/* id 111578632, wireType 2 =*/892629058).string(message.users[i]); + if (message.sourceSnapshot != null && Object.hasOwnProperty.call(message, "sourceSnapshot")) + writer.uint32(/* id 126061928, wireType 2 =*/1008495426).string(message.sourceSnapshot); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.provisionedIops != null && Object.hasOwnProperty.call(message, "provisionedIops")) + writer.uint32(/* id 186769108, wireType 0 =*/1494152864).int64(message.provisionedIops); + if (message.sourceStorageObject != null && Object.hasOwnProperty.call(message, "sourceStorageObject")) + writer.uint32(/* id 233052711, wireType 2 =*/1864421690).string(message.sourceStorageObject); + if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 271660677, wireType 2 =*/2173285418).fork()).ldelim(); + if (message.sourceSnapshotEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceSnapshotEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceSnapshotEncryptionKey, writer.uint32(/* id 303679322, wireType 2 =*/2429434578).fork()).ldelim(); + if (message.licenses != null && message.licenses.length) + for (var i = 0; i < message.licenses.length; ++i) + writer.uint32(/* id 337642578, wireType 2 =*/2701140626).string(message.licenses[i]); + if (message.locationHint != null && Object.hasOwnProperty.call(message, "locationHint")) + writer.uint32(/* id 350519505, wireType 2 =*/2804156042).string(message.locationHint); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 361137822, wireType 2 =*/2889102578).string(message.options); + if (message.sourceImageEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceImageEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceImageEncryptionKey, writer.uint32(/* id 381503659, wireType 2 =*/3052029274).fork()).ldelim(); + if (message.physicalBlockSizeBytes != null && Object.hasOwnProperty.call(message, "physicalBlockSizeBytes")) + writer.uint32(/* id 420007943, wireType 0 =*/3360063544).int64(message.physicalBlockSizeBytes); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.sourceDisk != null && Object.hasOwnProperty.call(message, "sourceDisk")) + writer.uint32(/* id 451753793, wireType 2 =*/3614030346).string(message.sourceDisk); + if (message.sourceDiskId != null && Object.hasOwnProperty.call(message, "sourceDiskId")) + writer.uint32(/* id 454190809, wireType 2 =*/3633526474).string(message.sourceDiskId); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 480964267, wireType 0 =*/3847714136).bool(message.satisfiesPzs); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 494929369, wireType 0 =*/3959434952).int64(message.sizeGb); + 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 500195327, wireType 2 =*/4001562618).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 Disk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Disk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {google.cloud.compute.v1.IDisk} message Disk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Disk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Disk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Disk(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 271660677: + message.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 79294545: + if (!(message.guestOsFeatures && message.guestOsFeatures.length)) + message.guestOsFeatures = []; + message.guestOsFeatures.push($root.google.cloud.compute.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 42159653: + message.lastAttachTimestamp = reader.string(); + break; + case 56471027: + message.lastDetachTimestamp = reader.string(); + break; + case 45482664: + if (!(message.licenseCodes && message.licenseCodes.length)) + message.licenseCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.licenseCodes.push(reader.int64()); + } else + message.licenseCodes.push(reader.int64()); + break; + case 337642578: + if (!(message.licenses && message.licenses.length)) + message.licenses = []; + message.licenses.push(reader.string()); + break; + case 350519505: + message.locationHint = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 361137822: + message.options = reader.string(); + break; + case 420007943: + message.physicalBlockSizeBytes = reader.int64(); + break; + case 186769108: + message.provisionedIops = reader.int64(); + break; + case 138946292: + message.region = reader.string(); + break; + case 48438272: + if (!(message.replicaZones && message.replicaZones.length)) + message.replicaZones = []; + message.replicaZones.push(reader.string()); + break; + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + case 480964267: + message.satisfiesPzs = reader.bool(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 494929369: + message.sizeGb = reader.int64(); + break; + case 451753793: + message.sourceDisk = reader.string(); + break; + case 454190809: + message.sourceDiskId = reader.string(); + break; + case 50443319: + message.sourceImage = reader.string(); + break; + case 381503659: + message.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 55328291: + message.sourceImageId = reader.string(); + break; + case 126061928: + message.sourceSnapshot = reader.string(); + break; + case 303679322: + message.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 98962258: + message.sourceSnapshotId = reader.string(); + break; + case 233052711: + message.sourceStorageObject = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 3575610: + message.type = reader.string(); + break; + case 111578632: + if (!(message.users && message.users.length)) + message.users = []; + message.users.push(reader.string()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Disk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Disk} Disk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Disk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Disk message. + * @function verify + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Disk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + properties._diskEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); + if (error) + return "diskEncryptionKey." + error; + } + } + if (message.guestOsFeatures != null && message.hasOwnProperty("guestOsFeatures")) { + if (!Array.isArray(message.guestOsFeatures)) + return "guestOsFeatures: array expected"; + for (var i = 0; i < message.guestOsFeatures.length; ++i) { + var error = $root.google.cloud.compute.v1.GuestOsFeature.verify(message.guestOsFeatures[i]); + if (error) + return "guestOsFeatures." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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.lastAttachTimestamp != null && message.hasOwnProperty("lastAttachTimestamp")) { + properties._lastAttachTimestamp = 1; + if (!$util.isString(message.lastAttachTimestamp)) + return "lastAttachTimestamp: string expected"; + } + if (message.lastDetachTimestamp != null && message.hasOwnProperty("lastDetachTimestamp")) { + properties._lastDetachTimestamp = 1; + if (!$util.isString(message.lastDetachTimestamp)) + return "lastDetachTimestamp: string expected"; + } + if (message.licenseCodes != null && message.hasOwnProperty("licenseCodes")) { + if (!Array.isArray(message.licenseCodes)) + return "licenseCodes: array expected"; + for (var i = 0; i < message.licenseCodes.length; ++i) + if (!$util.isInteger(message.licenseCodes[i]) && !(message.licenseCodes[i] && $util.isInteger(message.licenseCodes[i].low) && $util.isInteger(message.licenseCodes[i].high))) + return "licenseCodes: integer|Long[] expected"; + } + if (message.licenses != null && message.hasOwnProperty("licenses")) { + if (!Array.isArray(message.licenses)) + return "licenses: array expected"; + for (var i = 0; i < message.licenses.length; ++i) + if (!$util.isString(message.licenses[i])) + return "licenses: string[] expected"; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + properties._locationHint = 1; + if (!$util.isString(message.locationHint)) + return "locationHint: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.options != null && message.hasOwnProperty("options")) { + properties._options = 1; + if (!$util.isString(message.options)) + return "options: string expected"; + } + if (message.physicalBlockSizeBytes != null && message.hasOwnProperty("physicalBlockSizeBytes")) { + properties._physicalBlockSizeBytes = 1; + if (!$util.isInteger(message.physicalBlockSizeBytes) && !(message.physicalBlockSizeBytes && $util.isInteger(message.physicalBlockSizeBytes.low) && $util.isInteger(message.physicalBlockSizeBytes.high))) + return "physicalBlockSizeBytes: integer|Long expected"; + } + if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { + properties._provisionedIops = 1; + if (!$util.isInteger(message.provisionedIops) && !(message.provisionedIops && $util.isInteger(message.provisionedIops.low) && $util.isInteger(message.provisionedIops.high))) + return "provisionedIops: integer|Long expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { + if (!Array.isArray(message.replicaZones)) + return "replicaZones: array expected"; + for (var i = 0; i < message.replicaZones.length; ++i) + if (!$util.isString(message.replicaZones[i])) + return "replicaZones: string[] expected"; + } + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + properties._sizeGb = 1; + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + properties._sourceDisk = 1; + if (!$util.isString(message.sourceDisk)) + return "sourceDisk: string expected"; + } + if (message.sourceDiskId != null && message.hasOwnProperty("sourceDiskId")) { + properties._sourceDiskId = 1; + if (!$util.isString(message.sourceDiskId)) + return "sourceDiskId: string expected"; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + properties._sourceImage = 1; + if (!$util.isString(message.sourceImage)) + return "sourceImage: string expected"; + } + if (message.sourceImageEncryptionKey != null && message.hasOwnProperty("sourceImageEncryptionKey")) { + properties._sourceImageEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceImageEncryptionKey); + if (error) + return "sourceImageEncryptionKey." + error; + } + } + if (message.sourceImageId != null && message.hasOwnProperty("sourceImageId")) { + properties._sourceImageId = 1; + if (!$util.isString(message.sourceImageId)) + return "sourceImageId: string expected"; + } + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + properties._sourceSnapshot = 1; + if (!$util.isString(message.sourceSnapshot)) + return "sourceSnapshot: string expected"; + } + if (message.sourceSnapshotEncryptionKey != null && message.hasOwnProperty("sourceSnapshotEncryptionKey")) { + properties._sourceSnapshotEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceSnapshotEncryptionKey); + if (error) + return "sourceSnapshotEncryptionKey." + error; + } + } + if (message.sourceSnapshotId != null && message.hasOwnProperty("sourceSnapshotId")) { + properties._sourceSnapshotId = 1; + if (!$util.isString(message.sourceSnapshotId)) + return "sourceSnapshotId: string expected"; + } + if (message.sourceStorageObject != null && message.hasOwnProperty("sourceStorageObject")) { + properties._sourceStorageObject = 1; + if (!$util.isString(message.sourceStorageObject)) + return "sourceStorageObject: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 455706685: + case 77848963: + case 404263851: + break; + } + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + if (!$util.isString(message.type)) + return "type: string expected"; + } + if (message.users != null && message.hasOwnProperty("users")) { + if (!Array.isArray(message.users)) + return "users: array expected"; + for (var i = 0; i < message.users.length; ++i) + if (!$util.isString(message.users[i])) + return "users: string[] expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a Disk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Disk} Disk + */ + Disk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Disk) + return object; + var message = new $root.google.cloud.compute.v1.Disk(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.diskEncryptionKey != null) { + if (typeof object.diskEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Disk.diskEncryptionKey: object expected"); + message.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); + } + if (object.guestOsFeatures) { + if (!Array.isArray(object.guestOsFeatures)) + throw TypeError(".google.cloud.compute.v1.Disk.guestOsFeatures: array expected"); + message.guestOsFeatures = []; + for (var i = 0; i < object.guestOsFeatures.length; ++i) { + if (typeof object.guestOsFeatures[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Disk.guestOsFeatures: object expected"); + message.guestOsFeatures[i] = $root.google.cloud.compute.v1.GuestOsFeature.fromObject(object.guestOsFeatures[i]); + } + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.Disk.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.lastAttachTimestamp != null) + message.lastAttachTimestamp = String(object.lastAttachTimestamp); + if (object.lastDetachTimestamp != null) + message.lastDetachTimestamp = String(object.lastDetachTimestamp); + if (object.licenseCodes) { + if (!Array.isArray(object.licenseCodes)) + throw TypeError(".google.cloud.compute.v1.Disk.licenseCodes: array expected"); + message.licenseCodes = []; + for (var i = 0; i < object.licenseCodes.length; ++i) + if ($util.Long) + (message.licenseCodes[i] = $util.Long.fromValue(object.licenseCodes[i])).unsigned = false; + else if (typeof object.licenseCodes[i] === "string") + message.licenseCodes[i] = parseInt(object.licenseCodes[i], 10); + else if (typeof object.licenseCodes[i] === "number") + message.licenseCodes[i] = object.licenseCodes[i]; + else if (typeof object.licenseCodes[i] === "object") + message.licenseCodes[i] = new $util.LongBits(object.licenseCodes[i].low >>> 0, object.licenseCodes[i].high >>> 0).toNumber(); + } + if (object.licenses) { + if (!Array.isArray(object.licenses)) + throw TypeError(".google.cloud.compute.v1.Disk.licenses: array expected"); + message.licenses = []; + for (var i = 0; i < object.licenses.length; ++i) + message.licenses[i] = String(object.licenses[i]); + } + if (object.locationHint != null) + message.locationHint = String(object.locationHint); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) + message.options = String(object.options); + if (object.physicalBlockSizeBytes != null) + if ($util.Long) + (message.physicalBlockSizeBytes = $util.Long.fromValue(object.physicalBlockSizeBytes)).unsigned = false; + else if (typeof object.physicalBlockSizeBytes === "string") + message.physicalBlockSizeBytes = parseInt(object.physicalBlockSizeBytes, 10); + else if (typeof object.physicalBlockSizeBytes === "number") + message.physicalBlockSizeBytes = object.physicalBlockSizeBytes; + else if (typeof object.physicalBlockSizeBytes === "object") + message.physicalBlockSizeBytes = new $util.LongBits(object.physicalBlockSizeBytes.low >>> 0, object.physicalBlockSizeBytes.high >>> 0).toNumber(); + if (object.provisionedIops != null) + if ($util.Long) + (message.provisionedIops = $util.Long.fromValue(object.provisionedIops)).unsigned = false; + else if (typeof object.provisionedIops === "string") + message.provisionedIops = parseInt(object.provisionedIops, 10); + else if (typeof object.provisionedIops === "number") + message.provisionedIops = object.provisionedIops; + else if (typeof object.provisionedIops === "object") + message.provisionedIops = new $util.LongBits(object.provisionedIops.low >>> 0, object.provisionedIops.high >>> 0).toNumber(); + if (object.region != null) + message.region = String(object.region); + if (object.replicaZones) { + if (!Array.isArray(object.replicaZones)) + throw TypeError(".google.cloud.compute.v1.Disk.replicaZones: array expected"); + message.replicaZones = []; + for (var i = 0; i < object.replicaZones.length; ++i) + message.replicaZones[i] = String(object.replicaZones[i]); + } + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.Disk.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + if (object.sourceDisk != null) + message.sourceDisk = String(object.sourceDisk); + if (object.sourceDiskId != null) + message.sourceDiskId = String(object.sourceDiskId); + if (object.sourceImage != null) + message.sourceImage = String(object.sourceImage); + if (object.sourceImageEncryptionKey != null) { + if (typeof object.sourceImageEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Disk.sourceImageEncryptionKey: object expected"); + message.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceImageEncryptionKey); + } + if (object.sourceImageId != null) + message.sourceImageId = String(object.sourceImageId); + if (object.sourceSnapshot != null) + message.sourceSnapshot = String(object.sourceSnapshot); + if (object.sourceSnapshotEncryptionKey != null) { + if (typeof object.sourceSnapshotEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Disk.sourceSnapshotEncryptionKey: object expected"); + message.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceSnapshotEncryptionKey); + } + if (object.sourceSnapshotId != null) + message.sourceSnapshotId = String(object.sourceSnapshotId); + if (object.sourceStorageObject != null) + message.sourceStorageObject = String(object.sourceStorageObject); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "FAILED": + case 455706685: + message.status = 455706685; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + case "RESTORING": + case 404263851: + message.status = 404263851; + break; + } + if (object.type != null) + message.type = String(object.type); + if (object.users) { + if (!Array.isArray(object.users)) + throw TypeError(".google.cloud.compute.v1.Disk.users: array expected"); + message.users = []; + for (var i = 0; i < object.users.length; ++i) + message.users[i] = String(object.users[i]); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a Disk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Disk + * @static + * @param {google.cloud.compute.v1.Disk} message Disk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Disk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourcePolicies = []; + object.licenseCodes = []; + object.replicaZones = []; + object.guestOsFeatures = []; + object.users = []; + object.licenses = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.lastAttachTimestamp != null && message.hasOwnProperty("lastAttachTimestamp")) { + object.lastAttachTimestamp = message.lastAttachTimestamp; + if (options.oneofs) + object._lastAttachTimestamp = "lastAttachTimestamp"; + } + if (message.licenseCodes && message.licenseCodes.length) { + object.licenseCodes = []; + for (var j = 0; j < message.licenseCodes.length; ++j) + if (typeof message.licenseCodes[j] === "number") + object.licenseCodes[j] = options.longs === String ? String(message.licenseCodes[j]) : message.licenseCodes[j]; + else + object.licenseCodes[j] = options.longs === String ? $util.Long.prototype.toString.call(message.licenseCodes[j]) : options.longs === Number ? new $util.LongBits(message.licenseCodes[j].low >>> 0, message.licenseCodes[j].high >>> 0).toNumber() : message.licenseCodes[j]; + } + if (message.replicaZones && message.replicaZones.length) { + object.replicaZones = []; + for (var j = 0; j < message.replicaZones.length; ++j) + object.replicaZones[j] = message.replicaZones[j]; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + object.sourceImage = message.sourceImage; + if (options.oneofs) + object._sourceImage = "sourceImage"; + } + if (message.sourceImageId != null && message.hasOwnProperty("sourceImageId")) { + object.sourceImageId = message.sourceImageId; + if (options.oneofs) + object._sourceImageId = "sourceImageId"; + } + if (message.lastDetachTimestamp != null && message.hasOwnProperty("lastDetachTimestamp")) { + object.lastDetachTimestamp = message.lastDetachTimestamp; + if (options.oneofs) + object._lastDetachTimestamp = "lastDetachTimestamp"; + } + if (message.guestOsFeatures && message.guestOsFeatures.length) { + object.guestOsFeatures = []; + for (var j = 0; j < message.guestOsFeatures.length; ++j) + object.guestOsFeatures[j] = $root.google.cloud.compute.v1.GuestOsFeature.toObject(message.guestOsFeatures[j], options); + } + if (message.sourceSnapshotId != null && message.hasOwnProperty("sourceSnapshotId")) { + object.sourceSnapshotId = message.sourceSnapshotId; + if (options.oneofs) + object._sourceSnapshotId = "sourceSnapshotId"; + } + if (message.users && message.users.length) { + object.users = []; + for (var j = 0; j < message.users.length; ++j) + object.users[j] = message.users[j]; + } + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + object.sourceSnapshot = message.sourceSnapshot; + if (options.oneofs) + object._sourceSnapshot = "sourceSnapshot"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Disk.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { + if (typeof message.provisionedIops === "number") + object.provisionedIops = options.longs === String ? String(message.provisionedIops) : message.provisionedIops; + else + object.provisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.provisionedIops) : options.longs === Number ? new $util.LongBits(message.provisionedIops.low >>> 0, message.provisionedIops.high >>> 0).toNumber() : message.provisionedIops; + if (options.oneofs) + object._provisionedIops = "provisionedIops"; + } + if (message.sourceStorageObject != null && message.hasOwnProperty("sourceStorageObject")) { + object.sourceStorageObject = message.sourceStorageObject; + if (options.oneofs) + object._sourceStorageObject = "sourceStorageObject"; + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + object.diskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); + if (options.oneofs) + object._diskEncryptionKey = "diskEncryptionKey"; + } + if (message.sourceSnapshotEncryptionKey != null && message.hasOwnProperty("sourceSnapshotEncryptionKey")) { + object.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceSnapshotEncryptionKey, options); + if (options.oneofs) + object._sourceSnapshotEncryptionKey = "sourceSnapshotEncryptionKey"; + } + if (message.licenses && message.licenses.length) { + object.licenses = []; + for (var j = 0; j < message.licenses.length; ++j) + object.licenses[j] = message.licenses[j]; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + object.locationHint = message.locationHint; + if (options.oneofs) + object._locationHint = "locationHint"; + } + if (message.options != null && message.hasOwnProperty("options")) { + object.options = message.options; + if (options.oneofs) + object._options = "options"; + } + if (message.sourceImageEncryptionKey != null && message.hasOwnProperty("sourceImageEncryptionKey")) { + object.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceImageEncryptionKey, options); + if (options.oneofs) + object._sourceImageEncryptionKey = "sourceImageEncryptionKey"; + } + if (message.physicalBlockSizeBytes != null && message.hasOwnProperty("physicalBlockSizeBytes")) { + if (typeof message.physicalBlockSizeBytes === "number") + object.physicalBlockSizeBytes = options.longs === String ? String(message.physicalBlockSizeBytes) : message.physicalBlockSizeBytes; + else + object.physicalBlockSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.physicalBlockSizeBytes) : options.longs === Number ? new $util.LongBits(message.physicalBlockSizeBytes.low >>> 0, message.physicalBlockSizeBytes.high >>> 0).toNumber() : message.physicalBlockSizeBytes; + if (options.oneofs) + object._physicalBlockSizeBytes = "physicalBlockSizeBytes"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + object.sourceDisk = message.sourceDisk; + if (options.oneofs) + object._sourceDisk = "sourceDisk"; + } + if (message.sourceDiskId != null && message.hasOwnProperty("sourceDiskId")) { + object.sourceDiskId = message.sourceDiskId; + if (options.oneofs) + object._sourceDiskId = "sourceDiskId"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (options.oneofs) + object._sizeGb = "sizeGb"; + } + 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 Disk to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Disk + * @instance + * @returns {Object.} JSON object + */ + Disk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.Disk.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} FAILED=455706685 FAILED value + * @property {number} READY=77848963 READY value + * @property {number} RESTORING=404263851 RESTORING value + */ + Disk.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[455706685] = "FAILED"] = 455706685; + values[valuesById[77848963] = "READY"] = 77848963; + values[valuesById[404263851] = "RESTORING"] = 404263851; + return values; + })(); + + return Disk; + })(); + + v1.DisksScopedList = (function() { + + /** + * Properties of a DisksScopedList. + * @memberof google.cloud.compute.v1 + * @interface IDisksScopedList + * @property {Array.|null} [disks] DisksScopedList disks + * @property {google.cloud.compute.v1.IWarning|null} [warning] DisksScopedList warning + */ + + /** + * Constructs a new DisksScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DisksScopedList. + * @implements IDisksScopedList + * @constructor + * @param {google.cloud.compute.v1.IDisksScopedList=} [properties] Properties to set + */ + function DisksScopedList(properties) { + this.disks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisksScopedList disks. + * @member {Array.} disks + * @memberof google.cloud.compute.v1.DisksScopedList + * @instance + */ + DisksScopedList.prototype.disks = $util.emptyArray; + + /** + * DisksScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.DisksScopedList + * @instance + */ + DisksScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisksScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.DisksScopedList + * @instance + */ + Object.defineProperty(DisksScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisksScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {google.cloud.compute.v1.IDisksScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DisksScopedList} DisksScopedList instance + */ + DisksScopedList.create = function create(properties) { + return new DisksScopedList(properties); + }; + + /** + * Encodes the specified DisksScopedList message. Does not implicitly {@link google.cloud.compute.v1.DisksScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {google.cloud.compute.v1.IDisksScopedList} message DisksScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.compute.v1.Disk.encode(message.disks[i], writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DisksScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {google.cloud.compute.v1.IDisksScopedList} message DisksScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisksScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DisksScopedList} DisksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DisksScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 95594102: + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.compute.v1.Disk.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisksScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DisksScopedList} DisksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisksScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisksScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.compute.v1.Disk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a DisksScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DisksScopedList} DisksScopedList + */ + DisksScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DisksScopedList) + return object; + var message = new $root.google.cloud.compute.v1.DisksScopedList(); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.compute.v1.DisksScopedList.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.DisksScopedList.disks: object expected"); + message.disks[i] = $root.google.cloud.compute.v1.Disk.fromObject(object.disks[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.DisksScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a DisksScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DisksScopedList + * @static + * @param {google.cloud.compute.v1.DisksScopedList} message DisksScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisksScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.disks = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.compute.v1.Disk.toObject(message.disks[j], options); + } + return object; + }; + + /** + * Converts this DisksScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DisksScopedList + * @instance + * @returns {Object.} JSON object + */ + DisksScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DisksScopedList; + })(); + + v1.DiskAggregatedList = (function() { + + /** + * Properties of a DiskAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IDiskAggregatedList + * @property {string|null} [id] DiskAggregatedList id + * @property {Object.|null} [items] DiskAggregatedList items + * @property {string|null} [kind] DiskAggregatedList kind + * @property {string|null} [nextPageToken] DiskAggregatedList nextPageToken + * @property {string|null} [selfLink] DiskAggregatedList selfLink + * @property {Array.|null} [unreachables] DiskAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] DiskAggregatedList warning + */ + + /** + * Constructs a new DiskAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskAggregatedList. + * @implements IDiskAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IDiskAggregatedList=} [properties] Properties to set + */ + function DiskAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + DiskAggregatedList.prototype.id = null; + + /** + * DiskAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + DiskAggregatedList.prototype.items = $util.emptyObject; + + /** + * DiskAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + DiskAggregatedList.prototype.kind = null; + + /** + * DiskAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + DiskAggregatedList.prototype.nextPageToken = null; + + /** + * DiskAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + DiskAggregatedList.prototype.selfLink = null; + + /** + * DiskAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + DiskAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * DiskAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + DiskAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + Object.defineProperty(DiskAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + Object.defineProperty(DiskAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + Object.defineProperty(DiskAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + Object.defineProperty(DiskAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + */ + Object.defineProperty(DiskAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {google.cloud.compute.v1.IDiskAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskAggregatedList} DiskAggregatedList instance + */ + DiskAggregatedList.create = function create(properties) { + return new DiskAggregatedList(properties); + }; + + /** + * Encodes the specified DiskAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.DiskAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {google.cloud.compute.v1.IDiskAggregatedList} message DiskAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.DisksScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified DiskAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {google.cloud.compute.v1.IDiskAggregatedList} message DiskAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskAggregatedList} DiskAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.DisksScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskAggregatedList} DiskAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.DisksScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a DiskAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskAggregatedList} DiskAggregatedList + */ + DiskAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.DiskAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.DiskAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.DiskAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.DisksScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.DiskAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.DiskAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a DiskAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @static + * @param {google.cloud.compute.v1.DiskAggregatedList} message DiskAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.DisksScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this DiskAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskAggregatedList + * @instance + * @returns {Object.} JSON object + */ + DiskAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DiskAggregatedList; + })(); + + v1.DiskInstantiationConfig = (function() { + + /** + * Properties of a DiskInstantiationConfig. + * @memberof google.cloud.compute.v1 + * @interface IDiskInstantiationConfig + * @property {boolean|null} [autoDelete] DiskInstantiationConfig autoDelete + * @property {string|null} [customImage] DiskInstantiationConfig customImage + * @property {string|null} [deviceName] DiskInstantiationConfig deviceName + * @property {google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom|null} [instantiateFrom] DiskInstantiationConfig instantiateFrom + */ + + /** + * Constructs a new DiskInstantiationConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskInstantiationConfig. + * @implements IDiskInstantiationConfig + * @constructor + * @param {google.cloud.compute.v1.IDiskInstantiationConfig=} [properties] Properties to set + */ + function DiskInstantiationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskInstantiationConfig autoDelete. + * @member {boolean|null|undefined} autoDelete + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + DiskInstantiationConfig.prototype.autoDelete = null; + + /** + * DiskInstantiationConfig customImage. + * @member {string|null|undefined} customImage + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + DiskInstantiationConfig.prototype.customImage = null; + + /** + * DiskInstantiationConfig deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + DiskInstantiationConfig.prototype.deviceName = null; + + /** + * DiskInstantiationConfig instantiateFrom. + * @member {google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom|null|undefined} instantiateFrom + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + DiskInstantiationConfig.prototype.instantiateFrom = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskInstantiationConfig _autoDelete. + * @member {"autoDelete"|undefined} _autoDelete + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + Object.defineProperty(DiskInstantiationConfig.prototype, "_autoDelete", { + get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskInstantiationConfig _customImage. + * @member {"customImage"|undefined} _customImage + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + Object.defineProperty(DiskInstantiationConfig.prototype, "_customImage", { + get: $util.oneOfGetter($oneOfFields = ["customImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskInstantiationConfig _deviceName. + * @member {"deviceName"|undefined} _deviceName + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + Object.defineProperty(DiskInstantiationConfig.prototype, "_deviceName", { + get: $util.oneOfGetter($oneOfFields = ["deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskInstantiationConfig _instantiateFrom. + * @member {"instantiateFrom"|undefined} _instantiateFrom + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + */ + Object.defineProperty(DiskInstantiationConfig.prototype, "_instantiateFrom", { + get: $util.oneOfGetter($oneOfFields = ["instantiateFrom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskInstantiationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {google.cloud.compute.v1.IDiskInstantiationConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskInstantiationConfig} DiskInstantiationConfig instance + */ + DiskInstantiationConfig.create = function create(properties) { + return new DiskInstantiationConfig(properties); + }; + + /** + * Encodes the specified DiskInstantiationConfig message. Does not implicitly {@link google.cloud.compute.v1.DiskInstantiationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {google.cloud.compute.v1.IDiskInstantiationConfig} message DiskInstantiationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskInstantiationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 67541716, wireType 2 =*/540333730).string(message.deviceName); + if (message.customImage != null && Object.hasOwnProperty.call(message, "customImage")) + writer.uint32(/* id 184123149, wireType 2 =*/1472985194).string(message.customImage); + if (message.instantiateFrom != null && Object.hasOwnProperty.call(message, "instantiateFrom")) + writer.uint32(/* id 393383903, wireType 0 =*/3147071224).int32(message.instantiateFrom); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 464761403, wireType 0 =*/3718091224).bool(message.autoDelete); + return writer; + }; + + /** + * Encodes the specified DiskInstantiationConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskInstantiationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {google.cloud.compute.v1.IDiskInstantiationConfig} message DiskInstantiationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskInstantiationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskInstantiationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskInstantiationConfig} DiskInstantiationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskInstantiationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskInstantiationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 464761403: + message.autoDelete = reader.bool(); + break; + case 184123149: + message.customImage = reader.string(); + break; + case 67541716: + message.deviceName = reader.string(); + break; + case 393383903: + message.instantiateFrom = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskInstantiationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskInstantiationConfig} DiskInstantiationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskInstantiationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskInstantiationConfig message. + * @function verify + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskInstantiationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + properties._autoDelete = 1; + if (typeof message.autoDelete !== "boolean") + return "autoDelete: boolean expected"; + } + if (message.customImage != null && message.hasOwnProperty("customImage")) { + properties._customImage = 1; + if (!$util.isString(message.customImage)) + return "customImage: string expected"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + properties._deviceName = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.instantiateFrom != null && message.hasOwnProperty("instantiateFrom")) { + properties._instantiateFrom = 1; + switch (message.instantiateFrom) { + default: + return "instantiateFrom: enum value expected"; + case 0: + case 513775419: + case 63281460: + case 196311789: + case 115302945: + case 104218952: + case 62631959: + case 76850316: + break; + } + } + return null; + }; + + /** + * Creates a DiskInstantiationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskInstantiationConfig} DiskInstantiationConfig + */ + DiskInstantiationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskInstantiationConfig) + return object; + var message = new $root.google.cloud.compute.v1.DiskInstantiationConfig(); + if (object.autoDelete != null) + message.autoDelete = Boolean(object.autoDelete); + if (object.customImage != null) + message.customImage = String(object.customImage); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + switch (object.instantiateFrom) { + case "UNDEFINED_INSTANTIATE_FROM": + case 0: + message.instantiateFrom = 0; + break; + case "ATTACH_READ_ONLY": + case 513775419: + message.instantiateFrom = 513775419; + break; + case "BLANK": + case 63281460: + message.instantiateFrom = 63281460; + break; + case "CUSTOM_IMAGE": + case 196311789: + message.instantiateFrom = 196311789; + break; + case "DEFAULT": + case 115302945: + message.instantiateFrom = 115302945; + break; + case "DO_NOT_INCLUDE": + case 104218952: + message.instantiateFrom = 104218952; + break; + case "SOURCE_IMAGE": + case 62631959: + message.instantiateFrom = 62631959; + break; + case "SOURCE_IMAGE_FAMILY": + case 76850316: + message.instantiateFrom = 76850316; + break; + } + return message; + }; + + /** + * Creates a plain object from a DiskInstantiationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @static + * @param {google.cloud.compute.v1.DiskInstantiationConfig} message DiskInstantiationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskInstantiationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object._deviceName = "deviceName"; + } + if (message.customImage != null && message.hasOwnProperty("customImage")) { + object.customImage = message.customImage; + if (options.oneofs) + object._customImage = "customImage"; + } + if (message.instantiateFrom != null && message.hasOwnProperty("instantiateFrom")) { + object.instantiateFrom = options.enums === String ? $root.google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom[message.instantiateFrom] : message.instantiateFrom; + if (options.oneofs) + object._instantiateFrom = "instantiateFrom"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + object.autoDelete = message.autoDelete; + if (options.oneofs) + object._autoDelete = "autoDelete"; + } + return object; + }; + + /** + * Converts this DiskInstantiationConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskInstantiationConfig + * @instance + * @returns {Object.} JSON object + */ + DiskInstantiationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InstantiateFrom enum. + * @name google.cloud.compute.v1.DiskInstantiationConfig.InstantiateFrom + * @enum {number} + * @property {number} UNDEFINED_INSTANTIATE_FROM=0 UNDEFINED_INSTANTIATE_FROM value + * @property {number} ATTACH_READ_ONLY=513775419 ATTACH_READ_ONLY value + * @property {number} BLANK=63281460 BLANK value + * @property {number} CUSTOM_IMAGE=196311789 CUSTOM_IMAGE value + * @property {number} DEFAULT=115302945 DEFAULT value + * @property {number} DO_NOT_INCLUDE=104218952 DO_NOT_INCLUDE value + * @property {number} SOURCE_IMAGE=62631959 SOURCE_IMAGE value + * @property {number} SOURCE_IMAGE_FAMILY=76850316 SOURCE_IMAGE_FAMILY value + */ + DiskInstantiationConfig.InstantiateFrom = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_INSTANTIATE_FROM"] = 0; + values[valuesById[513775419] = "ATTACH_READ_ONLY"] = 513775419; + values[valuesById[63281460] = "BLANK"] = 63281460; + values[valuesById[196311789] = "CUSTOM_IMAGE"] = 196311789; + values[valuesById[115302945] = "DEFAULT"] = 115302945; + values[valuesById[104218952] = "DO_NOT_INCLUDE"] = 104218952; + values[valuesById[62631959] = "SOURCE_IMAGE"] = 62631959; + values[valuesById[76850316] = "SOURCE_IMAGE_FAMILY"] = 76850316; + return values; + })(); + + return DiskInstantiationConfig; + })(); + + v1.DiskList = (function() { + + /** + * Properties of a DiskList. + * @memberof google.cloud.compute.v1 + * @interface IDiskList + * @property {string|null} [id] DiskList id + * @property {Array.|null} [items] DiskList items + * @property {string|null} [kind] DiskList kind + * @property {string|null} [nextPageToken] DiskList nextPageToken + * @property {string|null} [selfLink] DiskList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] DiskList warning + */ + + /** + * Constructs a new DiskList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskList. + * @implements IDiskList + * @constructor + * @param {google.cloud.compute.v1.IDiskList=} [properties] Properties to set + */ + function DiskList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + DiskList.prototype.id = null; + + /** + * DiskList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + DiskList.prototype.items = $util.emptyArray; + + /** + * DiskList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + DiskList.prototype.kind = null; + + /** + * DiskList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + DiskList.prototype.nextPageToken = null; + + /** + * DiskList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + DiskList.prototype.selfLink = null; + + /** + * DiskList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + DiskList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + Object.defineProperty(DiskList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + Object.defineProperty(DiskList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + Object.defineProperty(DiskList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + Object.defineProperty(DiskList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.DiskList + * @instance + */ + Object.defineProperty(DiskList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {google.cloud.compute.v1.IDiskList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskList} DiskList instance + */ + DiskList.create = function create(properties) { + return new DiskList(properties); + }; + + /** + * Encodes the specified DiskList message. Does not implicitly {@link google.cloud.compute.v1.DiskList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {google.cloud.compute.v1.IDiskList} message DiskList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Disk.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified DiskList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {google.cloud.compute.v1.IDiskList} message DiskList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskList} DiskList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Disk.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskList} DiskList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskList message. + * @function verify + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Disk.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a DiskList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskList} DiskList + */ + DiskList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskList) + return object; + var message = new $root.google.cloud.compute.v1.DiskList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.DiskList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.DiskList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Disk.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.DiskList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a DiskList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskList + * @static + * @param {google.cloud.compute.v1.DiskList} message DiskList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Disk.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this DiskList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskList + * @instance + * @returns {Object.} JSON object + */ + DiskList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DiskList; + })(); + + v1.DiskMoveRequest = (function() { + + /** + * Properties of a DiskMoveRequest. + * @memberof google.cloud.compute.v1 + * @interface IDiskMoveRequest + * @property {string|null} [destinationZone] DiskMoveRequest destinationZone + * @property {string|null} [targetDisk] DiskMoveRequest targetDisk + */ + + /** + * Constructs a new DiskMoveRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskMoveRequest. + * @implements IDiskMoveRequest + * @constructor + * @param {google.cloud.compute.v1.IDiskMoveRequest=} [properties] Properties to set + */ + function DiskMoveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskMoveRequest destinationZone. + * @member {string|null|undefined} destinationZone + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @instance + */ + DiskMoveRequest.prototype.destinationZone = null; + + /** + * DiskMoveRequest targetDisk. + * @member {string|null|undefined} targetDisk + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @instance + */ + DiskMoveRequest.prototype.targetDisk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskMoveRequest _destinationZone. + * @member {"destinationZone"|undefined} _destinationZone + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @instance + */ + Object.defineProperty(DiskMoveRequest.prototype, "_destinationZone", { + get: $util.oneOfGetter($oneOfFields = ["destinationZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskMoveRequest _targetDisk. + * @member {"targetDisk"|undefined} _targetDisk + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @instance + */ + Object.defineProperty(DiskMoveRequest.prototype, "_targetDisk", { + get: $util.oneOfGetter($oneOfFields = ["targetDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskMoveRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {google.cloud.compute.v1.IDiskMoveRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskMoveRequest} DiskMoveRequest instance + */ + DiskMoveRequest.create = function create(properties) { + return new DiskMoveRequest(properties); + }; + + /** + * Encodes the specified DiskMoveRequest message. Does not implicitly {@link google.cloud.compute.v1.DiskMoveRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {google.cloud.compute.v1.IDiskMoveRequest} message DiskMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskMoveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetDisk != null && Object.hasOwnProperty.call(message, "targetDisk")) + writer.uint32(/* id 62433163, wireType 2 =*/499465306).string(message.targetDisk); + if (message.destinationZone != null && Object.hasOwnProperty.call(message, "destinationZone")) + writer.uint32(/* id 131854653, wireType 2 =*/1054837226).string(message.destinationZone); + return writer; + }; + + /** + * Encodes the specified DiskMoveRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskMoveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {google.cloud.compute.v1.IDiskMoveRequest} message DiskMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskMoveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskMoveRequest} DiskMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskMoveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskMoveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 131854653: + message.destinationZone = reader.string(); + break; + case 62433163: + message.targetDisk = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskMoveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskMoveRequest} DiskMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskMoveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskMoveRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskMoveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.destinationZone != null && message.hasOwnProperty("destinationZone")) { + properties._destinationZone = 1; + if (!$util.isString(message.destinationZone)) + return "destinationZone: string expected"; + } + if (message.targetDisk != null && message.hasOwnProperty("targetDisk")) { + properties._targetDisk = 1; + if (!$util.isString(message.targetDisk)) + return "targetDisk: string expected"; + } + return null; + }; + + /** + * Creates a DiskMoveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskMoveRequest} DiskMoveRequest + */ + DiskMoveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskMoveRequest) + return object; + var message = new $root.google.cloud.compute.v1.DiskMoveRequest(); + if (object.destinationZone != null) + message.destinationZone = String(object.destinationZone); + if (object.targetDisk != null) + message.targetDisk = String(object.targetDisk); + return message; + }; + + /** + * Creates a plain object from a DiskMoveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @static + * @param {google.cloud.compute.v1.DiskMoveRequest} message DiskMoveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskMoveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.targetDisk != null && message.hasOwnProperty("targetDisk")) { + object.targetDisk = message.targetDisk; + if (options.oneofs) + object._targetDisk = "targetDisk"; + } + if (message.destinationZone != null && message.hasOwnProperty("destinationZone")) { + object.destinationZone = message.destinationZone; + if (options.oneofs) + object._destinationZone = "destinationZone"; + } + return object; + }; + + /** + * Converts this DiskMoveRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskMoveRequest + * @instance + * @returns {Object.} JSON object + */ + DiskMoveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DiskMoveRequest; + })(); + + v1.DiskType = (function() { + + /** + * Properties of a DiskType. + * @memberof google.cloud.compute.v1 + * @interface IDiskType + * @property {string|null} [creationTimestamp] DiskType creationTimestamp + * @property {number|Long|null} [defaultDiskSizeGb] DiskType defaultDiskSizeGb + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecated] DiskType deprecated + * @property {string|null} [description] DiskType description + * @property {number|Long|null} [id] DiskType id + * @property {string|null} [kind] DiskType kind + * @property {string|null} [name] DiskType name + * @property {string|null} [region] DiskType region + * @property {string|null} [selfLink] DiskType selfLink + * @property {string|null} [validDiskSize] DiskType validDiskSize + * @property {string|null} [zone] DiskType zone + */ + + /** + * Constructs a new DiskType. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskType. + * @implements IDiskType + * @constructor + * @param {google.cloud.compute.v1.IDiskType=} [properties] Properties to set + */ + function DiskType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskType creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.creationTimestamp = null; + + /** + * DiskType defaultDiskSizeGb. + * @member {number|Long|null|undefined} defaultDiskSizeGb + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.defaultDiskSizeGb = null; + + /** + * DiskType deprecated. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecated + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.deprecated = null; + + /** + * DiskType description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.description = null; + + /** + * DiskType id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.id = null; + + /** + * DiskType kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.kind = null; + + /** + * DiskType name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.name = null; + + /** + * DiskType region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.region = null; + + /** + * DiskType selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.selfLink = null; + + /** + * DiskType validDiskSize. + * @member {string|null|undefined} validDiskSize + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.validDiskSize = null; + + /** + * DiskType zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + DiskType.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskType _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _defaultDiskSizeGb. + * @member {"defaultDiskSizeGb"|undefined} _defaultDiskSizeGb + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_defaultDiskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["defaultDiskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _validDiskSize. + * @member {"validDiskSize"|undefined} _validDiskSize + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_validDiskSize", { + get: $util.oneOfGetter($oneOfFields = ["validDiskSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskType _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.DiskType + * @instance + */ + Object.defineProperty(DiskType.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskType instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {google.cloud.compute.v1.IDiskType=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskType} DiskType instance + */ + DiskType.create = function create(properties) { + return new DiskType(properties); + }; + + /** + * Encodes the specified DiskType message. Does not implicitly {@link google.cloud.compute.v1.DiskType.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {google.cloud.compute.v1.IDiskType} message DiskType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.defaultDiskSizeGb != null && Object.hasOwnProperty.call(message, "defaultDiskSizeGb")) + writer.uint32(/* id 270619253, wireType 0 =*/2164954024).int64(message.defaultDiskSizeGb); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.validDiskSize != null && Object.hasOwnProperty.call(message, "validDiskSize")) + writer.uint32(/* id 493962464, wireType 2 =*/3951699714).string(message.validDiskSize); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecated, writer.uint32(/* id 515138995, wireType 2 =*/4121111962).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiskType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {google.cloud.compute.v1.IDiskType} message DiskType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskType} DiskType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 270619253: + message.defaultDiskSizeGb = reader.int64(); + break; + case 515138995: + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 493962464: + message.validDiskSize = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskType} DiskType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskType message. + * @function verify + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.defaultDiskSizeGb != null && message.hasOwnProperty("defaultDiskSizeGb")) { + properties._defaultDiskSizeGb = 1; + if (!$util.isInteger(message.defaultDiskSizeGb) && !(message.defaultDiskSizeGb && $util.isInteger(message.defaultDiskSizeGb.low) && $util.isInteger(message.defaultDiskSizeGb.high))) + return "defaultDiskSizeGb: integer|Long expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecated); + if (error) + return "deprecated." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.validDiskSize != null && message.hasOwnProperty("validDiskSize")) { + properties._validDiskSize = 1; + if (!$util.isString(message.validDiskSize)) + return "validDiskSize: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a DiskType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskType} DiskType + */ + DiskType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskType) + return object; + var message = new $root.google.cloud.compute.v1.DiskType(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.defaultDiskSizeGb != null) + if ($util.Long) + (message.defaultDiskSizeGb = $util.Long.fromValue(object.defaultDiskSizeGb)).unsigned = false; + else if (typeof object.defaultDiskSizeGb === "string") + message.defaultDiskSizeGb = parseInt(object.defaultDiskSizeGb, 10); + else if (typeof object.defaultDiskSizeGb === "number") + message.defaultDiskSizeGb = object.defaultDiskSizeGb; + else if (typeof object.defaultDiskSizeGb === "object") + message.defaultDiskSizeGb = new $util.LongBits(object.defaultDiskSizeGb.low >>> 0, object.defaultDiskSizeGb.high >>> 0).toNumber(); + if (object.deprecated != null) { + if (typeof object.deprecated !== "object") + throw TypeError(".google.cloud.compute.v1.DiskType.deprecated: object expected"); + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecated); + } + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.validDiskSize != null) + message.validDiskSize = String(object.validDiskSize); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DiskType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskType + * @static + * @param {google.cloud.compute.v1.DiskType} message DiskType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.defaultDiskSizeGb != null && message.hasOwnProperty("defaultDiskSizeGb")) { + if (typeof message.defaultDiskSizeGb === "number") + object.defaultDiskSizeGb = options.longs === String ? String(message.defaultDiskSizeGb) : message.defaultDiskSizeGb; + else + object.defaultDiskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.defaultDiskSizeGb) : options.longs === Number ? new $util.LongBits(message.defaultDiskSizeGb.low >>> 0, message.defaultDiskSizeGb.high >>> 0).toNumber() : message.defaultDiskSizeGb; + if (options.oneofs) + object._defaultDiskSizeGb = "defaultDiskSizeGb"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.validDiskSize != null && message.hasOwnProperty("validDiskSize")) { + object.validDiskSize = message.validDiskSize; + if (options.oneofs) + object._validDiskSize = "validDiskSize"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecated, options); + if (options.oneofs) + object._deprecated = "deprecated"; + } + return object; + }; + + /** + * Converts this DiskType to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskType + * @instance + * @returns {Object.} JSON object + */ + DiskType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DiskType; + })(); + + v1.DiskTypesScopedList = (function() { + + /** + * Properties of a DiskTypesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IDiskTypesScopedList + * @property {Array.|null} [diskTypes] DiskTypesScopedList diskTypes + * @property {google.cloud.compute.v1.IWarning|null} [warning] DiskTypesScopedList warning + */ + + /** + * Constructs a new DiskTypesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskTypesScopedList. + * @implements IDiskTypesScopedList + * @constructor + * @param {google.cloud.compute.v1.IDiskTypesScopedList=} [properties] Properties to set + */ + function DiskTypesScopedList(properties) { + this.diskTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskTypesScopedList diskTypes. + * @member {Array.} diskTypes + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @instance + */ + DiskTypesScopedList.prototype.diskTypes = $util.emptyArray; + + /** + * DiskTypesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @instance + */ + DiskTypesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskTypesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @instance + */ + Object.defineProperty(DiskTypesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskTypesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {google.cloud.compute.v1.IDiskTypesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskTypesScopedList} DiskTypesScopedList instance + */ + DiskTypesScopedList.create = function create(properties) { + return new DiskTypesScopedList(properties); + }; + + /** + * Encodes the specified DiskTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.DiskTypesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {google.cloud.compute.v1.IDiskTypesScopedList} message DiskTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTypesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.diskTypes != null && message.diskTypes.length) + for (var i = 0; i < message.diskTypes.length; ++i) + $root.google.cloud.compute.v1.DiskType.encode(message.diskTypes[i], writer.uint32(/* id 198926167, wireType 2 =*/1591409338).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiskTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskTypesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {google.cloud.compute.v1.IDiskTypesScopedList} message DiskTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTypesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskTypesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskTypesScopedList} DiskTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTypesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskTypesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 198926167: + if (!(message.diskTypes && message.diskTypes.length)) + message.diskTypes = []; + message.diskTypes.push($root.google.cloud.compute.v1.DiskType.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskTypesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskTypesScopedList} DiskTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTypesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskTypesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskTypesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskTypes != null && message.hasOwnProperty("diskTypes")) { + if (!Array.isArray(message.diskTypes)) + return "diskTypes: array expected"; + for (var i = 0; i < message.diskTypes.length; ++i) { + var error = $root.google.cloud.compute.v1.DiskType.verify(message.diskTypes[i]); + if (error) + return "diskTypes." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a DiskTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskTypesScopedList} DiskTypesScopedList + */ + DiskTypesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskTypesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.DiskTypesScopedList(); + if (object.diskTypes) { + if (!Array.isArray(object.diskTypes)) + throw TypeError(".google.cloud.compute.v1.DiskTypesScopedList.diskTypes: array expected"); + message.diskTypes = []; + for (var i = 0; i < object.diskTypes.length; ++i) { + if (typeof object.diskTypes[i] !== "object") + throw TypeError(".google.cloud.compute.v1.DiskTypesScopedList.diskTypes: object expected"); + message.diskTypes[i] = $root.google.cloud.compute.v1.DiskType.fromObject(object.diskTypes[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.DiskTypesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a DiskTypesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @static + * @param {google.cloud.compute.v1.DiskTypesScopedList} message DiskTypesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskTypesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.diskTypes = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.diskTypes && message.diskTypes.length) { + object.diskTypes = []; + for (var j = 0; j < message.diskTypes.length; ++j) + object.diskTypes[j] = $root.google.cloud.compute.v1.DiskType.toObject(message.diskTypes[j], options); + } + return object; + }; + + /** + * Converts this DiskTypesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskTypesScopedList + * @instance + * @returns {Object.} JSON object + */ + DiskTypesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DiskTypesScopedList; + })(); + + v1.DiskTypeAggregatedList = (function() { + + /** + * Properties of a DiskTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IDiskTypeAggregatedList + * @property {string|null} [id] DiskTypeAggregatedList id + * @property {Object.|null} [items] DiskTypeAggregatedList items + * @property {string|null} [kind] DiskTypeAggregatedList kind + * @property {string|null} [nextPageToken] DiskTypeAggregatedList nextPageToken + * @property {string|null} [selfLink] DiskTypeAggregatedList selfLink + * @property {Array.|null} [unreachables] DiskTypeAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] DiskTypeAggregatedList warning + */ + + /** + * Constructs a new DiskTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskTypeAggregatedList. + * @implements IDiskTypeAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IDiskTypeAggregatedList=} [properties] Properties to set + */ + function DiskTypeAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskTypeAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + DiskTypeAggregatedList.prototype.id = null; + + /** + * DiskTypeAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + DiskTypeAggregatedList.prototype.items = $util.emptyObject; + + /** + * DiskTypeAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + DiskTypeAggregatedList.prototype.kind = null; + + /** + * DiskTypeAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + DiskTypeAggregatedList.prototype.nextPageToken = null; + + /** + * DiskTypeAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + DiskTypeAggregatedList.prototype.selfLink = null; + + /** + * DiskTypeAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + DiskTypeAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * DiskTypeAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + DiskTypeAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskTypeAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + Object.defineProperty(DiskTypeAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + Object.defineProperty(DiskTypeAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + Object.defineProperty(DiskTypeAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + Object.defineProperty(DiskTypeAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + */ + Object.defineProperty(DiskTypeAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskTypeAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IDiskTypeAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskTypeAggregatedList} DiskTypeAggregatedList instance + */ + DiskTypeAggregatedList.create = function create(properties) { + return new DiskTypeAggregatedList(properties); + }; + + /** + * Encodes the specified DiskTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.DiskTypeAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IDiskTypeAggregatedList} message DiskTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTypeAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.DiskTypesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified DiskTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskTypeAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IDiskTypeAggregatedList} message DiskTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTypeAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskTypeAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskTypeAggregatedList} DiskTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTypeAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskTypeAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.DiskTypesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskTypeAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskTypeAggregatedList} DiskTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTypeAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskTypeAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskTypeAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.DiskTypesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a DiskTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskTypeAggregatedList} DiskTypeAggregatedList + */ + DiskTypeAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskTypeAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.DiskTypeAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.DiskTypeAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.DiskTypeAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.DiskTypesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.DiskTypeAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.DiskTypeAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a DiskTypeAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.DiskTypeAggregatedList} message DiskTypeAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskTypeAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.DiskTypesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this DiskTypeAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskTypeAggregatedList + * @instance + * @returns {Object.} JSON object + */ + DiskTypeAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DiskTypeAggregatedList; + })(); + + v1.DiskTypeList = (function() { + + /** + * Properties of a DiskTypeList. + * @memberof google.cloud.compute.v1 + * @interface IDiskTypeList + * @property {string|null} [id] DiskTypeList id + * @property {Array.|null} [items] DiskTypeList items + * @property {string|null} [kind] DiskTypeList kind + * @property {string|null} [nextPageToken] DiskTypeList nextPageToken + * @property {string|null} [selfLink] DiskTypeList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] DiskTypeList warning + */ + + /** + * Constructs a new DiskTypeList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskTypeList. + * @implements IDiskTypeList + * @constructor + * @param {google.cloud.compute.v1.IDiskTypeList=} [properties] Properties to set + */ + function DiskTypeList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskTypeList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + DiskTypeList.prototype.id = null; + + /** + * DiskTypeList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + DiskTypeList.prototype.items = $util.emptyArray; + + /** + * DiskTypeList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + DiskTypeList.prototype.kind = null; + + /** + * DiskTypeList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + DiskTypeList.prototype.nextPageToken = null; + + /** + * DiskTypeList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + DiskTypeList.prototype.selfLink = null; + + /** + * DiskTypeList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + DiskTypeList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DiskTypeList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + Object.defineProperty(DiskTypeList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + Object.defineProperty(DiskTypeList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + Object.defineProperty(DiskTypeList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + Object.defineProperty(DiskTypeList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DiskTypeList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + */ + Object.defineProperty(DiskTypeList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskTypeList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {google.cloud.compute.v1.IDiskTypeList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DiskTypeList} DiskTypeList instance + */ + DiskTypeList.create = function create(properties) { + return new DiskTypeList(properties); + }; + + /** + * Encodes the specified DiskTypeList message. Does not implicitly {@link google.cloud.compute.v1.DiskTypeList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {google.cloud.compute.v1.IDiskTypeList} message DiskTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTypeList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.DiskType.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified DiskTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DiskTypeList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {google.cloud.compute.v1.IDiskTypeList} message DiskTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTypeList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskTypeList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DiskTypeList} DiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTypeList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DiskTypeList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.DiskType.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskTypeList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DiskTypeList} DiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTypeList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskTypeList message. + * @function verify + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskTypeList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.DiskType.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a DiskTypeList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DiskTypeList} DiskTypeList + */ + DiskTypeList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DiskTypeList) + return object; + var message = new $root.google.cloud.compute.v1.DiskTypeList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.DiskTypeList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.DiskTypeList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.DiskType.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.DiskTypeList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a DiskTypeList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DiskTypeList + * @static + * @param {google.cloud.compute.v1.DiskTypeList} message DiskTypeList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskTypeList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.DiskType.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this DiskTypeList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DiskTypeList + * @instance + * @returns {Object.} JSON object + */ + DiskTypeList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DiskTypeList; + })(); + + v1.DisksAddResourcePoliciesRequest = (function() { + + /** + * Properties of a DisksAddResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IDisksAddResourcePoliciesRequest + * @property {Array.|null} [resourcePolicies] DisksAddResourcePoliciesRequest resourcePolicies + */ + + /** + * Constructs a new DisksAddResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DisksAddResourcePoliciesRequest. + * @implements IDisksAddResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IDisksAddResourcePoliciesRequest=} [properties] Properties to set + */ + function DisksAddResourcePoliciesRequest(properties) { + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisksAddResourcePoliciesRequest resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @instance + */ + DisksAddResourcePoliciesRequest.prototype.resourcePolicies = $util.emptyArray; + + /** + * Creates a new DisksAddResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IDisksAddResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DisksAddResourcePoliciesRequest} DisksAddResourcePoliciesRequest instance + */ + DisksAddResourcePoliciesRequest.create = function create(properties) { + return new DisksAddResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified DisksAddResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.DisksAddResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IDisksAddResourcePoliciesRequest} message DisksAddResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksAddResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + return writer; + }; + + /** + * Encodes the specified DisksAddResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksAddResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IDisksAddResourcePoliciesRequest} message DisksAddResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksAddResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisksAddResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DisksAddResourcePoliciesRequest} DisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksAddResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisksAddResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DisksAddResourcePoliciesRequest} DisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksAddResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisksAddResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisksAddResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + return null; + }; + + /** + * Creates a DisksAddResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DisksAddResourcePoliciesRequest} DisksAddResourcePoliciesRequest + */ + DisksAddResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.DisksAddResourcePoliciesRequest.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + return message; + }; + + /** + * Creates a plain object from a DisksAddResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.DisksAddResourcePoliciesRequest} message DisksAddResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisksAddResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + return object; + }; + + /** + * Converts this DisksAddResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DisksAddResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + DisksAddResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DisksAddResourcePoliciesRequest; + })(); + + v1.DisksRemoveResourcePoliciesRequest = (function() { + + /** + * Properties of a DisksRemoveResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IDisksRemoveResourcePoliciesRequest + * @property {Array.|null} [resourcePolicies] DisksRemoveResourcePoliciesRequest resourcePolicies + */ + + /** + * Constructs a new DisksRemoveResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DisksRemoveResourcePoliciesRequest. + * @implements IDisksRemoveResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest=} [properties] Properties to set + */ + function DisksRemoveResourcePoliciesRequest(properties) { + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisksRemoveResourcePoliciesRequest resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @instance + */ + DisksRemoveResourcePoliciesRequest.prototype.resourcePolicies = $util.emptyArray; + + /** + * Creates a new DisksRemoveResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest} DisksRemoveResourcePoliciesRequest instance + */ + DisksRemoveResourcePoliciesRequest.create = function create(properties) { + return new DisksRemoveResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified DisksRemoveResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest} message DisksRemoveResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksRemoveResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + return writer; + }; + + /** + * Encodes the specified DisksRemoveResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest} message DisksRemoveResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksRemoveResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisksRemoveResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest} DisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksRemoveResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisksRemoveResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest} DisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksRemoveResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisksRemoveResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisksRemoveResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + return null; + }; + + /** + * Creates a DisksRemoveResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest} DisksRemoveResourcePoliciesRequest + */ + DisksRemoveResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + return message; + }; + + /** + * Creates a plain object from a DisksRemoveResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest} message DisksRemoveResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisksRemoveResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + return object; + }; + + /** + * Converts this DisksRemoveResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + DisksRemoveResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DisksRemoveResourcePoliciesRequest; + })(); + + v1.DisksResizeRequest = (function() { + + /** + * Properties of a DisksResizeRequest. + * @memberof google.cloud.compute.v1 + * @interface IDisksResizeRequest + * @property {number|Long|null} [sizeGb] DisksResizeRequest sizeGb + */ + + /** + * Constructs a new DisksResizeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DisksResizeRequest. + * @implements IDisksResizeRequest + * @constructor + * @param {google.cloud.compute.v1.IDisksResizeRequest=} [properties] Properties to set + */ + function DisksResizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisksResizeRequest sizeGb. + * @member {number|Long|null|undefined} sizeGb + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @instance + */ + DisksResizeRequest.prototype.sizeGb = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisksResizeRequest _sizeGb. + * @member {"sizeGb"|undefined} _sizeGb + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @instance + */ + Object.defineProperty(DisksResizeRequest.prototype, "_sizeGb", { + get: $util.oneOfGetter($oneOfFields = ["sizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisksResizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {google.cloud.compute.v1.IDisksResizeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DisksResizeRequest} DisksResizeRequest instance + */ + DisksResizeRequest.create = function create(properties) { + return new DisksResizeRequest(properties); + }; + + /** + * Encodes the specified DisksResizeRequest message. Does not implicitly {@link google.cloud.compute.v1.DisksResizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {google.cloud.compute.v1.IDisksResizeRequest} message DisksResizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksResizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 494929369, wireType 0 =*/3959434952).int64(message.sizeGb); + return writer; + }; + + /** + * Encodes the specified DisksResizeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisksResizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {google.cloud.compute.v1.IDisksResizeRequest} message DisksResizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisksResizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisksResizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DisksResizeRequest} DisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksResizeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DisksResizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 494929369: + message.sizeGb = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisksResizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DisksResizeRequest} DisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisksResizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisksResizeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisksResizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + properties._sizeGb = 1; + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + } + return null; + }; + + /** + * Creates a DisksResizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DisksResizeRequest} DisksResizeRequest + */ + DisksResizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DisksResizeRequest) + return object; + var message = new $root.google.cloud.compute.v1.DisksResizeRequest(); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DisksResizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @static + * @param {google.cloud.compute.v1.DisksResizeRequest} message DisksResizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisksResizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (options.oneofs) + object._sizeGb = "sizeGb"; + } + return object; + }; + + /** + * Converts this DisksResizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DisksResizeRequest + * @instance + * @returns {Object.} JSON object + */ + DisksResizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DisksResizeRequest; + })(); + + v1.DisplayDevice = (function() { + + /** + * Properties of a DisplayDevice. + * @memberof google.cloud.compute.v1 + * @interface IDisplayDevice + * @property {boolean|null} [enableDisplay] DisplayDevice enableDisplay + */ + + /** + * Constructs a new DisplayDevice. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DisplayDevice. + * @implements IDisplayDevice + * @constructor + * @param {google.cloud.compute.v1.IDisplayDevice=} [properties] Properties to set + */ + function DisplayDevice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisplayDevice enableDisplay. + * @member {boolean|null|undefined} enableDisplay + * @memberof google.cloud.compute.v1.DisplayDevice + * @instance + */ + DisplayDevice.prototype.enableDisplay = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisplayDevice _enableDisplay. + * @member {"enableDisplay"|undefined} _enableDisplay + * @memberof google.cloud.compute.v1.DisplayDevice + * @instance + */ + Object.defineProperty(DisplayDevice.prototype, "_enableDisplay", { + get: $util.oneOfGetter($oneOfFields = ["enableDisplay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {google.cloud.compute.v1.IDisplayDevice=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DisplayDevice} DisplayDevice instance + */ + DisplayDevice.create = function create(properties) { + return new DisplayDevice(properties); + }; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.compute.v1.DisplayDevice.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {google.cloud.compute.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableDisplay != null && Object.hasOwnProperty.call(message, "enableDisplay")) + writer.uint32(/* id 14266886, wireType 0 =*/114135088).bool(message.enableDisplay); + return writer; + }; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisplayDevice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {google.cloud.compute.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DisplayDevice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 14266886: + message.enableDisplay = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisplayDevice message. + * @function verify + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisplayDevice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + properties._enableDisplay = 1; + if (typeof message.enableDisplay !== "boolean") + return "enableDisplay: boolean expected"; + } + return null; + }; + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DisplayDevice} DisplayDevice + */ + DisplayDevice.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DisplayDevice) + return object; + var message = new $root.google.cloud.compute.v1.DisplayDevice(); + if (object.enableDisplay != null) + message.enableDisplay = Boolean(object.enableDisplay); + return message; + }; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DisplayDevice + * @static + * @param {google.cloud.compute.v1.DisplayDevice} message DisplayDevice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisplayDevice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + object.enableDisplay = message.enableDisplay; + if (options.oneofs) + object._enableDisplay = "enableDisplay"; + } + return object; + }; + + /** + * Converts this DisplayDevice to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DisplayDevice + * @instance + * @returns {Object.} JSON object + */ + DisplayDevice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DisplayDevice; + })(); + + v1.DistributionPolicyZoneConfiguration = (function() { + + /** + * Properties of a DistributionPolicyZoneConfiguration. + * @memberof google.cloud.compute.v1 + * @interface IDistributionPolicyZoneConfiguration + * @property {string|null} [zone] DistributionPolicyZoneConfiguration zone + */ + + /** + * Constructs a new DistributionPolicyZoneConfiguration. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DistributionPolicyZoneConfiguration. + * @implements IDistributionPolicyZoneConfiguration + * @constructor + * @param {google.cloud.compute.v1.IDistributionPolicyZoneConfiguration=} [properties] Properties to set + */ + function DistributionPolicyZoneConfiguration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DistributionPolicyZoneConfiguration zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @instance + */ + DistributionPolicyZoneConfiguration.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DistributionPolicyZoneConfiguration _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @instance + */ + Object.defineProperty(DistributionPolicyZoneConfiguration.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DistributionPolicyZoneConfiguration instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {google.cloud.compute.v1.IDistributionPolicyZoneConfiguration=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DistributionPolicyZoneConfiguration} DistributionPolicyZoneConfiguration instance + */ + DistributionPolicyZoneConfiguration.create = function create(properties) { + return new DistributionPolicyZoneConfiguration(properties); + }; + + /** + * Encodes the specified DistributionPolicyZoneConfiguration message. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicyZoneConfiguration.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {google.cloud.compute.v1.IDistributionPolicyZoneConfiguration} message DistributionPolicyZoneConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionPolicyZoneConfiguration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + return writer; + }; + + /** + * Encodes the specified DistributionPolicyZoneConfiguration message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicyZoneConfiguration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {google.cloud.compute.v1.IDistributionPolicyZoneConfiguration} message DistributionPolicyZoneConfiguration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionPolicyZoneConfiguration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DistributionPolicyZoneConfiguration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DistributionPolicyZoneConfiguration} DistributionPolicyZoneConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionPolicyZoneConfiguration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DistributionPolicyZoneConfiguration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DistributionPolicyZoneConfiguration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DistributionPolicyZoneConfiguration} DistributionPolicyZoneConfiguration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionPolicyZoneConfiguration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DistributionPolicyZoneConfiguration message. + * @function verify + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DistributionPolicyZoneConfiguration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a DistributionPolicyZoneConfiguration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DistributionPolicyZoneConfiguration} DistributionPolicyZoneConfiguration + */ + DistributionPolicyZoneConfiguration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DistributionPolicyZoneConfiguration) + return object; + var message = new $root.google.cloud.compute.v1.DistributionPolicyZoneConfiguration(); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DistributionPolicyZoneConfiguration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @static + * @param {google.cloud.compute.v1.DistributionPolicyZoneConfiguration} message DistributionPolicyZoneConfiguration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DistributionPolicyZoneConfiguration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + return object; + }; + + /** + * Converts this DistributionPolicyZoneConfiguration to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DistributionPolicyZoneConfiguration + * @instance + * @returns {Object.} JSON object + */ + DistributionPolicyZoneConfiguration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DistributionPolicyZoneConfiguration; + })(); + + v1.DistributionPolicy = (function() { + + /** + * Properties of a DistributionPolicy. + * @memberof google.cloud.compute.v1 + * @interface IDistributionPolicy + * @property {google.cloud.compute.v1.DistributionPolicy.TargetShape|null} [targetShape] DistributionPolicy targetShape + * @property {Array.|null} [zones] DistributionPolicy zones + */ + + /** + * Constructs a new DistributionPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DistributionPolicy. + * @implements IDistributionPolicy + * @constructor + * @param {google.cloud.compute.v1.IDistributionPolicy=} [properties] Properties to set + */ + function DistributionPolicy(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]]; + } + + /** + * DistributionPolicy targetShape. + * @member {google.cloud.compute.v1.DistributionPolicy.TargetShape|null|undefined} targetShape + * @memberof google.cloud.compute.v1.DistributionPolicy + * @instance + */ + DistributionPolicy.prototype.targetShape = null; + + /** + * DistributionPolicy zones. + * @member {Array.} zones + * @memberof google.cloud.compute.v1.DistributionPolicy + * @instance + */ + DistributionPolicy.prototype.zones = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DistributionPolicy _targetShape. + * @member {"targetShape"|undefined} _targetShape + * @memberof google.cloud.compute.v1.DistributionPolicy + * @instance + */ + Object.defineProperty(DistributionPolicy.prototype, "_targetShape", { + get: $util.oneOfGetter($oneOfFields = ["targetShape"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DistributionPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {google.cloud.compute.v1.IDistributionPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DistributionPolicy} DistributionPolicy instance + */ + DistributionPolicy.create = function create(properties) { + return new DistributionPolicy(properties); + }; + + /** + * Encodes the specified DistributionPolicy message. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {google.cloud.compute.v1.IDistributionPolicy} message DistributionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionPolicy.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.compute.v1.DistributionPolicyZoneConfiguration.encode(message.zones[i], writer.uint32(/* id 116085319, wireType 2 =*/928682554).fork()).ldelim(); + if (message.targetShape != null && Object.hasOwnProperty.call(message, "targetShape")) + writer.uint32(/* id 338621299, wireType 0 =*/2708970392).int32(message.targetShape); + return writer; + }; + + /** + * Encodes the specified DistributionPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DistributionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {google.cloud.compute.v1.IDistributionPolicy} message DistributionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistributionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DistributionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DistributionPolicy} DistributionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DistributionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 338621299: + message.targetShape = reader.int32(); + break; + case 116085319: + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push($root.google.cloud.compute.v1.DistributionPolicyZoneConfiguration.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DistributionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DistributionPolicy} DistributionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistributionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DistributionPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DistributionPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetShape != null && message.hasOwnProperty("targetShape")) { + properties._targetShape = 1; + switch (message.targetShape) { + default: + return "targetShape: enum value expected"; + case 0: + case 64972: + case 468409608: + case 2140442: + break; + } + } + 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.compute.v1.DistributionPolicyZoneConfiguration.verify(message.zones[i]); + if (error) + return "zones." + error; + } + } + return null; + }; + + /** + * Creates a DistributionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DistributionPolicy} DistributionPolicy + */ + DistributionPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DistributionPolicy) + return object; + var message = new $root.google.cloud.compute.v1.DistributionPolicy(); + switch (object.targetShape) { + case "UNDEFINED_TARGET_SHAPE": + case 0: + message.targetShape = 0; + break; + case "ANY": + case 64972: + message.targetShape = 64972; + break; + case "BALANCED": + case 468409608: + message.targetShape = 468409608; + break; + case "EVEN": + case 2140442: + message.targetShape = 2140442; + break; + } + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.compute.v1.DistributionPolicy.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) { + if (typeof object.zones[i] !== "object") + throw TypeError(".google.cloud.compute.v1.DistributionPolicy.zones: object expected"); + message.zones[i] = $root.google.cloud.compute.v1.DistributionPolicyZoneConfiguration.fromObject(object.zones[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DistributionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DistributionPolicy + * @static + * @param {google.cloud.compute.v1.DistributionPolicy} message DistributionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DistributionPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.zones = []; + if (message.zones && message.zones.length) { + object.zones = []; + for (var j = 0; j < message.zones.length; ++j) + object.zones[j] = $root.google.cloud.compute.v1.DistributionPolicyZoneConfiguration.toObject(message.zones[j], options); + } + if (message.targetShape != null && message.hasOwnProperty("targetShape")) { + object.targetShape = options.enums === String ? $root.google.cloud.compute.v1.DistributionPolicy.TargetShape[message.targetShape] : message.targetShape; + if (options.oneofs) + object._targetShape = "targetShape"; + } + return object; + }; + + /** + * Converts this DistributionPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DistributionPolicy + * @instance + * @returns {Object.} JSON object + */ + DistributionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * TargetShape enum. + * @name google.cloud.compute.v1.DistributionPolicy.TargetShape + * @enum {number} + * @property {number} UNDEFINED_TARGET_SHAPE=0 UNDEFINED_TARGET_SHAPE value + * @property {number} ANY=64972 ANY value + * @property {number} BALANCED=468409608 BALANCED value + * @property {number} EVEN=2140442 EVEN value + */ + DistributionPolicy.TargetShape = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TARGET_SHAPE"] = 0; + values[valuesById[64972] = "ANY"] = 64972; + values[valuesById[468409608] = "BALANCED"] = 468409608; + values[valuesById[2140442] = "EVEN"] = 2140442; + return values; + })(); + + return DistributionPolicy; + })(); + + v1.ExchangedPeeringRoute = (function() { + + /** + * Properties of an ExchangedPeeringRoute. + * @memberof google.cloud.compute.v1 + * @interface IExchangedPeeringRoute + * @property {string|null} [destRange] ExchangedPeeringRoute destRange + * @property {boolean|null} [imported] ExchangedPeeringRoute imported + * @property {string|null} [nextHopRegion] ExchangedPeeringRoute nextHopRegion + * @property {number|null} [priority] ExchangedPeeringRoute priority + * @property {google.cloud.compute.v1.ExchangedPeeringRoute.Type|null} [type] ExchangedPeeringRoute type + */ + + /** + * Constructs a new ExchangedPeeringRoute. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ExchangedPeeringRoute. + * @implements IExchangedPeeringRoute + * @constructor + * @param {google.cloud.compute.v1.IExchangedPeeringRoute=} [properties] Properties to set + */ + function ExchangedPeeringRoute(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExchangedPeeringRoute destRange. + * @member {string|null|undefined} destRange + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + ExchangedPeeringRoute.prototype.destRange = null; + + /** + * ExchangedPeeringRoute imported. + * @member {boolean|null|undefined} imported + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + ExchangedPeeringRoute.prototype.imported = null; + + /** + * ExchangedPeeringRoute nextHopRegion. + * @member {string|null|undefined} nextHopRegion + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + ExchangedPeeringRoute.prototype.nextHopRegion = null; + + /** + * ExchangedPeeringRoute priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + ExchangedPeeringRoute.prototype.priority = null; + + /** + * ExchangedPeeringRoute type. + * @member {google.cloud.compute.v1.ExchangedPeeringRoute.Type|null|undefined} type + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + ExchangedPeeringRoute.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExchangedPeeringRoute _destRange. + * @member {"destRange"|undefined} _destRange + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + Object.defineProperty(ExchangedPeeringRoute.prototype, "_destRange", { + get: $util.oneOfGetter($oneOfFields = ["destRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoute _imported. + * @member {"imported"|undefined} _imported + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + Object.defineProperty(ExchangedPeeringRoute.prototype, "_imported", { + get: $util.oneOfGetter($oneOfFields = ["imported"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoute _nextHopRegion. + * @member {"nextHopRegion"|undefined} _nextHopRegion + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + Object.defineProperty(ExchangedPeeringRoute.prototype, "_nextHopRegion", { + get: $util.oneOfGetter($oneOfFields = ["nextHopRegion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoute _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + Object.defineProperty(ExchangedPeeringRoute.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoute _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + */ + Object.defineProperty(ExchangedPeeringRoute.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExchangedPeeringRoute instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {google.cloud.compute.v1.IExchangedPeeringRoute=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ExchangedPeeringRoute} ExchangedPeeringRoute instance + */ + ExchangedPeeringRoute.create = function create(properties) { + return new ExchangedPeeringRoute(properties); + }; + + /** + * Encodes the specified ExchangedPeeringRoute message. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoute.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {google.cloud.compute.v1.IExchangedPeeringRoute} message ExchangedPeeringRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExchangedPeeringRoute.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.imported != null && Object.hasOwnProperty.call(message, "imported")) + writer.uint32(/* id 114502404, wireType 0 =*/916019232).bool(message.imported); + if (message.nextHopRegion != null && Object.hasOwnProperty.call(message, "nextHopRegion")) + writer.uint32(/* id 122577014, wireType 2 =*/980616114).string(message.nextHopRegion); + if (message.destRange != null && Object.hasOwnProperty.call(message, "destRange")) + writer.uint32(/* id 381327712, wireType 2 =*/3050621698).string(message.destRange); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).uint32(message.priority); + return writer; + }; + + /** + * Encodes the specified ExchangedPeeringRoute message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoute.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {google.cloud.compute.v1.IExchangedPeeringRoute} message ExchangedPeeringRoute message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExchangedPeeringRoute.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExchangedPeeringRoute message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ExchangedPeeringRoute} ExchangedPeeringRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExchangedPeeringRoute.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ExchangedPeeringRoute(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 381327712: + message.destRange = reader.string(); + break; + case 114502404: + message.imported = reader.bool(); + break; + case 122577014: + message.nextHopRegion = reader.string(); + break; + case 445151652: + message.priority = reader.uint32(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExchangedPeeringRoute message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ExchangedPeeringRoute} ExchangedPeeringRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExchangedPeeringRoute.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExchangedPeeringRoute message. + * @function verify + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExchangedPeeringRoute.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.destRange != null && message.hasOwnProperty("destRange")) { + properties._destRange = 1; + if (!$util.isString(message.destRange)) + return "destRange: string expected"; + } + if (message.imported != null && message.hasOwnProperty("imported")) { + properties._imported = 1; + if (typeof message.imported !== "boolean") + return "imported: boolean expected"; + } + if (message.nextHopRegion != null && message.hasOwnProperty("nextHopRegion")) { + properties._nextHopRegion = 1; + if (!$util.isString(message.nextHopRegion)) + return "nextHopRegion: string expected"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 469794858: + case 473407545: + case 465782504: + break; + } + } + return null; + }; + + /** + * Creates an ExchangedPeeringRoute message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ExchangedPeeringRoute} ExchangedPeeringRoute + */ + ExchangedPeeringRoute.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ExchangedPeeringRoute) + return object; + var message = new $root.google.cloud.compute.v1.ExchangedPeeringRoute(); + if (object.destRange != null) + message.destRange = String(object.destRange); + if (object.imported != null) + message.imported = Boolean(object.imported); + if (object.nextHopRegion != null) + message.nextHopRegion = String(object.nextHopRegion); + if (object.priority != null) + message.priority = object.priority >>> 0; + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "DYNAMIC_PEERING_ROUTE": + case 469794858: + message.type = 469794858; + break; + case "STATIC_PEERING_ROUTE": + case 473407545: + message.type = 473407545; + break; + case "SUBNET_PEERING_ROUTE": + case 465782504: + message.type = 465782504; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExchangedPeeringRoute message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @static + * @param {google.cloud.compute.v1.ExchangedPeeringRoute} message ExchangedPeeringRoute + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExchangedPeeringRoute.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.ExchangedPeeringRoute.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.imported != null && message.hasOwnProperty("imported")) { + object.imported = message.imported; + if (options.oneofs) + object._imported = "imported"; + } + if (message.nextHopRegion != null && message.hasOwnProperty("nextHopRegion")) { + object.nextHopRegion = message.nextHopRegion; + if (options.oneofs) + object._nextHopRegion = "nextHopRegion"; + } + if (message.destRange != null && message.hasOwnProperty("destRange")) { + object.destRange = message.destRange; + if (options.oneofs) + object._destRange = "destRange"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + return object; + }; + + /** + * Converts this ExchangedPeeringRoute to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ExchangedPeeringRoute + * @instance + * @returns {Object.} JSON object + */ + ExchangedPeeringRoute.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.ExchangedPeeringRoute.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} DYNAMIC_PEERING_ROUTE=469794858 DYNAMIC_PEERING_ROUTE value + * @property {number} STATIC_PEERING_ROUTE=473407545 STATIC_PEERING_ROUTE value + * @property {number} SUBNET_PEERING_ROUTE=465782504 SUBNET_PEERING_ROUTE value + */ + ExchangedPeeringRoute.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[469794858] = "DYNAMIC_PEERING_ROUTE"] = 469794858; + values[valuesById[473407545] = "STATIC_PEERING_ROUTE"] = 473407545; + values[valuesById[465782504] = "SUBNET_PEERING_ROUTE"] = 465782504; + return values; + })(); + + return ExchangedPeeringRoute; + })(); + + v1.ExchangedPeeringRoutesList = (function() { + + /** + * Properties of an ExchangedPeeringRoutesList. + * @memberof google.cloud.compute.v1 + * @interface IExchangedPeeringRoutesList + * @property {string|null} [id] ExchangedPeeringRoutesList id + * @property {Array.|null} [items] ExchangedPeeringRoutesList items + * @property {string|null} [kind] ExchangedPeeringRoutesList kind + * @property {string|null} [nextPageToken] ExchangedPeeringRoutesList nextPageToken + * @property {string|null} [selfLink] ExchangedPeeringRoutesList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] ExchangedPeeringRoutesList warning + */ + + /** + * Constructs a new ExchangedPeeringRoutesList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ExchangedPeeringRoutesList. + * @implements IExchangedPeeringRoutesList + * @constructor + * @param {google.cloud.compute.v1.IExchangedPeeringRoutesList=} [properties] Properties to set + */ + function ExchangedPeeringRoutesList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExchangedPeeringRoutesList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + ExchangedPeeringRoutesList.prototype.id = null; + + /** + * ExchangedPeeringRoutesList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + ExchangedPeeringRoutesList.prototype.items = $util.emptyArray; + + /** + * ExchangedPeeringRoutesList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + ExchangedPeeringRoutesList.prototype.kind = null; + + /** + * ExchangedPeeringRoutesList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + ExchangedPeeringRoutesList.prototype.nextPageToken = null; + + /** + * ExchangedPeeringRoutesList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + ExchangedPeeringRoutesList.prototype.selfLink = null; + + /** + * ExchangedPeeringRoutesList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + ExchangedPeeringRoutesList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExchangedPeeringRoutesList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + Object.defineProperty(ExchangedPeeringRoutesList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoutesList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + Object.defineProperty(ExchangedPeeringRoutesList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoutesList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + Object.defineProperty(ExchangedPeeringRoutesList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoutesList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + Object.defineProperty(ExchangedPeeringRoutesList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExchangedPeeringRoutesList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + */ + Object.defineProperty(ExchangedPeeringRoutesList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExchangedPeeringRoutesList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {google.cloud.compute.v1.IExchangedPeeringRoutesList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ExchangedPeeringRoutesList} ExchangedPeeringRoutesList instance + */ + ExchangedPeeringRoutesList.create = function create(properties) { + return new ExchangedPeeringRoutesList(properties); + }; + + /** + * Encodes the specified ExchangedPeeringRoutesList message. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoutesList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {google.cloud.compute.v1.IExchangedPeeringRoutesList} message ExchangedPeeringRoutesList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExchangedPeeringRoutesList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.ExchangedPeeringRoute.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ExchangedPeeringRoutesList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExchangedPeeringRoutesList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {google.cloud.compute.v1.IExchangedPeeringRoutesList} message ExchangedPeeringRoutesList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExchangedPeeringRoutesList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExchangedPeeringRoutesList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ExchangedPeeringRoutesList} ExchangedPeeringRoutesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExchangedPeeringRoutesList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ExchangedPeeringRoutesList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.ExchangedPeeringRoute.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExchangedPeeringRoutesList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ExchangedPeeringRoutesList} ExchangedPeeringRoutesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExchangedPeeringRoutesList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExchangedPeeringRoutesList message. + * @function verify + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExchangedPeeringRoutesList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.ExchangedPeeringRoute.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an ExchangedPeeringRoutesList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ExchangedPeeringRoutesList} ExchangedPeeringRoutesList + */ + ExchangedPeeringRoutesList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ExchangedPeeringRoutesList) + return object; + var message = new $root.google.cloud.compute.v1.ExchangedPeeringRoutesList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.ExchangedPeeringRoutesList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ExchangedPeeringRoutesList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.ExchangedPeeringRoute.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ExchangedPeeringRoutesList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an ExchangedPeeringRoutesList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @static + * @param {google.cloud.compute.v1.ExchangedPeeringRoutesList} message ExchangedPeeringRoutesList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExchangedPeeringRoutesList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.ExchangedPeeringRoute.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ExchangedPeeringRoutesList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ExchangedPeeringRoutesList + * @instance + * @returns {Object.} JSON object + */ + ExchangedPeeringRoutesList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExchangedPeeringRoutesList; + })(); + + v1.ExternalVpnGatewayInterface = (function() { + + /** + * Properties of an ExternalVpnGatewayInterface. + * @memberof google.cloud.compute.v1 + * @interface IExternalVpnGatewayInterface + * @property {number|null} [id] ExternalVpnGatewayInterface id + * @property {string|null} [ipAddress] ExternalVpnGatewayInterface ipAddress + */ + + /** + * Constructs a new ExternalVpnGatewayInterface. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ExternalVpnGatewayInterface. + * @implements IExternalVpnGatewayInterface + * @constructor + * @param {google.cloud.compute.v1.IExternalVpnGatewayInterface=} [properties] Properties to set + */ + function ExternalVpnGatewayInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalVpnGatewayInterface id. + * @member {number|null|undefined} id + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @instance + */ + ExternalVpnGatewayInterface.prototype.id = null; + + /** + * ExternalVpnGatewayInterface ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @instance + */ + ExternalVpnGatewayInterface.prototype.ipAddress = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExternalVpnGatewayInterface _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @instance + */ + Object.defineProperty(ExternalVpnGatewayInterface.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGatewayInterface _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @instance + */ + Object.defineProperty(ExternalVpnGatewayInterface.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExternalVpnGatewayInterface instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.IExternalVpnGatewayInterface=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ExternalVpnGatewayInterface} ExternalVpnGatewayInterface instance + */ + ExternalVpnGatewayInterface.create = function create(properties) { + return new ExternalVpnGatewayInterface(properties); + }; + + /** + * Encodes the specified ExternalVpnGatewayInterface message. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.IExternalVpnGatewayInterface} message ExternalVpnGatewayInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalVpnGatewayInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint32(message.id); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 406272220, wireType 2 =*/3250177762).string(message.ipAddress); + return writer; + }; + + /** + * Encodes the specified ExternalVpnGatewayInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.IExternalVpnGatewayInterface} message ExternalVpnGatewayInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalVpnGatewayInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalVpnGatewayInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ExternalVpnGatewayInterface} ExternalVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalVpnGatewayInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ExternalVpnGatewayInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.uint32(); + break; + case 406272220: + message.ipAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalVpnGatewayInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ExternalVpnGatewayInterface} ExternalVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalVpnGatewayInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalVpnGatewayInterface message. + * @function verify + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalVpnGatewayInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id)) + return "id: integer expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + return null; + }; + + /** + * Creates an ExternalVpnGatewayInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ExternalVpnGatewayInterface} ExternalVpnGatewayInterface + */ + ExternalVpnGatewayInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ExternalVpnGatewayInterface) + return object; + var message = new $root.google.cloud.compute.v1.ExternalVpnGatewayInterface(); + if (object.id != null) + message.id = object.id >>> 0; + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + return message; + }; + + /** + * Creates a plain object from an ExternalVpnGatewayInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.ExternalVpnGatewayInterface} message ExternalVpnGatewayInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalVpnGatewayInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + return object; + }; + + /** + * Converts this ExternalVpnGatewayInterface to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ExternalVpnGatewayInterface + * @instance + * @returns {Object.} JSON object + */ + ExternalVpnGatewayInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExternalVpnGatewayInterface; + })(); + + v1.ExternalVpnGateway = (function() { + + /** + * Properties of an ExternalVpnGateway. + * @memberof google.cloud.compute.v1 + * @interface IExternalVpnGateway + * @property {string|null} [creationTimestamp] ExternalVpnGateway creationTimestamp + * @property {string|null} [description] ExternalVpnGateway description + * @property {number|Long|null} [id] ExternalVpnGateway id + * @property {Array.|null} [interfaces] ExternalVpnGateway interfaces + * @property {string|null} [kind] ExternalVpnGateway kind + * @property {string|null} [labelFingerprint] ExternalVpnGateway labelFingerprint + * @property {Object.|null} [labels] ExternalVpnGateway labels + * @property {string|null} [name] ExternalVpnGateway name + * @property {google.cloud.compute.v1.ExternalVpnGateway.RedundancyType|null} [redundancyType] ExternalVpnGateway redundancyType + * @property {string|null} [selfLink] ExternalVpnGateway selfLink + */ + + /** + * Constructs a new ExternalVpnGateway. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ExternalVpnGateway. + * @implements IExternalVpnGateway + * @constructor + * @param {google.cloud.compute.v1.IExternalVpnGateway=} [properties] Properties to set + */ + function ExternalVpnGateway(properties) { + this.interfaces = []; + 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]]; + } + + /** + * ExternalVpnGateway creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.creationTimestamp = null; + + /** + * ExternalVpnGateway description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.description = null; + + /** + * ExternalVpnGateway id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.id = null; + + /** + * ExternalVpnGateway interfaces. + * @member {Array.} interfaces + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.interfaces = $util.emptyArray; + + /** + * ExternalVpnGateway kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.kind = null; + + /** + * ExternalVpnGateway labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.labelFingerprint = null; + + /** + * ExternalVpnGateway labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.labels = $util.emptyObject; + + /** + * ExternalVpnGateway name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.name = null; + + /** + * ExternalVpnGateway redundancyType. + * @member {google.cloud.compute.v1.ExternalVpnGateway.RedundancyType|null|undefined} redundancyType + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.redundancyType = null; + + /** + * ExternalVpnGateway selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + ExternalVpnGateway.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExternalVpnGateway _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGateway _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGateway _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGateway _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGateway _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGateway _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGateway _redundancyType. + * @member {"redundancyType"|undefined} _redundancyType + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_redundancyType", { + get: $util.oneOfGetter($oneOfFields = ["redundancyType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGateway _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + */ + Object.defineProperty(ExternalVpnGateway.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExternalVpnGateway instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {google.cloud.compute.v1.IExternalVpnGateway=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ExternalVpnGateway} ExternalVpnGateway instance + */ + ExternalVpnGateway.create = function create(properties) { + return new ExternalVpnGateway(properties); + }; + + /** + * Encodes the specified ExternalVpnGateway message. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGateway.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {google.cloud.compute.v1.IExternalVpnGateway} message ExternalVpnGateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalVpnGateway.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.interfaces != null && message.interfaces.length) + for (var i = 0; i < message.interfaces.length; ++i) + $root.google.cloud.compute.v1.ExternalVpnGatewayInterface.encode(message.interfaces[i], writer.uint32(/* id 12073562, wireType 2 =*/96588498).fork()).ldelim(); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + if (message.redundancyType != null && Object.hasOwnProperty.call(message, "redundancyType")) + writer.uint32(/* id 271443740, wireType 0 =*/2171549920).int32(message.redundancyType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + 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 500195327, wireType 2 =*/4001562618).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 ExternalVpnGateway message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGateway.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {google.cloud.compute.v1.IExternalVpnGateway} message ExternalVpnGateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalVpnGateway.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalVpnGateway message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ExternalVpnGateway} ExternalVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalVpnGateway.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ExternalVpnGateway(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 12073562: + if (!(message.interfaces && message.interfaces.length)) + message.interfaces = []; + message.interfaces.push($root.google.cloud.compute.v1.ExternalVpnGatewayInterface.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 3373707: + message.name = reader.string(); + break; + case 271443740: + message.redundancyType = reader.int32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalVpnGateway message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ExternalVpnGateway} ExternalVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalVpnGateway.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalVpnGateway message. + * @function verify + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalVpnGateway.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.interfaces != null && message.hasOwnProperty("interfaces")) { + if (!Array.isArray(message.interfaces)) + return "interfaces: array expected"; + for (var i = 0; i < message.interfaces.length; ++i) { + var error = $root.google.cloud.compute.v1.ExternalVpnGatewayInterface.verify(message.interfaces[i]); + if (error) + return "interfaces." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.redundancyType != null && message.hasOwnProperty("redundancyType")) { + properties._redundancyType = 1; + switch (message.redundancyType) { + default: + return "redundancyType: enum value expected"; + case 0: + case 520087913: + case 133914873: + case 367049635: + break; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates an ExternalVpnGateway message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ExternalVpnGateway} ExternalVpnGateway + */ + ExternalVpnGateway.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ExternalVpnGateway) + return object; + var message = new $root.google.cloud.compute.v1.ExternalVpnGateway(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.interfaces) { + if (!Array.isArray(object.interfaces)) + throw TypeError(".google.cloud.compute.v1.ExternalVpnGateway.interfaces: array expected"); + message.interfaces = []; + for (var i = 0; i < object.interfaces.length; ++i) { + if (typeof object.interfaces[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ExternalVpnGateway.interfaces: object expected"); + message.interfaces[i] = $root.google.cloud.compute.v1.ExternalVpnGatewayInterface.fromObject(object.interfaces[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.ExternalVpnGateway.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.name != null) + message.name = String(object.name); + switch (object.redundancyType) { + case "UNDEFINED_REDUNDANCY_TYPE": + case 0: + message.redundancyType = 0; + break; + case "FOUR_IPS_REDUNDANCY": + case 520087913: + message.redundancyType = 520087913; + break; + case "SINGLE_IP_INTERNALLY_REDUNDANT": + case 133914873: + message.redundancyType = 133914873; + break; + case "TWO_IPS_REDUNDANCY": + case 367049635: + message.redundancyType = 367049635; + break; + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from an ExternalVpnGateway message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @static + * @param {google.cloud.compute.v1.ExternalVpnGateway} message ExternalVpnGateway + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalVpnGateway.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.interfaces = []; + if (options.objects || options.defaults) + object.labels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.interfaces && message.interfaces.length) { + object.interfaces = []; + for (var j = 0; j < message.interfaces.length; ++j) + object.interfaces[j] = $root.google.cloud.compute.v1.ExternalVpnGatewayInterface.toObject(message.interfaces[j], options); + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + if (message.redundancyType != null && message.hasOwnProperty("redundancyType")) { + object.redundancyType = options.enums === String ? $root.google.cloud.compute.v1.ExternalVpnGateway.RedundancyType[message.redundancyType] : message.redundancyType; + if (options.oneofs) + object._redundancyType = "redundancyType"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + 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 ExternalVpnGateway to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ExternalVpnGateway + * @instance + * @returns {Object.} JSON object + */ + ExternalVpnGateway.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * RedundancyType enum. + * @name google.cloud.compute.v1.ExternalVpnGateway.RedundancyType + * @enum {number} + * @property {number} UNDEFINED_REDUNDANCY_TYPE=0 UNDEFINED_REDUNDANCY_TYPE value + * @property {number} FOUR_IPS_REDUNDANCY=520087913 FOUR_IPS_REDUNDANCY value + * @property {number} SINGLE_IP_INTERNALLY_REDUNDANT=133914873 SINGLE_IP_INTERNALLY_REDUNDANT value + * @property {number} TWO_IPS_REDUNDANCY=367049635 TWO_IPS_REDUNDANCY value + */ + ExternalVpnGateway.RedundancyType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_REDUNDANCY_TYPE"] = 0; + values[valuesById[520087913] = "FOUR_IPS_REDUNDANCY"] = 520087913; + values[valuesById[133914873] = "SINGLE_IP_INTERNALLY_REDUNDANT"] = 133914873; + values[valuesById[367049635] = "TWO_IPS_REDUNDANCY"] = 367049635; + return values; + })(); + + return ExternalVpnGateway; + })(); + + v1.ExternalVpnGatewayList = (function() { + + /** + * Properties of an ExternalVpnGatewayList. + * @memberof google.cloud.compute.v1 + * @interface IExternalVpnGatewayList + * @property {string|null} [etag] ExternalVpnGatewayList etag + * @property {string|null} [id] ExternalVpnGatewayList id + * @property {Array.|null} [items] ExternalVpnGatewayList items + * @property {string|null} [kind] ExternalVpnGatewayList kind + * @property {string|null} [nextPageToken] ExternalVpnGatewayList nextPageToken + * @property {string|null} [selfLink] ExternalVpnGatewayList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] ExternalVpnGatewayList warning + */ + + /** + * Constructs a new ExternalVpnGatewayList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ExternalVpnGatewayList. + * @implements IExternalVpnGatewayList + * @constructor + * @param {google.cloud.compute.v1.IExternalVpnGatewayList=} [properties] Properties to set + */ + function ExternalVpnGatewayList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExternalVpnGatewayList etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + ExternalVpnGatewayList.prototype.etag = null; + + /** + * ExternalVpnGatewayList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + ExternalVpnGatewayList.prototype.id = null; + + /** + * ExternalVpnGatewayList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + ExternalVpnGatewayList.prototype.items = $util.emptyArray; + + /** + * ExternalVpnGatewayList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + ExternalVpnGatewayList.prototype.kind = null; + + /** + * ExternalVpnGatewayList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + ExternalVpnGatewayList.prototype.nextPageToken = null; + + /** + * ExternalVpnGatewayList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + ExternalVpnGatewayList.prototype.selfLink = null; + + /** + * ExternalVpnGatewayList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + ExternalVpnGatewayList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExternalVpnGatewayList _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + Object.defineProperty(ExternalVpnGatewayList.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGatewayList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + Object.defineProperty(ExternalVpnGatewayList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGatewayList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + Object.defineProperty(ExternalVpnGatewayList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGatewayList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + Object.defineProperty(ExternalVpnGatewayList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGatewayList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + Object.defineProperty(ExternalVpnGatewayList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ExternalVpnGatewayList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + */ + Object.defineProperty(ExternalVpnGatewayList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExternalVpnGatewayList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {google.cloud.compute.v1.IExternalVpnGatewayList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ExternalVpnGatewayList} ExternalVpnGatewayList instance + */ + ExternalVpnGatewayList.create = function create(properties) { + return new ExternalVpnGatewayList(properties); + }; + + /** + * Encodes the specified ExternalVpnGatewayList message. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {google.cloud.compute.v1.IExternalVpnGatewayList} message ExternalVpnGatewayList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalVpnGatewayList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.ExternalVpnGateway.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ExternalVpnGatewayList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExternalVpnGatewayList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {google.cloud.compute.v1.IExternalVpnGatewayList} message ExternalVpnGatewayList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExternalVpnGatewayList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExternalVpnGatewayList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ExternalVpnGatewayList} ExternalVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalVpnGatewayList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ExternalVpnGatewayList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3123477: + message.etag = reader.string(); + break; + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.ExternalVpnGateway.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExternalVpnGatewayList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ExternalVpnGatewayList} ExternalVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExternalVpnGatewayList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExternalVpnGatewayList message. + * @function verify + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExternalVpnGatewayList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.ExternalVpnGateway.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an ExternalVpnGatewayList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ExternalVpnGatewayList} ExternalVpnGatewayList + */ + ExternalVpnGatewayList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ExternalVpnGatewayList) + return object; + var message = new $root.google.cloud.compute.v1.ExternalVpnGatewayList(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.ExternalVpnGatewayList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ExternalVpnGatewayList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.ExternalVpnGateway.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ExternalVpnGatewayList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an ExternalVpnGatewayList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @static + * @param {google.cloud.compute.v1.ExternalVpnGatewayList} message ExternalVpnGatewayList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExternalVpnGatewayList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.ExternalVpnGateway.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ExternalVpnGatewayList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ExternalVpnGatewayList + * @instance + * @returns {Object.} JSON object + */ + ExternalVpnGatewayList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExternalVpnGatewayList; + })(); + + v1.FileContentBuffer = (function() { + + /** + * Properties of a FileContentBuffer. + * @memberof google.cloud.compute.v1 + * @interface IFileContentBuffer + * @property {string|null} [content] FileContentBuffer content + * @property {google.cloud.compute.v1.FileContentBuffer.FileType|null} [fileType] FileContentBuffer fileType + */ + + /** + * Constructs a new FileContentBuffer. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FileContentBuffer. + * @implements IFileContentBuffer + * @constructor + * @param {google.cloud.compute.v1.IFileContentBuffer=} [properties] Properties to set + */ + function FileContentBuffer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileContentBuffer content. + * @member {string|null|undefined} content + * @memberof google.cloud.compute.v1.FileContentBuffer + * @instance + */ + FileContentBuffer.prototype.content = null; + + /** + * FileContentBuffer fileType. + * @member {google.cloud.compute.v1.FileContentBuffer.FileType|null|undefined} fileType + * @memberof google.cloud.compute.v1.FileContentBuffer + * @instance + */ + FileContentBuffer.prototype.fileType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FileContentBuffer _content. + * @member {"content"|undefined} _content + * @memberof google.cloud.compute.v1.FileContentBuffer + * @instance + */ + Object.defineProperty(FileContentBuffer.prototype, "_content", { + get: $util.oneOfGetter($oneOfFields = ["content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FileContentBuffer _fileType. + * @member {"fileType"|undefined} _fileType + * @memberof google.cloud.compute.v1.FileContentBuffer + * @instance + */ + Object.defineProperty(FileContentBuffer.prototype, "_fileType", { + get: $util.oneOfGetter($oneOfFields = ["fileType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FileContentBuffer instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {google.cloud.compute.v1.IFileContentBuffer=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FileContentBuffer} FileContentBuffer instance + */ + FileContentBuffer.create = function create(properties) { + return new FileContentBuffer(properties); + }; + + /** + * Encodes the specified FileContentBuffer message. Does not implicitly {@link google.cloud.compute.v1.FileContentBuffer.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {google.cloud.compute.v1.IFileContentBuffer} message FileContentBuffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileContentBuffer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileType != null && Object.hasOwnProperty.call(message, "fileType")) + writer.uint32(/* id 294346781, wireType 0 =*/2354774248).int32(message.fileType); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 414659705, wireType 2 =*/3317277642).string(message.content); + return writer; + }; + + /** + * Encodes the specified FileContentBuffer message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FileContentBuffer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {google.cloud.compute.v1.IFileContentBuffer} message FileContentBuffer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileContentBuffer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileContentBuffer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FileContentBuffer} FileContentBuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileContentBuffer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FileContentBuffer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 414659705: + message.content = reader.string(); + break; + case 294346781: + message.fileType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileContentBuffer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FileContentBuffer} FileContentBuffer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileContentBuffer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileContentBuffer message. + * @function verify + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileContentBuffer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + properties._content = 1; + if (!$util.isString(message.content)) + return "content: string expected"; + } + if (message.fileType != null && message.hasOwnProperty("fileType")) { + properties._fileType = 1; + switch (message.fileType) { + default: + return "fileType: enum value expected"; + case 0: + case 65767: + case 137851184: + case 2674086: + break; + } + } + return null; + }; + + /** + * Creates a FileContentBuffer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FileContentBuffer} FileContentBuffer + */ + FileContentBuffer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FileContentBuffer) + return object; + var message = new $root.google.cloud.compute.v1.FileContentBuffer(); + if (object.content != null) + message.content = String(object.content); + switch (object.fileType) { + case "UNDEFINED_FILE_TYPE": + case 0: + message.fileType = 0; + break; + case "BIN": + case 65767: + message.fileType = 65767; + break; + case "UNDEFINED": + case 137851184: + message.fileType = 137851184; + break; + case "X509": + case 2674086: + message.fileType = 2674086; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileContentBuffer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FileContentBuffer + * @static + * @param {google.cloud.compute.v1.FileContentBuffer} message FileContentBuffer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileContentBuffer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.fileType != null && message.hasOwnProperty("fileType")) { + object.fileType = options.enums === String ? $root.google.cloud.compute.v1.FileContentBuffer.FileType[message.fileType] : message.fileType; + if (options.oneofs) + object._fileType = "fileType"; + } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object._content = "content"; + } + return object; + }; + + /** + * Converts this FileContentBuffer to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FileContentBuffer + * @instance + * @returns {Object.} JSON object + */ + FileContentBuffer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * FileType enum. + * @name google.cloud.compute.v1.FileContentBuffer.FileType + * @enum {number} + * @property {number} UNDEFINED_FILE_TYPE=0 UNDEFINED_FILE_TYPE value + * @property {number} BIN=65767 BIN value + * @property {number} UNDEFINED=137851184 UNDEFINED value + * @property {number} X509=2674086 X509 value + */ + FileContentBuffer.FileType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_FILE_TYPE"] = 0; + values[valuesById[65767] = "BIN"] = 65767; + values[valuesById[137851184] = "UNDEFINED"] = 137851184; + values[valuesById[2674086] = "X509"] = 2674086; + return values; + })(); + + return FileContentBuffer; + })(); + + v1.Allowed = (function() { + + /** + * Properties of an Allowed. + * @memberof google.cloud.compute.v1 + * @interface IAllowed + * @property {string|null} [IPProtocol] Allowed IPProtocol + * @property {Array.|null} [ports] Allowed ports + */ + + /** + * Constructs a new Allowed. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Allowed. + * @implements IAllowed + * @constructor + * @param {google.cloud.compute.v1.IAllowed=} [properties] Properties to set + */ + function Allowed(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]]; + } + + /** + * Allowed IPProtocol. + * @member {string|null|undefined} IPProtocol + * @memberof google.cloud.compute.v1.Allowed + * @instance + */ + Allowed.prototype.IPProtocol = null; + + /** + * Allowed ports. + * @member {Array.} ports + * @memberof google.cloud.compute.v1.Allowed + * @instance + */ + Allowed.prototype.ports = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Allowed _IPProtocol. + * @member {"IPProtocol"|undefined} _IPProtocol + * @memberof google.cloud.compute.v1.Allowed + * @instance + */ + Object.defineProperty(Allowed.prototype, "_IPProtocol", { + get: $util.oneOfGetter($oneOfFields = ["IPProtocol"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Allowed instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {google.cloud.compute.v1.IAllowed=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Allowed} Allowed instance + */ + Allowed.create = function create(properties) { + return new Allowed(properties); + }; + + /** + * Encodes the specified Allowed message. Does not implicitly {@link google.cloud.compute.v1.Allowed.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {google.cloud.compute.v1.IAllowed} message Allowed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Allowed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ports != null && message.ports.length) + for (var i = 0; i < message.ports.length; ++i) + writer.uint32(/* id 106854418, wireType 2 =*/854835346).string(message.ports[i]); + if (message.IPProtocol != null && Object.hasOwnProperty.call(message, "IPProtocol")) + writer.uint32(/* id 488094525, wireType 2 =*/3904756202).string(message.IPProtocol); + return writer; + }; + + /** + * Encodes the specified Allowed message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Allowed.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {google.cloud.compute.v1.IAllowed} message Allowed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Allowed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Allowed message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Allowed} Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Allowed.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Allowed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 488094525: + message.IPProtocol = reader.string(); + break; + case 106854418: + if (!(message.ports && message.ports.length)) + message.ports = []; + message.ports.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Allowed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Allowed} Allowed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Allowed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Allowed message. + * @function verify + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Allowed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.IPProtocol != null && message.hasOwnProperty("IPProtocol")) { + properties._IPProtocol = 1; + if (!$util.isString(message.IPProtocol)) + return "IPProtocol: 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.isString(message.ports[i])) + return "ports: string[] expected"; + } + return null; + }; + + /** + * Creates an Allowed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Allowed} Allowed + */ + Allowed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Allowed) + return object; + var message = new $root.google.cloud.compute.v1.Allowed(); + if (object.IPProtocol != null) + message.IPProtocol = String(object.IPProtocol); + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.compute.v1.Allowed.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = String(object.ports[i]); + } + return message; + }; + + /** + * Creates a plain object from an Allowed message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Allowed + * @static + * @param {google.cloud.compute.v1.Allowed} message Allowed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Allowed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ports = []; + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + if (message.IPProtocol != null && message.hasOwnProperty("IPProtocol")) { + object.IPProtocol = message.IPProtocol; + if (options.oneofs) + object._IPProtocol = "IPProtocol"; + } + return object; + }; + + /** + * Converts this Allowed to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Allowed + * @instance + * @returns {Object.} JSON object + */ + Allowed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Allowed; + })(); + + v1.Denied = (function() { + + /** + * Properties of a Denied. + * @memberof google.cloud.compute.v1 + * @interface IDenied + * @property {string|null} [IPProtocol] Denied IPProtocol + * @property {Array.|null} [ports] Denied ports + */ + + /** + * Constructs a new Denied. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Denied. + * @implements IDenied + * @constructor + * @param {google.cloud.compute.v1.IDenied=} [properties] Properties to set + */ + function Denied(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]]; + } + + /** + * Denied IPProtocol. + * @member {string|null|undefined} IPProtocol + * @memberof google.cloud.compute.v1.Denied + * @instance + */ + Denied.prototype.IPProtocol = null; + + /** + * Denied ports. + * @member {Array.} ports + * @memberof google.cloud.compute.v1.Denied + * @instance + */ + Denied.prototype.ports = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Denied _IPProtocol. + * @member {"IPProtocol"|undefined} _IPProtocol + * @memberof google.cloud.compute.v1.Denied + * @instance + */ + Object.defineProperty(Denied.prototype, "_IPProtocol", { + get: $util.oneOfGetter($oneOfFields = ["IPProtocol"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Denied instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {google.cloud.compute.v1.IDenied=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Denied} Denied instance + */ + Denied.create = function create(properties) { + return new Denied(properties); + }; + + /** + * Encodes the specified Denied message. Does not implicitly {@link google.cloud.compute.v1.Denied.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {google.cloud.compute.v1.IDenied} message Denied message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Denied.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ports != null && message.ports.length) + for (var i = 0; i < message.ports.length; ++i) + writer.uint32(/* id 106854418, wireType 2 =*/854835346).string(message.ports[i]); + if (message.IPProtocol != null && Object.hasOwnProperty.call(message, "IPProtocol")) + writer.uint32(/* id 488094525, wireType 2 =*/3904756202).string(message.IPProtocol); + return writer; + }; + + /** + * Encodes the specified Denied message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Denied.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {google.cloud.compute.v1.IDenied} message Denied message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Denied.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Denied message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Denied} Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Denied.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Denied(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 488094525: + message.IPProtocol = reader.string(); + break; + case 106854418: + if (!(message.ports && message.ports.length)) + message.ports = []; + message.ports.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Denied message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Denied} Denied + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Denied.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Denied message. + * @function verify + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Denied.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.IPProtocol != null && message.hasOwnProperty("IPProtocol")) { + properties._IPProtocol = 1; + if (!$util.isString(message.IPProtocol)) + return "IPProtocol: 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.isString(message.ports[i])) + return "ports: string[] expected"; + } + return null; + }; + + /** + * Creates a Denied message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Denied} Denied + */ + Denied.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Denied) + return object; + var message = new $root.google.cloud.compute.v1.Denied(); + if (object.IPProtocol != null) + message.IPProtocol = String(object.IPProtocol); + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.compute.v1.Denied.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = String(object.ports[i]); + } + return message; + }; + + /** + * Creates a plain object from a Denied message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Denied + * @static + * @param {google.cloud.compute.v1.Denied} message Denied + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Denied.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ports = []; + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + if (message.IPProtocol != null && message.hasOwnProperty("IPProtocol")) { + object.IPProtocol = message.IPProtocol; + if (options.oneofs) + object._IPProtocol = "IPProtocol"; + } + return object; + }; + + /** + * Converts this Denied to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Denied + * @instance + * @returns {Object.} JSON object + */ + Denied.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Denied; + })(); + + v1.FirewallLogConfig = (function() { + + /** + * Properties of a FirewallLogConfig. + * @memberof google.cloud.compute.v1 + * @interface IFirewallLogConfig + * @property {boolean|null} [enable] FirewallLogConfig enable + * @property {google.cloud.compute.v1.FirewallLogConfig.Metadata|null} [metadata] FirewallLogConfig metadata + */ + + /** + * Constructs a new FirewallLogConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallLogConfig. + * @implements IFirewallLogConfig + * @constructor + * @param {google.cloud.compute.v1.IFirewallLogConfig=} [properties] Properties to set + */ + function FirewallLogConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallLogConfig enable. + * @member {boolean|null|undefined} enable + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @instance + */ + FirewallLogConfig.prototype.enable = null; + + /** + * FirewallLogConfig metadata. + * @member {google.cloud.compute.v1.FirewallLogConfig.Metadata|null|undefined} metadata + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @instance + */ + FirewallLogConfig.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallLogConfig _enable. + * @member {"enable"|undefined} _enable + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @instance + */ + Object.defineProperty(FirewallLogConfig.prototype, "_enable", { + get: $util.oneOfGetter($oneOfFields = ["enable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallLogConfig _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @instance + */ + Object.defineProperty(FirewallLogConfig.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallLogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {google.cloud.compute.v1.IFirewallLogConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallLogConfig} FirewallLogConfig instance + */ + FirewallLogConfig.create = function create(properties) { + return new FirewallLogConfig(properties); + }; + + /** + * Encodes the specified FirewallLogConfig message. Does not implicitly {@link google.cloud.compute.v1.FirewallLogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {google.cloud.compute.v1.IFirewallLogConfig} message FirewallLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + writer.uint32(/* id 86866735, wireType 0 =*/694933880).int32(message.metadata); + if (message.enable != null && Object.hasOwnProperty.call(message, "enable")) + writer.uint32(/* id 311764355, wireType 0 =*/2494114840).bool(message.enable); + return writer; + }; + + /** + * Encodes the specified FirewallLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {google.cloud.compute.v1.IFirewallLogConfig} message FirewallLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallLogConfig} FirewallLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 311764355: + message.enable = reader.bool(); + break; + case 86866735: + message.metadata = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallLogConfig} FirewallLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallLogConfig message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enable != null && message.hasOwnProperty("enable")) { + properties._enable = 1; + if (typeof message.enable !== "boolean") + return "enable: boolean expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + switch (message.metadata) { + default: + return "metadata: enum value expected"; + case 0: + case 334519954: + case 164619908: + break; + } + } + return null; + }; + + /** + * Creates a FirewallLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallLogConfig} FirewallLogConfig + */ + FirewallLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallLogConfig) + return object; + var message = new $root.google.cloud.compute.v1.FirewallLogConfig(); + if (object.enable != null) + message.enable = Boolean(object.enable); + switch (object.metadata) { + case "UNDEFINED_METADATA": + case 0: + message.metadata = 0; + break; + case "EXCLUDE_ALL_METADATA": + case 334519954: + message.metadata = 334519954; + break; + case "INCLUDE_ALL_METADATA": + case 164619908: + message.metadata = 164619908; + break; + } + return message; + }; + + /** + * Creates a plain object from a FirewallLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @static + * @param {google.cloud.compute.v1.FirewallLogConfig} message FirewallLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = options.enums === String ? $root.google.cloud.compute.v1.FirewallLogConfig.Metadata[message.metadata] : message.metadata; + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.enable != null && message.hasOwnProperty("enable")) { + object.enable = message.enable; + if (options.oneofs) + object._enable = "enable"; + } + return object; + }; + + /** + * Converts this FirewallLogConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallLogConfig + * @instance + * @returns {Object.} JSON object + */ + FirewallLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Metadata enum. + * @name google.cloud.compute.v1.FirewallLogConfig.Metadata + * @enum {number} + * @property {number} UNDEFINED_METADATA=0 UNDEFINED_METADATA value + * @property {number} EXCLUDE_ALL_METADATA=334519954 EXCLUDE_ALL_METADATA value + * @property {number} INCLUDE_ALL_METADATA=164619908 INCLUDE_ALL_METADATA value + */ + FirewallLogConfig.Metadata = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_METADATA"] = 0; + values[valuesById[334519954] = "EXCLUDE_ALL_METADATA"] = 334519954; + values[valuesById[164619908] = "INCLUDE_ALL_METADATA"] = 164619908; + return values; + })(); + + return FirewallLogConfig; + })(); + + v1.Firewall = (function() { + + /** + * Properties of a Firewall. + * @memberof google.cloud.compute.v1 + * @interface IFirewall + * @property {Array.|null} [allowed] Firewall allowed + * @property {string|null} [creationTimestamp] Firewall creationTimestamp + * @property {Array.|null} [denied] Firewall denied + * @property {string|null} [description] Firewall description + * @property {Array.|null} [destinationRanges] Firewall destinationRanges + * @property {google.cloud.compute.v1.Firewall.Direction|null} [direction] Firewall direction + * @property {boolean|null} [disabled] Firewall disabled + * @property {number|Long|null} [id] Firewall id + * @property {string|null} [kind] Firewall kind + * @property {google.cloud.compute.v1.IFirewallLogConfig|null} [logConfig] Firewall logConfig + * @property {string|null} [name] Firewall name + * @property {string|null} [network] Firewall network + * @property {number|null} [priority] Firewall priority + * @property {string|null} [selfLink] Firewall selfLink + * @property {Array.|null} [sourceRanges] Firewall sourceRanges + * @property {Array.|null} [sourceServiceAccounts] Firewall sourceServiceAccounts + * @property {Array.|null} [sourceTags] Firewall sourceTags + * @property {Array.|null} [targetServiceAccounts] Firewall targetServiceAccounts + * @property {Array.|null} [targetTags] Firewall targetTags + */ + + /** + * Constructs a new Firewall. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Firewall. + * @implements IFirewall + * @constructor + * @param {google.cloud.compute.v1.IFirewall=} [properties] Properties to set + */ + function Firewall(properties) { + this.allowed = []; + this.denied = []; + this.destinationRanges = []; + this.sourceRanges = []; + this.sourceServiceAccounts = []; + this.sourceTags = []; + this.targetServiceAccounts = []; + this.targetTags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Firewall allowed. + * @member {Array.} allowed + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.allowed = $util.emptyArray; + + /** + * Firewall creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.creationTimestamp = null; + + /** + * Firewall denied. + * @member {Array.} denied + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.denied = $util.emptyArray; + + /** + * Firewall description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.description = null; + + /** + * Firewall destinationRanges. + * @member {Array.} destinationRanges + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.destinationRanges = $util.emptyArray; + + /** + * Firewall direction. + * @member {google.cloud.compute.v1.Firewall.Direction|null|undefined} direction + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.direction = null; + + /** + * Firewall disabled. + * @member {boolean|null|undefined} disabled + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.disabled = null; + + /** + * Firewall id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.id = null; + + /** + * Firewall kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.kind = null; + + /** + * Firewall logConfig. + * @member {google.cloud.compute.v1.IFirewallLogConfig|null|undefined} logConfig + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.logConfig = null; + + /** + * Firewall name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.name = null; + + /** + * Firewall network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.network = null; + + /** + * Firewall priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.priority = null; + + /** + * Firewall selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.selfLink = null; + + /** + * Firewall sourceRanges. + * @member {Array.} sourceRanges + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.sourceRanges = $util.emptyArray; + + /** + * Firewall sourceServiceAccounts. + * @member {Array.} sourceServiceAccounts + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.sourceServiceAccounts = $util.emptyArray; + + /** + * Firewall sourceTags. + * @member {Array.} sourceTags + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.sourceTags = $util.emptyArray; + + /** + * Firewall targetServiceAccounts. + * @member {Array.} targetServiceAccounts + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.targetServiceAccounts = $util.emptyArray; + + /** + * Firewall targetTags. + * @member {Array.} targetTags + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Firewall.prototype.targetTags = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Firewall _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _direction. + * @member {"direction"|undefined} _direction + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_direction", { + get: $util.oneOfGetter($oneOfFields = ["direction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _disabled. + * @member {"disabled"|undefined} _disabled + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_disabled", { + get: $util.oneOfGetter($oneOfFields = ["disabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _logConfig. + * @member {"logConfig"|undefined} _logConfig + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_logConfig", { + get: $util.oneOfGetter($oneOfFields = ["logConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Firewall _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Firewall + * @instance + */ + Object.defineProperty(Firewall.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Firewall instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {google.cloud.compute.v1.IFirewall=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Firewall} Firewall instance + */ + Firewall.create = function create(properties) { + return new Firewall(properties); + }; + + /** + * Encodes the specified Firewall message. Does not implicitly {@link google.cloud.compute.v1.Firewall.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {google.cloud.compute.v1.IFirewall} message Firewall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Firewall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.targetTags != null && message.targetTags.length) + for (var i = 0; i < message.targetTags.length; ++i) + writer.uint32(/* id 62901767, wireType 2 =*/503214138).string(message.targetTags[i]); + if (message.sourceServiceAccounts != null && message.sourceServiceAccounts.length) + for (var i = 0; i < message.sourceServiceAccounts.length; ++i) + writer.uint32(/* id 105100756, wireType 2 =*/840806050).string(message.sourceServiceAccounts[i]); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 111150975, wireType 0 =*/889207800).int32(message.direction); + if (message.allowed != null && message.allowed.length) + for (var i = 0; i < message.allowed.length; ++i) + $root.google.cloud.compute.v1.Allowed.encode(message.allowed[i], writer.uint32(/* id 162398632, wireType 2 =*/1299189058).fork()).ldelim(); + if (message.sourceRanges != null && message.sourceRanges.length) + for (var i = 0; i < message.sourceRanges.length; ++i) + writer.uint32(/* id 200097658, wireType 2 =*/1600781266).string(message.sourceRanges[i]); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 270940796, wireType 0 =*/2167526368).bool(message.disabled); + if (message.denied != null && message.denied.length) + for (var i = 0; i < message.denied.length; ++i) + $root.google.cloud.compute.v1.Denied.encode(message.denied[i], writer.uint32(/* id 275217307, wireType 2 =*/2201738458).fork()).ldelim(); + if (message.destinationRanges != null && message.destinationRanges.length) + for (var i = 0; i < message.destinationRanges.length; ++i) + writer.uint32(/* id 305699879, wireType 2 =*/2445599034).string(message.destinationRanges[i]); + if (message.logConfig != null && Object.hasOwnProperty.call(message, "logConfig")) + $root.google.cloud.compute.v1.FirewallLogConfig.encode(message.logConfig, writer.uint32(/* id 351299741, wireType 2 =*/2810397930).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + if (message.sourceTags != null && message.sourceTags.length) + for (var i = 0; i < message.sourceTags.length; ++i) + writer.uint32(/* id 452222397, wireType 2 =*/3617779178).string(message.sourceTags[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.targetServiceAccounts != null && message.targetServiceAccounts.length) + for (var i = 0; i < message.targetServiceAccounts.length; ++i) + writer.uint32(/* id 457639710, wireType 2 =*/3661117682).string(message.targetServiceAccounts[i]); + return writer; + }; + + /** + * Encodes the specified Firewall message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Firewall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {google.cloud.compute.v1.IFirewall} message Firewall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Firewall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Firewall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Firewall} Firewall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Firewall.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Firewall(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 162398632: + if (!(message.allowed && message.allowed.length)) + message.allowed = []; + message.allowed.push($root.google.cloud.compute.v1.Allowed.decode(reader, reader.uint32())); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 275217307: + if (!(message.denied && message.denied.length)) + message.denied = []; + message.denied.push($root.google.cloud.compute.v1.Denied.decode(reader, reader.uint32())); + break; + case 422937596: + message.description = reader.string(); + break; + case 305699879: + if (!(message.destinationRanges && message.destinationRanges.length)) + message.destinationRanges = []; + message.destinationRanges.push(reader.string()); + break; + case 111150975: + message.direction = reader.int32(); + break; + case 270940796: + message.disabled = reader.bool(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 351299741: + message.logConfig = $root.google.cloud.compute.v1.FirewallLogConfig.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 445151652: + message.priority = reader.int32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 200097658: + if (!(message.sourceRanges && message.sourceRanges.length)) + message.sourceRanges = []; + message.sourceRanges.push(reader.string()); + break; + case 105100756: + if (!(message.sourceServiceAccounts && message.sourceServiceAccounts.length)) + message.sourceServiceAccounts = []; + message.sourceServiceAccounts.push(reader.string()); + break; + case 452222397: + if (!(message.sourceTags && message.sourceTags.length)) + message.sourceTags = []; + message.sourceTags.push(reader.string()); + break; + case 457639710: + if (!(message.targetServiceAccounts && message.targetServiceAccounts.length)) + message.targetServiceAccounts = []; + message.targetServiceAccounts.push(reader.string()); + break; + case 62901767: + if (!(message.targetTags && message.targetTags.length)) + message.targetTags = []; + message.targetTags.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Firewall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Firewall} Firewall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Firewall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Firewall message. + * @function verify + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Firewall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allowed != null && message.hasOwnProperty("allowed")) { + if (!Array.isArray(message.allowed)) + return "allowed: array expected"; + for (var i = 0; i < message.allowed.length; ++i) { + var error = $root.google.cloud.compute.v1.Allowed.verify(message.allowed[i]); + if (error) + return "allowed." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.denied != null && message.hasOwnProperty("denied")) { + if (!Array.isArray(message.denied)) + return "denied: array expected"; + for (var i = 0; i < message.denied.length; ++i) { + var error = $root.google.cloud.compute.v1.Denied.verify(message.denied[i]); + if (error) + return "denied." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.destinationRanges != null && message.hasOwnProperty("destinationRanges")) { + if (!Array.isArray(message.destinationRanges)) + return "destinationRanges: array expected"; + for (var i = 0; i < message.destinationRanges.length; ++i) + if (!$util.isString(message.destinationRanges[i])) + return "destinationRanges: string[] expected"; + } + if (message.direction != null && message.hasOwnProperty("direction")) { + properties._direction = 1; + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 432880501: + case 516931221: + break; + } + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + properties._disabled = 1; + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + properties._logConfig = 1; + { + var error = $root.google.cloud.compute.v1.FirewallLogConfig.verify(message.logConfig); + if (error) + return "logConfig." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sourceRanges != null && message.hasOwnProperty("sourceRanges")) { + if (!Array.isArray(message.sourceRanges)) + return "sourceRanges: array expected"; + for (var i = 0; i < message.sourceRanges.length; ++i) + if (!$util.isString(message.sourceRanges[i])) + return "sourceRanges: string[] expected"; + } + if (message.sourceServiceAccounts != null && message.hasOwnProperty("sourceServiceAccounts")) { + if (!Array.isArray(message.sourceServiceAccounts)) + return "sourceServiceAccounts: array expected"; + for (var i = 0; i < message.sourceServiceAccounts.length; ++i) + if (!$util.isString(message.sourceServiceAccounts[i])) + return "sourceServiceAccounts: string[] expected"; + } + if (message.sourceTags != null && message.hasOwnProperty("sourceTags")) { + if (!Array.isArray(message.sourceTags)) + return "sourceTags: array expected"; + for (var i = 0; i < message.sourceTags.length; ++i) + if (!$util.isString(message.sourceTags[i])) + return "sourceTags: string[] expected"; + } + if (message.targetServiceAccounts != null && message.hasOwnProperty("targetServiceAccounts")) { + if (!Array.isArray(message.targetServiceAccounts)) + return "targetServiceAccounts: array expected"; + for (var i = 0; i < message.targetServiceAccounts.length; ++i) + if (!$util.isString(message.targetServiceAccounts[i])) + return "targetServiceAccounts: string[] expected"; + } + if (message.targetTags != null && message.hasOwnProperty("targetTags")) { + if (!Array.isArray(message.targetTags)) + return "targetTags: array expected"; + for (var i = 0; i < message.targetTags.length; ++i) + if (!$util.isString(message.targetTags[i])) + return "targetTags: string[] expected"; + } + return null; + }; + + /** + * Creates a Firewall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Firewall} Firewall + */ + Firewall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Firewall) + return object; + var message = new $root.google.cloud.compute.v1.Firewall(); + if (object.allowed) { + if (!Array.isArray(object.allowed)) + throw TypeError(".google.cloud.compute.v1.Firewall.allowed: array expected"); + message.allowed = []; + for (var i = 0; i < object.allowed.length; ++i) { + if (typeof object.allowed[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Firewall.allowed: object expected"); + message.allowed[i] = $root.google.cloud.compute.v1.Allowed.fromObject(object.allowed[i]); + } + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.denied) { + if (!Array.isArray(object.denied)) + throw TypeError(".google.cloud.compute.v1.Firewall.denied: array expected"); + message.denied = []; + for (var i = 0; i < object.denied.length; ++i) { + if (typeof object.denied[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Firewall.denied: object expected"); + message.denied[i] = $root.google.cloud.compute.v1.Denied.fromObject(object.denied[i]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.destinationRanges) { + if (!Array.isArray(object.destinationRanges)) + throw TypeError(".google.cloud.compute.v1.Firewall.destinationRanges: array expected"); + message.destinationRanges = []; + for (var i = 0; i < object.destinationRanges.length; ++i) + message.destinationRanges[i] = String(object.destinationRanges[i]); + } + switch (object.direction) { + case "UNDEFINED_DIRECTION": + case 0: + message.direction = 0; + break; + case "EGRESS": + case 432880501: + message.direction = 432880501; + break; + case "INGRESS": + case 516931221: + message.direction = 516931221; + break; + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.logConfig != null) { + if (typeof object.logConfig !== "object") + throw TypeError(".google.cloud.compute.v1.Firewall.logConfig: object expected"); + message.logConfig = $root.google.cloud.compute.v1.FirewallLogConfig.fromObject(object.logConfig); + } + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.priority != null) + message.priority = object.priority | 0; + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.sourceRanges) { + if (!Array.isArray(object.sourceRanges)) + throw TypeError(".google.cloud.compute.v1.Firewall.sourceRanges: array expected"); + message.sourceRanges = []; + for (var i = 0; i < object.sourceRanges.length; ++i) + message.sourceRanges[i] = String(object.sourceRanges[i]); + } + if (object.sourceServiceAccounts) { + if (!Array.isArray(object.sourceServiceAccounts)) + throw TypeError(".google.cloud.compute.v1.Firewall.sourceServiceAccounts: array expected"); + message.sourceServiceAccounts = []; + for (var i = 0; i < object.sourceServiceAccounts.length; ++i) + message.sourceServiceAccounts[i] = String(object.sourceServiceAccounts[i]); + } + if (object.sourceTags) { + if (!Array.isArray(object.sourceTags)) + throw TypeError(".google.cloud.compute.v1.Firewall.sourceTags: array expected"); + message.sourceTags = []; + for (var i = 0; i < object.sourceTags.length; ++i) + message.sourceTags[i] = String(object.sourceTags[i]); + } + if (object.targetServiceAccounts) { + if (!Array.isArray(object.targetServiceAccounts)) + throw TypeError(".google.cloud.compute.v1.Firewall.targetServiceAccounts: array expected"); + message.targetServiceAccounts = []; + for (var i = 0; i < object.targetServiceAccounts.length; ++i) + message.targetServiceAccounts[i] = String(object.targetServiceAccounts[i]); + } + if (object.targetTags) { + if (!Array.isArray(object.targetTags)) + throw TypeError(".google.cloud.compute.v1.Firewall.targetTags: array expected"); + message.targetTags = []; + for (var i = 0; i < object.targetTags.length; ++i) + message.targetTags[i] = String(object.targetTags[i]); + } + return message; + }; + + /** + * Creates a plain object from a Firewall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Firewall + * @static + * @param {google.cloud.compute.v1.Firewall} message Firewall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Firewall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetTags = []; + object.sourceServiceAccounts = []; + object.allowed = []; + object.sourceRanges = []; + object.denied = []; + object.destinationRanges = []; + object.sourceTags = []; + object.targetServiceAccounts = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.targetTags && message.targetTags.length) { + object.targetTags = []; + for (var j = 0; j < message.targetTags.length; ++j) + object.targetTags[j] = message.targetTags[j]; + } + if (message.sourceServiceAccounts && message.sourceServiceAccounts.length) { + object.sourceServiceAccounts = []; + for (var j = 0; j < message.sourceServiceAccounts.length; ++j) + object.sourceServiceAccounts[j] = message.sourceServiceAccounts[j]; + } + if (message.direction != null && message.hasOwnProperty("direction")) { + object.direction = options.enums === String ? $root.google.cloud.compute.v1.Firewall.Direction[message.direction] : message.direction; + if (options.oneofs) + object._direction = "direction"; + } + if (message.allowed && message.allowed.length) { + object.allowed = []; + for (var j = 0; j < message.allowed.length; ++j) + object.allowed[j] = $root.google.cloud.compute.v1.Allowed.toObject(message.allowed[j], options); + } + if (message.sourceRanges && message.sourceRanges.length) { + object.sourceRanges = []; + for (var j = 0; j < message.sourceRanges.length; ++j) + object.sourceRanges[j] = message.sourceRanges[j]; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + object.disabled = message.disabled; + if (options.oneofs) + object._disabled = "disabled"; + } + if (message.denied && message.denied.length) { + object.denied = []; + for (var j = 0; j < message.denied.length; ++j) + object.denied[j] = $root.google.cloud.compute.v1.Denied.toObject(message.denied[j], options); + } + if (message.destinationRanges && message.destinationRanges.length) { + object.destinationRanges = []; + for (var j = 0; j < message.destinationRanges.length; ++j) + object.destinationRanges[j] = message.destinationRanges[j]; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + object.logConfig = $root.google.cloud.compute.v1.FirewallLogConfig.toObject(message.logConfig, options); + if (options.oneofs) + object._logConfig = "logConfig"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + if (message.sourceTags && message.sourceTags.length) { + object.sourceTags = []; + for (var j = 0; j < message.sourceTags.length; ++j) + object.sourceTags[j] = message.sourceTags[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.targetServiceAccounts && message.targetServiceAccounts.length) { + object.targetServiceAccounts = []; + for (var j = 0; j < message.targetServiceAccounts.length; ++j) + object.targetServiceAccounts[j] = message.targetServiceAccounts[j]; + } + return object; + }; + + /** + * Converts this Firewall to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Firewall + * @instance + * @returns {Object.} JSON object + */ + Firewall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Direction enum. + * @name google.cloud.compute.v1.Firewall.Direction + * @enum {number} + * @property {number} UNDEFINED_DIRECTION=0 UNDEFINED_DIRECTION value + * @property {number} EGRESS=432880501 EGRESS value + * @property {number} INGRESS=516931221 INGRESS value + */ + Firewall.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_DIRECTION"] = 0; + values[valuesById[432880501] = "EGRESS"] = 432880501; + values[valuesById[516931221] = "INGRESS"] = 516931221; + return values; + })(); + + return Firewall; + })(); + + v1.FirewallList = (function() { + + /** + * Properties of a FirewallList. + * @memberof google.cloud.compute.v1 + * @interface IFirewallList + * @property {string|null} [id] FirewallList id + * @property {Array.|null} [items] FirewallList items + * @property {string|null} [kind] FirewallList kind + * @property {string|null} [nextPageToken] FirewallList nextPageToken + * @property {string|null} [selfLink] FirewallList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] FirewallList warning + */ + + /** + * Constructs a new FirewallList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallList. + * @implements IFirewallList + * @constructor + * @param {google.cloud.compute.v1.IFirewallList=} [properties] Properties to set + */ + function FirewallList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + FirewallList.prototype.id = null; + + /** + * FirewallList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + FirewallList.prototype.items = $util.emptyArray; + + /** + * FirewallList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + FirewallList.prototype.kind = null; + + /** + * FirewallList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + FirewallList.prototype.nextPageToken = null; + + /** + * FirewallList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + FirewallList.prototype.selfLink = null; + + /** + * FirewallList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + FirewallList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + Object.defineProperty(FirewallList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + Object.defineProperty(FirewallList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + Object.defineProperty(FirewallList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + Object.defineProperty(FirewallList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.FirewallList + * @instance + */ + Object.defineProperty(FirewallList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {google.cloud.compute.v1.IFirewallList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallList} FirewallList instance + */ + FirewallList.create = function create(properties) { + return new FirewallList(properties); + }; + + /** + * Encodes the specified FirewallList message. Does not implicitly {@link google.cloud.compute.v1.FirewallList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {google.cloud.compute.v1.IFirewallList} message FirewallList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Firewall.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified FirewallList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {google.cloud.compute.v1.IFirewallList} message FirewallList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallList} FirewallList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Firewall.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallList} FirewallList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallList message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Firewall.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a FirewallList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallList} FirewallList + */ + FirewallList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallList) + return object; + var message = new $root.google.cloud.compute.v1.FirewallList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.FirewallList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Firewall.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a FirewallList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallList + * @static + * @param {google.cloud.compute.v1.FirewallList} message FirewallList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Firewall.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this FirewallList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallList + * @instance + * @returns {Object.} JSON object + */ + FirewallList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FirewallList; + })(); + + v1.FirewallPolicyAssociation = (function() { + + /** + * Properties of a FirewallPolicyAssociation. + * @memberof google.cloud.compute.v1 + * @interface IFirewallPolicyAssociation + * @property {string|null} [attachmentTarget] FirewallPolicyAssociation attachmentTarget + * @property {string|null} [displayName] FirewallPolicyAssociation displayName + * @property {string|null} [firewallPolicyId] FirewallPolicyAssociation firewallPolicyId + * @property {string|null} [name] FirewallPolicyAssociation name + * @property {string|null} [shortName] FirewallPolicyAssociation shortName + */ + + /** + * Constructs a new FirewallPolicyAssociation. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPolicyAssociation. + * @implements IFirewallPolicyAssociation + * @constructor + * @param {google.cloud.compute.v1.IFirewallPolicyAssociation=} [properties] Properties to set + */ + function FirewallPolicyAssociation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallPolicyAssociation attachmentTarget. + * @member {string|null|undefined} attachmentTarget + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + FirewallPolicyAssociation.prototype.attachmentTarget = null; + + /** + * FirewallPolicyAssociation displayName. + * @member {string|null|undefined} displayName + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + FirewallPolicyAssociation.prototype.displayName = null; + + /** + * FirewallPolicyAssociation firewallPolicyId. + * @member {string|null|undefined} firewallPolicyId + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + FirewallPolicyAssociation.prototype.firewallPolicyId = null; + + /** + * FirewallPolicyAssociation name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + FirewallPolicyAssociation.prototype.name = null; + + /** + * FirewallPolicyAssociation shortName. + * @member {string|null|undefined} shortName + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + FirewallPolicyAssociation.prototype.shortName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallPolicyAssociation _attachmentTarget. + * @member {"attachmentTarget"|undefined} _attachmentTarget + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + Object.defineProperty(FirewallPolicyAssociation.prototype, "_attachmentTarget", { + get: $util.oneOfGetter($oneOfFields = ["attachmentTarget"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyAssociation _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + Object.defineProperty(FirewallPolicyAssociation.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyAssociation _firewallPolicyId. + * @member {"firewallPolicyId"|undefined} _firewallPolicyId + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + Object.defineProperty(FirewallPolicyAssociation.prototype, "_firewallPolicyId", { + get: $util.oneOfGetter($oneOfFields = ["firewallPolicyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyAssociation _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + Object.defineProperty(FirewallPolicyAssociation.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyAssociation _shortName. + * @member {"shortName"|undefined} _shortName + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + */ + Object.defineProperty(FirewallPolicyAssociation.prototype, "_shortName", { + get: $util.oneOfGetter($oneOfFields = ["shortName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallPolicyAssociation instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyAssociation=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallPolicyAssociation} FirewallPolicyAssociation instance + */ + FirewallPolicyAssociation.create = function create(properties) { + return new FirewallPolicyAssociation(properties); + }; + + /** + * Encodes the specified FirewallPolicyAssociation message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyAssociation.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyAssociation} message FirewallPolicyAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyAssociation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4473832, wireType 2 =*/35790658).string(message.displayName); + if (message.attachmentTarget != null && Object.hasOwnProperty.call(message, "attachmentTarget")) + writer.uint32(/* id 175773741, wireType 2 =*/1406189930).string(message.attachmentTarget); + if (message.firewallPolicyId != null && Object.hasOwnProperty.call(message, "firewallPolicyId")) + writer.uint32(/* id 357211849, wireType 2 =*/2857694794).string(message.firewallPolicyId); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 492051566, wireType 2 =*/3936412530).string(message.shortName); + return writer; + }; + + /** + * Encodes the specified FirewallPolicyAssociation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyAssociation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyAssociation} message FirewallPolicyAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyAssociation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallPolicyAssociation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallPolicyAssociation} FirewallPolicyAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyAssociation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallPolicyAssociation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 175773741: + message.attachmentTarget = reader.string(); + break; + case 4473832: + message.displayName = reader.string(); + break; + case 357211849: + message.firewallPolicyId = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 492051566: + message.shortName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallPolicyAssociation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallPolicyAssociation} FirewallPolicyAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyAssociation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallPolicyAssociation message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallPolicyAssociation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.attachmentTarget != null && message.hasOwnProperty("attachmentTarget")) { + properties._attachmentTarget = 1; + if (!$util.isString(message.attachmentTarget)) + return "attachmentTarget: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.firewallPolicyId != null && message.hasOwnProperty("firewallPolicyId")) { + properties._firewallPolicyId = 1; + if (!$util.isString(message.firewallPolicyId)) + return "firewallPolicyId: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + properties._shortName = 1; + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + } + return null; + }; + + /** + * Creates a FirewallPolicyAssociation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallPolicyAssociation} FirewallPolicyAssociation + */ + FirewallPolicyAssociation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallPolicyAssociation) + return object; + var message = new $root.google.cloud.compute.v1.FirewallPolicyAssociation(); + if (object.attachmentTarget != null) + message.attachmentTarget = String(object.attachmentTarget); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.firewallPolicyId != null) + message.firewallPolicyId = String(object.firewallPolicyId); + if (object.name != null) + message.name = String(object.name); + if (object.shortName != null) + message.shortName = String(object.shortName); + return message; + }; + + /** + * Creates a plain object from a FirewallPolicyAssociation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @static + * @param {google.cloud.compute.v1.FirewallPolicyAssociation} message FirewallPolicyAssociation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallPolicyAssociation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + if (message.attachmentTarget != null && message.hasOwnProperty("attachmentTarget")) { + object.attachmentTarget = message.attachmentTarget; + if (options.oneofs) + object._attachmentTarget = "attachmentTarget"; + } + if (message.firewallPolicyId != null && message.hasOwnProperty("firewallPolicyId")) { + object.firewallPolicyId = message.firewallPolicyId; + if (options.oneofs) + object._firewallPolicyId = "firewallPolicyId"; + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + object.shortName = message.shortName; + if (options.oneofs) + object._shortName = "shortName"; + } + return object; + }; + + /** + * Converts this FirewallPolicyAssociation to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallPolicyAssociation + * @instance + * @returns {Object.} JSON object + */ + FirewallPolicyAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FirewallPolicyAssociation; + })(); + + v1.FirewallPoliciesListAssociationsResponse = (function() { + + /** + * Properties of a FirewallPoliciesListAssociationsResponse. + * @memberof google.cloud.compute.v1 + * @interface IFirewallPoliciesListAssociationsResponse + * @property {Array.|null} [associations] FirewallPoliciesListAssociationsResponse associations + * @property {string|null} [kind] FirewallPoliciesListAssociationsResponse kind + */ + + /** + * Constructs a new FirewallPoliciesListAssociationsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPoliciesListAssociationsResponse. + * @implements IFirewallPoliciesListAssociationsResponse + * @constructor + * @param {google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse=} [properties] Properties to set + */ + function FirewallPoliciesListAssociationsResponse(properties) { + this.associations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallPoliciesListAssociationsResponse associations. + * @member {Array.} associations + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @instance + */ + FirewallPoliciesListAssociationsResponse.prototype.associations = $util.emptyArray; + + /** + * FirewallPoliciesListAssociationsResponse kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @instance + */ + FirewallPoliciesListAssociationsResponse.prototype.kind = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallPoliciesListAssociationsResponse _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @instance + */ + Object.defineProperty(FirewallPoliciesListAssociationsResponse.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallPoliciesListAssociationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse} FirewallPoliciesListAssociationsResponse instance + */ + FirewallPoliciesListAssociationsResponse.create = function create(properties) { + return new FirewallPoliciesListAssociationsResponse(properties); + }; + + /** + * Encodes the specified FirewallPoliciesListAssociationsResponse message. Does not implicitly {@link google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse} message FirewallPoliciesListAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPoliciesListAssociationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.associations != null && message.associations.length) + for (var i = 0; i < message.associations.length; ++i) + $root.google.cloud.compute.v1.FirewallPolicyAssociation.encode(message.associations[i], writer.uint32(/* id 508736530, wireType 2 =*/4069892242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FirewallPoliciesListAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse} message FirewallPoliciesListAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPoliciesListAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallPoliciesListAssociationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse} FirewallPoliciesListAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPoliciesListAssociationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 508736530: + if (!(message.associations && message.associations.length)) + message.associations = []; + message.associations.push($root.google.cloud.compute.v1.FirewallPolicyAssociation.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallPoliciesListAssociationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse} FirewallPoliciesListAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPoliciesListAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallPoliciesListAssociationsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallPoliciesListAssociationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.associations != null && message.hasOwnProperty("associations")) { + if (!Array.isArray(message.associations)) + return "associations: array expected"; + for (var i = 0; i < message.associations.length; ++i) { + var error = $root.google.cloud.compute.v1.FirewallPolicyAssociation.verify(message.associations[i]); + if (error) + return "associations." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + return null; + }; + + /** + * Creates a FirewallPoliciesListAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse} FirewallPoliciesListAssociationsResponse + */ + FirewallPoliciesListAssociationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse) + return object; + var message = new $root.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse(); + if (object.associations) { + if (!Array.isArray(object.associations)) + throw TypeError(".google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse.associations: array expected"); + message.associations = []; + for (var i = 0; i < object.associations.length; ++i) { + if (typeof object.associations[i] !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse.associations: object expected"); + message.associations[i] = $root.google.cloud.compute.v1.FirewallPolicyAssociation.fromObject(object.associations[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a FirewallPoliciesListAssociationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @static + * @param {google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse} message FirewallPoliciesListAssociationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallPoliciesListAssociationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.associations = []; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.associations && message.associations.length) { + object.associations = []; + for (var j = 0; j < message.associations.length; ++j) + object.associations[j] = $root.google.cloud.compute.v1.FirewallPolicyAssociation.toObject(message.associations[j], options); + } + return object; + }; + + /** + * Converts this FirewallPoliciesListAssociationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse + * @instance + * @returns {Object.} JSON object + */ + FirewallPoliciesListAssociationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FirewallPoliciesListAssociationsResponse; + })(); + + v1.FirewallPolicyRule = (function() { + + /** + * Properties of a FirewallPolicyRule. + * @memberof google.cloud.compute.v1 + * @interface IFirewallPolicyRule + * @property {string|null} [action] FirewallPolicyRule action + * @property {string|null} [description] FirewallPolicyRule description + * @property {google.cloud.compute.v1.FirewallPolicyRule.Direction|null} [direction] FirewallPolicyRule direction + * @property {boolean|null} [disabled] FirewallPolicyRule disabled + * @property {boolean|null} [enableLogging] FirewallPolicyRule enableLogging + * @property {string|null} [kind] FirewallPolicyRule kind + * @property {google.cloud.compute.v1.IFirewallPolicyRuleMatcher|null} [match] FirewallPolicyRule match + * @property {number|null} [priority] FirewallPolicyRule priority + * @property {number|null} [ruleTupleCount] FirewallPolicyRule ruleTupleCount + * @property {Array.|null} [targetResources] FirewallPolicyRule targetResources + * @property {Array.|null} [targetServiceAccounts] FirewallPolicyRule targetServiceAccounts + */ + + /** + * Constructs a new FirewallPolicyRule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPolicyRule. + * @implements IFirewallPolicyRule + * @constructor + * @param {google.cloud.compute.v1.IFirewallPolicyRule=} [properties] Properties to set + */ + function FirewallPolicyRule(properties) { + this.targetResources = []; + this.targetServiceAccounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallPolicyRule action. + * @member {string|null|undefined} action + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.action = null; + + /** + * FirewallPolicyRule description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.description = null; + + /** + * FirewallPolicyRule direction. + * @member {google.cloud.compute.v1.FirewallPolicyRule.Direction|null|undefined} direction + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.direction = null; + + /** + * FirewallPolicyRule disabled. + * @member {boolean|null|undefined} disabled + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.disabled = null; + + /** + * FirewallPolicyRule enableLogging. + * @member {boolean|null|undefined} enableLogging + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.enableLogging = null; + + /** + * FirewallPolicyRule kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.kind = null; + + /** + * FirewallPolicyRule match. + * @member {google.cloud.compute.v1.IFirewallPolicyRuleMatcher|null|undefined} match + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.match = null; + + /** + * FirewallPolicyRule priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.priority = null; + + /** + * FirewallPolicyRule ruleTupleCount. + * @member {number|null|undefined} ruleTupleCount + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.ruleTupleCount = null; + + /** + * FirewallPolicyRule targetResources. + * @member {Array.} targetResources + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.targetResources = $util.emptyArray; + + /** + * FirewallPolicyRule targetServiceAccounts. + * @member {Array.} targetServiceAccounts + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + FirewallPolicyRule.prototype.targetServiceAccounts = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallPolicyRule _action. + * @member {"action"|undefined} _action + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_action", { + get: $util.oneOfGetter($oneOfFields = ["action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _direction. + * @member {"direction"|undefined} _direction + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_direction", { + get: $util.oneOfGetter($oneOfFields = ["direction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _disabled. + * @member {"disabled"|undefined} _disabled + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_disabled", { + get: $util.oneOfGetter($oneOfFields = ["disabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _enableLogging. + * @member {"enableLogging"|undefined} _enableLogging + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_enableLogging", { + get: $util.oneOfGetter($oneOfFields = ["enableLogging"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _match. + * @member {"match"|undefined} _match + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_match", { + get: $util.oneOfGetter($oneOfFields = ["match"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyRule _ruleTupleCount. + * @member {"ruleTupleCount"|undefined} _ruleTupleCount + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + */ + Object.defineProperty(FirewallPolicyRule.prototype, "_ruleTupleCount", { + get: $util.oneOfGetter($oneOfFields = ["ruleTupleCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallPolicyRule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallPolicyRule} FirewallPolicyRule instance + */ + FirewallPolicyRule.create = function create(properties) { + return new FirewallPolicyRule(properties); + }; + + /** + * Encodes the specified FirewallPolicyRule message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRule} message FirewallPolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.match != null && Object.hasOwnProperty.call(message, "match")) + $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher.encode(message.match, writer.uint32(/* id 103668165, wireType 2 =*/829345322).fork()).ldelim(); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 111150975, wireType 0 =*/889207800).int32(message.direction); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 187661878, wireType 2 =*/1501295026).string(message.action); + if (message.disabled != null && Object.hasOwnProperty.call(message, "disabled")) + writer.uint32(/* id 270940796, wireType 0 =*/2167526368).bool(message.disabled); + if (message.enableLogging != null && Object.hasOwnProperty.call(message, "enableLogging")) + writer.uint32(/* id 295396515, wireType 0 =*/2363172120).bool(message.enableLogging); + if (message.ruleTupleCount != null && Object.hasOwnProperty.call(message, "ruleTupleCount")) + writer.uint32(/* id 388342037, wireType 0 =*/3106736296).int32(message.ruleTupleCount); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + if (message.targetServiceAccounts != null && message.targetServiceAccounts.length) + for (var i = 0; i < message.targetServiceAccounts.length; ++i) + writer.uint32(/* id 457639710, wireType 2 =*/3661117682).string(message.targetServiceAccounts[i]); + if (message.targetResources != null && message.targetResources.length) + for (var i = 0; i < message.targetResources.length; ++i) + writer.uint32(/* id 528230647, wireType 2 =*/4225845178).string(message.targetResources[i]); + return writer; + }; + + /** + * Encodes the specified FirewallPolicyRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRule} message FirewallPolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallPolicyRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallPolicyRule} FirewallPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallPolicyRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 187661878: + message.action = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 111150975: + message.direction = reader.int32(); + break; + case 270940796: + message.disabled = reader.bool(); + break; + case 295396515: + message.enableLogging = reader.bool(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 103668165: + message.match = $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher.decode(reader, reader.uint32()); + break; + case 445151652: + message.priority = reader.int32(); + break; + case 388342037: + message.ruleTupleCount = reader.int32(); + break; + case 528230647: + if (!(message.targetResources && message.targetResources.length)) + message.targetResources = []; + message.targetResources.push(reader.string()); + break; + case 457639710: + if (!(message.targetServiceAccounts && message.targetServiceAccounts.length)) + message.targetServiceAccounts = []; + message.targetServiceAccounts.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallPolicyRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallPolicyRule} FirewallPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallPolicyRule message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallPolicyRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) { + properties._action = 1; + if (!$util.isString(message.action)) + return "action: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.direction != null && message.hasOwnProperty("direction")) { + properties._direction = 1; + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 432880501: + case 516931221: + break; + } + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + properties._disabled = 1; + if (typeof message.disabled !== "boolean") + return "disabled: boolean expected"; + } + if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) { + properties._enableLogging = 1; + if (typeof message.enableLogging !== "boolean") + return "enableLogging: boolean expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.match != null && message.hasOwnProperty("match")) { + properties._match = 1; + { + var error = $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher.verify(message.match); + if (error) + return "match." + error; + } + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.ruleTupleCount != null && message.hasOwnProperty("ruleTupleCount")) { + properties._ruleTupleCount = 1; + if (!$util.isInteger(message.ruleTupleCount)) + return "ruleTupleCount: integer 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.targetServiceAccounts != null && message.hasOwnProperty("targetServiceAccounts")) { + if (!Array.isArray(message.targetServiceAccounts)) + return "targetServiceAccounts: array expected"; + for (var i = 0; i < message.targetServiceAccounts.length; ++i) + if (!$util.isString(message.targetServiceAccounts[i])) + return "targetServiceAccounts: string[] expected"; + } + return null; + }; + + /** + * Creates a FirewallPolicyRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallPolicyRule} FirewallPolicyRule + */ + FirewallPolicyRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallPolicyRule) + return object; + var message = new $root.google.cloud.compute.v1.FirewallPolicyRule(); + if (object.action != null) + message.action = String(object.action); + if (object.description != null) + message.description = String(object.description); + switch (object.direction) { + case "UNDEFINED_DIRECTION": + case 0: + message.direction = 0; + break; + case "EGRESS": + case 432880501: + message.direction = 432880501; + break; + case "INGRESS": + case 516931221: + message.direction = 516931221; + break; + } + if (object.disabled != null) + message.disabled = Boolean(object.disabled); + if (object.enableLogging != null) + message.enableLogging = Boolean(object.enableLogging); + if (object.kind != null) + message.kind = String(object.kind); + if (object.match != null) { + if (typeof object.match !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRule.match: object expected"); + message.match = $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher.fromObject(object.match); + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.ruleTupleCount != null) + message.ruleTupleCount = object.ruleTupleCount | 0; + if (object.targetResources) { + if (!Array.isArray(object.targetResources)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRule.targetResources: array expected"); + message.targetResources = []; + for (var i = 0; i < object.targetResources.length; ++i) + message.targetResources[i] = String(object.targetResources[i]); + } + if (object.targetServiceAccounts) { + if (!Array.isArray(object.targetServiceAccounts)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRule.targetServiceAccounts: array expected"); + message.targetServiceAccounts = []; + for (var i = 0; i < object.targetServiceAccounts.length; ++i) + message.targetServiceAccounts[i] = String(object.targetServiceAccounts[i]); + } + return message; + }; + + /** + * Creates a plain object from a FirewallPolicyRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @static + * @param {google.cloud.compute.v1.FirewallPolicyRule} message FirewallPolicyRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallPolicyRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetServiceAccounts = []; + object.targetResources = []; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.match != null && message.hasOwnProperty("match")) { + object.match = $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher.toObject(message.match, options); + if (options.oneofs) + object._match = "match"; + } + if (message.direction != null && message.hasOwnProperty("direction")) { + object.direction = options.enums === String ? $root.google.cloud.compute.v1.FirewallPolicyRule.Direction[message.direction] : message.direction; + if (options.oneofs) + object._direction = "direction"; + } + if (message.action != null && message.hasOwnProperty("action")) { + object.action = message.action; + if (options.oneofs) + object._action = "action"; + } + if (message.disabled != null && message.hasOwnProperty("disabled")) { + object.disabled = message.disabled; + if (options.oneofs) + object._disabled = "disabled"; + } + if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) { + object.enableLogging = message.enableLogging; + if (options.oneofs) + object._enableLogging = "enableLogging"; + } + if (message.ruleTupleCount != null && message.hasOwnProperty("ruleTupleCount")) { + object.ruleTupleCount = message.ruleTupleCount; + if (options.oneofs) + object._ruleTupleCount = "ruleTupleCount"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + if (message.targetServiceAccounts && message.targetServiceAccounts.length) { + object.targetServiceAccounts = []; + for (var j = 0; j < message.targetServiceAccounts.length; ++j) + object.targetServiceAccounts[j] = message.targetServiceAccounts[j]; + } + if (message.targetResources && message.targetResources.length) { + object.targetResources = []; + for (var j = 0; j < message.targetResources.length; ++j) + object.targetResources[j] = message.targetResources[j]; + } + return object; + }; + + /** + * Converts this FirewallPolicyRule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallPolicyRule + * @instance + * @returns {Object.} JSON object + */ + FirewallPolicyRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Direction enum. + * @name google.cloud.compute.v1.FirewallPolicyRule.Direction + * @enum {number} + * @property {number} UNDEFINED_DIRECTION=0 UNDEFINED_DIRECTION value + * @property {number} EGRESS=432880501 EGRESS value + * @property {number} INGRESS=516931221 INGRESS value + */ + FirewallPolicyRule.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_DIRECTION"] = 0; + values[valuesById[432880501] = "EGRESS"] = 432880501; + values[valuesById[516931221] = "INGRESS"] = 516931221; + return values; + })(); + + return FirewallPolicyRule; + })(); + + v1.FirewallPolicy = (function() { + + /** + * Properties of a FirewallPolicy. + * @memberof google.cloud.compute.v1 + * @interface IFirewallPolicy + * @property {Array.|null} [associations] FirewallPolicy associations + * @property {string|null} [creationTimestamp] FirewallPolicy creationTimestamp + * @property {string|null} [description] FirewallPolicy description + * @property {string|null} [displayName] FirewallPolicy displayName + * @property {string|null} [fingerprint] FirewallPolicy fingerprint + * @property {number|Long|null} [id] FirewallPolicy id + * @property {string|null} [kind] FirewallPolicy kind + * @property {string|null} [name] FirewallPolicy name + * @property {string|null} [parent] FirewallPolicy parent + * @property {number|null} [ruleTupleCount] FirewallPolicy ruleTupleCount + * @property {Array.|null} [rules] FirewallPolicy rules + * @property {string|null} [selfLink] FirewallPolicy selfLink + * @property {string|null} [selfLinkWithId] FirewallPolicy selfLinkWithId + * @property {string|null} [shortName] FirewallPolicy shortName + */ + + /** + * Constructs a new FirewallPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPolicy. + * @implements IFirewallPolicy + * @constructor + * @param {google.cloud.compute.v1.IFirewallPolicy=} [properties] Properties to set + */ + function FirewallPolicy(properties) { + this.associations = []; + 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]]; + } + + /** + * FirewallPolicy associations. + * @member {Array.} associations + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.associations = $util.emptyArray; + + /** + * FirewallPolicy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.creationTimestamp = null; + + /** + * FirewallPolicy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.description = null; + + /** + * FirewallPolicy displayName. + * @member {string|null|undefined} displayName + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.displayName = null; + + /** + * FirewallPolicy fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.fingerprint = null; + + /** + * FirewallPolicy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.id = null; + + /** + * FirewallPolicy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.kind = null; + + /** + * FirewallPolicy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.name = null; + + /** + * FirewallPolicy parent. + * @member {string|null|undefined} parent + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.parent = null; + + /** + * FirewallPolicy ruleTupleCount. + * @member {number|null|undefined} ruleTupleCount + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.ruleTupleCount = null; + + /** + * FirewallPolicy rules. + * @member {Array.} rules + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.rules = $util.emptyArray; + + /** + * FirewallPolicy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.selfLink = null; + + /** + * FirewallPolicy selfLinkWithId. + * @member {string|null|undefined} selfLinkWithId + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.selfLinkWithId = null; + + /** + * FirewallPolicy shortName. + * @member {string|null|undefined} shortName + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + FirewallPolicy.prototype.shortName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallPolicy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _parent. + * @member {"parent"|undefined} _parent + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_parent", { + get: $util.oneOfGetter($oneOfFields = ["parent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _ruleTupleCount. + * @member {"ruleTupleCount"|undefined} _ruleTupleCount + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_ruleTupleCount", { + get: $util.oneOfGetter($oneOfFields = ["ruleTupleCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _selfLinkWithId. + * @member {"selfLinkWithId"|undefined} _selfLinkWithId + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_selfLinkWithId", { + get: $util.oneOfGetter($oneOfFields = ["selfLinkWithId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicy _shortName. + * @member {"shortName"|undefined} _shortName + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + */ + Object.defineProperty(FirewallPolicy.prototype, "_shortName", { + get: $util.oneOfGetter($oneOfFields = ["shortName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {google.cloud.compute.v1.IFirewallPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallPolicy} FirewallPolicy instance + */ + FirewallPolicy.create = function create(properties) { + return new FirewallPolicy(properties); + }; + + /** + * Encodes the specified FirewallPolicy message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {google.cloud.compute.v1.IFirewallPolicy} message FirewallPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4473832, wireType 2 =*/35790658).string(message.displayName); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.selfLinkWithId != null && Object.hasOwnProperty.call(message, "selfLinkWithId")) + writer.uint32(/* id 44520962, wireType 2 =*/356167698).string(message.selfLinkWithId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 78317738, wireType 2 =*/626541906).string(message.parent); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.compute.v1.FirewallPolicyRule.encode(message.rules[i], writer.uint32(/* id 108873975, wireType 2 =*/870991802).fork()).ldelim(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.ruleTupleCount != null && Object.hasOwnProperty.call(message, "ruleTupleCount")) + writer.uint32(/* id 388342037, wireType 0 =*/3106736296).int32(message.ruleTupleCount); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 492051566, wireType 2 =*/3936412530).string(message.shortName); + if (message.associations != null && message.associations.length) + for (var i = 0; i < message.associations.length; ++i) + $root.google.cloud.compute.v1.FirewallPolicyAssociation.encode(message.associations[i], writer.uint32(/* id 508736530, wireType 2 =*/4069892242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FirewallPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {google.cloud.compute.v1.IFirewallPolicy} message FirewallPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallPolicy} FirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 508736530: + if (!(message.associations && message.associations.length)) + message.associations = []; + message.associations.push($root.google.cloud.compute.v1.FirewallPolicyAssociation.decode(reader, reader.uint32())); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 4473832: + message.displayName = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 78317738: + message.parent = reader.string(); + break; + case 388342037: + message.ruleTupleCount = reader.int32(); + break; + case 108873975: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.compute.v1.FirewallPolicyRule.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 44520962: + message.selfLinkWithId = reader.string(); + break; + case 492051566: + message.shortName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallPolicy} FirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.associations != null && message.hasOwnProperty("associations")) { + if (!Array.isArray(message.associations)) + return "associations: array expected"; + for (var i = 0; i < message.associations.length; ++i) { + var error = $root.google.cloud.compute.v1.FirewallPolicyAssociation.verify(message.associations[i]); + if (error) + return "associations." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.parent != null && message.hasOwnProperty("parent")) { + properties._parent = 1; + if (!$util.isString(message.parent)) + return "parent: string expected"; + } + if (message.ruleTupleCount != null && message.hasOwnProperty("ruleTupleCount")) { + properties._ruleTupleCount = 1; + if (!$util.isInteger(message.ruleTupleCount)) + return "ruleTupleCount: integer 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.cloud.compute.v1.FirewallPolicyRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.selfLinkWithId != null && message.hasOwnProperty("selfLinkWithId")) { + properties._selfLinkWithId = 1; + if (!$util.isString(message.selfLinkWithId)) + return "selfLinkWithId: string expected"; + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + properties._shortName = 1; + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + } + return null; + }; + + /** + * Creates a FirewallPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallPolicy} FirewallPolicy + */ + FirewallPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallPolicy) + return object; + var message = new $root.google.cloud.compute.v1.FirewallPolicy(); + if (object.associations) { + if (!Array.isArray(object.associations)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicy.associations: array expected"); + message.associations = []; + for (var i = 0; i < object.associations.length; ++i) { + if (typeof object.associations[i] !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallPolicy.associations: object expected"); + message.associations[i] = $root.google.cloud.compute.v1.FirewallPolicyAssociation.fromObject(object.associations[i]); + } + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.ruleTupleCount != null) + message.ruleTupleCount = object.ruleTupleCount | 0; + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicy.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallPolicy.rules: object expected"); + message.rules[i] = $root.google.cloud.compute.v1.FirewallPolicyRule.fromObject(object.rules[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.selfLinkWithId != null) + message.selfLinkWithId = String(object.selfLinkWithId); + if (object.shortName != null) + message.shortName = String(object.shortName); + return message; + }; + + /** + * Creates a plain object from a FirewallPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallPolicy + * @static + * @param {google.cloud.compute.v1.FirewallPolicy} message FirewallPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.rules = []; + object.associations = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.selfLinkWithId != null && message.hasOwnProperty("selfLinkWithId")) { + object.selfLinkWithId = message.selfLinkWithId; + if (options.oneofs) + object._selfLinkWithId = "selfLinkWithId"; + } + if (message.parent != null && message.hasOwnProperty("parent")) { + object.parent = message.parent; + if (options.oneofs) + object._parent = "parent"; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.compute.v1.FirewallPolicyRule.toObject(message.rules[j], options); + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.ruleTupleCount != null && message.hasOwnProperty("ruleTupleCount")) { + object.ruleTupleCount = message.ruleTupleCount; + if (options.oneofs) + object._ruleTupleCount = "ruleTupleCount"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + object.shortName = message.shortName; + if (options.oneofs) + object._shortName = "shortName"; + } + if (message.associations && message.associations.length) { + object.associations = []; + for (var j = 0; j < message.associations.length; ++j) + object.associations[j] = $root.google.cloud.compute.v1.FirewallPolicyAssociation.toObject(message.associations[j], options); + } + return object; + }; + + /** + * Converts this FirewallPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallPolicy + * @instance + * @returns {Object.} JSON object + */ + FirewallPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FirewallPolicy; + })(); + + v1.FirewallPolicyList = (function() { + + /** + * Properties of a FirewallPolicyList. + * @memberof google.cloud.compute.v1 + * @interface IFirewallPolicyList + * @property {string|null} [id] FirewallPolicyList id + * @property {Array.|null} [items] FirewallPolicyList items + * @property {string|null} [kind] FirewallPolicyList kind + * @property {string|null} [nextPageToken] FirewallPolicyList nextPageToken + * @property {google.cloud.compute.v1.IWarning|null} [warning] FirewallPolicyList warning + */ + + /** + * Constructs a new FirewallPolicyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPolicyList. + * @implements IFirewallPolicyList + * @constructor + * @param {google.cloud.compute.v1.IFirewallPolicyList=} [properties] Properties to set + */ + function FirewallPolicyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallPolicyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + FirewallPolicyList.prototype.id = null; + + /** + * FirewallPolicyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + FirewallPolicyList.prototype.items = $util.emptyArray; + + /** + * FirewallPolicyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + FirewallPolicyList.prototype.kind = null; + + /** + * FirewallPolicyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + FirewallPolicyList.prototype.nextPageToken = null; + + /** + * FirewallPolicyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + FirewallPolicyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallPolicyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + Object.defineProperty(FirewallPolicyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + Object.defineProperty(FirewallPolicyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + Object.defineProperty(FirewallPolicyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FirewallPolicyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + */ + Object.defineProperty(FirewallPolicyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallPolicyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallPolicyList} FirewallPolicyList instance + */ + FirewallPolicyList.create = function create(properties) { + return new FirewallPolicyList(properties); + }; + + /** + * Encodes the specified FirewallPolicyList message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyList} message FirewallPolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.FirewallPolicy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FirewallPolicyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyList} message FirewallPolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallPolicyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallPolicyList} FirewallPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallPolicyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.FirewallPolicy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallPolicyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallPolicyList} FirewallPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallPolicyList message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallPolicyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.FirewallPolicy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a FirewallPolicyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallPolicyList} FirewallPolicyList + */ + FirewallPolicyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallPolicyList) + return object; + var message = new $root.google.cloud.compute.v1.FirewallPolicyList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallPolicyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.FirewallPolicy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallPolicyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a FirewallPolicyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @static + * @param {google.cloud.compute.v1.FirewallPolicyList} message FirewallPolicyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallPolicyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.FirewallPolicy.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this FirewallPolicyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallPolicyList + * @instance + * @returns {Object.} JSON object + */ + FirewallPolicyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FirewallPolicyList; + })(); + + v1.FirewallPolicyRuleMatcher = (function() { + + /** + * Properties of a FirewallPolicyRuleMatcher. + * @memberof google.cloud.compute.v1 + * @interface IFirewallPolicyRuleMatcher + * @property {Array.|null} [destIpRanges] FirewallPolicyRuleMatcher destIpRanges + * @property {Array.|null} [layer4Configs] FirewallPolicyRuleMatcher layer4Configs + * @property {Array.|null} [srcIpRanges] FirewallPolicyRuleMatcher srcIpRanges + */ + + /** + * Constructs a new FirewallPolicyRuleMatcher. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPolicyRuleMatcher. + * @implements IFirewallPolicyRuleMatcher + * @constructor + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcher=} [properties] Properties to set + */ + function FirewallPolicyRuleMatcher(properties) { + this.destIpRanges = []; + this.layer4Configs = []; + this.srcIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FirewallPolicyRuleMatcher destIpRanges. + * @member {Array.} destIpRanges + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @instance + */ + FirewallPolicyRuleMatcher.prototype.destIpRanges = $util.emptyArray; + + /** + * FirewallPolicyRuleMatcher layer4Configs. + * @member {Array.} layer4Configs + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @instance + */ + FirewallPolicyRuleMatcher.prototype.layer4Configs = $util.emptyArray; + + /** + * FirewallPolicyRuleMatcher srcIpRanges. + * @member {Array.} srcIpRanges + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @instance + */ + FirewallPolicyRuleMatcher.prototype.srcIpRanges = $util.emptyArray; + + /** + * Creates a new FirewallPolicyRuleMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcher=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcher} FirewallPolicyRuleMatcher instance + */ + FirewallPolicyRuleMatcher.create = function create(properties) { + return new FirewallPolicyRuleMatcher(properties); + }; + + /** + * Encodes the specified FirewallPolicyRuleMatcher message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcher} message FirewallPolicyRuleMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyRuleMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destIpRanges != null && message.destIpRanges.length) + for (var i = 0; i < message.destIpRanges.length; ++i) + writer.uint32(/* id 337357713, wireType 2 =*/2698861706).string(message.destIpRanges[i]); + if (message.layer4Configs != null && message.layer4Configs.length) + for (var i = 0; i < message.layer4Configs.length; ++i) + $root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.encode(message.layer4Configs[i], writer.uint32(/* id 373534261, wireType 2 =*/2988274090).fork()).ldelim(); + if (message.srcIpRanges != null && message.srcIpRanges.length) + for (var i = 0; i < message.srcIpRanges.length; ++i) + writer.uint32(/* id 432128083, wireType 2 =*/3457024666).string(message.srcIpRanges[i]); + return writer; + }; + + /** + * Encodes the specified FirewallPolicyRuleMatcher message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcher} message FirewallPolicyRuleMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyRuleMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallPolicyRuleMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcher} FirewallPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyRuleMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 337357713: + if (!(message.destIpRanges && message.destIpRanges.length)) + message.destIpRanges = []; + message.destIpRanges.push(reader.string()); + break; + case 373534261: + if (!(message.layer4Configs && message.layer4Configs.length)) + message.layer4Configs = []; + message.layer4Configs.push($root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.decode(reader, reader.uint32())); + break; + case 432128083: + if (!(message.srcIpRanges && message.srcIpRanges.length)) + message.srcIpRanges = []; + message.srcIpRanges.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallPolicyRuleMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcher} FirewallPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyRuleMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallPolicyRuleMatcher message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallPolicyRuleMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destIpRanges != null && message.hasOwnProperty("destIpRanges")) { + if (!Array.isArray(message.destIpRanges)) + return "destIpRanges: array expected"; + for (var i = 0; i < message.destIpRanges.length; ++i) + if (!$util.isString(message.destIpRanges[i])) + return "destIpRanges: string[] expected"; + } + if (message.layer4Configs != null && message.hasOwnProperty("layer4Configs")) { + if (!Array.isArray(message.layer4Configs)) + return "layer4Configs: array expected"; + for (var i = 0; i < message.layer4Configs.length; ++i) { + var error = $root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.verify(message.layer4Configs[i]); + if (error) + return "layer4Configs." + error; + } + } + if (message.srcIpRanges != null && message.hasOwnProperty("srcIpRanges")) { + if (!Array.isArray(message.srcIpRanges)) + return "srcIpRanges: array expected"; + for (var i = 0; i < message.srcIpRanges.length; ++i) + if (!$util.isString(message.srcIpRanges[i])) + return "srcIpRanges: string[] expected"; + } + return null; + }; + + /** + * Creates a FirewallPolicyRuleMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcher} FirewallPolicyRuleMatcher + */ + FirewallPolicyRuleMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher) + return object; + var message = new $root.google.cloud.compute.v1.FirewallPolicyRuleMatcher(); + if (object.destIpRanges) { + if (!Array.isArray(object.destIpRanges)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRuleMatcher.destIpRanges: array expected"); + message.destIpRanges = []; + for (var i = 0; i < object.destIpRanges.length; ++i) + message.destIpRanges[i] = String(object.destIpRanges[i]); + } + if (object.layer4Configs) { + if (!Array.isArray(object.layer4Configs)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRuleMatcher.layer4Configs: array expected"); + message.layer4Configs = []; + for (var i = 0; i < object.layer4Configs.length; ++i) { + if (typeof object.layer4Configs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRuleMatcher.layer4Configs: object expected"); + message.layer4Configs[i] = $root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.fromObject(object.layer4Configs[i]); + } + } + if (object.srcIpRanges) { + if (!Array.isArray(object.srcIpRanges)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRuleMatcher.srcIpRanges: array expected"); + message.srcIpRanges = []; + for (var i = 0; i < object.srcIpRanges.length; ++i) + message.srcIpRanges[i] = String(object.srcIpRanges[i]); + } + return message; + }; + + /** + * Creates a plain object from a FirewallPolicyRuleMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.FirewallPolicyRuleMatcher} message FirewallPolicyRuleMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallPolicyRuleMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.destIpRanges = []; + object.layer4Configs = []; + object.srcIpRanges = []; + } + if (message.destIpRanges && message.destIpRanges.length) { + object.destIpRanges = []; + for (var j = 0; j < message.destIpRanges.length; ++j) + object.destIpRanges[j] = message.destIpRanges[j]; + } + if (message.layer4Configs && message.layer4Configs.length) { + object.layer4Configs = []; + for (var j = 0; j < message.layer4Configs.length; ++j) + object.layer4Configs[j] = $root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.toObject(message.layer4Configs[j], options); + } + if (message.srcIpRanges && message.srcIpRanges.length) { + object.srcIpRanges = []; + for (var j = 0; j < message.srcIpRanges.length; ++j) + object.srcIpRanges[j] = message.srcIpRanges[j]; + } + return object; + }; + + /** + * Converts this FirewallPolicyRuleMatcher to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcher + * @instance + * @returns {Object.} JSON object + */ + FirewallPolicyRuleMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FirewallPolicyRuleMatcher; + })(); + + v1.FirewallPolicyRuleMatcherLayer4Config = (function() { + + /** + * Properties of a FirewallPolicyRuleMatcherLayer4Config. + * @memberof google.cloud.compute.v1 + * @interface IFirewallPolicyRuleMatcherLayer4Config + * @property {string|null} [ipProtocol] FirewallPolicyRuleMatcherLayer4Config ipProtocol + * @property {Array.|null} [ports] FirewallPolicyRuleMatcherLayer4Config ports + */ + + /** + * Constructs a new FirewallPolicyRuleMatcherLayer4Config. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPolicyRuleMatcherLayer4Config. + * @implements IFirewallPolicyRuleMatcherLayer4Config + * @constructor + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config=} [properties] Properties to set + */ + function FirewallPolicyRuleMatcherLayer4Config(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]]; + } + + /** + * FirewallPolicyRuleMatcherLayer4Config ipProtocol. + * @member {string|null|undefined} ipProtocol + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @instance + */ + FirewallPolicyRuleMatcherLayer4Config.prototype.ipProtocol = null; + + /** + * FirewallPolicyRuleMatcherLayer4Config ports. + * @member {Array.} ports + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @instance + */ + FirewallPolicyRuleMatcherLayer4Config.prototype.ports = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FirewallPolicyRuleMatcherLayer4Config _ipProtocol. + * @member {"ipProtocol"|undefined} _ipProtocol + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @instance + */ + Object.defineProperty(FirewallPolicyRuleMatcherLayer4Config.prototype, "_ipProtocol", { + get: $util.oneOfGetter($oneOfFields = ["ipProtocol"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FirewallPolicyRuleMatcherLayer4Config instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config=} [properties] Properties to set + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config} FirewallPolicyRuleMatcherLayer4Config instance + */ + FirewallPolicyRuleMatcherLayer4Config.create = function create(properties) { + return new FirewallPolicyRuleMatcherLayer4Config(properties); + }; + + /** + * Encodes the specified FirewallPolicyRuleMatcherLayer4Config message. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config} message FirewallPolicyRuleMatcherLayer4Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyRuleMatcherLayer4Config.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ports != null && message.ports.length) + for (var i = 0; i < message.ports.length; ++i) + writer.uint32(/* id 106854418, wireType 2 =*/854835346).string(message.ports[i]); + if (message.ipProtocol != null && Object.hasOwnProperty.call(message, "ipProtocol")) + writer.uint32(/* id 475958960, wireType 2 =*/3807671682).string(message.ipProtocol); + return writer; + }; + + /** + * Encodes the specified FirewallPolicyRuleMatcherLayer4Config message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {google.cloud.compute.v1.IFirewallPolicyRuleMatcherLayer4Config} message FirewallPolicyRuleMatcherLayer4Config message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FirewallPolicyRuleMatcherLayer4Config.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FirewallPolicyRuleMatcherLayer4Config message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config} FirewallPolicyRuleMatcherLayer4Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyRuleMatcherLayer4Config.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 475958960: + message.ipProtocol = reader.string(); + break; + case 106854418: + if (!(message.ports && message.ports.length)) + message.ports = []; + message.ports.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FirewallPolicyRuleMatcherLayer4Config message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config} FirewallPolicyRuleMatcherLayer4Config + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FirewallPolicyRuleMatcherLayer4Config.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FirewallPolicyRuleMatcherLayer4Config message. + * @function verify + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FirewallPolicyRuleMatcherLayer4Config.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipProtocol != null && message.hasOwnProperty("ipProtocol")) { + properties._ipProtocol = 1; + if (!$util.isString(message.ipProtocol)) + return "ipProtocol: 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.isString(message.ports[i])) + return "ports: string[] expected"; + } + return null; + }; + + /** + * Creates a FirewallPolicyRuleMatcherLayer4Config message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config} FirewallPolicyRuleMatcherLayer4Config + */ + FirewallPolicyRuleMatcherLayer4Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config) + return object; + var message = new $root.google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config(); + if (object.ipProtocol != null) + message.ipProtocol = String(object.ipProtocol); + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = String(object.ports[i]); + } + return message; + }; + + /** + * Creates a plain object from a FirewallPolicyRuleMatcherLayer4Config message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @static + * @param {google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config} message FirewallPolicyRuleMatcherLayer4Config + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FirewallPolicyRuleMatcherLayer4Config.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ports = []; + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + if (message.ipProtocol != null && message.hasOwnProperty("ipProtocol")) { + object.ipProtocol = message.ipProtocol; + if (options.oneofs) + object._ipProtocol = "ipProtocol"; + } + return object; + }; + + /** + * Converts this FirewallPolicyRuleMatcherLayer4Config to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.FirewallPolicyRuleMatcherLayer4Config + * @instance + * @returns {Object.} JSON object + */ + FirewallPolicyRuleMatcherLayer4Config.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FirewallPolicyRuleMatcherLayer4Config; + })(); + + v1.MetadataFilter = (function() { + + /** + * Properties of a MetadataFilter. + * @memberof google.cloud.compute.v1 + * @interface IMetadataFilter + * @property {Array.|null} [filterLabels] MetadataFilter filterLabels + * @property {google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria|null} [filterMatchCriteria] MetadataFilter filterMatchCriteria + */ + + /** + * Constructs a new MetadataFilter. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MetadataFilter. + * @implements IMetadataFilter + * @constructor + * @param {google.cloud.compute.v1.IMetadataFilter=} [properties] Properties to set + */ + function MetadataFilter(properties) { + this.filterLabels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataFilter filterLabels. + * @member {Array.} filterLabels + * @memberof google.cloud.compute.v1.MetadataFilter + * @instance + */ + MetadataFilter.prototype.filterLabels = $util.emptyArray; + + /** + * MetadataFilter filterMatchCriteria. + * @member {google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria|null|undefined} filterMatchCriteria + * @memberof google.cloud.compute.v1.MetadataFilter + * @instance + */ + MetadataFilter.prototype.filterMatchCriteria = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetadataFilter _filterMatchCriteria. + * @member {"filterMatchCriteria"|undefined} _filterMatchCriteria + * @memberof google.cloud.compute.v1.MetadataFilter + * @instance + */ + Object.defineProperty(MetadataFilter.prototype, "_filterMatchCriteria", { + get: $util.oneOfGetter($oneOfFields = ["filterMatchCriteria"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetadataFilter instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {google.cloud.compute.v1.IMetadataFilter=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MetadataFilter} MetadataFilter instance + */ + MetadataFilter.create = function create(properties) { + return new MetadataFilter(properties); + }; + + /** + * Encodes the specified MetadataFilter message. Does not implicitly {@link google.cloud.compute.v1.MetadataFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {google.cloud.compute.v1.IMetadataFilter} message MetadataFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filterMatchCriteria != null && Object.hasOwnProperty.call(message, "filterMatchCriteria")) + writer.uint32(/* id 239970368, wireType 0 =*/1919762944).int32(message.filterMatchCriteria); + if (message.filterLabels != null && message.filterLabels.length) + for (var i = 0; i < message.filterLabels.length; ++i) + $root.google.cloud.compute.v1.MetadataFilterLabelMatch.encode(message.filterLabels[i], writer.uint32(/* id 307903142, wireType 2 =*/2463225138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetadataFilter message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MetadataFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {google.cloud.compute.v1.IMetadataFilter} message MetadataFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MetadataFilter} MetadataFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MetadataFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 307903142: + if (!(message.filterLabels && message.filterLabels.length)) + message.filterLabels = []; + message.filterLabels.push($root.google.cloud.compute.v1.MetadataFilterLabelMatch.decode(reader, reader.uint32())); + break; + case 239970368: + message.filterMatchCriteria = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MetadataFilter} MetadataFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataFilter message. + * @function verify + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filterLabels != null && message.hasOwnProperty("filterLabels")) { + if (!Array.isArray(message.filterLabels)) + return "filterLabels: array expected"; + for (var i = 0; i < message.filterLabels.length; ++i) { + var error = $root.google.cloud.compute.v1.MetadataFilterLabelMatch.verify(message.filterLabels[i]); + if (error) + return "filterLabels." + error; + } + } + if (message.filterMatchCriteria != null && message.hasOwnProperty("filterMatchCriteria")) { + properties._filterMatchCriteria = 1; + switch (message.filterMatchCriteria) { + default: + return "filterMatchCriteria: enum value expected"; + case 0: + case 180663271: + case 180663346: + case 163646646: + break; + } + } + return null; + }; + + /** + * Creates a MetadataFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MetadataFilter} MetadataFilter + */ + MetadataFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MetadataFilter) + return object; + var message = new $root.google.cloud.compute.v1.MetadataFilter(); + if (object.filterLabels) { + if (!Array.isArray(object.filterLabels)) + throw TypeError(".google.cloud.compute.v1.MetadataFilter.filterLabels: array expected"); + message.filterLabels = []; + for (var i = 0; i < object.filterLabels.length; ++i) { + if (typeof object.filterLabels[i] !== "object") + throw TypeError(".google.cloud.compute.v1.MetadataFilter.filterLabels: object expected"); + message.filterLabels[i] = $root.google.cloud.compute.v1.MetadataFilterLabelMatch.fromObject(object.filterLabels[i]); + } + } + switch (object.filterMatchCriteria) { + case "UNDEFINED_FILTER_MATCH_CRITERIA": + case 0: + message.filterMatchCriteria = 0; + break; + case "MATCH_ALL": + case 180663271: + message.filterMatchCriteria = 180663271; + break; + case "MATCH_ANY": + case 180663346: + message.filterMatchCriteria = 180663346; + break; + case "NOT_SET": + case 163646646: + message.filterMatchCriteria = 163646646; + break; + } + return message; + }; + + /** + * Creates a plain object from a MetadataFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MetadataFilter + * @static + * @param {google.cloud.compute.v1.MetadataFilter} message MetadataFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.filterLabels = []; + if (message.filterMatchCriteria != null && message.hasOwnProperty("filterMatchCriteria")) { + object.filterMatchCriteria = options.enums === String ? $root.google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria[message.filterMatchCriteria] : message.filterMatchCriteria; + if (options.oneofs) + object._filterMatchCriteria = "filterMatchCriteria"; + } + if (message.filterLabels && message.filterLabels.length) { + object.filterLabels = []; + for (var j = 0; j < message.filterLabels.length; ++j) + object.filterLabels[j] = $root.google.cloud.compute.v1.MetadataFilterLabelMatch.toObject(message.filterLabels[j], options); + } + return object; + }; + + /** + * Converts this MetadataFilter to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MetadataFilter + * @instance + * @returns {Object.} JSON object + */ + MetadataFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * FilterMatchCriteria enum. + * @name google.cloud.compute.v1.MetadataFilter.FilterMatchCriteria + * @enum {number} + * @property {number} UNDEFINED_FILTER_MATCH_CRITERIA=0 UNDEFINED_FILTER_MATCH_CRITERIA value + * @property {number} MATCH_ALL=180663271 MATCH_ALL value + * @property {number} MATCH_ANY=180663346 MATCH_ANY value + * @property {number} NOT_SET=163646646 NOT_SET value + */ + MetadataFilter.FilterMatchCriteria = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_FILTER_MATCH_CRITERIA"] = 0; + values[valuesById[180663271] = "MATCH_ALL"] = 180663271; + values[valuesById[180663346] = "MATCH_ANY"] = 180663346; + values[valuesById[163646646] = "NOT_SET"] = 163646646; + return values; + })(); + + return MetadataFilter; + })(); + + v1.ForwardingRuleServiceDirectoryRegistration = (function() { + + /** + * Properties of a ForwardingRuleServiceDirectoryRegistration. + * @memberof google.cloud.compute.v1 + * @interface IForwardingRuleServiceDirectoryRegistration + * @property {string|null} [namespace] ForwardingRuleServiceDirectoryRegistration namespace + * @property {string|null} [service] ForwardingRuleServiceDirectoryRegistration service + * @property {string|null} [serviceDirectoryRegion] ForwardingRuleServiceDirectoryRegistration serviceDirectoryRegion + */ + + /** + * Constructs a new ForwardingRuleServiceDirectoryRegistration. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ForwardingRuleServiceDirectoryRegistration. + * @implements IForwardingRuleServiceDirectoryRegistration + * @constructor + * @param {google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration=} [properties] Properties to set + */ + function ForwardingRuleServiceDirectoryRegistration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardingRuleServiceDirectoryRegistration namespace. + * @member {string|null|undefined} namespace + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @instance + */ + ForwardingRuleServiceDirectoryRegistration.prototype.namespace = null; + + /** + * ForwardingRuleServiceDirectoryRegistration service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @instance + */ + ForwardingRuleServiceDirectoryRegistration.prototype.service = null; + + /** + * ForwardingRuleServiceDirectoryRegistration serviceDirectoryRegion. + * @member {string|null|undefined} serviceDirectoryRegion + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @instance + */ + ForwardingRuleServiceDirectoryRegistration.prototype.serviceDirectoryRegion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ForwardingRuleServiceDirectoryRegistration _namespace. + * @member {"namespace"|undefined} _namespace + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @instance + */ + Object.defineProperty(ForwardingRuleServiceDirectoryRegistration.prototype, "_namespace", { + get: $util.oneOfGetter($oneOfFields = ["namespace"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleServiceDirectoryRegistration _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @instance + */ + Object.defineProperty(ForwardingRuleServiceDirectoryRegistration.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleServiceDirectoryRegistration _serviceDirectoryRegion. + * @member {"serviceDirectoryRegion"|undefined} _serviceDirectoryRegion + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @instance + */ + Object.defineProperty(ForwardingRuleServiceDirectoryRegistration.prototype, "_serviceDirectoryRegion", { + get: $util.oneOfGetter($oneOfFields = ["serviceDirectoryRegion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardingRuleServiceDirectoryRegistration instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration} ForwardingRuleServiceDirectoryRegistration instance + */ + ForwardingRuleServiceDirectoryRegistration.create = function create(properties) { + return new ForwardingRuleServiceDirectoryRegistration(properties); + }; + + /** + * Encodes the specified ForwardingRuleServiceDirectoryRegistration message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration} message ForwardingRuleServiceDirectoryRegistration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleServiceDirectoryRegistration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceDirectoryRegion != null && Object.hasOwnProperty.call(message, "serviceDirectoryRegion")) + writer.uint32(/* id 74030416, wireType 2 =*/592243330).string(message.serviceDirectoryRegion); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 178476379, wireType 2 =*/1427811034).string(message.namespace); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + return writer; + }; + + /** + * Encodes the specified ForwardingRuleServiceDirectoryRegistration message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {google.cloud.compute.v1.IForwardingRuleServiceDirectoryRegistration} message ForwardingRuleServiceDirectoryRegistration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleServiceDirectoryRegistration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardingRuleServiceDirectoryRegistration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration} ForwardingRuleServiceDirectoryRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleServiceDirectoryRegistration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 178476379: + message.namespace = reader.string(); + break; + case 373540533: + message.service = reader.string(); + break; + case 74030416: + message.serviceDirectoryRegion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardingRuleServiceDirectoryRegistration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration} ForwardingRuleServiceDirectoryRegistration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleServiceDirectoryRegistration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardingRuleServiceDirectoryRegistration message. + * @function verify + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardingRuleServiceDirectoryRegistration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.namespace != null && message.hasOwnProperty("namespace")) { + properties._namespace = 1; + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + } + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + if (message.serviceDirectoryRegion != null && message.hasOwnProperty("serviceDirectoryRegion")) { + properties._serviceDirectoryRegion = 1; + if (!$util.isString(message.serviceDirectoryRegion)) + return "serviceDirectoryRegion: string expected"; + } + return null; + }; + + /** + * Creates a ForwardingRuleServiceDirectoryRegistration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration} ForwardingRuleServiceDirectoryRegistration + */ + ForwardingRuleServiceDirectoryRegistration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration) + return object; + var message = new $root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration(); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.service != null) + message.service = String(object.service); + if (object.serviceDirectoryRegion != null) + message.serviceDirectoryRegion = String(object.serviceDirectoryRegion); + return message; + }; + + /** + * Creates a plain object from a ForwardingRuleServiceDirectoryRegistration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @static + * @param {google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration} message ForwardingRuleServiceDirectoryRegistration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardingRuleServiceDirectoryRegistration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.serviceDirectoryRegion != null && message.hasOwnProperty("serviceDirectoryRegion")) { + object.serviceDirectoryRegion = message.serviceDirectoryRegion; + if (options.oneofs) + object._serviceDirectoryRegion = "serviceDirectoryRegion"; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) { + object.namespace = message.namespace; + if (options.oneofs) + object._namespace = "namespace"; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + return object; + }; + + /** + * Converts this ForwardingRuleServiceDirectoryRegistration to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration + * @instance + * @returns {Object.} JSON object + */ + ForwardingRuleServiceDirectoryRegistration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ForwardingRuleServiceDirectoryRegistration; + })(); + + v1.ForwardingRule = (function() { + + /** + * Properties of a ForwardingRule. + * @memberof google.cloud.compute.v1 + * @interface IForwardingRule + * @property {string|null} [IPAddress] ForwardingRule IPAddress + * @property {google.cloud.compute.v1.ForwardingRule.IPProtocol_|null} [IPProtocol] ForwardingRule IPProtocol + * @property {boolean|null} [allPorts] ForwardingRule allPorts + * @property {boolean|null} [allowGlobalAccess] ForwardingRule allowGlobalAccess + * @property {string|null} [backendService] ForwardingRule backendService + * @property {string|null} [creationTimestamp] ForwardingRule creationTimestamp + * @property {string|null} [description] ForwardingRule description + * @property {string|null} [fingerprint] ForwardingRule fingerprint + * @property {number|Long|null} [id] ForwardingRule id + * @property {google.cloud.compute.v1.ForwardingRule.IpVersion|null} [ipVersion] ForwardingRule ipVersion + * @property {boolean|null} [isMirroringCollector] ForwardingRule isMirroringCollector + * @property {string|null} [kind] ForwardingRule kind + * @property {string|null} [labelFingerprint] ForwardingRule labelFingerprint + * @property {Object.|null} [labels] ForwardingRule labels + * @property {google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme|null} [loadBalancingScheme] ForwardingRule loadBalancingScheme + * @property {Array.|null} [metadataFilters] ForwardingRule metadataFilters + * @property {string|null} [name] ForwardingRule name + * @property {string|null} [network] ForwardingRule network + * @property {google.cloud.compute.v1.ForwardingRule.NetworkTier|null} [networkTier] ForwardingRule networkTier + * @property {string|null} [portRange] ForwardingRule portRange + * @property {Array.|null} [ports] ForwardingRule ports + * @property {number|Long|null} [pscConnectionId] ForwardingRule pscConnectionId + * @property {string|null} [region] ForwardingRule region + * @property {string|null} [selfLink] ForwardingRule selfLink + * @property {Array.|null} [serviceDirectoryRegistrations] ForwardingRule serviceDirectoryRegistrations + * @property {string|null} [serviceLabel] ForwardingRule serviceLabel + * @property {string|null} [serviceName] ForwardingRule serviceName + * @property {string|null} [subnetwork] ForwardingRule subnetwork + * @property {string|null} [target] ForwardingRule target + */ + + /** + * Constructs a new ForwardingRule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ForwardingRule. + * @implements IForwardingRule + * @constructor + * @param {google.cloud.compute.v1.IForwardingRule=} [properties] Properties to set + */ + function ForwardingRule(properties) { + this.labels = {}; + this.metadataFilters = []; + this.ports = []; + this.serviceDirectoryRegistrations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardingRule IPAddress. + * @member {string|null|undefined} IPAddress + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.IPAddress = null; + + /** + * ForwardingRule IPProtocol. + * @member {google.cloud.compute.v1.ForwardingRule.IPProtocol_|null|undefined} IPProtocol + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.IPProtocol = null; + + /** + * ForwardingRule allPorts. + * @member {boolean|null|undefined} allPorts + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.allPorts = null; + + /** + * ForwardingRule allowGlobalAccess. + * @member {boolean|null|undefined} allowGlobalAccess + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.allowGlobalAccess = null; + + /** + * ForwardingRule backendService. + * @member {string|null|undefined} backendService + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.backendService = null; + + /** + * ForwardingRule creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.creationTimestamp = null; + + /** + * ForwardingRule description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.description = null; + + /** + * ForwardingRule fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.fingerprint = null; + + /** + * ForwardingRule id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.id = null; + + /** + * ForwardingRule ipVersion. + * @member {google.cloud.compute.v1.ForwardingRule.IpVersion|null|undefined} ipVersion + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.ipVersion = null; + + /** + * ForwardingRule isMirroringCollector. + * @member {boolean|null|undefined} isMirroringCollector + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.isMirroringCollector = null; + + /** + * ForwardingRule kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.kind = null; + + /** + * ForwardingRule labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.labelFingerprint = null; + + /** + * ForwardingRule labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.labels = $util.emptyObject; + + /** + * ForwardingRule loadBalancingScheme. + * @member {google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme|null|undefined} loadBalancingScheme + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.loadBalancingScheme = null; + + /** + * ForwardingRule metadataFilters. + * @member {Array.} metadataFilters + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.metadataFilters = $util.emptyArray; + + /** + * ForwardingRule name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.name = null; + + /** + * ForwardingRule network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.network = null; + + /** + * ForwardingRule networkTier. + * @member {google.cloud.compute.v1.ForwardingRule.NetworkTier|null|undefined} networkTier + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.networkTier = null; + + /** + * ForwardingRule portRange. + * @member {string|null|undefined} portRange + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.portRange = null; + + /** + * ForwardingRule ports. + * @member {Array.} ports + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.ports = $util.emptyArray; + + /** + * ForwardingRule pscConnectionId. + * @member {number|Long|null|undefined} pscConnectionId + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.pscConnectionId = null; + + /** + * ForwardingRule region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.region = null; + + /** + * ForwardingRule selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.selfLink = null; + + /** + * ForwardingRule serviceDirectoryRegistrations. + * @member {Array.} serviceDirectoryRegistrations + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.serviceDirectoryRegistrations = $util.emptyArray; + + /** + * ForwardingRule serviceLabel. + * @member {string|null|undefined} serviceLabel + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.serviceLabel = null; + + /** + * ForwardingRule serviceName. + * @member {string|null|undefined} serviceName + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.serviceName = null; + + /** + * ForwardingRule subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.subnetwork = null; + + /** + * ForwardingRule target. + * @member {string|null|undefined} target + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + ForwardingRule.prototype.target = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ForwardingRule _IPAddress. + * @member {"IPAddress"|undefined} _IPAddress + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_IPAddress", { + get: $util.oneOfGetter($oneOfFields = ["IPAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _IPProtocol. + * @member {"IPProtocol"|undefined} _IPProtocol + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_IPProtocol", { + get: $util.oneOfGetter($oneOfFields = ["IPProtocol"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _allPorts. + * @member {"allPorts"|undefined} _allPorts + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_allPorts", { + get: $util.oneOfGetter($oneOfFields = ["allPorts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _allowGlobalAccess. + * @member {"allowGlobalAccess"|undefined} _allowGlobalAccess + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_allowGlobalAccess", { + get: $util.oneOfGetter($oneOfFields = ["allowGlobalAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _backendService. + * @member {"backendService"|undefined} _backendService + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_backendService", { + get: $util.oneOfGetter($oneOfFields = ["backendService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _ipVersion. + * @member {"ipVersion"|undefined} _ipVersion + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_ipVersion", { + get: $util.oneOfGetter($oneOfFields = ["ipVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _isMirroringCollector. + * @member {"isMirroringCollector"|undefined} _isMirroringCollector + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_isMirroringCollector", { + get: $util.oneOfGetter($oneOfFields = ["isMirroringCollector"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _loadBalancingScheme. + * @member {"loadBalancingScheme"|undefined} _loadBalancingScheme + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_loadBalancingScheme", { + get: $util.oneOfGetter($oneOfFields = ["loadBalancingScheme"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _networkTier. + * @member {"networkTier"|undefined} _networkTier + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_networkTier", { + get: $util.oneOfGetter($oneOfFields = ["networkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _portRange. + * @member {"portRange"|undefined} _portRange + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_portRange", { + get: $util.oneOfGetter($oneOfFields = ["portRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _pscConnectionId. + * @member {"pscConnectionId"|undefined} _pscConnectionId + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_pscConnectionId", { + get: $util.oneOfGetter($oneOfFields = ["pscConnectionId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _serviceLabel. + * @member {"serviceLabel"|undefined} _serviceLabel + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_serviceLabel", { + get: $util.oneOfGetter($oneOfFields = ["serviceLabel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _serviceName. + * @member {"serviceName"|undefined} _serviceName + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_serviceName", { + get: $util.oneOfGetter($oneOfFields = ["serviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRule _target. + * @member {"target"|undefined} _target + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + */ + Object.defineProperty(ForwardingRule.prototype, "_target", { + get: $util.oneOfGetter($oneOfFields = ["target"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardingRule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {google.cloud.compute.v1.IForwardingRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ForwardingRule} ForwardingRule instance + */ + ForwardingRule.create = function create(properties) { + return new ForwardingRule(properties); + }; + + /** + * Encodes the specified ForwardingRule message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {google.cloud.compute.v1.IForwardingRule} message ForwardingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.IPAddress != null && Object.hasOwnProperty.call(message, "IPAddress")) + writer.uint32(/* id 42976943, wireType 2 =*/343815546).string(message.IPAddress); + if (message.ports != null && message.ports.length) + for (var i = 0; i < message.ports.length; ++i) + writer.uint32(/* id 106854418, wireType 2 =*/854835346).string(message.ports[i]); + if (message.isMirroringCollector != null && Object.hasOwnProperty.call(message, "isMirroringCollector")) + writer.uint32(/* id 119255164, wireType 0 =*/954041312).bool(message.isMirroringCollector); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 192835985, wireType 2 =*/1542687882).string(message.target); + if (message.portRange != null && Object.hasOwnProperty.call(message, "portRange")) + writer.uint32(/* id 217518079, wireType 2 =*/1740144634).string(message.portRange); + if (message.serviceDirectoryRegistrations != null && message.serviceDirectoryRegistrations.length) + for (var i = 0; i < message.serviceDirectoryRegistrations.length; ++i) + $root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.encode(message.serviceDirectoryRegistrations[i], writer.uint32(/* id 223549694, wireType 2 =*/1788397554).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.pscConnectionId != null && Object.hasOwnProperty.call(message, "pscConnectionId")) + writer.uint32(/* id 292082397, wireType 0 =*/2336659176).uint64(message.pscConnectionId); + if (message.ipVersion != null && Object.hasOwnProperty.call(message, "ipVersion")) + writer.uint32(/* id 294959552, wireType 0 =*/2359676416).int32(message.ipVersion); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 359880149, wireType 2 =*/2879041194).string(message.serviceName); + if (message.loadBalancingScheme != null && Object.hasOwnProperty.call(message, "loadBalancingScheme")) + writer.uint32(/* id 363890244, wireType 0 =*/2911121952).int32(message.loadBalancingScheme); + if (message.serviceLabel != null && Object.hasOwnProperty.call(message, "serviceLabel")) + writer.uint32(/* id 417008874, wireType 2 =*/3336070994).string(message.serviceLabel); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.allPorts != null && Object.hasOwnProperty.call(message, "allPorts")) + writer.uint32(/* id 445175796, wireType 0 =*/3561406368).bool(message.allPorts); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.metadataFilters != null && message.metadataFilters.length) + for (var i = 0; i < message.metadataFilters.length; ++i) + $root.google.cloud.compute.v1.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 464725739, wireType 2 =*/3717805914).fork()).ldelim(); + if (message.IPProtocol != null && Object.hasOwnProperty.call(message, "IPProtocol")) + writer.uint32(/* id 488094525, wireType 0 =*/3904756200).int32(message.IPProtocol); + if (message.allowGlobalAccess != null && Object.hasOwnProperty.call(message, "allowGlobalAccess")) + writer.uint32(/* id 499409674, wireType 0 =*/3995277392).bool(message.allowGlobalAccess); + 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 500195327, wireType 2 =*/4001562618).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) + writer.uint32(/* id 517397843, wireType 0 =*/4139182744).int32(message.networkTier); + return writer; + }; + + /** + * Encodes the specified ForwardingRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {google.cloud.compute.v1.IForwardingRule} message ForwardingRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardingRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ForwardingRule} ForwardingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ForwardingRule(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 42976943: + message.IPAddress = reader.string(); + break; + case 488094525: + message.IPProtocol = reader.int32(); + break; + case 445175796: + message.allPorts = reader.bool(); + break; + case 499409674: + message.allowGlobalAccess = reader.bool(); + break; + case 306946058: + message.backendService = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 294959552: + message.ipVersion = reader.int32(); + break; + case 119255164: + message.isMirroringCollector = reader.bool(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 363890244: + message.loadBalancingScheme = reader.int32(); + break; + case 464725739: + if (!(message.metadataFilters && message.metadataFilters.length)) + message.metadataFilters = []; + message.metadataFilters.push($root.google.cloud.compute.v1.MetadataFilter.decode(reader, reader.uint32())); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 517397843: + message.networkTier = reader.int32(); + break; + case 217518079: + message.portRange = reader.string(); + break; + case 106854418: + if (!(message.ports && message.ports.length)) + message.ports = []; + message.ports.push(reader.string()); + break; + case 292082397: + message.pscConnectionId = reader.uint64(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 223549694: + if (!(message.serviceDirectoryRegistrations && message.serviceDirectoryRegistrations.length)) + message.serviceDirectoryRegistrations = []; + message.serviceDirectoryRegistrations.push($root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.decode(reader, reader.uint32())); + break; + case 417008874: + message.serviceLabel = reader.string(); + break; + case 359880149: + message.serviceName = reader.string(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + case 192835985: + message.target = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardingRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ForwardingRule} ForwardingRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardingRule message. + * @function verify + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardingRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.IPAddress != null && message.hasOwnProperty("IPAddress")) { + properties._IPAddress = 1; + if (!$util.isString(message.IPAddress)) + return "IPAddress: string expected"; + } + if (message.IPProtocol != null && message.hasOwnProperty("IPProtocol")) { + properties._IPProtocol = 1; + switch (message.IPProtocol) { + default: + return "IPProtocol: enum value expected"; + case 0: + case 2087: + case 68962: + case 2241597: + case 2539724: + case 82881: + case 83873: + break; + } + } + if (message.allPorts != null && message.hasOwnProperty("allPorts")) { + properties._allPorts = 1; + if (typeof message.allPorts !== "boolean") + return "allPorts: boolean expected"; + } + if (message.allowGlobalAccess != null && message.hasOwnProperty("allowGlobalAccess")) { + properties._allowGlobalAccess = 1; + if (typeof message.allowGlobalAccess !== "boolean") + return "allowGlobalAccess: boolean expected"; + } + if (message.backendService != null && message.hasOwnProperty("backendService")) { + properties._backendService = 1; + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.ipVersion != null && message.hasOwnProperty("ipVersion")) { + properties._ipVersion = 1; + switch (message.ipVersion) { + default: + return "ipVersion: enum value expected"; + case 0: + case 2254341: + case 2254343: + case 21850000: + break; + } + } + if (message.isMirroringCollector != null && message.hasOwnProperty("isMirroringCollector")) { + properties._isMirroringCollector = 1; + if (typeof message.isMirroringCollector !== "boolean") + return "isMirroringCollector: boolean expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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.loadBalancingScheme != null && message.hasOwnProperty("loadBalancingScheme")) { + properties._loadBalancingScheme = 1; + switch (message.loadBalancingScheme) { + default: + return "loadBalancingScheme: enum value expected"; + case 0: + case 35607499: + case 279295677: + case 37350397: + case 236211150: + case 530283991: + break; + } + } + if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) { + if (!Array.isArray(message.metadataFilters)) + return "metadataFilters: array expected"; + for (var i = 0; i < message.metadataFilters.length; ++i) { + var error = $root.google.cloud.compute.v1.MetadataFilter.verify(message.metadataFilters[i]); + if (error) + return "metadataFilters." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + properties._networkTier = 1; + switch (message.networkTier) { + default: + return "networkTier: enum value expected"; + case 0: + case 399530551: + case 484642493: + break; + } + } + if (message.portRange != null && message.hasOwnProperty("portRange")) { + properties._portRange = 1; + if (!$util.isString(message.portRange)) + return "portRange: 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.isString(message.ports[i])) + return "ports: string[] expected"; + } + if (message.pscConnectionId != null && message.hasOwnProperty("pscConnectionId")) { + properties._pscConnectionId = 1; + if (!$util.isInteger(message.pscConnectionId) && !(message.pscConnectionId && $util.isInteger(message.pscConnectionId.low) && $util.isInteger(message.pscConnectionId.high))) + return "pscConnectionId: integer|Long expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.serviceDirectoryRegistrations != null && message.hasOwnProperty("serviceDirectoryRegistrations")) { + if (!Array.isArray(message.serviceDirectoryRegistrations)) + return "serviceDirectoryRegistrations: array expected"; + for (var i = 0; i < message.serviceDirectoryRegistrations.length; ++i) { + var error = $root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.verify(message.serviceDirectoryRegistrations[i]); + if (error) + return "serviceDirectoryRegistrations." + error; + } + } + if (message.serviceLabel != null && message.hasOwnProperty("serviceLabel")) { + properties._serviceLabel = 1; + if (!$util.isString(message.serviceLabel)) + return "serviceLabel: string expected"; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) { + properties._serviceName = 1; + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + if (message.target != null && message.hasOwnProperty("target")) { + properties._target = 1; + if (!$util.isString(message.target)) + return "target: string expected"; + } + return null; + }; + + /** + * Creates a ForwardingRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ForwardingRule} ForwardingRule + */ + ForwardingRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ForwardingRule) + return object; + var message = new $root.google.cloud.compute.v1.ForwardingRule(); + if (object.IPAddress != null) + message.IPAddress = String(object.IPAddress); + switch (object.IPProtocol) { + case "UNDEFINED_I_P_PROTOCOL": + case 0: + message.IPProtocol = 0; + break; + case "AH": + case 2087: + message.IPProtocol = 2087; + break; + case "ESP": + case 68962: + message.IPProtocol = 68962; + break; + case "ICMP": + case 2241597: + message.IPProtocol = 2241597; + break; + case "SCTP": + case 2539724: + message.IPProtocol = 2539724; + break; + case "TCP": + case 82881: + message.IPProtocol = 82881; + break; + case "UDP": + case 83873: + message.IPProtocol = 83873; + break; + } + if (object.allPorts != null) + message.allPorts = Boolean(object.allPorts); + if (object.allowGlobalAccess != null) + message.allowGlobalAccess = Boolean(object.allowGlobalAccess); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + switch (object.ipVersion) { + case "UNDEFINED_IP_VERSION": + case 0: + message.ipVersion = 0; + break; + case "IPV4": + case 2254341: + message.ipVersion = 2254341; + break; + case "IPV6": + case 2254343: + message.ipVersion = 2254343; + break; + case "UNSPECIFIED_VERSION": + case 21850000: + message.ipVersion = 21850000; + break; + } + if (object.isMirroringCollector != null) + message.isMirroringCollector = Boolean(object.isMirroringCollector); + if (object.kind != null) + message.kind = String(object.kind); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRule.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]]); + } + switch (object.loadBalancingScheme) { + case "UNDEFINED_LOAD_BALANCING_SCHEME": + case 0: + message.loadBalancingScheme = 0; + break; + case "EXTERNAL": + case 35607499: + message.loadBalancingScheme = 35607499; + break; + case "INTERNAL": + case 279295677: + message.loadBalancingScheme = 279295677; + break; + case "INTERNAL_MANAGED": + case 37350397: + message.loadBalancingScheme = 37350397; + break; + case "INTERNAL_SELF_MANAGED": + case 236211150: + message.loadBalancingScheme = 236211150; + break; + case "INVALID": + case 530283991: + message.loadBalancingScheme = 530283991; + break; + } + if (object.metadataFilters) { + if (!Array.isArray(object.metadataFilters)) + throw TypeError(".google.cloud.compute.v1.ForwardingRule.metadataFilters: array expected"); + message.metadataFilters = []; + for (var i = 0; i < object.metadataFilters.length; ++i) { + if (typeof object.metadataFilters[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRule.metadataFilters: object expected"); + message.metadataFilters[i] = $root.google.cloud.compute.v1.MetadataFilter.fromObject(object.metadataFilters[i]); + } + } + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + switch (object.networkTier) { + case "UNDEFINED_NETWORK_TIER": + case 0: + message.networkTier = 0; + break; + case "PREMIUM": + case 399530551: + message.networkTier = 399530551; + break; + case "STANDARD": + case 484642493: + message.networkTier = 484642493; + break; + } + if (object.portRange != null) + message.portRange = String(object.portRange); + if (object.ports) { + if (!Array.isArray(object.ports)) + throw TypeError(".google.cloud.compute.v1.ForwardingRule.ports: array expected"); + message.ports = []; + for (var i = 0; i < object.ports.length; ++i) + message.ports[i] = String(object.ports[i]); + } + if (object.pscConnectionId != null) + if ($util.Long) + (message.pscConnectionId = $util.Long.fromValue(object.pscConnectionId)).unsigned = true; + else if (typeof object.pscConnectionId === "string") + message.pscConnectionId = parseInt(object.pscConnectionId, 10); + else if (typeof object.pscConnectionId === "number") + message.pscConnectionId = object.pscConnectionId; + else if (typeof object.pscConnectionId === "object") + message.pscConnectionId = new $util.LongBits(object.pscConnectionId.low >>> 0, object.pscConnectionId.high >>> 0).toNumber(true); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.serviceDirectoryRegistrations) { + if (!Array.isArray(object.serviceDirectoryRegistrations)) + throw TypeError(".google.cloud.compute.v1.ForwardingRule.serviceDirectoryRegistrations: array expected"); + message.serviceDirectoryRegistrations = []; + for (var i = 0; i < object.serviceDirectoryRegistrations.length; ++i) { + if (typeof object.serviceDirectoryRegistrations[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRule.serviceDirectoryRegistrations: object expected"); + message.serviceDirectoryRegistrations[i] = $root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.fromObject(object.serviceDirectoryRegistrations[i]); + } + } + if (object.serviceLabel != null) + message.serviceLabel = String(object.serviceLabel); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.target != null) + message.target = String(object.target); + return message; + }; + + /** + * Creates a plain object from a ForwardingRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ForwardingRule + * @static + * @param {google.cloud.compute.v1.ForwardingRule} message ForwardingRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardingRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ports = []; + object.serviceDirectoryRegistrations = []; + object.metadataFilters = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.IPAddress != null && message.hasOwnProperty("IPAddress")) { + object.IPAddress = message.IPAddress; + if (options.oneofs) + object._IPAddress = "IPAddress"; + } + if (message.ports && message.ports.length) { + object.ports = []; + for (var j = 0; j < message.ports.length; ++j) + object.ports[j] = message.ports[j]; + } + if (message.isMirroringCollector != null && message.hasOwnProperty("isMirroringCollector")) { + object.isMirroringCollector = message.isMirroringCollector; + if (options.oneofs) + object._isMirroringCollector = "isMirroringCollector"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + if (message.target != null && message.hasOwnProperty("target")) { + object.target = message.target; + if (options.oneofs) + object._target = "target"; + } + if (message.portRange != null && message.hasOwnProperty("portRange")) { + object.portRange = message.portRange; + if (options.oneofs) + object._portRange = "portRange"; + } + if (message.serviceDirectoryRegistrations && message.serviceDirectoryRegistrations.length) { + object.serviceDirectoryRegistrations = []; + for (var j = 0; j < message.serviceDirectoryRegistrations.length; ++j) + object.serviceDirectoryRegistrations[j] = $root.google.cloud.compute.v1.ForwardingRuleServiceDirectoryRegistration.toObject(message.serviceDirectoryRegistrations[j], options); + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.pscConnectionId != null && message.hasOwnProperty("pscConnectionId")) { + if (typeof message.pscConnectionId === "number") + object.pscConnectionId = options.longs === String ? String(message.pscConnectionId) : message.pscConnectionId; + else + object.pscConnectionId = options.longs === String ? $util.Long.prototype.toString.call(message.pscConnectionId) : options.longs === Number ? new $util.LongBits(message.pscConnectionId.low >>> 0, message.pscConnectionId.high >>> 0).toNumber(true) : message.pscConnectionId; + if (options.oneofs) + object._pscConnectionId = "pscConnectionId"; + } + if (message.ipVersion != null && message.hasOwnProperty("ipVersion")) { + object.ipVersion = options.enums === String ? $root.google.cloud.compute.v1.ForwardingRule.IpVersion[message.ipVersion] : message.ipVersion; + if (options.oneofs) + object._ipVersion = "ipVersion"; + } + if (message.backendService != null && message.hasOwnProperty("backendService")) { + object.backendService = message.backendService; + if (options.oneofs) + object._backendService = "backendService"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.serviceName != null && message.hasOwnProperty("serviceName")) { + object.serviceName = message.serviceName; + if (options.oneofs) + object._serviceName = "serviceName"; + } + if (message.loadBalancingScheme != null && message.hasOwnProperty("loadBalancingScheme")) { + object.loadBalancingScheme = options.enums === String ? $root.google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme[message.loadBalancingScheme] : message.loadBalancingScheme; + if (options.oneofs) + object._loadBalancingScheme = "loadBalancingScheme"; + } + if (message.serviceLabel != null && message.hasOwnProperty("serviceLabel")) { + object.serviceLabel = message.serviceLabel; + if (options.oneofs) + object._serviceLabel = "serviceLabel"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.allPorts != null && message.hasOwnProperty("allPorts")) { + object.allPorts = message.allPorts; + if (options.oneofs) + object._allPorts = "allPorts"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.metadataFilters && message.metadataFilters.length) { + object.metadataFilters = []; + for (var j = 0; j < message.metadataFilters.length; ++j) + object.metadataFilters[j] = $root.google.cloud.compute.v1.MetadataFilter.toObject(message.metadataFilters[j], options); + } + if (message.IPProtocol != null && message.hasOwnProperty("IPProtocol")) { + object.IPProtocol = options.enums === String ? $root.google.cloud.compute.v1.ForwardingRule.IPProtocol_[message.IPProtocol] : message.IPProtocol; + if (options.oneofs) + object._IPProtocol = "IPProtocol"; + } + if (message.allowGlobalAccess != null && message.hasOwnProperty("allowGlobalAccess")) { + object.allowGlobalAccess = message.allowGlobalAccess; + if (options.oneofs) + object._allowGlobalAccess = "allowGlobalAccess"; + } + 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.networkTier != null && message.hasOwnProperty("networkTier")) { + object.networkTier = options.enums === String ? $root.google.cloud.compute.v1.ForwardingRule.NetworkTier[message.networkTier] : message.networkTier; + if (options.oneofs) + object._networkTier = "networkTier"; + } + return object; + }; + + /** + * Converts this ForwardingRule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ForwardingRule + * @instance + * @returns {Object.} JSON object + */ + ForwardingRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IPProtocol_ enum. + * @name google.cloud.compute.v1.ForwardingRule.IPProtocol_ + * @enum {number} + * @property {number} UNDEFINED_I_P_PROTOCOL=0 UNDEFINED_I_P_PROTOCOL value + * @property {number} AH=2087 AH value + * @property {number} ESP=68962 ESP value + * @property {number} ICMP=2241597 ICMP value + * @property {number} SCTP=2539724 SCTP value + * @property {number} TCP=82881 TCP value + * @property {number} UDP=83873 UDP value + */ + ForwardingRule.IPProtocol_ = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_I_P_PROTOCOL"] = 0; + values[valuesById[2087] = "AH"] = 2087; + values[valuesById[68962] = "ESP"] = 68962; + values[valuesById[2241597] = "ICMP"] = 2241597; + values[valuesById[2539724] = "SCTP"] = 2539724; + values[valuesById[82881] = "TCP"] = 82881; + values[valuesById[83873] = "UDP"] = 83873; + return values; + })(); + + /** + * IpVersion enum. + * @name google.cloud.compute.v1.ForwardingRule.IpVersion + * @enum {number} + * @property {number} UNDEFINED_IP_VERSION=0 UNDEFINED_IP_VERSION value + * @property {number} IPV4=2254341 IPV4 value + * @property {number} IPV6=2254343 IPV6 value + * @property {number} UNSPECIFIED_VERSION=21850000 UNSPECIFIED_VERSION value + */ + ForwardingRule.IpVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_IP_VERSION"] = 0; + values[valuesById[2254341] = "IPV4"] = 2254341; + values[valuesById[2254343] = "IPV6"] = 2254343; + values[valuesById[21850000] = "UNSPECIFIED_VERSION"] = 21850000; + return values; + })(); + + /** + * LoadBalancingScheme enum. + * @name google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme + * @enum {number} + * @property {number} UNDEFINED_LOAD_BALANCING_SCHEME=0 UNDEFINED_LOAD_BALANCING_SCHEME value + * @property {number} EXTERNAL=35607499 EXTERNAL value + * @property {number} INTERNAL=279295677 INTERNAL value + * @property {number} INTERNAL_MANAGED=37350397 INTERNAL_MANAGED value + * @property {number} INTERNAL_SELF_MANAGED=236211150 INTERNAL_SELF_MANAGED value + * @property {number} INVALID=530283991 INVALID value + */ + ForwardingRule.LoadBalancingScheme = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LOAD_BALANCING_SCHEME"] = 0; + values[valuesById[35607499] = "EXTERNAL"] = 35607499; + values[valuesById[279295677] = "INTERNAL"] = 279295677; + values[valuesById[37350397] = "INTERNAL_MANAGED"] = 37350397; + values[valuesById[236211150] = "INTERNAL_SELF_MANAGED"] = 236211150; + values[valuesById[530283991] = "INVALID"] = 530283991; + return values; + })(); + + /** + * NetworkTier enum. + * @name google.cloud.compute.v1.ForwardingRule.NetworkTier + * @enum {number} + * @property {number} UNDEFINED_NETWORK_TIER=0 UNDEFINED_NETWORK_TIER value + * @property {number} PREMIUM=399530551 PREMIUM value + * @property {number} STANDARD=484642493 STANDARD value + */ + ForwardingRule.NetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NETWORK_TIER"] = 0; + values[valuesById[399530551] = "PREMIUM"] = 399530551; + values[valuesById[484642493] = "STANDARD"] = 484642493; + return values; + })(); + + return ForwardingRule; + })(); + + v1.ForwardingRulesScopedList = (function() { + + /** + * Properties of a ForwardingRulesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IForwardingRulesScopedList + * @property {Array.|null} [forwardingRules] ForwardingRulesScopedList forwardingRules + * @property {google.cloud.compute.v1.IWarning|null} [warning] ForwardingRulesScopedList warning + */ + + /** + * Constructs a new ForwardingRulesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ForwardingRulesScopedList. + * @implements IForwardingRulesScopedList + * @constructor + * @param {google.cloud.compute.v1.IForwardingRulesScopedList=} [properties] Properties to set + */ + function ForwardingRulesScopedList(properties) { + this.forwardingRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardingRulesScopedList forwardingRules. + * @member {Array.} forwardingRules + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @instance + */ + ForwardingRulesScopedList.prototype.forwardingRules = $util.emptyArray; + + /** + * ForwardingRulesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @instance + */ + ForwardingRulesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ForwardingRulesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @instance + */ + Object.defineProperty(ForwardingRulesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardingRulesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {google.cloud.compute.v1.IForwardingRulesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ForwardingRulesScopedList} ForwardingRulesScopedList instance + */ + ForwardingRulesScopedList.create = function create(properties) { + return new ForwardingRulesScopedList(properties); + }; + + /** + * Encodes the specified ForwardingRulesScopedList message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRulesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {google.cloud.compute.v1.IForwardingRulesScopedList} message ForwardingRulesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRulesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.forwardingRules != null && message.forwardingRules.length) + for (var i = 0; i < message.forwardingRules.length; ++i) + $root.google.cloud.compute.v1.ForwardingRule.encode(message.forwardingRules[i], writer.uint32(/* id 315821365, wireType 2 =*/2526570922).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ForwardingRulesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRulesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {google.cloud.compute.v1.IForwardingRulesScopedList} message ForwardingRulesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRulesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardingRulesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ForwardingRulesScopedList} ForwardingRulesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRulesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ForwardingRulesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 315821365: + if (!(message.forwardingRules && message.forwardingRules.length)) + message.forwardingRules = []; + message.forwardingRules.push($root.google.cloud.compute.v1.ForwardingRule.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardingRulesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ForwardingRulesScopedList} ForwardingRulesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRulesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardingRulesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardingRulesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRules != null && message.hasOwnProperty("forwardingRules")) { + if (!Array.isArray(message.forwardingRules)) + return "forwardingRules: array expected"; + for (var i = 0; i < message.forwardingRules.length; ++i) { + var error = $root.google.cloud.compute.v1.ForwardingRule.verify(message.forwardingRules[i]); + if (error) + return "forwardingRules." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ForwardingRulesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ForwardingRulesScopedList} ForwardingRulesScopedList + */ + ForwardingRulesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ForwardingRulesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.ForwardingRulesScopedList(); + if (object.forwardingRules) { + if (!Array.isArray(object.forwardingRules)) + throw TypeError(".google.cloud.compute.v1.ForwardingRulesScopedList.forwardingRules: array expected"); + message.forwardingRules = []; + for (var i = 0; i < object.forwardingRules.length; ++i) { + if (typeof object.forwardingRules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRulesScopedList.forwardingRules: object expected"); + message.forwardingRules[i] = $root.google.cloud.compute.v1.ForwardingRule.fromObject(object.forwardingRules[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRulesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ForwardingRulesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @static + * @param {google.cloud.compute.v1.ForwardingRulesScopedList} message ForwardingRulesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardingRulesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.forwardingRules = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.forwardingRules && message.forwardingRules.length) { + object.forwardingRules = []; + for (var j = 0; j < message.forwardingRules.length; ++j) + object.forwardingRules[j] = $root.google.cloud.compute.v1.ForwardingRule.toObject(message.forwardingRules[j], options); + } + return object; + }; + + /** + * Converts this ForwardingRulesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ForwardingRulesScopedList + * @instance + * @returns {Object.} JSON object + */ + ForwardingRulesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ForwardingRulesScopedList; + })(); + + v1.ForwardingRuleAggregatedList = (function() { + + /** + * Properties of a ForwardingRuleAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IForwardingRuleAggregatedList + * @property {string|null} [id] ForwardingRuleAggregatedList id + * @property {Object.|null} [items] ForwardingRuleAggregatedList items + * @property {string|null} [kind] ForwardingRuleAggregatedList kind + * @property {string|null} [nextPageToken] ForwardingRuleAggregatedList nextPageToken + * @property {string|null} [selfLink] ForwardingRuleAggregatedList selfLink + * @property {Array.|null} [unreachables] ForwardingRuleAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] ForwardingRuleAggregatedList warning + */ + + /** + * Constructs a new ForwardingRuleAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ForwardingRuleAggregatedList. + * @implements IForwardingRuleAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IForwardingRuleAggregatedList=} [properties] Properties to set + */ + function ForwardingRuleAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardingRuleAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + ForwardingRuleAggregatedList.prototype.id = null; + + /** + * ForwardingRuleAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + ForwardingRuleAggregatedList.prototype.items = $util.emptyObject; + + /** + * ForwardingRuleAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + ForwardingRuleAggregatedList.prototype.kind = null; + + /** + * ForwardingRuleAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + ForwardingRuleAggregatedList.prototype.nextPageToken = null; + + /** + * ForwardingRuleAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + ForwardingRuleAggregatedList.prototype.selfLink = null; + + /** + * ForwardingRuleAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + ForwardingRuleAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * ForwardingRuleAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + ForwardingRuleAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ForwardingRuleAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + Object.defineProperty(ForwardingRuleAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + Object.defineProperty(ForwardingRuleAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + Object.defineProperty(ForwardingRuleAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + Object.defineProperty(ForwardingRuleAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + */ + Object.defineProperty(ForwardingRuleAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardingRuleAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {google.cloud.compute.v1.IForwardingRuleAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ForwardingRuleAggregatedList} ForwardingRuleAggregatedList instance + */ + ForwardingRuleAggregatedList.create = function create(properties) { + return new ForwardingRuleAggregatedList(properties); + }; + + /** + * Encodes the specified ForwardingRuleAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {google.cloud.compute.v1.IForwardingRuleAggregatedList} message ForwardingRuleAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.ForwardingRulesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ForwardingRuleAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {google.cloud.compute.v1.IForwardingRuleAggregatedList} message ForwardingRuleAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardingRuleAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ForwardingRuleAggregatedList} ForwardingRuleAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ForwardingRuleAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.ForwardingRulesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardingRuleAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ForwardingRuleAggregatedList} ForwardingRuleAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardingRuleAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardingRuleAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.ForwardingRulesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ForwardingRuleAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ForwardingRuleAggregatedList} ForwardingRuleAggregatedList + */ + ForwardingRuleAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ForwardingRuleAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.ForwardingRuleAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRuleAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRuleAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.ForwardingRulesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.ForwardingRuleAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRuleAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ForwardingRuleAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @static + * @param {google.cloud.compute.v1.ForwardingRuleAggregatedList} message ForwardingRuleAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardingRuleAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.ForwardingRulesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ForwardingRuleAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ForwardingRuleAggregatedList + * @instance + * @returns {Object.} JSON object + */ + ForwardingRuleAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ForwardingRuleAggregatedList; + })(); + + v1.ForwardingRuleList = (function() { + + /** + * Properties of a ForwardingRuleList. + * @memberof google.cloud.compute.v1 + * @interface IForwardingRuleList + * @property {string|null} [id] ForwardingRuleList id + * @property {Array.|null} [items] ForwardingRuleList items + * @property {string|null} [kind] ForwardingRuleList kind + * @property {string|null} [nextPageToken] ForwardingRuleList nextPageToken + * @property {string|null} [selfLink] ForwardingRuleList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] ForwardingRuleList warning + */ + + /** + * Constructs a new ForwardingRuleList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ForwardingRuleList. + * @implements IForwardingRuleList + * @constructor + * @param {google.cloud.compute.v1.IForwardingRuleList=} [properties] Properties to set + */ + function ForwardingRuleList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardingRuleList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + ForwardingRuleList.prototype.id = null; + + /** + * ForwardingRuleList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + ForwardingRuleList.prototype.items = $util.emptyArray; + + /** + * ForwardingRuleList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + ForwardingRuleList.prototype.kind = null; + + /** + * ForwardingRuleList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + ForwardingRuleList.prototype.nextPageToken = null; + + /** + * ForwardingRuleList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + ForwardingRuleList.prototype.selfLink = null; + + /** + * ForwardingRuleList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + ForwardingRuleList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ForwardingRuleList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + Object.defineProperty(ForwardingRuleList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + Object.defineProperty(ForwardingRuleList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + Object.defineProperty(ForwardingRuleList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + Object.defineProperty(ForwardingRuleList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ForwardingRuleList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + */ + Object.defineProperty(ForwardingRuleList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardingRuleList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {google.cloud.compute.v1.IForwardingRuleList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ForwardingRuleList} ForwardingRuleList instance + */ + ForwardingRuleList.create = function create(properties) { + return new ForwardingRuleList(properties); + }; + + /** + * Encodes the specified ForwardingRuleList message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {google.cloud.compute.v1.IForwardingRuleList} message ForwardingRuleList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.ForwardingRule.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ForwardingRuleList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {google.cloud.compute.v1.IForwardingRuleList} message ForwardingRuleList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardingRuleList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ForwardingRuleList} ForwardingRuleList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ForwardingRuleList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.ForwardingRule.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardingRuleList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ForwardingRuleList} ForwardingRuleList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardingRuleList message. + * @function verify + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardingRuleList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.ForwardingRule.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ForwardingRuleList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ForwardingRuleList} ForwardingRuleList + */ + ForwardingRuleList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ForwardingRuleList) + return object; + var message = new $root.google.cloud.compute.v1.ForwardingRuleList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.ForwardingRuleList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRuleList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.ForwardingRule.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ForwardingRuleList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ForwardingRuleList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @static + * @param {google.cloud.compute.v1.ForwardingRuleList} message ForwardingRuleList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardingRuleList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.ForwardingRule.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ForwardingRuleList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ForwardingRuleList + * @instance + * @returns {Object.} JSON object + */ + ForwardingRuleList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ForwardingRuleList; + })(); + + v1.ForwardingRuleReference = (function() { + + /** + * Properties of a ForwardingRuleReference. + * @memberof google.cloud.compute.v1 + * @interface IForwardingRuleReference + * @property {string|null} [forwardingRule] ForwardingRuleReference forwardingRule + */ + + /** + * Constructs a new ForwardingRuleReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ForwardingRuleReference. + * @implements IForwardingRuleReference + * @constructor + * @param {google.cloud.compute.v1.IForwardingRuleReference=} [properties] Properties to set + */ + function ForwardingRuleReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ForwardingRuleReference forwardingRule. + * @member {string|null|undefined} forwardingRule + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @instance + */ + ForwardingRuleReference.prototype.forwardingRule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ForwardingRuleReference _forwardingRule. + * @member {"forwardingRule"|undefined} _forwardingRule + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @instance + */ + Object.defineProperty(ForwardingRuleReference.prototype, "_forwardingRule", { + get: $util.oneOfGetter($oneOfFields = ["forwardingRule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ForwardingRuleReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {google.cloud.compute.v1.IForwardingRuleReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ForwardingRuleReference} ForwardingRuleReference instance + */ + ForwardingRuleReference.create = function create(properties) { + return new ForwardingRuleReference(properties); + }; + + /** + * Encodes the specified ForwardingRuleReference message. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {google.cloud.compute.v1.IForwardingRuleReference} message ForwardingRuleReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + return writer; + }; + + /** + * Encodes the specified ForwardingRuleReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ForwardingRuleReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {google.cloud.compute.v1.IForwardingRuleReference} message ForwardingRuleReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ForwardingRuleReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ForwardingRuleReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ForwardingRuleReference} ForwardingRuleReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ForwardingRuleReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ForwardingRuleReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ForwardingRuleReference} ForwardingRuleReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ForwardingRuleReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ForwardingRuleReference message. + * @function verify + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ForwardingRuleReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) { + properties._forwardingRule = 1; + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + } + return null; + }; + + /** + * Creates a ForwardingRuleReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ForwardingRuleReference} ForwardingRuleReference + */ + ForwardingRuleReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ForwardingRuleReference) + return object; + var message = new $root.google.cloud.compute.v1.ForwardingRuleReference(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + return message; + }; + + /** + * Creates a plain object from a ForwardingRuleReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @static + * @param {google.cloud.compute.v1.ForwardingRuleReference} message ForwardingRuleReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ForwardingRuleReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) { + object.forwardingRule = message.forwardingRule; + if (options.oneofs) + object._forwardingRule = "forwardingRule"; + } + return object; + }; + + /** + * Converts this ForwardingRuleReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ForwardingRuleReference + * @instance + * @returns {Object.} JSON object + */ + ForwardingRuleReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ForwardingRuleReference; + })(); + + v1.GRPCHealthCheck = (function() { + + /** + * Properties of a GRPCHealthCheck. + * @memberof google.cloud.compute.v1 + * @interface IGRPCHealthCheck + * @property {string|null} [grpcServiceName] GRPCHealthCheck grpcServiceName + * @property {number|null} [port] GRPCHealthCheck port + * @property {string|null} [portName] GRPCHealthCheck portName + * @property {google.cloud.compute.v1.GRPCHealthCheck.PortSpecification|null} [portSpecification] GRPCHealthCheck portSpecification + */ + + /** + * Constructs a new GRPCHealthCheck. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GRPCHealthCheck. + * @implements IGRPCHealthCheck + * @constructor + * @param {google.cloud.compute.v1.IGRPCHealthCheck=} [properties] Properties to set + */ + function GRPCHealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GRPCHealthCheck grpcServiceName. + * @member {string|null|undefined} grpcServiceName + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + GRPCHealthCheck.prototype.grpcServiceName = null; + + /** + * GRPCHealthCheck port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + GRPCHealthCheck.prototype.port = null; + + /** + * GRPCHealthCheck portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + GRPCHealthCheck.prototype.portName = null; + + /** + * GRPCHealthCheck portSpecification. + * @member {google.cloud.compute.v1.GRPCHealthCheck.PortSpecification|null|undefined} portSpecification + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + GRPCHealthCheck.prototype.portSpecification = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GRPCHealthCheck _grpcServiceName. + * @member {"grpcServiceName"|undefined} _grpcServiceName + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + Object.defineProperty(GRPCHealthCheck.prototype, "_grpcServiceName", { + get: $util.oneOfGetter($oneOfFields = ["grpcServiceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GRPCHealthCheck _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + Object.defineProperty(GRPCHealthCheck.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GRPCHealthCheck _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + Object.defineProperty(GRPCHealthCheck.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GRPCHealthCheck _portSpecification. + * @member {"portSpecification"|undefined} _portSpecification + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + */ + Object.defineProperty(GRPCHealthCheck.prototype, "_portSpecification", { + get: $util.oneOfGetter($oneOfFields = ["portSpecification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GRPCHealthCheck instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {google.cloud.compute.v1.IGRPCHealthCheck=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GRPCHealthCheck} GRPCHealthCheck instance + */ + GRPCHealthCheck.create = function create(properties) { + return new GRPCHealthCheck(properties); + }; + + /** + * Encodes the specified GRPCHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.GRPCHealthCheck.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {google.cloud.compute.v1.IGRPCHealthCheck} message GRPCHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GRPCHealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.portSpecification != null && Object.hasOwnProperty.call(message, "portSpecification")) + writer.uint32(/* id 51590597, wireType 0 =*/412724776).int32(message.portSpecification); + if (message.grpcServiceName != null && Object.hasOwnProperty.call(message, "grpcServiceName")) + writer.uint32(/* id 136533078, wireType 2 =*/1092264626).string(message.grpcServiceName); + return writer; + }; + + /** + * Encodes the specified GRPCHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GRPCHealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {google.cloud.compute.v1.IGRPCHealthCheck} message GRPCHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GRPCHealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GRPCHealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GRPCHealthCheck} GRPCHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GRPCHealthCheck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GRPCHealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 136533078: + message.grpcServiceName = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + case 51590597: + message.portSpecification = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GRPCHealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GRPCHealthCheck} GRPCHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GRPCHealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GRPCHealthCheck message. + * @function verify + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GRPCHealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.grpcServiceName != null && message.hasOwnProperty("grpcServiceName")) { + properties._grpcServiceName = 1; + if (!$util.isString(message.grpcServiceName)) + return "grpcServiceName: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + properties._portSpecification = 1; + switch (message.portSpecification) { + default: + return "portSpecification: enum value expected"; + case 0: + case 190235748: + case 349300671: + case 362637516: + break; + } + } + return null; + }; + + /** + * Creates a GRPCHealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GRPCHealthCheck} GRPCHealthCheck + */ + GRPCHealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GRPCHealthCheck) + return object; + var message = new $root.google.cloud.compute.v1.GRPCHealthCheck(); + if (object.grpcServiceName != null) + message.grpcServiceName = String(object.grpcServiceName); + if (object.port != null) + message.port = object.port | 0; + if (object.portName != null) + message.portName = String(object.portName); + switch (object.portSpecification) { + case "UNDEFINED_PORT_SPECIFICATION": + case 0: + message.portSpecification = 0; + break; + case "USE_FIXED_PORT": + case 190235748: + message.portSpecification = 190235748; + break; + case "USE_NAMED_PORT": + case 349300671: + message.portSpecification = 349300671; + break; + case "USE_SERVING_PORT": + case 362637516: + message.portSpecification = 362637516; + break; + } + return message; + }; + + /** + * Creates a plain object from a GRPCHealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @static + * @param {google.cloud.compute.v1.GRPCHealthCheck} message GRPCHealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GRPCHealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + object.portSpecification = options.enums === String ? $root.google.cloud.compute.v1.GRPCHealthCheck.PortSpecification[message.portSpecification] : message.portSpecification; + if (options.oneofs) + object._portSpecification = "portSpecification"; + } + if (message.grpcServiceName != null && message.hasOwnProperty("grpcServiceName")) { + object.grpcServiceName = message.grpcServiceName; + if (options.oneofs) + object._grpcServiceName = "grpcServiceName"; + } + return object; + }; + + /** + * Converts this GRPCHealthCheck to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GRPCHealthCheck + * @instance + * @returns {Object.} JSON object + */ + GRPCHealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PortSpecification enum. + * @name google.cloud.compute.v1.GRPCHealthCheck.PortSpecification + * @enum {number} + * @property {number} UNDEFINED_PORT_SPECIFICATION=0 UNDEFINED_PORT_SPECIFICATION value + * @property {number} USE_FIXED_PORT=190235748 USE_FIXED_PORT value + * @property {number} USE_NAMED_PORT=349300671 USE_NAMED_PORT value + * @property {number} USE_SERVING_PORT=362637516 USE_SERVING_PORT value + */ + GRPCHealthCheck.PortSpecification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PORT_SPECIFICATION"] = 0; + values[valuesById[190235748] = "USE_FIXED_PORT"] = 190235748; + values[valuesById[349300671] = "USE_NAMED_PORT"] = 349300671; + values[valuesById[362637516] = "USE_SERVING_PORT"] = 362637516; + return values; + })(); + + return GRPCHealthCheck; + })(); + + v1.NetworkEndpoint = (function() { + + /** + * Properties of a NetworkEndpoint. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpoint + * @property {Object.|null} [annotations] NetworkEndpoint annotations + * @property {string|null} [fqdn] NetworkEndpoint fqdn + * @property {string|null} [instance] NetworkEndpoint instance + * @property {string|null} [ipAddress] NetworkEndpoint ipAddress + * @property {number|null} [port] NetworkEndpoint port + */ + + /** + * Constructs a new NetworkEndpoint. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpoint. + * @implements INetworkEndpoint + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpoint=} [properties] Properties to set + */ + function NetworkEndpoint(properties) { + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpoint annotations. + * @member {Object.} annotations + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + NetworkEndpoint.prototype.annotations = $util.emptyObject; + + /** + * NetworkEndpoint fqdn. + * @member {string|null|undefined} fqdn + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + NetworkEndpoint.prototype.fqdn = null; + + /** + * NetworkEndpoint instance. + * @member {string|null|undefined} instance + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + NetworkEndpoint.prototype.instance = null; + + /** + * NetworkEndpoint ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + NetworkEndpoint.prototype.ipAddress = null; + + /** + * NetworkEndpoint port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + NetworkEndpoint.prototype.port = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpoint _fqdn. + * @member {"fqdn"|undefined} _fqdn + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + Object.defineProperty(NetworkEndpoint.prototype, "_fqdn", { + get: $util.oneOfGetter($oneOfFields = ["fqdn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpoint _instance. + * @member {"instance"|undefined} _instance + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + Object.defineProperty(NetworkEndpoint.prototype, "_instance", { + get: $util.oneOfGetter($oneOfFields = ["instance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpoint _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + Object.defineProperty(NetworkEndpoint.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpoint _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + */ + Object.defineProperty(NetworkEndpoint.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpoint instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {google.cloud.compute.v1.INetworkEndpoint=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpoint} NetworkEndpoint instance + */ + NetworkEndpoint.create = function create(properties) { + return new NetworkEndpoint(properties); + }; + + /** + * Encodes the specified NetworkEndpoint message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {google.cloud.compute.v1.INetworkEndpoint} message NetworkEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) + writer.uint32(/* id 3150485, wireType 2 =*/25203882).string(message.fqdn); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + 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 112032548, wireType 2 =*/896260386).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 406272220, wireType 2 =*/3250177762).string(message.ipAddress); + return writer; + }; + + /** + * Encodes the specified NetworkEndpoint message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {google.cloud.compute.v1.INetworkEndpoint} message NetworkEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpoint} NetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpoint(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 112032548: + 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 3150485: + message.fqdn = reader.string(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 406272220: + message.ipAddress = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpoint} NetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpoint message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.fqdn != null && message.hasOwnProperty("fqdn")) { + properties._fqdn = 1; + if (!$util.isString(message.fqdn)) + return "fqdn: string expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + properties._instance = 1; + if (!$util.isString(message.instance)) + return "instance: string expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + return null; + }; + + /** + * Creates a NetworkEndpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpoint} NetworkEndpoint + */ + NetworkEndpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpoint) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpoint(); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpoint.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.fqdn != null) + message.fqdn = String(object.fqdn); + if (object.instance != null) + message.instance = String(object.instance); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.port != null) + message.port = object.port | 0; + return message; + }; + + /** + * Creates a plain object from a NetworkEndpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @static + * @param {google.cloud.compute.v1.NetworkEndpoint} message NetworkEndpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.annotations = {}; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) { + object.fqdn = message.fqdn; + if (options.oneofs) + object._fqdn = "fqdn"; + } + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + object.instance = message.instance; + if (options.oneofs) + object._instance = "instance"; + } + 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.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + return object; + }; + + /** + * Converts this NetworkEndpoint to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpoint + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpoint; + })(); + + v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest = (function() { + + /** + * Properties of a GlobalNetworkEndpointGroupsAttachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @interface IGlobalNetworkEndpointGroupsAttachEndpointsRequest + * @property {Array.|null} [networkEndpoints] GlobalNetworkEndpointGroupsAttachEndpointsRequest networkEndpoints + */ + + /** + * Constructs a new GlobalNetworkEndpointGroupsAttachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalNetworkEndpointGroupsAttachEndpointsRequest. + * @implements IGlobalNetworkEndpointGroupsAttachEndpointsRequest + * @constructor + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest=} [properties] Properties to set + */ + function GlobalNetworkEndpointGroupsAttachEndpointsRequest(properties) { + this.networkEndpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlobalNetworkEndpointGroupsAttachEndpointsRequest networkEndpoints. + * @member {Array.} networkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @instance + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.prototype.networkEndpoints = $util.emptyArray; + + /** + * Creates a new GlobalNetworkEndpointGroupsAttachEndpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest} GlobalNetworkEndpointGroupsAttachEndpointsRequest instance + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.create = function create(properties) { + return new GlobalNetworkEndpointGroupsAttachEndpointsRequest(properties); + }; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsAttachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest} message GlobalNetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkEndpoints != null && message.networkEndpoints.length) + for (var i = 0; i < message.networkEndpoints.length; ++i) + $root.google.cloud.compute.v1.NetworkEndpoint.encode(message.networkEndpoints[i], writer.uint32(/* id 149850285, wireType 2 =*/1198802282).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsAttachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest} message GlobalNetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlobalNetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest} GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 149850285: + if (!(message.networkEndpoints && message.networkEndpoints.length)) + message.networkEndpoints = []; + message.networkEndpoints.push($root.google.cloud.compute.v1.NetworkEndpoint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlobalNetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest} GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlobalNetworkEndpointGroupsAttachEndpointsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkEndpoints != null && message.hasOwnProperty("networkEndpoints")) { + if (!Array.isArray(message.networkEndpoints)) + return "networkEndpoints: array expected"; + for (var i = 0; i < message.networkEndpoints.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpoint.verify(message.networkEndpoints[i]); + if (error) + return "networkEndpoints." + error; + } + } + return null; + }; + + /** + * Creates a GlobalNetworkEndpointGroupsAttachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest} GlobalNetworkEndpointGroupsAttachEndpointsRequest + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest) + return object; + var message = new $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest(); + if (object.networkEndpoints) { + if (!Array.isArray(object.networkEndpoints)) + throw TypeError(".google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.networkEndpoints: array expected"); + message.networkEndpoints = []; + for (var i = 0; i < object.networkEndpoints.length; ++i) { + if (typeof object.networkEndpoints[i] !== "object") + throw TypeError(".google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.networkEndpoints: object expected"); + message.networkEndpoints[i] = $root.google.cloud.compute.v1.NetworkEndpoint.fromObject(object.networkEndpoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GlobalNetworkEndpointGroupsAttachEndpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest} message GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkEndpoints = []; + if (message.networkEndpoints && message.networkEndpoints.length) { + object.networkEndpoints = []; + for (var j = 0; j < message.networkEndpoints.length; ++j) + object.networkEndpoints[j] = $root.google.cloud.compute.v1.NetworkEndpoint.toObject(message.networkEndpoints[j], options); + } + return object; + }; + + /** + * Converts this GlobalNetworkEndpointGroupsAttachEndpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest + * @instance + * @returns {Object.} JSON object + */ + GlobalNetworkEndpointGroupsAttachEndpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlobalNetworkEndpointGroupsAttachEndpointsRequest; + })(); + + v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest = (function() { + + /** + * Properties of a GlobalNetworkEndpointGroupsDetachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @interface IGlobalNetworkEndpointGroupsDetachEndpointsRequest + * @property {Array.|null} [networkEndpoints] GlobalNetworkEndpointGroupsDetachEndpointsRequest networkEndpoints + */ + + /** + * Constructs a new GlobalNetworkEndpointGroupsDetachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalNetworkEndpointGroupsDetachEndpointsRequest. + * @implements IGlobalNetworkEndpointGroupsDetachEndpointsRequest + * @constructor + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest=} [properties] Properties to set + */ + function GlobalNetworkEndpointGroupsDetachEndpointsRequest(properties) { + this.networkEndpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlobalNetworkEndpointGroupsDetachEndpointsRequest networkEndpoints. + * @member {Array.} networkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @instance + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.prototype.networkEndpoints = $util.emptyArray; + + /** + * Creates a new GlobalNetworkEndpointGroupsDetachEndpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest} GlobalNetworkEndpointGroupsDetachEndpointsRequest instance + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.create = function create(properties) { + return new GlobalNetworkEndpointGroupsDetachEndpointsRequest(properties); + }; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsDetachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest} message GlobalNetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkEndpoints != null && message.networkEndpoints.length) + for (var i = 0; i < message.networkEndpoints.length; ++i) + $root.google.cloud.compute.v1.NetworkEndpoint.encode(message.networkEndpoints[i], writer.uint32(/* id 149850285, wireType 2 =*/1198802282).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlobalNetworkEndpointGroupsDetachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest} message GlobalNetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlobalNetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest} GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 149850285: + if (!(message.networkEndpoints && message.networkEndpoints.length)) + message.networkEndpoints = []; + message.networkEndpoints.push($root.google.cloud.compute.v1.NetworkEndpoint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlobalNetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest} GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlobalNetworkEndpointGroupsDetachEndpointsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkEndpoints != null && message.hasOwnProperty("networkEndpoints")) { + if (!Array.isArray(message.networkEndpoints)) + return "networkEndpoints: array expected"; + for (var i = 0; i < message.networkEndpoints.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpoint.verify(message.networkEndpoints[i]); + if (error) + return "networkEndpoints." + error; + } + } + return null; + }; + + /** + * Creates a GlobalNetworkEndpointGroupsDetachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest} GlobalNetworkEndpointGroupsDetachEndpointsRequest + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest) + return object; + var message = new $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest(); + if (object.networkEndpoints) { + if (!Array.isArray(object.networkEndpoints)) + throw TypeError(".google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.networkEndpoints: array expected"); + message.networkEndpoints = []; + for (var i = 0; i < object.networkEndpoints.length; ++i) { + if (typeof object.networkEndpoints[i] !== "object") + throw TypeError(".google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.networkEndpoints: object expected"); + message.networkEndpoints[i] = $root.google.cloud.compute.v1.NetworkEndpoint.fromObject(object.networkEndpoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GlobalNetworkEndpointGroupsDetachEndpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest} message GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkEndpoints = []; + if (message.networkEndpoints && message.networkEndpoints.length) { + object.networkEndpoints = []; + for (var j = 0; j < message.networkEndpoints.length; ++j) + object.networkEndpoints[j] = $root.google.cloud.compute.v1.NetworkEndpoint.toObject(message.networkEndpoints[j], options); + } + return object; + }; + + /** + * Converts this GlobalNetworkEndpointGroupsDetachEndpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest + * @instance + * @returns {Object.} JSON object + */ + GlobalNetworkEndpointGroupsDetachEndpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlobalNetworkEndpointGroupsDetachEndpointsRequest; + })(); + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.cloud.compute.v1 + * @interface IPolicy + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Array.|null} [bindings] Policy bindings + * @property {string|null} [etag] Policy etag + * @property {boolean|null} [iamOwned] Policy iamOwned + * @property {Array.|null} [rules] Policy rules + * @property {number|null} [version] Policy version + */ + + /** + * Constructs a new Policy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.cloud.compute.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.auditConfigs = []; + this.bindings = []; + 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]]; + } + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Policy.prototype.etag = null; + + /** + * Policy iamOwned. + * @member {boolean|null|undefined} iamOwned + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Policy.prototype.iamOwned = null; + + /** + * Policy rules. + * @member {Array.} rules + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Policy.prototype.rules = $util.emptyArray; + + /** + * Policy version. + * @member {number|null|undefined} version + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Policy.prototype.version = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Policy _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Policy _iamOwned. + * @member {"iamOwned"|undefined} _iamOwned + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "_iamOwned", { + get: $util.oneOfGetter($oneOfFields = ["iamOwned"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Policy _version. + * @member {"version"|undefined} _version + * @memberof google.cloud.compute.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Policy + * @static + * @param {google.cloud.compute.v1.IPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.compute.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Policy + * @static + * @param {google.cloud.compute.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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.compute.v1.Rule.encode(message.rules[i], writer.uint32(/* id 108873975, wireType 2 =*/870991802).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.cloud.compute.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 328080653, wireType 2 =*/2624645226).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 351608024, wireType 0 =*/2812864192).int32(message.version); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.cloud.compute.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 403251854, wireType 2 =*/3226014834).fork()).ldelim(); + if (message.iamOwned != null && Object.hasOwnProperty.call(message, "iamOwned")) + writer.uint32(/* id 450566203, wireType 0 =*/3604529624).bool(message.iamOwned); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Policy + * @static + * @param {google.cloud.compute.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.cloud.compute.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.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.cloud.compute.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 328080653: + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.cloud.compute.v1.AuditConfig.decode(reader, reader.uint32())); + break; + case 403251854: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.compute.v1.Binding.decode(reader, reader.uint32())); + break; + case 3123477: + message.etag = reader.string(); + break; + case 450566203: + message.iamOwned = reader.bool(); + break; + case 108873975: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.compute.v1.Rule.decode(reader, reader.uint32())); + break; + case 351608024: + message.version = reader.int32(); + 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.cloud.compute.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.cloud.compute.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"; + var properties = {}; + 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.cloud.compute.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + 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.cloud.compute.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.iamOwned != null && message.hasOwnProperty("iamOwned")) { + properties._iamOwned = 1; + if (typeof message.iamOwned !== "boolean") + return "iamOwned: boolean 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.cloud.compute.v1.Rule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) { + properties._version = 1; + if (!$util.isInteger(message.version)) + return "version: integer expected"; + } + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Policy) + return object; + var message = new $root.google.cloud.compute.v1.Policy(); + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.cloud.compute.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.cloud.compute.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.cloud.compute.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.compute.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.cloud.compute.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.cloud.compute.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.iamOwned != null) + message.iamOwned = Boolean(object.iamOwned); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.compute.v1.Policy.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Policy.rules: object expected"); + message.rules[i] = $root.google.cloud.compute.v1.Rule.fromObject(object.rules[i]); + } + } + if (object.version != null) + message.version = object.version | 0; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Policy + * @static + * @param {google.cloud.compute.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.rules = []; + object.auditConfigs = []; + object.bindings = []; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.compute.v1.Rule.toObject(message.rules[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.cloud.compute.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = message.version; + if (options.oneofs) + object._version = "version"; + } + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.cloud.compute.v1.Binding.toObject(message.bindings[j], options); + } + if (message.iamOwned != null && message.hasOwnProperty("iamOwned")) { + object.iamOwned = message.iamOwned; + if (options.oneofs) + object._iamOwned = "iamOwned"; + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Policy; + })(); + + v1.GlobalOrganizationSetPolicyRequest = (function() { + + /** + * Properties of a GlobalOrganizationSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGlobalOrganizationSetPolicyRequest + * @property {Array.|null} [bindings] GlobalOrganizationSetPolicyRequest bindings + * @property {string|null} [etag] GlobalOrganizationSetPolicyRequest etag + * @property {google.cloud.compute.v1.IPolicy|null} [policy] GlobalOrganizationSetPolicyRequest policy + */ + + /** + * Constructs a new GlobalOrganizationSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalOrganizationSetPolicyRequest. + * @implements IGlobalOrganizationSetPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest=} [properties] Properties to set + */ + function GlobalOrganizationSetPolicyRequest(properties) { + this.bindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlobalOrganizationSetPolicyRequest bindings. + * @member {Array.} bindings + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @instance + */ + GlobalOrganizationSetPolicyRequest.prototype.bindings = $util.emptyArray; + + /** + * GlobalOrganizationSetPolicyRequest etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @instance + */ + GlobalOrganizationSetPolicyRequest.prototype.etag = null; + + /** + * GlobalOrganizationSetPolicyRequest policy. + * @member {google.cloud.compute.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @instance + */ + GlobalOrganizationSetPolicyRequest.prototype.policy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GlobalOrganizationSetPolicyRequest _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @instance + */ + Object.defineProperty(GlobalOrganizationSetPolicyRequest.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GlobalOrganizationSetPolicyRequest _policy. + * @member {"policy"|undefined} _policy + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @instance + */ + Object.defineProperty(GlobalOrganizationSetPolicyRequest.prototype, "_policy", { + get: $util.oneOfGetter($oneOfFields = ["policy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GlobalOrganizationSetPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest} GlobalOrganizationSetPolicyRequest instance + */ + GlobalOrganizationSetPolicyRequest.create = function create(properties) { + return new GlobalOrganizationSetPolicyRequest(properties); + }; + + /** + * Encodes the specified GlobalOrganizationSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest} message GlobalOrganizationSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalOrganizationSetPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.compute.v1.Policy.encode(message.policy, writer.uint32(/* id 91071794, wireType 2 =*/728574354).fork()).ldelim(); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.cloud.compute.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 403251854, wireType 2 =*/3226014834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlobalOrganizationSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest} message GlobalOrganizationSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalOrganizationSetPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlobalOrganizationSetPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest} GlobalOrganizationSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalOrganizationSetPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 403251854: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.compute.v1.Binding.decode(reader, reader.uint32())); + break; + case 3123477: + message.etag = reader.string(); + break; + case 91071794: + message.policy = $root.google.cloud.compute.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlobalOrganizationSetPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest} GlobalOrganizationSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalOrganizationSetPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlobalOrganizationSetPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlobalOrganizationSetPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.cloud.compute.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + properties._policy = 1; + { + var error = $root.google.cloud.compute.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + } + return null; + }; + + /** + * Creates a GlobalOrganizationSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest} GlobalOrganizationSetPolicyRequest + */ + GlobalOrganizationSetPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest(); + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.bindings: object expected"); + message.bindings[i] = $root.google.cloud.compute.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.policy: object expected"); + message.policy = $root.google.cloud.compute.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a GlobalOrganizationSetPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest} message GlobalOrganizationSetPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlobalOrganizationSetPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.compute.v1.Policy.toObject(message.policy, options); + if (options.oneofs) + object._policy = "policy"; + } + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.cloud.compute.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; + + /** + * Converts this GlobalOrganizationSetPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GlobalOrganizationSetPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlobalOrganizationSetPolicyRequest; + })(); + + v1.GlobalSetLabelsRequest = (function() { + + /** + * Properties of a GlobalSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @interface IGlobalSetLabelsRequest + * @property {string|null} [labelFingerprint] GlobalSetLabelsRequest labelFingerprint + * @property {Object.|null} [labels] GlobalSetLabelsRequest labels + */ + + /** + * Constructs a new GlobalSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalSetLabelsRequest. + * @implements IGlobalSetLabelsRequest + * @constructor + * @param {google.cloud.compute.v1.IGlobalSetLabelsRequest=} [properties] Properties to set + */ + function GlobalSetLabelsRequest(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]]; + } + + /** + * GlobalSetLabelsRequest labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @instance + */ + GlobalSetLabelsRequest.prototype.labelFingerprint = null; + + /** + * GlobalSetLabelsRequest labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @instance + */ + GlobalSetLabelsRequest.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GlobalSetLabelsRequest _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @instance + */ + Object.defineProperty(GlobalSetLabelsRequest.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GlobalSetLabelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalSetLabelsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GlobalSetLabelsRequest} GlobalSetLabelsRequest instance + */ + GlobalSetLabelsRequest.create = function create(properties) { + return new GlobalSetLabelsRequest(properties); + }; + + /** + * Encodes the specified GlobalSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalSetLabelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalSetLabelsRequest} message GlobalSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalSetLabelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + 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 500195327, wireType 2 =*/4001562618).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 GlobalSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalSetLabelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IGlobalSetLabelsRequest} message GlobalSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalSetLabelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlobalSetLabelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GlobalSetLabelsRequest} GlobalSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalSetLabelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GlobalSetLabelsRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 GlobalSetLabelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GlobalSetLabelsRequest} GlobalSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalSetLabelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlobalSetLabelsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlobalSetLabelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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 GlobalSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GlobalSetLabelsRequest} GlobalSetLabelsRequest + */ + GlobalSetLabelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GlobalSetLabelsRequest) + return object; + var message = new $root.google.cloud.compute.v1.GlobalSetLabelsRequest(); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.GlobalSetLabelsRequest.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 GlobalSetLabelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.GlobalSetLabelsRequest} message GlobalSetLabelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlobalSetLabelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + 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 GlobalSetLabelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GlobalSetLabelsRequest + * @instance + * @returns {Object.} JSON object + */ + GlobalSetLabelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlobalSetLabelsRequest; + })(); + + v1.GlobalSetPolicyRequest = (function() { + + /** + * Properties of a GlobalSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGlobalSetPolicyRequest + * @property {Array.|null} [bindings] GlobalSetPolicyRequest bindings + * @property {string|null} [etag] GlobalSetPolicyRequest etag + * @property {google.cloud.compute.v1.IPolicy|null} [policy] GlobalSetPolicyRequest policy + */ + + /** + * Constructs a new GlobalSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalSetPolicyRequest. + * @implements IGlobalSetPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGlobalSetPolicyRequest=} [properties] Properties to set + */ + function GlobalSetPolicyRequest(properties) { + this.bindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GlobalSetPolicyRequest bindings. + * @member {Array.} bindings + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @instance + */ + GlobalSetPolicyRequest.prototype.bindings = $util.emptyArray; + + /** + * GlobalSetPolicyRequest etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @instance + */ + GlobalSetPolicyRequest.prototype.etag = null; + + /** + * GlobalSetPolicyRequest policy. + * @member {google.cloud.compute.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @instance + */ + GlobalSetPolicyRequest.prototype.policy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GlobalSetPolicyRequest _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @instance + */ + Object.defineProperty(GlobalSetPolicyRequest.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GlobalSetPolicyRequest _policy. + * @member {"policy"|undefined} _policy + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @instance + */ + Object.defineProperty(GlobalSetPolicyRequest.prototype, "_policy", { + get: $util.oneOfGetter($oneOfFields = ["policy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GlobalSetPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGlobalSetPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GlobalSetPolicyRequest} GlobalSetPolicyRequest instance + */ + GlobalSetPolicyRequest.create = function create(properties) { + return new GlobalSetPolicyRequest(properties); + }; + + /** + * Encodes the specified GlobalSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GlobalSetPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGlobalSetPolicyRequest} message GlobalSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalSetPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.compute.v1.Policy.encode(message.policy, writer.uint32(/* id 91071794, wireType 2 =*/728574354).fork()).ldelim(); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.cloud.compute.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 403251854, wireType 2 =*/3226014834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GlobalSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GlobalSetPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGlobalSetPolicyRequest} message GlobalSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GlobalSetPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GlobalSetPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GlobalSetPolicyRequest} GlobalSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalSetPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GlobalSetPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 403251854: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.compute.v1.Binding.decode(reader, reader.uint32())); + break; + case 3123477: + message.etag = reader.string(); + break; + case 91071794: + message.policy = $root.google.cloud.compute.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GlobalSetPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GlobalSetPolicyRequest} GlobalSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GlobalSetPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GlobalSetPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GlobalSetPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.cloud.compute.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + properties._policy = 1; + { + var error = $root.google.cloud.compute.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + } + return null; + }; + + /** + * Creates a GlobalSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GlobalSetPolicyRequest} GlobalSetPolicyRequest + */ + GlobalSetPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GlobalSetPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GlobalSetPolicyRequest(); + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.compute.v1.GlobalSetPolicyRequest.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.GlobalSetPolicyRequest.bindings: object expected"); + message.bindings[i] = $root.google.cloud.compute.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.compute.v1.GlobalSetPolicyRequest.policy: object expected"); + message.policy = $root.google.cloud.compute.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a GlobalSetPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.GlobalSetPolicyRequest} message GlobalSetPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GlobalSetPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.compute.v1.Policy.toObject(message.policy, options); + if (options.oneofs) + object._policy = "policy"; + } + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.cloud.compute.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; + + /** + * Converts this GlobalSetPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GlobalSetPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GlobalSetPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GlobalSetPolicyRequest; + })(); + + v1.GuestAttributesValue = (function() { + + /** + * Properties of a GuestAttributesValue. + * @memberof google.cloud.compute.v1 + * @interface IGuestAttributesValue + * @property {Array.|null} [items] GuestAttributesValue items + */ + + /** + * Constructs a new GuestAttributesValue. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GuestAttributesValue. + * @implements IGuestAttributesValue + * @constructor + * @param {google.cloud.compute.v1.IGuestAttributesValue=} [properties] Properties to set + */ + function GuestAttributesValue(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuestAttributesValue items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @instance + */ + GuestAttributesValue.prototype.items = $util.emptyArray; + + /** + * Creates a new GuestAttributesValue instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {google.cloud.compute.v1.IGuestAttributesValue=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GuestAttributesValue} GuestAttributesValue instance + */ + GuestAttributesValue.create = function create(properties) { + return new GuestAttributesValue(properties); + }; + + /** + * Encodes the specified GuestAttributesValue message. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {google.cloud.compute.v1.IGuestAttributesValue} message GuestAttributesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestAttributesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.GuestAttributesEntry.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GuestAttributesValue message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {google.cloud.compute.v1.IGuestAttributesValue} message GuestAttributesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestAttributesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestAttributesValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GuestAttributesValue} GuestAttributesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestAttributesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GuestAttributesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.GuestAttributesEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestAttributesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GuestAttributesValue} GuestAttributesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestAttributesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestAttributesValue message. + * @function verify + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestAttributesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.GuestAttributesEntry.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a GuestAttributesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GuestAttributesValue} GuestAttributesValue + */ + GuestAttributesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GuestAttributesValue) + return object; + var message = new $root.google.cloud.compute.v1.GuestAttributesValue(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.GuestAttributesValue.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.GuestAttributesValue.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.GuestAttributesEntry.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GuestAttributesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @static + * @param {google.cloud.compute.v1.GuestAttributesValue} message GuestAttributesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestAttributesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.GuestAttributesEntry.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this GuestAttributesValue to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GuestAttributesValue + * @instance + * @returns {Object.} JSON object + */ + GuestAttributesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GuestAttributesValue; + })(); + + v1.GuestAttributes = (function() { + + /** + * Properties of a GuestAttributes. + * @memberof google.cloud.compute.v1 + * @interface IGuestAttributes + * @property {string|null} [kind] GuestAttributes kind + * @property {string|null} [queryPath] GuestAttributes queryPath + * @property {google.cloud.compute.v1.IGuestAttributesValue|null} [queryValue] GuestAttributes queryValue + * @property {string|null} [selfLink] GuestAttributes selfLink + * @property {string|null} [variableKey] GuestAttributes variableKey + * @property {string|null} [variableValue] GuestAttributes variableValue + */ + + /** + * Constructs a new GuestAttributes. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GuestAttributes. + * @implements IGuestAttributes + * @constructor + * @param {google.cloud.compute.v1.IGuestAttributes=} [properties] Properties to set + */ + function GuestAttributes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuestAttributes kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + GuestAttributes.prototype.kind = null; + + /** + * GuestAttributes queryPath. + * @member {string|null|undefined} queryPath + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + GuestAttributes.prototype.queryPath = null; + + /** + * GuestAttributes queryValue. + * @member {google.cloud.compute.v1.IGuestAttributesValue|null|undefined} queryValue + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + GuestAttributes.prototype.queryValue = null; + + /** + * GuestAttributes selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + GuestAttributes.prototype.selfLink = null; + + /** + * GuestAttributes variableKey. + * @member {string|null|undefined} variableKey + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + GuestAttributes.prototype.variableKey = null; + + /** + * GuestAttributes variableValue. + * @member {string|null|undefined} variableValue + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + GuestAttributes.prototype.variableValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GuestAttributes _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + Object.defineProperty(GuestAttributes.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GuestAttributes _queryPath. + * @member {"queryPath"|undefined} _queryPath + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + Object.defineProperty(GuestAttributes.prototype, "_queryPath", { + get: $util.oneOfGetter($oneOfFields = ["queryPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GuestAttributes _queryValue. + * @member {"queryValue"|undefined} _queryValue + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + Object.defineProperty(GuestAttributes.prototype, "_queryValue", { + get: $util.oneOfGetter($oneOfFields = ["queryValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GuestAttributes _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + Object.defineProperty(GuestAttributes.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GuestAttributes _variableKey. + * @member {"variableKey"|undefined} _variableKey + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + Object.defineProperty(GuestAttributes.prototype, "_variableKey", { + get: $util.oneOfGetter($oneOfFields = ["variableKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GuestAttributes _variableValue. + * @member {"variableValue"|undefined} _variableValue + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + */ + Object.defineProperty(GuestAttributes.prototype, "_variableValue", { + get: $util.oneOfGetter($oneOfFields = ["variableValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GuestAttributes instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {google.cloud.compute.v1.IGuestAttributes=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GuestAttributes} GuestAttributes instance + */ + GuestAttributes.create = function create(properties) { + return new GuestAttributes(properties); + }; + + /** + * Encodes the specified GuestAttributes message. Does not implicitly {@link google.cloud.compute.v1.GuestAttributes.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {google.cloud.compute.v1.IGuestAttributes} message GuestAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestAttributes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.variableValue != null && Object.hasOwnProperty.call(message, "variableValue")) + writer.uint32(/* id 124582382, wireType 2 =*/996659058).string(message.variableValue); + if (message.queryValue != null && Object.hasOwnProperty.call(message, "queryValue")) + $root.google.cloud.compute.v1.GuestAttributesValue.encode(message.queryValue, writer.uint32(/* id 157570874, wireType 2 =*/1260566994).fork()).ldelim(); + if (message.variableKey != null && Object.hasOwnProperty.call(message, "variableKey")) + writer.uint32(/* id 164364828, wireType 2 =*/1314918626).string(message.variableKey); + if (message.queryPath != null && Object.hasOwnProperty.call(message, "queryPath")) + writer.uint32(/* id 368591164, wireType 2 =*/2948729314).string(message.queryPath); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified GuestAttributes message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestAttributes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {google.cloud.compute.v1.IGuestAttributes} message GuestAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestAttributes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestAttributes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GuestAttributes} GuestAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestAttributes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GuestAttributes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3292052: + message.kind = reader.string(); + break; + case 368591164: + message.queryPath = reader.string(); + break; + case 157570874: + message.queryValue = $root.google.cloud.compute.v1.GuestAttributesValue.decode(reader, reader.uint32()); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 164364828: + message.variableKey = reader.string(); + break; + case 124582382: + message.variableValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestAttributes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GuestAttributes} GuestAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestAttributes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestAttributes message. + * @function verify + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestAttributes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.queryPath != null && message.hasOwnProperty("queryPath")) { + properties._queryPath = 1; + if (!$util.isString(message.queryPath)) + return "queryPath: string expected"; + } + if (message.queryValue != null && message.hasOwnProperty("queryValue")) { + properties._queryValue = 1; + { + var error = $root.google.cloud.compute.v1.GuestAttributesValue.verify(message.queryValue); + if (error) + return "queryValue." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.variableKey != null && message.hasOwnProperty("variableKey")) { + properties._variableKey = 1; + if (!$util.isString(message.variableKey)) + return "variableKey: string expected"; + } + if (message.variableValue != null && message.hasOwnProperty("variableValue")) { + properties._variableValue = 1; + if (!$util.isString(message.variableValue)) + return "variableValue: string expected"; + } + return null; + }; + + /** + * Creates a GuestAttributes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GuestAttributes} GuestAttributes + */ + GuestAttributes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GuestAttributes) + return object; + var message = new $root.google.cloud.compute.v1.GuestAttributes(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.queryPath != null) + message.queryPath = String(object.queryPath); + if (object.queryValue != null) { + if (typeof object.queryValue !== "object") + throw TypeError(".google.cloud.compute.v1.GuestAttributes.queryValue: object expected"); + message.queryValue = $root.google.cloud.compute.v1.GuestAttributesValue.fromObject(object.queryValue); + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.variableKey != null) + message.variableKey = String(object.variableKey); + if (object.variableValue != null) + message.variableValue = String(object.variableValue); + return message; + }; + + /** + * Creates a plain object from a GuestAttributes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GuestAttributes + * @static + * @param {google.cloud.compute.v1.GuestAttributes} message GuestAttributes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestAttributes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.variableValue != null && message.hasOwnProperty("variableValue")) { + object.variableValue = message.variableValue; + if (options.oneofs) + object._variableValue = "variableValue"; + } + if (message.queryValue != null && message.hasOwnProperty("queryValue")) { + object.queryValue = $root.google.cloud.compute.v1.GuestAttributesValue.toObject(message.queryValue, options); + if (options.oneofs) + object._queryValue = "queryValue"; + } + if (message.variableKey != null && message.hasOwnProperty("variableKey")) { + object.variableKey = message.variableKey; + if (options.oneofs) + object._variableKey = "variableKey"; + } + if (message.queryPath != null && message.hasOwnProperty("queryPath")) { + object.queryPath = message.queryPath; + if (options.oneofs) + object._queryPath = "queryPath"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this GuestAttributes to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GuestAttributes + * @instance + * @returns {Object.} JSON object + */ + GuestAttributes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GuestAttributes; + })(); + + v1.GuestAttributesEntry = (function() { + + /** + * Properties of a GuestAttributesEntry. + * @memberof google.cloud.compute.v1 + * @interface IGuestAttributesEntry + * @property {string|null} [key] GuestAttributesEntry key + * @property {string|null} [namespace] GuestAttributesEntry namespace + * @property {string|null} [value] GuestAttributesEntry value + */ + + /** + * Constructs a new GuestAttributesEntry. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GuestAttributesEntry. + * @implements IGuestAttributesEntry + * @constructor + * @param {google.cloud.compute.v1.IGuestAttributesEntry=} [properties] Properties to set + */ + function GuestAttributesEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuestAttributesEntry key. + * @member {string|null|undefined} key + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @instance + */ + GuestAttributesEntry.prototype.key = null; + + /** + * GuestAttributesEntry namespace. + * @member {string|null|undefined} namespace + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @instance + */ + GuestAttributesEntry.prototype.namespace = null; + + /** + * GuestAttributesEntry value. + * @member {string|null|undefined} value + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @instance + */ + GuestAttributesEntry.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GuestAttributesEntry _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @instance + */ + Object.defineProperty(GuestAttributesEntry.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GuestAttributesEntry _namespace. + * @member {"namespace"|undefined} _namespace + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @instance + */ + Object.defineProperty(GuestAttributesEntry.prototype, "_namespace", { + get: $util.oneOfGetter($oneOfFields = ["namespace"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GuestAttributesEntry _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @instance + */ + Object.defineProperty(GuestAttributesEntry.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GuestAttributesEntry instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {google.cloud.compute.v1.IGuestAttributesEntry=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GuestAttributesEntry} GuestAttributesEntry instance + */ + GuestAttributesEntry.create = function create(properties) { + return new GuestAttributesEntry(properties); + }; + + /** + * Encodes the specified GuestAttributesEntry message. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {google.cloud.compute.v1.IGuestAttributesEntry} message GuestAttributesEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestAttributesEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 106079, wireType 2 =*/848634).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 111972721, wireType 2 =*/895781770).string(message.value); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 178476379, wireType 2 =*/1427811034).string(message.namespace); + return writer; + }; + + /** + * Encodes the specified GuestAttributesEntry message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GuestAttributesEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {google.cloud.compute.v1.IGuestAttributesEntry} message GuestAttributesEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestAttributesEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestAttributesEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GuestAttributesEntry} GuestAttributesEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestAttributesEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GuestAttributesEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 106079: + message.key = reader.string(); + break; + case 178476379: + message.namespace = reader.string(); + break; + case 111972721: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestAttributesEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GuestAttributesEntry} GuestAttributesEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestAttributesEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestAttributesEntry message. + * @function verify + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestAttributesEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) { + properties._namespace = 1; + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a GuestAttributesEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GuestAttributesEntry} GuestAttributesEntry + */ + GuestAttributesEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GuestAttributesEntry) + return object; + var message = new $root.google.cloud.compute.v1.GuestAttributesEntry(); + if (object.key != null) + message.key = String(object.key); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a GuestAttributesEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @static + * @param {google.cloud.compute.v1.GuestAttributesEntry} message GuestAttributesEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestAttributesEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) { + object.namespace = message.namespace; + if (options.oneofs) + object._namespace = "namespace"; + } + return object; + }; + + /** + * Converts this GuestAttributesEntry to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GuestAttributesEntry + * @instance + * @returns {Object.} JSON object + */ + GuestAttributesEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GuestAttributesEntry; + })(); + + v1.HTTP2HealthCheck = (function() { + + /** + * Properties of a HTTP2HealthCheck. + * @memberof google.cloud.compute.v1 + * @interface IHTTP2HealthCheck + * @property {string|null} [host] HTTP2HealthCheck host + * @property {number|null} [port] HTTP2HealthCheck port + * @property {string|null} [portName] HTTP2HealthCheck portName + * @property {google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification|null} [portSpecification] HTTP2HealthCheck portSpecification + * @property {google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader|null} [proxyHeader] HTTP2HealthCheck proxyHeader + * @property {string|null} [requestPath] HTTP2HealthCheck requestPath + * @property {string|null} [response] HTTP2HealthCheck response + */ + + /** + * Constructs a new HTTP2HealthCheck. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HTTP2HealthCheck. + * @implements IHTTP2HealthCheck + * @constructor + * @param {google.cloud.compute.v1.IHTTP2HealthCheck=} [properties] Properties to set + */ + function HTTP2HealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HTTP2HealthCheck host. + * @member {string|null|undefined} host + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + HTTP2HealthCheck.prototype.host = null; + + /** + * HTTP2HealthCheck port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + HTTP2HealthCheck.prototype.port = null; + + /** + * HTTP2HealthCheck portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + HTTP2HealthCheck.prototype.portName = null; + + /** + * HTTP2HealthCheck portSpecification. + * @member {google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification|null|undefined} portSpecification + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + HTTP2HealthCheck.prototype.portSpecification = null; + + /** + * HTTP2HealthCheck proxyHeader. + * @member {google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + HTTP2HealthCheck.prototype.proxyHeader = null; + + /** + * HTTP2HealthCheck requestPath. + * @member {string|null|undefined} requestPath + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + HTTP2HealthCheck.prototype.requestPath = null; + + /** + * HTTP2HealthCheck response. + * @member {string|null|undefined} response + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + HTTP2HealthCheck.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HTTP2HealthCheck _host. + * @member {"host"|undefined} _host + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + Object.defineProperty(HTTP2HealthCheck.prototype, "_host", { + get: $util.oneOfGetter($oneOfFields = ["host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTP2HealthCheck _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + Object.defineProperty(HTTP2HealthCheck.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTP2HealthCheck _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + Object.defineProperty(HTTP2HealthCheck.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTP2HealthCheck _portSpecification. + * @member {"portSpecification"|undefined} _portSpecification + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + Object.defineProperty(HTTP2HealthCheck.prototype, "_portSpecification", { + get: $util.oneOfGetter($oneOfFields = ["portSpecification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTP2HealthCheck _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + Object.defineProperty(HTTP2HealthCheck.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTP2HealthCheck _requestPath. + * @member {"requestPath"|undefined} _requestPath + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + Object.defineProperty(HTTP2HealthCheck.prototype, "_requestPath", { + get: $util.oneOfGetter($oneOfFields = ["requestPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTP2HealthCheck _response. + * @member {"response"|undefined} _response + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + */ + Object.defineProperty(HTTP2HealthCheck.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HTTP2HealthCheck instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTP2HealthCheck=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HTTP2HealthCheck} HTTP2HealthCheck instance + */ + HTTP2HealthCheck.create = function create(properties) { + return new HTTP2HealthCheck(properties); + }; + + /** + * Encodes the specified HTTP2HealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HTTP2HealthCheck.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTP2HealthCheck} message HTTP2HealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTP2HealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3208616, wireType 2 =*/25668930).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.portSpecification != null && Object.hasOwnProperty.call(message, "portSpecification")) + writer.uint32(/* id 51590597, wireType 0 =*/412724776).int32(message.portSpecification); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + writer.uint32(/* id 196547649, wireType 2 =*/1572381194).string(message.response); + if (message.requestPath != null && Object.hasOwnProperty.call(message, "requestPath")) + writer.uint32(/* id 229403605, wireType 2 =*/1835228842).string(message.requestPath); + return writer; + }; + + /** + * Encodes the specified HTTP2HealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HTTP2HealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTP2HealthCheck} message HTTP2HealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTP2HealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HTTP2HealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HTTP2HealthCheck} HTTP2HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTP2HealthCheck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HTTP2HealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3208616: + message.host = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + case 51590597: + message.portSpecification = reader.int32(); + break; + case 160374142: + message.proxyHeader = reader.int32(); + break; + case 229403605: + message.requestPath = reader.string(); + break; + case 196547649: + message.response = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HTTP2HealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HTTP2HealthCheck} HTTP2HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTP2HealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HTTP2HealthCheck message. + * @function verify + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HTTP2HealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.host != null && message.hasOwnProperty("host")) { + properties._host = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + properties._portSpecification = 1; + switch (message.portSpecification) { + default: + return "portSpecification: enum value expected"; + case 0: + case 190235748: + case 349300671: + case 362637516: + break; + } + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + if (message.requestPath != null && message.hasOwnProperty("requestPath")) { + properties._requestPath = 1; + if (!$util.isString(message.requestPath)) + return "requestPath: string expected"; + } + if (message.response != null && message.hasOwnProperty("response")) { + properties._response = 1; + if (!$util.isString(message.response)) + return "response: string expected"; + } + return null; + }; + + /** + * Creates a HTTP2HealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HTTP2HealthCheck} HTTP2HealthCheck + */ + HTTP2HealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HTTP2HealthCheck) + return object; + var message = new $root.google.cloud.compute.v1.HTTP2HealthCheck(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.portName != null) + message.portName = String(object.portName); + switch (object.portSpecification) { + case "UNDEFINED_PORT_SPECIFICATION": + case 0: + message.portSpecification = 0; + break; + case "USE_FIXED_PORT": + case 190235748: + message.portSpecification = 190235748; + break; + case "USE_NAMED_PORT": + case 349300671: + message.portSpecification = 349300671; + break; + case "USE_SERVING_PORT": + case 362637516: + message.portSpecification = 362637516; + break; + } + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + if (object.requestPath != null) + message.requestPath = String(object.requestPath); + if (object.response != null) + message.response = String(object.response); + return message; + }; + + /** + * Creates a plain object from a HTTP2HealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @static + * @param {google.cloud.compute.v1.HTTP2HealthCheck} message HTTP2HealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HTTP2HealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object._host = "host"; + } + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + object.portSpecification = options.enums === String ? $root.google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification[message.portSpecification] : message.portSpecification; + if (options.oneofs) + object._portSpecification = "portSpecification"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = message.response; + if (options.oneofs) + object._response = "response"; + } + if (message.requestPath != null && message.hasOwnProperty("requestPath")) { + object.requestPath = message.requestPath; + if (options.oneofs) + object._requestPath = "requestPath"; + } + return object; + }; + + /** + * Converts this HTTP2HealthCheck to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HTTP2HealthCheck + * @instance + * @returns {Object.} JSON object + */ + HTTP2HealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PortSpecification enum. + * @name google.cloud.compute.v1.HTTP2HealthCheck.PortSpecification + * @enum {number} + * @property {number} UNDEFINED_PORT_SPECIFICATION=0 UNDEFINED_PORT_SPECIFICATION value + * @property {number} USE_FIXED_PORT=190235748 USE_FIXED_PORT value + * @property {number} USE_NAMED_PORT=349300671 USE_NAMED_PORT value + * @property {number} USE_SERVING_PORT=362637516 USE_SERVING_PORT value + */ + HTTP2HealthCheck.PortSpecification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PORT_SPECIFICATION"] = 0; + values[valuesById[190235748] = "USE_FIXED_PORT"] = 190235748; + values[valuesById[349300671] = "USE_NAMED_PORT"] = 349300671; + values[valuesById[362637516] = "USE_SERVING_PORT"] = 362637516; + return values; + })(); + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.HTTP2HealthCheck.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + HTTP2HealthCheck.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return HTTP2HealthCheck; + })(); + + v1.HTTPHealthCheck = (function() { + + /** + * Properties of a HTTPHealthCheck. + * @memberof google.cloud.compute.v1 + * @interface IHTTPHealthCheck + * @property {string|null} [host] HTTPHealthCheck host + * @property {number|null} [port] HTTPHealthCheck port + * @property {string|null} [portName] HTTPHealthCheck portName + * @property {google.cloud.compute.v1.HTTPHealthCheck.PortSpecification|null} [portSpecification] HTTPHealthCheck portSpecification + * @property {google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader|null} [proxyHeader] HTTPHealthCheck proxyHeader + * @property {string|null} [requestPath] HTTPHealthCheck requestPath + * @property {string|null} [response] HTTPHealthCheck response + */ + + /** + * Constructs a new HTTPHealthCheck. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HTTPHealthCheck. + * @implements IHTTPHealthCheck + * @constructor + * @param {google.cloud.compute.v1.IHTTPHealthCheck=} [properties] Properties to set + */ + function HTTPHealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HTTPHealthCheck host. + * @member {string|null|undefined} host + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + HTTPHealthCheck.prototype.host = null; + + /** + * HTTPHealthCheck port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + HTTPHealthCheck.prototype.port = null; + + /** + * HTTPHealthCheck portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + HTTPHealthCheck.prototype.portName = null; + + /** + * HTTPHealthCheck portSpecification. + * @member {google.cloud.compute.v1.HTTPHealthCheck.PortSpecification|null|undefined} portSpecification + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + HTTPHealthCheck.prototype.portSpecification = null; + + /** + * HTTPHealthCheck proxyHeader. + * @member {google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + HTTPHealthCheck.prototype.proxyHeader = null; + + /** + * HTTPHealthCheck requestPath. + * @member {string|null|undefined} requestPath + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + HTTPHealthCheck.prototype.requestPath = null; + + /** + * HTTPHealthCheck response. + * @member {string|null|undefined} response + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + HTTPHealthCheck.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HTTPHealthCheck _host. + * @member {"host"|undefined} _host + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + Object.defineProperty(HTTPHealthCheck.prototype, "_host", { + get: $util.oneOfGetter($oneOfFields = ["host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPHealthCheck _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + Object.defineProperty(HTTPHealthCheck.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPHealthCheck _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + Object.defineProperty(HTTPHealthCheck.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPHealthCheck _portSpecification. + * @member {"portSpecification"|undefined} _portSpecification + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + Object.defineProperty(HTTPHealthCheck.prototype, "_portSpecification", { + get: $util.oneOfGetter($oneOfFields = ["portSpecification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPHealthCheck _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + Object.defineProperty(HTTPHealthCheck.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPHealthCheck _requestPath. + * @member {"requestPath"|undefined} _requestPath + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + Object.defineProperty(HTTPHealthCheck.prototype, "_requestPath", { + get: $util.oneOfGetter($oneOfFields = ["requestPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPHealthCheck _response. + * @member {"response"|undefined} _response + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + */ + Object.defineProperty(HTTPHealthCheck.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HTTPHealthCheck instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTPHealthCheck=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HTTPHealthCheck} HTTPHealthCheck instance + */ + HTTPHealthCheck.create = function create(properties) { + return new HTTPHealthCheck(properties); + }; + + /** + * Encodes the specified HTTPHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HTTPHealthCheck.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTPHealthCheck} message HTTPHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPHealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3208616, wireType 2 =*/25668930).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.portSpecification != null && Object.hasOwnProperty.call(message, "portSpecification")) + writer.uint32(/* id 51590597, wireType 0 =*/412724776).int32(message.portSpecification); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + writer.uint32(/* id 196547649, wireType 2 =*/1572381194).string(message.response); + if (message.requestPath != null && Object.hasOwnProperty.call(message, "requestPath")) + writer.uint32(/* id 229403605, wireType 2 =*/1835228842).string(message.requestPath); + return writer; + }; + + /** + * Encodes the specified HTTPHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HTTPHealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTPHealthCheck} message HTTPHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPHealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HTTPHealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HTTPHealthCheck} HTTPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPHealthCheck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HTTPHealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3208616: + message.host = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + case 51590597: + message.portSpecification = reader.int32(); + break; + case 160374142: + message.proxyHeader = reader.int32(); + break; + case 229403605: + message.requestPath = reader.string(); + break; + case 196547649: + message.response = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HTTPHealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HTTPHealthCheck} HTTPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPHealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HTTPHealthCheck message. + * @function verify + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HTTPHealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.host != null && message.hasOwnProperty("host")) { + properties._host = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + properties._portSpecification = 1; + switch (message.portSpecification) { + default: + return "portSpecification: enum value expected"; + case 0: + case 190235748: + case 349300671: + case 362637516: + break; + } + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + if (message.requestPath != null && message.hasOwnProperty("requestPath")) { + properties._requestPath = 1; + if (!$util.isString(message.requestPath)) + return "requestPath: string expected"; + } + if (message.response != null && message.hasOwnProperty("response")) { + properties._response = 1; + if (!$util.isString(message.response)) + return "response: string expected"; + } + return null; + }; + + /** + * Creates a HTTPHealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HTTPHealthCheck} HTTPHealthCheck + */ + HTTPHealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HTTPHealthCheck) + return object; + var message = new $root.google.cloud.compute.v1.HTTPHealthCheck(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.portName != null) + message.portName = String(object.portName); + switch (object.portSpecification) { + case "UNDEFINED_PORT_SPECIFICATION": + case 0: + message.portSpecification = 0; + break; + case "USE_FIXED_PORT": + case 190235748: + message.portSpecification = 190235748; + break; + case "USE_NAMED_PORT": + case 349300671: + message.portSpecification = 349300671; + break; + case "USE_SERVING_PORT": + case 362637516: + message.portSpecification = 362637516; + break; + } + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + if (object.requestPath != null) + message.requestPath = String(object.requestPath); + if (object.response != null) + message.response = String(object.response); + return message; + }; + + /** + * Creates a plain object from a HTTPHealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @static + * @param {google.cloud.compute.v1.HTTPHealthCheck} message HTTPHealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HTTPHealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object._host = "host"; + } + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + object.portSpecification = options.enums === String ? $root.google.cloud.compute.v1.HTTPHealthCheck.PortSpecification[message.portSpecification] : message.portSpecification; + if (options.oneofs) + object._portSpecification = "portSpecification"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = message.response; + if (options.oneofs) + object._response = "response"; + } + if (message.requestPath != null && message.hasOwnProperty("requestPath")) { + object.requestPath = message.requestPath; + if (options.oneofs) + object._requestPath = "requestPath"; + } + return object; + }; + + /** + * Converts this HTTPHealthCheck to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HTTPHealthCheck + * @instance + * @returns {Object.} JSON object + */ + HTTPHealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PortSpecification enum. + * @name google.cloud.compute.v1.HTTPHealthCheck.PortSpecification + * @enum {number} + * @property {number} UNDEFINED_PORT_SPECIFICATION=0 UNDEFINED_PORT_SPECIFICATION value + * @property {number} USE_FIXED_PORT=190235748 USE_FIXED_PORT value + * @property {number} USE_NAMED_PORT=349300671 USE_NAMED_PORT value + * @property {number} USE_SERVING_PORT=362637516 USE_SERVING_PORT value + */ + HTTPHealthCheck.PortSpecification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PORT_SPECIFICATION"] = 0; + values[valuesById[190235748] = "USE_FIXED_PORT"] = 190235748; + values[valuesById[349300671] = "USE_NAMED_PORT"] = 349300671; + values[valuesById[362637516] = "USE_SERVING_PORT"] = 362637516; + return values; + })(); + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.HTTPHealthCheck.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + HTTPHealthCheck.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return HTTPHealthCheck; + })(); + + v1.HTTPSHealthCheck = (function() { + + /** + * Properties of a HTTPSHealthCheck. + * @memberof google.cloud.compute.v1 + * @interface IHTTPSHealthCheck + * @property {string|null} [host] HTTPSHealthCheck host + * @property {number|null} [port] HTTPSHealthCheck port + * @property {string|null} [portName] HTTPSHealthCheck portName + * @property {google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification|null} [portSpecification] HTTPSHealthCheck portSpecification + * @property {google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader|null} [proxyHeader] HTTPSHealthCheck proxyHeader + * @property {string|null} [requestPath] HTTPSHealthCheck requestPath + * @property {string|null} [response] HTTPSHealthCheck response + */ + + /** + * Constructs a new HTTPSHealthCheck. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HTTPSHealthCheck. + * @implements IHTTPSHealthCheck + * @constructor + * @param {google.cloud.compute.v1.IHTTPSHealthCheck=} [properties] Properties to set + */ + function HTTPSHealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HTTPSHealthCheck host. + * @member {string|null|undefined} host + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + HTTPSHealthCheck.prototype.host = null; + + /** + * HTTPSHealthCheck port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + HTTPSHealthCheck.prototype.port = null; + + /** + * HTTPSHealthCheck portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + HTTPSHealthCheck.prototype.portName = null; + + /** + * HTTPSHealthCheck portSpecification. + * @member {google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification|null|undefined} portSpecification + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + HTTPSHealthCheck.prototype.portSpecification = null; + + /** + * HTTPSHealthCheck proxyHeader. + * @member {google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + HTTPSHealthCheck.prototype.proxyHeader = null; + + /** + * HTTPSHealthCheck requestPath. + * @member {string|null|undefined} requestPath + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + HTTPSHealthCheck.prototype.requestPath = null; + + /** + * HTTPSHealthCheck response. + * @member {string|null|undefined} response + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + HTTPSHealthCheck.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HTTPSHealthCheck _host. + * @member {"host"|undefined} _host + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + Object.defineProperty(HTTPSHealthCheck.prototype, "_host", { + get: $util.oneOfGetter($oneOfFields = ["host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPSHealthCheck _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + Object.defineProperty(HTTPSHealthCheck.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPSHealthCheck _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + Object.defineProperty(HTTPSHealthCheck.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPSHealthCheck _portSpecification. + * @member {"portSpecification"|undefined} _portSpecification + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + Object.defineProperty(HTTPSHealthCheck.prototype, "_portSpecification", { + get: $util.oneOfGetter($oneOfFields = ["portSpecification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPSHealthCheck _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + Object.defineProperty(HTTPSHealthCheck.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPSHealthCheck _requestPath. + * @member {"requestPath"|undefined} _requestPath + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + Object.defineProperty(HTTPSHealthCheck.prototype, "_requestPath", { + get: $util.oneOfGetter($oneOfFields = ["requestPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HTTPSHealthCheck _response. + * @member {"response"|undefined} _response + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + */ + Object.defineProperty(HTTPSHealthCheck.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HTTPSHealthCheck instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTPSHealthCheck=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HTTPSHealthCheck} HTTPSHealthCheck instance + */ + HTTPSHealthCheck.create = function create(properties) { + return new HTTPSHealthCheck(properties); + }; + + /** + * Encodes the specified HTTPSHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HTTPSHealthCheck.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTPSHealthCheck} message HTTPSHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPSHealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3208616, wireType 2 =*/25668930).string(message.host); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.portSpecification != null && Object.hasOwnProperty.call(message, "portSpecification")) + writer.uint32(/* id 51590597, wireType 0 =*/412724776).int32(message.portSpecification); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + writer.uint32(/* id 196547649, wireType 2 =*/1572381194).string(message.response); + if (message.requestPath != null && Object.hasOwnProperty.call(message, "requestPath")) + writer.uint32(/* id 229403605, wireType 2 =*/1835228842).string(message.requestPath); + return writer; + }; + + /** + * Encodes the specified HTTPSHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HTTPSHealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {google.cloud.compute.v1.IHTTPSHealthCheck} message HTTPSHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HTTPSHealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HTTPSHealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HTTPSHealthCheck} HTTPSHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPSHealthCheck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HTTPSHealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3208616: + message.host = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + case 51590597: + message.portSpecification = reader.int32(); + break; + case 160374142: + message.proxyHeader = reader.int32(); + break; + case 229403605: + message.requestPath = reader.string(); + break; + case 196547649: + message.response = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HTTPSHealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HTTPSHealthCheck} HTTPSHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HTTPSHealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HTTPSHealthCheck message. + * @function verify + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HTTPSHealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.host != null && message.hasOwnProperty("host")) { + properties._host = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + properties._portSpecification = 1; + switch (message.portSpecification) { + default: + return "portSpecification: enum value expected"; + case 0: + case 190235748: + case 349300671: + case 362637516: + break; + } + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + if (message.requestPath != null && message.hasOwnProperty("requestPath")) { + properties._requestPath = 1; + if (!$util.isString(message.requestPath)) + return "requestPath: string expected"; + } + if (message.response != null && message.hasOwnProperty("response")) { + properties._response = 1; + if (!$util.isString(message.response)) + return "response: string expected"; + } + return null; + }; + + /** + * Creates a HTTPSHealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HTTPSHealthCheck} HTTPSHealthCheck + */ + HTTPSHealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HTTPSHealthCheck) + return object; + var message = new $root.google.cloud.compute.v1.HTTPSHealthCheck(); + if (object.host != null) + message.host = String(object.host); + if (object.port != null) + message.port = object.port | 0; + if (object.portName != null) + message.portName = String(object.portName); + switch (object.portSpecification) { + case "UNDEFINED_PORT_SPECIFICATION": + case 0: + message.portSpecification = 0; + break; + case "USE_FIXED_PORT": + case 190235748: + message.portSpecification = 190235748; + break; + case "USE_NAMED_PORT": + case 349300671: + message.portSpecification = 349300671; + break; + case "USE_SERVING_PORT": + case 362637516: + message.portSpecification = 362637516; + break; + } + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + if (object.requestPath != null) + message.requestPath = String(object.requestPath); + if (object.response != null) + message.response = String(object.response); + return message; + }; + + /** + * Creates a plain object from a HTTPSHealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @static + * @param {google.cloud.compute.v1.HTTPSHealthCheck} message HTTPSHealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HTTPSHealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object._host = "host"; + } + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + object.portSpecification = options.enums === String ? $root.google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification[message.portSpecification] : message.portSpecification; + if (options.oneofs) + object._portSpecification = "portSpecification"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = message.response; + if (options.oneofs) + object._response = "response"; + } + if (message.requestPath != null && message.hasOwnProperty("requestPath")) { + object.requestPath = message.requestPath; + if (options.oneofs) + object._requestPath = "requestPath"; + } + return object; + }; + + /** + * Converts this HTTPSHealthCheck to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HTTPSHealthCheck + * @instance + * @returns {Object.} JSON object + */ + HTTPSHealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PortSpecification enum. + * @name google.cloud.compute.v1.HTTPSHealthCheck.PortSpecification + * @enum {number} + * @property {number} UNDEFINED_PORT_SPECIFICATION=0 UNDEFINED_PORT_SPECIFICATION value + * @property {number} USE_FIXED_PORT=190235748 USE_FIXED_PORT value + * @property {number} USE_NAMED_PORT=349300671 USE_NAMED_PORT value + * @property {number} USE_SERVING_PORT=362637516 USE_SERVING_PORT value + */ + HTTPSHealthCheck.PortSpecification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PORT_SPECIFICATION"] = 0; + values[valuesById[190235748] = "USE_FIXED_PORT"] = 190235748; + values[valuesById[349300671] = "USE_NAMED_PORT"] = 349300671; + values[valuesById[362637516] = "USE_SERVING_PORT"] = 362637516; + return values; + })(); + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.HTTPSHealthCheck.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + HTTPSHealthCheck.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return HTTPSHealthCheck; + })(); + + v1.HealthCheckLogConfig = (function() { + + /** + * Properties of a HealthCheckLogConfig. + * @memberof google.cloud.compute.v1 + * @interface IHealthCheckLogConfig + * @property {boolean|null} [enable] HealthCheckLogConfig enable + */ + + /** + * Constructs a new HealthCheckLogConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthCheckLogConfig. + * @implements IHealthCheckLogConfig + * @constructor + * @param {google.cloud.compute.v1.IHealthCheckLogConfig=} [properties] Properties to set + */ + function HealthCheckLogConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheckLogConfig enable. + * @member {boolean|null|undefined} enable + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @instance + */ + HealthCheckLogConfig.prototype.enable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthCheckLogConfig _enable. + * @member {"enable"|undefined} _enable + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @instance + */ + Object.defineProperty(HealthCheckLogConfig.prototype, "_enable", { + get: $util.oneOfGetter($oneOfFields = ["enable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthCheckLogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {google.cloud.compute.v1.IHealthCheckLogConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthCheckLogConfig} HealthCheckLogConfig instance + */ + HealthCheckLogConfig.create = function create(properties) { + return new HealthCheckLogConfig(properties); + }; + + /** + * Encodes the specified HealthCheckLogConfig message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckLogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {google.cloud.compute.v1.IHealthCheckLogConfig} message HealthCheckLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enable != null && Object.hasOwnProperty.call(message, "enable")) + writer.uint32(/* id 311764355, wireType 0 =*/2494114840).bool(message.enable); + return writer; + }; + + /** + * Encodes the specified HealthCheckLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {google.cloud.compute.v1.IHealthCheckLogConfig} message HealthCheckLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheckLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthCheckLogConfig} HealthCheckLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthCheckLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 311764355: + message.enable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheckLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthCheckLogConfig} HealthCheckLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheckLogConfig message. + * @function verify + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheckLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enable != null && message.hasOwnProperty("enable")) { + properties._enable = 1; + if (typeof message.enable !== "boolean") + return "enable: boolean expected"; + } + return null; + }; + + /** + * Creates a HealthCheckLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthCheckLogConfig} HealthCheckLogConfig + */ + HealthCheckLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthCheckLogConfig) + return object; + var message = new $root.google.cloud.compute.v1.HealthCheckLogConfig(); + if (object.enable != null) + message.enable = Boolean(object.enable); + return message; + }; + + /** + * Creates a plain object from a HealthCheckLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @static + * @param {google.cloud.compute.v1.HealthCheckLogConfig} message HealthCheckLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheckLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enable != null && message.hasOwnProperty("enable")) { + object.enable = message.enable; + if (options.oneofs) + object._enable = "enable"; + } + return object; + }; + + /** + * Converts this HealthCheckLogConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthCheckLogConfig + * @instance + * @returns {Object.} JSON object + */ + HealthCheckLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HealthCheckLogConfig; + })(); + + v1.SSLHealthCheck = (function() { + + /** + * Properties of a SSLHealthCheck. + * @memberof google.cloud.compute.v1 + * @interface ISSLHealthCheck + * @property {number|null} [port] SSLHealthCheck port + * @property {string|null} [portName] SSLHealthCheck portName + * @property {google.cloud.compute.v1.SSLHealthCheck.PortSpecification|null} [portSpecification] SSLHealthCheck portSpecification + * @property {google.cloud.compute.v1.SSLHealthCheck.ProxyHeader|null} [proxyHeader] SSLHealthCheck proxyHeader + * @property {string|null} [request] SSLHealthCheck request + * @property {string|null} [response] SSLHealthCheck response + */ + + /** + * Constructs a new SSLHealthCheck. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SSLHealthCheck. + * @implements ISSLHealthCheck + * @constructor + * @param {google.cloud.compute.v1.ISSLHealthCheck=} [properties] Properties to set + */ + function SSLHealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SSLHealthCheck port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + SSLHealthCheck.prototype.port = null; + + /** + * SSLHealthCheck portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + SSLHealthCheck.prototype.portName = null; + + /** + * SSLHealthCheck portSpecification. + * @member {google.cloud.compute.v1.SSLHealthCheck.PortSpecification|null|undefined} portSpecification + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + SSLHealthCheck.prototype.portSpecification = null; + + /** + * SSLHealthCheck proxyHeader. + * @member {google.cloud.compute.v1.SSLHealthCheck.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + SSLHealthCheck.prototype.proxyHeader = null; + + /** + * SSLHealthCheck request. + * @member {string|null|undefined} request + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + SSLHealthCheck.prototype.request = null; + + /** + * SSLHealthCheck response. + * @member {string|null|undefined} response + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + SSLHealthCheck.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SSLHealthCheck _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + Object.defineProperty(SSLHealthCheck.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SSLHealthCheck _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + Object.defineProperty(SSLHealthCheck.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SSLHealthCheck _portSpecification. + * @member {"portSpecification"|undefined} _portSpecification + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + Object.defineProperty(SSLHealthCheck.prototype, "_portSpecification", { + get: $util.oneOfGetter($oneOfFields = ["portSpecification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SSLHealthCheck _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + Object.defineProperty(SSLHealthCheck.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SSLHealthCheck _request. + * @member {"request"|undefined} _request + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + Object.defineProperty(SSLHealthCheck.prototype, "_request", { + get: $util.oneOfGetter($oneOfFields = ["request"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SSLHealthCheck _response. + * @member {"response"|undefined} _response + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + */ + Object.defineProperty(SSLHealthCheck.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SSLHealthCheck instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {google.cloud.compute.v1.ISSLHealthCheck=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SSLHealthCheck} SSLHealthCheck instance + */ + SSLHealthCheck.create = function create(properties) { + return new SSLHealthCheck(properties); + }; + + /** + * Encodes the specified SSLHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.SSLHealthCheck.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {google.cloud.compute.v1.ISSLHealthCheck} message SSLHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SSLHealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + writer.uint32(/* id 21951119, wireType 2 =*/175608954).string(message.request); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.portSpecification != null && Object.hasOwnProperty.call(message, "portSpecification")) + writer.uint32(/* id 51590597, wireType 0 =*/412724776).int32(message.portSpecification); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + writer.uint32(/* id 196547649, wireType 2 =*/1572381194).string(message.response); + return writer; + }; + + /** + * Encodes the specified SSLHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SSLHealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {google.cloud.compute.v1.ISSLHealthCheck} message SSLHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SSLHealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SSLHealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SSLHealthCheck} SSLHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SSLHealthCheck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SSLHealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3446913: + message.port = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + case 51590597: + message.portSpecification = reader.int32(); + break; + case 160374142: + message.proxyHeader = reader.int32(); + break; + case 21951119: + message.request = reader.string(); + break; + case 196547649: + message.response = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SSLHealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SSLHealthCheck} SSLHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SSLHealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SSLHealthCheck message. + * @function verify + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SSLHealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + properties._portSpecification = 1; + switch (message.portSpecification) { + default: + return "portSpecification: enum value expected"; + case 0: + case 190235748: + case 349300671: + case 362637516: + break; + } + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + if (message.request != null && message.hasOwnProperty("request")) { + properties._request = 1; + if (!$util.isString(message.request)) + return "request: string expected"; + } + if (message.response != null && message.hasOwnProperty("response")) { + properties._response = 1; + if (!$util.isString(message.response)) + return "response: string expected"; + } + return null; + }; + + /** + * Creates a SSLHealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SSLHealthCheck} SSLHealthCheck + */ + SSLHealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SSLHealthCheck) + return object; + var message = new $root.google.cloud.compute.v1.SSLHealthCheck(); + if (object.port != null) + message.port = object.port | 0; + if (object.portName != null) + message.portName = String(object.portName); + switch (object.portSpecification) { + case "UNDEFINED_PORT_SPECIFICATION": + case 0: + message.portSpecification = 0; + break; + case "USE_FIXED_PORT": + case 190235748: + message.portSpecification = 190235748; + break; + case "USE_NAMED_PORT": + case 349300671: + message.portSpecification = 349300671; + break; + case "USE_SERVING_PORT": + case 362637516: + message.portSpecification = 362637516; + break; + } + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + if (object.request != null) + message.request = String(object.request); + if (object.response != null) + message.response = String(object.response); + return message; + }; + + /** + * Creates a plain object from a SSLHealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @static + * @param {google.cloud.compute.v1.SSLHealthCheck} message SSLHealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SSLHealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.request != null && message.hasOwnProperty("request")) { + object.request = message.request; + if (options.oneofs) + object._request = "request"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + object.portSpecification = options.enums === String ? $root.google.cloud.compute.v1.SSLHealthCheck.PortSpecification[message.portSpecification] : message.portSpecification; + if (options.oneofs) + object._portSpecification = "portSpecification"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.SSLHealthCheck.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = message.response; + if (options.oneofs) + object._response = "response"; + } + return object; + }; + + /** + * Converts this SSLHealthCheck to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SSLHealthCheck + * @instance + * @returns {Object.} JSON object + */ + SSLHealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PortSpecification enum. + * @name google.cloud.compute.v1.SSLHealthCheck.PortSpecification + * @enum {number} + * @property {number} UNDEFINED_PORT_SPECIFICATION=0 UNDEFINED_PORT_SPECIFICATION value + * @property {number} USE_FIXED_PORT=190235748 USE_FIXED_PORT value + * @property {number} USE_NAMED_PORT=349300671 USE_NAMED_PORT value + * @property {number} USE_SERVING_PORT=362637516 USE_SERVING_PORT value + */ + SSLHealthCheck.PortSpecification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PORT_SPECIFICATION"] = 0; + values[valuesById[190235748] = "USE_FIXED_PORT"] = 190235748; + values[valuesById[349300671] = "USE_NAMED_PORT"] = 349300671; + values[valuesById[362637516] = "USE_SERVING_PORT"] = 362637516; + return values; + })(); + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.SSLHealthCheck.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + SSLHealthCheck.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return SSLHealthCheck; + })(); + + v1.TCPHealthCheck = (function() { + + /** + * Properties of a TCPHealthCheck. + * @memberof google.cloud.compute.v1 + * @interface ITCPHealthCheck + * @property {number|null} [port] TCPHealthCheck port + * @property {string|null} [portName] TCPHealthCheck portName + * @property {google.cloud.compute.v1.TCPHealthCheck.PortSpecification|null} [portSpecification] TCPHealthCheck portSpecification + * @property {google.cloud.compute.v1.TCPHealthCheck.ProxyHeader|null} [proxyHeader] TCPHealthCheck proxyHeader + * @property {string|null} [request] TCPHealthCheck request + * @property {string|null} [response] TCPHealthCheck response + */ + + /** + * Constructs a new TCPHealthCheck. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TCPHealthCheck. + * @implements ITCPHealthCheck + * @constructor + * @param {google.cloud.compute.v1.ITCPHealthCheck=} [properties] Properties to set + */ + function TCPHealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TCPHealthCheck port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + TCPHealthCheck.prototype.port = null; + + /** + * TCPHealthCheck portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + TCPHealthCheck.prototype.portName = null; + + /** + * TCPHealthCheck portSpecification. + * @member {google.cloud.compute.v1.TCPHealthCheck.PortSpecification|null|undefined} portSpecification + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + TCPHealthCheck.prototype.portSpecification = null; + + /** + * TCPHealthCheck proxyHeader. + * @member {google.cloud.compute.v1.TCPHealthCheck.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + TCPHealthCheck.prototype.proxyHeader = null; + + /** + * TCPHealthCheck request. + * @member {string|null|undefined} request + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + TCPHealthCheck.prototype.request = null; + + /** + * TCPHealthCheck response. + * @member {string|null|undefined} response + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + TCPHealthCheck.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TCPHealthCheck _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + Object.defineProperty(TCPHealthCheck.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TCPHealthCheck _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + Object.defineProperty(TCPHealthCheck.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TCPHealthCheck _portSpecification. + * @member {"portSpecification"|undefined} _portSpecification + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + Object.defineProperty(TCPHealthCheck.prototype, "_portSpecification", { + get: $util.oneOfGetter($oneOfFields = ["portSpecification"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TCPHealthCheck _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + Object.defineProperty(TCPHealthCheck.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TCPHealthCheck _request. + * @member {"request"|undefined} _request + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + Object.defineProperty(TCPHealthCheck.prototype, "_request", { + get: $util.oneOfGetter($oneOfFields = ["request"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TCPHealthCheck _response. + * @member {"response"|undefined} _response + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + */ + Object.defineProperty(TCPHealthCheck.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TCPHealthCheck instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {google.cloud.compute.v1.ITCPHealthCheck=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TCPHealthCheck} TCPHealthCheck instance + */ + TCPHealthCheck.create = function create(properties) { + return new TCPHealthCheck(properties); + }; + + /** + * Encodes the specified TCPHealthCheck message. Does not implicitly {@link google.cloud.compute.v1.TCPHealthCheck.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {google.cloud.compute.v1.ITCPHealthCheck} message TCPHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TCPHealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.request != null && Object.hasOwnProperty.call(message, "request")) + writer.uint32(/* id 21951119, wireType 2 =*/175608954).string(message.request); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.portSpecification != null && Object.hasOwnProperty.call(message, "portSpecification")) + writer.uint32(/* id 51590597, wireType 0 =*/412724776).int32(message.portSpecification); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + writer.uint32(/* id 196547649, wireType 2 =*/1572381194).string(message.response); + return writer; + }; + + /** + * Encodes the specified TCPHealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TCPHealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {google.cloud.compute.v1.ITCPHealthCheck} message TCPHealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TCPHealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TCPHealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TCPHealthCheck} TCPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TCPHealthCheck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TCPHealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3446913: + message.port = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + case 51590597: + message.portSpecification = reader.int32(); + break; + case 160374142: + message.proxyHeader = reader.int32(); + break; + case 21951119: + message.request = reader.string(); + break; + case 196547649: + message.response = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TCPHealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TCPHealthCheck} TCPHealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TCPHealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TCPHealthCheck message. + * @function verify + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TCPHealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + properties._portSpecification = 1; + switch (message.portSpecification) { + default: + return "portSpecification: enum value expected"; + case 0: + case 190235748: + case 349300671: + case 362637516: + break; + } + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + if (message.request != null && message.hasOwnProperty("request")) { + properties._request = 1; + if (!$util.isString(message.request)) + return "request: string expected"; + } + if (message.response != null && message.hasOwnProperty("response")) { + properties._response = 1; + if (!$util.isString(message.response)) + return "response: string expected"; + } + return null; + }; + + /** + * Creates a TCPHealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TCPHealthCheck} TCPHealthCheck + */ + TCPHealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TCPHealthCheck) + return object; + var message = new $root.google.cloud.compute.v1.TCPHealthCheck(); + if (object.port != null) + message.port = object.port | 0; + if (object.portName != null) + message.portName = String(object.portName); + switch (object.portSpecification) { + case "UNDEFINED_PORT_SPECIFICATION": + case 0: + message.portSpecification = 0; + break; + case "USE_FIXED_PORT": + case 190235748: + message.portSpecification = 190235748; + break; + case "USE_NAMED_PORT": + case 349300671: + message.portSpecification = 349300671; + break; + case "USE_SERVING_PORT": + case 362637516: + message.portSpecification = 362637516; + break; + } + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + if (object.request != null) + message.request = String(object.request); + if (object.response != null) + message.response = String(object.response); + return message; + }; + + /** + * Creates a plain object from a TCPHealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @static + * @param {google.cloud.compute.v1.TCPHealthCheck} message TCPHealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TCPHealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.request != null && message.hasOwnProperty("request")) { + object.request = message.request; + if (options.oneofs) + object._request = "request"; + } + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.portSpecification != null && message.hasOwnProperty("portSpecification")) { + object.portSpecification = options.enums === String ? $root.google.cloud.compute.v1.TCPHealthCheck.PortSpecification[message.portSpecification] : message.portSpecification; + if (options.oneofs) + object._portSpecification = "portSpecification"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.TCPHealthCheck.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = message.response; + if (options.oneofs) + object._response = "response"; + } + return object; + }; + + /** + * Converts this TCPHealthCheck to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TCPHealthCheck + * @instance + * @returns {Object.} JSON object + */ + TCPHealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PortSpecification enum. + * @name google.cloud.compute.v1.TCPHealthCheck.PortSpecification + * @enum {number} + * @property {number} UNDEFINED_PORT_SPECIFICATION=0 UNDEFINED_PORT_SPECIFICATION value + * @property {number} USE_FIXED_PORT=190235748 USE_FIXED_PORT value + * @property {number} USE_NAMED_PORT=349300671 USE_NAMED_PORT value + * @property {number} USE_SERVING_PORT=362637516 USE_SERVING_PORT value + */ + TCPHealthCheck.PortSpecification = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PORT_SPECIFICATION"] = 0; + values[valuesById[190235748] = "USE_FIXED_PORT"] = 190235748; + values[valuesById[349300671] = "USE_NAMED_PORT"] = 349300671; + values[valuesById[362637516] = "USE_SERVING_PORT"] = 362637516; + return values; + })(); + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.TCPHealthCheck.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + TCPHealthCheck.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return TCPHealthCheck; + })(); + + v1.HealthCheck = (function() { + + /** + * Properties of a HealthCheck. + * @memberof google.cloud.compute.v1 + * @interface IHealthCheck + * @property {number|null} [checkIntervalSec] HealthCheck checkIntervalSec + * @property {string|null} [creationTimestamp] HealthCheck creationTimestamp + * @property {string|null} [description] HealthCheck description + * @property {google.cloud.compute.v1.IGRPCHealthCheck|null} [grpcHealthCheck] HealthCheck grpcHealthCheck + * @property {number|null} [healthyThreshold] HealthCheck healthyThreshold + * @property {google.cloud.compute.v1.IHTTP2HealthCheck|null} [http2HealthCheck] HealthCheck http2HealthCheck + * @property {google.cloud.compute.v1.IHTTPHealthCheck|null} [httpHealthCheck] HealthCheck httpHealthCheck + * @property {google.cloud.compute.v1.IHTTPSHealthCheck|null} [httpsHealthCheck] HealthCheck httpsHealthCheck + * @property {number|Long|null} [id] HealthCheck id + * @property {string|null} [kind] HealthCheck kind + * @property {google.cloud.compute.v1.IHealthCheckLogConfig|null} [logConfig] HealthCheck logConfig + * @property {string|null} [name] HealthCheck name + * @property {string|null} [region] HealthCheck region + * @property {string|null} [selfLink] HealthCheck selfLink + * @property {google.cloud.compute.v1.ISSLHealthCheck|null} [sslHealthCheck] HealthCheck sslHealthCheck + * @property {google.cloud.compute.v1.ITCPHealthCheck|null} [tcpHealthCheck] HealthCheck tcpHealthCheck + * @property {number|null} [timeoutSec] HealthCheck timeoutSec + * @property {google.cloud.compute.v1.HealthCheck.Type|null} [type] HealthCheck type + * @property {number|null} [unhealthyThreshold] HealthCheck unhealthyThreshold + */ + + /** + * Constructs a new HealthCheck. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthCheck. + * @implements IHealthCheck + * @constructor + * @param {google.cloud.compute.v1.IHealthCheck=} [properties] Properties to set + */ + function HealthCheck(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheck checkIntervalSec. + * @member {number|null|undefined} checkIntervalSec + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.checkIntervalSec = null; + + /** + * HealthCheck creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.creationTimestamp = null; + + /** + * HealthCheck description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.description = null; + + /** + * HealthCheck grpcHealthCheck. + * @member {google.cloud.compute.v1.IGRPCHealthCheck|null|undefined} grpcHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.grpcHealthCheck = null; + + /** + * HealthCheck healthyThreshold. + * @member {number|null|undefined} healthyThreshold + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.healthyThreshold = null; + + /** + * HealthCheck http2HealthCheck. + * @member {google.cloud.compute.v1.IHTTP2HealthCheck|null|undefined} http2HealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.http2HealthCheck = null; + + /** + * HealthCheck httpHealthCheck. + * @member {google.cloud.compute.v1.IHTTPHealthCheck|null|undefined} httpHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.httpHealthCheck = null; + + /** + * HealthCheck httpsHealthCheck. + * @member {google.cloud.compute.v1.IHTTPSHealthCheck|null|undefined} httpsHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.httpsHealthCheck = null; + + /** + * HealthCheck id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.id = null; + + /** + * HealthCheck kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.kind = null; + + /** + * HealthCheck logConfig. + * @member {google.cloud.compute.v1.IHealthCheckLogConfig|null|undefined} logConfig + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.logConfig = null; + + /** + * HealthCheck name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.name = null; + + /** + * HealthCheck region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.region = null; + + /** + * HealthCheck selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.selfLink = null; + + /** + * HealthCheck sslHealthCheck. + * @member {google.cloud.compute.v1.ISSLHealthCheck|null|undefined} sslHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.sslHealthCheck = null; + + /** + * HealthCheck tcpHealthCheck. + * @member {google.cloud.compute.v1.ITCPHealthCheck|null|undefined} tcpHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.tcpHealthCheck = null; + + /** + * HealthCheck timeoutSec. + * @member {number|null|undefined} timeoutSec + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.timeoutSec = null; + + /** + * HealthCheck type. + * @member {google.cloud.compute.v1.HealthCheck.Type|null|undefined} type + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.type = null; + + /** + * HealthCheck unhealthyThreshold. + * @member {number|null|undefined} unhealthyThreshold + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + HealthCheck.prototype.unhealthyThreshold = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthCheck _checkIntervalSec. + * @member {"checkIntervalSec"|undefined} _checkIntervalSec + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_checkIntervalSec", { + get: $util.oneOfGetter($oneOfFields = ["checkIntervalSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _grpcHealthCheck. + * @member {"grpcHealthCheck"|undefined} _grpcHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_grpcHealthCheck", { + get: $util.oneOfGetter($oneOfFields = ["grpcHealthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _healthyThreshold. + * @member {"healthyThreshold"|undefined} _healthyThreshold + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_healthyThreshold", { + get: $util.oneOfGetter($oneOfFields = ["healthyThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _http2HealthCheck. + * @member {"http2HealthCheck"|undefined} _http2HealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_http2HealthCheck", { + get: $util.oneOfGetter($oneOfFields = ["http2HealthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _httpHealthCheck. + * @member {"httpHealthCheck"|undefined} _httpHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_httpHealthCheck", { + get: $util.oneOfGetter($oneOfFields = ["httpHealthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _httpsHealthCheck. + * @member {"httpsHealthCheck"|undefined} _httpsHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_httpsHealthCheck", { + get: $util.oneOfGetter($oneOfFields = ["httpsHealthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _logConfig. + * @member {"logConfig"|undefined} _logConfig + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_logConfig", { + get: $util.oneOfGetter($oneOfFields = ["logConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _sslHealthCheck. + * @member {"sslHealthCheck"|undefined} _sslHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_sslHealthCheck", { + get: $util.oneOfGetter($oneOfFields = ["sslHealthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _tcpHealthCheck. + * @member {"tcpHealthCheck"|undefined} _tcpHealthCheck + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_tcpHealthCheck", { + get: $util.oneOfGetter($oneOfFields = ["tcpHealthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _timeoutSec. + * @member {"timeoutSec"|undefined} _timeoutSec + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_timeoutSec", { + get: $util.oneOfGetter($oneOfFields = ["timeoutSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheck _unhealthyThreshold. + * @member {"unhealthyThreshold"|undefined} _unhealthyThreshold + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + */ + Object.defineProperty(HealthCheck.prototype, "_unhealthyThreshold", { + get: $util.oneOfGetter($oneOfFields = ["unhealthyThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthCheck instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {google.cloud.compute.v1.IHealthCheck=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthCheck} HealthCheck instance + */ + HealthCheck.create = function create(properties) { + return new HealthCheck(properties); + }; + + /** + * Encodes the specified HealthCheck message. Does not implicitly {@link google.cloud.compute.v1.HealthCheck.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {google.cloud.compute.v1.IHealthCheck} message HealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheck.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.http2HealthCheck != null && Object.hasOwnProperty.call(message, "http2HealthCheck")) + $root.google.cloud.compute.v1.HTTP2HealthCheck.encode(message.http2HealthCheck, writer.uint32(/* id 11360986, wireType 2 =*/90887890).fork()).ldelim(); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.timeoutSec != null && Object.hasOwnProperty.call(message, "timeoutSec")) + writer.uint32(/* id 79994995, wireType 0 =*/639959960).int32(message.timeoutSec); + if (message.grpcHealthCheck != null && Object.hasOwnProperty.call(message, "grpcHealthCheck")) + $root.google.cloud.compute.v1.GRPCHealthCheck.encode(message.grpcHealthCheck, writer.uint32(/* id 85529574, wireType 2 =*/684236594).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.unhealthyThreshold != null && Object.hasOwnProperty.call(message, "unhealthyThreshold")) + writer.uint32(/* id 227958480, wireType 0 =*/1823667840).int32(message.unhealthyThreshold); + if (message.sslHealthCheck != null && Object.hasOwnProperty.call(message, "sslHealthCheck")) + $root.google.cloud.compute.v1.SSLHealthCheck.encode(message.sslHealthCheck, writer.uint32(/* id 280032440, wireType 2 =*/2240259522).fork()).ldelim(); + if (message.checkIntervalSec != null && Object.hasOwnProperty.call(message, "checkIntervalSec")) + writer.uint32(/* id 345561006, wireType 0 =*/2764488048).int32(message.checkIntervalSec); + if (message.logConfig != null && Object.hasOwnProperty.call(message, "logConfig")) + $root.google.cloud.compute.v1.HealthCheckLogConfig.encode(message.logConfig, writer.uint32(/* id 351299741, wireType 2 =*/2810397930).fork()).ldelim(); + if (message.healthyThreshold != null && Object.hasOwnProperty.call(message, "healthyThreshold")) + writer.uint32(/* id 403212361, wireType 0 =*/3225698888).int32(message.healthyThreshold); + if (message.httpHealthCheck != null && Object.hasOwnProperty.call(message, "httpHealthCheck")) + $root.google.cloud.compute.v1.HTTPHealthCheck.encode(message.httpHealthCheck, writer.uint32(/* id 412586940, wireType 2 =*/3300695522).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.httpsHealthCheck != null && Object.hasOwnProperty.call(message, "httpsHealthCheck")) + $root.google.cloud.compute.v1.HTTPSHealthCheck.encode(message.httpsHealthCheck, writer.uint32(/* id 436046905, wireType 2 =*/3488375242).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.tcpHealthCheck != null && Object.hasOwnProperty.call(message, "tcpHealthCheck")) + $root.google.cloud.compute.v1.TCPHealthCheck.encode(message.tcpHealthCheck, writer.uint32(/* id 469980419, wireType 2 =*/3759843354).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HealthCheck message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheck.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {google.cloud.compute.v1.IHealthCheck} message HealthCheck message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheck.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheck message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthCheck} HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheck.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthCheck(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 345561006: + message.checkIntervalSec = reader.int32(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 85529574: + message.grpcHealthCheck = $root.google.cloud.compute.v1.GRPCHealthCheck.decode(reader, reader.uint32()); + break; + case 403212361: + message.healthyThreshold = reader.int32(); + break; + case 11360986: + message.http2HealthCheck = $root.google.cloud.compute.v1.HTTP2HealthCheck.decode(reader, reader.uint32()); + break; + case 412586940: + message.httpHealthCheck = $root.google.cloud.compute.v1.HTTPHealthCheck.decode(reader, reader.uint32()); + break; + case 436046905: + message.httpsHealthCheck = $root.google.cloud.compute.v1.HTTPSHealthCheck.decode(reader, reader.uint32()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 351299741: + message.logConfig = $root.google.cloud.compute.v1.HealthCheckLogConfig.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 280032440: + message.sslHealthCheck = $root.google.cloud.compute.v1.SSLHealthCheck.decode(reader, reader.uint32()); + break; + case 469980419: + message.tcpHealthCheck = $root.google.cloud.compute.v1.TCPHealthCheck.decode(reader, reader.uint32()); + break; + case 79994995: + message.timeoutSec = reader.int32(); + break; + case 3575610: + message.type = reader.int32(); + break; + case 227958480: + message.unhealthyThreshold = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheck message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthCheck} HealthCheck + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheck.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheck message. + * @function verify + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheck.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.checkIntervalSec != null && message.hasOwnProperty("checkIntervalSec")) { + properties._checkIntervalSec = 1; + if (!$util.isInteger(message.checkIntervalSec)) + return "checkIntervalSec: integer expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.grpcHealthCheck != null && message.hasOwnProperty("grpcHealthCheck")) { + properties._grpcHealthCheck = 1; + { + var error = $root.google.cloud.compute.v1.GRPCHealthCheck.verify(message.grpcHealthCheck); + if (error) + return "grpcHealthCheck." + error; + } + } + if (message.healthyThreshold != null && message.hasOwnProperty("healthyThreshold")) { + properties._healthyThreshold = 1; + if (!$util.isInteger(message.healthyThreshold)) + return "healthyThreshold: integer expected"; + } + if (message.http2HealthCheck != null && message.hasOwnProperty("http2HealthCheck")) { + properties._http2HealthCheck = 1; + { + var error = $root.google.cloud.compute.v1.HTTP2HealthCheck.verify(message.http2HealthCheck); + if (error) + return "http2HealthCheck." + error; + } + } + if (message.httpHealthCheck != null && message.hasOwnProperty("httpHealthCheck")) { + properties._httpHealthCheck = 1; + { + var error = $root.google.cloud.compute.v1.HTTPHealthCheck.verify(message.httpHealthCheck); + if (error) + return "httpHealthCheck." + error; + } + } + if (message.httpsHealthCheck != null && message.hasOwnProperty("httpsHealthCheck")) { + properties._httpsHealthCheck = 1; + { + var error = $root.google.cloud.compute.v1.HTTPSHealthCheck.verify(message.httpsHealthCheck); + if (error) + return "httpsHealthCheck." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + properties._logConfig = 1; + { + var error = $root.google.cloud.compute.v1.HealthCheckLogConfig.verify(message.logConfig); + if (error) + return "logConfig." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sslHealthCheck != null && message.hasOwnProperty("sslHealthCheck")) { + properties._sslHealthCheck = 1; + { + var error = $root.google.cloud.compute.v1.SSLHealthCheck.verify(message.sslHealthCheck); + if (error) + return "sslHealthCheck." + error; + } + } + if (message.tcpHealthCheck != null && message.hasOwnProperty("tcpHealthCheck")) { + properties._tcpHealthCheck = 1; + { + var error = $root.google.cloud.compute.v1.TCPHealthCheck.verify(message.tcpHealthCheck); + if (error) + return "tcpHealthCheck." + error; + } + } + if (message.timeoutSec != null && message.hasOwnProperty("timeoutSec")) { + properties._timeoutSec = 1; + if (!$util.isInteger(message.timeoutSec)) + return "timeoutSec: integer expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 2196510: + case 2228360: + case 69079210: + case 69079243: + case 530283991: + case 82412: + case 82881: + break; + } + } + if (message.unhealthyThreshold != null && message.hasOwnProperty("unhealthyThreshold")) { + properties._unhealthyThreshold = 1; + if (!$util.isInteger(message.unhealthyThreshold)) + return "unhealthyThreshold: integer expected"; + } + return null; + }; + + /** + * Creates a HealthCheck message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthCheck} HealthCheck + */ + HealthCheck.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthCheck) + return object; + var message = new $root.google.cloud.compute.v1.HealthCheck(); + if (object.checkIntervalSec != null) + message.checkIntervalSec = object.checkIntervalSec | 0; + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.grpcHealthCheck != null) { + if (typeof object.grpcHealthCheck !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheck.grpcHealthCheck: object expected"); + message.grpcHealthCheck = $root.google.cloud.compute.v1.GRPCHealthCheck.fromObject(object.grpcHealthCheck); + } + if (object.healthyThreshold != null) + message.healthyThreshold = object.healthyThreshold | 0; + if (object.http2HealthCheck != null) { + if (typeof object.http2HealthCheck !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheck.http2HealthCheck: object expected"); + message.http2HealthCheck = $root.google.cloud.compute.v1.HTTP2HealthCheck.fromObject(object.http2HealthCheck); + } + if (object.httpHealthCheck != null) { + if (typeof object.httpHealthCheck !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheck.httpHealthCheck: object expected"); + message.httpHealthCheck = $root.google.cloud.compute.v1.HTTPHealthCheck.fromObject(object.httpHealthCheck); + } + if (object.httpsHealthCheck != null) { + if (typeof object.httpsHealthCheck !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheck.httpsHealthCheck: object expected"); + message.httpsHealthCheck = $root.google.cloud.compute.v1.HTTPSHealthCheck.fromObject(object.httpsHealthCheck); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.logConfig != null) { + if (typeof object.logConfig !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheck.logConfig: object expected"); + message.logConfig = $root.google.cloud.compute.v1.HealthCheckLogConfig.fromObject(object.logConfig); + } + if (object.name != null) + message.name = String(object.name); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.sslHealthCheck != null) { + if (typeof object.sslHealthCheck !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheck.sslHealthCheck: object expected"); + message.sslHealthCheck = $root.google.cloud.compute.v1.SSLHealthCheck.fromObject(object.sslHealthCheck); + } + if (object.tcpHealthCheck != null) { + if (typeof object.tcpHealthCheck !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheck.tcpHealthCheck: object expected"); + message.tcpHealthCheck = $root.google.cloud.compute.v1.TCPHealthCheck.fromObject(object.tcpHealthCheck); + } + if (object.timeoutSec != null) + message.timeoutSec = object.timeoutSec | 0; + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "GRPC": + case 2196510: + message.type = 2196510; + break; + case "HTTP": + case 2228360: + message.type = 2228360; + break; + case "HTTP2": + case 69079210: + message.type = 69079210; + break; + case "HTTPS": + case 69079243: + message.type = 69079243; + break; + case "INVALID": + case 530283991: + message.type = 530283991; + break; + case "SSL": + case 82412: + message.type = 82412; + break; + case "TCP": + case 82881: + message.type = 82881; + break; + } + if (object.unhealthyThreshold != null) + message.unhealthyThreshold = object.unhealthyThreshold | 0; + return message; + }; + + /** + * Creates a plain object from a HealthCheck message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthCheck + * @static + * @param {google.cloud.compute.v1.HealthCheck} message HealthCheck + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheck.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.HealthCheck.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.http2HealthCheck != null && message.hasOwnProperty("http2HealthCheck")) { + object.http2HealthCheck = $root.google.cloud.compute.v1.HTTP2HealthCheck.toObject(message.http2HealthCheck, options); + if (options.oneofs) + object._http2HealthCheck = "http2HealthCheck"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.timeoutSec != null && message.hasOwnProperty("timeoutSec")) { + object.timeoutSec = message.timeoutSec; + if (options.oneofs) + object._timeoutSec = "timeoutSec"; + } + if (message.grpcHealthCheck != null && message.hasOwnProperty("grpcHealthCheck")) { + object.grpcHealthCheck = $root.google.cloud.compute.v1.GRPCHealthCheck.toObject(message.grpcHealthCheck, options); + if (options.oneofs) + object._grpcHealthCheck = "grpcHealthCheck"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.unhealthyThreshold != null && message.hasOwnProperty("unhealthyThreshold")) { + object.unhealthyThreshold = message.unhealthyThreshold; + if (options.oneofs) + object._unhealthyThreshold = "unhealthyThreshold"; + } + if (message.sslHealthCheck != null && message.hasOwnProperty("sslHealthCheck")) { + object.sslHealthCheck = $root.google.cloud.compute.v1.SSLHealthCheck.toObject(message.sslHealthCheck, options); + if (options.oneofs) + object._sslHealthCheck = "sslHealthCheck"; + } + if (message.checkIntervalSec != null && message.hasOwnProperty("checkIntervalSec")) { + object.checkIntervalSec = message.checkIntervalSec; + if (options.oneofs) + object._checkIntervalSec = "checkIntervalSec"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + object.logConfig = $root.google.cloud.compute.v1.HealthCheckLogConfig.toObject(message.logConfig, options); + if (options.oneofs) + object._logConfig = "logConfig"; + } + if (message.healthyThreshold != null && message.hasOwnProperty("healthyThreshold")) { + object.healthyThreshold = message.healthyThreshold; + if (options.oneofs) + object._healthyThreshold = "healthyThreshold"; + } + if (message.httpHealthCheck != null && message.hasOwnProperty("httpHealthCheck")) { + object.httpHealthCheck = $root.google.cloud.compute.v1.HTTPHealthCheck.toObject(message.httpHealthCheck, options); + if (options.oneofs) + object._httpHealthCheck = "httpHealthCheck"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.httpsHealthCheck != null && message.hasOwnProperty("httpsHealthCheck")) { + object.httpsHealthCheck = $root.google.cloud.compute.v1.HTTPSHealthCheck.toObject(message.httpsHealthCheck, options); + if (options.oneofs) + object._httpsHealthCheck = "httpsHealthCheck"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.tcpHealthCheck != null && message.hasOwnProperty("tcpHealthCheck")) { + object.tcpHealthCheck = $root.google.cloud.compute.v1.TCPHealthCheck.toObject(message.tcpHealthCheck, options); + if (options.oneofs) + object._tcpHealthCheck = "tcpHealthCheck"; + } + return object; + }; + + /** + * Converts this HealthCheck to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthCheck + * @instance + * @returns {Object.} JSON object + */ + HealthCheck.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.HealthCheck.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} GRPC=2196510 GRPC value + * @property {number} HTTP=2228360 HTTP value + * @property {number} HTTP2=69079210 HTTP2 value + * @property {number} HTTPS=69079243 HTTPS value + * @property {number} INVALID=530283991 INVALID value + * @property {number} SSL=82412 SSL value + * @property {number} TCP=82881 TCP value + */ + HealthCheck.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[2196510] = "GRPC"] = 2196510; + values[valuesById[2228360] = "HTTP"] = 2228360; + values[valuesById[69079210] = "HTTP2"] = 69079210; + values[valuesById[69079243] = "HTTPS"] = 69079243; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[82412] = "SSL"] = 82412; + values[valuesById[82881] = "TCP"] = 82881; + return values; + })(); + + return HealthCheck; + })(); + + v1.HealthCheckList = (function() { + + /** + * Properties of a HealthCheckList. + * @memberof google.cloud.compute.v1 + * @interface IHealthCheckList + * @property {string|null} [id] HealthCheckList id + * @property {Array.|null} [items] HealthCheckList items + * @property {string|null} [kind] HealthCheckList kind + * @property {string|null} [nextPageToken] HealthCheckList nextPageToken + * @property {string|null} [selfLink] HealthCheckList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] HealthCheckList warning + */ + + /** + * Constructs a new HealthCheckList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthCheckList. + * @implements IHealthCheckList + * @constructor + * @param {google.cloud.compute.v1.IHealthCheckList=} [properties] Properties to set + */ + function HealthCheckList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheckList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + HealthCheckList.prototype.id = null; + + /** + * HealthCheckList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + HealthCheckList.prototype.items = $util.emptyArray; + + /** + * HealthCheckList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + HealthCheckList.prototype.kind = null; + + /** + * HealthCheckList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + HealthCheckList.prototype.nextPageToken = null; + + /** + * HealthCheckList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + HealthCheckList.prototype.selfLink = null; + + /** + * HealthCheckList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + HealthCheckList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthCheckList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + Object.defineProperty(HealthCheckList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + Object.defineProperty(HealthCheckList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + Object.defineProperty(HealthCheckList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + Object.defineProperty(HealthCheckList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + */ + Object.defineProperty(HealthCheckList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthCheckList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {google.cloud.compute.v1.IHealthCheckList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthCheckList} HealthCheckList instance + */ + HealthCheckList.create = function create(properties) { + return new HealthCheckList(properties); + }; + + /** + * Encodes the specified HealthCheckList message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {google.cloud.compute.v1.IHealthCheckList} message HealthCheckList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.HealthCheck.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified HealthCheckList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {google.cloud.compute.v1.IHealthCheckList} message HealthCheckList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheckList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthCheckList} HealthCheckList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthCheckList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheckList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthCheckList} HealthCheckList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheckList message. + * @function verify + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheckList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a HealthCheckList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthCheckList} HealthCheckList + */ + HealthCheckList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthCheckList) + return object; + var message = new $root.google.cloud.compute.v1.HealthCheckList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.HealthCheckList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheckList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheckList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a HealthCheckList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthCheckList + * @static + * @param {google.cloud.compute.v1.HealthCheckList} message HealthCheckList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheckList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.HealthCheck.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this HealthCheckList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthCheckList + * @instance + * @returns {Object.} JSON object + */ + HealthCheckList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HealthCheckList; + })(); + + v1.HealthCheckReference = (function() { + + /** + * Properties of a HealthCheckReference. + * @memberof google.cloud.compute.v1 + * @interface IHealthCheckReference + * @property {string|null} [healthCheck] HealthCheckReference healthCheck + */ + + /** + * Constructs a new HealthCheckReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthCheckReference. + * @implements IHealthCheckReference + * @constructor + * @param {google.cloud.compute.v1.IHealthCheckReference=} [properties] Properties to set + */ + function HealthCheckReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheckReference healthCheck. + * @member {string|null|undefined} healthCheck + * @memberof google.cloud.compute.v1.HealthCheckReference + * @instance + */ + HealthCheckReference.prototype.healthCheck = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthCheckReference _healthCheck. + * @member {"healthCheck"|undefined} _healthCheck + * @memberof google.cloud.compute.v1.HealthCheckReference + * @instance + */ + Object.defineProperty(HealthCheckReference.prototype, "_healthCheck", { + get: $util.oneOfGetter($oneOfFields = ["healthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthCheckReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {google.cloud.compute.v1.IHealthCheckReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthCheckReference} HealthCheckReference instance + */ + HealthCheckReference.create = function create(properties) { + return new HealthCheckReference(properties); + }; + + /** + * Encodes the specified HealthCheckReference message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {google.cloud.compute.v1.IHealthCheckReference} message HealthCheckReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified HealthCheckReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {google.cloud.compute.v1.IHealthCheckReference} message HealthCheckReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheckReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthCheckReference} HealthCheckReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthCheckReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheckReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthCheckReference} HealthCheckReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheckReference message. + * @function verify + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheckReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + properties._healthCheck = 1; + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + } + return null; + }; + + /** + * Creates a HealthCheckReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthCheckReference} HealthCheckReference + */ + HealthCheckReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthCheckReference) + return object; + var message = new $root.google.cloud.compute.v1.HealthCheckReference(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + return message; + }; + + /** + * Creates a plain object from a HealthCheckReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthCheckReference + * @static + * @param {google.cloud.compute.v1.HealthCheckReference} message HealthCheckReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheckReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + object.healthCheck = message.healthCheck; + if (options.oneofs) + object._healthCheck = "healthCheck"; + } + return object; + }; + + /** + * Converts this HealthCheckReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthCheckReference + * @instance + * @returns {Object.} JSON object + */ + HealthCheckReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HealthCheckReference; + })(); + + v1.HealthCheckService = (function() { + + /** + * Properties of a HealthCheckService. + * @memberof google.cloud.compute.v1 + * @interface IHealthCheckService + * @property {string|null} [creationTimestamp] HealthCheckService creationTimestamp + * @property {string|null} [description] HealthCheckService description + * @property {string|null} [fingerprint] HealthCheckService fingerprint + * @property {Array.|null} [healthChecks] HealthCheckService healthChecks + * @property {google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy|null} [healthStatusAggregationPolicy] HealthCheckService healthStatusAggregationPolicy + * @property {number|Long|null} [id] HealthCheckService id + * @property {string|null} [kind] HealthCheckService kind + * @property {string|null} [name] HealthCheckService name + * @property {Array.|null} [networkEndpointGroups] HealthCheckService networkEndpointGroups + * @property {Array.|null} [notificationEndpoints] HealthCheckService notificationEndpoints + * @property {string|null} [region] HealthCheckService region + * @property {string|null} [selfLink] HealthCheckService selfLink + */ + + /** + * Constructs a new HealthCheckService. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthCheckService. + * @implements IHealthCheckService + * @constructor + * @param {google.cloud.compute.v1.IHealthCheckService=} [properties] Properties to set + */ + function HealthCheckService(properties) { + this.healthChecks = []; + this.networkEndpointGroups = []; + this.notificationEndpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheckService creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.creationTimestamp = null; + + /** + * HealthCheckService description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.description = null; + + /** + * HealthCheckService fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.fingerprint = null; + + /** + * HealthCheckService healthChecks. + * @member {Array.} healthChecks + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.healthChecks = $util.emptyArray; + + /** + * HealthCheckService healthStatusAggregationPolicy. + * @member {google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy|null|undefined} healthStatusAggregationPolicy + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.healthStatusAggregationPolicy = null; + + /** + * HealthCheckService id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.id = null; + + /** + * HealthCheckService kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.kind = null; + + /** + * HealthCheckService name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.name = null; + + /** + * HealthCheckService networkEndpointGroups. + * @member {Array.} networkEndpointGroups + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.networkEndpointGroups = $util.emptyArray; + + /** + * HealthCheckService notificationEndpoints. + * @member {Array.} notificationEndpoints + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.notificationEndpoints = $util.emptyArray; + + /** + * HealthCheckService region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.region = null; + + /** + * HealthCheckService selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + HealthCheckService.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthCheckService _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _healthStatusAggregationPolicy. + * @member {"healthStatusAggregationPolicy"|undefined} _healthStatusAggregationPolicy + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_healthStatusAggregationPolicy", { + get: $util.oneOfGetter($oneOfFields = ["healthStatusAggregationPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckService _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + */ + Object.defineProperty(HealthCheckService.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthCheckService instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {google.cloud.compute.v1.IHealthCheckService=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthCheckService} HealthCheckService instance + */ + HealthCheckService.create = function create(properties) { + return new HealthCheckService(properties); + }; + + /** + * Encodes the specified HealthCheckService message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckService.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {google.cloud.compute.v1.IHealthCheckService} message HealthCheckService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.networkEndpointGroups != null && message.networkEndpointGroups.length) + for (var i = 0; i < message.networkEndpointGroups.length; ++i) + writer.uint32(/* id 29346733, wireType 2 =*/234773866).string(message.networkEndpointGroups[i]); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.healthStatusAggregationPolicy != null && Object.hasOwnProperty.call(message, "healthStatusAggregationPolicy")) + writer.uint32(/* id 253163129, wireType 0 =*/2025305032).int32(message.healthStatusAggregationPolicy); + if (message.notificationEndpoints != null && message.notificationEndpoints.length) + for (var i = 0; i < message.notificationEndpoints.length; ++i) + writer.uint32(/* id 406728490, wireType 2 =*/3253827922).string(message.notificationEndpoints[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.healthChecks != null && message.healthChecks.length) + for (var i = 0; i < message.healthChecks.length; ++i) + writer.uint32(/* id 448370606, wireType 2 =*/3586964850).string(message.healthChecks[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified HealthCheckService message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {google.cloud.compute.v1.IHealthCheckService} message HealthCheckService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheckService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthCheckService} HealthCheckService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckService.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthCheckService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 448370606: + if (!(message.healthChecks && message.healthChecks.length)) + message.healthChecks = []; + message.healthChecks.push(reader.string()); + break; + case 253163129: + message.healthStatusAggregationPolicy = reader.int32(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 29346733: + if (!(message.networkEndpointGroups && message.networkEndpointGroups.length)) + message.networkEndpointGroups = []; + message.networkEndpointGroups.push(reader.string()); + break; + case 406728490: + if (!(message.notificationEndpoints && message.notificationEndpoints.length)) + message.notificationEndpoints = []; + message.notificationEndpoints.push(reader.string()); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheckService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthCheckService} HealthCheckService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheckService message. + * @function verify + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheckService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.healthChecks != null && message.hasOwnProperty("healthChecks")) { + if (!Array.isArray(message.healthChecks)) + return "healthChecks: array expected"; + for (var i = 0; i < message.healthChecks.length; ++i) + if (!$util.isString(message.healthChecks[i])) + return "healthChecks: string[] expected"; + } + if (message.healthStatusAggregationPolicy != null && message.hasOwnProperty("healthStatusAggregationPolicy")) { + properties._healthStatusAggregationPolicy = 1; + switch (message.healthStatusAggregationPolicy) { + default: + return "healthStatusAggregationPolicy: enum value expected"; + case 0: + case 64951: + case 426445124: + break; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.networkEndpointGroups != null && message.hasOwnProperty("networkEndpointGroups")) { + if (!Array.isArray(message.networkEndpointGroups)) + return "networkEndpointGroups: array expected"; + for (var i = 0; i < message.networkEndpointGroups.length; ++i) + if (!$util.isString(message.networkEndpointGroups[i])) + return "networkEndpointGroups: string[] expected"; + } + if (message.notificationEndpoints != null && message.hasOwnProperty("notificationEndpoints")) { + if (!Array.isArray(message.notificationEndpoints)) + return "notificationEndpoints: array expected"; + for (var i = 0; i < message.notificationEndpoints.length; ++i) + if (!$util.isString(message.notificationEndpoints[i])) + return "notificationEndpoints: string[] expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates a HealthCheckService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthCheckService} HealthCheckService + */ + HealthCheckService.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthCheckService) + return object; + var message = new $root.google.cloud.compute.v1.HealthCheckService(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.healthChecks) { + if (!Array.isArray(object.healthChecks)) + throw TypeError(".google.cloud.compute.v1.HealthCheckService.healthChecks: array expected"); + message.healthChecks = []; + for (var i = 0; i < object.healthChecks.length; ++i) + message.healthChecks[i] = String(object.healthChecks[i]); + } + switch (object.healthStatusAggregationPolicy) { + case "UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY": + case 0: + message.healthStatusAggregationPolicy = 0; + break; + case "AND": + case 64951: + message.healthStatusAggregationPolicy = 64951; + break; + case "NO_AGGREGATION": + case 426445124: + message.healthStatusAggregationPolicy = 426445124; + break; + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.networkEndpointGroups) { + if (!Array.isArray(object.networkEndpointGroups)) + throw TypeError(".google.cloud.compute.v1.HealthCheckService.networkEndpointGroups: array expected"); + message.networkEndpointGroups = []; + for (var i = 0; i < object.networkEndpointGroups.length; ++i) + message.networkEndpointGroups[i] = String(object.networkEndpointGroups[i]); + } + if (object.notificationEndpoints) { + if (!Array.isArray(object.notificationEndpoints)) + throw TypeError(".google.cloud.compute.v1.HealthCheckService.notificationEndpoints: array expected"); + message.notificationEndpoints = []; + for (var i = 0; i < object.notificationEndpoints.length; ++i) + message.notificationEndpoints[i] = String(object.notificationEndpoints[i]); + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from a HealthCheckService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthCheckService + * @static + * @param {google.cloud.compute.v1.HealthCheckService} message HealthCheckService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheckService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkEndpointGroups = []; + object.notificationEndpoints = []; + object.healthChecks = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.networkEndpointGroups && message.networkEndpointGroups.length) { + object.networkEndpointGroups = []; + for (var j = 0; j < message.networkEndpointGroups.length; ++j) + object.networkEndpointGroups[j] = message.networkEndpointGroups[j]; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.healthStatusAggregationPolicy != null && message.hasOwnProperty("healthStatusAggregationPolicy")) { + object.healthStatusAggregationPolicy = options.enums === String ? $root.google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy[message.healthStatusAggregationPolicy] : message.healthStatusAggregationPolicy; + if (options.oneofs) + object._healthStatusAggregationPolicy = "healthStatusAggregationPolicy"; + } + if (message.notificationEndpoints && message.notificationEndpoints.length) { + object.notificationEndpoints = []; + for (var j = 0; j < message.notificationEndpoints.length; ++j) + object.notificationEndpoints[j] = message.notificationEndpoints[j]; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.healthChecks && message.healthChecks.length) { + object.healthChecks = []; + for (var j = 0; j < message.healthChecks.length; ++j) + object.healthChecks[j] = message.healthChecks[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this HealthCheckService to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthCheckService + * @instance + * @returns {Object.} JSON object + */ + HealthCheckService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * HealthStatusAggregationPolicy enum. + * @name google.cloud.compute.v1.HealthCheckService.HealthStatusAggregationPolicy + * @enum {number} + * @property {number} UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY=0 UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY value + * @property {number} AND=64951 AND value + * @property {number} NO_AGGREGATION=426445124 NO_AGGREGATION value + */ + HealthCheckService.HealthStatusAggregationPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY"] = 0; + values[valuesById[64951] = "AND"] = 64951; + values[valuesById[426445124] = "NO_AGGREGATION"] = 426445124; + return values; + })(); + + return HealthCheckService; + })(); + + v1.HealthCheckServiceReference = (function() { + + /** + * Properties of a HealthCheckServiceReference. + * @memberof google.cloud.compute.v1 + * @interface IHealthCheckServiceReference + * @property {string|null} [healthCheckService] HealthCheckServiceReference healthCheckService + */ + + /** + * Constructs a new HealthCheckServiceReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthCheckServiceReference. + * @implements IHealthCheckServiceReference + * @constructor + * @param {google.cloud.compute.v1.IHealthCheckServiceReference=} [properties] Properties to set + */ + function HealthCheckServiceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheckServiceReference healthCheckService. + * @member {string|null|undefined} healthCheckService + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @instance + */ + HealthCheckServiceReference.prototype.healthCheckService = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthCheckServiceReference _healthCheckService. + * @member {"healthCheckService"|undefined} _healthCheckService + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @instance + */ + Object.defineProperty(HealthCheckServiceReference.prototype, "_healthCheckService", { + get: $util.oneOfGetter($oneOfFields = ["healthCheckService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthCheckServiceReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {google.cloud.compute.v1.IHealthCheckServiceReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthCheckServiceReference} HealthCheckServiceReference instance + */ + HealthCheckServiceReference.create = function create(properties) { + return new HealthCheckServiceReference(properties); + }; + + /** + * Encodes the specified HealthCheckServiceReference message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServiceReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {google.cloud.compute.v1.IHealthCheckServiceReference} message HealthCheckServiceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckServiceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.healthCheckService != null && Object.hasOwnProperty.call(message, "healthCheckService")) + writer.uint32(/* id 408374747, wireType 2 =*/3266997978).string(message.healthCheckService); + return writer; + }; + + /** + * Encodes the specified HealthCheckServiceReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServiceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {google.cloud.compute.v1.IHealthCheckServiceReference} message HealthCheckServiceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckServiceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheckServiceReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthCheckServiceReference} HealthCheckServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckServiceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthCheckServiceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 408374747: + message.healthCheckService = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheckServiceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthCheckServiceReference} HealthCheckServiceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckServiceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheckServiceReference message. + * @function verify + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheckServiceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) { + properties._healthCheckService = 1; + if (!$util.isString(message.healthCheckService)) + return "healthCheckService: string expected"; + } + return null; + }; + + /** + * Creates a HealthCheckServiceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthCheckServiceReference} HealthCheckServiceReference + */ + HealthCheckServiceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthCheckServiceReference) + return object; + var message = new $root.google.cloud.compute.v1.HealthCheckServiceReference(); + if (object.healthCheckService != null) + message.healthCheckService = String(object.healthCheckService); + return message; + }; + + /** + * Creates a plain object from a HealthCheckServiceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @static + * @param {google.cloud.compute.v1.HealthCheckServiceReference} message HealthCheckServiceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheckServiceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) { + object.healthCheckService = message.healthCheckService; + if (options.oneofs) + object._healthCheckService = "healthCheckService"; + } + return object; + }; + + /** + * Converts this HealthCheckServiceReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthCheckServiceReference + * @instance + * @returns {Object.} JSON object + */ + HealthCheckServiceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HealthCheckServiceReference; + })(); + + v1.HealthCheckServicesList = (function() { + + /** + * Properties of a HealthCheckServicesList. + * @memberof google.cloud.compute.v1 + * @interface IHealthCheckServicesList + * @property {string|null} [id] HealthCheckServicesList id + * @property {Array.|null} [items] HealthCheckServicesList items + * @property {string|null} [kind] HealthCheckServicesList kind + * @property {string|null} [nextPageToken] HealthCheckServicesList nextPageToken + * @property {string|null} [selfLink] HealthCheckServicesList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] HealthCheckServicesList warning + */ + + /** + * Constructs a new HealthCheckServicesList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthCheckServicesList. + * @implements IHealthCheckServicesList + * @constructor + * @param {google.cloud.compute.v1.IHealthCheckServicesList=} [properties] Properties to set + */ + function HealthCheckServicesList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthCheckServicesList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + HealthCheckServicesList.prototype.id = null; + + /** + * HealthCheckServicesList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + HealthCheckServicesList.prototype.items = $util.emptyArray; + + /** + * HealthCheckServicesList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + HealthCheckServicesList.prototype.kind = null; + + /** + * HealthCheckServicesList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + HealthCheckServicesList.prototype.nextPageToken = null; + + /** + * HealthCheckServicesList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + HealthCheckServicesList.prototype.selfLink = null; + + /** + * HealthCheckServicesList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + HealthCheckServicesList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthCheckServicesList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + Object.defineProperty(HealthCheckServicesList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckServicesList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + Object.defineProperty(HealthCheckServicesList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckServicesList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + Object.defineProperty(HealthCheckServicesList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckServicesList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + Object.defineProperty(HealthCheckServicesList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthCheckServicesList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + */ + Object.defineProperty(HealthCheckServicesList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthCheckServicesList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {google.cloud.compute.v1.IHealthCheckServicesList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthCheckServicesList} HealthCheckServicesList instance + */ + HealthCheckServicesList.create = function create(properties) { + return new HealthCheckServicesList(properties); + }; + + /** + * Encodes the specified HealthCheckServicesList message. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServicesList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {google.cloud.compute.v1.IHealthCheckServicesList} message HealthCheckServicesList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckServicesList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.HealthCheckService.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified HealthCheckServicesList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthCheckServicesList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {google.cloud.compute.v1.IHealthCheckServicesList} message HealthCheckServicesList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthCheckServicesList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthCheckServicesList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthCheckServicesList} HealthCheckServicesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckServicesList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthCheckServicesList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.HealthCheckService.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthCheckServicesList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthCheckServicesList} HealthCheckServicesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthCheckServicesList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthCheckServicesList message. + * @function verify + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthCheckServicesList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthCheckService.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a HealthCheckServicesList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthCheckServicesList} HealthCheckServicesList + */ + HealthCheckServicesList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthCheckServicesList) + return object; + var message = new $root.google.cloud.compute.v1.HealthCheckServicesList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.HealthCheckServicesList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheckServicesList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.HealthCheckService.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.HealthCheckServicesList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a HealthCheckServicesList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @static + * @param {google.cloud.compute.v1.HealthCheckServicesList} message HealthCheckServicesList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthCheckServicesList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.HealthCheckService.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this HealthCheckServicesList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthCheckServicesList + * @instance + * @returns {Object.} JSON object + */ + HealthCheckServicesList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HealthCheckServicesList; + })(); + + v1.HealthChecksScopedList = (function() { + + /** + * Properties of a HealthChecksScopedList. + * @memberof google.cloud.compute.v1 + * @interface IHealthChecksScopedList + * @property {Array.|null} [healthChecks] HealthChecksScopedList healthChecks + * @property {google.cloud.compute.v1.IWarning|null} [warning] HealthChecksScopedList warning + */ + + /** + * Constructs a new HealthChecksScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthChecksScopedList. + * @implements IHealthChecksScopedList + * @constructor + * @param {google.cloud.compute.v1.IHealthChecksScopedList=} [properties] Properties to set + */ + function HealthChecksScopedList(properties) { + this.healthChecks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthChecksScopedList healthChecks. + * @member {Array.} healthChecks + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @instance + */ + HealthChecksScopedList.prototype.healthChecks = $util.emptyArray; + + /** + * HealthChecksScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @instance + */ + HealthChecksScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthChecksScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @instance + */ + Object.defineProperty(HealthChecksScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthChecksScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {google.cloud.compute.v1.IHealthChecksScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthChecksScopedList} HealthChecksScopedList instance + */ + HealthChecksScopedList.create = function create(properties) { + return new HealthChecksScopedList(properties); + }; + + /** + * Encodes the specified HealthChecksScopedList message. Does not implicitly {@link google.cloud.compute.v1.HealthChecksScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {google.cloud.compute.v1.IHealthChecksScopedList} message HealthChecksScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthChecksScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.healthChecks != null && message.healthChecks.length) + for (var i = 0; i < message.healthChecks.length; ++i) + $root.google.cloud.compute.v1.HealthCheck.encode(message.healthChecks[i], writer.uint32(/* id 448370606, wireType 2 =*/3586964850).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HealthChecksScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthChecksScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {google.cloud.compute.v1.IHealthChecksScopedList} message HealthChecksScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthChecksScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthChecksScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthChecksScopedList} HealthChecksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthChecksScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthChecksScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 448370606: + if (!(message.healthChecks && message.healthChecks.length)) + message.healthChecks = []; + message.healthChecks.push($root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthChecksScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthChecksScopedList} HealthChecksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthChecksScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthChecksScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthChecksScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthChecks != null && message.hasOwnProperty("healthChecks")) { + if (!Array.isArray(message.healthChecks)) + return "healthChecks: array expected"; + for (var i = 0; i < message.healthChecks.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.healthChecks[i]); + if (error) + return "healthChecks." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a HealthChecksScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthChecksScopedList} HealthChecksScopedList + */ + HealthChecksScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthChecksScopedList) + return object; + var message = new $root.google.cloud.compute.v1.HealthChecksScopedList(); + if (object.healthChecks) { + if (!Array.isArray(object.healthChecks)) + throw TypeError(".google.cloud.compute.v1.HealthChecksScopedList.healthChecks: array expected"); + message.healthChecks = []; + for (var i = 0; i < object.healthChecks.length; ++i) { + if (typeof object.healthChecks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HealthChecksScopedList.healthChecks: object expected"); + message.healthChecks[i] = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.healthChecks[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.HealthChecksScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a HealthChecksScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @static + * @param {google.cloud.compute.v1.HealthChecksScopedList} message HealthChecksScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthChecksScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.healthChecks = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.healthChecks && message.healthChecks.length) { + object.healthChecks = []; + for (var j = 0; j < message.healthChecks.length; ++j) + object.healthChecks[j] = $root.google.cloud.compute.v1.HealthCheck.toObject(message.healthChecks[j], options); + } + return object; + }; + + /** + * Converts this HealthChecksScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthChecksScopedList + * @instance + * @returns {Object.} JSON object + */ + HealthChecksScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HealthChecksScopedList; + })(); + + v1.HealthChecksAggregatedList = (function() { + + /** + * Properties of a HealthChecksAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IHealthChecksAggregatedList + * @property {string|null} [id] HealthChecksAggregatedList id + * @property {Object.|null} [items] HealthChecksAggregatedList items + * @property {string|null} [kind] HealthChecksAggregatedList kind + * @property {string|null} [nextPageToken] HealthChecksAggregatedList nextPageToken + * @property {string|null} [selfLink] HealthChecksAggregatedList selfLink + * @property {Array.|null} [unreachables] HealthChecksAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] HealthChecksAggregatedList warning + */ + + /** + * Constructs a new HealthChecksAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthChecksAggregatedList. + * @implements IHealthChecksAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IHealthChecksAggregatedList=} [properties] Properties to set + */ + function HealthChecksAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthChecksAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + HealthChecksAggregatedList.prototype.id = null; + + /** + * HealthChecksAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + HealthChecksAggregatedList.prototype.items = $util.emptyObject; + + /** + * HealthChecksAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + HealthChecksAggregatedList.prototype.kind = null; + + /** + * HealthChecksAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + HealthChecksAggregatedList.prototype.nextPageToken = null; + + /** + * HealthChecksAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + HealthChecksAggregatedList.prototype.selfLink = null; + + /** + * HealthChecksAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + HealthChecksAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * HealthChecksAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + HealthChecksAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthChecksAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + Object.defineProperty(HealthChecksAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthChecksAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + Object.defineProperty(HealthChecksAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthChecksAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + Object.defineProperty(HealthChecksAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthChecksAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + Object.defineProperty(HealthChecksAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthChecksAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + */ + Object.defineProperty(HealthChecksAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthChecksAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {google.cloud.compute.v1.IHealthChecksAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthChecksAggregatedList} HealthChecksAggregatedList instance + */ + HealthChecksAggregatedList.create = function create(properties) { + return new HealthChecksAggregatedList(properties); + }; + + /** + * Encodes the specified HealthChecksAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.HealthChecksAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {google.cloud.compute.v1.IHealthChecksAggregatedList} message HealthChecksAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthChecksAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.HealthChecksScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified HealthChecksAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthChecksAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {google.cloud.compute.v1.IHealthChecksAggregatedList} message HealthChecksAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthChecksAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthChecksAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthChecksAggregatedList} HealthChecksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthChecksAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthChecksAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.HealthChecksScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthChecksAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthChecksAggregatedList} HealthChecksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthChecksAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthChecksAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthChecksAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthChecksScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a HealthChecksAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthChecksAggregatedList} HealthChecksAggregatedList + */ + HealthChecksAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthChecksAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.HealthChecksAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.HealthChecksAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.HealthChecksAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.HealthChecksScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.HealthChecksAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.HealthChecksAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a HealthChecksAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @static + * @param {google.cloud.compute.v1.HealthChecksAggregatedList} message HealthChecksAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthChecksAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.HealthChecksScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this HealthChecksAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthChecksAggregatedList + * @instance + * @returns {Object.} JSON object + */ + HealthChecksAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HealthChecksAggregatedList; + })(); + + v1.HealthStatusForNetworkEndpoint = (function() { + + /** + * Properties of a HealthStatusForNetworkEndpoint. + * @memberof google.cloud.compute.v1 + * @interface IHealthStatusForNetworkEndpoint + * @property {google.cloud.compute.v1.IBackendServiceReference|null} [backendService] HealthStatusForNetworkEndpoint backendService + * @property {google.cloud.compute.v1.IForwardingRuleReference|null} [forwardingRule] HealthStatusForNetworkEndpoint forwardingRule + * @property {google.cloud.compute.v1.IHealthCheckReference|null} [healthCheck] HealthStatusForNetworkEndpoint healthCheck + * @property {google.cloud.compute.v1.IHealthCheckServiceReference|null} [healthCheckService] HealthStatusForNetworkEndpoint healthCheckService + * @property {google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState|null} [healthState] HealthStatusForNetworkEndpoint healthState + */ + + /** + * Constructs a new HealthStatusForNetworkEndpoint. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthStatusForNetworkEndpoint. + * @implements IHealthStatusForNetworkEndpoint + * @constructor + * @param {google.cloud.compute.v1.IHealthStatusForNetworkEndpoint=} [properties] Properties to set + */ + function HealthStatusForNetworkEndpoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HealthStatusForNetworkEndpoint backendService. + * @member {google.cloud.compute.v1.IBackendServiceReference|null|undefined} backendService + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + HealthStatusForNetworkEndpoint.prototype.backendService = null; + + /** + * HealthStatusForNetworkEndpoint forwardingRule. + * @member {google.cloud.compute.v1.IForwardingRuleReference|null|undefined} forwardingRule + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + HealthStatusForNetworkEndpoint.prototype.forwardingRule = null; + + /** + * HealthStatusForNetworkEndpoint healthCheck. + * @member {google.cloud.compute.v1.IHealthCheckReference|null|undefined} healthCheck + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + HealthStatusForNetworkEndpoint.prototype.healthCheck = null; + + /** + * HealthStatusForNetworkEndpoint healthCheckService. + * @member {google.cloud.compute.v1.IHealthCheckServiceReference|null|undefined} healthCheckService + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + HealthStatusForNetworkEndpoint.prototype.healthCheckService = null; + + /** + * HealthStatusForNetworkEndpoint healthState. + * @member {google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState|null|undefined} healthState + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + HealthStatusForNetworkEndpoint.prototype.healthState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HealthStatusForNetworkEndpoint _backendService. + * @member {"backendService"|undefined} _backendService + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + Object.defineProperty(HealthStatusForNetworkEndpoint.prototype, "_backendService", { + get: $util.oneOfGetter($oneOfFields = ["backendService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatusForNetworkEndpoint _forwardingRule. + * @member {"forwardingRule"|undefined} _forwardingRule + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + Object.defineProperty(HealthStatusForNetworkEndpoint.prototype, "_forwardingRule", { + get: $util.oneOfGetter($oneOfFields = ["forwardingRule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatusForNetworkEndpoint _healthCheck. + * @member {"healthCheck"|undefined} _healthCheck + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + Object.defineProperty(HealthStatusForNetworkEndpoint.prototype, "_healthCheck", { + get: $util.oneOfGetter($oneOfFields = ["healthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatusForNetworkEndpoint _healthCheckService. + * @member {"healthCheckService"|undefined} _healthCheckService + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + Object.defineProperty(HealthStatusForNetworkEndpoint.prototype, "_healthCheckService", { + get: $util.oneOfGetter($oneOfFields = ["healthCheckService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HealthStatusForNetworkEndpoint _healthState. + * @member {"healthState"|undefined} _healthState + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + */ + Object.defineProperty(HealthStatusForNetworkEndpoint.prototype, "_healthState", { + get: $util.oneOfGetter($oneOfFields = ["healthState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HealthStatusForNetworkEndpoint instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {google.cloud.compute.v1.IHealthStatusForNetworkEndpoint=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HealthStatusForNetworkEndpoint} HealthStatusForNetworkEndpoint instance + */ + HealthStatusForNetworkEndpoint.create = function create(properties) { + return new HealthStatusForNetworkEndpoint(properties); + }; + + /** + * Encodes the specified HealthStatusForNetworkEndpoint message. Does not implicitly {@link google.cloud.compute.v1.HealthStatusForNetworkEndpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {google.cloud.compute.v1.IHealthStatusForNetworkEndpoint} message HealthStatusForNetworkEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthStatusForNetworkEndpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + $root.google.cloud.compute.v1.ForwardingRuleReference.encode(message.forwardingRule, writer.uint32(/* id 269964030, wireType 2 =*/2159712242).fork()).ldelim(); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + $root.google.cloud.compute.v1.BackendServiceReference.encode(message.backendService, writer.uint32(/* id 306946058, wireType 2 =*/2455568466).fork()).ldelim(); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + $root.google.cloud.compute.v1.HealthCheckReference.encode(message.healthCheck, writer.uint32(/* id 308876645, wireType 2 =*/2471013162).fork()).ldelim(); + if (message.healthState != null && Object.hasOwnProperty.call(message, "healthState")) + writer.uint32(/* id 324007150, wireType 0 =*/2592057200).int32(message.healthState); + if (message.healthCheckService != null && Object.hasOwnProperty.call(message, "healthCheckService")) + $root.google.cloud.compute.v1.HealthCheckServiceReference.encode(message.healthCheckService, writer.uint32(/* id 408374747, wireType 2 =*/3266997978).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HealthStatusForNetworkEndpoint message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HealthStatusForNetworkEndpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {google.cloud.compute.v1.IHealthStatusForNetworkEndpoint} message HealthStatusForNetworkEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HealthStatusForNetworkEndpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HealthStatusForNetworkEndpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HealthStatusForNetworkEndpoint} HealthStatusForNetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthStatusForNetworkEndpoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = $root.google.cloud.compute.v1.BackendServiceReference.decode(reader, reader.uint32()); + break; + case 269964030: + message.forwardingRule = $root.google.cloud.compute.v1.ForwardingRuleReference.decode(reader, reader.uint32()); + break; + case 308876645: + message.healthCheck = $root.google.cloud.compute.v1.HealthCheckReference.decode(reader, reader.uint32()); + break; + case 408374747: + message.healthCheckService = $root.google.cloud.compute.v1.HealthCheckServiceReference.decode(reader, reader.uint32()); + break; + case 324007150: + message.healthState = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HealthStatusForNetworkEndpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HealthStatusForNetworkEndpoint} HealthStatusForNetworkEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HealthStatusForNetworkEndpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HealthStatusForNetworkEndpoint message. + * @function verify + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HealthStatusForNetworkEndpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) { + properties._backendService = 1; + { + var error = $root.google.cloud.compute.v1.BackendServiceReference.verify(message.backendService); + if (error) + return "backendService." + error; + } + } + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) { + properties._forwardingRule = 1; + { + var error = $root.google.cloud.compute.v1.ForwardingRuleReference.verify(message.forwardingRule); + if (error) + return "forwardingRule." + error; + } + } + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + properties._healthCheck = 1; + { + var error = $root.google.cloud.compute.v1.HealthCheckReference.verify(message.healthCheck); + if (error) + return "healthCheck." + error; + } + } + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) { + properties._healthCheckService = 1; + { + var error = $root.google.cloud.compute.v1.HealthCheckServiceReference.verify(message.healthCheckService); + if (error) + return "healthCheckService." + error; + } + } + if (message.healthState != null && message.hasOwnProperty("healthState")) { + properties._healthState = 1; + switch (message.healthState) { + default: + return "healthState: enum value expected"; + case 0: + case 480455402: + case 439801213: + case 462118084: + case 433141802: + break; + } + } + return null; + }; + + /** + * Creates a HealthStatusForNetworkEndpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HealthStatusForNetworkEndpoint} HealthStatusForNetworkEndpoint + */ + HealthStatusForNetworkEndpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint) + return object; + var message = new $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint(); + if (object.backendService != null) { + if (typeof object.backendService !== "object") + throw TypeError(".google.cloud.compute.v1.HealthStatusForNetworkEndpoint.backendService: object expected"); + message.backendService = $root.google.cloud.compute.v1.BackendServiceReference.fromObject(object.backendService); + } + if (object.forwardingRule != null) { + if (typeof object.forwardingRule !== "object") + throw TypeError(".google.cloud.compute.v1.HealthStatusForNetworkEndpoint.forwardingRule: object expected"); + message.forwardingRule = $root.google.cloud.compute.v1.ForwardingRuleReference.fromObject(object.forwardingRule); + } + if (object.healthCheck != null) { + if (typeof object.healthCheck !== "object") + throw TypeError(".google.cloud.compute.v1.HealthStatusForNetworkEndpoint.healthCheck: object expected"); + message.healthCheck = $root.google.cloud.compute.v1.HealthCheckReference.fromObject(object.healthCheck); + } + if (object.healthCheckService != null) { + if (typeof object.healthCheckService !== "object") + throw TypeError(".google.cloud.compute.v1.HealthStatusForNetworkEndpoint.healthCheckService: object expected"); + message.healthCheckService = $root.google.cloud.compute.v1.HealthCheckServiceReference.fromObject(object.healthCheckService); + } + switch (object.healthState) { + case "UNDEFINED_HEALTH_STATE": + case 0: + message.healthState = 0; + break; + case "DRAINING": + case 480455402: + message.healthState = 480455402; + break; + case "HEALTHY": + case 439801213: + message.healthState = 439801213; + break; + case "UNHEALTHY": + case 462118084: + message.healthState = 462118084; + break; + case "UNKNOWN": + case 433141802: + message.healthState = 433141802; + break; + } + return message; + }; + + /** + * Creates a plain object from a HealthStatusForNetworkEndpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @static + * @param {google.cloud.compute.v1.HealthStatusForNetworkEndpoint} message HealthStatusForNetworkEndpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HealthStatusForNetworkEndpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) { + object.forwardingRule = $root.google.cloud.compute.v1.ForwardingRuleReference.toObject(message.forwardingRule, options); + if (options.oneofs) + object._forwardingRule = "forwardingRule"; + } + if (message.backendService != null && message.hasOwnProperty("backendService")) { + object.backendService = $root.google.cloud.compute.v1.BackendServiceReference.toObject(message.backendService, options); + if (options.oneofs) + object._backendService = "backendService"; + } + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + object.healthCheck = $root.google.cloud.compute.v1.HealthCheckReference.toObject(message.healthCheck, options); + if (options.oneofs) + object._healthCheck = "healthCheck"; + } + if (message.healthState != null && message.hasOwnProperty("healthState")) { + object.healthState = options.enums === String ? $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState[message.healthState] : message.healthState; + if (options.oneofs) + object._healthState = "healthState"; + } + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) { + object.healthCheckService = $root.google.cloud.compute.v1.HealthCheckServiceReference.toObject(message.healthCheckService, options); + if (options.oneofs) + object._healthCheckService = "healthCheckService"; + } + return object; + }; + + /** + * Converts this HealthStatusForNetworkEndpoint to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HealthStatusForNetworkEndpoint + * @instance + * @returns {Object.} JSON object + */ + HealthStatusForNetworkEndpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * HealthState enum. + * @name google.cloud.compute.v1.HealthStatusForNetworkEndpoint.HealthState + * @enum {number} + * @property {number} UNDEFINED_HEALTH_STATE=0 UNDEFINED_HEALTH_STATE value + * @property {number} DRAINING=480455402 DRAINING value + * @property {number} HEALTHY=439801213 HEALTHY value + * @property {number} UNHEALTHY=462118084 UNHEALTHY value + * @property {number} UNKNOWN=433141802 UNKNOWN value + */ + HealthStatusForNetworkEndpoint.HealthState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_HEALTH_STATE"] = 0; + values[valuesById[480455402] = "DRAINING"] = 480455402; + values[valuesById[439801213] = "HEALTHY"] = 439801213; + values[valuesById[462118084] = "UNHEALTHY"] = 462118084; + values[valuesById[433141802] = "UNKNOWN"] = 433141802; + return values; + })(); + + return HealthStatusForNetworkEndpoint; + })(); + + v1.HostRule = (function() { + + /** + * Properties of a HostRule. + * @memberof google.cloud.compute.v1 + * @interface IHostRule + * @property {string|null} [description] HostRule description + * @property {Array.|null} [hosts] HostRule hosts + * @property {string|null} [pathMatcher] HostRule pathMatcher + */ + + /** + * Constructs a new HostRule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HostRule. + * @implements IHostRule + * @constructor + * @param {google.cloud.compute.v1.IHostRule=} [properties] Properties to set + */ + function HostRule(properties) { + this.hosts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HostRule description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.HostRule + * @instance + */ + HostRule.prototype.description = null; + + /** + * HostRule hosts. + * @member {Array.} hosts + * @memberof google.cloud.compute.v1.HostRule + * @instance + */ + HostRule.prototype.hosts = $util.emptyArray; + + /** + * HostRule pathMatcher. + * @member {string|null|undefined} pathMatcher + * @memberof google.cloud.compute.v1.HostRule + * @instance + */ + HostRule.prototype.pathMatcher = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HostRule _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.HostRule + * @instance + */ + Object.defineProperty(HostRule.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HostRule _pathMatcher. + * @member {"pathMatcher"|undefined} _pathMatcher + * @memberof google.cloud.compute.v1.HostRule + * @instance + */ + Object.defineProperty(HostRule.prototype, "_pathMatcher", { + get: $util.oneOfGetter($oneOfFields = ["pathMatcher"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HostRule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {google.cloud.compute.v1.IHostRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HostRule} HostRule instance + */ + HostRule.create = function create(properties) { + return new HostRule(properties); + }; + + /** + * Encodes the specified HostRule message. Does not implicitly {@link google.cloud.compute.v1.HostRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {google.cloud.compute.v1.IHostRule} message HostRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HostRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hosts != null && message.hosts.length) + for (var i = 0; i < message.hosts.length; ++i) + writer.uint32(/* id 99467211, wireType 2 =*/795737690).string(message.hosts[i]); + if (message.pathMatcher != null && Object.hasOwnProperty.call(message, "pathMatcher")) + writer.uint32(/* id 337813272, wireType 2 =*/2702506178).string(message.pathMatcher); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + return writer; + }; + + /** + * Encodes the specified HostRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HostRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {google.cloud.compute.v1.IHostRule} message HostRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HostRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HostRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HostRule} HostRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HostRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HostRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 99467211: + if (!(message.hosts && message.hosts.length)) + message.hosts = []; + message.hosts.push(reader.string()); + break; + case 337813272: + message.pathMatcher = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HostRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HostRule} HostRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HostRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HostRule message. + * @function verify + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HostRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.hosts != null && message.hasOwnProperty("hosts")) { + if (!Array.isArray(message.hosts)) + return "hosts: array expected"; + for (var i = 0; i < message.hosts.length; ++i) + if (!$util.isString(message.hosts[i])) + return "hosts: string[] expected"; + } + if (message.pathMatcher != null && message.hasOwnProperty("pathMatcher")) { + properties._pathMatcher = 1; + if (!$util.isString(message.pathMatcher)) + return "pathMatcher: string expected"; + } + return null; + }; + + /** + * Creates a HostRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HostRule} HostRule + */ + HostRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HostRule) + return object; + var message = new $root.google.cloud.compute.v1.HostRule(); + if (object.description != null) + message.description = String(object.description); + if (object.hosts) { + if (!Array.isArray(object.hosts)) + throw TypeError(".google.cloud.compute.v1.HostRule.hosts: array expected"); + message.hosts = []; + for (var i = 0; i < object.hosts.length; ++i) + message.hosts[i] = String(object.hosts[i]); + } + if (object.pathMatcher != null) + message.pathMatcher = String(object.pathMatcher); + return message; + }; + + /** + * Creates a plain object from a HostRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HostRule + * @static + * @param {google.cloud.compute.v1.HostRule} message HostRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HostRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.hosts = []; + if (message.hosts && message.hosts.length) { + object.hosts = []; + for (var j = 0; j < message.hosts.length; ++j) + object.hosts[j] = message.hosts[j]; + } + if (message.pathMatcher != null && message.hasOwnProperty("pathMatcher")) { + object.pathMatcher = message.pathMatcher; + if (options.oneofs) + object._pathMatcher = "pathMatcher"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + return object; + }; + + /** + * Converts this HostRule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HostRule + * @instance + * @returns {Object.} JSON object + */ + HostRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HostRule; + })(); + + v1.HttpFaultAbort = (function() { + + /** + * Properties of a HttpFaultAbort. + * @memberof google.cloud.compute.v1 + * @interface IHttpFaultAbort + * @property {number|null} [httpStatus] HttpFaultAbort httpStatus + * @property {number|null} [percentage] HttpFaultAbort percentage + */ + + /** + * Constructs a new HttpFaultAbort. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpFaultAbort. + * @implements IHttpFaultAbort + * @constructor + * @param {google.cloud.compute.v1.IHttpFaultAbort=} [properties] Properties to set + */ + function HttpFaultAbort(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpFaultAbort httpStatus. + * @member {number|null|undefined} httpStatus + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @instance + */ + HttpFaultAbort.prototype.httpStatus = null; + + /** + * HttpFaultAbort percentage. + * @member {number|null|undefined} percentage + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @instance + */ + HttpFaultAbort.prototype.percentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpFaultAbort _httpStatus. + * @member {"httpStatus"|undefined} _httpStatus + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @instance + */ + Object.defineProperty(HttpFaultAbort.prototype, "_httpStatus", { + get: $util.oneOfGetter($oneOfFields = ["httpStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpFaultAbort _percentage. + * @member {"percentage"|undefined} _percentage + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @instance + */ + Object.defineProperty(HttpFaultAbort.prototype, "_percentage", { + get: $util.oneOfGetter($oneOfFields = ["percentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpFaultAbort instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {google.cloud.compute.v1.IHttpFaultAbort=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpFaultAbort} HttpFaultAbort instance + */ + HttpFaultAbort.create = function create(properties) { + return new HttpFaultAbort(properties); + }; + + /** + * Encodes the specified HttpFaultAbort message. Does not implicitly {@link google.cloud.compute.v1.HttpFaultAbort.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {google.cloud.compute.v1.IHttpFaultAbort} message HttpFaultAbort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpFaultAbort.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + writer.uint32(/* id 151909018, wireType 1 =*/1215272145).double(message.percentage); + if (message.httpStatus != null && Object.hasOwnProperty.call(message, "httpStatus")) + writer.uint32(/* id 468949897, wireType 0 =*/3751599176).uint32(message.httpStatus); + return writer; + }; + + /** + * Encodes the specified HttpFaultAbort message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpFaultAbort.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {google.cloud.compute.v1.IHttpFaultAbort} message HttpFaultAbort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpFaultAbort.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpFaultAbort message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpFaultAbort} HttpFaultAbort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpFaultAbort.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpFaultAbort(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 468949897: + message.httpStatus = reader.uint32(); + break; + case 151909018: + message.percentage = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpFaultAbort message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpFaultAbort} HttpFaultAbort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpFaultAbort.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpFaultAbort message. + * @function verify + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpFaultAbort.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.httpStatus != null && message.hasOwnProperty("httpStatus")) { + properties._httpStatus = 1; + if (!$util.isInteger(message.httpStatus)) + return "httpStatus: integer expected"; + } + if (message.percentage != null && message.hasOwnProperty("percentage")) { + properties._percentage = 1; + if (typeof message.percentage !== "number") + return "percentage: number expected"; + } + return null; + }; + + /** + * Creates a HttpFaultAbort message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpFaultAbort} HttpFaultAbort + */ + HttpFaultAbort.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpFaultAbort) + return object; + var message = new $root.google.cloud.compute.v1.HttpFaultAbort(); + if (object.httpStatus != null) + message.httpStatus = object.httpStatus >>> 0; + if (object.percentage != null) + message.percentage = Number(object.percentage); + return message; + }; + + /** + * Creates a plain object from a HttpFaultAbort message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @static + * @param {google.cloud.compute.v1.HttpFaultAbort} message HttpFaultAbort + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpFaultAbort.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.percentage != null && message.hasOwnProperty("percentage")) { + object.percentage = options.json && !isFinite(message.percentage) ? String(message.percentage) : message.percentage; + if (options.oneofs) + object._percentage = "percentage"; + } + if (message.httpStatus != null && message.hasOwnProperty("httpStatus")) { + object.httpStatus = message.httpStatus; + if (options.oneofs) + object._httpStatus = "httpStatus"; + } + return object; + }; + + /** + * Converts this HttpFaultAbort to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpFaultAbort + * @instance + * @returns {Object.} JSON object + */ + HttpFaultAbort.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpFaultAbort; + })(); + + v1.HttpFaultDelay = (function() { + + /** + * Properties of a HttpFaultDelay. + * @memberof google.cloud.compute.v1 + * @interface IHttpFaultDelay + * @property {google.cloud.compute.v1.IDuration|null} [fixedDelay] HttpFaultDelay fixedDelay + * @property {number|null} [percentage] HttpFaultDelay percentage + */ + + /** + * Constructs a new HttpFaultDelay. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpFaultDelay. + * @implements IHttpFaultDelay + * @constructor + * @param {google.cloud.compute.v1.IHttpFaultDelay=} [properties] Properties to set + */ + function HttpFaultDelay(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpFaultDelay fixedDelay. + * @member {google.cloud.compute.v1.IDuration|null|undefined} fixedDelay + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @instance + */ + HttpFaultDelay.prototype.fixedDelay = null; + + /** + * HttpFaultDelay percentage. + * @member {number|null|undefined} percentage + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @instance + */ + HttpFaultDelay.prototype.percentage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpFaultDelay _fixedDelay. + * @member {"fixedDelay"|undefined} _fixedDelay + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @instance + */ + Object.defineProperty(HttpFaultDelay.prototype, "_fixedDelay", { + get: $util.oneOfGetter($oneOfFields = ["fixedDelay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpFaultDelay _percentage. + * @member {"percentage"|undefined} _percentage + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @instance + */ + Object.defineProperty(HttpFaultDelay.prototype, "_percentage", { + get: $util.oneOfGetter($oneOfFields = ["percentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpFaultDelay instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {google.cloud.compute.v1.IHttpFaultDelay=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpFaultDelay} HttpFaultDelay instance + */ + HttpFaultDelay.create = function create(properties) { + return new HttpFaultDelay(properties); + }; + + /** + * Encodes the specified HttpFaultDelay message. Does not implicitly {@link google.cloud.compute.v1.HttpFaultDelay.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {google.cloud.compute.v1.IHttpFaultDelay} message HttpFaultDelay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpFaultDelay.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.percentage != null && Object.hasOwnProperty.call(message, "percentage")) + writer.uint32(/* id 151909018, wireType 1 =*/1215272145).double(message.percentage); + if (message.fixedDelay != null && Object.hasOwnProperty.call(message, "fixedDelay")) + $root.google.cloud.compute.v1.Duration.encode(message.fixedDelay, writer.uint32(/* id 317037816, wireType 2 =*/2536302530).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpFaultDelay message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpFaultDelay.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {google.cloud.compute.v1.IHttpFaultDelay} message HttpFaultDelay message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpFaultDelay.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpFaultDelay message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpFaultDelay} HttpFaultDelay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpFaultDelay.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpFaultDelay(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 317037816: + message.fixedDelay = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 151909018: + message.percentage = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpFaultDelay message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpFaultDelay} HttpFaultDelay + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpFaultDelay.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpFaultDelay message. + * @function verify + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpFaultDelay.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fixedDelay != null && message.hasOwnProperty("fixedDelay")) { + properties._fixedDelay = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.fixedDelay); + if (error) + return "fixedDelay." + error; + } + } + if (message.percentage != null && message.hasOwnProperty("percentage")) { + properties._percentage = 1; + if (typeof message.percentage !== "number") + return "percentage: number expected"; + } + return null; + }; + + /** + * Creates a HttpFaultDelay message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpFaultDelay} HttpFaultDelay + */ + HttpFaultDelay.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpFaultDelay) + return object; + var message = new $root.google.cloud.compute.v1.HttpFaultDelay(); + if (object.fixedDelay != null) { + if (typeof object.fixedDelay !== "object") + throw TypeError(".google.cloud.compute.v1.HttpFaultDelay.fixedDelay: object expected"); + message.fixedDelay = $root.google.cloud.compute.v1.Duration.fromObject(object.fixedDelay); + } + if (object.percentage != null) + message.percentage = Number(object.percentage); + return message; + }; + + /** + * Creates a plain object from a HttpFaultDelay message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @static + * @param {google.cloud.compute.v1.HttpFaultDelay} message HttpFaultDelay + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpFaultDelay.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.percentage != null && message.hasOwnProperty("percentage")) { + object.percentage = options.json && !isFinite(message.percentage) ? String(message.percentage) : message.percentage; + if (options.oneofs) + object._percentage = "percentage"; + } + if (message.fixedDelay != null && message.hasOwnProperty("fixedDelay")) { + object.fixedDelay = $root.google.cloud.compute.v1.Duration.toObject(message.fixedDelay, options); + if (options.oneofs) + object._fixedDelay = "fixedDelay"; + } + return object; + }; + + /** + * Converts this HttpFaultDelay to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpFaultDelay + * @instance + * @returns {Object.} JSON object + */ + HttpFaultDelay.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpFaultDelay; + })(); + + v1.HttpFaultInjection = (function() { + + /** + * Properties of a HttpFaultInjection. + * @memberof google.cloud.compute.v1 + * @interface IHttpFaultInjection + * @property {google.cloud.compute.v1.IHttpFaultAbort|null} [abort] HttpFaultInjection abort + * @property {google.cloud.compute.v1.IHttpFaultDelay|null} [delay] HttpFaultInjection delay + */ + + /** + * Constructs a new HttpFaultInjection. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpFaultInjection. + * @implements IHttpFaultInjection + * @constructor + * @param {google.cloud.compute.v1.IHttpFaultInjection=} [properties] Properties to set + */ + function HttpFaultInjection(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpFaultInjection abort. + * @member {google.cloud.compute.v1.IHttpFaultAbort|null|undefined} abort + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @instance + */ + HttpFaultInjection.prototype.abort = null; + + /** + * HttpFaultInjection delay. + * @member {google.cloud.compute.v1.IHttpFaultDelay|null|undefined} delay + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @instance + */ + HttpFaultInjection.prototype.delay = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpFaultInjection _abort. + * @member {"abort"|undefined} _abort + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @instance + */ + Object.defineProperty(HttpFaultInjection.prototype, "_abort", { + get: $util.oneOfGetter($oneOfFields = ["abort"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpFaultInjection _delay. + * @member {"delay"|undefined} _delay + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @instance + */ + Object.defineProperty(HttpFaultInjection.prototype, "_delay", { + get: $util.oneOfGetter($oneOfFields = ["delay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpFaultInjection instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {google.cloud.compute.v1.IHttpFaultInjection=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpFaultInjection} HttpFaultInjection instance + */ + HttpFaultInjection.create = function create(properties) { + return new HttpFaultInjection(properties); + }; + + /** + * Encodes the specified HttpFaultInjection message. Does not implicitly {@link google.cloud.compute.v1.HttpFaultInjection.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {google.cloud.compute.v1.IHttpFaultInjection} message HttpFaultInjection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpFaultInjection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.abort != null && Object.hasOwnProperty.call(message, "abort")) + $root.google.cloud.compute.v1.HttpFaultAbort.encode(message.abort, writer.uint32(/* id 92611376, wireType 2 =*/740891010).fork()).ldelim(); + if (message.delay != null && Object.hasOwnProperty.call(message, "delay")) + $root.google.cloud.compute.v1.HttpFaultDelay.encode(message.delay, writer.uint32(/* id 95467907, wireType 2 =*/763743258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpFaultInjection message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpFaultInjection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {google.cloud.compute.v1.IHttpFaultInjection} message HttpFaultInjection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpFaultInjection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpFaultInjection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpFaultInjection} HttpFaultInjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpFaultInjection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpFaultInjection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 92611376: + message.abort = $root.google.cloud.compute.v1.HttpFaultAbort.decode(reader, reader.uint32()); + break; + case 95467907: + message.delay = $root.google.cloud.compute.v1.HttpFaultDelay.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpFaultInjection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpFaultInjection} HttpFaultInjection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpFaultInjection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpFaultInjection message. + * @function verify + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpFaultInjection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.abort != null && message.hasOwnProperty("abort")) { + properties._abort = 1; + { + var error = $root.google.cloud.compute.v1.HttpFaultAbort.verify(message.abort); + if (error) + return "abort." + error; + } + } + if (message.delay != null && message.hasOwnProperty("delay")) { + properties._delay = 1; + { + var error = $root.google.cloud.compute.v1.HttpFaultDelay.verify(message.delay); + if (error) + return "delay." + error; + } + } + return null; + }; + + /** + * Creates a HttpFaultInjection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpFaultInjection} HttpFaultInjection + */ + HttpFaultInjection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpFaultInjection) + return object; + var message = new $root.google.cloud.compute.v1.HttpFaultInjection(); + if (object.abort != null) { + if (typeof object.abort !== "object") + throw TypeError(".google.cloud.compute.v1.HttpFaultInjection.abort: object expected"); + message.abort = $root.google.cloud.compute.v1.HttpFaultAbort.fromObject(object.abort); + } + if (object.delay != null) { + if (typeof object.delay !== "object") + throw TypeError(".google.cloud.compute.v1.HttpFaultInjection.delay: object expected"); + message.delay = $root.google.cloud.compute.v1.HttpFaultDelay.fromObject(object.delay); + } + return message; + }; + + /** + * Creates a plain object from a HttpFaultInjection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @static + * @param {google.cloud.compute.v1.HttpFaultInjection} message HttpFaultInjection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpFaultInjection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.abort != null && message.hasOwnProperty("abort")) { + object.abort = $root.google.cloud.compute.v1.HttpFaultAbort.toObject(message.abort, options); + if (options.oneofs) + object._abort = "abort"; + } + if (message.delay != null && message.hasOwnProperty("delay")) { + object.delay = $root.google.cloud.compute.v1.HttpFaultDelay.toObject(message.delay, options); + if (options.oneofs) + object._delay = "delay"; + } + return object; + }; + + /** + * Converts this HttpFaultInjection to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpFaultInjection + * @instance + * @returns {Object.} JSON object + */ + HttpFaultInjection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpFaultInjection; + })(); + + v1.HttpHeaderOption = (function() { + + /** + * Properties of a HttpHeaderOption. + * @memberof google.cloud.compute.v1 + * @interface IHttpHeaderOption + * @property {string|null} [headerName] HttpHeaderOption headerName + * @property {string|null} [headerValue] HttpHeaderOption headerValue + * @property {boolean|null} [replace] HttpHeaderOption replace + */ + + /** + * Constructs a new HttpHeaderOption. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpHeaderOption. + * @implements IHttpHeaderOption + * @constructor + * @param {google.cloud.compute.v1.IHttpHeaderOption=} [properties] Properties to set + */ + function HttpHeaderOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpHeaderOption headerName. + * @member {string|null|undefined} headerName + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @instance + */ + HttpHeaderOption.prototype.headerName = null; + + /** + * HttpHeaderOption headerValue. + * @member {string|null|undefined} headerValue + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @instance + */ + HttpHeaderOption.prototype.headerValue = null; + + /** + * HttpHeaderOption replace. + * @member {boolean|null|undefined} replace + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @instance + */ + HttpHeaderOption.prototype.replace = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpHeaderOption _headerName. + * @member {"headerName"|undefined} _headerName + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @instance + */ + Object.defineProperty(HttpHeaderOption.prototype, "_headerName", { + get: $util.oneOfGetter($oneOfFields = ["headerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderOption _headerValue. + * @member {"headerValue"|undefined} _headerValue + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @instance + */ + Object.defineProperty(HttpHeaderOption.prototype, "_headerValue", { + get: $util.oneOfGetter($oneOfFields = ["headerValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderOption _replace. + * @member {"replace"|undefined} _replace + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @instance + */ + Object.defineProperty(HttpHeaderOption.prototype, "_replace", { + get: $util.oneOfGetter($oneOfFields = ["replace"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpHeaderOption instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {google.cloud.compute.v1.IHttpHeaderOption=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpHeaderOption} HttpHeaderOption instance + */ + HttpHeaderOption.create = function create(properties) { + return new HttpHeaderOption(properties); + }; + + /** + * Encodes the specified HttpHeaderOption message. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderOption.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {google.cloud.compute.v1.IHttpHeaderOption} message HttpHeaderOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeaderOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 20755124, wireType 0 =*/166040992).bool(message.replace); + if (message.headerName != null && Object.hasOwnProperty.call(message, "headerName")) + writer.uint32(/* id 110223613, wireType 2 =*/881788906).string(message.headerName); + if (message.headerValue != null && Object.hasOwnProperty.call(message, "headerValue")) + writer.uint32(/* id 203094335, wireType 2 =*/1624754682).string(message.headerValue); + return writer; + }; + + /** + * Encodes the specified HttpHeaderOption message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {google.cloud.compute.v1.IHttpHeaderOption} message HttpHeaderOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeaderOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpHeaderOption message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpHeaderOption} HttpHeaderOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeaderOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpHeaderOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 110223613: + message.headerName = reader.string(); + break; + case 203094335: + message.headerValue = reader.string(); + break; + case 20755124: + message.replace = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpHeaderOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpHeaderOption} HttpHeaderOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeaderOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpHeaderOption message. + * @function verify + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpHeaderOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.headerName != null && message.hasOwnProperty("headerName")) { + properties._headerName = 1; + if (!$util.isString(message.headerName)) + return "headerName: string expected"; + } + if (message.headerValue != null && message.hasOwnProperty("headerValue")) { + properties._headerValue = 1; + if (!$util.isString(message.headerValue)) + return "headerValue: string expected"; + } + if (message.replace != null && message.hasOwnProperty("replace")) { + properties._replace = 1; + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + } + return null; + }; + + /** + * Creates a HttpHeaderOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpHeaderOption} HttpHeaderOption + */ + HttpHeaderOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpHeaderOption) + return object; + var message = new $root.google.cloud.compute.v1.HttpHeaderOption(); + if (object.headerName != null) + message.headerName = String(object.headerName); + if (object.headerValue != null) + message.headerValue = String(object.headerValue); + if (object.replace != null) + message.replace = Boolean(object.replace); + return message; + }; + + /** + * Creates a plain object from a HttpHeaderOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @static + * @param {google.cloud.compute.v1.HttpHeaderOption} message HttpHeaderOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpHeaderOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.replace != null && message.hasOwnProperty("replace")) { + object.replace = message.replace; + if (options.oneofs) + object._replace = "replace"; + } + if (message.headerName != null && message.hasOwnProperty("headerName")) { + object.headerName = message.headerName; + if (options.oneofs) + object._headerName = "headerName"; + } + if (message.headerValue != null && message.hasOwnProperty("headerValue")) { + object.headerValue = message.headerValue; + if (options.oneofs) + object._headerValue = "headerValue"; + } + return object; + }; + + /** + * Converts this HttpHeaderOption to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpHeaderOption + * @instance + * @returns {Object.} JSON object + */ + HttpHeaderOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpHeaderOption; + })(); + + v1.HttpHeaderAction = (function() { + + /** + * Properties of a HttpHeaderAction. + * @memberof google.cloud.compute.v1 + * @interface IHttpHeaderAction + * @property {Array.|null} [requestHeadersToAdd] HttpHeaderAction requestHeadersToAdd + * @property {Array.|null} [requestHeadersToRemove] HttpHeaderAction requestHeadersToRemove + * @property {Array.|null} [responseHeadersToAdd] HttpHeaderAction responseHeadersToAdd + * @property {Array.|null} [responseHeadersToRemove] HttpHeaderAction responseHeadersToRemove + */ + + /** + * Constructs a new HttpHeaderAction. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpHeaderAction. + * @implements IHttpHeaderAction + * @constructor + * @param {google.cloud.compute.v1.IHttpHeaderAction=} [properties] Properties to set + */ + function HttpHeaderAction(properties) { + this.requestHeadersToAdd = []; + this.requestHeadersToRemove = []; + this.responseHeadersToAdd = []; + this.responseHeadersToRemove = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpHeaderAction requestHeadersToAdd. + * @member {Array.} requestHeadersToAdd + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @instance + */ + HttpHeaderAction.prototype.requestHeadersToAdd = $util.emptyArray; + + /** + * HttpHeaderAction requestHeadersToRemove. + * @member {Array.} requestHeadersToRemove + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @instance + */ + HttpHeaderAction.prototype.requestHeadersToRemove = $util.emptyArray; + + /** + * HttpHeaderAction responseHeadersToAdd. + * @member {Array.} responseHeadersToAdd + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @instance + */ + HttpHeaderAction.prototype.responseHeadersToAdd = $util.emptyArray; + + /** + * HttpHeaderAction responseHeadersToRemove. + * @member {Array.} responseHeadersToRemove + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @instance + */ + HttpHeaderAction.prototype.responseHeadersToRemove = $util.emptyArray; + + /** + * Creates a new HttpHeaderAction instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {google.cloud.compute.v1.IHttpHeaderAction=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpHeaderAction} HttpHeaderAction instance + */ + HttpHeaderAction.create = function create(properties) { + return new HttpHeaderAction(properties); + }; + + /** + * Encodes the specified HttpHeaderAction message. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {google.cloud.compute.v1.IHttpHeaderAction} message HttpHeaderAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeaderAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseHeadersToAdd != null && message.responseHeadersToAdd.length) + for (var i = 0; i < message.responseHeadersToAdd.length; ++i) + $root.google.cloud.compute.v1.HttpHeaderOption.encode(message.responseHeadersToAdd[i], writer.uint32(/* id 32136052, wireType 2 =*/257088418).fork()).ldelim(); + if (message.requestHeadersToAdd != null && message.requestHeadersToAdd.length) + for (var i = 0; i < message.requestHeadersToAdd.length; ++i) + $root.google.cloud.compute.v1.HttpHeaderOption.encode(message.requestHeadersToAdd[i], writer.uint32(/* id 72111974, wireType 2 =*/576895794).fork()).ldelim(); + if (message.responseHeadersToRemove != null && message.responseHeadersToRemove.length) + for (var i = 0; i < message.responseHeadersToRemove.length; ++i) + writer.uint32(/* id 75415761, wireType 2 =*/603326090).string(message.responseHeadersToRemove[i]); + if (message.requestHeadersToRemove != null && message.requestHeadersToRemove.length) + for (var i = 0; i < message.requestHeadersToRemove.length; ++i) + writer.uint32(/* id 218425247, wireType 2 =*/1747401978).string(message.requestHeadersToRemove[i]); + return writer; + }; + + /** + * Encodes the specified HttpHeaderAction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {google.cloud.compute.v1.IHttpHeaderAction} message HttpHeaderAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeaderAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpHeaderAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpHeaderAction} HttpHeaderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeaderAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpHeaderAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 72111974: + if (!(message.requestHeadersToAdd && message.requestHeadersToAdd.length)) + message.requestHeadersToAdd = []; + message.requestHeadersToAdd.push($root.google.cloud.compute.v1.HttpHeaderOption.decode(reader, reader.uint32())); + break; + case 218425247: + if (!(message.requestHeadersToRemove && message.requestHeadersToRemove.length)) + message.requestHeadersToRemove = []; + message.requestHeadersToRemove.push(reader.string()); + break; + case 32136052: + if (!(message.responseHeadersToAdd && message.responseHeadersToAdd.length)) + message.responseHeadersToAdd = []; + message.responseHeadersToAdd.push($root.google.cloud.compute.v1.HttpHeaderOption.decode(reader, reader.uint32())); + break; + case 75415761: + if (!(message.responseHeadersToRemove && message.responseHeadersToRemove.length)) + message.responseHeadersToRemove = []; + message.responseHeadersToRemove.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpHeaderAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpHeaderAction} HttpHeaderAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeaderAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpHeaderAction message. + * @function verify + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpHeaderAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requestHeadersToAdd != null && message.hasOwnProperty("requestHeadersToAdd")) { + if (!Array.isArray(message.requestHeadersToAdd)) + return "requestHeadersToAdd: array expected"; + for (var i = 0; i < message.requestHeadersToAdd.length; ++i) { + var error = $root.google.cloud.compute.v1.HttpHeaderOption.verify(message.requestHeadersToAdd[i]); + if (error) + return "requestHeadersToAdd." + error; + } + } + if (message.requestHeadersToRemove != null && message.hasOwnProperty("requestHeadersToRemove")) { + if (!Array.isArray(message.requestHeadersToRemove)) + return "requestHeadersToRemove: array expected"; + for (var i = 0; i < message.requestHeadersToRemove.length; ++i) + if (!$util.isString(message.requestHeadersToRemove[i])) + return "requestHeadersToRemove: string[] expected"; + } + if (message.responseHeadersToAdd != null && message.hasOwnProperty("responseHeadersToAdd")) { + if (!Array.isArray(message.responseHeadersToAdd)) + return "responseHeadersToAdd: array expected"; + for (var i = 0; i < message.responseHeadersToAdd.length; ++i) { + var error = $root.google.cloud.compute.v1.HttpHeaderOption.verify(message.responseHeadersToAdd[i]); + if (error) + return "responseHeadersToAdd." + error; + } + } + if (message.responseHeadersToRemove != null && message.hasOwnProperty("responseHeadersToRemove")) { + if (!Array.isArray(message.responseHeadersToRemove)) + return "responseHeadersToRemove: array expected"; + for (var i = 0; i < message.responseHeadersToRemove.length; ++i) + if (!$util.isString(message.responseHeadersToRemove[i])) + return "responseHeadersToRemove: string[] expected"; + } + return null; + }; + + /** + * Creates a HttpHeaderAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpHeaderAction} HttpHeaderAction + */ + HttpHeaderAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpHeaderAction) + return object; + var message = new $root.google.cloud.compute.v1.HttpHeaderAction(); + if (object.requestHeadersToAdd) { + if (!Array.isArray(object.requestHeadersToAdd)) + throw TypeError(".google.cloud.compute.v1.HttpHeaderAction.requestHeadersToAdd: array expected"); + message.requestHeadersToAdd = []; + for (var i = 0; i < object.requestHeadersToAdd.length; ++i) { + if (typeof object.requestHeadersToAdd[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HttpHeaderAction.requestHeadersToAdd: object expected"); + message.requestHeadersToAdd[i] = $root.google.cloud.compute.v1.HttpHeaderOption.fromObject(object.requestHeadersToAdd[i]); + } + } + if (object.requestHeadersToRemove) { + if (!Array.isArray(object.requestHeadersToRemove)) + throw TypeError(".google.cloud.compute.v1.HttpHeaderAction.requestHeadersToRemove: array expected"); + message.requestHeadersToRemove = []; + for (var i = 0; i < object.requestHeadersToRemove.length; ++i) + message.requestHeadersToRemove[i] = String(object.requestHeadersToRemove[i]); + } + if (object.responseHeadersToAdd) { + if (!Array.isArray(object.responseHeadersToAdd)) + throw TypeError(".google.cloud.compute.v1.HttpHeaderAction.responseHeadersToAdd: array expected"); + message.responseHeadersToAdd = []; + for (var i = 0; i < object.responseHeadersToAdd.length; ++i) { + if (typeof object.responseHeadersToAdd[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HttpHeaderAction.responseHeadersToAdd: object expected"); + message.responseHeadersToAdd[i] = $root.google.cloud.compute.v1.HttpHeaderOption.fromObject(object.responseHeadersToAdd[i]); + } + } + if (object.responseHeadersToRemove) { + if (!Array.isArray(object.responseHeadersToRemove)) + throw TypeError(".google.cloud.compute.v1.HttpHeaderAction.responseHeadersToRemove: array expected"); + message.responseHeadersToRemove = []; + for (var i = 0; i < object.responseHeadersToRemove.length; ++i) + message.responseHeadersToRemove[i] = String(object.responseHeadersToRemove[i]); + } + return message; + }; + + /** + * Creates a plain object from a HttpHeaderAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @static + * @param {google.cloud.compute.v1.HttpHeaderAction} message HttpHeaderAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpHeaderAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.responseHeadersToAdd = []; + object.requestHeadersToAdd = []; + object.responseHeadersToRemove = []; + object.requestHeadersToRemove = []; + } + if (message.responseHeadersToAdd && message.responseHeadersToAdd.length) { + object.responseHeadersToAdd = []; + for (var j = 0; j < message.responseHeadersToAdd.length; ++j) + object.responseHeadersToAdd[j] = $root.google.cloud.compute.v1.HttpHeaderOption.toObject(message.responseHeadersToAdd[j], options); + } + if (message.requestHeadersToAdd && message.requestHeadersToAdd.length) { + object.requestHeadersToAdd = []; + for (var j = 0; j < message.requestHeadersToAdd.length; ++j) + object.requestHeadersToAdd[j] = $root.google.cloud.compute.v1.HttpHeaderOption.toObject(message.requestHeadersToAdd[j], options); + } + if (message.responseHeadersToRemove && message.responseHeadersToRemove.length) { + object.responseHeadersToRemove = []; + for (var j = 0; j < message.responseHeadersToRemove.length; ++j) + object.responseHeadersToRemove[j] = message.responseHeadersToRemove[j]; + } + if (message.requestHeadersToRemove && message.requestHeadersToRemove.length) { + object.requestHeadersToRemove = []; + for (var j = 0; j < message.requestHeadersToRemove.length; ++j) + object.requestHeadersToRemove[j] = message.requestHeadersToRemove[j]; + } + return object; + }; + + /** + * Converts this HttpHeaderAction to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpHeaderAction + * @instance + * @returns {Object.} JSON object + */ + HttpHeaderAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpHeaderAction; + })(); + + v1.Int64RangeMatch = (function() { + + /** + * Properties of an Int64RangeMatch. + * @memberof google.cloud.compute.v1 + * @interface IInt64RangeMatch + * @property {number|Long|null} [rangeEnd] Int64RangeMatch rangeEnd + * @property {number|Long|null} [rangeStart] Int64RangeMatch rangeStart + */ + + /** + * Constructs a new Int64RangeMatch. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Int64RangeMatch. + * @implements IInt64RangeMatch + * @constructor + * @param {google.cloud.compute.v1.IInt64RangeMatch=} [properties] Properties to set + */ + function Int64RangeMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64RangeMatch rangeEnd. + * @member {number|Long|null|undefined} rangeEnd + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @instance + */ + Int64RangeMatch.prototype.rangeEnd = null; + + /** + * Int64RangeMatch rangeStart. + * @member {number|Long|null|undefined} rangeStart + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @instance + */ + Int64RangeMatch.prototype.rangeStart = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Int64RangeMatch _rangeEnd. + * @member {"rangeEnd"|undefined} _rangeEnd + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @instance + */ + Object.defineProperty(Int64RangeMatch.prototype, "_rangeEnd", { + get: $util.oneOfGetter($oneOfFields = ["rangeEnd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Int64RangeMatch _rangeStart. + * @member {"rangeStart"|undefined} _rangeStart + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @instance + */ + Object.defineProperty(Int64RangeMatch.prototype, "_rangeStart", { + get: $util.oneOfGetter($oneOfFields = ["rangeStart"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Int64RangeMatch instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {google.cloud.compute.v1.IInt64RangeMatch=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Int64RangeMatch} Int64RangeMatch instance + */ + Int64RangeMatch.create = function create(properties) { + return new Int64RangeMatch(properties); + }; + + /** + * Encodes the specified Int64RangeMatch message. Does not implicitly {@link google.cloud.compute.v1.Int64RangeMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {google.cloud.compute.v1.IInt64RangeMatch} message Int64RangeMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64RangeMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rangeStart != null && Object.hasOwnProperty.call(message, "rangeStart")) + writer.uint32(/* id 103333600, wireType 0 =*/826668800).int64(message.rangeStart); + if (message.rangeEnd != null && Object.hasOwnProperty.call(message, "rangeEnd")) + writer.uint32(/* id 322439897, wireType 0 =*/2579519176).int64(message.rangeEnd); + return writer; + }; + + /** + * Encodes the specified Int64RangeMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Int64RangeMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {google.cloud.compute.v1.IInt64RangeMatch} message Int64RangeMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64RangeMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64RangeMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Int64RangeMatch} Int64RangeMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64RangeMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Int64RangeMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 322439897: + message.rangeEnd = reader.int64(); + break; + case 103333600: + message.rangeStart = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64RangeMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Int64RangeMatch} Int64RangeMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64RangeMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64RangeMatch message. + * @function verify + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64RangeMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rangeEnd != null && message.hasOwnProperty("rangeEnd")) { + properties._rangeEnd = 1; + if (!$util.isInteger(message.rangeEnd) && !(message.rangeEnd && $util.isInteger(message.rangeEnd.low) && $util.isInteger(message.rangeEnd.high))) + return "rangeEnd: integer|Long expected"; + } + if (message.rangeStart != null && message.hasOwnProperty("rangeStart")) { + properties._rangeStart = 1; + if (!$util.isInteger(message.rangeStart) && !(message.rangeStart && $util.isInteger(message.rangeStart.low) && $util.isInteger(message.rangeStart.high))) + return "rangeStart: integer|Long expected"; + } + return null; + }; + + /** + * Creates an Int64RangeMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Int64RangeMatch} Int64RangeMatch + */ + Int64RangeMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Int64RangeMatch) + return object; + var message = new $root.google.cloud.compute.v1.Int64RangeMatch(); + if (object.rangeEnd != null) + if ($util.Long) + (message.rangeEnd = $util.Long.fromValue(object.rangeEnd)).unsigned = false; + else if (typeof object.rangeEnd === "string") + message.rangeEnd = parseInt(object.rangeEnd, 10); + else if (typeof object.rangeEnd === "number") + message.rangeEnd = object.rangeEnd; + else if (typeof object.rangeEnd === "object") + message.rangeEnd = new $util.LongBits(object.rangeEnd.low >>> 0, object.rangeEnd.high >>> 0).toNumber(); + if (object.rangeStart != null) + if ($util.Long) + (message.rangeStart = $util.Long.fromValue(object.rangeStart)).unsigned = false; + else if (typeof object.rangeStart === "string") + message.rangeStart = parseInt(object.rangeStart, 10); + else if (typeof object.rangeStart === "number") + message.rangeStart = object.rangeStart; + else if (typeof object.rangeStart === "object") + message.rangeStart = new $util.LongBits(object.rangeStart.low >>> 0, object.rangeStart.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64RangeMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @static + * @param {google.cloud.compute.v1.Int64RangeMatch} message Int64RangeMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64RangeMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rangeStart != null && message.hasOwnProperty("rangeStart")) { + if (typeof message.rangeStart === "number") + object.rangeStart = options.longs === String ? String(message.rangeStart) : message.rangeStart; + else + object.rangeStart = options.longs === String ? $util.Long.prototype.toString.call(message.rangeStart) : options.longs === Number ? new $util.LongBits(message.rangeStart.low >>> 0, message.rangeStart.high >>> 0).toNumber() : message.rangeStart; + if (options.oneofs) + object._rangeStart = "rangeStart"; + } + if (message.rangeEnd != null && message.hasOwnProperty("rangeEnd")) { + if (typeof message.rangeEnd === "number") + object.rangeEnd = options.longs === String ? String(message.rangeEnd) : message.rangeEnd; + else + object.rangeEnd = options.longs === String ? $util.Long.prototype.toString.call(message.rangeEnd) : options.longs === Number ? new $util.LongBits(message.rangeEnd.low >>> 0, message.rangeEnd.high >>> 0).toNumber() : message.rangeEnd; + if (options.oneofs) + object._rangeEnd = "rangeEnd"; + } + return object; + }; + + /** + * Converts this Int64RangeMatch to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Int64RangeMatch + * @instance + * @returns {Object.} JSON object + */ + Int64RangeMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64RangeMatch; + })(); + + v1.HttpHeaderMatch = (function() { + + /** + * Properties of a HttpHeaderMatch. + * @memberof google.cloud.compute.v1 + * @interface IHttpHeaderMatch + * @property {string|null} [exactMatch] HttpHeaderMatch exactMatch + * @property {string|null} [headerName] HttpHeaderMatch headerName + * @property {boolean|null} [invertMatch] HttpHeaderMatch invertMatch + * @property {string|null} [prefixMatch] HttpHeaderMatch prefixMatch + * @property {boolean|null} [presentMatch] HttpHeaderMatch presentMatch + * @property {google.cloud.compute.v1.IInt64RangeMatch|null} [rangeMatch] HttpHeaderMatch rangeMatch + * @property {string|null} [regexMatch] HttpHeaderMatch regexMatch + * @property {string|null} [suffixMatch] HttpHeaderMatch suffixMatch + */ + + /** + * Constructs a new HttpHeaderMatch. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpHeaderMatch. + * @implements IHttpHeaderMatch + * @constructor + * @param {google.cloud.compute.v1.IHttpHeaderMatch=} [properties] Properties to set + */ + function HttpHeaderMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpHeaderMatch exactMatch. + * @member {string|null|undefined} exactMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.exactMatch = null; + + /** + * HttpHeaderMatch headerName. + * @member {string|null|undefined} headerName + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.headerName = null; + + /** + * HttpHeaderMatch invertMatch. + * @member {boolean|null|undefined} invertMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.invertMatch = null; + + /** + * HttpHeaderMatch prefixMatch. + * @member {string|null|undefined} prefixMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.prefixMatch = null; + + /** + * HttpHeaderMatch presentMatch. + * @member {boolean|null|undefined} presentMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.presentMatch = null; + + /** + * HttpHeaderMatch rangeMatch. + * @member {google.cloud.compute.v1.IInt64RangeMatch|null|undefined} rangeMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.rangeMatch = null; + + /** + * HttpHeaderMatch regexMatch. + * @member {string|null|undefined} regexMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.regexMatch = null; + + /** + * HttpHeaderMatch suffixMatch. + * @member {string|null|undefined} suffixMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + HttpHeaderMatch.prototype.suffixMatch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpHeaderMatch _exactMatch. + * @member {"exactMatch"|undefined} _exactMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_exactMatch", { + get: $util.oneOfGetter($oneOfFields = ["exactMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderMatch _headerName. + * @member {"headerName"|undefined} _headerName + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_headerName", { + get: $util.oneOfGetter($oneOfFields = ["headerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderMatch _invertMatch. + * @member {"invertMatch"|undefined} _invertMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_invertMatch", { + get: $util.oneOfGetter($oneOfFields = ["invertMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderMatch _prefixMatch. + * @member {"prefixMatch"|undefined} _prefixMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_prefixMatch", { + get: $util.oneOfGetter($oneOfFields = ["prefixMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderMatch _presentMatch. + * @member {"presentMatch"|undefined} _presentMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_presentMatch", { + get: $util.oneOfGetter($oneOfFields = ["presentMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderMatch _rangeMatch. + * @member {"rangeMatch"|undefined} _rangeMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_rangeMatch", { + get: $util.oneOfGetter($oneOfFields = ["rangeMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderMatch _regexMatch. + * @member {"regexMatch"|undefined} _regexMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_regexMatch", { + get: $util.oneOfGetter($oneOfFields = ["regexMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpHeaderMatch _suffixMatch. + * @member {"suffixMatch"|undefined} _suffixMatch + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + */ + Object.defineProperty(HttpHeaderMatch.prototype, "_suffixMatch", { + get: $util.oneOfGetter($oneOfFields = ["suffixMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpHeaderMatch instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {google.cloud.compute.v1.IHttpHeaderMatch=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpHeaderMatch} HttpHeaderMatch instance + */ + HttpHeaderMatch.create = function create(properties) { + return new HttpHeaderMatch(properties); + }; + + /** + * Encodes the specified HttpHeaderMatch message. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {google.cloud.compute.v1.IHttpHeaderMatch} message HttpHeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeaderMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.presentMatch != null && Object.hasOwnProperty.call(message, "presentMatch")) + writer.uint32(/* id 67435841, wireType 0 =*/539486728).bool(message.presentMatch); + if (message.rangeMatch != null && Object.hasOwnProperty.call(message, "rangeMatch")) + $root.google.cloud.compute.v1.Int64RangeMatch.encode(message.rangeMatch, writer.uint32(/* id 97244227, wireType 2 =*/777953818).fork()).ldelim(); + if (message.regexMatch != null && Object.hasOwnProperty.call(message, "regexMatch")) + writer.uint32(/* id 107387853, wireType 2 =*/859102826).string(message.regexMatch); + if (message.headerName != null && Object.hasOwnProperty.call(message, "headerName")) + writer.uint32(/* id 110223613, wireType 2 =*/881788906).string(message.headerName); + if (message.prefixMatch != null && Object.hasOwnProperty.call(message, "prefixMatch")) + writer.uint32(/* id 257898968, wireType 2 =*/2063191746).string(message.prefixMatch); + if (message.suffixMatch != null && Object.hasOwnProperty.call(message, "suffixMatch")) + writer.uint32(/* id 426488663, wireType 2 =*/3411909306).string(message.suffixMatch); + if (message.exactMatch != null && Object.hasOwnProperty.call(message, "exactMatch")) + writer.uint32(/* id 457641093, wireType 2 =*/3661128746).string(message.exactMatch); + if (message.invertMatch != null && Object.hasOwnProperty.call(message, "invertMatch")) + writer.uint32(/* id 501130268, wireType 0 =*/4009042144).bool(message.invertMatch); + return writer; + }; + + /** + * Encodes the specified HttpHeaderMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpHeaderMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {google.cloud.compute.v1.IHttpHeaderMatch} message HttpHeaderMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeaderMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpHeaderMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpHeaderMatch} HttpHeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeaderMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpHeaderMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 457641093: + message.exactMatch = reader.string(); + break; + case 110223613: + message.headerName = reader.string(); + break; + case 501130268: + message.invertMatch = reader.bool(); + break; + case 257898968: + message.prefixMatch = reader.string(); + break; + case 67435841: + message.presentMatch = reader.bool(); + break; + case 97244227: + message.rangeMatch = $root.google.cloud.compute.v1.Int64RangeMatch.decode(reader, reader.uint32()); + break; + case 107387853: + message.regexMatch = reader.string(); + break; + case 426488663: + message.suffixMatch = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpHeaderMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpHeaderMatch} HttpHeaderMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeaderMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpHeaderMatch message. + * @function verify + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpHeaderMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + properties._exactMatch = 1; + if (!$util.isString(message.exactMatch)) + return "exactMatch: string expected"; + } + if (message.headerName != null && message.hasOwnProperty("headerName")) { + properties._headerName = 1; + if (!$util.isString(message.headerName)) + return "headerName: string expected"; + } + if (message.invertMatch != null && message.hasOwnProperty("invertMatch")) { + properties._invertMatch = 1; + if (typeof message.invertMatch !== "boolean") + return "invertMatch: boolean expected"; + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + properties._prefixMatch = 1; + if (!$util.isString(message.prefixMatch)) + return "prefixMatch: string expected"; + } + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + properties._presentMatch = 1; + if (typeof message.presentMatch !== "boolean") + return "presentMatch: boolean expected"; + } + if (message.rangeMatch != null && message.hasOwnProperty("rangeMatch")) { + properties._rangeMatch = 1; + { + var error = $root.google.cloud.compute.v1.Int64RangeMatch.verify(message.rangeMatch); + if (error) + return "rangeMatch." + error; + } + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + properties._regexMatch = 1; + if (!$util.isString(message.regexMatch)) + return "regexMatch: string expected"; + } + if (message.suffixMatch != null && message.hasOwnProperty("suffixMatch")) { + properties._suffixMatch = 1; + if (!$util.isString(message.suffixMatch)) + return "suffixMatch: string expected"; + } + return null; + }; + + /** + * Creates a HttpHeaderMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpHeaderMatch} HttpHeaderMatch + */ + HttpHeaderMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpHeaderMatch) + return object; + var message = new $root.google.cloud.compute.v1.HttpHeaderMatch(); + if (object.exactMatch != null) + message.exactMatch = String(object.exactMatch); + if (object.headerName != null) + message.headerName = String(object.headerName); + if (object.invertMatch != null) + message.invertMatch = Boolean(object.invertMatch); + if (object.prefixMatch != null) + message.prefixMatch = String(object.prefixMatch); + if (object.presentMatch != null) + message.presentMatch = Boolean(object.presentMatch); + if (object.rangeMatch != null) { + if (typeof object.rangeMatch !== "object") + throw TypeError(".google.cloud.compute.v1.HttpHeaderMatch.rangeMatch: object expected"); + message.rangeMatch = $root.google.cloud.compute.v1.Int64RangeMatch.fromObject(object.rangeMatch); + } + if (object.regexMatch != null) + message.regexMatch = String(object.regexMatch); + if (object.suffixMatch != null) + message.suffixMatch = String(object.suffixMatch); + return message; + }; + + /** + * Creates a plain object from a HttpHeaderMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @static + * @param {google.cloud.compute.v1.HttpHeaderMatch} message HttpHeaderMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpHeaderMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + object.presentMatch = message.presentMatch; + if (options.oneofs) + object._presentMatch = "presentMatch"; + } + if (message.rangeMatch != null && message.hasOwnProperty("rangeMatch")) { + object.rangeMatch = $root.google.cloud.compute.v1.Int64RangeMatch.toObject(message.rangeMatch, options); + if (options.oneofs) + object._rangeMatch = "rangeMatch"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + object.regexMatch = message.regexMatch; + if (options.oneofs) + object._regexMatch = "regexMatch"; + } + if (message.headerName != null && message.hasOwnProperty("headerName")) { + object.headerName = message.headerName; + if (options.oneofs) + object._headerName = "headerName"; + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + object.prefixMatch = message.prefixMatch; + if (options.oneofs) + object._prefixMatch = "prefixMatch"; + } + if (message.suffixMatch != null && message.hasOwnProperty("suffixMatch")) { + object.suffixMatch = message.suffixMatch; + if (options.oneofs) + object._suffixMatch = "suffixMatch"; + } + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + object.exactMatch = message.exactMatch; + if (options.oneofs) + object._exactMatch = "exactMatch"; + } + if (message.invertMatch != null && message.hasOwnProperty("invertMatch")) { + object.invertMatch = message.invertMatch; + if (options.oneofs) + object._invertMatch = "invertMatch"; + } + return object; + }; + + /** + * Converts this HttpHeaderMatch to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpHeaderMatch + * @instance + * @returns {Object.} JSON object + */ + HttpHeaderMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpHeaderMatch; + })(); + + v1.HttpQueryParameterMatch = (function() { + + /** + * Properties of a HttpQueryParameterMatch. + * @memberof google.cloud.compute.v1 + * @interface IHttpQueryParameterMatch + * @property {string|null} [exactMatch] HttpQueryParameterMatch exactMatch + * @property {string|null} [name] HttpQueryParameterMatch name + * @property {boolean|null} [presentMatch] HttpQueryParameterMatch presentMatch + * @property {string|null} [regexMatch] HttpQueryParameterMatch regexMatch + */ + + /** + * Constructs a new HttpQueryParameterMatch. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpQueryParameterMatch. + * @implements IHttpQueryParameterMatch + * @constructor + * @param {google.cloud.compute.v1.IHttpQueryParameterMatch=} [properties] Properties to set + */ + function HttpQueryParameterMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpQueryParameterMatch exactMatch. + * @member {string|null|undefined} exactMatch + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + HttpQueryParameterMatch.prototype.exactMatch = null; + + /** + * HttpQueryParameterMatch name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + HttpQueryParameterMatch.prototype.name = null; + + /** + * HttpQueryParameterMatch presentMatch. + * @member {boolean|null|undefined} presentMatch + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + HttpQueryParameterMatch.prototype.presentMatch = null; + + /** + * HttpQueryParameterMatch regexMatch. + * @member {string|null|undefined} regexMatch + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + HttpQueryParameterMatch.prototype.regexMatch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpQueryParameterMatch _exactMatch. + * @member {"exactMatch"|undefined} _exactMatch + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + Object.defineProperty(HttpQueryParameterMatch.prototype, "_exactMatch", { + get: $util.oneOfGetter($oneOfFields = ["exactMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpQueryParameterMatch _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + Object.defineProperty(HttpQueryParameterMatch.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpQueryParameterMatch _presentMatch. + * @member {"presentMatch"|undefined} _presentMatch + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + Object.defineProperty(HttpQueryParameterMatch.prototype, "_presentMatch", { + get: $util.oneOfGetter($oneOfFields = ["presentMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpQueryParameterMatch _regexMatch. + * @member {"regexMatch"|undefined} _regexMatch + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + */ + Object.defineProperty(HttpQueryParameterMatch.prototype, "_regexMatch", { + get: $util.oneOfGetter($oneOfFields = ["regexMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpQueryParameterMatch instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {google.cloud.compute.v1.IHttpQueryParameterMatch=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpQueryParameterMatch} HttpQueryParameterMatch instance + */ + HttpQueryParameterMatch.create = function create(properties) { + return new HttpQueryParameterMatch(properties); + }; + + /** + * Encodes the specified HttpQueryParameterMatch message. Does not implicitly {@link google.cloud.compute.v1.HttpQueryParameterMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {google.cloud.compute.v1.IHttpQueryParameterMatch} message HttpQueryParameterMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpQueryParameterMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.presentMatch != null && Object.hasOwnProperty.call(message, "presentMatch")) + writer.uint32(/* id 67435841, wireType 0 =*/539486728).bool(message.presentMatch); + if (message.regexMatch != null && Object.hasOwnProperty.call(message, "regexMatch")) + writer.uint32(/* id 107387853, wireType 2 =*/859102826).string(message.regexMatch); + if (message.exactMatch != null && Object.hasOwnProperty.call(message, "exactMatch")) + writer.uint32(/* id 457641093, wireType 2 =*/3661128746).string(message.exactMatch); + return writer; + }; + + /** + * Encodes the specified HttpQueryParameterMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpQueryParameterMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {google.cloud.compute.v1.IHttpQueryParameterMatch} message HttpQueryParameterMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpQueryParameterMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpQueryParameterMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpQueryParameterMatch} HttpQueryParameterMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpQueryParameterMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpQueryParameterMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 457641093: + message.exactMatch = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 67435841: + message.presentMatch = reader.bool(); + break; + case 107387853: + message.regexMatch = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpQueryParameterMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpQueryParameterMatch} HttpQueryParameterMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpQueryParameterMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpQueryParameterMatch message. + * @function verify + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpQueryParameterMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + properties._exactMatch = 1; + if (!$util.isString(message.exactMatch)) + return "exactMatch: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + properties._presentMatch = 1; + if (typeof message.presentMatch !== "boolean") + return "presentMatch: boolean expected"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + properties._regexMatch = 1; + if (!$util.isString(message.regexMatch)) + return "regexMatch: string expected"; + } + return null; + }; + + /** + * Creates a HttpQueryParameterMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpQueryParameterMatch} HttpQueryParameterMatch + */ + HttpQueryParameterMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpQueryParameterMatch) + return object; + var message = new $root.google.cloud.compute.v1.HttpQueryParameterMatch(); + if (object.exactMatch != null) + message.exactMatch = String(object.exactMatch); + if (object.name != null) + message.name = String(object.name); + if (object.presentMatch != null) + message.presentMatch = Boolean(object.presentMatch); + if (object.regexMatch != null) + message.regexMatch = String(object.regexMatch); + return message; + }; + + /** + * Creates a plain object from a HttpQueryParameterMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @static + * @param {google.cloud.compute.v1.HttpQueryParameterMatch} message HttpQueryParameterMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpQueryParameterMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.presentMatch != null && message.hasOwnProperty("presentMatch")) { + object.presentMatch = message.presentMatch; + if (options.oneofs) + object._presentMatch = "presentMatch"; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + object.regexMatch = message.regexMatch; + if (options.oneofs) + object._regexMatch = "regexMatch"; + } + if (message.exactMatch != null && message.hasOwnProperty("exactMatch")) { + object.exactMatch = message.exactMatch; + if (options.oneofs) + object._exactMatch = "exactMatch"; + } + return object; + }; + + /** + * Converts this HttpQueryParameterMatch to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpQueryParameterMatch + * @instance + * @returns {Object.} JSON object + */ + HttpQueryParameterMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpQueryParameterMatch; + })(); + + v1.HttpRedirectAction = (function() { + + /** + * Properties of a HttpRedirectAction. + * @memberof google.cloud.compute.v1 + * @interface IHttpRedirectAction + * @property {string|null} [hostRedirect] HttpRedirectAction hostRedirect + * @property {boolean|null} [httpsRedirect] HttpRedirectAction httpsRedirect + * @property {string|null} [pathRedirect] HttpRedirectAction pathRedirect + * @property {string|null} [prefixRedirect] HttpRedirectAction prefixRedirect + * @property {google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode|null} [redirectResponseCode] HttpRedirectAction redirectResponseCode + * @property {boolean|null} [stripQuery] HttpRedirectAction stripQuery + */ + + /** + * Constructs a new HttpRedirectAction. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpRedirectAction. + * @implements IHttpRedirectAction + * @constructor + * @param {google.cloud.compute.v1.IHttpRedirectAction=} [properties] Properties to set + */ + function HttpRedirectAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRedirectAction hostRedirect. + * @member {string|null|undefined} hostRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + HttpRedirectAction.prototype.hostRedirect = null; + + /** + * HttpRedirectAction httpsRedirect. + * @member {boolean|null|undefined} httpsRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + HttpRedirectAction.prototype.httpsRedirect = null; + + /** + * HttpRedirectAction pathRedirect. + * @member {string|null|undefined} pathRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + HttpRedirectAction.prototype.pathRedirect = null; + + /** + * HttpRedirectAction prefixRedirect. + * @member {string|null|undefined} prefixRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + HttpRedirectAction.prototype.prefixRedirect = null; + + /** + * HttpRedirectAction redirectResponseCode. + * @member {google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode|null|undefined} redirectResponseCode + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + HttpRedirectAction.prototype.redirectResponseCode = null; + + /** + * HttpRedirectAction stripQuery. + * @member {boolean|null|undefined} stripQuery + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + HttpRedirectAction.prototype.stripQuery = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRedirectAction _hostRedirect. + * @member {"hostRedirect"|undefined} _hostRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + Object.defineProperty(HttpRedirectAction.prototype, "_hostRedirect", { + get: $util.oneOfGetter($oneOfFields = ["hostRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRedirectAction _httpsRedirect. + * @member {"httpsRedirect"|undefined} _httpsRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + Object.defineProperty(HttpRedirectAction.prototype, "_httpsRedirect", { + get: $util.oneOfGetter($oneOfFields = ["httpsRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRedirectAction _pathRedirect. + * @member {"pathRedirect"|undefined} _pathRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + Object.defineProperty(HttpRedirectAction.prototype, "_pathRedirect", { + get: $util.oneOfGetter($oneOfFields = ["pathRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRedirectAction _prefixRedirect. + * @member {"prefixRedirect"|undefined} _prefixRedirect + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + Object.defineProperty(HttpRedirectAction.prototype, "_prefixRedirect", { + get: $util.oneOfGetter($oneOfFields = ["prefixRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRedirectAction _redirectResponseCode. + * @member {"redirectResponseCode"|undefined} _redirectResponseCode + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + Object.defineProperty(HttpRedirectAction.prototype, "_redirectResponseCode", { + get: $util.oneOfGetter($oneOfFields = ["redirectResponseCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRedirectAction _stripQuery. + * @member {"stripQuery"|undefined} _stripQuery + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + */ + Object.defineProperty(HttpRedirectAction.prototype, "_stripQuery", { + get: $util.oneOfGetter($oneOfFields = ["stripQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRedirectAction instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {google.cloud.compute.v1.IHttpRedirectAction=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpRedirectAction} HttpRedirectAction instance + */ + HttpRedirectAction.create = function create(properties) { + return new HttpRedirectAction(properties); + }; + + /** + * Encodes the specified HttpRedirectAction message. Does not implicitly {@link google.cloud.compute.v1.HttpRedirectAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {google.cloud.compute.v1.IHttpRedirectAction} message HttpRedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRedirectAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stripQuery != null && Object.hasOwnProperty.call(message, "stripQuery")) + writer.uint32(/* id 52284641, wireType 0 =*/418277128).bool(message.stripQuery); + if (message.hostRedirect != null && Object.hasOwnProperty.call(message, "hostRedirect")) + writer.uint32(/* id 107417747, wireType 2 =*/859341978).string(message.hostRedirect); + if (message.httpsRedirect != null && Object.hasOwnProperty.call(message, "httpsRedirect")) + writer.uint32(/* id 170260656, wireType 0 =*/1362085248).bool(message.httpsRedirect); + if (message.pathRedirect != null && Object.hasOwnProperty.call(message, "pathRedirect")) + writer.uint32(/* id 272342710, wireType 2 =*/2178741682).string(message.pathRedirect); + if (message.redirectResponseCode != null && Object.hasOwnProperty.call(message, "redirectResponseCode")) + writer.uint32(/* id 436710408, wireType 0 =*/3493683264).int32(message.redirectResponseCode); + if (message.prefixRedirect != null && Object.hasOwnProperty.call(message, "prefixRedirect")) + writer.uint32(/* id 446184169, wireType 2 =*/3569473354).string(message.prefixRedirect); + return writer; + }; + + /** + * Encodes the specified HttpRedirectAction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRedirectAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {google.cloud.compute.v1.IHttpRedirectAction} message HttpRedirectAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRedirectAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRedirectAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpRedirectAction} HttpRedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRedirectAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpRedirectAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 107417747: + message.hostRedirect = reader.string(); + break; + case 170260656: + message.httpsRedirect = reader.bool(); + break; + case 272342710: + message.pathRedirect = reader.string(); + break; + case 446184169: + message.prefixRedirect = reader.string(); + break; + case 436710408: + message.redirectResponseCode = reader.int32(); + break; + case 52284641: + message.stripQuery = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRedirectAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpRedirectAction} HttpRedirectAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRedirectAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRedirectAction message. + * @function verify + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRedirectAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hostRedirect != null && message.hasOwnProperty("hostRedirect")) { + properties._hostRedirect = 1; + if (!$util.isString(message.hostRedirect)) + return "hostRedirect: string expected"; + } + if (message.httpsRedirect != null && message.hasOwnProperty("httpsRedirect")) { + properties._httpsRedirect = 1; + if (typeof message.httpsRedirect !== "boolean") + return "httpsRedirect: boolean expected"; + } + if (message.pathRedirect != null && message.hasOwnProperty("pathRedirect")) { + properties._pathRedirect = 1; + if (!$util.isString(message.pathRedirect)) + return "pathRedirect: string expected"; + } + if (message.prefixRedirect != null && message.hasOwnProperty("prefixRedirect")) { + properties._prefixRedirect = 1; + if (!$util.isString(message.prefixRedirect)) + return "prefixRedirect: string expected"; + } + if (message.redirectResponseCode != null && message.hasOwnProperty("redirectResponseCode")) { + properties._redirectResponseCode = 1; + switch (message.redirectResponseCode) { + default: + return "redirectResponseCode: enum value expected"; + case 0: + case 67084130: + case 386698449: + case 382006381: + case 445380580: + case 489550378: + break; + } + } + if (message.stripQuery != null && message.hasOwnProperty("stripQuery")) { + properties._stripQuery = 1; + if (typeof message.stripQuery !== "boolean") + return "stripQuery: boolean expected"; + } + return null; + }; + + /** + * Creates a HttpRedirectAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpRedirectAction} HttpRedirectAction + */ + HttpRedirectAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpRedirectAction) + return object; + var message = new $root.google.cloud.compute.v1.HttpRedirectAction(); + if (object.hostRedirect != null) + message.hostRedirect = String(object.hostRedirect); + if (object.httpsRedirect != null) + message.httpsRedirect = Boolean(object.httpsRedirect); + if (object.pathRedirect != null) + message.pathRedirect = String(object.pathRedirect); + if (object.prefixRedirect != null) + message.prefixRedirect = String(object.prefixRedirect); + switch (object.redirectResponseCode) { + case "UNDEFINED_REDIRECT_RESPONSE_CODE": + case 0: + message.redirectResponseCode = 0; + break; + case "FOUND": + case 67084130: + message.redirectResponseCode = 67084130; + break; + case "MOVED_PERMANENTLY_DEFAULT": + case 386698449: + message.redirectResponseCode = 386698449; + break; + case "PERMANENT_REDIRECT": + case 382006381: + message.redirectResponseCode = 382006381; + break; + case "SEE_OTHER": + case 445380580: + message.redirectResponseCode = 445380580; + break; + case "TEMPORARY_REDIRECT": + case 489550378: + message.redirectResponseCode = 489550378; + break; + } + if (object.stripQuery != null) + message.stripQuery = Boolean(object.stripQuery); + return message; + }; + + /** + * Creates a plain object from a HttpRedirectAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @static + * @param {google.cloud.compute.v1.HttpRedirectAction} message HttpRedirectAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRedirectAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.stripQuery != null && message.hasOwnProperty("stripQuery")) { + object.stripQuery = message.stripQuery; + if (options.oneofs) + object._stripQuery = "stripQuery"; + } + if (message.hostRedirect != null && message.hasOwnProperty("hostRedirect")) { + object.hostRedirect = message.hostRedirect; + if (options.oneofs) + object._hostRedirect = "hostRedirect"; + } + if (message.httpsRedirect != null && message.hasOwnProperty("httpsRedirect")) { + object.httpsRedirect = message.httpsRedirect; + if (options.oneofs) + object._httpsRedirect = "httpsRedirect"; + } + if (message.pathRedirect != null && message.hasOwnProperty("pathRedirect")) { + object.pathRedirect = message.pathRedirect; + if (options.oneofs) + object._pathRedirect = "pathRedirect"; + } + if (message.redirectResponseCode != null && message.hasOwnProperty("redirectResponseCode")) { + object.redirectResponseCode = options.enums === String ? $root.google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode[message.redirectResponseCode] : message.redirectResponseCode; + if (options.oneofs) + object._redirectResponseCode = "redirectResponseCode"; + } + if (message.prefixRedirect != null && message.hasOwnProperty("prefixRedirect")) { + object.prefixRedirect = message.prefixRedirect; + if (options.oneofs) + object._prefixRedirect = "prefixRedirect"; + } + return object; + }; + + /** + * Converts this HttpRedirectAction to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpRedirectAction + * @instance + * @returns {Object.} JSON object + */ + HttpRedirectAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * RedirectResponseCode enum. + * @name google.cloud.compute.v1.HttpRedirectAction.RedirectResponseCode + * @enum {number} + * @property {number} UNDEFINED_REDIRECT_RESPONSE_CODE=0 UNDEFINED_REDIRECT_RESPONSE_CODE value + * @property {number} FOUND=67084130 FOUND value + * @property {number} MOVED_PERMANENTLY_DEFAULT=386698449 MOVED_PERMANENTLY_DEFAULT value + * @property {number} PERMANENT_REDIRECT=382006381 PERMANENT_REDIRECT value + * @property {number} SEE_OTHER=445380580 SEE_OTHER value + * @property {number} TEMPORARY_REDIRECT=489550378 TEMPORARY_REDIRECT value + */ + HttpRedirectAction.RedirectResponseCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_REDIRECT_RESPONSE_CODE"] = 0; + values[valuesById[67084130] = "FOUND"] = 67084130; + values[valuesById[386698449] = "MOVED_PERMANENTLY_DEFAULT"] = 386698449; + values[valuesById[382006381] = "PERMANENT_REDIRECT"] = 382006381; + values[valuesById[445380580] = "SEE_OTHER"] = 445380580; + values[valuesById[489550378] = "TEMPORARY_REDIRECT"] = 489550378; + return values; + })(); + + return HttpRedirectAction; + })(); + + v1.HttpRetryPolicy = (function() { + + /** + * Properties of a HttpRetryPolicy. + * @memberof google.cloud.compute.v1 + * @interface IHttpRetryPolicy + * @property {number|null} [numRetries] HttpRetryPolicy numRetries + * @property {google.cloud.compute.v1.IDuration|null} [perTryTimeout] HttpRetryPolicy perTryTimeout + * @property {Array.|null} [retryConditions] HttpRetryPolicy retryConditions + */ + + /** + * Constructs a new HttpRetryPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpRetryPolicy. + * @implements IHttpRetryPolicy + * @constructor + * @param {google.cloud.compute.v1.IHttpRetryPolicy=} [properties] Properties to set + */ + function HttpRetryPolicy(properties) { + this.retryConditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRetryPolicy numRetries. + * @member {number|null|undefined} numRetries + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @instance + */ + HttpRetryPolicy.prototype.numRetries = null; + + /** + * HttpRetryPolicy perTryTimeout. + * @member {google.cloud.compute.v1.IDuration|null|undefined} perTryTimeout + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @instance + */ + HttpRetryPolicy.prototype.perTryTimeout = null; + + /** + * HttpRetryPolicy retryConditions. + * @member {Array.} retryConditions + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @instance + */ + HttpRetryPolicy.prototype.retryConditions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRetryPolicy _numRetries. + * @member {"numRetries"|undefined} _numRetries + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @instance + */ + Object.defineProperty(HttpRetryPolicy.prototype, "_numRetries", { + get: $util.oneOfGetter($oneOfFields = ["numRetries"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRetryPolicy _perTryTimeout. + * @member {"perTryTimeout"|undefined} _perTryTimeout + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @instance + */ + Object.defineProperty(HttpRetryPolicy.prototype, "_perTryTimeout", { + get: $util.oneOfGetter($oneOfFields = ["perTryTimeout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRetryPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {google.cloud.compute.v1.IHttpRetryPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpRetryPolicy} HttpRetryPolicy instance + */ + HttpRetryPolicy.create = function create(properties) { + return new HttpRetryPolicy(properties); + }; + + /** + * Encodes the specified HttpRetryPolicy message. Does not implicitly {@link google.cloud.compute.v1.HttpRetryPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {google.cloud.compute.v1.IHttpRetryPolicy} message HttpRetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRetryPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retryConditions != null && message.retryConditions.length) + for (var i = 0; i < message.retryConditions.length; ++i) + writer.uint32(/* id 28815535, wireType 2 =*/230524282).string(message.retryConditions[i]); + if (message.numRetries != null && Object.hasOwnProperty.call(message, "numRetries")) + writer.uint32(/* id 251680141, wireType 0 =*/2013441128).uint32(message.numRetries); + if (message.perTryTimeout != null && Object.hasOwnProperty.call(message, "perTryTimeout")) + $root.google.cloud.compute.v1.Duration.encode(message.perTryTimeout, writer.uint32(/* id 280041147, wireType 2 =*/2240329178).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpRetryPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRetryPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {google.cloud.compute.v1.IHttpRetryPolicy} message HttpRetryPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRetryPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRetryPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpRetryPolicy} HttpRetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRetryPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpRetryPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 251680141: + message.numRetries = reader.uint32(); + break; + case 280041147: + message.perTryTimeout = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 28815535: + if (!(message.retryConditions && message.retryConditions.length)) + message.retryConditions = []; + message.retryConditions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRetryPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpRetryPolicy} HttpRetryPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRetryPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRetryPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRetryPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.numRetries != null && message.hasOwnProperty("numRetries")) { + properties._numRetries = 1; + if (!$util.isInteger(message.numRetries)) + return "numRetries: integer expected"; + } + if (message.perTryTimeout != null && message.hasOwnProperty("perTryTimeout")) { + properties._perTryTimeout = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.perTryTimeout); + if (error) + return "perTryTimeout." + error; + } + } + if (message.retryConditions != null && message.hasOwnProperty("retryConditions")) { + if (!Array.isArray(message.retryConditions)) + return "retryConditions: array expected"; + for (var i = 0; i < message.retryConditions.length; ++i) + if (!$util.isString(message.retryConditions[i])) + return "retryConditions: string[] expected"; + } + return null; + }; + + /** + * Creates a HttpRetryPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpRetryPolicy} HttpRetryPolicy + */ + HttpRetryPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpRetryPolicy) + return object; + var message = new $root.google.cloud.compute.v1.HttpRetryPolicy(); + if (object.numRetries != null) + message.numRetries = object.numRetries >>> 0; + if (object.perTryTimeout != null) { + if (typeof object.perTryTimeout !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRetryPolicy.perTryTimeout: object expected"); + message.perTryTimeout = $root.google.cloud.compute.v1.Duration.fromObject(object.perTryTimeout); + } + if (object.retryConditions) { + if (!Array.isArray(object.retryConditions)) + throw TypeError(".google.cloud.compute.v1.HttpRetryPolicy.retryConditions: array expected"); + message.retryConditions = []; + for (var i = 0; i < object.retryConditions.length; ++i) + message.retryConditions[i] = String(object.retryConditions[i]); + } + return message; + }; + + /** + * Creates a plain object from a HttpRetryPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @static + * @param {google.cloud.compute.v1.HttpRetryPolicy} message HttpRetryPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRetryPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.retryConditions = []; + if (message.retryConditions && message.retryConditions.length) { + object.retryConditions = []; + for (var j = 0; j < message.retryConditions.length; ++j) + object.retryConditions[j] = message.retryConditions[j]; + } + if (message.numRetries != null && message.hasOwnProperty("numRetries")) { + object.numRetries = message.numRetries; + if (options.oneofs) + object._numRetries = "numRetries"; + } + if (message.perTryTimeout != null && message.hasOwnProperty("perTryTimeout")) { + object.perTryTimeout = $root.google.cloud.compute.v1.Duration.toObject(message.perTryTimeout, options); + if (options.oneofs) + object._perTryTimeout = "perTryTimeout"; + } + return object; + }; + + /** + * Converts this HttpRetryPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpRetryPolicy + * @instance + * @returns {Object.} JSON object + */ + HttpRetryPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRetryPolicy; + })(); + + v1.RequestMirrorPolicy = (function() { + + /** + * Properties of a RequestMirrorPolicy. + * @memberof google.cloud.compute.v1 + * @interface IRequestMirrorPolicy + * @property {string|null} [backendService] RequestMirrorPolicy backendService + */ + + /** + * Constructs a new RequestMirrorPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RequestMirrorPolicy. + * @implements IRequestMirrorPolicy + * @constructor + * @param {google.cloud.compute.v1.IRequestMirrorPolicy=} [properties] Properties to set + */ + function RequestMirrorPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RequestMirrorPolicy backendService. + * @member {string|null|undefined} backendService + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @instance + */ + RequestMirrorPolicy.prototype.backendService = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RequestMirrorPolicy _backendService. + * @member {"backendService"|undefined} _backendService + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @instance + */ + Object.defineProperty(RequestMirrorPolicy.prototype, "_backendService", { + get: $util.oneOfGetter($oneOfFields = ["backendService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RequestMirrorPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {google.cloud.compute.v1.IRequestMirrorPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RequestMirrorPolicy} RequestMirrorPolicy instance + */ + RequestMirrorPolicy.create = function create(properties) { + return new RequestMirrorPolicy(properties); + }; + + /** + * Encodes the specified RequestMirrorPolicy message. Does not implicitly {@link google.cloud.compute.v1.RequestMirrorPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {google.cloud.compute.v1.IRequestMirrorPolicy} message RequestMirrorPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMirrorPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified RequestMirrorPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RequestMirrorPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {google.cloud.compute.v1.IRequestMirrorPolicy} message RequestMirrorPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RequestMirrorPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RequestMirrorPolicy} RequestMirrorPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMirrorPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RequestMirrorPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RequestMirrorPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RequestMirrorPolicy} RequestMirrorPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RequestMirrorPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RequestMirrorPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RequestMirrorPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) { + properties._backendService = 1; + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + } + return null; + }; + + /** + * Creates a RequestMirrorPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RequestMirrorPolicy} RequestMirrorPolicy + */ + RequestMirrorPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RequestMirrorPolicy) + return object; + var message = new $root.google.cloud.compute.v1.RequestMirrorPolicy(); + if (object.backendService != null) + message.backendService = String(object.backendService); + return message; + }; + + /** + * Creates a plain object from a RequestMirrorPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @static + * @param {google.cloud.compute.v1.RequestMirrorPolicy} message RequestMirrorPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RequestMirrorPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) { + object.backendService = message.backendService; + if (options.oneofs) + object._backendService = "backendService"; + } + return object; + }; + + /** + * Converts this RequestMirrorPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RequestMirrorPolicy + * @instance + * @returns {Object.} JSON object + */ + RequestMirrorPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RequestMirrorPolicy; + })(); + + v1.UrlRewrite = (function() { + + /** + * Properties of an UrlRewrite. + * @memberof google.cloud.compute.v1 + * @interface IUrlRewrite + * @property {string|null} [hostRewrite] UrlRewrite hostRewrite + * @property {string|null} [pathPrefixRewrite] UrlRewrite pathPrefixRewrite + */ + + /** + * Constructs a new UrlRewrite. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlRewrite. + * @implements IUrlRewrite + * @constructor + * @param {google.cloud.compute.v1.IUrlRewrite=} [properties] Properties to set + */ + function UrlRewrite(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlRewrite hostRewrite. + * @member {string|null|undefined} hostRewrite + * @memberof google.cloud.compute.v1.UrlRewrite + * @instance + */ + UrlRewrite.prototype.hostRewrite = null; + + /** + * UrlRewrite pathPrefixRewrite. + * @member {string|null|undefined} pathPrefixRewrite + * @memberof google.cloud.compute.v1.UrlRewrite + * @instance + */ + UrlRewrite.prototype.pathPrefixRewrite = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlRewrite _hostRewrite. + * @member {"hostRewrite"|undefined} _hostRewrite + * @memberof google.cloud.compute.v1.UrlRewrite + * @instance + */ + Object.defineProperty(UrlRewrite.prototype, "_hostRewrite", { + get: $util.oneOfGetter($oneOfFields = ["hostRewrite"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlRewrite _pathPrefixRewrite. + * @member {"pathPrefixRewrite"|undefined} _pathPrefixRewrite + * @memberof google.cloud.compute.v1.UrlRewrite + * @instance + */ + Object.defineProperty(UrlRewrite.prototype, "_pathPrefixRewrite", { + get: $util.oneOfGetter($oneOfFields = ["pathPrefixRewrite"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlRewrite instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {google.cloud.compute.v1.IUrlRewrite=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlRewrite} UrlRewrite instance + */ + UrlRewrite.create = function create(properties) { + return new UrlRewrite(properties); + }; + + /** + * Encodes the specified UrlRewrite message. Does not implicitly {@link google.cloud.compute.v1.UrlRewrite.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {google.cloud.compute.v1.IUrlRewrite} message UrlRewrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlRewrite.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pathPrefixRewrite != null && Object.hasOwnProperty.call(message, "pathPrefixRewrite")) + writer.uint32(/* id 41186361, wireType 2 =*/329490890).string(message.pathPrefixRewrite); + if (message.hostRewrite != null && Object.hasOwnProperty.call(message, "hostRewrite")) + writer.uint32(/* id 159819253, wireType 2 =*/1278554026).string(message.hostRewrite); + return writer; + }; + + /** + * Encodes the specified UrlRewrite message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlRewrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {google.cloud.compute.v1.IUrlRewrite} message UrlRewrite message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlRewrite.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlRewrite message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlRewrite} UrlRewrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlRewrite.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlRewrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 159819253: + message.hostRewrite = reader.string(); + break; + case 41186361: + message.pathPrefixRewrite = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlRewrite message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlRewrite} UrlRewrite + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlRewrite.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlRewrite message. + * @function verify + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlRewrite.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hostRewrite != null && message.hasOwnProperty("hostRewrite")) { + properties._hostRewrite = 1; + if (!$util.isString(message.hostRewrite)) + return "hostRewrite: string expected"; + } + if (message.pathPrefixRewrite != null && message.hasOwnProperty("pathPrefixRewrite")) { + properties._pathPrefixRewrite = 1; + if (!$util.isString(message.pathPrefixRewrite)) + return "pathPrefixRewrite: string expected"; + } + return null; + }; + + /** + * Creates an UrlRewrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlRewrite} UrlRewrite + */ + UrlRewrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlRewrite) + return object; + var message = new $root.google.cloud.compute.v1.UrlRewrite(); + if (object.hostRewrite != null) + message.hostRewrite = String(object.hostRewrite); + if (object.pathPrefixRewrite != null) + message.pathPrefixRewrite = String(object.pathPrefixRewrite); + return message; + }; + + /** + * Creates a plain object from an UrlRewrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlRewrite + * @static + * @param {google.cloud.compute.v1.UrlRewrite} message UrlRewrite + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlRewrite.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pathPrefixRewrite != null && message.hasOwnProperty("pathPrefixRewrite")) { + object.pathPrefixRewrite = message.pathPrefixRewrite; + if (options.oneofs) + object._pathPrefixRewrite = "pathPrefixRewrite"; + } + if (message.hostRewrite != null && message.hasOwnProperty("hostRewrite")) { + object.hostRewrite = message.hostRewrite; + if (options.oneofs) + object._hostRewrite = "hostRewrite"; + } + return object; + }; + + /** + * Converts this UrlRewrite to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlRewrite + * @instance + * @returns {Object.} JSON object + */ + UrlRewrite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlRewrite; + })(); + + v1.WeightedBackendService = (function() { + + /** + * Properties of a WeightedBackendService. + * @memberof google.cloud.compute.v1 + * @interface IWeightedBackendService + * @property {string|null} [backendService] WeightedBackendService backendService + * @property {google.cloud.compute.v1.IHttpHeaderAction|null} [headerAction] WeightedBackendService headerAction + * @property {number|null} [weight] WeightedBackendService weight + */ + + /** + * Constructs a new WeightedBackendService. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a WeightedBackendService. + * @implements IWeightedBackendService + * @constructor + * @param {google.cloud.compute.v1.IWeightedBackendService=} [properties] Properties to set + */ + function WeightedBackendService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeightedBackendService backendService. + * @member {string|null|undefined} backendService + * @memberof google.cloud.compute.v1.WeightedBackendService + * @instance + */ + WeightedBackendService.prototype.backendService = null; + + /** + * WeightedBackendService headerAction. + * @member {google.cloud.compute.v1.IHttpHeaderAction|null|undefined} headerAction + * @memberof google.cloud.compute.v1.WeightedBackendService + * @instance + */ + WeightedBackendService.prototype.headerAction = null; + + /** + * WeightedBackendService weight. + * @member {number|null|undefined} weight + * @memberof google.cloud.compute.v1.WeightedBackendService + * @instance + */ + WeightedBackendService.prototype.weight = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WeightedBackendService _backendService. + * @member {"backendService"|undefined} _backendService + * @memberof google.cloud.compute.v1.WeightedBackendService + * @instance + */ + Object.defineProperty(WeightedBackendService.prototype, "_backendService", { + get: $util.oneOfGetter($oneOfFields = ["backendService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * WeightedBackendService _headerAction. + * @member {"headerAction"|undefined} _headerAction + * @memberof google.cloud.compute.v1.WeightedBackendService + * @instance + */ + Object.defineProperty(WeightedBackendService.prototype, "_headerAction", { + get: $util.oneOfGetter($oneOfFields = ["headerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * WeightedBackendService _weight. + * @member {"weight"|undefined} _weight + * @memberof google.cloud.compute.v1.WeightedBackendService + * @instance + */ + Object.defineProperty(WeightedBackendService.prototype, "_weight", { + get: $util.oneOfGetter($oneOfFields = ["weight"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WeightedBackendService instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {google.cloud.compute.v1.IWeightedBackendService=} [properties] Properties to set + * @returns {google.cloud.compute.v1.WeightedBackendService} WeightedBackendService instance + */ + WeightedBackendService.create = function create(properties) { + return new WeightedBackendService(properties); + }; + + /** + * Encodes the specified WeightedBackendService message. Does not implicitly {@link google.cloud.compute.v1.WeightedBackendService.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {google.cloud.compute.v1.IWeightedBackendService} message WeightedBackendService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightedBackendService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 282149496, wireType 0 =*/2257195968).uint32(message.weight); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.headerAction != null && Object.hasOwnProperty.call(message, "headerAction")) + $root.google.cloud.compute.v1.HttpHeaderAction.encode(message.headerAction, writer.uint32(/* id 328077352, wireType 2 =*/2624618818).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WeightedBackendService message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WeightedBackendService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {google.cloud.compute.v1.IWeightedBackendService} message WeightedBackendService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeightedBackendService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeightedBackendService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.WeightedBackendService} WeightedBackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightedBackendService.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.WeightedBackendService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 328077352: + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.decode(reader, reader.uint32()); + break; + case 282149496: + message.weight = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeightedBackendService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.WeightedBackendService} WeightedBackendService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeightedBackendService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeightedBackendService message. + * @function verify + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeightedBackendService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) { + properties._backendService = 1; + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + } + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + properties._headerAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpHeaderAction.verify(message.headerAction); + if (error) + return "headerAction." + error; + } + } + if (message.weight != null && message.hasOwnProperty("weight")) { + properties._weight = 1; + if (!$util.isInteger(message.weight)) + return "weight: integer expected"; + } + return null; + }; + + /** + * Creates a WeightedBackendService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.WeightedBackendService} WeightedBackendService + */ + WeightedBackendService.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.WeightedBackendService) + return object; + var message = new $root.google.cloud.compute.v1.WeightedBackendService(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.headerAction != null) { + if (typeof object.headerAction !== "object") + throw TypeError(".google.cloud.compute.v1.WeightedBackendService.headerAction: object expected"); + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.fromObject(object.headerAction); + } + if (object.weight != null) + message.weight = object.weight >>> 0; + return message; + }; + + /** + * Creates a plain object from a WeightedBackendService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.WeightedBackendService + * @static + * @param {google.cloud.compute.v1.WeightedBackendService} message WeightedBackendService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeightedBackendService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.weight != null && message.hasOwnProperty("weight")) { + object.weight = message.weight; + if (options.oneofs) + object._weight = "weight"; + } + if (message.backendService != null && message.hasOwnProperty("backendService")) { + object.backendService = message.backendService; + if (options.oneofs) + object._backendService = "backendService"; + } + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + object.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.toObject(message.headerAction, options); + if (options.oneofs) + object._headerAction = "headerAction"; + } + return object; + }; + + /** + * Converts this WeightedBackendService to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.WeightedBackendService + * @instance + * @returns {Object.} JSON object + */ + WeightedBackendService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WeightedBackendService; + })(); + + v1.HttpRouteAction = (function() { + + /** + * Properties of a HttpRouteAction. + * @memberof google.cloud.compute.v1 + * @interface IHttpRouteAction + * @property {google.cloud.compute.v1.ICorsPolicy|null} [corsPolicy] HttpRouteAction corsPolicy + * @property {google.cloud.compute.v1.IHttpFaultInjection|null} [faultInjectionPolicy] HttpRouteAction faultInjectionPolicy + * @property {google.cloud.compute.v1.IDuration|null} [maxStreamDuration] HttpRouteAction maxStreamDuration + * @property {google.cloud.compute.v1.IRequestMirrorPolicy|null} [requestMirrorPolicy] HttpRouteAction requestMirrorPolicy + * @property {google.cloud.compute.v1.IHttpRetryPolicy|null} [retryPolicy] HttpRouteAction retryPolicy + * @property {google.cloud.compute.v1.IDuration|null} [timeout] HttpRouteAction timeout + * @property {google.cloud.compute.v1.IUrlRewrite|null} [urlRewrite] HttpRouteAction urlRewrite + * @property {Array.|null} [weightedBackendServices] HttpRouteAction weightedBackendServices + */ + + /** + * Constructs a new HttpRouteAction. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpRouteAction. + * @implements IHttpRouteAction + * @constructor + * @param {google.cloud.compute.v1.IHttpRouteAction=} [properties] Properties to set + */ + function HttpRouteAction(properties) { + this.weightedBackendServices = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRouteAction corsPolicy. + * @member {google.cloud.compute.v1.ICorsPolicy|null|undefined} corsPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.corsPolicy = null; + + /** + * HttpRouteAction faultInjectionPolicy. + * @member {google.cloud.compute.v1.IHttpFaultInjection|null|undefined} faultInjectionPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.faultInjectionPolicy = null; + + /** + * HttpRouteAction maxStreamDuration. + * @member {google.cloud.compute.v1.IDuration|null|undefined} maxStreamDuration + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.maxStreamDuration = null; + + /** + * HttpRouteAction requestMirrorPolicy. + * @member {google.cloud.compute.v1.IRequestMirrorPolicy|null|undefined} requestMirrorPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.requestMirrorPolicy = null; + + /** + * HttpRouteAction retryPolicy. + * @member {google.cloud.compute.v1.IHttpRetryPolicy|null|undefined} retryPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.retryPolicy = null; + + /** + * HttpRouteAction timeout. + * @member {google.cloud.compute.v1.IDuration|null|undefined} timeout + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.timeout = null; + + /** + * HttpRouteAction urlRewrite. + * @member {google.cloud.compute.v1.IUrlRewrite|null|undefined} urlRewrite + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.urlRewrite = null; + + /** + * HttpRouteAction weightedBackendServices. + * @member {Array.} weightedBackendServices + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + HttpRouteAction.prototype.weightedBackendServices = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRouteAction _corsPolicy. + * @member {"corsPolicy"|undefined} _corsPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + Object.defineProperty(HttpRouteAction.prototype, "_corsPolicy", { + get: $util.oneOfGetter($oneOfFields = ["corsPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteAction _faultInjectionPolicy. + * @member {"faultInjectionPolicy"|undefined} _faultInjectionPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + Object.defineProperty(HttpRouteAction.prototype, "_faultInjectionPolicy", { + get: $util.oneOfGetter($oneOfFields = ["faultInjectionPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteAction _maxStreamDuration. + * @member {"maxStreamDuration"|undefined} _maxStreamDuration + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + Object.defineProperty(HttpRouteAction.prototype, "_maxStreamDuration", { + get: $util.oneOfGetter($oneOfFields = ["maxStreamDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteAction _requestMirrorPolicy. + * @member {"requestMirrorPolicy"|undefined} _requestMirrorPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + Object.defineProperty(HttpRouteAction.prototype, "_requestMirrorPolicy", { + get: $util.oneOfGetter($oneOfFields = ["requestMirrorPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteAction _retryPolicy. + * @member {"retryPolicy"|undefined} _retryPolicy + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + Object.defineProperty(HttpRouteAction.prototype, "_retryPolicy", { + get: $util.oneOfGetter($oneOfFields = ["retryPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteAction _timeout. + * @member {"timeout"|undefined} _timeout + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + Object.defineProperty(HttpRouteAction.prototype, "_timeout", { + get: $util.oneOfGetter($oneOfFields = ["timeout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteAction _urlRewrite. + * @member {"urlRewrite"|undefined} _urlRewrite + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + */ + Object.defineProperty(HttpRouteAction.prototype, "_urlRewrite", { + get: $util.oneOfGetter($oneOfFields = ["urlRewrite"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRouteAction instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {google.cloud.compute.v1.IHttpRouteAction=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpRouteAction} HttpRouteAction instance + */ + HttpRouteAction.create = function create(properties) { + return new HttpRouteAction(properties); + }; + + /** + * Encodes the specified HttpRouteAction message. Does not implicitly {@link google.cloud.compute.v1.HttpRouteAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {google.cloud.compute.v1.IHttpRouteAction} message HttpRouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRouteAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retryPolicy != null && Object.hasOwnProperty.call(message, "retryPolicy")) + $root.google.cloud.compute.v1.HttpRetryPolicy.encode(message.retryPolicy, writer.uint32(/* id 56799913, wireType 2 =*/454399306).fork()).ldelim(); + if (message.maxStreamDuration != null && Object.hasOwnProperty.call(message, "maxStreamDuration")) + $root.google.cloud.compute.v1.Duration.encode(message.maxStreamDuration, writer.uint32(/* id 61428376, wireType 2 =*/491427010).fork()).ldelim(); + if (message.requestMirrorPolicy != null && Object.hasOwnProperty.call(message, "requestMirrorPolicy")) + $root.google.cloud.compute.v1.RequestMirrorPolicy.encode(message.requestMirrorPolicy, writer.uint32(/* id 220196866, wireType 2 =*/1761574930).fork()).ldelim(); + if (message.urlRewrite != null && Object.hasOwnProperty.call(message, "urlRewrite")) + $root.google.cloud.compute.v1.UrlRewrite.encode(message.urlRewrite, writer.uint32(/* id 273333948, wireType 2 =*/2186671586).fork()).ldelim(); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.cloud.compute.v1.Duration.encode(message.timeout, writer.uint32(/* id 296701281, wireType 2 =*/2373610250).fork()).ldelim(); + if (message.weightedBackendServices != null && message.weightedBackendServices.length) + for (var i = 0; i < message.weightedBackendServices.length; ++i) + $root.google.cloud.compute.v1.WeightedBackendService.encode(message.weightedBackendServices[i], writer.uint32(/* id 337028049, wireType 2 =*/2696224394).fork()).ldelim(); + if (message.corsPolicy != null && Object.hasOwnProperty.call(message, "corsPolicy")) + $root.google.cloud.compute.v1.CorsPolicy.encode(message.corsPolicy, writer.uint32(/* id 398943748, wireType 2 =*/3191549986).fork()).ldelim(); + if (message.faultInjectionPolicy != null && Object.hasOwnProperty.call(message, "faultInjectionPolicy")) + $root.google.cloud.compute.v1.HttpFaultInjection.encode(message.faultInjectionPolicy, writer.uint32(/* id 412781079, wireType 2 =*/3302248634).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpRouteAction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRouteAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {google.cloud.compute.v1.IHttpRouteAction} message HttpRouteAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRouteAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRouteAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpRouteAction} HttpRouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRouteAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpRouteAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 398943748: + message.corsPolicy = $root.google.cloud.compute.v1.CorsPolicy.decode(reader, reader.uint32()); + break; + case 412781079: + message.faultInjectionPolicy = $root.google.cloud.compute.v1.HttpFaultInjection.decode(reader, reader.uint32()); + break; + case 61428376: + message.maxStreamDuration = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 220196866: + message.requestMirrorPolicy = $root.google.cloud.compute.v1.RequestMirrorPolicy.decode(reader, reader.uint32()); + break; + case 56799913: + message.retryPolicy = $root.google.cloud.compute.v1.HttpRetryPolicy.decode(reader, reader.uint32()); + break; + case 296701281: + message.timeout = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 273333948: + message.urlRewrite = $root.google.cloud.compute.v1.UrlRewrite.decode(reader, reader.uint32()); + break; + case 337028049: + if (!(message.weightedBackendServices && message.weightedBackendServices.length)) + message.weightedBackendServices = []; + message.weightedBackendServices.push($root.google.cloud.compute.v1.WeightedBackendService.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRouteAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpRouteAction} HttpRouteAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRouteAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRouteAction message. + * @function verify + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRouteAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.corsPolicy != null && message.hasOwnProperty("corsPolicy")) { + properties._corsPolicy = 1; + { + var error = $root.google.cloud.compute.v1.CorsPolicy.verify(message.corsPolicy); + if (error) + return "corsPolicy." + error; + } + } + if (message.faultInjectionPolicy != null && message.hasOwnProperty("faultInjectionPolicy")) { + properties._faultInjectionPolicy = 1; + { + var error = $root.google.cloud.compute.v1.HttpFaultInjection.verify(message.faultInjectionPolicy); + if (error) + return "faultInjectionPolicy." + error; + } + } + if (message.maxStreamDuration != null && message.hasOwnProperty("maxStreamDuration")) { + properties._maxStreamDuration = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.maxStreamDuration); + if (error) + return "maxStreamDuration." + error; + } + } + if (message.requestMirrorPolicy != null && message.hasOwnProperty("requestMirrorPolicy")) { + properties._requestMirrorPolicy = 1; + { + var error = $root.google.cloud.compute.v1.RequestMirrorPolicy.verify(message.requestMirrorPolicy); + if (error) + return "requestMirrorPolicy." + error; + } + } + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { + properties._retryPolicy = 1; + { + var error = $root.google.cloud.compute.v1.HttpRetryPolicy.verify(message.retryPolicy); + if (error) + return "retryPolicy." + error; + } + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + properties._timeout = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + } + if (message.urlRewrite != null && message.hasOwnProperty("urlRewrite")) { + properties._urlRewrite = 1; + { + var error = $root.google.cloud.compute.v1.UrlRewrite.verify(message.urlRewrite); + if (error) + return "urlRewrite." + error; + } + } + if (message.weightedBackendServices != null && message.hasOwnProperty("weightedBackendServices")) { + if (!Array.isArray(message.weightedBackendServices)) + return "weightedBackendServices: array expected"; + for (var i = 0; i < message.weightedBackendServices.length; ++i) { + var error = $root.google.cloud.compute.v1.WeightedBackendService.verify(message.weightedBackendServices[i]); + if (error) + return "weightedBackendServices." + error; + } + } + return null; + }; + + /** + * Creates a HttpRouteAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpRouteAction} HttpRouteAction + */ + HttpRouteAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpRouteAction) + return object; + var message = new $root.google.cloud.compute.v1.HttpRouteAction(); + if (object.corsPolicy != null) { + if (typeof object.corsPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.corsPolicy: object expected"); + message.corsPolicy = $root.google.cloud.compute.v1.CorsPolicy.fromObject(object.corsPolicy); + } + if (object.faultInjectionPolicy != null) { + if (typeof object.faultInjectionPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.faultInjectionPolicy: object expected"); + message.faultInjectionPolicy = $root.google.cloud.compute.v1.HttpFaultInjection.fromObject(object.faultInjectionPolicy); + } + if (object.maxStreamDuration != null) { + if (typeof object.maxStreamDuration !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.maxStreamDuration: object expected"); + message.maxStreamDuration = $root.google.cloud.compute.v1.Duration.fromObject(object.maxStreamDuration); + } + if (object.requestMirrorPolicy != null) { + if (typeof object.requestMirrorPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.requestMirrorPolicy: object expected"); + message.requestMirrorPolicy = $root.google.cloud.compute.v1.RequestMirrorPolicy.fromObject(object.requestMirrorPolicy); + } + if (object.retryPolicy != null) { + if (typeof object.retryPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.retryPolicy: object expected"); + message.retryPolicy = $root.google.cloud.compute.v1.HttpRetryPolicy.fromObject(object.retryPolicy); + } + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.timeout: object expected"); + message.timeout = $root.google.cloud.compute.v1.Duration.fromObject(object.timeout); + } + if (object.urlRewrite != null) { + if (typeof object.urlRewrite !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.urlRewrite: object expected"); + message.urlRewrite = $root.google.cloud.compute.v1.UrlRewrite.fromObject(object.urlRewrite); + } + if (object.weightedBackendServices) { + if (!Array.isArray(object.weightedBackendServices)) + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.weightedBackendServices: array expected"); + message.weightedBackendServices = []; + for (var i = 0; i < object.weightedBackendServices.length; ++i) { + if (typeof object.weightedBackendServices[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteAction.weightedBackendServices: object expected"); + message.weightedBackendServices[i] = $root.google.cloud.compute.v1.WeightedBackendService.fromObject(object.weightedBackendServices[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRouteAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpRouteAction + * @static + * @param {google.cloud.compute.v1.HttpRouteAction} message HttpRouteAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRouteAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.weightedBackendServices = []; + if (message.retryPolicy != null && message.hasOwnProperty("retryPolicy")) { + object.retryPolicy = $root.google.cloud.compute.v1.HttpRetryPolicy.toObject(message.retryPolicy, options); + if (options.oneofs) + object._retryPolicy = "retryPolicy"; + } + if (message.maxStreamDuration != null && message.hasOwnProperty("maxStreamDuration")) { + object.maxStreamDuration = $root.google.cloud.compute.v1.Duration.toObject(message.maxStreamDuration, options); + if (options.oneofs) + object._maxStreamDuration = "maxStreamDuration"; + } + if (message.requestMirrorPolicy != null && message.hasOwnProperty("requestMirrorPolicy")) { + object.requestMirrorPolicy = $root.google.cloud.compute.v1.RequestMirrorPolicy.toObject(message.requestMirrorPolicy, options); + if (options.oneofs) + object._requestMirrorPolicy = "requestMirrorPolicy"; + } + if (message.urlRewrite != null && message.hasOwnProperty("urlRewrite")) { + object.urlRewrite = $root.google.cloud.compute.v1.UrlRewrite.toObject(message.urlRewrite, options); + if (options.oneofs) + object._urlRewrite = "urlRewrite"; + } + if (message.timeout != null && message.hasOwnProperty("timeout")) { + object.timeout = $root.google.cloud.compute.v1.Duration.toObject(message.timeout, options); + if (options.oneofs) + object._timeout = "timeout"; + } + if (message.weightedBackendServices && message.weightedBackendServices.length) { + object.weightedBackendServices = []; + for (var j = 0; j < message.weightedBackendServices.length; ++j) + object.weightedBackendServices[j] = $root.google.cloud.compute.v1.WeightedBackendService.toObject(message.weightedBackendServices[j], options); + } + if (message.corsPolicy != null && message.hasOwnProperty("corsPolicy")) { + object.corsPolicy = $root.google.cloud.compute.v1.CorsPolicy.toObject(message.corsPolicy, options); + if (options.oneofs) + object._corsPolicy = "corsPolicy"; + } + if (message.faultInjectionPolicy != null && message.hasOwnProperty("faultInjectionPolicy")) { + object.faultInjectionPolicy = $root.google.cloud.compute.v1.HttpFaultInjection.toObject(message.faultInjectionPolicy, options); + if (options.oneofs) + object._faultInjectionPolicy = "faultInjectionPolicy"; + } + return object; + }; + + /** + * Converts this HttpRouteAction to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpRouteAction + * @instance + * @returns {Object.} JSON object + */ + HttpRouteAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRouteAction; + })(); + + v1.HttpRouteRuleMatch = (function() { + + /** + * Properties of a HttpRouteRuleMatch. + * @memberof google.cloud.compute.v1 + * @interface IHttpRouteRuleMatch + * @property {string|null} [fullPathMatch] HttpRouteRuleMatch fullPathMatch + * @property {Array.|null} [headerMatches] HttpRouteRuleMatch headerMatches + * @property {boolean|null} [ignoreCase] HttpRouteRuleMatch ignoreCase + * @property {Array.|null} [metadataFilters] HttpRouteRuleMatch metadataFilters + * @property {string|null} [prefixMatch] HttpRouteRuleMatch prefixMatch + * @property {Array.|null} [queryParameterMatches] HttpRouteRuleMatch queryParameterMatches + * @property {string|null} [regexMatch] HttpRouteRuleMatch regexMatch + */ + + /** + * Constructs a new HttpRouteRuleMatch. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpRouteRuleMatch. + * @implements IHttpRouteRuleMatch + * @constructor + * @param {google.cloud.compute.v1.IHttpRouteRuleMatch=} [properties] Properties to set + */ + function HttpRouteRuleMatch(properties) { + this.headerMatches = []; + this.metadataFilters = []; + this.queryParameterMatches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRouteRuleMatch fullPathMatch. + * @member {string|null|undefined} fullPathMatch + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + HttpRouteRuleMatch.prototype.fullPathMatch = null; + + /** + * HttpRouteRuleMatch headerMatches. + * @member {Array.} headerMatches + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + HttpRouteRuleMatch.prototype.headerMatches = $util.emptyArray; + + /** + * HttpRouteRuleMatch ignoreCase. + * @member {boolean|null|undefined} ignoreCase + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + HttpRouteRuleMatch.prototype.ignoreCase = null; + + /** + * HttpRouteRuleMatch metadataFilters. + * @member {Array.} metadataFilters + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + HttpRouteRuleMatch.prototype.metadataFilters = $util.emptyArray; + + /** + * HttpRouteRuleMatch prefixMatch. + * @member {string|null|undefined} prefixMatch + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + HttpRouteRuleMatch.prototype.prefixMatch = null; + + /** + * HttpRouteRuleMatch queryParameterMatches. + * @member {Array.} queryParameterMatches + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + HttpRouteRuleMatch.prototype.queryParameterMatches = $util.emptyArray; + + /** + * HttpRouteRuleMatch regexMatch. + * @member {string|null|undefined} regexMatch + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + HttpRouteRuleMatch.prototype.regexMatch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRouteRuleMatch _fullPathMatch. + * @member {"fullPathMatch"|undefined} _fullPathMatch + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + Object.defineProperty(HttpRouteRuleMatch.prototype, "_fullPathMatch", { + get: $util.oneOfGetter($oneOfFields = ["fullPathMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRuleMatch _ignoreCase. + * @member {"ignoreCase"|undefined} _ignoreCase + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + Object.defineProperty(HttpRouteRuleMatch.prototype, "_ignoreCase", { + get: $util.oneOfGetter($oneOfFields = ["ignoreCase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRuleMatch _prefixMatch. + * @member {"prefixMatch"|undefined} _prefixMatch + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + Object.defineProperty(HttpRouteRuleMatch.prototype, "_prefixMatch", { + get: $util.oneOfGetter($oneOfFields = ["prefixMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRuleMatch _regexMatch. + * @member {"regexMatch"|undefined} _regexMatch + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + */ + Object.defineProperty(HttpRouteRuleMatch.prototype, "_regexMatch", { + get: $util.oneOfGetter($oneOfFields = ["regexMatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRouteRuleMatch instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {google.cloud.compute.v1.IHttpRouteRuleMatch=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpRouteRuleMatch} HttpRouteRuleMatch instance + */ + HttpRouteRuleMatch.create = function create(properties) { + return new HttpRouteRuleMatch(properties); + }; + + /** + * Encodes the specified HttpRouteRuleMatch message. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRuleMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {google.cloud.compute.v1.IHttpRouteRuleMatch} message HttpRouteRuleMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRouteRuleMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regexMatch != null && Object.hasOwnProperty.call(message, "regexMatch")) + writer.uint32(/* id 107387853, wireType 2 =*/859102826).string(message.regexMatch); + if (message.fullPathMatch != null && Object.hasOwnProperty.call(message, "fullPathMatch")) + writer.uint32(/* id 214598875, wireType 2 =*/1716791002).string(message.fullPathMatch); + if (message.prefixMatch != null && Object.hasOwnProperty.call(message, "prefixMatch")) + writer.uint32(/* id 257898968, wireType 2 =*/2063191746).string(message.prefixMatch); + if (message.queryParameterMatches != null && message.queryParameterMatches.length) + for (var i = 0; i < message.queryParameterMatches.length; ++i) + $root.google.cloud.compute.v1.HttpQueryParameterMatch.encode(message.queryParameterMatches[i], writer.uint32(/* id 286231270, wireType 2 =*/2289850162).fork()).ldelim(); + if (message.headerMatches != null && message.headerMatches.length) + for (var i = 0; i < message.headerMatches.length; ++i) + $root.google.cloud.compute.v1.HttpHeaderMatch.encode(message.headerMatches[i], writer.uint32(/* id 361903489, wireType 2 =*/2895227914).fork()).ldelim(); + if (message.ignoreCase != null && Object.hasOwnProperty.call(message, "ignoreCase")) + writer.uint32(/* id 464324989, wireType 0 =*/3714599912).bool(message.ignoreCase); + if (message.metadataFilters != null && message.metadataFilters.length) + for (var i = 0; i < message.metadataFilters.length; ++i) + $root.google.cloud.compute.v1.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 464725739, wireType 2 =*/3717805914).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpRouteRuleMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRuleMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {google.cloud.compute.v1.IHttpRouteRuleMatch} message HttpRouteRuleMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRouteRuleMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRouteRuleMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpRouteRuleMatch} HttpRouteRuleMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRouteRuleMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpRouteRuleMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 214598875: + message.fullPathMatch = reader.string(); + break; + case 361903489: + if (!(message.headerMatches && message.headerMatches.length)) + message.headerMatches = []; + message.headerMatches.push($root.google.cloud.compute.v1.HttpHeaderMatch.decode(reader, reader.uint32())); + break; + case 464324989: + message.ignoreCase = reader.bool(); + break; + case 464725739: + if (!(message.metadataFilters && message.metadataFilters.length)) + message.metadataFilters = []; + message.metadataFilters.push($root.google.cloud.compute.v1.MetadataFilter.decode(reader, reader.uint32())); + break; + case 257898968: + message.prefixMatch = reader.string(); + break; + case 286231270: + if (!(message.queryParameterMatches && message.queryParameterMatches.length)) + message.queryParameterMatches = []; + message.queryParameterMatches.push($root.google.cloud.compute.v1.HttpQueryParameterMatch.decode(reader, reader.uint32())); + break; + case 107387853: + message.regexMatch = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRouteRuleMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpRouteRuleMatch} HttpRouteRuleMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRouteRuleMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRouteRuleMatch message. + * @function verify + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRouteRuleMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fullPathMatch != null && message.hasOwnProperty("fullPathMatch")) { + properties._fullPathMatch = 1; + if (!$util.isString(message.fullPathMatch)) + return "fullPathMatch: string expected"; + } + if (message.headerMatches != null && message.hasOwnProperty("headerMatches")) { + if (!Array.isArray(message.headerMatches)) + return "headerMatches: array expected"; + for (var i = 0; i < message.headerMatches.length; ++i) { + var error = $root.google.cloud.compute.v1.HttpHeaderMatch.verify(message.headerMatches[i]); + if (error) + return "headerMatches." + error; + } + } + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) { + properties._ignoreCase = 1; + if (typeof message.ignoreCase !== "boolean") + return "ignoreCase: boolean expected"; + } + if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) { + if (!Array.isArray(message.metadataFilters)) + return "metadataFilters: array expected"; + for (var i = 0; i < message.metadataFilters.length; ++i) { + var error = $root.google.cloud.compute.v1.MetadataFilter.verify(message.metadataFilters[i]); + if (error) + return "metadataFilters." + error; + } + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + properties._prefixMatch = 1; + if (!$util.isString(message.prefixMatch)) + return "prefixMatch: string expected"; + } + if (message.queryParameterMatches != null && message.hasOwnProperty("queryParameterMatches")) { + if (!Array.isArray(message.queryParameterMatches)) + return "queryParameterMatches: array expected"; + for (var i = 0; i < message.queryParameterMatches.length; ++i) { + var error = $root.google.cloud.compute.v1.HttpQueryParameterMatch.verify(message.queryParameterMatches[i]); + if (error) + return "queryParameterMatches." + error; + } + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + properties._regexMatch = 1; + if (!$util.isString(message.regexMatch)) + return "regexMatch: string expected"; + } + return null; + }; + + /** + * Creates a HttpRouteRuleMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpRouteRuleMatch} HttpRouteRuleMatch + */ + HttpRouteRuleMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpRouteRuleMatch) + return object; + var message = new $root.google.cloud.compute.v1.HttpRouteRuleMatch(); + if (object.fullPathMatch != null) + message.fullPathMatch = String(object.fullPathMatch); + if (object.headerMatches) { + if (!Array.isArray(object.headerMatches)) + throw TypeError(".google.cloud.compute.v1.HttpRouteRuleMatch.headerMatches: array expected"); + message.headerMatches = []; + for (var i = 0; i < object.headerMatches.length; ++i) { + if (typeof object.headerMatches[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteRuleMatch.headerMatches: object expected"); + message.headerMatches[i] = $root.google.cloud.compute.v1.HttpHeaderMatch.fromObject(object.headerMatches[i]); + } + } + if (object.ignoreCase != null) + message.ignoreCase = Boolean(object.ignoreCase); + if (object.metadataFilters) { + if (!Array.isArray(object.metadataFilters)) + throw TypeError(".google.cloud.compute.v1.HttpRouteRuleMatch.metadataFilters: array expected"); + message.metadataFilters = []; + for (var i = 0; i < object.metadataFilters.length; ++i) { + if (typeof object.metadataFilters[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteRuleMatch.metadataFilters: object expected"); + message.metadataFilters[i] = $root.google.cloud.compute.v1.MetadataFilter.fromObject(object.metadataFilters[i]); + } + } + if (object.prefixMatch != null) + message.prefixMatch = String(object.prefixMatch); + if (object.queryParameterMatches) { + if (!Array.isArray(object.queryParameterMatches)) + throw TypeError(".google.cloud.compute.v1.HttpRouteRuleMatch.queryParameterMatches: array expected"); + message.queryParameterMatches = []; + for (var i = 0; i < object.queryParameterMatches.length; ++i) { + if (typeof object.queryParameterMatches[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteRuleMatch.queryParameterMatches: object expected"); + message.queryParameterMatches[i] = $root.google.cloud.compute.v1.HttpQueryParameterMatch.fromObject(object.queryParameterMatches[i]); + } + } + if (object.regexMatch != null) + message.regexMatch = String(object.regexMatch); + return message; + }; + + /** + * Creates a plain object from a HttpRouteRuleMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @static + * @param {google.cloud.compute.v1.HttpRouteRuleMatch} message HttpRouteRuleMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRouteRuleMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.queryParameterMatches = []; + object.headerMatches = []; + object.metadataFilters = []; + } + if (message.regexMatch != null && message.hasOwnProperty("regexMatch")) { + object.regexMatch = message.regexMatch; + if (options.oneofs) + object._regexMatch = "regexMatch"; + } + if (message.fullPathMatch != null && message.hasOwnProperty("fullPathMatch")) { + object.fullPathMatch = message.fullPathMatch; + if (options.oneofs) + object._fullPathMatch = "fullPathMatch"; + } + if (message.prefixMatch != null && message.hasOwnProperty("prefixMatch")) { + object.prefixMatch = message.prefixMatch; + if (options.oneofs) + object._prefixMatch = "prefixMatch"; + } + if (message.queryParameterMatches && message.queryParameterMatches.length) { + object.queryParameterMatches = []; + for (var j = 0; j < message.queryParameterMatches.length; ++j) + object.queryParameterMatches[j] = $root.google.cloud.compute.v1.HttpQueryParameterMatch.toObject(message.queryParameterMatches[j], options); + } + if (message.headerMatches && message.headerMatches.length) { + object.headerMatches = []; + for (var j = 0; j < message.headerMatches.length; ++j) + object.headerMatches[j] = $root.google.cloud.compute.v1.HttpHeaderMatch.toObject(message.headerMatches[j], options); + } + if (message.ignoreCase != null && message.hasOwnProperty("ignoreCase")) { + object.ignoreCase = message.ignoreCase; + if (options.oneofs) + object._ignoreCase = "ignoreCase"; + } + if (message.metadataFilters && message.metadataFilters.length) { + object.metadataFilters = []; + for (var j = 0; j < message.metadataFilters.length; ++j) + object.metadataFilters[j] = $root.google.cloud.compute.v1.MetadataFilter.toObject(message.metadataFilters[j], options); + } + return object; + }; + + /** + * Converts this HttpRouteRuleMatch to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpRouteRuleMatch + * @instance + * @returns {Object.} JSON object + */ + HttpRouteRuleMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRouteRuleMatch; + })(); + + v1.HttpRouteRule = (function() { + + /** + * Properties of a HttpRouteRule. + * @memberof google.cloud.compute.v1 + * @interface IHttpRouteRule + * @property {string|null} [description] HttpRouteRule description + * @property {google.cloud.compute.v1.IHttpHeaderAction|null} [headerAction] HttpRouteRule headerAction + * @property {Array.|null} [matchRules] HttpRouteRule matchRules + * @property {number|null} [priority] HttpRouteRule priority + * @property {google.cloud.compute.v1.IHttpRouteAction|null} [routeAction] HttpRouteRule routeAction + * @property {string|null} [service] HttpRouteRule service + * @property {google.cloud.compute.v1.IHttpRedirectAction|null} [urlRedirect] HttpRouteRule urlRedirect + */ + + /** + * Constructs a new HttpRouteRule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HttpRouteRule. + * @implements IHttpRouteRule + * @constructor + * @param {google.cloud.compute.v1.IHttpRouteRule=} [properties] Properties to set + */ + function HttpRouteRule(properties) { + this.matchRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRouteRule description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + HttpRouteRule.prototype.description = null; + + /** + * HttpRouteRule headerAction. + * @member {google.cloud.compute.v1.IHttpHeaderAction|null|undefined} headerAction + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + HttpRouteRule.prototype.headerAction = null; + + /** + * HttpRouteRule matchRules. + * @member {Array.} matchRules + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + HttpRouteRule.prototype.matchRules = $util.emptyArray; + + /** + * HttpRouteRule priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + HttpRouteRule.prototype.priority = null; + + /** + * HttpRouteRule routeAction. + * @member {google.cloud.compute.v1.IHttpRouteAction|null|undefined} routeAction + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + HttpRouteRule.prototype.routeAction = null; + + /** + * HttpRouteRule service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + HttpRouteRule.prototype.service = null; + + /** + * HttpRouteRule urlRedirect. + * @member {google.cloud.compute.v1.IHttpRedirectAction|null|undefined} urlRedirect + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + HttpRouteRule.prototype.urlRedirect = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRouteRule _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + Object.defineProperty(HttpRouteRule.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRule _headerAction. + * @member {"headerAction"|undefined} _headerAction + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + Object.defineProperty(HttpRouteRule.prototype, "_headerAction", { + get: $util.oneOfGetter($oneOfFields = ["headerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRule _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + Object.defineProperty(HttpRouteRule.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRule _routeAction. + * @member {"routeAction"|undefined} _routeAction + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + Object.defineProperty(HttpRouteRule.prototype, "_routeAction", { + get: $util.oneOfGetter($oneOfFields = ["routeAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRule _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + Object.defineProperty(HttpRouteRule.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * HttpRouteRule _urlRedirect. + * @member {"urlRedirect"|undefined} _urlRedirect + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + */ + Object.defineProperty(HttpRouteRule.prototype, "_urlRedirect", { + get: $util.oneOfGetter($oneOfFields = ["urlRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRouteRule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {google.cloud.compute.v1.IHttpRouteRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.HttpRouteRule} HttpRouteRule instance + */ + HttpRouteRule.create = function create(properties) { + return new HttpRouteRule(properties); + }; + + /** + * Encodes the specified HttpRouteRule message. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {google.cloud.compute.v1.IHttpRouteRule} message HttpRouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRouteRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.headerAction != null && Object.hasOwnProperty.call(message, "headerAction")) + $root.google.cloud.compute.v1.HttpHeaderAction.encode(message.headerAction, writer.uint32(/* id 328077352, wireType 2 =*/2624618818).fork()).ldelim(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + if (message.matchRules != null && message.matchRules.length) + for (var i = 0; i < message.matchRules.length; ++i) + $root.google.cloud.compute.v1.HttpRouteRuleMatch.encode(message.matchRules[i], writer.uint32(/* id 376200701, wireType 2 =*/3009605610).fork()).ldelim(); + if (message.urlRedirect != null && Object.hasOwnProperty.call(message, "urlRedirect")) + $root.google.cloud.compute.v1.HttpRedirectAction.encode(message.urlRedirect, writer.uint32(/* id 405147820, wireType 2 =*/3241182562).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.routeAction != null && Object.hasOwnProperty.call(message, "routeAction")) + $root.google.cloud.compute.v1.HttpRouteAction.encode(message.routeAction, writer.uint32(/* id 424563948, wireType 2 =*/3396511586).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified HttpRouteRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.HttpRouteRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {google.cloud.compute.v1.IHttpRouteRule} message HttpRouteRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRouteRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRouteRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.HttpRouteRule} HttpRouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRouteRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.HttpRouteRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 328077352: + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.decode(reader, reader.uint32()); + break; + case 376200701: + if (!(message.matchRules && message.matchRules.length)) + message.matchRules = []; + message.matchRules.push($root.google.cloud.compute.v1.HttpRouteRuleMatch.decode(reader, reader.uint32())); + break; + case 445151652: + message.priority = reader.int32(); + break; + case 424563948: + message.routeAction = $root.google.cloud.compute.v1.HttpRouteAction.decode(reader, reader.uint32()); + break; + case 373540533: + message.service = reader.string(); + break; + case 405147820: + message.urlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRouteRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.HttpRouteRule} HttpRouteRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRouteRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRouteRule message. + * @function verify + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRouteRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + properties._headerAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpHeaderAction.verify(message.headerAction); + if (error) + return "headerAction." + error; + } + } + if (message.matchRules != null && message.hasOwnProperty("matchRules")) { + if (!Array.isArray(message.matchRules)) + return "matchRules: array expected"; + for (var i = 0; i < message.matchRules.length; ++i) { + var error = $root.google.cloud.compute.v1.HttpRouteRuleMatch.verify(message.matchRules[i]); + if (error) + return "matchRules." + error; + } + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.routeAction != null && message.hasOwnProperty("routeAction")) { + properties._routeAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpRouteAction.verify(message.routeAction); + if (error) + return "routeAction." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + if (message.urlRedirect != null && message.hasOwnProperty("urlRedirect")) { + properties._urlRedirect = 1; + { + var error = $root.google.cloud.compute.v1.HttpRedirectAction.verify(message.urlRedirect); + if (error) + return "urlRedirect." + error; + } + } + return null; + }; + + /** + * Creates a HttpRouteRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.HttpRouteRule} HttpRouteRule + */ + HttpRouteRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.HttpRouteRule) + return object; + var message = new $root.google.cloud.compute.v1.HttpRouteRule(); + if (object.description != null) + message.description = String(object.description); + if (object.headerAction != null) { + if (typeof object.headerAction !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteRule.headerAction: object expected"); + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.fromObject(object.headerAction); + } + if (object.matchRules) { + if (!Array.isArray(object.matchRules)) + throw TypeError(".google.cloud.compute.v1.HttpRouteRule.matchRules: array expected"); + message.matchRules = []; + for (var i = 0; i < object.matchRules.length; ++i) { + if (typeof object.matchRules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteRule.matchRules: object expected"); + message.matchRules[i] = $root.google.cloud.compute.v1.HttpRouteRuleMatch.fromObject(object.matchRules[i]); + } + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.routeAction != null) { + if (typeof object.routeAction !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteRule.routeAction: object expected"); + message.routeAction = $root.google.cloud.compute.v1.HttpRouteAction.fromObject(object.routeAction); + } + if (object.service != null) + message.service = String(object.service); + if (object.urlRedirect != null) { + if (typeof object.urlRedirect !== "object") + throw TypeError(".google.cloud.compute.v1.HttpRouteRule.urlRedirect: object expected"); + message.urlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.fromObject(object.urlRedirect); + } + return message; + }; + + /** + * Creates a plain object from a HttpRouteRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.HttpRouteRule + * @static + * @param {google.cloud.compute.v1.HttpRouteRule} message HttpRouteRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRouteRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.matchRules = []; + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + object.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.toObject(message.headerAction, options); + if (options.oneofs) + object._headerAction = "headerAction"; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + if (message.matchRules && message.matchRules.length) { + object.matchRules = []; + for (var j = 0; j < message.matchRules.length; ++j) + object.matchRules[j] = $root.google.cloud.compute.v1.HttpRouteRuleMatch.toObject(message.matchRules[j], options); + } + if (message.urlRedirect != null && message.hasOwnProperty("urlRedirect")) { + object.urlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.toObject(message.urlRedirect, options); + if (options.oneofs) + object._urlRedirect = "urlRedirect"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.routeAction != null && message.hasOwnProperty("routeAction")) { + object.routeAction = $root.google.cloud.compute.v1.HttpRouteAction.toObject(message.routeAction, options); + if (options.oneofs) + object._routeAction = "routeAction"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + return object; + }; + + /** + * Converts this HttpRouteRule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.HttpRouteRule + * @instance + * @returns {Object.} JSON object + */ + HttpRouteRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HttpRouteRule; + })(); + + v1.RawDisk = (function() { + + /** + * Properties of a RawDisk. + * @memberof google.cloud.compute.v1 + * @interface IRawDisk + * @property {google.cloud.compute.v1.RawDisk.ContainerType|null} [containerType] RawDisk containerType + * @property {string|null} [sha1Checksum] RawDisk sha1Checksum + * @property {string|null} [source] RawDisk source + */ + + /** + * Constructs a new RawDisk. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RawDisk. + * @implements IRawDisk + * @constructor + * @param {google.cloud.compute.v1.IRawDisk=} [properties] Properties to set + */ + function RawDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawDisk containerType. + * @member {google.cloud.compute.v1.RawDisk.ContainerType|null|undefined} containerType + * @memberof google.cloud.compute.v1.RawDisk + * @instance + */ + RawDisk.prototype.containerType = null; + + /** + * RawDisk sha1Checksum. + * @member {string|null|undefined} sha1Checksum + * @memberof google.cloud.compute.v1.RawDisk + * @instance + */ + RawDisk.prototype.sha1Checksum = null; + + /** + * RawDisk source. + * @member {string|null|undefined} source + * @memberof google.cloud.compute.v1.RawDisk + * @instance + */ + RawDisk.prototype.source = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RawDisk _containerType. + * @member {"containerType"|undefined} _containerType + * @memberof google.cloud.compute.v1.RawDisk + * @instance + */ + Object.defineProperty(RawDisk.prototype, "_containerType", { + get: $util.oneOfGetter($oneOfFields = ["containerType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RawDisk _sha1Checksum. + * @member {"sha1Checksum"|undefined} _sha1Checksum + * @memberof google.cloud.compute.v1.RawDisk + * @instance + */ + Object.defineProperty(RawDisk.prototype, "_sha1Checksum", { + get: $util.oneOfGetter($oneOfFields = ["sha1Checksum"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RawDisk _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.compute.v1.RawDisk + * @instance + */ + Object.defineProperty(RawDisk.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RawDisk instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {google.cloud.compute.v1.IRawDisk=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RawDisk} RawDisk instance + */ + RawDisk.create = function create(properties) { + return new RawDisk(properties); + }; + + /** + * Encodes the specified RawDisk message. Does not implicitly {@link google.cloud.compute.v1.RawDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {google.cloud.compute.v1.IRawDisk} message RawDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 177235995, wireType 2 =*/1417887962).string(message.source); + if (message.sha1Checksum != null && Object.hasOwnProperty.call(message, "sha1Checksum")) + writer.uint32(/* id 314444349, wireType 2 =*/2515554794).string(message.sha1Checksum); + if (message.containerType != null && Object.hasOwnProperty.call(message, "containerType")) + writer.uint32(/* id 318809144, wireType 0 =*/2550473152).int32(message.containerType); + return writer; + }; + + /** + * Encodes the specified RawDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RawDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {google.cloud.compute.v1.IRawDisk} message RawDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RawDisk} RawDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RawDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 318809144: + message.containerType = reader.int32(); + break; + case 314444349: + message.sha1Checksum = reader.string(); + break; + case 177235995: + message.source = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RawDisk} RawDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawDisk message. + * @function verify + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.containerType != null && message.hasOwnProperty("containerType")) { + properties._containerType = 1; + switch (message.containerType) { + default: + return "containerType: enum value expected"; + case 0: + case 82821: + break; + } + } + if (message.sha1Checksum != null && message.hasOwnProperty("sha1Checksum")) { + properties._sha1Checksum = 1; + if (!$util.isString(message.sha1Checksum)) + return "sha1Checksum: string expected"; + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + return null; + }; + + /** + * Creates a RawDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RawDisk} RawDisk + */ + RawDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RawDisk) + return object; + var message = new $root.google.cloud.compute.v1.RawDisk(); + switch (object.containerType) { + case "UNDEFINED_CONTAINER_TYPE": + case 0: + message.containerType = 0; + break; + case "TAR": + case 82821: + message.containerType = 82821; + break; + } + if (object.sha1Checksum != null) + message.sha1Checksum = String(object.sha1Checksum); + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a RawDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RawDisk + * @static + * @param {google.cloud.compute.v1.RawDisk} message RawDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.sha1Checksum != null && message.hasOwnProperty("sha1Checksum")) { + object.sha1Checksum = message.sha1Checksum; + if (options.oneofs) + object._sha1Checksum = "sha1Checksum"; + } + if (message.containerType != null && message.hasOwnProperty("containerType")) { + object.containerType = options.enums === String ? $root.google.cloud.compute.v1.RawDisk.ContainerType[message.containerType] : message.containerType; + if (options.oneofs) + object._containerType = "containerType"; + } + return object; + }; + + /** + * Converts this RawDisk to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RawDisk + * @instance + * @returns {Object.} JSON object + */ + RawDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ContainerType enum. + * @name google.cloud.compute.v1.RawDisk.ContainerType + * @enum {number} + * @property {number} UNDEFINED_CONTAINER_TYPE=0 UNDEFINED_CONTAINER_TYPE value + * @property {number} TAR=82821 TAR value + */ + RawDisk.ContainerType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CONTAINER_TYPE"] = 0; + values[valuesById[82821] = "TAR"] = 82821; + return values; + })(); + + return RawDisk; + })(); + + v1.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.compute.v1 + * @interface IImage + * @property {number|Long|null} [archiveSizeBytes] Image archiveSizeBytes + * @property {string|null} [creationTimestamp] Image creationTimestamp + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecated] Image deprecated + * @property {string|null} [description] Image description + * @property {number|Long|null} [diskSizeGb] Image diskSizeGb + * @property {string|null} [family] Image family + * @property {Array.|null} [guestOsFeatures] Image guestOsFeatures + * @property {number|Long|null} [id] Image id + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [imageEncryptionKey] Image imageEncryptionKey + * @property {string|null} [kind] Image kind + * @property {string|null} [labelFingerprint] Image labelFingerprint + * @property {Object.|null} [labels] Image labels + * @property {Array.|null} [licenseCodes] Image licenseCodes + * @property {Array.|null} [licenses] Image licenses + * @property {string|null} [name] Image name + * @property {google.cloud.compute.v1.IRawDisk|null} [rawDisk] Image rawDisk + * @property {boolean|null} [satisfiesPzs] Image satisfiesPzs + * @property {string|null} [selfLink] Image selfLink + * @property {google.cloud.compute.v1.IInitialStateConfig|null} [shieldedInstanceInitialState] Image shieldedInstanceInitialState + * @property {string|null} [sourceDisk] Image sourceDisk + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceDiskEncryptionKey] Image sourceDiskEncryptionKey + * @property {string|null} [sourceDiskId] Image sourceDiskId + * @property {string|null} [sourceImage] Image sourceImage + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceImageEncryptionKey] Image sourceImageEncryptionKey + * @property {string|null} [sourceImageId] Image sourceImageId + * @property {string|null} [sourceSnapshot] Image sourceSnapshot + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceSnapshotEncryptionKey] Image sourceSnapshotEncryptionKey + * @property {string|null} [sourceSnapshotId] Image sourceSnapshotId + * @property {google.cloud.compute.v1.Image.SourceType|null} [sourceType] Image sourceType + * @property {google.cloud.compute.v1.Image.Status|null} [status] Image status + * @property {Array.|null} [storageLocations] Image storageLocations + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.compute.v1.IImage=} [properties] Properties to set + */ + function Image(properties) { + this.guestOsFeatures = []; + this.labels = {}; + this.licenseCodes = []; + this.licenses = []; + this.storageLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image archiveSizeBytes. + * @member {number|Long|null|undefined} archiveSizeBytes + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.archiveSizeBytes = null; + + /** + * Image creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.creationTimestamp = null; + + /** + * Image deprecated. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecated + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.deprecated = null; + + /** + * Image description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.description = null; + + /** + * Image diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.diskSizeGb = null; + + /** + * Image family. + * @member {string|null|undefined} family + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.family = null; + + /** + * Image guestOsFeatures. + * @member {Array.} guestOsFeatures + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.guestOsFeatures = $util.emptyArray; + + /** + * Image id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.id = null; + + /** + * Image imageEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} imageEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.imageEncryptionKey = null; + + /** + * Image kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.kind = null; + + /** + * Image labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.labelFingerprint = null; + + /** + * Image labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.labels = $util.emptyObject; + + /** + * Image licenseCodes. + * @member {Array.} licenseCodes + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.licenseCodes = $util.emptyArray; + + /** + * Image licenses. + * @member {Array.} licenses + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.licenses = $util.emptyArray; + + /** + * Image name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.name = null; + + /** + * Image rawDisk. + * @member {google.cloud.compute.v1.IRawDisk|null|undefined} rawDisk + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.rawDisk = null; + + /** + * Image satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.satisfiesPzs = null; + + /** + * Image selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.selfLink = null; + + /** + * Image shieldedInstanceInitialState. + * @member {google.cloud.compute.v1.IInitialStateConfig|null|undefined} shieldedInstanceInitialState + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.shieldedInstanceInitialState = null; + + /** + * Image sourceDisk. + * @member {string|null|undefined} sourceDisk + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceDisk = null; + + /** + * Image sourceDiskEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceDiskEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceDiskEncryptionKey = null; + + /** + * Image sourceDiskId. + * @member {string|null|undefined} sourceDiskId + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceDiskId = null; + + /** + * Image sourceImage. + * @member {string|null|undefined} sourceImage + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceImage = null; + + /** + * Image sourceImageEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceImageEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceImageEncryptionKey = null; + + /** + * Image sourceImageId. + * @member {string|null|undefined} sourceImageId + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceImageId = null; + + /** + * Image sourceSnapshot. + * @member {string|null|undefined} sourceSnapshot + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceSnapshot = null; + + /** + * Image sourceSnapshotEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceSnapshotEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceSnapshotEncryptionKey = null; + + /** + * Image sourceSnapshotId. + * @member {string|null|undefined} sourceSnapshotId + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceSnapshotId = null; + + /** + * Image sourceType. + * @member {google.cloud.compute.v1.Image.SourceType|null|undefined} sourceType + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.sourceType = null; + + /** + * Image status. + * @member {google.cloud.compute.v1.Image.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.status = null; + + /** + * Image storageLocations. + * @member {Array.} storageLocations + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Image.prototype.storageLocations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Image _archiveSizeBytes. + * @member {"archiveSizeBytes"|undefined} _archiveSizeBytes + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_archiveSizeBytes", { + get: $util.oneOfGetter($oneOfFields = ["archiveSizeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _family. + * @member {"family"|undefined} _family + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_family", { + get: $util.oneOfGetter($oneOfFields = ["family"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _imageEncryptionKey. + * @member {"imageEncryptionKey"|undefined} _imageEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_imageEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["imageEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _rawDisk. + * @member {"rawDisk"|undefined} _rawDisk + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_rawDisk", { + get: $util.oneOfGetter($oneOfFields = ["rawDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _satisfiesPzs. + * @member {"satisfiesPzs"|undefined} _satisfiesPzs + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _shieldedInstanceInitialState. + * @member {"shieldedInstanceInitialState"|undefined} _shieldedInstanceInitialState + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_shieldedInstanceInitialState", { + get: $util.oneOfGetter($oneOfFields = ["shieldedInstanceInitialState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceDisk. + * @member {"sourceDisk"|undefined} _sourceDisk + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceDisk", { + get: $util.oneOfGetter($oneOfFields = ["sourceDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceDiskEncryptionKey. + * @member {"sourceDiskEncryptionKey"|undefined} _sourceDiskEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceDiskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceDiskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceDiskId. + * @member {"sourceDiskId"|undefined} _sourceDiskId + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceDiskId", { + get: $util.oneOfGetter($oneOfFields = ["sourceDiskId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceImage. + * @member {"sourceImage"|undefined} _sourceImage + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceImage", { + get: $util.oneOfGetter($oneOfFields = ["sourceImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceImageEncryptionKey. + * @member {"sourceImageEncryptionKey"|undefined} _sourceImageEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceImageEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceImageEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceImageId. + * @member {"sourceImageId"|undefined} _sourceImageId + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceImageId", { + get: $util.oneOfGetter($oneOfFields = ["sourceImageId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceSnapshot. + * @member {"sourceSnapshot"|undefined} _sourceSnapshot + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceSnapshot", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceSnapshotEncryptionKey. + * @member {"sourceSnapshotEncryptionKey"|undefined} _sourceSnapshotEncryptionKey + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceSnapshotEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshotEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceSnapshotId. + * @member {"sourceSnapshotId"|undefined} _sourceSnapshotId + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceSnapshotId", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshotId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _sourceType. + * @member {"sourceType"|undefined} _sourceType + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_sourceType", { + get: $util.oneOfGetter($oneOfFields = ["sourceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Image _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Image + * @instance + */ + Object.defineProperty(Image.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Image + * @static + * @param {google.cloud.compute.v1.IImage=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.compute.v1.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Image + * @static + * @param {google.cloud.compute.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.licenseCodes != null && message.licenseCodes.length) { + writer.uint32(/* id 45482664, wireType 2 =*/363861314).fork(); + for (var i = 0; i < message.licenseCodes.length; ++i) + writer.int64(message.licenseCodes[i]); + writer.ldelim(); + } + if (message.sourceImage != null && Object.hasOwnProperty.call(message, "sourceImage")) + writer.uint32(/* id 50443319, wireType 2 =*/403546554).string(message.sourceImage); + if (message.sourceImageId != null && Object.hasOwnProperty.call(message, "sourceImageId")) + writer.uint32(/* id 55328291, wireType 2 =*/442626330).string(message.sourceImageId); + if (message.guestOsFeatures != null && message.guestOsFeatures.length) + for (var i = 0; i < message.guestOsFeatures.length; ++i) + $root.google.cloud.compute.v1.GuestOsFeature.encode(message.guestOsFeatures[i], writer.uint32(/* id 79294545, wireType 2 =*/634356362).fork()).ldelim(); + if (message.sourceSnapshotId != null && Object.hasOwnProperty.call(message, "sourceSnapshotId")) + writer.uint32(/* id 98962258, wireType 2 =*/791698066).string(message.sourceSnapshotId); + if (message.sourceSnapshot != null && Object.hasOwnProperty.call(message, "sourceSnapshot")) + writer.uint32(/* id 126061928, wireType 2 =*/1008495426).string(message.sourceSnapshot); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.shieldedInstanceInitialState != null && Object.hasOwnProperty.call(message, "shieldedInstanceInitialState")) + $root.google.cloud.compute.v1.InitialStateConfig.encode(message.shieldedInstanceInitialState, writer.uint32(/* id 192356867, wireType 2 =*/1538854938).fork()).ldelim(); + if (message.sourceSnapshotEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceSnapshotEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceSnapshotEncryptionKey, writer.uint32(/* id 303679322, wireType 2 =*/2429434578).fork()).ldelim(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 316263735, wireType 0 =*/2530109880).int64(message.diskSizeGb); + if (message.storageLocations != null && message.storageLocations.length) + for (var i = 0; i < message.storageLocations.length; ++i) + writer.uint32(/* id 328005274, wireType 2 =*/2624042194).string(message.storageLocations[i]); + if (message.family != null && Object.hasOwnProperty.call(message, "family")) + writer.uint32(/* id 328751972, wireType 2 =*/2630015778).string(message.family); + if (message.licenses != null && message.licenses.length) + for (var i = 0; i < message.licenses.length; ++i) + writer.uint32(/* id 337642578, wireType 2 =*/2701140626).string(message.licenses[i]); + if (message.imageEncryptionKey != null && Object.hasOwnProperty.call(message, "imageEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.imageEncryptionKey, writer.uint32(/* id 379512583, wireType 2 =*/3036100666).fork()).ldelim(); + if (message.archiveSizeBytes != null && Object.hasOwnProperty.call(message, "archiveSizeBytes")) + writer.uint32(/* id 381093450, wireType 0 =*/3048747600).int64(message.archiveSizeBytes); + if (message.sourceImageEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceImageEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceImageEncryptionKey, writer.uint32(/* id 381503659, wireType 2 =*/3052029274).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.sourceDisk != null && Object.hasOwnProperty.call(message, "sourceDisk")) + writer.uint32(/* id 451753793, wireType 2 =*/3614030346).string(message.sourceDisk); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 452245726, wireType 0 =*/3617965808).int32(message.sourceType); + if (message.sourceDiskId != null && Object.hasOwnProperty.call(message, "sourceDiskId")) + writer.uint32(/* id 454190809, wireType 2 =*/3633526474).string(message.sourceDiskId); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 480964267, wireType 0 =*/3847714136).bool(message.satisfiesPzs); + 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 500195327, wireType 2 =*/4001562618).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.rawDisk != null && Object.hasOwnProperty.call(message, "rawDisk")) + $root.google.cloud.compute.v1.RawDisk.encode(message.rawDisk, writer.uint32(/* id 503113556, wireType 2 =*/4024908450).fork()).ldelim(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecated, writer.uint32(/* id 515138995, wireType 2 =*/4121111962).fork()).ldelim(); + if (message.sourceDiskEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceDiskEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceDiskEncryptionKey, writer.uint32(/* id 531501153, wireType 2 =*/4252009226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Image + * @static + * @param {google.cloud.compute.v1.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Image(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 381093450: + message.archiveSizeBytes = reader.int64(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 515138995: + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 316263735: + message.diskSizeGb = reader.int64(); + break; + case 328751972: + message.family = reader.string(); + break; + case 79294545: + if (!(message.guestOsFeatures && message.guestOsFeatures.length)) + message.guestOsFeatures = []; + message.guestOsFeatures.push($root.google.cloud.compute.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + case 3355: + message.id = reader.uint64(); + break; + case 379512583: + message.imageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 3292052: + message.kind = reader.string(); + break; + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 45482664: + if (!(message.licenseCodes && message.licenseCodes.length)) + message.licenseCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.licenseCodes.push(reader.int64()); + } else + message.licenseCodes.push(reader.int64()); + break; + case 337642578: + if (!(message.licenses && message.licenses.length)) + message.licenses = []; + message.licenses.push(reader.string()); + break; + case 3373707: + message.name = reader.string(); + break; + case 503113556: + message.rawDisk = $root.google.cloud.compute.v1.RawDisk.decode(reader, reader.uint32()); + break; + case 480964267: + message.satisfiesPzs = reader.bool(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 192356867: + message.shieldedInstanceInitialState = $root.google.cloud.compute.v1.InitialStateConfig.decode(reader, reader.uint32()); + break; + case 451753793: + message.sourceDisk = reader.string(); + break; + case 531501153: + message.sourceDiskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 454190809: + message.sourceDiskId = reader.string(); + break; + case 50443319: + message.sourceImage = reader.string(); + break; + case 381503659: + message.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 55328291: + message.sourceImageId = reader.string(); + break; + case 126061928: + message.sourceSnapshot = reader.string(); + break; + case 303679322: + message.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 98962258: + message.sourceSnapshotId = reader.string(); + break; + case 452245726: + message.sourceType = reader.int32(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 328005274: + if (!(message.storageLocations && message.storageLocations.length)) + message.storageLocations = []; + message.storageLocations.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.compute.v1.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.archiveSizeBytes != null && message.hasOwnProperty("archiveSizeBytes")) { + properties._archiveSizeBytes = 1; + if (!$util.isInteger(message.archiveSizeBytes) && !(message.archiveSizeBytes && $util.isInteger(message.archiveSizeBytes.low) && $util.isInteger(message.archiveSizeBytes.high))) + return "archiveSizeBytes: integer|Long expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecated); + if (error) + return "deprecated." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message.family != null && message.hasOwnProperty("family")) { + properties._family = 1; + if (!$util.isString(message.family)) + return "family: string expected"; + } + if (message.guestOsFeatures != null && message.hasOwnProperty("guestOsFeatures")) { + if (!Array.isArray(message.guestOsFeatures)) + return "guestOsFeatures: array expected"; + for (var i = 0; i < message.guestOsFeatures.length; ++i) { + var error = $root.google.cloud.compute.v1.GuestOsFeature.verify(message.guestOsFeatures[i]); + if (error) + return "guestOsFeatures." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.imageEncryptionKey != null && message.hasOwnProperty("imageEncryptionKey")) { + properties._imageEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.imageEncryptionKey); + if (error) + return "imageEncryptionKey." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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.licenseCodes != null && message.hasOwnProperty("licenseCodes")) { + if (!Array.isArray(message.licenseCodes)) + return "licenseCodes: array expected"; + for (var i = 0; i < message.licenseCodes.length; ++i) + if (!$util.isInteger(message.licenseCodes[i]) && !(message.licenseCodes[i] && $util.isInteger(message.licenseCodes[i].low) && $util.isInteger(message.licenseCodes[i].high))) + return "licenseCodes: integer|Long[] expected"; + } + if (message.licenses != null && message.hasOwnProperty("licenses")) { + if (!Array.isArray(message.licenses)) + return "licenses: array expected"; + for (var i = 0; i < message.licenses.length; ++i) + if (!$util.isString(message.licenses[i])) + return "licenses: string[] expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.rawDisk != null && message.hasOwnProperty("rawDisk")) { + properties._rawDisk = 1; + { + var error = $root.google.cloud.compute.v1.RawDisk.verify(message.rawDisk); + if (error) + return "rawDisk." + error; + } + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.shieldedInstanceInitialState != null && message.hasOwnProperty("shieldedInstanceInitialState")) { + properties._shieldedInstanceInitialState = 1; + { + var error = $root.google.cloud.compute.v1.InitialStateConfig.verify(message.shieldedInstanceInitialState); + if (error) + return "shieldedInstanceInitialState." + error; + } + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + properties._sourceDisk = 1; + if (!$util.isString(message.sourceDisk)) + return "sourceDisk: string expected"; + } + if (message.sourceDiskEncryptionKey != null && message.hasOwnProperty("sourceDiskEncryptionKey")) { + properties._sourceDiskEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceDiskEncryptionKey); + if (error) + return "sourceDiskEncryptionKey." + error; + } + } + if (message.sourceDiskId != null && message.hasOwnProperty("sourceDiskId")) { + properties._sourceDiskId = 1; + if (!$util.isString(message.sourceDiskId)) + return "sourceDiskId: string expected"; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + properties._sourceImage = 1; + if (!$util.isString(message.sourceImage)) + return "sourceImage: string expected"; + } + if (message.sourceImageEncryptionKey != null && message.hasOwnProperty("sourceImageEncryptionKey")) { + properties._sourceImageEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceImageEncryptionKey); + if (error) + return "sourceImageEncryptionKey." + error; + } + } + if (message.sourceImageId != null && message.hasOwnProperty("sourceImageId")) { + properties._sourceImageId = 1; + if (!$util.isString(message.sourceImageId)) + return "sourceImageId: string expected"; + } + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + properties._sourceSnapshot = 1; + if (!$util.isString(message.sourceSnapshot)) + return "sourceSnapshot: string expected"; + } + if (message.sourceSnapshotEncryptionKey != null && message.hasOwnProperty("sourceSnapshotEncryptionKey")) { + properties._sourceSnapshotEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceSnapshotEncryptionKey); + if (error) + return "sourceSnapshotEncryptionKey." + error; + } + } + if (message.sourceSnapshotId != null && message.hasOwnProperty("sourceSnapshotId")) { + properties._sourceSnapshotId = 1; + if (!$util.isString(message.sourceSnapshotId)) + return "sourceSnapshotId: string expected"; + } + if (message.sourceType != null && message.hasOwnProperty("sourceType")) { + properties._sourceType = 1; + switch (message.sourceType) { + default: + return "sourceType: enum value expected"; + case 0: + case 80904: + break; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 528602024: + case 455706685: + case 35394935: + case 77848963: + break; + } + } + if (message.storageLocations != null && message.hasOwnProperty("storageLocations")) { + if (!Array.isArray(message.storageLocations)) + return "storageLocations: array expected"; + for (var i = 0; i < message.storageLocations.length; ++i) + if (!$util.isString(message.storageLocations[i])) + return "storageLocations: string[] expected"; + } + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Image) + return object; + var message = new $root.google.cloud.compute.v1.Image(); + if (object.archiveSizeBytes != null) + if ($util.Long) + (message.archiveSizeBytes = $util.Long.fromValue(object.archiveSizeBytes)).unsigned = false; + else if (typeof object.archiveSizeBytes === "string") + message.archiveSizeBytes = parseInt(object.archiveSizeBytes, 10); + else if (typeof object.archiveSizeBytes === "number") + message.archiveSizeBytes = object.archiveSizeBytes; + else if (typeof object.archiveSizeBytes === "object") + message.archiveSizeBytes = new $util.LongBits(object.archiveSizeBytes.low >>> 0, object.archiveSizeBytes.high >>> 0).toNumber(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.deprecated != null) { + if (typeof object.deprecated !== "object") + throw TypeError(".google.cloud.compute.v1.Image.deprecated: object expected"); + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecated); + } + if (object.description != null) + message.description = String(object.description); + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + if (object.family != null) + message.family = String(object.family); + if (object.guestOsFeatures) { + if (!Array.isArray(object.guestOsFeatures)) + throw TypeError(".google.cloud.compute.v1.Image.guestOsFeatures: array expected"); + message.guestOsFeatures = []; + for (var i = 0; i < object.guestOsFeatures.length; ++i) { + if (typeof object.guestOsFeatures[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Image.guestOsFeatures: object expected"); + message.guestOsFeatures[i] = $root.google.cloud.compute.v1.GuestOsFeature.fromObject(object.guestOsFeatures[i]); + } + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.imageEncryptionKey != null) { + if (typeof object.imageEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Image.imageEncryptionKey: object expected"); + message.imageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.imageEncryptionKey); + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.Image.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.licenseCodes) { + if (!Array.isArray(object.licenseCodes)) + throw TypeError(".google.cloud.compute.v1.Image.licenseCodes: array expected"); + message.licenseCodes = []; + for (var i = 0; i < object.licenseCodes.length; ++i) + if ($util.Long) + (message.licenseCodes[i] = $util.Long.fromValue(object.licenseCodes[i])).unsigned = false; + else if (typeof object.licenseCodes[i] === "string") + message.licenseCodes[i] = parseInt(object.licenseCodes[i], 10); + else if (typeof object.licenseCodes[i] === "number") + message.licenseCodes[i] = object.licenseCodes[i]; + else if (typeof object.licenseCodes[i] === "object") + message.licenseCodes[i] = new $util.LongBits(object.licenseCodes[i].low >>> 0, object.licenseCodes[i].high >>> 0).toNumber(); + } + if (object.licenses) { + if (!Array.isArray(object.licenses)) + throw TypeError(".google.cloud.compute.v1.Image.licenses: array expected"); + message.licenses = []; + for (var i = 0; i < object.licenses.length; ++i) + message.licenses[i] = String(object.licenses[i]); + } + if (object.name != null) + message.name = String(object.name); + if (object.rawDisk != null) { + if (typeof object.rawDisk !== "object") + throw TypeError(".google.cloud.compute.v1.Image.rawDisk: object expected"); + message.rawDisk = $root.google.cloud.compute.v1.RawDisk.fromObject(object.rawDisk); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.shieldedInstanceInitialState != null) { + if (typeof object.shieldedInstanceInitialState !== "object") + throw TypeError(".google.cloud.compute.v1.Image.shieldedInstanceInitialState: object expected"); + message.shieldedInstanceInitialState = $root.google.cloud.compute.v1.InitialStateConfig.fromObject(object.shieldedInstanceInitialState); + } + if (object.sourceDisk != null) + message.sourceDisk = String(object.sourceDisk); + if (object.sourceDiskEncryptionKey != null) { + if (typeof object.sourceDiskEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Image.sourceDiskEncryptionKey: object expected"); + message.sourceDiskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceDiskEncryptionKey); + } + if (object.sourceDiskId != null) + message.sourceDiskId = String(object.sourceDiskId); + if (object.sourceImage != null) + message.sourceImage = String(object.sourceImage); + if (object.sourceImageEncryptionKey != null) { + if (typeof object.sourceImageEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Image.sourceImageEncryptionKey: object expected"); + message.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceImageEncryptionKey); + } + if (object.sourceImageId != null) + message.sourceImageId = String(object.sourceImageId); + if (object.sourceSnapshot != null) + message.sourceSnapshot = String(object.sourceSnapshot); + if (object.sourceSnapshotEncryptionKey != null) { + if (typeof object.sourceSnapshotEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Image.sourceSnapshotEncryptionKey: object expected"); + message.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceSnapshotEncryptionKey); + } + if (object.sourceSnapshotId != null) + message.sourceSnapshotId = String(object.sourceSnapshotId); + switch (object.sourceType) { + case "UNDEFINED_SOURCE_TYPE": + case 0: + message.sourceType = 0; + break; + case "RAW": + case 80904: + message.sourceType = 80904; + break; + } + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "FAILED": + case 455706685: + message.status = 455706685; + break; + case "PENDING": + case 35394935: + message.status = 35394935; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + } + if (object.storageLocations) { + if (!Array.isArray(object.storageLocations)) + throw TypeError(".google.cloud.compute.v1.Image.storageLocations: array expected"); + message.storageLocations = []; + for (var i = 0; i < object.storageLocations.length; ++i) + message.storageLocations[i] = String(object.storageLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Image + * @static + * @param {google.cloud.compute.v1.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.licenseCodes = []; + object.guestOsFeatures = []; + object.storageLocations = []; + object.licenses = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.licenseCodes && message.licenseCodes.length) { + object.licenseCodes = []; + for (var j = 0; j < message.licenseCodes.length; ++j) + if (typeof message.licenseCodes[j] === "number") + object.licenseCodes[j] = options.longs === String ? String(message.licenseCodes[j]) : message.licenseCodes[j]; + else + object.licenseCodes[j] = options.longs === String ? $util.Long.prototype.toString.call(message.licenseCodes[j]) : options.longs === Number ? new $util.LongBits(message.licenseCodes[j].low >>> 0, message.licenseCodes[j].high >>> 0).toNumber() : message.licenseCodes[j]; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + object.sourceImage = message.sourceImage; + if (options.oneofs) + object._sourceImage = "sourceImage"; + } + if (message.sourceImageId != null && message.hasOwnProperty("sourceImageId")) { + object.sourceImageId = message.sourceImageId; + if (options.oneofs) + object._sourceImageId = "sourceImageId"; + } + if (message.guestOsFeatures && message.guestOsFeatures.length) { + object.guestOsFeatures = []; + for (var j = 0; j < message.guestOsFeatures.length; ++j) + object.guestOsFeatures[j] = $root.google.cloud.compute.v1.GuestOsFeature.toObject(message.guestOsFeatures[j], options); + } + if (message.sourceSnapshotId != null && message.hasOwnProperty("sourceSnapshotId")) { + object.sourceSnapshotId = message.sourceSnapshotId; + if (options.oneofs) + object._sourceSnapshotId = "sourceSnapshotId"; + } + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + object.sourceSnapshot = message.sourceSnapshot; + if (options.oneofs) + object._sourceSnapshot = "sourceSnapshot"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Image.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.shieldedInstanceInitialState != null && message.hasOwnProperty("shieldedInstanceInitialState")) { + object.shieldedInstanceInitialState = $root.google.cloud.compute.v1.InitialStateConfig.toObject(message.shieldedInstanceInitialState, options); + if (options.oneofs) + object._shieldedInstanceInitialState = "shieldedInstanceInitialState"; + } + if (message.sourceSnapshotEncryptionKey != null && message.hasOwnProperty("sourceSnapshotEncryptionKey")) { + object.sourceSnapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceSnapshotEncryptionKey, options); + if (options.oneofs) + object._sourceSnapshotEncryptionKey = "sourceSnapshotEncryptionKey"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message.storageLocations && message.storageLocations.length) { + object.storageLocations = []; + for (var j = 0; j < message.storageLocations.length; ++j) + object.storageLocations[j] = message.storageLocations[j]; + } + if (message.family != null && message.hasOwnProperty("family")) { + object.family = message.family; + if (options.oneofs) + object._family = "family"; + } + if (message.licenses && message.licenses.length) { + object.licenses = []; + for (var j = 0; j < message.licenses.length; ++j) + object.licenses[j] = message.licenses[j]; + } + if (message.imageEncryptionKey != null && message.hasOwnProperty("imageEncryptionKey")) { + object.imageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.imageEncryptionKey, options); + if (options.oneofs) + object._imageEncryptionKey = "imageEncryptionKey"; + } + if (message.archiveSizeBytes != null && message.hasOwnProperty("archiveSizeBytes")) { + if (typeof message.archiveSizeBytes === "number") + object.archiveSizeBytes = options.longs === String ? String(message.archiveSizeBytes) : message.archiveSizeBytes; + else + object.archiveSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.archiveSizeBytes) : options.longs === Number ? new $util.LongBits(message.archiveSizeBytes.low >>> 0, message.archiveSizeBytes.high >>> 0).toNumber() : message.archiveSizeBytes; + if (options.oneofs) + object._archiveSizeBytes = "archiveSizeBytes"; + } + if (message.sourceImageEncryptionKey != null && message.hasOwnProperty("sourceImageEncryptionKey")) { + object.sourceImageEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceImageEncryptionKey, options); + if (options.oneofs) + object._sourceImageEncryptionKey = "sourceImageEncryptionKey"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + object.sourceDisk = message.sourceDisk; + if (options.oneofs) + object._sourceDisk = "sourceDisk"; + } + if (message.sourceType != null && message.hasOwnProperty("sourceType")) { + object.sourceType = options.enums === String ? $root.google.cloud.compute.v1.Image.SourceType[message.sourceType] : message.sourceType; + if (options.oneofs) + object._sourceType = "sourceType"; + } + if (message.sourceDiskId != null && message.hasOwnProperty("sourceDiskId")) { + object.sourceDiskId = message.sourceDiskId; + if (options.oneofs) + object._sourceDiskId = "sourceDiskId"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + 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.rawDisk != null && message.hasOwnProperty("rawDisk")) { + object.rawDisk = $root.google.cloud.compute.v1.RawDisk.toObject(message.rawDisk, options); + if (options.oneofs) + object._rawDisk = "rawDisk"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecated, options); + if (options.oneofs) + object._deprecated = "deprecated"; + } + if (message.sourceDiskEncryptionKey != null && message.hasOwnProperty("sourceDiskEncryptionKey")) { + object.sourceDiskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceDiskEncryptionKey, options); + if (options.oneofs) + object._sourceDiskEncryptionKey = "sourceDiskEncryptionKey"; + } + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SourceType enum. + * @name google.cloud.compute.v1.Image.SourceType + * @enum {number} + * @property {number} UNDEFINED_SOURCE_TYPE=0 UNDEFINED_SOURCE_TYPE value + * @property {number} RAW=80904 RAW value + */ + Image.SourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_SOURCE_TYPE"] = 0; + values[valuesById[80904] = "RAW"] = 80904; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.Image.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} DELETING=528602024 DELETING value + * @property {number} FAILED=455706685 FAILED value + * @property {number} PENDING=35394935 PENDING value + * @property {number} READY=77848963 READY value + */ + Image.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[455706685] = "FAILED"] = 455706685; + values[valuesById[35394935] = "PENDING"] = 35394935; + values[valuesById[77848963] = "READY"] = 77848963; + return values; + })(); + + return Image; + })(); + + v1.ImageList = (function() { + + /** + * Properties of an ImageList. + * @memberof google.cloud.compute.v1 + * @interface IImageList + * @property {string|null} [id] ImageList id + * @property {Array.|null} [items] ImageList items + * @property {string|null} [kind] ImageList kind + * @property {string|null} [nextPageToken] ImageList nextPageToken + * @property {string|null} [selfLink] ImageList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] ImageList warning + */ + + /** + * Constructs a new ImageList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ImageList. + * @implements IImageList + * @constructor + * @param {google.cloud.compute.v1.IImageList=} [properties] Properties to set + */ + function ImageList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + ImageList.prototype.id = null; + + /** + * ImageList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + ImageList.prototype.items = $util.emptyArray; + + /** + * ImageList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + ImageList.prototype.kind = null; + + /** + * ImageList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + ImageList.prototype.nextPageToken = null; + + /** + * ImageList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + ImageList.prototype.selfLink = null; + + /** + * ImageList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + ImageList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImageList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + Object.defineProperty(ImageList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ImageList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + Object.defineProperty(ImageList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ImageList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + Object.defineProperty(ImageList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ImageList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + Object.defineProperty(ImageList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ImageList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ImageList + * @instance + */ + Object.defineProperty(ImageList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImageList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {google.cloud.compute.v1.IImageList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ImageList} ImageList instance + */ + ImageList.create = function create(properties) { + return new ImageList(properties); + }; + + /** + * Encodes the specified ImageList message. Does not implicitly {@link google.cloud.compute.v1.ImageList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {google.cloud.compute.v1.IImageList} message ImageList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Image.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ImageList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ImageList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {google.cloud.compute.v1.IImageList} message ImageList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ImageList} ImageList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ImageList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Image.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ImageList} ImageList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageList message. + * @function verify + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Image.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an ImageList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ImageList} ImageList + */ + ImageList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ImageList) + return object; + var message = new $root.google.cloud.compute.v1.ImageList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.ImageList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ImageList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Image.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ImageList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an ImageList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ImageList + * @static + * @param {google.cloud.compute.v1.ImageList} message ImageList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Image.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ImageList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ImageList + * @instance + * @returns {Object.} JSON object + */ + ImageList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageList; + })(); + + v1.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.compute.v1 + * @interface IMetadata + * @property {string|null} [fingerprint] Metadata fingerprint + * @property {Array.|null} [items] Metadata items + * @property {string|null} [kind] Metadata kind + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.compute.v1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.items = []; + if (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 fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.Metadata + * @instance + */ + Metadata.prototype.fingerprint = null; + + /** + * Metadata items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.Metadata + * @instance + */ + Metadata.prototype.items = $util.emptyArray; + + /** + * Metadata kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Metadata + * @instance + */ + Metadata.prototype.kind = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Metadata _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.Metadata + * @instance + */ + Object.defineProperty(Metadata.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Metadata _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Metadata + * @instance + */ + Object.defineProperty(Metadata.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Metadata + * @static + * @param {google.cloud.compute.v1.IMetadata=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.compute.v1.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Metadata + * @static + * @param {google.cloud.compute.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.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Items.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Metadata + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 234678500: + message.fingerprint = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Items.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + 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.compute.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Items.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Metadata) + return object; + var message = new $root.google.cloud.compute.v1.Metadata(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.Metadata.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Metadata.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Items.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Metadata + * @static + * @param {google.cloud.compute.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.arrays || options.defaults) + object.items = []; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Items.toObject(message.items[j], options); + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Metadata; + })(); + + v1.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.compute.v1 + * @interface INetworkInterface + * @property {Array.|null} [accessConfigs] NetworkInterface accessConfigs + * @property {Array.|null} [aliasIpRanges] NetworkInterface aliasIpRanges + * @property {string|null} [fingerprint] NetworkInterface fingerprint + * @property {string|null} [ipv6Address] NetworkInterface ipv6Address + * @property {string|null} [kind] NetworkInterface kind + * @property {string|null} [name] NetworkInterface name + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [networkIP] NetworkInterface networkIP + * @property {google.cloud.compute.v1.NetworkInterface.NicType|null} [nicType] NetworkInterface nicType + * @property {string|null} [subnetwork] NetworkInterface subnetwork + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.compute.v1.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + this.accessConfigs = []; + this.aliasIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface accessConfigs. + * @member {Array.} accessConfigs + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.accessConfigs = $util.emptyArray; + + /** + * NetworkInterface aliasIpRanges. + * @member {Array.} aliasIpRanges + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.aliasIpRanges = $util.emptyArray; + + /** + * NetworkInterface fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.fingerprint = null; + + /** + * NetworkInterface ipv6Address. + * @member {string|null|undefined} ipv6Address + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6Address = null; + + /** + * NetworkInterface kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.kind = null; + + /** + * NetworkInterface name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.name = null; + + /** + * NetworkInterface network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = null; + + /** + * NetworkInterface networkIP. + * @member {string|null|undefined} networkIP + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.networkIP = null; + + /** + * NetworkInterface nicType. + * @member {google.cloud.compute.v1.NetworkInterface.NicType|null|undefined} nicType + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.nicType = null; + + /** + * NetworkInterface subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkInterface _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _ipv6Address. + * @member {"ipv6Address"|undefined} _ipv6Address + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_ipv6Address", { + get: $util.oneOfGetter($oneOfFields = ["ipv6Address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _networkIP. + * @member {"networkIP"|undefined} _networkIP + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_networkIP", { + get: $util.oneOfGetter($oneOfFields = ["networkIP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _nicType. + * @member {"nicType"|undefined} _nicType + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_nicType", { + get: $util.oneOfGetter($oneOfFields = ["nicType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {google.cloud.compute.v1.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.compute.v1.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {google.cloud.compute.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.nicType != null && Object.hasOwnProperty.call(message, "nicType")) + writer.uint32(/* id 59810577, wireType 0 =*/478484616).int32(message.nicType); + if (message.accessConfigs != null && message.accessConfigs.length) + for (var i = 0; i < message.accessConfigs.length; ++i) + $root.google.cloud.compute.v1.AccessConfig.encode(message.accessConfigs[i], writer.uint32(/* id 111058326, wireType 2 =*/888466610).fork()).ldelim(); + if (message.aliasIpRanges != null && message.aliasIpRanges.length) + for (var i = 0; i < message.aliasIpRanges.length; ++i) + $root.google.cloud.compute.v1.AliasIpRange.encode(message.aliasIpRanges[i], writer.uint32(/* id 165085631, wireType 2 =*/1320685050).fork()).ldelim(); + if (message.networkIP != null && Object.hasOwnProperty.call(message, "networkIP")) + writer.uint32(/* id 207181961, wireType 2 =*/1657455690).string(message.networkIP); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) + writer.uint32(/* id 341563804, wireType 2 =*/2732510434).string(message.ipv6Address); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {google.cloud.compute.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 111058326: + if (!(message.accessConfigs && message.accessConfigs.length)) + message.accessConfigs = []; + message.accessConfigs.push($root.google.cloud.compute.v1.AccessConfig.decode(reader, reader.uint32())); + break; + case 165085631: + if (!(message.aliasIpRanges && message.aliasIpRanges.length)) + message.aliasIpRanges = []; + message.aliasIpRanges.push($root.google.cloud.compute.v1.AliasIpRange.decode(reader, reader.uint32())); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 341563804: + message.ipv6Address = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 207181961: + message.networkIP = reader.string(); + break; + case 59810577: + message.nicType = reader.int32(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessConfigs != null && message.hasOwnProperty("accessConfigs")) { + if (!Array.isArray(message.accessConfigs)) + return "accessConfigs: array expected"; + for (var i = 0; i < message.accessConfigs.length; ++i) { + var error = $root.google.cloud.compute.v1.AccessConfig.verify(message.accessConfigs[i]); + if (error) + return "accessConfigs." + error; + } + } + if (message.aliasIpRanges != null && message.hasOwnProperty("aliasIpRanges")) { + if (!Array.isArray(message.aliasIpRanges)) + return "aliasIpRanges: array expected"; + for (var i = 0; i < message.aliasIpRanges.length; ++i) { + var error = $root.google.cloud.compute.v1.AliasIpRange.verify(message.aliasIpRanges[i]); + if (error) + return "aliasIpRanges." + error; + } + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + properties._ipv6Address = 1; + if (!$util.isString(message.ipv6Address)) + return "ipv6Address: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.networkIP != null && message.hasOwnProperty("networkIP")) { + properties._networkIP = 1; + if (!$util.isString(message.networkIP)) + return "networkIP: string expected"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + properties._nicType = 1; + switch (message.nicType) { + default: + return "nicType: enum value expected"; + case 0: + case 68209305: + case 67411801: + case 452123481: + break; + } + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkInterface) + return object; + var message = new $root.google.cloud.compute.v1.NetworkInterface(); + if (object.accessConfigs) { + if (!Array.isArray(object.accessConfigs)) + throw TypeError(".google.cloud.compute.v1.NetworkInterface.accessConfigs: array expected"); + message.accessConfigs = []; + for (var i = 0; i < object.accessConfigs.length; ++i) { + if (typeof object.accessConfigs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkInterface.accessConfigs: object expected"); + message.accessConfigs[i] = $root.google.cloud.compute.v1.AccessConfig.fromObject(object.accessConfigs[i]); + } + } + if (object.aliasIpRanges) { + if (!Array.isArray(object.aliasIpRanges)) + throw TypeError(".google.cloud.compute.v1.NetworkInterface.aliasIpRanges: array expected"); + message.aliasIpRanges = []; + for (var i = 0; i < object.aliasIpRanges.length; ++i) { + if (typeof object.aliasIpRanges[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkInterface.aliasIpRanges: object expected"); + message.aliasIpRanges[i] = $root.google.cloud.compute.v1.AliasIpRange.fromObject(object.aliasIpRanges[i]); + } + } + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.ipv6Address != null) + message.ipv6Address = String(object.ipv6Address); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.networkIP != null) + message.networkIP = String(object.networkIP); + switch (object.nicType) { + case "UNDEFINED_NIC_TYPE": + case 0: + message.nicType = 0; + break; + case "GVNIC": + case 68209305: + message.nicType = 68209305; + break; + case "UNSPECIFIED_NIC_TYPE": + case 67411801: + message.nicType = 67411801; + break; + case "VIRTIO_NET": + case 452123481: + message.nicType = 452123481; + break; + } + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkInterface + * @static + * @param {google.cloud.compute.v1.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.accessConfigs = []; + object.aliasIpRanges = []; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + object.nicType = options.enums === String ? $root.google.cloud.compute.v1.NetworkInterface.NicType[message.nicType] : message.nicType; + if (options.oneofs) + object._nicType = "nicType"; + } + if (message.accessConfigs && message.accessConfigs.length) { + object.accessConfigs = []; + for (var j = 0; j < message.accessConfigs.length; ++j) + object.accessConfigs[j] = $root.google.cloud.compute.v1.AccessConfig.toObject(message.accessConfigs[j], options); + } + if (message.aliasIpRanges && message.aliasIpRanges.length) { + object.aliasIpRanges = []; + for (var j = 0; j < message.aliasIpRanges.length; ++j) + object.aliasIpRanges[j] = $root.google.cloud.compute.v1.AliasIpRange.toObject(message.aliasIpRanges[j], options); + } + if (message.networkIP != null && message.hasOwnProperty("networkIP")) { + object.networkIP = message.networkIP; + if (options.oneofs) + object._networkIP = "networkIP"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + object.ipv6Address = message.ipv6Address; + if (options.oneofs) + object._ipv6Address = "ipv6Address"; + } + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * NicType enum. + * @name google.cloud.compute.v1.NetworkInterface.NicType + * @enum {number} + * @property {number} UNDEFINED_NIC_TYPE=0 UNDEFINED_NIC_TYPE value + * @property {number} GVNIC=68209305 GVNIC value + * @property {number} UNSPECIFIED_NIC_TYPE=67411801 UNSPECIFIED_NIC_TYPE value + * @property {number} VIRTIO_NET=452123481 VIRTIO_NET value + */ + NetworkInterface.NicType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NIC_TYPE"] = 0; + values[valuesById[68209305] = "GVNIC"] = 68209305; + values[valuesById[67411801] = "UNSPECIFIED_NIC_TYPE"] = 67411801; + values[valuesById[452123481] = "VIRTIO_NET"] = 452123481; + return values; + })(); + + return NetworkInterface; + })(); + + v1.ReservationAffinity = (function() { + + /** + * Properties of a ReservationAffinity. + * @memberof google.cloud.compute.v1 + * @interface IReservationAffinity + * @property {google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType|null} [consumeReservationType] ReservationAffinity consumeReservationType + * @property {string|null} [key] ReservationAffinity key + * @property {Array.|null} [values] ReservationAffinity values + */ + + /** + * Constructs a new ReservationAffinity. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ReservationAffinity. + * @implements IReservationAffinity + * @constructor + * @param {google.cloud.compute.v1.IReservationAffinity=} [properties] Properties to set + */ + function ReservationAffinity(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]]; + } + + /** + * ReservationAffinity consumeReservationType. + * @member {google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType|null|undefined} consumeReservationType + * @memberof google.cloud.compute.v1.ReservationAffinity + * @instance + */ + ReservationAffinity.prototype.consumeReservationType = null; + + /** + * ReservationAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.compute.v1.ReservationAffinity + * @instance + */ + ReservationAffinity.prototype.key = null; + + /** + * ReservationAffinity values. + * @member {Array.} values + * @memberof google.cloud.compute.v1.ReservationAffinity + * @instance + */ + ReservationAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReservationAffinity _consumeReservationType. + * @member {"consumeReservationType"|undefined} _consumeReservationType + * @memberof google.cloud.compute.v1.ReservationAffinity + * @instance + */ + Object.defineProperty(ReservationAffinity.prototype, "_consumeReservationType", { + get: $util.oneOfGetter($oneOfFields = ["consumeReservationType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationAffinity _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.compute.v1.ReservationAffinity + * @instance + */ + Object.defineProperty(ReservationAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReservationAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {google.cloud.compute.v1.IReservationAffinity=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ReservationAffinity} ReservationAffinity instance + */ + ReservationAffinity.create = function create(properties) { + return new ReservationAffinity(properties); + }; + + /** + * Encodes the specified ReservationAffinity message. Does not implicitly {@link google.cloud.compute.v1.ReservationAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {google.cloud.compute.v1.IReservationAffinity} message ReservationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 106079, wireType 2 =*/848634).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 249928994, wireType 2 =*/1999431954).string(message.values[i]); + if (message.consumeReservationType != null && Object.hasOwnProperty.call(message, "consumeReservationType")) + writer.uint32(/* id 300736944, wireType 0 =*/2405895552).int32(message.consumeReservationType); + return writer; + }; + + /** + * Encodes the specified ReservationAffinity message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {google.cloud.compute.v1.IReservationAffinity} message ReservationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ReservationAffinity} ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ReservationAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 300736944: + message.consumeReservationType = reader.int32(); + break; + case 106079: + message.key = reader.string(); + break; + case 249928994: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ReservationAffinity} ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservationAffinity message. + * @function verify + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservationAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumeReservationType != null && message.hasOwnProperty("consumeReservationType")) { + properties._consumeReservationType = 1; + switch (message.consumeReservationType) { + default: + return "consumeReservationType: enum value expected"; + case 0: + case 200008121: + case 169322030: + case 229889055: + case 526786327: + break; + } + } + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: 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"; + } + return null; + }; + + /** + * Creates a ReservationAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ReservationAffinity} ReservationAffinity + */ + ReservationAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ReservationAffinity) + return object; + var message = new $root.google.cloud.compute.v1.ReservationAffinity(); + switch (object.consumeReservationType) { + case "UNDEFINED_CONSUME_RESERVATION_TYPE": + case 0: + message.consumeReservationType = 0; + break; + case "ANY_RESERVATION": + case 200008121: + message.consumeReservationType = 200008121; + break; + case "NO_RESERVATION": + case 169322030: + message.consumeReservationType = 169322030; + break; + case "SPECIFIC_RESERVATION": + case 229889055: + message.consumeReservationType = 229889055; + break; + case "UNSPECIFIED": + case 526786327: + message.consumeReservationType = 526786327; + break; + } + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.compute.v1.ReservationAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a ReservationAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ReservationAffinity + * @static + * @param {google.cloud.compute.v1.ReservationAffinity} message ReservationAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservationAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + 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.consumeReservationType != null && message.hasOwnProperty("consumeReservationType")) { + object.consumeReservationType = options.enums === String ? $root.google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType[message.consumeReservationType] : message.consumeReservationType; + if (options.oneofs) + object._consumeReservationType = "consumeReservationType"; + } + return object; + }; + + /** + * Converts this ReservationAffinity to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ReservationAffinity + * @instance + * @returns {Object.} JSON object + */ + ReservationAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ConsumeReservationType enum. + * @name google.cloud.compute.v1.ReservationAffinity.ConsumeReservationType + * @enum {number} + * @property {number} UNDEFINED_CONSUME_RESERVATION_TYPE=0 UNDEFINED_CONSUME_RESERVATION_TYPE value + * @property {number} ANY_RESERVATION=200008121 ANY_RESERVATION value + * @property {number} NO_RESERVATION=169322030 NO_RESERVATION value + * @property {number} SPECIFIC_RESERVATION=229889055 SPECIFIC_RESERVATION value + * @property {number} UNSPECIFIED=526786327 UNSPECIFIED value + */ + ReservationAffinity.ConsumeReservationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CONSUME_RESERVATION_TYPE"] = 0; + values[valuesById[200008121] = "ANY_RESERVATION"] = 200008121; + values[valuesById[169322030] = "NO_RESERVATION"] = 169322030; + values[valuesById[229889055] = "SPECIFIC_RESERVATION"] = 229889055; + values[valuesById[526786327] = "UNSPECIFIED"] = 526786327; + return values; + })(); + + return ReservationAffinity; + })(); + + v1.Scheduling = (function() { + + /** + * Properties of a Scheduling. + * @memberof google.cloud.compute.v1 + * @interface IScheduling + * @property {boolean|null} [automaticRestart] Scheduling automaticRestart + * @property {string|null} [locationHint] Scheduling locationHint + * @property {number|null} [minNodeCpus] Scheduling minNodeCpus + * @property {Array.|null} [nodeAffinities] Scheduling nodeAffinities + * @property {google.cloud.compute.v1.Scheduling.OnHostMaintenance|null} [onHostMaintenance] Scheduling onHostMaintenance + * @property {boolean|null} [preemptible] Scheduling preemptible + */ + + /** + * Constructs a new Scheduling. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Scheduling. + * @implements IScheduling + * @constructor + * @param {google.cloud.compute.v1.IScheduling=} [properties] Properties to set + */ + function Scheduling(properties) { + this.nodeAffinities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Scheduling automaticRestart. + * @member {boolean|null|undefined} automaticRestart + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Scheduling.prototype.automaticRestart = null; + + /** + * Scheduling locationHint. + * @member {string|null|undefined} locationHint + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Scheduling.prototype.locationHint = null; + + /** + * Scheduling minNodeCpus. + * @member {number|null|undefined} minNodeCpus + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Scheduling.prototype.minNodeCpus = null; + + /** + * Scheduling nodeAffinities. + * @member {Array.} nodeAffinities + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Scheduling.prototype.nodeAffinities = $util.emptyArray; + + /** + * Scheduling onHostMaintenance. + * @member {google.cloud.compute.v1.Scheduling.OnHostMaintenance|null|undefined} onHostMaintenance + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Scheduling.prototype.onHostMaintenance = null; + + /** + * Scheduling preemptible. + * @member {boolean|null|undefined} preemptible + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Scheduling.prototype.preemptible = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Scheduling _automaticRestart. + * @member {"automaticRestart"|undefined} _automaticRestart + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_automaticRestart", { + get: $util.oneOfGetter($oneOfFields = ["automaticRestart"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _locationHint. + * @member {"locationHint"|undefined} _locationHint + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_locationHint", { + get: $util.oneOfGetter($oneOfFields = ["locationHint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _minNodeCpus. + * @member {"minNodeCpus"|undefined} _minNodeCpus + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_minNodeCpus", { + get: $util.oneOfGetter($oneOfFields = ["minNodeCpus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _onHostMaintenance. + * @member {"onHostMaintenance"|undefined} _onHostMaintenance + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_onHostMaintenance", { + get: $util.oneOfGetter($oneOfFields = ["onHostMaintenance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _preemptible. + * @member {"preemptible"|undefined} _preemptible + * @memberof google.cloud.compute.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_preemptible", { + get: $util.oneOfGetter($oneOfFields = ["preemptible"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Scheduling instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {google.cloud.compute.v1.IScheduling=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Scheduling} Scheduling instance + */ + Scheduling.create = function create(properties) { + return new Scheduling(properties); + }; + + /** + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.compute.v1.Scheduling.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {google.cloud.compute.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onHostMaintenance != null && Object.hasOwnProperty.call(message, "onHostMaintenance")) + writer.uint32(/* id 64616796, wireType 0 =*/516934368).int32(message.onHostMaintenance); + if (message.minNodeCpus != null && Object.hasOwnProperty.call(message, "minNodeCpus")) + writer.uint32(/* id 317231675, wireType 0 =*/2537853400).int32(message.minNodeCpus); + if (message.preemptible != null && Object.hasOwnProperty.call(message, "preemptible")) + writer.uint32(/* id 324203169, wireType 0 =*/2593625352).bool(message.preemptible); + if (message.locationHint != null && Object.hasOwnProperty.call(message, "locationHint")) + writer.uint32(/* id 350519505, wireType 2 =*/2804156042).string(message.locationHint); + if (message.automaticRestart != null && Object.hasOwnProperty.call(message, "automaticRestart")) + writer.uint32(/* id 350821371, wireType 0 =*/2806570968).bool(message.automaticRestart); + if (message.nodeAffinities != null && message.nodeAffinities.length) + for (var i = 0; i < message.nodeAffinities.length; ++i) + $root.google.cloud.compute.v1.SchedulingNodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 461799971, wireType 2 =*/3694399770).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Scheduling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {google.cloud.compute.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Scheduling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 350821371: + message.automaticRestart = reader.bool(); + break; + case 350519505: + message.locationHint = reader.string(); + break; + case 317231675: + message.minNodeCpus = reader.int32(); + break; + case 461799971: + if (!(message.nodeAffinities && message.nodeAffinities.length)) + message.nodeAffinities = []; + message.nodeAffinities.push($root.google.cloud.compute.v1.SchedulingNodeAffinity.decode(reader, reader.uint32())); + break; + case 64616796: + message.onHostMaintenance = reader.int32(); + break; + case 324203169: + message.preemptible = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scheduling message. + * @function verify + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scheduling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + properties._automaticRestart = 1; + if (typeof message.automaticRestart !== "boolean") + return "automaticRestart: boolean expected"; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + properties._locationHint = 1; + if (!$util.isString(message.locationHint)) + return "locationHint: string expected"; + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + properties._minNodeCpus = 1; + if (!$util.isInteger(message.minNodeCpus)) + return "minNodeCpus: integer expected"; + } + if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { + if (!Array.isArray(message.nodeAffinities)) + return "nodeAffinities: array expected"; + for (var i = 0; i < message.nodeAffinities.length; ++i) { + var error = $root.google.cloud.compute.v1.SchedulingNodeAffinity.verify(message.nodeAffinities[i]); + if (error) + return "nodeAffinities." + error; + } + } + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + properties._onHostMaintenance = 1; + switch (message.onHostMaintenance) { + default: + return "onHostMaintenance: enum value expected"; + case 0: + case 165699979: + case 527617601: + break; + } + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + properties._preemptible = 1; + if (typeof message.preemptible !== "boolean") + return "preemptible: boolean expected"; + } + return null; + }; + + /** + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Scheduling} Scheduling + */ + Scheduling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Scheduling) + return object; + var message = new $root.google.cloud.compute.v1.Scheduling(); + if (object.automaticRestart != null) + message.automaticRestart = Boolean(object.automaticRestart); + if (object.locationHint != null) + message.locationHint = String(object.locationHint); + if (object.minNodeCpus != null) + message.minNodeCpus = object.minNodeCpus | 0; + if (object.nodeAffinities) { + if (!Array.isArray(object.nodeAffinities)) + throw TypeError(".google.cloud.compute.v1.Scheduling.nodeAffinities: array expected"); + message.nodeAffinities = []; + for (var i = 0; i < object.nodeAffinities.length; ++i) { + if (typeof object.nodeAffinities[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Scheduling.nodeAffinities: object expected"); + message.nodeAffinities[i] = $root.google.cloud.compute.v1.SchedulingNodeAffinity.fromObject(object.nodeAffinities[i]); + } + } + switch (object.onHostMaintenance) { + case "UNDEFINED_ON_HOST_MAINTENANCE": + case 0: + message.onHostMaintenance = 0; + break; + case "MIGRATE": + case 165699979: + message.onHostMaintenance = 165699979; + break; + case "TERMINATE": + case 527617601: + message.onHostMaintenance = 527617601; + break; + } + if (object.preemptible != null) + message.preemptible = Boolean(object.preemptible); + return message; + }; + + /** + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Scheduling + * @static + * @param {google.cloud.compute.v1.Scheduling} message Scheduling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scheduling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeAffinities = []; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + object.onHostMaintenance = options.enums === String ? $root.google.cloud.compute.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] : message.onHostMaintenance; + if (options.oneofs) + object._onHostMaintenance = "onHostMaintenance"; + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + object.minNodeCpus = message.minNodeCpus; + if (options.oneofs) + object._minNodeCpus = "minNodeCpus"; + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + object.preemptible = message.preemptible; + if (options.oneofs) + object._preemptible = "preemptible"; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + object.locationHint = message.locationHint; + if (options.oneofs) + object._locationHint = "locationHint"; + } + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + object.automaticRestart = message.automaticRestart; + if (options.oneofs) + object._automaticRestart = "automaticRestart"; + } + if (message.nodeAffinities && message.nodeAffinities.length) { + object.nodeAffinities = []; + for (var j = 0; j < message.nodeAffinities.length; ++j) + object.nodeAffinities[j] = $root.google.cloud.compute.v1.SchedulingNodeAffinity.toObject(message.nodeAffinities[j], options); + } + return object; + }; + + /** + * Converts this Scheduling to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Scheduling + * @instance + * @returns {Object.} JSON object + */ + Scheduling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OnHostMaintenance enum. + * @name google.cloud.compute.v1.Scheduling.OnHostMaintenance + * @enum {number} + * @property {number} UNDEFINED_ON_HOST_MAINTENANCE=0 UNDEFINED_ON_HOST_MAINTENANCE value + * @property {number} MIGRATE=165699979 MIGRATE value + * @property {number} TERMINATE=527617601 TERMINATE value + */ + Scheduling.OnHostMaintenance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ON_HOST_MAINTENANCE"] = 0; + values[valuesById[165699979] = "MIGRATE"] = 165699979; + values[valuesById[527617601] = "TERMINATE"] = 527617601; + return values; + })(); + + return Scheduling; + })(); + + v1.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.compute.v1 + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.compute.v1.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + if (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|null|undefined} email + * @memberof google.cloud.compute.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = null; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.compute.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ServiceAccount _email. + * @member {"email"|undefined} _email + * @memberof google.cloud.compute.v1.ServiceAccount + * @instance + */ + Object.defineProperty(ServiceAccount.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ServiceAccount + * @static + * @param {google.cloud.compute.v1.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.compute.v1.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ServiceAccount + * @static + * @param {google.cloud.compute.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 96619420, wireType 2 =*/772955362).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 165973151, wireType 2 =*/1327785210).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ServiceAccount + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 96619420: + message.email = reader.string(); + break; + case 165973151: + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(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.compute.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.email != null && message.hasOwnProperty("email")) { + properties._email = 1; + if (!$util.isString(message.email)) + return "email: 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"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ServiceAccount) + return object; + var message = new $root.google.cloud.compute.v1.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.compute.v1.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ServiceAccount + * @static + * @param {google.cloud.compute.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.arrays || options.defaults) + object.scopes = []; + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceAccount; + })(); + + v1.ShieldedInstanceConfig = (function() { + + /** + * Properties of a ShieldedInstanceConfig. + * @memberof google.cloud.compute.v1 + * @interface IShieldedInstanceConfig + * @property {boolean|null} [enableIntegrityMonitoring] ShieldedInstanceConfig enableIntegrityMonitoring + * @property {boolean|null} [enableSecureBoot] ShieldedInstanceConfig enableSecureBoot + * @property {boolean|null} [enableVtpm] ShieldedInstanceConfig enableVtpm + */ + + /** + * Constructs a new ShieldedInstanceConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ShieldedInstanceConfig. + * @implements IShieldedInstanceConfig + * @constructor + * @param {google.cloud.compute.v1.IShieldedInstanceConfig=} [properties] Properties to set + */ + function ShieldedInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShieldedInstanceConfig enableIntegrityMonitoring. + * @member {boolean|null|undefined} enableIntegrityMonitoring + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @instance + */ + ShieldedInstanceConfig.prototype.enableIntegrityMonitoring = null; + + /** + * ShieldedInstanceConfig enableSecureBoot. + * @member {boolean|null|undefined} enableSecureBoot + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @instance + */ + ShieldedInstanceConfig.prototype.enableSecureBoot = null; + + /** + * ShieldedInstanceConfig enableVtpm. + * @member {boolean|null|undefined} enableVtpm + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @instance + */ + ShieldedInstanceConfig.prototype.enableVtpm = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ShieldedInstanceConfig _enableIntegrityMonitoring. + * @member {"enableIntegrityMonitoring"|undefined} _enableIntegrityMonitoring + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @instance + */ + Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableIntegrityMonitoring", { + get: $util.oneOfGetter($oneOfFields = ["enableIntegrityMonitoring"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ShieldedInstanceConfig _enableSecureBoot. + * @member {"enableSecureBoot"|undefined} _enableSecureBoot + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @instance + */ + Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableSecureBoot", { + get: $util.oneOfGetter($oneOfFields = ["enableSecureBoot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ShieldedInstanceConfig _enableVtpm. + * @member {"enableVtpm"|undefined} _enableVtpm + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @instance + */ + Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableVtpm", { + get: $util.oneOfGetter($oneOfFields = ["enableVtpm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ShieldedInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ShieldedInstanceConfig} ShieldedInstanceConfig instance + */ + ShieldedInstanceConfig.create = function create(properties) { + return new ShieldedInstanceConfig(properties); + }; + + /** + * Encodes the specified ShieldedInstanceConfig message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceConfig} message ShieldedInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSecureBoot != null && Object.hasOwnProperty.call(message, "enableSecureBoot")) + writer.uint32(/* id 123568638, wireType 0 =*/988549104).bool(message.enableSecureBoot); + if (message.enableVtpm != null && Object.hasOwnProperty.call(message, "enableVtpm")) + writer.uint32(/* id 181858935, wireType 0 =*/1454871480).bool(message.enableVtpm); + if (message.enableIntegrityMonitoring != null && Object.hasOwnProperty.call(message, "enableIntegrityMonitoring")) + writer.uint32(/* id 409071030, wireType 0 =*/3272568240).bool(message.enableIntegrityMonitoring); + return writer; + }; + + /** + * Encodes the specified ShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceConfig} message ShieldedInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ShieldedInstanceConfig} ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ShieldedInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 409071030: + message.enableIntegrityMonitoring = reader.bool(); + break; + case 123568638: + message.enableSecureBoot = reader.bool(); + break; + case 181858935: + message.enableVtpm = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ShieldedInstanceConfig} ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShieldedInstanceConfig message. + * @function verify + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShieldedInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) { + properties._enableIntegrityMonitoring = 1; + if (typeof message.enableIntegrityMonitoring !== "boolean") + return "enableIntegrityMonitoring: boolean expected"; + } + if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) { + properties._enableSecureBoot = 1; + if (typeof message.enableSecureBoot !== "boolean") + return "enableSecureBoot: boolean expected"; + } + if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) { + properties._enableVtpm = 1; + if (typeof message.enableVtpm !== "boolean") + return "enableVtpm: boolean expected"; + } + return null; + }; + + /** + * Creates a ShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ShieldedInstanceConfig} ShieldedInstanceConfig + */ + ShieldedInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ShieldedInstanceConfig) + return object; + var message = new $root.google.cloud.compute.v1.ShieldedInstanceConfig(); + if (object.enableIntegrityMonitoring != null) + message.enableIntegrityMonitoring = Boolean(object.enableIntegrityMonitoring); + if (object.enableSecureBoot != null) + message.enableSecureBoot = Boolean(object.enableSecureBoot); + if (object.enableVtpm != null) + message.enableVtpm = Boolean(object.enableVtpm); + return message; + }; + + /** + * Creates a plain object from a ShieldedInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.compute.v1.ShieldedInstanceConfig} message ShieldedInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShieldedInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) { + object.enableSecureBoot = message.enableSecureBoot; + if (options.oneofs) + object._enableSecureBoot = "enableSecureBoot"; + } + if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) { + object.enableVtpm = message.enableVtpm; + if (options.oneofs) + object._enableVtpm = "enableVtpm"; + } + if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) { + object.enableIntegrityMonitoring = message.enableIntegrityMonitoring; + if (options.oneofs) + object._enableIntegrityMonitoring = "enableIntegrityMonitoring"; + } + return object; + }; + + /** + * Converts this ShieldedInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ShieldedInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ShieldedInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ShieldedInstanceConfig; + })(); + + v1.ShieldedInstanceIntegrityPolicy = (function() { + + /** + * Properties of a ShieldedInstanceIntegrityPolicy. + * @memberof google.cloud.compute.v1 + * @interface IShieldedInstanceIntegrityPolicy + * @property {boolean|null} [updateAutoLearnPolicy] ShieldedInstanceIntegrityPolicy updateAutoLearnPolicy + */ + + /** + * Constructs a new ShieldedInstanceIntegrityPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ShieldedInstanceIntegrityPolicy. + * @implements IShieldedInstanceIntegrityPolicy + * @constructor + * @param {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy=} [properties] Properties to set + */ + function ShieldedInstanceIntegrityPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShieldedInstanceIntegrityPolicy updateAutoLearnPolicy. + * @member {boolean|null|undefined} updateAutoLearnPolicy + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @instance + */ + ShieldedInstanceIntegrityPolicy.prototype.updateAutoLearnPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ShieldedInstanceIntegrityPolicy _updateAutoLearnPolicy. + * @member {"updateAutoLearnPolicy"|undefined} _updateAutoLearnPolicy + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @instance + */ + Object.defineProperty(ShieldedInstanceIntegrityPolicy.prototype, "_updateAutoLearnPolicy", { + get: $util.oneOfGetter($oneOfFields = ["updateAutoLearnPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ShieldedInstanceIntegrityPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy} ShieldedInstanceIntegrityPolicy instance + */ + ShieldedInstanceIntegrityPolicy.create = function create(properties) { + return new ShieldedInstanceIntegrityPolicy(properties); + }; + + /** + * Encodes the specified ShieldedInstanceIntegrityPolicy message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy} message ShieldedInstanceIntegrityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceIntegrityPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateAutoLearnPolicy != null && Object.hasOwnProperty.call(message, "updateAutoLearnPolicy")) + writer.uint32(/* id 245490215, wireType 0 =*/1963921720).bool(message.updateAutoLearnPolicy); + return writer; + }; + + /** + * Encodes the specified ShieldedInstanceIntegrityPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy} message ShieldedInstanceIntegrityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceIntegrityPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShieldedInstanceIntegrityPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy} ShieldedInstanceIntegrityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceIntegrityPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 245490215: + message.updateAutoLearnPolicy = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShieldedInstanceIntegrityPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy} ShieldedInstanceIntegrityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceIntegrityPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShieldedInstanceIntegrityPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShieldedInstanceIntegrityPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.updateAutoLearnPolicy != null && message.hasOwnProperty("updateAutoLearnPolicy")) { + properties._updateAutoLearnPolicy = 1; + if (typeof message.updateAutoLearnPolicy !== "boolean") + return "updateAutoLearnPolicy: boolean expected"; + } + return null; + }; + + /** + * Creates a ShieldedInstanceIntegrityPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy} ShieldedInstanceIntegrityPolicy + */ + ShieldedInstanceIntegrityPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy) + return object; + var message = new $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy(); + if (object.updateAutoLearnPolicy != null) + message.updateAutoLearnPolicy = Boolean(object.updateAutoLearnPolicy); + return message; + }; + + /** + * Creates a plain object from a ShieldedInstanceIntegrityPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @static + * @param {google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy} message ShieldedInstanceIntegrityPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShieldedInstanceIntegrityPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.updateAutoLearnPolicy != null && message.hasOwnProperty("updateAutoLearnPolicy")) { + object.updateAutoLearnPolicy = message.updateAutoLearnPolicy; + if (options.oneofs) + object._updateAutoLearnPolicy = "updateAutoLearnPolicy"; + } + return object; + }; + + /** + * Converts this ShieldedInstanceIntegrityPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy + * @instance + * @returns {Object.} JSON object + */ + ShieldedInstanceIntegrityPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ShieldedInstanceIntegrityPolicy; + })(); + + v1.Tags = (function() { + + /** + * Properties of a Tags. + * @memberof google.cloud.compute.v1 + * @interface ITags + * @property {string|null} [fingerprint] Tags fingerprint + * @property {Array.|null} [items] Tags items + */ + + /** + * Constructs a new Tags. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Tags. + * @implements ITags + * @constructor + * @param {google.cloud.compute.v1.ITags=} [properties] Properties to set + */ + function Tags(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tags fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.Tags + * @instance + */ + Tags.prototype.fingerprint = null; + + /** + * Tags items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.Tags + * @instance + */ + Tags.prototype.items = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Tags _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.Tags + * @instance + */ + Object.defineProperty(Tags.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Tags instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {google.cloud.compute.v1.ITags=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Tags} Tags instance + */ + Tags.create = function create(properties) { + return new Tags(properties); + }; + + /** + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.compute.v1.Tags.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {google.cloud.compute.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + writer.uint32(/* id 100526016, wireType 2 =*/804208130).string(message.items[i]); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + return writer; + }; + + /** + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Tags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {google.cloud.compute.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tags message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Tags(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 234678500: + message.fingerprint = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tags message. + * @function verify + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) + if (!$util.isString(message.items[i])) + return "items: string[] expected"; + } + return null; + }; + + /** + * Creates a Tags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Tags} Tags + */ + Tags.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Tags) + return object; + var message = new $root.google.cloud.compute.v1.Tags(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.Tags.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) + message.items[i] = String(object.items[i]); + } + return message; + }; + + /** + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Tags + * @static + * @param {google.cloud.compute.v1.Tags} message Tags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = message.items[j]; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + return object; + }; + + /** + * Converts this Tags to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Tags + * @instance + * @returns {Object.} JSON object + */ + Tags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Tags; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.compute.v1 + * @interface IInstance + * @property {google.cloud.compute.v1.IAdvancedMachineFeatures|null} [advancedMachineFeatures] Instance advancedMachineFeatures + * @property {boolean|null} [canIpForward] Instance canIpForward + * @property {google.cloud.compute.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] Instance confidentialInstanceConfig + * @property {string|null} [cpuPlatform] Instance cpuPlatform + * @property {string|null} [creationTimestamp] Instance creationTimestamp + * @property {boolean|null} [deletionProtection] Instance deletionProtection + * @property {string|null} [description] Instance description + * @property {Array.|null} [disks] Instance disks + * @property {google.cloud.compute.v1.IDisplayDevice|null} [displayDevice] Instance displayDevice + * @property {string|null} [fingerprint] Instance fingerprint + * @property {Array.|null} [guestAccelerators] Instance guestAccelerators + * @property {string|null} [hostname] Instance hostname + * @property {number|Long|null} [id] Instance id + * @property {string|null} [kind] Instance kind + * @property {string|null} [labelFingerprint] Instance labelFingerprint + * @property {Object.|null} [labels] Instance labels + * @property {string|null} [lastStartTimestamp] Instance lastStartTimestamp + * @property {string|null} [lastStopTimestamp] Instance lastStopTimestamp + * @property {string|null} [lastSuspendedTimestamp] Instance lastSuspendedTimestamp + * @property {string|null} [machineType] Instance machineType + * @property {google.cloud.compute.v1.IMetadata|null} [metadata] Instance metadata + * @property {string|null} [minCpuPlatform] Instance minCpuPlatform + * @property {string|null} [name] Instance name + * @property {Array.|null} [networkInterfaces] Instance networkInterfaces + * @property {google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] Instance privateIpv6GoogleAccess + * @property {google.cloud.compute.v1.IReservationAffinity|null} [reservationAffinity] Instance reservationAffinity + * @property {Array.|null} [resourcePolicies] Instance resourcePolicies + * @property {boolean|null} [satisfiesPzs] Instance satisfiesPzs + * @property {google.cloud.compute.v1.IScheduling|null} [scheduling] Instance scheduling + * @property {string|null} [selfLink] Instance selfLink + * @property {Array.|null} [serviceAccounts] Instance serviceAccounts + * @property {google.cloud.compute.v1.IShieldedInstanceConfig|null} [shieldedInstanceConfig] Instance shieldedInstanceConfig + * @property {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null} [shieldedInstanceIntegrityPolicy] Instance shieldedInstanceIntegrityPolicy + * @property {boolean|null} [startRestricted] Instance startRestricted + * @property {google.cloud.compute.v1.Instance.Status|null} [status] Instance status + * @property {string|null} [statusMessage] Instance statusMessage + * @property {google.cloud.compute.v1.ITags|null} [tags] Instance tags + * @property {string|null} [zone] Instance zone + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.compute.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.disks = []; + this.guestAccelerators = []; + this.labels = {}; + this.networkInterfaces = []; + this.resourcePolicies = []; + this.serviceAccounts = []; + if (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 advancedMachineFeatures. + * @member {google.cloud.compute.v1.IAdvancedMachineFeatures|null|undefined} advancedMachineFeatures + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.advancedMachineFeatures = null; + + /** + * Instance canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.canIpForward = null; + + /** + * Instance confidentialInstanceConfig. + * @member {google.cloud.compute.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.confidentialInstanceConfig = null; + + /** + * Instance cpuPlatform. + * @member {string|null|undefined} cpuPlatform + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.cpuPlatform = null; + + /** + * Instance creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.creationTimestamp = null; + + /** + * Instance deletionProtection. + * @member {boolean|null|undefined} deletionProtection + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.deletionProtection = null; + + /** + * Instance description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.description = null; + + /** + * Instance disks. + * @member {Array.} disks + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.disks = $util.emptyArray; + + /** + * Instance displayDevice. + * @member {google.cloud.compute.v1.IDisplayDevice|null|undefined} displayDevice + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.displayDevice = null; + + /** + * Instance fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.fingerprint = null; + + /** + * Instance guestAccelerators. + * @member {Array.} guestAccelerators + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.guestAccelerators = $util.emptyArray; + + /** + * Instance hostname. + * @member {string|null|undefined} hostname + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.hostname = null; + + /** + * Instance id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.id = null; + + /** + * Instance kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.kind = null; + + /** + * Instance labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.labelFingerprint = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance lastStartTimestamp. + * @member {string|null|undefined} lastStartTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.lastStartTimestamp = null; + + /** + * Instance lastStopTimestamp. + * @member {string|null|undefined} lastStopTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.lastStopTimestamp = null; + + /** + * Instance lastSuspendedTimestamp. + * @member {string|null|undefined} lastSuspendedTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.lastSuspendedTimestamp = null; + + /** + * Instance machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.machineType = null; + + /** + * Instance metadata. + * @member {google.cloud.compute.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.metadata = null; + + /** + * Instance minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.minCpuPlatform = null; + + /** + * Instance name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.name = null; + + /** + * Instance networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.networkInterfaces = $util.emptyArray; + + /** + * Instance privateIpv6GoogleAccess. + * @member {google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess|null|undefined} privateIpv6GoogleAccess + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.privateIpv6GoogleAccess = null; + + /** + * Instance reservationAffinity. + * @member {google.cloud.compute.v1.IReservationAffinity|null|undefined} reservationAffinity + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.reservationAffinity = null; + + /** + * Instance resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.resourcePolicies = $util.emptyArray; + + /** + * Instance satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = null; + + /** + * Instance scheduling. + * @member {google.cloud.compute.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.scheduling = null; + + /** + * Instance selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.selfLink = null; + + /** + * Instance serviceAccounts. + * @member {Array.} serviceAccounts + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.serviceAccounts = $util.emptyArray; + + /** + * Instance shieldedInstanceConfig. + * @member {google.cloud.compute.v1.IShieldedInstanceConfig|null|undefined} shieldedInstanceConfig + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.shieldedInstanceConfig = null; + + /** + * Instance shieldedInstanceIntegrityPolicy. + * @member {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null|undefined} shieldedInstanceIntegrityPolicy + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.shieldedInstanceIntegrityPolicy = null; + + /** + * Instance startRestricted. + * @member {boolean|null|undefined} startRestricted + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.startRestricted = null; + + /** + * Instance status. + * @member {google.cloud.compute.v1.Instance.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.status = null; + + /** + * Instance statusMessage. + * @member {string|null|undefined} statusMessage + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.statusMessage = null; + + /** + * Instance tags. + * @member {google.cloud.compute.v1.ITags|null|undefined} tags + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.tags = null; + + /** + * Instance zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Instance.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Instance _advancedMachineFeatures. + * @member {"advancedMachineFeatures"|undefined} _advancedMachineFeatures + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_advancedMachineFeatures", { + get: $util.oneOfGetter($oneOfFields = ["advancedMachineFeatures"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _canIpForward. + * @member {"canIpForward"|undefined} _canIpForward + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _confidentialInstanceConfig. + * @member {"confidentialInstanceConfig"|undefined} _confidentialInstanceConfig + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_confidentialInstanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["confidentialInstanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _cpuPlatform. + * @member {"cpuPlatform"|undefined} _cpuPlatform + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_cpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["cpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _deletionProtection. + * @member {"deletionProtection"|undefined} _deletionProtection + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_deletionProtection", { + get: $util.oneOfGetter($oneOfFields = ["deletionProtection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _displayDevice. + * @member {"displayDevice"|undefined} _displayDevice + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_displayDevice", { + get: $util.oneOfGetter($oneOfFields = ["displayDevice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _hostname. + * @member {"hostname"|undefined} _hostname + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_hostname", { + get: $util.oneOfGetter($oneOfFields = ["hostname"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _lastStartTimestamp. + * @member {"lastStartTimestamp"|undefined} _lastStartTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_lastStartTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastStartTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _lastStopTimestamp. + * @member {"lastStopTimestamp"|undefined} _lastStopTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_lastStopTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastStopTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _lastSuspendedTimestamp. + * @member {"lastSuspendedTimestamp"|undefined} _lastSuspendedTimestamp + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_lastSuspendedTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["lastSuspendedTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _privateIpv6GoogleAccess. + * @member {"privateIpv6GoogleAccess"|undefined} _privateIpv6GoogleAccess + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_privateIpv6GoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpv6GoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _reservationAffinity. + * @member {"reservationAffinity"|undefined} _reservationAffinity + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_reservationAffinity", { + get: $util.oneOfGetter($oneOfFields = ["reservationAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _satisfiesPzs. + * @member {"satisfiesPzs"|undefined} _satisfiesPzs + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _scheduling. + * @member {"scheduling"|undefined} _scheduling + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _shieldedInstanceConfig. + * @member {"shieldedInstanceConfig"|undefined} _shieldedInstanceConfig + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_shieldedInstanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["shieldedInstanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _shieldedInstanceIntegrityPolicy. + * @member {"shieldedInstanceIntegrityPolicy"|undefined} _shieldedInstanceIntegrityPolicy + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_shieldedInstanceIntegrityPolicy", { + get: $util.oneOfGetter($oneOfFields = ["shieldedInstanceIntegrityPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _startRestricted. + * @member {"startRestricted"|undefined} _startRestricted + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_startRestricted", { + get: $util.oneOfGetter($oneOfFields = ["startRestricted"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _statusMessage. + * @member {"statusMessage"|undefined} _statusMessage + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_statusMessage", { + get: $util.oneOfGetter($oneOfFields = ["statusMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _tags. + * @member {"tags"|undefined} _tags + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Instance _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.Instance + * @instance + */ + Object.defineProperty(Instance.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Instance + * @static + * @param {google.cloud.compute.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.compute.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Instance + * @static + * @param {google.cloud.compute.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.compute.v1.Tags.encode(message.tags, writer.uint32(/* id 3552281, wireType 2 =*/28418250).fork()).ldelim(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.shieldedInstanceConfig != null && Object.hasOwnProperty.call(message, "shieldedInstanceConfig")) + $root.google.cloud.compute.v1.ShieldedInstanceConfig.encode(message.shieldedInstanceConfig, writer.uint32(/* id 12862901, wireType 2 =*/102903210).fork()).ldelim(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) + writer.uint32(/* id 48277006, wireType 0 =*/386216048).int32(message.privateIpv6GoogleAccess); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.compute.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 52735243, wireType 2 =*/421881946).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.compute.v1.Metadata.encode(message.metadata, writer.uint32(/* id 86866735, wireType 2 =*/694933882).fork()).ldelim(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.compute.v1.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork()).ldelim(); + if (message.startRestricted != null && Object.hasOwnProperty.call(message, "startRestricted")) + writer.uint32(/* id 123693144, wireType 0 =*/989545152).bool(message.startRestricted); + if (message.reservationAffinity != null && Object.hasOwnProperty.call(message, "reservationAffinity")) + $root.google.cloud.compute.v1.ReservationAffinity.encode(message.reservationAffinity, writer.uint32(/* id 157850683, wireType 2 =*/1262805466).fork()).ldelim(); + if (message.shieldedInstanceIntegrityPolicy != null && Object.hasOwnProperty.call(message, "shieldedInstanceIntegrityPolicy")) + $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.encode(message.shieldedInstanceIntegrityPolicy, writer.uint32(/* id 163696919, wireType 2 =*/1309575354).fork()).ldelim(); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 227711026, wireType 2 =*/1821688210).string(message.machineType); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 237067315, wireType 2 =*/1896538522).string(message.hostname); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 242912759, wireType 2 =*/1943302074).string(message.minCpuPlatform); + if (message.displayDevice != null && Object.hasOwnProperty.call(message, "displayDevice")) + $root.google.cloud.compute.v1.DisplayDevice.encode(message.displayDevice, writer.uint32(/* id 258933875, wireType 2 =*/2071471002).fork()).ldelim(); + if (message.serviceAccounts != null && message.serviceAccounts.length) + for (var i = 0; i < message.serviceAccounts.length; ++i) + $root.google.cloud.compute.v1.ServiceAccount.encode(message.serviceAccounts[i], writer.uint32(/* id 277537328, wireType 2 =*/2220298626).fork()).ldelim(); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 297428154, wireType 2 =*/2379425234).string(message.statusMessage); + if (message.lastSuspendedTimestamp != null && Object.hasOwnProperty.call(message, "lastSuspendedTimestamp")) + writer.uint32(/* id 356275337, wireType 2 =*/2850202698).string(message.lastSuspendedTimestamp); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.compute.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 386688404, wireType 2 =*/3093507234).fork()).ldelim(); + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) + $root.google.cloud.compute.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 409646002, wireType 2 =*/3277168018).fork()).ldelim(); + if (message.cpuPlatform != null && Object.hasOwnProperty.call(message, "cpuPlatform")) + writer.uint32(/* id 410285354, wireType 2 =*/3282282834).string(message.cpuPlatform); + if (message.lastStopTimestamp != null && Object.hasOwnProperty.call(message, "lastStopTimestamp")) + writer.uint32(/* id 412823010, wireType 2 =*/3302584082).string(message.lastStopTimestamp); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.lastStartTimestamp != null && Object.hasOwnProperty.call(message, "lastStartTimestamp")) + writer.uint32(/* id 443830736, wireType 2 =*/3550645890).string(message.lastStartTimestamp); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 458014698, wireType 0 =*/3664117584).bool(message.deletionProtection); + if (message.guestAccelerators != null && message.guestAccelerators.length) + for (var i = 0; i < message.guestAccelerators.length; ++i) + $root.google.cloud.compute.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 463595119, wireType 2 =*/3708760954).fork()).ldelim(); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 467731324, wireType 0 =*/3741850592).bool(message.canIpForward); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 480964267, wireType 0 =*/3847714136).bool(message.satisfiesPzs); + if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) + $root.google.cloud.compute.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 490637685, wireType 2 =*/3925101482).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 500195327, wireType 2 =*/4001562618).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 Instance message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Instance + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 409646002: + message.advancedMachineFeatures = $root.google.cloud.compute.v1.AdvancedMachineFeatures.decode(reader, reader.uint32()); + break; + case 467731324: + message.canIpForward = reader.bool(); + break; + case 490637685: + message.confidentialInstanceConfig = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); + break; + case 410285354: + message.cpuPlatform = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 458014698: + message.deletionProtection = reader.bool(); + break; + case 422937596: + message.description = reader.string(); + break; + case 95594102: + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.compute.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + case 258933875: + message.displayDevice = $root.google.cloud.compute.v1.DisplayDevice.decode(reader, reader.uint32()); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 463595119: + if (!(message.guestAccelerators && message.guestAccelerators.length)) + message.guestAccelerators = []; + message.guestAccelerators.push($root.google.cloud.compute.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + case 237067315: + message.hostname = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 443830736: + message.lastStartTimestamp = reader.string(); + break; + case 412823010: + message.lastStopTimestamp = reader.string(); + break; + case 356275337: + message.lastSuspendedTimestamp = reader.string(); + break; + case 227711026: + message.machineType = reader.string(); + break; + case 86866735: + message.metadata = $root.google.cloud.compute.v1.Metadata.decode(reader, reader.uint32()); + break; + case 242912759: + message.minCpuPlatform = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 52735243: + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.compute.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + case 48277006: + message.privateIpv6GoogleAccess = reader.int32(); + break; + case 157850683: + message.reservationAffinity = $root.google.cloud.compute.v1.ReservationAffinity.decode(reader, reader.uint32()); + break; + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + case 480964267: + message.satisfiesPzs = reader.bool(); + break; + case 386688404: + message.scheduling = $root.google.cloud.compute.v1.Scheduling.decode(reader, reader.uint32()); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 277537328: + if (!(message.serviceAccounts && message.serviceAccounts.length)) + message.serviceAccounts = []; + message.serviceAccounts.push($root.google.cloud.compute.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + case 12862901: + message.shieldedInstanceConfig = $root.google.cloud.compute.v1.ShieldedInstanceConfig.decode(reader, reader.uint32()); + break; + case 163696919: + message.shieldedInstanceIntegrityPolicy = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.decode(reader, reader.uint32()); + break; + case 123693144: + message.startRestricted = reader.bool(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 297428154: + message.statusMessage = reader.string(); + break; + case 3552281: + message.tags = $root.google.cloud.compute.v1.Tags.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = 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.compute.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + properties._advancedMachineFeatures = 1; + { + var error = $root.google.cloud.compute.v1.AdvancedMachineFeatures.verify(message.advancedMachineFeatures); + if (error) + return "advancedMachineFeatures." + error; + } + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + properties._confidentialInstanceConfig = 1; + { + var error = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); + if (error) + return "confidentialInstanceConfig." + error; + } + } + if (message.cpuPlatform != null && message.hasOwnProperty("cpuPlatform")) { + properties._cpuPlatform = 1; + if (!$util.isString(message.cpuPlatform)) + return "cpuPlatform: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + properties._deletionProtection = 1; + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.compute.v1.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + properties._displayDevice = 1; + { + var error = $root.google.cloud.compute.v1.DisplayDevice.verify(message.displayDevice); + if (error) + return "displayDevice." + error; + } + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { + if (!Array.isArray(message.guestAccelerators)) + return "guestAccelerators: array expected"; + for (var i = 0; i < message.guestAccelerators.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); + if (error) + return "guestAccelerators." + error; + } + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + properties._hostname = 1; + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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.lastStartTimestamp != null && message.hasOwnProperty("lastStartTimestamp")) { + properties._lastStartTimestamp = 1; + if (!$util.isString(message.lastStartTimestamp)) + return "lastStartTimestamp: string expected"; + } + if (message.lastStopTimestamp != null && message.hasOwnProperty("lastStopTimestamp")) { + properties._lastStopTimestamp = 1; + if (!$util.isString(message.lastStopTimestamp)) + return "lastStopTimestamp: string expected"; + } + if (message.lastSuspendedTimestamp != null && message.hasOwnProperty("lastSuspendedTimestamp")) { + properties._lastSuspendedTimestamp = 1; + if (!$util.isString(message.lastSuspendedTimestamp)) + return "lastSuspendedTimestamp: string expected"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.compute.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + properties._privateIpv6GoogleAccess = 1; + switch (message.privateIpv6GoogleAccess) { + default: + return "privateIpv6GoogleAccess: enum value expected"; + case 0: + case 427975994: + case 288210263: + case 530256959: + break; + } + } + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { + properties._reservationAffinity = 1; + { + var error = $root.google.cloud.compute.v1.ReservationAffinity.verify(message.reservationAffinity); + if (error) + return "reservationAffinity." + error; + } + } + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.compute.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.serviceAccounts != null && message.hasOwnProperty("serviceAccounts")) { + if (!Array.isArray(message.serviceAccounts)) + return "serviceAccounts: array expected"; + for (var i = 0; i < message.serviceAccounts.length; ++i) { + var error = $root.google.cloud.compute.v1.ServiceAccount.verify(message.serviceAccounts[i]); + if (error) + return "serviceAccounts." + error; + } + } + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) { + properties._shieldedInstanceConfig = 1; + { + var error = $root.google.cloud.compute.v1.ShieldedInstanceConfig.verify(message.shieldedInstanceConfig); + if (error) + return "shieldedInstanceConfig." + error; + } + } + if (message.shieldedInstanceIntegrityPolicy != null && message.hasOwnProperty("shieldedInstanceIntegrityPolicy")) { + properties._shieldedInstanceIntegrityPolicy = 1; + { + var error = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.verify(message.shieldedInstanceIntegrityPolicy); + if (error) + return "shieldedInstanceIntegrityPolicy." + error; + } + } + if (message.startRestricted != null && message.hasOwnProperty("startRestricted")) { + properties._startRestricted = 1; + if (typeof message.startRestricted !== "boolean") + return "startRestricted: boolean expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 428935662: + case 290896621: + case 413483285: + case 121282975: + case 431072283: + case 444276141: + case 350791796: + case 51223995: + case 514206246: + case 250018339: + break; + } + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + properties._statusMessage = 1; + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.compute.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Instance) + return object; + var message = new $root.google.cloud.compute.v1.Instance(); + if (object.advancedMachineFeatures != null) { + if (typeof object.advancedMachineFeatures !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.advancedMachineFeatures: object expected"); + message.advancedMachineFeatures = $root.google.cloud.compute.v1.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures); + } + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.confidentialInstanceConfig != null) { + if (typeof object.confidentialInstanceConfig !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.confidentialInstanceConfig: object expected"); + message.confidentialInstanceConfig = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); + } + if (object.cpuPlatform != null) + message.cpuPlatform = String(object.cpuPlatform); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + if (object.description != null) + message.description = String(object.description); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.compute.v1.Instance.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.disks: object expected"); + message.disks[i] = $root.google.cloud.compute.v1.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.displayDevice != null) { + if (typeof object.displayDevice !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.displayDevice: object expected"); + message.displayDevice = $root.google.cloud.compute.v1.DisplayDevice.fromObject(object.displayDevice); + } + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.guestAccelerators) { + if (!Array.isArray(object.guestAccelerators)) + throw TypeError(".google.cloud.compute.v1.Instance.guestAccelerators: array expected"); + message.guestAccelerators = []; + for (var i = 0; i < object.guestAccelerators.length; ++i) { + if (typeof object.guestAccelerators[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.guestAccelerators: object expected"); + message.guestAccelerators[i] = $root.google.cloud.compute.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); + } + } + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.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.lastStartTimestamp != null) + message.lastStartTimestamp = String(object.lastStartTimestamp); + if (object.lastStopTimestamp != null) + message.lastStopTimestamp = String(object.lastStopTimestamp); + if (object.lastSuspendedTimestamp != null) + message.lastSuspendedTimestamp = String(object.lastSuspendedTimestamp); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.metadata: object expected"); + message.metadata = $root.google.cloud.compute.v1.Metadata.fromObject(object.metadata); + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + if (object.name != null) + message.name = String(object.name); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.compute.v1.Instance.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.compute.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + switch (object.privateIpv6GoogleAccess) { + case "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS": + case 0: + message.privateIpv6GoogleAccess = 0; + break; + case "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": + case 427975994: + message.privateIpv6GoogleAccess = 427975994; + break; + case "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": + case 288210263: + message.privateIpv6GoogleAccess = 288210263; + break; + case "INHERIT_FROM_SUBNETWORK": + case 530256959: + message.privateIpv6GoogleAccess = 530256959; + break; + } + if (object.reservationAffinity != null) { + if (typeof object.reservationAffinity !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.reservationAffinity: object expected"); + message.reservationAffinity = $root.google.cloud.compute.v1.ReservationAffinity.fromObject(object.reservationAffinity); + } + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.Instance.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.scheduling: object expected"); + message.scheduling = $root.google.cloud.compute.v1.Scheduling.fromObject(object.scheduling); + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.serviceAccounts) { + if (!Array.isArray(object.serviceAccounts)) + throw TypeError(".google.cloud.compute.v1.Instance.serviceAccounts: array expected"); + message.serviceAccounts = []; + for (var i = 0; i < object.serviceAccounts.length; ++i) { + if (typeof object.serviceAccounts[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.serviceAccounts: object expected"); + message.serviceAccounts[i] = $root.google.cloud.compute.v1.ServiceAccount.fromObject(object.serviceAccounts[i]); + } + } + if (object.shieldedInstanceConfig != null) { + if (typeof object.shieldedInstanceConfig !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.shieldedInstanceConfig: object expected"); + message.shieldedInstanceConfig = $root.google.cloud.compute.v1.ShieldedInstanceConfig.fromObject(object.shieldedInstanceConfig); + } + if (object.shieldedInstanceIntegrityPolicy != null) { + if (typeof object.shieldedInstanceIntegrityPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.shieldedInstanceIntegrityPolicy: object expected"); + message.shieldedInstanceIntegrityPolicy = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.fromObject(object.shieldedInstanceIntegrityPolicy); + } + if (object.startRestricted != null) + message.startRestricted = Boolean(object.startRestricted); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "DEPROVISIONING": + case 428935662: + message.status = 428935662; + break; + case "PROVISIONING": + case 290896621: + message.status = 290896621; + break; + case "REPAIRING": + case 413483285: + message.status = 413483285; + break; + case "RUNNING": + case 121282975: + message.status = 121282975; + break; + case "STAGING": + case 431072283: + message.status = 431072283; + break; + case "STOPPED": + case 444276141: + message.status = 444276141; + break; + case "STOPPING": + case 350791796: + message.status = 350791796; + break; + case "SUSPENDED": + case 51223995: + message.status = 51223995; + break; + case "SUSPENDING": + case 514206246: + message.status = 514206246; + break; + case "TERMINATED": + case 250018339: + message.status = 250018339; + break; + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.compute.v1.Instance.tags: object expected"); + message.tags = $root.google.cloud.compute.v1.Tags.fromObject(object.tags); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Instance + * @static + * @param {google.cloud.compute.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.resourcePolicies = []; + object.networkInterfaces = []; + object.disks = []; + object.serviceAccounts = []; + object.guestAccelerators = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.compute.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) { + object.shieldedInstanceConfig = $root.google.cloud.compute.v1.ShieldedInstanceConfig.toObject(message.shieldedInstanceConfig, options); + if (options.oneofs) + object._shieldedInstanceConfig = "shieldedInstanceConfig"; + } + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; + if (options.oneofs) + object._privateIpv6GoogleAccess = "privateIpv6GoogleAccess"; + } + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.compute.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.compute.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.compute.v1.AttachedDisk.toObject(message.disks[j], options); + } + if (message.startRestricted != null && message.hasOwnProperty("startRestricted")) { + object.startRestricted = message.startRestricted; + if (options.oneofs) + object._startRestricted = "startRestricted"; + } + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { + object.reservationAffinity = $root.google.cloud.compute.v1.ReservationAffinity.toObject(message.reservationAffinity, options); + if (options.oneofs) + object._reservationAffinity = "reservationAffinity"; + } + if (message.shieldedInstanceIntegrityPolicy != null && message.hasOwnProperty("shieldedInstanceIntegrityPolicy")) { + object.shieldedInstanceIntegrityPolicy = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.toObject(message.shieldedInstanceIntegrityPolicy, options); + if (options.oneofs) + object._shieldedInstanceIntegrityPolicy = "shieldedInstanceIntegrityPolicy"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Instance.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + object.hostname = message.hostname; + if (options.oneofs) + object._hostname = "hostname"; + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + object.displayDevice = $root.google.cloud.compute.v1.DisplayDevice.toObject(message.displayDevice, options); + if (options.oneofs) + object._displayDevice = "displayDevice"; + } + if (message.serviceAccounts && message.serviceAccounts.length) { + object.serviceAccounts = []; + for (var j = 0; j < message.serviceAccounts.length; ++j) + object.serviceAccounts[j] = $root.google.cloud.compute.v1.ServiceAccount.toObject(message.serviceAccounts[j], options); + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + object.statusMessage = message.statusMessage; + if (options.oneofs) + object._statusMessage = "statusMessage"; + } + if (message.lastSuspendedTimestamp != null && message.hasOwnProperty("lastSuspendedTimestamp")) { + object.lastSuspendedTimestamp = message.lastSuspendedTimestamp; + if (options.oneofs) + object._lastSuspendedTimestamp = "lastSuspendedTimestamp"; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.compute.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + object.advancedMachineFeatures = $root.google.cloud.compute.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); + if (options.oneofs) + object._advancedMachineFeatures = "advancedMachineFeatures"; + } + if (message.cpuPlatform != null && message.hasOwnProperty("cpuPlatform")) { + object.cpuPlatform = message.cpuPlatform; + if (options.oneofs) + object._cpuPlatform = "cpuPlatform"; + } + if (message.lastStopTimestamp != null && message.hasOwnProperty("lastStopTimestamp")) { + object.lastStopTimestamp = message.lastStopTimestamp; + if (options.oneofs) + object._lastStopTimestamp = "lastStopTimestamp"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.lastStartTimestamp != null && message.hasOwnProperty("lastStartTimestamp")) { + object.lastStartTimestamp = message.lastStartTimestamp; + if (options.oneofs) + object._lastStartTimestamp = "lastStartTimestamp"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + object.deletionProtection = message.deletionProtection; + if (options.oneofs) + object._deletionProtection = "deletionProtection"; + } + if (message.guestAccelerators && message.guestAccelerators.length) { + object.guestAccelerators = []; + for (var j = 0; j < message.guestAccelerators.length; ++j) + object.guestAccelerators[j] = $root.google.cloud.compute.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + object.confidentialInstanceConfig = $root.google.cloud.compute.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); + if (options.oneofs) + object._confidentialInstanceConfig = "confidentialInstanceConfig"; + } + 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 Instance to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PrivateIpv6GoogleAccess enum. + * @name google.cloud.compute.v1.Instance.PrivateIpv6GoogleAccess + * @enum {number} + * @property {number} UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS=0 UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS value + * @property {number} ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE=427975994 ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE value + * @property {number} ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE=288210263 ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE value + * @property {number} INHERIT_FROM_SUBNETWORK=530256959 INHERIT_FROM_SUBNETWORK value + */ + Instance.PrivateIpv6GoogleAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS"] = 0; + values[valuesById[427975994] = "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"] = 427975994; + values[valuesById[288210263] = "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"] = 288210263; + values[valuesById[530256959] = "INHERIT_FROM_SUBNETWORK"] = 530256959; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.Instance.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} DEPROVISIONING=428935662 DEPROVISIONING value + * @property {number} PROVISIONING=290896621 PROVISIONING value + * @property {number} REPAIRING=413483285 REPAIRING value + * @property {number} RUNNING=121282975 RUNNING value + * @property {number} STAGING=431072283 STAGING value + * @property {number} STOPPED=444276141 STOPPED value + * @property {number} STOPPING=350791796 STOPPING value + * @property {number} SUSPENDED=51223995 SUSPENDED value + * @property {number} SUSPENDING=514206246 SUSPENDING value + * @property {number} TERMINATED=250018339 TERMINATED value + */ + Instance.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[428935662] = "DEPROVISIONING"] = 428935662; + values[valuesById[290896621] = "PROVISIONING"] = 290896621; + values[valuesById[413483285] = "REPAIRING"] = 413483285; + values[valuesById[121282975] = "RUNNING"] = 121282975; + values[valuesById[431072283] = "STAGING"] = 431072283; + values[valuesById[444276141] = "STOPPED"] = 444276141; + values[valuesById[350791796] = "STOPPING"] = 350791796; + values[valuesById[51223995] = "SUSPENDED"] = 51223995; + values[valuesById[514206246] = "SUSPENDING"] = 514206246; + values[valuesById[250018339] = "TERMINATED"] = 250018339; + return values; + })(); + + return Instance; + })(); + + v1.InstancesScopedList = (function() { + + /** + * Properties of an InstancesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IInstancesScopedList + * @property {Array.|null} [instances] InstancesScopedList instances + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstancesScopedList warning + */ + + /** + * Constructs a new InstancesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesScopedList. + * @implements IInstancesScopedList + * @constructor + * @param {google.cloud.compute.v1.IInstancesScopedList=} [properties] Properties to set + */ + function InstancesScopedList(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesScopedList instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstancesScopedList + * @instance + */ + InstancesScopedList.prototype.instances = $util.emptyArray; + + /** + * InstancesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstancesScopedList + * @instance + */ + InstancesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstancesScopedList + * @instance + */ + Object.defineProperty(InstancesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {google.cloud.compute.v1.IInstancesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesScopedList} InstancesScopedList instance + */ + InstancesScopedList.create = function create(properties) { + return new InstancesScopedList(properties); + }; + + /** + * Encodes the specified InstancesScopedList message. Does not implicitly {@link google.cloud.compute.v1.InstancesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {google.cloud.compute.v1.IInstancesScopedList} message InstancesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesScopedList.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.compute.v1.Instance.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {google.cloud.compute.v1.IInstancesScopedList} message InstancesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesScopedList} InstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.Instance.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesScopedList} InstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.compute.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstancesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesScopedList} InstancesScopedList + */ + InstancesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.InstancesScopedList(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstancesScopedList.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesScopedList.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstancesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesScopedList + * @static + * @param {google.cloud.compute.v1.InstancesScopedList} message InstancesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.Instance.toObject(message.instances[j], options); + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + return object; + }; + + /** + * Converts this InstancesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesScopedList + * @instance + * @returns {Object.} JSON object + */ + InstancesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesScopedList; + })(); + + v1.InstanceAggregatedList = (function() { + + /** + * Properties of an InstanceAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceAggregatedList + * @property {string|null} [id] InstanceAggregatedList id + * @property {Object.|null} [items] InstanceAggregatedList items + * @property {string|null} [kind] InstanceAggregatedList kind + * @property {string|null} [nextPageToken] InstanceAggregatedList nextPageToken + * @property {string|null} [selfLink] InstanceAggregatedList selfLink + * @property {Array.|null} [unreachables] InstanceAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceAggregatedList warning + */ + + /** + * Constructs a new InstanceAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceAggregatedList. + * @implements IInstanceAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IInstanceAggregatedList=} [properties] Properties to set + */ + function InstanceAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + InstanceAggregatedList.prototype.id = null; + + /** + * InstanceAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + InstanceAggregatedList.prototype.items = $util.emptyObject; + + /** + * InstanceAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + InstanceAggregatedList.prototype.kind = null; + + /** + * InstanceAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + InstanceAggregatedList.prototype.nextPageToken = null; + + /** + * InstanceAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + InstanceAggregatedList.prototype.selfLink = null; + + /** + * InstanceAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + InstanceAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * InstanceAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + InstanceAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + Object.defineProperty(InstanceAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + Object.defineProperty(InstanceAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + Object.defineProperty(InstanceAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + Object.defineProperty(InstanceAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + */ + Object.defineProperty(InstanceAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceAggregatedList} InstanceAggregatedList instance + */ + InstanceAggregatedList.create = function create(properties) { + return new InstanceAggregatedList(properties); + }; + + /** + * Encodes the specified InstanceAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceAggregatedList} message InstanceAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.InstancesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceAggregatedList} message InstanceAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceAggregatedList} InstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.InstancesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceAggregatedList} InstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.InstancesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceAggregatedList} InstanceAggregatedList + */ + InstanceAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.InstancesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.InstanceAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.InstanceAggregatedList} message InstanceAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.InstancesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceAggregatedList + * @instance + * @returns {Object.} JSON object + */ + InstanceAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceAggregatedList; + })(); + + v1.NamedPort = (function() { + + /** + * Properties of a NamedPort. + * @memberof google.cloud.compute.v1 + * @interface INamedPort + * @property {string|null} [name] NamedPort name + * @property {number|null} [port] NamedPort port + */ + + /** + * Constructs a new NamedPort. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NamedPort. + * @implements INamedPort + * @constructor + * @param {google.cloud.compute.v1.INamedPort=} [properties] Properties to set + */ + function NamedPort(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamedPort name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NamedPort + * @instance + */ + NamedPort.prototype.name = null; + + /** + * NamedPort port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.NamedPort + * @instance + */ + NamedPort.prototype.port = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NamedPort _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NamedPort + * @instance + */ + Object.defineProperty(NamedPort.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NamedPort _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.NamedPort + * @instance + */ + Object.defineProperty(NamedPort.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NamedPort instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {google.cloud.compute.v1.INamedPort=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NamedPort} NamedPort instance + */ + NamedPort.create = function create(properties) { + return new NamedPort(properties); + }; + + /** + * Encodes the specified NamedPort message. Does not implicitly {@link google.cloud.compute.v1.NamedPort.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {google.cloud.compute.v1.INamedPort} message NamedPort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamedPort.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + return writer; + }; + + /** + * Encodes the specified NamedPort message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NamedPort.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {google.cloud.compute.v1.INamedPort} message NamedPort message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamedPort.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamedPort message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NamedPort} NamedPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamedPort.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NamedPort(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NamedPort message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NamedPort} NamedPort + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamedPort.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamedPort message. + * @function verify + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamedPort.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + return null; + }; + + /** + * Creates a NamedPort message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NamedPort} NamedPort + */ + NamedPort.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NamedPort) + return object; + var message = new $root.google.cloud.compute.v1.NamedPort(); + if (object.name != null) + message.name = String(object.name); + if (object.port != null) + message.port = object.port | 0; + return message; + }; + + /** + * Creates a plain object from a NamedPort message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NamedPort + * @static + * @param {google.cloud.compute.v1.NamedPort} message NamedPort + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamedPort.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + return object; + }; + + /** + * Converts this NamedPort to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NamedPort + * @instance + * @returns {Object.} JSON object + */ + NamedPort.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamedPort; + })(); + + v1.InstanceGroup = (function() { + + /** + * Properties of an InstanceGroup. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroup + * @property {string|null} [creationTimestamp] InstanceGroup creationTimestamp + * @property {string|null} [description] InstanceGroup description + * @property {string|null} [fingerprint] InstanceGroup fingerprint + * @property {number|Long|null} [id] InstanceGroup id + * @property {string|null} [kind] InstanceGroup kind + * @property {string|null} [name] InstanceGroup name + * @property {Array.|null} [namedPorts] InstanceGroup namedPorts + * @property {string|null} [network] InstanceGroup network + * @property {string|null} [region] InstanceGroup region + * @property {string|null} [selfLink] InstanceGroup selfLink + * @property {number|null} [size] InstanceGroup size + * @property {string|null} [subnetwork] InstanceGroup subnetwork + * @property {string|null} [zone] InstanceGroup zone + */ + + /** + * Constructs a new InstanceGroup. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroup. + * @implements IInstanceGroup + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroup=} [properties] Properties to set + */ + function InstanceGroup(properties) { + this.namedPorts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroup creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.creationTimestamp = null; + + /** + * InstanceGroup description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.description = null; + + /** + * InstanceGroup fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.fingerprint = null; + + /** + * InstanceGroup id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.id = null; + + /** + * InstanceGroup kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.kind = null; + + /** + * InstanceGroup name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.name = null; + + /** + * InstanceGroup namedPorts. + * @member {Array.} namedPorts + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.namedPorts = $util.emptyArray; + + /** + * InstanceGroup network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.network = null; + + /** + * InstanceGroup region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.region = null; + + /** + * InstanceGroup selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.selfLink = null; + + /** + * InstanceGroup size. + * @member {number|null|undefined} size + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.size = null; + + /** + * InstanceGroup subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.subnetwork = null; + + /** + * InstanceGroup zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + InstanceGroup.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroup _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _size. + * @member {"size"|undefined} _size + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_size", { + get: $util.oneOfGetter($oneOfFields = ["size"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroup _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + */ + Object.defineProperty(InstanceGroup.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroup instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {google.cloud.compute.v1.IInstanceGroup=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroup} InstanceGroup instance + */ + InstanceGroup.create = function create(properties) { + return new InstanceGroup(properties); + }; + + /** + * Encodes the specified InstanceGroup message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {google.cloud.compute.v1.IInstanceGroup} message InstanceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 3530753, wireType 0 =*/28246024).int32(message.size); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.namedPorts != null && message.namedPorts.length) + for (var i = 0; i < message.namedPorts.length; ++i) + $root.google.cloud.compute.v1.NamedPort.encode(message.namedPorts[i], writer.uint32(/* id 427598732, wireType 2 =*/3420789858).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceGroup message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {google.cloud.compute.v1.IInstanceGroup} message InstanceGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroup} InstanceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 427598732: + if (!(message.namedPorts && message.namedPorts.length)) + message.namedPorts = []; + message.namedPorts.push($root.google.cloud.compute.v1.NamedPort.decode(reader, reader.uint32())); + break; + case 232872494: + message.network = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3530753: + message.size = reader.int32(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroup} InstanceGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroup message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.namedPorts != null && message.hasOwnProperty("namedPorts")) { + if (!Array.isArray(message.namedPorts)) + return "namedPorts: array expected"; + for (var i = 0; i < message.namedPorts.length; ++i) { + var error = $root.google.cloud.compute.v1.NamedPort.verify(message.namedPorts[i]); + if (error) + return "namedPorts." + error; + } + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.size != null && message.hasOwnProperty("size")) { + properties._size = 1; + if (!$util.isInteger(message.size)) + return "size: integer expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates an InstanceGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroup} InstanceGroup + */ + InstanceGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroup) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroup(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.namedPorts) { + if (!Array.isArray(object.namedPorts)) + throw TypeError(".google.cloud.compute.v1.InstanceGroup.namedPorts: array expected"); + message.namedPorts = []; + for (var i = 0; i < object.namedPorts.length; ++i) { + if (typeof object.namedPorts[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroup.namedPorts: object expected"); + message.namedPorts[i] = $root.google.cloud.compute.v1.NamedPort.fromObject(object.namedPorts[i]); + } + } + if (object.network != null) + message.network = String(object.network); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.size != null) + message.size = object.size | 0; + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InstanceGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroup + * @static + * @param {google.cloud.compute.v1.InstanceGroup} message InstanceGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.namedPorts = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.size != null && message.hasOwnProperty("size")) { + object.size = message.size; + if (options.oneofs) + object._size = "size"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.namedPorts && message.namedPorts.length) { + object.namedPorts = []; + for (var j = 0; j < message.namedPorts.length; ++j) + object.namedPorts[j] = $root.google.cloud.compute.v1.NamedPort.toObject(message.namedPorts[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceGroup to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroup + * @instance + * @returns {Object.} JSON object + */ + InstanceGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroup; + })(); + + v1.InstanceGroupsScopedList = (function() { + + /** + * Properties of an InstanceGroupsScopedList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupsScopedList + * @property {Array.|null} [instanceGroups] InstanceGroupsScopedList instanceGroups + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupsScopedList warning + */ + + /** + * Constructs a new InstanceGroupsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupsScopedList. + * @implements IInstanceGroupsScopedList + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupsScopedList=} [properties] Properties to set + */ + function InstanceGroupsScopedList(properties) { + this.instanceGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupsScopedList instanceGroups. + * @member {Array.} instanceGroups + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @instance + */ + InstanceGroupsScopedList.prototype.instanceGroups = $util.emptyArray; + + /** + * InstanceGroupsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @instance + */ + InstanceGroupsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @instance + */ + Object.defineProperty(InstanceGroupsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupsScopedList} InstanceGroupsScopedList instance + */ + InstanceGroupsScopedList.create = function create(properties) { + return new InstanceGroupsScopedList(properties); + }; + + /** + * Encodes the specified InstanceGroupsScopedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsScopedList} message InstanceGroupsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.instanceGroups != null && message.instanceGroups.length) + for (var i = 0; i < message.instanceGroups.length; ++i) + $root.google.cloud.compute.v1.InstanceGroup.encode(message.instanceGroups[i], writer.uint32(/* id 366469310, wireType 2 =*/2931754482).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsScopedList} message InstanceGroupsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupsScopedList} InstanceGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 366469310: + if (!(message.instanceGroups && message.instanceGroups.length)) + message.instanceGroups = []; + message.instanceGroups.push($root.google.cloud.compute.v1.InstanceGroup.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupsScopedList} InstanceGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroups != null && message.hasOwnProperty("instanceGroups")) { + if (!Array.isArray(message.instanceGroups)) + return "instanceGroups: array expected"; + for (var i = 0; i < message.instanceGroups.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroup.verify(message.instanceGroups[i]); + if (error) + return "instanceGroups." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupsScopedList} InstanceGroupsScopedList + */ + InstanceGroupsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupsScopedList(); + if (object.instanceGroups) { + if (!Array.isArray(object.instanceGroups)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupsScopedList.instanceGroups: array expected"); + message.instanceGroups = []; + for (var i = 0; i < object.instanceGroups.length; ++i) { + if (typeof object.instanceGroups[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupsScopedList.instanceGroups: object expected"); + message.instanceGroups[i] = $root.google.cloud.compute.v1.InstanceGroup.fromObject(object.instanceGroups[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @static + * @param {google.cloud.compute.v1.InstanceGroupsScopedList} message InstanceGroupsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceGroups = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.instanceGroups && message.instanceGroups.length) { + object.instanceGroups = []; + for (var j = 0; j < message.instanceGroups.length; ++j) + object.instanceGroups[j] = $root.google.cloud.compute.v1.InstanceGroup.toObject(message.instanceGroups[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupsScopedList + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupsScopedList; + })(); + + v1.InstanceGroupAggregatedList = (function() { + + /** + * Properties of an InstanceGroupAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupAggregatedList + * @property {string|null} [id] InstanceGroupAggregatedList id + * @property {Object.|null} [items] InstanceGroupAggregatedList items + * @property {string|null} [kind] InstanceGroupAggregatedList kind + * @property {string|null} [nextPageToken] InstanceGroupAggregatedList nextPageToken + * @property {string|null} [selfLink] InstanceGroupAggregatedList selfLink + * @property {Array.|null} [unreachables] InstanceGroupAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupAggregatedList warning + */ + + /** + * Constructs a new InstanceGroupAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupAggregatedList. + * @implements IInstanceGroupAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupAggregatedList=} [properties] Properties to set + */ + function InstanceGroupAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + InstanceGroupAggregatedList.prototype.id = null; + + /** + * InstanceGroupAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + InstanceGroupAggregatedList.prototype.items = $util.emptyObject; + + /** + * InstanceGroupAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + InstanceGroupAggregatedList.prototype.kind = null; + + /** + * InstanceGroupAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + InstanceGroupAggregatedList.prototype.nextPageToken = null; + + /** + * InstanceGroupAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + InstanceGroupAggregatedList.prototype.selfLink = null; + + /** + * InstanceGroupAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + InstanceGroupAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * InstanceGroupAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + InstanceGroupAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupAggregatedList} InstanceGroupAggregatedList instance + */ + InstanceGroupAggregatedList.create = function create(properties) { + return new InstanceGroupAggregatedList(properties); + }; + + /** + * Encodes the specified InstanceGroupAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupAggregatedList} message InstanceGroupAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.InstanceGroupsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceGroupAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupAggregatedList} message InstanceGroupAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupAggregatedList} InstanceGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.InstanceGroupsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupAggregatedList} InstanceGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroupsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupAggregatedList} InstanceGroupAggregatedList + */ + InstanceGroupAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.InstanceGroupsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.InstanceGroupAggregatedList} message InstanceGroupAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.InstanceGroupsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceGroupAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupAggregatedList + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupAggregatedList; + })(); + + v1.InstanceGroupList = (function() { + + /** + * Properties of an InstanceGroupList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupList + * @property {string|null} [id] InstanceGroupList id + * @property {Array.|null} [items] InstanceGroupList items + * @property {string|null} [kind] InstanceGroupList kind + * @property {string|null} [nextPageToken] InstanceGroupList nextPageToken + * @property {string|null} [selfLink] InstanceGroupList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupList warning + */ + + /** + * Constructs a new InstanceGroupList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupList. + * @implements IInstanceGroupList + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupList=} [properties] Properties to set + */ + function InstanceGroupList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + InstanceGroupList.prototype.id = null; + + /** + * InstanceGroupList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + InstanceGroupList.prototype.items = $util.emptyArray; + + /** + * InstanceGroupList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + InstanceGroupList.prototype.kind = null; + + /** + * InstanceGroupList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + InstanceGroupList.prototype.nextPageToken = null; + + /** + * InstanceGroupList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + InstanceGroupList.prototype.selfLink = null; + + /** + * InstanceGroupList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + InstanceGroupList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + Object.defineProperty(InstanceGroupList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + Object.defineProperty(InstanceGroupList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + Object.defineProperty(InstanceGroupList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + Object.defineProperty(InstanceGroupList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + */ + Object.defineProperty(InstanceGroupList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupList} InstanceGroupList instance + */ + InstanceGroupList.create = function create(properties) { + return new InstanceGroupList(properties); + }; + + /** + * Encodes the specified InstanceGroupList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupList} message InstanceGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceGroup.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupList} message InstanceGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupList} InstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceGroup.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupList} InstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroup.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupList} InstanceGroupList + */ + InstanceGroupList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceGroup.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupList + * @static + * @param {google.cloud.compute.v1.InstanceGroupList} message InstanceGroupList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceGroup.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceGroupList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupList + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupList; + })(); + + v1.InstanceGroupManagerAutoHealingPolicy = (function() { + + /** + * Properties of an InstanceGroupManagerAutoHealingPolicy. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerAutoHealingPolicy + * @property {string|null} [healthCheck] InstanceGroupManagerAutoHealingPolicy healthCheck + * @property {number|null} [initialDelaySec] InstanceGroupManagerAutoHealingPolicy initialDelaySec + */ + + /** + * Constructs a new InstanceGroupManagerAutoHealingPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerAutoHealingPolicy. + * @implements IInstanceGroupManagerAutoHealingPolicy + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy=} [properties] Properties to set + */ + function InstanceGroupManagerAutoHealingPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerAutoHealingPolicy healthCheck. + * @member {string|null|undefined} healthCheck + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @instance + */ + InstanceGroupManagerAutoHealingPolicy.prototype.healthCheck = null; + + /** + * InstanceGroupManagerAutoHealingPolicy initialDelaySec. + * @member {number|null|undefined} initialDelaySec + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @instance + */ + InstanceGroupManagerAutoHealingPolicy.prototype.initialDelaySec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerAutoHealingPolicy _healthCheck. + * @member {"healthCheck"|undefined} _healthCheck + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerAutoHealingPolicy.prototype, "_healthCheck", { + get: $util.oneOfGetter($oneOfFields = ["healthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerAutoHealingPolicy _initialDelaySec. + * @member {"initialDelaySec"|undefined} _initialDelaySec + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerAutoHealingPolicy.prototype, "_initialDelaySec", { + get: $util.oneOfGetter($oneOfFields = ["initialDelaySec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerAutoHealingPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy} InstanceGroupManagerAutoHealingPolicy instance + */ + InstanceGroupManagerAutoHealingPolicy.create = function create(properties) { + return new InstanceGroupManagerAutoHealingPolicy(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerAutoHealingPolicy message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy} message InstanceGroupManagerAutoHealingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerAutoHealingPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialDelaySec != null && Object.hasOwnProperty.call(message, "initialDelaySec")) + writer.uint32(/* id 263207002, wireType 0 =*/2105656016).int32(message.initialDelaySec); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerAutoHealingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerAutoHealingPolicy} message InstanceGroupManagerAutoHealingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerAutoHealingPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerAutoHealingPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy} InstanceGroupManagerAutoHealingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerAutoHealingPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 263207002: + message.initialDelaySec = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerAutoHealingPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy} InstanceGroupManagerAutoHealingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerAutoHealingPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerAutoHealingPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerAutoHealingPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + properties._healthCheck = 1; + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + } + if (message.initialDelaySec != null && message.hasOwnProperty("initialDelaySec")) { + properties._initialDelaySec = 1; + if (!$util.isInteger(message.initialDelaySec)) + return "initialDelaySec: integer expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagerAutoHealingPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy} InstanceGroupManagerAutoHealingPolicy + */ + InstanceGroupManagerAutoHealingPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.initialDelaySec != null) + message.initialDelaySec = object.initialDelaySec | 0; + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerAutoHealingPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy} message InstanceGroupManagerAutoHealingPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerAutoHealingPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.initialDelaySec != null && message.hasOwnProperty("initialDelaySec")) { + object.initialDelaySec = message.initialDelaySec; + if (options.oneofs) + object._initialDelaySec = "initialDelaySec"; + } + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + object.healthCheck = message.healthCheck; + if (options.oneofs) + object._healthCheck = "healthCheck"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerAutoHealingPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerAutoHealingPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerAutoHealingPolicy; + })(); + + v1.InstanceGroupManagerActionsSummary = (function() { + + /** + * Properties of an InstanceGroupManagerActionsSummary. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerActionsSummary + * @property {number|null} [abandoning] InstanceGroupManagerActionsSummary abandoning + * @property {number|null} [creating] InstanceGroupManagerActionsSummary creating + * @property {number|null} [creatingWithoutRetries] InstanceGroupManagerActionsSummary creatingWithoutRetries + * @property {number|null} [deleting] InstanceGroupManagerActionsSummary deleting + * @property {number|null} [none] InstanceGroupManagerActionsSummary none + * @property {number|null} [recreating] InstanceGroupManagerActionsSummary recreating + * @property {number|null} [refreshing] InstanceGroupManagerActionsSummary refreshing + * @property {number|null} [restarting] InstanceGroupManagerActionsSummary restarting + * @property {number|null} [verifying] InstanceGroupManagerActionsSummary verifying + */ + + /** + * Constructs a new InstanceGroupManagerActionsSummary. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerActionsSummary. + * @implements IInstanceGroupManagerActionsSummary + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerActionsSummary=} [properties] Properties to set + */ + function InstanceGroupManagerActionsSummary(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerActionsSummary abandoning. + * @member {number|null|undefined} abandoning + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.abandoning = null; + + /** + * InstanceGroupManagerActionsSummary creating. + * @member {number|null|undefined} creating + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.creating = null; + + /** + * InstanceGroupManagerActionsSummary creatingWithoutRetries. + * @member {number|null|undefined} creatingWithoutRetries + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.creatingWithoutRetries = null; + + /** + * InstanceGroupManagerActionsSummary deleting. + * @member {number|null|undefined} deleting + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.deleting = null; + + /** + * InstanceGroupManagerActionsSummary none. + * @member {number|null|undefined} none + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.none = null; + + /** + * InstanceGroupManagerActionsSummary recreating. + * @member {number|null|undefined} recreating + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.recreating = null; + + /** + * InstanceGroupManagerActionsSummary refreshing. + * @member {number|null|undefined} refreshing + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.refreshing = null; + + /** + * InstanceGroupManagerActionsSummary restarting. + * @member {number|null|undefined} restarting + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.restarting = null; + + /** + * InstanceGroupManagerActionsSummary verifying. + * @member {number|null|undefined} verifying + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + InstanceGroupManagerActionsSummary.prototype.verifying = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerActionsSummary _abandoning. + * @member {"abandoning"|undefined} _abandoning + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_abandoning", { + get: $util.oneOfGetter($oneOfFields = ["abandoning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _creating. + * @member {"creating"|undefined} _creating + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_creating", { + get: $util.oneOfGetter($oneOfFields = ["creating"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _creatingWithoutRetries. + * @member {"creatingWithoutRetries"|undefined} _creatingWithoutRetries + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_creatingWithoutRetries", { + get: $util.oneOfGetter($oneOfFields = ["creatingWithoutRetries"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _deleting. + * @member {"deleting"|undefined} _deleting + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_deleting", { + get: $util.oneOfGetter($oneOfFields = ["deleting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _none. + * @member {"none"|undefined} _none + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_none", { + get: $util.oneOfGetter($oneOfFields = ["none"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _recreating. + * @member {"recreating"|undefined} _recreating + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_recreating", { + get: $util.oneOfGetter($oneOfFields = ["recreating"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _refreshing. + * @member {"refreshing"|undefined} _refreshing + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_refreshing", { + get: $util.oneOfGetter($oneOfFields = ["refreshing"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _restarting. + * @member {"restarting"|undefined} _restarting + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_restarting", { + get: $util.oneOfGetter($oneOfFields = ["restarting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerActionsSummary _verifying. + * @member {"verifying"|undefined} _verifying + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + */ + Object.defineProperty(InstanceGroupManagerActionsSummary.prototype, "_verifying", { + get: $util.oneOfGetter($oneOfFields = ["verifying"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerActionsSummary instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerActionsSummary=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerActionsSummary} InstanceGroupManagerActionsSummary instance + */ + InstanceGroupManagerActionsSummary.create = function create(properties) { + return new InstanceGroupManagerActionsSummary(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerActionsSummary message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerActionsSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerActionsSummary} message InstanceGroupManagerActionsSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerActionsSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.none != null && Object.hasOwnProperty.call(message, "none")) + writer.uint32(/* id 3387192, wireType 0 =*/27097536).int32(message.none); + if (message.creating != null && Object.hasOwnProperty.call(message, "creating")) + writer.uint32(/* id 209809081, wireType 0 =*/1678472648).int32(message.creating); + if (message.refreshing != null && Object.hasOwnProperty.call(message, "refreshing")) + writer.uint32(/* id 215044903, wireType 0 =*/1720359224).int32(message.refreshing); + if (message.deleting != null && Object.hasOwnProperty.call(message, "deleting")) + writer.uint32(/* id 282846120, wireType 0 =*/2262768960).int32(message.deleting); + if (message.recreating != null && Object.hasOwnProperty.call(message, "recreating")) + writer.uint32(/* id 339057132, wireType 0 =*/2712457056).int32(message.recreating); + if (message.creatingWithoutRetries != null && Object.hasOwnProperty.call(message, "creatingWithoutRetries")) + writer.uint32(/* id 369916745, wireType 0 =*/2959333960).int32(message.creatingWithoutRetries); + if (message.restarting != null && Object.hasOwnProperty.call(message, "restarting")) + writer.uint32(/* id 372312947, wireType 0 =*/2978503576).int32(message.restarting); + if (message.abandoning != null && Object.hasOwnProperty.call(message, "abandoning")) + writer.uint32(/* id 440023373, wireType 0 =*/3520186984).int32(message.abandoning); + if (message.verifying != null && Object.hasOwnProperty.call(message, "verifying")) + writer.uint32(/* id 451612873, wireType 0 =*/3612902984).int32(message.verifying); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerActionsSummary message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerActionsSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerActionsSummary} message InstanceGroupManagerActionsSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerActionsSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerActionsSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerActionsSummary} InstanceGroupManagerActionsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerActionsSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 440023373: + message.abandoning = reader.int32(); + break; + case 209809081: + message.creating = reader.int32(); + break; + case 369916745: + message.creatingWithoutRetries = reader.int32(); + break; + case 282846120: + message.deleting = reader.int32(); + break; + case 3387192: + message.none = reader.int32(); + break; + case 339057132: + message.recreating = reader.int32(); + break; + case 215044903: + message.refreshing = reader.int32(); + break; + case 372312947: + message.restarting = reader.int32(); + break; + case 451612873: + message.verifying = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerActionsSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerActionsSummary} InstanceGroupManagerActionsSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerActionsSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerActionsSummary message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerActionsSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.abandoning != null && message.hasOwnProperty("abandoning")) { + properties._abandoning = 1; + if (!$util.isInteger(message.abandoning)) + return "abandoning: integer expected"; + } + if (message.creating != null && message.hasOwnProperty("creating")) { + properties._creating = 1; + if (!$util.isInteger(message.creating)) + return "creating: integer expected"; + } + if (message.creatingWithoutRetries != null && message.hasOwnProperty("creatingWithoutRetries")) { + properties._creatingWithoutRetries = 1; + if (!$util.isInteger(message.creatingWithoutRetries)) + return "creatingWithoutRetries: integer expected"; + } + if (message.deleting != null && message.hasOwnProperty("deleting")) { + properties._deleting = 1; + if (!$util.isInteger(message.deleting)) + return "deleting: integer expected"; + } + if (message.none != null && message.hasOwnProperty("none")) { + properties._none = 1; + if (!$util.isInteger(message.none)) + return "none: integer expected"; + } + if (message.recreating != null && message.hasOwnProperty("recreating")) { + properties._recreating = 1; + if (!$util.isInteger(message.recreating)) + return "recreating: integer expected"; + } + if (message.refreshing != null && message.hasOwnProperty("refreshing")) { + properties._refreshing = 1; + if (!$util.isInteger(message.refreshing)) + return "refreshing: integer expected"; + } + if (message.restarting != null && message.hasOwnProperty("restarting")) { + properties._restarting = 1; + if (!$util.isInteger(message.restarting)) + return "restarting: integer expected"; + } + if (message.verifying != null && message.hasOwnProperty("verifying")) { + properties._verifying = 1; + if (!$util.isInteger(message.verifying)) + return "verifying: integer expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagerActionsSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerActionsSummary} InstanceGroupManagerActionsSummary + */ + InstanceGroupManagerActionsSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary(); + if (object.abandoning != null) + message.abandoning = object.abandoning | 0; + if (object.creating != null) + message.creating = object.creating | 0; + if (object.creatingWithoutRetries != null) + message.creatingWithoutRetries = object.creatingWithoutRetries | 0; + if (object.deleting != null) + message.deleting = object.deleting | 0; + if (object.none != null) + message.none = object.none | 0; + if (object.recreating != null) + message.recreating = object.recreating | 0; + if (object.refreshing != null) + message.refreshing = object.refreshing | 0; + if (object.restarting != null) + message.restarting = object.restarting | 0; + if (object.verifying != null) + message.verifying = object.verifying | 0; + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerActionsSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerActionsSummary} message InstanceGroupManagerActionsSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerActionsSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.none != null && message.hasOwnProperty("none")) { + object.none = message.none; + if (options.oneofs) + object._none = "none"; + } + if (message.creating != null && message.hasOwnProperty("creating")) { + object.creating = message.creating; + if (options.oneofs) + object._creating = "creating"; + } + if (message.refreshing != null && message.hasOwnProperty("refreshing")) { + object.refreshing = message.refreshing; + if (options.oneofs) + object._refreshing = "refreshing"; + } + if (message.deleting != null && message.hasOwnProperty("deleting")) { + object.deleting = message.deleting; + if (options.oneofs) + object._deleting = "deleting"; + } + if (message.recreating != null && message.hasOwnProperty("recreating")) { + object.recreating = message.recreating; + if (options.oneofs) + object._recreating = "recreating"; + } + if (message.creatingWithoutRetries != null && message.hasOwnProperty("creatingWithoutRetries")) { + object.creatingWithoutRetries = message.creatingWithoutRetries; + if (options.oneofs) + object._creatingWithoutRetries = "creatingWithoutRetries"; + } + if (message.restarting != null && message.hasOwnProperty("restarting")) { + object.restarting = message.restarting; + if (options.oneofs) + object._restarting = "restarting"; + } + if (message.abandoning != null && message.hasOwnProperty("abandoning")) { + object.abandoning = message.abandoning; + if (options.oneofs) + object._abandoning = "abandoning"; + } + if (message.verifying != null && message.hasOwnProperty("verifying")) { + object.verifying = message.verifying; + if (options.oneofs) + object._verifying = "verifying"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerActionsSummary to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerActionsSummary + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerActionsSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerActionsSummary; + })(); + + v1.StatefulPolicy = (function() { + + /** + * Properties of a StatefulPolicy. + * @memberof google.cloud.compute.v1 + * @interface IStatefulPolicy + * @property {google.cloud.compute.v1.IStatefulPolicyPreservedState|null} [preservedState] StatefulPolicy preservedState + */ + + /** + * Constructs a new StatefulPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a StatefulPolicy. + * @implements IStatefulPolicy + * @constructor + * @param {google.cloud.compute.v1.IStatefulPolicy=} [properties] Properties to set + */ + function StatefulPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatefulPolicy preservedState. + * @member {google.cloud.compute.v1.IStatefulPolicyPreservedState|null|undefined} preservedState + * @memberof google.cloud.compute.v1.StatefulPolicy + * @instance + */ + StatefulPolicy.prototype.preservedState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StatefulPolicy _preservedState. + * @member {"preservedState"|undefined} _preservedState + * @memberof google.cloud.compute.v1.StatefulPolicy + * @instance + */ + Object.defineProperty(StatefulPolicy.prototype, "_preservedState", { + get: $util.oneOfGetter($oneOfFields = ["preservedState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StatefulPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {google.cloud.compute.v1.IStatefulPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.StatefulPolicy} StatefulPolicy instance + */ + StatefulPolicy.create = function create(properties) { + return new StatefulPolicy(properties); + }; + + /** + * Encodes the specified StatefulPolicy message. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {google.cloud.compute.v1.IStatefulPolicy} message StatefulPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatefulPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.preservedState != null && Object.hasOwnProperty.call(message, "preservedState")) + $root.google.cloud.compute.v1.StatefulPolicyPreservedState.encode(message.preservedState, writer.uint32(/* id 2634026, wireType 2 =*/21072210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StatefulPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {google.cloud.compute.v1.IStatefulPolicy} message StatefulPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatefulPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatefulPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.StatefulPolicy} StatefulPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatefulPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.StatefulPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2634026: + message.preservedState = $root.google.cloud.compute.v1.StatefulPolicyPreservedState.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatefulPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.StatefulPolicy} StatefulPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatefulPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatefulPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatefulPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.preservedState != null && message.hasOwnProperty("preservedState")) { + properties._preservedState = 1; + { + var error = $root.google.cloud.compute.v1.StatefulPolicyPreservedState.verify(message.preservedState); + if (error) + return "preservedState." + error; + } + } + return null; + }; + + /** + * Creates a StatefulPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.StatefulPolicy} StatefulPolicy + */ + StatefulPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.StatefulPolicy) + return object; + var message = new $root.google.cloud.compute.v1.StatefulPolicy(); + if (object.preservedState != null) { + if (typeof object.preservedState !== "object") + throw TypeError(".google.cloud.compute.v1.StatefulPolicy.preservedState: object expected"); + message.preservedState = $root.google.cloud.compute.v1.StatefulPolicyPreservedState.fromObject(object.preservedState); + } + return message; + }; + + /** + * Creates a plain object from a StatefulPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.StatefulPolicy + * @static + * @param {google.cloud.compute.v1.StatefulPolicy} message StatefulPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatefulPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.preservedState != null && message.hasOwnProperty("preservedState")) { + object.preservedState = $root.google.cloud.compute.v1.StatefulPolicyPreservedState.toObject(message.preservedState, options); + if (options.oneofs) + object._preservedState = "preservedState"; + } + return object; + }; + + /** + * Converts this StatefulPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.StatefulPolicy + * @instance + * @returns {Object.} JSON object + */ + StatefulPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StatefulPolicy; + })(); + + v1.InstanceGroupManagerStatus = (function() { + + /** + * Properties of an InstanceGroupManagerStatus. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerStatus + * @property {string|null} [autoscaler] InstanceGroupManagerStatus autoscaler + * @property {boolean|null} [isStable] InstanceGroupManagerStatus isStable + * @property {google.cloud.compute.v1.IInstanceGroupManagerStatusStateful|null} [stateful] InstanceGroupManagerStatus stateful + * @property {google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget|null} [versionTarget] InstanceGroupManagerStatus versionTarget + */ + + /** + * Constructs a new InstanceGroupManagerStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerStatus. + * @implements IInstanceGroupManagerStatus + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatus=} [properties] Properties to set + */ + function InstanceGroupManagerStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerStatus autoscaler. + * @member {string|null|undefined} autoscaler + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + InstanceGroupManagerStatus.prototype.autoscaler = null; + + /** + * InstanceGroupManagerStatus isStable. + * @member {boolean|null|undefined} isStable + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + InstanceGroupManagerStatus.prototype.isStable = null; + + /** + * InstanceGroupManagerStatus stateful. + * @member {google.cloud.compute.v1.IInstanceGroupManagerStatusStateful|null|undefined} stateful + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + InstanceGroupManagerStatus.prototype.stateful = null; + + /** + * InstanceGroupManagerStatus versionTarget. + * @member {google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget|null|undefined} versionTarget + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + InstanceGroupManagerStatus.prototype.versionTarget = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerStatus _autoscaler. + * @member {"autoscaler"|undefined} _autoscaler + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatus.prototype, "_autoscaler", { + get: $util.oneOfGetter($oneOfFields = ["autoscaler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerStatus _isStable. + * @member {"isStable"|undefined} _isStable + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatus.prototype, "_isStable", { + get: $util.oneOfGetter($oneOfFields = ["isStable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerStatus _stateful. + * @member {"stateful"|undefined} _stateful + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatus.prototype, "_stateful", { + get: $util.oneOfGetter($oneOfFields = ["stateful"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerStatus _versionTarget. + * @member {"versionTarget"|undefined} _versionTarget + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatus.prototype, "_versionTarget", { + get: $util.oneOfGetter($oneOfFields = ["versionTarget"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatus} InstanceGroupManagerStatus instance + */ + InstanceGroupManagerStatus.create = function create(properties) { + return new InstanceGroupManagerStatus(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerStatus message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatus} message InstanceGroupManagerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isStable != null && Object.hasOwnProperty.call(message, "isStable")) + writer.uint32(/* id 108410864, wireType 0 =*/867286912).bool(message.isStable); + if (message.stateful != null && Object.hasOwnProperty.call(message, "stateful")) + $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful.encode(message.stateful, writer.uint32(/* id 244462412, wireType 2 =*/1955699298).fork()).ldelim(); + if (message.versionTarget != null && Object.hasOwnProperty.call(message, "versionTarget")) + $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.encode(message.versionTarget, writer.uint32(/* id 289386200, wireType 2 =*/2315089602).fork()).ldelim(); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatus} message InstanceGroupManagerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatus} InstanceGroupManagerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 108410864: + message.isStable = reader.bool(); + break; + case 244462412: + message.stateful = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful.decode(reader, reader.uint32()); + break; + case 289386200: + message.versionTarget = $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatus} InstanceGroupManagerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerStatus message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + properties._autoscaler = 1; + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + } + if (message.isStable != null && message.hasOwnProperty("isStable")) { + properties._isStable = 1; + if (typeof message.isStable !== "boolean") + return "isStable: boolean expected"; + } + if (message.stateful != null && message.hasOwnProperty("stateful")) { + properties._stateful = 1; + { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful.verify(message.stateful); + if (error) + return "stateful." + error; + } + } + if (message.versionTarget != null && message.hasOwnProperty("versionTarget")) { + properties._versionTarget = 1; + { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.verify(message.versionTarget); + if (error) + return "versionTarget." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagerStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatus} InstanceGroupManagerStatus + */ + InstanceGroupManagerStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerStatus) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatus(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.isStable != null) + message.isStable = Boolean(object.isStable); + if (object.stateful != null) { + if (typeof object.stateful !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerStatus.stateful: object expected"); + message.stateful = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful.fromObject(object.stateful); + } + if (object.versionTarget != null) { + if (typeof object.versionTarget !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerStatus.versionTarget: object expected"); + message.versionTarget = $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.fromObject(object.versionTarget); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerStatus} message InstanceGroupManagerStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.isStable != null && message.hasOwnProperty("isStable")) { + object.isStable = message.isStable; + if (options.oneofs) + object._isStable = "isStable"; + } + if (message.stateful != null && message.hasOwnProperty("stateful")) { + object.stateful = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful.toObject(message.stateful, options); + if (options.oneofs) + object._stateful = "stateful"; + } + if (message.versionTarget != null && message.hasOwnProperty("versionTarget")) { + object.versionTarget = $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.toObject(message.versionTarget, options); + if (options.oneofs) + object._versionTarget = "versionTarget"; + } + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + object.autoscaler = message.autoscaler; + if (options.oneofs) + object._autoscaler = "autoscaler"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatus + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerStatus; + })(); + + v1.InstanceGroupManagerUpdatePolicy = (function() { + + /** + * Properties of an InstanceGroupManagerUpdatePolicy. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerUpdatePolicy + * @property {string|null} [instanceRedistributionType] InstanceGroupManagerUpdatePolicy instanceRedistributionType + * @property {google.cloud.compute.v1.IFixedOrPercent|null} [maxSurge] InstanceGroupManagerUpdatePolicy maxSurge + * @property {google.cloud.compute.v1.IFixedOrPercent|null} [maxUnavailable] InstanceGroupManagerUpdatePolicy maxUnavailable + * @property {string|null} [minimalAction] InstanceGroupManagerUpdatePolicy minimalAction + * @property {string|null} [replacementMethod] InstanceGroupManagerUpdatePolicy replacementMethod + * @property {string|null} [type] InstanceGroupManagerUpdatePolicy type + */ + + /** + * Constructs a new InstanceGroupManagerUpdatePolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerUpdatePolicy. + * @implements IInstanceGroupManagerUpdatePolicy + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy=} [properties] Properties to set + */ + function InstanceGroupManagerUpdatePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerUpdatePolicy instanceRedistributionType. + * @member {string|null|undefined} instanceRedistributionType + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + InstanceGroupManagerUpdatePolicy.prototype.instanceRedistributionType = null; + + /** + * InstanceGroupManagerUpdatePolicy maxSurge. + * @member {google.cloud.compute.v1.IFixedOrPercent|null|undefined} maxSurge + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + InstanceGroupManagerUpdatePolicy.prototype.maxSurge = null; + + /** + * InstanceGroupManagerUpdatePolicy maxUnavailable. + * @member {google.cloud.compute.v1.IFixedOrPercent|null|undefined} maxUnavailable + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + InstanceGroupManagerUpdatePolicy.prototype.maxUnavailable = null; + + /** + * InstanceGroupManagerUpdatePolicy minimalAction. + * @member {string|null|undefined} minimalAction + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + InstanceGroupManagerUpdatePolicy.prototype.minimalAction = null; + + /** + * InstanceGroupManagerUpdatePolicy replacementMethod. + * @member {string|null|undefined} replacementMethod + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + InstanceGroupManagerUpdatePolicy.prototype.replacementMethod = null; + + /** + * InstanceGroupManagerUpdatePolicy type. + * @member {string|null|undefined} type + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + InstanceGroupManagerUpdatePolicy.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerUpdatePolicy _instanceRedistributionType. + * @member {"instanceRedistributionType"|undefined} _instanceRedistributionType + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerUpdatePolicy.prototype, "_instanceRedistributionType", { + get: $util.oneOfGetter($oneOfFields = ["instanceRedistributionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerUpdatePolicy _maxSurge. + * @member {"maxSurge"|undefined} _maxSurge + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerUpdatePolicy.prototype, "_maxSurge", { + get: $util.oneOfGetter($oneOfFields = ["maxSurge"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerUpdatePolicy _maxUnavailable. + * @member {"maxUnavailable"|undefined} _maxUnavailable + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerUpdatePolicy.prototype, "_maxUnavailable", { + get: $util.oneOfGetter($oneOfFields = ["maxUnavailable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerUpdatePolicy _minimalAction. + * @member {"minimalAction"|undefined} _minimalAction + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerUpdatePolicy.prototype, "_minimalAction", { + get: $util.oneOfGetter($oneOfFields = ["minimalAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerUpdatePolicy _replacementMethod. + * @member {"replacementMethod"|undefined} _replacementMethod + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerUpdatePolicy.prototype, "_replacementMethod", { + get: $util.oneOfGetter($oneOfFields = ["replacementMethod"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerUpdatePolicy _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + */ + Object.defineProperty(InstanceGroupManagerUpdatePolicy.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerUpdatePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy} InstanceGroupManagerUpdatePolicy instance + */ + InstanceGroupManagerUpdatePolicy.create = function create(properties) { + return new InstanceGroupManagerUpdatePolicy(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerUpdatePolicy message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy} message InstanceGroupManagerUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerUpdatePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 2 =*/28604882).string(message.type); + if (message.minimalAction != null && Object.hasOwnProperty.call(message, "minimalAction")) + writer.uint32(/* id 270567060, wireType 2 =*/2164536482).string(message.minimalAction); + if (message.instanceRedistributionType != null && Object.hasOwnProperty.call(message, "instanceRedistributionType")) + writer.uint32(/* id 292630424, wireType 2 =*/2341043394).string(message.instanceRedistributionType); + if (message.maxSurge != null && Object.hasOwnProperty.call(message, "maxSurge")) + $root.google.cloud.compute.v1.FixedOrPercent.encode(message.maxSurge, writer.uint32(/* id 302572691, wireType 2 =*/2420581530).fork()).ldelim(); + if (message.maxUnavailable != null && Object.hasOwnProperty.call(message, "maxUnavailable")) + $root.google.cloud.compute.v1.FixedOrPercent.encode(message.maxUnavailable, writer.uint32(/* id 404940277, wireType 2 =*/3239522218).fork()).ldelim(); + if (message.replacementMethod != null && Object.hasOwnProperty.call(message, "replacementMethod")) + writer.uint32(/* id 505931694, wireType 2 =*/4047453554).string(message.replacementMethod); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerUpdatePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy} message InstanceGroupManagerUpdatePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerUpdatePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerUpdatePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy} InstanceGroupManagerUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerUpdatePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 292630424: + message.instanceRedistributionType = reader.string(); + break; + case 302572691: + message.maxSurge = $root.google.cloud.compute.v1.FixedOrPercent.decode(reader, reader.uint32()); + break; + case 404940277: + message.maxUnavailable = $root.google.cloud.compute.v1.FixedOrPercent.decode(reader, reader.uint32()); + break; + case 270567060: + message.minimalAction = reader.string(); + break; + case 505931694: + message.replacementMethod = reader.string(); + break; + case 3575610: + message.type = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerUpdatePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy} InstanceGroupManagerUpdatePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerUpdatePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerUpdatePolicy message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerUpdatePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceRedistributionType != null && message.hasOwnProperty("instanceRedistributionType")) { + properties._instanceRedistributionType = 1; + if (!$util.isString(message.instanceRedistributionType)) + return "instanceRedistributionType: string expected"; + } + if (message.maxSurge != null && message.hasOwnProperty("maxSurge")) { + properties._maxSurge = 1; + { + var error = $root.google.cloud.compute.v1.FixedOrPercent.verify(message.maxSurge); + if (error) + return "maxSurge." + error; + } + } + if (message.maxUnavailable != null && message.hasOwnProperty("maxUnavailable")) { + properties._maxUnavailable = 1; + { + var error = $root.google.cloud.compute.v1.FixedOrPercent.verify(message.maxUnavailable); + if (error) + return "maxUnavailable." + error; + } + } + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + properties._minimalAction = 1; + if (!$util.isString(message.minimalAction)) + return "minimalAction: string expected"; + } + if (message.replacementMethod != null && message.hasOwnProperty("replacementMethod")) { + properties._replacementMethod = 1; + if (!$util.isString(message.replacementMethod)) + return "replacementMethod: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + if (!$util.isString(message.type)) + return "type: string expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagerUpdatePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy} InstanceGroupManagerUpdatePolicy + */ + InstanceGroupManagerUpdatePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy(); + if (object.instanceRedistributionType != null) + message.instanceRedistributionType = String(object.instanceRedistributionType); + if (object.maxSurge != null) { + if (typeof object.maxSurge !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.maxSurge: object expected"); + message.maxSurge = $root.google.cloud.compute.v1.FixedOrPercent.fromObject(object.maxSurge); + } + if (object.maxUnavailable != null) { + if (typeof object.maxUnavailable !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.maxUnavailable: object expected"); + message.maxUnavailable = $root.google.cloud.compute.v1.FixedOrPercent.fromObject(object.maxUnavailable); + } + if (object.minimalAction != null) + message.minimalAction = String(object.minimalAction); + if (object.replacementMethod != null) + message.replacementMethod = String(object.replacementMethod); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerUpdatePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy} message InstanceGroupManagerUpdatePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerUpdatePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + object.minimalAction = message.minimalAction; + if (options.oneofs) + object._minimalAction = "minimalAction"; + } + if (message.instanceRedistributionType != null && message.hasOwnProperty("instanceRedistributionType")) { + object.instanceRedistributionType = message.instanceRedistributionType; + if (options.oneofs) + object._instanceRedistributionType = "instanceRedistributionType"; + } + if (message.maxSurge != null && message.hasOwnProperty("maxSurge")) { + object.maxSurge = $root.google.cloud.compute.v1.FixedOrPercent.toObject(message.maxSurge, options); + if (options.oneofs) + object._maxSurge = "maxSurge"; + } + if (message.maxUnavailable != null && message.hasOwnProperty("maxUnavailable")) { + object.maxUnavailable = $root.google.cloud.compute.v1.FixedOrPercent.toObject(message.maxUnavailable, options); + if (options.oneofs) + object._maxUnavailable = "maxUnavailable"; + } + if (message.replacementMethod != null && message.hasOwnProperty("replacementMethod")) { + object.replacementMethod = message.replacementMethod; + if (options.oneofs) + object._replacementMethod = "replacementMethod"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerUpdatePolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerUpdatePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerUpdatePolicy; + })(); + + v1.InstanceGroupManagerVersion = (function() { + + /** + * Properties of an InstanceGroupManagerVersion. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerVersion + * @property {string|null} [instanceTemplate] InstanceGroupManagerVersion instanceTemplate + * @property {string|null} [name] InstanceGroupManagerVersion name + * @property {google.cloud.compute.v1.IFixedOrPercent|null} [targetSize] InstanceGroupManagerVersion targetSize + */ + + /** + * Constructs a new InstanceGroupManagerVersion. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerVersion. + * @implements IInstanceGroupManagerVersion + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerVersion=} [properties] Properties to set + */ + function InstanceGroupManagerVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerVersion instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @instance + */ + InstanceGroupManagerVersion.prototype.instanceTemplate = null; + + /** + * InstanceGroupManagerVersion name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @instance + */ + InstanceGroupManagerVersion.prototype.name = null; + + /** + * InstanceGroupManagerVersion targetSize. + * @member {google.cloud.compute.v1.IFixedOrPercent|null|undefined} targetSize + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @instance + */ + InstanceGroupManagerVersion.prototype.targetSize = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerVersion _instanceTemplate. + * @member {"instanceTemplate"|undefined} _instanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @instance + */ + Object.defineProperty(InstanceGroupManagerVersion.prototype, "_instanceTemplate", { + get: $util.oneOfGetter($oneOfFields = ["instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerVersion _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @instance + */ + Object.defineProperty(InstanceGroupManagerVersion.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerVersion _targetSize. + * @member {"targetSize"|undefined} _targetSize + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @instance + */ + Object.defineProperty(InstanceGroupManagerVersion.prototype, "_targetSize", { + get: $util.oneOfGetter($oneOfFields = ["targetSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerVersion instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerVersion=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerVersion} InstanceGroupManagerVersion instance + */ + InstanceGroupManagerVersion.create = function create(properties) { + return new InstanceGroupManagerVersion(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerVersion message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerVersion} message InstanceGroupManagerVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.targetSize != null && Object.hasOwnProperty.call(message, "targetSize")) + $root.google.cloud.compute.v1.FixedOrPercent.encode(message.targetSize, writer.uint32(/* id 62880239, wireType 2 =*/503041914).fork()).ldelim(); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 309248228, wireType 2 =*/2473985826).string(message.instanceTemplate); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerVersion message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerVersion} message InstanceGroupManagerVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerVersion} InstanceGroupManagerVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 309248228: + message.instanceTemplate = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 62880239: + message.targetSize = $root.google.cloud.compute.v1.FixedOrPercent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerVersion} InstanceGroupManagerVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerVersion message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + properties._instanceTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.targetSize != null && message.hasOwnProperty("targetSize")) { + properties._targetSize = 1; + { + var error = $root.google.cloud.compute.v1.FixedOrPercent.verify(message.targetSize); + if (error) + return "targetSize." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagerVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerVersion} InstanceGroupManagerVersion + */ + InstanceGroupManagerVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerVersion) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerVersion(); + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.name != null) + message.name = String(object.name); + if (object.targetSize != null) { + if (typeof object.targetSize !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerVersion.targetSize: object expected"); + message.targetSize = $root.google.cloud.compute.v1.FixedOrPercent.fromObject(object.targetSize); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerVersion} message InstanceGroupManagerVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.targetSize != null && message.hasOwnProperty("targetSize")) { + object.targetSize = $root.google.cloud.compute.v1.FixedOrPercent.toObject(message.targetSize, options); + if (options.oneofs) + object._targetSize = "targetSize"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object._instanceTemplate = "instanceTemplate"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerVersion to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerVersion + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerVersion; + })(); + + v1.InstanceGroupManager = (function() { + + /** + * Properties of an InstanceGroupManager. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManager + * @property {Array.|null} [autoHealingPolicies] InstanceGroupManager autoHealingPolicies + * @property {string|null} [baseInstanceName] InstanceGroupManager baseInstanceName + * @property {string|null} [creationTimestamp] InstanceGroupManager creationTimestamp + * @property {google.cloud.compute.v1.IInstanceGroupManagerActionsSummary|null} [currentActions] InstanceGroupManager currentActions + * @property {string|null} [description] InstanceGroupManager description + * @property {google.cloud.compute.v1.IDistributionPolicy|null} [distributionPolicy] InstanceGroupManager distributionPolicy + * @property {string|null} [fingerprint] InstanceGroupManager fingerprint + * @property {number|Long|null} [id] InstanceGroupManager id + * @property {string|null} [instanceGroup] InstanceGroupManager instanceGroup + * @property {string|null} [instanceTemplate] InstanceGroupManager instanceTemplate + * @property {string|null} [kind] InstanceGroupManager kind + * @property {string|null} [name] InstanceGroupManager name + * @property {Array.|null} [namedPorts] InstanceGroupManager namedPorts + * @property {string|null} [region] InstanceGroupManager region + * @property {string|null} [selfLink] InstanceGroupManager selfLink + * @property {google.cloud.compute.v1.IStatefulPolicy|null} [statefulPolicy] InstanceGroupManager statefulPolicy + * @property {google.cloud.compute.v1.IInstanceGroupManagerStatus|null} [status] InstanceGroupManager status + * @property {Array.|null} [targetPools] InstanceGroupManager targetPools + * @property {number|null} [targetSize] InstanceGroupManager targetSize + * @property {google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy|null} [updatePolicy] InstanceGroupManager updatePolicy + * @property {Array.|null} [versions] InstanceGroupManager versions + * @property {string|null} [zone] InstanceGroupManager zone + */ + + /** + * Constructs a new InstanceGroupManager. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManager. + * @implements IInstanceGroupManager + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManager=} [properties] Properties to set + */ + function InstanceGroupManager(properties) { + this.autoHealingPolicies = []; + this.namedPorts = []; + this.targetPools = []; + this.versions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManager autoHealingPolicies. + * @member {Array.} autoHealingPolicies + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.autoHealingPolicies = $util.emptyArray; + + /** + * InstanceGroupManager baseInstanceName. + * @member {string|null|undefined} baseInstanceName + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.baseInstanceName = null; + + /** + * InstanceGroupManager creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.creationTimestamp = null; + + /** + * InstanceGroupManager currentActions. + * @member {google.cloud.compute.v1.IInstanceGroupManagerActionsSummary|null|undefined} currentActions + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.currentActions = null; + + /** + * InstanceGroupManager description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.description = null; + + /** + * InstanceGroupManager distributionPolicy. + * @member {google.cloud.compute.v1.IDistributionPolicy|null|undefined} distributionPolicy + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.distributionPolicy = null; + + /** + * InstanceGroupManager fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.fingerprint = null; + + /** + * InstanceGroupManager id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.id = null; + + /** + * InstanceGroupManager instanceGroup. + * @member {string|null|undefined} instanceGroup + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.instanceGroup = null; + + /** + * InstanceGroupManager instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.instanceTemplate = null; + + /** + * InstanceGroupManager kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.kind = null; + + /** + * InstanceGroupManager name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.name = null; + + /** + * InstanceGroupManager namedPorts. + * @member {Array.} namedPorts + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.namedPorts = $util.emptyArray; + + /** + * InstanceGroupManager region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.region = null; + + /** + * InstanceGroupManager selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.selfLink = null; + + /** + * InstanceGroupManager statefulPolicy. + * @member {google.cloud.compute.v1.IStatefulPolicy|null|undefined} statefulPolicy + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.statefulPolicy = null; + + /** + * InstanceGroupManager status. + * @member {google.cloud.compute.v1.IInstanceGroupManagerStatus|null|undefined} status + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.status = null; + + /** + * InstanceGroupManager targetPools. + * @member {Array.} targetPools + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.targetPools = $util.emptyArray; + + /** + * InstanceGroupManager targetSize. + * @member {number|null|undefined} targetSize + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.targetSize = null; + + /** + * InstanceGroupManager updatePolicy. + * @member {google.cloud.compute.v1.IInstanceGroupManagerUpdatePolicy|null|undefined} updatePolicy + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.updatePolicy = null; + + /** + * InstanceGroupManager versions. + * @member {Array.} versions + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.versions = $util.emptyArray; + + /** + * InstanceGroupManager zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + InstanceGroupManager.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManager _baseInstanceName. + * @member {"baseInstanceName"|undefined} _baseInstanceName + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_baseInstanceName", { + get: $util.oneOfGetter($oneOfFields = ["baseInstanceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _currentActions. + * @member {"currentActions"|undefined} _currentActions + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_currentActions", { + get: $util.oneOfGetter($oneOfFields = ["currentActions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _distributionPolicy. + * @member {"distributionPolicy"|undefined} _distributionPolicy + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_distributionPolicy", { + get: $util.oneOfGetter($oneOfFields = ["distributionPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _instanceGroup. + * @member {"instanceGroup"|undefined} _instanceGroup + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_instanceGroup", { + get: $util.oneOfGetter($oneOfFields = ["instanceGroup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _instanceTemplate. + * @member {"instanceTemplate"|undefined} _instanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_instanceTemplate", { + get: $util.oneOfGetter($oneOfFields = ["instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _statefulPolicy. + * @member {"statefulPolicy"|undefined} _statefulPolicy + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_statefulPolicy", { + get: $util.oneOfGetter($oneOfFields = ["statefulPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _targetSize. + * @member {"targetSize"|undefined} _targetSize + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_targetSize", { + get: $util.oneOfGetter($oneOfFields = ["targetSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _updatePolicy. + * @member {"updatePolicy"|undefined} _updatePolicy + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_updatePolicy", { + get: $util.oneOfGetter($oneOfFields = ["updatePolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManager _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + */ + Object.defineProperty(InstanceGroupManager.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManager instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManager=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManager} InstanceGroupManager instance + */ + InstanceGroupManager.create = function create(properties) { + return new InstanceGroupManager(properties); + }; + + /** + * Encodes the specified InstanceGroupManager message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManager.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManager} message InstanceGroupManager message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManager.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.statefulPolicy != null && Object.hasOwnProperty.call(message, "statefulPolicy")) + $root.google.cloud.compute.v1.StatefulPolicy.encode(message.statefulPolicy, writer.uint32(/* id 47538565, wireType 2 =*/380308522).fork()).ldelim(); + if (message.targetSize != null && Object.hasOwnProperty.call(message, "targetSize")) + writer.uint32(/* id 62880239, wireType 0 =*/503041912).int32(message.targetSize); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.versions != null && message.versions.length) + for (var i = 0; i < message.versions.length; ++i) + $root.google.cloud.compute.v1.InstanceGroupManagerVersion.encode(message.versions[i], writer.uint32(/* id 162430619, wireType 2 =*/1299444954).fork()).ldelim(); + if (message.currentActions != null && Object.hasOwnProperty.call(message, "currentActions")) + $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary.encode(message.currentActions, writer.uint32(/* id 164045879, wireType 2 =*/1312367034).fork()).ldelim(); + if (message.updatePolicy != null && Object.hasOwnProperty.call(message, "updatePolicy")) + $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.encode(message.updatePolicy, writer.uint32(/* id 175809896, wireType 2 =*/1406479170).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.compute.v1.InstanceGroupManagerStatus.encode(message.status, writer.uint32(/* id 181260274, wireType 2 =*/1450082194).fork()).ldelim(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 309248228, wireType 2 =*/2473985826).string(message.instanceTemplate); + if (message.targetPools != null && message.targetPools.length) + for (var i = 0; i < message.targetPools.length; ++i) + writer.uint32(/* id 336072617, wireType 2 =*/2688580938).string(message.targetPools[i]); + if (message.baseInstanceName != null && Object.hasOwnProperty.call(message, "baseInstanceName")) + writer.uint32(/* id 389106439, wireType 2 =*/3112851514).string(message.baseInstanceName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.namedPorts != null && message.namedPorts.length) + for (var i = 0; i < message.namedPorts.length; ++i) + $root.google.cloud.compute.v1.NamedPort.encode(message.namedPorts[i], writer.uint32(/* id 427598732, wireType 2 =*/3420789858).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.autoHealingPolicies != null && message.autoHealingPolicies.length) + for (var i = 0; i < message.autoHealingPolicies.length; ++i) + $root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.encode(message.autoHealingPolicies[i], writer.uint32(/* id 456799109, wireType 2 =*/3654392874).fork()).ldelim(); + if (message.distributionPolicy != null && Object.hasOwnProperty.call(message, "distributionPolicy")) + $root.google.cloud.compute.v1.DistributionPolicy.encode(message.distributionPolicy, writer.uint32(/* id 534558541, wireType 2 =*/4276468330).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManager message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManager.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManager} message InstanceGroupManager message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManager.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManager message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManager} InstanceGroupManager + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManager.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManager(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 456799109: + if (!(message.autoHealingPolicies && message.autoHealingPolicies.length)) + message.autoHealingPolicies = []; + message.autoHealingPolicies.push($root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.decode(reader, reader.uint32())); + break; + case 389106439: + message.baseInstanceName = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 164045879: + message.currentActions = $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 534558541: + message.distributionPolicy = $root.google.cloud.compute.v1.DistributionPolicy.decode(reader, reader.uint32()); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 81095253: + message.instanceGroup = reader.string(); + break; + case 309248228: + message.instanceTemplate = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 427598732: + if (!(message.namedPorts && message.namedPorts.length)) + message.namedPorts = []; + message.namedPorts.push($root.google.cloud.compute.v1.NamedPort.decode(reader, reader.uint32())); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 47538565: + message.statefulPolicy = $root.google.cloud.compute.v1.StatefulPolicy.decode(reader, reader.uint32()); + break; + case 181260274: + message.status = $root.google.cloud.compute.v1.InstanceGroupManagerStatus.decode(reader, reader.uint32()); + break; + case 336072617: + if (!(message.targetPools && message.targetPools.length)) + message.targetPools = []; + message.targetPools.push(reader.string()); + break; + case 62880239: + message.targetSize = reader.int32(); + break; + case 175809896: + message.updatePolicy = $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.decode(reader, reader.uint32()); + break; + case 162430619: + if (!(message.versions && message.versions.length)) + message.versions = []; + message.versions.push($root.google.cloud.compute.v1.InstanceGroupManagerVersion.decode(reader, reader.uint32())); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManager message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManager} InstanceGroupManager + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManager.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManager message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManager.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoHealingPolicies != null && message.hasOwnProperty("autoHealingPolicies")) { + if (!Array.isArray(message.autoHealingPolicies)) + return "autoHealingPolicies: array expected"; + for (var i = 0; i < message.autoHealingPolicies.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.verify(message.autoHealingPolicies[i]); + if (error) + return "autoHealingPolicies." + error; + } + } + if (message.baseInstanceName != null && message.hasOwnProperty("baseInstanceName")) { + properties._baseInstanceName = 1; + if (!$util.isString(message.baseInstanceName)) + return "baseInstanceName: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.currentActions != null && message.hasOwnProperty("currentActions")) { + properties._currentActions = 1; + { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary.verify(message.currentActions); + if (error) + return "currentActions." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.distributionPolicy != null && message.hasOwnProperty("distributionPolicy")) { + properties._distributionPolicy = 1; + { + var error = $root.google.cloud.compute.v1.DistributionPolicy.verify(message.distributionPolicy); + if (error) + return "distributionPolicy." + error; + } + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) { + properties._instanceGroup = 1; + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + properties._instanceTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.namedPorts != null && message.hasOwnProperty("namedPorts")) { + if (!Array.isArray(message.namedPorts)) + return "namedPorts: array expected"; + for (var i = 0; i < message.namedPorts.length; ++i) { + var error = $root.google.cloud.compute.v1.NamedPort.verify(message.namedPorts[i]); + if (error) + return "namedPorts." + error; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.statefulPolicy != null && message.hasOwnProperty("statefulPolicy")) { + properties._statefulPolicy = 1; + { + var error = $root.google.cloud.compute.v1.StatefulPolicy.verify(message.statefulPolicy); + if (error) + return "statefulPolicy." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerStatus.verify(message.status); + if (error) + return "status." + error; + } + } + if (message.targetPools != null && message.hasOwnProperty("targetPools")) { + if (!Array.isArray(message.targetPools)) + return "targetPools: array expected"; + for (var i = 0; i < message.targetPools.length; ++i) + if (!$util.isString(message.targetPools[i])) + return "targetPools: string[] expected"; + } + if (message.targetSize != null && message.hasOwnProperty("targetSize")) { + properties._targetSize = 1; + if (!$util.isInteger(message.targetSize)) + return "targetSize: integer expected"; + } + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { + properties._updatePolicy = 1; + { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.verify(message.updatePolicy); + if (error) + return "updatePolicy." + error; + } + } + if (message.versions != null && message.hasOwnProperty("versions")) { + if (!Array.isArray(message.versions)) + return "versions: array expected"; + for (var i = 0; i < message.versions.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerVersion.verify(message.versions[i]); + if (error) + return "versions." + error; + } + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManager message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManager} InstanceGroupManager + */ + InstanceGroupManager.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManager) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManager(); + if (object.autoHealingPolicies) { + if (!Array.isArray(object.autoHealingPolicies)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.autoHealingPolicies: array expected"); + message.autoHealingPolicies = []; + for (var i = 0; i < object.autoHealingPolicies.length; ++i) { + if (typeof object.autoHealingPolicies[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.autoHealingPolicies: object expected"); + message.autoHealingPolicies[i] = $root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.fromObject(object.autoHealingPolicies[i]); + } + } + if (object.baseInstanceName != null) + message.baseInstanceName = String(object.baseInstanceName); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.currentActions != null) { + if (typeof object.currentActions !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.currentActions: object expected"); + message.currentActions = $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary.fromObject(object.currentActions); + } + if (object.description != null) + message.description = String(object.description); + if (object.distributionPolicy != null) { + if (typeof object.distributionPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.distributionPolicy: object expected"); + message.distributionPolicy = $root.google.cloud.compute.v1.DistributionPolicy.fromObject(object.distributionPolicy); + } + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.namedPorts) { + if (!Array.isArray(object.namedPorts)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.namedPorts: array expected"); + message.namedPorts = []; + for (var i = 0; i < object.namedPorts.length; ++i) { + if (typeof object.namedPorts[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.namedPorts: object expected"); + message.namedPorts[i] = $root.google.cloud.compute.v1.NamedPort.fromObject(object.namedPorts[i]); + } + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.statefulPolicy != null) { + if (typeof object.statefulPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.statefulPolicy: object expected"); + message.statefulPolicy = $root.google.cloud.compute.v1.StatefulPolicy.fromObject(object.statefulPolicy); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.status: object expected"); + message.status = $root.google.cloud.compute.v1.InstanceGroupManagerStatus.fromObject(object.status); + } + if (object.targetPools) { + if (!Array.isArray(object.targetPools)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.targetPools: array expected"); + message.targetPools = []; + for (var i = 0; i < object.targetPools.length; ++i) + message.targetPools[i] = String(object.targetPools[i]); + } + if (object.targetSize != null) + message.targetSize = object.targetSize | 0; + if (object.updatePolicy != null) { + if (typeof object.updatePolicy !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.updatePolicy: object expected"); + message.updatePolicy = $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.fromObject(object.updatePolicy); + } + if (object.versions) { + if (!Array.isArray(object.versions)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.versions: array expected"); + message.versions = []; + for (var i = 0; i < object.versions.length; ++i) { + if (typeof object.versions[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManager.versions: object expected"); + message.versions[i] = $root.google.cloud.compute.v1.InstanceGroupManagerVersion.fromObject(object.versions[i]); + } + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManager message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @static + * @param {google.cloud.compute.v1.InstanceGroupManager} message InstanceGroupManager + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManager.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.versions = []; + object.targetPools = []; + object.namedPorts = []; + object.autoHealingPolicies = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.statefulPolicy != null && message.hasOwnProperty("statefulPolicy")) { + object.statefulPolicy = $root.google.cloud.compute.v1.StatefulPolicy.toObject(message.statefulPolicy, options); + if (options.oneofs) + object._statefulPolicy = "statefulPolicy"; + } + if (message.targetSize != null && message.hasOwnProperty("targetSize")) { + object.targetSize = message.targetSize; + if (options.oneofs) + object._targetSize = "targetSize"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) { + object.instanceGroup = message.instanceGroup; + if (options.oneofs) + object._instanceGroup = "instanceGroup"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.versions && message.versions.length) { + object.versions = []; + for (var j = 0; j < message.versions.length; ++j) + object.versions[j] = $root.google.cloud.compute.v1.InstanceGroupManagerVersion.toObject(message.versions[j], options); + } + if (message.currentActions != null && message.hasOwnProperty("currentActions")) { + object.currentActions = $root.google.cloud.compute.v1.InstanceGroupManagerActionsSummary.toObject(message.currentActions, options); + if (options.oneofs) + object._currentActions = "currentActions"; + } + if (message.updatePolicy != null && message.hasOwnProperty("updatePolicy")) { + object.updatePolicy = $root.google.cloud.compute.v1.InstanceGroupManagerUpdatePolicy.toObject(message.updatePolicy, options); + if (options.oneofs) + object._updatePolicy = "updatePolicy"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = $root.google.cloud.compute.v1.InstanceGroupManagerStatus.toObject(message.status, options); + if (options.oneofs) + object._status = "status"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object._instanceTemplate = "instanceTemplate"; + } + if (message.targetPools && message.targetPools.length) { + object.targetPools = []; + for (var j = 0; j < message.targetPools.length; ++j) + object.targetPools[j] = message.targetPools[j]; + } + if (message.baseInstanceName != null && message.hasOwnProperty("baseInstanceName")) { + object.baseInstanceName = message.baseInstanceName; + if (options.oneofs) + object._baseInstanceName = "baseInstanceName"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.namedPorts && message.namedPorts.length) { + object.namedPorts = []; + for (var j = 0; j < message.namedPorts.length; ++j) + object.namedPorts[j] = $root.google.cloud.compute.v1.NamedPort.toObject(message.namedPorts[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.autoHealingPolicies && message.autoHealingPolicies.length) { + object.autoHealingPolicies = []; + for (var j = 0; j < message.autoHealingPolicies.length; ++j) + object.autoHealingPolicies[j] = $root.google.cloud.compute.v1.InstanceGroupManagerAutoHealingPolicy.toObject(message.autoHealingPolicies[j], options); + } + if (message.distributionPolicy != null && message.hasOwnProperty("distributionPolicy")) { + object.distributionPolicy = $root.google.cloud.compute.v1.DistributionPolicy.toObject(message.distributionPolicy, options); + if (options.oneofs) + object._distributionPolicy = "distributionPolicy"; + } + return object; + }; + + /** + * Converts this InstanceGroupManager to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManager + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManager.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManager; + })(); + + v1.InstanceGroupManagersScopedList = (function() { + + /** + * Properties of an InstanceGroupManagersScopedList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersScopedList + * @property {Array.|null} [instanceGroupManagers] InstanceGroupManagersScopedList instanceGroupManagers + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupManagersScopedList warning + */ + + /** + * Constructs a new InstanceGroupManagersScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersScopedList. + * @implements IInstanceGroupManagersScopedList + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersScopedList=} [properties] Properties to set + */ + function InstanceGroupManagersScopedList(properties) { + this.instanceGroupManagers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersScopedList instanceGroupManagers. + * @member {Array.} instanceGroupManagers + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @instance + */ + InstanceGroupManagersScopedList.prototype.instanceGroupManagers = $util.emptyArray; + + /** + * InstanceGroupManagersScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @instance + */ + InstanceGroupManagersScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagersScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @instance + */ + Object.defineProperty(InstanceGroupManagersScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagersScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersScopedList} InstanceGroupManagersScopedList instance + */ + InstanceGroupManagersScopedList.create = function create(properties) { + return new InstanceGroupManagersScopedList(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersScopedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersScopedList} message InstanceGroupManagersScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.instanceGroupManagers != null && message.instanceGroupManagers.length) + for (var i = 0; i < message.instanceGroupManagers.length; ++i) + $root.google.cloud.compute.v1.InstanceGroupManager.encode(message.instanceGroupManagers[i], writer.uint32(/* id 214072592, wireType 2 =*/1712580738).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersScopedList} message InstanceGroupManagersScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersScopedList} InstanceGroupManagersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 214072592: + if (!(message.instanceGroupManagers && message.instanceGroupManagers.length)) + message.instanceGroupManagers = []; + message.instanceGroupManagers.push($root.google.cloud.compute.v1.InstanceGroupManager.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersScopedList} InstanceGroupManagersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManagers != null && message.hasOwnProperty("instanceGroupManagers")) { + if (!Array.isArray(message.instanceGroupManagers)) + return "instanceGroupManagers: array expected"; + for (var i = 0; i < message.instanceGroupManagers.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroupManager.verify(message.instanceGroupManagers[i]); + if (error) + return "instanceGroupManagers." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagersScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersScopedList} InstanceGroupManagersScopedList + */ + InstanceGroupManagersScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersScopedList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersScopedList(); + if (object.instanceGroupManagers) { + if (!Array.isArray(object.instanceGroupManagers)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersScopedList.instanceGroupManagers: array expected"); + message.instanceGroupManagers = []; + for (var i = 0; i < object.instanceGroupManagers.length; ++i) { + if (typeof object.instanceGroupManagers[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersScopedList.instanceGroupManagers: object expected"); + message.instanceGroupManagers[i] = $root.google.cloud.compute.v1.InstanceGroupManager.fromObject(object.instanceGroupManagers[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersScopedList} message InstanceGroupManagersScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceGroupManagers = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.instanceGroupManagers && message.instanceGroupManagers.length) { + object.instanceGroupManagers = []; + for (var j = 0; j < message.instanceGroupManagers.length; ++j) + object.instanceGroupManagers[j] = $root.google.cloud.compute.v1.InstanceGroupManager.toObject(message.instanceGroupManagers[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupManagersScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersScopedList + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersScopedList; + })(); + + v1.InstanceGroupManagerAggregatedList = (function() { + + /** + * Properties of an InstanceGroupManagerAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerAggregatedList + * @property {string|null} [id] InstanceGroupManagerAggregatedList id + * @property {Object.|null} [items] InstanceGroupManagerAggregatedList items + * @property {string|null} [kind] InstanceGroupManagerAggregatedList kind + * @property {string|null} [nextPageToken] InstanceGroupManagerAggregatedList nextPageToken + * @property {string|null} [selfLink] InstanceGroupManagerAggregatedList selfLink + * @property {Array.|null} [unreachables] InstanceGroupManagerAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupManagerAggregatedList warning + */ + + /** + * Constructs a new InstanceGroupManagerAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerAggregatedList. + * @implements IInstanceGroupManagerAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerAggregatedList=} [properties] Properties to set + */ + function InstanceGroupManagerAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + InstanceGroupManagerAggregatedList.prototype.id = null; + + /** + * InstanceGroupManagerAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + InstanceGroupManagerAggregatedList.prototype.items = $util.emptyObject; + + /** + * InstanceGroupManagerAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + InstanceGroupManagerAggregatedList.prototype.kind = null; + + /** + * InstanceGroupManagerAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + InstanceGroupManagerAggregatedList.prototype.nextPageToken = null; + + /** + * InstanceGroupManagerAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + InstanceGroupManagerAggregatedList.prototype.selfLink = null; + + /** + * InstanceGroupManagerAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + InstanceGroupManagerAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * InstanceGroupManagerAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + InstanceGroupManagerAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupManagerAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupManagerAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupManagerAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupManagerAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + */ + Object.defineProperty(InstanceGroupManagerAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerAggregatedList} InstanceGroupManagerAggregatedList instance + */ + InstanceGroupManagerAggregatedList.create = function create(properties) { + return new InstanceGroupManagerAggregatedList(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerAggregatedList} message InstanceGroupManagerAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.InstanceGroupManagersScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerAggregatedList} message InstanceGroupManagerAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerAggregatedList} InstanceGroupManagerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.InstanceGroupManagersScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerAggregatedList} InstanceGroupManagerAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagerAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerAggregatedList} InstanceGroupManagerAggregatedList + */ + InstanceGroupManagerAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.InstanceGroupManagersScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerAggregatedList} message InstanceGroupManagerAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.InstanceGroupManagersScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerAggregatedList + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerAggregatedList; + })(); + + v1.InstanceGroupManagerList = (function() { + + /** + * Properties of an InstanceGroupManagerList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerList + * @property {string|null} [id] InstanceGroupManagerList id + * @property {Array.|null} [items] InstanceGroupManagerList items + * @property {string|null} [kind] InstanceGroupManagerList kind + * @property {string|null} [nextPageToken] InstanceGroupManagerList nextPageToken + * @property {string|null} [selfLink] InstanceGroupManagerList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupManagerList warning + */ + + /** + * Constructs a new InstanceGroupManagerList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerList. + * @implements IInstanceGroupManagerList + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerList=} [properties] Properties to set + */ + function InstanceGroupManagerList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + InstanceGroupManagerList.prototype.id = null; + + /** + * InstanceGroupManagerList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + InstanceGroupManagerList.prototype.items = $util.emptyArray; + + /** + * InstanceGroupManagerList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + InstanceGroupManagerList.prototype.kind = null; + + /** + * InstanceGroupManagerList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + InstanceGroupManagerList.prototype.nextPageToken = null; + + /** + * InstanceGroupManagerList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + InstanceGroupManagerList.prototype.selfLink = null; + + /** + * InstanceGroupManagerList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + InstanceGroupManagerList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + Object.defineProperty(InstanceGroupManagerList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + Object.defineProperty(InstanceGroupManagerList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + Object.defineProperty(InstanceGroupManagerList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + Object.defineProperty(InstanceGroupManagerList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + */ + Object.defineProperty(InstanceGroupManagerList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerList} InstanceGroupManagerList instance + */ + InstanceGroupManagerList.create = function create(properties) { + return new InstanceGroupManagerList(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerList message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerList} message InstanceGroupManagerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceGroupManager.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerList} message InstanceGroupManagerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerList} InstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceGroupManager.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerList} InstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroupManager.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagerList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerList} InstanceGroupManagerList + */ + InstanceGroupManagerList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceGroupManager.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerList} message InstanceGroupManagerList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceGroupManager.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerList + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerList; + })(); + + v1.InstanceGroupManagerStatusStateful = (function() { + + /** + * Properties of an InstanceGroupManagerStatusStateful. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerStatusStateful + * @property {boolean|null} [hasStatefulConfig] InstanceGroupManagerStatusStateful hasStatefulConfig + * @property {google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs|null} [perInstanceConfigs] InstanceGroupManagerStatusStateful perInstanceConfigs + */ + + /** + * Constructs a new InstanceGroupManagerStatusStateful. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerStatusStateful. + * @implements IInstanceGroupManagerStatusStateful + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStateful=} [properties] Properties to set + */ + function InstanceGroupManagerStatusStateful(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerStatusStateful hasStatefulConfig. + * @member {boolean|null|undefined} hasStatefulConfig + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @instance + */ + InstanceGroupManagerStatusStateful.prototype.hasStatefulConfig = null; + + /** + * InstanceGroupManagerStatusStateful perInstanceConfigs. + * @member {google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs|null|undefined} perInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @instance + */ + InstanceGroupManagerStatusStateful.prototype.perInstanceConfigs = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerStatusStateful _hasStatefulConfig. + * @member {"hasStatefulConfig"|undefined} _hasStatefulConfig + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatusStateful.prototype, "_hasStatefulConfig", { + get: $util.oneOfGetter($oneOfFields = ["hasStatefulConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagerStatusStateful _perInstanceConfigs. + * @member {"perInstanceConfigs"|undefined} _perInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatusStateful.prototype, "_perInstanceConfigs", { + get: $util.oneOfGetter($oneOfFields = ["perInstanceConfigs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerStatusStateful instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStateful=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStateful} InstanceGroupManagerStatusStateful instance + */ + InstanceGroupManagerStatusStateful.create = function create(properties) { + return new InstanceGroupManagerStatusStateful(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerStatusStateful message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStateful.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStateful} message InstanceGroupManagerStatusStateful message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatusStateful.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hasStatefulConfig != null && Object.hasOwnProperty.call(message, "hasStatefulConfig")) + writer.uint32(/* id 110474224, wireType 0 =*/883793792).bool(message.hasStatefulConfig); + if (message.perInstanceConfigs != null && Object.hasOwnProperty.call(message, "perInstanceConfigs")) + $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.encode(message.perInstanceConfigs, writer.uint32(/* id 526265001, wireType 2 =*/4210120010).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerStatusStateful message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStateful.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStateful} message InstanceGroupManagerStatusStateful message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatusStateful.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerStatusStateful message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStateful} InstanceGroupManagerStatusStateful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatusStateful.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 110474224: + message.hasStatefulConfig = reader.bool(); + break; + case 526265001: + message.perInstanceConfigs = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerStatusStateful message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStateful} InstanceGroupManagerStatusStateful + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatusStateful.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerStatusStateful message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerStatusStateful.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.hasStatefulConfig != null && message.hasOwnProperty("hasStatefulConfig")) { + properties._hasStatefulConfig = 1; + if (typeof message.hasStatefulConfig !== "boolean") + return "hasStatefulConfig: boolean expected"; + } + if (message.perInstanceConfigs != null && message.hasOwnProperty("perInstanceConfigs")) { + properties._perInstanceConfigs = 1; + { + var error = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.verify(message.perInstanceConfigs); + if (error) + return "perInstanceConfigs." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagerStatusStateful message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStateful} InstanceGroupManagerStatusStateful + */ + InstanceGroupManagerStatusStateful.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatusStateful(); + if (object.hasStatefulConfig != null) + message.hasStatefulConfig = Boolean(object.hasStatefulConfig); + if (object.perInstanceConfigs != null) { + if (typeof object.perInstanceConfigs !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagerStatusStateful.perInstanceConfigs: object expected"); + message.perInstanceConfigs = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.fromObject(object.perInstanceConfigs); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerStatusStateful message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerStatusStateful} message InstanceGroupManagerStatusStateful + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerStatusStateful.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.hasStatefulConfig != null && message.hasOwnProperty("hasStatefulConfig")) { + object.hasStatefulConfig = message.hasStatefulConfig; + if (options.oneofs) + object._hasStatefulConfig = "hasStatefulConfig"; + } + if (message.perInstanceConfigs != null && message.hasOwnProperty("perInstanceConfigs")) { + object.perInstanceConfigs = $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.toObject(message.perInstanceConfigs, options); + if (options.oneofs) + object._perInstanceConfigs = "perInstanceConfigs"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerStatusStateful to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStateful + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerStatusStateful.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerStatusStateful; + })(); + + v1.InstanceGroupManagerStatusVersionTarget = (function() { + + /** + * Properties of an InstanceGroupManagerStatusVersionTarget. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerStatusVersionTarget + * @property {boolean|null} [isReached] InstanceGroupManagerStatusVersionTarget isReached + */ + + /** + * Constructs a new InstanceGroupManagerStatusVersionTarget. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerStatusVersionTarget. + * @implements IInstanceGroupManagerStatusVersionTarget + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget=} [properties] Properties to set + */ + function InstanceGroupManagerStatusVersionTarget(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerStatusVersionTarget isReached. + * @member {boolean|null|undefined} isReached + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @instance + */ + InstanceGroupManagerStatusVersionTarget.prototype.isReached = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerStatusVersionTarget _isReached. + * @member {"isReached"|undefined} _isReached + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatusVersionTarget.prototype, "_isReached", { + get: $util.oneOfGetter($oneOfFields = ["isReached"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerStatusVersionTarget instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget} InstanceGroupManagerStatusVersionTarget instance + */ + InstanceGroupManagerStatusVersionTarget.create = function create(properties) { + return new InstanceGroupManagerStatusVersionTarget(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerStatusVersionTarget message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget} message InstanceGroupManagerStatusVersionTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatusVersionTarget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isReached != null && Object.hasOwnProperty.call(message, "isReached")) + writer.uint32(/* id 433209149, wireType 0 =*/3465673192).bool(message.isReached); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerStatusVersionTarget message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusVersionTarget} message InstanceGroupManagerStatusVersionTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatusVersionTarget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerStatusVersionTarget message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget} InstanceGroupManagerStatusVersionTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatusVersionTarget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433209149: + message.isReached = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerStatusVersionTarget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget} InstanceGroupManagerStatusVersionTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatusVersionTarget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerStatusVersionTarget message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerStatusVersionTarget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.isReached != null && message.hasOwnProperty("isReached")) { + properties._isReached = 1; + if (typeof message.isReached !== "boolean") + return "isReached: boolean expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagerStatusVersionTarget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget} InstanceGroupManagerStatusVersionTarget + */ + InstanceGroupManagerStatusVersionTarget.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget(); + if (object.isReached != null) + message.isReached = Boolean(object.isReached); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerStatusVersionTarget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget} message InstanceGroupManagerStatusVersionTarget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerStatusVersionTarget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.isReached != null && message.hasOwnProperty("isReached")) { + object.isReached = message.isReached; + if (options.oneofs) + object._isReached = "isReached"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerStatusVersionTarget to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusVersionTarget + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerStatusVersionTarget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerStatusVersionTarget; + })(); + + v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs = (function() { + + /** + * Properties of an InstanceGroupManagerStatusStatefulPerInstanceConfigs. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagerStatusStatefulPerInstanceConfigs + * @property {boolean|null} [allEffective] InstanceGroupManagerStatusStatefulPerInstanceConfigs allEffective + */ + + /** + * Constructs a new InstanceGroupManagerStatusStatefulPerInstanceConfigs. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagerStatusStatefulPerInstanceConfigs. + * @implements IInstanceGroupManagerStatusStatefulPerInstanceConfigs + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs=} [properties] Properties to set + */ + function InstanceGroupManagerStatusStatefulPerInstanceConfigs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagerStatusStatefulPerInstanceConfigs allEffective. + * @member {boolean|null|undefined} allEffective + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @instance + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.prototype.allEffective = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagerStatusStatefulPerInstanceConfigs _allEffective. + * @member {"allEffective"|undefined} _allEffective + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @instance + */ + Object.defineProperty(InstanceGroupManagerStatusStatefulPerInstanceConfigs.prototype, "_allEffective", { + get: $util.oneOfGetter($oneOfFields = ["allEffective"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagerStatusStatefulPerInstanceConfigs instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs} InstanceGroupManagerStatusStatefulPerInstanceConfigs instance + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.create = function create(properties) { + return new InstanceGroupManagerStatusStatefulPerInstanceConfigs(properties); + }; + + /** + * Encodes the specified InstanceGroupManagerStatusStatefulPerInstanceConfigs message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs} message InstanceGroupManagerStatusStatefulPerInstanceConfigs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allEffective != null && Object.hasOwnProperty.call(message, "allEffective")) + writer.uint32(/* id 516540553, wireType 0 =*/4132324424).bool(message.allEffective); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagerStatusStatefulPerInstanceConfigs message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagerStatusStatefulPerInstanceConfigs} message InstanceGroupManagerStatusStatefulPerInstanceConfigs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagerStatusStatefulPerInstanceConfigs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs} InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 516540553: + message.allEffective = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagerStatusStatefulPerInstanceConfigs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs} InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagerStatusStatefulPerInstanceConfigs message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allEffective != null && message.hasOwnProperty("allEffective")) { + properties._allEffective = 1; + if (typeof message.allEffective !== "boolean") + return "allEffective: boolean expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagerStatusStatefulPerInstanceConfigs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs} InstanceGroupManagerStatusStatefulPerInstanceConfigs + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs(); + if (object.allEffective != null) + message.allEffective = Boolean(object.allEffective); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagerStatusStatefulPerInstanceConfigs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs} message InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.allEffective != null && message.hasOwnProperty("allEffective")) { + object.allEffective = message.allEffective; + if (options.oneofs) + object._allEffective = "allEffective"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagerStatusStatefulPerInstanceConfigs to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagerStatusStatefulPerInstanceConfigs + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagerStatusStatefulPerInstanceConfigs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagerStatusStatefulPerInstanceConfigs; + })(); + + v1.InstanceGroupManagersAbandonInstancesRequest = (function() { + + /** + * Properties of an InstanceGroupManagersAbandonInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersAbandonInstancesRequest + * @property {Array.|null} [instances] InstanceGroupManagersAbandonInstancesRequest instances + */ + + /** + * Constructs a new InstanceGroupManagersAbandonInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersAbandonInstancesRequest. + * @implements IInstanceGroupManagersAbandonInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest=} [properties] Properties to set + */ + function InstanceGroupManagersAbandonInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersAbandonInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @instance + */ + InstanceGroupManagersAbandonInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new InstanceGroupManagersAbandonInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest} InstanceGroupManagersAbandonInstancesRequest instance + */ + InstanceGroupManagersAbandonInstancesRequest.create = function create(properties) { + return new InstanceGroupManagersAbandonInstancesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersAbandonInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest} message InstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersAbandonInstancesRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersAbandonInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest} message InstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersAbandonInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest} InstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersAbandonInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest} InstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersAbandonInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersAbandonInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersAbandonInstancesRequest.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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersAbandonInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest} InstanceGroupManagersAbandonInstancesRequest + */ + InstanceGroupManagersAbandonInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersAbandonInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest} message InstanceGroupManagersAbandonInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersAbandonInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + return object; + }; + + /** + * Converts this InstanceGroupManagersAbandonInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersAbandonInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersAbandonInstancesRequest; + })(); + + v1.InstanceGroupManagersApplyUpdatesRequest = (function() { + + /** + * Properties of an InstanceGroupManagersApplyUpdatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersApplyUpdatesRequest + * @property {boolean|null} [allInstances] InstanceGroupManagersApplyUpdatesRequest allInstances + * @property {Array.|null} [instances] InstanceGroupManagersApplyUpdatesRequest instances + * @property {string|null} [minimalAction] InstanceGroupManagersApplyUpdatesRequest minimalAction + * @property {string|null} [mostDisruptiveAllowedAction] InstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction + */ + + /** + * Constructs a new InstanceGroupManagersApplyUpdatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersApplyUpdatesRequest. + * @implements IInstanceGroupManagersApplyUpdatesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest=} [properties] Properties to set + */ + function InstanceGroupManagersApplyUpdatesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersApplyUpdatesRequest allInstances. + * @member {boolean|null|undefined} allInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + */ + InstanceGroupManagersApplyUpdatesRequest.prototype.allInstances = null; + + /** + * InstanceGroupManagersApplyUpdatesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + */ + InstanceGroupManagersApplyUpdatesRequest.prototype.instances = $util.emptyArray; + + /** + * InstanceGroupManagersApplyUpdatesRequest minimalAction. + * @member {string|null|undefined} minimalAction + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + */ + InstanceGroupManagersApplyUpdatesRequest.prototype.minimalAction = null; + + /** + * InstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction. + * @member {string|null|undefined} mostDisruptiveAllowedAction + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + */ + InstanceGroupManagersApplyUpdatesRequest.prototype.mostDisruptiveAllowedAction = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagersApplyUpdatesRequest _allInstances. + * @member {"allInstances"|undefined} _allInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + */ + Object.defineProperty(InstanceGroupManagersApplyUpdatesRequest.prototype, "_allInstances", { + get: $util.oneOfGetter($oneOfFields = ["allInstances"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagersApplyUpdatesRequest _minimalAction. + * @member {"minimalAction"|undefined} _minimalAction + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + */ + Object.defineProperty(InstanceGroupManagersApplyUpdatesRequest.prototype, "_minimalAction", { + get: $util.oneOfGetter($oneOfFields = ["minimalAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagersApplyUpdatesRequest _mostDisruptiveAllowedAction. + * @member {"mostDisruptiveAllowedAction"|undefined} _mostDisruptiveAllowedAction + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + */ + Object.defineProperty(InstanceGroupManagersApplyUpdatesRequest.prototype, "_mostDisruptiveAllowedAction", { + get: $util.oneOfGetter($oneOfFields = ["mostDisruptiveAllowedAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagersApplyUpdatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest} InstanceGroupManagersApplyUpdatesRequest instance + */ + InstanceGroupManagersApplyUpdatesRequest.create = function create(properties) { + return new InstanceGroupManagersApplyUpdatesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersApplyUpdatesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest} message InstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersApplyUpdatesRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + if (message.mostDisruptiveAllowedAction != null && Object.hasOwnProperty.call(message, "mostDisruptiveAllowedAction")) + writer.uint32(/* id 66103053, wireType 2 =*/528824426).string(message.mostDisruptiveAllowedAction); + if (message.minimalAction != null && Object.hasOwnProperty.call(message, "minimalAction")) + writer.uint32(/* id 270567060, wireType 2 =*/2164536482).string(message.minimalAction); + if (message.allInstances != null && Object.hasOwnProperty.call(message, "allInstances")) + writer.uint32(/* id 403676512, wireType 0 =*/3229412096).bool(message.allInstances); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersApplyUpdatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest} message InstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersApplyUpdatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest} InstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersApplyUpdatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 403676512: + message.allInstances = reader.bool(); + break; + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + case 270567060: + message.minimalAction = reader.string(); + break; + case 66103053: + message.mostDisruptiveAllowedAction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest} InstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersApplyUpdatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersApplyUpdatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersApplyUpdatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allInstances != null && message.hasOwnProperty("allInstances")) { + properties._allInstances = 1; + if (typeof message.allInstances !== "boolean") + return "allInstances: boolean 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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + properties._minimalAction = 1; + if (!$util.isString(message.minimalAction)) + return "minimalAction: string expected"; + } + if (message.mostDisruptiveAllowedAction != null && message.hasOwnProperty("mostDisruptiveAllowedAction")) { + properties._mostDisruptiveAllowedAction = 1; + if (!$util.isString(message.mostDisruptiveAllowedAction)) + return "mostDisruptiveAllowedAction: string expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersApplyUpdatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest} InstanceGroupManagersApplyUpdatesRequest + */ + InstanceGroupManagersApplyUpdatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest(); + if (object.allInstances != null) + message.allInstances = Boolean(object.allInstances); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + if (object.minimalAction != null) + message.minimalAction = String(object.minimalAction); + if (object.mostDisruptiveAllowedAction != null) + message.mostDisruptiveAllowedAction = String(object.mostDisruptiveAllowedAction); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersApplyUpdatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest} message InstanceGroupManagersApplyUpdatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersApplyUpdatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + if (message.mostDisruptiveAllowedAction != null && message.hasOwnProperty("mostDisruptiveAllowedAction")) { + object.mostDisruptiveAllowedAction = message.mostDisruptiveAllowedAction; + if (options.oneofs) + object._mostDisruptiveAllowedAction = "mostDisruptiveAllowedAction"; + } + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + object.minimalAction = message.minimalAction; + if (options.oneofs) + object._minimalAction = "minimalAction"; + } + if (message.allInstances != null && message.hasOwnProperty("allInstances")) { + object.allInstances = message.allInstances; + if (options.oneofs) + object._allInstances = "allInstances"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagersApplyUpdatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersApplyUpdatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersApplyUpdatesRequest; + })(); + + v1.PerInstanceConfig = (function() { + + /** + * Properties of a PerInstanceConfig. + * @memberof google.cloud.compute.v1 + * @interface IPerInstanceConfig + * @property {string|null} [fingerprint] PerInstanceConfig fingerprint + * @property {string|null} [name] PerInstanceConfig name + * @property {google.cloud.compute.v1.IPreservedState|null} [preservedState] PerInstanceConfig preservedState + * @property {google.cloud.compute.v1.PerInstanceConfig.Status|null} [status] PerInstanceConfig status + */ + + /** + * Constructs a new PerInstanceConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PerInstanceConfig. + * @implements IPerInstanceConfig + * @constructor + * @param {google.cloud.compute.v1.IPerInstanceConfig=} [properties] Properties to set + */ + function PerInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PerInstanceConfig fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + PerInstanceConfig.prototype.fingerprint = null; + + /** + * PerInstanceConfig name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + PerInstanceConfig.prototype.name = null; + + /** + * PerInstanceConfig preservedState. + * @member {google.cloud.compute.v1.IPreservedState|null|undefined} preservedState + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + PerInstanceConfig.prototype.preservedState = null; + + /** + * PerInstanceConfig status. + * @member {google.cloud.compute.v1.PerInstanceConfig.Status|null|undefined} status + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + PerInstanceConfig.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PerInstanceConfig _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + Object.defineProperty(PerInstanceConfig.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PerInstanceConfig _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + Object.defineProperty(PerInstanceConfig.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PerInstanceConfig _preservedState. + * @member {"preservedState"|undefined} _preservedState + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + Object.defineProperty(PerInstanceConfig.prototype, "_preservedState", { + get: $util.oneOfGetter($oneOfFields = ["preservedState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PerInstanceConfig _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + */ + Object.defineProperty(PerInstanceConfig.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PerInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {google.cloud.compute.v1.IPerInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PerInstanceConfig} PerInstanceConfig instance + */ + PerInstanceConfig.create = function create(properties) { + return new PerInstanceConfig(properties); + }; + + /** + * Encodes the specified PerInstanceConfig message. Does not implicitly {@link google.cloud.compute.v1.PerInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {google.cloud.compute.v1.IPerInstanceConfig} message PerInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.preservedState != null && Object.hasOwnProperty.call(message, "preservedState")) + $root.google.cloud.compute.v1.PreservedState.encode(message.preservedState, writer.uint32(/* id 2634026, wireType 2 =*/21072210).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + return writer; + }; + + /** + * Encodes the specified PerInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PerInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {google.cloud.compute.v1.IPerInstanceConfig} message PerInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PerInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PerInstanceConfig} PerInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PerInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 234678500: + message.fingerprint = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 2634026: + message.preservedState = $root.google.cloud.compute.v1.PreservedState.decode(reader, reader.uint32()); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PerInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PerInstanceConfig} PerInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PerInstanceConfig message. + * @function verify + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PerInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.preservedState != null && message.hasOwnProperty("preservedState")) { + properties._preservedState = 1; + { + var error = $root.google.cloud.compute.v1.PreservedState.verify(message.preservedState); + if (error) + return "preservedState." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 352003508: + case 528602024: + case 244201863: + case 2402104: + case 483935140: + case 313956873: + break; + } + } + return null; + }; + + /** + * Creates a PerInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PerInstanceConfig} PerInstanceConfig + */ + PerInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PerInstanceConfig) + return object; + var message = new $root.google.cloud.compute.v1.PerInstanceConfig(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.name != null) + message.name = String(object.name); + if (object.preservedState != null) { + if (typeof object.preservedState !== "object") + throw TypeError(".google.cloud.compute.v1.PerInstanceConfig.preservedState: object expected"); + message.preservedState = $root.google.cloud.compute.v1.PreservedState.fromObject(object.preservedState); + } + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "APPLYING": + case 352003508: + message.status = 352003508; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "EFFECTIVE": + case 244201863: + message.status = 244201863; + break; + case "NONE": + case 2402104: + message.status = 2402104; + break; + case "UNAPPLIED": + case 483935140: + message.status = 483935140; + break; + case "UNAPPLIED_DELETION": + case 313956873: + message.status = 313956873; + break; + } + return message; + }; + + /** + * Creates a plain object from a PerInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @static + * @param {google.cloud.compute.v1.PerInstanceConfig} message PerInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PerInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.preservedState != null && message.hasOwnProperty("preservedState")) { + object.preservedState = $root.google.cloud.compute.v1.PreservedState.toObject(message.preservedState, options); + if (options.oneofs) + object._preservedState = "preservedState"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.PerInstanceConfig.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + return object; + }; + + /** + * Converts this PerInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PerInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + PerInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.PerInstanceConfig.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} APPLYING=352003508 APPLYING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} EFFECTIVE=244201863 EFFECTIVE value + * @property {number} NONE=2402104 NONE value + * @property {number} UNAPPLIED=483935140 UNAPPLIED value + * @property {number} UNAPPLIED_DELETION=313956873 UNAPPLIED_DELETION value + */ + PerInstanceConfig.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[352003508] = "APPLYING"] = 352003508; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[244201863] = "EFFECTIVE"] = 244201863; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[483935140] = "UNAPPLIED"] = 483935140; + values[valuesById[313956873] = "UNAPPLIED_DELETION"] = 313956873; + return values; + })(); + + return PerInstanceConfig; + })(); + + v1.InstanceGroupManagersCreateInstancesRequest = (function() { + + /** + * Properties of an InstanceGroupManagersCreateInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersCreateInstancesRequest + * @property {Array.|null} [instances] InstanceGroupManagersCreateInstancesRequest instances + */ + + /** + * Constructs a new InstanceGroupManagersCreateInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersCreateInstancesRequest. + * @implements IInstanceGroupManagersCreateInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest=} [properties] Properties to set + */ + function InstanceGroupManagersCreateInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersCreateInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @instance + */ + InstanceGroupManagersCreateInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new InstanceGroupManagersCreateInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest} InstanceGroupManagersCreateInstancesRequest instance + */ + InstanceGroupManagersCreateInstancesRequest.create = function create(properties) { + return new InstanceGroupManagersCreateInstancesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersCreateInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest} message InstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersCreateInstancesRequest.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.compute.v1.PerInstanceConfig.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest} message InstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest} InstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersCreateInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest} InstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersCreateInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersCreateInstancesRequest.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.compute.v1.PerInstanceConfig.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagersCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest} InstanceGroupManagersCreateInstancesRequest + */ + InstanceGroupManagersCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersCreateInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest} message InstanceGroupManagersCreateInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersCreateInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupManagersCreateInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersCreateInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersCreateInstancesRequest; + })(); + + v1.InstanceGroupManagersDeleteInstancesRequest = (function() { + + /** + * Properties of an InstanceGroupManagersDeleteInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersDeleteInstancesRequest + * @property {Array.|null} [instances] InstanceGroupManagersDeleteInstancesRequest instances + */ + + /** + * Constructs a new InstanceGroupManagersDeleteInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersDeleteInstancesRequest. + * @implements IInstanceGroupManagersDeleteInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest=} [properties] Properties to set + */ + function InstanceGroupManagersDeleteInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersDeleteInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @instance + */ + InstanceGroupManagersDeleteInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new InstanceGroupManagersDeleteInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest} InstanceGroupManagersDeleteInstancesRequest instance + */ + InstanceGroupManagersDeleteInstancesRequest.create = function create(properties) { + return new InstanceGroupManagersDeleteInstancesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersDeleteInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest} message InstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersDeleteInstancesRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersDeleteInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest} message InstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersDeleteInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest} InstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersDeleteInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest} InstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersDeleteInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersDeleteInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersDeleteInstancesRequest.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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersDeleteInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest} InstanceGroupManagersDeleteInstancesRequest + */ + InstanceGroupManagersDeleteInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersDeleteInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest} message InstanceGroupManagersDeleteInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersDeleteInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + return object; + }; + + /** + * Converts this InstanceGroupManagersDeleteInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersDeleteInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersDeleteInstancesRequest; + })(); + + v1.InstanceGroupManagersDeletePerInstanceConfigsReq = (function() { + + /** + * Properties of an InstanceGroupManagersDeletePerInstanceConfigsReq. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersDeletePerInstanceConfigsReq + * @property {Array.|null} [names] InstanceGroupManagersDeletePerInstanceConfigsReq names + */ + + /** + * Constructs a new InstanceGroupManagersDeletePerInstanceConfigsReq. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersDeletePerInstanceConfigsReq. + * @implements IInstanceGroupManagersDeletePerInstanceConfigsReq + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq=} [properties] Properties to set + */ + function InstanceGroupManagersDeletePerInstanceConfigsReq(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersDeletePerInstanceConfigsReq names. + * @member {Array.} names + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @instance + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.prototype.names = $util.emptyArray; + + /** + * Creates a new InstanceGroupManagersDeletePerInstanceConfigsReq instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq} InstanceGroupManagersDeletePerInstanceConfigsReq instance + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.create = function create(properties) { + return new InstanceGroupManagersDeletePerInstanceConfigsReq(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersDeletePerInstanceConfigsReq message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq} message InstanceGroupManagersDeletePerInstanceConfigsReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 104585032, wireType 2 =*/836680258).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersDeletePerInstanceConfigsReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq} message InstanceGroupManagersDeletePerInstanceConfigsReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersDeletePerInstanceConfigsReq message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq} InstanceGroupManagersDeletePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 104585032: + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersDeletePerInstanceConfigsReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq} InstanceGroupManagersDeletePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersDeletePerInstanceConfigsReq message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersDeletePerInstanceConfigsReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq} InstanceGroupManagersDeletePerInstanceConfigsReq + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq(); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersDeletePerInstanceConfigsReq message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq} message InstanceGroupManagersDeletePerInstanceConfigsReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this InstanceGroupManagersDeletePerInstanceConfigsReq to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersDeletePerInstanceConfigsReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersDeletePerInstanceConfigsReq; + })(); + + v1.InstanceManagedByIgmError = (function() { + + /** + * Properties of an InstanceManagedByIgmError. + * @memberof google.cloud.compute.v1 + * @interface IInstanceManagedByIgmError + * @property {google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError|null} [error] InstanceManagedByIgmError error + * @property {google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails|null} [instanceActionDetails] InstanceManagedByIgmError instanceActionDetails + * @property {string|null} [timestamp] InstanceManagedByIgmError timestamp + */ + + /** + * Constructs a new InstanceManagedByIgmError. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceManagedByIgmError. + * @implements IInstanceManagedByIgmError + * @constructor + * @param {google.cloud.compute.v1.IInstanceManagedByIgmError=} [properties] Properties to set + */ + function InstanceManagedByIgmError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceManagedByIgmError error. + * @member {google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError|null|undefined} error + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @instance + */ + InstanceManagedByIgmError.prototype.error = null; + + /** + * InstanceManagedByIgmError instanceActionDetails. + * @member {google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails|null|undefined} instanceActionDetails + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @instance + */ + InstanceManagedByIgmError.prototype.instanceActionDetails = null; + + /** + * InstanceManagedByIgmError timestamp. + * @member {string|null|undefined} timestamp + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @instance + */ + InstanceManagedByIgmError.prototype.timestamp = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceManagedByIgmError _error. + * @member {"error"|undefined} _error + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @instance + */ + Object.defineProperty(InstanceManagedByIgmError.prototype, "_error", { + get: $util.oneOfGetter($oneOfFields = ["error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceManagedByIgmError _instanceActionDetails. + * @member {"instanceActionDetails"|undefined} _instanceActionDetails + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @instance + */ + Object.defineProperty(InstanceManagedByIgmError.prototype, "_instanceActionDetails", { + get: $util.oneOfGetter($oneOfFields = ["instanceActionDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceManagedByIgmError _timestamp. + * @member {"timestamp"|undefined} _timestamp + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @instance + */ + Object.defineProperty(InstanceManagedByIgmError.prototype, "_timestamp", { + get: $util.oneOfGetter($oneOfFields = ["timestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceManagedByIgmError instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmError=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceManagedByIgmError} InstanceManagedByIgmError instance + */ + InstanceManagedByIgmError.create = function create(properties) { + return new InstanceManagedByIgmError(properties); + }; + + /** + * Encodes the specified InstanceManagedByIgmError message. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmError.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmError} message InstanceManagedByIgmError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceManagedByIgmError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 55126294, wireType 2 =*/441010354).string(message.timestamp); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.encode(message.error, writer.uint32(/* id 96784904, wireType 2 =*/774279234).fork()).ldelim(); + if (message.instanceActionDetails != null && Object.hasOwnProperty.call(message, "instanceActionDetails")) + $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.encode(message.instanceActionDetails, writer.uint32(/* id 292224547, wireType 2 =*/2337796378).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceManagedByIgmError message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmError} message InstanceManagedByIgmError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceManagedByIgmError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceManagedByIgmError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceManagedByIgmError} InstanceManagedByIgmError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceManagedByIgmError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceManagedByIgmError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 96784904: + message.error = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.decode(reader, reader.uint32()); + break; + case 292224547: + message.instanceActionDetails = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.decode(reader, reader.uint32()); + break; + case 55126294: + message.timestamp = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceManagedByIgmError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceManagedByIgmError} InstanceManagedByIgmError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceManagedByIgmError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceManagedByIgmError message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceManagedByIgmError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + properties._error = 1; + { + var error = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.instanceActionDetails != null && message.hasOwnProperty("instanceActionDetails")) { + properties._instanceActionDetails = 1; + { + var error = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.verify(message.instanceActionDetails); + if (error) + return "instanceActionDetails." + error; + } + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + properties._timestamp = 1; + if (!$util.isString(message.timestamp)) + return "timestamp: string expected"; + } + return null; + }; + + /** + * Creates an InstanceManagedByIgmError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceManagedByIgmError} InstanceManagedByIgmError + */ + InstanceManagedByIgmError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceManagedByIgmError) + return object; + var message = new $root.google.cloud.compute.v1.InstanceManagedByIgmError(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceManagedByIgmError.error: object expected"); + message.error = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.fromObject(object.error); + } + if (object.instanceActionDetails != null) { + if (typeof object.instanceActionDetails !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceManagedByIgmError.instanceActionDetails: object expected"); + message.instanceActionDetails = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.fromObject(object.instanceActionDetails); + } + if (object.timestamp != null) + message.timestamp = String(object.timestamp); + return message; + }; + + /** + * Creates a plain object from an InstanceManagedByIgmError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @static + * @param {google.cloud.compute.v1.InstanceManagedByIgmError} message InstanceManagedByIgmError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceManagedByIgmError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) { + object.timestamp = message.timestamp; + if (options.oneofs) + object._timestamp = "timestamp"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.toObject(message.error, options); + if (options.oneofs) + object._error = "error"; + } + if (message.instanceActionDetails != null && message.hasOwnProperty("instanceActionDetails")) { + object.instanceActionDetails = $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.toObject(message.instanceActionDetails, options); + if (options.oneofs) + object._instanceActionDetails = "instanceActionDetails"; + } + return object; + }; + + /** + * Converts this InstanceManagedByIgmError to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceManagedByIgmError + * @instance + * @returns {Object.} JSON object + */ + InstanceManagedByIgmError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceManagedByIgmError; + })(); + + v1.InstanceGroupManagersListErrorsResponse = (function() { + + /** + * Properties of an InstanceGroupManagersListErrorsResponse. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersListErrorsResponse + * @property {Array.|null} [items] InstanceGroupManagersListErrorsResponse items + * @property {string|null} [nextPageToken] InstanceGroupManagersListErrorsResponse nextPageToken + */ + + /** + * Constructs a new InstanceGroupManagersListErrorsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersListErrorsResponse. + * @implements IInstanceGroupManagersListErrorsResponse + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse=} [properties] Properties to set + */ + function InstanceGroupManagersListErrorsResponse(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersListErrorsResponse items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @instance + */ + InstanceGroupManagersListErrorsResponse.prototype.items = $util.emptyArray; + + /** + * InstanceGroupManagersListErrorsResponse nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @instance + */ + InstanceGroupManagersListErrorsResponse.prototype.nextPageToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagersListErrorsResponse _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @instance + */ + Object.defineProperty(InstanceGroupManagersListErrorsResponse.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagersListErrorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse} InstanceGroupManagersListErrorsResponse instance + */ + InstanceGroupManagersListErrorsResponse.create = function create(properties) { + return new InstanceGroupManagersListErrorsResponse(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersListErrorsResponse message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse} message InstanceGroupManagersListErrorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersListErrorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceManagedByIgmError.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersListErrorsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse} message InstanceGroupManagersListErrorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersListErrorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersListErrorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse} InstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersListErrorsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceManagedByIgmError.decode(reader, reader.uint32())); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersListErrorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse} InstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersListErrorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersListErrorsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersListErrorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceManagedByIgmError.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersListErrorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse} InstanceGroupManagersListErrorsResponse + */ + InstanceGroupManagersListErrorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceManagedByIgmError.fromObject(object.items[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersListErrorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse} message InstanceGroupManagersListErrorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersListErrorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceManagedByIgmError.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupManagersListErrorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersListErrorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersListErrorsResponse; + })(); + + v1.ManagedInstance = (function() { + + /** + * Properties of a ManagedInstance. + * @memberof google.cloud.compute.v1 + * @interface IManagedInstance + * @property {google.cloud.compute.v1.ManagedInstance.CurrentAction|null} [currentAction] ManagedInstance currentAction + * @property {number|Long|null} [id] ManagedInstance id + * @property {string|null} [instance] ManagedInstance instance + * @property {Array.|null} [instanceHealth] ManagedInstance instanceHealth + * @property {google.cloud.compute.v1.ManagedInstance.InstanceStatus|null} [instanceStatus] ManagedInstance instanceStatus + * @property {google.cloud.compute.v1.IManagedInstanceLastAttempt|null} [lastAttempt] ManagedInstance lastAttempt + * @property {google.cloud.compute.v1.IPreservedState|null} [preservedStateFromConfig] ManagedInstance preservedStateFromConfig + * @property {google.cloud.compute.v1.IPreservedState|null} [preservedStateFromPolicy] ManagedInstance preservedStateFromPolicy + * @property {google.cloud.compute.v1.IManagedInstanceVersion|null} [version] ManagedInstance version + */ + + /** + * Constructs a new ManagedInstance. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ManagedInstance. + * @implements IManagedInstance + * @constructor + * @param {google.cloud.compute.v1.IManagedInstance=} [properties] Properties to set + */ + function ManagedInstance(properties) { + this.instanceHealth = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedInstance currentAction. + * @member {google.cloud.compute.v1.ManagedInstance.CurrentAction|null|undefined} currentAction + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.currentAction = null; + + /** + * ManagedInstance id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.id = null; + + /** + * ManagedInstance instance. + * @member {string|null|undefined} instance + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.instance = null; + + /** + * ManagedInstance instanceHealth. + * @member {Array.} instanceHealth + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.instanceHealth = $util.emptyArray; + + /** + * ManagedInstance instanceStatus. + * @member {google.cloud.compute.v1.ManagedInstance.InstanceStatus|null|undefined} instanceStatus + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.instanceStatus = null; + + /** + * ManagedInstance lastAttempt. + * @member {google.cloud.compute.v1.IManagedInstanceLastAttempt|null|undefined} lastAttempt + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.lastAttempt = null; + + /** + * ManagedInstance preservedStateFromConfig. + * @member {google.cloud.compute.v1.IPreservedState|null|undefined} preservedStateFromConfig + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.preservedStateFromConfig = null; + + /** + * ManagedInstance preservedStateFromPolicy. + * @member {google.cloud.compute.v1.IPreservedState|null|undefined} preservedStateFromPolicy + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.preservedStateFromPolicy = null; + + /** + * ManagedInstance version. + * @member {google.cloud.compute.v1.IManagedInstanceVersion|null|undefined} version + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + ManagedInstance.prototype.version = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ManagedInstance _currentAction. + * @member {"currentAction"|undefined} _currentAction + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_currentAction", { + get: $util.oneOfGetter($oneOfFields = ["currentAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstance _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstance _instance. + * @member {"instance"|undefined} _instance + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_instance", { + get: $util.oneOfGetter($oneOfFields = ["instance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstance _instanceStatus. + * @member {"instanceStatus"|undefined} _instanceStatus + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_instanceStatus", { + get: $util.oneOfGetter($oneOfFields = ["instanceStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstance _lastAttempt. + * @member {"lastAttempt"|undefined} _lastAttempt + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_lastAttempt", { + get: $util.oneOfGetter($oneOfFields = ["lastAttempt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstance _preservedStateFromConfig. + * @member {"preservedStateFromConfig"|undefined} _preservedStateFromConfig + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_preservedStateFromConfig", { + get: $util.oneOfGetter($oneOfFields = ["preservedStateFromConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstance _preservedStateFromPolicy. + * @member {"preservedStateFromPolicy"|undefined} _preservedStateFromPolicy + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_preservedStateFromPolicy", { + get: $util.oneOfGetter($oneOfFields = ["preservedStateFromPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstance _version. + * @member {"version"|undefined} _version + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + */ + Object.defineProperty(ManagedInstance.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ManagedInstance instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {google.cloud.compute.v1.IManagedInstance=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ManagedInstance} ManagedInstance instance + */ + ManagedInstance.create = function create(properties) { + return new ManagedInstance(properties); + }; + + /** + * Encodes the specified ManagedInstance message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {google.cloud.compute.v1.IManagedInstance} message ManagedInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.preservedStateFromConfig != null && Object.hasOwnProperty.call(message, "preservedStateFromConfig")) + $root.google.cloud.compute.v1.PreservedState.encode(message.preservedStateFromConfig, writer.uint32(/* id 98661858, wireType 2 =*/789294866).fork()).ldelim(); + if (message.instanceStatus != null && Object.hasOwnProperty.call(message, "instanceStatus")) + writer.uint32(/* id 174577372, wireType 0 =*/1396618976).int32(message.instanceStatus); + if (message.currentAction != null && Object.hasOwnProperty.call(message, "currentAction")) + writer.uint32(/* id 178475964, wireType 0 =*/1427807712).int32(message.currentAction); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.compute.v1.ManagedInstanceVersion.encode(message.version, writer.uint32(/* id 351608024, wireType 2 =*/2812864194).fork()).ldelim(); + if (message.instanceHealth != null && message.instanceHealth.length) + for (var i = 0; i < message.instanceHealth.length; ++i) + $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth.encode(message.instanceHealth[i], writer.uint32(/* id 382667078, wireType 2 =*/3061336626).fork()).ldelim(); + if (message.lastAttempt != null && Object.hasOwnProperty.call(message, "lastAttempt")) + $root.google.cloud.compute.v1.ManagedInstanceLastAttempt.encode(message.lastAttempt, writer.uint32(/* id 434771492, wireType 2 =*/3478171938).fork()).ldelim(); + if (message.preservedStateFromPolicy != null && Object.hasOwnProperty.call(message, "preservedStateFromPolicy")) + $root.google.cloud.compute.v1.PreservedState.encode(message.preservedStateFromPolicy, writer.uint32(/* id 470783954, wireType 2 =*/3766271634).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ManagedInstance message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {google.cloud.compute.v1.IManagedInstance} message ManagedInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ManagedInstance} ManagedInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ManagedInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 178475964: + message.currentAction = reader.int32(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 382667078: + if (!(message.instanceHealth && message.instanceHealth.length)) + message.instanceHealth = []; + message.instanceHealth.push($root.google.cloud.compute.v1.ManagedInstanceInstanceHealth.decode(reader, reader.uint32())); + break; + case 174577372: + message.instanceStatus = reader.int32(); + break; + case 434771492: + message.lastAttempt = $root.google.cloud.compute.v1.ManagedInstanceLastAttempt.decode(reader, reader.uint32()); + break; + case 98661858: + message.preservedStateFromConfig = $root.google.cloud.compute.v1.PreservedState.decode(reader, reader.uint32()); + break; + case 470783954: + message.preservedStateFromPolicy = $root.google.cloud.compute.v1.PreservedState.decode(reader, reader.uint32()); + break; + case 351608024: + message.version = $root.google.cloud.compute.v1.ManagedInstanceVersion.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ManagedInstance} ManagedInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedInstance message. + * @function verify + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.currentAction != null && message.hasOwnProperty("currentAction")) { + properties._currentAction = 1; + switch (message.currentAction) { + default: + return "currentAction: enum value expected"; + case 0: + case 388244813: + case 455564985: + case 428843785: + case 528602024: + case 2402104: + case 287278572: + case 163266343: + case 320534387: + case 16982185: + break; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + properties._instance = 1; + if (!$util.isString(message.instance)) + return "instance: string expected"; + } + if (message.instanceHealth != null && message.hasOwnProperty("instanceHealth")) { + if (!Array.isArray(message.instanceHealth)) + return "instanceHealth: array expected"; + for (var i = 0; i < message.instanceHealth.length; ++i) { + var error = $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth.verify(message.instanceHealth[i]); + if (error) + return "instanceHealth." + error; + } + } + if (message.instanceStatus != null && message.hasOwnProperty("instanceStatus")) { + properties._instanceStatus = 1; + switch (message.instanceStatus) { + default: + return "instanceStatus: enum value expected"; + case 0: + case 428935662: + case 290896621: + case 413483285: + case 121282975: + case 431072283: + case 444276141: + case 350791796: + case 51223995: + case 514206246: + case 250018339: + break; + } + } + if (message.lastAttempt != null && message.hasOwnProperty("lastAttempt")) { + properties._lastAttempt = 1; + { + var error = $root.google.cloud.compute.v1.ManagedInstanceLastAttempt.verify(message.lastAttempt); + if (error) + return "lastAttempt." + error; + } + } + if (message.preservedStateFromConfig != null && message.hasOwnProperty("preservedStateFromConfig")) { + properties._preservedStateFromConfig = 1; + { + var error = $root.google.cloud.compute.v1.PreservedState.verify(message.preservedStateFromConfig); + if (error) + return "preservedStateFromConfig." + error; + } + } + if (message.preservedStateFromPolicy != null && message.hasOwnProperty("preservedStateFromPolicy")) { + properties._preservedStateFromPolicy = 1; + { + var error = $root.google.cloud.compute.v1.PreservedState.verify(message.preservedStateFromPolicy); + if (error) + return "preservedStateFromPolicy." + error; + } + } + if (message.version != null && message.hasOwnProperty("version")) { + properties._version = 1; + { + var error = $root.google.cloud.compute.v1.ManagedInstanceVersion.verify(message.version); + if (error) + return "version." + error; + } + } + return null; + }; + + /** + * Creates a ManagedInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ManagedInstance} ManagedInstance + */ + ManagedInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ManagedInstance) + return object; + var message = new $root.google.cloud.compute.v1.ManagedInstance(); + switch (object.currentAction) { + case "UNDEFINED_CURRENT_ACTION": + case 0: + message.currentAction = 0; + break; + case "ABANDONING": + case 388244813: + message.currentAction = 388244813; + break; + case "CREATING": + case 455564985: + message.currentAction = 455564985; + break; + case "CREATING_WITHOUT_RETRIES": + case 428843785: + message.currentAction = 428843785; + break; + case "DELETING": + case 528602024: + message.currentAction = 528602024; + break; + case "NONE": + case 2402104: + message.currentAction = 2402104; + break; + case "RECREATING": + case 287278572: + message.currentAction = 287278572; + break; + case "REFRESHING": + case 163266343: + message.currentAction = 163266343; + break; + case "RESTARTING": + case 320534387: + message.currentAction = 320534387; + break; + case "VERIFYING": + case 16982185: + message.currentAction = 16982185; + break; + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instanceHealth) { + if (!Array.isArray(object.instanceHealth)) + throw TypeError(".google.cloud.compute.v1.ManagedInstance.instanceHealth: array expected"); + message.instanceHealth = []; + for (var i = 0; i < object.instanceHealth.length; ++i) { + if (typeof object.instanceHealth[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ManagedInstance.instanceHealth: object expected"); + message.instanceHealth[i] = $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth.fromObject(object.instanceHealth[i]); + } + } + switch (object.instanceStatus) { + case "UNDEFINED_INSTANCE_STATUS": + case 0: + message.instanceStatus = 0; + break; + case "DEPROVISIONING": + case 428935662: + message.instanceStatus = 428935662; + break; + case "PROVISIONING": + case 290896621: + message.instanceStatus = 290896621; + break; + case "REPAIRING": + case 413483285: + message.instanceStatus = 413483285; + break; + case "RUNNING": + case 121282975: + message.instanceStatus = 121282975; + break; + case "STAGING": + case 431072283: + message.instanceStatus = 431072283; + break; + case "STOPPED": + case 444276141: + message.instanceStatus = 444276141; + break; + case "STOPPING": + case 350791796: + message.instanceStatus = 350791796; + break; + case "SUSPENDED": + case 51223995: + message.instanceStatus = 51223995; + break; + case "SUSPENDING": + case 514206246: + message.instanceStatus = 514206246; + break; + case "TERMINATED": + case 250018339: + message.instanceStatus = 250018339; + break; + } + if (object.lastAttempt != null) { + if (typeof object.lastAttempt !== "object") + throw TypeError(".google.cloud.compute.v1.ManagedInstance.lastAttempt: object expected"); + message.lastAttempt = $root.google.cloud.compute.v1.ManagedInstanceLastAttempt.fromObject(object.lastAttempt); + } + if (object.preservedStateFromConfig != null) { + if (typeof object.preservedStateFromConfig !== "object") + throw TypeError(".google.cloud.compute.v1.ManagedInstance.preservedStateFromConfig: object expected"); + message.preservedStateFromConfig = $root.google.cloud.compute.v1.PreservedState.fromObject(object.preservedStateFromConfig); + } + if (object.preservedStateFromPolicy != null) { + if (typeof object.preservedStateFromPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.ManagedInstance.preservedStateFromPolicy: object expected"); + message.preservedStateFromPolicy = $root.google.cloud.compute.v1.PreservedState.fromObject(object.preservedStateFromPolicy); + } + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.compute.v1.ManagedInstance.version: object expected"); + message.version = $root.google.cloud.compute.v1.ManagedInstanceVersion.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from a ManagedInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ManagedInstance + * @static + * @param {google.cloud.compute.v1.ManagedInstance} message ManagedInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instanceHealth = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + object.instance = message.instance; + if (options.oneofs) + object._instance = "instance"; + } + if (message.preservedStateFromConfig != null && message.hasOwnProperty("preservedStateFromConfig")) { + object.preservedStateFromConfig = $root.google.cloud.compute.v1.PreservedState.toObject(message.preservedStateFromConfig, options); + if (options.oneofs) + object._preservedStateFromConfig = "preservedStateFromConfig"; + } + if (message.instanceStatus != null && message.hasOwnProperty("instanceStatus")) { + object.instanceStatus = options.enums === String ? $root.google.cloud.compute.v1.ManagedInstance.InstanceStatus[message.instanceStatus] : message.instanceStatus; + if (options.oneofs) + object._instanceStatus = "instanceStatus"; + } + if (message.currentAction != null && message.hasOwnProperty("currentAction")) { + object.currentAction = options.enums === String ? $root.google.cloud.compute.v1.ManagedInstance.CurrentAction[message.currentAction] : message.currentAction; + if (options.oneofs) + object._currentAction = "currentAction"; + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = $root.google.cloud.compute.v1.ManagedInstanceVersion.toObject(message.version, options); + if (options.oneofs) + object._version = "version"; + } + if (message.instanceHealth && message.instanceHealth.length) { + object.instanceHealth = []; + for (var j = 0; j < message.instanceHealth.length; ++j) + object.instanceHealth[j] = $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth.toObject(message.instanceHealth[j], options); + } + if (message.lastAttempt != null && message.hasOwnProperty("lastAttempt")) { + object.lastAttempt = $root.google.cloud.compute.v1.ManagedInstanceLastAttempt.toObject(message.lastAttempt, options); + if (options.oneofs) + object._lastAttempt = "lastAttempt"; + } + if (message.preservedStateFromPolicy != null && message.hasOwnProperty("preservedStateFromPolicy")) { + object.preservedStateFromPolicy = $root.google.cloud.compute.v1.PreservedState.toObject(message.preservedStateFromPolicy, options); + if (options.oneofs) + object._preservedStateFromPolicy = "preservedStateFromPolicy"; + } + return object; + }; + + /** + * Converts this ManagedInstance to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ManagedInstance + * @instance + * @returns {Object.} JSON object + */ + ManagedInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CurrentAction enum. + * @name google.cloud.compute.v1.ManagedInstance.CurrentAction + * @enum {number} + * @property {number} UNDEFINED_CURRENT_ACTION=0 UNDEFINED_CURRENT_ACTION value + * @property {number} ABANDONING=388244813 ABANDONING value + * @property {number} CREATING=455564985 CREATING value + * @property {number} CREATING_WITHOUT_RETRIES=428843785 CREATING_WITHOUT_RETRIES value + * @property {number} DELETING=528602024 DELETING value + * @property {number} NONE=2402104 NONE value + * @property {number} RECREATING=287278572 RECREATING value + * @property {number} REFRESHING=163266343 REFRESHING value + * @property {number} RESTARTING=320534387 RESTARTING value + * @property {number} VERIFYING=16982185 VERIFYING value + */ + ManagedInstance.CurrentAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CURRENT_ACTION"] = 0; + values[valuesById[388244813] = "ABANDONING"] = 388244813; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[428843785] = "CREATING_WITHOUT_RETRIES"] = 428843785; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[287278572] = "RECREATING"] = 287278572; + values[valuesById[163266343] = "REFRESHING"] = 163266343; + values[valuesById[320534387] = "RESTARTING"] = 320534387; + values[valuesById[16982185] = "VERIFYING"] = 16982185; + return values; + })(); + + /** + * InstanceStatus enum. + * @name google.cloud.compute.v1.ManagedInstance.InstanceStatus + * @enum {number} + * @property {number} UNDEFINED_INSTANCE_STATUS=0 UNDEFINED_INSTANCE_STATUS value + * @property {number} DEPROVISIONING=428935662 DEPROVISIONING value + * @property {number} PROVISIONING=290896621 PROVISIONING value + * @property {number} REPAIRING=413483285 REPAIRING value + * @property {number} RUNNING=121282975 RUNNING value + * @property {number} STAGING=431072283 STAGING value + * @property {number} STOPPED=444276141 STOPPED value + * @property {number} STOPPING=350791796 STOPPING value + * @property {number} SUSPENDED=51223995 SUSPENDED value + * @property {number} SUSPENDING=514206246 SUSPENDING value + * @property {number} TERMINATED=250018339 TERMINATED value + */ + ManagedInstance.InstanceStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_INSTANCE_STATUS"] = 0; + values[valuesById[428935662] = "DEPROVISIONING"] = 428935662; + values[valuesById[290896621] = "PROVISIONING"] = 290896621; + values[valuesById[413483285] = "REPAIRING"] = 413483285; + values[valuesById[121282975] = "RUNNING"] = 121282975; + values[valuesById[431072283] = "STAGING"] = 431072283; + values[valuesById[444276141] = "STOPPED"] = 444276141; + values[valuesById[350791796] = "STOPPING"] = 350791796; + values[valuesById[51223995] = "SUSPENDED"] = 51223995; + values[valuesById[514206246] = "SUSPENDING"] = 514206246; + values[valuesById[250018339] = "TERMINATED"] = 250018339; + return values; + })(); + + return ManagedInstance; + })(); + + v1.InstanceGroupManagersListManagedInstancesResponse = (function() { + + /** + * Properties of an InstanceGroupManagersListManagedInstancesResponse. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersListManagedInstancesResponse + * @property {Array.|null} [managedInstances] InstanceGroupManagersListManagedInstancesResponse managedInstances + * @property {string|null} [nextPageToken] InstanceGroupManagersListManagedInstancesResponse nextPageToken + */ + + /** + * Constructs a new InstanceGroupManagersListManagedInstancesResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersListManagedInstancesResponse. + * @implements IInstanceGroupManagersListManagedInstancesResponse + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse=} [properties] Properties to set + */ + function InstanceGroupManagersListManagedInstancesResponse(properties) { + this.managedInstances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersListManagedInstancesResponse managedInstances. + * @member {Array.} managedInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @instance + */ + InstanceGroupManagersListManagedInstancesResponse.prototype.managedInstances = $util.emptyArray; + + /** + * InstanceGroupManagersListManagedInstancesResponse nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @instance + */ + InstanceGroupManagersListManagedInstancesResponse.prototype.nextPageToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagersListManagedInstancesResponse _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @instance + */ + Object.defineProperty(InstanceGroupManagersListManagedInstancesResponse.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagersListManagedInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse} InstanceGroupManagersListManagedInstancesResponse instance + */ + InstanceGroupManagersListManagedInstancesResponse.create = function create(properties) { + return new InstanceGroupManagersListManagedInstancesResponse(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersListManagedInstancesResponse message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse} message InstanceGroupManagersListManagedInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersListManagedInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.managedInstances != null && message.managedInstances.length) + for (var i = 0; i < message.managedInstances.length; ++i) + $root.google.cloud.compute.v1.ManagedInstance.encode(message.managedInstances[i], writer.uint32(/* id 336219614, wireType 2 =*/2689756914).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersListManagedInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse} message InstanceGroupManagersListManagedInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersListManagedInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersListManagedInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse} InstanceGroupManagersListManagedInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersListManagedInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336219614: + if (!(message.managedInstances && message.managedInstances.length)) + message.managedInstances = []; + message.managedInstances.push($root.google.cloud.compute.v1.ManagedInstance.decode(reader, reader.uint32())); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersListManagedInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse} InstanceGroupManagersListManagedInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersListManagedInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersListManagedInstancesResponse message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersListManagedInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.managedInstances != null && message.hasOwnProperty("managedInstances")) { + if (!Array.isArray(message.managedInstances)) + return "managedInstances: array expected"; + for (var i = 0; i < message.managedInstances.length; ++i) { + var error = $root.google.cloud.compute.v1.ManagedInstance.verify(message.managedInstances[i]); + if (error) + return "managedInstances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersListManagedInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse} InstanceGroupManagersListManagedInstancesResponse + */ + InstanceGroupManagersListManagedInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse(); + if (object.managedInstances) { + if (!Array.isArray(object.managedInstances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse.managedInstances: array expected"); + message.managedInstances = []; + for (var i = 0; i < object.managedInstances.length; ++i) { + if (typeof object.managedInstances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse.managedInstances: object expected"); + message.managedInstances[i] = $root.google.cloud.compute.v1.ManagedInstance.fromObject(object.managedInstances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersListManagedInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse} message InstanceGroupManagersListManagedInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersListManagedInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.managedInstances = []; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.managedInstances && message.managedInstances.length) { + object.managedInstances = []; + for (var j = 0; j < message.managedInstances.length; ++j) + object.managedInstances[j] = $root.google.cloud.compute.v1.ManagedInstance.toObject(message.managedInstances[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupManagersListManagedInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersListManagedInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersListManagedInstancesResponse; + })(); + + v1.InstanceGroupManagersListPerInstanceConfigsResp = (function() { + + /** + * Properties of an InstanceGroupManagersListPerInstanceConfigsResp. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersListPerInstanceConfigsResp + * @property {Array.|null} [items] InstanceGroupManagersListPerInstanceConfigsResp items + * @property {string|null} [nextPageToken] InstanceGroupManagersListPerInstanceConfigsResp nextPageToken + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupManagersListPerInstanceConfigsResp warning + */ + + /** + * Constructs a new InstanceGroupManagersListPerInstanceConfigsResp. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersListPerInstanceConfigsResp. + * @implements IInstanceGroupManagersListPerInstanceConfigsResp + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp=} [properties] Properties to set + */ + function InstanceGroupManagersListPerInstanceConfigsResp(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersListPerInstanceConfigsResp items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @instance + */ + InstanceGroupManagersListPerInstanceConfigsResp.prototype.items = $util.emptyArray; + + /** + * InstanceGroupManagersListPerInstanceConfigsResp nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @instance + */ + InstanceGroupManagersListPerInstanceConfigsResp.prototype.nextPageToken = null; + + /** + * InstanceGroupManagersListPerInstanceConfigsResp warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @instance + */ + InstanceGroupManagersListPerInstanceConfigsResp.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagersListPerInstanceConfigsResp _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @instance + */ + Object.defineProperty(InstanceGroupManagersListPerInstanceConfigsResp.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupManagersListPerInstanceConfigsResp _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @instance + */ + Object.defineProperty(InstanceGroupManagersListPerInstanceConfigsResp.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagersListPerInstanceConfigsResp instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp} InstanceGroupManagersListPerInstanceConfigsResp instance + */ + InstanceGroupManagersListPerInstanceConfigsResp.create = function create(properties) { + return new InstanceGroupManagersListPerInstanceConfigsResp(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersListPerInstanceConfigsResp message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp} message InstanceGroupManagersListPerInstanceConfigsResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersListPerInstanceConfigsResp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.PerInstanceConfig.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersListPerInstanceConfigsResp message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp} message InstanceGroupManagersListPerInstanceConfigsResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersListPerInstanceConfigsResp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersListPerInstanceConfigsResp message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp} InstanceGroupManagersListPerInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersListPerInstanceConfigsResp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersListPerInstanceConfigsResp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp} InstanceGroupManagersListPerInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersListPerInstanceConfigsResp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersListPerInstanceConfigsResp message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersListPerInstanceConfigsResp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.PerInstanceConfig.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagersListPerInstanceConfigsResp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp} InstanceGroupManagersListPerInstanceConfigsResp + */ + InstanceGroupManagersListPerInstanceConfigsResp.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.items[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersListPerInstanceConfigsResp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp} message InstanceGroupManagersListPerInstanceConfigsResp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersListPerInstanceConfigsResp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupManagersListPerInstanceConfigsResp to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersListPerInstanceConfigsResp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersListPerInstanceConfigsResp; + })(); + + v1.InstanceGroupManagersPatchPerInstanceConfigsReq = (function() { + + /** + * Properties of an InstanceGroupManagersPatchPerInstanceConfigsReq. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersPatchPerInstanceConfigsReq + * @property {Array.|null} [perInstanceConfigs] InstanceGroupManagersPatchPerInstanceConfigsReq perInstanceConfigs + */ + + /** + * Constructs a new InstanceGroupManagersPatchPerInstanceConfigsReq. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersPatchPerInstanceConfigsReq. + * @implements IInstanceGroupManagersPatchPerInstanceConfigsReq + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq=} [properties] Properties to set + */ + function InstanceGroupManagersPatchPerInstanceConfigsReq(properties) { + this.perInstanceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersPatchPerInstanceConfigsReq perInstanceConfigs. + * @member {Array.} perInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @instance + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.prototype.perInstanceConfigs = $util.emptyArray; + + /** + * Creates a new InstanceGroupManagersPatchPerInstanceConfigsReq instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq} InstanceGroupManagersPatchPerInstanceConfigsReq instance + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.create = function create(properties) { + return new InstanceGroupManagersPatchPerInstanceConfigsReq(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersPatchPerInstanceConfigsReq message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq} message InstanceGroupManagersPatchPerInstanceConfigsReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.perInstanceConfigs != null && message.perInstanceConfigs.length) + for (var i = 0; i < message.perInstanceConfigs.length; ++i) + $root.google.cloud.compute.v1.PerInstanceConfig.encode(message.perInstanceConfigs[i], writer.uint32(/* id 526265001, wireType 2 =*/4210120010).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersPatchPerInstanceConfigsReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq} message InstanceGroupManagersPatchPerInstanceConfigsReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersPatchPerInstanceConfigsReq message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq} InstanceGroupManagersPatchPerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 526265001: + if (!(message.perInstanceConfigs && message.perInstanceConfigs.length)) + message.perInstanceConfigs = []; + message.perInstanceConfigs.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersPatchPerInstanceConfigsReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq} InstanceGroupManagersPatchPerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersPatchPerInstanceConfigsReq message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.perInstanceConfigs != null && message.hasOwnProperty("perInstanceConfigs")) { + if (!Array.isArray(message.perInstanceConfigs)) + return "perInstanceConfigs: array expected"; + for (var i = 0; i < message.perInstanceConfigs.length; ++i) { + var error = $root.google.cloud.compute.v1.PerInstanceConfig.verify(message.perInstanceConfigs[i]); + if (error) + return "perInstanceConfigs." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagersPatchPerInstanceConfigsReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq} InstanceGroupManagersPatchPerInstanceConfigsReq + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq(); + if (object.perInstanceConfigs) { + if (!Array.isArray(object.perInstanceConfigs)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.perInstanceConfigs: array expected"); + message.perInstanceConfigs = []; + for (var i = 0; i < object.perInstanceConfigs.length; ++i) { + if (typeof object.perInstanceConfigs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.perInstanceConfigs: object expected"); + message.perInstanceConfigs[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.perInstanceConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersPatchPerInstanceConfigsReq message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq} message InstanceGroupManagersPatchPerInstanceConfigsReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.perInstanceConfigs = []; + if (message.perInstanceConfigs && message.perInstanceConfigs.length) { + object.perInstanceConfigs = []; + for (var j = 0; j < message.perInstanceConfigs.length; ++j) + object.perInstanceConfigs[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.perInstanceConfigs[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupManagersPatchPerInstanceConfigsReq to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersPatchPerInstanceConfigsReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersPatchPerInstanceConfigsReq; + })(); + + v1.InstanceGroupManagersRecreateInstancesRequest = (function() { + + /** + * Properties of an InstanceGroupManagersRecreateInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersRecreateInstancesRequest + * @property {Array.|null} [instances] InstanceGroupManagersRecreateInstancesRequest instances + */ + + /** + * Constructs a new InstanceGroupManagersRecreateInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersRecreateInstancesRequest. + * @implements IInstanceGroupManagersRecreateInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest=} [properties] Properties to set + */ + function InstanceGroupManagersRecreateInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersRecreateInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @instance + */ + InstanceGroupManagersRecreateInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new InstanceGroupManagersRecreateInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest} InstanceGroupManagersRecreateInstancesRequest instance + */ + InstanceGroupManagersRecreateInstancesRequest.create = function create(properties) { + return new InstanceGroupManagersRecreateInstancesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersRecreateInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest} message InstanceGroupManagersRecreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersRecreateInstancesRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersRecreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest} message InstanceGroupManagersRecreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersRecreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersRecreateInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest} InstanceGroupManagersRecreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersRecreateInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersRecreateInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest} InstanceGroupManagersRecreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersRecreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersRecreateInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersRecreateInstancesRequest.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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersRecreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest} InstanceGroupManagersRecreateInstancesRequest + */ + InstanceGroupManagersRecreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersRecreateInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest} message InstanceGroupManagersRecreateInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersRecreateInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + return object; + }; + + /** + * Converts this InstanceGroupManagersRecreateInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersRecreateInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersRecreateInstancesRequest; + })(); + + v1.InstanceGroupManagersSetInstanceTemplateRequest = (function() { + + /** + * Properties of an InstanceGroupManagersSetInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersSetInstanceTemplateRequest + * @property {string|null} [instanceTemplate] InstanceGroupManagersSetInstanceTemplateRequest instanceTemplate + */ + + /** + * Constructs a new InstanceGroupManagersSetInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersSetInstanceTemplateRequest. + * @implements IInstanceGroupManagersSetInstanceTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest=} [properties] Properties to set + */ + function InstanceGroupManagersSetInstanceTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersSetInstanceTemplateRequest instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @instance + */ + InstanceGroupManagersSetInstanceTemplateRequest.prototype.instanceTemplate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagersSetInstanceTemplateRequest _instanceTemplate. + * @member {"instanceTemplate"|undefined} _instanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @instance + */ + Object.defineProperty(InstanceGroupManagersSetInstanceTemplateRequest.prototype, "_instanceTemplate", { + get: $util.oneOfGetter($oneOfFields = ["instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagersSetInstanceTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest} InstanceGroupManagersSetInstanceTemplateRequest instance + */ + InstanceGroupManagersSetInstanceTemplateRequest.create = function create(properties) { + return new InstanceGroupManagersSetInstanceTemplateRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersSetInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest} message InstanceGroupManagersSetInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersSetInstanceTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 309248228, wireType 2 =*/2473985826).string(message.instanceTemplate); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersSetInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest} message InstanceGroupManagersSetInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersSetInstanceTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersSetInstanceTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest} InstanceGroupManagersSetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersSetInstanceTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 309248228: + message.instanceTemplate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersSetInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest} InstanceGroupManagersSetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersSetInstanceTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersSetInstanceTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersSetInstanceTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + properties._instanceTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersSetInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest} InstanceGroupManagersSetInstanceTemplateRequest + */ + InstanceGroupManagersSetInstanceTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest(); + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersSetInstanceTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest} message InstanceGroupManagersSetInstanceTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersSetInstanceTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object._instanceTemplate = "instanceTemplate"; + } + return object; + }; + + /** + * Converts this InstanceGroupManagersSetInstanceTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersSetInstanceTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersSetInstanceTemplateRequest; + })(); + + v1.InstanceGroupManagersSetTargetPoolsRequest = (function() { + + /** + * Properties of an InstanceGroupManagersSetTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersSetTargetPoolsRequest + * @property {string|null} [fingerprint] InstanceGroupManagersSetTargetPoolsRequest fingerprint + * @property {Array.|null} [targetPools] InstanceGroupManagersSetTargetPoolsRequest targetPools + */ + + /** + * Constructs a new InstanceGroupManagersSetTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersSetTargetPoolsRequest. + * @implements IInstanceGroupManagersSetTargetPoolsRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest=} [properties] Properties to set + */ + function InstanceGroupManagersSetTargetPoolsRequest(properties) { + this.targetPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersSetTargetPoolsRequest fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @instance + */ + InstanceGroupManagersSetTargetPoolsRequest.prototype.fingerprint = null; + + /** + * InstanceGroupManagersSetTargetPoolsRequest targetPools. + * @member {Array.} targetPools + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @instance + */ + InstanceGroupManagersSetTargetPoolsRequest.prototype.targetPools = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupManagersSetTargetPoolsRequest _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @instance + */ + Object.defineProperty(InstanceGroupManagersSetTargetPoolsRequest.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupManagersSetTargetPoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest} InstanceGroupManagersSetTargetPoolsRequest instance + */ + InstanceGroupManagersSetTargetPoolsRequest.create = function create(properties) { + return new InstanceGroupManagersSetTargetPoolsRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersSetTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest} message InstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersSetTargetPoolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.targetPools != null && message.targetPools.length) + for (var i = 0; i < message.targetPools.length; ++i) + writer.uint32(/* id 336072617, wireType 2 =*/2688580938).string(message.targetPools[i]); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersSetTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest} message InstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersSetTargetPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest} InstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersSetTargetPoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 234678500: + message.fingerprint = reader.string(); + break; + case 336072617: + if (!(message.targetPools && message.targetPools.length)) + message.targetPools = []; + message.targetPools.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest} InstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersSetTargetPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersSetTargetPoolsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersSetTargetPoolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.targetPools != null && message.hasOwnProperty("targetPools")) { + if (!Array.isArray(message.targetPools)) + return "targetPools: array expected"; + for (var i = 0; i < message.targetPools.length; ++i) + if (!$util.isString(message.targetPools[i])) + return "targetPools: string[] expected"; + } + return null; + }; + + /** + * Creates an InstanceGroupManagersSetTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest} InstanceGroupManagersSetTargetPoolsRequest + */ + InstanceGroupManagersSetTargetPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.targetPools) { + if (!Array.isArray(object.targetPools)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.targetPools: array expected"); + message.targetPools = []; + for (var i = 0; i < object.targetPools.length; ++i) + message.targetPools[i] = String(object.targetPools[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersSetTargetPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest} message InstanceGroupManagersSetTargetPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersSetTargetPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetPools = []; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.targetPools && message.targetPools.length) { + object.targetPools = []; + for (var j = 0; j < message.targetPools.length; ++j) + object.targetPools[j] = message.targetPools[j]; + } + return object; + }; + + /** + * Converts this InstanceGroupManagersSetTargetPoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersSetTargetPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersSetTargetPoolsRequest; + })(); + + v1.InstanceGroupManagersUpdatePerInstanceConfigsReq = (function() { + + /** + * Properties of an InstanceGroupManagersUpdatePerInstanceConfigsReq. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupManagersUpdatePerInstanceConfigsReq + * @property {Array.|null} [perInstanceConfigs] InstanceGroupManagersUpdatePerInstanceConfigsReq perInstanceConfigs + */ + + /** + * Constructs a new InstanceGroupManagersUpdatePerInstanceConfigsReq. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagersUpdatePerInstanceConfigsReq. + * @implements IInstanceGroupManagersUpdatePerInstanceConfigsReq + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq=} [properties] Properties to set + */ + function InstanceGroupManagersUpdatePerInstanceConfigsReq(properties) { + this.perInstanceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupManagersUpdatePerInstanceConfigsReq perInstanceConfigs. + * @member {Array.} perInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @instance + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.prototype.perInstanceConfigs = $util.emptyArray; + + /** + * Creates a new InstanceGroupManagersUpdatePerInstanceConfigsReq instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq} InstanceGroupManagersUpdatePerInstanceConfigsReq instance + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.create = function create(properties) { + return new InstanceGroupManagersUpdatePerInstanceConfigsReq(properties); + }; + + /** + * Encodes the specified InstanceGroupManagersUpdatePerInstanceConfigsReq message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq} message InstanceGroupManagersUpdatePerInstanceConfigsReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.perInstanceConfigs != null && message.perInstanceConfigs.length) + for (var i = 0; i < message.perInstanceConfigs.length; ++i) + $root.google.cloud.compute.v1.PerInstanceConfig.encode(message.perInstanceConfigs[i], writer.uint32(/* id 526265001, wireType 2 =*/4210120010).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupManagersUpdatePerInstanceConfigsReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq} message InstanceGroupManagersUpdatePerInstanceConfigsReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupManagersUpdatePerInstanceConfigsReq message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq} InstanceGroupManagersUpdatePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 526265001: + if (!(message.perInstanceConfigs && message.perInstanceConfigs.length)) + message.perInstanceConfigs = []; + message.perInstanceConfigs.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupManagersUpdatePerInstanceConfigsReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq} InstanceGroupManagersUpdatePerInstanceConfigsReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupManagersUpdatePerInstanceConfigsReq message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.perInstanceConfigs != null && message.hasOwnProperty("perInstanceConfigs")) { + if (!Array.isArray(message.perInstanceConfigs)) + return "perInstanceConfigs: array expected"; + for (var i = 0; i < message.perInstanceConfigs.length; ++i) { + var error = $root.google.cloud.compute.v1.PerInstanceConfig.verify(message.perInstanceConfigs[i]); + if (error) + return "perInstanceConfigs." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupManagersUpdatePerInstanceConfigsReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq} InstanceGroupManagersUpdatePerInstanceConfigsReq + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq(); + if (object.perInstanceConfigs) { + if (!Array.isArray(object.perInstanceConfigs)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.perInstanceConfigs: array expected"); + message.perInstanceConfigs = []; + for (var i = 0; i < object.perInstanceConfigs.length; ++i) { + if (typeof object.perInstanceConfigs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.perInstanceConfigs: object expected"); + message.perInstanceConfigs[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.perInstanceConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupManagersUpdatePerInstanceConfigsReq message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @static + * @param {google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq} message InstanceGroupManagersUpdatePerInstanceConfigsReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.perInstanceConfigs = []; + if (message.perInstanceConfigs && message.perInstanceConfigs.length) { + object.perInstanceConfigs = []; + for (var j = 0; j < message.perInstanceConfigs.length; ++j) + object.perInstanceConfigs[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.perInstanceConfigs[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupManagersUpdatePerInstanceConfigsReq to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupManagersUpdatePerInstanceConfigsReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupManagersUpdatePerInstanceConfigsReq; + })(); + + v1.InstanceReference = (function() { + + /** + * Properties of an InstanceReference. + * @memberof google.cloud.compute.v1 + * @interface IInstanceReference + * @property {string|null} [instance] InstanceReference instance + */ + + /** + * Constructs a new InstanceReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceReference. + * @implements IInstanceReference + * @constructor + * @param {google.cloud.compute.v1.IInstanceReference=} [properties] Properties to set + */ + function InstanceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceReference instance. + * @member {string|null|undefined} instance + * @memberof google.cloud.compute.v1.InstanceReference + * @instance + */ + InstanceReference.prototype.instance = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceReference _instance. + * @member {"instance"|undefined} _instance + * @memberof google.cloud.compute.v1.InstanceReference + * @instance + */ + Object.defineProperty(InstanceReference.prototype, "_instance", { + get: $util.oneOfGetter($oneOfFields = ["instance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {google.cloud.compute.v1.IInstanceReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceReference} InstanceReference instance + */ + InstanceReference.create = function create(properties) { + return new InstanceReference(properties); + }; + + /** + * Encodes the specified InstanceReference message. Does not implicitly {@link google.cloud.compute.v1.InstanceReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {google.cloud.compute.v1.IInstanceReference} message InstanceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + return writer; + }; + + /** + * Encodes the specified InstanceReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {google.cloud.compute.v1.IInstanceReference} message InstanceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceReference} InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceReference} InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceReference message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) { + properties._instance = 1; + if (!$util.isString(message.instance)) + return "instance: string expected"; + } + return null; + }; + + /** + * Creates an InstanceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceReference} InstanceReference + */ + InstanceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceReference) + return object; + var message = new $root.google.cloud.compute.v1.InstanceReference(); + if (object.instance != null) + message.instance = String(object.instance); + return message; + }; + + /** + * Creates a plain object from an InstanceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceReference + * @static + * @param {google.cloud.compute.v1.InstanceReference} message InstanceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.instance != null && message.hasOwnProperty("instance")) { + object.instance = message.instance; + if (options.oneofs) + object._instance = "instance"; + } + return object; + }; + + /** + * Converts this InstanceReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceReference + * @instance + * @returns {Object.} JSON object + */ + InstanceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceReference; + })(); + + v1.InstanceGroupsAddInstancesRequest = (function() { + + /** + * Properties of an InstanceGroupsAddInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupsAddInstancesRequest + * @property {Array.|null} [instances] InstanceGroupsAddInstancesRequest instances + */ + + /** + * Constructs a new InstanceGroupsAddInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupsAddInstancesRequest. + * @implements IInstanceGroupsAddInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest=} [properties] Properties to set + */ + function InstanceGroupsAddInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupsAddInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @instance + */ + InstanceGroupsAddInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new InstanceGroupsAddInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupsAddInstancesRequest} InstanceGroupsAddInstancesRequest instance + */ + InstanceGroupsAddInstancesRequest.create = function create(properties) { + return new InstanceGroupsAddInstancesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupsAddInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest} message InstanceGroupsAddInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsAddInstancesRequest.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.compute.v1.InstanceReference.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupsAddInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest} message InstanceGroupsAddInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsAddInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupsAddInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupsAddInstancesRequest} InstanceGroupsAddInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsAddInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.InstanceReference.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupsAddInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupsAddInstancesRequest} InstanceGroupsAddInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsAddInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupsAddInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupsAddInstancesRequest.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.compute.v1.InstanceReference.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupsAddInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupsAddInstancesRequest} InstanceGroupsAddInstancesRequest + */ + InstanceGroupsAddInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.InstanceReference.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupsAddInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupsAddInstancesRequest} message InstanceGroupsAddInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupsAddInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.InstanceReference.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupsAddInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupsAddInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupsAddInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupsAddInstancesRequest; + })(); + + v1.InstanceWithNamedPorts = (function() { + + /** + * Properties of an InstanceWithNamedPorts. + * @memberof google.cloud.compute.v1 + * @interface IInstanceWithNamedPorts + * @property {string|null} [instance] InstanceWithNamedPorts instance + * @property {Array.|null} [namedPorts] InstanceWithNamedPorts namedPorts + * @property {google.cloud.compute.v1.InstanceWithNamedPorts.Status|null} [status] InstanceWithNamedPorts status + */ + + /** + * Constructs a new InstanceWithNamedPorts. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceWithNamedPorts. + * @implements IInstanceWithNamedPorts + * @constructor + * @param {google.cloud.compute.v1.IInstanceWithNamedPorts=} [properties] Properties to set + */ + function InstanceWithNamedPorts(properties) { + this.namedPorts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceWithNamedPorts instance. + * @member {string|null|undefined} instance + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @instance + */ + InstanceWithNamedPorts.prototype.instance = null; + + /** + * InstanceWithNamedPorts namedPorts. + * @member {Array.} namedPorts + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @instance + */ + InstanceWithNamedPorts.prototype.namedPorts = $util.emptyArray; + + /** + * InstanceWithNamedPorts status. + * @member {google.cloud.compute.v1.InstanceWithNamedPorts.Status|null|undefined} status + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @instance + */ + InstanceWithNamedPorts.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceWithNamedPorts _instance. + * @member {"instance"|undefined} _instance + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @instance + */ + Object.defineProperty(InstanceWithNamedPorts.prototype, "_instance", { + get: $util.oneOfGetter($oneOfFields = ["instance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceWithNamedPorts _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @instance + */ + Object.defineProperty(InstanceWithNamedPorts.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceWithNamedPorts instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {google.cloud.compute.v1.IInstanceWithNamedPorts=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceWithNamedPorts} InstanceWithNamedPorts instance + */ + InstanceWithNamedPorts.create = function create(properties) { + return new InstanceWithNamedPorts(properties); + }; + + /** + * Encodes the specified InstanceWithNamedPorts message. Does not implicitly {@link google.cloud.compute.v1.InstanceWithNamedPorts.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {google.cloud.compute.v1.IInstanceWithNamedPorts} message InstanceWithNamedPorts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceWithNamedPorts.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.namedPorts != null && message.namedPorts.length) + for (var i = 0; i < message.namedPorts.length; ++i) + $root.google.cloud.compute.v1.NamedPort.encode(message.namedPorts[i], writer.uint32(/* id 427598732, wireType 2 =*/3420789858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceWithNamedPorts message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceWithNamedPorts.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {google.cloud.compute.v1.IInstanceWithNamedPorts} message InstanceWithNamedPorts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceWithNamedPorts.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceWithNamedPorts message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceWithNamedPorts} InstanceWithNamedPorts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceWithNamedPorts.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceWithNamedPorts(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 427598732: + if (!(message.namedPorts && message.namedPorts.length)) + message.namedPorts = []; + message.namedPorts.push($root.google.cloud.compute.v1.NamedPort.decode(reader, reader.uint32())); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceWithNamedPorts message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceWithNamedPorts} InstanceWithNamedPorts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceWithNamedPorts.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceWithNamedPorts message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceWithNamedPorts.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) { + properties._instance = 1; + if (!$util.isString(message.instance)) + return "instance: string expected"; + } + if (message.namedPorts != null && message.hasOwnProperty("namedPorts")) { + if (!Array.isArray(message.namedPorts)) + return "namedPorts: array expected"; + for (var i = 0; i < message.namedPorts.length; ++i) { + var error = $root.google.cloud.compute.v1.NamedPort.verify(message.namedPorts[i]); + if (error) + return "namedPorts." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 428935662: + case 290896621: + case 413483285: + case 121282975: + case 431072283: + case 444276141: + case 350791796: + case 51223995: + case 514206246: + case 250018339: + break; + } + } + return null; + }; + + /** + * Creates an InstanceWithNamedPorts message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceWithNamedPorts} InstanceWithNamedPorts + */ + InstanceWithNamedPorts.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceWithNamedPorts) + return object; + var message = new $root.google.cloud.compute.v1.InstanceWithNamedPorts(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.namedPorts) { + if (!Array.isArray(object.namedPorts)) + throw TypeError(".google.cloud.compute.v1.InstanceWithNamedPorts.namedPorts: array expected"); + message.namedPorts = []; + for (var i = 0; i < object.namedPorts.length; ++i) { + if (typeof object.namedPorts[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceWithNamedPorts.namedPorts: object expected"); + message.namedPorts[i] = $root.google.cloud.compute.v1.NamedPort.fromObject(object.namedPorts[i]); + } + } + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "DEPROVISIONING": + case 428935662: + message.status = 428935662; + break; + case "PROVISIONING": + case 290896621: + message.status = 290896621; + break; + case "REPAIRING": + case 413483285: + message.status = 413483285; + break; + case "RUNNING": + case 121282975: + message.status = 121282975; + break; + case "STAGING": + case 431072283: + message.status = 431072283; + break; + case "STOPPED": + case 444276141: + message.status = 444276141; + break; + case "STOPPING": + case 350791796: + message.status = 350791796; + break; + case "SUSPENDED": + case 51223995: + message.status = 51223995; + break; + case "SUSPENDING": + case 514206246: + message.status = 514206246; + break; + case "TERMINATED": + case 250018339: + message.status = 250018339; + break; + } + return message; + }; + + /** + * Creates a plain object from an InstanceWithNamedPorts message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @static + * @param {google.cloud.compute.v1.InstanceWithNamedPorts} message InstanceWithNamedPorts + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceWithNamedPorts.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.namedPorts = []; + if (message.instance != null && message.hasOwnProperty("instance")) { + object.instance = message.instance; + if (options.oneofs) + object._instance = "instance"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.InstanceWithNamedPorts.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.namedPorts && message.namedPorts.length) { + object.namedPorts = []; + for (var j = 0; j < message.namedPorts.length; ++j) + object.namedPorts[j] = $root.google.cloud.compute.v1.NamedPort.toObject(message.namedPorts[j], options); + } + return object; + }; + + /** + * Converts this InstanceWithNamedPorts to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceWithNamedPorts + * @instance + * @returns {Object.} JSON object + */ + InstanceWithNamedPorts.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.InstanceWithNamedPorts.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} DEPROVISIONING=428935662 DEPROVISIONING value + * @property {number} PROVISIONING=290896621 PROVISIONING value + * @property {number} REPAIRING=413483285 REPAIRING value + * @property {number} RUNNING=121282975 RUNNING value + * @property {number} STAGING=431072283 STAGING value + * @property {number} STOPPED=444276141 STOPPED value + * @property {number} STOPPING=350791796 STOPPING value + * @property {number} SUSPENDED=51223995 SUSPENDED value + * @property {number} SUSPENDING=514206246 SUSPENDING value + * @property {number} TERMINATED=250018339 TERMINATED value + */ + InstanceWithNamedPorts.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[428935662] = "DEPROVISIONING"] = 428935662; + values[valuesById[290896621] = "PROVISIONING"] = 290896621; + values[valuesById[413483285] = "REPAIRING"] = 413483285; + values[valuesById[121282975] = "RUNNING"] = 121282975; + values[valuesById[431072283] = "STAGING"] = 431072283; + values[valuesById[444276141] = "STOPPED"] = 444276141; + values[valuesById[350791796] = "STOPPING"] = 350791796; + values[valuesById[51223995] = "SUSPENDED"] = 51223995; + values[valuesById[514206246] = "SUSPENDING"] = 514206246; + values[valuesById[250018339] = "TERMINATED"] = 250018339; + return values; + })(); + + return InstanceWithNamedPorts; + })(); + + v1.InstanceGroupsListInstances = (function() { + + /** + * Properties of an InstanceGroupsListInstances. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupsListInstances + * @property {string|null} [id] InstanceGroupsListInstances id + * @property {Array.|null} [items] InstanceGroupsListInstances items + * @property {string|null} [kind] InstanceGroupsListInstances kind + * @property {string|null} [nextPageToken] InstanceGroupsListInstances nextPageToken + * @property {string|null} [selfLink] InstanceGroupsListInstances selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceGroupsListInstances warning + */ + + /** + * Constructs a new InstanceGroupsListInstances. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupsListInstances. + * @implements IInstanceGroupsListInstances + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupsListInstances=} [properties] Properties to set + */ + function InstanceGroupsListInstances(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupsListInstances id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + InstanceGroupsListInstances.prototype.id = null; + + /** + * InstanceGroupsListInstances items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + InstanceGroupsListInstances.prototype.items = $util.emptyArray; + + /** + * InstanceGroupsListInstances kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + InstanceGroupsListInstances.prototype.kind = null; + + /** + * InstanceGroupsListInstances nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + InstanceGroupsListInstances.prototype.nextPageToken = null; + + /** + * InstanceGroupsListInstances selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + InstanceGroupsListInstances.prototype.selfLink = null; + + /** + * InstanceGroupsListInstances warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + InstanceGroupsListInstances.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupsListInstances _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + Object.defineProperty(InstanceGroupsListInstances.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupsListInstances _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + Object.defineProperty(InstanceGroupsListInstances.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupsListInstances _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + Object.defineProperty(InstanceGroupsListInstances.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupsListInstances _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + Object.defineProperty(InstanceGroupsListInstances.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceGroupsListInstances _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + */ + Object.defineProperty(InstanceGroupsListInstances.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupsListInstances instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsListInstances=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupsListInstances} InstanceGroupsListInstances instance + */ + InstanceGroupsListInstances.create = function create(properties) { + return new InstanceGroupsListInstances(properties); + }; + + /** + * Encodes the specified InstanceGroupsListInstances message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstances.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsListInstances} message InstanceGroupsListInstances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsListInstances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceWithNamedPorts.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceGroupsListInstances message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstances.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsListInstances} message InstanceGroupsListInstances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsListInstances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupsListInstances message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupsListInstances} InstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsListInstances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupsListInstances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceWithNamedPorts.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupsListInstances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupsListInstances} InstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsListInstances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupsListInstances message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupsListInstances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceWithNamedPorts.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupsListInstances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupsListInstances} InstanceGroupsListInstances + */ + InstanceGroupsListInstances.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupsListInstances) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupsListInstances(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupsListInstances.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupsListInstances.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceWithNamedPorts.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupsListInstances.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupsListInstances message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.InstanceGroupsListInstances} message InstanceGroupsListInstances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupsListInstances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceWithNamedPorts.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceGroupsListInstances to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupsListInstances + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupsListInstances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupsListInstances; + })(); + + v1.InstanceGroupsListInstancesRequest = (function() { + + /** + * Properties of an InstanceGroupsListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupsListInstancesRequest + * @property {google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState|null} [instanceState] InstanceGroupsListInstancesRequest instanceState + */ + + /** + * Constructs a new InstanceGroupsListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupsListInstancesRequest. + * @implements IInstanceGroupsListInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupsListInstancesRequest=} [properties] Properties to set + */ + function InstanceGroupsListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupsListInstancesRequest instanceState. + * @member {google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState|null|undefined} instanceState + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @instance + */ + InstanceGroupsListInstancesRequest.prototype.instanceState = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupsListInstancesRequest _instanceState. + * @member {"instanceState"|undefined} _instanceState + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @instance + */ + Object.defineProperty(InstanceGroupsListInstancesRequest.prototype, "_instanceState", { + get: $util.oneOfGetter($oneOfFields = ["instanceState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupsListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} InstanceGroupsListInstancesRequest instance + */ + InstanceGroupsListInstancesRequest.create = function create(properties) { + return new InstanceGroupsListInstancesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupsListInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsListInstancesRequest} message InstanceGroupsListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceState != null && Object.hasOwnProperty.call(message, "instanceState")) + writer.uint32(/* id 92223591, wireType 0 =*/737788728).int32(message.instanceState); + return writer; + }; + + /** + * Encodes the specified InstanceGroupsListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsListInstancesRequest} message InstanceGroupsListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupsListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} InstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 92223591: + message.instanceState = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupsListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} InstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupsListInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupsListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceState != null && message.hasOwnProperty("instanceState")) { + properties._instanceState = 1; + switch (message.instanceState) { + default: + return "instanceState: enum value expected"; + case 0: + case 64897: + case 121282975: + break; + } + } + return null; + }; + + /** + * Creates an InstanceGroupsListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} InstanceGroupsListInstancesRequest + */ + InstanceGroupsListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest(); + switch (object.instanceState) { + case "UNDEFINED_INSTANCE_STATE": + case 0: + message.instanceState = 0; + break; + case "ALL": + case 64897: + message.instanceState = 64897; + break; + case "RUNNING": + case 121282975: + message.instanceState = 121282975; + break; + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupsListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} message InstanceGroupsListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupsListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.instanceState != null && message.hasOwnProperty("instanceState")) { + object.instanceState = options.enums === String ? $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState[message.instanceState] : message.instanceState; + if (options.oneofs) + object._instanceState = "instanceState"; + } + return object; + }; + + /** + * Converts this InstanceGroupsListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupsListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupsListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InstanceState enum. + * @name google.cloud.compute.v1.InstanceGroupsListInstancesRequest.InstanceState + * @enum {number} + * @property {number} UNDEFINED_INSTANCE_STATE=0 UNDEFINED_INSTANCE_STATE value + * @property {number} ALL=64897 ALL value + * @property {number} RUNNING=121282975 RUNNING value + */ + InstanceGroupsListInstancesRequest.InstanceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_INSTANCE_STATE"] = 0; + values[valuesById[64897] = "ALL"] = 64897; + values[valuesById[121282975] = "RUNNING"] = 121282975; + return values; + })(); + + return InstanceGroupsListInstancesRequest; + })(); + + v1.InstanceGroupsRemoveInstancesRequest = (function() { + + /** + * Properties of an InstanceGroupsRemoveInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupsRemoveInstancesRequest + * @property {Array.|null} [instances] InstanceGroupsRemoveInstancesRequest instances + */ + + /** + * Constructs a new InstanceGroupsRemoveInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupsRemoveInstancesRequest. + * @implements IInstanceGroupsRemoveInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest=} [properties] Properties to set + */ + function InstanceGroupsRemoveInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupsRemoveInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @instance + */ + InstanceGroupsRemoveInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new InstanceGroupsRemoveInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest} InstanceGroupsRemoveInstancesRequest instance + */ + InstanceGroupsRemoveInstancesRequest.create = function create(properties) { + return new InstanceGroupsRemoveInstancesRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupsRemoveInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest} message InstanceGroupsRemoveInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsRemoveInstancesRequest.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.compute.v1.InstanceReference.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupsRemoveInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest} message InstanceGroupsRemoveInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsRemoveInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupsRemoveInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest} InstanceGroupsRemoveInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsRemoveInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.InstanceReference.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupsRemoveInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest} InstanceGroupsRemoveInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsRemoveInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupsRemoveInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupsRemoveInstancesRequest.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.compute.v1.InstanceReference.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupsRemoveInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest} InstanceGroupsRemoveInstancesRequest + */ + InstanceGroupsRemoveInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.InstanceReference.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupsRemoveInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest} message InstanceGroupsRemoveInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupsRemoveInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.InstanceReference.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupsRemoveInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupsRemoveInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupsRemoveInstancesRequest; + })(); + + v1.InstanceGroupsSetNamedPortsRequest = (function() { + + /** + * Properties of an InstanceGroupsSetNamedPortsRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceGroupsSetNamedPortsRequest + * @property {string|null} [fingerprint] InstanceGroupsSetNamedPortsRequest fingerprint + * @property {Array.|null} [namedPorts] InstanceGroupsSetNamedPortsRequest namedPorts + */ + + /** + * Constructs a new InstanceGroupsSetNamedPortsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupsSetNamedPortsRequest. + * @implements IInstanceGroupsSetNamedPortsRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest=} [properties] Properties to set + */ + function InstanceGroupsSetNamedPortsRequest(properties) { + this.namedPorts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupsSetNamedPortsRequest fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @instance + */ + InstanceGroupsSetNamedPortsRequest.prototype.fingerprint = null; + + /** + * InstanceGroupsSetNamedPortsRequest namedPorts. + * @member {Array.} namedPorts + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @instance + */ + InstanceGroupsSetNamedPortsRequest.prototype.namedPorts = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceGroupsSetNamedPortsRequest _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @instance + */ + Object.defineProperty(InstanceGroupsSetNamedPortsRequest.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceGroupsSetNamedPortsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest} InstanceGroupsSetNamedPortsRequest instance + */ + InstanceGroupsSetNamedPortsRequest.create = function create(properties) { + return new InstanceGroupsSetNamedPortsRequest(properties); + }; + + /** + * Encodes the specified InstanceGroupsSetNamedPortsRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest} message InstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsSetNamedPortsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.namedPorts != null && message.namedPorts.length) + for (var i = 0; i < message.namedPorts.length; ++i) + $root.google.cloud.compute.v1.NamedPort.encode(message.namedPorts[i], writer.uint32(/* id 427598732, wireType 2 =*/3420789858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupsSetNamedPortsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest} message InstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupsSetNamedPortsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupsSetNamedPortsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest} InstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsSetNamedPortsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 234678500: + message.fingerprint = reader.string(); + break; + case 427598732: + if (!(message.namedPorts && message.namedPorts.length)) + message.namedPorts = []; + message.namedPorts.push($root.google.cloud.compute.v1.NamedPort.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupsSetNamedPortsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest} InstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupsSetNamedPortsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupsSetNamedPortsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupsSetNamedPortsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.namedPorts != null && message.hasOwnProperty("namedPorts")) { + if (!Array.isArray(message.namedPorts)) + return "namedPorts: array expected"; + for (var i = 0; i < message.namedPorts.length; ++i) { + var error = $root.google.cloud.compute.v1.NamedPort.verify(message.namedPorts[i]); + if (error) + return "namedPorts." + error; + } + } + return null; + }; + + /** + * Creates an InstanceGroupsSetNamedPortsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest} InstanceGroupsSetNamedPortsRequest + */ + InstanceGroupsSetNamedPortsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.namedPorts) { + if (!Array.isArray(object.namedPorts)) + throw TypeError(".google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.namedPorts: array expected"); + message.namedPorts = []; + for (var i = 0; i < object.namedPorts.length; ++i) { + if (typeof object.namedPorts[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.namedPorts: object expected"); + message.namedPorts[i] = $root.google.cloud.compute.v1.NamedPort.fromObject(object.namedPorts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupsSetNamedPortsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest} message InstanceGroupsSetNamedPortsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupsSetNamedPortsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.namedPorts = []; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.namedPorts && message.namedPorts.length) { + object.namedPorts = []; + for (var j = 0; j < message.namedPorts.length; ++j) + object.namedPorts[j] = $root.google.cloud.compute.v1.NamedPort.toObject(message.namedPorts[j], options); + } + return object; + }; + + /** + * Converts this InstanceGroupsSetNamedPortsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupsSetNamedPortsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceGroupsSetNamedPortsRequest; + })(); + + v1.InstanceList = (function() { + + /** + * Properties of an InstanceList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceList + * @property {string|null} [id] InstanceList id + * @property {Array.|null} [items] InstanceList items + * @property {string|null} [kind] InstanceList kind + * @property {string|null} [nextPageToken] InstanceList nextPageToken + * @property {string|null} [selfLink] InstanceList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceList warning + */ + + /** + * Constructs a new InstanceList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceList. + * @implements IInstanceList + * @constructor + * @param {google.cloud.compute.v1.IInstanceList=} [properties] Properties to set + */ + function InstanceList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + InstanceList.prototype.id = null; + + /** + * InstanceList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + InstanceList.prototype.items = $util.emptyArray; + + /** + * InstanceList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + InstanceList.prototype.kind = null; + + /** + * InstanceList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + InstanceList.prototype.nextPageToken = null; + + /** + * InstanceList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + InstanceList.prototype.selfLink = null; + + /** + * InstanceList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + InstanceList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + Object.defineProperty(InstanceList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + Object.defineProperty(InstanceList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + Object.defineProperty(InstanceList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + Object.defineProperty(InstanceList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceList + * @instance + */ + Object.defineProperty(InstanceList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {google.cloud.compute.v1.IInstanceList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceList} InstanceList instance + */ + InstanceList.create = function create(properties) { + return new InstanceList(properties); + }; + + /** + * Encodes the specified InstanceList message. Does not implicitly {@link google.cloud.compute.v1.InstanceList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {google.cloud.compute.v1.IInstanceList} message InstanceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Instance.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {google.cloud.compute.v1.IInstanceList} message InstanceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceList} InstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Instance.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceList} InstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Instance.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceList} InstanceList + */ + InstanceList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Instance.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceList + * @static + * @param {google.cloud.compute.v1.InstanceList} message InstanceList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Instance.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceList + * @instance + * @returns {Object.} JSON object + */ + InstanceList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceList; + })(); + + v1.Reference = (function() { + + /** + * Properties of a Reference. + * @memberof google.cloud.compute.v1 + * @interface IReference + * @property {string|null} [kind] Reference kind + * @property {string|null} [referenceType] Reference referenceType + * @property {string|null} [referrer] Reference referrer + * @property {string|null} [target] Reference target + */ + + /** + * Constructs a new Reference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Reference. + * @implements IReference + * @constructor + * @param {google.cloud.compute.v1.IReference=} [properties] Properties to set + */ + function Reference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Reference kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Reference.prototype.kind = null; + + /** + * Reference referenceType. + * @member {string|null|undefined} referenceType + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Reference.prototype.referenceType = null; + + /** + * Reference referrer. + * @member {string|null|undefined} referrer + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Reference.prototype.referrer = null; + + /** + * Reference target. + * @member {string|null|undefined} target + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Reference.prototype.target = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Reference _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Object.defineProperty(Reference.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reference _referenceType. + * @member {"referenceType"|undefined} _referenceType + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Object.defineProperty(Reference.prototype, "_referenceType", { + get: $util.oneOfGetter($oneOfFields = ["referenceType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reference _referrer. + * @member {"referrer"|undefined} _referrer + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Object.defineProperty(Reference.prototype, "_referrer", { + get: $util.oneOfGetter($oneOfFields = ["referrer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Reference _target. + * @member {"target"|undefined} _target + * @memberof google.cloud.compute.v1.Reference + * @instance + */ + Object.defineProperty(Reference.prototype, "_target", { + get: $util.oneOfGetter($oneOfFields = ["target"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Reference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {google.cloud.compute.v1.IReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Reference} Reference instance + */ + Reference.create = function create(properties) { + return new Reference(properties); + }; + + /** + * Encodes the specified Reference message. Does not implicitly {@link google.cloud.compute.v1.Reference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {google.cloud.compute.v1.IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 192835985, wireType 2 =*/1542687882).string(message.target); + if (message.referenceType != null && Object.hasOwnProperty.call(message, "referenceType")) + writer.uint32(/* id 247521198, wireType 2 =*/1980169586).string(message.referenceType); + if (message.referrer != null && Object.hasOwnProperty.call(message, "referrer")) + writer.uint32(/* id 351173663, wireType 2 =*/2809389306).string(message.referrer); + return writer; + }; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Reference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {google.cloud.compute.v1.IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Reference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3292052: + message.kind = reader.string(); + break; + case 247521198: + message.referenceType = reader.string(); + break; + case 351173663: + message.referrer = reader.string(); + break; + case 192835985: + message.target = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reference message. + * @function verify + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.referenceType != null && message.hasOwnProperty("referenceType")) { + properties._referenceType = 1; + if (!$util.isString(message.referenceType)) + return "referenceType: string expected"; + } + if (message.referrer != null && message.hasOwnProperty("referrer")) { + properties._referrer = 1; + if (!$util.isString(message.referrer)) + return "referrer: string expected"; + } + if (message.target != null && message.hasOwnProperty("target")) { + properties._target = 1; + if (!$util.isString(message.target)) + return "target: string expected"; + } + return null; + }; + + /** + * Creates a Reference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Reference} Reference + */ + Reference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Reference) + return object; + var message = new $root.google.cloud.compute.v1.Reference(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.referenceType != null) + message.referenceType = String(object.referenceType); + if (object.referrer != null) + message.referrer = String(object.referrer); + if (object.target != null) + message.target = String(object.target); + return message; + }; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Reference + * @static + * @param {google.cloud.compute.v1.Reference} message Reference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.target != null && message.hasOwnProperty("target")) { + object.target = message.target; + if (options.oneofs) + object._target = "target"; + } + if (message.referenceType != null && message.hasOwnProperty("referenceType")) { + object.referenceType = message.referenceType; + if (options.oneofs) + object._referenceType = "referenceType"; + } + if (message.referrer != null && message.hasOwnProperty("referrer")) { + object.referrer = message.referrer; + if (options.oneofs) + object._referrer = "referrer"; + } + return object; + }; + + /** + * Converts this Reference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Reference + * @instance + * @returns {Object.} JSON object + */ + Reference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Reference; + })(); + + v1.InstanceListReferrers = (function() { + + /** + * Properties of an InstanceListReferrers. + * @memberof google.cloud.compute.v1 + * @interface IInstanceListReferrers + * @property {string|null} [id] InstanceListReferrers id + * @property {Array.|null} [items] InstanceListReferrers items + * @property {string|null} [kind] InstanceListReferrers kind + * @property {string|null} [nextPageToken] InstanceListReferrers nextPageToken + * @property {string|null} [selfLink] InstanceListReferrers selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceListReferrers warning + */ + + /** + * Constructs a new InstanceListReferrers. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceListReferrers. + * @implements IInstanceListReferrers + * @constructor + * @param {google.cloud.compute.v1.IInstanceListReferrers=} [properties] Properties to set + */ + function InstanceListReferrers(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceListReferrers id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + InstanceListReferrers.prototype.id = null; + + /** + * InstanceListReferrers items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + InstanceListReferrers.prototype.items = $util.emptyArray; + + /** + * InstanceListReferrers kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + InstanceListReferrers.prototype.kind = null; + + /** + * InstanceListReferrers nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + InstanceListReferrers.prototype.nextPageToken = null; + + /** + * InstanceListReferrers selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + InstanceListReferrers.prototype.selfLink = null; + + /** + * InstanceListReferrers warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + InstanceListReferrers.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceListReferrers _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + Object.defineProperty(InstanceListReferrers.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceListReferrers _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + Object.defineProperty(InstanceListReferrers.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceListReferrers _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + Object.defineProperty(InstanceListReferrers.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceListReferrers _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + Object.defineProperty(InstanceListReferrers.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceListReferrers _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + */ + Object.defineProperty(InstanceListReferrers.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceListReferrers instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {google.cloud.compute.v1.IInstanceListReferrers=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceListReferrers} InstanceListReferrers instance + */ + InstanceListReferrers.create = function create(properties) { + return new InstanceListReferrers(properties); + }; + + /** + * Encodes the specified InstanceListReferrers message. Does not implicitly {@link google.cloud.compute.v1.InstanceListReferrers.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {google.cloud.compute.v1.IInstanceListReferrers} message InstanceListReferrers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceListReferrers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Reference.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceListReferrers message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceListReferrers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {google.cloud.compute.v1.IInstanceListReferrers} message InstanceListReferrers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceListReferrers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceListReferrers message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceListReferrers} InstanceListReferrers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceListReferrers.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceListReferrers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Reference.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceListReferrers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceListReferrers} InstanceListReferrers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceListReferrers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceListReferrers message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceListReferrers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Reference.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceListReferrers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceListReferrers} InstanceListReferrers + */ + InstanceListReferrers.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceListReferrers) + return object; + var message = new $root.google.cloud.compute.v1.InstanceListReferrers(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceListReferrers.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceListReferrers.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Reference.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceListReferrers.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceListReferrers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @static + * @param {google.cloud.compute.v1.InstanceListReferrers} message InstanceListReferrers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceListReferrers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Reference.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceListReferrers to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceListReferrers + * @instance + * @returns {Object.} JSON object + */ + InstanceListReferrers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceListReferrers; + })(); + + v1.InstanceManagedByIgmErrorManagedInstanceError = (function() { + + /** + * Properties of an InstanceManagedByIgmErrorManagedInstanceError. + * @memberof google.cloud.compute.v1 + * @interface IInstanceManagedByIgmErrorManagedInstanceError + * @property {string|null} [code] InstanceManagedByIgmErrorManagedInstanceError code + * @property {string|null} [message] InstanceManagedByIgmErrorManagedInstanceError message + */ + + /** + * Constructs a new InstanceManagedByIgmErrorManagedInstanceError. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceManagedByIgmErrorManagedInstanceError. + * @implements IInstanceManagedByIgmErrorManagedInstanceError + * @constructor + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError=} [properties] Properties to set + */ + function InstanceManagedByIgmErrorManagedInstanceError(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceManagedByIgmErrorManagedInstanceError code. + * @member {string|null|undefined} code + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @instance + */ + InstanceManagedByIgmErrorManagedInstanceError.prototype.code = null; + + /** + * InstanceManagedByIgmErrorManagedInstanceError message. + * @member {string|null|undefined} message + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @instance + */ + InstanceManagedByIgmErrorManagedInstanceError.prototype.message = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceManagedByIgmErrorManagedInstanceError _code. + * @member {"code"|undefined} _code + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @instance + */ + Object.defineProperty(InstanceManagedByIgmErrorManagedInstanceError.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceManagedByIgmErrorManagedInstanceError _message. + * @member {"message"|undefined} _message + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @instance + */ + Object.defineProperty(InstanceManagedByIgmErrorManagedInstanceError.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceManagedByIgmErrorManagedInstanceError instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError} InstanceManagedByIgmErrorManagedInstanceError instance + */ + InstanceManagedByIgmErrorManagedInstanceError.create = function create(properties) { + return new InstanceManagedByIgmErrorManagedInstanceError(properties); + }; + + /** + * Encodes the specified InstanceManagedByIgmErrorManagedInstanceError message. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError} message InstanceManagedByIgmErrorManagedInstanceError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceManagedByIgmErrorManagedInstanceError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 3059181, wireType 2 =*/24473450).string(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 418054151, wireType 2 =*/3344433210).string(message.message); + return writer; + }; + + /** + * Encodes the specified InstanceManagedByIgmErrorManagedInstanceError message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorManagedInstanceError} message InstanceManagedByIgmErrorManagedInstanceError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceManagedByIgmErrorManagedInstanceError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceManagedByIgmErrorManagedInstanceError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError} InstanceManagedByIgmErrorManagedInstanceError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceManagedByIgmErrorManagedInstanceError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3059181: + message.code = reader.string(); + break; + case 418054151: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceManagedByIgmErrorManagedInstanceError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError} InstanceManagedByIgmErrorManagedInstanceError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceManagedByIgmErrorManagedInstanceError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceManagedByIgmErrorManagedInstanceError message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceManagedByIgmErrorManagedInstanceError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.code != null && message.hasOwnProperty("code")) { + properties._code = 1; + if (!$util.isString(message.code)) + return "code: string expected"; + } + if (message.message != null && message.hasOwnProperty("message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + return null; + }; + + /** + * Creates an InstanceManagedByIgmErrorManagedInstanceError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError} InstanceManagedByIgmErrorManagedInstanceError + */ + InstanceManagedByIgmErrorManagedInstanceError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError) + return object; + var message = new $root.google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError(); + if (object.code != null) + message.code = String(object.code); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an InstanceManagedByIgmErrorManagedInstanceError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @static + * @param {google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError} message InstanceManagedByIgmErrorManagedInstanceError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceManagedByIgmErrorManagedInstanceError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.code != null && message.hasOwnProperty("code")) { + object.code = message.code; + if (options.oneofs) + object._code = "code"; + } + if (message.message != null && message.hasOwnProperty("message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; + + /** + * Converts this InstanceManagedByIgmErrorManagedInstanceError to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorManagedInstanceError + * @instance + * @returns {Object.} JSON object + */ + InstanceManagedByIgmErrorManagedInstanceError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceManagedByIgmErrorManagedInstanceError; + })(); + + v1.InstanceManagedByIgmErrorInstanceActionDetails = (function() { + + /** + * Properties of an InstanceManagedByIgmErrorInstanceActionDetails. + * @memberof google.cloud.compute.v1 + * @interface IInstanceManagedByIgmErrorInstanceActionDetails + * @property {google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action|null} [action] InstanceManagedByIgmErrorInstanceActionDetails action + * @property {string|null} [instance] InstanceManagedByIgmErrorInstanceActionDetails instance + * @property {google.cloud.compute.v1.IManagedInstanceVersion|null} [version] InstanceManagedByIgmErrorInstanceActionDetails version + */ + + /** + * Constructs a new InstanceManagedByIgmErrorInstanceActionDetails. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceManagedByIgmErrorInstanceActionDetails. + * @implements IInstanceManagedByIgmErrorInstanceActionDetails + * @constructor + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails=} [properties] Properties to set + */ + function InstanceManagedByIgmErrorInstanceActionDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceManagedByIgmErrorInstanceActionDetails action. + * @member {google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action|null|undefined} action + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @instance + */ + InstanceManagedByIgmErrorInstanceActionDetails.prototype.action = null; + + /** + * InstanceManagedByIgmErrorInstanceActionDetails instance. + * @member {string|null|undefined} instance + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @instance + */ + InstanceManagedByIgmErrorInstanceActionDetails.prototype.instance = null; + + /** + * InstanceManagedByIgmErrorInstanceActionDetails version. + * @member {google.cloud.compute.v1.IManagedInstanceVersion|null|undefined} version + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @instance + */ + InstanceManagedByIgmErrorInstanceActionDetails.prototype.version = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceManagedByIgmErrorInstanceActionDetails _action. + * @member {"action"|undefined} _action + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @instance + */ + Object.defineProperty(InstanceManagedByIgmErrorInstanceActionDetails.prototype, "_action", { + get: $util.oneOfGetter($oneOfFields = ["action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceManagedByIgmErrorInstanceActionDetails _instance. + * @member {"instance"|undefined} _instance + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @instance + */ + Object.defineProperty(InstanceManagedByIgmErrorInstanceActionDetails.prototype, "_instance", { + get: $util.oneOfGetter($oneOfFields = ["instance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceManagedByIgmErrorInstanceActionDetails _version. + * @member {"version"|undefined} _version + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @instance + */ + Object.defineProperty(InstanceManagedByIgmErrorInstanceActionDetails.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceManagedByIgmErrorInstanceActionDetails instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails} InstanceManagedByIgmErrorInstanceActionDetails instance + */ + InstanceManagedByIgmErrorInstanceActionDetails.create = function create(properties) { + return new InstanceManagedByIgmErrorInstanceActionDetails(properties); + }; + + /** + * Encodes the specified InstanceManagedByIgmErrorInstanceActionDetails message. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails} message InstanceManagedByIgmErrorInstanceActionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceManagedByIgmErrorInstanceActionDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 187661878, wireType 0 =*/1501295024).int32(message.action); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.google.cloud.compute.v1.ManagedInstanceVersion.encode(message.version, writer.uint32(/* id 351608024, wireType 2 =*/2812864194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceManagedByIgmErrorInstanceActionDetails message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {google.cloud.compute.v1.IInstanceManagedByIgmErrorInstanceActionDetails} message InstanceManagedByIgmErrorInstanceActionDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceManagedByIgmErrorInstanceActionDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceManagedByIgmErrorInstanceActionDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails} InstanceManagedByIgmErrorInstanceActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceManagedByIgmErrorInstanceActionDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 187661878: + message.action = reader.int32(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 351608024: + message.version = $root.google.cloud.compute.v1.ManagedInstanceVersion.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceManagedByIgmErrorInstanceActionDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails} InstanceManagedByIgmErrorInstanceActionDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceManagedByIgmErrorInstanceActionDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceManagedByIgmErrorInstanceActionDetails message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceManagedByIgmErrorInstanceActionDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) { + properties._action = 1; + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 388244813: + case 455564985: + case 428843785: + case 528602024: + case 2402104: + case 287278572: + case 163266343: + case 320534387: + case 16982185: + break; + } + } + if (message.instance != null && message.hasOwnProperty("instance")) { + properties._instance = 1; + if (!$util.isString(message.instance)) + return "instance: string expected"; + } + if (message.version != null && message.hasOwnProperty("version")) { + properties._version = 1; + { + var error = $root.google.cloud.compute.v1.ManagedInstanceVersion.verify(message.version); + if (error) + return "version." + error; + } + } + return null; + }; + + /** + * Creates an InstanceManagedByIgmErrorInstanceActionDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails} InstanceManagedByIgmErrorInstanceActionDetails + */ + InstanceManagedByIgmErrorInstanceActionDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails) + return object; + var message = new $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails(); + switch (object.action) { + case "UNDEFINED_ACTION": + case 0: + message.action = 0; + break; + case "ABANDONING": + case 388244813: + message.action = 388244813; + break; + case "CREATING": + case 455564985: + message.action = 455564985; + break; + case "CREATING_WITHOUT_RETRIES": + case 428843785: + message.action = 428843785; + break; + case "DELETING": + case 528602024: + message.action = 528602024; + break; + case "NONE": + case 2402104: + message.action = 2402104; + break; + case "RECREATING": + case 287278572: + message.action = 287278572; + break; + case "REFRESHING": + case 163266343: + message.action = 163266343; + break; + case "RESTARTING": + case 320534387: + message.action = 320534387; + break; + case "VERIFYING": + case 16982185: + message.action = 16982185; + break; + } + if (object.instance != null) + message.instance = String(object.instance); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.version: object expected"); + message.version = $root.google.cloud.compute.v1.ManagedInstanceVersion.fromObject(object.version); + } + return message; + }; + + /** + * Creates a plain object from an InstanceManagedByIgmErrorInstanceActionDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @static + * @param {google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails} message InstanceManagedByIgmErrorInstanceActionDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceManagedByIgmErrorInstanceActionDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.instance != null && message.hasOwnProperty("instance")) { + object.instance = message.instance; + if (options.oneofs) + object._instance = "instance"; + } + if (message.action != null && message.hasOwnProperty("action")) { + object.action = options.enums === String ? $root.google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action[message.action] : message.action; + if (options.oneofs) + object._action = "action"; + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = $root.google.cloud.compute.v1.ManagedInstanceVersion.toObject(message.version, options); + if (options.oneofs) + object._version = "version"; + } + return object; + }; + + /** + * Converts this InstanceManagedByIgmErrorInstanceActionDetails to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails + * @instance + * @returns {Object.} JSON object + */ + InstanceManagedByIgmErrorInstanceActionDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.cloud.compute.v1.InstanceManagedByIgmErrorInstanceActionDetails.Action + * @enum {number} + * @property {number} UNDEFINED_ACTION=0 UNDEFINED_ACTION value + * @property {number} ABANDONING=388244813 ABANDONING value + * @property {number} CREATING=455564985 CREATING value + * @property {number} CREATING_WITHOUT_RETRIES=428843785 CREATING_WITHOUT_RETRIES value + * @property {number} DELETING=528602024 DELETING value + * @property {number} NONE=2402104 NONE value + * @property {number} RECREATING=287278572 RECREATING value + * @property {number} REFRESHING=163266343 REFRESHING value + * @property {number} RESTARTING=320534387 RESTARTING value + * @property {number} VERIFYING=16982185 VERIFYING value + */ + InstanceManagedByIgmErrorInstanceActionDetails.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ACTION"] = 0; + values[valuesById[388244813] = "ABANDONING"] = 388244813; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[428843785] = "CREATING_WITHOUT_RETRIES"] = 428843785; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[287278572] = "RECREATING"] = 287278572; + values[valuesById[163266343] = "REFRESHING"] = 163266343; + values[valuesById[320534387] = "RESTARTING"] = 320534387; + values[valuesById[16982185] = "VERIFYING"] = 16982185; + return values; + })(); + + return InstanceManagedByIgmErrorInstanceActionDetails; + })(); + + v1.ManagedInstanceVersion = (function() { + + /** + * Properties of a ManagedInstanceVersion. + * @memberof google.cloud.compute.v1 + * @interface IManagedInstanceVersion + * @property {string|null} [instanceTemplate] ManagedInstanceVersion instanceTemplate + * @property {string|null} [name] ManagedInstanceVersion name + */ + + /** + * Constructs a new ManagedInstanceVersion. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ManagedInstanceVersion. + * @implements IManagedInstanceVersion + * @constructor + * @param {google.cloud.compute.v1.IManagedInstanceVersion=} [properties] Properties to set + */ + function ManagedInstanceVersion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedInstanceVersion instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @instance + */ + ManagedInstanceVersion.prototype.instanceTemplate = null; + + /** + * ManagedInstanceVersion name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @instance + */ + ManagedInstanceVersion.prototype.name = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ManagedInstanceVersion _instanceTemplate. + * @member {"instanceTemplate"|undefined} _instanceTemplate + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @instance + */ + Object.defineProperty(ManagedInstanceVersion.prototype, "_instanceTemplate", { + get: $util.oneOfGetter($oneOfFields = ["instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstanceVersion _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @instance + */ + Object.defineProperty(ManagedInstanceVersion.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ManagedInstanceVersion instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {google.cloud.compute.v1.IManagedInstanceVersion=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ManagedInstanceVersion} ManagedInstanceVersion instance + */ + ManagedInstanceVersion.create = function create(properties) { + return new ManagedInstanceVersion(properties); + }; + + /** + * Encodes the specified ManagedInstanceVersion message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceVersion.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {google.cloud.compute.v1.IManagedInstanceVersion} message ManagedInstanceVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstanceVersion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 309248228, wireType 2 =*/2473985826).string(message.instanceTemplate); + return writer; + }; + + /** + * Encodes the specified ManagedInstanceVersion message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceVersion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {google.cloud.compute.v1.IManagedInstanceVersion} message ManagedInstanceVersion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstanceVersion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedInstanceVersion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ManagedInstanceVersion} ManagedInstanceVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstanceVersion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ManagedInstanceVersion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 309248228: + message.instanceTemplate = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedInstanceVersion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ManagedInstanceVersion} ManagedInstanceVersion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstanceVersion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedInstanceVersion message. + * @function verify + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedInstanceVersion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + properties._instanceTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a ManagedInstanceVersion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ManagedInstanceVersion} ManagedInstanceVersion + */ + ManagedInstanceVersion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ManagedInstanceVersion) + return object; + var message = new $root.google.cloud.compute.v1.ManagedInstanceVersion(); + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ManagedInstanceVersion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @static + * @param {google.cloud.compute.v1.ManagedInstanceVersion} message ManagedInstanceVersion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedInstanceVersion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object._instanceTemplate = "instanceTemplate"; + } + return object; + }; + + /** + * Converts this ManagedInstanceVersion to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ManagedInstanceVersion + * @instance + * @returns {Object.} JSON object + */ + ManagedInstanceVersion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ManagedInstanceVersion; + })(); + + v1.InstanceMoveRequest = (function() { + + /** + * Properties of an InstanceMoveRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstanceMoveRequest + * @property {string|null} [destinationZone] InstanceMoveRequest destinationZone + * @property {string|null} [targetInstance] InstanceMoveRequest targetInstance + */ + + /** + * Constructs a new InstanceMoveRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceMoveRequest. + * @implements IInstanceMoveRequest + * @constructor + * @param {google.cloud.compute.v1.IInstanceMoveRequest=} [properties] Properties to set + */ + function InstanceMoveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceMoveRequest destinationZone. + * @member {string|null|undefined} destinationZone + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @instance + */ + InstanceMoveRequest.prototype.destinationZone = null; + + /** + * InstanceMoveRequest targetInstance. + * @member {string|null|undefined} targetInstance + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @instance + */ + InstanceMoveRequest.prototype.targetInstance = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceMoveRequest _destinationZone. + * @member {"destinationZone"|undefined} _destinationZone + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @instance + */ + Object.defineProperty(InstanceMoveRequest.prototype, "_destinationZone", { + get: $util.oneOfGetter($oneOfFields = ["destinationZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceMoveRequest _targetInstance. + * @member {"targetInstance"|undefined} _targetInstance + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @instance + */ + Object.defineProperty(InstanceMoveRequest.prototype, "_targetInstance", { + get: $util.oneOfGetter($oneOfFields = ["targetInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceMoveRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {google.cloud.compute.v1.IInstanceMoveRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceMoveRequest} InstanceMoveRequest instance + */ + InstanceMoveRequest.create = function create(properties) { + return new InstanceMoveRequest(properties); + }; + + /** + * Encodes the specified InstanceMoveRequest message. Does not implicitly {@link google.cloud.compute.v1.InstanceMoveRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {google.cloud.compute.v1.IInstanceMoveRequest} message InstanceMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMoveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationZone != null && Object.hasOwnProperty.call(message, "destinationZone")) + writer.uint32(/* id 131854653, wireType 2 =*/1054837226).string(message.destinationZone); + if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) + writer.uint32(/* id 289769347, wireType 2 =*/2318154778).string(message.targetInstance); + return writer; + }; + + /** + * Encodes the specified InstanceMoveRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceMoveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {google.cloud.compute.v1.IInstanceMoveRequest} message InstanceMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceMoveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceMoveRequest} InstanceMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMoveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceMoveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 131854653: + message.destinationZone = reader.string(); + break; + case 289769347: + message.targetInstance = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceMoveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceMoveRequest} InstanceMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceMoveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceMoveRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceMoveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.destinationZone != null && message.hasOwnProperty("destinationZone")) { + properties._destinationZone = 1; + if (!$util.isString(message.destinationZone)) + return "destinationZone: string expected"; + } + if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) { + properties._targetInstance = 1; + if (!$util.isString(message.targetInstance)) + return "targetInstance: string expected"; + } + return null; + }; + + /** + * Creates an InstanceMoveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceMoveRequest} InstanceMoveRequest + */ + InstanceMoveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceMoveRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstanceMoveRequest(); + if (object.destinationZone != null) + message.destinationZone = String(object.destinationZone); + if (object.targetInstance != null) + message.targetInstance = String(object.targetInstance); + return message; + }; + + /** + * Creates a plain object from an InstanceMoveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @static + * @param {google.cloud.compute.v1.InstanceMoveRequest} message InstanceMoveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceMoveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.destinationZone != null && message.hasOwnProperty("destinationZone")) { + object.destinationZone = message.destinationZone; + if (options.oneofs) + object._destinationZone = "destinationZone"; + } + if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) { + object.targetInstance = message.targetInstance; + if (options.oneofs) + object._targetInstance = "targetInstance"; + } + return object; + }; + + /** + * Converts this InstanceMoveRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceMoveRequest + * @instance + * @returns {Object.} JSON object + */ + InstanceMoveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceMoveRequest; + })(); + + v1.SourceInstanceParams = (function() { + + /** + * Properties of a SourceInstanceParams. + * @memberof google.cloud.compute.v1 + * @interface ISourceInstanceParams + * @property {Array.|null} [diskConfigs] SourceInstanceParams diskConfigs + */ + + /** + * Constructs a new SourceInstanceParams. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SourceInstanceParams. + * @implements ISourceInstanceParams + * @constructor + * @param {google.cloud.compute.v1.ISourceInstanceParams=} [properties] Properties to set + */ + function SourceInstanceParams(properties) { + this.diskConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceInstanceParams diskConfigs. + * @member {Array.} diskConfigs + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @instance + */ + SourceInstanceParams.prototype.diskConfigs = $util.emptyArray; + + /** + * Creates a new SourceInstanceParams instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {google.cloud.compute.v1.ISourceInstanceParams=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SourceInstanceParams} SourceInstanceParams instance + */ + SourceInstanceParams.create = function create(properties) { + return new SourceInstanceParams(properties); + }; + + /** + * Encodes the specified SourceInstanceParams message. Does not implicitly {@link google.cloud.compute.v1.SourceInstanceParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {google.cloud.compute.v1.ISourceInstanceParams} message SourceInstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceInstanceParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskConfigs != null && message.diskConfigs.length) + for (var i = 0; i < message.diskConfigs.length; ++i) + $root.google.cloud.compute.v1.DiskInstantiationConfig.encode(message.diskConfigs[i], writer.uint32(/* id 235580623, wireType 2 =*/1884644986).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceInstanceParams message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SourceInstanceParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {google.cloud.compute.v1.ISourceInstanceParams} message SourceInstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceInstanceParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceInstanceParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SourceInstanceParams} SourceInstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceInstanceParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SourceInstanceParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 235580623: + if (!(message.diskConfigs && message.diskConfigs.length)) + message.diskConfigs = []; + message.diskConfigs.push($root.google.cloud.compute.v1.DiskInstantiationConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceInstanceParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SourceInstanceParams} SourceInstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceInstanceParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceInstanceParams message. + * @function verify + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceInstanceParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.diskConfigs != null && message.hasOwnProperty("diskConfigs")) { + if (!Array.isArray(message.diskConfigs)) + return "diskConfigs: array expected"; + for (var i = 0; i < message.diskConfigs.length; ++i) { + var error = $root.google.cloud.compute.v1.DiskInstantiationConfig.verify(message.diskConfigs[i]); + if (error) + return "diskConfigs." + error; + } + } + return null; + }; + + /** + * Creates a SourceInstanceParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SourceInstanceParams} SourceInstanceParams + */ + SourceInstanceParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SourceInstanceParams) + return object; + var message = new $root.google.cloud.compute.v1.SourceInstanceParams(); + if (object.diskConfigs) { + if (!Array.isArray(object.diskConfigs)) + throw TypeError(".google.cloud.compute.v1.SourceInstanceParams.diskConfigs: array expected"); + message.diskConfigs = []; + for (var i = 0; i < object.diskConfigs.length; ++i) { + if (typeof object.diskConfigs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SourceInstanceParams.diskConfigs: object expected"); + message.diskConfigs[i] = $root.google.cloud.compute.v1.DiskInstantiationConfig.fromObject(object.diskConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceInstanceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @static + * @param {google.cloud.compute.v1.SourceInstanceParams} message SourceInstanceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceInstanceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.diskConfigs = []; + if (message.diskConfigs && message.diskConfigs.length) { + object.diskConfigs = []; + for (var j = 0; j < message.diskConfigs.length; ++j) + object.diskConfigs[j] = $root.google.cloud.compute.v1.DiskInstantiationConfig.toObject(message.diskConfigs[j], options); + } + return object; + }; + + /** + * Converts this SourceInstanceParams to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SourceInstanceParams + * @instance + * @returns {Object.} JSON object + */ + SourceInstanceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SourceInstanceParams; + })(); + + v1.InstanceTemplate = (function() { + + /** + * Properties of an InstanceTemplate. + * @memberof google.cloud.compute.v1 + * @interface IInstanceTemplate + * @property {string|null} [creationTimestamp] InstanceTemplate creationTimestamp + * @property {string|null} [description] InstanceTemplate description + * @property {number|Long|null} [id] InstanceTemplate id + * @property {string|null} [kind] InstanceTemplate kind + * @property {string|null} [name] InstanceTemplate name + * @property {google.cloud.compute.v1.IInstanceProperties|null} [properties] InstanceTemplate properties + * @property {string|null} [selfLink] InstanceTemplate selfLink + * @property {string|null} [sourceInstance] InstanceTemplate sourceInstance + * @property {google.cloud.compute.v1.ISourceInstanceParams|null} [sourceInstanceParams] InstanceTemplate sourceInstanceParams + */ + + /** + * Constructs a new InstanceTemplate. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceTemplate. + * @implements IInstanceTemplate + * @constructor + * @param {google.cloud.compute.v1.IInstanceTemplate=} [properties] Properties to set + */ + function InstanceTemplate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceTemplate creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.creationTimestamp = null; + + /** + * InstanceTemplate description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.description = null; + + /** + * InstanceTemplate id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.id = null; + + /** + * InstanceTemplate kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.kind = null; + + /** + * InstanceTemplate name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.name = null; + + /** + * InstanceTemplate properties. + * @member {google.cloud.compute.v1.IInstanceProperties|null|undefined} properties + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.properties = null; + + /** + * InstanceTemplate selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.selfLink = null; + + /** + * InstanceTemplate sourceInstance. + * @member {string|null|undefined} sourceInstance + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.sourceInstance = null; + + /** + * InstanceTemplate sourceInstanceParams. + * @member {google.cloud.compute.v1.ISourceInstanceParams|null|undefined} sourceInstanceParams + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + InstanceTemplate.prototype.sourceInstanceParams = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceTemplate _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _properties. + * @member {"properties"|undefined} _properties + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_properties", { + get: $util.oneOfGetter($oneOfFields = ["properties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _sourceInstance. + * @member {"sourceInstance"|undefined} _sourceInstance + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_sourceInstance", { + get: $util.oneOfGetter($oneOfFields = ["sourceInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplate _sourceInstanceParams. + * @member {"sourceInstanceParams"|undefined} _sourceInstanceParams + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + */ + Object.defineProperty(InstanceTemplate.prototype, "_sourceInstanceParams", { + get: $util.oneOfGetter($oneOfFields = ["sourceInstanceParams"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {google.cloud.compute.v1.IInstanceTemplate=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceTemplate} InstanceTemplate instance + */ + InstanceTemplate.create = function create(properties) { + return new InstanceTemplate(properties); + }; + + /** + * Encodes the specified InstanceTemplate message. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {google.cloud.compute.v1.IInstanceTemplate} message InstanceTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.sourceInstanceParams != null && Object.hasOwnProperty.call(message, "sourceInstanceParams")) + $root.google.cloud.compute.v1.SourceInstanceParams.encode(message.sourceInstanceParams, writer.uint32(/* id 135342156, wireType 2 =*/1082737250).fork()).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + $root.google.cloud.compute.v1.InstanceProperties.encode(message.properties, writer.uint32(/* id 147688755, wireType 2 =*/1181510042).fork()).ldelim(); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 396315705, wireType 2 =*/3170525642).string(message.sourceInstance); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceTemplate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {google.cloud.compute.v1.IInstanceTemplate} message InstanceTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceTemplate} InstanceTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceTemplate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 147688755: + message.properties = $root.google.cloud.compute.v1.InstanceProperties.decode(reader, reader.uint32()); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 396315705: + message.sourceInstance = reader.string(); + break; + case 135342156: + message.sourceInstanceParams = $root.google.cloud.compute.v1.SourceInstanceParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceTemplate} InstanceTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceTemplate message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + properties._properties = 1; + { + var error = $root.google.cloud.compute.v1.InstanceProperties.verify(message.properties); + if (error) + return "properties." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + properties._sourceInstance = 1; + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: string expected"; + } + if (message.sourceInstanceParams != null && message.hasOwnProperty("sourceInstanceParams")) { + properties._sourceInstanceParams = 1; + { + var error = $root.google.cloud.compute.v1.SourceInstanceParams.verify(message.sourceInstanceParams); + if (error) + return "sourceInstanceParams." + error; + } + } + return null; + }; + + /** + * Creates an InstanceTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceTemplate} InstanceTemplate + */ + InstanceTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceTemplate) + return object; + var message = new $root.google.cloud.compute.v1.InstanceTemplate(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.properties != null) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceTemplate.properties: object expected"); + message.properties = $root.google.cloud.compute.v1.InstanceProperties.fromObject(object.properties); + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.sourceInstanceParams != null) { + if (typeof object.sourceInstanceParams !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceTemplate.sourceInstanceParams: object expected"); + message.sourceInstanceParams = $root.google.cloud.compute.v1.SourceInstanceParams.fromObject(object.sourceInstanceParams); + } + return message; + }; + + /** + * Creates a plain object from an InstanceTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceTemplate + * @static + * @param {google.cloud.compute.v1.InstanceTemplate} message InstanceTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.sourceInstanceParams != null && message.hasOwnProperty("sourceInstanceParams")) { + object.sourceInstanceParams = $root.google.cloud.compute.v1.SourceInstanceParams.toObject(message.sourceInstanceParams, options); + if (options.oneofs) + object._sourceInstanceParams = "sourceInstanceParams"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + object.properties = $root.google.cloud.compute.v1.InstanceProperties.toObject(message.properties, options); + if (options.oneofs) + object._properties = "properties"; + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + object.sourceInstance = message.sourceInstance; + if (options.oneofs) + object._sourceInstance = "sourceInstance"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceTemplate to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceTemplate + * @instance + * @returns {Object.} JSON object + */ + InstanceTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceTemplate; + })(); + + v1.InstanceTemplateList = (function() { + + /** + * Properties of an InstanceTemplateList. + * @memberof google.cloud.compute.v1 + * @interface IInstanceTemplateList + * @property {string|null} [id] InstanceTemplateList id + * @property {Array.|null} [items] InstanceTemplateList items + * @property {string|null} [kind] InstanceTemplateList kind + * @property {string|null} [nextPageToken] InstanceTemplateList nextPageToken + * @property {string|null} [selfLink] InstanceTemplateList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InstanceTemplateList warning + */ + + /** + * Constructs a new InstanceTemplateList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceTemplateList. + * @implements IInstanceTemplateList + * @constructor + * @param {google.cloud.compute.v1.IInstanceTemplateList=} [properties] Properties to set + */ + function InstanceTemplateList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceTemplateList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + InstanceTemplateList.prototype.id = null; + + /** + * InstanceTemplateList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + InstanceTemplateList.prototype.items = $util.emptyArray; + + /** + * InstanceTemplateList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + InstanceTemplateList.prototype.kind = null; + + /** + * InstanceTemplateList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + InstanceTemplateList.prototype.nextPageToken = null; + + /** + * InstanceTemplateList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + InstanceTemplateList.prototype.selfLink = null; + + /** + * InstanceTemplateList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + InstanceTemplateList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstanceTemplateList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + Object.defineProperty(InstanceTemplateList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplateList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + Object.defineProperty(InstanceTemplateList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplateList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + Object.defineProperty(InstanceTemplateList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplateList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + Object.defineProperty(InstanceTemplateList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstanceTemplateList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + */ + Object.defineProperty(InstanceTemplateList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceTemplateList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {google.cloud.compute.v1.IInstanceTemplateList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstanceTemplateList} InstanceTemplateList instance + */ + InstanceTemplateList.create = function create(properties) { + return new InstanceTemplateList(properties); + }; + + /** + * Encodes the specified InstanceTemplateList message. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplateList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {google.cloud.compute.v1.IInstanceTemplateList} message InstanceTemplateList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceTemplateList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceTemplate.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InstanceTemplateList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstanceTemplateList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {google.cloud.compute.v1.IInstanceTemplateList} message InstanceTemplateList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceTemplateList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceTemplateList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstanceTemplateList} InstanceTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceTemplateList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstanceTemplateList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceTemplate.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceTemplateList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstanceTemplateList} InstanceTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceTemplateList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceTemplateList message. + * @function verify + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceTemplateList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceTemplate.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InstanceTemplateList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstanceTemplateList} InstanceTemplateList + */ + InstanceTemplateList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstanceTemplateList) + return object; + var message = new $root.google.cloud.compute.v1.InstanceTemplateList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InstanceTemplateList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceTemplateList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceTemplate.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InstanceTemplateList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InstanceTemplateList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @static + * @param {google.cloud.compute.v1.InstanceTemplateList} message InstanceTemplateList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceTemplateList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceTemplate.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InstanceTemplateList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstanceTemplateList + * @instance + * @returns {Object.} JSON object + */ + InstanceTemplateList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstanceTemplateList; + })(); + + v1.InstancesAddResourcePoliciesRequest = (function() { + + /** + * Properties of an InstancesAddResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesAddResourcePoliciesRequest + * @property {Array.|null} [resourcePolicies] InstancesAddResourcePoliciesRequest resourcePolicies + */ + + /** + * Constructs a new InstancesAddResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesAddResourcePoliciesRequest. + * @implements IInstancesAddResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest=} [properties] Properties to set + */ + function InstancesAddResourcePoliciesRequest(properties) { + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesAddResourcePoliciesRequest resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @instance + */ + InstancesAddResourcePoliciesRequest.prototype.resourcePolicies = $util.emptyArray; + + /** + * Creates a new InstancesAddResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesAddResourcePoliciesRequest} InstancesAddResourcePoliciesRequest instance + */ + InstancesAddResourcePoliciesRequest.create = function create(properties) { + return new InstancesAddResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified InstancesAddResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest} message InstancesAddResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesAddResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + return writer; + }; + + /** + * Encodes the specified InstancesAddResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest} message InstancesAddResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesAddResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesAddResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesAddResourcePoliciesRequest} InstancesAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesAddResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesAddResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesAddResourcePoliciesRequest} InstancesAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesAddResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesAddResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesAddResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + return null; + }; + + /** + * Creates an InstancesAddResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesAddResourcePoliciesRequest} InstancesAddResourcePoliciesRequest + */ + InstancesAddResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstancesAddResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.InstancesAddResourcePoliciesRequest} message InstancesAddResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesAddResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + return object; + }; + + /** + * Converts this InstancesAddResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesAddResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesAddResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesAddResourcePoliciesRequest; + })(); + + v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy = (function() { + + /** + * Properties of an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @memberof google.cloud.compute.v1 + * @interface IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @property {string|null} [displayName] InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName + * @property {string|null} [name] InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name + * @property {Array.|null} [rules] InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules + * @property {string|null} [shortName] InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName + * @property {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null} [type] InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy type + */ + + /** + * Constructs a new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @implements IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @constructor + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy=} [properties] Properties to set + */ + function InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(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]]; + } + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName. + * @member {string|null|undefined} displayName + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.displayName = null; + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.name = null; + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules. + * @member {Array.} rules + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.rules = $util.emptyArray; + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName. + * @member {string|null|undefined} shortName + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.shortName = null; + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy type. + * @member {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null|undefined} type + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _shortName. + * @member {"shortName"|undefined} _shortName + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_shortName", { + get: $util.oneOfGetter($oneOfFields = ["shortName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy} InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.create = function create(properties) { + return new InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(properties); + }; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy} message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4473832, wireType 2 =*/35790658).string(message.displayName); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.compute.v1.FirewallPolicyRule.encode(message.rules[i], writer.uint32(/* id 108873975, wireType 2 =*/870991802).fork()).ldelim(); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 492051566, wireType 2 =*/3936412530).string(message.shortName); + return writer; + }; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy} message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy} InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4473832: + message.displayName = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 108873975: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.compute.v1.FirewallPolicyRule.decode(reader, reader.uint32())); + break; + case 492051566: + message.shortName = reader.string(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy} InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string 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.cloud.compute.v1.FirewallPolicyRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + properties._shortName = 1; + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 69902869: + case 526786327: + break; + } + } + return null; + }; + + /** + * Creates an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy} InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy) + return object; + var message = new $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.name != null) + message.name = String(object.name); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.rules: object expected"); + message.rules[i] = $root.google.cloud.compute.v1.FirewallPolicyRule.fromObject(object.rules[i]); + } + } + if (object.shortName != null) + message.shortName = String(object.shortName); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "HIERARCHY": + case 69902869: + message.type = 69902869; + break; + case "UNSPECIFIED": + case 526786327: + message.type = 526786327; + break; + } + return message; + }; + + /** + * Creates a plain object from an InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy} message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.compute.v1.FirewallPolicyRule.toObject(message.rules[j], options); + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + object.shortName = message.shortName; + if (options.oneofs) + object._shortName = "shortName"; + } + return object; + }; + + /** + * Converts this InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + * @returns {Object.} JSON object + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} HIERARCHY=69902869 HIERARCHY value + * @property {number} UNSPECIFIED=526786327 UNSPECIFIED value + */ + InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[69902869] = "HIERARCHY"] = 69902869; + values[valuesById[526786327] = "UNSPECIFIED"] = 526786327; + return values; + })(); + + return InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + })(); + + v1.InstancesGetEffectiveFirewallsResponse = (function() { + + /** + * Properties of an InstancesGetEffectiveFirewallsResponse. + * @memberof google.cloud.compute.v1 + * @interface IInstancesGetEffectiveFirewallsResponse + * @property {Array.|null} [firewallPolicys] InstancesGetEffectiveFirewallsResponse firewallPolicys + * @property {Array.|null} [firewalls] InstancesGetEffectiveFirewallsResponse firewalls + */ + + /** + * Constructs a new InstancesGetEffectiveFirewallsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesGetEffectiveFirewallsResponse. + * @implements IInstancesGetEffectiveFirewallsResponse + * @constructor + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse=} [properties] Properties to set + */ + function InstancesGetEffectiveFirewallsResponse(properties) { + this.firewallPolicys = []; + this.firewalls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesGetEffectiveFirewallsResponse firewallPolicys. + * @member {Array.} firewallPolicys + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @instance + */ + InstancesGetEffectiveFirewallsResponse.prototype.firewallPolicys = $util.emptyArray; + + /** + * InstancesGetEffectiveFirewallsResponse firewalls. + * @member {Array.} firewalls + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @instance + */ + InstancesGetEffectiveFirewallsResponse.prototype.firewalls = $util.emptyArray; + + /** + * Creates a new InstancesGetEffectiveFirewallsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse} InstancesGetEffectiveFirewallsResponse instance + */ + InstancesGetEffectiveFirewallsResponse.create = function create(properties) { + return new InstancesGetEffectiveFirewallsResponse(properties); + }; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponse message. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse} message InstancesGetEffectiveFirewallsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesGetEffectiveFirewallsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firewalls != null && message.firewalls.length) + for (var i = 0; i < message.firewalls.length; ++i) + $root.google.cloud.compute.v1.Firewall.encode(message.firewalls[i], writer.uint32(/* id 272245619, wireType 2 =*/2177964954).fork()).ldelim(); + if (message.firewallPolicys != null && message.firewallPolicys.length) + for (var i = 0; i < message.firewallPolicys.length; ++i) + $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.encode(message.firewallPolicys[i], writer.uint32(/* id 410985794, wireType 2 =*/3287886354).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancesGetEffectiveFirewallsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse} message InstancesGetEffectiveFirewallsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesGetEffectiveFirewallsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse} InstancesGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesGetEffectiveFirewallsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 410985794: + if (!(message.firewallPolicys && message.firewallPolicys.length)) + message.firewallPolicys = []; + message.firewallPolicys.push($root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.decode(reader, reader.uint32())); + break; + case 272245619: + if (!(message.firewalls && message.firewalls.length)) + message.firewalls = []; + message.firewalls.push($root.google.cloud.compute.v1.Firewall.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesGetEffectiveFirewallsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse} InstancesGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesGetEffectiveFirewallsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesGetEffectiveFirewallsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesGetEffectiveFirewallsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firewallPolicys != null && message.hasOwnProperty("firewallPolicys")) { + if (!Array.isArray(message.firewallPolicys)) + return "firewallPolicys: array expected"; + for (var i = 0; i < message.firewallPolicys.length; ++i) { + var error = $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify(message.firewallPolicys[i]); + if (error) + return "firewallPolicys." + error; + } + } + if (message.firewalls != null && message.hasOwnProperty("firewalls")) { + if (!Array.isArray(message.firewalls)) + return "firewalls: array expected"; + for (var i = 0; i < message.firewalls.length; ++i) { + var error = $root.google.cloud.compute.v1.Firewall.verify(message.firewalls[i]); + if (error) + return "firewalls." + error; + } + } + return null; + }; + + /** + * Creates an InstancesGetEffectiveFirewallsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse} InstancesGetEffectiveFirewallsResponse + */ + InstancesGetEffectiveFirewallsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse) + return object; + var message = new $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse(); + if (object.firewallPolicys) { + if (!Array.isArray(object.firewallPolicys)) + throw TypeError(".google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.firewallPolicys: array expected"); + message.firewallPolicys = []; + for (var i = 0; i < object.firewallPolicys.length; ++i) { + if (typeof object.firewallPolicys[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.firewallPolicys: object expected"); + message.firewallPolicys[i] = $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.fromObject(object.firewallPolicys[i]); + } + } + if (object.firewalls) { + if (!Array.isArray(object.firewalls)) + throw TypeError(".google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.firewalls: array expected"); + message.firewalls = []; + for (var i = 0; i < object.firewalls.length; ++i) { + if (typeof object.firewalls[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse.firewalls: object expected"); + message.firewalls[i] = $root.google.cloud.compute.v1.Firewall.fromObject(object.firewalls[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstancesGetEffectiveFirewallsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse} message InstancesGetEffectiveFirewallsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesGetEffectiveFirewallsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.firewalls = []; + object.firewallPolicys = []; + } + if (message.firewalls && message.firewalls.length) { + object.firewalls = []; + for (var j = 0; j < message.firewalls.length; ++j) + object.firewalls[j] = $root.google.cloud.compute.v1.Firewall.toObject(message.firewalls[j], options); + } + if (message.firewallPolicys && message.firewallPolicys.length) { + object.firewallPolicys = []; + for (var j = 0; j < message.firewallPolicys.length; ++j) + object.firewallPolicys[j] = $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy.toObject(message.firewallPolicys[j], options); + } + return object; + }; + + /** + * Converts this InstancesGetEffectiveFirewallsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse + * @instance + * @returns {Object.} JSON object + */ + InstancesGetEffectiveFirewallsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesGetEffectiveFirewallsResponse; + })(); + + v1.InstancesRemoveResourcePoliciesRequest = (function() { + + /** + * Properties of an InstancesRemoveResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesRemoveResourcePoliciesRequest + * @property {Array.|null} [resourcePolicies] InstancesRemoveResourcePoliciesRequest resourcePolicies + */ + + /** + * Constructs a new InstancesRemoveResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesRemoveResourcePoliciesRequest. + * @implements IInstancesRemoveResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest=} [properties] Properties to set + */ + function InstancesRemoveResourcePoliciesRequest(properties) { + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesRemoveResourcePoliciesRequest resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @instance + */ + InstancesRemoveResourcePoliciesRequest.prototype.resourcePolicies = $util.emptyArray; + + /** + * Creates a new InstancesRemoveResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest} InstancesRemoveResourcePoliciesRequest instance + */ + InstancesRemoveResourcePoliciesRequest.create = function create(properties) { + return new InstancesRemoveResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified InstancesRemoveResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest} message InstancesRemoveResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesRemoveResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + return writer; + }; + + /** + * Encodes the specified InstancesRemoveResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest} message InstancesRemoveResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesRemoveResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesRemoveResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest} InstancesRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesRemoveResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesRemoveResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest} InstancesRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesRemoveResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesRemoveResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesRemoveResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + return null; + }; + + /** + * Creates an InstancesRemoveResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest} InstancesRemoveResourcePoliciesRequest + */ + InstancesRemoveResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstancesRemoveResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest} message InstancesRemoveResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesRemoveResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + return object; + }; + + /** + * Converts this InstancesRemoveResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesRemoveResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesRemoveResourcePoliciesRequest; + })(); + + v1.InstancesSetLabelsRequest = (function() { + + /** + * Properties of an InstancesSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesSetLabelsRequest + * @property {string|null} [labelFingerprint] InstancesSetLabelsRequest labelFingerprint + * @property {Object.|null} [labels] InstancesSetLabelsRequest labels + */ + + /** + * Constructs a new InstancesSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesSetLabelsRequest. + * @implements IInstancesSetLabelsRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesSetLabelsRequest=} [properties] Properties to set + */ + function InstancesSetLabelsRequest(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]]; + } + + /** + * InstancesSetLabelsRequest labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @instance + */ + InstancesSetLabelsRequest.prototype.labelFingerprint = null; + + /** + * InstancesSetLabelsRequest labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @instance + */ + InstancesSetLabelsRequest.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancesSetLabelsRequest _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @instance + */ + Object.defineProperty(InstancesSetLabelsRequest.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancesSetLabelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetLabelsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesSetLabelsRequest} InstancesSetLabelsRequest instance + */ + InstancesSetLabelsRequest.create = function create(properties) { + return new InstancesSetLabelsRequest(properties); + }; + + /** + * Encodes the specified InstancesSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetLabelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetLabelsRequest} message InstancesSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetLabelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + 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 500195327, wireType 2 =*/4001562618).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 InstancesSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetLabelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetLabelsRequest} message InstancesSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetLabelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesSetLabelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesSetLabelsRequest} InstancesSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetLabelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesSetLabelsRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 an InstancesSetLabelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesSetLabelsRequest} InstancesSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetLabelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesSetLabelsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesSetLabelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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 an InstancesSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesSetLabelsRequest} InstancesSetLabelsRequest + */ + InstancesSetLabelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesSetLabelsRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesSetLabelsRequest(); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesSetLabelsRequest.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 an InstancesSetLabelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.InstancesSetLabelsRequest} message InstancesSetLabelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesSetLabelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + 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 InstancesSetLabelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesSetLabelsRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesSetLabelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesSetLabelsRequest; + })(); + + v1.InstancesSetMachineResourcesRequest = (function() { + + /** + * Properties of an InstancesSetMachineResourcesRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesSetMachineResourcesRequest + * @property {Array.|null} [guestAccelerators] InstancesSetMachineResourcesRequest guestAccelerators + */ + + /** + * Constructs a new InstancesSetMachineResourcesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesSetMachineResourcesRequest. + * @implements IInstancesSetMachineResourcesRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesSetMachineResourcesRequest=} [properties] Properties to set + */ + function InstancesSetMachineResourcesRequest(properties) { + this.guestAccelerators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesSetMachineResourcesRequest guestAccelerators. + * @member {Array.} guestAccelerators + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @instance + */ + InstancesSetMachineResourcesRequest.prototype.guestAccelerators = $util.emptyArray; + + /** + * Creates a new InstancesSetMachineResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMachineResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesSetMachineResourcesRequest} InstancesSetMachineResourcesRequest instance + */ + InstancesSetMachineResourcesRequest.create = function create(properties) { + return new InstancesSetMachineResourcesRequest(properties); + }; + + /** + * Encodes the specified InstancesSetMachineResourcesRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMachineResourcesRequest} message InstancesSetMachineResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetMachineResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guestAccelerators != null && message.guestAccelerators.length) + for (var i = 0; i < message.guestAccelerators.length; ++i) + $root.google.cloud.compute.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 463595119, wireType 2 =*/3708760954).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancesSetMachineResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMachineResourcesRequest} message InstancesSetMachineResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetMachineResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesSetMachineResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesSetMachineResourcesRequest} InstancesSetMachineResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetMachineResourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 463595119: + if (!(message.guestAccelerators && message.guestAccelerators.length)) + message.guestAccelerators = []; + message.guestAccelerators.push($root.google.cloud.compute.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesSetMachineResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesSetMachineResourcesRequest} InstancesSetMachineResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetMachineResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesSetMachineResourcesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesSetMachineResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { + if (!Array.isArray(message.guestAccelerators)) + return "guestAccelerators: array expected"; + for (var i = 0; i < message.guestAccelerators.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); + if (error) + return "guestAccelerators." + error; + } + } + return null; + }; + + /** + * Creates an InstancesSetMachineResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesSetMachineResourcesRequest} InstancesSetMachineResourcesRequest + */ + InstancesSetMachineResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest(); + if (object.guestAccelerators) { + if (!Array.isArray(object.guestAccelerators)) + throw TypeError(".google.cloud.compute.v1.InstancesSetMachineResourcesRequest.guestAccelerators: array expected"); + message.guestAccelerators = []; + for (var i = 0; i < object.guestAccelerators.length; ++i) { + if (typeof object.guestAccelerators[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesSetMachineResourcesRequest.guestAccelerators: object expected"); + message.guestAccelerators[i] = $root.google.cloud.compute.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstancesSetMachineResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @static + * @param {google.cloud.compute.v1.InstancesSetMachineResourcesRequest} message InstancesSetMachineResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesSetMachineResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.guestAccelerators = []; + if (message.guestAccelerators && message.guestAccelerators.length) { + object.guestAccelerators = []; + for (var j = 0; j < message.guestAccelerators.length; ++j) + object.guestAccelerators[j] = $root.google.cloud.compute.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); + } + return object; + }; + + /** + * Converts this InstancesSetMachineResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesSetMachineResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesSetMachineResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesSetMachineResourcesRequest; + })(); + + v1.InstancesSetMachineTypeRequest = (function() { + + /** + * Properties of an InstancesSetMachineTypeRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesSetMachineTypeRequest + * @property {string|null} [machineType] InstancesSetMachineTypeRequest machineType + */ + + /** + * Constructs a new InstancesSetMachineTypeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesSetMachineTypeRequest. + * @implements IInstancesSetMachineTypeRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesSetMachineTypeRequest=} [properties] Properties to set + */ + function InstancesSetMachineTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesSetMachineTypeRequest machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @instance + */ + InstancesSetMachineTypeRequest.prototype.machineType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancesSetMachineTypeRequest _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @instance + */ + Object.defineProperty(InstancesSetMachineTypeRequest.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancesSetMachineTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMachineTypeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesSetMachineTypeRequest} InstancesSetMachineTypeRequest instance + */ + InstancesSetMachineTypeRequest.create = function create(properties) { + return new InstancesSetMachineTypeRequest(properties); + }; + + /** + * Encodes the specified InstancesSetMachineTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMachineTypeRequest} message InstancesSetMachineTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetMachineTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 227711026, wireType 2 =*/1821688210).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified InstancesSetMachineTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMachineTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMachineTypeRequest} message InstancesSetMachineTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetMachineTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesSetMachineTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesSetMachineTypeRequest} InstancesSetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetMachineTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227711026: + message.machineType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesSetMachineTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesSetMachineTypeRequest} InstancesSetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetMachineTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesSetMachineTypeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesSetMachineTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + return null; + }; + + /** + * Creates an InstancesSetMachineTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesSetMachineTypeRequest} InstancesSetMachineTypeRequest + */ + InstancesSetMachineTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest(); + if (object.machineType != null) + message.machineType = String(object.machineType); + return message; + }; + + /** + * Creates a plain object from an InstancesSetMachineTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.InstancesSetMachineTypeRequest} message InstancesSetMachineTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesSetMachineTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + return object; + }; + + /** + * Converts this InstancesSetMachineTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesSetMachineTypeRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesSetMachineTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesSetMachineTypeRequest; + })(); + + v1.InstancesSetMinCpuPlatformRequest = (function() { + + /** + * Properties of an InstancesSetMinCpuPlatformRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesSetMinCpuPlatformRequest + * @property {string|null} [minCpuPlatform] InstancesSetMinCpuPlatformRequest minCpuPlatform + */ + + /** + * Constructs a new InstancesSetMinCpuPlatformRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesSetMinCpuPlatformRequest. + * @implements IInstancesSetMinCpuPlatformRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest=} [properties] Properties to set + */ + function InstancesSetMinCpuPlatformRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesSetMinCpuPlatformRequest minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @instance + */ + InstancesSetMinCpuPlatformRequest.prototype.minCpuPlatform = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancesSetMinCpuPlatformRequest _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @instance + */ + Object.defineProperty(InstancesSetMinCpuPlatformRequest.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancesSetMinCpuPlatformRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest} InstancesSetMinCpuPlatformRequest instance + */ + InstancesSetMinCpuPlatformRequest.create = function create(properties) { + return new InstancesSetMinCpuPlatformRequest(properties); + }; + + /** + * Encodes the specified InstancesSetMinCpuPlatformRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest} message InstancesSetMinCpuPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetMinCpuPlatformRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 242912759, wireType 2 =*/1943302074).string(message.minCpuPlatform); + return writer; + }; + + /** + * Encodes the specified InstancesSetMinCpuPlatformRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest} message InstancesSetMinCpuPlatformRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetMinCpuPlatformRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesSetMinCpuPlatformRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest} InstancesSetMinCpuPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetMinCpuPlatformRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 242912759: + message.minCpuPlatform = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesSetMinCpuPlatformRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest} InstancesSetMinCpuPlatformRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetMinCpuPlatformRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesSetMinCpuPlatformRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesSetMinCpuPlatformRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + return null; + }; + + /** + * Creates an InstancesSetMinCpuPlatformRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest} InstancesSetMinCpuPlatformRequest + */ + InstancesSetMinCpuPlatformRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest(); + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + return message; + }; + + /** + * Creates a plain object from an InstancesSetMinCpuPlatformRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @static + * @param {google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest} message InstancesSetMinCpuPlatformRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesSetMinCpuPlatformRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + return object; + }; + + /** + * Converts this InstancesSetMinCpuPlatformRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesSetMinCpuPlatformRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesSetMinCpuPlatformRequest; + })(); + + v1.InstancesSetServiceAccountRequest = (function() { + + /** + * Properties of an InstancesSetServiceAccountRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesSetServiceAccountRequest + * @property {string|null} [email] InstancesSetServiceAccountRequest email + * @property {Array.|null} [scopes] InstancesSetServiceAccountRequest scopes + */ + + /** + * Constructs a new InstancesSetServiceAccountRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesSetServiceAccountRequest. + * @implements IInstancesSetServiceAccountRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesSetServiceAccountRequest=} [properties] Properties to set + */ + function InstancesSetServiceAccountRequest(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesSetServiceAccountRequest email. + * @member {string|null|undefined} email + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @instance + */ + InstancesSetServiceAccountRequest.prototype.email = null; + + /** + * InstancesSetServiceAccountRequest scopes. + * @member {Array.} scopes + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @instance + */ + InstancesSetServiceAccountRequest.prototype.scopes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InstancesSetServiceAccountRequest _email. + * @member {"email"|undefined} _email + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @instance + */ + Object.defineProperty(InstancesSetServiceAccountRequest.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstancesSetServiceAccountRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetServiceAccountRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesSetServiceAccountRequest} InstancesSetServiceAccountRequest instance + */ + InstancesSetServiceAccountRequest.create = function create(properties) { + return new InstancesSetServiceAccountRequest(properties); + }; + + /** + * Encodes the specified InstancesSetServiceAccountRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesSetServiceAccountRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetServiceAccountRequest} message InstancesSetServiceAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetServiceAccountRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 96619420, wireType 2 =*/772955362).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 165973151, wireType 2 =*/1327785210).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified InstancesSetServiceAccountRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesSetServiceAccountRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {google.cloud.compute.v1.IInstancesSetServiceAccountRequest} message InstancesSetServiceAccountRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesSetServiceAccountRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesSetServiceAccountRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesSetServiceAccountRequest} InstancesSetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetServiceAccountRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 96619420: + message.email = reader.string(); + break; + case 165973151: + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesSetServiceAccountRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesSetServiceAccountRequest} InstancesSetServiceAccountRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesSetServiceAccountRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesSetServiceAccountRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesSetServiceAccountRequest.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"; + } + 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"; + } + return null; + }; + + /** + * Creates an InstancesSetServiceAccountRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesSetServiceAccountRequest} InstancesSetServiceAccountRequest + */ + InstancesSetServiceAccountRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.compute.v1.InstancesSetServiceAccountRequest.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from an InstancesSetServiceAccountRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @static + * @param {google.cloud.compute.v1.InstancesSetServiceAccountRequest} message InstancesSetServiceAccountRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesSetServiceAccountRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this InstancesSetServiceAccountRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesSetServiceAccountRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesSetServiceAccountRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesSetServiceAccountRequest; + })(); + + v1.InstancesStartWithEncryptionKeyRequest = (function() { + + /** + * Properties of an InstancesStartWithEncryptionKeyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInstancesStartWithEncryptionKeyRequest + * @property {Array.|null} [disks] InstancesStartWithEncryptionKeyRequest disks + */ + + /** + * Constructs a new InstancesStartWithEncryptionKeyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstancesStartWithEncryptionKeyRequest. + * @implements IInstancesStartWithEncryptionKeyRequest + * @constructor + * @param {google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest=} [properties] Properties to set + */ + function InstancesStartWithEncryptionKeyRequest(properties) { + this.disks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstancesStartWithEncryptionKeyRequest disks. + * @member {Array.} disks + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @instance + */ + InstancesStartWithEncryptionKeyRequest.prototype.disks = $util.emptyArray; + + /** + * Creates a new InstancesStartWithEncryptionKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest} InstancesStartWithEncryptionKeyRequest instance + */ + InstancesStartWithEncryptionKeyRequest.create = function create(properties) { + return new InstancesStartWithEncryptionKeyRequest(properties); + }; + + /** + * Encodes the specified InstancesStartWithEncryptionKeyRequest message. Does not implicitly {@link google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest} message InstancesStartWithEncryptionKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesStartWithEncryptionKeyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.encode(message.disks[i], writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstancesStartWithEncryptionKeyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest} message InstancesStartWithEncryptionKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstancesStartWithEncryptionKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstancesStartWithEncryptionKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest} InstancesStartWithEncryptionKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesStartWithEncryptionKeyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 95594102: + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstancesStartWithEncryptionKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest} InstancesStartWithEncryptionKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstancesStartWithEncryptionKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstancesStartWithEncryptionKeyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstancesStartWithEncryptionKeyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + return null; + }; + + /** + * Creates an InstancesStartWithEncryptionKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest} InstancesStartWithEncryptionKeyRequest + */ + InstancesStartWithEncryptionKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest(); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.disks: object expected"); + message.disks[i] = $root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.fromObject(object.disks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstancesStartWithEncryptionKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @static + * @param {google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest} message InstancesStartWithEncryptionKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstancesStartWithEncryptionKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.disks = []; + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.compute.v1.CustomerEncryptionKeyProtectedDisk.toObject(message.disks[j], options); + } + return object; + }; + + /** + * Converts this InstancesStartWithEncryptionKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest + * @instance + * @returns {Object.} JSON object + */ + InstancesStartWithEncryptionKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InstancesStartWithEncryptionKeyRequest; + })(); + + v1.InterconnectCircuitInfo = (function() { + + /** + * Properties of an InterconnectCircuitInfo. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectCircuitInfo + * @property {string|null} [customerDemarcId] InterconnectCircuitInfo customerDemarcId + * @property {string|null} [googleCircuitId] InterconnectCircuitInfo googleCircuitId + * @property {string|null} [googleDemarcId] InterconnectCircuitInfo googleDemarcId + */ + + /** + * Constructs a new InterconnectCircuitInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectCircuitInfo. + * @implements IInterconnectCircuitInfo + * @constructor + * @param {google.cloud.compute.v1.IInterconnectCircuitInfo=} [properties] Properties to set + */ + function InterconnectCircuitInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectCircuitInfo customerDemarcId. + * @member {string|null|undefined} customerDemarcId + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @instance + */ + InterconnectCircuitInfo.prototype.customerDemarcId = null; + + /** + * InterconnectCircuitInfo googleCircuitId. + * @member {string|null|undefined} googleCircuitId + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @instance + */ + InterconnectCircuitInfo.prototype.googleCircuitId = null; + + /** + * InterconnectCircuitInfo googleDemarcId. + * @member {string|null|undefined} googleDemarcId + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @instance + */ + InterconnectCircuitInfo.prototype.googleDemarcId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectCircuitInfo _customerDemarcId. + * @member {"customerDemarcId"|undefined} _customerDemarcId + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @instance + */ + Object.defineProperty(InterconnectCircuitInfo.prototype, "_customerDemarcId", { + get: $util.oneOfGetter($oneOfFields = ["customerDemarcId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectCircuitInfo _googleCircuitId. + * @member {"googleCircuitId"|undefined} _googleCircuitId + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @instance + */ + Object.defineProperty(InterconnectCircuitInfo.prototype, "_googleCircuitId", { + get: $util.oneOfGetter($oneOfFields = ["googleCircuitId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectCircuitInfo _googleDemarcId. + * @member {"googleDemarcId"|undefined} _googleDemarcId + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @instance + */ + Object.defineProperty(InterconnectCircuitInfo.prototype, "_googleDemarcId", { + get: $util.oneOfGetter($oneOfFields = ["googleDemarcId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectCircuitInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectCircuitInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectCircuitInfo} InterconnectCircuitInfo instance + */ + InterconnectCircuitInfo.create = function create(properties) { + return new InterconnectCircuitInfo(properties); + }; + + /** + * Encodes the specified InterconnectCircuitInfo message. Does not implicitly {@link google.cloud.compute.v1.InterconnectCircuitInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectCircuitInfo} message InterconnectCircuitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectCircuitInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customerDemarcId != null && Object.hasOwnProperty.call(message, "customerDemarcId")) + writer.uint32(/* id 28771859, wireType 2 =*/230174874).string(message.customerDemarcId); + if (message.googleCircuitId != null && Object.hasOwnProperty.call(message, "googleCircuitId")) + writer.uint32(/* id 262014711, wireType 2 =*/2096117690).string(message.googleCircuitId); + if (message.googleDemarcId != null && Object.hasOwnProperty.call(message, "googleDemarcId")) + writer.uint32(/* id 448196270, wireType 2 =*/3585570162).string(message.googleDemarcId); + return writer; + }; + + /** + * Encodes the specified InterconnectCircuitInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectCircuitInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectCircuitInfo} message InterconnectCircuitInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectCircuitInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectCircuitInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectCircuitInfo} InterconnectCircuitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectCircuitInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectCircuitInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 28771859: + message.customerDemarcId = reader.string(); + break; + case 262014711: + message.googleCircuitId = reader.string(); + break; + case 448196270: + message.googleDemarcId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectCircuitInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectCircuitInfo} InterconnectCircuitInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectCircuitInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectCircuitInfo message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectCircuitInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.customerDemarcId != null && message.hasOwnProperty("customerDemarcId")) { + properties._customerDemarcId = 1; + if (!$util.isString(message.customerDemarcId)) + return "customerDemarcId: string expected"; + } + if (message.googleCircuitId != null && message.hasOwnProperty("googleCircuitId")) { + properties._googleCircuitId = 1; + if (!$util.isString(message.googleCircuitId)) + return "googleCircuitId: string expected"; + } + if (message.googleDemarcId != null && message.hasOwnProperty("googleDemarcId")) { + properties._googleDemarcId = 1; + if (!$util.isString(message.googleDemarcId)) + return "googleDemarcId: string expected"; + } + return null; + }; + + /** + * Creates an InterconnectCircuitInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectCircuitInfo} InterconnectCircuitInfo + */ + InterconnectCircuitInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectCircuitInfo) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectCircuitInfo(); + if (object.customerDemarcId != null) + message.customerDemarcId = String(object.customerDemarcId); + if (object.googleCircuitId != null) + message.googleCircuitId = String(object.googleCircuitId); + if (object.googleDemarcId != null) + message.googleDemarcId = String(object.googleDemarcId); + return message; + }; + + /** + * Creates a plain object from an InterconnectCircuitInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @static + * @param {google.cloud.compute.v1.InterconnectCircuitInfo} message InterconnectCircuitInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectCircuitInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.customerDemarcId != null && message.hasOwnProperty("customerDemarcId")) { + object.customerDemarcId = message.customerDemarcId; + if (options.oneofs) + object._customerDemarcId = "customerDemarcId"; + } + if (message.googleCircuitId != null && message.hasOwnProperty("googleCircuitId")) { + object.googleCircuitId = message.googleCircuitId; + if (options.oneofs) + object._googleCircuitId = "googleCircuitId"; + } + if (message.googleDemarcId != null && message.hasOwnProperty("googleDemarcId")) { + object.googleDemarcId = message.googleDemarcId; + if (options.oneofs) + object._googleDemarcId = "googleDemarcId"; + } + return object; + }; + + /** + * Converts this InterconnectCircuitInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectCircuitInfo + * @instance + * @returns {Object.} JSON object + */ + InterconnectCircuitInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectCircuitInfo; + })(); + + v1.InterconnectOutageNotification = (function() { + + /** + * Properties of an InterconnectOutageNotification. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectOutageNotification + * @property {Array.|null} [affectedCircuits] InterconnectOutageNotification affectedCircuits + * @property {string|null} [description] InterconnectOutageNotification description + * @property {number|Long|null} [endTime] InterconnectOutageNotification endTime + * @property {google.cloud.compute.v1.InterconnectOutageNotification.IssueType|null} [issueType] InterconnectOutageNotification issueType + * @property {string|null} [name] InterconnectOutageNotification name + * @property {google.cloud.compute.v1.InterconnectOutageNotification.Source|null} [source] InterconnectOutageNotification source + * @property {number|Long|null} [startTime] InterconnectOutageNotification startTime + * @property {google.cloud.compute.v1.InterconnectOutageNotification.State|null} [state] InterconnectOutageNotification state + */ + + /** + * Constructs a new InterconnectOutageNotification. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectOutageNotification. + * @implements IInterconnectOutageNotification + * @constructor + * @param {google.cloud.compute.v1.IInterconnectOutageNotification=} [properties] Properties to set + */ + function InterconnectOutageNotification(properties) { + this.affectedCircuits = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectOutageNotification affectedCircuits. + * @member {Array.} affectedCircuits + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.affectedCircuits = $util.emptyArray; + + /** + * InterconnectOutageNotification description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.description = null; + + /** + * InterconnectOutageNotification endTime. + * @member {number|Long|null|undefined} endTime + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.endTime = null; + + /** + * InterconnectOutageNotification issueType. + * @member {google.cloud.compute.v1.InterconnectOutageNotification.IssueType|null|undefined} issueType + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.issueType = null; + + /** + * InterconnectOutageNotification name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.name = null; + + /** + * InterconnectOutageNotification source. + * @member {google.cloud.compute.v1.InterconnectOutageNotification.Source|null|undefined} source + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.source = null; + + /** + * InterconnectOutageNotification startTime. + * @member {number|Long|null|undefined} startTime + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.startTime = null; + + /** + * InterconnectOutageNotification state. + * @member {google.cloud.compute.v1.InterconnectOutageNotification.State|null|undefined} state + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + InterconnectOutageNotification.prototype.state = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectOutageNotification _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + Object.defineProperty(InterconnectOutageNotification.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectOutageNotification _endTime. + * @member {"endTime"|undefined} _endTime + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + Object.defineProperty(InterconnectOutageNotification.prototype, "_endTime", { + get: $util.oneOfGetter($oneOfFields = ["endTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectOutageNotification _issueType. + * @member {"issueType"|undefined} _issueType + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + Object.defineProperty(InterconnectOutageNotification.prototype, "_issueType", { + get: $util.oneOfGetter($oneOfFields = ["issueType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectOutageNotification _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + Object.defineProperty(InterconnectOutageNotification.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectOutageNotification _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + Object.defineProperty(InterconnectOutageNotification.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectOutageNotification _startTime. + * @member {"startTime"|undefined} _startTime + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + Object.defineProperty(InterconnectOutageNotification.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectOutageNotification _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + */ + Object.defineProperty(InterconnectOutageNotification.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectOutageNotification instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {google.cloud.compute.v1.IInterconnectOutageNotification=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectOutageNotification} InterconnectOutageNotification instance + */ + InterconnectOutageNotification.create = function create(properties) { + return new InterconnectOutageNotification(properties); + }; + + /** + * Encodes the specified InterconnectOutageNotification message. Does not implicitly {@link google.cloud.compute.v1.InterconnectOutageNotification.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {google.cloud.compute.v1.IInterconnectOutageNotification} message InterconnectOutageNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectOutageNotification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 37467274, wireType 0 =*/299738192).int64(message.startTime); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 114938801, wireType 0 =*/919510408).int64(message.endTime); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 177235995, wireType 0 =*/1417887960).int32(message.source); + if (message.affectedCircuits != null && message.affectedCircuits.length) + for (var i = 0; i < message.affectedCircuits.length; ++i) + writer.uint32(/* id 177717013, wireType 2 =*/1421736106).string(message.affectedCircuits[i]); + if (message.issueType != null && Object.hasOwnProperty.call(message, "issueType")) + writer.uint32(/* id 369639136, wireType 0 =*/2957113088).int32(message.issueType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + return writer; + }; + + /** + * Encodes the specified InterconnectOutageNotification message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectOutageNotification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {google.cloud.compute.v1.IInterconnectOutageNotification} message InterconnectOutageNotification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectOutageNotification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectOutageNotification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectOutageNotification} InterconnectOutageNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectOutageNotification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectOutageNotification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 177717013: + if (!(message.affectedCircuits && message.affectedCircuits.length)) + message.affectedCircuits = []; + message.affectedCircuits.push(reader.string()); + break; + case 422937596: + message.description = reader.string(); + break; + case 114938801: + message.endTime = reader.int64(); + break; + case 369639136: + message.issueType = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 177235995: + message.source = reader.int32(); + break; + case 37467274: + message.startTime = reader.int64(); + break; + case 109757585: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectOutageNotification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectOutageNotification} InterconnectOutageNotification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectOutageNotification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectOutageNotification message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectOutageNotification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.affectedCircuits != null && message.hasOwnProperty("affectedCircuits")) { + if (!Array.isArray(message.affectedCircuits)) + return "affectedCircuits: array expected"; + for (var i = 0; i < message.affectedCircuits.length; ++i) + if (!$util.isString(message.affectedCircuits[i])) + return "affectedCircuits: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + properties._endTime = 1; + if (!$util.isInteger(message.endTime) && !(message.endTime && $util.isInteger(message.endTime.low) && $util.isInteger(message.endTime.high))) + return "endTime: integer|Long expected"; + } + if (message.issueType != null && message.hasOwnProperty("issueType")) { + properties._issueType = 1; + switch (message.issueType) { + default: + return "issueType: enum value expected"; + case 0: + case 175779973: + case 92103971: + case 195285745: + case 147053455: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + switch (message.source) { + default: + return "source: enum value expected"; + case 0: + case 497439289: + case 510574562: + break; + } + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties._startTime = 1; + if (!$util.isInteger(message.startTime) && !(message.startTime && $util.isInteger(message.startTime.low) && $util.isInteger(message.startTime.high))) + return "startTime: integer|Long expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 314733318: + case 41957681: + case 309921323: + case 252563136: + case 506579411: + break; + } + } + return null; + }; + + /** + * Creates an InterconnectOutageNotification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectOutageNotification} InterconnectOutageNotification + */ + InterconnectOutageNotification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectOutageNotification) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectOutageNotification(); + if (object.affectedCircuits) { + if (!Array.isArray(object.affectedCircuits)) + throw TypeError(".google.cloud.compute.v1.InterconnectOutageNotification.affectedCircuits: array expected"); + message.affectedCircuits = []; + for (var i = 0; i < object.affectedCircuits.length; ++i) + message.affectedCircuits[i] = String(object.affectedCircuits[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.endTime != null) + if ($util.Long) + (message.endTime = $util.Long.fromValue(object.endTime)).unsigned = false; + else if (typeof object.endTime === "string") + message.endTime = parseInt(object.endTime, 10); + else if (typeof object.endTime === "number") + message.endTime = object.endTime; + else if (typeof object.endTime === "object") + message.endTime = new $util.LongBits(object.endTime.low >>> 0, object.endTime.high >>> 0).toNumber(); + switch (object.issueType) { + case "UNDEFINED_ISSUE_TYPE": + case 0: + message.issueType = 0; + break; + case "IT_OUTAGE": + case 175779973: + message.issueType = 175779973; + break; + case "IT_PARTIAL_OUTAGE": + case 92103971: + message.issueType = 92103971; + break; + case "OUTAGE": + case 195285745: + message.issueType = 195285745; + break; + case "PARTIAL_OUTAGE": + case 147053455: + message.issueType = 147053455; + break; + } + if (object.name != null) + message.name = String(object.name); + switch (object.source) { + case "UNDEFINED_SOURCE": + case 0: + message.source = 0; + break; + case "GOOGLE": + case 497439289: + message.source = 497439289; + break; + case "NSRC_GOOGLE": + case 510574562: + message.source = 510574562; + break; + } + if (object.startTime != null) + if ($util.Long) + (message.startTime = $util.Long.fromValue(object.startTime)).unsigned = false; + else if (typeof object.startTime === "string") + message.startTime = parseInt(object.startTime, 10); + else if (typeof object.startTime === "number") + message.startTime = object.startTime; + else if (typeof object.startTime === "object") + message.startTime = new $util.LongBits(object.startTime.low >>> 0, object.startTime.high >>> 0).toNumber(); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 314733318: + message.state = 314733318; + break; + case "CANCELLED": + case 41957681: + message.state = 41957681; + break; + case "COMPLETED": + case 309921323: + message.state = 309921323; + break; + case "NS_ACTIVE": + case 252563136: + message.state = 252563136; + break; + case "NS_CANCELED": + case 506579411: + message.state = 506579411; + break; + } + return message; + }; + + /** + * Creates a plain object from an InterconnectOutageNotification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @static + * @param {google.cloud.compute.v1.InterconnectOutageNotification} message InterconnectOutageNotification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectOutageNotification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.affectedCircuits = []; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + if (typeof message.startTime === "number") + object.startTime = options.longs === String ? String(message.startTime) : message.startTime; + else + object.startTime = options.longs === String ? $util.Long.prototype.toString.call(message.startTime) : options.longs === Number ? new $util.LongBits(message.startTime.low >>> 0, message.startTime.high >>> 0).toNumber() : message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.InterconnectOutageNotification.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + if (typeof message.endTime === "number") + object.endTime = options.longs === String ? String(message.endTime) : message.endTime; + else + object.endTime = options.longs === String ? $util.Long.prototype.toString.call(message.endTime) : options.longs === Number ? new $util.LongBits(message.endTime.low >>> 0, message.endTime.high >>> 0).toNumber() : message.endTime; + if (options.oneofs) + object._endTime = "endTime"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = options.enums === String ? $root.google.cloud.compute.v1.InterconnectOutageNotification.Source[message.source] : message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.affectedCircuits && message.affectedCircuits.length) { + object.affectedCircuits = []; + for (var j = 0; j < message.affectedCircuits.length; ++j) + object.affectedCircuits[j] = message.affectedCircuits[j]; + } + if (message.issueType != null && message.hasOwnProperty("issueType")) { + object.issueType = options.enums === String ? $root.google.cloud.compute.v1.InterconnectOutageNotification.IssueType[message.issueType] : message.issueType; + if (options.oneofs) + object._issueType = "issueType"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + return object; + }; + + /** + * Converts this InterconnectOutageNotification to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectOutageNotification + * @instance + * @returns {Object.} JSON object + */ + InterconnectOutageNotification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IssueType enum. + * @name google.cloud.compute.v1.InterconnectOutageNotification.IssueType + * @enum {number} + * @property {number} UNDEFINED_ISSUE_TYPE=0 UNDEFINED_ISSUE_TYPE value + * @property {number} IT_OUTAGE=175779973 IT_OUTAGE value + * @property {number} IT_PARTIAL_OUTAGE=92103971 IT_PARTIAL_OUTAGE value + * @property {number} OUTAGE=195285745 OUTAGE value + * @property {number} PARTIAL_OUTAGE=147053455 PARTIAL_OUTAGE value + */ + InterconnectOutageNotification.IssueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ISSUE_TYPE"] = 0; + values[valuesById[175779973] = "IT_OUTAGE"] = 175779973; + values[valuesById[92103971] = "IT_PARTIAL_OUTAGE"] = 92103971; + values[valuesById[195285745] = "OUTAGE"] = 195285745; + values[valuesById[147053455] = "PARTIAL_OUTAGE"] = 147053455; + return values; + })(); + + /** + * Source enum. + * @name google.cloud.compute.v1.InterconnectOutageNotification.Source + * @enum {number} + * @property {number} UNDEFINED_SOURCE=0 UNDEFINED_SOURCE value + * @property {number} GOOGLE=497439289 GOOGLE value + * @property {number} NSRC_GOOGLE=510574562 NSRC_GOOGLE value + */ + InterconnectOutageNotification.Source = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_SOURCE"] = 0; + values[valuesById[497439289] = "GOOGLE"] = 497439289; + values[valuesById[510574562] = "NSRC_GOOGLE"] = 510574562; + return values; + })(); + + /** + * State enum. + * @name google.cloud.compute.v1.InterconnectOutageNotification.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} CANCELLED=41957681 CANCELLED value + * @property {number} COMPLETED=309921323 COMPLETED value + * @property {number} NS_ACTIVE=252563136 NS_ACTIVE value + * @property {number} NS_CANCELED=506579411 NS_CANCELED value + */ + InterconnectOutageNotification.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[41957681] = "CANCELLED"] = 41957681; + values[valuesById[309921323] = "COMPLETED"] = 309921323; + values[valuesById[252563136] = "NS_ACTIVE"] = 252563136; + values[valuesById[506579411] = "NS_CANCELED"] = 506579411; + return values; + })(); + + return InterconnectOutageNotification; + })(); + + v1.Interconnect = (function() { + + /** + * Properties of an Interconnect. + * @memberof google.cloud.compute.v1 + * @interface IInterconnect + * @property {boolean|null} [adminEnabled] Interconnect adminEnabled + * @property {Array.|null} [circuitInfos] Interconnect circuitInfos + * @property {string|null} [creationTimestamp] Interconnect creationTimestamp + * @property {string|null} [customerName] Interconnect customerName + * @property {string|null} [description] Interconnect description + * @property {Array.|null} [expectedOutages] Interconnect expectedOutages + * @property {string|null} [googleIpAddress] Interconnect googleIpAddress + * @property {string|null} [googleReferenceId] Interconnect googleReferenceId + * @property {number|Long|null} [id] Interconnect id + * @property {Array.|null} [interconnectAttachments] Interconnect interconnectAttachments + * @property {google.cloud.compute.v1.Interconnect.InterconnectType|null} [interconnectType] Interconnect interconnectType + * @property {string|null} [kind] Interconnect kind + * @property {google.cloud.compute.v1.Interconnect.LinkType|null} [linkType] Interconnect linkType + * @property {string|null} [location] Interconnect location + * @property {string|null} [name] Interconnect name + * @property {string|null} [nocContactEmail] Interconnect nocContactEmail + * @property {google.cloud.compute.v1.Interconnect.OperationalStatus|null} [operationalStatus] Interconnect operationalStatus + * @property {string|null} [peerIpAddress] Interconnect peerIpAddress + * @property {number|null} [provisionedLinkCount] Interconnect provisionedLinkCount + * @property {number|null} [requestedLinkCount] Interconnect requestedLinkCount + * @property {string|null} [selfLink] Interconnect selfLink + * @property {google.cloud.compute.v1.Interconnect.State|null} [state] Interconnect state + */ + + /** + * Constructs a new Interconnect. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Interconnect. + * @implements IInterconnect + * @constructor + * @param {google.cloud.compute.v1.IInterconnect=} [properties] Properties to set + */ + function Interconnect(properties) { + this.circuitInfos = []; + this.expectedOutages = []; + this.interconnectAttachments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interconnect adminEnabled. + * @member {boolean|null|undefined} adminEnabled + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.adminEnabled = null; + + /** + * Interconnect circuitInfos. + * @member {Array.} circuitInfos + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.circuitInfos = $util.emptyArray; + + /** + * Interconnect creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.creationTimestamp = null; + + /** + * Interconnect customerName. + * @member {string|null|undefined} customerName + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.customerName = null; + + /** + * Interconnect description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.description = null; + + /** + * Interconnect expectedOutages. + * @member {Array.} expectedOutages + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.expectedOutages = $util.emptyArray; + + /** + * Interconnect googleIpAddress. + * @member {string|null|undefined} googleIpAddress + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.googleIpAddress = null; + + /** + * Interconnect googleReferenceId. + * @member {string|null|undefined} googleReferenceId + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.googleReferenceId = null; + + /** + * Interconnect id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.id = null; + + /** + * Interconnect interconnectAttachments. + * @member {Array.} interconnectAttachments + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.interconnectAttachments = $util.emptyArray; + + /** + * Interconnect interconnectType. + * @member {google.cloud.compute.v1.Interconnect.InterconnectType|null|undefined} interconnectType + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.interconnectType = null; + + /** + * Interconnect kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.kind = null; + + /** + * Interconnect linkType. + * @member {google.cloud.compute.v1.Interconnect.LinkType|null|undefined} linkType + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.linkType = null; + + /** + * Interconnect location. + * @member {string|null|undefined} location + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.location = null; + + /** + * Interconnect name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.name = null; + + /** + * Interconnect nocContactEmail. + * @member {string|null|undefined} nocContactEmail + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.nocContactEmail = null; + + /** + * Interconnect operationalStatus. + * @member {google.cloud.compute.v1.Interconnect.OperationalStatus|null|undefined} operationalStatus + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.operationalStatus = null; + + /** + * Interconnect peerIpAddress. + * @member {string|null|undefined} peerIpAddress + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.peerIpAddress = null; + + /** + * Interconnect provisionedLinkCount. + * @member {number|null|undefined} provisionedLinkCount + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.provisionedLinkCount = null; + + /** + * Interconnect requestedLinkCount. + * @member {number|null|undefined} requestedLinkCount + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.requestedLinkCount = null; + + /** + * Interconnect selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.selfLink = null; + + /** + * Interconnect state. + * @member {google.cloud.compute.v1.Interconnect.State|null|undefined} state + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Interconnect.prototype.state = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Interconnect _adminEnabled. + * @member {"adminEnabled"|undefined} _adminEnabled + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_adminEnabled", { + get: $util.oneOfGetter($oneOfFields = ["adminEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _customerName. + * @member {"customerName"|undefined} _customerName + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_customerName", { + get: $util.oneOfGetter($oneOfFields = ["customerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _googleIpAddress. + * @member {"googleIpAddress"|undefined} _googleIpAddress + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_googleIpAddress", { + get: $util.oneOfGetter($oneOfFields = ["googleIpAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _googleReferenceId. + * @member {"googleReferenceId"|undefined} _googleReferenceId + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_googleReferenceId", { + get: $util.oneOfGetter($oneOfFields = ["googleReferenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _interconnectType. + * @member {"interconnectType"|undefined} _interconnectType + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_interconnectType", { + get: $util.oneOfGetter($oneOfFields = ["interconnectType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _linkType. + * @member {"linkType"|undefined} _linkType + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_linkType", { + get: $util.oneOfGetter($oneOfFields = ["linkType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _location. + * @member {"location"|undefined} _location + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_location", { + get: $util.oneOfGetter($oneOfFields = ["location"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _nocContactEmail. + * @member {"nocContactEmail"|undefined} _nocContactEmail + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_nocContactEmail", { + get: $util.oneOfGetter($oneOfFields = ["nocContactEmail"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _operationalStatus. + * @member {"operationalStatus"|undefined} _operationalStatus + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_operationalStatus", { + get: $util.oneOfGetter($oneOfFields = ["operationalStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _peerIpAddress. + * @member {"peerIpAddress"|undefined} _peerIpAddress + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_peerIpAddress", { + get: $util.oneOfGetter($oneOfFields = ["peerIpAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _provisionedLinkCount. + * @member {"provisionedLinkCount"|undefined} _provisionedLinkCount + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_provisionedLinkCount", { + get: $util.oneOfGetter($oneOfFields = ["provisionedLinkCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _requestedLinkCount. + * @member {"requestedLinkCount"|undefined} _requestedLinkCount + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_requestedLinkCount", { + get: $util.oneOfGetter($oneOfFields = ["requestedLinkCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Interconnect _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.Interconnect + * @instance + */ + Object.defineProperty(Interconnect.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Interconnect instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {google.cloud.compute.v1.IInterconnect=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Interconnect} Interconnect instance + */ + Interconnect.create = function create(properties) { + return new Interconnect(properties); + }; + + /** + * Encodes the specified Interconnect message. Does not implicitly {@link google.cloud.compute.v1.Interconnect.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {google.cloud.compute.v1.IInterconnect} message Interconnect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interconnect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.customerName != null && Object.hasOwnProperty.call(message, "customerName")) + writer.uint32(/* id 3665484, wireType 2 =*/29323874).string(message.customerName); + if (message.nocContactEmail != null && Object.hasOwnProperty.call(message, "nocContactEmail")) + writer.uint32(/* id 14072832, wireType 2 =*/112582658).string(message.nocContactEmail); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.requestedLinkCount != null && Object.hasOwnProperty.call(message, "requestedLinkCount")) + writer.uint32(/* id 45051387, wireType 0 =*/360411096).int32(message.requestedLinkCount); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.circuitInfos != null && message.circuitInfos.length) + for (var i = 0; i < message.circuitInfos.length; ++i) + $root.google.cloud.compute.v1.InterconnectCircuitInfo.encode(message.circuitInfos[i], writer.uint32(/* id 164839855, wireType 2 =*/1318718842).fork()).ldelim(); + if (message.operationalStatus != null && Object.hasOwnProperty.call(message, "operationalStatus")) + writer.uint32(/* id 201070847, wireType 0 =*/1608566776).int32(message.operationalStatus); + if (message.peerIpAddress != null && Object.hasOwnProperty.call(message, "peerIpAddress")) + writer.uint32(/* id 207735769, wireType 2 =*/1661886154).string(message.peerIpAddress); + if (message.expectedOutages != null && message.expectedOutages.length) + for (var i = 0; i < message.expectedOutages.length; ++i) + $root.google.cloud.compute.v1.InterconnectOutageNotification.encode(message.expectedOutages[i], writer.uint32(/* id 264484123, wireType 2 =*/2115872986).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 290430901, wireType 2 =*/2323447210).string(message.location); + if (message.provisionedLinkCount != null && Object.hasOwnProperty.call(message, "provisionedLinkCount")) + writer.uint32(/* id 410888565, wireType 0 =*/3287108520).int32(message.provisionedLinkCount); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.interconnectAttachments != null && message.interconnectAttachments.length) + for (var i = 0; i < message.interconnectAttachments.length; ++i) + writer.uint32(/* id 425388415, wireType 2 =*/3403107322).string(message.interconnectAttachments[i]); + if (message.googleIpAddress != null && Object.hasOwnProperty.call(message, "googleIpAddress")) + writer.uint32(/* id 443105954, wireType 2 =*/3544847634).string(message.googleIpAddress); + if (message.adminEnabled != null && Object.hasOwnProperty.call(message, "adminEnabled")) + writer.uint32(/* id 445675089, wireType 0 =*/3565400712).bool(message.adminEnabled); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.interconnectType != null && Object.hasOwnProperty.call(message, "interconnectType")) + writer.uint32(/* id 515165259, wireType 0 =*/4121322072).int32(message.interconnectType); + if (message.linkType != null && Object.hasOwnProperty.call(message, "linkType")) + writer.uint32(/* id 523207775, wireType 0 =*/4185662200).int32(message.linkType); + if (message.googleReferenceId != null && Object.hasOwnProperty.call(message, "googleReferenceId")) + writer.uint32(/* id 534944469, wireType 2 =*/4279555754).string(message.googleReferenceId); + return writer; + }; + + /** + * Encodes the specified Interconnect message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Interconnect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {google.cloud.compute.v1.IInterconnect} message Interconnect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interconnect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interconnect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Interconnect} Interconnect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interconnect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Interconnect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 445675089: + message.adminEnabled = reader.bool(); + break; + case 164839855: + if (!(message.circuitInfos && message.circuitInfos.length)) + message.circuitInfos = []; + message.circuitInfos.push($root.google.cloud.compute.v1.InterconnectCircuitInfo.decode(reader, reader.uint32())); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 3665484: + message.customerName = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 264484123: + if (!(message.expectedOutages && message.expectedOutages.length)) + message.expectedOutages = []; + message.expectedOutages.push($root.google.cloud.compute.v1.InterconnectOutageNotification.decode(reader, reader.uint32())); + break; + case 443105954: + message.googleIpAddress = reader.string(); + break; + case 534944469: + message.googleReferenceId = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 425388415: + if (!(message.interconnectAttachments && message.interconnectAttachments.length)) + message.interconnectAttachments = []; + message.interconnectAttachments.push(reader.string()); + break; + case 515165259: + message.interconnectType = reader.int32(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 523207775: + message.linkType = reader.int32(); + break; + case 290430901: + message.location = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 14072832: + message.nocContactEmail = reader.string(); + break; + case 201070847: + message.operationalStatus = reader.int32(); + break; + case 207735769: + message.peerIpAddress = reader.string(); + break; + case 410888565: + message.provisionedLinkCount = reader.int32(); + break; + case 45051387: + message.requestedLinkCount = reader.int32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 109757585: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interconnect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Interconnect} Interconnect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interconnect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interconnect message. + * @function verify + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interconnect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.adminEnabled != null && message.hasOwnProperty("adminEnabled")) { + properties._adminEnabled = 1; + if (typeof message.adminEnabled !== "boolean") + return "adminEnabled: boolean expected"; + } + if (message.circuitInfos != null && message.hasOwnProperty("circuitInfos")) { + if (!Array.isArray(message.circuitInfos)) + return "circuitInfos: array expected"; + for (var i = 0; i < message.circuitInfos.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectCircuitInfo.verify(message.circuitInfos[i]); + if (error) + return "circuitInfos." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.customerName != null && message.hasOwnProperty("customerName")) { + properties._customerName = 1; + if (!$util.isString(message.customerName)) + return "customerName: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.expectedOutages != null && message.hasOwnProperty("expectedOutages")) { + if (!Array.isArray(message.expectedOutages)) + return "expectedOutages: array expected"; + for (var i = 0; i < message.expectedOutages.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectOutageNotification.verify(message.expectedOutages[i]); + if (error) + return "expectedOutages." + error; + } + } + if (message.googleIpAddress != null && message.hasOwnProperty("googleIpAddress")) { + properties._googleIpAddress = 1; + if (!$util.isString(message.googleIpAddress)) + return "googleIpAddress: string expected"; + } + if (message.googleReferenceId != null && message.hasOwnProperty("googleReferenceId")) { + properties._googleReferenceId = 1; + if (!$util.isString(message.googleReferenceId)) + return "googleReferenceId: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.interconnectAttachments != null && message.hasOwnProperty("interconnectAttachments")) { + if (!Array.isArray(message.interconnectAttachments)) + return "interconnectAttachments: array expected"; + for (var i = 0; i < message.interconnectAttachments.length; ++i) + if (!$util.isString(message.interconnectAttachments[i])) + return "interconnectAttachments: string[] expected"; + } + if (message.interconnectType != null && message.hasOwnProperty("interconnectType")) { + properties._interconnectType = 1; + switch (message.interconnectType) { + default: + return "interconnectType: enum value expected"; + case 0: + case 258411983: + case 335677007: + case 461924520: + break; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.linkType != null && message.hasOwnProperty("linkType")) { + properties._linkType = 1; + switch (message.linkType) { + default: + return "linkType: enum value expected"; + case 0: + case 337672551: + case 236739749: + break; + } + } + if (message.location != null && message.hasOwnProperty("location")) { + properties._location = 1; + if (!$util.isString(message.location)) + return "location: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.nocContactEmail != null && message.hasOwnProperty("nocContactEmail")) { + properties._nocContactEmail = 1; + if (!$util.isString(message.nocContactEmail)) + return "nocContactEmail: string expected"; + } + if (message.operationalStatus != null && message.hasOwnProperty("operationalStatus")) { + properties._operationalStatus = 1; + switch (message.operationalStatus) { + default: + return "operationalStatus: enum value expected"; + case 0: + case 55721409: + case 239771840: + break; + } + } + if (message.peerIpAddress != null && message.hasOwnProperty("peerIpAddress")) { + properties._peerIpAddress = 1; + if (!$util.isString(message.peerIpAddress)) + return "peerIpAddress: string expected"; + } + if (message.provisionedLinkCount != null && message.hasOwnProperty("provisionedLinkCount")) { + properties._provisionedLinkCount = 1; + if (!$util.isInteger(message.provisionedLinkCount)) + return "provisionedLinkCount: integer expected"; + } + if (message.requestedLinkCount != null && message.hasOwnProperty("requestedLinkCount")) { + properties._requestedLinkCount = 1; + if (!$util.isInteger(message.requestedLinkCount)) + return "requestedLinkCount: integer expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 314733318: + case 517333979: + break; + } + } + return null; + }; + + /** + * Creates an Interconnect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Interconnect} Interconnect + */ + Interconnect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Interconnect) + return object; + var message = new $root.google.cloud.compute.v1.Interconnect(); + if (object.adminEnabled != null) + message.adminEnabled = Boolean(object.adminEnabled); + if (object.circuitInfos) { + if (!Array.isArray(object.circuitInfos)) + throw TypeError(".google.cloud.compute.v1.Interconnect.circuitInfos: array expected"); + message.circuitInfos = []; + for (var i = 0; i < object.circuitInfos.length; ++i) { + if (typeof object.circuitInfos[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Interconnect.circuitInfos: object expected"); + message.circuitInfos[i] = $root.google.cloud.compute.v1.InterconnectCircuitInfo.fromObject(object.circuitInfos[i]); + } + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.customerName != null) + message.customerName = String(object.customerName); + if (object.description != null) + message.description = String(object.description); + if (object.expectedOutages) { + if (!Array.isArray(object.expectedOutages)) + throw TypeError(".google.cloud.compute.v1.Interconnect.expectedOutages: array expected"); + message.expectedOutages = []; + for (var i = 0; i < object.expectedOutages.length; ++i) { + if (typeof object.expectedOutages[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Interconnect.expectedOutages: object expected"); + message.expectedOutages[i] = $root.google.cloud.compute.v1.InterconnectOutageNotification.fromObject(object.expectedOutages[i]); + } + } + if (object.googleIpAddress != null) + message.googleIpAddress = String(object.googleIpAddress); + if (object.googleReferenceId != null) + message.googleReferenceId = String(object.googleReferenceId); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.interconnectAttachments) { + if (!Array.isArray(object.interconnectAttachments)) + throw TypeError(".google.cloud.compute.v1.Interconnect.interconnectAttachments: array expected"); + message.interconnectAttachments = []; + for (var i = 0; i < object.interconnectAttachments.length; ++i) + message.interconnectAttachments[i] = String(object.interconnectAttachments[i]); + } + switch (object.interconnectType) { + case "UNDEFINED_INTERCONNECT_TYPE": + case 0: + message.interconnectType = 0; + break; + case "DEDICATED": + case 258411983: + message.interconnectType = 258411983; + break; + case "IT_PRIVATE": + case 335677007: + message.interconnectType = 335677007; + break; + case "PARTNER": + case 461924520: + message.interconnectType = 461924520; + break; + } + if (object.kind != null) + message.kind = String(object.kind); + switch (object.linkType) { + case "UNDEFINED_LINK_TYPE": + case 0: + message.linkType = 0; + break; + case "LINK_TYPE_ETHERNET_100G_LR": + case 337672551: + message.linkType = 337672551; + break; + case "LINK_TYPE_ETHERNET_10G_LR": + case 236739749: + message.linkType = 236739749; + break; + } + if (object.location != null) + message.location = String(object.location); + if (object.name != null) + message.name = String(object.name); + if (object.nocContactEmail != null) + message.nocContactEmail = String(object.nocContactEmail); + switch (object.operationalStatus) { + case "UNDEFINED_OPERATIONAL_STATUS": + case 0: + message.operationalStatus = 0; + break; + case "OS_ACTIVE": + case 55721409: + message.operationalStatus = 55721409; + break; + case "OS_UNPROVISIONED": + case 239771840: + message.operationalStatus = 239771840; + break; + } + if (object.peerIpAddress != null) + message.peerIpAddress = String(object.peerIpAddress); + if (object.provisionedLinkCount != null) + message.provisionedLinkCount = object.provisionedLinkCount | 0; + if (object.requestedLinkCount != null) + message.requestedLinkCount = object.requestedLinkCount | 0; + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 314733318: + message.state = 314733318; + break; + case "UNPROVISIONED": + case 517333979: + message.state = 517333979; + break; + } + return message; + }; + + /** + * Creates a plain object from an Interconnect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Interconnect + * @static + * @param {google.cloud.compute.v1.Interconnect} message Interconnect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interconnect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.circuitInfos = []; + object.expectedOutages = []; + object.interconnectAttachments = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.customerName != null && message.hasOwnProperty("customerName")) { + object.customerName = message.customerName; + if (options.oneofs) + object._customerName = "customerName"; + } + if (message.nocContactEmail != null && message.hasOwnProperty("nocContactEmail")) { + object.nocContactEmail = message.nocContactEmail; + if (options.oneofs) + object._nocContactEmail = "nocContactEmail"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.requestedLinkCount != null && message.hasOwnProperty("requestedLinkCount")) { + object.requestedLinkCount = message.requestedLinkCount; + if (options.oneofs) + object._requestedLinkCount = "requestedLinkCount"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.Interconnect.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.circuitInfos && message.circuitInfos.length) { + object.circuitInfos = []; + for (var j = 0; j < message.circuitInfos.length; ++j) + object.circuitInfos[j] = $root.google.cloud.compute.v1.InterconnectCircuitInfo.toObject(message.circuitInfos[j], options); + } + if (message.operationalStatus != null && message.hasOwnProperty("operationalStatus")) { + object.operationalStatus = options.enums === String ? $root.google.cloud.compute.v1.Interconnect.OperationalStatus[message.operationalStatus] : message.operationalStatus; + if (options.oneofs) + object._operationalStatus = "operationalStatus"; + } + if (message.peerIpAddress != null && message.hasOwnProperty("peerIpAddress")) { + object.peerIpAddress = message.peerIpAddress; + if (options.oneofs) + object._peerIpAddress = "peerIpAddress"; + } + if (message.expectedOutages && message.expectedOutages.length) { + object.expectedOutages = []; + for (var j = 0; j < message.expectedOutages.length; ++j) + object.expectedOutages[j] = $root.google.cloud.compute.v1.InterconnectOutageNotification.toObject(message.expectedOutages[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) { + object.location = message.location; + if (options.oneofs) + object._location = "location"; + } + if (message.provisionedLinkCount != null && message.hasOwnProperty("provisionedLinkCount")) { + object.provisionedLinkCount = message.provisionedLinkCount; + if (options.oneofs) + object._provisionedLinkCount = "provisionedLinkCount"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.interconnectAttachments && message.interconnectAttachments.length) { + object.interconnectAttachments = []; + for (var j = 0; j < message.interconnectAttachments.length; ++j) + object.interconnectAttachments[j] = message.interconnectAttachments[j]; + } + if (message.googleIpAddress != null && message.hasOwnProperty("googleIpAddress")) { + object.googleIpAddress = message.googleIpAddress; + if (options.oneofs) + object._googleIpAddress = "googleIpAddress"; + } + if (message.adminEnabled != null && message.hasOwnProperty("adminEnabled")) { + object.adminEnabled = message.adminEnabled; + if (options.oneofs) + object._adminEnabled = "adminEnabled"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.interconnectType != null && message.hasOwnProperty("interconnectType")) { + object.interconnectType = options.enums === String ? $root.google.cloud.compute.v1.Interconnect.InterconnectType[message.interconnectType] : message.interconnectType; + if (options.oneofs) + object._interconnectType = "interconnectType"; + } + if (message.linkType != null && message.hasOwnProperty("linkType")) { + object.linkType = options.enums === String ? $root.google.cloud.compute.v1.Interconnect.LinkType[message.linkType] : message.linkType; + if (options.oneofs) + object._linkType = "linkType"; + } + if (message.googleReferenceId != null && message.hasOwnProperty("googleReferenceId")) { + object.googleReferenceId = message.googleReferenceId; + if (options.oneofs) + object._googleReferenceId = "googleReferenceId"; + } + return object; + }; + + /** + * Converts this Interconnect to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Interconnect + * @instance + * @returns {Object.} JSON object + */ + Interconnect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InterconnectType enum. + * @name google.cloud.compute.v1.Interconnect.InterconnectType + * @enum {number} + * @property {number} UNDEFINED_INTERCONNECT_TYPE=0 UNDEFINED_INTERCONNECT_TYPE value + * @property {number} DEDICATED=258411983 DEDICATED value + * @property {number} IT_PRIVATE=335677007 IT_PRIVATE value + * @property {number} PARTNER=461924520 PARTNER value + */ + Interconnect.InterconnectType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_INTERCONNECT_TYPE"] = 0; + values[valuesById[258411983] = "DEDICATED"] = 258411983; + values[valuesById[335677007] = "IT_PRIVATE"] = 335677007; + values[valuesById[461924520] = "PARTNER"] = 461924520; + return values; + })(); + + /** + * LinkType enum. + * @name google.cloud.compute.v1.Interconnect.LinkType + * @enum {number} + * @property {number} UNDEFINED_LINK_TYPE=0 UNDEFINED_LINK_TYPE value + * @property {number} LINK_TYPE_ETHERNET_100G_LR=337672551 LINK_TYPE_ETHERNET_100G_LR value + * @property {number} LINK_TYPE_ETHERNET_10G_LR=236739749 LINK_TYPE_ETHERNET_10G_LR value + */ + Interconnect.LinkType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LINK_TYPE"] = 0; + values[valuesById[337672551] = "LINK_TYPE_ETHERNET_100G_LR"] = 337672551; + values[valuesById[236739749] = "LINK_TYPE_ETHERNET_10G_LR"] = 236739749; + return values; + })(); + + /** + * OperationalStatus enum. + * @name google.cloud.compute.v1.Interconnect.OperationalStatus + * @enum {number} + * @property {number} UNDEFINED_OPERATIONAL_STATUS=0 UNDEFINED_OPERATIONAL_STATUS value + * @property {number} OS_ACTIVE=55721409 OS_ACTIVE value + * @property {number} OS_UNPROVISIONED=239771840 OS_UNPROVISIONED value + */ + Interconnect.OperationalStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_OPERATIONAL_STATUS"] = 0; + values[valuesById[55721409] = "OS_ACTIVE"] = 55721409; + values[valuesById[239771840] = "OS_UNPROVISIONED"] = 239771840; + return values; + })(); + + /** + * State enum. + * @name google.cloud.compute.v1.Interconnect.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} UNPROVISIONED=517333979 UNPROVISIONED value + */ + Interconnect.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[517333979] = "UNPROVISIONED"] = 517333979; + return values; + })(); + + return Interconnect; + })(); + + v1.InterconnectAttachmentPartnerMetadata = (function() { + + /** + * Properties of an InterconnectAttachmentPartnerMetadata. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectAttachmentPartnerMetadata + * @property {string|null} [interconnectName] InterconnectAttachmentPartnerMetadata interconnectName + * @property {string|null} [partnerName] InterconnectAttachmentPartnerMetadata partnerName + * @property {string|null} [portalUrl] InterconnectAttachmentPartnerMetadata portalUrl + */ + + /** + * Constructs a new InterconnectAttachmentPartnerMetadata. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectAttachmentPartnerMetadata. + * @implements IInterconnectAttachmentPartnerMetadata + * @constructor + * @param {google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata=} [properties] Properties to set + */ + function InterconnectAttachmentPartnerMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectAttachmentPartnerMetadata interconnectName. + * @member {string|null|undefined} interconnectName + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @instance + */ + InterconnectAttachmentPartnerMetadata.prototype.interconnectName = null; + + /** + * InterconnectAttachmentPartnerMetadata partnerName. + * @member {string|null|undefined} partnerName + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @instance + */ + InterconnectAttachmentPartnerMetadata.prototype.partnerName = null; + + /** + * InterconnectAttachmentPartnerMetadata portalUrl. + * @member {string|null|undefined} portalUrl + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @instance + */ + InterconnectAttachmentPartnerMetadata.prototype.portalUrl = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectAttachmentPartnerMetadata _interconnectName. + * @member {"interconnectName"|undefined} _interconnectName + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @instance + */ + Object.defineProperty(InterconnectAttachmentPartnerMetadata.prototype, "_interconnectName", { + get: $util.oneOfGetter($oneOfFields = ["interconnectName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentPartnerMetadata _partnerName. + * @member {"partnerName"|undefined} _partnerName + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @instance + */ + Object.defineProperty(InterconnectAttachmentPartnerMetadata.prototype, "_partnerName", { + get: $util.oneOfGetter($oneOfFields = ["partnerName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentPartnerMetadata _portalUrl. + * @member {"portalUrl"|undefined} _portalUrl + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @instance + */ + Object.defineProperty(InterconnectAttachmentPartnerMetadata.prototype, "_portalUrl", { + get: $util.oneOfGetter($oneOfFields = ["portalUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectAttachmentPartnerMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata} InterconnectAttachmentPartnerMetadata instance + */ + InterconnectAttachmentPartnerMetadata.create = function create(properties) { + return new InterconnectAttachmentPartnerMetadata(properties); + }; + + /** + * Encodes the specified InterconnectAttachmentPartnerMetadata message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata} message InterconnectAttachmentPartnerMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentPartnerMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partnerName != null && Object.hasOwnProperty.call(message, "partnerName")) + writer.uint32(/* id 161747874, wireType 2 =*/1293982994).string(message.partnerName); + if (message.portalUrl != null && Object.hasOwnProperty.call(message, "portalUrl")) + writer.uint32(/* id 269182748, wireType 2 =*/2153461986).string(message.portalUrl); + if (message.interconnectName != null && Object.hasOwnProperty.call(message, "interconnectName")) + writer.uint32(/* id 514963356, wireType 2 =*/4119706850).string(message.interconnectName); + return writer; + }; + + /** + * Encodes the specified InterconnectAttachmentPartnerMetadata message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata} message InterconnectAttachmentPartnerMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentPartnerMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectAttachmentPartnerMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata} InterconnectAttachmentPartnerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentPartnerMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 514963356: + message.interconnectName = reader.string(); + break; + case 161747874: + message.partnerName = reader.string(); + break; + case 269182748: + message.portalUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectAttachmentPartnerMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata} InterconnectAttachmentPartnerMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentPartnerMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectAttachmentPartnerMetadata message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectAttachmentPartnerMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnectName != null && message.hasOwnProperty("interconnectName")) { + properties._interconnectName = 1; + if (!$util.isString(message.interconnectName)) + return "interconnectName: string expected"; + } + if (message.partnerName != null && message.hasOwnProperty("partnerName")) { + properties._partnerName = 1; + if (!$util.isString(message.partnerName)) + return "partnerName: string expected"; + } + if (message.portalUrl != null && message.hasOwnProperty("portalUrl")) { + properties._portalUrl = 1; + if (!$util.isString(message.portalUrl)) + return "portalUrl: string expected"; + } + return null; + }; + + /** + * Creates an InterconnectAttachmentPartnerMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata} InterconnectAttachmentPartnerMetadata + */ + InterconnectAttachmentPartnerMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata(); + if (object.interconnectName != null) + message.interconnectName = String(object.interconnectName); + if (object.partnerName != null) + message.partnerName = String(object.partnerName); + if (object.portalUrl != null) + message.portalUrl = String(object.portalUrl); + return message; + }; + + /** + * Creates a plain object from an InterconnectAttachmentPartnerMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @static + * @param {google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata} message InterconnectAttachmentPartnerMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectAttachmentPartnerMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.partnerName != null && message.hasOwnProperty("partnerName")) { + object.partnerName = message.partnerName; + if (options.oneofs) + object._partnerName = "partnerName"; + } + if (message.portalUrl != null && message.hasOwnProperty("portalUrl")) { + object.portalUrl = message.portalUrl; + if (options.oneofs) + object._portalUrl = "portalUrl"; + } + if (message.interconnectName != null && message.hasOwnProperty("interconnectName")) { + object.interconnectName = message.interconnectName; + if (options.oneofs) + object._interconnectName = "interconnectName"; + } + return object; + }; + + /** + * Converts this InterconnectAttachmentPartnerMetadata to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata + * @instance + * @returns {Object.} JSON object + */ + InterconnectAttachmentPartnerMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectAttachmentPartnerMetadata; + })(); + + v1.InterconnectAttachmentPrivateInfo = (function() { + + /** + * Properties of an InterconnectAttachmentPrivateInfo. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectAttachmentPrivateInfo + * @property {number|null} [tag8021q] InterconnectAttachmentPrivateInfo tag8021q + */ + + /** + * Constructs a new InterconnectAttachmentPrivateInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectAttachmentPrivateInfo. + * @implements IInterconnectAttachmentPrivateInfo + * @constructor + * @param {google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo=} [properties] Properties to set + */ + function InterconnectAttachmentPrivateInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectAttachmentPrivateInfo tag8021q. + * @member {number|null|undefined} tag8021q + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @instance + */ + InterconnectAttachmentPrivateInfo.prototype.tag8021q = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectAttachmentPrivateInfo _tag8021q. + * @member {"tag8021q"|undefined} _tag8021q + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @instance + */ + Object.defineProperty(InterconnectAttachmentPrivateInfo.prototype, "_tag8021q", { + get: $util.oneOfGetter($oneOfFields = ["tag8021q"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectAttachmentPrivateInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectAttachmentPrivateInfo} InterconnectAttachmentPrivateInfo instance + */ + InterconnectAttachmentPrivateInfo.create = function create(properties) { + return new InterconnectAttachmentPrivateInfo(properties); + }; + + /** + * Encodes the specified InterconnectAttachmentPrivateInfo message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo} message InterconnectAttachmentPrivateInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentPrivateInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag8021q != null && Object.hasOwnProperty.call(message, "tag8021q")) + writer.uint32(/* id 271820992, wireType 0 =*/2174567936).uint32(message.tag8021q); + return writer; + }; + + /** + * Encodes the specified InterconnectAttachmentPrivateInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo} message InterconnectAttachmentPrivateInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentPrivateInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectAttachmentPrivateInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectAttachmentPrivateInfo} InterconnectAttachmentPrivateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentPrivateInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 271820992: + message.tag8021q = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectAttachmentPrivateInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectAttachmentPrivateInfo} InterconnectAttachmentPrivateInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentPrivateInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectAttachmentPrivateInfo message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectAttachmentPrivateInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tag8021q != null && message.hasOwnProperty("tag8021q")) { + properties._tag8021q = 1; + if (!$util.isInteger(message.tag8021q)) + return "tag8021q: integer expected"; + } + return null; + }; + + /** + * Creates an InterconnectAttachmentPrivateInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectAttachmentPrivateInfo} InterconnectAttachmentPrivateInfo + */ + InterconnectAttachmentPrivateInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo(); + if (object.tag8021q != null) + message.tag8021q = object.tag8021q >>> 0; + return message; + }; + + /** + * Creates a plain object from an InterconnectAttachmentPrivateInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @static + * @param {google.cloud.compute.v1.InterconnectAttachmentPrivateInfo} message InterconnectAttachmentPrivateInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectAttachmentPrivateInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tag8021q != null && message.hasOwnProperty("tag8021q")) { + object.tag8021q = message.tag8021q; + if (options.oneofs) + object._tag8021q = "tag8021q"; + } + return object; + }; + + /** + * Converts this InterconnectAttachmentPrivateInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectAttachmentPrivateInfo + * @instance + * @returns {Object.} JSON object + */ + InterconnectAttachmentPrivateInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectAttachmentPrivateInfo; + })(); + + v1.InterconnectAttachment = (function() { + + /** + * Properties of an InterconnectAttachment. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectAttachment + * @property {boolean|null} [adminEnabled] InterconnectAttachment adminEnabled + * @property {google.cloud.compute.v1.InterconnectAttachment.Bandwidth|null} [bandwidth] InterconnectAttachment bandwidth + * @property {Array.|null} [candidateSubnets] InterconnectAttachment candidateSubnets + * @property {string|null} [cloudRouterIpAddress] InterconnectAttachment cloudRouterIpAddress + * @property {string|null} [creationTimestamp] InterconnectAttachment creationTimestamp + * @property {string|null} [customerRouterIpAddress] InterconnectAttachment customerRouterIpAddress + * @property {number|null} [dataplaneVersion] InterconnectAttachment dataplaneVersion + * @property {string|null} [description] InterconnectAttachment description + * @property {google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain|null} [edgeAvailabilityDomain] InterconnectAttachment edgeAvailabilityDomain + * @property {google.cloud.compute.v1.InterconnectAttachment.Encryption|null} [encryption] InterconnectAttachment encryption + * @property {string|null} [googleReferenceId] InterconnectAttachment googleReferenceId + * @property {number|Long|null} [id] InterconnectAttachment id + * @property {string|null} [interconnect] InterconnectAttachment interconnect + * @property {Array.|null} [ipsecInternalAddresses] InterconnectAttachment ipsecInternalAddresses + * @property {string|null} [kind] InterconnectAttachment kind + * @property {number|null} [mtu] InterconnectAttachment mtu + * @property {string|null} [name] InterconnectAttachment name + * @property {google.cloud.compute.v1.InterconnectAttachment.OperationalStatus|null} [operationalStatus] InterconnectAttachment operationalStatus + * @property {string|null} [pairingKey] InterconnectAttachment pairingKey + * @property {number|Long|null} [partnerAsn] InterconnectAttachment partnerAsn + * @property {google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata|null} [partnerMetadata] InterconnectAttachment partnerMetadata + * @property {google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo|null} [privateInterconnectInfo] InterconnectAttachment privateInterconnectInfo + * @property {string|null} [region] InterconnectAttachment region + * @property {string|null} [router] InterconnectAttachment router + * @property {string|null} [selfLink] InterconnectAttachment selfLink + * @property {google.cloud.compute.v1.InterconnectAttachment.State|null} [state] InterconnectAttachment state + * @property {google.cloud.compute.v1.InterconnectAttachment.Type|null} [type] InterconnectAttachment type + * @property {number|null} [vlanTag8021q] InterconnectAttachment vlanTag8021q + */ + + /** + * Constructs a new InterconnectAttachment. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectAttachment. + * @implements IInterconnectAttachment + * @constructor + * @param {google.cloud.compute.v1.IInterconnectAttachment=} [properties] Properties to set + */ + function InterconnectAttachment(properties) { + this.candidateSubnets = []; + this.ipsecInternalAddresses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectAttachment adminEnabled. + * @member {boolean|null|undefined} adminEnabled + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.adminEnabled = null; + + /** + * InterconnectAttachment bandwidth. + * @member {google.cloud.compute.v1.InterconnectAttachment.Bandwidth|null|undefined} bandwidth + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.bandwidth = null; + + /** + * InterconnectAttachment candidateSubnets. + * @member {Array.} candidateSubnets + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.candidateSubnets = $util.emptyArray; + + /** + * InterconnectAttachment cloudRouterIpAddress. + * @member {string|null|undefined} cloudRouterIpAddress + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.cloudRouterIpAddress = null; + + /** + * InterconnectAttachment creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.creationTimestamp = null; + + /** + * InterconnectAttachment customerRouterIpAddress. + * @member {string|null|undefined} customerRouterIpAddress + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.customerRouterIpAddress = null; + + /** + * InterconnectAttachment dataplaneVersion. + * @member {number|null|undefined} dataplaneVersion + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.dataplaneVersion = null; + + /** + * InterconnectAttachment description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.description = null; + + /** + * InterconnectAttachment edgeAvailabilityDomain. + * @member {google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain|null|undefined} edgeAvailabilityDomain + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.edgeAvailabilityDomain = null; + + /** + * InterconnectAttachment encryption. + * @member {google.cloud.compute.v1.InterconnectAttachment.Encryption|null|undefined} encryption + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.encryption = null; + + /** + * InterconnectAttachment googleReferenceId. + * @member {string|null|undefined} googleReferenceId + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.googleReferenceId = null; + + /** + * InterconnectAttachment id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.id = null; + + /** + * InterconnectAttachment interconnect. + * @member {string|null|undefined} interconnect + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.interconnect = null; + + /** + * InterconnectAttachment ipsecInternalAddresses. + * @member {Array.} ipsecInternalAddresses + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.ipsecInternalAddresses = $util.emptyArray; + + /** + * InterconnectAttachment kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.kind = null; + + /** + * InterconnectAttachment mtu. + * @member {number|null|undefined} mtu + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.mtu = null; + + /** + * InterconnectAttachment name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.name = null; + + /** + * InterconnectAttachment operationalStatus. + * @member {google.cloud.compute.v1.InterconnectAttachment.OperationalStatus|null|undefined} operationalStatus + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.operationalStatus = null; + + /** + * InterconnectAttachment pairingKey. + * @member {string|null|undefined} pairingKey + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.pairingKey = null; + + /** + * InterconnectAttachment partnerAsn. + * @member {number|Long|null|undefined} partnerAsn + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.partnerAsn = null; + + /** + * InterconnectAttachment partnerMetadata. + * @member {google.cloud.compute.v1.IInterconnectAttachmentPartnerMetadata|null|undefined} partnerMetadata + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.partnerMetadata = null; + + /** + * InterconnectAttachment privateInterconnectInfo. + * @member {google.cloud.compute.v1.IInterconnectAttachmentPrivateInfo|null|undefined} privateInterconnectInfo + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.privateInterconnectInfo = null; + + /** + * InterconnectAttachment region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.region = null; + + /** + * InterconnectAttachment router. + * @member {string|null|undefined} router + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.router = null; + + /** + * InterconnectAttachment selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.selfLink = null; + + /** + * InterconnectAttachment state. + * @member {google.cloud.compute.v1.InterconnectAttachment.State|null|undefined} state + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.state = null; + + /** + * InterconnectAttachment type. + * @member {google.cloud.compute.v1.InterconnectAttachment.Type|null|undefined} type + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.type = null; + + /** + * InterconnectAttachment vlanTag8021q. + * @member {number|null|undefined} vlanTag8021q + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + InterconnectAttachment.prototype.vlanTag8021q = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectAttachment _adminEnabled. + * @member {"adminEnabled"|undefined} _adminEnabled + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_adminEnabled", { + get: $util.oneOfGetter($oneOfFields = ["adminEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _bandwidth. + * @member {"bandwidth"|undefined} _bandwidth + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_bandwidth", { + get: $util.oneOfGetter($oneOfFields = ["bandwidth"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _cloudRouterIpAddress. + * @member {"cloudRouterIpAddress"|undefined} _cloudRouterIpAddress + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_cloudRouterIpAddress", { + get: $util.oneOfGetter($oneOfFields = ["cloudRouterIpAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _customerRouterIpAddress. + * @member {"customerRouterIpAddress"|undefined} _customerRouterIpAddress + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_customerRouterIpAddress", { + get: $util.oneOfGetter($oneOfFields = ["customerRouterIpAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _dataplaneVersion. + * @member {"dataplaneVersion"|undefined} _dataplaneVersion + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_dataplaneVersion", { + get: $util.oneOfGetter($oneOfFields = ["dataplaneVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _edgeAvailabilityDomain. + * @member {"edgeAvailabilityDomain"|undefined} _edgeAvailabilityDomain + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_edgeAvailabilityDomain", { + get: $util.oneOfGetter($oneOfFields = ["edgeAvailabilityDomain"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _encryption. + * @member {"encryption"|undefined} _encryption + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_encryption", { + get: $util.oneOfGetter($oneOfFields = ["encryption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _googleReferenceId. + * @member {"googleReferenceId"|undefined} _googleReferenceId + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_googleReferenceId", { + get: $util.oneOfGetter($oneOfFields = ["googleReferenceId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _interconnect. + * @member {"interconnect"|undefined} _interconnect + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_interconnect", { + get: $util.oneOfGetter($oneOfFields = ["interconnect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _mtu. + * @member {"mtu"|undefined} _mtu + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_mtu", { + get: $util.oneOfGetter($oneOfFields = ["mtu"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _operationalStatus. + * @member {"operationalStatus"|undefined} _operationalStatus + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_operationalStatus", { + get: $util.oneOfGetter($oneOfFields = ["operationalStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _pairingKey. + * @member {"pairingKey"|undefined} _pairingKey + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_pairingKey", { + get: $util.oneOfGetter($oneOfFields = ["pairingKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _partnerAsn. + * @member {"partnerAsn"|undefined} _partnerAsn + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_partnerAsn", { + get: $util.oneOfGetter($oneOfFields = ["partnerAsn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _partnerMetadata. + * @member {"partnerMetadata"|undefined} _partnerMetadata + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_partnerMetadata", { + get: $util.oneOfGetter($oneOfFields = ["partnerMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _privateInterconnectInfo. + * @member {"privateInterconnectInfo"|undefined} _privateInterconnectInfo + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_privateInterconnectInfo", { + get: $util.oneOfGetter($oneOfFields = ["privateInterconnectInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _router. + * @member {"router"|undefined} _router + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_router", { + get: $util.oneOfGetter($oneOfFields = ["router"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachment _vlanTag8021q. + * @member {"vlanTag8021q"|undefined} _vlanTag8021q + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + */ + Object.defineProperty(InterconnectAttachment.prototype, "_vlanTag8021q", { + get: $util.oneOfGetter($oneOfFields = ["vlanTag8021q"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectAttachment instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachment=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectAttachment} InterconnectAttachment instance + */ + InterconnectAttachment.create = function create(properties) { + return new InterconnectAttachment(properties); + }; + + /** + * Encodes the specified InterconnectAttachment message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachment.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachment} message InterconnectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.mtu != null && Object.hasOwnProperty.call(message, "mtu")) + writer.uint32(/* id 108462, wireType 0 =*/867696).int32(message.mtu); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.dataplaneVersion != null && Object.hasOwnProperty.call(message, "dataplaneVersion")) + writer.uint32(/* id 34920075, wireType 0 =*/279360600).int32(message.dataplaneVersion); + if (message.partnerMetadata != null && Object.hasOwnProperty.call(message, "partnerMetadata")) + $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.encode(message.partnerMetadata, writer.uint32(/* id 65908934, wireType 2 =*/527271474).fork()).ldelim(); + if (message.edgeAvailabilityDomain != null && Object.hasOwnProperty.call(message, "edgeAvailabilityDomain")) + writer.uint32(/* id 71289510, wireType 0 =*/570316080).int32(message.edgeAvailabilityDomain); + if (message.encryption != null && Object.hasOwnProperty.call(message, "encryption")) + writer.uint32(/* id 97980291, wireType 0 =*/783842328).int32(message.encryption); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.vlanTag8021q != null && Object.hasOwnProperty.call(message, "vlanTag8021q")) + writer.uint32(/* id 119927836, wireType 0 =*/959422688).int32(message.vlanTag8021q); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.bandwidth != null && Object.hasOwnProperty.call(message, "bandwidth")) + writer.uint32(/* id 181715121, wireType 0 =*/1453720968).int32(message.bandwidth); + if (message.operationalStatus != null && Object.hasOwnProperty.call(message, "operationalStatus")) + writer.uint32(/* id 201070847, wireType 0 =*/1608566776).int32(message.operationalStatus); + if (message.interconnect != null && Object.hasOwnProperty.call(message, "interconnect")) + writer.uint32(/* id 224601230, wireType 2 =*/1796809842).string(message.interconnect); + if (message.privateInterconnectInfo != null && Object.hasOwnProperty.call(message, "privateInterconnectInfo")) + $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.encode(message.privateInterconnectInfo, writer.uint32(/* id 237270531, wireType 2 =*/1898164250).fork()).ldelim(); + if (message.candidateSubnets != null && message.candidateSubnets.length) + for (var i = 0; i < message.candidateSubnets.length; ++i) + writer.uint32(/* id 237842938, wireType 2 =*/1902743506).string(message.candidateSubnets[i]); + if (message.cloudRouterIpAddress != null && Object.hasOwnProperty.call(message, "cloudRouterIpAddress")) + writer.uint32(/* id 287392776, wireType 2 =*/2299142210).string(message.cloudRouterIpAddress); + if (message.customerRouterIpAddress != null && Object.hasOwnProperty.call(message, "customerRouterIpAddress")) + writer.uint32(/* id 332475761, wireType 2 =*/2659806090).string(message.customerRouterIpAddress); + if (message.ipsecInternalAddresses != null && message.ipsecInternalAddresses.length) + for (var i = 0; i < message.ipsecInternalAddresses.length; ++i) + writer.uint32(/* id 407648565, wireType 2 =*/3261188522).string(message.ipsecInternalAddresses[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.partnerAsn != null && Object.hasOwnProperty.call(message, "partnerAsn")) + writer.uint32(/* id 438166149, wireType 0 =*/3505329192).int64(message.partnerAsn); + if (message.pairingKey != null && Object.hasOwnProperty.call(message, "pairingKey")) + writer.uint32(/* id 439695464, wireType 2 =*/3517563714).string(message.pairingKey); + if (message.adminEnabled != null && Object.hasOwnProperty.call(message, "adminEnabled")) + writer.uint32(/* id 445675089, wireType 0 =*/3565400712).bool(message.adminEnabled); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.googleReferenceId != null && Object.hasOwnProperty.call(message, "googleReferenceId")) + writer.uint32(/* id 534944469, wireType 2 =*/4279555754).string(message.googleReferenceId); + return writer; + }; + + /** + * Encodes the specified InterconnectAttachment message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachment} message InterconnectAttachment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectAttachment} InterconnectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectAttachment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 445675089: + message.adminEnabled = reader.bool(); + break; + case 181715121: + message.bandwidth = reader.int32(); + break; + case 237842938: + if (!(message.candidateSubnets && message.candidateSubnets.length)) + message.candidateSubnets = []; + message.candidateSubnets.push(reader.string()); + break; + case 287392776: + message.cloudRouterIpAddress = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 332475761: + message.customerRouterIpAddress = reader.string(); + break; + case 34920075: + message.dataplaneVersion = reader.int32(); + break; + case 422937596: + message.description = reader.string(); + break; + case 71289510: + message.edgeAvailabilityDomain = reader.int32(); + break; + case 97980291: + message.encryption = reader.int32(); + break; + case 534944469: + message.googleReferenceId = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 224601230: + message.interconnect = reader.string(); + break; + case 407648565: + if (!(message.ipsecInternalAddresses && message.ipsecInternalAddresses.length)) + message.ipsecInternalAddresses = []; + message.ipsecInternalAddresses.push(reader.string()); + break; + case 3292052: + message.kind = reader.string(); + break; + case 108462: + message.mtu = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 201070847: + message.operationalStatus = reader.int32(); + break; + case 439695464: + message.pairingKey = reader.string(); + break; + case 438166149: + message.partnerAsn = reader.int64(); + break; + case 65908934: + message.partnerMetadata = $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.decode(reader, reader.uint32()); + break; + case 237270531: + message.privateInterconnectInfo = $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.decode(reader, reader.uint32()); + break; + case 138946292: + message.region = reader.string(); + break; + case 148608841: + message.router = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 109757585: + message.state = reader.int32(); + break; + case 3575610: + message.type = reader.int32(); + break; + case 119927836: + message.vlanTag8021q = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectAttachment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectAttachment} InterconnectAttachment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectAttachment message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectAttachment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.adminEnabled != null && message.hasOwnProperty("adminEnabled")) { + properties._adminEnabled = 1; + if (typeof message.adminEnabled !== "boolean") + return "adminEnabled: boolean expected"; + } + if (message.bandwidth != null && message.hasOwnProperty("bandwidth")) { + properties._bandwidth = 1; + switch (message.bandwidth) { + default: + return "bandwidth: enum value expected"; + case 0: + case 49547958: + case 278693006: + case 355358448: + case 49577749: + case 278693967: + case 355358479: + case 49607540: + case 49637331: + case 49667122: + case 278696850: + case 278696856: + case 355358572: + break; + } + } + if (message.candidateSubnets != null && message.hasOwnProperty("candidateSubnets")) { + if (!Array.isArray(message.candidateSubnets)) + return "candidateSubnets: array expected"; + for (var i = 0; i < message.candidateSubnets.length; ++i) + if (!$util.isString(message.candidateSubnets[i])) + return "candidateSubnets: string[] expected"; + } + if (message.cloudRouterIpAddress != null && message.hasOwnProperty("cloudRouterIpAddress")) { + properties._cloudRouterIpAddress = 1; + if (!$util.isString(message.cloudRouterIpAddress)) + return "cloudRouterIpAddress: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.customerRouterIpAddress != null && message.hasOwnProperty("customerRouterIpAddress")) { + properties._customerRouterIpAddress = 1; + if (!$util.isString(message.customerRouterIpAddress)) + return "customerRouterIpAddress: string expected"; + } + if (message.dataplaneVersion != null && message.hasOwnProperty("dataplaneVersion")) { + properties._dataplaneVersion = 1; + if (!$util.isInteger(message.dataplaneVersion)) + return "dataplaneVersion: integer expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.edgeAvailabilityDomain != null && message.hasOwnProperty("edgeAvailabilityDomain")) { + properties._edgeAvailabilityDomain = 1; + switch (message.edgeAvailabilityDomain) { + default: + return "edgeAvailabilityDomain: enum value expected"; + case 0: + case 349552090: + case 349552091: + case 375256373: + break; + } + } + if (message.encryption != null && message.hasOwnProperty("encryption")) { + properties._encryption = 1; + switch (message.encryption) { + default: + return "encryption: enum value expected"; + case 0: + case 69882282: + case 2402104: + break; + } + } + if (message.googleReferenceId != null && message.hasOwnProperty("googleReferenceId")) { + properties._googleReferenceId = 1; + if (!$util.isString(message.googleReferenceId)) + return "googleReferenceId: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.interconnect != null && message.hasOwnProperty("interconnect")) { + properties._interconnect = 1; + if (!$util.isString(message.interconnect)) + return "interconnect: string expected"; + } + if (message.ipsecInternalAddresses != null && message.hasOwnProperty("ipsecInternalAddresses")) { + if (!Array.isArray(message.ipsecInternalAddresses)) + return "ipsecInternalAddresses: array expected"; + for (var i = 0; i < message.ipsecInternalAddresses.length; ++i) + if (!$util.isString(message.ipsecInternalAddresses[i])) + return "ipsecInternalAddresses: string[] expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.mtu != null && message.hasOwnProperty("mtu")) { + properties._mtu = 1; + if (!$util.isInteger(message.mtu)) + return "mtu: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.operationalStatus != null && message.hasOwnProperty("operationalStatus")) { + properties._operationalStatus = 1; + switch (message.operationalStatus) { + default: + return "operationalStatus: enum value expected"; + case 0: + case 55721409: + case 239771840: + break; + } + } + if (message.pairingKey != null && message.hasOwnProperty("pairingKey")) { + properties._pairingKey = 1; + if (!$util.isString(message.pairingKey)) + return "pairingKey: string expected"; + } + if (message.partnerAsn != null && message.hasOwnProperty("partnerAsn")) { + properties._partnerAsn = 1; + if (!$util.isInteger(message.partnerAsn) && !(message.partnerAsn && $util.isInteger(message.partnerAsn.low) && $util.isInteger(message.partnerAsn.high))) + return "partnerAsn: integer|Long expected"; + } + if (message.partnerMetadata != null && message.hasOwnProperty("partnerMetadata")) { + properties._partnerMetadata = 1; + { + var error = $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.verify(message.partnerMetadata); + if (error) + return "partnerMetadata." + error; + } + } + if (message.privateInterconnectInfo != null && message.hasOwnProperty("privateInterconnectInfo")) { + properties._privateInterconnectInfo = 1; + { + var error = $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.verify(message.privateInterconnectInfo); + if (error) + return "privateInterconnectInfo." + error; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.router != null && message.hasOwnProperty("router")) { + properties._router = 1; + if (!$util.isString(message.router)) + return "router: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 314733318: + case 115891759: + case 513587304: + case 167494054: + case 387890656: + case 470755401: + case 517333979: + break; + } + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 258411983: + case 461924520: + case 483261352: + break; + } + } + if (message.vlanTag8021q != null && message.hasOwnProperty("vlanTag8021q")) { + properties._vlanTag8021q = 1; + if (!$util.isInteger(message.vlanTag8021q)) + return "vlanTag8021q: integer expected"; + } + return null; + }; + + /** + * Creates an InterconnectAttachment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectAttachment} InterconnectAttachment + */ + InterconnectAttachment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectAttachment) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectAttachment(); + if (object.adminEnabled != null) + message.adminEnabled = Boolean(object.adminEnabled); + switch (object.bandwidth) { + case "UNDEFINED_BANDWIDTH": + case 0: + message.bandwidth = 0; + break; + case "BPS_100M": + case 49547958: + message.bandwidth = 49547958; + break; + case "BPS_10G": + case 278693006: + message.bandwidth = 278693006; + break; + case "BPS_1G": + case 355358448: + message.bandwidth = 355358448; + break; + case "BPS_200M": + case 49577749: + message.bandwidth = 49577749; + break; + case "BPS_20G": + case 278693967: + message.bandwidth = 278693967; + break; + case "BPS_2G": + case 355358479: + message.bandwidth = 355358479; + break; + case "BPS_300M": + case 49607540: + message.bandwidth = 49607540; + break; + case "BPS_400M": + case 49637331: + message.bandwidth = 49637331; + break; + case "BPS_500M": + case 49667122: + message.bandwidth = 49667122; + break; + case "BPS_50G": + case 278696850: + message.bandwidth = 278696850; + break; + case "BPS_50M": + case 278696856: + message.bandwidth = 278696856; + break; + case "BPS_5G": + case 355358572: + message.bandwidth = 355358572; + break; + } + if (object.candidateSubnets) { + if (!Array.isArray(object.candidateSubnets)) + throw TypeError(".google.cloud.compute.v1.InterconnectAttachment.candidateSubnets: array expected"); + message.candidateSubnets = []; + for (var i = 0; i < object.candidateSubnets.length; ++i) + message.candidateSubnets[i] = String(object.candidateSubnets[i]); + } + if (object.cloudRouterIpAddress != null) + message.cloudRouterIpAddress = String(object.cloudRouterIpAddress); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.customerRouterIpAddress != null) + message.customerRouterIpAddress = String(object.customerRouterIpAddress); + if (object.dataplaneVersion != null) + message.dataplaneVersion = object.dataplaneVersion | 0; + if (object.description != null) + message.description = String(object.description); + switch (object.edgeAvailabilityDomain) { + case "UNDEFINED_EDGE_AVAILABILITY_DOMAIN": + case 0: + message.edgeAvailabilityDomain = 0; + break; + case "AVAILABILITY_DOMAIN_1": + case 349552090: + message.edgeAvailabilityDomain = 349552090; + break; + case "AVAILABILITY_DOMAIN_2": + case 349552091: + message.edgeAvailabilityDomain = 349552091; + break; + case "AVAILABILITY_DOMAIN_ANY": + case 375256373: + message.edgeAvailabilityDomain = 375256373; + break; + } + switch (object.encryption) { + case "UNDEFINED_ENCRYPTION": + case 0: + message.encryption = 0; + break; + case "IPSEC": + case 69882282: + message.encryption = 69882282; + break; + case "NONE": + case 2402104: + message.encryption = 2402104; + break; + } + if (object.googleReferenceId != null) + message.googleReferenceId = String(object.googleReferenceId); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.interconnect != null) + message.interconnect = String(object.interconnect); + if (object.ipsecInternalAddresses) { + if (!Array.isArray(object.ipsecInternalAddresses)) + throw TypeError(".google.cloud.compute.v1.InterconnectAttachment.ipsecInternalAddresses: array expected"); + message.ipsecInternalAddresses = []; + for (var i = 0; i < object.ipsecInternalAddresses.length; ++i) + message.ipsecInternalAddresses[i] = String(object.ipsecInternalAddresses[i]); + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.mtu != null) + message.mtu = object.mtu | 0; + if (object.name != null) + message.name = String(object.name); + switch (object.operationalStatus) { + case "UNDEFINED_OPERATIONAL_STATUS": + case 0: + message.operationalStatus = 0; + break; + case "OS_ACTIVE": + case 55721409: + message.operationalStatus = 55721409; + break; + case "OS_UNPROVISIONED": + case 239771840: + message.operationalStatus = 239771840; + break; + } + if (object.pairingKey != null) + message.pairingKey = String(object.pairingKey); + if (object.partnerAsn != null) + if ($util.Long) + (message.partnerAsn = $util.Long.fromValue(object.partnerAsn)).unsigned = false; + else if (typeof object.partnerAsn === "string") + message.partnerAsn = parseInt(object.partnerAsn, 10); + else if (typeof object.partnerAsn === "number") + message.partnerAsn = object.partnerAsn; + else if (typeof object.partnerAsn === "object") + message.partnerAsn = new $util.LongBits(object.partnerAsn.low >>> 0, object.partnerAsn.high >>> 0).toNumber(); + if (object.partnerMetadata != null) { + if (typeof object.partnerMetadata !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachment.partnerMetadata: object expected"); + message.partnerMetadata = $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.fromObject(object.partnerMetadata); + } + if (object.privateInterconnectInfo != null) { + if (typeof object.privateInterconnectInfo !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachment.privateInterconnectInfo: object expected"); + message.privateInterconnectInfo = $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.fromObject(object.privateInterconnectInfo); + } + if (object.region != null) + message.region = String(object.region); + if (object.router != null) + message.router = String(object.router); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 314733318: + message.state = 314733318; + break; + case "DEFUNCT": + case 115891759: + message.state = 115891759; + break; + case "PARTNER_REQUEST_RECEIVED": + case 513587304: + message.state = 513587304; + break; + case "PENDING_CUSTOMER": + case 167494054: + message.state = 167494054; + break; + case "PENDING_PARTNER": + case 387890656: + message.state = 387890656; + break; + case "STATE_UNSPECIFIED": + case 470755401: + message.state = 470755401; + break; + case "UNPROVISIONED": + case 517333979: + message.state = 517333979; + break; + } + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "DEDICATED": + case 258411983: + message.type = 258411983; + break; + case "PARTNER": + case 461924520: + message.type = 461924520; + break; + case "PARTNER_PROVIDER": + case 483261352: + message.type = 483261352; + break; + } + if (object.vlanTag8021q != null) + message.vlanTag8021q = object.vlanTag8021q | 0; + return message; + }; + + /** + * Creates a plain object from an InterconnectAttachment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @static + * @param {google.cloud.compute.v1.InterconnectAttachment} message InterconnectAttachment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectAttachment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.candidateSubnets = []; + object.ipsecInternalAddresses = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.mtu != null && message.hasOwnProperty("mtu")) { + object.mtu = message.mtu; + if (options.oneofs) + object._mtu = "mtu"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.InterconnectAttachment.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.dataplaneVersion != null && message.hasOwnProperty("dataplaneVersion")) { + object.dataplaneVersion = message.dataplaneVersion; + if (options.oneofs) + object._dataplaneVersion = "dataplaneVersion"; + } + if (message.partnerMetadata != null && message.hasOwnProperty("partnerMetadata")) { + object.partnerMetadata = $root.google.cloud.compute.v1.InterconnectAttachmentPartnerMetadata.toObject(message.partnerMetadata, options); + if (options.oneofs) + object._partnerMetadata = "partnerMetadata"; + } + if (message.edgeAvailabilityDomain != null && message.hasOwnProperty("edgeAvailabilityDomain")) { + object.edgeAvailabilityDomain = options.enums === String ? $root.google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain[message.edgeAvailabilityDomain] : message.edgeAvailabilityDomain; + if (options.oneofs) + object._edgeAvailabilityDomain = "edgeAvailabilityDomain"; + } + if (message.encryption != null && message.hasOwnProperty("encryption")) { + object.encryption = options.enums === String ? $root.google.cloud.compute.v1.InterconnectAttachment.Encryption[message.encryption] : message.encryption; + if (options.oneofs) + object._encryption = "encryption"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.InterconnectAttachment.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.vlanTag8021q != null && message.hasOwnProperty("vlanTag8021q")) { + object.vlanTag8021q = message.vlanTag8021q; + if (options.oneofs) + object._vlanTag8021q = "vlanTag8021q"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.router != null && message.hasOwnProperty("router")) { + object.router = message.router; + if (options.oneofs) + object._router = "router"; + } + if (message.bandwidth != null && message.hasOwnProperty("bandwidth")) { + object.bandwidth = options.enums === String ? $root.google.cloud.compute.v1.InterconnectAttachment.Bandwidth[message.bandwidth] : message.bandwidth; + if (options.oneofs) + object._bandwidth = "bandwidth"; + } + if (message.operationalStatus != null && message.hasOwnProperty("operationalStatus")) { + object.operationalStatus = options.enums === String ? $root.google.cloud.compute.v1.InterconnectAttachment.OperationalStatus[message.operationalStatus] : message.operationalStatus; + if (options.oneofs) + object._operationalStatus = "operationalStatus"; + } + if (message.interconnect != null && message.hasOwnProperty("interconnect")) { + object.interconnect = message.interconnect; + if (options.oneofs) + object._interconnect = "interconnect"; + } + if (message.privateInterconnectInfo != null && message.hasOwnProperty("privateInterconnectInfo")) { + object.privateInterconnectInfo = $root.google.cloud.compute.v1.InterconnectAttachmentPrivateInfo.toObject(message.privateInterconnectInfo, options); + if (options.oneofs) + object._privateInterconnectInfo = "privateInterconnectInfo"; + } + if (message.candidateSubnets && message.candidateSubnets.length) { + object.candidateSubnets = []; + for (var j = 0; j < message.candidateSubnets.length; ++j) + object.candidateSubnets[j] = message.candidateSubnets[j]; + } + if (message.cloudRouterIpAddress != null && message.hasOwnProperty("cloudRouterIpAddress")) { + object.cloudRouterIpAddress = message.cloudRouterIpAddress; + if (options.oneofs) + object._cloudRouterIpAddress = "cloudRouterIpAddress"; + } + if (message.customerRouterIpAddress != null && message.hasOwnProperty("customerRouterIpAddress")) { + object.customerRouterIpAddress = message.customerRouterIpAddress; + if (options.oneofs) + object._customerRouterIpAddress = "customerRouterIpAddress"; + } + if (message.ipsecInternalAddresses && message.ipsecInternalAddresses.length) { + object.ipsecInternalAddresses = []; + for (var j = 0; j < message.ipsecInternalAddresses.length; ++j) + object.ipsecInternalAddresses[j] = message.ipsecInternalAddresses[j]; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.partnerAsn != null && message.hasOwnProperty("partnerAsn")) { + if (typeof message.partnerAsn === "number") + object.partnerAsn = options.longs === String ? String(message.partnerAsn) : message.partnerAsn; + else + object.partnerAsn = options.longs === String ? $util.Long.prototype.toString.call(message.partnerAsn) : options.longs === Number ? new $util.LongBits(message.partnerAsn.low >>> 0, message.partnerAsn.high >>> 0).toNumber() : message.partnerAsn; + if (options.oneofs) + object._partnerAsn = "partnerAsn"; + } + if (message.pairingKey != null && message.hasOwnProperty("pairingKey")) { + object.pairingKey = message.pairingKey; + if (options.oneofs) + object._pairingKey = "pairingKey"; + } + if (message.adminEnabled != null && message.hasOwnProperty("adminEnabled")) { + object.adminEnabled = message.adminEnabled; + if (options.oneofs) + object._adminEnabled = "adminEnabled"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.googleReferenceId != null && message.hasOwnProperty("googleReferenceId")) { + object.googleReferenceId = message.googleReferenceId; + if (options.oneofs) + object._googleReferenceId = "googleReferenceId"; + } + return object; + }; + + /** + * Converts this InterconnectAttachment to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectAttachment + * @instance + * @returns {Object.} JSON object + */ + InterconnectAttachment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Bandwidth enum. + * @name google.cloud.compute.v1.InterconnectAttachment.Bandwidth + * @enum {number} + * @property {number} UNDEFINED_BANDWIDTH=0 UNDEFINED_BANDWIDTH value + * @property {number} BPS_100M=49547958 BPS_100M value + * @property {number} BPS_10G=278693006 BPS_10G value + * @property {number} BPS_1G=355358448 BPS_1G value + * @property {number} BPS_200M=49577749 BPS_200M value + * @property {number} BPS_20G=278693967 BPS_20G value + * @property {number} BPS_2G=355358479 BPS_2G value + * @property {number} BPS_300M=49607540 BPS_300M value + * @property {number} BPS_400M=49637331 BPS_400M value + * @property {number} BPS_500M=49667122 BPS_500M value + * @property {number} BPS_50G=278696850 BPS_50G value + * @property {number} BPS_50M=278696856 BPS_50M value + * @property {number} BPS_5G=355358572 BPS_5G value + */ + InterconnectAttachment.Bandwidth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_BANDWIDTH"] = 0; + values[valuesById[49547958] = "BPS_100M"] = 49547958; + values[valuesById[278693006] = "BPS_10G"] = 278693006; + values[valuesById[355358448] = "BPS_1G"] = 355358448; + values[valuesById[49577749] = "BPS_200M"] = 49577749; + values[valuesById[278693967] = "BPS_20G"] = 278693967; + values[valuesById[355358479] = "BPS_2G"] = 355358479; + values[valuesById[49607540] = "BPS_300M"] = 49607540; + values[valuesById[49637331] = "BPS_400M"] = 49637331; + values[valuesById[49667122] = "BPS_500M"] = 49667122; + values[valuesById[278696850] = "BPS_50G"] = 278696850; + values[valuesById[278696856] = "BPS_50M"] = 278696856; + values[valuesById[355358572] = "BPS_5G"] = 355358572; + return values; + })(); + + /** + * EdgeAvailabilityDomain enum. + * @name google.cloud.compute.v1.InterconnectAttachment.EdgeAvailabilityDomain + * @enum {number} + * @property {number} UNDEFINED_EDGE_AVAILABILITY_DOMAIN=0 UNDEFINED_EDGE_AVAILABILITY_DOMAIN value + * @property {number} AVAILABILITY_DOMAIN_1=349552090 AVAILABILITY_DOMAIN_1 value + * @property {number} AVAILABILITY_DOMAIN_2=349552091 AVAILABILITY_DOMAIN_2 value + * @property {number} AVAILABILITY_DOMAIN_ANY=375256373 AVAILABILITY_DOMAIN_ANY value + */ + InterconnectAttachment.EdgeAvailabilityDomain = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_EDGE_AVAILABILITY_DOMAIN"] = 0; + values[valuesById[349552090] = "AVAILABILITY_DOMAIN_1"] = 349552090; + values[valuesById[349552091] = "AVAILABILITY_DOMAIN_2"] = 349552091; + values[valuesById[375256373] = "AVAILABILITY_DOMAIN_ANY"] = 375256373; + return values; + })(); + + /** + * Encryption enum. + * @name google.cloud.compute.v1.InterconnectAttachment.Encryption + * @enum {number} + * @property {number} UNDEFINED_ENCRYPTION=0 UNDEFINED_ENCRYPTION value + * @property {number} IPSEC=69882282 IPSEC value + * @property {number} NONE=2402104 NONE value + */ + InterconnectAttachment.Encryption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ENCRYPTION"] = 0; + values[valuesById[69882282] = "IPSEC"] = 69882282; + values[valuesById[2402104] = "NONE"] = 2402104; + return values; + })(); + + /** + * OperationalStatus enum. + * @name google.cloud.compute.v1.InterconnectAttachment.OperationalStatus + * @enum {number} + * @property {number} UNDEFINED_OPERATIONAL_STATUS=0 UNDEFINED_OPERATIONAL_STATUS value + * @property {number} OS_ACTIVE=55721409 OS_ACTIVE value + * @property {number} OS_UNPROVISIONED=239771840 OS_UNPROVISIONED value + */ + InterconnectAttachment.OperationalStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_OPERATIONAL_STATUS"] = 0; + values[valuesById[55721409] = "OS_ACTIVE"] = 55721409; + values[valuesById[239771840] = "OS_UNPROVISIONED"] = 239771840; + return values; + })(); + + /** + * State enum. + * @name google.cloud.compute.v1.InterconnectAttachment.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} DEFUNCT=115891759 DEFUNCT value + * @property {number} PARTNER_REQUEST_RECEIVED=513587304 PARTNER_REQUEST_RECEIVED value + * @property {number} PENDING_CUSTOMER=167494054 PENDING_CUSTOMER value + * @property {number} PENDING_PARTNER=387890656 PENDING_PARTNER value + * @property {number} STATE_UNSPECIFIED=470755401 STATE_UNSPECIFIED value + * @property {number} UNPROVISIONED=517333979 UNPROVISIONED value + */ + InterconnectAttachment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[115891759] = "DEFUNCT"] = 115891759; + values[valuesById[513587304] = "PARTNER_REQUEST_RECEIVED"] = 513587304; + values[valuesById[167494054] = "PENDING_CUSTOMER"] = 167494054; + values[valuesById[387890656] = "PENDING_PARTNER"] = 387890656; + values[valuesById[470755401] = "STATE_UNSPECIFIED"] = 470755401; + values[valuesById[517333979] = "UNPROVISIONED"] = 517333979; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.compute.v1.InterconnectAttachment.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} DEDICATED=258411983 DEDICATED value + * @property {number} PARTNER=461924520 PARTNER value + * @property {number} PARTNER_PROVIDER=483261352 PARTNER_PROVIDER value + */ + InterconnectAttachment.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[258411983] = "DEDICATED"] = 258411983; + values[valuesById[461924520] = "PARTNER"] = 461924520; + values[valuesById[483261352] = "PARTNER_PROVIDER"] = 483261352; + return values; + })(); + + return InterconnectAttachment; + })(); + + v1.InterconnectAttachmentsScopedList = (function() { + + /** + * Properties of an InterconnectAttachmentsScopedList. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectAttachmentsScopedList + * @property {Array.|null} [interconnectAttachments] InterconnectAttachmentsScopedList interconnectAttachments + * @property {google.cloud.compute.v1.IWarning|null} [warning] InterconnectAttachmentsScopedList warning + */ + + /** + * Constructs a new InterconnectAttachmentsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectAttachmentsScopedList. + * @implements IInterconnectAttachmentsScopedList + * @constructor + * @param {google.cloud.compute.v1.IInterconnectAttachmentsScopedList=} [properties] Properties to set + */ + function InterconnectAttachmentsScopedList(properties) { + this.interconnectAttachments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectAttachmentsScopedList interconnectAttachments. + * @member {Array.} interconnectAttachments + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @instance + */ + InterconnectAttachmentsScopedList.prototype.interconnectAttachments = $util.emptyArray; + + /** + * InterconnectAttachmentsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @instance + */ + InterconnectAttachmentsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectAttachmentsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @instance + */ + Object.defineProperty(InterconnectAttachmentsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectAttachmentsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectAttachmentsScopedList} InterconnectAttachmentsScopedList instance + */ + InterconnectAttachmentsScopedList.create = function create(properties) { + return new InterconnectAttachmentsScopedList(properties); + }; + + /** + * Encodes the specified InterconnectAttachmentsScopedList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentsScopedList} message InterconnectAttachmentsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.interconnectAttachments != null && message.interconnectAttachments.length) + for (var i = 0; i < message.interconnectAttachments.length; ++i) + $root.google.cloud.compute.v1.InterconnectAttachment.encode(message.interconnectAttachments[i], writer.uint32(/* id 425388415, wireType 2 =*/3403107322).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterconnectAttachmentsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentsScopedList} message InterconnectAttachmentsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectAttachmentsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectAttachmentsScopedList} InterconnectAttachmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectAttachmentsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 425388415: + if (!(message.interconnectAttachments && message.interconnectAttachments.length)) + message.interconnectAttachments = []; + message.interconnectAttachments.push($root.google.cloud.compute.v1.InterconnectAttachment.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectAttachmentsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectAttachmentsScopedList} InterconnectAttachmentsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectAttachmentsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectAttachmentsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnectAttachments != null && message.hasOwnProperty("interconnectAttachments")) { + if (!Array.isArray(message.interconnectAttachments)) + return "interconnectAttachments: array expected"; + for (var i = 0; i < message.interconnectAttachments.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectAttachment.verify(message.interconnectAttachments[i]); + if (error) + return "interconnectAttachments." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InterconnectAttachmentsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectAttachmentsScopedList} InterconnectAttachmentsScopedList + */ + InterconnectAttachmentsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectAttachmentsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectAttachmentsScopedList(); + if (object.interconnectAttachments) { + if (!Array.isArray(object.interconnectAttachments)) + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentsScopedList.interconnectAttachments: array expected"); + message.interconnectAttachments = []; + for (var i = 0; i < object.interconnectAttachments.length; ++i) { + if (typeof object.interconnectAttachments[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentsScopedList.interconnectAttachments: object expected"); + message.interconnectAttachments[i] = $root.google.cloud.compute.v1.InterconnectAttachment.fromObject(object.interconnectAttachments[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InterconnectAttachmentsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @static + * @param {google.cloud.compute.v1.InterconnectAttachmentsScopedList} message InterconnectAttachmentsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectAttachmentsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.interconnectAttachments = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.interconnectAttachments && message.interconnectAttachments.length) { + object.interconnectAttachments = []; + for (var j = 0; j < message.interconnectAttachments.length; ++j) + object.interconnectAttachments[j] = $root.google.cloud.compute.v1.InterconnectAttachment.toObject(message.interconnectAttachments[j], options); + } + return object; + }; + + /** + * Converts this InterconnectAttachmentsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectAttachmentsScopedList + * @instance + * @returns {Object.} JSON object + */ + InterconnectAttachmentsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectAttachmentsScopedList; + })(); + + v1.InterconnectAttachmentAggregatedList = (function() { + + /** + * Properties of an InterconnectAttachmentAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectAttachmentAggregatedList + * @property {string|null} [id] InterconnectAttachmentAggregatedList id + * @property {Object.|null} [items] InterconnectAttachmentAggregatedList items + * @property {string|null} [kind] InterconnectAttachmentAggregatedList kind + * @property {string|null} [nextPageToken] InterconnectAttachmentAggregatedList nextPageToken + * @property {string|null} [selfLink] InterconnectAttachmentAggregatedList selfLink + * @property {Array.|null} [unreachables] InterconnectAttachmentAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] InterconnectAttachmentAggregatedList warning + */ + + /** + * Constructs a new InterconnectAttachmentAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectAttachmentAggregatedList. + * @implements IInterconnectAttachmentAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IInterconnectAttachmentAggregatedList=} [properties] Properties to set + */ + function InterconnectAttachmentAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectAttachmentAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + InterconnectAttachmentAggregatedList.prototype.id = null; + + /** + * InterconnectAttachmentAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + InterconnectAttachmentAggregatedList.prototype.items = $util.emptyObject; + + /** + * InterconnectAttachmentAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + InterconnectAttachmentAggregatedList.prototype.kind = null; + + /** + * InterconnectAttachmentAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + InterconnectAttachmentAggregatedList.prototype.nextPageToken = null; + + /** + * InterconnectAttachmentAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + InterconnectAttachmentAggregatedList.prototype.selfLink = null; + + /** + * InterconnectAttachmentAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + InterconnectAttachmentAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * InterconnectAttachmentAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + InterconnectAttachmentAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectAttachmentAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + Object.defineProperty(InterconnectAttachmentAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + Object.defineProperty(InterconnectAttachmentAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + Object.defineProperty(InterconnectAttachmentAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + Object.defineProperty(InterconnectAttachmentAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + */ + Object.defineProperty(InterconnectAttachmentAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectAttachmentAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectAttachmentAggregatedList} InterconnectAttachmentAggregatedList instance + */ + InterconnectAttachmentAggregatedList.create = function create(properties) { + return new InterconnectAttachmentAggregatedList(properties); + }; + + /** + * Encodes the specified InterconnectAttachmentAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentAggregatedList} message InterconnectAttachmentAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.InterconnectAttachmentsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InterconnectAttachmentAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentAggregatedList} message InterconnectAttachmentAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectAttachmentAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectAttachmentAggregatedList} InterconnectAttachmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectAttachmentAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.InterconnectAttachmentsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectAttachmentAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectAttachmentAggregatedList} InterconnectAttachmentAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectAttachmentAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectAttachmentAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectAttachmentsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InterconnectAttachmentAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectAttachmentAggregatedList} InterconnectAttachmentAggregatedList + */ + InterconnectAttachmentAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectAttachmentAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectAttachmentAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.InterconnectAttachmentsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InterconnectAttachmentAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @static + * @param {google.cloud.compute.v1.InterconnectAttachmentAggregatedList} message InterconnectAttachmentAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectAttachmentAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.InterconnectAttachmentsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InterconnectAttachmentAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectAttachmentAggregatedList + * @instance + * @returns {Object.} JSON object + */ + InterconnectAttachmentAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectAttachmentAggregatedList; + })(); + + v1.InterconnectAttachmentList = (function() { + + /** + * Properties of an InterconnectAttachmentList. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectAttachmentList + * @property {string|null} [id] InterconnectAttachmentList id + * @property {Array.|null} [items] InterconnectAttachmentList items + * @property {string|null} [kind] InterconnectAttachmentList kind + * @property {string|null} [nextPageToken] InterconnectAttachmentList nextPageToken + * @property {string|null} [selfLink] InterconnectAttachmentList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InterconnectAttachmentList warning + */ + + /** + * Constructs a new InterconnectAttachmentList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectAttachmentList. + * @implements IInterconnectAttachmentList + * @constructor + * @param {google.cloud.compute.v1.IInterconnectAttachmentList=} [properties] Properties to set + */ + function InterconnectAttachmentList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectAttachmentList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + InterconnectAttachmentList.prototype.id = null; + + /** + * InterconnectAttachmentList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + InterconnectAttachmentList.prototype.items = $util.emptyArray; + + /** + * InterconnectAttachmentList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + InterconnectAttachmentList.prototype.kind = null; + + /** + * InterconnectAttachmentList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + InterconnectAttachmentList.prototype.nextPageToken = null; + + /** + * InterconnectAttachmentList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + InterconnectAttachmentList.prototype.selfLink = null; + + /** + * InterconnectAttachmentList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + InterconnectAttachmentList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectAttachmentList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + Object.defineProperty(InterconnectAttachmentList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + Object.defineProperty(InterconnectAttachmentList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + Object.defineProperty(InterconnectAttachmentList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + Object.defineProperty(InterconnectAttachmentList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectAttachmentList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + */ + Object.defineProperty(InterconnectAttachmentList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectAttachmentList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectAttachmentList} InterconnectAttachmentList instance + */ + InterconnectAttachmentList.create = function create(properties) { + return new InterconnectAttachmentList(properties); + }; + + /** + * Encodes the specified InterconnectAttachmentList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentList} message InterconnectAttachmentList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InterconnectAttachment.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InterconnectAttachmentList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectAttachmentList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {google.cloud.compute.v1.IInterconnectAttachmentList} message InterconnectAttachmentList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectAttachmentList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectAttachmentList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectAttachmentList} InterconnectAttachmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectAttachmentList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InterconnectAttachment.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectAttachmentList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectAttachmentList} InterconnectAttachmentList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectAttachmentList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectAttachmentList message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectAttachmentList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectAttachment.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InterconnectAttachmentList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectAttachmentList} InterconnectAttachmentList + */ + InterconnectAttachmentList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectAttachmentList) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectAttachmentList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InterconnectAttachment.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectAttachmentList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InterconnectAttachmentList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @static + * @param {google.cloud.compute.v1.InterconnectAttachmentList} message InterconnectAttachmentList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectAttachmentList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InterconnectAttachment.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InterconnectAttachmentList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectAttachmentList + * @instance + * @returns {Object.} JSON object + */ + InterconnectAttachmentList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectAttachmentList; + })(); + + v1.InterconnectDiagnosticsARPEntry = (function() { + + /** + * Properties of an InterconnectDiagnosticsARPEntry. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectDiagnosticsARPEntry + * @property {string|null} [ipAddress] InterconnectDiagnosticsARPEntry ipAddress + * @property {string|null} [macAddress] InterconnectDiagnosticsARPEntry macAddress + */ + + /** + * Constructs a new InterconnectDiagnosticsARPEntry. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectDiagnosticsARPEntry. + * @implements IInterconnectDiagnosticsARPEntry + * @constructor + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry=} [properties] Properties to set + */ + function InterconnectDiagnosticsARPEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectDiagnosticsARPEntry ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @instance + */ + InterconnectDiagnosticsARPEntry.prototype.ipAddress = null; + + /** + * InterconnectDiagnosticsARPEntry macAddress. + * @member {string|null|undefined} macAddress + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @instance + */ + InterconnectDiagnosticsARPEntry.prototype.macAddress = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectDiagnosticsARPEntry _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsARPEntry.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsARPEntry _macAddress. + * @member {"macAddress"|undefined} _macAddress + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsARPEntry.prototype, "_macAddress", { + get: $util.oneOfGetter($oneOfFields = ["macAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectDiagnosticsARPEntry instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsARPEntry} InterconnectDiagnosticsARPEntry instance + */ + InterconnectDiagnosticsARPEntry.create = function create(properties) { + return new InterconnectDiagnosticsARPEntry(properties); + }; + + /** + * Encodes the specified InterconnectDiagnosticsARPEntry message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry} message InterconnectDiagnosticsARPEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsARPEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.macAddress != null && Object.hasOwnProperty.call(message, "macAddress")) + writer.uint32(/* id 332540164, wireType 2 =*/2660321314).string(message.macAddress); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 406272220, wireType 2 =*/3250177762).string(message.ipAddress); + return writer; + }; + + /** + * Encodes the specified InterconnectDiagnosticsARPEntry message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsARPEntry} message InterconnectDiagnosticsARPEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsARPEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectDiagnosticsARPEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsARPEntry} InterconnectDiagnosticsARPEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsARPEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 406272220: + message.ipAddress = reader.string(); + break; + case 332540164: + message.macAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectDiagnosticsARPEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsARPEntry} InterconnectDiagnosticsARPEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsARPEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectDiagnosticsARPEntry message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectDiagnosticsARPEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.macAddress != null && message.hasOwnProperty("macAddress")) { + properties._macAddress = 1; + if (!$util.isString(message.macAddress)) + return "macAddress: string expected"; + } + return null; + }; + + /** + * Creates an InterconnectDiagnosticsARPEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsARPEntry} InterconnectDiagnosticsARPEntry + */ + InterconnectDiagnosticsARPEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry(); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.macAddress != null) + message.macAddress = String(object.macAddress); + return message; + }; + + /** + * Creates a plain object from an InterconnectDiagnosticsARPEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @static + * @param {google.cloud.compute.v1.InterconnectDiagnosticsARPEntry} message InterconnectDiagnosticsARPEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectDiagnosticsARPEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.macAddress != null && message.hasOwnProperty("macAddress")) { + object.macAddress = message.macAddress; + if (options.oneofs) + object._macAddress = "macAddress"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + return object; + }; + + /** + * Converts this InterconnectDiagnosticsARPEntry to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsARPEntry + * @instance + * @returns {Object.} JSON object + */ + InterconnectDiagnosticsARPEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectDiagnosticsARPEntry; + })(); + + v1.InterconnectDiagnosticsLinkStatus = (function() { + + /** + * Properties of an InterconnectDiagnosticsLinkStatus. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectDiagnosticsLinkStatus + * @property {Array.|null} [arpCaches] InterconnectDiagnosticsLinkStatus arpCaches + * @property {string|null} [circuitId] InterconnectDiagnosticsLinkStatus circuitId + * @property {string|null} [googleDemarc] InterconnectDiagnosticsLinkStatus googleDemarc + * @property {google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus|null} [lacpStatus] InterconnectDiagnosticsLinkStatus lacpStatus + * @property {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null} [receivingOpticalPower] InterconnectDiagnosticsLinkStatus receivingOpticalPower + * @property {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null} [transmittingOpticalPower] InterconnectDiagnosticsLinkStatus transmittingOpticalPower + */ + + /** + * Constructs a new InterconnectDiagnosticsLinkStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectDiagnosticsLinkStatus. + * @implements IInterconnectDiagnosticsLinkStatus + * @constructor + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus=} [properties] Properties to set + */ + function InterconnectDiagnosticsLinkStatus(properties) { + this.arpCaches = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectDiagnosticsLinkStatus arpCaches. + * @member {Array.} arpCaches + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + InterconnectDiagnosticsLinkStatus.prototype.arpCaches = $util.emptyArray; + + /** + * InterconnectDiagnosticsLinkStatus circuitId. + * @member {string|null|undefined} circuitId + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + InterconnectDiagnosticsLinkStatus.prototype.circuitId = null; + + /** + * InterconnectDiagnosticsLinkStatus googleDemarc. + * @member {string|null|undefined} googleDemarc + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + InterconnectDiagnosticsLinkStatus.prototype.googleDemarc = null; + + /** + * InterconnectDiagnosticsLinkStatus lacpStatus. + * @member {google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus|null|undefined} lacpStatus + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + InterconnectDiagnosticsLinkStatus.prototype.lacpStatus = null; + + /** + * InterconnectDiagnosticsLinkStatus receivingOpticalPower. + * @member {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null|undefined} receivingOpticalPower + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + InterconnectDiagnosticsLinkStatus.prototype.receivingOpticalPower = null; + + /** + * InterconnectDiagnosticsLinkStatus transmittingOpticalPower. + * @member {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower|null|undefined} transmittingOpticalPower + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + InterconnectDiagnosticsLinkStatus.prototype.transmittingOpticalPower = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectDiagnosticsLinkStatus _circuitId. + * @member {"circuitId"|undefined} _circuitId + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkStatus.prototype, "_circuitId", { + get: $util.oneOfGetter($oneOfFields = ["circuitId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsLinkStatus _googleDemarc. + * @member {"googleDemarc"|undefined} _googleDemarc + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkStatus.prototype, "_googleDemarc", { + get: $util.oneOfGetter($oneOfFields = ["googleDemarc"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsLinkStatus _lacpStatus. + * @member {"lacpStatus"|undefined} _lacpStatus + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkStatus.prototype, "_lacpStatus", { + get: $util.oneOfGetter($oneOfFields = ["lacpStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsLinkStatus _receivingOpticalPower. + * @member {"receivingOpticalPower"|undefined} _receivingOpticalPower + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkStatus.prototype, "_receivingOpticalPower", { + get: $util.oneOfGetter($oneOfFields = ["receivingOpticalPower"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsLinkStatus _transmittingOpticalPower. + * @member {"transmittingOpticalPower"|undefined} _transmittingOpticalPower + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkStatus.prototype, "_transmittingOpticalPower", { + get: $util.oneOfGetter($oneOfFields = ["transmittingOpticalPower"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectDiagnosticsLinkStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus} InterconnectDiagnosticsLinkStatus instance + */ + InterconnectDiagnosticsLinkStatus.create = function create(properties) { + return new InterconnectDiagnosticsLinkStatus(properties); + }; + + /** + * Encodes the specified InterconnectDiagnosticsLinkStatus message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus} message InterconnectDiagnosticsLinkStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsLinkStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleDemarc != null && Object.hasOwnProperty.call(message, "googleDemarc")) + writer.uint32(/* id 51084, wireType 2 =*/408674).string(message.googleDemarc); + if (message.circuitId != null && Object.hasOwnProperty.call(message, "circuitId")) + writer.uint32(/* id 225180977, wireType 2 =*/1801447818).string(message.circuitId); + if (message.receivingOpticalPower != null && Object.hasOwnProperty.call(message, "receivingOpticalPower")) + $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.encode(message.receivingOpticalPower, writer.uint32(/* id 244717279, wireType 2 =*/1957738234).fork()).ldelim(); + if (message.lacpStatus != null && Object.hasOwnProperty.call(message, "lacpStatus")) + $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.encode(message.lacpStatus, writer.uint32(/* id 361210415, wireType 2 =*/2889683322).fork()).ldelim(); + if (message.arpCaches != null && message.arpCaches.length) + for (var i = 0; i < message.arpCaches.length; ++i) + $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.encode(message.arpCaches[i], writer.uint32(/* id 414591761, wireType 2 =*/3316734090).fork()).ldelim(); + if (message.transmittingOpticalPower != null && Object.hasOwnProperty.call(message, "transmittingOpticalPower")) + $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.encode(message.transmittingOpticalPower, writer.uint32(/* id 459431197, wireType 2 =*/3675449578).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterconnectDiagnosticsLinkStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkStatus} message InterconnectDiagnosticsLinkStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsLinkStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectDiagnosticsLinkStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus} InterconnectDiagnosticsLinkStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsLinkStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 414591761: + if (!(message.arpCaches && message.arpCaches.length)) + message.arpCaches = []; + message.arpCaches.push($root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.decode(reader, reader.uint32())); + break; + case 225180977: + message.circuitId = reader.string(); + break; + case 51084: + message.googleDemarc = reader.string(); + break; + case 361210415: + message.lacpStatus = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.decode(reader, reader.uint32()); + break; + case 244717279: + message.receivingOpticalPower = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.decode(reader, reader.uint32()); + break; + case 459431197: + message.transmittingOpticalPower = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectDiagnosticsLinkStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus} InterconnectDiagnosticsLinkStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsLinkStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectDiagnosticsLinkStatus message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectDiagnosticsLinkStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.arpCaches != null && message.hasOwnProperty("arpCaches")) { + if (!Array.isArray(message.arpCaches)) + return "arpCaches: array expected"; + for (var i = 0; i < message.arpCaches.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.verify(message.arpCaches[i]); + if (error) + return "arpCaches." + error; + } + } + if (message.circuitId != null && message.hasOwnProperty("circuitId")) { + properties._circuitId = 1; + if (!$util.isString(message.circuitId)) + return "circuitId: string expected"; + } + if (message.googleDemarc != null && message.hasOwnProperty("googleDemarc")) { + properties._googleDemarc = 1; + if (!$util.isString(message.googleDemarc)) + return "googleDemarc: string expected"; + } + if (message.lacpStatus != null && message.hasOwnProperty("lacpStatus")) { + properties._lacpStatus = 1; + { + var error = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.verify(message.lacpStatus); + if (error) + return "lacpStatus." + error; + } + } + if (message.receivingOpticalPower != null && message.hasOwnProperty("receivingOpticalPower")) { + properties._receivingOpticalPower = 1; + { + var error = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.verify(message.receivingOpticalPower); + if (error) + return "receivingOpticalPower." + error; + } + } + if (message.transmittingOpticalPower != null && message.hasOwnProperty("transmittingOpticalPower")) { + properties._transmittingOpticalPower = 1; + { + var error = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.verify(message.transmittingOpticalPower); + if (error) + return "transmittingOpticalPower." + error; + } + } + return null; + }; + + /** + * Creates an InterconnectDiagnosticsLinkStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus} InterconnectDiagnosticsLinkStatus + */ + InterconnectDiagnosticsLinkStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus(); + if (object.arpCaches) { + if (!Array.isArray(object.arpCaches)) + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.arpCaches: array expected"); + message.arpCaches = []; + for (var i = 0; i < object.arpCaches.length; ++i) { + if (typeof object.arpCaches[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.arpCaches: object expected"); + message.arpCaches[i] = $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.fromObject(object.arpCaches[i]); + } + } + if (object.circuitId != null) + message.circuitId = String(object.circuitId); + if (object.googleDemarc != null) + message.googleDemarc = String(object.googleDemarc); + if (object.lacpStatus != null) { + if (typeof object.lacpStatus !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.lacpStatus: object expected"); + message.lacpStatus = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.fromObject(object.lacpStatus); + } + if (object.receivingOpticalPower != null) { + if (typeof object.receivingOpticalPower !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.receivingOpticalPower: object expected"); + message.receivingOpticalPower = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.fromObject(object.receivingOpticalPower); + } + if (object.transmittingOpticalPower != null) { + if (typeof object.transmittingOpticalPower !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.transmittingOpticalPower: object expected"); + message.transmittingOpticalPower = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.fromObject(object.transmittingOpticalPower); + } + return message; + }; + + /** + * Creates a plain object from an InterconnectDiagnosticsLinkStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @static + * @param {google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus} message InterconnectDiagnosticsLinkStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectDiagnosticsLinkStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.arpCaches = []; + if (message.googleDemarc != null && message.hasOwnProperty("googleDemarc")) { + object.googleDemarc = message.googleDemarc; + if (options.oneofs) + object._googleDemarc = "googleDemarc"; + } + if (message.circuitId != null && message.hasOwnProperty("circuitId")) { + object.circuitId = message.circuitId; + if (options.oneofs) + object._circuitId = "circuitId"; + } + if (message.receivingOpticalPower != null && message.hasOwnProperty("receivingOpticalPower")) { + object.receivingOpticalPower = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.toObject(message.receivingOpticalPower, options); + if (options.oneofs) + object._receivingOpticalPower = "receivingOpticalPower"; + } + if (message.lacpStatus != null && message.hasOwnProperty("lacpStatus")) { + object.lacpStatus = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.toObject(message.lacpStatus, options); + if (options.oneofs) + object._lacpStatus = "lacpStatus"; + } + if (message.arpCaches && message.arpCaches.length) { + object.arpCaches = []; + for (var j = 0; j < message.arpCaches.length; ++j) + object.arpCaches[j] = $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.toObject(message.arpCaches[j], options); + } + if (message.transmittingOpticalPower != null && message.hasOwnProperty("transmittingOpticalPower")) { + object.transmittingOpticalPower = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.toObject(message.transmittingOpticalPower, options); + if (options.oneofs) + object._transmittingOpticalPower = "transmittingOpticalPower"; + } + return object; + }; + + /** + * Converts this InterconnectDiagnosticsLinkStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus + * @instance + * @returns {Object.} JSON object + */ + InterconnectDiagnosticsLinkStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectDiagnosticsLinkStatus; + })(); + + v1.InterconnectDiagnostics = (function() { + + /** + * Properties of an InterconnectDiagnostics. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectDiagnostics + * @property {Array.|null} [arpCaches] InterconnectDiagnostics arpCaches + * @property {Array.|null} [links] InterconnectDiagnostics links + * @property {string|null} [macAddress] InterconnectDiagnostics macAddress + */ + + /** + * Constructs a new InterconnectDiagnostics. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectDiagnostics. + * @implements IInterconnectDiagnostics + * @constructor + * @param {google.cloud.compute.v1.IInterconnectDiagnostics=} [properties] Properties to set + */ + function InterconnectDiagnostics(properties) { + this.arpCaches = []; + this.links = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectDiagnostics arpCaches. + * @member {Array.} arpCaches + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @instance + */ + InterconnectDiagnostics.prototype.arpCaches = $util.emptyArray; + + /** + * InterconnectDiagnostics links. + * @member {Array.} links + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @instance + */ + InterconnectDiagnostics.prototype.links = $util.emptyArray; + + /** + * InterconnectDiagnostics macAddress. + * @member {string|null|undefined} macAddress + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @instance + */ + InterconnectDiagnostics.prototype.macAddress = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectDiagnostics _macAddress. + * @member {"macAddress"|undefined} _macAddress + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @instance + */ + Object.defineProperty(InterconnectDiagnostics.prototype, "_macAddress", { + get: $util.oneOfGetter($oneOfFields = ["macAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectDiagnostics instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnostics=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectDiagnostics} InterconnectDiagnostics instance + */ + InterconnectDiagnostics.create = function create(properties) { + return new InterconnectDiagnostics(properties); + }; + + /** + * Encodes the specified InterconnectDiagnostics message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnostics.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnostics} message InterconnectDiagnostics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnostics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.links != null && message.links.length) + for (var i = 0; i < message.links.length; ++i) + $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.encode(message.links[i], writer.uint32(/* id 102977465, wireType 2 =*/823819722).fork()).ldelim(); + if (message.macAddress != null && Object.hasOwnProperty.call(message, "macAddress")) + writer.uint32(/* id 332540164, wireType 2 =*/2660321314).string(message.macAddress); + if (message.arpCaches != null && message.arpCaches.length) + for (var i = 0; i < message.arpCaches.length; ++i) + $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.encode(message.arpCaches[i], writer.uint32(/* id 414591761, wireType 2 =*/3316734090).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterconnectDiagnostics message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnostics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnostics} message InterconnectDiagnostics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnostics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectDiagnostics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectDiagnostics} InterconnectDiagnostics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnostics.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectDiagnostics(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 414591761: + if (!(message.arpCaches && message.arpCaches.length)) + message.arpCaches = []; + message.arpCaches.push($root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.decode(reader, reader.uint32())); + break; + case 102977465: + if (!(message.links && message.links.length)) + message.links = []; + message.links.push($root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.decode(reader, reader.uint32())); + break; + case 332540164: + message.macAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectDiagnostics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectDiagnostics} InterconnectDiagnostics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnostics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectDiagnostics message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectDiagnostics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.arpCaches != null && message.hasOwnProperty("arpCaches")) { + if (!Array.isArray(message.arpCaches)) + return "arpCaches: array expected"; + for (var i = 0; i < message.arpCaches.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.verify(message.arpCaches[i]); + if (error) + return "arpCaches." + error; + } + } + if (message.links != null && message.hasOwnProperty("links")) { + if (!Array.isArray(message.links)) + return "links: array expected"; + for (var i = 0; i < message.links.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.verify(message.links[i]); + if (error) + return "links." + error; + } + } + if (message.macAddress != null && message.hasOwnProperty("macAddress")) { + properties._macAddress = 1; + if (!$util.isString(message.macAddress)) + return "macAddress: string expected"; + } + return null; + }; + + /** + * Creates an InterconnectDiagnostics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectDiagnostics} InterconnectDiagnostics + */ + InterconnectDiagnostics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectDiagnostics) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectDiagnostics(); + if (object.arpCaches) { + if (!Array.isArray(object.arpCaches)) + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnostics.arpCaches: array expected"); + message.arpCaches = []; + for (var i = 0; i < object.arpCaches.length; ++i) { + if (typeof object.arpCaches[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnostics.arpCaches: object expected"); + message.arpCaches[i] = $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.fromObject(object.arpCaches[i]); + } + } + if (object.links) { + if (!Array.isArray(object.links)) + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnostics.links: array expected"); + message.links = []; + for (var i = 0; i < object.links.length; ++i) { + if (typeof object.links[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectDiagnostics.links: object expected"); + message.links[i] = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.fromObject(object.links[i]); + } + } + if (object.macAddress != null) + message.macAddress = String(object.macAddress); + return message; + }; + + /** + * Creates a plain object from an InterconnectDiagnostics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @static + * @param {google.cloud.compute.v1.InterconnectDiagnostics} message InterconnectDiagnostics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectDiagnostics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.links = []; + object.arpCaches = []; + } + if (message.links && message.links.length) { + object.links = []; + for (var j = 0; j < message.links.length; ++j) + object.links[j] = $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkStatus.toObject(message.links[j], options); + } + if (message.macAddress != null && message.hasOwnProperty("macAddress")) { + object.macAddress = message.macAddress; + if (options.oneofs) + object._macAddress = "macAddress"; + } + if (message.arpCaches && message.arpCaches.length) { + object.arpCaches = []; + for (var j = 0; j < message.arpCaches.length; ++j) + object.arpCaches[j] = $root.google.cloud.compute.v1.InterconnectDiagnosticsARPEntry.toObject(message.arpCaches[j], options); + } + return object; + }; + + /** + * Converts this InterconnectDiagnostics to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectDiagnostics + * @instance + * @returns {Object.} JSON object + */ + InterconnectDiagnostics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectDiagnostics; + })(); + + v1.InterconnectDiagnosticsLinkLACPStatus = (function() { + + /** + * Properties of an InterconnectDiagnosticsLinkLACPStatus. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectDiagnosticsLinkLACPStatus + * @property {string|null} [googleSystemId] InterconnectDiagnosticsLinkLACPStatus googleSystemId + * @property {string|null} [neighborSystemId] InterconnectDiagnosticsLinkLACPStatus neighborSystemId + * @property {google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State|null} [state] InterconnectDiagnosticsLinkLACPStatus state + */ + + /** + * Constructs a new InterconnectDiagnosticsLinkLACPStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectDiagnosticsLinkLACPStatus. + * @implements IInterconnectDiagnosticsLinkLACPStatus + * @constructor + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus=} [properties] Properties to set + */ + function InterconnectDiagnosticsLinkLACPStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectDiagnosticsLinkLACPStatus googleSystemId. + * @member {string|null|undefined} googleSystemId + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @instance + */ + InterconnectDiagnosticsLinkLACPStatus.prototype.googleSystemId = null; + + /** + * InterconnectDiagnosticsLinkLACPStatus neighborSystemId. + * @member {string|null|undefined} neighborSystemId + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @instance + */ + InterconnectDiagnosticsLinkLACPStatus.prototype.neighborSystemId = null; + + /** + * InterconnectDiagnosticsLinkLACPStatus state. + * @member {google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State|null|undefined} state + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @instance + */ + InterconnectDiagnosticsLinkLACPStatus.prototype.state = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectDiagnosticsLinkLACPStatus _googleSystemId. + * @member {"googleSystemId"|undefined} _googleSystemId + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkLACPStatus.prototype, "_googleSystemId", { + get: $util.oneOfGetter($oneOfFields = ["googleSystemId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsLinkLACPStatus _neighborSystemId. + * @member {"neighborSystemId"|undefined} _neighborSystemId + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkLACPStatus.prototype, "_neighborSystemId", { + get: $util.oneOfGetter($oneOfFields = ["neighborSystemId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsLinkLACPStatus _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkLACPStatus.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectDiagnosticsLinkLACPStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus} InterconnectDiagnosticsLinkLACPStatus instance + */ + InterconnectDiagnosticsLinkLACPStatus.create = function create(properties) { + return new InterconnectDiagnosticsLinkLACPStatus(properties); + }; + + /** + * Encodes the specified InterconnectDiagnosticsLinkLACPStatus message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus} message InterconnectDiagnosticsLinkLACPStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsLinkLACPStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleSystemId != null && Object.hasOwnProperty.call(message, "googleSystemId")) + writer.uint32(/* id 91210405, wireType 2 =*/729683242).string(message.googleSystemId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.neighborSystemId != null && Object.hasOwnProperty.call(message, "neighborSystemId")) + writer.uint32(/* id 343821342, wireType 2 =*/2750570738).string(message.neighborSystemId); + return writer; + }; + + /** + * Encodes the specified InterconnectDiagnosticsLinkLACPStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkLACPStatus} message InterconnectDiagnosticsLinkLACPStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsLinkLACPStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectDiagnosticsLinkLACPStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus} InterconnectDiagnosticsLinkLACPStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsLinkLACPStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 91210405: + message.googleSystemId = reader.string(); + break; + case 343821342: + message.neighborSystemId = reader.string(); + break; + case 109757585: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectDiagnosticsLinkLACPStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus} InterconnectDiagnosticsLinkLACPStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsLinkLACPStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectDiagnosticsLinkLACPStatus message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectDiagnosticsLinkLACPStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.googleSystemId != null && message.hasOwnProperty("googleSystemId")) { + properties._googleSystemId = 1; + if (!$util.isString(message.googleSystemId)) + return "googleSystemId: string expected"; + } + if (message.neighborSystemId != null && message.hasOwnProperty("neighborSystemId")) { + properties._neighborSystemId = 1; + if (!$util.isString(message.neighborSystemId)) + return "neighborSystemId: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 314733318: + case 216562546: + break; + } + } + return null; + }; + + /** + * Creates an InterconnectDiagnosticsLinkLACPStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus} InterconnectDiagnosticsLinkLACPStatus + */ + InterconnectDiagnosticsLinkLACPStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus(); + if (object.googleSystemId != null) + message.googleSystemId = String(object.googleSystemId); + if (object.neighborSystemId != null) + message.neighborSystemId = String(object.neighborSystemId); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 314733318: + message.state = 314733318; + break; + case "DETACHED": + case 216562546: + message.state = 216562546; + break; + } + return message; + }; + + /** + * Creates a plain object from an InterconnectDiagnosticsLinkLACPStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @static + * @param {google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus} message InterconnectDiagnosticsLinkLACPStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectDiagnosticsLinkLACPStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.googleSystemId != null && message.hasOwnProperty("googleSystemId")) { + object.googleSystemId = message.googleSystemId; + if (options.oneofs) + object._googleSystemId = "googleSystemId"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.neighborSystemId != null && message.hasOwnProperty("neighborSystemId")) { + object.neighborSystemId = message.neighborSystemId; + if (options.oneofs) + object._neighborSystemId = "neighborSystemId"; + } + return object; + }; + + /** + * Converts this InterconnectDiagnosticsLinkLACPStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus + * @instance + * @returns {Object.} JSON object + */ + InterconnectDiagnosticsLinkLACPStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.compute.v1.InterconnectDiagnosticsLinkLACPStatus.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} DETACHED=216562546 DETACHED value + */ + InterconnectDiagnosticsLinkLACPStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[216562546] = "DETACHED"] = 216562546; + return values; + })(); + + return InterconnectDiagnosticsLinkLACPStatus; + })(); + + v1.InterconnectDiagnosticsLinkOpticalPower = (function() { + + /** + * Properties of an InterconnectDiagnosticsLinkOpticalPower. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectDiagnosticsLinkOpticalPower + * @property {google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State|null} [state] InterconnectDiagnosticsLinkOpticalPower state + * @property {number|null} [value] InterconnectDiagnosticsLinkOpticalPower value + */ + + /** + * Constructs a new InterconnectDiagnosticsLinkOpticalPower. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectDiagnosticsLinkOpticalPower. + * @implements IInterconnectDiagnosticsLinkOpticalPower + * @constructor + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower=} [properties] Properties to set + */ + function InterconnectDiagnosticsLinkOpticalPower(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectDiagnosticsLinkOpticalPower state. + * @member {google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State|null|undefined} state + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @instance + */ + InterconnectDiagnosticsLinkOpticalPower.prototype.state = null; + + /** + * InterconnectDiagnosticsLinkOpticalPower value. + * @member {number|null|undefined} value + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @instance + */ + InterconnectDiagnosticsLinkOpticalPower.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectDiagnosticsLinkOpticalPower _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkOpticalPower.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectDiagnosticsLinkOpticalPower _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @instance + */ + Object.defineProperty(InterconnectDiagnosticsLinkOpticalPower.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectDiagnosticsLinkOpticalPower instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower} InterconnectDiagnosticsLinkOpticalPower instance + */ + InterconnectDiagnosticsLinkOpticalPower.create = function create(properties) { + return new InterconnectDiagnosticsLinkOpticalPower(properties); + }; + + /** + * Encodes the specified InterconnectDiagnosticsLinkOpticalPower message. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower} message InterconnectDiagnosticsLinkOpticalPower message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsLinkOpticalPower.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 111972721, wireType 5 =*/895781773).float(message.value); + return writer; + }; + + /** + * Encodes the specified InterconnectDiagnosticsLinkOpticalPower message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {google.cloud.compute.v1.IInterconnectDiagnosticsLinkOpticalPower} message InterconnectDiagnosticsLinkOpticalPower message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectDiagnosticsLinkOpticalPower.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectDiagnosticsLinkOpticalPower message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower} InterconnectDiagnosticsLinkOpticalPower + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsLinkOpticalPower.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 109757585: + message.state = reader.int32(); + break; + case 111972721: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectDiagnosticsLinkOpticalPower message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower} InterconnectDiagnosticsLinkOpticalPower + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectDiagnosticsLinkOpticalPower.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectDiagnosticsLinkOpticalPower message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectDiagnosticsLinkOpticalPower.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 305363284: + case 220984799: + case 316659046: + case 338793841: + case 2524: + break; + } + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (typeof message.value !== "number") + return "value: number expected"; + } + return null; + }; + + /** + * Creates an InterconnectDiagnosticsLinkOpticalPower message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower} InterconnectDiagnosticsLinkOpticalPower + */ + InterconnectDiagnosticsLinkOpticalPower.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower(); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "HIGH_ALARM": + case 305363284: + message.state = 305363284; + break; + case "HIGH_WARNING": + case 220984799: + message.state = 220984799; + break; + case "LOW_ALARM": + case 316659046: + message.state = 316659046; + break; + case "LOW_WARNING": + case 338793841: + message.state = 338793841; + break; + case "OK": + case 2524: + message.state = 2524; + break; + } + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from an InterconnectDiagnosticsLinkOpticalPower message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @static + * @param {google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower} message InterconnectDiagnosticsLinkOpticalPower + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectDiagnosticsLinkOpticalPower.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this InterconnectDiagnosticsLinkOpticalPower to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower + * @instance + * @returns {Object.} JSON object + */ + InterconnectDiagnosticsLinkOpticalPower.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.compute.v1.InterconnectDiagnosticsLinkOpticalPower.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} HIGH_ALARM=305363284 HIGH_ALARM value + * @property {number} HIGH_WARNING=220984799 HIGH_WARNING value + * @property {number} LOW_ALARM=316659046 LOW_ALARM value + * @property {number} LOW_WARNING=338793841 LOW_WARNING value + * @property {number} OK=2524 OK value + */ + InterconnectDiagnosticsLinkOpticalPower.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[305363284] = "HIGH_ALARM"] = 305363284; + values[valuesById[220984799] = "HIGH_WARNING"] = 220984799; + values[valuesById[316659046] = "LOW_ALARM"] = 316659046; + values[valuesById[338793841] = "LOW_WARNING"] = 338793841; + values[valuesById[2524] = "OK"] = 2524; + return values; + })(); + + return InterconnectDiagnosticsLinkOpticalPower; + })(); + + v1.InterconnectList = (function() { + + /** + * Properties of an InterconnectList. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectList + * @property {string|null} [id] InterconnectList id + * @property {Array.|null} [items] InterconnectList items + * @property {string|null} [kind] InterconnectList kind + * @property {string|null} [nextPageToken] InterconnectList nextPageToken + * @property {string|null} [selfLink] InterconnectList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InterconnectList warning + */ + + /** + * Constructs a new InterconnectList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectList. + * @implements IInterconnectList + * @constructor + * @param {google.cloud.compute.v1.IInterconnectList=} [properties] Properties to set + */ + function InterconnectList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + InterconnectList.prototype.id = null; + + /** + * InterconnectList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + InterconnectList.prototype.items = $util.emptyArray; + + /** + * InterconnectList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + InterconnectList.prototype.kind = null; + + /** + * InterconnectList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + InterconnectList.prototype.nextPageToken = null; + + /** + * InterconnectList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + InterconnectList.prototype.selfLink = null; + + /** + * InterconnectList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + InterconnectList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + Object.defineProperty(InterconnectList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + Object.defineProperty(InterconnectList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + Object.defineProperty(InterconnectList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + Object.defineProperty(InterconnectList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + */ + Object.defineProperty(InterconnectList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {google.cloud.compute.v1.IInterconnectList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectList} InterconnectList instance + */ + InterconnectList.create = function create(properties) { + return new InterconnectList(properties); + }; + + /** + * Encodes the specified InterconnectList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {google.cloud.compute.v1.IInterconnectList} message InterconnectList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Interconnect.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InterconnectList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {google.cloud.compute.v1.IInterconnectList} message InterconnectList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectList} InterconnectList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Interconnect.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectList} InterconnectList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectList message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Interconnect.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InterconnectList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectList} InterconnectList + */ + InterconnectList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectList) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InterconnectList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Interconnect.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InterconnectList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectList + * @static + * @param {google.cloud.compute.v1.InterconnectList} message InterconnectList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Interconnect.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InterconnectList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectList + * @instance + * @returns {Object.} JSON object + */ + InterconnectList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectList; + })(); + + v1.InterconnectLocationRegionInfo = (function() { + + /** + * Properties of an InterconnectLocationRegionInfo. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectLocationRegionInfo + * @property {number|Long|null} [expectedRttMs] InterconnectLocationRegionInfo expectedRttMs + * @property {google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence|null} [locationPresence] InterconnectLocationRegionInfo locationPresence + * @property {string|null} [region] InterconnectLocationRegionInfo region + */ + + /** + * Constructs a new InterconnectLocationRegionInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectLocationRegionInfo. + * @implements IInterconnectLocationRegionInfo + * @constructor + * @param {google.cloud.compute.v1.IInterconnectLocationRegionInfo=} [properties] Properties to set + */ + function InterconnectLocationRegionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectLocationRegionInfo expectedRttMs. + * @member {number|Long|null|undefined} expectedRttMs + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @instance + */ + InterconnectLocationRegionInfo.prototype.expectedRttMs = null; + + /** + * InterconnectLocationRegionInfo locationPresence. + * @member {google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence|null|undefined} locationPresence + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @instance + */ + InterconnectLocationRegionInfo.prototype.locationPresence = null; + + /** + * InterconnectLocationRegionInfo region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @instance + */ + InterconnectLocationRegionInfo.prototype.region = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectLocationRegionInfo _expectedRttMs. + * @member {"expectedRttMs"|undefined} _expectedRttMs + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @instance + */ + Object.defineProperty(InterconnectLocationRegionInfo.prototype, "_expectedRttMs", { + get: $util.oneOfGetter($oneOfFields = ["expectedRttMs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocationRegionInfo _locationPresence. + * @member {"locationPresence"|undefined} _locationPresence + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @instance + */ + Object.defineProperty(InterconnectLocationRegionInfo.prototype, "_locationPresence", { + get: $util.oneOfGetter($oneOfFields = ["locationPresence"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocationRegionInfo _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @instance + */ + Object.defineProperty(InterconnectLocationRegionInfo.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectLocationRegionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectLocationRegionInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectLocationRegionInfo} InterconnectLocationRegionInfo instance + */ + InterconnectLocationRegionInfo.create = function create(properties) { + return new InterconnectLocationRegionInfo(properties); + }; + + /** + * Encodes the specified InterconnectLocationRegionInfo message. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationRegionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectLocationRegionInfo} message InterconnectLocationRegionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectLocationRegionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationPresence != null && Object.hasOwnProperty.call(message, "locationPresence")) + writer.uint32(/* id 101517893, wireType 0 =*/812143144).int32(message.locationPresence); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.expectedRttMs != null && Object.hasOwnProperty.call(message, "expectedRttMs")) + writer.uint32(/* id 422543866, wireType 0 =*/3380350928).int64(message.expectedRttMs); + return writer; + }; + + /** + * Encodes the specified InterconnectLocationRegionInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationRegionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {google.cloud.compute.v1.IInterconnectLocationRegionInfo} message InterconnectLocationRegionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectLocationRegionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectLocationRegionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectLocationRegionInfo} InterconnectLocationRegionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectLocationRegionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectLocationRegionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422543866: + message.expectedRttMs = reader.int64(); + break; + case 101517893: + message.locationPresence = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectLocationRegionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectLocationRegionInfo} InterconnectLocationRegionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectLocationRegionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectLocationRegionInfo message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectLocationRegionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.expectedRttMs != null && message.hasOwnProperty("expectedRttMs")) { + properties._expectedRttMs = 1; + if (!$util.isInteger(message.expectedRttMs) && !(message.expectedRttMs && $util.isInteger(message.expectedRttMs.low) && $util.isInteger(message.expectedRttMs.high))) + return "expectedRttMs: integer|Long expected"; + } + if (message.locationPresence != null && message.hasOwnProperty("locationPresence")) { + properties._locationPresence = 1; + switch (message.locationPresence) { + default: + return "locationPresence: enum value expected"; + case 0: + case 494663587: + case 403535464: + case 429584062: + case 488598851: + break; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + return null; + }; + + /** + * Creates an InterconnectLocationRegionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectLocationRegionInfo} InterconnectLocationRegionInfo + */ + InterconnectLocationRegionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectLocationRegionInfo) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectLocationRegionInfo(); + if (object.expectedRttMs != null) + if ($util.Long) + (message.expectedRttMs = $util.Long.fromValue(object.expectedRttMs)).unsigned = false; + else if (typeof object.expectedRttMs === "string") + message.expectedRttMs = parseInt(object.expectedRttMs, 10); + else if (typeof object.expectedRttMs === "number") + message.expectedRttMs = object.expectedRttMs; + else if (typeof object.expectedRttMs === "object") + message.expectedRttMs = new $util.LongBits(object.expectedRttMs.low >>> 0, object.expectedRttMs.high >>> 0).toNumber(); + switch (object.locationPresence) { + case "UNDEFINED_LOCATION_PRESENCE": + case 0: + message.locationPresence = 0; + break; + case "GLOBAL": + case 494663587: + message.locationPresence = 494663587; + break; + case "LOCAL_REGION": + case 403535464: + message.locationPresence = 403535464; + break; + case "LP_GLOBAL": + case 429584062: + message.locationPresence = 429584062; + break; + case "LP_LOCAL_REGION": + case 488598851: + message.locationPresence = 488598851; + break; + } + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from an InterconnectLocationRegionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @static + * @param {google.cloud.compute.v1.InterconnectLocationRegionInfo} message InterconnectLocationRegionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectLocationRegionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.locationPresence != null && message.hasOwnProperty("locationPresence")) { + object.locationPresence = options.enums === String ? $root.google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence[message.locationPresence] : message.locationPresence; + if (options.oneofs) + object._locationPresence = "locationPresence"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.expectedRttMs != null && message.hasOwnProperty("expectedRttMs")) { + if (typeof message.expectedRttMs === "number") + object.expectedRttMs = options.longs === String ? String(message.expectedRttMs) : message.expectedRttMs; + else + object.expectedRttMs = options.longs === String ? $util.Long.prototype.toString.call(message.expectedRttMs) : options.longs === Number ? new $util.LongBits(message.expectedRttMs.low >>> 0, message.expectedRttMs.high >>> 0).toNumber() : message.expectedRttMs; + if (options.oneofs) + object._expectedRttMs = "expectedRttMs"; + } + return object; + }; + + /** + * Converts this InterconnectLocationRegionInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectLocationRegionInfo + * @instance + * @returns {Object.} JSON object + */ + InterconnectLocationRegionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * LocationPresence enum. + * @name google.cloud.compute.v1.InterconnectLocationRegionInfo.LocationPresence + * @enum {number} + * @property {number} UNDEFINED_LOCATION_PRESENCE=0 UNDEFINED_LOCATION_PRESENCE value + * @property {number} GLOBAL=494663587 GLOBAL value + * @property {number} LOCAL_REGION=403535464 LOCAL_REGION value + * @property {number} LP_GLOBAL=429584062 LP_GLOBAL value + * @property {number} LP_LOCAL_REGION=488598851 LP_LOCAL_REGION value + */ + InterconnectLocationRegionInfo.LocationPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LOCATION_PRESENCE"] = 0; + values[valuesById[494663587] = "GLOBAL"] = 494663587; + values[valuesById[403535464] = "LOCAL_REGION"] = 403535464; + values[valuesById[429584062] = "LP_GLOBAL"] = 429584062; + values[valuesById[488598851] = "LP_LOCAL_REGION"] = 488598851; + return values; + })(); + + return InterconnectLocationRegionInfo; + })(); + + v1.InterconnectLocation = (function() { + + /** + * Properties of an InterconnectLocation. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectLocation + * @property {string|null} [address] InterconnectLocation address + * @property {string|null} [availabilityZone] InterconnectLocation availabilityZone + * @property {string|null} [city] InterconnectLocation city + * @property {google.cloud.compute.v1.InterconnectLocation.Continent|null} [continent] InterconnectLocation continent + * @property {string|null} [creationTimestamp] InterconnectLocation creationTimestamp + * @property {string|null} [description] InterconnectLocation description + * @property {string|null} [facilityProvider] InterconnectLocation facilityProvider + * @property {string|null} [facilityProviderFacilityId] InterconnectLocation facilityProviderFacilityId + * @property {number|Long|null} [id] InterconnectLocation id + * @property {string|null} [kind] InterconnectLocation kind + * @property {string|null} [name] InterconnectLocation name + * @property {string|null} [peeringdbFacilityId] InterconnectLocation peeringdbFacilityId + * @property {Array.|null} [regionInfos] InterconnectLocation regionInfos + * @property {string|null} [selfLink] InterconnectLocation selfLink + * @property {google.cloud.compute.v1.InterconnectLocation.Status|null} [status] InterconnectLocation status + */ + + /** + * Constructs a new InterconnectLocation. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectLocation. + * @implements IInterconnectLocation + * @constructor + * @param {google.cloud.compute.v1.IInterconnectLocation=} [properties] Properties to set + */ + function InterconnectLocation(properties) { + this.regionInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectLocation address. + * @member {string|null|undefined} address + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.address = null; + + /** + * InterconnectLocation availabilityZone. + * @member {string|null|undefined} availabilityZone + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.availabilityZone = null; + + /** + * InterconnectLocation city. + * @member {string|null|undefined} city + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.city = null; + + /** + * InterconnectLocation continent. + * @member {google.cloud.compute.v1.InterconnectLocation.Continent|null|undefined} continent + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.continent = null; + + /** + * InterconnectLocation creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.creationTimestamp = null; + + /** + * InterconnectLocation description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.description = null; + + /** + * InterconnectLocation facilityProvider. + * @member {string|null|undefined} facilityProvider + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.facilityProvider = null; + + /** + * InterconnectLocation facilityProviderFacilityId. + * @member {string|null|undefined} facilityProviderFacilityId + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.facilityProviderFacilityId = null; + + /** + * InterconnectLocation id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.id = null; + + /** + * InterconnectLocation kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.kind = null; + + /** + * InterconnectLocation name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.name = null; + + /** + * InterconnectLocation peeringdbFacilityId. + * @member {string|null|undefined} peeringdbFacilityId + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.peeringdbFacilityId = null; + + /** + * InterconnectLocation regionInfos. + * @member {Array.} regionInfos + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.regionInfos = $util.emptyArray; + + /** + * InterconnectLocation selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.selfLink = null; + + /** + * InterconnectLocation status. + * @member {google.cloud.compute.v1.InterconnectLocation.Status|null|undefined} status + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + InterconnectLocation.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectLocation _address. + * @member {"address"|undefined} _address + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_address", { + get: $util.oneOfGetter($oneOfFields = ["address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _availabilityZone. + * @member {"availabilityZone"|undefined} _availabilityZone + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_availabilityZone", { + get: $util.oneOfGetter($oneOfFields = ["availabilityZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _city. + * @member {"city"|undefined} _city + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_city", { + get: $util.oneOfGetter($oneOfFields = ["city"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _continent. + * @member {"continent"|undefined} _continent + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_continent", { + get: $util.oneOfGetter($oneOfFields = ["continent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _facilityProvider. + * @member {"facilityProvider"|undefined} _facilityProvider + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_facilityProvider", { + get: $util.oneOfGetter($oneOfFields = ["facilityProvider"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _facilityProviderFacilityId. + * @member {"facilityProviderFacilityId"|undefined} _facilityProviderFacilityId + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_facilityProviderFacilityId", { + get: $util.oneOfGetter($oneOfFields = ["facilityProviderFacilityId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _peeringdbFacilityId. + * @member {"peeringdbFacilityId"|undefined} _peeringdbFacilityId + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_peeringdbFacilityId", { + get: $util.oneOfGetter($oneOfFields = ["peeringdbFacilityId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocation _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + */ + Object.defineProperty(InterconnectLocation.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectLocation instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {google.cloud.compute.v1.IInterconnectLocation=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectLocation} InterconnectLocation instance + */ + InterconnectLocation.create = function create(properties) { + return new InterconnectLocation(properties); + }; + + /** + * Encodes the specified InterconnectLocation message. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {google.cloud.compute.v1.IInterconnectLocation} message InterconnectLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.city != null && Object.hasOwnProperty.call(message, "city")) + writer.uint32(/* id 3053931, wireType 2 =*/24431450).string(message.city); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.facilityProviderFacilityId != null && Object.hasOwnProperty.call(message, "facilityProviderFacilityId")) + writer.uint32(/* id 87269125, wireType 2 =*/698153002).string(message.facilityProviderFacilityId); + if (message.continent != null && Object.hasOwnProperty.call(message, "continent")) + writer.uint32(/* id 133442996, wireType 0 =*/1067543968).int32(message.continent); + if (message.availabilityZone != null && Object.hasOwnProperty.call(message, "availabilityZone")) + writer.uint32(/* id 158459920, wireType 2 =*/1267679362).string(message.availabilityZone); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.regionInfos != null && message.regionInfos.length) + for (var i = 0; i < message.regionInfos.length; ++i) + $root.google.cloud.compute.v1.InterconnectLocationRegionInfo.encode(message.regionInfos[i], writer.uint32(/* id 312194170, wireType 2 =*/2497553362).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 462920692, wireType 2 =*/3703365538).string(message.address); + if (message.facilityProvider != null && Object.hasOwnProperty.call(message, "facilityProvider")) + writer.uint32(/* id 533303309, wireType 2 =*/4266426474).string(message.facilityProvider); + if (message.peeringdbFacilityId != null && Object.hasOwnProperty.call(message, "peeringdbFacilityId")) + writer.uint32(/* id 536567094, wireType 2 =*/4292536754).string(message.peeringdbFacilityId); + return writer; + }; + + /** + * Encodes the specified InterconnectLocation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {google.cloud.compute.v1.IInterconnectLocation} message InterconnectLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectLocation} InterconnectLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 462920692: + message.address = reader.string(); + break; + case 158459920: + message.availabilityZone = reader.string(); + break; + case 3053931: + message.city = reader.string(); + break; + case 133442996: + message.continent = reader.int32(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 533303309: + message.facilityProvider = reader.string(); + break; + case 87269125: + message.facilityProviderFacilityId = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 536567094: + message.peeringdbFacilityId = reader.string(); + break; + case 312194170: + if (!(message.regionInfos && message.regionInfos.length)) + message.regionInfos = []; + message.regionInfos.push($root.google.cloud.compute.v1.InterconnectLocationRegionInfo.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectLocation} InterconnectLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectLocation message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.address != null && message.hasOwnProperty("address")) { + properties._address = 1; + if (!$util.isString(message.address)) + return "address: string expected"; + } + if (message.availabilityZone != null && message.hasOwnProperty("availabilityZone")) { + properties._availabilityZone = 1; + if (!$util.isString(message.availabilityZone)) + return "availabilityZone: string expected"; + } + if (message.city != null && message.hasOwnProperty("city")) { + properties._city = 1; + if (!$util.isString(message.city)) + return "city: string expected"; + } + if (message.continent != null && message.hasOwnProperty("continent")) { + properties._continent = 1; + switch (message.continent) { + default: + return "continent: enum value expected"; + case 0: + case 317443706: + case 119782269: + case 71993846: + case 465668089: + case 200369438: + case 275697048: + case 397149792: + case 445819298: + case 448015508: + case 32597340: + break; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.facilityProvider != null && message.hasOwnProperty("facilityProvider")) { + properties._facilityProvider = 1; + if (!$util.isString(message.facilityProvider)) + return "facilityProvider: string expected"; + } + if (message.facilityProviderFacilityId != null && message.hasOwnProperty("facilityProviderFacilityId")) { + properties._facilityProviderFacilityId = 1; + if (!$util.isString(message.facilityProviderFacilityId)) + return "facilityProviderFacilityId: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.peeringdbFacilityId != null && message.hasOwnProperty("peeringdbFacilityId")) { + properties._peeringdbFacilityId = 1; + if (!$util.isString(message.peeringdbFacilityId)) + return "peeringdbFacilityId: string expected"; + } + if (message.regionInfos != null && message.hasOwnProperty("regionInfos")) { + if (!Array.isArray(message.regionInfos)) + return "regionInfos: array expected"; + for (var i = 0; i < message.regionInfos.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectLocationRegionInfo.verify(message.regionInfos[i]); + if (error) + return "regionInfos." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 442079913: + case 380163436: + break; + } + } + return null; + }; + + /** + * Creates an InterconnectLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectLocation} InterconnectLocation + */ + InterconnectLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectLocation) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectLocation(); + if (object.address != null) + message.address = String(object.address); + if (object.availabilityZone != null) + message.availabilityZone = String(object.availabilityZone); + if (object.city != null) + message.city = String(object.city); + switch (object.continent) { + case "UNDEFINED_CONTINENT": + case 0: + message.continent = 0; + break; + case "AFRICA": + case 317443706: + message.continent = 317443706; + break; + case "ASIA_PAC": + case 119782269: + message.continent = 119782269; + break; + case "C_AFRICA": + case 71993846: + message.continent = 71993846; + break; + case "C_ASIA_PAC": + case 465668089: + message.continent = 465668089; + break; + case "C_EUROPE": + case 200369438: + message.continent = 200369438; + break; + case "C_NORTH_AMERICA": + case 275697048: + message.continent = 275697048; + break; + case "C_SOUTH_AMERICA": + case 397149792: + message.continent = 397149792; + break; + case "EUROPE": + case 445819298: + message.continent = 445819298; + break; + case "NORTH_AMERICA": + case 448015508: + message.continent = 448015508; + break; + case "SOUTH_AMERICA": + case 32597340: + message.continent = 32597340; + break; + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.facilityProvider != null) + message.facilityProvider = String(object.facilityProvider); + if (object.facilityProviderFacilityId != null) + message.facilityProviderFacilityId = String(object.facilityProviderFacilityId); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.peeringdbFacilityId != null) + message.peeringdbFacilityId = String(object.peeringdbFacilityId); + if (object.regionInfos) { + if (!Array.isArray(object.regionInfos)) + throw TypeError(".google.cloud.compute.v1.InterconnectLocation.regionInfos: array expected"); + message.regionInfos = []; + for (var i = 0; i < object.regionInfos.length; ++i) { + if (typeof object.regionInfos[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectLocation.regionInfos: object expected"); + message.regionInfos[i] = $root.google.cloud.compute.v1.InterconnectLocationRegionInfo.fromObject(object.regionInfos[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "AVAILABLE": + case 442079913: + message.status = 442079913; + break; + case "CLOSED": + case 380163436: + message.status = 380163436; + break; + } + return message; + }; + + /** + * Creates a plain object from an InterconnectLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectLocation + * @static + * @param {google.cloud.compute.v1.InterconnectLocation} message InterconnectLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.regionInfos = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.city != null && message.hasOwnProperty("city")) { + object.city = message.city; + if (options.oneofs) + object._city = "city"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.facilityProviderFacilityId != null && message.hasOwnProperty("facilityProviderFacilityId")) { + object.facilityProviderFacilityId = message.facilityProviderFacilityId; + if (options.oneofs) + object._facilityProviderFacilityId = "facilityProviderFacilityId"; + } + if (message.continent != null && message.hasOwnProperty("continent")) { + object.continent = options.enums === String ? $root.google.cloud.compute.v1.InterconnectLocation.Continent[message.continent] : message.continent; + if (options.oneofs) + object._continent = "continent"; + } + if (message.availabilityZone != null && message.hasOwnProperty("availabilityZone")) { + object.availabilityZone = message.availabilityZone; + if (options.oneofs) + object._availabilityZone = "availabilityZone"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.InterconnectLocation.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.regionInfos && message.regionInfos.length) { + object.regionInfos = []; + for (var j = 0; j < message.regionInfos.length; ++j) + object.regionInfos[j] = $root.google.cloud.compute.v1.InterconnectLocationRegionInfo.toObject(message.regionInfos[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.address != null && message.hasOwnProperty("address")) { + object.address = message.address; + if (options.oneofs) + object._address = "address"; + } + if (message.facilityProvider != null && message.hasOwnProperty("facilityProvider")) { + object.facilityProvider = message.facilityProvider; + if (options.oneofs) + object._facilityProvider = "facilityProvider"; + } + if (message.peeringdbFacilityId != null && message.hasOwnProperty("peeringdbFacilityId")) { + object.peeringdbFacilityId = message.peeringdbFacilityId; + if (options.oneofs) + object._peeringdbFacilityId = "peeringdbFacilityId"; + } + return object; + }; + + /** + * Converts this InterconnectLocation to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectLocation + * @instance + * @returns {Object.} JSON object + */ + InterconnectLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Continent enum. + * @name google.cloud.compute.v1.InterconnectLocation.Continent + * @enum {number} + * @property {number} UNDEFINED_CONTINENT=0 UNDEFINED_CONTINENT value + * @property {number} AFRICA=317443706 AFRICA value + * @property {number} ASIA_PAC=119782269 ASIA_PAC value + * @property {number} C_AFRICA=71993846 C_AFRICA value + * @property {number} C_ASIA_PAC=465668089 C_ASIA_PAC value + * @property {number} C_EUROPE=200369438 C_EUROPE value + * @property {number} C_NORTH_AMERICA=275697048 C_NORTH_AMERICA value + * @property {number} C_SOUTH_AMERICA=397149792 C_SOUTH_AMERICA value + * @property {number} EUROPE=445819298 EUROPE value + * @property {number} NORTH_AMERICA=448015508 NORTH_AMERICA value + * @property {number} SOUTH_AMERICA=32597340 SOUTH_AMERICA value + */ + InterconnectLocation.Continent = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CONTINENT"] = 0; + values[valuesById[317443706] = "AFRICA"] = 317443706; + values[valuesById[119782269] = "ASIA_PAC"] = 119782269; + values[valuesById[71993846] = "C_AFRICA"] = 71993846; + values[valuesById[465668089] = "C_ASIA_PAC"] = 465668089; + values[valuesById[200369438] = "C_EUROPE"] = 200369438; + values[valuesById[275697048] = "C_NORTH_AMERICA"] = 275697048; + values[valuesById[397149792] = "C_SOUTH_AMERICA"] = 397149792; + values[valuesById[445819298] = "EUROPE"] = 445819298; + values[valuesById[448015508] = "NORTH_AMERICA"] = 448015508; + values[valuesById[32597340] = "SOUTH_AMERICA"] = 32597340; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.InterconnectLocation.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} AVAILABLE=442079913 AVAILABLE value + * @property {number} CLOSED=380163436 CLOSED value + */ + InterconnectLocation.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[442079913] = "AVAILABLE"] = 442079913; + values[valuesById[380163436] = "CLOSED"] = 380163436; + return values; + })(); + + return InterconnectLocation; + })(); + + v1.InterconnectLocationList = (function() { + + /** + * Properties of an InterconnectLocationList. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectLocationList + * @property {string|null} [id] InterconnectLocationList id + * @property {Array.|null} [items] InterconnectLocationList items + * @property {string|null} [kind] InterconnectLocationList kind + * @property {string|null} [nextPageToken] InterconnectLocationList nextPageToken + * @property {string|null} [selfLink] InterconnectLocationList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] InterconnectLocationList warning + */ + + /** + * Constructs a new InterconnectLocationList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectLocationList. + * @implements IInterconnectLocationList + * @constructor + * @param {google.cloud.compute.v1.IInterconnectLocationList=} [properties] Properties to set + */ + function InterconnectLocationList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectLocationList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + InterconnectLocationList.prototype.id = null; + + /** + * InterconnectLocationList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + InterconnectLocationList.prototype.items = $util.emptyArray; + + /** + * InterconnectLocationList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + InterconnectLocationList.prototype.kind = null; + + /** + * InterconnectLocationList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + InterconnectLocationList.prototype.nextPageToken = null; + + /** + * InterconnectLocationList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + InterconnectLocationList.prototype.selfLink = null; + + /** + * InterconnectLocationList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + InterconnectLocationList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectLocationList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + Object.defineProperty(InterconnectLocationList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocationList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + Object.defineProperty(InterconnectLocationList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocationList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + Object.defineProperty(InterconnectLocationList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocationList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + Object.defineProperty(InterconnectLocationList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InterconnectLocationList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + */ + Object.defineProperty(InterconnectLocationList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectLocationList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {google.cloud.compute.v1.IInterconnectLocationList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectLocationList} InterconnectLocationList instance + */ + InterconnectLocationList.create = function create(properties) { + return new InterconnectLocationList(properties); + }; + + /** + * Encodes the specified InterconnectLocationList message. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {google.cloud.compute.v1.IInterconnectLocationList} message InterconnectLocationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectLocationList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InterconnectLocation.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified InterconnectLocationList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectLocationList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {google.cloud.compute.v1.IInterconnectLocationList} message InterconnectLocationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectLocationList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectLocationList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectLocationList} InterconnectLocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectLocationList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectLocationList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InterconnectLocation.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectLocationList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectLocationList} InterconnectLocationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectLocationList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectLocationList message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectLocationList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InterconnectLocation.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an InterconnectLocationList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectLocationList} InterconnectLocationList + */ + InterconnectLocationList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectLocationList) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectLocationList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.InterconnectLocationList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectLocationList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InterconnectLocation.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectLocationList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an InterconnectLocationList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @static + * @param {google.cloud.compute.v1.InterconnectLocationList} message InterconnectLocationList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectLocationList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InterconnectLocation.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this InterconnectLocationList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectLocationList + * @instance + * @returns {Object.} JSON object + */ + InterconnectLocationList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectLocationList; + })(); + + v1.InterconnectsGetDiagnosticsResponse = (function() { + + /** + * Properties of an InterconnectsGetDiagnosticsResponse. + * @memberof google.cloud.compute.v1 + * @interface IInterconnectsGetDiagnosticsResponse + * @property {google.cloud.compute.v1.IInterconnectDiagnostics|null} [result] InterconnectsGetDiagnosticsResponse result + */ + + /** + * Constructs a new InterconnectsGetDiagnosticsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectsGetDiagnosticsResponse. + * @implements IInterconnectsGetDiagnosticsResponse + * @constructor + * @param {google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse=} [properties] Properties to set + */ + function InterconnectsGetDiagnosticsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InterconnectsGetDiagnosticsResponse result. + * @member {google.cloud.compute.v1.IInterconnectDiagnostics|null|undefined} result + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @instance + */ + InterconnectsGetDiagnosticsResponse.prototype.result = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InterconnectsGetDiagnosticsResponse _result. + * @member {"result"|undefined} _result + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @instance + */ + Object.defineProperty(InterconnectsGetDiagnosticsResponse.prototype, "_result", { + get: $util.oneOfGetter($oneOfFields = ["result"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InterconnectsGetDiagnosticsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse} InterconnectsGetDiagnosticsResponse instance + */ + InterconnectsGetDiagnosticsResponse.create = function create(properties) { + return new InterconnectsGetDiagnosticsResponse(properties); + }; + + /** + * Encodes the specified InterconnectsGetDiagnosticsResponse message. Does not implicitly {@link google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse} message InterconnectsGetDiagnosticsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectsGetDiagnosticsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.compute.v1.InterconnectDiagnostics.encode(message.result, writer.uint32(/* id 139315229, wireType 2 =*/1114521834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InterconnectsGetDiagnosticsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse} message InterconnectsGetDiagnosticsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InterconnectsGetDiagnosticsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InterconnectsGetDiagnosticsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse} InterconnectsGetDiagnosticsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectsGetDiagnosticsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 139315229: + message.result = $root.google.cloud.compute.v1.InterconnectDiagnostics.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InterconnectsGetDiagnosticsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse} InterconnectsGetDiagnosticsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InterconnectsGetDiagnosticsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InterconnectsGetDiagnosticsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InterconnectsGetDiagnosticsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.result != null && message.hasOwnProperty("result")) { + properties._result = 1; + { + var error = $root.google.cloud.compute.v1.InterconnectDiagnostics.verify(message.result); + if (error) + return "result." + error; + } + } + return null; + }; + + /** + * Creates an InterconnectsGetDiagnosticsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse} InterconnectsGetDiagnosticsResponse + */ + InterconnectsGetDiagnosticsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse) + return object; + var message = new $root.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse.result: object expected"); + message.result = $root.google.cloud.compute.v1.InterconnectDiagnostics.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from an InterconnectsGetDiagnosticsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @static + * @param {google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse} message InterconnectsGetDiagnosticsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InterconnectsGetDiagnosticsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.result != null && message.hasOwnProperty("result")) { + object.result = $root.google.cloud.compute.v1.InterconnectDiagnostics.toObject(message.result, options); + if (options.oneofs) + object._result = "result"; + } + return object; + }; + + /** + * Converts this InterconnectsGetDiagnosticsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse + * @instance + * @returns {Object.} JSON object + */ + InterconnectsGetDiagnosticsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InterconnectsGetDiagnosticsResponse; + })(); + + v1.LicenseResourceRequirements = (function() { + + /** + * Properties of a LicenseResourceRequirements. + * @memberof google.cloud.compute.v1 + * @interface ILicenseResourceRequirements + * @property {number|null} [minGuestCpuCount] LicenseResourceRequirements minGuestCpuCount + * @property {number|null} [minMemoryMb] LicenseResourceRequirements minMemoryMb + */ + + /** + * Constructs a new LicenseResourceRequirements. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LicenseResourceRequirements. + * @implements ILicenseResourceRequirements + * @constructor + * @param {google.cloud.compute.v1.ILicenseResourceRequirements=} [properties] Properties to set + */ + function LicenseResourceRequirements(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LicenseResourceRequirements minGuestCpuCount. + * @member {number|null|undefined} minGuestCpuCount + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @instance + */ + LicenseResourceRequirements.prototype.minGuestCpuCount = null; + + /** + * LicenseResourceRequirements minMemoryMb. + * @member {number|null|undefined} minMemoryMb + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @instance + */ + LicenseResourceRequirements.prototype.minMemoryMb = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LicenseResourceRequirements _minGuestCpuCount. + * @member {"minGuestCpuCount"|undefined} _minGuestCpuCount + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @instance + */ + Object.defineProperty(LicenseResourceRequirements.prototype, "_minGuestCpuCount", { + get: $util.oneOfGetter($oneOfFields = ["minGuestCpuCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseResourceRequirements _minMemoryMb. + * @member {"minMemoryMb"|undefined} _minMemoryMb + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @instance + */ + Object.defineProperty(LicenseResourceRequirements.prototype, "_minMemoryMb", { + get: $util.oneOfGetter($oneOfFields = ["minMemoryMb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LicenseResourceRequirements instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {google.cloud.compute.v1.ILicenseResourceRequirements=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LicenseResourceRequirements} LicenseResourceRequirements instance + */ + LicenseResourceRequirements.create = function create(properties) { + return new LicenseResourceRequirements(properties); + }; + + /** + * Encodes the specified LicenseResourceRequirements message. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceRequirements.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {google.cloud.compute.v1.ILicenseResourceRequirements} message LicenseResourceRequirements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseResourceRequirements.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minGuestCpuCount != null && Object.hasOwnProperty.call(message, "minGuestCpuCount")) + writer.uint32(/* id 477964836, wireType 0 =*/3823718688).int32(message.minGuestCpuCount); + if (message.minMemoryMb != null && Object.hasOwnProperty.call(message, "minMemoryMb")) + writer.uint32(/* id 504785894, wireType 0 =*/4038287152).int32(message.minMemoryMb); + return writer; + }; + + /** + * Encodes the specified LicenseResourceRequirements message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseResourceRequirements.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {google.cloud.compute.v1.ILicenseResourceRequirements} message LicenseResourceRequirements message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseResourceRequirements.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LicenseResourceRequirements message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LicenseResourceRequirements} LicenseResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseResourceRequirements.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LicenseResourceRequirements(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 477964836: + message.minGuestCpuCount = reader.int32(); + break; + case 504785894: + message.minMemoryMb = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LicenseResourceRequirements message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LicenseResourceRequirements} LicenseResourceRequirements + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseResourceRequirements.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LicenseResourceRequirements message. + * @function verify + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LicenseResourceRequirements.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.minGuestCpuCount != null && message.hasOwnProperty("minGuestCpuCount")) { + properties._minGuestCpuCount = 1; + if (!$util.isInteger(message.minGuestCpuCount)) + return "minGuestCpuCount: integer expected"; + } + if (message.minMemoryMb != null && message.hasOwnProperty("minMemoryMb")) { + properties._minMemoryMb = 1; + if (!$util.isInteger(message.minMemoryMb)) + return "minMemoryMb: integer expected"; + } + return null; + }; + + /** + * Creates a LicenseResourceRequirements message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LicenseResourceRequirements} LicenseResourceRequirements + */ + LicenseResourceRequirements.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LicenseResourceRequirements) + return object; + var message = new $root.google.cloud.compute.v1.LicenseResourceRequirements(); + if (object.minGuestCpuCount != null) + message.minGuestCpuCount = object.minGuestCpuCount | 0; + if (object.minMemoryMb != null) + message.minMemoryMb = object.minMemoryMb | 0; + return message; + }; + + /** + * Creates a plain object from a LicenseResourceRequirements message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @static + * @param {google.cloud.compute.v1.LicenseResourceRequirements} message LicenseResourceRequirements + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LicenseResourceRequirements.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.minGuestCpuCount != null && message.hasOwnProperty("minGuestCpuCount")) { + object.minGuestCpuCount = message.minGuestCpuCount; + if (options.oneofs) + object._minGuestCpuCount = "minGuestCpuCount"; + } + if (message.minMemoryMb != null && message.hasOwnProperty("minMemoryMb")) { + object.minMemoryMb = message.minMemoryMb; + if (options.oneofs) + object._minMemoryMb = "minMemoryMb"; + } + return object; + }; + + /** + * Converts this LicenseResourceRequirements to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LicenseResourceRequirements + * @instance + * @returns {Object.} JSON object + */ + LicenseResourceRequirements.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LicenseResourceRequirements; + })(); + + v1.License = (function() { + + /** + * Properties of a License. + * @memberof google.cloud.compute.v1 + * @interface ILicense + * @property {boolean|null} [chargesUseFee] License chargesUseFee + * @property {string|null} [creationTimestamp] License creationTimestamp + * @property {string|null} [description] License description + * @property {number|Long|null} [id] License id + * @property {string|null} [kind] License kind + * @property {number|Long|null} [licenseCode] License licenseCode + * @property {string|null} [name] License name + * @property {google.cloud.compute.v1.ILicenseResourceRequirements|null} [resourceRequirements] License resourceRequirements + * @property {string|null} [selfLink] License selfLink + * @property {boolean|null} [transferable] License transferable + */ + + /** + * Constructs a new License. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a License. + * @implements ILicense + * @constructor + * @param {google.cloud.compute.v1.ILicense=} [properties] Properties to set + */ + function License(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * License chargesUseFee. + * @member {boolean|null|undefined} chargesUseFee + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.chargesUseFee = null; + + /** + * License creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.creationTimestamp = null; + + /** + * License description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.description = null; + + /** + * License id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.id = null; + + /** + * License kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.kind = null; + + /** + * License licenseCode. + * @member {number|Long|null|undefined} licenseCode + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.licenseCode = null; + + /** + * License name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.name = null; + + /** + * License resourceRequirements. + * @member {google.cloud.compute.v1.ILicenseResourceRequirements|null|undefined} resourceRequirements + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.resourceRequirements = null; + + /** + * License selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.selfLink = null; + + /** + * License transferable. + * @member {boolean|null|undefined} transferable + * @memberof google.cloud.compute.v1.License + * @instance + */ + License.prototype.transferable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * License _chargesUseFee. + * @member {"chargesUseFee"|undefined} _chargesUseFee + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_chargesUseFee", { + get: $util.oneOfGetter($oneOfFields = ["chargesUseFee"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _licenseCode. + * @member {"licenseCode"|undefined} _licenseCode + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_licenseCode", { + get: $util.oneOfGetter($oneOfFields = ["licenseCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _resourceRequirements. + * @member {"resourceRequirements"|undefined} _resourceRequirements + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_resourceRequirements", { + get: $util.oneOfGetter($oneOfFields = ["resourceRequirements"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * License _transferable. + * @member {"transferable"|undefined} _transferable + * @memberof google.cloud.compute.v1.License + * @instance + */ + Object.defineProperty(License.prototype, "_transferable", { + get: $util.oneOfGetter($oneOfFields = ["transferable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new License instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.License + * @static + * @param {google.cloud.compute.v1.ILicense=} [properties] Properties to set + * @returns {google.cloud.compute.v1.License} License instance + */ + License.create = function create(properties) { + return new License(properties); + }; + + /** + * Encodes the specified License message. Does not implicitly {@link google.cloud.compute.v1.License.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.License + * @static + * @param {google.cloud.compute.v1.ILicense} message License message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + License.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.licenseCode != null && Object.hasOwnProperty.call(message, "licenseCode")) + writer.uint32(/* id 1467179, wireType 0 =*/11737432).uint64(message.licenseCode); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.transferable != null && Object.hasOwnProperty.call(message, "transferable")) + writer.uint32(/* id 4349893, wireType 0 =*/34799144).bool(message.transferable); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.resourceRequirements != null && Object.hasOwnProperty.call(message, "resourceRequirements")) + $root.google.cloud.compute.v1.LicenseResourceRequirements.encode(message.resourceRequirements, writer.uint32(/* id 214292769, wireType 2 =*/1714342154).fork()).ldelim(); + if (message.chargesUseFee != null && Object.hasOwnProperty.call(message, "chargesUseFee")) + writer.uint32(/* id 372412622, wireType 0 =*/2979300976).bool(message.chargesUseFee); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified License message, length delimited. Does not implicitly {@link google.cloud.compute.v1.License.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.License + * @static + * @param {google.cloud.compute.v1.ILicense} message License message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + License.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a License message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.License + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.License} License + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + License.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.License(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 372412622: + message.chargesUseFee = reader.bool(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 1467179: + message.licenseCode = reader.uint64(); + break; + case 3373707: + message.name = reader.string(); + break; + case 214292769: + message.resourceRequirements = $root.google.cloud.compute.v1.LicenseResourceRequirements.decode(reader, reader.uint32()); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 4349893: + message.transferable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a License message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.License + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.License} License + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + License.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a License message. + * @function verify + * @memberof google.cloud.compute.v1.License + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + License.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.chargesUseFee != null && message.hasOwnProperty("chargesUseFee")) { + properties._chargesUseFee = 1; + if (typeof message.chargesUseFee !== "boolean") + return "chargesUseFee: boolean expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.licenseCode != null && message.hasOwnProperty("licenseCode")) { + properties._licenseCode = 1; + if (!$util.isInteger(message.licenseCode) && !(message.licenseCode && $util.isInteger(message.licenseCode.low) && $util.isInteger(message.licenseCode.high))) + return "licenseCode: integer|Long expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.resourceRequirements != null && message.hasOwnProperty("resourceRequirements")) { + properties._resourceRequirements = 1; + { + var error = $root.google.cloud.compute.v1.LicenseResourceRequirements.verify(message.resourceRequirements); + if (error) + return "resourceRequirements." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.transferable != null && message.hasOwnProperty("transferable")) { + properties._transferable = 1; + if (typeof message.transferable !== "boolean") + return "transferable: boolean expected"; + } + return null; + }; + + /** + * Creates a License message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.License + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.License} License + */ + License.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.License) + return object; + var message = new $root.google.cloud.compute.v1.License(); + if (object.chargesUseFee != null) + message.chargesUseFee = Boolean(object.chargesUseFee); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.licenseCode != null) + if ($util.Long) + (message.licenseCode = $util.Long.fromValue(object.licenseCode)).unsigned = true; + else if (typeof object.licenseCode === "string") + message.licenseCode = parseInt(object.licenseCode, 10); + else if (typeof object.licenseCode === "number") + message.licenseCode = object.licenseCode; + else if (typeof object.licenseCode === "object") + message.licenseCode = new $util.LongBits(object.licenseCode.low >>> 0, object.licenseCode.high >>> 0).toNumber(true); + if (object.name != null) + message.name = String(object.name); + if (object.resourceRequirements != null) { + if (typeof object.resourceRequirements !== "object") + throw TypeError(".google.cloud.compute.v1.License.resourceRequirements: object expected"); + message.resourceRequirements = $root.google.cloud.compute.v1.LicenseResourceRequirements.fromObject(object.resourceRequirements); + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.transferable != null) + message.transferable = Boolean(object.transferable); + return message; + }; + + /** + * Creates a plain object from a License message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.License + * @static + * @param {google.cloud.compute.v1.License} message License + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + License.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.licenseCode != null && message.hasOwnProperty("licenseCode")) { + if (typeof message.licenseCode === "number") + object.licenseCode = options.longs === String ? String(message.licenseCode) : message.licenseCode; + else + object.licenseCode = options.longs === String ? $util.Long.prototype.toString.call(message.licenseCode) : options.longs === Number ? new $util.LongBits(message.licenseCode.low >>> 0, message.licenseCode.high >>> 0).toNumber(true) : message.licenseCode; + if (options.oneofs) + object._licenseCode = "licenseCode"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.transferable != null && message.hasOwnProperty("transferable")) { + object.transferable = message.transferable; + if (options.oneofs) + object._transferable = "transferable"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.resourceRequirements != null && message.hasOwnProperty("resourceRequirements")) { + object.resourceRequirements = $root.google.cloud.compute.v1.LicenseResourceRequirements.toObject(message.resourceRequirements, options); + if (options.oneofs) + object._resourceRequirements = "resourceRequirements"; + } + if (message.chargesUseFee != null && message.hasOwnProperty("chargesUseFee")) { + object.chargesUseFee = message.chargesUseFee; + if (options.oneofs) + object._chargesUseFee = "chargesUseFee"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this License to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.License + * @instance + * @returns {Object.} JSON object + */ + License.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return License; + })(); + + v1.LicenseCodeLicenseAlias = (function() { + + /** + * Properties of a LicenseCodeLicenseAlias. + * @memberof google.cloud.compute.v1 + * @interface ILicenseCodeLicenseAlias + * @property {string|null} [description] LicenseCodeLicenseAlias description + * @property {string|null} [selfLink] LicenseCodeLicenseAlias selfLink + */ + + /** + * Constructs a new LicenseCodeLicenseAlias. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LicenseCodeLicenseAlias. + * @implements ILicenseCodeLicenseAlias + * @constructor + * @param {google.cloud.compute.v1.ILicenseCodeLicenseAlias=} [properties] Properties to set + */ + function LicenseCodeLicenseAlias(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LicenseCodeLicenseAlias description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @instance + */ + LicenseCodeLicenseAlias.prototype.description = null; + + /** + * LicenseCodeLicenseAlias selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @instance + */ + LicenseCodeLicenseAlias.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LicenseCodeLicenseAlias _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @instance + */ + Object.defineProperty(LicenseCodeLicenseAlias.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCodeLicenseAlias _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @instance + */ + Object.defineProperty(LicenseCodeLicenseAlias.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LicenseCodeLicenseAlias instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {google.cloud.compute.v1.ILicenseCodeLicenseAlias=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LicenseCodeLicenseAlias} LicenseCodeLicenseAlias instance + */ + LicenseCodeLicenseAlias.create = function create(properties) { + return new LicenseCodeLicenseAlias(properties); + }; + + /** + * Encodes the specified LicenseCodeLicenseAlias message. Does not implicitly {@link google.cloud.compute.v1.LicenseCodeLicenseAlias.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {google.cloud.compute.v1.ILicenseCodeLicenseAlias} message LicenseCodeLicenseAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseCodeLicenseAlias.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified LicenseCodeLicenseAlias message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseCodeLicenseAlias.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {google.cloud.compute.v1.ILicenseCodeLicenseAlias} message LicenseCodeLicenseAlias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseCodeLicenseAlias.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LicenseCodeLicenseAlias message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LicenseCodeLicenseAlias} LicenseCodeLicenseAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseCodeLicenseAlias.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LicenseCodeLicenseAlias(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LicenseCodeLicenseAlias message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LicenseCodeLicenseAlias} LicenseCodeLicenseAlias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseCodeLicenseAlias.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LicenseCodeLicenseAlias message. + * @function verify + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LicenseCodeLicenseAlias.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates a LicenseCodeLicenseAlias message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LicenseCodeLicenseAlias} LicenseCodeLicenseAlias + */ + LicenseCodeLicenseAlias.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LicenseCodeLicenseAlias) + return object; + var message = new $root.google.cloud.compute.v1.LicenseCodeLicenseAlias(); + if (object.description != null) + message.description = String(object.description); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from a LicenseCodeLicenseAlias message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @static + * @param {google.cloud.compute.v1.LicenseCodeLicenseAlias} message LicenseCodeLicenseAlias + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LicenseCodeLicenseAlias.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this LicenseCodeLicenseAlias to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LicenseCodeLicenseAlias + * @instance + * @returns {Object.} JSON object + */ + LicenseCodeLicenseAlias.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LicenseCodeLicenseAlias; + })(); + + v1.LicenseCode = (function() { + + /** + * Properties of a LicenseCode. + * @memberof google.cloud.compute.v1 + * @interface ILicenseCode + * @property {string|null} [creationTimestamp] LicenseCode creationTimestamp + * @property {string|null} [description] LicenseCode description + * @property {number|Long|null} [id] LicenseCode id + * @property {string|null} [kind] LicenseCode kind + * @property {Array.|null} [licenseAlias] LicenseCode licenseAlias + * @property {string|null} [name] LicenseCode name + * @property {string|null} [selfLink] LicenseCode selfLink + * @property {google.cloud.compute.v1.LicenseCode.State|null} [state] LicenseCode state + * @property {boolean|null} [transferable] LicenseCode transferable + */ + + /** + * Constructs a new LicenseCode. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LicenseCode. + * @implements ILicenseCode + * @constructor + * @param {google.cloud.compute.v1.ILicenseCode=} [properties] Properties to set + */ + function LicenseCode(properties) { + this.licenseAlias = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LicenseCode creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.creationTimestamp = null; + + /** + * LicenseCode description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.description = null; + + /** + * LicenseCode id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.id = null; + + /** + * LicenseCode kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.kind = null; + + /** + * LicenseCode licenseAlias. + * @member {Array.} licenseAlias + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.licenseAlias = $util.emptyArray; + + /** + * LicenseCode name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.name = null; + + /** + * LicenseCode selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.selfLink = null; + + /** + * LicenseCode state. + * @member {google.cloud.compute.v1.LicenseCode.State|null|undefined} state + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.state = null; + + /** + * LicenseCode transferable. + * @member {boolean|null|undefined} transferable + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + LicenseCode.prototype.transferable = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LicenseCode _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCode _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCode _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCode _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCode _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCode _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCode _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicenseCode _transferable. + * @member {"transferable"|undefined} _transferable + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + */ + Object.defineProperty(LicenseCode.prototype, "_transferable", { + get: $util.oneOfGetter($oneOfFields = ["transferable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LicenseCode instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {google.cloud.compute.v1.ILicenseCode=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LicenseCode} LicenseCode instance + */ + LicenseCode.create = function create(properties) { + return new LicenseCode(properties); + }; + + /** + * Encodes the specified LicenseCode message. Does not implicitly {@link google.cloud.compute.v1.LicenseCode.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {google.cloud.compute.v1.ILicenseCode} message LicenseCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseCode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.transferable != null && Object.hasOwnProperty.call(message, "transferable")) + writer.uint32(/* id 4349893, wireType 0 =*/34799144).bool(message.transferable); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.licenseAlias != null && message.licenseAlias.length) + for (var i = 0; i < message.licenseAlias.length; ++i) + $root.google.cloud.compute.v1.LicenseCodeLicenseAlias.encode(message.licenseAlias[i], writer.uint32(/* id 43550930, wireType 2 =*/348407442).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified LicenseCode message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicenseCode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {google.cloud.compute.v1.ILicenseCode} message LicenseCode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicenseCode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LicenseCode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LicenseCode} LicenseCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseCode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LicenseCode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 43550930: + if (!(message.licenseAlias && message.licenseAlias.length)) + message.licenseAlias = []; + message.licenseAlias.push($root.google.cloud.compute.v1.LicenseCodeLicenseAlias.decode(reader, reader.uint32())); + break; + case 3373707: + message.name = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 109757585: + message.state = reader.int32(); + break; + case 4349893: + message.transferable = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LicenseCode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LicenseCode} LicenseCode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicenseCode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LicenseCode message. + * @function verify + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LicenseCode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.licenseAlias != null && message.hasOwnProperty("licenseAlias")) { + if (!Array.isArray(message.licenseAlias)) + return "licenseAlias: array expected"; + for (var i = 0; i < message.licenseAlias.length; ++i) { + var error = $root.google.cloud.compute.v1.LicenseCodeLicenseAlias.verify(message.licenseAlias[i]); + if (error) + return "licenseAlias." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 516696700: + case 182130465: + case 261551195: + case 470755401: + case 250018339: + break; + } + } + if (message.transferable != null && message.hasOwnProperty("transferable")) { + properties._transferable = 1; + if (typeof message.transferable !== "boolean") + return "transferable: boolean expected"; + } + return null; + }; + + /** + * Creates a LicenseCode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LicenseCode} LicenseCode + */ + LicenseCode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LicenseCode) + return object; + var message = new $root.google.cloud.compute.v1.LicenseCode(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.licenseAlias) { + if (!Array.isArray(object.licenseAlias)) + throw TypeError(".google.cloud.compute.v1.LicenseCode.licenseAlias: array expected"); + message.licenseAlias = []; + for (var i = 0; i < object.licenseAlias.length; ++i) { + if (typeof object.licenseAlias[i] !== "object") + throw TypeError(".google.cloud.compute.v1.LicenseCode.licenseAlias: object expected"); + message.licenseAlias[i] = $root.google.cloud.compute.v1.LicenseCodeLicenseAlias.fromObject(object.licenseAlias[i]); + } + } + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "DISABLED": + case 516696700: + message.state = 516696700; + break; + case "ENABLED": + case 182130465: + message.state = 182130465; + break; + case "RESTRICTED": + case 261551195: + message.state = 261551195; + break; + case "STATE_UNSPECIFIED": + case 470755401: + message.state = 470755401; + break; + case "TERMINATED": + case 250018339: + message.state = 250018339; + break; + } + if (object.transferable != null) + message.transferable = Boolean(object.transferable); + return message; + }; + + /** + * Creates a plain object from a LicenseCode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LicenseCode + * @static + * @param {google.cloud.compute.v1.LicenseCode} message LicenseCode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LicenseCode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.licenseAlias = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.transferable != null && message.hasOwnProperty("transferable")) { + object.transferable = message.transferable; + if (options.oneofs) + object._transferable = "transferable"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.licenseAlias && message.licenseAlias.length) { + object.licenseAlias = []; + for (var j = 0; j < message.licenseAlias.length; ++j) + object.licenseAlias[j] = $root.google.cloud.compute.v1.LicenseCodeLicenseAlias.toObject(message.licenseAlias[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.LicenseCode.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this LicenseCode to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LicenseCode + * @instance + * @returns {Object.} JSON object + */ + LicenseCode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.compute.v1.LicenseCode.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} DISABLED=516696700 DISABLED value + * @property {number} ENABLED=182130465 ENABLED value + * @property {number} RESTRICTED=261551195 RESTRICTED value + * @property {number} STATE_UNSPECIFIED=470755401 STATE_UNSPECIFIED value + * @property {number} TERMINATED=250018339 TERMINATED value + */ + LicenseCode.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[516696700] = "DISABLED"] = 516696700; + values[valuesById[182130465] = "ENABLED"] = 182130465; + values[valuesById[261551195] = "RESTRICTED"] = 261551195; + values[valuesById[470755401] = "STATE_UNSPECIFIED"] = 470755401; + values[valuesById[250018339] = "TERMINATED"] = 250018339; + return values; + })(); + + return LicenseCode; + })(); + + v1.LicensesListResponse = (function() { + + /** + * Properties of a LicensesListResponse. + * @memberof google.cloud.compute.v1 + * @interface ILicensesListResponse + * @property {string|null} [id] LicensesListResponse id + * @property {Array.|null} [items] LicensesListResponse items + * @property {string|null} [nextPageToken] LicensesListResponse nextPageToken + * @property {string|null} [selfLink] LicensesListResponse selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] LicensesListResponse warning + */ + + /** + * Constructs a new LicensesListResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LicensesListResponse. + * @implements ILicensesListResponse + * @constructor + * @param {google.cloud.compute.v1.ILicensesListResponse=} [properties] Properties to set + */ + function LicensesListResponse(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LicensesListResponse id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + LicensesListResponse.prototype.id = null; + + /** + * LicensesListResponse items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + LicensesListResponse.prototype.items = $util.emptyArray; + + /** + * LicensesListResponse nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + LicensesListResponse.prototype.nextPageToken = null; + + /** + * LicensesListResponse selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + LicensesListResponse.prototype.selfLink = null; + + /** + * LicensesListResponse warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + LicensesListResponse.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LicensesListResponse _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + Object.defineProperty(LicensesListResponse.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicensesListResponse _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + Object.defineProperty(LicensesListResponse.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicensesListResponse _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + Object.defineProperty(LicensesListResponse.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LicensesListResponse _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + */ + Object.defineProperty(LicensesListResponse.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LicensesListResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {google.cloud.compute.v1.ILicensesListResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LicensesListResponse} LicensesListResponse instance + */ + LicensesListResponse.create = function create(properties) { + return new LicensesListResponse(properties); + }; + + /** + * Encodes the specified LicensesListResponse message. Does not implicitly {@link google.cloud.compute.v1.LicensesListResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {google.cloud.compute.v1.ILicensesListResponse} message LicensesListResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicensesListResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.License.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified LicensesListResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LicensesListResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {google.cloud.compute.v1.ILicensesListResponse} message LicensesListResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LicensesListResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LicensesListResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LicensesListResponse} LicensesListResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicensesListResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LicensesListResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.License.decode(reader, reader.uint32())); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LicensesListResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LicensesListResponse} LicensesListResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LicensesListResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LicensesListResponse message. + * @function verify + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LicensesListResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.License.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a LicensesListResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LicensesListResponse} LicensesListResponse + */ + LicensesListResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LicensesListResponse) + return object; + var message = new $root.google.cloud.compute.v1.LicensesListResponse(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.LicensesListResponse.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.LicensesListResponse.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.License.fromObject(object.items[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.LicensesListResponse.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a LicensesListResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LicensesListResponse + * @static + * @param {google.cloud.compute.v1.LicensesListResponse} message LicensesListResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LicensesListResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.License.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this LicensesListResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LicensesListResponse + * @instance + * @returns {Object.} JSON object + */ + LicensesListResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LicensesListResponse; + })(); + + v1.LocalDisk = (function() { + + /** + * Properties of a LocalDisk. + * @memberof google.cloud.compute.v1 + * @interface ILocalDisk + * @property {number|null} [diskCount] LocalDisk diskCount + * @property {number|null} [diskSizeGb] LocalDisk diskSizeGb + * @property {string|null} [diskType] LocalDisk diskType + */ + + /** + * Constructs a new LocalDisk. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LocalDisk. + * @implements ILocalDisk + * @constructor + * @param {google.cloud.compute.v1.ILocalDisk=} [properties] Properties to set + */ + function LocalDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocalDisk diskCount. + * @member {number|null|undefined} diskCount + * @memberof google.cloud.compute.v1.LocalDisk + * @instance + */ + LocalDisk.prototype.diskCount = null; + + /** + * LocalDisk diskSizeGb. + * @member {number|null|undefined} diskSizeGb + * @memberof google.cloud.compute.v1.LocalDisk + * @instance + */ + LocalDisk.prototype.diskSizeGb = null; + + /** + * LocalDisk diskType. + * @member {string|null|undefined} diskType + * @memberof google.cloud.compute.v1.LocalDisk + * @instance + */ + LocalDisk.prototype.diskType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LocalDisk _diskCount. + * @member {"diskCount"|undefined} _diskCount + * @memberof google.cloud.compute.v1.LocalDisk + * @instance + */ + Object.defineProperty(LocalDisk.prototype, "_diskCount", { + get: $util.oneOfGetter($oneOfFields = ["diskCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LocalDisk _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.compute.v1.LocalDisk + * @instance + */ + Object.defineProperty(LocalDisk.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LocalDisk _diskType. + * @member {"diskType"|undefined} _diskType + * @memberof google.cloud.compute.v1.LocalDisk + * @instance + */ + Object.defineProperty(LocalDisk.prototype, "_diskType", { + get: $util.oneOfGetter($oneOfFields = ["diskType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LocalDisk instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {google.cloud.compute.v1.ILocalDisk=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LocalDisk} LocalDisk instance + */ + LocalDisk.create = function create(properties) { + return new LocalDisk(properties); + }; + + /** + * Encodes the specified LocalDisk message. Does not implicitly {@link google.cloud.compute.v1.LocalDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {google.cloud.compute.v1.ILocalDisk} message LocalDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 93009052, wireType 2 =*/744072418).string(message.diskType); + if (message.diskCount != null && Object.hasOwnProperty.call(message, "diskCount")) + writer.uint32(/* id 182933485, wireType 0 =*/1463467880).int32(message.diskCount); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 316263735, wireType 0 =*/2530109880).int32(message.diskSizeGb); + return writer; + }; + + /** + * Encodes the specified LocalDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LocalDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {google.cloud.compute.v1.ILocalDisk} message LocalDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocalDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocalDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LocalDisk} LocalDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LocalDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 182933485: + message.diskCount = reader.int32(); + break; + case 316263735: + message.diskSizeGb = reader.int32(); + break; + case 93009052: + message.diskType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocalDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LocalDisk} LocalDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocalDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocalDisk message. + * @function verify + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocalDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskCount != null && message.hasOwnProperty("diskCount")) { + properties._diskCount = 1; + if (!$util.isInteger(message.diskCount)) + return "diskCount: integer expected"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + properties._diskType = 1; + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + } + return null; + }; + + /** + * Creates a LocalDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LocalDisk} LocalDisk + */ + LocalDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LocalDisk) + return object; + var message = new $root.google.cloud.compute.v1.LocalDisk(); + if (object.diskCount != null) + message.diskCount = object.diskCount | 0; + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.diskType != null) + message.diskType = String(object.diskType); + return message; + }; + + /** + * Creates a plain object from a LocalDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LocalDisk + * @static + * @param {google.cloud.compute.v1.LocalDisk} message LocalDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocalDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.diskType != null && message.hasOwnProperty("diskType")) { + object.diskType = message.diskType; + if (options.oneofs) + object._diskType = "diskType"; + } + if (message.diskCount != null && message.hasOwnProperty("diskCount")) { + object.diskCount = message.diskCount; + if (options.oneofs) + object._diskCount = "diskCount"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + object.diskSizeGb = message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + return object; + }; + + /** + * Converts this LocalDisk to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LocalDisk + * @instance + * @returns {Object.} JSON object + */ + LocalDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocalDisk; + })(); + + v1.LocationPolicyLocation = (function() { + + /** + * Properties of a LocationPolicyLocation. + * @memberof google.cloud.compute.v1 + * @interface ILocationPolicyLocation + * @property {google.cloud.compute.v1.LocationPolicyLocation.Preference|null} [preference] LocationPolicyLocation preference + */ + + /** + * Constructs a new LocationPolicyLocation. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LocationPolicyLocation. + * @implements ILocationPolicyLocation + * @constructor + * @param {google.cloud.compute.v1.ILocationPolicyLocation=} [properties] Properties to set + */ + function LocationPolicyLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LocationPolicyLocation preference. + * @member {google.cloud.compute.v1.LocationPolicyLocation.Preference|null|undefined} preference + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @instance + */ + LocationPolicyLocation.prototype.preference = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LocationPolicyLocation _preference. + * @member {"preference"|undefined} _preference + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @instance + */ + Object.defineProperty(LocationPolicyLocation.prototype, "_preference", { + get: $util.oneOfGetter($oneOfFields = ["preference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LocationPolicyLocation instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {google.cloud.compute.v1.ILocationPolicyLocation=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LocationPolicyLocation} LocationPolicyLocation instance + */ + LocationPolicyLocation.create = function create(properties) { + return new LocationPolicyLocation(properties); + }; + + /** + * Encodes the specified LocationPolicyLocation message. Does not implicitly {@link google.cloud.compute.v1.LocationPolicyLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {google.cloud.compute.v1.ILocationPolicyLocation} message LocationPolicyLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicyLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.preference != null && Object.hasOwnProperty.call(message, "preference")) + writer.uint32(/* id 150781147, wireType 0 =*/1206249176).int32(message.preference); + return writer; + }; + + /** + * Encodes the specified LocationPolicyLocation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LocationPolicyLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {google.cloud.compute.v1.ILocationPolicyLocation} message LocationPolicyLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationPolicyLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationPolicyLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LocationPolicyLocation} LocationPolicyLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicyLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LocationPolicyLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 150781147: + message.preference = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationPolicyLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LocationPolicyLocation} LocationPolicyLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationPolicyLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationPolicyLocation message. + * @function verify + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationPolicyLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.preference != null && message.hasOwnProperty("preference")) { + properties._preference = 1; + switch (message.preference) { + default: + return "preference: enum value expected"; + case 0: + case 62368553: + case 2094604: + case 496219571: + break; + } + } + return null; + }; + + /** + * Creates a LocationPolicyLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LocationPolicyLocation} LocationPolicyLocation + */ + LocationPolicyLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LocationPolicyLocation) + return object; + var message = new $root.google.cloud.compute.v1.LocationPolicyLocation(); + switch (object.preference) { + case "UNDEFINED_PREFERENCE": + case 0: + message.preference = 0; + break; + case "ALLOW": + case 62368553: + message.preference = 62368553; + break; + case "DENY": + case 2094604: + message.preference = 2094604; + break; + case "PREFERENCE_UNSPECIFIED": + case 496219571: + message.preference = 496219571; + break; + } + return message; + }; + + /** + * Creates a plain object from a LocationPolicyLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @static + * @param {google.cloud.compute.v1.LocationPolicyLocation} message LocationPolicyLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationPolicyLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.preference != null && message.hasOwnProperty("preference")) { + object.preference = options.enums === String ? $root.google.cloud.compute.v1.LocationPolicyLocation.Preference[message.preference] : message.preference; + if (options.oneofs) + object._preference = "preference"; + } + return object; + }; + + /** + * Converts this LocationPolicyLocation to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LocationPolicyLocation + * @instance + * @returns {Object.} JSON object + */ + LocationPolicyLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Preference enum. + * @name google.cloud.compute.v1.LocationPolicyLocation.Preference + * @enum {number} + * @property {number} UNDEFINED_PREFERENCE=0 UNDEFINED_PREFERENCE value + * @property {number} ALLOW=62368553 ALLOW value + * @property {number} DENY=2094604 DENY value + * @property {number} PREFERENCE_UNSPECIFIED=496219571 PREFERENCE_UNSPECIFIED value + */ + LocationPolicyLocation.Preference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PREFERENCE"] = 0; + values[valuesById[62368553] = "ALLOW"] = 62368553; + values[valuesById[2094604] = "DENY"] = 2094604; + values[valuesById[496219571] = "PREFERENCE_UNSPECIFIED"] = 496219571; + return values; + })(); + + return LocationPolicyLocation; + })(); + + v1.LogConfigCloudAuditOptions = (function() { + + /** + * Properties of a LogConfigCloudAuditOptions. + * @memberof google.cloud.compute.v1 + * @interface ILogConfigCloudAuditOptions + * @property {google.cloud.compute.v1.IAuthorizationLoggingOptions|null} [authorizationLoggingOptions] LogConfigCloudAuditOptions authorizationLoggingOptions + * @property {google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName|null} [logName] LogConfigCloudAuditOptions logName + */ + + /** + * Constructs a new LogConfigCloudAuditOptions. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LogConfigCloudAuditOptions. + * @implements ILogConfigCloudAuditOptions + * @constructor + * @param {google.cloud.compute.v1.ILogConfigCloudAuditOptions=} [properties] Properties to set + */ + function LogConfigCloudAuditOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogConfigCloudAuditOptions authorizationLoggingOptions. + * @member {google.cloud.compute.v1.IAuthorizationLoggingOptions|null|undefined} authorizationLoggingOptions + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @instance + */ + LogConfigCloudAuditOptions.prototype.authorizationLoggingOptions = null; + + /** + * LogConfigCloudAuditOptions logName. + * @member {google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName|null|undefined} logName + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @instance + */ + LogConfigCloudAuditOptions.prototype.logName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogConfigCloudAuditOptions _authorizationLoggingOptions. + * @member {"authorizationLoggingOptions"|undefined} _authorizationLoggingOptions + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @instance + */ + Object.defineProperty(LogConfigCloudAuditOptions.prototype, "_authorizationLoggingOptions", { + get: $util.oneOfGetter($oneOfFields = ["authorizationLoggingOptions"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LogConfigCloudAuditOptions _logName. + * @member {"logName"|undefined} _logName + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @instance + */ + Object.defineProperty(LogConfigCloudAuditOptions.prototype, "_logName", { + get: $util.oneOfGetter($oneOfFields = ["logName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogConfigCloudAuditOptions instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigCloudAuditOptions=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LogConfigCloudAuditOptions} LogConfigCloudAuditOptions instance + */ + LogConfigCloudAuditOptions.create = function create(properties) { + return new LogConfigCloudAuditOptions(properties); + }; + + /** + * Encodes the specified LogConfigCloudAuditOptions message. Does not implicitly {@link google.cloud.compute.v1.LogConfigCloudAuditOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigCloudAuditOptions} message LogConfigCloudAuditOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigCloudAuditOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.authorizationLoggingOptions != null && Object.hasOwnProperty.call(message, "authorizationLoggingOptions")) + $root.google.cloud.compute.v1.AuthorizationLoggingOptions.encode(message.authorizationLoggingOptions, writer.uint32(/* id 217861624, wireType 2 =*/1742892994).fork()).ldelim(); + if (message.logName != null && Object.hasOwnProperty.call(message, "logName")) + writer.uint32(/* id 402913958, wireType 0 =*/3223311664).int32(message.logName); + return writer; + }; + + /** + * Encodes the specified LogConfigCloudAuditOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigCloudAuditOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigCloudAuditOptions} message LogConfigCloudAuditOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigCloudAuditOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogConfigCloudAuditOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LogConfigCloudAuditOptions} LogConfigCloudAuditOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigCloudAuditOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LogConfigCloudAuditOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 217861624: + message.authorizationLoggingOptions = $root.google.cloud.compute.v1.AuthorizationLoggingOptions.decode(reader, reader.uint32()); + break; + case 402913958: + message.logName = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogConfigCloudAuditOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LogConfigCloudAuditOptions} LogConfigCloudAuditOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigCloudAuditOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogConfigCloudAuditOptions message. + * @function verify + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogConfigCloudAuditOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.authorizationLoggingOptions != null && message.hasOwnProperty("authorizationLoggingOptions")) { + properties._authorizationLoggingOptions = 1; + { + var error = $root.google.cloud.compute.v1.AuthorizationLoggingOptions.verify(message.authorizationLoggingOptions); + if (error) + return "authorizationLoggingOptions." + error; + } + } + if (message.logName != null && message.hasOwnProperty("logName")) { + properties._logName = 1; + switch (message.logName) { + default: + return "logName: enum value expected"; + case 0: + case 427503135: + case 238070681: + case 410515182: + break; + } + } + return null; + }; + + /** + * Creates a LogConfigCloudAuditOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LogConfigCloudAuditOptions} LogConfigCloudAuditOptions + */ + LogConfigCloudAuditOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LogConfigCloudAuditOptions) + return object; + var message = new $root.google.cloud.compute.v1.LogConfigCloudAuditOptions(); + if (object.authorizationLoggingOptions != null) { + if (typeof object.authorizationLoggingOptions !== "object") + throw TypeError(".google.cloud.compute.v1.LogConfigCloudAuditOptions.authorizationLoggingOptions: object expected"); + message.authorizationLoggingOptions = $root.google.cloud.compute.v1.AuthorizationLoggingOptions.fromObject(object.authorizationLoggingOptions); + } + switch (object.logName) { + case "UNDEFINED_LOG_NAME": + case 0: + message.logName = 0; + break; + case "ADMIN_ACTIVITY": + case 427503135: + message.logName = 427503135; + break; + case "DATA_ACCESS": + case 238070681: + message.logName = 238070681; + break; + case "UNSPECIFIED_LOG_NAME": + case 410515182: + message.logName = 410515182; + break; + } + return message; + }; + + /** + * Creates a plain object from a LogConfigCloudAuditOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @static + * @param {google.cloud.compute.v1.LogConfigCloudAuditOptions} message LogConfigCloudAuditOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogConfigCloudAuditOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.authorizationLoggingOptions != null && message.hasOwnProperty("authorizationLoggingOptions")) { + object.authorizationLoggingOptions = $root.google.cloud.compute.v1.AuthorizationLoggingOptions.toObject(message.authorizationLoggingOptions, options); + if (options.oneofs) + object._authorizationLoggingOptions = "authorizationLoggingOptions"; + } + if (message.logName != null && message.hasOwnProperty("logName")) { + object.logName = options.enums === String ? $root.google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName[message.logName] : message.logName; + if (options.oneofs) + object._logName = "logName"; + } + return object; + }; + + /** + * Converts this LogConfigCloudAuditOptions to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LogConfigCloudAuditOptions + * @instance + * @returns {Object.} JSON object + */ + LogConfigCloudAuditOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * LogName enum. + * @name google.cloud.compute.v1.LogConfigCloudAuditOptions.LogName + * @enum {number} + * @property {number} UNDEFINED_LOG_NAME=0 UNDEFINED_LOG_NAME value + * @property {number} ADMIN_ACTIVITY=427503135 ADMIN_ACTIVITY value + * @property {number} DATA_ACCESS=238070681 DATA_ACCESS value + * @property {number} UNSPECIFIED_LOG_NAME=410515182 UNSPECIFIED_LOG_NAME value + */ + LogConfigCloudAuditOptions.LogName = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LOG_NAME"] = 0; + values[valuesById[427503135] = "ADMIN_ACTIVITY"] = 427503135; + values[valuesById[238070681] = "DATA_ACCESS"] = 238070681; + values[valuesById[410515182] = "UNSPECIFIED_LOG_NAME"] = 410515182; + return values; + })(); + + return LogConfigCloudAuditOptions; + })(); + + v1.LogConfigCounterOptions = (function() { + + /** + * Properties of a LogConfigCounterOptions. + * @memberof google.cloud.compute.v1 + * @interface ILogConfigCounterOptions + * @property {Array.|null} [customFields] LogConfigCounterOptions customFields + * @property {string|null} [field] LogConfigCounterOptions field + * @property {string|null} [metric] LogConfigCounterOptions metric + */ + + /** + * Constructs a new LogConfigCounterOptions. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LogConfigCounterOptions. + * @implements ILogConfigCounterOptions + * @constructor + * @param {google.cloud.compute.v1.ILogConfigCounterOptions=} [properties] Properties to set + */ + function LogConfigCounterOptions(properties) { + this.customFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogConfigCounterOptions customFields. + * @member {Array.} customFields + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @instance + */ + LogConfigCounterOptions.prototype.customFields = $util.emptyArray; + + /** + * LogConfigCounterOptions field. + * @member {string|null|undefined} field + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @instance + */ + LogConfigCounterOptions.prototype.field = null; + + /** + * LogConfigCounterOptions metric. + * @member {string|null|undefined} metric + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @instance + */ + LogConfigCounterOptions.prototype.metric = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogConfigCounterOptions _field. + * @member {"field"|undefined} _field + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @instance + */ + Object.defineProperty(LogConfigCounterOptions.prototype, "_field", { + get: $util.oneOfGetter($oneOfFields = ["field"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LogConfigCounterOptions _metric. + * @member {"metric"|undefined} _metric + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @instance + */ + Object.defineProperty(LogConfigCounterOptions.prototype, "_metric", { + get: $util.oneOfGetter($oneOfFields = ["metric"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogConfigCounterOptions instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigCounterOptions=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LogConfigCounterOptions} LogConfigCounterOptions instance + */ + LogConfigCounterOptions.create = function create(properties) { + return new LogConfigCounterOptions(properties); + }; + + /** + * Encodes the specified LogConfigCounterOptions message. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigCounterOptions} message LogConfigCounterOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigCounterOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 97427706, wireType 2 =*/779421650).string(message.field); + if (message.customFields != null && message.customFields.length) + for (var i = 0; i < message.customFields.length; ++i) + $root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField.encode(message.customFields[i], writer.uint32(/* id 249651015, wireType 2 =*/1997208122).fork()).ldelim(); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + writer.uint32(/* id 533067184, wireType 2 =*/4264537474).string(message.metric); + return writer; + }; + + /** + * Encodes the specified LogConfigCounterOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigCounterOptions} message LogConfigCounterOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigCounterOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogConfigCounterOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LogConfigCounterOptions} LogConfigCounterOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigCounterOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LogConfigCounterOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249651015: + if (!(message.customFields && message.customFields.length)) + message.customFields = []; + message.customFields.push($root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField.decode(reader, reader.uint32())); + break; + case 97427706: + message.field = reader.string(); + break; + case 533067184: + message.metric = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogConfigCounterOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LogConfigCounterOptions} LogConfigCounterOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigCounterOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogConfigCounterOptions message. + * @function verify + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogConfigCounterOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.customFields != null && message.hasOwnProperty("customFields")) { + if (!Array.isArray(message.customFields)) + return "customFields: array expected"; + for (var i = 0; i < message.customFields.length; ++i) { + var error = $root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField.verify(message.customFields[i]); + if (error) + return "customFields." + error; + } + } + if (message.field != null && message.hasOwnProperty("field")) { + properties._field = 1; + if (!$util.isString(message.field)) + return "field: string expected"; + } + if (message.metric != null && message.hasOwnProperty("metric")) { + properties._metric = 1; + if (!$util.isString(message.metric)) + return "metric: string expected"; + } + return null; + }; + + /** + * Creates a LogConfigCounterOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LogConfigCounterOptions} LogConfigCounterOptions + */ + LogConfigCounterOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LogConfigCounterOptions) + return object; + var message = new $root.google.cloud.compute.v1.LogConfigCounterOptions(); + if (object.customFields) { + if (!Array.isArray(object.customFields)) + throw TypeError(".google.cloud.compute.v1.LogConfigCounterOptions.customFields: array expected"); + message.customFields = []; + for (var i = 0; i < object.customFields.length; ++i) { + if (typeof object.customFields[i] !== "object") + throw TypeError(".google.cloud.compute.v1.LogConfigCounterOptions.customFields: object expected"); + message.customFields[i] = $root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField.fromObject(object.customFields[i]); + } + } + if (object.field != null) + message.field = String(object.field); + if (object.metric != null) + message.metric = String(object.metric); + return message; + }; + + /** + * Creates a plain object from a LogConfigCounterOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @static + * @param {google.cloud.compute.v1.LogConfigCounterOptions} message LogConfigCounterOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogConfigCounterOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customFields = []; + if (message.field != null && message.hasOwnProperty("field")) { + object.field = message.field; + if (options.oneofs) + object._field = "field"; + } + if (message.customFields && message.customFields.length) { + object.customFields = []; + for (var j = 0; j < message.customFields.length; ++j) + object.customFields[j] = $root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField.toObject(message.customFields[j], options); + } + if (message.metric != null && message.hasOwnProperty("metric")) { + object.metric = message.metric; + if (options.oneofs) + object._metric = "metric"; + } + return object; + }; + + /** + * Converts this LogConfigCounterOptions to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LogConfigCounterOptions + * @instance + * @returns {Object.} JSON object + */ + LogConfigCounterOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LogConfigCounterOptions; + })(); + + v1.LogConfigDataAccessOptions = (function() { + + /** + * Properties of a LogConfigDataAccessOptions. + * @memberof google.cloud.compute.v1 + * @interface ILogConfigDataAccessOptions + * @property {google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode|null} [logMode] LogConfigDataAccessOptions logMode + */ + + /** + * Constructs a new LogConfigDataAccessOptions. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LogConfigDataAccessOptions. + * @implements ILogConfigDataAccessOptions + * @constructor + * @param {google.cloud.compute.v1.ILogConfigDataAccessOptions=} [properties] Properties to set + */ + function LogConfigDataAccessOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogConfigDataAccessOptions logMode. + * @member {google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode|null|undefined} logMode + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @instance + */ + LogConfigDataAccessOptions.prototype.logMode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogConfigDataAccessOptions _logMode. + * @member {"logMode"|undefined} _logMode + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @instance + */ + Object.defineProperty(LogConfigDataAccessOptions.prototype, "_logMode", { + get: $util.oneOfGetter($oneOfFields = ["logMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogConfigDataAccessOptions instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigDataAccessOptions=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LogConfigDataAccessOptions} LogConfigDataAccessOptions instance + */ + LogConfigDataAccessOptions.create = function create(properties) { + return new LogConfigDataAccessOptions(properties); + }; + + /** + * Encodes the specified LogConfigDataAccessOptions message. Does not implicitly {@link google.cloud.compute.v1.LogConfigDataAccessOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigDataAccessOptions} message LogConfigDataAccessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigDataAccessOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logMode != null && Object.hasOwnProperty.call(message, "logMode")) + writer.uint32(/* id 402897342, wireType 0 =*/3223178736).int32(message.logMode); + return writer; + }; + + /** + * Encodes the specified LogConfigDataAccessOptions message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigDataAccessOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {google.cloud.compute.v1.ILogConfigDataAccessOptions} message LogConfigDataAccessOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigDataAccessOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogConfigDataAccessOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LogConfigDataAccessOptions} LogConfigDataAccessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigDataAccessOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LogConfigDataAccessOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 402897342: + message.logMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogConfigDataAccessOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LogConfigDataAccessOptions} LogConfigDataAccessOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigDataAccessOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogConfigDataAccessOptions message. + * @function verify + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogConfigDataAccessOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.logMode != null && message.hasOwnProperty("logMode")) { + properties._logMode = 1; + switch (message.logMode) { + default: + return "logMode: enum value expected"; + case 0: + case 360469778: + case 88160822: + break; + } + } + return null; + }; + + /** + * Creates a LogConfigDataAccessOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LogConfigDataAccessOptions} LogConfigDataAccessOptions + */ + LogConfigDataAccessOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LogConfigDataAccessOptions) + return object; + var message = new $root.google.cloud.compute.v1.LogConfigDataAccessOptions(); + switch (object.logMode) { + case "UNDEFINED_LOG_MODE": + case 0: + message.logMode = 0; + break; + case "LOG_FAIL_CLOSED": + case 360469778: + message.logMode = 360469778; + break; + case "LOG_MODE_UNSPECIFIED": + case 88160822: + message.logMode = 88160822; + break; + } + return message; + }; + + /** + * Creates a plain object from a LogConfigDataAccessOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @static + * @param {google.cloud.compute.v1.LogConfigDataAccessOptions} message LogConfigDataAccessOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogConfigDataAccessOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.logMode != null && message.hasOwnProperty("logMode")) { + object.logMode = options.enums === String ? $root.google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode[message.logMode] : message.logMode; + if (options.oneofs) + object._logMode = "logMode"; + } + return object; + }; + + /** + * Converts this LogConfigDataAccessOptions to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LogConfigDataAccessOptions + * @instance + * @returns {Object.} JSON object + */ + LogConfigDataAccessOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * LogMode enum. + * @name google.cloud.compute.v1.LogConfigDataAccessOptions.LogMode + * @enum {number} + * @property {number} UNDEFINED_LOG_MODE=0 UNDEFINED_LOG_MODE value + * @property {number} LOG_FAIL_CLOSED=360469778 LOG_FAIL_CLOSED value + * @property {number} LOG_MODE_UNSPECIFIED=88160822 LOG_MODE_UNSPECIFIED value + */ + LogConfigDataAccessOptions.LogMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_LOG_MODE"] = 0; + values[valuesById[360469778] = "LOG_FAIL_CLOSED"] = 360469778; + values[valuesById[88160822] = "LOG_MODE_UNSPECIFIED"] = 88160822; + return values; + })(); + + return LogConfigDataAccessOptions; + })(); + + v1.LogConfig = (function() { + + /** + * Properties of a LogConfig. + * @memberof google.cloud.compute.v1 + * @interface ILogConfig + * @property {google.cloud.compute.v1.ILogConfigCloudAuditOptions|null} [cloudAudit] LogConfig cloudAudit + * @property {google.cloud.compute.v1.ILogConfigCounterOptions|null} [counter] LogConfig counter + * @property {google.cloud.compute.v1.ILogConfigDataAccessOptions|null} [dataAccess] LogConfig dataAccess + */ + + /** + * Constructs a new LogConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LogConfig. + * @implements ILogConfig + * @constructor + * @param {google.cloud.compute.v1.ILogConfig=} [properties] Properties to set + */ + function LogConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogConfig cloudAudit. + * @member {google.cloud.compute.v1.ILogConfigCloudAuditOptions|null|undefined} cloudAudit + * @memberof google.cloud.compute.v1.LogConfig + * @instance + */ + LogConfig.prototype.cloudAudit = null; + + /** + * LogConfig counter. + * @member {google.cloud.compute.v1.ILogConfigCounterOptions|null|undefined} counter + * @memberof google.cloud.compute.v1.LogConfig + * @instance + */ + LogConfig.prototype.counter = null; + + /** + * LogConfig dataAccess. + * @member {google.cloud.compute.v1.ILogConfigDataAccessOptions|null|undefined} dataAccess + * @memberof google.cloud.compute.v1.LogConfig + * @instance + */ + LogConfig.prototype.dataAccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogConfig _cloudAudit. + * @member {"cloudAudit"|undefined} _cloudAudit + * @memberof google.cloud.compute.v1.LogConfig + * @instance + */ + Object.defineProperty(LogConfig.prototype, "_cloudAudit", { + get: $util.oneOfGetter($oneOfFields = ["cloudAudit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LogConfig _counter. + * @member {"counter"|undefined} _counter + * @memberof google.cloud.compute.v1.LogConfig + * @instance + */ + Object.defineProperty(LogConfig.prototype, "_counter", { + get: $util.oneOfGetter($oneOfFields = ["counter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LogConfig _dataAccess. + * @member {"dataAccess"|undefined} _dataAccess + * @memberof google.cloud.compute.v1.LogConfig + * @instance + */ + Object.defineProperty(LogConfig.prototype, "_dataAccess", { + get: $util.oneOfGetter($oneOfFields = ["dataAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {google.cloud.compute.v1.ILogConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LogConfig} LogConfig instance + */ + LogConfig.create = function create(properties) { + return new LogConfig(properties); + }; + + /** + * Encodes the specified LogConfig message. Does not implicitly {@link google.cloud.compute.v1.LogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {google.cloud.compute.v1.ILogConfig} message LogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataAccess != null && Object.hasOwnProperty.call(message, "dataAccess")) + $root.google.cloud.compute.v1.LogConfigDataAccessOptions.encode(message.dataAccess, writer.uint32(/* id 286633881, wireType 2 =*/2293071050).fork()).ldelim(); + if (message.cloudAudit != null && Object.hasOwnProperty.call(message, "cloudAudit")) + $root.google.cloud.compute.v1.LogConfigCloudAuditOptions.encode(message.cloudAudit, writer.uint32(/* id 412852561, wireType 2 =*/3302820490).fork()).ldelim(); + if (message.counter != null && Object.hasOwnProperty.call(message, "counter")) + $root.google.cloud.compute.v1.LogConfigCounterOptions.encode(message.counter, writer.uint32(/* id 420959740, wireType 2 =*/3367677922).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {google.cloud.compute.v1.ILogConfig} message LogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LogConfig} LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 412852561: + message.cloudAudit = $root.google.cloud.compute.v1.LogConfigCloudAuditOptions.decode(reader, reader.uint32()); + break; + case 420959740: + message.counter = $root.google.cloud.compute.v1.LogConfigCounterOptions.decode(reader, reader.uint32()); + break; + case 286633881: + message.dataAccess = $root.google.cloud.compute.v1.LogConfigDataAccessOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LogConfig} LogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogConfig message. + * @function verify + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cloudAudit != null && message.hasOwnProperty("cloudAudit")) { + properties._cloudAudit = 1; + { + var error = $root.google.cloud.compute.v1.LogConfigCloudAuditOptions.verify(message.cloudAudit); + if (error) + return "cloudAudit." + error; + } + } + if (message.counter != null && message.hasOwnProperty("counter")) { + properties._counter = 1; + { + var error = $root.google.cloud.compute.v1.LogConfigCounterOptions.verify(message.counter); + if (error) + return "counter." + error; + } + } + if (message.dataAccess != null && message.hasOwnProperty("dataAccess")) { + properties._dataAccess = 1; + { + var error = $root.google.cloud.compute.v1.LogConfigDataAccessOptions.verify(message.dataAccess); + if (error) + return "dataAccess." + error; + } + } + return null; + }; + + /** + * Creates a LogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LogConfig} LogConfig + */ + LogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LogConfig) + return object; + var message = new $root.google.cloud.compute.v1.LogConfig(); + if (object.cloudAudit != null) { + if (typeof object.cloudAudit !== "object") + throw TypeError(".google.cloud.compute.v1.LogConfig.cloudAudit: object expected"); + message.cloudAudit = $root.google.cloud.compute.v1.LogConfigCloudAuditOptions.fromObject(object.cloudAudit); + } + if (object.counter != null) { + if (typeof object.counter !== "object") + throw TypeError(".google.cloud.compute.v1.LogConfig.counter: object expected"); + message.counter = $root.google.cloud.compute.v1.LogConfigCounterOptions.fromObject(object.counter); + } + if (object.dataAccess != null) { + if (typeof object.dataAccess !== "object") + throw TypeError(".google.cloud.compute.v1.LogConfig.dataAccess: object expected"); + message.dataAccess = $root.google.cloud.compute.v1.LogConfigDataAccessOptions.fromObject(object.dataAccess); + } + return message; + }; + + /** + * Creates a plain object from a LogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LogConfig + * @static + * @param {google.cloud.compute.v1.LogConfig} message LogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.dataAccess != null && message.hasOwnProperty("dataAccess")) { + object.dataAccess = $root.google.cloud.compute.v1.LogConfigDataAccessOptions.toObject(message.dataAccess, options); + if (options.oneofs) + object._dataAccess = "dataAccess"; + } + if (message.cloudAudit != null && message.hasOwnProperty("cloudAudit")) { + object.cloudAudit = $root.google.cloud.compute.v1.LogConfigCloudAuditOptions.toObject(message.cloudAudit, options); + if (options.oneofs) + object._cloudAudit = "cloudAudit"; + } + if (message.counter != null && message.hasOwnProperty("counter")) { + object.counter = $root.google.cloud.compute.v1.LogConfigCounterOptions.toObject(message.counter, options); + if (options.oneofs) + object._counter = "counter"; + } + return object; + }; + + /** + * Converts this LogConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LogConfig + * @instance + * @returns {Object.} JSON object + */ + LogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LogConfig; + })(); + + v1.LogConfigCounterOptionsCustomField = (function() { + + /** + * Properties of a LogConfigCounterOptionsCustomField. + * @memberof google.cloud.compute.v1 + * @interface ILogConfigCounterOptionsCustomField + * @property {string|null} [name] LogConfigCounterOptionsCustomField name + * @property {string|null} [value] LogConfigCounterOptionsCustomField value + */ + + /** + * Constructs a new LogConfigCounterOptionsCustomField. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LogConfigCounterOptionsCustomField. + * @implements ILogConfigCounterOptionsCustomField + * @constructor + * @param {google.cloud.compute.v1.ILogConfigCounterOptionsCustomField=} [properties] Properties to set + */ + function LogConfigCounterOptionsCustomField(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogConfigCounterOptionsCustomField name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @instance + */ + LogConfigCounterOptionsCustomField.prototype.name = null; + + /** + * LogConfigCounterOptionsCustomField value. + * @member {string|null|undefined} value + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @instance + */ + LogConfigCounterOptionsCustomField.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LogConfigCounterOptionsCustomField _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @instance + */ + Object.defineProperty(LogConfigCounterOptionsCustomField.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LogConfigCounterOptionsCustomField _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @instance + */ + Object.defineProperty(LogConfigCounterOptionsCustomField.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LogConfigCounterOptionsCustomField instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {google.cloud.compute.v1.ILogConfigCounterOptionsCustomField=} [properties] Properties to set + * @returns {google.cloud.compute.v1.LogConfigCounterOptionsCustomField} LogConfigCounterOptionsCustomField instance + */ + LogConfigCounterOptionsCustomField.create = function create(properties) { + return new LogConfigCounterOptionsCustomField(properties); + }; + + /** + * Encodes the specified LogConfigCounterOptionsCustomField message. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptionsCustomField.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {google.cloud.compute.v1.ILogConfigCounterOptionsCustomField} message LogConfigCounterOptionsCustomField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigCounterOptionsCustomField.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 111972721, wireType 2 =*/895781770).string(message.value); + return writer; + }; + + /** + * Encodes the specified LogConfigCounterOptionsCustomField message, length delimited. Does not implicitly {@link google.cloud.compute.v1.LogConfigCounterOptionsCustomField.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {google.cloud.compute.v1.ILogConfigCounterOptionsCustomField} message LogConfigCounterOptionsCustomField message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogConfigCounterOptionsCustomField.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogConfigCounterOptionsCustomField message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.LogConfigCounterOptionsCustomField} LogConfigCounterOptionsCustomField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigCounterOptionsCustomField.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + case 111972721: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogConfigCounterOptionsCustomField message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.LogConfigCounterOptionsCustomField} LogConfigCounterOptionsCustomField + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogConfigCounterOptionsCustomField.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogConfigCounterOptionsCustomField message. + * @function verify + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogConfigCounterOptionsCustomField.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a LogConfigCounterOptionsCustomField message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.LogConfigCounterOptionsCustomField} LogConfigCounterOptionsCustomField + */ + LogConfigCounterOptionsCustomField.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField) + return object; + var message = new $root.google.cloud.compute.v1.LogConfigCounterOptionsCustomField(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a LogConfigCounterOptionsCustomField message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @static + * @param {google.cloud.compute.v1.LogConfigCounterOptionsCustomField} message LogConfigCounterOptionsCustomField + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogConfigCounterOptionsCustomField.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this LogConfigCounterOptionsCustomField to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.LogConfigCounterOptionsCustomField + * @instance + * @returns {Object.} JSON object + */ + LogConfigCounterOptionsCustomField.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LogConfigCounterOptionsCustomField; + })(); + + v1.Accelerators = (function() { + + /** + * Properties of an Accelerators. + * @memberof google.cloud.compute.v1 + * @interface IAccelerators + * @property {number|null} [guestAcceleratorCount] Accelerators guestAcceleratorCount + * @property {string|null} [guestAcceleratorType] Accelerators guestAcceleratorType + */ + + /** + * Constructs a new Accelerators. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Accelerators. + * @implements IAccelerators + * @constructor + * @param {google.cloud.compute.v1.IAccelerators=} [properties] Properties to set + */ + function Accelerators(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Accelerators guestAcceleratorCount. + * @member {number|null|undefined} guestAcceleratorCount + * @memberof google.cloud.compute.v1.Accelerators + * @instance + */ + Accelerators.prototype.guestAcceleratorCount = null; + + /** + * Accelerators guestAcceleratorType. + * @member {string|null|undefined} guestAcceleratorType + * @memberof google.cloud.compute.v1.Accelerators + * @instance + */ + Accelerators.prototype.guestAcceleratorType = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Accelerators _guestAcceleratorCount. + * @member {"guestAcceleratorCount"|undefined} _guestAcceleratorCount + * @memberof google.cloud.compute.v1.Accelerators + * @instance + */ + Object.defineProperty(Accelerators.prototype, "_guestAcceleratorCount", { + get: $util.oneOfGetter($oneOfFields = ["guestAcceleratorCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Accelerators _guestAcceleratorType. + * @member {"guestAcceleratorType"|undefined} _guestAcceleratorType + * @memberof google.cloud.compute.v1.Accelerators + * @instance + */ + Object.defineProperty(Accelerators.prototype, "_guestAcceleratorType", { + get: $util.oneOfGetter($oneOfFields = ["guestAcceleratorType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Accelerators instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {google.cloud.compute.v1.IAccelerators=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Accelerators} Accelerators instance + */ + Accelerators.create = function create(properties) { + return new Accelerators(properties); + }; + + /** + * Encodes the specified Accelerators message. Does not implicitly {@link google.cloud.compute.v1.Accelerators.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {google.cloud.compute.v1.IAccelerators} message Accelerators message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerators.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.guestAcceleratorType != null && Object.hasOwnProperty.call(message, "guestAcceleratorType")) + writer.uint32(/* id 293064725, wireType 2 =*/2344517802).string(message.guestAcceleratorType); + if (message.guestAcceleratorCount != null && Object.hasOwnProperty.call(message, "guestAcceleratorCount")) + writer.uint32(/* id 479079316, wireType 0 =*/3832634528).int32(message.guestAcceleratorCount); + return writer; + }; + + /** + * Encodes the specified Accelerators message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Accelerators.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {google.cloud.compute.v1.IAccelerators} message Accelerators message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerators.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accelerators message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Accelerators} Accelerators + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerators.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Accelerators(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 479079316: + message.guestAcceleratorCount = reader.int32(); + break; + case 293064725: + message.guestAcceleratorType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accelerators message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Accelerators} Accelerators + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerators.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accelerators message. + * @function verify + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accelerators.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.guestAcceleratorCount != null && message.hasOwnProperty("guestAcceleratorCount")) { + properties._guestAcceleratorCount = 1; + if (!$util.isInteger(message.guestAcceleratorCount)) + return "guestAcceleratorCount: integer expected"; + } + if (message.guestAcceleratorType != null && message.hasOwnProperty("guestAcceleratorType")) { + properties._guestAcceleratorType = 1; + if (!$util.isString(message.guestAcceleratorType)) + return "guestAcceleratorType: string expected"; + } + return null; + }; + + /** + * Creates an Accelerators message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Accelerators} Accelerators + */ + Accelerators.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Accelerators) + return object; + var message = new $root.google.cloud.compute.v1.Accelerators(); + if (object.guestAcceleratorCount != null) + message.guestAcceleratorCount = object.guestAcceleratorCount | 0; + if (object.guestAcceleratorType != null) + message.guestAcceleratorType = String(object.guestAcceleratorType); + return message; + }; + + /** + * Creates a plain object from an Accelerators message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Accelerators + * @static + * @param {google.cloud.compute.v1.Accelerators} message Accelerators + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accelerators.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.guestAcceleratorType != null && message.hasOwnProperty("guestAcceleratorType")) { + object.guestAcceleratorType = message.guestAcceleratorType; + if (options.oneofs) + object._guestAcceleratorType = "guestAcceleratorType"; + } + if (message.guestAcceleratorCount != null && message.hasOwnProperty("guestAcceleratorCount")) { + object.guestAcceleratorCount = message.guestAcceleratorCount; + if (options.oneofs) + object._guestAcceleratorCount = "guestAcceleratorCount"; + } + return object; + }; + + /** + * Converts this Accelerators to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Accelerators + * @instance + * @returns {Object.} JSON object + */ + Accelerators.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Accelerators; + })(); + + v1.ScratchDisks = (function() { + + /** + * Properties of a ScratchDisks. + * @memberof google.cloud.compute.v1 + * @interface IScratchDisks + * @property {number|null} [diskGb] ScratchDisks diskGb + */ + + /** + * Constructs a new ScratchDisks. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ScratchDisks. + * @implements IScratchDisks + * @constructor + * @param {google.cloud.compute.v1.IScratchDisks=} [properties] Properties to set + */ + function ScratchDisks(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScratchDisks diskGb. + * @member {number|null|undefined} diskGb + * @memberof google.cloud.compute.v1.ScratchDisks + * @instance + */ + ScratchDisks.prototype.diskGb = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ScratchDisks _diskGb. + * @member {"diskGb"|undefined} _diskGb + * @memberof google.cloud.compute.v1.ScratchDisks + * @instance + */ + Object.defineProperty(ScratchDisks.prototype, "_diskGb", { + get: $util.oneOfGetter($oneOfFields = ["diskGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ScratchDisks instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {google.cloud.compute.v1.IScratchDisks=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ScratchDisks} ScratchDisks instance + */ + ScratchDisks.create = function create(properties) { + return new ScratchDisks(properties); + }; + + /** + * Encodes the specified ScratchDisks message. Does not implicitly {@link google.cloud.compute.v1.ScratchDisks.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {google.cloud.compute.v1.IScratchDisks} message ScratchDisks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScratchDisks.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskGb != null && Object.hasOwnProperty.call(message, "diskGb")) + writer.uint32(/* id 60990141, wireType 0 =*/487921128).int32(message.diskGb); + return writer; + }; + + /** + * Encodes the specified ScratchDisks message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ScratchDisks.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {google.cloud.compute.v1.IScratchDisks} message ScratchDisks message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScratchDisks.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScratchDisks message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ScratchDisks} ScratchDisks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScratchDisks.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ScratchDisks(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 60990141: + message.diskGb = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScratchDisks message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ScratchDisks} ScratchDisks + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScratchDisks.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScratchDisks message. + * @function verify + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScratchDisks.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskGb != null && message.hasOwnProperty("diskGb")) { + properties._diskGb = 1; + if (!$util.isInteger(message.diskGb)) + return "diskGb: integer expected"; + } + return null; + }; + + /** + * Creates a ScratchDisks message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ScratchDisks} ScratchDisks + */ + ScratchDisks.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ScratchDisks) + return object; + var message = new $root.google.cloud.compute.v1.ScratchDisks(); + if (object.diskGb != null) + message.diskGb = object.diskGb | 0; + return message; + }; + + /** + * Creates a plain object from a ScratchDisks message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ScratchDisks + * @static + * @param {google.cloud.compute.v1.ScratchDisks} message ScratchDisks + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScratchDisks.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.diskGb != null && message.hasOwnProperty("diskGb")) { + object.diskGb = message.diskGb; + if (options.oneofs) + object._diskGb = "diskGb"; + } + return object; + }; + + /** + * Converts this ScratchDisks to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ScratchDisks + * @instance + * @returns {Object.} JSON object + */ + ScratchDisks.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ScratchDisks; + })(); + + v1.MachineType = (function() { + + /** + * Properties of a MachineType. + * @memberof google.cloud.compute.v1 + * @interface IMachineType + * @property {Array.|null} [accelerators] MachineType accelerators + * @property {string|null} [creationTimestamp] MachineType creationTimestamp + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecated] MachineType deprecated + * @property {string|null} [description] MachineType description + * @property {number|null} [guestCpus] MachineType guestCpus + * @property {number|Long|null} [id] MachineType id + * @property {number|null} [imageSpaceGb] MachineType imageSpaceGb + * @property {boolean|null} [isSharedCpu] MachineType isSharedCpu + * @property {string|null} [kind] MachineType kind + * @property {number|null} [maximumPersistentDisks] MachineType maximumPersistentDisks + * @property {number|Long|null} [maximumPersistentDisksSizeGb] MachineType maximumPersistentDisksSizeGb + * @property {number|null} [memoryMb] MachineType memoryMb + * @property {string|null} [name] MachineType name + * @property {Array.|null} [scratchDisks] MachineType scratchDisks + * @property {string|null} [selfLink] MachineType selfLink + * @property {string|null} [zone] MachineType zone + */ + + /** + * Constructs a new MachineType. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MachineType. + * @implements IMachineType + * @constructor + * @param {google.cloud.compute.v1.IMachineType=} [properties] Properties to set + */ + function MachineType(properties) { + this.accelerators = []; + this.scratchDisks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineType accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.accelerators = $util.emptyArray; + + /** + * MachineType creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.creationTimestamp = null; + + /** + * MachineType deprecated. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecated + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.deprecated = null; + + /** + * MachineType description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.description = null; + + /** + * MachineType guestCpus. + * @member {number|null|undefined} guestCpus + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.guestCpus = null; + + /** + * MachineType id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.id = null; + + /** + * MachineType imageSpaceGb. + * @member {number|null|undefined} imageSpaceGb + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.imageSpaceGb = null; + + /** + * MachineType isSharedCpu. + * @member {boolean|null|undefined} isSharedCpu + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.isSharedCpu = null; + + /** + * MachineType kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.kind = null; + + /** + * MachineType maximumPersistentDisks. + * @member {number|null|undefined} maximumPersistentDisks + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.maximumPersistentDisks = null; + + /** + * MachineType maximumPersistentDisksSizeGb. + * @member {number|Long|null|undefined} maximumPersistentDisksSizeGb + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.maximumPersistentDisksSizeGb = null; + + /** + * MachineType memoryMb. + * @member {number|null|undefined} memoryMb + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.memoryMb = null; + + /** + * MachineType name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.name = null; + + /** + * MachineType scratchDisks. + * @member {Array.} scratchDisks + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.scratchDisks = $util.emptyArray; + + /** + * MachineType selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.selfLink = null; + + /** + * MachineType zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + MachineType.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MachineType _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _guestCpus. + * @member {"guestCpus"|undefined} _guestCpus + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_guestCpus", { + get: $util.oneOfGetter($oneOfFields = ["guestCpus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _imageSpaceGb. + * @member {"imageSpaceGb"|undefined} _imageSpaceGb + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_imageSpaceGb", { + get: $util.oneOfGetter($oneOfFields = ["imageSpaceGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _isSharedCpu. + * @member {"isSharedCpu"|undefined} _isSharedCpu + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_isSharedCpu", { + get: $util.oneOfGetter($oneOfFields = ["isSharedCpu"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _maximumPersistentDisks. + * @member {"maximumPersistentDisks"|undefined} _maximumPersistentDisks + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_maximumPersistentDisks", { + get: $util.oneOfGetter($oneOfFields = ["maximumPersistentDisks"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _maximumPersistentDisksSizeGb. + * @member {"maximumPersistentDisksSizeGb"|undefined} _maximumPersistentDisksSizeGb + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_maximumPersistentDisksSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["maximumPersistentDisksSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _memoryMb. + * @member {"memoryMb"|undefined} _memoryMb + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_memoryMb", { + get: $util.oneOfGetter($oneOfFields = ["memoryMb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineType _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.MachineType + * @instance + */ + Object.defineProperty(MachineType.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MachineType instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {google.cloud.compute.v1.IMachineType=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MachineType} MachineType instance + */ + MachineType.create = function create(properties) { + return new MachineType(properties); + }; + + /** + * Encodes the specified MachineType message. Does not implicitly {@link google.cloud.compute.v1.MachineType.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {google.cloud.compute.v1.IMachineType} message MachineType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.imageSpaceGb != null && Object.hasOwnProperty.call(message, "imageSpaceGb")) + writer.uint32(/* id 75331864, wireType 0 =*/602654912).int32(message.imageSpaceGb); + if (message.memoryMb != null && Object.hasOwnProperty.call(message, "memoryMb")) + writer.uint32(/* id 116001171, wireType 0 =*/928009368).int32(message.memoryMb); + if (message.maximumPersistentDisksSizeGb != null && Object.hasOwnProperty.call(message, "maximumPersistentDisksSizeGb")) + writer.uint32(/* id 154274471, wireType 0 =*/1234195768).int64(message.maximumPersistentDisksSizeGb); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.compute.v1.Accelerators.encode(message.accelerators[i], writer.uint32(/* id 269577064, wireType 2 =*/2156616514).fork()).ldelim(); + if (message.guestCpus != null && Object.hasOwnProperty.call(message, "guestCpus")) + writer.uint32(/* id 393356754, wireType 0 =*/3146854032).int32(message.guestCpus); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.scratchDisks != null && message.scratchDisks.length) + for (var i = 0; i < message.scratchDisks.length; ++i) + $root.google.cloud.compute.v1.ScratchDisks.encode(message.scratchDisks[i], writer.uint32(/* id 480778481, wireType 2 =*/3846227850).fork()).ldelim(); + if (message.maximumPersistentDisks != null && Object.hasOwnProperty.call(message, "maximumPersistentDisks")) + writer.uint32(/* id 496220941, wireType 0 =*/3969767528).int32(message.maximumPersistentDisks); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecated, writer.uint32(/* id 515138995, wireType 2 =*/4121111962).fork()).ldelim(); + if (message.isSharedCpu != null && Object.hasOwnProperty.call(message, "isSharedCpu")) + writer.uint32(/* id 521399555, wireType 0 =*/4171196440).bool(message.isSharedCpu); + return writer; + }; + + /** + * Encodes the specified MachineType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {google.cloud.compute.v1.IMachineType} message MachineType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MachineType} MachineType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MachineType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269577064: + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.compute.v1.Accelerators.decode(reader, reader.uint32())); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 515138995: + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 393356754: + message.guestCpus = reader.int32(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 75331864: + message.imageSpaceGb = reader.int32(); + break; + case 521399555: + message.isSharedCpu = reader.bool(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 496220941: + message.maximumPersistentDisks = reader.int32(); + break; + case 154274471: + message.maximumPersistentDisksSizeGb = reader.int64(); + break; + case 116001171: + message.memoryMb = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 480778481: + if (!(message.scratchDisks && message.scratchDisks.length)) + message.scratchDisks = []; + message.scratchDisks.push($root.google.cloud.compute.v1.ScratchDisks.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MachineType} MachineType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineType message. + * @function verify + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.compute.v1.Accelerators.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecated); + if (error) + return "deprecated." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.guestCpus != null && message.hasOwnProperty("guestCpus")) { + properties._guestCpus = 1; + if (!$util.isInteger(message.guestCpus)) + return "guestCpus: integer expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.imageSpaceGb != null && message.hasOwnProperty("imageSpaceGb")) { + properties._imageSpaceGb = 1; + if (!$util.isInteger(message.imageSpaceGb)) + return "imageSpaceGb: integer expected"; + } + if (message.isSharedCpu != null && message.hasOwnProperty("isSharedCpu")) { + properties._isSharedCpu = 1; + if (typeof message.isSharedCpu !== "boolean") + return "isSharedCpu: boolean expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.maximumPersistentDisks != null && message.hasOwnProperty("maximumPersistentDisks")) { + properties._maximumPersistentDisks = 1; + if (!$util.isInteger(message.maximumPersistentDisks)) + return "maximumPersistentDisks: integer expected"; + } + if (message.maximumPersistentDisksSizeGb != null && message.hasOwnProperty("maximumPersistentDisksSizeGb")) { + properties._maximumPersistentDisksSizeGb = 1; + if (!$util.isInteger(message.maximumPersistentDisksSizeGb) && !(message.maximumPersistentDisksSizeGb && $util.isInteger(message.maximumPersistentDisksSizeGb.low) && $util.isInteger(message.maximumPersistentDisksSizeGb.high))) + return "maximumPersistentDisksSizeGb: integer|Long expected"; + } + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) { + properties._memoryMb = 1; + if (!$util.isInteger(message.memoryMb)) + return "memoryMb: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.scratchDisks != null && message.hasOwnProperty("scratchDisks")) { + if (!Array.isArray(message.scratchDisks)) + return "scratchDisks: array expected"; + for (var i = 0; i < message.scratchDisks.length; ++i) { + var error = $root.google.cloud.compute.v1.ScratchDisks.verify(message.scratchDisks[i]); + if (error) + return "scratchDisks." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a MachineType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MachineType} MachineType + */ + MachineType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MachineType) + return object; + var message = new $root.google.cloud.compute.v1.MachineType(); + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.compute.v1.MachineType.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.compute.v1.MachineType.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.compute.v1.Accelerators.fromObject(object.accelerators[i]); + } + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.deprecated != null) { + if (typeof object.deprecated !== "object") + throw TypeError(".google.cloud.compute.v1.MachineType.deprecated: object expected"); + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecated); + } + if (object.description != null) + message.description = String(object.description); + if (object.guestCpus != null) + message.guestCpus = object.guestCpus | 0; + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.imageSpaceGb != null) + message.imageSpaceGb = object.imageSpaceGb | 0; + if (object.isSharedCpu != null) + message.isSharedCpu = Boolean(object.isSharedCpu); + if (object.kind != null) + message.kind = String(object.kind); + if (object.maximumPersistentDisks != null) + message.maximumPersistentDisks = object.maximumPersistentDisks | 0; + if (object.maximumPersistentDisksSizeGb != null) + if ($util.Long) + (message.maximumPersistentDisksSizeGb = $util.Long.fromValue(object.maximumPersistentDisksSizeGb)).unsigned = false; + else if (typeof object.maximumPersistentDisksSizeGb === "string") + message.maximumPersistentDisksSizeGb = parseInt(object.maximumPersistentDisksSizeGb, 10); + else if (typeof object.maximumPersistentDisksSizeGb === "number") + message.maximumPersistentDisksSizeGb = object.maximumPersistentDisksSizeGb; + else if (typeof object.maximumPersistentDisksSizeGb === "object") + message.maximumPersistentDisksSizeGb = new $util.LongBits(object.maximumPersistentDisksSizeGb.low >>> 0, object.maximumPersistentDisksSizeGb.high >>> 0).toNumber(); + if (object.memoryMb != null) + message.memoryMb = object.memoryMb | 0; + if (object.name != null) + message.name = String(object.name); + if (object.scratchDisks) { + if (!Array.isArray(object.scratchDisks)) + throw TypeError(".google.cloud.compute.v1.MachineType.scratchDisks: array expected"); + message.scratchDisks = []; + for (var i = 0; i < object.scratchDisks.length; ++i) { + if (typeof object.scratchDisks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.MachineType.scratchDisks: object expected"); + message.scratchDisks[i] = $root.google.cloud.compute.v1.ScratchDisks.fromObject(object.scratchDisks[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a MachineType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MachineType + * @static + * @param {google.cloud.compute.v1.MachineType} message MachineType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.accelerators = []; + object.scratchDisks = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.imageSpaceGb != null && message.hasOwnProperty("imageSpaceGb")) { + object.imageSpaceGb = message.imageSpaceGb; + if (options.oneofs) + object._imageSpaceGb = "imageSpaceGb"; + } + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) { + object.memoryMb = message.memoryMb; + if (options.oneofs) + object._memoryMb = "memoryMb"; + } + if (message.maximumPersistentDisksSizeGb != null && message.hasOwnProperty("maximumPersistentDisksSizeGb")) { + if (typeof message.maximumPersistentDisksSizeGb === "number") + object.maximumPersistentDisksSizeGb = options.longs === String ? String(message.maximumPersistentDisksSizeGb) : message.maximumPersistentDisksSizeGb; + else + object.maximumPersistentDisksSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.maximumPersistentDisksSizeGb) : options.longs === Number ? new $util.LongBits(message.maximumPersistentDisksSizeGb.low >>> 0, message.maximumPersistentDisksSizeGb.high >>> 0).toNumber() : message.maximumPersistentDisksSizeGb; + if (options.oneofs) + object._maximumPersistentDisksSizeGb = "maximumPersistentDisksSizeGb"; + } + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.compute.v1.Accelerators.toObject(message.accelerators[j], options); + } + if (message.guestCpus != null && message.hasOwnProperty("guestCpus")) { + object.guestCpus = message.guestCpus; + if (options.oneofs) + object._guestCpus = "guestCpus"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.scratchDisks && message.scratchDisks.length) { + object.scratchDisks = []; + for (var j = 0; j < message.scratchDisks.length; ++j) + object.scratchDisks[j] = $root.google.cloud.compute.v1.ScratchDisks.toObject(message.scratchDisks[j], options); + } + if (message.maximumPersistentDisks != null && message.hasOwnProperty("maximumPersistentDisks")) { + object.maximumPersistentDisks = message.maximumPersistentDisks; + if (options.oneofs) + object._maximumPersistentDisks = "maximumPersistentDisks"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecated, options); + if (options.oneofs) + object._deprecated = "deprecated"; + } + if (message.isSharedCpu != null && message.hasOwnProperty("isSharedCpu")) { + object.isSharedCpu = message.isSharedCpu; + if (options.oneofs) + object._isSharedCpu = "isSharedCpu"; + } + return object; + }; + + /** + * Converts this MachineType to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MachineType + * @instance + * @returns {Object.} JSON object + */ + MachineType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MachineType; + })(); + + v1.MachineTypesScopedList = (function() { + + /** + * Properties of a MachineTypesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IMachineTypesScopedList + * @property {Array.|null} [machineTypes] MachineTypesScopedList machineTypes + * @property {google.cloud.compute.v1.IWarning|null} [warning] MachineTypesScopedList warning + */ + + /** + * Constructs a new MachineTypesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MachineTypesScopedList. + * @implements IMachineTypesScopedList + * @constructor + * @param {google.cloud.compute.v1.IMachineTypesScopedList=} [properties] Properties to set + */ + function MachineTypesScopedList(properties) { + this.machineTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineTypesScopedList machineTypes. + * @member {Array.} machineTypes + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @instance + */ + MachineTypesScopedList.prototype.machineTypes = $util.emptyArray; + + /** + * MachineTypesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @instance + */ + MachineTypesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MachineTypesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @instance + */ + Object.defineProperty(MachineTypesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MachineTypesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {google.cloud.compute.v1.IMachineTypesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MachineTypesScopedList} MachineTypesScopedList instance + */ + MachineTypesScopedList.create = function create(properties) { + return new MachineTypesScopedList(properties); + }; + + /** + * Encodes the specified MachineTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.MachineTypesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {google.cloud.compute.v1.IMachineTypesScopedList} message MachineTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineTypesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.machineTypes != null && message.machineTypes.length) + for (var i = 0; i < message.machineTypes.length; ++i) + $root.google.cloud.compute.v1.MachineType.encode(message.machineTypes[i], writer.uint32(/* id 79720065, wireType 2 =*/637760522).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MachineTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineTypesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {google.cloud.compute.v1.IMachineTypesScopedList} message MachineTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineTypesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineTypesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MachineTypesScopedList} MachineTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineTypesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MachineTypesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 79720065: + if (!(message.machineTypes && message.machineTypes.length)) + message.machineTypes = []; + message.machineTypes.push($root.google.cloud.compute.v1.MachineType.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineTypesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MachineTypesScopedList} MachineTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineTypesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineTypesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineTypesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.machineTypes != null && message.hasOwnProperty("machineTypes")) { + if (!Array.isArray(message.machineTypes)) + return "machineTypes: array expected"; + for (var i = 0; i < message.machineTypes.length; ++i) { + var error = $root.google.cloud.compute.v1.MachineType.verify(message.machineTypes[i]); + if (error) + return "machineTypes." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a MachineTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MachineTypesScopedList} MachineTypesScopedList + */ + MachineTypesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MachineTypesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.MachineTypesScopedList(); + if (object.machineTypes) { + if (!Array.isArray(object.machineTypes)) + throw TypeError(".google.cloud.compute.v1.MachineTypesScopedList.machineTypes: array expected"); + message.machineTypes = []; + for (var i = 0; i < object.machineTypes.length; ++i) { + if (typeof object.machineTypes[i] !== "object") + throw TypeError(".google.cloud.compute.v1.MachineTypesScopedList.machineTypes: object expected"); + message.machineTypes[i] = $root.google.cloud.compute.v1.MachineType.fromObject(object.machineTypes[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.MachineTypesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a MachineTypesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @static + * @param {google.cloud.compute.v1.MachineTypesScopedList} message MachineTypesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineTypesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.machineTypes = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.machineTypes && message.machineTypes.length) { + object.machineTypes = []; + for (var j = 0; j < message.machineTypes.length; ++j) + object.machineTypes[j] = $root.google.cloud.compute.v1.MachineType.toObject(message.machineTypes[j], options); + } + return object; + }; + + /** + * Converts this MachineTypesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MachineTypesScopedList + * @instance + * @returns {Object.} JSON object + */ + MachineTypesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MachineTypesScopedList; + })(); + + v1.MachineTypeAggregatedList = (function() { + + /** + * Properties of a MachineTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IMachineTypeAggregatedList + * @property {string|null} [id] MachineTypeAggregatedList id + * @property {Object.|null} [items] MachineTypeAggregatedList items + * @property {string|null} [kind] MachineTypeAggregatedList kind + * @property {string|null} [nextPageToken] MachineTypeAggregatedList nextPageToken + * @property {string|null} [selfLink] MachineTypeAggregatedList selfLink + * @property {Array.|null} [unreachables] MachineTypeAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] MachineTypeAggregatedList warning + */ + + /** + * Constructs a new MachineTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MachineTypeAggregatedList. + * @implements IMachineTypeAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IMachineTypeAggregatedList=} [properties] Properties to set + */ + function MachineTypeAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineTypeAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + MachineTypeAggregatedList.prototype.id = null; + + /** + * MachineTypeAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + MachineTypeAggregatedList.prototype.items = $util.emptyObject; + + /** + * MachineTypeAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + MachineTypeAggregatedList.prototype.kind = null; + + /** + * MachineTypeAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + MachineTypeAggregatedList.prototype.nextPageToken = null; + + /** + * MachineTypeAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + MachineTypeAggregatedList.prototype.selfLink = null; + + /** + * MachineTypeAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + MachineTypeAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * MachineTypeAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + MachineTypeAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MachineTypeAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + Object.defineProperty(MachineTypeAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + Object.defineProperty(MachineTypeAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + Object.defineProperty(MachineTypeAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + Object.defineProperty(MachineTypeAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + */ + Object.defineProperty(MachineTypeAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MachineTypeAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IMachineTypeAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MachineTypeAggregatedList} MachineTypeAggregatedList instance + */ + MachineTypeAggregatedList.create = function create(properties) { + return new MachineTypeAggregatedList(properties); + }; + + /** + * Encodes the specified MachineTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.MachineTypeAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IMachineTypeAggregatedList} message MachineTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineTypeAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.MachineTypesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified MachineTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineTypeAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.IMachineTypeAggregatedList} message MachineTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineTypeAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineTypeAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MachineTypeAggregatedList} MachineTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineTypeAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MachineTypeAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.MachineTypesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineTypeAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MachineTypeAggregatedList} MachineTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineTypeAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineTypeAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineTypeAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.MachineTypesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a MachineTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MachineTypeAggregatedList} MachineTypeAggregatedList + */ + MachineTypeAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MachineTypeAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.MachineTypeAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.MachineTypeAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.MachineTypeAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.MachineTypesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.MachineTypeAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.MachineTypeAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a MachineTypeAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.MachineTypeAggregatedList} message MachineTypeAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineTypeAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.MachineTypesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this MachineTypeAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MachineTypeAggregatedList + * @instance + * @returns {Object.} JSON object + */ + MachineTypeAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MachineTypeAggregatedList; + })(); + + v1.MachineTypeList = (function() { + + /** + * Properties of a MachineTypeList. + * @memberof google.cloud.compute.v1 + * @interface IMachineTypeList + * @property {string|null} [id] MachineTypeList id + * @property {Array.|null} [items] MachineTypeList items + * @property {string|null} [kind] MachineTypeList kind + * @property {string|null} [nextPageToken] MachineTypeList nextPageToken + * @property {string|null} [selfLink] MachineTypeList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] MachineTypeList warning + */ + + /** + * Constructs a new MachineTypeList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MachineTypeList. + * @implements IMachineTypeList + * @constructor + * @param {google.cloud.compute.v1.IMachineTypeList=} [properties] Properties to set + */ + function MachineTypeList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineTypeList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + MachineTypeList.prototype.id = null; + + /** + * MachineTypeList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + MachineTypeList.prototype.items = $util.emptyArray; + + /** + * MachineTypeList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + MachineTypeList.prototype.kind = null; + + /** + * MachineTypeList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + MachineTypeList.prototype.nextPageToken = null; + + /** + * MachineTypeList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + MachineTypeList.prototype.selfLink = null; + + /** + * MachineTypeList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + MachineTypeList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MachineTypeList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + Object.defineProperty(MachineTypeList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + Object.defineProperty(MachineTypeList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + Object.defineProperty(MachineTypeList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + Object.defineProperty(MachineTypeList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MachineTypeList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + */ + Object.defineProperty(MachineTypeList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MachineTypeList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {google.cloud.compute.v1.IMachineTypeList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MachineTypeList} MachineTypeList instance + */ + MachineTypeList.create = function create(properties) { + return new MachineTypeList(properties); + }; + + /** + * Encodes the specified MachineTypeList message. Does not implicitly {@link google.cloud.compute.v1.MachineTypeList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {google.cloud.compute.v1.IMachineTypeList} message MachineTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineTypeList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.MachineType.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified MachineTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MachineTypeList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {google.cloud.compute.v1.IMachineTypeList} message MachineTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineTypeList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineTypeList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MachineTypeList} MachineTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineTypeList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MachineTypeList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.MachineType.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineTypeList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MachineTypeList} MachineTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineTypeList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineTypeList message. + * @function verify + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineTypeList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.MachineType.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a MachineTypeList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MachineTypeList} MachineTypeList + */ + MachineTypeList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MachineTypeList) + return object; + var message = new $root.google.cloud.compute.v1.MachineTypeList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.MachineTypeList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.MachineTypeList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.MachineType.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.MachineTypeList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a MachineTypeList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MachineTypeList + * @static + * @param {google.cloud.compute.v1.MachineTypeList} message MachineTypeList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineTypeList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.MachineType.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this MachineTypeList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MachineTypeList + * @instance + * @returns {Object.} JSON object + */ + MachineTypeList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MachineTypeList; + })(); + + v1.ManagedInstanceInstanceHealth = (function() { + + /** + * Properties of a ManagedInstanceInstanceHealth. + * @memberof google.cloud.compute.v1 + * @interface IManagedInstanceInstanceHealth + * @property {google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState|null} [detailedHealthState] ManagedInstanceInstanceHealth detailedHealthState + * @property {string|null} [healthCheck] ManagedInstanceInstanceHealth healthCheck + */ + + /** + * Constructs a new ManagedInstanceInstanceHealth. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ManagedInstanceInstanceHealth. + * @implements IManagedInstanceInstanceHealth + * @constructor + * @param {google.cloud.compute.v1.IManagedInstanceInstanceHealth=} [properties] Properties to set + */ + function ManagedInstanceInstanceHealth(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedInstanceInstanceHealth detailedHealthState. + * @member {google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState|null|undefined} detailedHealthState + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @instance + */ + ManagedInstanceInstanceHealth.prototype.detailedHealthState = null; + + /** + * ManagedInstanceInstanceHealth healthCheck. + * @member {string|null|undefined} healthCheck + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @instance + */ + ManagedInstanceInstanceHealth.prototype.healthCheck = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ManagedInstanceInstanceHealth _detailedHealthState. + * @member {"detailedHealthState"|undefined} _detailedHealthState + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @instance + */ + Object.defineProperty(ManagedInstanceInstanceHealth.prototype, "_detailedHealthState", { + get: $util.oneOfGetter($oneOfFields = ["detailedHealthState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ManagedInstanceInstanceHealth _healthCheck. + * @member {"healthCheck"|undefined} _healthCheck + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @instance + */ + Object.defineProperty(ManagedInstanceInstanceHealth.prototype, "_healthCheck", { + get: $util.oneOfGetter($oneOfFields = ["healthCheck"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ManagedInstanceInstanceHealth instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {google.cloud.compute.v1.IManagedInstanceInstanceHealth=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ManagedInstanceInstanceHealth} ManagedInstanceInstanceHealth instance + */ + ManagedInstanceInstanceHealth.create = function create(properties) { + return new ManagedInstanceInstanceHealth(properties); + }; + + /** + * Encodes the specified ManagedInstanceInstanceHealth message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceInstanceHealth.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {google.cloud.compute.v1.IManagedInstanceInstanceHealth} message ManagedInstanceInstanceHealth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstanceInstanceHealth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + if (message.detailedHealthState != null && Object.hasOwnProperty.call(message, "detailedHealthState")) + writer.uint32(/* id 510470173, wireType 0 =*/4083761384).int32(message.detailedHealthState); + return writer; + }; + + /** + * Encodes the specified ManagedInstanceInstanceHealth message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceInstanceHealth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {google.cloud.compute.v1.IManagedInstanceInstanceHealth} message ManagedInstanceInstanceHealth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstanceInstanceHealth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedInstanceInstanceHealth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ManagedInstanceInstanceHealth} ManagedInstanceInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstanceInstanceHealth.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 510470173: + message.detailedHealthState = reader.int32(); + break; + case 308876645: + message.healthCheck = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedInstanceInstanceHealth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ManagedInstanceInstanceHealth} ManagedInstanceInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstanceInstanceHealth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedInstanceInstanceHealth message. + * @function verify + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedInstanceInstanceHealth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.detailedHealthState != null && message.hasOwnProperty("detailedHealthState")) { + properties._detailedHealthState = 1; + switch (message.detailedHealthState) { + default: + return "detailedHealthState: enum value expected"; + case 0: + case 480455402: + case 439801213: + case 477813057: + case 462118084: + case 433141802: + break; + } + } + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + properties._healthCheck = 1; + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + } + return null; + }; + + /** + * Creates a ManagedInstanceInstanceHealth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ManagedInstanceInstanceHealth} ManagedInstanceInstanceHealth + */ + ManagedInstanceInstanceHealth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth) + return object; + var message = new $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth(); + switch (object.detailedHealthState) { + case "UNDEFINED_DETAILED_HEALTH_STATE": + case 0: + message.detailedHealthState = 0; + break; + case "DRAINING": + case 480455402: + message.detailedHealthState = 480455402; + break; + case "HEALTHY": + case 439801213: + message.detailedHealthState = 439801213; + break; + case "TIMEOUT": + case 477813057: + message.detailedHealthState = 477813057; + break; + case "UNHEALTHY": + case 462118084: + message.detailedHealthState = 462118084; + break; + case "UNKNOWN": + case 433141802: + message.detailedHealthState = 433141802; + break; + } + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + return message; + }; + + /** + * Creates a plain object from a ManagedInstanceInstanceHealth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @static + * @param {google.cloud.compute.v1.ManagedInstanceInstanceHealth} message ManagedInstanceInstanceHealth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedInstanceInstanceHealth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) { + object.healthCheck = message.healthCheck; + if (options.oneofs) + object._healthCheck = "healthCheck"; + } + if (message.detailedHealthState != null && message.hasOwnProperty("detailedHealthState")) { + object.detailedHealthState = options.enums === String ? $root.google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState[message.detailedHealthState] : message.detailedHealthState; + if (options.oneofs) + object._detailedHealthState = "detailedHealthState"; + } + return object; + }; + + /** + * Converts this ManagedInstanceInstanceHealth to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ManagedInstanceInstanceHealth + * @instance + * @returns {Object.} JSON object + */ + ManagedInstanceInstanceHealth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * DetailedHealthState enum. + * @name google.cloud.compute.v1.ManagedInstanceInstanceHealth.DetailedHealthState + * @enum {number} + * @property {number} UNDEFINED_DETAILED_HEALTH_STATE=0 UNDEFINED_DETAILED_HEALTH_STATE value + * @property {number} DRAINING=480455402 DRAINING value + * @property {number} HEALTHY=439801213 HEALTHY value + * @property {number} TIMEOUT=477813057 TIMEOUT value + * @property {number} UNHEALTHY=462118084 UNHEALTHY value + * @property {number} UNKNOWN=433141802 UNKNOWN value + */ + ManagedInstanceInstanceHealth.DetailedHealthState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_DETAILED_HEALTH_STATE"] = 0; + values[valuesById[480455402] = "DRAINING"] = 480455402; + values[valuesById[439801213] = "HEALTHY"] = 439801213; + values[valuesById[477813057] = "TIMEOUT"] = 477813057; + values[valuesById[462118084] = "UNHEALTHY"] = 462118084; + values[valuesById[433141802] = "UNKNOWN"] = 433141802; + return values; + })(); + + return ManagedInstanceInstanceHealth; + })(); + + v1.ManagedInstanceLastAttempt = (function() { + + /** + * Properties of a ManagedInstanceLastAttempt. + * @memberof google.cloud.compute.v1 + * @interface IManagedInstanceLastAttempt + * @property {google.cloud.compute.v1.IErrors|null} [errors] ManagedInstanceLastAttempt errors + */ + + /** + * Constructs a new ManagedInstanceLastAttempt. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ManagedInstanceLastAttempt. + * @implements IManagedInstanceLastAttempt + * @constructor + * @param {google.cloud.compute.v1.IManagedInstanceLastAttempt=} [properties] Properties to set + */ + function ManagedInstanceLastAttempt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedInstanceLastAttempt errors. + * @member {google.cloud.compute.v1.IErrors|null|undefined} errors + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @instance + */ + ManagedInstanceLastAttempt.prototype.errors = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ManagedInstanceLastAttempt _errors. + * @member {"errors"|undefined} _errors + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @instance + */ + Object.defineProperty(ManagedInstanceLastAttempt.prototype, "_errors", { + get: $util.oneOfGetter($oneOfFields = ["errors"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ManagedInstanceLastAttempt instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {google.cloud.compute.v1.IManagedInstanceLastAttempt=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ManagedInstanceLastAttempt} ManagedInstanceLastAttempt instance + */ + ManagedInstanceLastAttempt.create = function create(properties) { + return new ManagedInstanceLastAttempt(properties); + }; + + /** + * Encodes the specified ManagedInstanceLastAttempt message. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceLastAttempt.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {google.cloud.compute.v1.IManagedInstanceLastAttempt} message ManagedInstanceLastAttempt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstanceLastAttempt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && Object.hasOwnProperty.call(message, "errors")) + $root.google.cloud.compute.v1.Errors.encode(message.errors, writer.uint32(/* id 315977579, wireType 2 =*/2527820634).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ManagedInstanceLastAttempt message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ManagedInstanceLastAttempt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {google.cloud.compute.v1.IManagedInstanceLastAttempt} message ManagedInstanceLastAttempt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedInstanceLastAttempt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedInstanceLastAttempt message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ManagedInstanceLastAttempt} ManagedInstanceLastAttempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstanceLastAttempt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ManagedInstanceLastAttempt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 315977579: + message.errors = $root.google.cloud.compute.v1.Errors.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedInstanceLastAttempt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ManagedInstanceLastAttempt} ManagedInstanceLastAttempt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedInstanceLastAttempt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedInstanceLastAttempt message. + * @function verify + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedInstanceLastAttempt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.errors != null && message.hasOwnProperty("errors")) { + properties._errors = 1; + { + var error = $root.google.cloud.compute.v1.Errors.verify(message.errors); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates a ManagedInstanceLastAttempt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ManagedInstanceLastAttempt} ManagedInstanceLastAttempt + */ + ManagedInstanceLastAttempt.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ManagedInstanceLastAttempt) + return object; + var message = new $root.google.cloud.compute.v1.ManagedInstanceLastAttempt(); + if (object.errors != null) { + if (typeof object.errors !== "object") + throw TypeError(".google.cloud.compute.v1.ManagedInstanceLastAttempt.errors: object expected"); + message.errors = $root.google.cloud.compute.v1.Errors.fromObject(object.errors); + } + return message; + }; + + /** + * Creates a plain object from a ManagedInstanceLastAttempt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @static + * @param {google.cloud.compute.v1.ManagedInstanceLastAttempt} message ManagedInstanceLastAttempt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedInstanceLastAttempt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.errors != null && message.hasOwnProperty("errors")) { + object.errors = $root.google.cloud.compute.v1.Errors.toObject(message.errors, options); + if (options.oneofs) + object._errors = "errors"; + } + return object; + }; + + /** + * Converts this ManagedInstanceLastAttempt to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ManagedInstanceLastAttempt + * @instance + * @returns {Object.} JSON object + */ + ManagedInstanceLastAttempt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ManagedInstanceLastAttempt; + })(); + + v1.PreservedState = (function() { + + /** + * Properties of a PreservedState. + * @memberof google.cloud.compute.v1 + * @interface IPreservedState + * @property {Object.|null} [disks] PreservedState disks + * @property {Object.|null} [metadata] PreservedState metadata + */ + + /** + * Constructs a new PreservedState. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PreservedState. + * @implements IPreservedState + * @constructor + * @param {google.cloud.compute.v1.IPreservedState=} [properties] Properties to set + */ + function PreservedState(properties) { + this.disks = {}; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreservedState disks. + * @member {Object.} disks + * @memberof google.cloud.compute.v1.PreservedState + * @instance + */ + PreservedState.prototype.disks = $util.emptyObject; + + /** + * PreservedState metadata. + * @member {Object.} metadata + * @memberof google.cloud.compute.v1.PreservedState + * @instance + */ + PreservedState.prototype.metadata = $util.emptyObject; + + /** + * Creates a new PreservedState instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {google.cloud.compute.v1.IPreservedState=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PreservedState} PreservedState instance + */ + PreservedState.create = function create(properties) { + return new PreservedState(properties); + }; + + /** + * Encodes the specified PreservedState message. Does not implicitly {@link google.cloud.compute.v1.PreservedState.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {google.cloud.compute.v1.IPreservedState} message PreservedState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreservedState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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 86866735, wireType 2 =*/694933882).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.disks != null && Object.hasOwnProperty.call(message, "disks")) + for (var keys = Object.keys(message.disks), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.PreservedStatePreservedDisk.encode(message.disks[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified PreservedState message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreservedState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {google.cloud.compute.v1.IPreservedState} message PreservedState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreservedState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreservedState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PreservedState} PreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreservedState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PreservedState(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 95594102: + if (message.disks === $util.emptyObject) + message.disks = {}; + 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.compute.v1.PreservedStatePreservedDisk.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.disks[key] = value; + break; + case 86866735: + 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; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreservedState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PreservedState} PreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreservedState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreservedState message. + * @function verify + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreservedState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!$util.isObject(message.disks)) + return "disks: object expected"; + var key = Object.keys(message.disks); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.PreservedStatePreservedDisk.verify(message.disks[key[i]]); + if (error) + return "disks." + error; + } + } + 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"; + } + return null; + }; + + /** + * Creates a PreservedState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PreservedState} PreservedState + */ + PreservedState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PreservedState) + return object; + var message = new $root.google.cloud.compute.v1.PreservedState(); + if (object.disks) { + if (typeof object.disks !== "object") + throw TypeError(".google.cloud.compute.v1.PreservedState.disks: object expected"); + message.disks = {}; + for (var keys = Object.keys(object.disks), i = 0; i < keys.length; ++i) { + if (typeof object.disks[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.PreservedState.disks: object expected"); + message.disks[keys[i]] = $root.google.cloud.compute.v1.PreservedStatePreservedDisk.fromObject(object.disks[keys[i]]); + } + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.compute.v1.PreservedState.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]]); + } + return message; + }; + + /** + * Creates a plain object from a PreservedState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PreservedState + * @static + * @param {google.cloud.compute.v1.PreservedState} message PreservedState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreservedState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.metadata = {}; + object.disks = {}; + } + 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.disks && (keys2 = Object.keys(message.disks)).length) { + object.disks = {}; + for (var j = 0; j < keys2.length; ++j) + object.disks[keys2[j]] = $root.google.cloud.compute.v1.PreservedStatePreservedDisk.toObject(message.disks[keys2[j]], options); + } + return object; + }; + + /** + * Converts this PreservedState to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PreservedState + * @instance + * @returns {Object.} JSON object + */ + PreservedState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PreservedState; + })(); + + v1.Errors = (function() { + + /** + * Properties of an Errors. + * @memberof google.cloud.compute.v1 + * @interface IErrors + * @property {string|null} [code] Errors code + * @property {string|null} [location] Errors location + * @property {string|null} [message] Errors message + */ + + /** + * Constructs a new Errors. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Errors. + * @implements IErrors + * @constructor + * @param {google.cloud.compute.v1.IErrors=} [properties] Properties to set + */ + function Errors(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Errors code. + * @member {string|null|undefined} code + * @memberof google.cloud.compute.v1.Errors + * @instance + */ + Errors.prototype.code = null; + + /** + * Errors location. + * @member {string|null|undefined} location + * @memberof google.cloud.compute.v1.Errors + * @instance + */ + Errors.prototype.location = null; + + /** + * Errors message. + * @member {string|null|undefined} message + * @memberof google.cloud.compute.v1.Errors + * @instance + */ + Errors.prototype.message = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Errors _code. + * @member {"code"|undefined} _code + * @memberof google.cloud.compute.v1.Errors + * @instance + */ + Object.defineProperty(Errors.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Errors _location. + * @member {"location"|undefined} _location + * @memberof google.cloud.compute.v1.Errors + * @instance + */ + Object.defineProperty(Errors.prototype, "_location", { + get: $util.oneOfGetter($oneOfFields = ["location"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Errors _message. + * @member {"message"|undefined} _message + * @memberof google.cloud.compute.v1.Errors + * @instance + */ + Object.defineProperty(Errors.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Errors instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {google.cloud.compute.v1.IErrors=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Errors} Errors instance + */ + Errors.create = function create(properties) { + return new Errors(properties); + }; + + /** + * Encodes the specified Errors message. Does not implicitly {@link google.cloud.compute.v1.Errors.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {google.cloud.compute.v1.IErrors} message Errors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Errors.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 3059181, wireType 2 =*/24473450).string(message.code); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 290430901, wireType 2 =*/2323447210).string(message.location); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 418054151, wireType 2 =*/3344433210).string(message.message); + return writer; + }; + + /** + * Encodes the specified Errors message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Errors.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {google.cloud.compute.v1.IErrors} message Errors message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Errors.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Errors message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Errors} Errors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Errors.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Errors(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3059181: + message.code = reader.string(); + break; + case 290430901: + message.location = reader.string(); + break; + case 418054151: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Errors message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Errors} Errors + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Errors.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Errors message. + * @function verify + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Errors.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.code != null && message.hasOwnProperty("code")) { + properties._code = 1; + if (!$util.isString(message.code)) + return "code: string expected"; + } + if (message.location != null && message.hasOwnProperty("location")) { + properties._location = 1; + if (!$util.isString(message.location)) + return "location: string expected"; + } + if (message.message != null && message.hasOwnProperty("message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + return null; + }; + + /** + * Creates an Errors message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Errors} Errors + */ + Errors.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Errors) + return object; + var message = new $root.google.cloud.compute.v1.Errors(); + if (object.code != null) + message.code = String(object.code); + if (object.location != null) + message.location = String(object.location); + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from an Errors message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Errors + * @static + * @param {google.cloud.compute.v1.Errors} message Errors + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Errors.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.code != null && message.hasOwnProperty("code")) { + object.code = message.code; + if (options.oneofs) + object._code = "code"; + } + if (message.location != null && message.hasOwnProperty("location")) { + object.location = message.location; + if (options.oneofs) + object._location = "location"; + } + if (message.message != null && message.hasOwnProperty("message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; + + /** + * Converts this Errors to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Errors + * @instance + * @returns {Object.} JSON object + */ + Errors.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Errors; + })(); + + v1.Items = (function() { + + /** + * Properties of an Items. + * @memberof google.cloud.compute.v1 + * @interface IItems + * @property {string|null} [key] Items key + * @property {string|null} [value] Items value + */ + + /** + * Constructs a new Items. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Items. + * @implements IItems + * @constructor + * @param {google.cloud.compute.v1.IItems=} [properties] Properties to set + */ + function Items(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Items key. + * @member {string|null|undefined} key + * @memberof google.cloud.compute.v1.Items + * @instance + */ + Items.prototype.key = null; + + /** + * Items value. + * @member {string|null|undefined} value + * @memberof google.cloud.compute.v1.Items + * @instance + */ + Items.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Items _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.compute.v1.Items + * @instance + */ + Object.defineProperty(Items.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Items _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.compute.v1.Items + * @instance + */ + Object.defineProperty(Items.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Items instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Items + * @static + * @param {google.cloud.compute.v1.IItems=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Items} Items instance + */ + Items.create = function create(properties) { + return new Items(properties); + }; + + /** + * Encodes the specified Items message. Does not implicitly {@link google.cloud.compute.v1.Items.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Items + * @static + * @param {google.cloud.compute.v1.IItems} message Items message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Items.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 106079, wireType 2 =*/848634).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 111972721, wireType 2 =*/895781770).string(message.value); + return writer; + }; + + /** + * Encodes the specified Items message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Items.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Items + * @static + * @param {google.cloud.compute.v1.IItems} message Items message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Items.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Items message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Items + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Items} Items + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Items.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Items(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 106079: + message.key = reader.string(); + break; + case 111972721: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Items message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Items + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Items} Items + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Items.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Items message. + * @function verify + * @memberof google.cloud.compute.v1.Items + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Items.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates an Items message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Items + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Items} Items + */ + Items.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Items) + return object; + var message = new $root.google.cloud.compute.v1.Items(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an Items message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Items + * @static + * @param {google.cloud.compute.v1.Items} message Items + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Items.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this Items to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Items + * @instance + * @returns {Object.} JSON object + */ + Items.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Items; + })(); + + v1.MetadataFilterLabelMatch = (function() { + + /** + * Properties of a MetadataFilterLabelMatch. + * @memberof google.cloud.compute.v1 + * @interface IMetadataFilterLabelMatch + * @property {string|null} [name] MetadataFilterLabelMatch name + * @property {string|null} [value] MetadataFilterLabelMatch value + */ + + /** + * Constructs a new MetadataFilterLabelMatch. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MetadataFilterLabelMatch. + * @implements IMetadataFilterLabelMatch + * @constructor + * @param {google.cloud.compute.v1.IMetadataFilterLabelMatch=} [properties] Properties to set + */ + function MetadataFilterLabelMatch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataFilterLabelMatch name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @instance + */ + MetadataFilterLabelMatch.prototype.name = null; + + /** + * MetadataFilterLabelMatch value. + * @member {string|null|undefined} value + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @instance + */ + MetadataFilterLabelMatch.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetadataFilterLabelMatch _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @instance + */ + Object.defineProperty(MetadataFilterLabelMatch.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MetadataFilterLabelMatch _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @instance + */ + Object.defineProperty(MetadataFilterLabelMatch.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetadataFilterLabelMatch instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {google.cloud.compute.v1.IMetadataFilterLabelMatch=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MetadataFilterLabelMatch} MetadataFilterLabelMatch instance + */ + MetadataFilterLabelMatch.create = function create(properties) { + return new MetadataFilterLabelMatch(properties); + }; + + /** + * Encodes the specified MetadataFilterLabelMatch message. Does not implicitly {@link google.cloud.compute.v1.MetadataFilterLabelMatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {google.cloud.compute.v1.IMetadataFilterLabelMatch} message MetadataFilterLabelMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataFilterLabelMatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 111972721, wireType 2 =*/895781770).string(message.value); + return writer; + }; + + /** + * Encodes the specified MetadataFilterLabelMatch message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MetadataFilterLabelMatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {google.cloud.compute.v1.IMetadataFilterLabelMatch} message MetadataFilterLabelMatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataFilterLabelMatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataFilterLabelMatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MetadataFilterLabelMatch} MetadataFilterLabelMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataFilterLabelMatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MetadataFilterLabelMatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + case 111972721: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataFilterLabelMatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MetadataFilterLabelMatch} MetadataFilterLabelMatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataFilterLabelMatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataFilterLabelMatch message. + * @function verify + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataFilterLabelMatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates a MetadataFilterLabelMatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MetadataFilterLabelMatch} MetadataFilterLabelMatch + */ + MetadataFilterLabelMatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MetadataFilterLabelMatch) + return object; + var message = new $root.google.cloud.compute.v1.MetadataFilterLabelMatch(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a MetadataFilterLabelMatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @static + * @param {google.cloud.compute.v1.MetadataFilterLabelMatch} message MetadataFilterLabelMatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataFilterLabelMatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this MetadataFilterLabelMatch to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MetadataFilterLabelMatch + * @instance + * @returns {Object.} JSON object + */ + MetadataFilterLabelMatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MetadataFilterLabelMatch; + })(); + + v1.NetworkPeering = (function() { + + /** + * Properties of a NetworkPeering. + * @memberof google.cloud.compute.v1 + * @interface INetworkPeering + * @property {boolean|null} [autoCreateRoutes] NetworkPeering autoCreateRoutes + * @property {boolean|null} [exchangeSubnetRoutes] NetworkPeering exchangeSubnetRoutes + * @property {boolean|null} [exportCustomRoutes] NetworkPeering exportCustomRoutes + * @property {boolean|null} [exportSubnetRoutesWithPublicIp] NetworkPeering exportSubnetRoutesWithPublicIp + * @property {boolean|null} [importCustomRoutes] NetworkPeering importCustomRoutes + * @property {boolean|null} [importSubnetRoutesWithPublicIp] NetworkPeering importSubnetRoutesWithPublicIp + * @property {string|null} [name] NetworkPeering name + * @property {string|null} [network] NetworkPeering network + * @property {number|null} [peerMtu] NetworkPeering peerMtu + * @property {google.cloud.compute.v1.NetworkPeering.State|null} [state] NetworkPeering state + * @property {string|null} [stateDetails] NetworkPeering stateDetails + */ + + /** + * Constructs a new NetworkPeering. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkPeering. + * @implements INetworkPeering + * @constructor + * @param {google.cloud.compute.v1.INetworkPeering=} [properties] Properties to set + */ + function NetworkPeering(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPeering autoCreateRoutes. + * @member {boolean|null|undefined} autoCreateRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.autoCreateRoutes = null; + + /** + * NetworkPeering exchangeSubnetRoutes. + * @member {boolean|null|undefined} exchangeSubnetRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.exchangeSubnetRoutes = null; + + /** + * NetworkPeering exportCustomRoutes. + * @member {boolean|null|undefined} exportCustomRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.exportCustomRoutes = null; + + /** + * NetworkPeering exportSubnetRoutesWithPublicIp. + * @member {boolean|null|undefined} exportSubnetRoutesWithPublicIp + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.exportSubnetRoutesWithPublicIp = null; + + /** + * NetworkPeering importCustomRoutes. + * @member {boolean|null|undefined} importCustomRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.importCustomRoutes = null; + + /** + * NetworkPeering importSubnetRoutesWithPublicIp. + * @member {boolean|null|undefined} importSubnetRoutesWithPublicIp + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.importSubnetRoutesWithPublicIp = null; + + /** + * NetworkPeering name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.name = null; + + /** + * NetworkPeering network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.network = null; + + /** + * NetworkPeering peerMtu. + * @member {number|null|undefined} peerMtu + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.peerMtu = null; + + /** + * NetworkPeering state. + * @member {google.cloud.compute.v1.NetworkPeering.State|null|undefined} state + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.state = null; + + /** + * NetworkPeering stateDetails. + * @member {string|null|undefined} stateDetails + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + NetworkPeering.prototype.stateDetails = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkPeering _autoCreateRoutes. + * @member {"autoCreateRoutes"|undefined} _autoCreateRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_autoCreateRoutes", { + get: $util.oneOfGetter($oneOfFields = ["autoCreateRoutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _exchangeSubnetRoutes. + * @member {"exchangeSubnetRoutes"|undefined} _exchangeSubnetRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_exchangeSubnetRoutes", { + get: $util.oneOfGetter($oneOfFields = ["exchangeSubnetRoutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _exportCustomRoutes. + * @member {"exportCustomRoutes"|undefined} _exportCustomRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_exportCustomRoutes", { + get: $util.oneOfGetter($oneOfFields = ["exportCustomRoutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _exportSubnetRoutesWithPublicIp. + * @member {"exportSubnetRoutesWithPublicIp"|undefined} _exportSubnetRoutesWithPublicIp + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_exportSubnetRoutesWithPublicIp", { + get: $util.oneOfGetter($oneOfFields = ["exportSubnetRoutesWithPublicIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _importCustomRoutes. + * @member {"importCustomRoutes"|undefined} _importCustomRoutes + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_importCustomRoutes", { + get: $util.oneOfGetter($oneOfFields = ["importCustomRoutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _importSubnetRoutesWithPublicIp. + * @member {"importSubnetRoutesWithPublicIp"|undefined} _importSubnetRoutesWithPublicIp + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_importSubnetRoutesWithPublicIp", { + get: $util.oneOfGetter($oneOfFields = ["importSubnetRoutesWithPublicIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _peerMtu. + * @member {"peerMtu"|undefined} _peerMtu + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_peerMtu", { + get: $util.oneOfGetter($oneOfFields = ["peerMtu"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkPeering _stateDetails. + * @member {"stateDetails"|undefined} _stateDetails + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + */ + Object.defineProperty(NetworkPeering.prototype, "_stateDetails", { + get: $util.oneOfGetter($oneOfFields = ["stateDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkPeering instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {google.cloud.compute.v1.INetworkPeering=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkPeering} NetworkPeering instance + */ + NetworkPeering.create = function create(properties) { + return new NetworkPeering(properties); + }; + + /** + * Encodes the specified NetworkPeering message. Does not implicitly {@link google.cloud.compute.v1.NetworkPeering.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {google.cloud.compute.v1.INetworkPeering} message NetworkPeering message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPeering.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.importSubnetRoutesWithPublicIp != null && Object.hasOwnProperty.call(message, "importSubnetRoutesWithPublicIp")) + writer.uint32(/* id 14419729, wireType 0 =*/115357832).bool(message.importSubnetRoutesWithPublicIp); + if (message.exchangeSubnetRoutes != null && Object.hasOwnProperty.call(message, "exchangeSubnetRoutes")) + writer.uint32(/* id 26322256, wireType 0 =*/210578048).bool(message.exchangeSubnetRoutes); + if (message.autoCreateRoutes != null && Object.hasOwnProperty.call(message, "autoCreateRoutes")) + writer.uint32(/* id 57454941, wireType 0 =*/459639528).bool(message.autoCreateRoutes); + if (message.exportCustomRoutes != null && Object.hasOwnProperty.call(message, "exportCustomRoutes")) + writer.uint32(/* id 60281485, wireType 0 =*/482251880).bool(message.exportCustomRoutes); + if (message.peerMtu != null && Object.hasOwnProperty.call(message, "peerMtu")) + writer.uint32(/* id 69584721, wireType 0 =*/556677768).int32(message.peerMtu); + if (message.stateDetails != null && Object.hasOwnProperty.call(message, "stateDetails")) + writer.uint32(/* id 95566996, wireType 2 =*/764535970).string(message.stateDetails); + if (message.exportSubnetRoutesWithPublicIp != null && Object.hasOwnProperty.call(message, "exportSubnetRoutesWithPublicIp")) + writer.uint32(/* id 97940834, wireType 0 =*/783526672).bool(message.exportSubnetRoutesWithPublicIp); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.importCustomRoutes != null && Object.hasOwnProperty.call(message, "importCustomRoutes")) + writer.uint32(/* id 197982398, wireType 0 =*/1583859184).bool(message.importCustomRoutes); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + return writer; + }; + + /** + * Encodes the specified NetworkPeering message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkPeering.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {google.cloud.compute.v1.INetworkPeering} message NetworkPeering message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPeering.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPeering message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkPeering} NetworkPeering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPeering.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkPeering(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 57454941: + message.autoCreateRoutes = reader.bool(); + break; + case 26322256: + message.exchangeSubnetRoutes = reader.bool(); + break; + case 60281485: + message.exportCustomRoutes = reader.bool(); + break; + case 97940834: + message.exportSubnetRoutesWithPublicIp = reader.bool(); + break; + case 197982398: + message.importCustomRoutes = reader.bool(); + break; + case 14419729: + message.importSubnetRoutesWithPublicIp = reader.bool(); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 69584721: + message.peerMtu = reader.int32(); + break; + case 109757585: + message.state = reader.int32(); + break; + case 95566996: + message.stateDetails = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPeering message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkPeering} NetworkPeering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPeering.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPeering message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPeering.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoCreateRoutes != null && message.hasOwnProperty("autoCreateRoutes")) { + properties._autoCreateRoutes = 1; + if (typeof message.autoCreateRoutes !== "boolean") + return "autoCreateRoutes: boolean expected"; + } + if (message.exchangeSubnetRoutes != null && message.hasOwnProperty("exchangeSubnetRoutes")) { + properties._exchangeSubnetRoutes = 1; + if (typeof message.exchangeSubnetRoutes !== "boolean") + return "exchangeSubnetRoutes: boolean expected"; + } + if (message.exportCustomRoutes != null && message.hasOwnProperty("exportCustomRoutes")) { + properties._exportCustomRoutes = 1; + if (typeof message.exportCustomRoutes !== "boolean") + return "exportCustomRoutes: boolean expected"; + } + if (message.exportSubnetRoutesWithPublicIp != null && message.hasOwnProperty("exportSubnetRoutesWithPublicIp")) { + properties._exportSubnetRoutesWithPublicIp = 1; + if (typeof message.exportSubnetRoutesWithPublicIp !== "boolean") + return "exportSubnetRoutesWithPublicIp: boolean expected"; + } + if (message.importCustomRoutes != null && message.hasOwnProperty("importCustomRoutes")) { + properties._importCustomRoutes = 1; + if (typeof message.importCustomRoutes !== "boolean") + return "importCustomRoutes: boolean expected"; + } + if (message.importSubnetRoutesWithPublicIp != null && message.hasOwnProperty("importSubnetRoutesWithPublicIp")) { + properties._importSubnetRoutesWithPublicIp = 1; + if (typeof message.importSubnetRoutesWithPublicIp !== "boolean") + return "importSubnetRoutesWithPublicIp: boolean expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.peerMtu != null && message.hasOwnProperty("peerMtu")) { + properties._peerMtu = 1; + if (!$util.isInteger(message.peerMtu)) + return "peerMtu: integer expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 314733318: + case 270421099: + break; + } + } + if (message.stateDetails != null && message.hasOwnProperty("stateDetails")) { + properties._stateDetails = 1; + if (!$util.isString(message.stateDetails)) + return "stateDetails: string expected"; + } + return null; + }; + + /** + * Creates a NetworkPeering message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkPeering} NetworkPeering + */ + NetworkPeering.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkPeering) + return object; + var message = new $root.google.cloud.compute.v1.NetworkPeering(); + if (object.autoCreateRoutes != null) + message.autoCreateRoutes = Boolean(object.autoCreateRoutes); + if (object.exchangeSubnetRoutes != null) + message.exchangeSubnetRoutes = Boolean(object.exchangeSubnetRoutes); + if (object.exportCustomRoutes != null) + message.exportCustomRoutes = Boolean(object.exportCustomRoutes); + if (object.exportSubnetRoutesWithPublicIp != null) + message.exportSubnetRoutesWithPublicIp = Boolean(object.exportSubnetRoutesWithPublicIp); + if (object.importCustomRoutes != null) + message.importCustomRoutes = Boolean(object.importCustomRoutes); + if (object.importSubnetRoutesWithPublicIp != null) + message.importSubnetRoutesWithPublicIp = Boolean(object.importSubnetRoutesWithPublicIp); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.peerMtu != null) + message.peerMtu = object.peerMtu | 0; + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 314733318: + message.state = 314733318; + break; + case "INACTIVE": + case 270421099: + message.state = 270421099; + break; + } + if (object.stateDetails != null) + message.stateDetails = String(object.stateDetails); + return message; + }; + + /** + * Creates a plain object from a NetworkPeering message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkPeering + * @static + * @param {google.cloud.compute.v1.NetworkPeering} message NetworkPeering + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPeering.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.importSubnetRoutesWithPublicIp != null && message.hasOwnProperty("importSubnetRoutesWithPublicIp")) { + object.importSubnetRoutesWithPublicIp = message.importSubnetRoutesWithPublicIp; + if (options.oneofs) + object._importSubnetRoutesWithPublicIp = "importSubnetRoutesWithPublicIp"; + } + if (message.exchangeSubnetRoutes != null && message.hasOwnProperty("exchangeSubnetRoutes")) { + object.exchangeSubnetRoutes = message.exchangeSubnetRoutes; + if (options.oneofs) + object._exchangeSubnetRoutes = "exchangeSubnetRoutes"; + } + if (message.autoCreateRoutes != null && message.hasOwnProperty("autoCreateRoutes")) { + object.autoCreateRoutes = message.autoCreateRoutes; + if (options.oneofs) + object._autoCreateRoutes = "autoCreateRoutes"; + } + if (message.exportCustomRoutes != null && message.hasOwnProperty("exportCustomRoutes")) { + object.exportCustomRoutes = message.exportCustomRoutes; + if (options.oneofs) + object._exportCustomRoutes = "exportCustomRoutes"; + } + if (message.peerMtu != null && message.hasOwnProperty("peerMtu")) { + object.peerMtu = message.peerMtu; + if (options.oneofs) + object._peerMtu = "peerMtu"; + } + if (message.stateDetails != null && message.hasOwnProperty("stateDetails")) { + object.stateDetails = message.stateDetails; + if (options.oneofs) + object._stateDetails = "stateDetails"; + } + if (message.exportSubnetRoutesWithPublicIp != null && message.hasOwnProperty("exportSubnetRoutesWithPublicIp")) { + object.exportSubnetRoutesWithPublicIp = message.exportSubnetRoutesWithPublicIp; + if (options.oneofs) + object._exportSubnetRoutesWithPublicIp = "exportSubnetRoutesWithPublicIp"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.NetworkPeering.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.importCustomRoutes != null && message.hasOwnProperty("importCustomRoutes")) { + object.importCustomRoutes = message.importCustomRoutes; + if (options.oneofs) + object._importCustomRoutes = "importCustomRoutes"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + return object; + }; + + /** + * Converts this NetworkPeering to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkPeering + * @instance + * @returns {Object.} JSON object + */ + NetworkPeering.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.compute.v1.NetworkPeering.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} INACTIVE=270421099 INACTIVE value + */ + NetworkPeering.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[270421099] = "INACTIVE"] = 270421099; + return values; + })(); + + return NetworkPeering; + })(); + + v1.NetworkRoutingConfig = (function() { + + /** + * Properties of a NetworkRoutingConfig. + * @memberof google.cloud.compute.v1 + * @interface INetworkRoutingConfig + * @property {google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode|null} [routingMode] NetworkRoutingConfig routingMode + */ + + /** + * Constructs a new NetworkRoutingConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkRoutingConfig. + * @implements INetworkRoutingConfig + * @constructor + * @param {google.cloud.compute.v1.INetworkRoutingConfig=} [properties] Properties to set + */ + function NetworkRoutingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkRoutingConfig routingMode. + * @member {google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode|null|undefined} routingMode + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @instance + */ + NetworkRoutingConfig.prototype.routingMode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkRoutingConfig _routingMode. + * @member {"routingMode"|undefined} _routingMode + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @instance + */ + Object.defineProperty(NetworkRoutingConfig.prototype, "_routingMode", { + get: $util.oneOfGetter($oneOfFields = ["routingMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkRoutingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {google.cloud.compute.v1.INetworkRoutingConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkRoutingConfig} NetworkRoutingConfig instance + */ + NetworkRoutingConfig.create = function create(properties) { + return new NetworkRoutingConfig(properties); + }; + + /** + * Encodes the specified NetworkRoutingConfig message. Does not implicitly {@link google.cloud.compute.v1.NetworkRoutingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {google.cloud.compute.v1.INetworkRoutingConfig} message NetworkRoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkRoutingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routingMode != null && Object.hasOwnProperty.call(message, "routingMode")) + writer.uint32(/* id 475143548, wireType 0 =*/3801148384).int32(message.routingMode); + return writer; + }; + + /** + * Encodes the specified NetworkRoutingConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkRoutingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {google.cloud.compute.v1.INetworkRoutingConfig} message NetworkRoutingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkRoutingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkRoutingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkRoutingConfig} NetworkRoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkRoutingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkRoutingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 475143548: + message.routingMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkRoutingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkRoutingConfig} NetworkRoutingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkRoutingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkRoutingConfig message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkRoutingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.routingMode != null && message.hasOwnProperty("routingMode")) { + properties._routingMode = 1; + switch (message.routingMode) { + default: + return "routingMode: enum value expected"; + case 0: + case 494663587: + case 92288543: + break; + } + } + return null; + }; + + /** + * Creates a NetworkRoutingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkRoutingConfig} NetworkRoutingConfig + */ + NetworkRoutingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkRoutingConfig) + return object; + var message = new $root.google.cloud.compute.v1.NetworkRoutingConfig(); + switch (object.routingMode) { + case "UNDEFINED_ROUTING_MODE": + case 0: + message.routingMode = 0; + break; + case "GLOBAL": + case 494663587: + message.routingMode = 494663587; + break; + case "REGIONAL": + case 92288543: + message.routingMode = 92288543; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkRoutingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @static + * @param {google.cloud.compute.v1.NetworkRoutingConfig} message NetworkRoutingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkRoutingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.routingMode != null && message.hasOwnProperty("routingMode")) { + object.routingMode = options.enums === String ? $root.google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode[message.routingMode] : message.routingMode; + if (options.oneofs) + object._routingMode = "routingMode"; + } + return object; + }; + + /** + * Converts this NetworkRoutingConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkRoutingConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkRoutingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * RoutingMode enum. + * @name google.cloud.compute.v1.NetworkRoutingConfig.RoutingMode + * @enum {number} + * @property {number} UNDEFINED_ROUTING_MODE=0 UNDEFINED_ROUTING_MODE value + * @property {number} GLOBAL=494663587 GLOBAL value + * @property {number} REGIONAL=92288543 REGIONAL value + */ + NetworkRoutingConfig.RoutingMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ROUTING_MODE"] = 0; + values[valuesById[494663587] = "GLOBAL"] = 494663587; + values[valuesById[92288543] = "REGIONAL"] = 92288543; + return values; + })(); + + return NetworkRoutingConfig; + })(); + + v1.Network = (function() { + + /** + * Properties of a Network. + * @memberof google.cloud.compute.v1 + * @interface INetwork + * @property {string|null} [IPv4Range] Network IPv4Range + * @property {boolean|null} [autoCreateSubnetworks] Network autoCreateSubnetworks + * @property {string|null} [creationTimestamp] Network creationTimestamp + * @property {string|null} [description] Network description + * @property {string|null} [gatewayIPv4] Network gatewayIPv4 + * @property {number|Long|null} [id] Network id + * @property {string|null} [kind] Network kind + * @property {number|null} [mtu] Network mtu + * @property {string|null} [name] Network name + * @property {Array.|null} [peerings] Network peerings + * @property {google.cloud.compute.v1.INetworkRoutingConfig|null} [routingConfig] Network routingConfig + * @property {string|null} [selfLink] Network selfLink + * @property {Array.|null} [subnetworks] Network subnetworks + */ + + /** + * Constructs a new Network. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Network. + * @implements INetwork + * @constructor + * @param {google.cloud.compute.v1.INetwork=} [properties] Properties to set + */ + function Network(properties) { + this.peerings = []; + this.subnetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Network IPv4Range. + * @member {string|null|undefined} IPv4Range + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.IPv4Range = null; + + /** + * Network autoCreateSubnetworks. + * @member {boolean|null|undefined} autoCreateSubnetworks + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.autoCreateSubnetworks = null; + + /** + * Network creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.creationTimestamp = null; + + /** + * Network description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.description = null; + + /** + * Network gatewayIPv4. + * @member {string|null|undefined} gatewayIPv4 + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.gatewayIPv4 = null; + + /** + * Network id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.id = null; + + /** + * Network kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.kind = null; + + /** + * Network mtu. + * @member {number|null|undefined} mtu + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.mtu = null; + + /** + * Network name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.name = null; + + /** + * Network peerings. + * @member {Array.} peerings + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.peerings = $util.emptyArray; + + /** + * Network routingConfig. + * @member {google.cloud.compute.v1.INetworkRoutingConfig|null|undefined} routingConfig + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.routingConfig = null; + + /** + * Network selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.selfLink = null; + + /** + * Network subnetworks. + * @member {Array.} subnetworks + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Network.prototype.subnetworks = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Network _IPv4Range. + * @member {"IPv4Range"|undefined} _IPv4Range + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_IPv4Range", { + get: $util.oneOfGetter($oneOfFields = ["IPv4Range"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _autoCreateSubnetworks. + * @member {"autoCreateSubnetworks"|undefined} _autoCreateSubnetworks + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_autoCreateSubnetworks", { + get: $util.oneOfGetter($oneOfFields = ["autoCreateSubnetworks"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _gatewayIPv4. + * @member {"gatewayIPv4"|undefined} _gatewayIPv4 + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_gatewayIPv4", { + get: $util.oneOfGetter($oneOfFields = ["gatewayIPv4"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _mtu. + * @member {"mtu"|undefined} _mtu + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_mtu", { + get: $util.oneOfGetter($oneOfFields = ["mtu"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _routingConfig. + * @member {"routingConfig"|undefined} _routingConfig + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_routingConfig", { + get: $util.oneOfGetter($oneOfFields = ["routingConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Network _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Network + * @instance + */ + Object.defineProperty(Network.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Network instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Network + * @static + * @param {google.cloud.compute.v1.INetwork=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Network} Network instance + */ + Network.create = function create(properties) { + return new Network(properties); + }; + + /** + * Encodes the specified Network message. Does not implicitly {@link google.cloud.compute.v1.Network.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Network + * @static + * @param {google.cloud.compute.v1.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.mtu != null && Object.hasOwnProperty.call(message, "mtu")) + writer.uint32(/* id 108462, wireType 0 =*/867696).int32(message.mtu); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.IPv4Range != null && Object.hasOwnProperty.call(message, "IPv4Range")) + writer.uint32(/* id 59234358, wireType 2 =*/473874866).string(message.IPv4Range); + if (message.peerings != null && message.peerings.length) + for (var i = 0; i < message.peerings.length; ++i) + $root.google.cloud.compute.v1.NetworkPeering.encode(message.peerings[i], writer.uint32(/* id 69883187, wireType 2 =*/559065498).fork()).ldelim(); + if (message.gatewayIPv4 != null && Object.hasOwnProperty.call(message, "gatewayIPv4")) + writer.uint32(/* id 178678877, wireType 2 =*/1429431018).string(message.gatewayIPv4); + if (message.autoCreateSubnetworks != null && Object.hasOwnProperty.call(message, "autoCreateSubnetworks")) + writer.uint32(/* id 256156690, wireType 0 =*/2049253520).bool(message.autoCreateSubnetworks); + if (message.subnetworks != null && message.subnetworks.length) + for (var i = 0; i < message.subnetworks.length; ++i) + writer.uint32(/* id 415853125, wireType 2 =*/3326825002).string(message.subnetworks[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.routingConfig != null && Object.hasOwnProperty.call(message, "routingConfig")) + $root.google.cloud.compute.v1.NetworkRoutingConfig.encode(message.routingConfig, writer.uint32(/* id 523556059, wireType 2 =*/4188448474).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Network message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Network.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Network + * @static + * @param {google.cloud.compute.v1.INetwork} message Network message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Network.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Network message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Network(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 59234358: + message.IPv4Range = reader.string(); + break; + case 256156690: + message.autoCreateSubnetworks = reader.bool(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 178678877: + message.gatewayIPv4 = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 108462: + message.mtu = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 69883187: + if (!(message.peerings && message.peerings.length)) + message.peerings = []; + message.peerings.push($root.google.cloud.compute.v1.NetworkPeering.decode(reader, reader.uint32())); + break; + case 523556059: + message.routingConfig = $root.google.cloud.compute.v1.NetworkRoutingConfig.decode(reader, reader.uint32()); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 415853125: + if (!(message.subnetworks && message.subnetworks.length)) + message.subnetworks = []; + message.subnetworks.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Network message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Network + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Network} Network + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Network.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Network message. + * @function verify + * @memberof google.cloud.compute.v1.Network + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Network.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.IPv4Range != null && message.hasOwnProperty("IPv4Range")) { + properties._IPv4Range = 1; + if (!$util.isString(message.IPv4Range)) + return "IPv4Range: string expected"; + } + if (message.autoCreateSubnetworks != null && message.hasOwnProperty("autoCreateSubnetworks")) { + properties._autoCreateSubnetworks = 1; + if (typeof message.autoCreateSubnetworks !== "boolean") + return "autoCreateSubnetworks: boolean expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.gatewayIPv4 != null && message.hasOwnProperty("gatewayIPv4")) { + properties._gatewayIPv4 = 1; + if (!$util.isString(message.gatewayIPv4)) + return "gatewayIPv4: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.mtu != null && message.hasOwnProperty("mtu")) { + properties._mtu = 1; + if (!$util.isInteger(message.mtu)) + return "mtu: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.peerings != null && message.hasOwnProperty("peerings")) { + if (!Array.isArray(message.peerings)) + return "peerings: array expected"; + for (var i = 0; i < message.peerings.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkPeering.verify(message.peerings[i]); + if (error) + return "peerings." + error; + } + } + if (message.routingConfig != null && message.hasOwnProperty("routingConfig")) { + properties._routingConfig = 1; + { + var error = $root.google.cloud.compute.v1.NetworkRoutingConfig.verify(message.routingConfig); + if (error) + return "routingConfig." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.subnetworks != null && message.hasOwnProperty("subnetworks")) { + if (!Array.isArray(message.subnetworks)) + return "subnetworks: array expected"; + for (var i = 0; i < message.subnetworks.length; ++i) + if (!$util.isString(message.subnetworks[i])) + return "subnetworks: string[] expected"; + } + return null; + }; + + /** + * Creates a Network message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Network + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Network} Network + */ + Network.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Network) + return object; + var message = new $root.google.cloud.compute.v1.Network(); + if (object.IPv4Range != null) + message.IPv4Range = String(object.IPv4Range); + if (object.autoCreateSubnetworks != null) + message.autoCreateSubnetworks = Boolean(object.autoCreateSubnetworks); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.gatewayIPv4 != null) + message.gatewayIPv4 = String(object.gatewayIPv4); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.mtu != null) + message.mtu = object.mtu | 0; + if (object.name != null) + message.name = String(object.name); + if (object.peerings) { + if (!Array.isArray(object.peerings)) + throw TypeError(".google.cloud.compute.v1.Network.peerings: array expected"); + message.peerings = []; + for (var i = 0; i < object.peerings.length; ++i) { + if (typeof object.peerings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Network.peerings: object expected"); + message.peerings[i] = $root.google.cloud.compute.v1.NetworkPeering.fromObject(object.peerings[i]); + } + } + if (object.routingConfig != null) { + if (typeof object.routingConfig !== "object") + throw TypeError(".google.cloud.compute.v1.Network.routingConfig: object expected"); + message.routingConfig = $root.google.cloud.compute.v1.NetworkRoutingConfig.fromObject(object.routingConfig); + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.subnetworks) { + if (!Array.isArray(object.subnetworks)) + throw TypeError(".google.cloud.compute.v1.Network.subnetworks: array expected"); + message.subnetworks = []; + for (var i = 0; i < object.subnetworks.length; ++i) + message.subnetworks[i] = String(object.subnetworks[i]); + } + return message; + }; + + /** + * Creates a plain object from a Network message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Network + * @static + * @param {google.cloud.compute.v1.Network} message Network + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Network.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.peerings = []; + object.subnetworks = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.mtu != null && message.hasOwnProperty("mtu")) { + object.mtu = message.mtu; + if (options.oneofs) + object._mtu = "mtu"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.IPv4Range != null && message.hasOwnProperty("IPv4Range")) { + object.IPv4Range = message.IPv4Range; + if (options.oneofs) + object._IPv4Range = "IPv4Range"; + } + if (message.peerings && message.peerings.length) { + object.peerings = []; + for (var j = 0; j < message.peerings.length; ++j) + object.peerings[j] = $root.google.cloud.compute.v1.NetworkPeering.toObject(message.peerings[j], options); + } + if (message.gatewayIPv4 != null && message.hasOwnProperty("gatewayIPv4")) { + object.gatewayIPv4 = message.gatewayIPv4; + if (options.oneofs) + object._gatewayIPv4 = "gatewayIPv4"; + } + if (message.autoCreateSubnetworks != null && message.hasOwnProperty("autoCreateSubnetworks")) { + object.autoCreateSubnetworks = message.autoCreateSubnetworks; + if (options.oneofs) + object._autoCreateSubnetworks = "autoCreateSubnetworks"; + } + if (message.subnetworks && message.subnetworks.length) { + object.subnetworks = []; + for (var j = 0; j < message.subnetworks.length; ++j) + object.subnetworks[j] = message.subnetworks[j]; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.routingConfig != null && message.hasOwnProperty("routingConfig")) { + object.routingConfig = $root.google.cloud.compute.v1.NetworkRoutingConfig.toObject(message.routingConfig, options); + if (options.oneofs) + object._routingConfig = "routingConfig"; + } + return object; + }; + + /** + * Converts this Network to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Network + * @instance + * @returns {Object.} JSON object + */ + Network.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Network; + })(); + + v1.NetworkEndpointGroupAppEngine = (function() { + + /** + * Properties of a NetworkEndpointGroupAppEngine. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupAppEngine + * @property {string|null} [service] NetworkEndpointGroupAppEngine service + * @property {string|null} [urlMask] NetworkEndpointGroupAppEngine urlMask + * @property {string|null} [version] NetworkEndpointGroupAppEngine version + */ + + /** + * Constructs a new NetworkEndpointGroupAppEngine. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupAppEngine. + * @implements INetworkEndpointGroupAppEngine + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupAppEngine=} [properties] Properties to set + */ + function NetworkEndpointGroupAppEngine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupAppEngine service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @instance + */ + NetworkEndpointGroupAppEngine.prototype.service = null; + + /** + * NetworkEndpointGroupAppEngine urlMask. + * @member {string|null|undefined} urlMask + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @instance + */ + NetworkEndpointGroupAppEngine.prototype.urlMask = null; + + /** + * NetworkEndpointGroupAppEngine version. + * @member {string|null|undefined} version + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @instance + */ + NetworkEndpointGroupAppEngine.prototype.version = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupAppEngine _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAppEngine.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupAppEngine _urlMask. + * @member {"urlMask"|undefined} _urlMask + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAppEngine.prototype, "_urlMask", { + get: $util.oneOfGetter($oneOfFields = ["urlMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupAppEngine _version. + * @member {"version"|undefined} _version + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAppEngine.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupAppEngine instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupAppEngine=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAppEngine} NetworkEndpointGroupAppEngine instance + */ + NetworkEndpointGroupAppEngine.create = function create(properties) { + return new NetworkEndpointGroupAppEngine(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupAppEngine message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAppEngine.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupAppEngine} message NetworkEndpointGroupAppEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupAppEngine.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.urlMask != null && Object.hasOwnProperty.call(message, "urlMask")) + writer.uint32(/* id 103352252, wireType 2 =*/826818018).string(message.urlMask); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 351608024, wireType 2 =*/2812864194).string(message.version); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupAppEngine message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAppEngine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupAppEngine} message NetworkEndpointGroupAppEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupAppEngine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupAppEngine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAppEngine} NetworkEndpointGroupAppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupAppEngine.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 373540533: + message.service = reader.string(); + break; + case 103352252: + message.urlMask = reader.string(); + break; + case 351608024: + message.version = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupAppEngine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAppEngine} NetworkEndpointGroupAppEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupAppEngine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupAppEngine message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupAppEngine.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + if (message.urlMask != null && message.hasOwnProperty("urlMask")) { + properties._urlMask = 1; + if (!$util.isString(message.urlMask)) + return "urlMask: string expected"; + } + if (message.version != null && message.hasOwnProperty("version")) { + properties._version = 1; + if (!$util.isString(message.version)) + return "version: string expected"; + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupAppEngine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAppEngine} NetworkEndpointGroupAppEngine + */ + NetworkEndpointGroupAppEngine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine(); + if (object.service != null) + message.service = String(object.service); + if (object.urlMask != null) + message.urlMask = String(object.urlMask); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupAppEngine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupAppEngine} message NetworkEndpointGroupAppEngine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupAppEngine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.urlMask != null && message.hasOwnProperty("urlMask")) { + object.urlMask = message.urlMask; + if (options.oneofs) + object._urlMask = "urlMask"; + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = message.version; + if (options.oneofs) + object._version = "version"; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupAppEngine to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAppEngine + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupAppEngine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupAppEngine; + })(); + + v1.NetworkEndpointGroupCloudFunction = (function() { + + /** + * Properties of a NetworkEndpointGroupCloudFunction. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupCloudFunction + * @property {string|null} ["function"] NetworkEndpointGroupCloudFunction function + * @property {string|null} [urlMask] NetworkEndpointGroupCloudFunction urlMask + */ + + /** + * Constructs a new NetworkEndpointGroupCloudFunction. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupCloudFunction. + * @implements INetworkEndpointGroupCloudFunction + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudFunction=} [properties] Properties to set + */ + function NetworkEndpointGroupCloudFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupCloudFunction function. + * @member {string|null|undefined} function + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @instance + */ + NetworkEndpointGroupCloudFunction.prototype["function"] = null; + + /** + * NetworkEndpointGroupCloudFunction urlMask. + * @member {string|null|undefined} urlMask + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @instance + */ + NetworkEndpointGroupCloudFunction.prototype.urlMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupCloudFunction _function. + * @member {"function"|undefined} _function + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @instance + */ + Object.defineProperty(NetworkEndpointGroupCloudFunction.prototype, "_function", { + get: $util.oneOfGetter($oneOfFields = ["function"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupCloudFunction _urlMask. + * @member {"urlMask"|undefined} _urlMask + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @instance + */ + Object.defineProperty(NetworkEndpointGroupCloudFunction.prototype, "_urlMask", { + get: $util.oneOfGetter($oneOfFields = ["urlMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupCloudFunction instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudFunction=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudFunction} NetworkEndpointGroupCloudFunction instance + */ + NetworkEndpointGroupCloudFunction.create = function create(properties) { + return new NetworkEndpointGroupCloudFunction(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupCloudFunction message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudFunction} message NetworkEndpointGroupCloudFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupCloudFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.urlMask != null && Object.hasOwnProperty.call(message, "urlMask")) + writer.uint32(/* id 103352252, wireType 2 =*/826818018).string(message.urlMask); + if (message["function"] != null && Object.hasOwnProperty.call(message, "function")) + writer.uint32(/* id 307196888, wireType 2 =*/2457575106).string(message["function"]); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupCloudFunction message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudFunction} message NetworkEndpointGroupCloudFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupCloudFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupCloudFunction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudFunction} NetworkEndpointGroupCloudFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupCloudFunction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 307196888: + message["function"] = reader.string(); + break; + case 103352252: + message.urlMask = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupCloudFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudFunction} NetworkEndpointGroupCloudFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupCloudFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupCloudFunction message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupCloudFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message["function"] != null && message.hasOwnProperty("function")) { + properties._function = 1; + if (!$util.isString(message["function"])) + return "function: string expected"; + } + if (message.urlMask != null && message.hasOwnProperty("urlMask")) { + properties._urlMask = 1; + if (!$util.isString(message.urlMask)) + return "urlMask: string expected"; + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupCloudFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudFunction} NetworkEndpointGroupCloudFunction + */ + NetworkEndpointGroupCloudFunction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction(); + if (object["function"] != null) + message["function"] = String(object["function"]); + if (object.urlMask != null) + message.urlMask = String(object.urlMask); + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupCloudFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupCloudFunction} message NetworkEndpointGroupCloudFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupCloudFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.urlMask != null && message.hasOwnProperty("urlMask")) { + object.urlMask = message.urlMask; + if (options.oneofs) + object._urlMask = "urlMask"; + } + if (message["function"] != null && message.hasOwnProperty("function")) { + object["function"] = message["function"]; + if (options.oneofs) + object._function = "function"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupCloudFunction to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudFunction + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupCloudFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupCloudFunction; + })(); + + v1.NetworkEndpointGroupCloudRun = (function() { + + /** + * Properties of a NetworkEndpointGroupCloudRun. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupCloudRun + * @property {string|null} [service] NetworkEndpointGroupCloudRun service + * @property {string|null} [tag] NetworkEndpointGroupCloudRun tag + * @property {string|null} [urlMask] NetworkEndpointGroupCloudRun urlMask + */ + + /** + * Constructs a new NetworkEndpointGroupCloudRun. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupCloudRun. + * @implements INetworkEndpointGroupCloudRun + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudRun=} [properties] Properties to set + */ + function NetworkEndpointGroupCloudRun(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupCloudRun service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @instance + */ + NetworkEndpointGroupCloudRun.prototype.service = null; + + /** + * NetworkEndpointGroupCloudRun tag. + * @member {string|null|undefined} tag + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @instance + */ + NetworkEndpointGroupCloudRun.prototype.tag = null; + + /** + * NetworkEndpointGroupCloudRun urlMask. + * @member {string|null|undefined} urlMask + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @instance + */ + NetworkEndpointGroupCloudRun.prototype.urlMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupCloudRun _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @instance + */ + Object.defineProperty(NetworkEndpointGroupCloudRun.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupCloudRun _tag. + * @member {"tag"|undefined} _tag + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @instance + */ + Object.defineProperty(NetworkEndpointGroupCloudRun.prototype, "_tag", { + get: $util.oneOfGetter($oneOfFields = ["tag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupCloudRun _urlMask. + * @member {"urlMask"|undefined} _urlMask + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @instance + */ + Object.defineProperty(NetworkEndpointGroupCloudRun.prototype, "_urlMask", { + get: $util.oneOfGetter($oneOfFields = ["urlMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupCloudRun instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudRun=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudRun} NetworkEndpointGroupCloudRun instance + */ + NetworkEndpointGroupCloudRun.create = function create(properties) { + return new NetworkEndpointGroupCloudRun(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupCloudRun message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudRun} message NetworkEndpointGroupCloudRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupCloudRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) + writer.uint32(/* id 114586, wireType 2 =*/916690).string(message.tag); + if (message.urlMask != null && Object.hasOwnProperty.call(message, "urlMask")) + writer.uint32(/* id 103352252, wireType 2 =*/826818018).string(message.urlMask); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupCloudRun message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupCloudRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupCloudRun} message NetworkEndpointGroupCloudRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupCloudRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupCloudRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudRun} NetworkEndpointGroupCloudRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupCloudRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 373540533: + message.service = reader.string(); + break; + case 114586: + message.tag = reader.string(); + break; + case 103352252: + message.urlMask = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupCloudRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudRun} NetworkEndpointGroupCloudRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupCloudRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupCloudRun message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupCloudRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + if (message.tag != null && message.hasOwnProperty("tag")) { + properties._tag = 1; + if (!$util.isString(message.tag)) + return "tag: string expected"; + } + if (message.urlMask != null && message.hasOwnProperty("urlMask")) { + properties._urlMask = 1; + if (!$util.isString(message.urlMask)) + return "urlMask: string expected"; + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupCloudRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupCloudRun} NetworkEndpointGroupCloudRun + */ + NetworkEndpointGroupCloudRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun(); + if (object.service != null) + message.service = String(object.service); + if (object.tag != null) + message.tag = String(object.tag); + if (object.urlMask != null) + message.urlMask = String(object.urlMask); + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupCloudRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupCloudRun} message NetworkEndpointGroupCloudRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupCloudRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tag != null && message.hasOwnProperty("tag")) { + object.tag = message.tag; + if (options.oneofs) + object._tag = "tag"; + } + if (message.urlMask != null && message.hasOwnProperty("urlMask")) { + object.urlMask = message.urlMask; + if (options.oneofs) + object._urlMask = "urlMask"; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupCloudRun to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupCloudRun + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupCloudRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupCloudRun; + })(); + + v1.NetworkEndpointGroup = (function() { + + /** + * Properties of a NetworkEndpointGroup. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroup + * @property {Object.|null} [annotations] NetworkEndpointGroup annotations + * @property {google.cloud.compute.v1.INetworkEndpointGroupAppEngine|null} [appEngine] NetworkEndpointGroup appEngine + * @property {google.cloud.compute.v1.INetworkEndpointGroupCloudFunction|null} [cloudFunction] NetworkEndpointGroup cloudFunction + * @property {google.cloud.compute.v1.INetworkEndpointGroupCloudRun|null} [cloudRun] NetworkEndpointGroup cloudRun + * @property {string|null} [creationTimestamp] NetworkEndpointGroup creationTimestamp + * @property {number|null} [defaultPort] NetworkEndpointGroup defaultPort + * @property {string|null} [description] NetworkEndpointGroup description + * @property {number|Long|null} [id] NetworkEndpointGroup id + * @property {string|null} [kind] NetworkEndpointGroup kind + * @property {string|null} [name] NetworkEndpointGroup name + * @property {string|null} [network] NetworkEndpointGroup network + * @property {google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType|null} [networkEndpointType] NetworkEndpointGroup networkEndpointType + * @property {string|null} [region] NetworkEndpointGroup region + * @property {string|null} [selfLink] NetworkEndpointGroup selfLink + * @property {number|null} [size] NetworkEndpointGroup size + * @property {string|null} [subnetwork] NetworkEndpointGroup subnetwork + * @property {string|null} [zone] NetworkEndpointGroup zone + */ + + /** + * Constructs a new NetworkEndpointGroup. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroup. + * @implements INetworkEndpointGroup + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroup=} [properties] Properties to set + */ + function NetworkEndpointGroup(properties) { + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroup annotations. + * @member {Object.} annotations + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.annotations = $util.emptyObject; + + /** + * NetworkEndpointGroup appEngine. + * @member {google.cloud.compute.v1.INetworkEndpointGroupAppEngine|null|undefined} appEngine + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.appEngine = null; + + /** + * NetworkEndpointGroup cloudFunction. + * @member {google.cloud.compute.v1.INetworkEndpointGroupCloudFunction|null|undefined} cloudFunction + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.cloudFunction = null; + + /** + * NetworkEndpointGroup cloudRun. + * @member {google.cloud.compute.v1.INetworkEndpointGroupCloudRun|null|undefined} cloudRun + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.cloudRun = null; + + /** + * NetworkEndpointGroup creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.creationTimestamp = null; + + /** + * NetworkEndpointGroup defaultPort. + * @member {number|null|undefined} defaultPort + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.defaultPort = null; + + /** + * NetworkEndpointGroup description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.description = null; + + /** + * NetworkEndpointGroup id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.id = null; + + /** + * NetworkEndpointGroup kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.kind = null; + + /** + * NetworkEndpointGroup name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.name = null; + + /** + * NetworkEndpointGroup network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.network = null; + + /** + * NetworkEndpointGroup networkEndpointType. + * @member {google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType|null|undefined} networkEndpointType + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.networkEndpointType = null; + + /** + * NetworkEndpointGroup region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.region = null; + + /** + * NetworkEndpointGroup selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.selfLink = null; + + /** + * NetworkEndpointGroup size. + * @member {number|null|undefined} size + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.size = null; + + /** + * NetworkEndpointGroup subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.subnetwork = null; + + /** + * NetworkEndpointGroup zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + NetworkEndpointGroup.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroup _appEngine. + * @member {"appEngine"|undefined} _appEngine + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_appEngine", { + get: $util.oneOfGetter($oneOfFields = ["appEngine"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _cloudFunction. + * @member {"cloudFunction"|undefined} _cloudFunction + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_cloudFunction", { + get: $util.oneOfGetter($oneOfFields = ["cloudFunction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _cloudRun. + * @member {"cloudRun"|undefined} _cloudRun + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_cloudRun", { + get: $util.oneOfGetter($oneOfFields = ["cloudRun"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _defaultPort. + * @member {"defaultPort"|undefined} _defaultPort + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_defaultPort", { + get: $util.oneOfGetter($oneOfFields = ["defaultPort"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _networkEndpointType. + * @member {"networkEndpointType"|undefined} _networkEndpointType + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_networkEndpointType", { + get: $util.oneOfGetter($oneOfFields = ["networkEndpointType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _size. + * @member {"size"|undefined} _size + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_size", { + get: $util.oneOfGetter($oneOfFields = ["size"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroup _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + */ + Object.defineProperty(NetworkEndpointGroup.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroup instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroup=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroup} NetworkEndpointGroup instance + */ + NetworkEndpointGroup.create = function create(properties) { + return new NetworkEndpointGroup(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroup message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroup} message NetworkEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 3530753, wireType 0 =*/28246024).int32(message.size); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.cloudRun != null && Object.hasOwnProperty.call(message, "cloudRun")) + $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun.encode(message.cloudRun, writer.uint32(/* id 111060353, wireType 2 =*/888482826).fork()).ldelim(); + 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 112032548, wireType 2 =*/896260386).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.networkEndpointType != null && Object.hasOwnProperty.call(message, "networkEndpointType")) + writer.uint32(/* id 118301523, wireType 0 =*/946412184).int32(message.networkEndpointType); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + if (message.appEngine != null && Object.hasOwnProperty.call(message, "appEngine")) + $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine.encode(message.appEngine, writer.uint32(/* id 340788768, wireType 2 =*/2726310146).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.defaultPort != null && Object.hasOwnProperty.call(message, "defaultPort")) + writer.uint32(/* id 423377855, wireType 0 =*/3387022840).int32(message.defaultPort); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.cloudFunction != null && Object.hasOwnProperty.call(message, "cloudFunction")) + $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.encode(message.cloudFunction, writer.uint32(/* id 519893666, wireType 2 =*/4159149330).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroup message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroup} message NetworkEndpointGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroup} NetworkEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 112032548: + 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 340788768: + message.appEngine = $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine.decode(reader, reader.uint32()); + break; + case 519893666: + message.cloudFunction = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.decode(reader, reader.uint32()); + break; + case 111060353: + message.cloudRun = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun.decode(reader, reader.uint32()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 423377855: + message.defaultPort = reader.int32(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 118301523: + message.networkEndpointType = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3530753: + message.size = reader.int32(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroup} NetworkEndpointGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroup message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.appEngine != null && message.hasOwnProperty("appEngine")) { + properties._appEngine = 1; + { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine.verify(message.appEngine); + if (error) + return "appEngine." + error; + } + } + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) { + properties._cloudFunction = 1; + { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.verify(message.cloudFunction); + if (error) + return "cloudFunction." + error; + } + } + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) { + properties._cloudRun = 1; + { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun.verify(message.cloudRun); + if (error) + return "cloudRun." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.defaultPort != null && message.hasOwnProperty("defaultPort")) { + properties._defaultPort = 1; + if (!$util.isInteger(message.defaultPort)) + return "defaultPort: integer expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.networkEndpointType != null && message.hasOwnProperty("networkEndpointType")) { + properties._networkEndpointType = 1; + switch (message.networkEndpointType) { + default: + return "networkEndpointType: enum value expected"; + case 0: + case 401880793: + case 501838375: + case 404154477: + case 477719963: + case 336447968: + case 270492508: + break; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.size != null && message.hasOwnProperty("size")) { + properties._size = 1; + if (!$util.isInteger(message.size)) + return "size: integer expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a NetworkEndpointGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroup} NetworkEndpointGroup + */ + NetworkEndpointGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroup) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroup(); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroup.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.appEngine != null) { + if (typeof object.appEngine !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroup.appEngine: object expected"); + message.appEngine = $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine.fromObject(object.appEngine); + } + if (object.cloudFunction != null) { + if (typeof object.cloudFunction !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroup.cloudFunction: object expected"); + message.cloudFunction = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.fromObject(object.cloudFunction); + } + if (object.cloudRun != null) { + if (typeof object.cloudRun !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroup.cloudRun: object expected"); + message.cloudRun = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun.fromObject(object.cloudRun); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.defaultPort != null) + message.defaultPort = object.defaultPort | 0; + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + switch (object.networkEndpointType) { + case "UNDEFINED_NETWORK_ENDPOINT_TYPE": + case 0: + message.networkEndpointType = 0; + break; + case "GCE_VM_IP": + case 401880793: + message.networkEndpointType = 401880793; + break; + case "GCE_VM_IP_PORT": + case 501838375: + message.networkEndpointType = 501838375; + break; + case "INTERNET_FQDN_PORT": + case 404154477: + message.networkEndpointType = 404154477; + break; + case "INTERNET_IP_PORT": + case 477719963: + message.networkEndpointType = 477719963; + break; + case "NON_GCP_PRIVATE_IP_PORT": + case 336447968: + message.networkEndpointType = 336447968; + break; + case "SERVERLESS": + case 270492508: + message.networkEndpointType = 270492508; + break; + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.size != null) + message.size = object.size | 0; + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroup} message NetworkEndpointGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.annotations = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.size != null && message.hasOwnProperty("size")) { + object.size = message.size; + if (options.oneofs) + object._size = "size"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.cloudRun != null && message.hasOwnProperty("cloudRun")) { + object.cloudRun = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudRun.toObject(message.cloudRun, options); + if (options.oneofs) + object._cloudRun = "cloudRun"; + } + 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.networkEndpointType != null && message.hasOwnProperty("networkEndpointType")) { + object.networkEndpointType = options.enums === String ? $root.google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType[message.networkEndpointType] : message.networkEndpointType; + if (options.oneofs) + object._networkEndpointType = "networkEndpointType"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.appEngine != null && message.hasOwnProperty("appEngine")) { + object.appEngine = $root.google.cloud.compute.v1.NetworkEndpointGroupAppEngine.toObject(message.appEngine, options); + if (options.oneofs) + object._appEngine = "appEngine"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.defaultPort != null && message.hasOwnProperty("defaultPort")) { + object.defaultPort = message.defaultPort; + if (options.oneofs) + object._defaultPort = "defaultPort"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.cloudFunction != null && message.hasOwnProperty("cloudFunction")) { + object.cloudFunction = $root.google.cloud.compute.v1.NetworkEndpointGroupCloudFunction.toObject(message.cloudFunction, options); + if (options.oneofs) + object._cloudFunction = "cloudFunction"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroup to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroup + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * NetworkEndpointType enum. + * @name google.cloud.compute.v1.NetworkEndpointGroup.NetworkEndpointType + * @enum {number} + * @property {number} UNDEFINED_NETWORK_ENDPOINT_TYPE=0 UNDEFINED_NETWORK_ENDPOINT_TYPE value + * @property {number} GCE_VM_IP=401880793 GCE_VM_IP value + * @property {number} GCE_VM_IP_PORT=501838375 GCE_VM_IP_PORT value + * @property {number} INTERNET_FQDN_PORT=404154477 INTERNET_FQDN_PORT value + * @property {number} INTERNET_IP_PORT=477719963 INTERNET_IP_PORT value + * @property {number} NON_GCP_PRIVATE_IP_PORT=336447968 NON_GCP_PRIVATE_IP_PORT value + * @property {number} SERVERLESS=270492508 SERVERLESS value + */ + NetworkEndpointGroup.NetworkEndpointType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NETWORK_ENDPOINT_TYPE"] = 0; + values[valuesById[401880793] = "GCE_VM_IP"] = 401880793; + values[valuesById[501838375] = "GCE_VM_IP_PORT"] = 501838375; + values[valuesById[404154477] = "INTERNET_FQDN_PORT"] = 404154477; + values[valuesById[477719963] = "INTERNET_IP_PORT"] = 477719963; + values[valuesById[336447968] = "NON_GCP_PRIVATE_IP_PORT"] = 336447968; + values[valuesById[270492508] = "SERVERLESS"] = 270492508; + return values; + })(); + + return NetworkEndpointGroup; + })(); + + v1.NetworkEndpointGroupsScopedList = (function() { + + /** + * Properties of a NetworkEndpointGroupsScopedList. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupsScopedList + * @property {Array.|null} [networkEndpointGroups] NetworkEndpointGroupsScopedList networkEndpointGroups + * @property {google.cloud.compute.v1.IWarning|null} [warning] NetworkEndpointGroupsScopedList warning + */ + + /** + * Constructs a new NetworkEndpointGroupsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupsScopedList. + * @implements INetworkEndpointGroupsScopedList + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupsScopedList=} [properties] Properties to set + */ + function NetworkEndpointGroupsScopedList(properties) { + this.networkEndpointGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupsScopedList networkEndpointGroups. + * @member {Array.} networkEndpointGroups + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @instance + */ + NetworkEndpointGroupsScopedList.prototype.networkEndpointGroups = $util.emptyArray; + + /** + * NetworkEndpointGroupsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @instance + */ + NetworkEndpointGroupsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsScopedList} NetworkEndpointGroupsScopedList instance + */ + NetworkEndpointGroupsScopedList.create = function create(properties) { + return new NetworkEndpointGroupsScopedList(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupsScopedList message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsScopedList} message NetworkEndpointGroupsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkEndpointGroups != null && message.networkEndpointGroups.length) + for (var i = 0; i < message.networkEndpointGroups.length; ++i) + $root.google.cloud.compute.v1.NetworkEndpointGroup.encode(message.networkEndpointGroups[i], writer.uint32(/* id 29346733, wireType 2 =*/234773866).fork()).ldelim(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsScopedList} message NetworkEndpointGroupsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsScopedList} NetworkEndpointGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29346733: + if (!(message.networkEndpointGroups && message.networkEndpointGroups.length)) + message.networkEndpointGroups = []; + message.networkEndpointGroups.push($root.google.cloud.compute.v1.NetworkEndpointGroup.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsScopedList} NetworkEndpointGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroups != null && message.hasOwnProperty("networkEndpointGroups")) { + if (!Array.isArray(message.networkEndpointGroups)) + return "networkEndpointGroups: array expected"; + for (var i = 0; i < message.networkEndpointGroups.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroup.verify(message.networkEndpointGroups[i]); + if (error) + return "networkEndpointGroups." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsScopedList} NetworkEndpointGroupsScopedList + */ + NetworkEndpointGroupsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsScopedList(); + if (object.networkEndpointGroups) { + if (!Array.isArray(object.networkEndpointGroups)) + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsScopedList.networkEndpointGroups: array expected"); + message.networkEndpointGroups = []; + for (var i = 0; i < object.networkEndpointGroups.length; ++i) { + if (typeof object.networkEndpointGroups[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsScopedList.networkEndpointGroups: object expected"); + message.networkEndpointGroups[i] = $root.google.cloud.compute.v1.NetworkEndpointGroup.fromObject(object.networkEndpointGroups[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupsScopedList} message NetworkEndpointGroupsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkEndpointGroups = []; + if (message.networkEndpointGroups && message.networkEndpointGroups.length) { + object.networkEndpointGroups = []; + for (var j = 0; j < message.networkEndpointGroups.length; ++j) + object.networkEndpointGroups[j] = $root.google.cloud.compute.v1.NetworkEndpointGroup.toObject(message.networkEndpointGroups[j], options); + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsScopedList + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupsScopedList; + })(); + + v1.NetworkEndpointGroupAggregatedList = (function() { + + /** + * Properties of a NetworkEndpointGroupAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupAggregatedList + * @property {string|null} [id] NetworkEndpointGroupAggregatedList id + * @property {Object.|null} [items] NetworkEndpointGroupAggregatedList items + * @property {string|null} [kind] NetworkEndpointGroupAggregatedList kind + * @property {string|null} [nextPageToken] NetworkEndpointGroupAggregatedList nextPageToken + * @property {string|null} [selfLink] NetworkEndpointGroupAggregatedList selfLink + * @property {Array.|null} [unreachables] NetworkEndpointGroupAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] NetworkEndpointGroupAggregatedList warning + */ + + /** + * Constructs a new NetworkEndpointGroupAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupAggregatedList. + * @implements INetworkEndpointGroupAggregatedList + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupAggregatedList=} [properties] Properties to set + */ + function NetworkEndpointGroupAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + NetworkEndpointGroupAggregatedList.prototype.id = null; + + /** + * NetworkEndpointGroupAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + NetworkEndpointGroupAggregatedList.prototype.items = $util.emptyObject; + + /** + * NetworkEndpointGroupAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + NetworkEndpointGroupAggregatedList.prototype.kind = null; + + /** + * NetworkEndpointGroupAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + NetworkEndpointGroupAggregatedList.prototype.nextPageToken = null; + + /** + * NetworkEndpointGroupAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + NetworkEndpointGroupAggregatedList.prototype.selfLink = null; + + /** + * NetworkEndpointGroupAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + NetworkEndpointGroupAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * NetworkEndpointGroupAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + NetworkEndpointGroupAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAggregatedList} NetworkEndpointGroupAggregatedList instance + */ + NetworkEndpointGroupAggregatedList.create = function create(properties) { + return new NetworkEndpointGroupAggregatedList(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupAggregatedList} message NetworkEndpointGroupAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.NetworkEndpointGroupsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupAggregatedList} message NetworkEndpointGroupAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAggregatedList} NetworkEndpointGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.NetworkEndpointGroupsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAggregatedList} NetworkEndpointGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroupsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupAggregatedList} NetworkEndpointGroupAggregatedList + */ + NetworkEndpointGroupAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.NetworkEndpointGroupsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupAggregatedList} message NetworkEndpointGroupAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.NetworkEndpointGroupsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupAggregatedList + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupAggregatedList; + })(); + + v1.NetworkEndpointGroupList = (function() { + + /** + * Properties of a NetworkEndpointGroupList. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupList + * @property {string|null} [id] NetworkEndpointGroupList id + * @property {Array.|null} [items] NetworkEndpointGroupList items + * @property {string|null} [kind] NetworkEndpointGroupList kind + * @property {string|null} [nextPageToken] NetworkEndpointGroupList nextPageToken + * @property {string|null} [selfLink] NetworkEndpointGroupList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] NetworkEndpointGroupList warning + */ + + /** + * Constructs a new NetworkEndpointGroupList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupList. + * @implements INetworkEndpointGroupList + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupList=} [properties] Properties to set + */ + function NetworkEndpointGroupList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + NetworkEndpointGroupList.prototype.id = null; + + /** + * NetworkEndpointGroupList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + NetworkEndpointGroupList.prototype.items = $util.emptyArray; + + /** + * NetworkEndpointGroupList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + NetworkEndpointGroupList.prototype.kind = null; + + /** + * NetworkEndpointGroupList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + NetworkEndpointGroupList.prototype.nextPageToken = null; + + /** + * NetworkEndpointGroupList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + NetworkEndpointGroupList.prototype.selfLink = null; + + /** + * NetworkEndpointGroupList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + NetworkEndpointGroupList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + */ + Object.defineProperty(NetworkEndpointGroupList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupList} NetworkEndpointGroupList instance + */ + NetworkEndpointGroupList.create = function create(properties) { + return new NetworkEndpointGroupList(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupList message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupList} message NetworkEndpointGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.NetworkEndpointGroup.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupList} message NetworkEndpointGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupList} NetworkEndpointGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.NetworkEndpointGroup.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupList} NetworkEndpointGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupList message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroup.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupList} NetworkEndpointGroupList + */ + NetworkEndpointGroupList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupList) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.NetworkEndpointGroup.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupList} message NetworkEndpointGroupList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.NetworkEndpointGroup.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupList + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupList; + })(); + + v1.NetworkEndpointGroupsAttachEndpointsRequest = (function() { + + /** + * Properties of a NetworkEndpointGroupsAttachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupsAttachEndpointsRequest + * @property {Array.|null} [networkEndpoints] NetworkEndpointGroupsAttachEndpointsRequest networkEndpoints + */ + + /** + * Constructs a new NetworkEndpointGroupsAttachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupsAttachEndpointsRequest. + * @implements INetworkEndpointGroupsAttachEndpointsRequest + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest=} [properties] Properties to set + */ + function NetworkEndpointGroupsAttachEndpointsRequest(properties) { + this.networkEndpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupsAttachEndpointsRequest networkEndpoints. + * @member {Array.} networkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @instance + */ + NetworkEndpointGroupsAttachEndpointsRequest.prototype.networkEndpoints = $util.emptyArray; + + /** + * Creates a new NetworkEndpointGroupsAttachEndpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest} NetworkEndpointGroupsAttachEndpointsRequest instance + */ + NetworkEndpointGroupsAttachEndpointsRequest.create = function create(properties) { + return new NetworkEndpointGroupsAttachEndpointsRequest(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupsAttachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest} message NetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsAttachEndpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkEndpoints != null && message.networkEndpoints.length) + for (var i = 0; i < message.networkEndpoints.length; ++i) + $root.google.cloud.compute.v1.NetworkEndpoint.encode(message.networkEndpoints[i], writer.uint32(/* id 149850285, wireType 2 =*/1198802282).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupsAttachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest} message NetworkEndpointGroupsAttachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsAttachEndpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest} NetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsAttachEndpointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 149850285: + if (!(message.networkEndpoints && message.networkEndpoints.length)) + message.networkEndpoints = []; + message.networkEndpoints.push($root.google.cloud.compute.v1.NetworkEndpoint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupsAttachEndpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest} NetworkEndpointGroupsAttachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsAttachEndpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupsAttachEndpointsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupsAttachEndpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkEndpoints != null && message.hasOwnProperty("networkEndpoints")) { + if (!Array.isArray(message.networkEndpoints)) + return "networkEndpoints: array expected"; + for (var i = 0; i < message.networkEndpoints.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpoint.verify(message.networkEndpoints[i]); + if (error) + return "networkEndpoints." + error; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupsAttachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest} NetworkEndpointGroupsAttachEndpointsRequest + */ + NetworkEndpointGroupsAttachEndpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest(); + if (object.networkEndpoints) { + if (!Array.isArray(object.networkEndpoints)) + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.networkEndpoints: array expected"); + message.networkEndpoints = []; + for (var i = 0; i < object.networkEndpoints.length; ++i) { + if (typeof object.networkEndpoints[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.networkEndpoints: object expected"); + message.networkEndpoints[i] = $root.google.cloud.compute.v1.NetworkEndpoint.fromObject(object.networkEndpoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupsAttachEndpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest} message NetworkEndpointGroupsAttachEndpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupsAttachEndpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkEndpoints = []; + if (message.networkEndpoints && message.networkEndpoints.length) { + object.networkEndpoints = []; + for (var j = 0; j < message.networkEndpoints.length; ++j) + object.networkEndpoints[j] = $root.google.cloud.compute.v1.NetworkEndpoint.toObject(message.networkEndpoints[j], options); + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupsAttachEndpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupsAttachEndpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupsAttachEndpointsRequest; + })(); + + v1.NetworkEndpointGroupsDetachEndpointsRequest = (function() { + + /** + * Properties of a NetworkEndpointGroupsDetachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupsDetachEndpointsRequest + * @property {Array.|null} [networkEndpoints] NetworkEndpointGroupsDetachEndpointsRequest networkEndpoints + */ + + /** + * Constructs a new NetworkEndpointGroupsDetachEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupsDetachEndpointsRequest. + * @implements INetworkEndpointGroupsDetachEndpointsRequest + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest=} [properties] Properties to set + */ + function NetworkEndpointGroupsDetachEndpointsRequest(properties) { + this.networkEndpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupsDetachEndpointsRequest networkEndpoints. + * @member {Array.} networkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @instance + */ + NetworkEndpointGroupsDetachEndpointsRequest.prototype.networkEndpoints = $util.emptyArray; + + /** + * Creates a new NetworkEndpointGroupsDetachEndpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest} NetworkEndpointGroupsDetachEndpointsRequest instance + */ + NetworkEndpointGroupsDetachEndpointsRequest.create = function create(properties) { + return new NetworkEndpointGroupsDetachEndpointsRequest(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupsDetachEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest} message NetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsDetachEndpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkEndpoints != null && message.networkEndpoints.length) + for (var i = 0; i < message.networkEndpoints.length; ++i) + $root.google.cloud.compute.v1.NetworkEndpoint.encode(message.networkEndpoints[i], writer.uint32(/* id 149850285, wireType 2 =*/1198802282).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupsDetachEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest} message NetworkEndpointGroupsDetachEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsDetachEndpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest} NetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsDetachEndpointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 149850285: + if (!(message.networkEndpoints && message.networkEndpoints.length)) + message.networkEndpoints = []; + message.networkEndpoints.push($root.google.cloud.compute.v1.NetworkEndpoint.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupsDetachEndpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest} NetworkEndpointGroupsDetachEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsDetachEndpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupsDetachEndpointsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupsDetachEndpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkEndpoints != null && message.hasOwnProperty("networkEndpoints")) { + if (!Array.isArray(message.networkEndpoints)) + return "networkEndpoints: array expected"; + for (var i = 0; i < message.networkEndpoints.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpoint.verify(message.networkEndpoints[i]); + if (error) + return "networkEndpoints." + error; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupsDetachEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest} NetworkEndpointGroupsDetachEndpointsRequest + */ + NetworkEndpointGroupsDetachEndpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest(); + if (object.networkEndpoints) { + if (!Array.isArray(object.networkEndpoints)) + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.networkEndpoints: array expected"); + message.networkEndpoints = []; + for (var i = 0; i < object.networkEndpoints.length; ++i) { + if (typeof object.networkEndpoints[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.networkEndpoints: object expected"); + message.networkEndpoints[i] = $root.google.cloud.compute.v1.NetworkEndpoint.fromObject(object.networkEndpoints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupsDetachEndpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest} message NetworkEndpointGroupsDetachEndpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupsDetachEndpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkEndpoints = []; + if (message.networkEndpoints && message.networkEndpoints.length) { + object.networkEndpoints = []; + for (var j = 0; j < message.networkEndpoints.length; ++j) + object.networkEndpoints[j] = $root.google.cloud.compute.v1.NetworkEndpoint.toObject(message.networkEndpoints[j], options); + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupsDetachEndpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupsDetachEndpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupsDetachEndpointsRequest; + })(); + + v1.NetworkEndpointGroupsListEndpointsRequest = (function() { + + /** + * Properties of a NetworkEndpointGroupsListEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupsListEndpointsRequest + * @property {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus|null} [healthStatus] NetworkEndpointGroupsListEndpointsRequest healthStatus + */ + + /** + * Constructs a new NetworkEndpointGroupsListEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupsListEndpointsRequest. + * @implements INetworkEndpointGroupsListEndpointsRequest + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest=} [properties] Properties to set + */ + function NetworkEndpointGroupsListEndpointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupsListEndpointsRequest healthStatus. + * @member {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus|null|undefined} healthStatus + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @instance + */ + NetworkEndpointGroupsListEndpointsRequest.prototype.healthStatus = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupsListEndpointsRequest _healthStatus. + * @member {"healthStatus"|undefined} _healthStatus + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @instance + */ + Object.defineProperty(NetworkEndpointGroupsListEndpointsRequest.prototype, "_healthStatus", { + get: $util.oneOfGetter($oneOfFields = ["healthStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupsListEndpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} NetworkEndpointGroupsListEndpointsRequest instance + */ + NetworkEndpointGroupsListEndpointsRequest.create = function create(properties) { + return new NetworkEndpointGroupsListEndpointsRequest(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupsListEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest} message NetworkEndpointGroupsListEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsListEndpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.healthStatus != null && Object.hasOwnProperty.call(message, "healthStatus")) + writer.uint32(/* id 380545845, wireType 0 =*/3044366760).int32(message.healthStatus); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupsListEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest} message NetworkEndpointGroupsListEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsListEndpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupsListEndpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} NetworkEndpointGroupsListEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsListEndpointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 380545845: + message.healthStatus = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupsListEndpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} NetworkEndpointGroupsListEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsListEndpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupsListEndpointsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupsListEndpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthStatus != null && message.hasOwnProperty("healthStatus")) { + properties._healthStatus = 1; + switch (message.healthStatus) { + default: + return "healthStatus: enum value expected"; + case 0: + case 2544381: + case 2547071: + break; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupsListEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} NetworkEndpointGroupsListEndpointsRequest + */ + NetworkEndpointGroupsListEndpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest(); + switch (object.healthStatus) { + case "UNDEFINED_HEALTH_STATUS": + case 0: + message.healthStatus = 0; + break; + case "SHOW": + case 2544381: + message.healthStatus = 2544381; + break; + case "SKIP": + case 2547071: + message.healthStatus = 2547071; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupsListEndpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} message NetworkEndpointGroupsListEndpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupsListEndpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.healthStatus != null && message.hasOwnProperty("healthStatus")) { + object.healthStatus = options.enums === String ? $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus[message.healthStatus] : message.healthStatus; + if (options.oneofs) + object._healthStatus = "healthStatus"; + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupsListEndpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupsListEndpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * HealthStatus enum. + * @name google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.HealthStatus + * @enum {number} + * @property {number} UNDEFINED_HEALTH_STATUS=0 UNDEFINED_HEALTH_STATUS value + * @property {number} SHOW=2544381 SHOW value + * @property {number} SKIP=2547071 SKIP value + */ + NetworkEndpointGroupsListEndpointsRequest.HealthStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_HEALTH_STATUS"] = 0; + values[valuesById[2544381] = "SHOW"] = 2544381; + values[valuesById[2547071] = "SKIP"] = 2547071; + return values; + })(); + + return NetworkEndpointGroupsListEndpointsRequest; + })(); + + v1.NetworkEndpointWithHealthStatus = (function() { + + /** + * Properties of a NetworkEndpointWithHealthStatus. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointWithHealthStatus + * @property {Array.|null} [healths] NetworkEndpointWithHealthStatus healths + * @property {google.cloud.compute.v1.INetworkEndpoint|null} [networkEndpoint] NetworkEndpointWithHealthStatus networkEndpoint + */ + + /** + * Constructs a new NetworkEndpointWithHealthStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointWithHealthStatus. + * @implements INetworkEndpointWithHealthStatus + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointWithHealthStatus=} [properties] Properties to set + */ + function NetworkEndpointWithHealthStatus(properties) { + this.healths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointWithHealthStatus healths. + * @member {Array.} healths + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @instance + */ + NetworkEndpointWithHealthStatus.prototype.healths = $util.emptyArray; + + /** + * NetworkEndpointWithHealthStatus networkEndpoint. + * @member {google.cloud.compute.v1.INetworkEndpoint|null|undefined} networkEndpoint + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @instance + */ + NetworkEndpointWithHealthStatus.prototype.networkEndpoint = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointWithHealthStatus _networkEndpoint. + * @member {"networkEndpoint"|undefined} _networkEndpoint + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @instance + */ + Object.defineProperty(NetworkEndpointWithHealthStatus.prototype, "_networkEndpoint", { + get: $util.oneOfGetter($oneOfFields = ["networkEndpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointWithHealthStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {google.cloud.compute.v1.INetworkEndpointWithHealthStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointWithHealthStatus} NetworkEndpointWithHealthStatus instance + */ + NetworkEndpointWithHealthStatus.create = function create(properties) { + return new NetworkEndpointWithHealthStatus(properties); + }; + + /** + * Encodes the specified NetworkEndpointWithHealthStatus message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {google.cloud.compute.v1.INetworkEndpointWithHealthStatus} message NetworkEndpointWithHealthStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointWithHealthStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkEndpoint != null && Object.hasOwnProperty.call(message, "networkEndpoint")) + $root.google.cloud.compute.v1.NetworkEndpoint.encode(message.networkEndpoint, writer.uint32(/* id 56789126, wireType 2 =*/454313010).fork()).ldelim(); + if (message.healths != null && message.healths.length) + for (var i = 0; i < message.healths.length; ++i) + $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint.encode(message.healths[i], writer.uint32(/* id 258689431, wireType 2 =*/2069515450).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointWithHealthStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {google.cloud.compute.v1.INetworkEndpointWithHealthStatus} message NetworkEndpointWithHealthStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointWithHealthStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointWithHealthStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointWithHealthStatus} NetworkEndpointWithHealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointWithHealthStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 258689431: + if (!(message.healths && message.healths.length)) + message.healths = []; + message.healths.push($root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint.decode(reader, reader.uint32())); + break; + case 56789126: + message.networkEndpoint = $root.google.cloud.compute.v1.NetworkEndpoint.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointWithHealthStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointWithHealthStatus} NetworkEndpointWithHealthStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointWithHealthStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointWithHealthStatus message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointWithHealthStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healths != null && message.hasOwnProperty("healths")) { + if (!Array.isArray(message.healths)) + return "healths: array expected"; + for (var i = 0; i < message.healths.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint.verify(message.healths[i]); + if (error) + return "healths." + error; + } + } + if (message.networkEndpoint != null && message.hasOwnProperty("networkEndpoint")) { + properties._networkEndpoint = 1; + { + var error = $root.google.cloud.compute.v1.NetworkEndpoint.verify(message.networkEndpoint); + if (error) + return "networkEndpoint." + error; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointWithHealthStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointWithHealthStatus} NetworkEndpointWithHealthStatus + */ + NetworkEndpointWithHealthStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus(); + if (object.healths) { + if (!Array.isArray(object.healths)) + throw TypeError(".google.cloud.compute.v1.NetworkEndpointWithHealthStatus.healths: array expected"); + message.healths = []; + for (var i = 0; i < object.healths.length; ++i) { + if (typeof object.healths[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointWithHealthStatus.healths: object expected"); + message.healths[i] = $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint.fromObject(object.healths[i]); + } + } + if (object.networkEndpoint != null) { + if (typeof object.networkEndpoint !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointWithHealthStatus.networkEndpoint: object expected"); + message.networkEndpoint = $root.google.cloud.compute.v1.NetworkEndpoint.fromObject(object.networkEndpoint); + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointWithHealthStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @static + * @param {google.cloud.compute.v1.NetworkEndpointWithHealthStatus} message NetworkEndpointWithHealthStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointWithHealthStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.healths = []; + if (message.networkEndpoint != null && message.hasOwnProperty("networkEndpoint")) { + object.networkEndpoint = $root.google.cloud.compute.v1.NetworkEndpoint.toObject(message.networkEndpoint, options); + if (options.oneofs) + object._networkEndpoint = "networkEndpoint"; + } + if (message.healths && message.healths.length) { + object.healths = []; + for (var j = 0; j < message.healths.length; ++j) + object.healths[j] = $root.google.cloud.compute.v1.HealthStatusForNetworkEndpoint.toObject(message.healths[j], options); + } + return object; + }; + + /** + * Converts this NetworkEndpointWithHealthStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointWithHealthStatus + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointWithHealthStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointWithHealthStatus; + })(); + + v1.NetworkEndpointGroupsListNetworkEndpoints = (function() { + + /** + * Properties of a NetworkEndpointGroupsListNetworkEndpoints. + * @memberof google.cloud.compute.v1 + * @interface INetworkEndpointGroupsListNetworkEndpoints + * @property {string|null} [id] NetworkEndpointGroupsListNetworkEndpoints id + * @property {Array.|null} [items] NetworkEndpointGroupsListNetworkEndpoints items + * @property {string|null} [kind] NetworkEndpointGroupsListNetworkEndpoints kind + * @property {string|null} [nextPageToken] NetworkEndpointGroupsListNetworkEndpoints nextPageToken + * @property {google.cloud.compute.v1.IWarning|null} [warning] NetworkEndpointGroupsListNetworkEndpoints warning + */ + + /** + * Constructs a new NetworkEndpointGroupsListNetworkEndpoints. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroupsListNetworkEndpoints. + * @implements INetworkEndpointGroupsListNetworkEndpoints + * @constructor + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints=} [properties] Properties to set + */ + function NetworkEndpointGroupsListNetworkEndpoints(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkEndpointGroupsListNetworkEndpoints id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + NetworkEndpointGroupsListNetworkEndpoints.prototype.id = null; + + /** + * NetworkEndpointGroupsListNetworkEndpoints items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + NetworkEndpointGroupsListNetworkEndpoints.prototype.items = $util.emptyArray; + + /** + * NetworkEndpointGroupsListNetworkEndpoints kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + NetworkEndpointGroupsListNetworkEndpoints.prototype.kind = null; + + /** + * NetworkEndpointGroupsListNetworkEndpoints nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + NetworkEndpointGroupsListNetworkEndpoints.prototype.nextPageToken = null; + + /** + * NetworkEndpointGroupsListNetworkEndpoints warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + NetworkEndpointGroupsListNetworkEndpoints.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkEndpointGroupsListNetworkEndpoints _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + Object.defineProperty(NetworkEndpointGroupsListNetworkEndpoints.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupsListNetworkEndpoints _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + Object.defineProperty(NetworkEndpointGroupsListNetworkEndpoints.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupsListNetworkEndpoints _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + Object.defineProperty(NetworkEndpointGroupsListNetworkEndpoints.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkEndpointGroupsListNetworkEndpoints _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + */ + Object.defineProperty(NetworkEndpointGroupsListNetworkEndpoints.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkEndpointGroupsListNetworkEndpoints instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints} NetworkEndpointGroupsListNetworkEndpoints instance + */ + NetworkEndpointGroupsListNetworkEndpoints.create = function create(properties) { + return new NetworkEndpointGroupsListNetworkEndpoints(properties); + }; + + /** + * Encodes the specified NetworkEndpointGroupsListNetworkEndpoints message. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints} message NetworkEndpointGroupsListNetworkEndpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsListNetworkEndpoints.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworkEndpointGroupsListNetworkEndpoints message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints} message NetworkEndpointGroupsListNetworkEndpoints message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkEndpointGroupsListNetworkEndpoints.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkEndpointGroupsListNetworkEndpoints message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints} NetworkEndpointGroupsListNetworkEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsListNetworkEndpoints.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkEndpointGroupsListNetworkEndpoints message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints} NetworkEndpointGroupsListNetworkEndpoints + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkEndpointGroupsListNetworkEndpoints.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkEndpointGroupsListNetworkEndpoints message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkEndpointGroupsListNetworkEndpoints.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NetworkEndpointGroupsListNetworkEndpoints message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints} NetworkEndpointGroupsListNetworkEndpoints + */ + NetworkEndpointGroupsListNetworkEndpoints.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints) + return object; + var message = new $root.google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NetworkEndpointGroupsListNetworkEndpoints message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @static + * @param {google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints} message NetworkEndpointGroupsListNetworkEndpoints + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkEndpointGroupsListNetworkEndpoints.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.NetworkEndpointWithHealthStatus.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this NetworkEndpointGroupsListNetworkEndpoints to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints + * @instance + * @returns {Object.} JSON object + */ + NetworkEndpointGroupsListNetworkEndpoints.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkEndpointGroupsListNetworkEndpoints; + })(); + + v1.NetworkList = (function() { + + /** + * Properties of a NetworkList. + * @memberof google.cloud.compute.v1 + * @interface INetworkList + * @property {string|null} [id] NetworkList id + * @property {Array.|null} [items] NetworkList items + * @property {string|null} [kind] NetworkList kind + * @property {string|null} [nextPageToken] NetworkList nextPageToken + * @property {string|null} [selfLink] NetworkList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] NetworkList warning + */ + + /** + * Constructs a new NetworkList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkList. + * @implements INetworkList + * @constructor + * @param {google.cloud.compute.v1.INetworkList=} [properties] Properties to set + */ + function NetworkList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + NetworkList.prototype.id = null; + + /** + * NetworkList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + NetworkList.prototype.items = $util.emptyArray; + + /** + * NetworkList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + NetworkList.prototype.kind = null; + + /** + * NetworkList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + NetworkList.prototype.nextPageToken = null; + + /** + * NetworkList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + NetworkList.prototype.selfLink = null; + + /** + * NetworkList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + NetworkList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + Object.defineProperty(NetworkList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + Object.defineProperty(NetworkList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + Object.defineProperty(NetworkList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + Object.defineProperty(NetworkList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NetworkList + * @instance + */ + Object.defineProperty(NetworkList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {google.cloud.compute.v1.INetworkList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworkList} NetworkList instance + */ + NetworkList.create = function create(properties) { + return new NetworkList(properties); + }; + + /** + * Encodes the specified NetworkList message. Does not implicitly {@link google.cloud.compute.v1.NetworkList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {google.cloud.compute.v1.INetworkList} message NetworkList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Network.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NetworkList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {google.cloud.compute.v1.INetworkList} message NetworkList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworkList} NetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworkList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Network.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworkList} NetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkList message. + * @function verify + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Network.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NetworkList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworkList} NetworkList + */ + NetworkList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworkList) + return object; + var message = new $root.google.cloud.compute.v1.NetworkList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NetworkList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Network.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NetworkList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NetworkList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworkList + * @static + * @param {google.cloud.compute.v1.NetworkList} message NetworkList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Network.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NetworkList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworkList + * @instance + * @returns {Object.} JSON object + */ + NetworkList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkList; + })(); + + v1.NetworksAddPeeringRequest = (function() { + + /** + * Properties of a NetworksAddPeeringRequest. + * @memberof google.cloud.compute.v1 + * @interface INetworksAddPeeringRequest + * @property {boolean|null} [autoCreateRoutes] NetworksAddPeeringRequest autoCreateRoutes + * @property {string|null} [name] NetworksAddPeeringRequest name + * @property {google.cloud.compute.v1.INetworkPeering|null} [networkPeering] NetworksAddPeeringRequest networkPeering + * @property {string|null} [peerNetwork] NetworksAddPeeringRequest peerNetwork + */ + + /** + * Constructs a new NetworksAddPeeringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworksAddPeeringRequest. + * @implements INetworksAddPeeringRequest + * @constructor + * @param {google.cloud.compute.v1.INetworksAddPeeringRequest=} [properties] Properties to set + */ + function NetworksAddPeeringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworksAddPeeringRequest autoCreateRoutes. + * @member {boolean|null|undefined} autoCreateRoutes + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + NetworksAddPeeringRequest.prototype.autoCreateRoutes = null; + + /** + * NetworksAddPeeringRequest name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + NetworksAddPeeringRequest.prototype.name = null; + + /** + * NetworksAddPeeringRequest networkPeering. + * @member {google.cloud.compute.v1.INetworkPeering|null|undefined} networkPeering + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + NetworksAddPeeringRequest.prototype.networkPeering = null; + + /** + * NetworksAddPeeringRequest peerNetwork. + * @member {string|null|undefined} peerNetwork + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + NetworksAddPeeringRequest.prototype.peerNetwork = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworksAddPeeringRequest _autoCreateRoutes. + * @member {"autoCreateRoutes"|undefined} _autoCreateRoutes + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + Object.defineProperty(NetworksAddPeeringRequest.prototype, "_autoCreateRoutes", { + get: $util.oneOfGetter($oneOfFields = ["autoCreateRoutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworksAddPeeringRequest _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + Object.defineProperty(NetworksAddPeeringRequest.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworksAddPeeringRequest _networkPeering. + * @member {"networkPeering"|undefined} _networkPeering + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + Object.defineProperty(NetworksAddPeeringRequest.prototype, "_networkPeering", { + get: $util.oneOfGetter($oneOfFields = ["networkPeering"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworksAddPeeringRequest _peerNetwork. + * @member {"peerNetwork"|undefined} _peerNetwork + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + */ + Object.defineProperty(NetworksAddPeeringRequest.prototype, "_peerNetwork", { + get: $util.oneOfGetter($oneOfFields = ["peerNetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworksAddPeeringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksAddPeeringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworksAddPeeringRequest} NetworksAddPeeringRequest instance + */ + NetworksAddPeeringRequest.create = function create(properties) { + return new NetworksAddPeeringRequest(properties); + }; + + /** + * Encodes the specified NetworksAddPeeringRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworksAddPeeringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksAddPeeringRequest} message NetworksAddPeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksAddPeeringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.autoCreateRoutes != null && Object.hasOwnProperty.call(message, "autoCreateRoutes")) + writer.uint32(/* id 57454941, wireType 0 =*/459639528).bool(message.autoCreateRoutes); + if (message.networkPeering != null && Object.hasOwnProperty.call(message, "networkPeering")) + $root.google.cloud.compute.v1.NetworkPeering.encode(message.networkPeering, writer.uint32(/* id 328926767, wireType 2 =*/2631414138).fork()).ldelim(); + if (message.peerNetwork != null && Object.hasOwnProperty.call(message, "peerNetwork")) + writer.uint32(/* id 500625489, wireType 2 =*/4005003914).string(message.peerNetwork); + return writer; + }; + + /** + * Encodes the specified NetworksAddPeeringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksAddPeeringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksAddPeeringRequest} message NetworksAddPeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksAddPeeringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworksAddPeeringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworksAddPeeringRequest} NetworksAddPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksAddPeeringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworksAddPeeringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 57454941: + message.autoCreateRoutes = reader.bool(); + break; + case 3373707: + message.name = reader.string(); + break; + case 328926767: + message.networkPeering = $root.google.cloud.compute.v1.NetworkPeering.decode(reader, reader.uint32()); + break; + case 500625489: + message.peerNetwork = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworksAddPeeringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworksAddPeeringRequest} NetworksAddPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksAddPeeringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworksAddPeeringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworksAddPeeringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoCreateRoutes != null && message.hasOwnProperty("autoCreateRoutes")) { + properties._autoCreateRoutes = 1; + if (typeof message.autoCreateRoutes !== "boolean") + return "autoCreateRoutes: boolean expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.networkPeering != null && message.hasOwnProperty("networkPeering")) { + properties._networkPeering = 1; + { + var error = $root.google.cloud.compute.v1.NetworkPeering.verify(message.networkPeering); + if (error) + return "networkPeering." + error; + } + } + if (message.peerNetwork != null && message.hasOwnProperty("peerNetwork")) { + properties._peerNetwork = 1; + if (!$util.isString(message.peerNetwork)) + return "peerNetwork: string expected"; + } + return null; + }; + + /** + * Creates a NetworksAddPeeringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworksAddPeeringRequest} NetworksAddPeeringRequest + */ + NetworksAddPeeringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworksAddPeeringRequest) + return object; + var message = new $root.google.cloud.compute.v1.NetworksAddPeeringRequest(); + if (object.autoCreateRoutes != null) + message.autoCreateRoutes = Boolean(object.autoCreateRoutes); + if (object.name != null) + message.name = String(object.name); + if (object.networkPeering != null) { + if (typeof object.networkPeering !== "object") + throw TypeError(".google.cloud.compute.v1.NetworksAddPeeringRequest.networkPeering: object expected"); + message.networkPeering = $root.google.cloud.compute.v1.NetworkPeering.fromObject(object.networkPeering); + } + if (object.peerNetwork != null) + message.peerNetwork = String(object.peerNetwork); + return message; + }; + + /** + * Creates a plain object from a NetworksAddPeeringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @static + * @param {google.cloud.compute.v1.NetworksAddPeeringRequest} message NetworksAddPeeringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworksAddPeeringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.autoCreateRoutes != null && message.hasOwnProperty("autoCreateRoutes")) { + object.autoCreateRoutes = message.autoCreateRoutes; + if (options.oneofs) + object._autoCreateRoutes = "autoCreateRoutes"; + } + if (message.networkPeering != null && message.hasOwnProperty("networkPeering")) { + object.networkPeering = $root.google.cloud.compute.v1.NetworkPeering.toObject(message.networkPeering, options); + if (options.oneofs) + object._networkPeering = "networkPeering"; + } + if (message.peerNetwork != null && message.hasOwnProperty("peerNetwork")) { + object.peerNetwork = message.peerNetwork; + if (options.oneofs) + object._peerNetwork = "peerNetwork"; + } + return object; + }; + + /** + * Converts this NetworksAddPeeringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworksAddPeeringRequest + * @instance + * @returns {Object.} JSON object + */ + NetworksAddPeeringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworksAddPeeringRequest; + })(); + + v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy = (function() { + + /** + * Properties of a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @memberof google.cloud.compute.v1 + * @interface INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @property {string|null} [displayName] NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName + * @property {string|null} [name] NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy name + * @property {Array.|null} [rules] NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules + * @property {string|null} [shortName] NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName + * @property {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null} [type] NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy type + */ + + /** + * Constructs a new NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy. + * @implements INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @constructor + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy=} [properties] Properties to set + */ + function NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy(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]]; + } + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy displayName. + * @member {string|null|undefined} displayName + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.displayName = null; + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.name = null; + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules. + * @member {Array.} rules + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.rules = $util.emptyArray; + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy shortName. + * @member {string|null|undefined} shortName + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.shortName = null; + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy type. + * @member {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type|null|undefined} type + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _shortName. + * @member {"shortName"|undefined} _shortName + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_shortName", { + get: $util.oneOfGetter($oneOfFields = ["shortName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + */ + Object.defineProperty(NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy} NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy instance + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.create = function create(properties) { + return new NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy(properties); + }; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy} message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4473832, wireType 2 =*/35790658).string(message.displayName); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.compute.v1.FirewallPolicyRule.encode(message.rules[i], writer.uint32(/* id 108873975, wireType 2 =*/870991802).fork()).ldelim(); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 492051566, wireType 2 =*/3936412530).string(message.shortName); + return writer; + }; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy} message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy} NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4473832: + message.displayName = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 108873975: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.compute.v1.FirewallPolicyRule.decode(reader, reader.uint32())); + break; + case 492051566: + message.shortName = reader.string(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy} NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) { + properties._displayName = 1; + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string 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.cloud.compute.v1.FirewallPolicyRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + properties._shortName = 1; + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 69902869: + case 413984270: + case 526786327: + break; + } + } + return null; + }; + + /** + * Creates a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy} NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy) + return object; + var message = new $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.name != null) + message.name = String(object.name); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.rules: object expected"); + message.rules[i] = $root.google.cloud.compute.v1.FirewallPolicyRule.fromObject(object.rules[i]); + } + } + if (object.shortName != null) + message.shortName = String(object.shortName); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "HIERARCHY": + case 69902869: + message.type = 69902869; + break; + case "NETWORK": + case 413984270: + message.type = 413984270; + break; + case "UNSPECIFIED": + case 526786327: + message.type = 526786327; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @static + * @param {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy} message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) { + object.displayName = message.displayName; + if (options.oneofs) + object._displayName = "displayName"; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.compute.v1.FirewallPolicyRule.toObject(message.rules[j], options); + } + if (message.shortName != null && message.hasOwnProperty("shortName")) { + object.shortName = message.shortName; + if (options.oneofs) + object._shortName = "shortName"; + } + return object; + }; + + /** + * Converts this NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy + * @instance + * @returns {Object.} JSON object + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} HIERARCHY=69902869 HIERARCHY value + * @property {number} NETWORK=413984270 NETWORK value + * @property {number} UNSPECIFIED=526786327 UNSPECIFIED value + */ + NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[69902869] = "HIERARCHY"] = 69902869; + values[valuesById[413984270] = "NETWORK"] = 413984270; + values[valuesById[526786327] = "UNSPECIFIED"] = 526786327; + return values; + })(); + + return NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy; + })(); + + v1.NetworksGetEffectiveFirewallsResponse = (function() { + + /** + * Properties of a NetworksGetEffectiveFirewallsResponse. + * @memberof google.cloud.compute.v1 + * @interface INetworksGetEffectiveFirewallsResponse + * @property {Array.|null} [firewallPolicys] NetworksGetEffectiveFirewallsResponse firewallPolicys + * @property {Array.|null} [firewalls] NetworksGetEffectiveFirewallsResponse firewalls + */ + + /** + * Constructs a new NetworksGetEffectiveFirewallsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworksGetEffectiveFirewallsResponse. + * @implements INetworksGetEffectiveFirewallsResponse + * @constructor + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse=} [properties] Properties to set + */ + function NetworksGetEffectiveFirewallsResponse(properties) { + this.firewallPolicys = []; + this.firewalls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworksGetEffectiveFirewallsResponse firewallPolicys. + * @member {Array.} firewallPolicys + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @instance + */ + NetworksGetEffectiveFirewallsResponse.prototype.firewallPolicys = $util.emptyArray; + + /** + * NetworksGetEffectiveFirewallsResponse firewalls. + * @member {Array.} firewalls + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @instance + */ + NetworksGetEffectiveFirewallsResponse.prototype.firewalls = $util.emptyArray; + + /** + * Creates a new NetworksGetEffectiveFirewallsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse} NetworksGetEffectiveFirewallsResponse instance + */ + NetworksGetEffectiveFirewallsResponse.create = function create(properties) { + return new NetworksGetEffectiveFirewallsResponse(properties); + }; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponse message. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse} message NetworksGetEffectiveFirewallsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksGetEffectiveFirewallsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firewalls != null && message.firewalls.length) + for (var i = 0; i < message.firewalls.length; ++i) + $root.google.cloud.compute.v1.Firewall.encode(message.firewalls[i], writer.uint32(/* id 272245619, wireType 2 =*/2177964954).fork()).ldelim(); + if (message.firewallPolicys != null && message.firewallPolicys.length) + for (var i = 0; i < message.firewallPolicys.length; ++i) + $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.encode(message.firewallPolicys[i], writer.uint32(/* id 410985794, wireType 2 =*/3287886354).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworksGetEffectiveFirewallsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse} message NetworksGetEffectiveFirewallsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksGetEffectiveFirewallsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse} NetworksGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksGetEffectiveFirewallsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 410985794: + if (!(message.firewallPolicys && message.firewallPolicys.length)) + message.firewallPolicys = []; + message.firewallPolicys.push($root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.decode(reader, reader.uint32())); + break; + case 272245619: + if (!(message.firewalls && message.firewalls.length)) + message.firewalls = []; + message.firewalls.push($root.google.cloud.compute.v1.Firewall.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworksGetEffectiveFirewallsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse} NetworksGetEffectiveFirewallsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksGetEffectiveFirewallsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworksGetEffectiveFirewallsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworksGetEffectiveFirewallsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firewallPolicys != null && message.hasOwnProperty("firewallPolicys")) { + if (!Array.isArray(message.firewallPolicys)) + return "firewallPolicys: array expected"; + for (var i = 0; i < message.firewallPolicys.length; ++i) { + var error = $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.verify(message.firewallPolicys[i]); + if (error) + return "firewallPolicys." + error; + } + } + if (message.firewalls != null && message.hasOwnProperty("firewalls")) { + if (!Array.isArray(message.firewalls)) + return "firewalls: array expected"; + for (var i = 0; i < message.firewalls.length; ++i) { + var error = $root.google.cloud.compute.v1.Firewall.verify(message.firewalls[i]); + if (error) + return "firewalls." + error; + } + } + return null; + }; + + /** + * Creates a NetworksGetEffectiveFirewallsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse} NetworksGetEffectiveFirewallsResponse + */ + NetworksGetEffectiveFirewallsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse) + return object; + var message = new $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse(); + if (object.firewallPolicys) { + if (!Array.isArray(object.firewallPolicys)) + throw TypeError(".google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.firewallPolicys: array expected"); + message.firewallPolicys = []; + for (var i = 0; i < object.firewallPolicys.length; ++i) { + if (typeof object.firewallPolicys[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.firewallPolicys: object expected"); + message.firewallPolicys[i] = $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.fromObject(object.firewallPolicys[i]); + } + } + if (object.firewalls) { + if (!Array.isArray(object.firewalls)) + throw TypeError(".google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.firewalls: array expected"); + message.firewalls = []; + for (var i = 0; i < object.firewalls.length; ++i) { + if (typeof object.firewalls[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse.firewalls: object expected"); + message.firewalls[i] = $root.google.cloud.compute.v1.Firewall.fromObject(object.firewalls[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a NetworksGetEffectiveFirewallsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @static + * @param {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse} message NetworksGetEffectiveFirewallsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworksGetEffectiveFirewallsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.firewalls = []; + object.firewallPolicys = []; + } + if (message.firewalls && message.firewalls.length) { + object.firewalls = []; + for (var j = 0; j < message.firewalls.length; ++j) + object.firewalls[j] = $root.google.cloud.compute.v1.Firewall.toObject(message.firewalls[j], options); + } + if (message.firewallPolicys && message.firewallPolicys.length) { + object.firewallPolicys = []; + for (var j = 0; j < message.firewallPolicys.length; ++j) + object.firewallPolicys[j] = $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.toObject(message.firewallPolicys[j], options); + } + return object; + }; + + /** + * Converts this NetworksGetEffectiveFirewallsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse + * @instance + * @returns {Object.} JSON object + */ + NetworksGetEffectiveFirewallsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworksGetEffectiveFirewallsResponse; + })(); + + v1.NetworksRemovePeeringRequest = (function() { + + /** + * Properties of a NetworksRemovePeeringRequest. + * @memberof google.cloud.compute.v1 + * @interface INetworksRemovePeeringRequest + * @property {string|null} [name] NetworksRemovePeeringRequest name + */ + + /** + * Constructs a new NetworksRemovePeeringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworksRemovePeeringRequest. + * @implements INetworksRemovePeeringRequest + * @constructor + * @param {google.cloud.compute.v1.INetworksRemovePeeringRequest=} [properties] Properties to set + */ + function NetworksRemovePeeringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworksRemovePeeringRequest name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @instance + */ + NetworksRemovePeeringRequest.prototype.name = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworksRemovePeeringRequest _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @instance + */ + Object.defineProperty(NetworksRemovePeeringRequest.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworksRemovePeeringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksRemovePeeringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworksRemovePeeringRequest} NetworksRemovePeeringRequest instance + */ + NetworksRemovePeeringRequest.create = function create(properties) { + return new NetworksRemovePeeringRequest(properties); + }; + + /** + * Encodes the specified NetworksRemovePeeringRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworksRemovePeeringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksRemovePeeringRequest} message NetworksRemovePeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksRemovePeeringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + return writer; + }; + + /** + * Encodes the specified NetworksRemovePeeringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksRemovePeeringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksRemovePeeringRequest} message NetworksRemovePeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksRemovePeeringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworksRemovePeeringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworksRemovePeeringRequest} NetworksRemovePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksRemovePeeringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworksRemovePeeringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworksRemovePeeringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworksRemovePeeringRequest} NetworksRemovePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksRemovePeeringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworksRemovePeeringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworksRemovePeeringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a NetworksRemovePeeringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworksRemovePeeringRequest} NetworksRemovePeeringRequest + */ + NetworksRemovePeeringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworksRemovePeeringRequest) + return object; + var message = new $root.google.cloud.compute.v1.NetworksRemovePeeringRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a NetworksRemovePeeringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @static + * @param {google.cloud.compute.v1.NetworksRemovePeeringRequest} message NetworksRemovePeeringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworksRemovePeeringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + return object; + }; + + /** + * Converts this NetworksRemovePeeringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworksRemovePeeringRequest + * @instance + * @returns {Object.} JSON object + */ + NetworksRemovePeeringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworksRemovePeeringRequest; + })(); + + v1.NetworksUpdatePeeringRequest = (function() { + + /** + * Properties of a NetworksUpdatePeeringRequest. + * @memberof google.cloud.compute.v1 + * @interface INetworksUpdatePeeringRequest + * @property {google.cloud.compute.v1.INetworkPeering|null} [networkPeering] NetworksUpdatePeeringRequest networkPeering + */ + + /** + * Constructs a new NetworksUpdatePeeringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworksUpdatePeeringRequest. + * @implements INetworksUpdatePeeringRequest + * @constructor + * @param {google.cloud.compute.v1.INetworksUpdatePeeringRequest=} [properties] Properties to set + */ + function NetworksUpdatePeeringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworksUpdatePeeringRequest networkPeering. + * @member {google.cloud.compute.v1.INetworkPeering|null|undefined} networkPeering + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @instance + */ + NetworksUpdatePeeringRequest.prototype.networkPeering = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworksUpdatePeeringRequest _networkPeering. + * @member {"networkPeering"|undefined} _networkPeering + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @instance + */ + Object.defineProperty(NetworksUpdatePeeringRequest.prototype, "_networkPeering", { + get: $util.oneOfGetter($oneOfFields = ["networkPeering"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworksUpdatePeeringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksUpdatePeeringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NetworksUpdatePeeringRequest} NetworksUpdatePeeringRequest instance + */ + NetworksUpdatePeeringRequest.create = function create(properties) { + return new NetworksUpdatePeeringRequest(properties); + }; + + /** + * Encodes the specified NetworksUpdatePeeringRequest message. Does not implicitly {@link google.cloud.compute.v1.NetworksUpdatePeeringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksUpdatePeeringRequest} message NetworksUpdatePeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksUpdatePeeringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkPeering != null && Object.hasOwnProperty.call(message, "networkPeering")) + $root.google.cloud.compute.v1.NetworkPeering.encode(message.networkPeering, writer.uint32(/* id 328926767, wireType 2 =*/2631414138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NetworksUpdatePeeringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworksUpdatePeeringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {google.cloud.compute.v1.INetworksUpdatePeeringRequest} message NetworksUpdatePeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworksUpdatePeeringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworksUpdatePeeringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NetworksUpdatePeeringRequest} NetworksUpdatePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksUpdatePeeringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 328926767: + message.networkPeering = $root.google.cloud.compute.v1.NetworkPeering.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworksUpdatePeeringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NetworksUpdatePeeringRequest} NetworksUpdatePeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworksUpdatePeeringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworksUpdatePeeringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworksUpdatePeeringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkPeering != null && message.hasOwnProperty("networkPeering")) { + properties._networkPeering = 1; + { + var error = $root.google.cloud.compute.v1.NetworkPeering.verify(message.networkPeering); + if (error) + return "networkPeering." + error; + } + } + return null; + }; + + /** + * Creates a NetworksUpdatePeeringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NetworksUpdatePeeringRequest} NetworksUpdatePeeringRequest + */ + NetworksUpdatePeeringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest) + return object; + var message = new $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest(); + if (object.networkPeering != null) { + if (typeof object.networkPeering !== "object") + throw TypeError(".google.cloud.compute.v1.NetworksUpdatePeeringRequest.networkPeering: object expected"); + message.networkPeering = $root.google.cloud.compute.v1.NetworkPeering.fromObject(object.networkPeering); + } + return message; + }; + + /** + * Creates a plain object from a NetworksUpdatePeeringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @static + * @param {google.cloud.compute.v1.NetworksUpdatePeeringRequest} message NetworksUpdatePeeringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworksUpdatePeeringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.networkPeering != null && message.hasOwnProperty("networkPeering")) { + object.networkPeering = $root.google.cloud.compute.v1.NetworkPeering.toObject(message.networkPeering, options); + if (options.oneofs) + object._networkPeering = "networkPeering"; + } + return object; + }; + + /** + * Converts this NetworksUpdatePeeringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NetworksUpdatePeeringRequest + * @instance + * @returns {Object.} JSON object + */ + NetworksUpdatePeeringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworksUpdatePeeringRequest; + })(); + + v1.NodeGroupAutoscalingPolicy = (function() { + + /** + * Properties of a NodeGroupAutoscalingPolicy. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupAutoscalingPolicy + * @property {number|null} [maxNodes] NodeGroupAutoscalingPolicy maxNodes + * @property {number|null} [minNodes] NodeGroupAutoscalingPolicy minNodes + * @property {google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode|null} [mode] NodeGroupAutoscalingPolicy mode + */ + + /** + * Constructs a new NodeGroupAutoscalingPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupAutoscalingPolicy. + * @implements INodeGroupAutoscalingPolicy + * @constructor + * @param {google.cloud.compute.v1.INodeGroupAutoscalingPolicy=} [properties] Properties to set + */ + function NodeGroupAutoscalingPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupAutoscalingPolicy maxNodes. + * @member {number|null|undefined} maxNodes + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @instance + */ + NodeGroupAutoscalingPolicy.prototype.maxNodes = null; + + /** + * NodeGroupAutoscalingPolicy minNodes. + * @member {number|null|undefined} minNodes + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @instance + */ + NodeGroupAutoscalingPolicy.prototype.minNodes = null; + + /** + * NodeGroupAutoscalingPolicy mode. + * @member {google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode|null|undefined} mode + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @instance + */ + NodeGroupAutoscalingPolicy.prototype.mode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupAutoscalingPolicy _maxNodes. + * @member {"maxNodes"|undefined} _maxNodes + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @instance + */ + Object.defineProperty(NodeGroupAutoscalingPolicy.prototype, "_maxNodes", { + get: $util.oneOfGetter($oneOfFields = ["maxNodes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupAutoscalingPolicy _minNodes. + * @member {"minNodes"|undefined} _minNodes + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @instance + */ + Object.defineProperty(NodeGroupAutoscalingPolicy.prototype, "_minNodes", { + get: $util.oneOfGetter($oneOfFields = ["minNodes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupAutoscalingPolicy _mode. + * @member {"mode"|undefined} _mode + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @instance + */ + Object.defineProperty(NodeGroupAutoscalingPolicy.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupAutoscalingPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.INodeGroupAutoscalingPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupAutoscalingPolicy} NodeGroupAutoscalingPolicy instance + */ + NodeGroupAutoscalingPolicy.create = function create(properties) { + return new NodeGroupAutoscalingPolicy(properties); + }; + + /** + * Encodes the specified NodeGroupAutoscalingPolicy message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAutoscalingPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.INodeGroupAutoscalingPolicy} message NodeGroupAutoscalingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupAutoscalingPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3357091, wireType 0 =*/26856728).int32(message.mode); + if (message.maxNodes != null && Object.hasOwnProperty.call(message, "maxNodes")) + writer.uint32(/* id 297762838, wireType 0 =*/2382102704).int32(message.maxNodes); + if (message.minNodes != null && Object.hasOwnProperty.call(message, "minNodes")) + writer.uint32(/* id 533370500, wireType 0 =*/4266964000).int32(message.minNodes); + return writer; + }; + + /** + * Encodes the specified NodeGroupAutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAutoscalingPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.INodeGroupAutoscalingPolicy} message NodeGroupAutoscalingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupAutoscalingPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupAutoscalingPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupAutoscalingPolicy} NodeGroupAutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupAutoscalingPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 297762838: + message.maxNodes = reader.int32(); + break; + case 533370500: + message.minNodes = reader.int32(); + break; + case 3357091: + message.mode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupAutoscalingPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupAutoscalingPolicy} NodeGroupAutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupAutoscalingPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupAutoscalingPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupAutoscalingPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + properties._maxNodes = 1; + if (!$util.isInteger(message.maxNodes)) + return "maxNodes: integer expected"; + } + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + properties._minNodes = 1; + if (!$util.isInteger(message.minNodes)) + return "minNodes: integer expected"; + } + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 371348091: + case 78159: + case 2527: + case 152713670: + break; + } + } + return null; + }; + + /** + * Creates a NodeGroupAutoscalingPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupAutoscalingPolicy} NodeGroupAutoscalingPolicy + */ + NodeGroupAutoscalingPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy(); + if (object.maxNodes != null) + message.maxNodes = object.maxNodes | 0; + if (object.minNodes != null) + message.minNodes = object.minNodes | 0; + switch (object.mode) { + case "UNDEFINED_MODE": + case 0: + message.mode = 0; + break; + case "MODE_UNSPECIFIED": + case 371348091: + message.mode = 371348091; + break; + case "OFF": + case 78159: + message.mode = 78159; + break; + case "ON": + case 2527: + message.mode = 2527; + break; + case "ONLY_SCALE_OUT": + case 152713670: + message.mode = 152713670; + break; + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupAutoscalingPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @static + * @param {google.cloud.compute.v1.NodeGroupAutoscalingPolicy} message NodeGroupAutoscalingPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupAutoscalingPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.maxNodes != null && message.hasOwnProperty("maxNodes")) { + object.maxNodes = message.maxNodes; + if (options.oneofs) + object._maxNodes = "maxNodes"; + } + if (message.minNodes != null && message.hasOwnProperty("minNodes")) { + object.minNodes = message.minNodes; + if (options.oneofs) + object._minNodes = "minNodes"; + } + return object; + }; + + /** + * Converts this NodeGroupAutoscalingPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupAutoscalingPolicy + * @instance + * @returns {Object.} JSON object + */ + NodeGroupAutoscalingPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Mode enum. + * @name google.cloud.compute.v1.NodeGroupAutoscalingPolicy.Mode + * @enum {number} + * @property {number} UNDEFINED_MODE=0 UNDEFINED_MODE value + * @property {number} MODE_UNSPECIFIED=371348091 MODE_UNSPECIFIED value + * @property {number} OFF=78159 OFF value + * @property {number} ON=2527 ON value + * @property {number} ONLY_SCALE_OUT=152713670 ONLY_SCALE_OUT value + */ + NodeGroupAutoscalingPolicy.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MODE"] = 0; + values[valuesById[371348091] = "MODE_UNSPECIFIED"] = 371348091; + values[valuesById[78159] = "OFF"] = 78159; + values[valuesById[2527] = "ON"] = 2527; + values[valuesById[152713670] = "ONLY_SCALE_OUT"] = 152713670; + return values; + })(); + + return NodeGroupAutoscalingPolicy; + })(); + + v1.NodeGroupMaintenanceWindow = (function() { + + /** + * Properties of a NodeGroupMaintenanceWindow. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupMaintenanceWindow + * @property {google.cloud.compute.v1.IDuration|null} [maintenanceDuration] NodeGroupMaintenanceWindow maintenanceDuration + * @property {string|null} [startTime] NodeGroupMaintenanceWindow startTime + */ + + /** + * Constructs a new NodeGroupMaintenanceWindow. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupMaintenanceWindow. + * @implements INodeGroupMaintenanceWindow + * @constructor + * @param {google.cloud.compute.v1.INodeGroupMaintenanceWindow=} [properties] Properties to set + */ + function NodeGroupMaintenanceWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupMaintenanceWindow maintenanceDuration. + * @member {google.cloud.compute.v1.IDuration|null|undefined} maintenanceDuration + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @instance + */ + NodeGroupMaintenanceWindow.prototype.maintenanceDuration = null; + + /** + * NodeGroupMaintenanceWindow startTime. + * @member {string|null|undefined} startTime + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @instance + */ + NodeGroupMaintenanceWindow.prototype.startTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupMaintenanceWindow _maintenanceDuration. + * @member {"maintenanceDuration"|undefined} _maintenanceDuration + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @instance + */ + Object.defineProperty(NodeGroupMaintenanceWindow.prototype, "_maintenanceDuration", { + get: $util.oneOfGetter($oneOfFields = ["maintenanceDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupMaintenanceWindow _startTime. + * @member {"startTime"|undefined} _startTime + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @instance + */ + Object.defineProperty(NodeGroupMaintenanceWindow.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupMaintenanceWindow instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {google.cloud.compute.v1.INodeGroupMaintenanceWindow=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupMaintenanceWindow} NodeGroupMaintenanceWindow instance + */ + NodeGroupMaintenanceWindow.create = function create(properties) { + return new NodeGroupMaintenanceWindow(properties); + }; + + /** + * Encodes the specified NodeGroupMaintenanceWindow message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupMaintenanceWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {google.cloud.compute.v1.INodeGroupMaintenanceWindow} message NodeGroupMaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupMaintenanceWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 37467274, wireType 2 =*/299738194).string(message.startTime); + if (message.maintenanceDuration != null && Object.hasOwnProperty.call(message, "maintenanceDuration")) + $root.google.cloud.compute.v1.Duration.encode(message.maintenanceDuration, writer.uint32(/* id 525291840, wireType 2 =*/4202334722).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeGroupMaintenanceWindow message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupMaintenanceWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {google.cloud.compute.v1.INodeGroupMaintenanceWindow} message NodeGroupMaintenanceWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupMaintenanceWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupMaintenanceWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupMaintenanceWindow} NodeGroupMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupMaintenanceWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 525291840: + message.maintenanceDuration = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 37467274: + message.startTime = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupMaintenanceWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupMaintenanceWindow} NodeGroupMaintenanceWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupMaintenanceWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupMaintenanceWindow message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupMaintenanceWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maintenanceDuration != null && message.hasOwnProperty("maintenanceDuration")) { + properties._maintenanceDuration = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.maintenanceDuration); + if (error) + return "maintenanceDuration." + error; + } + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties._startTime = 1; + if (!$util.isString(message.startTime)) + return "startTime: string expected"; + } + return null; + }; + + /** + * Creates a NodeGroupMaintenanceWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupMaintenanceWindow} NodeGroupMaintenanceWindow + */ + NodeGroupMaintenanceWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow(); + if (object.maintenanceDuration != null) { + if (typeof object.maintenanceDuration !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupMaintenanceWindow.maintenanceDuration: object expected"); + message.maintenanceDuration = $root.google.cloud.compute.v1.Duration.fromObject(object.maintenanceDuration); + } + if (object.startTime != null) + message.startTime = String(object.startTime); + return message; + }; + + /** + * Creates a plain object from a NodeGroupMaintenanceWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @static + * @param {google.cloud.compute.v1.NodeGroupMaintenanceWindow} message NodeGroupMaintenanceWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupMaintenanceWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.maintenanceDuration != null && message.hasOwnProperty("maintenanceDuration")) { + object.maintenanceDuration = $root.google.cloud.compute.v1.Duration.toObject(message.maintenanceDuration, options); + if (options.oneofs) + object._maintenanceDuration = "maintenanceDuration"; + } + return object; + }; + + /** + * Converts this NodeGroupMaintenanceWindow to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupMaintenanceWindow + * @instance + * @returns {Object.} JSON object + */ + NodeGroupMaintenanceWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupMaintenanceWindow; + })(); + + v1.NodeGroup = (function() { + + /** + * Properties of a NodeGroup. + * @memberof google.cloud.compute.v1 + * @interface INodeGroup + * @property {google.cloud.compute.v1.INodeGroupAutoscalingPolicy|null} [autoscalingPolicy] NodeGroup autoscalingPolicy + * @property {string|null} [creationTimestamp] NodeGroup creationTimestamp + * @property {string|null} [description] NodeGroup description + * @property {string|null} [fingerprint] NodeGroup fingerprint + * @property {number|Long|null} [id] NodeGroup id + * @property {string|null} [kind] NodeGroup kind + * @property {string|null} [locationHint] NodeGroup locationHint + * @property {google.cloud.compute.v1.NodeGroup.MaintenancePolicy|null} [maintenancePolicy] NodeGroup maintenancePolicy + * @property {google.cloud.compute.v1.INodeGroupMaintenanceWindow|null} [maintenanceWindow] NodeGroup maintenanceWindow + * @property {string|null} [name] NodeGroup name + * @property {string|null} [nodeTemplate] NodeGroup nodeTemplate + * @property {string|null} [selfLink] NodeGroup selfLink + * @property {number|null} [size] NodeGroup size + * @property {google.cloud.compute.v1.NodeGroup.Status|null} [status] NodeGroup status + * @property {string|null} [zone] NodeGroup zone + */ + + /** + * Constructs a new NodeGroup. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroup. + * @implements INodeGroup + * @constructor + * @param {google.cloud.compute.v1.INodeGroup=} [properties] Properties to set + */ + function NodeGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroup autoscalingPolicy. + * @member {google.cloud.compute.v1.INodeGroupAutoscalingPolicy|null|undefined} autoscalingPolicy + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.autoscalingPolicy = null; + + /** + * NodeGroup creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.creationTimestamp = null; + + /** + * NodeGroup description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.description = null; + + /** + * NodeGroup fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.fingerprint = null; + + /** + * NodeGroup id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.id = null; + + /** + * NodeGroup kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.kind = null; + + /** + * NodeGroup locationHint. + * @member {string|null|undefined} locationHint + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.locationHint = null; + + /** + * NodeGroup maintenancePolicy. + * @member {google.cloud.compute.v1.NodeGroup.MaintenancePolicy|null|undefined} maintenancePolicy + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.maintenancePolicy = null; + + /** + * NodeGroup maintenanceWindow. + * @member {google.cloud.compute.v1.INodeGroupMaintenanceWindow|null|undefined} maintenanceWindow + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.maintenanceWindow = null; + + /** + * NodeGroup name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.name = null; + + /** + * NodeGroup nodeTemplate. + * @member {string|null|undefined} nodeTemplate + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.nodeTemplate = null; + + /** + * NodeGroup selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.selfLink = null; + + /** + * NodeGroup size. + * @member {number|null|undefined} size + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.size = null; + + /** + * NodeGroup status. + * @member {google.cloud.compute.v1.NodeGroup.Status|null|undefined} status + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.status = null; + + /** + * NodeGroup zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroup _autoscalingPolicy. + * @member {"autoscalingPolicy"|undefined} _autoscalingPolicy + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_autoscalingPolicy", { + get: $util.oneOfGetter($oneOfFields = ["autoscalingPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _locationHint. + * @member {"locationHint"|undefined} _locationHint + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_locationHint", { + get: $util.oneOfGetter($oneOfFields = ["locationHint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _maintenancePolicy. + * @member {"maintenancePolicy"|undefined} _maintenancePolicy + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_maintenancePolicy", { + get: $util.oneOfGetter($oneOfFields = ["maintenancePolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _maintenanceWindow. + * @member {"maintenanceWindow"|undefined} _maintenanceWindow + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_maintenanceWindow", { + get: $util.oneOfGetter($oneOfFields = ["maintenanceWindow"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _nodeTemplate. + * @member {"nodeTemplate"|undefined} _nodeTemplate + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_nodeTemplate", { + get: $util.oneOfGetter($oneOfFields = ["nodeTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _size. + * @member {"size"|undefined} _size + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_size", { + get: $util.oneOfGetter($oneOfFields = ["size"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroup _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + */ + Object.defineProperty(NodeGroup.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroup instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {google.cloud.compute.v1.INodeGroup=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroup} NodeGroup instance + */ + NodeGroup.create = function create(properties) { + return new NodeGroup(properties); + }; + + /** + * Encodes the specified NodeGroup message. Does not implicitly {@link google.cloud.compute.v1.NodeGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {google.cloud.compute.v1.INodeGroup} message NodeGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 3530753, wireType 0 =*/28246024).int32(message.size); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.maintenanceWindow != null && Object.hasOwnProperty.call(message, "maintenanceWindow")) + $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow.encode(message.maintenanceWindow, writer.uint32(/* id 186374812, wireType 2 =*/1490998498).fork()).ldelim(); + if (message.autoscalingPolicy != null && Object.hasOwnProperty.call(message, "autoscalingPolicy")) + $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy.encode(message.autoscalingPolicy, writer.uint32(/* id 221950041, wireType 2 =*/1775600330).fork()).ldelim(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.nodeTemplate != null && Object.hasOwnProperty.call(message, "nodeTemplate")) + writer.uint32(/* id 323154455, wireType 2 =*/2585235642).string(message.nodeTemplate); + if (message.locationHint != null && Object.hasOwnProperty.call(message, "locationHint")) + writer.uint32(/* id 350519505, wireType 2 =*/2804156042).string(message.locationHint); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.maintenancePolicy != null && Object.hasOwnProperty.call(message, "maintenancePolicy")) + writer.uint32(/* id 528327646, wireType 0 =*/4226621168).int32(message.maintenancePolicy); + return writer; + }; + + /** + * Encodes the specified NodeGroup message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {google.cloud.compute.v1.INodeGroup} message NodeGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroup} NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 221950041: + message.autoscalingPolicy = $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy.decode(reader, reader.uint32()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 350519505: + message.locationHint = reader.string(); + break; + case 528327646: + message.maintenancePolicy = reader.int32(); + break; + case 186374812: + message.maintenanceWindow = $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 323154455: + message.nodeTemplate = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3530753: + message.size = reader.int32(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroup} NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroup message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscalingPolicy != null && message.hasOwnProperty("autoscalingPolicy")) { + properties._autoscalingPolicy = 1; + { + var error = $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy.verify(message.autoscalingPolicy); + if (error) + return "autoscalingPolicy." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + properties._locationHint = 1; + if (!$util.isString(message.locationHint)) + return "locationHint: string expected"; + } + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) { + properties._maintenancePolicy = 1; + switch (message.maintenancePolicy) { + default: + return "maintenancePolicy: enum value expected"; + case 0: + case 115302945: + case 72964182: + case 153483394: + case 228647325: + break; + } + } + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { + properties._maintenanceWindow = 1; + { + var error = $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow.verify(message.maintenanceWindow); + if (error) + return "maintenanceWindow." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) { + properties._nodeTemplate = 1; + if (!$util.isString(message.nodeTemplate)) + return "nodeTemplate: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.size != null && message.hasOwnProperty("size")) { + properties._size = 1; + if (!$util.isInteger(message.size)) + return "size: integer expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 530283991: + case 77848963: + break; + } + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a NodeGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroup} NodeGroup + */ + NodeGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroup) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroup(); + if (object.autoscalingPolicy != null) { + if (typeof object.autoscalingPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroup.autoscalingPolicy: object expected"); + message.autoscalingPolicy = $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy.fromObject(object.autoscalingPolicy); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.locationHint != null) + message.locationHint = String(object.locationHint); + switch (object.maintenancePolicy) { + case "UNDEFINED_MAINTENANCE_POLICY": + case 0: + message.maintenancePolicy = 0; + break; + case "DEFAULT": + case 115302945: + message.maintenancePolicy = 115302945; + break; + case "MAINTENANCE_POLICY_UNSPECIFIED": + case 72964182: + message.maintenancePolicy = 72964182; + break; + case "MIGRATE_WITHIN_NODE_GROUP": + case 153483394: + message.maintenancePolicy = 153483394; + break; + case "RESTART_IN_PLACE": + case 228647325: + message.maintenancePolicy = 228647325; + break; + } + if (object.maintenanceWindow != null) { + if (typeof object.maintenanceWindow !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroup.maintenanceWindow: object expected"); + message.maintenanceWindow = $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow.fromObject(object.maintenanceWindow); + } + if (object.name != null) + message.name = String(object.name); + if (object.nodeTemplate != null) + message.nodeTemplate = String(object.nodeTemplate); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.size != null) + message.size = object.size | 0; + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "INVALID": + case 530283991: + message.status = 530283991; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a NodeGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroup + * @static + * @param {google.cloud.compute.v1.NodeGroup} message NodeGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.size != null && message.hasOwnProperty("size")) { + object.size = message.size; + if (options.oneofs) + object._size = "size"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.NodeGroup.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.maintenanceWindow != null && message.hasOwnProperty("maintenanceWindow")) { + object.maintenanceWindow = $root.google.cloud.compute.v1.NodeGroupMaintenanceWindow.toObject(message.maintenanceWindow, options); + if (options.oneofs) + object._maintenanceWindow = "maintenanceWindow"; + } + if (message.autoscalingPolicy != null && message.hasOwnProperty("autoscalingPolicy")) { + object.autoscalingPolicy = $root.google.cloud.compute.v1.NodeGroupAutoscalingPolicy.toObject(message.autoscalingPolicy, options); + if (options.oneofs) + object._autoscalingPolicy = "autoscalingPolicy"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) { + object.nodeTemplate = message.nodeTemplate; + if (options.oneofs) + object._nodeTemplate = "nodeTemplate"; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + object.locationHint = message.locationHint; + if (options.oneofs) + object._locationHint = "locationHint"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.maintenancePolicy != null && message.hasOwnProperty("maintenancePolicy")) { + object.maintenancePolicy = options.enums === String ? $root.google.cloud.compute.v1.NodeGroup.MaintenancePolicy[message.maintenancePolicy] : message.maintenancePolicy; + if (options.oneofs) + object._maintenancePolicy = "maintenancePolicy"; + } + return object; + }; + + /** + * Converts this NodeGroup to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroup + * @instance + * @returns {Object.} JSON object + */ + NodeGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * MaintenancePolicy enum. + * @name google.cloud.compute.v1.NodeGroup.MaintenancePolicy + * @enum {number} + * @property {number} UNDEFINED_MAINTENANCE_POLICY=0 UNDEFINED_MAINTENANCE_POLICY value + * @property {number} DEFAULT=115302945 DEFAULT value + * @property {number} MAINTENANCE_POLICY_UNSPECIFIED=72964182 MAINTENANCE_POLICY_UNSPECIFIED value + * @property {number} MIGRATE_WITHIN_NODE_GROUP=153483394 MIGRATE_WITHIN_NODE_GROUP value + * @property {number} RESTART_IN_PLACE=228647325 RESTART_IN_PLACE value + */ + NodeGroup.MaintenancePolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MAINTENANCE_POLICY"] = 0; + values[valuesById[115302945] = "DEFAULT"] = 115302945; + values[valuesById[72964182] = "MAINTENANCE_POLICY_UNSPECIFIED"] = 72964182; + values[valuesById[153483394] = "MIGRATE_WITHIN_NODE_GROUP"] = 153483394; + values[valuesById[228647325] = "RESTART_IN_PLACE"] = 228647325; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.NodeGroup.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} INVALID=530283991 INVALID value + * @property {number} READY=77848963 READY value + */ + NodeGroup.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[77848963] = "READY"] = 77848963; + return values; + })(); + + return NodeGroup; + })(); + + v1.NodeGroupsScopedList = (function() { + + /** + * Properties of a NodeGroupsScopedList. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupsScopedList + * @property {Array.|null} [nodeGroups] NodeGroupsScopedList nodeGroups + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeGroupsScopedList warning + */ + + /** + * Constructs a new NodeGroupsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupsScopedList. + * @implements INodeGroupsScopedList + * @constructor + * @param {google.cloud.compute.v1.INodeGroupsScopedList=} [properties] Properties to set + */ + function NodeGroupsScopedList(properties) { + this.nodeGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupsScopedList nodeGroups. + * @member {Array.} nodeGroups + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @instance + */ + NodeGroupsScopedList.prototype.nodeGroups = $util.emptyArray; + + /** + * NodeGroupsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @instance + */ + NodeGroupsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @instance + */ + Object.defineProperty(NodeGroupsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {google.cloud.compute.v1.INodeGroupsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupsScopedList} NodeGroupsScopedList instance + */ + NodeGroupsScopedList.create = function create(properties) { + return new NodeGroupsScopedList(properties); + }; + + /** + * Encodes the specified NodeGroupsScopedList message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {google.cloud.compute.v1.INodeGroupsScopedList} message NodeGroupsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nodeGroups != null && message.nodeGroups.length) + for (var i = 0; i < message.nodeGroups.length; ++i) + $root.google.cloud.compute.v1.NodeGroup.encode(message.nodeGroups[i], writer.uint32(/* id 73188017, wireType 2 =*/585504138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeGroupsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {google.cloud.compute.v1.INodeGroupsScopedList} message NodeGroupsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupsScopedList} NodeGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 73188017: + if (!(message.nodeGroups && message.nodeGroups.length)) + message.nodeGroups = []; + message.nodeGroups.push($root.google.cloud.compute.v1.NodeGroup.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupsScopedList} NodeGroupsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeGroups != null && message.hasOwnProperty("nodeGroups")) { + if (!Array.isArray(message.nodeGroups)) + return "nodeGroups: array expected"; + for (var i = 0; i < message.nodeGroups.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeGroup.verify(message.nodeGroups[i]); + if (error) + return "nodeGroups." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeGroupsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupsScopedList} NodeGroupsScopedList + */ + NodeGroupsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupsScopedList(); + if (object.nodeGroups) { + if (!Array.isArray(object.nodeGroups)) + throw TypeError(".google.cloud.compute.v1.NodeGroupsScopedList.nodeGroups: array expected"); + message.nodeGroups = []; + for (var i = 0; i < object.nodeGroups.length; ++i) { + if (typeof object.nodeGroups[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupsScopedList.nodeGroups: object expected"); + message.nodeGroups[i] = $root.google.cloud.compute.v1.NodeGroup.fromObject(object.nodeGroups[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @static + * @param {google.cloud.compute.v1.NodeGroupsScopedList} message NodeGroupsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeGroups = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nodeGroups && message.nodeGroups.length) { + object.nodeGroups = []; + for (var j = 0; j < message.nodeGroups.length; ++j) + object.nodeGroups[j] = $root.google.cloud.compute.v1.NodeGroup.toObject(message.nodeGroups[j], options); + } + return object; + }; + + /** + * Converts this NodeGroupsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupsScopedList + * @instance + * @returns {Object.} JSON object + */ + NodeGroupsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupsScopedList; + })(); + + v1.NodeGroupAggregatedList = (function() { + + /** + * Properties of a NodeGroupAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupAggregatedList + * @property {string|null} [id] NodeGroupAggregatedList id + * @property {Object.|null} [items] NodeGroupAggregatedList items + * @property {string|null} [kind] NodeGroupAggregatedList kind + * @property {string|null} [nextPageToken] NodeGroupAggregatedList nextPageToken + * @property {string|null} [selfLink] NodeGroupAggregatedList selfLink + * @property {Array.|null} [unreachables] NodeGroupAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeGroupAggregatedList warning + */ + + /** + * Constructs a new NodeGroupAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupAggregatedList. + * @implements INodeGroupAggregatedList + * @constructor + * @param {google.cloud.compute.v1.INodeGroupAggregatedList=} [properties] Properties to set + */ + function NodeGroupAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + NodeGroupAggregatedList.prototype.id = null; + + /** + * NodeGroupAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + NodeGroupAggregatedList.prototype.items = $util.emptyObject; + + /** + * NodeGroupAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + NodeGroupAggregatedList.prototype.kind = null; + + /** + * NodeGroupAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + NodeGroupAggregatedList.prototype.nextPageToken = null; + + /** + * NodeGroupAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + NodeGroupAggregatedList.prototype.selfLink = null; + + /** + * NodeGroupAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + NodeGroupAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * NodeGroupAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + NodeGroupAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + Object.defineProperty(NodeGroupAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + Object.defineProperty(NodeGroupAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + Object.defineProperty(NodeGroupAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + Object.defineProperty(NodeGroupAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + */ + Object.defineProperty(NodeGroupAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeGroupAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupAggregatedList} NodeGroupAggregatedList instance + */ + NodeGroupAggregatedList.create = function create(properties) { + return new NodeGroupAggregatedList(properties); + }; + + /** + * Encodes the specified NodeGroupAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeGroupAggregatedList} message NodeGroupAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.NodeGroupsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NodeGroupAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeGroupAggregatedList} message NodeGroupAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupAggregatedList} NodeGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.NodeGroupsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupAggregatedList} NodeGroupAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeGroupsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeGroupAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupAggregatedList} NodeGroupAggregatedList + */ + NodeGroupAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.NodeGroupsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.NodeGroupAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @static + * @param {google.cloud.compute.v1.NodeGroupAggregatedList} message NodeGroupAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.NodeGroupsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NodeGroupAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupAggregatedList + * @instance + * @returns {Object.} JSON object + */ + NodeGroupAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupAggregatedList; + })(); + + v1.NodeGroupList = (function() { + + /** + * Properties of a NodeGroupList. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupList + * @property {string|null} [id] NodeGroupList id + * @property {Array.|null} [items] NodeGroupList items + * @property {string|null} [kind] NodeGroupList kind + * @property {string|null} [nextPageToken] NodeGroupList nextPageToken + * @property {string|null} [selfLink] NodeGroupList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeGroupList warning + */ + + /** + * Constructs a new NodeGroupList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupList. + * @implements INodeGroupList + * @constructor + * @param {google.cloud.compute.v1.INodeGroupList=} [properties] Properties to set + */ + function NodeGroupList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + NodeGroupList.prototype.id = null; + + /** + * NodeGroupList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + NodeGroupList.prototype.items = $util.emptyArray; + + /** + * NodeGroupList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + NodeGroupList.prototype.kind = null; + + /** + * NodeGroupList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + NodeGroupList.prototype.nextPageToken = null; + + /** + * NodeGroupList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + NodeGroupList.prototype.selfLink = null; + + /** + * NodeGroupList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + NodeGroupList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + Object.defineProperty(NodeGroupList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + Object.defineProperty(NodeGroupList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + Object.defineProperty(NodeGroupList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + Object.defineProperty(NodeGroupList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + */ + Object.defineProperty(NodeGroupList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {google.cloud.compute.v1.INodeGroupList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupList} NodeGroupList instance + */ + NodeGroupList.create = function create(properties) { + return new NodeGroupList(properties); + }; + + /** + * Encodes the specified NodeGroupList message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {google.cloud.compute.v1.INodeGroupList} message NodeGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.NodeGroup.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NodeGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {google.cloud.compute.v1.INodeGroupList} message NodeGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupList} NodeGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.NodeGroup.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupList} NodeGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeGroup.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeGroupList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupList} NodeGroupList + */ + NodeGroupList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupList) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NodeGroupList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.NodeGroup.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupList + * @static + * @param {google.cloud.compute.v1.NodeGroupList} message NodeGroupList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.NodeGroup.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NodeGroupList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupList + * @instance + * @returns {Object.} JSON object + */ + NodeGroupList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupList; + })(); + + v1.ServerBinding = (function() { + + /** + * Properties of a ServerBinding. + * @memberof google.cloud.compute.v1 + * @interface IServerBinding + * @property {google.cloud.compute.v1.ServerBinding.Type|null} [type] ServerBinding type + */ + + /** + * Constructs a new ServerBinding. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ServerBinding. + * @implements IServerBinding + * @constructor + * @param {google.cloud.compute.v1.IServerBinding=} [properties] Properties to set + */ + function ServerBinding(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServerBinding type. + * @member {google.cloud.compute.v1.ServerBinding.Type|null|undefined} type + * @memberof google.cloud.compute.v1.ServerBinding + * @instance + */ + ServerBinding.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ServerBinding _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.ServerBinding + * @instance + */ + Object.defineProperty(ServerBinding.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServerBinding instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {google.cloud.compute.v1.IServerBinding=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ServerBinding} ServerBinding instance + */ + ServerBinding.create = function create(properties) { + return new ServerBinding(properties); + }; + + /** + * Encodes the specified ServerBinding message. Does not implicitly {@link google.cloud.compute.v1.ServerBinding.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {google.cloud.compute.v1.IServerBinding} message ServerBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServerBinding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + return writer; + }; + + /** + * Encodes the specified ServerBinding message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ServerBinding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {google.cloud.compute.v1.IServerBinding} message ServerBinding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServerBinding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServerBinding message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ServerBinding} ServerBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServerBinding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ServerBinding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServerBinding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ServerBinding} ServerBinding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServerBinding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServerBinding message. + * @function verify + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServerBinding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 502950985: + case 204166495: + case 180825512: + break; + } + } + return null; + }; + + /** + * Creates a ServerBinding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ServerBinding} ServerBinding + */ + ServerBinding.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ServerBinding) + return object; + var message = new $root.google.cloud.compute.v1.ServerBinding(); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "RESTART_NODE_ON_ANY_SERVER": + case 502950985: + message.type = 502950985; + break; + case "RESTART_NODE_ON_MINIMAL_SERVERS": + case 204166495: + message.type = 204166495; + break; + case "SERVER_BINDING_TYPE_UNSPECIFIED": + case 180825512: + message.type = 180825512; + break; + } + return message; + }; + + /** + * Creates a plain object from a ServerBinding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ServerBinding + * @static + * @param {google.cloud.compute.v1.ServerBinding} message ServerBinding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServerBinding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.ServerBinding.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this ServerBinding to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ServerBinding + * @instance + * @returns {Object.} JSON object + */ + ServerBinding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.ServerBinding.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} RESTART_NODE_ON_ANY_SERVER=502950985 RESTART_NODE_ON_ANY_SERVER value + * @property {number} RESTART_NODE_ON_MINIMAL_SERVERS=204166495 RESTART_NODE_ON_MINIMAL_SERVERS value + * @property {number} SERVER_BINDING_TYPE_UNSPECIFIED=180825512 SERVER_BINDING_TYPE_UNSPECIFIED value + */ + ServerBinding.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[502950985] = "RESTART_NODE_ON_ANY_SERVER"] = 502950985; + values[valuesById[204166495] = "RESTART_NODE_ON_MINIMAL_SERVERS"] = 204166495; + values[valuesById[180825512] = "SERVER_BINDING_TYPE_UNSPECIFIED"] = 180825512; + return values; + })(); + + return ServerBinding; + })(); + + v1.NodeGroupNode = (function() { + + /** + * Properties of a NodeGroupNode. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupNode + * @property {Array.|null} [accelerators] NodeGroupNode accelerators + * @property {google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType|null} [cpuOvercommitType] NodeGroupNode cpuOvercommitType + * @property {Array.|null} [disks] NodeGroupNode disks + * @property {Array.|null} [instances] NodeGroupNode instances + * @property {string|null} [name] NodeGroupNode name + * @property {string|null} [nodeType] NodeGroupNode nodeType + * @property {boolean|null} [satisfiesPzs] NodeGroupNode satisfiesPzs + * @property {google.cloud.compute.v1.IServerBinding|null} [serverBinding] NodeGroupNode serverBinding + * @property {string|null} [serverId] NodeGroupNode serverId + * @property {google.cloud.compute.v1.NodeGroupNode.Status|null} [status] NodeGroupNode status + */ + + /** + * Constructs a new NodeGroupNode. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupNode. + * @implements INodeGroupNode + * @constructor + * @param {google.cloud.compute.v1.INodeGroupNode=} [properties] Properties to set + */ + function NodeGroupNode(properties) { + this.accelerators = []; + this.disks = []; + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupNode accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.accelerators = $util.emptyArray; + + /** + * NodeGroupNode cpuOvercommitType. + * @member {google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType|null|undefined} cpuOvercommitType + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.cpuOvercommitType = null; + + /** + * NodeGroupNode disks. + * @member {Array.} disks + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.disks = $util.emptyArray; + + /** + * NodeGroupNode instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.instances = $util.emptyArray; + + /** + * NodeGroupNode name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.name = null; + + /** + * NodeGroupNode nodeType. + * @member {string|null|undefined} nodeType + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.nodeType = null; + + /** + * NodeGroupNode satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.satisfiesPzs = null; + + /** + * NodeGroupNode serverBinding. + * @member {google.cloud.compute.v1.IServerBinding|null|undefined} serverBinding + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.serverBinding = null; + + /** + * NodeGroupNode serverId. + * @member {string|null|undefined} serverId + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.serverId = null; + + /** + * NodeGroupNode status. + * @member {google.cloud.compute.v1.NodeGroupNode.Status|null|undefined} status + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + NodeGroupNode.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupNode _cpuOvercommitType. + * @member {"cpuOvercommitType"|undefined} _cpuOvercommitType + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + Object.defineProperty(NodeGroupNode.prototype, "_cpuOvercommitType", { + get: $util.oneOfGetter($oneOfFields = ["cpuOvercommitType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupNode _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + Object.defineProperty(NodeGroupNode.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupNode _nodeType. + * @member {"nodeType"|undefined} _nodeType + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + Object.defineProperty(NodeGroupNode.prototype, "_nodeType", { + get: $util.oneOfGetter($oneOfFields = ["nodeType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupNode _satisfiesPzs. + * @member {"satisfiesPzs"|undefined} _satisfiesPzs + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + Object.defineProperty(NodeGroupNode.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupNode _serverBinding. + * @member {"serverBinding"|undefined} _serverBinding + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + Object.defineProperty(NodeGroupNode.prototype, "_serverBinding", { + get: $util.oneOfGetter($oneOfFields = ["serverBinding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupNode _serverId. + * @member {"serverId"|undefined} _serverId + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + Object.defineProperty(NodeGroupNode.prototype, "_serverId", { + get: $util.oneOfGetter($oneOfFields = ["serverId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupNode _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + */ + Object.defineProperty(NodeGroupNode.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupNode instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {google.cloud.compute.v1.INodeGroupNode=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupNode} NodeGroupNode instance + */ + NodeGroupNode.create = function create(properties) { + return new NodeGroupNode(properties); + }; + + /** + * Encodes the specified NodeGroupNode message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {google.cloud.compute.v1.INodeGroupNode} message NodeGroupNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.compute.v1.LocalDisk.encode(message.disks[i], writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.serverBinding != null && Object.hasOwnProperty.call(message, "serverBinding")) + $root.google.cloud.compute.v1.ServerBinding.encode(message.serverBinding, writer.uint32(/* id 208179593, wireType 2 =*/1665436746).fork()).ldelim(); + if (message.cpuOvercommitType != null && Object.hasOwnProperty.call(message, "cpuOvercommitType")) + writer.uint32(/* id 247727959, wireType 0 =*/1981823672).int32(message.cpuOvercommitType); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.compute.v1.AcceleratorConfig.encode(message.accelerators[i], writer.uint32(/* id 269577064, wireType 2 =*/2156616514).fork()).ldelim(); + if (message.serverId != null && Object.hasOwnProperty.call(message, "serverId")) + writer.uint32(/* id 339433367, wireType 2 =*/2715466938).string(message.serverId); + if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) + writer.uint32(/* id 465832791, wireType 2 =*/3726662330).string(message.nodeType); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 480964267, wireType 0 =*/3847714136).bool(message.satisfiesPzs); + return writer; + }; + + /** + * Encodes the specified NodeGroupNode message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {google.cloud.compute.v1.INodeGroupNode} message NodeGroupNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupNode} NodeGroupNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupNode.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269577064: + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.compute.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + case 247727959: + message.cpuOvercommitType = reader.int32(); + break; + case 95594102: + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.compute.v1.LocalDisk.decode(reader, reader.uint32())); + break; + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + case 3373707: + message.name = reader.string(); + break; + case 465832791: + message.nodeType = reader.string(); + break; + case 480964267: + message.satisfiesPzs = reader.bool(); + break; + case 208179593: + message.serverBinding = $root.google.cloud.compute.v1.ServerBinding.decode(reader, reader.uint32()); + break; + case 339433367: + message.serverId = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupNode} NodeGroupNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupNode message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorConfig.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.cpuOvercommitType != null && message.hasOwnProperty("cpuOvercommitType")) { + properties._cpuOvercommitType = 1; + switch (message.cpuOvercommitType) { + default: + return "cpuOvercommitType: enum value expected"; + case 0: + case 520665615: + case 182130465: + case 2402104: + break; + } + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.compute.v1.LocalDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + 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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.nodeType != null && message.hasOwnProperty("nodeType")) { + properties._nodeType = 1; + if (!$util.isString(message.nodeType)) + return "nodeType: string expected"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.serverBinding != null && message.hasOwnProperty("serverBinding")) { + properties._serverBinding = 1; + { + var error = $root.google.cloud.compute.v1.ServerBinding.verify(message.serverBinding); + if (error) + return "serverBinding." + error; + } + } + if (message.serverId != null && message.hasOwnProperty("serverId")) { + properties._serverId = 1; + if (!$util.isString(message.serverId)) + return "serverId: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 530283991: + case 77848963: + case 413483285: + break; + } + } + return null; + }; + + /** + * Creates a NodeGroupNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupNode} NodeGroupNode + */ + NodeGroupNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupNode) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupNode(); + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.compute.v1.NodeGroupNode.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupNode.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.compute.v1.AcceleratorConfig.fromObject(object.accelerators[i]); + } + } + switch (object.cpuOvercommitType) { + case "UNDEFINED_CPU_OVERCOMMIT_TYPE": + case 0: + message.cpuOvercommitType = 0; + break; + case "CPU_OVERCOMMIT_TYPE_UNSPECIFIED": + case 520665615: + message.cpuOvercommitType = 520665615; + break; + case "ENABLED": + case 182130465: + message.cpuOvercommitType = 182130465; + break; + case "NONE": + case 2402104: + message.cpuOvercommitType = 2402104; + break; + } + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.compute.v1.NodeGroupNode.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupNode.disks: object expected"); + message.disks[i] = $root.google.cloud.compute.v1.LocalDisk.fromObject(object.disks[i]); + } + } + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.NodeGroupNode.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + if (object.name != null) + message.name = String(object.name); + if (object.nodeType != null) + message.nodeType = String(object.nodeType); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.serverBinding != null) { + if (typeof object.serverBinding !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupNode.serverBinding: object expected"); + message.serverBinding = $root.google.cloud.compute.v1.ServerBinding.fromObject(object.serverBinding); + } + if (object.serverId != null) + message.serverId = String(object.serverId); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "INVALID": + case 530283991: + message.status = 530283991; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + case "REPAIRING": + case 413483285: + message.status = 413483285; + break; + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupNode + * @static + * @param {google.cloud.compute.v1.NodeGroupNode} message NodeGroupNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.disks = []; + object.accelerators = []; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.compute.v1.LocalDisk.toObject(message.disks[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.NodeGroupNode.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.serverBinding != null && message.hasOwnProperty("serverBinding")) { + object.serverBinding = $root.google.cloud.compute.v1.ServerBinding.toObject(message.serverBinding, options); + if (options.oneofs) + object._serverBinding = "serverBinding"; + } + if (message.cpuOvercommitType != null && message.hasOwnProperty("cpuOvercommitType")) { + object.cpuOvercommitType = options.enums === String ? $root.google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType[message.cpuOvercommitType] : message.cpuOvercommitType; + if (options.oneofs) + object._cpuOvercommitType = "cpuOvercommitType"; + } + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.compute.v1.AcceleratorConfig.toObject(message.accelerators[j], options); + } + if (message.serverId != null && message.hasOwnProperty("serverId")) { + object.serverId = message.serverId; + if (options.oneofs) + object._serverId = "serverId"; + } + if (message.nodeType != null && message.hasOwnProperty("nodeType")) { + object.nodeType = message.nodeType; + if (options.oneofs) + object._nodeType = "nodeType"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + return object; + }; + + /** + * Converts this NodeGroupNode to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupNode + * @instance + * @returns {Object.} JSON object + */ + NodeGroupNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CpuOvercommitType enum. + * @name google.cloud.compute.v1.NodeGroupNode.CpuOvercommitType + * @enum {number} + * @property {number} UNDEFINED_CPU_OVERCOMMIT_TYPE=0 UNDEFINED_CPU_OVERCOMMIT_TYPE value + * @property {number} CPU_OVERCOMMIT_TYPE_UNSPECIFIED=520665615 CPU_OVERCOMMIT_TYPE_UNSPECIFIED value + * @property {number} ENABLED=182130465 ENABLED value + * @property {number} NONE=2402104 NONE value + */ + NodeGroupNode.CpuOvercommitType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CPU_OVERCOMMIT_TYPE"] = 0; + values[valuesById[520665615] = "CPU_OVERCOMMIT_TYPE_UNSPECIFIED"] = 520665615; + values[valuesById[182130465] = "ENABLED"] = 182130465; + values[valuesById[2402104] = "NONE"] = 2402104; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.NodeGroupNode.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} INVALID=530283991 INVALID value + * @property {number} READY=77848963 READY value + * @property {number} REPAIRING=413483285 REPAIRING value + */ + NodeGroupNode.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[77848963] = "READY"] = 77848963; + values[valuesById[413483285] = "REPAIRING"] = 413483285; + return values; + })(); + + return NodeGroupNode; + })(); + + v1.NodeGroupsAddNodesRequest = (function() { + + /** + * Properties of a NodeGroupsAddNodesRequest. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupsAddNodesRequest + * @property {number|null} [additionalNodeCount] NodeGroupsAddNodesRequest additionalNodeCount + */ + + /** + * Constructs a new NodeGroupsAddNodesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupsAddNodesRequest. + * @implements INodeGroupsAddNodesRequest + * @constructor + * @param {google.cloud.compute.v1.INodeGroupsAddNodesRequest=} [properties] Properties to set + */ + function NodeGroupsAddNodesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupsAddNodesRequest additionalNodeCount. + * @member {number|null|undefined} additionalNodeCount + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @instance + */ + NodeGroupsAddNodesRequest.prototype.additionalNodeCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupsAddNodesRequest _additionalNodeCount. + * @member {"additionalNodeCount"|undefined} _additionalNodeCount + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @instance + */ + Object.defineProperty(NodeGroupsAddNodesRequest.prototype, "_additionalNodeCount", { + get: $util.oneOfGetter($oneOfFields = ["additionalNodeCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupsAddNodesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsAddNodesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupsAddNodesRequest} NodeGroupsAddNodesRequest instance + */ + NodeGroupsAddNodesRequest.create = function create(properties) { + return new NodeGroupsAddNodesRequest(properties); + }; + + /** + * Encodes the specified NodeGroupsAddNodesRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsAddNodesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsAddNodesRequest} message NodeGroupsAddNodesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsAddNodesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.additionalNodeCount != null && Object.hasOwnProperty.call(message, "additionalNodeCount")) + writer.uint32(/* id 134997930, wireType 0 =*/1079983440).int32(message.additionalNodeCount); + return writer; + }; + + /** + * Encodes the specified NodeGroupsAddNodesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsAddNodesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsAddNodesRequest} message NodeGroupsAddNodesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsAddNodesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupsAddNodesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupsAddNodesRequest} NodeGroupsAddNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsAddNodesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 134997930: + message.additionalNodeCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupsAddNodesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupsAddNodesRequest} NodeGroupsAddNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsAddNodesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupsAddNodesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupsAddNodesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.additionalNodeCount != null && message.hasOwnProperty("additionalNodeCount")) { + properties._additionalNodeCount = 1; + if (!$util.isInteger(message.additionalNodeCount)) + return "additionalNodeCount: integer expected"; + } + return null; + }; + + /** + * Creates a NodeGroupsAddNodesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupsAddNodesRequest} NodeGroupsAddNodesRequest + */ + NodeGroupsAddNodesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest(); + if (object.additionalNodeCount != null) + message.additionalNodeCount = object.additionalNodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a NodeGroupsAddNodesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @static + * @param {google.cloud.compute.v1.NodeGroupsAddNodesRequest} message NodeGroupsAddNodesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupsAddNodesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.additionalNodeCount != null && message.hasOwnProperty("additionalNodeCount")) { + object.additionalNodeCount = message.additionalNodeCount; + if (options.oneofs) + object._additionalNodeCount = "additionalNodeCount"; + } + return object; + }; + + /** + * Converts this NodeGroupsAddNodesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupsAddNodesRequest + * @instance + * @returns {Object.} JSON object + */ + NodeGroupsAddNodesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupsAddNodesRequest; + })(); + + v1.NodeGroupsDeleteNodesRequest = (function() { + + /** + * Properties of a NodeGroupsDeleteNodesRequest. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupsDeleteNodesRequest + * @property {Array.|null} [nodes] NodeGroupsDeleteNodesRequest nodes + */ + + /** + * Constructs a new NodeGroupsDeleteNodesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupsDeleteNodesRequest. + * @implements INodeGroupsDeleteNodesRequest + * @constructor + * @param {google.cloud.compute.v1.INodeGroupsDeleteNodesRequest=} [properties] Properties to set + */ + function NodeGroupsDeleteNodesRequest(properties) { + this.nodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupsDeleteNodesRequest nodes. + * @member {Array.} nodes + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @instance + */ + NodeGroupsDeleteNodesRequest.prototype.nodes = $util.emptyArray; + + /** + * Creates a new NodeGroupsDeleteNodesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsDeleteNodesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupsDeleteNodesRequest} NodeGroupsDeleteNodesRequest instance + */ + NodeGroupsDeleteNodesRequest.create = function create(properties) { + return new NodeGroupsDeleteNodesRequest(properties); + }; + + /** + * Encodes the specified NodeGroupsDeleteNodesRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsDeleteNodesRequest} message NodeGroupsDeleteNodesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsDeleteNodesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + writer.uint32(/* id 104993457, wireType 2 =*/839947658).string(message.nodes[i]); + return writer; + }; + + /** + * Encodes the specified NodeGroupsDeleteNodesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsDeleteNodesRequest} message NodeGroupsDeleteNodesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsDeleteNodesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupsDeleteNodesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupsDeleteNodesRequest} NodeGroupsDeleteNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsDeleteNodesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 104993457: + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupsDeleteNodesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupsDeleteNodesRequest} NodeGroupsDeleteNodesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsDeleteNodesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupsDeleteNodesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupsDeleteNodesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) + if (!$util.isString(message.nodes[i])) + return "nodes: string[] expected"; + } + return null; + }; + + /** + * Creates a NodeGroupsDeleteNodesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupsDeleteNodesRequest} NodeGroupsDeleteNodesRequest + */ + NodeGroupsDeleteNodesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest(); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) + message.nodes[i] = String(object.nodes[i]); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupsDeleteNodesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @static + * @param {google.cloud.compute.v1.NodeGroupsDeleteNodesRequest} message NodeGroupsDeleteNodesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupsDeleteNodesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = message.nodes[j]; + } + return object; + }; + + /** + * Converts this NodeGroupsDeleteNodesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupsDeleteNodesRequest + * @instance + * @returns {Object.} JSON object + */ + NodeGroupsDeleteNodesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupsDeleteNodesRequest; + })(); + + v1.NodeGroupsListNodes = (function() { + + /** + * Properties of a NodeGroupsListNodes. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupsListNodes + * @property {string|null} [id] NodeGroupsListNodes id + * @property {Array.|null} [items] NodeGroupsListNodes items + * @property {string|null} [kind] NodeGroupsListNodes kind + * @property {string|null} [nextPageToken] NodeGroupsListNodes nextPageToken + * @property {string|null} [selfLink] NodeGroupsListNodes selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeGroupsListNodes warning + */ + + /** + * Constructs a new NodeGroupsListNodes. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupsListNodes. + * @implements INodeGroupsListNodes + * @constructor + * @param {google.cloud.compute.v1.INodeGroupsListNodes=} [properties] Properties to set + */ + function NodeGroupsListNodes(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupsListNodes id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + NodeGroupsListNodes.prototype.id = null; + + /** + * NodeGroupsListNodes items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + NodeGroupsListNodes.prototype.items = $util.emptyArray; + + /** + * NodeGroupsListNodes kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + NodeGroupsListNodes.prototype.kind = null; + + /** + * NodeGroupsListNodes nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + NodeGroupsListNodes.prototype.nextPageToken = null; + + /** + * NodeGroupsListNodes selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + NodeGroupsListNodes.prototype.selfLink = null; + + /** + * NodeGroupsListNodes warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + NodeGroupsListNodes.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupsListNodes _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + Object.defineProperty(NodeGroupsListNodes.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupsListNodes _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + Object.defineProperty(NodeGroupsListNodes.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupsListNodes _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + Object.defineProperty(NodeGroupsListNodes.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupsListNodes _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + Object.defineProperty(NodeGroupsListNodes.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeGroupsListNodes _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + */ + Object.defineProperty(NodeGroupsListNodes.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupsListNodes instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {google.cloud.compute.v1.INodeGroupsListNodes=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupsListNodes} NodeGroupsListNodes instance + */ + NodeGroupsListNodes.create = function create(properties) { + return new NodeGroupsListNodes(properties); + }; + + /** + * Encodes the specified NodeGroupsListNodes message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsListNodes.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {google.cloud.compute.v1.INodeGroupsListNodes} message NodeGroupsListNodes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsListNodes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.NodeGroupNode.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NodeGroupsListNodes message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsListNodes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {google.cloud.compute.v1.INodeGroupsListNodes} message NodeGroupsListNodes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsListNodes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupsListNodes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupsListNodes} NodeGroupsListNodes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsListNodes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupsListNodes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.NodeGroupNode.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupsListNodes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupsListNodes} NodeGroupsListNodes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsListNodes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupsListNodes message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupsListNodes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeGroupNode.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeGroupsListNodes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupsListNodes} NodeGroupsListNodes + */ + NodeGroupsListNodes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupsListNodes) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupsListNodes(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NodeGroupsListNodes.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupsListNodes.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.NodeGroupNode.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeGroupsListNodes.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupsListNodes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @static + * @param {google.cloud.compute.v1.NodeGroupsListNodes} message NodeGroupsListNodes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupsListNodes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.NodeGroupNode.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NodeGroupsListNodes to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupsListNodes + * @instance + * @returns {Object.} JSON object + */ + NodeGroupsListNodes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupsListNodes; + })(); + + v1.NodeGroupsSetNodeTemplateRequest = (function() { + + /** + * Properties of a NodeGroupsSetNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface INodeGroupsSetNodeTemplateRequest + * @property {string|null} [nodeTemplate] NodeGroupsSetNodeTemplateRequest nodeTemplate + */ + + /** + * Constructs a new NodeGroupsSetNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroupsSetNodeTemplateRequest. + * @implements INodeGroupsSetNodeTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest=} [properties] Properties to set + */ + function NodeGroupsSetNodeTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupsSetNodeTemplateRequest nodeTemplate. + * @member {string|null|undefined} nodeTemplate + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @instance + */ + NodeGroupsSetNodeTemplateRequest.prototype.nodeTemplate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeGroupsSetNodeTemplateRequest _nodeTemplate. + * @member {"nodeTemplate"|undefined} _nodeTemplate + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @instance + */ + Object.defineProperty(NodeGroupsSetNodeTemplateRequest.prototype, "_nodeTemplate", { + get: $util.oneOfGetter($oneOfFields = ["nodeTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeGroupsSetNodeTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest} NodeGroupsSetNodeTemplateRequest instance + */ + NodeGroupsSetNodeTemplateRequest.create = function create(properties) { + return new NodeGroupsSetNodeTemplateRequest(properties); + }; + + /** + * Encodes the specified NodeGroupsSetNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest} message NodeGroupsSetNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsSetNodeTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeTemplate != null && Object.hasOwnProperty.call(message, "nodeTemplate")) + writer.uint32(/* id 323154455, wireType 2 =*/2585235642).string(message.nodeTemplate); + return writer; + }; + + /** + * Encodes the specified NodeGroupsSetNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest} message NodeGroupsSetNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupsSetNodeTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupsSetNodeTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest} NodeGroupsSetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsSetNodeTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 323154455: + message.nodeTemplate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupsSetNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest} NodeGroupsSetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupsSetNodeTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupsSetNodeTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupsSetNodeTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) { + properties._nodeTemplate = 1; + if (!$util.isString(message.nodeTemplate)) + return "nodeTemplate: string expected"; + } + return null; + }; + + /** + * Creates a NodeGroupsSetNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest} NodeGroupsSetNodeTemplateRequest + */ + NodeGroupsSetNodeTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest(); + if (object.nodeTemplate != null) + message.nodeTemplate = String(object.nodeTemplate); + return message; + }; + + /** + * Creates a plain object from a NodeGroupsSetNodeTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest} message NodeGroupsSetNodeTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupsSetNodeTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) { + object.nodeTemplate = message.nodeTemplate; + if (options.oneofs) + object._nodeTemplate = "nodeTemplate"; + } + return object; + }; + + /** + * Converts this NodeGroupsSetNodeTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + NodeGroupsSetNodeTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeGroupsSetNodeTemplateRequest; + })(); + + v1.NodeTemplateNodeTypeFlexibility = (function() { + + /** + * Properties of a NodeTemplateNodeTypeFlexibility. + * @memberof google.cloud.compute.v1 + * @interface INodeTemplateNodeTypeFlexibility + * @property {string|null} [cpus] NodeTemplateNodeTypeFlexibility cpus + * @property {string|null} [localSsd] NodeTemplateNodeTypeFlexibility localSsd + * @property {string|null} [memory] NodeTemplateNodeTypeFlexibility memory + */ + + /** + * Constructs a new NodeTemplateNodeTypeFlexibility. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTemplateNodeTypeFlexibility. + * @implements INodeTemplateNodeTypeFlexibility + * @constructor + * @param {google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility=} [properties] Properties to set + */ + function NodeTemplateNodeTypeFlexibility(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTemplateNodeTypeFlexibility cpus. + * @member {string|null|undefined} cpus + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @instance + */ + NodeTemplateNodeTypeFlexibility.prototype.cpus = null; + + /** + * NodeTemplateNodeTypeFlexibility localSsd. + * @member {string|null|undefined} localSsd + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @instance + */ + NodeTemplateNodeTypeFlexibility.prototype.localSsd = null; + + /** + * NodeTemplateNodeTypeFlexibility memory. + * @member {string|null|undefined} memory + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @instance + */ + NodeTemplateNodeTypeFlexibility.prototype.memory = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTemplateNodeTypeFlexibility _cpus. + * @member {"cpus"|undefined} _cpus + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @instance + */ + Object.defineProperty(NodeTemplateNodeTypeFlexibility.prototype, "_cpus", { + get: $util.oneOfGetter($oneOfFields = ["cpus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateNodeTypeFlexibility _localSsd. + * @member {"localSsd"|undefined} _localSsd + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @instance + */ + Object.defineProperty(NodeTemplateNodeTypeFlexibility.prototype, "_localSsd", { + get: $util.oneOfGetter($oneOfFields = ["localSsd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateNodeTypeFlexibility _memory. + * @member {"memory"|undefined} _memory + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @instance + */ + Object.defineProperty(NodeTemplateNodeTypeFlexibility.prototype, "_memory", { + get: $util.oneOfGetter($oneOfFields = ["memory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTemplateNodeTypeFlexibility instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility} NodeTemplateNodeTypeFlexibility instance + */ + NodeTemplateNodeTypeFlexibility.create = function create(properties) { + return new NodeTemplateNodeTypeFlexibility(properties); + }; + + /** + * Encodes the specified NodeTemplateNodeTypeFlexibility message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility} message NodeTemplateNodeTypeFlexibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplateNodeTypeFlexibility.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpus != null && Object.hasOwnProperty.call(message, "cpus")) + writer.uint32(/* id 3060683, wireType 2 =*/24485466).string(message.cpus); + if (message.localSsd != null && Object.hasOwnProperty.call(message, "localSsd")) + writer.uint32(/* id 405741360, wireType 2 =*/3245930882).string(message.localSsd); + if (message.memory != null && Object.hasOwnProperty.call(message, "memory")) + writer.uint32(/* id 532856065, wireType 2 =*/4262848522).string(message.memory); + return writer; + }; + + /** + * Encodes the specified NodeTemplateNodeTypeFlexibility message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility} message NodeTemplateNodeTypeFlexibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplateNodeTypeFlexibility.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTemplateNodeTypeFlexibility message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility} NodeTemplateNodeTypeFlexibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplateNodeTypeFlexibility.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3060683: + message.cpus = reader.string(); + break; + case 405741360: + message.localSsd = reader.string(); + break; + case 532856065: + message.memory = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTemplateNodeTypeFlexibility message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility} NodeTemplateNodeTypeFlexibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplateNodeTypeFlexibility.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTemplateNodeTypeFlexibility message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTemplateNodeTypeFlexibility.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cpus != null && message.hasOwnProperty("cpus")) { + properties._cpus = 1; + if (!$util.isString(message.cpus)) + return "cpus: string expected"; + } + if (message.localSsd != null && message.hasOwnProperty("localSsd")) { + properties._localSsd = 1; + if (!$util.isString(message.localSsd)) + return "localSsd: string expected"; + } + if (message.memory != null && message.hasOwnProperty("memory")) { + properties._memory = 1; + if (!$util.isString(message.memory)) + return "memory: string expected"; + } + return null; + }; + + /** + * Creates a NodeTemplateNodeTypeFlexibility message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility} NodeTemplateNodeTypeFlexibility + */ + NodeTemplateNodeTypeFlexibility.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility) + return object; + var message = new $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility(); + if (object.cpus != null) + message.cpus = String(object.cpus); + if (object.localSsd != null) + message.localSsd = String(object.localSsd); + if (object.memory != null) + message.memory = String(object.memory); + return message; + }; + + /** + * Creates a plain object from a NodeTemplateNodeTypeFlexibility message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @static + * @param {google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility} message NodeTemplateNodeTypeFlexibility + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTemplateNodeTypeFlexibility.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.cpus != null && message.hasOwnProperty("cpus")) { + object.cpus = message.cpus; + if (options.oneofs) + object._cpus = "cpus"; + } + if (message.localSsd != null && message.hasOwnProperty("localSsd")) { + object.localSsd = message.localSsd; + if (options.oneofs) + object._localSsd = "localSsd"; + } + if (message.memory != null && message.hasOwnProperty("memory")) { + object.memory = message.memory; + if (options.oneofs) + object._memory = "memory"; + } + return object; + }; + + /** + * Converts this NodeTemplateNodeTypeFlexibility to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility + * @instance + * @returns {Object.} JSON object + */ + NodeTemplateNodeTypeFlexibility.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeTemplateNodeTypeFlexibility; + })(); + + v1.NodeTemplate = (function() { + + /** + * Properties of a NodeTemplate. + * @memberof google.cloud.compute.v1 + * @interface INodeTemplate + * @property {Array.|null} [accelerators] NodeTemplate accelerators + * @property {google.cloud.compute.v1.NodeTemplate.CpuOvercommitType|null} [cpuOvercommitType] NodeTemplate cpuOvercommitType + * @property {string|null} [creationTimestamp] NodeTemplate creationTimestamp + * @property {string|null} [description] NodeTemplate description + * @property {Array.|null} [disks] NodeTemplate disks + * @property {number|Long|null} [id] NodeTemplate id + * @property {string|null} [kind] NodeTemplate kind + * @property {string|null} [name] NodeTemplate name + * @property {Object.|null} [nodeAffinityLabels] NodeTemplate nodeAffinityLabels + * @property {string|null} [nodeType] NodeTemplate nodeType + * @property {google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility|null} [nodeTypeFlexibility] NodeTemplate nodeTypeFlexibility + * @property {string|null} [region] NodeTemplate region + * @property {string|null} [selfLink] NodeTemplate selfLink + * @property {google.cloud.compute.v1.IServerBinding|null} [serverBinding] NodeTemplate serverBinding + * @property {google.cloud.compute.v1.NodeTemplate.Status|null} [status] NodeTemplate status + * @property {string|null} [statusMessage] NodeTemplate statusMessage + */ + + /** + * Constructs a new NodeTemplate. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTemplate. + * @implements INodeTemplate + * @constructor + * @param {google.cloud.compute.v1.INodeTemplate=} [properties] Properties to set + */ + function NodeTemplate(properties) { + this.accelerators = []; + this.disks = []; + this.nodeAffinityLabels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTemplate accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.accelerators = $util.emptyArray; + + /** + * NodeTemplate cpuOvercommitType. + * @member {google.cloud.compute.v1.NodeTemplate.CpuOvercommitType|null|undefined} cpuOvercommitType + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.cpuOvercommitType = null; + + /** + * NodeTemplate creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.creationTimestamp = null; + + /** + * NodeTemplate description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.description = null; + + /** + * NodeTemplate disks. + * @member {Array.} disks + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.disks = $util.emptyArray; + + /** + * NodeTemplate id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.id = null; + + /** + * NodeTemplate kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.kind = null; + + /** + * NodeTemplate name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.name = null; + + /** + * NodeTemplate nodeAffinityLabels. + * @member {Object.} nodeAffinityLabels + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.nodeAffinityLabels = $util.emptyObject; + + /** + * NodeTemplate nodeType. + * @member {string|null|undefined} nodeType + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.nodeType = null; + + /** + * NodeTemplate nodeTypeFlexibility. + * @member {google.cloud.compute.v1.INodeTemplateNodeTypeFlexibility|null|undefined} nodeTypeFlexibility + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.nodeTypeFlexibility = null; + + /** + * NodeTemplate region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.region = null; + + /** + * NodeTemplate selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.selfLink = null; + + /** + * NodeTemplate serverBinding. + * @member {google.cloud.compute.v1.IServerBinding|null|undefined} serverBinding + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.serverBinding = null; + + /** + * NodeTemplate status. + * @member {google.cloud.compute.v1.NodeTemplate.Status|null|undefined} status + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.status = null; + + /** + * NodeTemplate statusMessage. + * @member {string|null|undefined} statusMessage + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + NodeTemplate.prototype.statusMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTemplate _cpuOvercommitType. + * @member {"cpuOvercommitType"|undefined} _cpuOvercommitType + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_cpuOvercommitType", { + get: $util.oneOfGetter($oneOfFields = ["cpuOvercommitType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _nodeType. + * @member {"nodeType"|undefined} _nodeType + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_nodeType", { + get: $util.oneOfGetter($oneOfFields = ["nodeType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _nodeTypeFlexibility. + * @member {"nodeTypeFlexibility"|undefined} _nodeTypeFlexibility + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_nodeTypeFlexibility", { + get: $util.oneOfGetter($oneOfFields = ["nodeTypeFlexibility"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _serverBinding. + * @member {"serverBinding"|undefined} _serverBinding + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_serverBinding", { + get: $util.oneOfGetter($oneOfFields = ["serverBinding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplate _statusMessage. + * @member {"statusMessage"|undefined} _statusMessage + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + */ + Object.defineProperty(NodeTemplate.prototype, "_statusMessage", { + get: $util.oneOfGetter($oneOfFields = ["statusMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {google.cloud.compute.v1.INodeTemplate=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTemplate} NodeTemplate instance + */ + NodeTemplate.create = function create(properties) { + return new NodeTemplate(properties); + }; + + /** + * Encodes the specified NodeTemplate message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {google.cloud.compute.v1.INodeTemplate} message NodeTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.compute.v1.LocalDisk.encode(message.disks[i], writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.serverBinding != null && Object.hasOwnProperty.call(message, "serverBinding")) + $root.google.cloud.compute.v1.ServerBinding.encode(message.serverBinding, writer.uint32(/* id 208179593, wireType 2 =*/1665436746).fork()).ldelim(); + if (message.cpuOvercommitType != null && Object.hasOwnProperty.call(message, "cpuOvercommitType")) + writer.uint32(/* id 247727959, wireType 0 =*/1981823672).int32(message.cpuOvercommitType); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.compute.v1.AcceleratorConfig.encode(message.accelerators[i], writer.uint32(/* id 269577064, wireType 2 =*/2156616514).fork()).ldelim(); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 297428154, wireType 2 =*/2379425234).string(message.statusMessage); + if (message.nodeTypeFlexibility != null && Object.hasOwnProperty.call(message, "nodeTypeFlexibility")) + $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.encode(message.nodeTypeFlexibility, writer.uint32(/* id 315257905, wireType 2 =*/2522063242).fork()).ldelim(); + if (message.nodeAffinityLabels != null && Object.hasOwnProperty.call(message, "nodeAffinityLabels")) + for (var keys = Object.keys(message.nodeAffinityLabels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 339007161, wireType 2 =*/2712057290).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.nodeAffinityLabels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) + writer.uint32(/* id 465832791, wireType 2 =*/3726662330).string(message.nodeType); + return writer; + }; + + /** + * Encodes the specified NodeTemplate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {google.cloud.compute.v1.INodeTemplate} message NodeTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTemplate} NodeTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTemplate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269577064: + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.compute.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + case 247727959: + message.cpuOvercommitType = reader.int32(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 95594102: + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.compute.v1.LocalDisk.decode(reader, reader.uint32())); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 339007161: + if (message.nodeAffinityLabels === $util.emptyObject) + message.nodeAffinityLabels = {}; + 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.nodeAffinityLabels[key] = value; + break; + case 465832791: + message.nodeType = reader.string(); + break; + case 315257905: + message.nodeTypeFlexibility = $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.decode(reader, reader.uint32()); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 208179593: + message.serverBinding = $root.google.cloud.compute.v1.ServerBinding.decode(reader, reader.uint32()); + break; + case 181260274: + message.status = reader.int32(); + break; + case 297428154: + message.statusMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTemplate} NodeTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTemplate message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.compute.v1.AcceleratorConfig.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.cpuOvercommitType != null && message.hasOwnProperty("cpuOvercommitType")) { + properties._cpuOvercommitType = 1; + switch (message.cpuOvercommitType) { + default: + return "cpuOvercommitType: enum value expected"; + case 0: + case 520665615: + case 182130465: + case 2402104: + break; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.compute.v1.LocalDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.nodeAffinityLabels != null && message.hasOwnProperty("nodeAffinityLabels")) { + if (!$util.isObject(message.nodeAffinityLabels)) + return "nodeAffinityLabels: object expected"; + var key = Object.keys(message.nodeAffinityLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.nodeAffinityLabels[key[i]])) + return "nodeAffinityLabels: string{k:string} expected"; + } + if (message.nodeType != null && message.hasOwnProperty("nodeType")) { + properties._nodeType = 1; + if (!$util.isString(message.nodeType)) + return "nodeType: string expected"; + } + if (message.nodeTypeFlexibility != null && message.hasOwnProperty("nodeTypeFlexibility")) { + properties._nodeTypeFlexibility = 1; + { + var error = $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.verify(message.nodeTypeFlexibility); + if (error) + return "nodeTypeFlexibility." + error; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.serverBinding != null && message.hasOwnProperty("serverBinding")) { + properties._serverBinding = 1; + { + var error = $root.google.cloud.compute.v1.ServerBinding.verify(message.serverBinding); + if (error) + return "serverBinding." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 530283991: + case 77848963: + break; + } + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + properties._statusMessage = 1; + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + } + return null; + }; + + /** + * Creates a NodeTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTemplate} NodeTemplate + */ + NodeTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTemplate) + return object; + var message = new $root.google.cloud.compute.v1.NodeTemplate(); + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.compute.v1.NodeTemplate.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplate.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.compute.v1.AcceleratorConfig.fromObject(object.accelerators[i]); + } + } + switch (object.cpuOvercommitType) { + case "UNDEFINED_CPU_OVERCOMMIT_TYPE": + case 0: + message.cpuOvercommitType = 0; + break; + case "CPU_OVERCOMMIT_TYPE_UNSPECIFIED": + case 520665615: + message.cpuOvercommitType = 520665615; + break; + case "ENABLED": + case 182130465: + message.cpuOvercommitType = 182130465; + break; + case "NONE": + case 2402104: + message.cpuOvercommitType = 2402104; + break; + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.compute.v1.NodeTemplate.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplate.disks: object expected"); + message.disks[i] = $root.google.cloud.compute.v1.LocalDisk.fromObject(object.disks[i]); + } + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.nodeAffinityLabels) { + if (typeof object.nodeAffinityLabels !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplate.nodeAffinityLabels: object expected"); + message.nodeAffinityLabels = {}; + for (var keys = Object.keys(object.nodeAffinityLabels), i = 0; i < keys.length; ++i) + message.nodeAffinityLabels[keys[i]] = String(object.nodeAffinityLabels[keys[i]]); + } + if (object.nodeType != null) + message.nodeType = String(object.nodeType); + if (object.nodeTypeFlexibility != null) { + if (typeof object.nodeTypeFlexibility !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplate.nodeTypeFlexibility: object expected"); + message.nodeTypeFlexibility = $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.fromObject(object.nodeTypeFlexibility); + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.serverBinding != null) { + if (typeof object.serverBinding !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplate.serverBinding: object expected"); + message.serverBinding = $root.google.cloud.compute.v1.ServerBinding.fromObject(object.serverBinding); + } + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "INVALID": + case 530283991: + message.status = 530283991; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + return message; + }; + + /** + * Creates a plain object from a NodeTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTemplate + * @static + * @param {google.cloud.compute.v1.NodeTemplate} message NodeTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.disks = []; + object.accelerators = []; + } + if (options.objects || options.defaults) + object.nodeAffinityLabels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.compute.v1.LocalDisk.toObject(message.disks[j], options); + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.NodeTemplate.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.serverBinding != null && message.hasOwnProperty("serverBinding")) { + object.serverBinding = $root.google.cloud.compute.v1.ServerBinding.toObject(message.serverBinding, options); + if (options.oneofs) + object._serverBinding = "serverBinding"; + } + if (message.cpuOvercommitType != null && message.hasOwnProperty("cpuOvercommitType")) { + object.cpuOvercommitType = options.enums === String ? $root.google.cloud.compute.v1.NodeTemplate.CpuOvercommitType[message.cpuOvercommitType] : message.cpuOvercommitType; + if (options.oneofs) + object._cpuOvercommitType = "cpuOvercommitType"; + } + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.compute.v1.AcceleratorConfig.toObject(message.accelerators[j], options); + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + object.statusMessage = message.statusMessage; + if (options.oneofs) + object._statusMessage = "statusMessage"; + } + if (message.nodeTypeFlexibility != null && message.hasOwnProperty("nodeTypeFlexibility")) { + object.nodeTypeFlexibility = $root.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility.toObject(message.nodeTypeFlexibility, options); + if (options.oneofs) + object._nodeTypeFlexibility = "nodeTypeFlexibility"; + } + var keys2; + if (message.nodeAffinityLabels && (keys2 = Object.keys(message.nodeAffinityLabels)).length) { + object.nodeAffinityLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.nodeAffinityLabels[keys2[j]] = message.nodeAffinityLabels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.nodeType != null && message.hasOwnProperty("nodeType")) { + object.nodeType = message.nodeType; + if (options.oneofs) + object._nodeType = "nodeType"; + } + return object; + }; + + /** + * Converts this NodeTemplate to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTemplate + * @instance + * @returns {Object.} JSON object + */ + NodeTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CpuOvercommitType enum. + * @name google.cloud.compute.v1.NodeTemplate.CpuOvercommitType + * @enum {number} + * @property {number} UNDEFINED_CPU_OVERCOMMIT_TYPE=0 UNDEFINED_CPU_OVERCOMMIT_TYPE value + * @property {number} CPU_OVERCOMMIT_TYPE_UNSPECIFIED=520665615 CPU_OVERCOMMIT_TYPE_UNSPECIFIED value + * @property {number} ENABLED=182130465 ENABLED value + * @property {number} NONE=2402104 NONE value + */ + NodeTemplate.CpuOvercommitType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CPU_OVERCOMMIT_TYPE"] = 0; + values[valuesById[520665615] = "CPU_OVERCOMMIT_TYPE_UNSPECIFIED"] = 520665615; + values[valuesById[182130465] = "ENABLED"] = 182130465; + values[valuesById[2402104] = "NONE"] = 2402104; + return values; + })(); + + /** + * Status enum. + * @name google.cloud.compute.v1.NodeTemplate.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} INVALID=530283991 INVALID value + * @property {number} READY=77848963 READY value + */ + NodeTemplate.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[77848963] = "READY"] = 77848963; + return values; + })(); + + return NodeTemplate; + })(); + + v1.NodeTemplatesScopedList = (function() { + + /** + * Properties of a NodeTemplatesScopedList. + * @memberof google.cloud.compute.v1 + * @interface INodeTemplatesScopedList + * @property {Array.|null} [nodeTemplates] NodeTemplatesScopedList nodeTemplates + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeTemplatesScopedList warning + */ + + /** + * Constructs a new NodeTemplatesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTemplatesScopedList. + * @implements INodeTemplatesScopedList + * @constructor + * @param {google.cloud.compute.v1.INodeTemplatesScopedList=} [properties] Properties to set + */ + function NodeTemplatesScopedList(properties) { + this.nodeTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTemplatesScopedList nodeTemplates. + * @member {Array.} nodeTemplates + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @instance + */ + NodeTemplatesScopedList.prototype.nodeTemplates = $util.emptyArray; + + /** + * NodeTemplatesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @instance + */ + NodeTemplatesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTemplatesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @instance + */ + Object.defineProperty(NodeTemplatesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTemplatesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {google.cloud.compute.v1.INodeTemplatesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTemplatesScopedList} NodeTemplatesScopedList instance + */ + NodeTemplatesScopedList.create = function create(properties) { + return new NodeTemplatesScopedList(properties); + }; + + /** + * Encodes the specified NodeTemplatesScopedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplatesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {google.cloud.compute.v1.INodeTemplatesScopedList} message NodeTemplatesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplatesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nodeTemplates != null && message.nodeTemplates.length) + for (var i = 0; i < message.nodeTemplates.length; ++i) + $root.google.cloud.compute.v1.NodeTemplate.encode(message.nodeTemplates[i], writer.uint32(/* id 354111804, wireType 2 =*/2832894434).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeTemplatesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplatesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {google.cloud.compute.v1.INodeTemplatesScopedList} message NodeTemplatesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplatesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTemplatesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTemplatesScopedList} NodeTemplatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplatesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTemplatesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 354111804: + if (!(message.nodeTemplates && message.nodeTemplates.length)) + message.nodeTemplates = []; + message.nodeTemplates.push($root.google.cloud.compute.v1.NodeTemplate.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTemplatesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTemplatesScopedList} NodeTemplatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplatesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTemplatesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTemplatesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeTemplates != null && message.hasOwnProperty("nodeTemplates")) { + if (!Array.isArray(message.nodeTemplates)) + return "nodeTemplates: array expected"; + for (var i = 0; i < message.nodeTemplates.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeTemplate.verify(message.nodeTemplates[i]); + if (error) + return "nodeTemplates." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeTemplatesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTemplatesScopedList} NodeTemplatesScopedList + */ + NodeTemplatesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTemplatesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.NodeTemplatesScopedList(); + if (object.nodeTemplates) { + if (!Array.isArray(object.nodeTemplates)) + throw TypeError(".google.cloud.compute.v1.NodeTemplatesScopedList.nodeTemplates: array expected"); + message.nodeTemplates = []; + for (var i = 0; i < object.nodeTemplates.length; ++i) { + if (typeof object.nodeTemplates[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplatesScopedList.nodeTemplates: object expected"); + message.nodeTemplates[i] = $root.google.cloud.compute.v1.NodeTemplate.fromObject(object.nodeTemplates[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplatesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeTemplatesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @static + * @param {google.cloud.compute.v1.NodeTemplatesScopedList} message NodeTemplatesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTemplatesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeTemplates = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nodeTemplates && message.nodeTemplates.length) { + object.nodeTemplates = []; + for (var j = 0; j < message.nodeTemplates.length; ++j) + object.nodeTemplates[j] = $root.google.cloud.compute.v1.NodeTemplate.toObject(message.nodeTemplates[j], options); + } + return object; + }; + + /** + * Converts this NodeTemplatesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTemplatesScopedList + * @instance + * @returns {Object.} JSON object + */ + NodeTemplatesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeTemplatesScopedList; + })(); + + v1.NodeTemplateAggregatedList = (function() { + + /** + * Properties of a NodeTemplateAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface INodeTemplateAggregatedList + * @property {string|null} [id] NodeTemplateAggregatedList id + * @property {Object.|null} [items] NodeTemplateAggregatedList items + * @property {string|null} [kind] NodeTemplateAggregatedList kind + * @property {string|null} [nextPageToken] NodeTemplateAggregatedList nextPageToken + * @property {string|null} [selfLink] NodeTemplateAggregatedList selfLink + * @property {Array.|null} [unreachables] NodeTemplateAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeTemplateAggregatedList warning + */ + + /** + * Constructs a new NodeTemplateAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTemplateAggregatedList. + * @implements INodeTemplateAggregatedList + * @constructor + * @param {google.cloud.compute.v1.INodeTemplateAggregatedList=} [properties] Properties to set + */ + function NodeTemplateAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTemplateAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + NodeTemplateAggregatedList.prototype.id = null; + + /** + * NodeTemplateAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + NodeTemplateAggregatedList.prototype.items = $util.emptyObject; + + /** + * NodeTemplateAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + NodeTemplateAggregatedList.prototype.kind = null; + + /** + * NodeTemplateAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + NodeTemplateAggregatedList.prototype.nextPageToken = null; + + /** + * NodeTemplateAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + NodeTemplateAggregatedList.prototype.selfLink = null; + + /** + * NodeTemplateAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + NodeTemplateAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * NodeTemplateAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + NodeTemplateAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTemplateAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + Object.defineProperty(NodeTemplateAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + Object.defineProperty(NodeTemplateAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + Object.defineProperty(NodeTemplateAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + Object.defineProperty(NodeTemplateAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + */ + Object.defineProperty(NodeTemplateAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTemplateAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeTemplateAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTemplateAggregatedList} NodeTemplateAggregatedList instance + */ + NodeTemplateAggregatedList.create = function create(properties) { + return new NodeTemplateAggregatedList(properties); + }; + + /** + * Encodes the specified NodeTemplateAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeTemplateAggregatedList} message NodeTemplateAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplateAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.NodeTemplatesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NodeTemplateAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeTemplateAggregatedList} message NodeTemplateAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplateAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTemplateAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTemplateAggregatedList} NodeTemplateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplateAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTemplateAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.NodeTemplatesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTemplateAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTemplateAggregatedList} NodeTemplateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplateAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTemplateAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTemplateAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeTemplatesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeTemplateAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTemplateAggregatedList} NodeTemplateAggregatedList + */ + NodeTemplateAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTemplateAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.NodeTemplateAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplateAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplateAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.NodeTemplatesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.NodeTemplateAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplateAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeTemplateAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @static + * @param {google.cloud.compute.v1.NodeTemplateAggregatedList} message NodeTemplateAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTemplateAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.NodeTemplatesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NodeTemplateAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTemplateAggregatedList + * @instance + * @returns {Object.} JSON object + */ + NodeTemplateAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeTemplateAggregatedList; + })(); + + v1.NodeTemplateList = (function() { + + /** + * Properties of a NodeTemplateList. + * @memberof google.cloud.compute.v1 + * @interface INodeTemplateList + * @property {string|null} [id] NodeTemplateList id + * @property {Array.|null} [items] NodeTemplateList items + * @property {string|null} [kind] NodeTemplateList kind + * @property {string|null} [nextPageToken] NodeTemplateList nextPageToken + * @property {string|null} [selfLink] NodeTemplateList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeTemplateList warning + */ + + /** + * Constructs a new NodeTemplateList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTemplateList. + * @implements INodeTemplateList + * @constructor + * @param {google.cloud.compute.v1.INodeTemplateList=} [properties] Properties to set + */ + function NodeTemplateList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTemplateList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + NodeTemplateList.prototype.id = null; + + /** + * NodeTemplateList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + NodeTemplateList.prototype.items = $util.emptyArray; + + /** + * NodeTemplateList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + NodeTemplateList.prototype.kind = null; + + /** + * NodeTemplateList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + NodeTemplateList.prototype.nextPageToken = null; + + /** + * NodeTemplateList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + NodeTemplateList.prototype.selfLink = null; + + /** + * NodeTemplateList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + NodeTemplateList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTemplateList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + Object.defineProperty(NodeTemplateList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + Object.defineProperty(NodeTemplateList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + Object.defineProperty(NodeTemplateList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + Object.defineProperty(NodeTemplateList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTemplateList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + */ + Object.defineProperty(NodeTemplateList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTemplateList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {google.cloud.compute.v1.INodeTemplateList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTemplateList} NodeTemplateList instance + */ + NodeTemplateList.create = function create(properties) { + return new NodeTemplateList(properties); + }; + + /** + * Encodes the specified NodeTemplateList message. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {google.cloud.compute.v1.INodeTemplateList} message NodeTemplateList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplateList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.NodeTemplate.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NodeTemplateList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTemplateList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {google.cloud.compute.v1.INodeTemplateList} message NodeTemplateList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTemplateList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTemplateList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTemplateList} NodeTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplateList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTemplateList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.NodeTemplate.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTemplateList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTemplateList} NodeTemplateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTemplateList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTemplateList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTemplateList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeTemplate.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeTemplateList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTemplateList} NodeTemplateList + */ + NodeTemplateList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTemplateList) + return object; + var message = new $root.google.cloud.compute.v1.NodeTemplateList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NodeTemplateList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplateList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.NodeTemplate.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTemplateList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeTemplateList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTemplateList + * @static + * @param {google.cloud.compute.v1.NodeTemplateList} message NodeTemplateList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTemplateList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.NodeTemplate.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NodeTemplateList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTemplateList + * @instance + * @returns {Object.} JSON object + */ + NodeTemplateList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeTemplateList; + })(); + + v1.NodeType = (function() { + + /** + * Properties of a NodeType. + * @memberof google.cloud.compute.v1 + * @interface INodeType + * @property {string|null} [cpuPlatform] NodeType cpuPlatform + * @property {string|null} [creationTimestamp] NodeType creationTimestamp + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecated] NodeType deprecated + * @property {string|null} [description] NodeType description + * @property {number|null} [guestCpus] NodeType guestCpus + * @property {number|Long|null} [id] NodeType id + * @property {string|null} [kind] NodeType kind + * @property {number|null} [localSsdGb] NodeType localSsdGb + * @property {number|null} [memoryMb] NodeType memoryMb + * @property {string|null} [name] NodeType name + * @property {string|null} [selfLink] NodeType selfLink + * @property {string|null} [zone] NodeType zone + */ + + /** + * Constructs a new NodeType. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeType. + * @implements INodeType + * @constructor + * @param {google.cloud.compute.v1.INodeType=} [properties] Properties to set + */ + function NodeType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeType cpuPlatform. + * @member {string|null|undefined} cpuPlatform + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.cpuPlatform = null; + + /** + * NodeType creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.creationTimestamp = null; + + /** + * NodeType deprecated. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecated + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.deprecated = null; + + /** + * NodeType description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.description = null; + + /** + * NodeType guestCpus. + * @member {number|null|undefined} guestCpus + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.guestCpus = null; + + /** + * NodeType id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.id = null; + + /** + * NodeType kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.kind = null; + + /** + * NodeType localSsdGb. + * @member {number|null|undefined} localSsdGb + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.localSsdGb = null; + + /** + * NodeType memoryMb. + * @member {number|null|undefined} memoryMb + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.memoryMb = null; + + /** + * NodeType name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.name = null; + + /** + * NodeType selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.selfLink = null; + + /** + * NodeType zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + NodeType.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeType _cpuPlatform. + * @member {"cpuPlatform"|undefined} _cpuPlatform + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_cpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["cpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _guestCpus. + * @member {"guestCpus"|undefined} _guestCpus + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_guestCpus", { + get: $util.oneOfGetter($oneOfFields = ["guestCpus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _localSsdGb. + * @member {"localSsdGb"|undefined} _localSsdGb + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_localSsdGb", { + get: $util.oneOfGetter($oneOfFields = ["localSsdGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _memoryMb. + * @member {"memoryMb"|undefined} _memoryMb + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_memoryMb", { + get: $util.oneOfGetter($oneOfFields = ["memoryMb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeType _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.NodeType + * @instance + */ + Object.defineProperty(NodeType.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeType instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {google.cloud.compute.v1.INodeType=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeType} NodeType instance + */ + NodeType.create = function create(properties) { + return new NodeType(properties); + }; + + /** + * Encodes the specified NodeType message. Does not implicitly {@link google.cloud.compute.v1.NodeType.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {google.cloud.compute.v1.INodeType} message NodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.memoryMb != null && Object.hasOwnProperty.call(message, "memoryMb")) + writer.uint32(/* id 116001171, wireType 0 =*/928009368).int32(message.memoryMb); + if (message.localSsdGb != null && Object.hasOwnProperty.call(message, "localSsdGb")) + writer.uint32(/* id 329237578, wireType 0 =*/2633900624).int32(message.localSsdGb); + if (message.guestCpus != null && Object.hasOwnProperty.call(message, "guestCpus")) + writer.uint32(/* id 393356754, wireType 0 =*/3146854032).int32(message.guestCpus); + if (message.cpuPlatform != null && Object.hasOwnProperty.call(message, "cpuPlatform")) + writer.uint32(/* id 410285354, wireType 2 =*/3282282834).string(message.cpuPlatform); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecated, writer.uint32(/* id 515138995, wireType 2 =*/4121111962).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeType message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {google.cloud.compute.v1.INodeType} message NodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeType} NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 410285354: + message.cpuPlatform = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 515138995: + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 393356754: + message.guestCpus = reader.int32(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 329237578: + message.localSsdGb = reader.int32(); + break; + case 116001171: + message.memoryMb = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeType} NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeType message. + * @function verify + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cpuPlatform != null && message.hasOwnProperty("cpuPlatform")) { + properties._cpuPlatform = 1; + if (!$util.isString(message.cpuPlatform)) + return "cpuPlatform: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecated); + if (error) + return "deprecated." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.guestCpus != null && message.hasOwnProperty("guestCpus")) { + properties._guestCpus = 1; + if (!$util.isInteger(message.guestCpus)) + return "guestCpus: integer expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.localSsdGb != null && message.hasOwnProperty("localSsdGb")) { + properties._localSsdGb = 1; + if (!$util.isInteger(message.localSsdGb)) + return "localSsdGb: integer expected"; + } + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) { + properties._memoryMb = 1; + if (!$util.isInteger(message.memoryMb)) + return "memoryMb: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a NodeType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeType} NodeType + */ + NodeType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeType) + return object; + var message = new $root.google.cloud.compute.v1.NodeType(); + if (object.cpuPlatform != null) + message.cpuPlatform = String(object.cpuPlatform); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.deprecated != null) { + if (typeof object.deprecated !== "object") + throw TypeError(".google.cloud.compute.v1.NodeType.deprecated: object expected"); + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecated); + } + if (object.description != null) + message.description = String(object.description); + if (object.guestCpus != null) + message.guestCpus = object.guestCpus | 0; + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.localSsdGb != null) + message.localSsdGb = object.localSsdGb | 0; + if (object.memoryMb != null) + message.memoryMb = object.memoryMb | 0; + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a NodeType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeType + * @static + * @param {google.cloud.compute.v1.NodeType} message NodeType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) { + object.memoryMb = message.memoryMb; + if (options.oneofs) + object._memoryMb = "memoryMb"; + } + if (message.localSsdGb != null && message.hasOwnProperty("localSsdGb")) { + object.localSsdGb = message.localSsdGb; + if (options.oneofs) + object._localSsdGb = "localSsdGb"; + } + if (message.guestCpus != null && message.hasOwnProperty("guestCpus")) { + object.guestCpus = message.guestCpus; + if (options.oneofs) + object._guestCpus = "guestCpus"; + } + if (message.cpuPlatform != null && message.hasOwnProperty("cpuPlatform")) { + object.cpuPlatform = message.cpuPlatform; + if (options.oneofs) + object._cpuPlatform = "cpuPlatform"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecated, options); + if (options.oneofs) + object._deprecated = "deprecated"; + } + return object; + }; + + /** + * Converts this NodeType to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeType + * @instance + * @returns {Object.} JSON object + */ + NodeType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeType; + })(); + + v1.NodeTypesScopedList = (function() { + + /** + * Properties of a NodeTypesScopedList. + * @memberof google.cloud.compute.v1 + * @interface INodeTypesScopedList + * @property {Array.|null} [nodeTypes] NodeTypesScopedList nodeTypes + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeTypesScopedList warning + */ + + /** + * Constructs a new NodeTypesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTypesScopedList. + * @implements INodeTypesScopedList + * @constructor + * @param {google.cloud.compute.v1.INodeTypesScopedList=} [properties] Properties to set + */ + function NodeTypesScopedList(properties) { + this.nodeTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTypesScopedList nodeTypes. + * @member {Array.} nodeTypes + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @instance + */ + NodeTypesScopedList.prototype.nodeTypes = $util.emptyArray; + + /** + * NodeTypesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @instance + */ + NodeTypesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTypesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @instance + */ + Object.defineProperty(NodeTypesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTypesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {google.cloud.compute.v1.INodeTypesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTypesScopedList} NodeTypesScopedList instance + */ + NodeTypesScopedList.create = function create(properties) { + return new NodeTypesScopedList(properties); + }; + + /** + * Encodes the specified NodeTypesScopedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTypesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {google.cloud.compute.v1.INodeTypesScopedList} message NodeTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nodeTypes != null && message.nodeTypes.length) + for (var i = 0; i < message.nodeTypes.length; ++i) + $root.google.cloud.compute.v1.NodeType.encode(message.nodeTypes[i], writer.uint32(/* id 482172924, wireType 2 =*/3857383394).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeTypesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTypesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {google.cloud.compute.v1.INodeTypesScopedList} message NodeTypesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTypesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTypesScopedList} NodeTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTypesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 482172924: + if (!(message.nodeTypes && message.nodeTypes.length)) + message.nodeTypes = []; + message.nodeTypes.push($root.google.cloud.compute.v1.NodeType.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTypesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTypesScopedList} NodeTypesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTypesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTypesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeTypes != null && message.hasOwnProperty("nodeTypes")) { + if (!Array.isArray(message.nodeTypes)) + return "nodeTypes: array expected"; + for (var i = 0; i < message.nodeTypes.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeType.verify(message.nodeTypes[i]); + if (error) + return "nodeTypes." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeTypesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTypesScopedList} NodeTypesScopedList + */ + NodeTypesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTypesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.NodeTypesScopedList(); + if (object.nodeTypes) { + if (!Array.isArray(object.nodeTypes)) + throw TypeError(".google.cloud.compute.v1.NodeTypesScopedList.nodeTypes: array expected"); + message.nodeTypes = []; + for (var i = 0; i < object.nodeTypes.length; ++i) { + if (typeof object.nodeTypes[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTypesScopedList.nodeTypes: object expected"); + message.nodeTypes[i] = $root.google.cloud.compute.v1.NodeType.fromObject(object.nodeTypes[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTypesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeTypesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @static + * @param {google.cloud.compute.v1.NodeTypesScopedList} message NodeTypesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTypesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeTypes = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nodeTypes && message.nodeTypes.length) { + object.nodeTypes = []; + for (var j = 0; j < message.nodeTypes.length; ++j) + object.nodeTypes[j] = $root.google.cloud.compute.v1.NodeType.toObject(message.nodeTypes[j], options); + } + return object; + }; + + /** + * Converts this NodeTypesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTypesScopedList + * @instance + * @returns {Object.} JSON object + */ + NodeTypesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeTypesScopedList; + })(); + + v1.NodeTypeAggregatedList = (function() { + + /** + * Properties of a NodeTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface INodeTypeAggregatedList + * @property {string|null} [id] NodeTypeAggregatedList id + * @property {Object.|null} [items] NodeTypeAggregatedList items + * @property {string|null} [kind] NodeTypeAggregatedList kind + * @property {string|null} [nextPageToken] NodeTypeAggregatedList nextPageToken + * @property {string|null} [selfLink] NodeTypeAggregatedList selfLink + * @property {Array.|null} [unreachables] NodeTypeAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeTypeAggregatedList warning + */ + + /** + * Constructs a new NodeTypeAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTypeAggregatedList. + * @implements INodeTypeAggregatedList + * @constructor + * @param {google.cloud.compute.v1.INodeTypeAggregatedList=} [properties] Properties to set + */ + function NodeTypeAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTypeAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + NodeTypeAggregatedList.prototype.id = null; + + /** + * NodeTypeAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + NodeTypeAggregatedList.prototype.items = $util.emptyObject; + + /** + * NodeTypeAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + NodeTypeAggregatedList.prototype.kind = null; + + /** + * NodeTypeAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + NodeTypeAggregatedList.prototype.nextPageToken = null; + + /** + * NodeTypeAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + NodeTypeAggregatedList.prototype.selfLink = null; + + /** + * NodeTypeAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + NodeTypeAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * NodeTypeAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + NodeTypeAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTypeAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + Object.defineProperty(NodeTypeAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + Object.defineProperty(NodeTypeAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + Object.defineProperty(NodeTypeAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + Object.defineProperty(NodeTypeAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + */ + Object.defineProperty(NodeTypeAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTypeAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeTypeAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTypeAggregatedList} NodeTypeAggregatedList instance + */ + NodeTypeAggregatedList.create = function create(properties) { + return new NodeTypeAggregatedList(properties); + }; + + /** + * Encodes the specified NodeTypeAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NodeTypeAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeTypeAggregatedList} message NodeTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.NodeTypesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NodeTypeAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTypeAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.INodeTypeAggregatedList} message NodeTypeAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTypeAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTypeAggregatedList} NodeTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTypeAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.NodeTypesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTypeAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTypeAggregatedList} NodeTypeAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTypeAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTypeAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeTypesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeTypeAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTypeAggregatedList} NodeTypeAggregatedList + */ + NodeTypeAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTypeAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.NodeTypeAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTypeAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTypeAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.NodeTypesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.NodeTypeAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTypeAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeTypeAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @static + * @param {google.cloud.compute.v1.NodeTypeAggregatedList} message NodeTypeAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTypeAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.NodeTypesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NodeTypeAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTypeAggregatedList + * @instance + * @returns {Object.} JSON object + */ + NodeTypeAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeTypeAggregatedList; + })(); + + v1.NodeTypeList = (function() { + + /** + * Properties of a NodeTypeList. + * @memberof google.cloud.compute.v1 + * @interface INodeTypeList + * @property {string|null} [id] NodeTypeList id + * @property {Array.|null} [items] NodeTypeList items + * @property {string|null} [kind] NodeTypeList kind + * @property {string|null} [nextPageToken] NodeTypeList nextPageToken + * @property {string|null} [selfLink] NodeTypeList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] NodeTypeList warning + */ + + /** + * Constructs a new NodeTypeList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTypeList. + * @implements INodeTypeList + * @constructor + * @param {google.cloud.compute.v1.INodeTypeList=} [properties] Properties to set + */ + function NodeTypeList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTypeList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + NodeTypeList.prototype.id = null; + + /** + * NodeTypeList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + NodeTypeList.prototype.items = $util.emptyArray; + + /** + * NodeTypeList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + NodeTypeList.prototype.kind = null; + + /** + * NodeTypeList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + NodeTypeList.prototype.nextPageToken = null; + + /** + * NodeTypeList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + NodeTypeList.prototype.selfLink = null; + + /** + * NodeTypeList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + NodeTypeList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeTypeList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + Object.defineProperty(NodeTypeList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + Object.defineProperty(NodeTypeList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + Object.defineProperty(NodeTypeList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + Object.defineProperty(NodeTypeList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeTypeList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + */ + Object.defineProperty(NodeTypeList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeTypeList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {google.cloud.compute.v1.INodeTypeList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NodeTypeList} NodeTypeList instance + */ + NodeTypeList.create = function create(properties) { + return new NodeTypeList(properties); + }; + + /** + * Encodes the specified NodeTypeList message. Does not implicitly {@link google.cloud.compute.v1.NodeTypeList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {google.cloud.compute.v1.INodeTypeList} message NodeTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.NodeType.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NodeTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NodeTypeList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {google.cloud.compute.v1.INodeTypeList} message NodeTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTypeList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NodeTypeList} NodeTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NodeTypeList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.NodeType.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTypeList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NodeTypeList} NodeTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTypeList message. + * @function verify + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTypeList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.NodeType.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NodeTypeList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NodeTypeList} NodeTypeList + */ + NodeTypeList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NodeTypeList) + return object; + var message = new $root.google.cloud.compute.v1.NodeTypeList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NodeTypeList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTypeList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.NodeType.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NodeTypeList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NodeTypeList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NodeTypeList + * @static + * @param {google.cloud.compute.v1.NodeTypeList} message NodeTypeList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTypeList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.NodeType.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NodeTypeList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NodeTypeList + * @instance + * @returns {Object.} JSON object + */ + NodeTypeList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NodeTypeList; + })(); + + v1.NotificationEndpointGrpcSettings = (function() { + + /** + * Properties of a NotificationEndpointGrpcSettings. + * @memberof google.cloud.compute.v1 + * @interface INotificationEndpointGrpcSettings + * @property {string|null} [authority] NotificationEndpointGrpcSettings authority + * @property {string|null} [endpoint] NotificationEndpointGrpcSettings endpoint + * @property {string|null} [payloadName] NotificationEndpointGrpcSettings payloadName + * @property {google.cloud.compute.v1.IDuration|null} [resendInterval] NotificationEndpointGrpcSettings resendInterval + * @property {number|null} [retryDurationSec] NotificationEndpointGrpcSettings retryDurationSec + */ + + /** + * Constructs a new NotificationEndpointGrpcSettings. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NotificationEndpointGrpcSettings. + * @implements INotificationEndpointGrpcSettings + * @constructor + * @param {google.cloud.compute.v1.INotificationEndpointGrpcSettings=} [properties] Properties to set + */ + function NotificationEndpointGrpcSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationEndpointGrpcSettings authority. + * @member {string|null|undefined} authority + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + NotificationEndpointGrpcSettings.prototype.authority = null; + + /** + * NotificationEndpointGrpcSettings endpoint. + * @member {string|null|undefined} endpoint + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + NotificationEndpointGrpcSettings.prototype.endpoint = null; + + /** + * NotificationEndpointGrpcSettings payloadName. + * @member {string|null|undefined} payloadName + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + NotificationEndpointGrpcSettings.prototype.payloadName = null; + + /** + * NotificationEndpointGrpcSettings resendInterval. + * @member {google.cloud.compute.v1.IDuration|null|undefined} resendInterval + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + NotificationEndpointGrpcSettings.prototype.resendInterval = null; + + /** + * NotificationEndpointGrpcSettings retryDurationSec. + * @member {number|null|undefined} retryDurationSec + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + NotificationEndpointGrpcSettings.prototype.retryDurationSec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationEndpointGrpcSettings _authority. + * @member {"authority"|undefined} _authority + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + Object.defineProperty(NotificationEndpointGrpcSettings.prototype, "_authority", { + get: $util.oneOfGetter($oneOfFields = ["authority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointGrpcSettings _endpoint. + * @member {"endpoint"|undefined} _endpoint + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + Object.defineProperty(NotificationEndpointGrpcSettings.prototype, "_endpoint", { + get: $util.oneOfGetter($oneOfFields = ["endpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointGrpcSettings _payloadName. + * @member {"payloadName"|undefined} _payloadName + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + Object.defineProperty(NotificationEndpointGrpcSettings.prototype, "_payloadName", { + get: $util.oneOfGetter($oneOfFields = ["payloadName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointGrpcSettings _resendInterval. + * @member {"resendInterval"|undefined} _resendInterval + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + Object.defineProperty(NotificationEndpointGrpcSettings.prototype, "_resendInterval", { + get: $util.oneOfGetter($oneOfFields = ["resendInterval"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointGrpcSettings _retryDurationSec. + * @member {"retryDurationSec"|undefined} _retryDurationSec + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + */ + Object.defineProperty(NotificationEndpointGrpcSettings.prototype, "_retryDurationSec", { + get: $util.oneOfGetter($oneOfFields = ["retryDurationSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationEndpointGrpcSettings instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {google.cloud.compute.v1.INotificationEndpointGrpcSettings=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NotificationEndpointGrpcSettings} NotificationEndpointGrpcSettings instance + */ + NotificationEndpointGrpcSettings.create = function create(properties) { + return new NotificationEndpointGrpcSettings(properties); + }; + + /** + * Encodes the specified NotificationEndpointGrpcSettings message. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointGrpcSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {google.cloud.compute.v1.INotificationEndpointGrpcSettings} message NotificationEndpointGrpcSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationEndpointGrpcSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retryDurationSec != null && Object.hasOwnProperty.call(message, "retryDurationSec")) + writer.uint32(/* id 115681117, wireType 0 =*/925448936).uint32(message.retryDurationSec); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 130489749, wireType 2 =*/1043917994).string(message.endpoint); + if (message.payloadName != null && Object.hasOwnProperty.call(message, "payloadName")) + writer.uint32(/* id 300358300, wireType 2 =*/2402866402).string(message.payloadName); + if (message.authority != null && Object.hasOwnProperty.call(message, "authority")) + writer.uint32(/* id 401868611, wireType 2 =*/3214948890).string(message.authority); + if (message.resendInterval != null && Object.hasOwnProperty.call(message, "resendInterval")) + $root.google.cloud.compute.v1.Duration.encode(message.resendInterval, writer.uint32(/* id 478288969, wireType 2 =*/3826311754).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotificationEndpointGrpcSettings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointGrpcSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {google.cloud.compute.v1.INotificationEndpointGrpcSettings} message NotificationEndpointGrpcSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationEndpointGrpcSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationEndpointGrpcSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NotificationEndpointGrpcSettings} NotificationEndpointGrpcSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationEndpointGrpcSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 401868611: + message.authority = reader.string(); + break; + case 130489749: + message.endpoint = reader.string(); + break; + case 300358300: + message.payloadName = reader.string(); + break; + case 478288969: + message.resendInterval = $root.google.cloud.compute.v1.Duration.decode(reader, reader.uint32()); + break; + case 115681117: + message.retryDurationSec = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationEndpointGrpcSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NotificationEndpointGrpcSettings} NotificationEndpointGrpcSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationEndpointGrpcSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationEndpointGrpcSettings message. + * @function verify + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationEndpointGrpcSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.authority != null && message.hasOwnProperty("authority")) { + properties._authority = 1; + if (!$util.isString(message.authority)) + return "authority: string expected"; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) { + properties._endpoint = 1; + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + } + if (message.payloadName != null && message.hasOwnProperty("payloadName")) { + properties._payloadName = 1; + if (!$util.isString(message.payloadName)) + return "payloadName: string expected"; + } + if (message.resendInterval != null && message.hasOwnProperty("resendInterval")) { + properties._resendInterval = 1; + { + var error = $root.google.cloud.compute.v1.Duration.verify(message.resendInterval); + if (error) + return "resendInterval." + error; + } + } + if (message.retryDurationSec != null && message.hasOwnProperty("retryDurationSec")) { + properties._retryDurationSec = 1; + if (!$util.isInteger(message.retryDurationSec)) + return "retryDurationSec: integer expected"; + } + return null; + }; + + /** + * Creates a NotificationEndpointGrpcSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NotificationEndpointGrpcSettings} NotificationEndpointGrpcSettings + */ + NotificationEndpointGrpcSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings) + return object; + var message = new $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings(); + if (object.authority != null) + message.authority = String(object.authority); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.payloadName != null) + message.payloadName = String(object.payloadName); + if (object.resendInterval != null) { + if (typeof object.resendInterval !== "object") + throw TypeError(".google.cloud.compute.v1.NotificationEndpointGrpcSettings.resendInterval: object expected"); + message.resendInterval = $root.google.cloud.compute.v1.Duration.fromObject(object.resendInterval); + } + if (object.retryDurationSec != null) + message.retryDurationSec = object.retryDurationSec >>> 0; + return message; + }; + + /** + * Creates a plain object from a NotificationEndpointGrpcSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @static + * @param {google.cloud.compute.v1.NotificationEndpointGrpcSettings} message NotificationEndpointGrpcSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationEndpointGrpcSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.retryDurationSec != null && message.hasOwnProperty("retryDurationSec")) { + object.retryDurationSec = message.retryDurationSec; + if (options.oneofs) + object._retryDurationSec = "retryDurationSec"; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) { + object.endpoint = message.endpoint; + if (options.oneofs) + object._endpoint = "endpoint"; + } + if (message.payloadName != null && message.hasOwnProperty("payloadName")) { + object.payloadName = message.payloadName; + if (options.oneofs) + object._payloadName = "payloadName"; + } + if (message.authority != null && message.hasOwnProperty("authority")) { + object.authority = message.authority; + if (options.oneofs) + object._authority = "authority"; + } + if (message.resendInterval != null && message.hasOwnProperty("resendInterval")) { + object.resendInterval = $root.google.cloud.compute.v1.Duration.toObject(message.resendInterval, options); + if (options.oneofs) + object._resendInterval = "resendInterval"; + } + return object; + }; + + /** + * Converts this NotificationEndpointGrpcSettings to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NotificationEndpointGrpcSettings + * @instance + * @returns {Object.} JSON object + */ + NotificationEndpointGrpcSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NotificationEndpointGrpcSettings; + })(); + + v1.NotificationEndpoint = (function() { + + /** + * Properties of a NotificationEndpoint. + * @memberof google.cloud.compute.v1 + * @interface INotificationEndpoint + * @property {string|null} [creationTimestamp] NotificationEndpoint creationTimestamp + * @property {string|null} [description] NotificationEndpoint description + * @property {google.cloud.compute.v1.INotificationEndpointGrpcSettings|null} [grpcSettings] NotificationEndpoint grpcSettings + * @property {number|Long|null} [id] NotificationEndpoint id + * @property {string|null} [kind] NotificationEndpoint kind + * @property {string|null} [name] NotificationEndpoint name + * @property {string|null} [region] NotificationEndpoint region + * @property {string|null} [selfLink] NotificationEndpoint selfLink + */ + + /** + * Constructs a new NotificationEndpoint. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NotificationEndpoint. + * @implements INotificationEndpoint + * @constructor + * @param {google.cloud.compute.v1.INotificationEndpoint=} [properties] Properties to set + */ + function NotificationEndpoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationEndpoint creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.creationTimestamp = null; + + /** + * NotificationEndpoint description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.description = null; + + /** + * NotificationEndpoint grpcSettings. + * @member {google.cloud.compute.v1.INotificationEndpointGrpcSettings|null|undefined} grpcSettings + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.grpcSettings = null; + + /** + * NotificationEndpoint id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.id = null; + + /** + * NotificationEndpoint kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.kind = null; + + /** + * NotificationEndpoint name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.name = null; + + /** + * NotificationEndpoint region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.region = null; + + /** + * NotificationEndpoint selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + NotificationEndpoint.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationEndpoint _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpoint _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpoint _grpcSettings. + * @member {"grpcSettings"|undefined} _grpcSettings + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_grpcSettings", { + get: $util.oneOfGetter($oneOfFields = ["grpcSettings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpoint _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpoint _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpoint _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpoint _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpoint _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + */ + Object.defineProperty(NotificationEndpoint.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationEndpoint instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {google.cloud.compute.v1.INotificationEndpoint=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NotificationEndpoint} NotificationEndpoint instance + */ + NotificationEndpoint.create = function create(properties) { + return new NotificationEndpoint(properties); + }; + + /** + * Encodes the specified NotificationEndpoint message. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {google.cloud.compute.v1.INotificationEndpoint} message NotificationEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationEndpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.grpcSettings != null && Object.hasOwnProperty.call(message, "grpcSettings")) + $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings.encode(message.grpcSettings, writer.uint32(/* id 456139556, wireType 2 =*/3649116450).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NotificationEndpoint message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {google.cloud.compute.v1.INotificationEndpoint} message NotificationEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationEndpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationEndpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NotificationEndpoint} NotificationEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationEndpoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NotificationEndpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 456139556: + message.grpcSettings = $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings.decode(reader, reader.uint32()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationEndpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NotificationEndpoint} NotificationEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationEndpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationEndpoint message. + * @function verify + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationEndpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.grpcSettings != null && message.hasOwnProperty("grpcSettings")) { + properties._grpcSettings = 1; + { + var error = $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings.verify(message.grpcSettings); + if (error) + return "grpcSettings." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates a NotificationEndpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NotificationEndpoint} NotificationEndpoint + */ + NotificationEndpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NotificationEndpoint) + return object; + var message = new $root.google.cloud.compute.v1.NotificationEndpoint(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.grpcSettings != null) { + if (typeof object.grpcSettings !== "object") + throw TypeError(".google.cloud.compute.v1.NotificationEndpoint.grpcSettings: object expected"); + message.grpcSettings = $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings.fromObject(object.grpcSettings); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from a NotificationEndpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @static + * @param {google.cloud.compute.v1.NotificationEndpoint} message NotificationEndpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationEndpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.grpcSettings != null && message.hasOwnProperty("grpcSettings")) { + object.grpcSettings = $root.google.cloud.compute.v1.NotificationEndpointGrpcSettings.toObject(message.grpcSettings, options); + if (options.oneofs) + object._grpcSettings = "grpcSettings"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NotificationEndpoint to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NotificationEndpoint + * @instance + * @returns {Object.} JSON object + */ + NotificationEndpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NotificationEndpoint; + })(); + + v1.NotificationEndpointList = (function() { + + /** + * Properties of a NotificationEndpointList. + * @memberof google.cloud.compute.v1 + * @interface INotificationEndpointList + * @property {string|null} [id] NotificationEndpointList id + * @property {Array.|null} [items] NotificationEndpointList items + * @property {string|null} [kind] NotificationEndpointList kind + * @property {string|null} [nextPageToken] NotificationEndpointList nextPageToken + * @property {string|null} [selfLink] NotificationEndpointList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] NotificationEndpointList warning + */ + + /** + * Constructs a new NotificationEndpointList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NotificationEndpointList. + * @implements INotificationEndpointList + * @constructor + * @param {google.cloud.compute.v1.INotificationEndpointList=} [properties] Properties to set + */ + function NotificationEndpointList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationEndpointList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + NotificationEndpointList.prototype.id = null; + + /** + * NotificationEndpointList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + NotificationEndpointList.prototype.items = $util.emptyArray; + + /** + * NotificationEndpointList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + NotificationEndpointList.prototype.kind = null; + + /** + * NotificationEndpointList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + NotificationEndpointList.prototype.nextPageToken = null; + + /** + * NotificationEndpointList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + NotificationEndpointList.prototype.selfLink = null; + + /** + * NotificationEndpointList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + NotificationEndpointList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NotificationEndpointList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + Object.defineProperty(NotificationEndpointList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + Object.defineProperty(NotificationEndpointList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + Object.defineProperty(NotificationEndpointList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + Object.defineProperty(NotificationEndpointList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NotificationEndpointList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + */ + Object.defineProperty(NotificationEndpointList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NotificationEndpointList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {google.cloud.compute.v1.INotificationEndpointList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.NotificationEndpointList} NotificationEndpointList instance + */ + NotificationEndpointList.create = function create(properties) { + return new NotificationEndpointList(properties); + }; + + /** + * Encodes the specified NotificationEndpointList message. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {google.cloud.compute.v1.INotificationEndpointList} message NotificationEndpointList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationEndpointList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.NotificationEndpoint.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified NotificationEndpointList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NotificationEndpointList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {google.cloud.compute.v1.INotificationEndpointList} message NotificationEndpointList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationEndpointList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationEndpointList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.NotificationEndpointList} NotificationEndpointList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationEndpointList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.NotificationEndpointList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.NotificationEndpoint.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationEndpointList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.NotificationEndpointList} NotificationEndpointList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationEndpointList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationEndpointList message. + * @function verify + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationEndpointList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.NotificationEndpoint.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a NotificationEndpointList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.NotificationEndpointList} NotificationEndpointList + */ + NotificationEndpointList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.NotificationEndpointList) + return object; + var message = new $root.google.cloud.compute.v1.NotificationEndpointList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.NotificationEndpointList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.NotificationEndpointList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.NotificationEndpoint.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.NotificationEndpointList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a NotificationEndpointList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @static + * @param {google.cloud.compute.v1.NotificationEndpointList} message NotificationEndpointList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationEndpointList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.NotificationEndpoint.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this NotificationEndpointList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.NotificationEndpointList + * @instance + * @returns {Object.} JSON object + */ + NotificationEndpointList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NotificationEndpointList; + })(); + + v1.Error = (function() { + + /** + * Properties of an Error. + * @memberof google.cloud.compute.v1 + * @interface IError + * @property {Array.|null} [errors] Error errors + */ + + /** + * Constructs a new Error. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Error. + * @implements IError + * @constructor + * @param {google.cloud.compute.v1.IError=} [properties] Properties to set + */ + function Error(properties) { + this.errors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Error errors. + * @member {Array.} errors + * @memberof google.cloud.compute.v1.Error + * @instance + */ + Error.prototype.errors = $util.emptyArray; + + /** + * Creates a new Error instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Error + * @static + * @param {google.cloud.compute.v1.IError=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Error} Error instance + */ + Error.create = function create(properties) { + return new Error(properties); + }; + + /** + * Encodes the specified Error message. Does not implicitly {@link google.cloud.compute.v1.Error.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Error + * @static + * @param {google.cloud.compute.v1.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errors != null && message.errors.length) + for (var i = 0; i < message.errors.length; ++i) + $root.google.cloud.compute.v1.Errors.encode(message.errors[i], writer.uint32(/* id 315977579, wireType 2 =*/2527820634).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Error message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Error.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Error + * @static + * @param {google.cloud.compute.v1.IError} message Error message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Error.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Error message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Error(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 315977579: + if (!(message.errors && message.errors.length)) + message.errors = []; + message.errors.push($root.google.cloud.compute.v1.Errors.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Error message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Error + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Error} Error + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Error.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Error message. + * @function verify + * @memberof google.cloud.compute.v1.Error + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Error.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errors != null && message.hasOwnProperty("errors")) { + if (!Array.isArray(message.errors)) + return "errors: array expected"; + for (var i = 0; i < message.errors.length; ++i) { + var error = $root.google.cloud.compute.v1.Errors.verify(message.errors[i]); + if (error) + return "errors." + error; + } + } + return null; + }; + + /** + * Creates an Error message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Error + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Error} Error + */ + Error.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Error) + return object; + var message = new $root.google.cloud.compute.v1.Error(); + if (object.errors) { + if (!Array.isArray(object.errors)) + throw TypeError(".google.cloud.compute.v1.Error.errors: array expected"); + message.errors = []; + for (var i = 0; i < object.errors.length; ++i) { + if (typeof object.errors[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Error.errors: object expected"); + message.errors[i] = $root.google.cloud.compute.v1.Errors.fromObject(object.errors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Error message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Error + * @static + * @param {google.cloud.compute.v1.Error} message Error + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Error.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.errors = []; + if (message.errors && message.errors.length) { + object.errors = []; + for (var j = 0; j < message.errors.length; ++j) + object.errors[j] = $root.google.cloud.compute.v1.Errors.toObject(message.errors[j], options); + } + return object; + }; + + /** + * Converts this Error to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Error + * @instance + * @returns {Object.} JSON object + */ + Error.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Error; + })(); + + v1.Warnings = (function() { + + /** + * Properties of a Warnings. + * @memberof google.cloud.compute.v1 + * @interface IWarnings + * @property {google.cloud.compute.v1.Warnings.Code|null} [code] Warnings code + * @property {Array.|null} [data] Warnings data + * @property {string|null} [message] Warnings message + */ + + /** + * Constructs a new Warnings. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Warnings. + * @implements IWarnings + * @constructor + * @param {google.cloud.compute.v1.IWarnings=} [properties] Properties to set + */ + function Warnings(properties) { + this.data = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Warnings code. + * @member {google.cloud.compute.v1.Warnings.Code|null|undefined} code + * @memberof google.cloud.compute.v1.Warnings + * @instance + */ + Warnings.prototype.code = null; + + /** + * Warnings data. + * @member {Array.} data + * @memberof google.cloud.compute.v1.Warnings + * @instance + */ + Warnings.prototype.data = $util.emptyArray; + + /** + * Warnings message. + * @member {string|null|undefined} message + * @memberof google.cloud.compute.v1.Warnings + * @instance + */ + Warnings.prototype.message = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Warnings _code. + * @member {"code"|undefined} _code + * @memberof google.cloud.compute.v1.Warnings + * @instance + */ + Object.defineProperty(Warnings.prototype, "_code", { + get: $util.oneOfGetter($oneOfFields = ["code"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Warnings _message. + * @member {"message"|undefined} _message + * @memberof google.cloud.compute.v1.Warnings + * @instance + */ + Object.defineProperty(Warnings.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Warnings instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {google.cloud.compute.v1.IWarnings=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Warnings} Warnings instance + */ + Warnings.create = function create(properties) { + return new Warnings(properties); + }; + + /** + * Encodes the specified Warnings message. Does not implicitly {@link google.cloud.compute.v1.Warnings.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {google.cloud.compute.v1.IWarnings} message Warnings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warnings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 3059181, wireType 0 =*/24473448).int32(message.code); + if (message.data != null && message.data.length) + for (var i = 0; i < message.data.length; ++i) + $root.google.cloud.compute.v1.Data.encode(message.data[i], writer.uint32(/* id 3076010, wireType 2 =*/24608082).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 418054151, wireType 2 =*/3344433210).string(message.message); + return writer; + }; + + /** + * Encodes the specified Warnings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Warnings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {google.cloud.compute.v1.IWarnings} message Warnings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Warnings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Warnings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Warnings} Warnings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warnings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Warnings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3059181: + message.code = reader.int32(); + break; + case 3076010: + if (!(message.data && message.data.length)) + message.data = []; + message.data.push($root.google.cloud.compute.v1.Data.decode(reader, reader.uint32())); + break; + case 418054151: + message.message = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Warnings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Warnings} Warnings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Warnings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Warnings message. + * @function verify + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Warnings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.code != null && message.hasOwnProperty("code")) { + properties._code = 1; + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 150308440: + case 391835586: + case 346526230: + case 369442967: + case 451954443: + case 175546307: + case 329669423: + case 417377419: + case 481440678: + case 344505463: + case 324964999: + case 383382887: + case 464250446: + case 243758146: + case 417081265: + case 105763924: + case 30036744: + case 39966469: + case 3745539: + case 496728641: + case 168598460: + case 275245642: + case 268305617: + case 390513439: + case 13328052: + break; + } + } + if (message.data != null && message.hasOwnProperty("data")) { + if (!Array.isArray(message.data)) + return "data: array expected"; + for (var i = 0; i < message.data.length; ++i) { + var error = $root.google.cloud.compute.v1.Data.verify(message.data[i]); + if (error) + return "data." + error; + } + } + if (message.message != null && message.hasOwnProperty("message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + return null; + }; + + /** + * Creates a Warnings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Warnings} Warnings + */ + Warnings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Warnings) + return object; + var message = new $root.google.cloud.compute.v1.Warnings(); + switch (object.code) { + case "UNDEFINED_CODE": + case 0: + message.code = 0; + break; + case "CLEANUP_FAILED": + case 150308440: + message.code = 150308440; + break; + case "DEPRECATED_RESOURCE_USED": + case 391835586: + message.code = 391835586; + break; + case "DEPRECATED_TYPE_USED": + case 346526230: + message.code = 346526230; + break; + case "DISK_SIZE_LARGER_THAN_IMAGE_SIZE": + case 369442967: + message.code = 369442967; + break; + case "EXPERIMENTAL_TYPE_USED": + case 451954443: + message.code = 451954443; + break; + case "EXTERNAL_API_WARNING": + case 175546307: + message.code = 175546307; + break; + case "FIELD_VALUE_OVERRIDEN": + case 329669423: + message.code = 329669423; + break; + case "INJECTED_KERNELS_DEPRECATED": + case 417377419: + message.code = 417377419; + break; + case "LARGE_DEPLOYMENT_WARNING": + case 481440678: + message.code = 481440678; + break; + case "MISSING_TYPE_DEPENDENCY": + case 344505463: + message.code = 344505463; + break; + case "NEXT_HOP_ADDRESS_NOT_ASSIGNED": + case 324964999: + message.code = 324964999; + break; + case "NEXT_HOP_CANNOT_IP_FORWARD": + case 383382887: + message.code = 383382887; + break; + case "NEXT_HOP_INSTANCE_NOT_FOUND": + case 464250446: + message.code = 464250446; + break; + case "NEXT_HOP_INSTANCE_NOT_ON_NETWORK": + case 243758146: + message.code = 243758146; + break; + case "NEXT_HOP_NOT_RUNNING": + case 417081265: + message.code = 417081265; + break; + case "NOT_CRITICAL_ERROR": + case 105763924: + message.code = 105763924; + break; + case "NO_RESULTS_ON_PAGE": + case 30036744: + message.code = 30036744; + break; + case "PARTIAL_SUCCESS": + case 39966469: + message.code = 39966469; + break; + case "REQUIRED_TOS_AGREEMENT": + case 3745539: + message.code = 3745539; + break; + case "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING": + case 496728641: + message.code = 496728641; + break; + case "RESOURCE_NOT_DELETED": + case 168598460: + message.code = 168598460; + break; + case "SCHEMA_VALIDATION_IGNORED": + case 275245642: + message.code = 275245642; + break; + case "SINGLE_INSTANCE_PROPERTY_TEMPLATE": + case 268305617: + message.code = 268305617; + break; + case "UNDECLARED_PROPERTIES": + case 390513439: + message.code = 390513439; + break; + case "UNREACHABLE": + case 13328052: + message.code = 13328052; + break; + } + if (object.data) { + if (!Array.isArray(object.data)) + throw TypeError(".google.cloud.compute.v1.Warnings.data: array expected"); + message.data = []; + for (var i = 0; i < object.data.length; ++i) { + if (typeof object.data[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Warnings.data: object expected"); + message.data[i] = $root.google.cloud.compute.v1.Data.fromObject(object.data[i]); + } + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a Warnings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Warnings + * @static + * @param {google.cloud.compute.v1.Warnings} message Warnings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Warnings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.data = []; + if (message.code != null && message.hasOwnProperty("code")) { + object.code = options.enums === String ? $root.google.cloud.compute.v1.Warnings.Code[message.code] : message.code; + if (options.oneofs) + object._code = "code"; + } + if (message.data && message.data.length) { + object.data = []; + for (var j = 0; j < message.data.length; ++j) + object.data[j] = $root.google.cloud.compute.v1.Data.toObject(message.data[j], options); + } + if (message.message != null && message.hasOwnProperty("message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; + + /** + * Converts this Warnings to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Warnings + * @instance + * @returns {Object.} JSON object + */ + Warnings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Code enum. + * @name google.cloud.compute.v1.Warnings.Code + * @enum {number} + * @property {number} UNDEFINED_CODE=0 UNDEFINED_CODE value + * @property {number} CLEANUP_FAILED=150308440 CLEANUP_FAILED value + * @property {number} DEPRECATED_RESOURCE_USED=391835586 DEPRECATED_RESOURCE_USED value + * @property {number} DEPRECATED_TYPE_USED=346526230 DEPRECATED_TYPE_USED value + * @property {number} DISK_SIZE_LARGER_THAN_IMAGE_SIZE=369442967 DISK_SIZE_LARGER_THAN_IMAGE_SIZE value + * @property {number} EXPERIMENTAL_TYPE_USED=451954443 EXPERIMENTAL_TYPE_USED value + * @property {number} EXTERNAL_API_WARNING=175546307 EXTERNAL_API_WARNING value + * @property {number} FIELD_VALUE_OVERRIDEN=329669423 FIELD_VALUE_OVERRIDEN value + * @property {number} INJECTED_KERNELS_DEPRECATED=417377419 INJECTED_KERNELS_DEPRECATED value + * @property {number} LARGE_DEPLOYMENT_WARNING=481440678 LARGE_DEPLOYMENT_WARNING value + * @property {number} MISSING_TYPE_DEPENDENCY=344505463 MISSING_TYPE_DEPENDENCY value + * @property {number} NEXT_HOP_ADDRESS_NOT_ASSIGNED=324964999 NEXT_HOP_ADDRESS_NOT_ASSIGNED value + * @property {number} NEXT_HOP_CANNOT_IP_FORWARD=383382887 NEXT_HOP_CANNOT_IP_FORWARD value + * @property {number} NEXT_HOP_INSTANCE_NOT_FOUND=464250446 NEXT_HOP_INSTANCE_NOT_FOUND value + * @property {number} NEXT_HOP_INSTANCE_NOT_ON_NETWORK=243758146 NEXT_HOP_INSTANCE_NOT_ON_NETWORK value + * @property {number} NEXT_HOP_NOT_RUNNING=417081265 NEXT_HOP_NOT_RUNNING value + * @property {number} NOT_CRITICAL_ERROR=105763924 NOT_CRITICAL_ERROR value + * @property {number} NO_RESULTS_ON_PAGE=30036744 NO_RESULTS_ON_PAGE value + * @property {number} PARTIAL_SUCCESS=39966469 PARTIAL_SUCCESS value + * @property {number} REQUIRED_TOS_AGREEMENT=3745539 REQUIRED_TOS_AGREEMENT value + * @property {number} RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING=496728641 RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING value + * @property {number} RESOURCE_NOT_DELETED=168598460 RESOURCE_NOT_DELETED value + * @property {number} SCHEMA_VALIDATION_IGNORED=275245642 SCHEMA_VALIDATION_IGNORED value + * @property {number} SINGLE_INSTANCE_PROPERTY_TEMPLATE=268305617 SINGLE_INSTANCE_PROPERTY_TEMPLATE value + * @property {number} UNDECLARED_PROPERTIES=390513439 UNDECLARED_PROPERTIES value + * @property {number} UNREACHABLE=13328052 UNREACHABLE value + */ + Warnings.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_CODE"] = 0; + values[valuesById[150308440] = "CLEANUP_FAILED"] = 150308440; + values[valuesById[391835586] = "DEPRECATED_RESOURCE_USED"] = 391835586; + values[valuesById[346526230] = "DEPRECATED_TYPE_USED"] = 346526230; + values[valuesById[369442967] = "DISK_SIZE_LARGER_THAN_IMAGE_SIZE"] = 369442967; + values[valuesById[451954443] = "EXPERIMENTAL_TYPE_USED"] = 451954443; + values[valuesById[175546307] = "EXTERNAL_API_WARNING"] = 175546307; + values[valuesById[329669423] = "FIELD_VALUE_OVERRIDEN"] = 329669423; + values[valuesById[417377419] = "INJECTED_KERNELS_DEPRECATED"] = 417377419; + values[valuesById[481440678] = "LARGE_DEPLOYMENT_WARNING"] = 481440678; + values[valuesById[344505463] = "MISSING_TYPE_DEPENDENCY"] = 344505463; + values[valuesById[324964999] = "NEXT_HOP_ADDRESS_NOT_ASSIGNED"] = 324964999; + values[valuesById[383382887] = "NEXT_HOP_CANNOT_IP_FORWARD"] = 383382887; + values[valuesById[464250446] = "NEXT_HOP_INSTANCE_NOT_FOUND"] = 464250446; + values[valuesById[243758146] = "NEXT_HOP_INSTANCE_NOT_ON_NETWORK"] = 243758146; + values[valuesById[417081265] = "NEXT_HOP_NOT_RUNNING"] = 417081265; + values[valuesById[105763924] = "NOT_CRITICAL_ERROR"] = 105763924; + values[valuesById[30036744] = "NO_RESULTS_ON_PAGE"] = 30036744; + values[valuesById[39966469] = "PARTIAL_SUCCESS"] = 39966469; + values[valuesById[3745539] = "REQUIRED_TOS_AGREEMENT"] = 3745539; + values[valuesById[496728641] = "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING"] = 496728641; + values[valuesById[168598460] = "RESOURCE_NOT_DELETED"] = 168598460; + values[valuesById[275245642] = "SCHEMA_VALIDATION_IGNORED"] = 275245642; + values[valuesById[268305617] = "SINGLE_INSTANCE_PROPERTY_TEMPLATE"] = 268305617; + values[valuesById[390513439] = "UNDECLARED_PROPERTIES"] = 390513439; + values[valuesById[13328052] = "UNREACHABLE"] = 13328052; + return values; + })(); + + return Warnings; + })(); + + v1.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.cloud.compute.v1 + * @interface IOperation + * @property {string|null} [clientOperationId] Operation clientOperationId + * @property {string|null} [creationTimestamp] Operation creationTimestamp + * @property {string|null} [description] Operation description + * @property {string|null} [endTime] Operation endTime + * @property {google.cloud.compute.v1.IError|null} [error] Operation error + * @property {string|null} [httpErrorMessage] Operation httpErrorMessage + * @property {number|null} [httpErrorStatusCode] Operation httpErrorStatusCode + * @property {number|Long|null} [id] Operation id + * @property {string|null} [insertTime] Operation insertTime + * @property {string|null} [kind] Operation kind + * @property {string|null} [name] Operation name + * @property {string|null} [operationGroupId] Operation operationGroupId + * @property {string|null} [operationType] Operation operationType + * @property {number|null} [progress] Operation progress + * @property {string|null} [region] Operation region + * @property {string|null} [selfLink] Operation selfLink + * @property {string|null} [startTime] Operation startTime + * @property {google.cloud.compute.v1.Operation.Status|null} [status] Operation status + * @property {string|null} [statusMessage] Operation statusMessage + * @property {number|Long|null} [targetId] Operation targetId + * @property {string|null} [targetLink] Operation targetLink + * @property {string|null} [user] Operation user + * @property {Array.|null} [warnings] Operation warnings + * @property {string|null} [zone] Operation zone + */ + + /** + * Constructs a new Operation. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.cloud.compute.v1.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + 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]]; + } + + /** + * Operation clientOperationId. + * @member {string|null|undefined} clientOperationId + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.clientOperationId = null; + + /** + * Operation creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.creationTimestamp = null; + + /** + * Operation description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.description = null; + + /** + * Operation endTime. + * @member {string|null|undefined} endTime + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.endTime = null; + + /** + * Operation error. + * @member {google.cloud.compute.v1.IError|null|undefined} error + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation httpErrorMessage. + * @member {string|null|undefined} httpErrorMessage + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.httpErrorMessage = null; + + /** + * Operation httpErrorStatusCode. + * @member {number|null|undefined} httpErrorStatusCode + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.httpErrorStatusCode = null; + + /** + * Operation id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.id = null; + + /** + * Operation insertTime. + * @member {string|null|undefined} insertTime + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.insertTime = null; + + /** + * Operation kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.kind = null; + + /** + * Operation name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.name = null; + + /** + * Operation operationGroupId. + * @member {string|null|undefined} operationGroupId + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.operationGroupId = null; + + /** + * Operation operationType. + * @member {string|null|undefined} operationType + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.operationType = null; + + /** + * Operation progress. + * @member {number|null|undefined} progress + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.progress = null; + + /** + * Operation region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.region = null; + + /** + * Operation selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.selfLink = null; + + /** + * Operation startTime. + * @member {string|null|undefined} startTime + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.startTime = null; + + /** + * Operation status. + * @member {google.cloud.compute.v1.Operation.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.status = null; + + /** + * Operation statusMessage. + * @member {string|null|undefined} statusMessage + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.statusMessage = null; + + /** + * Operation targetId. + * @member {number|Long|null|undefined} targetId + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.targetId = null; + + /** + * Operation targetLink. + * @member {string|null|undefined} targetLink + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.targetLink = null; + + /** + * Operation user. + * @member {string|null|undefined} user + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.user = null; + + /** + * Operation warnings. + * @member {Array.} warnings + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.warnings = $util.emptyArray; + + /** + * Operation zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Operation.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation _clientOperationId. + * @member {"clientOperationId"|undefined} _clientOperationId + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_clientOperationId", { + get: $util.oneOfGetter($oneOfFields = ["clientOperationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _endTime. + * @member {"endTime"|undefined} _endTime + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_endTime", { + get: $util.oneOfGetter($oneOfFields = ["endTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _error. + * @member {"error"|undefined} _error + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_error", { + get: $util.oneOfGetter($oneOfFields = ["error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _httpErrorMessage. + * @member {"httpErrorMessage"|undefined} _httpErrorMessage + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_httpErrorMessage", { + get: $util.oneOfGetter($oneOfFields = ["httpErrorMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _httpErrorStatusCode. + * @member {"httpErrorStatusCode"|undefined} _httpErrorStatusCode + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_httpErrorStatusCode", { + get: $util.oneOfGetter($oneOfFields = ["httpErrorStatusCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _insertTime. + * @member {"insertTime"|undefined} _insertTime + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_insertTime", { + get: $util.oneOfGetter($oneOfFields = ["insertTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _operationGroupId. + * @member {"operationGroupId"|undefined} _operationGroupId + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_operationGroupId", { + get: $util.oneOfGetter($oneOfFields = ["operationGroupId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _operationType. + * @member {"operationType"|undefined} _operationType + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_operationType", { + get: $util.oneOfGetter($oneOfFields = ["operationType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _progress. + * @member {"progress"|undefined} _progress + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_progress", { + get: $util.oneOfGetter($oneOfFields = ["progress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _startTime. + * @member {"startTime"|undefined} _startTime + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _statusMessage. + * @member {"statusMessage"|undefined} _statusMessage + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_statusMessage", { + get: $util.oneOfGetter($oneOfFields = ["statusMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _targetId. + * @member {"targetId"|undefined} _targetId + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_targetId", { + get: $util.oneOfGetter($oneOfFields = ["targetId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _targetLink. + * @member {"targetLink"|undefined} _targetLink + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_targetLink", { + get: $util.oneOfGetter($oneOfFields = ["targetLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _user. + * @member {"user"|undefined} _user + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_user", { + get: $util.oneOfGetter($oneOfFields = ["user"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Operation _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Operation + * @static + * @param {google.cloud.compute.v1.IOperation=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.cloud.compute.v1.Operation.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Operation + * @static + * @param {google.cloud.compute.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 3599307, wireType 2 =*/28794458).string(message.user); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 37467274, wireType 2 =*/299738194).string(message.startTime); + if (message.operationGroupId != null && Object.hasOwnProperty.call(message, "operationGroupId")) + writer.uint32(/* id 40171187, wireType 2 =*/321369498).string(message.operationGroupId); + if (message.targetLink != null && Object.hasOwnProperty.call(message, "targetLink")) + writer.uint32(/* id 62671336, wireType 2 =*/501370690).string(message.targetLink); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + writer.uint32(/* id 72663597, wireType 0 =*/581308776).int32(message.progress); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.cloud.compute.v1.Error.encode(message.error, writer.uint32(/* id 96784904, wireType 2 =*/774279234).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + writer.uint32(/* id 114938801, wireType 2 =*/919510410).string(message.endTime); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 177650450, wireType 2 =*/1421203602).string(message.operationType); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.httpErrorMessage != null && Object.hasOwnProperty.call(message, "httpErrorMessage")) + writer.uint32(/* id 202521945, wireType 2 =*/1620175562).string(message.httpErrorMessage); + if (message.targetId != null && Object.hasOwnProperty.call(message, "targetId")) + writer.uint32(/* id 258165385, wireType 0 =*/2065323080).uint64(message.targetId); + if (message.clientOperationId != null && Object.hasOwnProperty.call(message, "clientOperationId")) + writer.uint32(/* id 297240295, wireType 2 =*/2377922362).string(message.clientOperationId); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 297428154, wireType 2 =*/2379425234).string(message.statusMessage); + if (message.httpErrorStatusCode != null && Object.hasOwnProperty.call(message, "httpErrorStatusCode")) + writer.uint32(/* id 312345196, wireType 0 =*/2498761568).int32(message.httpErrorStatusCode); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.insertTime != null && Object.hasOwnProperty.call(message, "insertTime")) + writer.uint32(/* id 433722515, wireType 2 =*/3469780122).string(message.insertTime); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.cloud.compute.v1.Warnings.encode(message.warnings[i], writer.uint32(/* id 498091095, wireType 2 =*/3984728762).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Operation + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 297240295: + message.clientOperationId = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 114938801: + message.endTime = reader.string(); + break; + case 96784904: + message.error = $root.google.cloud.compute.v1.Error.decode(reader, reader.uint32()); + break; + case 202521945: + message.httpErrorMessage = reader.string(); + break; + case 312345196: + message.httpErrorStatusCode = reader.int32(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 433722515: + message.insertTime = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 40171187: + message.operationGroupId = reader.string(); + break; + case 177650450: + message.operationType = reader.string(); + break; + case 72663597: + message.progress = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 37467274: + message.startTime = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 297428154: + message.statusMessage = reader.string(); + break; + case 258165385: + message.targetId = reader.uint64(); + break; + case 62671336: + message.targetLink = reader.string(); + break; + case 3599307: + message.user = reader.string(); + break; + case 498091095: + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.compute.v1.Warnings.decode(reader, reader.uint32())); + break; + case 3744684: + message.zone = reader.string(); + 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.compute.v1.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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.clientOperationId != null && message.hasOwnProperty("clientOperationId")) { + properties._clientOperationId = 1; + if (!$util.isString(message.clientOperationId)) + return "clientOperationId: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + properties._endTime = 1; + if (!$util.isString(message.endTime)) + return "endTime: string expected"; + } + if (message.error != null && message.hasOwnProperty("error")) { + properties._error = 1; + { + var error = $root.google.cloud.compute.v1.Error.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.httpErrorMessage != null && message.hasOwnProperty("httpErrorMessage")) { + properties._httpErrorMessage = 1; + if (!$util.isString(message.httpErrorMessage)) + return "httpErrorMessage: string expected"; + } + if (message.httpErrorStatusCode != null && message.hasOwnProperty("httpErrorStatusCode")) { + properties._httpErrorStatusCode = 1; + if (!$util.isInteger(message.httpErrorStatusCode)) + return "httpErrorStatusCode: integer expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.insertTime != null && message.hasOwnProperty("insertTime")) { + properties._insertTime = 1; + if (!$util.isString(message.insertTime)) + return "insertTime: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.operationGroupId != null && message.hasOwnProperty("operationGroupId")) { + properties._operationGroupId = 1; + if (!$util.isString(message.operationGroupId)) + return "operationGroupId: string expected"; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) { + properties._operationType = 1; + if (!$util.isString(message.operationType)) + return "operationType: string expected"; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + properties._progress = 1; + if (!$util.isInteger(message.progress)) + return "progress: integer expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties._startTime = 1; + if (!$util.isString(message.startTime)) + return "startTime: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 2104194: + case 35394935: + case 121282975: + break; + } + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + properties._statusMessage = 1; + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) { + properties._targetId = 1; + if (!$util.isInteger(message.targetId) && !(message.targetId && $util.isInteger(message.targetId.low) && $util.isInteger(message.targetId.high))) + return "targetId: integer|Long expected"; + } + if (message.targetLink != null && message.hasOwnProperty("targetLink")) { + properties._targetLink = 1; + if (!$util.isString(message.targetLink)) + return "targetLink: string expected"; + } + if (message.user != null && message.hasOwnProperty("user")) { + properties._user = 1; + if (!$util.isString(message.user)) + return "user: 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) { + var error = $root.google.cloud.compute.v1.Warnings.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Operation) + return object; + var message = new $root.google.cloud.compute.v1.Operation(); + if (object.clientOperationId != null) + message.clientOperationId = String(object.clientOperationId); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.endTime != null) + message.endTime = String(object.endTime); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.compute.v1.Operation.error: object expected"); + message.error = $root.google.cloud.compute.v1.Error.fromObject(object.error); + } + if (object.httpErrorMessage != null) + message.httpErrorMessage = String(object.httpErrorMessage); + if (object.httpErrorStatusCode != null) + message.httpErrorStatusCode = object.httpErrorStatusCode | 0; + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.insertTime != null) + message.insertTime = String(object.insertTime); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.operationGroupId != null) + message.operationGroupId = String(object.operationGroupId); + if (object.operationType != null) + message.operationType = String(object.operationType); + if (object.progress != null) + message.progress = object.progress | 0; + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.startTime != null) + message.startTime = String(object.startTime); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "DONE": + case 2104194: + message.status = 2104194; + break; + case "PENDING": + case 35394935: + message.status = 35394935; + break; + case "RUNNING": + case 121282975: + message.status = 121282975; + break; + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.targetId != null) + if ($util.Long) + (message.targetId = $util.Long.fromValue(object.targetId)).unsigned = true; + else if (typeof object.targetId === "string") + message.targetId = parseInt(object.targetId, 10); + else if (typeof object.targetId === "number") + message.targetId = object.targetId; + else if (typeof object.targetId === "object") + message.targetId = new $util.LongBits(object.targetId.low >>> 0, object.targetId.high >>> 0).toNumber(true); + if (object.targetLink != null) + message.targetLink = String(object.targetLink); + if (object.user != null) + message.user = String(object.user); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.compute.v1.Operation.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Operation.warnings: object expected"); + message.warnings[i] = $root.google.cloud.compute.v1.Warnings.fromObject(object.warnings[i]); + } + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Operation + * @static + * @param {google.cloud.compute.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.arrays || options.defaults) + object.warnings = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.user != null && message.hasOwnProperty("user")) { + object.user = message.user; + if (options.oneofs) + object._user = "user"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.operationGroupId != null && message.hasOwnProperty("operationGroupId")) { + object.operationGroupId = message.operationGroupId; + if (options.oneofs) + object._operationGroupId = "operationGroupId"; + } + if (message.targetLink != null && message.hasOwnProperty("targetLink")) { + object.targetLink = message.targetLink; + if (options.oneofs) + object._targetLink = "targetLink"; + } + if (message.progress != null && message.hasOwnProperty("progress")) { + object.progress = message.progress; + if (options.oneofs) + object._progress = "progress"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.cloud.compute.v1.Error.toObject(message.error, options); + if (options.oneofs) + object._error = "error"; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + object.endTime = message.endTime; + if (options.oneofs) + object._endTime = "endTime"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) { + object.operationType = message.operationType; + if (options.oneofs) + object._operationType = "operationType"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Operation.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.httpErrorMessage != null && message.hasOwnProperty("httpErrorMessage")) { + object.httpErrorMessage = message.httpErrorMessage; + if (options.oneofs) + object._httpErrorMessage = "httpErrorMessage"; + } + if (message.targetId != null && message.hasOwnProperty("targetId")) { + if (typeof message.targetId === "number") + object.targetId = options.longs === String ? String(message.targetId) : message.targetId; + else + object.targetId = options.longs === String ? $util.Long.prototype.toString.call(message.targetId) : options.longs === Number ? new $util.LongBits(message.targetId.low >>> 0, message.targetId.high >>> 0).toNumber(true) : message.targetId; + if (options.oneofs) + object._targetId = "targetId"; + } + if (message.clientOperationId != null && message.hasOwnProperty("clientOperationId")) { + object.clientOperationId = message.clientOperationId; + if (options.oneofs) + object._clientOperationId = "clientOperationId"; + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) { + object.statusMessage = message.statusMessage; + if (options.oneofs) + object._statusMessage = "statusMessage"; + } + if (message.httpErrorStatusCode != null && message.hasOwnProperty("httpErrorStatusCode")) { + object.httpErrorStatusCode = message.httpErrorStatusCode; + if (options.oneofs) + object._httpErrorStatusCode = "httpErrorStatusCode"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.insertTime != null && message.hasOwnProperty("insertTime")) { + object.insertTime = message.insertTime; + if (options.oneofs) + object._insertTime = "insertTime"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.compute.v1.Warnings.toObject(message.warnings[j], options); + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.Operation.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} DONE=2104194 DONE value + * @property {number} PENDING=35394935 PENDING value + * @property {number} RUNNING=121282975 RUNNING value + */ + Operation.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[2104194] = "DONE"] = 2104194; + values[valuesById[35394935] = "PENDING"] = 35394935; + values[valuesById[121282975] = "RUNNING"] = 121282975; + return values; + })(); + + return Operation; + })(); + + v1.OperationsScopedList = (function() { + + /** + * Properties of an OperationsScopedList. + * @memberof google.cloud.compute.v1 + * @interface IOperationsScopedList + * @property {Array.|null} [operations] OperationsScopedList operations + * @property {google.cloud.compute.v1.IWarning|null} [warning] OperationsScopedList warning + */ + + /** + * Constructs a new OperationsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an OperationsScopedList. + * @implements IOperationsScopedList + * @constructor + * @param {google.cloud.compute.v1.IOperationsScopedList=} [properties] Properties to set + */ + function OperationsScopedList(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]]; + } + + /** + * OperationsScopedList operations. + * @member {Array.} operations + * @memberof google.cloud.compute.v1.OperationsScopedList + * @instance + */ + OperationsScopedList.prototype.operations = $util.emptyArray; + + /** + * OperationsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.OperationsScopedList + * @instance + */ + OperationsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.OperationsScopedList + * @instance + */ + Object.defineProperty(OperationsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {google.cloud.compute.v1.IOperationsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.OperationsScopedList} OperationsScopedList instance + */ + OperationsScopedList.create = function create(properties) { + return new OperationsScopedList(properties); + }; + + /** + * Encodes the specified OperationsScopedList message. Does not implicitly {@link google.cloud.compute.v1.OperationsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {google.cloud.compute.v1.IOperationsScopedList} message OperationsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationsScopedList.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.compute.v1.Operation.encode(message.operations[i], writer.uint32(/* id 4184044, wireType 2 =*/33472354).fork()).ldelim(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OperationsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {google.cloud.compute.v1.IOperationsScopedList} message OperationsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.OperationsScopedList} OperationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.OperationsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4184044: + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.cloud.compute.v1.Operation.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.OperationsScopedList} OperationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.compute.v1.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an OperationsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.OperationsScopedList} OperationsScopedList + */ + OperationsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.OperationsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.OperationsScopedList(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.cloud.compute.v1.OperationsScopedList.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.cloud.compute.v1.OperationsScopedList.operations: object expected"); + message.operations[i] = $root.google.cloud.compute.v1.Operation.fromObject(object.operations[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.OperationsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an OperationsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.OperationsScopedList + * @static + * @param {google.cloud.compute.v1.OperationsScopedList} message OperationsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationsScopedList.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.compute.v1.Operation.toObject(message.operations[j], options); + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + return object; + }; + + /** + * Converts this OperationsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.OperationsScopedList + * @instance + * @returns {Object.} JSON object + */ + OperationsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationsScopedList; + })(); + + v1.OperationAggregatedList = (function() { + + /** + * Properties of an OperationAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IOperationAggregatedList + * @property {string|null} [id] OperationAggregatedList id + * @property {Object.|null} [items] OperationAggregatedList items + * @property {string|null} [kind] OperationAggregatedList kind + * @property {string|null} [nextPageToken] OperationAggregatedList nextPageToken + * @property {string|null} [selfLink] OperationAggregatedList selfLink + * @property {Array.|null} [unreachables] OperationAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] OperationAggregatedList warning + */ + + /** + * Constructs a new OperationAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an OperationAggregatedList. + * @implements IOperationAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IOperationAggregatedList=} [properties] Properties to set + */ + function OperationAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + OperationAggregatedList.prototype.id = null; + + /** + * OperationAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + OperationAggregatedList.prototype.items = $util.emptyObject; + + /** + * OperationAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + OperationAggregatedList.prototype.kind = null; + + /** + * OperationAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + OperationAggregatedList.prototype.nextPageToken = null; + + /** + * OperationAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + OperationAggregatedList.prototype.selfLink = null; + + /** + * OperationAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + OperationAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * OperationAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + OperationAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + Object.defineProperty(OperationAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + Object.defineProperty(OperationAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + Object.defineProperty(OperationAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + Object.defineProperty(OperationAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + */ + Object.defineProperty(OperationAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {google.cloud.compute.v1.IOperationAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.OperationAggregatedList} OperationAggregatedList instance + */ + OperationAggregatedList.create = function create(properties) { + return new OperationAggregatedList(properties); + }; + + /** + * Encodes the specified OperationAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.OperationAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {google.cloud.compute.v1.IOperationAggregatedList} message OperationAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.OperationsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified OperationAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OperationAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {google.cloud.compute.v1.IOperationAggregatedList} message OperationAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.OperationAggregatedList} OperationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.OperationAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.OperationsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.OperationAggregatedList} OperationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.OperationsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an OperationAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.OperationAggregatedList} OperationAggregatedList + */ + OperationAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.OperationAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.OperationAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.OperationAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.OperationAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.OperationsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.OperationAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.OperationAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an OperationAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @static + * @param {google.cloud.compute.v1.OperationAggregatedList} message OperationAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.OperationsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this OperationAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.OperationAggregatedList + * @instance + * @returns {Object.} JSON object + */ + OperationAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationAggregatedList; + })(); + + v1.OperationList = (function() { + + /** + * Properties of an OperationList. + * @memberof google.cloud.compute.v1 + * @interface IOperationList + * @property {string|null} [id] OperationList id + * @property {Array.|null} [items] OperationList items + * @property {string|null} [kind] OperationList kind + * @property {string|null} [nextPageToken] OperationList nextPageToken + * @property {string|null} [selfLink] OperationList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] OperationList warning + */ + + /** + * Constructs a new OperationList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an OperationList. + * @implements IOperationList + * @constructor + * @param {google.cloud.compute.v1.IOperationList=} [properties] Properties to set + */ + function OperationList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + OperationList.prototype.id = null; + + /** + * OperationList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + OperationList.prototype.items = $util.emptyArray; + + /** + * OperationList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + OperationList.prototype.kind = null; + + /** + * OperationList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + OperationList.prototype.nextPageToken = null; + + /** + * OperationList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + OperationList.prototype.selfLink = null; + + /** + * OperationList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + OperationList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OperationList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + Object.defineProperty(OperationList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + Object.defineProperty(OperationList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + Object.defineProperty(OperationList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + Object.defineProperty(OperationList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * OperationList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.OperationList + * @instance + */ + Object.defineProperty(OperationList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OperationList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {google.cloud.compute.v1.IOperationList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.OperationList} OperationList instance + */ + OperationList.create = function create(properties) { + return new OperationList(properties); + }; + + /** + * Encodes the specified OperationList message. Does not implicitly {@link google.cloud.compute.v1.OperationList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {google.cloud.compute.v1.IOperationList} message OperationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Operation.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified OperationList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.OperationList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {google.cloud.compute.v1.IOperationList} message OperationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.OperationList} OperationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.OperationList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Operation.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.OperationList} OperationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationList message. + * @function verify + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Operation.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an OperationList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.OperationList} OperationList + */ + OperationList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.OperationList) + return object; + var message = new $root.google.cloud.compute.v1.OperationList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.OperationList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.OperationList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Operation.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.OperationList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an OperationList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.OperationList + * @static + * @param {google.cloud.compute.v1.OperationList} message OperationList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Operation.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this OperationList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.OperationList + * @instance + * @returns {Object.} JSON object + */ + OperationList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationList; + })(); + + v1.PacketMirroringForwardingRuleInfo = (function() { + + /** + * Properties of a PacketMirroringForwardingRuleInfo. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringForwardingRuleInfo + * @property {string|null} [canonicalUrl] PacketMirroringForwardingRuleInfo canonicalUrl + * @property {string|null} [url] PacketMirroringForwardingRuleInfo url + */ + + /** + * Constructs a new PacketMirroringForwardingRuleInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringForwardingRuleInfo. + * @implements IPacketMirroringForwardingRuleInfo + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo=} [properties] Properties to set + */ + function PacketMirroringForwardingRuleInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringForwardingRuleInfo canonicalUrl. + * @member {string|null|undefined} canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @instance + */ + PacketMirroringForwardingRuleInfo.prototype.canonicalUrl = null; + + /** + * PacketMirroringForwardingRuleInfo url. + * @member {string|null|undefined} url + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @instance + */ + PacketMirroringForwardingRuleInfo.prototype.url = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringForwardingRuleInfo _canonicalUrl. + * @member {"canonicalUrl"|undefined} _canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @instance + */ + Object.defineProperty(PacketMirroringForwardingRuleInfo.prototype, "_canonicalUrl", { + get: $util.oneOfGetter($oneOfFields = ["canonicalUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringForwardingRuleInfo _url. + * @member {"url"|undefined} _url + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @instance + */ + Object.defineProperty(PacketMirroringForwardingRuleInfo.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringForwardingRuleInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringForwardingRuleInfo} PacketMirroringForwardingRuleInfo instance + */ + PacketMirroringForwardingRuleInfo.create = function create(properties) { + return new PacketMirroringForwardingRuleInfo(properties); + }; + + /** + * Encodes the specified PacketMirroringForwardingRuleInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo} message PacketMirroringForwardingRuleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringForwardingRuleInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 116079, wireType 2 =*/928634).string(message.url); + if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) + writer.uint32(/* id 512294820, wireType 2 =*/4098358562).string(message.canonicalUrl); + return writer; + }; + + /** + * Encodes the specified PacketMirroringForwardingRuleInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo} message PacketMirroringForwardingRuleInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringForwardingRuleInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringForwardingRuleInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringForwardingRuleInfo} PacketMirroringForwardingRuleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringForwardingRuleInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 512294820: + message.canonicalUrl = reader.string(); + break; + case 116079: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringForwardingRuleInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringForwardingRuleInfo} PacketMirroringForwardingRuleInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringForwardingRuleInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringForwardingRuleInfo message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringForwardingRuleInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + properties._canonicalUrl = 1; + if (!$util.isString(message.canonicalUrl)) + return "canonicalUrl: string expected"; + } + if (message.url != null && message.hasOwnProperty("url")) { + properties._url = 1; + if (!$util.isString(message.url)) + return "url: string expected"; + } + return null; + }; + + /** + * Creates a PacketMirroringForwardingRuleInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringForwardingRuleInfo} PacketMirroringForwardingRuleInfo + */ + PacketMirroringForwardingRuleInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo(); + if (object.canonicalUrl != null) + message.canonicalUrl = String(object.canonicalUrl); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a PacketMirroringForwardingRuleInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @static + * @param {google.cloud.compute.v1.PacketMirroringForwardingRuleInfo} message PacketMirroringForwardingRuleInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringForwardingRuleInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.url != null && message.hasOwnProperty("url")) { + object.url = message.url; + if (options.oneofs) + object._url = "url"; + } + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + object.canonicalUrl = message.canonicalUrl; + if (options.oneofs) + object._canonicalUrl = "canonicalUrl"; + } + return object; + }; + + /** + * Converts this PacketMirroringForwardingRuleInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringForwardingRuleInfo + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringForwardingRuleInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringForwardingRuleInfo; + })(); + + v1.PacketMirroringFilter = (function() { + + /** + * Properties of a PacketMirroringFilter. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringFilter + * @property {Array.|null} [IPProtocols] PacketMirroringFilter IPProtocols + * @property {Array.|null} [cidrRanges] PacketMirroringFilter cidrRanges + * @property {google.cloud.compute.v1.PacketMirroringFilter.Direction|null} [direction] PacketMirroringFilter direction + */ + + /** + * Constructs a new PacketMirroringFilter. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringFilter. + * @implements IPacketMirroringFilter + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringFilter=} [properties] Properties to set + */ + function PacketMirroringFilter(properties) { + this.IPProtocols = []; + this.cidrRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringFilter IPProtocols. + * @member {Array.} IPProtocols + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @instance + */ + PacketMirroringFilter.prototype.IPProtocols = $util.emptyArray; + + /** + * PacketMirroringFilter cidrRanges. + * @member {Array.} cidrRanges + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @instance + */ + PacketMirroringFilter.prototype.cidrRanges = $util.emptyArray; + + /** + * PacketMirroringFilter direction. + * @member {google.cloud.compute.v1.PacketMirroringFilter.Direction|null|undefined} direction + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @instance + */ + PacketMirroringFilter.prototype.direction = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringFilter _direction. + * @member {"direction"|undefined} _direction + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @instance + */ + Object.defineProperty(PacketMirroringFilter.prototype, "_direction", { + get: $util.oneOfGetter($oneOfFields = ["direction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringFilter instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {google.cloud.compute.v1.IPacketMirroringFilter=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringFilter} PacketMirroringFilter instance + */ + PacketMirroringFilter.create = function create(properties) { + return new PacketMirroringFilter(properties); + }; + + /** + * Encodes the specified PacketMirroringFilter message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringFilter.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {google.cloud.compute.v1.IPacketMirroringFilter} message PacketMirroringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.IPProtocols != null && message.IPProtocols.length) + for (var i = 0; i < message.IPProtocols.length; ++i) + writer.uint32(/* id 98544854, wireType 2 =*/788358834).string(message.IPProtocols[i]); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 111150975, wireType 0 =*/889207800).int32(message.direction); + if (message.cidrRanges != null && message.cidrRanges.length) + for (var i = 0; i < message.cidrRanges.length; ++i) + writer.uint32(/* id 487901697, wireType 2 =*/3903213578).string(message.cidrRanges[i]); + return writer; + }; + + /** + * Encodes the specified PacketMirroringFilter message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {google.cloud.compute.v1.IPacketMirroringFilter} message PacketMirroringFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringFilter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringFilter} PacketMirroringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 98544854: + if (!(message.IPProtocols && message.IPProtocols.length)) + message.IPProtocols = []; + message.IPProtocols.push(reader.string()); + break; + case 487901697: + if (!(message.cidrRanges && message.cidrRanges.length)) + message.cidrRanges = []; + message.cidrRanges.push(reader.string()); + break; + case 111150975: + message.direction = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringFilter} PacketMirroringFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringFilter message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.IPProtocols != null && message.hasOwnProperty("IPProtocols")) { + if (!Array.isArray(message.IPProtocols)) + return "IPProtocols: array expected"; + for (var i = 0; i < message.IPProtocols.length; ++i) + if (!$util.isString(message.IPProtocols[i])) + return "IPProtocols: string[] expected"; + } + if (message.cidrRanges != null && message.hasOwnProperty("cidrRanges")) { + if (!Array.isArray(message.cidrRanges)) + return "cidrRanges: array expected"; + for (var i = 0; i < message.cidrRanges.length; ++i) + if (!$util.isString(message.cidrRanges[i])) + return "cidrRanges: string[] expected"; + } + if (message.direction != null && message.hasOwnProperty("direction")) { + properties._direction = 1; + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 2044801: + case 432880501: + case 516931221: + break; + } + } + return null; + }; + + /** + * Creates a PacketMirroringFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringFilter} PacketMirroringFilter + */ + PacketMirroringFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringFilter) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringFilter(); + if (object.IPProtocols) { + if (!Array.isArray(object.IPProtocols)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringFilter.IPProtocols: array expected"); + message.IPProtocols = []; + for (var i = 0; i < object.IPProtocols.length; ++i) + message.IPProtocols[i] = String(object.IPProtocols[i]); + } + if (object.cidrRanges) { + if (!Array.isArray(object.cidrRanges)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringFilter.cidrRanges: array expected"); + message.cidrRanges = []; + for (var i = 0; i < object.cidrRanges.length; ++i) + message.cidrRanges[i] = String(object.cidrRanges[i]); + } + switch (object.direction) { + case "UNDEFINED_DIRECTION": + case 0: + message.direction = 0; + break; + case "BOTH": + case 2044801: + message.direction = 2044801; + break; + case "EGRESS": + case 432880501: + message.direction = 432880501; + break; + case "INGRESS": + case 516931221: + message.direction = 516931221; + break; + } + return message; + }; + + /** + * Creates a plain object from a PacketMirroringFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @static + * @param {google.cloud.compute.v1.PacketMirroringFilter} message PacketMirroringFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.IPProtocols = []; + object.cidrRanges = []; + } + if (message.IPProtocols && message.IPProtocols.length) { + object.IPProtocols = []; + for (var j = 0; j < message.IPProtocols.length; ++j) + object.IPProtocols[j] = message.IPProtocols[j]; + } + if (message.direction != null && message.hasOwnProperty("direction")) { + object.direction = options.enums === String ? $root.google.cloud.compute.v1.PacketMirroringFilter.Direction[message.direction] : message.direction; + if (options.oneofs) + object._direction = "direction"; + } + if (message.cidrRanges && message.cidrRanges.length) { + object.cidrRanges = []; + for (var j = 0; j < message.cidrRanges.length; ++j) + object.cidrRanges[j] = message.cidrRanges[j]; + } + return object; + }; + + /** + * Converts this PacketMirroringFilter to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringFilter + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Direction enum. + * @name google.cloud.compute.v1.PacketMirroringFilter.Direction + * @enum {number} + * @property {number} UNDEFINED_DIRECTION=0 UNDEFINED_DIRECTION value + * @property {number} BOTH=2044801 BOTH value + * @property {number} EGRESS=432880501 EGRESS value + * @property {number} INGRESS=516931221 INGRESS value + */ + PacketMirroringFilter.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_DIRECTION"] = 0; + values[valuesById[2044801] = "BOTH"] = 2044801; + values[valuesById[432880501] = "EGRESS"] = 432880501; + values[valuesById[516931221] = "INGRESS"] = 516931221; + return values; + })(); + + return PacketMirroringFilter; + })(); + + v1.PacketMirroringMirroredResourceInfo = (function() { + + /** + * Properties of a PacketMirroringMirroredResourceInfo. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringMirroredResourceInfo + * @property {Array.|null} [instances] PacketMirroringMirroredResourceInfo instances + * @property {Array.|null} [subnetworks] PacketMirroringMirroredResourceInfo subnetworks + * @property {Array.|null} [tags] PacketMirroringMirroredResourceInfo tags + */ + + /** + * Constructs a new PacketMirroringMirroredResourceInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringMirroredResourceInfo. + * @implements IPacketMirroringMirroredResourceInfo + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo=} [properties] Properties to set + */ + function PacketMirroringMirroredResourceInfo(properties) { + this.instances = []; + this.subnetworks = []; + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringMirroredResourceInfo instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @instance + */ + PacketMirroringMirroredResourceInfo.prototype.instances = $util.emptyArray; + + /** + * PacketMirroringMirroredResourceInfo subnetworks. + * @member {Array.} subnetworks + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @instance + */ + PacketMirroringMirroredResourceInfo.prototype.subnetworks = $util.emptyArray; + + /** + * PacketMirroringMirroredResourceInfo tags. + * @member {Array.} tags + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @instance + */ + PacketMirroringMirroredResourceInfo.prototype.tags = $util.emptyArray; + + /** + * Creates a new PacketMirroringMirroredResourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfo} PacketMirroringMirroredResourceInfo instance + */ + PacketMirroringMirroredResourceInfo.create = function create(properties) { + return new PacketMirroringMirroredResourceInfo(properties); + }; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo} message PacketMirroringMirroredResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringMirroredResourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 3552281, wireType 2 =*/28418250).string(message.tags[i]); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + if (message.subnetworks != null && message.subnetworks.length) + for (var i = 0; i < message.subnetworks.length; ++i) + $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.encode(message.subnetworks[i], writer.uint32(/* id 415853125, wireType 2 =*/3326825002).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo} message PacketMirroringMirroredResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringMirroredResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringMirroredResourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfo} PacketMirroringMirroredResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringMirroredResourceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.decode(reader, reader.uint32())); + break; + case 415853125: + if (!(message.subnetworks && message.subnetworks.length)) + message.subnetworks = []; + message.subnetworks.push($root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.decode(reader, reader.uint32())); + break; + case 3552281: + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringMirroredResourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfo} PacketMirroringMirroredResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringMirroredResourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringMirroredResourceInfo message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringMirroredResourceInfo.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.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.subnetworks != null && message.hasOwnProperty("subnetworks")) { + if (!Array.isArray(message.subnetworks)) + return "subnetworks: array expected"; + for (var i = 0; i < message.subnetworks.length; ++i) { + var error = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.verify(message.subnetworks[i]); + if (error) + return "subnetworks." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + return null; + }; + + /** + * Creates a PacketMirroringMirroredResourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfo} PacketMirroringMirroredResourceInfo + */ + PacketMirroringMirroredResourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.fromObject(object.instances[i]); + } + } + if (object.subnetworks) { + if (!Array.isArray(object.subnetworks)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.subnetworks: array expected"); + message.subnetworks = []; + for (var i = 0; i < object.subnetworks.length; ++i) { + if (typeof object.subnetworks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.subnetworks: object expected"); + message.subnetworks[i] = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.fromObject(object.subnetworks[i]); + } + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + return message; + }; + + /** + * Creates a plain object from a PacketMirroringMirroredResourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @static + * @param {google.cloud.compute.v1.PacketMirroringMirroredResourceInfo} message PacketMirroringMirroredResourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringMirroredResourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tags = []; + object.instances = []; + object.subnetworks = []; + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.toObject(message.instances[j], options); + } + if (message.subnetworks && message.subnetworks.length) { + object.subnetworks = []; + for (var j = 0; j < message.subnetworks.length; ++j) + object.subnetworks[j] = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.toObject(message.subnetworks[j], options); + } + return object; + }; + + /** + * Converts this PacketMirroringMirroredResourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfo + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringMirroredResourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringMirroredResourceInfo; + })(); + + v1.PacketMirroringNetworkInfo = (function() { + + /** + * Properties of a PacketMirroringNetworkInfo. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringNetworkInfo + * @property {string|null} [canonicalUrl] PacketMirroringNetworkInfo canonicalUrl + * @property {string|null} [url] PacketMirroringNetworkInfo url + */ + + /** + * Constructs a new PacketMirroringNetworkInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringNetworkInfo. + * @implements IPacketMirroringNetworkInfo + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringNetworkInfo=} [properties] Properties to set + */ + function PacketMirroringNetworkInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringNetworkInfo canonicalUrl. + * @member {string|null|undefined} canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @instance + */ + PacketMirroringNetworkInfo.prototype.canonicalUrl = null; + + /** + * PacketMirroringNetworkInfo url. + * @member {string|null|undefined} url + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @instance + */ + PacketMirroringNetworkInfo.prototype.url = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringNetworkInfo _canonicalUrl. + * @member {"canonicalUrl"|undefined} _canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @instance + */ + Object.defineProperty(PacketMirroringNetworkInfo.prototype, "_canonicalUrl", { + get: $util.oneOfGetter($oneOfFields = ["canonicalUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringNetworkInfo _url. + * @member {"url"|undefined} _url + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @instance + */ + Object.defineProperty(PacketMirroringNetworkInfo.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringNetworkInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringNetworkInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringNetworkInfo} PacketMirroringNetworkInfo instance + */ + PacketMirroringNetworkInfo.create = function create(properties) { + return new PacketMirroringNetworkInfo(properties); + }; + + /** + * Encodes the specified PacketMirroringNetworkInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringNetworkInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringNetworkInfo} message PacketMirroringNetworkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringNetworkInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 116079, wireType 2 =*/928634).string(message.url); + if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) + writer.uint32(/* id 512294820, wireType 2 =*/4098358562).string(message.canonicalUrl); + return writer; + }; + + /** + * Encodes the specified PacketMirroringNetworkInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringNetworkInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringNetworkInfo} message PacketMirroringNetworkInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringNetworkInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringNetworkInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringNetworkInfo} PacketMirroringNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringNetworkInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringNetworkInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 512294820: + message.canonicalUrl = reader.string(); + break; + case 116079: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringNetworkInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringNetworkInfo} PacketMirroringNetworkInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringNetworkInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringNetworkInfo message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringNetworkInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + properties._canonicalUrl = 1; + if (!$util.isString(message.canonicalUrl)) + return "canonicalUrl: string expected"; + } + if (message.url != null && message.hasOwnProperty("url")) { + properties._url = 1; + if (!$util.isString(message.url)) + return "url: string expected"; + } + return null; + }; + + /** + * Creates a PacketMirroringNetworkInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringNetworkInfo} PacketMirroringNetworkInfo + */ + PacketMirroringNetworkInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringNetworkInfo) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringNetworkInfo(); + if (object.canonicalUrl != null) + message.canonicalUrl = String(object.canonicalUrl); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a PacketMirroringNetworkInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @static + * @param {google.cloud.compute.v1.PacketMirroringNetworkInfo} message PacketMirroringNetworkInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringNetworkInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.url != null && message.hasOwnProperty("url")) { + object.url = message.url; + if (options.oneofs) + object._url = "url"; + } + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + object.canonicalUrl = message.canonicalUrl; + if (options.oneofs) + object._canonicalUrl = "canonicalUrl"; + } + return object; + }; + + /** + * Converts this PacketMirroringNetworkInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringNetworkInfo + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringNetworkInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringNetworkInfo; + })(); + + v1.PacketMirroring = (function() { + + /** + * Properties of a PacketMirroring. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroring + * @property {google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo|null} [collectorIlb] PacketMirroring collectorIlb + * @property {string|null} [creationTimestamp] PacketMirroring creationTimestamp + * @property {string|null} [description] PacketMirroring description + * @property {google.cloud.compute.v1.PacketMirroring.Enable|null} [enable] PacketMirroring enable + * @property {google.cloud.compute.v1.IPacketMirroringFilter|null} [filter] PacketMirroring filter + * @property {number|Long|null} [id] PacketMirroring id + * @property {string|null} [kind] PacketMirroring kind + * @property {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo|null} [mirroredResources] PacketMirroring mirroredResources + * @property {string|null} [name] PacketMirroring name + * @property {google.cloud.compute.v1.IPacketMirroringNetworkInfo|null} [network] PacketMirroring network + * @property {number|null} [priority] PacketMirroring priority + * @property {string|null} [region] PacketMirroring region + * @property {string|null} [selfLink] PacketMirroring selfLink + */ + + /** + * Constructs a new PacketMirroring. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroring. + * @implements IPacketMirroring + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroring=} [properties] Properties to set + */ + function PacketMirroring(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroring collectorIlb. + * @member {google.cloud.compute.v1.IPacketMirroringForwardingRuleInfo|null|undefined} collectorIlb + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.collectorIlb = null; + + /** + * PacketMirroring creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.creationTimestamp = null; + + /** + * PacketMirroring description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.description = null; + + /** + * PacketMirroring enable. + * @member {google.cloud.compute.v1.PacketMirroring.Enable|null|undefined} enable + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.enable = null; + + /** + * PacketMirroring filter. + * @member {google.cloud.compute.v1.IPacketMirroringFilter|null|undefined} filter + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.filter = null; + + /** + * PacketMirroring id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.id = null; + + /** + * PacketMirroring kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.kind = null; + + /** + * PacketMirroring mirroredResources. + * @member {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfo|null|undefined} mirroredResources + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.mirroredResources = null; + + /** + * PacketMirroring name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.name = null; + + /** + * PacketMirroring network. + * @member {google.cloud.compute.v1.IPacketMirroringNetworkInfo|null|undefined} network + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.network = null; + + /** + * PacketMirroring priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.priority = null; + + /** + * PacketMirroring region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.region = null; + + /** + * PacketMirroring selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + PacketMirroring.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroring _collectorIlb. + * @member {"collectorIlb"|undefined} _collectorIlb + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_collectorIlb", { + get: $util.oneOfGetter($oneOfFields = ["collectorIlb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _enable. + * @member {"enable"|undefined} _enable + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_enable", { + get: $util.oneOfGetter($oneOfFields = ["enable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _mirroredResources. + * @member {"mirroredResources"|undefined} _mirroredResources + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_mirroredResources", { + get: $util.oneOfGetter($oneOfFields = ["mirroredResources"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroring _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + */ + Object.defineProperty(PacketMirroring.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroring instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {google.cloud.compute.v1.IPacketMirroring=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroring} PacketMirroring instance + */ + PacketMirroring.create = function create(properties) { + return new PacketMirroring(properties); + }; + + /** + * Encodes the specified PacketMirroring message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroring.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {google.cloud.compute.v1.IPacketMirroring} message PacketMirroring message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroring.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.mirroredResources != null && Object.hasOwnProperty.call(message, "mirroredResources")) + $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.encode(message.mirroredResources, writer.uint32(/* id 124817348, wireType 2 =*/998538786).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + $root.google.cloud.compute.v1.PacketMirroringNetworkInfo.encode(message.network, writer.uint32(/* id 232872494, wireType 2 =*/1862979954).fork()).ldelim(); + if (message.enable != null && Object.hasOwnProperty.call(message, "enable")) + writer.uint32(/* id 311764355, wireType 0 =*/2494114840).int32(message.enable); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.cloud.compute.v1.PacketMirroringFilter.encode(message.filter, writer.uint32(/* id 336120696, wireType 2 =*/2688965570).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.collectorIlb != null && Object.hasOwnProperty.call(message, "collectorIlb")) + $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.encode(message.collectorIlb, writer.uint32(/* id 426607853, wireType 2 =*/3412862826).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).uint32(message.priority); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified PacketMirroring message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroring.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {google.cloud.compute.v1.IPacketMirroring} message PacketMirroring message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroring.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroring message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroring} PacketMirroring + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroring.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroring(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 426607853: + message.collectorIlb = $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.decode(reader, reader.uint32()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 311764355: + message.enable = reader.int32(); + break; + case 336120696: + message.filter = $root.google.cloud.compute.v1.PacketMirroringFilter.decode(reader, reader.uint32()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 124817348: + message.mirroredResources = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = $root.google.cloud.compute.v1.PacketMirroringNetworkInfo.decode(reader, reader.uint32()); + break; + case 445151652: + message.priority = reader.uint32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroring message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroring} PacketMirroring + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroring.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroring message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroring.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.collectorIlb != null && message.hasOwnProperty("collectorIlb")) { + properties._collectorIlb = 1; + { + var error = $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.verify(message.collectorIlb); + if (error) + return "collectorIlb." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.enable != null && message.hasOwnProperty("enable")) { + properties._enable = 1; + switch (message.enable) { + default: + return "enable: enum value expected"; + case 0: + case 66658563: + case 2583950: + break; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + { + var error = $root.google.cloud.compute.v1.PacketMirroringFilter.verify(message.filter); + if (error) + return "filter." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.mirroredResources != null && message.hasOwnProperty("mirroredResources")) { + properties._mirroredResources = 1; + { + var error = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.verify(message.mirroredResources); + if (error) + return "mirroredResources." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + { + var error = $root.google.cloud.compute.v1.PacketMirroringNetworkInfo.verify(message.network); + if (error) + return "network." + error; + } + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates a PacketMirroring message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroring} PacketMirroring + */ + PacketMirroring.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroring) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroring(); + if (object.collectorIlb != null) { + if (typeof object.collectorIlb !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroring.collectorIlb: object expected"); + message.collectorIlb = $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.fromObject(object.collectorIlb); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + switch (object.enable) { + case "UNDEFINED_ENABLE": + case 0: + message.enable = 0; + break; + case "FALSE": + case 66658563: + message.enable = 66658563; + break; + case "TRUE": + case 2583950: + message.enable = 2583950; + break; + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroring.filter: object expected"); + message.filter = $root.google.cloud.compute.v1.PacketMirroringFilter.fromObject(object.filter); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.mirroredResources != null) { + if (typeof object.mirroredResources !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroring.mirroredResources: object expected"); + message.mirroredResources = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.fromObject(object.mirroredResources); + } + if (object.name != null) + message.name = String(object.name); + if (object.network != null) { + if (typeof object.network !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroring.network: object expected"); + message.network = $root.google.cloud.compute.v1.PacketMirroringNetworkInfo.fromObject(object.network); + } + if (object.priority != null) + message.priority = object.priority >>> 0; + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from a PacketMirroring message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroring + * @static + * @param {google.cloud.compute.v1.PacketMirroring} message PacketMirroring + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroring.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.mirroredResources != null && message.hasOwnProperty("mirroredResources")) { + object.mirroredResources = $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfo.toObject(message.mirroredResources, options); + if (options.oneofs) + object._mirroredResources = "mirroredResources"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = $root.google.cloud.compute.v1.PacketMirroringNetworkInfo.toObject(message.network, options); + if (options.oneofs) + object._network = "network"; + } + if (message.enable != null && message.hasOwnProperty("enable")) { + object.enable = options.enums === String ? $root.google.cloud.compute.v1.PacketMirroring.Enable[message.enable] : message.enable; + if (options.oneofs) + object._enable = "enable"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = $root.google.cloud.compute.v1.PacketMirroringFilter.toObject(message.filter, options); + if (options.oneofs) + object._filter = "filter"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.collectorIlb != null && message.hasOwnProperty("collectorIlb")) { + object.collectorIlb = $root.google.cloud.compute.v1.PacketMirroringForwardingRuleInfo.toObject(message.collectorIlb, options); + if (options.oneofs) + object._collectorIlb = "collectorIlb"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this PacketMirroring to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroring + * @instance + * @returns {Object.} JSON object + */ + PacketMirroring.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Enable enum. + * @name google.cloud.compute.v1.PacketMirroring.Enable + * @enum {number} + * @property {number} UNDEFINED_ENABLE=0 UNDEFINED_ENABLE value + * @property {number} FALSE=66658563 FALSE value + * @property {number} TRUE=2583950 TRUE value + */ + PacketMirroring.Enable = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ENABLE"] = 0; + values[valuesById[66658563] = "FALSE"] = 66658563; + values[valuesById[2583950] = "TRUE"] = 2583950; + return values; + })(); + + return PacketMirroring; + })(); + + v1.PacketMirroringsScopedList = (function() { + + /** + * Properties of a PacketMirroringsScopedList. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringsScopedList + * @property {Array.|null} [packetMirrorings] PacketMirroringsScopedList packetMirrorings + * @property {google.cloud.compute.v1.IWarning|null} [warning] PacketMirroringsScopedList warning + */ + + /** + * Constructs a new PacketMirroringsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringsScopedList. + * @implements IPacketMirroringsScopedList + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringsScopedList=} [properties] Properties to set + */ + function PacketMirroringsScopedList(properties) { + this.packetMirrorings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringsScopedList packetMirrorings. + * @member {Array.} packetMirrorings + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @instance + */ + PacketMirroringsScopedList.prototype.packetMirrorings = $util.emptyArray; + + /** + * PacketMirroringsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @instance + */ + PacketMirroringsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @instance + */ + Object.defineProperty(PacketMirroringsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringsScopedList} PacketMirroringsScopedList instance + */ + PacketMirroringsScopedList.create = function create(properties) { + return new PacketMirroringsScopedList(properties); + }; + + /** + * Encodes the specified PacketMirroringsScopedList message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringsScopedList} message PacketMirroringsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.packetMirrorings != null && message.packetMirrorings.length) + for (var i = 0; i < message.packetMirrorings.length; ++i) + $root.google.cloud.compute.v1.PacketMirroring.encode(message.packetMirrorings[i], writer.uint32(/* id 154615079, wireType 2 =*/1236920634).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PacketMirroringsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringsScopedList} message PacketMirroringsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringsScopedList} PacketMirroringsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 154615079: + if (!(message.packetMirrorings && message.packetMirrorings.length)) + message.packetMirrorings = []; + message.packetMirrorings.push($root.google.cloud.compute.v1.PacketMirroring.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringsScopedList} PacketMirroringsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.packetMirrorings != null && message.hasOwnProperty("packetMirrorings")) { + if (!Array.isArray(message.packetMirrorings)) + return "packetMirrorings: array expected"; + for (var i = 0; i < message.packetMirrorings.length; ++i) { + var error = $root.google.cloud.compute.v1.PacketMirroring.verify(message.packetMirrorings[i]); + if (error) + return "packetMirrorings." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a PacketMirroringsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringsScopedList} PacketMirroringsScopedList + */ + PacketMirroringsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringsScopedList(); + if (object.packetMirrorings) { + if (!Array.isArray(object.packetMirrorings)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringsScopedList.packetMirrorings: array expected"); + message.packetMirrorings = []; + for (var i = 0; i < object.packetMirrorings.length; ++i) { + if (typeof object.packetMirrorings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringsScopedList.packetMirrorings: object expected"); + message.packetMirrorings[i] = $root.google.cloud.compute.v1.PacketMirroring.fromObject(object.packetMirrorings[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a PacketMirroringsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @static + * @param {google.cloud.compute.v1.PacketMirroringsScopedList} message PacketMirroringsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.packetMirrorings = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.packetMirrorings && message.packetMirrorings.length) { + object.packetMirrorings = []; + for (var j = 0; j < message.packetMirrorings.length; ++j) + object.packetMirrorings[j] = $root.google.cloud.compute.v1.PacketMirroring.toObject(message.packetMirrorings[j], options); + } + return object; + }; + + /** + * Converts this PacketMirroringsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringsScopedList + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringsScopedList; + })(); + + v1.PacketMirroringAggregatedList = (function() { + + /** + * Properties of a PacketMirroringAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringAggregatedList + * @property {string|null} [id] PacketMirroringAggregatedList id + * @property {Object.|null} [items] PacketMirroringAggregatedList items + * @property {string|null} [kind] PacketMirroringAggregatedList kind + * @property {string|null} [nextPageToken] PacketMirroringAggregatedList nextPageToken + * @property {string|null} [selfLink] PacketMirroringAggregatedList selfLink + * @property {Array.|null} [unreachables] PacketMirroringAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] PacketMirroringAggregatedList warning + */ + + /** + * Constructs a new PacketMirroringAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringAggregatedList. + * @implements IPacketMirroringAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringAggregatedList=} [properties] Properties to set + */ + function PacketMirroringAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + PacketMirroringAggregatedList.prototype.id = null; + + /** + * PacketMirroringAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + PacketMirroringAggregatedList.prototype.items = $util.emptyObject; + + /** + * PacketMirroringAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + PacketMirroringAggregatedList.prototype.kind = null; + + /** + * PacketMirroringAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + PacketMirroringAggregatedList.prototype.nextPageToken = null; + + /** + * PacketMirroringAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + PacketMirroringAggregatedList.prototype.selfLink = null; + + /** + * PacketMirroringAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + PacketMirroringAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * PacketMirroringAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + PacketMirroringAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + Object.defineProperty(PacketMirroringAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + Object.defineProperty(PacketMirroringAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + Object.defineProperty(PacketMirroringAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + Object.defineProperty(PacketMirroringAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + */ + Object.defineProperty(PacketMirroringAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringAggregatedList} PacketMirroringAggregatedList instance + */ + PacketMirroringAggregatedList.create = function create(properties) { + return new PacketMirroringAggregatedList(properties); + }; + + /** + * Encodes the specified PacketMirroringAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringAggregatedList} message PacketMirroringAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.PacketMirroringsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified PacketMirroringAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringAggregatedList} message PacketMirroringAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringAggregatedList} PacketMirroringAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.PacketMirroringsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringAggregatedList} PacketMirroringAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.PacketMirroringsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a PacketMirroringAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringAggregatedList} PacketMirroringAggregatedList + */ + PacketMirroringAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.PacketMirroringsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a PacketMirroringAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @static + * @param {google.cloud.compute.v1.PacketMirroringAggregatedList} message PacketMirroringAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.PacketMirroringsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this PacketMirroringAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringAggregatedList + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringAggregatedList; + })(); + + v1.PacketMirroringList = (function() { + + /** + * Properties of a PacketMirroringList. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringList + * @property {string|null} [id] PacketMirroringList id + * @property {Array.|null} [items] PacketMirroringList items + * @property {string|null} [kind] PacketMirroringList kind + * @property {string|null} [nextPageToken] PacketMirroringList nextPageToken + * @property {string|null} [selfLink] PacketMirroringList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] PacketMirroringList warning + */ + + /** + * Constructs a new PacketMirroringList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringList. + * @implements IPacketMirroringList + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringList=} [properties] Properties to set + */ + function PacketMirroringList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + PacketMirroringList.prototype.id = null; + + /** + * PacketMirroringList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + PacketMirroringList.prototype.items = $util.emptyArray; + + /** + * PacketMirroringList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + PacketMirroringList.prototype.kind = null; + + /** + * PacketMirroringList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + PacketMirroringList.prototype.nextPageToken = null; + + /** + * PacketMirroringList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + PacketMirroringList.prototype.selfLink = null; + + /** + * PacketMirroringList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + PacketMirroringList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + Object.defineProperty(PacketMirroringList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + Object.defineProperty(PacketMirroringList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + Object.defineProperty(PacketMirroringList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + Object.defineProperty(PacketMirroringList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + */ + Object.defineProperty(PacketMirroringList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringList} PacketMirroringList instance + */ + PacketMirroringList.create = function create(properties) { + return new PacketMirroringList(properties); + }; + + /** + * Encodes the specified PacketMirroringList message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringList} message PacketMirroringList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.PacketMirroring.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified PacketMirroringList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {google.cloud.compute.v1.IPacketMirroringList} message PacketMirroringList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringList} PacketMirroringList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.PacketMirroring.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringList} PacketMirroringList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringList message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.PacketMirroring.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a PacketMirroringList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringList} PacketMirroringList + */ + PacketMirroringList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringList) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.PacketMirroringList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.PacketMirroring.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.PacketMirroringList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a PacketMirroringList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringList + * @static + * @param {google.cloud.compute.v1.PacketMirroringList} message PacketMirroringList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.PacketMirroring.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this PacketMirroringList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringList + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringList; + })(); + + v1.PacketMirroringMirroredResourceInfoInstanceInfo = (function() { + + /** + * Properties of a PacketMirroringMirroredResourceInfoInstanceInfo. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringMirroredResourceInfoInstanceInfo + * @property {string|null} [canonicalUrl] PacketMirroringMirroredResourceInfoInstanceInfo canonicalUrl + * @property {string|null} [url] PacketMirroringMirroredResourceInfoInstanceInfo url + */ + + /** + * Constructs a new PacketMirroringMirroredResourceInfoInstanceInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringMirroredResourceInfoInstanceInfo. + * @implements IPacketMirroringMirroredResourceInfoInstanceInfo + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo=} [properties] Properties to set + */ + function PacketMirroringMirroredResourceInfoInstanceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringMirroredResourceInfoInstanceInfo canonicalUrl. + * @member {string|null|undefined} canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @instance + */ + PacketMirroringMirroredResourceInfoInstanceInfo.prototype.canonicalUrl = null; + + /** + * PacketMirroringMirroredResourceInfoInstanceInfo url. + * @member {string|null|undefined} url + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @instance + */ + PacketMirroringMirroredResourceInfoInstanceInfo.prototype.url = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringMirroredResourceInfoInstanceInfo _canonicalUrl. + * @member {"canonicalUrl"|undefined} _canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @instance + */ + Object.defineProperty(PacketMirroringMirroredResourceInfoInstanceInfo.prototype, "_canonicalUrl", { + get: $util.oneOfGetter($oneOfFields = ["canonicalUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringMirroredResourceInfoInstanceInfo _url. + * @member {"url"|undefined} _url + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @instance + */ + Object.defineProperty(PacketMirroringMirroredResourceInfoInstanceInfo.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringMirroredResourceInfoInstanceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo} PacketMirroringMirroredResourceInfoInstanceInfo instance + */ + PacketMirroringMirroredResourceInfoInstanceInfo.create = function create(properties) { + return new PacketMirroringMirroredResourceInfoInstanceInfo(properties); + }; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoInstanceInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo} message PacketMirroringMirroredResourceInfoInstanceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringMirroredResourceInfoInstanceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 116079, wireType 2 =*/928634).string(message.url); + if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) + writer.uint32(/* id 512294820, wireType 2 =*/4098358562).string(message.canonicalUrl); + return writer; + }; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoInstanceInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoInstanceInfo} message PacketMirroringMirroredResourceInfoInstanceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringMirroredResourceInfoInstanceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringMirroredResourceInfoInstanceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo} PacketMirroringMirroredResourceInfoInstanceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringMirroredResourceInfoInstanceInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 512294820: + message.canonicalUrl = reader.string(); + break; + case 116079: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringMirroredResourceInfoInstanceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo} PacketMirroringMirroredResourceInfoInstanceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringMirroredResourceInfoInstanceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringMirroredResourceInfoInstanceInfo message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringMirroredResourceInfoInstanceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + properties._canonicalUrl = 1; + if (!$util.isString(message.canonicalUrl)) + return "canonicalUrl: string expected"; + } + if (message.url != null && message.hasOwnProperty("url")) { + properties._url = 1; + if (!$util.isString(message.url)) + return "url: string expected"; + } + return null; + }; + + /** + * Creates a PacketMirroringMirroredResourceInfoInstanceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo} PacketMirroringMirroredResourceInfoInstanceInfo + */ + PacketMirroringMirroredResourceInfoInstanceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo(); + if (object.canonicalUrl != null) + message.canonicalUrl = String(object.canonicalUrl); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a PacketMirroringMirroredResourceInfoInstanceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @static + * @param {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo} message PacketMirroringMirroredResourceInfoInstanceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringMirroredResourceInfoInstanceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.url != null && message.hasOwnProperty("url")) { + object.url = message.url; + if (options.oneofs) + object._url = "url"; + } + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + object.canonicalUrl = message.canonicalUrl; + if (options.oneofs) + object._canonicalUrl = "canonicalUrl"; + } + return object; + }; + + /** + * Converts this PacketMirroringMirroredResourceInfoInstanceInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoInstanceInfo + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringMirroredResourceInfoInstanceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringMirroredResourceInfoInstanceInfo; + })(); + + v1.PacketMirroringMirroredResourceInfoSubnetInfo = (function() { + + /** + * Properties of a PacketMirroringMirroredResourceInfoSubnetInfo. + * @memberof google.cloud.compute.v1 + * @interface IPacketMirroringMirroredResourceInfoSubnetInfo + * @property {string|null} [canonicalUrl] PacketMirroringMirroredResourceInfoSubnetInfo canonicalUrl + * @property {string|null} [url] PacketMirroringMirroredResourceInfoSubnetInfo url + */ + + /** + * Constructs a new PacketMirroringMirroredResourceInfoSubnetInfo. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirroringMirroredResourceInfoSubnetInfo. + * @implements IPacketMirroringMirroredResourceInfoSubnetInfo + * @constructor + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo=} [properties] Properties to set + */ + function PacketMirroringMirroredResourceInfoSubnetInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PacketMirroringMirroredResourceInfoSubnetInfo canonicalUrl. + * @member {string|null|undefined} canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @instance + */ + PacketMirroringMirroredResourceInfoSubnetInfo.prototype.canonicalUrl = null; + + /** + * PacketMirroringMirroredResourceInfoSubnetInfo url. + * @member {string|null|undefined} url + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @instance + */ + PacketMirroringMirroredResourceInfoSubnetInfo.prototype.url = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PacketMirroringMirroredResourceInfoSubnetInfo _canonicalUrl. + * @member {"canonicalUrl"|undefined} _canonicalUrl + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @instance + */ + Object.defineProperty(PacketMirroringMirroredResourceInfoSubnetInfo.prototype, "_canonicalUrl", { + get: $util.oneOfGetter($oneOfFields = ["canonicalUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PacketMirroringMirroredResourceInfoSubnetInfo _url. + * @member {"url"|undefined} _url + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @instance + */ + Object.defineProperty(PacketMirroringMirroredResourceInfoSubnetInfo.prototype, "_url", { + get: $util.oneOfGetter($oneOfFields = ["url"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PacketMirroringMirroredResourceInfoSubnetInfo instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo} PacketMirroringMirroredResourceInfoSubnetInfo instance + */ + PacketMirroringMirroredResourceInfoSubnetInfo.create = function create(properties) { + return new PacketMirroringMirroredResourceInfoSubnetInfo(properties); + }; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoSubnetInfo message. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo} message PacketMirroringMirroredResourceInfoSubnetInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringMirroredResourceInfoSubnetInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 116079, wireType 2 =*/928634).string(message.url); + if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) + writer.uint32(/* id 512294820, wireType 2 =*/4098358562).string(message.canonicalUrl); + return writer; + }; + + /** + * Encodes the specified PacketMirroringMirroredResourceInfoSubnetInfo message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {google.cloud.compute.v1.IPacketMirroringMirroredResourceInfoSubnetInfo} message PacketMirroringMirroredResourceInfoSubnetInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PacketMirroringMirroredResourceInfoSubnetInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PacketMirroringMirroredResourceInfoSubnetInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo} PacketMirroringMirroredResourceInfoSubnetInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringMirroredResourceInfoSubnetInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 512294820: + message.canonicalUrl = reader.string(); + break; + case 116079: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PacketMirroringMirroredResourceInfoSubnetInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo} PacketMirroringMirroredResourceInfoSubnetInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PacketMirroringMirroredResourceInfoSubnetInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PacketMirroringMirroredResourceInfoSubnetInfo message. + * @function verify + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PacketMirroringMirroredResourceInfoSubnetInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + properties._canonicalUrl = 1; + if (!$util.isString(message.canonicalUrl)) + return "canonicalUrl: string expected"; + } + if (message.url != null && message.hasOwnProperty("url")) { + properties._url = 1; + if (!$util.isString(message.url)) + return "url: string expected"; + } + return null; + }; + + /** + * Creates a PacketMirroringMirroredResourceInfoSubnetInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo} PacketMirroringMirroredResourceInfoSubnetInfo + */ + PacketMirroringMirroredResourceInfoSubnetInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo) + return object; + var message = new $root.google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo(); + if (object.canonicalUrl != null) + message.canonicalUrl = String(object.canonicalUrl); + if (object.url != null) + message.url = String(object.url); + return message; + }; + + /** + * Creates a plain object from a PacketMirroringMirroredResourceInfoSubnetInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @static + * @param {google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo} message PacketMirroringMirroredResourceInfoSubnetInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PacketMirroringMirroredResourceInfoSubnetInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.url != null && message.hasOwnProperty("url")) { + object.url = message.url; + if (options.oneofs) + object._url = "url"; + } + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) { + object.canonicalUrl = message.canonicalUrl; + if (options.oneofs) + object._canonicalUrl = "canonicalUrl"; + } + return object; + }; + + /** + * Converts this PacketMirroringMirroredResourceInfoSubnetInfo to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PacketMirroringMirroredResourceInfoSubnetInfo + * @instance + * @returns {Object.} JSON object + */ + PacketMirroringMirroredResourceInfoSubnetInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PacketMirroringMirroredResourceInfoSubnetInfo; + })(); + + v1.PathRule = (function() { + + /** + * Properties of a PathRule. + * @memberof google.cloud.compute.v1 + * @interface IPathRule + * @property {Array.|null} [paths] PathRule paths + * @property {google.cloud.compute.v1.IHttpRouteAction|null} [routeAction] PathRule routeAction + * @property {string|null} [service] PathRule service + * @property {google.cloud.compute.v1.IHttpRedirectAction|null} [urlRedirect] PathRule urlRedirect + */ + + /** + * Constructs a new PathRule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PathRule. + * @implements IPathRule + * @constructor + * @param {google.cloud.compute.v1.IPathRule=} [properties] Properties to set + */ + function PathRule(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]]; + } + + /** + * PathRule paths. + * @member {Array.} paths + * @memberof google.cloud.compute.v1.PathRule + * @instance + */ + PathRule.prototype.paths = $util.emptyArray; + + /** + * PathRule routeAction. + * @member {google.cloud.compute.v1.IHttpRouteAction|null|undefined} routeAction + * @memberof google.cloud.compute.v1.PathRule + * @instance + */ + PathRule.prototype.routeAction = null; + + /** + * PathRule service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.PathRule + * @instance + */ + PathRule.prototype.service = null; + + /** + * PathRule urlRedirect. + * @member {google.cloud.compute.v1.IHttpRedirectAction|null|undefined} urlRedirect + * @memberof google.cloud.compute.v1.PathRule + * @instance + */ + PathRule.prototype.urlRedirect = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PathRule _routeAction. + * @member {"routeAction"|undefined} _routeAction + * @memberof google.cloud.compute.v1.PathRule + * @instance + */ + Object.defineProperty(PathRule.prototype, "_routeAction", { + get: $util.oneOfGetter($oneOfFields = ["routeAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PathRule _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.PathRule + * @instance + */ + Object.defineProperty(PathRule.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PathRule _urlRedirect. + * @member {"urlRedirect"|undefined} _urlRedirect + * @memberof google.cloud.compute.v1.PathRule + * @instance + */ + Object.defineProperty(PathRule.prototype, "_urlRedirect", { + get: $util.oneOfGetter($oneOfFields = ["urlRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PathRule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {google.cloud.compute.v1.IPathRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PathRule} PathRule instance + */ + PathRule.create = function create(properties) { + return new PathRule(properties); + }; + + /** + * Encodes the specified PathRule message. Does not implicitly {@link google.cloud.compute.v1.PathRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {google.cloud.compute.v1.IPathRule} message PathRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathRule.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 106438894, wireType 2 =*/851511154).string(message.paths[i]); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + if (message.urlRedirect != null && Object.hasOwnProperty.call(message, "urlRedirect")) + $root.google.cloud.compute.v1.HttpRedirectAction.encode(message.urlRedirect, writer.uint32(/* id 405147820, wireType 2 =*/3241182562).fork()).ldelim(); + if (message.routeAction != null && Object.hasOwnProperty.call(message, "routeAction")) + $root.google.cloud.compute.v1.HttpRouteAction.encode(message.routeAction, writer.uint32(/* id 424563948, wireType 2 =*/3396511586).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PathRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PathRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {google.cloud.compute.v1.IPathRule} message PathRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PathRule} PathRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PathRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 106438894: + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + case 424563948: + message.routeAction = $root.google.cloud.compute.v1.HttpRouteAction.decode(reader, reader.uint32()); + break; + case 373540533: + message.service = reader.string(); + break; + case 405147820: + message.urlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PathRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PathRule} PathRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PathRule message. + * @function verify + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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"; + } + if (message.routeAction != null && message.hasOwnProperty("routeAction")) { + properties._routeAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpRouteAction.verify(message.routeAction); + if (error) + return "routeAction." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + if (message.urlRedirect != null && message.hasOwnProperty("urlRedirect")) { + properties._urlRedirect = 1; + { + var error = $root.google.cloud.compute.v1.HttpRedirectAction.verify(message.urlRedirect); + if (error) + return "urlRedirect." + error; + } + } + return null; + }; + + /** + * Creates a PathRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PathRule} PathRule + */ + PathRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PathRule) + return object; + var message = new $root.google.cloud.compute.v1.PathRule(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.cloud.compute.v1.PathRule.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + if (object.routeAction != null) { + if (typeof object.routeAction !== "object") + throw TypeError(".google.cloud.compute.v1.PathRule.routeAction: object expected"); + message.routeAction = $root.google.cloud.compute.v1.HttpRouteAction.fromObject(object.routeAction); + } + if (object.service != null) + message.service = String(object.service); + if (object.urlRedirect != null) { + if (typeof object.urlRedirect !== "object") + throw TypeError(".google.cloud.compute.v1.PathRule.urlRedirect: object expected"); + message.urlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.fromObject(object.urlRedirect); + } + return message; + }; + + /** + * Creates a plain object from a PathRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PathRule + * @static + * @param {google.cloud.compute.v1.PathRule} message PathRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + if (message.urlRedirect != null && message.hasOwnProperty("urlRedirect")) { + object.urlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.toObject(message.urlRedirect, options); + if (options.oneofs) + object._urlRedirect = "urlRedirect"; + } + if (message.routeAction != null && message.hasOwnProperty("routeAction")) { + object.routeAction = $root.google.cloud.compute.v1.HttpRouteAction.toObject(message.routeAction, options); + if (options.oneofs) + object._routeAction = "routeAction"; + } + return object; + }; + + /** + * Converts this PathRule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PathRule + * @instance + * @returns {Object.} JSON object + */ + PathRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PathRule; + })(); + + v1.PathMatcher = (function() { + + /** + * Properties of a PathMatcher. + * @memberof google.cloud.compute.v1 + * @interface IPathMatcher + * @property {google.cloud.compute.v1.IHttpRouteAction|null} [defaultRouteAction] PathMatcher defaultRouteAction + * @property {string|null} [defaultService] PathMatcher defaultService + * @property {google.cloud.compute.v1.IHttpRedirectAction|null} [defaultUrlRedirect] PathMatcher defaultUrlRedirect + * @property {string|null} [description] PathMatcher description + * @property {google.cloud.compute.v1.IHttpHeaderAction|null} [headerAction] PathMatcher headerAction + * @property {string|null} [name] PathMatcher name + * @property {Array.|null} [pathRules] PathMatcher pathRules + * @property {Array.|null} [routeRules] PathMatcher routeRules + */ + + /** + * Constructs a new PathMatcher. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PathMatcher. + * @implements IPathMatcher + * @constructor + * @param {google.cloud.compute.v1.IPathMatcher=} [properties] Properties to set + */ + function PathMatcher(properties) { + this.pathRules = []; + this.routeRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PathMatcher defaultRouteAction. + * @member {google.cloud.compute.v1.IHttpRouteAction|null|undefined} defaultRouteAction + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.defaultRouteAction = null; + + /** + * PathMatcher defaultService. + * @member {string|null|undefined} defaultService + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.defaultService = null; + + /** + * PathMatcher defaultUrlRedirect. + * @member {google.cloud.compute.v1.IHttpRedirectAction|null|undefined} defaultUrlRedirect + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.defaultUrlRedirect = null; + + /** + * PathMatcher description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.description = null; + + /** + * PathMatcher headerAction. + * @member {google.cloud.compute.v1.IHttpHeaderAction|null|undefined} headerAction + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.headerAction = null; + + /** + * PathMatcher name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.name = null; + + /** + * PathMatcher pathRules. + * @member {Array.} pathRules + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.pathRules = $util.emptyArray; + + /** + * PathMatcher routeRules. + * @member {Array.} routeRules + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + PathMatcher.prototype.routeRules = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PathMatcher _defaultRouteAction. + * @member {"defaultRouteAction"|undefined} _defaultRouteAction + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + Object.defineProperty(PathMatcher.prototype, "_defaultRouteAction", { + get: $util.oneOfGetter($oneOfFields = ["defaultRouteAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PathMatcher _defaultService. + * @member {"defaultService"|undefined} _defaultService + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + Object.defineProperty(PathMatcher.prototype, "_defaultService", { + get: $util.oneOfGetter($oneOfFields = ["defaultService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PathMatcher _defaultUrlRedirect. + * @member {"defaultUrlRedirect"|undefined} _defaultUrlRedirect + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + Object.defineProperty(PathMatcher.prototype, "_defaultUrlRedirect", { + get: $util.oneOfGetter($oneOfFields = ["defaultUrlRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PathMatcher _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + Object.defineProperty(PathMatcher.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PathMatcher _headerAction. + * @member {"headerAction"|undefined} _headerAction + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + Object.defineProperty(PathMatcher.prototype, "_headerAction", { + get: $util.oneOfGetter($oneOfFields = ["headerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PathMatcher _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + */ + Object.defineProperty(PathMatcher.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PathMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {google.cloud.compute.v1.IPathMatcher=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PathMatcher} PathMatcher instance + */ + PathMatcher.create = function create(properties) { + return new PathMatcher(properties); + }; + + /** + * Encodes the specified PathMatcher message. Does not implicitly {@link google.cloud.compute.v1.PathMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {google.cloud.compute.v1.IPathMatcher} message PathMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.pathRules != null && message.pathRules.length) + for (var i = 0; i < message.pathRules.length; ++i) + $root.google.cloud.compute.v1.PathRule.encode(message.pathRules[i], writer.uint32(/* id 104439901, wireType 2 =*/835519210).fork()).ldelim(); + if (message.headerAction != null && Object.hasOwnProperty.call(message, "headerAction")) + $root.google.cloud.compute.v1.HttpHeaderAction.encode(message.headerAction, writer.uint32(/* id 328077352, wireType 2 =*/2624618818).fork()).ldelim(); + if (message.defaultUrlRedirect != null && Object.hasOwnProperty.call(message, "defaultUrlRedirect")) + $root.google.cloud.compute.v1.HttpRedirectAction.encode(message.defaultUrlRedirect, writer.uint32(/* id 359503338, wireType 2 =*/2876026706).fork()).ldelim(); + if (message.defaultService != null && Object.hasOwnProperty.call(message, "defaultService")) + writer.uint32(/* id 370242231, wireType 2 =*/2961937850).string(message.defaultService); + if (message.routeRules != null && message.routeRules.length) + for (var i = 0; i < message.routeRules.length; ++i) + $root.google.cloud.compute.v1.HttpRouteRule.encode(message.routeRules[i], writer.uint32(/* id 376292225, wireType 2 =*/3010337802).fork()).ldelim(); + if (message.defaultRouteAction != null && Object.hasOwnProperty.call(message, "defaultRouteAction")) + $root.google.cloud.compute.v1.HttpRouteAction.encode(message.defaultRouteAction, writer.uint32(/* id 378919466, wireType 2 =*/3031355730).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + return writer; + }; + + /** + * Encodes the specified PathMatcher message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PathMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {google.cloud.compute.v1.IPathMatcher} message PathMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PathMatcher} PathMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PathMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 378919466: + message.defaultRouteAction = $root.google.cloud.compute.v1.HttpRouteAction.decode(reader, reader.uint32()); + break; + case 370242231: + message.defaultService = reader.string(); + break; + case 359503338: + message.defaultUrlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 328077352: + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 104439901: + if (!(message.pathRules && message.pathRules.length)) + message.pathRules = []; + message.pathRules.push($root.google.cloud.compute.v1.PathRule.decode(reader, reader.uint32())); + break; + case 376292225: + if (!(message.routeRules && message.routeRules.length)) + message.routeRules = []; + message.routeRules.push($root.google.cloud.compute.v1.HttpRouteRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PathMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PathMatcher} PathMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PathMatcher message. + * @function verify + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.defaultRouteAction != null && message.hasOwnProperty("defaultRouteAction")) { + properties._defaultRouteAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpRouteAction.verify(message.defaultRouteAction); + if (error) + return "defaultRouteAction." + error; + } + } + if (message.defaultService != null && message.hasOwnProperty("defaultService")) { + properties._defaultService = 1; + if (!$util.isString(message.defaultService)) + return "defaultService: string expected"; + } + if (message.defaultUrlRedirect != null && message.hasOwnProperty("defaultUrlRedirect")) { + properties._defaultUrlRedirect = 1; + { + var error = $root.google.cloud.compute.v1.HttpRedirectAction.verify(message.defaultUrlRedirect); + if (error) + return "defaultUrlRedirect." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + properties._headerAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpHeaderAction.verify(message.headerAction); + if (error) + return "headerAction." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.pathRules != null && message.hasOwnProperty("pathRules")) { + if (!Array.isArray(message.pathRules)) + return "pathRules: array expected"; + for (var i = 0; i < message.pathRules.length; ++i) { + var error = $root.google.cloud.compute.v1.PathRule.verify(message.pathRules[i]); + if (error) + return "pathRules." + error; + } + } + if (message.routeRules != null && message.hasOwnProperty("routeRules")) { + if (!Array.isArray(message.routeRules)) + return "routeRules: array expected"; + for (var i = 0; i < message.routeRules.length; ++i) { + var error = $root.google.cloud.compute.v1.HttpRouteRule.verify(message.routeRules[i]); + if (error) + return "routeRules." + error; + } + } + return null; + }; + + /** + * Creates a PathMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PathMatcher} PathMatcher + */ + PathMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PathMatcher) + return object; + var message = new $root.google.cloud.compute.v1.PathMatcher(); + if (object.defaultRouteAction != null) { + if (typeof object.defaultRouteAction !== "object") + throw TypeError(".google.cloud.compute.v1.PathMatcher.defaultRouteAction: object expected"); + message.defaultRouteAction = $root.google.cloud.compute.v1.HttpRouteAction.fromObject(object.defaultRouteAction); + } + if (object.defaultService != null) + message.defaultService = String(object.defaultService); + if (object.defaultUrlRedirect != null) { + if (typeof object.defaultUrlRedirect !== "object") + throw TypeError(".google.cloud.compute.v1.PathMatcher.defaultUrlRedirect: object expected"); + message.defaultUrlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.fromObject(object.defaultUrlRedirect); + } + if (object.description != null) + message.description = String(object.description); + if (object.headerAction != null) { + if (typeof object.headerAction !== "object") + throw TypeError(".google.cloud.compute.v1.PathMatcher.headerAction: object expected"); + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.fromObject(object.headerAction); + } + if (object.name != null) + message.name = String(object.name); + if (object.pathRules) { + if (!Array.isArray(object.pathRules)) + throw TypeError(".google.cloud.compute.v1.PathMatcher.pathRules: array expected"); + message.pathRules = []; + for (var i = 0; i < object.pathRules.length; ++i) { + if (typeof object.pathRules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PathMatcher.pathRules: object expected"); + message.pathRules[i] = $root.google.cloud.compute.v1.PathRule.fromObject(object.pathRules[i]); + } + } + if (object.routeRules) { + if (!Array.isArray(object.routeRules)) + throw TypeError(".google.cloud.compute.v1.PathMatcher.routeRules: array expected"); + message.routeRules = []; + for (var i = 0; i < object.routeRules.length; ++i) { + if (typeof object.routeRules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PathMatcher.routeRules: object expected"); + message.routeRules[i] = $root.google.cloud.compute.v1.HttpRouteRule.fromObject(object.routeRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PathMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PathMatcher + * @static + * @param {google.cloud.compute.v1.PathMatcher} message PathMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pathRules = []; + object.routeRules = []; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.pathRules && message.pathRules.length) { + object.pathRules = []; + for (var j = 0; j < message.pathRules.length; ++j) + object.pathRules[j] = $root.google.cloud.compute.v1.PathRule.toObject(message.pathRules[j], options); + } + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + object.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.toObject(message.headerAction, options); + if (options.oneofs) + object._headerAction = "headerAction"; + } + if (message.defaultUrlRedirect != null && message.hasOwnProperty("defaultUrlRedirect")) { + object.defaultUrlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.toObject(message.defaultUrlRedirect, options); + if (options.oneofs) + object._defaultUrlRedirect = "defaultUrlRedirect"; + } + if (message.defaultService != null && message.hasOwnProperty("defaultService")) { + object.defaultService = message.defaultService; + if (options.oneofs) + object._defaultService = "defaultService"; + } + if (message.routeRules && message.routeRules.length) { + object.routeRules = []; + for (var j = 0; j < message.routeRules.length; ++j) + object.routeRules[j] = $root.google.cloud.compute.v1.HttpRouteRule.toObject(message.routeRules[j], options); + } + if (message.defaultRouteAction != null && message.hasOwnProperty("defaultRouteAction")) { + object.defaultRouteAction = $root.google.cloud.compute.v1.HttpRouteAction.toObject(message.defaultRouteAction, options); + if (options.oneofs) + object._defaultRouteAction = "defaultRouteAction"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + return object; + }; + + /** + * Converts this PathMatcher to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PathMatcher + * @instance + * @returns {Object.} JSON object + */ + PathMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PathMatcher; + })(); + + v1.Rule = (function() { + + /** + * Properties of a Rule. + * @memberof google.cloud.compute.v1 + * @interface IRule + * @property {google.cloud.compute.v1.Rule.Action|null} [action] Rule action + * @property {Array.|null} [conditions] Rule conditions + * @property {string|null} [description] Rule description + * @property {Array.|null} [ins] Rule ins + * @property {Array.|null} [logConfigs] Rule logConfigs + * @property {Array.|null} [notIns] Rule notIns + * @property {Array.|null} [permissions] Rule permissions + */ + + /** + * Constructs a new Rule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Rule. + * @implements IRule + * @constructor + * @param {google.cloud.compute.v1.IRule=} [properties] Properties to set + */ + function Rule(properties) { + this.conditions = []; + this.ins = []; + this.logConfigs = []; + this.notIns = []; + 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]]; + } + + /** + * Rule action. + * @member {google.cloud.compute.v1.Rule.Action|null|undefined} action + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Rule.prototype.action = null; + + /** + * Rule conditions. + * @member {Array.} conditions + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Rule.prototype.conditions = $util.emptyArray; + + /** + * Rule description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Rule.prototype.description = null; + + /** + * Rule ins. + * @member {Array.} ins + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Rule.prototype.ins = $util.emptyArray; + + /** + * Rule logConfigs. + * @member {Array.} logConfigs + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Rule.prototype.logConfigs = $util.emptyArray; + + /** + * Rule notIns. + * @member {Array.} notIns + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Rule.prototype.notIns = $util.emptyArray; + + /** + * Rule permissions. + * @member {Array.} permissions + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Rule.prototype.permissions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Rule _action. + * @member {"action"|undefined} _action + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Object.defineProperty(Rule.prototype, "_action", { + get: $util.oneOfGetter($oneOfFields = ["action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Rule _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Rule + * @instance + */ + Object.defineProperty(Rule.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Rule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {google.cloud.compute.v1.IRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Rule} Rule instance + */ + Rule.create = function create(properties) { + return new Rule(properties); + }; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.compute.v1.Rule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {google.cloud.compute.v1.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ins != null && message.ins.length) + for (var i = 0; i < message.ins.length; ++i) + writer.uint32(/* id 104430, wireType 2 =*/835442).string(message.ins[i]); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 59962500, wireType 2 =*/479700002).string(message.permissions[i]); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.cloud.compute.v1.Condition.encode(message.conditions[i], writer.uint32(/* id 142882488, wireType 2 =*/1143059906).fork()).ldelim(); + if (message.logConfigs != null && message.logConfigs.length) + for (var i = 0; i < message.logConfigs.length; ++i) + $root.google.cloud.compute.v1.LogConfig.encode(message.logConfigs[i], writer.uint32(/* id 152873846, wireType 2 =*/1222990770).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 187661878, wireType 0 =*/1501295024).int32(message.action); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.notIns != null && message.notIns.length) + for (var i = 0; i < message.notIns.length; ++i) + writer.uint32(/* id 518443138, wireType 2 =*/4147545106).string(message.notIns[i]); + return writer; + }; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Rule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {google.cloud.compute.v1.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Rule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 187661878: + message.action = reader.int32(); + break; + case 142882488: + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.cloud.compute.v1.Condition.decode(reader, reader.uint32())); + break; + case 422937596: + message.description = reader.string(); + break; + case 104430: + if (!(message.ins && message.ins.length)) + message.ins = []; + message.ins.push(reader.string()); + break; + case 152873846: + if (!(message.logConfigs && message.logConfigs.length)) + message.logConfigs = []; + message.logConfigs.push($root.google.cloud.compute.v1.LogConfig.decode(reader, reader.uint32())); + break; + case 518443138: + if (!(message.notIns && message.notIns.length)) + message.notIns = []; + message.notIns.push(reader.string()); + break; + case 59962500: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rule message. + * @function verify + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) { + properties._action = 1; + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 62368553: + case 76034177: + case 2094604: + case 351433982: + case 75556: + case 260643444: + break; + } + } + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.cloud.compute.v1.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.ins != null && message.hasOwnProperty("ins")) { + if (!Array.isArray(message.ins)) + return "ins: array expected"; + for (var i = 0; i < message.ins.length; ++i) + if (!$util.isString(message.ins[i])) + return "ins: string[] expected"; + } + if (message.logConfigs != null && message.hasOwnProperty("logConfigs")) { + if (!Array.isArray(message.logConfigs)) + return "logConfigs: array expected"; + for (var i = 0; i < message.logConfigs.length; ++i) { + var error = $root.google.cloud.compute.v1.LogConfig.verify(message.logConfigs[i]); + if (error) + return "logConfigs." + error; + } + } + if (message.notIns != null && message.hasOwnProperty("notIns")) { + if (!Array.isArray(message.notIns)) + return "notIns: array expected"; + for (var i = 0; i < message.notIns.length; ++i) + if (!$util.isString(message.notIns[i])) + return "notIns: 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 Rule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Rule} Rule + */ + Rule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Rule) + return object; + var message = new $root.google.cloud.compute.v1.Rule(); + switch (object.action) { + case "UNDEFINED_ACTION": + case 0: + message.action = 0; + break; + case "ALLOW": + case 62368553: + message.action = 62368553; + break; + case "ALLOW_WITH_LOG": + case 76034177: + message.action = 76034177; + break; + case "DENY": + case 2094604: + message.action = 2094604; + break; + case "DENY_WITH_LOG": + case 351433982: + message.action = 351433982; + break; + case "LOG": + case 75556: + message.action = 75556; + break; + case "NO_ACTION": + case 260643444: + message.action = 260643444; + break; + } + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.compute.v1.Rule.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Rule.conditions: object expected"); + message.conditions[i] = $root.google.cloud.compute.v1.Condition.fromObject(object.conditions[i]); + } + } + if (object.description != null) + message.description = String(object.description); + if (object.ins) { + if (!Array.isArray(object.ins)) + throw TypeError(".google.cloud.compute.v1.Rule.ins: array expected"); + message.ins = []; + for (var i = 0; i < object.ins.length; ++i) + message.ins[i] = String(object.ins[i]); + } + if (object.logConfigs) { + if (!Array.isArray(object.logConfigs)) + throw TypeError(".google.cloud.compute.v1.Rule.logConfigs: array expected"); + message.logConfigs = []; + for (var i = 0; i < object.logConfigs.length; ++i) { + if (typeof object.logConfigs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Rule.logConfigs: object expected"); + message.logConfigs[i] = $root.google.cloud.compute.v1.LogConfig.fromObject(object.logConfigs[i]); + } + } + if (object.notIns) { + if (!Array.isArray(object.notIns)) + throw TypeError(".google.cloud.compute.v1.Rule.notIns: array expected"); + message.notIns = []; + for (var i = 0; i < object.notIns.length; ++i) + message.notIns[i] = String(object.notIns[i]); + } + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.compute.v1.Rule.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 Rule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Rule + * @static + * @param {google.cloud.compute.v1.Rule} message Rule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ins = []; + object.permissions = []; + object.conditions = []; + object.logConfigs = []; + object.notIns = []; + } + if (message.ins && message.ins.length) { + object.ins = []; + for (var j = 0; j < message.ins.length; ++j) + object.ins[j] = message.ins[j]; + } + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = message.permissions[j]; + } + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.cloud.compute.v1.Condition.toObject(message.conditions[j], options); + } + if (message.logConfigs && message.logConfigs.length) { + object.logConfigs = []; + for (var j = 0; j < message.logConfigs.length; ++j) + object.logConfigs[j] = $root.google.cloud.compute.v1.LogConfig.toObject(message.logConfigs[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) { + object.action = options.enums === String ? $root.google.cloud.compute.v1.Rule.Action[message.action] : message.action; + if (options.oneofs) + object._action = "action"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.notIns && message.notIns.length) { + object.notIns = []; + for (var j = 0; j < message.notIns.length; ++j) + object.notIns[j] = message.notIns[j]; + } + return object; + }; + + /** + * Converts this Rule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Rule + * @instance + * @returns {Object.} JSON object + */ + Rule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.cloud.compute.v1.Rule.Action + * @enum {number} + * @property {number} UNDEFINED_ACTION=0 UNDEFINED_ACTION value + * @property {number} ALLOW=62368553 ALLOW value + * @property {number} ALLOW_WITH_LOG=76034177 ALLOW_WITH_LOG value + * @property {number} DENY=2094604 DENY value + * @property {number} DENY_WITH_LOG=351433982 DENY_WITH_LOG value + * @property {number} LOG=75556 LOG value + * @property {number} NO_ACTION=260643444 NO_ACTION value + */ + Rule.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ACTION"] = 0; + values[valuesById[62368553] = "ALLOW"] = 62368553; + values[valuesById[76034177] = "ALLOW_WITH_LOG"] = 76034177; + values[valuesById[2094604] = "DENY"] = 2094604; + values[valuesById[351433982] = "DENY_WITH_LOG"] = 351433982; + values[valuesById[75556] = "LOG"] = 75556; + values[valuesById[260643444] = "NO_ACTION"] = 260643444; + return values; + })(); + + return Rule; + })(); + + v1.WafExpressionSet = (function() { + + /** + * Properties of a WafExpressionSet. + * @memberof google.cloud.compute.v1 + * @interface IWafExpressionSet + * @property {Array.|null} [aliases] WafExpressionSet aliases + * @property {Array.|null} [expressions] WafExpressionSet expressions + * @property {string|null} [id] WafExpressionSet id + */ + + /** + * Constructs a new WafExpressionSet. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a WafExpressionSet. + * @implements IWafExpressionSet + * @constructor + * @param {google.cloud.compute.v1.IWafExpressionSet=} [properties] Properties to set + */ + function WafExpressionSet(properties) { + this.aliases = []; + this.expressions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WafExpressionSet aliases. + * @member {Array.} aliases + * @memberof google.cloud.compute.v1.WafExpressionSet + * @instance + */ + WafExpressionSet.prototype.aliases = $util.emptyArray; + + /** + * WafExpressionSet expressions. + * @member {Array.} expressions + * @memberof google.cloud.compute.v1.WafExpressionSet + * @instance + */ + WafExpressionSet.prototype.expressions = $util.emptyArray; + + /** + * WafExpressionSet id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.WafExpressionSet + * @instance + */ + WafExpressionSet.prototype.id = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WafExpressionSet _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.WafExpressionSet + * @instance + */ + Object.defineProperty(WafExpressionSet.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WafExpressionSet instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {google.cloud.compute.v1.IWafExpressionSet=} [properties] Properties to set + * @returns {google.cloud.compute.v1.WafExpressionSet} WafExpressionSet instance + */ + WafExpressionSet.create = function create(properties) { + return new WafExpressionSet(properties); + }; + + /** + * Encodes the specified WafExpressionSet message. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {google.cloud.compute.v1.IWafExpressionSet} message WafExpressionSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafExpressionSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.aliases != null && message.aliases.length) + for (var i = 0; i < message.aliases.length; ++i) + writer.uint32(/* id 159207166, wireType 2 =*/1273657330).string(message.aliases[i]); + if (message.expressions != null && message.expressions.length) + for (var i = 0; i < message.expressions.length; ++i) + $root.google.cloud.compute.v1.WafExpressionSetExpression.encode(message.expressions[i], writer.uint32(/* id 175554779, wireType 2 =*/1404438234).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WafExpressionSet message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {google.cloud.compute.v1.IWafExpressionSet} message WafExpressionSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafExpressionSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WafExpressionSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.WafExpressionSet} WafExpressionSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafExpressionSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.WafExpressionSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 159207166: + if (!(message.aliases && message.aliases.length)) + message.aliases = []; + message.aliases.push(reader.string()); + break; + case 175554779: + if (!(message.expressions && message.expressions.length)) + message.expressions = []; + message.expressions.push($root.google.cloud.compute.v1.WafExpressionSetExpression.decode(reader, reader.uint32())); + break; + case 3355: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WafExpressionSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.WafExpressionSet} WafExpressionSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafExpressionSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WafExpressionSet message. + * @function verify + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WafExpressionSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.aliases != null && message.hasOwnProperty("aliases")) { + if (!Array.isArray(message.aliases)) + return "aliases: array expected"; + for (var i = 0; i < message.aliases.length; ++i) + if (!$util.isString(message.aliases[i])) + return "aliases: string[] expected"; + } + if (message.expressions != null && message.hasOwnProperty("expressions")) { + if (!Array.isArray(message.expressions)) + return "expressions: array expected"; + for (var i = 0; i < message.expressions.length; ++i) { + var error = $root.google.cloud.compute.v1.WafExpressionSetExpression.verify(message.expressions[i]); + if (error) + return "expressions." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + return null; + }; + + /** + * Creates a WafExpressionSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.WafExpressionSet} WafExpressionSet + */ + WafExpressionSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.WafExpressionSet) + return object; + var message = new $root.google.cloud.compute.v1.WafExpressionSet(); + if (object.aliases) { + if (!Array.isArray(object.aliases)) + throw TypeError(".google.cloud.compute.v1.WafExpressionSet.aliases: array expected"); + message.aliases = []; + for (var i = 0; i < object.aliases.length; ++i) + message.aliases[i] = String(object.aliases[i]); + } + if (object.expressions) { + if (!Array.isArray(object.expressions)) + throw TypeError(".google.cloud.compute.v1.WafExpressionSet.expressions: array expected"); + message.expressions = []; + for (var i = 0; i < object.expressions.length; ++i) { + if (typeof object.expressions[i] !== "object") + throw TypeError(".google.cloud.compute.v1.WafExpressionSet.expressions: object expected"); + message.expressions[i] = $root.google.cloud.compute.v1.WafExpressionSetExpression.fromObject(object.expressions[i]); + } + } + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a WafExpressionSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.WafExpressionSet + * @static + * @param {google.cloud.compute.v1.WafExpressionSet} message WafExpressionSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WafExpressionSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.aliases = []; + object.expressions = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.aliases && message.aliases.length) { + object.aliases = []; + for (var j = 0; j < message.aliases.length; ++j) + object.aliases[j] = message.aliases[j]; + } + if (message.expressions && message.expressions.length) { + object.expressions = []; + for (var j = 0; j < message.expressions.length; ++j) + object.expressions[j] = $root.google.cloud.compute.v1.WafExpressionSetExpression.toObject(message.expressions[j], options); + } + return object; + }; + + /** + * Converts this WafExpressionSet to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.WafExpressionSet + * @instance + * @returns {Object.} JSON object + */ + WafExpressionSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WafExpressionSet; + })(); + + v1.PreconfiguredWafSet = (function() { + + /** + * Properties of a PreconfiguredWafSet. + * @memberof google.cloud.compute.v1 + * @interface IPreconfiguredWafSet + * @property {Array.|null} [expressionSets] PreconfiguredWafSet expressionSets + */ + + /** + * Constructs a new PreconfiguredWafSet. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PreconfiguredWafSet. + * @implements IPreconfiguredWafSet + * @constructor + * @param {google.cloud.compute.v1.IPreconfiguredWafSet=} [properties] Properties to set + */ + function PreconfiguredWafSet(properties) { + this.expressionSets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreconfiguredWafSet expressionSets. + * @member {Array.} expressionSets + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @instance + */ + PreconfiguredWafSet.prototype.expressionSets = $util.emptyArray; + + /** + * Creates a new PreconfiguredWafSet instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {google.cloud.compute.v1.IPreconfiguredWafSet=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PreconfiguredWafSet} PreconfiguredWafSet instance + */ + PreconfiguredWafSet.create = function create(properties) { + return new PreconfiguredWafSet(properties); + }; + + /** + * Encodes the specified PreconfiguredWafSet message. Does not implicitly {@link google.cloud.compute.v1.PreconfiguredWafSet.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {google.cloud.compute.v1.IPreconfiguredWafSet} message PreconfiguredWafSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreconfiguredWafSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expressionSets != null && message.expressionSets.length) + for (var i = 0; i < message.expressionSets.length; ++i) + $root.google.cloud.compute.v1.WafExpressionSet.encode(message.expressionSets[i], writer.uint32(/* id 474011032, wireType 2 =*/3792088258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreconfiguredWafSet message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreconfiguredWafSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {google.cloud.compute.v1.IPreconfiguredWafSet} message PreconfiguredWafSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreconfiguredWafSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreconfiguredWafSet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PreconfiguredWafSet} PreconfiguredWafSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreconfiguredWafSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PreconfiguredWafSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 474011032: + if (!(message.expressionSets && message.expressionSets.length)) + message.expressionSets = []; + message.expressionSets.push($root.google.cloud.compute.v1.WafExpressionSet.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreconfiguredWafSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PreconfiguredWafSet} PreconfiguredWafSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreconfiguredWafSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreconfiguredWafSet message. + * @function verify + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreconfiguredWafSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expressionSets != null && message.hasOwnProperty("expressionSets")) { + if (!Array.isArray(message.expressionSets)) + return "expressionSets: array expected"; + for (var i = 0; i < message.expressionSets.length; ++i) { + var error = $root.google.cloud.compute.v1.WafExpressionSet.verify(message.expressionSets[i]); + if (error) + return "expressionSets." + error; + } + } + return null; + }; + + /** + * Creates a PreconfiguredWafSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PreconfiguredWafSet} PreconfiguredWafSet + */ + PreconfiguredWafSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PreconfiguredWafSet) + return object; + var message = new $root.google.cloud.compute.v1.PreconfiguredWafSet(); + if (object.expressionSets) { + if (!Array.isArray(object.expressionSets)) + throw TypeError(".google.cloud.compute.v1.PreconfiguredWafSet.expressionSets: array expected"); + message.expressionSets = []; + for (var i = 0; i < object.expressionSets.length; ++i) { + if (typeof object.expressionSets[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PreconfiguredWafSet.expressionSets: object expected"); + message.expressionSets[i] = $root.google.cloud.compute.v1.WafExpressionSet.fromObject(object.expressionSets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PreconfiguredWafSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @static + * @param {google.cloud.compute.v1.PreconfiguredWafSet} message PreconfiguredWafSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreconfiguredWafSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.expressionSets = []; + if (message.expressionSets && message.expressionSets.length) { + object.expressionSets = []; + for (var j = 0; j < message.expressionSets.length; ++j) + object.expressionSets[j] = $root.google.cloud.compute.v1.WafExpressionSet.toObject(message.expressionSets[j], options); + } + return object; + }; + + /** + * Converts this PreconfiguredWafSet to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PreconfiguredWafSet + * @instance + * @returns {Object.} JSON object + */ + PreconfiguredWafSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PreconfiguredWafSet; + })(); + + v1.PreservedStatePreservedDisk = (function() { + + /** + * Properties of a PreservedStatePreservedDisk. + * @memberof google.cloud.compute.v1 + * @interface IPreservedStatePreservedDisk + * @property {google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete|null} [autoDelete] PreservedStatePreservedDisk autoDelete + * @property {google.cloud.compute.v1.PreservedStatePreservedDisk.Mode|null} [mode] PreservedStatePreservedDisk mode + * @property {string|null} [source] PreservedStatePreservedDisk source + */ + + /** + * Constructs a new PreservedStatePreservedDisk. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PreservedStatePreservedDisk. + * @implements IPreservedStatePreservedDisk + * @constructor + * @param {google.cloud.compute.v1.IPreservedStatePreservedDisk=} [properties] Properties to set + */ + function PreservedStatePreservedDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreservedStatePreservedDisk autoDelete. + * @member {google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete|null|undefined} autoDelete + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @instance + */ + PreservedStatePreservedDisk.prototype.autoDelete = null; + + /** + * PreservedStatePreservedDisk mode. + * @member {google.cloud.compute.v1.PreservedStatePreservedDisk.Mode|null|undefined} mode + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @instance + */ + PreservedStatePreservedDisk.prototype.mode = null; + + /** + * PreservedStatePreservedDisk source. + * @member {string|null|undefined} source + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @instance + */ + PreservedStatePreservedDisk.prototype.source = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PreservedStatePreservedDisk _autoDelete. + * @member {"autoDelete"|undefined} _autoDelete + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @instance + */ + Object.defineProperty(PreservedStatePreservedDisk.prototype, "_autoDelete", { + get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PreservedStatePreservedDisk _mode. + * @member {"mode"|undefined} _mode + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @instance + */ + Object.defineProperty(PreservedStatePreservedDisk.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PreservedStatePreservedDisk _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @instance + */ + Object.defineProperty(PreservedStatePreservedDisk.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PreservedStatePreservedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {google.cloud.compute.v1.IPreservedStatePreservedDisk=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PreservedStatePreservedDisk} PreservedStatePreservedDisk instance + */ + PreservedStatePreservedDisk.create = function create(properties) { + return new PreservedStatePreservedDisk(properties); + }; + + /** + * Encodes the specified PreservedStatePreservedDisk message. Does not implicitly {@link google.cloud.compute.v1.PreservedStatePreservedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {google.cloud.compute.v1.IPreservedStatePreservedDisk} message PreservedStatePreservedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreservedStatePreservedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3357091, wireType 0 =*/26856728).int32(message.mode); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 177235995, wireType 2 =*/1417887962).string(message.source); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 464761403, wireType 0 =*/3718091224).int32(message.autoDelete); + return writer; + }; + + /** + * Encodes the specified PreservedStatePreservedDisk message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreservedStatePreservedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {google.cloud.compute.v1.IPreservedStatePreservedDisk} message PreservedStatePreservedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreservedStatePreservedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreservedStatePreservedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PreservedStatePreservedDisk} PreservedStatePreservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreservedStatePreservedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PreservedStatePreservedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 464761403: + message.autoDelete = reader.int32(); + break; + case 3357091: + message.mode = reader.int32(); + break; + case 177235995: + message.source = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreservedStatePreservedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PreservedStatePreservedDisk} PreservedStatePreservedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreservedStatePreservedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreservedStatePreservedDisk message. + * @function verify + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreservedStatePreservedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + properties._autoDelete = 1; + switch (message.autoDelete) { + default: + return "autoDelete: enum value expected"; + case 0: + case 74175084: + case 95727719: + break; + } + } + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 91950261: + case 173607894: + break; + } + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + return null; + }; + + /** + * Creates a PreservedStatePreservedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PreservedStatePreservedDisk} PreservedStatePreservedDisk + */ + PreservedStatePreservedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PreservedStatePreservedDisk) + return object; + var message = new $root.google.cloud.compute.v1.PreservedStatePreservedDisk(); + switch (object.autoDelete) { + case "UNDEFINED_AUTO_DELETE": + case 0: + message.autoDelete = 0; + break; + case "NEVER": + case 74175084: + message.autoDelete = 74175084; + break; + case "ON_PERMANENT_INSTANCE_DELETION": + case 95727719: + message.autoDelete = 95727719; + break; + } + switch (object.mode) { + case "UNDEFINED_MODE": + case 0: + message.mode = 0; + break; + case "READ_ONLY": + case 91950261: + message.mode = 91950261; + break; + case "READ_WRITE": + case 173607894: + message.mode = 173607894; + break; + } + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a PreservedStatePreservedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @static + * @param {google.cloud.compute.v1.PreservedStatePreservedDisk} message PreservedStatePreservedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreservedStatePreservedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.cloud.compute.v1.PreservedStatePreservedDisk.Mode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + object.autoDelete = options.enums === String ? $root.google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete[message.autoDelete] : message.autoDelete; + if (options.oneofs) + object._autoDelete = "autoDelete"; + } + return object; + }; + + /** + * Converts this PreservedStatePreservedDisk to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PreservedStatePreservedDisk + * @instance + * @returns {Object.} JSON object + */ + PreservedStatePreservedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AutoDelete enum. + * @name google.cloud.compute.v1.PreservedStatePreservedDisk.AutoDelete + * @enum {number} + * @property {number} UNDEFINED_AUTO_DELETE=0 UNDEFINED_AUTO_DELETE value + * @property {number} NEVER=74175084 NEVER value + * @property {number} ON_PERMANENT_INSTANCE_DELETION=95727719 ON_PERMANENT_INSTANCE_DELETION value + */ + PreservedStatePreservedDisk.AutoDelete = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_AUTO_DELETE"] = 0; + values[valuesById[74175084] = "NEVER"] = 74175084; + values[valuesById[95727719] = "ON_PERMANENT_INSTANCE_DELETION"] = 95727719; + return values; + })(); + + /** + * Mode enum. + * @name google.cloud.compute.v1.PreservedStatePreservedDisk.Mode + * @enum {number} + * @property {number} UNDEFINED_MODE=0 UNDEFINED_MODE value + * @property {number} READ_ONLY=91950261 READ_ONLY value + * @property {number} READ_WRITE=173607894 READ_WRITE value + */ + PreservedStatePreservedDisk.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MODE"] = 0; + values[valuesById[91950261] = "READ_ONLY"] = 91950261; + values[valuesById[173607894] = "READ_WRITE"] = 173607894; + return values; + })(); + + return PreservedStatePreservedDisk; + })(); + + v1.Quota = (function() { + + /** + * Properties of a Quota. + * @memberof google.cloud.compute.v1 + * @interface IQuota + * @property {number|null} [limit] Quota limit + * @property {google.cloud.compute.v1.Quota.Metric|null} [metric] Quota metric + * @property {string|null} [owner] Quota owner + * @property {number|null} [usage] Quota usage + */ + + /** + * Constructs a new Quota. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Quota. + * @implements IQuota + * @constructor + * @param {google.cloud.compute.v1.IQuota=} [properties] Properties to set + */ + function Quota(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Quota limit. + * @member {number|null|undefined} limit + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Quota.prototype.limit = null; + + /** + * Quota metric. + * @member {google.cloud.compute.v1.Quota.Metric|null|undefined} metric + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Quota.prototype.metric = null; + + /** + * Quota owner. + * @member {string|null|undefined} owner + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Quota.prototype.owner = null; + + /** + * Quota usage. + * @member {number|null|undefined} usage + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Quota.prototype.usage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Quota _limit. + * @member {"limit"|undefined} _limit + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Object.defineProperty(Quota.prototype, "_limit", { + get: $util.oneOfGetter($oneOfFields = ["limit"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Quota _metric. + * @member {"metric"|undefined} _metric + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Object.defineProperty(Quota.prototype, "_metric", { + get: $util.oneOfGetter($oneOfFields = ["metric"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Quota _owner. + * @member {"owner"|undefined} _owner + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Object.defineProperty(Quota.prototype, "_owner", { + get: $util.oneOfGetter($oneOfFields = ["owner"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Quota _usage. + * @member {"usage"|undefined} _usage + * @memberof google.cloud.compute.v1.Quota + * @instance + */ + Object.defineProperty(Quota.prototype, "_usage", { + get: $util.oneOfGetter($oneOfFields = ["usage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Quota instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {google.cloud.compute.v1.IQuota=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Quota} Quota instance + */ + Quota.create = function create(properties) { + return new Quota(properties); + }; + + /** + * Encodes the specified Quota message. Does not implicitly {@link google.cloud.compute.v1.Quota.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {google.cloud.compute.v1.IQuota} message Quota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Quota.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 102976443, wireType 1 =*/823811545).double(message.limit); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + writer.uint32(/* id 106164915, wireType 2 =*/849319322).string(message.owner); + if (message.usage != null && Object.hasOwnProperty.call(message, "usage")) + writer.uint32(/* id 111574433, wireType 1 =*/892595465).double(message.usage); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + writer.uint32(/* id 533067184, wireType 0 =*/4264537472).int32(message.metric); + return writer; + }; + + /** + * Encodes the specified Quota message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Quota.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {google.cloud.compute.v1.IQuota} message Quota message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Quota.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Quota message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Quota} Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Quota.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Quota(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 102976443: + message.limit = reader.double(); + break; + case 533067184: + message.metric = reader.int32(); + break; + case 106164915: + message.owner = reader.string(); + break; + case 111574433: + message.usage = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Quota message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Quota} Quota + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Quota.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Quota message. + * @function verify + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Quota.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.limit != null && message.hasOwnProperty("limit")) { + properties._limit = 1; + if (typeof message.limit !== "number") + return "limit: number expected"; + } + if (message.metric != null && message.hasOwnProperty("metric")) { + properties._metric = 1; + switch (message.metric) { + default: + return "metric: enum value expected"; + case 0: + case 153206585: + case 108303563: + case 471248988: + case 137626846: + case 269623753: + case 508182517: + case 317601211: + case 456141790: + case 59330902: + case 282390904: + case 223725528: + case 292394702: + case 388120154: + case 357606869: + case 308393480: + case 489057886: + case 40064304: + case 125951757: + case 322589603: + case 375799445: + case 3857188: + case 107528100: + case 347952897: + case 139871237: + case 219562: + case 2075595: + case 470911149: + case 353520543: + case 481995837: + case 374298265: + case 63478888: + case 272457134: + case 374485843: + case 432668949: + case 42738332: + case 39387177: + case 289347502: + case 15562360: + case 131337822: + case 355919038: + case 101798192: + case 226188271: + case 415204741: + case 159968086: + case 425090419: + case 285341866: + case 197899392: + case 266433668: + case 151359133: + case 402125072: + case 32786705: + case 462104083: + case 330878021: + case 37203366: + case 65832517: + case 446986640: + case 265855917: + case 351743370: + case 416465286: + case 485481477: + case 102144909: + case 101117374: + case 24624817: + case 474896668: + case 504872978: + case 163886599: + case 236601633: + case 213970574: + case 283841470: + case 528296619: + case 75759810: + case 319813039: + case 129293095: + case 15578407: + case 69593965: + case 251184841: + case 260819336: + case 68832784: + case 374960201: + case 337432351: + case 313544076: + case 429197628: + case 252981545: + case 221115968: + case 44497965: + case 230123813: + case 231164291: + case 471371980: + case 532465974: + case 29363772: + case 37543696: + case 32644647: + case 83955297: + case 493018666: + case 275680074: + case 189518703: + case 470815689: + case 203549225: + case 343405327: + case 161732561: + case 378372399: + case 93624049: + case 275809649: + case 421330469: + case 219522506: + case 164117155: + case 284519728: + case 348261257: + case 159216235: + case 182243136: + case 75029928: + case 378660743: + case 35620282: + case 104327296: + case 95191981: + break; + } + } + if (message.owner != null && message.hasOwnProperty("owner")) { + properties._owner = 1; + if (!$util.isString(message.owner)) + return "owner: string expected"; + } + if (message.usage != null && message.hasOwnProperty("usage")) { + properties._usage = 1; + if (typeof message.usage !== "number") + return "usage: number expected"; + } + return null; + }; + + /** + * Creates a Quota message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Quota} Quota + */ + Quota.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Quota) + return object; + var message = new $root.google.cloud.compute.v1.Quota(); + if (object.limit != null) + message.limit = Number(object.limit); + switch (object.metric) { + case "UNDEFINED_METRIC": + case 0: + message.metric = 0; + break; + case "A2_CPUS": + case 153206585: + message.metric = 153206585; + break; + case "AFFINITY_GROUPS": + case 108303563: + message.metric = 108303563; + break; + case "AUTOSCALERS": + case 471248988: + message.metric = 471248988; + break; + case "BACKEND_BUCKETS": + case 137626846: + message.metric = 137626846; + break; + case "BACKEND_SERVICES": + case 269623753: + message.metric = 269623753; + break; + case "C2D_CPUS": + case 508182517: + message.metric = 508182517; + break; + case "C2_CPUS": + case 317601211: + message.metric = 317601211; + break; + case "COMMITMENTS": + case 456141790: + message.metric = 456141790; + break; + case "COMMITTED_A2_CPUS": + case 59330902: + message.metric = 59330902; + break; + case "COMMITTED_C2D_CPUS": + case 282390904: + message.metric = 282390904; + break; + case "COMMITTED_C2_CPUS": + case 223725528: + message.metric = 223725528; + break; + case "COMMITTED_CPUS": + case 292394702: + message.metric = 292394702; + break; + case "COMMITTED_E2_CPUS": + case 388120154: + message.metric = 388120154; + break; + case "COMMITTED_LICENSES": + case 357606869: + message.metric = 357606869; + break; + case "COMMITTED_LOCAL_SSD_TOTAL_GB": + case 308393480: + message.metric = 308393480; + break; + case "COMMITTED_MEMORY_OPTIMIZED_CPUS": + case 489057886: + message.metric = 489057886; + break; + case "COMMITTED_N2A_CPUS": + case 40064304: + message.metric = 40064304; + break; + case "COMMITTED_N2D_CPUS": + case 125951757: + message.metric = 125951757; + break; + case "COMMITTED_N2_CPUS": + case 322589603: + message.metric = 322589603; + break; + case "COMMITTED_NVIDIA_A100_GPUS": + case 375799445: + message.metric = 375799445; + break; + case "COMMITTED_NVIDIA_K80_GPUS": + case 3857188: + message.metric = 3857188; + break; + case "COMMITTED_NVIDIA_P100_GPUS": + case 107528100: + message.metric = 107528100; + break; + case "COMMITTED_NVIDIA_P4_GPUS": + case 347952897: + message.metric = 347952897; + break; + case "COMMITTED_NVIDIA_T4_GPUS": + case 139871237: + message.metric = 139871237; + break; + case "COMMITTED_NVIDIA_V100_GPUS": + case 219562: + message.metric = 219562; + break; + case "CPUS": + case 2075595: + message.metric = 2075595; + break; + case "CPUS_ALL_REGIONS": + case 470911149: + message.metric = 470911149; + break; + case "DISKS_TOTAL_GB": + case 353520543: + message.metric = 353520543; + break; + case "E2_CPUS": + case 481995837: + message.metric = 481995837; + break; + case "EXTERNAL_NETWORK_LB_FORWARDING_RULES": + case 374298265: + message.metric = 374298265; + break; + case "EXTERNAL_PROTOCOL_FORWARDING_RULES": + case 63478888: + message.metric = 63478888; + break; + case "EXTERNAL_VPN_GATEWAYS": + case 272457134: + message.metric = 272457134; + break; + case "FIREWALLS": + case 374485843: + message.metric = 374485843; + break; + case "FORWARDING_RULES": + case 432668949: + message.metric = 432668949; + break; + case "GLOBAL_INTERNAL_ADDRESSES": + case 42738332: + message.metric = 42738332; + break; + case "GPUS_ALL_REGIONS": + case 39387177: + message.metric = 39387177; + break; + case "HEALTH_CHECKS": + case 289347502: + message.metric = 289347502; + break; + case "IMAGES": + case 15562360: + message.metric = 15562360; + break; + case "INSTANCES": + case 131337822: + message.metric = 131337822; + break; + case "INSTANCE_GROUPS": + case 355919038: + message.metric = 355919038; + break; + case "INSTANCE_GROUP_MANAGERS": + case 101798192: + message.metric = 101798192; + break; + case "INSTANCE_TEMPLATES": + case 226188271: + message.metric = 226188271; + break; + case "INTERCONNECTS": + case 415204741: + message.metric = 415204741; + break; + case "INTERCONNECT_ATTACHMENTS_PER_REGION": + case 159968086: + message.metric = 159968086; + break; + case "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS": + case 425090419: + message.metric = 425090419; + break; + case "INTERCONNECT_TOTAL_GBPS": + case 285341866: + message.metric = 285341866; + break; + case "INTERNAL_ADDRESSES": + case 197899392: + message.metric = 197899392; + break; + case "INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES": + case 266433668: + message.metric = 266433668; + break; + case "IN_PLACE_SNAPSHOTS": + case 151359133: + message.metric = 151359133; + break; + case "IN_USE_ADDRESSES": + case 402125072: + message.metric = 402125072; + break; + case "IN_USE_BACKUP_SCHEDULES": + case 32786705: + message.metric = 32786705; + break; + case "IN_USE_SNAPSHOT_SCHEDULES": + case 462104083: + message.metric = 462104083; + break; + case "LOCAL_SSD_TOTAL_GB": + case 330878021: + message.metric = 330878021; + break; + case "M1_CPUS": + case 37203366: + message.metric = 37203366; + break; + case "M2_CPUS": + case 65832517: + message.metric = 65832517; + break; + case "MACHINE_IMAGES": + case 446986640: + message.metric = 446986640; + break; + case "N2A_CPUS": + case 265855917: + message.metric = 265855917; + break; + case "N2D_CPUS": + case 351743370: + message.metric = 351743370; + break; + case "N2_CPUS": + case 416465286: + message.metric = 416465286; + break; + case "NETWORKS": + case 485481477: + message.metric = 485481477; + break; + case "NETWORK_ENDPOINT_GROUPS": + case 102144909: + message.metric = 102144909; + break; + case "NETWORK_FIREWALL_POLICIES": + case 101117374: + message.metric = 101117374; + break; + case "NODE_GROUPS": + case 24624817: + message.metric = 24624817; + break; + case "NODE_TEMPLATES": + case 474896668: + message.metric = 474896668; + break; + case "NVIDIA_A100_GPUS": + case 504872978: + message.metric = 504872978; + break; + case "NVIDIA_K80_GPUS": + case 163886599: + message.metric = 163886599; + break; + case "NVIDIA_P100_GPUS": + case 236601633: + message.metric = 236601633; + break; + case "NVIDIA_P100_VWS_GPUS": + case 213970574: + message.metric = 213970574; + break; + case "NVIDIA_P4_GPUS": + case 283841470: + message.metric = 283841470; + break; + case "NVIDIA_P4_VWS_GPUS": + case 528296619: + message.metric = 528296619; + break; + case "NVIDIA_T4_GPUS": + case 75759810: + message.metric = 75759810; + break; + case "NVIDIA_T4_VWS_GPUS": + case 319813039: + message.metric = 319813039; + break; + case "NVIDIA_V100_GPUS": + case 129293095: + message.metric = 129293095; + break; + case "PACKET_MIRRORINGS": + case 15578407: + message.metric = 15578407; + break; + case "PD_EXTREME_TOTAL_PROVISIONED_IOPS": + case 69593965: + message.metric = 69593965; + break; + case "PREEMPTIBLE_CPUS": + case 251184841: + message.metric = 251184841; + break; + case "PREEMPTIBLE_LOCAL_SSD_GB": + case 260819336: + message.metric = 260819336; + break; + case "PREEMPTIBLE_NVIDIA_A100_GPUS": + case 68832784: + message.metric = 68832784; + break; + case "PREEMPTIBLE_NVIDIA_K80_GPUS": + case 374960201: + message.metric = 374960201; + break; + case "PREEMPTIBLE_NVIDIA_P100_GPUS": + case 337432351: + message.metric = 337432351; + break; + case "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS": + case 313544076: + message.metric = 313544076; + break; + case "PREEMPTIBLE_NVIDIA_P4_GPUS": + case 429197628: + message.metric = 429197628; + break; + case "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS": + case 252981545: + message.metric = 252981545; + break; + case "PREEMPTIBLE_NVIDIA_T4_GPUS": + case 221115968: + message.metric = 221115968; + break; + case "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS": + case 44497965: + message.metric = 44497965; + break; + case "PREEMPTIBLE_NVIDIA_V100_GPUS": + case 230123813: + message.metric = 230123813; + break; + case "PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK": + case 231164291: + message.metric = 231164291; + break; + case "PUBLIC_ADVERTISED_PREFIXES": + case 471371980: + message.metric = 471371980; + break; + case "PUBLIC_DELEGATED_PREFIXES": + case 532465974: + message.metric = 532465974; + break; + case "REGIONAL_AUTOSCALERS": + case 29363772: + message.metric = 29363772; + break; + case "REGIONAL_INSTANCE_GROUP_MANAGERS": + case 37543696: + message.metric = 37543696; + break; + case "RESERVATIONS": + case 32644647: + message.metric = 32644647; + break; + case "RESOURCE_POLICIES": + case 83955297: + message.metric = 83955297; + break; + case "ROUTERS": + case 493018666: + message.metric = 493018666; + break; + case "ROUTES": + case 275680074: + message.metric = 275680074; + break; + case "SECURITY_POLICIES": + case 189518703: + message.metric = 189518703; + break; + case "SECURITY_POLICY_CEVAL_RULES": + case 470815689: + message.metric = 470815689; + break; + case "SECURITY_POLICY_RULES": + case 203549225: + message.metric = 203549225; + break; + case "SNAPSHOTS": + case 343405327: + message.metric = 343405327; + break; + case "SSD_TOTAL_GB": + case 161732561: + message.metric = 161732561; + break; + case "SSL_CERTIFICATES": + case 378372399: + message.metric = 378372399; + break; + case "STATIC_ADDRESSES": + case 93624049: + message.metric = 93624049; + break; + case "STATIC_BYOIP_ADDRESSES": + case 275809649: + message.metric = 275809649; + break; + case "SUBNETWORKS": + case 421330469: + message.metric = 421330469; + break; + case "TARGET_HTTPS_PROXIES": + case 219522506: + message.metric = 219522506; + break; + case "TARGET_HTTP_PROXIES": + case 164117155: + message.metric = 164117155; + break; + case "TARGET_INSTANCES": + case 284519728: + message.metric = 284519728; + break; + case "TARGET_POOLS": + case 348261257: + message.metric = 348261257; + break; + case "TARGET_SSL_PROXIES": + case 159216235: + message.metric = 159216235; + break; + case "TARGET_TCP_PROXIES": + case 182243136: + message.metric = 182243136; + break; + case "TARGET_VPN_GATEWAYS": + case 75029928: + message.metric = 75029928; + break; + case "URL_MAPS": + case 378660743: + message.metric = 378660743; + break; + case "VPN_GATEWAYS": + case 35620282: + message.metric = 35620282; + break; + case "VPN_TUNNELS": + case 104327296: + message.metric = 104327296; + break; + case "XPN_SERVICE_PROJECTS": + case 95191981: + message.metric = 95191981; + break; + } + if (object.owner != null) + message.owner = String(object.owner); + if (object.usage != null) + message.usage = Number(object.usage); + return message; + }; + + /** + * Creates a plain object from a Quota message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Quota + * @static + * @param {google.cloud.compute.v1.Quota} message Quota + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Quota.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.limit != null && message.hasOwnProperty("limit")) { + object.limit = options.json && !isFinite(message.limit) ? String(message.limit) : message.limit; + if (options.oneofs) + object._limit = "limit"; + } + if (message.owner != null && message.hasOwnProperty("owner")) { + object.owner = message.owner; + if (options.oneofs) + object._owner = "owner"; + } + if (message.usage != null && message.hasOwnProperty("usage")) { + object.usage = options.json && !isFinite(message.usage) ? String(message.usage) : message.usage; + if (options.oneofs) + object._usage = "usage"; + } + if (message.metric != null && message.hasOwnProperty("metric")) { + object.metric = options.enums === String ? $root.google.cloud.compute.v1.Quota.Metric[message.metric] : message.metric; + if (options.oneofs) + object._metric = "metric"; + } + return object; + }; + + /** + * Converts this Quota to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Quota + * @instance + * @returns {Object.} JSON object + */ + Quota.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Metric enum. + * @name google.cloud.compute.v1.Quota.Metric + * @enum {number} + * @property {number} UNDEFINED_METRIC=0 UNDEFINED_METRIC value + * @property {number} A2_CPUS=153206585 A2_CPUS value + * @property {number} AFFINITY_GROUPS=108303563 AFFINITY_GROUPS value + * @property {number} AUTOSCALERS=471248988 AUTOSCALERS value + * @property {number} BACKEND_BUCKETS=137626846 BACKEND_BUCKETS value + * @property {number} BACKEND_SERVICES=269623753 BACKEND_SERVICES value + * @property {number} C2D_CPUS=508182517 C2D_CPUS value + * @property {number} C2_CPUS=317601211 C2_CPUS value + * @property {number} COMMITMENTS=456141790 COMMITMENTS value + * @property {number} COMMITTED_A2_CPUS=59330902 COMMITTED_A2_CPUS value + * @property {number} COMMITTED_C2D_CPUS=282390904 COMMITTED_C2D_CPUS value + * @property {number} COMMITTED_C2_CPUS=223725528 COMMITTED_C2_CPUS value + * @property {number} COMMITTED_CPUS=292394702 COMMITTED_CPUS value + * @property {number} COMMITTED_E2_CPUS=388120154 COMMITTED_E2_CPUS value + * @property {number} COMMITTED_LICENSES=357606869 COMMITTED_LICENSES value + * @property {number} COMMITTED_LOCAL_SSD_TOTAL_GB=308393480 COMMITTED_LOCAL_SSD_TOTAL_GB value + * @property {number} COMMITTED_MEMORY_OPTIMIZED_CPUS=489057886 COMMITTED_MEMORY_OPTIMIZED_CPUS value + * @property {number} COMMITTED_N2A_CPUS=40064304 COMMITTED_N2A_CPUS value + * @property {number} COMMITTED_N2D_CPUS=125951757 COMMITTED_N2D_CPUS value + * @property {number} COMMITTED_N2_CPUS=322589603 COMMITTED_N2_CPUS value + * @property {number} COMMITTED_NVIDIA_A100_GPUS=375799445 COMMITTED_NVIDIA_A100_GPUS value + * @property {number} COMMITTED_NVIDIA_K80_GPUS=3857188 COMMITTED_NVIDIA_K80_GPUS value + * @property {number} COMMITTED_NVIDIA_P100_GPUS=107528100 COMMITTED_NVIDIA_P100_GPUS value + * @property {number} COMMITTED_NVIDIA_P4_GPUS=347952897 COMMITTED_NVIDIA_P4_GPUS value + * @property {number} COMMITTED_NVIDIA_T4_GPUS=139871237 COMMITTED_NVIDIA_T4_GPUS value + * @property {number} COMMITTED_NVIDIA_V100_GPUS=219562 COMMITTED_NVIDIA_V100_GPUS value + * @property {number} CPUS=2075595 CPUS value + * @property {number} CPUS_ALL_REGIONS=470911149 CPUS_ALL_REGIONS value + * @property {number} DISKS_TOTAL_GB=353520543 DISKS_TOTAL_GB value + * @property {number} E2_CPUS=481995837 E2_CPUS value + * @property {number} EXTERNAL_NETWORK_LB_FORWARDING_RULES=374298265 EXTERNAL_NETWORK_LB_FORWARDING_RULES value + * @property {number} EXTERNAL_PROTOCOL_FORWARDING_RULES=63478888 EXTERNAL_PROTOCOL_FORWARDING_RULES value + * @property {number} EXTERNAL_VPN_GATEWAYS=272457134 EXTERNAL_VPN_GATEWAYS value + * @property {number} FIREWALLS=374485843 FIREWALLS value + * @property {number} FORWARDING_RULES=432668949 FORWARDING_RULES value + * @property {number} GLOBAL_INTERNAL_ADDRESSES=42738332 GLOBAL_INTERNAL_ADDRESSES value + * @property {number} GPUS_ALL_REGIONS=39387177 GPUS_ALL_REGIONS value + * @property {number} HEALTH_CHECKS=289347502 HEALTH_CHECKS value + * @property {number} IMAGES=15562360 IMAGES value + * @property {number} INSTANCES=131337822 INSTANCES value + * @property {number} INSTANCE_GROUPS=355919038 INSTANCE_GROUPS value + * @property {number} INSTANCE_GROUP_MANAGERS=101798192 INSTANCE_GROUP_MANAGERS value + * @property {number} INSTANCE_TEMPLATES=226188271 INSTANCE_TEMPLATES value + * @property {number} INTERCONNECTS=415204741 INTERCONNECTS value + * @property {number} INTERCONNECT_ATTACHMENTS_PER_REGION=159968086 INTERCONNECT_ATTACHMENTS_PER_REGION value + * @property {number} INTERCONNECT_ATTACHMENTS_TOTAL_MBPS=425090419 INTERCONNECT_ATTACHMENTS_TOTAL_MBPS value + * @property {number} INTERCONNECT_TOTAL_GBPS=285341866 INTERCONNECT_TOTAL_GBPS value + * @property {number} INTERNAL_ADDRESSES=197899392 INTERNAL_ADDRESSES value + * @property {number} INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES=266433668 INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES value + * @property {number} IN_PLACE_SNAPSHOTS=151359133 IN_PLACE_SNAPSHOTS value + * @property {number} IN_USE_ADDRESSES=402125072 IN_USE_ADDRESSES value + * @property {number} IN_USE_BACKUP_SCHEDULES=32786705 IN_USE_BACKUP_SCHEDULES value + * @property {number} IN_USE_SNAPSHOT_SCHEDULES=462104083 IN_USE_SNAPSHOT_SCHEDULES value + * @property {number} LOCAL_SSD_TOTAL_GB=330878021 LOCAL_SSD_TOTAL_GB value + * @property {number} M1_CPUS=37203366 M1_CPUS value + * @property {number} M2_CPUS=65832517 M2_CPUS value + * @property {number} MACHINE_IMAGES=446986640 MACHINE_IMAGES value + * @property {number} N2A_CPUS=265855917 N2A_CPUS value + * @property {number} N2D_CPUS=351743370 N2D_CPUS value + * @property {number} N2_CPUS=416465286 N2_CPUS value + * @property {number} NETWORKS=485481477 NETWORKS value + * @property {number} NETWORK_ENDPOINT_GROUPS=102144909 NETWORK_ENDPOINT_GROUPS value + * @property {number} NETWORK_FIREWALL_POLICIES=101117374 NETWORK_FIREWALL_POLICIES value + * @property {number} NODE_GROUPS=24624817 NODE_GROUPS value + * @property {number} NODE_TEMPLATES=474896668 NODE_TEMPLATES value + * @property {number} NVIDIA_A100_GPUS=504872978 NVIDIA_A100_GPUS value + * @property {number} NVIDIA_K80_GPUS=163886599 NVIDIA_K80_GPUS value + * @property {number} NVIDIA_P100_GPUS=236601633 NVIDIA_P100_GPUS value + * @property {number} NVIDIA_P100_VWS_GPUS=213970574 NVIDIA_P100_VWS_GPUS value + * @property {number} NVIDIA_P4_GPUS=283841470 NVIDIA_P4_GPUS value + * @property {number} NVIDIA_P4_VWS_GPUS=528296619 NVIDIA_P4_VWS_GPUS value + * @property {number} NVIDIA_T4_GPUS=75759810 NVIDIA_T4_GPUS value + * @property {number} NVIDIA_T4_VWS_GPUS=319813039 NVIDIA_T4_VWS_GPUS value + * @property {number} NVIDIA_V100_GPUS=129293095 NVIDIA_V100_GPUS value + * @property {number} PACKET_MIRRORINGS=15578407 PACKET_MIRRORINGS value + * @property {number} PD_EXTREME_TOTAL_PROVISIONED_IOPS=69593965 PD_EXTREME_TOTAL_PROVISIONED_IOPS value + * @property {number} PREEMPTIBLE_CPUS=251184841 PREEMPTIBLE_CPUS value + * @property {number} PREEMPTIBLE_LOCAL_SSD_GB=260819336 PREEMPTIBLE_LOCAL_SSD_GB value + * @property {number} PREEMPTIBLE_NVIDIA_A100_GPUS=68832784 PREEMPTIBLE_NVIDIA_A100_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_K80_GPUS=374960201 PREEMPTIBLE_NVIDIA_K80_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_P100_GPUS=337432351 PREEMPTIBLE_NVIDIA_P100_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_P100_VWS_GPUS=313544076 PREEMPTIBLE_NVIDIA_P100_VWS_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_P4_GPUS=429197628 PREEMPTIBLE_NVIDIA_P4_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_P4_VWS_GPUS=252981545 PREEMPTIBLE_NVIDIA_P4_VWS_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_T4_GPUS=221115968 PREEMPTIBLE_NVIDIA_T4_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_T4_VWS_GPUS=44497965 PREEMPTIBLE_NVIDIA_T4_VWS_GPUS value + * @property {number} PREEMPTIBLE_NVIDIA_V100_GPUS=230123813 PREEMPTIBLE_NVIDIA_V100_GPUS value + * @property {number} PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK=231164291 PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK value + * @property {number} PUBLIC_ADVERTISED_PREFIXES=471371980 PUBLIC_ADVERTISED_PREFIXES value + * @property {number} PUBLIC_DELEGATED_PREFIXES=532465974 PUBLIC_DELEGATED_PREFIXES value + * @property {number} REGIONAL_AUTOSCALERS=29363772 REGIONAL_AUTOSCALERS value + * @property {number} REGIONAL_INSTANCE_GROUP_MANAGERS=37543696 REGIONAL_INSTANCE_GROUP_MANAGERS value + * @property {number} RESERVATIONS=32644647 RESERVATIONS value + * @property {number} RESOURCE_POLICIES=83955297 RESOURCE_POLICIES value + * @property {number} ROUTERS=493018666 ROUTERS value + * @property {number} ROUTES=275680074 ROUTES value + * @property {number} SECURITY_POLICIES=189518703 SECURITY_POLICIES value + * @property {number} SECURITY_POLICY_CEVAL_RULES=470815689 SECURITY_POLICY_CEVAL_RULES value + * @property {number} SECURITY_POLICY_RULES=203549225 SECURITY_POLICY_RULES value + * @property {number} SNAPSHOTS=343405327 SNAPSHOTS value + * @property {number} SSD_TOTAL_GB=161732561 SSD_TOTAL_GB value + * @property {number} SSL_CERTIFICATES=378372399 SSL_CERTIFICATES value + * @property {number} STATIC_ADDRESSES=93624049 STATIC_ADDRESSES value + * @property {number} STATIC_BYOIP_ADDRESSES=275809649 STATIC_BYOIP_ADDRESSES value + * @property {number} SUBNETWORKS=421330469 SUBNETWORKS value + * @property {number} TARGET_HTTPS_PROXIES=219522506 TARGET_HTTPS_PROXIES value + * @property {number} TARGET_HTTP_PROXIES=164117155 TARGET_HTTP_PROXIES value + * @property {number} TARGET_INSTANCES=284519728 TARGET_INSTANCES value + * @property {number} TARGET_POOLS=348261257 TARGET_POOLS value + * @property {number} TARGET_SSL_PROXIES=159216235 TARGET_SSL_PROXIES value + * @property {number} TARGET_TCP_PROXIES=182243136 TARGET_TCP_PROXIES value + * @property {number} TARGET_VPN_GATEWAYS=75029928 TARGET_VPN_GATEWAYS value + * @property {number} URL_MAPS=378660743 URL_MAPS value + * @property {number} VPN_GATEWAYS=35620282 VPN_GATEWAYS value + * @property {number} VPN_TUNNELS=104327296 VPN_TUNNELS value + * @property {number} XPN_SERVICE_PROJECTS=95191981 XPN_SERVICE_PROJECTS value + */ + Quota.Metric = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_METRIC"] = 0; + values[valuesById[153206585] = "A2_CPUS"] = 153206585; + values[valuesById[108303563] = "AFFINITY_GROUPS"] = 108303563; + values[valuesById[471248988] = "AUTOSCALERS"] = 471248988; + values[valuesById[137626846] = "BACKEND_BUCKETS"] = 137626846; + values[valuesById[269623753] = "BACKEND_SERVICES"] = 269623753; + values[valuesById[508182517] = "C2D_CPUS"] = 508182517; + values[valuesById[317601211] = "C2_CPUS"] = 317601211; + values[valuesById[456141790] = "COMMITMENTS"] = 456141790; + values[valuesById[59330902] = "COMMITTED_A2_CPUS"] = 59330902; + values[valuesById[282390904] = "COMMITTED_C2D_CPUS"] = 282390904; + values[valuesById[223725528] = "COMMITTED_C2_CPUS"] = 223725528; + values[valuesById[292394702] = "COMMITTED_CPUS"] = 292394702; + values[valuesById[388120154] = "COMMITTED_E2_CPUS"] = 388120154; + values[valuesById[357606869] = "COMMITTED_LICENSES"] = 357606869; + values[valuesById[308393480] = "COMMITTED_LOCAL_SSD_TOTAL_GB"] = 308393480; + values[valuesById[489057886] = "COMMITTED_MEMORY_OPTIMIZED_CPUS"] = 489057886; + values[valuesById[40064304] = "COMMITTED_N2A_CPUS"] = 40064304; + values[valuesById[125951757] = "COMMITTED_N2D_CPUS"] = 125951757; + values[valuesById[322589603] = "COMMITTED_N2_CPUS"] = 322589603; + values[valuesById[375799445] = "COMMITTED_NVIDIA_A100_GPUS"] = 375799445; + values[valuesById[3857188] = "COMMITTED_NVIDIA_K80_GPUS"] = 3857188; + values[valuesById[107528100] = "COMMITTED_NVIDIA_P100_GPUS"] = 107528100; + values[valuesById[347952897] = "COMMITTED_NVIDIA_P4_GPUS"] = 347952897; + values[valuesById[139871237] = "COMMITTED_NVIDIA_T4_GPUS"] = 139871237; + values[valuesById[219562] = "COMMITTED_NVIDIA_V100_GPUS"] = 219562; + values[valuesById[2075595] = "CPUS"] = 2075595; + values[valuesById[470911149] = "CPUS_ALL_REGIONS"] = 470911149; + values[valuesById[353520543] = "DISKS_TOTAL_GB"] = 353520543; + values[valuesById[481995837] = "E2_CPUS"] = 481995837; + values[valuesById[374298265] = "EXTERNAL_NETWORK_LB_FORWARDING_RULES"] = 374298265; + values[valuesById[63478888] = "EXTERNAL_PROTOCOL_FORWARDING_RULES"] = 63478888; + values[valuesById[272457134] = "EXTERNAL_VPN_GATEWAYS"] = 272457134; + values[valuesById[374485843] = "FIREWALLS"] = 374485843; + values[valuesById[432668949] = "FORWARDING_RULES"] = 432668949; + values[valuesById[42738332] = "GLOBAL_INTERNAL_ADDRESSES"] = 42738332; + values[valuesById[39387177] = "GPUS_ALL_REGIONS"] = 39387177; + values[valuesById[289347502] = "HEALTH_CHECKS"] = 289347502; + values[valuesById[15562360] = "IMAGES"] = 15562360; + values[valuesById[131337822] = "INSTANCES"] = 131337822; + values[valuesById[355919038] = "INSTANCE_GROUPS"] = 355919038; + values[valuesById[101798192] = "INSTANCE_GROUP_MANAGERS"] = 101798192; + values[valuesById[226188271] = "INSTANCE_TEMPLATES"] = 226188271; + values[valuesById[415204741] = "INTERCONNECTS"] = 415204741; + values[valuesById[159968086] = "INTERCONNECT_ATTACHMENTS_PER_REGION"] = 159968086; + values[valuesById[425090419] = "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS"] = 425090419; + values[valuesById[285341866] = "INTERCONNECT_TOTAL_GBPS"] = 285341866; + values[valuesById[197899392] = "INTERNAL_ADDRESSES"] = 197899392; + values[valuesById[266433668] = "INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES"] = 266433668; + values[valuesById[151359133] = "IN_PLACE_SNAPSHOTS"] = 151359133; + values[valuesById[402125072] = "IN_USE_ADDRESSES"] = 402125072; + values[valuesById[32786705] = "IN_USE_BACKUP_SCHEDULES"] = 32786705; + values[valuesById[462104083] = "IN_USE_SNAPSHOT_SCHEDULES"] = 462104083; + values[valuesById[330878021] = "LOCAL_SSD_TOTAL_GB"] = 330878021; + values[valuesById[37203366] = "M1_CPUS"] = 37203366; + values[valuesById[65832517] = "M2_CPUS"] = 65832517; + values[valuesById[446986640] = "MACHINE_IMAGES"] = 446986640; + values[valuesById[265855917] = "N2A_CPUS"] = 265855917; + values[valuesById[351743370] = "N2D_CPUS"] = 351743370; + values[valuesById[416465286] = "N2_CPUS"] = 416465286; + values[valuesById[485481477] = "NETWORKS"] = 485481477; + values[valuesById[102144909] = "NETWORK_ENDPOINT_GROUPS"] = 102144909; + values[valuesById[101117374] = "NETWORK_FIREWALL_POLICIES"] = 101117374; + values[valuesById[24624817] = "NODE_GROUPS"] = 24624817; + values[valuesById[474896668] = "NODE_TEMPLATES"] = 474896668; + values[valuesById[504872978] = "NVIDIA_A100_GPUS"] = 504872978; + values[valuesById[163886599] = "NVIDIA_K80_GPUS"] = 163886599; + values[valuesById[236601633] = "NVIDIA_P100_GPUS"] = 236601633; + values[valuesById[213970574] = "NVIDIA_P100_VWS_GPUS"] = 213970574; + values[valuesById[283841470] = "NVIDIA_P4_GPUS"] = 283841470; + values[valuesById[528296619] = "NVIDIA_P4_VWS_GPUS"] = 528296619; + values[valuesById[75759810] = "NVIDIA_T4_GPUS"] = 75759810; + values[valuesById[319813039] = "NVIDIA_T4_VWS_GPUS"] = 319813039; + values[valuesById[129293095] = "NVIDIA_V100_GPUS"] = 129293095; + values[valuesById[15578407] = "PACKET_MIRRORINGS"] = 15578407; + values[valuesById[69593965] = "PD_EXTREME_TOTAL_PROVISIONED_IOPS"] = 69593965; + values[valuesById[251184841] = "PREEMPTIBLE_CPUS"] = 251184841; + values[valuesById[260819336] = "PREEMPTIBLE_LOCAL_SSD_GB"] = 260819336; + values[valuesById[68832784] = "PREEMPTIBLE_NVIDIA_A100_GPUS"] = 68832784; + values[valuesById[374960201] = "PREEMPTIBLE_NVIDIA_K80_GPUS"] = 374960201; + values[valuesById[337432351] = "PREEMPTIBLE_NVIDIA_P100_GPUS"] = 337432351; + values[valuesById[313544076] = "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS"] = 313544076; + values[valuesById[429197628] = "PREEMPTIBLE_NVIDIA_P4_GPUS"] = 429197628; + values[valuesById[252981545] = "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS"] = 252981545; + values[valuesById[221115968] = "PREEMPTIBLE_NVIDIA_T4_GPUS"] = 221115968; + values[valuesById[44497965] = "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS"] = 44497965; + values[valuesById[230123813] = "PREEMPTIBLE_NVIDIA_V100_GPUS"] = 230123813; + values[valuesById[231164291] = "PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK"] = 231164291; + values[valuesById[471371980] = "PUBLIC_ADVERTISED_PREFIXES"] = 471371980; + values[valuesById[532465974] = "PUBLIC_DELEGATED_PREFIXES"] = 532465974; + values[valuesById[29363772] = "REGIONAL_AUTOSCALERS"] = 29363772; + values[valuesById[37543696] = "REGIONAL_INSTANCE_GROUP_MANAGERS"] = 37543696; + values[valuesById[32644647] = "RESERVATIONS"] = 32644647; + values[valuesById[83955297] = "RESOURCE_POLICIES"] = 83955297; + values[valuesById[493018666] = "ROUTERS"] = 493018666; + values[valuesById[275680074] = "ROUTES"] = 275680074; + values[valuesById[189518703] = "SECURITY_POLICIES"] = 189518703; + values[valuesById[470815689] = "SECURITY_POLICY_CEVAL_RULES"] = 470815689; + values[valuesById[203549225] = "SECURITY_POLICY_RULES"] = 203549225; + values[valuesById[343405327] = "SNAPSHOTS"] = 343405327; + values[valuesById[161732561] = "SSD_TOTAL_GB"] = 161732561; + values[valuesById[378372399] = "SSL_CERTIFICATES"] = 378372399; + values[valuesById[93624049] = "STATIC_ADDRESSES"] = 93624049; + values[valuesById[275809649] = "STATIC_BYOIP_ADDRESSES"] = 275809649; + values[valuesById[421330469] = "SUBNETWORKS"] = 421330469; + values[valuesById[219522506] = "TARGET_HTTPS_PROXIES"] = 219522506; + values[valuesById[164117155] = "TARGET_HTTP_PROXIES"] = 164117155; + values[valuesById[284519728] = "TARGET_INSTANCES"] = 284519728; + values[valuesById[348261257] = "TARGET_POOLS"] = 348261257; + values[valuesById[159216235] = "TARGET_SSL_PROXIES"] = 159216235; + values[valuesById[182243136] = "TARGET_TCP_PROXIES"] = 182243136; + values[valuesById[75029928] = "TARGET_VPN_GATEWAYS"] = 75029928; + values[valuesById[378660743] = "URL_MAPS"] = 378660743; + values[valuesById[35620282] = "VPN_GATEWAYS"] = 35620282; + values[valuesById[104327296] = "VPN_TUNNELS"] = 104327296; + values[valuesById[95191981] = "XPN_SERVICE_PROJECTS"] = 95191981; + return values; + })(); + + return Quota; + })(); + + v1.UsageExportLocation = (function() { + + /** + * Properties of a UsageExportLocation. + * @memberof google.cloud.compute.v1 + * @interface IUsageExportLocation + * @property {string|null} [bucketName] UsageExportLocation bucketName + * @property {string|null} [reportNamePrefix] UsageExportLocation reportNamePrefix + */ + + /** + * Constructs a new UsageExportLocation. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a UsageExportLocation. + * @implements IUsageExportLocation + * @constructor + * @param {google.cloud.compute.v1.IUsageExportLocation=} [properties] Properties to set + */ + function UsageExportLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageExportLocation bucketName. + * @member {string|null|undefined} bucketName + * @memberof google.cloud.compute.v1.UsageExportLocation + * @instance + */ + UsageExportLocation.prototype.bucketName = null; + + /** + * UsageExportLocation reportNamePrefix. + * @member {string|null|undefined} reportNamePrefix + * @memberof google.cloud.compute.v1.UsageExportLocation + * @instance + */ + UsageExportLocation.prototype.reportNamePrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UsageExportLocation _bucketName. + * @member {"bucketName"|undefined} _bucketName + * @memberof google.cloud.compute.v1.UsageExportLocation + * @instance + */ + Object.defineProperty(UsageExportLocation.prototype, "_bucketName", { + get: $util.oneOfGetter($oneOfFields = ["bucketName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsageExportLocation _reportNamePrefix. + * @member {"reportNamePrefix"|undefined} _reportNamePrefix + * @memberof google.cloud.compute.v1.UsageExportLocation + * @instance + */ + Object.defineProperty(UsageExportLocation.prototype, "_reportNamePrefix", { + get: $util.oneOfGetter($oneOfFields = ["reportNamePrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UsageExportLocation instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {google.cloud.compute.v1.IUsageExportLocation=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UsageExportLocation} UsageExportLocation instance + */ + UsageExportLocation.create = function create(properties) { + return new UsageExportLocation(properties); + }; + + /** + * Encodes the specified UsageExportLocation message. Does not implicitly {@link google.cloud.compute.v1.UsageExportLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {google.cloud.compute.v1.IUsageExportLocation} message UsageExportLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageExportLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bucketName != null && Object.hasOwnProperty.call(message, "bucketName")) + writer.uint32(/* id 283610048, wireType 2 =*/2268880386).string(message.bucketName); + if (message.reportNamePrefix != null && Object.hasOwnProperty.call(message, "reportNamePrefix")) + writer.uint32(/* id 320198715, wireType 2 =*/2561589722).string(message.reportNamePrefix); + return writer; + }; + + /** + * Encodes the specified UsageExportLocation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsageExportLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {google.cloud.compute.v1.IUsageExportLocation} message UsageExportLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageExportLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageExportLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UsageExportLocation} UsageExportLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageExportLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UsageExportLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 283610048: + message.bucketName = reader.string(); + break; + case 320198715: + message.reportNamePrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageExportLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UsageExportLocation} UsageExportLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageExportLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageExportLocation message. + * @function verify + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageExportLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) { + properties._bucketName = 1; + if (!$util.isString(message.bucketName)) + return "bucketName: string expected"; + } + if (message.reportNamePrefix != null && message.hasOwnProperty("reportNamePrefix")) { + properties._reportNamePrefix = 1; + if (!$util.isString(message.reportNamePrefix)) + return "reportNamePrefix: string expected"; + } + return null; + }; + + /** + * Creates a UsageExportLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UsageExportLocation} UsageExportLocation + */ + UsageExportLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UsageExportLocation) + return object; + var message = new $root.google.cloud.compute.v1.UsageExportLocation(); + if (object.bucketName != null) + message.bucketName = String(object.bucketName); + if (object.reportNamePrefix != null) + message.reportNamePrefix = String(object.reportNamePrefix); + return message; + }; + + /** + * Creates a plain object from a UsageExportLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UsageExportLocation + * @static + * @param {google.cloud.compute.v1.UsageExportLocation} message UsageExportLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageExportLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.bucketName != null && message.hasOwnProperty("bucketName")) { + object.bucketName = message.bucketName; + if (options.oneofs) + object._bucketName = "bucketName"; + } + if (message.reportNamePrefix != null && message.hasOwnProperty("reportNamePrefix")) { + object.reportNamePrefix = message.reportNamePrefix; + if (options.oneofs) + object._reportNamePrefix = "reportNamePrefix"; + } + return object; + }; + + /** + * Converts this UsageExportLocation to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UsageExportLocation + * @instance + * @returns {Object.} JSON object + */ + UsageExportLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UsageExportLocation; + })(); + + v1.Project = (function() { + + /** + * Properties of a Project. + * @memberof google.cloud.compute.v1 + * @interface IProject + * @property {google.cloud.compute.v1.IMetadata|null} [commonInstanceMetadata] Project commonInstanceMetadata + * @property {string|null} [creationTimestamp] Project creationTimestamp + * @property {google.cloud.compute.v1.Project.DefaultNetworkTier|null} [defaultNetworkTier] Project defaultNetworkTier + * @property {string|null} [defaultServiceAccount] Project defaultServiceAccount + * @property {string|null} [description] Project description + * @property {Array.|null} [enabledFeatures] Project enabledFeatures + * @property {number|Long|null} [id] Project id + * @property {string|null} [kind] Project kind + * @property {string|null} [name] Project name + * @property {Array.|null} [quotas] Project quotas + * @property {string|null} [selfLink] Project selfLink + * @property {google.cloud.compute.v1.IUsageExportLocation|null} [usageExportLocation] Project usageExportLocation + * @property {google.cloud.compute.v1.Project.XpnProjectStatus|null} [xpnProjectStatus] Project xpnProjectStatus + */ + + /** + * Constructs a new Project. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Project. + * @implements IProject + * @constructor + * @param {google.cloud.compute.v1.IProject=} [properties] Properties to set + */ + function Project(properties) { + this.enabledFeatures = []; + this.quotas = []; + if (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 commonInstanceMetadata. + * @member {google.cloud.compute.v1.IMetadata|null|undefined} commonInstanceMetadata + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.commonInstanceMetadata = null; + + /** + * Project creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.creationTimestamp = null; + + /** + * Project defaultNetworkTier. + * @member {google.cloud.compute.v1.Project.DefaultNetworkTier|null|undefined} defaultNetworkTier + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.defaultNetworkTier = null; + + /** + * Project defaultServiceAccount. + * @member {string|null|undefined} defaultServiceAccount + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.defaultServiceAccount = null; + + /** + * Project description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.description = null; + + /** + * Project enabledFeatures. + * @member {Array.} enabledFeatures + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.enabledFeatures = $util.emptyArray; + + /** + * Project id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.id = null; + + /** + * Project kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.kind = null; + + /** + * Project name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.name = null; + + /** + * Project quotas. + * @member {Array.} quotas + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.quotas = $util.emptyArray; + + /** + * Project selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.selfLink = null; + + /** + * Project usageExportLocation. + * @member {google.cloud.compute.v1.IUsageExportLocation|null|undefined} usageExportLocation + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.usageExportLocation = null; + + /** + * Project xpnProjectStatus. + * @member {google.cloud.compute.v1.Project.XpnProjectStatus|null|undefined} xpnProjectStatus + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Project.prototype.xpnProjectStatus = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Project _commonInstanceMetadata. + * @member {"commonInstanceMetadata"|undefined} _commonInstanceMetadata + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_commonInstanceMetadata", { + get: $util.oneOfGetter($oneOfFields = ["commonInstanceMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _defaultNetworkTier. + * @member {"defaultNetworkTier"|undefined} _defaultNetworkTier + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_defaultNetworkTier", { + get: $util.oneOfGetter($oneOfFields = ["defaultNetworkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _defaultServiceAccount. + * @member {"defaultServiceAccount"|undefined} _defaultServiceAccount + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_defaultServiceAccount", { + get: $util.oneOfGetter($oneOfFields = ["defaultServiceAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _usageExportLocation. + * @member {"usageExportLocation"|undefined} _usageExportLocation + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_usageExportLocation", { + get: $util.oneOfGetter($oneOfFields = ["usageExportLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Project _xpnProjectStatus. + * @member {"xpnProjectStatus"|undefined} _xpnProjectStatus + * @memberof google.cloud.compute.v1.Project + * @instance + */ + Object.defineProperty(Project.prototype, "_xpnProjectStatus", { + get: $util.oneOfGetter($oneOfFields = ["xpnProjectStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Project instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Project + * @static + * @param {google.cloud.compute.v1.IProject=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Project} Project instance + */ + Project.create = function create(properties) { + return new Project(properties); + }; + + /** + * Encodes the specified Project message. Does not implicitly {@link google.cloud.compute.v1.Project.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Project + * @static + * @param {google.cloud.compute.v1.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.quotas != null && message.quotas.length) + for (var i = 0; i < message.quotas.length; ++i) + $root.google.cloud.compute.v1.Quota.encode(message.quotas[i], writer.uint32(/* id 125341947, wireType 2 =*/1002735578).fork()).ldelim(); + if (message.commonInstanceMetadata != null && Object.hasOwnProperty.call(message, "commonInstanceMetadata")) + $root.google.cloud.compute.v1.Metadata.encode(message.commonInstanceMetadata, writer.uint32(/* id 185794117, wireType 2 =*/1486352938).fork()).ldelim(); + if (message.xpnProjectStatus != null && Object.hasOwnProperty.call(message, "xpnProjectStatus")) + writer.uint32(/* id 228419265, wireType 0 =*/1827354120).int32(message.xpnProjectStatus); + if (message.defaultServiceAccount != null && Object.hasOwnProperty.call(message, "defaultServiceAccount")) + writer.uint32(/* id 298712229, wireType 2 =*/2389697834).string(message.defaultServiceAccount); + if (message.usageExportLocation != null && Object.hasOwnProperty.call(message, "usageExportLocation")) + $root.google.cloud.compute.v1.UsageExportLocation.encode(message.usageExportLocation, writer.uint32(/* id 347543874, wireType 2 =*/2780350994).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.enabledFeatures != null && message.enabledFeatures.length) + for (var i = 0; i < message.enabledFeatures.length; ++i) + writer.uint32(/* id 469017467, wireType 2 =*/3752139738).string(message.enabledFeatures[i]); + if (message.defaultNetworkTier != null && Object.hasOwnProperty.call(message, "defaultNetworkTier")) + writer.uint32(/* id 471753361, wireType 0 =*/3774026888).int32(message.defaultNetworkTier); + return writer; + }; + + /** + * Encodes the specified Project message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Project.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Project + * @static + * @param {google.cloud.compute.v1.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.compute.v1.Project + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.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.compute.v1.Project(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 185794117: + message.commonInstanceMetadata = $root.google.cloud.compute.v1.Metadata.decode(reader, reader.uint32()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 471753361: + message.defaultNetworkTier = reader.int32(); + break; + case 298712229: + message.defaultServiceAccount = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 469017467: + if (!(message.enabledFeatures && message.enabledFeatures.length)) + message.enabledFeatures = []; + message.enabledFeatures.push(reader.string()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 125341947: + if (!(message.quotas && message.quotas.length)) + message.quotas = []; + message.quotas.push($root.google.cloud.compute.v1.Quota.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 347543874: + message.usageExportLocation = $root.google.cloud.compute.v1.UsageExportLocation.decode(reader, reader.uint32()); + break; + case 228419265: + message.xpnProjectStatus = reader.int32(); + 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.compute.v1.Project + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.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.compute.v1.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"; + var properties = {}; + if (message.commonInstanceMetadata != null && message.hasOwnProperty("commonInstanceMetadata")) { + properties._commonInstanceMetadata = 1; + { + var error = $root.google.cloud.compute.v1.Metadata.verify(message.commonInstanceMetadata); + if (error) + return "commonInstanceMetadata." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.defaultNetworkTier != null && message.hasOwnProperty("defaultNetworkTier")) { + properties._defaultNetworkTier = 1; + switch (message.defaultNetworkTier) { + default: + return "defaultNetworkTier: enum value expected"; + case 0: + case 399530551: + case 484642493: + break; + } + } + if (message.defaultServiceAccount != null && message.hasOwnProperty("defaultServiceAccount")) { + properties._defaultServiceAccount = 1; + if (!$util.isString(message.defaultServiceAccount)) + return "defaultServiceAccount: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.enabledFeatures != null && message.hasOwnProperty("enabledFeatures")) { + if (!Array.isArray(message.enabledFeatures)) + return "enabledFeatures: array expected"; + for (var i = 0; i < message.enabledFeatures.length; ++i) + if (!$util.isString(message.enabledFeatures[i])) + return "enabledFeatures: string[] expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.quotas != null && message.hasOwnProperty("quotas")) { + if (!Array.isArray(message.quotas)) + return "quotas: array expected"; + for (var i = 0; i < message.quotas.length; ++i) { + var error = $root.google.cloud.compute.v1.Quota.verify(message.quotas[i]); + if (error) + return "quotas." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.usageExportLocation != null && message.hasOwnProperty("usageExportLocation")) { + properties._usageExportLocation = 1; + { + var error = $root.google.cloud.compute.v1.UsageExportLocation.verify(message.usageExportLocation); + if (error) + return "usageExportLocation." + error; + } + } + if (message.xpnProjectStatus != null && message.hasOwnProperty("xpnProjectStatus")) { + properties._xpnProjectStatus = 1; + switch (message.xpnProjectStatus) { + default: + return "xpnProjectStatus: enum value expected"; + case 0: + case 2223528: + case 340393257: + break; + } + } + return null; + }; + + /** + * Creates a Project message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Project + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Project} Project + */ + Project.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Project) + return object; + var message = new $root.google.cloud.compute.v1.Project(); + if (object.commonInstanceMetadata != null) { + if (typeof object.commonInstanceMetadata !== "object") + throw TypeError(".google.cloud.compute.v1.Project.commonInstanceMetadata: object expected"); + message.commonInstanceMetadata = $root.google.cloud.compute.v1.Metadata.fromObject(object.commonInstanceMetadata); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + switch (object.defaultNetworkTier) { + case "UNDEFINED_DEFAULT_NETWORK_TIER": + case 0: + message.defaultNetworkTier = 0; + break; + case "PREMIUM": + case 399530551: + message.defaultNetworkTier = 399530551; + break; + case "STANDARD": + case 484642493: + message.defaultNetworkTier = 484642493; + break; + } + if (object.defaultServiceAccount != null) + message.defaultServiceAccount = String(object.defaultServiceAccount); + if (object.description != null) + message.description = String(object.description); + if (object.enabledFeatures) { + if (!Array.isArray(object.enabledFeatures)) + throw TypeError(".google.cloud.compute.v1.Project.enabledFeatures: array expected"); + message.enabledFeatures = []; + for (var i = 0; i < object.enabledFeatures.length; ++i) + message.enabledFeatures[i] = String(object.enabledFeatures[i]); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.quotas) { + if (!Array.isArray(object.quotas)) + throw TypeError(".google.cloud.compute.v1.Project.quotas: array expected"); + message.quotas = []; + for (var i = 0; i < object.quotas.length; ++i) { + if (typeof object.quotas[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Project.quotas: object expected"); + message.quotas[i] = $root.google.cloud.compute.v1.Quota.fromObject(object.quotas[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.usageExportLocation != null) { + if (typeof object.usageExportLocation !== "object") + throw TypeError(".google.cloud.compute.v1.Project.usageExportLocation: object expected"); + message.usageExportLocation = $root.google.cloud.compute.v1.UsageExportLocation.fromObject(object.usageExportLocation); + } + switch (object.xpnProjectStatus) { + case "UNDEFINED_XPN_PROJECT_STATUS": + case 0: + message.xpnProjectStatus = 0; + break; + case "HOST": + case 2223528: + message.xpnProjectStatus = 2223528; + break; + case "UNSPECIFIED_XPN_PROJECT_STATUS": + case 340393257: + message.xpnProjectStatus = 340393257; + break; + } + return message; + }; + + /** + * Creates a plain object from a Project message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Project + * @static + * @param {google.cloud.compute.v1.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.arrays || options.defaults) { + object.quotas = []; + object.enabledFeatures = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.quotas && message.quotas.length) { + object.quotas = []; + for (var j = 0; j < message.quotas.length; ++j) + object.quotas[j] = $root.google.cloud.compute.v1.Quota.toObject(message.quotas[j], options); + } + if (message.commonInstanceMetadata != null && message.hasOwnProperty("commonInstanceMetadata")) { + object.commonInstanceMetadata = $root.google.cloud.compute.v1.Metadata.toObject(message.commonInstanceMetadata, options); + if (options.oneofs) + object._commonInstanceMetadata = "commonInstanceMetadata"; + } + if (message.xpnProjectStatus != null && message.hasOwnProperty("xpnProjectStatus")) { + object.xpnProjectStatus = options.enums === String ? $root.google.cloud.compute.v1.Project.XpnProjectStatus[message.xpnProjectStatus] : message.xpnProjectStatus; + if (options.oneofs) + object._xpnProjectStatus = "xpnProjectStatus"; + } + if (message.defaultServiceAccount != null && message.hasOwnProperty("defaultServiceAccount")) { + object.defaultServiceAccount = message.defaultServiceAccount; + if (options.oneofs) + object._defaultServiceAccount = "defaultServiceAccount"; + } + if (message.usageExportLocation != null && message.hasOwnProperty("usageExportLocation")) { + object.usageExportLocation = $root.google.cloud.compute.v1.UsageExportLocation.toObject(message.usageExportLocation, options); + if (options.oneofs) + object._usageExportLocation = "usageExportLocation"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.enabledFeatures && message.enabledFeatures.length) { + object.enabledFeatures = []; + for (var j = 0; j < message.enabledFeatures.length; ++j) + object.enabledFeatures[j] = message.enabledFeatures[j]; + } + if (message.defaultNetworkTier != null && message.hasOwnProperty("defaultNetworkTier")) { + object.defaultNetworkTier = options.enums === String ? $root.google.cloud.compute.v1.Project.DefaultNetworkTier[message.defaultNetworkTier] : message.defaultNetworkTier; + if (options.oneofs) + object._defaultNetworkTier = "defaultNetworkTier"; + } + return object; + }; + + /** + * Converts this Project to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Project + * @instance + * @returns {Object.} JSON object + */ + Project.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * DefaultNetworkTier enum. + * @name google.cloud.compute.v1.Project.DefaultNetworkTier + * @enum {number} + * @property {number} UNDEFINED_DEFAULT_NETWORK_TIER=0 UNDEFINED_DEFAULT_NETWORK_TIER value + * @property {number} PREMIUM=399530551 PREMIUM value + * @property {number} STANDARD=484642493 STANDARD value + */ + Project.DefaultNetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_DEFAULT_NETWORK_TIER"] = 0; + values[valuesById[399530551] = "PREMIUM"] = 399530551; + values[valuesById[484642493] = "STANDARD"] = 484642493; + return values; + })(); + + /** + * XpnProjectStatus enum. + * @name google.cloud.compute.v1.Project.XpnProjectStatus + * @enum {number} + * @property {number} UNDEFINED_XPN_PROJECT_STATUS=0 UNDEFINED_XPN_PROJECT_STATUS value + * @property {number} HOST=2223528 HOST value + * @property {number} UNSPECIFIED_XPN_PROJECT_STATUS=340393257 UNSPECIFIED_XPN_PROJECT_STATUS value + */ + Project.XpnProjectStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_XPN_PROJECT_STATUS"] = 0; + values[valuesById[2223528] = "HOST"] = 2223528; + values[valuesById[340393257] = "UNSPECIFIED_XPN_PROJECT_STATUS"] = 340393257; + return values; + })(); + + return Project; + })(); + + v1.XpnResourceId = (function() { + + /** + * Properties of a XpnResourceId. + * @memberof google.cloud.compute.v1 + * @interface IXpnResourceId + * @property {string|null} [id] XpnResourceId id + * @property {google.cloud.compute.v1.XpnResourceId.Type|null} [type] XpnResourceId type + */ + + /** + * Constructs a new XpnResourceId. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a XpnResourceId. + * @implements IXpnResourceId + * @constructor + * @param {google.cloud.compute.v1.IXpnResourceId=} [properties] Properties to set + */ + function XpnResourceId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * XpnResourceId id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.XpnResourceId + * @instance + */ + XpnResourceId.prototype.id = null; + + /** + * XpnResourceId type. + * @member {google.cloud.compute.v1.XpnResourceId.Type|null|undefined} type + * @memberof google.cloud.compute.v1.XpnResourceId + * @instance + */ + XpnResourceId.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * XpnResourceId _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.XpnResourceId + * @instance + */ + Object.defineProperty(XpnResourceId.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * XpnResourceId _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.XpnResourceId + * @instance + */ + Object.defineProperty(XpnResourceId.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new XpnResourceId instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {google.cloud.compute.v1.IXpnResourceId=} [properties] Properties to set + * @returns {google.cloud.compute.v1.XpnResourceId} XpnResourceId instance + */ + XpnResourceId.create = function create(properties) { + return new XpnResourceId(properties); + }; + + /** + * Encodes the specified XpnResourceId message. Does not implicitly {@link google.cloud.compute.v1.XpnResourceId.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {google.cloud.compute.v1.IXpnResourceId} message XpnResourceId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XpnResourceId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + return writer; + }; + + /** + * Encodes the specified XpnResourceId message, length delimited. Does not implicitly {@link google.cloud.compute.v1.XpnResourceId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {google.cloud.compute.v1.IXpnResourceId} message XpnResourceId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XpnResourceId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a XpnResourceId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.XpnResourceId} XpnResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XpnResourceId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.XpnResourceId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a XpnResourceId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.XpnResourceId} XpnResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XpnResourceId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a XpnResourceId message. + * @function verify + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + XpnResourceId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 408671993: + case 151607034: + break; + } + } + return null; + }; + + /** + * Creates a XpnResourceId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.XpnResourceId} XpnResourceId + */ + XpnResourceId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.XpnResourceId) + return object; + var message = new $root.google.cloud.compute.v1.XpnResourceId(); + if (object.id != null) + message.id = String(object.id); + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "PROJECT": + case 408671993: + message.type = 408671993; + break; + case "XPN_RESOURCE_TYPE_UNSPECIFIED": + case 151607034: + message.type = 151607034; + break; + } + return message; + }; + + /** + * Creates a plain object from a XpnResourceId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.XpnResourceId + * @static + * @param {google.cloud.compute.v1.XpnResourceId} message XpnResourceId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + XpnResourceId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.XpnResourceId.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this XpnResourceId to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.XpnResourceId + * @instance + * @returns {Object.} JSON object + */ + XpnResourceId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.XpnResourceId.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} PROJECT=408671993 PROJECT value + * @property {number} XPN_RESOURCE_TYPE_UNSPECIFIED=151607034 XPN_RESOURCE_TYPE_UNSPECIFIED value + */ + XpnResourceId.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[408671993] = "PROJECT"] = 408671993; + values[valuesById[151607034] = "XPN_RESOURCE_TYPE_UNSPECIFIED"] = 151607034; + return values; + })(); + + return XpnResourceId; + })(); + + v1.ProjectsDisableXpnResourceRequest = (function() { + + /** + * Properties of a ProjectsDisableXpnResourceRequest. + * @memberof google.cloud.compute.v1 + * @interface IProjectsDisableXpnResourceRequest + * @property {google.cloud.compute.v1.IXpnResourceId|null} [xpnResource] ProjectsDisableXpnResourceRequest xpnResource + */ + + /** + * Constructs a new ProjectsDisableXpnResourceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ProjectsDisableXpnResourceRequest. + * @implements IProjectsDisableXpnResourceRequest + * @constructor + * @param {google.cloud.compute.v1.IProjectsDisableXpnResourceRequest=} [properties] Properties to set + */ + function ProjectsDisableXpnResourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProjectsDisableXpnResourceRequest xpnResource. + * @member {google.cloud.compute.v1.IXpnResourceId|null|undefined} xpnResource + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @instance + */ + ProjectsDisableXpnResourceRequest.prototype.xpnResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProjectsDisableXpnResourceRequest _xpnResource. + * @member {"xpnResource"|undefined} _xpnResource + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @instance + */ + Object.defineProperty(ProjectsDisableXpnResourceRequest.prototype, "_xpnResource", { + get: $util.oneOfGetter($oneOfFields = ["xpnResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProjectsDisableXpnResourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.IProjectsDisableXpnResourceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ProjectsDisableXpnResourceRequest} ProjectsDisableXpnResourceRequest instance + */ + ProjectsDisableXpnResourceRequest.create = function create(properties) { + return new ProjectsDisableXpnResourceRequest(properties); + }; + + /** + * Encodes the specified ProjectsDisableXpnResourceRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.IProjectsDisableXpnResourceRequest} message ProjectsDisableXpnResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsDisableXpnResourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpnResource != null && Object.hasOwnProperty.call(message, "xpnResource")) + $root.google.cloud.compute.v1.XpnResourceId.encode(message.xpnResource, writer.uint32(/* id 133384631, wireType 2 =*/1067077050).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProjectsDisableXpnResourceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.IProjectsDisableXpnResourceRequest} message ProjectsDisableXpnResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsDisableXpnResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProjectsDisableXpnResourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ProjectsDisableXpnResourceRequest} ProjectsDisableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsDisableXpnResourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 133384631: + message.xpnResource = $root.google.cloud.compute.v1.XpnResourceId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProjectsDisableXpnResourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ProjectsDisableXpnResourceRequest} ProjectsDisableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsDisableXpnResourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProjectsDisableXpnResourceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProjectsDisableXpnResourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.xpnResource != null && message.hasOwnProperty("xpnResource")) { + properties._xpnResource = 1; + { + var error = $root.google.cloud.compute.v1.XpnResourceId.verify(message.xpnResource); + if (error) + return "xpnResource." + error; + } + } + return null; + }; + + /** + * Creates a ProjectsDisableXpnResourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ProjectsDisableXpnResourceRequest} ProjectsDisableXpnResourceRequest + */ + ProjectsDisableXpnResourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest) + return object; + var message = new $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest(); + if (object.xpnResource != null) { + if (typeof object.xpnResource !== "object") + throw TypeError(".google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.xpnResource: object expected"); + message.xpnResource = $root.google.cloud.compute.v1.XpnResourceId.fromObject(object.xpnResource); + } + return message; + }; + + /** + * Creates a plain object from a ProjectsDisableXpnResourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.ProjectsDisableXpnResourceRequest} message ProjectsDisableXpnResourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProjectsDisableXpnResourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.xpnResource != null && message.hasOwnProperty("xpnResource")) { + object.xpnResource = $root.google.cloud.compute.v1.XpnResourceId.toObject(message.xpnResource, options); + if (options.oneofs) + object._xpnResource = "xpnResource"; + } + return object; + }; + + /** + * Converts this ProjectsDisableXpnResourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ProjectsDisableXpnResourceRequest + * @instance + * @returns {Object.} JSON object + */ + ProjectsDisableXpnResourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProjectsDisableXpnResourceRequest; + })(); + + v1.ProjectsEnableXpnResourceRequest = (function() { + + /** + * Properties of a ProjectsEnableXpnResourceRequest. + * @memberof google.cloud.compute.v1 + * @interface IProjectsEnableXpnResourceRequest + * @property {google.cloud.compute.v1.IXpnResourceId|null} [xpnResource] ProjectsEnableXpnResourceRequest xpnResource + */ + + /** + * Constructs a new ProjectsEnableXpnResourceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ProjectsEnableXpnResourceRequest. + * @implements IProjectsEnableXpnResourceRequest + * @constructor + * @param {google.cloud.compute.v1.IProjectsEnableXpnResourceRequest=} [properties] Properties to set + */ + function ProjectsEnableXpnResourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProjectsEnableXpnResourceRequest xpnResource. + * @member {google.cloud.compute.v1.IXpnResourceId|null|undefined} xpnResource + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @instance + */ + ProjectsEnableXpnResourceRequest.prototype.xpnResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProjectsEnableXpnResourceRequest _xpnResource. + * @member {"xpnResource"|undefined} _xpnResource + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @instance + */ + Object.defineProperty(ProjectsEnableXpnResourceRequest.prototype, "_xpnResource", { + get: $util.oneOfGetter($oneOfFields = ["xpnResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProjectsEnableXpnResourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.IProjectsEnableXpnResourceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ProjectsEnableXpnResourceRequest} ProjectsEnableXpnResourceRequest instance + */ + ProjectsEnableXpnResourceRequest.create = function create(properties) { + return new ProjectsEnableXpnResourceRequest(properties); + }; + + /** + * Encodes the specified ProjectsEnableXpnResourceRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.IProjectsEnableXpnResourceRequest} message ProjectsEnableXpnResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsEnableXpnResourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpnResource != null && Object.hasOwnProperty.call(message, "xpnResource")) + $root.google.cloud.compute.v1.XpnResourceId.encode(message.xpnResource, writer.uint32(/* id 133384631, wireType 2 =*/1067077050).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProjectsEnableXpnResourceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.IProjectsEnableXpnResourceRequest} message ProjectsEnableXpnResourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsEnableXpnResourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProjectsEnableXpnResourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ProjectsEnableXpnResourceRequest} ProjectsEnableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsEnableXpnResourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 133384631: + message.xpnResource = $root.google.cloud.compute.v1.XpnResourceId.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProjectsEnableXpnResourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ProjectsEnableXpnResourceRequest} ProjectsEnableXpnResourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsEnableXpnResourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProjectsEnableXpnResourceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProjectsEnableXpnResourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.xpnResource != null && message.hasOwnProperty("xpnResource")) { + properties._xpnResource = 1; + { + var error = $root.google.cloud.compute.v1.XpnResourceId.verify(message.xpnResource); + if (error) + return "xpnResource." + error; + } + } + return null; + }; + + /** + * Creates a ProjectsEnableXpnResourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ProjectsEnableXpnResourceRequest} ProjectsEnableXpnResourceRequest + */ + ProjectsEnableXpnResourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest) + return object; + var message = new $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest(); + if (object.xpnResource != null) { + if (typeof object.xpnResource !== "object") + throw TypeError(".google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.xpnResource: object expected"); + message.xpnResource = $root.google.cloud.compute.v1.XpnResourceId.fromObject(object.xpnResource); + } + return message; + }; + + /** + * Creates a plain object from a ProjectsEnableXpnResourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @static + * @param {google.cloud.compute.v1.ProjectsEnableXpnResourceRequest} message ProjectsEnableXpnResourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProjectsEnableXpnResourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.xpnResource != null && message.hasOwnProperty("xpnResource")) { + object.xpnResource = $root.google.cloud.compute.v1.XpnResourceId.toObject(message.xpnResource, options); + if (options.oneofs) + object._xpnResource = "xpnResource"; + } + return object; + }; + + /** + * Converts this ProjectsEnableXpnResourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ProjectsEnableXpnResourceRequest + * @instance + * @returns {Object.} JSON object + */ + ProjectsEnableXpnResourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProjectsEnableXpnResourceRequest; + })(); + + v1.ProjectsGetXpnResources = (function() { + + /** + * Properties of a ProjectsGetXpnResources. + * @memberof google.cloud.compute.v1 + * @interface IProjectsGetXpnResources + * @property {string|null} [kind] ProjectsGetXpnResources kind + * @property {string|null} [nextPageToken] ProjectsGetXpnResources nextPageToken + * @property {Array.|null} [resources] ProjectsGetXpnResources resources + */ + + /** + * Constructs a new ProjectsGetXpnResources. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ProjectsGetXpnResources. + * @implements IProjectsGetXpnResources + * @constructor + * @param {google.cloud.compute.v1.IProjectsGetXpnResources=} [properties] Properties to set + */ + function ProjectsGetXpnResources(properties) { + this.resources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProjectsGetXpnResources kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @instance + */ + ProjectsGetXpnResources.prototype.kind = null; + + /** + * ProjectsGetXpnResources nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @instance + */ + ProjectsGetXpnResources.prototype.nextPageToken = null; + + /** + * ProjectsGetXpnResources resources. + * @member {Array.} resources + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @instance + */ + ProjectsGetXpnResources.prototype.resources = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProjectsGetXpnResources _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @instance + */ + Object.defineProperty(ProjectsGetXpnResources.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ProjectsGetXpnResources _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @instance + */ + Object.defineProperty(ProjectsGetXpnResources.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProjectsGetXpnResources instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {google.cloud.compute.v1.IProjectsGetXpnResources=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ProjectsGetXpnResources} ProjectsGetXpnResources instance + */ + ProjectsGetXpnResources.create = function create(properties) { + return new ProjectsGetXpnResources(properties); + }; + + /** + * Encodes the specified ProjectsGetXpnResources message. Does not implicitly {@link google.cloud.compute.v1.ProjectsGetXpnResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {google.cloud.compute.v1.IProjectsGetXpnResources} message ProjectsGetXpnResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsGetXpnResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + $root.google.cloud.compute.v1.XpnResourceId.encode(message.resources[i], writer.uint32(/* id 164412965, wireType 2 =*/1315303722).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProjectsGetXpnResources message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsGetXpnResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {google.cloud.compute.v1.IProjectsGetXpnResources} message ProjectsGetXpnResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsGetXpnResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProjectsGetXpnResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ProjectsGetXpnResources} ProjectsGetXpnResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsGetXpnResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ProjectsGetXpnResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 164412965: + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push($root.google.cloud.compute.v1.XpnResourceId.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProjectsGetXpnResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ProjectsGetXpnResources} ProjectsGetXpnResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsGetXpnResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProjectsGetXpnResources message. + * @function verify + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProjectsGetXpnResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string 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.compute.v1.XpnResourceId.verify(message.resources[i]); + if (error) + return "resources." + error; + } + } + return null; + }; + + /** + * Creates a ProjectsGetXpnResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ProjectsGetXpnResources} ProjectsGetXpnResources + */ + ProjectsGetXpnResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ProjectsGetXpnResources) + return object; + var message = new $root.google.cloud.compute.v1.ProjectsGetXpnResources(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.compute.v1.ProjectsGetXpnResources.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) { + if (typeof object.resources[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ProjectsGetXpnResources.resources: object expected"); + message.resources[i] = $root.google.cloud.compute.v1.XpnResourceId.fromObject(object.resources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ProjectsGetXpnResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @static + * @param {google.cloud.compute.v1.ProjectsGetXpnResources} message ProjectsGetXpnResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProjectsGetXpnResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resources = []; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.compute.v1.XpnResourceId.toObject(message.resources[j], options); + } + return object; + }; + + /** + * Converts this ProjectsGetXpnResources to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ProjectsGetXpnResources + * @instance + * @returns {Object.} JSON object + */ + ProjectsGetXpnResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProjectsGetXpnResources; + })(); + + v1.ProjectsListXpnHostsRequest = (function() { + + /** + * Properties of a ProjectsListXpnHostsRequest. + * @memberof google.cloud.compute.v1 + * @interface IProjectsListXpnHostsRequest + * @property {string|null} [organization] ProjectsListXpnHostsRequest organization + */ + + /** + * Constructs a new ProjectsListXpnHostsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ProjectsListXpnHostsRequest. + * @implements IProjectsListXpnHostsRequest + * @constructor + * @param {google.cloud.compute.v1.IProjectsListXpnHostsRequest=} [properties] Properties to set + */ + function ProjectsListXpnHostsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProjectsListXpnHostsRequest organization. + * @member {string|null|undefined} organization + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @instance + */ + ProjectsListXpnHostsRequest.prototype.organization = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProjectsListXpnHostsRequest _organization. + * @member {"organization"|undefined} _organization + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @instance + */ + Object.defineProperty(ProjectsListXpnHostsRequest.prototype, "_organization", { + get: $util.oneOfGetter($oneOfFields = ["organization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProjectsListXpnHostsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {google.cloud.compute.v1.IProjectsListXpnHostsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ProjectsListXpnHostsRequest} ProjectsListXpnHostsRequest instance + */ + ProjectsListXpnHostsRequest.create = function create(properties) { + return new ProjectsListXpnHostsRequest(properties); + }; + + /** + * Encodes the specified ProjectsListXpnHostsRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsListXpnHostsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {google.cloud.compute.v1.IProjectsListXpnHostsRequest} message ProjectsListXpnHostsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsListXpnHostsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 105180467, wireType 2 =*/841443738).string(message.organization); + return writer; + }; + + /** + * Encodes the specified ProjectsListXpnHostsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsListXpnHostsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {google.cloud.compute.v1.IProjectsListXpnHostsRequest} message ProjectsListXpnHostsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsListXpnHostsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProjectsListXpnHostsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ProjectsListXpnHostsRequest} ProjectsListXpnHostsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsListXpnHostsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 105180467: + message.organization = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProjectsListXpnHostsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ProjectsListXpnHostsRequest} ProjectsListXpnHostsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsListXpnHostsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProjectsListXpnHostsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProjectsListXpnHostsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.organization != null && message.hasOwnProperty("organization")) { + properties._organization = 1; + if (!$util.isString(message.organization)) + return "organization: string expected"; + } + return null; + }; + + /** + * Creates a ProjectsListXpnHostsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ProjectsListXpnHostsRequest} ProjectsListXpnHostsRequest + */ + ProjectsListXpnHostsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest(); + if (object.organization != null) + message.organization = String(object.organization); + return message; + }; + + /** + * Creates a plain object from a ProjectsListXpnHostsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @static + * @param {google.cloud.compute.v1.ProjectsListXpnHostsRequest} message ProjectsListXpnHostsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProjectsListXpnHostsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.organization != null && message.hasOwnProperty("organization")) { + object.organization = message.organization; + if (options.oneofs) + object._organization = "organization"; + } + return object; + }; + + /** + * Converts this ProjectsListXpnHostsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ProjectsListXpnHostsRequest + * @instance + * @returns {Object.} JSON object + */ + ProjectsListXpnHostsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProjectsListXpnHostsRequest; + })(); + + v1.ProjectsSetDefaultNetworkTierRequest = (function() { + + /** + * Properties of a ProjectsSetDefaultNetworkTierRequest. + * @memberof google.cloud.compute.v1 + * @interface IProjectsSetDefaultNetworkTierRequest + * @property {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier|null} [networkTier] ProjectsSetDefaultNetworkTierRequest networkTier + */ + + /** + * Constructs a new ProjectsSetDefaultNetworkTierRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ProjectsSetDefaultNetworkTierRequest. + * @implements IProjectsSetDefaultNetworkTierRequest + * @constructor + * @param {google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest=} [properties] Properties to set + */ + function ProjectsSetDefaultNetworkTierRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProjectsSetDefaultNetworkTierRequest networkTier. + * @member {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier|null|undefined} networkTier + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @instance + */ + ProjectsSetDefaultNetworkTierRequest.prototype.networkTier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ProjectsSetDefaultNetworkTierRequest _networkTier. + * @member {"networkTier"|undefined} _networkTier + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @instance + */ + Object.defineProperty(ProjectsSetDefaultNetworkTierRequest.prototype, "_networkTier", { + get: $util.oneOfGetter($oneOfFields = ["networkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProjectsSetDefaultNetworkTierRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest} ProjectsSetDefaultNetworkTierRequest instance + */ + ProjectsSetDefaultNetworkTierRequest.create = function create(properties) { + return new ProjectsSetDefaultNetworkTierRequest(properties); + }; + + /** + * Encodes the specified ProjectsSetDefaultNetworkTierRequest message. Does not implicitly {@link google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest} message ProjectsSetDefaultNetworkTierRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsSetDefaultNetworkTierRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) + writer.uint32(/* id 517397843, wireType 0 =*/4139182744).int32(message.networkTier); + return writer; + }; + + /** + * Encodes the specified ProjectsSetDefaultNetworkTierRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest} message ProjectsSetDefaultNetworkTierRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProjectsSetDefaultNetworkTierRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProjectsSetDefaultNetworkTierRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest} ProjectsSetDefaultNetworkTierRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsSetDefaultNetworkTierRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517397843: + message.networkTier = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProjectsSetDefaultNetworkTierRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest} ProjectsSetDefaultNetworkTierRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProjectsSetDefaultNetworkTierRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProjectsSetDefaultNetworkTierRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProjectsSetDefaultNetworkTierRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + properties._networkTier = 1; + switch (message.networkTier) { + default: + return "networkTier: enum value expected"; + case 0: + case 399530551: + case 484642493: + break; + } + } + return null; + }; + + /** + * Creates a ProjectsSetDefaultNetworkTierRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest} ProjectsSetDefaultNetworkTierRequest + */ + ProjectsSetDefaultNetworkTierRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest) + return object; + var message = new $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest(); + switch (object.networkTier) { + case "UNDEFINED_NETWORK_TIER": + case 0: + message.networkTier = 0; + break; + case "PREMIUM": + case 399530551: + message.networkTier = 399530551; + break; + case "STANDARD": + case 484642493: + message.networkTier = 484642493; + break; + } + return message; + }; + + /** + * Creates a plain object from a ProjectsSetDefaultNetworkTierRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @static + * @param {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest} message ProjectsSetDefaultNetworkTierRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProjectsSetDefaultNetworkTierRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + object.networkTier = options.enums === String ? $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier[message.networkTier] : message.networkTier; + if (options.oneofs) + object._networkTier = "networkTier"; + } + return object; + }; + + /** + * Converts this ProjectsSetDefaultNetworkTierRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest + * @instance + * @returns {Object.} JSON object + */ + ProjectsSetDefaultNetworkTierRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * NetworkTier enum. + * @name google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.NetworkTier + * @enum {number} + * @property {number} UNDEFINED_NETWORK_TIER=0 UNDEFINED_NETWORK_TIER value + * @property {number} PREMIUM=399530551 PREMIUM value + * @property {number} STANDARD=484642493 STANDARD value + */ + ProjectsSetDefaultNetworkTierRequest.NetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NETWORK_TIER"] = 0; + values[valuesById[399530551] = "PREMIUM"] = 399530551; + values[valuesById[484642493] = "STANDARD"] = 484642493; + return values; + })(); + + return ProjectsSetDefaultNetworkTierRequest; + })(); + + v1.PublicAdvertisedPrefixPublicDelegatedPrefix = (function() { + + /** + * Properties of a PublicAdvertisedPrefixPublicDelegatedPrefix. + * @memberof google.cloud.compute.v1 + * @interface IPublicAdvertisedPrefixPublicDelegatedPrefix + * @property {string|null} [ipRange] PublicAdvertisedPrefixPublicDelegatedPrefix ipRange + * @property {string|null} [name] PublicAdvertisedPrefixPublicDelegatedPrefix name + * @property {string|null} [project] PublicAdvertisedPrefixPublicDelegatedPrefix project + * @property {string|null} [region] PublicAdvertisedPrefixPublicDelegatedPrefix region + * @property {string|null} [status] PublicAdvertisedPrefixPublicDelegatedPrefix status + */ + + /** + * Constructs a new PublicAdvertisedPrefixPublicDelegatedPrefix. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicAdvertisedPrefixPublicDelegatedPrefix. + * @implements IPublicAdvertisedPrefixPublicDelegatedPrefix + * @constructor + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix=} [properties] Properties to set + */ + function PublicAdvertisedPrefixPublicDelegatedPrefix(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix ipRange. + * @member {string|null|undefined} ipRange + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.prototype.ipRange = null; + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.prototype.name = null; + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix project. + * @member {string|null|undefined} project + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.prototype.project = null; + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.prototype.region = null; + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix status. + * @member {string|null|undefined} status + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix _ipRange. + * @member {"ipRange"|undefined} _ipRange + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixPublicDelegatedPrefix.prototype, "_ipRange", { + get: $util.oneOfGetter($oneOfFields = ["ipRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixPublicDelegatedPrefix.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix _project. + * @member {"project"|undefined} _project + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixPublicDelegatedPrefix.prototype, "_project", { + get: $util.oneOfGetter($oneOfFields = ["project"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixPublicDelegatedPrefix.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixPublicDelegatedPrefix _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixPublicDelegatedPrefix.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicAdvertisedPrefixPublicDelegatedPrefix instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix} PublicAdvertisedPrefixPublicDelegatedPrefix instance + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.create = function create(properties) { + return new PublicAdvertisedPrefixPublicDelegatedPrefix(properties); + }; + + /** + * Encodes the specified PublicAdvertisedPrefixPublicDelegatedPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix} message PublicAdvertisedPrefixPublicDelegatedPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.ipRange != null && Object.hasOwnProperty.call(message, "ipRange")) + writer.uint32(/* id 145092645, wireType 2 =*/1160741162).string(message.ipRange); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 2 =*/1450082194).string(message.status); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified PublicAdvertisedPrefixPublicDelegatedPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixPublicDelegatedPrefix} message PublicAdvertisedPrefixPublicDelegatedPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicAdvertisedPrefixPublicDelegatedPrefix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix} PublicAdvertisedPrefixPublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 145092645: + message.ipRange = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 181260274: + message.status = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicAdvertisedPrefixPublicDelegatedPrefix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix} PublicAdvertisedPrefixPublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicAdvertisedPrefixPublicDelegatedPrefix message. + * @function verify + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipRange != null && message.hasOwnProperty("ipRange")) { + properties._ipRange = 1; + if (!$util.isString(message.ipRange)) + return "ipRange: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) { + properties._project = 1; + if (!$util.isString(message.project)) + return "project: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + if (!$util.isString(message.status)) + return "status: string expected"; + } + return null; + }; + + /** + * Creates a PublicAdvertisedPrefixPublicDelegatedPrefix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix} PublicAdvertisedPrefixPublicDelegatedPrefix + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix) + return object; + var message = new $root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix(); + if (object.ipRange != null) + message.ipRange = String(object.ipRange); + if (object.name != null) + message.name = String(object.name); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.status != null) + message.status = String(object.status); + return message; + }; + + /** + * Creates a plain object from a PublicAdvertisedPrefixPublicDelegatedPrefix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix} message PublicAdvertisedPrefixPublicDelegatedPrefix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.ipRange != null && message.hasOwnProperty("ipRange")) { + object.ipRange = message.ipRange; + if (options.oneofs) + object._ipRange = "ipRange"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.project != null && message.hasOwnProperty("project")) { + object.project = message.project; + if (options.oneofs) + object._project = "project"; + } + return object; + }; + + /** + * Converts this PublicAdvertisedPrefixPublicDelegatedPrefix to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix + * @instance + * @returns {Object.} JSON object + */ + PublicAdvertisedPrefixPublicDelegatedPrefix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicAdvertisedPrefixPublicDelegatedPrefix; + })(); + + v1.PublicAdvertisedPrefix = (function() { + + /** + * Properties of a PublicAdvertisedPrefix. + * @memberof google.cloud.compute.v1 + * @interface IPublicAdvertisedPrefix + * @property {string|null} [creationTimestamp] PublicAdvertisedPrefix creationTimestamp + * @property {string|null} [description] PublicAdvertisedPrefix description + * @property {string|null} [dnsVerificationIp] PublicAdvertisedPrefix dnsVerificationIp + * @property {string|null} [fingerprint] PublicAdvertisedPrefix fingerprint + * @property {number|Long|null} [id] PublicAdvertisedPrefix id + * @property {string|null} [ipCidrRange] PublicAdvertisedPrefix ipCidrRange + * @property {string|null} [kind] PublicAdvertisedPrefix kind + * @property {string|null} [name] PublicAdvertisedPrefix name + * @property {Array.|null} [publicDelegatedPrefixs] PublicAdvertisedPrefix publicDelegatedPrefixs + * @property {string|null} [selfLink] PublicAdvertisedPrefix selfLink + * @property {string|null} [sharedSecret] PublicAdvertisedPrefix sharedSecret + * @property {google.cloud.compute.v1.PublicAdvertisedPrefix.Status|null} [status] PublicAdvertisedPrefix status + */ + + /** + * Constructs a new PublicAdvertisedPrefix. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicAdvertisedPrefix. + * @implements IPublicAdvertisedPrefix + * @constructor + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefix=} [properties] Properties to set + */ + function PublicAdvertisedPrefix(properties) { + this.publicDelegatedPrefixs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicAdvertisedPrefix creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.creationTimestamp = null; + + /** + * PublicAdvertisedPrefix description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.description = null; + + /** + * PublicAdvertisedPrefix dnsVerificationIp. + * @member {string|null|undefined} dnsVerificationIp + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.dnsVerificationIp = null; + + /** + * PublicAdvertisedPrefix fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.fingerprint = null; + + /** + * PublicAdvertisedPrefix id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.id = null; + + /** + * PublicAdvertisedPrefix ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.ipCidrRange = null; + + /** + * PublicAdvertisedPrefix kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.kind = null; + + /** + * PublicAdvertisedPrefix name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.name = null; + + /** + * PublicAdvertisedPrefix publicDelegatedPrefixs. + * @member {Array.} publicDelegatedPrefixs + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.publicDelegatedPrefixs = $util.emptyArray; + + /** + * PublicAdvertisedPrefix selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.selfLink = null; + + /** + * PublicAdvertisedPrefix sharedSecret. + * @member {string|null|undefined} sharedSecret + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.sharedSecret = null; + + /** + * PublicAdvertisedPrefix status. + * @member {google.cloud.compute.v1.PublicAdvertisedPrefix.Status|null|undefined} status + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + PublicAdvertisedPrefix.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicAdvertisedPrefix _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _dnsVerificationIp. + * @member {"dnsVerificationIp"|undefined} _dnsVerificationIp + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_dnsVerificationIp", { + get: $util.oneOfGetter($oneOfFields = ["dnsVerificationIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _sharedSecret. + * @member {"sharedSecret"|undefined} _sharedSecret + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_sharedSecret", { + get: $util.oneOfGetter($oneOfFields = ["sharedSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefix _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefix.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicAdvertisedPrefix instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefix=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefix} PublicAdvertisedPrefix instance + */ + PublicAdvertisedPrefix.create = function create(properties) { + return new PublicAdvertisedPrefix(properties); + }; + + /** + * Encodes the specified PublicAdvertisedPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefix.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefix} message PublicAdvertisedPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicAdvertisedPrefix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.dnsVerificationIp != null && Object.hasOwnProperty.call(message, "dnsVerificationIp")) + writer.uint32(/* id 241011381, wireType 2 =*/1928091050).string(message.dnsVerificationIp); + if (message.sharedSecret != null && Object.hasOwnProperty.call(message, "sharedSecret")) + writer.uint32(/* id 381932490, wireType 2 =*/3055459922).string(message.sharedSecret); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.publicDelegatedPrefixs != null && message.publicDelegatedPrefixs.length) + for (var i = 0; i < message.publicDelegatedPrefixs.length; ++i) + $root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.encode(message.publicDelegatedPrefixs[i], writer.uint32(/* id 425811723, wireType 2 =*/3406493786).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified PublicAdvertisedPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefix} message PublicAdvertisedPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicAdvertisedPrefix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicAdvertisedPrefix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefix} PublicAdvertisedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicAdvertisedPrefix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicAdvertisedPrefix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 241011381: + message.dnsVerificationIp = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 425811723: + if (!(message.publicDelegatedPrefixs && message.publicDelegatedPrefixs.length)) + message.publicDelegatedPrefixs = []; + message.publicDelegatedPrefixs.push($root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 381932490: + message.sharedSecret = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicAdvertisedPrefix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefix} PublicAdvertisedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicAdvertisedPrefix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicAdvertisedPrefix message. + * @function verify + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicAdvertisedPrefix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.dnsVerificationIp != null && message.hasOwnProperty("dnsVerificationIp")) { + properties._dnsVerificationIp = 1; + if (!$util.isString(message.dnsVerificationIp)) + return "dnsVerificationIp: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.publicDelegatedPrefixs != null && message.hasOwnProperty("publicDelegatedPrefixs")) { + if (!Array.isArray(message.publicDelegatedPrefixs)) + return "publicDelegatedPrefixs: array expected"; + for (var i = 0; i < message.publicDelegatedPrefixs.length; ++i) { + var error = $root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.verify(message.publicDelegatedPrefixs[i]); + if (error) + return "publicDelegatedPrefixs." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sharedSecret != null && message.hasOwnProperty("sharedSecret")) { + properties._sharedSecret = 1; + if (!$util.isString(message.sharedSecret)) + return "sharedSecret: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 518841124: + case 480889551: + case 378550961: + case 284375783: + case 513497167: + case 295755183: + case 66197998: + break; + } + } + return null; + }; + + /** + * Creates a PublicAdvertisedPrefix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefix} PublicAdvertisedPrefix + */ + PublicAdvertisedPrefix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicAdvertisedPrefix) + return object; + var message = new $root.google.cloud.compute.v1.PublicAdvertisedPrefix(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.dnsVerificationIp != null) + message.dnsVerificationIp = String(object.dnsVerificationIp); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.publicDelegatedPrefixs) { + if (!Array.isArray(object.publicDelegatedPrefixs)) + throw TypeError(".google.cloud.compute.v1.PublicAdvertisedPrefix.publicDelegatedPrefixs: array expected"); + message.publicDelegatedPrefixs = []; + for (var i = 0; i < object.publicDelegatedPrefixs.length; ++i) { + if (typeof object.publicDelegatedPrefixs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PublicAdvertisedPrefix.publicDelegatedPrefixs: object expected"); + message.publicDelegatedPrefixs[i] = $root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.fromObject(object.publicDelegatedPrefixs[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.sharedSecret != null) + message.sharedSecret = String(object.sharedSecret); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "INITIAL": + case 518841124: + message.status = 518841124; + break; + case "PREFIX_CONFIGURATION_COMPLETE": + case 480889551: + message.status = 480889551; + break; + case "PREFIX_CONFIGURATION_IN_PROGRESS": + case 378550961: + message.status = 378550961; + break; + case "PREFIX_REMOVAL_IN_PROGRESS": + case 284375783: + message.status = 284375783; + break; + case "PTR_CONFIGURED": + case 513497167: + message.status = 513497167; + break; + case "REVERSE_DNS_LOOKUP_FAILED": + case 295755183: + message.status = 295755183; + break; + case "VALIDATED": + case 66197998: + message.status = 66197998; + break; + } + return message; + }; + + /** + * Creates a plain object from a PublicAdvertisedPrefix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @static + * @param {google.cloud.compute.v1.PublicAdvertisedPrefix} message PublicAdvertisedPrefix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicAdvertisedPrefix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.publicDelegatedPrefixs = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.PublicAdvertisedPrefix.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.dnsVerificationIp != null && message.hasOwnProperty("dnsVerificationIp")) { + object.dnsVerificationIp = message.dnsVerificationIp; + if (options.oneofs) + object._dnsVerificationIp = "dnsVerificationIp"; + } + if (message.sharedSecret != null && message.hasOwnProperty("sharedSecret")) { + object.sharedSecret = message.sharedSecret; + if (options.oneofs) + object._sharedSecret = "sharedSecret"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.publicDelegatedPrefixs && message.publicDelegatedPrefixs.length) { + object.publicDelegatedPrefixs = []; + for (var j = 0; j < message.publicDelegatedPrefixs.length; ++j) + object.publicDelegatedPrefixs[j] = $root.google.cloud.compute.v1.PublicAdvertisedPrefixPublicDelegatedPrefix.toObject(message.publicDelegatedPrefixs[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this PublicAdvertisedPrefix to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefix + * @instance + * @returns {Object.} JSON object + */ + PublicAdvertisedPrefix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.PublicAdvertisedPrefix.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} INITIAL=518841124 INITIAL value + * @property {number} PREFIX_CONFIGURATION_COMPLETE=480889551 PREFIX_CONFIGURATION_COMPLETE value + * @property {number} PREFIX_CONFIGURATION_IN_PROGRESS=378550961 PREFIX_CONFIGURATION_IN_PROGRESS value + * @property {number} PREFIX_REMOVAL_IN_PROGRESS=284375783 PREFIX_REMOVAL_IN_PROGRESS value + * @property {number} PTR_CONFIGURED=513497167 PTR_CONFIGURED value + * @property {number} REVERSE_DNS_LOOKUP_FAILED=295755183 REVERSE_DNS_LOOKUP_FAILED value + * @property {number} VALIDATED=66197998 VALIDATED value + */ + PublicAdvertisedPrefix.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[518841124] = "INITIAL"] = 518841124; + values[valuesById[480889551] = "PREFIX_CONFIGURATION_COMPLETE"] = 480889551; + values[valuesById[378550961] = "PREFIX_CONFIGURATION_IN_PROGRESS"] = 378550961; + values[valuesById[284375783] = "PREFIX_REMOVAL_IN_PROGRESS"] = 284375783; + values[valuesById[513497167] = "PTR_CONFIGURED"] = 513497167; + values[valuesById[295755183] = "REVERSE_DNS_LOOKUP_FAILED"] = 295755183; + values[valuesById[66197998] = "VALIDATED"] = 66197998; + return values; + })(); + + return PublicAdvertisedPrefix; + })(); + + v1.PublicAdvertisedPrefixList = (function() { + + /** + * Properties of a PublicAdvertisedPrefixList. + * @memberof google.cloud.compute.v1 + * @interface IPublicAdvertisedPrefixList + * @property {string|null} [id] PublicAdvertisedPrefixList id + * @property {Array.|null} [items] PublicAdvertisedPrefixList items + * @property {string|null} [kind] PublicAdvertisedPrefixList kind + * @property {string|null} [nextPageToken] PublicAdvertisedPrefixList nextPageToken + * @property {string|null} [selfLink] PublicAdvertisedPrefixList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] PublicAdvertisedPrefixList warning + */ + + /** + * Constructs a new PublicAdvertisedPrefixList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicAdvertisedPrefixList. + * @implements IPublicAdvertisedPrefixList + * @constructor + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixList=} [properties] Properties to set + */ + function PublicAdvertisedPrefixList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicAdvertisedPrefixList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + PublicAdvertisedPrefixList.prototype.id = null; + + /** + * PublicAdvertisedPrefixList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + PublicAdvertisedPrefixList.prototype.items = $util.emptyArray; + + /** + * PublicAdvertisedPrefixList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + PublicAdvertisedPrefixList.prototype.kind = null; + + /** + * PublicAdvertisedPrefixList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + PublicAdvertisedPrefixList.prototype.nextPageToken = null; + + /** + * PublicAdvertisedPrefixList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + PublicAdvertisedPrefixList.prototype.selfLink = null; + + /** + * PublicAdvertisedPrefixList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + PublicAdvertisedPrefixList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicAdvertisedPrefixList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicAdvertisedPrefixList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + */ + Object.defineProperty(PublicAdvertisedPrefixList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicAdvertisedPrefixList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixList} PublicAdvertisedPrefixList instance + */ + PublicAdvertisedPrefixList.create = function create(properties) { + return new PublicAdvertisedPrefixList(properties); + }; + + /** + * Encodes the specified PublicAdvertisedPrefixList message. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixList} message PublicAdvertisedPrefixList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicAdvertisedPrefixList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.PublicAdvertisedPrefix.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified PublicAdvertisedPrefixList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicAdvertisedPrefixList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {google.cloud.compute.v1.IPublicAdvertisedPrefixList} message PublicAdvertisedPrefixList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicAdvertisedPrefixList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicAdvertisedPrefixList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixList} PublicAdvertisedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicAdvertisedPrefixList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicAdvertisedPrefixList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.PublicAdvertisedPrefix.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicAdvertisedPrefixList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixList} PublicAdvertisedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicAdvertisedPrefixList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicAdvertisedPrefixList message. + * @function verify + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicAdvertisedPrefixList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a PublicAdvertisedPrefixList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicAdvertisedPrefixList} PublicAdvertisedPrefixList + */ + PublicAdvertisedPrefixList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicAdvertisedPrefixList) + return object; + var message = new $root.google.cloud.compute.v1.PublicAdvertisedPrefixList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.PublicAdvertisedPrefixList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PublicAdvertisedPrefixList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.PublicAdvertisedPrefixList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a PublicAdvertisedPrefixList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @static + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixList} message PublicAdvertisedPrefixList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicAdvertisedPrefixList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this PublicAdvertisedPrefixList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixList + * @instance + * @returns {Object.} JSON object + */ + PublicAdvertisedPrefixList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicAdvertisedPrefixList; + })(); + + v1.PublicDelegatedPrefixPublicDelegatedSubPrefix = (function() { + + /** + * Properties of a PublicDelegatedPrefixPublicDelegatedSubPrefix. + * @memberof google.cloud.compute.v1 + * @interface IPublicDelegatedPrefixPublicDelegatedSubPrefix + * @property {string|null} [delegateeProject] PublicDelegatedPrefixPublicDelegatedSubPrefix delegateeProject + * @property {string|null} [description] PublicDelegatedPrefixPublicDelegatedSubPrefix description + * @property {string|null} [ipCidrRange] PublicDelegatedPrefixPublicDelegatedSubPrefix ipCidrRange + * @property {boolean|null} [isAddress] PublicDelegatedPrefixPublicDelegatedSubPrefix isAddress + * @property {string|null} [name] PublicDelegatedPrefixPublicDelegatedSubPrefix name + * @property {string|null} [region] PublicDelegatedPrefixPublicDelegatedSubPrefix region + * @property {google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status|null} [status] PublicDelegatedPrefixPublicDelegatedSubPrefix status + */ + + /** + * Constructs a new PublicDelegatedPrefixPublicDelegatedSubPrefix. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicDelegatedPrefixPublicDelegatedSubPrefix. + * @implements IPublicDelegatedPrefixPublicDelegatedSubPrefix + * @constructor + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix=} [properties] Properties to set + */ + function PublicDelegatedPrefixPublicDelegatedSubPrefix(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix delegateeProject. + * @member {string|null|undefined} delegateeProject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.delegateeProject = null; + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.description = null; + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.ipCidrRange = null; + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix isAddress. + * @member {boolean|null|undefined} isAddress + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.isAddress = null; + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.name = null; + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.region = null; + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix status. + * @member {google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status|null|undefined} status + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix _delegateeProject. + * @member {"delegateeProject"|undefined} _delegateeProject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype, "_delegateeProject", { + get: $util.oneOfGetter($oneOfFields = ["delegateeProject"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix _isAddress. + * @member {"isAddress"|undefined} _isAddress + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype, "_isAddress", { + get: $util.oneOfGetter($oneOfFields = ["isAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixPublicDelegatedSubPrefix _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicDelegatedPrefixPublicDelegatedSubPrefix instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix} PublicDelegatedPrefixPublicDelegatedSubPrefix instance + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.create = function create(properties) { + return new PublicDelegatedPrefixPublicDelegatedSubPrefix(properties); + }; + + /** + * Encodes the specified PublicDelegatedPrefixPublicDelegatedSubPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix} message PublicDelegatedPrefixPublicDelegatedSubPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.isAddress != null && Object.hasOwnProperty.call(message, "isAddress")) + writer.uint32(/* id 352617951, wireType 0 =*/2820943608).bool(message.isAddress); + if (message.delegateeProject != null && Object.hasOwnProperty.call(message, "delegateeProject")) + writer.uint32(/* id 414860634, wireType 2 =*/3318885074).string(message.delegateeProject); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + return writer; + }; + + /** + * Encodes the specified PublicDelegatedPrefixPublicDelegatedSubPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixPublicDelegatedSubPrefix} message PublicDelegatedPrefixPublicDelegatedSubPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicDelegatedPrefixPublicDelegatedSubPrefix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix} PublicDelegatedPrefixPublicDelegatedSubPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 414860634: + message.delegateeProject = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 352617951: + message.isAddress = reader.bool(); + break; + case 3373707: + message.name = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicDelegatedPrefixPublicDelegatedSubPrefix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix} PublicDelegatedPrefixPublicDelegatedSubPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicDelegatedPrefixPublicDelegatedSubPrefix message. + * @function verify + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.delegateeProject != null && message.hasOwnProperty("delegateeProject")) { + properties._delegateeProject = 1; + if (!$util.isString(message.delegateeProject)) + return "delegateeProject: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.isAddress != null && message.hasOwnProperty("isAddress")) { + properties._isAddress = 1; + if (typeof message.isAddress !== "boolean") + return "isAddress: boolean expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 314733318: + case 270421099: + break; + } + } + return null; + }; + + /** + * Creates a PublicDelegatedPrefixPublicDelegatedSubPrefix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix} PublicDelegatedPrefixPublicDelegatedSubPrefix + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix) + return object; + var message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix(); + if (object.delegateeProject != null) + message.delegateeProject = String(object.delegateeProject); + if (object.description != null) + message.description = String(object.description); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.isAddress != null) + message.isAddress = Boolean(object.isAddress); + if (object.name != null) + message.name = String(object.name); + if (object.region != null) + message.region = String(object.region); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "ACTIVE": + case 314733318: + message.status = 314733318; + break; + case "INACTIVE": + case 270421099: + message.status = 270421099; + break; + } + return message; + }; + + /** + * Creates a plain object from a PublicDelegatedPrefixPublicDelegatedSubPrefix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @static + * @param {google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix} message PublicDelegatedPrefixPublicDelegatedSubPrefix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.isAddress != null && message.hasOwnProperty("isAddress")) { + object.isAddress = message.isAddress; + if (options.oneofs) + object._isAddress = "isAddress"; + } + if (message.delegateeProject != null && message.hasOwnProperty("delegateeProject")) { + object.delegateeProject = message.delegateeProject; + if (options.oneofs) + object._delegateeProject = "delegateeProject"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + return object; + }; + + /** + * Converts this PublicDelegatedPrefixPublicDelegatedSubPrefix to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix + * @instance + * @returns {Object.} JSON object + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} INACTIVE=270421099 INACTIVE value + */ + PublicDelegatedPrefixPublicDelegatedSubPrefix.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[270421099] = "INACTIVE"] = 270421099; + return values; + })(); + + return PublicDelegatedPrefixPublicDelegatedSubPrefix; + })(); + + v1.PublicDelegatedPrefix = (function() { + + /** + * Properties of a PublicDelegatedPrefix. + * @memberof google.cloud.compute.v1 + * @interface IPublicDelegatedPrefix + * @property {string|null} [creationTimestamp] PublicDelegatedPrefix creationTimestamp + * @property {string|null} [description] PublicDelegatedPrefix description + * @property {string|null} [fingerprint] PublicDelegatedPrefix fingerprint + * @property {number|Long|null} [id] PublicDelegatedPrefix id + * @property {string|null} [ipCidrRange] PublicDelegatedPrefix ipCidrRange + * @property {boolean|null} [isLiveMigration] PublicDelegatedPrefix isLiveMigration + * @property {string|null} [kind] PublicDelegatedPrefix kind + * @property {string|null} [name] PublicDelegatedPrefix name + * @property {string|null} [parentPrefix] PublicDelegatedPrefix parentPrefix + * @property {Array.|null} [publicDelegatedSubPrefixs] PublicDelegatedPrefix publicDelegatedSubPrefixs + * @property {string|null} [region] PublicDelegatedPrefix region + * @property {string|null} [selfLink] PublicDelegatedPrefix selfLink + * @property {google.cloud.compute.v1.PublicDelegatedPrefix.Status|null} [status] PublicDelegatedPrefix status + */ + + /** + * Constructs a new PublicDelegatedPrefix. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicDelegatedPrefix. + * @implements IPublicDelegatedPrefix + * @constructor + * @param {google.cloud.compute.v1.IPublicDelegatedPrefix=} [properties] Properties to set + */ + function PublicDelegatedPrefix(properties) { + this.publicDelegatedSubPrefixs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicDelegatedPrefix creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.creationTimestamp = null; + + /** + * PublicDelegatedPrefix description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.description = null; + + /** + * PublicDelegatedPrefix fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.fingerprint = null; + + /** + * PublicDelegatedPrefix id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.id = null; + + /** + * PublicDelegatedPrefix ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.ipCidrRange = null; + + /** + * PublicDelegatedPrefix isLiveMigration. + * @member {boolean|null|undefined} isLiveMigration + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.isLiveMigration = null; + + /** + * PublicDelegatedPrefix kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.kind = null; + + /** + * PublicDelegatedPrefix name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.name = null; + + /** + * PublicDelegatedPrefix parentPrefix. + * @member {string|null|undefined} parentPrefix + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.parentPrefix = null; + + /** + * PublicDelegatedPrefix publicDelegatedSubPrefixs. + * @member {Array.} publicDelegatedSubPrefixs + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.publicDelegatedSubPrefixs = $util.emptyArray; + + /** + * PublicDelegatedPrefix region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.region = null; + + /** + * PublicDelegatedPrefix selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.selfLink = null; + + /** + * PublicDelegatedPrefix status. + * @member {google.cloud.compute.v1.PublicDelegatedPrefix.Status|null|undefined} status + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + PublicDelegatedPrefix.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicDelegatedPrefix _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _isLiveMigration. + * @member {"isLiveMigration"|undefined} _isLiveMigration + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_isLiveMigration", { + get: $util.oneOfGetter($oneOfFields = ["isLiveMigration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _parentPrefix. + * @member {"parentPrefix"|undefined} _parentPrefix + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_parentPrefix", { + get: $util.oneOfGetter($oneOfFields = ["parentPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefix _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + */ + Object.defineProperty(PublicDelegatedPrefix.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicDelegatedPrefix instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefix=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicDelegatedPrefix} PublicDelegatedPrefix instance + */ + PublicDelegatedPrefix.create = function create(properties) { + return new PublicDelegatedPrefix(properties); + }; + + /** + * Encodes the specified PublicDelegatedPrefix message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefix.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefix} message PublicDelegatedPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.parentPrefix != null && Object.hasOwnProperty.call(message, "parentPrefix")) + writer.uint32(/* id 15233991, wireType 2 =*/121871930).string(message.parentPrefix); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.publicDelegatedSubPrefixs != null && message.publicDelegatedSubPrefixs.length) + for (var i = 0; i < message.publicDelegatedSubPrefixs.length; ++i) + $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.encode(message.publicDelegatedSubPrefixs[i], writer.uint32(/* id 188940044, wireType 2 =*/1511520354).fork()).ldelim(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.isLiveMigration != null && Object.hasOwnProperty.call(message, "isLiveMigration")) + writer.uint32(/* id 511823856, wireType 0 =*/4094590848).bool(message.isLiveMigration); + return writer; + }; + + /** + * Encodes the specified PublicDelegatedPrefix message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefix} message PublicDelegatedPrefix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicDelegatedPrefix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicDelegatedPrefix} PublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefix.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicDelegatedPrefix(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 511823856: + message.isLiveMigration = reader.bool(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 15233991: + message.parentPrefix = reader.string(); + break; + case 188940044: + if (!(message.publicDelegatedSubPrefixs && message.publicDelegatedSubPrefixs.length)) + message.publicDelegatedSubPrefixs = []; + message.publicDelegatedSubPrefixs.push($root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.decode(reader, reader.uint32())); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicDelegatedPrefix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicDelegatedPrefix} PublicDelegatedPrefix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicDelegatedPrefix message. + * @function verify + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicDelegatedPrefix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.isLiveMigration != null && message.hasOwnProperty("isLiveMigration")) { + properties._isLiveMigration = 1; + if (typeof message.isLiveMigration !== "boolean") + return "isLiveMigration: boolean expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.parentPrefix != null && message.hasOwnProperty("parentPrefix")) { + properties._parentPrefix = 1; + if (!$util.isString(message.parentPrefix)) + return "parentPrefix: string expected"; + } + if (message.publicDelegatedSubPrefixs != null && message.hasOwnProperty("publicDelegatedSubPrefixs")) { + if (!Array.isArray(message.publicDelegatedSubPrefixs)) + return "publicDelegatedSubPrefixs: array expected"; + for (var i = 0; i < message.publicDelegatedSubPrefixs.length; ++i) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.verify(message.publicDelegatedSubPrefixs[i]); + if (error) + return "publicDelegatedSubPrefixs." + error; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 365103355: + case 528602024: + case 306588749: + break; + } + } + return null; + }; + + /** + * Creates a PublicDelegatedPrefix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicDelegatedPrefix} PublicDelegatedPrefix + */ + PublicDelegatedPrefix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicDelegatedPrefix) + return object; + var message = new $root.google.cloud.compute.v1.PublicDelegatedPrefix(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.isLiveMigration != null) + message.isLiveMigration = Boolean(object.isLiveMigration); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.parentPrefix != null) + message.parentPrefix = String(object.parentPrefix); + if (object.publicDelegatedSubPrefixs) { + if (!Array.isArray(object.publicDelegatedSubPrefixs)) + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefix.publicDelegatedSubPrefixs: array expected"); + message.publicDelegatedSubPrefixs = []; + for (var i = 0; i < object.publicDelegatedSubPrefixs.length; ++i) { + if (typeof object.publicDelegatedSubPrefixs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefix.publicDelegatedSubPrefixs: object expected"); + message.publicDelegatedSubPrefixs[i] = $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.fromObject(object.publicDelegatedSubPrefixs[i]); + } + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "ANNOUNCED": + case 365103355: + message.status = 365103355; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "INITIALIZING": + case 306588749: + message.status = 306588749; + break; + } + return message; + }; + + /** + * Creates a plain object from a PublicDelegatedPrefix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @static + * @param {google.cloud.compute.v1.PublicDelegatedPrefix} message PublicDelegatedPrefix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicDelegatedPrefix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.publicDelegatedSubPrefixs = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.parentPrefix != null && message.hasOwnProperty("parentPrefix")) { + object.parentPrefix = message.parentPrefix; + if (options.oneofs) + object._parentPrefix = "parentPrefix"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.PublicDelegatedPrefix.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.publicDelegatedSubPrefixs && message.publicDelegatedSubPrefixs.length) { + object.publicDelegatedSubPrefixs = []; + for (var j = 0; j < message.publicDelegatedSubPrefixs.length; ++j) + object.publicDelegatedSubPrefixs[j] = $root.google.cloud.compute.v1.PublicDelegatedPrefixPublicDelegatedSubPrefix.toObject(message.publicDelegatedSubPrefixs[j], options); + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.isLiveMigration != null && message.hasOwnProperty("isLiveMigration")) { + object.isLiveMigration = message.isLiveMigration; + if (options.oneofs) + object._isLiveMigration = "isLiveMigration"; + } + return object; + }; + + /** + * Converts this PublicDelegatedPrefix to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicDelegatedPrefix + * @instance + * @returns {Object.} JSON object + */ + PublicDelegatedPrefix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.PublicDelegatedPrefix.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} ANNOUNCED=365103355 ANNOUNCED value + * @property {number} DELETING=528602024 DELETING value + * @property {number} INITIALIZING=306588749 INITIALIZING value + */ + PublicDelegatedPrefix.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[365103355] = "ANNOUNCED"] = 365103355; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[306588749] = "INITIALIZING"] = 306588749; + return values; + })(); + + return PublicDelegatedPrefix; + })(); + + v1.PublicDelegatedPrefixesScopedList = (function() { + + /** + * Properties of a PublicDelegatedPrefixesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IPublicDelegatedPrefixesScopedList + * @property {Array.|null} [publicDelegatedPrefixes] PublicDelegatedPrefixesScopedList publicDelegatedPrefixes + * @property {google.cloud.compute.v1.IWarning|null} [warning] PublicDelegatedPrefixesScopedList warning + */ + + /** + * Constructs a new PublicDelegatedPrefixesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicDelegatedPrefixesScopedList. + * @implements IPublicDelegatedPrefixesScopedList + * @constructor + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList=} [properties] Properties to set + */ + function PublicDelegatedPrefixesScopedList(properties) { + this.publicDelegatedPrefixes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicDelegatedPrefixesScopedList publicDelegatedPrefixes. + * @member {Array.} publicDelegatedPrefixes + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @instance + */ + PublicDelegatedPrefixesScopedList.prototype.publicDelegatedPrefixes = $util.emptyArray; + + /** + * PublicDelegatedPrefixesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @instance + */ + PublicDelegatedPrefixesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicDelegatedPrefixesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicDelegatedPrefixesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixesScopedList} PublicDelegatedPrefixesScopedList instance + */ + PublicDelegatedPrefixesScopedList.create = function create(properties) { + return new PublicDelegatedPrefixesScopedList(properties); + }; + + /** + * Encodes the specified PublicDelegatedPrefixesScopedList message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList} message PublicDelegatedPrefixesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.publicDelegatedPrefixes != null && message.publicDelegatedPrefixes.length) + for (var i = 0; i < message.publicDelegatedPrefixes.length; ++i) + $root.google.cloud.compute.v1.PublicDelegatedPrefix.encode(message.publicDelegatedPrefixes[i], writer.uint32(/* id 315261206, wireType 2 =*/2522089650).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PublicDelegatedPrefixesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList} message PublicDelegatedPrefixesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicDelegatedPrefixesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixesScopedList} PublicDelegatedPrefixesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 315261206: + if (!(message.publicDelegatedPrefixes && message.publicDelegatedPrefixes.length)) + message.publicDelegatedPrefixes = []; + message.publicDelegatedPrefixes.push($root.google.cloud.compute.v1.PublicDelegatedPrefix.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicDelegatedPrefixesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixesScopedList} PublicDelegatedPrefixesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicDelegatedPrefixesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicDelegatedPrefixesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.publicDelegatedPrefixes != null && message.hasOwnProperty("publicDelegatedPrefixes")) { + if (!Array.isArray(message.publicDelegatedPrefixes)) + return "publicDelegatedPrefixes: array expected"; + for (var i = 0; i < message.publicDelegatedPrefixes.length; ++i) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefix.verify(message.publicDelegatedPrefixes[i]); + if (error) + return "publicDelegatedPrefixes." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a PublicDelegatedPrefixesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixesScopedList} PublicDelegatedPrefixesScopedList + */ + PublicDelegatedPrefixesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList(); + if (object.publicDelegatedPrefixes) { + if (!Array.isArray(object.publicDelegatedPrefixes)) + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.publicDelegatedPrefixes: array expected"); + message.publicDelegatedPrefixes = []; + for (var i = 0; i < object.publicDelegatedPrefixes.length; ++i) { + if (typeof object.publicDelegatedPrefixes[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.publicDelegatedPrefixes: object expected"); + message.publicDelegatedPrefixes[i] = $root.google.cloud.compute.v1.PublicDelegatedPrefix.fromObject(object.publicDelegatedPrefixes[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a PublicDelegatedPrefixesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @static + * @param {google.cloud.compute.v1.PublicDelegatedPrefixesScopedList} message PublicDelegatedPrefixesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicDelegatedPrefixesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.publicDelegatedPrefixes = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.publicDelegatedPrefixes && message.publicDelegatedPrefixes.length) { + object.publicDelegatedPrefixes = []; + for (var j = 0; j < message.publicDelegatedPrefixes.length; ++j) + object.publicDelegatedPrefixes[j] = $root.google.cloud.compute.v1.PublicDelegatedPrefix.toObject(message.publicDelegatedPrefixes[j], options); + } + return object; + }; + + /** + * Converts this PublicDelegatedPrefixesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixesScopedList + * @instance + * @returns {Object.} JSON object + */ + PublicDelegatedPrefixesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicDelegatedPrefixesScopedList; + })(); + + v1.PublicDelegatedPrefixAggregatedList = (function() { + + /** + * Properties of a PublicDelegatedPrefixAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IPublicDelegatedPrefixAggregatedList + * @property {string|null} [id] PublicDelegatedPrefixAggregatedList id + * @property {Object.|null} [items] PublicDelegatedPrefixAggregatedList items + * @property {string|null} [kind] PublicDelegatedPrefixAggregatedList kind + * @property {string|null} [nextPageToken] PublicDelegatedPrefixAggregatedList nextPageToken + * @property {string|null} [selfLink] PublicDelegatedPrefixAggregatedList selfLink + * @property {Array.|null} [unreachables] PublicDelegatedPrefixAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] PublicDelegatedPrefixAggregatedList warning + */ + + /** + * Constructs a new PublicDelegatedPrefixAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicDelegatedPrefixAggregatedList. + * @implements IPublicDelegatedPrefixAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList=} [properties] Properties to set + */ + function PublicDelegatedPrefixAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicDelegatedPrefixAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + PublicDelegatedPrefixAggregatedList.prototype.id = null; + + /** + * PublicDelegatedPrefixAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + PublicDelegatedPrefixAggregatedList.prototype.items = $util.emptyObject; + + /** + * PublicDelegatedPrefixAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + PublicDelegatedPrefixAggregatedList.prototype.kind = null; + + /** + * PublicDelegatedPrefixAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + PublicDelegatedPrefixAggregatedList.prototype.nextPageToken = null; + + /** + * PublicDelegatedPrefixAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + PublicDelegatedPrefixAggregatedList.prototype.selfLink = null; + + /** + * PublicDelegatedPrefixAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + PublicDelegatedPrefixAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * PublicDelegatedPrefixAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + PublicDelegatedPrefixAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicDelegatedPrefixAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicDelegatedPrefixAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList} PublicDelegatedPrefixAggregatedList instance + */ + PublicDelegatedPrefixAggregatedList.create = function create(properties) { + return new PublicDelegatedPrefixAggregatedList(properties); + }; + + /** + * Encodes the specified PublicDelegatedPrefixAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList} message PublicDelegatedPrefixAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified PublicDelegatedPrefixAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixAggregatedList} message PublicDelegatedPrefixAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicDelegatedPrefixAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList} PublicDelegatedPrefixAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.PublicDelegatedPrefixesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicDelegatedPrefixAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList} PublicDelegatedPrefixAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicDelegatedPrefixAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicDelegatedPrefixAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a PublicDelegatedPrefixAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList} PublicDelegatedPrefixAggregatedList + */ + PublicDelegatedPrefixAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a PublicDelegatedPrefixAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @static + * @param {google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList} message PublicDelegatedPrefixAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicDelegatedPrefixAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this PublicDelegatedPrefixAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList + * @instance + * @returns {Object.} JSON object + */ + PublicDelegatedPrefixAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicDelegatedPrefixAggregatedList; + })(); + + v1.PublicDelegatedPrefixList = (function() { + + /** + * Properties of a PublicDelegatedPrefixList. + * @memberof google.cloud.compute.v1 + * @interface IPublicDelegatedPrefixList + * @property {string|null} [id] PublicDelegatedPrefixList id + * @property {Array.|null} [items] PublicDelegatedPrefixList items + * @property {string|null} [kind] PublicDelegatedPrefixList kind + * @property {string|null} [nextPageToken] PublicDelegatedPrefixList nextPageToken + * @property {string|null} [selfLink] PublicDelegatedPrefixList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] PublicDelegatedPrefixList warning + */ + + /** + * Constructs a new PublicDelegatedPrefixList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicDelegatedPrefixList. + * @implements IPublicDelegatedPrefixList + * @constructor + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixList=} [properties] Properties to set + */ + function PublicDelegatedPrefixList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicDelegatedPrefixList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + PublicDelegatedPrefixList.prototype.id = null; + + /** + * PublicDelegatedPrefixList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + PublicDelegatedPrefixList.prototype.items = $util.emptyArray; + + /** + * PublicDelegatedPrefixList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + PublicDelegatedPrefixList.prototype.kind = null; + + /** + * PublicDelegatedPrefixList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + PublicDelegatedPrefixList.prototype.nextPageToken = null; + + /** + * PublicDelegatedPrefixList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + PublicDelegatedPrefixList.prototype.selfLink = null; + + /** + * PublicDelegatedPrefixList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + PublicDelegatedPrefixList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublicDelegatedPrefixList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PublicDelegatedPrefixList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + */ + Object.defineProperty(PublicDelegatedPrefixList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublicDelegatedPrefixList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixList} PublicDelegatedPrefixList instance + */ + PublicDelegatedPrefixList.create = function create(properties) { + return new PublicDelegatedPrefixList(properties); + }; + + /** + * Encodes the specified PublicDelegatedPrefixList message. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixList} message PublicDelegatedPrefixList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.PublicDelegatedPrefix.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified PublicDelegatedPrefixList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PublicDelegatedPrefixList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {google.cloud.compute.v1.IPublicDelegatedPrefixList} message PublicDelegatedPrefixList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicDelegatedPrefixList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicDelegatedPrefixList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixList} PublicDelegatedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.PublicDelegatedPrefix.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicDelegatedPrefixList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixList} PublicDelegatedPrefixList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicDelegatedPrefixList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicDelegatedPrefixList message. + * @function verify + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicDelegatedPrefixList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefix.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a PublicDelegatedPrefixList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PublicDelegatedPrefixList} PublicDelegatedPrefixList + */ + PublicDelegatedPrefixList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PublicDelegatedPrefixList) + return object; + var message = new $root.google.cloud.compute.v1.PublicDelegatedPrefixList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.PublicDelegatedPrefix.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.PublicDelegatedPrefixList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a PublicDelegatedPrefixList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @static + * @param {google.cloud.compute.v1.PublicDelegatedPrefixList} message PublicDelegatedPrefixList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicDelegatedPrefixList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.PublicDelegatedPrefix.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this PublicDelegatedPrefixList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixList + * @instance + * @returns {Object.} JSON object + */ + PublicDelegatedPrefixList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicDelegatedPrefixList; + })(); + + v1.Region = (function() { + + /** + * Properties of a Region. + * @memberof google.cloud.compute.v1 + * @interface IRegion + * @property {string|null} [creationTimestamp] Region creationTimestamp + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecated] Region deprecated + * @property {string|null} [description] Region description + * @property {number|Long|null} [id] Region id + * @property {string|null} [kind] Region kind + * @property {string|null} [name] Region name + * @property {Array.|null} [quotas] Region quotas + * @property {string|null} [selfLink] Region selfLink + * @property {google.cloud.compute.v1.Region.Status|null} [status] Region status + * @property {boolean|null} [supportsPzs] Region supportsPzs + * @property {Array.|null} [zones] Region zones + */ + + /** + * Constructs a new Region. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Region. + * @implements IRegion + * @constructor + * @param {google.cloud.compute.v1.IRegion=} [properties] Properties to set + */ + function Region(properties) { + this.quotas = []; + 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]]; + } + + /** + * Region creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.creationTimestamp = null; + + /** + * Region deprecated. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecated + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.deprecated = null; + + /** + * Region description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.description = null; + + /** + * Region id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.id = null; + + /** + * Region kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.kind = null; + + /** + * Region name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.name = null; + + /** + * Region quotas. + * @member {Array.} quotas + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.quotas = $util.emptyArray; + + /** + * Region selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.selfLink = null; + + /** + * Region status. + * @member {google.cloud.compute.v1.Region.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.status = null; + + /** + * Region supportsPzs. + * @member {boolean|null|undefined} supportsPzs + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.supportsPzs = null; + + /** + * Region zones. + * @member {Array.} zones + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Region.prototype.zones = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Region _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Region _supportsPzs. + * @member {"supportsPzs"|undefined} _supportsPzs + * @memberof google.cloud.compute.v1.Region + * @instance + */ + Object.defineProperty(Region.prototype, "_supportsPzs", { + get: $util.oneOfGetter($oneOfFields = ["supportsPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Region instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Region + * @static + * @param {google.cloud.compute.v1.IRegion=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Region} Region instance + */ + Region.create = function create(properties) { + return new Region(properties); + }; + + /** + * Encodes the specified Region message. Does not implicitly {@link google.cloud.compute.v1.Region.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Region + * @static + * @param {google.cloud.compute.v1.IRegion} message Region message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Region.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.supportsPzs != null && Object.hasOwnProperty.call(message, "supportsPzs")) + writer.uint32(/* id 83983214, wireType 0 =*/671865712).bool(message.supportsPzs); + if (message.zones != null && message.zones.length) + for (var i = 0; i < message.zones.length; ++i) + writer.uint32(/* id 116085319, wireType 2 =*/928682554).string(message.zones[i]); + if (message.quotas != null && message.quotas.length) + for (var i = 0; i < message.quotas.length; ++i) + $root.google.cloud.compute.v1.Quota.encode(message.quotas[i], writer.uint32(/* id 125341947, wireType 2 =*/1002735578).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecated, writer.uint32(/* id 515138995, wireType 2 =*/4121111962).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Region message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Region.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Region + * @static + * @param {google.cloud.compute.v1.IRegion} message Region message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Region.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Region message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Region + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Region} Region + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Region.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Region(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 515138995: + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 125341947: + if (!(message.quotas && message.quotas.length)) + message.quotas = []; + message.quotas.push($root.google.cloud.compute.v1.Quota.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 83983214: + message.supportsPzs = reader.bool(); + break; + case 116085319: + if (!(message.zones && message.zones.length)) + message.zones = []; + message.zones.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Region message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Region + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Region} Region + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Region.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Region message. + * @function verify + * @memberof google.cloud.compute.v1.Region + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Region.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecated); + if (error) + return "deprecated." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.quotas != null && message.hasOwnProperty("quotas")) { + if (!Array.isArray(message.quotas)) + return "quotas: array expected"; + for (var i = 0; i < message.quotas.length; ++i) { + var error = $root.google.cloud.compute.v1.Quota.verify(message.quotas[i]); + if (error) + return "quotas." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 2104482: + case 2715: + break; + } + } + if (message.supportsPzs != null && message.hasOwnProperty("supportsPzs")) { + properties._supportsPzs = 1; + if (typeof message.supportsPzs !== "boolean") + return "supportsPzs: boolean 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"; + } + return null; + }; + + /** + * Creates a Region message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Region + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Region} Region + */ + Region.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Region) + return object; + var message = new $root.google.cloud.compute.v1.Region(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.deprecated != null) { + if (typeof object.deprecated !== "object") + throw TypeError(".google.cloud.compute.v1.Region.deprecated: object expected"); + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecated); + } + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.quotas) { + if (!Array.isArray(object.quotas)) + throw TypeError(".google.cloud.compute.v1.Region.quotas: array expected"); + message.quotas = []; + for (var i = 0; i < object.quotas.length; ++i) { + if (typeof object.quotas[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Region.quotas: object expected"); + message.quotas[i] = $root.google.cloud.compute.v1.Quota.fromObject(object.quotas[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "DOWN": + case 2104482: + message.status = 2104482; + break; + case "UP": + case 2715: + message.status = 2715; + break; + } + if (object.supportsPzs != null) + message.supportsPzs = Boolean(object.supportsPzs); + if (object.zones) { + if (!Array.isArray(object.zones)) + throw TypeError(".google.cloud.compute.v1.Region.zones: array expected"); + message.zones = []; + for (var i = 0; i < object.zones.length; ++i) + message.zones[i] = String(object.zones[i]); + } + return message; + }; + + /** + * Creates a plain object from a Region message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Region + * @static + * @param {google.cloud.compute.v1.Region} message Region + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Region.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.zones = []; + object.quotas = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.supportsPzs != null && message.hasOwnProperty("supportsPzs")) { + object.supportsPzs = message.supportsPzs; + if (options.oneofs) + object._supportsPzs = "supportsPzs"; + } + 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.quotas && message.quotas.length) { + object.quotas = []; + for (var j = 0; j < message.quotas.length; ++j) + object.quotas[j] = $root.google.cloud.compute.v1.Quota.toObject(message.quotas[j], options); + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Region.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecated, options); + if (options.oneofs) + object._deprecated = "deprecated"; + } + return object; + }; + + /** + * Converts this Region to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Region + * @instance + * @returns {Object.} JSON object + */ + Region.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.Region.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} DOWN=2104482 DOWN value + * @property {number} UP=2715 UP value + */ + Region.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[2104482] = "DOWN"] = 2104482; + values[valuesById[2715] = "UP"] = 2715; + return values; + })(); + + return Region; + })(); + + v1.RegionAutoscalerList = (function() { + + /** + * Properties of a RegionAutoscalerList. + * @memberof google.cloud.compute.v1 + * @interface IRegionAutoscalerList + * @property {string|null} [id] RegionAutoscalerList id + * @property {Array.|null} [items] RegionAutoscalerList items + * @property {string|null} [kind] RegionAutoscalerList kind + * @property {string|null} [nextPageToken] RegionAutoscalerList nextPageToken + * @property {string|null} [selfLink] RegionAutoscalerList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RegionAutoscalerList warning + */ + + /** + * Constructs a new RegionAutoscalerList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionAutoscalerList. + * @implements IRegionAutoscalerList + * @constructor + * @param {google.cloud.compute.v1.IRegionAutoscalerList=} [properties] Properties to set + */ + function RegionAutoscalerList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionAutoscalerList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + RegionAutoscalerList.prototype.id = null; + + /** + * RegionAutoscalerList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + RegionAutoscalerList.prototype.items = $util.emptyArray; + + /** + * RegionAutoscalerList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + RegionAutoscalerList.prototype.kind = null; + + /** + * RegionAutoscalerList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + RegionAutoscalerList.prototype.nextPageToken = null; + + /** + * RegionAutoscalerList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + RegionAutoscalerList.prototype.selfLink = null; + + /** + * RegionAutoscalerList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + RegionAutoscalerList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionAutoscalerList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + Object.defineProperty(RegionAutoscalerList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionAutoscalerList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + Object.defineProperty(RegionAutoscalerList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionAutoscalerList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + Object.defineProperty(RegionAutoscalerList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionAutoscalerList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + Object.defineProperty(RegionAutoscalerList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionAutoscalerList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + */ + Object.defineProperty(RegionAutoscalerList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionAutoscalerList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {google.cloud.compute.v1.IRegionAutoscalerList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionAutoscalerList} RegionAutoscalerList instance + */ + RegionAutoscalerList.create = function create(properties) { + return new RegionAutoscalerList(properties); + }; + + /** + * Encodes the specified RegionAutoscalerList message. Does not implicitly {@link google.cloud.compute.v1.RegionAutoscalerList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {google.cloud.compute.v1.IRegionAutoscalerList} message RegionAutoscalerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionAutoscalerList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Autoscaler.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RegionAutoscalerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionAutoscalerList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {google.cloud.compute.v1.IRegionAutoscalerList} message RegionAutoscalerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionAutoscalerList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionAutoscalerList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionAutoscalerList} RegionAutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionAutoscalerList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionAutoscalerList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionAutoscalerList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionAutoscalerList} RegionAutoscalerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionAutoscalerList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionAutoscalerList message. + * @function verify + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionAutoscalerList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RegionAutoscalerList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionAutoscalerList} RegionAutoscalerList + */ + RegionAutoscalerList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionAutoscalerList) + return object; + var message = new $root.google.cloud.compute.v1.RegionAutoscalerList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionAutoscalerList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionAutoscalerList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RegionAutoscalerList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RegionAutoscalerList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @static + * @param {google.cloud.compute.v1.RegionAutoscalerList} message RegionAutoscalerList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionAutoscalerList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Autoscaler.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RegionAutoscalerList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionAutoscalerList + * @instance + * @returns {Object.} JSON object + */ + RegionAutoscalerList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionAutoscalerList; + })(); + + v1.RegionDiskTypeList = (function() { + + /** + * Properties of a RegionDiskTypeList. + * @memberof google.cloud.compute.v1 + * @interface IRegionDiskTypeList + * @property {string|null} [id] RegionDiskTypeList id + * @property {Array.|null} [items] RegionDiskTypeList items + * @property {string|null} [kind] RegionDiskTypeList kind + * @property {string|null} [nextPageToken] RegionDiskTypeList nextPageToken + * @property {string|null} [selfLink] RegionDiskTypeList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RegionDiskTypeList warning + */ + + /** + * Constructs a new RegionDiskTypeList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionDiskTypeList. + * @implements IRegionDiskTypeList + * @constructor + * @param {google.cloud.compute.v1.IRegionDiskTypeList=} [properties] Properties to set + */ + function RegionDiskTypeList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionDiskTypeList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + RegionDiskTypeList.prototype.id = null; + + /** + * RegionDiskTypeList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + RegionDiskTypeList.prototype.items = $util.emptyArray; + + /** + * RegionDiskTypeList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + RegionDiskTypeList.prototype.kind = null; + + /** + * RegionDiskTypeList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + RegionDiskTypeList.prototype.nextPageToken = null; + + /** + * RegionDiskTypeList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + RegionDiskTypeList.prototype.selfLink = null; + + /** + * RegionDiskTypeList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + RegionDiskTypeList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionDiskTypeList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + Object.defineProperty(RegionDiskTypeList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionDiskTypeList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + Object.defineProperty(RegionDiskTypeList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionDiskTypeList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + Object.defineProperty(RegionDiskTypeList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionDiskTypeList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + Object.defineProperty(RegionDiskTypeList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionDiskTypeList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + */ + Object.defineProperty(RegionDiskTypeList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionDiskTypeList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {google.cloud.compute.v1.IRegionDiskTypeList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionDiskTypeList} RegionDiskTypeList instance + */ + RegionDiskTypeList.create = function create(properties) { + return new RegionDiskTypeList(properties); + }; + + /** + * Encodes the specified RegionDiskTypeList message. Does not implicitly {@link google.cloud.compute.v1.RegionDiskTypeList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {google.cloud.compute.v1.IRegionDiskTypeList} message RegionDiskTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDiskTypeList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.DiskType.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RegionDiskTypeList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDiskTypeList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {google.cloud.compute.v1.IRegionDiskTypeList} message RegionDiskTypeList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDiskTypeList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionDiskTypeList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionDiskTypeList} RegionDiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDiskTypeList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionDiskTypeList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.DiskType.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionDiskTypeList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionDiskTypeList} RegionDiskTypeList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDiskTypeList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionDiskTypeList message. + * @function verify + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionDiskTypeList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.DiskType.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RegionDiskTypeList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionDiskTypeList} RegionDiskTypeList + */ + RegionDiskTypeList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionDiskTypeList) + return object; + var message = new $root.google.cloud.compute.v1.RegionDiskTypeList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionDiskTypeList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionDiskTypeList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.DiskType.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RegionDiskTypeList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RegionDiskTypeList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @static + * @param {google.cloud.compute.v1.RegionDiskTypeList} message RegionDiskTypeList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionDiskTypeList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.DiskType.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RegionDiskTypeList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionDiskTypeList + * @instance + * @returns {Object.} JSON object + */ + RegionDiskTypeList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionDiskTypeList; + })(); + + v1.RegionDisksAddResourcePoliciesRequest = (function() { + + /** + * Properties of a RegionDisksAddResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionDisksAddResourcePoliciesRequest + * @property {Array.|null} [resourcePolicies] RegionDisksAddResourcePoliciesRequest resourcePolicies + */ + + /** + * Constructs a new RegionDisksAddResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionDisksAddResourcePoliciesRequest. + * @implements IRegionDisksAddResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest=} [properties] Properties to set + */ + function RegionDisksAddResourcePoliciesRequest(properties) { + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionDisksAddResourcePoliciesRequest resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @instance + */ + RegionDisksAddResourcePoliciesRequest.prototype.resourcePolicies = $util.emptyArray; + + /** + * Creates a new RegionDisksAddResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest} RegionDisksAddResourcePoliciesRequest instance + */ + RegionDisksAddResourcePoliciesRequest.create = function create(properties) { + return new RegionDisksAddResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified RegionDisksAddResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest} message RegionDisksAddResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDisksAddResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + return writer; + }; + + /** + * Encodes the specified RegionDisksAddResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest} message RegionDisksAddResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDisksAddResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionDisksAddResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest} RegionDisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDisksAddResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionDisksAddResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest} RegionDisksAddResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDisksAddResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionDisksAddResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionDisksAddResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionDisksAddResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest} RegionDisksAddResourcePoliciesRequest + */ + RegionDisksAddResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionDisksAddResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest} message RegionDisksAddResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionDisksAddResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + return object; + }; + + /** + * Converts this RegionDisksAddResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionDisksAddResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionDisksAddResourcePoliciesRequest; + })(); + + v1.RegionDisksRemoveResourcePoliciesRequest = (function() { + + /** + * Properties of a RegionDisksRemoveResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionDisksRemoveResourcePoliciesRequest + * @property {Array.|null} [resourcePolicies] RegionDisksRemoveResourcePoliciesRequest resourcePolicies + */ + + /** + * Constructs a new RegionDisksRemoveResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionDisksRemoveResourcePoliciesRequest. + * @implements IRegionDisksRemoveResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest=} [properties] Properties to set + */ + function RegionDisksRemoveResourcePoliciesRequest(properties) { + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionDisksRemoveResourcePoliciesRequest resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @instance + */ + RegionDisksRemoveResourcePoliciesRequest.prototype.resourcePolicies = $util.emptyArray; + + /** + * Creates a new RegionDisksRemoveResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest} RegionDisksRemoveResourcePoliciesRequest instance + */ + RegionDisksRemoveResourcePoliciesRequest.create = function create(properties) { + return new RegionDisksRemoveResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified RegionDisksRemoveResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest} message RegionDisksRemoveResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDisksRemoveResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22220385, wireType 2 =*/177763082).string(message.resourcePolicies[i]); + return writer; + }; + + /** + * Encodes the specified RegionDisksRemoveResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest} message RegionDisksRemoveResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDisksRemoveResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionDisksRemoveResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest} RegionDisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDisksRemoveResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionDisksRemoveResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest} RegionDisksRemoveResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDisksRemoveResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionDisksRemoveResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionDisksRemoveResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionDisksRemoveResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest} RegionDisksRemoveResourcePoliciesRequest + */ + RegionDisksRemoveResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionDisksRemoveResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest} message RegionDisksRemoveResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionDisksRemoveResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + return object; + }; + + /** + * Converts this RegionDisksRemoveResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionDisksRemoveResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionDisksRemoveResourcePoliciesRequest; + })(); + + v1.RegionDisksResizeRequest = (function() { + + /** + * Properties of a RegionDisksResizeRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionDisksResizeRequest + * @property {number|Long|null} [sizeGb] RegionDisksResizeRequest sizeGb + */ + + /** + * Constructs a new RegionDisksResizeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionDisksResizeRequest. + * @implements IRegionDisksResizeRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionDisksResizeRequest=} [properties] Properties to set + */ + function RegionDisksResizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionDisksResizeRequest sizeGb. + * @member {number|Long|null|undefined} sizeGb + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @instance + */ + RegionDisksResizeRequest.prototype.sizeGb = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionDisksResizeRequest _sizeGb. + * @member {"sizeGb"|undefined} _sizeGb + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @instance + */ + Object.defineProperty(RegionDisksResizeRequest.prototype, "_sizeGb", { + get: $util.oneOfGetter($oneOfFields = ["sizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionDisksResizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksResizeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionDisksResizeRequest} RegionDisksResizeRequest instance + */ + RegionDisksResizeRequest.create = function create(properties) { + return new RegionDisksResizeRequest(properties); + }; + + /** + * Encodes the specified RegionDisksResizeRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionDisksResizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksResizeRequest} message RegionDisksResizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDisksResizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 494929369, wireType 0 =*/3959434952).int64(message.sizeGb); + return writer; + }; + + /** + * Encodes the specified RegionDisksResizeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionDisksResizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {google.cloud.compute.v1.IRegionDisksResizeRequest} message RegionDisksResizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDisksResizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionDisksResizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionDisksResizeRequest} RegionDisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDisksResizeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionDisksResizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 494929369: + message.sizeGb = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionDisksResizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionDisksResizeRequest} RegionDisksResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDisksResizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionDisksResizeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionDisksResizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + properties._sizeGb = 1; + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + } + return null; + }; + + /** + * Creates a RegionDisksResizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionDisksResizeRequest} RegionDisksResizeRequest + */ + RegionDisksResizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionDisksResizeRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionDisksResizeRequest(); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a RegionDisksResizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @static + * @param {google.cloud.compute.v1.RegionDisksResizeRequest} message RegionDisksResizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionDisksResizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (options.oneofs) + object._sizeGb = "sizeGb"; + } + return object; + }; + + /** + * Converts this RegionDisksResizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionDisksResizeRequest + * @instance + * @returns {Object.} JSON object + */ + RegionDisksResizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionDisksResizeRequest; + })(); + + v1.RegionInstanceGroupList = (function() { + + /** + * Properties of a RegionInstanceGroupList. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupList + * @property {string|null} [id] RegionInstanceGroupList id + * @property {Array.|null} [items] RegionInstanceGroupList items + * @property {string|null} [kind] RegionInstanceGroupList kind + * @property {string|null} [nextPageToken] RegionInstanceGroupList nextPageToken + * @property {string|null} [selfLink] RegionInstanceGroupList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RegionInstanceGroupList warning + */ + + /** + * Constructs a new RegionInstanceGroupList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupList. + * @implements IRegionInstanceGroupList + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupList=} [properties] Properties to set + */ + function RegionInstanceGroupList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + RegionInstanceGroupList.prototype.id = null; + + /** + * RegionInstanceGroupList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + RegionInstanceGroupList.prototype.items = $util.emptyArray; + + /** + * RegionInstanceGroupList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + RegionInstanceGroupList.prototype.kind = null; + + /** + * RegionInstanceGroupList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + RegionInstanceGroupList.prototype.nextPageToken = null; + + /** + * RegionInstanceGroupList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + RegionInstanceGroupList.prototype.selfLink = null; + + /** + * RegionInstanceGroupList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + RegionInstanceGroupList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + Object.defineProperty(RegionInstanceGroupList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + Object.defineProperty(RegionInstanceGroupList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + Object.defineProperty(RegionInstanceGroupList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + Object.defineProperty(RegionInstanceGroupList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + */ + Object.defineProperty(RegionInstanceGroupList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupList} RegionInstanceGroupList instance + */ + RegionInstanceGroupList.create = function create(properties) { + return new RegionInstanceGroupList(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupList message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupList} message RegionInstanceGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceGroup.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupList} message RegionInstanceGroupList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupList} RegionInstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceGroup.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupList} RegionInstanceGroupList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupList message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroup.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupList} RegionInstanceGroupList + */ + RegionInstanceGroupList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupList) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceGroup.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupList} message RegionInstanceGroupList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceGroup.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupList + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupList; + })(); + + v1.RegionInstanceGroupManagerDeleteInstanceConfigReq = (function() { + + /** + * Properties of a RegionInstanceGroupManagerDeleteInstanceConfigReq. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagerDeleteInstanceConfigReq + * @property {Array.|null} [names] RegionInstanceGroupManagerDeleteInstanceConfigReq names + */ + + /** + * Constructs a new RegionInstanceGroupManagerDeleteInstanceConfigReq. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagerDeleteInstanceConfigReq. + * @implements IRegionInstanceGroupManagerDeleteInstanceConfigReq + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq=} [properties] Properties to set + */ + function RegionInstanceGroupManagerDeleteInstanceConfigReq(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagerDeleteInstanceConfigReq names. + * @member {Array.} names + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @instance + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.prototype.names = $util.emptyArray; + + /** + * Creates a new RegionInstanceGroupManagerDeleteInstanceConfigReq instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq} RegionInstanceGroupManagerDeleteInstanceConfigReq instance + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.create = function create(properties) { + return new RegionInstanceGroupManagerDeleteInstanceConfigReq(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagerDeleteInstanceConfigReq message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq} message RegionInstanceGroupManagerDeleteInstanceConfigReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 104585032, wireType 2 =*/836680258).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagerDeleteInstanceConfigReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq} message RegionInstanceGroupManagerDeleteInstanceConfigReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagerDeleteInstanceConfigReq message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq} RegionInstanceGroupManagerDeleteInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 104585032: + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagerDeleteInstanceConfigReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq} RegionInstanceGroupManagerDeleteInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagerDeleteInstanceConfigReq message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagerDeleteInstanceConfigReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq} RegionInstanceGroupManagerDeleteInstanceConfigReq + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq(); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagerDeleteInstanceConfigReq message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq} message RegionInstanceGroupManagerDeleteInstanceConfigReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagerDeleteInstanceConfigReq to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagerDeleteInstanceConfigReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagerDeleteInstanceConfigReq; + })(); + + v1.RegionInstanceGroupManagerList = (function() { + + /** + * Properties of a RegionInstanceGroupManagerList. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagerList + * @property {string|null} [id] RegionInstanceGroupManagerList id + * @property {Array.|null} [items] RegionInstanceGroupManagerList items + * @property {string|null} [kind] RegionInstanceGroupManagerList kind + * @property {string|null} [nextPageToken] RegionInstanceGroupManagerList nextPageToken + * @property {string|null} [selfLink] RegionInstanceGroupManagerList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RegionInstanceGroupManagerList warning + */ + + /** + * Constructs a new RegionInstanceGroupManagerList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagerList. + * @implements IRegionInstanceGroupManagerList + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerList=} [properties] Properties to set + */ + function RegionInstanceGroupManagerList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagerList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + RegionInstanceGroupManagerList.prototype.id = null; + + /** + * RegionInstanceGroupManagerList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + RegionInstanceGroupManagerList.prototype.items = $util.emptyArray; + + /** + * RegionInstanceGroupManagerList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + RegionInstanceGroupManagerList.prototype.kind = null; + + /** + * RegionInstanceGroupManagerList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + RegionInstanceGroupManagerList.prototype.nextPageToken = null; + + /** + * RegionInstanceGroupManagerList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + RegionInstanceGroupManagerList.prototype.selfLink = null; + + /** + * RegionInstanceGroupManagerList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + RegionInstanceGroupManagerList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupManagerList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagerList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupManagerList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagerList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupManagerList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagerList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupManagerList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagerList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupManagerList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagerList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupManagerList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerList} RegionInstanceGroupManagerList instance + */ + RegionInstanceGroupManagerList.create = function create(properties) { + return new RegionInstanceGroupManagerList(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagerList message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerList} message RegionInstanceGroupManagerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceGroupManager.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagerList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerList} message RegionInstanceGroupManagerList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagerList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerList} RegionInstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceGroupManager.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagerList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerList} RegionInstanceGroupManagerList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagerList message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagerList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceGroupManager.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagerList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerList} RegionInstanceGroupManagerList + */ + RegionInstanceGroupManagerList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagerList) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceGroupManager.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagerList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerList} message RegionInstanceGroupManagerList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagerList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceGroupManager.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagerList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerList + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagerList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagerList; + })(); + + v1.RegionInstanceGroupManagerPatchInstanceConfigReq = (function() { + + /** + * Properties of a RegionInstanceGroupManagerPatchInstanceConfigReq. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagerPatchInstanceConfigReq + * @property {Array.|null} [perInstanceConfigs] RegionInstanceGroupManagerPatchInstanceConfigReq perInstanceConfigs + */ + + /** + * Constructs a new RegionInstanceGroupManagerPatchInstanceConfigReq. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagerPatchInstanceConfigReq. + * @implements IRegionInstanceGroupManagerPatchInstanceConfigReq + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq=} [properties] Properties to set + */ + function RegionInstanceGroupManagerPatchInstanceConfigReq(properties) { + this.perInstanceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagerPatchInstanceConfigReq perInstanceConfigs. + * @member {Array.} perInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @instance + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.prototype.perInstanceConfigs = $util.emptyArray; + + /** + * Creates a new RegionInstanceGroupManagerPatchInstanceConfigReq instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq} RegionInstanceGroupManagerPatchInstanceConfigReq instance + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.create = function create(properties) { + return new RegionInstanceGroupManagerPatchInstanceConfigReq(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagerPatchInstanceConfigReq message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq} message RegionInstanceGroupManagerPatchInstanceConfigReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.perInstanceConfigs != null && message.perInstanceConfigs.length) + for (var i = 0; i < message.perInstanceConfigs.length; ++i) + $root.google.cloud.compute.v1.PerInstanceConfig.encode(message.perInstanceConfigs[i], writer.uint32(/* id 526265001, wireType 2 =*/4210120010).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagerPatchInstanceConfigReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq} message RegionInstanceGroupManagerPatchInstanceConfigReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagerPatchInstanceConfigReq message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq} RegionInstanceGroupManagerPatchInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 526265001: + if (!(message.perInstanceConfigs && message.perInstanceConfigs.length)) + message.perInstanceConfigs = []; + message.perInstanceConfigs.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagerPatchInstanceConfigReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq} RegionInstanceGroupManagerPatchInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagerPatchInstanceConfigReq message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.perInstanceConfigs != null && message.hasOwnProperty("perInstanceConfigs")) { + if (!Array.isArray(message.perInstanceConfigs)) + return "perInstanceConfigs: array expected"; + for (var i = 0; i < message.perInstanceConfigs.length; ++i) { + var error = $root.google.cloud.compute.v1.PerInstanceConfig.verify(message.perInstanceConfigs[i]); + if (error) + return "perInstanceConfigs." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagerPatchInstanceConfigReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq} RegionInstanceGroupManagerPatchInstanceConfigReq + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq(); + if (object.perInstanceConfigs) { + if (!Array.isArray(object.perInstanceConfigs)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.perInstanceConfigs: array expected"); + message.perInstanceConfigs = []; + for (var i = 0; i < object.perInstanceConfigs.length; ++i) { + if (typeof object.perInstanceConfigs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.perInstanceConfigs: object expected"); + message.perInstanceConfigs[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.perInstanceConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagerPatchInstanceConfigReq message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq} message RegionInstanceGroupManagerPatchInstanceConfigReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.perInstanceConfigs = []; + if (message.perInstanceConfigs && message.perInstanceConfigs.length) { + object.perInstanceConfigs = []; + for (var j = 0; j < message.perInstanceConfigs.length; ++j) + object.perInstanceConfigs[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.perInstanceConfigs[j], options); + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagerPatchInstanceConfigReq to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagerPatchInstanceConfigReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagerPatchInstanceConfigReq; + })(); + + v1.RegionInstanceGroupManagerUpdateInstanceConfigReq = (function() { + + /** + * Properties of a RegionInstanceGroupManagerUpdateInstanceConfigReq. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagerUpdateInstanceConfigReq + * @property {Array.|null} [perInstanceConfigs] RegionInstanceGroupManagerUpdateInstanceConfigReq perInstanceConfigs + */ + + /** + * Constructs a new RegionInstanceGroupManagerUpdateInstanceConfigReq. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagerUpdateInstanceConfigReq. + * @implements IRegionInstanceGroupManagerUpdateInstanceConfigReq + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq=} [properties] Properties to set + */ + function RegionInstanceGroupManagerUpdateInstanceConfigReq(properties) { + this.perInstanceConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagerUpdateInstanceConfigReq perInstanceConfigs. + * @member {Array.} perInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @instance + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.prototype.perInstanceConfigs = $util.emptyArray; + + /** + * Creates a new RegionInstanceGroupManagerUpdateInstanceConfigReq instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq} RegionInstanceGroupManagerUpdateInstanceConfigReq instance + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.create = function create(properties) { + return new RegionInstanceGroupManagerUpdateInstanceConfigReq(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagerUpdateInstanceConfigReq message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq} message RegionInstanceGroupManagerUpdateInstanceConfigReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.perInstanceConfigs != null && message.perInstanceConfigs.length) + for (var i = 0; i < message.perInstanceConfigs.length; ++i) + $root.google.cloud.compute.v1.PerInstanceConfig.encode(message.perInstanceConfigs[i], writer.uint32(/* id 526265001, wireType 2 =*/4210120010).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagerUpdateInstanceConfigReq message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq} message RegionInstanceGroupManagerUpdateInstanceConfigReq message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagerUpdateInstanceConfigReq message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq} RegionInstanceGroupManagerUpdateInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 526265001: + if (!(message.perInstanceConfigs && message.perInstanceConfigs.length)) + message.perInstanceConfigs = []; + message.perInstanceConfigs.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagerUpdateInstanceConfigReq message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq} RegionInstanceGroupManagerUpdateInstanceConfigReq + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagerUpdateInstanceConfigReq message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.perInstanceConfigs != null && message.hasOwnProperty("perInstanceConfigs")) { + if (!Array.isArray(message.perInstanceConfigs)) + return "perInstanceConfigs: array expected"; + for (var i = 0; i < message.perInstanceConfigs.length; ++i) { + var error = $root.google.cloud.compute.v1.PerInstanceConfig.verify(message.perInstanceConfigs[i]); + if (error) + return "perInstanceConfigs." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagerUpdateInstanceConfigReq message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq} RegionInstanceGroupManagerUpdateInstanceConfigReq + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq(); + if (object.perInstanceConfigs) { + if (!Array.isArray(object.perInstanceConfigs)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.perInstanceConfigs: array expected"); + message.perInstanceConfigs = []; + for (var i = 0; i < object.perInstanceConfigs.length; ++i) { + if (typeof object.perInstanceConfigs[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.perInstanceConfigs: object expected"); + message.perInstanceConfigs[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.perInstanceConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagerUpdateInstanceConfigReq message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq} message RegionInstanceGroupManagerUpdateInstanceConfigReq + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.perInstanceConfigs = []; + if (message.perInstanceConfigs && message.perInstanceConfigs.length) { + object.perInstanceConfigs = []; + for (var j = 0; j < message.perInstanceConfigs.length; ++j) + object.perInstanceConfigs[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.perInstanceConfigs[j], options); + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagerUpdateInstanceConfigReq to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagerUpdateInstanceConfigReq.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagerUpdateInstanceConfigReq; + })(); + + v1.RegionInstanceGroupManagersAbandonInstancesRequest = (function() { + + /** + * Properties of a RegionInstanceGroupManagersAbandonInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersAbandonInstancesRequest + * @property {Array.|null} [instances] RegionInstanceGroupManagersAbandonInstancesRequest instances + */ + + /** + * Constructs a new RegionInstanceGroupManagersAbandonInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersAbandonInstancesRequest. + * @implements IRegionInstanceGroupManagersAbandonInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest=} [properties] Properties to set + */ + function RegionInstanceGroupManagersAbandonInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersAbandonInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @instance + */ + RegionInstanceGroupManagersAbandonInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new RegionInstanceGroupManagersAbandonInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest} RegionInstanceGroupManagersAbandonInstancesRequest instance + */ + RegionInstanceGroupManagersAbandonInstancesRequest.create = function create(properties) { + return new RegionInstanceGroupManagersAbandonInstancesRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersAbandonInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest} message RegionInstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersAbandonInstancesRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersAbandonInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest} message RegionInstanceGroupManagersAbandonInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersAbandonInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest} RegionInstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersAbandonInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersAbandonInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest} RegionInstanceGroupManagersAbandonInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersAbandonInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersAbandonInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersAbandonInstancesRequest.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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersAbandonInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest} RegionInstanceGroupManagersAbandonInstancesRequest + */ + RegionInstanceGroupManagersAbandonInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersAbandonInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest} message RegionInstanceGroupManagersAbandonInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersAbandonInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersAbandonInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersAbandonInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersAbandonInstancesRequest; + })(); + + v1.RegionInstanceGroupManagersApplyUpdatesRequest = (function() { + + /** + * Properties of a RegionInstanceGroupManagersApplyUpdatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersApplyUpdatesRequest + * @property {boolean|null} [allInstances] RegionInstanceGroupManagersApplyUpdatesRequest allInstances + * @property {Array.|null} [instances] RegionInstanceGroupManagersApplyUpdatesRequest instances + * @property {string|null} [minimalAction] RegionInstanceGroupManagersApplyUpdatesRequest minimalAction + * @property {string|null} [mostDisruptiveAllowedAction] RegionInstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction + */ + + /** + * Constructs a new RegionInstanceGroupManagersApplyUpdatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersApplyUpdatesRequest. + * @implements IRegionInstanceGroupManagersApplyUpdatesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest=} [properties] Properties to set + */ + function RegionInstanceGroupManagersApplyUpdatesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersApplyUpdatesRequest allInstances. + * @member {boolean|null|undefined} allInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + */ + RegionInstanceGroupManagersApplyUpdatesRequest.prototype.allInstances = null; + + /** + * RegionInstanceGroupManagersApplyUpdatesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + */ + RegionInstanceGroupManagersApplyUpdatesRequest.prototype.instances = $util.emptyArray; + + /** + * RegionInstanceGroupManagersApplyUpdatesRequest minimalAction. + * @member {string|null|undefined} minimalAction + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + */ + RegionInstanceGroupManagersApplyUpdatesRequest.prototype.minimalAction = null; + + /** + * RegionInstanceGroupManagersApplyUpdatesRequest mostDisruptiveAllowedAction. + * @member {string|null|undefined} mostDisruptiveAllowedAction + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + */ + RegionInstanceGroupManagersApplyUpdatesRequest.prototype.mostDisruptiveAllowedAction = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupManagersApplyUpdatesRequest _allInstances. + * @member {"allInstances"|undefined} _allInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersApplyUpdatesRequest.prototype, "_allInstances", { + get: $util.oneOfGetter($oneOfFields = ["allInstances"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupManagersApplyUpdatesRequest _minimalAction. + * @member {"minimalAction"|undefined} _minimalAction + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersApplyUpdatesRequest.prototype, "_minimalAction", { + get: $util.oneOfGetter($oneOfFields = ["minimalAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupManagersApplyUpdatesRequest _mostDisruptiveAllowedAction. + * @member {"mostDisruptiveAllowedAction"|undefined} _mostDisruptiveAllowedAction + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersApplyUpdatesRequest.prototype, "_mostDisruptiveAllowedAction", { + get: $util.oneOfGetter($oneOfFields = ["mostDisruptiveAllowedAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupManagersApplyUpdatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest} RegionInstanceGroupManagersApplyUpdatesRequest instance + */ + RegionInstanceGroupManagersApplyUpdatesRequest.create = function create(properties) { + return new RegionInstanceGroupManagersApplyUpdatesRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersApplyUpdatesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest} message RegionInstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersApplyUpdatesRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + if (message.mostDisruptiveAllowedAction != null && Object.hasOwnProperty.call(message, "mostDisruptiveAllowedAction")) + writer.uint32(/* id 66103053, wireType 2 =*/528824426).string(message.mostDisruptiveAllowedAction); + if (message.minimalAction != null && Object.hasOwnProperty.call(message, "minimalAction")) + writer.uint32(/* id 270567060, wireType 2 =*/2164536482).string(message.minimalAction); + if (message.allInstances != null && Object.hasOwnProperty.call(message, "allInstances")) + writer.uint32(/* id 403676512, wireType 0 =*/3229412096).bool(message.allInstances); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersApplyUpdatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest} message RegionInstanceGroupManagersApplyUpdatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersApplyUpdatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest} RegionInstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersApplyUpdatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 403676512: + message.allInstances = reader.bool(); + break; + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + case 270567060: + message.minimalAction = reader.string(); + break; + case 66103053: + message.mostDisruptiveAllowedAction = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersApplyUpdatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest} RegionInstanceGroupManagersApplyUpdatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersApplyUpdatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersApplyUpdatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersApplyUpdatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.allInstances != null && message.hasOwnProperty("allInstances")) { + properties._allInstances = 1; + if (typeof message.allInstances !== "boolean") + return "allInstances: boolean 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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + properties._minimalAction = 1; + if (!$util.isString(message.minimalAction)) + return "minimalAction: string expected"; + } + if (message.mostDisruptiveAllowedAction != null && message.hasOwnProperty("mostDisruptiveAllowedAction")) { + properties._mostDisruptiveAllowedAction = 1; + if (!$util.isString(message.mostDisruptiveAllowedAction)) + return "mostDisruptiveAllowedAction: string expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersApplyUpdatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest} RegionInstanceGroupManagersApplyUpdatesRequest + */ + RegionInstanceGroupManagersApplyUpdatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest(); + if (object.allInstances != null) + message.allInstances = Boolean(object.allInstances); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + if (object.minimalAction != null) + message.minimalAction = String(object.minimalAction); + if (object.mostDisruptiveAllowedAction != null) + message.mostDisruptiveAllowedAction = String(object.mostDisruptiveAllowedAction); + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersApplyUpdatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest} message RegionInstanceGroupManagersApplyUpdatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersApplyUpdatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + if (message.mostDisruptiveAllowedAction != null && message.hasOwnProperty("mostDisruptiveAllowedAction")) { + object.mostDisruptiveAllowedAction = message.mostDisruptiveAllowedAction; + if (options.oneofs) + object._mostDisruptiveAllowedAction = "mostDisruptiveAllowedAction"; + } + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + object.minimalAction = message.minimalAction; + if (options.oneofs) + object._minimalAction = "minimalAction"; + } + if (message.allInstances != null && message.hasOwnProperty("allInstances")) { + object.allInstances = message.allInstances; + if (options.oneofs) + object._allInstances = "allInstances"; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersApplyUpdatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersApplyUpdatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersApplyUpdatesRequest; + })(); + + v1.RegionInstanceGroupManagersCreateInstancesRequest = (function() { + + /** + * Properties of a RegionInstanceGroupManagersCreateInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersCreateInstancesRequest + * @property {Array.|null} [instances] RegionInstanceGroupManagersCreateInstancesRequest instances + */ + + /** + * Constructs a new RegionInstanceGroupManagersCreateInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersCreateInstancesRequest. + * @implements IRegionInstanceGroupManagersCreateInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest=} [properties] Properties to set + */ + function RegionInstanceGroupManagersCreateInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersCreateInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @instance + */ + RegionInstanceGroupManagersCreateInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new RegionInstanceGroupManagersCreateInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest} RegionInstanceGroupManagersCreateInstancesRequest instance + */ + RegionInstanceGroupManagersCreateInstancesRequest.create = function create(properties) { + return new RegionInstanceGroupManagersCreateInstancesRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersCreateInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest} message RegionInstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersCreateInstancesRequest.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.compute.v1.PerInstanceConfig.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersCreateInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest} message RegionInstanceGroupManagersCreateInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersCreateInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest} RegionInstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersCreateInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersCreateInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest} RegionInstanceGroupManagersCreateInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersCreateInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersCreateInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersCreateInstancesRequest.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.compute.v1.PerInstanceConfig.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersCreateInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest} RegionInstanceGroupManagersCreateInstancesRequest + */ + RegionInstanceGroupManagersCreateInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersCreateInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest} message RegionInstanceGroupManagersCreateInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersCreateInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersCreateInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersCreateInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersCreateInstancesRequest; + })(); + + v1.RegionInstanceGroupManagersDeleteInstancesRequest = (function() { + + /** + * Properties of a RegionInstanceGroupManagersDeleteInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersDeleteInstancesRequest + * @property {Array.|null} [instances] RegionInstanceGroupManagersDeleteInstancesRequest instances + */ + + /** + * Constructs a new RegionInstanceGroupManagersDeleteInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersDeleteInstancesRequest. + * @implements IRegionInstanceGroupManagersDeleteInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest=} [properties] Properties to set + */ + function RegionInstanceGroupManagersDeleteInstancesRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersDeleteInstancesRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @instance + */ + RegionInstanceGroupManagersDeleteInstancesRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new RegionInstanceGroupManagersDeleteInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest} RegionInstanceGroupManagersDeleteInstancesRequest instance + */ + RegionInstanceGroupManagersDeleteInstancesRequest.create = function create(properties) { + return new RegionInstanceGroupManagersDeleteInstancesRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersDeleteInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest} message RegionInstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersDeleteInstancesRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersDeleteInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest} message RegionInstanceGroupManagersDeleteInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersDeleteInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest} RegionInstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersDeleteInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersDeleteInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest} RegionInstanceGroupManagersDeleteInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersDeleteInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersDeleteInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersDeleteInstancesRequest.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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersDeleteInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest} RegionInstanceGroupManagersDeleteInstancesRequest + */ + RegionInstanceGroupManagersDeleteInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersDeleteInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest} message RegionInstanceGroupManagersDeleteInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersDeleteInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersDeleteInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersDeleteInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersDeleteInstancesRequest; + })(); + + v1.RegionInstanceGroupManagersListErrorsResponse = (function() { + + /** + * Properties of a RegionInstanceGroupManagersListErrorsResponse. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersListErrorsResponse + * @property {Array.|null} [items] RegionInstanceGroupManagersListErrorsResponse items + * @property {string|null} [nextPageToken] RegionInstanceGroupManagersListErrorsResponse nextPageToken + */ + + /** + * Constructs a new RegionInstanceGroupManagersListErrorsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersListErrorsResponse. + * @implements IRegionInstanceGroupManagersListErrorsResponse + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse=} [properties] Properties to set + */ + function RegionInstanceGroupManagersListErrorsResponse(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersListErrorsResponse items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @instance + */ + RegionInstanceGroupManagersListErrorsResponse.prototype.items = $util.emptyArray; + + /** + * RegionInstanceGroupManagersListErrorsResponse nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @instance + */ + RegionInstanceGroupManagersListErrorsResponse.prototype.nextPageToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupManagersListErrorsResponse _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersListErrorsResponse.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupManagersListErrorsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse} RegionInstanceGroupManagersListErrorsResponse instance + */ + RegionInstanceGroupManagersListErrorsResponse.create = function create(properties) { + return new RegionInstanceGroupManagersListErrorsResponse(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersListErrorsResponse message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse} message RegionInstanceGroupManagersListErrorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersListErrorsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceManagedByIgmError.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersListErrorsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse} message RegionInstanceGroupManagersListErrorsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersListErrorsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersListErrorsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse} RegionInstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersListErrorsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceManagedByIgmError.decode(reader, reader.uint32())); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersListErrorsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse} RegionInstanceGroupManagersListErrorsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersListErrorsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersListErrorsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersListErrorsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceManagedByIgmError.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersListErrorsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse} RegionInstanceGroupManagersListErrorsResponse + */ + RegionInstanceGroupManagersListErrorsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceManagedByIgmError.fromObject(object.items[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersListErrorsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse} message RegionInstanceGroupManagersListErrorsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersListErrorsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceManagedByIgmError.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersListErrorsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersListErrorsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersListErrorsResponse; + })(); + + v1.RegionInstanceGroupManagersListInstanceConfigsResp = (function() { + + /** + * Properties of a RegionInstanceGroupManagersListInstanceConfigsResp. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersListInstanceConfigsResp + * @property {Array.|null} [items] RegionInstanceGroupManagersListInstanceConfigsResp items + * @property {string|null} [nextPageToken] RegionInstanceGroupManagersListInstanceConfigsResp nextPageToken + * @property {google.cloud.compute.v1.IWarning|null} [warning] RegionInstanceGroupManagersListInstanceConfigsResp warning + */ + + /** + * Constructs a new RegionInstanceGroupManagersListInstanceConfigsResp. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersListInstanceConfigsResp. + * @implements IRegionInstanceGroupManagersListInstanceConfigsResp + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp=} [properties] Properties to set + */ + function RegionInstanceGroupManagersListInstanceConfigsResp(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersListInstanceConfigsResp items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @instance + */ + RegionInstanceGroupManagersListInstanceConfigsResp.prototype.items = $util.emptyArray; + + /** + * RegionInstanceGroupManagersListInstanceConfigsResp nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @instance + */ + RegionInstanceGroupManagersListInstanceConfigsResp.prototype.nextPageToken = null; + + /** + * RegionInstanceGroupManagersListInstanceConfigsResp warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @instance + */ + RegionInstanceGroupManagersListInstanceConfigsResp.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupManagersListInstanceConfigsResp _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersListInstanceConfigsResp.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupManagersListInstanceConfigsResp _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersListInstanceConfigsResp.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupManagersListInstanceConfigsResp instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp} RegionInstanceGroupManagersListInstanceConfigsResp instance + */ + RegionInstanceGroupManagersListInstanceConfigsResp.create = function create(properties) { + return new RegionInstanceGroupManagersListInstanceConfigsResp(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstanceConfigsResp message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp} message RegionInstanceGroupManagersListInstanceConfigsResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersListInstanceConfigsResp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.PerInstanceConfig.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstanceConfigsResp message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp} message RegionInstanceGroupManagersListInstanceConfigsResp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersListInstanceConfigsResp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersListInstanceConfigsResp message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp} RegionInstanceGroupManagersListInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersListInstanceConfigsResp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.PerInstanceConfig.decode(reader, reader.uint32())); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersListInstanceConfigsResp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp} RegionInstanceGroupManagersListInstanceConfigsResp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersListInstanceConfigsResp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersListInstanceConfigsResp message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersListInstanceConfigsResp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.PerInstanceConfig.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersListInstanceConfigsResp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp} RegionInstanceGroupManagersListInstanceConfigsResp + */ + RegionInstanceGroupManagersListInstanceConfigsResp.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.PerInstanceConfig.fromObject(object.items[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersListInstanceConfigsResp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp} message RegionInstanceGroupManagersListInstanceConfigsResp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersListInstanceConfigsResp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.PerInstanceConfig.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersListInstanceConfigsResp to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersListInstanceConfigsResp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersListInstanceConfigsResp; + })(); + + v1.RegionInstanceGroupManagersListInstancesResponse = (function() { + + /** + * Properties of a RegionInstanceGroupManagersListInstancesResponse. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersListInstancesResponse + * @property {Array.|null} [managedInstances] RegionInstanceGroupManagersListInstancesResponse managedInstances + * @property {string|null} [nextPageToken] RegionInstanceGroupManagersListInstancesResponse nextPageToken + */ + + /** + * Constructs a new RegionInstanceGroupManagersListInstancesResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersListInstancesResponse. + * @implements IRegionInstanceGroupManagersListInstancesResponse + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse=} [properties] Properties to set + */ + function RegionInstanceGroupManagersListInstancesResponse(properties) { + this.managedInstances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersListInstancesResponse managedInstances. + * @member {Array.} managedInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @instance + */ + RegionInstanceGroupManagersListInstancesResponse.prototype.managedInstances = $util.emptyArray; + + /** + * RegionInstanceGroupManagersListInstancesResponse nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @instance + */ + RegionInstanceGroupManagersListInstancesResponse.prototype.nextPageToken = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupManagersListInstancesResponse _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersListInstancesResponse.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupManagersListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse} RegionInstanceGroupManagersListInstancesResponse instance + */ + RegionInstanceGroupManagersListInstancesResponse.create = function create(properties) { + return new RegionInstanceGroupManagersListInstancesResponse(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstancesResponse message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse} message RegionInstanceGroupManagersListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.managedInstances != null && message.managedInstances.length) + for (var i = 0; i < message.managedInstances.length; ++i) + $root.google.cloud.compute.v1.ManagedInstance.encode(message.managedInstances[i], writer.uint32(/* id 336219614, wireType 2 =*/2689756914).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse} message RegionInstanceGroupManagersListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse} RegionInstanceGroupManagersListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersListInstancesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336219614: + if (!(message.managedInstances && message.managedInstances.length)) + message.managedInstances = []; + message.managedInstances.push($root.google.cloud.compute.v1.ManagedInstance.decode(reader, reader.uint32())); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse} RegionInstanceGroupManagersListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersListInstancesResponse message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.managedInstances != null && message.hasOwnProperty("managedInstances")) { + if (!Array.isArray(message.managedInstances)) + return "managedInstances: array expected"; + for (var i = 0; i < message.managedInstances.length; ++i) { + var error = $root.google.cloud.compute.v1.ManagedInstance.verify(message.managedInstances[i]); + if (error) + return "managedInstances." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse} RegionInstanceGroupManagersListInstancesResponse + */ + RegionInstanceGroupManagersListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse(); + if (object.managedInstances) { + if (!Array.isArray(object.managedInstances)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse.managedInstances: array expected"); + message.managedInstances = []; + for (var i = 0; i < object.managedInstances.length; ++i) { + if (typeof object.managedInstances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse.managedInstances: object expected"); + message.managedInstances[i] = $root.google.cloud.compute.v1.ManagedInstance.fromObject(object.managedInstances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse} message RegionInstanceGroupManagersListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.managedInstances = []; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.managedInstances && message.managedInstances.length) { + object.managedInstances = []; + for (var j = 0; j < message.managedInstances.length; ++j) + object.managedInstances[j] = $root.google.cloud.compute.v1.ManagedInstance.toObject(message.managedInstances[j], options); + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersListInstancesResponse; + })(); + + v1.RegionInstanceGroupManagersRecreateRequest = (function() { + + /** + * Properties of a RegionInstanceGroupManagersRecreateRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersRecreateRequest + * @property {Array.|null} [instances] RegionInstanceGroupManagersRecreateRequest instances + */ + + /** + * Constructs a new RegionInstanceGroupManagersRecreateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersRecreateRequest. + * @implements IRegionInstanceGroupManagersRecreateRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest=} [properties] Properties to set + */ + function RegionInstanceGroupManagersRecreateRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersRecreateRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @instance + */ + RegionInstanceGroupManagersRecreateRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new RegionInstanceGroupManagersRecreateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest} RegionInstanceGroupManagersRecreateRequest instance + */ + RegionInstanceGroupManagersRecreateRequest.create = function create(properties) { + return new RegionInstanceGroupManagersRecreateRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersRecreateRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest} message RegionInstanceGroupManagersRecreateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersRecreateRequest.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) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersRecreateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest} message RegionInstanceGroupManagersRecreateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersRecreateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersRecreateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest} RegionInstanceGroupManagersRecreateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersRecreateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersRecreateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest} RegionInstanceGroupManagersRecreateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersRecreateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersRecreateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersRecreateRequest.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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersRecreateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest} RegionInstanceGroupManagersRecreateRequest + */ + RegionInstanceGroupManagersRecreateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersRecreateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest} message RegionInstanceGroupManagersRecreateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersRecreateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersRecreateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersRecreateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersRecreateRequest; + })(); + + v1.RegionInstanceGroupManagersSetTargetPoolsRequest = (function() { + + /** + * Properties of a RegionInstanceGroupManagersSetTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersSetTargetPoolsRequest + * @property {string|null} [fingerprint] RegionInstanceGroupManagersSetTargetPoolsRequest fingerprint + * @property {Array.|null} [targetPools] RegionInstanceGroupManagersSetTargetPoolsRequest targetPools + */ + + /** + * Constructs a new RegionInstanceGroupManagersSetTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersSetTargetPoolsRequest. + * @implements IRegionInstanceGroupManagersSetTargetPoolsRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest=} [properties] Properties to set + */ + function RegionInstanceGroupManagersSetTargetPoolsRequest(properties) { + this.targetPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersSetTargetPoolsRequest fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @instance + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.prototype.fingerprint = null; + + /** + * RegionInstanceGroupManagersSetTargetPoolsRequest targetPools. + * @member {Array.} targetPools + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @instance + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.prototype.targetPools = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupManagersSetTargetPoolsRequest _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersSetTargetPoolsRequest.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupManagersSetTargetPoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest} RegionInstanceGroupManagersSetTargetPoolsRequest instance + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.create = function create(properties) { + return new RegionInstanceGroupManagersSetTargetPoolsRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest} message RegionInstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.targetPools != null && message.targetPools.length) + for (var i = 0; i < message.targetPools.length; ++i) + writer.uint32(/* id 336072617, wireType 2 =*/2688580938).string(message.targetPools[i]); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest} message RegionInstanceGroupManagersSetTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest} RegionInstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 234678500: + message.fingerprint = reader.string(); + break; + case 336072617: + if (!(message.targetPools && message.targetPools.length)) + message.targetPools = []; + message.targetPools.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersSetTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest} RegionInstanceGroupManagersSetTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersSetTargetPoolsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.targetPools != null && message.hasOwnProperty("targetPools")) { + if (!Array.isArray(message.targetPools)) + return "targetPools: array expected"; + for (var i = 0; i < message.targetPools.length; ++i) + if (!$util.isString(message.targetPools[i])) + return "targetPools: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersSetTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest} RegionInstanceGroupManagersSetTargetPoolsRequest + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.targetPools) { + if (!Array.isArray(object.targetPools)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.targetPools: array expected"); + message.targetPools = []; + for (var i = 0; i < object.targetPools.length; ++i) + message.targetPools[i] = String(object.targetPools[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersSetTargetPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest} message RegionInstanceGroupManagersSetTargetPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetPools = []; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.targetPools && message.targetPools.length) { + object.targetPools = []; + for (var j = 0; j < message.targetPools.length; ++j) + object.targetPools[j] = message.targetPools[j]; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersSetTargetPoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersSetTargetPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersSetTargetPoolsRequest; + })(); + + v1.RegionInstanceGroupManagersSetTemplateRequest = (function() { + + /** + * Properties of a RegionInstanceGroupManagersSetTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupManagersSetTemplateRequest + * @property {string|null} [instanceTemplate] RegionInstanceGroupManagersSetTemplateRequest instanceTemplate + */ + + /** + * Constructs a new RegionInstanceGroupManagersSetTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagersSetTemplateRequest. + * @implements IRegionInstanceGroupManagersSetTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest=} [properties] Properties to set + */ + function RegionInstanceGroupManagersSetTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupManagersSetTemplateRequest instanceTemplate. + * @member {string|null|undefined} instanceTemplate + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @instance + */ + RegionInstanceGroupManagersSetTemplateRequest.prototype.instanceTemplate = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupManagersSetTemplateRequest _instanceTemplate. + * @member {"instanceTemplate"|undefined} _instanceTemplate + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupManagersSetTemplateRequest.prototype, "_instanceTemplate", { + get: $util.oneOfGetter($oneOfFields = ["instanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupManagersSetTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest} RegionInstanceGroupManagersSetTemplateRequest instance + */ + RegionInstanceGroupManagersSetTemplateRequest.create = function create(properties) { + return new RegionInstanceGroupManagersSetTemplateRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest} message RegionInstanceGroupManagersSetTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersSetTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 309248228, wireType 2 =*/2473985826).string(message.instanceTemplate); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupManagersSetTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest} message RegionInstanceGroupManagersSetTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupManagersSetTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupManagersSetTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest} RegionInstanceGroupManagersSetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersSetTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 309248228: + message.instanceTemplate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupManagersSetTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest} RegionInstanceGroupManagersSetTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupManagersSetTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupManagersSetTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupManagersSetTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + properties._instanceTemplate = 1; + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupManagersSetTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest} RegionInstanceGroupManagersSetTemplateRequest + */ + RegionInstanceGroupManagersSetTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest(); + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupManagersSetTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest} message RegionInstanceGroupManagersSetTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupManagersSetTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) { + object.instanceTemplate = message.instanceTemplate; + if (options.oneofs) + object._instanceTemplate = "instanceTemplate"; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupManagersSetTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupManagersSetTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupManagersSetTemplateRequest; + })(); + + v1.RegionInstanceGroupsListInstances = (function() { + + /** + * Properties of a RegionInstanceGroupsListInstances. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupsListInstances + * @property {string|null} [id] RegionInstanceGroupsListInstances id + * @property {Array.|null} [items] RegionInstanceGroupsListInstances items + * @property {string|null} [kind] RegionInstanceGroupsListInstances kind + * @property {string|null} [nextPageToken] RegionInstanceGroupsListInstances nextPageToken + * @property {string|null} [selfLink] RegionInstanceGroupsListInstances selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RegionInstanceGroupsListInstances warning + */ + + /** + * Constructs a new RegionInstanceGroupsListInstances. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupsListInstances. + * @implements IRegionInstanceGroupsListInstances + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstances=} [properties] Properties to set + */ + function RegionInstanceGroupsListInstances(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupsListInstances id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + RegionInstanceGroupsListInstances.prototype.id = null; + + /** + * RegionInstanceGroupsListInstances items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + RegionInstanceGroupsListInstances.prototype.items = $util.emptyArray; + + /** + * RegionInstanceGroupsListInstances kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + RegionInstanceGroupsListInstances.prototype.kind = null; + + /** + * RegionInstanceGroupsListInstances nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + RegionInstanceGroupsListInstances.prototype.nextPageToken = null; + + /** + * RegionInstanceGroupsListInstances selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + RegionInstanceGroupsListInstances.prototype.selfLink = null; + + /** + * RegionInstanceGroupsListInstances warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + RegionInstanceGroupsListInstances.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupsListInstances _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + Object.defineProperty(RegionInstanceGroupsListInstances.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupsListInstances _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + Object.defineProperty(RegionInstanceGroupsListInstances.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupsListInstances _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + Object.defineProperty(RegionInstanceGroupsListInstances.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupsListInstances _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + Object.defineProperty(RegionInstanceGroupsListInstances.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupsListInstances _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + */ + Object.defineProperty(RegionInstanceGroupsListInstances.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupsListInstances instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstances=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstances} RegionInstanceGroupsListInstances instance + */ + RegionInstanceGroupsListInstances.create = function create(properties) { + return new RegionInstanceGroupsListInstances(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupsListInstances message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstances.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstances} message RegionInstanceGroupsListInstances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupsListInstances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.InstanceWithNamedPorts.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupsListInstances message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstances.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstances} message RegionInstanceGroupsListInstances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupsListInstances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupsListInstances message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstances} RegionInstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupsListInstances.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupsListInstances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.InstanceWithNamedPorts.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupsListInstances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstances} RegionInstanceGroupsListInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupsListInstances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupsListInstances message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupsListInstances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.InstanceWithNamedPorts.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupsListInstances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstances} RegionInstanceGroupsListInstances + */ + RegionInstanceGroupsListInstances.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupsListInstances) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupsListInstances(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupsListInstances.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupsListInstances.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.InstanceWithNamedPorts.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupsListInstances.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupsListInstances message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupsListInstances} message RegionInstanceGroupsListInstances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupsListInstances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.InstanceWithNamedPorts.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupsListInstances to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstances + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupsListInstances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupsListInstances; + })(); + + v1.RegionInstanceGroupsListInstancesRequest = (function() { + + /** + * Properties of a RegionInstanceGroupsListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupsListInstancesRequest + * @property {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState|null} [instanceState] RegionInstanceGroupsListInstancesRequest instanceState + * @property {string|null} [portName] RegionInstanceGroupsListInstancesRequest portName + */ + + /** + * Constructs a new RegionInstanceGroupsListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupsListInstancesRequest. + * @implements IRegionInstanceGroupsListInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest=} [properties] Properties to set + */ + function RegionInstanceGroupsListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupsListInstancesRequest instanceState. + * @member {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState|null|undefined} instanceState + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @instance + */ + RegionInstanceGroupsListInstancesRequest.prototype.instanceState = null; + + /** + * RegionInstanceGroupsListInstancesRequest portName. + * @member {string|null|undefined} portName + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @instance + */ + RegionInstanceGroupsListInstancesRequest.prototype.portName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupsListInstancesRequest _instanceState. + * @member {"instanceState"|undefined} _instanceState + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupsListInstancesRequest.prototype, "_instanceState", { + get: $util.oneOfGetter($oneOfFields = ["instanceState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionInstanceGroupsListInstancesRequest _portName. + * @member {"portName"|undefined} _portName + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupsListInstancesRequest.prototype, "_portName", { + get: $util.oneOfGetter($oneOfFields = ["portName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupsListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} RegionInstanceGroupsListInstancesRequest instance + */ + RegionInstanceGroupsListInstancesRequest.create = function create(properties) { + return new RegionInstanceGroupsListInstancesRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupsListInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest} message RegionInstanceGroupsListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupsListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portName != null && Object.hasOwnProperty.call(message, "portName")) + writer.uint32(/* id 41534345, wireType 2 =*/332274762).string(message.portName); + if (message.instanceState != null && Object.hasOwnProperty.call(message, "instanceState")) + writer.uint32(/* id 92223591, wireType 0 =*/737788728).int32(message.instanceState); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupsListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest} message RegionInstanceGroupsListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupsListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupsListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} RegionInstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupsListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 92223591: + message.instanceState = reader.int32(); + break; + case 41534345: + message.portName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupsListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} RegionInstanceGroupsListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupsListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupsListInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupsListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceState != null && message.hasOwnProperty("instanceState")) { + properties._instanceState = 1; + switch (message.instanceState) { + default: + return "instanceState: enum value expected"; + case 0: + case 64897: + case 121282975: + break; + } + } + if (message.portName != null && message.hasOwnProperty("portName")) { + properties._portName = 1; + if (!$util.isString(message.portName)) + return "portName: string expected"; + } + return null; + }; + + /** + * Creates a RegionInstanceGroupsListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} RegionInstanceGroupsListInstancesRequest + */ + RegionInstanceGroupsListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest(); + switch (object.instanceState) { + case "UNDEFINED_INSTANCE_STATE": + case 0: + message.instanceState = 0; + break; + case "ALL": + case 64897: + message.instanceState = 64897; + break; + case "RUNNING": + case 121282975: + message.instanceState = 121282975; + break; + } + if (object.portName != null) + message.portName = String(object.portName); + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupsListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} message RegionInstanceGroupsListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupsListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.portName != null && message.hasOwnProperty("portName")) { + object.portName = message.portName; + if (options.oneofs) + object._portName = "portName"; + } + if (message.instanceState != null && message.hasOwnProperty("instanceState")) { + object.instanceState = options.enums === String ? $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState[message.instanceState] : message.instanceState; + if (options.oneofs) + object._instanceState = "instanceState"; + } + return object; + }; + + /** + * Converts this RegionInstanceGroupsListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupsListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * InstanceState enum. + * @name google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.InstanceState + * @enum {number} + * @property {number} UNDEFINED_INSTANCE_STATE=0 UNDEFINED_INSTANCE_STATE value + * @property {number} ALL=64897 ALL value + * @property {number} RUNNING=121282975 RUNNING value + */ + RegionInstanceGroupsListInstancesRequest.InstanceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_INSTANCE_STATE"] = 0; + values[valuesById[64897] = "ALL"] = 64897; + values[valuesById[121282975] = "RUNNING"] = 121282975; + return values; + })(); + + return RegionInstanceGroupsListInstancesRequest; + })(); + + v1.RegionInstanceGroupsSetNamedPortsRequest = (function() { + + /** + * Properties of a RegionInstanceGroupsSetNamedPortsRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionInstanceGroupsSetNamedPortsRequest + * @property {string|null} [fingerprint] RegionInstanceGroupsSetNamedPortsRequest fingerprint + * @property {Array.|null} [namedPorts] RegionInstanceGroupsSetNamedPortsRequest namedPorts + */ + + /** + * Constructs a new RegionInstanceGroupsSetNamedPortsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupsSetNamedPortsRequest. + * @implements IRegionInstanceGroupsSetNamedPortsRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest=} [properties] Properties to set + */ + function RegionInstanceGroupsSetNamedPortsRequest(properties) { + this.namedPorts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionInstanceGroupsSetNamedPortsRequest fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @instance + */ + RegionInstanceGroupsSetNamedPortsRequest.prototype.fingerprint = null; + + /** + * RegionInstanceGroupsSetNamedPortsRequest namedPorts. + * @member {Array.} namedPorts + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @instance + */ + RegionInstanceGroupsSetNamedPortsRequest.prototype.namedPorts = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionInstanceGroupsSetNamedPortsRequest _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @instance + */ + Object.defineProperty(RegionInstanceGroupsSetNamedPortsRequest.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionInstanceGroupsSetNamedPortsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest} RegionInstanceGroupsSetNamedPortsRequest instance + */ + RegionInstanceGroupsSetNamedPortsRequest.create = function create(properties) { + return new RegionInstanceGroupsSetNamedPortsRequest(properties); + }; + + /** + * Encodes the specified RegionInstanceGroupsSetNamedPortsRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest} message RegionInstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupsSetNamedPortsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.namedPorts != null && message.namedPorts.length) + for (var i = 0; i < message.namedPorts.length; ++i) + $root.google.cloud.compute.v1.NamedPort.encode(message.namedPorts[i], writer.uint32(/* id 427598732, wireType 2 =*/3420789858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionInstanceGroupsSetNamedPortsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest} message RegionInstanceGroupsSetNamedPortsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionInstanceGroupsSetNamedPortsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionInstanceGroupsSetNamedPortsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest} RegionInstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupsSetNamedPortsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 234678500: + message.fingerprint = reader.string(); + break; + case 427598732: + if (!(message.namedPorts && message.namedPorts.length)) + message.namedPorts = []; + message.namedPorts.push($root.google.cloud.compute.v1.NamedPort.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionInstanceGroupsSetNamedPortsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest} RegionInstanceGroupsSetNamedPortsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionInstanceGroupsSetNamedPortsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionInstanceGroupsSetNamedPortsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionInstanceGroupsSetNamedPortsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.namedPorts != null && message.hasOwnProperty("namedPorts")) { + if (!Array.isArray(message.namedPorts)) + return "namedPorts: array expected"; + for (var i = 0; i < message.namedPorts.length; ++i) { + var error = $root.google.cloud.compute.v1.NamedPort.verify(message.namedPorts[i]); + if (error) + return "namedPorts." + error; + } + } + return null; + }; + + /** + * Creates a RegionInstanceGroupsSetNamedPortsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest} RegionInstanceGroupsSetNamedPortsRequest + */ + RegionInstanceGroupsSetNamedPortsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest(); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.namedPorts) { + if (!Array.isArray(object.namedPorts)) + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.namedPorts: array expected"); + message.namedPorts = []; + for (var i = 0; i < object.namedPorts.length; ++i) { + if (typeof object.namedPorts[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.namedPorts: object expected"); + message.namedPorts[i] = $root.google.cloud.compute.v1.NamedPort.fromObject(object.namedPorts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RegionInstanceGroupsSetNamedPortsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @static + * @param {google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest} message RegionInstanceGroupsSetNamedPortsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionInstanceGroupsSetNamedPortsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.namedPorts = []; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.namedPorts && message.namedPorts.length) { + object.namedPorts = []; + for (var j = 0; j < message.namedPorts.length; ++j) + object.namedPorts[j] = $root.google.cloud.compute.v1.NamedPort.toObject(message.namedPorts[j], options); + } + return object; + }; + + /** + * Converts this RegionInstanceGroupsSetNamedPortsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest + * @instance + * @returns {Object.} JSON object + */ + RegionInstanceGroupsSetNamedPortsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionInstanceGroupsSetNamedPortsRequest; + })(); + + v1.RegionList = (function() { + + /** + * Properties of a RegionList. + * @memberof google.cloud.compute.v1 + * @interface IRegionList + * @property {string|null} [id] RegionList id + * @property {Array.|null} [items] RegionList items + * @property {string|null} [kind] RegionList kind + * @property {string|null} [nextPageToken] RegionList nextPageToken + * @property {string|null} [selfLink] RegionList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RegionList warning + */ + + /** + * Constructs a new RegionList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionList. + * @implements IRegionList + * @constructor + * @param {google.cloud.compute.v1.IRegionList=} [properties] Properties to set + */ + function RegionList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + RegionList.prototype.id = null; + + /** + * RegionList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + RegionList.prototype.items = $util.emptyArray; + + /** + * RegionList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + RegionList.prototype.kind = null; + + /** + * RegionList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + RegionList.prototype.nextPageToken = null; + + /** + * RegionList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + RegionList.prototype.selfLink = null; + + /** + * RegionList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + RegionList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + Object.defineProperty(RegionList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + Object.defineProperty(RegionList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + Object.defineProperty(RegionList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + Object.defineProperty(RegionList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RegionList + * @instance + */ + Object.defineProperty(RegionList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {google.cloud.compute.v1.IRegionList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionList} RegionList instance + */ + RegionList.create = function create(properties) { + return new RegionList(properties); + }; + + /** + * Encodes the specified RegionList message. Does not implicitly {@link google.cloud.compute.v1.RegionList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {google.cloud.compute.v1.IRegionList} message RegionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Region.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RegionList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {google.cloud.compute.v1.IRegionList} message RegionList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionList} RegionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Region.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionList} RegionList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionList message. + * @function verify + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Region.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RegionList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionList} RegionList + */ + RegionList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionList) + return object; + var message = new $root.google.cloud.compute.v1.RegionList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RegionList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Region.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RegionList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RegionList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionList + * @static + * @param {google.cloud.compute.v1.RegionList} message RegionList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Region.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RegionList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionList + * @instance + * @returns {Object.} JSON object + */ + RegionList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionList; + })(); + + v1.RegionSetLabelsRequest = (function() { + + /** + * Properties of a RegionSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionSetLabelsRequest + * @property {string|null} [labelFingerprint] RegionSetLabelsRequest labelFingerprint + * @property {Object.|null} [labels] RegionSetLabelsRequest labels + */ + + /** + * Constructs a new RegionSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionSetLabelsRequest. + * @implements IRegionSetLabelsRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionSetLabelsRequest=} [properties] Properties to set + */ + function RegionSetLabelsRequest(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]]; + } + + /** + * RegionSetLabelsRequest labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @instance + */ + RegionSetLabelsRequest.prototype.labelFingerprint = null; + + /** + * RegionSetLabelsRequest labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @instance + */ + RegionSetLabelsRequest.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionSetLabelsRequest _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @instance + */ + Object.defineProperty(RegionSetLabelsRequest.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionSetLabelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IRegionSetLabelsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionSetLabelsRequest} RegionSetLabelsRequest instance + */ + RegionSetLabelsRequest.create = function create(properties) { + return new RegionSetLabelsRequest(properties); + }; + + /** + * Encodes the specified RegionSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionSetLabelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IRegionSetLabelsRequest} message RegionSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionSetLabelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + 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 500195327, wireType 2 =*/4001562618).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 RegionSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionSetLabelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IRegionSetLabelsRequest} message RegionSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionSetLabelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionSetLabelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionSetLabelsRequest} RegionSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionSetLabelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionSetLabelsRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 RegionSetLabelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionSetLabelsRequest} RegionSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionSetLabelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionSetLabelsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionSetLabelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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 RegionSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionSetLabelsRequest} RegionSetLabelsRequest + */ + RegionSetLabelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionSetLabelsRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionSetLabelsRequest(); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.RegionSetLabelsRequest.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 RegionSetLabelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.RegionSetLabelsRequest} message RegionSetLabelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionSetLabelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + 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 RegionSetLabelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionSetLabelsRequest + * @instance + * @returns {Object.} JSON object + */ + RegionSetLabelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionSetLabelsRequest; + })(); + + v1.RegionSetPolicyRequest = (function() { + + /** + * Properties of a RegionSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionSetPolicyRequest + * @property {Array.|null} [bindings] RegionSetPolicyRequest bindings + * @property {string|null} [etag] RegionSetPolicyRequest etag + * @property {google.cloud.compute.v1.IPolicy|null} [policy] RegionSetPolicyRequest policy + */ + + /** + * Constructs a new RegionSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionSetPolicyRequest. + * @implements IRegionSetPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionSetPolicyRequest=} [properties] Properties to set + */ + function RegionSetPolicyRequest(properties) { + this.bindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionSetPolicyRequest bindings. + * @member {Array.} bindings + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @instance + */ + RegionSetPolicyRequest.prototype.bindings = $util.emptyArray; + + /** + * RegionSetPolicyRequest etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @instance + */ + RegionSetPolicyRequest.prototype.etag = null; + + /** + * RegionSetPolicyRequest policy. + * @member {google.cloud.compute.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @instance + */ + RegionSetPolicyRequest.prototype.policy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionSetPolicyRequest _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @instance + */ + Object.defineProperty(RegionSetPolicyRequest.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RegionSetPolicyRequest _policy. + * @member {"policy"|undefined} _policy + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @instance + */ + Object.defineProperty(RegionSetPolicyRequest.prototype, "_policy", { + get: $util.oneOfGetter($oneOfFields = ["policy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionSetPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRegionSetPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionSetPolicyRequest} RegionSetPolicyRequest instance + */ + RegionSetPolicyRequest.create = function create(properties) { + return new RegionSetPolicyRequest(properties); + }; + + /** + * Encodes the specified RegionSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionSetPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRegionSetPolicyRequest} message RegionSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionSetPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.compute.v1.Policy.encode(message.policy, writer.uint32(/* id 91071794, wireType 2 =*/728574354).fork()).ldelim(); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.cloud.compute.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 403251854, wireType 2 =*/3226014834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionSetPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRegionSetPolicyRequest} message RegionSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionSetPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionSetPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionSetPolicyRequest} RegionSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionSetPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionSetPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 403251854: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.compute.v1.Binding.decode(reader, reader.uint32())); + break; + case 3123477: + message.etag = reader.string(); + break; + case 91071794: + message.policy = $root.google.cloud.compute.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionSetPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionSetPolicyRequest} RegionSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionSetPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionSetPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionSetPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.cloud.compute.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + properties._policy = 1; + { + var error = $root.google.cloud.compute.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + } + return null; + }; + + /** + * Creates a RegionSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionSetPolicyRequest} RegionSetPolicyRequest + */ + RegionSetPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionSetPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionSetPolicyRequest(); + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.compute.v1.RegionSetPolicyRequest.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RegionSetPolicyRequest.bindings: object expected"); + message.bindings[i] = $root.google.cloud.compute.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.compute.v1.RegionSetPolicyRequest.policy: object expected"); + message.policy = $root.google.cloud.compute.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a RegionSetPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.RegionSetPolicyRequest} message RegionSetPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionSetPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.compute.v1.Policy.toObject(message.policy, options); + if (options.oneofs) + object._policy = "policy"; + } + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.cloud.compute.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; + + /** + * Converts this RegionSetPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionSetPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + RegionSetPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionSetPolicyRequest; + })(); + + v1.RegionTargetHttpsProxiesSetSslCertificatesRequest = (function() { + + /** + * Properties of a RegionTargetHttpsProxiesSetSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionTargetHttpsProxiesSetSslCertificatesRequest + * @property {Array.|null} [sslCertificates] RegionTargetHttpsProxiesSetSslCertificatesRequest sslCertificates + */ + + /** + * Constructs a new RegionTargetHttpsProxiesSetSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionTargetHttpsProxiesSetSslCertificatesRequest. + * @implements IRegionTargetHttpsProxiesSetSslCertificatesRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest=} [properties] Properties to set + */ + function RegionTargetHttpsProxiesSetSslCertificatesRequest(properties) { + this.sslCertificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionTargetHttpsProxiesSetSslCertificatesRequest sslCertificates. + * @member {Array.} sslCertificates + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @instance + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.prototype.sslCertificates = $util.emptyArray; + + /** + * Creates a new RegionTargetHttpsProxiesSetSslCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest} RegionTargetHttpsProxiesSetSslCertificatesRequest instance + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.create = function create(properties) { + return new RegionTargetHttpsProxiesSetSslCertificatesRequest(properties); + }; + + /** + * Encodes the specified RegionTargetHttpsProxiesSetSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest} message RegionTargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslCertificates != null && message.sslCertificates.length) + for (var i = 0; i < message.sslCertificates.length; ++i) + writer.uint32(/* id 366006543, wireType 2 =*/2928052346).string(message.sslCertificates[i]); + return writer; + }; + + /** + * Encodes the specified RegionTargetHttpsProxiesSetSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest} message RegionTargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionTargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest} RegionTargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 366006543: + if (!(message.sslCertificates && message.sslCertificates.length)) + message.sslCertificates = []; + message.sslCertificates.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionTargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest} RegionTargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionTargetHttpsProxiesSetSslCertificatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslCertificates != null && message.hasOwnProperty("sslCertificates")) { + if (!Array.isArray(message.sslCertificates)) + return "sslCertificates: array expected"; + for (var i = 0; i < message.sslCertificates.length; ++i) + if (!$util.isString(message.sslCertificates[i])) + return "sslCertificates: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionTargetHttpsProxiesSetSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest} RegionTargetHttpsProxiesSetSslCertificatesRequest + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest(); + if (object.sslCertificates) { + if (!Array.isArray(object.sslCertificates)) + throw TypeError(".google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.sslCertificates: array expected"); + message.sslCertificates = []; + for (var i = 0; i < object.sslCertificates.length; ++i) + message.sslCertificates[i] = String(object.sslCertificates[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionTargetHttpsProxiesSetSslCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest} message RegionTargetHttpsProxiesSetSslCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sslCertificates = []; + if (message.sslCertificates && message.sslCertificates.length) { + object.sslCertificates = []; + for (var j = 0; j < message.sslCertificates.length; ++j) + object.sslCertificates[j] = message.sslCertificates[j]; + } + return object; + }; + + /** + * Converts this RegionTargetHttpsProxiesSetSslCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + RegionTargetHttpsProxiesSetSslCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionTargetHttpsProxiesSetSslCertificatesRequest; + })(); + + v1.UrlMap = (function() { + + /** + * Properties of an UrlMap. + * @memberof google.cloud.compute.v1 + * @interface IUrlMap + * @property {string|null} [creationTimestamp] UrlMap creationTimestamp + * @property {google.cloud.compute.v1.IHttpRouteAction|null} [defaultRouteAction] UrlMap defaultRouteAction + * @property {string|null} [defaultService] UrlMap defaultService + * @property {google.cloud.compute.v1.IHttpRedirectAction|null} [defaultUrlRedirect] UrlMap defaultUrlRedirect + * @property {string|null} [description] UrlMap description + * @property {string|null} [fingerprint] UrlMap fingerprint + * @property {google.cloud.compute.v1.IHttpHeaderAction|null} [headerAction] UrlMap headerAction + * @property {Array.|null} [hostRules] UrlMap hostRules + * @property {number|Long|null} [id] UrlMap id + * @property {string|null} [kind] UrlMap kind + * @property {string|null} [name] UrlMap name + * @property {Array.|null} [pathMatchers] UrlMap pathMatchers + * @property {string|null} [region] UrlMap region + * @property {string|null} [selfLink] UrlMap selfLink + * @property {Array.|null} [tests] UrlMap tests + */ + + /** + * Constructs a new UrlMap. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMap. + * @implements IUrlMap + * @constructor + * @param {google.cloud.compute.v1.IUrlMap=} [properties] Properties to set + */ + function UrlMap(properties) { + this.hostRules = []; + this.pathMatchers = []; + this.tests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMap creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.creationTimestamp = null; + + /** + * UrlMap defaultRouteAction. + * @member {google.cloud.compute.v1.IHttpRouteAction|null|undefined} defaultRouteAction + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.defaultRouteAction = null; + + /** + * UrlMap defaultService. + * @member {string|null|undefined} defaultService + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.defaultService = null; + + /** + * UrlMap defaultUrlRedirect. + * @member {google.cloud.compute.v1.IHttpRedirectAction|null|undefined} defaultUrlRedirect + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.defaultUrlRedirect = null; + + /** + * UrlMap description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.description = null; + + /** + * UrlMap fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.fingerprint = null; + + /** + * UrlMap headerAction. + * @member {google.cloud.compute.v1.IHttpHeaderAction|null|undefined} headerAction + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.headerAction = null; + + /** + * UrlMap hostRules. + * @member {Array.} hostRules + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.hostRules = $util.emptyArray; + + /** + * UrlMap id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.id = null; + + /** + * UrlMap kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.kind = null; + + /** + * UrlMap name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.name = null; + + /** + * UrlMap pathMatchers. + * @member {Array.} pathMatchers + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.pathMatchers = $util.emptyArray; + + /** + * UrlMap region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.region = null; + + /** + * UrlMap selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.selfLink = null; + + /** + * UrlMap tests. + * @member {Array.} tests + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + UrlMap.prototype.tests = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMap _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _defaultRouteAction. + * @member {"defaultRouteAction"|undefined} _defaultRouteAction + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_defaultRouteAction", { + get: $util.oneOfGetter($oneOfFields = ["defaultRouteAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _defaultService. + * @member {"defaultService"|undefined} _defaultService + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_defaultService", { + get: $util.oneOfGetter($oneOfFields = ["defaultService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _defaultUrlRedirect. + * @member {"defaultUrlRedirect"|undefined} _defaultUrlRedirect + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_defaultUrlRedirect", { + get: $util.oneOfGetter($oneOfFields = ["defaultUrlRedirect"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _headerAction. + * @member {"headerAction"|undefined} _headerAction + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_headerAction", { + get: $util.oneOfGetter($oneOfFields = ["headerAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMap _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.UrlMap + * @instance + */ + Object.defineProperty(UrlMap.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMap instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {google.cloud.compute.v1.IUrlMap=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMap} UrlMap instance + */ + UrlMap.create = function create(properties) { + return new UrlMap(properties); + }; + + /** + * Encodes the specified UrlMap message. Does not implicitly {@link google.cloud.compute.v1.UrlMap.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {google.cloud.compute.v1.IUrlMap} message UrlMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.tests != null && message.tests.length) + for (var i = 0; i < message.tests.length; ++i) + $root.google.cloud.compute.v1.UrlMapTest.encode(message.tests[i], writer.uint32(/* id 110251553, wireType 2 =*/882012426).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.pathMatchers != null && message.pathMatchers.length) + for (var i = 0; i < message.pathMatchers.length; ++i) + $root.google.cloud.compute.v1.PathMatcher.encode(message.pathMatchers[i], writer.uint32(/* id 271664219, wireType 2 =*/2173313754).fork()).ldelim(); + if (message.hostRules != null && message.hostRules.length) + for (var i = 0; i < message.hostRules.length; ++i) + $root.google.cloud.compute.v1.HostRule.encode(message.hostRules[i], writer.uint32(/* id 311804832, wireType 2 =*/2494438658).fork()).ldelim(); + if (message.headerAction != null && Object.hasOwnProperty.call(message, "headerAction")) + $root.google.cloud.compute.v1.HttpHeaderAction.encode(message.headerAction, writer.uint32(/* id 328077352, wireType 2 =*/2624618818).fork()).ldelim(); + if (message.defaultUrlRedirect != null && Object.hasOwnProperty.call(message, "defaultUrlRedirect")) + $root.google.cloud.compute.v1.HttpRedirectAction.encode(message.defaultUrlRedirect, writer.uint32(/* id 359503338, wireType 2 =*/2876026706).fork()).ldelim(); + if (message.defaultService != null && Object.hasOwnProperty.call(message, "defaultService")) + writer.uint32(/* id 370242231, wireType 2 =*/2961937850).string(message.defaultService); + if (message.defaultRouteAction != null && Object.hasOwnProperty.call(message, "defaultRouteAction")) + $root.google.cloud.compute.v1.HttpRouteAction.encode(message.defaultRouteAction, writer.uint32(/* id 378919466, wireType 2 =*/3031355730).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified UrlMap message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMap.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {google.cloud.compute.v1.IUrlMap} message UrlMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMap message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMap} UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMap(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 378919466: + message.defaultRouteAction = $root.google.cloud.compute.v1.HttpRouteAction.decode(reader, reader.uint32()); + break; + case 370242231: + message.defaultService = reader.string(); + break; + case 359503338: + message.defaultUrlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 328077352: + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.decode(reader, reader.uint32()); + break; + case 311804832: + if (!(message.hostRules && message.hostRules.length)) + message.hostRules = []; + message.hostRules.push($root.google.cloud.compute.v1.HostRule.decode(reader, reader.uint32())); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 271664219: + if (!(message.pathMatchers && message.pathMatchers.length)) + message.pathMatchers = []; + message.pathMatchers.push($root.google.cloud.compute.v1.PathMatcher.decode(reader, reader.uint32())); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 110251553: + if (!(message.tests && message.tests.length)) + message.tests = []; + message.tests.push($root.google.cloud.compute.v1.UrlMapTest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMap} UrlMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMap message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.defaultRouteAction != null && message.hasOwnProperty("defaultRouteAction")) { + properties._defaultRouteAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpRouteAction.verify(message.defaultRouteAction); + if (error) + return "defaultRouteAction." + error; + } + } + if (message.defaultService != null && message.hasOwnProperty("defaultService")) { + properties._defaultService = 1; + if (!$util.isString(message.defaultService)) + return "defaultService: string expected"; + } + if (message.defaultUrlRedirect != null && message.hasOwnProperty("defaultUrlRedirect")) { + properties._defaultUrlRedirect = 1; + { + var error = $root.google.cloud.compute.v1.HttpRedirectAction.verify(message.defaultUrlRedirect); + if (error) + return "defaultUrlRedirect." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + properties._headerAction = 1; + { + var error = $root.google.cloud.compute.v1.HttpHeaderAction.verify(message.headerAction); + if (error) + return "headerAction." + error; + } + } + if (message.hostRules != null && message.hasOwnProperty("hostRules")) { + if (!Array.isArray(message.hostRules)) + return "hostRules: array expected"; + for (var i = 0; i < message.hostRules.length; ++i) { + var error = $root.google.cloud.compute.v1.HostRule.verify(message.hostRules[i]); + if (error) + return "hostRules." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.pathMatchers != null && message.hasOwnProperty("pathMatchers")) { + if (!Array.isArray(message.pathMatchers)) + return "pathMatchers: array expected"; + for (var i = 0; i < message.pathMatchers.length; ++i) { + var error = $root.google.cloud.compute.v1.PathMatcher.verify(message.pathMatchers[i]); + if (error) + return "pathMatchers." + error; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.tests != null && message.hasOwnProperty("tests")) { + if (!Array.isArray(message.tests)) + return "tests: array expected"; + for (var i = 0; i < message.tests.length; ++i) { + var error = $root.google.cloud.compute.v1.UrlMapTest.verify(message.tests[i]); + if (error) + return "tests." + error; + } + } + return null; + }; + + /** + * Creates an UrlMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMap} UrlMap + */ + UrlMap.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMap) + return object; + var message = new $root.google.cloud.compute.v1.UrlMap(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.defaultRouteAction != null) { + if (typeof object.defaultRouteAction !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMap.defaultRouteAction: object expected"); + message.defaultRouteAction = $root.google.cloud.compute.v1.HttpRouteAction.fromObject(object.defaultRouteAction); + } + if (object.defaultService != null) + message.defaultService = String(object.defaultService); + if (object.defaultUrlRedirect != null) { + if (typeof object.defaultUrlRedirect !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMap.defaultUrlRedirect: object expected"); + message.defaultUrlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.fromObject(object.defaultUrlRedirect); + } + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.headerAction != null) { + if (typeof object.headerAction !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMap.headerAction: object expected"); + message.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.fromObject(object.headerAction); + } + if (object.hostRules) { + if (!Array.isArray(object.hostRules)) + throw TypeError(".google.cloud.compute.v1.UrlMap.hostRules: array expected"); + message.hostRules = []; + for (var i = 0; i < object.hostRules.length; ++i) { + if (typeof object.hostRules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMap.hostRules: object expected"); + message.hostRules[i] = $root.google.cloud.compute.v1.HostRule.fromObject(object.hostRules[i]); + } + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.pathMatchers) { + if (!Array.isArray(object.pathMatchers)) + throw TypeError(".google.cloud.compute.v1.UrlMap.pathMatchers: array expected"); + message.pathMatchers = []; + for (var i = 0; i < object.pathMatchers.length; ++i) { + if (typeof object.pathMatchers[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMap.pathMatchers: object expected"); + message.pathMatchers[i] = $root.google.cloud.compute.v1.PathMatcher.fromObject(object.pathMatchers[i]); + } + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.tests) { + if (!Array.isArray(object.tests)) + throw TypeError(".google.cloud.compute.v1.UrlMap.tests: array expected"); + message.tests = []; + for (var i = 0; i < object.tests.length; ++i) { + if (typeof object.tests[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMap.tests: object expected"); + message.tests[i] = $root.google.cloud.compute.v1.UrlMapTest.fromObject(object.tests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an UrlMap message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMap + * @static + * @param {google.cloud.compute.v1.UrlMap} message UrlMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tests = []; + object.pathMatchers = []; + object.hostRules = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.tests && message.tests.length) { + object.tests = []; + for (var j = 0; j < message.tests.length; ++j) + object.tests[j] = $root.google.cloud.compute.v1.UrlMapTest.toObject(message.tests[j], options); + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.pathMatchers && message.pathMatchers.length) { + object.pathMatchers = []; + for (var j = 0; j < message.pathMatchers.length; ++j) + object.pathMatchers[j] = $root.google.cloud.compute.v1.PathMatcher.toObject(message.pathMatchers[j], options); + } + if (message.hostRules && message.hostRules.length) { + object.hostRules = []; + for (var j = 0; j < message.hostRules.length; ++j) + object.hostRules[j] = $root.google.cloud.compute.v1.HostRule.toObject(message.hostRules[j], options); + } + if (message.headerAction != null && message.hasOwnProperty("headerAction")) { + object.headerAction = $root.google.cloud.compute.v1.HttpHeaderAction.toObject(message.headerAction, options); + if (options.oneofs) + object._headerAction = "headerAction"; + } + if (message.defaultUrlRedirect != null && message.hasOwnProperty("defaultUrlRedirect")) { + object.defaultUrlRedirect = $root.google.cloud.compute.v1.HttpRedirectAction.toObject(message.defaultUrlRedirect, options); + if (options.oneofs) + object._defaultUrlRedirect = "defaultUrlRedirect"; + } + if (message.defaultService != null && message.hasOwnProperty("defaultService")) { + object.defaultService = message.defaultService; + if (options.oneofs) + object._defaultService = "defaultService"; + } + if (message.defaultRouteAction != null && message.hasOwnProperty("defaultRouteAction")) { + object.defaultRouteAction = $root.google.cloud.compute.v1.HttpRouteAction.toObject(message.defaultRouteAction, options); + if (options.oneofs) + object._defaultRouteAction = "defaultRouteAction"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this UrlMap to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMap + * @instance + * @returns {Object.} JSON object + */ + UrlMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMap; + })(); + + v1.RegionUrlMapsValidateRequest = (function() { + + /** + * Properties of a RegionUrlMapsValidateRequest. + * @memberof google.cloud.compute.v1 + * @interface IRegionUrlMapsValidateRequest + * @property {google.cloud.compute.v1.IUrlMap|null} [resource] RegionUrlMapsValidateRequest resource + */ + + /** + * Constructs a new RegionUrlMapsValidateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionUrlMapsValidateRequest. + * @implements IRegionUrlMapsValidateRequest + * @constructor + * @param {google.cloud.compute.v1.IRegionUrlMapsValidateRequest=} [properties] Properties to set + */ + function RegionUrlMapsValidateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionUrlMapsValidateRequest resource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} resource + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @instance + */ + RegionUrlMapsValidateRequest.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RegionUrlMapsValidateRequest _resource. + * @member {"resource"|undefined} _resource + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @instance + */ + Object.defineProperty(RegionUrlMapsValidateRequest.prototype, "_resource", { + get: $util.oneOfGetter($oneOfFields = ["resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RegionUrlMapsValidateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.IRegionUrlMapsValidateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RegionUrlMapsValidateRequest} RegionUrlMapsValidateRequest instance + */ + RegionUrlMapsValidateRequest.create = function create(properties) { + return new RegionUrlMapsValidateRequest(properties); + }; + + /** + * Encodes the specified RegionUrlMapsValidateRequest message. Does not implicitly {@link google.cloud.compute.v1.RegionUrlMapsValidateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.IRegionUrlMapsValidateRequest} message RegionUrlMapsValidateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionUrlMapsValidateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.resource, writer.uint32(/* id 195806222, wireType 2 =*/1566449778).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RegionUrlMapsValidateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RegionUrlMapsValidateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.IRegionUrlMapsValidateRequest} message RegionUrlMapsValidateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionUrlMapsValidateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionUrlMapsValidateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RegionUrlMapsValidateRequest} RegionUrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionUrlMapsValidateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 195806222: + message.resource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionUrlMapsValidateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RegionUrlMapsValidateRequest} RegionUrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionUrlMapsValidateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionUrlMapsValidateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionUrlMapsValidateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + properties._resource = 1; + { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.resource); + if (error) + return "resource." + error; + } + } + return null; + }; + + /** + * Creates a RegionUrlMapsValidateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RegionUrlMapsValidateRequest} RegionUrlMapsValidateRequest + */ + RegionUrlMapsValidateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest) + return object; + var message = new $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.compute.v1.RegionUrlMapsValidateRequest.resource: object expected"); + message.resource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a RegionUrlMapsValidateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.RegionUrlMapsValidateRequest} message RegionUrlMapsValidateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionUrlMapsValidateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.cloud.compute.v1.UrlMap.toObject(message.resource, options); + if (options.oneofs) + object._resource = "resource"; + } + return object; + }; + + /** + * Converts this RegionUrlMapsValidateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RegionUrlMapsValidateRequest + * @instance + * @returns {Object.} JSON object + */ + RegionUrlMapsValidateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RegionUrlMapsValidateRequest; + })(); + + v1.ReservationsScopedList = (function() { + + /** + * Properties of a ReservationsScopedList. + * @memberof google.cloud.compute.v1 + * @interface IReservationsScopedList + * @property {Array.|null} [reservations] ReservationsScopedList reservations + * @property {google.cloud.compute.v1.IWarning|null} [warning] ReservationsScopedList warning + */ + + /** + * Constructs a new ReservationsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ReservationsScopedList. + * @implements IReservationsScopedList + * @constructor + * @param {google.cloud.compute.v1.IReservationsScopedList=} [properties] Properties to set + */ + function ReservationsScopedList(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]]; + } + + /** + * ReservationsScopedList reservations. + * @member {Array.} reservations + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @instance + */ + ReservationsScopedList.prototype.reservations = $util.emptyArray; + + /** + * ReservationsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @instance + */ + ReservationsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReservationsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @instance + */ + Object.defineProperty(ReservationsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReservationsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {google.cloud.compute.v1.IReservationsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ReservationsScopedList} ReservationsScopedList instance + */ + ReservationsScopedList.create = function create(properties) { + return new ReservationsScopedList(properties); + }; + + /** + * Encodes the specified ReservationsScopedList message. Does not implicitly {@link google.cloud.compute.v1.ReservationsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {google.cloud.compute.v1.IReservationsScopedList} message ReservationsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.reservations != null && message.reservations.length) + for (var i = 0; i < message.reservations.length; ++i) + $root.google.cloud.compute.v1.Reservation.encode(message.reservations[i], writer.uint32(/* id 399717927, wireType 2 =*/3197743418).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReservationsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {google.cloud.compute.v1.IReservationsScopedList} message ReservationsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservationsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ReservationsScopedList} ReservationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ReservationsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 399717927: + if (!(message.reservations && message.reservations.length)) + message.reservations = []; + message.reservations.push($root.google.cloud.compute.v1.Reservation.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservationsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ReservationsScopedList} ReservationsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservationsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservationsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.compute.v1.Reservation.verify(message.reservations[i]); + if (error) + return "reservations." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ReservationsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ReservationsScopedList} ReservationsScopedList + */ + ReservationsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ReservationsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.ReservationsScopedList(); + if (object.reservations) { + if (!Array.isArray(object.reservations)) + throw TypeError(".google.cloud.compute.v1.ReservationsScopedList.reservations: array expected"); + message.reservations = []; + for (var i = 0; i < object.reservations.length; ++i) { + if (typeof object.reservations[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ReservationsScopedList.reservations: object expected"); + message.reservations[i] = $root.google.cloud.compute.v1.Reservation.fromObject(object.reservations[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ReservationsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ReservationsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @static + * @param {google.cloud.compute.v1.ReservationsScopedList} message ReservationsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservationsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reservations = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.reservations && message.reservations.length) { + object.reservations = []; + for (var j = 0; j < message.reservations.length; ++j) + object.reservations[j] = $root.google.cloud.compute.v1.Reservation.toObject(message.reservations[j], options); + } + return object; + }; + + /** + * Converts this ReservationsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ReservationsScopedList + * @instance + * @returns {Object.} JSON object + */ + ReservationsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservationsScopedList; + })(); + + v1.ReservationAggregatedList = (function() { + + /** + * Properties of a ReservationAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IReservationAggregatedList + * @property {string|null} [id] ReservationAggregatedList id + * @property {Object.|null} [items] ReservationAggregatedList items + * @property {string|null} [kind] ReservationAggregatedList kind + * @property {string|null} [nextPageToken] ReservationAggregatedList nextPageToken + * @property {string|null} [selfLink] ReservationAggregatedList selfLink + * @property {Array.|null} [unreachables] ReservationAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] ReservationAggregatedList warning + */ + + /** + * Constructs a new ReservationAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ReservationAggregatedList. + * @implements IReservationAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IReservationAggregatedList=} [properties] Properties to set + */ + function ReservationAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservationAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + ReservationAggregatedList.prototype.id = null; + + /** + * ReservationAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + ReservationAggregatedList.prototype.items = $util.emptyObject; + + /** + * ReservationAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + ReservationAggregatedList.prototype.kind = null; + + /** + * ReservationAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + ReservationAggregatedList.prototype.nextPageToken = null; + + /** + * ReservationAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + ReservationAggregatedList.prototype.selfLink = null; + + /** + * ReservationAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + ReservationAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * ReservationAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + ReservationAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReservationAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + Object.defineProperty(ReservationAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + Object.defineProperty(ReservationAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + Object.defineProperty(ReservationAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + Object.defineProperty(ReservationAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + */ + Object.defineProperty(ReservationAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReservationAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {google.cloud.compute.v1.IReservationAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ReservationAggregatedList} ReservationAggregatedList instance + */ + ReservationAggregatedList.create = function create(properties) { + return new ReservationAggregatedList(properties); + }; + + /** + * Encodes the specified ReservationAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.ReservationAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {google.cloud.compute.v1.IReservationAggregatedList} message ReservationAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.ReservationsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ReservationAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {google.cloud.compute.v1.IReservationAggregatedList} message ReservationAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservationAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ReservationAggregatedList} ReservationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ReservationAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.ReservationsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservationAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ReservationAggregatedList} ReservationAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservationAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservationAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.ReservationsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ReservationAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ReservationAggregatedList} ReservationAggregatedList + */ + ReservationAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ReservationAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.ReservationAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.ReservationAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.ReservationAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.ReservationsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.ReservationAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ReservationAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ReservationAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @static + * @param {google.cloud.compute.v1.ReservationAggregatedList} message ReservationAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservationAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.ReservationsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ReservationAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ReservationAggregatedList + * @instance + * @returns {Object.} JSON object + */ + ReservationAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservationAggregatedList; + })(); + + v1.ReservationList = (function() { + + /** + * Properties of a ReservationList. + * @memberof google.cloud.compute.v1 + * @interface IReservationList + * @property {string|null} [id] ReservationList id + * @property {Array.|null} [items] ReservationList items + * @property {string|null} [kind] ReservationList kind + * @property {string|null} [nextPageToken] ReservationList nextPageToken + * @property {string|null} [selfLink] ReservationList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] ReservationList warning + */ + + /** + * Constructs a new ReservationList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ReservationList. + * @implements IReservationList + * @constructor + * @param {google.cloud.compute.v1.IReservationList=} [properties] Properties to set + */ + function ReservationList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservationList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + ReservationList.prototype.id = null; + + /** + * ReservationList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + ReservationList.prototype.items = $util.emptyArray; + + /** + * ReservationList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + ReservationList.prototype.kind = null; + + /** + * ReservationList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + ReservationList.prototype.nextPageToken = null; + + /** + * ReservationList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + ReservationList.prototype.selfLink = null; + + /** + * ReservationList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + ReservationList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReservationList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + Object.defineProperty(ReservationList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + Object.defineProperty(ReservationList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + Object.defineProperty(ReservationList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + Object.defineProperty(ReservationList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ReservationList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ReservationList + * @instance + */ + Object.defineProperty(ReservationList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReservationList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {google.cloud.compute.v1.IReservationList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ReservationList} ReservationList instance + */ + ReservationList.create = function create(properties) { + return new ReservationList(properties); + }; + + /** + * Encodes the specified ReservationList message. Does not implicitly {@link google.cloud.compute.v1.ReservationList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {google.cloud.compute.v1.IReservationList} message ReservationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Reservation.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ReservationList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {google.cloud.compute.v1.IReservationList} message ReservationList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservationList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ReservationList} ReservationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ReservationList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Reservation.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservationList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ReservationList} ReservationList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservationList message. + * @function verify + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservationList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Reservation.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ReservationList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ReservationList} ReservationList + */ + ReservationList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ReservationList) + return object; + var message = new $root.google.cloud.compute.v1.ReservationList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.ReservationList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ReservationList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Reservation.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ReservationList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ReservationList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ReservationList + * @static + * @param {google.cloud.compute.v1.ReservationList} message ReservationList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservationList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Reservation.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ReservationList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ReservationList + * @instance + * @returns {Object.} JSON object + */ + ReservationList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservationList; + })(); + + v1.ReservationsResizeRequest = (function() { + + /** + * Properties of a ReservationsResizeRequest. + * @memberof google.cloud.compute.v1 + * @interface IReservationsResizeRequest + * @property {number|Long|null} [specificSkuCount] ReservationsResizeRequest specificSkuCount + */ + + /** + * Constructs a new ReservationsResizeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ReservationsResizeRequest. + * @implements IReservationsResizeRequest + * @constructor + * @param {google.cloud.compute.v1.IReservationsResizeRequest=} [properties] Properties to set + */ + function ReservationsResizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservationsResizeRequest specificSkuCount. + * @member {number|Long|null|undefined} specificSkuCount + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @instance + */ + ReservationsResizeRequest.prototype.specificSkuCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReservationsResizeRequest _specificSkuCount. + * @member {"specificSkuCount"|undefined} _specificSkuCount + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @instance + */ + Object.defineProperty(ReservationsResizeRequest.prototype, "_specificSkuCount", { + get: $util.oneOfGetter($oneOfFields = ["specificSkuCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReservationsResizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {google.cloud.compute.v1.IReservationsResizeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ReservationsResizeRequest} ReservationsResizeRequest instance + */ + ReservationsResizeRequest.create = function create(properties) { + return new ReservationsResizeRequest(properties); + }; + + /** + * Encodes the specified ReservationsResizeRequest message. Does not implicitly {@link google.cloud.compute.v1.ReservationsResizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {google.cloud.compute.v1.IReservationsResizeRequest} message ReservationsResizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationsResizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.specificSkuCount != null && Object.hasOwnProperty.call(message, "specificSkuCount")) + writer.uint32(/* id 13890720, wireType 0 =*/111125760).int64(message.specificSkuCount); + return writer; + }; + + /** + * Encodes the specified ReservationsResizeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ReservationsResizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {google.cloud.compute.v1.IReservationsResizeRequest} message ReservationsResizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationsResizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservationsResizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ReservationsResizeRequest} ReservationsResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationsResizeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ReservationsResizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 13890720: + message.specificSkuCount = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservationsResizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ReservationsResizeRequest} ReservationsResizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationsResizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservationsResizeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservationsResizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.specificSkuCount != null && message.hasOwnProperty("specificSkuCount")) { + properties._specificSkuCount = 1; + if (!$util.isInteger(message.specificSkuCount) && !(message.specificSkuCount && $util.isInteger(message.specificSkuCount.low) && $util.isInteger(message.specificSkuCount.high))) + return "specificSkuCount: integer|Long expected"; + } + return null; + }; + + /** + * Creates a ReservationsResizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ReservationsResizeRequest} ReservationsResizeRequest + */ + ReservationsResizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ReservationsResizeRequest) + return object; + var message = new $root.google.cloud.compute.v1.ReservationsResizeRequest(); + if (object.specificSkuCount != null) + if ($util.Long) + (message.specificSkuCount = $util.Long.fromValue(object.specificSkuCount)).unsigned = false; + else if (typeof object.specificSkuCount === "string") + message.specificSkuCount = parseInt(object.specificSkuCount, 10); + else if (typeof object.specificSkuCount === "number") + message.specificSkuCount = object.specificSkuCount; + else if (typeof object.specificSkuCount === "object") + message.specificSkuCount = new $util.LongBits(object.specificSkuCount.low >>> 0, object.specificSkuCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ReservationsResizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @static + * @param {google.cloud.compute.v1.ReservationsResizeRequest} message ReservationsResizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservationsResizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.specificSkuCount != null && message.hasOwnProperty("specificSkuCount")) { + if (typeof message.specificSkuCount === "number") + object.specificSkuCount = options.longs === String ? String(message.specificSkuCount) : message.specificSkuCount; + else + object.specificSkuCount = options.longs === String ? $util.Long.prototype.toString.call(message.specificSkuCount) : options.longs === Number ? new $util.LongBits(message.specificSkuCount.low >>> 0, message.specificSkuCount.high >>> 0).toNumber() : message.specificSkuCount; + if (options.oneofs) + object._specificSkuCount = "specificSkuCount"; + } + return object; + }; + + /** + * Converts this ReservationsResizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ReservationsResizeRequest + * @instance + * @returns {Object.} JSON object + */ + ReservationsResizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservationsResizeRequest; + })(); + + v1.ResourceGroupReference = (function() { + + /** + * Properties of a ResourceGroupReference. + * @memberof google.cloud.compute.v1 + * @interface IResourceGroupReference + * @property {string|null} [group] ResourceGroupReference group + */ + + /** + * Constructs a new ResourceGroupReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourceGroupReference. + * @implements IResourceGroupReference + * @constructor + * @param {google.cloud.compute.v1.IResourceGroupReference=} [properties] Properties to set + */ + function ResourceGroupReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceGroupReference group. + * @member {string|null|undefined} group + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @instance + */ + ResourceGroupReference.prototype.group = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourceGroupReference _group. + * @member {"group"|undefined} _group + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @instance + */ + Object.defineProperty(ResourceGroupReference.prototype, "_group", { + get: $util.oneOfGetter($oneOfFields = ["group"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourceGroupReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {google.cloud.compute.v1.IResourceGroupReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourceGroupReference} ResourceGroupReference instance + */ + ResourceGroupReference.create = function create(properties) { + return new ResourceGroupReference(properties); + }; + + /** + * Encodes the specified ResourceGroupReference message. Does not implicitly {@link google.cloud.compute.v1.ResourceGroupReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {google.cloud.compute.v1.IResourceGroupReference} message ResourceGroupReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceGroupReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 98629247, wireType 2 =*/789033978).string(message.group); + return writer; + }; + + /** + * Encodes the specified ResourceGroupReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourceGroupReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {google.cloud.compute.v1.IResourceGroupReference} message ResourceGroupReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceGroupReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceGroupReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourceGroupReference} ResourceGroupReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceGroupReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourceGroupReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 98629247: + message.group = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceGroupReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourceGroupReference} ResourceGroupReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceGroupReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceGroupReference message. + * @function verify + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceGroupReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.group != null && message.hasOwnProperty("group")) { + properties._group = 1; + if (!$util.isString(message.group)) + return "group: string expected"; + } + return null; + }; + + /** + * Creates a ResourceGroupReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourceGroupReference} ResourceGroupReference + */ + ResourceGroupReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourceGroupReference) + return object; + var message = new $root.google.cloud.compute.v1.ResourceGroupReference(); + if (object.group != null) + message.group = String(object.group); + return message; + }; + + /** + * Creates a plain object from a ResourceGroupReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @static + * @param {google.cloud.compute.v1.ResourceGroupReference} message ResourceGroupReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceGroupReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.group != null && message.hasOwnProperty("group")) { + object.group = message.group; + if (options.oneofs) + object._group = "group"; + } + return object; + }; + + /** + * Converts this ResourceGroupReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourceGroupReference + * @instance + * @returns {Object.} JSON object + */ + ResourceGroupReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourceGroupReference; + })(); + + v1.ResourcePolicy = (function() { + + /** + * Properties of a ResourcePolicy. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicy + * @property {string|null} [creationTimestamp] ResourcePolicy creationTimestamp + * @property {string|null} [description] ResourcePolicy description + * @property {google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy|null} [groupPlacementPolicy] ResourcePolicy groupPlacementPolicy + * @property {number|Long|null} [id] ResourcePolicy id + * @property {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy|null} [instanceSchedulePolicy] ResourcePolicy instanceSchedulePolicy + * @property {string|null} [kind] ResourcePolicy kind + * @property {string|null} [name] ResourcePolicy name + * @property {string|null} [region] ResourcePolicy region + * @property {google.cloud.compute.v1.IResourcePolicyResourceStatus|null} [resourceStatus] ResourcePolicy resourceStatus + * @property {string|null} [selfLink] ResourcePolicy selfLink + * @property {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy|null} [snapshotSchedulePolicy] ResourcePolicy snapshotSchedulePolicy + * @property {google.cloud.compute.v1.ResourcePolicy.Status|null} [status] ResourcePolicy status + */ + + /** + * Constructs a new ResourcePolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicy. + * @implements IResourcePolicy + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicy=} [properties] Properties to set + */ + function ResourcePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.creationTimestamp = null; + + /** + * ResourcePolicy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.description = null; + + /** + * ResourcePolicy groupPlacementPolicy. + * @member {google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy|null|undefined} groupPlacementPolicy + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.groupPlacementPolicy = null; + + /** + * ResourcePolicy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.id = null; + + /** + * ResourcePolicy instanceSchedulePolicy. + * @member {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy|null|undefined} instanceSchedulePolicy + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.instanceSchedulePolicy = null; + + /** + * ResourcePolicy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.kind = null; + + /** + * ResourcePolicy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.name = null; + + /** + * ResourcePolicy region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.region = null; + + /** + * ResourcePolicy resourceStatus. + * @member {google.cloud.compute.v1.IResourcePolicyResourceStatus|null|undefined} resourceStatus + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.resourceStatus = null; + + /** + * ResourcePolicy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.selfLink = null; + + /** + * ResourcePolicy snapshotSchedulePolicy. + * @member {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy|null|undefined} snapshotSchedulePolicy + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.snapshotSchedulePolicy = null; + + /** + * ResourcePolicy status. + * @member {google.cloud.compute.v1.ResourcePolicy.Status|null|undefined} status + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + ResourcePolicy.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _groupPlacementPolicy. + * @member {"groupPlacementPolicy"|undefined} _groupPlacementPolicy + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_groupPlacementPolicy", { + get: $util.oneOfGetter($oneOfFields = ["groupPlacementPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _instanceSchedulePolicy. + * @member {"instanceSchedulePolicy"|undefined} _instanceSchedulePolicy + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_instanceSchedulePolicy", { + get: $util.oneOfGetter($oneOfFields = ["instanceSchedulePolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _resourceStatus. + * @member {"resourceStatus"|undefined} _resourceStatus + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_resourceStatus", { + get: $util.oneOfGetter($oneOfFields = ["resourceStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _snapshotSchedulePolicy. + * @member {"snapshotSchedulePolicy"|undefined} _snapshotSchedulePolicy + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_snapshotSchedulePolicy", { + get: $util.oneOfGetter($oneOfFields = ["snapshotSchedulePolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicy _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + */ + Object.defineProperty(ResourcePolicy.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicy} ResourcePolicy instance + */ + ResourcePolicy.create = function create(properties) { + return new ResourcePolicy(properties); + }; + + /** + * Encodes the specified ResourcePolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicy} message ResourcePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.groupPlacementPolicy != null && Object.hasOwnProperty.call(message, "groupPlacementPolicy")) + $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.encode(message.groupPlacementPolicy, writer.uint32(/* id 10931596, wireType 2 =*/87452770).fork()).ldelim(); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.snapshotSchedulePolicy != null && Object.hasOwnProperty.call(message, "snapshotSchedulePolicy")) + $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.encode(message.snapshotSchedulePolicy, writer.uint32(/* id 218131295, wireType 2 =*/1745050362).fork()).ldelim(); + if (message.resourceStatus != null && Object.hasOwnProperty.call(message, "resourceStatus")) + $root.google.cloud.compute.v1.ResourcePolicyResourceStatus.encode(message.resourceStatus, writer.uint32(/* id 249429315, wireType 2 =*/1995434522).fork()).ldelim(); + if (message.instanceSchedulePolicy != null && Object.hasOwnProperty.call(message, "instanceSchedulePolicy")) + $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.encode(message.instanceSchedulePolicy, writer.uint32(/* id 344877104, wireType 2 =*/2759016834).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ResourcePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicy} message ResourcePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicy} ResourcePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 10931596: + message.groupPlacementPolicy = $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.decode(reader, reader.uint32()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 344877104: + message.instanceSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.decode(reader, reader.uint32()); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 249429315: + message.resourceStatus = $root.google.cloud.compute.v1.ResourcePolicyResourceStatus.decode(reader, reader.uint32()); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 218131295: + message.snapshotSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.decode(reader, reader.uint32()); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicy} ResourcePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicy message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.groupPlacementPolicy != null && message.hasOwnProperty("groupPlacementPolicy")) { + properties._groupPlacementPolicy = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.verify(message.groupPlacementPolicy); + if (error) + return "groupPlacementPolicy." + error; + } + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.instanceSchedulePolicy != null && message.hasOwnProperty("instanceSchedulePolicy")) { + properties._instanceSchedulePolicy = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.verify(message.instanceSchedulePolicy); + if (error) + return "instanceSchedulePolicy." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.resourceStatus != null && message.hasOwnProperty("resourceStatus")) { + properties._resourceStatus = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyResourceStatus.verify(message.resourceStatus); + if (error) + return "resourceStatus." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.snapshotSchedulePolicy != null && message.hasOwnProperty("snapshotSchedulePolicy")) { + properties._snapshotSchedulePolicy = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.verify(message.snapshotSchedulePolicy); + if (error) + return "snapshotSchedulePolicy." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 482489093: + case 530283991: + case 77848963: + break; + } + } + return null; + }; + + /** + * Creates a ResourcePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicy} ResourcePolicy + */ + ResourcePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicy) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicy(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.groupPlacementPolicy != null) { + if (typeof object.groupPlacementPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicy.groupPlacementPolicy: object expected"); + message.groupPlacementPolicy = $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.fromObject(object.groupPlacementPolicy); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.instanceSchedulePolicy != null) { + if (typeof object.instanceSchedulePolicy !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicy.instanceSchedulePolicy: object expected"); + message.instanceSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.fromObject(object.instanceSchedulePolicy); + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.region != null) + message.region = String(object.region); + if (object.resourceStatus != null) { + if (typeof object.resourceStatus !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicy.resourceStatus: object expected"); + message.resourceStatus = $root.google.cloud.compute.v1.ResourcePolicyResourceStatus.fromObject(object.resourceStatus); + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.snapshotSchedulePolicy != null) { + if (typeof object.snapshotSchedulePolicy !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicy.snapshotSchedulePolicy: object expected"); + message.snapshotSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.fromObject(object.snapshotSchedulePolicy); + } + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "EXPIRED": + case 482489093: + message.status = 482489093; + break; + case "INVALID": + case 530283991: + message.status = 530283991; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicy + * @static + * @param {google.cloud.compute.v1.ResourcePolicy} message ResourcePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.groupPlacementPolicy != null && message.hasOwnProperty("groupPlacementPolicy")) { + object.groupPlacementPolicy = $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.toObject(message.groupPlacementPolicy, options); + if (options.oneofs) + object._groupPlacementPolicy = "groupPlacementPolicy"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.ResourcePolicy.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.snapshotSchedulePolicy != null && message.hasOwnProperty("snapshotSchedulePolicy")) { + object.snapshotSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.toObject(message.snapshotSchedulePolicy, options); + if (options.oneofs) + object._snapshotSchedulePolicy = "snapshotSchedulePolicy"; + } + if (message.resourceStatus != null && message.hasOwnProperty("resourceStatus")) { + object.resourceStatus = $root.google.cloud.compute.v1.ResourcePolicyResourceStatus.toObject(message.resourceStatus, options); + if (options.oneofs) + object._resourceStatus = "resourceStatus"; + } + if (message.instanceSchedulePolicy != null && message.hasOwnProperty("instanceSchedulePolicy")) { + object.instanceSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.toObject(message.instanceSchedulePolicy, options); + if (options.oneofs) + object._instanceSchedulePolicy = "instanceSchedulePolicy"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ResourcePolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicy + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.ResourcePolicy.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} EXPIRED=482489093 EXPIRED value + * @property {number} INVALID=530283991 INVALID value + * @property {number} READY=77848963 READY value + */ + ResourcePolicy.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[482489093] = "EXPIRED"] = 482489093; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[77848963] = "READY"] = 77848963; + return values; + })(); + + return ResourcePolicy; + })(); + + v1.ResourcePoliciesScopedList = (function() { + + /** + * Properties of a ResourcePoliciesScopedList. + * @memberof google.cloud.compute.v1 + * @interface IResourcePoliciesScopedList + * @property {Array.|null} [resourcePolicies] ResourcePoliciesScopedList resourcePolicies + * @property {google.cloud.compute.v1.IWarning|null} [warning] ResourcePoliciesScopedList warning + */ + + /** + * Constructs a new ResourcePoliciesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePoliciesScopedList. + * @implements IResourcePoliciesScopedList + * @constructor + * @param {google.cloud.compute.v1.IResourcePoliciesScopedList=} [properties] Properties to set + */ + function ResourcePoliciesScopedList(properties) { + this.resourcePolicies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePoliciesScopedList resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @instance + */ + ResourcePoliciesScopedList.prototype.resourcePolicies = $util.emptyArray; + + /** + * ResourcePoliciesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @instance + */ + ResourcePoliciesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePoliciesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @instance + */ + Object.defineProperty(ResourcePoliciesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePoliciesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {google.cloud.compute.v1.IResourcePoliciesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePoliciesScopedList} ResourcePoliciesScopedList instance + */ + ResourcePoliciesScopedList.create = function create(properties) { + return new ResourcePoliciesScopedList(properties); + }; + + /** + * Encodes the specified ResourcePoliciesScopedList message. Does not implicitly {@link google.cloud.compute.v1.ResourcePoliciesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {google.cloud.compute.v1.IResourcePoliciesScopedList} message ResourcePoliciesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePoliciesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + $root.google.cloud.compute.v1.ResourcePolicy.encode(message.resourcePolicies[i], writer.uint32(/* id 22220385, wireType 2 =*/177763082).fork()).ldelim(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePoliciesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePoliciesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {google.cloud.compute.v1.IResourcePoliciesScopedList} message ResourcePoliciesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePoliciesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePoliciesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePoliciesScopedList} ResourcePoliciesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePoliciesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePoliciesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22220385: + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push($root.google.cloud.compute.v1.ResourcePolicy.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePoliciesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePoliciesScopedList} ResourcePoliciesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePoliciesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePoliciesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePoliciesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) { + var error = $root.google.cloud.compute.v1.ResourcePolicy.verify(message.resourcePolicies[i]); + if (error) + return "resourcePolicies." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePoliciesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePoliciesScopedList} ResourcePoliciesScopedList + */ + ResourcePoliciesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePoliciesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePoliciesScopedList(); + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.compute.v1.ResourcePoliciesScopedList.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) { + if (typeof object.resourcePolicies[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePoliciesScopedList.resourcePolicies: object expected"); + message.resourcePolicies[i] = $root.google.cloud.compute.v1.ResourcePolicy.fromObject(object.resourcePolicies[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePoliciesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePoliciesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @static + * @param {google.cloud.compute.v1.ResourcePoliciesScopedList} message ResourcePoliciesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePoliciesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourcePolicies = []; + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = $root.google.cloud.compute.v1.ResourcePolicy.toObject(message.resourcePolicies[j], options); + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + return object; + }; + + /** + * Converts this ResourcePoliciesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePoliciesScopedList + * @instance + * @returns {Object.} JSON object + */ + ResourcePoliciesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePoliciesScopedList; + })(); + + v1.ResourcePolicyGroupPlacementPolicy = (function() { + + /** + * Properties of a ResourcePolicyGroupPlacementPolicy. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyGroupPlacementPolicy + * @property {number|null} [availabilityDomainCount] ResourcePolicyGroupPlacementPolicy availabilityDomainCount + * @property {google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation|null} [collocation] ResourcePolicyGroupPlacementPolicy collocation + * @property {number|null} [vmCount] ResourcePolicyGroupPlacementPolicy vmCount + */ + + /** + * Constructs a new ResourcePolicyGroupPlacementPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyGroupPlacementPolicy. + * @implements IResourcePolicyGroupPlacementPolicy + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy=} [properties] Properties to set + */ + function ResourcePolicyGroupPlacementPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyGroupPlacementPolicy availabilityDomainCount. + * @member {number|null|undefined} availabilityDomainCount + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @instance + */ + ResourcePolicyGroupPlacementPolicy.prototype.availabilityDomainCount = null; + + /** + * ResourcePolicyGroupPlacementPolicy collocation. + * @member {google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation|null|undefined} collocation + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @instance + */ + ResourcePolicyGroupPlacementPolicy.prototype.collocation = null; + + /** + * ResourcePolicyGroupPlacementPolicy vmCount. + * @member {number|null|undefined} vmCount + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @instance + */ + ResourcePolicyGroupPlacementPolicy.prototype.vmCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyGroupPlacementPolicy _availabilityDomainCount. + * @member {"availabilityDomainCount"|undefined} _availabilityDomainCount + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @instance + */ + Object.defineProperty(ResourcePolicyGroupPlacementPolicy.prototype, "_availabilityDomainCount", { + get: $util.oneOfGetter($oneOfFields = ["availabilityDomainCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyGroupPlacementPolicy _collocation. + * @member {"collocation"|undefined} _collocation + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @instance + */ + Object.defineProperty(ResourcePolicyGroupPlacementPolicy.prototype, "_collocation", { + get: $util.oneOfGetter($oneOfFields = ["collocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyGroupPlacementPolicy _vmCount. + * @member {"vmCount"|undefined} _vmCount + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @instance + */ + Object.defineProperty(ResourcePolicyGroupPlacementPolicy.prototype, "_vmCount", { + get: $util.oneOfGetter($oneOfFields = ["vmCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyGroupPlacementPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy} ResourcePolicyGroupPlacementPolicy instance + */ + ResourcePolicyGroupPlacementPolicy.create = function create(properties) { + return new ResourcePolicyGroupPlacementPolicy(properties); + }; + + /** + * Encodes the specified ResourcePolicyGroupPlacementPolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy} message ResourcePolicyGroupPlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyGroupPlacementPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availabilityDomainCount != null && Object.hasOwnProperty.call(message, "availabilityDomainCount")) + writer.uint32(/* id 12453432, wireType 0 =*/99627456).int32(message.availabilityDomainCount); + if (message.vmCount != null && Object.hasOwnProperty.call(message, "vmCount")) + writer.uint32(/* id 261463431, wireType 0 =*/2091707448).int32(message.vmCount); + if (message.collocation != null && Object.hasOwnProperty.call(message, "collocation")) + writer.uint32(/* id 511156533, wireType 0 =*/4089252264).int32(message.collocation); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyGroupPlacementPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicyGroupPlacementPolicy} message ResourcePolicyGroupPlacementPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyGroupPlacementPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyGroupPlacementPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy} ResourcePolicyGroupPlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyGroupPlacementPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 12453432: + message.availabilityDomainCount = reader.int32(); + break; + case 511156533: + message.collocation = reader.int32(); + break; + case 261463431: + message.vmCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyGroupPlacementPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy} ResourcePolicyGroupPlacementPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyGroupPlacementPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyGroupPlacementPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyGroupPlacementPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.availabilityDomainCount != null && message.hasOwnProperty("availabilityDomainCount")) { + properties._availabilityDomainCount = 1; + if (!$util.isInteger(message.availabilityDomainCount)) + return "availabilityDomainCount: integer expected"; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) { + properties._collocation = 1; + switch (message.collocation) { + default: + return "collocation: enum value expected"; + case 0: + case 103257554: + case 464308205: + break; + } + } + if (message.vmCount != null && message.hasOwnProperty("vmCount")) { + properties._vmCount = 1; + if (!$util.isInteger(message.vmCount)) + return "vmCount: integer expected"; + } + return null; + }; + + /** + * Creates a ResourcePolicyGroupPlacementPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy} ResourcePolicyGroupPlacementPolicy + */ + ResourcePolicyGroupPlacementPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy(); + if (object.availabilityDomainCount != null) + message.availabilityDomainCount = object.availabilityDomainCount | 0; + switch (object.collocation) { + case "UNDEFINED_COLLOCATION": + case 0: + message.collocation = 0; + break; + case "COLLOCATED": + case 103257554: + message.collocation = 103257554; + break; + case "UNSPECIFIED_COLLOCATION": + case 464308205: + message.collocation = 464308205; + break; + } + if (object.vmCount != null) + message.vmCount = object.vmCount | 0; + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyGroupPlacementPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @static + * @param {google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy} message ResourcePolicyGroupPlacementPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyGroupPlacementPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.availabilityDomainCount != null && message.hasOwnProperty("availabilityDomainCount")) { + object.availabilityDomainCount = message.availabilityDomainCount; + if (options.oneofs) + object._availabilityDomainCount = "availabilityDomainCount"; + } + if (message.vmCount != null && message.hasOwnProperty("vmCount")) { + object.vmCount = message.vmCount; + if (options.oneofs) + object._vmCount = "vmCount"; + } + if (message.collocation != null && message.hasOwnProperty("collocation")) { + object.collocation = options.enums === String ? $root.google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation[message.collocation] : message.collocation; + if (options.oneofs) + object._collocation = "collocation"; + } + return object; + }; + + /** + * Converts this ResourcePolicyGroupPlacementPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyGroupPlacementPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Collocation enum. + * @name google.cloud.compute.v1.ResourcePolicyGroupPlacementPolicy.Collocation + * @enum {number} + * @property {number} UNDEFINED_COLLOCATION=0 UNDEFINED_COLLOCATION value + * @property {number} COLLOCATED=103257554 COLLOCATED value + * @property {number} UNSPECIFIED_COLLOCATION=464308205 UNSPECIFIED_COLLOCATION value + */ + ResourcePolicyGroupPlacementPolicy.Collocation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_COLLOCATION"] = 0; + values[valuesById[103257554] = "COLLOCATED"] = 103257554; + values[valuesById[464308205] = "UNSPECIFIED_COLLOCATION"] = 464308205; + return values; + })(); + + return ResourcePolicyGroupPlacementPolicy; + })(); + + v1.ResourcePolicyInstanceSchedulePolicy = (function() { + + /** + * Properties of a ResourcePolicyInstanceSchedulePolicy. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyInstanceSchedulePolicy + * @property {string|null} [expirationTime] ResourcePolicyInstanceSchedulePolicy expirationTime + * @property {string|null} [startTime] ResourcePolicyInstanceSchedulePolicy startTime + * @property {string|null} [timeZone] ResourcePolicyInstanceSchedulePolicy timeZone + * @property {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null} [vmStartSchedule] ResourcePolicyInstanceSchedulePolicy vmStartSchedule + * @property {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null} [vmStopSchedule] ResourcePolicyInstanceSchedulePolicy vmStopSchedule + */ + + /** + * Constructs a new ResourcePolicyInstanceSchedulePolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyInstanceSchedulePolicy. + * @implements IResourcePolicyInstanceSchedulePolicy + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy=} [properties] Properties to set + */ + function ResourcePolicyInstanceSchedulePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyInstanceSchedulePolicy expirationTime. + * @member {string|null|undefined} expirationTime + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + ResourcePolicyInstanceSchedulePolicy.prototype.expirationTime = null; + + /** + * ResourcePolicyInstanceSchedulePolicy startTime. + * @member {string|null|undefined} startTime + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + ResourcePolicyInstanceSchedulePolicy.prototype.startTime = null; + + /** + * ResourcePolicyInstanceSchedulePolicy timeZone. + * @member {string|null|undefined} timeZone + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + ResourcePolicyInstanceSchedulePolicy.prototype.timeZone = null; + + /** + * ResourcePolicyInstanceSchedulePolicy vmStartSchedule. + * @member {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null|undefined} vmStartSchedule + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + ResourcePolicyInstanceSchedulePolicy.prototype.vmStartSchedule = null; + + /** + * ResourcePolicyInstanceSchedulePolicy vmStopSchedule. + * @member {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule|null|undefined} vmStopSchedule + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + ResourcePolicyInstanceSchedulePolicy.prototype.vmStopSchedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyInstanceSchedulePolicy _expirationTime. + * @member {"expirationTime"|undefined} _expirationTime + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicyInstanceSchedulePolicy.prototype, "_expirationTime", { + get: $util.oneOfGetter($oneOfFields = ["expirationTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyInstanceSchedulePolicy _startTime. + * @member {"startTime"|undefined} _startTime + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicyInstanceSchedulePolicy.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyInstanceSchedulePolicy _timeZone. + * @member {"timeZone"|undefined} _timeZone + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicyInstanceSchedulePolicy.prototype, "_timeZone", { + get: $util.oneOfGetter($oneOfFields = ["timeZone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyInstanceSchedulePolicy _vmStartSchedule. + * @member {"vmStartSchedule"|undefined} _vmStartSchedule + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicyInstanceSchedulePolicy.prototype, "_vmStartSchedule", { + get: $util.oneOfGetter($oneOfFields = ["vmStartSchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyInstanceSchedulePolicy _vmStopSchedule. + * @member {"vmStopSchedule"|undefined} _vmStopSchedule + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicyInstanceSchedulePolicy.prototype, "_vmStopSchedule", { + get: $util.oneOfGetter($oneOfFields = ["vmStopSchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyInstanceSchedulePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy} ResourcePolicyInstanceSchedulePolicy instance + */ + ResourcePolicyInstanceSchedulePolicy.create = function create(properties) { + return new ResourcePolicyInstanceSchedulePolicy(properties); + }; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy} message ResourcePolicyInstanceSchedulePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyInstanceSchedulePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmStartSchedule != null && Object.hasOwnProperty.call(message, "vmStartSchedule")) + $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.encode(message.vmStartSchedule, writer.uint32(/* id 17762396, wireType 2 =*/142099170).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 36848094, wireType 2 =*/294784754).string(message.timeZone); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 37467274, wireType 2 =*/299738194).string(message.startTime); + if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + writer.uint32(/* id 230299229, wireType 2 =*/1842393834).string(message.expirationTime); + if (message.vmStopSchedule != null && Object.hasOwnProperty.call(message, "vmStopSchedule")) + $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.encode(message.vmStopSchedule, writer.uint32(/* id 426242732, wireType 2 =*/3409941858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicy} message ResourcePolicyInstanceSchedulePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyInstanceSchedulePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy} ResourcePolicyInstanceSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyInstanceSchedulePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 230299229: + message.expirationTime = reader.string(); + break; + case 37467274: + message.startTime = reader.string(); + break; + case 36848094: + message.timeZone = reader.string(); + break; + case 17762396: + message.vmStartSchedule = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.decode(reader, reader.uint32()); + break; + case 426242732: + message.vmStopSchedule = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy} ResourcePolicyInstanceSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyInstanceSchedulePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyInstanceSchedulePolicy message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyInstanceSchedulePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) { + properties._expirationTime = 1; + if (!$util.isString(message.expirationTime)) + return "expirationTime: string expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties._startTime = 1; + if (!$util.isString(message.startTime)) + return "startTime: string expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + properties._timeZone = 1; + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + } + if (message.vmStartSchedule != null && message.hasOwnProperty("vmStartSchedule")) { + properties._vmStartSchedule = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.verify(message.vmStartSchedule); + if (error) + return "vmStartSchedule." + error; + } + } + if (message.vmStopSchedule != null && message.hasOwnProperty("vmStopSchedule")) { + properties._vmStopSchedule = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.verify(message.vmStopSchedule); + if (error) + return "vmStopSchedule." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePolicyInstanceSchedulePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy} ResourcePolicyInstanceSchedulePolicy + */ + ResourcePolicyInstanceSchedulePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy(); + if (object.expirationTime != null) + message.expirationTime = String(object.expirationTime); + if (object.startTime != null) + message.startTime = String(object.startTime); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.vmStartSchedule != null) { + if (typeof object.vmStartSchedule !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.vmStartSchedule: object expected"); + message.vmStartSchedule = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.fromObject(object.vmStartSchedule); + } + if (object.vmStopSchedule != null) { + if (typeof object.vmStopSchedule !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy.vmStopSchedule: object expected"); + message.vmStopSchedule = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.fromObject(object.vmStopSchedule); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyInstanceSchedulePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @static + * @param {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy} message ResourcePolicyInstanceSchedulePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyInstanceSchedulePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.vmStartSchedule != null && message.hasOwnProperty("vmStartSchedule")) { + object.vmStartSchedule = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.toObject(message.vmStartSchedule, options); + if (options.oneofs) + object._vmStartSchedule = "vmStartSchedule"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) { + object.timeZone = message.timeZone; + if (options.oneofs) + object._timeZone = "timeZone"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.expirationTime != null && message.hasOwnProperty("expirationTime")) { + object.expirationTime = message.expirationTime; + if (options.oneofs) + object._expirationTime = "expirationTime"; + } + if (message.vmStopSchedule != null && message.hasOwnProperty("vmStopSchedule")) { + object.vmStopSchedule = $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.toObject(message.vmStopSchedule, options); + if (options.oneofs) + object._vmStopSchedule = "vmStopSchedule"; + } + return object; + }; + + /** + * Converts this ResourcePolicyInstanceSchedulePolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicy + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyInstanceSchedulePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyInstanceSchedulePolicy; + })(); + + v1.ResourcePolicyResourceStatus = (function() { + + /** + * Properties of a ResourcePolicyResourceStatus. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyResourceStatus + * @property {google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus|null} [instanceSchedulePolicy] ResourcePolicyResourceStatus instanceSchedulePolicy + */ + + /** + * Constructs a new ResourcePolicyResourceStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyResourceStatus. + * @implements IResourcePolicyResourceStatus + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatus=} [properties] Properties to set + */ + function ResourcePolicyResourceStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyResourceStatus instanceSchedulePolicy. + * @member {google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus|null|undefined} instanceSchedulePolicy + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @instance + */ + ResourcePolicyResourceStatus.prototype.instanceSchedulePolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyResourceStatus _instanceSchedulePolicy. + * @member {"instanceSchedulePolicy"|undefined} _instanceSchedulePolicy + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @instance + */ + Object.defineProperty(ResourcePolicyResourceStatus.prototype, "_instanceSchedulePolicy", { + get: $util.oneOfGetter($oneOfFields = ["instanceSchedulePolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyResourceStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatus} ResourcePolicyResourceStatus instance + */ + ResourcePolicyResourceStatus.create = function create(properties) { + return new ResourcePolicyResourceStatus(properties); + }; + + /** + * Encodes the specified ResourcePolicyResourceStatus message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatus} message ResourcePolicyResourceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyResourceStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceSchedulePolicy != null && Object.hasOwnProperty.call(message, "instanceSchedulePolicy")) + $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.encode(message.instanceSchedulePolicy, writer.uint32(/* id 344877104, wireType 2 =*/2759016834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyResourceStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatus} message ResourcePolicyResourceStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyResourceStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyResourceStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatus} ResourcePolicyResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyResourceStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyResourceStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 344877104: + message.instanceSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyResourceStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatus} ResourcePolicyResourceStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyResourceStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyResourceStatus message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyResourceStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceSchedulePolicy != null && message.hasOwnProperty("instanceSchedulePolicy")) { + properties._instanceSchedulePolicy = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.verify(message.instanceSchedulePolicy); + if (error) + return "instanceSchedulePolicy." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePolicyResourceStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatus} ResourcePolicyResourceStatus + */ + ResourcePolicyResourceStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyResourceStatus) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyResourceStatus(); + if (object.instanceSchedulePolicy != null) { + if (typeof object.instanceSchedulePolicy !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyResourceStatus.instanceSchedulePolicy: object expected"); + message.instanceSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.fromObject(object.instanceSchedulePolicy); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyResourceStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @static + * @param {google.cloud.compute.v1.ResourcePolicyResourceStatus} message ResourcePolicyResourceStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyResourceStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.instanceSchedulePolicy != null && message.hasOwnProperty("instanceSchedulePolicy")) { + object.instanceSchedulePolicy = $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.toObject(message.instanceSchedulePolicy, options); + if (options.oneofs) + object._instanceSchedulePolicy = "instanceSchedulePolicy"; + } + return object; + }; + + /** + * Converts this ResourcePolicyResourceStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatus + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyResourceStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyResourceStatus; + })(); + + v1.ResourcePolicySnapshotSchedulePolicy = (function() { + + /** + * Properties of a ResourcePolicySnapshotSchedulePolicy. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicySnapshotSchedulePolicy + * @property {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy|null} [retentionPolicy] ResourcePolicySnapshotSchedulePolicy retentionPolicy + * @property {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule|null} [schedule] ResourcePolicySnapshotSchedulePolicy schedule + * @property {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties|null} [snapshotProperties] ResourcePolicySnapshotSchedulePolicy snapshotProperties + */ + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicySnapshotSchedulePolicy. + * @implements IResourcePolicySnapshotSchedulePolicy + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy=} [properties] Properties to set + */ + function ResourcePolicySnapshotSchedulePolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicySnapshotSchedulePolicy retentionPolicy. + * @member {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy|null|undefined} retentionPolicy + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @instance + */ + ResourcePolicySnapshotSchedulePolicy.prototype.retentionPolicy = null; + + /** + * ResourcePolicySnapshotSchedulePolicy schedule. + * @member {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule|null|undefined} schedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @instance + */ + ResourcePolicySnapshotSchedulePolicy.prototype.schedule = null; + + /** + * ResourcePolicySnapshotSchedulePolicy snapshotProperties. + * @member {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties|null|undefined} snapshotProperties + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @instance + */ + ResourcePolicySnapshotSchedulePolicy.prototype.snapshotProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicySnapshotSchedulePolicy _retentionPolicy. + * @member {"retentionPolicy"|undefined} _retentionPolicy + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicy.prototype, "_retentionPolicy", { + get: $util.oneOfGetter($oneOfFields = ["retentionPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicySnapshotSchedulePolicy _schedule. + * @member {"schedule"|undefined} _schedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicy.prototype, "_schedule", { + get: $util.oneOfGetter($oneOfFields = ["schedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicySnapshotSchedulePolicy _snapshotProperties. + * @member {"snapshotProperties"|undefined} _snapshotProperties + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicy.prototype, "_snapshotProperties", { + get: $util.oneOfGetter($oneOfFields = ["snapshotProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy} ResourcePolicySnapshotSchedulePolicy instance + */ + ResourcePolicySnapshotSchedulePolicy.create = function create(properties) { + return new ResourcePolicySnapshotSchedulePolicy(properties); + }; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy} message ResourcePolicySnapshotSchedulePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionPolicy != null && Object.hasOwnProperty.call(message, "retentionPolicy")) + $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.encode(message.retentionPolicy, writer.uint32(/* id 68625779, wireType 2 =*/549006234).fork()).ldelim(); + if (message.snapshotProperties != null && Object.hasOwnProperty.call(message, "snapshotProperties")) + $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.encode(message.snapshotProperties, writer.uint32(/* id 185371278, wireType 2 =*/1482970226).fork()).ldelim(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.encode(message.schedule, writer.uint32(/* id 375820951, wireType 2 =*/3006567610).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicy} message ResourcePolicySnapshotSchedulePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy} ResourcePolicySnapshotSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 68625779: + message.retentionPolicy = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.decode(reader, reader.uint32()); + break; + case 375820951: + message.schedule = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.decode(reader, reader.uint32()); + break; + case 185371278: + message.snapshotProperties = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy} ResourcePolicySnapshotSchedulePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicy message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicySnapshotSchedulePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.retentionPolicy != null && message.hasOwnProperty("retentionPolicy")) { + properties._retentionPolicy = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.verify(message.retentionPolicy); + if (error) + return "retentionPolicy." + error; + } + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + properties._schedule = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + } + if (message.snapshotProperties != null && message.hasOwnProperty("snapshotProperties")) { + properties._snapshotProperties = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.verify(message.snapshotProperties); + if (error) + return "snapshotProperties." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePolicySnapshotSchedulePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy} ResourcePolicySnapshotSchedulePolicy + */ + ResourcePolicySnapshotSchedulePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy(); + if (object.retentionPolicy != null) { + if (typeof object.retentionPolicy !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.retentionPolicy: object expected"); + message.retentionPolicy = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.fromObject(object.retentionPolicy); + } + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.schedule: object expected"); + message.schedule = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.fromObject(object.schedule); + } + if (object.snapshotProperties != null) { + if (typeof object.snapshotProperties !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy.snapshotProperties: object expected"); + message.snapshotProperties = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.fromObject(object.snapshotProperties); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @static + * @param {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy} message ResourcePolicySnapshotSchedulePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicySnapshotSchedulePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.retentionPolicy != null && message.hasOwnProperty("retentionPolicy")) { + object.retentionPolicy = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.toObject(message.retentionPolicy, options); + if (options.oneofs) + object._retentionPolicy = "retentionPolicy"; + } + if (message.snapshotProperties != null && message.hasOwnProperty("snapshotProperties")) { + object.snapshotProperties = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.toObject(message.snapshotProperties, options); + if (options.oneofs) + object._snapshotProperties = "snapshotProperties"; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) { + object.schedule = $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.toObject(message.schedule, options); + if (options.oneofs) + object._schedule = "schedule"; + } + return object; + }; + + /** + * Converts this ResourcePolicySnapshotSchedulePolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicy + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicySnapshotSchedulePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicySnapshotSchedulePolicy; + })(); + + v1.ResourcePolicyAggregatedList = (function() { + + /** + * Properties of a ResourcePolicyAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyAggregatedList + * @property {string|null} [etag] ResourcePolicyAggregatedList etag + * @property {string|null} [id] ResourcePolicyAggregatedList id + * @property {Object.|null} [items] ResourcePolicyAggregatedList items + * @property {string|null} [kind] ResourcePolicyAggregatedList kind + * @property {string|null} [nextPageToken] ResourcePolicyAggregatedList nextPageToken + * @property {string|null} [selfLink] ResourcePolicyAggregatedList selfLink + * @property {Array.|null} [unreachables] ResourcePolicyAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] ResourcePolicyAggregatedList warning + */ + + /** + * Constructs a new ResourcePolicyAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyAggregatedList. + * @implements IResourcePolicyAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyAggregatedList=} [properties] Properties to set + */ + function ResourcePolicyAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyAggregatedList etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.etag = null; + + /** + * ResourcePolicyAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.id = null; + + /** + * ResourcePolicyAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.items = $util.emptyObject; + + /** + * ResourcePolicyAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.kind = null; + + /** + * ResourcePolicyAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.nextPageToken = null; + + /** + * ResourcePolicyAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.selfLink = null; + + /** + * ResourcePolicyAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * ResourcePolicyAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + ResourcePolicyAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyAggregatedList _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + Object.defineProperty(ResourcePolicyAggregatedList.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + Object.defineProperty(ResourcePolicyAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + Object.defineProperty(ResourcePolicyAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + Object.defineProperty(ResourcePolicyAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + Object.defineProperty(ResourcePolicyAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + */ + Object.defineProperty(ResourcePolicyAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {google.cloud.compute.v1.IResourcePolicyAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyAggregatedList} ResourcePolicyAggregatedList instance + */ + ResourcePolicyAggregatedList.create = function create(properties) { + return new ResourcePolicyAggregatedList(properties); + }; + + /** + * Encodes the specified ResourcePolicyAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {google.cloud.compute.v1.IResourcePolicyAggregatedList} message ResourcePolicyAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.ResourcePoliciesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {google.cloud.compute.v1.IResourcePolicyAggregatedList} message ResourcePolicyAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyAggregatedList} ResourcePolicyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3123477: + message.etag = reader.string(); + break; + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.ResourcePoliciesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyAggregatedList} ResourcePolicyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.ResourcePoliciesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePolicyAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyAggregatedList} ResourcePolicyAggregatedList + */ + ResourcePolicyAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyAggregatedList(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.ResourcePoliciesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.ResourcePolicyAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @static + * @param {google.cloud.compute.v1.ResourcePolicyAggregatedList} message ResourcePolicyAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.ResourcePoliciesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ResourcePolicyAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyAggregatedList + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyAggregatedList; + })(); + + v1.ResourcePolicyDailyCycle = (function() { + + /** + * Properties of a ResourcePolicyDailyCycle. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyDailyCycle + * @property {number|null} [daysInCycle] ResourcePolicyDailyCycle daysInCycle + * @property {string|null} [duration] ResourcePolicyDailyCycle duration + * @property {string|null} [startTime] ResourcePolicyDailyCycle startTime + */ + + /** + * Constructs a new ResourcePolicyDailyCycle. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyDailyCycle. + * @implements IResourcePolicyDailyCycle + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyDailyCycle=} [properties] Properties to set + */ + function ResourcePolicyDailyCycle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyDailyCycle daysInCycle. + * @member {number|null|undefined} daysInCycle + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @instance + */ + ResourcePolicyDailyCycle.prototype.daysInCycle = null; + + /** + * ResourcePolicyDailyCycle duration. + * @member {string|null|undefined} duration + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @instance + */ + ResourcePolicyDailyCycle.prototype.duration = null; + + /** + * ResourcePolicyDailyCycle startTime. + * @member {string|null|undefined} startTime + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @instance + */ + ResourcePolicyDailyCycle.prototype.startTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyDailyCycle _daysInCycle. + * @member {"daysInCycle"|undefined} _daysInCycle + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @instance + */ + Object.defineProperty(ResourcePolicyDailyCycle.prototype, "_daysInCycle", { + get: $util.oneOfGetter($oneOfFields = ["daysInCycle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyDailyCycle _duration. + * @member {"duration"|undefined} _duration + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @instance + */ + Object.defineProperty(ResourcePolicyDailyCycle.prototype, "_duration", { + get: $util.oneOfGetter($oneOfFields = ["duration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyDailyCycle _startTime. + * @member {"startTime"|undefined} _startTime + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @instance + */ + Object.defineProperty(ResourcePolicyDailyCycle.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyDailyCycle instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyDailyCycle=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyDailyCycle} ResourcePolicyDailyCycle instance + */ + ResourcePolicyDailyCycle.create = function create(properties) { + return new ResourcePolicyDailyCycle(properties); + }; + + /** + * Encodes the specified ResourcePolicyDailyCycle message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyDailyCycle.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyDailyCycle} message ResourcePolicyDailyCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyDailyCycle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 37467274, wireType 2 =*/299738194).string(message.startTime); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + writer.uint32(/* id 155471252, wireType 2 =*/1243770018).string(message.duration); + if (message.daysInCycle != null && Object.hasOwnProperty.call(message, "daysInCycle")) + writer.uint32(/* id 369790004, wireType 0 =*/2958320032).int32(message.daysInCycle); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyDailyCycle message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyDailyCycle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyDailyCycle} message ResourcePolicyDailyCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyDailyCycle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyDailyCycle message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyDailyCycle} ResourcePolicyDailyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyDailyCycle.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyDailyCycle(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 369790004: + message.daysInCycle = reader.int32(); + break; + case 155471252: + message.duration = reader.string(); + break; + case 37467274: + message.startTime = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyDailyCycle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyDailyCycle} ResourcePolicyDailyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyDailyCycle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyDailyCycle message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyDailyCycle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.daysInCycle != null && message.hasOwnProperty("daysInCycle")) { + properties._daysInCycle = 1; + if (!$util.isInteger(message.daysInCycle)) + return "daysInCycle: integer expected"; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + properties._duration = 1; + if (!$util.isString(message.duration)) + return "duration: string expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties._startTime = 1; + if (!$util.isString(message.startTime)) + return "startTime: string expected"; + } + return null; + }; + + /** + * Creates a ResourcePolicyDailyCycle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyDailyCycle} ResourcePolicyDailyCycle + */ + ResourcePolicyDailyCycle.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyDailyCycle) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyDailyCycle(); + if (object.daysInCycle != null) + message.daysInCycle = object.daysInCycle | 0; + if (object.duration != null) + message.duration = String(object.duration); + if (object.startTime != null) + message.startTime = String(object.startTime); + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyDailyCycle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @static + * @param {google.cloud.compute.v1.ResourcePolicyDailyCycle} message ResourcePolicyDailyCycle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyDailyCycle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + object.duration = message.duration; + if (options.oneofs) + object._duration = "duration"; + } + if (message.daysInCycle != null && message.hasOwnProperty("daysInCycle")) { + object.daysInCycle = message.daysInCycle; + if (options.oneofs) + object._daysInCycle = "daysInCycle"; + } + return object; + }; + + /** + * Converts this ResourcePolicyDailyCycle to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyDailyCycle + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyDailyCycle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyDailyCycle; + })(); + + v1.ResourcePolicyHourlyCycle = (function() { + + /** + * Properties of a ResourcePolicyHourlyCycle. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyHourlyCycle + * @property {string|null} [duration] ResourcePolicyHourlyCycle duration + * @property {number|null} [hoursInCycle] ResourcePolicyHourlyCycle hoursInCycle + * @property {string|null} [startTime] ResourcePolicyHourlyCycle startTime + */ + + /** + * Constructs a new ResourcePolicyHourlyCycle. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyHourlyCycle. + * @implements IResourcePolicyHourlyCycle + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyHourlyCycle=} [properties] Properties to set + */ + function ResourcePolicyHourlyCycle(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyHourlyCycle duration. + * @member {string|null|undefined} duration + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @instance + */ + ResourcePolicyHourlyCycle.prototype.duration = null; + + /** + * ResourcePolicyHourlyCycle hoursInCycle. + * @member {number|null|undefined} hoursInCycle + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @instance + */ + ResourcePolicyHourlyCycle.prototype.hoursInCycle = null; + + /** + * ResourcePolicyHourlyCycle startTime. + * @member {string|null|undefined} startTime + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @instance + */ + ResourcePolicyHourlyCycle.prototype.startTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyHourlyCycle _duration. + * @member {"duration"|undefined} _duration + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @instance + */ + Object.defineProperty(ResourcePolicyHourlyCycle.prototype, "_duration", { + get: $util.oneOfGetter($oneOfFields = ["duration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyHourlyCycle _hoursInCycle. + * @member {"hoursInCycle"|undefined} _hoursInCycle + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @instance + */ + Object.defineProperty(ResourcePolicyHourlyCycle.prototype, "_hoursInCycle", { + get: $util.oneOfGetter($oneOfFields = ["hoursInCycle"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyHourlyCycle _startTime. + * @member {"startTime"|undefined} _startTime + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @instance + */ + Object.defineProperty(ResourcePolicyHourlyCycle.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyHourlyCycle instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyHourlyCycle=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyHourlyCycle} ResourcePolicyHourlyCycle instance + */ + ResourcePolicyHourlyCycle.create = function create(properties) { + return new ResourcePolicyHourlyCycle(properties); + }; + + /** + * Encodes the specified ResourcePolicyHourlyCycle message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyHourlyCycle.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyHourlyCycle} message ResourcePolicyHourlyCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyHourlyCycle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 37467274, wireType 2 =*/299738194).string(message.startTime); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + writer.uint32(/* id 155471252, wireType 2 =*/1243770018).string(message.duration); + if (message.hoursInCycle != null && Object.hasOwnProperty.call(message, "hoursInCycle")) + writer.uint32(/* id 526763132, wireType 0 =*/4214105056).int32(message.hoursInCycle); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyHourlyCycle message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyHourlyCycle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyHourlyCycle} message ResourcePolicyHourlyCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyHourlyCycle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyHourlyCycle message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyHourlyCycle} ResourcePolicyHourlyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyHourlyCycle.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 155471252: + message.duration = reader.string(); + break; + case 526763132: + message.hoursInCycle = reader.int32(); + break; + case 37467274: + message.startTime = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyHourlyCycle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyHourlyCycle} ResourcePolicyHourlyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyHourlyCycle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyHourlyCycle message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyHourlyCycle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.duration != null && message.hasOwnProperty("duration")) { + properties._duration = 1; + if (!$util.isString(message.duration)) + return "duration: string expected"; + } + if (message.hoursInCycle != null && message.hasOwnProperty("hoursInCycle")) { + properties._hoursInCycle = 1; + if (!$util.isInteger(message.hoursInCycle)) + return "hoursInCycle: integer expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties._startTime = 1; + if (!$util.isString(message.startTime)) + return "startTime: string expected"; + } + return null; + }; + + /** + * Creates a ResourcePolicyHourlyCycle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyHourlyCycle} ResourcePolicyHourlyCycle + */ + ResourcePolicyHourlyCycle.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle(); + if (object.duration != null) + message.duration = String(object.duration); + if (object.hoursInCycle != null) + message.hoursInCycle = object.hoursInCycle | 0; + if (object.startTime != null) + message.startTime = String(object.startTime); + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyHourlyCycle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @static + * @param {google.cloud.compute.v1.ResourcePolicyHourlyCycle} message ResourcePolicyHourlyCycle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyHourlyCycle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + object.duration = message.duration; + if (options.oneofs) + object._duration = "duration"; + } + if (message.hoursInCycle != null && message.hasOwnProperty("hoursInCycle")) { + object.hoursInCycle = message.hoursInCycle; + if (options.oneofs) + object._hoursInCycle = "hoursInCycle"; + } + return object; + }; + + /** + * Converts this ResourcePolicyHourlyCycle to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyHourlyCycle + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyHourlyCycle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyHourlyCycle; + })(); + + v1.ResourcePolicyInstanceSchedulePolicySchedule = (function() { + + /** + * Properties of a ResourcePolicyInstanceSchedulePolicySchedule. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyInstanceSchedulePolicySchedule + * @property {string|null} [schedule] ResourcePolicyInstanceSchedulePolicySchedule schedule + */ + + /** + * Constructs a new ResourcePolicyInstanceSchedulePolicySchedule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyInstanceSchedulePolicySchedule. + * @implements IResourcePolicyInstanceSchedulePolicySchedule + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule=} [properties] Properties to set + */ + function ResourcePolicyInstanceSchedulePolicySchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyInstanceSchedulePolicySchedule schedule. + * @member {string|null|undefined} schedule + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @instance + */ + ResourcePolicyInstanceSchedulePolicySchedule.prototype.schedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyInstanceSchedulePolicySchedule _schedule. + * @member {"schedule"|undefined} _schedule + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @instance + */ + Object.defineProperty(ResourcePolicyInstanceSchedulePolicySchedule.prototype, "_schedule", { + get: $util.oneOfGetter($oneOfFields = ["schedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyInstanceSchedulePolicySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule} ResourcePolicyInstanceSchedulePolicySchedule instance + */ + ResourcePolicyInstanceSchedulePolicySchedule.create = function create(properties) { + return new ResourcePolicyInstanceSchedulePolicySchedule(properties); + }; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicySchedule message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule} message ResourcePolicyInstanceSchedulePolicySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyInstanceSchedulePolicySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + writer.uint32(/* id 375820951, wireType 2 =*/3006567610).string(message.schedule); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyInstanceSchedulePolicySchedule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.IResourcePolicyInstanceSchedulePolicySchedule} message ResourcePolicyInstanceSchedulePolicySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyInstanceSchedulePolicySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule} ResourcePolicyInstanceSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyInstanceSchedulePolicySchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 375820951: + message.schedule = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyInstanceSchedulePolicySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule} ResourcePolicyInstanceSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyInstanceSchedulePolicySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyInstanceSchedulePolicySchedule message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyInstanceSchedulePolicySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.schedule != null && message.hasOwnProperty("schedule")) { + properties._schedule = 1; + if (!$util.isString(message.schedule)) + return "schedule: string expected"; + } + return null; + }; + + /** + * Creates a ResourcePolicyInstanceSchedulePolicySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule} ResourcePolicyInstanceSchedulePolicySchedule + */ + ResourcePolicyInstanceSchedulePolicySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule(); + if (object.schedule != null) + message.schedule = String(object.schedule); + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyInstanceSchedulePolicySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule} message ResourcePolicyInstanceSchedulePolicySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyInstanceSchedulePolicySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.schedule != null && message.hasOwnProperty("schedule")) { + object.schedule = message.schedule; + if (options.oneofs) + object._schedule = "schedule"; + } + return object; + }; + + /** + * Converts this ResourcePolicyInstanceSchedulePolicySchedule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyInstanceSchedulePolicySchedule + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyInstanceSchedulePolicySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyInstanceSchedulePolicySchedule; + })(); + + v1.ResourcePolicyList = (function() { + + /** + * Properties of a ResourcePolicyList. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyList + * @property {string|null} [etag] ResourcePolicyList etag + * @property {string|null} [id] ResourcePolicyList id + * @property {Array.|null} [items] ResourcePolicyList items + * @property {string|null} [kind] ResourcePolicyList kind + * @property {string|null} [nextPageToken] ResourcePolicyList nextPageToken + * @property {string|null} [selfLink] ResourcePolicyList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] ResourcePolicyList warning + */ + + /** + * Constructs a new ResourcePolicyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyList. + * @implements IResourcePolicyList + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyList=} [properties] Properties to set + */ + function ResourcePolicyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyList etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + ResourcePolicyList.prototype.etag = null; + + /** + * ResourcePolicyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + ResourcePolicyList.prototype.id = null; + + /** + * ResourcePolicyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + ResourcePolicyList.prototype.items = $util.emptyArray; + + /** + * ResourcePolicyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + ResourcePolicyList.prototype.kind = null; + + /** + * ResourcePolicyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + ResourcePolicyList.prototype.nextPageToken = null; + + /** + * ResourcePolicyList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + ResourcePolicyList.prototype.selfLink = null; + + /** + * ResourcePolicyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + ResourcePolicyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyList _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + Object.defineProperty(ResourcePolicyList.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + Object.defineProperty(ResourcePolicyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + Object.defineProperty(ResourcePolicyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + Object.defineProperty(ResourcePolicyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + Object.defineProperty(ResourcePolicyList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + */ + Object.defineProperty(ResourcePolicyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {google.cloud.compute.v1.IResourcePolicyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyList} ResourcePolicyList instance + */ + ResourcePolicyList.create = function create(properties) { + return new ResourcePolicyList(properties); + }; + + /** + * Encodes the specified ResourcePolicyList message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {google.cloud.compute.v1.IResourcePolicyList} message ResourcePolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.ResourcePolicy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {google.cloud.compute.v1.IResourcePolicyList} message ResourcePolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyList} ResourcePolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3123477: + message.etag = reader.string(); + break; + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.ResourcePolicy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyList} ResourcePolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyList message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.ResourcePolicy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePolicyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyList} ResourcePolicyList + */ + ResourcePolicyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyList) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyList(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.ResourcePolicyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.ResourcePolicy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @static + * @param {google.cloud.compute.v1.ResourcePolicyList} message ResourcePolicyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.ResourcePolicy.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ResourcePolicyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyList + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyList; + })(); + + v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus = (function() { + + /** + * Properties of a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @property {string|null} [lastRunStartTime] ResourcePolicyResourceStatusInstanceSchedulePolicyStatus lastRunStartTime + * @property {string|null} [nextRunStartTime] ResourcePolicyResourceStatusInstanceSchedulePolicyStatus nextRunStartTime + */ + + /** + * Constructs a new ResourcePolicyResourceStatusInstanceSchedulePolicyStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus. + * @implements IResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus=} [properties] Properties to set + */ + function ResourcePolicyResourceStatusInstanceSchedulePolicyStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyResourceStatusInstanceSchedulePolicyStatus lastRunStartTime. + * @member {string|null|undefined} lastRunStartTime + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @instance + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.prototype.lastRunStartTime = null; + + /** + * ResourcePolicyResourceStatusInstanceSchedulePolicyStatus nextRunStartTime. + * @member {string|null|undefined} nextRunStartTime + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @instance + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.prototype.nextRunStartTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyResourceStatusInstanceSchedulePolicyStatus _lastRunStartTime. + * @member {"lastRunStartTime"|undefined} _lastRunStartTime + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @instance + */ + Object.defineProperty(ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.prototype, "_lastRunStartTime", { + get: $util.oneOfGetter($oneOfFields = ["lastRunStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyResourceStatusInstanceSchedulePolicyStatus _nextRunStartTime. + * @member {"nextRunStartTime"|undefined} _nextRunStartTime + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @instance + */ + Object.defineProperty(ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.prototype, "_nextRunStartTime", { + get: $util.oneOfGetter($oneOfFields = ["nextRunStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus} ResourcePolicyResourceStatusInstanceSchedulePolicyStatus instance + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.create = function create(properties) { + return new ResourcePolicyResourceStatusInstanceSchedulePolicyStatus(properties); + }; + + /** + * Encodes the specified ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus} message ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastRunStartTime != null && Object.hasOwnProperty.call(message, "lastRunStartTime")) + writer.uint32(/* id 303069063, wireType 2 =*/2424552506).string(message.lastRunStartTime); + if (message.nextRunStartTime != null && Object.hasOwnProperty.call(message, "nextRunStartTime")) + writer.uint32(/* id 318642570, wireType 2 =*/2549140562).string(message.nextRunStartTime); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {google.cloud.compute.v1.IResourcePolicyResourceStatusInstanceSchedulePolicyStatus} message ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus} ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 303069063: + message.lastRunStartTime = reader.string(); + break; + case 318642570: + message.nextRunStartTime = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus} ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lastRunStartTime != null && message.hasOwnProperty("lastRunStartTime")) { + properties._lastRunStartTime = 1; + if (!$util.isString(message.lastRunStartTime)) + return "lastRunStartTime: string expected"; + } + if (message.nextRunStartTime != null && message.hasOwnProperty("nextRunStartTime")) { + properties._nextRunStartTime = 1; + if (!$util.isString(message.nextRunStartTime)) + return "nextRunStartTime: string expected"; + } + return null; + }; + + /** + * Creates a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus} ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus(); + if (object.lastRunStartTime != null) + message.lastRunStartTime = String(object.lastRunStartTime); + if (object.nextRunStartTime != null) + message.nextRunStartTime = String(object.nextRunStartTime); + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyResourceStatusInstanceSchedulePolicyStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @static + * @param {google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus} message ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.lastRunStartTime != null && message.hasOwnProperty("lastRunStartTime")) { + object.lastRunStartTime = message.lastRunStartTime; + if (options.oneofs) + object._lastRunStartTime = "lastRunStartTime"; + } + if (message.nextRunStartTime != null && message.hasOwnProperty("nextRunStartTime")) { + object.nextRunStartTime = message.nextRunStartTime; + if (options.oneofs) + object._nextRunStartTime = "nextRunStartTime"; + } + return object; + }; + + /** + * Converts this ResourcePolicyResourceStatusInstanceSchedulePolicyStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyResourceStatusInstanceSchedulePolicyStatus + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyResourceStatusInstanceSchedulePolicyStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyResourceStatusInstanceSchedulePolicyStatus; + })(); + + v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy = (function() { + + /** + * Properties of a ResourcePolicySnapshotSchedulePolicyRetentionPolicy. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @property {number|null} [maxRetentionDays] ResourcePolicySnapshotSchedulePolicyRetentionPolicy maxRetentionDays + * @property {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete|null} [onSourceDiskDelete] ResourcePolicySnapshotSchedulePolicyRetentionPolicy onSourceDiskDelete + */ + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicyRetentionPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicySnapshotSchedulePolicyRetentionPolicy. + * @implements IResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy=} [properties] Properties to set + */ + function ResourcePolicySnapshotSchedulePolicyRetentionPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicySnapshotSchedulePolicyRetentionPolicy maxRetentionDays. + * @member {number|null|undefined} maxRetentionDays + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @instance + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.prototype.maxRetentionDays = null; + + /** + * ResourcePolicySnapshotSchedulePolicyRetentionPolicy onSourceDiskDelete. + * @member {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete|null|undefined} onSourceDiskDelete + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @instance + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.prototype.onSourceDiskDelete = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicySnapshotSchedulePolicyRetentionPolicy _maxRetentionDays. + * @member {"maxRetentionDays"|undefined} _maxRetentionDays + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicyRetentionPolicy.prototype, "_maxRetentionDays", { + get: $util.oneOfGetter($oneOfFields = ["maxRetentionDays"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicySnapshotSchedulePolicyRetentionPolicy _onSourceDiskDelete. + * @member {"onSourceDiskDelete"|undefined} _onSourceDiskDelete + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicyRetentionPolicy.prototype, "_onSourceDiskDelete", { + get: $util.oneOfGetter($oneOfFields = ["onSourceDiskDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicyRetentionPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy} ResourcePolicySnapshotSchedulePolicyRetentionPolicy instance + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.create = function create(properties) { + return new ResourcePolicySnapshotSchedulePolicyRetentionPolicy(properties); + }; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicyRetentionPolicy message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy} message ResourcePolicySnapshotSchedulePolicyRetentionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onSourceDiskDelete != null && Object.hasOwnProperty.call(message, "onSourceDiskDelete")) + writer.uint32(/* id 321955529, wireType 0 =*/2575644232).int32(message.onSourceDiskDelete); + if (message.maxRetentionDays != null && Object.hasOwnProperty.call(message, "maxRetentionDays")) + writer.uint32(/* id 324296979, wireType 0 =*/2594375832).int32(message.maxRetentionDays); + return writer; + }; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicyRetentionPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicyRetentionPolicy} message ResourcePolicySnapshotSchedulePolicyRetentionPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy} ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 324296979: + message.maxRetentionDays = reader.int32(); + break; + case 321955529: + message.onSourceDiskDelete = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy} ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.maxRetentionDays != null && message.hasOwnProperty("maxRetentionDays")) { + properties._maxRetentionDays = 1; + if (!$util.isInteger(message.maxRetentionDays)) + return "maxRetentionDays: integer expected"; + } + if (message.onSourceDiskDelete != null && message.hasOwnProperty("onSourceDiskDelete")) { + properties._onSourceDiskDelete = 1; + switch (message.onSourceDiskDelete) { + default: + return "onSourceDiskDelete: enum value expected"; + case 0: + case 535071332: + case 258925689: + case 239140769: + break; + } + } + return null; + }; + + /** + * Creates a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy} ResourcePolicySnapshotSchedulePolicyRetentionPolicy + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy(); + if (object.maxRetentionDays != null) + message.maxRetentionDays = object.maxRetentionDays | 0; + switch (object.onSourceDiskDelete) { + case "UNDEFINED_ON_SOURCE_DISK_DELETE": + case 0: + message.onSourceDiskDelete = 0; + break; + case "APPLY_RETENTION_POLICY": + case 535071332: + message.onSourceDiskDelete = 535071332; + break; + case "KEEP_AUTO_SNAPSHOTS": + case 258925689: + message.onSourceDiskDelete = 258925689; + break; + case "UNSPECIFIED_ON_SOURCE_DISK_DELETE": + case 239140769: + message.onSourceDiskDelete = 239140769; + break; + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicyRetentionPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @static + * @param {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy} message ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.onSourceDiskDelete != null && message.hasOwnProperty("onSourceDiskDelete")) { + object.onSourceDiskDelete = options.enums === String ? $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete[message.onSourceDiskDelete] : message.onSourceDiskDelete; + if (options.oneofs) + object._onSourceDiskDelete = "onSourceDiskDelete"; + } + if (message.maxRetentionDays != null && message.hasOwnProperty("maxRetentionDays")) { + object.maxRetentionDays = message.maxRetentionDays; + if (options.oneofs) + object._maxRetentionDays = "maxRetentionDays"; + } + return object; + }; + + /** + * Converts this ResourcePolicySnapshotSchedulePolicyRetentionPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OnSourceDiskDelete enum. + * @name google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete + * @enum {number} + * @property {number} UNDEFINED_ON_SOURCE_DISK_DELETE=0 UNDEFINED_ON_SOURCE_DISK_DELETE value + * @property {number} APPLY_RETENTION_POLICY=535071332 APPLY_RETENTION_POLICY value + * @property {number} KEEP_AUTO_SNAPSHOTS=258925689 KEEP_AUTO_SNAPSHOTS value + * @property {number} UNSPECIFIED_ON_SOURCE_DISK_DELETE=239140769 UNSPECIFIED_ON_SOURCE_DISK_DELETE value + */ + ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ON_SOURCE_DISK_DELETE"] = 0; + values[valuesById[535071332] = "APPLY_RETENTION_POLICY"] = 535071332; + values[valuesById[258925689] = "KEEP_AUTO_SNAPSHOTS"] = 258925689; + values[valuesById[239140769] = "UNSPECIFIED_ON_SOURCE_DISK_DELETE"] = 239140769; + return values; + })(); + + return ResourcePolicySnapshotSchedulePolicyRetentionPolicy; + })(); + + v1.ResourcePolicySnapshotSchedulePolicySchedule = (function() { + + /** + * Properties of a ResourcePolicySnapshotSchedulePolicySchedule. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicySnapshotSchedulePolicySchedule + * @property {google.cloud.compute.v1.IResourcePolicyDailyCycle|null} [dailySchedule] ResourcePolicySnapshotSchedulePolicySchedule dailySchedule + * @property {google.cloud.compute.v1.IResourcePolicyHourlyCycle|null} [hourlySchedule] ResourcePolicySnapshotSchedulePolicySchedule hourlySchedule + * @property {google.cloud.compute.v1.IResourcePolicyWeeklyCycle|null} [weeklySchedule] ResourcePolicySnapshotSchedulePolicySchedule weeklySchedule + */ + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicySchedule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicySnapshotSchedulePolicySchedule. + * @implements IResourcePolicySnapshotSchedulePolicySchedule + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule=} [properties] Properties to set + */ + function ResourcePolicySnapshotSchedulePolicySchedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicySnapshotSchedulePolicySchedule dailySchedule. + * @member {google.cloud.compute.v1.IResourcePolicyDailyCycle|null|undefined} dailySchedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @instance + */ + ResourcePolicySnapshotSchedulePolicySchedule.prototype.dailySchedule = null; + + /** + * ResourcePolicySnapshotSchedulePolicySchedule hourlySchedule. + * @member {google.cloud.compute.v1.IResourcePolicyHourlyCycle|null|undefined} hourlySchedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @instance + */ + ResourcePolicySnapshotSchedulePolicySchedule.prototype.hourlySchedule = null; + + /** + * ResourcePolicySnapshotSchedulePolicySchedule weeklySchedule. + * @member {google.cloud.compute.v1.IResourcePolicyWeeklyCycle|null|undefined} weeklySchedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @instance + */ + ResourcePolicySnapshotSchedulePolicySchedule.prototype.weeklySchedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicySnapshotSchedulePolicySchedule _dailySchedule. + * @member {"dailySchedule"|undefined} _dailySchedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicySchedule.prototype, "_dailySchedule", { + get: $util.oneOfGetter($oneOfFields = ["dailySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicySnapshotSchedulePolicySchedule _hourlySchedule. + * @member {"hourlySchedule"|undefined} _hourlySchedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicySchedule.prototype, "_hourlySchedule", { + get: $util.oneOfGetter($oneOfFields = ["hourlySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicySnapshotSchedulePolicySchedule _weeklySchedule. + * @member {"weeklySchedule"|undefined} _weeklySchedule + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicySchedule.prototype, "_weeklySchedule", { + get: $util.oneOfGetter($oneOfFields = ["weeklySchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicySchedule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule} ResourcePolicySnapshotSchedulePolicySchedule instance + */ + ResourcePolicySnapshotSchedulePolicySchedule.create = function create(properties) { + return new ResourcePolicySnapshotSchedulePolicySchedule(properties); + }; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicySchedule message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule} message ResourcePolicySnapshotSchedulePolicySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicySchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hourlySchedule != null && Object.hasOwnProperty.call(message, "hourlySchedule")) + $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle.encode(message.hourlySchedule, writer.uint32(/* id 38328485, wireType 2 =*/306627882).fork()).ldelim(); + if (message.dailySchedule != null && Object.hasOwnProperty.call(message, "dailySchedule")) + $root.google.cloud.compute.v1.ResourcePolicyDailyCycle.encode(message.dailySchedule, writer.uint32(/* id 86159869, wireType 2 =*/689278954).fork()).ldelim(); + if (message.weeklySchedule != null && Object.hasOwnProperty.call(message, "weeklySchedule")) + $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle.encode(message.weeklySchedule, writer.uint32(/* id 359548053, wireType 2 =*/2876384426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicySchedule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySchedule} message ResourcePolicySnapshotSchedulePolicySchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicySchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule} ResourcePolicySnapshotSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicySchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 86159869: + message.dailySchedule = $root.google.cloud.compute.v1.ResourcePolicyDailyCycle.decode(reader, reader.uint32()); + break; + case 38328485: + message.hourlySchedule = $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle.decode(reader, reader.uint32()); + break; + case 359548053: + message.weeklySchedule = $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule} ResourcePolicySnapshotSchedulePolicySchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicySchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicySchedule message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicySnapshotSchedulePolicySchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dailySchedule != null && message.hasOwnProperty("dailySchedule")) { + properties._dailySchedule = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyDailyCycle.verify(message.dailySchedule); + if (error) + return "dailySchedule." + error; + } + } + if (message.hourlySchedule != null && message.hasOwnProperty("hourlySchedule")) { + properties._hourlySchedule = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle.verify(message.hourlySchedule); + if (error) + return "hourlySchedule." + error; + } + } + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + properties._weeklySchedule = 1; + { + var error = $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle.verify(message.weeklySchedule); + if (error) + return "weeklySchedule." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePolicySnapshotSchedulePolicySchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule} ResourcePolicySnapshotSchedulePolicySchedule + */ + ResourcePolicySnapshotSchedulePolicySchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule(); + if (object.dailySchedule != null) { + if (typeof object.dailySchedule !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.dailySchedule: object expected"); + message.dailySchedule = $root.google.cloud.compute.v1.ResourcePolicyDailyCycle.fromObject(object.dailySchedule); + } + if (object.hourlySchedule != null) { + if (typeof object.hourlySchedule !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.hourlySchedule: object expected"); + message.hourlySchedule = $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle.fromObject(object.hourlySchedule); + } + if (object.weeklySchedule != null) { + if (typeof object.weeklySchedule !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule.weeklySchedule: object expected"); + message.weeklySchedule = $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle.fromObject(object.weeklySchedule); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicySchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @static + * @param {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule} message ResourcePolicySnapshotSchedulePolicySchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicySnapshotSchedulePolicySchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.hourlySchedule != null && message.hasOwnProperty("hourlySchedule")) { + object.hourlySchedule = $root.google.cloud.compute.v1.ResourcePolicyHourlyCycle.toObject(message.hourlySchedule, options); + if (options.oneofs) + object._hourlySchedule = "hourlySchedule"; + } + if (message.dailySchedule != null && message.hasOwnProperty("dailySchedule")) { + object.dailySchedule = $root.google.cloud.compute.v1.ResourcePolicyDailyCycle.toObject(message.dailySchedule, options); + if (options.oneofs) + object._dailySchedule = "dailySchedule"; + } + if (message.weeklySchedule != null && message.hasOwnProperty("weeklySchedule")) { + object.weeklySchedule = $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle.toObject(message.weeklySchedule, options); + if (options.oneofs) + object._weeklySchedule = "weeklySchedule"; + } + return object; + }; + + /** + * Converts this ResourcePolicySnapshotSchedulePolicySchedule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySchedule + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicySnapshotSchedulePolicySchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicySnapshotSchedulePolicySchedule; + })(); + + v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties = (function() { + + /** + * Properties of a ResourcePolicySnapshotSchedulePolicySnapshotProperties. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicySnapshotSchedulePolicySnapshotProperties + * @property {string|null} [chainName] ResourcePolicySnapshotSchedulePolicySnapshotProperties chainName + * @property {boolean|null} [guestFlush] ResourcePolicySnapshotSchedulePolicySnapshotProperties guestFlush + * @property {Object.|null} [labels] ResourcePolicySnapshotSchedulePolicySnapshotProperties labels + * @property {Array.|null} [storageLocations] ResourcePolicySnapshotSchedulePolicySnapshotProperties storageLocations + */ + + /** + * Constructs a new ResourcePolicySnapshotSchedulePolicySnapshotProperties. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicySnapshotSchedulePolicySnapshotProperties. + * @implements IResourcePolicySnapshotSchedulePolicySnapshotProperties + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties=} [properties] Properties to set + */ + function ResourcePolicySnapshotSchedulePolicySnapshotProperties(properties) { + this.labels = {}; + this.storageLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicySnapshotSchedulePolicySnapshotProperties chainName. + * @member {string|null|undefined} chainName + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @instance + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.prototype.chainName = null; + + /** + * ResourcePolicySnapshotSchedulePolicySnapshotProperties guestFlush. + * @member {boolean|null|undefined} guestFlush + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @instance + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.prototype.guestFlush = null; + + /** + * ResourcePolicySnapshotSchedulePolicySnapshotProperties labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @instance + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.prototype.labels = $util.emptyObject; + + /** + * ResourcePolicySnapshotSchedulePolicySnapshotProperties storageLocations. + * @member {Array.} storageLocations + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @instance + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.prototype.storageLocations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicySnapshotSchedulePolicySnapshotProperties _chainName. + * @member {"chainName"|undefined} _chainName + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicySnapshotProperties.prototype, "_chainName", { + get: $util.oneOfGetter($oneOfFields = ["chainName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicySnapshotSchedulePolicySnapshotProperties _guestFlush. + * @member {"guestFlush"|undefined} _guestFlush + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @instance + */ + Object.defineProperty(ResourcePolicySnapshotSchedulePolicySnapshotProperties.prototype, "_guestFlush", { + get: $util.oneOfGetter($oneOfFields = ["guestFlush"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicySnapshotSchedulePolicySnapshotProperties instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties} ResourcePolicySnapshotSchedulePolicySnapshotProperties instance + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.create = function create(properties) { + return new ResourcePolicySnapshotSchedulePolicySnapshotProperties(properties); + }; + + /** + * Encodes the specified ResourcePolicySnapshotSchedulePolicySnapshotProperties message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties} message ResourcePolicySnapshotSchedulePolicySnapshotProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chainName != null && Object.hasOwnProperty.call(message, "chainName")) + writer.uint32(/* id 68644169, wireType 2 =*/549153354).string(message.chainName); + if (message.storageLocations != null && message.storageLocations.length) + for (var i = 0; i < message.storageLocations.length; ++i) + writer.uint32(/* id 328005274, wireType 2 =*/2624042194).string(message.storageLocations[i]); + if (message.guestFlush != null && Object.hasOwnProperty.call(message, "guestFlush")) + writer.uint32(/* id 385550813, wireType 0 =*/3084406504).bool(message.guestFlush); + 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 500195327, wireType 2 =*/4001562618).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 ResourcePolicySnapshotSchedulePolicySnapshotProperties message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {google.cloud.compute.v1.IResourcePolicySnapshotSchedulePolicySnapshotProperties} message ResourcePolicySnapshotSchedulePolicySnapshotProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySnapshotProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties} ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 68644169: + message.chainName = reader.string(); + break; + case 385550813: + message.guestFlush = reader.bool(); + break; + case 500195327: + 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 328005274: + if (!(message.storageLocations && message.storageLocations.length)) + message.storageLocations = []; + message.storageLocations.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicySnapshotSchedulePolicySnapshotProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties} ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicySnapshotSchedulePolicySnapshotProperties message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.chainName != null && message.hasOwnProperty("chainName")) { + properties._chainName = 1; + if (!$util.isString(message.chainName)) + return "chainName: string expected"; + } + if (message.guestFlush != null && message.hasOwnProperty("guestFlush")) { + properties._guestFlush = 1; + if (typeof message.guestFlush !== "boolean") + return "guestFlush: boolean 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.storageLocations != null && message.hasOwnProperty("storageLocations")) { + if (!Array.isArray(message.storageLocations)) + return "storageLocations: array expected"; + for (var i = 0; i < message.storageLocations.length; ++i) + if (!$util.isString(message.storageLocations[i])) + return "storageLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a ResourcePolicySnapshotSchedulePolicySnapshotProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties} ResourcePolicySnapshotSchedulePolicySnapshotProperties + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties(); + if (object.chainName != null) + message.chainName = String(object.chainName); + if (object.guestFlush != null) + message.guestFlush = Boolean(object.guestFlush); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.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.storageLocations) { + if (!Array.isArray(object.storageLocations)) + throw TypeError(".google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties.storageLocations: array expected"); + message.storageLocations = []; + for (var i = 0; i < object.storageLocations.length; ++i) + message.storageLocations[i] = String(object.storageLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicySnapshotSchedulePolicySnapshotProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @static + * @param {google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties} message ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.storageLocations = []; + if (options.objects || options.defaults) + object.labels = {}; + if (message.chainName != null && message.hasOwnProperty("chainName")) { + object.chainName = message.chainName; + if (options.oneofs) + object._chainName = "chainName"; + } + if (message.storageLocations && message.storageLocations.length) { + object.storageLocations = []; + for (var j = 0; j < message.storageLocations.length; ++j) + object.storageLocations[j] = message.storageLocations[j]; + } + if (message.guestFlush != null && message.hasOwnProperty("guestFlush")) { + object.guestFlush = message.guestFlush; + if (options.oneofs) + object._guestFlush = "guestFlush"; + } + 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 ResourcePolicySnapshotSchedulePolicySnapshotProperties to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicySnapshotProperties + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicySnapshotSchedulePolicySnapshotProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicySnapshotSchedulePolicySnapshotProperties; + })(); + + v1.ResourcePolicyWeeklyCycle = (function() { + + /** + * Properties of a ResourcePolicyWeeklyCycle. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyWeeklyCycle + * @property {Array.|null} [dayOfWeeks] ResourcePolicyWeeklyCycle dayOfWeeks + */ + + /** + * Constructs a new ResourcePolicyWeeklyCycle. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyWeeklyCycle. + * @implements IResourcePolicyWeeklyCycle + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycle=} [properties] Properties to set + */ + function ResourcePolicyWeeklyCycle(properties) { + this.dayOfWeeks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyWeeklyCycle dayOfWeeks. + * @member {Array.} dayOfWeeks + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @instance + */ + ResourcePolicyWeeklyCycle.prototype.dayOfWeeks = $util.emptyArray; + + /** + * Creates a new ResourcePolicyWeeklyCycle instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycle=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycle} ResourcePolicyWeeklyCycle instance + */ + ResourcePolicyWeeklyCycle.create = function create(properties) { + return new ResourcePolicyWeeklyCycle(properties); + }; + + /** + * Encodes the specified ResourcePolicyWeeklyCycle message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycle.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycle} message ResourcePolicyWeeklyCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyWeeklyCycle.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dayOfWeeks != null && message.dayOfWeeks.length) + for (var i = 0; i < message.dayOfWeeks.length; ++i) + $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.encode(message.dayOfWeeks[i], writer.uint32(/* id 257871834, wireType 2 =*/2062974674).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyWeeklyCycle message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycle.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycle} message ResourcePolicyWeeklyCycle message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyWeeklyCycle.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyWeeklyCycle message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycle} ResourcePolicyWeeklyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyWeeklyCycle.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 257871834: + if (!(message.dayOfWeeks && message.dayOfWeeks.length)) + message.dayOfWeeks = []; + message.dayOfWeeks.push($root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyWeeklyCycle message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycle} ResourcePolicyWeeklyCycle + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyWeeklyCycle.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyWeeklyCycle message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyWeeklyCycle.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dayOfWeeks != null && message.hasOwnProperty("dayOfWeeks")) { + if (!Array.isArray(message.dayOfWeeks)) + return "dayOfWeeks: array expected"; + for (var i = 0; i < message.dayOfWeeks.length; ++i) { + var error = $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.verify(message.dayOfWeeks[i]); + if (error) + return "dayOfWeeks." + error; + } + } + return null; + }; + + /** + * Creates a ResourcePolicyWeeklyCycle message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycle} ResourcePolicyWeeklyCycle + */ + ResourcePolicyWeeklyCycle.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycle(); + if (object.dayOfWeeks) { + if (!Array.isArray(object.dayOfWeeks)) + throw TypeError(".google.cloud.compute.v1.ResourcePolicyWeeklyCycle.dayOfWeeks: array expected"); + message.dayOfWeeks = []; + for (var i = 0; i < object.dayOfWeeks.length; ++i) { + if (typeof object.dayOfWeeks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ResourcePolicyWeeklyCycle.dayOfWeeks: object expected"); + message.dayOfWeeks[i] = $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.fromObject(object.dayOfWeeks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyWeeklyCycle message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @static + * @param {google.cloud.compute.v1.ResourcePolicyWeeklyCycle} message ResourcePolicyWeeklyCycle + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyWeeklyCycle.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dayOfWeeks = []; + if (message.dayOfWeeks && message.dayOfWeeks.length) { + object.dayOfWeeks = []; + for (var j = 0; j < message.dayOfWeeks.length; ++j) + object.dayOfWeeks[j] = $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.toObject(message.dayOfWeeks[j], options); + } + return object; + }; + + /** + * Converts this ResourcePolicyWeeklyCycle to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycle + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyWeeklyCycle.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResourcePolicyWeeklyCycle; + })(); + + v1.ResourcePolicyWeeklyCycleDayOfWeek = (function() { + + /** + * Properties of a ResourcePolicyWeeklyCycleDayOfWeek. + * @memberof google.cloud.compute.v1 + * @interface IResourcePolicyWeeklyCycleDayOfWeek + * @property {google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day|null} [day] ResourcePolicyWeeklyCycleDayOfWeek day + * @property {string|null} [duration] ResourcePolicyWeeklyCycleDayOfWeek duration + * @property {string|null} [startTime] ResourcePolicyWeeklyCycleDayOfWeek startTime + */ + + /** + * Constructs a new ResourcePolicyWeeklyCycleDayOfWeek. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicyWeeklyCycleDayOfWeek. + * @implements IResourcePolicyWeeklyCycleDayOfWeek + * @constructor + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek=} [properties] Properties to set + */ + function ResourcePolicyWeeklyCycleDayOfWeek(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcePolicyWeeklyCycleDayOfWeek day. + * @member {google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day|null|undefined} day + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @instance + */ + ResourcePolicyWeeklyCycleDayOfWeek.prototype.day = null; + + /** + * ResourcePolicyWeeklyCycleDayOfWeek duration. + * @member {string|null|undefined} duration + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @instance + */ + ResourcePolicyWeeklyCycleDayOfWeek.prototype.duration = null; + + /** + * ResourcePolicyWeeklyCycleDayOfWeek startTime. + * @member {string|null|undefined} startTime + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @instance + */ + ResourcePolicyWeeklyCycleDayOfWeek.prototype.startTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResourcePolicyWeeklyCycleDayOfWeek _day. + * @member {"day"|undefined} _day + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @instance + */ + Object.defineProperty(ResourcePolicyWeeklyCycleDayOfWeek.prototype, "_day", { + get: $util.oneOfGetter($oneOfFields = ["day"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyWeeklyCycleDayOfWeek _duration. + * @member {"duration"|undefined} _duration + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @instance + */ + Object.defineProperty(ResourcePolicyWeeklyCycleDayOfWeek.prototype, "_duration", { + get: $util.oneOfGetter($oneOfFields = ["duration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ResourcePolicyWeeklyCycleDayOfWeek _startTime. + * @member {"startTime"|undefined} _startTime + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @instance + */ + Object.defineProperty(ResourcePolicyWeeklyCycleDayOfWeek.prototype, "_startTime", { + get: $util.oneOfGetter($oneOfFields = ["startTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResourcePolicyWeeklyCycleDayOfWeek instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek} ResourcePolicyWeeklyCycleDayOfWeek instance + */ + ResourcePolicyWeeklyCycleDayOfWeek.create = function create(properties) { + return new ResourcePolicyWeeklyCycleDayOfWeek(properties); + }; + + /** + * Encodes the specified ResourcePolicyWeeklyCycleDayOfWeek message. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek} message ResourcePolicyWeeklyCycleDayOfWeek message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyWeeklyCycleDayOfWeek.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 99228, wireType 0 =*/793824).int32(message.day); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + writer.uint32(/* id 37467274, wireType 2 =*/299738194).string(message.startTime); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + writer.uint32(/* id 155471252, wireType 2 =*/1243770018).string(message.duration); + return writer; + }; + + /** + * Encodes the specified ResourcePolicyWeeklyCycleDayOfWeek message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {google.cloud.compute.v1.IResourcePolicyWeeklyCycleDayOfWeek} message ResourcePolicyWeeklyCycleDayOfWeek message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcePolicyWeeklyCycleDayOfWeek.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcePolicyWeeklyCycleDayOfWeek message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek} ResourcePolicyWeeklyCycleDayOfWeek + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyWeeklyCycleDayOfWeek.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 99228: + message.day = reader.int32(); + break; + case 155471252: + message.duration = reader.string(); + break; + case 37467274: + message.startTime = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcePolicyWeeklyCycleDayOfWeek message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek} ResourcePolicyWeeklyCycleDayOfWeek + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcePolicyWeeklyCycleDayOfWeek.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcePolicyWeeklyCycleDayOfWeek message. + * @function verify + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcePolicyWeeklyCycleDayOfWeek.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.day != null && message.hasOwnProperty("day")) { + properties._day = 1; + switch (message.day) { + default: + return "day: enum value expected"; + case 0: + case 471398751: + case 530283991: + case 132310288: + case 279037881: + case 309626320: + case 207198682: + case 277509677: + case 422029110: + break; + } + } + if (message.duration != null && message.hasOwnProperty("duration")) { + properties._duration = 1; + if (!$util.isString(message.duration)) + return "duration: string expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + properties._startTime = 1; + if (!$util.isString(message.startTime)) + return "startTime: string expected"; + } + return null; + }; + + /** + * Creates a ResourcePolicyWeeklyCycleDayOfWeek message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek} ResourcePolicyWeeklyCycleDayOfWeek + */ + ResourcePolicyWeeklyCycleDayOfWeek.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek) + return object; + var message = new $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek(); + switch (object.day) { + case "UNDEFINED_DAY": + case 0: + message.day = 0; + break; + case "FRIDAY": + case 471398751: + message.day = 471398751; + break; + case "INVALID": + case 530283991: + message.day = 530283991; + break; + case "MONDAY": + case 132310288: + message.day = 132310288; + break; + case "SATURDAY": + case 279037881: + message.day = 279037881; + break; + case "SUNDAY": + case 309626320: + message.day = 309626320; + break; + case "THURSDAY": + case 207198682: + message.day = 207198682; + break; + case "TUESDAY": + case 277509677: + message.day = 277509677; + break; + case "WEDNESDAY": + case 422029110: + message.day = 422029110; + break; + } + if (object.duration != null) + message.duration = String(object.duration); + if (object.startTime != null) + message.startTime = String(object.startTime); + return message; + }; + + /** + * Creates a plain object from a ResourcePolicyWeeklyCycleDayOfWeek message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @static + * @param {google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek} message ResourcePolicyWeeklyCycleDayOfWeek + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcePolicyWeeklyCycleDayOfWeek.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.day != null && message.hasOwnProperty("day")) { + object.day = options.enums === String ? $root.google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day[message.day] : message.day; + if (options.oneofs) + object._day = "day"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + object.startTime = message.startTime; + if (options.oneofs) + object._startTime = "startTime"; + } + if (message.duration != null && message.hasOwnProperty("duration")) { + object.duration = message.duration; + if (options.oneofs) + object._duration = "duration"; + } + return object; + }; + + /** + * Converts this ResourcePolicyWeeklyCycleDayOfWeek to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek + * @instance + * @returns {Object.} JSON object + */ + ResourcePolicyWeeklyCycleDayOfWeek.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Day enum. + * @name google.cloud.compute.v1.ResourcePolicyWeeklyCycleDayOfWeek.Day + * @enum {number} + * @property {number} UNDEFINED_DAY=0 UNDEFINED_DAY value + * @property {number} FRIDAY=471398751 FRIDAY value + * @property {number} INVALID=530283991 INVALID value + * @property {number} MONDAY=132310288 MONDAY value + * @property {number} SATURDAY=279037881 SATURDAY value + * @property {number} SUNDAY=309626320 SUNDAY value + * @property {number} THURSDAY=207198682 THURSDAY value + * @property {number} TUESDAY=277509677 TUESDAY value + * @property {number} WEDNESDAY=422029110 WEDNESDAY value + */ + ResourcePolicyWeeklyCycleDayOfWeek.Day = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_DAY"] = 0; + values[valuesById[471398751] = "FRIDAY"] = 471398751; + values[valuesById[530283991] = "INVALID"] = 530283991; + values[valuesById[132310288] = "MONDAY"] = 132310288; + values[valuesById[279037881] = "SATURDAY"] = 279037881; + values[valuesById[309626320] = "SUNDAY"] = 309626320; + values[valuesById[207198682] = "THURSDAY"] = 207198682; + values[valuesById[277509677] = "TUESDAY"] = 277509677; + values[valuesById[422029110] = "WEDNESDAY"] = 422029110; + return values; + })(); + + return ResourcePolicyWeeklyCycleDayOfWeek; + })(); + + v1.Route = (function() { + + /** + * Properties of a Route. + * @memberof google.cloud.compute.v1 + * @interface IRoute + * @property {string|null} [creationTimestamp] Route creationTimestamp + * @property {string|null} [description] Route description + * @property {string|null} [destRange] Route destRange + * @property {number|Long|null} [id] Route id + * @property {string|null} [kind] Route kind + * @property {string|null} [name] Route name + * @property {string|null} [network] Route network + * @property {string|null} [nextHopGateway] Route nextHopGateway + * @property {string|null} [nextHopIlb] Route nextHopIlb + * @property {string|null} [nextHopInstance] Route nextHopInstance + * @property {string|null} [nextHopIp] Route nextHopIp + * @property {string|null} [nextHopNetwork] Route nextHopNetwork + * @property {string|null} [nextHopPeering] Route nextHopPeering + * @property {string|null} [nextHopVpnTunnel] Route nextHopVpnTunnel + * @property {number|null} [priority] Route priority + * @property {string|null} [selfLink] Route selfLink + * @property {Array.|null} [tags] Route tags + * @property {Array.|null} [warnings] Route warnings + */ + + /** + * Constructs a new Route. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Route. + * @implements IRoute + * @constructor + * @param {google.cloud.compute.v1.IRoute=} [properties] Properties to set + */ + function Route(properties) { + this.tags = []; + 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 creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.creationTimestamp = null; + + /** + * Route description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.description = null; + + /** + * Route destRange. + * @member {string|null|undefined} destRange + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.destRange = null; + + /** + * Route id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.id = null; + + /** + * Route kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.kind = null; + + /** + * Route name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.name = null; + + /** + * Route network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.network = null; + + /** + * Route nextHopGateway. + * @member {string|null|undefined} nextHopGateway + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.nextHopGateway = null; + + /** + * Route nextHopIlb. + * @member {string|null|undefined} nextHopIlb + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.nextHopIlb = null; + + /** + * Route nextHopInstance. + * @member {string|null|undefined} nextHopInstance + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.nextHopInstance = null; + + /** + * Route nextHopIp. + * @member {string|null|undefined} nextHopIp + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.nextHopIp = null; + + /** + * Route nextHopNetwork. + * @member {string|null|undefined} nextHopNetwork + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.nextHopNetwork = null; + + /** + * Route nextHopPeering. + * @member {string|null|undefined} nextHopPeering + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.nextHopPeering = null; + + /** + * Route nextHopVpnTunnel. + * @member {string|null|undefined} nextHopVpnTunnel + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.nextHopVpnTunnel = null; + + /** + * Route priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.priority = null; + + /** + * Route selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.selfLink = null; + + /** + * Route tags. + * @member {Array.} tags + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.tags = $util.emptyArray; + + /** + * Route warnings. + * @member {Array.} warnings + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Route.prototype.warnings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Route _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _destRange. + * @member {"destRange"|undefined} _destRange + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_destRange", { + get: $util.oneOfGetter($oneOfFields = ["destRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _nextHopGateway. + * @member {"nextHopGateway"|undefined} _nextHopGateway + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_nextHopGateway", { + get: $util.oneOfGetter($oneOfFields = ["nextHopGateway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _nextHopIlb. + * @member {"nextHopIlb"|undefined} _nextHopIlb + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_nextHopIlb", { + get: $util.oneOfGetter($oneOfFields = ["nextHopIlb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _nextHopInstance. + * @member {"nextHopInstance"|undefined} _nextHopInstance + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_nextHopInstance", { + get: $util.oneOfGetter($oneOfFields = ["nextHopInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _nextHopIp. + * @member {"nextHopIp"|undefined} _nextHopIp + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_nextHopIp", { + get: $util.oneOfGetter($oneOfFields = ["nextHopIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _nextHopNetwork. + * @member {"nextHopNetwork"|undefined} _nextHopNetwork + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_nextHopNetwork", { + get: $util.oneOfGetter($oneOfFields = ["nextHopNetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _nextHopPeering. + * @member {"nextHopPeering"|undefined} _nextHopPeering + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_nextHopPeering", { + get: $util.oneOfGetter($oneOfFields = ["nextHopPeering"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _nextHopVpnTunnel. + * @member {"nextHopVpnTunnel"|undefined} _nextHopVpnTunnel + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_nextHopVpnTunnel", { + get: $util.oneOfGetter($oneOfFields = ["nextHopVpnTunnel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Route _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Route + * @instance + */ + Object.defineProperty(Route.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Route instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Route + * @static + * @param {google.cloud.compute.v1.IRoute=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Route} Route instance + */ + Route.create = function create(properties) { + return new Route(properties); + }; + + /** + * Encodes the specified Route message. Does not implicitly {@link google.cloud.compute.v1.Route.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Route + * @static + * @param {google.cloud.compute.v1.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 3552281, wireType 2 =*/28418250).string(message.tags[i]); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.nextHopIp != null && Object.hasOwnProperty.call(message, "nextHopIp")) + writer.uint32(/* id 110319529, wireType 2 =*/882556234).string(message.nextHopIp); + if (message.nextHopIlb != null && Object.hasOwnProperty.call(message, "nextHopIlb")) + writer.uint32(/* id 198679901, wireType 2 =*/1589439210).string(message.nextHopIlb); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.nextHopNetwork != null && Object.hasOwnProperty.call(message, "nextHopNetwork")) + writer.uint32(/* id 262295788, wireType 2 =*/2098366306).string(message.nextHopNetwork); + if (message.nextHopGateway != null && Object.hasOwnProperty.call(message, "nextHopGateway")) + writer.uint32(/* id 377175298, wireType 2 =*/3017402386).string(message.nextHopGateway); + if (message.destRange != null && Object.hasOwnProperty.call(message, "destRange")) + writer.uint32(/* id 381327712, wireType 2 =*/3050621698).string(message.destRange); + if (message.nextHopInstance != null && Object.hasOwnProperty.call(message, "nextHopInstance")) + writer.uint32(/* id 393508247, wireType 2 =*/3148065978).string(message.nextHopInstance); + if (message.nextHopPeering != null && Object.hasOwnProperty.call(message, "nextHopPeering")) + writer.uint32(/* id 412682750, wireType 2 =*/3301462002).string(message.nextHopPeering); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).uint32(message.priority); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.cloud.compute.v1.Warnings.encode(message.warnings[i], writer.uint32(/* id 498091095, wireType 2 =*/3984728762).fork()).ldelim(); + if (message.nextHopVpnTunnel != null && Object.hasOwnProperty.call(message, "nextHopVpnTunnel")) + writer.uint32(/* id 519844501, wireType 2 =*/4158756010).string(message.nextHopVpnTunnel); + return writer; + }; + + /** + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Route.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Route + * @static + * @param {google.cloud.compute.v1.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.cloud.compute.v1.Route + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.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.cloud.compute.v1.Route(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 381327712: + message.destRange = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 377175298: + message.nextHopGateway = reader.string(); + break; + case 198679901: + message.nextHopIlb = reader.string(); + break; + case 393508247: + message.nextHopInstance = reader.string(); + break; + case 110319529: + message.nextHopIp = reader.string(); + break; + case 262295788: + message.nextHopNetwork = reader.string(); + break; + case 412682750: + message.nextHopPeering = reader.string(); + break; + case 519844501: + message.nextHopVpnTunnel = reader.string(); + break; + case 445151652: + message.priority = reader.uint32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3552281: + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + case 498091095: + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.compute.v1.Warnings.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.cloud.compute.v1.Route + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.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.cloud.compute.v1.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"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.destRange != null && message.hasOwnProperty("destRange")) { + properties._destRange = 1; + if (!$util.isString(message.destRange)) + return "destRange: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.nextHopGateway != null && message.hasOwnProperty("nextHopGateway")) { + properties._nextHopGateway = 1; + if (!$util.isString(message.nextHopGateway)) + return "nextHopGateway: string expected"; + } + if (message.nextHopIlb != null && message.hasOwnProperty("nextHopIlb")) { + properties._nextHopIlb = 1; + if (!$util.isString(message.nextHopIlb)) + return "nextHopIlb: string expected"; + } + if (message.nextHopInstance != null && message.hasOwnProperty("nextHopInstance")) { + properties._nextHopInstance = 1; + if (!$util.isString(message.nextHopInstance)) + return "nextHopInstance: string expected"; + } + if (message.nextHopIp != null && message.hasOwnProperty("nextHopIp")) { + properties._nextHopIp = 1; + if (!$util.isString(message.nextHopIp)) + return "nextHopIp: string expected"; + } + if (message.nextHopNetwork != null && message.hasOwnProperty("nextHopNetwork")) { + properties._nextHopNetwork = 1; + if (!$util.isString(message.nextHopNetwork)) + return "nextHopNetwork: string expected"; + } + if (message.nextHopPeering != null && message.hasOwnProperty("nextHopPeering")) { + properties._nextHopPeering = 1; + if (!$util.isString(message.nextHopPeering)) + return "nextHopPeering: string expected"; + } + if (message.nextHopVpnTunnel != null && message.hasOwnProperty("nextHopVpnTunnel")) { + properties._nextHopVpnTunnel = 1; + if (!$util.isString(message.nextHopVpnTunnel)) + return "nextHopVpnTunnel: string expected"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: 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) { + var error = $root.google.cloud.compute.v1.Warnings.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + return null; + }; + + /** + * Creates a Route message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Route + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Route} Route + */ + Route.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Route) + return object; + var message = new $root.google.cloud.compute.v1.Route(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.destRange != null) + message.destRange = String(object.destRange); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.nextHopGateway != null) + message.nextHopGateway = String(object.nextHopGateway); + if (object.nextHopIlb != null) + message.nextHopIlb = String(object.nextHopIlb); + if (object.nextHopInstance != null) + message.nextHopInstance = String(object.nextHopInstance); + if (object.nextHopIp != null) + message.nextHopIp = String(object.nextHopIp); + if (object.nextHopNetwork != null) + message.nextHopNetwork = String(object.nextHopNetwork); + if (object.nextHopPeering != null) + message.nextHopPeering = String(object.nextHopPeering); + if (object.nextHopVpnTunnel != null) + message.nextHopVpnTunnel = String(object.nextHopVpnTunnel); + if (object.priority != null) + message.priority = object.priority >>> 0; + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.compute.v1.Route.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.compute.v1.Route.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Route.warnings: object expected"); + message.warnings[i] = $root.google.cloud.compute.v1.Warnings.fromObject(object.warnings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Route message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Route + * @static + * @param {google.cloud.compute.v1.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.tags = []; + object.warnings = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.nextHopIp != null && message.hasOwnProperty("nextHopIp")) { + object.nextHopIp = message.nextHopIp; + if (options.oneofs) + object._nextHopIp = "nextHopIp"; + } + if (message.nextHopIlb != null && message.hasOwnProperty("nextHopIlb")) { + object.nextHopIlb = message.nextHopIlb; + if (options.oneofs) + object._nextHopIlb = "nextHopIlb"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.nextHopNetwork != null && message.hasOwnProperty("nextHopNetwork")) { + object.nextHopNetwork = message.nextHopNetwork; + if (options.oneofs) + object._nextHopNetwork = "nextHopNetwork"; + } + if (message.nextHopGateway != null && message.hasOwnProperty("nextHopGateway")) { + object.nextHopGateway = message.nextHopGateway; + if (options.oneofs) + object._nextHopGateway = "nextHopGateway"; + } + if (message.destRange != null && message.hasOwnProperty("destRange")) { + object.destRange = message.destRange; + if (options.oneofs) + object._destRange = "destRange"; + } + if (message.nextHopInstance != null && message.hasOwnProperty("nextHopInstance")) { + object.nextHopInstance = message.nextHopInstance; + if (options.oneofs) + object._nextHopInstance = "nextHopInstance"; + } + if (message.nextHopPeering != null && message.hasOwnProperty("nextHopPeering")) { + object.nextHopPeering = message.nextHopPeering; + if (options.oneofs) + object._nextHopPeering = "nextHopPeering"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.compute.v1.Warnings.toObject(message.warnings[j], options); + } + if (message.nextHopVpnTunnel != null && message.hasOwnProperty("nextHopVpnTunnel")) { + object.nextHopVpnTunnel = message.nextHopVpnTunnel; + if (options.oneofs) + object._nextHopVpnTunnel = "nextHopVpnTunnel"; + } + return object; + }; + + /** + * Converts this Route to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Route + * @instance + * @returns {Object.} JSON object + */ + Route.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Route; + })(); + + v1.RouteList = (function() { + + /** + * Properties of a RouteList. + * @memberof google.cloud.compute.v1 + * @interface IRouteList + * @property {string|null} [id] RouteList id + * @property {Array.|null} [items] RouteList items + * @property {string|null} [kind] RouteList kind + * @property {string|null} [nextPageToken] RouteList nextPageToken + * @property {string|null} [selfLink] RouteList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RouteList warning + */ + + /** + * Constructs a new RouteList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouteList. + * @implements IRouteList + * @constructor + * @param {google.cloud.compute.v1.IRouteList=} [properties] Properties to set + */ + function RouteList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + RouteList.prototype.id = null; + + /** + * RouteList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + RouteList.prototype.items = $util.emptyArray; + + /** + * RouteList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + RouteList.prototype.kind = null; + + /** + * RouteList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + RouteList.prototype.nextPageToken = null; + + /** + * RouteList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + RouteList.prototype.selfLink = null; + + /** + * RouteList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + RouteList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouteList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + Object.defineProperty(RouteList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouteList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + Object.defineProperty(RouteList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouteList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + Object.defineProperty(RouteList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouteList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + Object.defineProperty(RouteList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouteList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RouteList + * @instance + */ + Object.defineProperty(RouteList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouteList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {google.cloud.compute.v1.IRouteList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouteList} RouteList instance + */ + RouteList.create = function create(properties) { + return new RouteList(properties); + }; + + /** + * Encodes the specified RouteList message. Does not implicitly {@link google.cloud.compute.v1.RouteList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {google.cloud.compute.v1.IRouteList} message RouteList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Route.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RouteList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouteList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {google.cloud.compute.v1.IRouteList} message RouteList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouteList} RouteList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouteList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Route.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouteList} RouteList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteList message. + * @function verify + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Route.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RouteList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouteList} RouteList + */ + RouteList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouteList) + return object; + var message = new $root.google.cloud.compute.v1.RouteList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RouteList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouteList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Route.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RouteList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RouteList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouteList + * @static + * @param {google.cloud.compute.v1.RouteList} message RouteList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Route.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RouteList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouteList + * @instance + * @returns {Object.} JSON object + */ + RouteList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RouteList; + })(); + + v1.RouterBgp = (function() { + + /** + * Properties of a RouterBgp. + * @memberof google.cloud.compute.v1 + * @interface IRouterBgp + * @property {google.cloud.compute.v1.RouterBgp.AdvertiseMode|null} [advertiseMode] RouterBgp advertiseMode + * @property {Array.|null} [advertisedGroups] RouterBgp advertisedGroups + * @property {Array.|null} [advertisedIpRanges] RouterBgp advertisedIpRanges + * @property {number|null} [asn] RouterBgp asn + */ + + /** + * Constructs a new RouterBgp. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterBgp. + * @implements IRouterBgp + * @constructor + * @param {google.cloud.compute.v1.IRouterBgp=} [properties] Properties to set + */ + function RouterBgp(properties) { + this.advertisedGroups = []; + this.advertisedIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterBgp advertiseMode. + * @member {google.cloud.compute.v1.RouterBgp.AdvertiseMode|null|undefined} advertiseMode + * @memberof google.cloud.compute.v1.RouterBgp + * @instance + */ + RouterBgp.prototype.advertiseMode = null; + + /** + * RouterBgp advertisedGroups. + * @member {Array.} advertisedGroups + * @memberof google.cloud.compute.v1.RouterBgp + * @instance + */ + RouterBgp.prototype.advertisedGroups = $util.emptyArray; + + /** + * RouterBgp advertisedIpRanges. + * @member {Array.} advertisedIpRanges + * @memberof google.cloud.compute.v1.RouterBgp + * @instance + */ + RouterBgp.prototype.advertisedIpRanges = $util.emptyArray; + + /** + * RouterBgp asn. + * @member {number|null|undefined} asn + * @memberof google.cloud.compute.v1.RouterBgp + * @instance + */ + RouterBgp.prototype.asn = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterBgp _advertiseMode. + * @member {"advertiseMode"|undefined} _advertiseMode + * @memberof google.cloud.compute.v1.RouterBgp + * @instance + */ + Object.defineProperty(RouterBgp.prototype, "_advertiseMode", { + get: $util.oneOfGetter($oneOfFields = ["advertiseMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgp _asn. + * @member {"asn"|undefined} _asn + * @memberof google.cloud.compute.v1.RouterBgp + * @instance + */ + Object.defineProperty(RouterBgp.prototype, "_asn", { + get: $util.oneOfGetter($oneOfFields = ["asn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterBgp instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {google.cloud.compute.v1.IRouterBgp=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterBgp} RouterBgp instance + */ + RouterBgp.create = function create(properties) { + return new RouterBgp(properties); + }; + + /** + * Encodes the specified RouterBgp message. Does not implicitly {@link google.cloud.compute.v1.RouterBgp.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {google.cloud.compute.v1.IRouterBgp} message RouterBgp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterBgp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asn != null && Object.hasOwnProperty.call(message, "asn")) + writer.uint32(/* id 96892, wireType 0 =*/775136).uint32(message.asn); + if (message.advertisedGroups != null && message.advertisedGroups.length) { + writer.uint32(/* id 21065526, wireType 2 =*/168524210).fork(); + for (var i = 0; i < message.advertisedGroups.length; ++i) + writer.int32(message.advertisedGroups[i]); + writer.ldelim(); + } + if (message.advertisedIpRanges != null && message.advertisedIpRanges.length) + for (var i = 0; i < message.advertisedIpRanges.length; ++i) + $root.google.cloud.compute.v1.RouterAdvertisedIpRange.encode(message.advertisedIpRanges[i], writer.uint32(/* id 35449932, wireType 2 =*/283599458).fork()).ldelim(); + if (message.advertiseMode != null && Object.hasOwnProperty.call(message, "advertiseMode")) + writer.uint32(/* id 312134331, wireType 0 =*/2497074648).int32(message.advertiseMode); + return writer; + }; + + /** + * Encodes the specified RouterBgp message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterBgp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {google.cloud.compute.v1.IRouterBgp} message RouterBgp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterBgp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterBgp message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterBgp} RouterBgp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterBgp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterBgp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 312134331: + message.advertiseMode = reader.int32(); + break; + case 21065526: + if (!(message.advertisedGroups && message.advertisedGroups.length)) + message.advertisedGroups = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.advertisedGroups.push(reader.int32()); + } else + message.advertisedGroups.push(reader.int32()); + break; + case 35449932: + if (!(message.advertisedIpRanges && message.advertisedIpRanges.length)) + message.advertisedIpRanges = []; + message.advertisedIpRanges.push($root.google.cloud.compute.v1.RouterAdvertisedIpRange.decode(reader, reader.uint32())); + break; + case 96892: + message.asn = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterBgp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterBgp} RouterBgp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterBgp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterBgp message. + * @function verify + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterBgp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.advertiseMode != null && message.hasOwnProperty("advertiseMode")) { + properties._advertiseMode = 1; + switch (message.advertiseMode) { + default: + return "advertiseMode: enum value expected"; + case 0: + case 388595569: + case 115302945: + break; + } + } + if (message.advertisedGroups != null && message.hasOwnProperty("advertisedGroups")) { + if (!Array.isArray(message.advertisedGroups)) + return "advertisedGroups: array expected"; + for (var i = 0; i < message.advertisedGroups.length; ++i) + switch (message.advertisedGroups[i]) { + default: + return "advertisedGroups: enum value[] expected"; + case 0: + case 3622872: + break; + } + } + if (message.advertisedIpRanges != null && message.hasOwnProperty("advertisedIpRanges")) { + if (!Array.isArray(message.advertisedIpRanges)) + return "advertisedIpRanges: array expected"; + for (var i = 0; i < message.advertisedIpRanges.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterAdvertisedIpRange.verify(message.advertisedIpRanges[i]); + if (error) + return "advertisedIpRanges." + error; + } + } + if (message.asn != null && message.hasOwnProperty("asn")) { + properties._asn = 1; + if (!$util.isInteger(message.asn)) + return "asn: integer expected"; + } + return null; + }; + + /** + * Creates a RouterBgp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterBgp} RouterBgp + */ + RouterBgp.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterBgp) + return object; + var message = new $root.google.cloud.compute.v1.RouterBgp(); + switch (object.advertiseMode) { + case "UNDEFINED_ADVERTISE_MODE": + case 0: + message.advertiseMode = 0; + break; + case "CUSTOM": + case 388595569: + message.advertiseMode = 388595569; + break; + case "DEFAULT": + case 115302945: + message.advertiseMode = 115302945; + break; + } + if (object.advertisedGroups) { + if (!Array.isArray(object.advertisedGroups)) + throw TypeError(".google.cloud.compute.v1.RouterBgp.advertisedGroups: array expected"); + message.advertisedGroups = []; + for (var i = 0; i < object.advertisedGroups.length; ++i) + switch (object.advertisedGroups[i]) { + default: + case "UNDEFINED_ADVERTISED_GROUPS": + case 0: + message.advertisedGroups[i] = 0; + break; + case "ALL_SUBNETS": + case 3622872: + message.advertisedGroups[i] = 3622872; + break; + } + } + if (object.advertisedIpRanges) { + if (!Array.isArray(object.advertisedIpRanges)) + throw TypeError(".google.cloud.compute.v1.RouterBgp.advertisedIpRanges: array expected"); + message.advertisedIpRanges = []; + for (var i = 0; i < object.advertisedIpRanges.length; ++i) { + if (typeof object.advertisedIpRanges[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterBgp.advertisedIpRanges: object expected"); + message.advertisedIpRanges[i] = $root.google.cloud.compute.v1.RouterAdvertisedIpRange.fromObject(object.advertisedIpRanges[i]); + } + } + if (object.asn != null) + message.asn = object.asn >>> 0; + return message; + }; + + /** + * Creates a plain object from a RouterBgp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterBgp + * @static + * @param {google.cloud.compute.v1.RouterBgp} message RouterBgp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterBgp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.advertisedGroups = []; + object.advertisedIpRanges = []; + } + if (message.asn != null && message.hasOwnProperty("asn")) { + object.asn = message.asn; + if (options.oneofs) + object._asn = "asn"; + } + if (message.advertisedGroups && message.advertisedGroups.length) { + object.advertisedGroups = []; + for (var j = 0; j < message.advertisedGroups.length; ++j) + object.advertisedGroups[j] = options.enums === String ? $root.google.cloud.compute.v1.RouterBgp.AdvertisedGroups[message.advertisedGroups[j]] : message.advertisedGroups[j]; + } + if (message.advertisedIpRanges && message.advertisedIpRanges.length) { + object.advertisedIpRanges = []; + for (var j = 0; j < message.advertisedIpRanges.length; ++j) + object.advertisedIpRanges[j] = $root.google.cloud.compute.v1.RouterAdvertisedIpRange.toObject(message.advertisedIpRanges[j], options); + } + if (message.advertiseMode != null && message.hasOwnProperty("advertiseMode")) { + object.advertiseMode = options.enums === String ? $root.google.cloud.compute.v1.RouterBgp.AdvertiseMode[message.advertiseMode] : message.advertiseMode; + if (options.oneofs) + object._advertiseMode = "advertiseMode"; + } + return object; + }; + + /** + * Converts this RouterBgp to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterBgp + * @instance + * @returns {Object.} JSON object + */ + RouterBgp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AdvertiseMode enum. + * @name google.cloud.compute.v1.RouterBgp.AdvertiseMode + * @enum {number} + * @property {number} UNDEFINED_ADVERTISE_MODE=0 UNDEFINED_ADVERTISE_MODE value + * @property {number} CUSTOM=388595569 CUSTOM value + * @property {number} DEFAULT=115302945 DEFAULT value + */ + RouterBgp.AdvertiseMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ADVERTISE_MODE"] = 0; + values[valuesById[388595569] = "CUSTOM"] = 388595569; + values[valuesById[115302945] = "DEFAULT"] = 115302945; + return values; + })(); + + /** + * AdvertisedGroups enum. + * @name google.cloud.compute.v1.RouterBgp.AdvertisedGroups + * @enum {number} + * @property {number} UNDEFINED_ADVERTISED_GROUPS=0 UNDEFINED_ADVERTISED_GROUPS value + * @property {number} ALL_SUBNETS=3622872 ALL_SUBNETS value + */ + RouterBgp.AdvertisedGroups = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ADVERTISED_GROUPS"] = 0; + values[valuesById[3622872] = "ALL_SUBNETS"] = 3622872; + return values; + })(); + + return RouterBgp; + })(); + + v1.RouterBgpPeer = (function() { + + /** + * Properties of a RouterBgpPeer. + * @memberof google.cloud.compute.v1 + * @interface IRouterBgpPeer + * @property {google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode|null} [advertiseMode] RouterBgpPeer advertiseMode + * @property {Array.|null} [advertisedGroups] RouterBgpPeer advertisedGroups + * @property {Array.|null} [advertisedIpRanges] RouterBgpPeer advertisedIpRanges + * @property {number|null} [advertisedRoutePriority] RouterBgpPeer advertisedRoutePriority + * @property {string|null} [interfaceName] RouterBgpPeer interfaceName + * @property {string|null} [ipAddress] RouterBgpPeer ipAddress + * @property {google.cloud.compute.v1.RouterBgpPeer.ManagementType|null} [managementType] RouterBgpPeer managementType + * @property {string|null} [name] RouterBgpPeer name + * @property {number|null} [peerAsn] RouterBgpPeer peerAsn + * @property {string|null} [peerIpAddress] RouterBgpPeer peerIpAddress + */ + + /** + * Constructs a new RouterBgpPeer. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterBgpPeer. + * @implements IRouterBgpPeer + * @constructor + * @param {google.cloud.compute.v1.IRouterBgpPeer=} [properties] Properties to set + */ + function RouterBgpPeer(properties) { + this.advertisedGroups = []; + this.advertisedIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterBgpPeer advertiseMode. + * @member {google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode|null|undefined} advertiseMode + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.advertiseMode = null; + + /** + * RouterBgpPeer advertisedGroups. + * @member {Array.} advertisedGroups + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.advertisedGroups = $util.emptyArray; + + /** + * RouterBgpPeer advertisedIpRanges. + * @member {Array.} advertisedIpRanges + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.advertisedIpRanges = $util.emptyArray; + + /** + * RouterBgpPeer advertisedRoutePriority. + * @member {number|null|undefined} advertisedRoutePriority + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.advertisedRoutePriority = null; + + /** + * RouterBgpPeer interfaceName. + * @member {string|null|undefined} interfaceName + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.interfaceName = null; + + /** + * RouterBgpPeer ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.ipAddress = null; + + /** + * RouterBgpPeer managementType. + * @member {google.cloud.compute.v1.RouterBgpPeer.ManagementType|null|undefined} managementType + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.managementType = null; + + /** + * RouterBgpPeer name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.name = null; + + /** + * RouterBgpPeer peerAsn. + * @member {number|null|undefined} peerAsn + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.peerAsn = null; + + /** + * RouterBgpPeer peerIpAddress. + * @member {string|null|undefined} peerIpAddress + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + RouterBgpPeer.prototype.peerIpAddress = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterBgpPeer _advertiseMode. + * @member {"advertiseMode"|undefined} _advertiseMode + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_advertiseMode", { + get: $util.oneOfGetter($oneOfFields = ["advertiseMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgpPeer _advertisedRoutePriority. + * @member {"advertisedRoutePriority"|undefined} _advertisedRoutePriority + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_advertisedRoutePriority", { + get: $util.oneOfGetter($oneOfFields = ["advertisedRoutePriority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgpPeer _interfaceName. + * @member {"interfaceName"|undefined} _interfaceName + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_interfaceName", { + get: $util.oneOfGetter($oneOfFields = ["interfaceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgpPeer _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgpPeer _managementType. + * @member {"managementType"|undefined} _managementType + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_managementType", { + get: $util.oneOfGetter($oneOfFields = ["managementType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgpPeer _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgpPeer _peerAsn. + * @member {"peerAsn"|undefined} _peerAsn + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_peerAsn", { + get: $util.oneOfGetter($oneOfFields = ["peerAsn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterBgpPeer _peerIpAddress. + * @member {"peerIpAddress"|undefined} _peerIpAddress + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + */ + Object.defineProperty(RouterBgpPeer.prototype, "_peerIpAddress", { + get: $util.oneOfGetter($oneOfFields = ["peerIpAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterBgpPeer instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {google.cloud.compute.v1.IRouterBgpPeer=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterBgpPeer} RouterBgpPeer instance + */ + RouterBgpPeer.create = function create(properties) { + return new RouterBgpPeer(properties); + }; + + /** + * Encodes the specified RouterBgpPeer message. Does not implicitly {@link google.cloud.compute.v1.RouterBgpPeer.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {google.cloud.compute.v1.IRouterBgpPeer} message RouterBgpPeer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterBgpPeer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.advertisedGroups != null && message.advertisedGroups.length) { + writer.uint32(/* id 21065526, wireType 2 =*/168524210).fork(); + for (var i = 0; i < message.advertisedGroups.length; ++i) + writer.int32(message.advertisedGroups[i]); + writer.ldelim(); + } + if (message.advertisedIpRanges != null && message.advertisedIpRanges.length) + for (var i = 0; i < message.advertisedIpRanges.length; ++i) + $root.google.cloud.compute.v1.RouterAdvertisedIpRange.encode(message.advertisedIpRanges[i], writer.uint32(/* id 35449932, wireType 2 =*/283599458).fork()).ldelim(); + if (message.peerAsn != null && Object.hasOwnProperty.call(message, "peerAsn")) + writer.uint32(/* id 69573151, wireType 0 =*/556585208).uint32(message.peerAsn); + if (message.managementType != null && Object.hasOwnProperty.call(message, "managementType")) + writer.uint32(/* id 173703606, wireType 0 =*/1389628848).int32(message.managementType); + if (message.advertisedRoutePriority != null && Object.hasOwnProperty.call(message, "advertisedRoutePriority")) + writer.uint32(/* id 186486332, wireType 0 =*/1491890656).uint32(message.advertisedRoutePriority); + if (message.peerIpAddress != null && Object.hasOwnProperty.call(message, "peerIpAddress")) + writer.uint32(/* id 207735769, wireType 2 =*/1661886154).string(message.peerIpAddress); + if (message.advertiseMode != null && Object.hasOwnProperty.call(message, "advertiseMode")) + writer.uint32(/* id 312134331, wireType 0 =*/2497074648).int32(message.advertiseMode); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 406272220, wireType 2 =*/3250177762).string(message.ipAddress); + if (message.interfaceName != null && Object.hasOwnProperty.call(message, "interfaceName")) + writer.uint32(/* id 437854673, wireType 2 =*/3502837386).string(message.interfaceName); + return writer; + }; + + /** + * Encodes the specified RouterBgpPeer message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterBgpPeer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {google.cloud.compute.v1.IRouterBgpPeer} message RouterBgpPeer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterBgpPeer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterBgpPeer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterBgpPeer} RouterBgpPeer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterBgpPeer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterBgpPeer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 312134331: + message.advertiseMode = reader.int32(); + break; + case 21065526: + if (!(message.advertisedGroups && message.advertisedGroups.length)) + message.advertisedGroups = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.advertisedGroups.push(reader.int32()); + } else + message.advertisedGroups.push(reader.int32()); + break; + case 35449932: + if (!(message.advertisedIpRanges && message.advertisedIpRanges.length)) + message.advertisedIpRanges = []; + message.advertisedIpRanges.push($root.google.cloud.compute.v1.RouterAdvertisedIpRange.decode(reader, reader.uint32())); + break; + case 186486332: + message.advertisedRoutePriority = reader.uint32(); + break; + case 437854673: + message.interfaceName = reader.string(); + break; + case 406272220: + message.ipAddress = reader.string(); + break; + case 173703606: + message.managementType = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 69573151: + message.peerAsn = reader.uint32(); + break; + case 207735769: + message.peerIpAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterBgpPeer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterBgpPeer} RouterBgpPeer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterBgpPeer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterBgpPeer message. + * @function verify + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterBgpPeer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.advertiseMode != null && message.hasOwnProperty("advertiseMode")) { + properties._advertiseMode = 1; + switch (message.advertiseMode) { + default: + return "advertiseMode: enum value expected"; + case 0: + case 388595569: + case 115302945: + break; + } + } + if (message.advertisedGroups != null && message.hasOwnProperty("advertisedGroups")) { + if (!Array.isArray(message.advertisedGroups)) + return "advertisedGroups: array expected"; + for (var i = 0; i < message.advertisedGroups.length; ++i) + switch (message.advertisedGroups[i]) { + default: + return "advertisedGroups: enum value[] expected"; + case 0: + case 3622872: + break; + } + } + if (message.advertisedIpRanges != null && message.hasOwnProperty("advertisedIpRanges")) { + if (!Array.isArray(message.advertisedIpRanges)) + return "advertisedIpRanges: array expected"; + for (var i = 0; i < message.advertisedIpRanges.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterAdvertisedIpRange.verify(message.advertisedIpRanges[i]); + if (error) + return "advertisedIpRanges." + error; + } + } + if (message.advertisedRoutePriority != null && message.hasOwnProperty("advertisedRoutePriority")) { + properties._advertisedRoutePriority = 1; + if (!$util.isInteger(message.advertisedRoutePriority)) + return "advertisedRoutePriority: integer expected"; + } + if (message.interfaceName != null && message.hasOwnProperty("interfaceName")) { + properties._interfaceName = 1; + if (!$util.isString(message.interfaceName)) + return "interfaceName: string expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.managementType != null && message.hasOwnProperty("managementType")) { + properties._managementType = 1; + switch (message.managementType) { + default: + return "managementType: enum value expected"; + case 0: + case 458926411: + case 317294067: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.peerAsn != null && message.hasOwnProperty("peerAsn")) { + properties._peerAsn = 1; + if (!$util.isInteger(message.peerAsn)) + return "peerAsn: integer expected"; + } + if (message.peerIpAddress != null && message.hasOwnProperty("peerIpAddress")) { + properties._peerIpAddress = 1; + if (!$util.isString(message.peerIpAddress)) + return "peerIpAddress: string expected"; + } + return null; + }; + + /** + * Creates a RouterBgpPeer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterBgpPeer} RouterBgpPeer + */ + RouterBgpPeer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterBgpPeer) + return object; + var message = new $root.google.cloud.compute.v1.RouterBgpPeer(); + switch (object.advertiseMode) { + case "UNDEFINED_ADVERTISE_MODE": + case 0: + message.advertiseMode = 0; + break; + case "CUSTOM": + case 388595569: + message.advertiseMode = 388595569; + break; + case "DEFAULT": + case 115302945: + message.advertiseMode = 115302945; + break; + } + if (object.advertisedGroups) { + if (!Array.isArray(object.advertisedGroups)) + throw TypeError(".google.cloud.compute.v1.RouterBgpPeer.advertisedGroups: array expected"); + message.advertisedGroups = []; + for (var i = 0; i < object.advertisedGroups.length; ++i) + switch (object.advertisedGroups[i]) { + default: + case "UNDEFINED_ADVERTISED_GROUPS": + case 0: + message.advertisedGroups[i] = 0; + break; + case "ALL_SUBNETS": + case 3622872: + message.advertisedGroups[i] = 3622872; + break; + } + } + if (object.advertisedIpRanges) { + if (!Array.isArray(object.advertisedIpRanges)) + throw TypeError(".google.cloud.compute.v1.RouterBgpPeer.advertisedIpRanges: array expected"); + message.advertisedIpRanges = []; + for (var i = 0; i < object.advertisedIpRanges.length; ++i) { + if (typeof object.advertisedIpRanges[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterBgpPeer.advertisedIpRanges: object expected"); + message.advertisedIpRanges[i] = $root.google.cloud.compute.v1.RouterAdvertisedIpRange.fromObject(object.advertisedIpRanges[i]); + } + } + if (object.advertisedRoutePriority != null) + message.advertisedRoutePriority = object.advertisedRoutePriority >>> 0; + if (object.interfaceName != null) + message.interfaceName = String(object.interfaceName); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + switch (object.managementType) { + case "UNDEFINED_MANAGEMENT_TYPE": + case 0: + message.managementType = 0; + break; + case "MANAGED_BY_ATTACHMENT": + case 458926411: + message.managementType = 458926411; + break; + case "MANAGED_BY_USER": + case 317294067: + message.managementType = 317294067; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.peerAsn != null) + message.peerAsn = object.peerAsn >>> 0; + if (object.peerIpAddress != null) + message.peerIpAddress = String(object.peerIpAddress); + return message; + }; + + /** + * Creates a plain object from a RouterBgpPeer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @static + * @param {google.cloud.compute.v1.RouterBgpPeer} message RouterBgpPeer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterBgpPeer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.advertisedGroups = []; + object.advertisedIpRanges = []; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.advertisedGroups && message.advertisedGroups.length) { + object.advertisedGroups = []; + for (var j = 0; j < message.advertisedGroups.length; ++j) + object.advertisedGroups[j] = options.enums === String ? $root.google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups[message.advertisedGroups[j]] : message.advertisedGroups[j]; + } + if (message.advertisedIpRanges && message.advertisedIpRanges.length) { + object.advertisedIpRanges = []; + for (var j = 0; j < message.advertisedIpRanges.length; ++j) + object.advertisedIpRanges[j] = $root.google.cloud.compute.v1.RouterAdvertisedIpRange.toObject(message.advertisedIpRanges[j], options); + } + if (message.peerAsn != null && message.hasOwnProperty("peerAsn")) { + object.peerAsn = message.peerAsn; + if (options.oneofs) + object._peerAsn = "peerAsn"; + } + if (message.managementType != null && message.hasOwnProperty("managementType")) { + object.managementType = options.enums === String ? $root.google.cloud.compute.v1.RouterBgpPeer.ManagementType[message.managementType] : message.managementType; + if (options.oneofs) + object._managementType = "managementType"; + } + if (message.advertisedRoutePriority != null && message.hasOwnProperty("advertisedRoutePriority")) { + object.advertisedRoutePriority = message.advertisedRoutePriority; + if (options.oneofs) + object._advertisedRoutePriority = "advertisedRoutePriority"; + } + if (message.peerIpAddress != null && message.hasOwnProperty("peerIpAddress")) { + object.peerIpAddress = message.peerIpAddress; + if (options.oneofs) + object._peerIpAddress = "peerIpAddress"; + } + if (message.advertiseMode != null && message.hasOwnProperty("advertiseMode")) { + object.advertiseMode = options.enums === String ? $root.google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode[message.advertiseMode] : message.advertiseMode; + if (options.oneofs) + object._advertiseMode = "advertiseMode"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + if (message.interfaceName != null && message.hasOwnProperty("interfaceName")) { + object.interfaceName = message.interfaceName; + if (options.oneofs) + object._interfaceName = "interfaceName"; + } + return object; + }; + + /** + * Converts this RouterBgpPeer to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterBgpPeer + * @instance + * @returns {Object.} JSON object + */ + RouterBgpPeer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AdvertiseMode enum. + * @name google.cloud.compute.v1.RouterBgpPeer.AdvertiseMode + * @enum {number} + * @property {number} UNDEFINED_ADVERTISE_MODE=0 UNDEFINED_ADVERTISE_MODE value + * @property {number} CUSTOM=388595569 CUSTOM value + * @property {number} DEFAULT=115302945 DEFAULT value + */ + RouterBgpPeer.AdvertiseMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ADVERTISE_MODE"] = 0; + values[valuesById[388595569] = "CUSTOM"] = 388595569; + values[valuesById[115302945] = "DEFAULT"] = 115302945; + return values; + })(); + + /** + * AdvertisedGroups enum. + * @name google.cloud.compute.v1.RouterBgpPeer.AdvertisedGroups + * @enum {number} + * @property {number} UNDEFINED_ADVERTISED_GROUPS=0 UNDEFINED_ADVERTISED_GROUPS value + * @property {number} ALL_SUBNETS=3622872 ALL_SUBNETS value + */ + RouterBgpPeer.AdvertisedGroups = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ADVERTISED_GROUPS"] = 0; + values[valuesById[3622872] = "ALL_SUBNETS"] = 3622872; + return values; + })(); + + /** + * ManagementType enum. + * @name google.cloud.compute.v1.RouterBgpPeer.ManagementType + * @enum {number} + * @property {number} UNDEFINED_MANAGEMENT_TYPE=0 UNDEFINED_MANAGEMENT_TYPE value + * @property {number} MANAGED_BY_ATTACHMENT=458926411 MANAGED_BY_ATTACHMENT value + * @property {number} MANAGED_BY_USER=317294067 MANAGED_BY_USER value + */ + RouterBgpPeer.ManagementType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MANAGEMENT_TYPE"] = 0; + values[valuesById[458926411] = "MANAGED_BY_ATTACHMENT"] = 458926411; + values[valuesById[317294067] = "MANAGED_BY_USER"] = 317294067; + return values; + })(); + + return RouterBgpPeer; + })(); + + v1.RouterInterface = (function() { + + /** + * Properties of a RouterInterface. + * @memberof google.cloud.compute.v1 + * @interface IRouterInterface + * @property {string|null} [ipRange] RouterInterface ipRange + * @property {string|null} [linkedInterconnectAttachment] RouterInterface linkedInterconnectAttachment + * @property {string|null} [linkedVpnTunnel] RouterInterface linkedVpnTunnel + * @property {google.cloud.compute.v1.RouterInterface.ManagementType|null} [managementType] RouterInterface managementType + * @property {string|null} [name] RouterInterface name + */ + + /** + * Constructs a new RouterInterface. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterInterface. + * @implements IRouterInterface + * @constructor + * @param {google.cloud.compute.v1.IRouterInterface=} [properties] Properties to set + */ + function RouterInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterInterface ipRange. + * @member {string|null|undefined} ipRange + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + RouterInterface.prototype.ipRange = null; + + /** + * RouterInterface linkedInterconnectAttachment. + * @member {string|null|undefined} linkedInterconnectAttachment + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + RouterInterface.prototype.linkedInterconnectAttachment = null; + + /** + * RouterInterface linkedVpnTunnel. + * @member {string|null|undefined} linkedVpnTunnel + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + RouterInterface.prototype.linkedVpnTunnel = null; + + /** + * RouterInterface managementType. + * @member {google.cloud.compute.v1.RouterInterface.ManagementType|null|undefined} managementType + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + RouterInterface.prototype.managementType = null; + + /** + * RouterInterface name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + RouterInterface.prototype.name = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterInterface _ipRange. + * @member {"ipRange"|undefined} _ipRange + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + Object.defineProperty(RouterInterface.prototype, "_ipRange", { + get: $util.oneOfGetter($oneOfFields = ["ipRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterInterface _linkedInterconnectAttachment. + * @member {"linkedInterconnectAttachment"|undefined} _linkedInterconnectAttachment + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + Object.defineProperty(RouterInterface.prototype, "_linkedInterconnectAttachment", { + get: $util.oneOfGetter($oneOfFields = ["linkedInterconnectAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterInterface _linkedVpnTunnel. + * @member {"linkedVpnTunnel"|undefined} _linkedVpnTunnel + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + Object.defineProperty(RouterInterface.prototype, "_linkedVpnTunnel", { + get: $util.oneOfGetter($oneOfFields = ["linkedVpnTunnel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterInterface _managementType. + * @member {"managementType"|undefined} _managementType + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + Object.defineProperty(RouterInterface.prototype, "_managementType", { + get: $util.oneOfGetter($oneOfFields = ["managementType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterInterface _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + */ + Object.defineProperty(RouterInterface.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterInterface instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {google.cloud.compute.v1.IRouterInterface=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterInterface} RouterInterface instance + */ + RouterInterface.create = function create(properties) { + return new RouterInterface(properties); + }; + + /** + * Encodes the specified RouterInterface message. Does not implicitly {@link google.cloud.compute.v1.RouterInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {google.cloud.compute.v1.IRouterInterface} message RouterInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.ipRange != null && Object.hasOwnProperty.call(message, "ipRange")) + writer.uint32(/* id 145092645, wireType 2 =*/1160741162).string(message.ipRange); + if (message.managementType != null && Object.hasOwnProperty.call(message, "managementType")) + writer.uint32(/* id 173703606, wireType 0 =*/1389628848).int32(message.managementType); + if (message.linkedVpnTunnel != null && Object.hasOwnProperty.call(message, "linkedVpnTunnel")) + writer.uint32(/* id 352296953, wireType 2 =*/2818375626).string(message.linkedVpnTunnel); + if (message.linkedInterconnectAttachment != null && Object.hasOwnProperty.call(message, "linkedInterconnectAttachment")) + writer.uint32(/* id 501085518, wireType 2 =*/4008684146).string(message.linkedInterconnectAttachment); + return writer; + }; + + /** + * Encodes the specified RouterInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {google.cloud.compute.v1.IRouterInterface} message RouterInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterInterface} RouterInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 145092645: + message.ipRange = reader.string(); + break; + case 501085518: + message.linkedInterconnectAttachment = reader.string(); + break; + case 352296953: + message.linkedVpnTunnel = reader.string(); + break; + case 173703606: + message.managementType = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterInterface} RouterInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterInterface message. + * @function verify + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipRange != null && message.hasOwnProperty("ipRange")) { + properties._ipRange = 1; + if (!$util.isString(message.ipRange)) + return "ipRange: string expected"; + } + if (message.linkedInterconnectAttachment != null && message.hasOwnProperty("linkedInterconnectAttachment")) { + properties._linkedInterconnectAttachment = 1; + if (!$util.isString(message.linkedInterconnectAttachment)) + return "linkedInterconnectAttachment: string expected"; + } + if (message.linkedVpnTunnel != null && message.hasOwnProperty("linkedVpnTunnel")) { + properties._linkedVpnTunnel = 1; + if (!$util.isString(message.linkedVpnTunnel)) + return "linkedVpnTunnel: string expected"; + } + if (message.managementType != null && message.hasOwnProperty("managementType")) { + properties._managementType = 1; + switch (message.managementType) { + default: + return "managementType: enum value expected"; + case 0: + case 458926411: + case 317294067: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a RouterInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterInterface} RouterInterface + */ + RouterInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterInterface) + return object; + var message = new $root.google.cloud.compute.v1.RouterInterface(); + if (object.ipRange != null) + message.ipRange = String(object.ipRange); + if (object.linkedInterconnectAttachment != null) + message.linkedInterconnectAttachment = String(object.linkedInterconnectAttachment); + if (object.linkedVpnTunnel != null) + message.linkedVpnTunnel = String(object.linkedVpnTunnel); + switch (object.managementType) { + case "UNDEFINED_MANAGEMENT_TYPE": + case 0: + message.managementType = 0; + break; + case "MANAGED_BY_ATTACHMENT": + case 458926411: + message.managementType = 458926411; + break; + case "MANAGED_BY_USER": + case 317294067: + message.managementType = 317294067; + break; + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RouterInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterInterface + * @static + * @param {google.cloud.compute.v1.RouterInterface} message RouterInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.ipRange != null && message.hasOwnProperty("ipRange")) { + object.ipRange = message.ipRange; + if (options.oneofs) + object._ipRange = "ipRange"; + } + if (message.managementType != null && message.hasOwnProperty("managementType")) { + object.managementType = options.enums === String ? $root.google.cloud.compute.v1.RouterInterface.ManagementType[message.managementType] : message.managementType; + if (options.oneofs) + object._managementType = "managementType"; + } + if (message.linkedVpnTunnel != null && message.hasOwnProperty("linkedVpnTunnel")) { + object.linkedVpnTunnel = message.linkedVpnTunnel; + if (options.oneofs) + object._linkedVpnTunnel = "linkedVpnTunnel"; + } + if (message.linkedInterconnectAttachment != null && message.hasOwnProperty("linkedInterconnectAttachment")) { + object.linkedInterconnectAttachment = message.linkedInterconnectAttachment; + if (options.oneofs) + object._linkedInterconnectAttachment = "linkedInterconnectAttachment"; + } + return object; + }; + + /** + * Converts this RouterInterface to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterInterface + * @instance + * @returns {Object.} JSON object + */ + RouterInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ManagementType enum. + * @name google.cloud.compute.v1.RouterInterface.ManagementType + * @enum {number} + * @property {number} UNDEFINED_MANAGEMENT_TYPE=0 UNDEFINED_MANAGEMENT_TYPE value + * @property {number} MANAGED_BY_ATTACHMENT=458926411 MANAGED_BY_ATTACHMENT value + * @property {number} MANAGED_BY_USER=317294067 MANAGED_BY_USER value + */ + RouterInterface.ManagementType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MANAGEMENT_TYPE"] = 0; + values[valuesById[458926411] = "MANAGED_BY_ATTACHMENT"] = 458926411; + values[valuesById[317294067] = "MANAGED_BY_USER"] = 317294067; + return values; + })(); + + return RouterInterface; + })(); + + v1.RouterNat = (function() { + + /** + * Properties of a RouterNat. + * @memberof google.cloud.compute.v1 + * @interface IRouterNat + * @property {Array.|null} [drainNatIps] RouterNat drainNatIps + * @property {boolean|null} [enableEndpointIndependentMapping] RouterNat enableEndpointIndependentMapping + * @property {number|null} [icmpIdleTimeoutSec] RouterNat icmpIdleTimeoutSec + * @property {google.cloud.compute.v1.IRouterNatLogConfig|null} [logConfig] RouterNat logConfig + * @property {number|null} [minPortsPerVm] RouterNat minPortsPerVm + * @property {string|null} [name] RouterNat name + * @property {google.cloud.compute.v1.RouterNat.NatIpAllocateOption|null} [natIpAllocateOption] RouterNat natIpAllocateOption + * @property {Array.|null} [natIps] RouterNat natIps + * @property {google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat|null} [sourceSubnetworkIpRangesToNat] RouterNat sourceSubnetworkIpRangesToNat + * @property {Array.|null} [subnetworks] RouterNat subnetworks + * @property {number|null} [tcpEstablishedIdleTimeoutSec] RouterNat tcpEstablishedIdleTimeoutSec + * @property {number|null} [tcpTransitoryIdleTimeoutSec] RouterNat tcpTransitoryIdleTimeoutSec + * @property {number|null} [udpIdleTimeoutSec] RouterNat udpIdleTimeoutSec + */ + + /** + * Constructs a new RouterNat. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterNat. + * @implements IRouterNat + * @constructor + * @param {google.cloud.compute.v1.IRouterNat=} [properties] Properties to set + */ + function RouterNat(properties) { + this.drainNatIps = []; + this.natIps = []; + this.subnetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterNat drainNatIps. + * @member {Array.} drainNatIps + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.drainNatIps = $util.emptyArray; + + /** + * RouterNat enableEndpointIndependentMapping. + * @member {boolean|null|undefined} enableEndpointIndependentMapping + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.enableEndpointIndependentMapping = null; + + /** + * RouterNat icmpIdleTimeoutSec. + * @member {number|null|undefined} icmpIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.icmpIdleTimeoutSec = null; + + /** + * RouterNat logConfig. + * @member {google.cloud.compute.v1.IRouterNatLogConfig|null|undefined} logConfig + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.logConfig = null; + + /** + * RouterNat minPortsPerVm. + * @member {number|null|undefined} minPortsPerVm + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.minPortsPerVm = null; + + /** + * RouterNat name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.name = null; + + /** + * RouterNat natIpAllocateOption. + * @member {google.cloud.compute.v1.RouterNat.NatIpAllocateOption|null|undefined} natIpAllocateOption + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.natIpAllocateOption = null; + + /** + * RouterNat natIps. + * @member {Array.} natIps + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.natIps = $util.emptyArray; + + /** + * RouterNat sourceSubnetworkIpRangesToNat. + * @member {google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat|null|undefined} sourceSubnetworkIpRangesToNat + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.sourceSubnetworkIpRangesToNat = null; + + /** + * RouterNat subnetworks. + * @member {Array.} subnetworks + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.subnetworks = $util.emptyArray; + + /** + * RouterNat tcpEstablishedIdleTimeoutSec. + * @member {number|null|undefined} tcpEstablishedIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.tcpEstablishedIdleTimeoutSec = null; + + /** + * RouterNat tcpTransitoryIdleTimeoutSec. + * @member {number|null|undefined} tcpTransitoryIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.tcpTransitoryIdleTimeoutSec = null; + + /** + * RouterNat udpIdleTimeoutSec. + * @member {number|null|undefined} udpIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + RouterNat.prototype.udpIdleTimeoutSec = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterNat _enableEndpointIndependentMapping. + * @member {"enableEndpointIndependentMapping"|undefined} _enableEndpointIndependentMapping + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_enableEndpointIndependentMapping", { + get: $util.oneOfGetter($oneOfFields = ["enableEndpointIndependentMapping"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _icmpIdleTimeoutSec. + * @member {"icmpIdleTimeoutSec"|undefined} _icmpIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_icmpIdleTimeoutSec", { + get: $util.oneOfGetter($oneOfFields = ["icmpIdleTimeoutSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _logConfig. + * @member {"logConfig"|undefined} _logConfig + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_logConfig", { + get: $util.oneOfGetter($oneOfFields = ["logConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _minPortsPerVm. + * @member {"minPortsPerVm"|undefined} _minPortsPerVm + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_minPortsPerVm", { + get: $util.oneOfGetter($oneOfFields = ["minPortsPerVm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _natIpAllocateOption. + * @member {"natIpAllocateOption"|undefined} _natIpAllocateOption + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_natIpAllocateOption", { + get: $util.oneOfGetter($oneOfFields = ["natIpAllocateOption"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _sourceSubnetworkIpRangesToNat. + * @member {"sourceSubnetworkIpRangesToNat"|undefined} _sourceSubnetworkIpRangesToNat + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_sourceSubnetworkIpRangesToNat", { + get: $util.oneOfGetter($oneOfFields = ["sourceSubnetworkIpRangesToNat"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _tcpEstablishedIdleTimeoutSec. + * @member {"tcpEstablishedIdleTimeoutSec"|undefined} _tcpEstablishedIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_tcpEstablishedIdleTimeoutSec", { + get: $util.oneOfGetter($oneOfFields = ["tcpEstablishedIdleTimeoutSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _tcpTransitoryIdleTimeoutSec. + * @member {"tcpTransitoryIdleTimeoutSec"|undefined} _tcpTransitoryIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_tcpTransitoryIdleTimeoutSec", { + get: $util.oneOfGetter($oneOfFields = ["tcpTransitoryIdleTimeoutSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNat _udpIdleTimeoutSec. + * @member {"udpIdleTimeoutSec"|undefined} _udpIdleTimeoutSec + * @memberof google.cloud.compute.v1.RouterNat + * @instance + */ + Object.defineProperty(RouterNat.prototype, "_udpIdleTimeoutSec", { + get: $util.oneOfGetter($oneOfFields = ["udpIdleTimeoutSec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterNat instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {google.cloud.compute.v1.IRouterNat=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterNat} RouterNat instance + */ + RouterNat.create = function create(properties) { + return new RouterNat(properties); + }; + + /** + * Encodes the specified RouterNat message. Does not implicitly {@link google.cloud.compute.v1.RouterNat.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {google.cloud.compute.v1.IRouterNat} message RouterNat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterNat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.icmpIdleTimeoutSec != null && Object.hasOwnProperty.call(message, "icmpIdleTimeoutSec")) + writer.uint32(/* id 3647562, wireType 0 =*/29180496).int32(message.icmpIdleTimeoutSec); + if (message.udpIdleTimeoutSec != null && Object.hasOwnProperty.call(message, "udpIdleTimeoutSec")) + writer.uint32(/* id 64919878, wireType 0 =*/519359024).int32(message.udpIdleTimeoutSec); + if (message.natIps != null && message.natIps.length) + for (var i = 0; i < message.natIps.length; ++i) + writer.uint32(/* id 117635086, wireType 2 =*/941080690).string(message.natIps[i]); + if (message.minPortsPerVm != null && Object.hasOwnProperty.call(message, "minPortsPerVm")) + writer.uint32(/* id 186193587, wireType 0 =*/1489548696).int32(message.minPortsPerVm); + if (message.tcpTransitoryIdleTimeoutSec != null && Object.hasOwnProperty.call(message, "tcpTransitoryIdleTimeoutSec")) + writer.uint32(/* id 205028774, wireType 0 =*/1640230192).int32(message.tcpTransitoryIdleTimeoutSec); + if (message.tcpEstablishedIdleTimeoutSec != null && Object.hasOwnProperty.call(message, "tcpEstablishedIdleTimeoutSec")) + writer.uint32(/* id 223098349, wireType 0 =*/1784786792).int32(message.tcpEstablishedIdleTimeoutSec); + if (message.sourceSubnetworkIpRangesToNat != null && Object.hasOwnProperty.call(message, "sourceSubnetworkIpRangesToNat")) + writer.uint32(/* id 252213211, wireType 0 =*/2017705688).int32(message.sourceSubnetworkIpRangesToNat); + if (message.enableEndpointIndependentMapping != null && Object.hasOwnProperty.call(message, "enableEndpointIndependentMapping")) + writer.uint32(/* id 259441819, wireType 0 =*/2075534552).bool(message.enableEndpointIndependentMapping); + if (message.logConfig != null && Object.hasOwnProperty.call(message, "logConfig")) + $root.google.cloud.compute.v1.RouterNatLogConfig.encode(message.logConfig, writer.uint32(/* id 351299741, wireType 2 =*/2810397930).fork()).ldelim(); + if (message.subnetworks != null && message.subnetworks.length) + for (var i = 0; i < message.subnetworks.length; ++i) + $root.google.cloud.compute.v1.RouterNatSubnetworkToNat.encode(message.subnetworks[i], writer.uint32(/* id 415853125, wireType 2 =*/3326825002).fork()).ldelim(); + if (message.natIpAllocateOption != null && Object.hasOwnProperty.call(message, "natIpAllocateOption")) + writer.uint32(/* id 429726845, wireType 0 =*/3437814760).int32(message.natIpAllocateOption); + if (message.drainNatIps != null && message.drainNatIps.length) + for (var i = 0; i < message.drainNatIps.length; ++i) + writer.uint32(/* id 504078535, wireType 2 =*/4032628282).string(message.drainNatIps[i]); + return writer; + }; + + /** + * Encodes the specified RouterNat message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterNat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {google.cloud.compute.v1.IRouterNat} message RouterNat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterNat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterNat message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterNat} RouterNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterNat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterNat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 504078535: + if (!(message.drainNatIps && message.drainNatIps.length)) + message.drainNatIps = []; + message.drainNatIps.push(reader.string()); + break; + case 259441819: + message.enableEndpointIndependentMapping = reader.bool(); + break; + case 3647562: + message.icmpIdleTimeoutSec = reader.int32(); + break; + case 351299741: + message.logConfig = $root.google.cloud.compute.v1.RouterNatLogConfig.decode(reader, reader.uint32()); + break; + case 186193587: + message.minPortsPerVm = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 429726845: + message.natIpAllocateOption = reader.int32(); + break; + case 117635086: + if (!(message.natIps && message.natIps.length)) + message.natIps = []; + message.natIps.push(reader.string()); + break; + case 252213211: + message.sourceSubnetworkIpRangesToNat = reader.int32(); + break; + case 415853125: + if (!(message.subnetworks && message.subnetworks.length)) + message.subnetworks = []; + message.subnetworks.push($root.google.cloud.compute.v1.RouterNatSubnetworkToNat.decode(reader, reader.uint32())); + break; + case 223098349: + message.tcpEstablishedIdleTimeoutSec = reader.int32(); + break; + case 205028774: + message.tcpTransitoryIdleTimeoutSec = reader.int32(); + break; + case 64919878: + message.udpIdleTimeoutSec = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterNat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterNat} RouterNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterNat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterNat message. + * @function verify + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterNat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.drainNatIps != null && message.hasOwnProperty("drainNatIps")) { + if (!Array.isArray(message.drainNatIps)) + return "drainNatIps: array expected"; + for (var i = 0; i < message.drainNatIps.length; ++i) + if (!$util.isString(message.drainNatIps[i])) + return "drainNatIps: string[] expected"; + } + if (message.enableEndpointIndependentMapping != null && message.hasOwnProperty("enableEndpointIndependentMapping")) { + properties._enableEndpointIndependentMapping = 1; + if (typeof message.enableEndpointIndependentMapping !== "boolean") + return "enableEndpointIndependentMapping: boolean expected"; + } + if (message.icmpIdleTimeoutSec != null && message.hasOwnProperty("icmpIdleTimeoutSec")) { + properties._icmpIdleTimeoutSec = 1; + if (!$util.isInteger(message.icmpIdleTimeoutSec)) + return "icmpIdleTimeoutSec: integer expected"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + properties._logConfig = 1; + { + var error = $root.google.cloud.compute.v1.RouterNatLogConfig.verify(message.logConfig); + if (error) + return "logConfig." + error; + } + } + if (message.minPortsPerVm != null && message.hasOwnProperty("minPortsPerVm")) { + properties._minPortsPerVm = 1; + if (!$util.isInteger(message.minPortsPerVm)) + return "minPortsPerVm: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.natIpAllocateOption != null && message.hasOwnProperty("natIpAllocateOption")) { + properties._natIpAllocateOption = 1; + switch (message.natIpAllocateOption) { + default: + return "natIpAllocateOption: enum value expected"; + case 0: + case 182333500: + case 261251205: + break; + } + } + if (message.natIps != null && message.hasOwnProperty("natIps")) { + if (!Array.isArray(message.natIps)) + return "natIps: array expected"; + for (var i = 0; i < message.natIps.length; ++i) + if (!$util.isString(message.natIps[i])) + return "natIps: string[] expected"; + } + if (message.sourceSubnetworkIpRangesToNat != null && message.hasOwnProperty("sourceSubnetworkIpRangesToNat")) { + properties._sourceSubnetworkIpRangesToNat = 1; + switch (message.sourceSubnetworkIpRangesToNat) { + default: + return "sourceSubnetworkIpRangesToNat: enum value expected"; + case 0: + case 179964376: + case 185573819: + case 517542270: + break; + } + } + if (message.subnetworks != null && message.hasOwnProperty("subnetworks")) { + if (!Array.isArray(message.subnetworks)) + return "subnetworks: array expected"; + for (var i = 0; i < message.subnetworks.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterNatSubnetworkToNat.verify(message.subnetworks[i]); + if (error) + return "subnetworks." + error; + } + } + if (message.tcpEstablishedIdleTimeoutSec != null && message.hasOwnProperty("tcpEstablishedIdleTimeoutSec")) { + properties._tcpEstablishedIdleTimeoutSec = 1; + if (!$util.isInteger(message.tcpEstablishedIdleTimeoutSec)) + return "tcpEstablishedIdleTimeoutSec: integer expected"; + } + if (message.tcpTransitoryIdleTimeoutSec != null && message.hasOwnProperty("tcpTransitoryIdleTimeoutSec")) { + properties._tcpTransitoryIdleTimeoutSec = 1; + if (!$util.isInteger(message.tcpTransitoryIdleTimeoutSec)) + return "tcpTransitoryIdleTimeoutSec: integer expected"; + } + if (message.udpIdleTimeoutSec != null && message.hasOwnProperty("udpIdleTimeoutSec")) { + properties._udpIdleTimeoutSec = 1; + if (!$util.isInteger(message.udpIdleTimeoutSec)) + return "udpIdleTimeoutSec: integer expected"; + } + return null; + }; + + /** + * Creates a RouterNat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterNat} RouterNat + */ + RouterNat.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterNat) + return object; + var message = new $root.google.cloud.compute.v1.RouterNat(); + if (object.drainNatIps) { + if (!Array.isArray(object.drainNatIps)) + throw TypeError(".google.cloud.compute.v1.RouterNat.drainNatIps: array expected"); + message.drainNatIps = []; + for (var i = 0; i < object.drainNatIps.length; ++i) + message.drainNatIps[i] = String(object.drainNatIps[i]); + } + if (object.enableEndpointIndependentMapping != null) + message.enableEndpointIndependentMapping = Boolean(object.enableEndpointIndependentMapping); + if (object.icmpIdleTimeoutSec != null) + message.icmpIdleTimeoutSec = object.icmpIdleTimeoutSec | 0; + if (object.logConfig != null) { + if (typeof object.logConfig !== "object") + throw TypeError(".google.cloud.compute.v1.RouterNat.logConfig: object expected"); + message.logConfig = $root.google.cloud.compute.v1.RouterNatLogConfig.fromObject(object.logConfig); + } + if (object.minPortsPerVm != null) + message.minPortsPerVm = object.minPortsPerVm | 0; + if (object.name != null) + message.name = String(object.name); + switch (object.natIpAllocateOption) { + case "UNDEFINED_NAT_IP_ALLOCATE_OPTION": + case 0: + message.natIpAllocateOption = 0; + break; + case "AUTO_ONLY": + case 182333500: + message.natIpAllocateOption = 182333500; + break; + case "MANUAL_ONLY": + case 261251205: + message.natIpAllocateOption = 261251205; + break; + } + if (object.natIps) { + if (!Array.isArray(object.natIps)) + throw TypeError(".google.cloud.compute.v1.RouterNat.natIps: array expected"); + message.natIps = []; + for (var i = 0; i < object.natIps.length; ++i) + message.natIps[i] = String(object.natIps[i]); + } + switch (object.sourceSubnetworkIpRangesToNat) { + case "UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT": + case 0: + message.sourceSubnetworkIpRangesToNat = 0; + break; + case "ALL_SUBNETWORKS_ALL_IP_RANGES": + case 179964376: + message.sourceSubnetworkIpRangesToNat = 179964376; + break; + case "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES": + case 185573819: + message.sourceSubnetworkIpRangesToNat = 185573819; + break; + case "LIST_OF_SUBNETWORKS": + case 517542270: + message.sourceSubnetworkIpRangesToNat = 517542270; + break; + } + if (object.subnetworks) { + if (!Array.isArray(object.subnetworks)) + throw TypeError(".google.cloud.compute.v1.RouterNat.subnetworks: array expected"); + message.subnetworks = []; + for (var i = 0; i < object.subnetworks.length; ++i) { + if (typeof object.subnetworks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterNat.subnetworks: object expected"); + message.subnetworks[i] = $root.google.cloud.compute.v1.RouterNatSubnetworkToNat.fromObject(object.subnetworks[i]); + } + } + if (object.tcpEstablishedIdleTimeoutSec != null) + message.tcpEstablishedIdleTimeoutSec = object.tcpEstablishedIdleTimeoutSec | 0; + if (object.tcpTransitoryIdleTimeoutSec != null) + message.tcpTransitoryIdleTimeoutSec = object.tcpTransitoryIdleTimeoutSec | 0; + if (object.udpIdleTimeoutSec != null) + message.udpIdleTimeoutSec = object.udpIdleTimeoutSec | 0; + return message; + }; + + /** + * Creates a plain object from a RouterNat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterNat + * @static + * @param {google.cloud.compute.v1.RouterNat} message RouterNat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterNat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.natIps = []; + object.subnetworks = []; + object.drainNatIps = []; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.icmpIdleTimeoutSec != null && message.hasOwnProperty("icmpIdleTimeoutSec")) { + object.icmpIdleTimeoutSec = message.icmpIdleTimeoutSec; + if (options.oneofs) + object._icmpIdleTimeoutSec = "icmpIdleTimeoutSec"; + } + if (message.udpIdleTimeoutSec != null && message.hasOwnProperty("udpIdleTimeoutSec")) { + object.udpIdleTimeoutSec = message.udpIdleTimeoutSec; + if (options.oneofs) + object._udpIdleTimeoutSec = "udpIdleTimeoutSec"; + } + if (message.natIps && message.natIps.length) { + object.natIps = []; + for (var j = 0; j < message.natIps.length; ++j) + object.natIps[j] = message.natIps[j]; + } + if (message.minPortsPerVm != null && message.hasOwnProperty("minPortsPerVm")) { + object.minPortsPerVm = message.minPortsPerVm; + if (options.oneofs) + object._minPortsPerVm = "minPortsPerVm"; + } + if (message.tcpTransitoryIdleTimeoutSec != null && message.hasOwnProperty("tcpTransitoryIdleTimeoutSec")) { + object.tcpTransitoryIdleTimeoutSec = message.tcpTransitoryIdleTimeoutSec; + if (options.oneofs) + object._tcpTransitoryIdleTimeoutSec = "tcpTransitoryIdleTimeoutSec"; + } + if (message.tcpEstablishedIdleTimeoutSec != null && message.hasOwnProperty("tcpEstablishedIdleTimeoutSec")) { + object.tcpEstablishedIdleTimeoutSec = message.tcpEstablishedIdleTimeoutSec; + if (options.oneofs) + object._tcpEstablishedIdleTimeoutSec = "tcpEstablishedIdleTimeoutSec"; + } + if (message.sourceSubnetworkIpRangesToNat != null && message.hasOwnProperty("sourceSubnetworkIpRangesToNat")) { + object.sourceSubnetworkIpRangesToNat = options.enums === String ? $root.google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat[message.sourceSubnetworkIpRangesToNat] : message.sourceSubnetworkIpRangesToNat; + if (options.oneofs) + object._sourceSubnetworkIpRangesToNat = "sourceSubnetworkIpRangesToNat"; + } + if (message.enableEndpointIndependentMapping != null && message.hasOwnProperty("enableEndpointIndependentMapping")) { + object.enableEndpointIndependentMapping = message.enableEndpointIndependentMapping; + if (options.oneofs) + object._enableEndpointIndependentMapping = "enableEndpointIndependentMapping"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + object.logConfig = $root.google.cloud.compute.v1.RouterNatLogConfig.toObject(message.logConfig, options); + if (options.oneofs) + object._logConfig = "logConfig"; + } + if (message.subnetworks && message.subnetworks.length) { + object.subnetworks = []; + for (var j = 0; j < message.subnetworks.length; ++j) + object.subnetworks[j] = $root.google.cloud.compute.v1.RouterNatSubnetworkToNat.toObject(message.subnetworks[j], options); + } + if (message.natIpAllocateOption != null && message.hasOwnProperty("natIpAllocateOption")) { + object.natIpAllocateOption = options.enums === String ? $root.google.cloud.compute.v1.RouterNat.NatIpAllocateOption[message.natIpAllocateOption] : message.natIpAllocateOption; + if (options.oneofs) + object._natIpAllocateOption = "natIpAllocateOption"; + } + if (message.drainNatIps && message.drainNatIps.length) { + object.drainNatIps = []; + for (var j = 0; j < message.drainNatIps.length; ++j) + object.drainNatIps[j] = message.drainNatIps[j]; + } + return object; + }; + + /** + * Converts this RouterNat to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterNat + * @instance + * @returns {Object.} JSON object + */ + RouterNat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * NatIpAllocateOption enum. + * @name google.cloud.compute.v1.RouterNat.NatIpAllocateOption + * @enum {number} + * @property {number} UNDEFINED_NAT_IP_ALLOCATE_OPTION=0 UNDEFINED_NAT_IP_ALLOCATE_OPTION value + * @property {number} AUTO_ONLY=182333500 AUTO_ONLY value + * @property {number} MANUAL_ONLY=261251205 MANUAL_ONLY value + */ + RouterNat.NatIpAllocateOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NAT_IP_ALLOCATE_OPTION"] = 0; + values[valuesById[182333500] = "AUTO_ONLY"] = 182333500; + values[valuesById[261251205] = "MANUAL_ONLY"] = 261251205; + return values; + })(); + + /** + * SourceSubnetworkIpRangesToNat enum. + * @name google.cloud.compute.v1.RouterNat.SourceSubnetworkIpRangesToNat + * @enum {number} + * @property {number} UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT=0 UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT value + * @property {number} ALL_SUBNETWORKS_ALL_IP_RANGES=179964376 ALL_SUBNETWORKS_ALL_IP_RANGES value + * @property {number} ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES=185573819 ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES value + * @property {number} LIST_OF_SUBNETWORKS=517542270 LIST_OF_SUBNETWORKS value + */ + RouterNat.SourceSubnetworkIpRangesToNat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT"] = 0; + values[valuesById[179964376] = "ALL_SUBNETWORKS_ALL_IP_RANGES"] = 179964376; + values[valuesById[185573819] = "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES"] = 185573819; + values[valuesById[517542270] = "LIST_OF_SUBNETWORKS"] = 517542270; + return values; + })(); + + return RouterNat; + })(); + + v1.Router = (function() { + + /** + * Properties of a Router. + * @memberof google.cloud.compute.v1 + * @interface IRouter + * @property {google.cloud.compute.v1.IRouterBgp|null} [bgp] Router bgp + * @property {Array.|null} [bgpPeers] Router bgpPeers + * @property {string|null} [creationTimestamp] Router creationTimestamp + * @property {string|null} [description] Router description + * @property {boolean|null} [encryptedInterconnectRouter] Router encryptedInterconnectRouter + * @property {number|Long|null} [id] Router id + * @property {Array.|null} [interfaces] Router interfaces + * @property {string|null} [kind] Router kind + * @property {string|null} [name] Router name + * @property {Array.|null} [nats] Router nats + * @property {string|null} [network] Router network + * @property {string|null} [region] Router region + * @property {string|null} [selfLink] Router selfLink + */ + + /** + * Constructs a new Router. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Router. + * @implements IRouter + * @constructor + * @param {google.cloud.compute.v1.IRouter=} [properties] Properties to set + */ + function Router(properties) { + this.bgpPeers = []; + this.interfaces = []; + this.nats = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Router bgp. + * @member {google.cloud.compute.v1.IRouterBgp|null|undefined} bgp + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.bgp = null; + + /** + * Router bgpPeers. + * @member {Array.} bgpPeers + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.bgpPeers = $util.emptyArray; + + /** + * Router creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.creationTimestamp = null; + + /** + * Router description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.description = null; + + /** + * Router encryptedInterconnectRouter. + * @member {boolean|null|undefined} encryptedInterconnectRouter + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.encryptedInterconnectRouter = null; + + /** + * Router id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.id = null; + + /** + * Router interfaces. + * @member {Array.} interfaces + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.interfaces = $util.emptyArray; + + /** + * Router kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.kind = null; + + /** + * Router name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.name = null; + + /** + * Router nats. + * @member {Array.} nats + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.nats = $util.emptyArray; + + /** + * Router network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.network = null; + + /** + * Router region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.region = null; + + /** + * Router selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Router.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Router _bgp. + * @member {"bgp"|undefined} _bgp + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_bgp", { + get: $util.oneOfGetter($oneOfFields = ["bgp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _encryptedInterconnectRouter. + * @member {"encryptedInterconnectRouter"|undefined} _encryptedInterconnectRouter + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_encryptedInterconnectRouter", { + get: $util.oneOfGetter($oneOfFields = ["encryptedInterconnectRouter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Router _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Router + * @instance + */ + Object.defineProperty(Router.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Router instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Router + * @static + * @param {google.cloud.compute.v1.IRouter=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Router} Router instance + */ + Router.create = function create(properties) { + return new Router(properties); + }; + + /** + * Encodes the specified Router message. Does not implicitly {@link google.cloud.compute.v1.Router.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Router + * @static + * @param {google.cloud.compute.v1.IRouter} message Router message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Router.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.bgp != null && Object.hasOwnProperty.call(message, "bgp")) + $root.google.cloud.compute.v1.RouterBgp.encode(message.bgp, writer.uint32(/* id 97483, wireType 2 =*/779866).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.nats != null && message.nats.length) + for (var i = 0; i < message.nats.length; ++i) + $root.google.cloud.compute.v1.RouterNat.encode(message.nats[i], writer.uint32(/* id 3373938, wireType 2 =*/26991506).fork()).ldelim(); + if (message.interfaces != null && message.interfaces.length) + for (var i = 0; i < message.interfaces.length; ++i) + $root.google.cloud.compute.v1.RouterInterface.encode(message.interfaces[i], writer.uint32(/* id 12073562, wireType 2 =*/96588498).fork()).ldelim(); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.encryptedInterconnectRouter != null && Object.hasOwnProperty.call(message, "encryptedInterconnectRouter")) + writer.uint32(/* id 297996575, wireType 0 =*/2383972600).bool(message.encryptedInterconnectRouter); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.bgpPeers != null && message.bgpPeers.length) + for (var i = 0; i < message.bgpPeers.length; ++i) + $root.google.cloud.compute.v1.RouterBgpPeer.encode(message.bgpPeers[i], writer.uint32(/* id 452695773, wireType 2 =*/3621566186).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified Router message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Router.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Router + * @static + * @param {google.cloud.compute.v1.IRouter} message Router message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Router.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Router message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Router + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Router} Router + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Router.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Router(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 97483: + message.bgp = $root.google.cloud.compute.v1.RouterBgp.decode(reader, reader.uint32()); + break; + case 452695773: + if (!(message.bgpPeers && message.bgpPeers.length)) + message.bgpPeers = []; + message.bgpPeers.push($root.google.cloud.compute.v1.RouterBgpPeer.decode(reader, reader.uint32())); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 297996575: + message.encryptedInterconnectRouter = reader.bool(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 12073562: + if (!(message.interfaces && message.interfaces.length)) + message.interfaces = []; + message.interfaces.push($root.google.cloud.compute.v1.RouterInterface.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 3373938: + if (!(message.nats && message.nats.length)) + message.nats = []; + message.nats.push($root.google.cloud.compute.v1.RouterNat.decode(reader, reader.uint32())); + break; + case 232872494: + message.network = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Router message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Router + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Router} Router + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Router.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Router message. + * @function verify + * @memberof google.cloud.compute.v1.Router + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Router.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bgp != null && message.hasOwnProperty("bgp")) { + properties._bgp = 1; + { + var error = $root.google.cloud.compute.v1.RouterBgp.verify(message.bgp); + if (error) + return "bgp." + error; + } + } + if (message.bgpPeers != null && message.hasOwnProperty("bgpPeers")) { + if (!Array.isArray(message.bgpPeers)) + return "bgpPeers: array expected"; + for (var i = 0; i < message.bgpPeers.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterBgpPeer.verify(message.bgpPeers[i]); + if (error) + return "bgpPeers." + error; + } + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.encryptedInterconnectRouter != null && message.hasOwnProperty("encryptedInterconnectRouter")) { + properties._encryptedInterconnectRouter = 1; + if (typeof message.encryptedInterconnectRouter !== "boolean") + return "encryptedInterconnectRouter: boolean expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.interfaces != null && message.hasOwnProperty("interfaces")) { + if (!Array.isArray(message.interfaces)) + return "interfaces: array expected"; + for (var i = 0; i < message.interfaces.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterInterface.verify(message.interfaces[i]); + if (error) + return "interfaces." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.nats != null && message.hasOwnProperty("nats")) { + if (!Array.isArray(message.nats)) + return "nats: array expected"; + for (var i = 0; i < message.nats.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterNat.verify(message.nats[i]); + if (error) + return "nats." + error; + } + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates a Router message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Router + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Router} Router + */ + Router.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Router) + return object; + var message = new $root.google.cloud.compute.v1.Router(); + if (object.bgp != null) { + if (typeof object.bgp !== "object") + throw TypeError(".google.cloud.compute.v1.Router.bgp: object expected"); + message.bgp = $root.google.cloud.compute.v1.RouterBgp.fromObject(object.bgp); + } + if (object.bgpPeers) { + if (!Array.isArray(object.bgpPeers)) + throw TypeError(".google.cloud.compute.v1.Router.bgpPeers: array expected"); + message.bgpPeers = []; + for (var i = 0; i < object.bgpPeers.length; ++i) { + if (typeof object.bgpPeers[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Router.bgpPeers: object expected"); + message.bgpPeers[i] = $root.google.cloud.compute.v1.RouterBgpPeer.fromObject(object.bgpPeers[i]); + } + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.encryptedInterconnectRouter != null) + message.encryptedInterconnectRouter = Boolean(object.encryptedInterconnectRouter); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.interfaces) { + if (!Array.isArray(object.interfaces)) + throw TypeError(".google.cloud.compute.v1.Router.interfaces: array expected"); + message.interfaces = []; + for (var i = 0; i < object.interfaces.length; ++i) { + if (typeof object.interfaces[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Router.interfaces: object expected"); + message.interfaces[i] = $root.google.cloud.compute.v1.RouterInterface.fromObject(object.interfaces[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.nats) { + if (!Array.isArray(object.nats)) + throw TypeError(".google.cloud.compute.v1.Router.nats: array expected"); + message.nats = []; + for (var i = 0; i < object.nats.length; ++i) { + if (typeof object.nats[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Router.nats: object expected"); + message.nats[i] = $root.google.cloud.compute.v1.RouterNat.fromObject(object.nats[i]); + } + } + if (object.network != null) + message.network = String(object.network); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from a Router message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Router + * @static + * @param {google.cloud.compute.v1.Router} message Router + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Router.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nats = []; + object.interfaces = []; + object.bgpPeers = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.bgp != null && message.hasOwnProperty("bgp")) { + object.bgp = $root.google.cloud.compute.v1.RouterBgp.toObject(message.bgp, options); + if (options.oneofs) + object._bgp = "bgp"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.nats && message.nats.length) { + object.nats = []; + for (var j = 0; j < message.nats.length; ++j) + object.nats[j] = $root.google.cloud.compute.v1.RouterNat.toObject(message.nats[j], options); + } + if (message.interfaces && message.interfaces.length) { + object.interfaces = []; + for (var j = 0; j < message.interfaces.length; ++j) + object.interfaces[j] = $root.google.cloud.compute.v1.RouterInterface.toObject(message.interfaces[j], options); + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.encryptedInterconnectRouter != null && message.hasOwnProperty("encryptedInterconnectRouter")) { + object.encryptedInterconnectRouter = message.encryptedInterconnectRouter; + if (options.oneofs) + object._encryptedInterconnectRouter = "encryptedInterconnectRouter"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.bgpPeers && message.bgpPeers.length) { + object.bgpPeers = []; + for (var j = 0; j < message.bgpPeers.length; ++j) + object.bgpPeers[j] = $root.google.cloud.compute.v1.RouterBgpPeer.toObject(message.bgpPeers[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this Router to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Router + * @instance + * @returns {Object.} JSON object + */ + Router.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Router; + })(); + + v1.RouterAdvertisedIpRange = (function() { + + /** + * Properties of a RouterAdvertisedIpRange. + * @memberof google.cloud.compute.v1 + * @interface IRouterAdvertisedIpRange + * @property {string|null} [description] RouterAdvertisedIpRange description + * @property {string|null} [range] RouterAdvertisedIpRange range + */ + + /** + * Constructs a new RouterAdvertisedIpRange. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterAdvertisedIpRange. + * @implements IRouterAdvertisedIpRange + * @constructor + * @param {google.cloud.compute.v1.IRouterAdvertisedIpRange=} [properties] Properties to set + */ + function RouterAdvertisedIpRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterAdvertisedIpRange description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @instance + */ + RouterAdvertisedIpRange.prototype.description = null; + + /** + * RouterAdvertisedIpRange range. + * @member {string|null|undefined} range + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @instance + */ + RouterAdvertisedIpRange.prototype.range = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterAdvertisedIpRange _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @instance + */ + Object.defineProperty(RouterAdvertisedIpRange.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterAdvertisedIpRange _range. + * @member {"range"|undefined} _range + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @instance + */ + Object.defineProperty(RouterAdvertisedIpRange.prototype, "_range", { + get: $util.oneOfGetter($oneOfFields = ["range"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterAdvertisedIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {google.cloud.compute.v1.IRouterAdvertisedIpRange=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterAdvertisedIpRange} RouterAdvertisedIpRange instance + */ + RouterAdvertisedIpRange.create = function create(properties) { + return new RouterAdvertisedIpRange(properties); + }; + + /** + * Encodes the specified RouterAdvertisedIpRange message. Does not implicitly {@link google.cloud.compute.v1.RouterAdvertisedIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {google.cloud.compute.v1.IRouterAdvertisedIpRange} message RouterAdvertisedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterAdvertisedIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.range != null && Object.hasOwnProperty.call(message, "range")) + writer.uint32(/* id 108280125, wireType 2 =*/866241002).string(message.range); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + return writer; + }; + + /** + * Encodes the specified RouterAdvertisedIpRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterAdvertisedIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {google.cloud.compute.v1.IRouterAdvertisedIpRange} message RouterAdvertisedIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterAdvertisedIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterAdvertisedIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterAdvertisedIpRange} RouterAdvertisedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterAdvertisedIpRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterAdvertisedIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 108280125: + message.range = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterAdvertisedIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterAdvertisedIpRange} RouterAdvertisedIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterAdvertisedIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterAdvertisedIpRange message. + * @function verify + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterAdvertisedIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.range != null && message.hasOwnProperty("range")) { + properties._range = 1; + if (!$util.isString(message.range)) + return "range: string expected"; + } + return null; + }; + + /** + * Creates a RouterAdvertisedIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterAdvertisedIpRange} RouterAdvertisedIpRange + */ + RouterAdvertisedIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterAdvertisedIpRange) + return object; + var message = new $root.google.cloud.compute.v1.RouterAdvertisedIpRange(); + if (object.description != null) + message.description = String(object.description); + if (object.range != null) + message.range = String(object.range); + return message; + }; + + /** + * Creates a plain object from a RouterAdvertisedIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @static + * @param {google.cloud.compute.v1.RouterAdvertisedIpRange} message RouterAdvertisedIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterAdvertisedIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.range != null && message.hasOwnProperty("range")) { + object.range = message.range; + if (options.oneofs) + object._range = "range"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + return object; + }; + + /** + * Converts this RouterAdvertisedIpRange to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterAdvertisedIpRange + * @instance + * @returns {Object.} JSON object + */ + RouterAdvertisedIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RouterAdvertisedIpRange; + })(); + + v1.RoutersScopedList = (function() { + + /** + * Properties of a RoutersScopedList. + * @memberof google.cloud.compute.v1 + * @interface IRoutersScopedList + * @property {Array.|null} [routers] RoutersScopedList routers + * @property {google.cloud.compute.v1.IWarning|null} [warning] RoutersScopedList warning + */ + + /** + * Constructs a new RoutersScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RoutersScopedList. + * @implements IRoutersScopedList + * @constructor + * @param {google.cloud.compute.v1.IRoutersScopedList=} [properties] Properties to set + */ + function RoutersScopedList(properties) { + this.routers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutersScopedList routers. + * @member {Array.} routers + * @memberof google.cloud.compute.v1.RoutersScopedList + * @instance + */ + RoutersScopedList.prototype.routers = $util.emptyArray; + + /** + * RoutersScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RoutersScopedList + * @instance + */ + RoutersScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RoutersScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RoutersScopedList + * @instance + */ + Object.defineProperty(RoutersScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RoutersScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {google.cloud.compute.v1.IRoutersScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RoutersScopedList} RoutersScopedList instance + */ + RoutersScopedList.create = function create(properties) { + return new RoutersScopedList(properties); + }; + + /** + * Encodes the specified RoutersScopedList message. Does not implicitly {@link google.cloud.compute.v1.RoutersScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {google.cloud.compute.v1.IRoutersScopedList} message RoutersScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutersScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.routers != null && message.routers.length) + for (var i = 0; i < message.routers.length; ++i) + $root.google.cloud.compute.v1.Router.encode(message.routers[i], writer.uint32(/* id 311906890, wireType 2 =*/2495255122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutersScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutersScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {google.cloud.compute.v1.IRoutersScopedList} message RoutersScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutersScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutersScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RoutersScopedList} RoutersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutersScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RoutersScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 311906890: + if (!(message.routers && message.routers.length)) + message.routers = []; + message.routers.push($root.google.cloud.compute.v1.Router.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutersScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RoutersScopedList} RoutersScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutersScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutersScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutersScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.routers != null && message.hasOwnProperty("routers")) { + if (!Array.isArray(message.routers)) + return "routers: array expected"; + for (var i = 0; i < message.routers.length; ++i) { + var error = $root.google.cloud.compute.v1.Router.verify(message.routers[i]); + if (error) + return "routers." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RoutersScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RoutersScopedList} RoutersScopedList + */ + RoutersScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RoutersScopedList) + return object; + var message = new $root.google.cloud.compute.v1.RoutersScopedList(); + if (object.routers) { + if (!Array.isArray(object.routers)) + throw TypeError(".google.cloud.compute.v1.RoutersScopedList.routers: array expected"); + message.routers = []; + for (var i = 0; i < object.routers.length; ++i) { + if (typeof object.routers[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RoutersScopedList.routers: object expected"); + message.routers[i] = $root.google.cloud.compute.v1.Router.fromObject(object.routers[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RoutersScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RoutersScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RoutersScopedList + * @static + * @param {google.cloud.compute.v1.RoutersScopedList} message RoutersScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutersScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.routers = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.routers && message.routers.length) { + object.routers = []; + for (var j = 0; j < message.routers.length; ++j) + object.routers[j] = $root.google.cloud.compute.v1.Router.toObject(message.routers[j], options); + } + return object; + }; + + /** + * Converts this RoutersScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RoutersScopedList + * @instance + * @returns {Object.} JSON object + */ + RoutersScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RoutersScopedList; + })(); + + v1.RouterAggregatedList = (function() { + + /** + * Properties of a RouterAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IRouterAggregatedList + * @property {string|null} [id] RouterAggregatedList id + * @property {Object.|null} [items] RouterAggregatedList items + * @property {string|null} [kind] RouterAggregatedList kind + * @property {string|null} [nextPageToken] RouterAggregatedList nextPageToken + * @property {string|null} [selfLink] RouterAggregatedList selfLink + * @property {Array.|null} [unreachables] RouterAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] RouterAggregatedList warning + */ + + /** + * Constructs a new RouterAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterAggregatedList. + * @implements IRouterAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IRouterAggregatedList=} [properties] Properties to set + */ + function RouterAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + RouterAggregatedList.prototype.id = null; + + /** + * RouterAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + RouterAggregatedList.prototype.items = $util.emptyObject; + + /** + * RouterAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + RouterAggregatedList.prototype.kind = null; + + /** + * RouterAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + RouterAggregatedList.prototype.nextPageToken = null; + + /** + * RouterAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + RouterAggregatedList.prototype.selfLink = null; + + /** + * RouterAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + RouterAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * RouterAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + RouterAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + Object.defineProperty(RouterAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + Object.defineProperty(RouterAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + Object.defineProperty(RouterAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + Object.defineProperty(RouterAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + */ + Object.defineProperty(RouterAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {google.cloud.compute.v1.IRouterAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterAggregatedList} RouterAggregatedList instance + */ + RouterAggregatedList.create = function create(properties) { + return new RouterAggregatedList(properties); + }; + + /** + * Encodes the specified RouterAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.RouterAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {google.cloud.compute.v1.IRouterAggregatedList} message RouterAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.RoutersScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RouterAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {google.cloud.compute.v1.IRouterAggregatedList} message RouterAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterAggregatedList} RouterAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.RoutersScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterAggregatedList} RouterAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.RoutersScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RouterAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterAggregatedList} RouterAggregatedList + */ + RouterAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.RouterAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.RouterAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.RoutersScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.RouterAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RouterAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RouterAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @static + * @param {google.cloud.compute.v1.RouterAggregatedList} message RouterAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.RoutersScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RouterAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterAggregatedList + * @instance + * @returns {Object.} JSON object + */ + RouterAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RouterAggregatedList; + })(); + + v1.RouterList = (function() { + + /** + * Properties of a RouterList. + * @memberof google.cloud.compute.v1 + * @interface IRouterList + * @property {string|null} [id] RouterList id + * @property {Array.|null} [items] RouterList items + * @property {string|null} [kind] RouterList kind + * @property {string|null} [nextPageToken] RouterList nextPageToken + * @property {string|null} [selfLink] RouterList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] RouterList warning + */ + + /** + * Constructs a new RouterList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterList. + * @implements IRouterList + * @constructor + * @param {google.cloud.compute.v1.IRouterList=} [properties] Properties to set + */ + function RouterList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + RouterList.prototype.id = null; + + /** + * RouterList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + RouterList.prototype.items = $util.emptyArray; + + /** + * RouterList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + RouterList.prototype.kind = null; + + /** + * RouterList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + RouterList.prototype.nextPageToken = null; + + /** + * RouterList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + RouterList.prototype.selfLink = null; + + /** + * RouterList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + RouterList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + Object.defineProperty(RouterList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + Object.defineProperty(RouterList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + Object.defineProperty(RouterList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + Object.defineProperty(RouterList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.RouterList + * @instance + */ + Object.defineProperty(RouterList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {google.cloud.compute.v1.IRouterList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterList} RouterList instance + */ + RouterList.create = function create(properties) { + return new RouterList(properties); + }; + + /** + * Encodes the specified RouterList message. Does not implicitly {@link google.cloud.compute.v1.RouterList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {google.cloud.compute.v1.IRouterList} message RouterList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Router.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified RouterList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {google.cloud.compute.v1.IRouterList} message RouterList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterList} RouterList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Router.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterList} RouterList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterList message. + * @function verify + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Router.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a RouterList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterList} RouterList + */ + RouterList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterList) + return object; + var message = new $root.google.cloud.compute.v1.RouterList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.RouterList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Router.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.RouterList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a RouterList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterList + * @static + * @param {google.cloud.compute.v1.RouterList} message RouterList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Router.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this RouterList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterList + * @instance + * @returns {Object.} JSON object + */ + RouterList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RouterList; + })(); + + v1.RouterNatLogConfig = (function() { + + /** + * Properties of a RouterNatLogConfig. + * @memberof google.cloud.compute.v1 + * @interface IRouterNatLogConfig + * @property {boolean|null} [enable] RouterNatLogConfig enable + * @property {google.cloud.compute.v1.RouterNatLogConfig.Filter|null} [filter] RouterNatLogConfig filter + */ + + /** + * Constructs a new RouterNatLogConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterNatLogConfig. + * @implements IRouterNatLogConfig + * @constructor + * @param {google.cloud.compute.v1.IRouterNatLogConfig=} [properties] Properties to set + */ + function RouterNatLogConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterNatLogConfig enable. + * @member {boolean|null|undefined} enable + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @instance + */ + RouterNatLogConfig.prototype.enable = null; + + /** + * RouterNatLogConfig filter. + * @member {google.cloud.compute.v1.RouterNatLogConfig.Filter|null|undefined} filter + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @instance + */ + RouterNatLogConfig.prototype.filter = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterNatLogConfig _enable. + * @member {"enable"|undefined} _enable + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @instance + */ + Object.defineProperty(RouterNatLogConfig.prototype, "_enable", { + get: $util.oneOfGetter($oneOfFields = ["enable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterNatLogConfig _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @instance + */ + Object.defineProperty(RouterNatLogConfig.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterNatLogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {google.cloud.compute.v1.IRouterNatLogConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterNatLogConfig} RouterNatLogConfig instance + */ + RouterNatLogConfig.create = function create(properties) { + return new RouterNatLogConfig(properties); + }; + + /** + * Encodes the specified RouterNatLogConfig message. Does not implicitly {@link google.cloud.compute.v1.RouterNatLogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {google.cloud.compute.v1.IRouterNatLogConfig} message RouterNatLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterNatLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enable != null && Object.hasOwnProperty.call(message, "enable")) + writer.uint32(/* id 311764355, wireType 0 =*/2494114840).bool(message.enable); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 0 =*/2688965568).int32(message.filter); + return writer; + }; + + /** + * Encodes the specified RouterNatLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterNatLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {google.cloud.compute.v1.IRouterNatLogConfig} message RouterNatLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterNatLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterNatLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterNatLogConfig} RouterNatLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterNatLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterNatLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 311764355: + message.enable = reader.bool(); + break; + case 336120696: + message.filter = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterNatLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterNatLogConfig} RouterNatLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterNatLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterNatLogConfig message. + * @function verify + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterNatLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enable != null && message.hasOwnProperty("enable")) { + properties._enable = 1; + if (typeof message.enable !== "boolean") + return "enable: boolean expected"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + switch (message.filter) { + default: + return "filter: enum value expected"; + case 0: + case 64897: + case 307484672: + case 357212649: + break; + } + } + return null; + }; + + /** + * Creates a RouterNatLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterNatLogConfig} RouterNatLogConfig + */ + RouterNatLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterNatLogConfig) + return object; + var message = new $root.google.cloud.compute.v1.RouterNatLogConfig(); + if (object.enable != null) + message.enable = Boolean(object.enable); + switch (object.filter) { + case "UNDEFINED_FILTER": + case 0: + message.filter = 0; + break; + case "ALL": + case 64897: + message.filter = 64897; + break; + case "ERRORS_ONLY": + case 307484672: + message.filter = 307484672; + break; + case "TRANSLATIONS_ONLY": + case 357212649: + message.filter = 357212649; + break; + } + return message; + }; + + /** + * Creates a plain object from a RouterNatLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @static + * @param {google.cloud.compute.v1.RouterNatLogConfig} message RouterNatLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterNatLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enable != null && message.hasOwnProperty("enable")) { + object.enable = message.enable; + if (options.oneofs) + object._enable = "enable"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = options.enums === String ? $root.google.cloud.compute.v1.RouterNatLogConfig.Filter[message.filter] : message.filter; + if (options.oneofs) + object._filter = "filter"; + } + return object; + }; + + /** + * Converts this RouterNatLogConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterNatLogConfig + * @instance + * @returns {Object.} JSON object + */ + RouterNatLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Filter enum. + * @name google.cloud.compute.v1.RouterNatLogConfig.Filter + * @enum {number} + * @property {number} UNDEFINED_FILTER=0 UNDEFINED_FILTER value + * @property {number} ALL=64897 ALL value + * @property {number} ERRORS_ONLY=307484672 ERRORS_ONLY value + * @property {number} TRANSLATIONS_ONLY=357212649 TRANSLATIONS_ONLY value + */ + RouterNatLogConfig.Filter = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_FILTER"] = 0; + values[valuesById[64897] = "ALL"] = 64897; + values[valuesById[307484672] = "ERRORS_ONLY"] = 307484672; + values[valuesById[357212649] = "TRANSLATIONS_ONLY"] = 357212649; + return values; + })(); + + return RouterNatLogConfig; + })(); + + v1.RouterNatSubnetworkToNat = (function() { + + /** + * Properties of a RouterNatSubnetworkToNat. + * @memberof google.cloud.compute.v1 + * @interface IRouterNatSubnetworkToNat + * @property {string|null} [name] RouterNatSubnetworkToNat name + * @property {Array.|null} [secondaryIpRangeNames] RouterNatSubnetworkToNat secondaryIpRangeNames + * @property {Array.|null} [sourceIpRangesToNat] RouterNatSubnetworkToNat sourceIpRangesToNat + */ + + /** + * Constructs a new RouterNatSubnetworkToNat. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterNatSubnetworkToNat. + * @implements IRouterNatSubnetworkToNat + * @constructor + * @param {google.cloud.compute.v1.IRouterNatSubnetworkToNat=} [properties] Properties to set + */ + function RouterNatSubnetworkToNat(properties) { + this.secondaryIpRangeNames = []; + this.sourceIpRangesToNat = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterNatSubnetworkToNat name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @instance + */ + RouterNatSubnetworkToNat.prototype.name = null; + + /** + * RouterNatSubnetworkToNat secondaryIpRangeNames. + * @member {Array.} secondaryIpRangeNames + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @instance + */ + RouterNatSubnetworkToNat.prototype.secondaryIpRangeNames = $util.emptyArray; + + /** + * RouterNatSubnetworkToNat sourceIpRangesToNat. + * @member {Array.} sourceIpRangesToNat + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @instance + */ + RouterNatSubnetworkToNat.prototype.sourceIpRangesToNat = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterNatSubnetworkToNat _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @instance + */ + Object.defineProperty(RouterNatSubnetworkToNat.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterNatSubnetworkToNat instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {google.cloud.compute.v1.IRouterNatSubnetworkToNat=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterNatSubnetworkToNat} RouterNatSubnetworkToNat instance + */ + RouterNatSubnetworkToNat.create = function create(properties) { + return new RouterNatSubnetworkToNat(properties); + }; + + /** + * Encodes the specified RouterNatSubnetworkToNat message. Does not implicitly {@link google.cloud.compute.v1.RouterNatSubnetworkToNat.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {google.cloud.compute.v1.IRouterNatSubnetworkToNat} message RouterNatSubnetworkToNat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterNatSubnetworkToNat.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.secondaryIpRangeNames != null && message.secondaryIpRangeNames.length) + for (var i = 0; i < message.secondaryIpRangeNames.length; ++i) + writer.uint32(/* id 264315097, wireType 2 =*/2114520778).string(message.secondaryIpRangeNames[i]); + if (message.sourceIpRangesToNat != null && message.sourceIpRangesToNat.length) { + writer.uint32(/* id 388310386, wireType 2 =*/3106483090).fork(); + for (var i = 0; i < message.sourceIpRangesToNat.length; ++i) + writer.int32(message.sourceIpRangesToNat[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified RouterNatSubnetworkToNat message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterNatSubnetworkToNat.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {google.cloud.compute.v1.IRouterNatSubnetworkToNat} message RouterNatSubnetworkToNat message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterNatSubnetworkToNat.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterNatSubnetworkToNat message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterNatSubnetworkToNat} RouterNatSubnetworkToNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterNatSubnetworkToNat.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterNatSubnetworkToNat(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + case 264315097: + if (!(message.secondaryIpRangeNames && message.secondaryIpRangeNames.length)) + message.secondaryIpRangeNames = []; + message.secondaryIpRangeNames.push(reader.string()); + break; + case 388310386: + if (!(message.sourceIpRangesToNat && message.sourceIpRangesToNat.length)) + message.sourceIpRangesToNat = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.sourceIpRangesToNat.push(reader.int32()); + } else + message.sourceIpRangesToNat.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterNatSubnetworkToNat message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterNatSubnetworkToNat} RouterNatSubnetworkToNat + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterNatSubnetworkToNat.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterNatSubnetworkToNat message. + * @function verify + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterNatSubnetworkToNat.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.secondaryIpRangeNames != null && message.hasOwnProperty("secondaryIpRangeNames")) { + if (!Array.isArray(message.secondaryIpRangeNames)) + return "secondaryIpRangeNames: array expected"; + for (var i = 0; i < message.secondaryIpRangeNames.length; ++i) + if (!$util.isString(message.secondaryIpRangeNames[i])) + return "secondaryIpRangeNames: string[] expected"; + } + if (message.sourceIpRangesToNat != null && message.hasOwnProperty("sourceIpRangesToNat")) { + if (!Array.isArray(message.sourceIpRangesToNat)) + return "sourceIpRangesToNat: array expected"; + for (var i = 0; i < message.sourceIpRangesToNat.length; ++i) + switch (message.sourceIpRangesToNat[i]) { + default: + return "sourceIpRangesToNat: enum value[] expected"; + case 0: + case 35608496: + case 192289308: + case 297109954: + break; + } + } + return null; + }; + + /** + * Creates a RouterNatSubnetworkToNat message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterNatSubnetworkToNat} RouterNatSubnetworkToNat + */ + RouterNatSubnetworkToNat.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterNatSubnetworkToNat) + return object; + var message = new $root.google.cloud.compute.v1.RouterNatSubnetworkToNat(); + if (object.name != null) + message.name = String(object.name); + if (object.secondaryIpRangeNames) { + if (!Array.isArray(object.secondaryIpRangeNames)) + throw TypeError(".google.cloud.compute.v1.RouterNatSubnetworkToNat.secondaryIpRangeNames: array expected"); + message.secondaryIpRangeNames = []; + for (var i = 0; i < object.secondaryIpRangeNames.length; ++i) + message.secondaryIpRangeNames[i] = String(object.secondaryIpRangeNames[i]); + } + if (object.sourceIpRangesToNat) { + if (!Array.isArray(object.sourceIpRangesToNat)) + throw TypeError(".google.cloud.compute.v1.RouterNatSubnetworkToNat.sourceIpRangesToNat: array expected"); + message.sourceIpRangesToNat = []; + for (var i = 0; i < object.sourceIpRangesToNat.length; ++i) + switch (object.sourceIpRangesToNat[i]) { + default: + case "UNDEFINED_SOURCE_IP_RANGES_TO_NAT": + case 0: + message.sourceIpRangesToNat[i] = 0; + break; + case "ALL_IP_RANGES": + case 35608496: + message.sourceIpRangesToNat[i] = 35608496; + break; + case "LIST_OF_SECONDARY_IP_RANGES": + case 192289308: + message.sourceIpRangesToNat[i] = 192289308; + break; + case "PRIMARY_IP_RANGE": + case 297109954: + message.sourceIpRangesToNat[i] = 297109954; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a RouterNatSubnetworkToNat message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @static + * @param {google.cloud.compute.v1.RouterNatSubnetworkToNat} message RouterNatSubnetworkToNat + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterNatSubnetworkToNat.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.secondaryIpRangeNames = []; + object.sourceIpRangesToNat = []; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.secondaryIpRangeNames && message.secondaryIpRangeNames.length) { + object.secondaryIpRangeNames = []; + for (var j = 0; j < message.secondaryIpRangeNames.length; ++j) + object.secondaryIpRangeNames[j] = message.secondaryIpRangeNames[j]; + } + if (message.sourceIpRangesToNat && message.sourceIpRangesToNat.length) { + object.sourceIpRangesToNat = []; + for (var j = 0; j < message.sourceIpRangesToNat.length; ++j) + object.sourceIpRangesToNat[j] = options.enums === String ? $root.google.cloud.compute.v1.RouterNatSubnetworkToNat.SourceIpRangesToNat[message.sourceIpRangesToNat[j]] : message.sourceIpRangesToNat[j]; + } + return object; + }; + + /** + * Converts this RouterNatSubnetworkToNat to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterNatSubnetworkToNat + * @instance + * @returns {Object.} JSON object + */ + RouterNatSubnetworkToNat.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SourceIpRangesToNat enum. + * @name google.cloud.compute.v1.RouterNatSubnetworkToNat.SourceIpRangesToNat + * @enum {number} + * @property {number} UNDEFINED_SOURCE_IP_RANGES_TO_NAT=0 UNDEFINED_SOURCE_IP_RANGES_TO_NAT value + * @property {number} ALL_IP_RANGES=35608496 ALL_IP_RANGES value + * @property {number} LIST_OF_SECONDARY_IP_RANGES=192289308 LIST_OF_SECONDARY_IP_RANGES value + * @property {number} PRIMARY_IP_RANGE=297109954 PRIMARY_IP_RANGE value + */ + RouterNatSubnetworkToNat.SourceIpRangesToNat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_SOURCE_IP_RANGES_TO_NAT"] = 0; + values[valuesById[35608496] = "ALL_IP_RANGES"] = 35608496; + values[valuesById[192289308] = "LIST_OF_SECONDARY_IP_RANGES"] = 192289308; + values[valuesById[297109954] = "PRIMARY_IP_RANGE"] = 297109954; + return values; + })(); + + return RouterNatSubnetworkToNat; + })(); + + v1.RouterStatusBgpPeerStatus = (function() { + + /** + * Properties of a RouterStatusBgpPeerStatus. + * @memberof google.cloud.compute.v1 + * @interface IRouterStatusBgpPeerStatus + * @property {Array.|null} [advertisedRoutes] RouterStatusBgpPeerStatus advertisedRoutes + * @property {string|null} [ipAddress] RouterStatusBgpPeerStatus ipAddress + * @property {string|null} [linkedVpnTunnel] RouterStatusBgpPeerStatus linkedVpnTunnel + * @property {string|null} [name] RouterStatusBgpPeerStatus name + * @property {number|null} [numLearnedRoutes] RouterStatusBgpPeerStatus numLearnedRoutes + * @property {string|null} [peerIpAddress] RouterStatusBgpPeerStatus peerIpAddress + * @property {string|null} [state] RouterStatusBgpPeerStatus state + * @property {google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status|null} [status] RouterStatusBgpPeerStatus status + * @property {string|null} [uptime] RouterStatusBgpPeerStatus uptime + * @property {string|null} [uptimeSeconds] RouterStatusBgpPeerStatus uptimeSeconds + */ + + /** + * Constructs a new RouterStatusBgpPeerStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterStatusBgpPeerStatus. + * @implements IRouterStatusBgpPeerStatus + * @constructor + * @param {google.cloud.compute.v1.IRouterStatusBgpPeerStatus=} [properties] Properties to set + */ + function RouterStatusBgpPeerStatus(properties) { + this.advertisedRoutes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterStatusBgpPeerStatus advertisedRoutes. + * @member {Array.} advertisedRoutes + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.advertisedRoutes = $util.emptyArray; + + /** + * RouterStatusBgpPeerStatus ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.ipAddress = null; + + /** + * RouterStatusBgpPeerStatus linkedVpnTunnel. + * @member {string|null|undefined} linkedVpnTunnel + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.linkedVpnTunnel = null; + + /** + * RouterStatusBgpPeerStatus name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.name = null; + + /** + * RouterStatusBgpPeerStatus numLearnedRoutes. + * @member {number|null|undefined} numLearnedRoutes + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.numLearnedRoutes = null; + + /** + * RouterStatusBgpPeerStatus peerIpAddress. + * @member {string|null|undefined} peerIpAddress + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.peerIpAddress = null; + + /** + * RouterStatusBgpPeerStatus state. + * @member {string|null|undefined} state + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.state = null; + + /** + * RouterStatusBgpPeerStatus status. + * @member {google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status|null|undefined} status + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.status = null; + + /** + * RouterStatusBgpPeerStatus uptime. + * @member {string|null|undefined} uptime + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.uptime = null; + + /** + * RouterStatusBgpPeerStatus uptimeSeconds. + * @member {string|null|undefined} uptimeSeconds + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + RouterStatusBgpPeerStatus.prototype.uptimeSeconds = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterStatusBgpPeerStatus _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _linkedVpnTunnel. + * @member {"linkedVpnTunnel"|undefined} _linkedVpnTunnel + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_linkedVpnTunnel", { + get: $util.oneOfGetter($oneOfFields = ["linkedVpnTunnel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _numLearnedRoutes. + * @member {"numLearnedRoutes"|undefined} _numLearnedRoutes + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_numLearnedRoutes", { + get: $util.oneOfGetter($oneOfFields = ["numLearnedRoutes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _peerIpAddress. + * @member {"peerIpAddress"|undefined} _peerIpAddress + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_peerIpAddress", { + get: $util.oneOfGetter($oneOfFields = ["peerIpAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _uptime. + * @member {"uptime"|undefined} _uptime + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_uptime", { + get: $util.oneOfGetter($oneOfFields = ["uptime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusBgpPeerStatus _uptimeSeconds. + * @member {"uptimeSeconds"|undefined} _uptimeSeconds + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + */ + Object.defineProperty(RouterStatusBgpPeerStatus.prototype, "_uptimeSeconds", { + get: $util.oneOfGetter($oneOfFields = ["uptimeSeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterStatusBgpPeerStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatusBgpPeerStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterStatusBgpPeerStatus} RouterStatusBgpPeerStatus instance + */ + RouterStatusBgpPeerStatus.create = function create(properties) { + return new RouterStatusBgpPeerStatus(properties); + }; + + /** + * Encodes the specified RouterStatusBgpPeerStatus message. Does not implicitly {@link google.cloud.compute.v1.RouterStatusBgpPeerStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatusBgpPeerStatus} message RouterStatusBgpPeerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatusBgpPeerStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.uptimeSeconds != null && Object.hasOwnProperty.call(message, "uptimeSeconds")) + writer.uint32(/* id 104736040, wireType 2 =*/837888322).string(message.uptimeSeconds); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 2 =*/878060682).string(message.state); + if (message.numLearnedRoutes != null && Object.hasOwnProperty.call(message, "numLearnedRoutes")) + writer.uint32(/* id 135457535, wireType 0 =*/1083660280).uint32(message.numLearnedRoutes); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.peerIpAddress != null && Object.hasOwnProperty.call(message, "peerIpAddress")) + writer.uint32(/* id 207735769, wireType 2 =*/1661886154).string(message.peerIpAddress); + if (message.uptime != null && Object.hasOwnProperty.call(message, "uptime")) + writer.uint32(/* id 235379688, wireType 2 =*/1883037506).string(message.uptime); + if (message.advertisedRoutes != null && message.advertisedRoutes.length) + for (var i = 0; i < message.advertisedRoutes.length; ++i) + $root.google.cloud.compute.v1.Route.encode(message.advertisedRoutes[i], writer.uint32(/* id 333393068, wireType 2 =*/2667144546).fork()).ldelim(); + if (message.linkedVpnTunnel != null && Object.hasOwnProperty.call(message, "linkedVpnTunnel")) + writer.uint32(/* id 352296953, wireType 2 =*/2818375626).string(message.linkedVpnTunnel); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 406272220, wireType 2 =*/3250177762).string(message.ipAddress); + return writer; + }; + + /** + * Encodes the specified RouterStatusBgpPeerStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatusBgpPeerStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatusBgpPeerStatus} message RouterStatusBgpPeerStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatusBgpPeerStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterStatusBgpPeerStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterStatusBgpPeerStatus} RouterStatusBgpPeerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatusBgpPeerStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 333393068: + if (!(message.advertisedRoutes && message.advertisedRoutes.length)) + message.advertisedRoutes = []; + message.advertisedRoutes.push($root.google.cloud.compute.v1.Route.decode(reader, reader.uint32())); + break; + case 406272220: + message.ipAddress = reader.string(); + break; + case 352296953: + message.linkedVpnTunnel = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 135457535: + message.numLearnedRoutes = reader.uint32(); + break; + case 207735769: + message.peerIpAddress = reader.string(); + break; + case 109757585: + message.state = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 235379688: + message.uptime = reader.string(); + break; + case 104736040: + message.uptimeSeconds = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterStatusBgpPeerStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterStatusBgpPeerStatus} RouterStatusBgpPeerStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatusBgpPeerStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterStatusBgpPeerStatus message. + * @function verify + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterStatusBgpPeerStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.advertisedRoutes != null && message.hasOwnProperty("advertisedRoutes")) { + if (!Array.isArray(message.advertisedRoutes)) + return "advertisedRoutes: array expected"; + for (var i = 0; i < message.advertisedRoutes.length; ++i) { + var error = $root.google.cloud.compute.v1.Route.verify(message.advertisedRoutes[i]); + if (error) + return "advertisedRoutes." + error; + } + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.linkedVpnTunnel != null && message.hasOwnProperty("linkedVpnTunnel")) { + properties._linkedVpnTunnel = 1; + if (!$util.isString(message.linkedVpnTunnel)) + return "linkedVpnTunnel: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.numLearnedRoutes != null && message.hasOwnProperty("numLearnedRoutes")) { + properties._numLearnedRoutes = 1; + if (!$util.isInteger(message.numLearnedRoutes)) + return "numLearnedRoutes: integer expected"; + } + if (message.peerIpAddress != null && message.hasOwnProperty("peerIpAddress")) { + properties._peerIpAddress = 1; + if (!$util.isString(message.peerIpAddress)) + return "peerIpAddress: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + if (!$util.isString(message.state)) + return "state: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 2104482: + case 433141802: + case 2715: + break; + } + } + if (message.uptime != null && message.hasOwnProperty("uptime")) { + properties._uptime = 1; + if (!$util.isString(message.uptime)) + return "uptime: string expected"; + } + if (message.uptimeSeconds != null && message.hasOwnProperty("uptimeSeconds")) { + properties._uptimeSeconds = 1; + if (!$util.isString(message.uptimeSeconds)) + return "uptimeSeconds: string expected"; + } + return null; + }; + + /** + * Creates a RouterStatusBgpPeerStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterStatusBgpPeerStatus} RouterStatusBgpPeerStatus + */ + RouterStatusBgpPeerStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus) + return object; + var message = new $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus(); + if (object.advertisedRoutes) { + if (!Array.isArray(object.advertisedRoutes)) + throw TypeError(".google.cloud.compute.v1.RouterStatusBgpPeerStatus.advertisedRoutes: array expected"); + message.advertisedRoutes = []; + for (var i = 0; i < object.advertisedRoutes.length; ++i) { + if (typeof object.advertisedRoutes[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterStatusBgpPeerStatus.advertisedRoutes: object expected"); + message.advertisedRoutes[i] = $root.google.cloud.compute.v1.Route.fromObject(object.advertisedRoutes[i]); + } + } + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.linkedVpnTunnel != null) + message.linkedVpnTunnel = String(object.linkedVpnTunnel); + if (object.name != null) + message.name = String(object.name); + if (object.numLearnedRoutes != null) + message.numLearnedRoutes = object.numLearnedRoutes >>> 0; + if (object.peerIpAddress != null) + message.peerIpAddress = String(object.peerIpAddress); + if (object.state != null) + message.state = String(object.state); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "DOWN": + case 2104482: + message.status = 2104482; + break; + case "UNKNOWN": + case 433141802: + message.status = 433141802; + break; + case "UP": + case 2715: + message.status = 2715; + break; + } + if (object.uptime != null) + message.uptime = String(object.uptime); + if (object.uptimeSeconds != null) + message.uptimeSeconds = String(object.uptimeSeconds); + return message; + }; + + /** + * Creates a plain object from a RouterStatusBgpPeerStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @static + * @param {google.cloud.compute.v1.RouterStatusBgpPeerStatus} message RouterStatusBgpPeerStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterStatusBgpPeerStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.advertisedRoutes = []; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.uptimeSeconds != null && message.hasOwnProperty("uptimeSeconds")) { + object.uptimeSeconds = message.uptimeSeconds; + if (options.oneofs) + object._uptimeSeconds = "uptimeSeconds"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.numLearnedRoutes != null && message.hasOwnProperty("numLearnedRoutes")) { + object.numLearnedRoutes = message.numLearnedRoutes; + if (options.oneofs) + object._numLearnedRoutes = "numLearnedRoutes"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.peerIpAddress != null && message.hasOwnProperty("peerIpAddress")) { + object.peerIpAddress = message.peerIpAddress; + if (options.oneofs) + object._peerIpAddress = "peerIpAddress"; + } + if (message.uptime != null && message.hasOwnProperty("uptime")) { + object.uptime = message.uptime; + if (options.oneofs) + object._uptime = "uptime"; + } + if (message.advertisedRoutes && message.advertisedRoutes.length) { + object.advertisedRoutes = []; + for (var j = 0; j < message.advertisedRoutes.length; ++j) + object.advertisedRoutes[j] = $root.google.cloud.compute.v1.Route.toObject(message.advertisedRoutes[j], options); + } + if (message.linkedVpnTunnel != null && message.hasOwnProperty("linkedVpnTunnel")) { + object.linkedVpnTunnel = message.linkedVpnTunnel; + if (options.oneofs) + object._linkedVpnTunnel = "linkedVpnTunnel"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + return object; + }; + + /** + * Converts this RouterStatusBgpPeerStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterStatusBgpPeerStatus + * @instance + * @returns {Object.} JSON object + */ + RouterStatusBgpPeerStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.RouterStatusBgpPeerStatus.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} DOWN=2104482 DOWN value + * @property {number} UNKNOWN=433141802 UNKNOWN value + * @property {number} UP=2715 UP value + */ + RouterStatusBgpPeerStatus.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[2104482] = "DOWN"] = 2104482; + values[valuesById[433141802] = "UNKNOWN"] = 433141802; + values[valuesById[2715] = "UP"] = 2715; + return values; + })(); + + return RouterStatusBgpPeerStatus; + })(); + + v1.RouterStatusNatStatus = (function() { + + /** + * Properties of a RouterStatusNatStatus. + * @memberof google.cloud.compute.v1 + * @interface IRouterStatusNatStatus + * @property {Array.|null} [autoAllocatedNatIps] RouterStatusNatStatus autoAllocatedNatIps + * @property {Array.|null} [drainAutoAllocatedNatIps] RouterStatusNatStatus drainAutoAllocatedNatIps + * @property {Array.|null} [drainUserAllocatedNatIps] RouterStatusNatStatus drainUserAllocatedNatIps + * @property {number|null} [minExtraNatIpsNeeded] RouterStatusNatStatus minExtraNatIpsNeeded + * @property {string|null} [name] RouterStatusNatStatus name + * @property {number|null} [numVmEndpointsWithNatMappings] RouterStatusNatStatus numVmEndpointsWithNatMappings + * @property {Array.|null} [userAllocatedNatIpResources] RouterStatusNatStatus userAllocatedNatIpResources + * @property {Array.|null} [userAllocatedNatIps] RouterStatusNatStatus userAllocatedNatIps + */ + + /** + * Constructs a new RouterStatusNatStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterStatusNatStatus. + * @implements IRouterStatusNatStatus + * @constructor + * @param {google.cloud.compute.v1.IRouterStatusNatStatus=} [properties] Properties to set + */ + function RouterStatusNatStatus(properties) { + this.autoAllocatedNatIps = []; + this.drainAutoAllocatedNatIps = []; + this.drainUserAllocatedNatIps = []; + this.userAllocatedNatIpResources = []; + this.userAllocatedNatIps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterStatusNatStatus autoAllocatedNatIps. + * @member {Array.} autoAllocatedNatIps + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.autoAllocatedNatIps = $util.emptyArray; + + /** + * RouterStatusNatStatus drainAutoAllocatedNatIps. + * @member {Array.} drainAutoAllocatedNatIps + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.drainAutoAllocatedNatIps = $util.emptyArray; + + /** + * RouterStatusNatStatus drainUserAllocatedNatIps. + * @member {Array.} drainUserAllocatedNatIps + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.drainUserAllocatedNatIps = $util.emptyArray; + + /** + * RouterStatusNatStatus minExtraNatIpsNeeded. + * @member {number|null|undefined} minExtraNatIpsNeeded + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.minExtraNatIpsNeeded = null; + + /** + * RouterStatusNatStatus name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.name = null; + + /** + * RouterStatusNatStatus numVmEndpointsWithNatMappings. + * @member {number|null|undefined} numVmEndpointsWithNatMappings + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.numVmEndpointsWithNatMappings = null; + + /** + * RouterStatusNatStatus userAllocatedNatIpResources. + * @member {Array.} userAllocatedNatIpResources + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.userAllocatedNatIpResources = $util.emptyArray; + + /** + * RouterStatusNatStatus userAllocatedNatIps. + * @member {Array.} userAllocatedNatIps + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + RouterStatusNatStatus.prototype.userAllocatedNatIps = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterStatusNatStatus _minExtraNatIpsNeeded. + * @member {"minExtraNatIpsNeeded"|undefined} _minExtraNatIpsNeeded + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + Object.defineProperty(RouterStatusNatStatus.prototype, "_minExtraNatIpsNeeded", { + get: $util.oneOfGetter($oneOfFields = ["minExtraNatIpsNeeded"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusNatStatus _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + Object.defineProperty(RouterStatusNatStatus.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusNatStatus _numVmEndpointsWithNatMappings. + * @member {"numVmEndpointsWithNatMappings"|undefined} _numVmEndpointsWithNatMappings + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + */ + Object.defineProperty(RouterStatusNatStatus.prototype, "_numVmEndpointsWithNatMappings", { + get: $util.oneOfGetter($oneOfFields = ["numVmEndpointsWithNatMappings"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterStatusNatStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatusNatStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterStatusNatStatus} RouterStatusNatStatus instance + */ + RouterStatusNatStatus.create = function create(properties) { + return new RouterStatusNatStatus(properties); + }; + + /** + * Encodes the specified RouterStatusNatStatus message. Does not implicitly {@link google.cloud.compute.v1.RouterStatusNatStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatusNatStatus} message RouterStatusNatStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatusNatStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.userAllocatedNatIpResources != null && message.userAllocatedNatIpResources.length) + for (var i = 0; i < message.userAllocatedNatIpResources.length; ++i) + writer.uint32(/* id 212776151, wireType 2 =*/1702209210).string(message.userAllocatedNatIpResources[i]); + if (message.drainUserAllocatedNatIps != null && message.drainUserAllocatedNatIps.length) + for (var i = 0; i < message.drainUserAllocatedNatIps.length; ++i) + writer.uint32(/* id 305268553, wireType 2 =*/2442148426).string(message.drainUserAllocatedNatIps[i]); + if (message.drainAutoAllocatedNatIps != null && message.drainAutoAllocatedNatIps.length) + for (var i = 0; i < message.drainAutoAllocatedNatIps.length; ++i) + writer.uint32(/* id 309184557, wireType 2 =*/2473476458).string(message.drainAutoAllocatedNatIps[i]); + if (message.minExtraNatIpsNeeded != null && Object.hasOwnProperty.call(message, "minExtraNatIpsNeeded")) + writer.uint32(/* id 365786338, wireType 0 =*/2926290704).int32(message.minExtraNatIpsNeeded); + if (message.userAllocatedNatIps != null && message.userAllocatedNatIps.length) + for (var i = 0; i < message.userAllocatedNatIps.length; ++i) + writer.uint32(/* id 506878242, wireType 2 =*/4055025938).string(message.userAllocatedNatIps[i]); + if (message.autoAllocatedNatIps != null && message.autoAllocatedNatIps.length) + for (var i = 0; i < message.autoAllocatedNatIps.length; ++i) + writer.uint32(/* id 510794246, wireType 2 =*/4086353970).string(message.autoAllocatedNatIps[i]); + if (message.numVmEndpointsWithNatMappings != null && Object.hasOwnProperty.call(message, "numVmEndpointsWithNatMappings")) + writer.uint32(/* id 512367468, wireType 0 =*/4098939744).int32(message.numVmEndpointsWithNatMappings); + return writer; + }; + + /** + * Encodes the specified RouterStatusNatStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatusNatStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatusNatStatus} message RouterStatusNatStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatusNatStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterStatusNatStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterStatusNatStatus} RouterStatusNatStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatusNatStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterStatusNatStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 510794246: + if (!(message.autoAllocatedNatIps && message.autoAllocatedNatIps.length)) + message.autoAllocatedNatIps = []; + message.autoAllocatedNatIps.push(reader.string()); + break; + case 309184557: + if (!(message.drainAutoAllocatedNatIps && message.drainAutoAllocatedNatIps.length)) + message.drainAutoAllocatedNatIps = []; + message.drainAutoAllocatedNatIps.push(reader.string()); + break; + case 305268553: + if (!(message.drainUserAllocatedNatIps && message.drainUserAllocatedNatIps.length)) + message.drainUserAllocatedNatIps = []; + message.drainUserAllocatedNatIps.push(reader.string()); + break; + case 365786338: + message.minExtraNatIpsNeeded = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 512367468: + message.numVmEndpointsWithNatMappings = reader.int32(); + break; + case 212776151: + if (!(message.userAllocatedNatIpResources && message.userAllocatedNatIpResources.length)) + message.userAllocatedNatIpResources = []; + message.userAllocatedNatIpResources.push(reader.string()); + break; + case 506878242: + if (!(message.userAllocatedNatIps && message.userAllocatedNatIps.length)) + message.userAllocatedNatIps = []; + message.userAllocatedNatIps.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterStatusNatStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterStatusNatStatus} RouterStatusNatStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatusNatStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterStatusNatStatus message. + * @function verify + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterStatusNatStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoAllocatedNatIps != null && message.hasOwnProperty("autoAllocatedNatIps")) { + if (!Array.isArray(message.autoAllocatedNatIps)) + return "autoAllocatedNatIps: array expected"; + for (var i = 0; i < message.autoAllocatedNatIps.length; ++i) + if (!$util.isString(message.autoAllocatedNatIps[i])) + return "autoAllocatedNatIps: string[] expected"; + } + if (message.drainAutoAllocatedNatIps != null && message.hasOwnProperty("drainAutoAllocatedNatIps")) { + if (!Array.isArray(message.drainAutoAllocatedNatIps)) + return "drainAutoAllocatedNatIps: array expected"; + for (var i = 0; i < message.drainAutoAllocatedNatIps.length; ++i) + if (!$util.isString(message.drainAutoAllocatedNatIps[i])) + return "drainAutoAllocatedNatIps: string[] expected"; + } + if (message.drainUserAllocatedNatIps != null && message.hasOwnProperty("drainUserAllocatedNatIps")) { + if (!Array.isArray(message.drainUserAllocatedNatIps)) + return "drainUserAllocatedNatIps: array expected"; + for (var i = 0; i < message.drainUserAllocatedNatIps.length; ++i) + if (!$util.isString(message.drainUserAllocatedNatIps[i])) + return "drainUserAllocatedNatIps: string[] expected"; + } + if (message.minExtraNatIpsNeeded != null && message.hasOwnProperty("minExtraNatIpsNeeded")) { + properties._minExtraNatIpsNeeded = 1; + if (!$util.isInteger(message.minExtraNatIpsNeeded)) + return "minExtraNatIpsNeeded: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.numVmEndpointsWithNatMappings != null && message.hasOwnProperty("numVmEndpointsWithNatMappings")) { + properties._numVmEndpointsWithNatMappings = 1; + if (!$util.isInteger(message.numVmEndpointsWithNatMappings)) + return "numVmEndpointsWithNatMappings: integer expected"; + } + if (message.userAllocatedNatIpResources != null && message.hasOwnProperty("userAllocatedNatIpResources")) { + if (!Array.isArray(message.userAllocatedNatIpResources)) + return "userAllocatedNatIpResources: array expected"; + for (var i = 0; i < message.userAllocatedNatIpResources.length; ++i) + if (!$util.isString(message.userAllocatedNatIpResources[i])) + return "userAllocatedNatIpResources: string[] expected"; + } + if (message.userAllocatedNatIps != null && message.hasOwnProperty("userAllocatedNatIps")) { + if (!Array.isArray(message.userAllocatedNatIps)) + return "userAllocatedNatIps: array expected"; + for (var i = 0; i < message.userAllocatedNatIps.length; ++i) + if (!$util.isString(message.userAllocatedNatIps[i])) + return "userAllocatedNatIps: string[] expected"; + } + return null; + }; + + /** + * Creates a RouterStatusNatStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterStatusNatStatus} RouterStatusNatStatus + */ + RouterStatusNatStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterStatusNatStatus) + return object; + var message = new $root.google.cloud.compute.v1.RouterStatusNatStatus(); + if (object.autoAllocatedNatIps) { + if (!Array.isArray(object.autoAllocatedNatIps)) + throw TypeError(".google.cloud.compute.v1.RouterStatusNatStatus.autoAllocatedNatIps: array expected"); + message.autoAllocatedNatIps = []; + for (var i = 0; i < object.autoAllocatedNatIps.length; ++i) + message.autoAllocatedNatIps[i] = String(object.autoAllocatedNatIps[i]); + } + if (object.drainAutoAllocatedNatIps) { + if (!Array.isArray(object.drainAutoAllocatedNatIps)) + throw TypeError(".google.cloud.compute.v1.RouterStatusNatStatus.drainAutoAllocatedNatIps: array expected"); + message.drainAutoAllocatedNatIps = []; + for (var i = 0; i < object.drainAutoAllocatedNatIps.length; ++i) + message.drainAutoAllocatedNatIps[i] = String(object.drainAutoAllocatedNatIps[i]); + } + if (object.drainUserAllocatedNatIps) { + if (!Array.isArray(object.drainUserAllocatedNatIps)) + throw TypeError(".google.cloud.compute.v1.RouterStatusNatStatus.drainUserAllocatedNatIps: array expected"); + message.drainUserAllocatedNatIps = []; + for (var i = 0; i < object.drainUserAllocatedNatIps.length; ++i) + message.drainUserAllocatedNatIps[i] = String(object.drainUserAllocatedNatIps[i]); + } + if (object.minExtraNatIpsNeeded != null) + message.minExtraNatIpsNeeded = object.minExtraNatIpsNeeded | 0; + if (object.name != null) + message.name = String(object.name); + if (object.numVmEndpointsWithNatMappings != null) + message.numVmEndpointsWithNatMappings = object.numVmEndpointsWithNatMappings | 0; + if (object.userAllocatedNatIpResources) { + if (!Array.isArray(object.userAllocatedNatIpResources)) + throw TypeError(".google.cloud.compute.v1.RouterStatusNatStatus.userAllocatedNatIpResources: array expected"); + message.userAllocatedNatIpResources = []; + for (var i = 0; i < object.userAllocatedNatIpResources.length; ++i) + message.userAllocatedNatIpResources[i] = String(object.userAllocatedNatIpResources[i]); + } + if (object.userAllocatedNatIps) { + if (!Array.isArray(object.userAllocatedNatIps)) + throw TypeError(".google.cloud.compute.v1.RouterStatusNatStatus.userAllocatedNatIps: array expected"); + message.userAllocatedNatIps = []; + for (var i = 0; i < object.userAllocatedNatIps.length; ++i) + message.userAllocatedNatIps[i] = String(object.userAllocatedNatIps[i]); + } + return message; + }; + + /** + * Creates a plain object from a RouterStatusNatStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @static + * @param {google.cloud.compute.v1.RouterStatusNatStatus} message RouterStatusNatStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterStatusNatStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.userAllocatedNatIpResources = []; + object.drainUserAllocatedNatIps = []; + object.drainAutoAllocatedNatIps = []; + object.userAllocatedNatIps = []; + object.autoAllocatedNatIps = []; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.userAllocatedNatIpResources && message.userAllocatedNatIpResources.length) { + object.userAllocatedNatIpResources = []; + for (var j = 0; j < message.userAllocatedNatIpResources.length; ++j) + object.userAllocatedNatIpResources[j] = message.userAllocatedNatIpResources[j]; + } + if (message.drainUserAllocatedNatIps && message.drainUserAllocatedNatIps.length) { + object.drainUserAllocatedNatIps = []; + for (var j = 0; j < message.drainUserAllocatedNatIps.length; ++j) + object.drainUserAllocatedNatIps[j] = message.drainUserAllocatedNatIps[j]; + } + if (message.drainAutoAllocatedNatIps && message.drainAutoAllocatedNatIps.length) { + object.drainAutoAllocatedNatIps = []; + for (var j = 0; j < message.drainAutoAllocatedNatIps.length; ++j) + object.drainAutoAllocatedNatIps[j] = message.drainAutoAllocatedNatIps[j]; + } + if (message.minExtraNatIpsNeeded != null && message.hasOwnProperty("minExtraNatIpsNeeded")) { + object.minExtraNatIpsNeeded = message.minExtraNatIpsNeeded; + if (options.oneofs) + object._minExtraNatIpsNeeded = "minExtraNatIpsNeeded"; + } + if (message.userAllocatedNatIps && message.userAllocatedNatIps.length) { + object.userAllocatedNatIps = []; + for (var j = 0; j < message.userAllocatedNatIps.length; ++j) + object.userAllocatedNatIps[j] = message.userAllocatedNatIps[j]; + } + if (message.autoAllocatedNatIps && message.autoAllocatedNatIps.length) { + object.autoAllocatedNatIps = []; + for (var j = 0; j < message.autoAllocatedNatIps.length; ++j) + object.autoAllocatedNatIps[j] = message.autoAllocatedNatIps[j]; + } + if (message.numVmEndpointsWithNatMappings != null && message.hasOwnProperty("numVmEndpointsWithNatMappings")) { + object.numVmEndpointsWithNatMappings = message.numVmEndpointsWithNatMappings; + if (options.oneofs) + object._numVmEndpointsWithNatMappings = "numVmEndpointsWithNatMappings"; + } + return object; + }; + + /** + * Converts this RouterStatusNatStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterStatusNatStatus + * @instance + * @returns {Object.} JSON object + */ + RouterStatusNatStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RouterStatusNatStatus; + })(); + + v1.RouterStatus = (function() { + + /** + * Properties of a RouterStatus. + * @memberof google.cloud.compute.v1 + * @interface IRouterStatus + * @property {Array.|null} [bestRoutes] RouterStatus bestRoutes + * @property {Array.|null} [bestRoutesForRouter] RouterStatus bestRoutesForRouter + * @property {Array.|null} [bgpPeerStatus] RouterStatus bgpPeerStatus + * @property {Array.|null} [natStatus] RouterStatus natStatus + * @property {string|null} [network] RouterStatus network + */ + + /** + * Constructs a new RouterStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterStatus. + * @implements IRouterStatus + * @constructor + * @param {google.cloud.compute.v1.IRouterStatus=} [properties] Properties to set + */ + function RouterStatus(properties) { + this.bestRoutes = []; + this.bestRoutesForRouter = []; + this.bgpPeerStatus = []; + this.natStatus = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterStatus bestRoutes. + * @member {Array.} bestRoutes + * @memberof google.cloud.compute.v1.RouterStatus + * @instance + */ + RouterStatus.prototype.bestRoutes = $util.emptyArray; + + /** + * RouterStatus bestRoutesForRouter. + * @member {Array.} bestRoutesForRouter + * @memberof google.cloud.compute.v1.RouterStatus + * @instance + */ + RouterStatus.prototype.bestRoutesForRouter = $util.emptyArray; + + /** + * RouterStatus bgpPeerStatus. + * @member {Array.} bgpPeerStatus + * @memberof google.cloud.compute.v1.RouterStatus + * @instance + */ + RouterStatus.prototype.bgpPeerStatus = $util.emptyArray; + + /** + * RouterStatus natStatus. + * @member {Array.} natStatus + * @memberof google.cloud.compute.v1.RouterStatus + * @instance + */ + RouterStatus.prototype.natStatus = $util.emptyArray; + + /** + * RouterStatus network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.RouterStatus + * @instance + */ + RouterStatus.prototype.network = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterStatus _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.RouterStatus + * @instance + */ + Object.defineProperty(RouterStatus.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterStatus} RouterStatus instance + */ + RouterStatus.create = function create(properties) { + return new RouterStatus(properties); + }; + + /** + * Encodes the specified RouterStatus message. Does not implicitly {@link google.cloud.compute.v1.RouterStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatus} message RouterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.natStatus != null && message.natStatus.length) + for (var i = 0; i < message.natStatus.length; ++i) + $root.google.cloud.compute.v1.RouterStatusNatStatus.encode(message.natStatus[i], writer.uint32(/* id 63098064, wireType 2 =*/504784514).fork()).ldelim(); + if (message.bestRoutesForRouter != null && message.bestRoutesForRouter.length) + for (var i = 0; i < message.bestRoutesForRouter.length; ++i) + $root.google.cloud.compute.v1.Route.encode(message.bestRoutesForRouter[i], writer.uint32(/* id 119389689, wireType 2 =*/955117514).fork()).ldelim(); + if (message.bgpPeerStatus != null && message.bgpPeerStatus.length) + for (var i = 0; i < message.bgpPeerStatus.length; ++i) + $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus.encode(message.bgpPeerStatus[i], writer.uint32(/* id 218459131, wireType 2 =*/1747673050).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.bestRoutes != null && message.bestRoutes.length) + for (var i = 0; i < message.bestRoutes.length; ++i) + $root.google.cloud.compute.v1.Route.encode(message.bestRoutes[i], writer.uint32(/* id 395826693, wireType 2 =*/3166613546).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouterStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {google.cloud.compute.v1.IRouterStatus} message RouterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterStatus} RouterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 395826693: + if (!(message.bestRoutes && message.bestRoutes.length)) + message.bestRoutes = []; + message.bestRoutes.push($root.google.cloud.compute.v1.Route.decode(reader, reader.uint32())); + break; + case 119389689: + if (!(message.bestRoutesForRouter && message.bestRoutesForRouter.length)) + message.bestRoutesForRouter = []; + message.bestRoutesForRouter.push($root.google.cloud.compute.v1.Route.decode(reader, reader.uint32())); + break; + case 218459131: + if (!(message.bgpPeerStatus && message.bgpPeerStatus.length)) + message.bgpPeerStatus = []; + message.bgpPeerStatus.push($root.google.cloud.compute.v1.RouterStatusBgpPeerStatus.decode(reader, reader.uint32())); + break; + case 63098064: + if (!(message.natStatus && message.natStatus.length)) + message.natStatus = []; + message.natStatus.push($root.google.cloud.compute.v1.RouterStatusNatStatus.decode(reader, reader.uint32())); + break; + case 232872494: + message.network = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterStatus} RouterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterStatus message. + * @function verify + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bestRoutes != null && message.hasOwnProperty("bestRoutes")) { + if (!Array.isArray(message.bestRoutes)) + return "bestRoutes: array expected"; + for (var i = 0; i < message.bestRoutes.length; ++i) { + var error = $root.google.cloud.compute.v1.Route.verify(message.bestRoutes[i]); + if (error) + return "bestRoutes." + error; + } + } + if (message.bestRoutesForRouter != null && message.hasOwnProperty("bestRoutesForRouter")) { + if (!Array.isArray(message.bestRoutesForRouter)) + return "bestRoutesForRouter: array expected"; + for (var i = 0; i < message.bestRoutesForRouter.length; ++i) { + var error = $root.google.cloud.compute.v1.Route.verify(message.bestRoutesForRouter[i]); + if (error) + return "bestRoutesForRouter." + error; + } + } + if (message.bgpPeerStatus != null && message.hasOwnProperty("bgpPeerStatus")) { + if (!Array.isArray(message.bgpPeerStatus)) + return "bgpPeerStatus: array expected"; + for (var i = 0; i < message.bgpPeerStatus.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus.verify(message.bgpPeerStatus[i]); + if (error) + return "bgpPeerStatus." + error; + } + } + if (message.natStatus != null && message.hasOwnProperty("natStatus")) { + if (!Array.isArray(message.natStatus)) + return "natStatus: array expected"; + for (var i = 0; i < message.natStatus.length; ++i) { + var error = $root.google.cloud.compute.v1.RouterStatusNatStatus.verify(message.natStatus[i]); + if (error) + return "natStatus." + error; + } + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + return null; + }; + + /** + * Creates a RouterStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterStatus} RouterStatus + */ + RouterStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterStatus) + return object; + var message = new $root.google.cloud.compute.v1.RouterStatus(); + if (object.bestRoutes) { + if (!Array.isArray(object.bestRoutes)) + throw TypeError(".google.cloud.compute.v1.RouterStatus.bestRoutes: array expected"); + message.bestRoutes = []; + for (var i = 0; i < object.bestRoutes.length; ++i) { + if (typeof object.bestRoutes[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterStatus.bestRoutes: object expected"); + message.bestRoutes[i] = $root.google.cloud.compute.v1.Route.fromObject(object.bestRoutes[i]); + } + } + if (object.bestRoutesForRouter) { + if (!Array.isArray(object.bestRoutesForRouter)) + throw TypeError(".google.cloud.compute.v1.RouterStatus.bestRoutesForRouter: array expected"); + message.bestRoutesForRouter = []; + for (var i = 0; i < object.bestRoutesForRouter.length; ++i) { + if (typeof object.bestRoutesForRouter[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterStatus.bestRoutesForRouter: object expected"); + message.bestRoutesForRouter[i] = $root.google.cloud.compute.v1.Route.fromObject(object.bestRoutesForRouter[i]); + } + } + if (object.bgpPeerStatus) { + if (!Array.isArray(object.bgpPeerStatus)) + throw TypeError(".google.cloud.compute.v1.RouterStatus.bgpPeerStatus: array expected"); + message.bgpPeerStatus = []; + for (var i = 0; i < object.bgpPeerStatus.length; ++i) { + if (typeof object.bgpPeerStatus[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterStatus.bgpPeerStatus: object expected"); + message.bgpPeerStatus[i] = $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus.fromObject(object.bgpPeerStatus[i]); + } + } + if (object.natStatus) { + if (!Array.isArray(object.natStatus)) + throw TypeError(".google.cloud.compute.v1.RouterStatus.natStatus: array expected"); + message.natStatus = []; + for (var i = 0; i < object.natStatus.length; ++i) { + if (typeof object.natStatus[i] !== "object") + throw TypeError(".google.cloud.compute.v1.RouterStatus.natStatus: object expected"); + message.natStatus[i] = $root.google.cloud.compute.v1.RouterStatusNatStatus.fromObject(object.natStatus[i]); + } + } + if (object.network != null) + message.network = String(object.network); + return message; + }; + + /** + * Creates a plain object from a RouterStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterStatus + * @static + * @param {google.cloud.compute.v1.RouterStatus} message RouterStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.natStatus = []; + object.bestRoutesForRouter = []; + object.bgpPeerStatus = []; + object.bestRoutes = []; + } + if (message.natStatus && message.natStatus.length) { + object.natStatus = []; + for (var j = 0; j < message.natStatus.length; ++j) + object.natStatus[j] = $root.google.cloud.compute.v1.RouterStatusNatStatus.toObject(message.natStatus[j], options); + } + if (message.bestRoutesForRouter && message.bestRoutesForRouter.length) { + object.bestRoutesForRouter = []; + for (var j = 0; j < message.bestRoutesForRouter.length; ++j) + object.bestRoutesForRouter[j] = $root.google.cloud.compute.v1.Route.toObject(message.bestRoutesForRouter[j], options); + } + if (message.bgpPeerStatus && message.bgpPeerStatus.length) { + object.bgpPeerStatus = []; + for (var j = 0; j < message.bgpPeerStatus.length; ++j) + object.bgpPeerStatus[j] = $root.google.cloud.compute.v1.RouterStatusBgpPeerStatus.toObject(message.bgpPeerStatus[j], options); + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.bestRoutes && message.bestRoutes.length) { + object.bestRoutes = []; + for (var j = 0; j < message.bestRoutes.length; ++j) + object.bestRoutes[j] = $root.google.cloud.compute.v1.Route.toObject(message.bestRoutes[j], options); + } + return object; + }; + + /** + * Converts this RouterStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterStatus + * @instance + * @returns {Object.} JSON object + */ + RouterStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RouterStatus; + })(); + + v1.RouterStatusResponse = (function() { + + /** + * Properties of a RouterStatusResponse. + * @memberof google.cloud.compute.v1 + * @interface IRouterStatusResponse + * @property {string|null} [kind] RouterStatusResponse kind + * @property {google.cloud.compute.v1.IRouterStatus|null} [result] RouterStatusResponse result + */ + + /** + * Constructs a new RouterStatusResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RouterStatusResponse. + * @implements IRouterStatusResponse + * @constructor + * @param {google.cloud.compute.v1.IRouterStatusResponse=} [properties] Properties to set + */ + function RouterStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouterStatusResponse kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @instance + */ + RouterStatusResponse.prototype.kind = null; + + /** + * RouterStatusResponse result. + * @member {google.cloud.compute.v1.IRouterStatus|null|undefined} result + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @instance + */ + RouterStatusResponse.prototype.result = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RouterStatusResponse _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @instance + */ + Object.defineProperty(RouterStatusResponse.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RouterStatusResponse _result. + * @member {"result"|undefined} _result + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @instance + */ + Object.defineProperty(RouterStatusResponse.prototype, "_result", { + get: $util.oneOfGetter($oneOfFields = ["result"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RouterStatusResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {google.cloud.compute.v1.IRouterStatusResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RouterStatusResponse} RouterStatusResponse instance + */ + RouterStatusResponse.create = function create(properties) { + return new RouterStatusResponse(properties); + }; + + /** + * Encodes the specified RouterStatusResponse message. Does not implicitly {@link google.cloud.compute.v1.RouterStatusResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {google.cloud.compute.v1.IRouterStatusResponse} message RouterStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.compute.v1.RouterStatus.encode(message.result, writer.uint32(/* id 139315229, wireType 2 =*/1114521834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RouterStatusResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RouterStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {google.cloud.compute.v1.IRouterStatusResponse} message RouterStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RouterStatusResponse} RouterStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RouterStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3292052: + message.kind = reader.string(); + break; + case 139315229: + message.result = $root.google.cloud.compute.v1.RouterStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RouterStatusResponse} RouterStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterStatusResponse message. + * @function verify + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.result != null && message.hasOwnProperty("result")) { + properties._result = 1; + { + var error = $root.google.cloud.compute.v1.RouterStatus.verify(message.result); + if (error) + return "result." + error; + } + } + return null; + }; + + /** + * Creates a RouterStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RouterStatusResponse} RouterStatusResponse + */ + RouterStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RouterStatusResponse) + return object; + var message = new $root.google.cloud.compute.v1.RouterStatusResponse(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.compute.v1.RouterStatusResponse.result: object expected"); + message.result = $root.google.cloud.compute.v1.RouterStatus.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a RouterStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @static + * @param {google.cloud.compute.v1.RouterStatusResponse} message RouterStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.result != null && message.hasOwnProperty("result")) { + object.result = $root.google.cloud.compute.v1.RouterStatus.toObject(message.result, options); + if (options.oneofs) + object._result = "result"; + } + return object; + }; + + /** + * Converts this RouterStatusResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RouterStatusResponse + * @instance + * @returns {Object.} JSON object + */ + RouterStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RouterStatusResponse; + })(); + + v1.RoutersPreviewResponse = (function() { + + /** + * Properties of a RoutersPreviewResponse. + * @memberof google.cloud.compute.v1 + * @interface IRoutersPreviewResponse + * @property {google.cloud.compute.v1.IRouter|null} [resource] RoutersPreviewResponse resource + */ + + /** + * Constructs a new RoutersPreviewResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RoutersPreviewResponse. + * @implements IRoutersPreviewResponse + * @constructor + * @param {google.cloud.compute.v1.IRoutersPreviewResponse=} [properties] Properties to set + */ + function RoutersPreviewResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutersPreviewResponse resource. + * @member {google.cloud.compute.v1.IRouter|null|undefined} resource + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @instance + */ + RoutersPreviewResponse.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RoutersPreviewResponse _resource. + * @member {"resource"|undefined} _resource + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @instance + */ + Object.defineProperty(RoutersPreviewResponse.prototype, "_resource", { + get: $util.oneOfGetter($oneOfFields = ["resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RoutersPreviewResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {google.cloud.compute.v1.IRoutersPreviewResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RoutersPreviewResponse} RoutersPreviewResponse instance + */ + RoutersPreviewResponse.create = function create(properties) { + return new RoutersPreviewResponse(properties); + }; + + /** + * Encodes the specified RoutersPreviewResponse message. Does not implicitly {@link google.cloud.compute.v1.RoutersPreviewResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {google.cloud.compute.v1.IRoutersPreviewResponse} message RoutersPreviewResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutersPreviewResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.compute.v1.Router.encode(message.resource, writer.uint32(/* id 195806222, wireType 2 =*/1566449778).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutersPreviewResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutersPreviewResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {google.cloud.compute.v1.IRoutersPreviewResponse} message RoutersPreviewResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutersPreviewResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutersPreviewResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RoutersPreviewResponse} RoutersPreviewResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutersPreviewResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RoutersPreviewResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 195806222: + message.resource = $root.google.cloud.compute.v1.Router.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutersPreviewResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RoutersPreviewResponse} RoutersPreviewResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutersPreviewResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutersPreviewResponse message. + * @function verify + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutersPreviewResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + properties._resource = 1; + { + var error = $root.google.cloud.compute.v1.Router.verify(message.resource); + if (error) + return "resource." + error; + } + } + return null; + }; + + /** + * Creates a RoutersPreviewResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RoutersPreviewResponse} RoutersPreviewResponse + */ + RoutersPreviewResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RoutersPreviewResponse) + return object; + var message = new $root.google.cloud.compute.v1.RoutersPreviewResponse(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.compute.v1.RoutersPreviewResponse.resource: object expected"); + message.resource = $root.google.cloud.compute.v1.Router.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a RoutersPreviewResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @static + * @param {google.cloud.compute.v1.RoutersPreviewResponse} message RoutersPreviewResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutersPreviewResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.cloud.compute.v1.Router.toObject(message.resource, options); + if (options.oneofs) + object._resource = "resource"; + } + return object; + }; + + /** + * Converts this RoutersPreviewResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RoutersPreviewResponse + * @instance + * @returns {Object.} JSON object + */ + RoutersPreviewResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RoutersPreviewResponse; + })(); + + v1.SchedulingNodeAffinity = (function() { + + /** + * Properties of a SchedulingNodeAffinity. + * @memberof google.cloud.compute.v1 + * @interface ISchedulingNodeAffinity + * @property {string|null} [key] SchedulingNodeAffinity key + * @property {google.cloud.compute.v1.SchedulingNodeAffinity.Operator|null} [operator] SchedulingNodeAffinity operator + * @property {Array.|null} [values] SchedulingNodeAffinity values + */ + + /** + * Constructs a new SchedulingNodeAffinity. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SchedulingNodeAffinity. + * @implements ISchedulingNodeAffinity + * @constructor + * @param {google.cloud.compute.v1.ISchedulingNodeAffinity=} [properties] Properties to set + */ + function SchedulingNodeAffinity(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]]; + } + + /** + * SchedulingNodeAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @instance + */ + SchedulingNodeAffinity.prototype.key = null; + + /** + * SchedulingNodeAffinity operator. + * @member {google.cloud.compute.v1.SchedulingNodeAffinity.Operator|null|undefined} operator + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @instance + */ + SchedulingNodeAffinity.prototype.operator = null; + + /** + * SchedulingNodeAffinity values. + * @member {Array.} values + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @instance + */ + SchedulingNodeAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SchedulingNodeAffinity _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @instance + */ + Object.defineProperty(SchedulingNodeAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SchedulingNodeAffinity _operator. + * @member {"operator"|undefined} _operator + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @instance + */ + Object.defineProperty(SchedulingNodeAffinity.prototype, "_operator", { + get: $util.oneOfGetter($oneOfFields = ["operator"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SchedulingNodeAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.compute.v1.ISchedulingNodeAffinity=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SchedulingNodeAffinity} SchedulingNodeAffinity instance + */ + SchedulingNodeAffinity.create = function create(properties) { + return new SchedulingNodeAffinity(properties); + }; + + /** + * Encodes the specified SchedulingNodeAffinity message. Does not implicitly {@link google.cloud.compute.v1.SchedulingNodeAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.compute.v1.ISchedulingNodeAffinity} message SchedulingNodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingNodeAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 106079, wireType 2 =*/848634).string(message.key); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 36317348, wireType 0 =*/290538784).int32(message.operator); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 249928994, wireType 2 =*/1999431954).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified SchedulingNodeAffinity message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SchedulingNodeAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.compute.v1.ISchedulingNodeAffinity} message SchedulingNodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingNodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SchedulingNodeAffinity} SchedulingNodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingNodeAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SchedulingNodeAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 106079: + message.key = reader.string(); + break; + case 36317348: + message.operator = reader.int32(); + break; + case 249928994: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchedulingNodeAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SchedulingNodeAffinity} SchedulingNodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingNodeAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulingNodeAffinity message. + * @function verify + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulingNodeAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + properties._operator = 1; + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 2341: + case 161144369: + case 128892924: + break; + } + } + 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"; + } + return null; + }; + + /** + * Creates a SchedulingNodeAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SchedulingNodeAffinity} SchedulingNodeAffinity + */ + SchedulingNodeAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SchedulingNodeAffinity) + return object; + var message = new $root.google.cloud.compute.v1.SchedulingNodeAffinity(); + if (object.key != null) + message.key = String(object.key); + switch (object.operator) { + case "UNDEFINED_OPERATOR": + case 0: + message.operator = 0; + break; + case "IN": + case 2341: + message.operator = 2341; + break; + case "NOT_IN": + case 161144369: + message.operator = 161144369; + break; + case "OPERATOR_UNSPECIFIED": + case 128892924: + message.operator = 128892924; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.compute.v1.SchedulingNodeAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a SchedulingNodeAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @static + * @param {google.cloud.compute.v1.SchedulingNodeAffinity} message SchedulingNodeAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulingNodeAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + object.operator = options.enums === String ? $root.google.cloud.compute.v1.SchedulingNodeAffinity.Operator[message.operator] : message.operator; + if (options.oneofs) + object._operator = "operator"; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this SchedulingNodeAffinity to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SchedulingNodeAffinity + * @instance + * @returns {Object.} JSON object + */ + SchedulingNodeAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Operator enum. + * @name google.cloud.compute.v1.SchedulingNodeAffinity.Operator + * @enum {number} + * @property {number} UNDEFINED_OPERATOR=0 UNDEFINED_OPERATOR value + * @property {number} IN=2341 IN value + * @property {number} NOT_IN=161144369 NOT_IN value + * @property {number} OPERATOR_UNSPECIFIED=128892924 OPERATOR_UNSPECIFIED value + */ + SchedulingNodeAffinity.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_OPERATOR"] = 0; + values[valuesById[2341] = "IN"] = 2341; + values[valuesById[161144369] = "NOT_IN"] = 161144369; + values[valuesById[128892924] = "OPERATOR_UNSPECIFIED"] = 128892924; + return values; + })(); + + return SchedulingNodeAffinity; + })(); + + v1.Screenshot = (function() { + + /** + * Properties of a Screenshot. + * @memberof google.cloud.compute.v1 + * @interface IScreenshot + * @property {string|null} [contents] Screenshot contents + * @property {string|null} [kind] Screenshot kind + */ + + /** + * Constructs a new Screenshot. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Screenshot. + * @implements IScreenshot + * @constructor + * @param {google.cloud.compute.v1.IScreenshot=} [properties] Properties to set + */ + function Screenshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Screenshot contents. + * @member {string|null|undefined} contents + * @memberof google.cloud.compute.v1.Screenshot + * @instance + */ + Screenshot.prototype.contents = null; + + /** + * Screenshot kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Screenshot + * @instance + */ + Screenshot.prototype.kind = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Screenshot _contents. + * @member {"contents"|undefined} _contents + * @memberof google.cloud.compute.v1.Screenshot + * @instance + */ + Object.defineProperty(Screenshot.prototype, "_contents", { + get: $util.oneOfGetter($oneOfFields = ["contents"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Screenshot _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Screenshot + * @instance + */ + Object.defineProperty(Screenshot.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Screenshot instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {google.cloud.compute.v1.IScreenshot=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Screenshot} Screenshot instance + */ + Screenshot.create = function create(properties) { + return new Screenshot(properties); + }; + + /** + * Encodes the specified Screenshot message. Does not implicitly {@link google.cloud.compute.v1.Screenshot.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {google.cloud.compute.v1.IScreenshot} message Screenshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Screenshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 506419994, wireType 2 =*/4051359954).string(message.contents); + return writer; + }; + + /** + * Encodes the specified Screenshot message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Screenshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {google.cloud.compute.v1.IScreenshot} message Screenshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Screenshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Screenshot message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Screenshot} Screenshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Screenshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Screenshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 506419994: + message.contents = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Screenshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Screenshot} Screenshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Screenshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Screenshot message. + * @function verify + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Screenshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contents != null && message.hasOwnProperty("contents")) { + properties._contents = 1; + if (!$util.isString(message.contents)) + return "contents: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + return null; + }; + + /** + * Creates a Screenshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Screenshot} Screenshot + */ + Screenshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Screenshot) + return object; + var message = new $root.google.cloud.compute.v1.Screenshot(); + if (object.contents != null) + message.contents = String(object.contents); + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a Screenshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Screenshot + * @static + * @param {google.cloud.compute.v1.Screenshot} message Screenshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Screenshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.contents != null && message.hasOwnProperty("contents")) { + object.contents = message.contents; + if (options.oneofs) + object._contents = "contents"; + } + return object; + }; + + /** + * Converts this Screenshot to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Screenshot + * @instance + * @returns {Object.} JSON object + */ + Screenshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Screenshot; + })(); + + v1.SecurityPoliciesWafConfig = (function() { + + /** + * Properties of a SecurityPoliciesWafConfig. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPoliciesWafConfig + * @property {google.cloud.compute.v1.IPreconfiguredWafSet|null} [wafRules] SecurityPoliciesWafConfig wafRules + */ + + /** + * Constructs a new SecurityPoliciesWafConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPoliciesWafConfig. + * @implements ISecurityPoliciesWafConfig + * @constructor + * @param {google.cloud.compute.v1.ISecurityPoliciesWafConfig=} [properties] Properties to set + */ + function SecurityPoliciesWafConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPoliciesWafConfig wafRules. + * @member {google.cloud.compute.v1.IPreconfiguredWafSet|null|undefined} wafRules + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @instance + */ + SecurityPoliciesWafConfig.prototype.wafRules = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPoliciesWafConfig _wafRules. + * @member {"wafRules"|undefined} _wafRules + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @instance + */ + Object.defineProperty(SecurityPoliciesWafConfig.prototype, "_wafRules", { + get: $util.oneOfGetter($oneOfFields = ["wafRules"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPoliciesWafConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {google.cloud.compute.v1.ISecurityPoliciesWafConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPoliciesWafConfig} SecurityPoliciesWafConfig instance + */ + SecurityPoliciesWafConfig.create = function create(properties) { + return new SecurityPoliciesWafConfig(properties); + }; + + /** + * Encodes the specified SecurityPoliciesWafConfig message. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesWafConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {google.cloud.compute.v1.ISecurityPoliciesWafConfig} message SecurityPoliciesWafConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPoliciesWafConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.wafRules != null && Object.hasOwnProperty.call(message, "wafRules")) + $root.google.cloud.compute.v1.PreconfiguredWafSet.encode(message.wafRules, writer.uint32(/* id 74899924, wireType 2 =*/599199394).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityPoliciesWafConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesWafConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {google.cloud.compute.v1.ISecurityPoliciesWafConfig} message SecurityPoliciesWafConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPoliciesWafConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPoliciesWafConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPoliciesWafConfig} SecurityPoliciesWafConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPoliciesWafConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPoliciesWafConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 74899924: + message.wafRules = $root.google.cloud.compute.v1.PreconfiguredWafSet.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPoliciesWafConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPoliciesWafConfig} SecurityPoliciesWafConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPoliciesWafConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPoliciesWafConfig message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPoliciesWafConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.wafRules != null && message.hasOwnProperty("wafRules")) { + properties._wafRules = 1; + { + var error = $root.google.cloud.compute.v1.PreconfiguredWafSet.verify(message.wafRules); + if (error) + return "wafRules." + error; + } + } + return null; + }; + + /** + * Creates a SecurityPoliciesWafConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPoliciesWafConfig} SecurityPoliciesWafConfig + */ + SecurityPoliciesWafConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPoliciesWafConfig) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPoliciesWafConfig(); + if (object.wafRules != null) { + if (typeof object.wafRules !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPoliciesWafConfig.wafRules: object expected"); + message.wafRules = $root.google.cloud.compute.v1.PreconfiguredWafSet.fromObject(object.wafRules); + } + return message; + }; + + /** + * Creates a plain object from a SecurityPoliciesWafConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @static + * @param {google.cloud.compute.v1.SecurityPoliciesWafConfig} message SecurityPoliciesWafConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPoliciesWafConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.wafRules != null && message.hasOwnProperty("wafRules")) { + object.wafRules = $root.google.cloud.compute.v1.PreconfiguredWafSet.toObject(message.wafRules, options); + if (options.oneofs) + object._wafRules = "wafRules"; + } + return object; + }; + + /** + * Converts this SecurityPoliciesWafConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPoliciesWafConfig + * @instance + * @returns {Object.} JSON object + */ + SecurityPoliciesWafConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityPoliciesWafConfig; + })(); + + v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse = (function() { + + /** + * Properties of a SecurityPoliciesListPreconfiguredExpressionSetsResponse. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPoliciesListPreconfiguredExpressionSetsResponse + * @property {google.cloud.compute.v1.ISecurityPoliciesWafConfig|null} [preconfiguredExpressionSets] SecurityPoliciesListPreconfiguredExpressionSetsResponse preconfiguredExpressionSets + */ + + /** + * Constructs a new SecurityPoliciesListPreconfiguredExpressionSetsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPoliciesListPreconfiguredExpressionSetsResponse. + * @implements ISecurityPoliciesListPreconfiguredExpressionSetsResponse + * @constructor + * @param {google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse=} [properties] Properties to set + */ + function SecurityPoliciesListPreconfiguredExpressionSetsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPoliciesListPreconfiguredExpressionSetsResponse preconfiguredExpressionSets. + * @member {google.cloud.compute.v1.ISecurityPoliciesWafConfig|null|undefined} preconfiguredExpressionSets + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @instance + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.prototype.preconfiguredExpressionSets = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPoliciesListPreconfiguredExpressionSetsResponse _preconfiguredExpressionSets. + * @member {"preconfiguredExpressionSets"|undefined} _preconfiguredExpressionSets + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @instance + */ + Object.defineProperty(SecurityPoliciesListPreconfiguredExpressionSetsResponse.prototype, "_preconfiguredExpressionSets", { + get: $util.oneOfGetter($oneOfFields = ["preconfiguredExpressionSets"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPoliciesListPreconfiguredExpressionSetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse} SecurityPoliciesListPreconfiguredExpressionSetsResponse instance + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.create = function create(properties) { + return new SecurityPoliciesListPreconfiguredExpressionSetsResponse(properties); + }; + + /** + * Encodes the specified SecurityPoliciesListPreconfiguredExpressionSetsResponse message. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse} message SecurityPoliciesListPreconfiguredExpressionSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.preconfiguredExpressionSets != null && Object.hasOwnProperty.call(message, "preconfiguredExpressionSets")) + $root.google.cloud.compute.v1.SecurityPoliciesWafConfig.encode(message.preconfiguredExpressionSets, writer.uint32(/* id 536200826, wireType 2 =*/4289606610).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityPoliciesListPreconfiguredExpressionSetsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse} message SecurityPoliciesListPreconfiguredExpressionSetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPoliciesListPreconfiguredExpressionSetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse} SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 536200826: + message.preconfiguredExpressionSets = $root.google.cloud.compute.v1.SecurityPoliciesWafConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPoliciesListPreconfiguredExpressionSetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse} SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPoliciesListPreconfiguredExpressionSetsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.preconfiguredExpressionSets != null && message.hasOwnProperty("preconfiguredExpressionSets")) { + properties._preconfiguredExpressionSets = 1; + { + var error = $root.google.cloud.compute.v1.SecurityPoliciesWafConfig.verify(message.preconfiguredExpressionSets); + if (error) + return "preconfiguredExpressionSets." + error; + } + } + return null; + }; + + /** + * Creates a SecurityPoliciesListPreconfiguredExpressionSetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse} SecurityPoliciesListPreconfiguredExpressionSetsResponse + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse(); + if (object.preconfiguredExpressionSets != null) { + if (typeof object.preconfiguredExpressionSets !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse.preconfiguredExpressionSets: object expected"); + message.preconfiguredExpressionSets = $root.google.cloud.compute.v1.SecurityPoliciesWafConfig.fromObject(object.preconfiguredExpressionSets); + } + return message; + }; + + /** + * Creates a plain object from a SecurityPoliciesListPreconfiguredExpressionSetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @static + * @param {google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse} message SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.preconfiguredExpressionSets != null && message.hasOwnProperty("preconfiguredExpressionSets")) { + object.preconfiguredExpressionSets = $root.google.cloud.compute.v1.SecurityPoliciesWafConfig.toObject(message.preconfiguredExpressionSets, options); + if (options.oneofs) + object._preconfiguredExpressionSets = "preconfiguredExpressionSets"; + } + return object; + }; + + /** + * Converts this SecurityPoliciesListPreconfiguredExpressionSetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @instance + * @returns {Object.} JSON object + */ + SecurityPoliciesListPreconfiguredExpressionSetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityPoliciesListPreconfiguredExpressionSetsResponse; + })(); + + v1.SecurityPolicyRule = (function() { + + /** + * Properties of a SecurityPolicyRule. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPolicyRule + * @property {string|null} [action] SecurityPolicyRule action + * @property {string|null} [description] SecurityPolicyRule description + * @property {string|null} [kind] SecurityPolicyRule kind + * @property {google.cloud.compute.v1.ISecurityPolicyRuleMatcher|null} [match] SecurityPolicyRule match + * @property {boolean|null} [preview] SecurityPolicyRule preview + * @property {number|null} [priority] SecurityPolicyRule priority + */ + + /** + * Constructs a new SecurityPolicyRule. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPolicyRule. + * @implements ISecurityPolicyRule + * @constructor + * @param {google.cloud.compute.v1.ISecurityPolicyRule=} [properties] Properties to set + */ + function SecurityPolicyRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPolicyRule action. + * @member {string|null|undefined} action + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + SecurityPolicyRule.prototype.action = null; + + /** + * SecurityPolicyRule description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + SecurityPolicyRule.prototype.description = null; + + /** + * SecurityPolicyRule kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + SecurityPolicyRule.prototype.kind = null; + + /** + * SecurityPolicyRule match. + * @member {google.cloud.compute.v1.ISecurityPolicyRuleMatcher|null|undefined} match + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + SecurityPolicyRule.prototype.match = null; + + /** + * SecurityPolicyRule preview. + * @member {boolean|null|undefined} preview + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + SecurityPolicyRule.prototype.preview = null; + + /** + * SecurityPolicyRule priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + SecurityPolicyRule.prototype.priority = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPolicyRule _action. + * @member {"action"|undefined} _action + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + Object.defineProperty(SecurityPolicyRule.prototype, "_action", { + get: $util.oneOfGetter($oneOfFields = ["action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyRule _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + Object.defineProperty(SecurityPolicyRule.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyRule _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + Object.defineProperty(SecurityPolicyRule.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyRule _match. + * @member {"match"|undefined} _match + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + Object.defineProperty(SecurityPolicyRule.prototype, "_match", { + get: $util.oneOfGetter($oneOfFields = ["match"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyRule _preview. + * @member {"preview"|undefined} _preview + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + Object.defineProperty(SecurityPolicyRule.prototype, "_preview", { + get: $util.oneOfGetter($oneOfFields = ["preview"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyRule _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + */ + Object.defineProperty(SecurityPolicyRule.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPolicyRule instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRule=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPolicyRule} SecurityPolicyRule instance + */ + SecurityPolicyRule.create = function create(properties) { + return new SecurityPolicyRule(properties); + }; + + /** + * Encodes the specified SecurityPolicyRule message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRule} message SecurityPolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.match != null && Object.hasOwnProperty.call(message, "match")) + $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher.encode(message.match, writer.uint32(/* id 103668165, wireType 2 =*/829345322).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 187661878, wireType 2 =*/1501295026).string(message.action); + if (message.preview != null && Object.hasOwnProperty.call(message, "preview")) + writer.uint32(/* id 218686408, wireType 0 =*/1749491264).bool(message.preview); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified SecurityPolicyRule message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRule} message SecurityPolicyRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicyRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPolicyRule} SecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPolicyRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 187661878: + message.action = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 103668165: + message.match = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher.decode(reader, reader.uint32()); + break; + case 218686408: + message.preview = reader.bool(); + break; + case 445151652: + message.priority = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicyRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPolicyRule} SecurityPolicyRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicyRule message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicyRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) { + properties._action = 1; + if (!$util.isString(message.action)) + return "action: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.match != null && message.hasOwnProperty("match")) { + properties._match = 1; + { + var error = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher.verify(message.match); + if (error) + return "match." + error; + } + } + if (message.preview != null && message.hasOwnProperty("preview")) { + properties._preview = 1; + if (typeof message.preview !== "boolean") + return "preview: boolean expected"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + return null; + }; + + /** + * Creates a SecurityPolicyRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPolicyRule} SecurityPolicyRule + */ + SecurityPolicyRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPolicyRule) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPolicyRule(); + if (object.action != null) + message.action = String(object.action); + if (object.description != null) + message.description = String(object.description); + if (object.kind != null) + message.kind = String(object.kind); + if (object.match != null) { + if (typeof object.match !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPolicyRule.match: object expected"); + message.match = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher.fromObject(object.match); + } + if (object.preview != null) + message.preview = Boolean(object.preview); + if (object.priority != null) + message.priority = object.priority | 0; + return message; + }; + + /** + * Creates a plain object from a SecurityPolicyRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @static + * @param {google.cloud.compute.v1.SecurityPolicyRule} message SecurityPolicyRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicyRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.match != null && message.hasOwnProperty("match")) { + object.match = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher.toObject(message.match, options); + if (options.oneofs) + object._match = "match"; + } + if (message.action != null && message.hasOwnProperty("action")) { + object.action = message.action; + if (options.oneofs) + object._action = "action"; + } + if (message.preview != null && message.hasOwnProperty("preview")) { + object.preview = message.preview; + if (options.oneofs) + object._preview = "preview"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + return object; + }; + + /** + * Converts this SecurityPolicyRule to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPolicyRule + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicyRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityPolicyRule; + })(); + + v1.SecurityPolicy = (function() { + + /** + * Properties of a SecurityPolicy. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPolicy + * @property {string|null} [creationTimestamp] SecurityPolicy creationTimestamp + * @property {string|null} [description] SecurityPolicy description + * @property {string|null} [fingerprint] SecurityPolicy fingerprint + * @property {number|Long|null} [id] SecurityPolicy id + * @property {string|null} [kind] SecurityPolicy kind + * @property {string|null} [name] SecurityPolicy name + * @property {Array.|null} [rules] SecurityPolicy rules + * @property {string|null} [selfLink] SecurityPolicy selfLink + */ + + /** + * Constructs a new SecurityPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPolicy. + * @implements ISecurityPolicy + * @constructor + * @param {google.cloud.compute.v1.ISecurityPolicy=} [properties] Properties to set + */ + function SecurityPolicy(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]]; + } + + /** + * SecurityPolicy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.creationTimestamp = null; + + /** + * SecurityPolicy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.description = null; + + /** + * SecurityPolicy fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.fingerprint = null; + + /** + * SecurityPolicy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.id = null; + + /** + * SecurityPolicy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.kind = null; + + /** + * SecurityPolicy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.name = null; + + /** + * SecurityPolicy rules. + * @member {Array.} rules + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.rules = $util.emptyArray; + + /** + * SecurityPolicy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + SecurityPolicy.prototype.selfLink = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPolicy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + Object.defineProperty(SecurityPolicy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + Object.defineProperty(SecurityPolicy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicy _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + Object.defineProperty(SecurityPolicy.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + Object.defineProperty(SecurityPolicy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + Object.defineProperty(SecurityPolicy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + Object.defineProperty(SecurityPolicy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + */ + Object.defineProperty(SecurityPolicy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {google.cloud.compute.v1.ISecurityPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPolicy} SecurityPolicy instance + */ + SecurityPolicy.create = function create(properties) { + return new SecurityPolicy(properties); + }; + + /** + * Encodes the specified SecurityPolicy message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {google.cloud.compute.v1.ISecurityPolicy} message SecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.compute.v1.SecurityPolicyRule.encode(message.rules[i], writer.uint32(/* id 108873975, wireType 2 =*/870991802).fork()).ldelim(); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified SecurityPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {google.cloud.compute.v1.ISecurityPolicy} message SecurityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPolicy} SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 108873975: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.compute.v1.SecurityPolicyRule.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPolicy} SecurityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string 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.cloud.compute.v1.SecurityPolicyRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + return null; + }; + + /** + * Creates a SecurityPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPolicy} SecurityPolicy + */ + SecurityPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPolicy) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPolicy(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.compute.v1.SecurityPolicy.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPolicy.rules: object expected"); + message.rules[i] = $root.google.cloud.compute.v1.SecurityPolicyRule.fromObject(object.rules[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + return message; + }; + + /** + * Creates a plain object from a SecurityPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPolicy + * @static + * @param {google.cloud.compute.v1.SecurityPolicy} message SecurityPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.compute.v1.SecurityPolicyRule.toObject(message.rules[j], options); + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this SecurityPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPolicy + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityPolicy; + })(); + + v1.SecurityPolicyList = (function() { + + /** + * Properties of a SecurityPolicyList. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPolicyList + * @property {string|null} [id] SecurityPolicyList id + * @property {Array.|null} [items] SecurityPolicyList items + * @property {string|null} [kind] SecurityPolicyList kind + * @property {string|null} [nextPageToken] SecurityPolicyList nextPageToken + * @property {google.cloud.compute.v1.IWarning|null} [warning] SecurityPolicyList warning + */ + + /** + * Constructs a new SecurityPolicyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPolicyList. + * @implements ISecurityPolicyList + * @constructor + * @param {google.cloud.compute.v1.ISecurityPolicyList=} [properties] Properties to set + */ + function SecurityPolicyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPolicyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + SecurityPolicyList.prototype.id = null; + + /** + * SecurityPolicyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + SecurityPolicyList.prototype.items = $util.emptyArray; + + /** + * SecurityPolicyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + SecurityPolicyList.prototype.kind = null; + + /** + * SecurityPolicyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + SecurityPolicyList.prototype.nextPageToken = null; + + /** + * SecurityPolicyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + SecurityPolicyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPolicyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + Object.defineProperty(SecurityPolicyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + Object.defineProperty(SecurityPolicyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + Object.defineProperty(SecurityPolicyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + */ + Object.defineProperty(SecurityPolicyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPolicyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPolicyList} SecurityPolicyList instance + */ + SecurityPolicyList.create = function create(properties) { + return new SecurityPolicyList(properties); + }; + + /** + * Encodes the specified SecurityPolicyList message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyList} message SecurityPolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.SecurityPolicy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityPolicyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyList} message SecurityPolicyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPolicyList} SecurityPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPolicyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.SecurityPolicy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPolicyList} SecurityPolicyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicyList message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.SecurityPolicy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SecurityPolicyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPolicyList} SecurityPolicyList + */ + SecurityPolicyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPolicyList) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPolicyList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.SecurityPolicyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPolicyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.SecurityPolicy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPolicyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SecurityPolicyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @static + * @param {google.cloud.compute.v1.SecurityPolicyList} message SecurityPolicyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.SecurityPolicy.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this SecurityPolicyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPolicyList + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityPolicyList; + })(); + + v1.SecurityPolicyReference = (function() { + + /** + * Properties of a SecurityPolicyReference. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPolicyReference + * @property {string|null} [securityPolicy] SecurityPolicyReference securityPolicy + */ + + /** + * Constructs a new SecurityPolicyReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPolicyReference. + * @implements ISecurityPolicyReference + * @constructor + * @param {google.cloud.compute.v1.ISecurityPolicyReference=} [properties] Properties to set + */ + function SecurityPolicyReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPolicyReference securityPolicy. + * @member {string|null|undefined} securityPolicy + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @instance + */ + SecurityPolicyReference.prototype.securityPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPolicyReference _securityPolicy. + * @member {"securityPolicy"|undefined} _securityPolicy + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @instance + */ + Object.defineProperty(SecurityPolicyReference.prototype, "_securityPolicy", { + get: $util.oneOfGetter($oneOfFields = ["securityPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPolicyReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPolicyReference} SecurityPolicyReference instance + */ + SecurityPolicyReference.create = function create(properties) { + return new SecurityPolicyReference(properties); + }; + + /** + * Encodes the specified SecurityPolicyReference message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyReference} message SecurityPolicyReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + return writer; + }; + + /** + * Encodes the specified SecurityPolicyReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyReference} message SecurityPolicyReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicyReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPolicyReference} SecurityPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPolicyReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 171082513: + message.securityPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicyReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPolicyReference} SecurityPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicyReference message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicyReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { + properties._securityPolicy = 1; + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + } + return null; + }; + + /** + * Creates a SecurityPolicyReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPolicyReference} SecurityPolicyReference + */ + SecurityPolicyReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPolicyReference) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPolicyReference(); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + return message; + }; + + /** + * Creates a plain object from a SecurityPolicyReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @static + * @param {google.cloud.compute.v1.SecurityPolicyReference} message SecurityPolicyReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicyReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) { + object.securityPolicy = message.securityPolicy; + if (options.oneofs) + object._securityPolicy = "securityPolicy"; + } + return object; + }; + + /** + * Converts this SecurityPolicyReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPolicyReference + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicyReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityPolicyReference; + })(); + + v1.SecurityPolicyRuleMatcher = (function() { + + /** + * Properties of a SecurityPolicyRuleMatcher. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPolicyRuleMatcher + * @property {google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig|null} [config] SecurityPolicyRuleMatcher config + * @property {google.cloud.compute.v1.IExpr|null} [expr] SecurityPolicyRuleMatcher expr + * @property {google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr|null} [versionedExpr] SecurityPolicyRuleMatcher versionedExpr + */ + + /** + * Constructs a new SecurityPolicyRuleMatcher. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPolicyRuleMatcher. + * @implements ISecurityPolicyRuleMatcher + * @constructor + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcher=} [properties] Properties to set + */ + function SecurityPolicyRuleMatcher(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPolicyRuleMatcher config. + * @member {google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig|null|undefined} config + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @instance + */ + SecurityPolicyRuleMatcher.prototype.config = null; + + /** + * SecurityPolicyRuleMatcher expr. + * @member {google.cloud.compute.v1.IExpr|null|undefined} expr + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @instance + */ + SecurityPolicyRuleMatcher.prototype.expr = null; + + /** + * SecurityPolicyRuleMatcher versionedExpr. + * @member {google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr|null|undefined} versionedExpr + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @instance + */ + SecurityPolicyRuleMatcher.prototype.versionedExpr = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SecurityPolicyRuleMatcher _config. + * @member {"config"|undefined} _config + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @instance + */ + Object.defineProperty(SecurityPolicyRuleMatcher.prototype, "_config", { + get: $util.oneOfGetter($oneOfFields = ["config"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyRuleMatcher _expr. + * @member {"expr"|undefined} _expr + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @instance + */ + Object.defineProperty(SecurityPolicyRuleMatcher.prototype, "_expr", { + get: $util.oneOfGetter($oneOfFields = ["expr"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SecurityPolicyRuleMatcher _versionedExpr. + * @member {"versionedExpr"|undefined} _versionedExpr + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @instance + */ + Object.defineProperty(SecurityPolicyRuleMatcher.prototype, "_versionedExpr", { + get: $util.oneOfGetter($oneOfFields = ["versionedExpr"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SecurityPolicyRuleMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcher=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcher} SecurityPolicyRuleMatcher instance + */ + SecurityPolicyRuleMatcher.create = function create(properties) { + return new SecurityPolicyRuleMatcher(properties); + }; + + /** + * Encodes the specified SecurityPolicyRuleMatcher message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcher} message SecurityPolicyRuleMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyRuleMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.google.cloud.compute.v1.Expr.encode(message.expr, writer.uint32(/* id 3127797, wireType 2 =*/25022378).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.encode(message.config, writer.uint32(/* id 255820610, wireType 2 =*/2046564882).fork()).ldelim(); + if (message.versionedExpr != null && Object.hasOwnProperty.call(message, "versionedExpr")) + writer.uint32(/* id 322286013, wireType 0 =*/2578288104).int32(message.versionedExpr); + return writer; + }; + + /** + * Encodes the specified SecurityPolicyRuleMatcher message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcher} message SecurityPolicyRuleMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyRuleMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicyRuleMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcher} SecurityPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyRuleMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 255820610: + message.config = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.decode(reader, reader.uint32()); + break; + case 3127797: + message.expr = $root.google.cloud.compute.v1.Expr.decode(reader, reader.uint32()); + break; + case 322286013: + message.versionedExpr = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicyRuleMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcher} SecurityPolicyRuleMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyRuleMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicyRuleMatcher message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicyRuleMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.config != null && message.hasOwnProperty("config")) { + properties._config = 1; + { + var error = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.verify(message.config); + if (error) + return "config." + error; + } + } + if (message.expr != null && message.hasOwnProperty("expr")) { + properties._expr = 1; + { + var error = $root.google.cloud.compute.v1.Expr.verify(message.expr); + if (error) + return "expr." + error; + } + } + if (message.versionedExpr != null && message.hasOwnProperty("versionedExpr")) { + properties._versionedExpr = 1; + switch (message.versionedExpr) { + default: + return "versionedExpr: enum value expected"; + case 0: + case 70925961: + break; + } + } + return null; + }; + + /** + * Creates a SecurityPolicyRuleMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcher} SecurityPolicyRuleMatcher + */ + SecurityPolicyRuleMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPolicyRuleMatcher.config: object expected"); + message.config = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.fromObject(object.config); + } + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".google.cloud.compute.v1.SecurityPolicyRuleMatcher.expr: object expected"); + message.expr = $root.google.cloud.compute.v1.Expr.fromObject(object.expr); + } + switch (object.versionedExpr) { + case "UNDEFINED_VERSIONED_EXPR": + case 0: + message.versionedExpr = 0; + break; + case "SRC_IPS_V1": + case 70925961: + message.versionedExpr = 70925961; + break; + } + return message; + }; + + /** + * Creates a plain object from a SecurityPolicyRuleMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @static + * @param {google.cloud.compute.v1.SecurityPolicyRuleMatcher} message SecurityPolicyRuleMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicyRuleMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.expr != null && message.hasOwnProperty("expr")) { + object.expr = $root.google.cloud.compute.v1.Expr.toObject(message.expr, options); + if (options.oneofs) + object._expr = "expr"; + } + if (message.config != null && message.hasOwnProperty("config")) { + object.config = $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.toObject(message.config, options); + if (options.oneofs) + object._config = "config"; + } + if (message.versionedExpr != null && message.hasOwnProperty("versionedExpr")) { + object.versionedExpr = options.enums === String ? $root.google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr[message.versionedExpr] : message.versionedExpr; + if (options.oneofs) + object._versionedExpr = "versionedExpr"; + } + return object; + }; + + /** + * Converts this SecurityPolicyRuleMatcher to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcher + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicyRuleMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * VersionedExpr enum. + * @name google.cloud.compute.v1.SecurityPolicyRuleMatcher.VersionedExpr + * @enum {number} + * @property {number} UNDEFINED_VERSIONED_EXPR=0 UNDEFINED_VERSIONED_EXPR value + * @property {number} SRC_IPS_V1=70925961 SRC_IPS_V1 value + */ + SecurityPolicyRuleMatcher.VersionedExpr = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_VERSIONED_EXPR"] = 0; + values[valuesById[70925961] = "SRC_IPS_V1"] = 70925961; + return values; + })(); + + return SecurityPolicyRuleMatcher; + })(); + + v1.SecurityPolicyRuleMatcherConfig = (function() { + + /** + * Properties of a SecurityPolicyRuleMatcherConfig. + * @memberof google.cloud.compute.v1 + * @interface ISecurityPolicyRuleMatcherConfig + * @property {Array.|null} [srcIpRanges] SecurityPolicyRuleMatcherConfig srcIpRanges + */ + + /** + * Constructs a new SecurityPolicyRuleMatcherConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPolicyRuleMatcherConfig. + * @implements ISecurityPolicyRuleMatcherConfig + * @constructor + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig=} [properties] Properties to set + */ + function SecurityPolicyRuleMatcherConfig(properties) { + this.srcIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityPolicyRuleMatcherConfig srcIpRanges. + * @member {Array.} srcIpRanges + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @instance + */ + SecurityPolicyRuleMatcherConfig.prototype.srcIpRanges = $util.emptyArray; + + /** + * Creates a new SecurityPolicyRuleMatcherConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig} SecurityPolicyRuleMatcherConfig instance + */ + SecurityPolicyRuleMatcherConfig.create = function create(properties) { + return new SecurityPolicyRuleMatcherConfig(properties); + }; + + /** + * Encodes the specified SecurityPolicyRuleMatcherConfig message. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig} message SecurityPolicyRuleMatcherConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyRuleMatcherConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.srcIpRanges != null && message.srcIpRanges.length) + for (var i = 0; i < message.srcIpRanges.length; ++i) + writer.uint32(/* id 432128083, wireType 2 =*/3457024666).string(message.srcIpRanges[i]); + return writer; + }; + + /** + * Encodes the specified SecurityPolicyRuleMatcherConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {google.cloud.compute.v1.ISecurityPolicyRuleMatcherConfig} message SecurityPolicyRuleMatcherConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityPolicyRuleMatcherConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityPolicyRuleMatcherConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig} SecurityPolicyRuleMatcherConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyRuleMatcherConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 432128083: + if (!(message.srcIpRanges && message.srcIpRanges.length)) + message.srcIpRanges = []; + message.srcIpRanges.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityPolicyRuleMatcherConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig} SecurityPolicyRuleMatcherConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityPolicyRuleMatcherConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityPolicyRuleMatcherConfig message. + * @function verify + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityPolicyRuleMatcherConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.srcIpRanges != null && message.hasOwnProperty("srcIpRanges")) { + if (!Array.isArray(message.srcIpRanges)) + return "srcIpRanges: array expected"; + for (var i = 0; i < message.srcIpRanges.length; ++i) + if (!$util.isString(message.srcIpRanges[i])) + return "srcIpRanges: string[] expected"; + } + return null; + }; + + /** + * Creates a SecurityPolicyRuleMatcherConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig} SecurityPolicyRuleMatcherConfig + */ + SecurityPolicyRuleMatcherConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig) + return object; + var message = new $root.google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig(); + if (object.srcIpRanges) { + if (!Array.isArray(object.srcIpRanges)) + throw TypeError(".google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig.srcIpRanges: array expected"); + message.srcIpRanges = []; + for (var i = 0; i < object.srcIpRanges.length; ++i) + message.srcIpRanges[i] = String(object.srcIpRanges[i]); + } + return message; + }; + + /** + * Creates a plain object from a SecurityPolicyRuleMatcherConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @static + * @param {google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig} message SecurityPolicyRuleMatcherConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityPolicyRuleMatcherConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.srcIpRanges = []; + if (message.srcIpRanges && message.srcIpRanges.length) { + object.srcIpRanges = []; + for (var j = 0; j < message.srcIpRanges.length; ++j) + object.srcIpRanges[j] = message.srcIpRanges[j]; + } + return object; + }; + + /** + * Converts this SecurityPolicyRuleMatcherConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SecurityPolicyRuleMatcherConfig + * @instance + * @returns {Object.} JSON object + */ + SecurityPolicyRuleMatcherConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SecurityPolicyRuleMatcherConfig; + })(); + + v1.SerialPortOutput = (function() { + + /** + * Properties of a SerialPortOutput. + * @memberof google.cloud.compute.v1 + * @interface ISerialPortOutput + * @property {string|null} [contents] SerialPortOutput contents + * @property {string|null} [kind] SerialPortOutput kind + * @property {number|Long|null} [next] SerialPortOutput next + * @property {string|null} [selfLink] SerialPortOutput selfLink + * @property {number|Long|null} [start] SerialPortOutput start + */ + + /** + * Constructs a new SerialPortOutput. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SerialPortOutput. + * @implements ISerialPortOutput + * @constructor + * @param {google.cloud.compute.v1.ISerialPortOutput=} [properties] Properties to set + */ + function SerialPortOutput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SerialPortOutput contents. + * @member {string|null|undefined} contents + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + SerialPortOutput.prototype.contents = null; + + /** + * SerialPortOutput kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + SerialPortOutput.prototype.kind = null; + + /** + * SerialPortOutput next. + * @member {number|Long|null|undefined} next + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + SerialPortOutput.prototype.next = null; + + /** + * SerialPortOutput selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + SerialPortOutput.prototype.selfLink = null; + + /** + * SerialPortOutput start. + * @member {number|Long|null|undefined} start + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + SerialPortOutput.prototype.start = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SerialPortOutput _contents. + * @member {"contents"|undefined} _contents + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + Object.defineProperty(SerialPortOutput.prototype, "_contents", { + get: $util.oneOfGetter($oneOfFields = ["contents"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SerialPortOutput _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + Object.defineProperty(SerialPortOutput.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SerialPortOutput _next. + * @member {"next"|undefined} _next + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + Object.defineProperty(SerialPortOutput.prototype, "_next", { + get: $util.oneOfGetter($oneOfFields = ["next"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SerialPortOutput _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + Object.defineProperty(SerialPortOutput.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SerialPortOutput _start. + * @member {"start"|undefined} _start + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + */ + Object.defineProperty(SerialPortOutput.prototype, "_start", { + get: $util.oneOfGetter($oneOfFields = ["start"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SerialPortOutput instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {google.cloud.compute.v1.ISerialPortOutput=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SerialPortOutput} SerialPortOutput instance + */ + SerialPortOutput.create = function create(properties) { + return new SerialPortOutput(properties); + }; + + /** + * Encodes the specified SerialPortOutput message. Does not implicitly {@link google.cloud.compute.v1.SerialPortOutput.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {google.cloud.compute.v1.ISerialPortOutput} message SerialPortOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerialPortOutput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.next != null && Object.hasOwnProperty.call(message, "next")) + writer.uint32(/* id 3377907, wireType 0 =*/27023256).int64(message.next); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 109757538, wireType 0 =*/878060304).int64(message.start); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.contents != null && Object.hasOwnProperty.call(message, "contents")) + writer.uint32(/* id 506419994, wireType 2 =*/4051359954).string(message.contents); + return writer; + }; + + /** + * Encodes the specified SerialPortOutput message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SerialPortOutput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {google.cloud.compute.v1.ISerialPortOutput} message SerialPortOutput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SerialPortOutput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SerialPortOutput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SerialPortOutput} SerialPortOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerialPortOutput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SerialPortOutput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 506419994: + message.contents = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3377907: + message.next = reader.int64(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 109757538: + message.start = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SerialPortOutput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SerialPortOutput} SerialPortOutput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SerialPortOutput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SerialPortOutput message. + * @function verify + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SerialPortOutput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.contents != null && message.hasOwnProperty("contents")) { + properties._contents = 1; + if (!$util.isString(message.contents)) + return "contents: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.next != null && message.hasOwnProperty("next")) { + properties._next = 1; + if (!$util.isInteger(message.next) && !(message.next && $util.isInteger(message.next.low) && $util.isInteger(message.next.high))) + return "next: integer|Long expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.start != null && message.hasOwnProperty("start")) { + properties._start = 1; + if (!$util.isInteger(message.start) && !(message.start && $util.isInteger(message.start.low) && $util.isInteger(message.start.high))) + return "start: integer|Long expected"; + } + return null; + }; + + /** + * Creates a SerialPortOutput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SerialPortOutput} SerialPortOutput + */ + SerialPortOutput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SerialPortOutput) + return object; + var message = new $root.google.cloud.compute.v1.SerialPortOutput(); + if (object.contents != null) + message.contents = String(object.contents); + if (object.kind != null) + message.kind = String(object.kind); + if (object.next != null) + if ($util.Long) + (message.next = $util.Long.fromValue(object.next)).unsigned = false; + else if (typeof object.next === "string") + message.next = parseInt(object.next, 10); + else if (typeof object.next === "number") + message.next = object.next; + else if (typeof object.next === "object") + message.next = new $util.LongBits(object.next.low >>> 0, object.next.high >>> 0).toNumber(); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.start != null) + if ($util.Long) + (message.start = $util.Long.fromValue(object.start)).unsigned = false; + else if (typeof object.start === "string") + message.start = parseInt(object.start, 10); + else if (typeof object.start === "number") + message.start = object.start; + else if (typeof object.start === "object") + message.start = new $util.LongBits(object.start.low >>> 0, object.start.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SerialPortOutput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SerialPortOutput + * @static + * @param {google.cloud.compute.v1.SerialPortOutput} message SerialPortOutput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SerialPortOutput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.next != null && message.hasOwnProperty("next")) { + if (typeof message.next === "number") + object.next = options.longs === String ? String(message.next) : message.next; + else + object.next = options.longs === String ? $util.Long.prototype.toString.call(message.next) : options.longs === Number ? new $util.LongBits(message.next.low >>> 0, message.next.high >>> 0).toNumber() : message.next; + if (options.oneofs) + object._next = "next"; + } + if (message.start != null && message.hasOwnProperty("start")) { + if (typeof message.start === "number") + object.start = options.longs === String ? String(message.start) : message.start; + else + object.start = options.longs === String ? $util.Long.prototype.toString.call(message.start) : options.longs === Number ? new $util.LongBits(message.start.low >>> 0, message.start.high >>> 0).toNumber() : message.start; + if (options.oneofs) + object._start = "start"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.contents != null && message.hasOwnProperty("contents")) { + object.contents = message.contents; + if (options.oneofs) + object._contents = "contents"; + } + return object; + }; + + /** + * Converts this SerialPortOutput to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SerialPortOutput + * @instance + * @returns {Object.} JSON object + */ + SerialPortOutput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SerialPortOutput; + })(); + + v1.ShieldedInstanceIdentityEntry = (function() { + + /** + * Properties of a ShieldedInstanceIdentityEntry. + * @memberof google.cloud.compute.v1 + * @interface IShieldedInstanceIdentityEntry + * @property {string|null} [ekCert] ShieldedInstanceIdentityEntry ekCert + * @property {string|null} [ekPub] ShieldedInstanceIdentityEntry ekPub + */ + + /** + * Constructs a new ShieldedInstanceIdentityEntry. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ShieldedInstanceIdentityEntry. + * @implements IShieldedInstanceIdentityEntry + * @constructor + * @param {google.cloud.compute.v1.IShieldedInstanceIdentityEntry=} [properties] Properties to set + */ + function ShieldedInstanceIdentityEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShieldedInstanceIdentityEntry ekCert. + * @member {string|null|undefined} ekCert + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @instance + */ + ShieldedInstanceIdentityEntry.prototype.ekCert = null; + + /** + * ShieldedInstanceIdentityEntry ekPub. + * @member {string|null|undefined} ekPub + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @instance + */ + ShieldedInstanceIdentityEntry.prototype.ekPub = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ShieldedInstanceIdentityEntry _ekCert. + * @member {"ekCert"|undefined} _ekCert + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @instance + */ + Object.defineProperty(ShieldedInstanceIdentityEntry.prototype, "_ekCert", { + get: $util.oneOfGetter($oneOfFields = ["ekCert"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ShieldedInstanceIdentityEntry _ekPub. + * @member {"ekPub"|undefined} _ekPub + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @instance + */ + Object.defineProperty(ShieldedInstanceIdentityEntry.prototype, "_ekPub", { + get: $util.oneOfGetter($oneOfFields = ["ekPub"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ShieldedInstanceIdentityEntry instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIdentityEntry=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentityEntry} ShieldedInstanceIdentityEntry instance + */ + ShieldedInstanceIdentityEntry.create = function create(properties) { + return new ShieldedInstanceIdentityEntry(properties); + }; + + /** + * Encodes the specified ShieldedInstanceIdentityEntry message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentityEntry.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIdentityEntry} message ShieldedInstanceIdentityEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceIdentityEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ekPub != null && Object.hasOwnProperty.call(message, "ekPub")) + writer.uint32(/* id 308947940, wireType 2 =*/2471583522).string(message.ekPub); + if (message.ekCert != null && Object.hasOwnProperty.call(message, "ekCert")) + writer.uint32(/* id 450178589, wireType 2 =*/3601428714).string(message.ekCert); + return writer; + }; + + /** + * Encodes the specified ShieldedInstanceIdentityEntry message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentityEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIdentityEntry} message ShieldedInstanceIdentityEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceIdentityEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShieldedInstanceIdentityEntry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentityEntry} ShieldedInstanceIdentityEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceIdentityEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 450178589: + message.ekCert = reader.string(); + break; + case 308947940: + message.ekPub = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShieldedInstanceIdentityEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentityEntry} ShieldedInstanceIdentityEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceIdentityEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShieldedInstanceIdentityEntry message. + * @function verify + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShieldedInstanceIdentityEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ekCert != null && message.hasOwnProperty("ekCert")) { + properties._ekCert = 1; + if (!$util.isString(message.ekCert)) + return "ekCert: string expected"; + } + if (message.ekPub != null && message.hasOwnProperty("ekPub")) { + properties._ekPub = 1; + if (!$util.isString(message.ekPub)) + return "ekPub: string expected"; + } + return null; + }; + + /** + * Creates a ShieldedInstanceIdentityEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentityEntry} ShieldedInstanceIdentityEntry + */ + ShieldedInstanceIdentityEntry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry) + return object; + var message = new $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry(); + if (object.ekCert != null) + message.ekCert = String(object.ekCert); + if (object.ekPub != null) + message.ekPub = String(object.ekPub); + return message; + }; + + /** + * Creates a plain object from a ShieldedInstanceIdentityEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @static + * @param {google.cloud.compute.v1.ShieldedInstanceIdentityEntry} message ShieldedInstanceIdentityEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShieldedInstanceIdentityEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ekPub != null && message.hasOwnProperty("ekPub")) { + object.ekPub = message.ekPub; + if (options.oneofs) + object._ekPub = "ekPub"; + } + if (message.ekCert != null && message.hasOwnProperty("ekCert")) { + object.ekCert = message.ekCert; + if (options.oneofs) + object._ekCert = "ekCert"; + } + return object; + }; + + /** + * Converts this ShieldedInstanceIdentityEntry to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentityEntry + * @instance + * @returns {Object.} JSON object + */ + ShieldedInstanceIdentityEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ShieldedInstanceIdentityEntry; + })(); + + v1.ShieldedInstanceIdentity = (function() { + + /** + * Properties of a ShieldedInstanceIdentity. + * @memberof google.cloud.compute.v1 + * @interface IShieldedInstanceIdentity + * @property {google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null} [encryptionKey] ShieldedInstanceIdentity encryptionKey + * @property {string|null} [kind] ShieldedInstanceIdentity kind + * @property {google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null} [signingKey] ShieldedInstanceIdentity signingKey + */ + + /** + * Constructs a new ShieldedInstanceIdentity. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ShieldedInstanceIdentity. + * @implements IShieldedInstanceIdentity + * @constructor + * @param {google.cloud.compute.v1.IShieldedInstanceIdentity=} [properties] Properties to set + */ + function ShieldedInstanceIdentity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShieldedInstanceIdentity encryptionKey. + * @member {google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null|undefined} encryptionKey + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @instance + */ + ShieldedInstanceIdentity.prototype.encryptionKey = null; + + /** + * ShieldedInstanceIdentity kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @instance + */ + ShieldedInstanceIdentity.prototype.kind = null; + + /** + * ShieldedInstanceIdentity signingKey. + * @member {google.cloud.compute.v1.IShieldedInstanceIdentityEntry|null|undefined} signingKey + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @instance + */ + ShieldedInstanceIdentity.prototype.signingKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ShieldedInstanceIdentity _encryptionKey. + * @member {"encryptionKey"|undefined} _encryptionKey + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @instance + */ + Object.defineProperty(ShieldedInstanceIdentity.prototype, "_encryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["encryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ShieldedInstanceIdentity _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @instance + */ + Object.defineProperty(ShieldedInstanceIdentity.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ShieldedInstanceIdentity _signingKey. + * @member {"signingKey"|undefined} _signingKey + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @instance + */ + Object.defineProperty(ShieldedInstanceIdentity.prototype, "_signingKey", { + get: $util.oneOfGetter($oneOfFields = ["signingKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ShieldedInstanceIdentity instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIdentity=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentity} ShieldedInstanceIdentity instance + */ + ShieldedInstanceIdentity.create = function create(properties) { + return new ShieldedInstanceIdentity(properties); + }; + + /** + * Encodes the specified ShieldedInstanceIdentity message. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentity.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIdentity} message ShieldedInstanceIdentity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceIdentity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.signingKey != null && Object.hasOwnProperty.call(message, "signingKey")) + $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.encode(message.signingKey, writer.uint32(/* id 320948261, wireType 2 =*/2567586090).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.encode(message.encryptionKey, writer.uint32(/* id 488268707, wireType 2 =*/3906149658).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ShieldedInstanceIdentity message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ShieldedInstanceIdentity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {google.cloud.compute.v1.IShieldedInstanceIdentity} message ShieldedInstanceIdentity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceIdentity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShieldedInstanceIdentity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentity} ShieldedInstanceIdentity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceIdentity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ShieldedInstanceIdentity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 488268707: + message.encryptionKey = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.decode(reader, reader.uint32()); + break; + case 3292052: + message.kind = reader.string(); + break; + case 320948261: + message.signingKey = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShieldedInstanceIdentity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentity} ShieldedInstanceIdentity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceIdentity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShieldedInstanceIdentity message. + * @function verify + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShieldedInstanceIdentity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) { + properties._encryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.verify(message.encryptionKey); + if (error) + return "encryptionKey." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.signingKey != null && message.hasOwnProperty("signingKey")) { + properties._signingKey = 1; + { + var error = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.verify(message.signingKey); + if (error) + return "signingKey." + error; + } + } + return null; + }; + + /** + * Creates a ShieldedInstanceIdentity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ShieldedInstanceIdentity} ShieldedInstanceIdentity + */ + ShieldedInstanceIdentity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ShieldedInstanceIdentity) + return object; + var message = new $root.google.cloud.compute.v1.ShieldedInstanceIdentity(); + if (object.encryptionKey != null) { + if (typeof object.encryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.ShieldedInstanceIdentity.encryptionKey: object expected"); + message.encryptionKey = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.fromObject(object.encryptionKey); + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.signingKey != null) { + if (typeof object.signingKey !== "object") + throw TypeError(".google.cloud.compute.v1.ShieldedInstanceIdentity.signingKey: object expected"); + message.signingKey = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.fromObject(object.signingKey); + } + return message; + }; + + /** + * Creates a plain object from a ShieldedInstanceIdentity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @static + * @param {google.cloud.compute.v1.ShieldedInstanceIdentity} message ShieldedInstanceIdentity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShieldedInstanceIdentity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.signingKey != null && message.hasOwnProperty("signingKey")) { + object.signingKey = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.toObject(message.signingKey, options); + if (options.oneofs) + object._signingKey = "signingKey"; + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) { + object.encryptionKey = $root.google.cloud.compute.v1.ShieldedInstanceIdentityEntry.toObject(message.encryptionKey, options); + if (options.oneofs) + object._encryptionKey = "encryptionKey"; + } + return object; + }; + + /** + * Converts this ShieldedInstanceIdentity to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ShieldedInstanceIdentity + * @instance + * @returns {Object.} JSON object + */ + ShieldedInstanceIdentity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ShieldedInstanceIdentity; + })(); + + v1.SignedUrlKey = (function() { + + /** + * Properties of a SignedUrlKey. + * @memberof google.cloud.compute.v1 + * @interface ISignedUrlKey + * @property {string|null} [keyName] SignedUrlKey keyName + * @property {string|null} [keyValue] SignedUrlKey keyValue + */ + + /** + * Constructs a new SignedUrlKey. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SignedUrlKey. + * @implements ISignedUrlKey + * @constructor + * @param {google.cloud.compute.v1.ISignedUrlKey=} [properties] Properties to set + */ + function SignedUrlKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SignedUrlKey keyName. + * @member {string|null|undefined} keyName + * @memberof google.cloud.compute.v1.SignedUrlKey + * @instance + */ + SignedUrlKey.prototype.keyName = null; + + /** + * SignedUrlKey keyValue. + * @member {string|null|undefined} keyValue + * @memberof google.cloud.compute.v1.SignedUrlKey + * @instance + */ + SignedUrlKey.prototype.keyValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SignedUrlKey _keyName. + * @member {"keyName"|undefined} _keyName + * @memberof google.cloud.compute.v1.SignedUrlKey + * @instance + */ + Object.defineProperty(SignedUrlKey.prototype, "_keyName", { + get: $util.oneOfGetter($oneOfFields = ["keyName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SignedUrlKey _keyValue. + * @member {"keyValue"|undefined} _keyValue + * @memberof google.cloud.compute.v1.SignedUrlKey + * @instance + */ + Object.defineProperty(SignedUrlKey.prototype, "_keyValue", { + get: $util.oneOfGetter($oneOfFields = ["keyValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SignedUrlKey instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {google.cloud.compute.v1.ISignedUrlKey=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SignedUrlKey} SignedUrlKey instance + */ + SignedUrlKey.create = function create(properties) { + return new SignedUrlKey(properties); + }; + + /** + * Encodes the specified SignedUrlKey message. Does not implicitly {@link google.cloud.compute.v1.SignedUrlKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {google.cloud.compute.v1.ISignedUrlKey} message SignedUrlKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedUrlKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 500938859, wireType 2 =*/4007510874).string(message.keyName); + if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) + writer.uint32(/* id 504106897, wireType 2 =*/4032855178).string(message.keyValue); + return writer; + }; + + /** + * Encodes the specified SignedUrlKey message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SignedUrlKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {google.cloud.compute.v1.ISignedUrlKey} message SignedUrlKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SignedUrlKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SignedUrlKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SignedUrlKey} SignedUrlKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedUrlKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SignedUrlKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 500938859: + message.keyName = reader.string(); + break; + case 504106897: + message.keyValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SignedUrlKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SignedUrlKey} SignedUrlKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SignedUrlKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SignedUrlKey message. + * @function verify + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SignedUrlKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.keyName != null && message.hasOwnProperty("keyName")) { + properties._keyName = 1; + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + } + if (message.keyValue != null && message.hasOwnProperty("keyValue")) { + properties._keyValue = 1; + if (!$util.isString(message.keyValue)) + return "keyValue: string expected"; + } + return null; + }; + + /** + * Creates a SignedUrlKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SignedUrlKey} SignedUrlKey + */ + SignedUrlKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SignedUrlKey) + return object; + var message = new $root.google.cloud.compute.v1.SignedUrlKey(); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.keyValue != null) + message.keyValue = String(object.keyValue); + return message; + }; + + /** + * Creates a plain object from a SignedUrlKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SignedUrlKey + * @static + * @param {google.cloud.compute.v1.SignedUrlKey} message SignedUrlKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SignedUrlKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.keyName != null && message.hasOwnProperty("keyName")) { + object.keyName = message.keyName; + if (options.oneofs) + object._keyName = "keyName"; + } + if (message.keyValue != null && message.hasOwnProperty("keyValue")) { + object.keyValue = message.keyValue; + if (options.oneofs) + object._keyValue = "keyValue"; + } + return object; + }; + + /** + * Converts this SignedUrlKey to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SignedUrlKey + * @instance + * @returns {Object.} JSON object + */ + SignedUrlKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SignedUrlKey; + })(); + + v1.Snapshot = (function() { + + /** + * Properties of a Snapshot. + * @memberof google.cloud.compute.v1 + * @interface ISnapshot + * @property {boolean|null} [autoCreated] Snapshot autoCreated + * @property {string|null} [chainName] Snapshot chainName + * @property {string|null} [creationTimestamp] Snapshot creationTimestamp + * @property {string|null} [description] Snapshot description + * @property {number|Long|null} [diskSizeGb] Snapshot diskSizeGb + * @property {number|Long|null} [downloadBytes] Snapshot downloadBytes + * @property {number|Long|null} [id] Snapshot id + * @property {string|null} [kind] Snapshot kind + * @property {string|null} [labelFingerprint] Snapshot labelFingerprint + * @property {Object.|null} [labels] Snapshot labels + * @property {Array.|null} [licenseCodes] Snapshot licenseCodes + * @property {Array.|null} [licenses] Snapshot licenses + * @property {string|null} [locationHint] Snapshot locationHint + * @property {string|null} [name] Snapshot name + * @property {boolean|null} [satisfiesPzs] Snapshot satisfiesPzs + * @property {string|null} [selfLink] Snapshot selfLink + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [snapshotEncryptionKey] Snapshot snapshotEncryptionKey + * @property {string|null} [sourceDisk] Snapshot sourceDisk + * @property {google.cloud.compute.v1.ICustomerEncryptionKey|null} [sourceDiskEncryptionKey] Snapshot sourceDiskEncryptionKey + * @property {string|null} [sourceDiskId] Snapshot sourceDiskId + * @property {google.cloud.compute.v1.Snapshot.Status|null} [status] Snapshot status + * @property {number|Long|null} [storageBytes] Snapshot storageBytes + * @property {google.cloud.compute.v1.Snapshot.StorageBytesStatus|null} [storageBytesStatus] Snapshot storageBytesStatus + * @property {Array.|null} [storageLocations] Snapshot storageLocations + */ + + /** + * Constructs a new Snapshot. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {google.cloud.compute.v1.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + this.labels = {}; + this.licenseCodes = []; + this.licenses = []; + this.storageLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot autoCreated. + * @member {boolean|null|undefined} autoCreated + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.autoCreated = null; + + /** + * Snapshot chainName. + * @member {string|null|undefined} chainName + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.chainName = null; + + /** + * Snapshot creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.creationTimestamp = null; + + /** + * Snapshot description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.description = null; + + /** + * Snapshot diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.diskSizeGb = null; + + /** + * Snapshot downloadBytes. + * @member {number|Long|null|undefined} downloadBytes + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.downloadBytes = null; + + /** + * Snapshot id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.id = null; + + /** + * Snapshot kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.kind = null; + + /** + * Snapshot labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.labelFingerprint = null; + + /** + * Snapshot labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.labels = $util.emptyObject; + + /** + * Snapshot licenseCodes. + * @member {Array.} licenseCodes + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.licenseCodes = $util.emptyArray; + + /** + * Snapshot licenses. + * @member {Array.} licenses + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.licenses = $util.emptyArray; + + /** + * Snapshot locationHint. + * @member {string|null|undefined} locationHint + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.locationHint = null; + + /** + * Snapshot name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.name = null; + + /** + * Snapshot satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.satisfiesPzs = null; + + /** + * Snapshot selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.selfLink = null; + + /** + * Snapshot snapshotEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} snapshotEncryptionKey + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.snapshotEncryptionKey = null; + + /** + * Snapshot sourceDisk. + * @member {string|null|undefined} sourceDisk + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.sourceDisk = null; + + /** + * Snapshot sourceDiskEncryptionKey. + * @member {google.cloud.compute.v1.ICustomerEncryptionKey|null|undefined} sourceDiskEncryptionKey + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.sourceDiskEncryptionKey = null; + + /** + * Snapshot sourceDiskId. + * @member {string|null|undefined} sourceDiskId + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.sourceDiskId = null; + + /** + * Snapshot status. + * @member {google.cloud.compute.v1.Snapshot.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.status = null; + + /** + * Snapshot storageBytes. + * @member {number|Long|null|undefined} storageBytes + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.storageBytes = null; + + /** + * Snapshot storageBytesStatus. + * @member {google.cloud.compute.v1.Snapshot.StorageBytesStatus|null|undefined} storageBytesStatus + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.storageBytesStatus = null; + + /** + * Snapshot storageLocations. + * @member {Array.} storageLocations + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Snapshot.prototype.storageLocations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Snapshot _autoCreated. + * @member {"autoCreated"|undefined} _autoCreated + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_autoCreated", { + get: $util.oneOfGetter($oneOfFields = ["autoCreated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _chainName. + * @member {"chainName"|undefined} _chainName + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_chainName", { + get: $util.oneOfGetter($oneOfFields = ["chainName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _downloadBytes. + * @member {"downloadBytes"|undefined} _downloadBytes + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_downloadBytes", { + get: $util.oneOfGetter($oneOfFields = ["downloadBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _locationHint. + * @member {"locationHint"|undefined} _locationHint + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_locationHint", { + get: $util.oneOfGetter($oneOfFields = ["locationHint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _satisfiesPzs. + * @member {"satisfiesPzs"|undefined} _satisfiesPzs + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _snapshotEncryptionKey. + * @member {"snapshotEncryptionKey"|undefined} _snapshotEncryptionKey + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_snapshotEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["snapshotEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _sourceDisk. + * @member {"sourceDisk"|undefined} _sourceDisk + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_sourceDisk", { + get: $util.oneOfGetter($oneOfFields = ["sourceDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _sourceDiskEncryptionKey. + * @member {"sourceDiskEncryptionKey"|undefined} _sourceDiskEncryptionKey + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_sourceDiskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["sourceDiskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _sourceDiskId. + * @member {"sourceDiskId"|undefined} _sourceDiskId + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_sourceDiskId", { + get: $util.oneOfGetter($oneOfFields = ["sourceDiskId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _storageBytes. + * @member {"storageBytes"|undefined} _storageBytes + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_storageBytes", { + get: $util.oneOfGetter($oneOfFields = ["storageBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Snapshot _storageBytesStatus. + * @member {"storageBytesStatus"|undefined} _storageBytesStatus + * @memberof google.cloud.compute.v1.Snapshot + * @instance + */ + Object.defineProperty(Snapshot.prototype, "_storageBytesStatus", { + get: $util.oneOfGetter($oneOfFields = ["storageBytesStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {google.cloud.compute.v1.ISnapshot=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.cloud.compute.v1.Snapshot.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {google.cloud.compute.v1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.snapshotEncryptionKey != null && Object.hasOwnProperty.call(message, "snapshotEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.snapshotEncryptionKey, writer.uint32(/* id 43334526, wireType 2 =*/346676210).fork()).ldelim(); + if (message.licenseCodes != null && message.licenseCodes.length) { + writer.uint32(/* id 45482664, wireType 2 =*/363861314).fork(); + for (var i = 0; i < message.licenseCodes.length; ++i) + writer.int64(message.licenseCodes[i]); + writer.ldelim(); + } + if (message.chainName != null && Object.hasOwnProperty.call(message, "chainName")) + writer.uint32(/* id 68644169, wireType 2 =*/549153354).string(message.chainName); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 316263735, wireType 0 =*/2530109880).int64(message.diskSizeGb); + if (message.storageLocations != null && message.storageLocations.length) + for (var i = 0; i < message.storageLocations.length; ++i) + writer.uint32(/* id 328005274, wireType 2 =*/2624042194).string(message.storageLocations[i]); + if (message.licenses != null && message.licenses.length) + for (var i = 0; i < message.licenses.length; ++i) + writer.uint32(/* id 337642578, wireType 2 =*/2701140626).string(message.licenses[i]); + if (message.locationHint != null && Object.hasOwnProperty.call(message, "locationHint")) + writer.uint32(/* id 350519505, wireType 2 =*/2804156042).string(message.locationHint); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.storageBytes != null && Object.hasOwnProperty.call(message, "storageBytes")) + writer.uint32(/* id 424631719, wireType 0 =*/3397053752).int64(message.storageBytes); + if (message.downloadBytes != null && Object.hasOwnProperty.call(message, "downloadBytes")) + writer.uint32(/* id 435054068, wireType 0 =*/3480432544).int64(message.downloadBytes); + if (message.sourceDisk != null && Object.hasOwnProperty.call(message, "sourceDisk")) + writer.uint32(/* id 451753793, wireType 2 =*/3614030346).string(message.sourceDisk); + if (message.sourceDiskId != null && Object.hasOwnProperty.call(message, "sourceDiskId")) + writer.uint32(/* id 454190809, wireType 2 =*/3633526474).string(message.sourceDiskId); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.autoCreated != null && Object.hasOwnProperty.call(message, "autoCreated")) + writer.uint32(/* id 463922264, wireType 0 =*/3711378112).bool(message.autoCreated); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 480964267, wireType 0 =*/3847714136).bool(message.satisfiesPzs); + if (message.storageBytesStatus != null && Object.hasOwnProperty.call(message, "storageBytesStatus")) + writer.uint32(/* id 490739082, wireType 0 =*/3925912656).int32(message.storageBytesStatus); + 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 500195327, wireType 2 =*/4001562618).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.sourceDiskEncryptionKey != null && Object.hasOwnProperty.call(message, "sourceDiskEncryptionKey")) + $root.google.cloud.compute.v1.CustomerEncryptionKey.encode(message.sourceDiskEncryptionKey, writer.uint32(/* id 531501153, wireType 2 =*/4252009226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {google.cloud.compute.v1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Snapshot(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 463922264: + message.autoCreated = reader.bool(); + break; + case 68644169: + message.chainName = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 316263735: + message.diskSizeGb = reader.int64(); + break; + case 435054068: + message.downloadBytes = reader.int64(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 45482664: + if (!(message.licenseCodes && message.licenseCodes.length)) + message.licenseCodes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.licenseCodes.push(reader.int64()); + } else + message.licenseCodes.push(reader.int64()); + break; + case 337642578: + if (!(message.licenses && message.licenses.length)) + message.licenses = []; + message.licenses.push(reader.string()); + break; + case 350519505: + message.locationHint = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 480964267: + message.satisfiesPzs = reader.bool(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 43334526: + message.snapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 451753793: + message.sourceDisk = reader.string(); + break; + case 531501153: + message.sourceDiskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + case 454190809: + message.sourceDiskId = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 424631719: + message.storageBytes = reader.int64(); + break; + case 490739082: + message.storageBytesStatus = reader.int32(); + break; + case 328005274: + if (!(message.storageLocations && message.storageLocations.length)) + message.storageLocations = []; + message.storageLocations.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoCreated != null && message.hasOwnProperty("autoCreated")) { + properties._autoCreated = 1; + if (typeof message.autoCreated !== "boolean") + return "autoCreated: boolean expected"; + } + if (message.chainName != null && message.hasOwnProperty("chainName")) { + properties._chainName = 1; + if (!$util.isString(message.chainName)) + return "chainName: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) { + properties._downloadBytes = 1; + if (!$util.isInteger(message.downloadBytes) && !(message.downloadBytes && $util.isInteger(message.downloadBytes.low) && $util.isInteger(message.downloadBytes.high))) + return "downloadBytes: integer|Long expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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.licenseCodes != null && message.hasOwnProperty("licenseCodes")) { + if (!Array.isArray(message.licenseCodes)) + return "licenseCodes: array expected"; + for (var i = 0; i < message.licenseCodes.length; ++i) + if (!$util.isInteger(message.licenseCodes[i]) && !(message.licenseCodes[i] && $util.isInteger(message.licenseCodes[i].low) && $util.isInteger(message.licenseCodes[i].high))) + return "licenseCodes: integer|Long[] expected"; + } + if (message.licenses != null && message.hasOwnProperty("licenses")) { + if (!Array.isArray(message.licenses)) + return "licenses: array expected"; + for (var i = 0; i < message.licenses.length; ++i) + if (!$util.isString(message.licenses[i])) + return "licenses: string[] expected"; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + properties._locationHint = 1; + if (!$util.isString(message.locationHint)) + return "locationHint: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.snapshotEncryptionKey != null && message.hasOwnProperty("snapshotEncryptionKey")) { + properties._snapshotEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.snapshotEncryptionKey); + if (error) + return "snapshotEncryptionKey." + error; + } + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + properties._sourceDisk = 1; + if (!$util.isString(message.sourceDisk)) + return "sourceDisk: string expected"; + } + if (message.sourceDiskEncryptionKey != null && message.hasOwnProperty("sourceDiskEncryptionKey")) { + properties._sourceDiskEncryptionKey = 1; + { + var error = $root.google.cloud.compute.v1.CustomerEncryptionKey.verify(message.sourceDiskEncryptionKey); + if (error) + return "sourceDiskEncryptionKey." + error; + } + } + if (message.sourceDiskId != null && message.hasOwnProperty("sourceDiskId")) { + properties._sourceDiskId = 1; + if (!$util.isString(message.sourceDiskId)) + return "sourceDiskId: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 455706685: + case 77848963: + case 267603489: + break; + } + } + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) { + properties._storageBytes = 1; + if (!$util.isInteger(message.storageBytes) && !(message.storageBytes && $util.isInteger(message.storageBytes.low) && $util.isInteger(message.storageBytes.high))) + return "storageBytes: integer|Long expected"; + } + if (message.storageBytesStatus != null && message.hasOwnProperty("storageBytesStatus")) { + properties._storageBytesStatus = 1; + switch (message.storageBytesStatus) { + default: + return "storageBytesStatus: enum value expected"; + case 0: + case 494614342: + case 101306702: + break; + } + } + if (message.storageLocations != null && message.hasOwnProperty("storageLocations")) { + if (!Array.isArray(message.storageLocations)) + return "storageLocations: array expected"; + for (var i = 0; i < message.storageLocations.length; ++i) + if (!$util.isString(message.storageLocations[i])) + return "storageLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Snapshot) + return object; + var message = new $root.google.cloud.compute.v1.Snapshot(); + if (object.autoCreated != null) + message.autoCreated = Boolean(object.autoCreated); + if (object.chainName != null) + message.chainName = String(object.chainName); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + if (object.downloadBytes != null) + if ($util.Long) + (message.downloadBytes = $util.Long.fromValue(object.downloadBytes)).unsigned = false; + else if (typeof object.downloadBytes === "string") + message.downloadBytes = parseInt(object.downloadBytes, 10); + else if (typeof object.downloadBytes === "number") + message.downloadBytes = object.downloadBytes; + else if (typeof object.downloadBytes === "object") + message.downloadBytes = new $util.LongBits(object.downloadBytes.low >>> 0, object.downloadBytes.high >>> 0).toNumber(); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.Snapshot.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.licenseCodes) { + if (!Array.isArray(object.licenseCodes)) + throw TypeError(".google.cloud.compute.v1.Snapshot.licenseCodes: array expected"); + message.licenseCodes = []; + for (var i = 0; i < object.licenseCodes.length; ++i) + if ($util.Long) + (message.licenseCodes[i] = $util.Long.fromValue(object.licenseCodes[i])).unsigned = false; + else if (typeof object.licenseCodes[i] === "string") + message.licenseCodes[i] = parseInt(object.licenseCodes[i], 10); + else if (typeof object.licenseCodes[i] === "number") + message.licenseCodes[i] = object.licenseCodes[i]; + else if (typeof object.licenseCodes[i] === "object") + message.licenseCodes[i] = new $util.LongBits(object.licenseCodes[i].low >>> 0, object.licenseCodes[i].high >>> 0).toNumber(); + } + if (object.licenses) { + if (!Array.isArray(object.licenses)) + throw TypeError(".google.cloud.compute.v1.Snapshot.licenses: array expected"); + message.licenses = []; + for (var i = 0; i < object.licenses.length; ++i) + message.licenses[i] = String(object.licenses[i]); + } + if (object.locationHint != null) + message.locationHint = String(object.locationHint); + if (object.name != null) + message.name = String(object.name); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.snapshotEncryptionKey != null) { + if (typeof object.snapshotEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Snapshot.snapshotEncryptionKey: object expected"); + message.snapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.snapshotEncryptionKey); + } + if (object.sourceDisk != null) + message.sourceDisk = String(object.sourceDisk); + if (object.sourceDiskEncryptionKey != null) { + if (typeof object.sourceDiskEncryptionKey !== "object") + throw TypeError(".google.cloud.compute.v1.Snapshot.sourceDiskEncryptionKey: object expected"); + message.sourceDiskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.fromObject(object.sourceDiskEncryptionKey); + } + if (object.sourceDiskId != null) + message.sourceDiskId = String(object.sourceDiskId); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "FAILED": + case 455706685: + message.status = 455706685; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + case "UPLOADING": + case 267603489: + message.status = 267603489; + break; + } + if (object.storageBytes != null) + if ($util.Long) + (message.storageBytes = $util.Long.fromValue(object.storageBytes)).unsigned = false; + else if (typeof object.storageBytes === "string") + message.storageBytes = parseInt(object.storageBytes, 10); + else if (typeof object.storageBytes === "number") + message.storageBytes = object.storageBytes; + else if (typeof object.storageBytes === "object") + message.storageBytes = new $util.LongBits(object.storageBytes.low >>> 0, object.storageBytes.high >>> 0).toNumber(); + switch (object.storageBytesStatus) { + case "UNDEFINED_STORAGE_BYTES_STATUS": + case 0: + message.storageBytesStatus = 0; + break; + case "UPDATING": + case 494614342: + message.storageBytesStatus = 494614342; + break; + case "UP_TO_DATE": + case 101306702: + message.storageBytesStatus = 101306702; + break; + } + if (object.storageLocations) { + if (!Array.isArray(object.storageLocations)) + throw TypeError(".google.cloud.compute.v1.Snapshot.storageLocations: array expected"); + message.storageLocations = []; + for (var i = 0; i < object.storageLocations.length; ++i) + message.storageLocations[i] = String(object.storageLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Snapshot + * @static + * @param {google.cloud.compute.v1.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.licenseCodes = []; + object.storageLocations = []; + object.licenses = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.snapshotEncryptionKey != null && message.hasOwnProperty("snapshotEncryptionKey")) { + object.snapshotEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.snapshotEncryptionKey, options); + if (options.oneofs) + object._snapshotEncryptionKey = "snapshotEncryptionKey"; + } + if (message.licenseCodes && message.licenseCodes.length) { + object.licenseCodes = []; + for (var j = 0; j < message.licenseCodes.length; ++j) + if (typeof message.licenseCodes[j] === "number") + object.licenseCodes[j] = options.longs === String ? String(message.licenseCodes[j]) : message.licenseCodes[j]; + else + object.licenseCodes[j] = options.longs === String ? $util.Long.prototype.toString.call(message.licenseCodes[j]) : options.longs === Number ? new $util.LongBits(message.licenseCodes[j].low >>> 0, message.licenseCodes[j].high >>> 0).toNumber() : message.licenseCodes[j]; + } + if (message.chainName != null && message.hasOwnProperty("chainName")) { + object.chainName = message.chainName; + if (options.oneofs) + object._chainName = "chainName"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Snapshot.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message.storageLocations && message.storageLocations.length) { + object.storageLocations = []; + for (var j = 0; j < message.storageLocations.length; ++j) + object.storageLocations[j] = message.storageLocations[j]; + } + if (message.licenses && message.licenses.length) { + object.licenses = []; + for (var j = 0; j < message.licenses.length; ++j) + object.licenses[j] = message.licenses[j]; + } + if (message.locationHint != null && message.hasOwnProperty("locationHint")) { + object.locationHint = message.locationHint; + if (options.oneofs) + object._locationHint = "locationHint"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) { + if (typeof message.storageBytes === "number") + object.storageBytes = options.longs === String ? String(message.storageBytes) : message.storageBytes; + else + object.storageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.storageBytes) : options.longs === Number ? new $util.LongBits(message.storageBytes.low >>> 0, message.storageBytes.high >>> 0).toNumber() : message.storageBytes; + if (options.oneofs) + object._storageBytes = "storageBytes"; + } + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) { + if (typeof message.downloadBytes === "number") + object.downloadBytes = options.longs === String ? String(message.downloadBytes) : message.downloadBytes; + else + object.downloadBytes = options.longs === String ? $util.Long.prototype.toString.call(message.downloadBytes) : options.longs === Number ? new $util.LongBits(message.downloadBytes.low >>> 0, message.downloadBytes.high >>> 0).toNumber() : message.downloadBytes; + if (options.oneofs) + object._downloadBytes = "downloadBytes"; + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + object.sourceDisk = message.sourceDisk; + if (options.oneofs) + object._sourceDisk = "sourceDisk"; + } + if (message.sourceDiskId != null && message.hasOwnProperty("sourceDiskId")) { + object.sourceDiskId = message.sourceDiskId; + if (options.oneofs) + object._sourceDiskId = "sourceDiskId"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.autoCreated != null && message.hasOwnProperty("autoCreated")) { + object.autoCreated = message.autoCreated; + if (options.oneofs) + object._autoCreated = "autoCreated"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.storageBytesStatus != null && message.hasOwnProperty("storageBytesStatus")) { + object.storageBytesStatus = options.enums === String ? $root.google.cloud.compute.v1.Snapshot.StorageBytesStatus[message.storageBytesStatus] : message.storageBytesStatus; + if (options.oneofs) + object._storageBytesStatus = "storageBytesStatus"; + } + 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.sourceDiskEncryptionKey != null && message.hasOwnProperty("sourceDiskEncryptionKey")) { + object.sourceDiskEncryptionKey = $root.google.cloud.compute.v1.CustomerEncryptionKey.toObject(message.sourceDiskEncryptionKey, options); + if (options.oneofs) + object._sourceDiskEncryptionKey = "sourceDiskEncryptionKey"; + } + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.Snapshot.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} FAILED=455706685 FAILED value + * @property {number} READY=77848963 READY value + * @property {number} UPLOADING=267603489 UPLOADING value + */ + Snapshot.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[455706685] = "FAILED"] = 455706685; + values[valuesById[77848963] = "READY"] = 77848963; + values[valuesById[267603489] = "UPLOADING"] = 267603489; + return values; + })(); + + /** + * StorageBytesStatus enum. + * @name google.cloud.compute.v1.Snapshot.StorageBytesStatus + * @enum {number} + * @property {number} UNDEFINED_STORAGE_BYTES_STATUS=0 UNDEFINED_STORAGE_BYTES_STATUS value + * @property {number} UPDATING=494614342 UPDATING value + * @property {number} UP_TO_DATE=101306702 UP_TO_DATE value + */ + Snapshot.StorageBytesStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STORAGE_BYTES_STATUS"] = 0; + values[valuesById[494614342] = "UPDATING"] = 494614342; + values[valuesById[101306702] = "UP_TO_DATE"] = 101306702; + return values; + })(); + + return Snapshot; + })(); + + v1.SnapshotList = (function() { + + /** + * Properties of a SnapshotList. + * @memberof google.cloud.compute.v1 + * @interface ISnapshotList + * @property {string|null} [id] SnapshotList id + * @property {Array.|null} [items] SnapshotList items + * @property {string|null} [kind] SnapshotList kind + * @property {string|null} [nextPageToken] SnapshotList nextPageToken + * @property {string|null} [selfLink] SnapshotList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] SnapshotList warning + */ + + /** + * Constructs a new SnapshotList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SnapshotList. + * @implements ISnapshotList + * @constructor + * @param {google.cloud.compute.v1.ISnapshotList=} [properties] Properties to set + */ + function SnapshotList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SnapshotList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + SnapshotList.prototype.id = null; + + /** + * SnapshotList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + SnapshotList.prototype.items = $util.emptyArray; + + /** + * SnapshotList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + SnapshotList.prototype.kind = null; + + /** + * SnapshotList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + SnapshotList.prototype.nextPageToken = null; + + /** + * SnapshotList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + SnapshotList.prototype.selfLink = null; + + /** + * SnapshotList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + SnapshotList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SnapshotList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + Object.defineProperty(SnapshotList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SnapshotList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + Object.defineProperty(SnapshotList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SnapshotList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + Object.defineProperty(SnapshotList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SnapshotList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + Object.defineProperty(SnapshotList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SnapshotList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + */ + Object.defineProperty(SnapshotList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SnapshotList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {google.cloud.compute.v1.ISnapshotList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SnapshotList} SnapshotList instance + */ + SnapshotList.create = function create(properties) { + return new SnapshotList(properties); + }; + + /** + * Encodes the specified SnapshotList message. Does not implicitly {@link google.cloud.compute.v1.SnapshotList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {google.cloud.compute.v1.ISnapshotList} message SnapshotList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Snapshot.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified SnapshotList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SnapshotList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {google.cloud.compute.v1.ISnapshotList} message SnapshotList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SnapshotList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SnapshotList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SnapshotList} SnapshotList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SnapshotList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Snapshot.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SnapshotList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SnapshotList} SnapshotList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SnapshotList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SnapshotList message. + * @function verify + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SnapshotList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Snapshot.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SnapshotList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SnapshotList} SnapshotList + */ + SnapshotList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SnapshotList) + return object; + var message = new $root.google.cloud.compute.v1.SnapshotList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.SnapshotList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SnapshotList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Snapshot.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SnapshotList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SnapshotList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SnapshotList + * @static + * @param {google.cloud.compute.v1.SnapshotList} message SnapshotList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SnapshotList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Snapshot.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this SnapshotList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SnapshotList + * @instance + * @returns {Object.} JSON object + */ + SnapshotList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SnapshotList; + })(); + + v1.SslCertificateManagedSslCertificate = (function() { + + /** + * Properties of a SslCertificateManagedSslCertificate. + * @memberof google.cloud.compute.v1 + * @interface ISslCertificateManagedSslCertificate + * @property {Object.|null} [domainStatus] SslCertificateManagedSslCertificate domainStatus + * @property {Array.|null} [domains] SslCertificateManagedSslCertificate domains + * @property {google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status|null} [status] SslCertificateManagedSslCertificate status + */ + + /** + * Constructs a new SslCertificateManagedSslCertificate. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslCertificateManagedSslCertificate. + * @implements ISslCertificateManagedSslCertificate + * @constructor + * @param {google.cloud.compute.v1.ISslCertificateManagedSslCertificate=} [properties] Properties to set + */ + function SslCertificateManagedSslCertificate(properties) { + this.domainStatus = {}; + this.domains = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslCertificateManagedSslCertificate domainStatus. + * @member {Object.} domainStatus + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @instance + */ + SslCertificateManagedSslCertificate.prototype.domainStatus = $util.emptyObject; + + /** + * SslCertificateManagedSslCertificate domains. + * @member {Array.} domains + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @instance + */ + SslCertificateManagedSslCertificate.prototype.domains = $util.emptyArray; + + /** + * SslCertificateManagedSslCertificate status. + * @member {google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status|null|undefined} status + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @instance + */ + SslCertificateManagedSslCertificate.prototype.status = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslCertificateManagedSslCertificate _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @instance + */ + Object.defineProperty(SslCertificateManagedSslCertificate.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslCertificateManagedSslCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificateManagedSslCertificate=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslCertificateManagedSslCertificate} SslCertificateManagedSslCertificate instance + */ + SslCertificateManagedSslCertificate.create = function create(properties) { + return new SslCertificateManagedSslCertificate(properties); + }; + + /** + * Encodes the specified SslCertificateManagedSslCertificate message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateManagedSslCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificateManagedSslCertificate} message SslCertificateManagedSslCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateManagedSslCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.domains != null && message.domains.length) + for (var i = 0; i < message.domains.length; ++i) + writer.uint32(/* id 226935855, wireType 2 =*/1815486842).string(message.domains[i]); + if (message.domainStatus != null && Object.hasOwnProperty.call(message, "domainStatus")) + for (var keys = Object.keys(message.domainStatus), i = 0; i < keys.length; ++i) + writer.uint32(/* id 360305613, wireType 2 =*/2882444906).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.domainStatus[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SslCertificateManagedSslCertificate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateManagedSslCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificateManagedSslCertificate} message SslCertificateManagedSslCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateManagedSslCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslCertificateManagedSslCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslCertificateManagedSslCertificate} SslCertificateManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateManagedSslCertificate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 360305613: + if (message.domainStatus === $util.emptyObject) + message.domainStatus = {}; + 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.domainStatus[key] = value; + break; + case 226935855: + if (!(message.domains && message.domains.length)) + message.domains = []; + message.domains.push(reader.string()); + break; + case 181260274: + message.status = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslCertificateManagedSslCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslCertificateManagedSslCertificate} SslCertificateManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateManagedSslCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslCertificateManagedSslCertificate message. + * @function verify + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslCertificateManagedSslCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.domainStatus != null && message.hasOwnProperty("domainStatus")) { + if (!$util.isObject(message.domainStatus)) + return "domainStatus: object expected"; + var key = Object.keys(message.domainStatus); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.domainStatus[key[i]])) + return "domainStatus: string{k:string} 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.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 314733318: + case 474800850: + case 290896621: + case 76813775: + case 275036203: + case 434659076: + break; + } + } + return null; + }; + + /** + * Creates a SslCertificateManagedSslCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslCertificateManagedSslCertificate} SslCertificateManagedSslCertificate + */ + SslCertificateManagedSslCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate) + return object; + var message = new $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate(); + if (object.domainStatus) { + if (typeof object.domainStatus !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificateManagedSslCertificate.domainStatus: object expected"); + message.domainStatus = {}; + for (var keys = Object.keys(object.domainStatus), i = 0; i < keys.length; ++i) + message.domainStatus[keys[i]] = String(object.domainStatus[keys[i]]); + } + if (object.domains) { + if (!Array.isArray(object.domains)) + throw TypeError(".google.cloud.compute.v1.SslCertificateManagedSslCertificate.domains: array expected"); + message.domains = []; + for (var i = 0; i < object.domains.length; ++i) + message.domains[i] = String(object.domains[i]); + } + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "ACTIVE": + case 314733318: + message.status = 314733318; + break; + case "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED": + case 474800850: + message.status = 474800850; + break; + case "PROVISIONING": + case 290896621: + message.status = 290896621; + break; + case "PROVISIONING_FAILED": + case 76813775: + message.status = 76813775; + break; + case "PROVISIONING_FAILED_PERMANENTLY": + case 275036203: + message.status = 275036203; + break; + case "RENEWAL_FAILED": + case 434659076: + message.status = 434659076; + break; + } + return message; + }; + + /** + * Creates a plain object from a SslCertificateManagedSslCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.SslCertificateManagedSslCertificate} message SslCertificateManagedSslCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslCertificateManagedSslCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.domains = []; + if (options.objects || options.defaults) + object.domainStatus = {}; + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.domains && message.domains.length) { + object.domains = []; + for (var j = 0; j < message.domains.length; ++j) + object.domains[j] = message.domains[j]; + } + var keys2; + if (message.domainStatus && (keys2 = Object.keys(message.domainStatus)).length) { + object.domainStatus = {}; + for (var j = 0; j < keys2.length; ++j) + object.domainStatus[keys2[j]] = message.domainStatus[keys2[j]]; + } + return object; + }; + + /** + * Converts this SslCertificateManagedSslCertificate to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslCertificateManagedSslCertificate + * @instance + * @returns {Object.} JSON object + */ + SslCertificateManagedSslCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.SslCertificateManagedSslCertificate.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} MANAGED_CERTIFICATE_STATUS_UNSPECIFIED=474800850 MANAGED_CERTIFICATE_STATUS_UNSPECIFIED value + * @property {number} PROVISIONING=290896621 PROVISIONING value + * @property {number} PROVISIONING_FAILED=76813775 PROVISIONING_FAILED value + * @property {number} PROVISIONING_FAILED_PERMANENTLY=275036203 PROVISIONING_FAILED_PERMANENTLY value + * @property {number} RENEWAL_FAILED=434659076 RENEWAL_FAILED value + */ + SslCertificateManagedSslCertificate.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[474800850] = "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED"] = 474800850; + values[valuesById[290896621] = "PROVISIONING"] = 290896621; + values[valuesById[76813775] = "PROVISIONING_FAILED"] = 76813775; + values[valuesById[275036203] = "PROVISIONING_FAILED_PERMANENTLY"] = 275036203; + values[valuesById[434659076] = "RENEWAL_FAILED"] = 434659076; + return values; + })(); + + return SslCertificateManagedSslCertificate; + })(); + + v1.SslCertificateSelfManagedSslCertificate = (function() { + + /** + * Properties of a SslCertificateSelfManagedSslCertificate. + * @memberof google.cloud.compute.v1 + * @interface ISslCertificateSelfManagedSslCertificate + * @property {string|null} [certificate] SslCertificateSelfManagedSslCertificate certificate + * @property {string|null} [privateKey] SslCertificateSelfManagedSslCertificate privateKey + */ + + /** + * Constructs a new SslCertificateSelfManagedSslCertificate. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslCertificateSelfManagedSslCertificate. + * @implements ISslCertificateSelfManagedSslCertificate + * @constructor + * @param {google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate=} [properties] Properties to set + */ + function SslCertificateSelfManagedSslCertificate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslCertificateSelfManagedSslCertificate certificate. + * @member {string|null|undefined} certificate + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @instance + */ + SslCertificateSelfManagedSslCertificate.prototype.certificate = null; + + /** + * SslCertificateSelfManagedSslCertificate privateKey. + * @member {string|null|undefined} privateKey + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @instance + */ + SslCertificateSelfManagedSslCertificate.prototype.privateKey = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslCertificateSelfManagedSslCertificate _certificate. + * @member {"certificate"|undefined} _certificate + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @instance + */ + Object.defineProperty(SslCertificateSelfManagedSslCertificate.prototype, "_certificate", { + get: $util.oneOfGetter($oneOfFields = ["certificate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateSelfManagedSslCertificate _privateKey. + * @member {"privateKey"|undefined} _privateKey + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @instance + */ + Object.defineProperty(SslCertificateSelfManagedSslCertificate.prototype, "_privateKey", { + get: $util.oneOfGetter($oneOfFields = ["privateKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslCertificateSelfManagedSslCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate} SslCertificateSelfManagedSslCertificate instance + */ + SslCertificateSelfManagedSslCertificate.create = function create(properties) { + return new SslCertificateSelfManagedSslCertificate(properties); + }; + + /** + * Encodes the specified SslCertificateSelfManagedSslCertificate message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate} message SslCertificateSelfManagedSslCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateSelfManagedSslCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + writer.uint32(/* id 341787031, wireType 2 =*/2734296250).string(message.certificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 361331107, wireType 2 =*/2890648858).string(message.privateKey); + return writer; + }; + + /** + * Encodes the specified SslCertificateSelfManagedSslCertificate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate} message SslCertificateSelfManagedSslCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateSelfManagedSslCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslCertificateSelfManagedSslCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate} SslCertificateSelfManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateSelfManagedSslCertificate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 341787031: + message.certificate = reader.string(); + break; + case 361331107: + message.privateKey = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslCertificateSelfManagedSslCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate} SslCertificateSelfManagedSslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateSelfManagedSslCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslCertificateSelfManagedSslCertificate message. + * @function verify + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslCertificateSelfManagedSslCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + properties._certificate = 1; + if (!$util.isString(message.certificate)) + return "certificate: string expected"; + } + if (message.privateKey != null && message.hasOwnProperty("privateKey")) { + properties._privateKey = 1; + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + } + return null; + }; + + /** + * Creates a SslCertificateSelfManagedSslCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate} SslCertificateSelfManagedSslCertificate + */ + SslCertificateSelfManagedSslCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate) + return object; + var message = new $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate(); + if (object.certificate != null) + message.certificate = String(object.certificate); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + return message; + }; + + /** + * Creates a plain object from a SslCertificateSelfManagedSslCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @static + * @param {google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate} message SslCertificateSelfManagedSslCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslCertificateSelfManagedSslCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + object.certificate = message.certificate; + if (options.oneofs) + object._certificate = "certificate"; + } + if (message.privateKey != null && message.hasOwnProperty("privateKey")) { + object.privateKey = message.privateKey; + if (options.oneofs) + object._privateKey = "privateKey"; + } + return object; + }; + + /** + * Converts this SslCertificateSelfManagedSslCertificate to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate + * @instance + * @returns {Object.} JSON object + */ + SslCertificateSelfManagedSslCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SslCertificateSelfManagedSslCertificate; + })(); + + v1.SslCertificate = (function() { + + /** + * Properties of a SslCertificate. + * @memberof google.cloud.compute.v1 + * @interface ISslCertificate + * @property {string|null} [certificate] SslCertificate certificate + * @property {string|null} [creationTimestamp] SslCertificate creationTimestamp + * @property {string|null} [description] SslCertificate description + * @property {string|null} [expireTime] SslCertificate expireTime + * @property {number|Long|null} [id] SslCertificate id + * @property {string|null} [kind] SslCertificate kind + * @property {google.cloud.compute.v1.ISslCertificateManagedSslCertificate|null} [managed] SslCertificate managed + * @property {string|null} [name] SslCertificate name + * @property {string|null} [privateKey] SslCertificate privateKey + * @property {string|null} [region] SslCertificate region + * @property {string|null} [selfLink] SslCertificate selfLink + * @property {google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate|null} [selfManaged] SslCertificate selfManaged + * @property {Array.|null} [subjectAlternativeNames] SslCertificate subjectAlternativeNames + * @property {google.cloud.compute.v1.SslCertificate.Type|null} [type] SslCertificate type + */ + + /** + * Constructs a new SslCertificate. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslCertificate. + * @implements ISslCertificate + * @constructor + * @param {google.cloud.compute.v1.ISslCertificate=} [properties] Properties to set + */ + function SslCertificate(properties) { + this.subjectAlternativeNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslCertificate certificate. + * @member {string|null|undefined} certificate + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.certificate = null; + + /** + * SslCertificate creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.creationTimestamp = null; + + /** + * SslCertificate description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.description = null; + + /** + * SslCertificate expireTime. + * @member {string|null|undefined} expireTime + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.expireTime = null; + + /** + * SslCertificate id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.id = null; + + /** + * SslCertificate kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.kind = null; + + /** + * SslCertificate managed. + * @member {google.cloud.compute.v1.ISslCertificateManagedSslCertificate|null|undefined} managed + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.managed = null; + + /** + * SslCertificate name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.name = null; + + /** + * SslCertificate privateKey. + * @member {string|null|undefined} privateKey + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.privateKey = null; + + /** + * SslCertificate region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.region = null; + + /** + * SslCertificate selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.selfLink = null; + + /** + * SslCertificate selfManaged. + * @member {google.cloud.compute.v1.ISslCertificateSelfManagedSslCertificate|null|undefined} selfManaged + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.selfManaged = null; + + /** + * SslCertificate subjectAlternativeNames. + * @member {Array.} subjectAlternativeNames + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.subjectAlternativeNames = $util.emptyArray; + + /** + * SslCertificate type. + * @member {google.cloud.compute.v1.SslCertificate.Type|null|undefined} type + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + SslCertificate.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslCertificate _certificate. + * @member {"certificate"|undefined} _certificate + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_certificate", { + get: $util.oneOfGetter($oneOfFields = ["certificate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _expireTime. + * @member {"expireTime"|undefined} _expireTime + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_expireTime", { + get: $util.oneOfGetter($oneOfFields = ["expireTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _managed. + * @member {"managed"|undefined} _managed + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_managed", { + get: $util.oneOfGetter($oneOfFields = ["managed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _privateKey. + * @member {"privateKey"|undefined} _privateKey + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_privateKey", { + get: $util.oneOfGetter($oneOfFields = ["privateKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _selfManaged. + * @member {"selfManaged"|undefined} _selfManaged + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_selfManaged", { + get: $util.oneOfGetter($oneOfFields = ["selfManaged"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificate _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + */ + Object.defineProperty(SslCertificate.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslCertificate instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificate=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslCertificate} SslCertificate instance + */ + SslCertificate.create = function create(properties) { + return new SslCertificate(properties); + }; + + /** + * Encodes the specified SslCertificate message. Does not implicitly {@link google.cloud.compute.v1.SslCertificate.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificate} message SslCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3575610, wireType 0 =*/28604880).int32(message.type); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.managed != null && Object.hasOwnProperty.call(message, "managed")) + $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate.encode(message.managed, writer.uint32(/* id 298389407, wireType 2 =*/2387115258).fork()).ldelim(); + if (message.selfManaged != null && Object.hasOwnProperty.call(message, "selfManaged")) + $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.encode(message.selfManaged, writer.uint32(/* id 329284012, wireType 2 =*/2634272098).fork()).ldelim(); + if (message.certificate != null && Object.hasOwnProperty.call(message, "certificate")) + writer.uint32(/* id 341787031, wireType 2 =*/2734296250).string(message.certificate); + if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey")) + writer.uint32(/* id 361331107, wireType 2 =*/2890648858).string(message.privateKey); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + writer.uint32(/* id 440691181, wireType 2 =*/3525529450).string(message.expireTime); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.subjectAlternativeNames != null && message.subjectAlternativeNames.length) + for (var i = 0; i < message.subjectAlternativeNames.length; ++i) + writer.uint32(/* id 528807907, wireType 2 =*/4230463258).string(message.subjectAlternativeNames[i]); + return writer; + }; + + /** + * Encodes the specified SslCertificate message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {google.cloud.compute.v1.ISslCertificate} message SslCertificate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslCertificate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslCertificate} SslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslCertificate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 341787031: + message.certificate = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 440691181: + message.expireTime = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 298389407: + message.managed = $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 361331107: + message.privateKey = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 329284012: + message.selfManaged = $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.decode(reader, reader.uint32()); + break; + case 528807907: + if (!(message.subjectAlternativeNames && message.subjectAlternativeNames.length)) + message.subjectAlternativeNames = []; + message.subjectAlternativeNames.push(reader.string()); + break; + case 3575610: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslCertificate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslCertificate} SslCertificate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslCertificate message. + * @function verify + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslCertificate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.certificate != null && message.hasOwnProperty("certificate")) { + properties._certificate = 1; + if (!$util.isString(message.certificate)) + return "certificate: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties._expireTime = 1; + if (!$util.isString(message.expireTime)) + return "expireTime: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.managed != null && message.hasOwnProperty("managed")) { + properties._managed = 1; + { + var error = $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate.verify(message.managed); + if (error) + return "managed." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.privateKey != null && message.hasOwnProperty("privateKey")) { + properties._privateKey = 1; + if (!$util.isString(message.privateKey)) + return "privateKey: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.selfManaged != null && message.hasOwnProperty("selfManaged")) { + properties._selfManaged = 1; + { + var error = $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.verify(message.selfManaged); + if (error) + return "selfManaged." + error; + } + } + if (message.subjectAlternativeNames != null && message.hasOwnProperty("subjectAlternativeNames")) { + if (!Array.isArray(message.subjectAlternativeNames)) + return "subjectAlternativeNames: array expected"; + for (var i = 0; i < message.subjectAlternativeNames.length; ++i) + if (!$util.isString(message.subjectAlternativeNames[i])) + return "subjectAlternativeNames: string[] expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 479501183: + case 434437516: + case 437714322: + break; + } + } + return null; + }; + + /** + * Creates a SslCertificate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslCertificate} SslCertificate + */ + SslCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslCertificate) + return object; + var message = new $root.google.cloud.compute.v1.SslCertificate(); + if (object.certificate != null) + message.certificate = String(object.certificate); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.expireTime != null) + message.expireTime = String(object.expireTime); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.managed != null) { + if (typeof object.managed !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificate.managed: object expected"); + message.managed = $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate.fromObject(object.managed); + } + if (object.name != null) + message.name = String(object.name); + if (object.privateKey != null) + message.privateKey = String(object.privateKey); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.selfManaged != null) { + if (typeof object.selfManaged !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificate.selfManaged: object expected"); + message.selfManaged = $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.fromObject(object.selfManaged); + } + if (object.subjectAlternativeNames) { + if (!Array.isArray(object.subjectAlternativeNames)) + throw TypeError(".google.cloud.compute.v1.SslCertificate.subjectAlternativeNames: array expected"); + message.subjectAlternativeNames = []; + for (var i = 0; i < object.subjectAlternativeNames.length; ++i) + message.subjectAlternativeNames[i] = String(object.subjectAlternativeNames[i]); + } + switch (object.type) { + case "UNDEFINED_TYPE": + case 0: + message.type = 0; + break; + case "MANAGED": + case 479501183: + message.type = 479501183; + break; + case "SELF_MANAGED": + case 434437516: + message.type = 434437516; + break; + case "TYPE_UNSPECIFIED": + case 437714322: + message.type = 437714322; + break; + } + return message; + }; + + /** + * Creates a plain object from a SslCertificate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslCertificate + * @static + * @param {google.cloud.compute.v1.SslCertificate} message SslCertificate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslCertificate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subjectAlternativeNames = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.compute.v1.SslCertificate.Type[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.managed != null && message.hasOwnProperty("managed")) { + object.managed = $root.google.cloud.compute.v1.SslCertificateManagedSslCertificate.toObject(message.managed, options); + if (options.oneofs) + object._managed = "managed"; + } + if (message.selfManaged != null && message.hasOwnProperty("selfManaged")) { + object.selfManaged = $root.google.cloud.compute.v1.SslCertificateSelfManagedSslCertificate.toObject(message.selfManaged, options); + if (options.oneofs) + object._selfManaged = "selfManaged"; + } + if (message.certificate != null && message.hasOwnProperty("certificate")) { + object.certificate = message.certificate; + if (options.oneofs) + object._certificate = "certificate"; + } + if (message.privateKey != null && message.hasOwnProperty("privateKey")) { + object.privateKey = message.privateKey; + if (options.oneofs) + object._privateKey = "privateKey"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = message.expireTime; + if (options.oneofs) + object._expireTime = "expireTime"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.subjectAlternativeNames && message.subjectAlternativeNames.length) { + object.subjectAlternativeNames = []; + for (var j = 0; j < message.subjectAlternativeNames.length; ++j) + object.subjectAlternativeNames[j] = message.subjectAlternativeNames[j]; + } + return object; + }; + + /** + * Converts this SslCertificate to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslCertificate + * @instance + * @returns {Object.} JSON object + */ + SslCertificate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.compute.v1.SslCertificate.Type + * @enum {number} + * @property {number} UNDEFINED_TYPE=0 UNDEFINED_TYPE value + * @property {number} MANAGED=479501183 MANAGED value + * @property {number} SELF_MANAGED=434437516 SELF_MANAGED value + * @property {number} TYPE_UNSPECIFIED=437714322 TYPE_UNSPECIFIED value + */ + SslCertificate.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_TYPE"] = 0; + values[valuesById[479501183] = "MANAGED"] = 479501183; + values[valuesById[434437516] = "SELF_MANAGED"] = 434437516; + values[valuesById[437714322] = "TYPE_UNSPECIFIED"] = 437714322; + return values; + })(); + + return SslCertificate; + })(); + + v1.SslCertificatesScopedList = (function() { + + /** + * Properties of a SslCertificatesScopedList. + * @memberof google.cloud.compute.v1 + * @interface ISslCertificatesScopedList + * @property {Array.|null} [sslCertificates] SslCertificatesScopedList sslCertificates + * @property {google.cloud.compute.v1.IWarning|null} [warning] SslCertificatesScopedList warning + */ + + /** + * Constructs a new SslCertificatesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslCertificatesScopedList. + * @implements ISslCertificatesScopedList + * @constructor + * @param {google.cloud.compute.v1.ISslCertificatesScopedList=} [properties] Properties to set + */ + function SslCertificatesScopedList(properties) { + this.sslCertificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslCertificatesScopedList sslCertificates. + * @member {Array.} sslCertificates + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @instance + */ + SslCertificatesScopedList.prototype.sslCertificates = $util.emptyArray; + + /** + * SslCertificatesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @instance + */ + SslCertificatesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslCertificatesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @instance + */ + Object.defineProperty(SslCertificatesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslCertificatesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {google.cloud.compute.v1.ISslCertificatesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslCertificatesScopedList} SslCertificatesScopedList instance + */ + SslCertificatesScopedList.create = function create(properties) { + return new SslCertificatesScopedList(properties); + }; + + /** + * Encodes the specified SslCertificatesScopedList message. Does not implicitly {@link google.cloud.compute.v1.SslCertificatesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {google.cloud.compute.v1.ISslCertificatesScopedList} message SslCertificatesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificatesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.sslCertificates != null && message.sslCertificates.length) + for (var i = 0; i < message.sslCertificates.length; ++i) + $root.google.cloud.compute.v1.SslCertificate.encode(message.sslCertificates[i], writer.uint32(/* id 366006543, wireType 2 =*/2928052346).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SslCertificatesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificatesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {google.cloud.compute.v1.ISslCertificatesScopedList} message SslCertificatesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificatesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslCertificatesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslCertificatesScopedList} SslCertificatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificatesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslCertificatesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 366006543: + if (!(message.sslCertificates && message.sslCertificates.length)) + message.sslCertificates = []; + message.sslCertificates.push($root.google.cloud.compute.v1.SslCertificate.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslCertificatesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslCertificatesScopedList} SslCertificatesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificatesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslCertificatesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslCertificatesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sslCertificates != null && message.hasOwnProperty("sslCertificates")) { + if (!Array.isArray(message.sslCertificates)) + return "sslCertificates: array expected"; + for (var i = 0; i < message.sslCertificates.length; ++i) { + var error = $root.google.cloud.compute.v1.SslCertificate.verify(message.sslCertificates[i]); + if (error) + return "sslCertificates." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SslCertificatesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslCertificatesScopedList} SslCertificatesScopedList + */ + SslCertificatesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslCertificatesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.SslCertificatesScopedList(); + if (object.sslCertificates) { + if (!Array.isArray(object.sslCertificates)) + throw TypeError(".google.cloud.compute.v1.SslCertificatesScopedList.sslCertificates: array expected"); + message.sslCertificates = []; + for (var i = 0; i < object.sslCertificates.length; ++i) { + if (typeof object.sslCertificates[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificatesScopedList.sslCertificates: object expected"); + message.sslCertificates[i] = $root.google.cloud.compute.v1.SslCertificate.fromObject(object.sslCertificates[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificatesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SslCertificatesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @static + * @param {google.cloud.compute.v1.SslCertificatesScopedList} message SslCertificatesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslCertificatesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sslCertificates = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.sslCertificates && message.sslCertificates.length) { + object.sslCertificates = []; + for (var j = 0; j < message.sslCertificates.length; ++j) + object.sslCertificates[j] = $root.google.cloud.compute.v1.SslCertificate.toObject(message.sslCertificates[j], options); + } + return object; + }; + + /** + * Converts this SslCertificatesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslCertificatesScopedList + * @instance + * @returns {Object.} JSON object + */ + SslCertificatesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SslCertificatesScopedList; + })(); + + v1.SslCertificateAggregatedList = (function() { + + /** + * Properties of a SslCertificateAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ISslCertificateAggregatedList + * @property {string|null} [id] SslCertificateAggregatedList id + * @property {Object.|null} [items] SslCertificateAggregatedList items + * @property {string|null} [kind] SslCertificateAggregatedList kind + * @property {string|null} [nextPageToken] SslCertificateAggregatedList nextPageToken + * @property {string|null} [selfLink] SslCertificateAggregatedList selfLink + * @property {Array.|null} [unreachables] SslCertificateAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] SslCertificateAggregatedList warning + */ + + /** + * Constructs a new SslCertificateAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslCertificateAggregatedList. + * @implements ISslCertificateAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ISslCertificateAggregatedList=} [properties] Properties to set + */ + function SslCertificateAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslCertificateAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + SslCertificateAggregatedList.prototype.id = null; + + /** + * SslCertificateAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + SslCertificateAggregatedList.prototype.items = $util.emptyObject; + + /** + * SslCertificateAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + SslCertificateAggregatedList.prototype.kind = null; + + /** + * SslCertificateAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + SslCertificateAggregatedList.prototype.nextPageToken = null; + + /** + * SslCertificateAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + SslCertificateAggregatedList.prototype.selfLink = null; + + /** + * SslCertificateAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + SslCertificateAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * SslCertificateAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + SslCertificateAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslCertificateAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + Object.defineProperty(SslCertificateAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + Object.defineProperty(SslCertificateAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + Object.defineProperty(SslCertificateAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + Object.defineProperty(SslCertificateAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + */ + Object.defineProperty(SslCertificateAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslCertificateAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {google.cloud.compute.v1.ISslCertificateAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslCertificateAggregatedList} SslCertificateAggregatedList instance + */ + SslCertificateAggregatedList.create = function create(properties) { + return new SslCertificateAggregatedList(properties); + }; + + /** + * Encodes the specified SslCertificateAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {google.cloud.compute.v1.ISslCertificateAggregatedList} message SslCertificateAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.SslCertificatesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified SslCertificateAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {google.cloud.compute.v1.ISslCertificateAggregatedList} message SslCertificateAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslCertificateAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslCertificateAggregatedList} SslCertificateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslCertificateAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.SslCertificatesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslCertificateAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslCertificateAggregatedList} SslCertificateAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslCertificateAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslCertificateAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.SslCertificatesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SslCertificateAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslCertificateAggregatedList} SslCertificateAggregatedList + */ + SslCertificateAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslCertificateAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.SslCertificateAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificateAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificateAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.SslCertificatesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.SslCertificateAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificateAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SslCertificateAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @static + * @param {google.cloud.compute.v1.SslCertificateAggregatedList} message SslCertificateAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslCertificateAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.SslCertificatesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this SslCertificateAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslCertificateAggregatedList + * @instance + * @returns {Object.} JSON object + */ + SslCertificateAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SslCertificateAggregatedList; + })(); + + v1.SslCertificateList = (function() { + + /** + * Properties of a SslCertificateList. + * @memberof google.cloud.compute.v1 + * @interface ISslCertificateList + * @property {string|null} [id] SslCertificateList id + * @property {Array.|null} [items] SslCertificateList items + * @property {string|null} [kind] SslCertificateList kind + * @property {string|null} [nextPageToken] SslCertificateList nextPageToken + * @property {string|null} [selfLink] SslCertificateList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] SslCertificateList warning + */ + + /** + * Constructs a new SslCertificateList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslCertificateList. + * @implements ISslCertificateList + * @constructor + * @param {google.cloud.compute.v1.ISslCertificateList=} [properties] Properties to set + */ + function SslCertificateList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslCertificateList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + SslCertificateList.prototype.id = null; + + /** + * SslCertificateList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + SslCertificateList.prototype.items = $util.emptyArray; + + /** + * SslCertificateList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + SslCertificateList.prototype.kind = null; + + /** + * SslCertificateList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + SslCertificateList.prototype.nextPageToken = null; + + /** + * SslCertificateList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + SslCertificateList.prototype.selfLink = null; + + /** + * SslCertificateList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + SslCertificateList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslCertificateList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + Object.defineProperty(SslCertificateList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + Object.defineProperty(SslCertificateList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + Object.defineProperty(SslCertificateList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + Object.defineProperty(SslCertificateList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslCertificateList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + */ + Object.defineProperty(SslCertificateList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslCertificateList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {google.cloud.compute.v1.ISslCertificateList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslCertificateList} SslCertificateList instance + */ + SslCertificateList.create = function create(properties) { + return new SslCertificateList(properties); + }; + + /** + * Encodes the specified SslCertificateList message. Does not implicitly {@link google.cloud.compute.v1.SslCertificateList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {google.cloud.compute.v1.ISslCertificateList} message SslCertificateList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.SslCertificate.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified SslCertificateList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslCertificateList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {google.cloud.compute.v1.ISslCertificateList} message SslCertificateList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslCertificateList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslCertificateList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslCertificateList} SslCertificateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslCertificateList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.SslCertificate.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslCertificateList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslCertificateList} SslCertificateList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslCertificateList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslCertificateList message. + * @function verify + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslCertificateList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.SslCertificate.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SslCertificateList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslCertificateList} SslCertificateList + */ + SslCertificateList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslCertificateList) + return object; + var message = new $root.google.cloud.compute.v1.SslCertificateList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.SslCertificateList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificateList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.SslCertificate.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SslCertificateList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SslCertificateList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslCertificateList + * @static + * @param {google.cloud.compute.v1.SslCertificateList} message SslCertificateList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslCertificateList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.SslCertificate.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this SslCertificateList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslCertificateList + * @instance + * @returns {Object.} JSON object + */ + SslCertificateList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SslCertificateList; + })(); + + v1.SslPolicy = (function() { + + /** + * Properties of a SslPolicy. + * @memberof google.cloud.compute.v1 + * @interface ISslPolicy + * @property {string|null} [creationTimestamp] SslPolicy creationTimestamp + * @property {Array.|null} [customFeatures] SslPolicy customFeatures + * @property {string|null} [description] SslPolicy description + * @property {Array.|null} [enabledFeatures] SslPolicy enabledFeatures + * @property {string|null} [fingerprint] SslPolicy fingerprint + * @property {number|Long|null} [id] SslPolicy id + * @property {string|null} [kind] SslPolicy kind + * @property {google.cloud.compute.v1.SslPolicy.MinTlsVersion|null} [minTlsVersion] SslPolicy minTlsVersion + * @property {string|null} [name] SslPolicy name + * @property {google.cloud.compute.v1.SslPolicy.Profile|null} [profile] SslPolicy profile + * @property {string|null} [selfLink] SslPolicy selfLink + * @property {Array.|null} [warnings] SslPolicy warnings + */ + + /** + * Constructs a new SslPolicy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslPolicy. + * @implements ISslPolicy + * @constructor + * @param {google.cloud.compute.v1.ISslPolicy=} [properties] Properties to set + */ + function SslPolicy(properties) { + this.customFeatures = []; + this.enabledFeatures = []; + 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]]; + } + + /** + * SslPolicy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.creationTimestamp = null; + + /** + * SslPolicy customFeatures. + * @member {Array.} customFeatures + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.customFeatures = $util.emptyArray; + + /** + * SslPolicy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.description = null; + + /** + * SslPolicy enabledFeatures. + * @member {Array.} enabledFeatures + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.enabledFeatures = $util.emptyArray; + + /** + * SslPolicy fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.fingerprint = null; + + /** + * SslPolicy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.id = null; + + /** + * SslPolicy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.kind = null; + + /** + * SslPolicy minTlsVersion. + * @member {google.cloud.compute.v1.SslPolicy.MinTlsVersion|null|undefined} minTlsVersion + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.minTlsVersion = null; + + /** + * SslPolicy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.name = null; + + /** + * SslPolicy profile. + * @member {google.cloud.compute.v1.SslPolicy.Profile|null|undefined} profile + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.profile = null; + + /** + * SslPolicy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.selfLink = null; + + /** + * SslPolicy warnings. + * @member {Array.} warnings + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + SslPolicy.prototype.warnings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslPolicy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _minTlsVersion. + * @member {"minTlsVersion"|undefined} _minTlsVersion + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_minTlsVersion", { + get: $util.oneOfGetter($oneOfFields = ["minTlsVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _profile. + * @member {"profile"|undefined} _profile + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_profile", { + get: $util.oneOfGetter($oneOfFields = ["profile"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPolicy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + */ + Object.defineProperty(SslPolicy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {google.cloud.compute.v1.ISslPolicy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslPolicy} SslPolicy instance + */ + SslPolicy.create = function create(properties) { + return new SslPolicy(properties); + }; + + /** + * Encodes the specified SslPolicy message. Does not implicitly {@link google.cloud.compute.v1.SslPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {google.cloud.compute.v1.ISslPolicy} message SslPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.minTlsVersion != null && Object.hasOwnProperty.call(message, "minTlsVersion")) + writer.uint32(/* id 8155943, wireType 0 =*/65247544).int32(message.minTlsVersion); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.customFeatures != null && message.customFeatures.length) + for (var i = 0; i < message.customFeatures.length; ++i) + writer.uint32(/* id 34789707, wireType 2 =*/278317658).string(message.customFeatures[i]); + if (message.profile != null && Object.hasOwnProperty.call(message, "profile")) + writer.uint32(/* id 227445161, wireType 0 =*/1819561288).int32(message.profile); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.enabledFeatures != null && message.enabledFeatures.length) + for (var i = 0; i < message.enabledFeatures.length; ++i) + writer.uint32(/* id 469017467, wireType 2 =*/3752139738).string(message.enabledFeatures[i]); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.cloud.compute.v1.Warnings.encode(message.warnings[i], writer.uint32(/* id 498091095, wireType 2 =*/3984728762).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SslPolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {google.cloud.compute.v1.ISslPolicy} message SslPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslPolicy} SslPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 34789707: + if (!(message.customFeatures && message.customFeatures.length)) + message.customFeatures = []; + message.customFeatures.push(reader.string()); + break; + case 422937596: + message.description = reader.string(); + break; + case 469017467: + if (!(message.enabledFeatures && message.enabledFeatures.length)) + message.enabledFeatures = []; + message.enabledFeatures.push(reader.string()); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 8155943: + message.minTlsVersion = reader.int32(); + break; + case 3373707: + message.name = reader.string(); + break; + case 227445161: + message.profile = reader.int32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 498091095: + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.compute.v1.Warnings.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslPolicy} SslPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslPolicy message. + * @function verify + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.customFeatures != null && message.hasOwnProperty("customFeatures")) { + if (!Array.isArray(message.customFeatures)) + return "customFeatures: array expected"; + for (var i = 0; i < message.customFeatures.length; ++i) + if (!$util.isString(message.customFeatures[i])) + return "customFeatures: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.enabledFeatures != null && message.hasOwnProperty("enabledFeatures")) { + if (!Array.isArray(message.enabledFeatures)) + return "enabledFeatures: array expected"; + for (var i = 0; i < message.enabledFeatures.length; ++i) + if (!$util.isString(message.enabledFeatures[i])) + return "enabledFeatures: string[] expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.minTlsVersion != null && message.hasOwnProperty("minTlsVersion")) { + properties._minTlsVersion = 1; + switch (message.minTlsVersion) { + default: + return "minTlsVersion: enum value expected"; + case 0: + case 33116734: + case 33116735: + case 33116736: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.profile != null && message.hasOwnProperty("profile")) { + properties._profile = 1; + switch (message.profile) { + default: + return "profile: enum value expected"; + case 0: + case 179357396: + case 388595569: + case 132013855: + case 261551195: + break; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: 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) { + var error = $root.google.cloud.compute.v1.Warnings.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + return null; + }; + + /** + * Creates a SslPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslPolicy} SslPolicy + */ + SslPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslPolicy) + return object; + var message = new $root.google.cloud.compute.v1.SslPolicy(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.customFeatures) { + if (!Array.isArray(object.customFeatures)) + throw TypeError(".google.cloud.compute.v1.SslPolicy.customFeatures: array expected"); + message.customFeatures = []; + for (var i = 0; i < object.customFeatures.length; ++i) + message.customFeatures[i] = String(object.customFeatures[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.enabledFeatures) { + if (!Array.isArray(object.enabledFeatures)) + throw TypeError(".google.cloud.compute.v1.SslPolicy.enabledFeatures: array expected"); + message.enabledFeatures = []; + for (var i = 0; i < object.enabledFeatures.length; ++i) + message.enabledFeatures[i] = String(object.enabledFeatures[i]); + } + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + switch (object.minTlsVersion) { + case "UNDEFINED_MIN_TLS_VERSION": + case 0: + message.minTlsVersion = 0; + break; + case "TLS_1_0": + case 33116734: + message.minTlsVersion = 33116734; + break; + case "TLS_1_1": + case 33116735: + message.minTlsVersion = 33116735; + break; + case "TLS_1_2": + case 33116736: + message.minTlsVersion = 33116736; + break; + } + if (object.name != null) + message.name = String(object.name); + switch (object.profile) { + case "UNDEFINED_PROFILE": + case 0: + message.profile = 0; + break; + case "COMPATIBLE": + case 179357396: + message.profile = 179357396; + break; + case "CUSTOM": + case 388595569: + message.profile = 388595569; + break; + case "MODERN": + case 132013855: + message.profile = 132013855; + break; + case "RESTRICTED": + case 261551195: + message.profile = 261551195; + break; + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.compute.v1.SslPolicy.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SslPolicy.warnings: object expected"); + message.warnings[i] = $root.google.cloud.compute.v1.Warnings.fromObject(object.warnings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SslPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslPolicy + * @static + * @param {google.cloud.compute.v1.SslPolicy} message SslPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.customFeatures = []; + object.enabledFeatures = []; + object.warnings = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.minTlsVersion != null && message.hasOwnProperty("minTlsVersion")) { + object.minTlsVersion = options.enums === String ? $root.google.cloud.compute.v1.SslPolicy.MinTlsVersion[message.minTlsVersion] : message.minTlsVersion; + if (options.oneofs) + object._minTlsVersion = "minTlsVersion"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.customFeatures && message.customFeatures.length) { + object.customFeatures = []; + for (var j = 0; j < message.customFeatures.length; ++j) + object.customFeatures[j] = message.customFeatures[j]; + } + if (message.profile != null && message.hasOwnProperty("profile")) { + object.profile = options.enums === String ? $root.google.cloud.compute.v1.SslPolicy.Profile[message.profile] : message.profile; + if (options.oneofs) + object._profile = "profile"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.enabledFeatures && message.enabledFeatures.length) { + object.enabledFeatures = []; + for (var j = 0; j < message.enabledFeatures.length; ++j) + object.enabledFeatures[j] = message.enabledFeatures[j]; + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.compute.v1.Warnings.toObject(message.warnings[j], options); + } + return object; + }; + + /** + * Converts this SslPolicy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslPolicy + * @instance + * @returns {Object.} JSON object + */ + SslPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * MinTlsVersion enum. + * @name google.cloud.compute.v1.SslPolicy.MinTlsVersion + * @enum {number} + * @property {number} UNDEFINED_MIN_TLS_VERSION=0 UNDEFINED_MIN_TLS_VERSION value + * @property {number} TLS_1_0=33116734 TLS_1_0 value + * @property {number} TLS_1_1=33116735 TLS_1_1 value + * @property {number} TLS_1_2=33116736 TLS_1_2 value + */ + SslPolicy.MinTlsVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_MIN_TLS_VERSION"] = 0; + values[valuesById[33116734] = "TLS_1_0"] = 33116734; + values[valuesById[33116735] = "TLS_1_1"] = 33116735; + values[valuesById[33116736] = "TLS_1_2"] = 33116736; + return values; + })(); + + /** + * Profile enum. + * @name google.cloud.compute.v1.SslPolicy.Profile + * @enum {number} + * @property {number} UNDEFINED_PROFILE=0 UNDEFINED_PROFILE value + * @property {number} COMPATIBLE=179357396 COMPATIBLE value + * @property {number} CUSTOM=388595569 CUSTOM value + * @property {number} MODERN=132013855 MODERN value + * @property {number} RESTRICTED=261551195 RESTRICTED value + */ + SslPolicy.Profile = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROFILE"] = 0; + values[valuesById[179357396] = "COMPATIBLE"] = 179357396; + values[valuesById[388595569] = "CUSTOM"] = 388595569; + values[valuesById[132013855] = "MODERN"] = 132013855; + values[valuesById[261551195] = "RESTRICTED"] = 261551195; + return values; + })(); + + return SslPolicy; + })(); + + v1.SslPoliciesList = (function() { + + /** + * Properties of a SslPoliciesList. + * @memberof google.cloud.compute.v1 + * @interface ISslPoliciesList + * @property {string|null} [id] SslPoliciesList id + * @property {Array.|null} [items] SslPoliciesList items + * @property {string|null} [kind] SslPoliciesList kind + * @property {string|null} [nextPageToken] SslPoliciesList nextPageToken + * @property {string|null} [selfLink] SslPoliciesList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] SslPoliciesList warning + */ + + /** + * Constructs a new SslPoliciesList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslPoliciesList. + * @implements ISslPoliciesList + * @constructor + * @param {google.cloud.compute.v1.ISslPoliciesList=} [properties] Properties to set + */ + function SslPoliciesList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslPoliciesList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + SslPoliciesList.prototype.id = null; + + /** + * SslPoliciesList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + SslPoliciesList.prototype.items = $util.emptyArray; + + /** + * SslPoliciesList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + SslPoliciesList.prototype.kind = null; + + /** + * SslPoliciesList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + SslPoliciesList.prototype.nextPageToken = null; + + /** + * SslPoliciesList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + SslPoliciesList.prototype.selfLink = null; + + /** + * SslPoliciesList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + SslPoliciesList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslPoliciesList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + Object.defineProperty(SslPoliciesList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPoliciesList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + Object.defineProperty(SslPoliciesList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPoliciesList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + Object.defineProperty(SslPoliciesList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPoliciesList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + Object.defineProperty(SslPoliciesList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SslPoliciesList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + */ + Object.defineProperty(SslPoliciesList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslPoliciesList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {google.cloud.compute.v1.ISslPoliciesList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslPoliciesList} SslPoliciesList instance + */ + SslPoliciesList.create = function create(properties) { + return new SslPoliciesList(properties); + }; + + /** + * Encodes the specified SslPoliciesList message. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {google.cloud.compute.v1.ISslPoliciesList} message SslPoliciesList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPoliciesList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.SslPolicy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified SslPoliciesList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {google.cloud.compute.v1.ISslPoliciesList} message SslPoliciesList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPoliciesList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslPoliciesList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslPoliciesList} SslPoliciesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPoliciesList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslPoliciesList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.SslPolicy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslPoliciesList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslPoliciesList} SslPoliciesList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPoliciesList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslPoliciesList message. + * @function verify + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslPoliciesList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.SslPolicy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SslPoliciesList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslPoliciesList} SslPoliciesList + */ + SslPoliciesList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslPoliciesList) + return object; + var message = new $root.google.cloud.compute.v1.SslPoliciesList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.SslPoliciesList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SslPoliciesList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.SslPolicy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SslPoliciesList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SslPoliciesList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslPoliciesList + * @static + * @param {google.cloud.compute.v1.SslPoliciesList} message SslPoliciesList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslPoliciesList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.SslPolicy.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this SslPoliciesList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslPoliciesList + * @instance + * @returns {Object.} JSON object + */ + SslPoliciesList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SslPoliciesList; + })(); + + v1.SslPoliciesListAvailableFeaturesResponse = (function() { + + /** + * Properties of a SslPoliciesListAvailableFeaturesResponse. + * @memberof google.cloud.compute.v1 + * @interface ISslPoliciesListAvailableFeaturesResponse + * @property {Array.|null} [features] SslPoliciesListAvailableFeaturesResponse features + */ + + /** + * Constructs a new SslPoliciesListAvailableFeaturesResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslPoliciesListAvailableFeaturesResponse. + * @implements ISslPoliciesListAvailableFeaturesResponse + * @constructor + * @param {google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse=} [properties] Properties to set + */ + function SslPoliciesListAvailableFeaturesResponse(properties) { + this.features = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslPoliciesListAvailableFeaturesResponse features. + * @member {Array.} features + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @instance + */ + SslPoliciesListAvailableFeaturesResponse.prototype.features = $util.emptyArray; + + /** + * Creates a new SslPoliciesListAvailableFeaturesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse} SslPoliciesListAvailableFeaturesResponse instance + */ + SslPoliciesListAvailableFeaturesResponse.create = function create(properties) { + return new SslPoliciesListAvailableFeaturesResponse(properties); + }; + + /** + * Encodes the specified SslPoliciesListAvailableFeaturesResponse message. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse} message SslPoliciesListAvailableFeaturesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPoliciesListAvailableFeaturesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && message.features.length) + for (var i = 0; i < message.features.length; ++i) + writer.uint32(/* id 246211645, wireType 2 =*/1969693162).string(message.features[i]); + return writer; + }; + + /** + * Encodes the specified SslPoliciesListAvailableFeaturesResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse} message SslPoliciesListAvailableFeaturesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPoliciesListAvailableFeaturesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslPoliciesListAvailableFeaturesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse} SslPoliciesListAvailableFeaturesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPoliciesListAvailableFeaturesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 246211645: + if (!(message.features && message.features.length)) + message.features = []; + message.features.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslPoliciesListAvailableFeaturesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse} SslPoliciesListAvailableFeaturesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPoliciesListAvailableFeaturesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslPoliciesListAvailableFeaturesResponse message. + * @function verify + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslPoliciesListAvailableFeaturesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + if (!Array.isArray(message.features)) + return "features: array expected"; + for (var i = 0; i < message.features.length; ++i) + if (!$util.isString(message.features[i])) + return "features: string[] expected"; + } + return null; + }; + + /** + * Creates a SslPoliciesListAvailableFeaturesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse} SslPoliciesListAvailableFeaturesResponse + */ + SslPoliciesListAvailableFeaturesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse) + return object; + var message = new $root.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse(); + if (object.features) { + if (!Array.isArray(object.features)) + throw TypeError(".google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse.features: array expected"); + message.features = []; + for (var i = 0; i < object.features.length; ++i) + message.features[i] = String(object.features[i]); + } + return message; + }; + + /** + * Creates a plain object from a SslPoliciesListAvailableFeaturesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @static + * @param {google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse} message SslPoliciesListAvailableFeaturesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslPoliciesListAvailableFeaturesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.features = []; + if (message.features && message.features.length) { + object.features = []; + for (var j = 0; j < message.features.length; ++j) + object.features[j] = message.features[j]; + } + return object; + }; + + /** + * Converts this SslPoliciesListAvailableFeaturesResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse + * @instance + * @returns {Object.} JSON object + */ + SslPoliciesListAvailableFeaturesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SslPoliciesListAvailableFeaturesResponse; + })(); + + v1.SslPolicyReference = (function() { + + /** + * Properties of a SslPolicyReference. + * @memberof google.cloud.compute.v1 + * @interface ISslPolicyReference + * @property {string|null} [sslPolicy] SslPolicyReference sslPolicy + */ + + /** + * Constructs a new SslPolicyReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslPolicyReference. + * @implements ISslPolicyReference + * @constructor + * @param {google.cloud.compute.v1.ISslPolicyReference=} [properties] Properties to set + */ + function SslPolicyReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SslPolicyReference sslPolicy. + * @member {string|null|undefined} sslPolicy + * @memberof google.cloud.compute.v1.SslPolicyReference + * @instance + */ + SslPolicyReference.prototype.sslPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SslPolicyReference _sslPolicy. + * @member {"sslPolicy"|undefined} _sslPolicy + * @memberof google.cloud.compute.v1.SslPolicyReference + * @instance + */ + Object.defineProperty(SslPolicyReference.prototype, "_sslPolicy", { + get: $util.oneOfGetter($oneOfFields = ["sslPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SslPolicyReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {google.cloud.compute.v1.ISslPolicyReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SslPolicyReference} SslPolicyReference instance + */ + SslPolicyReference.create = function create(properties) { + return new SslPolicyReference(properties); + }; + + /** + * Encodes the specified SslPolicyReference message. Does not implicitly {@link google.cloud.compute.v1.SslPolicyReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {google.cloud.compute.v1.ISslPolicyReference} message SslPolicyReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPolicyReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslPolicy != null && Object.hasOwnProperty.call(message, "sslPolicy")) + writer.uint32(/* id 295190213, wireType 2 =*/2361521706).string(message.sslPolicy); + return writer; + }; + + /** + * Encodes the specified SslPolicyReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SslPolicyReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {google.cloud.compute.v1.ISslPolicyReference} message SslPolicyReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SslPolicyReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SslPolicyReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SslPolicyReference} SslPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPolicyReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SslPolicyReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 295190213: + message.sslPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SslPolicyReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SslPolicyReference} SslPolicyReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SslPolicyReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SslPolicyReference message. + * @function verify + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SslPolicyReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) { + properties._sslPolicy = 1; + if (!$util.isString(message.sslPolicy)) + return "sslPolicy: string expected"; + } + return null; + }; + + /** + * Creates a SslPolicyReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SslPolicyReference} SslPolicyReference + */ + SslPolicyReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SslPolicyReference) + return object; + var message = new $root.google.cloud.compute.v1.SslPolicyReference(); + if (object.sslPolicy != null) + message.sslPolicy = String(object.sslPolicy); + return message; + }; + + /** + * Creates a plain object from a SslPolicyReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SslPolicyReference + * @static + * @param {google.cloud.compute.v1.SslPolicyReference} message SslPolicyReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SslPolicyReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) { + object.sslPolicy = message.sslPolicy; + if (options.oneofs) + object._sslPolicy = "sslPolicy"; + } + return object; + }; + + /** + * Converts this SslPolicyReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SslPolicyReference + * @instance + * @returns {Object.} JSON object + */ + SslPolicyReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SslPolicyReference; + })(); + + v1.StatefulPolicyPreservedState = (function() { + + /** + * Properties of a StatefulPolicyPreservedState. + * @memberof google.cloud.compute.v1 + * @interface IStatefulPolicyPreservedState + * @property {Object.|null} [disks] StatefulPolicyPreservedState disks + */ + + /** + * Constructs a new StatefulPolicyPreservedState. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a StatefulPolicyPreservedState. + * @implements IStatefulPolicyPreservedState + * @constructor + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedState=} [properties] Properties to set + */ + function StatefulPolicyPreservedState(properties) { + this.disks = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatefulPolicyPreservedState disks. + * @member {Object.} disks + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @instance + */ + StatefulPolicyPreservedState.prototype.disks = $util.emptyObject; + + /** + * Creates a new StatefulPolicyPreservedState instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedState=} [properties] Properties to set + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedState} StatefulPolicyPreservedState instance + */ + StatefulPolicyPreservedState.create = function create(properties) { + return new StatefulPolicyPreservedState(properties); + }; + + /** + * Encodes the specified StatefulPolicyPreservedState message. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedState.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedState} message StatefulPolicyPreservedState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatefulPolicyPreservedState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disks != null && Object.hasOwnProperty.call(message, "disks")) + for (var keys = Object.keys(message.disks), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 95594102, wireType 2 =*/764752818).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.encode(message.disks[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified StatefulPolicyPreservedState message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedState} message StatefulPolicyPreservedState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatefulPolicyPreservedState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatefulPolicyPreservedState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedState} StatefulPolicyPreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatefulPolicyPreservedState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.StatefulPolicyPreservedState(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 95594102: + if (message.disks === $util.emptyObject) + message.disks = {}; + 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.compute.v1.StatefulPolicyPreservedStateDiskDevice.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.disks[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatefulPolicyPreservedState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedState} StatefulPolicyPreservedState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatefulPolicyPreservedState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatefulPolicyPreservedState message. + * @function verify + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatefulPolicyPreservedState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!$util.isObject(message.disks)) + return "disks: object expected"; + var key = Object.keys(message.disks); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.verify(message.disks[key[i]]); + if (error) + return "disks." + error; + } + } + return null; + }; + + /** + * Creates a StatefulPolicyPreservedState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedState} StatefulPolicyPreservedState + */ + StatefulPolicyPreservedState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.StatefulPolicyPreservedState) + return object; + var message = new $root.google.cloud.compute.v1.StatefulPolicyPreservedState(); + if (object.disks) { + if (typeof object.disks !== "object") + throw TypeError(".google.cloud.compute.v1.StatefulPolicyPreservedState.disks: object expected"); + message.disks = {}; + for (var keys = Object.keys(object.disks), i = 0; i < keys.length; ++i) { + if (typeof object.disks[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.StatefulPolicyPreservedState.disks: object expected"); + message.disks[keys[i]] = $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.fromObject(object.disks[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a StatefulPolicyPreservedState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @static + * @param {google.cloud.compute.v1.StatefulPolicyPreservedState} message StatefulPolicyPreservedState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatefulPolicyPreservedState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.disks = {}; + var keys2; + if (message.disks && (keys2 = Object.keys(message.disks)).length) { + object.disks = {}; + for (var j = 0; j < keys2.length; ++j) + object.disks[keys2[j]] = $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.toObject(message.disks[keys2[j]], options); + } + return object; + }; + + /** + * Converts this StatefulPolicyPreservedState to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedState + * @instance + * @returns {Object.} JSON object + */ + StatefulPolicyPreservedState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StatefulPolicyPreservedState; + })(); + + v1.StatefulPolicyPreservedStateDiskDevice = (function() { + + /** + * Properties of a StatefulPolicyPreservedStateDiskDevice. + * @memberof google.cloud.compute.v1 + * @interface IStatefulPolicyPreservedStateDiskDevice + * @property {google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete|null} [autoDelete] StatefulPolicyPreservedStateDiskDevice autoDelete + */ + + /** + * Constructs a new StatefulPolicyPreservedStateDiskDevice. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a StatefulPolicyPreservedStateDiskDevice. + * @implements IStatefulPolicyPreservedStateDiskDevice + * @constructor + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice=} [properties] Properties to set + */ + function StatefulPolicyPreservedStateDiskDevice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatefulPolicyPreservedStateDiskDevice autoDelete. + * @member {google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete|null|undefined} autoDelete + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @instance + */ + StatefulPolicyPreservedStateDiskDevice.prototype.autoDelete = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StatefulPolicyPreservedStateDiskDevice _autoDelete. + * @member {"autoDelete"|undefined} _autoDelete + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @instance + */ + Object.defineProperty(StatefulPolicyPreservedStateDiskDevice.prototype, "_autoDelete", { + get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StatefulPolicyPreservedStateDiskDevice instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice=} [properties] Properties to set + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice} StatefulPolicyPreservedStateDiskDevice instance + */ + StatefulPolicyPreservedStateDiskDevice.create = function create(properties) { + return new StatefulPolicyPreservedStateDiskDevice(properties); + }; + + /** + * Encodes the specified StatefulPolicyPreservedStateDiskDevice message. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice} message StatefulPolicyPreservedStateDiskDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatefulPolicyPreservedStateDiskDevice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 464761403, wireType 0 =*/3718091224).int32(message.autoDelete); + return writer; + }; + + /** + * Encodes the specified StatefulPolicyPreservedStateDiskDevice message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {google.cloud.compute.v1.IStatefulPolicyPreservedStateDiskDevice} message StatefulPolicyPreservedStateDiskDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatefulPolicyPreservedStateDiskDevice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatefulPolicyPreservedStateDiskDevice message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice} StatefulPolicyPreservedStateDiskDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatefulPolicyPreservedStateDiskDevice.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 464761403: + message.autoDelete = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StatefulPolicyPreservedStateDiskDevice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice} StatefulPolicyPreservedStateDiskDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatefulPolicyPreservedStateDiskDevice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatefulPolicyPreservedStateDiskDevice message. + * @function verify + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatefulPolicyPreservedStateDiskDevice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + properties._autoDelete = 1; + switch (message.autoDelete) { + default: + return "autoDelete: enum value expected"; + case 0: + case 74175084: + case 95727719: + break; + } + } + return null; + }; + + /** + * Creates a StatefulPolicyPreservedStateDiskDevice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice} StatefulPolicyPreservedStateDiskDevice + */ + StatefulPolicyPreservedStateDiskDevice.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice) + return object; + var message = new $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice(); + switch (object.autoDelete) { + case "UNDEFINED_AUTO_DELETE": + case 0: + message.autoDelete = 0; + break; + case "NEVER": + case 74175084: + message.autoDelete = 74175084; + break; + case "ON_PERMANENT_INSTANCE_DELETION": + case 95727719: + message.autoDelete = 95727719; + break; + } + return message; + }; + + /** + * Creates a plain object from a StatefulPolicyPreservedStateDiskDevice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @static + * @param {google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice} message StatefulPolicyPreservedStateDiskDevice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatefulPolicyPreservedStateDiskDevice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + object.autoDelete = options.enums === String ? $root.google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete[message.autoDelete] : message.autoDelete; + if (options.oneofs) + object._autoDelete = "autoDelete"; + } + return object; + }; + + /** + * Converts this StatefulPolicyPreservedStateDiskDevice to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice + * @instance + * @returns {Object.} JSON object + */ + StatefulPolicyPreservedStateDiskDevice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AutoDelete enum. + * @name google.cloud.compute.v1.StatefulPolicyPreservedStateDiskDevice.AutoDelete + * @enum {number} + * @property {number} UNDEFINED_AUTO_DELETE=0 UNDEFINED_AUTO_DELETE value + * @property {number} NEVER=74175084 NEVER value + * @property {number} ON_PERMANENT_INSTANCE_DELETION=95727719 ON_PERMANENT_INSTANCE_DELETION value + */ + StatefulPolicyPreservedStateDiskDevice.AutoDelete = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_AUTO_DELETE"] = 0; + values[valuesById[74175084] = "NEVER"] = 74175084; + values[valuesById[95727719] = "ON_PERMANENT_INSTANCE_DELETION"] = 95727719; + return values; + })(); + + return StatefulPolicyPreservedStateDiskDevice; + })(); + + v1.SubnetworkLogConfig = (function() { + + /** + * Properties of a SubnetworkLogConfig. + * @memberof google.cloud.compute.v1 + * @interface ISubnetworkLogConfig + * @property {google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval|null} [aggregationInterval] SubnetworkLogConfig aggregationInterval + * @property {boolean|null} [enable] SubnetworkLogConfig enable + * @property {string|null} [filterExpr] SubnetworkLogConfig filterExpr + * @property {number|null} [flowSampling] SubnetworkLogConfig flowSampling + * @property {google.cloud.compute.v1.SubnetworkLogConfig.Metadata|null} [metadata] SubnetworkLogConfig metadata + * @property {Array.|null} [metadataFields] SubnetworkLogConfig metadataFields + */ + + /** + * Constructs a new SubnetworkLogConfig. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SubnetworkLogConfig. + * @implements ISubnetworkLogConfig + * @constructor + * @param {google.cloud.compute.v1.ISubnetworkLogConfig=} [properties] Properties to set + */ + function SubnetworkLogConfig(properties) { + this.metadataFields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubnetworkLogConfig aggregationInterval. + * @member {google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval|null|undefined} aggregationInterval + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + SubnetworkLogConfig.prototype.aggregationInterval = null; + + /** + * SubnetworkLogConfig enable. + * @member {boolean|null|undefined} enable + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + SubnetworkLogConfig.prototype.enable = null; + + /** + * SubnetworkLogConfig filterExpr. + * @member {string|null|undefined} filterExpr + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + SubnetworkLogConfig.prototype.filterExpr = null; + + /** + * SubnetworkLogConfig flowSampling. + * @member {number|null|undefined} flowSampling + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + SubnetworkLogConfig.prototype.flowSampling = null; + + /** + * SubnetworkLogConfig metadata. + * @member {google.cloud.compute.v1.SubnetworkLogConfig.Metadata|null|undefined} metadata + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + SubnetworkLogConfig.prototype.metadata = null; + + /** + * SubnetworkLogConfig metadataFields. + * @member {Array.} metadataFields + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + SubnetworkLogConfig.prototype.metadataFields = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubnetworkLogConfig _aggregationInterval. + * @member {"aggregationInterval"|undefined} _aggregationInterval + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + Object.defineProperty(SubnetworkLogConfig.prototype, "_aggregationInterval", { + get: $util.oneOfGetter($oneOfFields = ["aggregationInterval"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkLogConfig _enable. + * @member {"enable"|undefined} _enable + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + Object.defineProperty(SubnetworkLogConfig.prototype, "_enable", { + get: $util.oneOfGetter($oneOfFields = ["enable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkLogConfig _filterExpr. + * @member {"filterExpr"|undefined} _filterExpr + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + Object.defineProperty(SubnetworkLogConfig.prototype, "_filterExpr", { + get: $util.oneOfGetter($oneOfFields = ["filterExpr"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkLogConfig _flowSampling. + * @member {"flowSampling"|undefined} _flowSampling + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + Object.defineProperty(SubnetworkLogConfig.prototype, "_flowSampling", { + get: $util.oneOfGetter($oneOfFields = ["flowSampling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkLogConfig _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + */ + Object.defineProperty(SubnetworkLogConfig.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubnetworkLogConfig instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {google.cloud.compute.v1.ISubnetworkLogConfig=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SubnetworkLogConfig} SubnetworkLogConfig instance + */ + SubnetworkLogConfig.create = function create(properties) { + return new SubnetworkLogConfig(properties); + }; + + /** + * Encodes the specified SubnetworkLogConfig message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkLogConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {google.cloud.compute.v1.ISubnetworkLogConfig} message SubnetworkLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + writer.uint32(/* id 86866735, wireType 0 =*/694933880).int32(message.metadata); + if (message.aggregationInterval != null && Object.hasOwnProperty.call(message, "aggregationInterval")) + writer.uint32(/* id 174919042, wireType 0 =*/1399352336).int32(message.aggregationInterval); + if (message.filterExpr != null && Object.hasOwnProperty.call(message, "filterExpr")) + writer.uint32(/* id 183374428, wireType 2 =*/1466995426).string(message.filterExpr); + if (message.enable != null && Object.hasOwnProperty.call(message, "enable")) + writer.uint32(/* id 311764355, wireType 0 =*/2494114840).bool(message.enable); + if (message.metadataFields != null && message.metadataFields.length) + for (var i = 0; i < message.metadataFields.length; ++i) + writer.uint32(/* id 378461641, wireType 2 =*/3027693130).string(message.metadataFields[i]); + if (message.flowSampling != null && Object.hasOwnProperty.call(message, "flowSampling")) + writer.uint32(/* id 530150360, wireType 5 =*/4241202885).float(message.flowSampling); + return writer; + }; + + /** + * Encodes the specified SubnetworkLogConfig message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {google.cloud.compute.v1.ISubnetworkLogConfig} message SubnetworkLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubnetworkLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SubnetworkLogConfig} SubnetworkLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SubnetworkLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 174919042: + message.aggregationInterval = reader.int32(); + break; + case 311764355: + message.enable = reader.bool(); + break; + case 183374428: + message.filterExpr = reader.string(); + break; + case 530150360: + message.flowSampling = reader.float(); + break; + case 86866735: + message.metadata = reader.int32(); + break; + case 378461641: + if (!(message.metadataFields && message.metadataFields.length)) + message.metadataFields = []; + message.metadataFields.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubnetworkLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SubnetworkLogConfig} SubnetworkLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubnetworkLogConfig message. + * @function verify + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubnetworkLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.aggregationInterval != null && message.hasOwnProperty("aggregationInterval")) { + properties._aggregationInterval = 1; + switch (message.aggregationInterval) { + default: + return "aggregationInterval: enum value expected"; + case 0: + case 487155916: + case 491773521: + case 69052714: + case 7548937: + case 72746798: + case 72752429: + break; + } + } + if (message.enable != null && message.hasOwnProperty("enable")) { + properties._enable = 1; + if (typeof message.enable !== "boolean") + return "enable: boolean expected"; + } + if (message.filterExpr != null && message.hasOwnProperty("filterExpr")) { + properties._filterExpr = 1; + if (!$util.isString(message.filterExpr)) + return "filterExpr: string expected"; + } + if (message.flowSampling != null && message.hasOwnProperty("flowSampling")) { + properties._flowSampling = 1; + if (typeof message.flowSampling !== "number") + return "flowSampling: number expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + switch (message.metadata) { + default: + return "metadata: enum value expected"; + case 0: + case 62450749: + case 334519954: + case 164619908: + break; + } + } + if (message.metadataFields != null && message.hasOwnProperty("metadataFields")) { + if (!Array.isArray(message.metadataFields)) + return "metadataFields: array expected"; + for (var i = 0; i < message.metadataFields.length; ++i) + if (!$util.isString(message.metadataFields[i])) + return "metadataFields: string[] expected"; + } + return null; + }; + + /** + * Creates a SubnetworkLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SubnetworkLogConfig} SubnetworkLogConfig + */ + SubnetworkLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SubnetworkLogConfig) + return object; + var message = new $root.google.cloud.compute.v1.SubnetworkLogConfig(); + switch (object.aggregationInterval) { + case "UNDEFINED_AGGREGATION_INTERVAL": + case 0: + message.aggregationInterval = 0; + break; + case "INTERVAL_10_MIN": + case 487155916: + message.aggregationInterval = 487155916; + break; + case "INTERVAL_15_MIN": + case 491773521: + message.aggregationInterval = 491773521; + break; + case "INTERVAL_1_MIN": + case 69052714: + message.aggregationInterval = 69052714; + break; + case "INTERVAL_30_SEC": + case 7548937: + message.aggregationInterval = 7548937; + break; + case "INTERVAL_5_MIN": + case 72746798: + message.aggregationInterval = 72746798; + break; + case "INTERVAL_5_SEC": + case 72752429: + message.aggregationInterval = 72752429; + break; + } + if (object.enable != null) + message.enable = Boolean(object.enable); + if (object.filterExpr != null) + message.filterExpr = String(object.filterExpr); + if (object.flowSampling != null) + message.flowSampling = Number(object.flowSampling); + switch (object.metadata) { + case "UNDEFINED_METADATA": + case 0: + message.metadata = 0; + break; + case "CUSTOM_METADATA": + case 62450749: + message.metadata = 62450749; + break; + case "EXCLUDE_ALL_METADATA": + case 334519954: + message.metadata = 334519954; + break; + case "INCLUDE_ALL_METADATA": + case 164619908: + message.metadata = 164619908; + break; + } + if (object.metadataFields) { + if (!Array.isArray(object.metadataFields)) + throw TypeError(".google.cloud.compute.v1.SubnetworkLogConfig.metadataFields: array expected"); + message.metadataFields = []; + for (var i = 0; i < object.metadataFields.length; ++i) + message.metadataFields[i] = String(object.metadataFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a SubnetworkLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @static + * @param {google.cloud.compute.v1.SubnetworkLogConfig} message SubnetworkLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubnetworkLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metadataFields = []; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = options.enums === String ? $root.google.cloud.compute.v1.SubnetworkLogConfig.Metadata[message.metadata] : message.metadata; + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.aggregationInterval != null && message.hasOwnProperty("aggregationInterval")) { + object.aggregationInterval = options.enums === String ? $root.google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval[message.aggregationInterval] : message.aggregationInterval; + if (options.oneofs) + object._aggregationInterval = "aggregationInterval"; + } + if (message.filterExpr != null && message.hasOwnProperty("filterExpr")) { + object.filterExpr = message.filterExpr; + if (options.oneofs) + object._filterExpr = "filterExpr"; + } + if (message.enable != null && message.hasOwnProperty("enable")) { + object.enable = message.enable; + if (options.oneofs) + object._enable = "enable"; + } + if (message.metadataFields && message.metadataFields.length) { + object.metadataFields = []; + for (var j = 0; j < message.metadataFields.length; ++j) + object.metadataFields[j] = message.metadataFields[j]; + } + if (message.flowSampling != null && message.hasOwnProperty("flowSampling")) { + object.flowSampling = options.json && !isFinite(message.flowSampling) ? String(message.flowSampling) : message.flowSampling; + if (options.oneofs) + object._flowSampling = "flowSampling"; + } + return object; + }; + + /** + * Converts this SubnetworkLogConfig to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SubnetworkLogConfig + * @instance + * @returns {Object.} JSON object + */ + SubnetworkLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AggregationInterval enum. + * @name google.cloud.compute.v1.SubnetworkLogConfig.AggregationInterval + * @enum {number} + * @property {number} UNDEFINED_AGGREGATION_INTERVAL=0 UNDEFINED_AGGREGATION_INTERVAL value + * @property {number} INTERVAL_10_MIN=487155916 INTERVAL_10_MIN value + * @property {number} INTERVAL_15_MIN=491773521 INTERVAL_15_MIN value + * @property {number} INTERVAL_1_MIN=69052714 INTERVAL_1_MIN value + * @property {number} INTERVAL_30_SEC=7548937 INTERVAL_30_SEC value + * @property {number} INTERVAL_5_MIN=72746798 INTERVAL_5_MIN value + * @property {number} INTERVAL_5_SEC=72752429 INTERVAL_5_SEC value + */ + SubnetworkLogConfig.AggregationInterval = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_AGGREGATION_INTERVAL"] = 0; + values[valuesById[487155916] = "INTERVAL_10_MIN"] = 487155916; + values[valuesById[491773521] = "INTERVAL_15_MIN"] = 491773521; + values[valuesById[69052714] = "INTERVAL_1_MIN"] = 69052714; + values[valuesById[7548937] = "INTERVAL_30_SEC"] = 7548937; + values[valuesById[72746798] = "INTERVAL_5_MIN"] = 72746798; + values[valuesById[72752429] = "INTERVAL_5_SEC"] = 72752429; + return values; + })(); + + /** + * Metadata enum. + * @name google.cloud.compute.v1.SubnetworkLogConfig.Metadata + * @enum {number} + * @property {number} UNDEFINED_METADATA=0 UNDEFINED_METADATA value + * @property {number} CUSTOM_METADATA=62450749 CUSTOM_METADATA value + * @property {number} EXCLUDE_ALL_METADATA=334519954 EXCLUDE_ALL_METADATA value + * @property {number} INCLUDE_ALL_METADATA=164619908 INCLUDE_ALL_METADATA value + */ + SubnetworkLogConfig.Metadata = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_METADATA"] = 0; + values[valuesById[62450749] = "CUSTOM_METADATA"] = 62450749; + values[valuesById[334519954] = "EXCLUDE_ALL_METADATA"] = 334519954; + values[valuesById[164619908] = "INCLUDE_ALL_METADATA"] = 164619908; + return values; + })(); + + return SubnetworkLogConfig; + })(); + + v1.SubnetworkSecondaryRange = (function() { + + /** + * Properties of a SubnetworkSecondaryRange. + * @memberof google.cloud.compute.v1 + * @interface ISubnetworkSecondaryRange + * @property {string|null} [ipCidrRange] SubnetworkSecondaryRange ipCidrRange + * @property {string|null} [rangeName] SubnetworkSecondaryRange rangeName + */ + + /** + * Constructs a new SubnetworkSecondaryRange. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SubnetworkSecondaryRange. + * @implements ISubnetworkSecondaryRange + * @constructor + * @param {google.cloud.compute.v1.ISubnetworkSecondaryRange=} [properties] Properties to set + */ + function SubnetworkSecondaryRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubnetworkSecondaryRange ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @instance + */ + SubnetworkSecondaryRange.prototype.ipCidrRange = null; + + /** + * SubnetworkSecondaryRange rangeName. + * @member {string|null|undefined} rangeName + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @instance + */ + SubnetworkSecondaryRange.prototype.rangeName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubnetworkSecondaryRange _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @instance + */ + Object.defineProperty(SubnetworkSecondaryRange.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkSecondaryRange _rangeName. + * @member {"rangeName"|undefined} _rangeName + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @instance + */ + Object.defineProperty(SubnetworkSecondaryRange.prototype, "_rangeName", { + get: $util.oneOfGetter($oneOfFields = ["rangeName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubnetworkSecondaryRange instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.ISubnetworkSecondaryRange=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SubnetworkSecondaryRange} SubnetworkSecondaryRange instance + */ + SubnetworkSecondaryRange.create = function create(properties) { + return new SubnetworkSecondaryRange(properties); + }; + + /** + * Encodes the specified SubnetworkSecondaryRange message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkSecondaryRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.ISubnetworkSecondaryRange} message SubnetworkSecondaryRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkSecondaryRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.rangeName != null && Object.hasOwnProperty.call(message, "rangeName")) + writer.uint32(/* id 332216397, wireType 2 =*/2657731178).string(message.rangeName); + return writer; + }; + + /** + * Encodes the specified SubnetworkSecondaryRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkSecondaryRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.ISubnetworkSecondaryRange} message SubnetworkSecondaryRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkSecondaryRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubnetworkSecondaryRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SubnetworkSecondaryRange} SubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkSecondaryRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SubnetworkSecondaryRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 332216397: + message.rangeName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubnetworkSecondaryRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SubnetworkSecondaryRange} SubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkSecondaryRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubnetworkSecondaryRange message. + * @function verify + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubnetworkSecondaryRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.rangeName != null && message.hasOwnProperty("rangeName")) { + properties._rangeName = 1; + if (!$util.isString(message.rangeName)) + return "rangeName: string expected"; + } + return null; + }; + + /** + * Creates a SubnetworkSecondaryRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SubnetworkSecondaryRange} SubnetworkSecondaryRange + */ + SubnetworkSecondaryRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SubnetworkSecondaryRange) + return object; + var message = new $root.google.cloud.compute.v1.SubnetworkSecondaryRange(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.rangeName != null) + message.rangeName = String(object.rangeName); + return message; + }; + + /** + * Creates a plain object from a SubnetworkSecondaryRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.SubnetworkSecondaryRange} message SubnetworkSecondaryRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubnetworkSecondaryRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.rangeName != null && message.hasOwnProperty("rangeName")) { + object.rangeName = message.rangeName; + if (options.oneofs) + object._rangeName = "rangeName"; + } + return object; + }; + + /** + * Converts this SubnetworkSecondaryRange to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SubnetworkSecondaryRange + * @instance + * @returns {Object.} JSON object + */ + SubnetworkSecondaryRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubnetworkSecondaryRange; + })(); + + v1.Subnetwork = (function() { + + /** + * Properties of a Subnetwork. + * @memberof google.cloud.compute.v1 + * @interface ISubnetwork + * @property {string|null} [creationTimestamp] Subnetwork creationTimestamp + * @property {string|null} [description] Subnetwork description + * @property {boolean|null} [enableFlowLogs] Subnetwork enableFlowLogs + * @property {string|null} [fingerprint] Subnetwork fingerprint + * @property {string|null} [gatewayAddress] Subnetwork gatewayAddress + * @property {number|Long|null} [id] Subnetwork id + * @property {string|null} [ipCidrRange] Subnetwork ipCidrRange + * @property {string|null} [ipv6CidrRange] Subnetwork ipv6CidrRange + * @property {string|null} [kind] Subnetwork kind + * @property {google.cloud.compute.v1.ISubnetworkLogConfig|null} [logConfig] Subnetwork logConfig + * @property {string|null} [name] Subnetwork name + * @property {string|null} [network] Subnetwork network + * @property {boolean|null} [privateIpGoogleAccess] Subnetwork privateIpGoogleAccess + * @property {google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] Subnetwork privateIpv6GoogleAccess + * @property {google.cloud.compute.v1.Subnetwork.Purpose|null} [purpose] Subnetwork purpose + * @property {string|null} [region] Subnetwork region + * @property {google.cloud.compute.v1.Subnetwork.Role|null} [role] Subnetwork role + * @property {Array.|null} [secondaryIpRanges] Subnetwork secondaryIpRanges + * @property {string|null} [selfLink] Subnetwork selfLink + * @property {google.cloud.compute.v1.Subnetwork.State|null} [state] Subnetwork state + */ + + /** + * Constructs a new Subnetwork. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Subnetwork. + * @implements ISubnetwork + * @constructor + * @param {google.cloud.compute.v1.ISubnetwork=} [properties] Properties to set + */ + function Subnetwork(properties) { + this.secondaryIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Subnetwork creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.creationTimestamp = null; + + /** + * Subnetwork description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.description = null; + + /** + * Subnetwork enableFlowLogs. + * @member {boolean|null|undefined} enableFlowLogs + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.enableFlowLogs = null; + + /** + * Subnetwork fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.fingerprint = null; + + /** + * Subnetwork gatewayAddress. + * @member {string|null|undefined} gatewayAddress + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.gatewayAddress = null; + + /** + * Subnetwork id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.id = null; + + /** + * Subnetwork ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.ipCidrRange = null; + + /** + * Subnetwork ipv6CidrRange. + * @member {string|null|undefined} ipv6CidrRange + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.ipv6CidrRange = null; + + /** + * Subnetwork kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.kind = null; + + /** + * Subnetwork logConfig. + * @member {google.cloud.compute.v1.ISubnetworkLogConfig|null|undefined} logConfig + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.logConfig = null; + + /** + * Subnetwork name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.name = null; + + /** + * Subnetwork network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.network = null; + + /** + * Subnetwork privateIpGoogleAccess. + * @member {boolean|null|undefined} privateIpGoogleAccess + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.privateIpGoogleAccess = null; + + /** + * Subnetwork privateIpv6GoogleAccess. + * @member {google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess|null|undefined} privateIpv6GoogleAccess + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.privateIpv6GoogleAccess = null; + + /** + * Subnetwork purpose. + * @member {google.cloud.compute.v1.Subnetwork.Purpose|null|undefined} purpose + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.purpose = null; + + /** + * Subnetwork region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.region = null; + + /** + * Subnetwork role. + * @member {google.cloud.compute.v1.Subnetwork.Role|null|undefined} role + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.role = null; + + /** + * Subnetwork secondaryIpRanges. + * @member {Array.} secondaryIpRanges + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.secondaryIpRanges = $util.emptyArray; + + /** + * Subnetwork selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.selfLink = null; + + /** + * Subnetwork state. + * @member {google.cloud.compute.v1.Subnetwork.State|null|undefined} state + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Subnetwork.prototype.state = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Subnetwork _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _enableFlowLogs. + * @member {"enableFlowLogs"|undefined} _enableFlowLogs + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_enableFlowLogs", { + get: $util.oneOfGetter($oneOfFields = ["enableFlowLogs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _gatewayAddress. + * @member {"gatewayAddress"|undefined} _gatewayAddress + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_gatewayAddress", { + get: $util.oneOfGetter($oneOfFields = ["gatewayAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _ipv6CidrRange. + * @member {"ipv6CidrRange"|undefined} _ipv6CidrRange + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_ipv6CidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipv6CidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _logConfig. + * @member {"logConfig"|undefined} _logConfig + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_logConfig", { + get: $util.oneOfGetter($oneOfFields = ["logConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _privateIpGoogleAccess. + * @member {"privateIpGoogleAccess"|undefined} _privateIpGoogleAccess + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_privateIpGoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpGoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _privateIpv6GoogleAccess. + * @member {"privateIpv6GoogleAccess"|undefined} _privateIpv6GoogleAccess + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_privateIpv6GoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpv6GoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _purpose. + * @member {"purpose"|undefined} _purpose + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_purpose", { + get: $util.oneOfGetter($oneOfFields = ["purpose"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _role. + * @member {"role"|undefined} _role + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_role", { + get: $util.oneOfGetter($oneOfFields = ["role"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Subnetwork _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + */ + Object.defineProperty(Subnetwork.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Subnetwork instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {google.cloud.compute.v1.ISubnetwork=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Subnetwork} Subnetwork instance + */ + Subnetwork.create = function create(properties) { + return new Subnetwork(properties); + }; + + /** + * Encodes the specified Subnetwork message. Does not implicitly {@link google.cloud.compute.v1.Subnetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {google.cloud.compute.v1.ISubnetwork} message Subnetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subnetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 3506294, wireType 0 =*/28050352).int32(message.role); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) + writer.uint32(/* id 48277006, wireType 0 =*/386216048).int32(message.privateIpv6GoogleAccess); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + if (message.secondaryIpRanges != null && message.secondaryIpRanges.length) + for (var i = 0; i < message.secondaryIpRanges.length; ++i) + $root.google.cloud.compute.v1.SubnetworkSecondaryRange.encode(message.secondaryIpRanges[i], writer.uint32(/* id 136658915, wireType 2 =*/1093271322).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.enableFlowLogs != null && Object.hasOwnProperty.call(message, "enableFlowLogs")) + writer.uint32(/* id 151544420, wireType 0 =*/1212355360).bool(message.enableFlowLogs); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.ipv6CidrRange != null && Object.hasOwnProperty.call(message, "ipv6CidrRange")) + writer.uint32(/* id 273141258, wireType 2 =*/2185130066).string(message.ipv6CidrRange); + if (message.purpose != null && Object.hasOwnProperty.call(message, "purpose")) + writer.uint32(/* id 316407070, wireType 0 =*/2531256560).int32(message.purpose); + if (message.logConfig != null && Object.hasOwnProperty.call(message, "logConfig")) + $root.google.cloud.compute.v1.SubnetworkLogConfig.encode(message.logConfig, writer.uint32(/* id 351299741, wireType 2 =*/2810397930).fork()).ldelim(); + if (message.privateIpGoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpGoogleAccess")) + writer.uint32(/* id 421491790, wireType 0 =*/3371934320).bool(message.privateIpGoogleAccess); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.gatewayAddress != null && Object.hasOwnProperty.call(message, "gatewayAddress")) + writer.uint32(/* id 459867385, wireType 2 =*/3678939082).string(message.gatewayAddress); + return writer; + }; + + /** + * Encodes the specified Subnetwork message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Subnetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {google.cloud.compute.v1.ISubnetwork} message Subnetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subnetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subnetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.Subnetwork} Subnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subnetwork.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.Subnetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 151544420: + message.enableFlowLogs = reader.bool(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 459867385: + message.gatewayAddress = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 273141258: + message.ipv6CidrRange = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 351299741: + message.logConfig = $root.google.cloud.compute.v1.SubnetworkLogConfig.decode(reader, reader.uint32()); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 421491790: + message.privateIpGoogleAccess = reader.bool(); + break; + case 48277006: + message.privateIpv6GoogleAccess = reader.int32(); + break; + case 316407070: + message.purpose = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 3506294: + message.role = reader.int32(); + break; + case 136658915: + if (!(message.secondaryIpRanges && message.secondaryIpRanges.length)) + message.secondaryIpRanges = []; + message.secondaryIpRanges.push($root.google.cloud.compute.v1.SubnetworkSecondaryRange.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 109757585: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subnetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.Subnetwork} Subnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subnetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subnetwork message. + * @function verify + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subnetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.enableFlowLogs != null && message.hasOwnProperty("enableFlowLogs")) { + properties._enableFlowLogs = 1; + if (typeof message.enableFlowLogs !== "boolean") + return "enableFlowLogs: boolean expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.gatewayAddress != null && message.hasOwnProperty("gatewayAddress")) { + properties._gatewayAddress = 1; + if (!$util.isString(message.gatewayAddress)) + return "gatewayAddress: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.ipv6CidrRange != null && message.hasOwnProperty("ipv6CidrRange")) { + properties._ipv6CidrRange = 1; + if (!$util.isString(message.ipv6CidrRange)) + return "ipv6CidrRange: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + properties._logConfig = 1; + { + var error = $root.google.cloud.compute.v1.SubnetworkLogConfig.verify(message.logConfig); + if (error) + return "logConfig." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.privateIpGoogleAccess != null && message.hasOwnProperty("privateIpGoogleAccess")) { + properties._privateIpGoogleAccess = 1; + if (typeof message.privateIpGoogleAccess !== "boolean") + return "privateIpGoogleAccess: boolean expected"; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + properties._privateIpv6GoogleAccess = 1; + switch (message.privateIpv6GoogleAccess) { + default: + return "privateIpv6GoogleAccess: enum value expected"; + case 0: + case 450958579: + case 427975994: + case 288210263: + break; + } + } + if (message.purpose != null && message.hasOwnProperty("purpose")) { + properties._purpose = 1; + switch (message.purpose) { + default: + return "purpose: enum value expected"; + case 0: + case 248748889: + case 403485027: + case 254902107: + break; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.role != null && message.hasOwnProperty("role")) { + properties._role = 1; + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 314733318: + case 341010882: + break; + } + } + if (message.secondaryIpRanges != null && message.hasOwnProperty("secondaryIpRanges")) { + if (!Array.isArray(message.secondaryIpRanges)) + return "secondaryIpRanges: array expected"; + for (var i = 0; i < message.secondaryIpRanges.length; ++i) { + var error = $root.google.cloud.compute.v1.SubnetworkSecondaryRange.verify(message.secondaryIpRanges[i]); + if (error) + return "secondaryIpRanges." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 480455402: + case 77848963: + break; + } + } + return null; + }; + + /** + * Creates a Subnetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Subnetwork} Subnetwork + */ + Subnetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Subnetwork) + return object; + var message = new $root.google.cloud.compute.v1.Subnetwork(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.enableFlowLogs != null) + message.enableFlowLogs = Boolean(object.enableFlowLogs); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.gatewayAddress != null) + message.gatewayAddress = String(object.gatewayAddress); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.ipv6CidrRange != null) + message.ipv6CidrRange = String(object.ipv6CidrRange); + if (object.kind != null) + message.kind = String(object.kind); + if (object.logConfig != null) { + if (typeof object.logConfig !== "object") + throw TypeError(".google.cloud.compute.v1.Subnetwork.logConfig: object expected"); + message.logConfig = $root.google.cloud.compute.v1.SubnetworkLogConfig.fromObject(object.logConfig); + } + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.privateIpGoogleAccess != null) + message.privateIpGoogleAccess = Boolean(object.privateIpGoogleAccess); + switch (object.privateIpv6GoogleAccess) { + case "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS": + case 0: + message.privateIpv6GoogleAccess = 0; + break; + case "DISABLE_GOOGLE_ACCESS": + case 450958579: + message.privateIpv6GoogleAccess = 450958579; + break; + case "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": + case 427975994: + message.privateIpv6GoogleAccess = 427975994; + break; + case "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": + case 288210263: + message.privateIpv6GoogleAccess = 288210263; + break; + } + switch (object.purpose) { + case "UNDEFINED_PURPOSE": + case 0: + message.purpose = 0; + break; + case "INTERNAL_HTTPS_LOAD_BALANCER": + case 248748889: + message.purpose = 248748889; + break; + case "PRIVATE": + case 403485027: + message.purpose = 403485027; + break; + case "PRIVATE_RFC_1918": + case 254902107: + message.purpose = 254902107; + break; + } + if (object.region != null) + message.region = String(object.region); + switch (object.role) { + case "UNDEFINED_ROLE": + case 0: + message.role = 0; + break; + case "ACTIVE": + case 314733318: + message.role = 314733318; + break; + case "BACKUP": + case 341010882: + message.role = 341010882; + break; + } + if (object.secondaryIpRanges) { + if (!Array.isArray(object.secondaryIpRanges)) + throw TypeError(".google.cloud.compute.v1.Subnetwork.secondaryIpRanges: array expected"); + message.secondaryIpRanges = []; + for (var i = 0; i < object.secondaryIpRanges.length; ++i) { + if (typeof object.secondaryIpRanges[i] !== "object") + throw TypeError(".google.cloud.compute.v1.Subnetwork.secondaryIpRanges: object expected"); + message.secondaryIpRanges[i] = $root.google.cloud.compute.v1.SubnetworkSecondaryRange.fromObject(object.secondaryIpRanges[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "DRAINING": + case 480455402: + message.state = 480455402; + break; + case "READY": + case 77848963: + message.state = 77848963; + break; + } + return message; + }; + + /** + * Creates a plain object from a Subnetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Subnetwork + * @static + * @param {google.cloud.compute.v1.Subnetwork} message Subnetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subnetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secondaryIpRanges = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.role != null && message.hasOwnProperty("role")) { + object.role = options.enums === String ? $root.google.cloud.compute.v1.Subnetwork.Role[message.role] : message.role; + if (options.oneofs) + object._role = "role"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; + if (options.oneofs) + object._privateIpv6GoogleAccess = "privateIpv6GoogleAccess"; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.Subnetwork.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + if (message.secondaryIpRanges && message.secondaryIpRanges.length) { + object.secondaryIpRanges = []; + for (var j = 0; j < message.secondaryIpRanges.length; ++j) + object.secondaryIpRanges[j] = $root.google.cloud.compute.v1.SubnetworkSecondaryRange.toObject(message.secondaryIpRanges[j], options); + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.enableFlowLogs != null && message.hasOwnProperty("enableFlowLogs")) { + object.enableFlowLogs = message.enableFlowLogs; + if (options.oneofs) + object._enableFlowLogs = "enableFlowLogs"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.ipv6CidrRange != null && message.hasOwnProperty("ipv6CidrRange")) { + object.ipv6CidrRange = message.ipv6CidrRange; + if (options.oneofs) + object._ipv6CidrRange = "ipv6CidrRange"; + } + if (message.purpose != null && message.hasOwnProperty("purpose")) { + object.purpose = options.enums === String ? $root.google.cloud.compute.v1.Subnetwork.Purpose[message.purpose] : message.purpose; + if (options.oneofs) + object._purpose = "purpose"; + } + if (message.logConfig != null && message.hasOwnProperty("logConfig")) { + object.logConfig = $root.google.cloud.compute.v1.SubnetworkLogConfig.toObject(message.logConfig, options); + if (options.oneofs) + object._logConfig = "logConfig"; + } + if (message.privateIpGoogleAccess != null && message.hasOwnProperty("privateIpGoogleAccess")) { + object.privateIpGoogleAccess = message.privateIpGoogleAccess; + if (options.oneofs) + object._privateIpGoogleAccess = "privateIpGoogleAccess"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.gatewayAddress != null && message.hasOwnProperty("gatewayAddress")) { + object.gatewayAddress = message.gatewayAddress; + if (options.oneofs) + object._gatewayAddress = "gatewayAddress"; + } + return object; + }; + + /** + * Converts this Subnetwork to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Subnetwork + * @instance + * @returns {Object.} JSON object + */ + Subnetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PrivateIpv6GoogleAccess enum. + * @name google.cloud.compute.v1.Subnetwork.PrivateIpv6GoogleAccess + * @enum {number} + * @property {number} UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS=0 UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS value + * @property {number} DISABLE_GOOGLE_ACCESS=450958579 DISABLE_GOOGLE_ACCESS value + * @property {number} ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE=427975994 ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE value + * @property {number} ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE=288210263 ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE value + */ + Subnetwork.PrivateIpv6GoogleAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS"] = 0; + values[valuesById[450958579] = "DISABLE_GOOGLE_ACCESS"] = 450958579; + values[valuesById[427975994] = "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"] = 427975994; + values[valuesById[288210263] = "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"] = 288210263; + return values; + })(); + + /** + * Purpose enum. + * @name google.cloud.compute.v1.Subnetwork.Purpose + * @enum {number} + * @property {number} UNDEFINED_PURPOSE=0 UNDEFINED_PURPOSE value + * @property {number} INTERNAL_HTTPS_LOAD_BALANCER=248748889 INTERNAL_HTTPS_LOAD_BALANCER value + * @property {number} PRIVATE=403485027 PRIVATE value + * @property {number} PRIVATE_RFC_1918=254902107 PRIVATE_RFC_1918 value + */ + Subnetwork.Purpose = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PURPOSE"] = 0; + values[valuesById[248748889] = "INTERNAL_HTTPS_LOAD_BALANCER"] = 248748889; + values[valuesById[403485027] = "PRIVATE"] = 403485027; + values[valuesById[254902107] = "PRIVATE_RFC_1918"] = 254902107; + return values; + })(); + + /** + * Role enum. + * @name google.cloud.compute.v1.Subnetwork.Role + * @enum {number} + * @property {number} UNDEFINED_ROLE=0 UNDEFINED_ROLE value + * @property {number} ACTIVE=314733318 ACTIVE value + * @property {number} BACKUP=341010882 BACKUP value + */ + Subnetwork.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_ROLE"] = 0; + values[valuesById[314733318] = "ACTIVE"] = 314733318; + values[valuesById[341010882] = "BACKUP"] = 341010882; + return values; + })(); + + /** + * State enum. + * @name google.cloud.compute.v1.Subnetwork.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} DRAINING=480455402 DRAINING value + * @property {number} READY=77848963 READY value + */ + Subnetwork.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[480455402] = "DRAINING"] = 480455402; + values[valuesById[77848963] = "READY"] = 77848963; + return values; + })(); + + return Subnetwork; + })(); + + v1.SubnetworksScopedList = (function() { + + /** + * Properties of a SubnetworksScopedList. + * @memberof google.cloud.compute.v1 + * @interface ISubnetworksScopedList + * @property {Array.|null} [subnetworks] SubnetworksScopedList subnetworks + * @property {google.cloud.compute.v1.IWarning|null} [warning] SubnetworksScopedList warning + */ + + /** + * Constructs a new SubnetworksScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SubnetworksScopedList. + * @implements ISubnetworksScopedList + * @constructor + * @param {google.cloud.compute.v1.ISubnetworksScopedList=} [properties] Properties to set + */ + function SubnetworksScopedList(properties) { + this.subnetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubnetworksScopedList subnetworks. + * @member {Array.} subnetworks + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @instance + */ + SubnetworksScopedList.prototype.subnetworks = $util.emptyArray; + + /** + * SubnetworksScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @instance + */ + SubnetworksScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubnetworksScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @instance + */ + Object.defineProperty(SubnetworksScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubnetworksScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {google.cloud.compute.v1.ISubnetworksScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SubnetworksScopedList} SubnetworksScopedList instance + */ + SubnetworksScopedList.create = function create(properties) { + return new SubnetworksScopedList(properties); + }; + + /** + * Encodes the specified SubnetworksScopedList message. Does not implicitly {@link google.cloud.compute.v1.SubnetworksScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {google.cloud.compute.v1.ISubnetworksScopedList} message SubnetworksScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworksScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.subnetworks != null && message.subnetworks.length) + for (var i = 0; i < message.subnetworks.length; ++i) + $root.google.cloud.compute.v1.Subnetwork.encode(message.subnetworks[i], writer.uint32(/* id 415853125, wireType 2 =*/3326825002).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubnetworksScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworksScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {google.cloud.compute.v1.ISubnetworksScopedList} message SubnetworksScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworksScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubnetworksScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SubnetworksScopedList} SubnetworksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworksScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SubnetworksScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 415853125: + if (!(message.subnetworks && message.subnetworks.length)) + message.subnetworks = []; + message.subnetworks.push($root.google.cloud.compute.v1.Subnetwork.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubnetworksScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SubnetworksScopedList} SubnetworksScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworksScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubnetworksScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubnetworksScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.subnetworks != null && message.hasOwnProperty("subnetworks")) { + if (!Array.isArray(message.subnetworks)) + return "subnetworks: array expected"; + for (var i = 0; i < message.subnetworks.length; ++i) { + var error = $root.google.cloud.compute.v1.Subnetwork.verify(message.subnetworks[i]); + if (error) + return "subnetworks." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SubnetworksScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SubnetworksScopedList} SubnetworksScopedList + */ + SubnetworksScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SubnetworksScopedList) + return object; + var message = new $root.google.cloud.compute.v1.SubnetworksScopedList(); + if (object.subnetworks) { + if (!Array.isArray(object.subnetworks)) + throw TypeError(".google.cloud.compute.v1.SubnetworksScopedList.subnetworks: array expected"); + message.subnetworks = []; + for (var i = 0; i < object.subnetworks.length; ++i) { + if (typeof object.subnetworks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SubnetworksScopedList.subnetworks: object expected"); + message.subnetworks[i] = $root.google.cloud.compute.v1.Subnetwork.fromObject(object.subnetworks[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SubnetworksScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SubnetworksScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @static + * @param {google.cloud.compute.v1.SubnetworksScopedList} message SubnetworksScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubnetworksScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subnetworks = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.subnetworks && message.subnetworks.length) { + object.subnetworks = []; + for (var j = 0; j < message.subnetworks.length; ++j) + object.subnetworks[j] = $root.google.cloud.compute.v1.Subnetwork.toObject(message.subnetworks[j], options); + } + return object; + }; + + /** + * Converts this SubnetworksScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SubnetworksScopedList + * @instance + * @returns {Object.} JSON object + */ + SubnetworksScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubnetworksScopedList; + })(); + + v1.SubnetworkAggregatedList = (function() { + + /** + * Properties of a SubnetworkAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ISubnetworkAggregatedList + * @property {string|null} [id] SubnetworkAggregatedList id + * @property {Object.|null} [items] SubnetworkAggregatedList items + * @property {string|null} [kind] SubnetworkAggregatedList kind + * @property {string|null} [nextPageToken] SubnetworkAggregatedList nextPageToken + * @property {string|null} [selfLink] SubnetworkAggregatedList selfLink + * @property {Array.|null} [unreachables] SubnetworkAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] SubnetworkAggregatedList warning + */ + + /** + * Constructs a new SubnetworkAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SubnetworkAggregatedList. + * @implements ISubnetworkAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ISubnetworkAggregatedList=} [properties] Properties to set + */ + function SubnetworkAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubnetworkAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + SubnetworkAggregatedList.prototype.id = null; + + /** + * SubnetworkAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + SubnetworkAggregatedList.prototype.items = $util.emptyObject; + + /** + * SubnetworkAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + SubnetworkAggregatedList.prototype.kind = null; + + /** + * SubnetworkAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + SubnetworkAggregatedList.prototype.nextPageToken = null; + + /** + * SubnetworkAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + SubnetworkAggregatedList.prototype.selfLink = null; + + /** + * SubnetworkAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + SubnetworkAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * SubnetworkAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + SubnetworkAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubnetworkAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + Object.defineProperty(SubnetworkAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + Object.defineProperty(SubnetworkAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + Object.defineProperty(SubnetworkAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + Object.defineProperty(SubnetworkAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + */ + Object.defineProperty(SubnetworkAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubnetworkAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {google.cloud.compute.v1.ISubnetworkAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SubnetworkAggregatedList} SubnetworkAggregatedList instance + */ + SubnetworkAggregatedList.create = function create(properties) { + return new SubnetworkAggregatedList(properties); + }; + + /** + * Encodes the specified SubnetworkAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {google.cloud.compute.v1.ISubnetworkAggregatedList} message SubnetworkAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.SubnetworksScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified SubnetworkAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {google.cloud.compute.v1.ISubnetworkAggregatedList} message SubnetworkAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubnetworkAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SubnetworkAggregatedList} SubnetworkAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SubnetworkAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.SubnetworksScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubnetworkAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SubnetworkAggregatedList} SubnetworkAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubnetworkAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubnetworkAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.SubnetworksScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SubnetworkAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SubnetworkAggregatedList} SubnetworkAggregatedList + */ + SubnetworkAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SubnetworkAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.SubnetworkAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.SubnetworkAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.SubnetworkAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.SubnetworksScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.SubnetworkAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SubnetworkAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SubnetworkAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @static + * @param {google.cloud.compute.v1.SubnetworkAggregatedList} message SubnetworkAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubnetworkAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.SubnetworksScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this SubnetworkAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SubnetworkAggregatedList + * @instance + * @returns {Object.} JSON object + */ + SubnetworkAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubnetworkAggregatedList; + })(); + + v1.SubnetworkList = (function() { + + /** + * Properties of a SubnetworkList. + * @memberof google.cloud.compute.v1 + * @interface ISubnetworkList + * @property {string|null} [id] SubnetworkList id + * @property {Array.|null} [items] SubnetworkList items + * @property {string|null} [kind] SubnetworkList kind + * @property {string|null} [nextPageToken] SubnetworkList nextPageToken + * @property {string|null} [selfLink] SubnetworkList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] SubnetworkList warning + */ + + /** + * Constructs a new SubnetworkList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SubnetworkList. + * @implements ISubnetworkList + * @constructor + * @param {google.cloud.compute.v1.ISubnetworkList=} [properties] Properties to set + */ + function SubnetworkList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubnetworkList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + SubnetworkList.prototype.id = null; + + /** + * SubnetworkList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + SubnetworkList.prototype.items = $util.emptyArray; + + /** + * SubnetworkList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + SubnetworkList.prototype.kind = null; + + /** + * SubnetworkList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + SubnetworkList.prototype.nextPageToken = null; + + /** + * SubnetworkList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + SubnetworkList.prototype.selfLink = null; + + /** + * SubnetworkList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + SubnetworkList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubnetworkList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + Object.defineProperty(SubnetworkList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + Object.defineProperty(SubnetworkList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + Object.defineProperty(SubnetworkList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + Object.defineProperty(SubnetworkList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SubnetworkList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + */ + Object.defineProperty(SubnetworkList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubnetworkList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {google.cloud.compute.v1.ISubnetworkList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SubnetworkList} SubnetworkList instance + */ + SubnetworkList.create = function create(properties) { + return new SubnetworkList(properties); + }; + + /** + * Encodes the specified SubnetworkList message. Does not implicitly {@link google.cloud.compute.v1.SubnetworkList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {google.cloud.compute.v1.ISubnetworkList} message SubnetworkList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Subnetwork.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified SubnetworkList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworkList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {google.cloud.compute.v1.ISubnetworkList} message SubnetworkList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworkList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubnetworkList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SubnetworkList} SubnetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SubnetworkList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Subnetwork.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubnetworkList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SubnetworkList} SubnetworkList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworkList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubnetworkList message. + * @function verify + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubnetworkList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Subnetwork.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a SubnetworkList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SubnetworkList} SubnetworkList + */ + SubnetworkList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SubnetworkList) + return object; + var message = new $root.google.cloud.compute.v1.SubnetworkList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.SubnetworkList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.SubnetworkList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Subnetwork.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.SubnetworkList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a SubnetworkList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SubnetworkList + * @static + * @param {google.cloud.compute.v1.SubnetworkList} message SubnetworkList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubnetworkList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Subnetwork.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this SubnetworkList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SubnetworkList + * @instance + * @returns {Object.} JSON object + */ + SubnetworkList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubnetworkList; + })(); + + v1.SubnetworksExpandIpCidrRangeRequest = (function() { + + /** + * Properties of a SubnetworksExpandIpCidrRangeRequest. + * @memberof google.cloud.compute.v1 + * @interface ISubnetworksExpandIpCidrRangeRequest + * @property {string|null} [ipCidrRange] SubnetworksExpandIpCidrRangeRequest ipCidrRange + */ + + /** + * Constructs a new SubnetworksExpandIpCidrRangeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SubnetworksExpandIpCidrRangeRequest. + * @implements ISubnetworksExpandIpCidrRangeRequest + * @constructor + * @param {google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest=} [properties] Properties to set + */ + function SubnetworksExpandIpCidrRangeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubnetworksExpandIpCidrRangeRequest ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @instance + */ + SubnetworksExpandIpCidrRangeRequest.prototype.ipCidrRange = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubnetworksExpandIpCidrRangeRequest _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @instance + */ + Object.defineProperty(SubnetworksExpandIpCidrRangeRequest.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubnetworksExpandIpCidrRangeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest} SubnetworksExpandIpCidrRangeRequest instance + */ + SubnetworksExpandIpCidrRangeRequest.create = function create(properties) { + return new SubnetworksExpandIpCidrRangeRequest(properties); + }; + + /** + * Encodes the specified SubnetworksExpandIpCidrRangeRequest message. Does not implicitly {@link google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest} message SubnetworksExpandIpCidrRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworksExpandIpCidrRangeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + return writer; + }; + + /** + * Encodes the specified SubnetworksExpandIpCidrRangeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest} message SubnetworksExpandIpCidrRangeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworksExpandIpCidrRangeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubnetworksExpandIpCidrRangeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest} SubnetworksExpandIpCidrRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworksExpandIpCidrRangeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 98117322: + message.ipCidrRange = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubnetworksExpandIpCidrRangeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest} SubnetworksExpandIpCidrRangeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworksExpandIpCidrRangeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubnetworksExpandIpCidrRangeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubnetworksExpandIpCidrRangeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + return null; + }; + + /** + * Creates a SubnetworksExpandIpCidrRangeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest} SubnetworksExpandIpCidrRangeRequest + */ + SubnetworksExpandIpCidrRangeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest) + return object; + var message = new $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + return message; + }; + + /** + * Creates a plain object from a SubnetworksExpandIpCidrRangeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @static + * @param {google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest} message SubnetworksExpandIpCidrRangeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubnetworksExpandIpCidrRangeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + return object; + }; + + /** + * Converts this SubnetworksExpandIpCidrRangeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest + * @instance + * @returns {Object.} JSON object + */ + SubnetworksExpandIpCidrRangeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubnetworksExpandIpCidrRangeRequest; + })(); + + v1.SubnetworksSetPrivateIpGoogleAccessRequest = (function() { + + /** + * Properties of a SubnetworksSetPrivateIpGoogleAccessRequest. + * @memberof google.cloud.compute.v1 + * @interface ISubnetworksSetPrivateIpGoogleAccessRequest + * @property {boolean|null} [privateIpGoogleAccess] SubnetworksSetPrivateIpGoogleAccessRequest privateIpGoogleAccess + */ + + /** + * Constructs a new SubnetworksSetPrivateIpGoogleAccessRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SubnetworksSetPrivateIpGoogleAccessRequest. + * @implements ISubnetworksSetPrivateIpGoogleAccessRequest + * @constructor + * @param {google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest=} [properties] Properties to set + */ + function SubnetworksSetPrivateIpGoogleAccessRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubnetworksSetPrivateIpGoogleAccessRequest privateIpGoogleAccess. + * @member {boolean|null|undefined} privateIpGoogleAccess + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @instance + */ + SubnetworksSetPrivateIpGoogleAccessRequest.prototype.privateIpGoogleAccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SubnetworksSetPrivateIpGoogleAccessRequest _privateIpGoogleAccess. + * @member {"privateIpGoogleAccess"|undefined} _privateIpGoogleAccess + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @instance + */ + Object.defineProperty(SubnetworksSetPrivateIpGoogleAccessRequest.prototype, "_privateIpGoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpGoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SubnetworksSetPrivateIpGoogleAccessRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest} SubnetworksSetPrivateIpGoogleAccessRequest instance + */ + SubnetworksSetPrivateIpGoogleAccessRequest.create = function create(properties) { + return new SubnetworksSetPrivateIpGoogleAccessRequest(properties); + }; + + /** + * Encodes the specified SubnetworksSetPrivateIpGoogleAccessRequest message. Does not implicitly {@link google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest} message SubnetworksSetPrivateIpGoogleAccessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworksSetPrivateIpGoogleAccessRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateIpGoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpGoogleAccess")) + writer.uint32(/* id 421491790, wireType 0 =*/3371934320).bool(message.privateIpGoogleAccess); + return writer; + }; + + /** + * Encodes the specified SubnetworksSetPrivateIpGoogleAccessRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest} message SubnetworksSetPrivateIpGoogleAccessRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubnetworksSetPrivateIpGoogleAccessRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubnetworksSetPrivateIpGoogleAccessRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest} SubnetworksSetPrivateIpGoogleAccessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworksSetPrivateIpGoogleAccessRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 421491790: + message.privateIpGoogleAccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubnetworksSetPrivateIpGoogleAccessRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest} SubnetworksSetPrivateIpGoogleAccessRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubnetworksSetPrivateIpGoogleAccessRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubnetworksSetPrivateIpGoogleAccessRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubnetworksSetPrivateIpGoogleAccessRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.privateIpGoogleAccess != null && message.hasOwnProperty("privateIpGoogleAccess")) { + properties._privateIpGoogleAccess = 1; + if (typeof message.privateIpGoogleAccess !== "boolean") + return "privateIpGoogleAccess: boolean expected"; + } + return null; + }; + + /** + * Creates a SubnetworksSetPrivateIpGoogleAccessRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest} SubnetworksSetPrivateIpGoogleAccessRequest + */ + SubnetworksSetPrivateIpGoogleAccessRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest) + return object; + var message = new $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest(); + if (object.privateIpGoogleAccess != null) + message.privateIpGoogleAccess = Boolean(object.privateIpGoogleAccess); + return message; + }; + + /** + * Creates a plain object from a SubnetworksSetPrivateIpGoogleAccessRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @static + * @param {google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest} message SubnetworksSetPrivateIpGoogleAccessRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubnetworksSetPrivateIpGoogleAccessRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.privateIpGoogleAccess != null && message.hasOwnProperty("privateIpGoogleAccess")) { + object.privateIpGoogleAccess = message.privateIpGoogleAccess; + if (options.oneofs) + object._privateIpGoogleAccess = "privateIpGoogleAccess"; + } + return object; + }; + + /** + * Converts this SubnetworksSetPrivateIpGoogleAccessRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest + * @instance + * @returns {Object.} JSON object + */ + SubnetworksSetPrivateIpGoogleAccessRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubnetworksSetPrivateIpGoogleAccessRequest; + })(); + + v1.TargetGrpcProxy = (function() { + + /** + * Properties of a TargetGrpcProxy. + * @memberof google.cloud.compute.v1 + * @interface ITargetGrpcProxy + * @property {string|null} [creationTimestamp] TargetGrpcProxy creationTimestamp + * @property {string|null} [description] TargetGrpcProxy description + * @property {string|null} [fingerprint] TargetGrpcProxy fingerprint + * @property {number|Long|null} [id] TargetGrpcProxy id + * @property {string|null} [kind] TargetGrpcProxy kind + * @property {string|null} [name] TargetGrpcProxy name + * @property {string|null} [selfLink] TargetGrpcProxy selfLink + * @property {string|null} [selfLinkWithId] TargetGrpcProxy selfLinkWithId + * @property {string|null} [urlMap] TargetGrpcProxy urlMap + * @property {boolean|null} [validateForProxyless] TargetGrpcProxy validateForProxyless + */ + + /** + * Constructs a new TargetGrpcProxy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetGrpcProxy. + * @implements ITargetGrpcProxy + * @constructor + * @param {google.cloud.compute.v1.ITargetGrpcProxy=} [properties] Properties to set + */ + function TargetGrpcProxy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetGrpcProxy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.creationTimestamp = null; + + /** + * TargetGrpcProxy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.description = null; + + /** + * TargetGrpcProxy fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.fingerprint = null; + + /** + * TargetGrpcProxy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.id = null; + + /** + * TargetGrpcProxy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.kind = null; + + /** + * TargetGrpcProxy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.name = null; + + /** + * TargetGrpcProxy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.selfLink = null; + + /** + * TargetGrpcProxy selfLinkWithId. + * @member {string|null|undefined} selfLinkWithId + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.selfLinkWithId = null; + + /** + * TargetGrpcProxy urlMap. + * @member {string|null|undefined} urlMap + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.urlMap = null; + + /** + * TargetGrpcProxy validateForProxyless. + * @member {boolean|null|undefined} validateForProxyless + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + TargetGrpcProxy.prototype.validateForProxyless = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetGrpcProxy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _selfLinkWithId. + * @member {"selfLinkWithId"|undefined} _selfLinkWithId + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_selfLinkWithId", { + get: $util.oneOfGetter($oneOfFields = ["selfLinkWithId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _urlMap. + * @member {"urlMap"|undefined} _urlMap + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_urlMap", { + get: $util.oneOfGetter($oneOfFields = ["urlMap"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxy _validateForProxyless. + * @member {"validateForProxyless"|undefined} _validateForProxyless + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + */ + Object.defineProperty(TargetGrpcProxy.prototype, "_validateForProxyless", { + get: $util.oneOfGetter($oneOfFields = ["validateForProxyless"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetGrpcProxy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {google.cloud.compute.v1.ITargetGrpcProxy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetGrpcProxy} TargetGrpcProxy instance + */ + TargetGrpcProxy.create = function create(properties) { + return new TargetGrpcProxy(properties); + }; + + /** + * Encodes the specified TargetGrpcProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {google.cloud.compute.v1.ITargetGrpcProxy} message TargetGrpcProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetGrpcProxy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.selfLinkWithId != null && Object.hasOwnProperty.call(message, "selfLinkWithId")) + writer.uint32(/* id 44520962, wireType 2 =*/356167698).string(message.selfLinkWithId); + if (message.validateForProxyless != null && Object.hasOwnProperty.call(message, "validateForProxyless")) + writer.uint32(/* id 101822888, wireType 0 =*/814583104).bool(message.validateForProxyless); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetGrpcProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {google.cloud.compute.v1.ITargetGrpcProxy} message TargetGrpcProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetGrpcProxy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetGrpcProxy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetGrpcProxy} TargetGrpcProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetGrpcProxy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetGrpcProxy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 44520962: + message.selfLinkWithId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + case 101822888: + message.validateForProxyless = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetGrpcProxy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetGrpcProxy} TargetGrpcProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetGrpcProxy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetGrpcProxy message. + * @function verify + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetGrpcProxy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.selfLinkWithId != null && message.hasOwnProperty("selfLinkWithId")) { + properties._selfLinkWithId = 1; + if (!$util.isString(message.selfLinkWithId)) + return "selfLinkWithId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + properties._urlMap = 1; + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + } + if (message.validateForProxyless != null && message.hasOwnProperty("validateForProxyless")) { + properties._validateForProxyless = 1; + if (typeof message.validateForProxyless !== "boolean") + return "validateForProxyless: boolean expected"; + } + return null; + }; + + /** + * Creates a TargetGrpcProxy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetGrpcProxy} TargetGrpcProxy + */ + TargetGrpcProxy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetGrpcProxy) + return object; + var message = new $root.google.cloud.compute.v1.TargetGrpcProxy(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.selfLinkWithId != null) + message.selfLinkWithId = String(object.selfLinkWithId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + if (object.validateForProxyless != null) + message.validateForProxyless = Boolean(object.validateForProxyless); + return message; + }; + + /** + * Creates a plain object from a TargetGrpcProxy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @static + * @param {google.cloud.compute.v1.TargetGrpcProxy} message TargetGrpcProxy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetGrpcProxy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.selfLinkWithId != null && message.hasOwnProperty("selfLinkWithId")) { + object.selfLinkWithId = message.selfLinkWithId; + if (options.oneofs) + object._selfLinkWithId = "selfLinkWithId"; + } + if (message.validateForProxyless != null && message.hasOwnProperty("validateForProxyless")) { + object.validateForProxyless = message.validateForProxyless; + if (options.oneofs) + object._validateForProxyless = "validateForProxyless"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + object.urlMap = message.urlMap; + if (options.oneofs) + object._urlMap = "urlMap"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetGrpcProxy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetGrpcProxy + * @instance + * @returns {Object.} JSON object + */ + TargetGrpcProxy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetGrpcProxy; + })(); + + v1.TargetGrpcProxyList = (function() { + + /** + * Properties of a TargetGrpcProxyList. + * @memberof google.cloud.compute.v1 + * @interface ITargetGrpcProxyList + * @property {string|null} [id] TargetGrpcProxyList id + * @property {Array.|null} [items] TargetGrpcProxyList items + * @property {string|null} [kind] TargetGrpcProxyList kind + * @property {string|null} [nextPageToken] TargetGrpcProxyList nextPageToken + * @property {string|null} [selfLink] TargetGrpcProxyList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetGrpcProxyList warning + */ + + /** + * Constructs a new TargetGrpcProxyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetGrpcProxyList. + * @implements ITargetGrpcProxyList + * @constructor + * @param {google.cloud.compute.v1.ITargetGrpcProxyList=} [properties] Properties to set + */ + function TargetGrpcProxyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetGrpcProxyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + TargetGrpcProxyList.prototype.id = null; + + /** + * TargetGrpcProxyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + TargetGrpcProxyList.prototype.items = $util.emptyArray; + + /** + * TargetGrpcProxyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + TargetGrpcProxyList.prototype.kind = null; + + /** + * TargetGrpcProxyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + TargetGrpcProxyList.prototype.nextPageToken = null; + + /** + * TargetGrpcProxyList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + TargetGrpcProxyList.prototype.selfLink = null; + + /** + * TargetGrpcProxyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + TargetGrpcProxyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetGrpcProxyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + Object.defineProperty(TargetGrpcProxyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + Object.defineProperty(TargetGrpcProxyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + Object.defineProperty(TargetGrpcProxyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxyList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + Object.defineProperty(TargetGrpcProxyList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetGrpcProxyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + */ + Object.defineProperty(TargetGrpcProxyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetGrpcProxyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {google.cloud.compute.v1.ITargetGrpcProxyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetGrpcProxyList} TargetGrpcProxyList instance + */ + TargetGrpcProxyList.create = function create(properties) { + return new TargetGrpcProxyList(properties); + }; + + /** + * Encodes the specified TargetGrpcProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {google.cloud.compute.v1.ITargetGrpcProxyList} message TargetGrpcProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetGrpcProxyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetGrpcProxy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetGrpcProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetGrpcProxyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {google.cloud.compute.v1.ITargetGrpcProxyList} message TargetGrpcProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetGrpcProxyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetGrpcProxyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetGrpcProxyList} TargetGrpcProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetGrpcProxyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetGrpcProxyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetGrpcProxy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetGrpcProxyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetGrpcProxyList} TargetGrpcProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetGrpcProxyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetGrpcProxyList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetGrpcProxyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetGrpcProxy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetGrpcProxyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetGrpcProxyList} TargetGrpcProxyList + */ + TargetGrpcProxyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetGrpcProxyList) + return object; + var message = new $root.google.cloud.compute.v1.TargetGrpcProxyList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetGrpcProxyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetGrpcProxyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetGrpcProxy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetGrpcProxyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetGrpcProxyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @static + * @param {google.cloud.compute.v1.TargetGrpcProxyList} message TargetGrpcProxyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetGrpcProxyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetGrpcProxy.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetGrpcProxyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetGrpcProxyList + * @instance + * @returns {Object.} JSON object + */ + TargetGrpcProxyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetGrpcProxyList; + })(); + + v1.TargetHttpProxy = (function() { + + /** + * Properties of a TargetHttpProxy. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpProxy + * @property {string|null} [creationTimestamp] TargetHttpProxy creationTimestamp + * @property {string|null} [description] TargetHttpProxy description + * @property {string|null} [fingerprint] TargetHttpProxy fingerprint + * @property {number|Long|null} [id] TargetHttpProxy id + * @property {string|null} [kind] TargetHttpProxy kind + * @property {string|null} [name] TargetHttpProxy name + * @property {boolean|null} [proxyBind] TargetHttpProxy proxyBind + * @property {string|null} [region] TargetHttpProxy region + * @property {string|null} [selfLink] TargetHttpProxy selfLink + * @property {string|null} [urlMap] TargetHttpProxy urlMap + */ + + /** + * Constructs a new TargetHttpProxy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpProxy. + * @implements ITargetHttpProxy + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpProxy=} [properties] Properties to set + */ + function TargetHttpProxy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpProxy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.creationTimestamp = null; + + /** + * TargetHttpProxy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.description = null; + + /** + * TargetHttpProxy fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.fingerprint = null; + + /** + * TargetHttpProxy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.id = null; + + /** + * TargetHttpProxy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.kind = null; + + /** + * TargetHttpProxy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.name = null; + + /** + * TargetHttpProxy proxyBind. + * @member {boolean|null|undefined} proxyBind + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.proxyBind = null; + + /** + * TargetHttpProxy region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.region = null; + + /** + * TargetHttpProxy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.selfLink = null; + + /** + * TargetHttpProxy urlMap. + * @member {string|null|undefined} urlMap + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + TargetHttpProxy.prototype.urlMap = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpProxy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _proxyBind. + * @member {"proxyBind"|undefined} _proxyBind + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_proxyBind", { + get: $util.oneOfGetter($oneOfFields = ["proxyBind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxy _urlMap. + * @member {"urlMap"|undefined} _urlMap + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + */ + Object.defineProperty(TargetHttpProxy.prototype, "_urlMap", { + get: $util.oneOfGetter($oneOfFields = ["urlMap"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpProxy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpProxy} TargetHttpProxy instance + */ + TargetHttpProxy.create = function create(properties) { + return new TargetHttpProxy(properties); + }; + + /** + * Encodes the specified TargetHttpProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxy} message TargetHttpProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.proxyBind != null && Object.hasOwnProperty.call(message, "proxyBind")) + writer.uint32(/* id 286025582, wireType 0 =*/2288204656).bool(message.proxyBind); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetHttpProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxy} message TargetHttpProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpProxy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpProxy} TargetHttpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpProxy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 286025582: + message.proxyBind = reader.bool(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpProxy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpProxy} TargetHttpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpProxy message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpProxy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.proxyBind != null && message.hasOwnProperty("proxyBind")) { + properties._proxyBind = 1; + if (typeof message.proxyBind !== "boolean") + return "proxyBind: boolean expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + properties._urlMap = 1; + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + } + return null; + }; + + /** + * Creates a TargetHttpProxy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpProxy} TargetHttpProxy + */ + TargetHttpProxy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpProxy) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpProxy(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.proxyBind != null) + message.proxyBind = Boolean(object.proxyBind); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from a TargetHttpProxy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @static + * @param {google.cloud.compute.v1.TargetHttpProxy} message TargetHttpProxy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpProxy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.proxyBind != null && message.hasOwnProperty("proxyBind")) { + object.proxyBind = message.proxyBind; + if (options.oneofs) + object._proxyBind = "proxyBind"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + object.urlMap = message.urlMap; + if (options.oneofs) + object._urlMap = "urlMap"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetHttpProxy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpProxy + * @instance + * @returns {Object.} JSON object + */ + TargetHttpProxy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpProxy; + })(); + + v1.TargetHttpProxiesScopedList = (function() { + + /** + * Properties of a TargetHttpProxiesScopedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpProxiesScopedList + * @property {Array.|null} [targetHttpProxies] TargetHttpProxiesScopedList targetHttpProxies + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetHttpProxiesScopedList warning + */ + + /** + * Constructs a new TargetHttpProxiesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpProxiesScopedList. + * @implements ITargetHttpProxiesScopedList + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpProxiesScopedList=} [properties] Properties to set + */ + function TargetHttpProxiesScopedList(properties) { + this.targetHttpProxies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpProxiesScopedList targetHttpProxies. + * @member {Array.} targetHttpProxies + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @instance + */ + TargetHttpProxiesScopedList.prototype.targetHttpProxies = $util.emptyArray; + + /** + * TargetHttpProxiesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @instance + */ + TargetHttpProxiesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpProxiesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @instance + */ + Object.defineProperty(TargetHttpProxiesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpProxiesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxiesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpProxiesScopedList} TargetHttpProxiesScopedList instance + */ + TargetHttpProxiesScopedList.create = function create(properties) { + return new TargetHttpProxiesScopedList(properties); + }; + + /** + * Encodes the specified TargetHttpProxiesScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxiesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxiesScopedList} message TargetHttpProxiesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxiesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.targetHttpProxies != null && message.targetHttpProxies.length) + for (var i = 0; i < message.targetHttpProxies.length; ++i) + $root.google.cloud.compute.v1.TargetHttpProxy.encode(message.targetHttpProxies[i], writer.uint32(/* id 162147011, wireType 2 =*/1297176090).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetHttpProxiesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxiesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxiesScopedList} message TargetHttpProxiesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxiesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpProxiesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpProxiesScopedList} TargetHttpProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxiesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpProxiesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 162147011: + if (!(message.targetHttpProxies && message.targetHttpProxies.length)) + message.targetHttpProxies = []; + message.targetHttpProxies.push($root.google.cloud.compute.v1.TargetHttpProxy.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpProxiesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpProxiesScopedList} TargetHttpProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxiesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpProxiesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpProxiesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetHttpProxies != null && message.hasOwnProperty("targetHttpProxies")) { + if (!Array.isArray(message.targetHttpProxies)) + return "targetHttpProxies: array expected"; + for (var i = 0; i < message.targetHttpProxies.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetHttpProxy.verify(message.targetHttpProxies[i]); + if (error) + return "targetHttpProxies." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetHttpProxiesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpProxiesScopedList} TargetHttpProxiesScopedList + */ + TargetHttpProxiesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpProxiesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpProxiesScopedList(); + if (object.targetHttpProxies) { + if (!Array.isArray(object.targetHttpProxies)) + throw TypeError(".google.cloud.compute.v1.TargetHttpProxiesScopedList.targetHttpProxies: array expected"); + message.targetHttpProxies = []; + for (var i = 0; i < object.targetHttpProxies.length; ++i) { + if (typeof object.targetHttpProxies[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpProxiesScopedList.targetHttpProxies: object expected"); + message.targetHttpProxies[i] = $root.google.cloud.compute.v1.TargetHttpProxy.fromObject(object.targetHttpProxies[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpProxiesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpProxiesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @static + * @param {google.cloud.compute.v1.TargetHttpProxiesScopedList} message TargetHttpProxiesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpProxiesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetHttpProxies = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.targetHttpProxies && message.targetHttpProxies.length) { + object.targetHttpProxies = []; + for (var j = 0; j < message.targetHttpProxies.length; ++j) + object.targetHttpProxies[j] = $root.google.cloud.compute.v1.TargetHttpProxy.toObject(message.targetHttpProxies[j], options); + } + return object; + }; + + /** + * Converts this TargetHttpProxiesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpProxiesScopedList + * @instance + * @returns {Object.} JSON object + */ + TargetHttpProxiesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpProxiesScopedList; + })(); + + v1.TargetHttpProxyAggregatedList = (function() { + + /** + * Properties of a TargetHttpProxyAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpProxyAggregatedList + * @property {string|null} [id] TargetHttpProxyAggregatedList id + * @property {Object.|null} [items] TargetHttpProxyAggregatedList items + * @property {string|null} [kind] TargetHttpProxyAggregatedList kind + * @property {string|null} [nextPageToken] TargetHttpProxyAggregatedList nextPageToken + * @property {string|null} [selfLink] TargetHttpProxyAggregatedList selfLink + * @property {Array.|null} [unreachables] TargetHttpProxyAggregatedList unreachables + */ + + /** + * Constructs a new TargetHttpProxyAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpProxyAggregatedList. + * @implements ITargetHttpProxyAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpProxyAggregatedList=} [properties] Properties to set + */ + function TargetHttpProxyAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpProxyAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + TargetHttpProxyAggregatedList.prototype.id = null; + + /** + * TargetHttpProxyAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + TargetHttpProxyAggregatedList.prototype.items = $util.emptyObject; + + /** + * TargetHttpProxyAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + TargetHttpProxyAggregatedList.prototype.kind = null; + + /** + * TargetHttpProxyAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + TargetHttpProxyAggregatedList.prototype.nextPageToken = null; + + /** + * TargetHttpProxyAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + TargetHttpProxyAggregatedList.prototype.selfLink = null; + + /** + * TargetHttpProxyAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + TargetHttpProxyAggregatedList.prototype.unreachables = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpProxyAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpProxyAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxyAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpProxyAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxyAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpProxyAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxyAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpProxyAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpProxyAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxyAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpProxyAggregatedList} TargetHttpProxyAggregatedList instance + */ + TargetHttpProxyAggregatedList.create = function create(properties) { + return new TargetHttpProxyAggregatedList(properties); + }; + + /** + * Encodes the specified TargetHttpProxyAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxyAggregatedList} message TargetHttpProxyAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxyAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.TargetHttpProxiesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetHttpProxyAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxyAggregatedList} message TargetHttpProxyAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxyAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpProxyAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpProxyAggregatedList} TargetHttpProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxyAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpProxyAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.TargetHttpProxiesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpProxyAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpProxyAggregatedList} TargetHttpProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxyAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpProxyAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpProxyAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetHttpProxiesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + return null; + }; + + /** + * Creates a TargetHttpProxyAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpProxyAggregatedList} TargetHttpProxyAggregatedList + */ + TargetHttpProxyAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpProxyAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpProxyAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpProxyAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpProxyAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.TargetHttpProxiesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.TargetHttpProxyAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpProxyAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.TargetHttpProxyAggregatedList} message TargetHttpProxyAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpProxyAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.TargetHttpProxiesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetHttpProxyAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpProxyAggregatedList + * @instance + * @returns {Object.} JSON object + */ + TargetHttpProxyAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpProxyAggregatedList; + })(); + + v1.TargetHttpProxyList = (function() { + + /** + * Properties of a TargetHttpProxyList. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpProxyList + * @property {string|null} [id] TargetHttpProxyList id + * @property {Array.|null} [items] TargetHttpProxyList items + * @property {string|null} [kind] TargetHttpProxyList kind + * @property {string|null} [nextPageToken] TargetHttpProxyList nextPageToken + * @property {string|null} [selfLink] TargetHttpProxyList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetHttpProxyList warning + */ + + /** + * Constructs a new TargetHttpProxyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpProxyList. + * @implements ITargetHttpProxyList + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpProxyList=} [properties] Properties to set + */ + function TargetHttpProxyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpProxyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + TargetHttpProxyList.prototype.id = null; + + /** + * TargetHttpProxyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + TargetHttpProxyList.prototype.items = $util.emptyArray; + + /** + * TargetHttpProxyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + TargetHttpProxyList.prototype.kind = null; + + /** + * TargetHttpProxyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + TargetHttpProxyList.prototype.nextPageToken = null; + + /** + * TargetHttpProxyList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + TargetHttpProxyList.prototype.selfLink = null; + + /** + * TargetHttpProxyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + TargetHttpProxyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpProxyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + Object.defineProperty(TargetHttpProxyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + Object.defineProperty(TargetHttpProxyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + Object.defineProperty(TargetHttpProxyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxyList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + Object.defineProperty(TargetHttpProxyList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpProxyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + */ + Object.defineProperty(TargetHttpProxyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpProxyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpProxyList} TargetHttpProxyList instance + */ + TargetHttpProxyList.create = function create(properties) { + return new TargetHttpProxyList(properties); + }; + + /** + * Encodes the specified TargetHttpProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxyList} message TargetHttpProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetHttpProxy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetHttpProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpProxyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {google.cloud.compute.v1.ITargetHttpProxyList} message TargetHttpProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpProxyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpProxyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpProxyList} TargetHttpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpProxyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetHttpProxy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpProxyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpProxyList} TargetHttpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpProxyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpProxyList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpProxyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetHttpProxy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetHttpProxyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpProxyList} TargetHttpProxyList + */ + TargetHttpProxyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpProxyList) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpProxyList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetHttpProxyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpProxyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetHttpProxy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpProxyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpProxyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @static + * @param {google.cloud.compute.v1.TargetHttpProxyList} message TargetHttpProxyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpProxyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetHttpProxy.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetHttpProxyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpProxyList + * @instance + * @returns {Object.} JSON object + */ + TargetHttpProxyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpProxyList; + })(); + + v1.TargetHttpsProxy = (function() { + + /** + * Properties of a TargetHttpsProxy. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpsProxy + * @property {string|null} [authorizationPolicy] TargetHttpsProxy authorizationPolicy + * @property {string|null} [creationTimestamp] TargetHttpsProxy creationTimestamp + * @property {string|null} [description] TargetHttpsProxy description + * @property {string|null} [fingerprint] TargetHttpsProxy fingerprint + * @property {number|Long|null} [id] TargetHttpsProxy id + * @property {string|null} [kind] TargetHttpsProxy kind + * @property {string|null} [name] TargetHttpsProxy name + * @property {boolean|null} [proxyBind] TargetHttpsProxy proxyBind + * @property {google.cloud.compute.v1.TargetHttpsProxy.QuicOverride|null} [quicOverride] TargetHttpsProxy quicOverride + * @property {string|null} [region] TargetHttpsProxy region + * @property {string|null} [selfLink] TargetHttpsProxy selfLink + * @property {string|null} [serverTlsPolicy] TargetHttpsProxy serverTlsPolicy + * @property {Array.|null} [sslCertificates] TargetHttpsProxy sslCertificates + * @property {string|null} [sslPolicy] TargetHttpsProxy sslPolicy + * @property {string|null} [urlMap] TargetHttpsProxy urlMap + */ + + /** + * Constructs a new TargetHttpsProxy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpsProxy. + * @implements ITargetHttpsProxy + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpsProxy=} [properties] Properties to set + */ + function TargetHttpsProxy(properties) { + this.sslCertificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpsProxy authorizationPolicy. + * @member {string|null|undefined} authorizationPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.authorizationPolicy = null; + + /** + * TargetHttpsProxy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.creationTimestamp = null; + + /** + * TargetHttpsProxy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.description = null; + + /** + * TargetHttpsProxy fingerprint. + * @member {string|null|undefined} fingerprint + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.fingerprint = null; + + /** + * TargetHttpsProxy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.id = null; + + /** + * TargetHttpsProxy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.kind = null; + + /** + * TargetHttpsProxy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.name = null; + + /** + * TargetHttpsProxy proxyBind. + * @member {boolean|null|undefined} proxyBind + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.proxyBind = null; + + /** + * TargetHttpsProxy quicOverride. + * @member {google.cloud.compute.v1.TargetHttpsProxy.QuicOverride|null|undefined} quicOverride + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.quicOverride = null; + + /** + * TargetHttpsProxy region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.region = null; + + /** + * TargetHttpsProxy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.selfLink = null; + + /** + * TargetHttpsProxy serverTlsPolicy. + * @member {string|null|undefined} serverTlsPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.serverTlsPolicy = null; + + /** + * TargetHttpsProxy sslCertificates. + * @member {Array.} sslCertificates + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.sslCertificates = $util.emptyArray; + + /** + * TargetHttpsProxy sslPolicy. + * @member {string|null|undefined} sslPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.sslPolicy = null; + + /** + * TargetHttpsProxy urlMap. + * @member {string|null|undefined} urlMap + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + TargetHttpsProxy.prototype.urlMap = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpsProxy _authorizationPolicy. + * @member {"authorizationPolicy"|undefined} _authorizationPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_authorizationPolicy", { + get: $util.oneOfGetter($oneOfFields = ["authorizationPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _fingerprint. + * @member {"fingerprint"|undefined} _fingerprint + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_fingerprint", { + get: $util.oneOfGetter($oneOfFields = ["fingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _proxyBind. + * @member {"proxyBind"|undefined} _proxyBind + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_proxyBind", { + get: $util.oneOfGetter($oneOfFields = ["proxyBind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _quicOverride. + * @member {"quicOverride"|undefined} _quicOverride + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_quicOverride", { + get: $util.oneOfGetter($oneOfFields = ["quicOverride"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _serverTlsPolicy. + * @member {"serverTlsPolicy"|undefined} _serverTlsPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_serverTlsPolicy", { + get: $util.oneOfGetter($oneOfFields = ["serverTlsPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _sslPolicy. + * @member {"sslPolicy"|undefined} _sslPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_sslPolicy", { + get: $util.oneOfGetter($oneOfFields = ["sslPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxy _urlMap. + * @member {"urlMap"|undefined} _urlMap + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + */ + Object.defineProperty(TargetHttpsProxy.prototype, "_urlMap", { + get: $util.oneOfGetter($oneOfFields = ["urlMap"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpsProxy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpsProxy} TargetHttpsProxy instance + */ + TargetHttpsProxy.create = function create(properties) { + return new TargetHttpsProxy(properties); + }; + + /** + * Encodes the specified TargetHttpsProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxy} message TargetHttpsProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.authorizationPolicy != null && Object.hasOwnProperty.call(message, "authorizationPolicy")) + writer.uint32(/* id 33945528, wireType 2 =*/271564226).string(message.authorizationPolicy); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + writer.uint32(/* id 234678500, wireType 2 =*/1877428002).string(message.fingerprint); + if (message.proxyBind != null && Object.hasOwnProperty.call(message, "proxyBind")) + writer.uint32(/* id 286025582, wireType 0 =*/2288204656).bool(message.proxyBind); + if (message.sslPolicy != null && Object.hasOwnProperty.call(message, "sslPolicy")) + writer.uint32(/* id 295190213, wireType 2 =*/2361521706).string(message.sslPolicy); + if (message.serverTlsPolicy != null && Object.hasOwnProperty.call(message, "serverTlsPolicy")) + writer.uint32(/* id 295825266, wireType 2 =*/2366602130).string(message.serverTlsPolicy); + if (message.sslCertificates != null && message.sslCertificates.length) + for (var i = 0; i < message.sslCertificates.length; ++i) + writer.uint32(/* id 366006543, wireType 2 =*/2928052346).string(message.sslCertificates[i]); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.quicOverride != null && Object.hasOwnProperty.call(message, "quicOverride")) + writer.uint32(/* id 456577197, wireType 0 =*/3652617576).int32(message.quicOverride); + return writer; + }; + + /** + * Encodes the specified TargetHttpsProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxy} message TargetHttpsProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpsProxy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpsProxy} TargetHttpsProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpsProxy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33945528: + message.authorizationPolicy = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 234678500: + message.fingerprint = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 286025582: + message.proxyBind = reader.bool(); + break; + case 456577197: + message.quicOverride = reader.int32(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 295825266: + message.serverTlsPolicy = reader.string(); + break; + case 366006543: + if (!(message.sslCertificates && message.sslCertificates.length)) + message.sslCertificates = []; + message.sslCertificates.push(reader.string()); + break; + case 295190213: + message.sslPolicy = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpsProxy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpsProxy} TargetHttpsProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpsProxy message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpsProxy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.authorizationPolicy != null && message.hasOwnProperty("authorizationPolicy")) { + properties._authorizationPolicy = 1; + if (!$util.isString(message.authorizationPolicy)) + return "authorizationPolicy: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + properties._fingerprint = 1; + if (!$util.isString(message.fingerprint)) + return "fingerprint: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.proxyBind != null && message.hasOwnProperty("proxyBind")) { + properties._proxyBind = 1; + if (typeof message.proxyBind !== "boolean") + return "proxyBind: boolean expected"; + } + if (message.quicOverride != null && message.hasOwnProperty("quicOverride")) { + properties._quicOverride = 1; + switch (message.quicOverride) { + default: + return "quicOverride: enum value expected"; + case 0: + case 241807048: + case 438835587: + case 2402104: + break; + } + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) { + properties._serverTlsPolicy = 1; + if (!$util.isString(message.serverTlsPolicy)) + return "serverTlsPolicy: string expected"; + } + if (message.sslCertificates != null && message.hasOwnProperty("sslCertificates")) { + if (!Array.isArray(message.sslCertificates)) + return "sslCertificates: array expected"; + for (var i = 0; i < message.sslCertificates.length; ++i) + if (!$util.isString(message.sslCertificates[i])) + return "sslCertificates: string[] expected"; + } + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) { + properties._sslPolicy = 1; + if (!$util.isString(message.sslPolicy)) + return "sslPolicy: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + properties._urlMap = 1; + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + } + return null; + }; + + /** + * Creates a TargetHttpsProxy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpsProxy} TargetHttpsProxy + */ + TargetHttpsProxy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpsProxy) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpsProxy(); + if (object.authorizationPolicy != null) + message.authorizationPolicy = String(object.authorizationPolicy); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.fingerprint != null) + message.fingerprint = String(object.fingerprint); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.proxyBind != null) + message.proxyBind = Boolean(object.proxyBind); + switch (object.quicOverride) { + case "UNDEFINED_QUIC_OVERRIDE": + case 0: + message.quicOverride = 0; + break; + case "DISABLE": + case 241807048: + message.quicOverride = 241807048; + break; + case "ENABLE": + case 438835587: + message.quicOverride = 438835587; + break; + case "NONE": + case 2402104: + message.quicOverride = 2402104; + break; + } + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.serverTlsPolicy != null) + message.serverTlsPolicy = String(object.serverTlsPolicy); + if (object.sslCertificates) { + if (!Array.isArray(object.sslCertificates)) + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxy.sslCertificates: array expected"); + message.sslCertificates = []; + for (var i = 0; i < object.sslCertificates.length; ++i) + message.sslCertificates[i] = String(object.sslCertificates[i]); + } + if (object.sslPolicy != null) + message.sslPolicy = String(object.sslPolicy); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from a TargetHttpsProxy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @static + * @param {google.cloud.compute.v1.TargetHttpsProxy} message TargetHttpsProxy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpsProxy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sslCertificates = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.authorizationPolicy != null && message.hasOwnProperty("authorizationPolicy")) { + object.authorizationPolicy = message.authorizationPolicy; + if (options.oneofs) + object._authorizationPolicy = "authorizationPolicy"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + object.fingerprint = message.fingerprint; + if (options.oneofs) + object._fingerprint = "fingerprint"; + } + if (message.proxyBind != null && message.hasOwnProperty("proxyBind")) { + object.proxyBind = message.proxyBind; + if (options.oneofs) + object._proxyBind = "proxyBind"; + } + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) { + object.sslPolicy = message.sslPolicy; + if (options.oneofs) + object._sslPolicy = "sslPolicy"; + } + if (message.serverTlsPolicy != null && message.hasOwnProperty("serverTlsPolicy")) { + object.serverTlsPolicy = message.serverTlsPolicy; + if (options.oneofs) + object._serverTlsPolicy = "serverTlsPolicy"; + } + if (message.sslCertificates && message.sslCertificates.length) { + object.sslCertificates = []; + for (var j = 0; j < message.sslCertificates.length; ++j) + object.sslCertificates[j] = message.sslCertificates[j]; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + object.urlMap = message.urlMap; + if (options.oneofs) + object._urlMap = "urlMap"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.quicOverride != null && message.hasOwnProperty("quicOverride")) { + object.quicOverride = options.enums === String ? $root.google.cloud.compute.v1.TargetHttpsProxy.QuicOverride[message.quicOverride] : message.quicOverride; + if (options.oneofs) + object._quicOverride = "quicOverride"; + } + return object; + }; + + /** + * Converts this TargetHttpsProxy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpsProxy + * @instance + * @returns {Object.} JSON object + */ + TargetHttpsProxy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * QuicOverride enum. + * @name google.cloud.compute.v1.TargetHttpsProxy.QuicOverride + * @enum {number} + * @property {number} UNDEFINED_QUIC_OVERRIDE=0 UNDEFINED_QUIC_OVERRIDE value + * @property {number} DISABLE=241807048 DISABLE value + * @property {number} ENABLE=438835587 ENABLE value + * @property {number} NONE=2402104 NONE value + */ + TargetHttpsProxy.QuicOverride = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_QUIC_OVERRIDE"] = 0; + values[valuesById[241807048] = "DISABLE"] = 241807048; + values[valuesById[438835587] = "ENABLE"] = 438835587; + values[valuesById[2402104] = "NONE"] = 2402104; + return values; + })(); + + return TargetHttpsProxy; + })(); + + v1.TargetHttpsProxiesScopedList = (function() { + + /** + * Properties of a TargetHttpsProxiesScopedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpsProxiesScopedList + * @property {Array.|null} [targetHttpsProxies] TargetHttpsProxiesScopedList targetHttpsProxies + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetHttpsProxiesScopedList warning + */ + + /** + * Constructs a new TargetHttpsProxiesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpsProxiesScopedList. + * @implements ITargetHttpsProxiesScopedList + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpsProxiesScopedList=} [properties] Properties to set + */ + function TargetHttpsProxiesScopedList(properties) { + this.targetHttpsProxies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpsProxiesScopedList targetHttpsProxies. + * @member {Array.} targetHttpsProxies + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @instance + */ + TargetHttpsProxiesScopedList.prototype.targetHttpsProxies = $util.emptyArray; + + /** + * TargetHttpsProxiesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @instance + */ + TargetHttpsProxiesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpsProxiesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @instance + */ + Object.defineProperty(TargetHttpsProxiesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpsProxiesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpsProxiesScopedList} TargetHttpsProxiesScopedList instance + */ + TargetHttpsProxiesScopedList.create = function create(properties) { + return new TargetHttpsProxiesScopedList(properties); + }; + + /** + * Encodes the specified TargetHttpsProxiesScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesScopedList} message TargetHttpsProxiesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxiesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.targetHttpsProxies != null && message.targetHttpsProxies.length) + for (var i = 0; i < message.targetHttpsProxies.length; ++i) + $root.google.cloud.compute.v1.TargetHttpsProxy.encode(message.targetHttpsProxies[i], writer.uint32(/* id 366607882, wireType 2 =*/2932863058).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetHttpsProxiesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesScopedList} message TargetHttpsProxiesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxiesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpsProxiesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpsProxiesScopedList} TargetHttpsProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxiesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpsProxiesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 366607882: + if (!(message.targetHttpsProxies && message.targetHttpsProxies.length)) + message.targetHttpsProxies = []; + message.targetHttpsProxies.push($root.google.cloud.compute.v1.TargetHttpsProxy.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpsProxiesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpsProxiesScopedList} TargetHttpsProxiesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxiesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpsProxiesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpsProxiesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetHttpsProxies != null && message.hasOwnProperty("targetHttpsProxies")) { + if (!Array.isArray(message.targetHttpsProxies)) + return "targetHttpsProxies: array expected"; + for (var i = 0; i < message.targetHttpsProxies.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxy.verify(message.targetHttpsProxies[i]); + if (error) + return "targetHttpsProxies." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetHttpsProxiesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpsProxiesScopedList} TargetHttpsProxiesScopedList + */ + TargetHttpsProxiesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpsProxiesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpsProxiesScopedList(); + if (object.targetHttpsProxies) { + if (!Array.isArray(object.targetHttpsProxies)) + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxiesScopedList.targetHttpsProxies: array expected"); + message.targetHttpsProxies = []; + for (var i = 0; i < object.targetHttpsProxies.length; ++i) { + if (typeof object.targetHttpsProxies[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxiesScopedList.targetHttpsProxies: object expected"); + message.targetHttpsProxies[i] = $root.google.cloud.compute.v1.TargetHttpsProxy.fromObject(object.targetHttpsProxies[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxiesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpsProxiesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @static + * @param {google.cloud.compute.v1.TargetHttpsProxiesScopedList} message TargetHttpsProxiesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpsProxiesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetHttpsProxies = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.targetHttpsProxies && message.targetHttpsProxies.length) { + object.targetHttpsProxies = []; + for (var j = 0; j < message.targetHttpsProxies.length; ++j) + object.targetHttpsProxies[j] = $root.google.cloud.compute.v1.TargetHttpsProxy.toObject(message.targetHttpsProxies[j], options); + } + return object; + }; + + /** + * Converts this TargetHttpsProxiesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpsProxiesScopedList + * @instance + * @returns {Object.} JSON object + */ + TargetHttpsProxiesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpsProxiesScopedList; + })(); + + v1.TargetHttpsProxiesSetQuicOverrideRequest = (function() { + + /** + * Properties of a TargetHttpsProxiesSetQuicOverrideRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpsProxiesSetQuicOverrideRequest + * @property {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride|null} [quicOverride] TargetHttpsProxiesSetQuicOverrideRequest quicOverride + */ + + /** + * Constructs a new TargetHttpsProxiesSetQuicOverrideRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpsProxiesSetQuicOverrideRequest. + * @implements ITargetHttpsProxiesSetQuicOverrideRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest=} [properties] Properties to set + */ + function TargetHttpsProxiesSetQuicOverrideRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpsProxiesSetQuicOverrideRequest quicOverride. + * @member {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride|null|undefined} quicOverride + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @instance + */ + TargetHttpsProxiesSetQuicOverrideRequest.prototype.quicOverride = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpsProxiesSetQuicOverrideRequest _quicOverride. + * @member {"quicOverride"|undefined} _quicOverride + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @instance + */ + Object.defineProperty(TargetHttpsProxiesSetQuicOverrideRequest.prototype, "_quicOverride", { + get: $util.oneOfGetter($oneOfFields = ["quicOverride"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpsProxiesSetQuicOverrideRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest} TargetHttpsProxiesSetQuicOverrideRequest instance + */ + TargetHttpsProxiesSetQuicOverrideRequest.create = function create(properties) { + return new TargetHttpsProxiesSetQuicOverrideRequest(properties); + }; + + /** + * Encodes the specified TargetHttpsProxiesSetQuicOverrideRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest} message TargetHttpsProxiesSetQuicOverrideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxiesSetQuicOverrideRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quicOverride != null && Object.hasOwnProperty.call(message, "quicOverride")) + writer.uint32(/* id 456577197, wireType 0 =*/3652617576).int32(message.quicOverride); + return writer; + }; + + /** + * Encodes the specified TargetHttpsProxiesSetQuicOverrideRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest} message TargetHttpsProxiesSetQuicOverrideRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxiesSetQuicOverrideRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpsProxiesSetQuicOverrideRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest} TargetHttpsProxiesSetQuicOverrideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxiesSetQuicOverrideRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 456577197: + message.quicOverride = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpsProxiesSetQuicOverrideRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest} TargetHttpsProxiesSetQuicOverrideRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxiesSetQuicOverrideRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpsProxiesSetQuicOverrideRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpsProxiesSetQuicOverrideRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.quicOverride != null && message.hasOwnProperty("quicOverride")) { + properties._quicOverride = 1; + switch (message.quicOverride) { + default: + return "quicOverride: enum value expected"; + case 0: + case 241807048: + case 438835587: + case 2402104: + break; + } + } + return null; + }; + + /** + * Creates a TargetHttpsProxiesSetQuicOverrideRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest} TargetHttpsProxiesSetQuicOverrideRequest + */ + TargetHttpsProxiesSetQuicOverrideRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest(); + switch (object.quicOverride) { + case "UNDEFINED_QUIC_OVERRIDE": + case 0: + message.quicOverride = 0; + break; + case "DISABLE": + case 241807048: + message.quicOverride = 241807048; + break; + case "ENABLE": + case 438835587: + message.quicOverride = 438835587; + break; + case "NONE": + case 2402104: + message.quicOverride = 2402104; + break; + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpsProxiesSetQuicOverrideRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @static + * @param {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest} message TargetHttpsProxiesSetQuicOverrideRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpsProxiesSetQuicOverrideRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.quicOverride != null && message.hasOwnProperty("quicOverride")) { + object.quicOverride = options.enums === String ? $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride[message.quicOverride] : message.quicOverride; + if (options.oneofs) + object._quicOverride = "quicOverride"; + } + return object; + }; + + /** + * Converts this TargetHttpsProxiesSetQuicOverrideRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest + * @instance + * @returns {Object.} JSON object + */ + TargetHttpsProxiesSetQuicOverrideRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * QuicOverride enum. + * @name google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride + * @enum {number} + * @property {number} UNDEFINED_QUIC_OVERRIDE=0 UNDEFINED_QUIC_OVERRIDE value + * @property {number} DISABLE=241807048 DISABLE value + * @property {number} ENABLE=438835587 ENABLE value + * @property {number} NONE=2402104 NONE value + */ + TargetHttpsProxiesSetQuicOverrideRequest.QuicOverride = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_QUIC_OVERRIDE"] = 0; + values[valuesById[241807048] = "DISABLE"] = 241807048; + values[valuesById[438835587] = "ENABLE"] = 438835587; + values[valuesById[2402104] = "NONE"] = 2402104; + return values; + })(); + + return TargetHttpsProxiesSetQuicOverrideRequest; + })(); + + v1.TargetHttpsProxiesSetSslCertificatesRequest = (function() { + + /** + * Properties of a TargetHttpsProxiesSetSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpsProxiesSetSslCertificatesRequest + * @property {Array.|null} [sslCertificates] TargetHttpsProxiesSetSslCertificatesRequest sslCertificates + */ + + /** + * Constructs a new TargetHttpsProxiesSetSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpsProxiesSetSslCertificatesRequest. + * @implements ITargetHttpsProxiesSetSslCertificatesRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest=} [properties] Properties to set + */ + function TargetHttpsProxiesSetSslCertificatesRequest(properties) { + this.sslCertificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpsProxiesSetSslCertificatesRequest sslCertificates. + * @member {Array.} sslCertificates + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @instance + */ + TargetHttpsProxiesSetSslCertificatesRequest.prototype.sslCertificates = $util.emptyArray; + + /** + * Creates a new TargetHttpsProxiesSetSslCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest} TargetHttpsProxiesSetSslCertificatesRequest instance + */ + TargetHttpsProxiesSetSslCertificatesRequest.create = function create(properties) { + return new TargetHttpsProxiesSetSslCertificatesRequest(properties); + }; + + /** + * Encodes the specified TargetHttpsProxiesSetSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest} message TargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxiesSetSslCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslCertificates != null && message.sslCertificates.length) + for (var i = 0; i < message.sslCertificates.length; ++i) + writer.uint32(/* id 366006543, wireType 2 =*/2928052346).string(message.sslCertificates[i]); + return writer; + }; + + /** + * Encodes the specified TargetHttpsProxiesSetSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest} message TargetHttpsProxiesSetSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxiesSetSslCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest} TargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxiesSetSslCertificatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 366006543: + if (!(message.sslCertificates && message.sslCertificates.length)) + message.sslCertificates = []; + message.sslCertificates.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpsProxiesSetSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest} TargetHttpsProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxiesSetSslCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpsProxiesSetSslCertificatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpsProxiesSetSslCertificatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslCertificates != null && message.hasOwnProperty("sslCertificates")) { + if (!Array.isArray(message.sslCertificates)) + return "sslCertificates: array expected"; + for (var i = 0; i < message.sslCertificates.length; ++i) + if (!$util.isString(message.sslCertificates[i])) + return "sslCertificates: string[] expected"; + } + return null; + }; + + /** + * Creates a TargetHttpsProxiesSetSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest} TargetHttpsProxiesSetSslCertificatesRequest + */ + TargetHttpsProxiesSetSslCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest(); + if (object.sslCertificates) { + if (!Array.isArray(object.sslCertificates)) + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.sslCertificates: array expected"); + message.sslCertificates = []; + for (var i = 0; i < object.sslCertificates.length; ++i) + message.sslCertificates[i] = String(object.sslCertificates[i]); + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpsProxiesSetSslCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest} message TargetHttpsProxiesSetSslCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpsProxiesSetSslCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sslCertificates = []; + if (message.sslCertificates && message.sslCertificates.length) { + object.sslCertificates = []; + for (var j = 0; j < message.sslCertificates.length; ++j) + object.sslCertificates[j] = message.sslCertificates[j]; + } + return object; + }; + + /** + * Converts this TargetHttpsProxiesSetSslCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + TargetHttpsProxiesSetSslCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpsProxiesSetSslCertificatesRequest; + })(); + + v1.TargetHttpsProxyAggregatedList = (function() { + + /** + * Properties of a TargetHttpsProxyAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpsProxyAggregatedList + * @property {string|null} [id] TargetHttpsProxyAggregatedList id + * @property {Object.|null} [items] TargetHttpsProxyAggregatedList items + * @property {string|null} [kind] TargetHttpsProxyAggregatedList kind + * @property {string|null} [nextPageToken] TargetHttpsProxyAggregatedList nextPageToken + * @property {string|null} [selfLink] TargetHttpsProxyAggregatedList selfLink + * @property {Array.|null} [unreachables] TargetHttpsProxyAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetHttpsProxyAggregatedList warning + */ + + /** + * Constructs a new TargetHttpsProxyAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpsProxyAggregatedList. + * @implements ITargetHttpsProxyAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpsProxyAggregatedList=} [properties] Properties to set + */ + function TargetHttpsProxyAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpsProxyAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + TargetHttpsProxyAggregatedList.prototype.id = null; + + /** + * TargetHttpsProxyAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + TargetHttpsProxyAggregatedList.prototype.items = $util.emptyObject; + + /** + * TargetHttpsProxyAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + TargetHttpsProxyAggregatedList.prototype.kind = null; + + /** + * TargetHttpsProxyAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + TargetHttpsProxyAggregatedList.prototype.nextPageToken = null; + + /** + * TargetHttpsProxyAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + TargetHttpsProxyAggregatedList.prototype.selfLink = null; + + /** + * TargetHttpsProxyAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + TargetHttpsProxyAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * TargetHttpsProxyAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + TargetHttpsProxyAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpsProxyAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpsProxyAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpsProxyAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpsProxyAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpsProxyAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + */ + Object.defineProperty(TargetHttpsProxyAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpsProxyAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxyAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpsProxyAggregatedList} TargetHttpsProxyAggregatedList instance + */ + TargetHttpsProxyAggregatedList.create = function create(properties) { + return new TargetHttpsProxyAggregatedList(properties); + }; + + /** + * Encodes the specified TargetHttpsProxyAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxyAggregatedList} message TargetHttpsProxyAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxyAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.TargetHttpsProxiesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetHttpsProxyAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxyAggregatedList} message TargetHttpsProxyAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxyAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpsProxyAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpsProxyAggregatedList} TargetHttpsProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxyAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpsProxyAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.TargetHttpsProxiesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpsProxyAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpsProxyAggregatedList} TargetHttpsProxyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxyAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpsProxyAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpsProxyAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxiesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetHttpsProxyAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpsProxyAggregatedList} TargetHttpsProxyAggregatedList + */ + TargetHttpsProxyAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpsProxyAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpsProxyAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxyAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxyAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.TargetHttpsProxiesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxyAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxyAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpsProxyAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @static + * @param {google.cloud.compute.v1.TargetHttpsProxyAggregatedList} message TargetHttpsProxyAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpsProxyAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.TargetHttpsProxiesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetHttpsProxyAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpsProxyAggregatedList + * @instance + * @returns {Object.} JSON object + */ + TargetHttpsProxyAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpsProxyAggregatedList; + })(); + + v1.TargetHttpsProxyList = (function() { + + /** + * Properties of a TargetHttpsProxyList. + * @memberof google.cloud.compute.v1 + * @interface ITargetHttpsProxyList + * @property {string|null} [id] TargetHttpsProxyList id + * @property {Array.|null} [items] TargetHttpsProxyList items + * @property {string|null} [kind] TargetHttpsProxyList kind + * @property {string|null} [nextPageToken] TargetHttpsProxyList nextPageToken + * @property {string|null} [selfLink] TargetHttpsProxyList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetHttpsProxyList warning + */ + + /** + * Constructs a new TargetHttpsProxyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpsProxyList. + * @implements ITargetHttpsProxyList + * @constructor + * @param {google.cloud.compute.v1.ITargetHttpsProxyList=} [properties] Properties to set + */ + function TargetHttpsProxyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetHttpsProxyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + TargetHttpsProxyList.prototype.id = null; + + /** + * TargetHttpsProxyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + TargetHttpsProxyList.prototype.items = $util.emptyArray; + + /** + * TargetHttpsProxyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + TargetHttpsProxyList.prototype.kind = null; + + /** + * TargetHttpsProxyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + TargetHttpsProxyList.prototype.nextPageToken = null; + + /** + * TargetHttpsProxyList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + TargetHttpsProxyList.prototype.selfLink = null; + + /** + * TargetHttpsProxyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + TargetHttpsProxyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetHttpsProxyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + Object.defineProperty(TargetHttpsProxyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + Object.defineProperty(TargetHttpsProxyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + Object.defineProperty(TargetHttpsProxyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + Object.defineProperty(TargetHttpsProxyList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetHttpsProxyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + */ + Object.defineProperty(TargetHttpsProxyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetHttpsProxyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetHttpsProxyList} TargetHttpsProxyList instance + */ + TargetHttpsProxyList.create = function create(properties) { + return new TargetHttpsProxyList(properties); + }; + + /** + * Encodes the specified TargetHttpsProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxyList} message TargetHttpsProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetHttpsProxy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetHttpsProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetHttpsProxyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {google.cloud.compute.v1.ITargetHttpsProxyList} message TargetHttpsProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetHttpsProxyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetHttpsProxyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetHttpsProxyList} TargetHttpsProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetHttpsProxyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetHttpsProxy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetHttpsProxyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetHttpsProxyList} TargetHttpsProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetHttpsProxyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetHttpsProxyList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetHttpsProxyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetHttpsProxyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetHttpsProxyList} TargetHttpsProxyList + */ + TargetHttpsProxyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetHttpsProxyList) + return object; + var message = new $root.google.cloud.compute.v1.TargetHttpsProxyList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetHttpsProxy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetHttpsProxyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetHttpsProxyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @static + * @param {google.cloud.compute.v1.TargetHttpsProxyList} message TargetHttpsProxyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetHttpsProxyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetHttpsProxy.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetHttpsProxyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetHttpsProxyList + * @instance + * @returns {Object.} JSON object + */ + TargetHttpsProxyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetHttpsProxyList; + })(); + + v1.TargetInstance = (function() { + + /** + * Properties of a TargetInstance. + * @memberof google.cloud.compute.v1 + * @interface ITargetInstance + * @property {string|null} [creationTimestamp] TargetInstance creationTimestamp + * @property {string|null} [description] TargetInstance description + * @property {number|Long|null} [id] TargetInstance id + * @property {string|null} [instance] TargetInstance instance + * @property {string|null} [kind] TargetInstance kind + * @property {string|null} [name] TargetInstance name + * @property {google.cloud.compute.v1.TargetInstance.NatPolicy|null} [natPolicy] TargetInstance natPolicy + * @property {string|null} [selfLink] TargetInstance selfLink + * @property {string|null} [zone] TargetInstance zone + */ + + /** + * Constructs a new TargetInstance. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetInstance. + * @implements ITargetInstance + * @constructor + * @param {google.cloud.compute.v1.ITargetInstance=} [properties] Properties to set + */ + function TargetInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetInstance creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.creationTimestamp = null; + + /** + * TargetInstance description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.description = null; + + /** + * TargetInstance id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.id = null; + + /** + * TargetInstance instance. + * @member {string|null|undefined} instance + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.instance = null; + + /** + * TargetInstance kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.kind = null; + + /** + * TargetInstance name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.name = null; + + /** + * TargetInstance natPolicy. + * @member {google.cloud.compute.v1.TargetInstance.NatPolicy|null|undefined} natPolicy + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.natPolicy = null; + + /** + * TargetInstance selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.selfLink = null; + + /** + * TargetInstance zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + TargetInstance.prototype.zone = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetInstance _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _instance. + * @member {"instance"|undefined} _instance + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_instance", { + get: $util.oneOfGetter($oneOfFields = ["instance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _natPolicy. + * @member {"natPolicy"|undefined} _natPolicy + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_natPolicy", { + get: $util.oneOfGetter($oneOfFields = ["natPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstance _zone. + * @member {"zone"|undefined} _zone + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + */ + Object.defineProperty(TargetInstance.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetInstance instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {google.cloud.compute.v1.ITargetInstance=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetInstance} TargetInstance instance + */ + TargetInstance.create = function create(properties) { + return new TargetInstance(properties); + }; + + /** + * Encodes the specified TargetInstance message. Does not implicitly {@link google.cloud.compute.v1.TargetInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {google.cloud.compute.v1.ITargetInstance} message TargetInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.natPolicy != null && Object.hasOwnProperty.call(message, "natPolicy")) + writer.uint32(/* id 509780496, wireType 0 =*/4078243968).int32(message.natPolicy); + return writer; + }; + + /** + * Encodes the specified TargetInstance message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {google.cloud.compute.v1.ITargetInstance} message TargetInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetInstance} TargetInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 509780496: + message.natPolicy = reader.int32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetInstance} TargetInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetInstance message. + * @function verify + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + properties._instance = 1; + if (!$util.isString(message.instance)) + return "instance: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.natPolicy != null && message.hasOwnProperty("natPolicy")) { + properties._natPolicy = 1; + switch (message.natPolicy) { + default: + return "natPolicy: enum value expected"; + case 0: + case 161455491: + break; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + return null; + }; + + /** + * Creates a TargetInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetInstance} TargetInstance + */ + TargetInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetInstance) + return object; + var message = new $root.google.cloud.compute.v1.TargetInstance(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.instance != null) + message.instance = String(object.instance); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + switch (object.natPolicy) { + case "UNDEFINED_NAT_POLICY": + case 0: + message.natPolicy = 0; + break; + case "NO_NAT": + case 161455491: + message.natPolicy = 161455491; + break; + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a TargetInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetInstance + * @static + * @param {google.cloud.compute.v1.TargetInstance} message TargetInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + object.instance = message.instance; + if (options.oneofs) + object._instance = "instance"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.natPolicy != null && message.hasOwnProperty("natPolicy")) { + object.natPolicy = options.enums === String ? $root.google.cloud.compute.v1.TargetInstance.NatPolicy[message.natPolicy] : message.natPolicy; + if (options.oneofs) + object._natPolicy = "natPolicy"; + } + return object; + }; + + /** + * Converts this TargetInstance to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetInstance + * @instance + * @returns {Object.} JSON object + */ + TargetInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * NatPolicy enum. + * @name google.cloud.compute.v1.TargetInstance.NatPolicy + * @enum {number} + * @property {number} UNDEFINED_NAT_POLICY=0 UNDEFINED_NAT_POLICY value + * @property {number} NO_NAT=161455491 NO_NAT value + */ + TargetInstance.NatPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_NAT_POLICY"] = 0; + values[valuesById[161455491] = "NO_NAT"] = 161455491; + return values; + })(); + + return TargetInstance; + })(); + + v1.TargetInstancesScopedList = (function() { + + /** + * Properties of a TargetInstancesScopedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetInstancesScopedList + * @property {Array.|null} [targetInstances] TargetInstancesScopedList targetInstances + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetInstancesScopedList warning + */ + + /** + * Constructs a new TargetInstancesScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetInstancesScopedList. + * @implements ITargetInstancesScopedList + * @constructor + * @param {google.cloud.compute.v1.ITargetInstancesScopedList=} [properties] Properties to set + */ + function TargetInstancesScopedList(properties) { + this.targetInstances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetInstancesScopedList targetInstances. + * @member {Array.} targetInstances + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @instance + */ + TargetInstancesScopedList.prototype.targetInstances = $util.emptyArray; + + /** + * TargetInstancesScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @instance + */ + TargetInstancesScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetInstancesScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @instance + */ + Object.defineProperty(TargetInstancesScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetInstancesScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetInstancesScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetInstancesScopedList} TargetInstancesScopedList instance + */ + TargetInstancesScopedList.create = function create(properties) { + return new TargetInstancesScopedList(properties); + }; + + /** + * Encodes the specified TargetInstancesScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetInstancesScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetInstancesScopedList} message TargetInstancesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstancesScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.targetInstances != null && message.targetInstances.length) + for (var i = 0; i < message.targetInstances.length; ++i) + $root.google.cloud.compute.v1.TargetInstance.encode(message.targetInstances[i], writer.uint32(/* id 392915280, wireType 2 =*/3143322242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetInstancesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstancesScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {google.cloud.compute.v1.ITargetInstancesScopedList} message TargetInstancesScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstancesScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetInstancesScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetInstancesScopedList} TargetInstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstancesScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetInstancesScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 392915280: + if (!(message.targetInstances && message.targetInstances.length)) + message.targetInstances = []; + message.targetInstances.push($root.google.cloud.compute.v1.TargetInstance.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetInstancesScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetInstancesScopedList} TargetInstancesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstancesScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetInstancesScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetInstancesScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetInstances != null && message.hasOwnProperty("targetInstances")) { + if (!Array.isArray(message.targetInstances)) + return "targetInstances: array expected"; + for (var i = 0; i < message.targetInstances.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetInstance.verify(message.targetInstances[i]); + if (error) + return "targetInstances." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetInstancesScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetInstancesScopedList} TargetInstancesScopedList + */ + TargetInstancesScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetInstancesScopedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetInstancesScopedList(); + if (object.targetInstances) { + if (!Array.isArray(object.targetInstances)) + throw TypeError(".google.cloud.compute.v1.TargetInstancesScopedList.targetInstances: array expected"); + message.targetInstances = []; + for (var i = 0; i < object.targetInstances.length; ++i) { + if (typeof object.targetInstances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetInstancesScopedList.targetInstances: object expected"); + message.targetInstances[i] = $root.google.cloud.compute.v1.TargetInstance.fromObject(object.targetInstances[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetInstancesScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetInstancesScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @static + * @param {google.cloud.compute.v1.TargetInstancesScopedList} message TargetInstancesScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetInstancesScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetInstances = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.targetInstances && message.targetInstances.length) { + object.targetInstances = []; + for (var j = 0; j < message.targetInstances.length; ++j) + object.targetInstances[j] = $root.google.cloud.compute.v1.TargetInstance.toObject(message.targetInstances[j], options); + } + return object; + }; + + /** + * Converts this TargetInstancesScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetInstancesScopedList + * @instance + * @returns {Object.} JSON object + */ + TargetInstancesScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetInstancesScopedList; + })(); + + v1.TargetInstanceAggregatedList = (function() { + + /** + * Properties of a TargetInstanceAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetInstanceAggregatedList + * @property {string|null} [id] TargetInstanceAggregatedList id + * @property {Object.|null} [items] TargetInstanceAggregatedList items + * @property {string|null} [kind] TargetInstanceAggregatedList kind + * @property {string|null} [nextPageToken] TargetInstanceAggregatedList nextPageToken + * @property {string|null} [selfLink] TargetInstanceAggregatedList selfLink + * @property {Array.|null} [unreachables] TargetInstanceAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetInstanceAggregatedList warning + */ + + /** + * Constructs a new TargetInstanceAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetInstanceAggregatedList. + * @implements ITargetInstanceAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ITargetInstanceAggregatedList=} [properties] Properties to set + */ + function TargetInstanceAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetInstanceAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + TargetInstanceAggregatedList.prototype.id = null; + + /** + * TargetInstanceAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + TargetInstanceAggregatedList.prototype.items = $util.emptyObject; + + /** + * TargetInstanceAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + TargetInstanceAggregatedList.prototype.kind = null; + + /** + * TargetInstanceAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + TargetInstanceAggregatedList.prototype.nextPageToken = null; + + /** + * TargetInstanceAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + TargetInstanceAggregatedList.prototype.selfLink = null; + + /** + * TargetInstanceAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + TargetInstanceAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * TargetInstanceAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + TargetInstanceAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetInstanceAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + Object.defineProperty(TargetInstanceAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + Object.defineProperty(TargetInstanceAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + Object.defineProperty(TargetInstanceAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + Object.defineProperty(TargetInstanceAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + */ + Object.defineProperty(TargetInstanceAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetInstanceAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetInstanceAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetInstanceAggregatedList} TargetInstanceAggregatedList instance + */ + TargetInstanceAggregatedList.create = function create(properties) { + return new TargetInstanceAggregatedList(properties); + }; + + /** + * Encodes the specified TargetInstanceAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetInstanceAggregatedList} message TargetInstanceAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstanceAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.TargetInstancesScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetInstanceAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetInstanceAggregatedList} message TargetInstanceAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstanceAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetInstanceAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetInstanceAggregatedList} TargetInstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstanceAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetInstanceAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.TargetInstancesScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetInstanceAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetInstanceAggregatedList} TargetInstanceAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstanceAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetInstanceAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetInstanceAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetInstancesScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetInstanceAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetInstanceAggregatedList} TargetInstanceAggregatedList + */ + TargetInstanceAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetInstanceAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetInstanceAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.TargetInstanceAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetInstanceAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.TargetInstancesScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.TargetInstanceAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetInstanceAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetInstanceAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @static + * @param {google.cloud.compute.v1.TargetInstanceAggregatedList} message TargetInstanceAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetInstanceAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.TargetInstancesScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetInstanceAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetInstanceAggregatedList + * @instance + * @returns {Object.} JSON object + */ + TargetInstanceAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetInstanceAggregatedList; + })(); + + v1.TargetInstanceList = (function() { + + /** + * Properties of a TargetInstanceList. + * @memberof google.cloud.compute.v1 + * @interface ITargetInstanceList + * @property {string|null} [id] TargetInstanceList id + * @property {Array.|null} [items] TargetInstanceList items + * @property {string|null} [kind] TargetInstanceList kind + * @property {string|null} [nextPageToken] TargetInstanceList nextPageToken + * @property {string|null} [selfLink] TargetInstanceList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetInstanceList warning + */ + + /** + * Constructs a new TargetInstanceList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetInstanceList. + * @implements ITargetInstanceList + * @constructor + * @param {google.cloud.compute.v1.ITargetInstanceList=} [properties] Properties to set + */ + function TargetInstanceList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetInstanceList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + TargetInstanceList.prototype.id = null; + + /** + * TargetInstanceList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + TargetInstanceList.prototype.items = $util.emptyArray; + + /** + * TargetInstanceList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + TargetInstanceList.prototype.kind = null; + + /** + * TargetInstanceList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + TargetInstanceList.prototype.nextPageToken = null; + + /** + * TargetInstanceList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + TargetInstanceList.prototype.selfLink = null; + + /** + * TargetInstanceList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + TargetInstanceList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetInstanceList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + Object.defineProperty(TargetInstanceList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + Object.defineProperty(TargetInstanceList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + Object.defineProperty(TargetInstanceList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + Object.defineProperty(TargetInstanceList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetInstanceList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + */ + Object.defineProperty(TargetInstanceList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetInstanceList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {google.cloud.compute.v1.ITargetInstanceList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetInstanceList} TargetInstanceList instance + */ + TargetInstanceList.create = function create(properties) { + return new TargetInstanceList(properties); + }; + + /** + * Encodes the specified TargetInstanceList message. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {google.cloud.compute.v1.ITargetInstanceList} message TargetInstanceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstanceList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetInstance.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetInstanceList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetInstanceList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {google.cloud.compute.v1.ITargetInstanceList} message TargetInstanceList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetInstanceList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetInstanceList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetInstanceList} TargetInstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstanceList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetInstanceList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetInstance.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetInstanceList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetInstanceList} TargetInstanceList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetInstanceList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetInstanceList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetInstanceList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetInstance.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetInstanceList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetInstanceList} TargetInstanceList + */ + TargetInstanceList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetInstanceList) + return object; + var message = new $root.google.cloud.compute.v1.TargetInstanceList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetInstanceList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetInstanceList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetInstance.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetInstanceList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetInstanceList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetInstanceList + * @static + * @param {google.cloud.compute.v1.TargetInstanceList} message TargetInstanceList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetInstanceList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetInstance.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetInstanceList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetInstanceList + * @instance + * @returns {Object.} JSON object + */ + TargetInstanceList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetInstanceList; + })(); + + v1.TargetPool = (function() { + + /** + * Properties of a TargetPool. + * @memberof google.cloud.compute.v1 + * @interface ITargetPool + * @property {string|null} [backupPool] TargetPool backupPool + * @property {string|null} [creationTimestamp] TargetPool creationTimestamp + * @property {string|null} [description] TargetPool description + * @property {number|null} [failoverRatio] TargetPool failoverRatio + * @property {Array.|null} [healthChecks] TargetPool healthChecks + * @property {number|Long|null} [id] TargetPool id + * @property {Array.|null} [instances] TargetPool instances + * @property {string|null} [kind] TargetPool kind + * @property {string|null} [name] TargetPool name + * @property {string|null} [region] TargetPool region + * @property {string|null} [selfLink] TargetPool selfLink + * @property {google.cloud.compute.v1.TargetPool.SessionAffinity|null} [sessionAffinity] TargetPool sessionAffinity + */ + + /** + * Constructs a new TargetPool. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPool. + * @implements ITargetPool + * @constructor + * @param {google.cloud.compute.v1.ITargetPool=} [properties] Properties to set + */ + function TargetPool(properties) { + this.healthChecks = []; + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPool backupPool. + * @member {string|null|undefined} backupPool + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.backupPool = null; + + /** + * TargetPool creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.creationTimestamp = null; + + /** + * TargetPool description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.description = null; + + /** + * TargetPool failoverRatio. + * @member {number|null|undefined} failoverRatio + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.failoverRatio = null; + + /** + * TargetPool healthChecks. + * @member {Array.} healthChecks + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.healthChecks = $util.emptyArray; + + /** + * TargetPool id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.id = null; + + /** + * TargetPool instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.instances = $util.emptyArray; + + /** + * TargetPool kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.kind = null; + + /** + * TargetPool name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.name = null; + + /** + * TargetPool region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.region = null; + + /** + * TargetPool selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.selfLink = null; + + /** + * TargetPool sessionAffinity. + * @member {google.cloud.compute.v1.TargetPool.SessionAffinity|null|undefined} sessionAffinity + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + TargetPool.prototype.sessionAffinity = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetPool _backupPool. + * @member {"backupPool"|undefined} _backupPool + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_backupPool", { + get: $util.oneOfGetter($oneOfFields = ["backupPool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _failoverRatio. + * @member {"failoverRatio"|undefined} _failoverRatio + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_failoverRatio", { + get: $util.oneOfGetter($oneOfFields = ["failoverRatio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPool _sessionAffinity. + * @member {"sessionAffinity"|undefined} _sessionAffinity + * @memberof google.cloud.compute.v1.TargetPool + * @instance + */ + Object.defineProperty(TargetPool.prototype, "_sessionAffinity", { + get: $util.oneOfGetter($oneOfFields = ["sessionAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetPool instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {google.cloud.compute.v1.ITargetPool=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPool} TargetPool instance + */ + TargetPool.create = function create(properties) { + return new TargetPool(properties); + }; + + /** + * Encodes the specified TargetPool message. Does not implicitly {@link google.cloud.compute.v1.TargetPool.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {google.cloud.compute.v1.ITargetPool} message TargetPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + writer.uint32(/* id 29097598, wireType 2 =*/232780786).string(message.instances[i]); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.backupPool != null && Object.hasOwnProperty.call(message, "backupPool")) + writer.uint32(/* id 45884537, wireType 2 =*/367076298).string(message.backupPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.failoverRatio != null && Object.hasOwnProperty.call(message, "failoverRatio")) + writer.uint32(/* id 212667006, wireType 5 =*/1701336053).float(message.failoverRatio); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.healthChecks != null && message.healthChecks.length) + for (var i = 0; i < message.healthChecks.length; ++i) + writer.uint32(/* id 448370606, wireType 2 =*/3586964850).string(message.healthChecks[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.sessionAffinity != null && Object.hasOwnProperty.call(message, "sessionAffinity")) + writer.uint32(/* id 463888561, wireType 0 =*/3711108488).int32(message.sessionAffinity); + return writer; + }; + + /** + * Encodes the specified TargetPool message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {google.cloud.compute.v1.ITargetPool} message TargetPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPool} TargetPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 45884537: + message.backupPool = reader.string(); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 212667006: + message.failoverRatio = reader.float(); + break; + case 448370606: + if (!(message.healthChecks && message.healthChecks.length)) + message.healthChecks = []; + message.healthChecks.push(reader.string()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push(reader.string()); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 463888561: + message.sessionAffinity = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPool} TargetPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPool message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupPool != null && message.hasOwnProperty("backupPool")) { + properties._backupPool = 1; + if (!$util.isString(message.backupPool)) + return "backupPool: string expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.failoverRatio != null && message.hasOwnProperty("failoverRatio")) { + properties._failoverRatio = 1; + if (typeof message.failoverRatio !== "number") + return "failoverRatio: number expected"; + } + if (message.healthChecks != null && message.hasOwnProperty("healthChecks")) { + if (!Array.isArray(message.healthChecks)) + return "healthChecks: array expected"; + for (var i = 0; i < message.healthChecks.length; ++i) + if (!$util.isString(message.healthChecks[i])) + return "healthChecks: string[] expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long 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) + if (!$util.isString(message.instances[i])) + return "instances: string[] expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) { + properties._sessionAffinity = 1; + switch (message.sessionAffinity) { + default: + return "sessionAffinity: enum value expected"; + case 0: + case 345665051: + case 106122516: + case 221722926: + case 25322148: + case 370321204: + case 200737960: + case 494981627: + case 2402104: + break; + } + } + return null; + }; + + /** + * Creates a TargetPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPool} TargetPool + */ + TargetPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPool) + return object; + var message = new $root.google.cloud.compute.v1.TargetPool(); + if (object.backupPool != null) + message.backupPool = String(object.backupPool); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.failoverRatio != null) + message.failoverRatio = Number(object.failoverRatio); + if (object.healthChecks) { + if (!Array.isArray(object.healthChecks)) + throw TypeError(".google.cloud.compute.v1.TargetPool.healthChecks: array expected"); + message.healthChecks = []; + for (var i = 0; i < object.healthChecks.length; ++i) + message.healthChecks[i] = String(object.healthChecks[i]); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.TargetPool.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) + message.instances[i] = String(object.instances[i]); + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.sessionAffinity) { + case "UNDEFINED_SESSION_AFFINITY": + case 0: + message.sessionAffinity = 0; + break; + case "CLIENT_IP": + case 345665051: + message.sessionAffinity = 345665051; + break; + case "CLIENT_IP_NO_DESTINATION": + case 106122516: + message.sessionAffinity = 106122516; + break; + case "CLIENT_IP_PORT_PROTO": + case 221722926: + message.sessionAffinity = 221722926; + break; + case "CLIENT_IP_PROTO": + case 25322148: + message.sessionAffinity = 25322148; + break; + case "GENERATED_COOKIE": + case 370321204: + message.sessionAffinity = 370321204; + break; + case "HEADER_FIELD": + case 200737960: + message.sessionAffinity = 200737960; + break; + case "HTTP_COOKIE": + case 494981627: + message.sessionAffinity = 494981627; + break; + case "NONE": + case 2402104: + message.sessionAffinity = 2402104; + break; + } + return message; + }; + + /** + * Creates a plain object from a TargetPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPool + * @static + * @param {google.cloud.compute.v1.TargetPool} message TargetPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.healthChecks = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = message.instances[j]; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.backupPool != null && message.hasOwnProperty("backupPool")) { + object.backupPool = message.backupPool; + if (options.oneofs) + object._backupPool = "backupPool"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.failoverRatio != null && message.hasOwnProperty("failoverRatio")) { + object.failoverRatio = options.json && !isFinite(message.failoverRatio) ? String(message.failoverRatio) : message.failoverRatio; + if (options.oneofs) + object._failoverRatio = "failoverRatio"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.healthChecks && message.healthChecks.length) { + object.healthChecks = []; + for (var j = 0; j < message.healthChecks.length; ++j) + object.healthChecks[j] = message.healthChecks[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.sessionAffinity != null && message.hasOwnProperty("sessionAffinity")) { + object.sessionAffinity = options.enums === String ? $root.google.cloud.compute.v1.TargetPool.SessionAffinity[message.sessionAffinity] : message.sessionAffinity; + if (options.oneofs) + object._sessionAffinity = "sessionAffinity"; + } + return object; + }; + + /** + * Converts this TargetPool to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPool + * @instance + * @returns {Object.} JSON object + */ + TargetPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * SessionAffinity enum. + * @name google.cloud.compute.v1.TargetPool.SessionAffinity + * @enum {number} + * @property {number} UNDEFINED_SESSION_AFFINITY=0 UNDEFINED_SESSION_AFFINITY value + * @property {number} CLIENT_IP=345665051 CLIENT_IP value + * @property {number} CLIENT_IP_NO_DESTINATION=106122516 CLIENT_IP_NO_DESTINATION value + * @property {number} CLIENT_IP_PORT_PROTO=221722926 CLIENT_IP_PORT_PROTO value + * @property {number} CLIENT_IP_PROTO=25322148 CLIENT_IP_PROTO value + * @property {number} GENERATED_COOKIE=370321204 GENERATED_COOKIE value + * @property {number} HEADER_FIELD=200737960 HEADER_FIELD value + * @property {number} HTTP_COOKIE=494981627 HTTP_COOKIE value + * @property {number} NONE=2402104 NONE value + */ + TargetPool.SessionAffinity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_SESSION_AFFINITY"] = 0; + values[valuesById[345665051] = "CLIENT_IP"] = 345665051; + values[valuesById[106122516] = "CLIENT_IP_NO_DESTINATION"] = 106122516; + values[valuesById[221722926] = "CLIENT_IP_PORT_PROTO"] = 221722926; + values[valuesById[25322148] = "CLIENT_IP_PROTO"] = 25322148; + values[valuesById[370321204] = "GENERATED_COOKIE"] = 370321204; + values[valuesById[200737960] = "HEADER_FIELD"] = 200737960; + values[valuesById[494981627] = "HTTP_COOKIE"] = 494981627; + values[valuesById[2402104] = "NONE"] = 2402104; + return values; + })(); + + return TargetPool; + })(); + + v1.TargetPoolsScopedList = (function() { + + /** + * Properties of a TargetPoolsScopedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolsScopedList + * @property {Array.|null} [targetPools] TargetPoolsScopedList targetPools + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetPoolsScopedList warning + */ + + /** + * Constructs a new TargetPoolsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolsScopedList. + * @implements ITargetPoolsScopedList + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolsScopedList=} [properties] Properties to set + */ + function TargetPoolsScopedList(properties) { + this.targetPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolsScopedList targetPools. + * @member {Array.} targetPools + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @instance + */ + TargetPoolsScopedList.prototype.targetPools = $util.emptyArray; + + /** + * TargetPoolsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @instance + */ + TargetPoolsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetPoolsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @instance + */ + Object.defineProperty(TargetPoolsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetPoolsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {google.cloud.compute.v1.ITargetPoolsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolsScopedList} TargetPoolsScopedList instance + */ + TargetPoolsScopedList.create = function create(properties) { + return new TargetPoolsScopedList(properties); + }; + + /** + * Encodes the specified TargetPoolsScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {google.cloud.compute.v1.ITargetPoolsScopedList} message TargetPoolsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.targetPools != null && message.targetPools.length) + for (var i = 0; i < message.targetPools.length; ++i) + $root.google.cloud.compute.v1.TargetPool.encode(message.targetPools[i], writer.uint32(/* id 336072617, wireType 2 =*/2688580938).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetPoolsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {google.cloud.compute.v1.ITargetPoolsScopedList} message TargetPoolsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolsScopedList} TargetPoolsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336072617: + if (!(message.targetPools && message.targetPools.length)) + message.targetPools = []; + message.targetPools.push($root.google.cloud.compute.v1.TargetPool.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolsScopedList} TargetPoolsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetPools != null && message.hasOwnProperty("targetPools")) { + if (!Array.isArray(message.targetPools)) + return "targetPools: array expected"; + for (var i = 0; i < message.targetPools.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetPool.verify(message.targetPools[i]); + if (error) + return "targetPools." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetPoolsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolsScopedList} TargetPoolsScopedList + */ + TargetPoolsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolsScopedList(); + if (object.targetPools) { + if (!Array.isArray(object.targetPools)) + throw TypeError(".google.cloud.compute.v1.TargetPoolsScopedList.targetPools: array expected"); + message.targetPools = []; + for (var i = 0; i < object.targetPools.length; ++i) { + if (typeof object.targetPools[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolsScopedList.targetPools: object expected"); + message.targetPools[i] = $root.google.cloud.compute.v1.TargetPool.fromObject(object.targetPools[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetPoolsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @static + * @param {google.cloud.compute.v1.TargetPoolsScopedList} message TargetPoolsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetPools = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.targetPools && message.targetPools.length) { + object.targetPools = []; + for (var j = 0; j < message.targetPools.length; ++j) + object.targetPools[j] = $root.google.cloud.compute.v1.TargetPool.toObject(message.targetPools[j], options); + } + return object; + }; + + /** + * Converts this TargetPoolsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolsScopedList + * @instance + * @returns {Object.} JSON object + */ + TargetPoolsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolsScopedList; + })(); + + v1.TargetPoolAggregatedList = (function() { + + /** + * Properties of a TargetPoolAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolAggregatedList + * @property {string|null} [id] TargetPoolAggregatedList id + * @property {Object.|null} [items] TargetPoolAggregatedList items + * @property {string|null} [kind] TargetPoolAggregatedList kind + * @property {string|null} [nextPageToken] TargetPoolAggregatedList nextPageToken + * @property {string|null} [selfLink] TargetPoolAggregatedList selfLink + * @property {Array.|null} [unreachables] TargetPoolAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetPoolAggregatedList warning + */ + + /** + * Constructs a new TargetPoolAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolAggregatedList. + * @implements ITargetPoolAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolAggregatedList=} [properties] Properties to set + */ + function TargetPoolAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + TargetPoolAggregatedList.prototype.id = null; + + /** + * TargetPoolAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + TargetPoolAggregatedList.prototype.items = $util.emptyObject; + + /** + * TargetPoolAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + TargetPoolAggregatedList.prototype.kind = null; + + /** + * TargetPoolAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + TargetPoolAggregatedList.prototype.nextPageToken = null; + + /** + * TargetPoolAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + TargetPoolAggregatedList.prototype.selfLink = null; + + /** + * TargetPoolAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + TargetPoolAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * TargetPoolAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + TargetPoolAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetPoolAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + Object.defineProperty(TargetPoolAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + Object.defineProperty(TargetPoolAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + Object.defineProperty(TargetPoolAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + Object.defineProperty(TargetPoolAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + */ + Object.defineProperty(TargetPoolAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetPoolAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetPoolAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolAggregatedList} TargetPoolAggregatedList instance + */ + TargetPoolAggregatedList.create = function create(properties) { + return new TargetPoolAggregatedList(properties); + }; + + /** + * Encodes the specified TargetPoolAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetPoolAggregatedList} message TargetPoolAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.TargetPoolsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetPoolAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetPoolAggregatedList} message TargetPoolAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolAggregatedList} TargetPoolAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.TargetPoolsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolAggregatedList} TargetPoolAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetPoolsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetPoolAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolAggregatedList} TargetPoolAggregatedList + */ + TargetPoolAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.TargetPoolsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.TargetPoolAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetPoolAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @static + * @param {google.cloud.compute.v1.TargetPoolAggregatedList} message TargetPoolAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.TargetPoolsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetPoolAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolAggregatedList + * @instance + * @returns {Object.} JSON object + */ + TargetPoolAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolAggregatedList; + })(); + + v1.TargetPoolInstanceHealth = (function() { + + /** + * Properties of a TargetPoolInstanceHealth. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolInstanceHealth + * @property {Array.|null} [healthStatus] TargetPoolInstanceHealth healthStatus + * @property {string|null} [kind] TargetPoolInstanceHealth kind + */ + + /** + * Constructs a new TargetPoolInstanceHealth. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolInstanceHealth. + * @implements ITargetPoolInstanceHealth + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolInstanceHealth=} [properties] Properties to set + */ + function TargetPoolInstanceHealth(properties) { + this.healthStatus = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolInstanceHealth healthStatus. + * @member {Array.} healthStatus + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @instance + */ + TargetPoolInstanceHealth.prototype.healthStatus = $util.emptyArray; + + /** + * TargetPoolInstanceHealth kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @instance + */ + TargetPoolInstanceHealth.prototype.kind = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetPoolInstanceHealth _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @instance + */ + Object.defineProperty(TargetPoolInstanceHealth.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetPoolInstanceHealth instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {google.cloud.compute.v1.ITargetPoolInstanceHealth=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolInstanceHealth} TargetPoolInstanceHealth instance + */ + TargetPoolInstanceHealth.create = function create(properties) { + return new TargetPoolInstanceHealth(properties); + }; + + /** + * Encodes the specified TargetPoolInstanceHealth message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolInstanceHealth.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {google.cloud.compute.v1.ITargetPoolInstanceHealth} message TargetPoolInstanceHealth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolInstanceHealth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.healthStatus != null && message.healthStatus.length) + for (var i = 0; i < message.healthStatus.length; ++i) + $root.google.cloud.compute.v1.HealthStatus.encode(message.healthStatus[i], writer.uint32(/* id 380545845, wireType 2 =*/3044366762).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetPoolInstanceHealth message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolInstanceHealth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {google.cloud.compute.v1.ITargetPoolInstanceHealth} message TargetPoolInstanceHealth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolInstanceHealth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolInstanceHealth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolInstanceHealth} TargetPoolInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolInstanceHealth.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolInstanceHealth(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 380545845: + if (!(message.healthStatus && message.healthStatus.length)) + message.healthStatus = []; + message.healthStatus.push($root.google.cloud.compute.v1.HealthStatus.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolInstanceHealth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolInstanceHealth} TargetPoolInstanceHealth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolInstanceHealth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolInstanceHealth message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolInstanceHealth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthStatus != null && message.hasOwnProperty("healthStatus")) { + if (!Array.isArray(message.healthStatus)) + return "healthStatus: array expected"; + for (var i = 0; i < message.healthStatus.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthStatus.verify(message.healthStatus[i]); + if (error) + return "healthStatus." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + return null; + }; + + /** + * Creates a TargetPoolInstanceHealth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolInstanceHealth} TargetPoolInstanceHealth + */ + TargetPoolInstanceHealth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolInstanceHealth) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolInstanceHealth(); + if (object.healthStatus) { + if (!Array.isArray(object.healthStatus)) + throw TypeError(".google.cloud.compute.v1.TargetPoolInstanceHealth.healthStatus: array expected"); + message.healthStatus = []; + for (var i = 0; i < object.healthStatus.length; ++i) { + if (typeof object.healthStatus[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolInstanceHealth.healthStatus: object expected"); + message.healthStatus[i] = $root.google.cloud.compute.v1.HealthStatus.fromObject(object.healthStatus[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + return message; + }; + + /** + * Creates a plain object from a TargetPoolInstanceHealth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @static + * @param {google.cloud.compute.v1.TargetPoolInstanceHealth} message TargetPoolInstanceHealth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolInstanceHealth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.healthStatus = []; + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.healthStatus && message.healthStatus.length) { + object.healthStatus = []; + for (var j = 0; j < message.healthStatus.length; ++j) + object.healthStatus[j] = $root.google.cloud.compute.v1.HealthStatus.toObject(message.healthStatus[j], options); + } + return object; + }; + + /** + * Converts this TargetPoolInstanceHealth to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolInstanceHealth + * @instance + * @returns {Object.} JSON object + */ + TargetPoolInstanceHealth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolInstanceHealth; + })(); + + v1.TargetPoolList = (function() { + + /** + * Properties of a TargetPoolList. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolList + * @property {string|null} [id] TargetPoolList id + * @property {Array.|null} [items] TargetPoolList items + * @property {string|null} [kind] TargetPoolList kind + * @property {string|null} [nextPageToken] TargetPoolList nextPageToken + * @property {string|null} [selfLink] TargetPoolList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetPoolList warning + */ + + /** + * Constructs a new TargetPoolList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolList. + * @implements ITargetPoolList + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolList=} [properties] Properties to set + */ + function TargetPoolList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + TargetPoolList.prototype.id = null; + + /** + * TargetPoolList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + TargetPoolList.prototype.items = $util.emptyArray; + + /** + * TargetPoolList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + TargetPoolList.prototype.kind = null; + + /** + * TargetPoolList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + TargetPoolList.prototype.nextPageToken = null; + + /** + * TargetPoolList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + TargetPoolList.prototype.selfLink = null; + + /** + * TargetPoolList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + TargetPoolList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetPoolList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + Object.defineProperty(TargetPoolList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + Object.defineProperty(TargetPoolList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + Object.defineProperty(TargetPoolList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + Object.defineProperty(TargetPoolList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetPoolList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + */ + Object.defineProperty(TargetPoolList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetPoolList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {google.cloud.compute.v1.ITargetPoolList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolList} TargetPoolList instance + */ + TargetPoolList.create = function create(properties) { + return new TargetPoolList(properties); + }; + + /** + * Encodes the specified TargetPoolList message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {google.cloud.compute.v1.ITargetPoolList} message TargetPoolList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetPool.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetPoolList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {google.cloud.compute.v1.ITargetPoolList} message TargetPoolList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolList} TargetPoolList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetPool.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolList} TargetPoolList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetPool.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetPoolList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolList} TargetPoolList + */ + TargetPoolList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolList) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetPoolList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetPool.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetPoolList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolList + * @static + * @param {google.cloud.compute.v1.TargetPoolList} message TargetPoolList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetPool.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetPoolList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolList + * @instance + * @returns {Object.} JSON object + */ + TargetPoolList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolList; + })(); + + v1.TargetPoolsAddHealthCheckRequest = (function() { + + /** + * Properties of a TargetPoolsAddHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolsAddHealthCheckRequest + * @property {Array.|null} [healthChecks] TargetPoolsAddHealthCheckRequest healthChecks + */ + + /** + * Constructs a new TargetPoolsAddHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolsAddHealthCheckRequest. + * @implements ITargetPoolsAddHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest=} [properties] Properties to set + */ + function TargetPoolsAddHealthCheckRequest(properties) { + this.healthChecks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolsAddHealthCheckRequest healthChecks. + * @member {Array.} healthChecks + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @instance + */ + TargetPoolsAddHealthCheckRequest.prototype.healthChecks = $util.emptyArray; + + /** + * Creates a new TargetPoolsAddHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest} TargetPoolsAddHealthCheckRequest instance + */ + TargetPoolsAddHealthCheckRequest.create = function create(properties) { + return new TargetPoolsAddHealthCheckRequest(properties); + }; + + /** + * Encodes the specified TargetPoolsAddHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest} message TargetPoolsAddHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsAddHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.healthChecks != null && message.healthChecks.length) + for (var i = 0; i < message.healthChecks.length; ++i) + $root.google.cloud.compute.v1.HealthCheckReference.encode(message.healthChecks[i], writer.uint32(/* id 448370606, wireType 2 =*/3586964850).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetPoolsAddHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest} message TargetPoolsAddHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsAddHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolsAddHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest} TargetPoolsAddHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsAddHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 448370606: + if (!(message.healthChecks && message.healthChecks.length)) + message.healthChecks = []; + message.healthChecks.push($root.google.cloud.compute.v1.HealthCheckReference.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolsAddHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest} TargetPoolsAddHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsAddHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolsAddHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolsAddHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.healthChecks != null && message.hasOwnProperty("healthChecks")) { + if (!Array.isArray(message.healthChecks)) + return "healthChecks: array expected"; + for (var i = 0; i < message.healthChecks.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthCheckReference.verify(message.healthChecks[i]); + if (error) + return "healthChecks." + error; + } + } + return null; + }; + + /** + * Creates a TargetPoolsAddHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest} TargetPoolsAddHealthCheckRequest + */ + TargetPoolsAddHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest(); + if (object.healthChecks) { + if (!Array.isArray(object.healthChecks)) + throw TypeError(".google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.healthChecks: array expected"); + message.healthChecks = []; + for (var i = 0; i < object.healthChecks.length; ++i) { + if (typeof object.healthChecks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.healthChecks: object expected"); + message.healthChecks[i] = $root.google.cloud.compute.v1.HealthCheckReference.fromObject(object.healthChecks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetPoolsAddHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest} message TargetPoolsAddHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolsAddHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.healthChecks = []; + if (message.healthChecks && message.healthChecks.length) { + object.healthChecks = []; + for (var j = 0; j < message.healthChecks.length; ++j) + object.healthChecks[j] = $root.google.cloud.compute.v1.HealthCheckReference.toObject(message.healthChecks[j], options); + } + return object; + }; + + /** + * Converts this TargetPoolsAddHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + TargetPoolsAddHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolsAddHealthCheckRequest; + })(); + + v1.TargetPoolsAddInstanceRequest = (function() { + + /** + * Properties of a TargetPoolsAddInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolsAddInstanceRequest + * @property {Array.|null} [instances] TargetPoolsAddInstanceRequest instances + */ + + /** + * Constructs a new TargetPoolsAddInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolsAddInstanceRequest. + * @implements ITargetPoolsAddInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolsAddInstanceRequest=} [properties] Properties to set + */ + function TargetPoolsAddInstanceRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolsAddInstanceRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @instance + */ + TargetPoolsAddInstanceRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new TargetPoolsAddInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsAddInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolsAddInstanceRequest} TargetPoolsAddInstanceRequest instance + */ + TargetPoolsAddInstanceRequest.create = function create(properties) { + return new TargetPoolsAddInstanceRequest(properties); + }; + + /** + * Encodes the specified TargetPoolsAddInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsAddInstanceRequest} message TargetPoolsAddInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsAddInstanceRequest.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.compute.v1.InstanceReference.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetPoolsAddInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsAddInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsAddInstanceRequest} message TargetPoolsAddInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsAddInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolsAddInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolsAddInstanceRequest} TargetPoolsAddInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsAddInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.InstanceReference.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolsAddInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolsAddInstanceRequest} TargetPoolsAddInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsAddInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolsAddInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolsAddInstanceRequest.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.compute.v1.InstanceReference.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a TargetPoolsAddInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolsAddInstanceRequest} TargetPoolsAddInstanceRequest + */ + TargetPoolsAddInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.TargetPoolsAddInstanceRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolsAddInstanceRequest.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.InstanceReference.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetPoolsAddInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @static + * @param {google.cloud.compute.v1.TargetPoolsAddInstanceRequest} message TargetPoolsAddInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolsAddInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.InstanceReference.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this TargetPoolsAddInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolsAddInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + TargetPoolsAddInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolsAddInstanceRequest; + })(); + + v1.TargetPoolsRemoveHealthCheckRequest = (function() { + + /** + * Properties of a TargetPoolsRemoveHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolsRemoveHealthCheckRequest + * @property {Array.|null} [healthChecks] TargetPoolsRemoveHealthCheckRequest healthChecks + */ + + /** + * Constructs a new TargetPoolsRemoveHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolsRemoveHealthCheckRequest. + * @implements ITargetPoolsRemoveHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest=} [properties] Properties to set + */ + function TargetPoolsRemoveHealthCheckRequest(properties) { + this.healthChecks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolsRemoveHealthCheckRequest healthChecks. + * @member {Array.} healthChecks + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @instance + */ + TargetPoolsRemoveHealthCheckRequest.prototype.healthChecks = $util.emptyArray; + + /** + * Creates a new TargetPoolsRemoveHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest} TargetPoolsRemoveHealthCheckRequest instance + */ + TargetPoolsRemoveHealthCheckRequest.create = function create(properties) { + return new TargetPoolsRemoveHealthCheckRequest(properties); + }; + + /** + * Encodes the specified TargetPoolsRemoveHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest} message TargetPoolsRemoveHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsRemoveHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.healthChecks != null && message.healthChecks.length) + for (var i = 0; i < message.healthChecks.length; ++i) + $root.google.cloud.compute.v1.HealthCheckReference.encode(message.healthChecks[i], writer.uint32(/* id 448370606, wireType 2 =*/3586964850).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetPoolsRemoveHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest} message TargetPoolsRemoveHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsRemoveHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolsRemoveHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest} TargetPoolsRemoveHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsRemoveHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 448370606: + if (!(message.healthChecks && message.healthChecks.length)) + message.healthChecks = []; + message.healthChecks.push($root.google.cloud.compute.v1.HealthCheckReference.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolsRemoveHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest} TargetPoolsRemoveHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsRemoveHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolsRemoveHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolsRemoveHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.healthChecks != null && message.hasOwnProperty("healthChecks")) { + if (!Array.isArray(message.healthChecks)) + return "healthChecks: array expected"; + for (var i = 0; i < message.healthChecks.length; ++i) { + var error = $root.google.cloud.compute.v1.HealthCheckReference.verify(message.healthChecks[i]); + if (error) + return "healthChecks." + error; + } + } + return null; + }; + + /** + * Creates a TargetPoolsRemoveHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest} TargetPoolsRemoveHealthCheckRequest + */ + TargetPoolsRemoveHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest(); + if (object.healthChecks) { + if (!Array.isArray(object.healthChecks)) + throw TypeError(".google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.healthChecks: array expected"); + message.healthChecks = []; + for (var i = 0; i < object.healthChecks.length; ++i) { + if (typeof object.healthChecks[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.healthChecks: object expected"); + message.healthChecks[i] = $root.google.cloud.compute.v1.HealthCheckReference.fromObject(object.healthChecks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetPoolsRemoveHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest} message TargetPoolsRemoveHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolsRemoveHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.healthChecks = []; + if (message.healthChecks && message.healthChecks.length) { + object.healthChecks = []; + for (var j = 0; j < message.healthChecks.length; ++j) + object.healthChecks[j] = $root.google.cloud.compute.v1.HealthCheckReference.toObject(message.healthChecks[j], options); + } + return object; + }; + + /** + * Converts this TargetPoolsRemoveHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + TargetPoolsRemoveHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolsRemoveHealthCheckRequest; + })(); + + v1.TargetPoolsRemoveInstanceRequest = (function() { + + /** + * Properties of a TargetPoolsRemoveInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetPoolsRemoveInstanceRequest + * @property {Array.|null} [instances] TargetPoolsRemoveInstanceRequest instances + */ + + /** + * Constructs a new TargetPoolsRemoveInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPoolsRemoveInstanceRequest. + * @implements ITargetPoolsRemoveInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest=} [properties] Properties to set + */ + function TargetPoolsRemoveInstanceRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetPoolsRemoveInstanceRequest instances. + * @member {Array.} instances + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @instance + */ + TargetPoolsRemoveInstanceRequest.prototype.instances = $util.emptyArray; + + /** + * Creates a new TargetPoolsRemoveInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest} TargetPoolsRemoveInstanceRequest instance + */ + TargetPoolsRemoveInstanceRequest.create = function create(properties) { + return new TargetPoolsRemoveInstanceRequest(properties); + }; + + /** + * Encodes the specified TargetPoolsRemoveInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest} message TargetPoolsRemoveInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsRemoveInstanceRequest.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.compute.v1.InstanceReference.encode(message.instances[i], writer.uint32(/* id 29097598, wireType 2 =*/232780786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetPoolsRemoveInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest} message TargetPoolsRemoveInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetPoolsRemoveInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetPoolsRemoveInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest} TargetPoolsRemoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsRemoveInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 29097598: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.compute.v1.InstanceReference.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetPoolsRemoveInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest} TargetPoolsRemoveInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetPoolsRemoveInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetPoolsRemoveInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetPoolsRemoveInstanceRequest.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.compute.v1.InstanceReference.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + return null; + }; + + /** + * Creates a TargetPoolsRemoveInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest} TargetPoolsRemoveInstanceRequest + */ + TargetPoolsRemoveInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.instances: object expected"); + message.instances[i] = $root.google.cloud.compute.v1.InstanceReference.fromObject(object.instances[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetPoolsRemoveInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @static + * @param {google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest} message TargetPoolsRemoveInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetPoolsRemoveInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.compute.v1.InstanceReference.toObject(message.instances[j], options); + } + return object; + }; + + /** + * Converts this TargetPoolsRemoveInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + TargetPoolsRemoveInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetPoolsRemoveInstanceRequest; + })(); + + v1.TargetReference = (function() { + + /** + * Properties of a TargetReference. + * @memberof google.cloud.compute.v1 + * @interface ITargetReference + * @property {string|null} [target] TargetReference target + */ + + /** + * Constructs a new TargetReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetReference. + * @implements ITargetReference + * @constructor + * @param {google.cloud.compute.v1.ITargetReference=} [properties] Properties to set + */ + function TargetReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetReference target. + * @member {string|null|undefined} target + * @memberof google.cloud.compute.v1.TargetReference + * @instance + */ + TargetReference.prototype.target = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetReference _target. + * @member {"target"|undefined} _target + * @memberof google.cloud.compute.v1.TargetReference + * @instance + */ + Object.defineProperty(TargetReference.prototype, "_target", { + get: $util.oneOfGetter($oneOfFields = ["target"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {google.cloud.compute.v1.ITargetReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetReference} TargetReference instance + */ + TargetReference.create = function create(properties) { + return new TargetReference(properties); + }; + + /** + * Encodes the specified TargetReference message. Does not implicitly {@link google.cloud.compute.v1.TargetReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {google.cloud.compute.v1.ITargetReference} message TargetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 192835985, wireType 2 =*/1542687882).string(message.target); + return writer; + }; + + /** + * Encodes the specified TargetReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {google.cloud.compute.v1.ITargetReference} message TargetReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetReference} TargetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 192835985: + message.target = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetReference} TargetReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetReference message. + * @function verify + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.target != null && message.hasOwnProperty("target")) { + properties._target = 1; + if (!$util.isString(message.target)) + return "target: string expected"; + } + return null; + }; + + /** + * Creates a TargetReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetReference} TargetReference + */ + TargetReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetReference) + return object; + var message = new $root.google.cloud.compute.v1.TargetReference(); + if (object.target != null) + message.target = String(object.target); + return message; + }; + + /** + * Creates a plain object from a TargetReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetReference + * @static + * @param {google.cloud.compute.v1.TargetReference} message TargetReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.target != null && message.hasOwnProperty("target")) { + object.target = message.target; + if (options.oneofs) + object._target = "target"; + } + return object; + }; + + /** + * Converts this TargetReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetReference + * @instance + * @returns {Object.} JSON object + */ + TargetReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetReference; + })(); + + v1.TargetSslProxiesSetBackendServiceRequest = (function() { + + /** + * Properties of a TargetSslProxiesSetBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetSslProxiesSetBackendServiceRequest + * @property {string|null} [service] TargetSslProxiesSetBackendServiceRequest service + */ + + /** + * Constructs a new TargetSslProxiesSetBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetSslProxiesSetBackendServiceRequest. + * @implements ITargetSslProxiesSetBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest=} [properties] Properties to set + */ + function TargetSslProxiesSetBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetSslProxiesSetBackendServiceRequest service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @instance + */ + TargetSslProxiesSetBackendServiceRequest.prototype.service = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetSslProxiesSetBackendServiceRequest _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @instance + */ + Object.defineProperty(TargetSslProxiesSetBackendServiceRequest.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetSslProxiesSetBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest} TargetSslProxiesSetBackendServiceRequest instance + */ + TargetSslProxiesSetBackendServiceRequest.create = function create(properties) { + return new TargetSslProxiesSetBackendServiceRequest(properties); + }; + + /** + * Encodes the specified TargetSslProxiesSetBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest} message TargetSslProxiesSetBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxiesSetBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + return writer; + }; + + /** + * Encodes the specified TargetSslProxiesSetBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest} message TargetSslProxiesSetBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxiesSetBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetSslProxiesSetBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest} TargetSslProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxiesSetBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 373540533: + message.service = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetSslProxiesSetBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest} TargetSslProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxiesSetBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetSslProxiesSetBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetSslProxiesSetBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + return null; + }; + + /** + * Creates a TargetSslProxiesSetBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest} TargetSslProxiesSetBackendServiceRequest + */ + TargetSslProxiesSetBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a TargetSslProxiesSetBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest} message TargetSslProxiesSetBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetSslProxiesSetBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + return object; + }; + + /** + * Converts this TargetSslProxiesSetBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + TargetSslProxiesSetBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetSslProxiesSetBackendServiceRequest; + })(); + + v1.TargetSslProxiesSetProxyHeaderRequest = (function() { + + /** + * Properties of a TargetSslProxiesSetProxyHeaderRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetSslProxiesSetProxyHeaderRequest + * @property {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader|null} [proxyHeader] TargetSslProxiesSetProxyHeaderRequest proxyHeader + */ + + /** + * Constructs a new TargetSslProxiesSetProxyHeaderRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetSslProxiesSetProxyHeaderRequest. + * @implements ITargetSslProxiesSetProxyHeaderRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest=} [properties] Properties to set + */ + function TargetSslProxiesSetProxyHeaderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetSslProxiesSetProxyHeaderRequest proxyHeader. + * @member {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @instance + */ + TargetSslProxiesSetProxyHeaderRequest.prototype.proxyHeader = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetSslProxiesSetProxyHeaderRequest _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @instance + */ + Object.defineProperty(TargetSslProxiesSetProxyHeaderRequest.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetSslProxiesSetProxyHeaderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest} TargetSslProxiesSetProxyHeaderRequest instance + */ + TargetSslProxiesSetProxyHeaderRequest.create = function create(properties) { + return new TargetSslProxiesSetProxyHeaderRequest(properties); + }; + + /** + * Encodes the specified TargetSslProxiesSetProxyHeaderRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest} message TargetSslProxiesSetProxyHeaderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxiesSetProxyHeaderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + return writer; + }; + + /** + * Encodes the specified TargetSslProxiesSetProxyHeaderRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest} message TargetSslProxiesSetProxyHeaderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxiesSetProxyHeaderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetSslProxiesSetProxyHeaderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest} TargetSslProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxiesSetProxyHeaderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 160374142: + message.proxyHeader = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetSslProxiesSetProxyHeaderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest} TargetSslProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxiesSetProxyHeaderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetSslProxiesSetProxyHeaderRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetSslProxiesSetProxyHeaderRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + return null; + }; + + /** + * Creates a TargetSslProxiesSetProxyHeaderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest} TargetSslProxiesSetProxyHeaderRequest + */ + TargetSslProxiesSetProxyHeaderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest(); + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + return message; + }; + + /** + * Creates a plain object from a TargetSslProxiesSetProxyHeaderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest} message TargetSslProxiesSetProxyHeaderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetSslProxiesSetProxyHeaderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + return object; + }; + + /** + * Converts this TargetSslProxiesSetProxyHeaderRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest + * @instance + * @returns {Object.} JSON object + */ + TargetSslProxiesSetProxyHeaderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + TargetSslProxiesSetProxyHeaderRequest.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return TargetSslProxiesSetProxyHeaderRequest; + })(); + + v1.TargetSslProxiesSetSslCertificatesRequest = (function() { + + /** + * Properties of a TargetSslProxiesSetSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetSslProxiesSetSslCertificatesRequest + * @property {Array.|null} [sslCertificates] TargetSslProxiesSetSslCertificatesRequest sslCertificates + */ + + /** + * Constructs a new TargetSslProxiesSetSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetSslProxiesSetSslCertificatesRequest. + * @implements ITargetSslProxiesSetSslCertificatesRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest=} [properties] Properties to set + */ + function TargetSslProxiesSetSslCertificatesRequest(properties) { + this.sslCertificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetSslProxiesSetSslCertificatesRequest sslCertificates. + * @member {Array.} sslCertificates + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @instance + */ + TargetSslProxiesSetSslCertificatesRequest.prototype.sslCertificates = $util.emptyArray; + + /** + * Creates a new TargetSslProxiesSetSslCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest} TargetSslProxiesSetSslCertificatesRequest instance + */ + TargetSslProxiesSetSslCertificatesRequest.create = function create(properties) { + return new TargetSslProxiesSetSslCertificatesRequest(properties); + }; + + /** + * Encodes the specified TargetSslProxiesSetSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest} message TargetSslProxiesSetSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxiesSetSslCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslCertificates != null && message.sslCertificates.length) + for (var i = 0; i < message.sslCertificates.length; ++i) + writer.uint32(/* id 366006543, wireType 2 =*/2928052346).string(message.sslCertificates[i]); + return writer; + }; + + /** + * Encodes the specified TargetSslProxiesSetSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest} message TargetSslProxiesSetSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxiesSetSslCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetSslProxiesSetSslCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest} TargetSslProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxiesSetSslCertificatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 366006543: + if (!(message.sslCertificates && message.sslCertificates.length)) + message.sslCertificates = []; + message.sslCertificates.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetSslProxiesSetSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest} TargetSslProxiesSetSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxiesSetSslCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetSslProxiesSetSslCertificatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetSslProxiesSetSslCertificatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sslCertificates != null && message.hasOwnProperty("sslCertificates")) { + if (!Array.isArray(message.sslCertificates)) + return "sslCertificates: array expected"; + for (var i = 0; i < message.sslCertificates.length; ++i) + if (!$util.isString(message.sslCertificates[i])) + return "sslCertificates: string[] expected"; + } + return null; + }; + + /** + * Creates a TargetSslProxiesSetSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest} TargetSslProxiesSetSslCertificatesRequest + */ + TargetSslProxiesSetSslCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest(); + if (object.sslCertificates) { + if (!Array.isArray(object.sslCertificates)) + throw TypeError(".google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.sslCertificates: array expected"); + message.sslCertificates = []; + for (var i = 0; i < object.sslCertificates.length; ++i) + message.sslCertificates[i] = String(object.sslCertificates[i]); + } + return message; + }; + + /** + * Creates a plain object from a TargetSslProxiesSetSslCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest} message TargetSslProxiesSetSslCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetSslProxiesSetSslCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sslCertificates = []; + if (message.sslCertificates && message.sslCertificates.length) { + object.sslCertificates = []; + for (var j = 0; j < message.sslCertificates.length; ++j) + object.sslCertificates[j] = message.sslCertificates[j]; + } + return object; + }; + + /** + * Converts this TargetSslProxiesSetSslCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + TargetSslProxiesSetSslCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetSslProxiesSetSslCertificatesRequest; + })(); + + v1.TargetSslProxy = (function() { + + /** + * Properties of a TargetSslProxy. + * @memberof google.cloud.compute.v1 + * @interface ITargetSslProxy + * @property {string|null} [creationTimestamp] TargetSslProxy creationTimestamp + * @property {string|null} [description] TargetSslProxy description + * @property {number|Long|null} [id] TargetSslProxy id + * @property {string|null} [kind] TargetSslProxy kind + * @property {string|null} [name] TargetSslProxy name + * @property {google.cloud.compute.v1.TargetSslProxy.ProxyHeader|null} [proxyHeader] TargetSslProxy proxyHeader + * @property {string|null} [selfLink] TargetSslProxy selfLink + * @property {string|null} [service] TargetSslProxy service + * @property {Array.|null} [sslCertificates] TargetSslProxy sslCertificates + * @property {string|null} [sslPolicy] TargetSslProxy sslPolicy + */ + + /** + * Constructs a new TargetSslProxy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetSslProxy. + * @implements ITargetSslProxy + * @constructor + * @param {google.cloud.compute.v1.ITargetSslProxy=} [properties] Properties to set + */ + function TargetSslProxy(properties) { + this.sslCertificates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetSslProxy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.creationTimestamp = null; + + /** + * TargetSslProxy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.description = null; + + /** + * TargetSslProxy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.id = null; + + /** + * TargetSslProxy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.kind = null; + + /** + * TargetSslProxy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.name = null; + + /** + * TargetSslProxy proxyHeader. + * @member {google.cloud.compute.v1.TargetSslProxy.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.proxyHeader = null; + + /** + * TargetSslProxy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.selfLink = null; + + /** + * TargetSslProxy service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.service = null; + + /** + * TargetSslProxy sslCertificates. + * @member {Array.} sslCertificates + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.sslCertificates = $util.emptyArray; + + /** + * TargetSslProxy sslPolicy. + * @member {string|null|undefined} sslPolicy + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + TargetSslProxy.prototype.sslPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetSslProxy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxy _sslPolicy. + * @member {"sslPolicy"|undefined} _sslPolicy + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + */ + Object.defineProperty(TargetSslProxy.prototype, "_sslPolicy", { + get: $util.oneOfGetter($oneOfFields = ["sslPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetSslProxy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {google.cloud.compute.v1.ITargetSslProxy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetSslProxy} TargetSslProxy instance + */ + TargetSslProxy.create = function create(properties) { + return new TargetSslProxy(properties); + }; + + /** + * Encodes the specified TargetSslProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {google.cloud.compute.v1.ITargetSslProxy} message TargetSslProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + if (message.sslPolicy != null && Object.hasOwnProperty.call(message, "sslPolicy")) + writer.uint32(/* id 295190213, wireType 2 =*/2361521706).string(message.sslPolicy); + if (message.sslCertificates != null && message.sslCertificates.length) + for (var i = 0; i < message.sslCertificates.length; ++i) + writer.uint32(/* id 366006543, wireType 2 =*/2928052346).string(message.sslCertificates[i]); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetSslProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {google.cloud.compute.v1.ITargetSslProxy} message TargetSslProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetSslProxy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetSslProxy} TargetSslProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetSslProxy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 160374142: + message.proxyHeader = reader.int32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 373540533: + message.service = reader.string(); + break; + case 366006543: + if (!(message.sslCertificates && message.sslCertificates.length)) + message.sslCertificates = []; + message.sslCertificates.push(reader.string()); + break; + case 295190213: + message.sslPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetSslProxy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetSslProxy} TargetSslProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetSslProxy message. + * @function verify + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetSslProxy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + if (message.sslCertificates != null && message.hasOwnProperty("sslCertificates")) { + if (!Array.isArray(message.sslCertificates)) + return "sslCertificates: array expected"; + for (var i = 0; i < message.sslCertificates.length; ++i) + if (!$util.isString(message.sslCertificates[i])) + return "sslCertificates: string[] expected"; + } + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) { + properties._sslPolicy = 1; + if (!$util.isString(message.sslPolicy)) + return "sslPolicy: string expected"; + } + return null; + }; + + /** + * Creates a TargetSslProxy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetSslProxy} TargetSslProxy + */ + TargetSslProxy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetSslProxy) + return object; + var message = new $root.google.cloud.compute.v1.TargetSslProxy(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.service != null) + message.service = String(object.service); + if (object.sslCertificates) { + if (!Array.isArray(object.sslCertificates)) + throw TypeError(".google.cloud.compute.v1.TargetSslProxy.sslCertificates: array expected"); + message.sslCertificates = []; + for (var i = 0; i < object.sslCertificates.length; ++i) + message.sslCertificates[i] = String(object.sslCertificates[i]); + } + if (object.sslPolicy != null) + message.sslPolicy = String(object.sslPolicy); + return message; + }; + + /** + * Creates a plain object from a TargetSslProxy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetSslProxy + * @static + * @param {google.cloud.compute.v1.TargetSslProxy} message TargetSslProxy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetSslProxy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sslCertificates = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.TargetSslProxy.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) { + object.sslPolicy = message.sslPolicy; + if (options.oneofs) + object._sslPolicy = "sslPolicy"; + } + if (message.sslCertificates && message.sslCertificates.length) { + object.sslCertificates = []; + for (var j = 0; j < message.sslCertificates.length; ++j) + object.sslCertificates[j] = message.sslCertificates[j]; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetSslProxy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetSslProxy + * @instance + * @returns {Object.} JSON object + */ + TargetSslProxy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.TargetSslProxy.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + TargetSslProxy.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return TargetSslProxy; + })(); + + v1.TargetSslProxyList = (function() { + + /** + * Properties of a TargetSslProxyList. + * @memberof google.cloud.compute.v1 + * @interface ITargetSslProxyList + * @property {string|null} [id] TargetSslProxyList id + * @property {Array.|null} [items] TargetSslProxyList items + * @property {string|null} [kind] TargetSslProxyList kind + * @property {string|null} [nextPageToken] TargetSslProxyList nextPageToken + * @property {string|null} [selfLink] TargetSslProxyList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetSslProxyList warning + */ + + /** + * Constructs a new TargetSslProxyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetSslProxyList. + * @implements ITargetSslProxyList + * @constructor + * @param {google.cloud.compute.v1.ITargetSslProxyList=} [properties] Properties to set + */ + function TargetSslProxyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetSslProxyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + TargetSslProxyList.prototype.id = null; + + /** + * TargetSslProxyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + TargetSslProxyList.prototype.items = $util.emptyArray; + + /** + * TargetSslProxyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + TargetSslProxyList.prototype.kind = null; + + /** + * TargetSslProxyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + TargetSslProxyList.prototype.nextPageToken = null; + + /** + * TargetSslProxyList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + TargetSslProxyList.prototype.selfLink = null; + + /** + * TargetSslProxyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + TargetSslProxyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetSslProxyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + Object.defineProperty(TargetSslProxyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + Object.defineProperty(TargetSslProxyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + Object.defineProperty(TargetSslProxyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxyList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + Object.defineProperty(TargetSslProxyList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetSslProxyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + */ + Object.defineProperty(TargetSslProxyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetSslProxyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {google.cloud.compute.v1.ITargetSslProxyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetSslProxyList} TargetSslProxyList instance + */ + TargetSslProxyList.create = function create(properties) { + return new TargetSslProxyList(properties); + }; + + /** + * Encodes the specified TargetSslProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {google.cloud.compute.v1.ITargetSslProxyList} message TargetSslProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetSslProxy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetSslProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetSslProxyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {google.cloud.compute.v1.ITargetSslProxyList} message TargetSslProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetSslProxyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetSslProxyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetSslProxyList} TargetSslProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetSslProxyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetSslProxy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetSslProxyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetSslProxyList} TargetSslProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetSslProxyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetSslProxyList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetSslProxyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetSslProxy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetSslProxyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetSslProxyList} TargetSslProxyList + */ + TargetSslProxyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetSslProxyList) + return object; + var message = new $root.google.cloud.compute.v1.TargetSslProxyList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetSslProxyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetSslProxyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetSslProxy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetSslProxyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetSslProxyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @static + * @param {google.cloud.compute.v1.TargetSslProxyList} message TargetSslProxyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetSslProxyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetSslProxy.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetSslProxyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetSslProxyList + * @instance + * @returns {Object.} JSON object + */ + TargetSslProxyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetSslProxyList; + })(); + + v1.TargetTcpProxiesSetBackendServiceRequest = (function() { + + /** + * Properties of a TargetTcpProxiesSetBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetTcpProxiesSetBackendServiceRequest + * @property {string|null} [service] TargetTcpProxiesSetBackendServiceRequest service + */ + + /** + * Constructs a new TargetTcpProxiesSetBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetTcpProxiesSetBackendServiceRequest. + * @implements ITargetTcpProxiesSetBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest=} [properties] Properties to set + */ + function TargetTcpProxiesSetBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetTcpProxiesSetBackendServiceRequest service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @instance + */ + TargetTcpProxiesSetBackendServiceRequest.prototype.service = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetTcpProxiesSetBackendServiceRequest _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @instance + */ + Object.defineProperty(TargetTcpProxiesSetBackendServiceRequest.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetTcpProxiesSetBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest} TargetTcpProxiesSetBackendServiceRequest instance + */ + TargetTcpProxiesSetBackendServiceRequest.create = function create(properties) { + return new TargetTcpProxiesSetBackendServiceRequest(properties); + }; + + /** + * Encodes the specified TargetTcpProxiesSetBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest} message TargetTcpProxiesSetBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxiesSetBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + return writer; + }; + + /** + * Encodes the specified TargetTcpProxiesSetBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest} message TargetTcpProxiesSetBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxiesSetBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetTcpProxiesSetBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest} TargetTcpProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxiesSetBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 373540533: + message.service = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetTcpProxiesSetBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest} TargetTcpProxiesSetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxiesSetBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetTcpProxiesSetBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetTcpProxiesSetBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + return null; + }; + + /** + * Creates a TargetTcpProxiesSetBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest} TargetTcpProxiesSetBackendServiceRequest + */ + TargetTcpProxiesSetBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest(); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a TargetTcpProxiesSetBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest} message TargetTcpProxiesSetBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetTcpProxiesSetBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + return object; + }; + + /** + * Converts this TargetTcpProxiesSetBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + TargetTcpProxiesSetBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetTcpProxiesSetBackendServiceRequest; + })(); + + v1.TargetTcpProxiesSetProxyHeaderRequest = (function() { + + /** + * Properties of a TargetTcpProxiesSetProxyHeaderRequest. + * @memberof google.cloud.compute.v1 + * @interface ITargetTcpProxiesSetProxyHeaderRequest + * @property {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader|null} [proxyHeader] TargetTcpProxiesSetProxyHeaderRequest proxyHeader + */ + + /** + * Constructs a new TargetTcpProxiesSetProxyHeaderRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetTcpProxiesSetProxyHeaderRequest. + * @implements ITargetTcpProxiesSetProxyHeaderRequest + * @constructor + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest=} [properties] Properties to set + */ + function TargetTcpProxiesSetProxyHeaderRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetTcpProxiesSetProxyHeaderRequest proxyHeader. + * @member {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @instance + */ + TargetTcpProxiesSetProxyHeaderRequest.prototype.proxyHeader = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetTcpProxiesSetProxyHeaderRequest _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @instance + */ + Object.defineProperty(TargetTcpProxiesSetProxyHeaderRequest.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetTcpProxiesSetProxyHeaderRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest} TargetTcpProxiesSetProxyHeaderRequest instance + */ + TargetTcpProxiesSetProxyHeaderRequest.create = function create(properties) { + return new TargetTcpProxiesSetProxyHeaderRequest(properties); + }; + + /** + * Encodes the specified TargetTcpProxiesSetProxyHeaderRequest message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest} message TargetTcpProxiesSetProxyHeaderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxiesSetProxyHeaderRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + return writer; + }; + + /** + * Encodes the specified TargetTcpProxiesSetProxyHeaderRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest} message TargetTcpProxiesSetProxyHeaderRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxiesSetProxyHeaderRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetTcpProxiesSetProxyHeaderRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest} TargetTcpProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxiesSetProxyHeaderRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 160374142: + message.proxyHeader = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetTcpProxiesSetProxyHeaderRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest} TargetTcpProxiesSetProxyHeaderRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxiesSetProxyHeaderRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetTcpProxiesSetProxyHeaderRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetTcpProxiesSetProxyHeaderRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + return null; + }; + + /** + * Creates a TargetTcpProxiesSetProxyHeaderRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest} TargetTcpProxiesSetProxyHeaderRequest + */ + TargetTcpProxiesSetProxyHeaderRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest) + return object; + var message = new $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest(); + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + return message; + }; + + /** + * Creates a plain object from a TargetTcpProxiesSetProxyHeaderRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @static + * @param {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest} message TargetTcpProxiesSetProxyHeaderRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetTcpProxiesSetProxyHeaderRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + return object; + }; + + /** + * Converts this TargetTcpProxiesSetProxyHeaderRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest + * @instance + * @returns {Object.} JSON object + */ + TargetTcpProxiesSetProxyHeaderRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + TargetTcpProxiesSetProxyHeaderRequest.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return TargetTcpProxiesSetProxyHeaderRequest; + })(); + + v1.TargetTcpProxy = (function() { + + /** + * Properties of a TargetTcpProxy. + * @memberof google.cloud.compute.v1 + * @interface ITargetTcpProxy + * @property {string|null} [creationTimestamp] TargetTcpProxy creationTimestamp + * @property {string|null} [description] TargetTcpProxy description + * @property {number|Long|null} [id] TargetTcpProxy id + * @property {string|null} [kind] TargetTcpProxy kind + * @property {string|null} [name] TargetTcpProxy name + * @property {boolean|null} [proxyBind] TargetTcpProxy proxyBind + * @property {google.cloud.compute.v1.TargetTcpProxy.ProxyHeader|null} [proxyHeader] TargetTcpProxy proxyHeader + * @property {string|null} [selfLink] TargetTcpProxy selfLink + * @property {string|null} [service] TargetTcpProxy service + */ + + /** + * Constructs a new TargetTcpProxy. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetTcpProxy. + * @implements ITargetTcpProxy + * @constructor + * @param {google.cloud.compute.v1.ITargetTcpProxy=} [properties] Properties to set + */ + function TargetTcpProxy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetTcpProxy creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.creationTimestamp = null; + + /** + * TargetTcpProxy description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.description = null; + + /** + * TargetTcpProxy id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.id = null; + + /** + * TargetTcpProxy kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.kind = null; + + /** + * TargetTcpProxy name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.name = null; + + /** + * TargetTcpProxy proxyBind. + * @member {boolean|null|undefined} proxyBind + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.proxyBind = null; + + /** + * TargetTcpProxy proxyHeader. + * @member {google.cloud.compute.v1.TargetTcpProxy.ProxyHeader|null|undefined} proxyHeader + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.proxyHeader = null; + + /** + * TargetTcpProxy selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.selfLink = null; + + /** + * TargetTcpProxy service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + TargetTcpProxy.prototype.service = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetTcpProxy _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _proxyBind. + * @member {"proxyBind"|undefined} _proxyBind + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_proxyBind", { + get: $util.oneOfGetter($oneOfFields = ["proxyBind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _proxyHeader. + * @member {"proxyHeader"|undefined} _proxyHeader + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_proxyHeader", { + get: $util.oneOfGetter($oneOfFields = ["proxyHeader"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxy _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + */ + Object.defineProperty(TargetTcpProxy.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetTcpProxy instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxy=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetTcpProxy} TargetTcpProxy instance + */ + TargetTcpProxy.create = function create(properties) { + return new TargetTcpProxy(properties); + }; + + /** + * Encodes the specified TargetTcpProxy message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxy.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxy} message TargetTcpProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.proxyHeader != null && Object.hasOwnProperty.call(message, "proxyHeader")) + writer.uint32(/* id 160374142, wireType 0 =*/1282993136).int32(message.proxyHeader); + if (message.proxyBind != null && Object.hasOwnProperty.call(message, "proxyBind")) + writer.uint32(/* id 286025582, wireType 0 =*/2288204656).bool(message.proxyBind); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetTcpProxy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxy} message TargetTcpProxy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetTcpProxy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetTcpProxy} TargetTcpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetTcpProxy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 286025582: + message.proxyBind = reader.bool(); + break; + case 160374142: + message.proxyHeader = reader.int32(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 373540533: + message.service = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetTcpProxy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetTcpProxy} TargetTcpProxy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetTcpProxy message. + * @function verify + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetTcpProxy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.proxyBind != null && message.hasOwnProperty("proxyBind")) { + properties._proxyBind = 1; + if (typeof message.proxyBind !== "boolean") + return "proxyBind: boolean expected"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + properties._proxyHeader = 1; + switch (message.proxyHeader) { + default: + return "proxyHeader: enum value expected"; + case 0: + case 2402104: + case 334352940: + break; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + return null; + }; + + /** + * Creates a TargetTcpProxy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetTcpProxy} TargetTcpProxy + */ + TargetTcpProxy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetTcpProxy) + return object; + var message = new $root.google.cloud.compute.v1.TargetTcpProxy(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.proxyBind != null) + message.proxyBind = Boolean(object.proxyBind); + switch (object.proxyHeader) { + case "UNDEFINED_PROXY_HEADER": + case 0: + message.proxyHeader = 0; + break; + case "NONE": + case 2402104: + message.proxyHeader = 2402104; + break; + case "PROXY_V1": + case 334352940: + message.proxyHeader = 334352940; + break; + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a TargetTcpProxy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @static + * @param {google.cloud.compute.v1.TargetTcpProxy} message TargetTcpProxy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetTcpProxy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.proxyHeader != null && message.hasOwnProperty("proxyHeader")) { + object.proxyHeader = options.enums === String ? $root.google.cloud.compute.v1.TargetTcpProxy.ProxyHeader[message.proxyHeader] : message.proxyHeader; + if (options.oneofs) + object._proxyHeader = "proxyHeader"; + } + if (message.proxyBind != null && message.hasOwnProperty("proxyBind")) { + object.proxyBind = message.proxyBind; + if (options.oneofs) + object._proxyBind = "proxyBind"; + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetTcpProxy to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetTcpProxy + * @instance + * @returns {Object.} JSON object + */ + TargetTcpProxy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * ProxyHeader enum. + * @name google.cloud.compute.v1.TargetTcpProxy.ProxyHeader + * @enum {number} + * @property {number} UNDEFINED_PROXY_HEADER=0 UNDEFINED_PROXY_HEADER value + * @property {number} NONE=2402104 NONE value + * @property {number} PROXY_V1=334352940 PROXY_V1 value + */ + TargetTcpProxy.ProxyHeader = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_PROXY_HEADER"] = 0; + values[valuesById[2402104] = "NONE"] = 2402104; + values[valuesById[334352940] = "PROXY_V1"] = 334352940; + return values; + })(); + + return TargetTcpProxy; + })(); + + v1.TargetTcpProxyList = (function() { + + /** + * Properties of a TargetTcpProxyList. + * @memberof google.cloud.compute.v1 + * @interface ITargetTcpProxyList + * @property {string|null} [id] TargetTcpProxyList id + * @property {Array.|null} [items] TargetTcpProxyList items + * @property {string|null} [kind] TargetTcpProxyList kind + * @property {string|null} [nextPageToken] TargetTcpProxyList nextPageToken + * @property {string|null} [selfLink] TargetTcpProxyList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetTcpProxyList warning + */ + + /** + * Constructs a new TargetTcpProxyList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetTcpProxyList. + * @implements ITargetTcpProxyList + * @constructor + * @param {google.cloud.compute.v1.ITargetTcpProxyList=} [properties] Properties to set + */ + function TargetTcpProxyList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetTcpProxyList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + TargetTcpProxyList.prototype.id = null; + + /** + * TargetTcpProxyList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + TargetTcpProxyList.prototype.items = $util.emptyArray; + + /** + * TargetTcpProxyList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + TargetTcpProxyList.prototype.kind = null; + + /** + * TargetTcpProxyList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + TargetTcpProxyList.prototype.nextPageToken = null; + + /** + * TargetTcpProxyList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + TargetTcpProxyList.prototype.selfLink = null; + + /** + * TargetTcpProxyList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + TargetTcpProxyList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetTcpProxyList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + Object.defineProperty(TargetTcpProxyList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxyList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + Object.defineProperty(TargetTcpProxyList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxyList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + Object.defineProperty(TargetTcpProxyList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxyList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + Object.defineProperty(TargetTcpProxyList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetTcpProxyList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + */ + Object.defineProperty(TargetTcpProxyList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetTcpProxyList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxyList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetTcpProxyList} TargetTcpProxyList instance + */ + TargetTcpProxyList.create = function create(properties) { + return new TargetTcpProxyList(properties); + }; + + /** + * Encodes the specified TargetTcpProxyList message. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxyList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxyList} message TargetTcpProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxyList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetTcpProxy.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetTcpProxyList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetTcpProxyList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {google.cloud.compute.v1.ITargetTcpProxyList} message TargetTcpProxyList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetTcpProxyList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetTcpProxyList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetTcpProxyList} TargetTcpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxyList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetTcpProxyList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetTcpProxy.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetTcpProxyList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetTcpProxyList} TargetTcpProxyList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetTcpProxyList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetTcpProxyList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetTcpProxyList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetTcpProxy.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetTcpProxyList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetTcpProxyList} TargetTcpProxyList + */ + TargetTcpProxyList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetTcpProxyList) + return object; + var message = new $root.google.cloud.compute.v1.TargetTcpProxyList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetTcpProxyList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetTcpProxyList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetTcpProxy.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetTcpProxyList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetTcpProxyList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @static + * @param {google.cloud.compute.v1.TargetTcpProxyList} message TargetTcpProxyList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetTcpProxyList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetTcpProxy.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetTcpProxyList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetTcpProxyList + * @instance + * @returns {Object.} JSON object + */ + TargetTcpProxyList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetTcpProxyList; + })(); + + v1.TargetVpnGateway = (function() { + + /** + * Properties of a TargetVpnGateway. + * @memberof google.cloud.compute.v1 + * @interface ITargetVpnGateway + * @property {string|null} [creationTimestamp] TargetVpnGateway creationTimestamp + * @property {string|null} [description] TargetVpnGateway description + * @property {Array.|null} [forwardingRules] TargetVpnGateway forwardingRules + * @property {number|Long|null} [id] TargetVpnGateway id + * @property {string|null} [kind] TargetVpnGateway kind + * @property {string|null} [name] TargetVpnGateway name + * @property {string|null} [network] TargetVpnGateway network + * @property {string|null} [region] TargetVpnGateway region + * @property {string|null} [selfLink] TargetVpnGateway selfLink + * @property {google.cloud.compute.v1.TargetVpnGateway.Status|null} [status] TargetVpnGateway status + * @property {Array.|null} [tunnels] TargetVpnGateway tunnels + */ + + /** + * Constructs a new TargetVpnGateway. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetVpnGateway. + * @implements ITargetVpnGateway + * @constructor + * @param {google.cloud.compute.v1.ITargetVpnGateway=} [properties] Properties to set + */ + function TargetVpnGateway(properties) { + this.forwardingRules = []; + this.tunnels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetVpnGateway creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.creationTimestamp = null; + + /** + * TargetVpnGateway description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.description = null; + + /** + * TargetVpnGateway forwardingRules. + * @member {Array.} forwardingRules + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.forwardingRules = $util.emptyArray; + + /** + * TargetVpnGateway id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.id = null; + + /** + * TargetVpnGateway kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.kind = null; + + /** + * TargetVpnGateway name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.name = null; + + /** + * TargetVpnGateway network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.network = null; + + /** + * TargetVpnGateway region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.region = null; + + /** + * TargetVpnGateway selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.selfLink = null; + + /** + * TargetVpnGateway status. + * @member {google.cloud.compute.v1.TargetVpnGateway.Status|null|undefined} status + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.status = null; + + /** + * TargetVpnGateway tunnels. + * @member {Array.} tunnels + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + TargetVpnGateway.prototype.tunnels = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetVpnGateway _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGateway _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + */ + Object.defineProperty(TargetVpnGateway.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetVpnGateway instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {google.cloud.compute.v1.ITargetVpnGateway=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetVpnGateway} TargetVpnGateway instance + */ + TargetVpnGateway.create = function create(properties) { + return new TargetVpnGateway(properties); + }; + + /** + * Encodes the specified TargetVpnGateway message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGateway.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {google.cloud.compute.v1.ITargetVpnGateway} message TargetVpnGateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGateway.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.tunnels != null && message.tunnels.length) + for (var i = 0; i < message.tunnels.length; ++i) + writer.uint32(/* id 104561931, wireType 2 =*/836495450).string(message.tunnels[i]); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.forwardingRules != null && message.forwardingRules.length) + for (var i = 0; i < message.forwardingRules.length; ++i) + writer.uint32(/* id 315821365, wireType 2 =*/2526570922).string(message.forwardingRules[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetVpnGateway message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGateway.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {google.cloud.compute.v1.ITargetVpnGateway} message TargetVpnGateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGateway.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetVpnGateway message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetVpnGateway} TargetVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGateway.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetVpnGateway(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 315821365: + if (!(message.forwardingRules && message.forwardingRules.length)) + message.forwardingRules = []; + message.forwardingRules.push(reader.string()); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 104561931: + if (!(message.tunnels && message.tunnels.length)) + message.tunnels = []; + message.tunnels.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetVpnGateway message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetVpnGateway} TargetVpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGateway.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetVpnGateway message. + * @function verify + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetVpnGateway.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.forwardingRules != null && message.hasOwnProperty("forwardingRules")) { + if (!Array.isArray(message.forwardingRules)) + return "forwardingRules: array expected"; + for (var i = 0; i < message.forwardingRules.length; ++i) + if (!$util.isString(message.forwardingRules[i])) + return "forwardingRules: string[] expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 455564985: + case 528602024: + case 455706685: + case 77848963: + break; + } + } + if (message.tunnels != null && message.hasOwnProperty("tunnels")) { + if (!Array.isArray(message.tunnels)) + return "tunnels: array expected"; + for (var i = 0; i < message.tunnels.length; ++i) + if (!$util.isString(message.tunnels[i])) + return "tunnels: string[] expected"; + } + return null; + }; + + /** + * Creates a TargetVpnGateway message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetVpnGateway} TargetVpnGateway + */ + TargetVpnGateway.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetVpnGateway) + return object; + var message = new $root.google.cloud.compute.v1.TargetVpnGateway(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.forwardingRules) { + if (!Array.isArray(object.forwardingRules)) + throw TypeError(".google.cloud.compute.v1.TargetVpnGateway.forwardingRules: array expected"); + message.forwardingRules = []; + for (var i = 0; i < object.forwardingRules.length; ++i) + message.forwardingRules[i] = String(object.forwardingRules[i]); + } + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "CREATING": + case 455564985: + message.status = 455564985; + break; + case "DELETING": + case 528602024: + message.status = 528602024; + break; + case "FAILED": + case 455706685: + message.status = 455706685; + break; + case "READY": + case 77848963: + message.status = 77848963; + break; + } + if (object.tunnels) { + if (!Array.isArray(object.tunnels)) + throw TypeError(".google.cloud.compute.v1.TargetVpnGateway.tunnels: array expected"); + message.tunnels = []; + for (var i = 0; i < object.tunnels.length; ++i) + message.tunnels[i] = String(object.tunnels[i]); + } + return message; + }; + + /** + * Creates a plain object from a TargetVpnGateway message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @static + * @param {google.cloud.compute.v1.TargetVpnGateway} message TargetVpnGateway + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetVpnGateway.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tunnels = []; + object.forwardingRules = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.tunnels && message.tunnels.length) { + object.tunnels = []; + for (var j = 0; j < message.tunnels.length; ++j) + object.tunnels[j] = message.tunnels[j]; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.TargetVpnGateway.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.forwardingRules && message.forwardingRules.length) { + object.forwardingRules = []; + for (var j = 0; j < message.forwardingRules.length; ++j) + object.forwardingRules[j] = message.forwardingRules[j]; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetVpnGateway to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetVpnGateway + * @instance + * @returns {Object.} JSON object + */ + TargetVpnGateway.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.TargetVpnGateway.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} CREATING=455564985 CREATING value + * @property {number} DELETING=528602024 DELETING value + * @property {number} FAILED=455706685 FAILED value + * @property {number} READY=77848963 READY value + */ + TargetVpnGateway.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[455564985] = "CREATING"] = 455564985; + values[valuesById[528602024] = "DELETING"] = 528602024; + values[valuesById[455706685] = "FAILED"] = 455706685; + values[valuesById[77848963] = "READY"] = 77848963; + return values; + })(); + + return TargetVpnGateway; + })(); + + v1.TargetVpnGatewaysScopedList = (function() { + + /** + * Properties of a TargetVpnGatewaysScopedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetVpnGatewaysScopedList + * @property {Array.|null} [targetVpnGateways] TargetVpnGatewaysScopedList targetVpnGateways + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetVpnGatewaysScopedList warning + */ + + /** + * Constructs a new TargetVpnGatewaysScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetVpnGatewaysScopedList. + * @implements ITargetVpnGatewaysScopedList + * @constructor + * @param {google.cloud.compute.v1.ITargetVpnGatewaysScopedList=} [properties] Properties to set + */ + function TargetVpnGatewaysScopedList(properties) { + this.targetVpnGateways = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetVpnGatewaysScopedList targetVpnGateways. + * @member {Array.} targetVpnGateways + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @instance + */ + TargetVpnGatewaysScopedList.prototype.targetVpnGateways = $util.emptyArray; + + /** + * TargetVpnGatewaysScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @instance + */ + TargetVpnGatewaysScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetVpnGatewaysScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @instance + */ + Object.defineProperty(TargetVpnGatewaysScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetVpnGatewaysScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewaysScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetVpnGatewaysScopedList} TargetVpnGatewaysScopedList instance + */ + TargetVpnGatewaysScopedList.create = function create(properties) { + return new TargetVpnGatewaysScopedList(properties); + }; + + /** + * Encodes the specified TargetVpnGatewaysScopedList message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewaysScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewaysScopedList} message TargetVpnGatewaysScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGatewaysScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.targetVpnGateways != null && message.targetVpnGateways.length) + for (var i = 0; i < message.targetVpnGateways.length; ++i) + $root.google.cloud.compute.v1.TargetVpnGateway.encode(message.targetVpnGateways[i], writer.uint32(/* id 401770888, wireType 2 =*/3214167106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetVpnGatewaysScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewaysScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewaysScopedList} message TargetVpnGatewaysScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGatewaysScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetVpnGatewaysScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetVpnGatewaysScopedList} TargetVpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGatewaysScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetVpnGatewaysScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 401770888: + if (!(message.targetVpnGateways && message.targetVpnGateways.length)) + message.targetVpnGateways = []; + message.targetVpnGateways.push($root.google.cloud.compute.v1.TargetVpnGateway.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetVpnGatewaysScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetVpnGatewaysScopedList} TargetVpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGatewaysScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetVpnGatewaysScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetVpnGatewaysScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetVpnGateways != null && message.hasOwnProperty("targetVpnGateways")) { + if (!Array.isArray(message.targetVpnGateways)) + return "targetVpnGateways: array expected"; + for (var i = 0; i < message.targetVpnGateways.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetVpnGateway.verify(message.targetVpnGateways[i]); + if (error) + return "targetVpnGateways." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetVpnGatewaysScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetVpnGatewaysScopedList} TargetVpnGatewaysScopedList + */ + TargetVpnGatewaysScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetVpnGatewaysScopedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetVpnGatewaysScopedList(); + if (object.targetVpnGateways) { + if (!Array.isArray(object.targetVpnGateways)) + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewaysScopedList.targetVpnGateways: array expected"); + message.targetVpnGateways = []; + for (var i = 0; i < object.targetVpnGateways.length; ++i) { + if (typeof object.targetVpnGateways[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewaysScopedList.targetVpnGateways: object expected"); + message.targetVpnGateways[i] = $root.google.cloud.compute.v1.TargetVpnGateway.fromObject(object.targetVpnGateways[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewaysScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetVpnGatewaysScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.TargetVpnGatewaysScopedList} message TargetVpnGatewaysScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetVpnGatewaysScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetVpnGateways = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.targetVpnGateways && message.targetVpnGateways.length) { + object.targetVpnGateways = []; + for (var j = 0; j < message.targetVpnGateways.length; ++j) + object.targetVpnGateways[j] = $root.google.cloud.compute.v1.TargetVpnGateway.toObject(message.targetVpnGateways[j], options); + } + return object; + }; + + /** + * Converts this TargetVpnGatewaysScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetVpnGatewaysScopedList + * @instance + * @returns {Object.} JSON object + */ + TargetVpnGatewaysScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetVpnGatewaysScopedList; + })(); + + v1.TargetVpnGatewayAggregatedList = (function() { + + /** + * Properties of a TargetVpnGatewayAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface ITargetVpnGatewayAggregatedList + * @property {string|null} [id] TargetVpnGatewayAggregatedList id + * @property {Object.|null} [items] TargetVpnGatewayAggregatedList items + * @property {string|null} [kind] TargetVpnGatewayAggregatedList kind + * @property {string|null} [nextPageToken] TargetVpnGatewayAggregatedList nextPageToken + * @property {string|null} [selfLink] TargetVpnGatewayAggregatedList selfLink + * @property {Array.|null} [unreachables] TargetVpnGatewayAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetVpnGatewayAggregatedList warning + */ + + /** + * Constructs a new TargetVpnGatewayAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetVpnGatewayAggregatedList. + * @implements ITargetVpnGatewayAggregatedList + * @constructor + * @param {google.cloud.compute.v1.ITargetVpnGatewayAggregatedList=} [properties] Properties to set + */ + function TargetVpnGatewayAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetVpnGatewayAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + TargetVpnGatewayAggregatedList.prototype.id = null; + + /** + * TargetVpnGatewayAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + TargetVpnGatewayAggregatedList.prototype.items = $util.emptyObject; + + /** + * TargetVpnGatewayAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + TargetVpnGatewayAggregatedList.prototype.kind = null; + + /** + * TargetVpnGatewayAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + TargetVpnGatewayAggregatedList.prototype.nextPageToken = null; + + /** + * TargetVpnGatewayAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + TargetVpnGatewayAggregatedList.prototype.selfLink = null; + + /** + * TargetVpnGatewayAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + TargetVpnGatewayAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * TargetVpnGatewayAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + TargetVpnGatewayAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetVpnGatewayAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(TargetVpnGatewayAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(TargetVpnGatewayAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(TargetVpnGatewayAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(TargetVpnGatewayAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(TargetVpnGatewayAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetVpnGatewayAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewayAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetVpnGatewayAggregatedList} TargetVpnGatewayAggregatedList instance + */ + TargetVpnGatewayAggregatedList.create = function create(properties) { + return new TargetVpnGatewayAggregatedList(properties); + }; + + /** + * Encodes the specified TargetVpnGatewayAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewayAggregatedList} message TargetVpnGatewayAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGatewayAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.TargetVpnGatewaysScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetVpnGatewayAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewayAggregatedList} message TargetVpnGatewayAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGatewayAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetVpnGatewayAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetVpnGatewayAggregatedList} TargetVpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGatewayAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetVpnGatewayAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.TargetVpnGatewaysScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetVpnGatewayAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetVpnGatewayAggregatedList} TargetVpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGatewayAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetVpnGatewayAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetVpnGatewayAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetVpnGatewaysScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetVpnGatewayAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetVpnGatewayAggregatedList} TargetVpnGatewayAggregatedList + */ + TargetVpnGatewayAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetVpnGatewayAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.TargetVpnGatewayAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewayAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewayAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.TargetVpnGatewaysScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewayAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewayAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetVpnGatewayAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.TargetVpnGatewayAggregatedList} message TargetVpnGatewayAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetVpnGatewayAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.TargetVpnGatewaysScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetVpnGatewayAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetVpnGatewayAggregatedList + * @instance + * @returns {Object.} JSON object + */ + TargetVpnGatewayAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetVpnGatewayAggregatedList; + })(); + + v1.TargetVpnGatewayList = (function() { + + /** + * Properties of a TargetVpnGatewayList. + * @memberof google.cloud.compute.v1 + * @interface ITargetVpnGatewayList + * @property {string|null} [id] TargetVpnGatewayList id + * @property {Array.|null} [items] TargetVpnGatewayList items + * @property {string|null} [kind] TargetVpnGatewayList kind + * @property {string|null} [nextPageToken] TargetVpnGatewayList nextPageToken + * @property {string|null} [selfLink] TargetVpnGatewayList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] TargetVpnGatewayList warning + */ + + /** + * Constructs a new TargetVpnGatewayList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetVpnGatewayList. + * @implements ITargetVpnGatewayList + * @constructor + * @param {google.cloud.compute.v1.ITargetVpnGatewayList=} [properties] Properties to set + */ + function TargetVpnGatewayList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetVpnGatewayList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + TargetVpnGatewayList.prototype.id = null; + + /** + * TargetVpnGatewayList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + TargetVpnGatewayList.prototype.items = $util.emptyArray; + + /** + * TargetVpnGatewayList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + TargetVpnGatewayList.prototype.kind = null; + + /** + * TargetVpnGatewayList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + TargetVpnGatewayList.prototype.nextPageToken = null; + + /** + * TargetVpnGatewayList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + TargetVpnGatewayList.prototype.selfLink = null; + + /** + * TargetVpnGatewayList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + TargetVpnGatewayList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetVpnGatewayList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + Object.defineProperty(TargetVpnGatewayList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + Object.defineProperty(TargetVpnGatewayList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + Object.defineProperty(TargetVpnGatewayList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + Object.defineProperty(TargetVpnGatewayList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TargetVpnGatewayList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + */ + Object.defineProperty(TargetVpnGatewayList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetVpnGatewayList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewayList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TargetVpnGatewayList} TargetVpnGatewayList instance + */ + TargetVpnGatewayList.create = function create(properties) { + return new TargetVpnGatewayList(properties); + }; + + /** + * Encodes the specified TargetVpnGatewayList message. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewayList} message TargetVpnGatewayList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGatewayList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.TargetVpnGateway.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified TargetVpnGatewayList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TargetVpnGatewayList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {google.cloud.compute.v1.ITargetVpnGatewayList} message TargetVpnGatewayList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetVpnGatewayList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetVpnGatewayList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TargetVpnGatewayList} TargetVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGatewayList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TargetVpnGatewayList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.TargetVpnGateway.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetVpnGatewayList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TargetVpnGatewayList} TargetVpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetVpnGatewayList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetVpnGatewayList message. + * @function verify + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetVpnGatewayList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.TargetVpnGateway.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a TargetVpnGatewayList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TargetVpnGatewayList} TargetVpnGatewayList + */ + TargetVpnGatewayList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TargetVpnGatewayList) + return object; + var message = new $root.google.cloud.compute.v1.TargetVpnGatewayList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewayList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewayList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.TargetVpnGateway.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.TargetVpnGatewayList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a TargetVpnGatewayList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @static + * @param {google.cloud.compute.v1.TargetVpnGatewayList} message TargetVpnGatewayList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetVpnGatewayList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.TargetVpnGateway.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this TargetVpnGatewayList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TargetVpnGatewayList + * @instance + * @returns {Object.} JSON object + */ + TargetVpnGatewayList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TargetVpnGatewayList; + })(); + + v1.UrlMapTestHeader = (function() { + + /** + * Properties of an UrlMapTestHeader. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapTestHeader + * @property {string|null} [name] UrlMapTestHeader name + * @property {string|null} [value] UrlMapTestHeader value + */ + + /** + * Constructs a new UrlMapTestHeader. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapTestHeader. + * @implements IUrlMapTestHeader + * @constructor + * @param {google.cloud.compute.v1.IUrlMapTestHeader=} [properties] Properties to set + */ + function UrlMapTestHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapTestHeader name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @instance + */ + UrlMapTestHeader.prototype.name = null; + + /** + * UrlMapTestHeader value. + * @member {string|null|undefined} value + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @instance + */ + UrlMapTestHeader.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapTestHeader _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @instance + */ + Object.defineProperty(UrlMapTestHeader.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapTestHeader _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @instance + */ + Object.defineProperty(UrlMapTestHeader.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapTestHeader instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {google.cloud.compute.v1.IUrlMapTestHeader=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapTestHeader} UrlMapTestHeader instance + */ + UrlMapTestHeader.create = function create(properties) { + return new UrlMapTestHeader(properties); + }; + + /** + * Encodes the specified UrlMapTestHeader message. Does not implicitly {@link google.cloud.compute.v1.UrlMapTestHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {google.cloud.compute.v1.IUrlMapTestHeader} message UrlMapTestHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapTestHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 111972721, wireType 2 =*/895781770).string(message.value); + return writer; + }; + + /** + * Encodes the specified UrlMapTestHeader message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapTestHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {google.cloud.compute.v1.IUrlMapTestHeader} message UrlMapTestHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapTestHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapTestHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapTestHeader} UrlMapTestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapTestHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapTestHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3373707: + message.name = reader.string(); + break; + case 111972721: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapTestHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapTestHeader} UrlMapTestHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapTestHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapTestHeader message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapTestHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates an UrlMapTestHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapTestHeader} UrlMapTestHeader + */ + UrlMapTestHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapTestHeader) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapTestHeader(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an UrlMapTestHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @static + * @param {google.cloud.compute.v1.UrlMapTestHeader} message UrlMapTestHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapTestHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this UrlMapTestHeader to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapTestHeader + * @instance + * @returns {Object.} JSON object + */ + UrlMapTestHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapTestHeader; + })(); + + v1.TestFailure = (function() { + + /** + * Properties of a TestFailure. + * @memberof google.cloud.compute.v1 + * @interface ITestFailure + * @property {string|null} [actualOutputUrl] TestFailure actualOutputUrl + * @property {number|null} [actualRedirectResponseCode] TestFailure actualRedirectResponseCode + * @property {string|null} [actualService] TestFailure actualService + * @property {string|null} [expectedOutputUrl] TestFailure expectedOutputUrl + * @property {number|null} [expectedRedirectResponseCode] TestFailure expectedRedirectResponseCode + * @property {string|null} [expectedService] TestFailure expectedService + * @property {Array.|null} [headers] TestFailure headers + * @property {string|null} [host] TestFailure host + * @property {string|null} [path] TestFailure path + */ + + /** + * Constructs a new TestFailure. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestFailure. + * @implements ITestFailure + * @constructor + * @param {google.cloud.compute.v1.ITestFailure=} [properties] Properties to set + */ + function TestFailure(properties) { + this.headers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestFailure actualOutputUrl. + * @member {string|null|undefined} actualOutputUrl + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.actualOutputUrl = null; + + /** + * TestFailure actualRedirectResponseCode. + * @member {number|null|undefined} actualRedirectResponseCode + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.actualRedirectResponseCode = null; + + /** + * TestFailure actualService. + * @member {string|null|undefined} actualService + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.actualService = null; + + /** + * TestFailure expectedOutputUrl. + * @member {string|null|undefined} expectedOutputUrl + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.expectedOutputUrl = null; + + /** + * TestFailure expectedRedirectResponseCode. + * @member {number|null|undefined} expectedRedirectResponseCode + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.expectedRedirectResponseCode = null; + + /** + * TestFailure expectedService. + * @member {string|null|undefined} expectedService + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.expectedService = null; + + /** + * TestFailure headers. + * @member {Array.} headers + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.headers = $util.emptyArray; + + /** + * TestFailure host. + * @member {string|null|undefined} host + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.host = null; + + /** + * TestFailure path. + * @member {string|null|undefined} path + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + TestFailure.prototype.path = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TestFailure _actualOutputUrl. + * @member {"actualOutputUrl"|undefined} _actualOutputUrl + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_actualOutputUrl", { + get: $util.oneOfGetter($oneOfFields = ["actualOutputUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TestFailure _actualRedirectResponseCode. + * @member {"actualRedirectResponseCode"|undefined} _actualRedirectResponseCode + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_actualRedirectResponseCode", { + get: $util.oneOfGetter($oneOfFields = ["actualRedirectResponseCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TestFailure _actualService. + * @member {"actualService"|undefined} _actualService + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_actualService", { + get: $util.oneOfGetter($oneOfFields = ["actualService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TestFailure _expectedOutputUrl. + * @member {"expectedOutputUrl"|undefined} _expectedOutputUrl + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_expectedOutputUrl", { + get: $util.oneOfGetter($oneOfFields = ["expectedOutputUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TestFailure _expectedRedirectResponseCode. + * @member {"expectedRedirectResponseCode"|undefined} _expectedRedirectResponseCode + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_expectedRedirectResponseCode", { + get: $util.oneOfGetter($oneOfFields = ["expectedRedirectResponseCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TestFailure _expectedService. + * @member {"expectedService"|undefined} _expectedService + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_expectedService", { + get: $util.oneOfGetter($oneOfFields = ["expectedService"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TestFailure _host. + * @member {"host"|undefined} _host + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_host", { + get: $util.oneOfGetter($oneOfFields = ["host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TestFailure _path. + * @member {"path"|undefined} _path + * @memberof google.cloud.compute.v1.TestFailure + * @instance + */ + Object.defineProperty(TestFailure.prototype, "_path", { + get: $util.oneOfGetter($oneOfFields = ["path"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TestFailure instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {google.cloud.compute.v1.ITestFailure=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestFailure} TestFailure instance + */ + TestFailure.create = function create(properties) { + return new TestFailure(properties); + }; + + /** + * Encodes the specified TestFailure message. Does not implicitly {@link google.cloud.compute.v1.TestFailure.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {google.cloud.compute.v1.ITestFailure} message TestFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestFailure.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3208616, wireType 2 =*/25668930).string(message.host); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3433509, wireType 2 =*/27468074).string(message.path); + if (message.expectedRedirectResponseCode != null && Object.hasOwnProperty.call(message, "expectedRedirectResponseCode")) + writer.uint32(/* id 18888047, wireType 0 =*/151104376).int32(message.expectedRedirectResponseCode); + if (message.actualRedirectResponseCode != null && Object.hasOwnProperty.call(message, "actualRedirectResponseCode")) + writer.uint32(/* id 42926553, wireType 0 =*/343412424).int32(message.actualRedirectResponseCode); + if (message.expectedService != null && Object.hasOwnProperty.call(message, "expectedService")) + writer.uint32(/* id 133987374, wireType 2 =*/1071898994).string(message.expectedService); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.compute.v1.UrlMapTestHeader.encode(message.headers[i], writer.uint32(/* id 258436998, wireType 2 =*/2067495986).fork()).ldelim(); + if (message.actualOutputUrl != null && Object.hasOwnProperty.call(message, "actualOutputUrl")) + writer.uint32(/* id 287075458, wireType 2 =*/2296603666).string(message.actualOutputUrl); + if (message.expectedOutputUrl != null && Object.hasOwnProperty.call(message, "expectedOutputUrl")) + writer.uint32(/* id 433967384, wireType 2 =*/3471739074).string(message.expectedOutputUrl); + if (message.actualService != null && Object.hasOwnProperty.call(message, "actualService")) + writer.uint32(/* id 440379652, wireType 2 =*/3523037218).string(message.actualService); + return writer; + }; + + /** + * Encodes the specified TestFailure message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestFailure.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {google.cloud.compute.v1.ITestFailure} message TestFailure message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestFailure.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestFailure message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestFailure} TestFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestFailure.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestFailure(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 287075458: + message.actualOutputUrl = reader.string(); + break; + case 42926553: + message.actualRedirectResponseCode = reader.int32(); + break; + case 440379652: + message.actualService = reader.string(); + break; + case 433967384: + message.expectedOutputUrl = reader.string(); + break; + case 18888047: + message.expectedRedirectResponseCode = reader.int32(); + break; + case 133987374: + message.expectedService = reader.string(); + break; + case 258436998: + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.compute.v1.UrlMapTestHeader.decode(reader, reader.uint32())); + break; + case 3208616: + message.host = reader.string(); + break; + case 3433509: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestFailure message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestFailure} TestFailure + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestFailure.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestFailure message. + * @function verify + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestFailure.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.actualOutputUrl != null && message.hasOwnProperty("actualOutputUrl")) { + properties._actualOutputUrl = 1; + if (!$util.isString(message.actualOutputUrl)) + return "actualOutputUrl: string expected"; + } + if (message.actualRedirectResponseCode != null && message.hasOwnProperty("actualRedirectResponseCode")) { + properties._actualRedirectResponseCode = 1; + if (!$util.isInteger(message.actualRedirectResponseCode)) + return "actualRedirectResponseCode: integer expected"; + } + if (message.actualService != null && message.hasOwnProperty("actualService")) { + properties._actualService = 1; + if (!$util.isString(message.actualService)) + return "actualService: string expected"; + } + if (message.expectedOutputUrl != null && message.hasOwnProperty("expectedOutputUrl")) { + properties._expectedOutputUrl = 1; + if (!$util.isString(message.expectedOutputUrl)) + return "expectedOutputUrl: string expected"; + } + if (message.expectedRedirectResponseCode != null && message.hasOwnProperty("expectedRedirectResponseCode")) { + properties._expectedRedirectResponseCode = 1; + if (!$util.isInteger(message.expectedRedirectResponseCode)) + return "expectedRedirectResponseCode: integer expected"; + } + if (message.expectedService != null && message.hasOwnProperty("expectedService")) { + properties._expectedService = 1; + if (!$util.isString(message.expectedService)) + return "expectedService: string expected"; + } + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.compute.v1.UrlMapTestHeader.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.host != null && message.hasOwnProperty("host")) { + properties._host = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.path != null && message.hasOwnProperty("path")) { + properties._path = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + return null; + }; + + /** + * Creates a TestFailure message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestFailure} TestFailure + */ + TestFailure.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestFailure) + return object; + var message = new $root.google.cloud.compute.v1.TestFailure(); + if (object.actualOutputUrl != null) + message.actualOutputUrl = String(object.actualOutputUrl); + if (object.actualRedirectResponseCode != null) + message.actualRedirectResponseCode = object.actualRedirectResponseCode | 0; + if (object.actualService != null) + message.actualService = String(object.actualService); + if (object.expectedOutputUrl != null) + message.expectedOutputUrl = String(object.expectedOutputUrl); + if (object.expectedRedirectResponseCode != null) + message.expectedRedirectResponseCode = object.expectedRedirectResponseCode | 0; + if (object.expectedService != null) + message.expectedService = String(object.expectedService); + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.compute.v1.TestFailure.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.compute.v1.TestFailure.headers: object expected"); + message.headers[i] = $root.google.cloud.compute.v1.UrlMapTestHeader.fromObject(object.headers[i]); + } + } + if (object.host != null) + message.host = String(object.host); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a TestFailure message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestFailure + * @static + * @param {google.cloud.compute.v1.TestFailure} message TestFailure + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestFailure.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.headers = []; + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object._host = "host"; + } + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object._path = "path"; + } + if (message.expectedRedirectResponseCode != null && message.hasOwnProperty("expectedRedirectResponseCode")) { + object.expectedRedirectResponseCode = message.expectedRedirectResponseCode; + if (options.oneofs) + object._expectedRedirectResponseCode = "expectedRedirectResponseCode"; + } + if (message.actualRedirectResponseCode != null && message.hasOwnProperty("actualRedirectResponseCode")) { + object.actualRedirectResponseCode = message.actualRedirectResponseCode; + if (options.oneofs) + object._actualRedirectResponseCode = "actualRedirectResponseCode"; + } + if (message.expectedService != null && message.hasOwnProperty("expectedService")) { + object.expectedService = message.expectedService; + if (options.oneofs) + object._expectedService = "expectedService"; + } + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.compute.v1.UrlMapTestHeader.toObject(message.headers[j], options); + } + if (message.actualOutputUrl != null && message.hasOwnProperty("actualOutputUrl")) { + object.actualOutputUrl = message.actualOutputUrl; + if (options.oneofs) + object._actualOutputUrl = "actualOutputUrl"; + } + if (message.expectedOutputUrl != null && message.hasOwnProperty("expectedOutputUrl")) { + object.expectedOutputUrl = message.expectedOutputUrl; + if (options.oneofs) + object._expectedOutputUrl = "expectedOutputUrl"; + } + if (message.actualService != null && message.hasOwnProperty("actualService")) { + object.actualService = message.actualService; + if (options.oneofs) + object._actualService = "actualService"; + } + return object; + }; + + /** + * Converts this TestFailure to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestFailure + * @instance + * @returns {Object.} JSON object + */ + TestFailure.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestFailure; + })(); + + v1.TestPermissionsRequest = (function() { + + /** + * Properties of a TestPermissionsRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestPermissionsRequest + * @property {Array.|null} [permissions] TestPermissionsRequest permissions + */ + + /** + * Constructs a new TestPermissionsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestPermissionsRequest. + * @implements ITestPermissionsRequest + * @constructor + * @param {google.cloud.compute.v1.ITestPermissionsRequest=} [properties] Properties to set + */ + function TestPermissionsRequest(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]]; + } + + /** + * TestPermissionsRequest permissions. + * @member {Array.} permissions + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @instance + */ + TestPermissionsRequest.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {google.cloud.compute.v1.ITestPermissionsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestPermissionsRequest} TestPermissionsRequest instance + */ + TestPermissionsRequest.create = function create(properties) { + return new TestPermissionsRequest(properties); + }; + + /** + * Encodes the specified TestPermissionsRequest message. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {google.cloud.compute.v1.ITestPermissionsRequest} message TestPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPermissionsRequest.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 59962500, wireType 2 =*/479700002).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestPermissionsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {google.cloud.compute.v1.ITestPermissionsRequest} message TestPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestPermissionsRequest} TestPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 59962500: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestPermissionsRequest} TestPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestPermissionsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestPermissionsRequest.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 TestPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestPermissionsRequest} TestPermissionsRequest + */ + TestPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestPermissionsRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestPermissionsRequest(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.compute.v1.TestPermissionsRequest.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 TestPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @static + * @param {google.cloud.compute.v1.TestPermissionsRequest} message TestPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestPermissionsRequest.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 TestPermissionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + TestPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestPermissionsRequest; + })(); + + v1.TestPermissionsResponse = (function() { + + /** + * Properties of a TestPermissionsResponse. + * @memberof google.cloud.compute.v1 + * @interface ITestPermissionsResponse + * @property {Array.|null} [permissions] TestPermissionsResponse permissions + */ + + /** + * Constructs a new TestPermissionsResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestPermissionsResponse. + * @implements ITestPermissionsResponse + * @constructor + * @param {google.cloud.compute.v1.ITestPermissionsResponse=} [properties] Properties to set + */ + function TestPermissionsResponse(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]]; + } + + /** + * TestPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @instance + */ + TestPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * Creates a new TestPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {google.cloud.compute.v1.ITestPermissionsResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestPermissionsResponse} TestPermissionsResponse instance + */ + TestPermissionsResponse.create = function create(properties) { + return new TestPermissionsResponse(properties); + }; + + /** + * Encodes the specified TestPermissionsResponse message. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {google.cloud.compute.v1.ITestPermissionsResponse} message TestPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPermissionsResponse.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 59962500, wireType 2 =*/479700002).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified TestPermissionsResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {google.cloud.compute.v1.ITestPermissionsResponse} message TestPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestPermissionsResponse} TestPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 59962500: + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestPermissionsResponse} TestPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestPermissionsResponse message. + * @function verify + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestPermissionsResponse.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 TestPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestPermissionsResponse} TestPermissionsResponse + */ + TestPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestPermissionsResponse) + return object; + var message = new $root.google.cloud.compute.v1.TestPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.compute.v1.TestPermissionsResponse.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 TestPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @static + * @param {google.cloud.compute.v1.TestPermissionsResponse} message TestPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestPermissionsResponse.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 TestPermissionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + TestPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestPermissionsResponse; + })(); + + v1.UrlMapTest = (function() { + + /** + * Properties of an UrlMapTest. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapTest + * @property {string|null} [description] UrlMapTest description + * @property {string|null} [expectedOutputUrl] UrlMapTest expectedOutputUrl + * @property {number|null} [expectedRedirectResponseCode] UrlMapTest expectedRedirectResponseCode + * @property {Array.|null} [headers] UrlMapTest headers + * @property {string|null} [host] UrlMapTest host + * @property {string|null} [path] UrlMapTest path + * @property {string|null} [service] UrlMapTest service + */ + + /** + * Constructs a new UrlMapTest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapTest. + * @implements IUrlMapTest + * @constructor + * @param {google.cloud.compute.v1.IUrlMapTest=} [properties] Properties to set + */ + function UrlMapTest(properties) { + this.headers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapTest description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + UrlMapTest.prototype.description = null; + + /** + * UrlMapTest expectedOutputUrl. + * @member {string|null|undefined} expectedOutputUrl + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + UrlMapTest.prototype.expectedOutputUrl = null; + + /** + * UrlMapTest expectedRedirectResponseCode. + * @member {number|null|undefined} expectedRedirectResponseCode + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + UrlMapTest.prototype.expectedRedirectResponseCode = null; + + /** + * UrlMapTest headers. + * @member {Array.} headers + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + UrlMapTest.prototype.headers = $util.emptyArray; + + /** + * UrlMapTest host. + * @member {string|null|undefined} host + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + UrlMapTest.prototype.host = null; + + /** + * UrlMapTest path. + * @member {string|null|undefined} path + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + UrlMapTest.prototype.path = null; + + /** + * UrlMapTest service. + * @member {string|null|undefined} service + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + UrlMapTest.prototype.service = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapTest _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + Object.defineProperty(UrlMapTest.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapTest _expectedOutputUrl. + * @member {"expectedOutputUrl"|undefined} _expectedOutputUrl + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + Object.defineProperty(UrlMapTest.prototype, "_expectedOutputUrl", { + get: $util.oneOfGetter($oneOfFields = ["expectedOutputUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapTest _expectedRedirectResponseCode. + * @member {"expectedRedirectResponseCode"|undefined} _expectedRedirectResponseCode + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + Object.defineProperty(UrlMapTest.prototype, "_expectedRedirectResponseCode", { + get: $util.oneOfGetter($oneOfFields = ["expectedRedirectResponseCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapTest _host. + * @member {"host"|undefined} _host + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + Object.defineProperty(UrlMapTest.prototype, "_host", { + get: $util.oneOfGetter($oneOfFields = ["host"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapTest _path. + * @member {"path"|undefined} _path + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + Object.defineProperty(UrlMapTest.prototype, "_path", { + get: $util.oneOfGetter($oneOfFields = ["path"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapTest _service. + * @member {"service"|undefined} _service + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + */ + Object.defineProperty(UrlMapTest.prototype, "_service", { + get: $util.oneOfGetter($oneOfFields = ["service"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapTest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {google.cloud.compute.v1.IUrlMapTest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapTest} UrlMapTest instance + */ + UrlMapTest.create = function create(properties) { + return new UrlMapTest(properties); + }; + + /** + * Encodes the specified UrlMapTest message. Does not implicitly {@link google.cloud.compute.v1.UrlMapTest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {google.cloud.compute.v1.IUrlMapTest} message UrlMapTest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapTest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3208616, wireType 2 =*/25668930).string(message.host); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3433509, wireType 2 =*/27468074).string(message.path); + if (message.expectedRedirectResponseCode != null && Object.hasOwnProperty.call(message, "expectedRedirectResponseCode")) + writer.uint32(/* id 18888047, wireType 0 =*/151104376).int32(message.expectedRedirectResponseCode); + if (message.headers != null && message.headers.length) + for (var i = 0; i < message.headers.length; ++i) + $root.google.cloud.compute.v1.UrlMapTestHeader.encode(message.headers[i], writer.uint32(/* id 258436998, wireType 2 =*/2067495986).fork()).ldelim(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 373540533, wireType 2 =*/2988324266).string(message.service); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.expectedOutputUrl != null && Object.hasOwnProperty.call(message, "expectedOutputUrl")) + writer.uint32(/* id 433967384, wireType 2 =*/3471739074).string(message.expectedOutputUrl); + return writer; + }; + + /** + * Encodes the specified UrlMapTest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapTest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {google.cloud.compute.v1.IUrlMapTest} message UrlMapTest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapTest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapTest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapTest} UrlMapTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapTest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapTest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 422937596: + message.description = reader.string(); + break; + case 433967384: + message.expectedOutputUrl = reader.string(); + break; + case 18888047: + message.expectedRedirectResponseCode = reader.int32(); + break; + case 258436998: + if (!(message.headers && message.headers.length)) + message.headers = []; + message.headers.push($root.google.cloud.compute.v1.UrlMapTestHeader.decode(reader, reader.uint32())); + break; + case 3208616: + message.host = reader.string(); + break; + case 3433509: + message.path = reader.string(); + break; + case 373540533: + message.service = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapTest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapTest} UrlMapTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapTest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapTest message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapTest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.expectedOutputUrl != null && message.hasOwnProperty("expectedOutputUrl")) { + properties._expectedOutputUrl = 1; + if (!$util.isString(message.expectedOutputUrl)) + return "expectedOutputUrl: string expected"; + } + if (message.expectedRedirectResponseCode != null && message.hasOwnProperty("expectedRedirectResponseCode")) { + properties._expectedRedirectResponseCode = 1; + if (!$util.isInteger(message.expectedRedirectResponseCode)) + return "expectedRedirectResponseCode: integer expected"; + } + if (message.headers != null && message.hasOwnProperty("headers")) { + if (!Array.isArray(message.headers)) + return "headers: array expected"; + for (var i = 0; i < message.headers.length; ++i) { + var error = $root.google.cloud.compute.v1.UrlMapTestHeader.verify(message.headers[i]); + if (error) + return "headers." + error; + } + } + if (message.host != null && message.hasOwnProperty("host")) { + properties._host = 1; + if (!$util.isString(message.host)) + return "host: string expected"; + } + if (message.path != null && message.hasOwnProperty("path")) { + properties._path = 1; + if (!$util.isString(message.path)) + return "path: string expected"; + } + if (message.service != null && message.hasOwnProperty("service")) { + properties._service = 1; + if (!$util.isString(message.service)) + return "service: string expected"; + } + return null; + }; + + /** + * Creates an UrlMapTest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapTest} UrlMapTest + */ + UrlMapTest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapTest) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapTest(); + if (object.description != null) + message.description = String(object.description); + if (object.expectedOutputUrl != null) + message.expectedOutputUrl = String(object.expectedOutputUrl); + if (object.expectedRedirectResponseCode != null) + message.expectedRedirectResponseCode = object.expectedRedirectResponseCode | 0; + if (object.headers) { + if (!Array.isArray(object.headers)) + throw TypeError(".google.cloud.compute.v1.UrlMapTest.headers: array expected"); + message.headers = []; + for (var i = 0; i < object.headers.length; ++i) { + if (typeof object.headers[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapTest.headers: object expected"); + message.headers[i] = $root.google.cloud.compute.v1.UrlMapTestHeader.fromObject(object.headers[i]); + } + } + if (object.host != null) + message.host = String(object.host); + if (object.path != null) + message.path = String(object.path); + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from an UrlMapTest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapTest + * @static + * @param {google.cloud.compute.v1.UrlMapTest} message UrlMapTest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapTest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.headers = []; + if (message.host != null && message.hasOwnProperty("host")) { + object.host = message.host; + if (options.oneofs) + object._host = "host"; + } + if (message.path != null && message.hasOwnProperty("path")) { + object.path = message.path; + if (options.oneofs) + object._path = "path"; + } + if (message.expectedRedirectResponseCode != null && message.hasOwnProperty("expectedRedirectResponseCode")) { + object.expectedRedirectResponseCode = message.expectedRedirectResponseCode; + if (options.oneofs) + object._expectedRedirectResponseCode = "expectedRedirectResponseCode"; + } + if (message.headers && message.headers.length) { + object.headers = []; + for (var j = 0; j < message.headers.length; ++j) + object.headers[j] = $root.google.cloud.compute.v1.UrlMapTestHeader.toObject(message.headers[j], options); + } + if (message.service != null && message.hasOwnProperty("service")) { + object.service = message.service; + if (options.oneofs) + object._service = "service"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.expectedOutputUrl != null && message.hasOwnProperty("expectedOutputUrl")) { + object.expectedOutputUrl = message.expectedOutputUrl; + if (options.oneofs) + object._expectedOutputUrl = "expectedOutputUrl"; + } + return object; + }; + + /** + * Converts this UrlMapTest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapTest + * @instance + * @returns {Object.} JSON object + */ + UrlMapTest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapTest; + })(); + + v1.UrlMapList = (function() { + + /** + * Properties of an UrlMapList. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapList + * @property {string|null} [id] UrlMapList id + * @property {Array.|null} [items] UrlMapList items + * @property {string|null} [kind] UrlMapList kind + * @property {string|null} [nextPageToken] UrlMapList nextPageToken + * @property {string|null} [selfLink] UrlMapList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] UrlMapList warning + */ + + /** + * Constructs a new UrlMapList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapList. + * @implements IUrlMapList + * @constructor + * @param {google.cloud.compute.v1.IUrlMapList=} [properties] Properties to set + */ + function UrlMapList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + UrlMapList.prototype.id = null; + + /** + * UrlMapList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + UrlMapList.prototype.items = $util.emptyArray; + + /** + * UrlMapList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + UrlMapList.prototype.kind = null; + + /** + * UrlMapList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + UrlMapList.prototype.nextPageToken = null; + + /** + * UrlMapList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + UrlMapList.prototype.selfLink = null; + + /** + * UrlMapList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + UrlMapList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + Object.defineProperty(UrlMapList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + Object.defineProperty(UrlMapList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + Object.defineProperty(UrlMapList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + Object.defineProperty(UrlMapList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + */ + Object.defineProperty(UrlMapList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {google.cloud.compute.v1.IUrlMapList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapList} UrlMapList instance + */ + UrlMapList.create = function create(properties) { + return new UrlMapList(properties); + }; + + /** + * Encodes the specified UrlMapList message. Does not implicitly {@link google.cloud.compute.v1.UrlMapList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {google.cloud.compute.v1.IUrlMapList} message UrlMapList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.UrlMap.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified UrlMapList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {google.cloud.compute.v1.IUrlMapList} message UrlMapList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapList} UrlMapList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapList} UrlMapList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapList message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an UrlMapList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapList} UrlMapList + */ + UrlMapList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapList) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.UrlMapList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.UrlMap.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an UrlMapList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapList + * @static + * @param {google.cloud.compute.v1.UrlMapList} message UrlMapList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.UrlMap.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this UrlMapList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapList + * @instance + * @returns {Object.} JSON object + */ + UrlMapList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapList; + })(); + + v1.UrlMapReference = (function() { + + /** + * Properties of an UrlMapReference. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapReference + * @property {string|null} [urlMap] UrlMapReference urlMap + */ + + /** + * Constructs a new UrlMapReference. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapReference. + * @implements IUrlMapReference + * @constructor + * @param {google.cloud.compute.v1.IUrlMapReference=} [properties] Properties to set + */ + function UrlMapReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapReference urlMap. + * @member {string|null|undefined} urlMap + * @memberof google.cloud.compute.v1.UrlMapReference + * @instance + */ + UrlMapReference.prototype.urlMap = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapReference _urlMap. + * @member {"urlMap"|undefined} _urlMap + * @memberof google.cloud.compute.v1.UrlMapReference + * @instance + */ + Object.defineProperty(UrlMapReference.prototype, "_urlMap", { + get: $util.oneOfGetter($oneOfFields = ["urlMap"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapReference instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {google.cloud.compute.v1.IUrlMapReference=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapReference} UrlMapReference instance + */ + UrlMapReference.create = function create(properties) { + return new UrlMapReference(properties); + }; + + /** + * Encodes the specified UrlMapReference message. Does not implicitly {@link google.cloud.compute.v1.UrlMapReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {google.cloud.compute.v1.IUrlMapReference} message UrlMapReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified UrlMapReference message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {google.cloud.compute.v1.IUrlMapReference} message UrlMapReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapReference} UrlMapReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapReference} UrlMapReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapReference message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + properties._urlMap = 1; + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + } + return null; + }; + + /** + * Creates an UrlMapReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapReference} UrlMapReference + */ + UrlMapReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapReference) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapReference(); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from an UrlMapReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapReference + * @static + * @param {google.cloud.compute.v1.UrlMapReference} message UrlMapReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) { + object.urlMap = message.urlMap; + if (options.oneofs) + object._urlMap = "urlMap"; + } + return object; + }; + + /** + * Converts this UrlMapReference to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapReference + * @instance + * @returns {Object.} JSON object + */ + UrlMapReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapReference; + })(); + + v1.UrlMapValidationResult = (function() { + + /** + * Properties of an UrlMapValidationResult. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapValidationResult + * @property {Array.|null} [loadErrors] UrlMapValidationResult loadErrors + * @property {boolean|null} [loadSucceeded] UrlMapValidationResult loadSucceeded + * @property {Array.|null} [testFailures] UrlMapValidationResult testFailures + * @property {boolean|null} [testPassed] UrlMapValidationResult testPassed + */ + + /** + * Constructs a new UrlMapValidationResult. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapValidationResult. + * @implements IUrlMapValidationResult + * @constructor + * @param {google.cloud.compute.v1.IUrlMapValidationResult=} [properties] Properties to set + */ + function UrlMapValidationResult(properties) { + this.loadErrors = []; + this.testFailures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapValidationResult loadErrors. + * @member {Array.} loadErrors + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @instance + */ + UrlMapValidationResult.prototype.loadErrors = $util.emptyArray; + + /** + * UrlMapValidationResult loadSucceeded. + * @member {boolean|null|undefined} loadSucceeded + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @instance + */ + UrlMapValidationResult.prototype.loadSucceeded = null; + + /** + * UrlMapValidationResult testFailures. + * @member {Array.} testFailures + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @instance + */ + UrlMapValidationResult.prototype.testFailures = $util.emptyArray; + + /** + * UrlMapValidationResult testPassed. + * @member {boolean|null|undefined} testPassed + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @instance + */ + UrlMapValidationResult.prototype.testPassed = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapValidationResult _loadSucceeded. + * @member {"loadSucceeded"|undefined} _loadSucceeded + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @instance + */ + Object.defineProperty(UrlMapValidationResult.prototype, "_loadSucceeded", { + get: $util.oneOfGetter($oneOfFields = ["loadSucceeded"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapValidationResult _testPassed. + * @member {"testPassed"|undefined} _testPassed + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @instance + */ + Object.defineProperty(UrlMapValidationResult.prototype, "_testPassed", { + get: $util.oneOfGetter($oneOfFields = ["testPassed"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {google.cloud.compute.v1.IUrlMapValidationResult=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapValidationResult} UrlMapValidationResult instance + */ + UrlMapValidationResult.create = function create(properties) { + return new UrlMapValidationResult(properties); + }; + + /** + * Encodes the specified UrlMapValidationResult message. Does not implicitly {@link google.cloud.compute.v1.UrlMapValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {google.cloud.compute.v1.IUrlMapValidationResult} message UrlMapValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapValidationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.loadSucceeded != null && Object.hasOwnProperty.call(message, "loadSucceeded")) + writer.uint32(/* id 128326216, wireType 0 =*/1026609728).bool(message.loadSucceeded); + if (message.testPassed != null && Object.hasOwnProperty.call(message, "testPassed")) + writer.uint32(/* id 192708797, wireType 0 =*/1541670376).bool(message.testPassed); + if (message.loadErrors != null && message.loadErrors.length) + for (var i = 0; i < message.loadErrors.length; ++i) + writer.uint32(/* id 310147300, wireType 2 =*/2481178402).string(message.loadErrors[i]); + if (message.testFailures != null && message.testFailures.length) + for (var i = 0; i < message.testFailures.length; ++i) + $root.google.cloud.compute.v1.TestFailure.encode(message.testFailures[i], writer.uint32(/* id 505934134, wireType 2 =*/4047473074).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UrlMapValidationResult message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {google.cloud.compute.v1.IUrlMapValidationResult} message UrlMapValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapValidationResult} UrlMapValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapValidationResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 310147300: + if (!(message.loadErrors && message.loadErrors.length)) + message.loadErrors = []; + message.loadErrors.push(reader.string()); + break; + case 128326216: + message.loadSucceeded = reader.bool(); + break; + case 505934134: + if (!(message.testFailures && message.testFailures.length)) + message.testFailures = []; + message.testFailures.push($root.google.cloud.compute.v1.TestFailure.decode(reader, reader.uint32())); + break; + case 192708797: + message.testPassed = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapValidationResult} UrlMapValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapValidationResult message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapValidationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.loadErrors != null && message.hasOwnProperty("loadErrors")) { + if (!Array.isArray(message.loadErrors)) + return "loadErrors: array expected"; + for (var i = 0; i < message.loadErrors.length; ++i) + if (!$util.isString(message.loadErrors[i])) + return "loadErrors: string[] expected"; + } + if (message.loadSucceeded != null && message.hasOwnProperty("loadSucceeded")) { + properties._loadSucceeded = 1; + if (typeof message.loadSucceeded !== "boolean") + return "loadSucceeded: boolean expected"; + } + if (message.testFailures != null && message.hasOwnProperty("testFailures")) { + if (!Array.isArray(message.testFailures)) + return "testFailures: array expected"; + for (var i = 0; i < message.testFailures.length; ++i) { + var error = $root.google.cloud.compute.v1.TestFailure.verify(message.testFailures[i]); + if (error) + return "testFailures." + error; + } + } + if (message.testPassed != null && message.hasOwnProperty("testPassed")) { + properties._testPassed = 1; + if (typeof message.testPassed !== "boolean") + return "testPassed: boolean expected"; + } + return null; + }; + + /** + * Creates an UrlMapValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapValidationResult} UrlMapValidationResult + */ + UrlMapValidationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapValidationResult) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapValidationResult(); + if (object.loadErrors) { + if (!Array.isArray(object.loadErrors)) + throw TypeError(".google.cloud.compute.v1.UrlMapValidationResult.loadErrors: array expected"); + message.loadErrors = []; + for (var i = 0; i < object.loadErrors.length; ++i) + message.loadErrors[i] = String(object.loadErrors[i]); + } + if (object.loadSucceeded != null) + message.loadSucceeded = Boolean(object.loadSucceeded); + if (object.testFailures) { + if (!Array.isArray(object.testFailures)) + throw TypeError(".google.cloud.compute.v1.UrlMapValidationResult.testFailures: array expected"); + message.testFailures = []; + for (var i = 0; i < object.testFailures.length; ++i) { + if (typeof object.testFailures[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapValidationResult.testFailures: object expected"); + message.testFailures[i] = $root.google.cloud.compute.v1.TestFailure.fromObject(object.testFailures[i]); + } + } + if (object.testPassed != null) + message.testPassed = Boolean(object.testPassed); + return message; + }; + + /** + * Creates a plain object from an UrlMapValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @static + * @param {google.cloud.compute.v1.UrlMapValidationResult} message UrlMapValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.loadErrors = []; + object.testFailures = []; + } + if (message.loadSucceeded != null && message.hasOwnProperty("loadSucceeded")) { + object.loadSucceeded = message.loadSucceeded; + if (options.oneofs) + object._loadSucceeded = "loadSucceeded"; + } + if (message.testPassed != null && message.hasOwnProperty("testPassed")) { + object.testPassed = message.testPassed; + if (options.oneofs) + object._testPassed = "testPassed"; + } + if (message.loadErrors && message.loadErrors.length) { + object.loadErrors = []; + for (var j = 0; j < message.loadErrors.length; ++j) + object.loadErrors[j] = message.loadErrors[j]; + } + if (message.testFailures && message.testFailures.length) { + object.testFailures = []; + for (var j = 0; j < message.testFailures.length; ++j) + object.testFailures[j] = $root.google.cloud.compute.v1.TestFailure.toObject(message.testFailures[j], options); + } + return object; + }; + + /** + * Converts this UrlMapValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapValidationResult + * @instance + * @returns {Object.} JSON object + */ + UrlMapValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapValidationResult; + })(); + + v1.UrlMapsScopedList = (function() { + + /** + * Properties of an UrlMapsScopedList. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapsScopedList + * @property {Array.|null} [urlMaps] UrlMapsScopedList urlMaps + * @property {google.cloud.compute.v1.IWarning|null} [warning] UrlMapsScopedList warning + */ + + /** + * Constructs a new UrlMapsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapsScopedList. + * @implements IUrlMapsScopedList + * @constructor + * @param {google.cloud.compute.v1.IUrlMapsScopedList=} [properties] Properties to set + */ + function UrlMapsScopedList(properties) { + this.urlMaps = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapsScopedList urlMaps. + * @member {Array.} urlMaps + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @instance + */ + UrlMapsScopedList.prototype.urlMaps = $util.emptyArray; + + /** + * UrlMapsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @instance + */ + UrlMapsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @instance + */ + Object.defineProperty(UrlMapsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {google.cloud.compute.v1.IUrlMapsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapsScopedList} UrlMapsScopedList instance + */ + UrlMapsScopedList.create = function create(properties) { + return new UrlMapsScopedList(properties); + }; + + /** + * Encodes the specified UrlMapsScopedList message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {google.cloud.compute.v1.IUrlMapsScopedList} message UrlMapsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.urlMaps != null && message.urlMaps.length) + for (var i = 0; i < message.urlMaps.length; ++i) + $root.google.cloud.compute.v1.UrlMap.encode(message.urlMaps[i], writer.uint32(/* id 103352167, wireType 2 =*/826817338).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UrlMapsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {google.cloud.compute.v1.IUrlMapsScopedList} message UrlMapsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapsScopedList} UrlMapsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 103352167: + if (!(message.urlMaps && message.urlMaps.length)) + message.urlMaps = []; + message.urlMaps.push($root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapsScopedList} UrlMapsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.urlMaps != null && message.hasOwnProperty("urlMaps")) { + if (!Array.isArray(message.urlMaps)) + return "urlMaps: array expected"; + for (var i = 0; i < message.urlMaps.length; ++i) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.urlMaps[i]); + if (error) + return "urlMaps." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an UrlMapsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapsScopedList} UrlMapsScopedList + */ + UrlMapsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapsScopedList(); + if (object.urlMaps) { + if (!Array.isArray(object.urlMaps)) + throw TypeError(".google.cloud.compute.v1.UrlMapsScopedList.urlMaps: array expected"); + message.urlMaps = []; + for (var i = 0; i < object.urlMaps.length; ++i) { + if (typeof object.urlMaps[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapsScopedList.urlMaps: object expected"); + message.urlMaps[i] = $root.google.cloud.compute.v1.UrlMap.fromObject(object.urlMaps[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an UrlMapsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @static + * @param {google.cloud.compute.v1.UrlMapsScopedList} message UrlMapsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.urlMaps = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.urlMaps && message.urlMaps.length) { + object.urlMaps = []; + for (var j = 0; j < message.urlMaps.length; ++j) + object.urlMaps[j] = $root.google.cloud.compute.v1.UrlMap.toObject(message.urlMaps[j], options); + } + return object; + }; + + /** + * Converts this UrlMapsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapsScopedList + * @instance + * @returns {Object.} JSON object + */ + UrlMapsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapsScopedList; + })(); + + v1.UrlMapsAggregatedList = (function() { + + /** + * Properties of an UrlMapsAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapsAggregatedList + * @property {string|null} [id] UrlMapsAggregatedList id + * @property {Object.|null} [items] UrlMapsAggregatedList items + * @property {string|null} [kind] UrlMapsAggregatedList kind + * @property {string|null} [nextPageToken] UrlMapsAggregatedList nextPageToken + * @property {string|null} [selfLink] UrlMapsAggregatedList selfLink + * @property {Array.|null} [unreachables] UrlMapsAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] UrlMapsAggregatedList warning + */ + + /** + * Constructs a new UrlMapsAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapsAggregatedList. + * @implements IUrlMapsAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IUrlMapsAggregatedList=} [properties] Properties to set + */ + function UrlMapsAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapsAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + UrlMapsAggregatedList.prototype.id = null; + + /** + * UrlMapsAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + UrlMapsAggregatedList.prototype.items = $util.emptyObject; + + /** + * UrlMapsAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + UrlMapsAggregatedList.prototype.kind = null; + + /** + * UrlMapsAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + UrlMapsAggregatedList.prototype.nextPageToken = null; + + /** + * UrlMapsAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + UrlMapsAggregatedList.prototype.selfLink = null; + + /** + * UrlMapsAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + UrlMapsAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * UrlMapsAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + UrlMapsAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapsAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + Object.defineProperty(UrlMapsAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapsAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + Object.defineProperty(UrlMapsAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapsAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + Object.defineProperty(UrlMapsAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapsAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + Object.defineProperty(UrlMapsAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UrlMapsAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + */ + Object.defineProperty(UrlMapsAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapsAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {google.cloud.compute.v1.IUrlMapsAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapsAggregatedList} UrlMapsAggregatedList instance + */ + UrlMapsAggregatedList.create = function create(properties) { + return new UrlMapsAggregatedList(properties); + }; + + /** + * Encodes the specified UrlMapsAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {google.cloud.compute.v1.IUrlMapsAggregatedList} message UrlMapsAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.UrlMapsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified UrlMapsAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {google.cloud.compute.v1.IUrlMapsAggregatedList} message UrlMapsAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapsAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapsAggregatedList} UrlMapsAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapsAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.UrlMapsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapsAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapsAggregatedList} UrlMapsAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapsAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapsAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.UrlMapsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates an UrlMapsAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapsAggregatedList} UrlMapsAggregatedList + */ + UrlMapsAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapsAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapsAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapsAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapsAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.UrlMapsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.UrlMapsAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapsAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from an UrlMapsAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @static + * @param {google.cloud.compute.v1.UrlMapsAggregatedList} message UrlMapsAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapsAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.UrlMapsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this UrlMapsAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapsAggregatedList + * @instance + * @returns {Object.} JSON object + */ + UrlMapsAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapsAggregatedList; + })(); + + v1.UrlMapsValidateRequest = (function() { + + /** + * Properties of an UrlMapsValidateRequest. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapsValidateRequest + * @property {google.cloud.compute.v1.IUrlMap|null} [resource] UrlMapsValidateRequest resource + */ + + /** + * Constructs a new UrlMapsValidateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapsValidateRequest. + * @implements IUrlMapsValidateRequest + * @constructor + * @param {google.cloud.compute.v1.IUrlMapsValidateRequest=} [properties] Properties to set + */ + function UrlMapsValidateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapsValidateRequest resource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} resource + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @instance + */ + UrlMapsValidateRequest.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapsValidateRequest _resource. + * @member {"resource"|undefined} _resource + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @instance + */ + Object.defineProperty(UrlMapsValidateRequest.prototype, "_resource", { + get: $util.oneOfGetter($oneOfFields = ["resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapsValidateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.IUrlMapsValidateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapsValidateRequest} UrlMapsValidateRequest instance + */ + UrlMapsValidateRequest.create = function create(properties) { + return new UrlMapsValidateRequest(properties); + }; + + /** + * Encodes the specified UrlMapsValidateRequest message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.IUrlMapsValidateRequest} message UrlMapsValidateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsValidateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.resource, writer.uint32(/* id 195806222, wireType 2 =*/1566449778).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UrlMapsValidateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.IUrlMapsValidateRequest} message UrlMapsValidateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsValidateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapsValidateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapsValidateRequest} UrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsValidateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapsValidateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 195806222: + message.resource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapsValidateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapsValidateRequest} UrlMapsValidateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsValidateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapsValidateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapsValidateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + properties._resource = 1; + { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.resource); + if (error) + return "resource." + error; + } + } + return null; + }; + + /** + * Creates an UrlMapsValidateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapsValidateRequest} UrlMapsValidateRequest + */ + UrlMapsValidateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapsValidateRequest) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapsValidateRequest(); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapsValidateRequest.resource: object expected"); + message.resource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from an UrlMapsValidateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @static + * @param {google.cloud.compute.v1.UrlMapsValidateRequest} message UrlMapsValidateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapsValidateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = $root.google.cloud.compute.v1.UrlMap.toObject(message.resource, options); + if (options.oneofs) + object._resource = "resource"; + } + return object; + }; + + /** + * Converts this UrlMapsValidateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapsValidateRequest + * @instance + * @returns {Object.} JSON object + */ + UrlMapsValidateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapsValidateRequest; + })(); + + v1.UrlMapsValidateResponse = (function() { + + /** + * Properties of an UrlMapsValidateResponse. + * @memberof google.cloud.compute.v1 + * @interface IUrlMapsValidateResponse + * @property {google.cloud.compute.v1.IUrlMapValidationResult|null} [result] UrlMapsValidateResponse result + */ + + /** + * Constructs a new UrlMapsValidateResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMapsValidateResponse. + * @implements IUrlMapsValidateResponse + * @constructor + * @param {google.cloud.compute.v1.IUrlMapsValidateResponse=} [properties] Properties to set + */ + function UrlMapsValidateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UrlMapsValidateResponse result. + * @member {google.cloud.compute.v1.IUrlMapValidationResult|null|undefined} result + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @instance + */ + UrlMapsValidateResponse.prototype.result = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UrlMapsValidateResponse _result. + * @member {"result"|undefined} _result + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @instance + */ + Object.defineProperty(UrlMapsValidateResponse.prototype, "_result", { + get: $util.oneOfGetter($oneOfFields = ["result"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UrlMapsValidateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {google.cloud.compute.v1.IUrlMapsValidateResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UrlMapsValidateResponse} UrlMapsValidateResponse instance + */ + UrlMapsValidateResponse.create = function create(properties) { + return new UrlMapsValidateResponse(properties); + }; + + /** + * Encodes the specified UrlMapsValidateResponse message. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {google.cloud.compute.v1.IUrlMapsValidateResponse} message UrlMapsValidateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsValidateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.compute.v1.UrlMapValidationResult.encode(message.result, writer.uint32(/* id 139315229, wireType 2 =*/1114521834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UrlMapsValidateResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UrlMapsValidateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {google.cloud.compute.v1.IUrlMapsValidateResponse} message UrlMapsValidateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UrlMapsValidateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UrlMapsValidateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UrlMapsValidateResponse} UrlMapsValidateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsValidateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UrlMapsValidateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 139315229: + message.result = $root.google.cloud.compute.v1.UrlMapValidationResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UrlMapsValidateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UrlMapsValidateResponse} UrlMapsValidateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UrlMapsValidateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UrlMapsValidateResponse message. + * @function verify + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UrlMapsValidateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.result != null && message.hasOwnProperty("result")) { + properties._result = 1; + { + var error = $root.google.cloud.compute.v1.UrlMapValidationResult.verify(message.result); + if (error) + return "result." + error; + } + } + return null; + }; + + /** + * Creates an UrlMapsValidateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UrlMapsValidateResponse} UrlMapsValidateResponse + */ + UrlMapsValidateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UrlMapsValidateResponse) + return object; + var message = new $root.google.cloud.compute.v1.UrlMapsValidateResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.compute.v1.UrlMapsValidateResponse.result: object expected"); + message.result = $root.google.cloud.compute.v1.UrlMapValidationResult.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from an UrlMapsValidateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @static + * @param {google.cloud.compute.v1.UrlMapsValidateResponse} message UrlMapsValidateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UrlMapsValidateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.result != null && message.hasOwnProperty("result")) { + object.result = $root.google.cloud.compute.v1.UrlMapValidationResult.toObject(message.result, options); + if (options.oneofs) + object._result = "result"; + } + return object; + }; + + /** + * Converts this UrlMapsValidateResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UrlMapsValidateResponse + * @instance + * @returns {Object.} JSON object + */ + UrlMapsValidateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UrlMapsValidateResponse; + })(); + + v1.UsableSubnetworkSecondaryRange = (function() { + + /** + * Properties of a UsableSubnetworkSecondaryRange. + * @memberof google.cloud.compute.v1 + * @interface IUsableSubnetworkSecondaryRange + * @property {string|null} [ipCidrRange] UsableSubnetworkSecondaryRange ipCidrRange + * @property {string|null} [rangeName] UsableSubnetworkSecondaryRange rangeName + */ + + /** + * Constructs a new UsableSubnetworkSecondaryRange. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a UsableSubnetworkSecondaryRange. + * @implements IUsableSubnetworkSecondaryRange + * @constructor + * @param {google.cloud.compute.v1.IUsableSubnetworkSecondaryRange=} [properties] Properties to set + */ + function UsableSubnetworkSecondaryRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsableSubnetworkSecondaryRange ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @instance + */ + UsableSubnetworkSecondaryRange.prototype.ipCidrRange = null; + + /** + * UsableSubnetworkSecondaryRange rangeName. + * @member {string|null|undefined} rangeName + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @instance + */ + UsableSubnetworkSecondaryRange.prototype.rangeName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UsableSubnetworkSecondaryRange _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @instance + */ + Object.defineProperty(UsableSubnetworkSecondaryRange.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsableSubnetworkSecondaryRange _rangeName. + * @member {"rangeName"|undefined} _rangeName + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @instance + */ + Object.defineProperty(UsableSubnetworkSecondaryRange.prototype, "_rangeName", { + get: $util.oneOfGetter($oneOfFields = ["rangeName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UsableSubnetworkSecondaryRange instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.IUsableSubnetworkSecondaryRange=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UsableSubnetworkSecondaryRange} UsableSubnetworkSecondaryRange instance + */ + UsableSubnetworkSecondaryRange.create = function create(properties) { + return new UsableSubnetworkSecondaryRange(properties); + }; + + /** + * Encodes the specified UsableSubnetworkSecondaryRange message. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworkSecondaryRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.IUsableSubnetworkSecondaryRange} message UsableSubnetworkSecondaryRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsableSubnetworkSecondaryRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.rangeName != null && Object.hasOwnProperty.call(message, "rangeName")) + writer.uint32(/* id 332216397, wireType 2 =*/2657731178).string(message.rangeName); + return writer; + }; + + /** + * Encodes the specified UsableSubnetworkSecondaryRange message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworkSecondaryRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.IUsableSubnetworkSecondaryRange} message UsableSubnetworkSecondaryRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsableSubnetworkSecondaryRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsableSubnetworkSecondaryRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UsableSubnetworkSecondaryRange} UsableSubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsableSubnetworkSecondaryRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 332216397: + message.rangeName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsableSubnetworkSecondaryRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UsableSubnetworkSecondaryRange} UsableSubnetworkSecondaryRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsableSubnetworkSecondaryRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsableSubnetworkSecondaryRange message. + * @function verify + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsableSubnetworkSecondaryRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.rangeName != null && message.hasOwnProperty("rangeName")) { + properties._rangeName = 1; + if (!$util.isString(message.rangeName)) + return "rangeName: string expected"; + } + return null; + }; + + /** + * Creates a UsableSubnetworkSecondaryRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UsableSubnetworkSecondaryRange} UsableSubnetworkSecondaryRange + */ + UsableSubnetworkSecondaryRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange) + return object; + var message = new $root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.rangeName != null) + message.rangeName = String(object.rangeName); + return message; + }; + + /** + * Creates a plain object from a UsableSubnetworkSecondaryRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @static + * @param {google.cloud.compute.v1.UsableSubnetworkSecondaryRange} message UsableSubnetworkSecondaryRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsableSubnetworkSecondaryRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.rangeName != null && message.hasOwnProperty("rangeName")) { + object.rangeName = message.rangeName; + if (options.oneofs) + object._rangeName = "rangeName"; + } + return object; + }; + + /** + * Converts this UsableSubnetworkSecondaryRange to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UsableSubnetworkSecondaryRange + * @instance + * @returns {Object.} JSON object + */ + UsableSubnetworkSecondaryRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UsableSubnetworkSecondaryRange; + })(); + + v1.UsableSubnetwork = (function() { + + /** + * Properties of a UsableSubnetwork. + * @memberof google.cloud.compute.v1 + * @interface IUsableSubnetwork + * @property {string|null} [ipCidrRange] UsableSubnetwork ipCidrRange + * @property {string|null} [network] UsableSubnetwork network + * @property {Array.|null} [secondaryIpRanges] UsableSubnetwork secondaryIpRanges + * @property {string|null} [subnetwork] UsableSubnetwork subnetwork + */ + + /** + * Constructs a new UsableSubnetwork. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a UsableSubnetwork. + * @implements IUsableSubnetwork + * @constructor + * @param {google.cloud.compute.v1.IUsableSubnetwork=} [properties] Properties to set + */ + function UsableSubnetwork(properties) { + this.secondaryIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsableSubnetwork ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + */ + UsableSubnetwork.prototype.ipCidrRange = null; + + /** + * UsableSubnetwork network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + */ + UsableSubnetwork.prototype.network = null; + + /** + * UsableSubnetwork secondaryIpRanges. + * @member {Array.} secondaryIpRanges + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + */ + UsableSubnetwork.prototype.secondaryIpRanges = $util.emptyArray; + + /** + * UsableSubnetwork subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + */ + UsableSubnetwork.prototype.subnetwork = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UsableSubnetwork _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + */ + Object.defineProperty(UsableSubnetwork.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsableSubnetwork _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + */ + Object.defineProperty(UsableSubnetwork.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsableSubnetwork _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + */ + Object.defineProperty(UsableSubnetwork.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UsableSubnetwork instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {google.cloud.compute.v1.IUsableSubnetwork=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UsableSubnetwork} UsableSubnetwork instance + */ + UsableSubnetwork.create = function create(properties) { + return new UsableSubnetwork(properties); + }; + + /** + * Encodes the specified UsableSubnetwork message. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {google.cloud.compute.v1.IUsableSubnetwork} message UsableSubnetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsableSubnetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 98117322, wireType 2 =*/784938578).string(message.ipCidrRange); + if (message.secondaryIpRanges != null && message.secondaryIpRanges.length) + for (var i = 0; i < message.secondaryIpRanges.length; ++i) + $root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange.encode(message.secondaryIpRanges[i], writer.uint32(/* id 136658915, wireType 2 =*/1093271322).fork()).ldelim(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + return writer; + }; + + /** + * Encodes the specified UsableSubnetwork message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {google.cloud.compute.v1.IUsableSubnetwork} message UsableSubnetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsableSubnetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsableSubnetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UsableSubnetwork} UsableSubnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsableSubnetwork.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UsableSubnetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 98117322: + message.ipCidrRange = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 136658915: + if (!(message.secondaryIpRanges && message.secondaryIpRanges.length)) + message.secondaryIpRanges = []; + message.secondaryIpRanges.push($root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange.decode(reader, reader.uint32())); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsableSubnetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UsableSubnetwork} UsableSubnetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsableSubnetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsableSubnetwork message. + * @function verify + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsableSubnetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.secondaryIpRanges != null && message.hasOwnProperty("secondaryIpRanges")) { + if (!Array.isArray(message.secondaryIpRanges)) + return "secondaryIpRanges: array expected"; + for (var i = 0; i < message.secondaryIpRanges.length; ++i) { + var error = $root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange.verify(message.secondaryIpRanges[i]); + if (error) + return "secondaryIpRanges." + error; + } + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + return null; + }; + + /** + * Creates a UsableSubnetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UsableSubnetwork} UsableSubnetwork + */ + UsableSubnetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UsableSubnetwork) + return object; + var message = new $root.google.cloud.compute.v1.UsableSubnetwork(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.network != null) + message.network = String(object.network); + if (object.secondaryIpRanges) { + if (!Array.isArray(object.secondaryIpRanges)) + throw TypeError(".google.cloud.compute.v1.UsableSubnetwork.secondaryIpRanges: array expected"); + message.secondaryIpRanges = []; + for (var i = 0; i < object.secondaryIpRanges.length; ++i) { + if (typeof object.secondaryIpRanges[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UsableSubnetwork.secondaryIpRanges: object expected"); + message.secondaryIpRanges[i] = $root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange.fromObject(object.secondaryIpRanges[i]); + } + } + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + return message; + }; + + /** + * Creates a plain object from a UsableSubnetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @static + * @param {google.cloud.compute.v1.UsableSubnetwork} message UsableSubnetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsableSubnetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.secondaryIpRanges = []; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.secondaryIpRanges && message.secondaryIpRanges.length) { + object.secondaryIpRanges = []; + for (var j = 0; j < message.secondaryIpRanges.length; ++j) + object.secondaryIpRanges[j] = $root.google.cloud.compute.v1.UsableSubnetworkSecondaryRange.toObject(message.secondaryIpRanges[j], options); + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + return object; + }; + + /** + * Converts this UsableSubnetwork to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UsableSubnetwork + * @instance + * @returns {Object.} JSON object + */ + UsableSubnetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UsableSubnetwork; + })(); + + v1.UsableSubnetworksAggregatedList = (function() { + + /** + * Properties of a UsableSubnetworksAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IUsableSubnetworksAggregatedList + * @property {string|null} [id] UsableSubnetworksAggregatedList id + * @property {Array.|null} [items] UsableSubnetworksAggregatedList items + * @property {string|null} [kind] UsableSubnetworksAggregatedList kind + * @property {string|null} [nextPageToken] UsableSubnetworksAggregatedList nextPageToken + * @property {string|null} [selfLink] UsableSubnetworksAggregatedList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] UsableSubnetworksAggregatedList warning + */ + + /** + * Constructs a new UsableSubnetworksAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a UsableSubnetworksAggregatedList. + * @implements IUsableSubnetworksAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IUsableSubnetworksAggregatedList=} [properties] Properties to set + */ + function UsableSubnetworksAggregatedList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsableSubnetworksAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + UsableSubnetworksAggregatedList.prototype.id = null; + + /** + * UsableSubnetworksAggregatedList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + UsableSubnetworksAggregatedList.prototype.items = $util.emptyArray; + + /** + * UsableSubnetworksAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + UsableSubnetworksAggregatedList.prototype.kind = null; + + /** + * UsableSubnetworksAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + UsableSubnetworksAggregatedList.prototype.nextPageToken = null; + + /** + * UsableSubnetworksAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + UsableSubnetworksAggregatedList.prototype.selfLink = null; + + /** + * UsableSubnetworksAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + UsableSubnetworksAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UsableSubnetworksAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + Object.defineProperty(UsableSubnetworksAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsableSubnetworksAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + Object.defineProperty(UsableSubnetworksAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsableSubnetworksAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + Object.defineProperty(UsableSubnetworksAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsableSubnetworksAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + Object.defineProperty(UsableSubnetworksAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UsableSubnetworksAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + */ + Object.defineProperty(UsableSubnetworksAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UsableSubnetworksAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {google.cloud.compute.v1.IUsableSubnetworksAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UsableSubnetworksAggregatedList} UsableSubnetworksAggregatedList instance + */ + UsableSubnetworksAggregatedList.create = function create(properties) { + return new UsableSubnetworksAggregatedList(properties); + }; + + /** + * Encodes the specified UsableSubnetworksAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworksAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {google.cloud.compute.v1.IUsableSubnetworksAggregatedList} message UsableSubnetworksAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsableSubnetworksAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.UsableSubnetwork.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified UsableSubnetworksAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UsableSubnetworksAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {google.cloud.compute.v1.IUsableSubnetworksAggregatedList} message UsableSubnetworksAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsableSubnetworksAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsableSubnetworksAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UsableSubnetworksAggregatedList} UsableSubnetworksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsableSubnetworksAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UsableSubnetworksAggregatedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.UsableSubnetwork.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsableSubnetworksAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UsableSubnetworksAggregatedList} UsableSubnetworksAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsableSubnetworksAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsableSubnetworksAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsableSubnetworksAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.UsableSubnetwork.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a UsableSubnetworksAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UsableSubnetworksAggregatedList} UsableSubnetworksAggregatedList + */ + UsableSubnetworksAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UsableSubnetworksAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.UsableSubnetworksAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.UsableSubnetworksAggregatedList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.UsableSubnetworksAggregatedList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.UsableSubnetwork.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.UsableSubnetworksAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a UsableSubnetworksAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @static + * @param {google.cloud.compute.v1.UsableSubnetworksAggregatedList} message UsableSubnetworksAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsableSubnetworksAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.UsableSubnetwork.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this UsableSubnetworksAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UsableSubnetworksAggregatedList + * @instance + * @returns {Object.} JSON object + */ + UsableSubnetworksAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UsableSubnetworksAggregatedList; + })(); + + v1.VmEndpointNatMappingsInterfaceNatMappings = (function() { + + /** + * Properties of a VmEndpointNatMappingsInterfaceNatMappings. + * @memberof google.cloud.compute.v1 + * @interface IVmEndpointNatMappingsInterfaceNatMappings + * @property {Array.|null} [drainNatIpPortRanges] VmEndpointNatMappingsInterfaceNatMappings drainNatIpPortRanges + * @property {Array.|null} [natIpPortRanges] VmEndpointNatMappingsInterfaceNatMappings natIpPortRanges + * @property {number|null} [numTotalDrainNatPorts] VmEndpointNatMappingsInterfaceNatMappings numTotalDrainNatPorts + * @property {number|null} [numTotalNatPorts] VmEndpointNatMappingsInterfaceNatMappings numTotalNatPorts + * @property {string|null} [sourceAliasIpRange] VmEndpointNatMappingsInterfaceNatMappings sourceAliasIpRange + * @property {string|null} [sourceVirtualIp] VmEndpointNatMappingsInterfaceNatMappings sourceVirtualIp + */ + + /** + * Constructs a new VmEndpointNatMappingsInterfaceNatMappings. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VmEndpointNatMappingsInterfaceNatMappings. + * @implements IVmEndpointNatMappingsInterfaceNatMappings + * @constructor + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings=} [properties] Properties to set + */ + function VmEndpointNatMappingsInterfaceNatMappings(properties) { + this.drainNatIpPortRanges = []; + this.natIpPortRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmEndpointNatMappingsInterfaceNatMappings drainNatIpPortRanges. + * @member {Array.} drainNatIpPortRanges + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + VmEndpointNatMappingsInterfaceNatMappings.prototype.drainNatIpPortRanges = $util.emptyArray; + + /** + * VmEndpointNatMappingsInterfaceNatMappings natIpPortRanges. + * @member {Array.} natIpPortRanges + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + VmEndpointNatMappingsInterfaceNatMappings.prototype.natIpPortRanges = $util.emptyArray; + + /** + * VmEndpointNatMappingsInterfaceNatMappings numTotalDrainNatPorts. + * @member {number|null|undefined} numTotalDrainNatPorts + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + VmEndpointNatMappingsInterfaceNatMappings.prototype.numTotalDrainNatPorts = null; + + /** + * VmEndpointNatMappingsInterfaceNatMappings numTotalNatPorts. + * @member {number|null|undefined} numTotalNatPorts + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + VmEndpointNatMappingsInterfaceNatMappings.prototype.numTotalNatPorts = null; + + /** + * VmEndpointNatMappingsInterfaceNatMappings sourceAliasIpRange. + * @member {string|null|undefined} sourceAliasIpRange + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + VmEndpointNatMappingsInterfaceNatMappings.prototype.sourceAliasIpRange = null; + + /** + * VmEndpointNatMappingsInterfaceNatMappings sourceVirtualIp. + * @member {string|null|undefined} sourceVirtualIp + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + VmEndpointNatMappingsInterfaceNatMappings.prototype.sourceVirtualIp = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VmEndpointNatMappingsInterfaceNatMappings _numTotalDrainNatPorts. + * @member {"numTotalDrainNatPorts"|undefined} _numTotalDrainNatPorts + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsInterfaceNatMappings.prototype, "_numTotalDrainNatPorts", { + get: $util.oneOfGetter($oneOfFields = ["numTotalDrainNatPorts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VmEndpointNatMappingsInterfaceNatMappings _numTotalNatPorts. + * @member {"numTotalNatPorts"|undefined} _numTotalNatPorts + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsInterfaceNatMappings.prototype, "_numTotalNatPorts", { + get: $util.oneOfGetter($oneOfFields = ["numTotalNatPorts"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VmEndpointNatMappingsInterfaceNatMappings _sourceAliasIpRange. + * @member {"sourceAliasIpRange"|undefined} _sourceAliasIpRange + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsInterfaceNatMappings.prototype, "_sourceAliasIpRange", { + get: $util.oneOfGetter($oneOfFields = ["sourceAliasIpRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VmEndpointNatMappingsInterfaceNatMappings _sourceVirtualIp. + * @member {"sourceVirtualIp"|undefined} _sourceVirtualIp + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsInterfaceNatMappings.prototype, "_sourceVirtualIp", { + get: $util.oneOfGetter($oneOfFields = ["sourceVirtualIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VmEndpointNatMappingsInterfaceNatMappings instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings} VmEndpointNatMappingsInterfaceNatMappings instance + */ + VmEndpointNatMappingsInterfaceNatMappings.create = function create(properties) { + return new VmEndpointNatMappingsInterfaceNatMappings(properties); + }; + + /** + * Encodes the specified VmEndpointNatMappingsInterfaceNatMappings message. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings} message VmEndpointNatMappingsInterfaceNatMappings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmEndpointNatMappingsInterfaceNatMappings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceVirtualIp != null && Object.hasOwnProperty.call(message, "sourceVirtualIp")) + writer.uint32(/* id 149836159, wireType 2 =*/1198689274).string(message.sourceVirtualIp); + if (message.numTotalNatPorts != null && Object.hasOwnProperty.call(message, "numTotalNatPorts")) + writer.uint32(/* id 299904384, wireType 0 =*/2399235072).int32(message.numTotalNatPorts); + if (message.numTotalDrainNatPorts != null && Object.hasOwnProperty.call(message, "numTotalDrainNatPorts")) + writer.uint32(/* id 335532793, wireType 0 =*/2684262344).int32(message.numTotalDrainNatPorts); + if (message.drainNatIpPortRanges != null && message.drainNatIpPortRanges.length) + for (var i = 0; i < message.drainNatIpPortRanges.length; ++i) + writer.uint32(/* id 395440577, wireType 2 =*/3163524618).string(message.drainNatIpPortRanges[i]); + if (message.sourceAliasIpRange != null && Object.hasOwnProperty.call(message, "sourceAliasIpRange")) + writer.uint32(/* id 440340952, wireType 2 =*/3522727618).string(message.sourceAliasIpRange); + if (message.natIpPortRanges != null && message.natIpPortRanges.length) + for (var i = 0; i < message.natIpPortRanges.length; ++i) + writer.uint32(/* id 531830810, wireType 2 =*/4254646482).string(message.natIpPortRanges[i]); + return writer; + }; + + /** + * Encodes the specified VmEndpointNatMappingsInterfaceNatMappings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsInterfaceNatMappings} message VmEndpointNatMappingsInterfaceNatMappings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmEndpointNatMappingsInterfaceNatMappings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmEndpointNatMappingsInterfaceNatMappings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings} VmEndpointNatMappingsInterfaceNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmEndpointNatMappingsInterfaceNatMappings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 395440577: + if (!(message.drainNatIpPortRanges && message.drainNatIpPortRanges.length)) + message.drainNatIpPortRanges = []; + message.drainNatIpPortRanges.push(reader.string()); + break; + case 531830810: + if (!(message.natIpPortRanges && message.natIpPortRanges.length)) + message.natIpPortRanges = []; + message.natIpPortRanges.push(reader.string()); + break; + case 335532793: + message.numTotalDrainNatPorts = reader.int32(); + break; + case 299904384: + message.numTotalNatPorts = reader.int32(); + break; + case 440340952: + message.sourceAliasIpRange = reader.string(); + break; + case 149836159: + message.sourceVirtualIp = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmEndpointNatMappingsInterfaceNatMappings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings} VmEndpointNatMappingsInterfaceNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmEndpointNatMappingsInterfaceNatMappings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmEndpointNatMappingsInterfaceNatMappings message. + * @function verify + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmEndpointNatMappingsInterfaceNatMappings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.drainNatIpPortRanges != null && message.hasOwnProperty("drainNatIpPortRanges")) { + if (!Array.isArray(message.drainNatIpPortRanges)) + return "drainNatIpPortRanges: array expected"; + for (var i = 0; i < message.drainNatIpPortRanges.length; ++i) + if (!$util.isString(message.drainNatIpPortRanges[i])) + return "drainNatIpPortRanges: string[] expected"; + } + if (message.natIpPortRanges != null && message.hasOwnProperty("natIpPortRanges")) { + if (!Array.isArray(message.natIpPortRanges)) + return "natIpPortRanges: array expected"; + for (var i = 0; i < message.natIpPortRanges.length; ++i) + if (!$util.isString(message.natIpPortRanges[i])) + return "natIpPortRanges: string[] expected"; + } + if (message.numTotalDrainNatPorts != null && message.hasOwnProperty("numTotalDrainNatPorts")) { + properties._numTotalDrainNatPorts = 1; + if (!$util.isInteger(message.numTotalDrainNatPorts)) + return "numTotalDrainNatPorts: integer expected"; + } + if (message.numTotalNatPorts != null && message.hasOwnProperty("numTotalNatPorts")) { + properties._numTotalNatPorts = 1; + if (!$util.isInteger(message.numTotalNatPorts)) + return "numTotalNatPorts: integer expected"; + } + if (message.sourceAliasIpRange != null && message.hasOwnProperty("sourceAliasIpRange")) { + properties._sourceAliasIpRange = 1; + if (!$util.isString(message.sourceAliasIpRange)) + return "sourceAliasIpRange: string expected"; + } + if (message.sourceVirtualIp != null && message.hasOwnProperty("sourceVirtualIp")) { + properties._sourceVirtualIp = 1; + if (!$util.isString(message.sourceVirtualIp)) + return "sourceVirtualIp: string expected"; + } + return null; + }; + + /** + * Creates a VmEndpointNatMappingsInterfaceNatMappings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings} VmEndpointNatMappingsInterfaceNatMappings + */ + VmEndpointNatMappingsInterfaceNatMappings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings) + return object; + var message = new $root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings(); + if (object.drainNatIpPortRanges) { + if (!Array.isArray(object.drainNatIpPortRanges)) + throw TypeError(".google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.drainNatIpPortRanges: array expected"); + message.drainNatIpPortRanges = []; + for (var i = 0; i < object.drainNatIpPortRanges.length; ++i) + message.drainNatIpPortRanges[i] = String(object.drainNatIpPortRanges[i]); + } + if (object.natIpPortRanges) { + if (!Array.isArray(object.natIpPortRanges)) + throw TypeError(".google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.natIpPortRanges: array expected"); + message.natIpPortRanges = []; + for (var i = 0; i < object.natIpPortRanges.length; ++i) + message.natIpPortRanges[i] = String(object.natIpPortRanges[i]); + } + if (object.numTotalDrainNatPorts != null) + message.numTotalDrainNatPorts = object.numTotalDrainNatPorts | 0; + if (object.numTotalNatPorts != null) + message.numTotalNatPorts = object.numTotalNatPorts | 0; + if (object.sourceAliasIpRange != null) + message.sourceAliasIpRange = String(object.sourceAliasIpRange); + if (object.sourceVirtualIp != null) + message.sourceVirtualIp = String(object.sourceVirtualIp); + return message; + }; + + /** + * Creates a plain object from a VmEndpointNatMappingsInterfaceNatMappings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @static + * @param {google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings} message VmEndpointNatMappingsInterfaceNatMappings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmEndpointNatMappingsInterfaceNatMappings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.drainNatIpPortRanges = []; + object.natIpPortRanges = []; + } + if (message.sourceVirtualIp != null && message.hasOwnProperty("sourceVirtualIp")) { + object.sourceVirtualIp = message.sourceVirtualIp; + if (options.oneofs) + object._sourceVirtualIp = "sourceVirtualIp"; + } + if (message.numTotalNatPorts != null && message.hasOwnProperty("numTotalNatPorts")) { + object.numTotalNatPorts = message.numTotalNatPorts; + if (options.oneofs) + object._numTotalNatPorts = "numTotalNatPorts"; + } + if (message.numTotalDrainNatPorts != null && message.hasOwnProperty("numTotalDrainNatPorts")) { + object.numTotalDrainNatPorts = message.numTotalDrainNatPorts; + if (options.oneofs) + object._numTotalDrainNatPorts = "numTotalDrainNatPorts"; + } + if (message.drainNatIpPortRanges && message.drainNatIpPortRanges.length) { + object.drainNatIpPortRanges = []; + for (var j = 0; j < message.drainNatIpPortRanges.length; ++j) + object.drainNatIpPortRanges[j] = message.drainNatIpPortRanges[j]; + } + if (message.sourceAliasIpRange != null && message.hasOwnProperty("sourceAliasIpRange")) { + object.sourceAliasIpRange = message.sourceAliasIpRange; + if (options.oneofs) + object._sourceAliasIpRange = "sourceAliasIpRange"; + } + if (message.natIpPortRanges && message.natIpPortRanges.length) { + object.natIpPortRanges = []; + for (var j = 0; j < message.natIpPortRanges.length; ++j) + object.natIpPortRanges[j] = message.natIpPortRanges[j]; + } + return object; + }; + + /** + * Converts this VmEndpointNatMappingsInterfaceNatMappings to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings + * @instance + * @returns {Object.} JSON object + */ + VmEndpointNatMappingsInterfaceNatMappings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VmEndpointNatMappingsInterfaceNatMappings; + })(); + + v1.VmEndpointNatMappings = (function() { + + /** + * Properties of a VmEndpointNatMappings. + * @memberof google.cloud.compute.v1 + * @interface IVmEndpointNatMappings + * @property {string|null} [instanceName] VmEndpointNatMappings instanceName + * @property {Array.|null} [interfaceNatMappings] VmEndpointNatMappings interfaceNatMappings + */ + + /** + * Constructs a new VmEndpointNatMappings. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VmEndpointNatMappings. + * @implements IVmEndpointNatMappings + * @constructor + * @param {google.cloud.compute.v1.IVmEndpointNatMappings=} [properties] Properties to set + */ + function VmEndpointNatMappings(properties) { + this.interfaceNatMappings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmEndpointNatMappings instanceName. + * @member {string|null|undefined} instanceName + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @instance + */ + VmEndpointNatMappings.prototype.instanceName = null; + + /** + * VmEndpointNatMappings interfaceNatMappings. + * @member {Array.} interfaceNatMappings + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @instance + */ + VmEndpointNatMappings.prototype.interfaceNatMappings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VmEndpointNatMappings _instanceName. + * @member {"instanceName"|undefined} _instanceName + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @instance + */ + Object.defineProperty(VmEndpointNatMappings.prototype, "_instanceName", { + get: $util.oneOfGetter($oneOfFields = ["instanceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VmEndpointNatMappings instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappings=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VmEndpointNatMappings} VmEndpointNatMappings instance + */ + VmEndpointNatMappings.create = function create(properties) { + return new VmEndpointNatMappings(properties); + }; + + /** + * Encodes the specified VmEndpointNatMappings message. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappings.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappings} message VmEndpointNatMappings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmEndpointNatMappings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceName != null && Object.hasOwnProperty.call(message, "instanceName")) + writer.uint32(/* id 227947509, wireType 2 =*/1823580074).string(message.instanceName); + if (message.interfaceNatMappings != null && message.interfaceNatMappings.length) + for (var i = 0; i < message.interfaceNatMappings.length; ++i) + $root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.encode(message.interfaceNatMappings[i], writer.uint32(/* id 256196617, wireType 2 =*/2049572938).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VmEndpointNatMappings message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappings} message VmEndpointNatMappings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmEndpointNatMappings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmEndpointNatMappings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VmEndpointNatMappings} VmEndpointNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmEndpointNatMappings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VmEndpointNatMappings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227947509: + message.instanceName = reader.string(); + break; + case 256196617: + if (!(message.interfaceNatMappings && message.interfaceNatMappings.length)) + message.interfaceNatMappings = []; + message.interfaceNatMappings.push($root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmEndpointNatMappings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VmEndpointNatMappings} VmEndpointNatMappings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmEndpointNatMappings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmEndpointNatMappings message. + * @function verify + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmEndpointNatMappings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceName != null && message.hasOwnProperty("instanceName")) { + properties._instanceName = 1; + if (!$util.isString(message.instanceName)) + return "instanceName: string expected"; + } + if (message.interfaceNatMappings != null && message.hasOwnProperty("interfaceNatMappings")) { + if (!Array.isArray(message.interfaceNatMappings)) + return "interfaceNatMappings: array expected"; + for (var i = 0; i < message.interfaceNatMappings.length; ++i) { + var error = $root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.verify(message.interfaceNatMappings[i]); + if (error) + return "interfaceNatMappings." + error; + } + } + return null; + }; + + /** + * Creates a VmEndpointNatMappings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VmEndpointNatMappings} VmEndpointNatMappings + */ + VmEndpointNatMappings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VmEndpointNatMappings) + return object; + var message = new $root.google.cloud.compute.v1.VmEndpointNatMappings(); + if (object.instanceName != null) + message.instanceName = String(object.instanceName); + if (object.interfaceNatMappings) { + if (!Array.isArray(object.interfaceNatMappings)) + throw TypeError(".google.cloud.compute.v1.VmEndpointNatMappings.interfaceNatMappings: array expected"); + message.interfaceNatMappings = []; + for (var i = 0; i < object.interfaceNatMappings.length; ++i) { + if (typeof object.interfaceNatMappings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VmEndpointNatMappings.interfaceNatMappings: object expected"); + message.interfaceNatMappings[i] = $root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.fromObject(object.interfaceNatMappings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VmEndpointNatMappings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @static + * @param {google.cloud.compute.v1.VmEndpointNatMappings} message VmEndpointNatMappings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmEndpointNatMappings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.interfaceNatMappings = []; + if (message.instanceName != null && message.hasOwnProperty("instanceName")) { + object.instanceName = message.instanceName; + if (options.oneofs) + object._instanceName = "instanceName"; + } + if (message.interfaceNatMappings && message.interfaceNatMappings.length) { + object.interfaceNatMappings = []; + for (var j = 0; j < message.interfaceNatMappings.length; ++j) + object.interfaceNatMappings[j] = $root.google.cloud.compute.v1.VmEndpointNatMappingsInterfaceNatMappings.toObject(message.interfaceNatMappings[j], options); + } + return object; + }; + + /** + * Converts this VmEndpointNatMappings to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VmEndpointNatMappings + * @instance + * @returns {Object.} JSON object + */ + VmEndpointNatMappings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VmEndpointNatMappings; + })(); + + v1.VmEndpointNatMappingsList = (function() { + + /** + * Properties of a VmEndpointNatMappingsList. + * @memberof google.cloud.compute.v1 + * @interface IVmEndpointNatMappingsList + * @property {string|null} [id] VmEndpointNatMappingsList id + * @property {string|null} [kind] VmEndpointNatMappingsList kind + * @property {string|null} [nextPageToken] VmEndpointNatMappingsList nextPageToken + * @property {Array.|null} [result] VmEndpointNatMappingsList result + * @property {string|null} [selfLink] VmEndpointNatMappingsList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] VmEndpointNatMappingsList warning + */ + + /** + * Constructs a new VmEndpointNatMappingsList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VmEndpointNatMappingsList. + * @implements IVmEndpointNatMappingsList + * @constructor + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsList=} [properties] Properties to set + */ + function VmEndpointNatMappingsList(properties) { + this.result = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmEndpointNatMappingsList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + VmEndpointNatMappingsList.prototype.id = null; + + /** + * VmEndpointNatMappingsList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + VmEndpointNatMappingsList.prototype.kind = null; + + /** + * VmEndpointNatMappingsList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + VmEndpointNatMappingsList.prototype.nextPageToken = null; + + /** + * VmEndpointNatMappingsList result. + * @member {Array.} result + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + VmEndpointNatMappingsList.prototype.result = $util.emptyArray; + + /** + * VmEndpointNatMappingsList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + VmEndpointNatMappingsList.prototype.selfLink = null; + + /** + * VmEndpointNatMappingsList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + VmEndpointNatMappingsList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VmEndpointNatMappingsList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VmEndpointNatMappingsList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VmEndpointNatMappingsList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VmEndpointNatMappingsList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VmEndpointNatMappingsList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + */ + Object.defineProperty(VmEndpointNatMappingsList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VmEndpointNatMappingsList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsList} VmEndpointNatMappingsList instance + */ + VmEndpointNatMappingsList.create = function create(properties) { + return new VmEndpointNatMappingsList(properties); + }; + + /** + * Encodes the specified VmEndpointNatMappingsList message. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsList} message VmEndpointNatMappingsList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmEndpointNatMappingsList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.result != null && message.result.length) + for (var i = 0; i < message.result.length; ++i) + $root.google.cloud.compute.v1.VmEndpointNatMappings.encode(message.result[i], writer.uint32(/* id 139315229, wireType 2 =*/1114521834).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified VmEndpointNatMappingsList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VmEndpointNatMappingsList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {google.cloud.compute.v1.IVmEndpointNatMappingsList} message VmEndpointNatMappingsList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmEndpointNatMappingsList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmEndpointNatMappingsList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsList} VmEndpointNatMappingsList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmEndpointNatMappingsList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VmEndpointNatMappingsList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 139315229: + if (!(message.result && message.result.length)) + message.result = []; + message.result.push($root.google.cloud.compute.v1.VmEndpointNatMappings.decode(reader, reader.uint32())); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmEndpointNatMappingsList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsList} VmEndpointNatMappingsList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmEndpointNatMappingsList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmEndpointNatMappingsList message. + * @function verify + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmEndpointNatMappingsList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.result != null && message.hasOwnProperty("result")) { + if (!Array.isArray(message.result)) + return "result: array expected"; + for (var i = 0; i < message.result.length; ++i) { + var error = $root.google.cloud.compute.v1.VmEndpointNatMappings.verify(message.result[i]); + if (error) + return "result." + error; + } + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a VmEndpointNatMappingsList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VmEndpointNatMappingsList} VmEndpointNatMappingsList + */ + VmEndpointNatMappingsList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VmEndpointNatMappingsList) + return object; + var message = new $root.google.cloud.compute.v1.VmEndpointNatMappingsList(); + if (object.id != null) + message.id = String(object.id); + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.result) { + if (!Array.isArray(object.result)) + throw TypeError(".google.cloud.compute.v1.VmEndpointNatMappingsList.result: array expected"); + message.result = []; + for (var i = 0; i < object.result.length; ++i) { + if (typeof object.result[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VmEndpointNatMappingsList.result: object expected"); + message.result[i] = $root.google.cloud.compute.v1.VmEndpointNatMappings.fromObject(object.result[i]); + } + } + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.VmEndpointNatMappingsList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a VmEndpointNatMappingsList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @static + * @param {google.cloud.compute.v1.VmEndpointNatMappingsList} message VmEndpointNatMappingsList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmEndpointNatMappingsList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.result = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.result && message.result.length) { + object.result = []; + for (var j = 0; j < message.result.length; ++j) + object.result[j] = $root.google.cloud.compute.v1.VmEndpointNatMappings.toObject(message.result[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this VmEndpointNatMappingsList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VmEndpointNatMappingsList + * @instance + * @returns {Object.} JSON object + */ + VmEndpointNatMappingsList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VmEndpointNatMappingsList; + })(); + + v1.VpnGatewayVpnGatewayInterface = (function() { + + /** + * Properties of a VpnGatewayVpnGatewayInterface. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewayVpnGatewayInterface + * @property {number|null} [id] VpnGatewayVpnGatewayInterface id + * @property {string|null} [interconnectAttachment] VpnGatewayVpnGatewayInterface interconnectAttachment + * @property {string|null} [ipAddress] VpnGatewayVpnGatewayInterface ipAddress + */ + + /** + * Constructs a new VpnGatewayVpnGatewayInterface. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewayVpnGatewayInterface. + * @implements IVpnGatewayVpnGatewayInterface + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface=} [properties] Properties to set + */ + function VpnGatewayVpnGatewayInterface(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewayVpnGatewayInterface id. + * @member {number|null|undefined} id + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @instance + */ + VpnGatewayVpnGatewayInterface.prototype.id = null; + + /** + * VpnGatewayVpnGatewayInterface interconnectAttachment. + * @member {string|null|undefined} interconnectAttachment + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @instance + */ + VpnGatewayVpnGatewayInterface.prototype.interconnectAttachment = null; + + /** + * VpnGatewayVpnGatewayInterface ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @instance + */ + VpnGatewayVpnGatewayInterface.prototype.ipAddress = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewayVpnGatewayInterface _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @instance + */ + Object.defineProperty(VpnGatewayVpnGatewayInterface.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayVpnGatewayInterface _interconnectAttachment. + * @member {"interconnectAttachment"|undefined} _interconnectAttachment + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @instance + */ + Object.defineProperty(VpnGatewayVpnGatewayInterface.prototype, "_interconnectAttachment", { + get: $util.oneOfGetter($oneOfFields = ["interconnectAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayVpnGatewayInterface _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @instance + */ + Object.defineProperty(VpnGatewayVpnGatewayInterface.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewayVpnGatewayInterface instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewayVpnGatewayInterface} VpnGatewayVpnGatewayInterface instance + */ + VpnGatewayVpnGatewayInterface.create = function create(properties) { + return new VpnGatewayVpnGatewayInterface(properties); + }; + + /** + * Encodes the specified VpnGatewayVpnGatewayInterface message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface} message VpnGatewayVpnGatewayInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayVpnGatewayInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint32(message.id); + if (message.interconnectAttachment != null && Object.hasOwnProperty.call(message, "interconnectAttachment")) + writer.uint32(/* id 308135284, wireType 2 =*/2465082274).string(message.interconnectAttachment); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 406272220, wireType 2 =*/3250177762).string(message.ipAddress); + return writer; + }; + + /** + * Encodes the specified VpnGatewayVpnGatewayInterface message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.IVpnGatewayVpnGatewayInterface} message VpnGatewayVpnGatewayInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayVpnGatewayInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewayVpnGatewayInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewayVpnGatewayInterface} VpnGatewayVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayVpnGatewayInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.uint32(); + break; + case 308135284: + message.interconnectAttachment = reader.string(); + break; + case 406272220: + message.ipAddress = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewayVpnGatewayInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewayVpnGatewayInterface} VpnGatewayVpnGatewayInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayVpnGatewayInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewayVpnGatewayInterface message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewayVpnGatewayInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id)) + return "id: integer expected"; + } + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) { + properties._interconnectAttachment = 1; + if (!$util.isString(message.interconnectAttachment)) + return "interconnectAttachment: string expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + return null; + }; + + /** + * Creates a VpnGatewayVpnGatewayInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewayVpnGatewayInterface} VpnGatewayVpnGatewayInterface + */ + VpnGatewayVpnGatewayInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface(); + if (object.id != null) + message.id = object.id >>> 0; + if (object.interconnectAttachment != null) + message.interconnectAttachment = String(object.interconnectAttachment); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + return message; + }; + + /** + * Creates a plain object from a VpnGatewayVpnGatewayInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @static + * @param {google.cloud.compute.v1.VpnGatewayVpnGatewayInterface} message VpnGatewayVpnGatewayInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewayVpnGatewayInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) { + object.interconnectAttachment = message.interconnectAttachment; + if (options.oneofs) + object._interconnectAttachment = "interconnectAttachment"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + return object; + }; + + /** + * Converts this VpnGatewayVpnGatewayInterface to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewayVpnGatewayInterface + * @instance + * @returns {Object.} JSON object + */ + VpnGatewayVpnGatewayInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewayVpnGatewayInterface; + })(); + + v1.VpnGateway = (function() { + + /** + * Properties of a VpnGateway. + * @memberof google.cloud.compute.v1 + * @interface IVpnGateway + * @property {string|null} [creationTimestamp] VpnGateway creationTimestamp + * @property {string|null} [description] VpnGateway description + * @property {number|Long|null} [id] VpnGateway id + * @property {string|null} [kind] VpnGateway kind + * @property {string|null} [labelFingerprint] VpnGateway labelFingerprint + * @property {Object.|null} [labels] VpnGateway labels + * @property {string|null} [name] VpnGateway name + * @property {string|null} [network] VpnGateway network + * @property {string|null} [region] VpnGateway region + * @property {string|null} [selfLink] VpnGateway selfLink + * @property {Array.|null} [vpnInterfaces] VpnGateway vpnInterfaces + */ + + /** + * Constructs a new VpnGateway. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGateway. + * @implements IVpnGateway + * @constructor + * @param {google.cloud.compute.v1.IVpnGateway=} [properties] Properties to set + */ + function VpnGateway(properties) { + this.labels = {}; + this.vpnInterfaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGateway creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.creationTimestamp = null; + + /** + * VpnGateway description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.description = null; + + /** + * VpnGateway id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.id = null; + + /** + * VpnGateway kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.kind = null; + + /** + * VpnGateway labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.labelFingerprint = null; + + /** + * VpnGateway labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.labels = $util.emptyObject; + + /** + * VpnGateway name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.name = null; + + /** + * VpnGateway network. + * @member {string|null|undefined} network + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.network = null; + + /** + * VpnGateway region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.region = null; + + /** + * VpnGateway selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.selfLink = null; + + /** + * VpnGateway vpnInterfaces. + * @member {Array.} vpnInterfaces + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + VpnGateway.prototype.vpnInterfaces = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGateway _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGateway _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + */ + Object.defineProperty(VpnGateway.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGateway instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {google.cloud.compute.v1.IVpnGateway=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGateway} VpnGateway instance + */ + VpnGateway.create = function create(properties) { + return new VpnGateway(properties); + }; + + /** + * Encodes the specified VpnGateway message. Does not implicitly {@link google.cloud.compute.v1.VpnGateway.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {google.cloud.compute.v1.IVpnGateway} message VpnGateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGateway.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.vpnInterfaces != null && message.vpnInterfaces.length) + for (var i = 0; i < message.vpnInterfaces.length; ++i) + $root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.encode(message.vpnInterfaces[i], writer.uint32(/* id 91842181, wireType 2 =*/734737450).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + 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 500195327, wireType 2 =*/4001562618).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 VpnGateway message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGateway.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {google.cloud.compute.v1.IVpnGateway} message VpnGateway message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGateway.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGateway message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGateway} VpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGateway.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGateway(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 3373707: + message.name = reader.string(); + break; + case 232872494: + message.network = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 91842181: + if (!(message.vpnInterfaces && message.vpnInterfaces.length)) + message.vpnInterfaces = []; + message.vpnInterfaces.push($root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGateway message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGateway} VpnGateway + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGateway.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGateway message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGateway.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.vpnInterfaces != null && message.hasOwnProperty("vpnInterfaces")) { + if (!Array.isArray(message.vpnInterfaces)) + return "vpnInterfaces: array expected"; + for (var i = 0; i < message.vpnInterfaces.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.verify(message.vpnInterfaces[i]); + if (error) + return "vpnInterfaces." + error; + } + } + return null; + }; + + /** + * Creates a VpnGateway message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGateway} VpnGateway + */ + VpnGateway.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGateway) + return object; + var message = new $root.google.cloud.compute.v1.VpnGateway(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGateway.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.name != null) + message.name = String(object.name); + if (object.network != null) + message.network = String(object.network); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.vpnInterfaces) { + if (!Array.isArray(object.vpnInterfaces)) + throw TypeError(".google.cloud.compute.v1.VpnGateway.vpnInterfaces: array expected"); + message.vpnInterfaces = []; + for (var i = 0; i < object.vpnInterfaces.length; ++i) { + if (typeof object.vpnInterfaces[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGateway.vpnInterfaces: object expected"); + message.vpnInterfaces[i] = $root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.fromObject(object.vpnInterfaces[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VpnGateway message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGateway + * @static + * @param {google.cloud.compute.v1.VpnGateway} message VpnGateway + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGateway.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vpnInterfaces = []; + if (options.objects || options.defaults) + object.labels = {}; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.vpnInterfaces && message.vpnInterfaces.length) { + object.vpnInterfaces = []; + for (var j = 0; j < message.vpnInterfaces.length; ++j) + object.vpnInterfaces[j] = $root.google.cloud.compute.v1.VpnGatewayVpnGatewayInterface.toObject(message.vpnInterfaces[j], options); + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + 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 VpnGateway to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGateway + * @instance + * @returns {Object.} JSON object + */ + VpnGateway.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGateway; + })(); + + v1.VpnGatewaysScopedList = (function() { + + /** + * Properties of a VpnGatewaysScopedList. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewaysScopedList + * @property {Array.|null} [vpnGateways] VpnGatewaysScopedList vpnGateways + * @property {google.cloud.compute.v1.IWarning|null} [warning] VpnGatewaysScopedList warning + */ + + /** + * Constructs a new VpnGatewaysScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewaysScopedList. + * @implements IVpnGatewaysScopedList + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewaysScopedList=} [properties] Properties to set + */ + function VpnGatewaysScopedList(properties) { + this.vpnGateways = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewaysScopedList vpnGateways. + * @member {Array.} vpnGateways + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @instance + */ + VpnGatewaysScopedList.prototype.vpnGateways = $util.emptyArray; + + /** + * VpnGatewaysScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @instance + */ + VpnGatewaysScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewaysScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @instance + */ + Object.defineProperty(VpnGatewaysScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewaysScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.IVpnGatewaysScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewaysScopedList} VpnGatewaysScopedList instance + */ + VpnGatewaysScopedList.create = function create(properties) { + return new VpnGatewaysScopedList(properties); + }; + + /** + * Encodes the specified VpnGatewaysScopedList message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.IVpnGatewaysScopedList} message VpnGatewaysScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewaysScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.vpnGateways != null && message.vpnGateways.length) + for (var i = 0; i < message.vpnGateways.length; ++i) + $root.google.cloud.compute.v1.VpnGateway.encode(message.vpnGateways[i], writer.uint32(/* id 259177882, wireType 2 =*/2073423058).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VpnGatewaysScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.IVpnGatewaysScopedList} message VpnGatewaysScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewaysScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewaysScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewaysScopedList} VpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewaysScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewaysScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 259177882: + if (!(message.vpnGateways && message.vpnGateways.length)) + message.vpnGateways = []; + message.vpnGateways.push($root.google.cloud.compute.v1.VpnGateway.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewaysScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewaysScopedList} VpnGatewaysScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewaysScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewaysScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewaysScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vpnGateways != null && message.hasOwnProperty("vpnGateways")) { + if (!Array.isArray(message.vpnGateways)) + return "vpnGateways: array expected"; + for (var i = 0; i < message.vpnGateways.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnGateway.verify(message.vpnGateways[i]); + if (error) + return "vpnGateways." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a VpnGatewaysScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewaysScopedList} VpnGatewaysScopedList + */ + VpnGatewaysScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewaysScopedList) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewaysScopedList(); + if (object.vpnGateways) { + if (!Array.isArray(object.vpnGateways)) + throw TypeError(".google.cloud.compute.v1.VpnGatewaysScopedList.vpnGateways: array expected"); + message.vpnGateways = []; + for (var i = 0; i < object.vpnGateways.length; ++i) { + if (typeof object.vpnGateways[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewaysScopedList.vpnGateways: object expected"); + message.vpnGateways[i] = $root.google.cloud.compute.v1.VpnGateway.fromObject(object.vpnGateways[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewaysScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a VpnGatewaysScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @static + * @param {google.cloud.compute.v1.VpnGatewaysScopedList} message VpnGatewaysScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewaysScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vpnGateways = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.vpnGateways && message.vpnGateways.length) { + object.vpnGateways = []; + for (var j = 0; j < message.vpnGateways.length; ++j) + object.vpnGateways[j] = $root.google.cloud.compute.v1.VpnGateway.toObject(message.vpnGateways[j], options); + } + return object; + }; + + /** + * Converts this VpnGatewaysScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewaysScopedList + * @instance + * @returns {Object.} JSON object + */ + VpnGatewaysScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewaysScopedList; + })(); + + v1.VpnGatewayAggregatedList = (function() { + + /** + * Properties of a VpnGatewayAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewayAggregatedList + * @property {string|null} [id] VpnGatewayAggregatedList id + * @property {Object.|null} [items] VpnGatewayAggregatedList items + * @property {string|null} [kind] VpnGatewayAggregatedList kind + * @property {string|null} [nextPageToken] VpnGatewayAggregatedList nextPageToken + * @property {string|null} [selfLink] VpnGatewayAggregatedList selfLink + * @property {Array.|null} [unreachables] VpnGatewayAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] VpnGatewayAggregatedList warning + */ + + /** + * Constructs a new VpnGatewayAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewayAggregatedList. + * @implements IVpnGatewayAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewayAggregatedList=} [properties] Properties to set + */ + function VpnGatewayAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewayAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + VpnGatewayAggregatedList.prototype.id = null; + + /** + * VpnGatewayAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + VpnGatewayAggregatedList.prototype.items = $util.emptyObject; + + /** + * VpnGatewayAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + VpnGatewayAggregatedList.prototype.kind = null; + + /** + * VpnGatewayAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + VpnGatewayAggregatedList.prototype.nextPageToken = null; + + /** + * VpnGatewayAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + VpnGatewayAggregatedList.prototype.selfLink = null; + + /** + * VpnGatewayAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + VpnGatewayAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * VpnGatewayAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + VpnGatewayAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewayAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(VpnGatewayAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(VpnGatewayAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(VpnGatewayAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(VpnGatewayAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + */ + Object.defineProperty(VpnGatewayAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewayAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.IVpnGatewayAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewayAggregatedList} VpnGatewayAggregatedList instance + */ + VpnGatewayAggregatedList.create = function create(properties) { + return new VpnGatewayAggregatedList(properties); + }; + + /** + * Encodes the specified VpnGatewayAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.IVpnGatewayAggregatedList} message VpnGatewayAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.VpnGatewaysScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified VpnGatewayAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.IVpnGatewayAggregatedList} message VpnGatewayAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewayAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewayAggregatedList} VpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewayAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.VpnGatewaysScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewayAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewayAggregatedList} VpnGatewayAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewayAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewayAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnGatewaysScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a VpnGatewayAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewayAggregatedList} VpnGatewayAggregatedList + */ + VpnGatewayAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewayAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewayAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.VpnGatewaysScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.VpnGatewayAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a VpnGatewayAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @static + * @param {google.cloud.compute.v1.VpnGatewayAggregatedList} message VpnGatewayAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewayAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.VpnGatewaysScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this VpnGatewayAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewayAggregatedList + * @instance + * @returns {Object.} JSON object + */ + VpnGatewayAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewayAggregatedList; + })(); + + v1.VpnGatewayList = (function() { + + /** + * Properties of a VpnGatewayList. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewayList + * @property {string|null} [id] VpnGatewayList id + * @property {Array.|null} [items] VpnGatewayList items + * @property {string|null} [kind] VpnGatewayList kind + * @property {string|null} [nextPageToken] VpnGatewayList nextPageToken + * @property {string|null} [selfLink] VpnGatewayList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] VpnGatewayList warning + */ + + /** + * Constructs a new VpnGatewayList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewayList. + * @implements IVpnGatewayList + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewayList=} [properties] Properties to set + */ + function VpnGatewayList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewayList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + VpnGatewayList.prototype.id = null; + + /** + * VpnGatewayList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + VpnGatewayList.prototype.items = $util.emptyArray; + + /** + * VpnGatewayList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + VpnGatewayList.prototype.kind = null; + + /** + * VpnGatewayList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + VpnGatewayList.prototype.nextPageToken = null; + + /** + * VpnGatewayList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + VpnGatewayList.prototype.selfLink = null; + + /** + * VpnGatewayList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + VpnGatewayList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewayList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + Object.defineProperty(VpnGatewayList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + Object.defineProperty(VpnGatewayList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + Object.defineProperty(VpnGatewayList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + Object.defineProperty(VpnGatewayList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + */ + Object.defineProperty(VpnGatewayList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewayList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {google.cloud.compute.v1.IVpnGatewayList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewayList} VpnGatewayList instance + */ + VpnGatewayList.create = function create(properties) { + return new VpnGatewayList(properties); + }; + + /** + * Encodes the specified VpnGatewayList message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {google.cloud.compute.v1.IVpnGatewayList} message VpnGatewayList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.VpnGateway.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified VpnGatewayList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {google.cloud.compute.v1.IVpnGatewayList} message VpnGatewayList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewayList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewayList} VpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewayList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.VpnGateway.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewayList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewayList} VpnGatewayList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewayList message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewayList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnGateway.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a VpnGatewayList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewayList} VpnGatewayList + */ + VpnGatewayList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewayList) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewayList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.VpnGatewayList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.VpnGateway.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a VpnGatewayList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewayList + * @static + * @param {google.cloud.compute.v1.VpnGatewayList} message VpnGatewayList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewayList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.VpnGateway.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this VpnGatewayList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewayList + * @instance + * @returns {Object.} JSON object + */ + VpnGatewayList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewayList; + })(); + + v1.VpnGatewayStatusVpnConnection = (function() { + + /** + * Properties of a VpnGatewayStatusVpnConnection. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewayStatusVpnConnection + * @property {string|null} [peerExternalGateway] VpnGatewayStatusVpnConnection peerExternalGateway + * @property {string|null} [peerGcpGateway] VpnGatewayStatusVpnConnection peerGcpGateway + * @property {google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState|null} [state] VpnGatewayStatusVpnConnection state + * @property {Array.|null} [tunnels] VpnGatewayStatusVpnConnection tunnels + */ + + /** + * Constructs a new VpnGatewayStatusVpnConnection. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewayStatusVpnConnection. + * @implements IVpnGatewayStatusVpnConnection + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewayStatusVpnConnection=} [properties] Properties to set + */ + function VpnGatewayStatusVpnConnection(properties) { + this.tunnels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewayStatusVpnConnection peerExternalGateway. + * @member {string|null|undefined} peerExternalGateway + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + */ + VpnGatewayStatusVpnConnection.prototype.peerExternalGateway = null; + + /** + * VpnGatewayStatusVpnConnection peerGcpGateway. + * @member {string|null|undefined} peerGcpGateway + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + */ + VpnGatewayStatusVpnConnection.prototype.peerGcpGateway = null; + + /** + * VpnGatewayStatusVpnConnection state. + * @member {google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState|null|undefined} state + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + */ + VpnGatewayStatusVpnConnection.prototype.state = null; + + /** + * VpnGatewayStatusVpnConnection tunnels. + * @member {Array.} tunnels + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + */ + VpnGatewayStatusVpnConnection.prototype.tunnels = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewayStatusVpnConnection _peerExternalGateway. + * @member {"peerExternalGateway"|undefined} _peerExternalGateway + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + */ + Object.defineProperty(VpnGatewayStatusVpnConnection.prototype, "_peerExternalGateway", { + get: $util.oneOfGetter($oneOfFields = ["peerExternalGateway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayStatusVpnConnection _peerGcpGateway. + * @member {"peerGcpGateway"|undefined} _peerGcpGateway + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + */ + Object.defineProperty(VpnGatewayStatusVpnConnection.prototype, "_peerGcpGateway", { + get: $util.oneOfGetter($oneOfFields = ["peerGcpGateway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayStatusVpnConnection _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + */ + Object.defineProperty(VpnGatewayStatusVpnConnection.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewayStatusVpnConnection instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusVpnConnection=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewayStatusVpnConnection} VpnGatewayStatusVpnConnection instance + */ + VpnGatewayStatusVpnConnection.create = function create(properties) { + return new VpnGatewayStatusVpnConnection(properties); + }; + + /** + * Encodes the specified VpnGatewayStatusVpnConnection message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusVpnConnection.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusVpnConnection} message VpnGatewayStatusVpnConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatusVpnConnection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunnels != null && message.tunnels.length) + for (var i = 0; i < message.tunnels.length; ++i) + $root.google.cloud.compute.v1.VpnGatewayStatusTunnel.encode(message.tunnels[i], writer.uint32(/* id 104561931, wireType 2 =*/836495450).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.encode(message.state, writer.uint32(/* id 109757585, wireType 2 =*/878060682).fork()).ldelim(); + if (message.peerGcpGateway != null && Object.hasOwnProperty.call(message, "peerGcpGateway")) + writer.uint32(/* id 281867452, wireType 2 =*/2254939618).string(message.peerGcpGateway); + if (message.peerExternalGateway != null && Object.hasOwnProperty.call(message, "peerExternalGateway")) + writer.uint32(/* id 384956173, wireType 2 =*/3079649386).string(message.peerExternalGateway); + return writer; + }; + + /** + * Encodes the specified VpnGatewayStatusVpnConnection message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusVpnConnection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusVpnConnection} message VpnGatewayStatusVpnConnection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatusVpnConnection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewayStatusVpnConnection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewayStatusVpnConnection} VpnGatewayStatusVpnConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatusVpnConnection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 384956173: + message.peerExternalGateway = reader.string(); + break; + case 281867452: + message.peerGcpGateway = reader.string(); + break; + case 109757585: + message.state = $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.decode(reader, reader.uint32()); + break; + case 104561931: + if (!(message.tunnels && message.tunnels.length)) + message.tunnels = []; + message.tunnels.push($root.google.cloud.compute.v1.VpnGatewayStatusTunnel.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewayStatusVpnConnection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewayStatusVpnConnection} VpnGatewayStatusVpnConnection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatusVpnConnection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewayStatusVpnConnection message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewayStatusVpnConnection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.peerExternalGateway != null && message.hasOwnProperty("peerExternalGateway")) { + properties._peerExternalGateway = 1; + if (!$util.isString(message.peerExternalGateway)) + return "peerExternalGateway: string expected"; + } + if (message.peerGcpGateway != null && message.hasOwnProperty("peerGcpGateway")) { + properties._peerGcpGateway = 1; + if (!$util.isString(message.peerGcpGateway)) + return "peerGcpGateway: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + { + var error = $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.verify(message.state); + if (error) + return "state." + error; + } + } + if (message.tunnels != null && message.hasOwnProperty("tunnels")) { + if (!Array.isArray(message.tunnels)) + return "tunnels: array expected"; + for (var i = 0; i < message.tunnels.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnGatewayStatusTunnel.verify(message.tunnels[i]); + if (error) + return "tunnels." + error; + } + } + return null; + }; + + /** + * Creates a VpnGatewayStatusVpnConnection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewayStatusVpnConnection} VpnGatewayStatusVpnConnection + */ + VpnGatewayStatusVpnConnection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection(); + if (object.peerExternalGateway != null) + message.peerExternalGateway = String(object.peerExternalGateway); + if (object.peerGcpGateway != null) + message.peerGcpGateway = String(object.peerGcpGateway); + if (object.state != null) { + if (typeof object.state !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayStatusVpnConnection.state: object expected"); + message.state = $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.fromObject(object.state); + } + if (object.tunnels) { + if (!Array.isArray(object.tunnels)) + throw TypeError(".google.cloud.compute.v1.VpnGatewayStatusVpnConnection.tunnels: array expected"); + message.tunnels = []; + for (var i = 0; i < object.tunnels.length; ++i) { + if (typeof object.tunnels[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayStatusVpnConnection.tunnels: object expected"); + message.tunnels[i] = $root.google.cloud.compute.v1.VpnGatewayStatusTunnel.fromObject(object.tunnels[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VpnGatewayStatusVpnConnection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @static + * @param {google.cloud.compute.v1.VpnGatewayStatusVpnConnection} message VpnGatewayStatusVpnConnection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewayStatusVpnConnection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tunnels = []; + if (message.tunnels && message.tunnels.length) { + object.tunnels = []; + for (var j = 0; j < message.tunnels.length; ++j) + object.tunnels[j] = $root.google.cloud.compute.v1.VpnGatewayStatusTunnel.toObject(message.tunnels[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.toObject(message.state, options); + if (options.oneofs) + object._state = "state"; + } + if (message.peerGcpGateway != null && message.hasOwnProperty("peerGcpGateway")) { + object.peerGcpGateway = message.peerGcpGateway; + if (options.oneofs) + object._peerGcpGateway = "peerGcpGateway"; + } + if (message.peerExternalGateway != null && message.hasOwnProperty("peerExternalGateway")) { + object.peerExternalGateway = message.peerExternalGateway; + if (options.oneofs) + object._peerExternalGateway = "peerExternalGateway"; + } + return object; + }; + + /** + * Converts this VpnGatewayStatusVpnConnection to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewayStatusVpnConnection + * @instance + * @returns {Object.} JSON object + */ + VpnGatewayStatusVpnConnection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewayStatusVpnConnection; + })(); + + v1.VpnGatewayStatus = (function() { + + /** + * Properties of a VpnGatewayStatus. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewayStatus + * @property {Array.|null} [vpnConnections] VpnGatewayStatus vpnConnections + */ + + /** + * Constructs a new VpnGatewayStatus. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewayStatus. + * @implements IVpnGatewayStatus + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewayStatus=} [properties] Properties to set + */ + function VpnGatewayStatus(properties) { + this.vpnConnections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewayStatus vpnConnections. + * @member {Array.} vpnConnections + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @instance + */ + VpnGatewayStatus.prototype.vpnConnections = $util.emptyArray; + + /** + * Creates a new VpnGatewayStatus instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatus=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewayStatus} VpnGatewayStatus instance + */ + VpnGatewayStatus.create = function create(properties) { + return new VpnGatewayStatus(properties); + }; + + /** + * Encodes the specified VpnGatewayStatus message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatus} message VpnGatewayStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vpnConnections != null && message.vpnConnections.length) + for (var i = 0; i < message.vpnConnections.length; ++i) + $root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection.encode(message.vpnConnections[i], writer.uint32(/* id 439334538, wireType 2 =*/3514676306).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VpnGatewayStatus message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatus} message VpnGatewayStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewayStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewayStatus} VpnGatewayStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewayStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 439334538: + if (!(message.vpnConnections && message.vpnConnections.length)) + message.vpnConnections = []; + message.vpnConnections.push($root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewayStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewayStatus} VpnGatewayStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewayStatus message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewayStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vpnConnections != null && message.hasOwnProperty("vpnConnections")) { + if (!Array.isArray(message.vpnConnections)) + return "vpnConnections: array expected"; + for (var i = 0; i < message.vpnConnections.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection.verify(message.vpnConnections[i]); + if (error) + return "vpnConnections." + error; + } + } + return null; + }; + + /** + * Creates a VpnGatewayStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewayStatus} VpnGatewayStatus + */ + VpnGatewayStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewayStatus) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewayStatus(); + if (object.vpnConnections) { + if (!Array.isArray(object.vpnConnections)) + throw TypeError(".google.cloud.compute.v1.VpnGatewayStatus.vpnConnections: array expected"); + message.vpnConnections = []; + for (var i = 0; i < object.vpnConnections.length; ++i) { + if (typeof object.vpnConnections[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewayStatus.vpnConnections: object expected"); + message.vpnConnections[i] = $root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection.fromObject(object.vpnConnections[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VpnGatewayStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @static + * @param {google.cloud.compute.v1.VpnGatewayStatus} message VpnGatewayStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewayStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vpnConnections = []; + if (message.vpnConnections && message.vpnConnections.length) { + object.vpnConnections = []; + for (var j = 0; j < message.vpnConnections.length; ++j) + object.vpnConnections[j] = $root.google.cloud.compute.v1.VpnGatewayStatusVpnConnection.toObject(message.vpnConnections[j], options); + } + return object; + }; + + /** + * Converts this VpnGatewayStatus to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewayStatus + * @instance + * @returns {Object.} JSON object + */ + VpnGatewayStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewayStatus; + })(); + + v1.VpnGatewayStatusHighAvailabilityRequirementState = (function() { + + /** + * Properties of a VpnGatewayStatusHighAvailabilityRequirementState. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewayStatusHighAvailabilityRequirementState + * @property {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State|null} [state] VpnGatewayStatusHighAvailabilityRequirementState state + * @property {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason|null} [unsatisfiedReason] VpnGatewayStatusHighAvailabilityRequirementState unsatisfiedReason + */ + + /** + * Constructs a new VpnGatewayStatusHighAvailabilityRequirementState. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewayStatusHighAvailabilityRequirementState. + * @implements IVpnGatewayStatusHighAvailabilityRequirementState + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState=} [properties] Properties to set + */ + function VpnGatewayStatusHighAvailabilityRequirementState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewayStatusHighAvailabilityRequirementState state. + * @member {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State|null|undefined} state + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @instance + */ + VpnGatewayStatusHighAvailabilityRequirementState.prototype.state = null; + + /** + * VpnGatewayStatusHighAvailabilityRequirementState unsatisfiedReason. + * @member {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason|null|undefined} unsatisfiedReason + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @instance + */ + VpnGatewayStatusHighAvailabilityRequirementState.prototype.unsatisfiedReason = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewayStatusHighAvailabilityRequirementState _state. + * @member {"state"|undefined} _state + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @instance + */ + Object.defineProperty(VpnGatewayStatusHighAvailabilityRequirementState.prototype, "_state", { + get: $util.oneOfGetter($oneOfFields = ["state"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayStatusHighAvailabilityRequirementState _unsatisfiedReason. + * @member {"unsatisfiedReason"|undefined} _unsatisfiedReason + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @instance + */ + Object.defineProperty(VpnGatewayStatusHighAvailabilityRequirementState.prototype, "_unsatisfiedReason", { + get: $util.oneOfGetter($oneOfFields = ["unsatisfiedReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewayStatusHighAvailabilityRequirementState instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState} VpnGatewayStatusHighAvailabilityRequirementState instance + */ + VpnGatewayStatusHighAvailabilityRequirementState.create = function create(properties) { + return new VpnGatewayStatusHighAvailabilityRequirementState(properties); + }; + + /** + * Encodes the specified VpnGatewayStatusHighAvailabilityRequirementState message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState} message VpnGatewayStatusHighAvailabilityRequirementState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatusHighAvailabilityRequirementState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unsatisfiedReason != null && Object.hasOwnProperty.call(message, "unsatisfiedReason")) + writer.uint32(/* id 55016330, wireType 0 =*/440130640).int32(message.unsatisfiedReason); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 109757585, wireType 0 =*/878060680).int32(message.state); + return writer; + }; + + /** + * Encodes the specified VpnGatewayStatusHighAvailabilityRequirementState message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusHighAvailabilityRequirementState} message VpnGatewayStatusHighAvailabilityRequirementState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatusHighAvailabilityRequirementState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewayStatusHighAvailabilityRequirementState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState} VpnGatewayStatusHighAvailabilityRequirementState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatusHighAvailabilityRequirementState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 109757585: + message.state = reader.int32(); + break; + case 55016330: + message.unsatisfiedReason = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewayStatusHighAvailabilityRequirementState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState} VpnGatewayStatusHighAvailabilityRequirementState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatusHighAvailabilityRequirementState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewayStatusHighAvailabilityRequirementState message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewayStatusHighAvailabilityRequirementState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.state != null && message.hasOwnProperty("state")) { + properties._state = 1; + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 505242907: + case 511863311: + break; + } + } + if (message.unsatisfiedReason != null && message.hasOwnProperty("unsatisfiedReason")) { + properties._unsatisfiedReason = 1; + switch (message.unsatisfiedReason) { + default: + return "unsatisfiedReason: enum value expected"; + case 0: + case 55917437: + break; + } + } + return null; + }; + + /** + * Creates a VpnGatewayStatusHighAvailabilityRequirementState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState} VpnGatewayStatusHighAvailabilityRequirementState + */ + VpnGatewayStatusHighAvailabilityRequirementState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState(); + switch (object.state) { + case "UNDEFINED_STATE": + case 0: + message.state = 0; + break; + case "CONNECTION_REDUNDANCY_MET": + case 505242907: + message.state = 505242907; + break; + case "CONNECTION_REDUNDANCY_NOT_MET": + case 511863311: + message.state = 511863311; + break; + } + switch (object.unsatisfiedReason) { + case "UNDEFINED_UNSATISFIED_REASON": + case 0: + message.unsatisfiedReason = 0; + break; + case "INCOMPLETE_TUNNELS_COVERAGE": + case 55917437: + message.unsatisfiedReason = 55917437; + break; + } + return message; + }; + + /** + * Creates a plain object from a VpnGatewayStatusHighAvailabilityRequirementState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @static + * @param {google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState} message VpnGatewayStatusHighAvailabilityRequirementState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewayStatusHighAvailabilityRequirementState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.unsatisfiedReason != null && message.hasOwnProperty("unsatisfiedReason")) { + object.unsatisfiedReason = options.enums === String ? $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason[message.unsatisfiedReason] : message.unsatisfiedReason; + if (options.oneofs) + object._unsatisfiedReason = "unsatisfiedReason"; + } + if (message.state != null && message.hasOwnProperty("state")) { + object.state = options.enums === String ? $root.google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State[message.state] : message.state; + if (options.oneofs) + object._state = "state"; + } + return object; + }; + + /** + * Converts this VpnGatewayStatusHighAvailabilityRequirementState to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState + * @instance + * @returns {Object.} JSON object + */ + VpnGatewayStatusHighAvailabilityRequirementState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.State + * @enum {number} + * @property {number} UNDEFINED_STATE=0 UNDEFINED_STATE value + * @property {number} CONNECTION_REDUNDANCY_MET=505242907 CONNECTION_REDUNDANCY_MET value + * @property {number} CONNECTION_REDUNDANCY_NOT_MET=511863311 CONNECTION_REDUNDANCY_NOT_MET value + */ + VpnGatewayStatusHighAvailabilityRequirementState.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATE"] = 0; + values[valuesById[505242907] = "CONNECTION_REDUNDANCY_MET"] = 505242907; + values[valuesById[511863311] = "CONNECTION_REDUNDANCY_NOT_MET"] = 511863311; + return values; + })(); + + /** + * UnsatisfiedReason enum. + * @name google.cloud.compute.v1.VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason + * @enum {number} + * @property {number} UNDEFINED_UNSATISFIED_REASON=0 UNDEFINED_UNSATISFIED_REASON value + * @property {number} INCOMPLETE_TUNNELS_COVERAGE=55917437 INCOMPLETE_TUNNELS_COVERAGE value + */ + VpnGatewayStatusHighAvailabilityRequirementState.UnsatisfiedReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_UNSATISFIED_REASON"] = 0; + values[valuesById[55917437] = "INCOMPLETE_TUNNELS_COVERAGE"] = 55917437; + return values; + })(); + + return VpnGatewayStatusHighAvailabilityRequirementState; + })(); + + v1.VpnGatewayStatusTunnel = (function() { + + /** + * Properties of a VpnGatewayStatusTunnel. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewayStatusTunnel + * @property {number|null} [localGatewayInterface] VpnGatewayStatusTunnel localGatewayInterface + * @property {number|null} [peerGatewayInterface] VpnGatewayStatusTunnel peerGatewayInterface + * @property {string|null} [tunnelUrl] VpnGatewayStatusTunnel tunnelUrl + */ + + /** + * Constructs a new VpnGatewayStatusTunnel. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewayStatusTunnel. + * @implements IVpnGatewayStatusTunnel + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewayStatusTunnel=} [properties] Properties to set + */ + function VpnGatewayStatusTunnel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewayStatusTunnel localGatewayInterface. + * @member {number|null|undefined} localGatewayInterface + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @instance + */ + VpnGatewayStatusTunnel.prototype.localGatewayInterface = null; + + /** + * VpnGatewayStatusTunnel peerGatewayInterface. + * @member {number|null|undefined} peerGatewayInterface + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @instance + */ + VpnGatewayStatusTunnel.prototype.peerGatewayInterface = null; + + /** + * VpnGatewayStatusTunnel tunnelUrl. + * @member {string|null|undefined} tunnelUrl + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @instance + */ + VpnGatewayStatusTunnel.prototype.tunnelUrl = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewayStatusTunnel _localGatewayInterface. + * @member {"localGatewayInterface"|undefined} _localGatewayInterface + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @instance + */ + Object.defineProperty(VpnGatewayStatusTunnel.prototype, "_localGatewayInterface", { + get: $util.oneOfGetter($oneOfFields = ["localGatewayInterface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayStatusTunnel _peerGatewayInterface. + * @member {"peerGatewayInterface"|undefined} _peerGatewayInterface + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @instance + */ + Object.defineProperty(VpnGatewayStatusTunnel.prototype, "_peerGatewayInterface", { + get: $util.oneOfGetter($oneOfFields = ["peerGatewayInterface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnGatewayStatusTunnel _tunnelUrl. + * @member {"tunnelUrl"|undefined} _tunnelUrl + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @instance + */ + Object.defineProperty(VpnGatewayStatusTunnel.prototype, "_tunnelUrl", { + get: $util.oneOfGetter($oneOfFields = ["tunnelUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewayStatusTunnel instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusTunnel=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewayStatusTunnel} VpnGatewayStatusTunnel instance + */ + VpnGatewayStatusTunnel.create = function create(properties) { + return new VpnGatewayStatusTunnel(properties); + }; + + /** + * Encodes the specified VpnGatewayStatusTunnel message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusTunnel.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusTunnel} message VpnGatewayStatusTunnel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatusTunnel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunnelUrl != null && Object.hasOwnProperty.call(message, "tunnelUrl")) + writer.uint32(/* id 78975256, wireType 2 =*/631802050).string(message.tunnelUrl); + if (message.localGatewayInterface != null && Object.hasOwnProperty.call(message, "localGatewayInterface")) + writer.uint32(/* id 158764330, wireType 0 =*/1270114640).uint32(message.localGatewayInterface); + if (message.peerGatewayInterface != null && Object.hasOwnProperty.call(message, "peerGatewayInterface")) + writer.uint32(/* id 214380385, wireType 0 =*/1715043080).uint32(message.peerGatewayInterface); + return writer; + }; + + /** + * Encodes the specified VpnGatewayStatusTunnel message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewayStatusTunnel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {google.cloud.compute.v1.IVpnGatewayStatusTunnel} message VpnGatewayStatusTunnel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewayStatusTunnel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewayStatusTunnel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewayStatusTunnel} VpnGatewayStatusTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatusTunnel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewayStatusTunnel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 158764330: + message.localGatewayInterface = reader.uint32(); + break; + case 214380385: + message.peerGatewayInterface = reader.uint32(); + break; + case 78975256: + message.tunnelUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewayStatusTunnel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewayStatusTunnel} VpnGatewayStatusTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewayStatusTunnel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewayStatusTunnel message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewayStatusTunnel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.localGatewayInterface != null && message.hasOwnProperty("localGatewayInterface")) { + properties._localGatewayInterface = 1; + if (!$util.isInteger(message.localGatewayInterface)) + return "localGatewayInterface: integer expected"; + } + if (message.peerGatewayInterface != null && message.hasOwnProperty("peerGatewayInterface")) { + properties._peerGatewayInterface = 1; + if (!$util.isInteger(message.peerGatewayInterface)) + return "peerGatewayInterface: integer expected"; + } + if (message.tunnelUrl != null && message.hasOwnProperty("tunnelUrl")) { + properties._tunnelUrl = 1; + if (!$util.isString(message.tunnelUrl)) + return "tunnelUrl: string expected"; + } + return null; + }; + + /** + * Creates a VpnGatewayStatusTunnel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewayStatusTunnel} VpnGatewayStatusTunnel + */ + VpnGatewayStatusTunnel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewayStatusTunnel) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewayStatusTunnel(); + if (object.localGatewayInterface != null) + message.localGatewayInterface = object.localGatewayInterface >>> 0; + if (object.peerGatewayInterface != null) + message.peerGatewayInterface = object.peerGatewayInterface >>> 0; + if (object.tunnelUrl != null) + message.tunnelUrl = String(object.tunnelUrl); + return message; + }; + + /** + * Creates a plain object from a VpnGatewayStatusTunnel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @static + * @param {google.cloud.compute.v1.VpnGatewayStatusTunnel} message VpnGatewayStatusTunnel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewayStatusTunnel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tunnelUrl != null && message.hasOwnProperty("tunnelUrl")) { + object.tunnelUrl = message.tunnelUrl; + if (options.oneofs) + object._tunnelUrl = "tunnelUrl"; + } + if (message.localGatewayInterface != null && message.hasOwnProperty("localGatewayInterface")) { + object.localGatewayInterface = message.localGatewayInterface; + if (options.oneofs) + object._localGatewayInterface = "localGatewayInterface"; + } + if (message.peerGatewayInterface != null && message.hasOwnProperty("peerGatewayInterface")) { + object.peerGatewayInterface = message.peerGatewayInterface; + if (options.oneofs) + object._peerGatewayInterface = "peerGatewayInterface"; + } + return object; + }; + + /** + * Converts this VpnGatewayStatusTunnel to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewayStatusTunnel + * @instance + * @returns {Object.} JSON object + */ + VpnGatewayStatusTunnel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewayStatusTunnel; + })(); + + v1.VpnGatewaysGetStatusResponse = (function() { + + /** + * Properties of a VpnGatewaysGetStatusResponse. + * @memberof google.cloud.compute.v1 + * @interface IVpnGatewaysGetStatusResponse + * @property {google.cloud.compute.v1.IVpnGatewayStatus|null} [result] VpnGatewaysGetStatusResponse result + */ + + /** + * Constructs a new VpnGatewaysGetStatusResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGatewaysGetStatusResponse. + * @implements IVpnGatewaysGetStatusResponse + * @constructor + * @param {google.cloud.compute.v1.IVpnGatewaysGetStatusResponse=} [properties] Properties to set + */ + function VpnGatewaysGetStatusResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnGatewaysGetStatusResponse result. + * @member {google.cloud.compute.v1.IVpnGatewayStatus|null|undefined} result + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @instance + */ + VpnGatewaysGetStatusResponse.prototype.result = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnGatewaysGetStatusResponse _result. + * @member {"result"|undefined} _result + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @instance + */ + Object.defineProperty(VpnGatewaysGetStatusResponse.prototype, "_result", { + get: $util.oneOfGetter($oneOfFields = ["result"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnGatewaysGetStatusResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {google.cloud.compute.v1.IVpnGatewaysGetStatusResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnGatewaysGetStatusResponse} VpnGatewaysGetStatusResponse instance + */ + VpnGatewaysGetStatusResponse.create = function create(properties) { + return new VpnGatewaysGetStatusResponse(properties); + }; + + /** + * Encodes the specified VpnGatewaysGetStatusResponse message. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysGetStatusResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {google.cloud.compute.v1.IVpnGatewaysGetStatusResponse} message VpnGatewaysGetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewaysGetStatusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.google.cloud.compute.v1.VpnGatewayStatus.encode(message.result, writer.uint32(/* id 139315229, wireType 2 =*/1114521834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VpnGatewaysGetStatusResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnGatewaysGetStatusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {google.cloud.compute.v1.IVpnGatewaysGetStatusResponse} message VpnGatewaysGetStatusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnGatewaysGetStatusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnGatewaysGetStatusResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnGatewaysGetStatusResponse} VpnGatewaysGetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewaysGetStatusResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnGatewaysGetStatusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 139315229: + message.result = $root.google.cloud.compute.v1.VpnGatewayStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnGatewaysGetStatusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnGatewaysGetStatusResponse} VpnGatewaysGetStatusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnGatewaysGetStatusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnGatewaysGetStatusResponse message. + * @function verify + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnGatewaysGetStatusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.result != null && message.hasOwnProperty("result")) { + properties._result = 1; + { + var error = $root.google.cloud.compute.v1.VpnGatewayStatus.verify(message.result); + if (error) + return "result." + error; + } + } + return null; + }; + + /** + * Creates a VpnGatewaysGetStatusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnGatewaysGetStatusResponse} VpnGatewaysGetStatusResponse + */ + VpnGatewaysGetStatusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnGatewaysGetStatusResponse) + return object; + var message = new $root.google.cloud.compute.v1.VpnGatewaysGetStatusResponse(); + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".google.cloud.compute.v1.VpnGatewaysGetStatusResponse.result: object expected"); + message.result = $root.google.cloud.compute.v1.VpnGatewayStatus.fromObject(object.result); + } + return message; + }; + + /** + * Creates a plain object from a VpnGatewaysGetStatusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @static + * @param {google.cloud.compute.v1.VpnGatewaysGetStatusResponse} message VpnGatewaysGetStatusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnGatewaysGetStatusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.result != null && message.hasOwnProperty("result")) { + object.result = $root.google.cloud.compute.v1.VpnGatewayStatus.toObject(message.result, options); + if (options.oneofs) + object._result = "result"; + } + return object; + }; + + /** + * Converts this VpnGatewaysGetStatusResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnGatewaysGetStatusResponse + * @instance + * @returns {Object.} JSON object + */ + VpnGatewaysGetStatusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnGatewaysGetStatusResponse; + })(); + + v1.VpnTunnel = (function() { + + /** + * Properties of a VpnTunnel. + * @memberof google.cloud.compute.v1 + * @interface IVpnTunnel + * @property {string|null} [creationTimestamp] VpnTunnel creationTimestamp + * @property {string|null} [description] VpnTunnel description + * @property {string|null} [detailedStatus] VpnTunnel detailedStatus + * @property {number|Long|null} [id] VpnTunnel id + * @property {number|null} [ikeVersion] VpnTunnel ikeVersion + * @property {string|null} [kind] VpnTunnel kind + * @property {Array.|null} [localTrafficSelector] VpnTunnel localTrafficSelector + * @property {string|null} [name] VpnTunnel name + * @property {string|null} [peerExternalGateway] VpnTunnel peerExternalGateway + * @property {number|null} [peerExternalGatewayInterface] VpnTunnel peerExternalGatewayInterface + * @property {string|null} [peerGcpGateway] VpnTunnel peerGcpGateway + * @property {string|null} [peerIp] VpnTunnel peerIp + * @property {string|null} [region] VpnTunnel region + * @property {Array.|null} [remoteTrafficSelector] VpnTunnel remoteTrafficSelector + * @property {string|null} [router] VpnTunnel router + * @property {string|null} [selfLink] VpnTunnel selfLink + * @property {string|null} [sharedSecret] VpnTunnel sharedSecret + * @property {string|null} [sharedSecretHash] VpnTunnel sharedSecretHash + * @property {google.cloud.compute.v1.VpnTunnel.Status|null} [status] VpnTunnel status + * @property {string|null} [targetVpnGateway] VpnTunnel targetVpnGateway + * @property {string|null} [vpnGateway] VpnTunnel vpnGateway + * @property {number|null} [vpnGatewayInterface] VpnTunnel vpnGatewayInterface + */ + + /** + * Constructs a new VpnTunnel. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnTunnel. + * @implements IVpnTunnel + * @constructor + * @param {google.cloud.compute.v1.IVpnTunnel=} [properties] Properties to set + */ + function VpnTunnel(properties) { + this.localTrafficSelector = []; + this.remoteTrafficSelector = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnTunnel creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.creationTimestamp = null; + + /** + * VpnTunnel description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.description = null; + + /** + * VpnTunnel detailedStatus. + * @member {string|null|undefined} detailedStatus + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.detailedStatus = null; + + /** + * VpnTunnel id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.id = null; + + /** + * VpnTunnel ikeVersion. + * @member {number|null|undefined} ikeVersion + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.ikeVersion = null; + + /** + * VpnTunnel kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.kind = null; + + /** + * VpnTunnel localTrafficSelector. + * @member {Array.} localTrafficSelector + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.localTrafficSelector = $util.emptyArray; + + /** + * VpnTunnel name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.name = null; + + /** + * VpnTunnel peerExternalGateway. + * @member {string|null|undefined} peerExternalGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.peerExternalGateway = null; + + /** + * VpnTunnel peerExternalGatewayInterface. + * @member {number|null|undefined} peerExternalGatewayInterface + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.peerExternalGatewayInterface = null; + + /** + * VpnTunnel peerGcpGateway. + * @member {string|null|undefined} peerGcpGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.peerGcpGateway = null; + + /** + * VpnTunnel peerIp. + * @member {string|null|undefined} peerIp + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.peerIp = null; + + /** + * VpnTunnel region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.region = null; + + /** + * VpnTunnel remoteTrafficSelector. + * @member {Array.} remoteTrafficSelector + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.remoteTrafficSelector = $util.emptyArray; + + /** + * VpnTunnel router. + * @member {string|null|undefined} router + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.router = null; + + /** + * VpnTunnel selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.selfLink = null; + + /** + * VpnTunnel sharedSecret. + * @member {string|null|undefined} sharedSecret + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.sharedSecret = null; + + /** + * VpnTunnel sharedSecretHash. + * @member {string|null|undefined} sharedSecretHash + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.sharedSecretHash = null; + + /** + * VpnTunnel status. + * @member {google.cloud.compute.v1.VpnTunnel.Status|null|undefined} status + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.status = null; + + /** + * VpnTunnel targetVpnGateway. + * @member {string|null|undefined} targetVpnGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.targetVpnGateway = null; + + /** + * VpnTunnel vpnGateway. + * @member {string|null|undefined} vpnGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.vpnGateway = null; + + /** + * VpnTunnel vpnGatewayInterface. + * @member {number|null|undefined} vpnGatewayInterface + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + VpnTunnel.prototype.vpnGatewayInterface = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnTunnel _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _detailedStatus. + * @member {"detailedStatus"|undefined} _detailedStatus + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_detailedStatus", { + get: $util.oneOfGetter($oneOfFields = ["detailedStatus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _ikeVersion. + * @member {"ikeVersion"|undefined} _ikeVersion + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_ikeVersion", { + get: $util.oneOfGetter($oneOfFields = ["ikeVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _peerExternalGateway. + * @member {"peerExternalGateway"|undefined} _peerExternalGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_peerExternalGateway", { + get: $util.oneOfGetter($oneOfFields = ["peerExternalGateway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _peerExternalGatewayInterface. + * @member {"peerExternalGatewayInterface"|undefined} _peerExternalGatewayInterface + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_peerExternalGatewayInterface", { + get: $util.oneOfGetter($oneOfFields = ["peerExternalGatewayInterface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _peerGcpGateway. + * @member {"peerGcpGateway"|undefined} _peerGcpGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_peerGcpGateway", { + get: $util.oneOfGetter($oneOfFields = ["peerGcpGateway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _peerIp. + * @member {"peerIp"|undefined} _peerIp + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_peerIp", { + get: $util.oneOfGetter($oneOfFields = ["peerIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _router. + * @member {"router"|undefined} _router + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_router", { + get: $util.oneOfGetter($oneOfFields = ["router"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _sharedSecret. + * @member {"sharedSecret"|undefined} _sharedSecret + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_sharedSecret", { + get: $util.oneOfGetter($oneOfFields = ["sharedSecret"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _sharedSecretHash. + * @member {"sharedSecretHash"|undefined} _sharedSecretHash + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_sharedSecretHash", { + get: $util.oneOfGetter($oneOfFields = ["sharedSecretHash"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _targetVpnGateway. + * @member {"targetVpnGateway"|undefined} _targetVpnGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_targetVpnGateway", { + get: $util.oneOfGetter($oneOfFields = ["targetVpnGateway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _vpnGateway. + * @member {"vpnGateway"|undefined} _vpnGateway + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_vpnGateway", { + get: $util.oneOfGetter($oneOfFields = ["vpnGateway"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnel _vpnGatewayInterface. + * @member {"vpnGatewayInterface"|undefined} _vpnGatewayInterface + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + */ + Object.defineProperty(VpnTunnel.prototype, "_vpnGatewayInterface", { + get: $util.oneOfGetter($oneOfFields = ["vpnGatewayInterface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnTunnel instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {google.cloud.compute.v1.IVpnTunnel=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnTunnel} VpnTunnel instance + */ + VpnTunnel.create = function create(properties) { + return new VpnTunnel(properties); + }; + + /** + * Encodes the specified VpnTunnel message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnel.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {google.cloud.compute.v1.IVpnTunnel} message VpnTunnel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.vpnGatewayInterface != null && Object.hasOwnProperty.call(message, "vpnGatewayInterface")) + writer.uint32(/* id 95979123, wireType 0 =*/767832984).int32(message.vpnGatewayInterface); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.ikeVersion != null && Object.hasOwnProperty.call(message, "ikeVersion")) + writer.uint32(/* id 218376220, wireType 0 =*/1747009760).int32(message.ikeVersion); + if (message.peerGcpGateway != null && Object.hasOwnProperty.call(message, "peerGcpGateway")) + writer.uint32(/* id 281867452, wireType 2 =*/2254939618).string(message.peerGcpGateway); + if (message.localTrafficSelector != null && message.localTrafficSelector.length) + for (var i = 0; i < message.localTrafficSelector.length; ++i) + writer.uint32(/* id 317314613, wireType 2 =*/2538516906).string(message.localTrafficSelector[i]); + if (message.detailedStatus != null && Object.hasOwnProperty.call(message, "detailedStatus")) + writer.uint32(/* id 333501025, wireType 2 =*/2668008202).string(message.detailedStatus); + if (message.remoteTrafficSelector != null && message.remoteTrafficSelector.length) + for (var i = 0; i < message.remoteTrafficSelector.length; ++i) + writer.uint32(/* id 358887098, wireType 2 =*/2871096786).string(message.remoteTrafficSelector[i]); + if (message.sharedSecret != null && Object.hasOwnProperty.call(message, "sharedSecret")) + writer.uint32(/* id 381932490, wireType 2 =*/3055459922).string(message.sharedSecret); + if (message.peerIp != null && Object.hasOwnProperty.call(message, "peerIp")) + writer.uint32(/* id 383249700, wireType 2 =*/3065997602).string(message.peerIp); + if (message.peerExternalGateway != null && Object.hasOwnProperty.call(message, "peerExternalGateway")) + writer.uint32(/* id 384956173, wireType 2 =*/3079649386).string(message.peerExternalGateway); + if (message.sharedSecretHash != null && Object.hasOwnProperty.call(message, "sharedSecretHash")) + writer.uint32(/* id 398881891, wireType 2 =*/3191055130).string(message.sharedSecretHash); + if (message.vpnGateway != null && Object.hasOwnProperty.call(message, "vpnGateway")) + writer.uint32(/* id 406684153, wireType 2 =*/3253473226).string(message.vpnGateway); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.peerExternalGatewayInterface != null && Object.hasOwnProperty.call(message, "peerExternalGatewayInterface")) + writer.uint32(/* id 452768391, wireType 0 =*/3622147128).int32(message.peerExternalGatewayInterface); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.targetVpnGateway != null && Object.hasOwnProperty.call(message, "targetVpnGateway")) + writer.uint32(/* id 532512843, wireType 2 =*/4260102746).string(message.targetVpnGateway); + return writer; + }; + + /** + * Encodes the specified VpnTunnel message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {google.cloud.compute.v1.IVpnTunnel} message VpnTunnel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnTunnel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnTunnel} VpnTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnTunnel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 422937596: + message.description = reader.string(); + break; + case 333501025: + message.detailedStatus = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 218376220: + message.ikeVersion = reader.int32(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 317314613: + if (!(message.localTrafficSelector && message.localTrafficSelector.length)) + message.localTrafficSelector = []; + message.localTrafficSelector.push(reader.string()); + break; + case 3373707: + message.name = reader.string(); + break; + case 384956173: + message.peerExternalGateway = reader.string(); + break; + case 452768391: + message.peerExternalGatewayInterface = reader.int32(); + break; + case 281867452: + message.peerGcpGateway = reader.string(); + break; + case 383249700: + message.peerIp = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 358887098: + if (!(message.remoteTrafficSelector && message.remoteTrafficSelector.length)) + message.remoteTrafficSelector = []; + message.remoteTrafficSelector.push(reader.string()); + break; + case 148608841: + message.router = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 381932490: + message.sharedSecret = reader.string(); + break; + case 398881891: + message.sharedSecretHash = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 532512843: + message.targetVpnGateway = reader.string(); + break; + case 406684153: + message.vpnGateway = reader.string(); + break; + case 95979123: + message.vpnGatewayInterface = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnTunnel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnTunnel} VpnTunnel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnTunnel message. + * @function verify + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnTunnel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.detailedStatus != null && message.hasOwnProperty("detailedStatus")) { + properties._detailedStatus = 1; + if (!$util.isString(message.detailedStatus)) + return "detailedStatus: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.ikeVersion != null && message.hasOwnProperty("ikeVersion")) { + properties._ikeVersion = 1; + if (!$util.isInteger(message.ikeVersion)) + return "ikeVersion: integer expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.localTrafficSelector != null && message.hasOwnProperty("localTrafficSelector")) { + if (!Array.isArray(message.localTrafficSelector)) + return "localTrafficSelector: array expected"; + for (var i = 0; i < message.localTrafficSelector.length; ++i) + if (!$util.isString(message.localTrafficSelector[i])) + return "localTrafficSelector: string[] expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.peerExternalGateway != null && message.hasOwnProperty("peerExternalGateway")) { + properties._peerExternalGateway = 1; + if (!$util.isString(message.peerExternalGateway)) + return "peerExternalGateway: string expected"; + } + if (message.peerExternalGatewayInterface != null && message.hasOwnProperty("peerExternalGatewayInterface")) { + properties._peerExternalGatewayInterface = 1; + if (!$util.isInteger(message.peerExternalGatewayInterface)) + return "peerExternalGatewayInterface: integer expected"; + } + if (message.peerGcpGateway != null && message.hasOwnProperty("peerGcpGateway")) { + properties._peerGcpGateway = 1; + if (!$util.isString(message.peerGcpGateway)) + return "peerGcpGateway: string expected"; + } + if (message.peerIp != null && message.hasOwnProperty("peerIp")) { + properties._peerIp = 1; + if (!$util.isString(message.peerIp)) + return "peerIp: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.remoteTrafficSelector != null && message.hasOwnProperty("remoteTrafficSelector")) { + if (!Array.isArray(message.remoteTrafficSelector)) + return "remoteTrafficSelector: array expected"; + for (var i = 0; i < message.remoteTrafficSelector.length; ++i) + if (!$util.isString(message.remoteTrafficSelector[i])) + return "remoteTrafficSelector: string[] expected"; + } + if (message.router != null && message.hasOwnProperty("router")) { + properties._router = 1; + if (!$util.isString(message.router)) + return "router: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.sharedSecret != null && message.hasOwnProperty("sharedSecret")) { + properties._sharedSecret = 1; + if (!$util.isString(message.sharedSecret)) + return "sharedSecret: string expected"; + } + if (message.sharedSecretHash != null && message.hasOwnProperty("sharedSecretHash")) { + properties._sharedSecretHash = 1; + if (!$util.isString(message.sharedSecretHash)) + return "sharedSecretHash: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 320922816: + case 23580290: + case 428935662: + case 88852344: + case 455706685: + case 191393000: + case 360325868: + case 193912951: + case 119983216: + case 290896621: + case 174130302: + case 444276141: + case 41640522: + break; + } + } + if (message.targetVpnGateway != null && message.hasOwnProperty("targetVpnGateway")) { + properties._targetVpnGateway = 1; + if (!$util.isString(message.targetVpnGateway)) + return "targetVpnGateway: string expected"; + } + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) { + properties._vpnGateway = 1; + if (!$util.isString(message.vpnGateway)) + return "vpnGateway: string expected"; + } + if (message.vpnGatewayInterface != null && message.hasOwnProperty("vpnGatewayInterface")) { + properties._vpnGatewayInterface = 1; + if (!$util.isInteger(message.vpnGatewayInterface)) + return "vpnGatewayInterface: integer expected"; + } + return null; + }; + + /** + * Creates a VpnTunnel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnTunnel} VpnTunnel + */ + VpnTunnel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnTunnel) + return object; + var message = new $root.google.cloud.compute.v1.VpnTunnel(); + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.description != null) + message.description = String(object.description); + if (object.detailedStatus != null) + message.detailedStatus = String(object.detailedStatus); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.ikeVersion != null) + message.ikeVersion = object.ikeVersion | 0; + if (object.kind != null) + message.kind = String(object.kind); + if (object.localTrafficSelector) { + if (!Array.isArray(object.localTrafficSelector)) + throw TypeError(".google.cloud.compute.v1.VpnTunnel.localTrafficSelector: array expected"); + message.localTrafficSelector = []; + for (var i = 0; i < object.localTrafficSelector.length; ++i) + message.localTrafficSelector[i] = String(object.localTrafficSelector[i]); + } + if (object.name != null) + message.name = String(object.name); + if (object.peerExternalGateway != null) + message.peerExternalGateway = String(object.peerExternalGateway); + if (object.peerExternalGatewayInterface != null) + message.peerExternalGatewayInterface = object.peerExternalGatewayInterface | 0; + if (object.peerGcpGateway != null) + message.peerGcpGateway = String(object.peerGcpGateway); + if (object.peerIp != null) + message.peerIp = String(object.peerIp); + if (object.region != null) + message.region = String(object.region); + if (object.remoteTrafficSelector) { + if (!Array.isArray(object.remoteTrafficSelector)) + throw TypeError(".google.cloud.compute.v1.VpnTunnel.remoteTrafficSelector: array expected"); + message.remoteTrafficSelector = []; + for (var i = 0; i < object.remoteTrafficSelector.length; ++i) + message.remoteTrafficSelector[i] = String(object.remoteTrafficSelector[i]); + } + if (object.router != null) + message.router = String(object.router); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.sharedSecret != null) + message.sharedSecret = String(object.sharedSecret); + if (object.sharedSecretHash != null) + message.sharedSecretHash = String(object.sharedSecretHash); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "ALLOCATING_RESOURCES": + case 320922816: + message.status = 320922816; + break; + case "AUTHORIZATION_ERROR": + case 23580290: + message.status = 23580290; + break; + case "DEPROVISIONING": + case 428935662: + message.status = 428935662; + break; + case "ESTABLISHED": + case 88852344: + message.status = 88852344; + break; + case "FAILED": + case 455706685: + message.status = 455706685; + break; + case "FIRST_HANDSHAKE": + case 191393000: + message.status = 191393000; + break; + case "NEGOTIATION_FAILURE": + case 360325868: + message.status = 360325868; + break; + case "NETWORK_ERROR": + case 193912951: + message.status = 193912951; + break; + case "NO_INCOMING_PACKETS": + case 119983216: + message.status = 119983216; + break; + case "PROVISIONING": + case 290896621: + message.status = 290896621; + break; + case "REJECTED": + case 174130302: + message.status = 174130302; + break; + case "STOPPED": + case 444276141: + message.status = 444276141; + break; + case "WAITING_FOR_FULL_CONFIG": + case 41640522: + message.status = 41640522; + break; + } + if (object.targetVpnGateway != null) + message.targetVpnGateway = String(object.targetVpnGateway); + if (object.vpnGateway != null) + message.vpnGateway = String(object.vpnGateway); + if (object.vpnGatewayInterface != null) + message.vpnGatewayInterface = object.vpnGatewayInterface | 0; + return message; + }; + + /** + * Creates a plain object from a VpnTunnel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnTunnel + * @static + * @param {google.cloud.compute.v1.VpnTunnel} message VpnTunnel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnTunnel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.localTrafficSelector = []; + object.remoteTrafficSelector = []; + } + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.vpnGatewayInterface != null && message.hasOwnProperty("vpnGatewayInterface")) { + object.vpnGatewayInterface = message.vpnGatewayInterface; + if (options.oneofs) + object._vpnGatewayInterface = "vpnGatewayInterface"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.router != null && message.hasOwnProperty("router")) { + object.router = message.router; + if (options.oneofs) + object._router = "router"; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.VpnTunnel.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.ikeVersion != null && message.hasOwnProperty("ikeVersion")) { + object.ikeVersion = message.ikeVersion; + if (options.oneofs) + object._ikeVersion = "ikeVersion"; + } + if (message.peerGcpGateway != null && message.hasOwnProperty("peerGcpGateway")) { + object.peerGcpGateway = message.peerGcpGateway; + if (options.oneofs) + object._peerGcpGateway = "peerGcpGateway"; + } + if (message.localTrafficSelector && message.localTrafficSelector.length) { + object.localTrafficSelector = []; + for (var j = 0; j < message.localTrafficSelector.length; ++j) + object.localTrafficSelector[j] = message.localTrafficSelector[j]; + } + if (message.detailedStatus != null && message.hasOwnProperty("detailedStatus")) { + object.detailedStatus = message.detailedStatus; + if (options.oneofs) + object._detailedStatus = "detailedStatus"; + } + if (message.remoteTrafficSelector && message.remoteTrafficSelector.length) { + object.remoteTrafficSelector = []; + for (var j = 0; j < message.remoteTrafficSelector.length; ++j) + object.remoteTrafficSelector[j] = message.remoteTrafficSelector[j]; + } + if (message.sharedSecret != null && message.hasOwnProperty("sharedSecret")) { + object.sharedSecret = message.sharedSecret; + if (options.oneofs) + object._sharedSecret = "sharedSecret"; + } + if (message.peerIp != null && message.hasOwnProperty("peerIp")) { + object.peerIp = message.peerIp; + if (options.oneofs) + object._peerIp = "peerIp"; + } + if (message.peerExternalGateway != null && message.hasOwnProperty("peerExternalGateway")) { + object.peerExternalGateway = message.peerExternalGateway; + if (options.oneofs) + object._peerExternalGateway = "peerExternalGateway"; + } + if (message.sharedSecretHash != null && message.hasOwnProperty("sharedSecretHash")) { + object.sharedSecretHash = message.sharedSecretHash; + if (options.oneofs) + object._sharedSecretHash = "sharedSecretHash"; + } + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) { + object.vpnGateway = message.vpnGateway; + if (options.oneofs) + object._vpnGateway = "vpnGateway"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.peerExternalGatewayInterface != null && message.hasOwnProperty("peerExternalGatewayInterface")) { + object.peerExternalGatewayInterface = message.peerExternalGatewayInterface; + if (options.oneofs) + object._peerExternalGatewayInterface = "peerExternalGatewayInterface"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.targetVpnGateway != null && message.hasOwnProperty("targetVpnGateway")) { + object.targetVpnGateway = message.targetVpnGateway; + if (options.oneofs) + object._targetVpnGateway = "targetVpnGateway"; + } + return object; + }; + + /** + * Converts this VpnTunnel to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnTunnel + * @instance + * @returns {Object.} JSON object + */ + VpnTunnel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.VpnTunnel.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} ALLOCATING_RESOURCES=320922816 ALLOCATING_RESOURCES value + * @property {number} AUTHORIZATION_ERROR=23580290 AUTHORIZATION_ERROR value + * @property {number} DEPROVISIONING=428935662 DEPROVISIONING value + * @property {number} ESTABLISHED=88852344 ESTABLISHED value + * @property {number} FAILED=455706685 FAILED value + * @property {number} FIRST_HANDSHAKE=191393000 FIRST_HANDSHAKE value + * @property {number} NEGOTIATION_FAILURE=360325868 NEGOTIATION_FAILURE value + * @property {number} NETWORK_ERROR=193912951 NETWORK_ERROR value + * @property {number} NO_INCOMING_PACKETS=119983216 NO_INCOMING_PACKETS value + * @property {number} PROVISIONING=290896621 PROVISIONING value + * @property {number} REJECTED=174130302 REJECTED value + * @property {number} STOPPED=444276141 STOPPED value + * @property {number} WAITING_FOR_FULL_CONFIG=41640522 WAITING_FOR_FULL_CONFIG value + */ + VpnTunnel.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[320922816] = "ALLOCATING_RESOURCES"] = 320922816; + values[valuesById[23580290] = "AUTHORIZATION_ERROR"] = 23580290; + values[valuesById[428935662] = "DEPROVISIONING"] = 428935662; + values[valuesById[88852344] = "ESTABLISHED"] = 88852344; + values[valuesById[455706685] = "FAILED"] = 455706685; + values[valuesById[191393000] = "FIRST_HANDSHAKE"] = 191393000; + values[valuesById[360325868] = "NEGOTIATION_FAILURE"] = 360325868; + values[valuesById[193912951] = "NETWORK_ERROR"] = 193912951; + values[valuesById[119983216] = "NO_INCOMING_PACKETS"] = 119983216; + values[valuesById[290896621] = "PROVISIONING"] = 290896621; + values[valuesById[174130302] = "REJECTED"] = 174130302; + values[valuesById[444276141] = "STOPPED"] = 444276141; + values[valuesById[41640522] = "WAITING_FOR_FULL_CONFIG"] = 41640522; + return values; + })(); + + return VpnTunnel; + })(); + + v1.VpnTunnelsScopedList = (function() { + + /** + * Properties of a VpnTunnelsScopedList. + * @memberof google.cloud.compute.v1 + * @interface IVpnTunnelsScopedList + * @property {Array.|null} [vpnTunnels] VpnTunnelsScopedList vpnTunnels + * @property {google.cloud.compute.v1.IWarning|null} [warning] VpnTunnelsScopedList warning + */ + + /** + * Constructs a new VpnTunnelsScopedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnTunnelsScopedList. + * @implements IVpnTunnelsScopedList + * @constructor + * @param {google.cloud.compute.v1.IVpnTunnelsScopedList=} [properties] Properties to set + */ + function VpnTunnelsScopedList(properties) { + this.vpnTunnels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnTunnelsScopedList vpnTunnels. + * @member {Array.} vpnTunnels + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @instance + */ + VpnTunnelsScopedList.prototype.vpnTunnels = $util.emptyArray; + + /** + * VpnTunnelsScopedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @instance + */ + VpnTunnelsScopedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnTunnelsScopedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @instance + */ + Object.defineProperty(VpnTunnelsScopedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnTunnelsScopedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelsScopedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnTunnelsScopedList} VpnTunnelsScopedList instance + */ + VpnTunnelsScopedList.create = function create(properties) { + return new VpnTunnelsScopedList(properties); + }; + + /** + * Encodes the specified VpnTunnelsScopedList message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelsScopedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelsScopedList} message VpnTunnelsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnelsScopedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.vpnTunnels != null && message.vpnTunnels.length) + for (var i = 0; i < message.vpnTunnels.length; ++i) + $root.google.cloud.compute.v1.VpnTunnel.encode(message.vpnTunnels[i], writer.uint32(/* id 163494080, wireType 2 =*/1307952642).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VpnTunnelsScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelsScopedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelsScopedList} message VpnTunnelsScopedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnelsScopedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnTunnelsScopedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnTunnelsScopedList} VpnTunnelsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnelsScopedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnTunnelsScopedList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 163494080: + if (!(message.vpnTunnels && message.vpnTunnels.length)) + message.vpnTunnels = []; + message.vpnTunnels.push($root.google.cloud.compute.v1.VpnTunnel.decode(reader, reader.uint32())); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnTunnelsScopedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnTunnelsScopedList} VpnTunnelsScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnelsScopedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnTunnelsScopedList message. + * @function verify + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnTunnelsScopedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vpnTunnels != null && message.hasOwnProperty("vpnTunnels")) { + if (!Array.isArray(message.vpnTunnels)) + return "vpnTunnels: array expected"; + for (var i = 0; i < message.vpnTunnels.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnTunnel.verify(message.vpnTunnels[i]); + if (error) + return "vpnTunnels." + error; + } + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a VpnTunnelsScopedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnTunnelsScopedList} VpnTunnelsScopedList + */ + VpnTunnelsScopedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnTunnelsScopedList) + return object; + var message = new $root.google.cloud.compute.v1.VpnTunnelsScopedList(); + if (object.vpnTunnels) { + if (!Array.isArray(object.vpnTunnels)) + throw TypeError(".google.cloud.compute.v1.VpnTunnelsScopedList.vpnTunnels: array expected"); + message.vpnTunnels = []; + for (var i = 0; i < object.vpnTunnels.length; ++i) { + if (typeof object.vpnTunnels[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnTunnelsScopedList.vpnTunnels: object expected"); + message.vpnTunnels[i] = $root.google.cloud.compute.v1.VpnTunnel.fromObject(object.vpnTunnels[i]); + } + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.VpnTunnelsScopedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a VpnTunnelsScopedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @static + * @param {google.cloud.compute.v1.VpnTunnelsScopedList} message VpnTunnelsScopedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnTunnelsScopedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vpnTunnels = []; + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.vpnTunnels && message.vpnTunnels.length) { + object.vpnTunnels = []; + for (var j = 0; j < message.vpnTunnels.length; ++j) + object.vpnTunnels[j] = $root.google.cloud.compute.v1.VpnTunnel.toObject(message.vpnTunnels[j], options); + } + return object; + }; + + /** + * Converts this VpnTunnelsScopedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnTunnelsScopedList + * @instance + * @returns {Object.} JSON object + */ + VpnTunnelsScopedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnTunnelsScopedList; + })(); + + v1.VpnTunnelAggregatedList = (function() { + + /** + * Properties of a VpnTunnelAggregatedList. + * @memberof google.cloud.compute.v1 + * @interface IVpnTunnelAggregatedList + * @property {string|null} [id] VpnTunnelAggregatedList id + * @property {Object.|null} [items] VpnTunnelAggregatedList items + * @property {string|null} [kind] VpnTunnelAggregatedList kind + * @property {string|null} [nextPageToken] VpnTunnelAggregatedList nextPageToken + * @property {string|null} [selfLink] VpnTunnelAggregatedList selfLink + * @property {Array.|null} [unreachables] VpnTunnelAggregatedList unreachables + * @property {google.cloud.compute.v1.IWarning|null} [warning] VpnTunnelAggregatedList warning + */ + + /** + * Constructs a new VpnTunnelAggregatedList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnTunnelAggregatedList. + * @implements IVpnTunnelAggregatedList + * @constructor + * @param {google.cloud.compute.v1.IVpnTunnelAggregatedList=} [properties] Properties to set + */ + function VpnTunnelAggregatedList(properties) { + this.items = {}; + this.unreachables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnTunnelAggregatedList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + VpnTunnelAggregatedList.prototype.id = null; + + /** + * VpnTunnelAggregatedList items. + * @member {Object.} items + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + VpnTunnelAggregatedList.prototype.items = $util.emptyObject; + + /** + * VpnTunnelAggregatedList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + VpnTunnelAggregatedList.prototype.kind = null; + + /** + * VpnTunnelAggregatedList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + VpnTunnelAggregatedList.prototype.nextPageToken = null; + + /** + * VpnTunnelAggregatedList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + VpnTunnelAggregatedList.prototype.selfLink = null; + + /** + * VpnTunnelAggregatedList unreachables. + * @member {Array.} unreachables + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + VpnTunnelAggregatedList.prototype.unreachables = $util.emptyArray; + + /** + * VpnTunnelAggregatedList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + VpnTunnelAggregatedList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnTunnelAggregatedList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + Object.defineProperty(VpnTunnelAggregatedList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelAggregatedList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + Object.defineProperty(VpnTunnelAggregatedList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelAggregatedList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + Object.defineProperty(VpnTunnelAggregatedList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelAggregatedList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + Object.defineProperty(VpnTunnelAggregatedList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelAggregatedList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + */ + Object.defineProperty(VpnTunnelAggregatedList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnTunnelAggregatedList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelAggregatedList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnTunnelAggregatedList} VpnTunnelAggregatedList instance + */ + VpnTunnelAggregatedList.create = function create(properties) { + return new VpnTunnelAggregatedList(properties); + }; + + /** + * Encodes the specified VpnTunnelAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelAggregatedList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelAggregatedList} message VpnTunnelAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnelAggregatedList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.compute.v1.VpnTunnelsScopedList.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.unreachables != null && message.unreachables.length) + for (var i = 0; i < message.unreachables.length; ++i) + writer.uint32(/* id 243372063, wireType 2 =*/1946976506).string(message.unreachables[i]); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified VpnTunnelAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelAggregatedList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelAggregatedList} message VpnTunnelAggregatedList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnelAggregatedList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnTunnelAggregatedList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnTunnelAggregatedList} VpnTunnelAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnelAggregatedList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnTunnelAggregatedList(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (message.items === $util.emptyObject) + message.items = {}; + 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.compute.v1.VpnTunnelsScopedList.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 243372063: + if (!(message.unreachables && message.unreachables.length)) + message.unreachables = []; + message.unreachables.push(reader.string()); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnTunnelAggregatedList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnTunnelAggregatedList} VpnTunnelAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnelAggregatedList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnTunnelAggregatedList message. + * @function verify + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnTunnelAggregatedList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnTunnelsScopedList.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.unreachables != null && message.hasOwnProperty("unreachables")) { + if (!Array.isArray(message.unreachables)) + return "unreachables: array expected"; + for (var i = 0; i < message.unreachables.length; ++i) + if (!$util.isString(message.unreachables[i])) + return "unreachables: string[] expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a VpnTunnelAggregatedList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnTunnelAggregatedList} VpnTunnelAggregatedList + */ + VpnTunnelAggregatedList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnTunnelAggregatedList) + return object; + var message = new $root.google.cloud.compute.v1.VpnTunnelAggregatedList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.compute.v1.VpnTunnelAggregatedList.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnTunnelAggregatedList.items: object expected"); + message.items[keys[i]] = $root.google.cloud.compute.v1.VpnTunnelsScopedList.fromObject(object.items[keys[i]]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.unreachables) { + if (!Array.isArray(object.unreachables)) + throw TypeError(".google.cloud.compute.v1.VpnTunnelAggregatedList.unreachables: array expected"); + message.unreachables = []; + for (var i = 0; i < object.unreachables.length; ++i) + message.unreachables[i] = String(object.unreachables[i]); + } + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.VpnTunnelAggregatedList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a VpnTunnelAggregatedList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @static + * @param {google.cloud.compute.v1.VpnTunnelAggregatedList} message VpnTunnelAggregatedList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnTunnelAggregatedList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachables = []; + if (options.objects || options.defaults) + object.items = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.compute.v1.VpnTunnelsScopedList.toObject(message.items[keys2[j]], options); + } + if (message.unreachables && message.unreachables.length) { + object.unreachables = []; + for (var j = 0; j < message.unreachables.length; ++j) + object.unreachables[j] = message.unreachables[j]; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this VpnTunnelAggregatedList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnTunnelAggregatedList + * @instance + * @returns {Object.} JSON object + */ + VpnTunnelAggregatedList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnTunnelAggregatedList; + })(); + + v1.VpnTunnelList = (function() { + + /** + * Properties of a VpnTunnelList. + * @memberof google.cloud.compute.v1 + * @interface IVpnTunnelList + * @property {string|null} [id] VpnTunnelList id + * @property {Array.|null} [items] VpnTunnelList items + * @property {string|null} [kind] VpnTunnelList kind + * @property {string|null} [nextPageToken] VpnTunnelList nextPageToken + * @property {string|null} [selfLink] VpnTunnelList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] VpnTunnelList warning + */ + + /** + * Constructs a new VpnTunnelList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnTunnelList. + * @implements IVpnTunnelList + * @constructor + * @param {google.cloud.compute.v1.IVpnTunnelList=} [properties] Properties to set + */ + function VpnTunnelList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpnTunnelList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + VpnTunnelList.prototype.id = null; + + /** + * VpnTunnelList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + VpnTunnelList.prototype.items = $util.emptyArray; + + /** + * VpnTunnelList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + VpnTunnelList.prototype.kind = null; + + /** + * VpnTunnelList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + VpnTunnelList.prototype.nextPageToken = null; + + /** + * VpnTunnelList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + VpnTunnelList.prototype.selfLink = null; + + /** + * VpnTunnelList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + VpnTunnelList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VpnTunnelList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + Object.defineProperty(VpnTunnelList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + Object.defineProperty(VpnTunnelList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + Object.defineProperty(VpnTunnelList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + Object.defineProperty(VpnTunnelList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VpnTunnelList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + */ + Object.defineProperty(VpnTunnelList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VpnTunnelList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.VpnTunnelList} VpnTunnelList instance + */ + VpnTunnelList.create = function create(properties) { + return new VpnTunnelList(properties); + }; + + /** + * Encodes the specified VpnTunnelList message. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelList} message VpnTunnelList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnelList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.VpnTunnel.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified VpnTunnelList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.VpnTunnelList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {google.cloud.compute.v1.IVpnTunnelList} message VpnTunnelList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpnTunnelList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpnTunnelList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.VpnTunnelList} VpnTunnelList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnelList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.VpnTunnelList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.VpnTunnel.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpnTunnelList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.VpnTunnelList} VpnTunnelList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpnTunnelList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpnTunnelList message. + * @function verify + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpnTunnelList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.VpnTunnel.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a VpnTunnelList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.VpnTunnelList} VpnTunnelList + */ + VpnTunnelList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.VpnTunnelList) + return object; + var message = new $root.google.cloud.compute.v1.VpnTunnelList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.VpnTunnelList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.VpnTunnelList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.VpnTunnel.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.VpnTunnelList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a VpnTunnelList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.VpnTunnelList + * @static + * @param {google.cloud.compute.v1.VpnTunnelList} message VpnTunnelList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpnTunnelList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.VpnTunnel.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this VpnTunnelList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.VpnTunnelList + * @instance + * @returns {Object.} JSON object + */ + VpnTunnelList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VpnTunnelList; + })(); + + v1.WafExpressionSetExpression = (function() { + + /** + * Properties of a WafExpressionSetExpression. + * @memberof google.cloud.compute.v1 + * @interface IWafExpressionSetExpression + * @property {string|null} [id] WafExpressionSetExpression id + */ + + /** + * Constructs a new WafExpressionSetExpression. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a WafExpressionSetExpression. + * @implements IWafExpressionSetExpression + * @constructor + * @param {google.cloud.compute.v1.IWafExpressionSetExpression=} [properties] Properties to set + */ + function WafExpressionSetExpression(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WafExpressionSetExpression id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @instance + */ + WafExpressionSetExpression.prototype.id = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WafExpressionSetExpression _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @instance + */ + Object.defineProperty(WafExpressionSetExpression.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WafExpressionSetExpression instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {google.cloud.compute.v1.IWafExpressionSetExpression=} [properties] Properties to set + * @returns {google.cloud.compute.v1.WafExpressionSetExpression} WafExpressionSetExpression instance + */ + WafExpressionSetExpression.create = function create(properties) { + return new WafExpressionSetExpression(properties); + }; + + /** + * Encodes the specified WafExpressionSetExpression message. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSetExpression.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {google.cloud.compute.v1.IWafExpressionSetExpression} message WafExpressionSetExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafExpressionSetExpression.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + return writer; + }; + + /** + * Encodes the specified WafExpressionSetExpression message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WafExpressionSetExpression.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {google.cloud.compute.v1.IWafExpressionSetExpression} message WafExpressionSetExpression message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WafExpressionSetExpression.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WafExpressionSetExpression message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.WafExpressionSetExpression} WafExpressionSetExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafExpressionSetExpression.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.WafExpressionSetExpression(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WafExpressionSetExpression message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.WafExpressionSetExpression} WafExpressionSetExpression + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WafExpressionSetExpression.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WafExpressionSetExpression message. + * @function verify + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WafExpressionSetExpression.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + return null; + }; + + /** + * Creates a WafExpressionSetExpression message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.WafExpressionSetExpression} WafExpressionSetExpression + */ + WafExpressionSetExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.WafExpressionSetExpression) + return object; + var message = new $root.google.cloud.compute.v1.WafExpressionSetExpression(); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a WafExpressionSetExpression message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @static + * @param {google.cloud.compute.v1.WafExpressionSetExpression} message WafExpressionSetExpression + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WafExpressionSetExpression.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + return object; + }; + + /** + * Converts this WafExpressionSetExpression to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.WafExpressionSetExpression + * @instance + * @returns {Object.} JSON object + */ + WafExpressionSetExpression.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WafExpressionSetExpression; + })(); + + v1.XpnHostList = (function() { + + /** + * Properties of a XpnHostList. + * @memberof google.cloud.compute.v1 + * @interface IXpnHostList + * @property {string|null} [id] XpnHostList id + * @property {Array.|null} [items] XpnHostList items + * @property {string|null} [kind] XpnHostList kind + * @property {string|null} [nextPageToken] XpnHostList nextPageToken + * @property {string|null} [selfLink] XpnHostList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] XpnHostList warning + */ + + /** + * Constructs a new XpnHostList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a XpnHostList. + * @implements IXpnHostList + * @constructor + * @param {google.cloud.compute.v1.IXpnHostList=} [properties] Properties to set + */ + function XpnHostList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * XpnHostList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + XpnHostList.prototype.id = null; + + /** + * XpnHostList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + XpnHostList.prototype.items = $util.emptyArray; + + /** + * XpnHostList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + XpnHostList.prototype.kind = null; + + /** + * XpnHostList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + XpnHostList.prototype.nextPageToken = null; + + /** + * XpnHostList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + XpnHostList.prototype.selfLink = null; + + /** + * XpnHostList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + XpnHostList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * XpnHostList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + Object.defineProperty(XpnHostList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * XpnHostList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + Object.defineProperty(XpnHostList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * XpnHostList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + Object.defineProperty(XpnHostList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * XpnHostList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + Object.defineProperty(XpnHostList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * XpnHostList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + */ + Object.defineProperty(XpnHostList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new XpnHostList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {google.cloud.compute.v1.IXpnHostList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.XpnHostList} XpnHostList instance + */ + XpnHostList.create = function create(properties) { + return new XpnHostList(properties); + }; + + /** + * Encodes the specified XpnHostList message. Does not implicitly {@link google.cloud.compute.v1.XpnHostList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {google.cloud.compute.v1.IXpnHostList} message XpnHostList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XpnHostList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Project.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified XpnHostList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.XpnHostList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {google.cloud.compute.v1.IXpnHostList} message XpnHostList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XpnHostList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a XpnHostList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.XpnHostList} XpnHostList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XpnHostList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.XpnHostList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Project.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a XpnHostList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.XpnHostList} XpnHostList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XpnHostList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a XpnHostList message. + * @function verify + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + XpnHostList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Project.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a XpnHostList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.XpnHostList} XpnHostList + */ + XpnHostList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.XpnHostList) + return object; + var message = new $root.google.cloud.compute.v1.XpnHostList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.XpnHostList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.XpnHostList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Project.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.XpnHostList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a XpnHostList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.XpnHostList + * @static + * @param {google.cloud.compute.v1.XpnHostList} message XpnHostList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + XpnHostList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Project.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this XpnHostList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.XpnHostList + * @instance + * @returns {Object.} JSON object + */ + XpnHostList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return XpnHostList; + })(); + + v1.Zone = (function() { + + /** + * Properties of a Zone. + * @memberof google.cloud.compute.v1 + * @interface IZone + * @property {Array.|null} [availableCpuPlatforms] Zone availableCpuPlatforms + * @property {string|null} [creationTimestamp] Zone creationTimestamp + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecated] Zone deprecated + * @property {string|null} [description] Zone description + * @property {number|Long|null} [id] Zone id + * @property {string|null} [kind] Zone kind + * @property {string|null} [name] Zone name + * @property {string|null} [region] Zone region + * @property {string|null} [selfLink] Zone selfLink + * @property {google.cloud.compute.v1.Zone.Status|null} [status] Zone status + * @property {boolean|null} [supportsPzs] Zone supportsPzs + */ + + /** + * Constructs a new Zone. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Zone. + * @implements IZone + * @constructor + * @param {google.cloud.compute.v1.IZone=} [properties] Properties to set + */ + function Zone(properties) { + this.availableCpuPlatforms = []; + if (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 availableCpuPlatforms. + * @member {Array.} availableCpuPlatforms + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.availableCpuPlatforms = $util.emptyArray; + + /** + * Zone creationTimestamp. + * @member {string|null|undefined} creationTimestamp + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.creationTimestamp = null; + + /** + * Zone deprecated. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecated + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.deprecated = null; + + /** + * Zone description. + * @member {string|null|undefined} description + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.description = null; + + /** + * Zone id. + * @member {number|Long|null|undefined} id + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.id = null; + + /** + * Zone kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.kind = null; + + /** + * Zone name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.name = null; + + /** + * Zone region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.region = null; + + /** + * Zone selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.selfLink = null; + + /** + * Zone status. + * @member {google.cloud.compute.v1.Zone.Status|null|undefined} status + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.status = null; + + /** + * Zone supportsPzs. + * @member {boolean|null|undefined} supportsPzs + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Zone.prototype.supportsPzs = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Zone _creationTimestamp. + * @member {"creationTimestamp"|undefined} _creationTimestamp + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_creationTimestamp", { + get: $util.oneOfGetter($oneOfFields = ["creationTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _deprecated. + * @member {"deprecated"|undefined} _deprecated + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_deprecated", { + get: $util.oneOfGetter($oneOfFields = ["deprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _status. + * @member {"status"|undefined} _status + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_status", { + get: $util.oneOfGetter($oneOfFields = ["status"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Zone _supportsPzs. + * @member {"supportsPzs"|undefined} _supportsPzs + * @memberof google.cloud.compute.v1.Zone + * @instance + */ + Object.defineProperty(Zone.prototype, "_supportsPzs", { + get: $util.oneOfGetter($oneOfFields = ["supportsPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Zone instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.Zone + * @static + * @param {google.cloud.compute.v1.IZone=} [properties] Properties to set + * @returns {google.cloud.compute.v1.Zone} Zone instance + */ + Zone.create = function create(properties) { + return new Zone(properties); + }; + + /** + * Encodes the specified Zone message. Does not implicitly {@link google.cloud.compute.v1.Zone.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.Zone + * @static + * @param {google.cloud.compute.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 0 =*/26840).uint64(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.creationTimestamp != null && Object.hasOwnProperty.call(message, "creationTimestamp")) + writer.uint32(/* id 30525366, wireType 2 =*/244202930).string(message.creationTimestamp); + if (message.supportsPzs != null && Object.hasOwnProperty.call(message, "supportsPzs")) + writer.uint32(/* id 83983214, wireType 0 =*/671865712).bool(message.supportsPzs); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.availableCpuPlatforms != null && message.availableCpuPlatforms.length) + for (var i = 0; i < message.availableCpuPlatforms.length; ++i) + writer.uint32(/* id 175536531, wireType 2 =*/1404292250).string(message.availableCpuPlatforms[i]); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 181260274, wireType 0 =*/1450082192).int32(message.status); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 422937596, wireType 2 =*/3383500770).string(message.description); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecated, writer.uint32(/* id 515138995, wireType 2 =*/4121111962).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Zone message, length delimited. Does not implicitly {@link google.cloud.compute.v1.Zone.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.Zone + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.Zone(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 175536531: + if (!(message.availableCpuPlatforms && message.availableCpuPlatforms.length)) + message.availableCpuPlatforms = []; + message.availableCpuPlatforms.push(reader.string()); + break; + case 30525366: + message.creationTimestamp = reader.string(); + break; + case 515138995: + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 422937596: + message.description = reader.string(); + break; + case 3355: + message.id = reader.uint64(); + break; + case 3292052: + message.kind = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 181260274: + message.status = reader.int32(); + break; + case 83983214: + message.supportsPzs = reader.bool(); + 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.compute.v1.Zone + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.availableCpuPlatforms != null && message.hasOwnProperty("availableCpuPlatforms")) { + if (!Array.isArray(message.availableCpuPlatforms)) + return "availableCpuPlatforms: array expected"; + for (var i = 0; i < message.availableCpuPlatforms.length; ++i) + if (!$util.isString(message.availableCpuPlatforms[i])) + return "availableCpuPlatforms: string[] expected"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + properties._creationTimestamp = 1; + if (!$util.isString(message.creationTimestamp)) + return "creationTimestamp: string expected"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + properties._deprecated = 1; + { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecated); + if (error) + return "deprecated." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + properties._status = 1; + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 2104482: + case 2715: + break; + } + } + if (message.supportsPzs != null && message.hasOwnProperty("supportsPzs")) { + properties._supportsPzs = 1; + if (typeof message.supportsPzs !== "boolean") + return "supportsPzs: boolean expected"; + } + return null; + }; + + /** + * Creates a Zone message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.Zone + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.Zone} Zone + */ + Zone.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.Zone) + return object; + var message = new $root.google.cloud.compute.v1.Zone(); + if (object.availableCpuPlatforms) { + if (!Array.isArray(object.availableCpuPlatforms)) + throw TypeError(".google.cloud.compute.v1.Zone.availableCpuPlatforms: array expected"); + message.availableCpuPlatforms = []; + for (var i = 0; i < object.availableCpuPlatforms.length; ++i) + message.availableCpuPlatforms[i] = String(object.availableCpuPlatforms[i]); + } + if (object.creationTimestamp != null) + message.creationTimestamp = String(object.creationTimestamp); + if (object.deprecated != null) { + if (typeof object.deprecated !== "object") + throw TypeError(".google.cloud.compute.v1.Zone.deprecated: object expected"); + message.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecated); + } + if (object.description != null) + message.description = String(object.description); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = true; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true); + if (object.kind != null) + message.kind = String(object.kind); + if (object.name != null) + message.name = String(object.name); + if (object.region != null) + message.region = String(object.region); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + switch (object.status) { + case "UNDEFINED_STATUS": + case 0: + message.status = 0; + break; + case "DOWN": + case 2104482: + message.status = 2104482; + break; + case "UP": + case 2715: + message.status = 2715; + break; + } + if (object.supportsPzs != null) + message.supportsPzs = Boolean(object.supportsPzs); + return message; + }; + + /** + * Creates a plain object from a Zone message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.Zone + * @static + * @param {google.cloud.compute.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.arrays || options.defaults) + object.availableCpuPlatforms = []; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.creationTimestamp != null && message.hasOwnProperty("creationTimestamp")) { + object.creationTimestamp = message.creationTimestamp; + if (options.oneofs) + object._creationTimestamp = "creationTimestamp"; + } + if (message.supportsPzs != null && message.hasOwnProperty("supportsPzs")) { + object.supportsPzs = message.supportsPzs; + if (options.oneofs) + object._supportsPzs = "supportsPzs"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.availableCpuPlatforms && message.availableCpuPlatforms.length) { + object.availableCpuPlatforms = []; + for (var j = 0; j < message.availableCpuPlatforms.length; ++j) + object.availableCpuPlatforms[j] = message.availableCpuPlatforms[j]; + } + if (message.status != null && message.hasOwnProperty("status")) { + object.status = options.enums === String ? $root.google.cloud.compute.v1.Zone.Status[message.status] : message.status; + if (options.oneofs) + object._status = "status"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) { + object.deprecated = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecated, options); + if (options.oneofs) + object._deprecated = "deprecated"; + } + return object; + }; + + /** + * Converts this Zone to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.Zone + * @instance + * @returns {Object.} JSON object + */ + Zone.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Status enum. + * @name google.cloud.compute.v1.Zone.Status + * @enum {number} + * @property {number} UNDEFINED_STATUS=0 UNDEFINED_STATUS value + * @property {number} DOWN=2104482 DOWN value + * @property {number} UP=2715 UP value + */ + Zone.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_STATUS"] = 0; + values[valuesById[2104482] = "DOWN"] = 2104482; + values[valuesById[2715] = "UP"] = 2715; + return values; + })(); + + return Zone; + })(); + + v1.ZoneList = (function() { + + /** + * Properties of a ZoneList. + * @memberof google.cloud.compute.v1 + * @interface IZoneList + * @property {string|null} [id] ZoneList id + * @property {Array.|null} [items] ZoneList items + * @property {string|null} [kind] ZoneList kind + * @property {string|null} [nextPageToken] ZoneList nextPageToken + * @property {string|null} [selfLink] ZoneList selfLink + * @property {google.cloud.compute.v1.IWarning|null} [warning] ZoneList warning + */ + + /** + * Constructs a new ZoneList. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ZoneList. + * @implements IZoneList + * @constructor + * @param {google.cloud.compute.v1.IZoneList=} [properties] Properties to set + */ + function ZoneList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZoneList id. + * @member {string|null|undefined} id + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + ZoneList.prototype.id = null; + + /** + * ZoneList items. + * @member {Array.} items + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + ZoneList.prototype.items = $util.emptyArray; + + /** + * ZoneList kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + ZoneList.prototype.kind = null; + + /** + * ZoneList nextPageToken. + * @member {string|null|undefined} nextPageToken + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + ZoneList.prototype.nextPageToken = null; + + /** + * ZoneList selfLink. + * @member {string|null|undefined} selfLink + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + ZoneList.prototype.selfLink = null; + + /** + * ZoneList warning. + * @member {google.cloud.compute.v1.IWarning|null|undefined} warning + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + ZoneList.prototype.warning = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ZoneList _id. + * @member {"id"|undefined} _id + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + Object.defineProperty(ZoneList.prototype, "_id", { + get: $util.oneOfGetter($oneOfFields = ["id"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ZoneList _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + Object.defineProperty(ZoneList.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ZoneList _nextPageToken. + * @member {"nextPageToken"|undefined} _nextPageToken + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + Object.defineProperty(ZoneList.prototype, "_nextPageToken", { + get: $util.oneOfGetter($oneOfFields = ["nextPageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ZoneList _selfLink. + * @member {"selfLink"|undefined} _selfLink + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + Object.defineProperty(ZoneList.prototype, "_selfLink", { + get: $util.oneOfGetter($oneOfFields = ["selfLink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ZoneList _warning. + * @member {"warning"|undefined} _warning + * @memberof google.cloud.compute.v1.ZoneList + * @instance + */ + Object.defineProperty(ZoneList.prototype, "_warning", { + get: $util.oneOfGetter($oneOfFields = ["warning"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ZoneList instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {google.cloud.compute.v1.IZoneList=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ZoneList} ZoneList instance + */ + ZoneList.create = function create(properties) { + return new ZoneList(properties); + }; + + /** + * Encodes the specified ZoneList message. Does not implicitly {@link google.cloud.compute.v1.ZoneList.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {google.cloud.compute.v1.IZoneList} message ZoneList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3355, wireType 2 =*/26842).string(message.id); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3292052, wireType 2 =*/26336418).string(message.kind); + if (message.warning != null && Object.hasOwnProperty.call(message, "warning")) + $root.google.cloud.compute.v1.Warning.encode(message.warning, writer.uint32(/* id 50704284, wireType 2 =*/405634274).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 79797525, wireType 2 =*/638380202).string(message.nextPageToken); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.compute.v1.Zone.encode(message.items[i], writer.uint32(/* id 100526016, wireType 2 =*/804208130).fork()).ldelim(); + if (message.selfLink != null && Object.hasOwnProperty.call(message, "selfLink")) + writer.uint32(/* id 456214797, wireType 2 =*/3649718378).string(message.selfLink); + return writer; + }; + + /** + * Encodes the specified ZoneList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ZoneList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {google.cloud.compute.v1.IZoneList} message ZoneList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ZoneList} ZoneList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ZoneList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3355: + message.id = reader.string(); + break; + case 100526016: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.compute.v1.Zone.decode(reader, reader.uint32())); + break; + case 3292052: + message.kind = reader.string(); + break; + case 79797525: + message.nextPageToken = reader.string(); + break; + case 456214797: + message.selfLink = reader.string(); + break; + case 50704284: + message.warning = $root.google.cloud.compute.v1.Warning.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZoneList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ZoneList} ZoneList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneList message. + * @function verify + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) { + properties._id = 1; + if (!$util.isString(message.id)) + return "id: string expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.compute.v1.Zone.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + properties._nextPageToken = 1; + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + properties._selfLink = 1; + if (!$util.isString(message.selfLink)) + return "selfLink: string expected"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + properties._warning = 1; + { + var error = $root.google.cloud.compute.v1.Warning.verify(message.warning); + if (error) + return "warning." + error; + } + } + return null; + }; + + /** + * Creates a ZoneList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ZoneList} ZoneList + */ + ZoneList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ZoneList) + return object; + var message = new $root.google.cloud.compute.v1.ZoneList(); + if (object.id != null) + message.id = String(object.id); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.compute.v1.ZoneList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ZoneList.items: object expected"); + message.items[i] = $root.google.cloud.compute.v1.Zone.fromObject(object.items[i]); + } + } + if (object.kind != null) + message.kind = String(object.kind); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.selfLink != null) + message.selfLink = String(object.selfLink); + if (object.warning != null) { + if (typeof object.warning !== "object") + throw TypeError(".google.cloud.compute.v1.ZoneList.warning: object expected"); + message.warning = $root.google.cloud.compute.v1.Warning.fromObject(object.warning); + } + return message; + }; + + /** + * Creates a plain object from a ZoneList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ZoneList + * @static + * @param {google.cloud.compute.v1.ZoneList} message ZoneList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.id != null && message.hasOwnProperty("id")) { + object.id = message.id; + if (options.oneofs) + object._id = "id"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.warning != null && message.hasOwnProperty("warning")) { + object.warning = $root.google.cloud.compute.v1.Warning.toObject(message.warning, options); + if (options.oneofs) + object._warning = "warning"; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) { + object.nextPageToken = message.nextPageToken; + if (options.oneofs) + object._nextPageToken = "nextPageToken"; + } + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.compute.v1.Zone.toObject(message.items[j], options); + } + if (message.selfLink != null && message.hasOwnProperty("selfLink")) { + object.selfLink = message.selfLink; + if (options.oneofs) + object._selfLink = "selfLink"; + } + return object; + }; + + /** + * Converts this ZoneList to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ZoneList + * @instance + * @returns {Object.} JSON object + */ + ZoneList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ZoneList; + })(); + + v1.ZoneSetLabelsRequest = (function() { + + /** + * Properties of a ZoneSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @interface IZoneSetLabelsRequest + * @property {string|null} [labelFingerprint] ZoneSetLabelsRequest labelFingerprint + * @property {Object.|null} [labels] ZoneSetLabelsRequest labels + */ + + /** + * Constructs a new ZoneSetLabelsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ZoneSetLabelsRequest. + * @implements IZoneSetLabelsRequest + * @constructor + * @param {google.cloud.compute.v1.IZoneSetLabelsRequest=} [properties] Properties to set + */ + function ZoneSetLabelsRequest(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]]; + } + + /** + * ZoneSetLabelsRequest labelFingerprint. + * @member {string|null|undefined} labelFingerprint + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @instance + */ + ZoneSetLabelsRequest.prototype.labelFingerprint = null; + + /** + * ZoneSetLabelsRequest labels. + * @member {Object.} labels + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @instance + */ + ZoneSetLabelsRequest.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ZoneSetLabelsRequest _labelFingerprint. + * @member {"labelFingerprint"|undefined} _labelFingerprint + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @instance + */ + Object.defineProperty(ZoneSetLabelsRequest.prototype, "_labelFingerprint", { + get: $util.oneOfGetter($oneOfFields = ["labelFingerprint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ZoneSetLabelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IZoneSetLabelsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ZoneSetLabelsRequest} ZoneSetLabelsRequest instance + */ + ZoneSetLabelsRequest.create = function create(properties) { + return new ZoneSetLabelsRequest(properties); + }; + + /** + * Encodes the specified ZoneSetLabelsRequest message. Does not implicitly {@link google.cloud.compute.v1.ZoneSetLabelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IZoneSetLabelsRequest} message ZoneSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneSetLabelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelFingerprint != null && Object.hasOwnProperty.call(message, "labelFingerprint")) + writer.uint32(/* id 178124825, wireType 2 =*/1424998602).string(message.labelFingerprint); + 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 500195327, wireType 2 =*/4001562618).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 ZoneSetLabelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ZoneSetLabelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.IZoneSetLabelsRequest} message ZoneSetLabelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneSetLabelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneSetLabelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ZoneSetLabelsRequest} ZoneSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneSetLabelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ZoneSetLabelsRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 178124825: + message.labelFingerprint = reader.string(); + break; + case 500195327: + 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 ZoneSetLabelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ZoneSetLabelsRequest} ZoneSetLabelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneSetLabelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneSetLabelsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneSetLabelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + properties._labelFingerprint = 1; + if (!$util.isString(message.labelFingerprint)) + return "labelFingerprint: 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 ZoneSetLabelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ZoneSetLabelsRequest} ZoneSetLabelsRequest + */ + ZoneSetLabelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ZoneSetLabelsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ZoneSetLabelsRequest(); + if (object.labelFingerprint != null) + message.labelFingerprint = String(object.labelFingerprint); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.compute.v1.ZoneSetLabelsRequest.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 ZoneSetLabelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @static + * @param {google.cloud.compute.v1.ZoneSetLabelsRequest} message ZoneSetLabelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneSetLabelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (message.labelFingerprint != null && message.hasOwnProperty("labelFingerprint")) { + object.labelFingerprint = message.labelFingerprint; + if (options.oneofs) + object._labelFingerprint = "labelFingerprint"; + } + 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 ZoneSetLabelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ZoneSetLabelsRequest + * @instance + * @returns {Object.} JSON object + */ + ZoneSetLabelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ZoneSetLabelsRequest; + })(); + + v1.ZoneSetPolicyRequest = (function() { + + /** + * Properties of a ZoneSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IZoneSetPolicyRequest + * @property {Array.|null} [bindings] ZoneSetPolicyRequest bindings + * @property {string|null} [etag] ZoneSetPolicyRequest etag + * @property {google.cloud.compute.v1.IPolicy|null} [policy] ZoneSetPolicyRequest policy + */ + + /** + * Constructs a new ZoneSetPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ZoneSetPolicyRequest. + * @implements IZoneSetPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IZoneSetPolicyRequest=} [properties] Properties to set + */ + function ZoneSetPolicyRequest(properties) { + this.bindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ZoneSetPolicyRequest bindings. + * @member {Array.} bindings + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @instance + */ + ZoneSetPolicyRequest.prototype.bindings = $util.emptyArray; + + /** + * ZoneSetPolicyRequest etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @instance + */ + ZoneSetPolicyRequest.prototype.etag = null; + + /** + * ZoneSetPolicyRequest policy. + * @member {google.cloud.compute.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @instance + */ + ZoneSetPolicyRequest.prototype.policy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ZoneSetPolicyRequest _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @instance + */ + Object.defineProperty(ZoneSetPolicyRequest.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ZoneSetPolicyRequest _policy. + * @member {"policy"|undefined} _policy + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @instance + */ + Object.defineProperty(ZoneSetPolicyRequest.prototype, "_policy", { + get: $util.oneOfGetter($oneOfFields = ["policy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ZoneSetPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IZoneSetPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ZoneSetPolicyRequest} ZoneSetPolicyRequest instance + */ + ZoneSetPolicyRequest.create = function create(properties) { + return new ZoneSetPolicyRequest(properties); + }; + + /** + * Encodes the specified ZoneSetPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.ZoneSetPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IZoneSetPolicyRequest} message ZoneSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneSetPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3123477, wireType 2 =*/24987818).string(message.etag); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.compute.v1.Policy.encode(message.policy, writer.uint32(/* id 91071794, wireType 2 =*/728574354).fork()).ldelim(); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.cloud.compute.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 403251854, wireType 2 =*/3226014834).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ZoneSetPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ZoneSetPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.IZoneSetPolicyRequest} message ZoneSetPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZoneSetPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZoneSetPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ZoneSetPolicyRequest} ZoneSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneSetPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ZoneSetPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 403251854: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.cloud.compute.v1.Binding.decode(reader, reader.uint32())); + break; + case 3123477: + message.etag = reader.string(); + break; + case 91071794: + message.policy = $root.google.cloud.compute.v1.Policy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZoneSetPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ZoneSetPolicyRequest} ZoneSetPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZoneSetPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZoneSetPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZoneSetPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + 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.cloud.compute.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + properties._policy = 1; + { + var error = $root.google.cloud.compute.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + } + return null; + }; + + /** + * Creates a ZoneSetPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ZoneSetPolicyRequest} ZoneSetPolicyRequest + */ + ZoneSetPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ZoneSetPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.ZoneSetPolicyRequest(); + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.cloud.compute.v1.ZoneSetPolicyRequest.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.cloud.compute.v1.ZoneSetPolicyRequest.bindings: object expected"); + message.bindings[i] = $root.google.cloud.compute.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.compute.v1.ZoneSetPolicyRequest.policy: object expected"); + message.policy = $root.google.cloud.compute.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a ZoneSetPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @static + * @param {google.cloud.compute.v1.ZoneSetPolicyRequest} message ZoneSetPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZoneSetPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.policy != null && message.hasOwnProperty("policy")) { + object.policy = $root.google.cloud.compute.v1.Policy.toObject(message.policy, options); + if (options.oneofs) + object._policy = "policy"; + } + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.cloud.compute.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; + + /** + * Converts this ZoneSetPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ZoneSetPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + ZoneSetPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ZoneSetPolicyRequest; + })(); + + v1.AggregatedListAcceleratorTypesRequest = (function() { + + /** + * Properties of an AggregatedListAcceleratorTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListAcceleratorTypesRequest + * @property {string|null} [filter] AggregatedListAcceleratorTypesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListAcceleratorTypesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListAcceleratorTypesRequest maxResults + * @property {string|null} [orderBy] AggregatedListAcceleratorTypesRequest orderBy + * @property {string|null} [pageToken] AggregatedListAcceleratorTypesRequest pageToken + * @property {string|null} [project] AggregatedListAcceleratorTypesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListAcceleratorTypesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListAcceleratorTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListAcceleratorTypesRequest. + * @implements IAggregatedListAcceleratorTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest=} [properties] Properties to set + */ + function AggregatedListAcceleratorTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListAcceleratorTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + AggregatedListAcceleratorTypesRequest.prototype.filter = null; + + /** + * AggregatedListAcceleratorTypesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + AggregatedListAcceleratorTypesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListAcceleratorTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + AggregatedListAcceleratorTypesRequest.prototype.maxResults = null; + + /** + * AggregatedListAcceleratorTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + AggregatedListAcceleratorTypesRequest.prototype.orderBy = null; + + /** + * AggregatedListAcceleratorTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + AggregatedListAcceleratorTypesRequest.prototype.pageToken = null; + + /** + * AggregatedListAcceleratorTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + AggregatedListAcceleratorTypesRequest.prototype.project = ""; + + /** + * AggregatedListAcceleratorTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + AggregatedListAcceleratorTypesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListAcceleratorTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListAcceleratorTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAcceleratorTypesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListAcceleratorTypesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAcceleratorTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListAcceleratorTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAcceleratorTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListAcceleratorTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAcceleratorTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListAcceleratorTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAcceleratorTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListAcceleratorTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListAcceleratorTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest} AggregatedListAcceleratorTypesRequest instance + */ + AggregatedListAcceleratorTypesRequest.create = function create(properties) { + return new AggregatedListAcceleratorTypesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListAcceleratorTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest} message AggregatedListAcceleratorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListAcceleratorTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListAcceleratorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest} message AggregatedListAcceleratorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListAcceleratorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListAcceleratorTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest} AggregatedListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListAcceleratorTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListAcceleratorTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest} AggregatedListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListAcceleratorTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListAcceleratorTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListAcceleratorTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListAcceleratorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest} AggregatedListAcceleratorTypesRequest + */ + AggregatedListAcceleratorTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListAcceleratorTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest} message AggregatedListAcceleratorTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListAcceleratorTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListAcceleratorTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListAcceleratorTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListAcceleratorTypesRequest; + })(); + + v1.GetAcceleratorTypeRequest = (function() { + + /** + * Properties of a GetAcceleratorTypeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetAcceleratorTypeRequest + * @property {string|null} [acceleratorType] GetAcceleratorTypeRequest acceleratorType + * @property {string|null} [project] GetAcceleratorTypeRequest project + * @property {string|null} [zone] GetAcceleratorTypeRequest zone + */ + + /** + * Constructs a new GetAcceleratorTypeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetAcceleratorTypeRequest. + * @implements IGetAcceleratorTypeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetAcceleratorTypeRequest=} [properties] Properties to set + */ + function GetAcceleratorTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAcceleratorTypeRequest acceleratorType. + * @member {string} acceleratorType + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @instance + */ + GetAcceleratorTypeRequest.prototype.acceleratorType = ""; + + /** + * GetAcceleratorTypeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @instance + */ + GetAcceleratorTypeRequest.prototype.project = ""; + + /** + * GetAcceleratorTypeRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @instance + */ + GetAcceleratorTypeRequest.prototype.zone = ""; + + /** + * Creates a new GetAcceleratorTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetAcceleratorTypeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetAcceleratorTypeRequest} GetAcceleratorTypeRequest instance + */ + GetAcceleratorTypeRequest.create = function create(properties) { + return new GetAcceleratorTypeRequest(properties); + }; + + /** + * Encodes the specified GetAcceleratorTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAcceleratorTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetAcceleratorTypeRequest} message GetAcceleratorTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAcceleratorTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 138031246, wireType 2 =*/1104249970).string(message.acceleratorType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetAcceleratorTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAcceleratorTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetAcceleratorTypeRequest} message GetAcceleratorTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAcceleratorTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAcceleratorTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetAcceleratorTypeRequest} GetAcceleratorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAcceleratorTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetAcceleratorTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 138031246: + message.acceleratorType = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAcceleratorTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetAcceleratorTypeRequest} GetAcceleratorTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAcceleratorTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAcceleratorTypeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAcceleratorTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetAcceleratorTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetAcceleratorTypeRequest} GetAcceleratorTypeRequest + */ + GetAcceleratorTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetAcceleratorTypeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetAcceleratorTypeRequest(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetAcceleratorTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @static + * @param {google.cloud.compute.v1.GetAcceleratorTypeRequest} message GetAcceleratorTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAcceleratorTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.acceleratorType = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = message.acceleratorType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetAcceleratorTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetAcceleratorTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetAcceleratorTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetAcceleratorTypeRequest; + })(); + + v1.ListAcceleratorTypesRequest = (function() { + + /** + * Properties of a ListAcceleratorTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListAcceleratorTypesRequest + * @property {string|null} [filter] ListAcceleratorTypesRequest filter + * @property {number|null} [maxResults] ListAcceleratorTypesRequest maxResults + * @property {string|null} [orderBy] ListAcceleratorTypesRequest orderBy + * @property {string|null} [pageToken] ListAcceleratorTypesRequest pageToken + * @property {string|null} [project] ListAcceleratorTypesRequest project + * @property {boolean|null} [returnPartialSuccess] ListAcceleratorTypesRequest returnPartialSuccess + * @property {string|null} [zone] ListAcceleratorTypesRequest zone + */ + + /** + * Constructs a new ListAcceleratorTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListAcceleratorTypesRequest. + * @implements IListAcceleratorTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IListAcceleratorTypesRequest=} [properties] Properties to set + */ + function ListAcceleratorTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAcceleratorTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + ListAcceleratorTypesRequest.prototype.filter = null; + + /** + * ListAcceleratorTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + ListAcceleratorTypesRequest.prototype.maxResults = null; + + /** + * ListAcceleratorTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + ListAcceleratorTypesRequest.prototype.orderBy = null; + + /** + * ListAcceleratorTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + ListAcceleratorTypesRequest.prototype.pageToken = null; + + /** + * ListAcceleratorTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + ListAcceleratorTypesRequest.prototype.project = ""; + + /** + * ListAcceleratorTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + ListAcceleratorTypesRequest.prototype.returnPartialSuccess = null; + + /** + * ListAcceleratorTypesRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + ListAcceleratorTypesRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListAcceleratorTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(ListAcceleratorTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAcceleratorTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(ListAcceleratorTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAcceleratorTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(ListAcceleratorTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAcceleratorTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(ListAcceleratorTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAcceleratorTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + */ + Object.defineProperty(ListAcceleratorTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListAcceleratorTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.IListAcceleratorTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListAcceleratorTypesRequest} ListAcceleratorTypesRequest instance + */ + ListAcceleratorTypesRequest.create = function create(properties) { + return new ListAcceleratorTypesRequest(properties); + }; + + /** + * Encodes the specified ListAcceleratorTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAcceleratorTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.IListAcceleratorTypesRequest} message ListAcceleratorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAcceleratorTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListAcceleratorTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAcceleratorTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.IListAcceleratorTypesRequest} message ListAcceleratorTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAcceleratorTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAcceleratorTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListAcceleratorTypesRequest} ListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAcceleratorTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListAcceleratorTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAcceleratorTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListAcceleratorTypesRequest} ListAcceleratorTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAcceleratorTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAcceleratorTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAcceleratorTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListAcceleratorTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListAcceleratorTypesRequest} ListAcceleratorTypesRequest + */ + ListAcceleratorTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListAcceleratorTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListAcceleratorTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListAcceleratorTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @static + * @param {google.cloud.compute.v1.ListAcceleratorTypesRequest} message ListAcceleratorTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAcceleratorTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListAcceleratorTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListAcceleratorTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAcceleratorTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAcceleratorTypesRequest; + })(); + + v1.AggregatedListAddressesRequest = (function() { + + /** + * Properties of an AggregatedListAddressesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListAddressesRequest + * @property {string|null} [filter] AggregatedListAddressesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListAddressesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListAddressesRequest maxResults + * @property {string|null} [orderBy] AggregatedListAddressesRequest orderBy + * @property {string|null} [pageToken] AggregatedListAddressesRequest pageToken + * @property {string|null} [project] AggregatedListAddressesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListAddressesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListAddressesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListAddressesRequest. + * @implements IAggregatedListAddressesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListAddressesRequest=} [properties] Properties to set + */ + function AggregatedListAddressesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListAddressesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + AggregatedListAddressesRequest.prototype.filter = null; + + /** + * AggregatedListAddressesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + AggregatedListAddressesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListAddressesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + AggregatedListAddressesRequest.prototype.maxResults = null; + + /** + * AggregatedListAddressesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + AggregatedListAddressesRequest.prototype.orderBy = null; + + /** + * AggregatedListAddressesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + AggregatedListAddressesRequest.prototype.pageToken = null; + + /** + * AggregatedListAddressesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + AggregatedListAddressesRequest.prototype.project = ""; + + /** + * AggregatedListAddressesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + AggregatedListAddressesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListAddressesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + Object.defineProperty(AggregatedListAddressesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAddressesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + Object.defineProperty(AggregatedListAddressesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAddressesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + Object.defineProperty(AggregatedListAddressesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAddressesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + Object.defineProperty(AggregatedListAddressesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAddressesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + Object.defineProperty(AggregatedListAddressesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAddressesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + */ + Object.defineProperty(AggregatedListAddressesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListAddressesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAddressesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListAddressesRequest} AggregatedListAddressesRequest instance + */ + AggregatedListAddressesRequest.create = function create(properties) { + return new AggregatedListAddressesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListAddressesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAddressesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAddressesRequest} message AggregatedListAddressesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListAddressesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListAddressesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAddressesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAddressesRequest} message AggregatedListAddressesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListAddressesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListAddressesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListAddressesRequest} AggregatedListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListAddressesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListAddressesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListAddressesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListAddressesRequest} AggregatedListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListAddressesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListAddressesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListAddressesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListAddressesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListAddressesRequest} AggregatedListAddressesRequest + */ + AggregatedListAddressesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListAddressesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListAddressesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListAddressesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListAddressesRequest} message AggregatedListAddressesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListAddressesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListAddressesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListAddressesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListAddressesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListAddressesRequest; + })(); + + v1.DeleteAddressRequest = (function() { + + /** + * Properties of a DeleteAddressRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteAddressRequest + * @property {string|null} [address] DeleteAddressRequest address + * @property {string|null} [project] DeleteAddressRequest project + * @property {string|null} [region] DeleteAddressRequest region + * @property {string|null} [requestId] DeleteAddressRequest requestId + */ + + /** + * Constructs a new DeleteAddressRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteAddressRequest. + * @implements IDeleteAddressRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteAddressRequest=} [properties] Properties to set + */ + function DeleteAddressRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAddressRequest address. + * @member {string} address + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @instance + */ + DeleteAddressRequest.prototype.address = ""; + + /** + * DeleteAddressRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @instance + */ + DeleteAddressRequest.prototype.project = ""; + + /** + * DeleteAddressRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @instance + */ + DeleteAddressRequest.prototype.region = ""; + + /** + * DeleteAddressRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @instance + */ + DeleteAddressRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteAddressRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @instance + */ + Object.defineProperty(DeleteAddressRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteAddressRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAddressRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteAddressRequest} DeleteAddressRequest instance + */ + DeleteAddressRequest.create = function create(properties) { + return new DeleteAddressRequest(properties); + }; + + /** + * Encodes the specified DeleteAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteAddressRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAddressRequest} message DeleteAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAddressRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 462920692, wireType 2 =*/3703365538).string(message.address); + return writer; + }; + + /** + * Encodes the specified DeleteAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteAddressRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAddressRequest} message DeleteAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAddressRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteAddressRequest} DeleteAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAddressRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteAddressRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 462920692: + message.address = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAddressRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteAddressRequest} DeleteAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAddressRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAddressRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAddressRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteAddressRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteAddressRequest} DeleteAddressRequest + */ + DeleteAddressRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteAddressRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteAddressRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteAddressRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @static + * @param {google.cloud.compute.v1.DeleteAddressRequest} message DeleteAddressRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAddressRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.address = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + return object; + }; + + /** + * Converts this DeleteAddressRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteAddressRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAddressRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteAddressRequest; + })(); + + v1.GetAddressRequest = (function() { + + /** + * Properties of a GetAddressRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetAddressRequest + * @property {string|null} [address] GetAddressRequest address + * @property {string|null} [project] GetAddressRequest project + * @property {string|null} [region] GetAddressRequest region + */ + + /** + * Constructs a new GetAddressRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetAddressRequest. + * @implements IGetAddressRequest + * @constructor + * @param {google.cloud.compute.v1.IGetAddressRequest=} [properties] Properties to set + */ + function GetAddressRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAddressRequest address. + * @member {string} address + * @memberof google.cloud.compute.v1.GetAddressRequest + * @instance + */ + GetAddressRequest.prototype.address = ""; + + /** + * GetAddressRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetAddressRequest + * @instance + */ + GetAddressRequest.prototype.project = ""; + + /** + * GetAddressRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetAddressRequest + * @instance + */ + GetAddressRequest.prototype.region = ""; + + /** + * Creates a new GetAddressRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {google.cloud.compute.v1.IGetAddressRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetAddressRequest} GetAddressRequest instance + */ + GetAddressRequest.create = function create(properties) { + return new GetAddressRequest(properties); + }; + + /** + * Encodes the specified GetAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAddressRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {google.cloud.compute.v1.IGetAddressRequest} message GetAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAddressRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 462920692, wireType 2 =*/3703365538).string(message.address); + return writer; + }; + + /** + * Encodes the specified GetAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAddressRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {google.cloud.compute.v1.IGetAddressRequest} message GetAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAddressRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetAddressRequest} GetAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAddressRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetAddressRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 462920692: + message.address = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAddressRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetAddressRequest} GetAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAddressRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAddressRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAddressRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetAddressRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetAddressRequest} GetAddressRequest + */ + GetAddressRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetAddressRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetAddressRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetAddressRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetAddressRequest + * @static + * @param {google.cloud.compute.v1.GetAddressRequest} message GetAddressRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAddressRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.address = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + return object; + }; + + /** + * Converts this GetAddressRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetAddressRequest + * @instance + * @returns {Object.} JSON object + */ + GetAddressRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetAddressRequest; + })(); + + v1.InsertAddressRequest = (function() { + + /** + * Properties of an InsertAddressRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertAddressRequest + * @property {google.cloud.compute.v1.IAddress|null} [addressResource] InsertAddressRequest addressResource + * @property {string|null} [project] InsertAddressRequest project + * @property {string|null} [region] InsertAddressRequest region + * @property {string|null} [requestId] InsertAddressRequest requestId + */ + + /** + * Constructs a new InsertAddressRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertAddressRequest. + * @implements IInsertAddressRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertAddressRequest=} [properties] Properties to set + */ + function InsertAddressRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertAddressRequest addressResource. + * @member {google.cloud.compute.v1.IAddress|null|undefined} addressResource + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @instance + */ + InsertAddressRequest.prototype.addressResource = null; + + /** + * InsertAddressRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @instance + */ + InsertAddressRequest.prototype.project = ""; + + /** + * InsertAddressRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @instance + */ + InsertAddressRequest.prototype.region = ""; + + /** + * InsertAddressRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @instance + */ + InsertAddressRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertAddressRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @instance + */ + Object.defineProperty(InsertAddressRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertAddressRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {google.cloud.compute.v1.IInsertAddressRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertAddressRequest} InsertAddressRequest instance + */ + InsertAddressRequest.create = function create(properties) { + return new InsertAddressRequest(properties); + }; + + /** + * Encodes the specified InsertAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertAddressRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {google.cloud.compute.v1.IInsertAddressRequest} message InsertAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertAddressRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.addressResource != null && Object.hasOwnProperty.call(message, "addressResource")) + $root.google.cloud.compute.v1.Address.encode(message.addressResource, writer.uint32(/* id 483888121, wireType 2 =*/3871104970).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertAddressRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {google.cloud.compute.v1.IInsertAddressRequest} message InsertAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertAddressRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertAddressRequest} InsertAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertAddressRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertAddressRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 483888121: + message.addressResource = $root.google.cloud.compute.v1.Address.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertAddressRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertAddressRequest} InsertAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertAddressRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertAddressRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertAddressRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.addressResource != null && message.hasOwnProperty("addressResource")) { + var error = $root.google.cloud.compute.v1.Address.verify(message.addressResource); + if (error) + return "addressResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertAddressRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertAddressRequest} InsertAddressRequest + */ + InsertAddressRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertAddressRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertAddressRequest(); + if (object.addressResource != null) { + if (typeof object.addressResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertAddressRequest.addressResource: object expected"); + message.addressResource = $root.google.cloud.compute.v1.Address.fromObject(object.addressResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertAddressRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @static + * @param {google.cloud.compute.v1.InsertAddressRequest} message InsertAddressRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertAddressRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.addressResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.addressResource != null && message.hasOwnProperty("addressResource")) + object.addressResource = $root.google.cloud.compute.v1.Address.toObject(message.addressResource, options); + return object; + }; + + /** + * Converts this InsertAddressRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertAddressRequest + * @instance + * @returns {Object.} JSON object + */ + InsertAddressRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertAddressRequest; + })(); + + v1.ListAddressesRequest = (function() { + + /** + * Properties of a ListAddressesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListAddressesRequest + * @property {string|null} [filter] ListAddressesRequest filter + * @property {number|null} [maxResults] ListAddressesRequest maxResults + * @property {string|null} [orderBy] ListAddressesRequest orderBy + * @property {string|null} [pageToken] ListAddressesRequest pageToken + * @property {string|null} [project] ListAddressesRequest project + * @property {string|null} [region] ListAddressesRequest region + * @property {boolean|null} [returnPartialSuccess] ListAddressesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListAddressesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListAddressesRequest. + * @implements IListAddressesRequest + * @constructor + * @param {google.cloud.compute.v1.IListAddressesRequest=} [properties] Properties to set + */ + function ListAddressesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAddressesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + ListAddressesRequest.prototype.filter = null; + + /** + * ListAddressesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + ListAddressesRequest.prototype.maxResults = null; + + /** + * ListAddressesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + ListAddressesRequest.prototype.orderBy = null; + + /** + * ListAddressesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + ListAddressesRequest.prototype.pageToken = null; + + /** + * ListAddressesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + ListAddressesRequest.prototype.project = ""; + + /** + * ListAddressesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + ListAddressesRequest.prototype.region = ""; + + /** + * ListAddressesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + ListAddressesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListAddressesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + Object.defineProperty(ListAddressesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAddressesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + Object.defineProperty(ListAddressesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAddressesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + Object.defineProperty(ListAddressesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAddressesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + Object.defineProperty(ListAddressesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAddressesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + */ + Object.defineProperty(ListAddressesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListAddressesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {google.cloud.compute.v1.IListAddressesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListAddressesRequest} ListAddressesRequest instance + */ + ListAddressesRequest.create = function create(properties) { + return new ListAddressesRequest(properties); + }; + + /** + * Encodes the specified ListAddressesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAddressesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {google.cloud.compute.v1.IListAddressesRequest} message ListAddressesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAddressesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListAddressesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAddressesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {google.cloud.compute.v1.IListAddressesRequest} message ListAddressesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAddressesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAddressesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListAddressesRequest} ListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAddressesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListAddressesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAddressesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListAddressesRequest} ListAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAddressesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAddressesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAddressesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListAddressesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListAddressesRequest} ListAddressesRequest + */ + ListAddressesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListAddressesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListAddressesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListAddressesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @static + * @param {google.cloud.compute.v1.ListAddressesRequest} message ListAddressesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAddressesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListAddressesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListAddressesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAddressesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAddressesRequest; + })(); + + v1.AggregatedListAutoscalersRequest = (function() { + + /** + * Properties of an AggregatedListAutoscalersRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListAutoscalersRequest + * @property {string|null} [filter] AggregatedListAutoscalersRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListAutoscalersRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListAutoscalersRequest maxResults + * @property {string|null} [orderBy] AggregatedListAutoscalersRequest orderBy + * @property {string|null} [pageToken] AggregatedListAutoscalersRequest pageToken + * @property {string|null} [project] AggregatedListAutoscalersRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListAutoscalersRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListAutoscalersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListAutoscalersRequest. + * @implements IAggregatedListAutoscalersRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListAutoscalersRequest=} [properties] Properties to set + */ + function AggregatedListAutoscalersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListAutoscalersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + AggregatedListAutoscalersRequest.prototype.filter = null; + + /** + * AggregatedListAutoscalersRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + AggregatedListAutoscalersRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListAutoscalersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + AggregatedListAutoscalersRequest.prototype.maxResults = null; + + /** + * AggregatedListAutoscalersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + AggregatedListAutoscalersRequest.prototype.orderBy = null; + + /** + * AggregatedListAutoscalersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + AggregatedListAutoscalersRequest.prototype.pageToken = null; + + /** + * AggregatedListAutoscalersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + AggregatedListAutoscalersRequest.prototype.project = ""; + + /** + * AggregatedListAutoscalersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + AggregatedListAutoscalersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListAutoscalersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + Object.defineProperty(AggregatedListAutoscalersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAutoscalersRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + Object.defineProperty(AggregatedListAutoscalersRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAutoscalersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + Object.defineProperty(AggregatedListAutoscalersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAutoscalersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + Object.defineProperty(AggregatedListAutoscalersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAutoscalersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + Object.defineProperty(AggregatedListAutoscalersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListAutoscalersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + */ + Object.defineProperty(AggregatedListAutoscalersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListAutoscalersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAutoscalersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListAutoscalersRequest} AggregatedListAutoscalersRequest instance + */ + AggregatedListAutoscalersRequest.create = function create(properties) { + return new AggregatedListAutoscalersRequest(properties); + }; + + /** + * Encodes the specified AggregatedListAutoscalersRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAutoscalersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAutoscalersRequest} message AggregatedListAutoscalersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListAutoscalersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListAutoscalersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListAutoscalersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListAutoscalersRequest} message AggregatedListAutoscalersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListAutoscalersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListAutoscalersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListAutoscalersRequest} AggregatedListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListAutoscalersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListAutoscalersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListAutoscalersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListAutoscalersRequest} AggregatedListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListAutoscalersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListAutoscalersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListAutoscalersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListAutoscalersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListAutoscalersRequest} AggregatedListAutoscalersRequest + */ + AggregatedListAutoscalersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListAutoscalersRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListAutoscalersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListAutoscalersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListAutoscalersRequest} message AggregatedListAutoscalersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListAutoscalersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListAutoscalersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListAutoscalersRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListAutoscalersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListAutoscalersRequest; + })(); + + v1.DeleteAutoscalerRequest = (function() { + + /** + * Properties of a DeleteAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteAutoscalerRequest + * @property {string|null} [autoscaler] DeleteAutoscalerRequest autoscaler + * @property {string|null} [project] DeleteAutoscalerRequest project + * @property {string|null} [requestId] DeleteAutoscalerRequest requestId + * @property {string|null} [zone] DeleteAutoscalerRequest zone + */ + + /** + * Constructs a new DeleteAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteAutoscalerRequest. + * @implements IDeleteAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteAutoscalerRequest=} [properties] Properties to set + */ + function DeleteAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAutoscalerRequest autoscaler. + * @member {string} autoscaler + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @instance + */ + DeleteAutoscalerRequest.prototype.autoscaler = ""; + + /** + * DeleteAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @instance + */ + DeleteAutoscalerRequest.prototype.project = ""; + + /** + * DeleteAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @instance + */ + DeleteAutoscalerRequest.prototype.requestId = null; + + /** + * DeleteAutoscalerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @instance + */ + DeleteAutoscalerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @instance + */ + Object.defineProperty(DeleteAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteAutoscalerRequest} DeleteAutoscalerRequest instance + */ + DeleteAutoscalerRequest.create = function create(properties) { + return new DeleteAutoscalerRequest(properties); + }; + + /** + * Encodes the specified DeleteAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAutoscalerRequest} message DeleteAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified DeleteAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAutoscalerRequest} message DeleteAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteAutoscalerRequest} DeleteAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteAutoscalerRequest} DeleteAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteAutoscalerRequest} DeleteAutoscalerRequest + */ + DeleteAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.DeleteAutoscalerRequest} message DeleteAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.autoscaler = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = message.autoscaler; + return object; + }; + + /** + * Converts this DeleteAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteAutoscalerRequest; + })(); + + v1.GetAutoscalerRequest = (function() { + + /** + * Properties of a GetAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetAutoscalerRequest + * @property {string|null} [autoscaler] GetAutoscalerRequest autoscaler + * @property {string|null} [project] GetAutoscalerRequest project + * @property {string|null} [zone] GetAutoscalerRequest zone + */ + + /** + * Constructs a new GetAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetAutoscalerRequest. + * @implements IGetAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IGetAutoscalerRequest=} [properties] Properties to set + */ + function GetAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAutoscalerRequest autoscaler. + * @member {string} autoscaler + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @instance + */ + GetAutoscalerRequest.prototype.autoscaler = ""; + + /** + * GetAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @instance + */ + GetAutoscalerRequest.prototype.project = ""; + + /** + * GetAutoscalerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @instance + */ + GetAutoscalerRequest.prototype.zone = ""; + + /** + * Creates a new GetAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IGetAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetAutoscalerRequest} GetAutoscalerRequest instance + */ + GetAutoscalerRequest.create = function create(properties) { + return new GetAutoscalerRequest(properties); + }; + + /** + * Encodes the specified GetAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IGetAutoscalerRequest} message GetAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified GetAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IGetAutoscalerRequest} message GetAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetAutoscalerRequest} GetAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetAutoscalerRequest} GetAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetAutoscalerRequest} GetAutoscalerRequest + */ + GetAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.GetAutoscalerRequest} message GetAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.autoscaler = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = message.autoscaler; + return object; + }; + + /** + * Converts this GetAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + GetAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetAutoscalerRequest; + })(); + + v1.InsertAutoscalerRequest = (function() { + + /** + * Properties of an InsertAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertAutoscalerRequest + * @property {google.cloud.compute.v1.IAutoscaler|null} [autoscalerResource] InsertAutoscalerRequest autoscalerResource + * @property {string|null} [project] InsertAutoscalerRequest project + * @property {string|null} [requestId] InsertAutoscalerRequest requestId + * @property {string|null} [zone] InsertAutoscalerRequest zone + */ + + /** + * Constructs a new InsertAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertAutoscalerRequest. + * @implements IInsertAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertAutoscalerRequest=} [properties] Properties to set + */ + function InsertAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertAutoscalerRequest autoscalerResource. + * @member {google.cloud.compute.v1.IAutoscaler|null|undefined} autoscalerResource + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @instance + */ + InsertAutoscalerRequest.prototype.autoscalerResource = null; + + /** + * InsertAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @instance + */ + InsertAutoscalerRequest.prototype.project = ""; + + /** + * InsertAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @instance + */ + InsertAutoscalerRequest.prototype.requestId = null; + + /** + * InsertAutoscalerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @instance + */ + InsertAutoscalerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @instance + */ + Object.defineProperty(InsertAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IInsertAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertAutoscalerRequest} InsertAutoscalerRequest instance + */ + InsertAutoscalerRequest.create = function create(properties) { + return new InsertAutoscalerRequest(properties); + }; + + /** + * Encodes the specified InsertAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IInsertAutoscalerRequest} message InsertAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.autoscalerResource != null && Object.hasOwnProperty.call(message, "autoscalerResource")) + $root.google.cloud.compute.v1.Autoscaler.encode(message.autoscalerResource, writer.uint32(/* id 207616118, wireType 2 =*/1660928946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IInsertAutoscalerRequest} message InsertAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertAutoscalerRequest} InsertAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 207616118: + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertAutoscalerRequest} InsertAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.autoscalerResource); + if (error) + return "autoscalerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertAutoscalerRequest} InsertAutoscalerRequest + */ + InsertAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertAutoscalerRequest(); + if (object.autoscalerResource != null) { + if (typeof object.autoscalerResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertAutoscalerRequest.autoscalerResource: object expected"); + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.autoscalerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.InsertAutoscalerRequest} message InsertAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.autoscalerResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) + object.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.toObject(message.autoscalerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + InsertAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertAutoscalerRequest; + })(); + + v1.ListAutoscalersRequest = (function() { + + /** + * Properties of a ListAutoscalersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListAutoscalersRequest + * @property {string|null} [filter] ListAutoscalersRequest filter + * @property {number|null} [maxResults] ListAutoscalersRequest maxResults + * @property {string|null} [orderBy] ListAutoscalersRequest orderBy + * @property {string|null} [pageToken] ListAutoscalersRequest pageToken + * @property {string|null} [project] ListAutoscalersRequest project + * @property {boolean|null} [returnPartialSuccess] ListAutoscalersRequest returnPartialSuccess + * @property {string|null} [zone] ListAutoscalersRequest zone + */ + + /** + * Constructs a new ListAutoscalersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListAutoscalersRequest. + * @implements IListAutoscalersRequest + * @constructor + * @param {google.cloud.compute.v1.IListAutoscalersRequest=} [properties] Properties to set + */ + function ListAutoscalersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAutoscalersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + ListAutoscalersRequest.prototype.filter = null; + + /** + * ListAutoscalersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + ListAutoscalersRequest.prototype.maxResults = null; + + /** + * ListAutoscalersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + ListAutoscalersRequest.prototype.orderBy = null; + + /** + * ListAutoscalersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + ListAutoscalersRequest.prototype.pageToken = null; + + /** + * ListAutoscalersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + ListAutoscalersRequest.prototype.project = ""; + + /** + * ListAutoscalersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + ListAutoscalersRequest.prototype.returnPartialSuccess = null; + + /** + * ListAutoscalersRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + ListAutoscalersRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListAutoscalersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + Object.defineProperty(ListAutoscalersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAutoscalersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + Object.defineProperty(ListAutoscalersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAutoscalersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + Object.defineProperty(ListAutoscalersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAutoscalersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + Object.defineProperty(ListAutoscalersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAutoscalersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + */ + Object.defineProperty(ListAutoscalersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListAutoscalersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IListAutoscalersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListAutoscalersRequest} ListAutoscalersRequest instance + */ + ListAutoscalersRequest.create = function create(properties) { + return new ListAutoscalersRequest(properties); + }; + + /** + * Encodes the specified ListAutoscalersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAutoscalersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IListAutoscalersRequest} message ListAutoscalersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAutoscalersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListAutoscalersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAutoscalersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IListAutoscalersRequest} message ListAutoscalersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAutoscalersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAutoscalersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListAutoscalersRequest} ListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAutoscalersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListAutoscalersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAutoscalersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListAutoscalersRequest} ListAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAutoscalersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAutoscalersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAutoscalersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListAutoscalersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListAutoscalersRequest} ListAutoscalersRequest + */ + ListAutoscalersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListAutoscalersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListAutoscalersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListAutoscalersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.ListAutoscalersRequest} message ListAutoscalersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAutoscalersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListAutoscalersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListAutoscalersRequest + * @instance + * @returns {Object.} JSON object + */ + ListAutoscalersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAutoscalersRequest; + })(); + + v1.PatchAutoscalerRequest = (function() { + + /** + * Properties of a PatchAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchAutoscalerRequest + * @property {string|null} [autoscaler] PatchAutoscalerRequest autoscaler + * @property {google.cloud.compute.v1.IAutoscaler|null} [autoscalerResource] PatchAutoscalerRequest autoscalerResource + * @property {string|null} [project] PatchAutoscalerRequest project + * @property {string|null} [requestId] PatchAutoscalerRequest requestId + * @property {string|null} [zone] PatchAutoscalerRequest zone + */ + + /** + * Constructs a new PatchAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchAutoscalerRequest. + * @implements IPatchAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchAutoscalerRequest=} [properties] Properties to set + */ + function PatchAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchAutoscalerRequest autoscaler. + * @member {string|null|undefined} autoscaler + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + */ + PatchAutoscalerRequest.prototype.autoscaler = null; + + /** + * PatchAutoscalerRequest autoscalerResource. + * @member {google.cloud.compute.v1.IAutoscaler|null|undefined} autoscalerResource + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + */ + PatchAutoscalerRequest.prototype.autoscalerResource = null; + + /** + * PatchAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + */ + PatchAutoscalerRequest.prototype.project = ""; + + /** + * PatchAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + */ + PatchAutoscalerRequest.prototype.requestId = null; + + /** + * PatchAutoscalerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + */ + PatchAutoscalerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchAutoscalerRequest _autoscaler. + * @member {"autoscaler"|undefined} _autoscaler + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + */ + Object.defineProperty(PatchAutoscalerRequest.prototype, "_autoscaler", { + get: $util.oneOfGetter($oneOfFields = ["autoscaler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PatchAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + */ + Object.defineProperty(PatchAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IPatchAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchAutoscalerRequest} PatchAutoscalerRequest instance + */ + PatchAutoscalerRequest.create = function create(properties) { + return new PatchAutoscalerRequest(properties); + }; + + /** + * Encodes the specified PatchAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IPatchAutoscalerRequest} message PatchAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.autoscalerResource != null && Object.hasOwnProperty.call(message, "autoscalerResource")) + $root.google.cloud.compute.v1.Autoscaler.encode(message.autoscalerResource, writer.uint32(/* id 207616118, wireType 2 =*/1660928946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified PatchAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IPatchAutoscalerRequest} message PatchAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchAutoscalerRequest} PatchAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 207616118: + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchAutoscalerRequest} PatchAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + properties._autoscaler = 1; + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + } + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.autoscalerResource); + if (error) + return "autoscalerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a PatchAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchAutoscalerRequest} PatchAutoscalerRequest + */ + PatchAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.autoscalerResource != null) { + if (typeof object.autoscalerResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchAutoscalerRequest.autoscalerResource: object expected"); + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.autoscalerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a PatchAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.PatchAutoscalerRequest} message PatchAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.autoscalerResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) + object.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.toObject(message.autoscalerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + object.autoscaler = message.autoscaler; + if (options.oneofs) + object._autoscaler = "autoscaler"; + } + return object; + }; + + /** + * Converts this PatchAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + PatchAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchAutoscalerRequest; + })(); + + v1.UpdateAutoscalerRequest = (function() { + + /** + * Properties of an UpdateAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateAutoscalerRequest + * @property {string|null} [autoscaler] UpdateAutoscalerRequest autoscaler + * @property {google.cloud.compute.v1.IAutoscaler|null} [autoscalerResource] UpdateAutoscalerRequest autoscalerResource + * @property {string|null} [project] UpdateAutoscalerRequest project + * @property {string|null} [requestId] UpdateAutoscalerRequest requestId + * @property {string|null} [zone] UpdateAutoscalerRequest zone + */ + + /** + * Constructs a new UpdateAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateAutoscalerRequest. + * @implements IUpdateAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateAutoscalerRequest=} [properties] Properties to set + */ + function UpdateAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAutoscalerRequest autoscaler. + * @member {string|null|undefined} autoscaler + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + */ + UpdateAutoscalerRequest.prototype.autoscaler = null; + + /** + * UpdateAutoscalerRequest autoscalerResource. + * @member {google.cloud.compute.v1.IAutoscaler|null|undefined} autoscalerResource + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + */ + UpdateAutoscalerRequest.prototype.autoscalerResource = null; + + /** + * UpdateAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + */ + UpdateAutoscalerRequest.prototype.project = ""; + + /** + * UpdateAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + */ + UpdateAutoscalerRequest.prototype.requestId = null; + + /** + * UpdateAutoscalerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + */ + UpdateAutoscalerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateAutoscalerRequest _autoscaler. + * @member {"autoscaler"|undefined} _autoscaler + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + */ + Object.defineProperty(UpdateAutoscalerRequest.prototype, "_autoscaler", { + get: $util.oneOfGetter($oneOfFields = ["autoscaler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UpdateAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + */ + Object.defineProperty(UpdateAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IUpdateAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateAutoscalerRequest} UpdateAutoscalerRequest instance + */ + UpdateAutoscalerRequest.create = function create(properties) { + return new UpdateAutoscalerRequest(properties); + }; + + /** + * Encodes the specified UpdateAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IUpdateAutoscalerRequest} message UpdateAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.autoscalerResource != null && Object.hasOwnProperty.call(message, "autoscalerResource")) + $root.google.cloud.compute.v1.Autoscaler.encode(message.autoscalerResource, writer.uint32(/* id 207616118, wireType 2 =*/1660928946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified UpdateAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IUpdateAutoscalerRequest} message UpdateAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateAutoscalerRequest} UpdateAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 207616118: + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateAutoscalerRequest} UpdateAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + properties._autoscaler = 1; + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + } + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.autoscalerResource); + if (error) + return "autoscalerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an UpdateAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateAutoscalerRequest} UpdateAutoscalerRequest + */ + UpdateAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.autoscalerResource != null) { + if (typeof object.autoscalerResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateAutoscalerRequest.autoscalerResource: object expected"); + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.autoscalerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an UpdateAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.UpdateAutoscalerRequest} message UpdateAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.autoscalerResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) + object.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.toObject(message.autoscalerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + object.autoscaler = message.autoscaler; + if (options.oneofs) + object._autoscaler = "autoscaler"; + } + return object; + }; + + /** + * Converts this UpdateAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateAutoscalerRequest; + })(); + + v1.AddSignedUrlKeyBackendBucketRequest = (function() { + + /** + * Properties of an AddSignedUrlKeyBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddSignedUrlKeyBackendBucketRequest + * @property {string|null} [backendBucket] AddSignedUrlKeyBackendBucketRequest backendBucket + * @property {string|null} [project] AddSignedUrlKeyBackendBucketRequest project + * @property {string|null} [requestId] AddSignedUrlKeyBackendBucketRequest requestId + * @property {google.cloud.compute.v1.ISignedUrlKey|null} [signedUrlKeyResource] AddSignedUrlKeyBackendBucketRequest signedUrlKeyResource + */ + + /** + * Constructs a new AddSignedUrlKeyBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddSignedUrlKeyBackendBucketRequest. + * @implements IAddSignedUrlKeyBackendBucketRequest + * @constructor + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest=} [properties] Properties to set + */ + function AddSignedUrlKeyBackendBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddSignedUrlKeyBackendBucketRequest backendBucket. + * @member {string} backendBucket + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @instance + */ + AddSignedUrlKeyBackendBucketRequest.prototype.backendBucket = ""; + + /** + * AddSignedUrlKeyBackendBucketRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @instance + */ + AddSignedUrlKeyBackendBucketRequest.prototype.project = ""; + + /** + * AddSignedUrlKeyBackendBucketRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @instance + */ + AddSignedUrlKeyBackendBucketRequest.prototype.requestId = null; + + /** + * AddSignedUrlKeyBackendBucketRequest signedUrlKeyResource. + * @member {google.cloud.compute.v1.ISignedUrlKey|null|undefined} signedUrlKeyResource + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @instance + */ + AddSignedUrlKeyBackendBucketRequest.prototype.signedUrlKeyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddSignedUrlKeyBackendBucketRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @instance + */ + Object.defineProperty(AddSignedUrlKeyBackendBucketRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddSignedUrlKeyBackendBucketRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest} AddSignedUrlKeyBackendBucketRequest instance + */ + AddSignedUrlKeyBackendBucketRequest.create = function create(properties) { + return new AddSignedUrlKeyBackendBucketRequest(properties); + }; + + /** + * Encodes the specified AddSignedUrlKeyBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest} message AddSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSignedUrlKeyBackendBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.backendBucket != null && Object.hasOwnProperty.call(message, "backendBucket")) + writer.uint32(/* id 91714037, wireType 2 =*/733712298).string(message.backendBucket); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.signedUrlKeyResource != null && Object.hasOwnProperty.call(message, "signedUrlKeyResource")) + $root.google.cloud.compute.v1.SignedUrlKey.encode(message.signedUrlKeyResource, writer.uint32(/* id 457625985, wireType 2 =*/3661007882).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddSignedUrlKeyBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest} message AddSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSignedUrlKeyBackendBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddSignedUrlKeyBackendBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest} AddSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSignedUrlKeyBackendBucketRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 91714037: + message.backendBucket = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 457625985: + message.signedUrlKeyResource = $root.google.cloud.compute.v1.SignedUrlKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddSignedUrlKeyBackendBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest} AddSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSignedUrlKeyBackendBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddSignedUrlKeyBackendBucketRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddSignedUrlKeyBackendBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + if (!$util.isString(message.backendBucket)) + return "backendBucket: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.signedUrlKeyResource != null && message.hasOwnProperty("signedUrlKeyResource")) { + var error = $root.google.cloud.compute.v1.SignedUrlKey.verify(message.signedUrlKeyResource); + if (error) + return "signedUrlKeyResource." + error; + } + return null; + }; + + /** + * Creates an AddSignedUrlKeyBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest} AddSignedUrlKeyBackendBucketRequest + */ + AddSignedUrlKeyBackendBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest(); + if (object.backendBucket != null) + message.backendBucket = String(object.backendBucket); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.signedUrlKeyResource != null) { + if (typeof object.signedUrlKeyResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest.signedUrlKeyResource: object expected"); + message.signedUrlKeyResource = $root.google.cloud.compute.v1.SignedUrlKey.fromObject(object.signedUrlKeyResource); + } + return message; + }; + + /** + * Creates a plain object from an AddSignedUrlKeyBackendBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest} message AddSignedUrlKeyBackendBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddSignedUrlKeyBackendBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backendBucket = ""; + object.project = ""; + object.signedUrlKeyResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + object.backendBucket = message.backendBucket; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.signedUrlKeyResource != null && message.hasOwnProperty("signedUrlKeyResource")) + object.signedUrlKeyResource = $root.google.cloud.compute.v1.SignedUrlKey.toObject(message.signedUrlKeyResource, options); + return object; + }; + + /** + * Converts this AddSignedUrlKeyBackendBucketRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest + * @instance + * @returns {Object.} JSON object + */ + AddSignedUrlKeyBackendBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddSignedUrlKeyBackendBucketRequest; + })(); + + v1.DeleteBackendBucketRequest = (function() { + + /** + * Properties of a DeleteBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteBackendBucketRequest + * @property {string|null} [backendBucket] DeleteBackendBucketRequest backendBucket + * @property {string|null} [project] DeleteBackendBucketRequest project + * @property {string|null} [requestId] DeleteBackendBucketRequest requestId + */ + + /** + * Constructs a new DeleteBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteBackendBucketRequest. + * @implements IDeleteBackendBucketRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteBackendBucketRequest=} [properties] Properties to set + */ + function DeleteBackendBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackendBucketRequest backendBucket. + * @member {string} backendBucket + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @instance + */ + DeleteBackendBucketRequest.prototype.backendBucket = ""; + + /** + * DeleteBackendBucketRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @instance + */ + DeleteBackendBucketRequest.prototype.project = ""; + + /** + * DeleteBackendBucketRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @instance + */ + DeleteBackendBucketRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteBackendBucketRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @instance + */ + Object.defineProperty(DeleteBackendBucketRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteBackendBucketRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IDeleteBackendBucketRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteBackendBucketRequest} DeleteBackendBucketRequest instance + */ + DeleteBackendBucketRequest.create = function create(properties) { + return new DeleteBackendBucketRequest(properties); + }; + + /** + * Encodes the specified DeleteBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IDeleteBackendBucketRequest} message DeleteBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackendBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.backendBucket != null && Object.hasOwnProperty.call(message, "backendBucket")) + writer.uint32(/* id 91714037, wireType 2 =*/733712298).string(message.backendBucket); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IDeleteBackendBucketRequest} message DeleteBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackendBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackendBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteBackendBucketRequest} DeleteBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackendBucketRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteBackendBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 91714037: + message.backendBucket = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackendBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteBackendBucketRequest} DeleteBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackendBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackendBucketRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackendBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + if (!$util.isString(message.backendBucket)) + return "backendBucket: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteBackendBucketRequest} DeleteBackendBucketRequest + */ + DeleteBackendBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteBackendBucketRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteBackendBucketRequest(); + if (object.backendBucket != null) + message.backendBucket = String(object.backendBucket); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackendBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.DeleteBackendBucketRequest} message DeleteBackendBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackendBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backendBucket = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + object.backendBucket = message.backendBucket; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteBackendBucketRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteBackendBucketRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackendBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteBackendBucketRequest; + })(); + + v1.DeleteSignedUrlKeyBackendBucketRequest = (function() { + + /** + * Properties of a DeleteSignedUrlKeyBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteSignedUrlKeyBackendBucketRequest + * @property {string|null} [backendBucket] DeleteSignedUrlKeyBackendBucketRequest backendBucket + * @property {string|null} [keyName] DeleteSignedUrlKeyBackendBucketRequest keyName + * @property {string|null} [project] DeleteSignedUrlKeyBackendBucketRequest project + * @property {string|null} [requestId] DeleteSignedUrlKeyBackendBucketRequest requestId + */ + + /** + * Constructs a new DeleteSignedUrlKeyBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteSignedUrlKeyBackendBucketRequest. + * @implements IDeleteSignedUrlKeyBackendBucketRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest=} [properties] Properties to set + */ + function DeleteSignedUrlKeyBackendBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSignedUrlKeyBackendBucketRequest backendBucket. + * @member {string} backendBucket + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @instance + */ + DeleteSignedUrlKeyBackendBucketRequest.prototype.backendBucket = ""; + + /** + * DeleteSignedUrlKeyBackendBucketRequest keyName. + * @member {string} keyName + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @instance + */ + DeleteSignedUrlKeyBackendBucketRequest.prototype.keyName = ""; + + /** + * DeleteSignedUrlKeyBackendBucketRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @instance + */ + DeleteSignedUrlKeyBackendBucketRequest.prototype.project = ""; + + /** + * DeleteSignedUrlKeyBackendBucketRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @instance + */ + DeleteSignedUrlKeyBackendBucketRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteSignedUrlKeyBackendBucketRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @instance + */ + Object.defineProperty(DeleteSignedUrlKeyBackendBucketRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteSignedUrlKeyBackendBucketRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest} DeleteSignedUrlKeyBackendBucketRequest instance + */ + DeleteSignedUrlKeyBackendBucketRequest.create = function create(properties) { + return new DeleteSignedUrlKeyBackendBucketRequest(properties); + }; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest} message DeleteSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSignedUrlKeyBackendBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.backendBucket != null && Object.hasOwnProperty.call(message, "backendBucket")) + writer.uint32(/* id 91714037, wireType 2 =*/733712298).string(message.backendBucket); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 500938859, wireType 2 =*/4007510874).string(message.keyName); + return writer; + }; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest} message DeleteSignedUrlKeyBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSignedUrlKeyBackendBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSignedUrlKeyBackendBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest} DeleteSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSignedUrlKeyBackendBucketRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 91714037: + message.backendBucket = reader.string(); + break; + case 500938859: + message.keyName = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSignedUrlKeyBackendBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest} DeleteSignedUrlKeyBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSignedUrlKeyBackendBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSignedUrlKeyBackendBucketRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSignedUrlKeyBackendBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + if (!$util.isString(message.backendBucket)) + return "backendBucket: string expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteSignedUrlKeyBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest} DeleteSignedUrlKeyBackendBucketRequest + */ + DeleteSignedUrlKeyBackendBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest(); + if (object.backendBucket != null) + message.backendBucket = String(object.backendBucket); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteSignedUrlKeyBackendBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest} message DeleteSignedUrlKeyBackendBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSignedUrlKeyBackendBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backendBucket = ""; + object.project = ""; + object.keyName = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + object.backendBucket = message.backendBucket; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + return object; + }; + + /** + * Converts this DeleteSignedUrlKeyBackendBucketRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSignedUrlKeyBackendBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSignedUrlKeyBackendBucketRequest; + })(); + + v1.GetBackendBucketRequest = (function() { + + /** + * Properties of a GetBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetBackendBucketRequest + * @property {string|null} [backendBucket] GetBackendBucketRequest backendBucket + * @property {string|null} [project] GetBackendBucketRequest project + */ + + /** + * Constructs a new GetBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetBackendBucketRequest. + * @implements IGetBackendBucketRequest + * @constructor + * @param {google.cloud.compute.v1.IGetBackendBucketRequest=} [properties] Properties to set + */ + function GetBackendBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackendBucketRequest backendBucket. + * @member {string} backendBucket + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @instance + */ + GetBackendBucketRequest.prototype.backendBucket = ""; + + /** + * GetBackendBucketRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @instance + */ + GetBackendBucketRequest.prototype.project = ""; + + /** + * Creates a new GetBackendBucketRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IGetBackendBucketRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetBackendBucketRequest} GetBackendBucketRequest instance + */ + GetBackendBucketRequest.create = function create(properties) { + return new GetBackendBucketRequest(properties); + }; + + /** + * Encodes the specified GetBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.GetBackendBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IGetBackendBucketRequest} message GetBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackendBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backendBucket != null && Object.hasOwnProperty.call(message, "backendBucket")) + writer.uint32(/* id 91714037, wireType 2 =*/733712298).string(message.backendBucket); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetBackendBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IGetBackendBucketRequest} message GetBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackendBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackendBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetBackendBucketRequest} GetBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackendBucketRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetBackendBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 91714037: + message.backendBucket = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackendBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetBackendBucketRequest} GetBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackendBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackendBucketRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackendBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + if (!$util.isString(message.backendBucket)) + return "backendBucket: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetBackendBucketRequest} GetBackendBucketRequest + */ + GetBackendBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetBackendBucketRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetBackendBucketRequest(); + if (object.backendBucket != null) + message.backendBucket = String(object.backendBucket); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetBackendBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.GetBackendBucketRequest} message GetBackendBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackendBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backendBucket = ""; + object.project = ""; + } + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + object.backendBucket = message.backendBucket; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetBackendBucketRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetBackendBucketRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackendBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBackendBucketRequest; + })(); + + v1.InsertBackendBucketRequest = (function() { + + /** + * Properties of an InsertBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertBackendBucketRequest + * @property {google.cloud.compute.v1.IBackendBucket|null} [backendBucketResource] InsertBackendBucketRequest backendBucketResource + * @property {string|null} [project] InsertBackendBucketRequest project + * @property {string|null} [requestId] InsertBackendBucketRequest requestId + */ + + /** + * Constructs a new InsertBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertBackendBucketRequest. + * @implements IInsertBackendBucketRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertBackendBucketRequest=} [properties] Properties to set + */ + function InsertBackendBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertBackendBucketRequest backendBucketResource. + * @member {google.cloud.compute.v1.IBackendBucket|null|undefined} backendBucketResource + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @instance + */ + InsertBackendBucketRequest.prototype.backendBucketResource = null; + + /** + * InsertBackendBucketRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @instance + */ + InsertBackendBucketRequest.prototype.project = ""; + + /** + * InsertBackendBucketRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @instance + */ + InsertBackendBucketRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertBackendBucketRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @instance + */ + Object.defineProperty(InsertBackendBucketRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertBackendBucketRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IInsertBackendBucketRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertBackendBucketRequest} InsertBackendBucketRequest instance + */ + InsertBackendBucketRequest.create = function create(properties) { + return new InsertBackendBucketRequest(properties); + }; + + /** + * Encodes the specified InsertBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertBackendBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IInsertBackendBucketRequest} message InsertBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertBackendBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendBucketResource != null && Object.hasOwnProperty.call(message, "backendBucketResource")) + $root.google.cloud.compute.v1.BackendBucket.encode(message.backendBucketResource, writer.uint32(/* id 380757784, wireType 2 =*/3046062274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertBackendBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IInsertBackendBucketRequest} message InsertBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertBackendBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertBackendBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertBackendBucketRequest} InsertBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertBackendBucketRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertBackendBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 380757784: + message.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertBackendBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertBackendBucketRequest} InsertBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertBackendBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertBackendBucketRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertBackendBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendBucketResource != null && message.hasOwnProperty("backendBucketResource")) { + var error = $root.google.cloud.compute.v1.BackendBucket.verify(message.backendBucketResource); + if (error) + return "backendBucketResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertBackendBucketRequest} InsertBackendBucketRequest + */ + InsertBackendBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertBackendBucketRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertBackendBucketRequest(); + if (object.backendBucketResource != null) { + if (typeof object.backendBucketResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertBackendBucketRequest.backendBucketResource: object expected"); + message.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.fromObject(object.backendBucketResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertBackendBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.InsertBackendBucketRequest} message InsertBackendBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertBackendBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendBucketResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendBucketResource != null && message.hasOwnProperty("backendBucketResource")) + object.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.toObject(message.backendBucketResource, options); + return object; + }; + + /** + * Converts this InsertBackendBucketRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertBackendBucketRequest + * @instance + * @returns {Object.} JSON object + */ + InsertBackendBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertBackendBucketRequest; + })(); + + v1.ListBackendBucketsRequest = (function() { + + /** + * Properties of a ListBackendBucketsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListBackendBucketsRequest + * @property {string|null} [filter] ListBackendBucketsRequest filter + * @property {number|null} [maxResults] ListBackendBucketsRequest maxResults + * @property {string|null} [orderBy] ListBackendBucketsRequest orderBy + * @property {string|null} [pageToken] ListBackendBucketsRequest pageToken + * @property {string|null} [project] ListBackendBucketsRequest project + * @property {boolean|null} [returnPartialSuccess] ListBackendBucketsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListBackendBucketsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListBackendBucketsRequest. + * @implements IListBackendBucketsRequest + * @constructor + * @param {google.cloud.compute.v1.IListBackendBucketsRequest=} [properties] Properties to set + */ + function ListBackendBucketsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackendBucketsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + ListBackendBucketsRequest.prototype.filter = null; + + /** + * ListBackendBucketsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + ListBackendBucketsRequest.prototype.maxResults = null; + + /** + * ListBackendBucketsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + ListBackendBucketsRequest.prototype.orderBy = null; + + /** + * ListBackendBucketsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + ListBackendBucketsRequest.prototype.pageToken = null; + + /** + * ListBackendBucketsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + ListBackendBucketsRequest.prototype.project = ""; + + /** + * ListBackendBucketsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + ListBackendBucketsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListBackendBucketsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + Object.defineProperty(ListBackendBucketsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendBucketsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + Object.defineProperty(ListBackendBucketsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendBucketsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + Object.defineProperty(ListBackendBucketsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendBucketsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + Object.defineProperty(ListBackendBucketsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendBucketsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + */ + Object.defineProperty(ListBackendBucketsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListBackendBucketsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {google.cloud.compute.v1.IListBackendBucketsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListBackendBucketsRequest} ListBackendBucketsRequest instance + */ + ListBackendBucketsRequest.create = function create(properties) { + return new ListBackendBucketsRequest(properties); + }; + + /** + * Encodes the specified ListBackendBucketsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListBackendBucketsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {google.cloud.compute.v1.IListBackendBucketsRequest} message ListBackendBucketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendBucketsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListBackendBucketsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListBackendBucketsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {google.cloud.compute.v1.IListBackendBucketsRequest} message ListBackendBucketsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendBucketsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackendBucketsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListBackendBucketsRequest} ListBackendBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendBucketsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListBackendBucketsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackendBucketsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListBackendBucketsRequest} ListBackendBucketsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendBucketsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackendBucketsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackendBucketsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListBackendBucketsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListBackendBucketsRequest} ListBackendBucketsRequest + */ + ListBackendBucketsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListBackendBucketsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListBackendBucketsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListBackendBucketsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @static + * @param {google.cloud.compute.v1.ListBackendBucketsRequest} message ListBackendBucketsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackendBucketsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListBackendBucketsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListBackendBucketsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackendBucketsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBackendBucketsRequest; + })(); + + v1.PatchBackendBucketRequest = (function() { + + /** + * Properties of a PatchBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchBackendBucketRequest + * @property {string|null} [backendBucket] PatchBackendBucketRequest backendBucket + * @property {google.cloud.compute.v1.IBackendBucket|null} [backendBucketResource] PatchBackendBucketRequest backendBucketResource + * @property {string|null} [project] PatchBackendBucketRequest project + * @property {string|null} [requestId] PatchBackendBucketRequest requestId + */ + + /** + * Constructs a new PatchBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchBackendBucketRequest. + * @implements IPatchBackendBucketRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchBackendBucketRequest=} [properties] Properties to set + */ + function PatchBackendBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchBackendBucketRequest backendBucket. + * @member {string} backendBucket + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @instance + */ + PatchBackendBucketRequest.prototype.backendBucket = ""; + + /** + * PatchBackendBucketRequest backendBucketResource. + * @member {google.cloud.compute.v1.IBackendBucket|null|undefined} backendBucketResource + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @instance + */ + PatchBackendBucketRequest.prototype.backendBucketResource = null; + + /** + * PatchBackendBucketRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @instance + */ + PatchBackendBucketRequest.prototype.project = ""; + + /** + * PatchBackendBucketRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @instance + */ + PatchBackendBucketRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchBackendBucketRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @instance + */ + Object.defineProperty(PatchBackendBucketRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchBackendBucketRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IPatchBackendBucketRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchBackendBucketRequest} PatchBackendBucketRequest instance + */ + PatchBackendBucketRequest.create = function create(properties) { + return new PatchBackendBucketRequest(properties); + }; + + /** + * Encodes the specified PatchBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchBackendBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IPatchBackendBucketRequest} message PatchBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchBackendBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.backendBucket != null && Object.hasOwnProperty.call(message, "backendBucket")) + writer.uint32(/* id 91714037, wireType 2 =*/733712298).string(message.backendBucket); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendBucketResource != null && Object.hasOwnProperty.call(message, "backendBucketResource")) + $root.google.cloud.compute.v1.BackendBucket.encode(message.backendBucketResource, writer.uint32(/* id 380757784, wireType 2 =*/3046062274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchBackendBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IPatchBackendBucketRequest} message PatchBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchBackendBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchBackendBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchBackendBucketRequest} PatchBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchBackendBucketRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchBackendBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 91714037: + message.backendBucket = reader.string(); + break; + case 380757784: + message.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchBackendBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchBackendBucketRequest} PatchBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchBackendBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchBackendBucketRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchBackendBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + if (!$util.isString(message.backendBucket)) + return "backendBucket: string expected"; + if (message.backendBucketResource != null && message.hasOwnProperty("backendBucketResource")) { + var error = $root.google.cloud.compute.v1.BackendBucket.verify(message.backendBucketResource); + if (error) + return "backendBucketResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchBackendBucketRequest} PatchBackendBucketRequest + */ + PatchBackendBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchBackendBucketRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchBackendBucketRequest(); + if (object.backendBucket != null) + message.backendBucket = String(object.backendBucket); + if (object.backendBucketResource != null) { + if (typeof object.backendBucketResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchBackendBucketRequest.backendBucketResource: object expected"); + message.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.fromObject(object.backendBucketResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchBackendBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.PatchBackendBucketRequest} message PatchBackendBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchBackendBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backendBucket = ""; + object.project = ""; + object.backendBucketResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + object.backendBucket = message.backendBucket; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendBucketResource != null && message.hasOwnProperty("backendBucketResource")) + object.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.toObject(message.backendBucketResource, options); + return object; + }; + + /** + * Converts this PatchBackendBucketRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchBackendBucketRequest + * @instance + * @returns {Object.} JSON object + */ + PatchBackendBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchBackendBucketRequest; + })(); + + v1.UpdateBackendBucketRequest = (function() { + + /** + * Properties of an UpdateBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateBackendBucketRequest + * @property {string|null} [backendBucket] UpdateBackendBucketRequest backendBucket + * @property {google.cloud.compute.v1.IBackendBucket|null} [backendBucketResource] UpdateBackendBucketRequest backendBucketResource + * @property {string|null} [project] UpdateBackendBucketRequest project + * @property {string|null} [requestId] UpdateBackendBucketRequest requestId + */ + + /** + * Constructs a new UpdateBackendBucketRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateBackendBucketRequest. + * @implements IUpdateBackendBucketRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateBackendBucketRequest=} [properties] Properties to set + */ + function UpdateBackendBucketRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackendBucketRequest backendBucket. + * @member {string} backendBucket + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @instance + */ + UpdateBackendBucketRequest.prototype.backendBucket = ""; + + /** + * UpdateBackendBucketRequest backendBucketResource. + * @member {google.cloud.compute.v1.IBackendBucket|null|undefined} backendBucketResource + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @instance + */ + UpdateBackendBucketRequest.prototype.backendBucketResource = null; + + /** + * UpdateBackendBucketRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @instance + */ + UpdateBackendBucketRequest.prototype.project = ""; + + /** + * UpdateBackendBucketRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @instance + */ + UpdateBackendBucketRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateBackendBucketRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @instance + */ + Object.defineProperty(UpdateBackendBucketRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateBackendBucketRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IUpdateBackendBucketRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateBackendBucketRequest} UpdateBackendBucketRequest instance + */ + UpdateBackendBucketRequest.create = function create(properties) { + return new UpdateBackendBucketRequest(properties); + }; + + /** + * Encodes the specified UpdateBackendBucketRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendBucketRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IUpdateBackendBucketRequest} message UpdateBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackendBucketRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.backendBucket != null && Object.hasOwnProperty.call(message, "backendBucket")) + writer.uint32(/* id 91714037, wireType 2 =*/733712298).string(message.backendBucket); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendBucketResource != null && Object.hasOwnProperty.call(message, "backendBucketResource")) + $root.google.cloud.compute.v1.BackendBucket.encode(message.backendBucketResource, writer.uint32(/* id 380757784, wireType 2 =*/3046062274).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackendBucketRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendBucketRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.IUpdateBackendBucketRequest} message UpdateBackendBucketRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackendBucketRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackendBucketRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateBackendBucketRequest} UpdateBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackendBucketRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateBackendBucketRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 91714037: + message.backendBucket = reader.string(); + break; + case 380757784: + message.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackendBucketRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateBackendBucketRequest} UpdateBackendBucketRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackendBucketRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackendBucketRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackendBucketRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + if (!$util.isString(message.backendBucket)) + return "backendBucket: string expected"; + if (message.backendBucketResource != null && message.hasOwnProperty("backendBucketResource")) { + var error = $root.google.cloud.compute.v1.BackendBucket.verify(message.backendBucketResource); + if (error) + return "backendBucketResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdateBackendBucketRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateBackendBucketRequest} UpdateBackendBucketRequest + */ + UpdateBackendBucketRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateBackendBucketRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateBackendBucketRequest(); + if (object.backendBucket != null) + message.backendBucket = String(object.backendBucket); + if (object.backendBucketResource != null) { + if (typeof object.backendBucketResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateBackendBucketRequest.backendBucketResource: object expected"); + message.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.fromObject(object.backendBucketResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateBackendBucketRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @static + * @param {google.cloud.compute.v1.UpdateBackendBucketRequest} message UpdateBackendBucketRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackendBucketRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backendBucket = ""; + object.project = ""; + object.backendBucketResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.backendBucket != null && message.hasOwnProperty("backendBucket")) + object.backendBucket = message.backendBucket; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendBucketResource != null && message.hasOwnProperty("backendBucketResource")) + object.backendBucketResource = $root.google.cloud.compute.v1.BackendBucket.toObject(message.backendBucketResource, options); + return object; + }; + + /** + * Converts this UpdateBackendBucketRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateBackendBucketRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackendBucketRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateBackendBucketRequest; + })(); + + v1.AddSignedUrlKeyBackendServiceRequest = (function() { + + /** + * Properties of an AddSignedUrlKeyBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddSignedUrlKeyBackendServiceRequest + * @property {string|null} [backendService] AddSignedUrlKeyBackendServiceRequest backendService + * @property {string|null} [project] AddSignedUrlKeyBackendServiceRequest project + * @property {string|null} [requestId] AddSignedUrlKeyBackendServiceRequest requestId + * @property {google.cloud.compute.v1.ISignedUrlKey|null} [signedUrlKeyResource] AddSignedUrlKeyBackendServiceRequest signedUrlKeyResource + */ + + /** + * Constructs a new AddSignedUrlKeyBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddSignedUrlKeyBackendServiceRequest. + * @implements IAddSignedUrlKeyBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest=} [properties] Properties to set + */ + function AddSignedUrlKeyBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddSignedUrlKeyBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @instance + */ + AddSignedUrlKeyBackendServiceRequest.prototype.backendService = ""; + + /** + * AddSignedUrlKeyBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @instance + */ + AddSignedUrlKeyBackendServiceRequest.prototype.project = ""; + + /** + * AddSignedUrlKeyBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @instance + */ + AddSignedUrlKeyBackendServiceRequest.prototype.requestId = null; + + /** + * AddSignedUrlKeyBackendServiceRequest signedUrlKeyResource. + * @member {google.cloud.compute.v1.ISignedUrlKey|null|undefined} signedUrlKeyResource + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @instance + */ + AddSignedUrlKeyBackendServiceRequest.prototype.signedUrlKeyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddSignedUrlKeyBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @instance + */ + Object.defineProperty(AddSignedUrlKeyBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddSignedUrlKeyBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest} AddSignedUrlKeyBackendServiceRequest instance + */ + AddSignedUrlKeyBackendServiceRequest.create = function create(properties) { + return new AddSignedUrlKeyBackendServiceRequest(properties); + }; + + /** + * Encodes the specified AddSignedUrlKeyBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest} message AddSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSignedUrlKeyBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.signedUrlKeyResource != null && Object.hasOwnProperty.call(message, "signedUrlKeyResource")) + $root.google.cloud.compute.v1.SignedUrlKey.encode(message.signedUrlKeyResource, writer.uint32(/* id 457625985, wireType 2 =*/3661007882).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddSignedUrlKeyBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest} message AddSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddSignedUrlKeyBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddSignedUrlKeyBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest} AddSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSignedUrlKeyBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 457625985: + message.signedUrlKeyResource = $root.google.cloud.compute.v1.SignedUrlKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddSignedUrlKeyBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest} AddSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddSignedUrlKeyBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddSignedUrlKeyBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddSignedUrlKeyBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.signedUrlKeyResource != null && message.hasOwnProperty("signedUrlKeyResource")) { + var error = $root.google.cloud.compute.v1.SignedUrlKey.verify(message.signedUrlKeyResource); + if (error) + return "signedUrlKeyResource." + error; + } + return null; + }; + + /** + * Creates an AddSignedUrlKeyBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest} AddSignedUrlKeyBackendServiceRequest + */ + AddSignedUrlKeyBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.signedUrlKeyResource != null) { + if (typeof object.signedUrlKeyResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest.signedUrlKeyResource: object expected"); + message.signedUrlKeyResource = $root.google.cloud.compute.v1.SignedUrlKey.fromObject(object.signedUrlKeyResource); + } + return message; + }; + + /** + * Creates a plain object from an AddSignedUrlKeyBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest} message AddSignedUrlKeyBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddSignedUrlKeyBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendService = ""; + object.signedUrlKeyResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.signedUrlKeyResource != null && message.hasOwnProperty("signedUrlKeyResource")) + object.signedUrlKeyResource = $root.google.cloud.compute.v1.SignedUrlKey.toObject(message.signedUrlKeyResource, options); + return object; + }; + + /** + * Converts this AddSignedUrlKeyBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + AddSignedUrlKeyBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddSignedUrlKeyBackendServiceRequest; + })(); + + v1.AggregatedListBackendServicesRequest = (function() { + + /** + * Properties of an AggregatedListBackendServicesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListBackendServicesRequest + * @property {string|null} [filter] AggregatedListBackendServicesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListBackendServicesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListBackendServicesRequest maxResults + * @property {string|null} [orderBy] AggregatedListBackendServicesRequest orderBy + * @property {string|null} [pageToken] AggregatedListBackendServicesRequest pageToken + * @property {string|null} [project] AggregatedListBackendServicesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListBackendServicesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListBackendServicesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListBackendServicesRequest. + * @implements IAggregatedListBackendServicesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListBackendServicesRequest=} [properties] Properties to set + */ + function AggregatedListBackendServicesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListBackendServicesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + AggregatedListBackendServicesRequest.prototype.filter = null; + + /** + * AggregatedListBackendServicesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + AggregatedListBackendServicesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListBackendServicesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + AggregatedListBackendServicesRequest.prototype.maxResults = null; + + /** + * AggregatedListBackendServicesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + AggregatedListBackendServicesRequest.prototype.orderBy = null; + + /** + * AggregatedListBackendServicesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + AggregatedListBackendServicesRequest.prototype.pageToken = null; + + /** + * AggregatedListBackendServicesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + AggregatedListBackendServicesRequest.prototype.project = ""; + + /** + * AggregatedListBackendServicesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + AggregatedListBackendServicesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListBackendServicesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + Object.defineProperty(AggregatedListBackendServicesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListBackendServicesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + Object.defineProperty(AggregatedListBackendServicesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListBackendServicesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + Object.defineProperty(AggregatedListBackendServicesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListBackendServicesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + Object.defineProperty(AggregatedListBackendServicesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListBackendServicesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + Object.defineProperty(AggregatedListBackendServicesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListBackendServicesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + */ + Object.defineProperty(AggregatedListBackendServicesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListBackendServicesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListBackendServicesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListBackendServicesRequest} AggregatedListBackendServicesRequest instance + */ + AggregatedListBackendServicesRequest.create = function create(properties) { + return new AggregatedListBackendServicesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListBackendServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListBackendServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListBackendServicesRequest} message AggregatedListBackendServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListBackendServicesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListBackendServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListBackendServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListBackendServicesRequest} message AggregatedListBackendServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListBackendServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListBackendServicesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListBackendServicesRequest} AggregatedListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListBackendServicesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListBackendServicesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListBackendServicesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListBackendServicesRequest} AggregatedListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListBackendServicesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListBackendServicesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListBackendServicesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListBackendServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListBackendServicesRequest} AggregatedListBackendServicesRequest + */ + AggregatedListBackendServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListBackendServicesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListBackendServicesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListBackendServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListBackendServicesRequest} message AggregatedListBackendServicesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListBackendServicesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListBackendServicesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListBackendServicesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListBackendServicesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListBackendServicesRequest; + })(); + + v1.DeleteBackendServiceRequest = (function() { + + /** + * Properties of a DeleteBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteBackendServiceRequest + * @property {string|null} [backendService] DeleteBackendServiceRequest backendService + * @property {string|null} [project] DeleteBackendServiceRequest project + * @property {string|null} [requestId] DeleteBackendServiceRequest requestId + */ + + /** + * Constructs a new DeleteBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteBackendServiceRequest. + * @implements IDeleteBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteBackendServiceRequest=} [properties] Properties to set + */ + function DeleteBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @instance + */ + DeleteBackendServiceRequest.prototype.backendService = ""; + + /** + * DeleteBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @instance + */ + DeleteBackendServiceRequest.prototype.project = ""; + + /** + * DeleteBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @instance + */ + DeleteBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @instance + */ + Object.defineProperty(DeleteBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteBackendServiceRequest} DeleteBackendServiceRequest instance + */ + DeleteBackendServiceRequest.create = function create(properties) { + return new DeleteBackendServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteBackendServiceRequest} message DeleteBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified DeleteBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteBackendServiceRequest} message DeleteBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteBackendServiceRequest} DeleteBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteBackendServiceRequest} DeleteBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteBackendServiceRequest} DeleteBackendServiceRequest + */ + DeleteBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.DeleteBackendServiceRequest} message DeleteBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendService = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + return object; + }; + + /** + * Converts this DeleteBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteBackendServiceRequest; + })(); + + v1.DeleteSignedUrlKeyBackendServiceRequest = (function() { + + /** + * Properties of a DeleteSignedUrlKeyBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteSignedUrlKeyBackendServiceRequest + * @property {string|null} [backendService] DeleteSignedUrlKeyBackendServiceRequest backendService + * @property {string|null} [keyName] DeleteSignedUrlKeyBackendServiceRequest keyName + * @property {string|null} [project] DeleteSignedUrlKeyBackendServiceRequest project + * @property {string|null} [requestId] DeleteSignedUrlKeyBackendServiceRequest requestId + */ + + /** + * Constructs a new DeleteSignedUrlKeyBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteSignedUrlKeyBackendServiceRequest. + * @implements IDeleteSignedUrlKeyBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest=} [properties] Properties to set + */ + function DeleteSignedUrlKeyBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSignedUrlKeyBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @instance + */ + DeleteSignedUrlKeyBackendServiceRequest.prototype.backendService = ""; + + /** + * DeleteSignedUrlKeyBackendServiceRequest keyName. + * @member {string} keyName + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @instance + */ + DeleteSignedUrlKeyBackendServiceRequest.prototype.keyName = ""; + + /** + * DeleteSignedUrlKeyBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @instance + */ + DeleteSignedUrlKeyBackendServiceRequest.prototype.project = ""; + + /** + * DeleteSignedUrlKeyBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @instance + */ + DeleteSignedUrlKeyBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteSignedUrlKeyBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @instance + */ + Object.defineProperty(DeleteSignedUrlKeyBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteSignedUrlKeyBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest} DeleteSignedUrlKeyBackendServiceRequest instance + */ + DeleteSignedUrlKeyBackendServiceRequest.create = function create(properties) { + return new DeleteSignedUrlKeyBackendServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest} message DeleteSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSignedUrlKeyBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.keyName != null && Object.hasOwnProperty.call(message, "keyName")) + writer.uint32(/* id 500938859, wireType 2 =*/4007510874).string(message.keyName); + return writer; + }; + + /** + * Encodes the specified DeleteSignedUrlKeyBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest} message DeleteSignedUrlKeyBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSignedUrlKeyBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSignedUrlKeyBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest} DeleteSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSignedUrlKeyBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 500938859: + message.keyName = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSignedUrlKeyBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest} DeleteSignedUrlKeyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSignedUrlKeyBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSignedUrlKeyBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSignedUrlKeyBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.keyName != null && message.hasOwnProperty("keyName")) + if (!$util.isString(message.keyName)) + return "keyName: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteSignedUrlKeyBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest} DeleteSignedUrlKeyBackendServiceRequest + */ + DeleteSignedUrlKeyBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.keyName != null) + message.keyName = String(object.keyName); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteSignedUrlKeyBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest} message DeleteSignedUrlKeyBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSignedUrlKeyBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendService = ""; + object.keyName = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.keyName != null && message.hasOwnProperty("keyName")) + object.keyName = message.keyName; + return object; + }; + + /** + * Converts this DeleteSignedUrlKeyBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSignedUrlKeyBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSignedUrlKeyBackendServiceRequest; + })(); + + v1.GetBackendServiceRequest = (function() { + + /** + * Properties of a GetBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetBackendServiceRequest + * @property {string|null} [backendService] GetBackendServiceRequest backendService + * @property {string|null} [project] GetBackendServiceRequest project + */ + + /** + * Constructs a new GetBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetBackendServiceRequest. + * @implements IGetBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetBackendServiceRequest=} [properties] Properties to set + */ + function GetBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @instance + */ + GetBackendServiceRequest.prototype.backendService = ""; + + /** + * GetBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @instance + */ + GetBackendServiceRequest.prototype.project = ""; + + /** + * Creates a new GetBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetBackendServiceRequest} GetBackendServiceRequest instance + */ + GetBackendServiceRequest.create = function create(properties) { + return new GetBackendServiceRequest(properties); + }; + + /** + * Encodes the specified GetBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetBackendServiceRequest} message GetBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified GetBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetBackendServiceRequest} message GetBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetBackendServiceRequest} GetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetBackendServiceRequest} GetBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetBackendServiceRequest} GetBackendServiceRequest + */ + GetBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.GetBackendServiceRequest} message GetBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendService = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + return object; + }; + + /** + * Converts this GetBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBackendServiceRequest; + })(); + + v1.GetHealthBackendServiceRequest = (function() { + + /** + * Properties of a GetHealthBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetHealthBackendServiceRequest + * @property {string|null} [backendService] GetHealthBackendServiceRequest backendService + * @property {string|null} [project] GetHealthBackendServiceRequest project + * @property {google.cloud.compute.v1.IResourceGroupReference|null} [resourceGroupReferenceResource] GetHealthBackendServiceRequest resourceGroupReferenceResource + */ + + /** + * Constructs a new GetHealthBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetHealthBackendServiceRequest. + * @implements IGetHealthBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetHealthBackendServiceRequest=} [properties] Properties to set + */ + function GetHealthBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetHealthBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @instance + */ + GetHealthBackendServiceRequest.prototype.backendService = ""; + + /** + * GetHealthBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @instance + */ + GetHealthBackendServiceRequest.prototype.project = ""; + + /** + * GetHealthBackendServiceRequest resourceGroupReferenceResource. + * @member {google.cloud.compute.v1.IResourceGroupReference|null|undefined} resourceGroupReferenceResource + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @instance + */ + GetHealthBackendServiceRequest.prototype.resourceGroupReferenceResource = null; + + /** + * Creates a new GetHealthBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetHealthBackendServiceRequest} GetHealthBackendServiceRequest instance + */ + GetHealthBackendServiceRequest.create = function create(properties) { + return new GetHealthBackendServiceRequest(properties); + }; + + /** + * Encodes the specified GetHealthBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthBackendServiceRequest} message GetHealthBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceGroupReferenceResource != null && Object.hasOwnProperty.call(message, "resourceGroupReferenceResource")) + $root.google.cloud.compute.v1.ResourceGroupReference.encode(message.resourceGroupReferenceResource, writer.uint32(/* id 112951123, wireType 2 =*/903608986).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified GetHealthBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthBackendServiceRequest} message GetHealthBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHealthBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetHealthBackendServiceRequest} GetHealthBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetHealthBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 112951123: + message.resourceGroupReferenceResource = $root.google.cloud.compute.v1.ResourceGroupReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetHealthBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetHealthBackendServiceRequest} GetHealthBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHealthBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHealthBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resourceGroupReferenceResource != null && message.hasOwnProperty("resourceGroupReferenceResource")) { + var error = $root.google.cloud.compute.v1.ResourceGroupReference.verify(message.resourceGroupReferenceResource); + if (error) + return "resourceGroupReferenceResource." + error; + } + return null; + }; + + /** + * Creates a GetHealthBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetHealthBackendServiceRequest} GetHealthBackendServiceRequest + */ + GetHealthBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetHealthBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetHealthBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + if (object.resourceGroupReferenceResource != null) { + if (typeof object.resourceGroupReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.GetHealthBackendServiceRequest.resourceGroupReferenceResource: object expected"); + message.resourceGroupReferenceResource = $root.google.cloud.compute.v1.ResourceGroupReference.fromObject(object.resourceGroupReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a GetHealthBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.GetHealthBackendServiceRequest} message GetHealthBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHealthBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceGroupReferenceResource = null; + object.project = ""; + object.backendService = ""; + } + if (message.resourceGroupReferenceResource != null && message.hasOwnProperty("resourceGroupReferenceResource")) + object.resourceGroupReferenceResource = $root.google.cloud.compute.v1.ResourceGroupReference.toObject(message.resourceGroupReferenceResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + return object; + }; + + /** + * Converts this GetHealthBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetHealthBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetHealthBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetHealthBackendServiceRequest; + })(); + + v1.InsertBackendServiceRequest = (function() { + + /** + * Properties of an InsertBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertBackendServiceRequest + * @property {google.cloud.compute.v1.IBackendService|null} [backendServiceResource] InsertBackendServiceRequest backendServiceResource + * @property {string|null} [project] InsertBackendServiceRequest project + * @property {string|null} [requestId] InsertBackendServiceRequest requestId + */ + + /** + * Constructs a new InsertBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertBackendServiceRequest. + * @implements IInsertBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertBackendServiceRequest=} [properties] Properties to set + */ + function InsertBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertBackendServiceRequest backendServiceResource. + * @member {google.cloud.compute.v1.IBackendService|null|undefined} backendServiceResource + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @instance + */ + InsertBackendServiceRequest.prototype.backendServiceResource = null; + + /** + * InsertBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @instance + */ + InsertBackendServiceRequest.prototype.project = ""; + + /** + * InsertBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @instance + */ + InsertBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @instance + */ + Object.defineProperty(InsertBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertBackendServiceRequest} InsertBackendServiceRequest instance + */ + InsertBackendServiceRequest.create = function create(properties) { + return new InsertBackendServiceRequest(properties); + }; + + /** + * Encodes the specified InsertBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertBackendServiceRequest} message InsertBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendServiceResource != null && Object.hasOwnProperty.call(message, "backendServiceResource")) + $root.google.cloud.compute.v1.BackendService.encode(message.backendServiceResource, writer.uint32(/* id 347586723, wireType 2 =*/2780693786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertBackendServiceRequest} message InsertBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertBackendServiceRequest} InsertBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 347586723: + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertBackendServiceRequest} InsertBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.backendServiceResource); + if (error) + return "backendServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertBackendServiceRequest} InsertBackendServiceRequest + */ + InsertBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertBackendServiceRequest(); + if (object.backendServiceResource != null) { + if (typeof object.backendServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertBackendServiceRequest.backendServiceResource: object expected"); + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.fromObject(object.backendServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.InsertBackendServiceRequest} message InsertBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) + object.backendServiceResource = $root.google.cloud.compute.v1.BackendService.toObject(message.backendServiceResource, options); + return object; + }; + + /** + * Converts this InsertBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + InsertBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertBackendServiceRequest; + })(); + + v1.ListBackendServicesRequest = (function() { + + /** + * Properties of a ListBackendServicesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListBackendServicesRequest + * @property {string|null} [filter] ListBackendServicesRequest filter + * @property {number|null} [maxResults] ListBackendServicesRequest maxResults + * @property {string|null} [orderBy] ListBackendServicesRequest orderBy + * @property {string|null} [pageToken] ListBackendServicesRequest pageToken + * @property {string|null} [project] ListBackendServicesRequest project + * @property {boolean|null} [returnPartialSuccess] ListBackendServicesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListBackendServicesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListBackendServicesRequest. + * @implements IListBackendServicesRequest + * @constructor + * @param {google.cloud.compute.v1.IListBackendServicesRequest=} [properties] Properties to set + */ + function ListBackendServicesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackendServicesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + ListBackendServicesRequest.prototype.filter = null; + + /** + * ListBackendServicesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + ListBackendServicesRequest.prototype.maxResults = null; + + /** + * ListBackendServicesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + ListBackendServicesRequest.prototype.orderBy = null; + + /** + * ListBackendServicesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + ListBackendServicesRequest.prototype.pageToken = null; + + /** + * ListBackendServicesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + ListBackendServicesRequest.prototype.project = ""; + + /** + * ListBackendServicesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + ListBackendServicesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListBackendServicesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + Object.defineProperty(ListBackendServicesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendServicesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + Object.defineProperty(ListBackendServicesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendServicesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + Object.defineProperty(ListBackendServicesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendServicesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + Object.defineProperty(ListBackendServicesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListBackendServicesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + */ + Object.defineProperty(ListBackendServicesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListBackendServicesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IListBackendServicesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListBackendServicesRequest} ListBackendServicesRequest instance + */ + ListBackendServicesRequest.create = function create(properties) { + return new ListBackendServicesRequest(properties); + }; + + /** + * Encodes the specified ListBackendServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListBackendServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IListBackendServicesRequest} message ListBackendServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendServicesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListBackendServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListBackendServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IListBackendServicesRequest} message ListBackendServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackendServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackendServicesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListBackendServicesRequest} ListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendServicesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListBackendServicesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackendServicesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListBackendServicesRequest} ListBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackendServicesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackendServicesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackendServicesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListBackendServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListBackendServicesRequest} ListBackendServicesRequest + */ + ListBackendServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListBackendServicesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListBackendServicesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListBackendServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.ListBackendServicesRequest} message ListBackendServicesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackendServicesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListBackendServicesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListBackendServicesRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackendServicesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBackendServicesRequest; + })(); + + v1.PatchBackendServiceRequest = (function() { + + /** + * Properties of a PatchBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchBackendServiceRequest + * @property {string|null} [backendService] PatchBackendServiceRequest backendService + * @property {google.cloud.compute.v1.IBackendService|null} [backendServiceResource] PatchBackendServiceRequest backendServiceResource + * @property {string|null} [project] PatchBackendServiceRequest project + * @property {string|null} [requestId] PatchBackendServiceRequest requestId + */ + + /** + * Constructs a new PatchBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchBackendServiceRequest. + * @implements IPatchBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchBackendServiceRequest=} [properties] Properties to set + */ + function PatchBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @instance + */ + PatchBackendServiceRequest.prototype.backendService = ""; + + /** + * PatchBackendServiceRequest backendServiceResource. + * @member {google.cloud.compute.v1.IBackendService|null|undefined} backendServiceResource + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @instance + */ + PatchBackendServiceRequest.prototype.backendServiceResource = null; + + /** + * PatchBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @instance + */ + PatchBackendServiceRequest.prototype.project = ""; + + /** + * PatchBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @instance + */ + PatchBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @instance + */ + Object.defineProperty(PatchBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchBackendServiceRequest} PatchBackendServiceRequest instance + */ + PatchBackendServiceRequest.create = function create(properties) { + return new PatchBackendServiceRequest(properties); + }; + + /** + * Encodes the specified PatchBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchBackendServiceRequest} message PatchBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.backendServiceResource != null && Object.hasOwnProperty.call(message, "backendServiceResource")) + $root.google.cloud.compute.v1.BackendService.encode(message.backendServiceResource, writer.uint32(/* id 347586723, wireType 2 =*/2780693786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchBackendServiceRequest} message PatchBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchBackendServiceRequest} PatchBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 347586723: + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchBackendServiceRequest} PatchBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.backendServiceResource); + if (error) + return "backendServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchBackendServiceRequest} PatchBackendServiceRequest + */ + PatchBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.backendServiceResource != null) { + if (typeof object.backendServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchBackendServiceRequest.backendServiceResource: object expected"); + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.fromObject(object.backendServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.PatchBackendServiceRequest} message PatchBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendService = ""; + object.backendServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) + object.backendServiceResource = $root.google.cloud.compute.v1.BackendService.toObject(message.backendServiceResource, options); + return object; + }; + + /** + * Converts this PatchBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + PatchBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchBackendServiceRequest; + })(); + + v1.SetSecurityPolicyBackendServiceRequest = (function() { + + /** + * Properties of a SetSecurityPolicyBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetSecurityPolicyBackendServiceRequest + * @property {string|null} [backendService] SetSecurityPolicyBackendServiceRequest backendService + * @property {string|null} [project] SetSecurityPolicyBackendServiceRequest project + * @property {string|null} [requestId] SetSecurityPolicyBackendServiceRequest requestId + * @property {google.cloud.compute.v1.ISecurityPolicyReference|null} [securityPolicyReferenceResource] SetSecurityPolicyBackendServiceRequest securityPolicyReferenceResource + */ + + /** + * Constructs a new SetSecurityPolicyBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetSecurityPolicyBackendServiceRequest. + * @implements ISetSecurityPolicyBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest=} [properties] Properties to set + */ + function SetSecurityPolicyBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetSecurityPolicyBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @instance + */ + SetSecurityPolicyBackendServiceRequest.prototype.backendService = ""; + + /** + * SetSecurityPolicyBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @instance + */ + SetSecurityPolicyBackendServiceRequest.prototype.project = ""; + + /** + * SetSecurityPolicyBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @instance + */ + SetSecurityPolicyBackendServiceRequest.prototype.requestId = null; + + /** + * SetSecurityPolicyBackendServiceRequest securityPolicyReferenceResource. + * @member {google.cloud.compute.v1.ISecurityPolicyReference|null|undefined} securityPolicyReferenceResource + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @instance + */ + SetSecurityPolicyBackendServiceRequest.prototype.securityPolicyReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetSecurityPolicyBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @instance + */ + Object.defineProperty(SetSecurityPolicyBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetSecurityPolicyBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest} SetSecurityPolicyBackendServiceRequest instance + */ + SetSecurityPolicyBackendServiceRequest.create = function create(properties) { + return new SetSecurityPolicyBackendServiceRequest(properties); + }; + + /** + * Encodes the specified SetSecurityPolicyBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest} message SetSecurityPolicyBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSecurityPolicyBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.securityPolicyReferenceResource != null && Object.hasOwnProperty.call(message, "securityPolicyReferenceResource")) + $root.google.cloud.compute.v1.SecurityPolicyReference.encode(message.securityPolicyReferenceResource, writer.uint32(/* id 204135024, wireType 2 =*/1633080194).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified SetSecurityPolicyBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest} message SetSecurityPolicyBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSecurityPolicyBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetSecurityPolicyBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest} SetSecurityPolicyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSecurityPolicyBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 204135024: + message.securityPolicyReferenceResource = $root.google.cloud.compute.v1.SecurityPolicyReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetSecurityPolicyBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest} SetSecurityPolicyBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSecurityPolicyBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetSecurityPolicyBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetSecurityPolicyBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.securityPolicyReferenceResource != null && message.hasOwnProperty("securityPolicyReferenceResource")) { + var error = $root.google.cloud.compute.v1.SecurityPolicyReference.verify(message.securityPolicyReferenceResource); + if (error) + return "securityPolicyReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetSecurityPolicyBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest} SetSecurityPolicyBackendServiceRequest + */ + SetSecurityPolicyBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.securityPolicyReferenceResource != null) { + if (typeof object.securityPolicyReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest.securityPolicyReferenceResource: object expected"); + message.securityPolicyReferenceResource = $root.google.cloud.compute.v1.SecurityPolicyReference.fromObject(object.securityPolicyReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetSecurityPolicyBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest} message SetSecurityPolicyBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetSecurityPolicyBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicyReferenceResource = null; + object.project = ""; + object.backendService = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.securityPolicyReferenceResource != null && message.hasOwnProperty("securityPolicyReferenceResource")) + object.securityPolicyReferenceResource = $root.google.cloud.compute.v1.SecurityPolicyReference.toObject(message.securityPolicyReferenceResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + return object; + }; + + /** + * Converts this SetSecurityPolicyBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + SetSecurityPolicyBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetSecurityPolicyBackendServiceRequest; + })(); + + v1.UpdateBackendServiceRequest = (function() { + + /** + * Properties of an UpdateBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateBackendServiceRequest + * @property {string|null} [backendService] UpdateBackendServiceRequest backendService + * @property {google.cloud.compute.v1.IBackendService|null} [backendServiceResource] UpdateBackendServiceRequest backendServiceResource + * @property {string|null} [project] UpdateBackendServiceRequest project + * @property {string|null} [requestId] UpdateBackendServiceRequest requestId + */ + + /** + * Constructs a new UpdateBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateBackendServiceRequest. + * @implements IUpdateBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateBackendServiceRequest=} [properties] Properties to set + */ + function UpdateBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @instance + */ + UpdateBackendServiceRequest.prototype.backendService = ""; + + /** + * UpdateBackendServiceRequest backendServiceResource. + * @member {google.cloud.compute.v1.IBackendService|null|undefined} backendServiceResource + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @instance + */ + UpdateBackendServiceRequest.prototype.backendServiceResource = null; + + /** + * UpdateBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @instance + */ + UpdateBackendServiceRequest.prototype.project = ""; + + /** + * UpdateBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @instance + */ + UpdateBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @instance + */ + Object.defineProperty(UpdateBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateBackendServiceRequest} UpdateBackendServiceRequest instance + */ + UpdateBackendServiceRequest.create = function create(properties) { + return new UpdateBackendServiceRequest(properties); + }; + + /** + * Encodes the specified UpdateBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateBackendServiceRequest} message UpdateBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.backendServiceResource != null && Object.hasOwnProperty.call(message, "backendServiceResource")) + $root.google.cloud.compute.v1.BackendService.encode(message.backendServiceResource, writer.uint32(/* id 347586723, wireType 2 =*/2780693786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateBackendServiceRequest} message UpdateBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateBackendServiceRequest} UpdateBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 347586723: + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateBackendServiceRequest} UpdateBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.backendServiceResource); + if (error) + return "backendServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdateBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateBackendServiceRequest} UpdateBackendServiceRequest + */ + UpdateBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.backendServiceResource != null) { + if (typeof object.backendServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateBackendServiceRequest.backendServiceResource: object expected"); + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.fromObject(object.backendServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.UpdateBackendServiceRequest} message UpdateBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.backendService = ""; + object.backendServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) + object.backendServiceResource = $root.google.cloud.compute.v1.BackendService.toObject(message.backendServiceResource, options); + return object; + }; + + /** + * Converts this UpdateBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateBackendServiceRequest; + })(); + + v1.AggregatedListDiskTypesRequest = (function() { + + /** + * Properties of an AggregatedListDiskTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListDiskTypesRequest + * @property {string|null} [filter] AggregatedListDiskTypesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListDiskTypesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListDiskTypesRequest maxResults + * @property {string|null} [orderBy] AggregatedListDiskTypesRequest orderBy + * @property {string|null} [pageToken] AggregatedListDiskTypesRequest pageToken + * @property {string|null} [project] AggregatedListDiskTypesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListDiskTypesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListDiskTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListDiskTypesRequest. + * @implements IAggregatedListDiskTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListDiskTypesRequest=} [properties] Properties to set + */ + function AggregatedListDiskTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListDiskTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + AggregatedListDiskTypesRequest.prototype.filter = null; + + /** + * AggregatedListDiskTypesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + AggregatedListDiskTypesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListDiskTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + AggregatedListDiskTypesRequest.prototype.maxResults = null; + + /** + * AggregatedListDiskTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + AggregatedListDiskTypesRequest.prototype.orderBy = null; + + /** + * AggregatedListDiskTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + AggregatedListDiskTypesRequest.prototype.pageToken = null; + + /** + * AggregatedListDiskTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + AggregatedListDiskTypesRequest.prototype.project = ""; + + /** + * AggregatedListDiskTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + AggregatedListDiskTypesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListDiskTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListDiskTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDiskTypesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListDiskTypesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDiskTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListDiskTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDiskTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListDiskTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDiskTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListDiskTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDiskTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListDiskTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListDiskTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListDiskTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListDiskTypesRequest} AggregatedListDiskTypesRequest instance + */ + AggregatedListDiskTypesRequest.create = function create(properties) { + return new AggregatedListDiskTypesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListDiskTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDiskTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListDiskTypesRequest} message AggregatedListDiskTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListDiskTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListDiskTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDiskTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListDiskTypesRequest} message AggregatedListDiskTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListDiskTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListDiskTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListDiskTypesRequest} AggregatedListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListDiskTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListDiskTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListDiskTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListDiskTypesRequest} AggregatedListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListDiskTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListDiskTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListDiskTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListDiskTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListDiskTypesRequest} AggregatedListDiskTypesRequest + */ + AggregatedListDiskTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListDiskTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListDiskTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListDiskTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListDiskTypesRequest} message AggregatedListDiskTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListDiskTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListDiskTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListDiskTypesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListDiskTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListDiskTypesRequest; + })(); + + v1.GetDiskTypeRequest = (function() { + + /** + * Properties of a GetDiskTypeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetDiskTypeRequest + * @property {string|null} [diskType] GetDiskTypeRequest diskType + * @property {string|null} [project] GetDiskTypeRequest project + * @property {string|null} [zone] GetDiskTypeRequest zone + */ + + /** + * Constructs a new GetDiskTypeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetDiskTypeRequest. + * @implements IGetDiskTypeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetDiskTypeRequest=} [properties] Properties to set + */ + function GetDiskTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDiskTypeRequest diskType. + * @member {string} diskType + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @instance + */ + GetDiskTypeRequest.prototype.diskType = ""; + + /** + * GetDiskTypeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @instance + */ + GetDiskTypeRequest.prototype.project = ""; + + /** + * GetDiskTypeRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @instance + */ + GetDiskTypeRequest.prototype.zone = ""; + + /** + * Creates a new GetDiskTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetDiskTypeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetDiskTypeRequest} GetDiskTypeRequest instance + */ + GetDiskTypeRequest.create = function create(properties) { + return new GetDiskTypeRequest(properties); + }; + + /** + * Encodes the specified GetDiskTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetDiskTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetDiskTypeRequest} message GetDiskTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDiskTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 93009052, wireType 2 =*/744072418).string(message.diskType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetDiskTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetDiskTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetDiskTypeRequest} message GetDiskTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDiskTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDiskTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetDiskTypeRequest} GetDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDiskTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetDiskTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 93009052: + message.diskType = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDiskTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetDiskTypeRequest} GetDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDiskTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDiskTypeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDiskTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.diskType != null && message.hasOwnProperty("diskType")) + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetDiskTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetDiskTypeRequest} GetDiskTypeRequest + */ + GetDiskTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetDiskTypeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetDiskTypeRequest(); + if (object.diskType != null) + message.diskType = String(object.diskType); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetDiskTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.GetDiskTypeRequest} message GetDiskTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDiskTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.diskType = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.diskType != null && message.hasOwnProperty("diskType")) + object.diskType = message.diskType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetDiskTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetDiskTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetDiskTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDiskTypeRequest; + })(); + + v1.ListDiskTypesRequest = (function() { + + /** + * Properties of a ListDiskTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListDiskTypesRequest + * @property {string|null} [filter] ListDiskTypesRequest filter + * @property {number|null} [maxResults] ListDiskTypesRequest maxResults + * @property {string|null} [orderBy] ListDiskTypesRequest orderBy + * @property {string|null} [pageToken] ListDiskTypesRequest pageToken + * @property {string|null} [project] ListDiskTypesRequest project + * @property {boolean|null} [returnPartialSuccess] ListDiskTypesRequest returnPartialSuccess + * @property {string|null} [zone] ListDiskTypesRequest zone + */ + + /** + * Constructs a new ListDiskTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListDiskTypesRequest. + * @implements IListDiskTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IListDiskTypesRequest=} [properties] Properties to set + */ + function ListDiskTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDiskTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + ListDiskTypesRequest.prototype.filter = null; + + /** + * ListDiskTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + ListDiskTypesRequest.prototype.maxResults = null; + + /** + * ListDiskTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + ListDiskTypesRequest.prototype.orderBy = null; + + /** + * ListDiskTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + ListDiskTypesRequest.prototype.pageToken = null; + + /** + * ListDiskTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + ListDiskTypesRequest.prototype.project = ""; + + /** + * ListDiskTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + ListDiskTypesRequest.prototype.returnPartialSuccess = null; + + /** + * ListDiskTypesRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + ListDiskTypesRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListDiskTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + Object.defineProperty(ListDiskTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDiskTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + Object.defineProperty(ListDiskTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDiskTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + Object.defineProperty(ListDiskTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDiskTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + Object.defineProperty(ListDiskTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDiskTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + */ + Object.defineProperty(ListDiskTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListDiskTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IListDiskTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListDiskTypesRequest} ListDiskTypesRequest instance + */ + ListDiskTypesRequest.create = function create(properties) { + return new ListDiskTypesRequest(properties); + }; + + /** + * Encodes the specified ListDiskTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListDiskTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IListDiskTypesRequest} message ListDiskTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDiskTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListDiskTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListDiskTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IListDiskTypesRequest} message ListDiskTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDiskTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDiskTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListDiskTypesRequest} ListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDiskTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListDiskTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDiskTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListDiskTypesRequest} ListDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDiskTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDiskTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDiskTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListDiskTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListDiskTypesRequest} ListDiskTypesRequest + */ + ListDiskTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListDiskTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListDiskTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListDiskTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.ListDiskTypesRequest} message ListDiskTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDiskTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListDiskTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListDiskTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDiskTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDiskTypesRequest; + })(); + + v1.AddResourcePoliciesDiskRequest = (function() { + + /** + * Properties of an AddResourcePoliciesDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddResourcePoliciesDiskRequest + * @property {string|null} [disk] AddResourcePoliciesDiskRequest disk + * @property {google.cloud.compute.v1.IDisksAddResourcePoliciesRequest|null} [disksAddResourcePoliciesRequestResource] AddResourcePoliciesDiskRequest disksAddResourcePoliciesRequestResource + * @property {string|null} [project] AddResourcePoliciesDiskRequest project + * @property {string|null} [requestId] AddResourcePoliciesDiskRequest requestId + * @property {string|null} [zone] AddResourcePoliciesDiskRequest zone + */ + + /** + * Constructs a new AddResourcePoliciesDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddResourcePoliciesDiskRequest. + * @implements IAddResourcePoliciesDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IAddResourcePoliciesDiskRequest=} [properties] Properties to set + */ + function AddResourcePoliciesDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddResourcePoliciesDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @instance + */ + AddResourcePoliciesDiskRequest.prototype.disk = ""; + + /** + * AddResourcePoliciesDiskRequest disksAddResourcePoliciesRequestResource. + * @member {google.cloud.compute.v1.IDisksAddResourcePoliciesRequest|null|undefined} disksAddResourcePoliciesRequestResource + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @instance + */ + AddResourcePoliciesDiskRequest.prototype.disksAddResourcePoliciesRequestResource = null; + + /** + * AddResourcePoliciesDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @instance + */ + AddResourcePoliciesDiskRequest.prototype.project = ""; + + /** + * AddResourcePoliciesDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @instance + */ + AddResourcePoliciesDiskRequest.prototype.requestId = null; + + /** + * AddResourcePoliciesDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @instance + */ + AddResourcePoliciesDiskRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddResourcePoliciesDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @instance + */ + Object.defineProperty(AddResourcePoliciesDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddResourcePoliciesDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddResourcePoliciesDiskRequest} AddResourcePoliciesDiskRequest instance + */ + AddResourcePoliciesDiskRequest.create = function create(properties) { + return new AddResourcePoliciesDiskRequest(properties); + }; + + /** + * Encodes the specified AddResourcePoliciesDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesDiskRequest} message AddResourcePoliciesDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddResourcePoliciesDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.disksAddResourcePoliciesRequestResource != null && Object.hasOwnProperty.call(message, "disksAddResourcePoliciesRequestResource")) + $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest.encode(message.disksAddResourcePoliciesRequestResource, writer.uint32(/* id 496483363, wireType 2 =*/3971866906).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddResourcePoliciesDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesDiskRequest} message AddResourcePoliciesDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddResourcePoliciesDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddResourcePoliciesDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddResourcePoliciesDiskRequest} AddResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddResourcePoliciesDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddResourcePoliciesDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 496483363: + message.disksAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddResourcePoliciesDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddResourcePoliciesDiskRequest} AddResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddResourcePoliciesDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddResourcePoliciesDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddResourcePoliciesDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.disksAddResourcePoliciesRequestResource != null && message.hasOwnProperty("disksAddResourcePoliciesRequestResource")) { + var error = $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest.verify(message.disksAddResourcePoliciesRequestResource); + if (error) + return "disksAddResourcePoliciesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AddResourcePoliciesDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddResourcePoliciesDiskRequest} AddResourcePoliciesDiskRequest + */ + AddResourcePoliciesDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddResourcePoliciesDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddResourcePoliciesDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.disksAddResourcePoliciesRequestResource != null) { + if (typeof object.disksAddResourcePoliciesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddResourcePoliciesDiskRequest.disksAddResourcePoliciesRequestResource: object expected"); + message.disksAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest.fromObject(object.disksAddResourcePoliciesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AddResourcePoliciesDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.AddResourcePoliciesDiskRequest} message AddResourcePoliciesDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddResourcePoliciesDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.zone = ""; + object.project = ""; + object.disksAddResourcePoliciesRequestResource = null; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.disksAddResourcePoliciesRequestResource != null && message.hasOwnProperty("disksAddResourcePoliciesRequestResource")) + object.disksAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.DisksAddResourcePoliciesRequest.toObject(message.disksAddResourcePoliciesRequestResource, options); + return object; + }; + + /** + * Converts this AddResourcePoliciesDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddResourcePoliciesDiskRequest + * @instance + * @returns {Object.} JSON object + */ + AddResourcePoliciesDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddResourcePoliciesDiskRequest; + })(); + + v1.AggregatedListDisksRequest = (function() { + + /** + * Properties of an AggregatedListDisksRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListDisksRequest + * @property {string|null} [filter] AggregatedListDisksRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListDisksRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListDisksRequest maxResults + * @property {string|null} [orderBy] AggregatedListDisksRequest orderBy + * @property {string|null} [pageToken] AggregatedListDisksRequest pageToken + * @property {string|null} [project] AggregatedListDisksRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListDisksRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListDisksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListDisksRequest. + * @implements IAggregatedListDisksRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListDisksRequest=} [properties] Properties to set + */ + function AggregatedListDisksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListDisksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + AggregatedListDisksRequest.prototype.filter = null; + + /** + * AggregatedListDisksRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + AggregatedListDisksRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListDisksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + AggregatedListDisksRequest.prototype.maxResults = null; + + /** + * AggregatedListDisksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + AggregatedListDisksRequest.prototype.orderBy = null; + + /** + * AggregatedListDisksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + AggregatedListDisksRequest.prototype.pageToken = null; + + /** + * AggregatedListDisksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + AggregatedListDisksRequest.prototype.project = ""; + + /** + * AggregatedListDisksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + AggregatedListDisksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListDisksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + Object.defineProperty(AggregatedListDisksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDisksRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + Object.defineProperty(AggregatedListDisksRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDisksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + Object.defineProperty(AggregatedListDisksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDisksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + Object.defineProperty(AggregatedListDisksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDisksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + Object.defineProperty(AggregatedListDisksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListDisksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + */ + Object.defineProperty(AggregatedListDisksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListDisksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListDisksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListDisksRequest} AggregatedListDisksRequest instance + */ + AggregatedListDisksRequest.create = function create(properties) { + return new AggregatedListDisksRequest(properties); + }; + + /** + * Encodes the specified AggregatedListDisksRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDisksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListDisksRequest} message AggregatedListDisksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListDisksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListDisksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListDisksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListDisksRequest} message AggregatedListDisksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListDisksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListDisksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListDisksRequest} AggregatedListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListDisksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListDisksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListDisksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListDisksRequest} AggregatedListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListDisksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListDisksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListDisksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListDisksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListDisksRequest} AggregatedListDisksRequest + */ + AggregatedListDisksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListDisksRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListDisksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListDisksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListDisksRequest} message AggregatedListDisksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListDisksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListDisksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListDisksRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListDisksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListDisksRequest; + })(); + + v1.CreateSnapshotDiskRequest = (function() { + + /** + * Properties of a CreateSnapshotDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ICreateSnapshotDiskRequest + * @property {string|null} [disk] CreateSnapshotDiskRequest disk + * @property {boolean|null} [guestFlush] CreateSnapshotDiskRequest guestFlush + * @property {string|null} [project] CreateSnapshotDiskRequest project + * @property {string|null} [requestId] CreateSnapshotDiskRequest requestId + * @property {google.cloud.compute.v1.ISnapshot|null} [snapshotResource] CreateSnapshotDiskRequest snapshotResource + * @property {string|null} [zone] CreateSnapshotDiskRequest zone + */ + + /** + * Constructs a new CreateSnapshotDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CreateSnapshotDiskRequest. + * @implements ICreateSnapshotDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ICreateSnapshotDiskRequest=} [properties] Properties to set + */ + function CreateSnapshotDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSnapshotDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + CreateSnapshotDiskRequest.prototype.disk = ""; + + /** + * CreateSnapshotDiskRequest guestFlush. + * @member {boolean|null|undefined} guestFlush + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + CreateSnapshotDiskRequest.prototype.guestFlush = null; + + /** + * CreateSnapshotDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + CreateSnapshotDiskRequest.prototype.project = ""; + + /** + * CreateSnapshotDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + CreateSnapshotDiskRequest.prototype.requestId = null; + + /** + * CreateSnapshotDiskRequest snapshotResource. + * @member {google.cloud.compute.v1.ISnapshot|null|undefined} snapshotResource + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + CreateSnapshotDiskRequest.prototype.snapshotResource = null; + + /** + * CreateSnapshotDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + CreateSnapshotDiskRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateSnapshotDiskRequest _guestFlush. + * @member {"guestFlush"|undefined} _guestFlush + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + Object.defineProperty(CreateSnapshotDiskRequest.prototype, "_guestFlush", { + get: $util.oneOfGetter($oneOfFields = ["guestFlush"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CreateSnapshotDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + */ + Object.defineProperty(CreateSnapshotDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateSnapshotDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {google.cloud.compute.v1.ICreateSnapshotDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CreateSnapshotDiskRequest} CreateSnapshotDiskRequest instance + */ + CreateSnapshotDiskRequest.create = function create(properties) { + return new CreateSnapshotDiskRequest(properties); + }; + + /** + * Encodes the specified CreateSnapshotDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {google.cloud.compute.v1.ICreateSnapshotDiskRequest} message CreateSnapshotDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.guestFlush != null && Object.hasOwnProperty.call(message, "guestFlush")) + writer.uint32(/* id 385550813, wireType 0 =*/3084406504).bool(message.guestFlush); + if (message.snapshotResource != null && Object.hasOwnProperty.call(message, "snapshotResource")) + $root.google.cloud.compute.v1.Snapshot.encode(message.snapshotResource, writer.uint32(/* id 481319977, wireType 2 =*/3850559818).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSnapshotDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {google.cloud.compute.v1.ICreateSnapshotDiskRequest} message CreateSnapshotDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSnapshotDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CreateSnapshotDiskRequest} CreateSnapshotDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CreateSnapshotDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 385550813: + message.guestFlush = reader.bool(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 481319977: + message.snapshotResource = $root.google.cloud.compute.v1.Snapshot.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSnapshotDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CreateSnapshotDiskRequest} CreateSnapshotDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSnapshotDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSnapshotDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.guestFlush != null && message.hasOwnProperty("guestFlush")) { + properties._guestFlush = 1; + if (typeof message.guestFlush !== "boolean") + return "guestFlush: boolean expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.snapshotResource != null && message.hasOwnProperty("snapshotResource")) { + var error = $root.google.cloud.compute.v1.Snapshot.verify(message.snapshotResource); + if (error) + return "snapshotResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a CreateSnapshotDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CreateSnapshotDiskRequest} CreateSnapshotDiskRequest + */ + CreateSnapshotDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CreateSnapshotDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.CreateSnapshotDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.guestFlush != null) + message.guestFlush = Boolean(object.guestFlush); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.snapshotResource != null) { + if (typeof object.snapshotResource !== "object") + throw TypeError(".google.cloud.compute.v1.CreateSnapshotDiskRequest.snapshotResource: object expected"); + message.snapshotResource = $root.google.cloud.compute.v1.Snapshot.fromObject(object.snapshotResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a CreateSnapshotDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @static + * @param {google.cloud.compute.v1.CreateSnapshotDiskRequest} message CreateSnapshotDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSnapshotDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.zone = ""; + object.project = ""; + object.snapshotResource = null; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.guestFlush != null && message.hasOwnProperty("guestFlush")) { + object.guestFlush = message.guestFlush; + if (options.oneofs) + object._guestFlush = "guestFlush"; + } + if (message.snapshotResource != null && message.hasOwnProperty("snapshotResource")) + object.snapshotResource = $root.google.cloud.compute.v1.Snapshot.toObject(message.snapshotResource, options); + return object; + }; + + /** + * Converts this CreateSnapshotDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CreateSnapshotDiskRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSnapshotDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSnapshotDiskRequest; + })(); + + v1.DeleteDiskRequest = (function() { + + /** + * Properties of a DeleteDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteDiskRequest + * @property {string|null} [disk] DeleteDiskRequest disk + * @property {string|null} [project] DeleteDiskRequest project + * @property {string|null} [requestId] DeleteDiskRequest requestId + * @property {string|null} [zone] DeleteDiskRequest zone + */ + + /** + * Constructs a new DeleteDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteDiskRequest. + * @implements IDeleteDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteDiskRequest=} [properties] Properties to set + */ + function DeleteDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @instance + */ + DeleteDiskRequest.prototype.disk = ""; + + /** + * DeleteDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @instance + */ + DeleteDiskRequest.prototype.project = ""; + + /** + * DeleteDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @instance + */ + DeleteDiskRequest.prototype.requestId = null; + + /** + * DeleteDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @instance + */ + DeleteDiskRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @instance + */ + Object.defineProperty(DeleteDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {google.cloud.compute.v1.IDeleteDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteDiskRequest} DeleteDiskRequest instance + */ + DeleteDiskRequest.create = function create(properties) { + return new DeleteDiskRequest(properties); + }; + + /** + * Encodes the specified DeleteDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {google.cloud.compute.v1.IDeleteDiskRequest} message DeleteDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {google.cloud.compute.v1.IDeleteDiskRequest} message DeleteDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteDiskRequest} DeleteDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteDiskRequest} DeleteDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteDiskRequest} DeleteDiskRequest + */ + DeleteDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @static + * @param {google.cloud.compute.v1.DeleteDiskRequest} message DeleteDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.zone = ""; + object.project = ""; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteDiskRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteDiskRequest; + })(); + + v1.GetDiskRequest = (function() { + + /** + * Properties of a GetDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetDiskRequest + * @property {string|null} [disk] GetDiskRequest disk + * @property {string|null} [project] GetDiskRequest project + * @property {string|null} [zone] GetDiskRequest zone + */ + + /** + * Constructs a new GetDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetDiskRequest. + * @implements IGetDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IGetDiskRequest=} [properties] Properties to set + */ + function GetDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.GetDiskRequest + * @instance + */ + GetDiskRequest.prototype.disk = ""; + + /** + * GetDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetDiskRequest + * @instance + */ + GetDiskRequest.prototype.project = ""; + + /** + * GetDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetDiskRequest + * @instance + */ + GetDiskRequest.prototype.zone = ""; + + /** + * Creates a new GetDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetDiskRequest} GetDiskRequest instance + */ + GetDiskRequest.create = function create(properties) { + return new GetDiskRequest(properties); + }; + + /** + * Encodes the specified GetDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetDiskRequest} message GetDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetDiskRequest} message GetDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetDiskRequest} GetDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetDiskRequest} GetDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetDiskRequest} GetDiskRequest + */ + GetDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetDiskRequest + * @static + * @param {google.cloud.compute.v1.GetDiskRequest} message GetDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.zone = ""; + object.project = ""; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetDiskRequest + * @instance + * @returns {Object.} JSON object + */ + GetDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDiskRequest; + })(); + + v1.GetIamPolicyDiskRequest = (function() { + + /** + * Properties of a GetIamPolicyDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyDiskRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyDiskRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyDiskRequest project + * @property {string|null} [resource] GetIamPolicyDiskRequest resource + * @property {string|null} [zone] GetIamPolicyDiskRequest zone + */ + + /** + * Constructs a new GetIamPolicyDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyDiskRequest. + * @implements IGetIamPolicyDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyDiskRequest=} [properties] Properties to set + */ + function GetIamPolicyDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyDiskRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @instance + */ + GetIamPolicyDiskRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @instance + */ + GetIamPolicyDiskRequest.prototype.project = ""; + + /** + * GetIamPolicyDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @instance + */ + GetIamPolicyDiskRequest.prototype.resource = ""; + + /** + * GetIamPolicyDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @instance + */ + GetIamPolicyDiskRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyDiskRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @instance + */ + Object.defineProperty(GetIamPolicyDiskRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyDiskRequest} GetIamPolicyDiskRequest instance + */ + GetIamPolicyDiskRequest.create = function create(properties) { + return new GetIamPolicyDiskRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyDiskRequest} message GetIamPolicyDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyDiskRequest} message GetIamPolicyDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyDiskRequest} GetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyDiskRequest} GetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyDiskRequest} GetIamPolicyDiskRequest + */ + GetIamPolicyDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyDiskRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyDiskRequest} message GetIamPolicyDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyDiskRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyDiskRequest; + })(); + + v1.InsertDiskRequest = (function() { + + /** + * Properties of an InsertDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertDiskRequest + * @property {google.cloud.compute.v1.IDisk|null} [diskResource] InsertDiskRequest diskResource + * @property {string|null} [project] InsertDiskRequest project + * @property {string|null} [requestId] InsertDiskRequest requestId + * @property {string|null} [sourceImage] InsertDiskRequest sourceImage + * @property {string|null} [zone] InsertDiskRequest zone + */ + + /** + * Constructs a new InsertDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertDiskRequest. + * @implements IInsertDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertDiskRequest=} [properties] Properties to set + */ + function InsertDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertDiskRequest diskResource. + * @member {google.cloud.compute.v1.IDisk|null|undefined} diskResource + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + */ + InsertDiskRequest.prototype.diskResource = null; + + /** + * InsertDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + */ + InsertDiskRequest.prototype.project = ""; + + /** + * InsertDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + */ + InsertDiskRequest.prototype.requestId = null; + + /** + * InsertDiskRequest sourceImage. + * @member {string|null|undefined} sourceImage + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + */ + InsertDiskRequest.prototype.sourceImage = null; + + /** + * InsertDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + */ + InsertDiskRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + */ + Object.defineProperty(InsertDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InsertDiskRequest _sourceImage. + * @member {"sourceImage"|undefined} _sourceImage + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + */ + Object.defineProperty(InsertDiskRequest.prototype, "_sourceImage", { + get: $util.oneOfGetter($oneOfFields = ["sourceImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {google.cloud.compute.v1.IInsertDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertDiskRequest} InsertDiskRequest instance + */ + InsertDiskRequest.create = function create(properties) { + return new InsertDiskRequest(properties); + }; + + /** + * Encodes the specified InsertDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {google.cloud.compute.v1.IInsertDiskRequest} message InsertDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.diskResource != null && Object.hasOwnProperty.call(message, "diskResource")) + $root.google.cloud.compute.v1.Disk.encode(message.diskResource, writer.uint32(/* id 25880688, wireType 2 =*/207045506).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.sourceImage != null && Object.hasOwnProperty.call(message, "sourceImage")) + writer.uint32(/* id 50443319, wireType 2 =*/403546554).string(message.sourceImage); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {google.cloud.compute.v1.IInsertDiskRequest} message InsertDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertDiskRequest} InsertDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 25880688: + message.diskResource = $root.google.cloud.compute.v1.Disk.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 50443319: + message.sourceImage = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertDiskRequest} InsertDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskResource != null && message.hasOwnProperty("diskResource")) { + var error = $root.google.cloud.compute.v1.Disk.verify(message.diskResource); + if (error) + return "diskResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + properties._sourceImage = 1; + if (!$util.isString(message.sourceImage)) + return "sourceImage: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertDiskRequest} InsertDiskRequest + */ + InsertDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertDiskRequest(); + if (object.diskResource != null) { + if (typeof object.diskResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertDiskRequest.diskResource: object expected"); + message.diskResource = $root.google.cloud.compute.v1.Disk.fromObject(object.diskResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sourceImage != null) + message.sourceImage = String(object.sourceImage); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @static + * @param {google.cloud.compute.v1.InsertDiskRequest} message InsertDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.diskResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.diskResource != null && message.hasOwnProperty("diskResource")) + object.diskResource = $root.google.cloud.compute.v1.Disk.toObject(message.diskResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + object.sourceImage = message.sourceImage; + if (options.oneofs) + object._sourceImage = "sourceImage"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertDiskRequest + * @instance + * @returns {Object.} JSON object + */ + InsertDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertDiskRequest; + })(); + + v1.ListDisksRequest = (function() { + + /** + * Properties of a ListDisksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListDisksRequest + * @property {string|null} [filter] ListDisksRequest filter + * @property {number|null} [maxResults] ListDisksRequest maxResults + * @property {string|null} [orderBy] ListDisksRequest orderBy + * @property {string|null} [pageToken] ListDisksRequest pageToken + * @property {string|null} [project] ListDisksRequest project + * @property {boolean|null} [returnPartialSuccess] ListDisksRequest returnPartialSuccess + * @property {string|null} [zone] ListDisksRequest zone + */ + + /** + * Constructs a new ListDisksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListDisksRequest. + * @implements IListDisksRequest + * @constructor + * @param {google.cloud.compute.v1.IListDisksRequest=} [properties] Properties to set + */ + function ListDisksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDisksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + ListDisksRequest.prototype.filter = null; + + /** + * ListDisksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + ListDisksRequest.prototype.maxResults = null; + + /** + * ListDisksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + ListDisksRequest.prototype.orderBy = null; + + /** + * ListDisksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + ListDisksRequest.prototype.pageToken = null; + + /** + * ListDisksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + ListDisksRequest.prototype.project = ""; + + /** + * ListDisksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + ListDisksRequest.prototype.returnPartialSuccess = null; + + /** + * ListDisksRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + ListDisksRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListDisksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + Object.defineProperty(ListDisksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDisksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + Object.defineProperty(ListDisksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDisksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + Object.defineProperty(ListDisksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDisksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + Object.defineProperty(ListDisksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListDisksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + */ + Object.defineProperty(ListDisksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListDisksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {google.cloud.compute.v1.IListDisksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListDisksRequest} ListDisksRequest instance + */ + ListDisksRequest.create = function create(properties) { + return new ListDisksRequest(properties); + }; + + /** + * Encodes the specified ListDisksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListDisksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {google.cloud.compute.v1.IListDisksRequest} message ListDisksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDisksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListDisksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListDisksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {google.cloud.compute.v1.IListDisksRequest} message ListDisksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDisksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDisksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListDisksRequest} ListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDisksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListDisksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDisksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListDisksRequest} ListDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDisksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDisksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDisksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListDisksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListDisksRequest} ListDisksRequest + */ + ListDisksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListDisksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListDisksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListDisksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListDisksRequest + * @static + * @param {google.cloud.compute.v1.ListDisksRequest} message ListDisksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDisksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListDisksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListDisksRequest + * @instance + * @returns {Object.} JSON object + */ + ListDisksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDisksRequest; + })(); + + v1.RemoveResourcePoliciesDiskRequest = (function() { + + /** + * Properties of a RemoveResourcePoliciesDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveResourcePoliciesDiskRequest + * @property {string|null} [disk] RemoveResourcePoliciesDiskRequest disk + * @property {google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest|null} [disksRemoveResourcePoliciesRequestResource] RemoveResourcePoliciesDiskRequest disksRemoveResourcePoliciesRequestResource + * @property {string|null} [project] RemoveResourcePoliciesDiskRequest project + * @property {string|null} [requestId] RemoveResourcePoliciesDiskRequest requestId + * @property {string|null} [zone] RemoveResourcePoliciesDiskRequest zone + */ + + /** + * Constructs a new RemoveResourcePoliciesDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveResourcePoliciesDiskRequest. + * @implements IRemoveResourcePoliciesDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest=} [properties] Properties to set + */ + function RemoveResourcePoliciesDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveResourcePoliciesDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @instance + */ + RemoveResourcePoliciesDiskRequest.prototype.disk = ""; + + /** + * RemoveResourcePoliciesDiskRequest disksRemoveResourcePoliciesRequestResource. + * @member {google.cloud.compute.v1.IDisksRemoveResourcePoliciesRequest|null|undefined} disksRemoveResourcePoliciesRequestResource + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @instance + */ + RemoveResourcePoliciesDiskRequest.prototype.disksRemoveResourcePoliciesRequestResource = null; + + /** + * RemoveResourcePoliciesDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @instance + */ + RemoveResourcePoliciesDiskRequest.prototype.project = ""; + + /** + * RemoveResourcePoliciesDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @instance + */ + RemoveResourcePoliciesDiskRequest.prototype.requestId = null; + + /** + * RemoveResourcePoliciesDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @instance + */ + RemoveResourcePoliciesDiskRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveResourcePoliciesDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @instance + */ + Object.defineProperty(RemoveResourcePoliciesDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveResourcePoliciesDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest} RemoveResourcePoliciesDiskRequest instance + */ + RemoveResourcePoliciesDiskRequest.create = function create(properties) { + return new RemoveResourcePoliciesDiskRequest(properties); + }; + + /** + * Encodes the specified RemoveResourcePoliciesDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest} message RemoveResourcePoliciesDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveResourcePoliciesDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.disksRemoveResourcePoliciesRequestResource != null && Object.hasOwnProperty.call(message, "disksRemoveResourcePoliciesRequestResource")) + $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.encode(message.disksRemoveResourcePoliciesRequestResource, writer.uint32(/* id 436756718, wireType 2 =*/3494053746).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RemoveResourcePoliciesDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest} message RemoveResourcePoliciesDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveResourcePoliciesDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveResourcePoliciesDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest} RemoveResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveResourcePoliciesDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 436756718: + message.disksRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveResourcePoliciesDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest} RemoveResourcePoliciesDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveResourcePoliciesDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveResourcePoliciesDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveResourcePoliciesDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.disksRemoveResourcePoliciesRequestResource != null && message.hasOwnProperty("disksRemoveResourcePoliciesRequestResource")) { + var error = $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.verify(message.disksRemoveResourcePoliciesRequestResource); + if (error) + return "disksRemoveResourcePoliciesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a RemoveResourcePoliciesDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest} RemoveResourcePoliciesDiskRequest + */ + RemoveResourcePoliciesDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.disksRemoveResourcePoliciesRequestResource != null) { + if (typeof object.disksRemoveResourcePoliciesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest.disksRemoveResourcePoliciesRequestResource: object expected"); + message.disksRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.fromObject(object.disksRemoveResourcePoliciesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a RemoveResourcePoliciesDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @static + * @param {google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest} message RemoveResourcePoliciesDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveResourcePoliciesDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.zone = ""; + object.project = ""; + object.disksRemoveResourcePoliciesRequestResource = null; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.disksRemoveResourcePoliciesRequestResource != null && message.hasOwnProperty("disksRemoveResourcePoliciesRequestResource")) + object.disksRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest.toObject(message.disksRemoveResourcePoliciesRequestResource, options); + return object; + }; + + /** + * Converts this RemoveResourcePoliciesDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveResourcePoliciesDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveResourcePoliciesDiskRequest; + })(); + + v1.ResizeDiskRequest = (function() { + + /** + * Properties of a ResizeDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IResizeDiskRequest + * @property {string|null} [disk] ResizeDiskRequest disk + * @property {google.cloud.compute.v1.IDisksResizeRequest|null} [disksResizeRequestResource] ResizeDiskRequest disksResizeRequestResource + * @property {string|null} [project] ResizeDiskRequest project + * @property {string|null} [requestId] ResizeDiskRequest requestId + * @property {string|null} [zone] ResizeDiskRequest zone + */ + + /** + * Constructs a new ResizeDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResizeDiskRequest. + * @implements IResizeDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IResizeDiskRequest=} [properties] Properties to set + */ + function ResizeDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResizeDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @instance + */ + ResizeDiskRequest.prototype.disk = ""; + + /** + * ResizeDiskRequest disksResizeRequestResource. + * @member {google.cloud.compute.v1.IDisksResizeRequest|null|undefined} disksResizeRequestResource + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @instance + */ + ResizeDiskRequest.prototype.disksResizeRequestResource = null; + + /** + * ResizeDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @instance + */ + ResizeDiskRequest.prototype.project = ""; + + /** + * ResizeDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @instance + */ + ResizeDiskRequest.prototype.requestId = null; + + /** + * ResizeDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @instance + */ + ResizeDiskRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResizeDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @instance + */ + Object.defineProperty(ResizeDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResizeDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {google.cloud.compute.v1.IResizeDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResizeDiskRequest} ResizeDiskRequest instance + */ + ResizeDiskRequest.create = function create(properties) { + return new ResizeDiskRequest(properties); + }; + + /** + * Encodes the specified ResizeDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {google.cloud.compute.v1.IResizeDiskRequest} message ResizeDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.disksResizeRequestResource != null && Object.hasOwnProperty.call(message, "disksResizeRequestResource")) + $root.google.cloud.compute.v1.DisksResizeRequest.encode(message.disksResizeRequestResource, writer.uint32(/* id 78307616, wireType 2 =*/626460930).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified ResizeDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {google.cloud.compute.v1.IResizeDiskRequest} message ResizeDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResizeDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResizeDiskRequest} ResizeDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResizeDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 78307616: + message.disksResizeRequestResource = $root.google.cloud.compute.v1.DisksResizeRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResizeDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResizeDiskRequest} ResizeDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResizeDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResizeDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.disksResizeRequestResource != null && message.hasOwnProperty("disksResizeRequestResource")) { + var error = $root.google.cloud.compute.v1.DisksResizeRequest.verify(message.disksResizeRequestResource); + if (error) + return "disksResizeRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ResizeDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResizeDiskRequest} ResizeDiskRequest + */ + ResizeDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResizeDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.ResizeDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.disksResizeRequestResource != null) { + if (typeof object.disksResizeRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ResizeDiskRequest.disksResizeRequestResource: object expected"); + message.disksResizeRequestResource = $root.google.cloud.compute.v1.DisksResizeRequest.fromObject(object.disksResizeRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ResizeDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @static + * @param {google.cloud.compute.v1.ResizeDiskRequest} message ResizeDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResizeDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.zone = ""; + object.disksResizeRequestResource = null; + object.project = ""; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.disksResizeRequestResource != null && message.hasOwnProperty("disksResizeRequestResource")) + object.disksResizeRequestResource = $root.google.cloud.compute.v1.DisksResizeRequest.toObject(message.disksResizeRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this ResizeDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResizeDiskRequest + * @instance + * @returns {Object.} JSON object + */ + ResizeDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResizeDiskRequest; + })(); + + v1.SetIamPolicyDiskRequest = (function() { + + /** + * Properties of a SetIamPolicyDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyDiskRequest + * @property {string|null} [project] SetIamPolicyDiskRequest project + * @property {string|null} [resource] SetIamPolicyDiskRequest resource + * @property {string|null} [zone] SetIamPolicyDiskRequest zone + * @property {google.cloud.compute.v1.IZoneSetPolicyRequest|null} [zoneSetPolicyRequestResource] SetIamPolicyDiskRequest zoneSetPolicyRequestResource + */ + + /** + * Constructs a new SetIamPolicyDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyDiskRequest. + * @implements ISetIamPolicyDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyDiskRequest=} [properties] Properties to set + */ + function SetIamPolicyDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @instance + */ + SetIamPolicyDiskRequest.prototype.project = ""; + + /** + * SetIamPolicyDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @instance + */ + SetIamPolicyDiskRequest.prototype.resource = ""; + + /** + * SetIamPolicyDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @instance + */ + SetIamPolicyDiskRequest.prototype.zone = ""; + + /** + * SetIamPolicyDiskRequest zoneSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IZoneSetPolicyRequest|null|undefined} zoneSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @instance + */ + SetIamPolicyDiskRequest.prototype.zoneSetPolicyRequestResource = null; + + /** + * Creates a new SetIamPolicyDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyDiskRequest} SetIamPolicyDiskRequest instance + */ + SetIamPolicyDiskRequest.create = function create(properties) { + return new SetIamPolicyDiskRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyDiskRequest} message SetIamPolicyDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.zoneSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "zoneSetPolicyRequestResource")) + $root.google.cloud.compute.v1.ZoneSetPolicyRequest.encode(message.zoneSetPolicyRequestResource, writer.uint32(/* id 382082107, wireType 2 =*/3056656858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyDiskRequest} message SetIamPolicyDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyDiskRequest} SetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + case 382082107: + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyDiskRequest} SetIamPolicyDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.verify(message.zoneSetPolicyRequestResource); + if (error) + return "zoneSetPolicyRequestResource." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyDiskRequest} SetIamPolicyDiskRequest + */ + SetIamPolicyDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyDiskRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + if (object.zoneSetPolicyRequestResource != null) { + if (typeof object.zoneSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyDiskRequest.zoneSetPolicyRequestResource: object expected"); + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.fromObject(object.zoneSetPolicyRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyDiskRequest} message SetIamPolicyDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.zoneSetPolicyRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) + object.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.toObject(message.zoneSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyDiskRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyDiskRequest; + })(); + + v1.SetLabelsDiskRequest = (function() { + + /** + * Properties of a SetLabelsDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsDiskRequest + * @property {string|null} [project] SetLabelsDiskRequest project + * @property {string|null} [requestId] SetLabelsDiskRequest requestId + * @property {string|null} [resource] SetLabelsDiskRequest resource + * @property {string|null} [zone] SetLabelsDiskRequest zone + * @property {google.cloud.compute.v1.IZoneSetLabelsRequest|null} [zoneSetLabelsRequestResource] SetLabelsDiskRequest zoneSetLabelsRequestResource + */ + + /** + * Constructs a new SetLabelsDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsDiskRequest. + * @implements ISetLabelsDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsDiskRequest=} [properties] Properties to set + */ + function SetLabelsDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @instance + */ + SetLabelsDiskRequest.prototype.project = ""; + + /** + * SetLabelsDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @instance + */ + SetLabelsDiskRequest.prototype.requestId = null; + + /** + * SetLabelsDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @instance + */ + SetLabelsDiskRequest.prototype.resource = ""; + + /** + * SetLabelsDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @instance + */ + SetLabelsDiskRequest.prototype.zone = ""; + + /** + * SetLabelsDiskRequest zoneSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IZoneSetLabelsRequest|null|undefined} zoneSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @instance + */ + SetLabelsDiskRequest.prototype.zoneSetLabelsRequestResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetLabelsDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @instance + */ + Object.defineProperty(SetLabelsDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetLabelsDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsDiskRequest} SetLabelsDiskRequest instance + */ + SetLabelsDiskRequest.create = function create(properties) { + return new SetLabelsDiskRequest(properties); + }; + + /** + * Encodes the specified SetLabelsDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsDiskRequest} message SetLabelsDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.zoneSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "zoneSetLabelsRequestResource")) + $root.google.cloud.compute.v1.ZoneSetLabelsRequest.encode(message.zoneSetLabelsRequestResource, writer.uint32(/* id 364950798, wireType 2 =*/2919606386).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsDiskRequest} message SetLabelsDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsDiskRequest} SetLabelsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + case 364950798: + message.zoneSetLabelsRequestResource = $root.google.cloud.compute.v1.ZoneSetLabelsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsDiskRequest} SetLabelsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.zoneSetLabelsRequestResource != null && message.hasOwnProperty("zoneSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.ZoneSetLabelsRequest.verify(message.zoneSetLabelsRequestResource); + if (error) + return "zoneSetLabelsRequestResource." + error; + } + return null; + }; + + /** + * Creates a SetLabelsDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsDiskRequest} SetLabelsDiskRequest + */ + SetLabelsDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsDiskRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + if (object.zoneSetLabelsRequestResource != null) { + if (typeof object.zoneSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsDiskRequest.zoneSetLabelsRequestResource: object expected"); + message.zoneSetLabelsRequestResource = $root.google.cloud.compute.v1.ZoneSetLabelsRequest.fromObject(object.zoneSetLabelsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a SetLabelsDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsDiskRequest} message SetLabelsDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.zoneSetLabelsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zoneSetLabelsRequestResource != null && message.hasOwnProperty("zoneSetLabelsRequestResource")) + object.zoneSetLabelsRequestResource = $root.google.cloud.compute.v1.ZoneSetLabelsRequest.toObject(message.zoneSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsDiskRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsDiskRequest; + })(); + + v1.TestIamPermissionsDiskRequest = (function() { + + /** + * Properties of a TestIamPermissionsDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsDiskRequest + * @property {string|null} [project] TestIamPermissionsDiskRequest project + * @property {string|null} [resource] TestIamPermissionsDiskRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsDiskRequest testPermissionsRequestResource + * @property {string|null} [zone] TestIamPermissionsDiskRequest zone + */ + + /** + * Constructs a new TestIamPermissionsDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsDiskRequest. + * @implements ITestIamPermissionsDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsDiskRequest=} [properties] Properties to set + */ + function TestIamPermissionsDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @instance + */ + TestIamPermissionsDiskRequest.prototype.project = ""; + + /** + * TestIamPermissionsDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @instance + */ + TestIamPermissionsDiskRequest.prototype.resource = ""; + + /** + * TestIamPermissionsDiskRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @instance + */ + TestIamPermissionsDiskRequest.prototype.testPermissionsRequestResource = null; + + /** + * TestIamPermissionsDiskRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @instance + */ + TestIamPermissionsDiskRequest.prototype.zone = ""; + + /** + * Creates a new TestIamPermissionsDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsDiskRequest} TestIamPermissionsDiskRequest instance + */ + TestIamPermissionsDiskRequest.create = function create(properties) { + return new TestIamPermissionsDiskRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsDiskRequest} message TestIamPermissionsDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsDiskRequest} message TestIamPermissionsDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsDiskRequest} TestIamPermissionsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsDiskRequest} TestIamPermissionsDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a TestIamPermissionsDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsDiskRequest} TestIamPermissionsDiskRequest + */ + TestIamPermissionsDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsDiskRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsDiskRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsDiskRequest} message TestIamPermissionsDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsDiskRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsDiskRequest; + })(); + + v1.DeleteExternalVpnGatewayRequest = (function() { + + /** + * Properties of a DeleteExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteExternalVpnGatewayRequest + * @property {string|null} [externalVpnGateway] DeleteExternalVpnGatewayRequest externalVpnGateway + * @property {string|null} [project] DeleteExternalVpnGatewayRequest project + * @property {string|null} [requestId] DeleteExternalVpnGatewayRequest requestId + */ + + /** + * Constructs a new DeleteExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteExternalVpnGatewayRequest. + * @implements IDeleteExternalVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest=} [properties] Properties to set + */ + function DeleteExternalVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteExternalVpnGatewayRequest externalVpnGateway. + * @member {string} externalVpnGateway + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @instance + */ + DeleteExternalVpnGatewayRequest.prototype.externalVpnGateway = ""; + + /** + * DeleteExternalVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @instance + */ + DeleteExternalVpnGatewayRequest.prototype.project = ""; + + /** + * DeleteExternalVpnGatewayRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @instance + */ + DeleteExternalVpnGatewayRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteExternalVpnGatewayRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @instance + */ + Object.defineProperty(DeleteExternalVpnGatewayRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteExternalVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteExternalVpnGatewayRequest} DeleteExternalVpnGatewayRequest instance + */ + DeleteExternalVpnGatewayRequest.create = function create(properties) { + return new DeleteExternalVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified DeleteExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteExternalVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest} message DeleteExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExternalVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.externalVpnGateway != null && Object.hasOwnProperty.call(message, "externalVpnGateway")) + writer.uint32(/* id 109898629, wireType 2 =*/879189034).string(message.externalVpnGateway); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteExternalVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest} message DeleteExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteExternalVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteExternalVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteExternalVpnGatewayRequest} DeleteExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExternalVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 109898629: + message.externalVpnGateway = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteExternalVpnGatewayRequest} DeleteExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteExternalVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteExternalVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteExternalVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.externalVpnGateway != null && message.hasOwnProperty("externalVpnGateway")) + if (!$util.isString(message.externalVpnGateway)) + return "externalVpnGateway: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteExternalVpnGatewayRequest} DeleteExternalVpnGatewayRequest + */ + DeleteExternalVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest(); + if (object.externalVpnGateway != null) + message.externalVpnGateway = String(object.externalVpnGateway); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.DeleteExternalVpnGatewayRequest} message DeleteExternalVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteExternalVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.externalVpnGateway = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.externalVpnGateway != null && message.hasOwnProperty("externalVpnGateway")) + object.externalVpnGateway = message.externalVpnGateway; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteExternalVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteExternalVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteExternalVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteExternalVpnGatewayRequest; + })(); + + v1.GetExternalVpnGatewayRequest = (function() { + + /** + * Properties of a GetExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetExternalVpnGatewayRequest + * @property {string|null} [externalVpnGateway] GetExternalVpnGatewayRequest externalVpnGateway + * @property {string|null} [project] GetExternalVpnGatewayRequest project + */ + + /** + * Constructs a new GetExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetExternalVpnGatewayRequest. + * @implements IGetExternalVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IGetExternalVpnGatewayRequest=} [properties] Properties to set + */ + function GetExternalVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetExternalVpnGatewayRequest externalVpnGateway. + * @member {string} externalVpnGateway + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @instance + */ + GetExternalVpnGatewayRequest.prototype.externalVpnGateway = ""; + + /** + * GetExternalVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @instance + */ + GetExternalVpnGatewayRequest.prototype.project = ""; + + /** + * Creates a new GetExternalVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetExternalVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetExternalVpnGatewayRequest} GetExternalVpnGatewayRequest instance + */ + GetExternalVpnGatewayRequest.create = function create(properties) { + return new GetExternalVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified GetExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetExternalVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetExternalVpnGatewayRequest} message GetExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExternalVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.externalVpnGateway != null && Object.hasOwnProperty.call(message, "externalVpnGateway")) + writer.uint32(/* id 109898629, wireType 2 =*/879189034).string(message.externalVpnGateway); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetExternalVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetExternalVpnGatewayRequest} message GetExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetExternalVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetExternalVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetExternalVpnGatewayRequest} GetExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExternalVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetExternalVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 109898629: + message.externalVpnGateway = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetExternalVpnGatewayRequest} GetExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetExternalVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetExternalVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetExternalVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.externalVpnGateway != null && message.hasOwnProperty("externalVpnGateway")) + if (!$util.isString(message.externalVpnGateway)) + return "externalVpnGateway: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetExternalVpnGatewayRequest} GetExternalVpnGatewayRequest + */ + GetExternalVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetExternalVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetExternalVpnGatewayRequest(); + if (object.externalVpnGateway != null) + message.externalVpnGateway = String(object.externalVpnGateway); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.GetExternalVpnGatewayRequest} message GetExternalVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetExternalVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.externalVpnGateway = ""; + object.project = ""; + } + if (message.externalVpnGateway != null && message.hasOwnProperty("externalVpnGateway")) + object.externalVpnGateway = message.externalVpnGateway; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetExternalVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetExternalVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + GetExternalVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetExternalVpnGatewayRequest; + })(); + + v1.InsertExternalVpnGatewayRequest = (function() { + + /** + * Properties of an InsertExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertExternalVpnGatewayRequest + * @property {google.cloud.compute.v1.IExternalVpnGateway|null} [externalVpnGatewayResource] InsertExternalVpnGatewayRequest externalVpnGatewayResource + * @property {string|null} [project] InsertExternalVpnGatewayRequest project + * @property {string|null} [requestId] InsertExternalVpnGatewayRequest requestId + */ + + /** + * Constructs a new InsertExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertExternalVpnGatewayRequest. + * @implements IInsertExternalVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertExternalVpnGatewayRequest=} [properties] Properties to set + */ + function InsertExternalVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertExternalVpnGatewayRequest externalVpnGatewayResource. + * @member {google.cloud.compute.v1.IExternalVpnGateway|null|undefined} externalVpnGatewayResource + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @instance + */ + InsertExternalVpnGatewayRequest.prototype.externalVpnGatewayResource = null; + + /** + * InsertExternalVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @instance + */ + InsertExternalVpnGatewayRequest.prototype.project = ""; + + /** + * InsertExternalVpnGatewayRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @instance + */ + InsertExternalVpnGatewayRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertExternalVpnGatewayRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @instance + */ + Object.defineProperty(InsertExternalVpnGatewayRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertExternalVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertExternalVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertExternalVpnGatewayRequest} InsertExternalVpnGatewayRequest instance + */ + InsertExternalVpnGatewayRequest.create = function create(properties) { + return new InsertExternalVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified InsertExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertExternalVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertExternalVpnGatewayRequest} message InsertExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertExternalVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.externalVpnGatewayResource != null && Object.hasOwnProperty.call(message, "externalVpnGatewayResource")) + $root.google.cloud.compute.v1.ExternalVpnGateway.encode(message.externalVpnGatewayResource, writer.uint32(/* id 486813576, wireType 2 =*/3894508610).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertExternalVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertExternalVpnGatewayRequest} message InsertExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertExternalVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertExternalVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertExternalVpnGatewayRequest} InsertExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertExternalVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertExternalVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 486813576: + message.externalVpnGatewayResource = $root.google.cloud.compute.v1.ExternalVpnGateway.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertExternalVpnGatewayRequest} InsertExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertExternalVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertExternalVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertExternalVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.externalVpnGatewayResource != null && message.hasOwnProperty("externalVpnGatewayResource")) { + var error = $root.google.cloud.compute.v1.ExternalVpnGateway.verify(message.externalVpnGatewayResource); + if (error) + return "externalVpnGatewayResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertExternalVpnGatewayRequest} InsertExternalVpnGatewayRequest + */ + InsertExternalVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertExternalVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertExternalVpnGatewayRequest(); + if (object.externalVpnGatewayResource != null) { + if (typeof object.externalVpnGatewayResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertExternalVpnGatewayRequest.externalVpnGatewayResource: object expected"); + message.externalVpnGatewayResource = $root.google.cloud.compute.v1.ExternalVpnGateway.fromObject(object.externalVpnGatewayResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.InsertExternalVpnGatewayRequest} message InsertExternalVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertExternalVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.externalVpnGatewayResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.externalVpnGatewayResource != null && message.hasOwnProperty("externalVpnGatewayResource")) + object.externalVpnGatewayResource = $root.google.cloud.compute.v1.ExternalVpnGateway.toObject(message.externalVpnGatewayResource, options); + return object; + }; + + /** + * Converts this InsertExternalVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertExternalVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + InsertExternalVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertExternalVpnGatewayRequest; + })(); + + v1.ListExternalVpnGatewaysRequest = (function() { + + /** + * Properties of a ListExternalVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @interface IListExternalVpnGatewaysRequest + * @property {string|null} [filter] ListExternalVpnGatewaysRequest filter + * @property {number|null} [maxResults] ListExternalVpnGatewaysRequest maxResults + * @property {string|null} [orderBy] ListExternalVpnGatewaysRequest orderBy + * @property {string|null} [pageToken] ListExternalVpnGatewaysRequest pageToken + * @property {string|null} [project] ListExternalVpnGatewaysRequest project + * @property {boolean|null} [returnPartialSuccess] ListExternalVpnGatewaysRequest returnPartialSuccess + */ + + /** + * Constructs a new ListExternalVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListExternalVpnGatewaysRequest. + * @implements IListExternalVpnGatewaysRequest + * @constructor + * @param {google.cloud.compute.v1.IListExternalVpnGatewaysRequest=} [properties] Properties to set + */ + function ListExternalVpnGatewaysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListExternalVpnGatewaysRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + ListExternalVpnGatewaysRequest.prototype.filter = null; + + /** + * ListExternalVpnGatewaysRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + ListExternalVpnGatewaysRequest.prototype.maxResults = null; + + /** + * ListExternalVpnGatewaysRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + ListExternalVpnGatewaysRequest.prototype.orderBy = null; + + /** + * ListExternalVpnGatewaysRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + ListExternalVpnGatewaysRequest.prototype.pageToken = null; + + /** + * ListExternalVpnGatewaysRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + ListExternalVpnGatewaysRequest.prototype.project = ""; + + /** + * ListExternalVpnGatewaysRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + ListExternalVpnGatewaysRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListExternalVpnGatewaysRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListExternalVpnGatewaysRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListExternalVpnGatewaysRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListExternalVpnGatewaysRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListExternalVpnGatewaysRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListExternalVpnGatewaysRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListExternalVpnGatewaysRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListExternalVpnGatewaysRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListExternalVpnGatewaysRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListExternalVpnGatewaysRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListExternalVpnGatewaysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListExternalVpnGatewaysRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListExternalVpnGatewaysRequest} ListExternalVpnGatewaysRequest instance + */ + ListExternalVpnGatewaysRequest.create = function create(properties) { + return new ListExternalVpnGatewaysRequest(properties); + }; + + /** + * Encodes the specified ListExternalVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.ListExternalVpnGatewaysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListExternalVpnGatewaysRequest} message ListExternalVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalVpnGatewaysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListExternalVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListExternalVpnGatewaysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListExternalVpnGatewaysRequest} message ListExternalVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListExternalVpnGatewaysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListExternalVpnGatewaysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListExternalVpnGatewaysRequest} ListExternalVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalVpnGatewaysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListExternalVpnGatewaysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListExternalVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListExternalVpnGatewaysRequest} ListExternalVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListExternalVpnGatewaysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListExternalVpnGatewaysRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListExternalVpnGatewaysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListExternalVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListExternalVpnGatewaysRequest} ListExternalVpnGatewaysRequest + */ + ListExternalVpnGatewaysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListExternalVpnGatewaysRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListExternalVpnGatewaysRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListExternalVpnGatewaysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.ListExternalVpnGatewaysRequest} message ListExternalVpnGatewaysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListExternalVpnGatewaysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListExternalVpnGatewaysRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListExternalVpnGatewaysRequest + * @instance + * @returns {Object.} JSON object + */ + ListExternalVpnGatewaysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListExternalVpnGatewaysRequest; + })(); + + v1.SetLabelsExternalVpnGatewayRequest = (function() { + + /** + * Properties of a SetLabelsExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsExternalVpnGatewayRequest + * @property {google.cloud.compute.v1.IGlobalSetLabelsRequest|null} [globalSetLabelsRequestResource] SetLabelsExternalVpnGatewayRequest globalSetLabelsRequestResource + * @property {string|null} [project] SetLabelsExternalVpnGatewayRequest project + * @property {string|null} [resource] SetLabelsExternalVpnGatewayRequest resource + */ + + /** + * Constructs a new SetLabelsExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsExternalVpnGatewayRequest. + * @implements ISetLabelsExternalVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest=} [properties] Properties to set + */ + function SetLabelsExternalVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsExternalVpnGatewayRequest globalSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetLabelsRequest|null|undefined} globalSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @instance + */ + SetLabelsExternalVpnGatewayRequest.prototype.globalSetLabelsRequestResource = null; + + /** + * SetLabelsExternalVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @instance + */ + SetLabelsExternalVpnGatewayRequest.prototype.project = ""; + + /** + * SetLabelsExternalVpnGatewayRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @instance + */ + SetLabelsExternalVpnGatewayRequest.prototype.resource = ""; + + /** + * Creates a new SetLabelsExternalVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest} SetLabelsExternalVpnGatewayRequest instance + */ + SetLabelsExternalVpnGatewayRequest.create = function create(properties) { + return new SetLabelsExternalVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified SetLabelsExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest} message SetLabelsExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsExternalVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "globalSetLabelsRequestResource")) + $root.google.cloud.compute.v1.GlobalSetLabelsRequest.encode(message.globalSetLabelsRequestResource, writer.uint32(/* id 319917189, wireType 2 =*/2559337514).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest} message SetLabelsExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsExternalVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsExternalVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest} SetLabelsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsExternalVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 319917189: + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest} SetLabelsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsExternalVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsExternalVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsExternalVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.verify(message.globalSetLabelsRequestResource); + if (error) + return "globalSetLabelsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetLabelsExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest} SetLabelsExternalVpnGatewayRequest + */ + SetLabelsExternalVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest(); + if (object.globalSetLabelsRequestResource != null) { + if (typeof object.globalSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest.globalSetLabelsRequestResource: object expected"); + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.fromObject(object.globalSetLabelsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetLabelsExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest} message SetLabelsExternalVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsExternalVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetLabelsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) + object.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.toObject(message.globalSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsExternalVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsExternalVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsExternalVpnGatewayRequest; + })(); + + v1.TestIamPermissionsExternalVpnGatewayRequest = (function() { + + /** + * Properties of a TestIamPermissionsExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsExternalVpnGatewayRequest + * @property {string|null} [project] TestIamPermissionsExternalVpnGatewayRequest project + * @property {string|null} [resource] TestIamPermissionsExternalVpnGatewayRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsExternalVpnGatewayRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsExternalVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsExternalVpnGatewayRequest. + * @implements ITestIamPermissionsExternalVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest=} [properties] Properties to set + */ + function TestIamPermissionsExternalVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsExternalVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @instance + */ + TestIamPermissionsExternalVpnGatewayRequest.prototype.project = ""; + + /** + * TestIamPermissionsExternalVpnGatewayRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @instance + */ + TestIamPermissionsExternalVpnGatewayRequest.prototype.resource = ""; + + /** + * TestIamPermissionsExternalVpnGatewayRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @instance + */ + TestIamPermissionsExternalVpnGatewayRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsExternalVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest} TestIamPermissionsExternalVpnGatewayRequest instance + */ + TestIamPermissionsExternalVpnGatewayRequest.create = function create(properties) { + return new TestIamPermissionsExternalVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsExternalVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest} message TestIamPermissionsExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsExternalVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsExternalVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest} message TestIamPermissionsExternalVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsExternalVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsExternalVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest} TestIamPermissionsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsExternalVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsExternalVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest} TestIamPermissionsExternalVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsExternalVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsExternalVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsExternalVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsExternalVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest} TestIamPermissionsExternalVpnGatewayRequest + */ + TestIamPermissionsExternalVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsExternalVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest} message TestIamPermissionsExternalVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsExternalVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsExternalVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsExternalVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsExternalVpnGatewayRequest; + })(); + + v1.AddAssociationFirewallPolicyRequest = (function() { + + /** + * Properties of an AddAssociationFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddAssociationFirewallPolicyRequest + * @property {string|null} [firewallPolicy] AddAssociationFirewallPolicyRequest firewallPolicy + * @property {google.cloud.compute.v1.IFirewallPolicyAssociation|null} [firewallPolicyAssociationResource] AddAssociationFirewallPolicyRequest firewallPolicyAssociationResource + * @property {boolean|null} [replaceExistingAssociation] AddAssociationFirewallPolicyRequest replaceExistingAssociation + * @property {string|null} [requestId] AddAssociationFirewallPolicyRequest requestId + */ + + /** + * Constructs a new AddAssociationFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddAssociationFirewallPolicyRequest. + * @implements IAddAssociationFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest=} [properties] Properties to set + */ + function AddAssociationFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddAssociationFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @instance + */ + AddAssociationFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * AddAssociationFirewallPolicyRequest firewallPolicyAssociationResource. + * @member {google.cloud.compute.v1.IFirewallPolicyAssociation|null|undefined} firewallPolicyAssociationResource + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @instance + */ + AddAssociationFirewallPolicyRequest.prototype.firewallPolicyAssociationResource = null; + + /** + * AddAssociationFirewallPolicyRequest replaceExistingAssociation. + * @member {boolean|null|undefined} replaceExistingAssociation + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @instance + */ + AddAssociationFirewallPolicyRequest.prototype.replaceExistingAssociation = null; + + /** + * AddAssociationFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @instance + */ + AddAssociationFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddAssociationFirewallPolicyRequest _replaceExistingAssociation. + * @member {"replaceExistingAssociation"|undefined} _replaceExistingAssociation + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @instance + */ + Object.defineProperty(AddAssociationFirewallPolicyRequest.prototype, "_replaceExistingAssociation", { + get: $util.oneOfGetter($oneOfFields = ["replaceExistingAssociation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AddAssociationFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @instance + */ + Object.defineProperty(AddAssociationFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddAssociationFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddAssociationFirewallPolicyRequest} AddAssociationFirewallPolicyRequest instance + */ + AddAssociationFirewallPolicyRequest.create = function create(properties) { + return new AddAssociationFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified AddAssociationFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.AddAssociationFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest} message AddAssociationFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddAssociationFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.replaceExistingAssociation != null && Object.hasOwnProperty.call(message, "replaceExistingAssociation")) + writer.uint32(/* id 209541240, wireType 0 =*/1676329920).bool(message.replaceExistingAssociation); + if (message.firewallPolicyAssociationResource != null && Object.hasOwnProperty.call(message, "firewallPolicyAssociationResource")) + $root.google.cloud.compute.v1.FirewallPolicyAssociation.encode(message.firewallPolicyAssociationResource, writer.uint32(/* id 259546170, wireType 2 =*/2076369362).fork()).ldelim(); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified AddAssociationFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddAssociationFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest} message AddAssociationFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddAssociationFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddAssociationFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddAssociationFirewallPolicyRequest} AddAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddAssociationFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 259546170: + message.firewallPolicyAssociationResource = $root.google.cloud.compute.v1.FirewallPolicyAssociation.decode(reader, reader.uint32()); + break; + case 209541240: + message.replaceExistingAssociation = reader.bool(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddAssociationFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddAssociationFirewallPolicyRequest} AddAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddAssociationFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddAssociationFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddAssociationFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.firewallPolicyAssociationResource != null && message.hasOwnProperty("firewallPolicyAssociationResource")) { + var error = $root.google.cloud.compute.v1.FirewallPolicyAssociation.verify(message.firewallPolicyAssociationResource); + if (error) + return "firewallPolicyAssociationResource." + error; + } + if (message.replaceExistingAssociation != null && message.hasOwnProperty("replaceExistingAssociation")) { + properties._replaceExistingAssociation = 1; + if (typeof message.replaceExistingAssociation !== "boolean") + return "replaceExistingAssociation: boolean expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an AddAssociationFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddAssociationFirewallPolicyRequest} AddAssociationFirewallPolicyRequest + */ + AddAssociationFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.firewallPolicyAssociationResource != null) { + if (typeof object.firewallPolicyAssociationResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddAssociationFirewallPolicyRequest.firewallPolicyAssociationResource: object expected"); + message.firewallPolicyAssociationResource = $root.google.cloud.compute.v1.FirewallPolicyAssociation.fromObject(object.firewallPolicyAssociationResource); + } + if (object.replaceExistingAssociation != null) + message.replaceExistingAssociation = Boolean(object.replaceExistingAssociation); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AddAssociationFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.AddAssociationFirewallPolicyRequest} message AddAssociationFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddAssociationFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firewallPolicyAssociationResource = null; + object.firewallPolicy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.replaceExistingAssociation != null && message.hasOwnProperty("replaceExistingAssociation")) { + object.replaceExistingAssociation = message.replaceExistingAssociation; + if (options.oneofs) + object._replaceExistingAssociation = "replaceExistingAssociation"; + } + if (message.firewallPolicyAssociationResource != null && message.hasOwnProperty("firewallPolicyAssociationResource")) + object.firewallPolicyAssociationResource = $root.google.cloud.compute.v1.FirewallPolicyAssociation.toObject(message.firewallPolicyAssociationResource, options); + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this AddAssociationFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddAssociationFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + AddAssociationFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddAssociationFirewallPolicyRequest; + })(); + + v1.AddRuleFirewallPolicyRequest = (function() { + + /** + * Properties of an AddRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddRuleFirewallPolicyRequest + * @property {string|null} [firewallPolicy] AddRuleFirewallPolicyRequest firewallPolicy + * @property {google.cloud.compute.v1.IFirewallPolicyRule|null} [firewallPolicyRuleResource] AddRuleFirewallPolicyRequest firewallPolicyRuleResource + * @property {string|null} [requestId] AddRuleFirewallPolicyRequest requestId + */ + + /** + * Constructs a new AddRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddRuleFirewallPolicyRequest. + * @implements IAddRuleFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IAddRuleFirewallPolicyRequest=} [properties] Properties to set + */ + function AddRuleFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddRuleFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @instance + */ + AddRuleFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * AddRuleFirewallPolicyRequest firewallPolicyRuleResource. + * @member {google.cloud.compute.v1.IFirewallPolicyRule|null|undefined} firewallPolicyRuleResource + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @instance + */ + AddRuleFirewallPolicyRequest.prototype.firewallPolicyRuleResource = null; + + /** + * AddRuleFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @instance + */ + AddRuleFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddRuleFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @instance + */ + Object.defineProperty(AddRuleFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddRuleFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddRuleFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddRuleFirewallPolicyRequest} AddRuleFirewallPolicyRequest instance + */ + AddRuleFirewallPolicyRequest.create = function create(properties) { + return new AddRuleFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified AddRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.AddRuleFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddRuleFirewallPolicyRequest} message AddRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddRuleFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallPolicyRuleResource != null && Object.hasOwnProperty.call(message, "firewallPolicyRuleResource")) + $root.google.cloud.compute.v1.FirewallPolicyRule.encode(message.firewallPolicyRuleResource, writer.uint32(/* id 250523523, wireType 2 =*/2004188186).fork()).ldelim(); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified AddRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddRuleFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddRuleFirewallPolicyRequest} message AddRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddRuleFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddRuleFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddRuleFirewallPolicyRequest} AddRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddRuleFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddRuleFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 250523523: + message.firewallPolicyRuleResource = $root.google.cloud.compute.v1.FirewallPolicyRule.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddRuleFirewallPolicyRequest} AddRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddRuleFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddRuleFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddRuleFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.firewallPolicyRuleResource != null && message.hasOwnProperty("firewallPolicyRuleResource")) { + var error = $root.google.cloud.compute.v1.FirewallPolicyRule.verify(message.firewallPolicyRuleResource); + if (error) + return "firewallPolicyRuleResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an AddRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddRuleFirewallPolicyRequest} AddRuleFirewallPolicyRequest + */ + AddRuleFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddRuleFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddRuleFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.firewallPolicyRuleResource != null) { + if (typeof object.firewallPolicyRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddRuleFirewallPolicyRequest.firewallPolicyRuleResource: object expected"); + message.firewallPolicyRuleResource = $root.google.cloud.compute.v1.FirewallPolicyRule.fromObject(object.firewallPolicyRuleResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AddRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.AddRuleFirewallPolicyRequest} message AddRuleFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddRuleFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firewallPolicyRuleResource = null; + object.firewallPolicy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallPolicyRuleResource != null && message.hasOwnProperty("firewallPolicyRuleResource")) + object.firewallPolicyRuleResource = $root.google.cloud.compute.v1.FirewallPolicyRule.toObject(message.firewallPolicyRuleResource, options); + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this AddRuleFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddRuleFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + AddRuleFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddRuleFirewallPolicyRequest; + })(); + + v1.CloneRulesFirewallPolicyRequest = (function() { + + /** + * Properties of a CloneRulesFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface ICloneRulesFirewallPolicyRequest + * @property {string|null} [firewallPolicy] CloneRulesFirewallPolicyRequest firewallPolicy + * @property {string|null} [requestId] CloneRulesFirewallPolicyRequest requestId + * @property {string|null} [sourceFirewallPolicy] CloneRulesFirewallPolicyRequest sourceFirewallPolicy + */ + + /** + * Constructs a new CloneRulesFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CloneRulesFirewallPolicyRequest. + * @implements ICloneRulesFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest=} [properties] Properties to set + */ + function CloneRulesFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloneRulesFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @instance + */ + CloneRulesFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * CloneRulesFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @instance + */ + CloneRulesFirewallPolicyRequest.prototype.requestId = null; + + /** + * CloneRulesFirewallPolicyRequest sourceFirewallPolicy. + * @member {string|null|undefined} sourceFirewallPolicy + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @instance + */ + CloneRulesFirewallPolicyRequest.prototype.sourceFirewallPolicy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloneRulesFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @instance + */ + Object.defineProperty(CloneRulesFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CloneRulesFirewallPolicyRequest _sourceFirewallPolicy. + * @member {"sourceFirewallPolicy"|undefined} _sourceFirewallPolicy + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @instance + */ + Object.defineProperty(CloneRulesFirewallPolicyRequest.prototype, "_sourceFirewallPolicy", { + get: $util.oneOfGetter($oneOfFields = ["sourceFirewallPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloneRulesFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CloneRulesFirewallPolicyRequest} CloneRulesFirewallPolicyRequest instance + */ + CloneRulesFirewallPolicyRequest.create = function create(properties) { + return new CloneRulesFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified CloneRulesFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.CloneRulesFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest} message CloneRulesFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloneRulesFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceFirewallPolicy != null && Object.hasOwnProperty.call(message, "sourceFirewallPolicy")) + writer.uint32(/* id 25013549, wireType 2 =*/200108394).string(message.sourceFirewallPolicy); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified CloneRulesFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CloneRulesFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest} message CloneRulesFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloneRulesFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloneRulesFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CloneRulesFirewallPolicyRequest} CloneRulesFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloneRulesFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 25013549: + message.sourceFirewallPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloneRulesFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CloneRulesFirewallPolicyRequest} CloneRulesFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloneRulesFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloneRulesFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloneRulesFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sourceFirewallPolicy != null && message.hasOwnProperty("sourceFirewallPolicy")) { + properties._sourceFirewallPolicy = 1; + if (!$util.isString(message.sourceFirewallPolicy)) + return "sourceFirewallPolicy: string expected"; + } + return null; + }; + + /** + * Creates a CloneRulesFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CloneRulesFirewallPolicyRequest} CloneRulesFirewallPolicyRequest + */ + CloneRulesFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sourceFirewallPolicy != null) + message.sourceFirewallPolicy = String(object.sourceFirewallPolicy); + return message; + }; + + /** + * Creates a plain object from a CloneRulesFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.CloneRulesFirewallPolicyRequest} message CloneRulesFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloneRulesFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.sourceFirewallPolicy != null && message.hasOwnProperty("sourceFirewallPolicy")) { + object.sourceFirewallPolicy = message.sourceFirewallPolicy; + if (options.oneofs) + object._sourceFirewallPolicy = "sourceFirewallPolicy"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this CloneRulesFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CloneRulesFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CloneRulesFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CloneRulesFirewallPolicyRequest; + })(); + + v1.DeleteFirewallPolicyRequest = (function() { + + /** + * Properties of a DeleteFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteFirewallPolicyRequest + * @property {string|null} [firewallPolicy] DeleteFirewallPolicyRequest firewallPolicy + * @property {string|null} [requestId] DeleteFirewallPolicyRequest requestId + */ + + /** + * Constructs a new DeleteFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteFirewallPolicyRequest. + * @implements IDeleteFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteFirewallPolicyRequest=} [properties] Properties to set + */ + function DeleteFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @instance + */ + DeleteFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * DeleteFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @instance + */ + DeleteFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @instance + */ + Object.defineProperty(DeleteFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteFirewallPolicyRequest} DeleteFirewallPolicyRequest instance + */ + DeleteFirewallPolicyRequest.create = function create(properties) { + return new DeleteFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteFirewallPolicyRequest} message DeleteFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified DeleteFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteFirewallPolicyRequest} message DeleteFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteFirewallPolicyRequest} DeleteFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteFirewallPolicyRequest} DeleteFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteFirewallPolicyRequest} DeleteFirewallPolicyRequest + */ + DeleteFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.DeleteFirewallPolicyRequest} message DeleteFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this DeleteFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteFirewallPolicyRequest; + })(); + + v1.GetFirewallPolicyRequest = (function() { + + /** + * Properties of a GetFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetFirewallPolicyRequest + * @property {string|null} [firewallPolicy] GetFirewallPolicyRequest firewallPolicy + */ + + /** + * Constructs a new GetFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetFirewallPolicyRequest. + * @implements IGetFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetFirewallPolicyRequest=} [properties] Properties to set + */ + function GetFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @instance + */ + GetFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * Creates a new GetFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetFirewallPolicyRequest} GetFirewallPolicyRequest instance + */ + GetFirewallPolicyRequest.create = function create(properties) { + return new GetFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified GetFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetFirewallPolicyRequest} message GetFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified GetFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetFirewallPolicyRequest} message GetFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetFirewallPolicyRequest} GetFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetFirewallPolicyRequest} GetFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + return null; + }; + + /** + * Creates a GetFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetFirewallPolicyRequest} GetFirewallPolicyRequest + */ + GetFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + return message; + }; + + /** + * Creates a plain object from a GetFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.GetFirewallPolicyRequest} message GetFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this GetFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetFirewallPolicyRequest; + })(); + + v1.GetAssociationFirewallPolicyRequest = (function() { + + /** + * Properties of a GetAssociationFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetAssociationFirewallPolicyRequest + * @property {string|null} [firewallPolicy] GetAssociationFirewallPolicyRequest firewallPolicy + * @property {string|null} [name] GetAssociationFirewallPolicyRequest name + */ + + /** + * Constructs a new GetAssociationFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetAssociationFirewallPolicyRequest. + * @implements IGetAssociationFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest=} [properties] Properties to set + */ + function GetAssociationFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAssociationFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @instance + */ + GetAssociationFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * GetAssociationFirewallPolicyRequest name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @instance + */ + GetAssociationFirewallPolicyRequest.prototype.name = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetAssociationFirewallPolicyRequest _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @instance + */ + Object.defineProperty(GetAssociationFirewallPolicyRequest.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetAssociationFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetAssociationFirewallPolicyRequest} GetAssociationFirewallPolicyRequest instance + */ + GetAssociationFirewallPolicyRequest.create = function create(properties) { + return new GetAssociationFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified GetAssociationFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetAssociationFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest} message GetAssociationFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAssociationFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified GetAssociationFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetAssociationFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest} message GetAssociationFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAssociationFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAssociationFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetAssociationFirewallPolicyRequest} GetAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAssociationFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAssociationFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetAssociationFirewallPolicyRequest} GetAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAssociationFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAssociationFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAssociationFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; + + /** + * Creates a GetAssociationFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetAssociationFirewallPolicyRequest} GetAssociationFirewallPolicyRequest + */ + GetAssociationFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAssociationFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.GetAssociationFirewallPolicyRequest} message GetAssociationFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAssociationFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this GetAssociationFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetAssociationFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetAssociationFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetAssociationFirewallPolicyRequest; + })(); + + v1.GetIamPolicyFirewallPolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyFirewallPolicyRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyFirewallPolicyRequest optionsRequestedPolicyVersion + * @property {string|null} [resource] GetIamPolicyFirewallPolicyRequest resource + */ + + /** + * Constructs a new GetIamPolicyFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyFirewallPolicyRequest. + * @implements IGetIamPolicyFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyFirewallPolicyRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @instance + */ + GetIamPolicyFirewallPolicyRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyFirewallPolicyRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @instance + */ + GetIamPolicyFirewallPolicyRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyFirewallPolicyRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @instance + */ + Object.defineProperty(GetIamPolicyFirewallPolicyRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest} GetIamPolicyFirewallPolicyRequest instance + */ + GetIamPolicyFirewallPolicyRequest.create = function create(properties) { + return new GetIamPolicyFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest} message GetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest} message GetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest} GetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest} GetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest} GetIamPolicyFirewallPolicyRequest + */ + GetIamPolicyFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest} message GetIamPolicyFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyFirewallPolicyRequest; + })(); + + v1.GetRuleFirewallPolicyRequest = (function() { + + /** + * Properties of a GetRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRuleFirewallPolicyRequest + * @property {string|null} [firewallPolicy] GetRuleFirewallPolicyRequest firewallPolicy + * @property {number|null} [priority] GetRuleFirewallPolicyRequest priority + */ + + /** + * Constructs a new GetRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRuleFirewallPolicyRequest. + * @implements IGetRuleFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRuleFirewallPolicyRequest=} [properties] Properties to set + */ + function GetRuleFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRuleFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @instance + */ + GetRuleFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * GetRuleFirewallPolicyRequest priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @instance + */ + GetRuleFirewallPolicyRequest.prototype.priority = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetRuleFirewallPolicyRequest _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @instance + */ + Object.defineProperty(GetRuleFirewallPolicyRequest.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetRuleFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetRuleFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRuleFirewallPolicyRequest} GetRuleFirewallPolicyRequest instance + */ + GetRuleFirewallPolicyRequest.create = function create(properties) { + return new GetRuleFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified GetRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRuleFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetRuleFirewallPolicyRequest} message GetRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuleFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified GetRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRuleFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetRuleFirewallPolicyRequest} message GetRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuleFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRuleFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRuleFirewallPolicyRequest} GetRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuleFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRuleFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 445151652: + message.priority = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRuleFirewallPolicyRequest} GetRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuleFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRuleFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRuleFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + return null; + }; + + /** + * Creates a GetRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRuleFirewallPolicyRequest} GetRuleFirewallPolicyRequest + */ + GetRuleFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRuleFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRuleFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.priority != null) + message.priority = object.priority | 0; + return message; + }; + + /** + * Creates a plain object from a GetRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.GetRuleFirewallPolicyRequest} message GetRuleFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRuleFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this GetRuleFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRuleFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetRuleFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRuleFirewallPolicyRequest; + })(); + + v1.InsertFirewallPolicyRequest = (function() { + + /** + * Properties of an InsertFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertFirewallPolicyRequest + * @property {google.cloud.compute.v1.IFirewallPolicy|null} [firewallPolicyResource] InsertFirewallPolicyRequest firewallPolicyResource + * @property {string|null} [parentId] InsertFirewallPolicyRequest parentId + * @property {string|null} [requestId] InsertFirewallPolicyRequest requestId + */ + + /** + * Constructs a new InsertFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertFirewallPolicyRequest. + * @implements IInsertFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertFirewallPolicyRequest=} [properties] Properties to set + */ + function InsertFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertFirewallPolicyRequest firewallPolicyResource. + * @member {google.cloud.compute.v1.IFirewallPolicy|null|undefined} firewallPolicyResource + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @instance + */ + InsertFirewallPolicyRequest.prototype.firewallPolicyResource = null; + + /** + * InsertFirewallPolicyRequest parentId. + * @member {string|null|undefined} parentId + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @instance + */ + InsertFirewallPolicyRequest.prototype.parentId = null; + + /** + * InsertFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @instance + */ + InsertFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertFirewallPolicyRequest _parentId. + * @member {"parentId"|undefined} _parentId + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @instance + */ + Object.defineProperty(InsertFirewallPolicyRequest.prototype, "_parentId", { + get: $util.oneOfGetter($oneOfFields = ["parentId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InsertFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @instance + */ + Object.defineProperty(InsertFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertFirewallPolicyRequest} InsertFirewallPolicyRequest instance + */ + InsertFirewallPolicyRequest.create = function create(properties) { + return new InsertFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified InsertFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertFirewallPolicyRequest} message InsertFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.parentId != null && Object.hasOwnProperty.call(message, "parentId")) + writer.uint32(/* id 459714768, wireType 2 =*/3677718146).string(message.parentId); + if (message.firewallPolicyResource != null && Object.hasOwnProperty.call(message, "firewallPolicyResource")) + $root.google.cloud.compute.v1.FirewallPolicy.encode(message.firewallPolicyResource, writer.uint32(/* id 495049532, wireType 2 =*/3960396258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertFirewallPolicyRequest} message InsertFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertFirewallPolicyRequest} InsertFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 495049532: + message.firewallPolicyResource = $root.google.cloud.compute.v1.FirewallPolicy.decode(reader, reader.uint32()); + break; + case 459714768: + message.parentId = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertFirewallPolicyRequest} InsertFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicyResource != null && message.hasOwnProperty("firewallPolicyResource")) { + var error = $root.google.cloud.compute.v1.FirewallPolicy.verify(message.firewallPolicyResource); + if (error) + return "firewallPolicyResource." + error; + } + if (message.parentId != null && message.hasOwnProperty("parentId")) { + properties._parentId = 1; + if (!$util.isString(message.parentId)) + return "parentId: string expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertFirewallPolicyRequest} InsertFirewallPolicyRequest + */ + InsertFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertFirewallPolicyRequest(); + if (object.firewallPolicyResource != null) { + if (typeof object.firewallPolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertFirewallPolicyRequest.firewallPolicyResource: object expected"); + message.firewallPolicyResource = $root.google.cloud.compute.v1.FirewallPolicy.fromObject(object.firewallPolicyResource); + } + if (object.parentId != null) + message.parentId = String(object.parentId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.InsertFirewallPolicyRequest} message InsertFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicyResource = null; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.parentId != null && message.hasOwnProperty("parentId")) { + object.parentId = message.parentId; + if (options.oneofs) + object._parentId = "parentId"; + } + if (message.firewallPolicyResource != null && message.hasOwnProperty("firewallPolicyResource")) + object.firewallPolicyResource = $root.google.cloud.compute.v1.FirewallPolicy.toObject(message.firewallPolicyResource, options); + return object; + }; + + /** + * Converts this InsertFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertFirewallPolicyRequest; + })(); + + v1.ListFirewallPoliciesRequest = (function() { + + /** + * Properties of a ListFirewallPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListFirewallPoliciesRequest + * @property {string|null} [filter] ListFirewallPoliciesRequest filter + * @property {number|null} [maxResults] ListFirewallPoliciesRequest maxResults + * @property {string|null} [orderBy] ListFirewallPoliciesRequest orderBy + * @property {string|null} [pageToken] ListFirewallPoliciesRequest pageToken + * @property {string|null} [parentId] ListFirewallPoliciesRequest parentId + * @property {boolean|null} [returnPartialSuccess] ListFirewallPoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListFirewallPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListFirewallPoliciesRequest. + * @implements IListFirewallPoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IListFirewallPoliciesRequest=} [properties] Properties to set + */ + function ListFirewallPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFirewallPoliciesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + ListFirewallPoliciesRequest.prototype.filter = null; + + /** + * ListFirewallPoliciesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + ListFirewallPoliciesRequest.prototype.maxResults = null; + + /** + * ListFirewallPoliciesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + ListFirewallPoliciesRequest.prototype.orderBy = null; + + /** + * ListFirewallPoliciesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + ListFirewallPoliciesRequest.prototype.pageToken = null; + + /** + * ListFirewallPoliciesRequest parentId. + * @member {string|null|undefined} parentId + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + ListFirewallPoliciesRequest.prototype.parentId = null; + + /** + * ListFirewallPoliciesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + ListFirewallPoliciesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListFirewallPoliciesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + Object.defineProperty(ListFirewallPoliciesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallPoliciesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + Object.defineProperty(ListFirewallPoliciesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallPoliciesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + Object.defineProperty(ListFirewallPoliciesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallPoliciesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + Object.defineProperty(ListFirewallPoliciesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallPoliciesRequest _parentId. + * @member {"parentId"|undefined} _parentId + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + Object.defineProperty(ListFirewallPoliciesRequest.prototype, "_parentId", { + get: $util.oneOfGetter($oneOfFields = ["parentId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallPoliciesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + */ + Object.defineProperty(ListFirewallPoliciesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListFirewallPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListFirewallPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListFirewallPoliciesRequest} ListFirewallPoliciesRequest instance + */ + ListFirewallPoliciesRequest.create = function create(properties) { + return new ListFirewallPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListFirewallPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListFirewallPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListFirewallPoliciesRequest} message ListFirewallPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.parentId != null && Object.hasOwnProperty.call(message, "parentId")) + writer.uint32(/* id 459714768, wireType 2 =*/3677718146).string(message.parentId); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListFirewallPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListFirewallPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListFirewallPoliciesRequest} message ListFirewallPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFirewallPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListFirewallPoliciesRequest} ListFirewallPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListFirewallPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 459714768: + message.parentId = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFirewallPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListFirewallPoliciesRequest} ListFirewallPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFirewallPoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFirewallPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.parentId != null && message.hasOwnProperty("parentId")) { + properties._parentId = 1; + if (!$util.isString(message.parentId)) + return "parentId: string expected"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListFirewallPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListFirewallPoliciesRequest} ListFirewallPoliciesRequest + */ + ListFirewallPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListFirewallPoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListFirewallPoliciesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.parentId != null) + message.parentId = String(object.parentId); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListFirewallPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @static + * @param {google.cloud.compute.v1.ListFirewallPoliciesRequest} message ListFirewallPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFirewallPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.parentId != null && message.hasOwnProperty("parentId")) { + object.parentId = message.parentId; + if (options.oneofs) + object._parentId = "parentId"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListFirewallPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListFirewallPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListFirewallPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFirewallPoliciesRequest; + })(); + + v1.ListAssociationsFirewallPolicyRequest = (function() { + + /** + * Properties of a ListAssociationsFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IListAssociationsFirewallPolicyRequest + * @property {string|null} [targetResource] ListAssociationsFirewallPolicyRequest targetResource + */ + + /** + * Constructs a new ListAssociationsFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListAssociationsFirewallPolicyRequest. + * @implements IListAssociationsFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest=} [properties] Properties to set + */ + function ListAssociationsFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAssociationsFirewallPolicyRequest targetResource. + * @member {string|null|undefined} targetResource + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @instance + */ + ListAssociationsFirewallPolicyRequest.prototype.targetResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListAssociationsFirewallPolicyRequest _targetResource. + * @member {"targetResource"|undefined} _targetResource + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @instance + */ + Object.defineProperty(ListAssociationsFirewallPolicyRequest.prototype, "_targetResource", { + get: $util.oneOfGetter($oneOfFields = ["targetResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListAssociationsFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest} ListAssociationsFirewallPolicyRequest instance + */ + ListAssociationsFirewallPolicyRequest.create = function create(properties) { + return new ListAssociationsFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified ListAssociationsFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest} message ListAssociationsFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssociationsFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + writer.uint32(/* id 467318524, wireType 2 =*/3738548194).string(message.targetResource); + return writer; + }; + + /** + * Encodes the specified ListAssociationsFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest} message ListAssociationsFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssociationsFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssociationsFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest} ListAssociationsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssociationsFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 467318524: + message.targetResource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssociationsFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest} ListAssociationsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssociationsFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssociationsFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssociationsFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) { + properties._targetResource = 1; + if (!$util.isString(message.targetResource)) + return "targetResource: string expected"; + } + return null; + }; + + /** + * Creates a ListAssociationsFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest} ListAssociationsFirewallPolicyRequest + */ + ListAssociationsFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest(); + if (object.targetResource != null) + message.targetResource = String(object.targetResource); + return message; + }; + + /** + * Creates a plain object from a ListAssociationsFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest} message ListAssociationsFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssociationsFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) { + object.targetResource = message.targetResource; + if (options.oneofs) + object._targetResource = "targetResource"; + } + return object; + }; + + /** + * Converts this ListAssociationsFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssociationsFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAssociationsFirewallPolicyRequest; + })(); + + v1.MoveFirewallPolicyRequest = (function() { + + /** + * Properties of a MoveFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IMoveFirewallPolicyRequest + * @property {string|null} [firewallPolicy] MoveFirewallPolicyRequest firewallPolicy + * @property {string|null} [parentId] MoveFirewallPolicyRequest parentId + * @property {string|null} [requestId] MoveFirewallPolicyRequest requestId + */ + + /** + * Constructs a new MoveFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MoveFirewallPolicyRequest. + * @implements IMoveFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IMoveFirewallPolicyRequest=} [properties] Properties to set + */ + function MoveFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @instance + */ + MoveFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * MoveFirewallPolicyRequest parentId. + * @member {string|null|undefined} parentId + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @instance + */ + MoveFirewallPolicyRequest.prototype.parentId = null; + + /** + * MoveFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @instance + */ + MoveFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MoveFirewallPolicyRequest _parentId. + * @member {"parentId"|undefined} _parentId + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @instance + */ + Object.defineProperty(MoveFirewallPolicyRequest.prototype, "_parentId", { + get: $util.oneOfGetter($oneOfFields = ["parentId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MoveFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @instance + */ + Object.defineProperty(MoveFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MoveFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IMoveFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MoveFirewallPolicyRequest} MoveFirewallPolicyRequest instance + */ + MoveFirewallPolicyRequest.create = function create(properties) { + return new MoveFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified MoveFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.MoveFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IMoveFirewallPolicyRequest} message MoveFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.parentId != null && Object.hasOwnProperty.call(message, "parentId")) + writer.uint32(/* id 459714768, wireType 2 =*/3677718146).string(message.parentId); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified MoveFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MoveFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IMoveFirewallPolicyRequest} message MoveFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MoveFirewallPolicyRequest} MoveFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MoveFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 459714768: + message.parentId = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MoveFirewallPolicyRequest} MoveFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.parentId != null && message.hasOwnProperty("parentId")) { + properties._parentId = 1; + if (!$util.isString(message.parentId)) + return "parentId: string expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a MoveFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MoveFirewallPolicyRequest} MoveFirewallPolicyRequest + */ + MoveFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MoveFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.MoveFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.parentId != null) + message.parentId = String(object.parentId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a MoveFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.MoveFirewallPolicyRequest} message MoveFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.parentId != null && message.hasOwnProperty("parentId")) { + object.parentId = message.parentId; + if (options.oneofs) + object._parentId = "parentId"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this MoveFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MoveFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + MoveFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveFirewallPolicyRequest; + })(); + + v1.PatchFirewallPolicyRequest = (function() { + + /** + * Properties of a PatchFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchFirewallPolicyRequest + * @property {string|null} [firewallPolicy] PatchFirewallPolicyRequest firewallPolicy + * @property {google.cloud.compute.v1.IFirewallPolicy|null} [firewallPolicyResource] PatchFirewallPolicyRequest firewallPolicyResource + * @property {string|null} [requestId] PatchFirewallPolicyRequest requestId + */ + + /** + * Constructs a new PatchFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchFirewallPolicyRequest. + * @implements IPatchFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchFirewallPolicyRequest=} [properties] Properties to set + */ + function PatchFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @instance + */ + PatchFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * PatchFirewallPolicyRequest firewallPolicyResource. + * @member {google.cloud.compute.v1.IFirewallPolicy|null|undefined} firewallPolicyResource + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @instance + */ + PatchFirewallPolicyRequest.prototype.firewallPolicyResource = null; + + /** + * PatchFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @instance + */ + PatchFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @instance + */ + Object.defineProperty(PatchFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchFirewallPolicyRequest} PatchFirewallPolicyRequest instance + */ + PatchFirewallPolicyRequest.create = function create(properties) { + return new PatchFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified PatchFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchFirewallPolicyRequest} message PatchFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallPolicyResource != null && Object.hasOwnProperty.call(message, "firewallPolicyResource")) + $root.google.cloud.compute.v1.FirewallPolicy.encode(message.firewallPolicyResource, writer.uint32(/* id 495049532, wireType 2 =*/3960396258).fork()).ldelim(); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified PatchFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchFirewallPolicyRequest} message PatchFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchFirewallPolicyRequest} PatchFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 495049532: + message.firewallPolicyResource = $root.google.cloud.compute.v1.FirewallPolicy.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchFirewallPolicyRequest} PatchFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.firewallPolicyResource != null && message.hasOwnProperty("firewallPolicyResource")) { + var error = $root.google.cloud.compute.v1.FirewallPolicy.verify(message.firewallPolicyResource); + if (error) + return "firewallPolicyResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchFirewallPolicyRequest} PatchFirewallPolicyRequest + */ + PatchFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.firewallPolicyResource != null) { + if (typeof object.firewallPolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchFirewallPolicyRequest.firewallPolicyResource: object expected"); + message.firewallPolicyResource = $root.google.cloud.compute.v1.FirewallPolicy.fromObject(object.firewallPolicyResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.PatchFirewallPolicyRequest} message PatchFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firewallPolicyResource = null; + object.firewallPolicy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallPolicyResource != null && message.hasOwnProperty("firewallPolicyResource")) + object.firewallPolicyResource = $root.google.cloud.compute.v1.FirewallPolicy.toObject(message.firewallPolicyResource, options); + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this PatchFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchFirewallPolicyRequest; + })(); + + v1.PatchRuleFirewallPolicyRequest = (function() { + + /** + * Properties of a PatchRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRuleFirewallPolicyRequest + * @property {string|null} [firewallPolicy] PatchRuleFirewallPolicyRequest firewallPolicy + * @property {google.cloud.compute.v1.IFirewallPolicyRule|null} [firewallPolicyRuleResource] PatchRuleFirewallPolicyRequest firewallPolicyRuleResource + * @property {number|null} [priority] PatchRuleFirewallPolicyRequest priority + * @property {string|null} [requestId] PatchRuleFirewallPolicyRequest requestId + */ + + /** + * Constructs a new PatchRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRuleFirewallPolicyRequest. + * @implements IPatchRuleFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest=} [properties] Properties to set + */ + function PatchRuleFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRuleFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @instance + */ + PatchRuleFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * PatchRuleFirewallPolicyRequest firewallPolicyRuleResource. + * @member {google.cloud.compute.v1.IFirewallPolicyRule|null|undefined} firewallPolicyRuleResource + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @instance + */ + PatchRuleFirewallPolicyRequest.prototype.firewallPolicyRuleResource = null; + + /** + * PatchRuleFirewallPolicyRequest priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @instance + */ + PatchRuleFirewallPolicyRequest.prototype.priority = null; + + /** + * PatchRuleFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @instance + */ + PatchRuleFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRuleFirewallPolicyRequest _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @instance + */ + Object.defineProperty(PatchRuleFirewallPolicyRequest.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PatchRuleFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @instance + */ + Object.defineProperty(PatchRuleFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRuleFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRuleFirewallPolicyRequest} PatchRuleFirewallPolicyRequest instance + */ + PatchRuleFirewallPolicyRequest.create = function create(properties) { + return new PatchRuleFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified PatchRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRuleFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest} message PatchRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRuleFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallPolicyRuleResource != null && Object.hasOwnProperty.call(message, "firewallPolicyRuleResource")) + $root.google.cloud.compute.v1.FirewallPolicyRule.encode(message.firewallPolicyRuleResource, writer.uint32(/* id 250523523, wireType 2 =*/2004188186).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified PatchRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRuleFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest} message PatchRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRuleFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRuleFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRuleFirewallPolicyRequest} PatchRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRuleFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 250523523: + message.firewallPolicyRuleResource = $root.google.cloud.compute.v1.FirewallPolicyRule.decode(reader, reader.uint32()); + break; + case 445151652: + message.priority = reader.int32(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRuleFirewallPolicyRequest} PatchRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRuleFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRuleFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRuleFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.firewallPolicyRuleResource != null && message.hasOwnProperty("firewallPolicyRuleResource")) { + var error = $root.google.cloud.compute.v1.FirewallPolicyRule.verify(message.firewallPolicyRuleResource); + if (error) + return "firewallPolicyRuleResource." + error; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRuleFirewallPolicyRequest} PatchRuleFirewallPolicyRequest + */ + PatchRuleFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.firewallPolicyRuleResource != null) { + if (typeof object.firewallPolicyRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRuleFirewallPolicyRequest.firewallPolicyRuleResource: object expected"); + message.firewallPolicyRuleResource = $root.google.cloud.compute.v1.FirewallPolicyRule.fromObject(object.firewallPolicyRuleResource); + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.PatchRuleFirewallPolicyRequest} message PatchRuleFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRuleFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firewallPolicyRuleResource = null; + object.firewallPolicy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallPolicyRuleResource != null && message.hasOwnProperty("firewallPolicyRuleResource")) + object.firewallPolicyRuleResource = $root.google.cloud.compute.v1.FirewallPolicyRule.toObject(message.firewallPolicyRuleResource, options); + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this PatchRuleFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRuleFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRuleFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRuleFirewallPolicyRequest; + })(); + + v1.RemoveAssociationFirewallPolicyRequest = (function() { + + /** + * Properties of a RemoveAssociationFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveAssociationFirewallPolicyRequest + * @property {string|null} [firewallPolicy] RemoveAssociationFirewallPolicyRequest firewallPolicy + * @property {string|null} [name] RemoveAssociationFirewallPolicyRequest name + * @property {string|null} [requestId] RemoveAssociationFirewallPolicyRequest requestId + */ + + /** + * Constructs a new RemoveAssociationFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveAssociationFirewallPolicyRequest. + * @implements IRemoveAssociationFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest=} [properties] Properties to set + */ + function RemoveAssociationFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveAssociationFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @instance + */ + RemoveAssociationFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * RemoveAssociationFirewallPolicyRequest name. + * @member {string|null|undefined} name + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @instance + */ + RemoveAssociationFirewallPolicyRequest.prototype.name = null; + + /** + * RemoveAssociationFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @instance + */ + RemoveAssociationFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveAssociationFirewallPolicyRequest _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @instance + */ + Object.defineProperty(RemoveAssociationFirewallPolicyRequest.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RemoveAssociationFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @instance + */ + Object.defineProperty(RemoveAssociationFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveAssociationFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest} RemoveAssociationFirewallPolicyRequest instance + */ + RemoveAssociationFirewallPolicyRequest.create = function create(properties) { + return new RemoveAssociationFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified RemoveAssociationFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest} message RemoveAssociationFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveAssociationFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3373707, wireType 2 =*/26989658).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified RemoveAssociationFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest} message RemoveAssociationFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveAssociationFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveAssociationFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest} RemoveAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveAssociationFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 3373707: + message.name = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveAssociationFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest} RemoveAssociationFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveAssociationFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveAssociationFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveAssociationFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a RemoveAssociationFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest} RemoveAssociationFirewallPolicyRequest + */ + RemoveAssociationFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RemoveAssociationFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest} message RemoveAssociationFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveAssociationFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this RemoveAssociationFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveAssociationFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveAssociationFirewallPolicyRequest; + })(); + + v1.RemoveRuleFirewallPolicyRequest = (function() { + + /** + * Properties of a RemoveRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveRuleFirewallPolicyRequest + * @property {string|null} [firewallPolicy] RemoveRuleFirewallPolicyRequest firewallPolicy + * @property {number|null} [priority] RemoveRuleFirewallPolicyRequest priority + * @property {string|null} [requestId] RemoveRuleFirewallPolicyRequest requestId + */ + + /** + * Constructs a new RemoveRuleFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveRuleFirewallPolicyRequest. + * @implements IRemoveRuleFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest=} [properties] Properties to set + */ + function RemoveRuleFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveRuleFirewallPolicyRequest firewallPolicy. + * @member {string} firewallPolicy + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @instance + */ + RemoveRuleFirewallPolicyRequest.prototype.firewallPolicy = ""; + + /** + * RemoveRuleFirewallPolicyRequest priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @instance + */ + RemoveRuleFirewallPolicyRequest.prototype.priority = null; + + /** + * RemoveRuleFirewallPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @instance + */ + RemoveRuleFirewallPolicyRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveRuleFirewallPolicyRequest _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @instance + */ + Object.defineProperty(RemoveRuleFirewallPolicyRequest.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RemoveRuleFirewallPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @instance + */ + Object.defineProperty(RemoveRuleFirewallPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveRuleFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest} RemoveRuleFirewallPolicyRequest instance + */ + RemoveRuleFirewallPolicyRequest.create = function create(properties) { + return new RemoveRuleFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified RemoveRuleFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest} message RemoveRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveRuleFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + if (message.firewallPolicy != null && Object.hasOwnProperty.call(message, "firewallPolicy")) + writer.uint32(/* id 498173265, wireType 2 =*/3985386122).string(message.firewallPolicy); + return writer; + }; + + /** + * Encodes the specified RemoveRuleFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest} message RemoveRuleFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveRuleFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveRuleFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest} RemoveRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveRuleFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 498173265: + message.firewallPolicy = reader.string(); + break; + case 445151652: + message.priority = reader.int32(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveRuleFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest} RemoveRuleFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveRuleFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveRuleFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveRuleFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + if (!$util.isString(message.firewallPolicy)) + return "firewallPolicy: string expected"; + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a RemoveRuleFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest} RemoveRuleFirewallPolicyRequest + */ + RemoveRuleFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest(); + if (object.firewallPolicy != null) + message.firewallPolicy = String(object.firewallPolicy); + if (object.priority != null) + message.priority = object.priority | 0; + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RemoveRuleFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest} message RemoveRuleFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveRuleFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.firewallPolicy = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + if (message.firewallPolicy != null && message.hasOwnProperty("firewallPolicy")) + object.firewallPolicy = message.firewallPolicy; + return object; + }; + + /** + * Converts this RemoveRuleFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveRuleFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveRuleFirewallPolicyRequest; + })(); + + v1.SetIamPolicyFirewallPolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyFirewallPolicyRequest + * @property {google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest|null} [globalOrganizationSetPolicyRequestResource] SetIamPolicyFirewallPolicyRequest globalOrganizationSetPolicyRequestResource + * @property {string|null} [resource] SetIamPolicyFirewallPolicyRequest resource + */ + + /** + * Constructs a new SetIamPolicyFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyFirewallPolicyRequest. + * @implements ISetIamPolicyFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyFirewallPolicyRequest globalOrganizationSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IGlobalOrganizationSetPolicyRequest|null|undefined} globalOrganizationSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @instance + */ + SetIamPolicyFirewallPolicyRequest.prototype.globalOrganizationSetPolicyRequestResource = null; + + /** + * SetIamPolicyFirewallPolicyRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @instance + */ + SetIamPolicyFirewallPolicyRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicyFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest} SetIamPolicyFirewallPolicyRequest instance + */ + SetIamPolicyFirewallPolicyRequest.create = function create(properties) { + return new SetIamPolicyFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest} message SetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.globalOrganizationSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "globalOrganizationSetPolicyRequestResource")) + $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.encode(message.globalOrganizationSetPolicyRequestResource, writer.uint32(/* id 177408606, wireType 2 =*/1419268850).fork()).ldelim(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest} message SetIamPolicyFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest} SetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 177408606: + message.globalOrganizationSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest} SetIamPolicyFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyFirewallPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalOrganizationSetPolicyRequestResource != null && message.hasOwnProperty("globalOrganizationSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.verify(message.globalOrganizationSetPolicyRequestResource); + if (error) + return "globalOrganizationSetPolicyRequestResource." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicyFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest} SetIamPolicyFirewallPolicyRequest + */ + SetIamPolicyFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest(); + if (object.globalOrganizationSetPolicyRequestResource != null) { + if (typeof object.globalOrganizationSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest.globalOrganizationSetPolicyRequestResource: object expected"); + message.globalOrganizationSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.fromObject(object.globalOrganizationSetPolicyRequestResource); + } + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest} message SetIamPolicyFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.globalOrganizationSetPolicyRequestResource = null; + object.resource = ""; + } + if (message.globalOrganizationSetPolicyRequestResource != null && message.hasOwnProperty("globalOrganizationSetPolicyRequestResource")) + object.globalOrganizationSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest.toObject(message.globalOrganizationSetPolicyRequestResource, options); + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + return object; + }; + + /** + * Converts this SetIamPolicyFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyFirewallPolicyRequest; + })(); + + v1.TestIamPermissionsFirewallPolicyRequest = (function() { + + /** + * Properties of a TestIamPermissionsFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsFirewallPolicyRequest + * @property {string|null} [resource] TestIamPermissionsFirewallPolicyRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsFirewallPolicyRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsFirewallPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsFirewallPolicyRequest. + * @implements ITestIamPermissionsFirewallPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest=} [properties] Properties to set + */ + function TestIamPermissionsFirewallPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsFirewallPolicyRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @instance + */ + TestIamPermissionsFirewallPolicyRequest.prototype.resource = ""; + + /** + * TestIamPermissionsFirewallPolicyRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @instance + */ + TestIamPermissionsFirewallPolicyRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsFirewallPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest} TestIamPermissionsFirewallPolicyRequest instance + */ + TestIamPermissionsFirewallPolicyRequest.create = function create(properties) { + return new TestIamPermissionsFirewallPolicyRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest} message TestIamPermissionsFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsFirewallPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest} message TestIamPermissionsFirewallPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsFirewallPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsFirewallPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest} TestIamPermissionsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsFirewallPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest} TestIamPermissionsFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsFirewallPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsFirewallPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsFirewallPolicyRequest.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.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest} TestIamPermissionsFirewallPolicyRequest + */ + TestIamPermissionsFirewallPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsFirewallPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest} message TestIamPermissionsFirewallPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsFirewallPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.testPermissionsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsFirewallPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsFirewallPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsFirewallPolicyRequest; + })(); + + v1.DeleteFirewallRequest = (function() { + + /** + * Properties of a DeleteFirewallRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteFirewallRequest + * @property {string|null} [firewall] DeleteFirewallRequest firewall + * @property {string|null} [project] DeleteFirewallRequest project + * @property {string|null} [requestId] DeleteFirewallRequest requestId + */ + + /** + * Constructs a new DeleteFirewallRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteFirewallRequest. + * @implements IDeleteFirewallRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteFirewallRequest=} [properties] Properties to set + */ + function DeleteFirewallRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFirewallRequest firewall. + * @member {string} firewall + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @instance + */ + DeleteFirewallRequest.prototype.firewall = ""; + + /** + * DeleteFirewallRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @instance + */ + DeleteFirewallRequest.prototype.project = ""; + + /** + * DeleteFirewallRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @instance + */ + DeleteFirewallRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteFirewallRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @instance + */ + Object.defineProperty(DeleteFirewallRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteFirewallRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {google.cloud.compute.v1.IDeleteFirewallRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteFirewallRequest} DeleteFirewallRequest instance + */ + DeleteFirewallRequest.create = function create(properties) { + return new DeleteFirewallRequest(properties); + }; + + /** + * Encodes the specified DeleteFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {google.cloud.compute.v1.IDeleteFirewallRequest} message DeleteFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.firewall != null && Object.hasOwnProperty.call(message, "firewall")) + writer.uint32(/* id 511016192, wireType 2 =*/4088129538).string(message.firewall); + return writer; + }; + + /** + * Encodes the specified DeleteFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteFirewallRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {google.cloud.compute.v1.IDeleteFirewallRequest} message DeleteFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFirewallRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFirewallRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteFirewallRequest} DeleteFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteFirewallRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 511016192: + message.firewall = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFirewallRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteFirewallRequest} DeleteFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFirewallRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFirewallRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFirewallRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewall != null && message.hasOwnProperty("firewall")) + if (!$util.isString(message.firewall)) + return "firewall: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteFirewallRequest} DeleteFirewallRequest + */ + DeleteFirewallRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteFirewallRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteFirewallRequest(); + if (object.firewall != null) + message.firewall = String(object.firewall); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteFirewallRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @static + * @param {google.cloud.compute.v1.DeleteFirewallRequest} message DeleteFirewallRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFirewallRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.firewall = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.firewall != null && message.hasOwnProperty("firewall")) + object.firewall = message.firewall; + return object; + }; + + /** + * Converts this DeleteFirewallRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteFirewallRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFirewallRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteFirewallRequest; + })(); + + v1.GetFirewallRequest = (function() { + + /** + * Properties of a GetFirewallRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetFirewallRequest + * @property {string|null} [firewall] GetFirewallRequest firewall + * @property {string|null} [project] GetFirewallRequest project + */ + + /** + * Constructs a new GetFirewallRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetFirewallRequest. + * @implements IGetFirewallRequest + * @constructor + * @param {google.cloud.compute.v1.IGetFirewallRequest=} [properties] Properties to set + */ + function GetFirewallRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFirewallRequest firewall. + * @member {string} firewall + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @instance + */ + GetFirewallRequest.prototype.firewall = ""; + + /** + * GetFirewallRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @instance + */ + GetFirewallRequest.prototype.project = ""; + + /** + * Creates a new GetFirewallRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {google.cloud.compute.v1.IGetFirewallRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetFirewallRequest} GetFirewallRequest instance + */ + GetFirewallRequest.create = function create(properties) { + return new GetFirewallRequest(properties); + }; + + /** + * Encodes the specified GetFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.GetFirewallRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {google.cloud.compute.v1.IGetFirewallRequest} message GetFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.firewall != null && Object.hasOwnProperty.call(message, "firewall")) + writer.uint32(/* id 511016192, wireType 2 =*/4088129538).string(message.firewall); + return writer; + }; + + /** + * Encodes the specified GetFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetFirewallRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {google.cloud.compute.v1.IGetFirewallRequest} message GetFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFirewallRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFirewallRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetFirewallRequest} GetFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetFirewallRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 511016192: + message.firewall = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFirewallRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetFirewallRequest} GetFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFirewallRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFirewallRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFirewallRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firewall != null && message.hasOwnProperty("firewall")) + if (!$util.isString(message.firewall)) + return "firewall: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetFirewallRequest} GetFirewallRequest + */ + GetFirewallRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetFirewallRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetFirewallRequest(); + if (object.firewall != null) + message.firewall = String(object.firewall); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetFirewallRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @static + * @param {google.cloud.compute.v1.GetFirewallRequest} message GetFirewallRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFirewallRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.firewall = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.firewall != null && message.hasOwnProperty("firewall")) + object.firewall = message.firewall; + return object; + }; + + /** + * Converts this GetFirewallRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetFirewallRequest + * @instance + * @returns {Object.} JSON object + */ + GetFirewallRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetFirewallRequest; + })(); + + v1.InsertFirewallRequest = (function() { + + /** + * Properties of an InsertFirewallRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertFirewallRequest + * @property {google.cloud.compute.v1.IFirewall|null} [firewallResource] InsertFirewallRequest firewallResource + * @property {string|null} [project] InsertFirewallRequest project + * @property {string|null} [requestId] InsertFirewallRequest requestId + */ + + /** + * Constructs a new InsertFirewallRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertFirewallRequest. + * @implements IInsertFirewallRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertFirewallRequest=} [properties] Properties to set + */ + function InsertFirewallRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertFirewallRequest firewallResource. + * @member {google.cloud.compute.v1.IFirewall|null|undefined} firewallResource + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @instance + */ + InsertFirewallRequest.prototype.firewallResource = null; + + /** + * InsertFirewallRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @instance + */ + InsertFirewallRequest.prototype.project = ""; + + /** + * InsertFirewallRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @instance + */ + InsertFirewallRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertFirewallRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @instance + */ + Object.defineProperty(InsertFirewallRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertFirewallRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {google.cloud.compute.v1.IInsertFirewallRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertFirewallRequest} InsertFirewallRequest instance + */ + InsertFirewallRequest.create = function create(properties) { + return new InsertFirewallRequest(properties); + }; + + /** + * Encodes the specified InsertFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {google.cloud.compute.v1.IInsertFirewallRequest} message InsertFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertFirewallRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallResource != null && Object.hasOwnProperty.call(message, "firewallResource")) + $root.google.cloud.compute.v1.Firewall.encode(message.firewallResource, writer.uint32(/* id 41425005, wireType 2 =*/331400042).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertFirewallRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {google.cloud.compute.v1.IInsertFirewallRequest} message InsertFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertFirewallRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertFirewallRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertFirewallRequest} InsertFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertFirewallRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertFirewallRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 41425005: + message.firewallResource = $root.google.cloud.compute.v1.Firewall.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertFirewallRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertFirewallRequest} InsertFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertFirewallRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertFirewallRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertFirewallRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewallResource != null && message.hasOwnProperty("firewallResource")) { + var error = $root.google.cloud.compute.v1.Firewall.verify(message.firewallResource); + if (error) + return "firewallResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertFirewallRequest} InsertFirewallRequest + */ + InsertFirewallRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertFirewallRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertFirewallRequest(); + if (object.firewallResource != null) { + if (typeof object.firewallResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertFirewallRequest.firewallResource: object expected"); + message.firewallResource = $root.google.cloud.compute.v1.Firewall.fromObject(object.firewallResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertFirewallRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @static + * @param {google.cloud.compute.v1.InsertFirewallRequest} message InsertFirewallRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertFirewallRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firewallResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallResource != null && message.hasOwnProperty("firewallResource")) + object.firewallResource = $root.google.cloud.compute.v1.Firewall.toObject(message.firewallResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertFirewallRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertFirewallRequest + * @instance + * @returns {Object.} JSON object + */ + InsertFirewallRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertFirewallRequest; + })(); + + v1.ListFirewallsRequest = (function() { + + /** + * Properties of a ListFirewallsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListFirewallsRequest + * @property {string|null} [filter] ListFirewallsRequest filter + * @property {number|null} [maxResults] ListFirewallsRequest maxResults + * @property {string|null} [orderBy] ListFirewallsRequest orderBy + * @property {string|null} [pageToken] ListFirewallsRequest pageToken + * @property {string|null} [project] ListFirewallsRequest project + * @property {boolean|null} [returnPartialSuccess] ListFirewallsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListFirewallsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListFirewallsRequest. + * @implements IListFirewallsRequest + * @constructor + * @param {google.cloud.compute.v1.IListFirewallsRequest=} [properties] Properties to set + */ + function ListFirewallsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFirewallsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + ListFirewallsRequest.prototype.filter = null; + + /** + * ListFirewallsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + ListFirewallsRequest.prototype.maxResults = null; + + /** + * ListFirewallsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + ListFirewallsRequest.prototype.orderBy = null; + + /** + * ListFirewallsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + ListFirewallsRequest.prototype.pageToken = null; + + /** + * ListFirewallsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + ListFirewallsRequest.prototype.project = ""; + + /** + * ListFirewallsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + ListFirewallsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListFirewallsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + Object.defineProperty(ListFirewallsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + Object.defineProperty(ListFirewallsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + Object.defineProperty(ListFirewallsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + Object.defineProperty(ListFirewallsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListFirewallsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + */ + Object.defineProperty(ListFirewallsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListFirewallsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {google.cloud.compute.v1.IListFirewallsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListFirewallsRequest} ListFirewallsRequest instance + */ + ListFirewallsRequest.create = function create(properties) { + return new ListFirewallsRequest(properties); + }; + + /** + * Encodes the specified ListFirewallsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListFirewallsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {google.cloud.compute.v1.IListFirewallsRequest} message ListFirewallsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListFirewallsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListFirewallsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {google.cloud.compute.v1.IListFirewallsRequest} message ListFirewallsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFirewallsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFirewallsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListFirewallsRequest} ListFirewallsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListFirewallsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFirewallsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListFirewallsRequest} ListFirewallsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFirewallsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFirewallsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFirewallsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListFirewallsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListFirewallsRequest} ListFirewallsRequest + */ + ListFirewallsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListFirewallsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListFirewallsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListFirewallsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @static + * @param {google.cloud.compute.v1.ListFirewallsRequest} message ListFirewallsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFirewallsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListFirewallsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListFirewallsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFirewallsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListFirewallsRequest; + })(); + + v1.PatchFirewallRequest = (function() { + + /** + * Properties of a PatchFirewallRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchFirewallRequest + * @property {string|null} [firewall] PatchFirewallRequest firewall + * @property {google.cloud.compute.v1.IFirewall|null} [firewallResource] PatchFirewallRequest firewallResource + * @property {string|null} [project] PatchFirewallRequest project + * @property {string|null} [requestId] PatchFirewallRequest requestId + */ + + /** + * Constructs a new PatchFirewallRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchFirewallRequest. + * @implements IPatchFirewallRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchFirewallRequest=} [properties] Properties to set + */ + function PatchFirewallRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchFirewallRequest firewall. + * @member {string} firewall + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @instance + */ + PatchFirewallRequest.prototype.firewall = ""; + + /** + * PatchFirewallRequest firewallResource. + * @member {google.cloud.compute.v1.IFirewall|null|undefined} firewallResource + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @instance + */ + PatchFirewallRequest.prototype.firewallResource = null; + + /** + * PatchFirewallRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @instance + */ + PatchFirewallRequest.prototype.project = ""; + + /** + * PatchFirewallRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @instance + */ + PatchFirewallRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchFirewallRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @instance + */ + Object.defineProperty(PatchFirewallRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchFirewallRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {google.cloud.compute.v1.IPatchFirewallRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchFirewallRequest} PatchFirewallRequest instance + */ + PatchFirewallRequest.create = function create(properties) { + return new PatchFirewallRequest(properties); + }; + + /** + * Encodes the specified PatchFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {google.cloud.compute.v1.IPatchFirewallRequest} message PatchFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchFirewallRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallResource != null && Object.hasOwnProperty.call(message, "firewallResource")) + $root.google.cloud.compute.v1.Firewall.encode(message.firewallResource, writer.uint32(/* id 41425005, wireType 2 =*/331400042).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.firewall != null && Object.hasOwnProperty.call(message, "firewall")) + writer.uint32(/* id 511016192, wireType 2 =*/4088129538).string(message.firewall); + return writer; + }; + + /** + * Encodes the specified PatchFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchFirewallRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {google.cloud.compute.v1.IPatchFirewallRequest} message PatchFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchFirewallRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchFirewallRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchFirewallRequest} PatchFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchFirewallRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchFirewallRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 511016192: + message.firewall = reader.string(); + break; + case 41425005: + message.firewallResource = $root.google.cloud.compute.v1.Firewall.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchFirewallRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchFirewallRequest} PatchFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchFirewallRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchFirewallRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchFirewallRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewall != null && message.hasOwnProperty("firewall")) + if (!$util.isString(message.firewall)) + return "firewall: string expected"; + if (message.firewallResource != null && message.hasOwnProperty("firewallResource")) { + var error = $root.google.cloud.compute.v1.Firewall.verify(message.firewallResource); + if (error) + return "firewallResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchFirewallRequest} PatchFirewallRequest + */ + PatchFirewallRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchFirewallRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchFirewallRequest(); + if (object.firewall != null) + message.firewall = String(object.firewall); + if (object.firewallResource != null) { + if (typeof object.firewallResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchFirewallRequest.firewallResource: object expected"); + message.firewallResource = $root.google.cloud.compute.v1.Firewall.fromObject(object.firewallResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchFirewallRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @static + * @param {google.cloud.compute.v1.PatchFirewallRequest} message PatchFirewallRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchFirewallRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firewallResource = null; + object.project = ""; + object.firewall = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallResource != null && message.hasOwnProperty("firewallResource")) + object.firewallResource = $root.google.cloud.compute.v1.Firewall.toObject(message.firewallResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.firewall != null && message.hasOwnProperty("firewall")) + object.firewall = message.firewall; + return object; + }; + + /** + * Converts this PatchFirewallRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchFirewallRequest + * @instance + * @returns {Object.} JSON object + */ + PatchFirewallRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchFirewallRequest; + })(); + + v1.UpdateFirewallRequest = (function() { + + /** + * Properties of an UpdateFirewallRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateFirewallRequest + * @property {string|null} [firewall] UpdateFirewallRequest firewall + * @property {google.cloud.compute.v1.IFirewall|null} [firewallResource] UpdateFirewallRequest firewallResource + * @property {string|null} [project] UpdateFirewallRequest project + * @property {string|null} [requestId] UpdateFirewallRequest requestId + */ + + /** + * Constructs a new UpdateFirewallRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateFirewallRequest. + * @implements IUpdateFirewallRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateFirewallRequest=} [properties] Properties to set + */ + function UpdateFirewallRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFirewallRequest firewall. + * @member {string} firewall + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @instance + */ + UpdateFirewallRequest.prototype.firewall = ""; + + /** + * UpdateFirewallRequest firewallResource. + * @member {google.cloud.compute.v1.IFirewall|null|undefined} firewallResource + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @instance + */ + UpdateFirewallRequest.prototype.firewallResource = null; + + /** + * UpdateFirewallRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @instance + */ + UpdateFirewallRequest.prototype.project = ""; + + /** + * UpdateFirewallRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @instance + */ + UpdateFirewallRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateFirewallRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @instance + */ + Object.defineProperty(UpdateFirewallRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateFirewallRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {google.cloud.compute.v1.IUpdateFirewallRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateFirewallRequest} UpdateFirewallRequest instance + */ + UpdateFirewallRequest.create = function create(properties) { + return new UpdateFirewallRequest(properties); + }; + + /** + * Encodes the specified UpdateFirewallRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateFirewallRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {google.cloud.compute.v1.IUpdateFirewallRequest} message UpdateFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFirewallRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.firewallResource != null && Object.hasOwnProperty.call(message, "firewallResource")) + $root.google.cloud.compute.v1.Firewall.encode(message.firewallResource, writer.uint32(/* id 41425005, wireType 2 =*/331400042).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.firewall != null && Object.hasOwnProperty.call(message, "firewall")) + writer.uint32(/* id 511016192, wireType 2 =*/4088129538).string(message.firewall); + return writer; + }; + + /** + * Encodes the specified UpdateFirewallRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateFirewallRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {google.cloud.compute.v1.IUpdateFirewallRequest} message UpdateFirewallRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFirewallRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFirewallRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateFirewallRequest} UpdateFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFirewallRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateFirewallRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 511016192: + message.firewall = reader.string(); + break; + case 41425005: + message.firewallResource = $root.google.cloud.compute.v1.Firewall.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFirewallRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateFirewallRequest} UpdateFirewallRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFirewallRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFirewallRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFirewallRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.firewall != null && message.hasOwnProperty("firewall")) + if (!$util.isString(message.firewall)) + return "firewall: string expected"; + if (message.firewallResource != null && message.hasOwnProperty("firewallResource")) { + var error = $root.google.cloud.compute.v1.Firewall.verify(message.firewallResource); + if (error) + return "firewallResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdateFirewallRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateFirewallRequest} UpdateFirewallRequest + */ + UpdateFirewallRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateFirewallRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateFirewallRequest(); + if (object.firewall != null) + message.firewall = String(object.firewall); + if (object.firewallResource != null) { + if (typeof object.firewallResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateFirewallRequest.firewallResource: object expected"); + message.firewallResource = $root.google.cloud.compute.v1.Firewall.fromObject(object.firewallResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateFirewallRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @static + * @param {google.cloud.compute.v1.UpdateFirewallRequest} message UpdateFirewallRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFirewallRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firewallResource = null; + object.project = ""; + object.firewall = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.firewallResource != null && message.hasOwnProperty("firewallResource")) + object.firewallResource = $root.google.cloud.compute.v1.Firewall.toObject(message.firewallResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.firewall != null && message.hasOwnProperty("firewall")) + object.firewall = message.firewall; + return object; + }; + + /** + * Converts this UpdateFirewallRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateFirewallRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFirewallRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateFirewallRequest; + })(); + + v1.AggregatedListForwardingRulesRequest = (function() { + + /** + * Properties of an AggregatedListForwardingRulesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListForwardingRulesRequest + * @property {string|null} [filter] AggregatedListForwardingRulesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListForwardingRulesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListForwardingRulesRequest maxResults + * @property {string|null} [orderBy] AggregatedListForwardingRulesRequest orderBy + * @property {string|null} [pageToken] AggregatedListForwardingRulesRequest pageToken + * @property {string|null} [project] AggregatedListForwardingRulesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListForwardingRulesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListForwardingRulesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListForwardingRulesRequest. + * @implements IAggregatedListForwardingRulesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListForwardingRulesRequest=} [properties] Properties to set + */ + function AggregatedListForwardingRulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListForwardingRulesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + AggregatedListForwardingRulesRequest.prototype.filter = null; + + /** + * AggregatedListForwardingRulesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + AggregatedListForwardingRulesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListForwardingRulesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + AggregatedListForwardingRulesRequest.prototype.maxResults = null; + + /** + * AggregatedListForwardingRulesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + AggregatedListForwardingRulesRequest.prototype.orderBy = null; + + /** + * AggregatedListForwardingRulesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + AggregatedListForwardingRulesRequest.prototype.pageToken = null; + + /** + * AggregatedListForwardingRulesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + AggregatedListForwardingRulesRequest.prototype.project = ""; + + /** + * AggregatedListForwardingRulesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + AggregatedListForwardingRulesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListForwardingRulesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + Object.defineProperty(AggregatedListForwardingRulesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListForwardingRulesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + Object.defineProperty(AggregatedListForwardingRulesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListForwardingRulesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + Object.defineProperty(AggregatedListForwardingRulesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListForwardingRulesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + Object.defineProperty(AggregatedListForwardingRulesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListForwardingRulesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + Object.defineProperty(AggregatedListForwardingRulesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListForwardingRulesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + */ + Object.defineProperty(AggregatedListForwardingRulesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListForwardingRulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListForwardingRulesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListForwardingRulesRequest} AggregatedListForwardingRulesRequest instance + */ + AggregatedListForwardingRulesRequest.create = function create(properties) { + return new AggregatedListForwardingRulesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListForwardingRulesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListForwardingRulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListForwardingRulesRequest} message AggregatedListForwardingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListForwardingRulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListForwardingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListForwardingRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListForwardingRulesRequest} message AggregatedListForwardingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListForwardingRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListForwardingRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListForwardingRulesRequest} AggregatedListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListForwardingRulesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListForwardingRulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListForwardingRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListForwardingRulesRequest} AggregatedListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListForwardingRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListForwardingRulesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListForwardingRulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListForwardingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListForwardingRulesRequest} AggregatedListForwardingRulesRequest + */ + AggregatedListForwardingRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListForwardingRulesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListForwardingRulesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListForwardingRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListForwardingRulesRequest} message AggregatedListForwardingRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListForwardingRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListForwardingRulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListForwardingRulesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListForwardingRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListForwardingRulesRequest; + })(); + + v1.DeleteForwardingRuleRequest = (function() { + + /** + * Properties of a DeleteForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteForwardingRuleRequest + * @property {string|null} [forwardingRule] DeleteForwardingRuleRequest forwardingRule + * @property {string|null} [project] DeleteForwardingRuleRequest project + * @property {string|null} [region] DeleteForwardingRuleRequest region + * @property {string|null} [requestId] DeleteForwardingRuleRequest requestId + */ + + /** + * Constructs a new DeleteForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteForwardingRuleRequest. + * @implements IDeleteForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteForwardingRuleRequest=} [properties] Properties to set + */ + function DeleteForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @instance + */ + DeleteForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * DeleteForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @instance + */ + DeleteForwardingRuleRequest.prototype.project = ""; + + /** + * DeleteForwardingRuleRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @instance + */ + DeleteForwardingRuleRequest.prototype.region = ""; + + /** + * DeleteForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @instance + */ + DeleteForwardingRuleRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @instance + */ + Object.defineProperty(DeleteForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IDeleteForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteForwardingRuleRequest} DeleteForwardingRuleRequest instance + */ + DeleteForwardingRuleRequest.create = function create(properties) { + return new DeleteForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified DeleteForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IDeleteForwardingRuleRequest} message DeleteForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + return writer; + }; + + /** + * Encodes the specified DeleteForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IDeleteForwardingRuleRequest} message DeleteForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteForwardingRuleRequest} DeleteForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteForwardingRuleRequest} DeleteForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteForwardingRuleRequest} DeleteForwardingRuleRequest + */ + DeleteForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.DeleteForwardingRuleRequest} message DeleteForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.forwardingRule = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + return object; + }; + + /** + * Converts this DeleteForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteForwardingRuleRequest; + })(); + + v1.GetForwardingRuleRequest = (function() { + + /** + * Properties of a GetForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetForwardingRuleRequest + * @property {string|null} [forwardingRule] GetForwardingRuleRequest forwardingRule + * @property {string|null} [project] GetForwardingRuleRequest project + * @property {string|null} [region] GetForwardingRuleRequest region + */ + + /** + * Constructs a new GetForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetForwardingRuleRequest. + * @implements IGetForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IGetForwardingRuleRequest=} [properties] Properties to set + */ + function GetForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @instance + */ + GetForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * GetForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @instance + */ + GetForwardingRuleRequest.prototype.project = ""; + + /** + * GetForwardingRuleRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @instance + */ + GetForwardingRuleRequest.prototype.region = ""; + + /** + * Creates a new GetForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IGetForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetForwardingRuleRequest} GetForwardingRuleRequest instance + */ + GetForwardingRuleRequest.create = function create(properties) { + return new GetForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified GetForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.GetForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IGetForwardingRuleRequest} message GetForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + return writer; + }; + + /** + * Encodes the specified GetForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IGetForwardingRuleRequest} message GetForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetForwardingRuleRequest} GetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetForwardingRuleRequest} GetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetForwardingRuleRequest} GetForwardingRuleRequest + */ + GetForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.GetForwardingRuleRequest} message GetForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.forwardingRule = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + return object; + }; + + /** + * Converts this GetForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetForwardingRuleRequest; + })(); + + v1.InsertForwardingRuleRequest = (function() { + + /** + * Properties of an InsertForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertForwardingRuleRequest + * @property {google.cloud.compute.v1.IForwardingRule|null} [forwardingRuleResource] InsertForwardingRuleRequest forwardingRuleResource + * @property {string|null} [project] InsertForwardingRuleRequest project + * @property {string|null} [region] InsertForwardingRuleRequest region + * @property {string|null} [requestId] InsertForwardingRuleRequest requestId + */ + + /** + * Constructs a new InsertForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertForwardingRuleRequest. + * @implements IInsertForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertForwardingRuleRequest=} [properties] Properties to set + */ + function InsertForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertForwardingRuleRequest forwardingRuleResource. + * @member {google.cloud.compute.v1.IForwardingRule|null|undefined} forwardingRuleResource + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @instance + */ + InsertForwardingRuleRequest.prototype.forwardingRuleResource = null; + + /** + * InsertForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @instance + */ + InsertForwardingRuleRequest.prototype.project = ""; + + /** + * InsertForwardingRuleRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @instance + */ + InsertForwardingRuleRequest.prototype.region = ""; + + /** + * InsertForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @instance + */ + InsertForwardingRuleRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @instance + */ + Object.defineProperty(InsertForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IInsertForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertForwardingRuleRequest} InsertForwardingRuleRequest instance + */ + InsertForwardingRuleRequest.create = function create(properties) { + return new InsertForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified InsertForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IInsertForwardingRuleRequest} message InsertForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRuleResource != null && Object.hasOwnProperty.call(message, "forwardingRuleResource")) + $root.google.cloud.compute.v1.ForwardingRule.encode(message.forwardingRuleResource, writer.uint32(/* id 301211695, wireType 2 =*/2409693562).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IInsertForwardingRuleRequest} message InsertForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertForwardingRuleRequest} InsertForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 301211695: + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertForwardingRuleRequest} InsertForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) { + var error = $root.google.cloud.compute.v1.ForwardingRule.verify(message.forwardingRuleResource); + if (error) + return "forwardingRuleResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertForwardingRuleRequest} InsertForwardingRuleRequest + */ + InsertForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertForwardingRuleRequest(); + if (object.forwardingRuleResource != null) { + if (typeof object.forwardingRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertForwardingRuleRequest.forwardingRuleResource: object expected"); + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.fromObject(object.forwardingRuleResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.InsertForwardingRuleRequest} message InsertForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.forwardingRuleResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) + object.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.toObject(message.forwardingRuleResource, options); + return object; + }; + + /** + * Converts this InsertForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + InsertForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertForwardingRuleRequest; + })(); + + v1.ListForwardingRulesRequest = (function() { + + /** + * Properties of a ListForwardingRulesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListForwardingRulesRequest + * @property {string|null} [filter] ListForwardingRulesRequest filter + * @property {number|null} [maxResults] ListForwardingRulesRequest maxResults + * @property {string|null} [orderBy] ListForwardingRulesRequest orderBy + * @property {string|null} [pageToken] ListForwardingRulesRequest pageToken + * @property {string|null} [project] ListForwardingRulesRequest project + * @property {string|null} [region] ListForwardingRulesRequest region + * @property {boolean|null} [returnPartialSuccess] ListForwardingRulesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListForwardingRulesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListForwardingRulesRequest. + * @implements IListForwardingRulesRequest + * @constructor + * @param {google.cloud.compute.v1.IListForwardingRulesRequest=} [properties] Properties to set + */ + function ListForwardingRulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListForwardingRulesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + ListForwardingRulesRequest.prototype.filter = null; + + /** + * ListForwardingRulesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + ListForwardingRulesRequest.prototype.maxResults = null; + + /** + * ListForwardingRulesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + ListForwardingRulesRequest.prototype.orderBy = null; + + /** + * ListForwardingRulesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + ListForwardingRulesRequest.prototype.pageToken = null; + + /** + * ListForwardingRulesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + ListForwardingRulesRequest.prototype.project = ""; + + /** + * ListForwardingRulesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + ListForwardingRulesRequest.prototype.region = ""; + + /** + * ListForwardingRulesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + ListForwardingRulesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListForwardingRulesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListForwardingRulesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListForwardingRulesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListForwardingRulesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListForwardingRulesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListForwardingRulesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListForwardingRulesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListForwardingRulesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListForwardingRulesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListForwardingRulesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListForwardingRulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IListForwardingRulesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListForwardingRulesRequest} ListForwardingRulesRequest instance + */ + ListForwardingRulesRequest.create = function create(properties) { + return new ListForwardingRulesRequest(properties); + }; + + /** + * Encodes the specified ListForwardingRulesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListForwardingRulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IListForwardingRulesRequest} message ListForwardingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardingRulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListForwardingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListForwardingRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IListForwardingRulesRequest} message ListForwardingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListForwardingRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListForwardingRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListForwardingRulesRequest} ListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListForwardingRulesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListForwardingRulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListForwardingRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListForwardingRulesRequest} ListForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListForwardingRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListForwardingRulesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListForwardingRulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListForwardingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListForwardingRulesRequest} ListForwardingRulesRequest + */ + ListForwardingRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListForwardingRulesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListForwardingRulesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListForwardingRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.ListForwardingRulesRequest} message ListForwardingRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListForwardingRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListForwardingRulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListForwardingRulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListForwardingRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListForwardingRulesRequest; + })(); + + v1.PatchForwardingRuleRequest = (function() { + + /** + * Properties of a PatchForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchForwardingRuleRequest + * @property {string|null} [forwardingRule] PatchForwardingRuleRequest forwardingRule + * @property {google.cloud.compute.v1.IForwardingRule|null} [forwardingRuleResource] PatchForwardingRuleRequest forwardingRuleResource + * @property {string|null} [project] PatchForwardingRuleRequest project + * @property {string|null} [region] PatchForwardingRuleRequest region + * @property {string|null} [requestId] PatchForwardingRuleRequest requestId + */ + + /** + * Constructs a new PatchForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchForwardingRuleRequest. + * @implements IPatchForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchForwardingRuleRequest=} [properties] Properties to set + */ + function PatchForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @instance + */ + PatchForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * PatchForwardingRuleRequest forwardingRuleResource. + * @member {google.cloud.compute.v1.IForwardingRule|null|undefined} forwardingRuleResource + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @instance + */ + PatchForwardingRuleRequest.prototype.forwardingRuleResource = null; + + /** + * PatchForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @instance + */ + PatchForwardingRuleRequest.prototype.project = ""; + + /** + * PatchForwardingRuleRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @instance + */ + PatchForwardingRuleRequest.prototype.region = ""; + + /** + * PatchForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @instance + */ + PatchForwardingRuleRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @instance + */ + Object.defineProperty(PatchForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IPatchForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchForwardingRuleRequest} PatchForwardingRuleRequest instance + */ + PatchForwardingRuleRequest.create = function create(properties) { + return new PatchForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified PatchForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IPatchForwardingRuleRequest} message PatchForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + if (message.forwardingRuleResource != null && Object.hasOwnProperty.call(message, "forwardingRuleResource")) + $root.google.cloud.compute.v1.ForwardingRule.encode(message.forwardingRuleResource, writer.uint32(/* id 301211695, wireType 2 =*/2409693562).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IPatchForwardingRuleRequest} message PatchForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchForwardingRuleRequest} PatchForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 301211695: + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchForwardingRuleRequest} PatchForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) { + var error = $root.google.cloud.compute.v1.ForwardingRule.verify(message.forwardingRuleResource); + if (error) + return "forwardingRuleResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchForwardingRuleRequest} PatchForwardingRuleRequest + */ + PatchForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.forwardingRuleResource != null) { + if (typeof object.forwardingRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchForwardingRuleRequest.forwardingRuleResource: object expected"); + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.fromObject(object.forwardingRuleResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.PatchForwardingRuleRequest} message PatchForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.forwardingRule = ""; + object.forwardingRuleResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) + object.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.toObject(message.forwardingRuleResource, options); + return object; + }; + + /** + * Converts this PatchForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + PatchForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchForwardingRuleRequest; + })(); + + v1.SetLabelsForwardingRuleRequest = (function() { + + /** + * Properties of a SetLabelsForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsForwardingRuleRequest + * @property {string|null} [project] SetLabelsForwardingRuleRequest project + * @property {string|null} [region] SetLabelsForwardingRuleRequest region + * @property {google.cloud.compute.v1.IRegionSetLabelsRequest|null} [regionSetLabelsRequestResource] SetLabelsForwardingRuleRequest regionSetLabelsRequestResource + * @property {string|null} [requestId] SetLabelsForwardingRuleRequest requestId + * @property {string|null} [resource] SetLabelsForwardingRuleRequest resource + */ + + /** + * Constructs a new SetLabelsForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsForwardingRuleRequest. + * @implements ISetLabelsForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsForwardingRuleRequest=} [properties] Properties to set + */ + function SetLabelsForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @instance + */ + SetLabelsForwardingRuleRequest.prototype.project = ""; + + /** + * SetLabelsForwardingRuleRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @instance + */ + SetLabelsForwardingRuleRequest.prototype.region = ""; + + /** + * SetLabelsForwardingRuleRequest regionSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IRegionSetLabelsRequest|null|undefined} regionSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @instance + */ + SetLabelsForwardingRuleRequest.prototype.regionSetLabelsRequestResource = null; + + /** + * SetLabelsForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @instance + */ + SetLabelsForwardingRuleRequest.prototype.requestId = null; + + /** + * SetLabelsForwardingRuleRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @instance + */ + SetLabelsForwardingRuleRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetLabelsForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @instance + */ + Object.defineProperty(SetLabelsForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetLabelsForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsForwardingRuleRequest} SetLabelsForwardingRuleRequest instance + */ + SetLabelsForwardingRuleRequest.create = function create(properties) { + return new SetLabelsForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified SetLabelsForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsForwardingRuleRequest} message SetLabelsForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "regionSetLabelsRequestResource")) + $root.google.cloud.compute.v1.RegionSetLabelsRequest.encode(message.regionSetLabelsRequestResource, writer.uint32(/* id 259357782, wireType 2 =*/2074862258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsForwardingRuleRequest} message SetLabelsForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsForwardingRuleRequest} SetLabelsForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 259357782: + message.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsForwardingRuleRequest} SetLabelsForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionSetLabelsRequestResource != null && message.hasOwnProperty("regionSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionSetLabelsRequest.verify(message.regionSetLabelsRequestResource); + if (error) + return "regionSetLabelsRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetLabelsForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsForwardingRuleRequest} SetLabelsForwardingRuleRequest + */ + SetLabelsForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsForwardingRuleRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionSetLabelsRequestResource != null) { + if (typeof object.regionSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsForwardingRuleRequest.regionSetLabelsRequestResource: object expected"); + message.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.fromObject(object.regionSetLabelsRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetLabelsForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsForwardingRuleRequest} message SetLabelsForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.regionSetLabelsRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionSetLabelsRequestResource != null && message.hasOwnProperty("regionSetLabelsRequestResource")) + object.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.toObject(message.regionSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsForwardingRuleRequest; + })(); + + v1.SetTargetForwardingRuleRequest = (function() { + + /** + * Properties of a SetTargetForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetTargetForwardingRuleRequest + * @property {string|null} [forwardingRule] SetTargetForwardingRuleRequest forwardingRule + * @property {string|null} [project] SetTargetForwardingRuleRequest project + * @property {string|null} [region] SetTargetForwardingRuleRequest region + * @property {string|null} [requestId] SetTargetForwardingRuleRequest requestId + * @property {google.cloud.compute.v1.ITargetReference|null} [targetReferenceResource] SetTargetForwardingRuleRequest targetReferenceResource + */ + + /** + * Constructs a new SetTargetForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetTargetForwardingRuleRequest. + * @implements ISetTargetForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.ISetTargetForwardingRuleRequest=} [properties] Properties to set + */ + function SetTargetForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetTargetForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @instance + */ + SetTargetForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * SetTargetForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @instance + */ + SetTargetForwardingRuleRequest.prototype.project = ""; + + /** + * SetTargetForwardingRuleRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @instance + */ + SetTargetForwardingRuleRequest.prototype.region = ""; + + /** + * SetTargetForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @instance + */ + SetTargetForwardingRuleRequest.prototype.requestId = null; + + /** + * SetTargetForwardingRuleRequest targetReferenceResource. + * @member {google.cloud.compute.v1.ITargetReference|null|undefined} targetReferenceResource + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @instance + */ + SetTargetForwardingRuleRequest.prototype.targetReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetTargetForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @instance + */ + Object.defineProperty(SetTargetForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetTargetForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetTargetForwardingRuleRequest} SetTargetForwardingRuleRequest instance + */ + SetTargetForwardingRuleRequest.create = function create(properties) { + return new SetTargetForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified SetTargetForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetForwardingRuleRequest} message SetTargetForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + if (message.targetReferenceResource != null && Object.hasOwnProperty.call(message, "targetReferenceResource")) + $root.google.cloud.compute.v1.TargetReference.encode(message.targetReferenceResource, writer.uint32(/* id 523721712, wireType 2 =*/4189773698).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetTargetForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetForwardingRuleRequest} message SetTargetForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetTargetForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetTargetForwardingRuleRequest} SetTargetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetTargetForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 523721712: + message.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetTargetForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetTargetForwardingRuleRequest} SetTargetForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetTargetForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetTargetForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetReferenceResource != null && message.hasOwnProperty("targetReferenceResource")) { + var error = $root.google.cloud.compute.v1.TargetReference.verify(message.targetReferenceResource); + if (error) + return "targetReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetTargetForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetTargetForwardingRuleRequest} SetTargetForwardingRuleRequest + */ + SetTargetForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetTargetForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetTargetForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetReferenceResource != null) { + if (typeof object.targetReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetTargetForwardingRuleRequest.targetReferenceResource: object expected"); + message.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.fromObject(object.targetReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetTargetForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.SetTargetForwardingRuleRequest} message SetTargetForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetTargetForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.forwardingRule = ""; + object.targetReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.targetReferenceResource != null && message.hasOwnProperty("targetReferenceResource")) + object.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.toObject(message.targetReferenceResource, options); + return object; + }; + + /** + * Converts this SetTargetForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetTargetForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + SetTargetForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetTargetForwardingRuleRequest; + })(); + + v1.DeleteGlobalAddressRequest = (function() { + + /** + * Properties of a DeleteGlobalAddressRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalAddressRequest + * @property {string|null} [address] DeleteGlobalAddressRequest address + * @property {string|null} [project] DeleteGlobalAddressRequest project + * @property {string|null} [requestId] DeleteGlobalAddressRequest requestId + */ + + /** + * Constructs a new DeleteGlobalAddressRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalAddressRequest. + * @implements IDeleteGlobalAddressRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalAddressRequest=} [properties] Properties to set + */ + function DeleteGlobalAddressRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlobalAddressRequest address. + * @member {string} address + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @instance + */ + DeleteGlobalAddressRequest.prototype.address = ""; + + /** + * DeleteGlobalAddressRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @instance + */ + DeleteGlobalAddressRequest.prototype.project = ""; + + /** + * DeleteGlobalAddressRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @instance + */ + DeleteGlobalAddressRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteGlobalAddressRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @instance + */ + Object.defineProperty(DeleteGlobalAddressRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteGlobalAddressRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalAddressRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalAddressRequest} DeleteGlobalAddressRequest instance + */ + DeleteGlobalAddressRequest.create = function create(properties) { + return new DeleteGlobalAddressRequest(properties); + }; + + /** + * Encodes the specified DeleteGlobalAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalAddressRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalAddressRequest} message DeleteGlobalAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalAddressRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 462920692, wireType 2 =*/3703365538).string(message.address); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalAddressRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalAddressRequest} message DeleteGlobalAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalAddressRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalAddressRequest} DeleteGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalAddressRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalAddressRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 462920692: + message.address = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalAddressRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalAddressRequest} DeleteGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalAddressRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalAddressRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalAddressRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteGlobalAddressRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalAddressRequest} DeleteGlobalAddressRequest + */ + DeleteGlobalAddressRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalAddressRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteGlobalAddressRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteGlobalAddressRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.DeleteGlobalAddressRequest} message DeleteGlobalAddressRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalAddressRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.address = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + return object; + }; + + /** + * Converts this DeleteGlobalAddressRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalAddressRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalAddressRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalAddressRequest; + })(); + + v1.GetGlobalAddressRequest = (function() { + + /** + * Properties of a GetGlobalAddressRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetGlobalAddressRequest + * @property {string|null} [address] GetGlobalAddressRequest address + * @property {string|null} [project] GetGlobalAddressRequest project + */ + + /** + * Constructs a new GetGlobalAddressRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetGlobalAddressRequest. + * @implements IGetGlobalAddressRequest + * @constructor + * @param {google.cloud.compute.v1.IGetGlobalAddressRequest=} [properties] Properties to set + */ + function GetGlobalAddressRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlobalAddressRequest address. + * @member {string} address + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @instance + */ + GetGlobalAddressRequest.prototype.address = ""; + + /** + * GetGlobalAddressRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @instance + */ + GetGlobalAddressRequest.prototype.project = ""; + + /** + * Creates a new GetGlobalAddressRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalAddressRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetGlobalAddressRequest} GetGlobalAddressRequest instance + */ + GetGlobalAddressRequest.create = function create(properties) { + return new GetGlobalAddressRequest(properties); + }; + + /** + * Encodes the specified GetGlobalAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalAddressRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalAddressRequest} message GetGlobalAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalAddressRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 462920692, wireType 2 =*/3703365538).string(message.address); + return writer; + }; + + /** + * Encodes the specified GetGlobalAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalAddressRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalAddressRequest} message GetGlobalAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalAddressRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetGlobalAddressRequest} GetGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalAddressRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetGlobalAddressRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 462920692: + message.address = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalAddressRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetGlobalAddressRequest} GetGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalAddressRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalAddressRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalAddressRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetGlobalAddressRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetGlobalAddressRequest} GetGlobalAddressRequest + */ + GetGlobalAddressRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetGlobalAddressRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetGlobalAddressRequest(); + if (object.address != null) + message.address = String(object.address); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetGlobalAddressRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.GetGlobalAddressRequest} message GetGlobalAddressRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalAddressRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.address = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + return object; + }; + + /** + * Converts this GetGlobalAddressRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetGlobalAddressRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalAddressRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlobalAddressRequest; + })(); + + v1.InsertGlobalAddressRequest = (function() { + + /** + * Properties of an InsertGlobalAddressRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertGlobalAddressRequest + * @property {google.cloud.compute.v1.IAddress|null} [addressResource] InsertGlobalAddressRequest addressResource + * @property {string|null} [project] InsertGlobalAddressRequest project + * @property {string|null} [requestId] InsertGlobalAddressRequest requestId + */ + + /** + * Constructs a new InsertGlobalAddressRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertGlobalAddressRequest. + * @implements IInsertGlobalAddressRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertGlobalAddressRequest=} [properties] Properties to set + */ + function InsertGlobalAddressRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertGlobalAddressRequest addressResource. + * @member {google.cloud.compute.v1.IAddress|null|undefined} addressResource + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @instance + */ + InsertGlobalAddressRequest.prototype.addressResource = null; + + /** + * InsertGlobalAddressRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @instance + */ + InsertGlobalAddressRequest.prototype.project = ""; + + /** + * InsertGlobalAddressRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @instance + */ + InsertGlobalAddressRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertGlobalAddressRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @instance + */ + Object.defineProperty(InsertGlobalAddressRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertGlobalAddressRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalAddressRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertGlobalAddressRequest} InsertGlobalAddressRequest instance + */ + InsertGlobalAddressRequest.create = function create(properties) { + return new InsertGlobalAddressRequest(properties); + }; + + /** + * Encodes the specified InsertGlobalAddressRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalAddressRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalAddressRequest} message InsertGlobalAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalAddressRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.addressResource != null && Object.hasOwnProperty.call(message, "addressResource")) + $root.google.cloud.compute.v1.Address.encode(message.addressResource, writer.uint32(/* id 483888121, wireType 2 =*/3871104970).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertGlobalAddressRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalAddressRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalAddressRequest} message InsertGlobalAddressRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalAddressRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertGlobalAddressRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertGlobalAddressRequest} InsertGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalAddressRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertGlobalAddressRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 483888121: + message.addressResource = $root.google.cloud.compute.v1.Address.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertGlobalAddressRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertGlobalAddressRequest} InsertGlobalAddressRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalAddressRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertGlobalAddressRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertGlobalAddressRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.addressResource != null && message.hasOwnProperty("addressResource")) { + var error = $root.google.cloud.compute.v1.Address.verify(message.addressResource); + if (error) + return "addressResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertGlobalAddressRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertGlobalAddressRequest} InsertGlobalAddressRequest + */ + InsertGlobalAddressRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertGlobalAddressRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertGlobalAddressRequest(); + if (object.addressResource != null) { + if (typeof object.addressResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertGlobalAddressRequest.addressResource: object expected"); + message.addressResource = $root.google.cloud.compute.v1.Address.fromObject(object.addressResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertGlobalAddressRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @static + * @param {google.cloud.compute.v1.InsertGlobalAddressRequest} message InsertGlobalAddressRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertGlobalAddressRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.addressResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.addressResource != null && message.hasOwnProperty("addressResource")) + object.addressResource = $root.google.cloud.compute.v1.Address.toObject(message.addressResource, options); + return object; + }; + + /** + * Converts this InsertGlobalAddressRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertGlobalAddressRequest + * @instance + * @returns {Object.} JSON object + */ + InsertGlobalAddressRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertGlobalAddressRequest; + })(); + + v1.ListGlobalAddressesRequest = (function() { + + /** + * Properties of a ListGlobalAddressesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListGlobalAddressesRequest + * @property {string|null} [filter] ListGlobalAddressesRequest filter + * @property {number|null} [maxResults] ListGlobalAddressesRequest maxResults + * @property {string|null} [orderBy] ListGlobalAddressesRequest orderBy + * @property {string|null} [pageToken] ListGlobalAddressesRequest pageToken + * @property {string|null} [project] ListGlobalAddressesRequest project + * @property {boolean|null} [returnPartialSuccess] ListGlobalAddressesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListGlobalAddressesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListGlobalAddressesRequest. + * @implements IListGlobalAddressesRequest + * @constructor + * @param {google.cloud.compute.v1.IListGlobalAddressesRequest=} [properties] Properties to set + */ + function ListGlobalAddressesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlobalAddressesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + ListGlobalAddressesRequest.prototype.filter = null; + + /** + * ListGlobalAddressesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + ListGlobalAddressesRequest.prototype.maxResults = null; + + /** + * ListGlobalAddressesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + ListGlobalAddressesRequest.prototype.orderBy = null; + + /** + * ListGlobalAddressesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + ListGlobalAddressesRequest.prototype.pageToken = null; + + /** + * ListGlobalAddressesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + ListGlobalAddressesRequest.prototype.project = ""; + + /** + * ListGlobalAddressesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + ListGlobalAddressesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListGlobalAddressesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + Object.defineProperty(ListGlobalAddressesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalAddressesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + Object.defineProperty(ListGlobalAddressesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalAddressesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + Object.defineProperty(ListGlobalAddressesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalAddressesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + Object.defineProperty(ListGlobalAddressesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalAddressesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + */ + Object.defineProperty(ListGlobalAddressesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListGlobalAddressesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalAddressesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListGlobalAddressesRequest} ListGlobalAddressesRequest instance + */ + ListGlobalAddressesRequest.create = function create(properties) { + return new ListGlobalAddressesRequest(properties); + }; + + /** + * Encodes the specified ListGlobalAddressesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalAddressesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalAddressesRequest} message ListGlobalAddressesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalAddressesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListGlobalAddressesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalAddressesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalAddressesRequest} message ListGlobalAddressesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalAddressesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlobalAddressesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListGlobalAddressesRequest} ListGlobalAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalAddressesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListGlobalAddressesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlobalAddressesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListGlobalAddressesRequest} ListGlobalAddressesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalAddressesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlobalAddressesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlobalAddressesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListGlobalAddressesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListGlobalAddressesRequest} ListGlobalAddressesRequest + */ + ListGlobalAddressesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListGlobalAddressesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListGlobalAddressesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListGlobalAddressesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @static + * @param {google.cloud.compute.v1.ListGlobalAddressesRequest} message ListGlobalAddressesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlobalAddressesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListGlobalAddressesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListGlobalAddressesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlobalAddressesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlobalAddressesRequest; + })(); + + v1.DeleteGlobalForwardingRuleRequest = (function() { + + /** + * Properties of a DeleteGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalForwardingRuleRequest + * @property {string|null} [forwardingRule] DeleteGlobalForwardingRuleRequest forwardingRule + * @property {string|null} [project] DeleteGlobalForwardingRuleRequest project + * @property {string|null} [requestId] DeleteGlobalForwardingRuleRequest requestId + */ + + /** + * Constructs a new DeleteGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalForwardingRuleRequest. + * @implements IDeleteGlobalForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest=} [properties] Properties to set + */ + function DeleteGlobalForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlobalForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @instance + */ + DeleteGlobalForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * DeleteGlobalForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @instance + */ + DeleteGlobalForwardingRuleRequest.prototype.project = ""; + + /** + * DeleteGlobalForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @instance + */ + DeleteGlobalForwardingRuleRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteGlobalForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @instance + */ + Object.defineProperty(DeleteGlobalForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteGlobalForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest} DeleteGlobalForwardingRuleRequest instance + */ + DeleteGlobalForwardingRuleRequest.create = function create(properties) { + return new DeleteGlobalForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified DeleteGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest} message DeleteGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest} message DeleteGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest} DeleteGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest} DeleteGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest} DeleteGlobalForwardingRuleRequest + */ + DeleteGlobalForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest} message DeleteGlobalForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.forwardingRule = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + return object; + }; + + /** + * Converts this DeleteGlobalForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalForwardingRuleRequest; + })(); + + v1.GetGlobalForwardingRuleRequest = (function() { + + /** + * Properties of a GetGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetGlobalForwardingRuleRequest + * @property {string|null} [forwardingRule] GetGlobalForwardingRuleRequest forwardingRule + * @property {string|null} [project] GetGlobalForwardingRuleRequest project + */ + + /** + * Constructs a new GetGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetGlobalForwardingRuleRequest. + * @implements IGetGlobalForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IGetGlobalForwardingRuleRequest=} [properties] Properties to set + */ + function GetGlobalForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlobalForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @instance + */ + GetGlobalForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * GetGlobalForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @instance + */ + GetGlobalForwardingRuleRequest.prototype.project = ""; + + /** + * Creates a new GetGlobalForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetGlobalForwardingRuleRequest} GetGlobalForwardingRuleRequest instance + */ + GetGlobalForwardingRuleRequest.create = function create(properties) { + return new GetGlobalForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified GetGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalForwardingRuleRequest} message GetGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + return writer; + }; + + /** + * Encodes the specified GetGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalForwardingRuleRequest} message GetGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetGlobalForwardingRuleRequest} GetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetGlobalForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetGlobalForwardingRuleRequest} GetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetGlobalForwardingRuleRequest} GetGlobalForwardingRuleRequest + */ + GetGlobalForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetGlobalForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetGlobalForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.GetGlobalForwardingRuleRequest} message GetGlobalForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.forwardingRule = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + return object; + }; + + /** + * Converts this GetGlobalForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetGlobalForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlobalForwardingRuleRequest; + })(); + + v1.InsertGlobalForwardingRuleRequest = (function() { + + /** + * Properties of an InsertGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertGlobalForwardingRuleRequest + * @property {google.cloud.compute.v1.IForwardingRule|null} [forwardingRuleResource] InsertGlobalForwardingRuleRequest forwardingRuleResource + * @property {string|null} [project] InsertGlobalForwardingRuleRequest project + * @property {string|null} [requestId] InsertGlobalForwardingRuleRequest requestId + */ + + /** + * Constructs a new InsertGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertGlobalForwardingRuleRequest. + * @implements IInsertGlobalForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest=} [properties] Properties to set + */ + function InsertGlobalForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertGlobalForwardingRuleRequest forwardingRuleResource. + * @member {google.cloud.compute.v1.IForwardingRule|null|undefined} forwardingRuleResource + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @instance + */ + InsertGlobalForwardingRuleRequest.prototype.forwardingRuleResource = null; + + /** + * InsertGlobalForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @instance + */ + InsertGlobalForwardingRuleRequest.prototype.project = ""; + + /** + * InsertGlobalForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @instance + */ + InsertGlobalForwardingRuleRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertGlobalForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @instance + */ + Object.defineProperty(InsertGlobalForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertGlobalForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertGlobalForwardingRuleRequest} InsertGlobalForwardingRuleRequest instance + */ + InsertGlobalForwardingRuleRequest.create = function create(properties) { + return new InsertGlobalForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified InsertGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest} message InsertGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRuleResource != null && Object.hasOwnProperty.call(message, "forwardingRuleResource")) + $root.google.cloud.compute.v1.ForwardingRule.encode(message.forwardingRuleResource, writer.uint32(/* id 301211695, wireType 2 =*/2409693562).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest} message InsertGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertGlobalForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertGlobalForwardingRuleRequest} InsertGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertGlobalForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 301211695: + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertGlobalForwardingRuleRequest} InsertGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertGlobalForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertGlobalForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) { + var error = $root.google.cloud.compute.v1.ForwardingRule.verify(message.forwardingRuleResource); + if (error) + return "forwardingRuleResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertGlobalForwardingRuleRequest} InsertGlobalForwardingRuleRequest + */ + InsertGlobalForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertGlobalForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertGlobalForwardingRuleRequest(); + if (object.forwardingRuleResource != null) { + if (typeof object.forwardingRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertGlobalForwardingRuleRequest.forwardingRuleResource: object expected"); + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.fromObject(object.forwardingRuleResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.InsertGlobalForwardingRuleRequest} message InsertGlobalForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertGlobalForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.forwardingRuleResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) + object.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.toObject(message.forwardingRuleResource, options); + return object; + }; + + /** + * Converts this InsertGlobalForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertGlobalForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + InsertGlobalForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertGlobalForwardingRuleRequest; + })(); + + v1.ListGlobalForwardingRulesRequest = (function() { + + /** + * Properties of a ListGlobalForwardingRulesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListGlobalForwardingRulesRequest + * @property {string|null} [filter] ListGlobalForwardingRulesRequest filter + * @property {number|null} [maxResults] ListGlobalForwardingRulesRequest maxResults + * @property {string|null} [orderBy] ListGlobalForwardingRulesRequest orderBy + * @property {string|null} [pageToken] ListGlobalForwardingRulesRequest pageToken + * @property {string|null} [project] ListGlobalForwardingRulesRequest project + * @property {boolean|null} [returnPartialSuccess] ListGlobalForwardingRulesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListGlobalForwardingRulesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListGlobalForwardingRulesRequest. + * @implements IListGlobalForwardingRulesRequest + * @constructor + * @param {google.cloud.compute.v1.IListGlobalForwardingRulesRequest=} [properties] Properties to set + */ + function ListGlobalForwardingRulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlobalForwardingRulesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + ListGlobalForwardingRulesRequest.prototype.filter = null; + + /** + * ListGlobalForwardingRulesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + ListGlobalForwardingRulesRequest.prototype.maxResults = null; + + /** + * ListGlobalForwardingRulesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + ListGlobalForwardingRulesRequest.prototype.orderBy = null; + + /** + * ListGlobalForwardingRulesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + ListGlobalForwardingRulesRequest.prototype.pageToken = null; + + /** + * ListGlobalForwardingRulesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + ListGlobalForwardingRulesRequest.prototype.project = ""; + + /** + * ListGlobalForwardingRulesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + ListGlobalForwardingRulesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListGlobalForwardingRulesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListGlobalForwardingRulesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalForwardingRulesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListGlobalForwardingRulesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalForwardingRulesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListGlobalForwardingRulesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalForwardingRulesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListGlobalForwardingRulesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalForwardingRulesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + */ + Object.defineProperty(ListGlobalForwardingRulesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListGlobalForwardingRulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalForwardingRulesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListGlobalForwardingRulesRequest} ListGlobalForwardingRulesRequest instance + */ + ListGlobalForwardingRulesRequest.create = function create(properties) { + return new ListGlobalForwardingRulesRequest(properties); + }; + + /** + * Encodes the specified ListGlobalForwardingRulesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalForwardingRulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalForwardingRulesRequest} message ListGlobalForwardingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalForwardingRulesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListGlobalForwardingRulesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalForwardingRulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalForwardingRulesRequest} message ListGlobalForwardingRulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalForwardingRulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlobalForwardingRulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListGlobalForwardingRulesRequest} ListGlobalForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalForwardingRulesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListGlobalForwardingRulesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlobalForwardingRulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListGlobalForwardingRulesRequest} ListGlobalForwardingRulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalForwardingRulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlobalForwardingRulesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlobalForwardingRulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListGlobalForwardingRulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListGlobalForwardingRulesRequest} ListGlobalForwardingRulesRequest + */ + ListGlobalForwardingRulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListGlobalForwardingRulesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListGlobalForwardingRulesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListGlobalForwardingRulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @static + * @param {google.cloud.compute.v1.ListGlobalForwardingRulesRequest} message ListGlobalForwardingRulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlobalForwardingRulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListGlobalForwardingRulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListGlobalForwardingRulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlobalForwardingRulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlobalForwardingRulesRequest; + })(); + + v1.PatchGlobalForwardingRuleRequest = (function() { + + /** + * Properties of a PatchGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchGlobalForwardingRuleRequest + * @property {string|null} [forwardingRule] PatchGlobalForwardingRuleRequest forwardingRule + * @property {google.cloud.compute.v1.IForwardingRule|null} [forwardingRuleResource] PatchGlobalForwardingRuleRequest forwardingRuleResource + * @property {string|null} [project] PatchGlobalForwardingRuleRequest project + * @property {string|null} [requestId] PatchGlobalForwardingRuleRequest requestId + */ + + /** + * Constructs a new PatchGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchGlobalForwardingRuleRequest. + * @implements IPatchGlobalForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest=} [properties] Properties to set + */ + function PatchGlobalForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchGlobalForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @instance + */ + PatchGlobalForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * PatchGlobalForwardingRuleRequest forwardingRuleResource. + * @member {google.cloud.compute.v1.IForwardingRule|null|undefined} forwardingRuleResource + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @instance + */ + PatchGlobalForwardingRuleRequest.prototype.forwardingRuleResource = null; + + /** + * PatchGlobalForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @instance + */ + PatchGlobalForwardingRuleRequest.prototype.project = ""; + + /** + * PatchGlobalForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @instance + */ + PatchGlobalForwardingRuleRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchGlobalForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @instance + */ + Object.defineProperty(PatchGlobalForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchGlobalForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchGlobalForwardingRuleRequest} PatchGlobalForwardingRuleRequest instance + */ + PatchGlobalForwardingRuleRequest.create = function create(properties) { + return new PatchGlobalForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified PatchGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest} message PatchGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchGlobalForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + if (message.forwardingRuleResource != null && Object.hasOwnProperty.call(message, "forwardingRuleResource")) + $root.google.cloud.compute.v1.ForwardingRule.encode(message.forwardingRuleResource, writer.uint32(/* id 301211695, wireType 2 =*/2409693562).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest} message PatchGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchGlobalForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchGlobalForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchGlobalForwardingRuleRequest} PatchGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchGlobalForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchGlobalForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 301211695: + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchGlobalForwardingRuleRequest} PatchGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchGlobalForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchGlobalForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchGlobalForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) { + var error = $root.google.cloud.compute.v1.ForwardingRule.verify(message.forwardingRuleResource); + if (error) + return "forwardingRuleResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchGlobalForwardingRuleRequest} PatchGlobalForwardingRuleRequest + */ + PatchGlobalForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchGlobalForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchGlobalForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.forwardingRuleResource != null) { + if (typeof object.forwardingRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchGlobalForwardingRuleRequest.forwardingRuleResource: object expected"); + message.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.fromObject(object.forwardingRuleResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.PatchGlobalForwardingRuleRequest} message PatchGlobalForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchGlobalForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.forwardingRule = ""; + object.forwardingRuleResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.forwardingRuleResource != null && message.hasOwnProperty("forwardingRuleResource")) + object.forwardingRuleResource = $root.google.cloud.compute.v1.ForwardingRule.toObject(message.forwardingRuleResource, options); + return object; + }; + + /** + * Converts this PatchGlobalForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchGlobalForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + PatchGlobalForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchGlobalForwardingRuleRequest; + })(); + + v1.SetLabelsGlobalForwardingRuleRequest = (function() { + + /** + * Properties of a SetLabelsGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsGlobalForwardingRuleRequest + * @property {google.cloud.compute.v1.IGlobalSetLabelsRequest|null} [globalSetLabelsRequestResource] SetLabelsGlobalForwardingRuleRequest globalSetLabelsRequestResource + * @property {string|null} [project] SetLabelsGlobalForwardingRuleRequest project + * @property {string|null} [resource] SetLabelsGlobalForwardingRuleRequest resource + */ + + /** + * Constructs a new SetLabelsGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsGlobalForwardingRuleRequest. + * @implements ISetLabelsGlobalForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest=} [properties] Properties to set + */ + function SetLabelsGlobalForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsGlobalForwardingRuleRequest globalSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetLabelsRequest|null|undefined} globalSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @instance + */ + SetLabelsGlobalForwardingRuleRequest.prototype.globalSetLabelsRequestResource = null; + + /** + * SetLabelsGlobalForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @instance + */ + SetLabelsGlobalForwardingRuleRequest.prototype.project = ""; + + /** + * SetLabelsGlobalForwardingRuleRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @instance + */ + SetLabelsGlobalForwardingRuleRequest.prototype.resource = ""; + + /** + * Creates a new SetLabelsGlobalForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest} SetLabelsGlobalForwardingRuleRequest instance + */ + SetLabelsGlobalForwardingRuleRequest.create = function create(properties) { + return new SetLabelsGlobalForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified SetLabelsGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest} message SetLabelsGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsGlobalForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "globalSetLabelsRequestResource")) + $root.google.cloud.compute.v1.GlobalSetLabelsRequest.encode(message.globalSetLabelsRequestResource, writer.uint32(/* id 319917189, wireType 2 =*/2559337514).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest} message SetLabelsGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsGlobalForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsGlobalForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest} SetLabelsGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsGlobalForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 319917189: + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest} SetLabelsGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsGlobalForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsGlobalForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsGlobalForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.verify(message.globalSetLabelsRequestResource); + if (error) + return "globalSetLabelsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetLabelsGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest} SetLabelsGlobalForwardingRuleRequest + */ + SetLabelsGlobalForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest(); + if (object.globalSetLabelsRequestResource != null) { + if (typeof object.globalSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest.globalSetLabelsRequestResource: object expected"); + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.fromObject(object.globalSetLabelsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetLabelsGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest} message SetLabelsGlobalForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsGlobalForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetLabelsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) + object.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.toObject(message.globalSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsGlobalForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsGlobalForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsGlobalForwardingRuleRequest; + })(); + + v1.SetTargetGlobalForwardingRuleRequest = (function() { + + /** + * Properties of a SetTargetGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetTargetGlobalForwardingRuleRequest + * @property {string|null} [forwardingRule] SetTargetGlobalForwardingRuleRequest forwardingRule + * @property {string|null} [project] SetTargetGlobalForwardingRuleRequest project + * @property {string|null} [requestId] SetTargetGlobalForwardingRuleRequest requestId + * @property {google.cloud.compute.v1.ITargetReference|null} [targetReferenceResource] SetTargetGlobalForwardingRuleRequest targetReferenceResource + */ + + /** + * Constructs a new SetTargetGlobalForwardingRuleRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetTargetGlobalForwardingRuleRequest. + * @implements ISetTargetGlobalForwardingRuleRequest + * @constructor + * @param {google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest=} [properties] Properties to set + */ + function SetTargetGlobalForwardingRuleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetTargetGlobalForwardingRuleRequest forwardingRule. + * @member {string} forwardingRule + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @instance + */ + SetTargetGlobalForwardingRuleRequest.prototype.forwardingRule = ""; + + /** + * SetTargetGlobalForwardingRuleRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @instance + */ + SetTargetGlobalForwardingRuleRequest.prototype.project = ""; + + /** + * SetTargetGlobalForwardingRuleRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @instance + */ + SetTargetGlobalForwardingRuleRequest.prototype.requestId = null; + + /** + * SetTargetGlobalForwardingRuleRequest targetReferenceResource. + * @member {google.cloud.compute.v1.ITargetReference|null|undefined} targetReferenceResource + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @instance + */ + SetTargetGlobalForwardingRuleRequest.prototype.targetReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetTargetGlobalForwardingRuleRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @instance + */ + Object.defineProperty(SetTargetGlobalForwardingRuleRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetTargetGlobalForwardingRuleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest} SetTargetGlobalForwardingRuleRequest instance + */ + SetTargetGlobalForwardingRuleRequest.create = function create(properties) { + return new SetTargetGlobalForwardingRuleRequest(properties); + }; + + /** + * Encodes the specified SetTargetGlobalForwardingRuleRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest} message SetTargetGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetGlobalForwardingRuleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.forwardingRule != null && Object.hasOwnProperty.call(message, "forwardingRule")) + writer.uint32(/* id 269964030, wireType 2 =*/2159712242).string(message.forwardingRule); + if (message.targetReferenceResource != null && Object.hasOwnProperty.call(message, "targetReferenceResource")) + $root.google.cloud.compute.v1.TargetReference.encode(message.targetReferenceResource, writer.uint32(/* id 523721712, wireType 2 =*/4189773698).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetTargetGlobalForwardingRuleRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest} message SetTargetGlobalForwardingRuleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetGlobalForwardingRuleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetTargetGlobalForwardingRuleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest} SetTargetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetGlobalForwardingRuleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 269964030: + message.forwardingRule = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 523721712: + message.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetTargetGlobalForwardingRuleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest} SetTargetGlobalForwardingRuleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetGlobalForwardingRuleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetTargetGlobalForwardingRuleRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetTargetGlobalForwardingRuleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + if (!$util.isString(message.forwardingRule)) + return "forwardingRule: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetReferenceResource != null && message.hasOwnProperty("targetReferenceResource")) { + var error = $root.google.cloud.compute.v1.TargetReference.verify(message.targetReferenceResource); + if (error) + return "targetReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetTargetGlobalForwardingRuleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest} SetTargetGlobalForwardingRuleRequest + */ + SetTargetGlobalForwardingRuleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest(); + if (object.forwardingRule != null) + message.forwardingRule = String(object.forwardingRule); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetReferenceResource != null) { + if (typeof object.targetReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest.targetReferenceResource: object expected"); + message.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.fromObject(object.targetReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetTargetGlobalForwardingRuleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @static + * @param {google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest} message SetTargetGlobalForwardingRuleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetTargetGlobalForwardingRuleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.forwardingRule = ""; + object.targetReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.forwardingRule != null && message.hasOwnProperty("forwardingRule")) + object.forwardingRule = message.forwardingRule; + if (message.targetReferenceResource != null && message.hasOwnProperty("targetReferenceResource")) + object.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.toObject(message.targetReferenceResource, options); + return object; + }; + + /** + * Converts this SetTargetGlobalForwardingRuleRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest + * @instance + * @returns {Object.} JSON object + */ + SetTargetGlobalForwardingRuleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetTargetGlobalForwardingRuleRequest; + })(); + + v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest = (function() { + + /** + * Properties of an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @property {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest|null} [globalNetworkEndpointGroupsAttachEndpointsRequestResource] AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource + * @property {string|null} [networkEndpointGroup] AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest project + * @property {string|null} [requestId] AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId + */ + + /** + * Constructs a new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @implements IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsAttachEndpointsRequestResource. + * @member {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsAttachEndpointsRequest|null|undefined} globalNetworkEndpointGroupsAttachEndpointsRequestResource + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.globalNetworkEndpointGroupsAttachEndpointsRequestResource = null; + + /** + * AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.create = function create(properties) { + return new AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} message AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.globalNetworkEndpointGroupsAttachEndpointsRequestResource != null && Object.hasOwnProperty.call(message, "globalNetworkEndpointGroupsAttachEndpointsRequestResource")) + $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.encode(message.globalNetworkEndpointGroupsAttachEndpointsRequestResource, writer.uint32(/* id 30691563, wireType 2 =*/245532506).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} message AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 30691563: + message.globalNetworkEndpointGroupsAttachEndpointsRequestResource = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.decode(reader, reader.uint32()); + break; + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.globalNetworkEndpointGroupsAttachEndpointsRequestResource != null && message.hasOwnProperty("globalNetworkEndpointGroupsAttachEndpointsRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.verify(message.globalNetworkEndpointGroupsAttachEndpointsRequestResource); + if (error) + return "globalNetworkEndpointGroupsAttachEndpointsRequestResource." + error; + } + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest(); + if (object.globalNetworkEndpointGroupsAttachEndpointsRequestResource != null) { + if (typeof object.globalNetworkEndpointGroupsAttachEndpointsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.globalNetworkEndpointGroupsAttachEndpointsRequestResource: object expected"); + message.globalNetworkEndpointGroupsAttachEndpointsRequestResource = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.fromObject(object.globalNetworkEndpointGroupsAttachEndpointsRequestResource); + } + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} message AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.globalNetworkEndpointGroupsAttachEndpointsRequestResource = null; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.globalNetworkEndpointGroupsAttachEndpointsRequestResource != null && message.hasOwnProperty("globalNetworkEndpointGroupsAttachEndpointsRequestResource")) + object.globalNetworkEndpointGroupsAttachEndpointsRequestResource = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest.toObject(message.globalNetworkEndpointGroupsAttachEndpointsRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + })(); + + v1.DeleteGlobalNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a DeleteGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] DeleteGlobalNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] DeleteGlobalNetworkEndpointGroupRequest project + * @property {string|null} [requestId] DeleteGlobalNetworkEndpointGroupRequest requestId + */ + + /** + * Constructs a new DeleteGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalNetworkEndpointGroupRequest. + * @implements IDeleteGlobalNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function DeleteGlobalNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlobalNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @instance + */ + DeleteGlobalNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * DeleteGlobalNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @instance + */ + DeleteGlobalNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * DeleteGlobalNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @instance + */ + DeleteGlobalNetworkEndpointGroupRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteGlobalNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(DeleteGlobalNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest} DeleteGlobalNetworkEndpointGroupRequest instance + */ + DeleteGlobalNetworkEndpointGroupRequest.create = function create(properties) { + return new DeleteGlobalNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest} message DeleteGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest} message DeleteGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest} DeleteGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest} DeleteGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest} DeleteGlobalNetworkEndpointGroupRequest + */ + DeleteGlobalNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest} message DeleteGlobalNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this DeleteGlobalNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalNetworkEndpointGroupRequest; + })(); + + v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @property {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest|null} [globalNetworkEndpointGroupsDetachEndpointsRequestResource] DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource + * @property {string|null} [networkEndpointGroup] DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest project + * @property {string|null} [requestId] DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId + */ + + /** + * Constructs a new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest. + * @implements IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest globalNetworkEndpointGroupsDetachEndpointsRequestResource. + * @member {google.cloud.compute.v1.IGlobalNetworkEndpointGroupsDetachEndpointsRequest|null|undefined} globalNetworkEndpointGroupsDetachEndpointsRequestResource + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.globalNetworkEndpointGroupsDetachEndpointsRequestResource = null; + + /** + * DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest instance + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.create = function create(properties) { + return new DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} message DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.globalNetworkEndpointGroupsDetachEndpointsRequestResource != null && Object.hasOwnProperty.call(message, "globalNetworkEndpointGroupsDetachEndpointsRequestResource")) + $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.encode(message.globalNetworkEndpointGroupsDetachEndpointsRequestResource, writer.uint32(/* id 8898269, wireType 2 =*/71186154).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} message DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8898269: + message.globalNetworkEndpointGroupsDetachEndpointsRequestResource = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.decode(reader, reader.uint32()); + break; + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.globalNetworkEndpointGroupsDetachEndpointsRequestResource != null && message.hasOwnProperty("globalNetworkEndpointGroupsDetachEndpointsRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.verify(message.globalNetworkEndpointGroupsDetachEndpointsRequestResource); + if (error) + return "globalNetworkEndpointGroupsDetachEndpointsRequestResource." + error; + } + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest(); + if (object.globalNetworkEndpointGroupsDetachEndpointsRequestResource != null) { + if (typeof object.globalNetworkEndpointGroupsDetachEndpointsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.globalNetworkEndpointGroupsDetachEndpointsRequestResource: object expected"); + message.globalNetworkEndpointGroupsDetachEndpointsRequestResource = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.fromObject(object.globalNetworkEndpointGroupsDetachEndpointsRequestResource); + } + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} message DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.globalNetworkEndpointGroupsDetachEndpointsRequestResource = null; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.globalNetworkEndpointGroupsDetachEndpointsRequestResource != null && message.hasOwnProperty("globalNetworkEndpointGroupsDetachEndpointsRequestResource")) + object.globalNetworkEndpointGroupsDetachEndpointsRequestResource = $root.google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest.toObject(message.globalNetworkEndpointGroupsDetachEndpointsRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest; + })(); + + v1.GetGlobalNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a GetGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetGlobalNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] GetGlobalNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] GetGlobalNetworkEndpointGroupRequest project + */ + + /** + * Constructs a new GetGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetGlobalNetworkEndpointGroupRequest. + * @implements IGetGlobalNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function GetGlobalNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlobalNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @instance + */ + GetGlobalNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * GetGlobalNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @instance + */ + GetGlobalNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * Creates a new GetGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest} GetGlobalNetworkEndpointGroupRequest instance + */ + GetGlobalNetworkEndpointGroupRequest.create = function create(properties) { + return new GetGlobalNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified GetGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest} message GetGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified GetGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest} message GetGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest} GetGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest} GetGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest} GetGlobalNetworkEndpointGroupRequest + */ + GetGlobalNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest} message GetGlobalNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this GetGlobalNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlobalNetworkEndpointGroupRequest; + })(); + + v1.InsertGlobalNetworkEndpointGroupRequest = (function() { + + /** + * Properties of an InsertGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertGlobalNetworkEndpointGroupRequest + * @property {google.cloud.compute.v1.INetworkEndpointGroup|null} [networkEndpointGroupResource] InsertGlobalNetworkEndpointGroupRequest networkEndpointGroupResource + * @property {string|null} [project] InsertGlobalNetworkEndpointGroupRequest project + * @property {string|null} [requestId] InsertGlobalNetworkEndpointGroupRequest requestId + */ + + /** + * Constructs a new InsertGlobalNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertGlobalNetworkEndpointGroupRequest. + * @implements IInsertGlobalNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function InsertGlobalNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertGlobalNetworkEndpointGroupRequest networkEndpointGroupResource. + * @member {google.cloud.compute.v1.INetworkEndpointGroup|null|undefined} networkEndpointGroupResource + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @instance + */ + InsertGlobalNetworkEndpointGroupRequest.prototype.networkEndpointGroupResource = null; + + /** + * InsertGlobalNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @instance + */ + InsertGlobalNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * InsertGlobalNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @instance + */ + InsertGlobalNetworkEndpointGroupRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertGlobalNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(InsertGlobalNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertGlobalNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest} InsertGlobalNetworkEndpointGroupRequest instance + */ + InsertGlobalNetworkEndpointGroupRequest.create = function create(properties) { + return new InsertGlobalNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified InsertGlobalNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest} message InsertGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroupResource != null && Object.hasOwnProperty.call(message, "networkEndpointGroupResource")) + $root.google.cloud.compute.v1.NetworkEndpointGroup.encode(message.networkEndpointGroupResource, writer.uint32(/* id 525788839, wireType 2 =*/4206310714).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertGlobalNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest} message InsertGlobalNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertGlobalNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest} InsertGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 525788839: + message.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertGlobalNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest} InsertGlobalNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertGlobalNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertGlobalNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroupResource != null && message.hasOwnProperty("networkEndpointGroupResource")) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroup.verify(message.networkEndpointGroupResource); + if (error) + return "networkEndpointGroupResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertGlobalNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest} InsertGlobalNetworkEndpointGroupRequest + */ + InsertGlobalNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest(); + if (object.networkEndpointGroupResource != null) { + if (typeof object.networkEndpointGroupResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest.networkEndpointGroupResource: object expected"); + message.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.fromObject(object.networkEndpointGroupResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertGlobalNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest} message InsertGlobalNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertGlobalNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.networkEndpointGroupResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroupResource != null && message.hasOwnProperty("networkEndpointGroupResource")) + object.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.toObject(message.networkEndpointGroupResource, options); + return object; + }; + + /** + * Converts this InsertGlobalNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + InsertGlobalNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertGlobalNetworkEndpointGroupRequest; + })(); + + v1.ListGlobalNetworkEndpointGroupsRequest = (function() { + + /** + * Properties of a ListGlobalNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListGlobalNetworkEndpointGroupsRequest + * @property {string|null} [filter] ListGlobalNetworkEndpointGroupsRequest filter + * @property {number|null} [maxResults] ListGlobalNetworkEndpointGroupsRequest maxResults + * @property {string|null} [orderBy] ListGlobalNetworkEndpointGroupsRequest orderBy + * @property {string|null} [pageToken] ListGlobalNetworkEndpointGroupsRequest pageToken + * @property {string|null} [project] ListGlobalNetworkEndpointGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListGlobalNetworkEndpointGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListGlobalNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListGlobalNetworkEndpointGroupsRequest. + * @implements IListGlobalNetworkEndpointGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest=} [properties] Properties to set + */ + function ListGlobalNetworkEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlobalNetworkEndpointGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListGlobalNetworkEndpointGroupsRequest.prototype.filter = null; + + /** + * ListGlobalNetworkEndpointGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListGlobalNetworkEndpointGroupsRequest.prototype.maxResults = null; + + /** + * ListGlobalNetworkEndpointGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListGlobalNetworkEndpointGroupsRequest.prototype.orderBy = null; + + /** + * ListGlobalNetworkEndpointGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListGlobalNetworkEndpointGroupsRequest.prototype.pageToken = null; + + /** + * ListGlobalNetworkEndpointGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListGlobalNetworkEndpointGroupsRequest.prototype.project = ""; + + /** + * ListGlobalNetworkEndpointGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListGlobalNetworkEndpointGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListGlobalNetworkEndpointGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListGlobalNetworkEndpointGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalNetworkEndpointGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListGlobalNetworkEndpointGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalNetworkEndpointGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListGlobalNetworkEndpointGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalNetworkEndpointGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListGlobalNetworkEndpointGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalNetworkEndpointGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListGlobalNetworkEndpointGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListGlobalNetworkEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest} ListGlobalNetworkEndpointGroupsRequest instance + */ + ListGlobalNetworkEndpointGroupsRequest.create = function create(properties) { + return new ListGlobalNetworkEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified ListGlobalNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest} message ListGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalNetworkEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListGlobalNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest} message ListGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalNetworkEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest} ListGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalNetworkEndpointGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest} ListGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalNetworkEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlobalNetworkEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlobalNetworkEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListGlobalNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest} ListGlobalNetworkEndpointGroupsRequest + */ + ListGlobalNetworkEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListGlobalNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest} message ListGlobalNetworkEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlobalNetworkEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListGlobalNetworkEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlobalNetworkEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlobalNetworkEndpointGroupsRequest; + })(); + + v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest = (function() { + + /** + * Properties of a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @property {string|null} [filter] ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest filter + * @property {number|null} [maxResults] ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest maxResults + * @property {string|null} [networkEndpointGroup] ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest networkEndpointGroup + * @property {string|null} [orderBy] ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest orderBy + * @property {string|null} [pageToken] ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest pageToken + * @property {string|null} [project] ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest. + * @implements IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest=} [properties] Properties to set + */ + function ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.filter = null; + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.maxResults = null; + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.networkEndpointGroup = ""; + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.orderBy = null; + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.pageToken = null; + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.project = ""; + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest instance + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.create = function create(properties) { + return new ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} message ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} message ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} message ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest; + })(); + + v1.AggregatedListGlobalOperationsRequest = (function() { + + /** + * Properties of an AggregatedListGlobalOperationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListGlobalOperationsRequest + * @property {string|null} [filter] AggregatedListGlobalOperationsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListGlobalOperationsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListGlobalOperationsRequest maxResults + * @property {string|null} [orderBy] AggregatedListGlobalOperationsRequest orderBy + * @property {string|null} [pageToken] AggregatedListGlobalOperationsRequest pageToken + * @property {string|null} [project] AggregatedListGlobalOperationsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListGlobalOperationsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListGlobalOperationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListGlobalOperationsRequest. + * @implements IAggregatedListGlobalOperationsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest=} [properties] Properties to set + */ + function AggregatedListGlobalOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListGlobalOperationsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + AggregatedListGlobalOperationsRequest.prototype.filter = null; + + /** + * AggregatedListGlobalOperationsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + AggregatedListGlobalOperationsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListGlobalOperationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + AggregatedListGlobalOperationsRequest.prototype.maxResults = null; + + /** + * AggregatedListGlobalOperationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + AggregatedListGlobalOperationsRequest.prototype.orderBy = null; + + /** + * AggregatedListGlobalOperationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + AggregatedListGlobalOperationsRequest.prototype.pageToken = null; + + /** + * AggregatedListGlobalOperationsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + AggregatedListGlobalOperationsRequest.prototype.project = ""; + + /** + * AggregatedListGlobalOperationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + AggregatedListGlobalOperationsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListGlobalOperationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(AggregatedListGlobalOperationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListGlobalOperationsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(AggregatedListGlobalOperationsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListGlobalOperationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(AggregatedListGlobalOperationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListGlobalOperationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(AggregatedListGlobalOperationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListGlobalOperationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(AggregatedListGlobalOperationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListGlobalOperationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(AggregatedListGlobalOperationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListGlobalOperationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListGlobalOperationsRequest} AggregatedListGlobalOperationsRequest instance + */ + AggregatedListGlobalOperationsRequest.create = function create(properties) { + return new AggregatedListGlobalOperationsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListGlobalOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListGlobalOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest} message AggregatedListGlobalOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListGlobalOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListGlobalOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListGlobalOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest} message AggregatedListGlobalOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListGlobalOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListGlobalOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListGlobalOperationsRequest} AggregatedListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListGlobalOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListGlobalOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListGlobalOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListGlobalOperationsRequest} AggregatedListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListGlobalOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListGlobalOperationsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListGlobalOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListGlobalOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListGlobalOperationsRequest} AggregatedListGlobalOperationsRequest + */ + AggregatedListGlobalOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListGlobalOperationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListGlobalOperationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListGlobalOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListGlobalOperationsRequest} message AggregatedListGlobalOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListGlobalOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListGlobalOperationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListGlobalOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListGlobalOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListGlobalOperationsRequest; + })(); + + v1.DeleteGlobalOperationRequest = (function() { + + /** + * Properties of a DeleteGlobalOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalOperationRequest + * @property {string|null} [operation] DeleteGlobalOperationRequest operation + * @property {string|null} [project] DeleteGlobalOperationRequest project + */ + + /** + * Constructs a new DeleteGlobalOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalOperationRequest. + * @implements IDeleteGlobalOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalOperationRequest=} [properties] Properties to set + */ + function DeleteGlobalOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlobalOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @instance + */ + DeleteGlobalOperationRequest.prototype.operation = ""; + + /** + * DeleteGlobalOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @instance + */ + DeleteGlobalOperationRequest.prototype.project = ""; + + /** + * Creates a new DeleteGlobalOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalOperationRequest} DeleteGlobalOperationRequest instance + */ + DeleteGlobalOperationRequest.create = function create(properties) { + return new DeleteGlobalOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteGlobalOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOperationRequest} message DeleteGlobalOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOperationRequest} message DeleteGlobalOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalOperationRequest} DeleteGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalOperationRequest} DeleteGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a DeleteGlobalOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalOperationRequest} DeleteGlobalOperationRequest + */ + DeleteGlobalOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteGlobalOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a DeleteGlobalOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.DeleteGlobalOperationRequest} message DeleteGlobalOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.project = ""; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteGlobalOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalOperationRequest; + })(); + + v1.DeleteGlobalOperationResponse = (function() { + + /** + * Properties of a DeleteGlobalOperationResponse. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalOperationResponse + */ + + /** + * Constructs a new DeleteGlobalOperationResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalOperationResponse. + * @implements IDeleteGlobalOperationResponse + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalOperationResponse=} [properties] Properties to set + */ + function DeleteGlobalOperationResponse(properties) { + if (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 DeleteGlobalOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOperationResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalOperationResponse} DeleteGlobalOperationResponse instance + */ + DeleteGlobalOperationResponse.create = function create(properties) { + return new DeleteGlobalOperationResponse(properties); + }; + + /** + * Encodes the specified DeleteGlobalOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOperationResponse} message DeleteGlobalOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOperationResponse} message DeleteGlobalOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalOperationResponse} DeleteGlobalOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalOperationResponse} DeleteGlobalOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalOperationResponse message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteGlobalOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalOperationResponse} DeleteGlobalOperationResponse + */ + DeleteGlobalOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalOperationResponse) + return object; + return new $root.google.cloud.compute.v1.DeleteGlobalOperationResponse(); + }; + + /** + * Creates a plain object from a DeleteGlobalOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @static + * @param {google.cloud.compute.v1.DeleteGlobalOperationResponse} message DeleteGlobalOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteGlobalOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalOperationResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalOperationResponse; + })(); + + v1.GetGlobalOperationRequest = (function() { + + /** + * Properties of a GetGlobalOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetGlobalOperationRequest + * @property {string|null} [operation] GetGlobalOperationRequest operation + * @property {string|null} [project] GetGlobalOperationRequest project + */ + + /** + * Constructs a new GetGlobalOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetGlobalOperationRequest. + * @implements IGetGlobalOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IGetGlobalOperationRequest=} [properties] Properties to set + */ + function GetGlobalOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlobalOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @instance + */ + GetGlobalOperationRequest.prototype.operation = ""; + + /** + * GetGlobalOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @instance + */ + GetGlobalOperationRequest.prototype.project = ""; + + /** + * Creates a new GetGlobalOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetGlobalOperationRequest} GetGlobalOperationRequest instance + */ + GetGlobalOperationRequest.create = function create(properties) { + return new GetGlobalOperationRequest(properties); + }; + + /** + * Encodes the specified GetGlobalOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalOperationRequest} message GetGlobalOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetGlobalOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalOperationRequest} message GetGlobalOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetGlobalOperationRequest} GetGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetGlobalOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetGlobalOperationRequest} GetGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetGlobalOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetGlobalOperationRequest} GetGlobalOperationRequest + */ + GetGlobalOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetGlobalOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetGlobalOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetGlobalOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.GetGlobalOperationRequest} message GetGlobalOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.project = ""; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetGlobalOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetGlobalOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlobalOperationRequest; + })(); + + v1.ListGlobalOperationsRequest = (function() { + + /** + * Properties of a ListGlobalOperationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListGlobalOperationsRequest + * @property {string|null} [filter] ListGlobalOperationsRequest filter + * @property {number|null} [maxResults] ListGlobalOperationsRequest maxResults + * @property {string|null} [orderBy] ListGlobalOperationsRequest orderBy + * @property {string|null} [pageToken] ListGlobalOperationsRequest pageToken + * @property {string|null} [project] ListGlobalOperationsRequest project + * @property {boolean|null} [returnPartialSuccess] ListGlobalOperationsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListGlobalOperationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListGlobalOperationsRequest. + * @implements IListGlobalOperationsRequest + * @constructor + * @param {google.cloud.compute.v1.IListGlobalOperationsRequest=} [properties] Properties to set + */ + function ListGlobalOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlobalOperationsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + ListGlobalOperationsRequest.prototype.filter = null; + + /** + * ListGlobalOperationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + ListGlobalOperationsRequest.prototype.maxResults = null; + + /** + * ListGlobalOperationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + ListGlobalOperationsRequest.prototype.orderBy = null; + + /** + * ListGlobalOperationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + ListGlobalOperationsRequest.prototype.pageToken = null; + + /** + * ListGlobalOperationsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + ListGlobalOperationsRequest.prototype.project = ""; + + /** + * ListGlobalOperationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + ListGlobalOperationsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListGlobalOperationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOperationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOperationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOperationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOperationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOperationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOperationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOperationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOperationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOperationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListGlobalOperationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalOperationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListGlobalOperationsRequest} ListGlobalOperationsRequest instance + */ + ListGlobalOperationsRequest.create = function create(properties) { + return new ListGlobalOperationsRequest(properties); + }; + + /** + * Encodes the specified ListGlobalOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalOperationsRequest} message ListGlobalOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListGlobalOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalOperationsRequest} message ListGlobalOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlobalOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListGlobalOperationsRequest} ListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListGlobalOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlobalOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListGlobalOperationsRequest} ListGlobalOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlobalOperationsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlobalOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListGlobalOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListGlobalOperationsRequest} ListGlobalOperationsRequest + */ + ListGlobalOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListGlobalOperationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListGlobalOperationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListGlobalOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @static + * @param {google.cloud.compute.v1.ListGlobalOperationsRequest} message ListGlobalOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlobalOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListGlobalOperationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListGlobalOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlobalOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlobalOperationsRequest; + })(); + + v1.WaitGlobalOperationRequest = (function() { + + /** + * Properties of a WaitGlobalOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IWaitGlobalOperationRequest + * @property {string|null} [operation] WaitGlobalOperationRequest operation + * @property {string|null} [project] WaitGlobalOperationRequest project + */ + + /** + * Constructs a new WaitGlobalOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a WaitGlobalOperationRequest. + * @implements IWaitGlobalOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IWaitGlobalOperationRequest=} [properties] Properties to set + */ + function WaitGlobalOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitGlobalOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @instance + */ + WaitGlobalOperationRequest.prototype.operation = ""; + + /** + * WaitGlobalOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @instance + */ + WaitGlobalOperationRequest.prototype.project = ""; + + /** + * Creates a new WaitGlobalOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitGlobalOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.WaitGlobalOperationRequest} WaitGlobalOperationRequest instance + */ + WaitGlobalOperationRequest.create = function create(properties) { + return new WaitGlobalOperationRequest(properties); + }; + + /** + * Encodes the specified WaitGlobalOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.WaitGlobalOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitGlobalOperationRequest} message WaitGlobalOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitGlobalOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified WaitGlobalOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WaitGlobalOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitGlobalOperationRequest} message WaitGlobalOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitGlobalOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitGlobalOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.WaitGlobalOperationRequest} WaitGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitGlobalOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.WaitGlobalOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitGlobalOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.WaitGlobalOperationRequest} WaitGlobalOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitGlobalOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitGlobalOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitGlobalOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a WaitGlobalOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.WaitGlobalOperationRequest} WaitGlobalOperationRequest + */ + WaitGlobalOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.WaitGlobalOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.WaitGlobalOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a WaitGlobalOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @static + * @param {google.cloud.compute.v1.WaitGlobalOperationRequest} message WaitGlobalOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitGlobalOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.project = ""; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this WaitGlobalOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.WaitGlobalOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitGlobalOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitGlobalOperationRequest; + })(); + + v1.DeleteGlobalOrganizationOperationRequest = (function() { + + /** + * Properties of a DeleteGlobalOrganizationOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalOrganizationOperationRequest + * @property {string|null} [operation] DeleteGlobalOrganizationOperationRequest operation + * @property {string|null} [parentId] DeleteGlobalOrganizationOperationRequest parentId + */ + + /** + * Constructs a new DeleteGlobalOrganizationOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalOrganizationOperationRequest. + * @implements IDeleteGlobalOrganizationOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest=} [properties] Properties to set + */ + function DeleteGlobalOrganizationOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlobalOrganizationOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @instance + */ + DeleteGlobalOrganizationOperationRequest.prototype.operation = ""; + + /** + * DeleteGlobalOrganizationOperationRequest parentId. + * @member {string|null|undefined} parentId + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @instance + */ + DeleteGlobalOrganizationOperationRequest.prototype.parentId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteGlobalOrganizationOperationRequest _parentId. + * @member {"parentId"|undefined} _parentId + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @instance + */ + Object.defineProperty(DeleteGlobalOrganizationOperationRequest.prototype, "_parentId", { + get: $util.oneOfGetter($oneOfFields = ["parentId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteGlobalOrganizationOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest} DeleteGlobalOrganizationOperationRequest instance + */ + DeleteGlobalOrganizationOperationRequest.create = function create(properties) { + return new DeleteGlobalOrganizationOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest} message DeleteGlobalOrganizationOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOrganizationOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.parentId != null && Object.hasOwnProperty.call(message, "parentId")) + writer.uint32(/* id 459714768, wireType 2 =*/3677718146).string(message.parentId); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest} message DeleteGlobalOrganizationOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOrganizationOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalOrganizationOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest} DeleteGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOrganizationOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 459714768: + message.parentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalOrganizationOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest} DeleteGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOrganizationOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalOrganizationOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalOrganizationOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.parentId != null && message.hasOwnProperty("parentId")) { + properties._parentId = 1; + if (!$util.isString(message.parentId)) + return "parentId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteGlobalOrganizationOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest} DeleteGlobalOrganizationOperationRequest + */ + DeleteGlobalOrganizationOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.parentId != null) + message.parentId = String(object.parentId); + return message; + }; + + /** + * Creates a plain object from a DeleteGlobalOrganizationOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest} message DeleteGlobalOrganizationOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalOrganizationOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.parentId != null && message.hasOwnProperty("parentId")) { + object.parentId = message.parentId; + if (options.oneofs) + object._parentId = "parentId"; + } + return object; + }; + + /** + * Converts this DeleteGlobalOrganizationOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalOrganizationOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalOrganizationOperationRequest; + })(); + + v1.DeleteGlobalOrganizationOperationResponse = (function() { + + /** + * Properties of a DeleteGlobalOrganizationOperationResponse. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalOrganizationOperationResponse + */ + + /** + * Constructs a new DeleteGlobalOrganizationOperationResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalOrganizationOperationResponse. + * @implements IDeleteGlobalOrganizationOperationResponse + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse=} [properties] Properties to set + */ + function DeleteGlobalOrganizationOperationResponse(properties) { + if (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 DeleteGlobalOrganizationOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse} DeleteGlobalOrganizationOperationResponse instance + */ + DeleteGlobalOrganizationOperationResponse.create = function create(properties) { + return new DeleteGlobalOrganizationOperationResponse(properties); + }; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse} message DeleteGlobalOrganizationOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOrganizationOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalOrganizationOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse} message DeleteGlobalOrganizationOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalOrganizationOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalOrganizationOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse} DeleteGlobalOrganizationOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOrganizationOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalOrganizationOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse} DeleteGlobalOrganizationOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalOrganizationOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalOrganizationOperationResponse message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalOrganizationOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteGlobalOrganizationOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse} DeleteGlobalOrganizationOperationResponse + */ + DeleteGlobalOrganizationOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse) + return object; + return new $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse(); + }; + + /** + * Creates a plain object from a DeleteGlobalOrganizationOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @static + * @param {google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse} message DeleteGlobalOrganizationOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalOrganizationOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteGlobalOrganizationOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalOrganizationOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalOrganizationOperationResponse; + })(); + + v1.GetGlobalOrganizationOperationRequest = (function() { + + /** + * Properties of a GetGlobalOrganizationOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetGlobalOrganizationOperationRequest + * @property {string|null} [operation] GetGlobalOrganizationOperationRequest operation + * @property {string|null} [parentId] GetGlobalOrganizationOperationRequest parentId + */ + + /** + * Constructs a new GetGlobalOrganizationOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetGlobalOrganizationOperationRequest. + * @implements IGetGlobalOrganizationOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest=} [properties] Properties to set + */ + function GetGlobalOrganizationOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlobalOrganizationOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @instance + */ + GetGlobalOrganizationOperationRequest.prototype.operation = ""; + + /** + * GetGlobalOrganizationOperationRequest parentId. + * @member {string|null|undefined} parentId + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @instance + */ + GetGlobalOrganizationOperationRequest.prototype.parentId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGlobalOrganizationOperationRequest _parentId. + * @member {"parentId"|undefined} _parentId + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @instance + */ + Object.defineProperty(GetGlobalOrganizationOperationRequest.prototype, "_parentId", { + get: $util.oneOfGetter($oneOfFields = ["parentId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGlobalOrganizationOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetGlobalOrganizationOperationRequest} GetGlobalOrganizationOperationRequest instance + */ + GetGlobalOrganizationOperationRequest.create = function create(properties) { + return new GetGlobalOrganizationOperationRequest(properties); + }; + + /** + * Encodes the specified GetGlobalOrganizationOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOrganizationOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest} message GetGlobalOrganizationOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalOrganizationOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.parentId != null && Object.hasOwnProperty.call(message, "parentId")) + writer.uint32(/* id 459714768, wireType 2 =*/3677718146).string(message.parentId); + return writer; + }; + + /** + * Encodes the specified GetGlobalOrganizationOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalOrganizationOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest} message GetGlobalOrganizationOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalOrganizationOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalOrganizationOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetGlobalOrganizationOperationRequest} GetGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalOrganizationOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetGlobalOrganizationOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 459714768: + message.parentId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalOrganizationOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetGlobalOrganizationOperationRequest} GetGlobalOrganizationOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalOrganizationOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalOrganizationOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalOrganizationOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.parentId != null && message.hasOwnProperty("parentId")) { + properties._parentId = 1; + if (!$util.isString(message.parentId)) + return "parentId: string expected"; + } + return null; + }; + + /** + * Creates a GetGlobalOrganizationOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetGlobalOrganizationOperationRequest} GetGlobalOrganizationOperationRequest + */ + GetGlobalOrganizationOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetGlobalOrganizationOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetGlobalOrganizationOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.parentId != null) + message.parentId = String(object.parentId); + return message; + }; + + /** + * Creates a plain object from a GetGlobalOrganizationOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @static + * @param {google.cloud.compute.v1.GetGlobalOrganizationOperationRequest} message GetGlobalOrganizationOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalOrganizationOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.parentId != null && message.hasOwnProperty("parentId")) { + object.parentId = message.parentId; + if (options.oneofs) + object._parentId = "parentId"; + } + return object; + }; + + /** + * Converts this GetGlobalOrganizationOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetGlobalOrganizationOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalOrganizationOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlobalOrganizationOperationRequest; + })(); + + v1.ListGlobalOrganizationOperationsRequest = (function() { + + /** + * Properties of a ListGlobalOrganizationOperationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListGlobalOrganizationOperationsRequest + * @property {string|null} [filter] ListGlobalOrganizationOperationsRequest filter + * @property {number|null} [maxResults] ListGlobalOrganizationOperationsRequest maxResults + * @property {string|null} [orderBy] ListGlobalOrganizationOperationsRequest orderBy + * @property {string|null} [pageToken] ListGlobalOrganizationOperationsRequest pageToken + * @property {string|null} [parentId] ListGlobalOrganizationOperationsRequest parentId + * @property {boolean|null} [returnPartialSuccess] ListGlobalOrganizationOperationsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListGlobalOrganizationOperationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListGlobalOrganizationOperationsRequest. + * @implements IListGlobalOrganizationOperationsRequest + * @constructor + * @param {google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest=} [properties] Properties to set + */ + function ListGlobalOrganizationOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlobalOrganizationOperationsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + ListGlobalOrganizationOperationsRequest.prototype.filter = null; + + /** + * ListGlobalOrganizationOperationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + ListGlobalOrganizationOperationsRequest.prototype.maxResults = null; + + /** + * ListGlobalOrganizationOperationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + ListGlobalOrganizationOperationsRequest.prototype.orderBy = null; + + /** + * ListGlobalOrganizationOperationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + ListGlobalOrganizationOperationsRequest.prototype.pageToken = null; + + /** + * ListGlobalOrganizationOperationsRequest parentId. + * @member {string|null|undefined} parentId + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + ListGlobalOrganizationOperationsRequest.prototype.parentId = null; + + /** + * ListGlobalOrganizationOperationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + ListGlobalOrganizationOperationsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListGlobalOrganizationOperationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOrganizationOperationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOrganizationOperationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOrganizationOperationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOrganizationOperationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOrganizationOperationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOrganizationOperationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOrganizationOperationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOrganizationOperationsRequest _parentId. + * @member {"parentId"|undefined} _parentId + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOrganizationOperationsRequest.prototype, "_parentId", { + get: $util.oneOfGetter($oneOfFields = ["parentId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalOrganizationOperationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + */ + Object.defineProperty(ListGlobalOrganizationOperationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListGlobalOrganizationOperationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest} ListGlobalOrganizationOperationsRequest instance + */ + ListGlobalOrganizationOperationsRequest.create = function create(properties) { + return new ListGlobalOrganizationOperationsRequest(properties); + }; + + /** + * Encodes the specified ListGlobalOrganizationOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest} message ListGlobalOrganizationOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalOrganizationOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.parentId != null && Object.hasOwnProperty.call(message, "parentId")) + writer.uint32(/* id 459714768, wireType 2 =*/3677718146).string(message.parentId); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListGlobalOrganizationOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest} message ListGlobalOrganizationOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalOrganizationOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlobalOrganizationOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest} ListGlobalOrganizationOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalOrganizationOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 459714768: + message.parentId = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlobalOrganizationOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest} ListGlobalOrganizationOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalOrganizationOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlobalOrganizationOperationsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlobalOrganizationOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.parentId != null && message.hasOwnProperty("parentId")) { + properties._parentId = 1; + if (!$util.isString(message.parentId)) + return "parentId: string expected"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListGlobalOrganizationOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest} ListGlobalOrganizationOperationsRequest + */ + ListGlobalOrganizationOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.parentId != null) + message.parentId = String(object.parentId); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListGlobalOrganizationOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @static + * @param {google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest} message ListGlobalOrganizationOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlobalOrganizationOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.parentId != null && message.hasOwnProperty("parentId")) { + object.parentId = message.parentId; + if (options.oneofs) + object._parentId = "parentId"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListGlobalOrganizationOperationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlobalOrganizationOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlobalOrganizationOperationsRequest; + })(); + + v1.DeleteGlobalPublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of a DeleteGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteGlobalPublicDelegatedPrefixeRequest + * @property {string|null} [project] DeleteGlobalPublicDelegatedPrefixeRequest project + * @property {string|null} [publicDelegatedPrefix] DeleteGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix + * @property {string|null} [requestId] DeleteGlobalPublicDelegatedPrefixeRequest requestId + */ + + /** + * Constructs a new DeleteGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteGlobalPublicDelegatedPrefixeRequest. + * @implements IDeleteGlobalPublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function DeleteGlobalPublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGlobalPublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @instance + */ + DeleteGlobalPublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * DeleteGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix. + * @member {string} publicDelegatedPrefix + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @instance + */ + DeleteGlobalPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefix = ""; + + /** + * DeleteGlobalPublicDelegatedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @instance + */ + DeleteGlobalPublicDelegatedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteGlobalPublicDelegatedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @instance + */ + Object.defineProperty(DeleteGlobalPublicDelegatedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest} DeleteGlobalPublicDelegatedPrefixeRequest instance + */ + DeleteGlobalPublicDelegatedPrefixeRequest.create = function create(properties) { + return new DeleteGlobalPublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified DeleteGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest} message DeleteGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalPublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.publicDelegatedPrefix != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefix")) + writer.uint32(/* id 204238440, wireType 2 =*/1633907522).string(message.publicDelegatedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest} message DeleteGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGlobalPublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest} DeleteGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalPublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 204238440: + message.publicDelegatedPrefix = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest} DeleteGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGlobalPublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGlobalPublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGlobalPublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + if (!$util.isString(message.publicDelegatedPrefix)) + return "publicDelegatedPrefix: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest} DeleteGlobalPublicDelegatedPrefixeRequest + */ + DeleteGlobalPublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefix != null) + message.publicDelegatedPrefix = String(object.publicDelegatedPrefix); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest} message DeleteGlobalPublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGlobalPublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicDelegatedPrefix = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + object.publicDelegatedPrefix = message.publicDelegatedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteGlobalPublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGlobalPublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteGlobalPublicDelegatedPrefixeRequest; + })(); + + v1.GetGlobalPublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of a GetGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetGlobalPublicDelegatedPrefixeRequest + * @property {string|null} [project] GetGlobalPublicDelegatedPrefixeRequest project + * @property {string|null} [publicDelegatedPrefix] GetGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix + */ + + /** + * Constructs a new GetGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetGlobalPublicDelegatedPrefixeRequest. + * @implements IGetGlobalPublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function GetGlobalPublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGlobalPublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @instance + */ + GetGlobalPublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * GetGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix. + * @member {string} publicDelegatedPrefix + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @instance + */ + GetGlobalPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefix = ""; + + /** + * Creates a new GetGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest} GetGlobalPublicDelegatedPrefixeRequest instance + */ + GetGlobalPublicDelegatedPrefixeRequest.create = function create(properties) { + return new GetGlobalPublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified GetGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest} message GetGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalPublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicDelegatedPrefix != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefix")) + writer.uint32(/* id 204238440, wireType 2 =*/1633907522).string(message.publicDelegatedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest} message GetGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGlobalPublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest} GetGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalPublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 204238440: + message.publicDelegatedPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest} GetGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGlobalPublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGlobalPublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGlobalPublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + if (!$util.isString(message.publicDelegatedPrefix)) + return "publicDelegatedPrefix: string expected"; + return null; + }; + + /** + * Creates a GetGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest} GetGlobalPublicDelegatedPrefixeRequest + */ + GetGlobalPublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefix != null) + message.publicDelegatedPrefix = String(object.publicDelegatedPrefix); + return message; + }; + + /** + * Creates a plain object from a GetGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest} message GetGlobalPublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGlobalPublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicDelegatedPrefix = ""; + object.project = ""; + } + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + object.publicDelegatedPrefix = message.publicDelegatedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetGlobalPublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + GetGlobalPublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGlobalPublicDelegatedPrefixeRequest; + })(); + + v1.InsertGlobalPublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of an InsertGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertGlobalPublicDelegatedPrefixeRequest + * @property {string|null} [project] InsertGlobalPublicDelegatedPrefixeRequest project + * @property {google.cloud.compute.v1.IPublicDelegatedPrefix|null} [publicDelegatedPrefixResource] InsertGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource + * @property {string|null} [requestId] InsertGlobalPublicDelegatedPrefixeRequest requestId + */ + + /** + * Constructs a new InsertGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertGlobalPublicDelegatedPrefixeRequest. + * @implements IInsertGlobalPublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function InsertGlobalPublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertGlobalPublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @instance + */ + InsertGlobalPublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * InsertGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. + * @member {google.cloud.compute.v1.IPublicDelegatedPrefix|null|undefined} publicDelegatedPrefixResource + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @instance + */ + InsertGlobalPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefixResource = null; + + /** + * InsertGlobalPublicDelegatedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @instance + */ + InsertGlobalPublicDelegatedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertGlobalPublicDelegatedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @instance + */ + Object.defineProperty(InsertGlobalPublicDelegatedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest} InsertGlobalPublicDelegatedPrefixeRequest instance + */ + InsertGlobalPublicDelegatedPrefixeRequest.create = function create(properties) { + return new InsertGlobalPublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified InsertGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest} message InsertGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalPublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.publicDelegatedPrefixResource != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefixResource")) + $root.google.cloud.compute.v1.PublicDelegatedPrefix.encode(message.publicDelegatedPrefixResource, writer.uint32(/* id 47594501, wireType 2 =*/380756010).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest} message InsertGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertGlobalPublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest} InsertGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalPublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 47594501: + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest} InsertGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertGlobalPublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertGlobalPublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertGlobalPublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefix.verify(message.publicDelegatedPrefixResource); + if (error) + return "publicDelegatedPrefixResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest} InsertGlobalPublicDelegatedPrefixeRequest + */ + InsertGlobalPublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefixResource != null) { + if (typeof object.publicDelegatedPrefixResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest.publicDelegatedPrefixResource: object expected"); + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.fromObject(object.publicDelegatedPrefixResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest} message InsertGlobalPublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertGlobalPublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicDelegatedPrefixResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) + object.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.toObject(message.publicDelegatedPrefixResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertGlobalPublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + InsertGlobalPublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertGlobalPublicDelegatedPrefixeRequest; + })(); + + v1.ListGlobalPublicDelegatedPrefixesRequest = (function() { + + /** + * Properties of a ListGlobalPublicDelegatedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListGlobalPublicDelegatedPrefixesRequest + * @property {string|null} [filter] ListGlobalPublicDelegatedPrefixesRequest filter + * @property {number|null} [maxResults] ListGlobalPublicDelegatedPrefixesRequest maxResults + * @property {string|null} [orderBy] ListGlobalPublicDelegatedPrefixesRequest orderBy + * @property {string|null} [pageToken] ListGlobalPublicDelegatedPrefixesRequest pageToken + * @property {string|null} [project] ListGlobalPublicDelegatedPrefixesRequest project + * @property {boolean|null} [returnPartialSuccess] ListGlobalPublicDelegatedPrefixesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListGlobalPublicDelegatedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListGlobalPublicDelegatedPrefixesRequest. + * @implements IListGlobalPublicDelegatedPrefixesRequest + * @constructor + * @param {google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest=} [properties] Properties to set + */ + function ListGlobalPublicDelegatedPrefixesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGlobalPublicDelegatedPrefixesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + ListGlobalPublicDelegatedPrefixesRequest.prototype.filter = null; + + /** + * ListGlobalPublicDelegatedPrefixesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + ListGlobalPublicDelegatedPrefixesRequest.prototype.maxResults = null; + + /** + * ListGlobalPublicDelegatedPrefixesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + ListGlobalPublicDelegatedPrefixesRequest.prototype.orderBy = null; + + /** + * ListGlobalPublicDelegatedPrefixesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + ListGlobalPublicDelegatedPrefixesRequest.prototype.pageToken = null; + + /** + * ListGlobalPublicDelegatedPrefixesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + ListGlobalPublicDelegatedPrefixesRequest.prototype.project = ""; + + /** + * ListGlobalPublicDelegatedPrefixesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + ListGlobalPublicDelegatedPrefixesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListGlobalPublicDelegatedPrefixesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListGlobalPublicDelegatedPrefixesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalPublicDelegatedPrefixesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListGlobalPublicDelegatedPrefixesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalPublicDelegatedPrefixesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListGlobalPublicDelegatedPrefixesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalPublicDelegatedPrefixesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListGlobalPublicDelegatedPrefixesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListGlobalPublicDelegatedPrefixesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListGlobalPublicDelegatedPrefixesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListGlobalPublicDelegatedPrefixesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest} ListGlobalPublicDelegatedPrefixesRequest instance + */ + ListGlobalPublicDelegatedPrefixesRequest.create = function create(properties) { + return new ListGlobalPublicDelegatedPrefixesRequest(properties); + }; + + /** + * Encodes the specified ListGlobalPublicDelegatedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest} message ListGlobalPublicDelegatedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalPublicDelegatedPrefixesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListGlobalPublicDelegatedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest} message ListGlobalPublicDelegatedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGlobalPublicDelegatedPrefixesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGlobalPublicDelegatedPrefixesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest} ListGlobalPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalPublicDelegatedPrefixesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGlobalPublicDelegatedPrefixesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest} ListGlobalPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGlobalPublicDelegatedPrefixesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGlobalPublicDelegatedPrefixesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGlobalPublicDelegatedPrefixesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListGlobalPublicDelegatedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest} ListGlobalPublicDelegatedPrefixesRequest + */ + ListGlobalPublicDelegatedPrefixesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListGlobalPublicDelegatedPrefixesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest} message ListGlobalPublicDelegatedPrefixesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGlobalPublicDelegatedPrefixesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListGlobalPublicDelegatedPrefixesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest + * @instance + * @returns {Object.} JSON object + */ + ListGlobalPublicDelegatedPrefixesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListGlobalPublicDelegatedPrefixesRequest; + })(); + + v1.PatchGlobalPublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of a PatchGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchGlobalPublicDelegatedPrefixeRequest + * @property {string|null} [project] PatchGlobalPublicDelegatedPrefixeRequest project + * @property {string|null} [publicDelegatedPrefix] PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix + * @property {google.cloud.compute.v1.IPublicDelegatedPrefix|null} [publicDelegatedPrefixResource] PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource + * @property {string|null} [requestId] PatchGlobalPublicDelegatedPrefixeRequest requestId + */ + + /** + * Constructs a new PatchGlobalPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchGlobalPublicDelegatedPrefixeRequest. + * @implements IPatchGlobalPublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function PatchGlobalPublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchGlobalPublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @instance + */ + PatchGlobalPublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefix. + * @member {string} publicDelegatedPrefix + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @instance + */ + PatchGlobalPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefix = ""; + + /** + * PatchGlobalPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. + * @member {google.cloud.compute.v1.IPublicDelegatedPrefix|null|undefined} publicDelegatedPrefixResource + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @instance + */ + PatchGlobalPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefixResource = null; + + /** + * PatchGlobalPublicDelegatedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @instance + */ + PatchGlobalPublicDelegatedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchGlobalPublicDelegatedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @instance + */ + Object.defineProperty(PatchGlobalPublicDelegatedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchGlobalPublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest} PatchGlobalPublicDelegatedPrefixeRequest instance + */ + PatchGlobalPublicDelegatedPrefixeRequest.create = function create(properties) { + return new PatchGlobalPublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified PatchGlobalPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest} message PatchGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchGlobalPublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.publicDelegatedPrefixResource != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefixResource")) + $root.google.cloud.compute.v1.PublicDelegatedPrefix.encode(message.publicDelegatedPrefixResource, writer.uint32(/* id 47594501, wireType 2 =*/380756010).fork()).ldelim(); + if (message.publicDelegatedPrefix != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefix")) + writer.uint32(/* id 204238440, wireType 2 =*/1633907522).string(message.publicDelegatedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified PatchGlobalPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest} message PatchGlobalPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchGlobalPublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest} PatchGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchGlobalPublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 204238440: + message.publicDelegatedPrefix = reader.string(); + break; + case 47594501: + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchGlobalPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest} PatchGlobalPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchGlobalPublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchGlobalPublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchGlobalPublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + if (!$util.isString(message.publicDelegatedPrefix)) + return "publicDelegatedPrefix: string expected"; + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefix.verify(message.publicDelegatedPrefixResource); + if (error) + return "publicDelegatedPrefixResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchGlobalPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest} PatchGlobalPublicDelegatedPrefixeRequest + */ + PatchGlobalPublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefix != null) + message.publicDelegatedPrefix = String(object.publicDelegatedPrefix); + if (object.publicDelegatedPrefixResource != null) { + if (typeof object.publicDelegatedPrefixResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest.publicDelegatedPrefixResource: object expected"); + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.fromObject(object.publicDelegatedPrefixResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchGlobalPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest} message PatchGlobalPublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchGlobalPublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicDelegatedPrefixResource = null; + object.publicDelegatedPrefix = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) + object.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.toObject(message.publicDelegatedPrefixResource, options); + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + object.publicDelegatedPrefix = message.publicDelegatedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this PatchGlobalPublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + PatchGlobalPublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchGlobalPublicDelegatedPrefixeRequest; + })(); + + v1.AggregatedListHealthChecksRequest = (function() { + + /** + * Properties of an AggregatedListHealthChecksRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListHealthChecksRequest + * @property {string|null} [filter] AggregatedListHealthChecksRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListHealthChecksRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListHealthChecksRequest maxResults + * @property {string|null} [orderBy] AggregatedListHealthChecksRequest orderBy + * @property {string|null} [pageToken] AggregatedListHealthChecksRequest pageToken + * @property {string|null} [project] AggregatedListHealthChecksRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListHealthChecksRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListHealthChecksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListHealthChecksRequest. + * @implements IAggregatedListHealthChecksRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListHealthChecksRequest=} [properties] Properties to set + */ + function AggregatedListHealthChecksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListHealthChecksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + AggregatedListHealthChecksRequest.prototype.filter = null; + + /** + * AggregatedListHealthChecksRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + AggregatedListHealthChecksRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListHealthChecksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + AggregatedListHealthChecksRequest.prototype.maxResults = null; + + /** + * AggregatedListHealthChecksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + AggregatedListHealthChecksRequest.prototype.orderBy = null; + + /** + * AggregatedListHealthChecksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + AggregatedListHealthChecksRequest.prototype.pageToken = null; + + /** + * AggregatedListHealthChecksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + AggregatedListHealthChecksRequest.prototype.project = ""; + + /** + * AggregatedListHealthChecksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + AggregatedListHealthChecksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListHealthChecksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + Object.defineProperty(AggregatedListHealthChecksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListHealthChecksRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + Object.defineProperty(AggregatedListHealthChecksRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListHealthChecksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + Object.defineProperty(AggregatedListHealthChecksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListHealthChecksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + Object.defineProperty(AggregatedListHealthChecksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListHealthChecksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + Object.defineProperty(AggregatedListHealthChecksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListHealthChecksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + */ + Object.defineProperty(AggregatedListHealthChecksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListHealthChecksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListHealthChecksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListHealthChecksRequest} AggregatedListHealthChecksRequest instance + */ + AggregatedListHealthChecksRequest.create = function create(properties) { + return new AggregatedListHealthChecksRequest(properties); + }; + + /** + * Encodes the specified AggregatedListHealthChecksRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListHealthChecksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListHealthChecksRequest} message AggregatedListHealthChecksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListHealthChecksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListHealthChecksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListHealthChecksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListHealthChecksRequest} message AggregatedListHealthChecksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListHealthChecksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListHealthChecksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListHealthChecksRequest} AggregatedListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListHealthChecksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListHealthChecksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListHealthChecksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListHealthChecksRequest} AggregatedListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListHealthChecksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListHealthChecksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListHealthChecksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListHealthChecksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListHealthChecksRequest} AggregatedListHealthChecksRequest + */ + AggregatedListHealthChecksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListHealthChecksRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListHealthChecksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListHealthChecksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListHealthChecksRequest} message AggregatedListHealthChecksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListHealthChecksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListHealthChecksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListHealthChecksRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListHealthChecksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListHealthChecksRequest; + })(); + + v1.DeleteHealthCheckRequest = (function() { + + /** + * Properties of a DeleteHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteHealthCheckRequest + * @property {string|null} [healthCheck] DeleteHealthCheckRequest healthCheck + * @property {string|null} [project] DeleteHealthCheckRequest project + * @property {string|null} [requestId] DeleteHealthCheckRequest requestId + */ + + /** + * Constructs a new DeleteHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteHealthCheckRequest. + * @implements IDeleteHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteHealthCheckRequest=} [properties] Properties to set + */ + function DeleteHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @instance + */ + DeleteHealthCheckRequest.prototype.healthCheck = ""; + + /** + * DeleteHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @instance + */ + DeleteHealthCheckRequest.prototype.project = ""; + + /** + * DeleteHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @instance + */ + DeleteHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @instance + */ + Object.defineProperty(DeleteHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IDeleteHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteHealthCheckRequest} DeleteHealthCheckRequest instance + */ + DeleteHealthCheckRequest.create = function create(properties) { + return new DeleteHealthCheckRequest(properties); + }; + + /** + * Encodes the specified DeleteHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IDeleteHealthCheckRequest} message DeleteHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified DeleteHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IDeleteHealthCheckRequest} message DeleteHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteHealthCheckRequest} DeleteHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteHealthCheckRequest} DeleteHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteHealthCheckRequest} DeleteHealthCheckRequest + */ + DeleteHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.DeleteHealthCheckRequest} message DeleteHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.healthCheck = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this DeleteHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteHealthCheckRequest; + })(); + + v1.GetHealthCheckRequest = (function() { + + /** + * Properties of a GetHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetHealthCheckRequest + * @property {string|null} [healthCheck] GetHealthCheckRequest healthCheck + * @property {string|null} [project] GetHealthCheckRequest project + */ + + /** + * Constructs a new GetHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetHealthCheckRequest. + * @implements IGetHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IGetHealthCheckRequest=} [properties] Properties to set + */ + function GetHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @instance + */ + GetHealthCheckRequest.prototype.healthCheck = ""; + + /** + * GetHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @instance + */ + GetHealthCheckRequest.prototype.project = ""; + + /** + * Creates a new GetHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetHealthCheckRequest} GetHealthCheckRequest instance + */ + GetHealthCheckRequest.create = function create(properties) { + return new GetHealthCheckRequest(properties); + }; + + /** + * Encodes the specified GetHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthCheckRequest} message GetHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified GetHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthCheckRequest} message GetHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetHealthCheckRequest} GetHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetHealthCheckRequest} GetHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetHealthCheckRequest} GetHealthCheckRequest + */ + GetHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.GetHealthCheckRequest} message GetHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.healthCheck = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this GetHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + GetHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetHealthCheckRequest; + })(); + + v1.InsertHealthCheckRequest = (function() { + + /** + * Properties of an InsertHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertHealthCheckRequest + * @property {google.cloud.compute.v1.IHealthCheck|null} [healthCheckResource] InsertHealthCheckRequest healthCheckResource + * @property {string|null} [project] InsertHealthCheckRequest project + * @property {string|null} [requestId] InsertHealthCheckRequest requestId + */ + + /** + * Constructs a new InsertHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertHealthCheckRequest. + * @implements IInsertHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertHealthCheckRequest=} [properties] Properties to set + */ + function InsertHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertHealthCheckRequest healthCheckResource. + * @member {google.cloud.compute.v1.IHealthCheck|null|undefined} healthCheckResource + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @instance + */ + InsertHealthCheckRequest.prototype.healthCheckResource = null; + + /** + * InsertHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @instance + */ + InsertHealthCheckRequest.prototype.project = ""; + + /** + * InsertHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @instance + */ + InsertHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @instance + */ + Object.defineProperty(InsertHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IInsertHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertHealthCheckRequest} InsertHealthCheckRequest instance + */ + InsertHealthCheckRequest.create = function create(properties) { + return new InsertHealthCheckRequest(properties); + }; + + /** + * Encodes the specified InsertHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IInsertHealthCheckRequest} message InsertHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.healthCheckResource != null && Object.hasOwnProperty.call(message, "healthCheckResource")) + $root.google.cloud.compute.v1.HealthCheck.encode(message.healthCheckResource, writer.uint32(/* id 201925032, wireType 2 =*/1615400258).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IInsertHealthCheckRequest} message InsertHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertHealthCheckRequest} InsertHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 201925032: + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertHealthCheckRequest} InsertHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.healthCheckResource); + if (error) + return "healthCheckResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertHealthCheckRequest} InsertHealthCheckRequest + */ + InsertHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertHealthCheckRequest(); + if (object.healthCheckResource != null) { + if (typeof object.healthCheckResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertHealthCheckRequest.healthCheckResource: object expected"); + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.healthCheckResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.InsertHealthCheckRequest} message InsertHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.healthCheckResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) + object.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.toObject(message.healthCheckResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + InsertHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertHealthCheckRequest; + })(); + + v1.ListHealthChecksRequest = (function() { + + /** + * Properties of a ListHealthChecksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListHealthChecksRequest + * @property {string|null} [filter] ListHealthChecksRequest filter + * @property {number|null} [maxResults] ListHealthChecksRequest maxResults + * @property {string|null} [orderBy] ListHealthChecksRequest orderBy + * @property {string|null} [pageToken] ListHealthChecksRequest pageToken + * @property {string|null} [project] ListHealthChecksRequest project + * @property {boolean|null} [returnPartialSuccess] ListHealthChecksRequest returnPartialSuccess + */ + + /** + * Constructs a new ListHealthChecksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListHealthChecksRequest. + * @implements IListHealthChecksRequest + * @constructor + * @param {google.cloud.compute.v1.IListHealthChecksRequest=} [properties] Properties to set + */ + function ListHealthChecksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHealthChecksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + ListHealthChecksRequest.prototype.filter = null; + + /** + * ListHealthChecksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + ListHealthChecksRequest.prototype.maxResults = null; + + /** + * ListHealthChecksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + ListHealthChecksRequest.prototype.orderBy = null; + + /** + * ListHealthChecksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + ListHealthChecksRequest.prototype.pageToken = null; + + /** + * ListHealthChecksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + ListHealthChecksRequest.prototype.project = ""; + + /** + * ListHealthChecksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + ListHealthChecksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListHealthChecksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + Object.defineProperty(ListHealthChecksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListHealthChecksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + Object.defineProperty(ListHealthChecksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListHealthChecksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + Object.defineProperty(ListHealthChecksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListHealthChecksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + Object.defineProperty(ListHealthChecksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListHealthChecksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + */ + Object.defineProperty(ListHealthChecksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListHealthChecksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IListHealthChecksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListHealthChecksRequest} ListHealthChecksRequest instance + */ + ListHealthChecksRequest.create = function create(properties) { + return new ListHealthChecksRequest(properties); + }; + + /** + * Encodes the specified ListHealthChecksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListHealthChecksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IListHealthChecksRequest} message ListHealthChecksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHealthChecksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListHealthChecksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListHealthChecksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IListHealthChecksRequest} message ListHealthChecksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHealthChecksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHealthChecksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListHealthChecksRequest} ListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHealthChecksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListHealthChecksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHealthChecksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListHealthChecksRequest} ListHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHealthChecksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHealthChecksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHealthChecksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListHealthChecksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListHealthChecksRequest} ListHealthChecksRequest + */ + ListHealthChecksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListHealthChecksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListHealthChecksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListHealthChecksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.ListHealthChecksRequest} message ListHealthChecksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHealthChecksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListHealthChecksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListHealthChecksRequest + * @instance + * @returns {Object.} JSON object + */ + ListHealthChecksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListHealthChecksRequest; + })(); + + v1.PatchHealthCheckRequest = (function() { + + /** + * Properties of a PatchHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchHealthCheckRequest + * @property {string|null} [healthCheck] PatchHealthCheckRequest healthCheck + * @property {google.cloud.compute.v1.IHealthCheck|null} [healthCheckResource] PatchHealthCheckRequest healthCheckResource + * @property {string|null} [project] PatchHealthCheckRequest project + * @property {string|null} [requestId] PatchHealthCheckRequest requestId + */ + + /** + * Constructs a new PatchHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchHealthCheckRequest. + * @implements IPatchHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchHealthCheckRequest=} [properties] Properties to set + */ + function PatchHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @instance + */ + PatchHealthCheckRequest.prototype.healthCheck = ""; + + /** + * PatchHealthCheckRequest healthCheckResource. + * @member {google.cloud.compute.v1.IHealthCheck|null|undefined} healthCheckResource + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @instance + */ + PatchHealthCheckRequest.prototype.healthCheckResource = null; + + /** + * PatchHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @instance + */ + PatchHealthCheckRequest.prototype.project = ""; + + /** + * PatchHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @instance + */ + PatchHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @instance + */ + Object.defineProperty(PatchHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IPatchHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchHealthCheckRequest} PatchHealthCheckRequest instance + */ + PatchHealthCheckRequest.create = function create(properties) { + return new PatchHealthCheckRequest(properties); + }; + + /** + * Encodes the specified PatchHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IPatchHealthCheckRequest} message PatchHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.healthCheckResource != null && Object.hasOwnProperty.call(message, "healthCheckResource")) + $root.google.cloud.compute.v1.HealthCheck.encode(message.healthCheckResource, writer.uint32(/* id 201925032, wireType 2 =*/1615400258).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified PatchHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IPatchHealthCheckRequest} message PatchHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchHealthCheckRequest} PatchHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 201925032: + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchHealthCheckRequest} PatchHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.healthCheckResource); + if (error) + return "healthCheckResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchHealthCheckRequest} PatchHealthCheckRequest + */ + PatchHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.healthCheckResource != null) { + if (typeof object.healthCheckResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchHealthCheckRequest.healthCheckResource: object expected"); + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.healthCheckResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.PatchHealthCheckRequest} message PatchHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.healthCheckResource = null; + object.project = ""; + object.healthCheck = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) + object.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.toObject(message.healthCheckResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this PatchHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + PatchHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchHealthCheckRequest; + })(); + + v1.UpdateHealthCheckRequest = (function() { + + /** + * Properties of an UpdateHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateHealthCheckRequest + * @property {string|null} [healthCheck] UpdateHealthCheckRequest healthCheck + * @property {google.cloud.compute.v1.IHealthCheck|null} [healthCheckResource] UpdateHealthCheckRequest healthCheckResource + * @property {string|null} [project] UpdateHealthCheckRequest project + * @property {string|null} [requestId] UpdateHealthCheckRequest requestId + */ + + /** + * Constructs a new UpdateHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateHealthCheckRequest. + * @implements IUpdateHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateHealthCheckRequest=} [properties] Properties to set + */ + function UpdateHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @instance + */ + UpdateHealthCheckRequest.prototype.healthCheck = ""; + + /** + * UpdateHealthCheckRequest healthCheckResource. + * @member {google.cloud.compute.v1.IHealthCheck|null|undefined} healthCheckResource + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @instance + */ + UpdateHealthCheckRequest.prototype.healthCheckResource = null; + + /** + * UpdateHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @instance + */ + UpdateHealthCheckRequest.prototype.project = ""; + + /** + * UpdateHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @instance + */ + UpdateHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @instance + */ + Object.defineProperty(UpdateHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IUpdateHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateHealthCheckRequest} UpdateHealthCheckRequest instance + */ + UpdateHealthCheckRequest.create = function create(properties) { + return new UpdateHealthCheckRequest(properties); + }; + + /** + * Encodes the specified UpdateHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IUpdateHealthCheckRequest} message UpdateHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.healthCheckResource != null && Object.hasOwnProperty.call(message, "healthCheckResource")) + $root.google.cloud.compute.v1.HealthCheck.encode(message.healthCheckResource, writer.uint32(/* id 201925032, wireType 2 =*/1615400258).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified UpdateHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IUpdateHealthCheckRequest} message UpdateHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateHealthCheckRequest} UpdateHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 201925032: + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateHealthCheckRequest} UpdateHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.healthCheckResource); + if (error) + return "healthCheckResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdateHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateHealthCheckRequest} UpdateHealthCheckRequest + */ + UpdateHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.healthCheckResource != null) { + if (typeof object.healthCheckResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateHealthCheckRequest.healthCheckResource: object expected"); + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.healthCheckResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.UpdateHealthCheckRequest} message UpdateHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.healthCheckResource = null; + object.project = ""; + object.healthCheck = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) + object.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.toObject(message.healthCheckResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this UpdateHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateHealthCheckRequest; + })(); + + v1.DeleteImageRequest = (function() { + + /** + * Properties of a DeleteImageRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteImageRequest + * @property {string|null} [image] DeleteImageRequest image + * @property {string|null} [project] DeleteImageRequest project + * @property {string|null} [requestId] DeleteImageRequest requestId + */ + + /** + * Constructs a new DeleteImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteImageRequest. + * @implements IDeleteImageRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteImageRequest=} [properties] Properties to set + */ + function DeleteImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteImageRequest image. + * @member {string} image + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @instance + */ + DeleteImageRequest.prototype.image = ""; + + /** + * DeleteImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @instance + */ + DeleteImageRequest.prototype.project = ""; + + /** + * DeleteImageRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @instance + */ + DeleteImageRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteImageRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @instance + */ + Object.defineProperty(DeleteImageRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {google.cloud.compute.v1.IDeleteImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteImageRequest} DeleteImageRequest instance + */ + DeleteImageRequest.create = function create(properties) { + return new DeleteImageRequest(properties); + }; + + /** + * Encodes the specified DeleteImageRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {google.cloud.compute.v1.IDeleteImageRequest} message DeleteImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 100313435, wireType 2 =*/802507482).string(message.image); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {google.cloud.compute.v1.IDeleteImageRequest} message DeleteImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteImageRequest} DeleteImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100313435: + message.image = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteImageRequest} DeleteImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteImageRequest} DeleteImageRequest + */ + DeleteImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteImageRequest(); + if (object.image != null) + message.image = String(object.image); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @static + * @param {google.cloud.compute.v1.DeleteImageRequest} message DeleteImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.image = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteImageRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteImageRequest; + })(); + + v1.DeprecateImageRequest = (function() { + + /** + * Properties of a DeprecateImageRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeprecateImageRequest + * @property {google.cloud.compute.v1.IDeprecationStatus|null} [deprecationStatusResource] DeprecateImageRequest deprecationStatusResource + * @property {string|null} [image] DeprecateImageRequest image + * @property {string|null} [project] DeprecateImageRequest project + * @property {string|null} [requestId] DeprecateImageRequest requestId + */ + + /** + * Constructs a new DeprecateImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeprecateImageRequest. + * @implements IDeprecateImageRequest + * @constructor + * @param {google.cloud.compute.v1.IDeprecateImageRequest=} [properties] Properties to set + */ + function DeprecateImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeprecateImageRequest deprecationStatusResource. + * @member {google.cloud.compute.v1.IDeprecationStatus|null|undefined} deprecationStatusResource + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @instance + */ + DeprecateImageRequest.prototype.deprecationStatusResource = null; + + /** + * DeprecateImageRequest image. + * @member {string} image + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @instance + */ + DeprecateImageRequest.prototype.image = ""; + + /** + * DeprecateImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @instance + */ + DeprecateImageRequest.prototype.project = ""; + + /** + * DeprecateImageRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @instance + */ + DeprecateImageRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeprecateImageRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @instance + */ + Object.defineProperty(DeprecateImageRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeprecateImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {google.cloud.compute.v1.IDeprecateImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeprecateImageRequest} DeprecateImageRequest instance + */ + DeprecateImageRequest.create = function create(properties) { + return new DeprecateImageRequest(properties); + }; + + /** + * Encodes the specified DeprecateImageRequest message. Does not implicitly {@link google.cloud.compute.v1.DeprecateImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {google.cloud.compute.v1.IDeprecateImageRequest} message DeprecateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecateImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 100313435, wireType 2 =*/802507482).string(message.image); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.deprecationStatusResource != null && Object.hasOwnProperty.call(message, "deprecationStatusResource")) + $root.google.cloud.compute.v1.DeprecationStatus.encode(message.deprecationStatusResource, writer.uint32(/* id 333006064, wireType 2 =*/2664048514).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeprecateImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeprecateImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {google.cloud.compute.v1.IDeprecateImageRequest} message DeprecateImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeprecateImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeprecateImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeprecateImageRequest} DeprecateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecateImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeprecateImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 333006064: + message.deprecationStatusResource = $root.google.cloud.compute.v1.DeprecationStatus.decode(reader, reader.uint32()); + break; + case 100313435: + message.image = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeprecateImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeprecateImageRequest} DeprecateImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeprecateImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeprecateImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeprecateImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deprecationStatusResource != null && message.hasOwnProperty("deprecationStatusResource")) { + var error = $root.google.cloud.compute.v1.DeprecationStatus.verify(message.deprecationStatusResource); + if (error) + return "deprecationStatusResource." + error; + } + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeprecateImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeprecateImageRequest} DeprecateImageRequest + */ + DeprecateImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeprecateImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeprecateImageRequest(); + if (object.deprecationStatusResource != null) { + if (typeof object.deprecationStatusResource !== "object") + throw TypeError(".google.cloud.compute.v1.DeprecateImageRequest.deprecationStatusResource: object expected"); + message.deprecationStatusResource = $root.google.cloud.compute.v1.DeprecationStatus.fromObject(object.deprecationStatusResource); + } + if (object.image != null) + message.image = String(object.image); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeprecateImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @static + * @param {google.cloud.compute.v1.DeprecateImageRequest} message DeprecateImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeprecateImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.image = ""; + object.project = ""; + object.deprecationStatusResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.deprecationStatusResource != null && message.hasOwnProperty("deprecationStatusResource")) + object.deprecationStatusResource = $root.google.cloud.compute.v1.DeprecationStatus.toObject(message.deprecationStatusResource, options); + return object; + }; + + /** + * Converts this DeprecateImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeprecateImageRequest + * @instance + * @returns {Object.} JSON object + */ + DeprecateImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeprecateImageRequest; + })(); + + v1.GetImageRequest = (function() { + + /** + * Properties of a GetImageRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetImageRequest + * @property {string|null} [image] GetImageRequest image + * @property {string|null} [project] GetImageRequest project + */ + + /** + * Constructs a new GetImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetImageRequest. + * @implements IGetImageRequest + * @constructor + * @param {google.cloud.compute.v1.IGetImageRequest=} [properties] Properties to set + */ + function GetImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetImageRequest image. + * @member {string} image + * @memberof google.cloud.compute.v1.GetImageRequest + * @instance + */ + GetImageRequest.prototype.image = ""; + + /** + * GetImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetImageRequest + * @instance + */ + GetImageRequest.prototype.project = ""; + + /** + * Creates a new GetImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {google.cloud.compute.v1.IGetImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetImageRequest} GetImageRequest instance + */ + GetImageRequest.create = function create(properties) { + return new GetImageRequest(properties); + }; + + /** + * Encodes the specified GetImageRequest message. Does not implicitly {@link google.cloud.compute.v1.GetImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {google.cloud.compute.v1.IGetImageRequest} message GetImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 100313435, wireType 2 =*/802507482).string(message.image); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {google.cloud.compute.v1.IGetImageRequest} message GetImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetImageRequest} GetImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100313435: + message.image = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetImageRequest} GetImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetImageRequest.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetImageRequest} GetImageRequest + */ + GetImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetImageRequest(); + if (object.image != null) + message.image = String(object.image); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetImageRequest + * @static + * @param {google.cloud.compute.v1.GetImageRequest} message GetImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.image = ""; + object.project = ""; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetImageRequest + * @instance + * @returns {Object.} JSON object + */ + GetImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetImageRequest; + })(); + + v1.GetFromFamilyImageRequest = (function() { + + /** + * Properties of a GetFromFamilyImageRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetFromFamilyImageRequest + * @property {string|null} [family] GetFromFamilyImageRequest family + * @property {string|null} [project] GetFromFamilyImageRequest project + */ + + /** + * Constructs a new GetFromFamilyImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetFromFamilyImageRequest. + * @implements IGetFromFamilyImageRequest + * @constructor + * @param {google.cloud.compute.v1.IGetFromFamilyImageRequest=} [properties] Properties to set + */ + function GetFromFamilyImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFromFamilyImageRequest family. + * @member {string} family + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @instance + */ + GetFromFamilyImageRequest.prototype.family = ""; + + /** + * GetFromFamilyImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @instance + */ + GetFromFamilyImageRequest.prototype.project = ""; + + /** + * Creates a new GetFromFamilyImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {google.cloud.compute.v1.IGetFromFamilyImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetFromFamilyImageRequest} GetFromFamilyImageRequest instance + */ + GetFromFamilyImageRequest.create = function create(properties) { + return new GetFromFamilyImageRequest(properties); + }; + + /** + * Encodes the specified GetFromFamilyImageRequest message. Does not implicitly {@link google.cloud.compute.v1.GetFromFamilyImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {google.cloud.compute.v1.IGetFromFamilyImageRequest} message GetFromFamilyImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFromFamilyImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.family != null && Object.hasOwnProperty.call(message, "family")) + writer.uint32(/* id 328751972, wireType 2 =*/2630015778).string(message.family); + return writer; + }; + + /** + * Encodes the specified GetFromFamilyImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetFromFamilyImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {google.cloud.compute.v1.IGetFromFamilyImageRequest} message GetFromFamilyImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFromFamilyImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFromFamilyImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetFromFamilyImageRequest} GetFromFamilyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFromFamilyImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetFromFamilyImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 328751972: + message.family = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFromFamilyImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetFromFamilyImageRequest} GetFromFamilyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFromFamilyImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFromFamilyImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFromFamilyImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.family != null && message.hasOwnProperty("family")) + if (!$util.isString(message.family)) + return "family: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetFromFamilyImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetFromFamilyImageRequest} GetFromFamilyImageRequest + */ + GetFromFamilyImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetFromFamilyImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetFromFamilyImageRequest(); + if (object.family != null) + message.family = String(object.family); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetFromFamilyImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @static + * @param {google.cloud.compute.v1.GetFromFamilyImageRequest} message GetFromFamilyImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFromFamilyImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.family = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.family != null && message.hasOwnProperty("family")) + object.family = message.family; + return object; + }; + + /** + * Converts this GetFromFamilyImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetFromFamilyImageRequest + * @instance + * @returns {Object.} JSON object + */ + GetFromFamilyImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetFromFamilyImageRequest; + })(); + + v1.GetIamPolicyImageRequest = (function() { + + /** + * Properties of a GetIamPolicyImageRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyImageRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyImageRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyImageRequest project + * @property {string|null} [resource] GetIamPolicyImageRequest resource + */ + + /** + * Constructs a new GetIamPolicyImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyImageRequest. + * @implements IGetIamPolicyImageRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyImageRequest=} [properties] Properties to set + */ + function GetIamPolicyImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyImageRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @instance + */ + GetIamPolicyImageRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @instance + */ + GetIamPolicyImageRequest.prototype.project = ""; + + /** + * GetIamPolicyImageRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @instance + */ + GetIamPolicyImageRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyImageRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @instance + */ + Object.defineProperty(GetIamPolicyImageRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyImageRequest} GetIamPolicyImageRequest instance + */ + GetIamPolicyImageRequest.create = function create(properties) { + return new GetIamPolicyImageRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyImageRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyImageRequest} message GetIamPolicyImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyImageRequest} message GetIamPolicyImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyImageRequest} GetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyImageRequest} GetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyImageRequest} GetIamPolicyImageRequest + */ + GetIamPolicyImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyImageRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyImageRequest} message GetIamPolicyImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyImageRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyImageRequest; + })(); + + v1.InsertImageRequest = (function() { + + /** + * Properties of an InsertImageRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertImageRequest + * @property {boolean|null} [forceCreate] InsertImageRequest forceCreate + * @property {google.cloud.compute.v1.IImage|null} [imageResource] InsertImageRequest imageResource + * @property {string|null} [project] InsertImageRequest project + * @property {string|null} [requestId] InsertImageRequest requestId + */ + + /** + * Constructs a new InsertImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertImageRequest. + * @implements IInsertImageRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertImageRequest=} [properties] Properties to set + */ + function InsertImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertImageRequest forceCreate. + * @member {boolean|null|undefined} forceCreate + * @memberof google.cloud.compute.v1.InsertImageRequest + * @instance + */ + InsertImageRequest.prototype.forceCreate = null; + + /** + * InsertImageRequest imageResource. + * @member {google.cloud.compute.v1.IImage|null|undefined} imageResource + * @memberof google.cloud.compute.v1.InsertImageRequest + * @instance + */ + InsertImageRequest.prototype.imageResource = null; + + /** + * InsertImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertImageRequest + * @instance + */ + InsertImageRequest.prototype.project = ""; + + /** + * InsertImageRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertImageRequest + * @instance + */ + InsertImageRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertImageRequest _forceCreate. + * @member {"forceCreate"|undefined} _forceCreate + * @memberof google.cloud.compute.v1.InsertImageRequest + * @instance + */ + Object.defineProperty(InsertImageRequest.prototype, "_forceCreate", { + get: $util.oneOfGetter($oneOfFields = ["forceCreate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InsertImageRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertImageRequest + * @instance + */ + Object.defineProperty(InsertImageRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {google.cloud.compute.v1.IInsertImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertImageRequest} InsertImageRequest instance + */ + InsertImageRequest.create = function create(properties) { + return new InsertImageRequest(properties); + }; + + /** + * Encodes the specified InsertImageRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {google.cloud.compute.v1.IInsertImageRequest} message InsertImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.forceCreate != null && Object.hasOwnProperty.call(message, "forceCreate")) + writer.uint32(/* id 197723344, wireType 0 =*/1581786752).bool(message.forceCreate); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.imageResource != null && Object.hasOwnProperty.call(message, "imageResource")) + $root.google.cloud.compute.v1.Image.encode(message.imageResource, writer.uint32(/* id 371171954, wireType 2 =*/2969375634).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {google.cloud.compute.v1.IInsertImageRequest} message InsertImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertImageRequest} InsertImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 197723344: + message.forceCreate = reader.bool(); + break; + case 371171954: + message.imageResource = $root.google.cloud.compute.v1.Image.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertImageRequest} InsertImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.forceCreate != null && message.hasOwnProperty("forceCreate")) { + properties._forceCreate = 1; + if (typeof message.forceCreate !== "boolean") + return "forceCreate: boolean expected"; + } + if (message.imageResource != null && message.hasOwnProperty("imageResource")) { + var error = $root.google.cloud.compute.v1.Image.verify(message.imageResource); + if (error) + return "imageResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertImageRequest} InsertImageRequest + */ + InsertImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertImageRequest(); + if (object.forceCreate != null) + message.forceCreate = Boolean(object.forceCreate); + if (object.imageResource != null) { + if (typeof object.imageResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertImageRequest.imageResource: object expected"); + message.imageResource = $root.google.cloud.compute.v1.Image.fromObject(object.imageResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertImageRequest + * @static + * @param {google.cloud.compute.v1.InsertImageRequest} message InsertImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.imageResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.forceCreate != null && message.hasOwnProperty("forceCreate")) { + object.forceCreate = message.forceCreate; + if (options.oneofs) + object._forceCreate = "forceCreate"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.imageResource != null && message.hasOwnProperty("imageResource")) + object.imageResource = $root.google.cloud.compute.v1.Image.toObject(message.imageResource, options); + return object; + }; + + /** + * Converts this InsertImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertImageRequest + * @instance + * @returns {Object.} JSON object + */ + InsertImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertImageRequest; + })(); + + v1.ListImagesRequest = (function() { + + /** + * Properties of a ListImagesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListImagesRequest + * @property {string|null} [filter] ListImagesRequest filter + * @property {number|null} [maxResults] ListImagesRequest maxResults + * @property {string|null} [orderBy] ListImagesRequest orderBy + * @property {string|null} [pageToken] ListImagesRequest pageToken + * @property {string|null} [project] ListImagesRequest project + * @property {boolean|null} [returnPartialSuccess] ListImagesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListImagesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListImagesRequest. + * @implements IListImagesRequest + * @constructor + * @param {google.cloud.compute.v1.IListImagesRequest=} [properties] Properties to set + */ + function ListImagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListImagesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + ListImagesRequest.prototype.filter = null; + + /** + * ListImagesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + ListImagesRequest.prototype.maxResults = null; + + /** + * ListImagesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + ListImagesRequest.prototype.orderBy = null; + + /** + * ListImagesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + ListImagesRequest.prototype.pageToken = null; + + /** + * ListImagesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + ListImagesRequest.prototype.project = ""; + + /** + * ListImagesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + ListImagesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListImagesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + Object.defineProperty(ListImagesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListImagesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + Object.defineProperty(ListImagesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListImagesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + Object.defineProperty(ListImagesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListImagesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + Object.defineProperty(ListImagesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListImagesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + */ + Object.defineProperty(ListImagesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListImagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {google.cloud.compute.v1.IListImagesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListImagesRequest} ListImagesRequest instance + */ + ListImagesRequest.create = function create(properties) { + return new ListImagesRequest(properties); + }; + + /** + * Encodes the specified ListImagesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListImagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {google.cloud.compute.v1.IListImagesRequest} message ListImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListImagesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListImagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {google.cloud.compute.v1.IListImagesRequest} message ListImagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListImagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListImagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListImagesRequest} ListImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListImagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListImagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListImagesRequest} ListImagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListImagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListImagesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListImagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListImagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListImagesRequest} ListImagesRequest + */ + ListImagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListImagesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListImagesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListImagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListImagesRequest + * @static + * @param {google.cloud.compute.v1.ListImagesRequest} message ListImagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListImagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListImagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListImagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListImagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListImagesRequest; + })(); + + v1.PatchImageRequest = (function() { + + /** + * Properties of a PatchImageRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchImageRequest + * @property {string|null} [image] PatchImageRequest image + * @property {google.cloud.compute.v1.IImage|null} [imageResource] PatchImageRequest imageResource + * @property {string|null} [project] PatchImageRequest project + * @property {string|null} [requestId] PatchImageRequest requestId + */ + + /** + * Constructs a new PatchImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchImageRequest. + * @implements IPatchImageRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchImageRequest=} [properties] Properties to set + */ + function PatchImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchImageRequest image. + * @member {string} image + * @memberof google.cloud.compute.v1.PatchImageRequest + * @instance + */ + PatchImageRequest.prototype.image = ""; + + /** + * PatchImageRequest imageResource. + * @member {google.cloud.compute.v1.IImage|null|undefined} imageResource + * @memberof google.cloud.compute.v1.PatchImageRequest + * @instance + */ + PatchImageRequest.prototype.imageResource = null; + + /** + * PatchImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchImageRequest + * @instance + */ + PatchImageRequest.prototype.project = ""; + + /** + * PatchImageRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchImageRequest + * @instance + */ + PatchImageRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchImageRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchImageRequest + * @instance + */ + Object.defineProperty(PatchImageRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {google.cloud.compute.v1.IPatchImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchImageRequest} PatchImageRequest instance + */ + PatchImageRequest.create = function create(properties) { + return new PatchImageRequest(properties); + }; + + /** + * Encodes the specified PatchImageRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {google.cloud.compute.v1.IPatchImageRequest} message PatchImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 100313435, wireType 2 =*/802507482).string(message.image); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.imageResource != null && Object.hasOwnProperty.call(message, "imageResource")) + $root.google.cloud.compute.v1.Image.encode(message.imageResource, writer.uint32(/* id 371171954, wireType 2 =*/2969375634).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {google.cloud.compute.v1.IPatchImageRequest} message PatchImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchImageRequest} PatchImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 100313435: + message.image = reader.string(); + break; + case 371171954: + message.imageResource = $root.google.cloud.compute.v1.Image.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchImageRequest} PatchImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.imageResource != null && message.hasOwnProperty("imageResource")) { + var error = $root.google.cloud.compute.v1.Image.verify(message.imageResource); + if (error) + return "imageResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchImageRequest} PatchImageRequest + */ + PatchImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchImageRequest(); + if (object.image != null) + message.image = String(object.image); + if (object.imageResource != null) { + if (typeof object.imageResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchImageRequest.imageResource: object expected"); + message.imageResource = $root.google.cloud.compute.v1.Image.fromObject(object.imageResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchImageRequest + * @static + * @param {google.cloud.compute.v1.PatchImageRequest} message PatchImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.image = ""; + object.project = ""; + object.imageResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.imageResource != null && message.hasOwnProperty("imageResource")) + object.imageResource = $root.google.cloud.compute.v1.Image.toObject(message.imageResource, options); + return object; + }; + + /** + * Converts this PatchImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchImageRequest + * @instance + * @returns {Object.} JSON object + */ + PatchImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchImageRequest; + })(); + + v1.SetIamPolicyImageRequest = (function() { + + /** + * Properties of a SetIamPolicyImageRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyImageRequest + * @property {google.cloud.compute.v1.IGlobalSetPolicyRequest|null} [globalSetPolicyRequestResource] SetIamPolicyImageRequest globalSetPolicyRequestResource + * @property {string|null} [project] SetIamPolicyImageRequest project + * @property {string|null} [resource] SetIamPolicyImageRequest resource + */ + + /** + * Constructs a new SetIamPolicyImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyImageRequest. + * @implements ISetIamPolicyImageRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyImageRequest=} [properties] Properties to set + */ + function SetIamPolicyImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyImageRequest globalSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetPolicyRequest|null|undefined} globalSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @instance + */ + SetIamPolicyImageRequest.prototype.globalSetPolicyRequestResource = null; + + /** + * SetIamPolicyImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @instance + */ + SetIamPolicyImageRequest.prototype.project = ""; + + /** + * SetIamPolicyImageRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @instance + */ + SetIamPolicyImageRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicyImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyImageRequest} SetIamPolicyImageRequest instance + */ + SetIamPolicyImageRequest.create = function create(properties) { + return new SetIamPolicyImageRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyImageRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyImageRequest} message SetIamPolicyImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "globalSetPolicyRequestResource")) + $root.google.cloud.compute.v1.GlobalSetPolicyRequest.encode(message.globalSetPolicyRequestResource, writer.uint32(/* id 337048498, wireType 2 =*/2696387986).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyImageRequest} message SetIamPolicyImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyImageRequest} SetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 337048498: + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyImageRequest} SetIamPolicyImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.verify(message.globalSetPolicyRequestResource); + if (error) + return "globalSetPolicyRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicyImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyImageRequest} SetIamPolicyImageRequest + */ + SetIamPolicyImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyImageRequest(); + if (object.globalSetPolicyRequestResource != null) { + if (typeof object.globalSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyImageRequest.globalSetPolicyRequestResource: object expected"); + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.fromObject(object.globalSetPolicyRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyImageRequest} message SetIamPolicyImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetPolicyRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) + object.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.toObject(message.globalSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyImageRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyImageRequest; + })(); + + v1.SetLabelsImageRequest = (function() { + + /** + * Properties of a SetLabelsImageRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsImageRequest + * @property {google.cloud.compute.v1.IGlobalSetLabelsRequest|null} [globalSetLabelsRequestResource] SetLabelsImageRequest globalSetLabelsRequestResource + * @property {string|null} [project] SetLabelsImageRequest project + * @property {string|null} [resource] SetLabelsImageRequest resource + */ + + /** + * Constructs a new SetLabelsImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsImageRequest. + * @implements ISetLabelsImageRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsImageRequest=} [properties] Properties to set + */ + function SetLabelsImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsImageRequest globalSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetLabelsRequest|null|undefined} globalSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @instance + */ + SetLabelsImageRequest.prototype.globalSetLabelsRequestResource = null; + + /** + * SetLabelsImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @instance + */ + SetLabelsImageRequest.prototype.project = ""; + + /** + * SetLabelsImageRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @instance + */ + SetLabelsImageRequest.prototype.resource = ""; + + /** + * Creates a new SetLabelsImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsImageRequest} SetLabelsImageRequest instance + */ + SetLabelsImageRequest.create = function create(properties) { + return new SetLabelsImageRequest(properties); + }; + + /** + * Encodes the specified SetLabelsImageRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsImageRequest} message SetLabelsImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "globalSetLabelsRequestResource")) + $root.google.cloud.compute.v1.GlobalSetLabelsRequest.encode(message.globalSetLabelsRequestResource, writer.uint32(/* id 319917189, wireType 2 =*/2559337514).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsImageRequest} message SetLabelsImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsImageRequest} SetLabelsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 319917189: + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsImageRequest} SetLabelsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.verify(message.globalSetLabelsRequestResource); + if (error) + return "globalSetLabelsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetLabelsImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsImageRequest} SetLabelsImageRequest + */ + SetLabelsImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsImageRequest(); + if (object.globalSetLabelsRequestResource != null) { + if (typeof object.globalSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsImageRequest.globalSetLabelsRequestResource: object expected"); + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.fromObject(object.globalSetLabelsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetLabelsImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsImageRequest} message SetLabelsImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetLabelsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) + object.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.toObject(message.globalSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsImageRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsImageRequest; + })(); + + v1.TestIamPermissionsImageRequest = (function() { + + /** + * Properties of a TestIamPermissionsImageRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsImageRequest + * @property {string|null} [project] TestIamPermissionsImageRequest project + * @property {string|null} [resource] TestIamPermissionsImageRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsImageRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsImageRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsImageRequest. + * @implements ITestIamPermissionsImageRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsImageRequest=} [properties] Properties to set + */ + function TestIamPermissionsImageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsImageRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @instance + */ + TestIamPermissionsImageRequest.prototype.project = ""; + + /** + * TestIamPermissionsImageRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @instance + */ + TestIamPermissionsImageRequest.prototype.resource = ""; + + /** + * TestIamPermissionsImageRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @instance + */ + TestIamPermissionsImageRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsImageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsImageRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsImageRequest} TestIamPermissionsImageRequest instance + */ + TestIamPermissionsImageRequest.create = function create(properties) { + return new TestIamPermissionsImageRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsImageRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsImageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsImageRequest} message TestIamPermissionsImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsImageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsImageRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsImageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsImageRequest} message TestIamPermissionsImageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsImageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsImageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsImageRequest} TestIamPermissionsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsImageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsImageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsImageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsImageRequest} TestIamPermissionsImageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsImageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsImageRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsImageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsImageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsImageRequest} TestIamPermissionsImageRequest + */ + TestIamPermissionsImageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsImageRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsImageRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsImageRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsImageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsImageRequest} message TestIamPermissionsImageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsImageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsImageRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsImageRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsImageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsImageRequest; + })(); + + v1.AbandonInstancesInstanceGroupManagerRequest = (function() { + + /** + * Properties of an AbandonInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IAbandonInstancesInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] AbandonInstancesInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest|null} [instanceGroupManagersAbandonInstancesRequestResource] AbandonInstancesInstanceGroupManagerRequest instanceGroupManagersAbandonInstancesRequestResource + * @property {string|null} [project] AbandonInstancesInstanceGroupManagerRequest project + * @property {string|null} [requestId] AbandonInstancesInstanceGroupManagerRequest requestId + * @property {string|null} [zone] AbandonInstancesInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new AbandonInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AbandonInstancesInstanceGroupManagerRequest. + * @implements IAbandonInstancesInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest=} [properties] Properties to set + */ + function AbandonInstancesInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AbandonInstancesInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * AbandonInstancesInstanceGroupManagerRequest instanceGroupManagersAbandonInstancesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersAbandonInstancesRequest|null|undefined} instanceGroupManagersAbandonInstancesRequestResource + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesInstanceGroupManagerRequest.prototype.instanceGroupManagersAbandonInstancesRequestResource = null; + + /** + * AbandonInstancesInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesInstanceGroupManagerRequest.prototype.project = ""; + + /** + * AbandonInstancesInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * AbandonInstancesInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AbandonInstancesInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(AbandonInstancesInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AbandonInstancesInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest} AbandonInstancesInstanceGroupManagerRequest instance + */ + AbandonInstancesInstanceGroupManagerRequest.create = function create(properties) { + return new AbandonInstancesInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified AbandonInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest} message AbandonInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonInstancesInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.instanceGroupManagersAbandonInstancesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersAbandonInstancesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.encode(message.instanceGroupManagersAbandonInstancesRequestResource, writer.uint32(/* id 320929016, wireType 2 =*/2567432130).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AbandonInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest} message AbandonInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonInstancesInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AbandonInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest} AbandonInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonInstancesInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 320929016: + message.instanceGroupManagersAbandonInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AbandonInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest} AbandonInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonInstancesInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AbandonInstancesInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AbandonInstancesInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersAbandonInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersAbandonInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.verify(message.instanceGroupManagersAbandonInstancesRequestResource); + if (error) + return "instanceGroupManagersAbandonInstancesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AbandonInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest} AbandonInstancesInstanceGroupManagerRequest + */ + AbandonInstancesInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersAbandonInstancesRequestResource != null) { + if (typeof object.instanceGroupManagersAbandonInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest.instanceGroupManagersAbandonInstancesRequestResource: object expected"); + message.instanceGroupManagersAbandonInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.fromObject(object.instanceGroupManagersAbandonInstancesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AbandonInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest} message AbandonInstancesInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AbandonInstancesInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.instanceGroupManagersAbandonInstancesRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.instanceGroupManagersAbandonInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersAbandonInstancesRequestResource")) + object.instanceGroupManagersAbandonInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest.toObject(message.instanceGroupManagersAbandonInstancesRequestResource, options); + return object; + }; + + /** + * Converts this AbandonInstancesInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + AbandonInstancesInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AbandonInstancesInstanceGroupManagerRequest; + })(); + + v1.AggregatedListInstanceGroupManagersRequest = (function() { + + /** + * Properties of an AggregatedListInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListInstanceGroupManagersRequest + * @property {string|null} [filter] AggregatedListInstanceGroupManagersRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListInstanceGroupManagersRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] AggregatedListInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] AggregatedListInstanceGroupManagersRequest pageToken + * @property {string|null} [project] AggregatedListInstanceGroupManagersRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListInstanceGroupManagersRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListInstanceGroupManagersRequest. + * @implements IAggregatedListInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest=} [properties] Properties to set + */ + function AggregatedListInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + AggregatedListInstanceGroupManagersRequest.prototype.filter = null; + + /** + * AggregatedListInstanceGroupManagersRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + AggregatedListInstanceGroupManagersRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + AggregatedListInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * AggregatedListInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + AggregatedListInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * AggregatedListInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + AggregatedListInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * AggregatedListInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + AggregatedListInstanceGroupManagersRequest.prototype.project = ""; + + /** + * AggregatedListInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + AggregatedListInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupManagersRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupManagersRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest} AggregatedListInstanceGroupManagersRequest instance + */ + AggregatedListInstanceGroupManagersRequest.create = function create(properties) { + return new AggregatedListInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified AggregatedListInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest} message AggregatedListInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest} message AggregatedListInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest} AggregatedListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest} AggregatedListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest} AggregatedListInstanceGroupManagersRequest + */ + AggregatedListInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest} message AggregatedListInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListInstanceGroupManagersRequest; + })(); + + v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest = (function() { + + /** + * Properties of an ApplyUpdatesToInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IApplyUpdatesToInstancesInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest|null} [instanceGroupManagersApplyUpdatesRequestResource] ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManagersApplyUpdatesRequestResource + * @property {string|null} [project] ApplyUpdatesToInstancesInstanceGroupManagerRequest project + * @property {string|null} [zone] ApplyUpdatesToInstancesInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new ApplyUpdatesToInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ApplyUpdatesToInstancesInstanceGroupManagerRequest. + * @implements IApplyUpdatesToInstancesInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest=} [properties] Properties to set + */ + function ApplyUpdatesToInstancesInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * ApplyUpdatesToInstancesInstanceGroupManagerRequest instanceGroupManagersApplyUpdatesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersApplyUpdatesRequest|null|undefined} instanceGroupManagersApplyUpdatesRequestResource + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.prototype.instanceGroupManagersApplyUpdatesRequestResource = null; + + /** + * ApplyUpdatesToInstancesInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.prototype.project = ""; + + /** + * ApplyUpdatesToInstancesInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.prototype.zone = ""; + + /** + * Creates a new ApplyUpdatesToInstancesInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest} ApplyUpdatesToInstancesInstanceGroupManagerRequest instance + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.create = function create(properties) { + return new ApplyUpdatesToInstancesInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified ApplyUpdatesToInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest} message ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.instanceGroupManagersApplyUpdatesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersApplyUpdatesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.encode(message.instanceGroupManagersApplyUpdatesRequestResource, writer.uint32(/* id 259242835, wireType 2 =*/2073942682).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApplyUpdatesToInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest} message ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyUpdatesToInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest} ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 259242835: + message.instanceGroupManagersApplyUpdatesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyUpdatesToInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest} ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyUpdatesToInstancesInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersApplyUpdatesRequestResource != null && message.hasOwnProperty("instanceGroupManagersApplyUpdatesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.verify(message.instanceGroupManagersApplyUpdatesRequestResource); + if (error) + return "instanceGroupManagersApplyUpdatesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an ApplyUpdatesToInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest} ApplyUpdatesToInstancesInstanceGroupManagerRequest + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersApplyUpdatesRequestResource != null) { + if (typeof object.instanceGroupManagersApplyUpdatesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest.instanceGroupManagersApplyUpdatesRequestResource: object expected"); + message.instanceGroupManagersApplyUpdatesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.fromObject(object.instanceGroupManagersApplyUpdatesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an ApplyUpdatesToInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest} message ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.instanceGroupManagersApplyUpdatesRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.instanceGroupManagersApplyUpdatesRequestResource != null && message.hasOwnProperty("instanceGroupManagersApplyUpdatesRequestResource")) + object.instanceGroupManagersApplyUpdatesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest.toObject(message.instanceGroupManagersApplyUpdatesRequestResource, options); + return object; + }; + + /** + * Converts this ApplyUpdatesToInstancesInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyUpdatesToInstancesInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApplyUpdatesToInstancesInstanceGroupManagerRequest; + })(); + + v1.CreateInstancesInstanceGroupManagerRequest = (function() { + + /** + * Properties of a CreateInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface ICreateInstancesInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] CreateInstancesInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest|null} [instanceGroupManagersCreateInstancesRequestResource] CreateInstancesInstanceGroupManagerRequest instanceGroupManagersCreateInstancesRequestResource + * @property {string|null} [project] CreateInstancesInstanceGroupManagerRequest project + * @property {string|null} [requestId] CreateInstancesInstanceGroupManagerRequest requestId + * @property {string|null} [zone] CreateInstancesInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new CreateInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CreateInstancesInstanceGroupManagerRequest. + * @implements ICreateInstancesInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest=} [properties] Properties to set + */ + function CreateInstancesInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstancesInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @instance + */ + CreateInstancesInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * CreateInstancesInstanceGroupManagerRequest instanceGroupManagersCreateInstancesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersCreateInstancesRequest|null|undefined} instanceGroupManagersCreateInstancesRequestResource + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @instance + */ + CreateInstancesInstanceGroupManagerRequest.prototype.instanceGroupManagersCreateInstancesRequestResource = null; + + /** + * CreateInstancesInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @instance + */ + CreateInstancesInstanceGroupManagerRequest.prototype.project = ""; + + /** + * CreateInstancesInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @instance + */ + CreateInstancesInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * CreateInstancesInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @instance + */ + CreateInstancesInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateInstancesInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(CreateInstancesInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateInstancesInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest} CreateInstancesInstanceGroupManagerRequest instance + */ + CreateInstancesInstanceGroupManagerRequest.create = function create(properties) { + return new CreateInstancesInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified CreateInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest} message CreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancesInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instanceGroupManagersCreateInstancesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersCreateInstancesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.encode(message.instanceGroupManagersCreateInstancesRequestResource, writer.uint32(/* id 24558867, wireType 2 =*/196470938).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified CreateInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest} message CreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancesInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest} CreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancesInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 24558867: + message.instanceGroupManagersCreateInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest} CreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancesInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstancesInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstancesInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersCreateInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersCreateInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.verify(message.instanceGroupManagersCreateInstancesRequestResource); + if (error) + return "instanceGroupManagersCreateInstancesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a CreateInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest} CreateInstancesInstanceGroupManagerRequest + */ + CreateInstancesInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersCreateInstancesRequestResource != null) { + if (typeof object.instanceGroupManagersCreateInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest.instanceGroupManagersCreateInstancesRequestResource: object expected"); + message.instanceGroupManagersCreateInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.fromObject(object.instanceGroupManagersCreateInstancesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a CreateInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest} message CreateInstancesInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstancesInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroupManagersCreateInstancesRequestResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instanceGroupManagersCreateInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersCreateInstancesRequestResource")) + object.instanceGroupManagersCreateInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest.toObject(message.instanceGroupManagersCreateInstancesRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this CreateInstancesInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstancesInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstancesInstanceGroupManagerRequest; + })(); + + v1.DeleteInstanceGroupManagerRequest = (function() { + + /** + * Properties of a DeleteInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] DeleteInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] DeleteInstanceGroupManagerRequest project + * @property {string|null} [requestId] DeleteInstanceGroupManagerRequest requestId + * @property {string|null} [zone] DeleteInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new DeleteInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInstanceGroupManagerRequest. + * @implements IDeleteInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest=} [properties] Properties to set + */ + function DeleteInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @instance + */ + DeleteInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * DeleteInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @instance + */ + DeleteInstanceGroupManagerRequest.prototype.project = ""; + + /** + * DeleteInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @instance + */ + DeleteInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * DeleteInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @instance + */ + DeleteInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(DeleteInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInstanceGroupManagerRequest} DeleteInstanceGroupManagerRequest instance + */ + DeleteInstanceGroupManagerRequest.create = function create(properties) { + return new DeleteInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest} message DeleteInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest} message DeleteInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteInstanceGroupManagerRequest} DeleteInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteInstanceGroupManagerRequest} DeleteInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInstanceGroupManagerRequest} DeleteInstanceGroupManagerRequest + */ + DeleteInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.DeleteInstanceGroupManagerRequest} message DeleteInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this DeleteInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceGroupManagerRequest; + })(); + + v1.DeleteInstancesInstanceGroupManagerRequest = (function() { + + /** + * Properties of a DeleteInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInstancesInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] DeleteInstancesInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest|null} [instanceGroupManagersDeleteInstancesRequestResource] DeleteInstancesInstanceGroupManagerRequest instanceGroupManagersDeleteInstancesRequestResource + * @property {string|null} [project] DeleteInstancesInstanceGroupManagerRequest project + * @property {string|null} [requestId] DeleteInstancesInstanceGroupManagerRequest requestId + * @property {string|null} [zone] DeleteInstancesInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new DeleteInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInstancesInstanceGroupManagerRequest. + * @implements IDeleteInstancesInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest=} [properties] Properties to set + */ + function DeleteInstancesInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstancesInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * DeleteInstancesInstanceGroupManagerRequest instanceGroupManagersDeleteInstancesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersDeleteInstancesRequest|null|undefined} instanceGroupManagersDeleteInstancesRequestResource + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesInstanceGroupManagerRequest.prototype.instanceGroupManagersDeleteInstancesRequestResource = null; + + /** + * DeleteInstancesInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesInstanceGroupManagerRequest.prototype.project = ""; + + /** + * DeleteInstancesInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * DeleteInstancesInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInstancesInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(DeleteInstancesInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInstancesInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest} DeleteInstancesInstanceGroupManagerRequest instance + */ + DeleteInstancesInstanceGroupManagerRequest.create = function create(properties) { + return new DeleteInstancesInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified DeleteInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest} message DeleteInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancesInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceGroupManagersDeleteInstancesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersDeleteInstancesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.encode(message.instanceGroupManagersDeleteInstancesRequestResource, writer.uint32(/* id 166421252, wireType 2 =*/1331370018).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified DeleteInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest} message DeleteInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancesInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest} DeleteInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancesInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 166421252: + message.instanceGroupManagersDeleteInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest} DeleteInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancesInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstancesInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstancesInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersDeleteInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersDeleteInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.verify(message.instanceGroupManagersDeleteInstancesRequestResource); + if (error) + return "instanceGroupManagersDeleteInstancesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest} DeleteInstancesInstanceGroupManagerRequest + */ + DeleteInstancesInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersDeleteInstancesRequestResource != null) { + if (typeof object.instanceGroupManagersDeleteInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest.instanceGroupManagersDeleteInstancesRequestResource: object expected"); + message.instanceGroupManagersDeleteInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.fromObject(object.instanceGroupManagersDeleteInstancesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest} message DeleteInstancesInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstancesInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroupManagersDeleteInstancesRequestResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceGroupManagersDeleteInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersDeleteInstancesRequestResource")) + object.instanceGroupManagersDeleteInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest.toObject(message.instanceGroupManagersDeleteInstancesRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this DeleteInstancesInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstancesInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstancesInstanceGroupManagerRequest; + })(); + + v1.DeletePerInstanceConfigsInstanceGroupManagerRequest = (function() { + + /** + * Properties of a DeletePerInstanceConfigsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeletePerInstanceConfigsInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq|null} [instanceGroupManagersDeletePerInstanceConfigsReqResource] DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersDeletePerInstanceConfigsReqResource + * @property {string|null} [project] DeletePerInstanceConfigsInstanceGroupManagerRequest project + * @property {string|null} [zone] DeletePerInstanceConfigsInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new DeletePerInstanceConfigsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeletePerInstanceConfigsInstanceGroupManagerRequest. + * @implements IDeletePerInstanceConfigsInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest=} [properties] Properties to set + */ + function DeletePerInstanceConfigsInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * DeletePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersDeletePerInstanceConfigsReqResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersDeletePerInstanceConfigsReq|null|undefined} instanceGroupManagersDeletePerInstanceConfigsReqResource + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.prototype.instanceGroupManagersDeletePerInstanceConfigsReqResource = null; + + /** + * DeletePerInstanceConfigsInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.prototype.project = ""; + + /** + * DeletePerInstanceConfigsInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.prototype.zone = ""; + + /** + * Creates a new DeletePerInstanceConfigsInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest} DeletePerInstanceConfigsInstanceGroupManagerRequest instance + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.create = function create(properties) { + return new DeletePerInstanceConfigsInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified DeletePerInstanceConfigsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest} message DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.instanceGroupManagersDeletePerInstanceConfigsReqResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersDeletePerInstanceConfigsReqResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.encode(message.instanceGroupManagersDeletePerInstanceConfigsReqResource, writer.uint32(/* id 362427680, wireType 2 =*/2899421442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeletePerInstanceConfigsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest} message DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest} DeletePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 362427680: + message.instanceGroupManagersDeletePerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest} DeletePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePerInstanceConfigsInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersDeletePerInstanceConfigsReqResource != null && message.hasOwnProperty("instanceGroupManagersDeletePerInstanceConfigsReqResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.verify(message.instanceGroupManagersDeletePerInstanceConfigsReqResource); + if (error) + return "instanceGroupManagersDeletePerInstanceConfigsReqResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeletePerInstanceConfigsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest} DeletePerInstanceConfigsInstanceGroupManagerRequest + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersDeletePerInstanceConfigsReqResource != null) { + if (typeof object.instanceGroupManagersDeletePerInstanceConfigsReqResource !== "object") + throw TypeError(".google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest.instanceGroupManagersDeletePerInstanceConfigsReqResource: object expected"); + message.instanceGroupManagersDeletePerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.fromObject(object.instanceGroupManagersDeletePerInstanceConfigsReqResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeletePerInstanceConfigsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest} message DeletePerInstanceConfigsInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.instanceGroupManagersDeletePerInstanceConfigsReqResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.instanceGroupManagersDeletePerInstanceConfigsReqResource != null && message.hasOwnProperty("instanceGroupManagersDeletePerInstanceConfigsReqResource")) + object.instanceGroupManagersDeletePerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq.toObject(message.instanceGroupManagersDeletePerInstanceConfigsReqResource, options); + return object; + }; + + /** + * Converts this DeletePerInstanceConfigsInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePerInstanceConfigsInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeletePerInstanceConfigsInstanceGroupManagerRequest; + })(); + + v1.GetInstanceGroupManagerRequest = (function() { + + /** + * Properties of a GetInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] GetInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] GetInstanceGroupManagerRequest project + * @property {string|null} [zone] GetInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new GetInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetInstanceGroupManagerRequest. + * @implements IGetInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IGetInstanceGroupManagerRequest=} [properties] Properties to set + */ + function GetInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @instance + */ + GetInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * GetInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @instance + */ + GetInstanceGroupManagerRequest.prototype.project = ""; + + /** + * GetInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @instance + */ + GetInstanceGroupManagerRequest.prototype.zone = ""; + + /** + * Creates a new GetInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetInstanceGroupManagerRequest} GetInstanceGroupManagerRequest instance + */ + GetInstanceGroupManagerRequest.create = function create(properties) { + return new GetInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified GetInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceGroupManagerRequest} message GetInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified GetInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceGroupManagerRequest} message GetInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetInstanceGroupManagerRequest} GetInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetInstanceGroupManagerRequest} GetInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetInstanceGroupManagerRequest} GetInstanceGroupManagerRequest + */ + GetInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.GetInstanceGroupManagerRequest} message GetInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this GetInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceGroupManagerRequest; + })(); + + v1.InsertInstanceGroupManagerRequest = (function() { + + /** + * Properties of an InsertInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertInstanceGroupManagerRequest + * @property {google.cloud.compute.v1.IInstanceGroupManager|null} [instanceGroupManagerResource] InsertInstanceGroupManagerRequest instanceGroupManagerResource + * @property {string|null} [project] InsertInstanceGroupManagerRequest project + * @property {string|null} [requestId] InsertInstanceGroupManagerRequest requestId + * @property {string|null} [zone] InsertInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new InsertInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertInstanceGroupManagerRequest. + * @implements IInsertInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertInstanceGroupManagerRequest=} [properties] Properties to set + */ + function InsertInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertInstanceGroupManagerRequest instanceGroupManagerResource. + * @member {google.cloud.compute.v1.IInstanceGroupManager|null|undefined} instanceGroupManagerResource + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @instance + */ + InsertInstanceGroupManagerRequest.prototype.instanceGroupManagerResource = null; + + /** + * InsertInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @instance + */ + InsertInstanceGroupManagerRequest.prototype.project = ""; + + /** + * InsertInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @instance + */ + InsertInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * InsertInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @instance + */ + InsertInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(InsertInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertInstanceGroupManagerRequest} InsertInstanceGroupManagerRequest instance + */ + InsertInstanceGroupManagerRequest.create = function create(properties) { + return new InsertInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified InsertInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceGroupManagerRequest} message InsertInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManagerResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagerResource")) + $root.google.cloud.compute.v1.InstanceGroupManager.encode(message.instanceGroupManagerResource, writer.uint32(/* id 261063946, wireType 2 =*/2088511570).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceGroupManagerRequest} message InsertInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertInstanceGroupManagerRequest} InsertInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 261063946: + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertInstanceGroupManagerRequest} InsertInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManager.verify(message.instanceGroupManagerResource); + if (error) + return "instanceGroupManagerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertInstanceGroupManagerRequest} InsertInstanceGroupManagerRequest + */ + InsertInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertInstanceGroupManagerRequest(); + if (object.instanceGroupManagerResource != null) { + if (typeof object.instanceGroupManagerResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertInstanceGroupManagerRequest.instanceGroupManagerResource: object expected"); + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.fromObject(object.instanceGroupManagerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.InsertInstanceGroupManagerRequest} message InsertInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManagerResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) + object.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.toObject(message.instanceGroupManagerResource, options); + return object; + }; + + /** + * Converts this InsertInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + InsertInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertInstanceGroupManagerRequest; + })(); + + v1.ListInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInstanceGroupManagersRequest + * @property {string|null} [filter] ListInstanceGroupManagersRequest filter + * @property {number|null} [maxResults] ListInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListInstanceGroupManagersRequest project + * @property {boolean|null} [returnPartialSuccess] ListInstanceGroupManagersRequest returnPartialSuccess + * @property {string|null} [zone] ListInstanceGroupManagersRequest zone + */ + + /** + * Constructs a new ListInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInstanceGroupManagersRequest. + * @implements IListInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + ListInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + ListInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + ListInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + ListInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + ListInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + ListInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + /** + * ListInstanceGroupManagersRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + ListInstanceGroupManagersRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInstanceGroupManagersRequest} ListInstanceGroupManagersRequest instance + */ + ListInstanceGroupManagersRequest.create = function create(properties) { + return new ListInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceGroupManagersRequest} message ListInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceGroupManagersRequest} message ListInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInstanceGroupManagersRequest} ListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInstanceGroupManagersRequest} ListInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInstanceGroupManagersRequest} ListInstanceGroupManagersRequest + */ + ListInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListInstanceGroupManagersRequest} message ListInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstanceGroupManagersRequest; + })(); + + v1.ListErrorsInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListErrorsInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListErrorsInstanceGroupManagersRequest + * @property {string|null} [filter] ListErrorsInstanceGroupManagersRequest filter + * @property {string|null} [instanceGroupManager] ListErrorsInstanceGroupManagersRequest instanceGroupManager + * @property {number|null} [maxResults] ListErrorsInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListErrorsInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListErrorsInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListErrorsInstanceGroupManagersRequest project + * @property {boolean|null} [returnPartialSuccess] ListErrorsInstanceGroupManagersRequest returnPartialSuccess + * @property {string|null} [zone] ListErrorsInstanceGroupManagersRequest zone + */ + + /** + * Constructs a new ListErrorsInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListErrorsInstanceGroupManagersRequest. + * @implements IListErrorsInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListErrorsInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListErrorsInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListErrorsInstanceGroupManagersRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.instanceGroupManager = ""; + + /** + * ListErrorsInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListErrorsInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListErrorsInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListErrorsInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListErrorsInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + /** + * ListErrorsInstanceGroupManagersRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + ListErrorsInstanceGroupManagersRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListErrorsInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListErrorsInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest} ListErrorsInstanceGroupManagersRequest instance + */ + ListErrorsInstanceGroupManagersRequest.create = function create(properties) { + return new ListErrorsInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListErrorsInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest} message ListErrorsInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListErrorsInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListErrorsInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest} message ListErrorsInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListErrorsInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListErrorsInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest} ListErrorsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListErrorsInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListErrorsInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest} ListErrorsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListErrorsInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListErrorsInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListErrorsInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListErrorsInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest} ListErrorsInstanceGroupManagersRequest + */ + ListErrorsInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListErrorsInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest} message ListErrorsInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListErrorsInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListErrorsInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListErrorsInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListErrorsInstanceGroupManagersRequest; + })(); + + v1.ListManagedInstancesInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListManagedInstancesInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListManagedInstancesInstanceGroupManagersRequest + * @property {string|null} [filter] ListManagedInstancesInstanceGroupManagersRequest filter + * @property {string|null} [instanceGroupManager] ListManagedInstancesInstanceGroupManagersRequest instanceGroupManager + * @property {number|null} [maxResults] ListManagedInstancesInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListManagedInstancesInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListManagedInstancesInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListManagedInstancesInstanceGroupManagersRequest project + * @property {boolean|null} [returnPartialSuccess] ListManagedInstancesInstanceGroupManagersRequest returnPartialSuccess + * @property {string|null} [zone] ListManagedInstancesInstanceGroupManagersRequest zone + */ + + /** + * Constructs a new ListManagedInstancesInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListManagedInstancesInstanceGroupManagersRequest. + * @implements IListManagedInstancesInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListManagedInstancesInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListManagedInstancesInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListManagedInstancesInstanceGroupManagersRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.instanceGroupManager = ""; + + /** + * ListManagedInstancesInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListManagedInstancesInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListManagedInstancesInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListManagedInstancesInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListManagedInstancesInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + /** + * ListManagedInstancesInstanceGroupManagersRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListManagedInstancesInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListManagedInstancesInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest} ListManagedInstancesInstanceGroupManagersRequest instance + */ + ListManagedInstancesInstanceGroupManagersRequest.create = function create(properties) { + return new ListManagedInstancesInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListManagedInstancesInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest} message ListManagedInstancesInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedInstancesInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListManagedInstancesInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest} message ListManagedInstancesInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedInstancesInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListManagedInstancesInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest} ListManagedInstancesInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedInstancesInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListManagedInstancesInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest} ListManagedInstancesInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedInstancesInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListManagedInstancesInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListManagedInstancesInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListManagedInstancesInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest} ListManagedInstancesInstanceGroupManagersRequest + */ + ListManagedInstancesInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListManagedInstancesInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest} message ListManagedInstancesInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListManagedInstancesInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListManagedInstancesInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListManagedInstancesInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListManagedInstancesInstanceGroupManagersRequest; + })(); + + v1.ListPerInstanceConfigsInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListPerInstanceConfigsInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListPerInstanceConfigsInstanceGroupManagersRequest + * @property {string|null} [filter] ListPerInstanceConfigsInstanceGroupManagersRequest filter + * @property {string|null} [instanceGroupManager] ListPerInstanceConfigsInstanceGroupManagersRequest instanceGroupManager + * @property {number|null} [maxResults] ListPerInstanceConfigsInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListPerInstanceConfigsInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListPerInstanceConfigsInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListPerInstanceConfigsInstanceGroupManagersRequest project + * @property {boolean|null} [returnPartialSuccess] ListPerInstanceConfigsInstanceGroupManagersRequest returnPartialSuccess + * @property {string|null} [zone] ListPerInstanceConfigsInstanceGroupManagersRequest zone + */ + + /** + * Constructs a new ListPerInstanceConfigsInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListPerInstanceConfigsInstanceGroupManagersRequest. + * @implements IListPerInstanceConfigsInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListPerInstanceConfigsInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.instanceGroupManager = ""; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPerInstanceConfigsInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest} ListPerInstanceConfigsInstanceGroupManagersRequest instance + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.create = function create(properties) { + return new ListPerInstanceConfigsInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListPerInstanceConfigsInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest} message ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListPerInstanceConfigsInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest} message ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPerInstanceConfigsInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest} ListPerInstanceConfigsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPerInstanceConfigsInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest} ListPerInstanceConfigsInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPerInstanceConfigsInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListPerInstanceConfigsInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest} ListPerInstanceConfigsInstanceGroupManagersRequest + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListPerInstanceConfigsInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest} message ListPerInstanceConfigsInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListPerInstanceConfigsInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListPerInstanceConfigsInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPerInstanceConfigsInstanceGroupManagersRequest; + })(); + + v1.PatchInstanceGroupManagerRequest = (function() { + + /** + * Properties of a PatchInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] PatchInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManager|null} [instanceGroupManagerResource] PatchInstanceGroupManagerRequest instanceGroupManagerResource + * @property {string|null} [project] PatchInstanceGroupManagerRequest project + * @property {string|null} [requestId] PatchInstanceGroupManagerRequest requestId + * @property {string|null} [zone] PatchInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new PatchInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchInstanceGroupManagerRequest. + * @implements IPatchInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchInstanceGroupManagerRequest=} [properties] Properties to set + */ + function PatchInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @instance + */ + PatchInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * PatchInstanceGroupManagerRequest instanceGroupManagerResource. + * @member {google.cloud.compute.v1.IInstanceGroupManager|null|undefined} instanceGroupManagerResource + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @instance + */ + PatchInstanceGroupManagerRequest.prototype.instanceGroupManagerResource = null; + + /** + * PatchInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @instance + */ + PatchInstanceGroupManagerRequest.prototype.project = ""; + + /** + * PatchInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @instance + */ + PatchInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * PatchInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @instance + */ + PatchInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(PatchInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchInstanceGroupManagerRequest} PatchInstanceGroupManagerRequest instance + */ + PatchInstanceGroupManagerRequest.create = function create(properties) { + return new PatchInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified PatchInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchInstanceGroupManagerRequest} message PatchInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.instanceGroupManagerResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagerResource")) + $root.google.cloud.compute.v1.InstanceGroupManager.encode(message.instanceGroupManagerResource, writer.uint32(/* id 261063946, wireType 2 =*/2088511570).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchInstanceGroupManagerRequest} message PatchInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchInstanceGroupManagerRequest} PatchInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 261063946: + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchInstanceGroupManagerRequest} PatchInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManager.verify(message.instanceGroupManagerResource); + if (error) + return "instanceGroupManagerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a PatchInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchInstanceGroupManagerRequest} PatchInstanceGroupManagerRequest + */ + PatchInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagerResource != null) { + if (typeof object.instanceGroupManagerResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchInstanceGroupManagerRequest.instanceGroupManagerResource: object expected"); + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.fromObject(object.instanceGroupManagerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a PatchInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.PatchInstanceGroupManagerRequest} message PatchInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.instanceGroupManagerResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) + object.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.toObject(message.instanceGroupManagerResource, options); + return object; + }; + + /** + * Converts this PatchInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + PatchInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchInstanceGroupManagerRequest; + })(); + + v1.PatchPerInstanceConfigsInstanceGroupManagerRequest = (function() { + + /** + * Properties of a PatchPerInstanceConfigsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchPerInstanceConfigsInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq|null} [instanceGroupManagersPatchPerInstanceConfigsReqResource] PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersPatchPerInstanceConfigsReqResource + * @property {string|null} [project] PatchPerInstanceConfigsInstanceGroupManagerRequest project + * @property {string|null} [requestId] PatchPerInstanceConfigsInstanceGroupManagerRequest requestId + * @property {string|null} [zone] PatchPerInstanceConfigsInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new PatchPerInstanceConfigsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchPerInstanceConfigsInstanceGroupManagerRequest. + * @implements IPatchPerInstanceConfigsInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest=} [properties] Properties to set + */ + function PatchPerInstanceConfigsInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * PatchPerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersPatchPerInstanceConfigsReqResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersPatchPerInstanceConfigsReq|null|undefined} instanceGroupManagersPatchPerInstanceConfigsReqResource + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.prototype.instanceGroupManagersPatchPerInstanceConfigsReqResource = null; + + /** + * PatchPerInstanceConfigsInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.prototype.project = ""; + + /** + * PatchPerInstanceConfigsInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * PatchPerInstanceConfigsInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchPerInstanceConfigsInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(PatchPerInstanceConfigsInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchPerInstanceConfigsInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest} PatchPerInstanceConfigsInstanceGroupManagerRequest instance + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.create = function create(properties) { + return new PatchPerInstanceConfigsInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified PatchPerInstanceConfigsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest} message PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.instanceGroupManagersPatchPerInstanceConfigsReqResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersPatchPerInstanceConfigsReqResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.encode(message.instanceGroupManagersPatchPerInstanceConfigsReqResource, writer.uint32(/* id 356650495, wireType 2 =*/2853203962).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchPerInstanceConfigsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest} message PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchPerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest} PatchPerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 356650495: + message.instanceGroupManagersPatchPerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchPerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest} PatchPerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchPerInstanceConfigsInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersPatchPerInstanceConfigsReqResource != null && message.hasOwnProperty("instanceGroupManagersPatchPerInstanceConfigsReqResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.verify(message.instanceGroupManagersPatchPerInstanceConfigsReqResource); + if (error) + return "instanceGroupManagersPatchPerInstanceConfigsReqResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a PatchPerInstanceConfigsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest} PatchPerInstanceConfigsInstanceGroupManagerRequest + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersPatchPerInstanceConfigsReqResource != null) { + if (typeof object.instanceGroupManagersPatchPerInstanceConfigsReqResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest.instanceGroupManagersPatchPerInstanceConfigsReqResource: object expected"); + message.instanceGroupManagersPatchPerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.fromObject(object.instanceGroupManagersPatchPerInstanceConfigsReqResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a PatchPerInstanceConfigsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest} message PatchPerInstanceConfigsInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.instanceGroupManagersPatchPerInstanceConfigsReqResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.instanceGroupManagersPatchPerInstanceConfigsReqResource != null && message.hasOwnProperty("instanceGroupManagersPatchPerInstanceConfigsReqResource")) + object.instanceGroupManagersPatchPerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq.toObject(message.instanceGroupManagersPatchPerInstanceConfigsReqResource, options); + return object; + }; + + /** + * Converts this PatchPerInstanceConfigsInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + PatchPerInstanceConfigsInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchPerInstanceConfigsInstanceGroupManagerRequest; + })(); + + v1.RecreateInstancesInstanceGroupManagerRequest = (function() { + + /** + * Properties of a RecreateInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IRecreateInstancesInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] RecreateInstancesInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest|null} [instanceGroupManagersRecreateInstancesRequestResource] RecreateInstancesInstanceGroupManagerRequest instanceGroupManagersRecreateInstancesRequestResource + * @property {string|null} [project] RecreateInstancesInstanceGroupManagerRequest project + * @property {string|null} [requestId] RecreateInstancesInstanceGroupManagerRequest requestId + * @property {string|null} [zone] RecreateInstancesInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new RecreateInstancesInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RecreateInstancesInstanceGroupManagerRequest. + * @implements IRecreateInstancesInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest=} [properties] Properties to set + */ + function RecreateInstancesInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecreateInstancesInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * RecreateInstancesInstanceGroupManagerRequest instanceGroupManagersRecreateInstancesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersRecreateInstancesRequest|null|undefined} instanceGroupManagersRecreateInstancesRequestResource + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesInstanceGroupManagerRequest.prototype.instanceGroupManagersRecreateInstancesRequestResource = null; + + /** + * RecreateInstancesInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesInstanceGroupManagerRequest.prototype.project = ""; + + /** + * RecreateInstancesInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * RecreateInstancesInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecreateInstancesInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(RecreateInstancesInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecreateInstancesInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest} RecreateInstancesInstanceGroupManagerRequest instance + */ + RecreateInstancesInstanceGroupManagerRequest.create = function create(properties) { + return new RecreateInstancesInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified RecreateInstancesInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest} message RecreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecreateInstancesInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instanceGroupManagersRecreateInstancesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersRecreateInstancesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.encode(message.instanceGroupManagersRecreateInstancesRequestResource, writer.uint32(/* id 21405952, wireType 2 =*/171247618).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified RecreateInstancesInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest} message RecreateInstancesInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecreateInstancesInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest} RecreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecreateInstancesInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 21405952: + message.instanceGroupManagersRecreateInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecreateInstancesInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest} RecreateInstancesInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecreateInstancesInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecreateInstancesInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecreateInstancesInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersRecreateInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersRecreateInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.verify(message.instanceGroupManagersRecreateInstancesRequestResource); + if (error) + return "instanceGroupManagersRecreateInstancesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a RecreateInstancesInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest} RecreateInstancesInstanceGroupManagerRequest + */ + RecreateInstancesInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersRecreateInstancesRequestResource != null) { + if (typeof object.instanceGroupManagersRecreateInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest.instanceGroupManagersRecreateInstancesRequestResource: object expected"); + message.instanceGroupManagersRecreateInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.fromObject(object.instanceGroupManagersRecreateInstancesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a RecreateInstancesInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest} message RecreateInstancesInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecreateInstancesInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroupManagersRecreateInstancesRequestResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instanceGroupManagersRecreateInstancesRequestResource != null && message.hasOwnProperty("instanceGroupManagersRecreateInstancesRequestResource")) + object.instanceGroupManagersRecreateInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest.toObject(message.instanceGroupManagersRecreateInstancesRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this RecreateInstancesInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + RecreateInstancesInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecreateInstancesInstanceGroupManagerRequest; + })(); + + v1.ResizeInstanceGroupManagerRequest = (function() { + + /** + * Properties of a ResizeInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IResizeInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] ResizeInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] ResizeInstanceGroupManagerRequest project + * @property {string|null} [requestId] ResizeInstanceGroupManagerRequest requestId + * @property {number|null} [size] ResizeInstanceGroupManagerRequest size + * @property {string|null} [zone] ResizeInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new ResizeInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResizeInstanceGroupManagerRequest. + * @implements IResizeInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IResizeInstanceGroupManagerRequest=} [properties] Properties to set + */ + function ResizeInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResizeInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @instance + */ + ResizeInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * ResizeInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @instance + */ + ResizeInstanceGroupManagerRequest.prototype.project = ""; + + /** + * ResizeInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @instance + */ + ResizeInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * ResizeInstanceGroupManagerRequest size. + * @member {number} size + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @instance + */ + ResizeInstanceGroupManagerRequest.prototype.size = 0; + + /** + * ResizeInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @instance + */ + ResizeInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResizeInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(ResizeInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResizeInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IResizeInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResizeInstanceGroupManagerRequest} ResizeInstanceGroupManagerRequest instance + */ + ResizeInstanceGroupManagerRequest.create = function create(properties) { + return new ResizeInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified ResizeInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IResizeInstanceGroupManagerRequest} message ResizeInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 3530753, wireType 0 =*/28246024).int32(message.size); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified ResizeInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IResizeInstanceGroupManagerRequest} message ResizeInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResizeInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResizeInstanceGroupManagerRequest} ResizeInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResizeInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3530753: + message.size = reader.int32(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResizeInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResizeInstanceGroupManagerRequest} ResizeInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResizeInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResizeInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size)) + return "size: integer expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ResizeInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResizeInstanceGroupManagerRequest} ResizeInstanceGroupManagerRequest + */ + ResizeInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResizeInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.ResizeInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.size != null) + message.size = object.size | 0; + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ResizeInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ResizeInstanceGroupManagerRequest} message ResizeInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResizeInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.size = 0; + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.size != null && message.hasOwnProperty("size")) + object.size = message.size; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this ResizeInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResizeInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + ResizeInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResizeInstanceGroupManagerRequest; + })(); + + v1.SetInstanceTemplateInstanceGroupManagerRequest = (function() { + + /** + * Properties of a SetInstanceTemplateInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetInstanceTemplateInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest|null} [instanceGroupManagersSetInstanceTemplateRequestResource] SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManagersSetInstanceTemplateRequestResource + * @property {string|null} [project] SetInstanceTemplateInstanceGroupManagerRequest project + * @property {string|null} [requestId] SetInstanceTemplateInstanceGroupManagerRequest requestId + * @property {string|null} [zone] SetInstanceTemplateInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new SetInstanceTemplateInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetInstanceTemplateInstanceGroupManagerRequest. + * @implements ISetInstanceTemplateInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest=} [properties] Properties to set + */ + function SetInstanceTemplateInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * SetInstanceTemplateInstanceGroupManagerRequest instanceGroupManagersSetInstanceTemplateRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersSetInstanceTemplateRequest|null|undefined} instanceGroupManagersSetInstanceTemplateRequestResource + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateInstanceGroupManagerRequest.prototype.instanceGroupManagersSetInstanceTemplateRequestResource = null; + + /** + * SetInstanceTemplateInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateInstanceGroupManagerRequest.prototype.project = ""; + + /** + * SetInstanceTemplateInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * SetInstanceTemplateInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetInstanceTemplateInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(SetInstanceTemplateInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetInstanceTemplateInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest} SetInstanceTemplateInstanceGroupManagerRequest instance + */ + SetInstanceTemplateInstanceGroupManagerRequest.create = function create(properties) { + return new SetInstanceTemplateInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified SetInstanceTemplateInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest} message SetInstanceTemplateInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetInstanceTemplateInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instanceGroupManagersSetInstanceTemplateRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersSetInstanceTemplateRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.encode(message.instanceGroupManagersSetInstanceTemplateRequestResource, writer.uint32(/* id 9809093, wireType 2 =*/78472746).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified SetInstanceTemplateInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest} message SetInstanceTemplateInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetInstanceTemplateInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetInstanceTemplateInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest} SetInstanceTemplateInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetInstanceTemplateInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 9809093: + message.instanceGroupManagersSetInstanceTemplateRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetInstanceTemplateInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest} SetInstanceTemplateInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetInstanceTemplateInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetInstanceTemplateInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetInstanceTemplateInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersSetInstanceTemplateRequestResource != null && message.hasOwnProperty("instanceGroupManagersSetInstanceTemplateRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.verify(message.instanceGroupManagersSetInstanceTemplateRequestResource); + if (error) + return "instanceGroupManagersSetInstanceTemplateRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetInstanceTemplateInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest} SetInstanceTemplateInstanceGroupManagerRequest + */ + SetInstanceTemplateInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersSetInstanceTemplateRequestResource != null) { + if (typeof object.instanceGroupManagersSetInstanceTemplateRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest.instanceGroupManagersSetInstanceTemplateRequestResource: object expected"); + message.instanceGroupManagersSetInstanceTemplateRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.fromObject(object.instanceGroupManagersSetInstanceTemplateRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetInstanceTemplateInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest} message SetInstanceTemplateInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetInstanceTemplateInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroupManagersSetInstanceTemplateRequestResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instanceGroupManagersSetInstanceTemplateRequestResource != null && message.hasOwnProperty("instanceGroupManagersSetInstanceTemplateRequestResource")) + object.instanceGroupManagersSetInstanceTemplateRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest.toObject(message.instanceGroupManagersSetInstanceTemplateRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this SetInstanceTemplateInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + SetInstanceTemplateInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetInstanceTemplateInstanceGroupManagerRequest; + })(); + + v1.SetTargetPoolsInstanceGroupManagerRequest = (function() { + + /** + * Properties of a SetTargetPoolsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetTargetPoolsInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] SetTargetPoolsInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest|null} [instanceGroupManagersSetTargetPoolsRequestResource] SetTargetPoolsInstanceGroupManagerRequest instanceGroupManagersSetTargetPoolsRequestResource + * @property {string|null} [project] SetTargetPoolsInstanceGroupManagerRequest project + * @property {string|null} [requestId] SetTargetPoolsInstanceGroupManagerRequest requestId + * @property {string|null} [zone] SetTargetPoolsInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new SetTargetPoolsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetTargetPoolsInstanceGroupManagerRequest. + * @implements ISetTargetPoolsInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest=} [properties] Properties to set + */ + function SetTargetPoolsInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetTargetPoolsInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * SetTargetPoolsInstanceGroupManagerRequest instanceGroupManagersSetTargetPoolsRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersSetTargetPoolsRequest|null|undefined} instanceGroupManagersSetTargetPoolsRequestResource + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsInstanceGroupManagerRequest.prototype.instanceGroupManagersSetTargetPoolsRequestResource = null; + + /** + * SetTargetPoolsInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsInstanceGroupManagerRequest.prototype.project = ""; + + /** + * SetTargetPoolsInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * SetTargetPoolsInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetTargetPoolsInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(SetTargetPoolsInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetTargetPoolsInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest} SetTargetPoolsInstanceGroupManagerRequest instance + */ + SetTargetPoolsInstanceGroupManagerRequest.create = function create(properties) { + return new SetTargetPoolsInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified SetTargetPoolsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest} message SetTargetPoolsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetPoolsInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.instanceGroupManagersSetTargetPoolsRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersSetTargetPoolsRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.encode(message.instanceGroupManagersSetTargetPoolsRequestResource, writer.uint32(/* id 281150216, wireType 2 =*/2249201730).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetTargetPoolsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest} message SetTargetPoolsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetPoolsInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetTargetPoolsInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest} SetTargetPoolsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetPoolsInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 281150216: + message.instanceGroupManagersSetTargetPoolsRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetTargetPoolsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest} SetTargetPoolsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetPoolsInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetTargetPoolsInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetTargetPoolsInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersSetTargetPoolsRequestResource != null && message.hasOwnProperty("instanceGroupManagersSetTargetPoolsRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.verify(message.instanceGroupManagersSetTargetPoolsRequestResource); + if (error) + return "instanceGroupManagersSetTargetPoolsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetTargetPoolsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest} SetTargetPoolsInstanceGroupManagerRequest + */ + SetTargetPoolsInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersSetTargetPoolsRequestResource != null) { + if (typeof object.instanceGroupManagersSetTargetPoolsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest.instanceGroupManagersSetTargetPoolsRequestResource: object expected"); + message.instanceGroupManagersSetTargetPoolsRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.fromObject(object.instanceGroupManagersSetTargetPoolsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetTargetPoolsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest} message SetTargetPoolsInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetTargetPoolsInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.instanceGroupManagersSetTargetPoolsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.instanceGroupManagersSetTargetPoolsRequestResource != null && message.hasOwnProperty("instanceGroupManagersSetTargetPoolsRequestResource")) + object.instanceGroupManagersSetTargetPoolsRequestResource = $root.google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest.toObject(message.instanceGroupManagersSetTargetPoolsRequestResource, options); + return object; + }; + + /** + * Converts this SetTargetPoolsInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + SetTargetPoolsInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetTargetPoolsInstanceGroupManagerRequest; + })(); + + v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest = (function() { + + /** + * Properties of an UpdatePerInstanceConfigsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdatePerInstanceConfigsInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq|null} [instanceGroupManagersUpdatePerInstanceConfigsReqResource] UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersUpdatePerInstanceConfigsReqResource + * @property {string|null} [project] UpdatePerInstanceConfigsInstanceGroupManagerRequest project + * @property {string|null} [requestId] UpdatePerInstanceConfigsInstanceGroupManagerRequest requestId + * @property {string|null} [zone] UpdatePerInstanceConfigsInstanceGroupManagerRequest zone + */ + + /** + * Constructs a new UpdatePerInstanceConfigsInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdatePerInstanceConfigsInstanceGroupManagerRequest. + * @implements IUpdatePerInstanceConfigsInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest=} [properties] Properties to set + */ + function UpdatePerInstanceConfigsInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * UpdatePerInstanceConfigsInstanceGroupManagerRequest instanceGroupManagersUpdatePerInstanceConfigsReqResource. + * @member {google.cloud.compute.v1.IInstanceGroupManagersUpdatePerInstanceConfigsReq|null|undefined} instanceGroupManagersUpdatePerInstanceConfigsReqResource + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.prototype.instanceGroupManagersUpdatePerInstanceConfigsReqResource = null; + + /** + * UpdatePerInstanceConfigsInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.prototype.project = ""; + + /** + * UpdatePerInstanceConfigsInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * UpdatePerInstanceConfigsInstanceGroupManagerRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdatePerInstanceConfigsInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(UpdatePerInstanceConfigsInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdatePerInstanceConfigsInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest} UpdatePerInstanceConfigsInstanceGroupManagerRequest instance + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.create = function create(properties) { + return new UpdatePerInstanceConfigsInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified UpdatePerInstanceConfigsInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest} message UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceGroupManagersUpdatePerInstanceConfigsReqResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagersUpdatePerInstanceConfigsReqResource")) + $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.encode(message.instanceGroupManagersUpdatePerInstanceConfigsReqResource, writer.uint32(/* id 141402302, wireType 2 =*/1131218418).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified UpdatePerInstanceConfigsInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest} message UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest} UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 141402302: + message.instanceGroupManagersUpdatePerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePerInstanceConfigsInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest} UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePerInstanceConfigsInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagersUpdatePerInstanceConfigsReqResource != null && message.hasOwnProperty("instanceGroupManagersUpdatePerInstanceConfigsReqResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.verify(message.instanceGroupManagersUpdatePerInstanceConfigsReqResource); + if (error) + return "instanceGroupManagersUpdatePerInstanceConfigsReqResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an UpdatePerInstanceConfigsInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest} UpdatePerInstanceConfigsInstanceGroupManagerRequest + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagersUpdatePerInstanceConfigsReqResource != null) { + if (typeof object.instanceGroupManagersUpdatePerInstanceConfigsReqResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest.instanceGroupManagersUpdatePerInstanceConfigsReqResource: object expected"); + message.instanceGroupManagersUpdatePerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.fromObject(object.instanceGroupManagersUpdatePerInstanceConfigsReqResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an UpdatePerInstanceConfigsInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest} message UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroupManagersUpdatePerInstanceConfigsReqResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceGroupManagersUpdatePerInstanceConfigsReqResource != null && message.hasOwnProperty("instanceGroupManagersUpdatePerInstanceConfigsReqResource")) + object.instanceGroupManagersUpdatePerInstanceConfigsReqResource = $root.google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq.toObject(message.instanceGroupManagersUpdatePerInstanceConfigsReqResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this UpdatePerInstanceConfigsInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePerInstanceConfigsInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdatePerInstanceConfigsInstanceGroupManagerRequest; + })(); + + v1.AddInstancesInstanceGroupRequest = (function() { + + /** + * Properties of an AddInstancesInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddInstancesInstanceGroupRequest + * @property {string|null} [instanceGroup] AddInstancesInstanceGroupRequest instanceGroup + * @property {google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest|null} [instanceGroupsAddInstancesRequestResource] AddInstancesInstanceGroupRequest instanceGroupsAddInstancesRequestResource + * @property {string|null} [project] AddInstancesInstanceGroupRequest project + * @property {string|null} [requestId] AddInstancesInstanceGroupRequest requestId + * @property {string|null} [zone] AddInstancesInstanceGroupRequest zone + */ + + /** + * Constructs a new AddInstancesInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddInstancesInstanceGroupRequest. + * @implements IAddInstancesInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IAddInstancesInstanceGroupRequest=} [properties] Properties to set + */ + function AddInstancesInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddInstancesInstanceGroupRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @instance + */ + AddInstancesInstanceGroupRequest.prototype.instanceGroup = ""; + + /** + * AddInstancesInstanceGroupRequest instanceGroupsAddInstancesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupsAddInstancesRequest|null|undefined} instanceGroupsAddInstancesRequestResource + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @instance + */ + AddInstancesInstanceGroupRequest.prototype.instanceGroupsAddInstancesRequestResource = null; + + /** + * AddInstancesInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @instance + */ + AddInstancesInstanceGroupRequest.prototype.project = ""; + + /** + * AddInstancesInstanceGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @instance + */ + AddInstancesInstanceGroupRequest.prototype.requestId = null; + + /** + * AddInstancesInstanceGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @instance + */ + AddInstancesInstanceGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddInstancesInstanceGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @instance + */ + Object.defineProperty(AddInstancesInstanceGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddInstancesInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IAddInstancesInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddInstancesInstanceGroupRequest} AddInstancesInstanceGroupRequest instance + */ + AddInstancesInstanceGroupRequest.create = function create(properties) { + return new AddInstancesInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified AddInstancesInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AddInstancesInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IAddInstancesInstanceGroupRequest} message AddInstancesInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddInstancesInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupsAddInstancesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupsAddInstancesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.encode(message.instanceGroupsAddInstancesRequestResource, writer.uint32(/* id 453713246, wireType 2 =*/3629705970).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddInstancesInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddInstancesInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IAddInstancesInstanceGroupRequest} message AddInstancesInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddInstancesInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddInstancesInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddInstancesInstanceGroupRequest} AddInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddInstancesInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddInstancesInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 81095253: + message.instanceGroup = reader.string(); + break; + case 453713246: + message.instanceGroupsAddInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddInstancesInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddInstancesInstanceGroupRequest} AddInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddInstancesInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddInstancesInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddInstancesInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.instanceGroupsAddInstancesRequestResource != null && message.hasOwnProperty("instanceGroupsAddInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.verify(message.instanceGroupsAddInstancesRequestResource); + if (error) + return "instanceGroupsAddInstancesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AddInstancesInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddInstancesInstanceGroupRequest} AddInstancesInstanceGroupRequest + */ + AddInstancesInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddInstancesInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddInstancesInstanceGroupRequest(); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.instanceGroupsAddInstancesRequestResource != null) { + if (typeof object.instanceGroupsAddInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddInstancesInstanceGroupRequest.instanceGroupsAddInstancesRequestResource: object expected"); + message.instanceGroupsAddInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.fromObject(object.instanceGroupsAddInstancesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AddInstancesInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.AddInstancesInstanceGroupRequest} message AddInstancesInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddInstancesInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroup = ""; + object.project = ""; + object.instanceGroupsAddInstancesRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupsAddInstancesRequestResource != null && message.hasOwnProperty("instanceGroupsAddInstancesRequestResource")) + object.instanceGroupsAddInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsAddInstancesRequest.toObject(message.instanceGroupsAddInstancesRequestResource, options); + return object; + }; + + /** + * Converts this AddInstancesInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddInstancesInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + AddInstancesInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddInstancesInstanceGroupRequest; + })(); + + v1.AggregatedListInstanceGroupsRequest = (function() { + + /** + * Properties of an AggregatedListInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListInstanceGroupsRequest + * @property {string|null} [filter] AggregatedListInstanceGroupsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListInstanceGroupsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListInstanceGroupsRequest maxResults + * @property {string|null} [orderBy] AggregatedListInstanceGroupsRequest orderBy + * @property {string|null} [pageToken] AggregatedListInstanceGroupsRequest pageToken + * @property {string|null} [project] AggregatedListInstanceGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListInstanceGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListInstanceGroupsRequest. + * @implements IAggregatedListInstanceGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest=} [properties] Properties to set + */ + function AggregatedListInstanceGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListInstanceGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + AggregatedListInstanceGroupsRequest.prototype.filter = null; + + /** + * AggregatedListInstanceGroupsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + AggregatedListInstanceGroupsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListInstanceGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + AggregatedListInstanceGroupsRequest.prototype.maxResults = null; + + /** + * AggregatedListInstanceGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + AggregatedListInstanceGroupsRequest.prototype.orderBy = null; + + /** + * AggregatedListInstanceGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + AggregatedListInstanceGroupsRequest.prototype.pageToken = null; + + /** + * AggregatedListInstanceGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + AggregatedListInstanceGroupsRequest.prototype.project = ""; + + /** + * AggregatedListInstanceGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + AggregatedListInstanceGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListInstanceGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstanceGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListInstanceGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListInstanceGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupsRequest} AggregatedListInstanceGroupsRequest instance + */ + AggregatedListInstanceGroupsRequest.create = function create(properties) { + return new AggregatedListInstanceGroupsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest} message AggregatedListInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInstanceGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstanceGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest} message AggregatedListInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInstanceGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListInstanceGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupsRequest} AggregatedListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInstanceGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListInstanceGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupsRequest} AggregatedListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInstanceGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListInstanceGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListInstanceGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListInstanceGroupsRequest} AggregatedListInstanceGroupsRequest + */ + AggregatedListInstanceGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListInstanceGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListInstanceGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListInstanceGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListInstanceGroupsRequest} message AggregatedListInstanceGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListInstanceGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListInstanceGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListInstanceGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListInstanceGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListInstanceGroupsRequest; + })(); + + v1.DeleteInstanceGroupRequest = (function() { + + /** + * Properties of a DeleteInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInstanceGroupRequest + * @property {string|null} [instanceGroup] DeleteInstanceGroupRequest instanceGroup + * @property {string|null} [project] DeleteInstanceGroupRequest project + * @property {string|null} [requestId] DeleteInstanceGroupRequest requestId + * @property {string|null} [zone] DeleteInstanceGroupRequest zone + */ + + /** + * Constructs a new DeleteInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInstanceGroupRequest. + * @implements IDeleteInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteInstanceGroupRequest=} [properties] Properties to set + */ + function DeleteInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceGroupRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @instance + */ + DeleteInstanceGroupRequest.prototype.instanceGroup = ""; + + /** + * DeleteInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @instance + */ + DeleteInstanceGroupRequest.prototype.project = ""; + + /** + * DeleteInstanceGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @instance + */ + DeleteInstanceGroupRequest.prototype.requestId = null; + + /** + * DeleteInstanceGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @instance + */ + DeleteInstanceGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInstanceGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @instance + */ + Object.defineProperty(DeleteInstanceGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInstanceGroupRequest} DeleteInstanceGroupRequest instance + */ + DeleteInstanceGroupRequest.create = function create(properties) { + return new DeleteInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceGroupRequest} message DeleteInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceGroupRequest} message DeleteInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteInstanceGroupRequest} DeleteInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 81095253: + message.instanceGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteInstanceGroupRequest} DeleteInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInstanceGroupRequest} DeleteInstanceGroupRequest + */ + DeleteInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInstanceGroupRequest(); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.DeleteInstanceGroupRequest} message DeleteInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroup = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceGroupRequest; + })(); + + v1.GetInstanceGroupRequest = (function() { + + /** + * Properties of a GetInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetInstanceGroupRequest + * @property {string|null} [instanceGroup] GetInstanceGroupRequest instanceGroup + * @property {string|null} [project] GetInstanceGroupRequest project + * @property {string|null} [zone] GetInstanceGroupRequest zone + */ + + /** + * Constructs a new GetInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetInstanceGroupRequest. + * @implements IGetInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IGetInstanceGroupRequest=} [properties] Properties to set + */ + function GetInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceGroupRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @instance + */ + GetInstanceGroupRequest.prototype.instanceGroup = ""; + + /** + * GetInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @instance + */ + GetInstanceGroupRequest.prototype.project = ""; + + /** + * GetInstanceGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @instance + */ + GetInstanceGroupRequest.prototype.zone = ""; + + /** + * Creates a new GetInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetInstanceGroupRequest} GetInstanceGroupRequest instance + */ + GetInstanceGroupRequest.create = function create(properties) { + return new GetInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified GetInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceGroupRequest} message GetInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceGroupRequest} message GetInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetInstanceGroupRequest} GetInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 81095253: + message.instanceGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetInstanceGroupRequest} GetInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetInstanceGroupRequest} GetInstanceGroupRequest + */ + GetInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetInstanceGroupRequest(); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.GetInstanceGroupRequest} message GetInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroup = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceGroupRequest; + })(); + + v1.InsertInstanceGroupRequest = (function() { + + /** + * Properties of an InsertInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertInstanceGroupRequest + * @property {google.cloud.compute.v1.IInstanceGroup|null} [instanceGroupResource] InsertInstanceGroupRequest instanceGroupResource + * @property {string|null} [project] InsertInstanceGroupRequest project + * @property {string|null} [requestId] InsertInstanceGroupRequest requestId + * @property {string|null} [zone] InsertInstanceGroupRequest zone + */ + + /** + * Constructs a new InsertInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertInstanceGroupRequest. + * @implements IInsertInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertInstanceGroupRequest=} [properties] Properties to set + */ + function InsertInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertInstanceGroupRequest instanceGroupResource. + * @member {google.cloud.compute.v1.IInstanceGroup|null|undefined} instanceGroupResource + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @instance + */ + InsertInstanceGroupRequest.prototype.instanceGroupResource = null; + + /** + * InsertInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @instance + */ + InsertInstanceGroupRequest.prototype.project = ""; + + /** + * InsertInstanceGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @instance + */ + InsertInstanceGroupRequest.prototype.requestId = null; + + /** + * InsertInstanceGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @instance + */ + InsertInstanceGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertInstanceGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @instance + */ + Object.defineProperty(InsertInstanceGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertInstanceGroupRequest} InsertInstanceGroupRequest instance + */ + InsertInstanceGroupRequest.create = function create(properties) { + return new InsertInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified InsertInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceGroupRequest} message InsertInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupResource != null && Object.hasOwnProperty.call(message, "instanceGroupResource")) + $root.google.cloud.compute.v1.InstanceGroup.encode(message.instanceGroupResource, writer.uint32(/* id 286612152, wireType 2 =*/2292897218).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceGroupRequest} message InsertInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertInstanceGroupRequest} InsertInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 286612152: + message.instanceGroupResource = $root.google.cloud.compute.v1.InstanceGroup.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertInstanceGroupRequest} InsertInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupResource != null && message.hasOwnProperty("instanceGroupResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroup.verify(message.instanceGroupResource); + if (error) + return "instanceGroupResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertInstanceGroupRequest} InsertInstanceGroupRequest + */ + InsertInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertInstanceGroupRequest(); + if (object.instanceGroupResource != null) { + if (typeof object.instanceGroupResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertInstanceGroupRequest.instanceGroupResource: object expected"); + message.instanceGroupResource = $root.google.cloud.compute.v1.InstanceGroup.fromObject(object.instanceGroupResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.InsertInstanceGroupRequest} message InsertInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.instanceGroupResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupResource != null && message.hasOwnProperty("instanceGroupResource")) + object.instanceGroupResource = $root.google.cloud.compute.v1.InstanceGroup.toObject(message.instanceGroupResource, options); + return object; + }; + + /** + * Converts this InsertInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + InsertInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertInstanceGroupRequest; + })(); + + v1.ListInstanceGroupsRequest = (function() { + + /** + * Properties of a ListInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInstanceGroupsRequest + * @property {string|null} [filter] ListInstanceGroupsRequest filter + * @property {number|null} [maxResults] ListInstanceGroupsRequest maxResults + * @property {string|null} [orderBy] ListInstanceGroupsRequest orderBy + * @property {string|null} [pageToken] ListInstanceGroupsRequest pageToken + * @property {string|null} [project] ListInstanceGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListInstanceGroupsRequest returnPartialSuccess + * @property {string|null} [zone] ListInstanceGroupsRequest zone + */ + + /** + * Constructs a new ListInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInstanceGroupsRequest. + * @implements IListInstanceGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListInstanceGroupsRequest=} [properties] Properties to set + */ + function ListInstanceGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + ListInstanceGroupsRequest.prototype.filter = null; + + /** + * ListInstanceGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + ListInstanceGroupsRequest.prototype.maxResults = null; + + /** + * ListInstanceGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + ListInstanceGroupsRequest.prototype.orderBy = null; + + /** + * ListInstanceGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + ListInstanceGroupsRequest.prototype.pageToken = null; + + /** + * ListInstanceGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + ListInstanceGroupsRequest.prototype.project = ""; + + /** + * ListInstanceGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + ListInstanceGroupsRequest.prototype.returnPartialSuccess = null; + + /** + * ListInstanceGroupsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + ListInstanceGroupsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInstanceGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstanceGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInstanceGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInstanceGroupsRequest} ListInstanceGroupsRequest instance + */ + ListInstanceGroupsRequest.create = function create(properties) { + return new ListInstanceGroupsRequest(properties); + }; + + /** + * Encodes the specified ListInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceGroupsRequest} message ListInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstanceGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceGroupsRequest} message ListInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInstanceGroupsRequest} ListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInstanceGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInstanceGroupsRequest} ListInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInstanceGroupsRequest} ListInstanceGroupsRequest + */ + ListInstanceGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInstanceGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInstanceGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListInstanceGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListInstanceGroupsRequest} message ListInstanceGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInstanceGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInstanceGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstanceGroupsRequest; + })(); + + v1.ListInstancesInstanceGroupsRequest = (function() { + + /** + * Properties of a ListInstancesInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInstancesInstanceGroupsRequest + * @property {string|null} [filter] ListInstancesInstanceGroupsRequest filter + * @property {string|null} [instanceGroup] ListInstancesInstanceGroupsRequest instanceGroup + * @property {google.cloud.compute.v1.IInstanceGroupsListInstancesRequest|null} [instanceGroupsListInstancesRequestResource] ListInstancesInstanceGroupsRequest instanceGroupsListInstancesRequestResource + * @property {number|null} [maxResults] ListInstancesInstanceGroupsRequest maxResults + * @property {string|null} [orderBy] ListInstancesInstanceGroupsRequest orderBy + * @property {string|null} [pageToken] ListInstancesInstanceGroupsRequest pageToken + * @property {string|null} [project] ListInstancesInstanceGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListInstancesInstanceGroupsRequest returnPartialSuccess + * @property {string|null} [zone] ListInstancesInstanceGroupsRequest zone + */ + + /** + * Constructs a new ListInstancesInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInstancesInstanceGroupsRequest. + * @implements IListInstancesInstanceGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListInstancesInstanceGroupsRequest=} [properties] Properties to set + */ + function ListInstancesInstanceGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesInstanceGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.filter = null; + + /** + * ListInstancesInstanceGroupsRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.instanceGroup = ""; + + /** + * ListInstancesInstanceGroupsRequest instanceGroupsListInstancesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupsListInstancesRequest|null|undefined} instanceGroupsListInstancesRequestResource + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.instanceGroupsListInstancesRequestResource = null; + + /** + * ListInstancesInstanceGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.maxResults = null; + + /** + * ListInstancesInstanceGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.orderBy = null; + + /** + * ListInstancesInstanceGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.pageToken = null; + + /** + * ListInstancesInstanceGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.project = ""; + + /** + * ListInstancesInstanceGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.returnPartialSuccess = null; + + /** + * ListInstancesInstanceGroupsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + ListInstancesInstanceGroupsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInstancesInstanceGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesInstanceGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesInstanceGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesInstanceGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesInstanceGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesInstanceGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesInstanceGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesInstanceGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesInstanceGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesInstanceGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInstancesInstanceGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstancesInstanceGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInstancesInstanceGroupsRequest} ListInstancesInstanceGroupsRequest instance + */ + ListInstancesInstanceGroupsRequest.create = function create(properties) { + return new ListInstancesInstanceGroupsRequest(properties); + }; + + /** + * Encodes the specified ListInstancesInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstancesInstanceGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstancesInstanceGroupsRequest} message ListInstancesInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesInstanceGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.instanceGroupsListInstancesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupsListInstancesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest.encode(message.instanceGroupsListInstancesRequestResource, writer.uint32(/* id 476255263, wireType 2 =*/3810042106).fork()).ldelim(); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInstancesInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstancesInstanceGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstancesInstanceGroupsRequest} message ListInstancesInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesInstanceGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesInstanceGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInstancesInstanceGroupsRequest} ListInstancesInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesInstanceGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 81095253: + message.instanceGroup = reader.string(); + break; + case 476255263: + message.instanceGroupsListInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest.decode(reader, reader.uint32()); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInstancesInstanceGroupsRequest} ListInstancesInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesInstanceGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesInstanceGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesInstanceGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.instanceGroupsListInstancesRequestResource != null && message.hasOwnProperty("instanceGroupsListInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest.verify(message.instanceGroupsListInstancesRequestResource); + if (error) + return "instanceGroupsListInstancesRequestResource." + error; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListInstancesInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInstancesInstanceGroupsRequest} ListInstancesInstanceGroupsRequest + */ + ListInstancesInstanceGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.instanceGroupsListInstancesRequestResource != null) { + if (typeof object.instanceGroupsListInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ListInstancesInstanceGroupsRequest.instanceGroupsListInstancesRequestResource: object expected"); + message.instanceGroupsListInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest.fromObject(object.instanceGroupsListInstancesRequestResource); + } + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListInstancesInstanceGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListInstancesInstanceGroupsRequest} message ListInstancesInstanceGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesInstanceGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroup = ""; + object.project = ""; + object.instanceGroupsListInstancesRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.instanceGroupsListInstancesRequestResource != null && message.hasOwnProperty("instanceGroupsListInstancesRequestResource")) + object.instanceGroupsListInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsListInstancesRequest.toObject(message.instanceGroupsListInstancesRequestResource, options); + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInstancesInstanceGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInstancesInstanceGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesInstanceGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesInstanceGroupsRequest; + })(); + + v1.RemoveInstancesInstanceGroupRequest = (function() { + + /** + * Properties of a RemoveInstancesInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveInstancesInstanceGroupRequest + * @property {string|null} [instanceGroup] RemoveInstancesInstanceGroupRequest instanceGroup + * @property {google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest|null} [instanceGroupsRemoveInstancesRequestResource] RemoveInstancesInstanceGroupRequest instanceGroupsRemoveInstancesRequestResource + * @property {string|null} [project] RemoveInstancesInstanceGroupRequest project + * @property {string|null} [requestId] RemoveInstancesInstanceGroupRequest requestId + * @property {string|null} [zone] RemoveInstancesInstanceGroupRequest zone + */ + + /** + * Constructs a new RemoveInstancesInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveInstancesInstanceGroupRequest. + * @implements IRemoveInstancesInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest=} [properties] Properties to set + */ + function RemoveInstancesInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveInstancesInstanceGroupRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @instance + */ + RemoveInstancesInstanceGroupRequest.prototype.instanceGroup = ""; + + /** + * RemoveInstancesInstanceGroupRequest instanceGroupsRemoveInstancesRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupsRemoveInstancesRequest|null|undefined} instanceGroupsRemoveInstancesRequestResource + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @instance + */ + RemoveInstancesInstanceGroupRequest.prototype.instanceGroupsRemoveInstancesRequestResource = null; + + /** + * RemoveInstancesInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @instance + */ + RemoveInstancesInstanceGroupRequest.prototype.project = ""; + + /** + * RemoveInstancesInstanceGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @instance + */ + RemoveInstancesInstanceGroupRequest.prototype.requestId = null; + + /** + * RemoveInstancesInstanceGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @instance + */ + RemoveInstancesInstanceGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveInstancesInstanceGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @instance + */ + Object.defineProperty(RemoveInstancesInstanceGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveInstancesInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest} RemoveInstancesInstanceGroupRequest instance + */ + RemoveInstancesInstanceGroupRequest.create = function create(properties) { + return new RemoveInstancesInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified RemoveInstancesInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest} message RemoveInstancesInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveInstancesInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupsRemoveInstancesRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupsRemoveInstancesRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.encode(message.instanceGroupsRemoveInstancesRequestResource, writer.uint32(/* id 390981817, wireType 2 =*/3127854538).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RemoveInstancesInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest} message RemoveInstancesInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveInstancesInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveInstancesInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest} RemoveInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveInstancesInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 81095253: + message.instanceGroup = reader.string(); + break; + case 390981817: + message.instanceGroupsRemoveInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveInstancesInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest} RemoveInstancesInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveInstancesInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveInstancesInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveInstancesInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.instanceGroupsRemoveInstancesRequestResource != null && message.hasOwnProperty("instanceGroupsRemoveInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.verify(message.instanceGroupsRemoveInstancesRequestResource); + if (error) + return "instanceGroupsRemoveInstancesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a RemoveInstancesInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest} RemoveInstancesInstanceGroupRequest + */ + RemoveInstancesInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest(); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.instanceGroupsRemoveInstancesRequestResource != null) { + if (typeof object.instanceGroupsRemoveInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest.instanceGroupsRemoveInstancesRequestResource: object expected"); + message.instanceGroupsRemoveInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.fromObject(object.instanceGroupsRemoveInstancesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a RemoveInstancesInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest} message RemoveInstancesInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveInstancesInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroup = ""; + object.project = ""; + object.instanceGroupsRemoveInstancesRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupsRemoveInstancesRequestResource != null && message.hasOwnProperty("instanceGroupsRemoveInstancesRequestResource")) + object.instanceGroupsRemoveInstancesRequestResource = $root.google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest.toObject(message.instanceGroupsRemoveInstancesRequestResource, options); + return object; + }; + + /** + * Converts this RemoveInstancesInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveInstancesInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveInstancesInstanceGroupRequest; + })(); + + v1.SetNamedPortsInstanceGroupRequest = (function() { + + /** + * Properties of a SetNamedPortsInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetNamedPortsInstanceGroupRequest + * @property {string|null} [instanceGroup] SetNamedPortsInstanceGroupRequest instanceGroup + * @property {google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest|null} [instanceGroupsSetNamedPortsRequestResource] SetNamedPortsInstanceGroupRequest instanceGroupsSetNamedPortsRequestResource + * @property {string|null} [project] SetNamedPortsInstanceGroupRequest project + * @property {string|null} [requestId] SetNamedPortsInstanceGroupRequest requestId + * @property {string|null} [zone] SetNamedPortsInstanceGroupRequest zone + */ + + /** + * Constructs a new SetNamedPortsInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetNamedPortsInstanceGroupRequest. + * @implements ISetNamedPortsInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest=} [properties] Properties to set + */ + function SetNamedPortsInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetNamedPortsInstanceGroupRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @instance + */ + SetNamedPortsInstanceGroupRequest.prototype.instanceGroup = ""; + + /** + * SetNamedPortsInstanceGroupRequest instanceGroupsSetNamedPortsRequestResource. + * @member {google.cloud.compute.v1.IInstanceGroupsSetNamedPortsRequest|null|undefined} instanceGroupsSetNamedPortsRequestResource + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @instance + */ + SetNamedPortsInstanceGroupRequest.prototype.instanceGroupsSetNamedPortsRequestResource = null; + + /** + * SetNamedPortsInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @instance + */ + SetNamedPortsInstanceGroupRequest.prototype.project = ""; + + /** + * SetNamedPortsInstanceGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @instance + */ + SetNamedPortsInstanceGroupRequest.prototype.requestId = null; + + /** + * SetNamedPortsInstanceGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @instance + */ + SetNamedPortsInstanceGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetNamedPortsInstanceGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @instance + */ + Object.defineProperty(SetNamedPortsInstanceGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetNamedPortsInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest} SetNamedPortsInstanceGroupRequest instance + */ + SetNamedPortsInstanceGroupRequest.create = function create(properties) { + return new SetNamedPortsInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified SetNamedPortsInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest} message SetNamedPortsInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetNamedPortsInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupsSetNamedPortsRequestResource != null && Object.hasOwnProperty.call(message, "instanceGroupsSetNamedPortsRequestResource")) + $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.encode(message.instanceGroupsSetNamedPortsRequestResource, writer.uint32(/* id 385151535, wireType 2 =*/3081212282).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetNamedPortsInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest} message SetNamedPortsInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetNamedPortsInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetNamedPortsInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest} SetNamedPortsInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetNamedPortsInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 81095253: + message.instanceGroup = reader.string(); + break; + case 385151535: + message.instanceGroupsSetNamedPortsRequestResource = $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetNamedPortsInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest} SetNamedPortsInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetNamedPortsInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetNamedPortsInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetNamedPortsInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.instanceGroupsSetNamedPortsRequestResource != null && message.hasOwnProperty("instanceGroupsSetNamedPortsRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.verify(message.instanceGroupsSetNamedPortsRequestResource); + if (error) + return "instanceGroupsSetNamedPortsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetNamedPortsInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest} SetNamedPortsInstanceGroupRequest + */ + SetNamedPortsInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest(); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.instanceGroupsSetNamedPortsRequestResource != null) { + if (typeof object.instanceGroupsSetNamedPortsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest.instanceGroupsSetNamedPortsRequestResource: object expected"); + message.instanceGroupsSetNamedPortsRequestResource = $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.fromObject(object.instanceGroupsSetNamedPortsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetNamedPortsInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest} message SetNamedPortsInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetNamedPortsInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceGroup = ""; + object.project = ""; + object.instanceGroupsSetNamedPortsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupsSetNamedPortsRequestResource != null && message.hasOwnProperty("instanceGroupsSetNamedPortsRequestResource")) + object.instanceGroupsSetNamedPortsRequestResource = $root.google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest.toObject(message.instanceGroupsSetNamedPortsRequestResource, options); + return object; + }; + + /** + * Converts this SetNamedPortsInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + SetNamedPortsInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetNamedPortsInstanceGroupRequest; + })(); + + v1.DeleteInstanceTemplateRequest = (function() { + + /** + * Properties of a DeleteInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInstanceTemplateRequest + * @property {string|null} [instanceTemplate] DeleteInstanceTemplateRequest instanceTemplate + * @property {string|null} [project] DeleteInstanceTemplateRequest project + * @property {string|null} [requestId] DeleteInstanceTemplateRequest requestId + */ + + /** + * Constructs a new DeleteInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInstanceTemplateRequest. + * @implements IDeleteInstanceTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteInstanceTemplateRequest=} [properties] Properties to set + */ + function DeleteInstanceTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceTemplateRequest instanceTemplate. + * @member {string} instanceTemplate + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @instance + */ + DeleteInstanceTemplateRequest.prototype.instanceTemplate = ""; + + /** + * DeleteInstanceTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @instance + */ + DeleteInstanceTemplateRequest.prototype.project = ""; + + /** + * DeleteInstanceTemplateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @instance + */ + DeleteInstanceTemplateRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInstanceTemplateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @instance + */ + Object.defineProperty(DeleteInstanceTemplateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInstanceTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInstanceTemplateRequest} DeleteInstanceTemplateRequest instance + */ + DeleteInstanceTemplateRequest.create = function create(properties) { + return new DeleteInstanceTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceTemplateRequest} message DeleteInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 309248228, wireType 2 =*/2473985826).string(message.instanceTemplate); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceTemplateRequest} message DeleteInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteInstanceTemplateRequest} DeleteInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteInstanceTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 309248228: + message.instanceTemplate = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteInstanceTemplateRequest} DeleteInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInstanceTemplateRequest} DeleteInstanceTemplateRequest + */ + DeleteInstanceTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInstanceTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInstanceTemplateRequest(); + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.DeleteInstanceTemplateRequest} message DeleteInstanceTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.instanceTemplate = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) + object.instanceTemplate = message.instanceTemplate; + return object; + }; + + /** + * Converts this DeleteInstanceTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInstanceTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceTemplateRequest; + })(); + + v1.GetInstanceTemplateRequest = (function() { + + /** + * Properties of a GetInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetInstanceTemplateRequest + * @property {string|null} [instanceTemplate] GetInstanceTemplateRequest instanceTemplate + * @property {string|null} [project] GetInstanceTemplateRequest project + */ + + /** + * Constructs a new GetInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetInstanceTemplateRequest. + * @implements IGetInstanceTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IGetInstanceTemplateRequest=} [properties] Properties to set + */ + function GetInstanceTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceTemplateRequest instanceTemplate. + * @member {string} instanceTemplate + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @instance + */ + GetInstanceTemplateRequest.prototype.instanceTemplate = ""; + + /** + * GetInstanceTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @instance + */ + GetInstanceTemplateRequest.prototype.project = ""; + + /** + * Creates a new GetInstanceTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetInstanceTemplateRequest} GetInstanceTemplateRequest instance + */ + GetInstanceTemplateRequest.create = function create(properties) { + return new GetInstanceTemplateRequest(properties); + }; + + /** + * Encodes the specified GetInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInstanceTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceTemplateRequest} message GetInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceTemplate != null && Object.hasOwnProperty.call(message, "instanceTemplate")) + writer.uint32(/* id 309248228, wireType 2 =*/2473985826).string(message.instanceTemplate); + return writer; + }; + + /** + * Encodes the specified GetInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInstanceTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceTemplateRequest} message GetInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetInstanceTemplateRequest} GetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetInstanceTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 309248228: + message.instanceTemplate = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetInstanceTemplateRequest} GetInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) + if (!$util.isString(message.instanceTemplate)) + return "instanceTemplate: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetInstanceTemplateRequest} GetInstanceTemplateRequest + */ + GetInstanceTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetInstanceTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetInstanceTemplateRequest(); + if (object.instanceTemplate != null) + message.instanceTemplate = String(object.instanceTemplate); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetInstanceTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.GetInstanceTemplateRequest} message GetInstanceTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.instanceTemplate = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceTemplate != null && message.hasOwnProperty("instanceTemplate")) + object.instanceTemplate = message.instanceTemplate; + return object; + }; + + /** + * Converts this GetInstanceTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetInstanceTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceTemplateRequest; + })(); + + v1.GetIamPolicyInstanceTemplateRequest = (function() { + + /** + * Properties of a GetIamPolicyInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyInstanceTemplateRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyInstanceTemplateRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyInstanceTemplateRequest project + * @property {string|null} [resource] GetIamPolicyInstanceTemplateRequest resource + */ + + /** + * Constructs a new GetIamPolicyInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyInstanceTemplateRequest. + * @implements IGetIamPolicyInstanceTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest=} [properties] Properties to set + */ + function GetIamPolicyInstanceTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyInstanceTemplateRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @instance + */ + GetIamPolicyInstanceTemplateRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyInstanceTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @instance + */ + GetIamPolicyInstanceTemplateRequest.prototype.project = ""; + + /** + * GetIamPolicyInstanceTemplateRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @instance + */ + GetIamPolicyInstanceTemplateRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyInstanceTemplateRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @instance + */ + Object.defineProperty(GetIamPolicyInstanceTemplateRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyInstanceTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest} GetIamPolicyInstanceTemplateRequest instance + */ + GetIamPolicyInstanceTemplateRequest.create = function create(properties) { + return new GetIamPolicyInstanceTemplateRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest} message GetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyInstanceTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest} message GetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyInstanceTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyInstanceTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest} GetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyInstanceTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest} GetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyInstanceTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyInstanceTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyInstanceTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest} GetIamPolicyInstanceTemplateRequest + */ + GetIamPolicyInstanceTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyInstanceTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest} message GetIamPolicyInstanceTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyInstanceTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyInstanceTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyInstanceTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyInstanceTemplateRequest; + })(); + + v1.InsertInstanceTemplateRequest = (function() { + + /** + * Properties of an InsertInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertInstanceTemplateRequest + * @property {google.cloud.compute.v1.IInstanceTemplate|null} [instanceTemplateResource] InsertInstanceTemplateRequest instanceTemplateResource + * @property {string|null} [project] InsertInstanceTemplateRequest project + * @property {string|null} [requestId] InsertInstanceTemplateRequest requestId + */ + + /** + * Constructs a new InsertInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertInstanceTemplateRequest. + * @implements IInsertInstanceTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertInstanceTemplateRequest=} [properties] Properties to set + */ + function InsertInstanceTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertInstanceTemplateRequest instanceTemplateResource. + * @member {google.cloud.compute.v1.IInstanceTemplate|null|undefined} instanceTemplateResource + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @instance + */ + InsertInstanceTemplateRequest.prototype.instanceTemplateResource = null; + + /** + * InsertInstanceTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @instance + */ + InsertInstanceTemplateRequest.prototype.project = ""; + + /** + * InsertInstanceTemplateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @instance + */ + InsertInstanceTemplateRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertInstanceTemplateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @instance + */ + Object.defineProperty(InsertInstanceTemplateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertInstanceTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertInstanceTemplateRequest} InsertInstanceTemplateRequest instance + */ + InsertInstanceTemplateRequest.create = function create(properties) { + return new InsertInstanceTemplateRequest(properties); + }; + + /** + * Encodes the specified InsertInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceTemplateRequest} message InsertInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceTemplateResource != null && Object.hasOwnProperty.call(message, "instanceTemplateResource")) + $root.google.cloud.compute.v1.InstanceTemplate.encode(message.instanceTemplateResource, writer.uint32(/* id 10679561, wireType 2 =*/85436490).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceTemplateRequest} message InsertInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertInstanceTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertInstanceTemplateRequest} InsertInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertInstanceTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 10679561: + message.instanceTemplateResource = $root.google.cloud.compute.v1.InstanceTemplate.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertInstanceTemplateRequest} InsertInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertInstanceTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertInstanceTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceTemplateResource != null && message.hasOwnProperty("instanceTemplateResource")) { + var error = $root.google.cloud.compute.v1.InstanceTemplate.verify(message.instanceTemplateResource); + if (error) + return "instanceTemplateResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertInstanceTemplateRequest} InsertInstanceTemplateRequest + */ + InsertInstanceTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertInstanceTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertInstanceTemplateRequest(); + if (object.instanceTemplateResource != null) { + if (typeof object.instanceTemplateResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertInstanceTemplateRequest.instanceTemplateResource: object expected"); + message.instanceTemplateResource = $root.google.cloud.compute.v1.InstanceTemplate.fromObject(object.instanceTemplateResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertInstanceTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.InsertInstanceTemplateRequest} message InsertInstanceTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertInstanceTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceTemplateResource = null; + object.project = ""; + } + if (message.instanceTemplateResource != null && message.hasOwnProperty("instanceTemplateResource")) + object.instanceTemplateResource = $root.google.cloud.compute.v1.InstanceTemplate.toObject(message.instanceTemplateResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertInstanceTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertInstanceTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + InsertInstanceTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertInstanceTemplateRequest; + })(); + + v1.ListInstanceTemplatesRequest = (function() { + + /** + * Properties of a ListInstanceTemplatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInstanceTemplatesRequest + * @property {string|null} [filter] ListInstanceTemplatesRequest filter + * @property {number|null} [maxResults] ListInstanceTemplatesRequest maxResults + * @property {string|null} [orderBy] ListInstanceTemplatesRequest orderBy + * @property {string|null} [pageToken] ListInstanceTemplatesRequest pageToken + * @property {string|null} [project] ListInstanceTemplatesRequest project + * @property {boolean|null} [returnPartialSuccess] ListInstanceTemplatesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListInstanceTemplatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInstanceTemplatesRequest. + * @implements IListInstanceTemplatesRequest + * @constructor + * @param {google.cloud.compute.v1.IListInstanceTemplatesRequest=} [properties] Properties to set + */ + function ListInstanceTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstanceTemplatesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + ListInstanceTemplatesRequest.prototype.filter = null; + + /** + * ListInstanceTemplatesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + ListInstanceTemplatesRequest.prototype.maxResults = null; + + /** + * ListInstanceTemplatesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + ListInstanceTemplatesRequest.prototype.orderBy = null; + + /** + * ListInstanceTemplatesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + ListInstanceTemplatesRequest.prototype.pageToken = null; + + /** + * ListInstanceTemplatesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + ListInstanceTemplatesRequest.prototype.project = ""; + + /** + * ListInstanceTemplatesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + ListInstanceTemplatesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInstanceTemplatesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + Object.defineProperty(ListInstanceTemplatesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceTemplatesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + Object.defineProperty(ListInstanceTemplatesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceTemplatesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + Object.defineProperty(ListInstanceTemplatesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceTemplatesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + Object.defineProperty(ListInstanceTemplatesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstanceTemplatesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + */ + Object.defineProperty(ListInstanceTemplatesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInstanceTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceTemplatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInstanceTemplatesRequest} ListInstanceTemplatesRequest instance + */ + ListInstanceTemplatesRequest.create = function create(properties) { + return new ListInstanceTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListInstanceTemplatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstanceTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceTemplatesRequest} message ListInstanceTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInstanceTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstanceTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IListInstanceTemplatesRequest} message ListInstanceTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstanceTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstanceTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInstanceTemplatesRequest} ListInstanceTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceTemplatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInstanceTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstanceTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInstanceTemplatesRequest} ListInstanceTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstanceTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstanceTemplatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstanceTemplatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListInstanceTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInstanceTemplatesRequest} ListInstanceTemplatesRequest + */ + ListInstanceTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInstanceTemplatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInstanceTemplatesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListInstanceTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @static + * @param {google.cloud.compute.v1.ListInstanceTemplatesRequest} message ListInstanceTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstanceTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInstanceTemplatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInstanceTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstanceTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstanceTemplatesRequest; + })(); + + v1.SetIamPolicyInstanceTemplateRequest = (function() { + + /** + * Properties of a SetIamPolicyInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyInstanceTemplateRequest + * @property {google.cloud.compute.v1.IGlobalSetPolicyRequest|null} [globalSetPolicyRequestResource] SetIamPolicyInstanceTemplateRequest globalSetPolicyRequestResource + * @property {string|null} [project] SetIamPolicyInstanceTemplateRequest project + * @property {string|null} [resource] SetIamPolicyInstanceTemplateRequest resource + */ + + /** + * Constructs a new SetIamPolicyInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyInstanceTemplateRequest. + * @implements ISetIamPolicyInstanceTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest=} [properties] Properties to set + */ + function SetIamPolicyInstanceTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyInstanceTemplateRequest globalSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetPolicyRequest|null|undefined} globalSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @instance + */ + SetIamPolicyInstanceTemplateRequest.prototype.globalSetPolicyRequestResource = null; + + /** + * SetIamPolicyInstanceTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @instance + */ + SetIamPolicyInstanceTemplateRequest.prototype.project = ""; + + /** + * SetIamPolicyInstanceTemplateRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @instance + */ + SetIamPolicyInstanceTemplateRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicyInstanceTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest} SetIamPolicyInstanceTemplateRequest instance + */ + SetIamPolicyInstanceTemplateRequest.create = function create(properties) { + return new SetIamPolicyInstanceTemplateRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest} message SetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyInstanceTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "globalSetPolicyRequestResource")) + $root.google.cloud.compute.v1.GlobalSetPolicyRequest.encode(message.globalSetPolicyRequestResource, writer.uint32(/* id 337048498, wireType 2 =*/2696387986).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest} message SetIamPolicyInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyInstanceTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyInstanceTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest} SetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyInstanceTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 337048498: + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest} SetIamPolicyInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyInstanceTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyInstanceTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyInstanceTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.verify(message.globalSetPolicyRequestResource); + if (error) + return "globalSetPolicyRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicyInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest} SetIamPolicyInstanceTemplateRequest + */ + SetIamPolicyInstanceTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest(); + if (object.globalSetPolicyRequestResource != null) { + if (typeof object.globalSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest.globalSetPolicyRequestResource: object expected"); + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.fromObject(object.globalSetPolicyRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyInstanceTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest} message SetIamPolicyInstanceTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyInstanceTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetPolicyRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) + object.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.toObject(message.globalSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyInstanceTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyInstanceTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyInstanceTemplateRequest; + })(); + + v1.TestIamPermissionsInstanceTemplateRequest = (function() { + + /** + * Properties of a TestIamPermissionsInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsInstanceTemplateRequest + * @property {string|null} [project] TestIamPermissionsInstanceTemplateRequest project + * @property {string|null} [resource] TestIamPermissionsInstanceTemplateRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsInstanceTemplateRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsInstanceTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsInstanceTemplateRequest. + * @implements ITestIamPermissionsInstanceTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest=} [properties] Properties to set + */ + function TestIamPermissionsInstanceTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsInstanceTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @instance + */ + TestIamPermissionsInstanceTemplateRequest.prototype.project = ""; + + /** + * TestIamPermissionsInstanceTemplateRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @instance + */ + TestIamPermissionsInstanceTemplateRequest.prototype.resource = ""; + + /** + * TestIamPermissionsInstanceTemplateRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @instance + */ + TestIamPermissionsInstanceTemplateRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsInstanceTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest} TestIamPermissionsInstanceTemplateRequest instance + */ + TestIamPermissionsInstanceTemplateRequest.create = function create(properties) { + return new TestIamPermissionsInstanceTemplateRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsInstanceTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest} message TestIamPermissionsInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsInstanceTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsInstanceTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest} message TestIamPermissionsInstanceTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsInstanceTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsInstanceTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest} TestIamPermissionsInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsInstanceTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsInstanceTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest} TestIamPermissionsInstanceTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsInstanceTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsInstanceTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsInstanceTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsInstanceTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest} TestIamPermissionsInstanceTemplateRequest + */ + TestIamPermissionsInstanceTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsInstanceTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest} message TestIamPermissionsInstanceTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsInstanceTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsInstanceTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsInstanceTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsInstanceTemplateRequest; + })(); + + v1.AddAccessConfigInstanceRequest = (function() { + + /** + * Properties of an AddAccessConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddAccessConfigInstanceRequest + * @property {google.cloud.compute.v1.IAccessConfig|null} [accessConfigResource] AddAccessConfigInstanceRequest accessConfigResource + * @property {string|null} [instance] AddAccessConfigInstanceRequest instance + * @property {string|null} [networkInterface] AddAccessConfigInstanceRequest networkInterface + * @property {string|null} [project] AddAccessConfigInstanceRequest project + * @property {string|null} [requestId] AddAccessConfigInstanceRequest requestId + * @property {string|null} [zone] AddAccessConfigInstanceRequest zone + */ + + /** + * Constructs a new AddAccessConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddAccessConfigInstanceRequest. + * @implements IAddAccessConfigInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IAddAccessConfigInstanceRequest=} [properties] Properties to set + */ + function AddAccessConfigInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddAccessConfigInstanceRequest accessConfigResource. + * @member {google.cloud.compute.v1.IAccessConfig|null|undefined} accessConfigResource + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + */ + AddAccessConfigInstanceRequest.prototype.accessConfigResource = null; + + /** + * AddAccessConfigInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + */ + AddAccessConfigInstanceRequest.prototype.instance = ""; + + /** + * AddAccessConfigInstanceRequest networkInterface. + * @member {string} networkInterface + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + */ + AddAccessConfigInstanceRequest.prototype.networkInterface = ""; + + /** + * AddAccessConfigInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + */ + AddAccessConfigInstanceRequest.prototype.project = ""; + + /** + * AddAccessConfigInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + */ + AddAccessConfigInstanceRequest.prototype.requestId = null; + + /** + * AddAccessConfigInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + */ + AddAccessConfigInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddAccessConfigInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + */ + Object.defineProperty(AddAccessConfigInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddAccessConfigInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAddAccessConfigInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddAccessConfigInstanceRequest} AddAccessConfigInstanceRequest instance + */ + AddAccessConfigInstanceRequest.create = function create(properties) { + return new AddAccessConfigInstanceRequest(properties); + }; + + /** + * Encodes the specified AddAccessConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.AddAccessConfigInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAddAccessConfigInstanceRequest} message AddAccessConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddAccessConfigInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkInterface != null && Object.hasOwnProperty.call(message, "networkInterface")) + writer.uint32(/* id 365387880, wireType 2 =*/2923103042).string(message.networkInterface); + if (message.accessConfigResource != null && Object.hasOwnProperty.call(message, "accessConfigResource")) + $root.google.cloud.compute.v1.AccessConfig.encode(message.accessConfigResource, writer.uint32(/* id 387825552, wireType 2 =*/3102604418).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddAccessConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddAccessConfigInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAddAccessConfigInstanceRequest} message AddAccessConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddAccessConfigInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddAccessConfigInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddAccessConfigInstanceRequest} AddAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddAccessConfigInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddAccessConfigInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 387825552: + message.accessConfigResource = $root.google.cloud.compute.v1.AccessConfig.decode(reader, reader.uint32()); + break; + case 18257045: + message.instance = reader.string(); + break; + case 365387880: + message.networkInterface = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddAccessConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddAccessConfigInstanceRequest} AddAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddAccessConfigInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddAccessConfigInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddAccessConfigInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessConfigResource != null && message.hasOwnProperty("accessConfigResource")) { + var error = $root.google.cloud.compute.v1.AccessConfig.verify(message.accessConfigResource); + if (error) + return "accessConfigResource." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + if (!$util.isString(message.networkInterface)) + return "networkInterface: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AddAccessConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddAccessConfigInstanceRequest} AddAccessConfigInstanceRequest + */ + AddAccessConfigInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddAccessConfigInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddAccessConfigInstanceRequest(); + if (object.accessConfigResource != null) { + if (typeof object.accessConfigResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddAccessConfigInstanceRequest.accessConfigResource: object expected"); + message.accessConfigResource = $root.google.cloud.compute.v1.AccessConfig.fromObject(object.accessConfigResource); + } + if (object.instance != null) + message.instance = String(object.instance); + if (object.networkInterface != null) + message.networkInterface = String(object.networkInterface); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AddAccessConfigInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.AddAccessConfigInstanceRequest} message AddAccessConfigInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddAccessConfigInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.networkInterface = ""; + object.accessConfigResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + object.networkInterface = message.networkInterface; + if (message.accessConfigResource != null && message.hasOwnProperty("accessConfigResource")) + object.accessConfigResource = $root.google.cloud.compute.v1.AccessConfig.toObject(message.accessConfigResource, options); + return object; + }; + + /** + * Converts this AddAccessConfigInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddAccessConfigInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + AddAccessConfigInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddAccessConfigInstanceRequest; + })(); + + v1.AddResourcePoliciesInstanceRequest = (function() { + + /** + * Properties of an AddResourcePoliciesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddResourcePoliciesInstanceRequest + * @property {string|null} [instance] AddResourcePoliciesInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest|null} [instancesAddResourcePoliciesRequestResource] AddResourcePoliciesInstanceRequest instancesAddResourcePoliciesRequestResource + * @property {string|null} [project] AddResourcePoliciesInstanceRequest project + * @property {string|null} [requestId] AddResourcePoliciesInstanceRequest requestId + * @property {string|null} [zone] AddResourcePoliciesInstanceRequest zone + */ + + /** + * Constructs a new AddResourcePoliciesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddResourcePoliciesInstanceRequest. + * @implements IAddResourcePoliciesInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest=} [properties] Properties to set + */ + function AddResourcePoliciesInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddResourcePoliciesInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @instance + */ + AddResourcePoliciesInstanceRequest.prototype.instance = ""; + + /** + * AddResourcePoliciesInstanceRequest instancesAddResourcePoliciesRequestResource. + * @member {google.cloud.compute.v1.IInstancesAddResourcePoliciesRequest|null|undefined} instancesAddResourcePoliciesRequestResource + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @instance + */ + AddResourcePoliciesInstanceRequest.prototype.instancesAddResourcePoliciesRequestResource = null; + + /** + * AddResourcePoliciesInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @instance + */ + AddResourcePoliciesInstanceRequest.prototype.project = ""; + + /** + * AddResourcePoliciesInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @instance + */ + AddResourcePoliciesInstanceRequest.prototype.requestId = null; + + /** + * AddResourcePoliciesInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @instance + */ + AddResourcePoliciesInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddResourcePoliciesInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @instance + */ + Object.defineProperty(AddResourcePoliciesInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddResourcePoliciesInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddResourcePoliciesInstanceRequest} AddResourcePoliciesInstanceRequest instance + */ + AddResourcePoliciesInstanceRequest.create = function create(properties) { + return new AddResourcePoliciesInstanceRequest(properties); + }; + + /** + * Encodes the specified AddResourcePoliciesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest} message AddResourcePoliciesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddResourcePoliciesInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instancesAddResourcePoliciesRequestResource != null && Object.hasOwnProperty.call(message, "instancesAddResourcePoliciesRequestResource")) + $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.encode(message.instancesAddResourcePoliciesRequestResource, writer.uint32(/* id 489351963, wireType 2 =*/3914815706).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddResourcePoliciesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest} message AddResourcePoliciesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddResourcePoliciesInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddResourcePoliciesInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddResourcePoliciesInstanceRequest} AddResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddResourcePoliciesInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddResourcePoliciesInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 489351963: + message.instancesAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddResourcePoliciesInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddResourcePoliciesInstanceRequest} AddResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddResourcePoliciesInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddResourcePoliciesInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddResourcePoliciesInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesAddResourcePoliciesRequestResource != null && message.hasOwnProperty("instancesAddResourcePoliciesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.verify(message.instancesAddResourcePoliciesRequestResource); + if (error) + return "instancesAddResourcePoliciesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AddResourcePoliciesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddResourcePoliciesInstanceRequest} AddResourcePoliciesInstanceRequest + */ + AddResourcePoliciesInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddResourcePoliciesInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddResourcePoliciesInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesAddResourcePoliciesRequestResource != null) { + if (typeof object.instancesAddResourcePoliciesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddResourcePoliciesInstanceRequest.instancesAddResourcePoliciesRequestResource: object expected"); + message.instancesAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.fromObject(object.instancesAddResourcePoliciesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AddResourcePoliciesInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.AddResourcePoliciesInstanceRequest} message AddResourcePoliciesInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddResourcePoliciesInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.instancesAddResourcePoliciesRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instancesAddResourcePoliciesRequestResource != null && message.hasOwnProperty("instancesAddResourcePoliciesRequestResource")) + object.instancesAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.InstancesAddResourcePoliciesRequest.toObject(message.instancesAddResourcePoliciesRequestResource, options); + return object; + }; + + /** + * Converts this AddResourcePoliciesInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddResourcePoliciesInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + AddResourcePoliciesInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddResourcePoliciesInstanceRequest; + })(); + + v1.AggregatedListInstancesRequest = (function() { + + /** + * Properties of an AggregatedListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListInstancesRequest + * @property {string|null} [filter] AggregatedListInstancesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListInstancesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListInstancesRequest maxResults + * @property {string|null} [orderBy] AggregatedListInstancesRequest orderBy + * @property {string|null} [pageToken] AggregatedListInstancesRequest pageToken + * @property {string|null} [project] AggregatedListInstancesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListInstancesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListInstancesRequest. + * @implements IAggregatedListInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListInstancesRequest=} [properties] Properties to set + */ + function AggregatedListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListInstancesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + AggregatedListInstancesRequest.prototype.filter = null; + + /** + * AggregatedListInstancesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + AggregatedListInstancesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListInstancesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + AggregatedListInstancesRequest.prototype.maxResults = null; + + /** + * AggregatedListInstancesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + AggregatedListInstancesRequest.prototype.orderBy = null; + + /** + * AggregatedListInstancesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + AggregatedListInstancesRequest.prototype.pageToken = null; + + /** + * AggregatedListInstancesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + AggregatedListInstancesRequest.prototype.project = ""; + + /** + * AggregatedListInstancesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + AggregatedListInstancesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListInstancesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListInstancesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstancesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListInstancesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstancesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListInstancesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstancesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListInstancesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstancesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListInstancesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInstancesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListInstancesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListInstancesRequest} AggregatedListInstancesRequest instance + */ + AggregatedListInstancesRequest.create = function create(properties) { + return new AggregatedListInstancesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstancesRequest} message AggregatedListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInstancesRequest} message AggregatedListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListInstancesRequest} AggregatedListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListInstancesRequest} AggregatedListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListInstancesRequest} AggregatedListInstancesRequest + */ + AggregatedListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListInstancesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListInstancesRequest} message AggregatedListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListInstancesRequest; + })(); + + v1.AttachDiskInstanceRequest = (function() { + + /** + * Properties of an AttachDiskInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IAttachDiskInstanceRequest + * @property {google.cloud.compute.v1.IAttachedDisk|null} [attachedDiskResource] AttachDiskInstanceRequest attachedDiskResource + * @property {boolean|null} [forceAttach] AttachDiskInstanceRequest forceAttach + * @property {string|null} [instance] AttachDiskInstanceRequest instance + * @property {string|null} [project] AttachDiskInstanceRequest project + * @property {string|null} [requestId] AttachDiskInstanceRequest requestId + * @property {string|null} [zone] AttachDiskInstanceRequest zone + */ + + /** + * Constructs a new AttachDiskInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AttachDiskInstanceRequest. + * @implements IAttachDiskInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IAttachDiskInstanceRequest=} [properties] Properties to set + */ + function AttachDiskInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachDiskInstanceRequest attachedDiskResource. + * @member {google.cloud.compute.v1.IAttachedDisk|null|undefined} attachedDiskResource + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + AttachDiskInstanceRequest.prototype.attachedDiskResource = null; + + /** + * AttachDiskInstanceRequest forceAttach. + * @member {boolean|null|undefined} forceAttach + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + AttachDiskInstanceRequest.prototype.forceAttach = null; + + /** + * AttachDiskInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + AttachDiskInstanceRequest.prototype.instance = ""; + + /** + * AttachDiskInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + AttachDiskInstanceRequest.prototype.project = ""; + + /** + * AttachDiskInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + AttachDiskInstanceRequest.prototype.requestId = null; + + /** + * AttachDiskInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + AttachDiskInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachDiskInstanceRequest _forceAttach. + * @member {"forceAttach"|undefined} _forceAttach + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + Object.defineProperty(AttachDiskInstanceRequest.prototype, "_forceAttach", { + get: $util.oneOfGetter($oneOfFields = ["forceAttach"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachDiskInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + */ + Object.defineProperty(AttachDiskInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachDiskInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAttachDiskInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AttachDiskInstanceRequest} AttachDiskInstanceRequest instance + */ + AttachDiskInstanceRequest.create = function create(properties) { + return new AttachDiskInstanceRequest(properties); + }; + + /** + * Encodes the specified AttachDiskInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.AttachDiskInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAttachDiskInstanceRequest} message AttachDiskInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachDiskInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.attachedDiskResource != null && Object.hasOwnProperty.call(message, "attachedDiskResource")) + $root.google.cloud.compute.v1.AttachedDisk.encode(message.attachedDiskResource, writer.uint32(/* id 90605845, wireType 2 =*/724846762).fork()).ldelim(); + if (message.forceAttach != null && Object.hasOwnProperty.call(message, "forceAttach")) + writer.uint32(/* id 142758425, wireType 0 =*/1142067400).bool(message.forceAttach); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified AttachDiskInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachDiskInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.IAttachDiskInstanceRequest} message AttachDiskInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachDiskInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachDiskInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AttachDiskInstanceRequest} AttachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachDiskInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AttachDiskInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 90605845: + message.attachedDiskResource = $root.google.cloud.compute.v1.AttachedDisk.decode(reader, reader.uint32()); + break; + case 142758425: + message.forceAttach = reader.bool(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachDiskInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AttachDiskInstanceRequest} AttachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachDiskInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachDiskInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachDiskInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.attachedDiskResource != null && message.hasOwnProperty("attachedDiskResource")) { + var error = $root.google.cloud.compute.v1.AttachedDisk.verify(message.attachedDiskResource); + if (error) + return "attachedDiskResource." + error; + } + if (message.forceAttach != null && message.hasOwnProperty("forceAttach")) { + properties._forceAttach = 1; + if (typeof message.forceAttach !== "boolean") + return "forceAttach: boolean expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AttachDiskInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AttachDiskInstanceRequest} AttachDiskInstanceRequest + */ + AttachDiskInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AttachDiskInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.AttachDiskInstanceRequest(); + if (object.attachedDiskResource != null) { + if (typeof object.attachedDiskResource !== "object") + throw TypeError(".google.cloud.compute.v1.AttachDiskInstanceRequest.attachedDiskResource: object expected"); + message.attachedDiskResource = $root.google.cloud.compute.v1.AttachedDisk.fromObject(object.attachedDiskResource); + } + if (object.forceAttach != null) + message.forceAttach = Boolean(object.forceAttach); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AttachDiskInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.AttachDiskInstanceRequest} message AttachDiskInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachDiskInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.attachedDiskResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.attachedDiskResource != null && message.hasOwnProperty("attachedDiskResource")) + object.attachedDiskResource = $root.google.cloud.compute.v1.AttachedDisk.toObject(message.attachedDiskResource, options); + if (message.forceAttach != null && message.hasOwnProperty("forceAttach")) { + object.forceAttach = message.forceAttach; + if (options.oneofs) + object._forceAttach = "forceAttach"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this AttachDiskInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AttachDiskInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + AttachDiskInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttachDiskInstanceRequest; + })(); + + v1.BulkInsertInstanceRequest = (function() { + + /** + * Properties of a BulkInsertInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IBulkInsertInstanceRequest + * @property {google.cloud.compute.v1.IBulkInsertInstanceResource|null} [bulkInsertInstanceResourceResource] BulkInsertInstanceRequest bulkInsertInstanceResourceResource + * @property {string|null} [project] BulkInsertInstanceRequest project + * @property {string|null} [requestId] BulkInsertInstanceRequest requestId + * @property {string|null} [zone] BulkInsertInstanceRequest zone + */ + + /** + * Constructs a new BulkInsertInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BulkInsertInstanceRequest. + * @implements IBulkInsertInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IBulkInsertInstanceRequest=} [properties] Properties to set + */ + function BulkInsertInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BulkInsertInstanceRequest bulkInsertInstanceResourceResource. + * @member {google.cloud.compute.v1.IBulkInsertInstanceResource|null|undefined} bulkInsertInstanceResourceResource + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @instance + */ + BulkInsertInstanceRequest.prototype.bulkInsertInstanceResourceResource = null; + + /** + * BulkInsertInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @instance + */ + BulkInsertInstanceRequest.prototype.project = ""; + + /** + * BulkInsertInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @instance + */ + BulkInsertInstanceRequest.prototype.requestId = null; + + /** + * BulkInsertInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @instance + */ + BulkInsertInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BulkInsertInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @instance + */ + Object.defineProperty(BulkInsertInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BulkInsertInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BulkInsertInstanceRequest} BulkInsertInstanceRequest instance + */ + BulkInsertInstanceRequest.create = function create(properties) { + return new BulkInsertInstanceRequest(properties); + }; + + /** + * Encodes the specified BulkInsertInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceRequest} message BulkInsertInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.bulkInsertInstanceResourceResource != null && Object.hasOwnProperty.call(message, "bulkInsertInstanceResourceResource")) + $root.google.cloud.compute.v1.BulkInsertInstanceResource.encode(message.bulkInsertInstanceResourceResource, writer.uint32(/* id 41427278, wireType 2 =*/331418226).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified BulkInsertInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.IBulkInsertInstanceRequest} message BulkInsertInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkInsertInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BulkInsertInstanceRequest} BulkInsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BulkInsertInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 41427278: + message.bulkInsertInstanceResourceResource = $root.google.cloud.compute.v1.BulkInsertInstanceResource.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkInsertInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BulkInsertInstanceRequest} BulkInsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkInsertInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkInsertInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bulkInsertInstanceResourceResource != null && message.hasOwnProperty("bulkInsertInstanceResourceResource")) { + var error = $root.google.cloud.compute.v1.BulkInsertInstanceResource.verify(message.bulkInsertInstanceResourceResource); + if (error) + return "bulkInsertInstanceResourceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a BulkInsertInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BulkInsertInstanceRequest} BulkInsertInstanceRequest + */ + BulkInsertInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BulkInsertInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.BulkInsertInstanceRequest(); + if (object.bulkInsertInstanceResourceResource != null) { + if (typeof object.bulkInsertInstanceResourceResource !== "object") + throw TypeError(".google.cloud.compute.v1.BulkInsertInstanceRequest.bulkInsertInstanceResourceResource: object expected"); + message.bulkInsertInstanceResourceResource = $root.google.cloud.compute.v1.BulkInsertInstanceResource.fromObject(object.bulkInsertInstanceResourceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a BulkInsertInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.BulkInsertInstanceRequest} message BulkInsertInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkInsertInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.bulkInsertInstanceResourceResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.bulkInsertInstanceResourceResource != null && message.hasOwnProperty("bulkInsertInstanceResourceResource")) + object.bulkInsertInstanceResourceResource = $root.google.cloud.compute.v1.BulkInsertInstanceResource.toObject(message.bulkInsertInstanceResourceResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this BulkInsertInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BulkInsertInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + BulkInsertInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BulkInsertInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [instance] DeleteInstanceRequest instance + * @property {string|null} [project] DeleteInstanceRequest project + * @property {string|null} [requestId] DeleteInstanceRequest requestId + * @property {string|null} [zone] DeleteInstanceRequest zone + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.compute.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 instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.instance = ""; + + /** + * DeleteInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.project = ""; + + /** + * DeleteInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.requestId = null; + + /** + * DeleteInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @instance + */ + Object.defineProperty(DeleteInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = 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.compute.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceRequest; + })(); + + v1.DeleteAccessConfigInstanceRequest = (function() { + + /** + * Properties of a DeleteAccessConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteAccessConfigInstanceRequest + * @property {string|null} [accessConfig] DeleteAccessConfigInstanceRequest accessConfig + * @property {string|null} [instance] DeleteAccessConfigInstanceRequest instance + * @property {string|null} [networkInterface] DeleteAccessConfigInstanceRequest networkInterface + * @property {string|null} [project] DeleteAccessConfigInstanceRequest project + * @property {string|null} [requestId] DeleteAccessConfigInstanceRequest requestId + * @property {string|null} [zone] DeleteAccessConfigInstanceRequest zone + */ + + /** + * Constructs a new DeleteAccessConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteAccessConfigInstanceRequest. + * @implements IDeleteAccessConfigInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest=} [properties] Properties to set + */ + function DeleteAccessConfigInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAccessConfigInstanceRequest accessConfig. + * @member {string} accessConfig + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + */ + DeleteAccessConfigInstanceRequest.prototype.accessConfig = ""; + + /** + * DeleteAccessConfigInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + */ + DeleteAccessConfigInstanceRequest.prototype.instance = ""; + + /** + * DeleteAccessConfigInstanceRequest networkInterface. + * @member {string} networkInterface + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + */ + DeleteAccessConfigInstanceRequest.prototype.networkInterface = ""; + + /** + * DeleteAccessConfigInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + */ + DeleteAccessConfigInstanceRequest.prototype.project = ""; + + /** + * DeleteAccessConfigInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + */ + DeleteAccessConfigInstanceRequest.prototype.requestId = null; + + /** + * DeleteAccessConfigInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + */ + DeleteAccessConfigInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteAccessConfigInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + */ + Object.defineProperty(DeleteAccessConfigInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteAccessConfigInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteAccessConfigInstanceRequest} DeleteAccessConfigInstanceRequest instance + */ + DeleteAccessConfigInstanceRequest.create = function create(properties) { + return new DeleteAccessConfigInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteAccessConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteAccessConfigInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest} message DeleteAccessConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAccessConfigInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.accessConfig != null && Object.hasOwnProperty.call(message, "accessConfig")) + writer.uint32(/* id 72856189, wireType 2 =*/582849514).string(message.accessConfig); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkInterface != null && Object.hasOwnProperty.call(message, "networkInterface")) + writer.uint32(/* id 365387880, wireType 2 =*/2923103042).string(message.networkInterface); + return writer; + }; + + /** + * Encodes the specified DeleteAccessConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteAccessConfigInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest} message DeleteAccessConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAccessConfigInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAccessConfigInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteAccessConfigInstanceRequest} DeleteAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAccessConfigInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteAccessConfigInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 72856189: + message.accessConfig = reader.string(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 365387880: + message.networkInterface = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAccessConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteAccessConfigInstanceRequest} DeleteAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAccessConfigInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAccessConfigInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAccessConfigInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessConfig != null && message.hasOwnProperty("accessConfig")) + if (!$util.isString(message.accessConfig)) + return "accessConfig: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + if (!$util.isString(message.networkInterface)) + return "networkInterface: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteAccessConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteAccessConfigInstanceRequest} DeleteAccessConfigInstanceRequest + */ + DeleteAccessConfigInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteAccessConfigInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteAccessConfigInstanceRequest(); + if (object.accessConfig != null) + message.accessConfig = String(object.accessConfig); + if (object.instance != null) + message.instance = String(object.instance); + if (object.networkInterface != null) + message.networkInterface = String(object.networkInterface); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteAccessConfigInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.DeleteAccessConfigInstanceRequest} message DeleteAccessConfigInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAccessConfigInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.accessConfig = ""; + object.project = ""; + object.networkInterface = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.accessConfig != null && message.hasOwnProperty("accessConfig")) + object.accessConfig = message.accessConfig; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + object.networkInterface = message.networkInterface; + return object; + }; + + /** + * Converts this DeleteAccessConfigInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteAccessConfigInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAccessConfigInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteAccessConfigInstanceRequest; + })(); + + v1.DetachDiskInstanceRequest = (function() { + + /** + * Properties of a DetachDiskInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDetachDiskInstanceRequest + * @property {string|null} [deviceName] DetachDiskInstanceRequest deviceName + * @property {string|null} [instance] DetachDiskInstanceRequest instance + * @property {string|null} [project] DetachDiskInstanceRequest project + * @property {string|null} [requestId] DetachDiskInstanceRequest requestId + * @property {string|null} [zone] DetachDiskInstanceRequest zone + */ + + /** + * Constructs a new DetachDiskInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DetachDiskInstanceRequest. + * @implements IDetachDiskInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IDetachDiskInstanceRequest=} [properties] Properties to set + */ + function DetachDiskInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetachDiskInstanceRequest deviceName. + * @member {string} deviceName + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @instance + */ + DetachDiskInstanceRequest.prototype.deviceName = ""; + + /** + * DetachDiskInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @instance + */ + DetachDiskInstanceRequest.prototype.instance = ""; + + /** + * DetachDiskInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @instance + */ + DetachDiskInstanceRequest.prototype.project = ""; + + /** + * DetachDiskInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @instance + */ + DetachDiskInstanceRequest.prototype.requestId = null; + + /** + * DetachDiskInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @instance + */ + DetachDiskInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DetachDiskInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @instance + */ + Object.defineProperty(DetachDiskInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DetachDiskInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDetachDiskInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DetachDiskInstanceRequest} DetachDiskInstanceRequest instance + */ + DetachDiskInstanceRequest.create = function create(properties) { + return new DetachDiskInstanceRequest(properties); + }; + + /** + * Encodes the specified DetachDiskInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.DetachDiskInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDetachDiskInstanceRequest} message DetachDiskInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachDiskInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 67541716, wireType 2 =*/540333730).string(message.deviceName); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DetachDiskInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DetachDiskInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDetachDiskInstanceRequest} message DetachDiskInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachDiskInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetachDiskInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DetachDiskInstanceRequest} DetachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachDiskInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DetachDiskInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 67541716: + message.deviceName = reader.string(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetachDiskInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DetachDiskInstanceRequest} DetachDiskInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachDiskInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetachDiskInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetachDiskInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DetachDiskInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DetachDiskInstanceRequest} DetachDiskInstanceRequest + */ + DetachDiskInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DetachDiskInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DetachDiskInstanceRequest(); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DetachDiskInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @static + * @param {google.cloud.compute.v1.DetachDiskInstanceRequest} message DetachDiskInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetachDiskInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.deviceName = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + object.deviceName = message.deviceName; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DetachDiskInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DetachDiskInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DetachDiskInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetachDiskInstanceRequest; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetInstanceRequest + * @property {string|null} [instance] GetInstanceRequest instance + * @property {string|null} [project] GetInstanceRequest project + * @property {string|null} [zone] GetInstanceRequest zone + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.compute.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 instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.instance = ""; + + /** + * GetInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.project = ""; + + /** + * GetInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.zone = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.GetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = 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.compute.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1.GetEffectiveFirewallsInstanceRequest = (function() { + + /** + * Properties of a GetEffectiveFirewallsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetEffectiveFirewallsInstanceRequest + * @property {string|null} [instance] GetEffectiveFirewallsInstanceRequest instance + * @property {string|null} [networkInterface] GetEffectiveFirewallsInstanceRequest networkInterface + * @property {string|null} [project] GetEffectiveFirewallsInstanceRequest project + * @property {string|null} [zone] GetEffectiveFirewallsInstanceRequest zone + */ + + /** + * Constructs a new GetEffectiveFirewallsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetEffectiveFirewallsInstanceRequest. + * @implements IGetEffectiveFirewallsInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest=} [properties] Properties to set + */ + function GetEffectiveFirewallsInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEffectiveFirewallsInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @instance + */ + GetEffectiveFirewallsInstanceRequest.prototype.instance = ""; + + /** + * GetEffectiveFirewallsInstanceRequest networkInterface. + * @member {string} networkInterface + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @instance + */ + GetEffectiveFirewallsInstanceRequest.prototype.networkInterface = ""; + + /** + * GetEffectiveFirewallsInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @instance + */ + GetEffectiveFirewallsInstanceRequest.prototype.project = ""; + + /** + * GetEffectiveFirewallsInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @instance + */ + GetEffectiveFirewallsInstanceRequest.prototype.zone = ""; + + /** + * Creates a new GetEffectiveFirewallsInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest} GetEffectiveFirewallsInstanceRequest instance + */ + GetEffectiveFirewallsInstanceRequest.create = function create(properties) { + return new GetEffectiveFirewallsInstanceRequest(properties); + }; + + /** + * Encodes the specified GetEffectiveFirewallsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest} message GetEffectiveFirewallsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveFirewallsInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkInterface != null && Object.hasOwnProperty.call(message, "networkInterface")) + writer.uint32(/* id 365387880, wireType 2 =*/2923103042).string(message.networkInterface); + return writer; + }; + + /** + * Encodes the specified GetEffectiveFirewallsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest} message GetEffectiveFirewallsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveFirewallsInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEffectiveFirewallsInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest} GetEffectiveFirewallsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveFirewallsInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 365387880: + message.networkInterface = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEffectiveFirewallsInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest} GetEffectiveFirewallsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveFirewallsInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEffectiveFirewallsInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEffectiveFirewallsInstanceRequest.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.networkInterface != null && message.hasOwnProperty("networkInterface")) + if (!$util.isString(message.networkInterface)) + return "networkInterface: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetEffectiveFirewallsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest} GetEffectiveFirewallsInstanceRequest + */ + GetEffectiveFirewallsInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.networkInterface != null) + message.networkInterface = String(object.networkInterface); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetEffectiveFirewallsInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @static + * @param {google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest} message GetEffectiveFirewallsInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEffectiveFirewallsInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.networkInterface = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + object.networkInterface = message.networkInterface; + return object; + }; + + /** + * Converts this GetEffectiveFirewallsInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetEffectiveFirewallsInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEffectiveFirewallsInstanceRequest; + })(); + + v1.GetGuestAttributesInstanceRequest = (function() { + + /** + * Properties of a GetGuestAttributesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetGuestAttributesInstanceRequest + * @property {string|null} [instance] GetGuestAttributesInstanceRequest instance + * @property {string|null} [project] GetGuestAttributesInstanceRequest project + * @property {string|null} [queryPath] GetGuestAttributesInstanceRequest queryPath + * @property {string|null} [variableKey] GetGuestAttributesInstanceRequest variableKey + * @property {string|null} [zone] GetGuestAttributesInstanceRequest zone + */ + + /** + * Constructs a new GetGuestAttributesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetGuestAttributesInstanceRequest. + * @implements IGetGuestAttributesInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetGuestAttributesInstanceRequest=} [properties] Properties to set + */ + function GetGuestAttributesInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGuestAttributesInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + */ + GetGuestAttributesInstanceRequest.prototype.instance = ""; + + /** + * GetGuestAttributesInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + */ + GetGuestAttributesInstanceRequest.prototype.project = ""; + + /** + * GetGuestAttributesInstanceRequest queryPath. + * @member {string|null|undefined} queryPath + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + */ + GetGuestAttributesInstanceRequest.prototype.queryPath = null; + + /** + * GetGuestAttributesInstanceRequest variableKey. + * @member {string|null|undefined} variableKey + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + */ + GetGuestAttributesInstanceRequest.prototype.variableKey = null; + + /** + * GetGuestAttributesInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + */ + GetGuestAttributesInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetGuestAttributesInstanceRequest _queryPath. + * @member {"queryPath"|undefined} _queryPath + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + */ + Object.defineProperty(GetGuestAttributesInstanceRequest.prototype, "_queryPath", { + get: $util.oneOfGetter($oneOfFields = ["queryPath"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetGuestAttributesInstanceRequest _variableKey. + * @member {"variableKey"|undefined} _variableKey + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + */ + Object.defineProperty(GetGuestAttributesInstanceRequest.prototype, "_variableKey", { + get: $util.oneOfGetter($oneOfFields = ["variableKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetGuestAttributesInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetGuestAttributesInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetGuestAttributesInstanceRequest} GetGuestAttributesInstanceRequest instance + */ + GetGuestAttributesInstanceRequest.create = function create(properties) { + return new GetGuestAttributesInstanceRequest(properties); + }; + + /** + * Encodes the specified GetGuestAttributesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetGuestAttributesInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetGuestAttributesInstanceRequest} message GetGuestAttributesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuestAttributesInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.variableKey != null && Object.hasOwnProperty.call(message, "variableKey")) + writer.uint32(/* id 164364828, wireType 2 =*/1314918626).string(message.variableKey); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.queryPath != null && Object.hasOwnProperty.call(message, "queryPath")) + writer.uint32(/* id 368591164, wireType 2 =*/2948729314).string(message.queryPath); + return writer; + }; + + /** + * Encodes the specified GetGuestAttributesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetGuestAttributesInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetGuestAttributesInstanceRequest} message GetGuestAttributesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGuestAttributesInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGuestAttributesInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetGuestAttributesInstanceRequest} GetGuestAttributesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuestAttributesInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetGuestAttributesInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 368591164: + message.queryPath = reader.string(); + break; + case 164364828: + message.variableKey = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGuestAttributesInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetGuestAttributesInstanceRequest} GetGuestAttributesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGuestAttributesInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGuestAttributesInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGuestAttributesInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.queryPath != null && message.hasOwnProperty("queryPath")) { + properties._queryPath = 1; + if (!$util.isString(message.queryPath)) + return "queryPath: string expected"; + } + if (message.variableKey != null && message.hasOwnProperty("variableKey")) { + properties._variableKey = 1; + if (!$util.isString(message.variableKey)) + return "variableKey: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetGuestAttributesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetGuestAttributesInstanceRequest} GetGuestAttributesInstanceRequest + */ + GetGuestAttributesInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetGuestAttributesInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetGuestAttributesInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.queryPath != null) + message.queryPath = String(object.queryPath); + if (object.variableKey != null) + message.variableKey = String(object.variableKey); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetGuestAttributesInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @static + * @param {google.cloud.compute.v1.GetGuestAttributesInstanceRequest} message GetGuestAttributesInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGuestAttributesInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.variableKey != null && message.hasOwnProperty("variableKey")) { + object.variableKey = message.variableKey; + if (options.oneofs) + object._variableKey = "variableKey"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.queryPath != null && message.hasOwnProperty("queryPath")) { + object.queryPath = message.queryPath; + if (options.oneofs) + object._queryPath = "queryPath"; + } + return object; + }; + + /** + * Converts this GetGuestAttributesInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetGuestAttributesInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetGuestAttributesInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetGuestAttributesInstanceRequest; + })(); + + v1.GetIamPolicyInstanceRequest = (function() { + + /** + * Properties of a GetIamPolicyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyInstanceRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyInstanceRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyInstanceRequest project + * @property {string|null} [resource] GetIamPolicyInstanceRequest resource + * @property {string|null} [zone] GetIamPolicyInstanceRequest zone + */ + + /** + * Constructs a new GetIamPolicyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyInstanceRequest. + * @implements IGetIamPolicyInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceRequest=} [properties] Properties to set + */ + function GetIamPolicyInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyInstanceRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @instance + */ + GetIamPolicyInstanceRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @instance + */ + GetIamPolicyInstanceRequest.prototype.project = ""; + + /** + * GetIamPolicyInstanceRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @instance + */ + GetIamPolicyInstanceRequest.prototype.resource = ""; + + /** + * GetIamPolicyInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @instance + */ + GetIamPolicyInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyInstanceRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @instance + */ + Object.defineProperty(GetIamPolicyInstanceRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceRequest} GetIamPolicyInstanceRequest instance + */ + GetIamPolicyInstanceRequest.create = function create(properties) { + return new GetIamPolicyInstanceRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceRequest} message GetIamPolicyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceRequest} message GetIamPolicyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceRequest} GetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceRequest} GetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyInstanceRequest} GetIamPolicyInstanceRequest + */ + GetIamPolicyInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyInstanceRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyInstanceRequest} message GetIamPolicyInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyInstanceRequest; + })(); + + v1.GetScreenshotInstanceRequest = (function() { + + /** + * Properties of a GetScreenshotInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetScreenshotInstanceRequest + * @property {string|null} [instance] GetScreenshotInstanceRequest instance + * @property {string|null} [project] GetScreenshotInstanceRequest project + * @property {string|null} [zone] GetScreenshotInstanceRequest zone + */ + + /** + * Constructs a new GetScreenshotInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetScreenshotInstanceRequest. + * @implements IGetScreenshotInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetScreenshotInstanceRequest=} [properties] Properties to set + */ + function GetScreenshotInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScreenshotInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @instance + */ + GetScreenshotInstanceRequest.prototype.instance = ""; + + /** + * GetScreenshotInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @instance + */ + GetScreenshotInstanceRequest.prototype.project = ""; + + /** + * GetScreenshotInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @instance + */ + GetScreenshotInstanceRequest.prototype.zone = ""; + + /** + * Creates a new GetScreenshotInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetScreenshotInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetScreenshotInstanceRequest} GetScreenshotInstanceRequest instance + */ + GetScreenshotInstanceRequest.create = function create(properties) { + return new GetScreenshotInstanceRequest(properties); + }; + + /** + * Encodes the specified GetScreenshotInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetScreenshotInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetScreenshotInstanceRequest} message GetScreenshotInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScreenshotInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetScreenshotInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetScreenshotInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetScreenshotInstanceRequest} message GetScreenshotInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScreenshotInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScreenshotInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetScreenshotInstanceRequest} GetScreenshotInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScreenshotInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetScreenshotInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetScreenshotInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetScreenshotInstanceRequest} GetScreenshotInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScreenshotInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScreenshotInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScreenshotInstanceRequest.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetScreenshotInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetScreenshotInstanceRequest} GetScreenshotInstanceRequest + */ + GetScreenshotInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetScreenshotInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetScreenshotInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetScreenshotInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @static + * @param {google.cloud.compute.v1.GetScreenshotInstanceRequest} message GetScreenshotInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScreenshotInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetScreenshotInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetScreenshotInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetScreenshotInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetScreenshotInstanceRequest; + })(); + + v1.GetSerialPortOutputInstanceRequest = (function() { + + /** + * Properties of a GetSerialPortOutputInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetSerialPortOutputInstanceRequest + * @property {string|null} [instance] GetSerialPortOutputInstanceRequest instance + * @property {number|null} [port] GetSerialPortOutputInstanceRequest port + * @property {string|null} [project] GetSerialPortOutputInstanceRequest project + * @property {number|Long|null} [start] GetSerialPortOutputInstanceRequest start + * @property {string|null} [zone] GetSerialPortOutputInstanceRequest zone + */ + + /** + * Constructs a new GetSerialPortOutputInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetSerialPortOutputInstanceRequest. + * @implements IGetSerialPortOutputInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest=} [properties] Properties to set + */ + function GetSerialPortOutputInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSerialPortOutputInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + */ + GetSerialPortOutputInstanceRequest.prototype.instance = ""; + + /** + * GetSerialPortOutputInstanceRequest port. + * @member {number|null|undefined} port + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + */ + GetSerialPortOutputInstanceRequest.prototype.port = null; + + /** + * GetSerialPortOutputInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + */ + GetSerialPortOutputInstanceRequest.prototype.project = ""; + + /** + * GetSerialPortOutputInstanceRequest start. + * @member {number|Long|null|undefined} start + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + */ + GetSerialPortOutputInstanceRequest.prototype.start = null; + + /** + * GetSerialPortOutputInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + */ + GetSerialPortOutputInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetSerialPortOutputInstanceRequest _port. + * @member {"port"|undefined} _port + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + */ + Object.defineProperty(GetSerialPortOutputInstanceRequest.prototype, "_port", { + get: $util.oneOfGetter($oneOfFields = ["port"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetSerialPortOutputInstanceRequest _start. + * @member {"start"|undefined} _start + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + */ + Object.defineProperty(GetSerialPortOutputInstanceRequest.prototype, "_start", { + get: $util.oneOfGetter($oneOfFields = ["start"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetSerialPortOutputInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetSerialPortOutputInstanceRequest} GetSerialPortOutputInstanceRequest instance + */ + GetSerialPortOutputInstanceRequest.create = function create(properties) { + return new GetSerialPortOutputInstanceRequest(properties); + }; + + /** + * Encodes the specified GetSerialPortOutputInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSerialPortOutputInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest} message GetSerialPortOutputInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSerialPortOutputInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 3446913, wireType 0 =*/27575304).int32(message.port); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 109757538, wireType 0 =*/878060304).int64(message.start); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetSerialPortOutputInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSerialPortOutputInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest} message GetSerialPortOutputInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSerialPortOutputInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSerialPortOutputInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetSerialPortOutputInstanceRequest} GetSerialPortOutputInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSerialPortOutputInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetSerialPortOutputInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 3446913: + message.port = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 109757538: + message.start = reader.int64(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSerialPortOutputInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetSerialPortOutputInstanceRequest} GetSerialPortOutputInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSerialPortOutputInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSerialPortOutputInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSerialPortOutputInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.port != null && message.hasOwnProperty("port")) { + properties._port = 1; + if (!$util.isInteger(message.port)) + return "port: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.start != null && message.hasOwnProperty("start")) { + properties._start = 1; + if (!$util.isInteger(message.start) && !(message.start && $util.isInteger(message.start.low) && $util.isInteger(message.start.high))) + return "start: integer|Long expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetSerialPortOutputInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetSerialPortOutputInstanceRequest} GetSerialPortOutputInstanceRequest + */ + GetSerialPortOutputInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetSerialPortOutputInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetSerialPortOutputInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.port != null) + message.port = object.port | 0; + if (object.project != null) + message.project = String(object.project); + if (object.start != null) + if ($util.Long) + (message.start = $util.Long.fromValue(object.start)).unsigned = false; + else if (typeof object.start === "string") + message.start = parseInt(object.start, 10); + else if (typeof object.start === "number") + message.start = object.start; + else if (typeof object.start === "object") + message.start = new $util.LongBits(object.start.low >>> 0, object.start.high >>> 0).toNumber(); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetSerialPortOutputInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @static + * @param {google.cloud.compute.v1.GetSerialPortOutputInstanceRequest} message GetSerialPortOutputInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSerialPortOutputInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.port != null && message.hasOwnProperty("port")) { + object.port = message.port; + if (options.oneofs) + object._port = "port"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.start != null && message.hasOwnProperty("start")) { + if (typeof message.start === "number") + object.start = options.longs === String ? String(message.start) : message.start; + else + object.start = options.longs === String ? $util.Long.prototype.toString.call(message.start) : options.longs === Number ? new $util.LongBits(message.start.low >>> 0, message.start.high >>> 0).toNumber() : message.start; + if (options.oneofs) + object._start = "start"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetSerialPortOutputInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetSerialPortOutputInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSerialPortOutputInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSerialPortOutputInstanceRequest; + })(); + + v1.GetShieldedInstanceIdentityInstanceRequest = (function() { + + /** + * Properties of a GetShieldedInstanceIdentityInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetShieldedInstanceIdentityInstanceRequest + * @property {string|null} [instance] GetShieldedInstanceIdentityInstanceRequest instance + * @property {string|null} [project] GetShieldedInstanceIdentityInstanceRequest project + * @property {string|null} [zone] GetShieldedInstanceIdentityInstanceRequest zone + */ + + /** + * Constructs a new GetShieldedInstanceIdentityInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetShieldedInstanceIdentityInstanceRequest. + * @implements IGetShieldedInstanceIdentityInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest=} [properties] Properties to set + */ + function GetShieldedInstanceIdentityInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetShieldedInstanceIdentityInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @instance + */ + GetShieldedInstanceIdentityInstanceRequest.prototype.instance = ""; + + /** + * GetShieldedInstanceIdentityInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @instance + */ + GetShieldedInstanceIdentityInstanceRequest.prototype.project = ""; + + /** + * GetShieldedInstanceIdentityInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @instance + */ + GetShieldedInstanceIdentityInstanceRequest.prototype.zone = ""; + + /** + * Creates a new GetShieldedInstanceIdentityInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest} GetShieldedInstanceIdentityInstanceRequest instance + */ + GetShieldedInstanceIdentityInstanceRequest.create = function create(properties) { + return new GetShieldedInstanceIdentityInstanceRequest(properties); + }; + + /** + * Encodes the specified GetShieldedInstanceIdentityInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest} message GetShieldedInstanceIdentityInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetShieldedInstanceIdentityInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetShieldedInstanceIdentityInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest} message GetShieldedInstanceIdentityInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetShieldedInstanceIdentityInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetShieldedInstanceIdentityInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest} GetShieldedInstanceIdentityInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetShieldedInstanceIdentityInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetShieldedInstanceIdentityInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest} GetShieldedInstanceIdentityInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetShieldedInstanceIdentityInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetShieldedInstanceIdentityInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetShieldedInstanceIdentityInstanceRequest.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetShieldedInstanceIdentityInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest} GetShieldedInstanceIdentityInstanceRequest + */ + GetShieldedInstanceIdentityInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetShieldedInstanceIdentityInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @static + * @param {google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest} message GetShieldedInstanceIdentityInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetShieldedInstanceIdentityInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetShieldedInstanceIdentityInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetShieldedInstanceIdentityInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetShieldedInstanceIdentityInstanceRequest; + })(); + + v1.InsertInstanceRequest = (function() { + + /** + * Properties of an InsertInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertInstanceRequest + * @property {google.cloud.compute.v1.IInstance|null} [instanceResource] InsertInstanceRequest instanceResource + * @property {string|null} [project] InsertInstanceRequest project + * @property {string|null} [requestId] InsertInstanceRequest requestId + * @property {string|null} [sourceInstanceTemplate] InsertInstanceRequest sourceInstanceTemplate + * @property {string|null} [zone] InsertInstanceRequest zone + */ + + /** + * Constructs a new InsertInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertInstanceRequest. + * @implements IInsertInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertInstanceRequest=} [properties] Properties to set + */ + function InsertInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertInstanceRequest instanceResource. + * @member {google.cloud.compute.v1.IInstance|null|undefined} instanceResource + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + */ + InsertInstanceRequest.prototype.instanceResource = null; + + /** + * InsertInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + */ + InsertInstanceRequest.prototype.project = ""; + + /** + * InsertInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + */ + InsertInstanceRequest.prototype.requestId = null; + + /** + * InsertInstanceRequest sourceInstanceTemplate. + * @member {string|null|undefined} sourceInstanceTemplate + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + */ + InsertInstanceRequest.prototype.sourceInstanceTemplate = null; + + /** + * InsertInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + */ + InsertInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + */ + Object.defineProperty(InsertInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InsertInstanceRequest _sourceInstanceTemplate. + * @member {"sourceInstanceTemplate"|undefined} _sourceInstanceTemplate + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + */ + Object.defineProperty(InsertInstanceRequest.prototype, "_sourceInstanceTemplate", { + get: $util.oneOfGetter($oneOfFields = ["sourceInstanceTemplate"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertInstanceRequest} InsertInstanceRequest instance + */ + InsertInstanceRequest.create = function create(properties) { + return new InsertInstanceRequest(properties); + }; + + /** + * Encodes the specified InsertInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceRequest} message InsertInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceResource != null && Object.hasOwnProperty.call(message, "instanceResource")) + $root.google.cloud.compute.v1.Instance.encode(message.instanceResource, writer.uint32(/* id 215988344, wireType 2 =*/1727906754).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.sourceInstanceTemplate != null && Object.hasOwnProperty.call(message, "sourceInstanceTemplate")) + writer.uint32(/* id 332423616, wireType 2 =*/2659388930).string(message.sourceInstanceTemplate); + return writer; + }; + + /** + * Encodes the specified InsertInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.IInsertInstanceRequest} message InsertInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertInstanceRequest} InsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 215988344: + message.instanceResource = $root.google.cloud.compute.v1.Instance.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 332423616: + message.sourceInstanceTemplate = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertInstanceRequest} InsertInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceResource != null && message.hasOwnProperty("instanceResource")) { + var error = $root.google.cloud.compute.v1.Instance.verify(message.instanceResource); + if (error) + return "instanceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sourceInstanceTemplate != null && message.hasOwnProperty("sourceInstanceTemplate")) { + properties._sourceInstanceTemplate = 1; + if (!$util.isString(message.sourceInstanceTemplate)) + return "sourceInstanceTemplate: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertInstanceRequest} InsertInstanceRequest + */ + InsertInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertInstanceRequest(); + if (object.instanceResource != null) { + if (typeof object.instanceResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertInstanceRequest.instanceResource: object expected"); + message.instanceResource = $root.google.cloud.compute.v1.Instance.fromObject(object.instanceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sourceInstanceTemplate != null) + message.sourceInstanceTemplate = String(object.sourceInstanceTemplate); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @static + * @param {google.cloud.compute.v1.InsertInstanceRequest} message InsertInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instanceResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceResource != null && message.hasOwnProperty("instanceResource")) + object.instanceResource = $root.google.cloud.compute.v1.Instance.toObject(message.instanceResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.sourceInstanceTemplate != null && message.hasOwnProperty("sourceInstanceTemplate")) { + object.sourceInstanceTemplate = message.sourceInstanceTemplate; + if (options.oneofs) + object._sourceInstanceTemplate = "sourceInstanceTemplate"; + } + return object; + }; + + /** + * Converts this InsertInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + InsertInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertInstanceRequest; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInstancesRequest + * @property {string|null} [filter] ListInstancesRequest filter + * @property {number|null} [maxResults] ListInstancesRequest maxResults + * @property {string|null} [orderBy] ListInstancesRequest orderBy + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [project] ListInstancesRequest project + * @property {boolean|null} [returnPartialSuccess] ListInstancesRequest returnPartialSuccess + * @property {string|null} [zone] ListInstancesRequest zone + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.compute.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 filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = null; + + /** + * ListInstancesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.maxResults = null; + + /** + * ListInstancesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = null; + + /** + * ListInstancesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = null; + + /** + * ListInstancesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.project = ""; + + /** + * ListInstancesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.returnPartialSuccess = null; + + /** + * ListInstancesRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInstancesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + Object.defineProperty(ListInstancesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + Object.defineProperty(ListInstancesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + Object.defineProperty(ListInstancesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + Object.defineProperty(ListInstancesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + */ + Object.defineProperty(ListInstancesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @static + * @param {google.cloud.compute.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.ListInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = 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.compute.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInstancesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesRequest; + })(); + + v1.ListReferrersInstancesRequest = (function() { + + /** + * Properties of a ListReferrersInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListReferrersInstancesRequest + * @property {string|null} [filter] ListReferrersInstancesRequest filter + * @property {string|null} [instance] ListReferrersInstancesRequest instance + * @property {number|null} [maxResults] ListReferrersInstancesRequest maxResults + * @property {string|null} [orderBy] ListReferrersInstancesRequest orderBy + * @property {string|null} [pageToken] ListReferrersInstancesRequest pageToken + * @property {string|null} [project] ListReferrersInstancesRequest project + * @property {boolean|null} [returnPartialSuccess] ListReferrersInstancesRequest returnPartialSuccess + * @property {string|null} [zone] ListReferrersInstancesRequest zone + */ + + /** + * Constructs a new ListReferrersInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListReferrersInstancesRequest. + * @implements IListReferrersInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IListReferrersInstancesRequest=} [properties] Properties to set + */ + function ListReferrersInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListReferrersInstancesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.filter = null; + + /** + * ListReferrersInstancesRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.instance = ""; + + /** + * ListReferrersInstancesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.maxResults = null; + + /** + * ListReferrersInstancesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.orderBy = null; + + /** + * ListReferrersInstancesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.pageToken = null; + + /** + * ListReferrersInstancesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.project = ""; + + /** + * ListReferrersInstancesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.returnPartialSuccess = null; + + /** + * ListReferrersInstancesRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + ListReferrersInstancesRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListReferrersInstancesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + Object.defineProperty(ListReferrersInstancesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReferrersInstancesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + Object.defineProperty(ListReferrersInstancesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReferrersInstancesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + Object.defineProperty(ListReferrersInstancesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReferrersInstancesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + Object.defineProperty(ListReferrersInstancesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReferrersInstancesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + */ + Object.defineProperty(ListReferrersInstancesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListReferrersInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {google.cloud.compute.v1.IListReferrersInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListReferrersInstancesRequest} ListReferrersInstancesRequest instance + */ + ListReferrersInstancesRequest.create = function create(properties) { + return new ListReferrersInstancesRequest(properties); + }; + + /** + * Encodes the specified ListReferrersInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListReferrersInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {google.cloud.compute.v1.IListReferrersInstancesRequest} message ListReferrersInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferrersInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListReferrersInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListReferrersInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {google.cloud.compute.v1.IListReferrersInstancesRequest} message ListReferrersInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReferrersInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReferrersInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListReferrersInstancesRequest} ListReferrersInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferrersInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListReferrersInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListReferrersInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListReferrersInstancesRequest} ListReferrersInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReferrersInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListReferrersInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReferrersInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListReferrersInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListReferrersInstancesRequest} ListReferrersInstancesRequest + */ + ListReferrersInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListReferrersInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListReferrersInstancesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instance != null) + message.instance = String(object.instance); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListReferrersInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @static + * @param {google.cloud.compute.v1.ListReferrersInstancesRequest} message ListReferrersInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReferrersInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListReferrersInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListReferrersInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListReferrersInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReferrersInstancesRequest; + })(); + + v1.RemoveResourcePoliciesInstanceRequest = (function() { + + /** + * Properties of a RemoveResourcePoliciesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveResourcePoliciesInstanceRequest + * @property {string|null} [instance] RemoveResourcePoliciesInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest|null} [instancesRemoveResourcePoliciesRequestResource] RemoveResourcePoliciesInstanceRequest instancesRemoveResourcePoliciesRequestResource + * @property {string|null} [project] RemoveResourcePoliciesInstanceRequest project + * @property {string|null} [requestId] RemoveResourcePoliciesInstanceRequest requestId + * @property {string|null} [zone] RemoveResourcePoliciesInstanceRequest zone + */ + + /** + * Constructs a new RemoveResourcePoliciesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveResourcePoliciesInstanceRequest. + * @implements IRemoveResourcePoliciesInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest=} [properties] Properties to set + */ + function RemoveResourcePoliciesInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveResourcePoliciesInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @instance + */ + RemoveResourcePoliciesInstanceRequest.prototype.instance = ""; + + /** + * RemoveResourcePoliciesInstanceRequest instancesRemoveResourcePoliciesRequestResource. + * @member {google.cloud.compute.v1.IInstancesRemoveResourcePoliciesRequest|null|undefined} instancesRemoveResourcePoliciesRequestResource + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @instance + */ + RemoveResourcePoliciesInstanceRequest.prototype.instancesRemoveResourcePoliciesRequestResource = null; + + /** + * RemoveResourcePoliciesInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @instance + */ + RemoveResourcePoliciesInstanceRequest.prototype.project = ""; + + /** + * RemoveResourcePoliciesInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @instance + */ + RemoveResourcePoliciesInstanceRequest.prototype.requestId = null; + + /** + * RemoveResourcePoliciesInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @instance + */ + RemoveResourcePoliciesInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveResourcePoliciesInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @instance + */ + Object.defineProperty(RemoveResourcePoliciesInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveResourcePoliciesInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest} RemoveResourcePoliciesInstanceRequest instance + */ + RemoveResourcePoliciesInstanceRequest.create = function create(properties) { + return new RemoveResourcePoliciesInstanceRequest(properties); + }; + + /** + * Encodes the specified RemoveResourcePoliciesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest} message RemoveResourcePoliciesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveResourcePoliciesInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instancesRemoveResourcePoliciesRequestResource != null && Object.hasOwnProperty.call(message, "instancesRemoveResourcePoliciesRequestResource")) + $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.encode(message.instancesRemoveResourcePoliciesRequestResource, writer.uint32(/* id 49229558, wireType 2 =*/393836466).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified RemoveResourcePoliciesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest} message RemoveResourcePoliciesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveResourcePoliciesInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveResourcePoliciesInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest} RemoveResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveResourcePoliciesInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 49229558: + message.instancesRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveResourcePoliciesInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest} RemoveResourcePoliciesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveResourcePoliciesInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveResourcePoliciesInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveResourcePoliciesInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesRemoveResourcePoliciesRequestResource != null && message.hasOwnProperty("instancesRemoveResourcePoliciesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.verify(message.instancesRemoveResourcePoliciesRequestResource); + if (error) + return "instancesRemoveResourcePoliciesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a RemoveResourcePoliciesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest} RemoveResourcePoliciesInstanceRequest + */ + RemoveResourcePoliciesInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesRemoveResourcePoliciesRequestResource != null) { + if (typeof object.instancesRemoveResourcePoliciesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest.instancesRemoveResourcePoliciesRequestResource: object expected"); + message.instancesRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.fromObject(object.instancesRemoveResourcePoliciesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a RemoveResourcePoliciesInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @static + * @param {google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest} message RemoveResourcePoliciesInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveResourcePoliciesInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.instancesRemoveResourcePoliciesRequestResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instancesRemoveResourcePoliciesRequestResource != null && message.hasOwnProperty("instancesRemoveResourcePoliciesRequestResource")) + object.instancesRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest.toObject(message.instancesRemoveResourcePoliciesRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this RemoveResourcePoliciesInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveResourcePoliciesInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveResourcePoliciesInstanceRequest; + })(); + + v1.ResetInstanceRequest = (function() { + + /** + * Properties of a ResetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IResetInstanceRequest + * @property {string|null} [instance] ResetInstanceRequest instance + * @property {string|null} [project] ResetInstanceRequest project + * @property {string|null} [requestId] ResetInstanceRequest requestId + * @property {string|null} [zone] ResetInstanceRequest zone + */ + + /** + * Constructs a new ResetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResetInstanceRequest. + * @implements IResetInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IResetInstanceRequest=} [properties] Properties to set + */ + function ResetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResetInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @instance + */ + ResetInstanceRequest.prototype.instance = ""; + + /** + * ResetInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @instance + */ + ResetInstanceRequest.prototype.project = ""; + + /** + * ResetInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @instance + */ + ResetInstanceRequest.prototype.requestId = null; + + /** + * ResetInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @instance + */ + ResetInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResetInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @instance + */ + Object.defineProperty(ResetInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IResetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResetInstanceRequest} ResetInstanceRequest instance + */ + ResetInstanceRequest.create = function create(properties) { + return new ResetInstanceRequest(properties); + }; + + /** + * Encodes the specified ResetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.ResetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IResetInstanceRequest} message ResetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified ResetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IResetInstanceRequest} message ResetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResetInstanceRequest} ResetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResetInstanceRequest} ResetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResetInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ResetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResetInstanceRequest} ResetInstanceRequest + */ + ResetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResetInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.ResetInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ResetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @static + * @param {google.cloud.compute.v1.ResetInstanceRequest} message ResetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this ResetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + ResetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResetInstanceRequest; + })(); + + v1.SetDeletionProtectionInstanceRequest = (function() { + + /** + * Properties of a SetDeletionProtectionInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetDeletionProtectionInstanceRequest + * @property {boolean|null} [deletionProtection] SetDeletionProtectionInstanceRequest deletionProtection + * @property {string|null} [project] SetDeletionProtectionInstanceRequest project + * @property {string|null} [requestId] SetDeletionProtectionInstanceRequest requestId + * @property {string|null} [resource] SetDeletionProtectionInstanceRequest resource + * @property {string|null} [zone] SetDeletionProtectionInstanceRequest zone + */ + + /** + * Constructs a new SetDeletionProtectionInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetDeletionProtectionInstanceRequest. + * @implements ISetDeletionProtectionInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest=} [properties] Properties to set + */ + function SetDeletionProtectionInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetDeletionProtectionInstanceRequest deletionProtection. + * @member {boolean|null|undefined} deletionProtection + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + */ + SetDeletionProtectionInstanceRequest.prototype.deletionProtection = null; + + /** + * SetDeletionProtectionInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + */ + SetDeletionProtectionInstanceRequest.prototype.project = ""; + + /** + * SetDeletionProtectionInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + */ + SetDeletionProtectionInstanceRequest.prototype.requestId = null; + + /** + * SetDeletionProtectionInstanceRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + */ + SetDeletionProtectionInstanceRequest.prototype.resource = ""; + + /** + * SetDeletionProtectionInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + */ + SetDeletionProtectionInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetDeletionProtectionInstanceRequest _deletionProtection. + * @member {"deletionProtection"|undefined} _deletionProtection + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + */ + Object.defineProperty(SetDeletionProtectionInstanceRequest.prototype, "_deletionProtection", { + get: $util.oneOfGetter($oneOfFields = ["deletionProtection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SetDeletionProtectionInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + */ + Object.defineProperty(SetDeletionProtectionInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetDeletionProtectionInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetDeletionProtectionInstanceRequest} SetDeletionProtectionInstanceRequest instance + */ + SetDeletionProtectionInstanceRequest.create = function create(properties) { + return new SetDeletionProtectionInstanceRequest(properties); + }; + + /** + * Encodes the specified SetDeletionProtectionInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetDeletionProtectionInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest} message SetDeletionProtectionInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDeletionProtectionInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 458014698, wireType 0 =*/3664117584).bool(message.deletionProtection); + return writer; + }; + + /** + * Encodes the specified SetDeletionProtectionInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetDeletionProtectionInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest} message SetDeletionProtectionInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDeletionProtectionInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDeletionProtectionInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetDeletionProtectionInstanceRequest} SetDeletionProtectionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDeletionProtectionInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetDeletionProtectionInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 458014698: + message.deletionProtection = reader.bool(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDeletionProtectionInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetDeletionProtectionInstanceRequest} SetDeletionProtectionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDeletionProtectionInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDeletionProtectionInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDeletionProtectionInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + properties._deletionProtection = 1; + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetDeletionProtectionInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetDeletionProtectionInstanceRequest} SetDeletionProtectionInstanceRequest + */ + SetDeletionProtectionInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetDeletionProtectionInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetDeletionProtectionInstanceRequest(); + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetDeletionProtectionInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetDeletionProtectionInstanceRequest} message SetDeletionProtectionInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDeletionProtectionInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + object.deletionProtection = message.deletionProtection; + if (options.oneofs) + object._deletionProtection = "deletionProtection"; + } + return object; + }; + + /** + * Converts this SetDeletionProtectionInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetDeletionProtectionInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetDeletionProtectionInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetDeletionProtectionInstanceRequest; + })(); + + v1.SetDiskAutoDeleteInstanceRequest = (function() { + + /** + * Properties of a SetDiskAutoDeleteInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetDiskAutoDeleteInstanceRequest + * @property {boolean|null} [autoDelete] SetDiskAutoDeleteInstanceRequest autoDelete + * @property {string|null} [deviceName] SetDiskAutoDeleteInstanceRequest deviceName + * @property {string|null} [instance] SetDiskAutoDeleteInstanceRequest instance + * @property {string|null} [project] SetDiskAutoDeleteInstanceRequest project + * @property {string|null} [requestId] SetDiskAutoDeleteInstanceRequest requestId + * @property {string|null} [zone] SetDiskAutoDeleteInstanceRequest zone + */ + + /** + * Constructs a new SetDiskAutoDeleteInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetDiskAutoDeleteInstanceRequest. + * @implements ISetDiskAutoDeleteInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest=} [properties] Properties to set + */ + function SetDiskAutoDeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetDiskAutoDeleteInstanceRequest autoDelete. + * @member {boolean} autoDelete + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + */ + SetDiskAutoDeleteInstanceRequest.prototype.autoDelete = false; + + /** + * SetDiskAutoDeleteInstanceRequest deviceName. + * @member {string} deviceName + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + */ + SetDiskAutoDeleteInstanceRequest.prototype.deviceName = ""; + + /** + * SetDiskAutoDeleteInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + */ + SetDiskAutoDeleteInstanceRequest.prototype.instance = ""; + + /** + * SetDiskAutoDeleteInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + */ + SetDiskAutoDeleteInstanceRequest.prototype.project = ""; + + /** + * SetDiskAutoDeleteInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + */ + SetDiskAutoDeleteInstanceRequest.prototype.requestId = null; + + /** + * SetDiskAutoDeleteInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + */ + SetDiskAutoDeleteInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetDiskAutoDeleteInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + */ + Object.defineProperty(SetDiskAutoDeleteInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetDiskAutoDeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest} SetDiskAutoDeleteInstanceRequest instance + */ + SetDiskAutoDeleteInstanceRequest.create = function create(properties) { + return new SetDiskAutoDeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified SetDiskAutoDeleteInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest} message SetDiskAutoDeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDiskAutoDeleteInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 67541716, wireType 2 =*/540333730).string(message.deviceName); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 464761403, wireType 0 =*/3718091224).bool(message.autoDelete); + return writer; + }; + + /** + * Encodes the specified SetDiskAutoDeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest} message SetDiskAutoDeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDiskAutoDeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDiskAutoDeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest} SetDiskAutoDeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDiskAutoDeleteInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 464761403: + message.autoDelete = reader.bool(); + break; + case 67541716: + message.deviceName = reader.string(); + break; + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDiskAutoDeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest} SetDiskAutoDeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDiskAutoDeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDiskAutoDeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDiskAutoDeleteInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) + if (typeof message.autoDelete !== "boolean") + return "autoDelete: boolean expected"; + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetDiskAutoDeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest} SetDiskAutoDeleteInstanceRequest + */ + SetDiskAutoDeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest(); + if (object.autoDelete != null) + message.autoDelete = Boolean(object.autoDelete); + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetDiskAutoDeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest} message SetDiskAutoDeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDiskAutoDeleteInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.deviceName = ""; + object.project = ""; + object.autoDelete = false; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) + object.deviceName = message.deviceName; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) + object.autoDelete = message.autoDelete; + return object; + }; + + /** + * Converts this SetDiskAutoDeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetDiskAutoDeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetDiskAutoDeleteInstanceRequest; + })(); + + v1.SetIamPolicyInstanceRequest = (function() { + + /** + * Properties of a SetIamPolicyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyInstanceRequest + * @property {string|null} [project] SetIamPolicyInstanceRequest project + * @property {string|null} [resource] SetIamPolicyInstanceRequest resource + * @property {string|null} [zone] SetIamPolicyInstanceRequest zone + * @property {google.cloud.compute.v1.IZoneSetPolicyRequest|null} [zoneSetPolicyRequestResource] SetIamPolicyInstanceRequest zoneSetPolicyRequestResource + */ + + /** + * Constructs a new SetIamPolicyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyInstanceRequest. + * @implements ISetIamPolicyInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceRequest=} [properties] Properties to set + */ + function SetIamPolicyInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @instance + */ + SetIamPolicyInstanceRequest.prototype.project = ""; + + /** + * SetIamPolicyInstanceRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @instance + */ + SetIamPolicyInstanceRequest.prototype.resource = ""; + + /** + * SetIamPolicyInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @instance + */ + SetIamPolicyInstanceRequest.prototype.zone = ""; + + /** + * SetIamPolicyInstanceRequest zoneSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IZoneSetPolicyRequest|null|undefined} zoneSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @instance + */ + SetIamPolicyInstanceRequest.prototype.zoneSetPolicyRequestResource = null; + + /** + * Creates a new SetIamPolicyInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceRequest} SetIamPolicyInstanceRequest instance + */ + SetIamPolicyInstanceRequest.create = function create(properties) { + return new SetIamPolicyInstanceRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceRequest} message SetIamPolicyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.zoneSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "zoneSetPolicyRequestResource")) + $root.google.cloud.compute.v1.ZoneSetPolicyRequest.encode(message.zoneSetPolicyRequestResource, writer.uint32(/* id 382082107, wireType 2 =*/3056656858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceRequest} message SetIamPolicyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceRequest} SetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + case 382082107: + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceRequest} SetIamPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.verify(message.zoneSetPolicyRequestResource); + if (error) + return "zoneSetPolicyRequestResource." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyInstanceRequest} SetIamPolicyInstanceRequest + */ + SetIamPolicyInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyInstanceRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + if (object.zoneSetPolicyRequestResource != null) { + if (typeof object.zoneSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyInstanceRequest.zoneSetPolicyRequestResource: object expected"); + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.fromObject(object.zoneSetPolicyRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyInstanceRequest} message SetIamPolicyInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.zoneSetPolicyRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) + object.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.toObject(message.zoneSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyInstanceRequest; + })(); + + v1.SetLabelsInstanceRequest = (function() { + + /** + * Properties of a SetLabelsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsInstanceRequest + * @property {string|null} [instance] SetLabelsInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesSetLabelsRequest|null} [instancesSetLabelsRequestResource] SetLabelsInstanceRequest instancesSetLabelsRequestResource + * @property {string|null} [project] SetLabelsInstanceRequest project + * @property {string|null} [requestId] SetLabelsInstanceRequest requestId + * @property {string|null} [zone] SetLabelsInstanceRequest zone + */ + + /** + * Constructs a new SetLabelsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsInstanceRequest. + * @implements ISetLabelsInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsInstanceRequest=} [properties] Properties to set + */ + function SetLabelsInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @instance + */ + SetLabelsInstanceRequest.prototype.instance = ""; + + /** + * SetLabelsInstanceRequest instancesSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IInstancesSetLabelsRequest|null|undefined} instancesSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @instance + */ + SetLabelsInstanceRequest.prototype.instancesSetLabelsRequestResource = null; + + /** + * SetLabelsInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @instance + */ + SetLabelsInstanceRequest.prototype.project = ""; + + /** + * SetLabelsInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @instance + */ + SetLabelsInstanceRequest.prototype.requestId = null; + + /** + * SetLabelsInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @instance + */ + SetLabelsInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetLabelsInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @instance + */ + Object.defineProperty(SetLabelsInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetLabelsInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsInstanceRequest} SetLabelsInstanceRequest instance + */ + SetLabelsInstanceRequest.create = function create(properties) { + return new SetLabelsInstanceRequest(properties); + }; + + /** + * Encodes the specified SetLabelsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsInstanceRequest} message SetLabelsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instancesSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "instancesSetLabelsRequestResource")) + $root.google.cloud.compute.v1.InstancesSetLabelsRequest.encode(message.instancesSetLabelsRequestResource, writer.uint32(/* id 207749344, wireType 2 =*/1661994754).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetLabelsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsInstanceRequest} message SetLabelsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsInstanceRequest} SetLabelsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 207749344: + message.instancesSetLabelsRequestResource = $root.google.cloud.compute.v1.InstancesSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsInstanceRequest} SetLabelsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesSetLabelsRequestResource != null && message.hasOwnProperty("instancesSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesSetLabelsRequest.verify(message.instancesSetLabelsRequestResource); + if (error) + return "instancesSetLabelsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetLabelsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsInstanceRequest} SetLabelsInstanceRequest + */ + SetLabelsInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesSetLabelsRequestResource != null) { + if (typeof object.instancesSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsInstanceRequest.instancesSetLabelsRequestResource: object expected"); + message.instancesSetLabelsRequestResource = $root.google.cloud.compute.v1.InstancesSetLabelsRequest.fromObject(object.instancesSetLabelsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetLabelsInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsInstanceRequest} message SetLabelsInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.instancesSetLabelsRequestResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instancesSetLabelsRequestResource != null && message.hasOwnProperty("instancesSetLabelsRequestResource")) + object.instancesSetLabelsRequestResource = $root.google.cloud.compute.v1.InstancesSetLabelsRequest.toObject(message.instancesSetLabelsRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetLabelsInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsInstanceRequest; + })(); + + v1.SetMachineResourcesInstanceRequest = (function() { + + /** + * Properties of a SetMachineResourcesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetMachineResourcesInstanceRequest + * @property {string|null} [instance] SetMachineResourcesInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesSetMachineResourcesRequest|null} [instancesSetMachineResourcesRequestResource] SetMachineResourcesInstanceRequest instancesSetMachineResourcesRequestResource + * @property {string|null} [project] SetMachineResourcesInstanceRequest project + * @property {string|null} [requestId] SetMachineResourcesInstanceRequest requestId + * @property {string|null} [zone] SetMachineResourcesInstanceRequest zone + */ + + /** + * Constructs a new SetMachineResourcesInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetMachineResourcesInstanceRequest. + * @implements ISetMachineResourcesInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetMachineResourcesInstanceRequest=} [properties] Properties to set + */ + function SetMachineResourcesInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetMachineResourcesInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @instance + */ + SetMachineResourcesInstanceRequest.prototype.instance = ""; + + /** + * SetMachineResourcesInstanceRequest instancesSetMachineResourcesRequestResource. + * @member {google.cloud.compute.v1.IInstancesSetMachineResourcesRequest|null|undefined} instancesSetMachineResourcesRequestResource + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @instance + */ + SetMachineResourcesInstanceRequest.prototype.instancesSetMachineResourcesRequestResource = null; + + /** + * SetMachineResourcesInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @instance + */ + SetMachineResourcesInstanceRequest.prototype.project = ""; + + /** + * SetMachineResourcesInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @instance + */ + SetMachineResourcesInstanceRequest.prototype.requestId = null; + + /** + * SetMachineResourcesInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @instance + */ + SetMachineResourcesInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetMachineResourcesInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @instance + */ + Object.defineProperty(SetMachineResourcesInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetMachineResourcesInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMachineResourcesInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetMachineResourcesInstanceRequest} SetMachineResourcesInstanceRequest instance + */ + SetMachineResourcesInstanceRequest.create = function create(properties) { + return new SetMachineResourcesInstanceRequest(properties); + }; + + /** + * Encodes the specified SetMachineResourcesInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMachineResourcesInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMachineResourcesInstanceRequest} message SetMachineResourcesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMachineResourcesInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instancesSetMachineResourcesRequestResource != null && Object.hasOwnProperty.call(message, "instancesSetMachineResourcesRequestResource")) + $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest.encode(message.instancesSetMachineResourcesRequestResource, writer.uint32(/* id 196286318, wireType 2 =*/1570290546).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetMachineResourcesInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMachineResourcesInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMachineResourcesInstanceRequest} message SetMachineResourcesInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMachineResourcesInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetMachineResourcesInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetMachineResourcesInstanceRequest} SetMachineResourcesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMachineResourcesInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetMachineResourcesInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 196286318: + message.instancesSetMachineResourcesRequestResource = $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetMachineResourcesInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetMachineResourcesInstanceRequest} SetMachineResourcesInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMachineResourcesInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetMachineResourcesInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetMachineResourcesInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesSetMachineResourcesRequestResource != null && message.hasOwnProperty("instancesSetMachineResourcesRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest.verify(message.instancesSetMachineResourcesRequestResource); + if (error) + return "instancesSetMachineResourcesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetMachineResourcesInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetMachineResourcesInstanceRequest} SetMachineResourcesInstanceRequest + */ + SetMachineResourcesInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetMachineResourcesInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetMachineResourcesInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesSetMachineResourcesRequestResource != null) { + if (typeof object.instancesSetMachineResourcesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetMachineResourcesInstanceRequest.instancesSetMachineResourcesRequestResource: object expected"); + message.instancesSetMachineResourcesRequestResource = $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest.fromObject(object.instancesSetMachineResourcesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetMachineResourcesInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetMachineResourcesInstanceRequest} message SetMachineResourcesInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMachineResourcesInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.instancesSetMachineResourcesRequestResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instancesSetMachineResourcesRequestResource != null && message.hasOwnProperty("instancesSetMachineResourcesRequestResource")) + object.instancesSetMachineResourcesRequestResource = $root.google.cloud.compute.v1.InstancesSetMachineResourcesRequest.toObject(message.instancesSetMachineResourcesRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetMachineResourcesInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetMachineResourcesInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetMachineResourcesInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetMachineResourcesInstanceRequest; + })(); + + v1.SetMachineTypeInstanceRequest = (function() { + + /** + * Properties of a SetMachineTypeInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetMachineTypeInstanceRequest + * @property {string|null} [instance] SetMachineTypeInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesSetMachineTypeRequest|null} [instancesSetMachineTypeRequestResource] SetMachineTypeInstanceRequest instancesSetMachineTypeRequestResource + * @property {string|null} [project] SetMachineTypeInstanceRequest project + * @property {string|null} [requestId] SetMachineTypeInstanceRequest requestId + * @property {string|null} [zone] SetMachineTypeInstanceRequest zone + */ + + /** + * Constructs a new SetMachineTypeInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetMachineTypeInstanceRequest. + * @implements ISetMachineTypeInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetMachineTypeInstanceRequest=} [properties] Properties to set + */ + function SetMachineTypeInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetMachineTypeInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @instance + */ + SetMachineTypeInstanceRequest.prototype.instance = ""; + + /** + * SetMachineTypeInstanceRequest instancesSetMachineTypeRequestResource. + * @member {google.cloud.compute.v1.IInstancesSetMachineTypeRequest|null|undefined} instancesSetMachineTypeRequestResource + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @instance + */ + SetMachineTypeInstanceRequest.prototype.instancesSetMachineTypeRequestResource = null; + + /** + * SetMachineTypeInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @instance + */ + SetMachineTypeInstanceRequest.prototype.project = ""; + + /** + * SetMachineTypeInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @instance + */ + SetMachineTypeInstanceRequest.prototype.requestId = null; + + /** + * SetMachineTypeInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @instance + */ + SetMachineTypeInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetMachineTypeInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @instance + */ + Object.defineProperty(SetMachineTypeInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetMachineTypeInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMachineTypeInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetMachineTypeInstanceRequest} SetMachineTypeInstanceRequest instance + */ + SetMachineTypeInstanceRequest.create = function create(properties) { + return new SetMachineTypeInstanceRequest(properties); + }; + + /** + * Encodes the specified SetMachineTypeInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMachineTypeInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMachineTypeInstanceRequest} message SetMachineTypeInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMachineTypeInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instancesSetMachineTypeRequestResource != null && Object.hasOwnProperty.call(message, "instancesSetMachineTypeRequestResource")) + $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest.encode(message.instancesSetMachineTypeRequestResource, writer.uint32(/* id 254157709, wireType 2 =*/2033261674).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetMachineTypeInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMachineTypeInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMachineTypeInstanceRequest} message SetMachineTypeInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMachineTypeInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetMachineTypeInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetMachineTypeInstanceRequest} SetMachineTypeInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMachineTypeInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetMachineTypeInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 254157709: + message.instancesSetMachineTypeRequestResource = $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetMachineTypeInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetMachineTypeInstanceRequest} SetMachineTypeInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMachineTypeInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetMachineTypeInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetMachineTypeInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesSetMachineTypeRequestResource != null && message.hasOwnProperty("instancesSetMachineTypeRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest.verify(message.instancesSetMachineTypeRequestResource); + if (error) + return "instancesSetMachineTypeRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetMachineTypeInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetMachineTypeInstanceRequest} SetMachineTypeInstanceRequest + */ + SetMachineTypeInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetMachineTypeInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetMachineTypeInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesSetMachineTypeRequestResource != null) { + if (typeof object.instancesSetMachineTypeRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetMachineTypeInstanceRequest.instancesSetMachineTypeRequestResource: object expected"); + message.instancesSetMachineTypeRequestResource = $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest.fromObject(object.instancesSetMachineTypeRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetMachineTypeInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetMachineTypeInstanceRequest} message SetMachineTypeInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMachineTypeInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.instancesSetMachineTypeRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instancesSetMachineTypeRequestResource != null && message.hasOwnProperty("instancesSetMachineTypeRequestResource")) + object.instancesSetMachineTypeRequestResource = $root.google.cloud.compute.v1.InstancesSetMachineTypeRequest.toObject(message.instancesSetMachineTypeRequestResource, options); + return object; + }; + + /** + * Converts this SetMachineTypeInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetMachineTypeInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetMachineTypeInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetMachineTypeInstanceRequest; + })(); + + v1.SetMetadataInstanceRequest = (function() { + + /** + * Properties of a SetMetadataInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetMetadataInstanceRequest + * @property {string|null} [instance] SetMetadataInstanceRequest instance + * @property {google.cloud.compute.v1.IMetadata|null} [metadataResource] SetMetadataInstanceRequest metadataResource + * @property {string|null} [project] SetMetadataInstanceRequest project + * @property {string|null} [requestId] SetMetadataInstanceRequest requestId + * @property {string|null} [zone] SetMetadataInstanceRequest zone + */ + + /** + * Constructs a new SetMetadataInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetMetadataInstanceRequest. + * @implements ISetMetadataInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetMetadataInstanceRequest=} [properties] Properties to set + */ + function SetMetadataInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetMetadataInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @instance + */ + SetMetadataInstanceRequest.prototype.instance = ""; + + /** + * SetMetadataInstanceRequest metadataResource. + * @member {google.cloud.compute.v1.IMetadata|null|undefined} metadataResource + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @instance + */ + SetMetadataInstanceRequest.prototype.metadataResource = null; + + /** + * SetMetadataInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @instance + */ + SetMetadataInstanceRequest.prototype.project = ""; + + /** + * SetMetadataInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @instance + */ + SetMetadataInstanceRequest.prototype.requestId = null; + + /** + * SetMetadataInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @instance + */ + SetMetadataInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetMetadataInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @instance + */ + Object.defineProperty(SetMetadataInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetMetadataInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMetadataInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetMetadataInstanceRequest} SetMetadataInstanceRequest instance + */ + SetMetadataInstanceRequest.create = function create(properties) { + return new SetMetadataInstanceRequest(properties); + }; + + /** + * Encodes the specified SetMetadataInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMetadataInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMetadataInstanceRequest} message SetMetadataInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMetadataInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.metadataResource != null && Object.hasOwnProperty.call(message, "metadataResource")) + $root.google.cloud.compute.v1.Metadata.encode(message.metadataResource, writer.uint32(/* id 291086110, wireType 2 =*/2328688882).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetMetadataInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMetadataInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMetadataInstanceRequest} message SetMetadataInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMetadataInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetMetadataInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetMetadataInstanceRequest} SetMetadataInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMetadataInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetMetadataInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 291086110: + message.metadataResource = $root.google.cloud.compute.v1.Metadata.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetMetadataInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetMetadataInstanceRequest} SetMetadataInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMetadataInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetMetadataInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetMetadataInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.metadataResource != null && message.hasOwnProperty("metadataResource")) { + var error = $root.google.cloud.compute.v1.Metadata.verify(message.metadataResource); + if (error) + return "metadataResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetMetadataInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetMetadataInstanceRequest} SetMetadataInstanceRequest + */ + SetMetadataInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetMetadataInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetMetadataInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.metadataResource != null) { + if (typeof object.metadataResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetMetadataInstanceRequest.metadataResource: object expected"); + message.metadataResource = $root.google.cloud.compute.v1.Metadata.fromObject(object.metadataResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetMetadataInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetMetadataInstanceRequest} message SetMetadataInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMetadataInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.metadataResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.metadataResource != null && message.hasOwnProperty("metadataResource")) + object.metadataResource = $root.google.cloud.compute.v1.Metadata.toObject(message.metadataResource, options); + return object; + }; + + /** + * Converts this SetMetadataInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetMetadataInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetMetadataInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetMetadataInstanceRequest; + })(); + + v1.SetMinCpuPlatformInstanceRequest = (function() { + + /** + * Properties of a SetMinCpuPlatformInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetMinCpuPlatformInstanceRequest + * @property {string|null} [instance] SetMinCpuPlatformInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest|null} [instancesSetMinCpuPlatformRequestResource] SetMinCpuPlatformInstanceRequest instancesSetMinCpuPlatformRequestResource + * @property {string|null} [project] SetMinCpuPlatformInstanceRequest project + * @property {string|null} [requestId] SetMinCpuPlatformInstanceRequest requestId + * @property {string|null} [zone] SetMinCpuPlatformInstanceRequest zone + */ + + /** + * Constructs a new SetMinCpuPlatformInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetMinCpuPlatformInstanceRequest. + * @implements ISetMinCpuPlatformInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest=} [properties] Properties to set + */ + function SetMinCpuPlatformInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetMinCpuPlatformInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @instance + */ + SetMinCpuPlatformInstanceRequest.prototype.instance = ""; + + /** + * SetMinCpuPlatformInstanceRequest instancesSetMinCpuPlatformRequestResource. + * @member {google.cloud.compute.v1.IInstancesSetMinCpuPlatformRequest|null|undefined} instancesSetMinCpuPlatformRequestResource + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @instance + */ + SetMinCpuPlatformInstanceRequest.prototype.instancesSetMinCpuPlatformRequestResource = null; + + /** + * SetMinCpuPlatformInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @instance + */ + SetMinCpuPlatformInstanceRequest.prototype.project = ""; + + /** + * SetMinCpuPlatformInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @instance + */ + SetMinCpuPlatformInstanceRequest.prototype.requestId = null; + + /** + * SetMinCpuPlatformInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @instance + */ + SetMinCpuPlatformInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetMinCpuPlatformInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @instance + */ + Object.defineProperty(SetMinCpuPlatformInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetMinCpuPlatformInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest} SetMinCpuPlatformInstanceRequest instance + */ + SetMinCpuPlatformInstanceRequest.create = function create(properties) { + return new SetMinCpuPlatformInstanceRequest(properties); + }; + + /** + * Encodes the specified SetMinCpuPlatformInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest} message SetMinCpuPlatformInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMinCpuPlatformInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instancesSetMinCpuPlatformRequestResource != null && Object.hasOwnProperty.call(message, "instancesSetMinCpuPlatformRequestResource")) + $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.encode(message.instancesSetMinCpuPlatformRequestResource, writer.uint32(/* id 148459368, wireType 2 =*/1187674946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetMinCpuPlatformInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest} message SetMinCpuPlatformInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetMinCpuPlatformInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetMinCpuPlatformInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest} SetMinCpuPlatformInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMinCpuPlatformInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 148459368: + message.instancesSetMinCpuPlatformRequestResource = $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetMinCpuPlatformInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest} SetMinCpuPlatformInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetMinCpuPlatformInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetMinCpuPlatformInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetMinCpuPlatformInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesSetMinCpuPlatformRequestResource != null && message.hasOwnProperty("instancesSetMinCpuPlatformRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.verify(message.instancesSetMinCpuPlatformRequestResource); + if (error) + return "instancesSetMinCpuPlatformRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetMinCpuPlatformInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest} SetMinCpuPlatformInstanceRequest + */ + SetMinCpuPlatformInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesSetMinCpuPlatformRequestResource != null) { + if (typeof object.instancesSetMinCpuPlatformRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest.instancesSetMinCpuPlatformRequestResource: object expected"); + message.instancesSetMinCpuPlatformRequestResource = $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.fromObject(object.instancesSetMinCpuPlatformRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetMinCpuPlatformInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest} message SetMinCpuPlatformInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetMinCpuPlatformInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.instancesSetMinCpuPlatformRequestResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instancesSetMinCpuPlatformRequestResource != null && message.hasOwnProperty("instancesSetMinCpuPlatformRequestResource")) + object.instancesSetMinCpuPlatformRequestResource = $root.google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest.toObject(message.instancesSetMinCpuPlatformRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetMinCpuPlatformInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetMinCpuPlatformInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetMinCpuPlatformInstanceRequest; + })(); + + v1.SetSchedulingInstanceRequest = (function() { + + /** + * Properties of a SetSchedulingInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetSchedulingInstanceRequest + * @property {string|null} [instance] SetSchedulingInstanceRequest instance + * @property {string|null} [project] SetSchedulingInstanceRequest project + * @property {string|null} [requestId] SetSchedulingInstanceRequest requestId + * @property {google.cloud.compute.v1.IScheduling|null} [schedulingResource] SetSchedulingInstanceRequest schedulingResource + * @property {string|null} [zone] SetSchedulingInstanceRequest zone + */ + + /** + * Constructs a new SetSchedulingInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetSchedulingInstanceRequest. + * @implements ISetSchedulingInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetSchedulingInstanceRequest=} [properties] Properties to set + */ + function SetSchedulingInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetSchedulingInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @instance + */ + SetSchedulingInstanceRequest.prototype.instance = ""; + + /** + * SetSchedulingInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @instance + */ + SetSchedulingInstanceRequest.prototype.project = ""; + + /** + * SetSchedulingInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @instance + */ + SetSchedulingInstanceRequest.prototype.requestId = null; + + /** + * SetSchedulingInstanceRequest schedulingResource. + * @member {google.cloud.compute.v1.IScheduling|null|undefined} schedulingResource + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @instance + */ + SetSchedulingInstanceRequest.prototype.schedulingResource = null; + + /** + * SetSchedulingInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @instance + */ + SetSchedulingInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetSchedulingInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @instance + */ + Object.defineProperty(SetSchedulingInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetSchedulingInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetSchedulingInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetSchedulingInstanceRequest} SetSchedulingInstanceRequest instance + */ + SetSchedulingInstanceRequest.create = function create(properties) { + return new SetSchedulingInstanceRequest(properties); + }; + + /** + * Encodes the specified SetSchedulingInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSchedulingInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetSchedulingInstanceRequest} message SetSchedulingInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSchedulingInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.schedulingResource != null && Object.hasOwnProperty.call(message, "schedulingResource")) + $root.google.cloud.compute.v1.Scheduling.encode(message.schedulingResource, writer.uint32(/* id 463181401, wireType 2 =*/3705451210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetSchedulingInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSchedulingInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetSchedulingInstanceRequest} message SetSchedulingInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSchedulingInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetSchedulingInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetSchedulingInstanceRequest} SetSchedulingInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSchedulingInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetSchedulingInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 463181401: + message.schedulingResource = $root.google.cloud.compute.v1.Scheduling.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetSchedulingInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetSchedulingInstanceRequest} SetSchedulingInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSchedulingInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetSchedulingInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetSchedulingInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.schedulingResource != null && message.hasOwnProperty("schedulingResource")) { + var error = $root.google.cloud.compute.v1.Scheduling.verify(message.schedulingResource); + if (error) + return "schedulingResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetSchedulingInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetSchedulingInstanceRequest} SetSchedulingInstanceRequest + */ + SetSchedulingInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetSchedulingInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetSchedulingInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.schedulingResource != null) { + if (typeof object.schedulingResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetSchedulingInstanceRequest.schedulingResource: object expected"); + message.schedulingResource = $root.google.cloud.compute.v1.Scheduling.fromObject(object.schedulingResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetSchedulingInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetSchedulingInstanceRequest} message SetSchedulingInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetSchedulingInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.schedulingResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.schedulingResource != null && message.hasOwnProperty("schedulingResource")) + object.schedulingResource = $root.google.cloud.compute.v1.Scheduling.toObject(message.schedulingResource, options); + return object; + }; + + /** + * Converts this SetSchedulingInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetSchedulingInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetSchedulingInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetSchedulingInstanceRequest; + })(); + + v1.SetServiceAccountInstanceRequest = (function() { + + /** + * Properties of a SetServiceAccountInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetServiceAccountInstanceRequest + * @property {string|null} [instance] SetServiceAccountInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesSetServiceAccountRequest|null} [instancesSetServiceAccountRequestResource] SetServiceAccountInstanceRequest instancesSetServiceAccountRequestResource + * @property {string|null} [project] SetServiceAccountInstanceRequest project + * @property {string|null} [requestId] SetServiceAccountInstanceRequest requestId + * @property {string|null} [zone] SetServiceAccountInstanceRequest zone + */ + + /** + * Constructs a new SetServiceAccountInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetServiceAccountInstanceRequest. + * @implements ISetServiceAccountInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetServiceAccountInstanceRequest=} [properties] Properties to set + */ + function SetServiceAccountInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetServiceAccountInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @instance + */ + SetServiceAccountInstanceRequest.prototype.instance = ""; + + /** + * SetServiceAccountInstanceRequest instancesSetServiceAccountRequestResource. + * @member {google.cloud.compute.v1.IInstancesSetServiceAccountRequest|null|undefined} instancesSetServiceAccountRequestResource + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @instance + */ + SetServiceAccountInstanceRequest.prototype.instancesSetServiceAccountRequestResource = null; + + /** + * SetServiceAccountInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @instance + */ + SetServiceAccountInstanceRequest.prototype.project = ""; + + /** + * SetServiceAccountInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @instance + */ + SetServiceAccountInstanceRequest.prototype.requestId = null; + + /** + * SetServiceAccountInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @instance + */ + SetServiceAccountInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetServiceAccountInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @instance + */ + Object.defineProperty(SetServiceAccountInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetServiceAccountInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetServiceAccountInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetServiceAccountInstanceRequest} SetServiceAccountInstanceRequest instance + */ + SetServiceAccountInstanceRequest.create = function create(properties) { + return new SetServiceAccountInstanceRequest(properties); + }; + + /** + * Encodes the specified SetServiceAccountInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetServiceAccountInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetServiceAccountInstanceRequest} message SetServiceAccountInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetServiceAccountInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instancesSetServiceAccountRequestResource != null && Object.hasOwnProperty.call(message, "instancesSetServiceAccountRequestResource")) + $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest.encode(message.instancesSetServiceAccountRequestResource, writer.uint32(/* id 275550008, wireType 2 =*/2204400066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetServiceAccountInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetServiceAccountInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetServiceAccountInstanceRequest} message SetServiceAccountInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetServiceAccountInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetServiceAccountInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetServiceAccountInstanceRequest} SetServiceAccountInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetServiceAccountInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetServiceAccountInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 275550008: + message.instancesSetServiceAccountRequestResource = $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetServiceAccountInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetServiceAccountInstanceRequest} SetServiceAccountInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetServiceAccountInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetServiceAccountInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetServiceAccountInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesSetServiceAccountRequestResource != null && message.hasOwnProperty("instancesSetServiceAccountRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest.verify(message.instancesSetServiceAccountRequestResource); + if (error) + return "instancesSetServiceAccountRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetServiceAccountInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetServiceAccountInstanceRequest} SetServiceAccountInstanceRequest + */ + SetServiceAccountInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetServiceAccountInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetServiceAccountInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesSetServiceAccountRequestResource != null) { + if (typeof object.instancesSetServiceAccountRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetServiceAccountInstanceRequest.instancesSetServiceAccountRequestResource: object expected"); + message.instancesSetServiceAccountRequestResource = $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest.fromObject(object.instancesSetServiceAccountRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetServiceAccountInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetServiceAccountInstanceRequest} message SetServiceAccountInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetServiceAccountInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.instancesSetServiceAccountRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instancesSetServiceAccountRequestResource != null && message.hasOwnProperty("instancesSetServiceAccountRequestResource")) + object.instancesSetServiceAccountRequestResource = $root.google.cloud.compute.v1.InstancesSetServiceAccountRequest.toObject(message.instancesSetServiceAccountRequestResource, options); + return object; + }; + + /** + * Converts this SetServiceAccountInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetServiceAccountInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetServiceAccountInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetServiceAccountInstanceRequest; + })(); + + v1.SetShieldedInstanceIntegrityPolicyInstanceRequest = (function() { + + /** + * Properties of a SetShieldedInstanceIntegrityPolicyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetShieldedInstanceIntegrityPolicyInstanceRequest + * @property {string|null} [instance] SetShieldedInstanceIntegrityPolicyInstanceRequest instance + * @property {string|null} [project] SetShieldedInstanceIntegrityPolicyInstanceRequest project + * @property {string|null} [requestId] SetShieldedInstanceIntegrityPolicyInstanceRequest requestId + * @property {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null} [shieldedInstanceIntegrityPolicyResource] SetShieldedInstanceIntegrityPolicyInstanceRequest shieldedInstanceIntegrityPolicyResource + * @property {string|null} [zone] SetShieldedInstanceIntegrityPolicyInstanceRequest zone + */ + + /** + * Constructs a new SetShieldedInstanceIntegrityPolicyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetShieldedInstanceIntegrityPolicyInstanceRequest. + * @implements ISetShieldedInstanceIntegrityPolicyInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest=} [properties] Properties to set + */ + function SetShieldedInstanceIntegrityPolicyInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetShieldedInstanceIntegrityPolicyInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @instance + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.prototype.instance = ""; + + /** + * SetShieldedInstanceIntegrityPolicyInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @instance + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.prototype.project = ""; + + /** + * SetShieldedInstanceIntegrityPolicyInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @instance + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.prototype.requestId = null; + + /** + * SetShieldedInstanceIntegrityPolicyInstanceRequest shieldedInstanceIntegrityPolicyResource. + * @member {google.cloud.compute.v1.IShieldedInstanceIntegrityPolicy|null|undefined} shieldedInstanceIntegrityPolicyResource + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @instance + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.prototype.shieldedInstanceIntegrityPolicyResource = null; + + /** + * SetShieldedInstanceIntegrityPolicyInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @instance + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetShieldedInstanceIntegrityPolicyInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @instance + */ + Object.defineProperty(SetShieldedInstanceIntegrityPolicyInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetShieldedInstanceIntegrityPolicyInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest} SetShieldedInstanceIntegrityPolicyInstanceRequest instance + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.create = function create(properties) { + return new SetShieldedInstanceIntegrityPolicyInstanceRequest(properties); + }; + + /** + * Encodes the specified SetShieldedInstanceIntegrityPolicyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest} message SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.shieldedInstanceIntegrityPolicyResource != null && Object.hasOwnProperty.call(message, "shieldedInstanceIntegrityPolicyResource")) + $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.encode(message.shieldedInstanceIntegrityPolicyResource, writer.uint32(/* id 409169462, wireType 2 =*/3273355698).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetShieldedInstanceIntegrityPolicyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest} message SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetShieldedInstanceIntegrityPolicyInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest} SetShieldedInstanceIntegrityPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 409169462: + message.shieldedInstanceIntegrityPolicyResource = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetShieldedInstanceIntegrityPolicyInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest} SetShieldedInstanceIntegrityPolicyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetShieldedInstanceIntegrityPolicyInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.shieldedInstanceIntegrityPolicyResource != null && message.hasOwnProperty("shieldedInstanceIntegrityPolicyResource")) { + var error = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.verify(message.shieldedInstanceIntegrityPolicyResource); + if (error) + return "shieldedInstanceIntegrityPolicyResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetShieldedInstanceIntegrityPolicyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest} SetShieldedInstanceIntegrityPolicyInstanceRequest + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.shieldedInstanceIntegrityPolicyResource != null) { + if (typeof object.shieldedInstanceIntegrityPolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest.shieldedInstanceIntegrityPolicyResource: object expected"); + message.shieldedInstanceIntegrityPolicyResource = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.fromObject(object.shieldedInstanceIntegrityPolicyResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetShieldedInstanceIntegrityPolicyInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest} message SetShieldedInstanceIntegrityPolicyInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.shieldedInstanceIntegrityPolicyResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.shieldedInstanceIntegrityPolicyResource != null && message.hasOwnProperty("shieldedInstanceIntegrityPolicyResource")) + object.shieldedInstanceIntegrityPolicyResource = $root.google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy.toObject(message.shieldedInstanceIntegrityPolicyResource, options); + return object; + }; + + /** + * Converts this SetShieldedInstanceIntegrityPolicyInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetShieldedInstanceIntegrityPolicyInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetShieldedInstanceIntegrityPolicyInstanceRequest; + })(); + + v1.SetTagsInstanceRequest = (function() { + + /** + * Properties of a SetTagsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetTagsInstanceRequest + * @property {string|null} [instance] SetTagsInstanceRequest instance + * @property {string|null} [project] SetTagsInstanceRequest project + * @property {string|null} [requestId] SetTagsInstanceRequest requestId + * @property {google.cloud.compute.v1.ITags|null} [tagsResource] SetTagsInstanceRequest tagsResource + * @property {string|null} [zone] SetTagsInstanceRequest zone + */ + + /** + * Constructs a new SetTagsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetTagsInstanceRequest. + * @implements ISetTagsInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISetTagsInstanceRequest=} [properties] Properties to set + */ + function SetTagsInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetTagsInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @instance + */ + SetTagsInstanceRequest.prototype.instance = ""; + + /** + * SetTagsInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @instance + */ + SetTagsInstanceRequest.prototype.project = ""; + + /** + * SetTagsInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @instance + */ + SetTagsInstanceRequest.prototype.requestId = null; + + /** + * SetTagsInstanceRequest tagsResource. + * @member {google.cloud.compute.v1.ITags|null|undefined} tagsResource + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @instance + */ + SetTagsInstanceRequest.prototype.tagsResource = null; + + /** + * SetTagsInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @instance + */ + SetTagsInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetTagsInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @instance + */ + Object.defineProperty(SetTagsInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetTagsInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetTagsInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetTagsInstanceRequest} SetTagsInstanceRequest instance + */ + SetTagsInstanceRequest.create = function create(properties) { + return new SetTagsInstanceRequest(properties); + }; + + /** + * Encodes the specified SetTagsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTagsInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetTagsInstanceRequest} message SetTagsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTagsInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.tagsResource != null && Object.hasOwnProperty.call(message, "tagsResource")) + $root.google.cloud.compute.v1.Tags.encode(message.tagsResource, writer.uint32(/* id 331435380, wireType 2 =*/2651483042).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetTagsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTagsInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISetTagsInstanceRequest} message SetTagsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTagsInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetTagsInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetTagsInstanceRequest} SetTagsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTagsInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetTagsInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 331435380: + message.tagsResource = $root.google.cloud.compute.v1.Tags.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetTagsInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetTagsInstanceRequest} SetTagsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTagsInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetTagsInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetTagsInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.tagsResource != null && message.hasOwnProperty("tagsResource")) { + var error = $root.google.cloud.compute.v1.Tags.verify(message.tagsResource); + if (error) + return "tagsResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetTagsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetTagsInstanceRequest} SetTagsInstanceRequest + */ + SetTagsInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetTagsInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetTagsInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.tagsResource != null) { + if (typeof object.tagsResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetTagsInstanceRequest.tagsResource: object expected"); + message.tagsResource = $root.google.cloud.compute.v1.Tags.fromObject(object.tagsResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetTagsInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @static + * @param {google.cloud.compute.v1.SetTagsInstanceRequest} message SetTagsInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetTagsInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.tagsResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.tagsResource != null && message.hasOwnProperty("tagsResource")) + object.tagsResource = $root.google.cloud.compute.v1.Tags.toObject(message.tagsResource, options); + return object; + }; + + /** + * Converts this SetTagsInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetTagsInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SetTagsInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetTagsInstanceRequest; + })(); + + v1.SimulateMaintenanceEventInstanceRequest = (function() { + + /** + * Properties of a SimulateMaintenanceEventInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ISimulateMaintenanceEventInstanceRequest + * @property {string|null} [instance] SimulateMaintenanceEventInstanceRequest instance + * @property {string|null} [project] SimulateMaintenanceEventInstanceRequest project + * @property {string|null} [zone] SimulateMaintenanceEventInstanceRequest zone + */ + + /** + * Constructs a new SimulateMaintenanceEventInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SimulateMaintenanceEventInstanceRequest. + * @implements ISimulateMaintenanceEventInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest=} [properties] Properties to set + */ + function SimulateMaintenanceEventInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimulateMaintenanceEventInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @instance + */ + SimulateMaintenanceEventInstanceRequest.prototype.instance = ""; + + /** + * SimulateMaintenanceEventInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @instance + */ + SimulateMaintenanceEventInstanceRequest.prototype.project = ""; + + /** + * SimulateMaintenanceEventInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @instance + */ + SimulateMaintenanceEventInstanceRequest.prototype.zone = ""; + + /** + * Creates a new SimulateMaintenanceEventInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest} SimulateMaintenanceEventInstanceRequest instance + */ + SimulateMaintenanceEventInstanceRequest.create = function create(properties) { + return new SimulateMaintenanceEventInstanceRequest(properties); + }; + + /** + * Encodes the specified SimulateMaintenanceEventInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest} message SimulateMaintenanceEventInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateMaintenanceEventInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SimulateMaintenanceEventInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest} message SimulateMaintenanceEventInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimulateMaintenanceEventInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimulateMaintenanceEventInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest} SimulateMaintenanceEventInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateMaintenanceEventInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimulateMaintenanceEventInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest} SimulateMaintenanceEventInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimulateMaintenanceEventInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimulateMaintenanceEventInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimulateMaintenanceEventInstanceRequest.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SimulateMaintenanceEventInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest} SimulateMaintenanceEventInstanceRequest + */ + SimulateMaintenanceEventInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SimulateMaintenanceEventInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @static + * @param {google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest} message SimulateMaintenanceEventInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimulateMaintenanceEventInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SimulateMaintenanceEventInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + SimulateMaintenanceEventInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimulateMaintenanceEventInstanceRequest; + })(); + + v1.StartInstanceRequest = (function() { + + /** + * Properties of a StartInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IStartInstanceRequest + * @property {string|null} [instance] StartInstanceRequest instance + * @property {string|null} [project] StartInstanceRequest project + * @property {string|null} [requestId] StartInstanceRequest requestId + * @property {string|null} [zone] StartInstanceRequest zone + */ + + /** + * Constructs a new StartInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a StartInstanceRequest. + * @implements IStartInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IStartInstanceRequest=} [properties] Properties to set + */ + function StartInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.instance = ""; + + /** + * StartInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.project = ""; + + /** + * StartInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.requestId = null; + + /** + * StartInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @instance + */ + StartInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StartInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @instance + */ + Object.defineProperty(StartInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.StartInstanceRequest} StartInstanceRequest instance + */ + StartInstanceRequest.create = function create(properties) { + return new StartInstanceRequest(properties); + }; + + /** + * Encodes the specified StartInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.StartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified StartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStartInstanceRequest} message StartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.StartInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.StartInstanceRequest} StartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a StartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.StartInstanceRequest} StartInstanceRequest + */ + StartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.StartInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.StartInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a StartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @static + * @param {google.cloud.compute.v1.StartInstanceRequest} message StartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this StartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.StartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartInstanceRequest; + })(); + + v1.StartWithEncryptionKeyInstanceRequest = (function() { + + /** + * Properties of a StartWithEncryptionKeyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IStartWithEncryptionKeyInstanceRequest + * @property {string|null} [instance] StartWithEncryptionKeyInstanceRequest instance + * @property {google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest|null} [instancesStartWithEncryptionKeyRequestResource] StartWithEncryptionKeyInstanceRequest instancesStartWithEncryptionKeyRequestResource + * @property {string|null} [project] StartWithEncryptionKeyInstanceRequest project + * @property {string|null} [requestId] StartWithEncryptionKeyInstanceRequest requestId + * @property {string|null} [zone] StartWithEncryptionKeyInstanceRequest zone + */ + + /** + * Constructs a new StartWithEncryptionKeyInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a StartWithEncryptionKeyInstanceRequest. + * @implements IStartWithEncryptionKeyInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest=} [properties] Properties to set + */ + function StartWithEncryptionKeyInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartWithEncryptionKeyInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @instance + */ + StartWithEncryptionKeyInstanceRequest.prototype.instance = ""; + + /** + * StartWithEncryptionKeyInstanceRequest instancesStartWithEncryptionKeyRequestResource. + * @member {google.cloud.compute.v1.IInstancesStartWithEncryptionKeyRequest|null|undefined} instancesStartWithEncryptionKeyRequestResource + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @instance + */ + StartWithEncryptionKeyInstanceRequest.prototype.instancesStartWithEncryptionKeyRequestResource = null; + + /** + * StartWithEncryptionKeyInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @instance + */ + StartWithEncryptionKeyInstanceRequest.prototype.project = ""; + + /** + * StartWithEncryptionKeyInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @instance + */ + StartWithEncryptionKeyInstanceRequest.prototype.requestId = null; + + /** + * StartWithEncryptionKeyInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @instance + */ + StartWithEncryptionKeyInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StartWithEncryptionKeyInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @instance + */ + Object.defineProperty(StartWithEncryptionKeyInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StartWithEncryptionKeyInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest} StartWithEncryptionKeyInstanceRequest instance + */ + StartWithEncryptionKeyInstanceRequest.create = function create(properties) { + return new StartWithEncryptionKeyInstanceRequest(properties); + }; + + /** + * Encodes the specified StartWithEncryptionKeyInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest} message StartWithEncryptionKeyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartWithEncryptionKeyInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instancesStartWithEncryptionKeyRequestResource != null && Object.hasOwnProperty.call(message, "instancesStartWithEncryptionKeyRequestResource")) + $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.encode(message.instancesStartWithEncryptionKeyRequestResource, writer.uint32(/* id 441712511, wireType 2 =*/3533700090).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StartWithEncryptionKeyInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest} message StartWithEncryptionKeyInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartWithEncryptionKeyInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartWithEncryptionKeyInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest} StartWithEncryptionKeyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartWithEncryptionKeyInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 441712511: + message.instancesStartWithEncryptionKeyRequestResource = $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartWithEncryptionKeyInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest} StartWithEncryptionKeyInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartWithEncryptionKeyInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartWithEncryptionKeyInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartWithEncryptionKeyInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instancesStartWithEncryptionKeyRequestResource != null && message.hasOwnProperty("instancesStartWithEncryptionKeyRequestResource")) { + var error = $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.verify(message.instancesStartWithEncryptionKeyRequestResource); + if (error) + return "instancesStartWithEncryptionKeyRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a StartWithEncryptionKeyInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest} StartWithEncryptionKeyInstanceRequest + */ + StartWithEncryptionKeyInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instancesStartWithEncryptionKeyRequestResource != null) { + if (typeof object.instancesStartWithEncryptionKeyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest.instancesStartWithEncryptionKeyRequestResource: object expected"); + message.instancesStartWithEncryptionKeyRequestResource = $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.fromObject(object.instancesStartWithEncryptionKeyRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a StartWithEncryptionKeyInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @static + * @param {google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest} message StartWithEncryptionKeyInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartWithEncryptionKeyInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.instancesStartWithEncryptionKeyRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instancesStartWithEncryptionKeyRequestResource != null && message.hasOwnProperty("instancesStartWithEncryptionKeyRequestResource")) + object.instancesStartWithEncryptionKeyRequestResource = $root.google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest.toObject(message.instancesStartWithEncryptionKeyRequestResource, options); + return object; + }; + + /** + * Converts this StartWithEncryptionKeyInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StartWithEncryptionKeyInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StartWithEncryptionKeyInstanceRequest; + })(); + + v1.StopInstanceRequest = (function() { + + /** + * Properties of a StopInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IStopInstanceRequest + * @property {string|null} [instance] StopInstanceRequest instance + * @property {string|null} [project] StopInstanceRequest project + * @property {string|null} [requestId] StopInstanceRequest requestId + * @property {string|null} [zone] StopInstanceRequest zone + */ + + /** + * Constructs a new StopInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a StopInstanceRequest. + * @implements IStopInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IStopInstanceRequest=} [properties] Properties to set + */ + function StopInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.instance = ""; + + /** + * StopInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.project = ""; + + /** + * StopInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.requestId = null; + + /** + * StopInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @instance + */ + StopInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StopInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @instance + */ + Object.defineProperty(StopInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StopInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStopInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.StopInstanceRequest} StopInstanceRequest instance + */ + StopInstanceRequest.create = function create(properties) { + return new StopInstanceRequest(properties); + }; + + /** + * Encodes the specified StopInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.StopInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified StopInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.StopInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {google.cloud.compute.v1.IStopInstanceRequest} message StopInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.StopInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StopInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.StopInstanceRequest} StopInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a StopInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.StopInstanceRequest} StopInstanceRequest + */ + StopInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.StopInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.StopInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a StopInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @static + * @param {google.cloud.compute.v1.StopInstanceRequest} message StopInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this StopInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.StopInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + StopInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StopInstanceRequest; + })(); + + v1.TestIamPermissionsInstanceRequest = (function() { + + /** + * Properties of a TestIamPermissionsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsInstanceRequest + * @property {string|null} [project] TestIamPermissionsInstanceRequest project + * @property {string|null} [resource] TestIamPermissionsInstanceRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsInstanceRequest testPermissionsRequestResource + * @property {string|null} [zone] TestIamPermissionsInstanceRequest zone + */ + + /** + * Constructs a new TestIamPermissionsInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsInstanceRequest. + * @implements ITestIamPermissionsInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceRequest=} [properties] Properties to set + */ + function TestIamPermissionsInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @instance + */ + TestIamPermissionsInstanceRequest.prototype.project = ""; + + /** + * TestIamPermissionsInstanceRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @instance + */ + TestIamPermissionsInstanceRequest.prototype.resource = ""; + + /** + * TestIamPermissionsInstanceRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @instance + */ + TestIamPermissionsInstanceRequest.prototype.testPermissionsRequestResource = null; + + /** + * TestIamPermissionsInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @instance + */ + TestIamPermissionsInstanceRequest.prototype.zone = ""; + + /** + * Creates a new TestIamPermissionsInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceRequest} TestIamPermissionsInstanceRequest instance + */ + TestIamPermissionsInstanceRequest.create = function create(properties) { + return new TestIamPermissionsInstanceRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceRequest} message TestIamPermissionsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceRequest} message TestIamPermissionsInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceRequest} TestIamPermissionsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceRequest} TestIamPermissionsInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a TestIamPermissionsInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsInstanceRequest} TestIamPermissionsInstanceRequest + */ + TestIamPermissionsInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsInstanceRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsInstanceRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsInstanceRequest} message TestIamPermissionsInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsInstanceRequest; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateInstanceRequest + * @property {string|null} [instance] UpdateInstanceRequest instance + * @property {google.cloud.compute.v1.IInstance|null} [instanceResource] UpdateInstanceRequest instanceResource + * @property {string|null} [minimalAction] UpdateInstanceRequest minimalAction + * @property {string|null} [mostDisruptiveAllowedAction] UpdateInstanceRequest mostDisruptiveAllowedAction + * @property {string|null} [project] UpdateInstanceRequest project + * @property {string|null} [requestId] UpdateInstanceRequest requestId + * @property {string|null} [zone] UpdateInstanceRequest zone + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.compute.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 instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = ""; + + /** + * UpdateInstanceRequest instanceResource. + * @member {google.cloud.compute.v1.IInstance|null|undefined} instanceResource + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instanceResource = null; + + /** + * UpdateInstanceRequest minimalAction. + * @member {string|null|undefined} minimalAction + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.minimalAction = null; + + /** + * UpdateInstanceRequest mostDisruptiveAllowedAction. + * @member {string|null|undefined} mostDisruptiveAllowedAction + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.mostDisruptiveAllowedAction = null; + + /** + * UpdateInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.project = ""; + + /** + * UpdateInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.requestId = null; + + /** + * UpdateInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateInstanceRequest _minimalAction. + * @member {"minimalAction"|undefined} _minimalAction + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + Object.defineProperty(UpdateInstanceRequest.prototype, "_minimalAction", { + get: $util.oneOfGetter($oneOfFields = ["minimalAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UpdateInstanceRequest _mostDisruptiveAllowedAction. + * @member {"mostDisruptiveAllowedAction"|undefined} _mostDisruptiveAllowedAction + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + Object.defineProperty(UpdateInstanceRequest.prototype, "_mostDisruptiveAllowedAction", { + get: $util.oneOfGetter($oneOfFields = ["mostDisruptiveAllowedAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UpdateInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + */ + Object.defineProperty(UpdateInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.mostDisruptiveAllowedAction != null && Object.hasOwnProperty.call(message, "mostDisruptiveAllowedAction")) + writer.uint32(/* id 66103053, wireType 2 =*/528824426).string(message.mostDisruptiveAllowedAction); + if (message.instanceResource != null && Object.hasOwnProperty.call(message, "instanceResource")) + $root.google.cloud.compute.v1.Instance.encode(message.instanceResource, writer.uint32(/* id 215988344, wireType 2 =*/1727906754).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.minimalAction != null && Object.hasOwnProperty.call(message, "minimalAction")) + writer.uint32(/* id 270567060, wireType 2 =*/2164536482).string(message.minimalAction); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 215988344: + message.instanceResource = $root.google.cloud.compute.v1.Instance.decode(reader, reader.uint32()); + break; + case 270567060: + message.minimalAction = reader.string(); + break; + case 66103053: + message.mostDisruptiveAllowedAction = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + 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.compute.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.instanceResource != null && message.hasOwnProperty("instanceResource")) { + var error = $root.google.cloud.compute.v1.Instance.verify(message.instanceResource); + if (error) + return "instanceResource." + error; + } + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + properties._minimalAction = 1; + if (!$util.isString(message.minimalAction)) + return "minimalAction: string expected"; + } + if (message.mostDisruptiveAllowedAction != null && message.hasOwnProperty("mostDisruptiveAllowedAction")) { + properties._mostDisruptiveAllowedAction = 1; + if (!$util.isString(message.mostDisruptiveAllowedAction)) + return "mostDisruptiveAllowedAction: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.instanceResource != null) { + if (typeof object.instanceResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateInstanceRequest.instanceResource: object expected"); + message.instanceResource = $root.google.cloud.compute.v1.Instance.fromObject(object.instanceResource); + } + if (object.minimalAction != null) + message.minimalAction = String(object.minimalAction); + if (object.mostDisruptiveAllowedAction != null) + message.mostDisruptiveAllowedAction = String(object.mostDisruptiveAllowedAction); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.instance = ""; + object.instanceResource = null; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.mostDisruptiveAllowedAction != null && message.hasOwnProperty("mostDisruptiveAllowedAction")) { + object.mostDisruptiveAllowedAction = message.mostDisruptiveAllowedAction; + if (options.oneofs) + object._mostDisruptiveAllowedAction = "mostDisruptiveAllowedAction"; + } + if (message.instanceResource != null && message.hasOwnProperty("instanceResource")) + object.instanceResource = $root.google.cloud.compute.v1.Instance.toObject(message.instanceResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.minimalAction != null && message.hasOwnProperty("minimalAction")) { + object.minimalAction = message.minimalAction; + if (options.oneofs) + object._minimalAction = "minimalAction"; + } + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInstanceRequest; + })(); + + v1.UpdateAccessConfigInstanceRequest = (function() { + + /** + * Properties of an UpdateAccessConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateAccessConfigInstanceRequest + * @property {google.cloud.compute.v1.IAccessConfig|null} [accessConfigResource] UpdateAccessConfigInstanceRequest accessConfigResource + * @property {string|null} [instance] UpdateAccessConfigInstanceRequest instance + * @property {string|null} [networkInterface] UpdateAccessConfigInstanceRequest networkInterface + * @property {string|null} [project] UpdateAccessConfigInstanceRequest project + * @property {string|null} [requestId] UpdateAccessConfigInstanceRequest requestId + * @property {string|null} [zone] UpdateAccessConfigInstanceRequest zone + */ + + /** + * Constructs a new UpdateAccessConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateAccessConfigInstanceRequest. + * @implements IUpdateAccessConfigInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest=} [properties] Properties to set + */ + function UpdateAccessConfigInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAccessConfigInstanceRequest accessConfigResource. + * @member {google.cloud.compute.v1.IAccessConfig|null|undefined} accessConfigResource + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + */ + UpdateAccessConfigInstanceRequest.prototype.accessConfigResource = null; + + /** + * UpdateAccessConfigInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + */ + UpdateAccessConfigInstanceRequest.prototype.instance = ""; + + /** + * UpdateAccessConfigInstanceRequest networkInterface. + * @member {string} networkInterface + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + */ + UpdateAccessConfigInstanceRequest.prototype.networkInterface = ""; + + /** + * UpdateAccessConfigInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + */ + UpdateAccessConfigInstanceRequest.prototype.project = ""; + + /** + * UpdateAccessConfigInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + */ + UpdateAccessConfigInstanceRequest.prototype.requestId = null; + + /** + * UpdateAccessConfigInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + */ + UpdateAccessConfigInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateAccessConfigInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + */ + Object.defineProperty(UpdateAccessConfigInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateAccessConfigInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateAccessConfigInstanceRequest} UpdateAccessConfigInstanceRequest instance + */ + UpdateAccessConfigInstanceRequest.create = function create(properties) { + return new UpdateAccessConfigInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateAccessConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateAccessConfigInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest} message UpdateAccessConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAccessConfigInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkInterface != null && Object.hasOwnProperty.call(message, "networkInterface")) + writer.uint32(/* id 365387880, wireType 2 =*/2923103042).string(message.networkInterface); + if (message.accessConfigResource != null && Object.hasOwnProperty.call(message, "accessConfigResource")) + $root.google.cloud.compute.v1.AccessConfig.encode(message.accessConfigResource, writer.uint32(/* id 387825552, wireType 2 =*/3102604418).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAccessConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateAccessConfigInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest} message UpdateAccessConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAccessConfigInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAccessConfigInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateAccessConfigInstanceRequest} UpdateAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAccessConfigInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateAccessConfigInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 387825552: + message.accessConfigResource = $root.google.cloud.compute.v1.AccessConfig.decode(reader, reader.uint32()); + break; + case 18257045: + message.instance = reader.string(); + break; + case 365387880: + message.networkInterface = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAccessConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateAccessConfigInstanceRequest} UpdateAccessConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAccessConfigInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAccessConfigInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAccessConfigInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessConfigResource != null && message.hasOwnProperty("accessConfigResource")) { + var error = $root.google.cloud.compute.v1.AccessConfig.verify(message.accessConfigResource); + if (error) + return "accessConfigResource." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + if (!$util.isString(message.networkInterface)) + return "networkInterface: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an UpdateAccessConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateAccessConfigInstanceRequest} UpdateAccessConfigInstanceRequest + */ + UpdateAccessConfigInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateAccessConfigInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateAccessConfigInstanceRequest(); + if (object.accessConfigResource != null) { + if (typeof object.accessConfigResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateAccessConfigInstanceRequest.accessConfigResource: object expected"); + message.accessConfigResource = $root.google.cloud.compute.v1.AccessConfig.fromObject(object.accessConfigResource); + } + if (object.instance != null) + message.instance = String(object.instance); + if (object.networkInterface != null) + message.networkInterface = String(object.networkInterface); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an UpdateAccessConfigInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.UpdateAccessConfigInstanceRequest} message UpdateAccessConfigInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAccessConfigInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.networkInterface = ""; + object.accessConfigResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + object.networkInterface = message.networkInterface; + if (message.accessConfigResource != null && message.hasOwnProperty("accessConfigResource")) + object.accessConfigResource = $root.google.cloud.compute.v1.AccessConfig.toObject(message.accessConfigResource, options); + return object; + }; + + /** + * Converts this UpdateAccessConfigInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateAccessConfigInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAccessConfigInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateAccessConfigInstanceRequest; + })(); + + v1.UpdateDisplayDeviceInstanceRequest = (function() { + + /** + * Properties of an UpdateDisplayDeviceInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateDisplayDeviceInstanceRequest + * @property {google.cloud.compute.v1.IDisplayDevice|null} [displayDeviceResource] UpdateDisplayDeviceInstanceRequest displayDeviceResource + * @property {string|null} [instance] UpdateDisplayDeviceInstanceRequest instance + * @property {string|null} [project] UpdateDisplayDeviceInstanceRequest project + * @property {string|null} [requestId] UpdateDisplayDeviceInstanceRequest requestId + * @property {string|null} [zone] UpdateDisplayDeviceInstanceRequest zone + */ + + /** + * Constructs a new UpdateDisplayDeviceInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateDisplayDeviceInstanceRequest. + * @implements IUpdateDisplayDeviceInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest=} [properties] Properties to set + */ + function UpdateDisplayDeviceInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDisplayDeviceInstanceRequest displayDeviceResource. + * @member {google.cloud.compute.v1.IDisplayDevice|null|undefined} displayDeviceResource + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @instance + */ + UpdateDisplayDeviceInstanceRequest.prototype.displayDeviceResource = null; + + /** + * UpdateDisplayDeviceInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @instance + */ + UpdateDisplayDeviceInstanceRequest.prototype.instance = ""; + + /** + * UpdateDisplayDeviceInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @instance + */ + UpdateDisplayDeviceInstanceRequest.prototype.project = ""; + + /** + * UpdateDisplayDeviceInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @instance + */ + UpdateDisplayDeviceInstanceRequest.prototype.requestId = null; + + /** + * UpdateDisplayDeviceInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @instance + */ + UpdateDisplayDeviceInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateDisplayDeviceInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @instance + */ + Object.defineProperty(UpdateDisplayDeviceInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateDisplayDeviceInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest} UpdateDisplayDeviceInstanceRequest instance + */ + UpdateDisplayDeviceInstanceRequest.create = function create(properties) { + return new UpdateDisplayDeviceInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateDisplayDeviceInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest} message UpdateDisplayDeviceInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDisplayDeviceInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.displayDeviceResource != null && Object.hasOwnProperty.call(message, "displayDeviceResource")) + $root.google.cloud.compute.v1.DisplayDevice.encode(message.displayDeviceResource, writer.uint32(/* id 289686106, wireType 2 =*/2317488850).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDisplayDeviceInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest} message UpdateDisplayDeviceInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDisplayDeviceInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDisplayDeviceInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest} UpdateDisplayDeviceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDisplayDeviceInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 289686106: + message.displayDeviceResource = $root.google.cloud.compute.v1.DisplayDevice.decode(reader, reader.uint32()); + break; + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDisplayDeviceInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest} UpdateDisplayDeviceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDisplayDeviceInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDisplayDeviceInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDisplayDeviceInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayDeviceResource != null && message.hasOwnProperty("displayDeviceResource")) { + var error = $root.google.cloud.compute.v1.DisplayDevice.verify(message.displayDeviceResource); + if (error) + return "displayDeviceResource." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an UpdateDisplayDeviceInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest} UpdateDisplayDeviceInstanceRequest + */ + UpdateDisplayDeviceInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest(); + if (object.displayDeviceResource != null) { + if (typeof object.displayDeviceResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest.displayDeviceResource: object expected"); + message.displayDeviceResource = $root.google.cloud.compute.v1.DisplayDevice.fromObject(object.displayDeviceResource); + } + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an UpdateDisplayDeviceInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @static + * @param {google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest} message UpdateDisplayDeviceInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDisplayDeviceInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.displayDeviceResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayDeviceResource != null && message.hasOwnProperty("displayDeviceResource")) + object.displayDeviceResource = $root.google.cloud.compute.v1.DisplayDevice.toObject(message.displayDeviceResource, options); + return object; + }; + + /** + * Converts this UpdateDisplayDeviceInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDisplayDeviceInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateDisplayDeviceInstanceRequest; + })(); + + v1.UpdateNetworkInterfaceInstanceRequest = (function() { + + /** + * Properties of an UpdateNetworkInterfaceInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateNetworkInterfaceInstanceRequest + * @property {string|null} [instance] UpdateNetworkInterfaceInstanceRequest instance + * @property {string|null} [networkInterface] UpdateNetworkInterfaceInstanceRequest networkInterface + * @property {google.cloud.compute.v1.INetworkInterface|null} [networkInterfaceResource] UpdateNetworkInterfaceInstanceRequest networkInterfaceResource + * @property {string|null} [project] UpdateNetworkInterfaceInstanceRequest project + * @property {string|null} [requestId] UpdateNetworkInterfaceInstanceRequest requestId + * @property {string|null} [zone] UpdateNetworkInterfaceInstanceRequest zone + */ + + /** + * Constructs a new UpdateNetworkInterfaceInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateNetworkInterfaceInstanceRequest. + * @implements IUpdateNetworkInterfaceInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest=} [properties] Properties to set + */ + function UpdateNetworkInterfaceInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateNetworkInterfaceInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + */ + UpdateNetworkInterfaceInstanceRequest.prototype.instance = ""; + + /** + * UpdateNetworkInterfaceInstanceRequest networkInterface. + * @member {string} networkInterface + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + */ + UpdateNetworkInterfaceInstanceRequest.prototype.networkInterface = ""; + + /** + * UpdateNetworkInterfaceInstanceRequest networkInterfaceResource. + * @member {google.cloud.compute.v1.INetworkInterface|null|undefined} networkInterfaceResource + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + */ + UpdateNetworkInterfaceInstanceRequest.prototype.networkInterfaceResource = null; + + /** + * UpdateNetworkInterfaceInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + */ + UpdateNetworkInterfaceInstanceRequest.prototype.project = ""; + + /** + * UpdateNetworkInterfaceInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + */ + UpdateNetworkInterfaceInstanceRequest.prototype.requestId = null; + + /** + * UpdateNetworkInterfaceInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + */ + UpdateNetworkInterfaceInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateNetworkInterfaceInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + */ + Object.defineProperty(UpdateNetworkInterfaceInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateNetworkInterfaceInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest} UpdateNetworkInterfaceInstanceRequest instance + */ + UpdateNetworkInterfaceInstanceRequest.create = function create(properties) { + return new UpdateNetworkInterfaceInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateNetworkInterfaceInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest} message UpdateNetworkInterfaceInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNetworkInterfaceInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkInterfaceResource != null && Object.hasOwnProperty.call(message, "networkInterfaceResource")) + $root.google.cloud.compute.v1.NetworkInterface.encode(message.networkInterfaceResource, writer.uint32(/* id 325814789, wireType 2 =*/2606518314).fork()).ldelim(); + if (message.networkInterface != null && Object.hasOwnProperty.call(message, "networkInterface")) + writer.uint32(/* id 365387880, wireType 2 =*/2923103042).string(message.networkInterface); + return writer; + }; + + /** + * Encodes the specified UpdateNetworkInterfaceInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest} message UpdateNetworkInterfaceInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNetworkInterfaceInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateNetworkInterfaceInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest} UpdateNetworkInterfaceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNetworkInterfaceInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 365387880: + message.networkInterface = reader.string(); + break; + case 325814789: + message.networkInterfaceResource = $root.google.cloud.compute.v1.NetworkInterface.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateNetworkInterfaceInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest} UpdateNetworkInterfaceInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNetworkInterfaceInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateNetworkInterfaceInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateNetworkInterfaceInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + if (!$util.isString(message.networkInterface)) + return "networkInterface: string expected"; + if (message.networkInterfaceResource != null && message.hasOwnProperty("networkInterfaceResource")) { + var error = $root.google.cloud.compute.v1.NetworkInterface.verify(message.networkInterfaceResource); + if (error) + return "networkInterfaceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an UpdateNetworkInterfaceInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest} UpdateNetworkInterfaceInstanceRequest + */ + UpdateNetworkInterfaceInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.networkInterface != null) + message.networkInterface = String(object.networkInterface); + if (object.networkInterfaceResource != null) { + if (typeof object.networkInterfaceResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest.networkInterfaceResource: object expected"); + message.networkInterfaceResource = $root.google.cloud.compute.v1.NetworkInterface.fromObject(object.networkInterfaceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an UpdateNetworkInterfaceInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @static + * @param {google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest} message UpdateNetworkInterfaceInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateNetworkInterfaceInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.networkInterfaceResource = null; + object.networkInterface = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkInterfaceResource != null && message.hasOwnProperty("networkInterfaceResource")) + object.networkInterfaceResource = $root.google.cloud.compute.v1.NetworkInterface.toObject(message.networkInterfaceResource, options); + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) + object.networkInterface = message.networkInterface; + return object; + }; + + /** + * Converts this UpdateNetworkInterfaceInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNetworkInterfaceInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateNetworkInterfaceInstanceRequest; + })(); + + v1.UpdateShieldedInstanceConfigInstanceRequest = (function() { + + /** + * Properties of an UpdateShieldedInstanceConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateShieldedInstanceConfigInstanceRequest + * @property {string|null} [instance] UpdateShieldedInstanceConfigInstanceRequest instance + * @property {string|null} [project] UpdateShieldedInstanceConfigInstanceRequest project + * @property {string|null} [requestId] UpdateShieldedInstanceConfigInstanceRequest requestId + * @property {google.cloud.compute.v1.IShieldedInstanceConfig|null} [shieldedInstanceConfigResource] UpdateShieldedInstanceConfigInstanceRequest shieldedInstanceConfigResource + * @property {string|null} [zone] UpdateShieldedInstanceConfigInstanceRequest zone + */ + + /** + * Constructs a new UpdateShieldedInstanceConfigInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateShieldedInstanceConfigInstanceRequest. + * @implements IUpdateShieldedInstanceConfigInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest=} [properties] Properties to set + */ + function UpdateShieldedInstanceConfigInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateShieldedInstanceConfigInstanceRequest instance. + * @member {string} instance + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @instance + */ + UpdateShieldedInstanceConfigInstanceRequest.prototype.instance = ""; + + /** + * UpdateShieldedInstanceConfigInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @instance + */ + UpdateShieldedInstanceConfigInstanceRequest.prototype.project = ""; + + /** + * UpdateShieldedInstanceConfigInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @instance + */ + UpdateShieldedInstanceConfigInstanceRequest.prototype.requestId = null; + + /** + * UpdateShieldedInstanceConfigInstanceRequest shieldedInstanceConfigResource. + * @member {google.cloud.compute.v1.IShieldedInstanceConfig|null|undefined} shieldedInstanceConfigResource + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @instance + */ + UpdateShieldedInstanceConfigInstanceRequest.prototype.shieldedInstanceConfigResource = null; + + /** + * UpdateShieldedInstanceConfigInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @instance + */ + UpdateShieldedInstanceConfigInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateShieldedInstanceConfigInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @instance + */ + Object.defineProperty(UpdateShieldedInstanceConfigInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateShieldedInstanceConfigInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest} UpdateShieldedInstanceConfigInstanceRequest instance + */ + UpdateShieldedInstanceConfigInstanceRequest.create = function create(properties) { + return new UpdateShieldedInstanceConfigInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateShieldedInstanceConfigInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest} message UpdateShieldedInstanceConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateShieldedInstanceConfigInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + writer.uint32(/* id 18257045, wireType 2 =*/146056362).string(message.instance); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.shieldedInstanceConfigResource != null && Object.hasOwnProperty.call(message, "shieldedInstanceConfigResource")) + $root.google.cloud.compute.v1.ShieldedInstanceConfig.encode(message.shieldedInstanceConfigResource, writer.uint32(/* id 272059224, wireType 2 =*/2176473794).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateShieldedInstanceConfigInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest} message UpdateShieldedInstanceConfigInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateShieldedInstanceConfigInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateShieldedInstanceConfigInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest} UpdateShieldedInstanceConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateShieldedInstanceConfigInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 18257045: + message.instance = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 272059224: + message.shieldedInstanceConfigResource = $root.google.cloud.compute.v1.ShieldedInstanceConfig.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateShieldedInstanceConfigInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest} UpdateShieldedInstanceConfigInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateShieldedInstanceConfigInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateShieldedInstanceConfigInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateShieldedInstanceConfigInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instance != null && message.hasOwnProperty("instance")) + if (!$util.isString(message.instance)) + return "instance: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.shieldedInstanceConfigResource != null && message.hasOwnProperty("shieldedInstanceConfigResource")) { + var error = $root.google.cloud.compute.v1.ShieldedInstanceConfig.verify(message.shieldedInstanceConfigResource); + if (error) + return "shieldedInstanceConfigResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an UpdateShieldedInstanceConfigInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest} UpdateShieldedInstanceConfigInstanceRequest + */ + UpdateShieldedInstanceConfigInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest(); + if (object.instance != null) + message.instance = String(object.instance); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.shieldedInstanceConfigResource != null) { + if (typeof object.shieldedInstanceConfigResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest.shieldedInstanceConfigResource: object expected"); + message.shieldedInstanceConfigResource = $root.google.cloud.compute.v1.ShieldedInstanceConfig.fromObject(object.shieldedInstanceConfigResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an UpdateShieldedInstanceConfigInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @static + * @param {google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest} message UpdateShieldedInstanceConfigInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateShieldedInstanceConfigInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.instance = ""; + object.project = ""; + object.shieldedInstanceConfigResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = message.instance; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.shieldedInstanceConfigResource != null && message.hasOwnProperty("shieldedInstanceConfigResource")) + object.shieldedInstanceConfigResource = $root.google.cloud.compute.v1.ShieldedInstanceConfig.toObject(message.shieldedInstanceConfigResource, options); + return object; + }; + + /** + * Converts this UpdateShieldedInstanceConfigInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateShieldedInstanceConfigInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateShieldedInstanceConfigInstanceRequest; + })(); + + v1.AggregatedListInterconnectAttachmentsRequest = (function() { + + /** + * Properties of an AggregatedListInterconnectAttachmentsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListInterconnectAttachmentsRequest + * @property {string|null} [filter] AggregatedListInterconnectAttachmentsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListInterconnectAttachmentsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListInterconnectAttachmentsRequest maxResults + * @property {string|null} [orderBy] AggregatedListInterconnectAttachmentsRequest orderBy + * @property {string|null} [pageToken] AggregatedListInterconnectAttachmentsRequest pageToken + * @property {string|null} [project] AggregatedListInterconnectAttachmentsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListInterconnectAttachmentsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListInterconnectAttachmentsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListInterconnectAttachmentsRequest. + * @implements IAggregatedListInterconnectAttachmentsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest=} [properties] Properties to set + */ + function AggregatedListInterconnectAttachmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListInterconnectAttachmentsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + AggregatedListInterconnectAttachmentsRequest.prototype.filter = null; + + /** + * AggregatedListInterconnectAttachmentsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + AggregatedListInterconnectAttachmentsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListInterconnectAttachmentsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + AggregatedListInterconnectAttachmentsRequest.prototype.maxResults = null; + + /** + * AggregatedListInterconnectAttachmentsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + AggregatedListInterconnectAttachmentsRequest.prototype.orderBy = null; + + /** + * AggregatedListInterconnectAttachmentsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + AggregatedListInterconnectAttachmentsRequest.prototype.pageToken = null; + + /** + * AggregatedListInterconnectAttachmentsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + AggregatedListInterconnectAttachmentsRequest.prototype.project = ""; + + /** + * AggregatedListInterconnectAttachmentsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + AggregatedListInterconnectAttachmentsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListInterconnectAttachmentsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListInterconnectAttachmentsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInterconnectAttachmentsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListInterconnectAttachmentsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInterconnectAttachmentsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListInterconnectAttachmentsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInterconnectAttachmentsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListInterconnectAttachmentsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInterconnectAttachmentsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListInterconnectAttachmentsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListInterconnectAttachmentsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListInterconnectAttachmentsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListInterconnectAttachmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest} AggregatedListInterconnectAttachmentsRequest instance + */ + AggregatedListInterconnectAttachmentsRequest.create = function create(properties) { + return new AggregatedListInterconnectAttachmentsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListInterconnectAttachmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest} message AggregatedListInterconnectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInterconnectAttachmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListInterconnectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest} message AggregatedListInterconnectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListInterconnectAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListInterconnectAttachmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest} AggregatedListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInterconnectAttachmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListInterconnectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest} AggregatedListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListInterconnectAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListInterconnectAttachmentsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListInterconnectAttachmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListInterconnectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest} AggregatedListInterconnectAttachmentsRequest + */ + AggregatedListInterconnectAttachmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListInterconnectAttachmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest} message AggregatedListInterconnectAttachmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListInterconnectAttachmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListInterconnectAttachmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListInterconnectAttachmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListInterconnectAttachmentsRequest; + })(); + + v1.DeleteInterconnectAttachmentRequest = (function() { + + /** + * Properties of a DeleteInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInterconnectAttachmentRequest + * @property {string|null} [interconnectAttachment] DeleteInterconnectAttachmentRequest interconnectAttachment + * @property {string|null} [project] DeleteInterconnectAttachmentRequest project + * @property {string|null} [region] DeleteInterconnectAttachmentRequest region + * @property {string|null} [requestId] DeleteInterconnectAttachmentRequest requestId + */ + + /** + * Constructs a new DeleteInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInterconnectAttachmentRequest. + * @implements IDeleteInterconnectAttachmentRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest=} [properties] Properties to set + */ + function DeleteInterconnectAttachmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInterconnectAttachmentRequest interconnectAttachment. + * @member {string} interconnectAttachment + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @instance + */ + DeleteInterconnectAttachmentRequest.prototype.interconnectAttachment = ""; + + /** + * DeleteInterconnectAttachmentRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @instance + */ + DeleteInterconnectAttachmentRequest.prototype.project = ""; + + /** + * DeleteInterconnectAttachmentRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @instance + */ + DeleteInterconnectAttachmentRequest.prototype.region = ""; + + /** + * DeleteInterconnectAttachmentRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @instance + */ + DeleteInterconnectAttachmentRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInterconnectAttachmentRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @instance + */ + Object.defineProperty(DeleteInterconnectAttachmentRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInterconnectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInterconnectAttachmentRequest} DeleteInterconnectAttachmentRequest instance + */ + DeleteInterconnectAttachmentRequest.create = function create(properties) { + return new DeleteInterconnectAttachmentRequest(properties); + }; + + /** + * Encodes the specified DeleteInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest} message DeleteInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterconnectAttachmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.interconnectAttachment != null && Object.hasOwnProperty.call(message, "interconnectAttachment")) + writer.uint32(/* id 308135284, wireType 2 =*/2465082274).string(message.interconnectAttachment); + return writer; + }; + + /** + * Encodes the specified DeleteInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest} message DeleteInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterconnectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInterconnectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteInterconnectAttachmentRequest} DeleteInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterconnectAttachmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteInterconnectAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308135284: + message.interconnectAttachment = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteInterconnectAttachmentRequest} DeleteInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterconnectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInterconnectAttachmentRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInterconnectAttachmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) + if (!$util.isString(message.interconnectAttachment)) + return "interconnectAttachment: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInterconnectAttachmentRequest} DeleteInterconnectAttachmentRequest + */ + DeleteInterconnectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInterconnectAttachmentRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInterconnectAttachmentRequest(); + if (object.interconnectAttachment != null) + message.interconnectAttachment = String(object.interconnectAttachment); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.DeleteInterconnectAttachmentRequest} message DeleteInterconnectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInterconnectAttachmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.interconnectAttachment = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) + object.interconnectAttachment = message.interconnectAttachment; + return object; + }; + + /** + * Converts this DeleteInterconnectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInterconnectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInterconnectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInterconnectAttachmentRequest; + })(); + + v1.GetInterconnectAttachmentRequest = (function() { + + /** + * Properties of a GetInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetInterconnectAttachmentRequest + * @property {string|null} [interconnectAttachment] GetInterconnectAttachmentRequest interconnectAttachment + * @property {string|null} [project] GetInterconnectAttachmentRequest project + * @property {string|null} [region] GetInterconnectAttachmentRequest region + */ + + /** + * Constructs a new GetInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetInterconnectAttachmentRequest. + * @implements IGetInterconnectAttachmentRequest + * @constructor + * @param {google.cloud.compute.v1.IGetInterconnectAttachmentRequest=} [properties] Properties to set + */ + function GetInterconnectAttachmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInterconnectAttachmentRequest interconnectAttachment. + * @member {string} interconnectAttachment + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @instance + */ + GetInterconnectAttachmentRequest.prototype.interconnectAttachment = ""; + + /** + * GetInterconnectAttachmentRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @instance + */ + GetInterconnectAttachmentRequest.prototype.project = ""; + + /** + * GetInterconnectAttachmentRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @instance + */ + GetInterconnectAttachmentRequest.prototype.region = ""; + + /** + * Creates a new GetInterconnectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetInterconnectAttachmentRequest} GetInterconnectAttachmentRequest instance + */ + GetInterconnectAttachmentRequest.create = function create(properties) { + return new GetInterconnectAttachmentRequest(properties); + }; + + /** + * Encodes the specified GetInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectAttachmentRequest} message GetInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterconnectAttachmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.interconnectAttachment != null && Object.hasOwnProperty.call(message, "interconnectAttachment")) + writer.uint32(/* id 308135284, wireType 2 =*/2465082274).string(message.interconnectAttachment); + return writer; + }; + + /** + * Encodes the specified GetInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectAttachmentRequest} message GetInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterconnectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInterconnectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetInterconnectAttachmentRequest} GetInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterconnectAttachmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetInterconnectAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308135284: + message.interconnectAttachment = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetInterconnectAttachmentRequest} GetInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterconnectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInterconnectAttachmentRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInterconnectAttachmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) + if (!$util.isString(message.interconnectAttachment)) + return "interconnectAttachment: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetInterconnectAttachmentRequest} GetInterconnectAttachmentRequest + */ + GetInterconnectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetInterconnectAttachmentRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetInterconnectAttachmentRequest(); + if (object.interconnectAttachment != null) + message.interconnectAttachment = String(object.interconnectAttachment); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.GetInterconnectAttachmentRequest} message GetInterconnectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInterconnectAttachmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.interconnectAttachment = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) + object.interconnectAttachment = message.interconnectAttachment; + return object; + }; + + /** + * Converts this GetInterconnectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetInterconnectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetInterconnectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInterconnectAttachmentRequest; + })(); + + v1.InsertInterconnectAttachmentRequest = (function() { + + /** + * Properties of an InsertInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertInterconnectAttachmentRequest + * @property {google.cloud.compute.v1.IInterconnectAttachment|null} [interconnectAttachmentResource] InsertInterconnectAttachmentRequest interconnectAttachmentResource + * @property {string|null} [project] InsertInterconnectAttachmentRequest project + * @property {string|null} [region] InsertInterconnectAttachmentRequest region + * @property {string|null} [requestId] InsertInterconnectAttachmentRequest requestId + * @property {boolean|null} [validateOnly] InsertInterconnectAttachmentRequest validateOnly + */ + + /** + * Constructs a new InsertInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertInterconnectAttachmentRequest. + * @implements IInsertInterconnectAttachmentRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertInterconnectAttachmentRequest=} [properties] Properties to set + */ + function InsertInterconnectAttachmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertInterconnectAttachmentRequest interconnectAttachmentResource. + * @member {google.cloud.compute.v1.IInterconnectAttachment|null|undefined} interconnectAttachmentResource + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + */ + InsertInterconnectAttachmentRequest.prototype.interconnectAttachmentResource = null; + + /** + * InsertInterconnectAttachmentRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + */ + InsertInterconnectAttachmentRequest.prototype.project = ""; + + /** + * InsertInterconnectAttachmentRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + */ + InsertInterconnectAttachmentRequest.prototype.region = ""; + + /** + * InsertInterconnectAttachmentRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + */ + InsertInterconnectAttachmentRequest.prototype.requestId = null; + + /** + * InsertInterconnectAttachmentRequest validateOnly. + * @member {boolean|null|undefined} validateOnly + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + */ + InsertInterconnectAttachmentRequest.prototype.validateOnly = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertInterconnectAttachmentRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + */ + Object.defineProperty(InsertInterconnectAttachmentRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InsertInterconnectAttachmentRequest _validateOnly. + * @member {"validateOnly"|undefined} _validateOnly + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + */ + Object.defineProperty(InsertInterconnectAttachmentRequest.prototype, "_validateOnly", { + get: $util.oneOfGetter($oneOfFields = ["validateOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertInterconnectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IInsertInterconnectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertInterconnectAttachmentRequest} InsertInterconnectAttachmentRequest instance + */ + InsertInterconnectAttachmentRequest.create = function create(properties) { + return new InsertInterconnectAttachmentRequest(properties); + }; + + /** + * Encodes the specified InsertInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IInsertInterconnectAttachmentRequest} message InsertInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInterconnectAttachmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.interconnectAttachmentResource != null && Object.hasOwnProperty.call(message, "interconnectAttachmentResource")) + $root.google.cloud.compute.v1.InterconnectAttachment.encode(message.interconnectAttachmentResource, writer.uint32(/* id 212341369, wireType 2 =*/1698730954).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 242744629, wireType 0 =*/1941957032).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified InsertInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IInsertInterconnectAttachmentRequest} message InsertInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInterconnectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertInterconnectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertInterconnectAttachmentRequest} InsertInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInterconnectAttachmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertInterconnectAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 212341369: + message.interconnectAttachmentResource = $root.google.cloud.compute.v1.InterconnectAttachment.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 242744629: + message.validateOnly = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertInterconnectAttachmentRequest} InsertInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInterconnectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertInterconnectAttachmentRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertInterconnectAttachmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnectAttachmentResource != null && message.hasOwnProperty("interconnectAttachmentResource")) { + var error = $root.google.cloud.compute.v1.InterconnectAttachment.verify(message.interconnectAttachmentResource); + if (error) + return "interconnectAttachmentResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) { + properties._validateOnly = 1; + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + } + return null; + }; + + /** + * Creates an InsertInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertInterconnectAttachmentRequest} InsertInterconnectAttachmentRequest + */ + InsertInterconnectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertInterconnectAttachmentRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertInterconnectAttachmentRequest(); + if (object.interconnectAttachmentResource != null) { + if (typeof object.interconnectAttachmentResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertInterconnectAttachmentRequest.interconnectAttachmentResource: object expected"); + message.interconnectAttachmentResource = $root.google.cloud.compute.v1.InterconnectAttachment.fromObject(object.interconnectAttachmentResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + 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 an InsertInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.InsertInterconnectAttachmentRequest} message InsertInterconnectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertInterconnectAttachmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.interconnectAttachmentResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.interconnectAttachmentResource != null && message.hasOwnProperty("interconnectAttachmentResource")) + object.interconnectAttachmentResource = $root.google.cloud.compute.v1.InterconnectAttachment.toObject(message.interconnectAttachmentResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) { + object.validateOnly = message.validateOnly; + if (options.oneofs) + object._validateOnly = "validateOnly"; + } + return object; + }; + + /** + * Converts this InsertInterconnectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertInterconnectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + InsertInterconnectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertInterconnectAttachmentRequest; + })(); + + v1.ListInterconnectAttachmentsRequest = (function() { + + /** + * Properties of a ListInterconnectAttachmentsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInterconnectAttachmentsRequest + * @property {string|null} [filter] ListInterconnectAttachmentsRequest filter + * @property {number|null} [maxResults] ListInterconnectAttachmentsRequest maxResults + * @property {string|null} [orderBy] ListInterconnectAttachmentsRequest orderBy + * @property {string|null} [pageToken] ListInterconnectAttachmentsRequest pageToken + * @property {string|null} [project] ListInterconnectAttachmentsRequest project + * @property {string|null} [region] ListInterconnectAttachmentsRequest region + * @property {boolean|null} [returnPartialSuccess] ListInterconnectAttachmentsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListInterconnectAttachmentsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInterconnectAttachmentsRequest. + * @implements IListInterconnectAttachmentsRequest + * @constructor + * @param {google.cloud.compute.v1.IListInterconnectAttachmentsRequest=} [properties] Properties to set + */ + function ListInterconnectAttachmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterconnectAttachmentsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + ListInterconnectAttachmentsRequest.prototype.filter = null; + + /** + * ListInterconnectAttachmentsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + ListInterconnectAttachmentsRequest.prototype.maxResults = null; + + /** + * ListInterconnectAttachmentsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + ListInterconnectAttachmentsRequest.prototype.orderBy = null; + + /** + * ListInterconnectAttachmentsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + ListInterconnectAttachmentsRequest.prototype.pageToken = null; + + /** + * ListInterconnectAttachmentsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + ListInterconnectAttachmentsRequest.prototype.project = ""; + + /** + * ListInterconnectAttachmentsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + ListInterconnectAttachmentsRequest.prototype.region = ""; + + /** + * ListInterconnectAttachmentsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + ListInterconnectAttachmentsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInterconnectAttachmentsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(ListInterconnectAttachmentsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectAttachmentsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(ListInterconnectAttachmentsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectAttachmentsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(ListInterconnectAttachmentsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectAttachmentsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(ListInterconnectAttachmentsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectAttachmentsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + */ + Object.defineProperty(ListInterconnectAttachmentsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInterconnectAttachmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectAttachmentsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInterconnectAttachmentsRequest} ListInterconnectAttachmentsRequest instance + */ + ListInterconnectAttachmentsRequest.create = function create(properties) { + return new ListInterconnectAttachmentsRequest(properties); + }; + + /** + * Encodes the specified ListInterconnectAttachmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectAttachmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectAttachmentsRequest} message ListInterconnectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterconnectAttachmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInterconnectAttachmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectAttachmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectAttachmentsRequest} message ListInterconnectAttachmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterconnectAttachmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterconnectAttachmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInterconnectAttachmentsRequest} ListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterconnectAttachmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInterconnectAttachmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterconnectAttachmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInterconnectAttachmentsRequest} ListInterconnectAttachmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterconnectAttachmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterconnectAttachmentsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterconnectAttachmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListInterconnectAttachmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInterconnectAttachmentsRequest} ListInterconnectAttachmentsRequest + */ + ListInterconnectAttachmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInterconnectAttachmentsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInterconnectAttachmentsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListInterconnectAttachmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @static + * @param {google.cloud.compute.v1.ListInterconnectAttachmentsRequest} message ListInterconnectAttachmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterconnectAttachmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInterconnectAttachmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInterconnectAttachmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInterconnectAttachmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInterconnectAttachmentsRequest; + })(); + + v1.PatchInterconnectAttachmentRequest = (function() { + + /** + * Properties of a PatchInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchInterconnectAttachmentRequest + * @property {string|null} [interconnectAttachment] PatchInterconnectAttachmentRequest interconnectAttachment + * @property {google.cloud.compute.v1.IInterconnectAttachment|null} [interconnectAttachmentResource] PatchInterconnectAttachmentRequest interconnectAttachmentResource + * @property {string|null} [project] PatchInterconnectAttachmentRequest project + * @property {string|null} [region] PatchInterconnectAttachmentRequest region + * @property {string|null} [requestId] PatchInterconnectAttachmentRequest requestId + */ + + /** + * Constructs a new PatchInterconnectAttachmentRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchInterconnectAttachmentRequest. + * @implements IPatchInterconnectAttachmentRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchInterconnectAttachmentRequest=} [properties] Properties to set + */ + function PatchInterconnectAttachmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchInterconnectAttachmentRequest interconnectAttachment. + * @member {string} interconnectAttachment + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @instance + */ + PatchInterconnectAttachmentRequest.prototype.interconnectAttachment = ""; + + /** + * PatchInterconnectAttachmentRequest interconnectAttachmentResource. + * @member {google.cloud.compute.v1.IInterconnectAttachment|null|undefined} interconnectAttachmentResource + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @instance + */ + PatchInterconnectAttachmentRequest.prototype.interconnectAttachmentResource = null; + + /** + * PatchInterconnectAttachmentRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @instance + */ + PatchInterconnectAttachmentRequest.prototype.project = ""; + + /** + * PatchInterconnectAttachmentRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @instance + */ + PatchInterconnectAttachmentRequest.prototype.region = ""; + + /** + * PatchInterconnectAttachmentRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @instance + */ + PatchInterconnectAttachmentRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchInterconnectAttachmentRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @instance + */ + Object.defineProperty(PatchInterconnectAttachmentRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchInterconnectAttachmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IPatchInterconnectAttachmentRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchInterconnectAttachmentRequest} PatchInterconnectAttachmentRequest instance + */ + PatchInterconnectAttachmentRequest.create = function create(properties) { + return new PatchInterconnectAttachmentRequest(properties); + }; + + /** + * Encodes the specified PatchInterconnectAttachmentRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectAttachmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IPatchInterconnectAttachmentRequest} message PatchInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInterconnectAttachmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.interconnectAttachmentResource != null && Object.hasOwnProperty.call(message, "interconnectAttachmentResource")) + $root.google.cloud.compute.v1.InterconnectAttachment.encode(message.interconnectAttachmentResource, writer.uint32(/* id 212341369, wireType 2 =*/1698730954).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.interconnectAttachment != null && Object.hasOwnProperty.call(message, "interconnectAttachment")) + writer.uint32(/* id 308135284, wireType 2 =*/2465082274).string(message.interconnectAttachment); + return writer; + }; + + /** + * Encodes the specified PatchInterconnectAttachmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectAttachmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.IPatchInterconnectAttachmentRequest} message PatchInterconnectAttachmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInterconnectAttachmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchInterconnectAttachmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchInterconnectAttachmentRequest} PatchInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInterconnectAttachmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchInterconnectAttachmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308135284: + message.interconnectAttachment = reader.string(); + break; + case 212341369: + message.interconnectAttachmentResource = $root.google.cloud.compute.v1.InterconnectAttachment.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchInterconnectAttachmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchInterconnectAttachmentRequest} PatchInterconnectAttachmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInterconnectAttachmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchInterconnectAttachmentRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchInterconnectAttachmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) + if (!$util.isString(message.interconnectAttachment)) + return "interconnectAttachment: string expected"; + if (message.interconnectAttachmentResource != null && message.hasOwnProperty("interconnectAttachmentResource")) { + var error = $root.google.cloud.compute.v1.InterconnectAttachment.verify(message.interconnectAttachmentResource); + if (error) + return "interconnectAttachmentResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchInterconnectAttachmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchInterconnectAttachmentRequest} PatchInterconnectAttachmentRequest + */ + PatchInterconnectAttachmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchInterconnectAttachmentRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchInterconnectAttachmentRequest(); + if (object.interconnectAttachment != null) + message.interconnectAttachment = String(object.interconnectAttachment); + if (object.interconnectAttachmentResource != null) { + if (typeof object.interconnectAttachmentResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchInterconnectAttachmentRequest.interconnectAttachmentResource: object expected"); + message.interconnectAttachmentResource = $root.google.cloud.compute.v1.InterconnectAttachment.fromObject(object.interconnectAttachmentResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchInterconnectAttachmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @static + * @param {google.cloud.compute.v1.PatchInterconnectAttachmentRequest} message PatchInterconnectAttachmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchInterconnectAttachmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.interconnectAttachmentResource = null; + object.project = ""; + object.interconnectAttachment = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.interconnectAttachmentResource != null && message.hasOwnProperty("interconnectAttachmentResource")) + object.interconnectAttachmentResource = $root.google.cloud.compute.v1.InterconnectAttachment.toObject(message.interconnectAttachmentResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.interconnectAttachment != null && message.hasOwnProperty("interconnectAttachment")) + object.interconnectAttachment = message.interconnectAttachment; + return object; + }; + + /** + * Converts this PatchInterconnectAttachmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchInterconnectAttachmentRequest + * @instance + * @returns {Object.} JSON object + */ + PatchInterconnectAttachmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchInterconnectAttachmentRequest; + })(); + + v1.GetInterconnectLocationRequest = (function() { + + /** + * Properties of a GetInterconnectLocationRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetInterconnectLocationRequest + * @property {string|null} [interconnectLocation] GetInterconnectLocationRequest interconnectLocation + * @property {string|null} [project] GetInterconnectLocationRequest project + */ + + /** + * Constructs a new GetInterconnectLocationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetInterconnectLocationRequest. + * @implements IGetInterconnectLocationRequest + * @constructor + * @param {google.cloud.compute.v1.IGetInterconnectLocationRequest=} [properties] Properties to set + */ + function GetInterconnectLocationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInterconnectLocationRequest interconnectLocation. + * @member {string} interconnectLocation + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @instance + */ + GetInterconnectLocationRequest.prototype.interconnectLocation = ""; + + /** + * GetInterconnectLocationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @instance + */ + GetInterconnectLocationRequest.prototype.project = ""; + + /** + * Creates a new GetInterconnectLocationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectLocationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetInterconnectLocationRequest} GetInterconnectLocationRequest instance + */ + GetInterconnectLocationRequest.create = function create(properties) { + return new GetInterconnectLocationRequest(properties); + }; + + /** + * Encodes the specified GetInterconnectLocationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectLocationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectLocationRequest} message GetInterconnectLocationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterconnectLocationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.interconnectLocation != null && Object.hasOwnProperty.call(message, "interconnectLocation")) + writer.uint32(/* id 492235846, wireType 2 =*/3937886770).string(message.interconnectLocation); + return writer; + }; + + /** + * Encodes the specified GetInterconnectLocationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectLocationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectLocationRequest} message GetInterconnectLocationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterconnectLocationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInterconnectLocationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetInterconnectLocationRequest} GetInterconnectLocationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterconnectLocationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetInterconnectLocationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 492235846: + message.interconnectLocation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInterconnectLocationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetInterconnectLocationRequest} GetInterconnectLocationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterconnectLocationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInterconnectLocationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInterconnectLocationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interconnectLocation != null && message.hasOwnProperty("interconnectLocation")) + if (!$util.isString(message.interconnectLocation)) + return "interconnectLocation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetInterconnectLocationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetInterconnectLocationRequest} GetInterconnectLocationRequest + */ + GetInterconnectLocationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetInterconnectLocationRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetInterconnectLocationRequest(); + if (object.interconnectLocation != null) + message.interconnectLocation = String(object.interconnectLocation); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetInterconnectLocationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @static + * @param {google.cloud.compute.v1.GetInterconnectLocationRequest} message GetInterconnectLocationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInterconnectLocationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.interconnectLocation = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.interconnectLocation != null && message.hasOwnProperty("interconnectLocation")) + object.interconnectLocation = message.interconnectLocation; + return object; + }; + + /** + * Converts this GetInterconnectLocationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetInterconnectLocationRequest + * @instance + * @returns {Object.} JSON object + */ + GetInterconnectLocationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInterconnectLocationRequest; + })(); + + v1.ListInterconnectLocationsRequest = (function() { + + /** + * Properties of a ListInterconnectLocationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInterconnectLocationsRequest + * @property {string|null} [filter] ListInterconnectLocationsRequest filter + * @property {number|null} [maxResults] ListInterconnectLocationsRequest maxResults + * @property {string|null} [orderBy] ListInterconnectLocationsRequest orderBy + * @property {string|null} [pageToken] ListInterconnectLocationsRequest pageToken + * @property {string|null} [project] ListInterconnectLocationsRequest project + * @property {boolean|null} [returnPartialSuccess] ListInterconnectLocationsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListInterconnectLocationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInterconnectLocationsRequest. + * @implements IListInterconnectLocationsRequest + * @constructor + * @param {google.cloud.compute.v1.IListInterconnectLocationsRequest=} [properties] Properties to set + */ + function ListInterconnectLocationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterconnectLocationsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + ListInterconnectLocationsRequest.prototype.filter = null; + + /** + * ListInterconnectLocationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + ListInterconnectLocationsRequest.prototype.maxResults = null; + + /** + * ListInterconnectLocationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + ListInterconnectLocationsRequest.prototype.orderBy = null; + + /** + * ListInterconnectLocationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + ListInterconnectLocationsRequest.prototype.pageToken = null; + + /** + * ListInterconnectLocationsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + ListInterconnectLocationsRequest.prototype.project = ""; + + /** + * ListInterconnectLocationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + ListInterconnectLocationsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInterconnectLocationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + Object.defineProperty(ListInterconnectLocationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectLocationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + Object.defineProperty(ListInterconnectLocationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectLocationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + Object.defineProperty(ListInterconnectLocationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectLocationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + Object.defineProperty(ListInterconnectLocationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectLocationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + */ + Object.defineProperty(ListInterconnectLocationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInterconnectLocationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectLocationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInterconnectLocationsRequest} ListInterconnectLocationsRequest instance + */ + ListInterconnectLocationsRequest.create = function create(properties) { + return new ListInterconnectLocationsRequest(properties); + }; + + /** + * Encodes the specified ListInterconnectLocationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectLocationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectLocationsRequest} message ListInterconnectLocationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterconnectLocationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInterconnectLocationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectLocationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectLocationsRequest} message ListInterconnectLocationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterconnectLocationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterconnectLocationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInterconnectLocationsRequest} ListInterconnectLocationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterconnectLocationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInterconnectLocationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterconnectLocationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInterconnectLocationsRequest} ListInterconnectLocationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterconnectLocationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterconnectLocationsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterconnectLocationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListInterconnectLocationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInterconnectLocationsRequest} ListInterconnectLocationsRequest + */ + ListInterconnectLocationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInterconnectLocationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInterconnectLocationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListInterconnectLocationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @static + * @param {google.cloud.compute.v1.ListInterconnectLocationsRequest} message ListInterconnectLocationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterconnectLocationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInterconnectLocationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInterconnectLocationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInterconnectLocationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInterconnectLocationsRequest; + })(); + + v1.DeleteInterconnectRequest = (function() { + + /** + * Properties of a DeleteInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInterconnectRequest + * @property {string|null} [interconnect] DeleteInterconnectRequest interconnect + * @property {string|null} [project] DeleteInterconnectRequest project + * @property {string|null} [requestId] DeleteInterconnectRequest requestId + */ + + /** + * Constructs a new DeleteInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInterconnectRequest. + * @implements IDeleteInterconnectRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteInterconnectRequest=} [properties] Properties to set + */ + function DeleteInterconnectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInterconnectRequest interconnect. + * @member {string} interconnect + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @instance + */ + DeleteInterconnectRequest.prototype.interconnect = ""; + + /** + * DeleteInterconnectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @instance + */ + DeleteInterconnectRequest.prototype.project = ""; + + /** + * DeleteInterconnectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @instance + */ + DeleteInterconnectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInterconnectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @instance + */ + Object.defineProperty(DeleteInterconnectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInterconnectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInterconnectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInterconnectRequest} DeleteInterconnectRequest instance + */ + DeleteInterconnectRequest.create = function create(properties) { + return new DeleteInterconnectRequest(properties); + }; + + /** + * Encodes the specified DeleteInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInterconnectRequest} message DeleteInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterconnectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.interconnect != null && Object.hasOwnProperty.call(message, "interconnect")) + writer.uint32(/* id 224601230, wireType 2 =*/1796809842).string(message.interconnect); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInterconnectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInterconnectRequest} message DeleteInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInterconnectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInterconnectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteInterconnectRequest} DeleteInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterconnectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteInterconnectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 224601230: + message.interconnect = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInterconnectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteInterconnectRequest} DeleteInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInterconnectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInterconnectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInterconnectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + if (!$util.isString(message.interconnect)) + return "interconnect: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInterconnectRequest} DeleteInterconnectRequest + */ + DeleteInterconnectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInterconnectRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInterconnectRequest(); + if (object.interconnect != null) + message.interconnect = String(object.interconnect); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInterconnectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @static + * @param {google.cloud.compute.v1.DeleteInterconnectRequest} message DeleteInterconnectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInterconnectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interconnect = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + object.interconnect = message.interconnect; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteInterconnectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInterconnectRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInterconnectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInterconnectRequest; + })(); + + v1.GetInterconnectRequest = (function() { + + /** + * Properties of a GetInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetInterconnectRequest + * @property {string|null} [interconnect] GetInterconnectRequest interconnect + * @property {string|null} [project] GetInterconnectRequest project + */ + + /** + * Constructs a new GetInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetInterconnectRequest. + * @implements IGetInterconnectRequest + * @constructor + * @param {google.cloud.compute.v1.IGetInterconnectRequest=} [properties] Properties to set + */ + function GetInterconnectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInterconnectRequest interconnect. + * @member {string} interconnect + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @instance + */ + GetInterconnectRequest.prototype.interconnect = ""; + + /** + * GetInterconnectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @instance + */ + GetInterconnectRequest.prototype.project = ""; + + /** + * Creates a new GetInterconnectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetInterconnectRequest} GetInterconnectRequest instance + */ + GetInterconnectRequest.create = function create(properties) { + return new GetInterconnectRequest(properties); + }; + + /** + * Encodes the specified GetInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectRequest} message GetInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterconnectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interconnect != null && Object.hasOwnProperty.call(message, "interconnect")) + writer.uint32(/* id 224601230, wireType 2 =*/1796809842).string(message.interconnect); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetInterconnectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IGetInterconnectRequest} message GetInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInterconnectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInterconnectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetInterconnectRequest} GetInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterconnectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetInterconnectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 224601230: + message.interconnect = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInterconnectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetInterconnectRequest} GetInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInterconnectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInterconnectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInterconnectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + if (!$util.isString(message.interconnect)) + return "interconnect: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetInterconnectRequest} GetInterconnectRequest + */ + GetInterconnectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetInterconnectRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetInterconnectRequest(); + if (object.interconnect != null) + message.interconnect = String(object.interconnect); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetInterconnectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @static + * @param {google.cloud.compute.v1.GetInterconnectRequest} message GetInterconnectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInterconnectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interconnect = ""; + object.project = ""; + } + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + object.interconnect = message.interconnect; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetInterconnectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetInterconnectRequest + * @instance + * @returns {Object.} JSON object + */ + GetInterconnectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInterconnectRequest; + })(); + + v1.GetDiagnosticsInterconnectRequest = (function() { + + /** + * Properties of a GetDiagnosticsInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetDiagnosticsInterconnectRequest + * @property {string|null} [interconnect] GetDiagnosticsInterconnectRequest interconnect + * @property {string|null} [project] GetDiagnosticsInterconnectRequest project + */ + + /** + * Constructs a new GetDiagnosticsInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetDiagnosticsInterconnectRequest. + * @implements IGetDiagnosticsInterconnectRequest + * @constructor + * @param {google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest=} [properties] Properties to set + */ + function GetDiagnosticsInterconnectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDiagnosticsInterconnectRequest interconnect. + * @member {string} interconnect + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @instance + */ + GetDiagnosticsInterconnectRequest.prototype.interconnect = ""; + + /** + * GetDiagnosticsInterconnectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @instance + */ + GetDiagnosticsInterconnectRequest.prototype.project = ""; + + /** + * Creates a new GetDiagnosticsInterconnectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetDiagnosticsInterconnectRequest} GetDiagnosticsInterconnectRequest instance + */ + GetDiagnosticsInterconnectRequest.create = function create(properties) { + return new GetDiagnosticsInterconnectRequest(properties); + }; + + /** + * Encodes the specified GetDiagnosticsInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.GetDiagnosticsInterconnectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest} message GetDiagnosticsInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDiagnosticsInterconnectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.interconnect != null && Object.hasOwnProperty.call(message, "interconnect")) + writer.uint32(/* id 224601230, wireType 2 =*/1796809842).string(message.interconnect); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetDiagnosticsInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetDiagnosticsInterconnectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest} message GetDiagnosticsInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDiagnosticsInterconnectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDiagnosticsInterconnectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetDiagnosticsInterconnectRequest} GetDiagnosticsInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDiagnosticsInterconnectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetDiagnosticsInterconnectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 224601230: + message.interconnect = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDiagnosticsInterconnectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetDiagnosticsInterconnectRequest} GetDiagnosticsInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDiagnosticsInterconnectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDiagnosticsInterconnectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDiagnosticsInterconnectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + if (!$util.isString(message.interconnect)) + return "interconnect: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetDiagnosticsInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetDiagnosticsInterconnectRequest} GetDiagnosticsInterconnectRequest + */ + GetDiagnosticsInterconnectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetDiagnosticsInterconnectRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetDiagnosticsInterconnectRequest(); + if (object.interconnect != null) + message.interconnect = String(object.interconnect); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetDiagnosticsInterconnectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @static + * @param {google.cloud.compute.v1.GetDiagnosticsInterconnectRequest} message GetDiagnosticsInterconnectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDiagnosticsInterconnectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interconnect = ""; + object.project = ""; + } + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + object.interconnect = message.interconnect; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetDiagnosticsInterconnectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetDiagnosticsInterconnectRequest + * @instance + * @returns {Object.} JSON object + */ + GetDiagnosticsInterconnectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDiagnosticsInterconnectRequest; + })(); + + v1.InsertInterconnectRequest = (function() { + + /** + * Properties of an InsertInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertInterconnectRequest + * @property {google.cloud.compute.v1.IInterconnect|null} [interconnectResource] InsertInterconnectRequest interconnectResource + * @property {string|null} [project] InsertInterconnectRequest project + * @property {string|null} [requestId] InsertInterconnectRequest requestId + */ + + /** + * Constructs a new InsertInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertInterconnectRequest. + * @implements IInsertInterconnectRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertInterconnectRequest=} [properties] Properties to set + */ + function InsertInterconnectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertInterconnectRequest interconnectResource. + * @member {google.cloud.compute.v1.IInterconnect|null|undefined} interconnectResource + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @instance + */ + InsertInterconnectRequest.prototype.interconnectResource = null; + + /** + * InsertInterconnectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @instance + */ + InsertInterconnectRequest.prototype.project = ""; + + /** + * InsertInterconnectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @instance + */ + InsertInterconnectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertInterconnectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @instance + */ + Object.defineProperty(InsertInterconnectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertInterconnectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IInsertInterconnectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertInterconnectRequest} InsertInterconnectRequest instance + */ + InsertInterconnectRequest.create = function create(properties) { + return new InsertInterconnectRequest(properties); + }; + + /** + * Encodes the specified InsertInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IInsertInterconnectRequest} message InsertInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInterconnectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.interconnectResource != null && Object.hasOwnProperty.call(message, "interconnectResource")) + $root.google.cloud.compute.v1.Interconnect.encode(message.interconnectResource, writer.uint32(/* id 397611167, wireType 2 =*/3180889338).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertInterconnectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IInsertInterconnectRequest} message InsertInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertInterconnectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertInterconnectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertInterconnectRequest} InsertInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInterconnectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertInterconnectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 397611167: + message.interconnectResource = $root.google.cloud.compute.v1.Interconnect.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertInterconnectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertInterconnectRequest} InsertInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertInterconnectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertInterconnectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertInterconnectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnectResource != null && message.hasOwnProperty("interconnectResource")) { + var error = $root.google.cloud.compute.v1.Interconnect.verify(message.interconnectResource); + if (error) + return "interconnectResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertInterconnectRequest} InsertInterconnectRequest + */ + InsertInterconnectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertInterconnectRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertInterconnectRequest(); + if (object.interconnectResource != null) { + if (typeof object.interconnectResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertInterconnectRequest.interconnectResource: object expected"); + message.interconnectResource = $root.google.cloud.compute.v1.Interconnect.fromObject(object.interconnectResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertInterconnectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @static + * @param {google.cloud.compute.v1.InsertInterconnectRequest} message InsertInterconnectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertInterconnectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.interconnectResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.interconnectResource != null && message.hasOwnProperty("interconnectResource")) + object.interconnectResource = $root.google.cloud.compute.v1.Interconnect.toObject(message.interconnectResource, options); + return object; + }; + + /** + * Converts this InsertInterconnectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertInterconnectRequest + * @instance + * @returns {Object.} JSON object + */ + InsertInterconnectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertInterconnectRequest; + })(); + + v1.ListInterconnectsRequest = (function() { + + /** + * Properties of a ListInterconnectsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInterconnectsRequest + * @property {string|null} [filter] ListInterconnectsRequest filter + * @property {number|null} [maxResults] ListInterconnectsRequest maxResults + * @property {string|null} [orderBy] ListInterconnectsRequest orderBy + * @property {string|null} [pageToken] ListInterconnectsRequest pageToken + * @property {string|null} [project] ListInterconnectsRequest project + * @property {boolean|null} [returnPartialSuccess] ListInterconnectsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListInterconnectsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInterconnectsRequest. + * @implements IListInterconnectsRequest + * @constructor + * @param {google.cloud.compute.v1.IListInterconnectsRequest=} [properties] Properties to set + */ + function ListInterconnectsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInterconnectsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + ListInterconnectsRequest.prototype.filter = null; + + /** + * ListInterconnectsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + ListInterconnectsRequest.prototype.maxResults = null; + + /** + * ListInterconnectsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + ListInterconnectsRequest.prototype.orderBy = null; + + /** + * ListInterconnectsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + ListInterconnectsRequest.prototype.pageToken = null; + + /** + * ListInterconnectsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + ListInterconnectsRequest.prototype.project = ""; + + /** + * ListInterconnectsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + ListInterconnectsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInterconnectsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + Object.defineProperty(ListInterconnectsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + Object.defineProperty(ListInterconnectsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + Object.defineProperty(ListInterconnectsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + Object.defineProperty(ListInterconnectsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInterconnectsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + */ + Object.defineProperty(ListInterconnectsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInterconnectsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInterconnectsRequest} ListInterconnectsRequest instance + */ + ListInterconnectsRequest.create = function create(properties) { + return new ListInterconnectsRequest(properties); + }; + + /** + * Encodes the specified ListInterconnectsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectsRequest} message ListInterconnectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterconnectsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInterconnectsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInterconnectsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {google.cloud.compute.v1.IListInterconnectsRequest} message ListInterconnectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInterconnectsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInterconnectsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInterconnectsRequest} ListInterconnectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterconnectsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInterconnectsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInterconnectsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInterconnectsRequest} ListInterconnectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInterconnectsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInterconnectsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInterconnectsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListInterconnectsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInterconnectsRequest} ListInterconnectsRequest + */ + ListInterconnectsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInterconnectsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInterconnectsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListInterconnectsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @static + * @param {google.cloud.compute.v1.ListInterconnectsRequest} message ListInterconnectsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInterconnectsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInterconnectsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInterconnectsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInterconnectsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInterconnectsRequest; + })(); + + v1.PatchInterconnectRequest = (function() { + + /** + * Properties of a PatchInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchInterconnectRequest + * @property {string|null} [interconnect] PatchInterconnectRequest interconnect + * @property {google.cloud.compute.v1.IInterconnect|null} [interconnectResource] PatchInterconnectRequest interconnectResource + * @property {string|null} [project] PatchInterconnectRequest project + * @property {string|null} [requestId] PatchInterconnectRequest requestId + */ + + /** + * Constructs a new PatchInterconnectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchInterconnectRequest. + * @implements IPatchInterconnectRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchInterconnectRequest=} [properties] Properties to set + */ + function PatchInterconnectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchInterconnectRequest interconnect. + * @member {string} interconnect + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @instance + */ + PatchInterconnectRequest.prototype.interconnect = ""; + + /** + * PatchInterconnectRequest interconnectResource. + * @member {google.cloud.compute.v1.IInterconnect|null|undefined} interconnectResource + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @instance + */ + PatchInterconnectRequest.prototype.interconnectResource = null; + + /** + * PatchInterconnectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @instance + */ + PatchInterconnectRequest.prototype.project = ""; + + /** + * PatchInterconnectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @instance + */ + PatchInterconnectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchInterconnectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @instance + */ + Object.defineProperty(PatchInterconnectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchInterconnectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IPatchInterconnectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchInterconnectRequest} PatchInterconnectRequest instance + */ + PatchInterconnectRequest.create = function create(properties) { + return new PatchInterconnectRequest(properties); + }; + + /** + * Encodes the specified PatchInterconnectRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IPatchInterconnectRequest} message PatchInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInterconnectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.interconnect != null && Object.hasOwnProperty.call(message, "interconnect")) + writer.uint32(/* id 224601230, wireType 2 =*/1796809842).string(message.interconnect); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.interconnectResource != null && Object.hasOwnProperty.call(message, "interconnectResource")) + $root.google.cloud.compute.v1.Interconnect.encode(message.interconnectResource, writer.uint32(/* id 397611167, wireType 2 =*/3180889338).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchInterconnectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchInterconnectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {google.cloud.compute.v1.IPatchInterconnectRequest} message PatchInterconnectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchInterconnectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchInterconnectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchInterconnectRequest} PatchInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInterconnectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchInterconnectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 224601230: + message.interconnect = reader.string(); + break; + case 397611167: + message.interconnectResource = $root.google.cloud.compute.v1.Interconnect.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchInterconnectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchInterconnectRequest} PatchInterconnectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchInterconnectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchInterconnectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchInterconnectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + if (!$util.isString(message.interconnect)) + return "interconnect: string expected"; + if (message.interconnectResource != null && message.hasOwnProperty("interconnectResource")) { + var error = $root.google.cloud.compute.v1.Interconnect.verify(message.interconnectResource); + if (error) + return "interconnectResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchInterconnectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchInterconnectRequest} PatchInterconnectRequest + */ + PatchInterconnectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchInterconnectRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchInterconnectRequest(); + if (object.interconnect != null) + message.interconnect = String(object.interconnect); + if (object.interconnectResource != null) { + if (typeof object.interconnectResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchInterconnectRequest.interconnectResource: object expected"); + message.interconnectResource = $root.google.cloud.compute.v1.Interconnect.fromObject(object.interconnectResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchInterconnectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @static + * @param {google.cloud.compute.v1.PatchInterconnectRequest} message PatchInterconnectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchInterconnectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.interconnect = ""; + object.project = ""; + object.interconnectResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.interconnect != null && message.hasOwnProperty("interconnect")) + object.interconnect = message.interconnect; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.interconnectResource != null && message.hasOwnProperty("interconnectResource")) + object.interconnectResource = $root.google.cloud.compute.v1.Interconnect.toObject(message.interconnectResource, options); + return object; + }; + + /** + * Converts this PatchInterconnectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchInterconnectRequest + * @instance + * @returns {Object.} JSON object + */ + PatchInterconnectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchInterconnectRequest; + })(); + + v1.GetLicenseCodeRequest = (function() { + + /** + * Properties of a GetLicenseCodeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetLicenseCodeRequest + * @property {string|null} [licenseCode] GetLicenseCodeRequest licenseCode + * @property {string|null} [project] GetLicenseCodeRequest project + */ + + /** + * Constructs a new GetLicenseCodeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetLicenseCodeRequest. + * @implements IGetLicenseCodeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetLicenseCodeRequest=} [properties] Properties to set + */ + function GetLicenseCodeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLicenseCodeRequest licenseCode. + * @member {string} licenseCode + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @instance + */ + GetLicenseCodeRequest.prototype.licenseCode = ""; + + /** + * GetLicenseCodeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @instance + */ + GetLicenseCodeRequest.prototype.project = ""; + + /** + * Creates a new GetLicenseCodeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.IGetLicenseCodeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetLicenseCodeRequest} GetLicenseCodeRequest instance + */ + GetLicenseCodeRequest.create = function create(properties) { + return new GetLicenseCodeRequest(properties); + }; + + /** + * Encodes the specified GetLicenseCodeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetLicenseCodeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.IGetLicenseCodeRequest} message GetLicenseCodeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLicenseCodeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.licenseCode != null && Object.hasOwnProperty.call(message, "licenseCode")) + writer.uint32(/* id 1467179, wireType 2 =*/11737434).string(message.licenseCode); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetLicenseCodeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetLicenseCodeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.IGetLicenseCodeRequest} message GetLicenseCodeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLicenseCodeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLicenseCodeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetLicenseCodeRequest} GetLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLicenseCodeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetLicenseCodeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1467179: + message.licenseCode = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLicenseCodeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetLicenseCodeRequest} GetLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLicenseCodeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLicenseCodeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLicenseCodeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.licenseCode != null && message.hasOwnProperty("licenseCode")) + if (!$util.isString(message.licenseCode)) + return "licenseCode: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetLicenseCodeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetLicenseCodeRequest} GetLicenseCodeRequest + */ + GetLicenseCodeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetLicenseCodeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetLicenseCodeRequest(); + if (object.licenseCode != null) + message.licenseCode = String(object.licenseCode); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetLicenseCodeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.GetLicenseCodeRequest} message GetLicenseCodeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLicenseCodeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.licenseCode = ""; + object.project = ""; + } + if (message.licenseCode != null && message.hasOwnProperty("licenseCode")) + object.licenseCode = message.licenseCode; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetLicenseCodeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetLicenseCodeRequest + * @instance + * @returns {Object.} JSON object + */ + GetLicenseCodeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetLicenseCodeRequest; + })(); + + v1.TestIamPermissionsLicenseCodeRequest = (function() { + + /** + * Properties of a TestIamPermissionsLicenseCodeRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsLicenseCodeRequest + * @property {string|null} [project] TestIamPermissionsLicenseCodeRequest project + * @property {string|null} [resource] TestIamPermissionsLicenseCodeRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsLicenseCodeRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsLicenseCodeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsLicenseCodeRequest. + * @implements ITestIamPermissionsLicenseCodeRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest=} [properties] Properties to set + */ + function TestIamPermissionsLicenseCodeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsLicenseCodeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @instance + */ + TestIamPermissionsLicenseCodeRequest.prototype.project = ""; + + /** + * TestIamPermissionsLicenseCodeRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @instance + */ + TestIamPermissionsLicenseCodeRequest.prototype.resource = ""; + + /** + * TestIamPermissionsLicenseCodeRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @instance + */ + TestIamPermissionsLicenseCodeRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsLicenseCodeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest} TestIamPermissionsLicenseCodeRequest instance + */ + TestIamPermissionsLicenseCodeRequest.create = function create(properties) { + return new TestIamPermissionsLicenseCodeRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsLicenseCodeRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest} message TestIamPermissionsLicenseCodeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsLicenseCodeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsLicenseCodeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest} message TestIamPermissionsLicenseCodeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsLicenseCodeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsLicenseCodeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest} TestIamPermissionsLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsLicenseCodeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsLicenseCodeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest} TestIamPermissionsLicenseCodeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsLicenseCodeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsLicenseCodeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsLicenseCodeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsLicenseCodeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest} TestIamPermissionsLicenseCodeRequest + */ + TestIamPermissionsLicenseCodeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsLicenseCodeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest} message TestIamPermissionsLicenseCodeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsLicenseCodeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsLicenseCodeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsLicenseCodeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsLicenseCodeRequest; + })(); + + v1.DeleteLicenseRequest = (function() { + + /** + * Properties of a DeleteLicenseRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteLicenseRequest + * @property {string|null} [license] DeleteLicenseRequest license + * @property {string|null} [project] DeleteLicenseRequest project + * @property {string|null} [requestId] DeleteLicenseRequest requestId + */ + + /** + * Constructs a new DeleteLicenseRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteLicenseRequest. + * @implements IDeleteLicenseRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteLicenseRequest=} [properties] Properties to set + */ + function DeleteLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteLicenseRequest license. + * @member {string} license + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @instance + */ + DeleteLicenseRequest.prototype.license = ""; + + /** + * DeleteLicenseRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @instance + */ + DeleteLicenseRequest.prototype.project = ""; + + /** + * DeleteLicenseRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @instance + */ + DeleteLicenseRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteLicenseRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @instance + */ + Object.defineProperty(DeleteLicenseRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteLicenseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {google.cloud.compute.v1.IDeleteLicenseRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteLicenseRequest} DeleteLicenseRequest instance + */ + DeleteLicenseRequest.create = function create(properties) { + return new DeleteLicenseRequest(properties); + }; + + /** + * Encodes the specified DeleteLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {google.cloud.compute.v1.IDeleteLicenseRequest} message DeleteLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.license != null && Object.hasOwnProperty.call(message, "license")) + writer.uint32(/* id 166757441, wireType 2 =*/1334059530).string(message.license); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {google.cloud.compute.v1.IDeleteLicenseRequest} message DeleteLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteLicenseRequest} DeleteLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLicenseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 166757441: + message.license = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteLicenseRequest} DeleteLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteLicenseRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.license != null && message.hasOwnProperty("license")) + if (!$util.isString(message.license)) + return "license: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteLicenseRequest} DeleteLicenseRequest + */ + DeleteLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteLicenseRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteLicenseRequest(); + if (object.license != null) + message.license = String(object.license); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @static + * @param {google.cloud.compute.v1.DeleteLicenseRequest} message DeleteLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.license = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.license != null && message.hasOwnProperty("license")) + object.license = message.license; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteLicenseRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteLicenseRequest; + })(); + + v1.GetLicenseRequest = (function() { + + /** + * Properties of a GetLicenseRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetLicenseRequest + * @property {string|null} [license] GetLicenseRequest license + * @property {string|null} [project] GetLicenseRequest project + */ + + /** + * Constructs a new GetLicenseRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetLicenseRequest. + * @implements IGetLicenseRequest + * @constructor + * @param {google.cloud.compute.v1.IGetLicenseRequest=} [properties] Properties to set + */ + function GetLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetLicenseRequest license. + * @member {string} license + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @instance + */ + GetLicenseRequest.prototype.license = ""; + + /** + * GetLicenseRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @instance + */ + GetLicenseRequest.prototype.project = ""; + + /** + * Creates a new GetLicenseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {google.cloud.compute.v1.IGetLicenseRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetLicenseRequest} GetLicenseRequest instance + */ + GetLicenseRequest.create = function create(properties) { + return new GetLicenseRequest(properties); + }; + + /** + * Encodes the specified GetLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.GetLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {google.cloud.compute.v1.IGetLicenseRequest} message GetLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.license != null && Object.hasOwnProperty.call(message, "license")) + writer.uint32(/* id 166757441, wireType 2 =*/1334059530).string(message.license); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {google.cloud.compute.v1.IGetLicenseRequest} message GetLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetLicenseRequest} GetLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLicenseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 166757441: + message.license = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetLicenseRequest} GetLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetLicenseRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.license != null && message.hasOwnProperty("license")) + if (!$util.isString(message.license)) + return "license: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetLicenseRequest} GetLicenseRequest + */ + GetLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetLicenseRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetLicenseRequest(); + if (object.license != null) + message.license = String(object.license); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @static + * @param {google.cloud.compute.v1.GetLicenseRequest} message GetLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.license = ""; + object.project = ""; + } + if (message.license != null && message.hasOwnProperty("license")) + object.license = message.license; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetLicenseRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + GetLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetLicenseRequest; + })(); + + v1.GetIamPolicyLicenseRequest = (function() { + + /** + * Properties of a GetIamPolicyLicenseRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyLicenseRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyLicenseRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyLicenseRequest project + * @property {string|null} [resource] GetIamPolicyLicenseRequest resource + */ + + /** + * Constructs a new GetIamPolicyLicenseRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyLicenseRequest. + * @implements IGetIamPolicyLicenseRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyLicenseRequest=} [properties] Properties to set + */ + function GetIamPolicyLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyLicenseRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @instance + */ + GetIamPolicyLicenseRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyLicenseRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @instance + */ + GetIamPolicyLicenseRequest.prototype.project = ""; + + /** + * GetIamPolicyLicenseRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @instance + */ + GetIamPolicyLicenseRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyLicenseRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @instance + */ + Object.defineProperty(GetIamPolicyLicenseRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyLicenseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyLicenseRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyLicenseRequest} GetIamPolicyLicenseRequest instance + */ + GetIamPolicyLicenseRequest.create = function create(properties) { + return new GetIamPolicyLicenseRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyLicenseRequest} message GetIamPolicyLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyLicenseRequest} message GetIamPolicyLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyLicenseRequest} GetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyLicenseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyLicenseRequest} GetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyLicenseRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyLicenseRequest} GetIamPolicyLicenseRequest + */ + GetIamPolicyLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyLicenseRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyLicenseRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyLicenseRequest} message GetIamPolicyLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyLicenseRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyLicenseRequest; + })(); + + v1.InsertLicenseRequest = (function() { + + /** + * Properties of an InsertLicenseRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertLicenseRequest + * @property {google.cloud.compute.v1.ILicense|null} [licenseResource] InsertLicenseRequest licenseResource + * @property {string|null} [project] InsertLicenseRequest project + * @property {string|null} [requestId] InsertLicenseRequest requestId + */ + + /** + * Constructs a new InsertLicenseRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertLicenseRequest. + * @implements IInsertLicenseRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertLicenseRequest=} [properties] Properties to set + */ + function InsertLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertLicenseRequest licenseResource. + * @member {google.cloud.compute.v1.ILicense|null|undefined} licenseResource + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @instance + */ + InsertLicenseRequest.prototype.licenseResource = null; + + /** + * InsertLicenseRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @instance + */ + InsertLicenseRequest.prototype.project = ""; + + /** + * InsertLicenseRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @instance + */ + InsertLicenseRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertLicenseRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @instance + */ + Object.defineProperty(InsertLicenseRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertLicenseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {google.cloud.compute.v1.IInsertLicenseRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertLicenseRequest} InsertLicenseRequest instance + */ + InsertLicenseRequest.create = function create(properties) { + return new InsertLicenseRequest(properties); + }; + + /** + * Encodes the specified InsertLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {google.cloud.compute.v1.IInsertLicenseRequest} message InsertLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.licenseResource != null && Object.hasOwnProperty.call(message, "licenseResource")) + $root.google.cloud.compute.v1.License.encode(message.licenseResource, writer.uint32(/* id 437955148, wireType 2 =*/3503641186).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {google.cloud.compute.v1.IInsertLicenseRequest} message InsertLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertLicenseRequest} InsertLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertLicenseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 437955148: + message.licenseResource = $root.google.cloud.compute.v1.License.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertLicenseRequest} InsertLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertLicenseRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.licenseResource != null && message.hasOwnProperty("licenseResource")) { + var error = $root.google.cloud.compute.v1.License.verify(message.licenseResource); + if (error) + return "licenseResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertLicenseRequest} InsertLicenseRequest + */ + InsertLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertLicenseRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertLicenseRequest(); + if (object.licenseResource != null) { + if (typeof object.licenseResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertLicenseRequest.licenseResource: object expected"); + message.licenseResource = $root.google.cloud.compute.v1.License.fromObject(object.licenseResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @static + * @param {google.cloud.compute.v1.InsertLicenseRequest} message InsertLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.licenseResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.licenseResource != null && message.hasOwnProperty("licenseResource")) + object.licenseResource = $root.google.cloud.compute.v1.License.toObject(message.licenseResource, options); + return object; + }; + + /** + * Converts this InsertLicenseRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + InsertLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertLicenseRequest; + })(); + + v1.ListLicensesRequest = (function() { + + /** + * Properties of a ListLicensesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListLicensesRequest + * @property {string|null} [filter] ListLicensesRequest filter + * @property {number|null} [maxResults] ListLicensesRequest maxResults + * @property {string|null} [orderBy] ListLicensesRequest orderBy + * @property {string|null} [pageToken] ListLicensesRequest pageToken + * @property {string|null} [project] ListLicensesRequest project + * @property {boolean|null} [returnPartialSuccess] ListLicensesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListLicensesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListLicensesRequest. + * @implements IListLicensesRequest + * @constructor + * @param {google.cloud.compute.v1.IListLicensesRequest=} [properties] Properties to set + */ + function ListLicensesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListLicensesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + ListLicensesRequest.prototype.filter = null; + + /** + * ListLicensesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + ListLicensesRequest.prototype.maxResults = null; + + /** + * ListLicensesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + ListLicensesRequest.prototype.orderBy = null; + + /** + * ListLicensesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + ListLicensesRequest.prototype.pageToken = null; + + /** + * ListLicensesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + ListLicensesRequest.prototype.project = ""; + + /** + * ListLicensesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + ListLicensesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListLicensesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + Object.defineProperty(ListLicensesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListLicensesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + Object.defineProperty(ListLicensesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListLicensesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + Object.defineProperty(ListLicensesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListLicensesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + Object.defineProperty(ListLicensesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListLicensesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + */ + Object.defineProperty(ListLicensesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListLicensesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {google.cloud.compute.v1.IListLicensesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListLicensesRequest} ListLicensesRequest instance + */ + ListLicensesRequest.create = function create(properties) { + return new ListLicensesRequest(properties); + }; + + /** + * Encodes the specified ListLicensesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListLicensesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {google.cloud.compute.v1.IListLicensesRequest} message ListLicensesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLicensesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListLicensesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListLicensesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {google.cloud.compute.v1.IListLicensesRequest} message ListLicensesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListLicensesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListLicensesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListLicensesRequest} ListLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLicensesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListLicensesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListLicensesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListLicensesRequest} ListLicensesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListLicensesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListLicensesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListLicensesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListLicensesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListLicensesRequest} ListLicensesRequest + */ + ListLicensesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListLicensesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListLicensesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListLicensesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @static + * @param {google.cloud.compute.v1.ListLicensesRequest} message ListLicensesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListLicensesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListLicensesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListLicensesRequest + * @instance + * @returns {Object.} JSON object + */ + ListLicensesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListLicensesRequest; + })(); + + v1.SetIamPolicyLicenseRequest = (function() { + + /** + * Properties of a SetIamPolicyLicenseRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyLicenseRequest + * @property {google.cloud.compute.v1.IGlobalSetPolicyRequest|null} [globalSetPolicyRequestResource] SetIamPolicyLicenseRequest globalSetPolicyRequestResource + * @property {string|null} [project] SetIamPolicyLicenseRequest project + * @property {string|null} [resource] SetIamPolicyLicenseRequest resource + */ + + /** + * Constructs a new SetIamPolicyLicenseRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyLicenseRequest. + * @implements ISetIamPolicyLicenseRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyLicenseRequest=} [properties] Properties to set + */ + function SetIamPolicyLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyLicenseRequest globalSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetPolicyRequest|null|undefined} globalSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @instance + */ + SetIamPolicyLicenseRequest.prototype.globalSetPolicyRequestResource = null; + + /** + * SetIamPolicyLicenseRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @instance + */ + SetIamPolicyLicenseRequest.prototype.project = ""; + + /** + * SetIamPolicyLicenseRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @instance + */ + SetIamPolicyLicenseRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicyLicenseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyLicenseRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyLicenseRequest} SetIamPolicyLicenseRequest instance + */ + SetIamPolicyLicenseRequest.create = function create(properties) { + return new SetIamPolicyLicenseRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyLicenseRequest} message SetIamPolicyLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "globalSetPolicyRequestResource")) + $root.google.cloud.compute.v1.GlobalSetPolicyRequest.encode(message.globalSetPolicyRequestResource, writer.uint32(/* id 337048498, wireType 2 =*/2696387986).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyLicenseRequest} message SetIamPolicyLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyLicenseRequest} SetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyLicenseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 337048498: + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyLicenseRequest} SetIamPolicyLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyLicenseRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.verify(message.globalSetPolicyRequestResource); + if (error) + return "globalSetPolicyRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicyLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyLicenseRequest} SetIamPolicyLicenseRequest + */ + SetIamPolicyLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyLicenseRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyLicenseRequest(); + if (object.globalSetPolicyRequestResource != null) { + if (typeof object.globalSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyLicenseRequest.globalSetPolicyRequestResource: object expected"); + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.fromObject(object.globalSetPolicyRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyLicenseRequest} message SetIamPolicyLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetPolicyRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) + object.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.toObject(message.globalSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyLicenseRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyLicenseRequest; + })(); + + v1.TestIamPermissionsLicenseRequest = (function() { + + /** + * Properties of a TestIamPermissionsLicenseRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsLicenseRequest + * @property {string|null} [project] TestIamPermissionsLicenseRequest project + * @property {string|null} [resource] TestIamPermissionsLicenseRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsLicenseRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsLicenseRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsLicenseRequest. + * @implements ITestIamPermissionsLicenseRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseRequest=} [properties] Properties to set + */ + function TestIamPermissionsLicenseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsLicenseRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @instance + */ + TestIamPermissionsLicenseRequest.prototype.project = ""; + + /** + * TestIamPermissionsLicenseRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @instance + */ + TestIamPermissionsLicenseRequest.prototype.resource = ""; + + /** + * TestIamPermissionsLicenseRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @instance + */ + TestIamPermissionsLicenseRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsLicenseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseRequest} TestIamPermissionsLicenseRequest instance + */ + TestIamPermissionsLicenseRequest.create = function create(properties) { + return new TestIamPermissionsLicenseRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsLicenseRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseRequest} message TestIamPermissionsLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsLicenseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsLicenseRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsLicenseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseRequest} message TestIamPermissionsLicenseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsLicenseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsLicenseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseRequest} TestIamPermissionsLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsLicenseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsLicenseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsLicenseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseRequest} TestIamPermissionsLicenseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsLicenseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsLicenseRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsLicenseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsLicenseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsLicenseRequest} TestIamPermissionsLicenseRequest + */ + TestIamPermissionsLicenseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsLicenseRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsLicenseRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsLicenseRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsLicenseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsLicenseRequest} message TestIamPermissionsLicenseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsLicenseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsLicenseRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsLicenseRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsLicenseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsLicenseRequest; + })(); + + v1.AggregatedListMachineTypesRequest = (function() { + + /** + * Properties of an AggregatedListMachineTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListMachineTypesRequest + * @property {string|null} [filter] AggregatedListMachineTypesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListMachineTypesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListMachineTypesRequest maxResults + * @property {string|null} [orderBy] AggregatedListMachineTypesRequest orderBy + * @property {string|null} [pageToken] AggregatedListMachineTypesRequest pageToken + * @property {string|null} [project] AggregatedListMachineTypesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListMachineTypesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListMachineTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListMachineTypesRequest. + * @implements IAggregatedListMachineTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListMachineTypesRequest=} [properties] Properties to set + */ + function AggregatedListMachineTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListMachineTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + AggregatedListMachineTypesRequest.prototype.filter = null; + + /** + * AggregatedListMachineTypesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + AggregatedListMachineTypesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListMachineTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + AggregatedListMachineTypesRequest.prototype.maxResults = null; + + /** + * AggregatedListMachineTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + AggregatedListMachineTypesRequest.prototype.orderBy = null; + + /** + * AggregatedListMachineTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + AggregatedListMachineTypesRequest.prototype.pageToken = null; + + /** + * AggregatedListMachineTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + AggregatedListMachineTypesRequest.prototype.project = ""; + + /** + * AggregatedListMachineTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + AggregatedListMachineTypesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListMachineTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListMachineTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListMachineTypesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListMachineTypesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListMachineTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListMachineTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListMachineTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListMachineTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListMachineTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListMachineTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListMachineTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListMachineTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListMachineTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListMachineTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListMachineTypesRequest} AggregatedListMachineTypesRequest instance + */ + AggregatedListMachineTypesRequest.create = function create(properties) { + return new AggregatedListMachineTypesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListMachineTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListMachineTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListMachineTypesRequest} message AggregatedListMachineTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListMachineTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListMachineTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListMachineTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListMachineTypesRequest} message AggregatedListMachineTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListMachineTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListMachineTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListMachineTypesRequest} AggregatedListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListMachineTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListMachineTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListMachineTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListMachineTypesRequest} AggregatedListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListMachineTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListMachineTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListMachineTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListMachineTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListMachineTypesRequest} AggregatedListMachineTypesRequest + */ + AggregatedListMachineTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListMachineTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListMachineTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListMachineTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListMachineTypesRequest} message AggregatedListMachineTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListMachineTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListMachineTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListMachineTypesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListMachineTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListMachineTypesRequest; + })(); + + v1.GetMachineTypeRequest = (function() { + + /** + * Properties of a GetMachineTypeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetMachineTypeRequest + * @property {string|null} [machineType] GetMachineTypeRequest machineType + * @property {string|null} [project] GetMachineTypeRequest project + * @property {string|null} [zone] GetMachineTypeRequest zone + */ + + /** + * Constructs a new GetMachineTypeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetMachineTypeRequest. + * @implements IGetMachineTypeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetMachineTypeRequest=} [properties] Properties to set + */ + function GetMachineTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMachineTypeRequest machineType. + * @member {string} machineType + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @instance + */ + GetMachineTypeRequest.prototype.machineType = ""; + + /** + * GetMachineTypeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @instance + */ + GetMachineTypeRequest.prototype.project = ""; + + /** + * GetMachineTypeRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @instance + */ + GetMachineTypeRequest.prototype.zone = ""; + + /** + * Creates a new GetMachineTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetMachineTypeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetMachineTypeRequest} GetMachineTypeRequest instance + */ + GetMachineTypeRequest.create = function create(properties) { + return new GetMachineTypeRequest(properties); + }; + + /** + * Encodes the specified GetMachineTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetMachineTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetMachineTypeRequest} message GetMachineTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMachineTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 227711026, wireType 2 =*/1821688210).string(message.machineType); + return writer; + }; + + /** + * Encodes the specified GetMachineTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetMachineTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetMachineTypeRequest} message GetMachineTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMachineTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMachineTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetMachineTypeRequest} GetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMachineTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetMachineTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227711026: + message.machineType = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetMachineTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetMachineTypeRequest} GetMachineTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMachineTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMachineTypeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMachineTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetMachineTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetMachineTypeRequest} GetMachineTypeRequest + */ + GetMachineTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetMachineTypeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetMachineTypeRequest(); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetMachineTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @static + * @param {google.cloud.compute.v1.GetMachineTypeRequest} message GetMachineTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMachineTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.machineType = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + return object; + }; + + /** + * Converts this GetMachineTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetMachineTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetMachineTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetMachineTypeRequest; + })(); + + v1.ListMachineTypesRequest = (function() { + + /** + * Properties of a ListMachineTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListMachineTypesRequest + * @property {string|null} [filter] ListMachineTypesRequest filter + * @property {number|null} [maxResults] ListMachineTypesRequest maxResults + * @property {string|null} [orderBy] ListMachineTypesRequest orderBy + * @property {string|null} [pageToken] ListMachineTypesRequest pageToken + * @property {string|null} [project] ListMachineTypesRequest project + * @property {boolean|null} [returnPartialSuccess] ListMachineTypesRequest returnPartialSuccess + * @property {string|null} [zone] ListMachineTypesRequest zone + */ + + /** + * Constructs a new ListMachineTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListMachineTypesRequest. + * @implements IListMachineTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IListMachineTypesRequest=} [properties] Properties to set + */ + function ListMachineTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMachineTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + ListMachineTypesRequest.prototype.filter = null; + + /** + * ListMachineTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + ListMachineTypesRequest.prototype.maxResults = null; + + /** + * ListMachineTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + ListMachineTypesRequest.prototype.orderBy = null; + + /** + * ListMachineTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + ListMachineTypesRequest.prototype.pageToken = null; + + /** + * ListMachineTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + ListMachineTypesRequest.prototype.project = ""; + + /** + * ListMachineTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + ListMachineTypesRequest.prototype.returnPartialSuccess = null; + + /** + * ListMachineTypesRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + ListMachineTypesRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListMachineTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + Object.defineProperty(ListMachineTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListMachineTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + Object.defineProperty(ListMachineTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListMachineTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + Object.defineProperty(ListMachineTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListMachineTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + Object.defineProperty(ListMachineTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListMachineTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + */ + Object.defineProperty(ListMachineTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListMachineTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.IListMachineTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListMachineTypesRequest} ListMachineTypesRequest instance + */ + ListMachineTypesRequest.create = function create(properties) { + return new ListMachineTypesRequest(properties); + }; + + /** + * Encodes the specified ListMachineTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListMachineTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.IListMachineTypesRequest} message ListMachineTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMachineTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListMachineTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListMachineTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.IListMachineTypesRequest} message ListMachineTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMachineTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMachineTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListMachineTypesRequest} ListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMachineTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListMachineTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMachineTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListMachineTypesRequest} ListMachineTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMachineTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMachineTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMachineTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListMachineTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListMachineTypesRequest} ListMachineTypesRequest + */ + ListMachineTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListMachineTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListMachineTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListMachineTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @static + * @param {google.cloud.compute.v1.ListMachineTypesRequest} message ListMachineTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMachineTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListMachineTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListMachineTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListMachineTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListMachineTypesRequest; + })(); + + v1.AggregatedListNetworkEndpointGroupsRequest = (function() { + + /** + * Properties of an AggregatedListNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListNetworkEndpointGroupsRequest + * @property {string|null} [filter] AggregatedListNetworkEndpointGroupsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListNetworkEndpointGroupsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListNetworkEndpointGroupsRequest maxResults + * @property {string|null} [orderBy] AggregatedListNetworkEndpointGroupsRequest orderBy + * @property {string|null} [pageToken] AggregatedListNetworkEndpointGroupsRequest pageToken + * @property {string|null} [project] AggregatedListNetworkEndpointGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListNetworkEndpointGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListNetworkEndpointGroupsRequest. + * @implements IAggregatedListNetworkEndpointGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest=} [properties] Properties to set + */ + function AggregatedListNetworkEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListNetworkEndpointGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.filter = null; + + /** + * AggregatedListNetworkEndpointGroupsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListNetworkEndpointGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.maxResults = null; + + /** + * AggregatedListNetworkEndpointGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.orderBy = null; + + /** + * AggregatedListNetworkEndpointGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.pageToken = null; + + /** + * AggregatedListNetworkEndpointGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.project = ""; + + /** + * AggregatedListNetworkEndpointGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListNetworkEndpointGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNetworkEndpointGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNetworkEndpointGroupsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNetworkEndpointGroupsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNetworkEndpointGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNetworkEndpointGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNetworkEndpointGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNetworkEndpointGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNetworkEndpointGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNetworkEndpointGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNetworkEndpointGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNetworkEndpointGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListNetworkEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest} AggregatedListNetworkEndpointGroupsRequest instance + */ + AggregatedListNetworkEndpointGroupsRequest.create = function create(properties) { + return new AggregatedListNetworkEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest} message AggregatedListNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNetworkEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest} message AggregatedListNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNetworkEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest} AggregatedListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNetworkEndpointGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest} AggregatedListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNetworkEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListNetworkEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListNetworkEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest} AggregatedListNetworkEndpointGroupsRequest + */ + AggregatedListNetworkEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest} message AggregatedListNetworkEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListNetworkEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListNetworkEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListNetworkEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListNetworkEndpointGroupsRequest; + })(); + + v1.AttachNetworkEndpointsNetworkEndpointGroupRequest = (function() { + + /** + * Properties of an AttachNetworkEndpointsNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IAttachNetworkEndpointsNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup + * @property {google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest|null} [networkEndpointGroupsAttachEndpointsRequestResource] AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsAttachEndpointsRequestResource + * @property {string|null} [project] AttachNetworkEndpointsNetworkEndpointGroupRequest project + * @property {string|null} [requestId] AttachNetworkEndpointsNetworkEndpointGroupRequest requestId + * @property {string|null} [zone] AttachNetworkEndpointsNetworkEndpointGroupRequest zone + */ + + /** + * Constructs a new AttachNetworkEndpointsNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AttachNetworkEndpointsNetworkEndpointGroupRequest. + * @implements IAttachNetworkEndpointsNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function AttachNetworkEndpointsNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * AttachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsAttachEndpointsRequestResource. + * @member {google.cloud.compute.v1.INetworkEndpointGroupsAttachEndpointsRequest|null|undefined} networkEndpointGroupsAttachEndpointsRequestResource + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.prototype.networkEndpointGroupsAttachEndpointsRequestResource = null; + + /** + * AttachNetworkEndpointsNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * AttachNetworkEndpointsNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.prototype.requestId = null; + + /** + * AttachNetworkEndpointsNetworkEndpointGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachNetworkEndpointsNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(AttachNetworkEndpointsNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachNetworkEndpointsNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest} AttachNetworkEndpointsNetworkEndpointGroupRequest instance + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.create = function create(properties) { + return new AttachNetworkEndpointsNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified AttachNetworkEndpointsNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest} message AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkEndpointGroupsAttachEndpointsRequestResource != null && Object.hasOwnProperty.call(message, "networkEndpointGroupsAttachEndpointsRequestResource")) + $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.encode(message.networkEndpointGroupsAttachEndpointsRequestResource, writer.uint32(/* id 531079, wireType 2 =*/4248634).fork()).ldelim(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified AttachNetworkEndpointsNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest} message AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest} AttachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 531079: + message.networkEndpointGroupsAttachEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest} AttachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachNetworkEndpointsNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.networkEndpointGroupsAttachEndpointsRequestResource != null && message.hasOwnProperty("networkEndpointGroupsAttachEndpointsRequestResource")) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.verify(message.networkEndpointGroupsAttachEndpointsRequestResource); + if (error) + return "networkEndpointGroupsAttachEndpointsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AttachNetworkEndpointsNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest} AttachNetworkEndpointsNetworkEndpointGroupRequest + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.networkEndpointGroupsAttachEndpointsRequestResource != null) { + if (typeof object.networkEndpointGroupsAttachEndpointsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest.networkEndpointGroupsAttachEndpointsRequestResource: object expected"); + message.networkEndpointGroupsAttachEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.fromObject(object.networkEndpointGroupsAttachEndpointsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AttachNetworkEndpointsNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest} message AttachNetworkEndpointsNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networkEndpointGroupsAttachEndpointsRequestResource = null; + object.zone = ""; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.networkEndpointGroupsAttachEndpointsRequestResource != null && message.hasOwnProperty("networkEndpointGroupsAttachEndpointsRequestResource")) + object.networkEndpointGroupsAttachEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest.toObject(message.networkEndpointGroupsAttachEndpointsRequestResource, options); + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this AttachNetworkEndpointsNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + AttachNetworkEndpointsNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttachNetworkEndpointsNetworkEndpointGroupRequest; + })(); + + v1.DeleteNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a DeleteNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] DeleteNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] DeleteNetworkEndpointGroupRequest project + * @property {string|null} [requestId] DeleteNetworkEndpointGroupRequest requestId + * @property {string|null} [zone] DeleteNetworkEndpointGroupRequest zone + */ + + /** + * Constructs a new DeleteNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteNetworkEndpointGroupRequest. + * @implements IDeleteNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function DeleteNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @instance + */ + DeleteNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * DeleteNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @instance + */ + DeleteNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * DeleteNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @instance + */ + DeleteNetworkEndpointGroupRequest.prototype.requestId = null; + + /** + * DeleteNetworkEndpointGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @instance + */ + DeleteNetworkEndpointGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(DeleteNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest} DeleteNetworkEndpointGroupRequest instance + */ + DeleteNetworkEndpointGroupRequest.create = function create(properties) { + return new DeleteNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest} message DeleteNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified DeleteNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest} message DeleteNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest} DeleteNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest} DeleteNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest} DeleteNetworkEndpointGroupRequest + */ + DeleteNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest} message DeleteNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this DeleteNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteNetworkEndpointGroupRequest; + })(); + + v1.DetachNetworkEndpointsNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a DetachNetworkEndpointsNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDetachNetworkEndpointsNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup + * @property {google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest|null} [networkEndpointGroupsDetachEndpointsRequestResource] DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsDetachEndpointsRequestResource + * @property {string|null} [project] DetachNetworkEndpointsNetworkEndpointGroupRequest project + * @property {string|null} [requestId] DetachNetworkEndpointsNetworkEndpointGroupRequest requestId + * @property {string|null} [zone] DetachNetworkEndpointsNetworkEndpointGroupRequest zone + */ + + /** + * Constructs a new DetachNetworkEndpointsNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DetachNetworkEndpointsNetworkEndpointGroupRequest. + * @implements IDetachNetworkEndpointsNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function DetachNetworkEndpointsNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * DetachNetworkEndpointsNetworkEndpointGroupRequest networkEndpointGroupsDetachEndpointsRequestResource. + * @member {google.cloud.compute.v1.INetworkEndpointGroupsDetachEndpointsRequest|null|undefined} networkEndpointGroupsDetachEndpointsRequestResource + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.prototype.networkEndpointGroupsDetachEndpointsRequestResource = null; + + /** + * DetachNetworkEndpointsNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * DetachNetworkEndpointsNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.prototype.requestId = null; + + /** + * DetachNetworkEndpointsNetworkEndpointGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DetachNetworkEndpointsNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(DetachNetworkEndpointsNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DetachNetworkEndpointsNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest} DetachNetworkEndpointsNetworkEndpointGroupRequest instance + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.create = function create(properties) { + return new DetachNetworkEndpointsNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified DetachNetworkEndpointsNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest} message DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + if (message.networkEndpointGroupsDetachEndpointsRequestResource != null && Object.hasOwnProperty.call(message, "networkEndpointGroupsDetachEndpointsRequestResource")) + $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.encode(message.networkEndpointGroupsDetachEndpointsRequestResource, writer.uint32(/* id 515608697, wireType 2 =*/4124869578).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetachNetworkEndpointsNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest} message DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest} DetachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 515608697: + message.networkEndpointGroupsDetachEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetachNetworkEndpointsNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest} DetachNetworkEndpointsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetachNetworkEndpointsNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.networkEndpointGroupsDetachEndpointsRequestResource != null && message.hasOwnProperty("networkEndpointGroupsDetachEndpointsRequestResource")) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.verify(message.networkEndpointGroupsDetachEndpointsRequestResource); + if (error) + return "networkEndpointGroupsDetachEndpointsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DetachNetworkEndpointsNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest} DetachNetworkEndpointsNetworkEndpointGroupRequest + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.networkEndpointGroupsDetachEndpointsRequestResource != null) { + if (typeof object.networkEndpointGroupsDetachEndpointsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest.networkEndpointGroupsDetachEndpointsRequestResource: object expected"); + message.networkEndpointGroupsDetachEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.fromObject(object.networkEndpointGroupsDetachEndpointsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DetachNetworkEndpointsNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest} message DetachNetworkEndpointsNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.networkEndpointGroup = ""; + object.networkEndpointGroupsDetachEndpointsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + if (message.networkEndpointGroupsDetachEndpointsRequestResource != null && message.hasOwnProperty("networkEndpointGroupsDetachEndpointsRequestResource")) + object.networkEndpointGroupsDetachEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest.toObject(message.networkEndpointGroupsDetachEndpointsRequestResource, options); + return object; + }; + + /** + * Converts this DetachNetworkEndpointsNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DetachNetworkEndpointsNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetachNetworkEndpointsNetworkEndpointGroupRequest; + })(); + + v1.GetNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a GetNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] GetNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] GetNetworkEndpointGroupRequest project + * @property {string|null} [zone] GetNetworkEndpointGroupRequest zone + */ + + /** + * Constructs a new GetNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetNetworkEndpointGroupRequest. + * @implements IGetNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IGetNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function GetNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @instance + */ + GetNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * GetNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @instance + */ + GetNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * GetNetworkEndpointGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @instance + */ + GetNetworkEndpointGroupRequest.prototype.zone = ""; + + /** + * Creates a new GetNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetNetworkEndpointGroupRequest} GetNetworkEndpointGroupRequest instance + */ + GetNetworkEndpointGroupRequest.create = function create(properties) { + return new GetNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified GetNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetNetworkEndpointGroupRequest} message GetNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified GetNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetNetworkEndpointGroupRequest} message GetNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetNetworkEndpointGroupRequest} GetNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetNetworkEndpointGroupRequest} GetNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetNetworkEndpointGroupRequest} GetNetworkEndpointGroupRequest + */ + GetNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.GetNetworkEndpointGroupRequest} message GetNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this GetNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNetworkEndpointGroupRequest; + })(); + + v1.InsertNetworkEndpointGroupRequest = (function() { + + /** + * Properties of an InsertNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertNetworkEndpointGroupRequest + * @property {google.cloud.compute.v1.INetworkEndpointGroup|null} [networkEndpointGroupResource] InsertNetworkEndpointGroupRequest networkEndpointGroupResource + * @property {string|null} [project] InsertNetworkEndpointGroupRequest project + * @property {string|null} [requestId] InsertNetworkEndpointGroupRequest requestId + * @property {string|null} [zone] InsertNetworkEndpointGroupRequest zone + */ + + /** + * Constructs a new InsertNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertNetworkEndpointGroupRequest. + * @implements IInsertNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function InsertNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertNetworkEndpointGroupRequest networkEndpointGroupResource. + * @member {google.cloud.compute.v1.INetworkEndpointGroup|null|undefined} networkEndpointGroupResource + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @instance + */ + InsertNetworkEndpointGroupRequest.prototype.networkEndpointGroupResource = null; + + /** + * InsertNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @instance + */ + InsertNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * InsertNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @instance + */ + InsertNetworkEndpointGroupRequest.prototype.requestId = null; + + /** + * InsertNetworkEndpointGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @instance + */ + InsertNetworkEndpointGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(InsertNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertNetworkEndpointGroupRequest} InsertNetworkEndpointGroupRequest instance + */ + InsertNetworkEndpointGroupRequest.create = function create(properties) { + return new InsertNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified InsertNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest} message InsertNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroupResource != null && Object.hasOwnProperty.call(message, "networkEndpointGroupResource")) + $root.google.cloud.compute.v1.NetworkEndpointGroup.encode(message.networkEndpointGroupResource, writer.uint32(/* id 525788839, wireType 2 =*/4206310714).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest} message InsertNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertNetworkEndpointGroupRequest} InsertNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 525788839: + message.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertNetworkEndpointGroupRequest} InsertNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroupResource != null && message.hasOwnProperty("networkEndpointGroupResource")) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroup.verify(message.networkEndpointGroupResource); + if (error) + return "networkEndpointGroupResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertNetworkEndpointGroupRequest} InsertNetworkEndpointGroupRequest + */ + InsertNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertNetworkEndpointGroupRequest(); + if (object.networkEndpointGroupResource != null) { + if (typeof object.networkEndpointGroupResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertNetworkEndpointGroupRequest.networkEndpointGroupResource: object expected"); + message.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.fromObject(object.networkEndpointGroupResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.InsertNetworkEndpointGroupRequest} message InsertNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.networkEndpointGroupResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroupResource != null && message.hasOwnProperty("networkEndpointGroupResource")) + object.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.toObject(message.networkEndpointGroupResource, options); + return object; + }; + + /** + * Converts this InsertNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + InsertNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertNetworkEndpointGroupRequest; + })(); + + v1.ListNetworkEndpointGroupsRequest = (function() { + + /** + * Properties of a ListNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNetworkEndpointGroupsRequest + * @property {string|null} [filter] ListNetworkEndpointGroupsRequest filter + * @property {number|null} [maxResults] ListNetworkEndpointGroupsRequest maxResults + * @property {string|null} [orderBy] ListNetworkEndpointGroupsRequest orderBy + * @property {string|null} [pageToken] ListNetworkEndpointGroupsRequest pageToken + * @property {string|null} [project] ListNetworkEndpointGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListNetworkEndpointGroupsRequest returnPartialSuccess + * @property {string|null} [zone] ListNetworkEndpointGroupsRequest zone + */ + + /** + * Constructs a new ListNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNetworkEndpointGroupsRequest. + * @implements IListNetworkEndpointGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListNetworkEndpointGroupsRequest=} [properties] Properties to set + */ + function ListNetworkEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNetworkEndpointGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointGroupsRequest.prototype.filter = null; + + /** + * ListNetworkEndpointGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointGroupsRequest.prototype.maxResults = null; + + /** + * ListNetworkEndpointGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointGroupsRequest.prototype.orderBy = null; + + /** + * ListNetworkEndpointGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointGroupsRequest.prototype.pageToken = null; + + /** + * ListNetworkEndpointGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointGroupsRequest.prototype.project = ""; + + /** + * ListNetworkEndpointGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointGroupsRequest.prototype.returnPartialSuccess = null; + + /** + * ListNetworkEndpointGroupsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointGroupsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNetworkEndpointGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNetworkEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNetworkEndpointGroupsRequest} ListNetworkEndpointGroupsRequest instance + */ + ListNetworkEndpointGroupsRequest.create = function create(properties) { + return new ListNetworkEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified ListNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointGroupsRequest} message ListNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointGroupsRequest} message ListNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNetworkEndpointGroupsRequest} ListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkEndpointGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNetworkEndpointGroupsRequest} ListNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNetworkEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNetworkEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNetworkEndpointGroupsRequest} ListNetworkEndpointGroupsRequest + */ + ListNetworkEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListNetworkEndpointGroupsRequest} message ListNetworkEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNetworkEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNetworkEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNetworkEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNetworkEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNetworkEndpointGroupsRequest; + })(); + + v1.ListNetworkEndpointsNetworkEndpointGroupsRequest = (function() { + + /** + * Properties of a ListNetworkEndpointsNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNetworkEndpointsNetworkEndpointGroupsRequest + * @property {string|null} [filter] ListNetworkEndpointsNetworkEndpointGroupsRequest filter + * @property {number|null} [maxResults] ListNetworkEndpointsNetworkEndpointGroupsRequest maxResults + * @property {string|null} [networkEndpointGroup] ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroup + * @property {google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest|null} [networkEndpointGroupsListEndpointsRequestResource] ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroupsListEndpointsRequestResource + * @property {string|null} [orderBy] ListNetworkEndpointsNetworkEndpointGroupsRequest orderBy + * @property {string|null} [pageToken] ListNetworkEndpointsNetworkEndpointGroupsRequest pageToken + * @property {string|null} [project] ListNetworkEndpointsNetworkEndpointGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListNetworkEndpointsNetworkEndpointGroupsRequest returnPartialSuccess + * @property {string|null} [zone] ListNetworkEndpointsNetworkEndpointGroupsRequest zone + */ + + /** + * Constructs a new ListNetworkEndpointsNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNetworkEndpointsNetworkEndpointGroupsRequest. + * @implements IListNetworkEndpointsNetworkEndpointGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest=} [properties] Properties to set + */ + function ListNetworkEndpointsNetworkEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.filter = null; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.maxResults = null; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.networkEndpointGroup = ""; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest networkEndpointGroupsListEndpointsRequestResource. + * @member {google.cloud.compute.v1.INetworkEndpointGroupsListEndpointsRequest|null|undefined} networkEndpointGroupsListEndpointsRequestResource + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.networkEndpointGroupsListEndpointsRequestResource = null; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.orderBy = null; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.pageToken = null; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.project = ""; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.returnPartialSuccess = null; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworkEndpointsNetworkEndpointGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNetworkEndpointsNetworkEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest} ListNetworkEndpointsNetworkEndpointGroupsRequest instance + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.create = function create(properties) { + return new ListNetworkEndpointsNetworkEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified ListNetworkEndpointsNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest} message ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.networkEndpointGroupsListEndpointsRequestResource != null && Object.hasOwnProperty.call(message, "networkEndpointGroupsListEndpointsRequestResource")) + $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.encode(message.networkEndpointGroupsListEndpointsRequestResource, writer.uint32(/* id 59493390, wireType 2 =*/475947122).fork()).ldelim(); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNetworkEndpointsNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest} message ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNetworkEndpointsNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest} ListNetworkEndpointsNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 59493390: + message.networkEndpointGroupsListEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.decode(reader, reader.uint32()); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNetworkEndpointsNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest} ListNetworkEndpointsNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNetworkEndpointsNetworkEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.networkEndpointGroupsListEndpointsRequestResource != null && message.hasOwnProperty("networkEndpointGroupsListEndpointsRequestResource")) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.verify(message.networkEndpointGroupsListEndpointsRequestResource); + if (error) + return "networkEndpointGroupsListEndpointsRequestResource." + error; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListNetworkEndpointsNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest} ListNetworkEndpointsNetworkEndpointGroupsRequest + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.networkEndpointGroupsListEndpointsRequestResource != null) { + if (typeof object.networkEndpointGroupsListEndpointsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest.networkEndpointGroupsListEndpointsRequestResource: object expected"); + message.networkEndpointGroupsListEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.fromObject(object.networkEndpointGroupsListEndpointsRequestResource); + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListNetworkEndpointsNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest} message ListNetworkEndpointsNetworkEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.networkEndpointGroupsListEndpointsRequestResource = null; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.networkEndpointGroupsListEndpointsRequestResource != null && message.hasOwnProperty("networkEndpointGroupsListEndpointsRequestResource")) + object.networkEndpointGroupsListEndpointsRequestResource = $root.google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest.toObject(message.networkEndpointGroupsListEndpointsRequestResource, options); + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNetworkEndpointsNetworkEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNetworkEndpointsNetworkEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNetworkEndpointsNetworkEndpointGroupsRequest; + })(); + + v1.TestIamPermissionsNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a TestIamPermissionsNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsNetworkEndpointGroupRequest + * @property {string|null} [project] TestIamPermissionsNetworkEndpointGroupRequest project + * @property {string|null} [resource] TestIamPermissionsNetworkEndpointGroupRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsNetworkEndpointGroupRequest testPermissionsRequestResource + * @property {string|null} [zone] TestIamPermissionsNetworkEndpointGroupRequest zone + */ + + /** + * Constructs a new TestIamPermissionsNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsNetworkEndpointGroupRequest. + * @implements ITestIamPermissionsNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function TestIamPermissionsNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @instance + */ + TestIamPermissionsNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * TestIamPermissionsNetworkEndpointGroupRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @instance + */ + TestIamPermissionsNetworkEndpointGroupRequest.prototype.resource = ""; + + /** + * TestIamPermissionsNetworkEndpointGroupRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @instance + */ + TestIamPermissionsNetworkEndpointGroupRequest.prototype.testPermissionsRequestResource = null; + + /** + * TestIamPermissionsNetworkEndpointGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @instance + */ + TestIamPermissionsNetworkEndpointGroupRequest.prototype.zone = ""; + + /** + * Creates a new TestIamPermissionsNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest} TestIamPermissionsNetworkEndpointGroupRequest instance + */ + TestIamPermissionsNetworkEndpointGroupRequest.create = function create(properties) { + return new TestIamPermissionsNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest} message TestIamPermissionsNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest} message TestIamPermissionsNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest} TestIamPermissionsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest} TestIamPermissionsNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a TestIamPermissionsNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest} TestIamPermissionsNetworkEndpointGroupRequest + */ + TestIamPermissionsNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest} message TestIamPermissionsNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsNetworkEndpointGroupRequest; + })(); + + v1.AddPeeringNetworkRequest = (function() { + + /** + * Properties of an AddPeeringNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddPeeringNetworkRequest + * @property {string|null} [network] AddPeeringNetworkRequest network + * @property {google.cloud.compute.v1.INetworksAddPeeringRequest|null} [networksAddPeeringRequestResource] AddPeeringNetworkRequest networksAddPeeringRequestResource + * @property {string|null} [project] AddPeeringNetworkRequest project + * @property {string|null} [requestId] AddPeeringNetworkRequest requestId + */ + + /** + * Constructs a new AddPeeringNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddPeeringNetworkRequest. + * @implements IAddPeeringNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IAddPeeringNetworkRequest=} [properties] Properties to set + */ + function AddPeeringNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddPeeringNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @instance + */ + AddPeeringNetworkRequest.prototype.network = ""; + + /** + * AddPeeringNetworkRequest networksAddPeeringRequestResource. + * @member {google.cloud.compute.v1.INetworksAddPeeringRequest|null|undefined} networksAddPeeringRequestResource + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @instance + */ + AddPeeringNetworkRequest.prototype.networksAddPeeringRequestResource = null; + + /** + * AddPeeringNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @instance + */ + AddPeeringNetworkRequest.prototype.project = ""; + + /** + * AddPeeringNetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @instance + */ + AddPeeringNetworkRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddPeeringNetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @instance + */ + Object.defineProperty(AddPeeringNetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddPeeringNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IAddPeeringNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddPeeringNetworkRequest} AddPeeringNetworkRequest instance + */ + AddPeeringNetworkRequest.create = function create(properties) { + return new AddPeeringNetworkRequest(properties); + }; + + /** + * Encodes the specified AddPeeringNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.AddPeeringNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IAddPeeringNetworkRequest} message AddPeeringNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPeeringNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.networksAddPeeringRequestResource != null && Object.hasOwnProperty.call(message, "networksAddPeeringRequestResource")) + $root.google.cloud.compute.v1.NetworksAddPeeringRequest.encode(message.networksAddPeeringRequestResource, writer.uint32(/* id 388810421, wireType 2 =*/3110483370).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddPeeringNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddPeeringNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IAddPeeringNetworkRequest} message AddPeeringNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddPeeringNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddPeeringNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddPeeringNetworkRequest} AddPeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPeeringNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddPeeringNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 388810421: + message.networksAddPeeringRequestResource = $root.google.cloud.compute.v1.NetworksAddPeeringRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddPeeringNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddPeeringNetworkRequest} AddPeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddPeeringNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddPeeringNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddPeeringNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.networksAddPeeringRequestResource != null && message.hasOwnProperty("networksAddPeeringRequestResource")) { + var error = $root.google.cloud.compute.v1.NetworksAddPeeringRequest.verify(message.networksAddPeeringRequestResource); + if (error) + return "networksAddPeeringRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an AddPeeringNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddPeeringNetworkRequest} AddPeeringNetworkRequest + */ + AddPeeringNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddPeeringNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddPeeringNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.networksAddPeeringRequestResource != null) { + if (typeof object.networksAddPeeringRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddPeeringNetworkRequest.networksAddPeeringRequestResource: object expected"); + message.networksAddPeeringRequestResource = $root.google.cloud.compute.v1.NetworksAddPeeringRequest.fromObject(object.networksAddPeeringRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AddPeeringNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.AddPeeringNetworkRequest} message AddPeeringNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddPeeringNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.network = ""; + object.networksAddPeeringRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.networksAddPeeringRequestResource != null && message.hasOwnProperty("networksAddPeeringRequestResource")) + object.networksAddPeeringRequestResource = $root.google.cloud.compute.v1.NetworksAddPeeringRequest.toObject(message.networksAddPeeringRequestResource, options); + return object; + }; + + /** + * Converts this AddPeeringNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddPeeringNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + AddPeeringNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddPeeringNetworkRequest; + })(); + + v1.DeleteNetworkRequest = (function() { + + /** + * Properties of a DeleteNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteNetworkRequest + * @property {string|null} [network] DeleteNetworkRequest network + * @property {string|null} [project] DeleteNetworkRequest project + * @property {string|null} [requestId] DeleteNetworkRequest requestId + */ + + /** + * Constructs a new DeleteNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteNetworkRequest. + * @implements IDeleteNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteNetworkRequest=} [properties] Properties to set + */ + function DeleteNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @instance + */ + DeleteNetworkRequest.prototype.network = ""; + + /** + * DeleteNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @instance + */ + DeleteNetworkRequest.prototype.project = ""; + + /** + * DeleteNetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @instance + */ + DeleteNetworkRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteNetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @instance + */ + Object.defineProperty(DeleteNetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteNetworkRequest} DeleteNetworkRequest instance + */ + DeleteNetworkRequest.create = function create(properties) { + return new DeleteNetworkRequest(properties); + }; + + /** + * Encodes the specified DeleteNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNetworkRequest} message DeleteNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + return writer; + }; + + /** + * Encodes the specified DeleteNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNetworkRequest} message DeleteNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteNetworkRequest} DeleteNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteNetworkRequest} DeleteNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteNetworkRequest} DeleteNetworkRequest + */ + DeleteNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @static + * @param {google.cloud.compute.v1.DeleteNetworkRequest} message DeleteNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.network = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this DeleteNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteNetworkRequest; + })(); + + v1.GetNetworkRequest = (function() { + + /** + * Properties of a GetNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetNetworkRequest + * @property {string|null} [network] GetNetworkRequest network + * @property {string|null} [project] GetNetworkRequest project + */ + + /** + * Constructs a new GetNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetNetworkRequest. + * @implements IGetNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IGetNetworkRequest=} [properties] Properties to set + */ + function GetNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @instance + */ + GetNetworkRequest.prototype.network = ""; + + /** + * GetNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @instance + */ + GetNetworkRequest.prototype.project = ""; + + /** + * Creates a new GetNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetNetworkRequest} GetNetworkRequest instance + */ + GetNetworkRequest.create = function create(properties) { + return new GetNetworkRequest(properties); + }; + + /** + * Encodes the specified GetNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetNetworkRequest} message GetNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + return writer; + }; + + /** + * Encodes the specified GetNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetNetworkRequest} message GetNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetNetworkRequest} GetNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetNetworkRequest} GetNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetNetworkRequest} GetNetworkRequest + */ + GetNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @static + * @param {google.cloud.compute.v1.GetNetworkRequest} message GetNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.network = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this GetNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + GetNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNetworkRequest; + })(); + + v1.GetEffectiveFirewallsNetworkRequest = (function() { + + /** + * Properties of a GetEffectiveFirewallsNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetEffectiveFirewallsNetworkRequest + * @property {string|null} [network] GetEffectiveFirewallsNetworkRequest network + * @property {string|null} [project] GetEffectiveFirewallsNetworkRequest project + */ + + /** + * Constructs a new GetEffectiveFirewallsNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetEffectiveFirewallsNetworkRequest. + * @implements IGetEffectiveFirewallsNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest=} [properties] Properties to set + */ + function GetEffectiveFirewallsNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEffectiveFirewallsNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @instance + */ + GetEffectiveFirewallsNetworkRequest.prototype.network = ""; + + /** + * GetEffectiveFirewallsNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @instance + */ + GetEffectiveFirewallsNetworkRequest.prototype.project = ""; + + /** + * Creates a new GetEffectiveFirewallsNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest} GetEffectiveFirewallsNetworkRequest instance + */ + GetEffectiveFirewallsNetworkRequest.create = function create(properties) { + return new GetEffectiveFirewallsNetworkRequest(properties); + }; + + /** + * Encodes the specified GetEffectiveFirewallsNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest} message GetEffectiveFirewallsNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveFirewallsNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + return writer; + }; + + /** + * Encodes the specified GetEffectiveFirewallsNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest} message GetEffectiveFirewallsNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEffectiveFirewallsNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetEffectiveFirewallsNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest} GetEffectiveFirewallsNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveFirewallsNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetEffectiveFirewallsNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest} GetEffectiveFirewallsNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEffectiveFirewallsNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetEffectiveFirewallsNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEffectiveFirewallsNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetEffectiveFirewallsNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest} GetEffectiveFirewallsNetworkRequest + */ + GetEffectiveFirewallsNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetEffectiveFirewallsNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @static + * @param {google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest} message GetEffectiveFirewallsNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEffectiveFirewallsNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.network = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this GetEffectiveFirewallsNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + GetEffectiveFirewallsNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetEffectiveFirewallsNetworkRequest; + })(); + + v1.InsertNetworkRequest = (function() { + + /** + * Properties of an InsertNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertNetworkRequest + * @property {google.cloud.compute.v1.INetwork|null} [networkResource] InsertNetworkRequest networkResource + * @property {string|null} [project] InsertNetworkRequest project + * @property {string|null} [requestId] InsertNetworkRequest requestId + */ + + /** + * Constructs a new InsertNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertNetworkRequest. + * @implements IInsertNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertNetworkRequest=} [properties] Properties to set + */ + function InsertNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertNetworkRequest networkResource. + * @member {google.cloud.compute.v1.INetwork|null|undefined} networkResource + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @instance + */ + InsertNetworkRequest.prototype.networkResource = null; + + /** + * InsertNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @instance + */ + InsertNetworkRequest.prototype.project = ""; + + /** + * InsertNetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @instance + */ + InsertNetworkRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertNetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @instance + */ + Object.defineProperty(InsertNetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {google.cloud.compute.v1.IInsertNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertNetworkRequest} InsertNetworkRequest instance + */ + InsertNetworkRequest.create = function create(properties) { + return new InsertNetworkRequest(properties); + }; + + /** + * Encodes the specified InsertNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {google.cloud.compute.v1.IInsertNetworkRequest} message InsertNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.networkResource != null && Object.hasOwnProperty.call(message, "networkResource")) + $root.google.cloud.compute.v1.Network.encode(message.networkResource, writer.uint32(/* id 122105599, wireType 2 =*/976844794).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {google.cloud.compute.v1.IInsertNetworkRequest} message InsertNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertNetworkRequest} InsertNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 122105599: + message.networkResource = $root.google.cloud.compute.v1.Network.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertNetworkRequest} InsertNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkResource != null && message.hasOwnProperty("networkResource")) { + var error = $root.google.cloud.compute.v1.Network.verify(message.networkResource); + if (error) + return "networkResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertNetworkRequest} InsertNetworkRequest + */ + InsertNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertNetworkRequest(); + if (object.networkResource != null) { + if (typeof object.networkResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertNetworkRequest.networkResource: object expected"); + message.networkResource = $root.google.cloud.compute.v1.Network.fromObject(object.networkResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @static + * @param {google.cloud.compute.v1.InsertNetworkRequest} message InsertNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networkResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.networkResource != null && message.hasOwnProperty("networkResource")) + object.networkResource = $root.google.cloud.compute.v1.Network.toObject(message.networkResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + InsertNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertNetworkRequest; + })(); + + v1.ListNetworksRequest = (function() { + + /** + * Properties of a ListNetworksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNetworksRequest + * @property {string|null} [filter] ListNetworksRequest filter + * @property {number|null} [maxResults] ListNetworksRequest maxResults + * @property {string|null} [orderBy] ListNetworksRequest orderBy + * @property {string|null} [pageToken] ListNetworksRequest pageToken + * @property {string|null} [project] ListNetworksRequest project + * @property {boolean|null} [returnPartialSuccess] ListNetworksRequest returnPartialSuccess + */ + + /** + * Constructs a new ListNetworksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNetworksRequest. + * @implements IListNetworksRequest + * @constructor + * @param {google.cloud.compute.v1.IListNetworksRequest=} [properties] Properties to set + */ + function ListNetworksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNetworksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + ListNetworksRequest.prototype.filter = null; + + /** + * ListNetworksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + ListNetworksRequest.prototype.maxResults = null; + + /** + * ListNetworksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + ListNetworksRequest.prototype.orderBy = null; + + /** + * ListNetworksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + ListNetworksRequest.prototype.pageToken = null; + + /** + * ListNetworksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + ListNetworksRequest.prototype.project = ""; + + /** + * ListNetworksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + ListNetworksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNetworksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + Object.defineProperty(ListNetworksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + Object.defineProperty(ListNetworksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + Object.defineProperty(ListNetworksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + Object.defineProperty(ListNetworksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNetworksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + */ + Object.defineProperty(ListNetworksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNetworksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {google.cloud.compute.v1.IListNetworksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNetworksRequest} ListNetworksRequest instance + */ + ListNetworksRequest.create = function create(properties) { + return new ListNetworksRequest(properties); + }; + + /** + * Encodes the specified ListNetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNetworksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {google.cloud.compute.v1.IListNetworksRequest} message ListNetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNetworksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {google.cloud.compute.v1.IListNetworksRequest} message ListNetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNetworksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNetworksRequest} ListNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNetworksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNetworksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNetworksRequest} ListNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNetworksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNetworksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListNetworksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNetworksRequest} ListNetworksRequest + */ + ListNetworksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNetworksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNetworksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListNetworksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @static + * @param {google.cloud.compute.v1.ListNetworksRequest} message ListNetworksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNetworksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNetworksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNetworksRequest + * @instance + * @returns {Object.} JSON object + */ + ListNetworksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNetworksRequest; + })(); + + v1.ListPeeringRoutesNetworksRequest = (function() { + + /** + * Properties of a ListPeeringRoutesNetworksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListPeeringRoutesNetworksRequest + * @property {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction|null} [direction] ListPeeringRoutesNetworksRequest direction + * @property {string|null} [filter] ListPeeringRoutesNetworksRequest filter + * @property {number|null} [maxResults] ListPeeringRoutesNetworksRequest maxResults + * @property {string|null} [network] ListPeeringRoutesNetworksRequest network + * @property {string|null} [orderBy] ListPeeringRoutesNetworksRequest orderBy + * @property {string|null} [pageToken] ListPeeringRoutesNetworksRequest pageToken + * @property {string|null} [peeringName] ListPeeringRoutesNetworksRequest peeringName + * @property {string|null} [project] ListPeeringRoutesNetworksRequest project + * @property {string|null} [region] ListPeeringRoutesNetworksRequest region + * @property {boolean|null} [returnPartialSuccess] ListPeeringRoutesNetworksRequest returnPartialSuccess + */ + + /** + * Constructs a new ListPeeringRoutesNetworksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListPeeringRoutesNetworksRequest. + * @implements IListPeeringRoutesNetworksRequest + * @constructor + * @param {google.cloud.compute.v1.IListPeeringRoutesNetworksRequest=} [properties] Properties to set + */ + function ListPeeringRoutesNetworksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPeeringRoutesNetworksRequest direction. + * @member {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction|null|undefined} direction + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.direction = null; + + /** + * ListPeeringRoutesNetworksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.filter = null; + + /** + * ListPeeringRoutesNetworksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.maxResults = null; + + /** + * ListPeeringRoutesNetworksRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.network = ""; + + /** + * ListPeeringRoutesNetworksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.orderBy = null; + + /** + * ListPeeringRoutesNetworksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.pageToken = null; + + /** + * ListPeeringRoutesNetworksRequest peeringName. + * @member {string|null|undefined} peeringName + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.peeringName = null; + + /** + * ListPeeringRoutesNetworksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.project = ""; + + /** + * ListPeeringRoutesNetworksRequest region. + * @member {string|null|undefined} region + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.region = null; + + /** + * ListPeeringRoutesNetworksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + ListPeeringRoutesNetworksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPeeringRoutesNetworksRequest _direction. + * @member {"direction"|undefined} _direction + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_direction", { + get: $util.oneOfGetter($oneOfFields = ["direction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPeeringRoutesNetworksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPeeringRoutesNetworksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPeeringRoutesNetworksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPeeringRoutesNetworksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPeeringRoutesNetworksRequest _peeringName. + * @member {"peeringName"|undefined} _peeringName + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_peeringName", { + get: $util.oneOfGetter($oneOfFields = ["peeringName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPeeringRoutesNetworksRequest _region. + * @member {"region"|undefined} _region + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPeeringRoutesNetworksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + */ + Object.defineProperty(ListPeeringRoutesNetworksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPeeringRoutesNetworksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {google.cloud.compute.v1.IListPeeringRoutesNetworksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest} ListPeeringRoutesNetworksRequest instance + */ + ListPeeringRoutesNetworksRequest.create = function create(properties) { + return new ListPeeringRoutesNetworksRequest(properties); + }; + + /** + * Encodes the specified ListPeeringRoutesNetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {google.cloud.compute.v1.IListPeeringRoutesNetworksRequest} message ListPeeringRoutesNetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPeeringRoutesNetworksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 111150975, wireType 0 =*/889207800).int32(message.direction); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.peeringName != null && Object.hasOwnProperty.call(message, "peeringName")) + writer.uint32(/* id 249571370, wireType 2 =*/1996570962).string(message.peeringName); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListPeeringRoutesNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {google.cloud.compute.v1.IListPeeringRoutesNetworksRequest} message ListPeeringRoutesNetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPeeringRoutesNetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPeeringRoutesNetworksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest} ListPeeringRoutesNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPeeringRoutesNetworksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 111150975: + message.direction = reader.int32(); + break; + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 232872494: + message.network = reader.string(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 249571370: + message.peeringName = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPeeringRoutesNetworksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest} ListPeeringRoutesNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPeeringRoutesNetworksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPeeringRoutesNetworksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPeeringRoutesNetworksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.direction != null && message.hasOwnProperty("direction")) { + properties._direction = 1; + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 338552870: + case 307438444: + break; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.peeringName != null && message.hasOwnProperty("peeringName")) { + properties._peeringName = 1; + if (!$util.isString(message.peeringName)) + return "peeringName: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListPeeringRoutesNetworksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest} ListPeeringRoutesNetworksRequest + */ + ListPeeringRoutesNetworksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest(); + switch (object.direction) { + case "UNDEFINED_DIRECTION": + case 0: + message.direction = 0; + break; + case "INCOMING": + case 338552870: + message.direction = 338552870; + break; + case "OUTGOING": + case 307438444: + message.direction = 307438444; + break; + } + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.network != null) + message.network = String(object.network); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.peeringName != null) + message.peeringName = String(object.peeringName); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListPeeringRoutesNetworksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @static + * @param {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest} message ListPeeringRoutesNetworksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPeeringRoutesNetworksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.network = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.direction != null && message.hasOwnProperty("direction")) { + object.direction = options.enums === String ? $root.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction[message.direction] : message.direction; + if (options.oneofs) + object._direction = "direction"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.peeringName != null && message.hasOwnProperty("peeringName")) { + object.peeringName = message.peeringName; + if (options.oneofs) + object._peeringName = "peeringName"; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListPeeringRoutesNetworksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListPeeringRoutesNetworksRequest + * @instance + * @returns {Object.} JSON object + */ + ListPeeringRoutesNetworksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Direction enum. + * @name google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction + * @enum {number} + * @property {number} UNDEFINED_DIRECTION=0 UNDEFINED_DIRECTION value + * @property {number} INCOMING=338552870 INCOMING value + * @property {number} OUTGOING=307438444 OUTGOING value + */ + ListPeeringRoutesNetworksRequest.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED_DIRECTION"] = 0; + values[valuesById[338552870] = "INCOMING"] = 338552870; + values[valuesById[307438444] = "OUTGOING"] = 307438444; + return values; + })(); + + return ListPeeringRoutesNetworksRequest; + })(); + + v1.PatchNetworkRequest = (function() { + + /** + * Properties of a PatchNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchNetworkRequest + * @property {string|null} [network] PatchNetworkRequest network + * @property {google.cloud.compute.v1.INetwork|null} [networkResource] PatchNetworkRequest networkResource + * @property {string|null} [project] PatchNetworkRequest project + * @property {string|null} [requestId] PatchNetworkRequest requestId + */ + + /** + * Constructs a new PatchNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchNetworkRequest. + * @implements IPatchNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchNetworkRequest=} [properties] Properties to set + */ + function PatchNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @instance + */ + PatchNetworkRequest.prototype.network = ""; + + /** + * PatchNetworkRequest networkResource. + * @member {google.cloud.compute.v1.INetwork|null|undefined} networkResource + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @instance + */ + PatchNetworkRequest.prototype.networkResource = null; + + /** + * PatchNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @instance + */ + PatchNetworkRequest.prototype.project = ""; + + /** + * PatchNetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @instance + */ + PatchNetworkRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchNetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @instance + */ + Object.defineProperty(PatchNetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {google.cloud.compute.v1.IPatchNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchNetworkRequest} PatchNetworkRequest instance + */ + PatchNetworkRequest.create = function create(properties) { + return new PatchNetworkRequest(properties); + }; + + /** + * Encodes the specified PatchNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {google.cloud.compute.v1.IPatchNetworkRequest} message PatchNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.networkResource != null && Object.hasOwnProperty.call(message, "networkResource")) + $root.google.cloud.compute.v1.Network.encode(message.networkResource, writer.uint32(/* id 122105599, wireType 2 =*/976844794).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + return writer; + }; + + /** + * Encodes the specified PatchNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {google.cloud.compute.v1.IPatchNetworkRequest} message PatchNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchNetworkRequest} PatchNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 122105599: + message.networkResource = $root.google.cloud.compute.v1.Network.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchNetworkRequest} PatchNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.networkResource != null && message.hasOwnProperty("networkResource")) { + var error = $root.google.cloud.compute.v1.Network.verify(message.networkResource); + if (error) + return "networkResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchNetworkRequest} PatchNetworkRequest + */ + PatchNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.networkResource != null) { + if (typeof object.networkResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchNetworkRequest.networkResource: object expected"); + message.networkResource = $root.google.cloud.compute.v1.Network.fromObject(object.networkResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @static + * @param {google.cloud.compute.v1.PatchNetworkRequest} message PatchNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networkResource = null; + object.project = ""; + object.network = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.networkResource != null && message.hasOwnProperty("networkResource")) + object.networkResource = $root.google.cloud.compute.v1.Network.toObject(message.networkResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this PatchNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + PatchNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchNetworkRequest; + })(); + + v1.RemovePeeringNetworkRequest = (function() { + + /** + * Properties of a RemovePeeringNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemovePeeringNetworkRequest + * @property {string|null} [network] RemovePeeringNetworkRequest network + * @property {google.cloud.compute.v1.INetworksRemovePeeringRequest|null} [networksRemovePeeringRequestResource] RemovePeeringNetworkRequest networksRemovePeeringRequestResource + * @property {string|null} [project] RemovePeeringNetworkRequest project + * @property {string|null} [requestId] RemovePeeringNetworkRequest requestId + */ + + /** + * Constructs a new RemovePeeringNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemovePeeringNetworkRequest. + * @implements IRemovePeeringNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IRemovePeeringNetworkRequest=} [properties] Properties to set + */ + function RemovePeeringNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemovePeeringNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @instance + */ + RemovePeeringNetworkRequest.prototype.network = ""; + + /** + * RemovePeeringNetworkRequest networksRemovePeeringRequestResource. + * @member {google.cloud.compute.v1.INetworksRemovePeeringRequest|null|undefined} networksRemovePeeringRequestResource + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @instance + */ + RemovePeeringNetworkRequest.prototype.networksRemovePeeringRequestResource = null; + + /** + * RemovePeeringNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @instance + */ + RemovePeeringNetworkRequest.prototype.project = ""; + + /** + * RemovePeeringNetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @instance + */ + RemovePeeringNetworkRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemovePeeringNetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @instance + */ + Object.defineProperty(RemovePeeringNetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemovePeeringNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IRemovePeeringNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemovePeeringNetworkRequest} RemovePeeringNetworkRequest instance + */ + RemovePeeringNetworkRequest.create = function create(properties) { + return new RemovePeeringNetworkRequest(properties); + }; + + /** + * Encodes the specified RemovePeeringNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.RemovePeeringNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IRemovePeeringNetworkRequest} message RemovePeeringNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePeeringNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + if (message.networksRemovePeeringRequestResource != null && Object.hasOwnProperty.call(message, "networksRemovePeeringRequestResource")) + $root.google.cloud.compute.v1.NetworksRemovePeeringRequest.encode(message.networksRemovePeeringRequestResource, writer.uint32(/* id 421162494, wireType 2 =*/3369299954).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RemovePeeringNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemovePeeringNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IRemovePeeringNetworkRequest} message RemovePeeringNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemovePeeringNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemovePeeringNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemovePeeringNetworkRequest} RemovePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePeeringNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemovePeeringNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 421162494: + message.networksRemovePeeringRequestResource = $root.google.cloud.compute.v1.NetworksRemovePeeringRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemovePeeringNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemovePeeringNetworkRequest} RemovePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemovePeeringNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemovePeeringNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemovePeeringNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.networksRemovePeeringRequestResource != null && message.hasOwnProperty("networksRemovePeeringRequestResource")) { + var error = $root.google.cloud.compute.v1.NetworksRemovePeeringRequest.verify(message.networksRemovePeeringRequestResource); + if (error) + return "networksRemovePeeringRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a RemovePeeringNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemovePeeringNetworkRequest} RemovePeeringNetworkRequest + */ + RemovePeeringNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemovePeeringNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemovePeeringNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.networksRemovePeeringRequestResource != null) { + if (typeof object.networksRemovePeeringRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RemovePeeringNetworkRequest.networksRemovePeeringRequestResource: object expected"); + message.networksRemovePeeringRequestResource = $root.google.cloud.compute.v1.NetworksRemovePeeringRequest.fromObject(object.networksRemovePeeringRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RemovePeeringNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.RemovePeeringNetworkRequest} message RemovePeeringNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemovePeeringNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.network = ""; + object.networksRemovePeeringRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.networksRemovePeeringRequestResource != null && message.hasOwnProperty("networksRemovePeeringRequestResource")) + object.networksRemovePeeringRequestResource = $root.google.cloud.compute.v1.NetworksRemovePeeringRequest.toObject(message.networksRemovePeeringRequestResource, options); + return object; + }; + + /** + * Converts this RemovePeeringNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemovePeeringNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + RemovePeeringNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemovePeeringNetworkRequest; + })(); + + v1.SwitchToCustomModeNetworkRequest = (function() { + + /** + * Properties of a SwitchToCustomModeNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface ISwitchToCustomModeNetworkRequest + * @property {string|null} [network] SwitchToCustomModeNetworkRequest network + * @property {string|null} [project] SwitchToCustomModeNetworkRequest project + * @property {string|null} [requestId] SwitchToCustomModeNetworkRequest requestId + */ + + /** + * Constructs a new SwitchToCustomModeNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SwitchToCustomModeNetworkRequest. + * @implements ISwitchToCustomModeNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest=} [properties] Properties to set + */ + function SwitchToCustomModeNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SwitchToCustomModeNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @instance + */ + SwitchToCustomModeNetworkRequest.prototype.network = ""; + + /** + * SwitchToCustomModeNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @instance + */ + SwitchToCustomModeNetworkRequest.prototype.project = ""; + + /** + * SwitchToCustomModeNetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @instance + */ + SwitchToCustomModeNetworkRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SwitchToCustomModeNetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @instance + */ + Object.defineProperty(SwitchToCustomModeNetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SwitchToCustomModeNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SwitchToCustomModeNetworkRequest} SwitchToCustomModeNetworkRequest instance + */ + SwitchToCustomModeNetworkRequest.create = function create(properties) { + return new SwitchToCustomModeNetworkRequest(properties); + }; + + /** + * Encodes the specified SwitchToCustomModeNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.SwitchToCustomModeNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest} message SwitchToCustomModeNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchToCustomModeNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + return writer; + }; + + /** + * Encodes the specified SwitchToCustomModeNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SwitchToCustomModeNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest} message SwitchToCustomModeNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SwitchToCustomModeNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SwitchToCustomModeNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SwitchToCustomModeNetworkRequest} SwitchToCustomModeNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchToCustomModeNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SwitchToCustomModeNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SwitchToCustomModeNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SwitchToCustomModeNetworkRequest} SwitchToCustomModeNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SwitchToCustomModeNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SwitchToCustomModeNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SwitchToCustomModeNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a SwitchToCustomModeNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SwitchToCustomModeNetworkRequest} SwitchToCustomModeNetworkRequest + */ + SwitchToCustomModeNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SwitchToCustomModeNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.SwitchToCustomModeNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SwitchToCustomModeNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @static + * @param {google.cloud.compute.v1.SwitchToCustomModeNetworkRequest} message SwitchToCustomModeNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SwitchToCustomModeNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.network = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this SwitchToCustomModeNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SwitchToCustomModeNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + SwitchToCustomModeNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SwitchToCustomModeNetworkRequest; + })(); + + v1.UpdatePeeringNetworkRequest = (function() { + + /** + * Properties of an UpdatePeeringNetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdatePeeringNetworkRequest + * @property {string|null} [network] UpdatePeeringNetworkRequest network + * @property {google.cloud.compute.v1.INetworksUpdatePeeringRequest|null} [networksUpdatePeeringRequestResource] UpdatePeeringNetworkRequest networksUpdatePeeringRequestResource + * @property {string|null} [project] UpdatePeeringNetworkRequest project + * @property {string|null} [requestId] UpdatePeeringNetworkRequest requestId + */ + + /** + * Constructs a new UpdatePeeringNetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdatePeeringNetworkRequest. + * @implements IUpdatePeeringNetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdatePeeringNetworkRequest=} [properties] Properties to set + */ + function UpdatePeeringNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePeeringNetworkRequest network. + * @member {string} network + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @instance + */ + UpdatePeeringNetworkRequest.prototype.network = ""; + + /** + * UpdatePeeringNetworkRequest networksUpdatePeeringRequestResource. + * @member {google.cloud.compute.v1.INetworksUpdatePeeringRequest|null|undefined} networksUpdatePeeringRequestResource + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @instance + */ + UpdatePeeringNetworkRequest.prototype.networksUpdatePeeringRequestResource = null; + + /** + * UpdatePeeringNetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @instance + */ + UpdatePeeringNetworkRequest.prototype.project = ""; + + /** + * UpdatePeeringNetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @instance + */ + UpdatePeeringNetworkRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdatePeeringNetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @instance + */ + Object.defineProperty(UpdatePeeringNetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdatePeeringNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePeeringNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdatePeeringNetworkRequest} UpdatePeeringNetworkRequest instance + */ + UpdatePeeringNetworkRequest.create = function create(properties) { + return new UpdatePeeringNetworkRequest(properties); + }; + + /** + * Encodes the specified UpdatePeeringNetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdatePeeringNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePeeringNetworkRequest} message UpdatePeeringNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePeeringNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.networksUpdatePeeringRequestResource != null && Object.hasOwnProperty.call(message, "networksUpdatePeeringRequestResource")) + $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest.encode(message.networksUpdatePeeringRequestResource, writer.uint32(/* id 224433497, wireType 2 =*/1795467978).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 232872494, wireType 2 =*/1862979954).string(message.network); + return writer; + }; + + /** + * Encodes the specified UpdatePeeringNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdatePeeringNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePeeringNetworkRequest} message UpdatePeeringNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePeeringNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePeeringNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdatePeeringNetworkRequest} UpdatePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePeeringNetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdatePeeringNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 232872494: + message.network = reader.string(); + break; + case 224433497: + message.networksUpdatePeeringRequestResource = $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePeeringNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdatePeeringNetworkRequest} UpdatePeeringNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePeeringNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePeeringNetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePeeringNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.networksUpdatePeeringRequestResource != null && message.hasOwnProperty("networksUpdatePeeringRequestResource")) { + var error = $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest.verify(message.networksUpdatePeeringRequestResource); + if (error) + return "networksUpdatePeeringRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdatePeeringNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdatePeeringNetworkRequest} UpdatePeeringNetworkRequest + */ + UpdatePeeringNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdatePeeringNetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdatePeeringNetworkRequest(); + if (object.network != null) + message.network = String(object.network); + if (object.networksUpdatePeeringRequestResource != null) { + if (typeof object.networksUpdatePeeringRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdatePeeringNetworkRequest.networksUpdatePeeringRequestResource: object expected"); + message.networksUpdatePeeringRequestResource = $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest.fromObject(object.networksUpdatePeeringRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdatePeeringNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @static + * @param {google.cloud.compute.v1.UpdatePeeringNetworkRequest} message UpdatePeeringNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePeeringNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networksUpdatePeeringRequestResource = null; + object.project = ""; + object.network = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.networksUpdatePeeringRequestResource != null && message.hasOwnProperty("networksUpdatePeeringRequestResource")) + object.networksUpdatePeeringRequestResource = $root.google.cloud.compute.v1.NetworksUpdatePeeringRequest.toObject(message.networksUpdatePeeringRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this UpdatePeeringNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdatePeeringNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePeeringNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdatePeeringNetworkRequest; + })(); + + v1.AddNodesNodeGroupRequest = (function() { + + /** + * Properties of an AddNodesNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddNodesNodeGroupRequest + * @property {string|null} [nodeGroup] AddNodesNodeGroupRequest nodeGroup + * @property {google.cloud.compute.v1.INodeGroupsAddNodesRequest|null} [nodeGroupsAddNodesRequestResource] AddNodesNodeGroupRequest nodeGroupsAddNodesRequestResource + * @property {string|null} [project] AddNodesNodeGroupRequest project + * @property {string|null} [requestId] AddNodesNodeGroupRequest requestId + * @property {string|null} [zone] AddNodesNodeGroupRequest zone + */ + + /** + * Constructs a new AddNodesNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddNodesNodeGroupRequest. + * @implements IAddNodesNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IAddNodesNodeGroupRequest=} [properties] Properties to set + */ + function AddNodesNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddNodesNodeGroupRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @instance + */ + AddNodesNodeGroupRequest.prototype.nodeGroup = ""; + + /** + * AddNodesNodeGroupRequest nodeGroupsAddNodesRequestResource. + * @member {google.cloud.compute.v1.INodeGroupsAddNodesRequest|null|undefined} nodeGroupsAddNodesRequestResource + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @instance + */ + AddNodesNodeGroupRequest.prototype.nodeGroupsAddNodesRequestResource = null; + + /** + * AddNodesNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @instance + */ + AddNodesNodeGroupRequest.prototype.project = ""; + + /** + * AddNodesNodeGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @instance + */ + AddNodesNodeGroupRequest.prototype.requestId = null; + + /** + * AddNodesNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @instance + */ + AddNodesNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddNodesNodeGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @instance + */ + Object.defineProperty(AddNodesNodeGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddNodesNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IAddNodesNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddNodesNodeGroupRequest} AddNodesNodeGroupRequest instance + */ + AddNodesNodeGroupRequest.create = function create(properties) { + return new AddNodesNodeGroupRequest(properties); + }; + + /** + * Encodes the specified AddNodesNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.AddNodesNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IAddNodesNodeGroupRequest} message AddNodesNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddNodesNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.nodeGroupsAddNodesRequestResource != null && Object.hasOwnProperty.call(message, "nodeGroupsAddNodesRequestResource")) + $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest.encode(message.nodeGroupsAddNodesRequestResource, writer.uint32(/* id 131263288, wireType 2 =*/1050106306).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + return writer; + }; + + /** + * Encodes the specified AddNodesNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddNodesNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IAddNodesNodeGroupRequest} message AddNodesNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddNodesNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddNodesNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddNodesNodeGroupRequest} AddNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddNodesNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddNodesNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 469958146: + message.nodeGroup = reader.string(); + break; + case 131263288: + message.nodeGroupsAddNodesRequestResource = $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddNodesNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddNodesNodeGroupRequest} AddNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddNodesNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddNodesNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddNodesNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.nodeGroupsAddNodesRequestResource != null && message.hasOwnProperty("nodeGroupsAddNodesRequestResource")) { + var error = $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest.verify(message.nodeGroupsAddNodesRequestResource); + if (error) + return "nodeGroupsAddNodesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an AddNodesNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddNodesNodeGroupRequest} AddNodesNodeGroupRequest + */ + AddNodesNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddNodesNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddNodesNodeGroupRequest(); + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.nodeGroupsAddNodesRequestResource != null) { + if (typeof object.nodeGroupsAddNodesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddNodesNodeGroupRequest.nodeGroupsAddNodesRequestResource: object expected"); + message.nodeGroupsAddNodesRequestResource = $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest.fromObject(object.nodeGroupsAddNodesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an AddNodesNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.AddNodesNodeGroupRequest} message AddNodesNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddNodesNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.nodeGroupsAddNodesRequestResource = null; + object.project = ""; + object.nodeGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.nodeGroupsAddNodesRequestResource != null && message.hasOwnProperty("nodeGroupsAddNodesRequestResource")) + object.nodeGroupsAddNodesRequestResource = $root.google.cloud.compute.v1.NodeGroupsAddNodesRequest.toObject(message.nodeGroupsAddNodesRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + return object; + }; + + /** + * Converts this AddNodesNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddNodesNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + AddNodesNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddNodesNodeGroupRequest; + })(); + + v1.AggregatedListNodeGroupsRequest = (function() { + + /** + * Properties of an AggregatedListNodeGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListNodeGroupsRequest + * @property {string|null} [filter] AggregatedListNodeGroupsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListNodeGroupsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListNodeGroupsRequest maxResults + * @property {string|null} [orderBy] AggregatedListNodeGroupsRequest orderBy + * @property {string|null} [pageToken] AggregatedListNodeGroupsRequest pageToken + * @property {string|null} [project] AggregatedListNodeGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListNodeGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListNodeGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListNodeGroupsRequest. + * @implements IAggregatedListNodeGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListNodeGroupsRequest=} [properties] Properties to set + */ + function AggregatedListNodeGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListNodeGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + AggregatedListNodeGroupsRequest.prototype.filter = null; + + /** + * AggregatedListNodeGroupsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + AggregatedListNodeGroupsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListNodeGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + AggregatedListNodeGroupsRequest.prototype.maxResults = null; + + /** + * AggregatedListNodeGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + AggregatedListNodeGroupsRequest.prototype.orderBy = null; + + /** + * AggregatedListNodeGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + AggregatedListNodeGroupsRequest.prototype.pageToken = null; + + /** + * AggregatedListNodeGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + AggregatedListNodeGroupsRequest.prototype.project = ""; + + /** + * AggregatedListNodeGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + AggregatedListNodeGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListNodeGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeGroupsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeGroupsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListNodeGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListNodeGroupsRequest} AggregatedListNodeGroupsRequest instance + */ + AggregatedListNodeGroupsRequest.create = function create(properties) { + return new AggregatedListNodeGroupsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListNodeGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeGroupsRequest} message AggregatedListNodeGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNodeGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListNodeGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeGroupsRequest} message AggregatedListNodeGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNodeGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListNodeGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListNodeGroupsRequest} AggregatedListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNodeGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListNodeGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListNodeGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListNodeGroupsRequest} AggregatedListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNodeGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListNodeGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListNodeGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListNodeGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListNodeGroupsRequest} AggregatedListNodeGroupsRequest + */ + AggregatedListNodeGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListNodeGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListNodeGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListNodeGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListNodeGroupsRequest} message AggregatedListNodeGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListNodeGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListNodeGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListNodeGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListNodeGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListNodeGroupsRequest; + })(); + + v1.DeleteNodeGroupRequest = (function() { + + /** + * Properties of a DeleteNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteNodeGroupRequest + * @property {string|null} [nodeGroup] DeleteNodeGroupRequest nodeGroup + * @property {string|null} [project] DeleteNodeGroupRequest project + * @property {string|null} [requestId] DeleteNodeGroupRequest requestId + * @property {string|null} [zone] DeleteNodeGroupRequest zone + */ + + /** + * Constructs a new DeleteNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteNodeGroupRequest. + * @implements IDeleteNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteNodeGroupRequest=} [properties] Properties to set + */ + function DeleteNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNodeGroupRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @instance + */ + DeleteNodeGroupRequest.prototype.nodeGroup = ""; + + /** + * DeleteNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @instance + */ + DeleteNodeGroupRequest.prototype.project = ""; + + /** + * DeleteNodeGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @instance + */ + DeleteNodeGroupRequest.prototype.requestId = null; + + /** + * DeleteNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @instance + */ + DeleteNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteNodeGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @instance + */ + Object.defineProperty(DeleteNodeGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteNodeGroupRequest} DeleteNodeGroupRequest instance + */ + DeleteNodeGroupRequest.create = function create(properties) { + return new DeleteNodeGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodeGroupRequest} message DeleteNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + return writer; + }; + + /** + * Encodes the specified DeleteNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodeGroupRequest} message DeleteNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteNodeGroupRequest} DeleteNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 469958146: + message.nodeGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteNodeGroupRequest} DeleteNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteNodeGroupRequest} DeleteNodeGroupRequest + */ + DeleteNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteNodeGroupRequest(); + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.DeleteNodeGroupRequest} message DeleteNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.nodeGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + return object; + }; + + /** + * Converts this DeleteNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteNodeGroupRequest; + })(); + + v1.DeleteNodesNodeGroupRequest = (function() { + + /** + * Properties of a DeleteNodesNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteNodesNodeGroupRequest + * @property {string|null} [nodeGroup] DeleteNodesNodeGroupRequest nodeGroup + * @property {google.cloud.compute.v1.INodeGroupsDeleteNodesRequest|null} [nodeGroupsDeleteNodesRequestResource] DeleteNodesNodeGroupRequest nodeGroupsDeleteNodesRequestResource + * @property {string|null} [project] DeleteNodesNodeGroupRequest project + * @property {string|null} [requestId] DeleteNodesNodeGroupRequest requestId + * @property {string|null} [zone] DeleteNodesNodeGroupRequest zone + */ + + /** + * Constructs a new DeleteNodesNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteNodesNodeGroupRequest. + * @implements IDeleteNodesNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteNodesNodeGroupRequest=} [properties] Properties to set + */ + function DeleteNodesNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNodesNodeGroupRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @instance + */ + DeleteNodesNodeGroupRequest.prototype.nodeGroup = ""; + + /** + * DeleteNodesNodeGroupRequest nodeGroupsDeleteNodesRequestResource. + * @member {google.cloud.compute.v1.INodeGroupsDeleteNodesRequest|null|undefined} nodeGroupsDeleteNodesRequestResource + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @instance + */ + DeleteNodesNodeGroupRequest.prototype.nodeGroupsDeleteNodesRequestResource = null; + + /** + * DeleteNodesNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @instance + */ + DeleteNodesNodeGroupRequest.prototype.project = ""; + + /** + * DeleteNodesNodeGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @instance + */ + DeleteNodesNodeGroupRequest.prototype.requestId = null; + + /** + * DeleteNodesNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @instance + */ + DeleteNodesNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteNodesNodeGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @instance + */ + Object.defineProperty(DeleteNodesNodeGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteNodesNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodesNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteNodesNodeGroupRequest} DeleteNodesNodeGroupRequest instance + */ + DeleteNodesNodeGroupRequest.create = function create(properties) { + return new DeleteNodesNodeGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteNodesNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNodesNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodesNodeGroupRequest} message DeleteNodesNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodesNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.nodeGroupsDeleteNodesRequestResource != null && Object.hasOwnProperty.call(message, "nodeGroupsDeleteNodesRequestResource")) + $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.encode(message.nodeGroupsDeleteNodesRequestResource, writer.uint32(/* id 183298962, wireType 2 =*/1466391698).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + return writer; + }; + + /** + * Encodes the specified DeleteNodesNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNodesNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodesNodeGroupRequest} message DeleteNodesNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodesNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNodesNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteNodesNodeGroupRequest} DeleteNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodesNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteNodesNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 469958146: + message.nodeGroup = reader.string(); + break; + case 183298962: + message.nodeGroupsDeleteNodesRequestResource = $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteNodesNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteNodesNodeGroupRequest} DeleteNodesNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodesNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNodesNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNodesNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.nodeGroupsDeleteNodesRequestResource != null && message.hasOwnProperty("nodeGroupsDeleteNodesRequestResource")) { + var error = $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.verify(message.nodeGroupsDeleteNodesRequestResource); + if (error) + return "nodeGroupsDeleteNodesRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteNodesNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteNodesNodeGroupRequest} DeleteNodesNodeGroupRequest + */ + DeleteNodesNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteNodesNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteNodesNodeGroupRequest(); + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.nodeGroupsDeleteNodesRequestResource != null) { + if (typeof object.nodeGroupsDeleteNodesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.DeleteNodesNodeGroupRequest.nodeGroupsDeleteNodesRequestResource: object expected"); + message.nodeGroupsDeleteNodesRequestResource = $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.fromObject(object.nodeGroupsDeleteNodesRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteNodesNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.DeleteNodesNodeGroupRequest} message DeleteNodesNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNodesNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.nodeGroupsDeleteNodesRequestResource = null; + object.project = ""; + object.nodeGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.nodeGroupsDeleteNodesRequestResource != null && message.hasOwnProperty("nodeGroupsDeleteNodesRequestResource")) + object.nodeGroupsDeleteNodesRequestResource = $root.google.cloud.compute.v1.NodeGroupsDeleteNodesRequest.toObject(message.nodeGroupsDeleteNodesRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + return object; + }; + + /** + * Converts this DeleteNodesNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteNodesNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNodesNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteNodesNodeGroupRequest; + })(); + + v1.GetNodeGroupRequest = (function() { + + /** + * Properties of a GetNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetNodeGroupRequest + * @property {string|null} [nodeGroup] GetNodeGroupRequest nodeGroup + * @property {string|null} [project] GetNodeGroupRequest project + * @property {string|null} [zone] GetNodeGroupRequest zone + */ + + /** + * Constructs a new GetNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetNodeGroupRequest. + * @implements IGetNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IGetNodeGroupRequest=} [properties] Properties to set + */ + function GetNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeGroupRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @instance + */ + GetNodeGroupRequest.prototype.nodeGroup = ""; + + /** + * GetNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @instance + */ + GetNodeGroupRequest.prototype.project = ""; + + /** + * GetNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @instance + */ + GetNodeGroupRequest.prototype.zone = ""; + + /** + * Creates a new GetNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetNodeGroupRequest} GetNodeGroupRequest instance + */ + GetNodeGroupRequest.create = function create(properties) { + return new GetNodeGroupRequest(properties); + }; + + /** + * Encodes the specified GetNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeGroupRequest} message GetNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + return writer; + }; + + /** + * Encodes the specified GetNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeGroupRequest} message GetNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetNodeGroupRequest} GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 469958146: + message.nodeGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetNodeGroupRequest} GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetNodeGroupRequest} GetNodeGroupRequest + */ + GetNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetNodeGroupRequest(); + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.GetNodeGroupRequest} message GetNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.nodeGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + return object; + }; + + /** + * Converts this GetNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNodeGroupRequest; + })(); + + v1.GetIamPolicyNodeGroupRequest = (function() { + + /** + * Properties of a GetIamPolicyNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyNodeGroupRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyNodeGroupRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyNodeGroupRequest project + * @property {string|null} [resource] GetIamPolicyNodeGroupRequest resource + * @property {string|null} [zone] GetIamPolicyNodeGroupRequest zone + */ + + /** + * Constructs a new GetIamPolicyNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyNodeGroupRequest. + * @implements IGetIamPolicyNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest=} [properties] Properties to set + */ + function GetIamPolicyNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyNodeGroupRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @instance + */ + GetIamPolicyNodeGroupRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @instance + */ + GetIamPolicyNodeGroupRequest.prototype.project = ""; + + /** + * GetIamPolicyNodeGroupRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @instance + */ + GetIamPolicyNodeGroupRequest.prototype.resource = ""; + + /** + * GetIamPolicyNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @instance + */ + GetIamPolicyNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyNodeGroupRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @instance + */ + Object.defineProperty(GetIamPolicyNodeGroupRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyNodeGroupRequest} GetIamPolicyNodeGroupRequest instance + */ + GetIamPolicyNodeGroupRequest.create = function create(properties) { + return new GetIamPolicyNodeGroupRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest} message GetIamPolicyNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest} message GetIamPolicyNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyNodeGroupRequest} GetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyNodeGroupRequest} GetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyNodeGroupRequest} GetIamPolicyNodeGroupRequest + */ + GetIamPolicyNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyNodeGroupRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyNodeGroupRequest} message GetIamPolicyNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyNodeGroupRequest; + })(); + + v1.InsertNodeGroupRequest = (function() { + + /** + * Properties of an InsertNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertNodeGroupRequest + * @property {number|null} [initialNodeCount] InsertNodeGroupRequest initialNodeCount + * @property {google.cloud.compute.v1.INodeGroup|null} [nodeGroupResource] InsertNodeGroupRequest nodeGroupResource + * @property {string|null} [project] InsertNodeGroupRequest project + * @property {string|null} [requestId] InsertNodeGroupRequest requestId + * @property {string|null} [zone] InsertNodeGroupRequest zone + */ + + /** + * Constructs a new InsertNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertNodeGroupRequest. + * @implements IInsertNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertNodeGroupRequest=} [properties] Properties to set + */ + function InsertNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertNodeGroupRequest initialNodeCount. + * @member {number} initialNodeCount + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @instance + */ + InsertNodeGroupRequest.prototype.initialNodeCount = 0; + + /** + * InsertNodeGroupRequest nodeGroupResource. + * @member {google.cloud.compute.v1.INodeGroup|null|undefined} nodeGroupResource + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @instance + */ + InsertNodeGroupRequest.prototype.nodeGroupResource = null; + + /** + * InsertNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @instance + */ + InsertNodeGroupRequest.prototype.project = ""; + + /** + * InsertNodeGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @instance + */ + InsertNodeGroupRequest.prototype.requestId = null; + + /** + * InsertNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @instance + */ + InsertNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertNodeGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @instance + */ + Object.defineProperty(InsertNodeGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertNodeGroupRequest} InsertNodeGroupRequest instance + */ + InsertNodeGroupRequest.create = function create(properties) { + return new InsertNodeGroupRequest(properties); + }; + + /** + * Encodes the specified InsertNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertNodeGroupRequest} message InsertNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.initialNodeCount != null && Object.hasOwnProperty.call(message, "initialNodeCount")) + writer.uint32(/* id 71951469, wireType 0 =*/575611752).int32(message.initialNodeCount); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroupResource != null && Object.hasOwnProperty.call(message, "nodeGroupResource")) + $root.google.cloud.compute.v1.NodeGroup.encode(message.nodeGroupResource, writer.uint32(/* id 505321899, wireType 2 =*/4042575194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertNodeGroupRequest} message InsertNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertNodeGroupRequest} InsertNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 71951469: + message.initialNodeCount = reader.int32(); + break; + case 505321899: + message.nodeGroupResource = $root.google.cloud.compute.v1.NodeGroup.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertNodeGroupRequest} InsertNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.initialNodeCount != null && message.hasOwnProperty("initialNodeCount")) + if (!$util.isInteger(message.initialNodeCount)) + return "initialNodeCount: integer expected"; + if (message.nodeGroupResource != null && message.hasOwnProperty("nodeGroupResource")) { + var error = $root.google.cloud.compute.v1.NodeGroup.verify(message.nodeGroupResource); + if (error) + return "nodeGroupResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertNodeGroupRequest} InsertNodeGroupRequest + */ + InsertNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertNodeGroupRequest(); + if (object.initialNodeCount != null) + message.initialNodeCount = object.initialNodeCount | 0; + if (object.nodeGroupResource != null) { + if (typeof object.nodeGroupResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertNodeGroupRequest.nodeGroupResource: object expected"); + message.nodeGroupResource = $root.google.cloud.compute.v1.NodeGroup.fromObject(object.nodeGroupResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.InsertNodeGroupRequest} message InsertNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.initialNodeCount = 0; + object.project = ""; + object.nodeGroupResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.initialNodeCount != null && message.hasOwnProperty("initialNodeCount")) + object.initialNodeCount = message.initialNodeCount; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroupResource != null && message.hasOwnProperty("nodeGroupResource")) + object.nodeGroupResource = $root.google.cloud.compute.v1.NodeGroup.toObject(message.nodeGroupResource, options); + return object; + }; + + /** + * Converts this InsertNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + InsertNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertNodeGroupRequest; + })(); + + v1.ListNodeGroupsRequest = (function() { + + /** + * Properties of a ListNodeGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNodeGroupsRequest + * @property {string|null} [filter] ListNodeGroupsRequest filter + * @property {number|null} [maxResults] ListNodeGroupsRequest maxResults + * @property {string|null} [orderBy] ListNodeGroupsRequest orderBy + * @property {string|null} [pageToken] ListNodeGroupsRequest pageToken + * @property {string|null} [project] ListNodeGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListNodeGroupsRequest returnPartialSuccess + * @property {string|null} [zone] ListNodeGroupsRequest zone + */ + + /** + * Constructs a new ListNodeGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNodeGroupsRequest. + * @implements IListNodeGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListNodeGroupsRequest=} [properties] Properties to set + */ + function ListNodeGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNodeGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + ListNodeGroupsRequest.prototype.filter = null; + + /** + * ListNodeGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + ListNodeGroupsRequest.prototype.maxResults = null; + + /** + * ListNodeGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + ListNodeGroupsRequest.prototype.orderBy = null; + + /** + * ListNodeGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + ListNodeGroupsRequest.prototype.pageToken = null; + + /** + * ListNodeGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + ListNodeGroupsRequest.prototype.project = ""; + + /** + * ListNodeGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + ListNodeGroupsRequest.prototype.returnPartialSuccess = null; + + /** + * ListNodeGroupsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + ListNodeGroupsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNodeGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodeGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodeGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodeGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodeGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodeGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNodeGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNodeGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNodeGroupsRequest} ListNodeGroupsRequest instance + */ + ListNodeGroupsRequest.create = function create(properties) { + return new ListNodeGroupsRequest(properties); + }; + + /** + * Encodes the specified ListNodeGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodeGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNodeGroupsRequest} message ListNodeGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNodeGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodeGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNodeGroupsRequest} message ListNodeGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodeGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNodeGroupsRequest} ListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNodeGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNodeGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNodeGroupsRequest} ListNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodeGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodeGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListNodeGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNodeGroupsRequest} ListNodeGroupsRequest + */ + ListNodeGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNodeGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNodeGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListNodeGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListNodeGroupsRequest} message ListNodeGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodeGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNodeGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNodeGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNodeGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNodeGroupsRequest; + })(); + + v1.ListNodesNodeGroupsRequest = (function() { + + /** + * Properties of a ListNodesNodeGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNodesNodeGroupsRequest + * @property {string|null} [filter] ListNodesNodeGroupsRequest filter + * @property {number|null} [maxResults] ListNodesNodeGroupsRequest maxResults + * @property {string|null} [nodeGroup] ListNodesNodeGroupsRequest nodeGroup + * @property {string|null} [orderBy] ListNodesNodeGroupsRequest orderBy + * @property {string|null} [pageToken] ListNodesNodeGroupsRequest pageToken + * @property {string|null} [project] ListNodesNodeGroupsRequest project + * @property {boolean|null} [returnPartialSuccess] ListNodesNodeGroupsRequest returnPartialSuccess + * @property {string|null} [zone] ListNodesNodeGroupsRequest zone + */ + + /** + * Constructs a new ListNodesNodeGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNodesNodeGroupsRequest. + * @implements IListNodesNodeGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListNodesNodeGroupsRequest=} [properties] Properties to set + */ + function ListNodesNodeGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNodesNodeGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.filter = null; + + /** + * ListNodesNodeGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.maxResults = null; + + /** + * ListNodesNodeGroupsRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.nodeGroup = ""; + + /** + * ListNodesNodeGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.orderBy = null; + + /** + * ListNodesNodeGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.pageToken = null; + + /** + * ListNodesNodeGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.project = ""; + + /** + * ListNodesNodeGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.returnPartialSuccess = null; + + /** + * ListNodesNodeGroupsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + ListNodesNodeGroupsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNodesNodeGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodesNodeGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodesNodeGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodesNodeGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodesNodeGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodesNodeGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodesNodeGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodesNodeGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodesNodeGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + */ + Object.defineProperty(ListNodesNodeGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNodesNodeGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNodesNodeGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNodesNodeGroupsRequest} ListNodesNodeGroupsRequest instance + */ + ListNodesNodeGroupsRequest.create = function create(properties) { + return new ListNodesNodeGroupsRequest(properties); + }; + + /** + * Encodes the specified ListNodesNodeGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodesNodeGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNodesNodeGroupsRequest} message ListNodesNodeGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodesNodeGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNodesNodeGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodesNodeGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListNodesNodeGroupsRequest} message ListNodesNodeGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodesNodeGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodesNodeGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNodesNodeGroupsRequest} ListNodesNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodesNodeGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNodesNodeGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 469958146: + message.nodeGroup = reader.string(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNodesNodeGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNodesNodeGroupsRequest} ListNodesNodeGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodesNodeGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodesNodeGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodesNodeGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListNodesNodeGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNodesNodeGroupsRequest} ListNodesNodeGroupsRequest + */ + ListNodesNodeGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNodesNodeGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNodesNodeGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListNodesNodeGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListNodesNodeGroupsRequest} message ListNodesNodeGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodesNodeGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.nodeGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNodesNodeGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNodesNodeGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListNodesNodeGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNodesNodeGroupsRequest; + })(); + + v1.PatchNodeGroupRequest = (function() { + + /** + * Properties of a PatchNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchNodeGroupRequest + * @property {string|null} [nodeGroup] PatchNodeGroupRequest nodeGroup + * @property {google.cloud.compute.v1.INodeGroup|null} [nodeGroupResource] PatchNodeGroupRequest nodeGroupResource + * @property {string|null} [project] PatchNodeGroupRequest project + * @property {string|null} [requestId] PatchNodeGroupRequest requestId + * @property {string|null} [zone] PatchNodeGroupRequest zone + */ + + /** + * Constructs a new PatchNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchNodeGroupRequest. + * @implements IPatchNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchNodeGroupRequest=} [properties] Properties to set + */ + function PatchNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchNodeGroupRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @instance + */ + PatchNodeGroupRequest.prototype.nodeGroup = ""; + + /** + * PatchNodeGroupRequest nodeGroupResource. + * @member {google.cloud.compute.v1.INodeGroup|null|undefined} nodeGroupResource + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @instance + */ + PatchNodeGroupRequest.prototype.nodeGroupResource = null; + + /** + * PatchNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @instance + */ + PatchNodeGroupRequest.prototype.project = ""; + + /** + * PatchNodeGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @instance + */ + PatchNodeGroupRequest.prototype.requestId = null; + + /** + * PatchNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @instance + */ + PatchNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchNodeGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @instance + */ + Object.defineProperty(PatchNodeGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IPatchNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchNodeGroupRequest} PatchNodeGroupRequest instance + */ + PatchNodeGroupRequest.create = function create(properties) { + return new PatchNodeGroupRequest(properties); + }; + + /** + * Encodes the specified PatchNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IPatchNodeGroupRequest} message PatchNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + if (message.nodeGroupResource != null && Object.hasOwnProperty.call(message, "nodeGroupResource")) + $root.google.cloud.compute.v1.NodeGroup.encode(message.nodeGroupResource, writer.uint32(/* id 505321899, wireType 2 =*/4042575194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.IPatchNodeGroupRequest} message PatchNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchNodeGroupRequest} PatchNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 469958146: + message.nodeGroup = reader.string(); + break; + case 505321899: + message.nodeGroupResource = $root.google.cloud.compute.v1.NodeGroup.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchNodeGroupRequest} PatchNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.nodeGroupResource != null && message.hasOwnProperty("nodeGroupResource")) { + var error = $root.google.cloud.compute.v1.NodeGroup.verify(message.nodeGroupResource); + if (error) + return "nodeGroupResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a PatchNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchNodeGroupRequest} PatchNodeGroupRequest + */ + PatchNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchNodeGroupRequest(); + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.nodeGroupResource != null) { + if (typeof object.nodeGroupResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchNodeGroupRequest.nodeGroupResource: object expected"); + message.nodeGroupResource = $root.google.cloud.compute.v1.NodeGroup.fromObject(object.nodeGroupResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a PatchNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.PatchNodeGroupRequest} message PatchNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.nodeGroup = ""; + object.nodeGroupResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + if (message.nodeGroupResource != null && message.hasOwnProperty("nodeGroupResource")) + object.nodeGroupResource = $root.google.cloud.compute.v1.NodeGroup.toObject(message.nodeGroupResource, options); + return object; + }; + + /** + * Converts this PatchNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + PatchNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchNodeGroupRequest; + })(); + + v1.SetIamPolicyNodeGroupRequest = (function() { + + /** + * Properties of a SetIamPolicyNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyNodeGroupRequest + * @property {string|null} [project] SetIamPolicyNodeGroupRequest project + * @property {string|null} [resource] SetIamPolicyNodeGroupRequest resource + * @property {string|null} [zone] SetIamPolicyNodeGroupRequest zone + * @property {google.cloud.compute.v1.IZoneSetPolicyRequest|null} [zoneSetPolicyRequestResource] SetIamPolicyNodeGroupRequest zoneSetPolicyRequestResource + */ + + /** + * Constructs a new SetIamPolicyNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyNodeGroupRequest. + * @implements ISetIamPolicyNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest=} [properties] Properties to set + */ + function SetIamPolicyNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @instance + */ + SetIamPolicyNodeGroupRequest.prototype.project = ""; + + /** + * SetIamPolicyNodeGroupRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @instance + */ + SetIamPolicyNodeGroupRequest.prototype.resource = ""; + + /** + * SetIamPolicyNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @instance + */ + SetIamPolicyNodeGroupRequest.prototype.zone = ""; + + /** + * SetIamPolicyNodeGroupRequest zoneSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IZoneSetPolicyRequest|null|undefined} zoneSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @instance + */ + SetIamPolicyNodeGroupRequest.prototype.zoneSetPolicyRequestResource = null; + + /** + * Creates a new SetIamPolicyNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyNodeGroupRequest} SetIamPolicyNodeGroupRequest instance + */ + SetIamPolicyNodeGroupRequest.create = function create(properties) { + return new SetIamPolicyNodeGroupRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest} message SetIamPolicyNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.zoneSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "zoneSetPolicyRequestResource")) + $root.google.cloud.compute.v1.ZoneSetPolicyRequest.encode(message.zoneSetPolicyRequestResource, writer.uint32(/* id 382082107, wireType 2 =*/3056656858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest} message SetIamPolicyNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyNodeGroupRequest} SetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + case 382082107: + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyNodeGroupRequest} SetIamPolicyNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.verify(message.zoneSetPolicyRequestResource); + if (error) + return "zoneSetPolicyRequestResource." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyNodeGroupRequest} SetIamPolicyNodeGroupRequest + */ + SetIamPolicyNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyNodeGroupRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + if (object.zoneSetPolicyRequestResource != null) { + if (typeof object.zoneSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyNodeGroupRequest.zoneSetPolicyRequestResource: object expected"); + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.fromObject(object.zoneSetPolicyRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyNodeGroupRequest} message SetIamPolicyNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.zoneSetPolicyRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) + object.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.toObject(message.zoneSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyNodeGroupRequest; + })(); + + v1.SetNodeTemplateNodeGroupRequest = (function() { + + /** + * Properties of a SetNodeTemplateNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetNodeTemplateNodeGroupRequest + * @property {string|null} [nodeGroup] SetNodeTemplateNodeGroupRequest nodeGroup + * @property {google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest|null} [nodeGroupsSetNodeTemplateRequestResource] SetNodeTemplateNodeGroupRequest nodeGroupsSetNodeTemplateRequestResource + * @property {string|null} [project] SetNodeTemplateNodeGroupRequest project + * @property {string|null} [requestId] SetNodeTemplateNodeGroupRequest requestId + * @property {string|null} [zone] SetNodeTemplateNodeGroupRequest zone + */ + + /** + * Constructs a new SetNodeTemplateNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetNodeTemplateNodeGroupRequest. + * @implements ISetNodeTemplateNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest=} [properties] Properties to set + */ + function SetNodeTemplateNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetNodeTemplateNodeGroupRequest nodeGroup. + * @member {string} nodeGroup + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @instance + */ + SetNodeTemplateNodeGroupRequest.prototype.nodeGroup = ""; + + /** + * SetNodeTemplateNodeGroupRequest nodeGroupsSetNodeTemplateRequestResource. + * @member {google.cloud.compute.v1.INodeGroupsSetNodeTemplateRequest|null|undefined} nodeGroupsSetNodeTemplateRequestResource + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @instance + */ + SetNodeTemplateNodeGroupRequest.prototype.nodeGroupsSetNodeTemplateRequestResource = null; + + /** + * SetNodeTemplateNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @instance + */ + SetNodeTemplateNodeGroupRequest.prototype.project = ""; + + /** + * SetNodeTemplateNodeGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @instance + */ + SetNodeTemplateNodeGroupRequest.prototype.requestId = null; + + /** + * SetNodeTemplateNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @instance + */ + SetNodeTemplateNodeGroupRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetNodeTemplateNodeGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @instance + */ + Object.defineProperty(SetNodeTemplateNodeGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetNodeTemplateNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest} SetNodeTemplateNodeGroupRequest instance + */ + SetNodeTemplateNodeGroupRequest.create = function create(properties) { + return new SetNodeTemplateNodeGroupRequest(properties); + }; + + /** + * Encodes the specified SetNodeTemplateNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest} message SetNodeTemplateNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetNodeTemplateNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.nodeGroupsSetNodeTemplateRequestResource != null && Object.hasOwnProperty.call(message, "nodeGroupsSetNodeTemplateRequestResource")) + $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.encode(message.nodeGroupsSetNodeTemplateRequestResource, writer.uint32(/* id 117382321, wireType 2 =*/939058570).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + writer.uint32(/* id 469958146, wireType 2 =*/3759665170).string(message.nodeGroup); + return writer; + }; + + /** + * Encodes the specified SetNodeTemplateNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest} message SetNodeTemplateNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetNodeTemplateNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetNodeTemplateNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest} SetNodeTemplateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetNodeTemplateNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 469958146: + message.nodeGroup = reader.string(); + break; + case 117382321: + message.nodeGroupsSetNodeTemplateRequestResource = $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetNodeTemplateNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest} SetNodeTemplateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetNodeTemplateNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetNodeTemplateNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetNodeTemplateNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + if (!$util.isString(message.nodeGroup)) + return "nodeGroup: string expected"; + if (message.nodeGroupsSetNodeTemplateRequestResource != null && message.hasOwnProperty("nodeGroupsSetNodeTemplateRequestResource")) { + var error = $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.verify(message.nodeGroupsSetNodeTemplateRequestResource); + if (error) + return "nodeGroupsSetNodeTemplateRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a SetNodeTemplateNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest} SetNodeTemplateNodeGroupRequest + */ + SetNodeTemplateNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest(); + if (object.nodeGroup != null) + message.nodeGroup = String(object.nodeGroup); + if (object.nodeGroupsSetNodeTemplateRequestResource != null) { + if (typeof object.nodeGroupsSetNodeTemplateRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest.nodeGroupsSetNodeTemplateRequestResource: object expected"); + message.nodeGroupsSetNodeTemplateRequestResource = $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.fromObject(object.nodeGroupsSetNodeTemplateRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a SetNodeTemplateNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest} message SetNodeTemplateNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetNodeTemplateNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.nodeGroupsSetNodeTemplateRequestResource = null; + object.project = ""; + object.nodeGroup = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.nodeGroupsSetNodeTemplateRequestResource != null && message.hasOwnProperty("nodeGroupsSetNodeTemplateRequestResource")) + object.nodeGroupsSetNodeTemplateRequestResource = $root.google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest.toObject(message.nodeGroupsSetNodeTemplateRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = message.nodeGroup; + return object; + }; + + /** + * Converts this SetNodeTemplateNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + SetNodeTemplateNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetNodeTemplateNodeGroupRequest; + })(); + + v1.TestIamPermissionsNodeGroupRequest = (function() { + + /** + * Properties of a TestIamPermissionsNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsNodeGroupRequest + * @property {string|null} [project] TestIamPermissionsNodeGroupRequest project + * @property {string|null} [resource] TestIamPermissionsNodeGroupRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsNodeGroupRequest testPermissionsRequestResource + * @property {string|null} [zone] TestIamPermissionsNodeGroupRequest zone + */ + + /** + * Constructs a new TestIamPermissionsNodeGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsNodeGroupRequest. + * @implements ITestIamPermissionsNodeGroupRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest=} [properties] Properties to set + */ + function TestIamPermissionsNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsNodeGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @instance + */ + TestIamPermissionsNodeGroupRequest.prototype.project = ""; + + /** + * TestIamPermissionsNodeGroupRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @instance + */ + TestIamPermissionsNodeGroupRequest.prototype.resource = ""; + + /** + * TestIamPermissionsNodeGroupRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @instance + */ + TestIamPermissionsNodeGroupRequest.prototype.testPermissionsRequestResource = null; + + /** + * TestIamPermissionsNodeGroupRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @instance + */ + TestIamPermissionsNodeGroupRequest.prototype.zone = ""; + + /** + * Creates a new TestIamPermissionsNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest} TestIamPermissionsNodeGroupRequest instance + */ + TestIamPermissionsNodeGroupRequest.create = function create(properties) { + return new TestIamPermissionsNodeGroupRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsNodeGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest} message TestIamPermissionsNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest} message TestIamPermissionsNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest} TestIamPermissionsNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsNodeGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest} TestIamPermissionsNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsNodeGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a TestIamPermissionsNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest} TestIamPermissionsNodeGroupRequest + */ + TestIamPermissionsNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest} message TestIamPermissionsNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsNodeGroupRequest; + })(); + + v1.AggregatedListNodeTemplatesRequest = (function() { + + /** + * Properties of an AggregatedListNodeTemplatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListNodeTemplatesRequest + * @property {string|null} [filter] AggregatedListNodeTemplatesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListNodeTemplatesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListNodeTemplatesRequest maxResults + * @property {string|null} [orderBy] AggregatedListNodeTemplatesRequest orderBy + * @property {string|null} [pageToken] AggregatedListNodeTemplatesRequest pageToken + * @property {string|null} [project] AggregatedListNodeTemplatesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListNodeTemplatesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListNodeTemplatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListNodeTemplatesRequest. + * @implements IAggregatedListNodeTemplatesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest=} [properties] Properties to set + */ + function AggregatedListNodeTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListNodeTemplatesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + AggregatedListNodeTemplatesRequest.prototype.filter = null; + + /** + * AggregatedListNodeTemplatesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + AggregatedListNodeTemplatesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListNodeTemplatesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + AggregatedListNodeTemplatesRequest.prototype.maxResults = null; + + /** + * AggregatedListNodeTemplatesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + AggregatedListNodeTemplatesRequest.prototype.orderBy = null; + + /** + * AggregatedListNodeTemplatesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + AggregatedListNodeTemplatesRequest.prototype.pageToken = null; + + /** + * AggregatedListNodeTemplatesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + AggregatedListNodeTemplatesRequest.prototype.project = ""; + + /** + * AggregatedListNodeTemplatesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + AggregatedListNodeTemplatesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListNodeTemplatesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTemplatesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTemplatesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTemplatesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTemplatesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTemplatesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTemplatesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTemplatesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTemplatesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTemplatesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTemplatesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTemplatesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListNodeTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListNodeTemplatesRequest} AggregatedListNodeTemplatesRequest instance + */ + AggregatedListNodeTemplatesRequest.create = function create(properties) { + return new AggregatedListNodeTemplatesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListNodeTemplatesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest} message AggregatedListNodeTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNodeTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListNodeTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest} message AggregatedListNodeTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNodeTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListNodeTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListNodeTemplatesRequest} AggregatedListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNodeTemplatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListNodeTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListNodeTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListNodeTemplatesRequest} AggregatedListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNodeTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListNodeTemplatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListNodeTemplatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListNodeTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListNodeTemplatesRequest} AggregatedListNodeTemplatesRequest + */ + AggregatedListNodeTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListNodeTemplatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListNodeTemplatesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListNodeTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListNodeTemplatesRequest} message AggregatedListNodeTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListNodeTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListNodeTemplatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListNodeTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListNodeTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListNodeTemplatesRequest; + })(); + + v1.DeleteNodeTemplateRequest = (function() { + + /** + * Properties of a DeleteNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteNodeTemplateRequest + * @property {string|null} [nodeTemplate] DeleteNodeTemplateRequest nodeTemplate + * @property {string|null} [project] DeleteNodeTemplateRequest project + * @property {string|null} [region] DeleteNodeTemplateRequest region + * @property {string|null} [requestId] DeleteNodeTemplateRequest requestId + */ + + /** + * Constructs a new DeleteNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteNodeTemplateRequest. + * @implements IDeleteNodeTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteNodeTemplateRequest=} [properties] Properties to set + */ + function DeleteNodeTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNodeTemplateRequest nodeTemplate. + * @member {string} nodeTemplate + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @instance + */ + DeleteNodeTemplateRequest.prototype.nodeTemplate = ""; + + /** + * DeleteNodeTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @instance + */ + DeleteNodeTemplateRequest.prototype.project = ""; + + /** + * DeleteNodeTemplateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @instance + */ + DeleteNodeTemplateRequest.prototype.region = ""; + + /** + * DeleteNodeTemplateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @instance + */ + DeleteNodeTemplateRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteNodeTemplateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @instance + */ + Object.defineProperty(DeleteNodeTemplateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteNodeTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodeTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteNodeTemplateRequest} DeleteNodeTemplateRequest instance + */ + DeleteNodeTemplateRequest.create = function create(properties) { + return new DeleteNodeTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodeTemplateRequest} message DeleteNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodeTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeTemplate != null && Object.hasOwnProperty.call(message, "nodeTemplate")) + writer.uint32(/* id 323154455, wireType 2 =*/2585235642).string(message.nodeTemplate); + return writer; + }; + + /** + * Encodes the specified DeleteNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteNodeTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteNodeTemplateRequest} message DeleteNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNodeTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNodeTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteNodeTemplateRequest} DeleteNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodeTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteNodeTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 323154455: + message.nodeTemplate = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteNodeTemplateRequest} DeleteNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNodeTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNodeTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNodeTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) + if (!$util.isString(message.nodeTemplate)) + return "nodeTemplate: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteNodeTemplateRequest} DeleteNodeTemplateRequest + */ + DeleteNodeTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteNodeTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteNodeTemplateRequest(); + if (object.nodeTemplate != null) + message.nodeTemplate = String(object.nodeTemplate); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteNodeTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.DeleteNodeTemplateRequest} message DeleteNodeTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNodeTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.nodeTemplate = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) + object.nodeTemplate = message.nodeTemplate; + return object; + }; + + /** + * Converts this DeleteNodeTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteNodeTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNodeTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteNodeTemplateRequest; + })(); + + v1.GetNodeTemplateRequest = (function() { + + /** + * Properties of a GetNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetNodeTemplateRequest + * @property {string|null} [nodeTemplate] GetNodeTemplateRequest nodeTemplate + * @property {string|null} [project] GetNodeTemplateRequest project + * @property {string|null} [region] GetNodeTemplateRequest region + */ + + /** + * Constructs a new GetNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetNodeTemplateRequest. + * @implements IGetNodeTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IGetNodeTemplateRequest=} [properties] Properties to set + */ + function GetNodeTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeTemplateRequest nodeTemplate. + * @member {string} nodeTemplate + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @instance + */ + GetNodeTemplateRequest.prototype.nodeTemplate = ""; + + /** + * GetNodeTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @instance + */ + GetNodeTemplateRequest.prototype.project = ""; + + /** + * GetNodeTemplateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @instance + */ + GetNodeTemplateRequest.prototype.region = ""; + + /** + * Creates a new GetNodeTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetNodeTemplateRequest} GetNodeTemplateRequest instance + */ + GetNodeTemplateRequest.create = function create(properties) { + return new GetNodeTemplateRequest(properties); + }; + + /** + * Encodes the specified GetNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNodeTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeTemplateRequest} message GetNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeTemplate != null && Object.hasOwnProperty.call(message, "nodeTemplate")) + writer.uint32(/* id 323154455, wireType 2 =*/2585235642).string(message.nodeTemplate); + return writer; + }; + + /** + * Encodes the specified GetNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNodeTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeTemplateRequest} message GetNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetNodeTemplateRequest} GetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetNodeTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 323154455: + message.nodeTemplate = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetNodeTemplateRequest} GetNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) + if (!$util.isString(message.nodeTemplate)) + return "nodeTemplate: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetNodeTemplateRequest} GetNodeTemplateRequest + */ + GetNodeTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetNodeTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetNodeTemplateRequest(); + if (object.nodeTemplate != null) + message.nodeTemplate = String(object.nodeTemplate); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetNodeTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.GetNodeTemplateRequest} message GetNodeTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.nodeTemplate = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeTemplate != null && message.hasOwnProperty("nodeTemplate")) + object.nodeTemplate = message.nodeTemplate; + return object; + }; + + /** + * Converts this GetNodeTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetNodeTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodeTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNodeTemplateRequest; + })(); + + v1.GetIamPolicyNodeTemplateRequest = (function() { + + /** + * Properties of a GetIamPolicyNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyNodeTemplateRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyNodeTemplateRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyNodeTemplateRequest project + * @property {string|null} [region] GetIamPolicyNodeTemplateRequest region + * @property {string|null} [resource] GetIamPolicyNodeTemplateRequest resource + */ + + /** + * Constructs a new GetIamPolicyNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyNodeTemplateRequest. + * @implements IGetIamPolicyNodeTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest=} [properties] Properties to set + */ + function GetIamPolicyNodeTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyNodeTemplateRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @instance + */ + GetIamPolicyNodeTemplateRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyNodeTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @instance + */ + GetIamPolicyNodeTemplateRequest.prototype.project = ""; + + /** + * GetIamPolicyNodeTemplateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @instance + */ + GetIamPolicyNodeTemplateRequest.prototype.region = ""; + + /** + * GetIamPolicyNodeTemplateRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @instance + */ + GetIamPolicyNodeTemplateRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyNodeTemplateRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @instance + */ + Object.defineProperty(GetIamPolicyNodeTemplateRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyNodeTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest} GetIamPolicyNodeTemplateRequest instance + */ + GetIamPolicyNodeTemplateRequest.create = function create(properties) { + return new GetIamPolicyNodeTemplateRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest} message GetIamPolicyNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyNodeTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest} message GetIamPolicyNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyNodeTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyNodeTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest} GetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyNodeTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest} GetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyNodeTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyNodeTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyNodeTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest} GetIamPolicyNodeTemplateRequest + */ + GetIamPolicyNodeTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyNodeTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest} message GetIamPolicyNodeTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyNodeTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyNodeTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyNodeTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyNodeTemplateRequest; + })(); + + v1.InsertNodeTemplateRequest = (function() { + + /** + * Properties of an InsertNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertNodeTemplateRequest + * @property {google.cloud.compute.v1.INodeTemplate|null} [nodeTemplateResource] InsertNodeTemplateRequest nodeTemplateResource + * @property {string|null} [project] InsertNodeTemplateRequest project + * @property {string|null} [region] InsertNodeTemplateRequest region + * @property {string|null} [requestId] InsertNodeTemplateRequest requestId + */ + + /** + * Constructs a new InsertNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertNodeTemplateRequest. + * @implements IInsertNodeTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertNodeTemplateRequest=} [properties] Properties to set + */ + function InsertNodeTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertNodeTemplateRequest nodeTemplateResource. + * @member {google.cloud.compute.v1.INodeTemplate|null|undefined} nodeTemplateResource + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @instance + */ + InsertNodeTemplateRequest.prototype.nodeTemplateResource = null; + + /** + * InsertNodeTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @instance + */ + InsertNodeTemplateRequest.prototype.project = ""; + + /** + * InsertNodeTemplateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @instance + */ + InsertNodeTemplateRequest.prototype.region = ""; + + /** + * InsertNodeTemplateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @instance + */ + InsertNodeTemplateRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertNodeTemplateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @instance + */ + Object.defineProperty(InsertNodeTemplateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertNodeTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInsertNodeTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertNodeTemplateRequest} InsertNodeTemplateRequest instance + */ + InsertNodeTemplateRequest.create = function create(properties) { + return new InsertNodeTemplateRequest(properties); + }; + + /** + * Encodes the specified InsertNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertNodeTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInsertNodeTemplateRequest} message InsertNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNodeTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.nodeTemplateResource != null && Object.hasOwnProperty.call(message, "nodeTemplateResource")) + $root.google.cloud.compute.v1.NodeTemplate.encode(message.nodeTemplateResource, writer.uint32(/* id 127364406, wireType 2 =*/1018915250).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertNodeTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.IInsertNodeTemplateRequest} message InsertNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertNodeTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertNodeTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertNodeTemplateRequest} InsertNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNodeTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertNodeTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 127364406: + message.nodeTemplateResource = $root.google.cloud.compute.v1.NodeTemplate.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertNodeTemplateRequest} InsertNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertNodeTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertNodeTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertNodeTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nodeTemplateResource != null && message.hasOwnProperty("nodeTemplateResource")) { + var error = $root.google.cloud.compute.v1.NodeTemplate.verify(message.nodeTemplateResource); + if (error) + return "nodeTemplateResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertNodeTemplateRequest} InsertNodeTemplateRequest + */ + InsertNodeTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertNodeTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertNodeTemplateRequest(); + if (object.nodeTemplateResource != null) { + if (typeof object.nodeTemplateResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertNodeTemplateRequest.nodeTemplateResource: object expected"); + message.nodeTemplateResource = $root.google.cloud.compute.v1.NodeTemplate.fromObject(object.nodeTemplateResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertNodeTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.InsertNodeTemplateRequest} message InsertNodeTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertNodeTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeTemplateResource = null; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.nodeTemplateResource != null && message.hasOwnProperty("nodeTemplateResource")) + object.nodeTemplateResource = $root.google.cloud.compute.v1.NodeTemplate.toObject(message.nodeTemplateResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertNodeTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertNodeTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + InsertNodeTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertNodeTemplateRequest; + })(); + + v1.ListNodeTemplatesRequest = (function() { + + /** + * Properties of a ListNodeTemplatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNodeTemplatesRequest + * @property {string|null} [filter] ListNodeTemplatesRequest filter + * @property {number|null} [maxResults] ListNodeTemplatesRequest maxResults + * @property {string|null} [orderBy] ListNodeTemplatesRequest orderBy + * @property {string|null} [pageToken] ListNodeTemplatesRequest pageToken + * @property {string|null} [project] ListNodeTemplatesRequest project + * @property {string|null} [region] ListNodeTemplatesRequest region + * @property {boolean|null} [returnPartialSuccess] ListNodeTemplatesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListNodeTemplatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNodeTemplatesRequest. + * @implements IListNodeTemplatesRequest + * @constructor + * @param {google.cloud.compute.v1.IListNodeTemplatesRequest=} [properties] Properties to set + */ + function ListNodeTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNodeTemplatesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + ListNodeTemplatesRequest.prototype.filter = null; + + /** + * ListNodeTemplatesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + ListNodeTemplatesRequest.prototype.maxResults = null; + + /** + * ListNodeTemplatesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + ListNodeTemplatesRequest.prototype.orderBy = null; + + /** + * ListNodeTemplatesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + ListNodeTemplatesRequest.prototype.pageToken = null; + + /** + * ListNodeTemplatesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + ListNodeTemplatesRequest.prototype.project = ""; + + /** + * ListNodeTemplatesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + ListNodeTemplatesRequest.prototype.region = ""; + + /** + * ListNodeTemplatesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + ListNodeTemplatesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNodeTemplatesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(ListNodeTemplatesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTemplatesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(ListNodeTemplatesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTemplatesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(ListNodeTemplatesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTemplatesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(ListNodeTemplatesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTemplatesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + */ + Object.defineProperty(ListNodeTemplatesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNodeTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IListNodeTemplatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNodeTemplatesRequest} ListNodeTemplatesRequest instance + */ + ListNodeTemplatesRequest.create = function create(properties) { + return new ListNodeTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListNodeTemplatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodeTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IListNodeTemplatesRequest} message ListNodeTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNodeTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodeTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.IListNodeTemplatesRequest} message ListNodeTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodeTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNodeTemplatesRequest} ListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTemplatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNodeTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNodeTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNodeTemplatesRequest} ListNodeTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodeTemplatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodeTemplatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListNodeTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNodeTemplatesRequest} ListNodeTemplatesRequest + */ + ListNodeTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNodeTemplatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNodeTemplatesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListNodeTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @static + * @param {google.cloud.compute.v1.ListNodeTemplatesRequest} message ListNodeTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodeTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNodeTemplatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNodeTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListNodeTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNodeTemplatesRequest; + })(); + + v1.SetIamPolicyNodeTemplateRequest = (function() { + + /** + * Properties of a SetIamPolicyNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyNodeTemplateRequest + * @property {string|null} [project] SetIamPolicyNodeTemplateRequest project + * @property {string|null} [region] SetIamPolicyNodeTemplateRequest region + * @property {google.cloud.compute.v1.IRegionSetPolicyRequest|null} [regionSetPolicyRequestResource] SetIamPolicyNodeTemplateRequest regionSetPolicyRequestResource + * @property {string|null} [resource] SetIamPolicyNodeTemplateRequest resource + */ + + /** + * Constructs a new SetIamPolicyNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyNodeTemplateRequest. + * @implements ISetIamPolicyNodeTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest=} [properties] Properties to set + */ + function SetIamPolicyNodeTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyNodeTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @instance + */ + SetIamPolicyNodeTemplateRequest.prototype.project = ""; + + /** + * SetIamPolicyNodeTemplateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @instance + */ + SetIamPolicyNodeTemplateRequest.prototype.region = ""; + + /** + * SetIamPolicyNodeTemplateRequest regionSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IRegionSetPolicyRequest|null|undefined} regionSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @instance + */ + SetIamPolicyNodeTemplateRequest.prototype.regionSetPolicyRequestResource = null; + + /** + * SetIamPolicyNodeTemplateRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @instance + */ + SetIamPolicyNodeTemplateRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicyNodeTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest} SetIamPolicyNodeTemplateRequest instance + */ + SetIamPolicyNodeTemplateRequest.create = function create(properties) { + return new SetIamPolicyNodeTemplateRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest} message SetIamPolicyNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyNodeTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "regionSetPolicyRequestResource")) + $root.google.cloud.compute.v1.RegionSetPolicyRequest.encode(message.regionSetPolicyRequestResource, writer.uint32(/* id 276489091, wireType 2 =*/2211912730).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest} message SetIamPolicyNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyNodeTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyNodeTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest} SetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyNodeTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 276489091: + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest} SetIamPolicyNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyNodeTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyNodeTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyNodeTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionSetPolicyRequest.verify(message.regionSetPolicyRequestResource); + if (error) + return "regionSetPolicyRequestResource." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicyNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest} SetIamPolicyNodeTemplateRequest + */ + SetIamPolicyNodeTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionSetPolicyRequestResource != null) { + if (typeof object.regionSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest.regionSetPolicyRequestResource: object expected"); + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.fromObject(object.regionSetPolicyRequestResource); + } + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyNodeTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest} message SetIamPolicyNodeTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyNodeTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.regionSetPolicyRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) + object.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.toObject(message.regionSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyNodeTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyNodeTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyNodeTemplateRequest; + })(); + + v1.TestIamPermissionsNodeTemplateRequest = (function() { + + /** + * Properties of a TestIamPermissionsNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsNodeTemplateRequest + * @property {string|null} [project] TestIamPermissionsNodeTemplateRequest project + * @property {string|null} [region] TestIamPermissionsNodeTemplateRequest region + * @property {string|null} [resource] TestIamPermissionsNodeTemplateRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsNodeTemplateRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsNodeTemplateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsNodeTemplateRequest. + * @implements ITestIamPermissionsNodeTemplateRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest=} [properties] Properties to set + */ + function TestIamPermissionsNodeTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsNodeTemplateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @instance + */ + TestIamPermissionsNodeTemplateRequest.prototype.project = ""; + + /** + * TestIamPermissionsNodeTemplateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @instance + */ + TestIamPermissionsNodeTemplateRequest.prototype.region = ""; + + /** + * TestIamPermissionsNodeTemplateRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @instance + */ + TestIamPermissionsNodeTemplateRequest.prototype.resource = ""; + + /** + * TestIamPermissionsNodeTemplateRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @instance + */ + TestIamPermissionsNodeTemplateRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsNodeTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest} TestIamPermissionsNodeTemplateRequest instance + */ + TestIamPermissionsNodeTemplateRequest.create = function create(properties) { + return new TestIamPermissionsNodeTemplateRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsNodeTemplateRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest} message TestIamPermissionsNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsNodeTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsNodeTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest} message TestIamPermissionsNodeTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsNodeTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsNodeTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest} TestIamPermissionsNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsNodeTemplateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsNodeTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest} TestIamPermissionsNodeTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsNodeTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsNodeTemplateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsNodeTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsNodeTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest} TestIamPermissionsNodeTemplateRequest + */ + TestIamPermissionsNodeTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsNodeTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest} message TestIamPermissionsNodeTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsNodeTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsNodeTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsNodeTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsNodeTemplateRequest; + })(); + + v1.AggregatedListNodeTypesRequest = (function() { + + /** + * Properties of an AggregatedListNodeTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListNodeTypesRequest + * @property {string|null} [filter] AggregatedListNodeTypesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListNodeTypesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListNodeTypesRequest maxResults + * @property {string|null} [orderBy] AggregatedListNodeTypesRequest orderBy + * @property {string|null} [pageToken] AggregatedListNodeTypesRequest pageToken + * @property {string|null} [project] AggregatedListNodeTypesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListNodeTypesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListNodeTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListNodeTypesRequest. + * @implements IAggregatedListNodeTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListNodeTypesRequest=} [properties] Properties to set + */ + function AggregatedListNodeTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListNodeTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + AggregatedListNodeTypesRequest.prototype.filter = null; + + /** + * AggregatedListNodeTypesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + AggregatedListNodeTypesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListNodeTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + AggregatedListNodeTypesRequest.prototype.maxResults = null; + + /** + * AggregatedListNodeTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + AggregatedListNodeTypesRequest.prototype.orderBy = null; + + /** + * AggregatedListNodeTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + AggregatedListNodeTypesRequest.prototype.pageToken = null; + + /** + * AggregatedListNodeTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + AggregatedListNodeTypesRequest.prototype.project = ""; + + /** + * AggregatedListNodeTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + AggregatedListNodeTypesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListNodeTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTypesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTypesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListNodeTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + */ + Object.defineProperty(AggregatedListNodeTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListNodeTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListNodeTypesRequest} AggregatedListNodeTypesRequest instance + */ + AggregatedListNodeTypesRequest.create = function create(properties) { + return new AggregatedListNodeTypesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListNodeTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeTypesRequest} message AggregatedListNodeTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNodeTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNodeTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListNodeTypesRequest} message AggregatedListNodeTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListNodeTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListNodeTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListNodeTypesRequest} AggregatedListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNodeTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListNodeTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListNodeTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListNodeTypesRequest} AggregatedListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListNodeTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListNodeTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListNodeTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListNodeTypesRequest} AggregatedListNodeTypesRequest + */ + AggregatedListNodeTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListNodeTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListNodeTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListNodeTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListNodeTypesRequest} message AggregatedListNodeTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListNodeTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListNodeTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListNodeTypesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListNodeTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListNodeTypesRequest; + })(); + + v1.GetNodeTypeRequest = (function() { + + /** + * Properties of a GetNodeTypeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetNodeTypeRequest + * @property {string|null} [nodeType] GetNodeTypeRequest nodeType + * @property {string|null} [project] GetNodeTypeRequest project + * @property {string|null} [zone] GetNodeTypeRequest zone + */ + + /** + * Constructs a new GetNodeTypeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetNodeTypeRequest. + * @implements IGetNodeTypeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetNodeTypeRequest=} [properties] Properties to set + */ + function GetNodeTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeTypeRequest nodeType. + * @member {string} nodeType + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @instance + */ + GetNodeTypeRequest.prototype.nodeType = ""; + + /** + * GetNodeTypeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @instance + */ + GetNodeTypeRequest.prototype.project = ""; + + /** + * GetNodeTypeRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @instance + */ + GetNodeTypeRequest.prototype.zone = ""; + + /** + * Creates a new GetNodeTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeTypeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetNodeTypeRequest} GetNodeTypeRequest instance + */ + GetNodeTypeRequest.create = function create(properties) { + return new GetNodeTypeRequest(properties); + }; + + /** + * Encodes the specified GetNodeTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNodeTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.nodeType != null && Object.hasOwnProperty.call(message, "nodeType")) + writer.uint32(/* id 465832791, wireType 2 =*/3726662330).string(message.nodeType); + return writer; + }; + + /** + * Encodes the specified GetNodeTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNodeTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetNodeTypeRequest} GetNodeTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetNodeTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 465832791: + message.nodeType = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNodeTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetNodeTypeRequest} GetNodeTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeTypeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + if (!$util.isString(message.nodeType)) + return "nodeType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetNodeTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetNodeTypeRequest} GetNodeTypeRequest + */ + GetNodeTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetNodeTypeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetNodeTypeRequest(); + if (object.nodeType != null) + message.nodeType = String(object.nodeType); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetNodeTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.compute.v1.GetNodeTypeRequest} message GetNodeTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.nodeType = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.nodeType != null && message.hasOwnProperty("nodeType")) + object.nodeType = message.nodeType; + return object; + }; + + /** + * Converts this GetNodeTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetNodeTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodeTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNodeTypeRequest; + })(); + + v1.ListNodeTypesRequest = (function() { + + /** + * Properties of a ListNodeTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListNodeTypesRequest + * @property {string|null} [filter] ListNodeTypesRequest filter + * @property {number|null} [maxResults] ListNodeTypesRequest maxResults + * @property {string|null} [orderBy] ListNodeTypesRequest orderBy + * @property {string|null} [pageToken] ListNodeTypesRequest pageToken + * @property {string|null} [project] ListNodeTypesRequest project + * @property {boolean|null} [returnPartialSuccess] ListNodeTypesRequest returnPartialSuccess + * @property {string|null} [zone] ListNodeTypesRequest zone + */ + + /** + * Constructs a new ListNodeTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListNodeTypesRequest. + * @implements IListNodeTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IListNodeTypesRequest=} [properties] Properties to set + */ + function ListNodeTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNodeTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.filter = null; + + /** + * ListNodeTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.maxResults = null; + + /** + * ListNodeTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.orderBy = null; + + /** + * ListNodeTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.pageToken = null; + + /** + * ListNodeTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.project = ""; + + /** + * ListNodeTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.returnPartialSuccess = null; + + /** + * ListNodeTypesRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListNodeTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + Object.defineProperty(ListNodeTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + Object.defineProperty(ListNodeTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + Object.defineProperty(ListNodeTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + Object.defineProperty(ListNodeTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListNodeTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + */ + Object.defineProperty(ListNodeTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListNodeTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.IListNodeTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListNodeTypesRequest} ListNodeTypesRequest instance + */ + ListNodeTypesRequest.create = function create(properties) { + return new ListNodeTypesRequest(properties); + }; + + /** + * Encodes the specified ListNodeTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListNodeTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListNodeTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListNodeTypesRequest} ListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListNodeTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListNodeTypesRequest} ListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodeTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodeTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListNodeTypesRequest} ListNodeTypesRequest + */ + ListNodeTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListNodeTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListNodeTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListNodeTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.compute.v1.ListNodeTypesRequest} message ListNodeTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodeTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListNodeTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListNodeTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListNodeTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNodeTypesRequest; + })(); + + v1.AggregatedListPacketMirroringsRequest = (function() { + + /** + * Properties of an AggregatedListPacketMirroringsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListPacketMirroringsRequest + * @property {string|null} [filter] AggregatedListPacketMirroringsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListPacketMirroringsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListPacketMirroringsRequest maxResults + * @property {string|null} [orderBy] AggregatedListPacketMirroringsRequest orderBy + * @property {string|null} [pageToken] AggregatedListPacketMirroringsRequest pageToken + * @property {string|null} [project] AggregatedListPacketMirroringsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListPacketMirroringsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListPacketMirroringsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListPacketMirroringsRequest. + * @implements IAggregatedListPacketMirroringsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest=} [properties] Properties to set + */ + function AggregatedListPacketMirroringsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListPacketMirroringsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + AggregatedListPacketMirroringsRequest.prototype.filter = null; + + /** + * AggregatedListPacketMirroringsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + AggregatedListPacketMirroringsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListPacketMirroringsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + AggregatedListPacketMirroringsRequest.prototype.maxResults = null; + + /** + * AggregatedListPacketMirroringsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + AggregatedListPacketMirroringsRequest.prototype.orderBy = null; + + /** + * AggregatedListPacketMirroringsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + AggregatedListPacketMirroringsRequest.prototype.pageToken = null; + + /** + * AggregatedListPacketMirroringsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + AggregatedListPacketMirroringsRequest.prototype.project = ""; + + /** + * AggregatedListPacketMirroringsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + AggregatedListPacketMirroringsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListPacketMirroringsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(AggregatedListPacketMirroringsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPacketMirroringsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(AggregatedListPacketMirroringsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPacketMirroringsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(AggregatedListPacketMirroringsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPacketMirroringsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(AggregatedListPacketMirroringsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPacketMirroringsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(AggregatedListPacketMirroringsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPacketMirroringsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(AggregatedListPacketMirroringsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListPacketMirroringsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListPacketMirroringsRequest} AggregatedListPacketMirroringsRequest instance + */ + AggregatedListPacketMirroringsRequest.create = function create(properties) { + return new AggregatedListPacketMirroringsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListPacketMirroringsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPacketMirroringsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest} message AggregatedListPacketMirroringsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListPacketMirroringsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListPacketMirroringsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPacketMirroringsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest} message AggregatedListPacketMirroringsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListPacketMirroringsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListPacketMirroringsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListPacketMirroringsRequest} AggregatedListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListPacketMirroringsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListPacketMirroringsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListPacketMirroringsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListPacketMirroringsRequest} AggregatedListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListPacketMirroringsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListPacketMirroringsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListPacketMirroringsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListPacketMirroringsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListPacketMirroringsRequest} AggregatedListPacketMirroringsRequest + */ + AggregatedListPacketMirroringsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListPacketMirroringsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListPacketMirroringsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListPacketMirroringsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListPacketMirroringsRequest} message AggregatedListPacketMirroringsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListPacketMirroringsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListPacketMirroringsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListPacketMirroringsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListPacketMirroringsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListPacketMirroringsRequest; + })(); + + v1.DeletePacketMirroringRequest = (function() { + + /** + * Properties of a DeletePacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeletePacketMirroringRequest + * @property {string|null} [packetMirroring] DeletePacketMirroringRequest packetMirroring + * @property {string|null} [project] DeletePacketMirroringRequest project + * @property {string|null} [region] DeletePacketMirroringRequest region + * @property {string|null} [requestId] DeletePacketMirroringRequest requestId + */ + + /** + * Constructs a new DeletePacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeletePacketMirroringRequest. + * @implements IDeletePacketMirroringRequest + * @constructor + * @param {google.cloud.compute.v1.IDeletePacketMirroringRequest=} [properties] Properties to set + */ + function DeletePacketMirroringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePacketMirroringRequest packetMirroring. + * @member {string} packetMirroring + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @instance + */ + DeletePacketMirroringRequest.prototype.packetMirroring = ""; + + /** + * DeletePacketMirroringRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @instance + */ + DeletePacketMirroringRequest.prototype.project = ""; + + /** + * DeletePacketMirroringRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @instance + */ + DeletePacketMirroringRequest.prototype.region = ""; + + /** + * DeletePacketMirroringRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @instance + */ + DeletePacketMirroringRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeletePacketMirroringRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @instance + */ + Object.defineProperty(DeletePacketMirroringRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeletePacketMirroringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IDeletePacketMirroringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeletePacketMirroringRequest} DeletePacketMirroringRequest instance + */ + DeletePacketMirroringRequest.create = function create(properties) { + return new DeletePacketMirroringRequest(properties); + }; + + /** + * Encodes the specified DeletePacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePacketMirroringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IDeletePacketMirroringRequest} message DeletePacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePacketMirroringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packetMirroring != null && Object.hasOwnProperty.call(message, "packetMirroring")) + writer.uint32(/* id 22305996, wireType 2 =*/178447970).string(message.packetMirroring); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeletePacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePacketMirroringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IDeletePacketMirroringRequest} message DeletePacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePacketMirroringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePacketMirroringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeletePacketMirroringRequest} DeletePacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePacketMirroringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeletePacketMirroringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22305996: + message.packetMirroring = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePacketMirroringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeletePacketMirroringRequest} DeletePacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePacketMirroringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePacketMirroringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePacketMirroringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.packetMirroring != null && message.hasOwnProperty("packetMirroring")) + if (!$util.isString(message.packetMirroring)) + return "packetMirroring: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeletePacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeletePacketMirroringRequest} DeletePacketMirroringRequest + */ + DeletePacketMirroringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeletePacketMirroringRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeletePacketMirroringRequest(); + if (object.packetMirroring != null) + message.packetMirroring = String(object.packetMirroring); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeletePacketMirroringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.DeletePacketMirroringRequest} message DeletePacketMirroringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePacketMirroringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.packetMirroring = ""; + object.region = ""; + object.project = ""; + } + if (message.packetMirroring != null && message.hasOwnProperty("packetMirroring")) + object.packetMirroring = message.packetMirroring; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeletePacketMirroringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeletePacketMirroringRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePacketMirroringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeletePacketMirroringRequest; + })(); + + v1.GetPacketMirroringRequest = (function() { + + /** + * Properties of a GetPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetPacketMirroringRequest + * @property {string|null} [packetMirroring] GetPacketMirroringRequest packetMirroring + * @property {string|null} [project] GetPacketMirroringRequest project + * @property {string|null} [region] GetPacketMirroringRequest region + */ + + /** + * Constructs a new GetPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetPacketMirroringRequest. + * @implements IGetPacketMirroringRequest + * @constructor + * @param {google.cloud.compute.v1.IGetPacketMirroringRequest=} [properties] Properties to set + */ + function GetPacketMirroringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPacketMirroringRequest packetMirroring. + * @member {string} packetMirroring + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @instance + */ + GetPacketMirroringRequest.prototype.packetMirroring = ""; + + /** + * GetPacketMirroringRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @instance + */ + GetPacketMirroringRequest.prototype.project = ""; + + /** + * GetPacketMirroringRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @instance + */ + GetPacketMirroringRequest.prototype.region = ""; + + /** + * Creates a new GetPacketMirroringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IGetPacketMirroringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetPacketMirroringRequest} GetPacketMirroringRequest instance + */ + GetPacketMirroringRequest.create = function create(properties) { + return new GetPacketMirroringRequest(properties); + }; + + /** + * Encodes the specified GetPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.GetPacketMirroringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IGetPacketMirroringRequest} message GetPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPacketMirroringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packetMirroring != null && Object.hasOwnProperty.call(message, "packetMirroring")) + writer.uint32(/* id 22305996, wireType 2 =*/178447970).string(message.packetMirroring); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetPacketMirroringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IGetPacketMirroringRequest} message GetPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPacketMirroringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPacketMirroringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetPacketMirroringRequest} GetPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPacketMirroringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetPacketMirroringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22305996: + message.packetMirroring = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetPacketMirroringRequest} GetPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPacketMirroringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPacketMirroringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPacketMirroringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packetMirroring != null && message.hasOwnProperty("packetMirroring")) + if (!$util.isString(message.packetMirroring)) + return "packetMirroring: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetPacketMirroringRequest} GetPacketMirroringRequest + */ + GetPacketMirroringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetPacketMirroringRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetPacketMirroringRequest(); + if (object.packetMirroring != null) + message.packetMirroring = String(object.packetMirroring); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetPacketMirroringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.GetPacketMirroringRequest} message GetPacketMirroringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPacketMirroringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.packetMirroring = ""; + object.region = ""; + object.project = ""; + } + if (message.packetMirroring != null && message.hasOwnProperty("packetMirroring")) + object.packetMirroring = message.packetMirroring; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetPacketMirroringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetPacketMirroringRequest + * @instance + * @returns {Object.} JSON object + */ + GetPacketMirroringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPacketMirroringRequest; + })(); + + v1.InsertPacketMirroringRequest = (function() { + + /** + * Properties of an InsertPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertPacketMirroringRequest + * @property {google.cloud.compute.v1.IPacketMirroring|null} [packetMirroringResource] InsertPacketMirroringRequest packetMirroringResource + * @property {string|null} [project] InsertPacketMirroringRequest project + * @property {string|null} [region] InsertPacketMirroringRequest region + * @property {string|null} [requestId] InsertPacketMirroringRequest requestId + */ + + /** + * Constructs a new InsertPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertPacketMirroringRequest. + * @implements IInsertPacketMirroringRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertPacketMirroringRequest=} [properties] Properties to set + */ + function InsertPacketMirroringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertPacketMirroringRequest packetMirroringResource. + * @member {google.cloud.compute.v1.IPacketMirroring|null|undefined} packetMirroringResource + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @instance + */ + InsertPacketMirroringRequest.prototype.packetMirroringResource = null; + + /** + * InsertPacketMirroringRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @instance + */ + InsertPacketMirroringRequest.prototype.project = ""; + + /** + * InsertPacketMirroringRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @instance + */ + InsertPacketMirroringRequest.prototype.region = ""; + + /** + * InsertPacketMirroringRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @instance + */ + InsertPacketMirroringRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertPacketMirroringRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @instance + */ + Object.defineProperty(InsertPacketMirroringRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertPacketMirroringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IInsertPacketMirroringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertPacketMirroringRequest} InsertPacketMirroringRequest instance + */ + InsertPacketMirroringRequest.create = function create(properties) { + return new InsertPacketMirroringRequest(properties); + }; + + /** + * Encodes the specified InsertPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertPacketMirroringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IInsertPacketMirroringRequest} message InsertPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertPacketMirroringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.packetMirroringResource != null && Object.hasOwnProperty.call(message, "packetMirroringResource")) + $root.google.cloud.compute.v1.PacketMirroring.encode(message.packetMirroringResource, writer.uint32(/* id 493501985, wireType 2 =*/3948015882).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertPacketMirroringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IInsertPacketMirroringRequest} message InsertPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertPacketMirroringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertPacketMirroringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertPacketMirroringRequest} InsertPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertPacketMirroringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertPacketMirroringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 493501985: + message.packetMirroringResource = $root.google.cloud.compute.v1.PacketMirroring.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertPacketMirroringRequest} InsertPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertPacketMirroringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertPacketMirroringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertPacketMirroringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.packetMirroringResource != null && message.hasOwnProperty("packetMirroringResource")) { + var error = $root.google.cloud.compute.v1.PacketMirroring.verify(message.packetMirroringResource); + if (error) + return "packetMirroringResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertPacketMirroringRequest} InsertPacketMirroringRequest + */ + InsertPacketMirroringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertPacketMirroringRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertPacketMirroringRequest(); + if (object.packetMirroringResource != null) { + if (typeof object.packetMirroringResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertPacketMirroringRequest.packetMirroringResource: object expected"); + message.packetMirroringResource = $root.google.cloud.compute.v1.PacketMirroring.fromObject(object.packetMirroringResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertPacketMirroringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.InsertPacketMirroringRequest} message InsertPacketMirroringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertPacketMirroringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.packetMirroringResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.packetMirroringResource != null && message.hasOwnProperty("packetMirroringResource")) + object.packetMirroringResource = $root.google.cloud.compute.v1.PacketMirroring.toObject(message.packetMirroringResource, options); + return object; + }; + + /** + * Converts this InsertPacketMirroringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertPacketMirroringRequest + * @instance + * @returns {Object.} JSON object + */ + InsertPacketMirroringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertPacketMirroringRequest; + })(); + + v1.ListPacketMirroringsRequest = (function() { + + /** + * Properties of a ListPacketMirroringsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListPacketMirroringsRequest + * @property {string|null} [filter] ListPacketMirroringsRequest filter + * @property {number|null} [maxResults] ListPacketMirroringsRequest maxResults + * @property {string|null} [orderBy] ListPacketMirroringsRequest orderBy + * @property {string|null} [pageToken] ListPacketMirroringsRequest pageToken + * @property {string|null} [project] ListPacketMirroringsRequest project + * @property {string|null} [region] ListPacketMirroringsRequest region + * @property {boolean|null} [returnPartialSuccess] ListPacketMirroringsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListPacketMirroringsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListPacketMirroringsRequest. + * @implements IListPacketMirroringsRequest + * @constructor + * @param {google.cloud.compute.v1.IListPacketMirroringsRequest=} [properties] Properties to set + */ + function ListPacketMirroringsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPacketMirroringsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + ListPacketMirroringsRequest.prototype.filter = null; + + /** + * ListPacketMirroringsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + ListPacketMirroringsRequest.prototype.maxResults = null; + + /** + * ListPacketMirroringsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + ListPacketMirroringsRequest.prototype.orderBy = null; + + /** + * ListPacketMirroringsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + ListPacketMirroringsRequest.prototype.pageToken = null; + + /** + * ListPacketMirroringsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + ListPacketMirroringsRequest.prototype.project = ""; + + /** + * ListPacketMirroringsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + ListPacketMirroringsRequest.prototype.region = ""; + + /** + * ListPacketMirroringsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + ListPacketMirroringsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPacketMirroringsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(ListPacketMirroringsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPacketMirroringsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(ListPacketMirroringsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPacketMirroringsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(ListPacketMirroringsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPacketMirroringsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(ListPacketMirroringsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPacketMirroringsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + */ + Object.defineProperty(ListPacketMirroringsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPacketMirroringsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.IListPacketMirroringsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListPacketMirroringsRequest} ListPacketMirroringsRequest instance + */ + ListPacketMirroringsRequest.create = function create(properties) { + return new ListPacketMirroringsRequest(properties); + }; + + /** + * Encodes the specified ListPacketMirroringsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPacketMirroringsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.IListPacketMirroringsRequest} message ListPacketMirroringsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPacketMirroringsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListPacketMirroringsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPacketMirroringsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.IListPacketMirroringsRequest} message ListPacketMirroringsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPacketMirroringsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPacketMirroringsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListPacketMirroringsRequest} ListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPacketMirroringsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListPacketMirroringsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPacketMirroringsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListPacketMirroringsRequest} ListPacketMirroringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPacketMirroringsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPacketMirroringsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPacketMirroringsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListPacketMirroringsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListPacketMirroringsRequest} ListPacketMirroringsRequest + */ + ListPacketMirroringsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListPacketMirroringsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListPacketMirroringsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListPacketMirroringsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @static + * @param {google.cloud.compute.v1.ListPacketMirroringsRequest} message ListPacketMirroringsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPacketMirroringsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListPacketMirroringsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListPacketMirroringsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPacketMirroringsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPacketMirroringsRequest; + })(); + + v1.PatchPacketMirroringRequest = (function() { + + /** + * Properties of a PatchPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchPacketMirroringRequest + * @property {string|null} [packetMirroring] PatchPacketMirroringRequest packetMirroring + * @property {google.cloud.compute.v1.IPacketMirroring|null} [packetMirroringResource] PatchPacketMirroringRequest packetMirroringResource + * @property {string|null} [project] PatchPacketMirroringRequest project + * @property {string|null} [region] PatchPacketMirroringRequest region + * @property {string|null} [requestId] PatchPacketMirroringRequest requestId + */ + + /** + * Constructs a new PatchPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchPacketMirroringRequest. + * @implements IPatchPacketMirroringRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchPacketMirroringRequest=} [properties] Properties to set + */ + function PatchPacketMirroringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchPacketMirroringRequest packetMirroring. + * @member {string} packetMirroring + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @instance + */ + PatchPacketMirroringRequest.prototype.packetMirroring = ""; + + /** + * PatchPacketMirroringRequest packetMirroringResource. + * @member {google.cloud.compute.v1.IPacketMirroring|null|undefined} packetMirroringResource + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @instance + */ + PatchPacketMirroringRequest.prototype.packetMirroringResource = null; + + /** + * PatchPacketMirroringRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @instance + */ + PatchPacketMirroringRequest.prototype.project = ""; + + /** + * PatchPacketMirroringRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @instance + */ + PatchPacketMirroringRequest.prototype.region = ""; + + /** + * PatchPacketMirroringRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @instance + */ + PatchPacketMirroringRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchPacketMirroringRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @instance + */ + Object.defineProperty(PatchPacketMirroringRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchPacketMirroringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IPatchPacketMirroringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchPacketMirroringRequest} PatchPacketMirroringRequest instance + */ + PatchPacketMirroringRequest.create = function create(properties) { + return new PatchPacketMirroringRequest(properties); + }; + + /** + * Encodes the specified PatchPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPacketMirroringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IPatchPacketMirroringRequest} message PatchPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPacketMirroringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.packetMirroring != null && Object.hasOwnProperty.call(message, "packetMirroring")) + writer.uint32(/* id 22305996, wireType 2 =*/178447970).string(message.packetMirroring); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.packetMirroringResource != null && Object.hasOwnProperty.call(message, "packetMirroringResource")) + $root.google.cloud.compute.v1.PacketMirroring.encode(message.packetMirroringResource, writer.uint32(/* id 493501985, wireType 2 =*/3948015882).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPacketMirroringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.IPatchPacketMirroringRequest} message PatchPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPacketMirroringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchPacketMirroringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchPacketMirroringRequest} PatchPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPacketMirroringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchPacketMirroringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 22305996: + message.packetMirroring = reader.string(); + break; + case 493501985: + message.packetMirroringResource = $root.google.cloud.compute.v1.PacketMirroring.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchPacketMirroringRequest} PatchPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPacketMirroringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchPacketMirroringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchPacketMirroringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.packetMirroring != null && message.hasOwnProperty("packetMirroring")) + if (!$util.isString(message.packetMirroring)) + return "packetMirroring: string expected"; + if (message.packetMirroringResource != null && message.hasOwnProperty("packetMirroringResource")) { + var error = $root.google.cloud.compute.v1.PacketMirroring.verify(message.packetMirroringResource); + if (error) + return "packetMirroringResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchPacketMirroringRequest} PatchPacketMirroringRequest + */ + PatchPacketMirroringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchPacketMirroringRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchPacketMirroringRequest(); + if (object.packetMirroring != null) + message.packetMirroring = String(object.packetMirroring); + if (object.packetMirroringResource != null) { + if (typeof object.packetMirroringResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchPacketMirroringRequest.packetMirroringResource: object expected"); + message.packetMirroringResource = $root.google.cloud.compute.v1.PacketMirroring.fromObject(object.packetMirroringResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchPacketMirroringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.PatchPacketMirroringRequest} message PatchPacketMirroringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchPacketMirroringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.packetMirroring = ""; + object.region = ""; + object.project = ""; + object.packetMirroringResource = null; + } + if (message.packetMirroring != null && message.hasOwnProperty("packetMirroring")) + object.packetMirroring = message.packetMirroring; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.packetMirroringResource != null && message.hasOwnProperty("packetMirroringResource")) + object.packetMirroringResource = $root.google.cloud.compute.v1.PacketMirroring.toObject(message.packetMirroringResource, options); + return object; + }; + + /** + * Converts this PatchPacketMirroringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchPacketMirroringRequest + * @instance + * @returns {Object.} JSON object + */ + PatchPacketMirroringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchPacketMirroringRequest; + })(); + + v1.TestIamPermissionsPacketMirroringRequest = (function() { + + /** + * Properties of a TestIamPermissionsPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsPacketMirroringRequest + * @property {string|null} [project] TestIamPermissionsPacketMirroringRequest project + * @property {string|null} [region] TestIamPermissionsPacketMirroringRequest region + * @property {string|null} [resource] TestIamPermissionsPacketMirroringRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsPacketMirroringRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsPacketMirroringRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsPacketMirroringRequest. + * @implements ITestIamPermissionsPacketMirroringRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest=} [properties] Properties to set + */ + function TestIamPermissionsPacketMirroringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsPacketMirroringRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @instance + */ + TestIamPermissionsPacketMirroringRequest.prototype.project = ""; + + /** + * TestIamPermissionsPacketMirroringRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @instance + */ + TestIamPermissionsPacketMirroringRequest.prototype.region = ""; + + /** + * TestIamPermissionsPacketMirroringRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @instance + */ + TestIamPermissionsPacketMirroringRequest.prototype.resource = ""; + + /** + * TestIamPermissionsPacketMirroringRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @instance + */ + TestIamPermissionsPacketMirroringRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsPacketMirroringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest} TestIamPermissionsPacketMirroringRequest instance + */ + TestIamPermissionsPacketMirroringRequest.create = function create(properties) { + return new TestIamPermissionsPacketMirroringRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsPacketMirroringRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest} message TestIamPermissionsPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsPacketMirroringRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsPacketMirroringRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest} message TestIamPermissionsPacketMirroringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsPacketMirroringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsPacketMirroringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest} TestIamPermissionsPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsPacketMirroringRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsPacketMirroringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest} TestIamPermissionsPacketMirroringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsPacketMirroringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsPacketMirroringRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsPacketMirroringRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsPacketMirroringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest} TestIamPermissionsPacketMirroringRequest + */ + TestIamPermissionsPacketMirroringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsPacketMirroringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest} message TestIamPermissionsPacketMirroringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsPacketMirroringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsPacketMirroringRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsPacketMirroringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsPacketMirroringRequest; + })(); + + v1.DisableXpnHostProjectRequest = (function() { + + /** + * Properties of a DisableXpnHostProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IDisableXpnHostProjectRequest + * @property {string|null} [project] DisableXpnHostProjectRequest project + * @property {string|null} [requestId] DisableXpnHostProjectRequest requestId + */ + + /** + * Constructs a new DisableXpnHostProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DisableXpnHostProjectRequest. + * @implements IDisableXpnHostProjectRequest + * @constructor + * @param {google.cloud.compute.v1.IDisableXpnHostProjectRequest=} [properties] Properties to set + */ + function DisableXpnHostProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableXpnHostProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @instance + */ + DisableXpnHostProjectRequest.prototype.project = ""; + + /** + * DisableXpnHostProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @instance + */ + DisableXpnHostProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisableXpnHostProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @instance + */ + Object.defineProperty(DisableXpnHostProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisableXpnHostProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IDisableXpnHostProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DisableXpnHostProjectRequest} DisableXpnHostProjectRequest instance + */ + DisableXpnHostProjectRequest.create = function create(properties) { + return new DisableXpnHostProjectRequest(properties); + }; + + /** + * Encodes the specified DisableXpnHostProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.DisableXpnHostProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IDisableXpnHostProjectRequest} message DisableXpnHostProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableXpnHostProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DisableXpnHostProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisableXpnHostProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IDisableXpnHostProjectRequest} message DisableXpnHostProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableXpnHostProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableXpnHostProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DisableXpnHostProjectRequest} DisableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableXpnHostProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DisableXpnHostProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisableXpnHostProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DisableXpnHostProjectRequest} DisableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableXpnHostProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableXpnHostProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableXpnHostProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DisableXpnHostProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DisableXpnHostProjectRequest} DisableXpnHostProjectRequest + */ + DisableXpnHostProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DisableXpnHostProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.DisableXpnHostProjectRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DisableXpnHostProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.DisableXpnHostProjectRequest} message DisableXpnHostProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableXpnHostProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DisableXpnHostProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DisableXpnHostProjectRequest + * @instance + * @returns {Object.} JSON object + */ + DisableXpnHostProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DisableXpnHostProjectRequest; + })(); + + v1.DisableXpnResourceProjectRequest = (function() { + + /** + * Properties of a DisableXpnResourceProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IDisableXpnResourceProjectRequest + * @property {string|null} [project] DisableXpnResourceProjectRequest project + * @property {google.cloud.compute.v1.IProjectsDisableXpnResourceRequest|null} [projectsDisableXpnResourceRequestResource] DisableXpnResourceProjectRequest projectsDisableXpnResourceRequestResource + * @property {string|null} [requestId] DisableXpnResourceProjectRequest requestId + */ + + /** + * Constructs a new DisableXpnResourceProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DisableXpnResourceProjectRequest. + * @implements IDisableXpnResourceProjectRequest + * @constructor + * @param {google.cloud.compute.v1.IDisableXpnResourceProjectRequest=} [properties] Properties to set + */ + function DisableXpnResourceProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisableXpnResourceProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @instance + */ + DisableXpnResourceProjectRequest.prototype.project = ""; + + /** + * DisableXpnResourceProjectRequest projectsDisableXpnResourceRequestResource. + * @member {google.cloud.compute.v1.IProjectsDisableXpnResourceRequest|null|undefined} projectsDisableXpnResourceRequestResource + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @instance + */ + DisableXpnResourceProjectRequest.prototype.projectsDisableXpnResourceRequestResource = null; + + /** + * DisableXpnResourceProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @instance + */ + DisableXpnResourceProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisableXpnResourceProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @instance + */ + Object.defineProperty(DisableXpnResourceProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisableXpnResourceProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.IDisableXpnResourceProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DisableXpnResourceProjectRequest} DisableXpnResourceProjectRequest instance + */ + DisableXpnResourceProjectRequest.create = function create(properties) { + return new DisableXpnResourceProjectRequest(properties); + }; + + /** + * Encodes the specified DisableXpnResourceProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.DisableXpnResourceProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.IDisableXpnResourceProjectRequest} message DisableXpnResourceProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableXpnResourceProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.projectsDisableXpnResourceRequestResource != null && Object.hasOwnProperty.call(message, "projectsDisableXpnResourceRequestResource")) + $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.encode(message.projectsDisableXpnResourceRequestResource, writer.uint32(/* id 209136170, wireType 2 =*/1673089362).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DisableXpnResourceProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DisableXpnResourceProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.IDisableXpnResourceProjectRequest} message DisableXpnResourceProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisableXpnResourceProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisableXpnResourceProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DisableXpnResourceProjectRequest} DisableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableXpnResourceProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DisableXpnResourceProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 209136170: + message.projectsDisableXpnResourceRequestResource = $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisableXpnResourceProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DisableXpnResourceProjectRequest} DisableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisableXpnResourceProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisableXpnResourceProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisableXpnResourceProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectsDisableXpnResourceRequestResource != null && message.hasOwnProperty("projectsDisableXpnResourceRequestResource")) { + var error = $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.verify(message.projectsDisableXpnResourceRequestResource); + if (error) + return "projectsDisableXpnResourceRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DisableXpnResourceProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DisableXpnResourceProjectRequest} DisableXpnResourceProjectRequest + */ + DisableXpnResourceProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DisableXpnResourceProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.DisableXpnResourceProjectRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.projectsDisableXpnResourceRequestResource != null) { + if (typeof object.projectsDisableXpnResourceRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.DisableXpnResourceProjectRequest.projectsDisableXpnResourceRequestResource: object expected"); + message.projectsDisableXpnResourceRequestResource = $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.fromObject(object.projectsDisableXpnResourceRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DisableXpnResourceProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.DisableXpnResourceProjectRequest} message DisableXpnResourceProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisableXpnResourceProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectsDisableXpnResourceRequestResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.projectsDisableXpnResourceRequestResource != null && message.hasOwnProperty("projectsDisableXpnResourceRequestResource")) + object.projectsDisableXpnResourceRequestResource = $root.google.cloud.compute.v1.ProjectsDisableXpnResourceRequest.toObject(message.projectsDisableXpnResourceRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DisableXpnResourceProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DisableXpnResourceProjectRequest + * @instance + * @returns {Object.} JSON object + */ + DisableXpnResourceProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DisableXpnResourceProjectRequest; + })(); + + v1.EnableXpnHostProjectRequest = (function() { + + /** + * Properties of an EnableXpnHostProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IEnableXpnHostProjectRequest + * @property {string|null} [project] EnableXpnHostProjectRequest project + * @property {string|null} [requestId] EnableXpnHostProjectRequest requestId + */ + + /** + * Constructs a new EnableXpnHostProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an EnableXpnHostProjectRequest. + * @implements IEnableXpnHostProjectRequest + * @constructor + * @param {google.cloud.compute.v1.IEnableXpnHostProjectRequest=} [properties] Properties to set + */ + function EnableXpnHostProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableXpnHostProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @instance + */ + EnableXpnHostProjectRequest.prototype.project = ""; + + /** + * EnableXpnHostProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @instance + */ + EnableXpnHostProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EnableXpnHostProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @instance + */ + Object.defineProperty(EnableXpnHostProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EnableXpnHostProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IEnableXpnHostProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.EnableXpnHostProjectRequest} EnableXpnHostProjectRequest instance + */ + EnableXpnHostProjectRequest.create = function create(properties) { + return new EnableXpnHostProjectRequest(properties); + }; + + /** + * Encodes the specified EnableXpnHostProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.EnableXpnHostProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IEnableXpnHostProjectRequest} message EnableXpnHostProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableXpnHostProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified EnableXpnHostProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.EnableXpnHostProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IEnableXpnHostProjectRequest} message EnableXpnHostProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableXpnHostProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableXpnHostProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.EnableXpnHostProjectRequest} EnableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableXpnHostProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.EnableXpnHostProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnableXpnHostProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.EnableXpnHostProjectRequest} EnableXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableXpnHostProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableXpnHostProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableXpnHostProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an EnableXpnHostProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.EnableXpnHostProjectRequest} EnableXpnHostProjectRequest + */ + EnableXpnHostProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.EnableXpnHostProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.EnableXpnHostProjectRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an EnableXpnHostProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.EnableXpnHostProjectRequest} message EnableXpnHostProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableXpnHostProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this EnableXpnHostProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.EnableXpnHostProjectRequest + * @instance + * @returns {Object.} JSON object + */ + EnableXpnHostProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnableXpnHostProjectRequest; + })(); + + v1.EnableXpnResourceProjectRequest = (function() { + + /** + * Properties of an EnableXpnResourceProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IEnableXpnResourceProjectRequest + * @property {string|null} [project] EnableXpnResourceProjectRequest project + * @property {google.cloud.compute.v1.IProjectsEnableXpnResourceRequest|null} [projectsEnableXpnResourceRequestResource] EnableXpnResourceProjectRequest projectsEnableXpnResourceRequestResource + * @property {string|null} [requestId] EnableXpnResourceProjectRequest requestId + */ + + /** + * Constructs a new EnableXpnResourceProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an EnableXpnResourceProjectRequest. + * @implements IEnableXpnResourceProjectRequest + * @constructor + * @param {google.cloud.compute.v1.IEnableXpnResourceProjectRequest=} [properties] Properties to set + */ + function EnableXpnResourceProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnableXpnResourceProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @instance + */ + EnableXpnResourceProjectRequest.prototype.project = ""; + + /** + * EnableXpnResourceProjectRequest projectsEnableXpnResourceRequestResource. + * @member {google.cloud.compute.v1.IProjectsEnableXpnResourceRequest|null|undefined} projectsEnableXpnResourceRequestResource + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @instance + */ + EnableXpnResourceProjectRequest.prototype.projectsEnableXpnResourceRequestResource = null; + + /** + * EnableXpnResourceProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @instance + */ + EnableXpnResourceProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EnableXpnResourceProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @instance + */ + Object.defineProperty(EnableXpnResourceProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EnableXpnResourceProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.IEnableXpnResourceProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.EnableXpnResourceProjectRequest} EnableXpnResourceProjectRequest instance + */ + EnableXpnResourceProjectRequest.create = function create(properties) { + return new EnableXpnResourceProjectRequest(properties); + }; + + /** + * Encodes the specified EnableXpnResourceProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.EnableXpnResourceProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.IEnableXpnResourceProjectRequest} message EnableXpnResourceProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableXpnResourceProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.projectsEnableXpnResourceRequestResource != null && Object.hasOwnProperty.call(message, "projectsEnableXpnResourceRequestResource")) + $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.encode(message.projectsEnableXpnResourceRequestResource, writer.uint32(/* id 421980207, wireType 2 =*/3375841658).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnableXpnResourceProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.EnableXpnResourceProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.IEnableXpnResourceProjectRequest} message EnableXpnResourceProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnableXpnResourceProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnableXpnResourceProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.EnableXpnResourceProjectRequest} EnableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableXpnResourceProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.EnableXpnResourceProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 421980207: + message.projectsEnableXpnResourceRequestResource = $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnableXpnResourceProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.EnableXpnResourceProjectRequest} EnableXpnResourceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnableXpnResourceProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnableXpnResourceProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnableXpnResourceProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectsEnableXpnResourceRequestResource != null && message.hasOwnProperty("projectsEnableXpnResourceRequestResource")) { + var error = $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.verify(message.projectsEnableXpnResourceRequestResource); + if (error) + return "projectsEnableXpnResourceRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an EnableXpnResourceProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.EnableXpnResourceProjectRequest} EnableXpnResourceProjectRequest + */ + EnableXpnResourceProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.EnableXpnResourceProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.EnableXpnResourceProjectRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.projectsEnableXpnResourceRequestResource != null) { + if (typeof object.projectsEnableXpnResourceRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.EnableXpnResourceProjectRequest.projectsEnableXpnResourceRequestResource: object expected"); + message.projectsEnableXpnResourceRequestResource = $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.fromObject(object.projectsEnableXpnResourceRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an EnableXpnResourceProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @static + * @param {google.cloud.compute.v1.EnableXpnResourceProjectRequest} message EnableXpnResourceProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnableXpnResourceProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.projectsEnableXpnResourceRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectsEnableXpnResourceRequestResource != null && message.hasOwnProperty("projectsEnableXpnResourceRequestResource")) + object.projectsEnableXpnResourceRequestResource = $root.google.cloud.compute.v1.ProjectsEnableXpnResourceRequest.toObject(message.projectsEnableXpnResourceRequestResource, options); + return object; + }; + + /** + * Converts this EnableXpnResourceProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.EnableXpnResourceProjectRequest + * @instance + * @returns {Object.} JSON object + */ + EnableXpnResourceProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnableXpnResourceProjectRequest; + })(); + + v1.GetProjectRequest = (function() { + + /** + * Properties of a GetProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetProjectRequest + * @property {string|null} [project] GetProjectRequest project + */ + + /** + * Constructs a new GetProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetProjectRequest. + * @implements IGetProjectRequest + * @constructor + * @param {google.cloud.compute.v1.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 project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetProjectRequest + * @instance + */ + GetProjectRequest.prototype.project = ""; + + /** + * Creates a new GetProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetProjectRequest + * @static + * @param {google.cloud.compute.v1.IGetProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetProjectRequest} GetProjectRequest instance + */ + GetProjectRequest.create = function create(properties) { + return new GetProjectRequest(properties); + }; + + /** + * Encodes the specified GetProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.GetProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetProjectRequest + * @static + * @param {google.cloud.compute.v1.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.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetProjectRequest + * @static + * @param {google.cloud.compute.v1.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.compute.v1.GetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.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.compute.v1.GetProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = 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.compute.v1.GetProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.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.compute.v1.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: 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.compute.v1.GetProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetProjectRequest} GetProjectRequest + */ + GetProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetProjectRequest(); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetProjectRequest + * @static + * @param {google.cloud.compute.v1.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.project = ""; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetProjectRequest + * @instance + * @returns {Object.} JSON object + */ + GetProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetProjectRequest; + })(); + + v1.GetXpnHostProjectRequest = (function() { + + /** + * Properties of a GetXpnHostProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetXpnHostProjectRequest + * @property {string|null} [project] GetXpnHostProjectRequest project + */ + + /** + * Constructs a new GetXpnHostProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetXpnHostProjectRequest. + * @implements IGetXpnHostProjectRequest + * @constructor + * @param {google.cloud.compute.v1.IGetXpnHostProjectRequest=} [properties] Properties to set + */ + function GetXpnHostProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetXpnHostProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @instance + */ + GetXpnHostProjectRequest.prototype.project = ""; + + /** + * Creates a new GetXpnHostProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IGetXpnHostProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetXpnHostProjectRequest} GetXpnHostProjectRequest instance + */ + GetXpnHostProjectRequest.create = function create(properties) { + return new GetXpnHostProjectRequest(properties); + }; + + /** + * Encodes the specified GetXpnHostProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.GetXpnHostProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IGetXpnHostProjectRequest} message GetXpnHostProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetXpnHostProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetXpnHostProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetXpnHostProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.IGetXpnHostProjectRequest} message GetXpnHostProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetXpnHostProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetXpnHostProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetXpnHostProjectRequest} GetXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetXpnHostProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetXpnHostProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetXpnHostProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetXpnHostProjectRequest} GetXpnHostProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetXpnHostProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetXpnHostProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetXpnHostProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + return null; + }; + + /** + * Creates a GetXpnHostProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetXpnHostProjectRequest} GetXpnHostProjectRequest + */ + GetXpnHostProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetXpnHostProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetXpnHostProjectRequest(); + if (object.project != null) + message.project = String(object.project); + return message; + }; + + /** + * Creates a plain object from a GetXpnHostProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @static + * @param {google.cloud.compute.v1.GetXpnHostProjectRequest} message GetXpnHostProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetXpnHostProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetXpnHostProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetXpnHostProjectRequest + * @instance + * @returns {Object.} JSON object + */ + GetXpnHostProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetXpnHostProjectRequest; + })(); + + v1.GetXpnResourcesProjectsRequest = (function() { + + /** + * Properties of a GetXpnResourcesProjectsRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetXpnResourcesProjectsRequest + * @property {string|null} [filter] GetXpnResourcesProjectsRequest filter + * @property {number|null} [maxResults] GetXpnResourcesProjectsRequest maxResults + * @property {string|null} [orderBy] GetXpnResourcesProjectsRequest orderBy + * @property {string|null} [pageToken] GetXpnResourcesProjectsRequest pageToken + * @property {string|null} [project] GetXpnResourcesProjectsRequest project + * @property {boolean|null} [returnPartialSuccess] GetXpnResourcesProjectsRequest returnPartialSuccess + */ + + /** + * Constructs a new GetXpnResourcesProjectsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetXpnResourcesProjectsRequest. + * @implements IGetXpnResourcesProjectsRequest + * @constructor + * @param {google.cloud.compute.v1.IGetXpnResourcesProjectsRequest=} [properties] Properties to set + */ + function GetXpnResourcesProjectsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetXpnResourcesProjectsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + GetXpnResourcesProjectsRequest.prototype.filter = null; + + /** + * GetXpnResourcesProjectsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + GetXpnResourcesProjectsRequest.prototype.maxResults = null; + + /** + * GetXpnResourcesProjectsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + GetXpnResourcesProjectsRequest.prototype.orderBy = null; + + /** + * GetXpnResourcesProjectsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + GetXpnResourcesProjectsRequest.prototype.pageToken = null; + + /** + * GetXpnResourcesProjectsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + GetXpnResourcesProjectsRequest.prototype.project = ""; + + /** + * GetXpnResourcesProjectsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + GetXpnResourcesProjectsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetXpnResourcesProjectsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + Object.defineProperty(GetXpnResourcesProjectsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetXpnResourcesProjectsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + Object.defineProperty(GetXpnResourcesProjectsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetXpnResourcesProjectsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + Object.defineProperty(GetXpnResourcesProjectsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetXpnResourcesProjectsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + Object.defineProperty(GetXpnResourcesProjectsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetXpnResourcesProjectsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + */ + Object.defineProperty(GetXpnResourcesProjectsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetXpnResourcesProjectsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {google.cloud.compute.v1.IGetXpnResourcesProjectsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetXpnResourcesProjectsRequest} GetXpnResourcesProjectsRequest instance + */ + GetXpnResourcesProjectsRequest.create = function create(properties) { + return new GetXpnResourcesProjectsRequest(properties); + }; + + /** + * Encodes the specified GetXpnResourcesProjectsRequest message. Does not implicitly {@link google.cloud.compute.v1.GetXpnResourcesProjectsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {google.cloud.compute.v1.IGetXpnResourcesProjectsRequest} message GetXpnResourcesProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetXpnResourcesProjectsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified GetXpnResourcesProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetXpnResourcesProjectsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {google.cloud.compute.v1.IGetXpnResourcesProjectsRequest} message GetXpnResourcesProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetXpnResourcesProjectsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetXpnResourcesProjectsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetXpnResourcesProjectsRequest} GetXpnResourcesProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetXpnResourcesProjectsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetXpnResourcesProjectsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetXpnResourcesProjectsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetXpnResourcesProjectsRequest} GetXpnResourcesProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetXpnResourcesProjectsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetXpnResourcesProjectsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetXpnResourcesProjectsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a GetXpnResourcesProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetXpnResourcesProjectsRequest} GetXpnResourcesProjectsRequest + */ + GetXpnResourcesProjectsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetXpnResourcesProjectsRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetXpnResourcesProjectsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a GetXpnResourcesProjectsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @static + * @param {google.cloud.compute.v1.GetXpnResourcesProjectsRequest} message GetXpnResourcesProjectsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetXpnResourcesProjectsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this GetXpnResourcesProjectsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetXpnResourcesProjectsRequest + * @instance + * @returns {Object.} JSON object + */ + GetXpnResourcesProjectsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetXpnResourcesProjectsRequest; + })(); + + v1.ListXpnHostsProjectsRequest = (function() { + + /** + * Properties of a ListXpnHostsProjectsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListXpnHostsProjectsRequest + * @property {string|null} [filter] ListXpnHostsProjectsRequest filter + * @property {number|null} [maxResults] ListXpnHostsProjectsRequest maxResults + * @property {string|null} [orderBy] ListXpnHostsProjectsRequest orderBy + * @property {string|null} [pageToken] ListXpnHostsProjectsRequest pageToken + * @property {string|null} [project] ListXpnHostsProjectsRequest project + * @property {google.cloud.compute.v1.IProjectsListXpnHostsRequest|null} [projectsListXpnHostsRequestResource] ListXpnHostsProjectsRequest projectsListXpnHostsRequestResource + * @property {boolean|null} [returnPartialSuccess] ListXpnHostsProjectsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListXpnHostsProjectsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListXpnHostsProjectsRequest. + * @implements IListXpnHostsProjectsRequest + * @constructor + * @param {google.cloud.compute.v1.IListXpnHostsProjectsRequest=} [properties] Properties to set + */ + function ListXpnHostsProjectsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListXpnHostsProjectsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + ListXpnHostsProjectsRequest.prototype.filter = null; + + /** + * ListXpnHostsProjectsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + ListXpnHostsProjectsRequest.prototype.maxResults = null; + + /** + * ListXpnHostsProjectsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + ListXpnHostsProjectsRequest.prototype.orderBy = null; + + /** + * ListXpnHostsProjectsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + ListXpnHostsProjectsRequest.prototype.pageToken = null; + + /** + * ListXpnHostsProjectsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + ListXpnHostsProjectsRequest.prototype.project = ""; + + /** + * ListXpnHostsProjectsRequest projectsListXpnHostsRequestResource. + * @member {google.cloud.compute.v1.IProjectsListXpnHostsRequest|null|undefined} projectsListXpnHostsRequestResource + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + ListXpnHostsProjectsRequest.prototype.projectsListXpnHostsRequestResource = null; + + /** + * ListXpnHostsProjectsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + ListXpnHostsProjectsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListXpnHostsProjectsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + Object.defineProperty(ListXpnHostsProjectsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListXpnHostsProjectsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + Object.defineProperty(ListXpnHostsProjectsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListXpnHostsProjectsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + Object.defineProperty(ListXpnHostsProjectsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListXpnHostsProjectsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + Object.defineProperty(ListXpnHostsProjectsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListXpnHostsProjectsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + */ + Object.defineProperty(ListXpnHostsProjectsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListXpnHostsProjectsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {google.cloud.compute.v1.IListXpnHostsProjectsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListXpnHostsProjectsRequest} ListXpnHostsProjectsRequest instance + */ + ListXpnHostsProjectsRequest.create = function create(properties) { + return new ListXpnHostsProjectsRequest(properties); + }; + + /** + * Encodes the specified ListXpnHostsProjectsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListXpnHostsProjectsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {google.cloud.compute.v1.IListXpnHostsProjectsRequest} message ListXpnHostsProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListXpnHostsProjectsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.projectsListXpnHostsRequestResource != null && Object.hasOwnProperty.call(message, "projectsListXpnHostsRequestResource")) + $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest.encode(message.projectsListXpnHostsRequestResource, writer.uint32(/* id 238266391, wireType 2 =*/1906131130).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListXpnHostsProjectsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListXpnHostsProjectsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {google.cloud.compute.v1.IListXpnHostsProjectsRequest} message ListXpnHostsProjectsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListXpnHostsProjectsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListXpnHostsProjectsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListXpnHostsProjectsRequest} ListXpnHostsProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListXpnHostsProjectsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListXpnHostsProjectsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 238266391: + message.projectsListXpnHostsRequestResource = $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest.decode(reader, reader.uint32()); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListXpnHostsProjectsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListXpnHostsProjectsRequest} ListXpnHostsProjectsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListXpnHostsProjectsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListXpnHostsProjectsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListXpnHostsProjectsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectsListXpnHostsRequestResource != null && message.hasOwnProperty("projectsListXpnHostsRequestResource")) { + var error = $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest.verify(message.projectsListXpnHostsRequestResource); + if (error) + return "projectsListXpnHostsRequestResource." + error; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListXpnHostsProjectsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListXpnHostsProjectsRequest} ListXpnHostsProjectsRequest + */ + ListXpnHostsProjectsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListXpnHostsProjectsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListXpnHostsProjectsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.projectsListXpnHostsRequestResource != null) { + if (typeof object.projectsListXpnHostsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ListXpnHostsProjectsRequest.projectsListXpnHostsRequestResource: object expected"); + message.projectsListXpnHostsRequestResource = $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest.fromObject(object.projectsListXpnHostsRequestResource); + } + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListXpnHostsProjectsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @static + * @param {google.cloud.compute.v1.ListXpnHostsProjectsRequest} message ListXpnHostsProjectsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListXpnHostsProjectsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.projectsListXpnHostsRequestResource = null; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.projectsListXpnHostsRequestResource != null && message.hasOwnProperty("projectsListXpnHostsRequestResource")) + object.projectsListXpnHostsRequestResource = $root.google.cloud.compute.v1.ProjectsListXpnHostsRequest.toObject(message.projectsListXpnHostsRequestResource, options); + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListXpnHostsProjectsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListXpnHostsProjectsRequest + * @instance + * @returns {Object.} JSON object + */ + ListXpnHostsProjectsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListXpnHostsProjectsRequest; + })(); + + v1.MoveDiskProjectRequest = (function() { + + /** + * Properties of a MoveDiskProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IMoveDiskProjectRequest + * @property {google.cloud.compute.v1.IDiskMoveRequest|null} [diskMoveRequestResource] MoveDiskProjectRequest diskMoveRequestResource + * @property {string|null} [project] MoveDiskProjectRequest project + * @property {string|null} [requestId] MoveDiskProjectRequest requestId + */ + + /** + * Constructs a new MoveDiskProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MoveDiskProjectRequest. + * @implements IMoveDiskProjectRequest + * @constructor + * @param {google.cloud.compute.v1.IMoveDiskProjectRequest=} [properties] Properties to set + */ + function MoveDiskProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveDiskProjectRequest diskMoveRequestResource. + * @member {google.cloud.compute.v1.IDiskMoveRequest|null|undefined} diskMoveRequestResource + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @instance + */ + MoveDiskProjectRequest.prototype.diskMoveRequestResource = null; + + /** + * MoveDiskProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @instance + */ + MoveDiskProjectRequest.prototype.project = ""; + + /** + * MoveDiskProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @instance + */ + MoveDiskProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MoveDiskProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @instance + */ + Object.defineProperty(MoveDiskProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MoveDiskProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {google.cloud.compute.v1.IMoveDiskProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MoveDiskProjectRequest} MoveDiskProjectRequest instance + */ + MoveDiskProjectRequest.create = function create(properties) { + return new MoveDiskProjectRequest(properties); + }; + + /** + * Encodes the specified MoveDiskProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.MoveDiskProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {google.cloud.compute.v1.IMoveDiskProjectRequest} message MoveDiskProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveDiskProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.diskMoveRequestResource != null && Object.hasOwnProperty.call(message, "diskMoveRequestResource")) + $root.google.cloud.compute.v1.DiskMoveRequest.encode(message.diskMoveRequestResource, writer.uint32(/* id 313008458, wireType 2 =*/2504067666).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveDiskProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MoveDiskProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {google.cloud.compute.v1.IMoveDiskProjectRequest} message MoveDiskProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveDiskProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveDiskProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MoveDiskProjectRequest} MoveDiskProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveDiskProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MoveDiskProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 313008458: + message.diskMoveRequestResource = $root.google.cloud.compute.v1.DiskMoveRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveDiskProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MoveDiskProjectRequest} MoveDiskProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveDiskProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveDiskProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveDiskProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskMoveRequestResource != null && message.hasOwnProperty("diskMoveRequestResource")) { + var error = $root.google.cloud.compute.v1.DiskMoveRequest.verify(message.diskMoveRequestResource); + if (error) + return "diskMoveRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a MoveDiskProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MoveDiskProjectRequest} MoveDiskProjectRequest + */ + MoveDiskProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MoveDiskProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.MoveDiskProjectRequest(); + if (object.diskMoveRequestResource != null) { + if (typeof object.diskMoveRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.MoveDiskProjectRequest.diskMoveRequestResource: object expected"); + message.diskMoveRequestResource = $root.google.cloud.compute.v1.DiskMoveRequest.fromObject(object.diskMoveRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a MoveDiskProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @static + * @param {google.cloud.compute.v1.MoveDiskProjectRequest} message MoveDiskProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveDiskProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.diskMoveRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.diskMoveRequestResource != null && message.hasOwnProperty("diskMoveRequestResource")) + object.diskMoveRequestResource = $root.google.cloud.compute.v1.DiskMoveRequest.toObject(message.diskMoveRequestResource, options); + return object; + }; + + /** + * Converts this MoveDiskProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MoveDiskProjectRequest + * @instance + * @returns {Object.} JSON object + */ + MoveDiskProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveDiskProjectRequest; + })(); + + v1.MoveInstanceProjectRequest = (function() { + + /** + * Properties of a MoveInstanceProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface IMoveInstanceProjectRequest + * @property {google.cloud.compute.v1.IInstanceMoveRequest|null} [instanceMoveRequestResource] MoveInstanceProjectRequest instanceMoveRequestResource + * @property {string|null} [project] MoveInstanceProjectRequest project + * @property {string|null} [requestId] MoveInstanceProjectRequest requestId + */ + + /** + * Constructs a new MoveInstanceProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MoveInstanceProjectRequest. + * @implements IMoveInstanceProjectRequest + * @constructor + * @param {google.cloud.compute.v1.IMoveInstanceProjectRequest=} [properties] Properties to set + */ + function MoveInstanceProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveInstanceProjectRequest instanceMoveRequestResource. + * @member {google.cloud.compute.v1.IInstanceMoveRequest|null|undefined} instanceMoveRequestResource + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @instance + */ + MoveInstanceProjectRequest.prototype.instanceMoveRequestResource = null; + + /** + * MoveInstanceProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @instance + */ + MoveInstanceProjectRequest.prototype.project = ""; + + /** + * MoveInstanceProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @instance + */ + MoveInstanceProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MoveInstanceProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @instance + */ + Object.defineProperty(MoveInstanceProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MoveInstanceProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {google.cloud.compute.v1.IMoveInstanceProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.MoveInstanceProjectRequest} MoveInstanceProjectRequest instance + */ + MoveInstanceProjectRequest.create = function create(properties) { + return new MoveInstanceProjectRequest(properties); + }; + + /** + * Encodes the specified MoveInstanceProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.MoveInstanceProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {google.cloud.compute.v1.IMoveInstanceProjectRequest} message MoveInstanceProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceMoveRequestResource != null && Object.hasOwnProperty.call(message, "instanceMoveRequestResource")) + $root.google.cloud.compute.v1.InstanceMoveRequest.encode(message.instanceMoveRequestResource, writer.uint32(/* id 311664194, wireType 2 =*/2493313554).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveInstanceProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.MoveInstanceProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {google.cloud.compute.v1.IMoveInstanceProjectRequest} message MoveInstanceProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveInstanceProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveInstanceProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.MoveInstanceProjectRequest} MoveInstanceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.MoveInstanceProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 311664194: + message.instanceMoveRequestResource = $root.google.cloud.compute.v1.InstanceMoveRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveInstanceProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.MoveInstanceProjectRequest} MoveInstanceProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveInstanceProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveInstanceProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveInstanceProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceMoveRequestResource != null && message.hasOwnProperty("instanceMoveRequestResource")) { + var error = $root.google.cloud.compute.v1.InstanceMoveRequest.verify(message.instanceMoveRequestResource); + if (error) + return "instanceMoveRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a MoveInstanceProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.MoveInstanceProjectRequest} MoveInstanceProjectRequest + */ + MoveInstanceProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.MoveInstanceProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.MoveInstanceProjectRequest(); + if (object.instanceMoveRequestResource != null) { + if (typeof object.instanceMoveRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.MoveInstanceProjectRequest.instanceMoveRequestResource: object expected"); + message.instanceMoveRequestResource = $root.google.cloud.compute.v1.InstanceMoveRequest.fromObject(object.instanceMoveRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a MoveInstanceProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @static + * @param {google.cloud.compute.v1.MoveInstanceProjectRequest} message MoveInstanceProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveInstanceProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.instanceMoveRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceMoveRequestResource != null && message.hasOwnProperty("instanceMoveRequestResource")) + object.instanceMoveRequestResource = $root.google.cloud.compute.v1.InstanceMoveRequest.toObject(message.instanceMoveRequestResource, options); + return object; + }; + + /** + * Converts this MoveInstanceProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.MoveInstanceProjectRequest + * @instance + * @returns {Object.} JSON object + */ + MoveInstanceProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MoveInstanceProjectRequest; + })(); + + v1.SetCommonInstanceMetadataProjectRequest = (function() { + + /** + * Properties of a SetCommonInstanceMetadataProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetCommonInstanceMetadataProjectRequest + * @property {google.cloud.compute.v1.IMetadata|null} [metadataResource] SetCommonInstanceMetadataProjectRequest metadataResource + * @property {string|null} [project] SetCommonInstanceMetadataProjectRequest project + * @property {string|null} [requestId] SetCommonInstanceMetadataProjectRequest requestId + */ + + /** + * Constructs a new SetCommonInstanceMetadataProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetCommonInstanceMetadataProjectRequest. + * @implements ISetCommonInstanceMetadataProjectRequest + * @constructor + * @param {google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest=} [properties] Properties to set + */ + function SetCommonInstanceMetadataProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetCommonInstanceMetadataProjectRequest metadataResource. + * @member {google.cloud.compute.v1.IMetadata|null|undefined} metadataResource + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @instance + */ + SetCommonInstanceMetadataProjectRequest.prototype.metadataResource = null; + + /** + * SetCommonInstanceMetadataProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @instance + */ + SetCommonInstanceMetadataProjectRequest.prototype.project = ""; + + /** + * SetCommonInstanceMetadataProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @instance + */ + SetCommonInstanceMetadataProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetCommonInstanceMetadataProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @instance + */ + Object.defineProperty(SetCommonInstanceMetadataProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetCommonInstanceMetadataProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest} SetCommonInstanceMetadataProjectRequest instance + */ + SetCommonInstanceMetadataProjectRequest.create = function create(properties) { + return new SetCommonInstanceMetadataProjectRequest(properties); + }; + + /** + * Encodes the specified SetCommonInstanceMetadataProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest} message SetCommonInstanceMetadataProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetCommonInstanceMetadataProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.metadataResource != null && Object.hasOwnProperty.call(message, "metadataResource")) + $root.google.cloud.compute.v1.Metadata.encode(message.metadataResource, writer.uint32(/* id 291086110, wireType 2 =*/2328688882).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetCommonInstanceMetadataProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest} message SetCommonInstanceMetadataProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetCommonInstanceMetadataProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetCommonInstanceMetadataProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest} SetCommonInstanceMetadataProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetCommonInstanceMetadataProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 291086110: + message.metadataResource = $root.google.cloud.compute.v1.Metadata.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetCommonInstanceMetadataProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest} SetCommonInstanceMetadataProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetCommonInstanceMetadataProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetCommonInstanceMetadataProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetCommonInstanceMetadataProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.metadataResource != null && message.hasOwnProperty("metadataResource")) { + var error = $root.google.cloud.compute.v1.Metadata.verify(message.metadataResource); + if (error) + return "metadataResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a SetCommonInstanceMetadataProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest} SetCommonInstanceMetadataProjectRequest + */ + SetCommonInstanceMetadataProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest(); + if (object.metadataResource != null) { + if (typeof object.metadataResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest.metadataResource: object expected"); + message.metadataResource = $root.google.cloud.compute.v1.Metadata.fromObject(object.metadataResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SetCommonInstanceMetadataProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @static + * @param {google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest} message SetCommonInstanceMetadataProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetCommonInstanceMetadataProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.metadataResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.metadataResource != null && message.hasOwnProperty("metadataResource")) + object.metadataResource = $root.google.cloud.compute.v1.Metadata.toObject(message.metadataResource, options); + return object; + }; + + /** + * Converts this SetCommonInstanceMetadataProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest + * @instance + * @returns {Object.} JSON object + */ + SetCommonInstanceMetadataProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetCommonInstanceMetadataProjectRequest; + })(); + + v1.SetDefaultNetworkTierProjectRequest = (function() { + + /** + * Properties of a SetDefaultNetworkTierProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetDefaultNetworkTierProjectRequest + * @property {string|null} [project] SetDefaultNetworkTierProjectRequest project + * @property {google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest|null} [projectsSetDefaultNetworkTierRequestResource] SetDefaultNetworkTierProjectRequest projectsSetDefaultNetworkTierRequestResource + * @property {string|null} [requestId] SetDefaultNetworkTierProjectRequest requestId + */ + + /** + * Constructs a new SetDefaultNetworkTierProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetDefaultNetworkTierProjectRequest. + * @implements ISetDefaultNetworkTierProjectRequest + * @constructor + * @param {google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest=} [properties] Properties to set + */ + function SetDefaultNetworkTierProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetDefaultNetworkTierProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @instance + */ + SetDefaultNetworkTierProjectRequest.prototype.project = ""; + + /** + * SetDefaultNetworkTierProjectRequest projectsSetDefaultNetworkTierRequestResource. + * @member {google.cloud.compute.v1.IProjectsSetDefaultNetworkTierRequest|null|undefined} projectsSetDefaultNetworkTierRequestResource + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @instance + */ + SetDefaultNetworkTierProjectRequest.prototype.projectsSetDefaultNetworkTierRequestResource = null; + + /** + * SetDefaultNetworkTierProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @instance + */ + SetDefaultNetworkTierProjectRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetDefaultNetworkTierProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @instance + */ + Object.defineProperty(SetDefaultNetworkTierProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetDefaultNetworkTierProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest} SetDefaultNetworkTierProjectRequest instance + */ + SetDefaultNetworkTierProjectRequest.create = function create(properties) { + return new SetDefaultNetworkTierProjectRequest(properties); + }; + + /** + * Encodes the specified SetDefaultNetworkTierProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest} message SetDefaultNetworkTierProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultNetworkTierProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.projectsSetDefaultNetworkTierRequestResource != null && Object.hasOwnProperty.call(message, "projectsSetDefaultNetworkTierRequestResource")) + $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.encode(message.projectsSetDefaultNetworkTierRequestResource, writer.uint32(/* id 126410762, wireType 2 =*/1011286098).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetDefaultNetworkTierProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest} message SetDefaultNetworkTierProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetDefaultNetworkTierProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetDefaultNetworkTierProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest} SetDefaultNetworkTierProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultNetworkTierProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 126410762: + message.projectsSetDefaultNetworkTierRequestResource = $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetDefaultNetworkTierProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest} SetDefaultNetworkTierProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetDefaultNetworkTierProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetDefaultNetworkTierProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetDefaultNetworkTierProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.projectsSetDefaultNetworkTierRequestResource != null && message.hasOwnProperty("projectsSetDefaultNetworkTierRequestResource")) { + var error = $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.verify(message.projectsSetDefaultNetworkTierRequestResource); + if (error) + return "projectsSetDefaultNetworkTierRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a SetDefaultNetworkTierProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest} SetDefaultNetworkTierProjectRequest + */ + SetDefaultNetworkTierProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.projectsSetDefaultNetworkTierRequestResource != null) { + if (typeof object.projectsSetDefaultNetworkTierRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest.projectsSetDefaultNetworkTierRequestResource: object expected"); + message.projectsSetDefaultNetworkTierRequestResource = $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.fromObject(object.projectsSetDefaultNetworkTierRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SetDefaultNetworkTierProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @static + * @param {google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest} message SetDefaultNetworkTierProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetDefaultNetworkTierProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectsSetDefaultNetworkTierRequestResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.projectsSetDefaultNetworkTierRequestResource != null && message.hasOwnProperty("projectsSetDefaultNetworkTierRequestResource")) + object.projectsSetDefaultNetworkTierRequestResource = $root.google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest.toObject(message.projectsSetDefaultNetworkTierRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetDefaultNetworkTierProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest + * @instance + * @returns {Object.} JSON object + */ + SetDefaultNetworkTierProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetDefaultNetworkTierProjectRequest; + })(); + + v1.SetUsageExportBucketProjectRequest = (function() { + + /** + * Properties of a SetUsageExportBucketProjectRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetUsageExportBucketProjectRequest + * @property {string|null} [project] SetUsageExportBucketProjectRequest project + * @property {string|null} [requestId] SetUsageExportBucketProjectRequest requestId + * @property {google.cloud.compute.v1.IUsageExportLocation|null} [usageExportLocationResource] SetUsageExportBucketProjectRequest usageExportLocationResource + */ + + /** + * Constructs a new SetUsageExportBucketProjectRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetUsageExportBucketProjectRequest. + * @implements ISetUsageExportBucketProjectRequest + * @constructor + * @param {google.cloud.compute.v1.ISetUsageExportBucketProjectRequest=} [properties] Properties to set + */ + function SetUsageExportBucketProjectRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetUsageExportBucketProjectRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @instance + */ + SetUsageExportBucketProjectRequest.prototype.project = ""; + + /** + * SetUsageExportBucketProjectRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @instance + */ + SetUsageExportBucketProjectRequest.prototype.requestId = null; + + /** + * SetUsageExportBucketProjectRequest usageExportLocationResource. + * @member {google.cloud.compute.v1.IUsageExportLocation|null|undefined} usageExportLocationResource + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @instance + */ + SetUsageExportBucketProjectRequest.prototype.usageExportLocationResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetUsageExportBucketProjectRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @instance + */ + Object.defineProperty(SetUsageExportBucketProjectRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetUsageExportBucketProjectRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetUsageExportBucketProjectRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetUsageExportBucketProjectRequest} SetUsageExportBucketProjectRequest instance + */ + SetUsageExportBucketProjectRequest.create = function create(properties) { + return new SetUsageExportBucketProjectRequest(properties); + }; + + /** + * Encodes the specified SetUsageExportBucketProjectRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUsageExportBucketProjectRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetUsageExportBucketProjectRequest} message SetUsageExportBucketProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUsageExportBucketProjectRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.usageExportLocationResource != null && Object.hasOwnProperty.call(message, "usageExportLocationResource")) + $root.google.cloud.compute.v1.UsageExportLocation.encode(message.usageExportLocationResource, writer.uint32(/* id 20260459, wireType 2 =*/162083674).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetUsageExportBucketProjectRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUsageExportBucketProjectRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {google.cloud.compute.v1.ISetUsageExportBucketProjectRequest} message SetUsageExportBucketProjectRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUsageExportBucketProjectRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetUsageExportBucketProjectRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetUsageExportBucketProjectRequest} SetUsageExportBucketProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUsageExportBucketProjectRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetUsageExportBucketProjectRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 20260459: + message.usageExportLocationResource = $root.google.cloud.compute.v1.UsageExportLocation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetUsageExportBucketProjectRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetUsageExportBucketProjectRequest} SetUsageExportBucketProjectRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUsageExportBucketProjectRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetUsageExportBucketProjectRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetUsageExportBucketProjectRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.usageExportLocationResource != null && message.hasOwnProperty("usageExportLocationResource")) { + var error = $root.google.cloud.compute.v1.UsageExportLocation.verify(message.usageExportLocationResource); + if (error) + return "usageExportLocationResource." + error; + } + return null; + }; + + /** + * Creates a SetUsageExportBucketProjectRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetUsageExportBucketProjectRequest} SetUsageExportBucketProjectRequest + */ + SetUsageExportBucketProjectRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetUsageExportBucketProjectRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetUsageExportBucketProjectRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.usageExportLocationResource != null) { + if (typeof object.usageExportLocationResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetUsageExportBucketProjectRequest.usageExportLocationResource: object expected"); + message.usageExportLocationResource = $root.google.cloud.compute.v1.UsageExportLocation.fromObject(object.usageExportLocationResource); + } + return message; + }; + + /** + * Creates a plain object from a SetUsageExportBucketProjectRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @static + * @param {google.cloud.compute.v1.SetUsageExportBucketProjectRequest} message SetUsageExportBucketProjectRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetUsageExportBucketProjectRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.usageExportLocationResource = null; + object.project = ""; + } + if (message.usageExportLocationResource != null && message.hasOwnProperty("usageExportLocationResource")) + object.usageExportLocationResource = $root.google.cloud.compute.v1.UsageExportLocation.toObject(message.usageExportLocationResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetUsageExportBucketProjectRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetUsageExportBucketProjectRequest + * @instance + * @returns {Object.} JSON object + */ + SetUsageExportBucketProjectRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetUsageExportBucketProjectRequest; + })(); + + v1.DeletePublicAdvertisedPrefixeRequest = (function() { + + /** + * Properties of a DeletePublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeletePublicAdvertisedPrefixeRequest + * @property {string|null} [project] DeletePublicAdvertisedPrefixeRequest project + * @property {string|null} [publicAdvertisedPrefix] DeletePublicAdvertisedPrefixeRequest publicAdvertisedPrefix + * @property {string|null} [requestId] DeletePublicAdvertisedPrefixeRequest requestId + */ + + /** + * Constructs a new DeletePublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeletePublicAdvertisedPrefixeRequest. + * @implements IDeletePublicAdvertisedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest=} [properties] Properties to set + */ + function DeletePublicAdvertisedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePublicAdvertisedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @instance + */ + DeletePublicAdvertisedPrefixeRequest.prototype.project = ""; + + /** + * DeletePublicAdvertisedPrefixeRequest publicAdvertisedPrefix. + * @member {string} publicAdvertisedPrefix + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @instance + */ + DeletePublicAdvertisedPrefixeRequest.prototype.publicAdvertisedPrefix = ""; + + /** + * DeletePublicAdvertisedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @instance + */ + DeletePublicAdvertisedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeletePublicAdvertisedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @instance + */ + Object.defineProperty(DeletePublicAdvertisedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeletePublicAdvertisedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest} DeletePublicAdvertisedPrefixeRequest instance + */ + DeletePublicAdvertisedPrefixeRequest.create = function create(properties) { + return new DeletePublicAdvertisedPrefixeRequest(properties); + }; + + /** + * Encodes the specified DeletePublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest} message DeletePublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePublicAdvertisedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.publicAdvertisedPrefix != null && Object.hasOwnProperty.call(message, "publicAdvertisedPrefix")) + writer.uint32(/* id 101874590, wireType 2 =*/814996722).string(message.publicAdvertisedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeletePublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest} message DeletePublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePublicAdvertisedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest} DeletePublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePublicAdvertisedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 101874590: + message.publicAdvertisedPrefix = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest} DeletePublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePublicAdvertisedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePublicAdvertisedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePublicAdvertisedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicAdvertisedPrefix != null && message.hasOwnProperty("publicAdvertisedPrefix")) + if (!$util.isString(message.publicAdvertisedPrefix)) + return "publicAdvertisedPrefix: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeletePublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest} DeletePublicAdvertisedPrefixeRequest + */ + DeletePublicAdvertisedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicAdvertisedPrefix != null) + message.publicAdvertisedPrefix = String(object.publicAdvertisedPrefix); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeletePublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest} message DeletePublicAdvertisedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePublicAdvertisedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicAdvertisedPrefix = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.publicAdvertisedPrefix != null && message.hasOwnProperty("publicAdvertisedPrefix")) + object.publicAdvertisedPrefix = message.publicAdvertisedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeletePublicAdvertisedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePublicAdvertisedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeletePublicAdvertisedPrefixeRequest; + })(); + + v1.GetPublicAdvertisedPrefixeRequest = (function() { + + /** + * Properties of a GetPublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetPublicAdvertisedPrefixeRequest + * @property {string|null} [project] GetPublicAdvertisedPrefixeRequest project + * @property {string|null} [publicAdvertisedPrefix] GetPublicAdvertisedPrefixeRequest publicAdvertisedPrefix + */ + + /** + * Constructs a new GetPublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetPublicAdvertisedPrefixeRequest. + * @implements IGetPublicAdvertisedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest=} [properties] Properties to set + */ + function GetPublicAdvertisedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPublicAdvertisedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @instance + */ + GetPublicAdvertisedPrefixeRequest.prototype.project = ""; + + /** + * GetPublicAdvertisedPrefixeRequest publicAdvertisedPrefix. + * @member {string} publicAdvertisedPrefix + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @instance + */ + GetPublicAdvertisedPrefixeRequest.prototype.publicAdvertisedPrefix = ""; + + /** + * Creates a new GetPublicAdvertisedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest} GetPublicAdvertisedPrefixeRequest instance + */ + GetPublicAdvertisedPrefixeRequest.create = function create(properties) { + return new GetPublicAdvertisedPrefixeRequest(properties); + }; + + /** + * Encodes the specified GetPublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest} message GetPublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPublicAdvertisedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicAdvertisedPrefix != null && Object.hasOwnProperty.call(message, "publicAdvertisedPrefix")) + writer.uint32(/* id 101874590, wireType 2 =*/814996722).string(message.publicAdvertisedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetPublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest} message GetPublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPublicAdvertisedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest} GetPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPublicAdvertisedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 101874590: + message.publicAdvertisedPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest} GetPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPublicAdvertisedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPublicAdvertisedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPublicAdvertisedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicAdvertisedPrefix != null && message.hasOwnProperty("publicAdvertisedPrefix")) + if (!$util.isString(message.publicAdvertisedPrefix)) + return "publicAdvertisedPrefix: string expected"; + return null; + }; + + /** + * Creates a GetPublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest} GetPublicAdvertisedPrefixeRequest + */ + GetPublicAdvertisedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicAdvertisedPrefix != null) + message.publicAdvertisedPrefix = String(object.publicAdvertisedPrefix); + return message; + }; + + /** + * Creates a plain object from a GetPublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest} message GetPublicAdvertisedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPublicAdvertisedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicAdvertisedPrefix = ""; + object.project = ""; + } + if (message.publicAdvertisedPrefix != null && message.hasOwnProperty("publicAdvertisedPrefix")) + object.publicAdvertisedPrefix = message.publicAdvertisedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetPublicAdvertisedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + GetPublicAdvertisedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPublicAdvertisedPrefixeRequest; + })(); + + v1.InsertPublicAdvertisedPrefixeRequest = (function() { + + /** + * Properties of an InsertPublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertPublicAdvertisedPrefixeRequest + * @property {string|null} [project] InsertPublicAdvertisedPrefixeRequest project + * @property {google.cloud.compute.v1.IPublicAdvertisedPrefix|null} [publicAdvertisedPrefixResource] InsertPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource + * @property {string|null} [requestId] InsertPublicAdvertisedPrefixeRequest requestId + */ + + /** + * Constructs a new InsertPublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertPublicAdvertisedPrefixeRequest. + * @implements IInsertPublicAdvertisedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest=} [properties] Properties to set + */ + function InsertPublicAdvertisedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertPublicAdvertisedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @instance + */ + InsertPublicAdvertisedPrefixeRequest.prototype.project = ""; + + /** + * InsertPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource. + * @member {google.cloud.compute.v1.IPublicAdvertisedPrefix|null|undefined} publicAdvertisedPrefixResource + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @instance + */ + InsertPublicAdvertisedPrefixeRequest.prototype.publicAdvertisedPrefixResource = null; + + /** + * InsertPublicAdvertisedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @instance + */ + InsertPublicAdvertisedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertPublicAdvertisedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @instance + */ + Object.defineProperty(InsertPublicAdvertisedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertPublicAdvertisedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest} InsertPublicAdvertisedPrefixeRequest instance + */ + InsertPublicAdvertisedPrefixeRequest.create = function create(properties) { + return new InsertPublicAdvertisedPrefixeRequest(properties); + }; + + /** + * Encodes the specified InsertPublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest} message InsertPublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertPublicAdvertisedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.publicAdvertisedPrefixResource != null && Object.hasOwnProperty.call(message, "publicAdvertisedPrefixResource")) + $root.google.cloud.compute.v1.PublicAdvertisedPrefix.encode(message.publicAdvertisedPrefixResource, writer.uint32(/* id 233614223, wireType 2 =*/1868913786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertPublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest} message InsertPublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertPublicAdvertisedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertPublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest} InsertPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertPublicAdvertisedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 233614223: + message.publicAdvertisedPrefixResource = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertPublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest} InsertPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertPublicAdvertisedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertPublicAdvertisedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertPublicAdvertisedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicAdvertisedPrefixResource != null && message.hasOwnProperty("publicAdvertisedPrefixResource")) { + var error = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.verify(message.publicAdvertisedPrefixResource); + if (error) + return "publicAdvertisedPrefixResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertPublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest} InsertPublicAdvertisedPrefixeRequest + */ + InsertPublicAdvertisedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicAdvertisedPrefixResource != null) { + if (typeof object.publicAdvertisedPrefixResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest.publicAdvertisedPrefixResource: object expected"); + message.publicAdvertisedPrefixResource = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.fromObject(object.publicAdvertisedPrefixResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertPublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest} message InsertPublicAdvertisedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertPublicAdvertisedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.publicAdvertisedPrefixResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.publicAdvertisedPrefixResource != null && message.hasOwnProperty("publicAdvertisedPrefixResource")) + object.publicAdvertisedPrefixResource = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.toObject(message.publicAdvertisedPrefixResource, options); + return object; + }; + + /** + * Converts this InsertPublicAdvertisedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + InsertPublicAdvertisedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertPublicAdvertisedPrefixeRequest; + })(); + + v1.ListPublicAdvertisedPrefixesRequest = (function() { + + /** + * Properties of a ListPublicAdvertisedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListPublicAdvertisedPrefixesRequest + * @property {string|null} [filter] ListPublicAdvertisedPrefixesRequest filter + * @property {number|null} [maxResults] ListPublicAdvertisedPrefixesRequest maxResults + * @property {string|null} [orderBy] ListPublicAdvertisedPrefixesRequest orderBy + * @property {string|null} [pageToken] ListPublicAdvertisedPrefixesRequest pageToken + * @property {string|null} [project] ListPublicAdvertisedPrefixesRequest project + * @property {boolean|null} [returnPartialSuccess] ListPublicAdvertisedPrefixesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListPublicAdvertisedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListPublicAdvertisedPrefixesRequest. + * @implements IListPublicAdvertisedPrefixesRequest + * @constructor + * @param {google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest=} [properties] Properties to set + */ + function ListPublicAdvertisedPrefixesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPublicAdvertisedPrefixesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + ListPublicAdvertisedPrefixesRequest.prototype.filter = null; + + /** + * ListPublicAdvertisedPrefixesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + ListPublicAdvertisedPrefixesRequest.prototype.maxResults = null; + + /** + * ListPublicAdvertisedPrefixesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + ListPublicAdvertisedPrefixesRequest.prototype.orderBy = null; + + /** + * ListPublicAdvertisedPrefixesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + ListPublicAdvertisedPrefixesRequest.prototype.pageToken = null; + + /** + * ListPublicAdvertisedPrefixesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + ListPublicAdvertisedPrefixesRequest.prototype.project = ""; + + /** + * ListPublicAdvertisedPrefixesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + ListPublicAdvertisedPrefixesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPublicAdvertisedPrefixesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicAdvertisedPrefixesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicAdvertisedPrefixesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicAdvertisedPrefixesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicAdvertisedPrefixesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicAdvertisedPrefixesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicAdvertisedPrefixesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicAdvertisedPrefixesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicAdvertisedPrefixesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicAdvertisedPrefixesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPublicAdvertisedPrefixesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest} ListPublicAdvertisedPrefixesRequest instance + */ + ListPublicAdvertisedPrefixesRequest.create = function create(properties) { + return new ListPublicAdvertisedPrefixesRequest(properties); + }; + + /** + * Encodes the specified ListPublicAdvertisedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest} message ListPublicAdvertisedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPublicAdvertisedPrefixesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListPublicAdvertisedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest} message ListPublicAdvertisedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPublicAdvertisedPrefixesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPublicAdvertisedPrefixesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest} ListPublicAdvertisedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPublicAdvertisedPrefixesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPublicAdvertisedPrefixesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest} ListPublicAdvertisedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPublicAdvertisedPrefixesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPublicAdvertisedPrefixesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPublicAdvertisedPrefixesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListPublicAdvertisedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest} ListPublicAdvertisedPrefixesRequest + */ + ListPublicAdvertisedPrefixesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListPublicAdvertisedPrefixesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest} message ListPublicAdvertisedPrefixesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPublicAdvertisedPrefixesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListPublicAdvertisedPrefixesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest + * @instance + * @returns {Object.} JSON object + */ + ListPublicAdvertisedPrefixesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPublicAdvertisedPrefixesRequest; + })(); + + v1.PatchPublicAdvertisedPrefixeRequest = (function() { + + /** + * Properties of a PatchPublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchPublicAdvertisedPrefixeRequest + * @property {string|null} [project] PatchPublicAdvertisedPrefixeRequest project + * @property {string|null} [publicAdvertisedPrefix] PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefix + * @property {google.cloud.compute.v1.IPublicAdvertisedPrefix|null} [publicAdvertisedPrefixResource] PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource + * @property {string|null} [requestId] PatchPublicAdvertisedPrefixeRequest requestId + */ + + /** + * Constructs a new PatchPublicAdvertisedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchPublicAdvertisedPrefixeRequest. + * @implements IPatchPublicAdvertisedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest=} [properties] Properties to set + */ + function PatchPublicAdvertisedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchPublicAdvertisedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @instance + */ + PatchPublicAdvertisedPrefixeRequest.prototype.project = ""; + + /** + * PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefix. + * @member {string} publicAdvertisedPrefix + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @instance + */ + PatchPublicAdvertisedPrefixeRequest.prototype.publicAdvertisedPrefix = ""; + + /** + * PatchPublicAdvertisedPrefixeRequest publicAdvertisedPrefixResource. + * @member {google.cloud.compute.v1.IPublicAdvertisedPrefix|null|undefined} publicAdvertisedPrefixResource + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @instance + */ + PatchPublicAdvertisedPrefixeRequest.prototype.publicAdvertisedPrefixResource = null; + + /** + * PatchPublicAdvertisedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @instance + */ + PatchPublicAdvertisedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchPublicAdvertisedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @instance + */ + Object.defineProperty(PatchPublicAdvertisedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchPublicAdvertisedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest} PatchPublicAdvertisedPrefixeRequest instance + */ + PatchPublicAdvertisedPrefixeRequest.create = function create(properties) { + return new PatchPublicAdvertisedPrefixeRequest(properties); + }; + + /** + * Encodes the specified PatchPublicAdvertisedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest} message PatchPublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPublicAdvertisedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.publicAdvertisedPrefix != null && Object.hasOwnProperty.call(message, "publicAdvertisedPrefix")) + writer.uint32(/* id 101874590, wireType 2 =*/814996722).string(message.publicAdvertisedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.publicAdvertisedPrefixResource != null && Object.hasOwnProperty.call(message, "publicAdvertisedPrefixResource")) + $root.google.cloud.compute.v1.PublicAdvertisedPrefix.encode(message.publicAdvertisedPrefixResource, writer.uint32(/* id 233614223, wireType 2 =*/1868913786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchPublicAdvertisedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest} message PatchPublicAdvertisedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPublicAdvertisedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchPublicAdvertisedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest} PatchPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPublicAdvertisedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 101874590: + message.publicAdvertisedPrefix = reader.string(); + break; + case 233614223: + message.publicAdvertisedPrefixResource = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchPublicAdvertisedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest} PatchPublicAdvertisedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPublicAdvertisedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchPublicAdvertisedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchPublicAdvertisedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicAdvertisedPrefix != null && message.hasOwnProperty("publicAdvertisedPrefix")) + if (!$util.isString(message.publicAdvertisedPrefix)) + return "publicAdvertisedPrefix: string expected"; + if (message.publicAdvertisedPrefixResource != null && message.hasOwnProperty("publicAdvertisedPrefixResource")) { + var error = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.verify(message.publicAdvertisedPrefixResource); + if (error) + return "publicAdvertisedPrefixResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchPublicAdvertisedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest} PatchPublicAdvertisedPrefixeRequest + */ + PatchPublicAdvertisedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicAdvertisedPrefix != null) + message.publicAdvertisedPrefix = String(object.publicAdvertisedPrefix); + if (object.publicAdvertisedPrefixResource != null) { + if (typeof object.publicAdvertisedPrefixResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest.publicAdvertisedPrefixResource: object expected"); + message.publicAdvertisedPrefixResource = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.fromObject(object.publicAdvertisedPrefixResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchPublicAdvertisedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest} message PatchPublicAdvertisedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchPublicAdvertisedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicAdvertisedPrefix = ""; + object.project = ""; + object.publicAdvertisedPrefixResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.publicAdvertisedPrefix != null && message.hasOwnProperty("publicAdvertisedPrefix")) + object.publicAdvertisedPrefix = message.publicAdvertisedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.publicAdvertisedPrefixResource != null && message.hasOwnProperty("publicAdvertisedPrefixResource")) + object.publicAdvertisedPrefixResource = $root.google.cloud.compute.v1.PublicAdvertisedPrefix.toObject(message.publicAdvertisedPrefixResource, options); + return object; + }; + + /** + * Converts this PatchPublicAdvertisedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + PatchPublicAdvertisedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchPublicAdvertisedPrefixeRequest; + })(); + + v1.AggregatedListPublicDelegatedPrefixesRequest = (function() { + + /** + * Properties of an AggregatedListPublicDelegatedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListPublicDelegatedPrefixesRequest + * @property {string|null} [filter] AggregatedListPublicDelegatedPrefixesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListPublicDelegatedPrefixesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListPublicDelegatedPrefixesRequest maxResults + * @property {string|null} [orderBy] AggregatedListPublicDelegatedPrefixesRequest orderBy + * @property {string|null} [pageToken] AggregatedListPublicDelegatedPrefixesRequest pageToken + * @property {string|null} [project] AggregatedListPublicDelegatedPrefixesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListPublicDelegatedPrefixesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListPublicDelegatedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListPublicDelegatedPrefixesRequest. + * @implements IAggregatedListPublicDelegatedPrefixesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest=} [properties] Properties to set + */ + function AggregatedListPublicDelegatedPrefixesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListPublicDelegatedPrefixesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.filter = null; + + /** + * AggregatedListPublicDelegatedPrefixesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListPublicDelegatedPrefixesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.maxResults = null; + + /** + * AggregatedListPublicDelegatedPrefixesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.orderBy = null; + + /** + * AggregatedListPublicDelegatedPrefixesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.pageToken = null; + + /** + * AggregatedListPublicDelegatedPrefixesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.project = ""; + + /** + * AggregatedListPublicDelegatedPrefixesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListPublicDelegatedPrefixesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(AggregatedListPublicDelegatedPrefixesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPublicDelegatedPrefixesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(AggregatedListPublicDelegatedPrefixesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPublicDelegatedPrefixesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(AggregatedListPublicDelegatedPrefixesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPublicDelegatedPrefixesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(AggregatedListPublicDelegatedPrefixesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPublicDelegatedPrefixesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(AggregatedListPublicDelegatedPrefixesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListPublicDelegatedPrefixesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(AggregatedListPublicDelegatedPrefixesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListPublicDelegatedPrefixesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest} AggregatedListPublicDelegatedPrefixesRequest instance + */ + AggregatedListPublicDelegatedPrefixesRequest.create = function create(properties) { + return new AggregatedListPublicDelegatedPrefixesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListPublicDelegatedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest} message AggregatedListPublicDelegatedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListPublicDelegatedPrefixesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListPublicDelegatedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest} message AggregatedListPublicDelegatedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListPublicDelegatedPrefixesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListPublicDelegatedPrefixesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest} AggregatedListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListPublicDelegatedPrefixesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListPublicDelegatedPrefixesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest} AggregatedListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListPublicDelegatedPrefixesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListPublicDelegatedPrefixesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListPublicDelegatedPrefixesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListPublicDelegatedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest} AggregatedListPublicDelegatedPrefixesRequest + */ + AggregatedListPublicDelegatedPrefixesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListPublicDelegatedPrefixesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest} message AggregatedListPublicDelegatedPrefixesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListPublicDelegatedPrefixesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListPublicDelegatedPrefixesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListPublicDelegatedPrefixesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListPublicDelegatedPrefixesRequest; + })(); + + v1.DeletePublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of a DeletePublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeletePublicDelegatedPrefixeRequest + * @property {string|null} [project] DeletePublicDelegatedPrefixeRequest project + * @property {string|null} [publicDelegatedPrefix] DeletePublicDelegatedPrefixeRequest publicDelegatedPrefix + * @property {string|null} [region] DeletePublicDelegatedPrefixeRequest region + * @property {string|null} [requestId] DeletePublicDelegatedPrefixeRequest requestId + */ + + /** + * Constructs a new DeletePublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeletePublicDelegatedPrefixeRequest. + * @implements IDeletePublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function DeletePublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @instance + */ + DeletePublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * DeletePublicDelegatedPrefixeRequest publicDelegatedPrefix. + * @member {string} publicDelegatedPrefix + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @instance + */ + DeletePublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefix = ""; + + /** + * DeletePublicDelegatedPrefixeRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @instance + */ + DeletePublicDelegatedPrefixeRequest.prototype.region = ""; + + /** + * DeletePublicDelegatedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @instance + */ + DeletePublicDelegatedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeletePublicDelegatedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @instance + */ + Object.defineProperty(DeletePublicDelegatedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeletePublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest} DeletePublicDelegatedPrefixeRequest instance + */ + DeletePublicDelegatedPrefixeRequest.create = function create(properties) { + return new DeletePublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified DeletePublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest} message DeletePublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.publicDelegatedPrefix != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefix")) + writer.uint32(/* id 204238440, wireType 2 =*/1633907522).string(message.publicDelegatedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeletePublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest} message DeletePublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest} DeletePublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 204238440: + message.publicDelegatedPrefix = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest} DeletePublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + if (!$util.isString(message.publicDelegatedPrefix)) + return "publicDelegatedPrefix: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeletePublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest} DeletePublicDelegatedPrefixeRequest + */ + DeletePublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefix != null) + message.publicDelegatedPrefix = String(object.publicDelegatedPrefix); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeletePublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest} message DeletePublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.publicDelegatedPrefix = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + object.publicDelegatedPrefix = message.publicDelegatedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeletePublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeletePublicDelegatedPrefixeRequest; + })(); + + v1.GetPublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of a GetPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetPublicDelegatedPrefixeRequest + * @property {string|null} [project] GetPublicDelegatedPrefixeRequest project + * @property {string|null} [publicDelegatedPrefix] GetPublicDelegatedPrefixeRequest publicDelegatedPrefix + * @property {string|null} [region] GetPublicDelegatedPrefixeRequest region + */ + + /** + * Constructs a new GetPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetPublicDelegatedPrefixeRequest. + * @implements IGetPublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function GetPublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @instance + */ + GetPublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * GetPublicDelegatedPrefixeRequest publicDelegatedPrefix. + * @member {string} publicDelegatedPrefix + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @instance + */ + GetPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefix = ""; + + /** + * GetPublicDelegatedPrefixeRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @instance + */ + GetPublicDelegatedPrefixeRequest.prototype.region = ""; + + /** + * Creates a new GetPublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest} GetPublicDelegatedPrefixeRequest instance + */ + GetPublicDelegatedPrefixeRequest.create = function create(properties) { + return new GetPublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified GetPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest} message GetPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.publicDelegatedPrefix != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefix")) + writer.uint32(/* id 204238440, wireType 2 =*/1633907522).string(message.publicDelegatedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest} message GetPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest} GetPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 204238440: + message.publicDelegatedPrefix = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest} GetPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + if (!$util.isString(message.publicDelegatedPrefix)) + return "publicDelegatedPrefix: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest} GetPublicDelegatedPrefixeRequest + */ + GetPublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefix != null) + message.publicDelegatedPrefix = String(object.publicDelegatedPrefix); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest} message GetPublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.publicDelegatedPrefix = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + object.publicDelegatedPrefix = message.publicDelegatedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetPublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + GetPublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetPublicDelegatedPrefixeRequest; + })(); + + v1.InsertPublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of an InsertPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertPublicDelegatedPrefixeRequest + * @property {string|null} [project] InsertPublicDelegatedPrefixeRequest project + * @property {google.cloud.compute.v1.IPublicDelegatedPrefix|null} [publicDelegatedPrefixResource] InsertPublicDelegatedPrefixeRequest publicDelegatedPrefixResource + * @property {string|null} [region] InsertPublicDelegatedPrefixeRequest region + * @property {string|null} [requestId] InsertPublicDelegatedPrefixeRequest requestId + */ + + /** + * Constructs a new InsertPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertPublicDelegatedPrefixeRequest. + * @implements IInsertPublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function InsertPublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertPublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @instance + */ + InsertPublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * InsertPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. + * @member {google.cloud.compute.v1.IPublicDelegatedPrefix|null|undefined} publicDelegatedPrefixResource + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @instance + */ + InsertPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefixResource = null; + + /** + * InsertPublicDelegatedPrefixeRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @instance + */ + InsertPublicDelegatedPrefixeRequest.prototype.region = ""; + + /** + * InsertPublicDelegatedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @instance + */ + InsertPublicDelegatedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertPublicDelegatedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @instance + */ + Object.defineProperty(InsertPublicDelegatedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertPublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest} InsertPublicDelegatedPrefixeRequest instance + */ + InsertPublicDelegatedPrefixeRequest.create = function create(properties) { + return new InsertPublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified InsertPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest} message InsertPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertPublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.publicDelegatedPrefixResource != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefixResource")) + $root.google.cloud.compute.v1.PublicDelegatedPrefix.encode(message.publicDelegatedPrefixResource, writer.uint32(/* id 47594501, wireType 2 =*/380756010).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest} message InsertPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertPublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest} InsertPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertPublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 47594501: + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.decode(reader, reader.uint32()); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest} InsertPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertPublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertPublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertPublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefix.verify(message.publicDelegatedPrefixResource); + if (error) + return "publicDelegatedPrefixResource." + error; + } + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest} InsertPublicDelegatedPrefixeRequest + */ + InsertPublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefixResource != null) { + if (typeof object.publicDelegatedPrefixResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest.publicDelegatedPrefixResource: object expected"); + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.fromObject(object.publicDelegatedPrefixResource); + } + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest} message InsertPublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertPublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicDelegatedPrefixResource = null; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) + object.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.toObject(message.publicDelegatedPrefixResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertPublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + InsertPublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertPublicDelegatedPrefixeRequest; + })(); + + v1.ListPublicDelegatedPrefixesRequest = (function() { + + /** + * Properties of a ListPublicDelegatedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListPublicDelegatedPrefixesRequest + * @property {string|null} [filter] ListPublicDelegatedPrefixesRequest filter + * @property {number|null} [maxResults] ListPublicDelegatedPrefixesRequest maxResults + * @property {string|null} [orderBy] ListPublicDelegatedPrefixesRequest orderBy + * @property {string|null} [pageToken] ListPublicDelegatedPrefixesRequest pageToken + * @property {string|null} [project] ListPublicDelegatedPrefixesRequest project + * @property {string|null} [region] ListPublicDelegatedPrefixesRequest region + * @property {boolean|null} [returnPartialSuccess] ListPublicDelegatedPrefixesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListPublicDelegatedPrefixesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListPublicDelegatedPrefixesRequest. + * @implements IListPublicDelegatedPrefixesRequest + * @constructor + * @param {google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest=} [properties] Properties to set + */ + function ListPublicDelegatedPrefixesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPublicDelegatedPrefixesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + ListPublicDelegatedPrefixesRequest.prototype.filter = null; + + /** + * ListPublicDelegatedPrefixesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + ListPublicDelegatedPrefixesRequest.prototype.maxResults = null; + + /** + * ListPublicDelegatedPrefixesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + ListPublicDelegatedPrefixesRequest.prototype.orderBy = null; + + /** + * ListPublicDelegatedPrefixesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + ListPublicDelegatedPrefixesRequest.prototype.pageToken = null; + + /** + * ListPublicDelegatedPrefixesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + ListPublicDelegatedPrefixesRequest.prototype.project = ""; + + /** + * ListPublicDelegatedPrefixesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + ListPublicDelegatedPrefixesRequest.prototype.region = ""; + + /** + * ListPublicDelegatedPrefixesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + ListPublicDelegatedPrefixesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPublicDelegatedPrefixesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicDelegatedPrefixesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicDelegatedPrefixesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicDelegatedPrefixesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicDelegatedPrefixesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicDelegatedPrefixesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicDelegatedPrefixesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicDelegatedPrefixesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPublicDelegatedPrefixesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + */ + Object.defineProperty(ListPublicDelegatedPrefixesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPublicDelegatedPrefixesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest} ListPublicDelegatedPrefixesRequest instance + */ + ListPublicDelegatedPrefixesRequest.create = function create(properties) { + return new ListPublicDelegatedPrefixesRequest(properties); + }; + + /** + * Encodes the specified ListPublicDelegatedPrefixesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest} message ListPublicDelegatedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPublicDelegatedPrefixesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListPublicDelegatedPrefixesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest} message ListPublicDelegatedPrefixesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPublicDelegatedPrefixesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPublicDelegatedPrefixesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest} ListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPublicDelegatedPrefixesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPublicDelegatedPrefixesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest} ListPublicDelegatedPrefixesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPublicDelegatedPrefixesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPublicDelegatedPrefixesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPublicDelegatedPrefixesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListPublicDelegatedPrefixesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest} ListPublicDelegatedPrefixesRequest + */ + ListPublicDelegatedPrefixesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListPublicDelegatedPrefixesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @static + * @param {google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest} message ListPublicDelegatedPrefixesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPublicDelegatedPrefixesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListPublicDelegatedPrefixesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest + * @instance + * @returns {Object.} JSON object + */ + ListPublicDelegatedPrefixesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPublicDelegatedPrefixesRequest; + })(); + + v1.PatchPublicDelegatedPrefixeRequest = (function() { + + /** + * Properties of a PatchPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchPublicDelegatedPrefixeRequest + * @property {string|null} [project] PatchPublicDelegatedPrefixeRequest project + * @property {string|null} [publicDelegatedPrefix] PatchPublicDelegatedPrefixeRequest publicDelegatedPrefix + * @property {google.cloud.compute.v1.IPublicDelegatedPrefix|null} [publicDelegatedPrefixResource] PatchPublicDelegatedPrefixeRequest publicDelegatedPrefixResource + * @property {string|null} [region] PatchPublicDelegatedPrefixeRequest region + * @property {string|null} [requestId] PatchPublicDelegatedPrefixeRequest requestId + */ + + /** + * Constructs a new PatchPublicDelegatedPrefixeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchPublicDelegatedPrefixeRequest. + * @implements IPatchPublicDelegatedPrefixeRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest=} [properties] Properties to set + */ + function PatchPublicDelegatedPrefixeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchPublicDelegatedPrefixeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @instance + */ + PatchPublicDelegatedPrefixeRequest.prototype.project = ""; + + /** + * PatchPublicDelegatedPrefixeRequest publicDelegatedPrefix. + * @member {string} publicDelegatedPrefix + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @instance + */ + PatchPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefix = ""; + + /** + * PatchPublicDelegatedPrefixeRequest publicDelegatedPrefixResource. + * @member {google.cloud.compute.v1.IPublicDelegatedPrefix|null|undefined} publicDelegatedPrefixResource + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @instance + */ + PatchPublicDelegatedPrefixeRequest.prototype.publicDelegatedPrefixResource = null; + + /** + * PatchPublicDelegatedPrefixeRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @instance + */ + PatchPublicDelegatedPrefixeRequest.prototype.region = ""; + + /** + * PatchPublicDelegatedPrefixeRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @instance + */ + PatchPublicDelegatedPrefixeRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchPublicDelegatedPrefixeRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @instance + */ + Object.defineProperty(PatchPublicDelegatedPrefixeRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchPublicDelegatedPrefixeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest} PatchPublicDelegatedPrefixeRequest instance + */ + PatchPublicDelegatedPrefixeRequest.create = function create(properties) { + return new PatchPublicDelegatedPrefixeRequest(properties); + }; + + /** + * Encodes the specified PatchPublicDelegatedPrefixeRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest} message PatchPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPublicDelegatedPrefixeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.publicDelegatedPrefixResource != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefixResource")) + $root.google.cloud.compute.v1.PublicDelegatedPrefix.encode(message.publicDelegatedPrefixResource, writer.uint32(/* id 47594501, wireType 2 =*/380756010).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.publicDelegatedPrefix != null && Object.hasOwnProperty.call(message, "publicDelegatedPrefix")) + writer.uint32(/* id 204238440, wireType 2 =*/1633907522).string(message.publicDelegatedPrefix); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified PatchPublicDelegatedPrefixeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest} message PatchPublicDelegatedPrefixeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPublicDelegatedPrefixeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchPublicDelegatedPrefixeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest} PatchPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPublicDelegatedPrefixeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 204238440: + message.publicDelegatedPrefix = reader.string(); + break; + case 47594501: + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.decode(reader, reader.uint32()); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchPublicDelegatedPrefixeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest} PatchPublicDelegatedPrefixeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPublicDelegatedPrefixeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchPublicDelegatedPrefixeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchPublicDelegatedPrefixeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + if (!$util.isString(message.publicDelegatedPrefix)) + return "publicDelegatedPrefix: string expected"; + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) { + var error = $root.google.cloud.compute.v1.PublicDelegatedPrefix.verify(message.publicDelegatedPrefixResource); + if (error) + return "publicDelegatedPrefixResource." + error; + } + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchPublicDelegatedPrefixeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest} PatchPublicDelegatedPrefixeRequest + */ + PatchPublicDelegatedPrefixeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.publicDelegatedPrefix != null) + message.publicDelegatedPrefix = String(object.publicDelegatedPrefix); + if (object.publicDelegatedPrefixResource != null) { + if (typeof object.publicDelegatedPrefixResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest.publicDelegatedPrefixResource: object expected"); + message.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.fromObject(object.publicDelegatedPrefixResource); + } + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchPublicDelegatedPrefixeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @static + * @param {google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest} message PatchPublicDelegatedPrefixeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchPublicDelegatedPrefixeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publicDelegatedPrefixResource = null; + object.region = ""; + object.publicDelegatedPrefix = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.publicDelegatedPrefixResource != null && message.hasOwnProperty("publicDelegatedPrefixResource")) + object.publicDelegatedPrefixResource = $root.google.cloud.compute.v1.PublicDelegatedPrefix.toObject(message.publicDelegatedPrefixResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.publicDelegatedPrefix != null && message.hasOwnProperty("publicDelegatedPrefix")) + object.publicDelegatedPrefix = message.publicDelegatedPrefix; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this PatchPublicDelegatedPrefixeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest + * @instance + * @returns {Object.} JSON object + */ + PatchPublicDelegatedPrefixeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchPublicDelegatedPrefixeRequest; + })(); + + v1.DeleteRegionAutoscalerRequest = (function() { + + /** + * Properties of a DeleteRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionAutoscalerRequest + * @property {string|null} [autoscaler] DeleteRegionAutoscalerRequest autoscaler + * @property {string|null} [project] DeleteRegionAutoscalerRequest project + * @property {string|null} [region] DeleteRegionAutoscalerRequest region + * @property {string|null} [requestId] DeleteRegionAutoscalerRequest requestId + */ + + /** + * Constructs a new DeleteRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionAutoscalerRequest. + * @implements IDeleteRegionAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionAutoscalerRequest=} [properties] Properties to set + */ + function DeleteRegionAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionAutoscalerRequest autoscaler. + * @member {string} autoscaler + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @instance + */ + DeleteRegionAutoscalerRequest.prototype.autoscaler = ""; + + /** + * DeleteRegionAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @instance + */ + DeleteRegionAutoscalerRequest.prototype.project = ""; + + /** + * DeleteRegionAutoscalerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @instance + */ + DeleteRegionAutoscalerRequest.prototype.region = ""; + + /** + * DeleteRegionAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @instance + */ + DeleteRegionAutoscalerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @instance + */ + Object.defineProperty(DeleteRegionAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionAutoscalerRequest} DeleteRegionAutoscalerRequest instance + */ + DeleteRegionAutoscalerRequest.create = function create(properties) { + return new DeleteRegionAutoscalerRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionAutoscalerRequest} message DeleteRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified DeleteRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionAutoscalerRequest} message DeleteRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionAutoscalerRequest} DeleteRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionAutoscalerRequest} DeleteRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionAutoscalerRequest} DeleteRegionAutoscalerRequest + */ + DeleteRegionAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionAutoscalerRequest} message DeleteRegionAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.autoscaler = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = message.autoscaler; + return object; + }; + + /** + * Converts this DeleteRegionAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionAutoscalerRequest; + })(); + + v1.GetRegionAutoscalerRequest = (function() { + + /** + * Properties of a GetRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionAutoscalerRequest + * @property {string|null} [autoscaler] GetRegionAutoscalerRequest autoscaler + * @property {string|null} [project] GetRegionAutoscalerRequest project + * @property {string|null} [region] GetRegionAutoscalerRequest region + */ + + /** + * Constructs a new GetRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionAutoscalerRequest. + * @implements IGetRegionAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionAutoscalerRequest=} [properties] Properties to set + */ + function GetRegionAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionAutoscalerRequest autoscaler. + * @member {string} autoscaler + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @instance + */ + GetRegionAutoscalerRequest.prototype.autoscaler = ""; + + /** + * GetRegionAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @instance + */ + GetRegionAutoscalerRequest.prototype.project = ""; + + /** + * GetRegionAutoscalerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @instance + */ + GetRegionAutoscalerRequest.prototype.region = ""; + + /** + * Creates a new GetRegionAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionAutoscalerRequest} GetRegionAutoscalerRequest instance + */ + GetRegionAutoscalerRequest.create = function create(properties) { + return new GetRegionAutoscalerRequest(properties); + }; + + /** + * Encodes the specified GetRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionAutoscalerRequest} message GetRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified GetRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionAutoscalerRequest} message GetRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionAutoscalerRequest} GetRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionAutoscalerRequest} GetRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionAutoscalerRequest} GetRegionAutoscalerRequest + */ + GetRegionAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.GetRegionAutoscalerRequest} message GetRegionAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.autoscaler = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = message.autoscaler; + return object; + }; + + /** + * Converts this GetRegionAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionAutoscalerRequest; + })(); + + v1.InsertRegionAutoscalerRequest = (function() { + + /** + * Properties of an InsertRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionAutoscalerRequest + * @property {google.cloud.compute.v1.IAutoscaler|null} [autoscalerResource] InsertRegionAutoscalerRequest autoscalerResource + * @property {string|null} [project] InsertRegionAutoscalerRequest project + * @property {string|null} [region] InsertRegionAutoscalerRequest region + * @property {string|null} [requestId] InsertRegionAutoscalerRequest requestId + */ + + /** + * Constructs a new InsertRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionAutoscalerRequest. + * @implements IInsertRegionAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionAutoscalerRequest=} [properties] Properties to set + */ + function InsertRegionAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionAutoscalerRequest autoscalerResource. + * @member {google.cloud.compute.v1.IAutoscaler|null|undefined} autoscalerResource + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @instance + */ + InsertRegionAutoscalerRequest.prototype.autoscalerResource = null; + + /** + * InsertRegionAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @instance + */ + InsertRegionAutoscalerRequest.prototype.project = ""; + + /** + * InsertRegionAutoscalerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @instance + */ + InsertRegionAutoscalerRequest.prototype.region = ""; + + /** + * InsertRegionAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @instance + */ + InsertRegionAutoscalerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @instance + */ + Object.defineProperty(InsertRegionAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionAutoscalerRequest} InsertRegionAutoscalerRequest instance + */ + InsertRegionAutoscalerRequest.create = function create(properties) { + return new InsertRegionAutoscalerRequest(properties); + }; + + /** + * Encodes the specified InsertRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionAutoscalerRequest} message InsertRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.autoscalerResource != null && Object.hasOwnProperty.call(message, "autoscalerResource")) + $root.google.cloud.compute.v1.Autoscaler.encode(message.autoscalerResource, writer.uint32(/* id 207616118, wireType 2 =*/1660928946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionAutoscalerRequest} message InsertRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionAutoscalerRequest} InsertRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 207616118: + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionAutoscalerRequest} InsertRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.autoscalerResource); + if (error) + return "autoscalerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionAutoscalerRequest} InsertRegionAutoscalerRequest + */ + InsertRegionAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionAutoscalerRequest(); + if (object.autoscalerResource != null) { + if (typeof object.autoscalerResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionAutoscalerRequest.autoscalerResource: object expected"); + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.autoscalerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionAutoscalerRequest} message InsertRegionAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.autoscalerResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) + object.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.toObject(message.autoscalerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRegionAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionAutoscalerRequest; + })(); + + v1.ListRegionAutoscalersRequest = (function() { + + /** + * Properties of a ListRegionAutoscalersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionAutoscalersRequest + * @property {string|null} [filter] ListRegionAutoscalersRequest filter + * @property {number|null} [maxResults] ListRegionAutoscalersRequest maxResults + * @property {string|null} [orderBy] ListRegionAutoscalersRequest orderBy + * @property {string|null} [pageToken] ListRegionAutoscalersRequest pageToken + * @property {string|null} [project] ListRegionAutoscalersRequest project + * @property {string|null} [region] ListRegionAutoscalersRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionAutoscalersRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionAutoscalersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionAutoscalersRequest. + * @implements IListRegionAutoscalersRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionAutoscalersRequest=} [properties] Properties to set + */ + function ListRegionAutoscalersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionAutoscalersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + ListRegionAutoscalersRequest.prototype.filter = null; + + /** + * ListRegionAutoscalersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + ListRegionAutoscalersRequest.prototype.maxResults = null; + + /** + * ListRegionAutoscalersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + ListRegionAutoscalersRequest.prototype.orderBy = null; + + /** + * ListRegionAutoscalersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + ListRegionAutoscalersRequest.prototype.pageToken = null; + + /** + * ListRegionAutoscalersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + ListRegionAutoscalersRequest.prototype.project = ""; + + /** + * ListRegionAutoscalersRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + ListRegionAutoscalersRequest.prototype.region = ""; + + /** + * ListRegionAutoscalersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + ListRegionAutoscalersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionAutoscalersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + Object.defineProperty(ListRegionAutoscalersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionAutoscalersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + Object.defineProperty(ListRegionAutoscalersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionAutoscalersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + Object.defineProperty(ListRegionAutoscalersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionAutoscalersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + Object.defineProperty(ListRegionAutoscalersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionAutoscalersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + */ + Object.defineProperty(ListRegionAutoscalersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionAutoscalersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IListRegionAutoscalersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionAutoscalersRequest} ListRegionAutoscalersRequest instance + */ + ListRegionAutoscalersRequest.create = function create(properties) { + return new ListRegionAutoscalersRequest(properties); + }; + + /** + * Encodes the specified ListRegionAutoscalersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionAutoscalersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IListRegionAutoscalersRequest} message ListRegionAutoscalersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionAutoscalersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionAutoscalersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionAutoscalersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.IListRegionAutoscalersRequest} message ListRegionAutoscalersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionAutoscalersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionAutoscalersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionAutoscalersRequest} ListRegionAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionAutoscalersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionAutoscalersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionAutoscalersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionAutoscalersRequest} ListRegionAutoscalersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionAutoscalersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionAutoscalersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionAutoscalersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionAutoscalersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionAutoscalersRequest} ListRegionAutoscalersRequest + */ + ListRegionAutoscalersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionAutoscalersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionAutoscalersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionAutoscalersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @static + * @param {google.cloud.compute.v1.ListRegionAutoscalersRequest} message ListRegionAutoscalersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionAutoscalersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionAutoscalersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionAutoscalersRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionAutoscalersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionAutoscalersRequest; + })(); + + v1.PatchRegionAutoscalerRequest = (function() { + + /** + * Properties of a PatchRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRegionAutoscalerRequest + * @property {string|null} [autoscaler] PatchRegionAutoscalerRequest autoscaler + * @property {google.cloud.compute.v1.IAutoscaler|null} [autoscalerResource] PatchRegionAutoscalerRequest autoscalerResource + * @property {string|null} [project] PatchRegionAutoscalerRequest project + * @property {string|null} [region] PatchRegionAutoscalerRequest region + * @property {string|null} [requestId] PatchRegionAutoscalerRequest requestId + */ + + /** + * Constructs a new PatchRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRegionAutoscalerRequest. + * @implements IPatchRegionAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRegionAutoscalerRequest=} [properties] Properties to set + */ + function PatchRegionAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRegionAutoscalerRequest autoscaler. + * @member {string|null|undefined} autoscaler + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + */ + PatchRegionAutoscalerRequest.prototype.autoscaler = null; + + /** + * PatchRegionAutoscalerRequest autoscalerResource. + * @member {google.cloud.compute.v1.IAutoscaler|null|undefined} autoscalerResource + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + */ + PatchRegionAutoscalerRequest.prototype.autoscalerResource = null; + + /** + * PatchRegionAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + */ + PatchRegionAutoscalerRequest.prototype.project = ""; + + /** + * PatchRegionAutoscalerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + */ + PatchRegionAutoscalerRequest.prototype.region = ""; + + /** + * PatchRegionAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + */ + PatchRegionAutoscalerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRegionAutoscalerRequest _autoscaler. + * @member {"autoscaler"|undefined} _autoscaler + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + */ + Object.defineProperty(PatchRegionAutoscalerRequest.prototype, "_autoscaler", { + get: $util.oneOfGetter($oneOfFields = ["autoscaler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PatchRegionAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + */ + Object.defineProperty(PatchRegionAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRegionAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRegionAutoscalerRequest} PatchRegionAutoscalerRequest instance + */ + PatchRegionAutoscalerRequest.create = function create(properties) { + return new PatchRegionAutoscalerRequest(properties); + }; + + /** + * Encodes the specified PatchRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionAutoscalerRequest} message PatchRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.autoscalerResource != null && Object.hasOwnProperty.call(message, "autoscalerResource")) + $root.google.cloud.compute.v1.Autoscaler.encode(message.autoscalerResource, writer.uint32(/* id 207616118, wireType 2 =*/1660928946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified PatchRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionAutoscalerRequest} message PatchRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRegionAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRegionAutoscalerRequest} PatchRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRegionAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 207616118: + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRegionAutoscalerRequest} PatchRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRegionAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRegionAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + properties._autoscaler = 1; + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + } + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.autoscalerResource); + if (error) + return "autoscalerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRegionAutoscalerRequest} PatchRegionAutoscalerRequest + */ + PatchRegionAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRegionAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRegionAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.autoscalerResource != null) { + if (typeof object.autoscalerResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRegionAutoscalerRequest.autoscalerResource: object expected"); + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.autoscalerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchRegionAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.PatchRegionAutoscalerRequest} message PatchRegionAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRegionAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.autoscalerResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) + object.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.toObject(message.autoscalerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + object.autoscaler = message.autoscaler; + if (options.oneofs) + object._autoscaler = "autoscaler"; + } + return object; + }; + + /** + * Converts this PatchRegionAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRegionAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRegionAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRegionAutoscalerRequest; + })(); + + v1.UpdateRegionAutoscalerRequest = (function() { + + /** + * Properties of an UpdateRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateRegionAutoscalerRequest + * @property {string|null} [autoscaler] UpdateRegionAutoscalerRequest autoscaler + * @property {google.cloud.compute.v1.IAutoscaler|null} [autoscalerResource] UpdateRegionAutoscalerRequest autoscalerResource + * @property {string|null} [project] UpdateRegionAutoscalerRequest project + * @property {string|null} [region] UpdateRegionAutoscalerRequest region + * @property {string|null} [requestId] UpdateRegionAutoscalerRequest requestId + */ + + /** + * Constructs a new UpdateRegionAutoscalerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateRegionAutoscalerRequest. + * @implements IUpdateRegionAutoscalerRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateRegionAutoscalerRequest=} [properties] Properties to set + */ + function UpdateRegionAutoscalerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRegionAutoscalerRequest autoscaler. + * @member {string|null|undefined} autoscaler + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + */ + UpdateRegionAutoscalerRequest.prototype.autoscaler = null; + + /** + * UpdateRegionAutoscalerRequest autoscalerResource. + * @member {google.cloud.compute.v1.IAutoscaler|null|undefined} autoscalerResource + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + */ + UpdateRegionAutoscalerRequest.prototype.autoscalerResource = null; + + /** + * UpdateRegionAutoscalerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + */ + UpdateRegionAutoscalerRequest.prototype.project = ""; + + /** + * UpdateRegionAutoscalerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + */ + UpdateRegionAutoscalerRequest.prototype.region = ""; + + /** + * UpdateRegionAutoscalerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + */ + UpdateRegionAutoscalerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateRegionAutoscalerRequest _autoscaler. + * @member {"autoscaler"|undefined} _autoscaler + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + */ + Object.defineProperty(UpdateRegionAutoscalerRequest.prototype, "_autoscaler", { + get: $util.oneOfGetter($oneOfFields = ["autoscaler"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * UpdateRegionAutoscalerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + */ + Object.defineProperty(UpdateRegionAutoscalerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateRegionAutoscalerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionAutoscalerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateRegionAutoscalerRequest} UpdateRegionAutoscalerRequest instance + */ + UpdateRegionAutoscalerRequest.create = function create(properties) { + return new UpdateRegionAutoscalerRequest(properties); + }; + + /** + * Encodes the specified UpdateRegionAutoscalerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionAutoscalerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionAutoscalerRequest} message UpdateRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionAutoscalerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.autoscalerResource != null && Object.hasOwnProperty.call(message, "autoscalerResource")) + $root.google.cloud.compute.v1.Autoscaler.encode(message.autoscalerResource, writer.uint32(/* id 207616118, wireType 2 =*/1660928946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 517258967, wireType 2 =*/4138071738).string(message.autoscaler); + return writer; + }; + + /** + * Encodes the specified UpdateRegionAutoscalerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionAutoscalerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionAutoscalerRequest} message UpdateRegionAutoscalerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionAutoscalerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRegionAutoscalerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateRegionAutoscalerRequest} UpdateRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionAutoscalerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateRegionAutoscalerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 517258967: + message.autoscaler = reader.string(); + break; + case 207616118: + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRegionAutoscalerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateRegionAutoscalerRequest} UpdateRegionAutoscalerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionAutoscalerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRegionAutoscalerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRegionAutoscalerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + properties._autoscaler = 1; + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + } + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) { + var error = $root.google.cloud.compute.v1.Autoscaler.verify(message.autoscalerResource); + if (error) + return "autoscalerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdateRegionAutoscalerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateRegionAutoscalerRequest} UpdateRegionAutoscalerRequest + */ + UpdateRegionAutoscalerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateRegionAutoscalerRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateRegionAutoscalerRequest(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.autoscalerResource != null) { + if (typeof object.autoscalerResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateRegionAutoscalerRequest.autoscalerResource: object expected"); + message.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.fromObject(object.autoscalerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateRegionAutoscalerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @static + * @param {google.cloud.compute.v1.UpdateRegionAutoscalerRequest} message UpdateRegionAutoscalerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRegionAutoscalerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.autoscalerResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.autoscalerResource != null && message.hasOwnProperty("autoscalerResource")) + object.autoscalerResource = $root.google.cloud.compute.v1.Autoscaler.toObject(message.autoscalerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + object.autoscaler = message.autoscaler; + if (options.oneofs) + object._autoscaler = "autoscaler"; + } + return object; + }; + + /** + * Converts this UpdateRegionAutoscalerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateRegionAutoscalerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRegionAutoscalerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateRegionAutoscalerRequest; + })(); + + v1.DeleteRegionBackendServiceRequest = (function() { + + /** + * Properties of a DeleteRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionBackendServiceRequest + * @property {string|null} [backendService] DeleteRegionBackendServiceRequest backendService + * @property {string|null} [project] DeleteRegionBackendServiceRequest project + * @property {string|null} [region] DeleteRegionBackendServiceRequest region + * @property {string|null} [requestId] DeleteRegionBackendServiceRequest requestId + */ + + /** + * Constructs a new DeleteRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionBackendServiceRequest. + * @implements IDeleteRegionBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionBackendServiceRequest=} [properties] Properties to set + */ + function DeleteRegionBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @instance + */ + DeleteRegionBackendServiceRequest.prototype.backendService = ""; + + /** + * DeleteRegionBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @instance + */ + DeleteRegionBackendServiceRequest.prototype.project = ""; + + /** + * DeleteRegionBackendServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @instance + */ + DeleteRegionBackendServiceRequest.prototype.region = ""; + + /** + * DeleteRegionBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @instance + */ + DeleteRegionBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @instance + */ + Object.defineProperty(DeleteRegionBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionBackendServiceRequest} DeleteRegionBackendServiceRequest instance + */ + DeleteRegionBackendServiceRequest.create = function create(properties) { + return new DeleteRegionBackendServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionBackendServiceRequest} message DeleteRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified DeleteRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionBackendServiceRequest} message DeleteRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionBackendServiceRequest} DeleteRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionBackendServiceRequest} DeleteRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionBackendServiceRequest} DeleteRegionBackendServiceRequest + */ + DeleteRegionBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionBackendServiceRequest} message DeleteRegionBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.backendService = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + return object; + }; + + /** + * Converts this DeleteRegionBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionBackendServiceRequest; + })(); + + v1.GetRegionBackendServiceRequest = (function() { + + /** + * Properties of a GetRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionBackendServiceRequest + * @property {string|null} [backendService] GetRegionBackendServiceRequest backendService + * @property {string|null} [project] GetRegionBackendServiceRequest project + * @property {string|null} [region] GetRegionBackendServiceRequest region + */ + + /** + * Constructs a new GetRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionBackendServiceRequest. + * @implements IGetRegionBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionBackendServiceRequest=} [properties] Properties to set + */ + function GetRegionBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @instance + */ + GetRegionBackendServiceRequest.prototype.backendService = ""; + + /** + * GetRegionBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @instance + */ + GetRegionBackendServiceRequest.prototype.project = ""; + + /** + * GetRegionBackendServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @instance + */ + GetRegionBackendServiceRequest.prototype.region = ""; + + /** + * Creates a new GetRegionBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionBackendServiceRequest} GetRegionBackendServiceRequest instance + */ + GetRegionBackendServiceRequest.create = function create(properties) { + return new GetRegionBackendServiceRequest(properties); + }; + + /** + * Encodes the specified GetRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionBackendServiceRequest} message GetRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified GetRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionBackendServiceRequest} message GetRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionBackendServiceRequest} GetRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionBackendServiceRequest} GetRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionBackendServiceRequest} GetRegionBackendServiceRequest + */ + GetRegionBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.GetRegionBackendServiceRequest} message GetRegionBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.backendService = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + return object; + }; + + /** + * Converts this GetRegionBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionBackendServiceRequest; + })(); + + v1.GetHealthRegionBackendServiceRequest = (function() { + + /** + * Properties of a GetHealthRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetHealthRegionBackendServiceRequest + * @property {string|null} [backendService] GetHealthRegionBackendServiceRequest backendService + * @property {string|null} [project] GetHealthRegionBackendServiceRequest project + * @property {string|null} [region] GetHealthRegionBackendServiceRequest region + * @property {google.cloud.compute.v1.IResourceGroupReference|null} [resourceGroupReferenceResource] GetHealthRegionBackendServiceRequest resourceGroupReferenceResource + */ + + /** + * Constructs a new GetHealthRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetHealthRegionBackendServiceRequest. + * @implements IGetHealthRegionBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest=} [properties] Properties to set + */ + function GetHealthRegionBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetHealthRegionBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @instance + */ + GetHealthRegionBackendServiceRequest.prototype.backendService = ""; + + /** + * GetHealthRegionBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @instance + */ + GetHealthRegionBackendServiceRequest.prototype.project = ""; + + /** + * GetHealthRegionBackendServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @instance + */ + GetHealthRegionBackendServiceRequest.prototype.region = ""; + + /** + * GetHealthRegionBackendServiceRequest resourceGroupReferenceResource. + * @member {google.cloud.compute.v1.IResourceGroupReference|null|undefined} resourceGroupReferenceResource + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @instance + */ + GetHealthRegionBackendServiceRequest.prototype.resourceGroupReferenceResource = null; + + /** + * Creates a new GetHealthRegionBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetHealthRegionBackendServiceRequest} GetHealthRegionBackendServiceRequest instance + */ + GetHealthRegionBackendServiceRequest.create = function create(properties) { + return new GetHealthRegionBackendServiceRequest(properties); + }; + + /** + * Encodes the specified GetHealthRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthRegionBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest} message GetHealthRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthRegionBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceGroupReferenceResource != null && Object.hasOwnProperty.call(message, "resourceGroupReferenceResource")) + $root.google.cloud.compute.v1.ResourceGroupReference.encode(message.resourceGroupReferenceResource, writer.uint32(/* id 112951123, wireType 2 =*/903608986).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + return writer; + }; + + /** + * Encodes the specified GetHealthRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthRegionBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest} message GetHealthRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthRegionBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHealthRegionBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetHealthRegionBackendServiceRequest} GetHealthRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthRegionBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetHealthRegionBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 112951123: + message.resourceGroupReferenceResource = $root.google.cloud.compute.v1.ResourceGroupReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetHealthRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetHealthRegionBackendServiceRequest} GetHealthRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthRegionBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHealthRegionBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHealthRegionBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resourceGroupReferenceResource != null && message.hasOwnProperty("resourceGroupReferenceResource")) { + var error = $root.google.cloud.compute.v1.ResourceGroupReference.verify(message.resourceGroupReferenceResource); + if (error) + return "resourceGroupReferenceResource." + error; + } + return null; + }; + + /** + * Creates a GetHealthRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetHealthRegionBackendServiceRequest} GetHealthRegionBackendServiceRequest + */ + GetHealthRegionBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetHealthRegionBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetHealthRegionBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resourceGroupReferenceResource != null) { + if (typeof object.resourceGroupReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.GetHealthRegionBackendServiceRequest.resourceGroupReferenceResource: object expected"); + message.resourceGroupReferenceResource = $root.google.cloud.compute.v1.ResourceGroupReference.fromObject(object.resourceGroupReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a GetHealthRegionBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.GetHealthRegionBackendServiceRequest} message GetHealthRegionBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHealthRegionBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceGroupReferenceResource = null; + object.region = ""; + object.project = ""; + object.backendService = ""; + } + if (message.resourceGroupReferenceResource != null && message.hasOwnProperty("resourceGroupReferenceResource")) + object.resourceGroupReferenceResource = $root.google.cloud.compute.v1.ResourceGroupReference.toObject(message.resourceGroupReferenceResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + return object; + }; + + /** + * Converts this GetHealthRegionBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetHealthRegionBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetHealthRegionBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetHealthRegionBackendServiceRequest; + })(); + + v1.InsertRegionBackendServiceRequest = (function() { + + /** + * Properties of an InsertRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionBackendServiceRequest + * @property {google.cloud.compute.v1.IBackendService|null} [backendServiceResource] InsertRegionBackendServiceRequest backendServiceResource + * @property {string|null} [project] InsertRegionBackendServiceRequest project + * @property {string|null} [region] InsertRegionBackendServiceRequest region + * @property {string|null} [requestId] InsertRegionBackendServiceRequest requestId + */ + + /** + * Constructs a new InsertRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionBackendServiceRequest. + * @implements IInsertRegionBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionBackendServiceRequest=} [properties] Properties to set + */ + function InsertRegionBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionBackendServiceRequest backendServiceResource. + * @member {google.cloud.compute.v1.IBackendService|null|undefined} backendServiceResource + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @instance + */ + InsertRegionBackendServiceRequest.prototype.backendServiceResource = null; + + /** + * InsertRegionBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @instance + */ + InsertRegionBackendServiceRequest.prototype.project = ""; + + /** + * InsertRegionBackendServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @instance + */ + InsertRegionBackendServiceRequest.prototype.region = ""; + + /** + * InsertRegionBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @instance + */ + InsertRegionBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @instance + */ + Object.defineProperty(InsertRegionBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionBackendServiceRequest} InsertRegionBackendServiceRequest instance + */ + InsertRegionBackendServiceRequest.create = function create(properties) { + return new InsertRegionBackendServiceRequest(properties); + }; + + /** + * Encodes the specified InsertRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionBackendServiceRequest} message InsertRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendServiceResource != null && Object.hasOwnProperty.call(message, "backendServiceResource")) + $root.google.cloud.compute.v1.BackendService.encode(message.backendServiceResource, writer.uint32(/* id 347586723, wireType 2 =*/2780693786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionBackendServiceRequest} message InsertRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionBackendServiceRequest} InsertRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 347586723: + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionBackendServiceRequest} InsertRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.backendServiceResource); + if (error) + return "backendServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionBackendServiceRequest} InsertRegionBackendServiceRequest + */ + InsertRegionBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionBackendServiceRequest(); + if (object.backendServiceResource != null) { + if (typeof object.backendServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionBackendServiceRequest.backendServiceResource: object expected"); + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.fromObject(object.backendServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionBackendServiceRequest} message InsertRegionBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.backendServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) + object.backendServiceResource = $root.google.cloud.compute.v1.BackendService.toObject(message.backendServiceResource, options); + return object; + }; + + /** + * Converts this InsertRegionBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionBackendServiceRequest; + })(); + + v1.ListRegionBackendServicesRequest = (function() { + + /** + * Properties of a ListRegionBackendServicesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionBackendServicesRequest + * @property {string|null} [filter] ListRegionBackendServicesRequest filter + * @property {number|null} [maxResults] ListRegionBackendServicesRequest maxResults + * @property {string|null} [orderBy] ListRegionBackendServicesRequest orderBy + * @property {string|null} [pageToken] ListRegionBackendServicesRequest pageToken + * @property {string|null} [project] ListRegionBackendServicesRequest project + * @property {string|null} [region] ListRegionBackendServicesRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionBackendServicesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionBackendServicesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionBackendServicesRequest. + * @implements IListRegionBackendServicesRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionBackendServicesRequest=} [properties] Properties to set + */ + function ListRegionBackendServicesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionBackendServicesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + ListRegionBackendServicesRequest.prototype.filter = null; + + /** + * ListRegionBackendServicesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + ListRegionBackendServicesRequest.prototype.maxResults = null; + + /** + * ListRegionBackendServicesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + ListRegionBackendServicesRequest.prototype.orderBy = null; + + /** + * ListRegionBackendServicesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + ListRegionBackendServicesRequest.prototype.pageToken = null; + + /** + * ListRegionBackendServicesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + ListRegionBackendServicesRequest.prototype.project = ""; + + /** + * ListRegionBackendServicesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + ListRegionBackendServicesRequest.prototype.region = ""; + + /** + * ListRegionBackendServicesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + ListRegionBackendServicesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionBackendServicesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + Object.defineProperty(ListRegionBackendServicesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionBackendServicesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + Object.defineProperty(ListRegionBackendServicesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionBackendServicesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + Object.defineProperty(ListRegionBackendServicesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionBackendServicesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + Object.defineProperty(ListRegionBackendServicesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionBackendServicesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + */ + Object.defineProperty(ListRegionBackendServicesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionBackendServicesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionBackendServicesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionBackendServicesRequest} ListRegionBackendServicesRequest instance + */ + ListRegionBackendServicesRequest.create = function create(properties) { + return new ListRegionBackendServicesRequest(properties); + }; + + /** + * Encodes the specified ListRegionBackendServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionBackendServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionBackendServicesRequest} message ListRegionBackendServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionBackendServicesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionBackendServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionBackendServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionBackendServicesRequest} message ListRegionBackendServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionBackendServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionBackendServicesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionBackendServicesRequest} ListRegionBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionBackendServicesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionBackendServicesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionBackendServicesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionBackendServicesRequest} ListRegionBackendServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionBackendServicesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionBackendServicesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionBackendServicesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionBackendServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionBackendServicesRequest} ListRegionBackendServicesRequest + */ + ListRegionBackendServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionBackendServicesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionBackendServicesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionBackendServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @static + * @param {google.cloud.compute.v1.ListRegionBackendServicesRequest} message ListRegionBackendServicesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionBackendServicesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionBackendServicesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionBackendServicesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionBackendServicesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionBackendServicesRequest; + })(); + + v1.PatchRegionBackendServiceRequest = (function() { + + /** + * Properties of a PatchRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRegionBackendServiceRequest + * @property {string|null} [backendService] PatchRegionBackendServiceRequest backendService + * @property {google.cloud.compute.v1.IBackendService|null} [backendServiceResource] PatchRegionBackendServiceRequest backendServiceResource + * @property {string|null} [project] PatchRegionBackendServiceRequest project + * @property {string|null} [region] PatchRegionBackendServiceRequest region + * @property {string|null} [requestId] PatchRegionBackendServiceRequest requestId + */ + + /** + * Constructs a new PatchRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRegionBackendServiceRequest. + * @implements IPatchRegionBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRegionBackendServiceRequest=} [properties] Properties to set + */ + function PatchRegionBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRegionBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @instance + */ + PatchRegionBackendServiceRequest.prototype.backendService = ""; + + /** + * PatchRegionBackendServiceRequest backendServiceResource. + * @member {google.cloud.compute.v1.IBackendService|null|undefined} backendServiceResource + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @instance + */ + PatchRegionBackendServiceRequest.prototype.backendServiceResource = null; + + /** + * PatchRegionBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @instance + */ + PatchRegionBackendServiceRequest.prototype.project = ""; + + /** + * PatchRegionBackendServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @instance + */ + PatchRegionBackendServiceRequest.prototype.region = ""; + + /** + * PatchRegionBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @instance + */ + PatchRegionBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRegionBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @instance + */ + Object.defineProperty(PatchRegionBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRegionBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRegionBackendServiceRequest} PatchRegionBackendServiceRequest instance + */ + PatchRegionBackendServiceRequest.create = function create(properties) { + return new PatchRegionBackendServiceRequest(properties); + }; + + /** + * Encodes the specified PatchRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionBackendServiceRequest} message PatchRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.backendServiceResource != null && Object.hasOwnProperty.call(message, "backendServiceResource")) + $root.google.cloud.compute.v1.BackendService.encode(message.backendServiceResource, writer.uint32(/* id 347586723, wireType 2 =*/2780693786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionBackendServiceRequest} message PatchRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRegionBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRegionBackendServiceRequest} PatchRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRegionBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 347586723: + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRegionBackendServiceRequest} PatchRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRegionBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRegionBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.backendServiceResource); + if (error) + return "backendServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRegionBackendServiceRequest} PatchRegionBackendServiceRequest + */ + PatchRegionBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRegionBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRegionBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.backendServiceResource != null) { + if (typeof object.backendServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRegionBackendServiceRequest.backendServiceResource: object expected"); + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.fromObject(object.backendServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchRegionBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.PatchRegionBackendServiceRequest} message PatchRegionBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRegionBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.backendService = ""; + object.backendServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) + object.backendServiceResource = $root.google.cloud.compute.v1.BackendService.toObject(message.backendServiceResource, options); + return object; + }; + + /** + * Converts this PatchRegionBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRegionBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRegionBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRegionBackendServiceRequest; + })(); + + v1.UpdateRegionBackendServiceRequest = (function() { + + /** + * Properties of an UpdateRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateRegionBackendServiceRequest + * @property {string|null} [backendService] UpdateRegionBackendServiceRequest backendService + * @property {google.cloud.compute.v1.IBackendService|null} [backendServiceResource] UpdateRegionBackendServiceRequest backendServiceResource + * @property {string|null} [project] UpdateRegionBackendServiceRequest project + * @property {string|null} [region] UpdateRegionBackendServiceRequest region + * @property {string|null} [requestId] UpdateRegionBackendServiceRequest requestId + */ + + /** + * Constructs a new UpdateRegionBackendServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateRegionBackendServiceRequest. + * @implements IUpdateRegionBackendServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateRegionBackendServiceRequest=} [properties] Properties to set + */ + function UpdateRegionBackendServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRegionBackendServiceRequest backendService. + * @member {string} backendService + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @instance + */ + UpdateRegionBackendServiceRequest.prototype.backendService = ""; + + /** + * UpdateRegionBackendServiceRequest backendServiceResource. + * @member {google.cloud.compute.v1.IBackendService|null|undefined} backendServiceResource + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @instance + */ + UpdateRegionBackendServiceRequest.prototype.backendServiceResource = null; + + /** + * UpdateRegionBackendServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @instance + */ + UpdateRegionBackendServiceRequest.prototype.project = ""; + + /** + * UpdateRegionBackendServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @instance + */ + UpdateRegionBackendServiceRequest.prototype.region = ""; + + /** + * UpdateRegionBackendServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @instance + */ + UpdateRegionBackendServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateRegionBackendServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @instance + */ + Object.defineProperty(UpdateRegionBackendServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateRegionBackendServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionBackendServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateRegionBackendServiceRequest} UpdateRegionBackendServiceRequest instance + */ + UpdateRegionBackendServiceRequest.create = function create(properties) { + return new UpdateRegionBackendServiceRequest(properties); + }; + + /** + * Encodes the specified UpdateRegionBackendServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionBackendServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionBackendServiceRequest} message UpdateRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionBackendServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.backendService != null && Object.hasOwnProperty.call(message, "backendService")) + writer.uint32(/* id 306946058, wireType 2 =*/2455568466).string(message.backendService); + if (message.backendServiceResource != null && Object.hasOwnProperty.call(message, "backendServiceResource")) + $root.google.cloud.compute.v1.BackendService.encode(message.backendServiceResource, writer.uint32(/* id 347586723, wireType 2 =*/2780693786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateRegionBackendServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionBackendServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionBackendServiceRequest} message UpdateRegionBackendServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionBackendServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRegionBackendServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateRegionBackendServiceRequest} UpdateRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionBackendServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateRegionBackendServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 306946058: + message.backendService = reader.string(); + break; + case 347586723: + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRegionBackendServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateRegionBackendServiceRequest} UpdateRegionBackendServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionBackendServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRegionBackendServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRegionBackendServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backendService != null && message.hasOwnProperty("backendService")) + if (!$util.isString(message.backendService)) + return "backendService: string expected"; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) { + var error = $root.google.cloud.compute.v1.BackendService.verify(message.backendServiceResource); + if (error) + return "backendServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdateRegionBackendServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateRegionBackendServiceRequest} UpdateRegionBackendServiceRequest + */ + UpdateRegionBackendServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateRegionBackendServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateRegionBackendServiceRequest(); + if (object.backendService != null) + message.backendService = String(object.backendService); + if (object.backendServiceResource != null) { + if (typeof object.backendServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateRegionBackendServiceRequest.backendServiceResource: object expected"); + message.backendServiceResource = $root.google.cloud.compute.v1.BackendService.fromObject(object.backendServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateRegionBackendServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @static + * @param {google.cloud.compute.v1.UpdateRegionBackendServiceRequest} message UpdateRegionBackendServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRegionBackendServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.backendService = ""; + object.backendServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.backendService != null && message.hasOwnProperty("backendService")) + object.backendService = message.backendService; + if (message.backendServiceResource != null && message.hasOwnProperty("backendServiceResource")) + object.backendServiceResource = $root.google.cloud.compute.v1.BackendService.toObject(message.backendServiceResource, options); + return object; + }; + + /** + * Converts this UpdateRegionBackendServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateRegionBackendServiceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRegionBackendServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateRegionBackendServiceRequest; + })(); + + v1.AggregatedListRegionCommitmentsRequest = (function() { + + /** + * Properties of an AggregatedListRegionCommitmentsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListRegionCommitmentsRequest + * @property {string|null} [filter] AggregatedListRegionCommitmentsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListRegionCommitmentsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListRegionCommitmentsRequest maxResults + * @property {string|null} [orderBy] AggregatedListRegionCommitmentsRequest orderBy + * @property {string|null} [pageToken] AggregatedListRegionCommitmentsRequest pageToken + * @property {string|null} [project] AggregatedListRegionCommitmentsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListRegionCommitmentsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListRegionCommitmentsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListRegionCommitmentsRequest. + * @implements IAggregatedListRegionCommitmentsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest=} [properties] Properties to set + */ + function AggregatedListRegionCommitmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListRegionCommitmentsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + AggregatedListRegionCommitmentsRequest.prototype.filter = null; + + /** + * AggregatedListRegionCommitmentsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + AggregatedListRegionCommitmentsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListRegionCommitmentsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + AggregatedListRegionCommitmentsRequest.prototype.maxResults = null; + + /** + * AggregatedListRegionCommitmentsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + AggregatedListRegionCommitmentsRequest.prototype.orderBy = null; + + /** + * AggregatedListRegionCommitmentsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + AggregatedListRegionCommitmentsRequest.prototype.pageToken = null; + + /** + * AggregatedListRegionCommitmentsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + AggregatedListRegionCommitmentsRequest.prototype.project = ""; + + /** + * AggregatedListRegionCommitmentsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + AggregatedListRegionCommitmentsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListRegionCommitmentsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListRegionCommitmentsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRegionCommitmentsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListRegionCommitmentsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRegionCommitmentsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListRegionCommitmentsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRegionCommitmentsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListRegionCommitmentsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRegionCommitmentsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListRegionCommitmentsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRegionCommitmentsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(AggregatedListRegionCommitmentsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListRegionCommitmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest} AggregatedListRegionCommitmentsRequest instance + */ + AggregatedListRegionCommitmentsRequest.create = function create(properties) { + return new AggregatedListRegionCommitmentsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListRegionCommitmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest} message AggregatedListRegionCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListRegionCommitmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListRegionCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest} message AggregatedListRegionCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListRegionCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListRegionCommitmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest} AggregatedListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListRegionCommitmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListRegionCommitmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest} AggregatedListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListRegionCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListRegionCommitmentsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListRegionCommitmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListRegionCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest} AggregatedListRegionCommitmentsRequest + */ + AggregatedListRegionCommitmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListRegionCommitmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest} message AggregatedListRegionCommitmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListRegionCommitmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListRegionCommitmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListRegionCommitmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListRegionCommitmentsRequest; + })(); + + v1.GetRegionCommitmentRequest = (function() { + + /** + * Properties of a GetRegionCommitmentRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionCommitmentRequest + * @property {string|null} [commitment] GetRegionCommitmentRequest commitment + * @property {string|null} [project] GetRegionCommitmentRequest project + * @property {string|null} [region] GetRegionCommitmentRequest region + */ + + /** + * Constructs a new GetRegionCommitmentRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionCommitmentRequest. + * @implements IGetRegionCommitmentRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionCommitmentRequest=} [properties] Properties to set + */ + function GetRegionCommitmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionCommitmentRequest commitment. + * @member {string} commitment + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @instance + */ + GetRegionCommitmentRequest.prototype.commitment = ""; + + /** + * GetRegionCommitmentRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @instance + */ + GetRegionCommitmentRequest.prototype.project = ""; + + /** + * GetRegionCommitmentRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @instance + */ + GetRegionCommitmentRequest.prototype.region = ""; + + /** + * Creates a new GetRegionCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionCommitmentRequest} GetRegionCommitmentRequest instance + */ + GetRegionCommitmentRequest.create = function create(properties) { + return new GetRegionCommitmentRequest(properties); + }; + + /** + * Encodes the specified GetRegionCommitmentRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionCommitmentRequest} message GetRegionCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionCommitmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.commitment != null && Object.hasOwnProperty.call(message, "commitment")) + writer.uint32(/* id 482134805, wireType 2 =*/3857078442).string(message.commitment); + return writer; + }; + + /** + * Encodes the specified GetRegionCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionCommitmentRequest} message GetRegionCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionCommitmentRequest} GetRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 482134805: + message.commitment = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionCommitmentRequest} GetRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionCommitmentRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionCommitmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commitment != null && message.hasOwnProperty("commitment")) + if (!$util.isString(message.commitment)) + return "commitment: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionCommitmentRequest} GetRegionCommitmentRequest + */ + GetRegionCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionCommitmentRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionCommitmentRequest(); + if (object.commitment != null) + message.commitment = String(object.commitment); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.GetRegionCommitmentRequest} message GetRegionCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.commitment = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.commitment != null && message.hasOwnProperty("commitment")) + object.commitment = message.commitment; + return object; + }; + + /** + * Converts this GetRegionCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionCommitmentRequest; + })(); + + v1.InsertRegionCommitmentRequest = (function() { + + /** + * Properties of an InsertRegionCommitmentRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionCommitmentRequest + * @property {google.cloud.compute.v1.ICommitment|null} [commitmentResource] InsertRegionCommitmentRequest commitmentResource + * @property {string|null} [project] InsertRegionCommitmentRequest project + * @property {string|null} [region] InsertRegionCommitmentRequest region + * @property {string|null} [requestId] InsertRegionCommitmentRequest requestId + */ + + /** + * Constructs a new InsertRegionCommitmentRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionCommitmentRequest. + * @implements IInsertRegionCommitmentRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionCommitmentRequest=} [properties] Properties to set + */ + function InsertRegionCommitmentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionCommitmentRequest commitmentResource. + * @member {google.cloud.compute.v1.ICommitment|null|undefined} commitmentResource + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @instance + */ + InsertRegionCommitmentRequest.prototype.commitmentResource = null; + + /** + * InsertRegionCommitmentRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @instance + */ + InsertRegionCommitmentRequest.prototype.project = ""; + + /** + * InsertRegionCommitmentRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @instance + */ + InsertRegionCommitmentRequest.prototype.region = ""; + + /** + * InsertRegionCommitmentRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @instance + */ + InsertRegionCommitmentRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionCommitmentRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @instance + */ + Object.defineProperty(InsertRegionCommitmentRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionCommitmentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionCommitmentRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionCommitmentRequest} InsertRegionCommitmentRequest instance + */ + InsertRegionCommitmentRequest.create = function create(properties) { + return new InsertRegionCommitmentRequest(properties); + }; + + /** + * Encodes the specified InsertRegionCommitmentRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionCommitmentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionCommitmentRequest} message InsertRegionCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionCommitmentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.commitmentResource != null && Object.hasOwnProperty.call(message, "commitmentResource")) + $root.google.cloud.compute.v1.Commitment.encode(message.commitmentResource, writer.uint32(/* id 244240888, wireType 2 =*/1953927106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRegionCommitmentRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionCommitmentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionCommitmentRequest} message InsertRegionCommitmentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionCommitmentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionCommitmentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionCommitmentRequest} InsertRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionCommitmentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionCommitmentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 244240888: + message.commitmentResource = $root.google.cloud.compute.v1.Commitment.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionCommitmentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionCommitmentRequest} InsertRegionCommitmentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionCommitmentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionCommitmentRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionCommitmentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.commitmentResource != null && message.hasOwnProperty("commitmentResource")) { + var error = $root.google.cloud.compute.v1.Commitment.verify(message.commitmentResource); + if (error) + return "commitmentResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionCommitmentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionCommitmentRequest} InsertRegionCommitmentRequest + */ + InsertRegionCommitmentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionCommitmentRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionCommitmentRequest(); + if (object.commitmentResource != null) { + if (typeof object.commitmentResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionCommitmentRequest.commitmentResource: object expected"); + message.commitmentResource = $root.google.cloud.compute.v1.Commitment.fromObject(object.commitmentResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionCommitmentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionCommitmentRequest} message InsertRegionCommitmentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionCommitmentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.commitmentResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.commitmentResource != null && message.hasOwnProperty("commitmentResource")) + object.commitmentResource = $root.google.cloud.compute.v1.Commitment.toObject(message.commitmentResource, options); + return object; + }; + + /** + * Converts this InsertRegionCommitmentRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionCommitmentRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionCommitmentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionCommitmentRequest; + })(); + + v1.ListRegionCommitmentsRequest = (function() { + + /** + * Properties of a ListRegionCommitmentsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionCommitmentsRequest + * @property {string|null} [filter] ListRegionCommitmentsRequest filter + * @property {number|null} [maxResults] ListRegionCommitmentsRequest maxResults + * @property {string|null} [orderBy] ListRegionCommitmentsRequest orderBy + * @property {string|null} [pageToken] ListRegionCommitmentsRequest pageToken + * @property {string|null} [project] ListRegionCommitmentsRequest project + * @property {string|null} [region] ListRegionCommitmentsRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionCommitmentsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionCommitmentsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionCommitmentsRequest. + * @implements IListRegionCommitmentsRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionCommitmentsRequest=} [properties] Properties to set + */ + function ListRegionCommitmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionCommitmentsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + ListRegionCommitmentsRequest.prototype.filter = null; + + /** + * ListRegionCommitmentsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + ListRegionCommitmentsRequest.prototype.maxResults = null; + + /** + * ListRegionCommitmentsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + ListRegionCommitmentsRequest.prototype.orderBy = null; + + /** + * ListRegionCommitmentsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + ListRegionCommitmentsRequest.prototype.pageToken = null; + + /** + * ListRegionCommitmentsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + ListRegionCommitmentsRequest.prototype.project = ""; + + /** + * ListRegionCommitmentsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + ListRegionCommitmentsRequest.prototype.region = ""; + + /** + * ListRegionCommitmentsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + ListRegionCommitmentsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionCommitmentsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(ListRegionCommitmentsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionCommitmentsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(ListRegionCommitmentsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionCommitmentsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(ListRegionCommitmentsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionCommitmentsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(ListRegionCommitmentsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionCommitmentsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + */ + Object.defineProperty(ListRegionCommitmentsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionCommitmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionCommitmentsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionCommitmentsRequest} ListRegionCommitmentsRequest instance + */ + ListRegionCommitmentsRequest.create = function create(properties) { + return new ListRegionCommitmentsRequest(properties); + }; + + /** + * Encodes the specified ListRegionCommitmentsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionCommitmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionCommitmentsRequest} message ListRegionCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionCommitmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionCommitmentsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionCommitmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionCommitmentsRequest} message ListRegionCommitmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionCommitmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionCommitmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionCommitmentsRequest} ListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionCommitmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionCommitmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionCommitmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionCommitmentsRequest} ListRegionCommitmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionCommitmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionCommitmentsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionCommitmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionCommitmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionCommitmentsRequest} ListRegionCommitmentsRequest + */ + ListRegionCommitmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionCommitmentsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionCommitmentsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionCommitmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @static + * @param {google.cloud.compute.v1.ListRegionCommitmentsRequest} message ListRegionCommitmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionCommitmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionCommitmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionCommitmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionCommitmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionCommitmentsRequest; + })(); + + v1.GetRegionDiskTypeRequest = (function() { + + /** + * Properties of a GetRegionDiskTypeRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionDiskTypeRequest + * @property {string|null} [diskType] GetRegionDiskTypeRequest diskType + * @property {string|null} [project] GetRegionDiskTypeRequest project + * @property {string|null} [region] GetRegionDiskTypeRequest region + */ + + /** + * Constructs a new GetRegionDiskTypeRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionDiskTypeRequest. + * @implements IGetRegionDiskTypeRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionDiskTypeRequest=} [properties] Properties to set + */ + function GetRegionDiskTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionDiskTypeRequest diskType. + * @member {string} diskType + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @instance + */ + GetRegionDiskTypeRequest.prototype.diskType = ""; + + /** + * GetRegionDiskTypeRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @instance + */ + GetRegionDiskTypeRequest.prototype.project = ""; + + /** + * GetRegionDiskTypeRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @instance + */ + GetRegionDiskTypeRequest.prototype.region = ""; + + /** + * Creates a new GetRegionDiskTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionDiskTypeRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionDiskTypeRequest} GetRegionDiskTypeRequest instance + */ + GetRegionDiskTypeRequest.create = function create(properties) { + return new GetRegionDiskTypeRequest(properties); + }; + + /** + * Encodes the specified GetRegionDiskTypeRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionDiskTypeRequest} message GetRegionDiskTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionDiskTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 93009052, wireType 2 =*/744072418).string(message.diskType); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionDiskTypeRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionDiskTypeRequest} message GetRegionDiskTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionDiskTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionDiskTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionDiskTypeRequest} GetRegionDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionDiskTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionDiskTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 93009052: + message.diskType = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionDiskTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionDiskTypeRequest} GetRegionDiskTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionDiskTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionDiskTypeRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionDiskTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.diskType != null && message.hasOwnProperty("diskType")) + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionDiskTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionDiskTypeRequest} GetRegionDiskTypeRequest + */ + GetRegionDiskTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionDiskTypeRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionDiskTypeRequest(); + if (object.diskType != null) + message.diskType = String(object.diskType); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionDiskTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @static + * @param {google.cloud.compute.v1.GetRegionDiskTypeRequest} message GetRegionDiskTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionDiskTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.diskType = ""; + object.region = ""; + object.project = ""; + } + if (message.diskType != null && message.hasOwnProperty("diskType")) + object.diskType = message.diskType; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionDiskTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionDiskTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionDiskTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionDiskTypeRequest; + })(); + + v1.ListRegionDiskTypesRequest = (function() { + + /** + * Properties of a ListRegionDiskTypesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionDiskTypesRequest + * @property {string|null} [filter] ListRegionDiskTypesRequest filter + * @property {number|null} [maxResults] ListRegionDiskTypesRequest maxResults + * @property {string|null} [orderBy] ListRegionDiskTypesRequest orderBy + * @property {string|null} [pageToken] ListRegionDiskTypesRequest pageToken + * @property {string|null} [project] ListRegionDiskTypesRequest project + * @property {string|null} [region] ListRegionDiskTypesRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionDiskTypesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionDiskTypesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionDiskTypesRequest. + * @implements IListRegionDiskTypesRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionDiskTypesRequest=} [properties] Properties to set + */ + function ListRegionDiskTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionDiskTypesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + ListRegionDiskTypesRequest.prototype.filter = null; + + /** + * ListRegionDiskTypesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + ListRegionDiskTypesRequest.prototype.maxResults = null; + + /** + * ListRegionDiskTypesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + ListRegionDiskTypesRequest.prototype.orderBy = null; + + /** + * ListRegionDiskTypesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + ListRegionDiskTypesRequest.prototype.pageToken = null; + + /** + * ListRegionDiskTypesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + ListRegionDiskTypesRequest.prototype.project = ""; + + /** + * ListRegionDiskTypesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + ListRegionDiskTypesRequest.prototype.region = ""; + + /** + * ListRegionDiskTypesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + ListRegionDiskTypesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionDiskTypesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + Object.defineProperty(ListRegionDiskTypesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDiskTypesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + Object.defineProperty(ListRegionDiskTypesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDiskTypesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + Object.defineProperty(ListRegionDiskTypesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDiskTypesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + Object.defineProperty(ListRegionDiskTypesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDiskTypesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + */ + Object.defineProperty(ListRegionDiskTypesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionDiskTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionDiskTypesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionDiskTypesRequest} ListRegionDiskTypesRequest instance + */ + ListRegionDiskTypesRequest.create = function create(properties) { + return new ListRegionDiskTypesRequest(properties); + }; + + /** + * Encodes the specified ListRegionDiskTypesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionDiskTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionDiskTypesRequest} message ListRegionDiskTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionDiskTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionDiskTypesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionDiskTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionDiskTypesRequest} message ListRegionDiskTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionDiskTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionDiskTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionDiskTypesRequest} ListRegionDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionDiskTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionDiskTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionDiskTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionDiskTypesRequest} ListRegionDiskTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionDiskTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionDiskTypesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionDiskTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionDiskTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionDiskTypesRequest} ListRegionDiskTypesRequest + */ + ListRegionDiskTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionDiskTypesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionDiskTypesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionDiskTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @static + * @param {google.cloud.compute.v1.ListRegionDiskTypesRequest} message ListRegionDiskTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionDiskTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionDiskTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionDiskTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionDiskTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionDiskTypesRequest; + })(); + + v1.AddResourcePoliciesRegionDiskRequest = (function() { + + /** + * Properties of an AddResourcePoliciesRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddResourcePoliciesRegionDiskRequest + * @property {string|null} [disk] AddResourcePoliciesRegionDiskRequest disk + * @property {string|null} [project] AddResourcePoliciesRegionDiskRequest project + * @property {string|null} [region] AddResourcePoliciesRegionDiskRequest region + * @property {google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest|null} [regionDisksAddResourcePoliciesRequestResource] AddResourcePoliciesRegionDiskRequest regionDisksAddResourcePoliciesRequestResource + * @property {string|null} [requestId] AddResourcePoliciesRegionDiskRequest requestId + */ + + /** + * Constructs a new AddResourcePoliciesRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddResourcePoliciesRegionDiskRequest. + * @implements IAddResourcePoliciesRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest=} [properties] Properties to set + */ + function AddResourcePoliciesRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddResourcePoliciesRegionDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @instance + */ + AddResourcePoliciesRegionDiskRequest.prototype.disk = ""; + + /** + * AddResourcePoliciesRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @instance + */ + AddResourcePoliciesRegionDiskRequest.prototype.project = ""; + + /** + * AddResourcePoliciesRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @instance + */ + AddResourcePoliciesRegionDiskRequest.prototype.region = ""; + + /** + * AddResourcePoliciesRegionDiskRequest regionDisksAddResourcePoliciesRequestResource. + * @member {google.cloud.compute.v1.IRegionDisksAddResourcePoliciesRequest|null|undefined} regionDisksAddResourcePoliciesRequestResource + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @instance + */ + AddResourcePoliciesRegionDiskRequest.prototype.regionDisksAddResourcePoliciesRequestResource = null; + + /** + * AddResourcePoliciesRegionDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @instance + */ + AddResourcePoliciesRegionDiskRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddResourcePoliciesRegionDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @instance + */ + Object.defineProperty(AddResourcePoliciesRegionDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddResourcePoliciesRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest} AddResourcePoliciesRegionDiskRequest instance + */ + AddResourcePoliciesRegionDiskRequest.create = function create(properties) { + return new AddResourcePoliciesRegionDiskRequest(properties); + }; + + /** + * Encodes the specified AddResourcePoliciesRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest} message AddResourcePoliciesRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddResourcePoliciesRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionDisksAddResourcePoliciesRequestResource != null && Object.hasOwnProperty.call(message, "regionDisksAddResourcePoliciesRequestResource")) + $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.encode(message.regionDisksAddResourcePoliciesRequestResource, writer.uint32(/* id 284196750, wireType 2 =*/2273574002).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddResourcePoliciesRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest} message AddResourcePoliciesRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddResourcePoliciesRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddResourcePoliciesRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest} AddResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddResourcePoliciesRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 284196750: + message.regionDisksAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddResourcePoliciesRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest} AddResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddResourcePoliciesRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddResourcePoliciesRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddResourcePoliciesRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionDisksAddResourcePoliciesRequestResource != null && message.hasOwnProperty("regionDisksAddResourcePoliciesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.verify(message.regionDisksAddResourcePoliciesRequestResource); + if (error) + return "regionDisksAddResourcePoliciesRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an AddResourcePoliciesRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest} AddResourcePoliciesRegionDiskRequest + */ + AddResourcePoliciesRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionDisksAddResourcePoliciesRequestResource != null) { + if (typeof object.regionDisksAddResourcePoliciesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest.regionDisksAddResourcePoliciesRequestResource: object expected"); + message.regionDisksAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.fromObject(object.regionDisksAddResourcePoliciesRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AddResourcePoliciesRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest} message AddResourcePoliciesRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddResourcePoliciesRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.region = ""; + object.project = ""; + object.regionDisksAddResourcePoliciesRequestResource = null; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionDisksAddResourcePoliciesRequestResource != null && message.hasOwnProperty("regionDisksAddResourcePoliciesRequestResource")) + object.regionDisksAddResourcePoliciesRequestResource = $root.google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest.toObject(message.regionDisksAddResourcePoliciesRequestResource, options); + return object; + }; + + /** + * Converts this AddResourcePoliciesRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + AddResourcePoliciesRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddResourcePoliciesRegionDiskRequest; + })(); + + v1.CreateSnapshotRegionDiskRequest = (function() { + + /** + * Properties of a CreateSnapshotRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ICreateSnapshotRegionDiskRequest + * @property {string|null} [disk] CreateSnapshotRegionDiskRequest disk + * @property {string|null} [project] CreateSnapshotRegionDiskRequest project + * @property {string|null} [region] CreateSnapshotRegionDiskRequest region + * @property {string|null} [requestId] CreateSnapshotRegionDiskRequest requestId + * @property {google.cloud.compute.v1.ISnapshot|null} [snapshotResource] CreateSnapshotRegionDiskRequest snapshotResource + */ + + /** + * Constructs a new CreateSnapshotRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CreateSnapshotRegionDiskRequest. + * @implements ICreateSnapshotRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest=} [properties] Properties to set + */ + function CreateSnapshotRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSnapshotRegionDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @instance + */ + CreateSnapshotRegionDiskRequest.prototype.disk = ""; + + /** + * CreateSnapshotRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @instance + */ + CreateSnapshotRegionDiskRequest.prototype.project = ""; + + /** + * CreateSnapshotRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @instance + */ + CreateSnapshotRegionDiskRequest.prototype.region = ""; + + /** + * CreateSnapshotRegionDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @instance + */ + CreateSnapshotRegionDiskRequest.prototype.requestId = null; + + /** + * CreateSnapshotRegionDiskRequest snapshotResource. + * @member {google.cloud.compute.v1.ISnapshot|null|undefined} snapshotResource + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @instance + */ + CreateSnapshotRegionDiskRequest.prototype.snapshotResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateSnapshotRegionDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @instance + */ + Object.defineProperty(CreateSnapshotRegionDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateSnapshotRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CreateSnapshotRegionDiskRequest} CreateSnapshotRegionDiskRequest instance + */ + CreateSnapshotRegionDiskRequest.create = function create(properties) { + return new CreateSnapshotRegionDiskRequest(properties); + }; + + /** + * Encodes the specified CreateSnapshotRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest} message CreateSnapshotRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.snapshotResource != null && Object.hasOwnProperty.call(message, "snapshotResource")) + $root.google.cloud.compute.v1.Snapshot.encode(message.snapshotResource, writer.uint32(/* id 481319977, wireType 2 =*/3850559818).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSnapshotRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateSnapshotRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest} message CreateSnapshotRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSnapshotRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CreateSnapshotRegionDiskRequest} CreateSnapshotRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CreateSnapshotRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 481319977: + message.snapshotResource = $root.google.cloud.compute.v1.Snapshot.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSnapshotRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CreateSnapshotRegionDiskRequest} CreateSnapshotRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSnapshotRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSnapshotRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.snapshotResource != null && message.hasOwnProperty("snapshotResource")) { + var error = $root.google.cloud.compute.v1.Snapshot.verify(message.snapshotResource); + if (error) + return "snapshotResource." + error; + } + return null; + }; + + /** + * Creates a CreateSnapshotRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CreateSnapshotRegionDiskRequest} CreateSnapshotRegionDiskRequest + */ + CreateSnapshotRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CreateSnapshotRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.CreateSnapshotRegionDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.snapshotResource != null) { + if (typeof object.snapshotResource !== "object") + throw TypeError(".google.cloud.compute.v1.CreateSnapshotRegionDiskRequest.snapshotResource: object expected"); + message.snapshotResource = $root.google.cloud.compute.v1.Snapshot.fromObject(object.snapshotResource); + } + return message; + }; + + /** + * Creates a plain object from a CreateSnapshotRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.CreateSnapshotRegionDiskRequest} message CreateSnapshotRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSnapshotRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.region = ""; + object.project = ""; + object.snapshotResource = null; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.snapshotResource != null && message.hasOwnProperty("snapshotResource")) + object.snapshotResource = $root.google.cloud.compute.v1.Snapshot.toObject(message.snapshotResource, options); + return object; + }; + + /** + * Converts this CreateSnapshotRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CreateSnapshotRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSnapshotRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateSnapshotRegionDiskRequest; + })(); + + v1.DeleteRegionDiskRequest = (function() { + + /** + * Properties of a DeleteRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionDiskRequest + * @property {string|null} [disk] DeleteRegionDiskRequest disk + * @property {string|null} [project] DeleteRegionDiskRequest project + * @property {string|null} [region] DeleteRegionDiskRequest region + * @property {string|null} [requestId] DeleteRegionDiskRequest requestId + */ + + /** + * Constructs a new DeleteRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionDiskRequest. + * @implements IDeleteRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionDiskRequest=} [properties] Properties to set + */ + function DeleteRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @instance + */ + DeleteRegionDiskRequest.prototype.disk = ""; + + /** + * DeleteRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @instance + */ + DeleteRegionDiskRequest.prototype.project = ""; + + /** + * DeleteRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @instance + */ + DeleteRegionDiskRequest.prototype.region = ""; + + /** + * DeleteRegionDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @instance + */ + DeleteRegionDiskRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @instance + */ + Object.defineProperty(DeleteRegionDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionDiskRequest} DeleteRegionDiskRequest instance + */ + DeleteRegionDiskRequest.create = function create(properties) { + return new DeleteRegionDiskRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionDiskRequest} message DeleteRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionDiskRequest} message DeleteRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionDiskRequest} DeleteRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionDiskRequest} DeleteRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionDiskRequest} DeleteRegionDiskRequest + */ + DeleteRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionDiskRequest} message DeleteRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.region = ""; + object.project = ""; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionDiskRequest; + })(); + + v1.GetRegionDiskRequest = (function() { + + /** + * Properties of a GetRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionDiskRequest + * @property {string|null} [disk] GetRegionDiskRequest disk + * @property {string|null} [project] GetRegionDiskRequest project + * @property {string|null} [region] GetRegionDiskRequest region + */ + + /** + * Constructs a new GetRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionDiskRequest. + * @implements IGetRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionDiskRequest=} [properties] Properties to set + */ + function GetRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @instance + */ + GetRegionDiskRequest.prototype.disk = ""; + + /** + * GetRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @instance + */ + GetRegionDiskRequest.prototype.project = ""; + + /** + * GetRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @instance + */ + GetRegionDiskRequest.prototype.region = ""; + + /** + * Creates a new GetRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionDiskRequest} GetRegionDiskRequest instance + */ + GetRegionDiskRequest.create = function create(properties) { + return new GetRegionDiskRequest(properties); + }; + + /** + * Encodes the specified GetRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionDiskRequest} message GetRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionDiskRequest} message GetRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionDiskRequest} GetRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionDiskRequest} GetRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionDiskRequest} GetRegionDiskRequest + */ + GetRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.GetRegionDiskRequest} message GetRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.region = ""; + object.project = ""; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionDiskRequest; + })(); + + v1.GetIamPolicyRegionDiskRequest = (function() { + + /** + * Properties of a GetIamPolicyRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyRegionDiskRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyRegionDiskRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyRegionDiskRequest project + * @property {string|null} [region] GetIamPolicyRegionDiskRequest region + * @property {string|null} [resource] GetIamPolicyRegionDiskRequest resource + */ + + /** + * Constructs a new GetIamPolicyRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyRegionDiskRequest. + * @implements IGetIamPolicyRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest=} [properties] Properties to set + */ + function GetIamPolicyRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyRegionDiskRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @instance + */ + GetIamPolicyRegionDiskRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @instance + */ + GetIamPolicyRegionDiskRequest.prototype.project = ""; + + /** + * GetIamPolicyRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @instance + */ + GetIamPolicyRegionDiskRequest.prototype.region = ""; + + /** + * GetIamPolicyRegionDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @instance + */ + GetIamPolicyRegionDiskRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyRegionDiskRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @instance + */ + Object.defineProperty(GetIamPolicyRegionDiskRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyRegionDiskRequest} GetIamPolicyRegionDiskRequest instance + */ + GetIamPolicyRegionDiskRequest.create = function create(properties) { + return new GetIamPolicyRegionDiskRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest} message GetIamPolicyRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest} message GetIamPolicyRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyRegionDiskRequest} GetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyRegionDiskRequest} GetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyRegionDiskRequest} GetIamPolicyRegionDiskRequest + */ + GetIamPolicyRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyRegionDiskRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyRegionDiskRequest} message GetIamPolicyRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyRegionDiskRequest; + })(); + + v1.InsertRegionDiskRequest = (function() { + + /** + * Properties of an InsertRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionDiskRequest + * @property {google.cloud.compute.v1.IDisk|null} [diskResource] InsertRegionDiskRequest diskResource + * @property {string|null} [project] InsertRegionDiskRequest project + * @property {string|null} [region] InsertRegionDiskRequest region + * @property {string|null} [requestId] InsertRegionDiskRequest requestId + * @property {string|null} [sourceImage] InsertRegionDiskRequest sourceImage + */ + + /** + * Constructs a new InsertRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionDiskRequest. + * @implements IInsertRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionDiskRequest=} [properties] Properties to set + */ + function InsertRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionDiskRequest diskResource. + * @member {google.cloud.compute.v1.IDisk|null|undefined} diskResource + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + */ + InsertRegionDiskRequest.prototype.diskResource = null; + + /** + * InsertRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + */ + InsertRegionDiskRequest.prototype.project = ""; + + /** + * InsertRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + */ + InsertRegionDiskRequest.prototype.region = ""; + + /** + * InsertRegionDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + */ + InsertRegionDiskRequest.prototype.requestId = null; + + /** + * InsertRegionDiskRequest sourceImage. + * @member {string|null|undefined} sourceImage + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + */ + InsertRegionDiskRequest.prototype.sourceImage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + */ + Object.defineProperty(InsertRegionDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * InsertRegionDiskRequest _sourceImage. + * @member {"sourceImage"|undefined} _sourceImage + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + */ + Object.defineProperty(InsertRegionDiskRequest.prototype, "_sourceImage", { + get: $util.oneOfGetter($oneOfFields = ["sourceImage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionDiskRequest} InsertRegionDiskRequest instance + */ + InsertRegionDiskRequest.create = function create(properties) { + return new InsertRegionDiskRequest(properties); + }; + + /** + * Encodes the specified InsertRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionDiskRequest} message InsertRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskResource != null && Object.hasOwnProperty.call(message, "diskResource")) + $root.google.cloud.compute.v1.Disk.encode(message.diskResource, writer.uint32(/* id 25880688, wireType 2 =*/207045506).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.sourceImage != null && Object.hasOwnProperty.call(message, "sourceImage")) + writer.uint32(/* id 50443319, wireType 2 =*/403546554).string(message.sourceImage); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionDiskRequest} message InsertRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionDiskRequest} InsertRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 25880688: + message.diskResource = $root.google.cloud.compute.v1.Disk.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 50443319: + message.sourceImage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionDiskRequest} InsertRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskResource != null && message.hasOwnProperty("diskResource")) { + var error = $root.google.cloud.compute.v1.Disk.verify(message.diskResource); + if (error) + return "diskResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + properties._sourceImage = 1; + if (!$util.isString(message.sourceImage)) + return "sourceImage: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionDiskRequest} InsertRegionDiskRequest + */ + InsertRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionDiskRequest(); + if (object.diskResource != null) { + if (typeof object.diskResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionDiskRequest.diskResource: object expected"); + message.diskResource = $root.google.cloud.compute.v1.Disk.fromObject(object.diskResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sourceImage != null) + message.sourceImage = String(object.sourceImage); + return message; + }; + + /** + * Creates a plain object from an InsertRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionDiskRequest} message InsertRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.diskResource = null; + object.region = ""; + object.project = ""; + } + if (message.diskResource != null && message.hasOwnProperty("diskResource")) + object.diskResource = $root.google.cloud.compute.v1.Disk.toObject(message.diskResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.sourceImage != null && message.hasOwnProperty("sourceImage")) { + object.sourceImage = message.sourceImage; + if (options.oneofs) + object._sourceImage = "sourceImage"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionDiskRequest; + })(); + + v1.ListRegionDisksRequest = (function() { + + /** + * Properties of a ListRegionDisksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionDisksRequest + * @property {string|null} [filter] ListRegionDisksRequest filter + * @property {number|null} [maxResults] ListRegionDisksRequest maxResults + * @property {string|null} [orderBy] ListRegionDisksRequest orderBy + * @property {string|null} [pageToken] ListRegionDisksRequest pageToken + * @property {string|null} [project] ListRegionDisksRequest project + * @property {string|null} [region] ListRegionDisksRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionDisksRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionDisksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionDisksRequest. + * @implements IListRegionDisksRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionDisksRequest=} [properties] Properties to set + */ + function ListRegionDisksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionDisksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + ListRegionDisksRequest.prototype.filter = null; + + /** + * ListRegionDisksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + ListRegionDisksRequest.prototype.maxResults = null; + + /** + * ListRegionDisksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + ListRegionDisksRequest.prototype.orderBy = null; + + /** + * ListRegionDisksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + ListRegionDisksRequest.prototype.pageToken = null; + + /** + * ListRegionDisksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + ListRegionDisksRequest.prototype.project = ""; + + /** + * ListRegionDisksRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + ListRegionDisksRequest.prototype.region = ""; + + /** + * ListRegionDisksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + ListRegionDisksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionDisksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + Object.defineProperty(ListRegionDisksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDisksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + Object.defineProperty(ListRegionDisksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDisksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + Object.defineProperty(ListRegionDisksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDisksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + Object.defineProperty(ListRegionDisksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionDisksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + */ + Object.defineProperty(ListRegionDisksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionDisksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {google.cloud.compute.v1.IListRegionDisksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionDisksRequest} ListRegionDisksRequest instance + */ + ListRegionDisksRequest.create = function create(properties) { + return new ListRegionDisksRequest(properties); + }; + + /** + * Encodes the specified ListRegionDisksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionDisksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {google.cloud.compute.v1.IListRegionDisksRequest} message ListRegionDisksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionDisksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionDisksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionDisksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {google.cloud.compute.v1.IListRegionDisksRequest} message ListRegionDisksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionDisksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionDisksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionDisksRequest} ListRegionDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionDisksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionDisksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionDisksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionDisksRequest} ListRegionDisksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionDisksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionDisksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionDisksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionDisksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionDisksRequest} ListRegionDisksRequest + */ + ListRegionDisksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionDisksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionDisksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionDisksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @static + * @param {google.cloud.compute.v1.ListRegionDisksRequest} message ListRegionDisksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionDisksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionDisksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionDisksRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionDisksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionDisksRequest; + })(); + + v1.RemoveResourcePoliciesRegionDiskRequest = (function() { + + /** + * Properties of a RemoveResourcePoliciesRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveResourcePoliciesRegionDiskRequest + * @property {string|null} [disk] RemoveResourcePoliciesRegionDiskRequest disk + * @property {string|null} [project] RemoveResourcePoliciesRegionDiskRequest project + * @property {string|null} [region] RemoveResourcePoliciesRegionDiskRequest region + * @property {google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest|null} [regionDisksRemoveResourcePoliciesRequestResource] RemoveResourcePoliciesRegionDiskRequest regionDisksRemoveResourcePoliciesRequestResource + * @property {string|null} [requestId] RemoveResourcePoliciesRegionDiskRequest requestId + */ + + /** + * Constructs a new RemoveResourcePoliciesRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveResourcePoliciesRegionDiskRequest. + * @implements IRemoveResourcePoliciesRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest=} [properties] Properties to set + */ + function RemoveResourcePoliciesRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveResourcePoliciesRegionDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @instance + */ + RemoveResourcePoliciesRegionDiskRequest.prototype.disk = ""; + + /** + * RemoveResourcePoliciesRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @instance + */ + RemoveResourcePoliciesRegionDiskRequest.prototype.project = ""; + + /** + * RemoveResourcePoliciesRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @instance + */ + RemoveResourcePoliciesRegionDiskRequest.prototype.region = ""; + + /** + * RemoveResourcePoliciesRegionDiskRequest regionDisksRemoveResourcePoliciesRequestResource. + * @member {google.cloud.compute.v1.IRegionDisksRemoveResourcePoliciesRequest|null|undefined} regionDisksRemoveResourcePoliciesRequestResource + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @instance + */ + RemoveResourcePoliciesRegionDiskRequest.prototype.regionDisksRemoveResourcePoliciesRequestResource = null; + + /** + * RemoveResourcePoliciesRegionDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @instance + */ + RemoveResourcePoliciesRegionDiskRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveResourcePoliciesRegionDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @instance + */ + Object.defineProperty(RemoveResourcePoliciesRegionDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveResourcePoliciesRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest} RemoveResourcePoliciesRegionDiskRequest instance + */ + RemoveResourcePoliciesRegionDiskRequest.create = function create(properties) { + return new RemoveResourcePoliciesRegionDiskRequest(properties); + }; + + /** + * Encodes the specified RemoveResourcePoliciesRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest} message RemoveResourcePoliciesRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveResourcePoliciesRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.regionDisksRemoveResourcePoliciesRequestResource != null && Object.hasOwnProperty.call(message, "regionDisksRemoveResourcePoliciesRequestResource")) + $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.encode(message.regionDisksRemoveResourcePoliciesRequestResource, writer.uint32(/* id 8741283, wireType 2 =*/69930266).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified RemoveResourcePoliciesRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest} message RemoveResourcePoliciesRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveResourcePoliciesRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveResourcePoliciesRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest} RemoveResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveResourcePoliciesRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 8741283: + message.regionDisksRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveResourcePoliciesRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest} RemoveResourcePoliciesRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveResourcePoliciesRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveResourcePoliciesRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveResourcePoliciesRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionDisksRemoveResourcePoliciesRequestResource != null && message.hasOwnProperty("regionDisksRemoveResourcePoliciesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.verify(message.regionDisksRemoveResourcePoliciesRequestResource); + if (error) + return "regionDisksRemoveResourcePoliciesRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a RemoveResourcePoliciesRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest} RemoveResourcePoliciesRegionDiskRequest + */ + RemoveResourcePoliciesRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionDisksRemoveResourcePoliciesRequestResource != null) { + if (typeof object.regionDisksRemoveResourcePoliciesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest.regionDisksRemoveResourcePoliciesRequestResource: object expected"); + message.regionDisksRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.fromObject(object.regionDisksRemoveResourcePoliciesRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RemoveResourcePoliciesRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest} message RemoveResourcePoliciesRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveResourcePoliciesRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.regionDisksRemoveResourcePoliciesRequestResource = null; + object.region = ""; + object.project = ""; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.regionDisksRemoveResourcePoliciesRequestResource != null && message.hasOwnProperty("regionDisksRemoveResourcePoliciesRequestResource")) + object.regionDisksRemoveResourcePoliciesRequestResource = $root.google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest.toObject(message.regionDisksRemoveResourcePoliciesRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this RemoveResourcePoliciesRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveResourcePoliciesRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveResourcePoliciesRegionDiskRequest; + })(); + + v1.ResizeRegionDiskRequest = (function() { + + /** + * Properties of a ResizeRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface IResizeRegionDiskRequest + * @property {string|null} [disk] ResizeRegionDiskRequest disk + * @property {string|null} [project] ResizeRegionDiskRequest project + * @property {string|null} [region] ResizeRegionDiskRequest region + * @property {google.cloud.compute.v1.IRegionDisksResizeRequest|null} [regionDisksResizeRequestResource] ResizeRegionDiskRequest regionDisksResizeRequestResource + * @property {string|null} [requestId] ResizeRegionDiskRequest requestId + */ + + /** + * Constructs a new ResizeRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResizeRegionDiskRequest. + * @implements IResizeRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.IResizeRegionDiskRequest=} [properties] Properties to set + */ + function ResizeRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResizeRegionDiskRequest disk. + * @member {string} disk + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @instance + */ + ResizeRegionDiskRequest.prototype.disk = ""; + + /** + * ResizeRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @instance + */ + ResizeRegionDiskRequest.prototype.project = ""; + + /** + * ResizeRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @instance + */ + ResizeRegionDiskRequest.prototype.region = ""; + + /** + * ResizeRegionDiskRequest regionDisksResizeRequestResource. + * @member {google.cloud.compute.v1.IRegionDisksResizeRequest|null|undefined} regionDisksResizeRequestResource + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @instance + */ + ResizeRegionDiskRequest.prototype.regionDisksResizeRequestResource = null; + + /** + * ResizeRegionDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @instance + */ + ResizeRegionDiskRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResizeRegionDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @instance + */ + Object.defineProperty(ResizeRegionDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResizeRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IResizeRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResizeRegionDiskRequest} ResizeRegionDiskRequest instance + */ + ResizeRegionDiskRequest.create = function create(properties) { + return new ResizeRegionDiskRequest(properties); + }; + + /** + * Encodes the specified ResizeRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IResizeRegionDiskRequest} message ResizeRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.disk != null && Object.hasOwnProperty.call(message, "disk")) + writer.uint32(/* id 3083677, wireType 2 =*/24669418).string(message.disk); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionDisksResizeRequestResource != null && Object.hasOwnProperty.call(message, "regionDisksResizeRequestResource")) + $root.google.cloud.compute.v1.RegionDisksResizeRequest.encode(message.regionDisksResizeRequestResource, writer.uint32(/* id 446633237, wireType 2 =*/3573065898).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResizeRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.IResizeRegionDiskRequest} message ResizeRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResizeRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResizeRegionDiskRequest} ResizeRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResizeRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3083677: + message.disk = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 446633237: + message.regionDisksResizeRequestResource = $root.google.cloud.compute.v1.RegionDisksResizeRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResizeRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResizeRegionDiskRequest} ResizeRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResizeRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResizeRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.disk != null && message.hasOwnProperty("disk")) + if (!$util.isString(message.disk)) + return "disk: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionDisksResizeRequestResource != null && message.hasOwnProperty("regionDisksResizeRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionDisksResizeRequest.verify(message.regionDisksResizeRequestResource); + if (error) + return "regionDisksResizeRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a ResizeRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResizeRegionDiskRequest} ResizeRegionDiskRequest + */ + ResizeRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResizeRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.ResizeRegionDiskRequest(); + if (object.disk != null) + message.disk = String(object.disk); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionDisksResizeRequestResource != null) { + if (typeof object.regionDisksResizeRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ResizeRegionDiskRequest.regionDisksResizeRequestResource: object expected"); + message.regionDisksResizeRequestResource = $root.google.cloud.compute.v1.RegionDisksResizeRequest.fromObject(object.regionDisksResizeRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ResizeRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ResizeRegionDiskRequest} message ResizeRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResizeRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.disk = ""; + object.region = ""; + object.project = ""; + object.regionDisksResizeRequestResource = null; + } + if (message.disk != null && message.hasOwnProperty("disk")) + object.disk = message.disk; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionDisksResizeRequestResource != null && message.hasOwnProperty("regionDisksResizeRequestResource")) + object.regionDisksResizeRequestResource = $root.google.cloud.compute.v1.RegionDisksResizeRequest.toObject(message.regionDisksResizeRequestResource, options); + return object; + }; + + /** + * Converts this ResizeRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResizeRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + ResizeRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResizeRegionDiskRequest; + })(); + + v1.SetIamPolicyRegionDiskRequest = (function() { + + /** + * Properties of a SetIamPolicyRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyRegionDiskRequest + * @property {string|null} [project] SetIamPolicyRegionDiskRequest project + * @property {string|null} [region] SetIamPolicyRegionDiskRequest region + * @property {google.cloud.compute.v1.IRegionSetPolicyRequest|null} [regionSetPolicyRequestResource] SetIamPolicyRegionDiskRequest regionSetPolicyRequestResource + * @property {string|null} [resource] SetIamPolicyRegionDiskRequest resource + */ + + /** + * Constructs a new SetIamPolicyRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyRegionDiskRequest. + * @implements ISetIamPolicyRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest=} [properties] Properties to set + */ + function SetIamPolicyRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @instance + */ + SetIamPolicyRegionDiskRequest.prototype.project = ""; + + /** + * SetIamPolicyRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @instance + */ + SetIamPolicyRegionDiskRequest.prototype.region = ""; + + /** + * SetIamPolicyRegionDiskRequest regionSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IRegionSetPolicyRequest|null|undefined} regionSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @instance + */ + SetIamPolicyRegionDiskRequest.prototype.regionSetPolicyRequestResource = null; + + /** + * SetIamPolicyRegionDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @instance + */ + SetIamPolicyRegionDiskRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicyRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyRegionDiskRequest} SetIamPolicyRegionDiskRequest instance + */ + SetIamPolicyRegionDiskRequest.create = function create(properties) { + return new SetIamPolicyRegionDiskRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest} message SetIamPolicyRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "regionSetPolicyRequestResource")) + $root.google.cloud.compute.v1.RegionSetPolicyRequest.encode(message.regionSetPolicyRequestResource, writer.uint32(/* id 276489091, wireType 2 =*/2211912730).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest} message SetIamPolicyRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyRegionDiskRequest} SetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 276489091: + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyRegionDiskRequest} SetIamPolicyRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionSetPolicyRequest.verify(message.regionSetPolicyRequestResource); + if (error) + return "regionSetPolicyRequestResource." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicyRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyRegionDiskRequest} SetIamPolicyRegionDiskRequest + */ + SetIamPolicyRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyRegionDiskRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionSetPolicyRequestResource != null) { + if (typeof object.regionSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyRegionDiskRequest.regionSetPolicyRequestResource: object expected"); + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.fromObject(object.regionSetPolicyRequestResource); + } + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyRegionDiskRequest} message SetIamPolicyRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.regionSetPolicyRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) + object.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.toObject(message.regionSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyRegionDiskRequest; + })(); + + v1.SetLabelsRegionDiskRequest = (function() { + + /** + * Properties of a SetLabelsRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsRegionDiskRequest + * @property {string|null} [project] SetLabelsRegionDiskRequest project + * @property {string|null} [region] SetLabelsRegionDiskRequest region + * @property {google.cloud.compute.v1.IRegionSetLabelsRequest|null} [regionSetLabelsRequestResource] SetLabelsRegionDiskRequest regionSetLabelsRequestResource + * @property {string|null} [requestId] SetLabelsRegionDiskRequest requestId + * @property {string|null} [resource] SetLabelsRegionDiskRequest resource + */ + + /** + * Constructs a new SetLabelsRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsRegionDiskRequest. + * @implements ISetLabelsRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsRegionDiskRequest=} [properties] Properties to set + */ + function SetLabelsRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @instance + */ + SetLabelsRegionDiskRequest.prototype.project = ""; + + /** + * SetLabelsRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @instance + */ + SetLabelsRegionDiskRequest.prototype.region = ""; + + /** + * SetLabelsRegionDiskRequest regionSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IRegionSetLabelsRequest|null|undefined} regionSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @instance + */ + SetLabelsRegionDiskRequest.prototype.regionSetLabelsRequestResource = null; + + /** + * SetLabelsRegionDiskRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @instance + */ + SetLabelsRegionDiskRequest.prototype.requestId = null; + + /** + * SetLabelsRegionDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @instance + */ + SetLabelsRegionDiskRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetLabelsRegionDiskRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @instance + */ + Object.defineProperty(SetLabelsRegionDiskRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetLabelsRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsRegionDiskRequest} SetLabelsRegionDiskRequest instance + */ + SetLabelsRegionDiskRequest.create = function create(properties) { + return new SetLabelsRegionDiskRequest(properties); + }; + + /** + * Encodes the specified SetLabelsRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsRegionDiskRequest} message SetLabelsRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "regionSetLabelsRequestResource")) + $root.google.cloud.compute.v1.RegionSetLabelsRequest.encode(message.regionSetLabelsRequestResource, writer.uint32(/* id 259357782, wireType 2 =*/2074862258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsRegionDiskRequest} message SetLabelsRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsRegionDiskRequest} SetLabelsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 259357782: + message.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsRegionDiskRequest} SetLabelsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionSetLabelsRequestResource != null && message.hasOwnProperty("regionSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionSetLabelsRequest.verify(message.regionSetLabelsRequestResource); + if (error) + return "regionSetLabelsRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetLabelsRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsRegionDiskRequest} SetLabelsRegionDiskRequest + */ + SetLabelsRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsRegionDiskRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionSetLabelsRequestResource != null) { + if (typeof object.regionSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsRegionDiskRequest.regionSetLabelsRequestResource: object expected"); + message.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.fromObject(object.regionSetLabelsRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetLabelsRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsRegionDiskRequest} message SetLabelsRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.regionSetLabelsRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionSetLabelsRequestResource != null && message.hasOwnProperty("regionSetLabelsRequestResource")) + object.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.toObject(message.regionSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsRegionDiskRequest; + })(); + + v1.TestIamPermissionsRegionDiskRequest = (function() { + + /** + * Properties of a TestIamPermissionsRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsRegionDiskRequest + * @property {string|null} [project] TestIamPermissionsRegionDiskRequest project + * @property {string|null} [region] TestIamPermissionsRegionDiskRequest region + * @property {string|null} [resource] TestIamPermissionsRegionDiskRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsRegionDiskRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsRegionDiskRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsRegionDiskRequest. + * @implements ITestIamPermissionsRegionDiskRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest=} [properties] Properties to set + */ + function TestIamPermissionsRegionDiskRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsRegionDiskRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @instance + */ + TestIamPermissionsRegionDiskRequest.prototype.project = ""; + + /** + * TestIamPermissionsRegionDiskRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @instance + */ + TestIamPermissionsRegionDiskRequest.prototype.region = ""; + + /** + * TestIamPermissionsRegionDiskRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @instance + */ + TestIamPermissionsRegionDiskRequest.prototype.resource = ""; + + /** + * TestIamPermissionsRegionDiskRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @instance + */ + TestIamPermissionsRegionDiskRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsRegionDiskRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest} TestIamPermissionsRegionDiskRequest instance + */ + TestIamPermissionsRegionDiskRequest.create = function create(properties) { + return new TestIamPermissionsRegionDiskRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsRegionDiskRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest} message TestIamPermissionsRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRegionDiskRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsRegionDiskRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest} message TestIamPermissionsRegionDiskRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsRegionDiskRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsRegionDiskRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest} TestIamPermissionsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRegionDiskRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsRegionDiskRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest} TestIamPermissionsRegionDiskRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsRegionDiskRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsRegionDiskRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsRegionDiskRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsRegionDiskRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest} TestIamPermissionsRegionDiskRequest + */ + TestIamPermissionsRegionDiskRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsRegionDiskRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest} message TestIamPermissionsRegionDiskRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsRegionDiskRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsRegionDiskRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsRegionDiskRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsRegionDiskRequest; + })(); + + v1.DeleteRegionHealthCheckServiceRequest = (function() { + + /** + * Properties of a DeleteRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionHealthCheckServiceRequest + * @property {string|null} [healthCheckService] DeleteRegionHealthCheckServiceRequest healthCheckService + * @property {string|null} [project] DeleteRegionHealthCheckServiceRequest project + * @property {string|null} [region] DeleteRegionHealthCheckServiceRequest region + * @property {string|null} [requestId] DeleteRegionHealthCheckServiceRequest requestId + */ + + /** + * Constructs a new DeleteRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionHealthCheckServiceRequest. + * @implements IDeleteRegionHealthCheckServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest=} [properties] Properties to set + */ + function DeleteRegionHealthCheckServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionHealthCheckServiceRequest healthCheckService. + * @member {string} healthCheckService + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @instance + */ + DeleteRegionHealthCheckServiceRequest.prototype.healthCheckService = ""; + + /** + * DeleteRegionHealthCheckServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @instance + */ + DeleteRegionHealthCheckServiceRequest.prototype.project = ""; + + /** + * DeleteRegionHealthCheckServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @instance + */ + DeleteRegionHealthCheckServiceRequest.prototype.region = ""; + + /** + * DeleteRegionHealthCheckServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @instance + */ + DeleteRegionHealthCheckServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionHealthCheckServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @instance + */ + Object.defineProperty(DeleteRegionHealthCheckServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionHealthCheckServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest} DeleteRegionHealthCheckServiceRequest instance + */ + DeleteRegionHealthCheckServiceRequest.create = function create(properties) { + return new DeleteRegionHealthCheckServiceRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest} message DeleteRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionHealthCheckServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheckService != null && Object.hasOwnProperty.call(message, "healthCheckService")) + writer.uint32(/* id 408374747, wireType 2 =*/3266997978).string(message.healthCheckService); + return writer; + }; + + /** + * Encodes the specified DeleteRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest} message DeleteRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionHealthCheckServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest} DeleteRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionHealthCheckServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 408374747: + message.healthCheckService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest} DeleteRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionHealthCheckServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionHealthCheckServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionHealthCheckServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) + if (!$util.isString(message.healthCheckService)) + return "healthCheckService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest} DeleteRegionHealthCheckServiceRequest + */ + DeleteRegionHealthCheckServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest(); + if (object.healthCheckService != null) + message.healthCheckService = String(object.healthCheckService); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest} message DeleteRegionHealthCheckServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionHealthCheckServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.healthCheckService = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) + object.healthCheckService = message.healthCheckService; + return object; + }; + + /** + * Converts this DeleteRegionHealthCheckServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionHealthCheckServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionHealthCheckServiceRequest; + })(); + + v1.GetRegionHealthCheckServiceRequest = (function() { + + /** + * Properties of a GetRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionHealthCheckServiceRequest + * @property {string|null} [healthCheckService] GetRegionHealthCheckServiceRequest healthCheckService + * @property {string|null} [project] GetRegionHealthCheckServiceRequest project + * @property {string|null} [region] GetRegionHealthCheckServiceRequest region + */ + + /** + * Constructs a new GetRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionHealthCheckServiceRequest. + * @implements IGetRegionHealthCheckServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest=} [properties] Properties to set + */ + function GetRegionHealthCheckServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionHealthCheckServiceRequest healthCheckService. + * @member {string} healthCheckService + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @instance + */ + GetRegionHealthCheckServiceRequest.prototype.healthCheckService = ""; + + /** + * GetRegionHealthCheckServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @instance + */ + GetRegionHealthCheckServiceRequest.prototype.project = ""; + + /** + * GetRegionHealthCheckServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @instance + */ + GetRegionHealthCheckServiceRequest.prototype.region = ""; + + /** + * Creates a new GetRegionHealthCheckServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionHealthCheckServiceRequest} GetRegionHealthCheckServiceRequest instance + */ + GetRegionHealthCheckServiceRequest.create = function create(properties) { + return new GetRegionHealthCheckServiceRequest(properties); + }; + + /** + * Encodes the specified GetRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest} message GetRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionHealthCheckServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheckService != null && Object.hasOwnProperty.call(message, "healthCheckService")) + writer.uint32(/* id 408374747, wireType 2 =*/3266997978).string(message.healthCheckService); + return writer; + }; + + /** + * Encodes the specified GetRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest} message GetRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionHealthCheckServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionHealthCheckServiceRequest} GetRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionHealthCheckServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionHealthCheckServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 408374747: + message.healthCheckService = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionHealthCheckServiceRequest} GetRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionHealthCheckServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionHealthCheckServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionHealthCheckServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) + if (!$util.isString(message.healthCheckService)) + return "healthCheckService: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionHealthCheckServiceRequest} GetRegionHealthCheckServiceRequest + */ + GetRegionHealthCheckServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionHealthCheckServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionHealthCheckServiceRequest(); + if (object.healthCheckService != null) + message.healthCheckService = String(object.healthCheckService); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.GetRegionHealthCheckServiceRequest} message GetRegionHealthCheckServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionHealthCheckServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.healthCheckService = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) + object.healthCheckService = message.healthCheckService; + return object; + }; + + /** + * Converts this GetRegionHealthCheckServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionHealthCheckServiceRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionHealthCheckServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionHealthCheckServiceRequest; + })(); + + v1.InsertRegionHealthCheckServiceRequest = (function() { + + /** + * Properties of an InsertRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionHealthCheckServiceRequest + * @property {google.cloud.compute.v1.IHealthCheckService|null} [healthCheckServiceResource] InsertRegionHealthCheckServiceRequest healthCheckServiceResource + * @property {string|null} [project] InsertRegionHealthCheckServiceRequest project + * @property {string|null} [region] InsertRegionHealthCheckServiceRequest region + * @property {string|null} [requestId] InsertRegionHealthCheckServiceRequest requestId + */ + + /** + * Constructs a new InsertRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionHealthCheckServiceRequest. + * @implements IInsertRegionHealthCheckServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest=} [properties] Properties to set + */ + function InsertRegionHealthCheckServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionHealthCheckServiceRequest healthCheckServiceResource. + * @member {google.cloud.compute.v1.IHealthCheckService|null|undefined} healthCheckServiceResource + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @instance + */ + InsertRegionHealthCheckServiceRequest.prototype.healthCheckServiceResource = null; + + /** + * InsertRegionHealthCheckServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @instance + */ + InsertRegionHealthCheckServiceRequest.prototype.project = ""; + + /** + * InsertRegionHealthCheckServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @instance + */ + InsertRegionHealthCheckServiceRequest.prototype.region = ""; + + /** + * InsertRegionHealthCheckServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @instance + */ + InsertRegionHealthCheckServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionHealthCheckServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @instance + */ + Object.defineProperty(InsertRegionHealthCheckServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionHealthCheckServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest} InsertRegionHealthCheckServiceRequest instance + */ + InsertRegionHealthCheckServiceRequest.create = function create(properties) { + return new InsertRegionHealthCheckServiceRequest(properties); + }; + + /** + * Encodes the specified InsertRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest} message InsertRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionHealthCheckServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheckServiceResource != null && Object.hasOwnProperty.call(message, "healthCheckServiceResource")) + $root.google.cloud.compute.v1.HealthCheckService.encode(message.healthCheckServiceResource, writer.uint32(/* id 477367794, wireType 2 =*/3818942354).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest} message InsertRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionHealthCheckServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest} InsertRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionHealthCheckServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 477367794: + message.healthCheckServiceResource = $root.google.cloud.compute.v1.HealthCheckService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest} InsertRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionHealthCheckServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionHealthCheckServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionHealthCheckServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheckServiceResource != null && message.hasOwnProperty("healthCheckServiceResource")) { + var error = $root.google.cloud.compute.v1.HealthCheckService.verify(message.healthCheckServiceResource); + if (error) + return "healthCheckServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest} InsertRegionHealthCheckServiceRequest + */ + InsertRegionHealthCheckServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest(); + if (object.healthCheckServiceResource != null) { + if (typeof object.healthCheckServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest.healthCheckServiceResource: object expected"); + message.healthCheckServiceResource = $root.google.cloud.compute.v1.HealthCheckService.fromObject(object.healthCheckServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest} message InsertRegionHealthCheckServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionHealthCheckServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.healthCheckServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheckServiceResource != null && message.hasOwnProperty("healthCheckServiceResource")) + object.healthCheckServiceResource = $root.google.cloud.compute.v1.HealthCheckService.toObject(message.healthCheckServiceResource, options); + return object; + }; + + /** + * Converts this InsertRegionHealthCheckServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionHealthCheckServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionHealthCheckServiceRequest; + })(); + + v1.ListRegionHealthCheckServicesRequest = (function() { + + /** + * Properties of a ListRegionHealthCheckServicesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionHealthCheckServicesRequest + * @property {string|null} [filter] ListRegionHealthCheckServicesRequest filter + * @property {number|null} [maxResults] ListRegionHealthCheckServicesRequest maxResults + * @property {string|null} [orderBy] ListRegionHealthCheckServicesRequest orderBy + * @property {string|null} [pageToken] ListRegionHealthCheckServicesRequest pageToken + * @property {string|null} [project] ListRegionHealthCheckServicesRequest project + * @property {string|null} [region] ListRegionHealthCheckServicesRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionHealthCheckServicesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionHealthCheckServicesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionHealthCheckServicesRequest. + * @implements IListRegionHealthCheckServicesRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionHealthCheckServicesRequest=} [properties] Properties to set + */ + function ListRegionHealthCheckServicesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionHealthCheckServicesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + ListRegionHealthCheckServicesRequest.prototype.filter = null; + + /** + * ListRegionHealthCheckServicesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + ListRegionHealthCheckServicesRequest.prototype.maxResults = null; + + /** + * ListRegionHealthCheckServicesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + ListRegionHealthCheckServicesRequest.prototype.orderBy = null; + + /** + * ListRegionHealthCheckServicesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + ListRegionHealthCheckServicesRequest.prototype.pageToken = null; + + /** + * ListRegionHealthCheckServicesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + ListRegionHealthCheckServicesRequest.prototype.project = ""; + + /** + * ListRegionHealthCheckServicesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + ListRegionHealthCheckServicesRequest.prototype.region = ""; + + /** + * ListRegionHealthCheckServicesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + ListRegionHealthCheckServicesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionHealthCheckServicesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + Object.defineProperty(ListRegionHealthCheckServicesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthCheckServicesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + Object.defineProperty(ListRegionHealthCheckServicesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthCheckServicesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + Object.defineProperty(ListRegionHealthCheckServicesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthCheckServicesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + Object.defineProperty(ListRegionHealthCheckServicesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthCheckServicesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + */ + Object.defineProperty(ListRegionHealthCheckServicesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionHealthCheckServicesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionHealthCheckServicesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionHealthCheckServicesRequest} ListRegionHealthCheckServicesRequest instance + */ + ListRegionHealthCheckServicesRequest.create = function create(properties) { + return new ListRegionHealthCheckServicesRequest(properties); + }; + + /** + * Encodes the specified ListRegionHealthCheckServicesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthCheckServicesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionHealthCheckServicesRequest} message ListRegionHealthCheckServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionHealthCheckServicesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionHealthCheckServicesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthCheckServicesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionHealthCheckServicesRequest} message ListRegionHealthCheckServicesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionHealthCheckServicesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionHealthCheckServicesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionHealthCheckServicesRequest} ListRegionHealthCheckServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionHealthCheckServicesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionHealthCheckServicesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionHealthCheckServicesRequest} ListRegionHealthCheckServicesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionHealthCheckServicesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionHealthCheckServicesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionHealthCheckServicesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionHealthCheckServicesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionHealthCheckServicesRequest} ListRegionHealthCheckServicesRequest + */ + ListRegionHealthCheckServicesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionHealthCheckServicesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @static + * @param {google.cloud.compute.v1.ListRegionHealthCheckServicesRequest} message ListRegionHealthCheckServicesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionHealthCheckServicesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionHealthCheckServicesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionHealthCheckServicesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionHealthCheckServicesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionHealthCheckServicesRequest; + })(); + + v1.PatchRegionHealthCheckServiceRequest = (function() { + + /** + * Properties of a PatchRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRegionHealthCheckServiceRequest + * @property {string|null} [healthCheckService] PatchRegionHealthCheckServiceRequest healthCheckService + * @property {google.cloud.compute.v1.IHealthCheckService|null} [healthCheckServiceResource] PatchRegionHealthCheckServiceRequest healthCheckServiceResource + * @property {string|null} [project] PatchRegionHealthCheckServiceRequest project + * @property {string|null} [region] PatchRegionHealthCheckServiceRequest region + * @property {string|null} [requestId] PatchRegionHealthCheckServiceRequest requestId + */ + + /** + * Constructs a new PatchRegionHealthCheckServiceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRegionHealthCheckServiceRequest. + * @implements IPatchRegionHealthCheckServiceRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest=} [properties] Properties to set + */ + function PatchRegionHealthCheckServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRegionHealthCheckServiceRequest healthCheckService. + * @member {string} healthCheckService + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @instance + */ + PatchRegionHealthCheckServiceRequest.prototype.healthCheckService = ""; + + /** + * PatchRegionHealthCheckServiceRequest healthCheckServiceResource. + * @member {google.cloud.compute.v1.IHealthCheckService|null|undefined} healthCheckServiceResource + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @instance + */ + PatchRegionHealthCheckServiceRequest.prototype.healthCheckServiceResource = null; + + /** + * PatchRegionHealthCheckServiceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @instance + */ + PatchRegionHealthCheckServiceRequest.prototype.project = ""; + + /** + * PatchRegionHealthCheckServiceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @instance + */ + PatchRegionHealthCheckServiceRequest.prototype.region = ""; + + /** + * PatchRegionHealthCheckServiceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @instance + */ + PatchRegionHealthCheckServiceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRegionHealthCheckServiceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @instance + */ + Object.defineProperty(PatchRegionHealthCheckServiceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRegionHealthCheckServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest} PatchRegionHealthCheckServiceRequest instance + */ + PatchRegionHealthCheckServiceRequest.create = function create(properties) { + return new PatchRegionHealthCheckServiceRequest(properties); + }; + + /** + * Encodes the specified PatchRegionHealthCheckServiceRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest} message PatchRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionHealthCheckServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheckService != null && Object.hasOwnProperty.call(message, "healthCheckService")) + writer.uint32(/* id 408374747, wireType 2 =*/3266997978).string(message.healthCheckService); + if (message.healthCheckServiceResource != null && Object.hasOwnProperty.call(message, "healthCheckServiceResource")) + $root.google.cloud.compute.v1.HealthCheckService.encode(message.healthCheckServiceResource, writer.uint32(/* id 477367794, wireType 2 =*/3818942354).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchRegionHealthCheckServiceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest} message PatchRegionHealthCheckServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionHealthCheckServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRegionHealthCheckServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest} PatchRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionHealthCheckServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 408374747: + message.healthCheckService = reader.string(); + break; + case 477367794: + message.healthCheckServiceResource = $root.google.cloud.compute.v1.HealthCheckService.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRegionHealthCheckServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest} PatchRegionHealthCheckServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionHealthCheckServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRegionHealthCheckServiceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRegionHealthCheckServiceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) + if (!$util.isString(message.healthCheckService)) + return "healthCheckService: string expected"; + if (message.healthCheckServiceResource != null && message.hasOwnProperty("healthCheckServiceResource")) { + var error = $root.google.cloud.compute.v1.HealthCheckService.verify(message.healthCheckServiceResource); + if (error) + return "healthCheckServiceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchRegionHealthCheckServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest} PatchRegionHealthCheckServiceRequest + */ + PatchRegionHealthCheckServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest(); + if (object.healthCheckService != null) + message.healthCheckService = String(object.healthCheckService); + if (object.healthCheckServiceResource != null) { + if (typeof object.healthCheckServiceResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest.healthCheckServiceResource: object expected"); + message.healthCheckServiceResource = $root.google.cloud.compute.v1.HealthCheckService.fromObject(object.healthCheckServiceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchRegionHealthCheckServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @static + * @param {google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest} message PatchRegionHealthCheckServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRegionHealthCheckServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.healthCheckService = ""; + object.healthCheckServiceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheckService != null && message.hasOwnProperty("healthCheckService")) + object.healthCheckService = message.healthCheckService; + if (message.healthCheckServiceResource != null && message.hasOwnProperty("healthCheckServiceResource")) + object.healthCheckServiceResource = $root.google.cloud.compute.v1.HealthCheckService.toObject(message.healthCheckServiceResource, options); + return object; + }; + + /** + * Converts this PatchRegionHealthCheckServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRegionHealthCheckServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRegionHealthCheckServiceRequest; + })(); + + v1.DeleteRegionHealthCheckRequest = (function() { + + /** + * Properties of a DeleteRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionHealthCheckRequest + * @property {string|null} [healthCheck] DeleteRegionHealthCheckRequest healthCheck + * @property {string|null} [project] DeleteRegionHealthCheckRequest project + * @property {string|null} [region] DeleteRegionHealthCheckRequest region + * @property {string|null} [requestId] DeleteRegionHealthCheckRequest requestId + */ + + /** + * Constructs a new DeleteRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionHealthCheckRequest. + * @implements IDeleteRegionHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckRequest=} [properties] Properties to set + */ + function DeleteRegionHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @instance + */ + DeleteRegionHealthCheckRequest.prototype.healthCheck = ""; + + /** + * DeleteRegionHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @instance + */ + DeleteRegionHealthCheckRequest.prototype.project = ""; + + /** + * DeleteRegionHealthCheckRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @instance + */ + DeleteRegionHealthCheckRequest.prototype.region = ""; + + /** + * DeleteRegionHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @instance + */ + DeleteRegionHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @instance + */ + Object.defineProperty(DeleteRegionHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckRequest} DeleteRegionHealthCheckRequest instance + */ + DeleteRegionHealthCheckRequest.create = function create(properties) { + return new DeleteRegionHealthCheckRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckRequest} message DeleteRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified DeleteRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckRequest} message DeleteRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckRequest} DeleteRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckRequest} DeleteRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionHealthCheckRequest} DeleteRegionHealthCheckRequest + */ + DeleteRegionHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionHealthCheckRequest} message DeleteRegionHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.healthCheck = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this DeleteRegionHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionHealthCheckRequest; + })(); + + v1.GetRegionHealthCheckRequest = (function() { + + /** + * Properties of a GetRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionHealthCheckRequest + * @property {string|null} [healthCheck] GetRegionHealthCheckRequest healthCheck + * @property {string|null} [project] GetRegionHealthCheckRequest project + * @property {string|null} [region] GetRegionHealthCheckRequest region + */ + + /** + * Constructs a new GetRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionHealthCheckRequest. + * @implements IGetRegionHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionHealthCheckRequest=} [properties] Properties to set + */ + function GetRegionHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @instance + */ + GetRegionHealthCheckRequest.prototype.healthCheck = ""; + + /** + * GetRegionHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @instance + */ + GetRegionHealthCheckRequest.prototype.project = ""; + + /** + * GetRegionHealthCheckRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @instance + */ + GetRegionHealthCheckRequest.prototype.region = ""; + + /** + * Creates a new GetRegionHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionHealthCheckRequest} GetRegionHealthCheckRequest instance + */ + GetRegionHealthCheckRequest.create = function create(properties) { + return new GetRegionHealthCheckRequest(properties); + }; + + /** + * Encodes the specified GetRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionHealthCheckRequest} message GetRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified GetRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionHealthCheckRequest} message GetRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionHealthCheckRequest} GetRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionHealthCheckRequest} GetRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionHealthCheckRequest} GetRegionHealthCheckRequest + */ + GetRegionHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.GetRegionHealthCheckRequest} message GetRegionHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.healthCheck = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this GetRegionHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionHealthCheckRequest; + })(); + + v1.InsertRegionHealthCheckRequest = (function() { + + /** + * Properties of an InsertRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionHealthCheckRequest + * @property {google.cloud.compute.v1.IHealthCheck|null} [healthCheckResource] InsertRegionHealthCheckRequest healthCheckResource + * @property {string|null} [project] InsertRegionHealthCheckRequest project + * @property {string|null} [region] InsertRegionHealthCheckRequest region + * @property {string|null} [requestId] InsertRegionHealthCheckRequest requestId + */ + + /** + * Constructs a new InsertRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionHealthCheckRequest. + * @implements IInsertRegionHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckRequest=} [properties] Properties to set + */ + function InsertRegionHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionHealthCheckRequest healthCheckResource. + * @member {google.cloud.compute.v1.IHealthCheck|null|undefined} healthCheckResource + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @instance + */ + InsertRegionHealthCheckRequest.prototype.healthCheckResource = null; + + /** + * InsertRegionHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @instance + */ + InsertRegionHealthCheckRequest.prototype.project = ""; + + /** + * InsertRegionHealthCheckRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @instance + */ + InsertRegionHealthCheckRequest.prototype.region = ""; + + /** + * InsertRegionHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @instance + */ + InsertRegionHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @instance + */ + Object.defineProperty(InsertRegionHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckRequest} InsertRegionHealthCheckRequest instance + */ + InsertRegionHealthCheckRequest.create = function create(properties) { + return new InsertRegionHealthCheckRequest(properties); + }; + + /** + * Encodes the specified InsertRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckRequest} message InsertRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.healthCheckResource != null && Object.hasOwnProperty.call(message, "healthCheckResource")) + $root.google.cloud.compute.v1.HealthCheck.encode(message.healthCheckResource, writer.uint32(/* id 201925032, wireType 2 =*/1615400258).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckRequest} message InsertRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckRequest} InsertRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 201925032: + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckRequest} InsertRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.healthCheckResource); + if (error) + return "healthCheckResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionHealthCheckRequest} InsertRegionHealthCheckRequest + */ + InsertRegionHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionHealthCheckRequest(); + if (object.healthCheckResource != null) { + if (typeof object.healthCheckResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionHealthCheckRequest.healthCheckResource: object expected"); + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.healthCheckResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionHealthCheckRequest} message InsertRegionHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.healthCheckResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) + object.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.toObject(message.healthCheckResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRegionHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionHealthCheckRequest; + })(); + + v1.ListRegionHealthChecksRequest = (function() { + + /** + * Properties of a ListRegionHealthChecksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionHealthChecksRequest + * @property {string|null} [filter] ListRegionHealthChecksRequest filter + * @property {number|null} [maxResults] ListRegionHealthChecksRequest maxResults + * @property {string|null} [orderBy] ListRegionHealthChecksRequest orderBy + * @property {string|null} [pageToken] ListRegionHealthChecksRequest pageToken + * @property {string|null} [project] ListRegionHealthChecksRequest project + * @property {string|null} [region] ListRegionHealthChecksRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionHealthChecksRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionHealthChecksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionHealthChecksRequest. + * @implements IListRegionHealthChecksRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionHealthChecksRequest=} [properties] Properties to set + */ + function ListRegionHealthChecksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionHealthChecksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + ListRegionHealthChecksRequest.prototype.filter = null; + + /** + * ListRegionHealthChecksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + ListRegionHealthChecksRequest.prototype.maxResults = null; + + /** + * ListRegionHealthChecksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + ListRegionHealthChecksRequest.prototype.orderBy = null; + + /** + * ListRegionHealthChecksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + ListRegionHealthChecksRequest.prototype.pageToken = null; + + /** + * ListRegionHealthChecksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + ListRegionHealthChecksRequest.prototype.project = ""; + + /** + * ListRegionHealthChecksRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + ListRegionHealthChecksRequest.prototype.region = ""; + + /** + * ListRegionHealthChecksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + ListRegionHealthChecksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionHealthChecksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + Object.defineProperty(ListRegionHealthChecksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthChecksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + Object.defineProperty(ListRegionHealthChecksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthChecksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + Object.defineProperty(ListRegionHealthChecksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthChecksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + Object.defineProperty(ListRegionHealthChecksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionHealthChecksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + */ + Object.defineProperty(ListRegionHealthChecksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionHealthChecksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IListRegionHealthChecksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionHealthChecksRequest} ListRegionHealthChecksRequest instance + */ + ListRegionHealthChecksRequest.create = function create(properties) { + return new ListRegionHealthChecksRequest(properties); + }; + + /** + * Encodes the specified ListRegionHealthChecksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthChecksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IListRegionHealthChecksRequest} message ListRegionHealthChecksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionHealthChecksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionHealthChecksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionHealthChecksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.IListRegionHealthChecksRequest} message ListRegionHealthChecksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionHealthChecksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionHealthChecksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionHealthChecksRequest} ListRegionHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionHealthChecksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionHealthChecksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionHealthChecksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionHealthChecksRequest} ListRegionHealthChecksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionHealthChecksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionHealthChecksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionHealthChecksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionHealthChecksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionHealthChecksRequest} ListRegionHealthChecksRequest + */ + ListRegionHealthChecksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionHealthChecksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionHealthChecksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionHealthChecksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @static + * @param {google.cloud.compute.v1.ListRegionHealthChecksRequest} message ListRegionHealthChecksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionHealthChecksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionHealthChecksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionHealthChecksRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionHealthChecksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionHealthChecksRequest; + })(); + + v1.PatchRegionHealthCheckRequest = (function() { + + /** + * Properties of a PatchRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRegionHealthCheckRequest + * @property {string|null} [healthCheck] PatchRegionHealthCheckRequest healthCheck + * @property {google.cloud.compute.v1.IHealthCheck|null} [healthCheckResource] PatchRegionHealthCheckRequest healthCheckResource + * @property {string|null} [project] PatchRegionHealthCheckRequest project + * @property {string|null} [region] PatchRegionHealthCheckRequest region + * @property {string|null} [requestId] PatchRegionHealthCheckRequest requestId + */ + + /** + * Constructs a new PatchRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRegionHealthCheckRequest. + * @implements IPatchRegionHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckRequest=} [properties] Properties to set + */ + function PatchRegionHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRegionHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @instance + */ + PatchRegionHealthCheckRequest.prototype.healthCheck = ""; + + /** + * PatchRegionHealthCheckRequest healthCheckResource. + * @member {google.cloud.compute.v1.IHealthCheck|null|undefined} healthCheckResource + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @instance + */ + PatchRegionHealthCheckRequest.prototype.healthCheckResource = null; + + /** + * PatchRegionHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @instance + */ + PatchRegionHealthCheckRequest.prototype.project = ""; + + /** + * PatchRegionHealthCheckRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @instance + */ + PatchRegionHealthCheckRequest.prototype.region = ""; + + /** + * PatchRegionHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @instance + */ + PatchRegionHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRegionHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @instance + */ + Object.defineProperty(PatchRegionHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRegionHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckRequest} PatchRegionHealthCheckRequest instance + */ + PatchRegionHealthCheckRequest.create = function create(properties) { + return new PatchRegionHealthCheckRequest(properties); + }; + + /** + * Encodes the specified PatchRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckRequest} message PatchRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.healthCheckResource != null && Object.hasOwnProperty.call(message, "healthCheckResource")) + $root.google.cloud.compute.v1.HealthCheck.encode(message.healthCheckResource, writer.uint32(/* id 201925032, wireType 2 =*/1615400258).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified PatchRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckRequest} message PatchRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRegionHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckRequest} PatchRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRegionHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 201925032: + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckRequest} PatchRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRegionHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRegionHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.healthCheckResource); + if (error) + return "healthCheckResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRegionHealthCheckRequest} PatchRegionHealthCheckRequest + */ + PatchRegionHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRegionHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRegionHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.healthCheckResource != null) { + if (typeof object.healthCheckResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRegionHealthCheckRequest.healthCheckResource: object expected"); + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.healthCheckResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchRegionHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.PatchRegionHealthCheckRequest} message PatchRegionHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRegionHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.healthCheckResource = null; + object.project = ""; + object.healthCheck = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) + object.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.toObject(message.healthCheckResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this PatchRegionHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRegionHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRegionHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRegionHealthCheckRequest; + })(); + + v1.UpdateRegionHealthCheckRequest = (function() { + + /** + * Properties of an UpdateRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateRegionHealthCheckRequest + * @property {string|null} [healthCheck] UpdateRegionHealthCheckRequest healthCheck + * @property {google.cloud.compute.v1.IHealthCheck|null} [healthCheckResource] UpdateRegionHealthCheckRequest healthCheckResource + * @property {string|null} [project] UpdateRegionHealthCheckRequest project + * @property {string|null} [region] UpdateRegionHealthCheckRequest region + * @property {string|null} [requestId] UpdateRegionHealthCheckRequest requestId + */ + + /** + * Constructs a new UpdateRegionHealthCheckRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateRegionHealthCheckRequest. + * @implements IUpdateRegionHealthCheckRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateRegionHealthCheckRequest=} [properties] Properties to set + */ + function UpdateRegionHealthCheckRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRegionHealthCheckRequest healthCheck. + * @member {string} healthCheck + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @instance + */ + UpdateRegionHealthCheckRequest.prototype.healthCheck = ""; + + /** + * UpdateRegionHealthCheckRequest healthCheckResource. + * @member {google.cloud.compute.v1.IHealthCheck|null|undefined} healthCheckResource + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @instance + */ + UpdateRegionHealthCheckRequest.prototype.healthCheckResource = null; + + /** + * UpdateRegionHealthCheckRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @instance + */ + UpdateRegionHealthCheckRequest.prototype.project = ""; + + /** + * UpdateRegionHealthCheckRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @instance + */ + UpdateRegionHealthCheckRequest.prototype.region = ""; + + /** + * UpdateRegionHealthCheckRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @instance + */ + UpdateRegionHealthCheckRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateRegionHealthCheckRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @instance + */ + Object.defineProperty(UpdateRegionHealthCheckRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateRegionHealthCheckRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionHealthCheckRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateRegionHealthCheckRequest} UpdateRegionHealthCheckRequest instance + */ + UpdateRegionHealthCheckRequest.create = function create(properties) { + return new UpdateRegionHealthCheckRequest(properties); + }; + + /** + * Encodes the specified UpdateRegionHealthCheckRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionHealthCheckRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionHealthCheckRequest} message UpdateRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionHealthCheckRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.healthCheckResource != null && Object.hasOwnProperty.call(message, "healthCheckResource")) + $root.google.cloud.compute.v1.HealthCheck.encode(message.healthCheckResource, writer.uint32(/* id 201925032, wireType 2 =*/1615400258).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.healthCheck != null && Object.hasOwnProperty.call(message, "healthCheck")) + writer.uint32(/* id 308876645, wireType 2 =*/2471013162).string(message.healthCheck); + return writer; + }; + + /** + * Encodes the specified UpdateRegionHealthCheckRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionHealthCheckRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionHealthCheckRequest} message UpdateRegionHealthCheckRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionHealthCheckRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRegionHealthCheckRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateRegionHealthCheckRequest} UpdateRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionHealthCheckRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateRegionHealthCheckRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 308876645: + message.healthCheck = reader.string(); + break; + case 201925032: + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRegionHealthCheckRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateRegionHealthCheckRequest} UpdateRegionHealthCheckRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionHealthCheckRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRegionHealthCheckRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRegionHealthCheckRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + if (!$util.isString(message.healthCheck)) + return "healthCheck: string expected"; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) { + var error = $root.google.cloud.compute.v1.HealthCheck.verify(message.healthCheckResource); + if (error) + return "healthCheckResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdateRegionHealthCheckRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateRegionHealthCheckRequest} UpdateRegionHealthCheckRequest + */ + UpdateRegionHealthCheckRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateRegionHealthCheckRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateRegionHealthCheckRequest(); + if (object.healthCheck != null) + message.healthCheck = String(object.healthCheck); + if (object.healthCheckResource != null) { + if (typeof object.healthCheckResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateRegionHealthCheckRequest.healthCheckResource: object expected"); + message.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.fromObject(object.healthCheckResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateRegionHealthCheckRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @static + * @param {google.cloud.compute.v1.UpdateRegionHealthCheckRequest} message UpdateRegionHealthCheckRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRegionHealthCheckRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.healthCheckResource = null; + object.project = ""; + object.healthCheck = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.healthCheckResource != null && message.hasOwnProperty("healthCheckResource")) + object.healthCheckResource = $root.google.cloud.compute.v1.HealthCheck.toObject(message.healthCheckResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.healthCheck != null && message.hasOwnProperty("healthCheck")) + object.healthCheck = message.healthCheck; + return object; + }; + + /** + * Converts this UpdateRegionHealthCheckRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateRegionHealthCheckRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRegionHealthCheckRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateRegionHealthCheckRequest; + })(); + + v1.AbandonInstancesRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of an AbandonInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IAbandonInstancesRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] AbandonInstancesRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] AbandonInstancesRegionInstanceGroupManagerRequest project + * @property {string|null} [region] AbandonInstancesRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest|null} [regionInstanceGroupManagersAbandonInstancesRequestResource] AbandonInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersAbandonInstancesRequestResource + * @property {string|null} [requestId] AbandonInstancesRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new AbandonInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AbandonInstancesRegionInstanceGroupManagerRequest. + * @implements IAbandonInstancesRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function AbandonInstancesRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AbandonInstancesRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * AbandonInstancesRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * AbandonInstancesRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * AbandonInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersAbandonInstancesRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagersAbandonInstancesRequest|null|undefined} regionInstanceGroupManagersAbandonInstancesRequestResource + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagersAbandonInstancesRequestResource = null; + + /** + * AbandonInstancesRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @instance + */ + AbandonInstancesRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AbandonInstancesRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(AbandonInstancesRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AbandonInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest} AbandonInstancesRegionInstanceGroupManagerRequest instance + */ + AbandonInstancesRegionInstanceGroupManagerRequest.create = function create(properties) { + return new AbandonInstancesRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified AbandonInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest} message AbandonInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonInstancesRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.regionInstanceGroupManagersAbandonInstancesRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagersAbandonInstancesRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.encode(message.regionInstanceGroupManagersAbandonInstancesRequestResource, writer.uint32(/* id 488499491, wireType 2 =*/3907995930).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AbandonInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest} message AbandonInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AbandonInstancesRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AbandonInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest} AbandonInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonInstancesRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 488499491: + message.regionInstanceGroupManagersAbandonInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AbandonInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest} AbandonInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AbandonInstancesRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AbandonInstancesRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AbandonInstancesRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagersAbandonInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersAbandonInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.verify(message.regionInstanceGroupManagersAbandonInstancesRequestResource); + if (error) + return "regionInstanceGroupManagersAbandonInstancesRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an AbandonInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest} AbandonInstancesRegionInstanceGroupManagerRequest + */ + AbandonInstancesRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagersAbandonInstancesRequestResource != null) { + if (typeof object.regionInstanceGroupManagersAbandonInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest.regionInstanceGroupManagersAbandonInstancesRequestResource: object expected"); + message.regionInstanceGroupManagersAbandonInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.fromObject(object.regionInstanceGroupManagersAbandonInstancesRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AbandonInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest} message AbandonInstancesRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AbandonInstancesRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.regionInstanceGroupManagersAbandonInstancesRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.regionInstanceGroupManagersAbandonInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersAbandonInstancesRequestResource")) + object.regionInstanceGroupManagersAbandonInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest.toObject(message.regionInstanceGroupManagersAbandonInstancesRequestResource, options); + return object; + }; + + /** + * Converts this AbandonInstancesRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + AbandonInstancesRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AbandonInstancesRegionInstanceGroupManagerRequest; + })(); + + v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest project + * @property {string|null} [region] ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest|null} [regionInstanceGroupManagersApplyUpdatesRequestResource] ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersApplyUpdatesRequestResource + */ + + /** + * Constructs a new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest. + * @implements IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersApplyUpdatesRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagersApplyUpdatesRequest|null|undefined} regionInstanceGroupManagersApplyUpdatesRequestResource + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @instance + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagersApplyUpdatesRequestResource = null; + + /** + * Creates a new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest instance + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.create = function create(properties) { + return new ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} message ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionInstanceGroupManagersApplyUpdatesRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagersApplyUpdatesRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.encode(message.regionInstanceGroupManagersApplyUpdatesRequestResource, writer.uint32(/* id 76248318, wireType 2 =*/609986546).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} message ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 76248318: + message.regionInstanceGroupManagersApplyUpdatesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagersApplyUpdatesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersApplyUpdatesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.verify(message.regionInstanceGroupManagersApplyUpdatesRequestResource); + if (error) + return "regionInstanceGroupManagersApplyUpdatesRequestResource." + error; + } + return null; + }; + + /** + * Creates an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagersApplyUpdatesRequestResource != null) { + if (typeof object.regionInstanceGroupManagersApplyUpdatesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.regionInstanceGroupManagersApplyUpdatesRequestResource: object expected"); + message.regionInstanceGroupManagersApplyUpdatesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.fromObject(object.regionInstanceGroupManagersApplyUpdatesRequestResource); + } + return message; + }; + + /** + * Creates a plain object from an ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} message ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionInstanceGroupManagersApplyUpdatesRequestResource = null; + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.regionInstanceGroupManagersApplyUpdatesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersApplyUpdatesRequestResource")) + object.regionInstanceGroupManagersApplyUpdatesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest.toObject(message.regionInstanceGroupManagersApplyUpdatesRequestResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest; + })(); + + v1.CreateInstancesRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a CreateInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface ICreateInstancesRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] CreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] CreateInstancesRegionInstanceGroupManagerRequest project + * @property {string|null} [region] CreateInstancesRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest|null} [regionInstanceGroupManagersCreateInstancesRequestResource] CreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersCreateInstancesRequestResource + * @property {string|null} [requestId] CreateInstancesRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new CreateInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a CreateInstancesRegionInstanceGroupManagerRequest. + * @implements ICreateInstancesRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function CreateInstancesRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + CreateInstancesRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * CreateInstancesRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + CreateInstancesRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * CreateInstancesRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + CreateInstancesRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * CreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersCreateInstancesRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagersCreateInstancesRequest|null|undefined} regionInstanceGroupManagersCreateInstancesRequestResource + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + CreateInstancesRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagersCreateInstancesRequestResource = null; + + /** + * CreateInstancesRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + CreateInstancesRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateInstancesRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(CreateInstancesRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest} CreateInstancesRegionInstanceGroupManagerRequest instance + */ + CreateInstancesRegionInstanceGroupManagerRequest.create = function create(properties) { + return new CreateInstancesRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified CreateInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest} message CreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancesRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.regionInstanceGroupManagersCreateInstancesRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagersCreateInstancesRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.encode(message.regionInstanceGroupManagersCreateInstancesRequestResource, writer.uint32(/* id 359014280, wireType 2 =*/2872114242).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest} message CreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstancesRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest} CreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancesRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 359014280: + message.regionInstanceGroupManagersCreateInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest} CreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstancesRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstancesRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstancesRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagersCreateInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersCreateInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.verify(message.regionInstanceGroupManagersCreateInstancesRequestResource); + if (error) + return "regionInstanceGroupManagersCreateInstancesRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a CreateInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest} CreateInstancesRegionInstanceGroupManagerRequest + */ + CreateInstancesRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagersCreateInstancesRequestResource != null) { + if (typeof object.regionInstanceGroupManagersCreateInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest.regionInstanceGroupManagersCreateInstancesRequestResource: object expected"); + message.regionInstanceGroupManagersCreateInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.fromObject(object.regionInstanceGroupManagersCreateInstancesRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest} message CreateInstancesRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstancesRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.regionInstanceGroupManagersCreateInstancesRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.regionInstanceGroupManagersCreateInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersCreateInstancesRequestResource")) + object.regionInstanceGroupManagersCreateInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest.toObject(message.regionInstanceGroupManagersCreateInstancesRequestResource, options); + return object; + }; + + /** + * Converts this CreateInstancesRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstancesRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstancesRegionInstanceGroupManagerRequest; + })(); + + v1.DeleteRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a DeleteRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] DeleteRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] DeleteRegionInstanceGroupManagerRequest project + * @property {string|null} [region] DeleteRegionInstanceGroupManagerRequest region + * @property {string|null} [requestId] DeleteRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new DeleteRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionInstanceGroupManagerRequest. + * @implements IDeleteRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function DeleteRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @instance + */ + DeleteRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * DeleteRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @instance + */ + DeleteRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * DeleteRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @instance + */ + DeleteRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * DeleteRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @instance + */ + DeleteRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(DeleteRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest} DeleteRegionInstanceGroupManagerRequest instance + */ + DeleteRegionInstanceGroupManagerRequest.create = function create(properties) { + return new DeleteRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest} message DeleteRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified DeleteRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest} message DeleteRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest} DeleteRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest} DeleteRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest} DeleteRegionInstanceGroupManagerRequest + */ + DeleteRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest} message DeleteRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this DeleteRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionInstanceGroupManagerRequest; + })(); + + v1.DeleteInstancesRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a DeleteInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteInstancesRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] DeleteInstancesRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] DeleteInstancesRegionInstanceGroupManagerRequest project + * @property {string|null} [region] DeleteInstancesRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest|null} [regionInstanceGroupManagersDeleteInstancesRequestResource] DeleteInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersDeleteInstancesRequestResource + * @property {string|null} [requestId] DeleteInstancesRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new DeleteInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteInstancesRegionInstanceGroupManagerRequest. + * @implements IDeleteInstancesRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function DeleteInstancesRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstancesRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * DeleteInstancesRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * DeleteInstancesRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * DeleteInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersDeleteInstancesRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagersDeleteInstancesRequest|null|undefined} regionInstanceGroupManagersDeleteInstancesRequestResource + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagersDeleteInstancesRequestResource = null; + + /** + * DeleteInstancesRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @instance + */ + DeleteInstancesRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteInstancesRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(DeleteInstancesRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest} DeleteInstancesRegionInstanceGroupManagerRequest instance + */ + DeleteInstancesRegionInstanceGroupManagerRequest.create = function create(properties) { + return new DeleteInstancesRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified DeleteInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest} message DeleteInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancesRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.regionInstanceGroupManagersDeleteInstancesRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagersDeleteInstancesRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.encode(message.regionInstanceGroupManagersDeleteInstancesRequestResource, writer.uint32(/* id 500876665, wireType 2 =*/4007013322).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest} message DeleteInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstancesRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest} DeleteInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancesRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 500876665: + message.regionInstanceGroupManagersDeleteInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest} DeleteInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstancesRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstancesRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstancesRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagersDeleteInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersDeleteInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.verify(message.regionInstanceGroupManagersDeleteInstancesRequestResource); + if (error) + return "regionInstanceGroupManagersDeleteInstancesRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest} DeleteInstancesRegionInstanceGroupManagerRequest + */ + DeleteInstancesRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagersDeleteInstancesRequestResource != null) { + if (typeof object.regionInstanceGroupManagersDeleteInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest.regionInstanceGroupManagersDeleteInstancesRequestResource: object expected"); + message.regionInstanceGroupManagersDeleteInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.fromObject(object.regionInstanceGroupManagersDeleteInstancesRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest} message DeleteInstancesRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstancesRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.regionInstanceGroupManagersDeleteInstancesRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.regionInstanceGroupManagersDeleteInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersDeleteInstancesRequestResource")) + object.regionInstanceGroupManagersDeleteInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest.toObject(message.regionInstanceGroupManagersDeleteInstancesRequestResource, options); + return object; + }; + + /** + * Converts this DeleteInstancesRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstancesRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstancesRegionInstanceGroupManagerRequest; + })(); + + v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] DeletePerInstanceConfigsRegionInstanceGroupManagerRequest project + * @property {string|null} [region] DeletePerInstanceConfigsRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq|null} [regionInstanceGroupManagerDeleteInstanceConfigReqResource] DeletePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerDeleteInstanceConfigReqResource + */ + + /** + * Constructs a new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @implements IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function DeletePerInstanceConfigsRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * DeletePerInstanceConfigsRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * DeletePerInstanceConfigsRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * DeletePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerDeleteInstanceConfigReqResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagerDeleteInstanceConfigReq|null|undefined} regionInstanceGroupManagerDeleteInstanceConfigReqResource + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagerDeleteInstanceConfigReqResource = null; + + /** + * Creates a new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest} DeletePerInstanceConfigsRegionInstanceGroupManagerRequest instance + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.create = function create(properties) { + return new DeletePerInstanceConfigsRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest} message DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionInstanceGroupManagerDeleteInstanceConfigReqResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagerDeleteInstanceConfigReqResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.encode(message.regionInstanceGroupManagerDeleteInstanceConfigReqResource, writer.uint32(/* id 740741, wireType 2 =*/5925930).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest} message DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest} DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 740741: + message.regionInstanceGroupManagerDeleteInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest} DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagerDeleteInstanceConfigReqResource != null && message.hasOwnProperty("regionInstanceGroupManagerDeleteInstanceConfigReqResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.verify(message.regionInstanceGroupManagerDeleteInstanceConfigReqResource); + if (error) + return "regionInstanceGroupManagerDeleteInstanceConfigReqResource." + error; + } + return null; + }; + + /** + * Creates a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest} DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagerDeleteInstanceConfigReqResource != null) { + if (typeof object.regionInstanceGroupManagerDeleteInstanceConfigReqResource !== "object") + throw TypeError(".google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.regionInstanceGroupManagerDeleteInstanceConfigReqResource: object expected"); + message.regionInstanceGroupManagerDeleteInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.fromObject(object.regionInstanceGroupManagerDeleteInstanceConfigReqResource); + } + return message; + }; + + /** + * Creates a plain object from a DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest} message DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionInstanceGroupManagerDeleteInstanceConfigReqResource = null; + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.regionInstanceGroupManagerDeleteInstanceConfigReqResource != null && message.hasOwnProperty("regionInstanceGroupManagerDeleteInstanceConfigReqResource")) + object.regionInstanceGroupManagerDeleteInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq.toObject(message.regionInstanceGroupManagerDeleteInstanceConfigReqResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this DeletePerInstanceConfigsRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeletePerInstanceConfigsRegionInstanceGroupManagerRequest; + })(); + + v1.GetRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a GetRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] GetRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] GetRegionInstanceGroupManagerRequest project + * @property {string|null} [region] GetRegionInstanceGroupManagerRequest region + */ + + /** + * Constructs a new GetRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionInstanceGroupManagerRequest. + * @implements IGetRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function GetRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @instance + */ + GetRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * GetRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @instance + */ + GetRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * GetRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @instance + */ + GetRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * Creates a new GetRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest} GetRegionInstanceGroupManagerRequest instance + */ + GetRegionInstanceGroupManagerRequest.create = function create(properties) { + return new GetRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified GetRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest} message GetRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified GetRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest} message GetRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest} GetRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest} GetRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest} GetRegionInstanceGroupManagerRequest + */ + GetRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest} message GetRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this GetRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionInstanceGroupManagerRequest; + })(); + + v1.InsertRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of an InsertRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionInstanceGroupManagerRequest + * @property {google.cloud.compute.v1.IInstanceGroupManager|null} [instanceGroupManagerResource] InsertRegionInstanceGroupManagerRequest instanceGroupManagerResource + * @property {string|null} [project] InsertRegionInstanceGroupManagerRequest project + * @property {string|null} [region] InsertRegionInstanceGroupManagerRequest region + * @property {string|null} [requestId] InsertRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new InsertRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionInstanceGroupManagerRequest. + * @implements IInsertRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function InsertRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionInstanceGroupManagerRequest instanceGroupManagerResource. + * @member {google.cloud.compute.v1.IInstanceGroupManager|null|undefined} instanceGroupManagerResource + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @instance + */ + InsertRegionInstanceGroupManagerRequest.prototype.instanceGroupManagerResource = null; + + /** + * InsertRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @instance + */ + InsertRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * InsertRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @instance + */ + InsertRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * InsertRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @instance + */ + InsertRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(InsertRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest} InsertRegionInstanceGroupManagerRequest instance + */ + InsertRegionInstanceGroupManagerRequest.create = function create(properties) { + return new InsertRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified InsertRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest} message InsertRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManagerResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagerResource")) + $root.google.cloud.compute.v1.InstanceGroupManager.encode(message.instanceGroupManagerResource, writer.uint32(/* id 261063946, wireType 2 =*/2088511570).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest} message InsertRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest} InsertRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 261063946: + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest} InsertRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManager.verify(message.instanceGroupManagerResource); + if (error) + return "instanceGroupManagerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest} InsertRegionInstanceGroupManagerRequest + */ + InsertRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManagerResource != null) { + if (typeof object.instanceGroupManagerResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest.instanceGroupManagerResource: object expected"); + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.fromObject(object.instanceGroupManagerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest} message InsertRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManagerResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) + object.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.toObject(message.instanceGroupManagerResource, options); + return object; + }; + + /** + * Converts this InsertRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionInstanceGroupManagerRequest; + })(); + + v1.ListRegionInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionInstanceGroupManagersRequest + * @property {string|null} [filter] ListRegionInstanceGroupManagersRequest filter + * @property {number|null} [maxResults] ListRegionInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListRegionInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListRegionInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListRegionInstanceGroupManagersRequest project + * @property {string|null} [region] ListRegionInstanceGroupManagersRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionInstanceGroupManagersRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionInstanceGroupManagersRequest. + * @implements IListRegionInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListRegionInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + ListRegionInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListRegionInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + ListRegionInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListRegionInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + ListRegionInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListRegionInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + ListRegionInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListRegionInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + ListRegionInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListRegionInstanceGroupManagersRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + ListRegionInstanceGroupManagersRequest.prototype.region = ""; + + /** + * ListRegionInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + ListRegionInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest} ListRegionInstanceGroupManagersRequest instance + */ + ListRegionInstanceGroupManagersRequest.create = function create(properties) { + return new ListRegionInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest} message ListRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest} message ListRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest} ListRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest} ListRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest} ListRegionInstanceGroupManagersRequest + */ + ListRegionInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest} message ListRegionInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionInstanceGroupManagersRequest; + })(); + + v1.ListErrorsRegionInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListErrorsRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListErrorsRegionInstanceGroupManagersRequest + * @property {string|null} [filter] ListErrorsRegionInstanceGroupManagersRequest filter + * @property {string|null} [instanceGroupManager] ListErrorsRegionInstanceGroupManagersRequest instanceGroupManager + * @property {number|null} [maxResults] ListErrorsRegionInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListErrorsRegionInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListErrorsRegionInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListErrorsRegionInstanceGroupManagersRequest project + * @property {string|null} [region] ListErrorsRegionInstanceGroupManagersRequest region + * @property {boolean|null} [returnPartialSuccess] ListErrorsRegionInstanceGroupManagersRequest returnPartialSuccess + */ + + /** + * Constructs a new ListErrorsRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListErrorsRegionInstanceGroupManagersRequest. + * @implements IListErrorsRegionInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListErrorsRegionInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListErrorsRegionInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListErrorsRegionInstanceGroupManagersRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.instanceGroupManager = ""; + + /** + * ListErrorsRegionInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListErrorsRegionInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListErrorsRegionInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListErrorsRegionInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListErrorsRegionInstanceGroupManagersRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.region = ""; + + /** + * ListErrorsRegionInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListErrorsRegionInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsRegionInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsRegionInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsRegionInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsRegionInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsRegionInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsRegionInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsRegionInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListErrorsRegionInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListErrorsRegionInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListErrorsRegionInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest} ListErrorsRegionInstanceGroupManagersRequest instance + */ + ListErrorsRegionInstanceGroupManagersRequest.create = function create(properties) { + return new ListErrorsRegionInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListErrorsRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest} message ListErrorsRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListErrorsRegionInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListErrorsRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest} message ListErrorsRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListErrorsRegionInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListErrorsRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest} ListErrorsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListErrorsRegionInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListErrorsRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest} ListErrorsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListErrorsRegionInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListErrorsRegionInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListErrorsRegionInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListErrorsRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest} ListErrorsRegionInstanceGroupManagersRequest + */ + ListErrorsRegionInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListErrorsRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest} message ListErrorsRegionInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListErrorsRegionInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListErrorsRegionInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListErrorsRegionInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListErrorsRegionInstanceGroupManagersRequest; + })(); + + v1.ListManagedInstancesRegionInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListManagedInstancesRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListManagedInstancesRegionInstanceGroupManagersRequest + * @property {string|null} [filter] ListManagedInstancesRegionInstanceGroupManagersRequest filter + * @property {string|null} [instanceGroupManager] ListManagedInstancesRegionInstanceGroupManagersRequest instanceGroupManager + * @property {number|null} [maxResults] ListManagedInstancesRegionInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListManagedInstancesRegionInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListManagedInstancesRegionInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListManagedInstancesRegionInstanceGroupManagersRequest project + * @property {string|null} [region] ListManagedInstancesRegionInstanceGroupManagersRequest region + * @property {boolean|null} [returnPartialSuccess] ListManagedInstancesRegionInstanceGroupManagersRequest returnPartialSuccess + */ + + /** + * Constructs a new ListManagedInstancesRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListManagedInstancesRegionInstanceGroupManagersRequest. + * @implements IListManagedInstancesRegionInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListManagedInstancesRegionInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.instanceGroupManager = ""; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.region = ""; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesRegionInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesRegionInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesRegionInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesRegionInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListManagedInstancesRegionInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListManagedInstancesRegionInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListManagedInstancesRegionInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest} ListManagedInstancesRegionInstanceGroupManagersRequest instance + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.create = function create(properties) { + return new ListManagedInstancesRegionInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListManagedInstancesRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest} message ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListManagedInstancesRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest} message ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListManagedInstancesRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest} ListManagedInstancesRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListManagedInstancesRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest} ListManagedInstancesRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListManagedInstancesRegionInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListManagedInstancesRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest} ListManagedInstancesRegionInstanceGroupManagersRequest + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListManagedInstancesRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest} message ListManagedInstancesRegionInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListManagedInstancesRegionInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListManagedInstancesRegionInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListManagedInstancesRegionInstanceGroupManagersRequest; + })(); + + v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest = (function() { + + /** + * Properties of a ListPerInstanceConfigsRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @property {string|null} [filter] ListPerInstanceConfigsRegionInstanceGroupManagersRequest filter + * @property {string|null} [instanceGroupManager] ListPerInstanceConfigsRegionInstanceGroupManagersRequest instanceGroupManager + * @property {number|null} [maxResults] ListPerInstanceConfigsRegionInstanceGroupManagersRequest maxResults + * @property {string|null} [orderBy] ListPerInstanceConfigsRegionInstanceGroupManagersRequest orderBy + * @property {string|null} [pageToken] ListPerInstanceConfigsRegionInstanceGroupManagersRequest pageToken + * @property {string|null} [project] ListPerInstanceConfigsRegionInstanceGroupManagersRequest project + * @property {string|null} [region] ListPerInstanceConfigsRegionInstanceGroupManagersRequest region + * @property {boolean|null} [returnPartialSuccess] ListPerInstanceConfigsRegionInstanceGroupManagersRequest returnPartialSuccess + */ + + /** + * Constructs a new ListPerInstanceConfigsRegionInstanceGroupManagersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListPerInstanceConfigsRegionInstanceGroupManagersRequest. + * @implements IListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @constructor + * @param {google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest=} [properties] Properties to set + */ + function ListPerInstanceConfigsRegionInstanceGroupManagersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.filter = null; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.instanceGroupManager = ""; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.maxResults = null; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.orderBy = null; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.pageToken = null; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.project = ""; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.region = ""; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPerInstanceConfigsRegionInstanceGroupManagersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + */ + Object.defineProperty(ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPerInstanceConfigsRegionInstanceGroupManagersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest} ListPerInstanceConfigsRegionInstanceGroupManagersRequest instance + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.create = function create(properties) { + return new ListPerInstanceConfigsRegionInstanceGroupManagersRequest(properties); + }; + + /** + * Encodes the specified ListPerInstanceConfigsRegionInstanceGroupManagersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest} message ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListPerInstanceConfigsRegionInstanceGroupManagersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest} message ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest} ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest} ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest} ListPerInstanceConfigsRegionInstanceGroupManagersRequest + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListPerInstanceConfigsRegionInstanceGroupManagersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @static + * @param {google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest} message ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListPerInstanceConfigsRegionInstanceGroupManagersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest + * @instance + * @returns {Object.} JSON object + */ + ListPerInstanceConfigsRegionInstanceGroupManagersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPerInstanceConfigsRegionInstanceGroupManagersRequest; + })(); + + v1.PatchRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a PatchRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] PatchRegionInstanceGroupManagerRequest instanceGroupManager + * @property {google.cloud.compute.v1.IInstanceGroupManager|null} [instanceGroupManagerResource] PatchRegionInstanceGroupManagerRequest instanceGroupManagerResource + * @property {string|null} [project] PatchRegionInstanceGroupManagerRequest project + * @property {string|null} [region] PatchRegionInstanceGroupManagerRequest region + * @property {string|null} [requestId] PatchRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new PatchRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRegionInstanceGroupManagerRequest. + * @implements IPatchRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function PatchRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @instance + */ + PatchRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * PatchRegionInstanceGroupManagerRequest instanceGroupManagerResource. + * @member {google.cloud.compute.v1.IInstanceGroupManager|null|undefined} instanceGroupManagerResource + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @instance + */ + PatchRegionInstanceGroupManagerRequest.prototype.instanceGroupManagerResource = null; + + /** + * PatchRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @instance + */ + PatchRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * PatchRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @instance + */ + PatchRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * PatchRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @instance + */ + PatchRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(PatchRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest} PatchRegionInstanceGroupManagerRequest instance + */ + PatchRegionInstanceGroupManagerRequest.create = function create(properties) { + return new PatchRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified PatchRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest} message PatchRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + if (message.instanceGroupManagerResource != null && Object.hasOwnProperty.call(message, "instanceGroupManagerResource")) + $root.google.cloud.compute.v1.InstanceGroupManager.encode(message.instanceGroupManagerResource, writer.uint32(/* id 261063946, wireType 2 =*/2088511570).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest} message PatchRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest} PatchRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 261063946: + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest} PatchRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) { + var error = $root.google.cloud.compute.v1.InstanceGroupManager.verify(message.instanceGroupManagerResource); + if (error) + return "instanceGroupManagerResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest} PatchRegionInstanceGroupManagerRequest + */ + PatchRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.instanceGroupManagerResource != null) { + if (typeof object.instanceGroupManagerResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest.instanceGroupManagerResource: object expected"); + message.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.fromObject(object.instanceGroupManagerResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest} message PatchRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + object.instanceGroupManagerResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + if (message.instanceGroupManagerResource != null && message.hasOwnProperty("instanceGroupManagerResource")) + object.instanceGroupManagerResource = $root.google.cloud.compute.v1.InstanceGroupManager.toObject(message.instanceGroupManagerResource, options); + return object; + }; + + /** + * Converts this PatchRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRegionInstanceGroupManagerRequest; + })(); + + v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] PatchPerInstanceConfigsRegionInstanceGroupManagerRequest project + * @property {string|null} [region] PatchPerInstanceConfigsRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq|null} [regionInstanceGroupManagerPatchInstanceConfigReqResource] PatchPerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerPatchInstanceConfigReqResource + * @property {string|null} [requestId] PatchPerInstanceConfigsRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest. + * @implements IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function PatchPerInstanceConfigsRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * PatchPerInstanceConfigsRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * PatchPerInstanceConfigsRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * PatchPerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerPatchInstanceConfigReqResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagerPatchInstanceConfigReq|null|undefined} regionInstanceGroupManagerPatchInstanceConfigReqResource + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagerPatchInstanceConfigReqResource = null; + + /** + * PatchPerInstanceConfigsRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchPerInstanceConfigsRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest} PatchPerInstanceConfigsRegionInstanceGroupManagerRequest instance + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.create = function create(properties) { + return new PatchPerInstanceConfigsRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest} message PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.regionInstanceGroupManagerPatchInstanceConfigReqResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagerPatchInstanceConfigReqResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.encode(message.regionInstanceGroupManagerPatchInstanceConfigReqResource, writer.uint32(/* id 197682890, wireType 2 =*/1581463122).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest} message PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest} PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 197682890: + message.regionInstanceGroupManagerPatchInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest} PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagerPatchInstanceConfigReqResource != null && message.hasOwnProperty("regionInstanceGroupManagerPatchInstanceConfigReqResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.verify(message.regionInstanceGroupManagerPatchInstanceConfigReqResource); + if (error) + return "regionInstanceGroupManagerPatchInstanceConfigReqResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest} PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagerPatchInstanceConfigReqResource != null) { + if (typeof object.regionInstanceGroupManagerPatchInstanceConfigReqResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.regionInstanceGroupManagerPatchInstanceConfigReqResource: object expected"); + message.regionInstanceGroupManagerPatchInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.fromObject(object.regionInstanceGroupManagerPatchInstanceConfigReqResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest} message PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.regionInstanceGroupManagerPatchInstanceConfigReqResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.regionInstanceGroupManagerPatchInstanceConfigReqResource != null && message.hasOwnProperty("regionInstanceGroupManagerPatchInstanceConfigReqResource")) + object.regionInstanceGroupManagerPatchInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq.toObject(message.regionInstanceGroupManagerPatchInstanceConfigReqResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this PatchPerInstanceConfigsRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + PatchPerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchPerInstanceConfigsRegionInstanceGroupManagerRequest; + })(); + + v1.RecreateInstancesRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a RecreateInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IRecreateInstancesRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] RecreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] RecreateInstancesRegionInstanceGroupManagerRequest project + * @property {string|null} [region] RecreateInstancesRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest|null} [regionInstanceGroupManagersRecreateRequestResource] RecreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersRecreateRequestResource + * @property {string|null} [requestId] RecreateInstancesRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new RecreateInstancesRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RecreateInstancesRegionInstanceGroupManagerRequest. + * @implements IRecreateInstancesRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function RecreateInstancesRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecreateInstancesRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * RecreateInstancesRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * RecreateInstancesRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * RecreateInstancesRegionInstanceGroupManagerRequest regionInstanceGroupManagersRecreateRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagersRecreateRequest|null|undefined} regionInstanceGroupManagersRecreateRequestResource + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagersRecreateRequestResource = null; + + /** + * RecreateInstancesRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + RecreateInstancesRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RecreateInstancesRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(RecreateInstancesRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RecreateInstancesRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest} RecreateInstancesRegionInstanceGroupManagerRequest instance + */ + RecreateInstancesRegionInstanceGroupManagerRequest.create = function create(properties) { + return new RecreateInstancesRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified RecreateInstancesRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest} message RecreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecreateInstancesRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.regionInstanceGroupManagersRecreateRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagersRecreateRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.encode(message.regionInstanceGroupManagersRecreateRequestResource, writer.uint32(/* id 170999316, wireType 2 =*/1367994530).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified RecreateInstancesRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest} message RecreateInstancesRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecreateInstancesRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest} RecreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecreateInstancesRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 170999316: + message.regionInstanceGroupManagersRecreateRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecreateInstancesRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest} RecreateInstancesRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecreateInstancesRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecreateInstancesRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecreateInstancesRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagersRecreateRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersRecreateRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.verify(message.regionInstanceGroupManagersRecreateRequestResource); + if (error) + return "regionInstanceGroupManagersRecreateRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a RecreateInstancesRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest} RecreateInstancesRegionInstanceGroupManagerRequest + */ + RecreateInstancesRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagersRecreateRequestResource != null) { + if (typeof object.regionInstanceGroupManagersRecreateRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest.regionInstanceGroupManagersRecreateRequestResource: object expected"); + message.regionInstanceGroupManagersRecreateRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.fromObject(object.regionInstanceGroupManagersRecreateRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a RecreateInstancesRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest} message RecreateInstancesRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecreateInstancesRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.regionInstanceGroupManagersRecreateRequestResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.regionInstanceGroupManagersRecreateRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersRecreateRequestResource")) + object.regionInstanceGroupManagersRecreateRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest.toObject(message.regionInstanceGroupManagersRecreateRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this RecreateInstancesRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + RecreateInstancesRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RecreateInstancesRegionInstanceGroupManagerRequest; + })(); + + v1.ResizeRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a ResizeRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IResizeRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] ResizeRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] ResizeRegionInstanceGroupManagerRequest project + * @property {string|null} [region] ResizeRegionInstanceGroupManagerRequest region + * @property {string|null} [requestId] ResizeRegionInstanceGroupManagerRequest requestId + * @property {number|null} [size] ResizeRegionInstanceGroupManagerRequest size + */ + + /** + * Constructs a new ResizeRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResizeRegionInstanceGroupManagerRequest. + * @implements IResizeRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function ResizeRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResizeRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @instance + */ + ResizeRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * ResizeRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @instance + */ + ResizeRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * ResizeRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @instance + */ + ResizeRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * ResizeRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @instance + */ + ResizeRegionInstanceGroupManagerRequest.prototype.requestId = null; + + /** + * ResizeRegionInstanceGroupManagerRequest size. + * @member {number} size + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @instance + */ + ResizeRegionInstanceGroupManagerRequest.prototype.size = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResizeRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(ResizeRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResizeRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest} ResizeRegionInstanceGroupManagerRequest instance + */ + ResizeRegionInstanceGroupManagerRequest.create = function create(properties) { + return new ResizeRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified ResizeRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest} message ResizeRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 3530753, wireType 0 =*/28246024).int32(message.size); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified ResizeRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest} message ResizeRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResizeRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest} ResizeRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 3530753: + message.size = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResizeRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest} ResizeRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResizeRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResizeRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size)) + return "size: integer expected"; + return null; + }; + + /** + * Creates a ResizeRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest} ResizeRegionInstanceGroupManagerRequest + */ + ResizeRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.size != null) + message.size = object.size | 0; + return message; + }; + + /** + * Creates a plain object from a ResizeRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest} message ResizeRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResizeRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.size = 0; + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.size != null && message.hasOwnProperty("size")) + object.size = message.size; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this ResizeRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + ResizeRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResizeRegionInstanceGroupManagerRequest; + })(); + + v1.SetInstanceTemplateRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a SetInstanceTemplateRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetInstanceTemplateRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] SetInstanceTemplateRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] SetInstanceTemplateRegionInstanceGroupManagerRequest project + * @property {string|null} [region] SetInstanceTemplateRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest|null} [regionInstanceGroupManagersSetTemplateRequestResource] SetInstanceTemplateRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTemplateRequestResource + * @property {string|null} [requestId] SetInstanceTemplateRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new SetInstanceTemplateRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetInstanceTemplateRegionInstanceGroupManagerRequest. + * @implements ISetInstanceTemplateRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function SetInstanceTemplateRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetInstanceTemplateRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * SetInstanceTemplateRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * SetInstanceTemplateRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * SetInstanceTemplateRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTemplateRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTemplateRequest|null|undefined} regionInstanceGroupManagersSetTemplateRequestResource + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagersSetTemplateRequestResource = null; + + /** + * SetInstanceTemplateRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @instance + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetInstanceTemplateRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(SetInstanceTemplateRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetInstanceTemplateRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest} SetInstanceTemplateRegionInstanceGroupManagerRequest instance + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.create = function create(properties) { + return new SetInstanceTemplateRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified SetInstanceTemplateRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest} message SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.regionInstanceGroupManagersSetTemplateRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagersSetTemplateRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.encode(message.regionInstanceGroupManagersSetTemplateRequestResource, writer.uint32(/* id 187310412, wireType 2 =*/1498483298).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified SetInstanceTemplateRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest} message SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetInstanceTemplateRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest} SetInstanceTemplateRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 187310412: + message.regionInstanceGroupManagersSetTemplateRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetInstanceTemplateRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest} SetInstanceTemplateRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetInstanceTemplateRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagersSetTemplateRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersSetTemplateRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.verify(message.regionInstanceGroupManagersSetTemplateRequestResource); + if (error) + return "regionInstanceGroupManagersSetTemplateRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a SetInstanceTemplateRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest} SetInstanceTemplateRegionInstanceGroupManagerRequest + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagersSetTemplateRequestResource != null) { + if (typeof object.regionInstanceGroupManagersSetTemplateRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest.regionInstanceGroupManagersSetTemplateRequestResource: object expected"); + message.regionInstanceGroupManagersSetTemplateRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.fromObject(object.regionInstanceGroupManagersSetTemplateRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SetInstanceTemplateRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest} message SetInstanceTemplateRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.regionInstanceGroupManagersSetTemplateRequestResource = null; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.regionInstanceGroupManagersSetTemplateRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersSetTemplateRequestResource")) + object.regionInstanceGroupManagersSetTemplateRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest.toObject(message.regionInstanceGroupManagersSetTemplateRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this SetInstanceTemplateRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + SetInstanceTemplateRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetInstanceTemplateRegionInstanceGroupManagerRequest; + })(); + + v1.SetTargetPoolsRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of a SetTargetPoolsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetTargetPoolsRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] SetTargetPoolsRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] SetTargetPoolsRegionInstanceGroupManagerRequest project + * @property {string|null} [region] SetTargetPoolsRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest|null} [regionInstanceGroupManagersSetTargetPoolsRequestResource] SetTargetPoolsRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTargetPoolsRequestResource + * @property {string|null} [requestId] SetTargetPoolsRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new SetTargetPoolsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetTargetPoolsRegionInstanceGroupManagerRequest. + * @implements ISetTargetPoolsRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function SetTargetPoolsRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetTargetPoolsRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * SetTargetPoolsRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * SetTargetPoolsRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * SetTargetPoolsRegionInstanceGroupManagerRequest regionInstanceGroupManagersSetTargetPoolsRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagersSetTargetPoolsRequest|null|undefined} regionInstanceGroupManagersSetTargetPoolsRequestResource + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagersSetTargetPoolsRequestResource = null; + + /** + * SetTargetPoolsRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @instance + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetTargetPoolsRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(SetTargetPoolsRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetTargetPoolsRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest} SetTargetPoolsRegionInstanceGroupManagerRequest instance + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.create = function create(properties) { + return new SetTargetPoolsRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified SetTargetPoolsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest} message SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.regionInstanceGroupManagersSetTargetPoolsRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagersSetTargetPoolsRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.encode(message.regionInstanceGroupManagersSetTargetPoolsRequestResource, writer.uint32(/* id 78734717, wireType 2 =*/629877738).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified SetTargetPoolsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest} message SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetTargetPoolsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest} SetTargetPoolsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 78734717: + message.regionInstanceGroupManagersSetTargetPoolsRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetTargetPoolsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest} SetTargetPoolsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetTargetPoolsRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagersSetTargetPoolsRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersSetTargetPoolsRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.verify(message.regionInstanceGroupManagersSetTargetPoolsRequestResource); + if (error) + return "regionInstanceGroupManagersSetTargetPoolsRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a SetTargetPoolsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest} SetTargetPoolsRegionInstanceGroupManagerRequest + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagersSetTargetPoolsRequestResource != null) { + if (typeof object.regionInstanceGroupManagersSetTargetPoolsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest.regionInstanceGroupManagersSetTargetPoolsRequestResource: object expected"); + message.regionInstanceGroupManagersSetTargetPoolsRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.fromObject(object.regionInstanceGroupManagersSetTargetPoolsRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SetTargetPoolsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest} message SetTargetPoolsRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionInstanceGroupManagersSetTargetPoolsRequestResource = null; + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.regionInstanceGroupManagersSetTargetPoolsRequestResource != null && message.hasOwnProperty("regionInstanceGroupManagersSetTargetPoolsRequestResource")) + object.regionInstanceGroupManagersSetTargetPoolsRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest.toObject(message.regionInstanceGroupManagersSetTargetPoolsRequestResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this SetTargetPoolsRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + SetTargetPoolsRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetTargetPoolsRegionInstanceGroupManagerRequest; + })(); + + v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest = (function() { + + /** + * Properties of an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @property {string|null} [instanceGroupManager] UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager + * @property {string|null} [project] UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest project + * @property {string|null} [region] UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq|null} [regionInstanceGroupManagerUpdateInstanceConfigReqResource] UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerUpdateInstanceConfigReqResource + * @property {string|null} [requestId] UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest requestId + */ + + /** + * Constructs a new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest. + * @implements IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest=} [properties] Properties to set + */ + function UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instanceGroupManager. + * @member {string} instanceGroupManager + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.instanceGroupManager = ""; + + /** + * UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.project = ""; + + /** + * UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.region = ""; + + /** + * UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest regionInstanceGroupManagerUpdateInstanceConfigReqResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupManagerUpdateInstanceConfigReq|null|undefined} regionInstanceGroupManagerUpdateInstanceConfigReqResource + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.regionInstanceGroupManagerUpdateInstanceConfigReqResource = null; + + /** + * UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + */ + Object.defineProperty(UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest instance + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.create = function create(properties) { + return new UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(properties); + }; + + /** + * Encodes the specified UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} message UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.regionInstanceGroupManagerUpdateInstanceConfigReqResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupManagerUpdateInstanceConfigReqResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.encode(message.regionInstanceGroupManagerUpdateInstanceConfigReqResource, writer.uint32(/* id 89036583, wireType 2 =*/712292666).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceGroupManager != null && Object.hasOwnProperty.call(message, "instanceGroupManager")) + writer.uint32(/* id 249363395, wireType 2 =*/1994907162).string(message.instanceGroupManager); + return writer; + }; + + /** + * Encodes the specified UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} message UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 249363395: + message.instanceGroupManager = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 89036583: + message.regionInstanceGroupManagerUpdateInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + if (!$util.isString(message.instanceGroupManager)) + return "instanceGroupManager: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupManagerUpdateInstanceConfigReqResource != null && message.hasOwnProperty("regionInstanceGroupManagerUpdateInstanceConfigReqResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.verify(message.regionInstanceGroupManagerUpdateInstanceConfigReqResource); + if (error) + return "regionInstanceGroupManagerUpdateInstanceConfigReqResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest(); + if (object.instanceGroupManager != null) + message.instanceGroupManager = String(object.instanceGroupManager); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupManagerUpdateInstanceConfigReqResource != null) { + if (typeof object.regionInstanceGroupManagerUpdateInstanceConfigReqResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.regionInstanceGroupManagerUpdateInstanceConfigReqResource: object expected"); + message.regionInstanceGroupManagerUpdateInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.fromObject(object.regionInstanceGroupManagerUpdateInstanceConfigReqResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @static + * @param {google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} message UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionInstanceGroupManagerUpdateInstanceConfigReqResource = null; + object.region = ""; + object.project = ""; + object.instanceGroupManager = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.regionInstanceGroupManagerUpdateInstanceConfigReqResource != null && message.hasOwnProperty("regionInstanceGroupManagerUpdateInstanceConfigReqResource")) + object.regionInstanceGroupManagerUpdateInstanceConfigReqResource = $root.google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq.toObject(message.regionInstanceGroupManagerUpdateInstanceConfigReqResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceGroupManager != null && message.hasOwnProperty("instanceGroupManager")) + object.instanceGroupManager = message.instanceGroupManager; + return object; + }; + + /** + * Converts this UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest; + })(); + + v1.GetRegionInstanceGroupRequest = (function() { + + /** + * Properties of a GetRegionInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionInstanceGroupRequest + * @property {string|null} [instanceGroup] GetRegionInstanceGroupRequest instanceGroup + * @property {string|null} [project] GetRegionInstanceGroupRequest project + * @property {string|null} [region] GetRegionInstanceGroupRequest region + */ + + /** + * Constructs a new GetRegionInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionInstanceGroupRequest. + * @implements IGetRegionInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupRequest=} [properties] Properties to set + */ + function GetRegionInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionInstanceGroupRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @instance + */ + GetRegionInstanceGroupRequest.prototype.instanceGroup = ""; + + /** + * GetRegionInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @instance + */ + GetRegionInstanceGroupRequest.prototype.project = ""; + + /** + * GetRegionInstanceGroupRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @instance + */ + GetRegionInstanceGroupRequest.prototype.region = ""; + + /** + * Creates a new GetRegionInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupRequest} GetRegionInstanceGroupRequest instance + */ + GetRegionInstanceGroupRequest.create = function create(properties) { + return new GetRegionInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified GetRegionInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupRequest} message GetRegionInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupRequest} message GetRegionInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupRequest} GetRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 81095253: + message.instanceGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupRequest} GetRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionInstanceGroupRequest} GetRegionInstanceGroupRequest + */ + GetRegionInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionInstanceGroupRequest(); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.GetRegionInstanceGroupRequest} message GetRegionInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceGroup = ""; + object.region = ""; + object.project = ""; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionInstanceGroupRequest; + })(); + + v1.ListRegionInstanceGroupsRequest = (function() { + + /** + * Properties of a ListRegionInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionInstanceGroupsRequest + * @property {string|null} [filter] ListRegionInstanceGroupsRequest filter + * @property {number|null} [maxResults] ListRegionInstanceGroupsRequest maxResults + * @property {string|null} [orderBy] ListRegionInstanceGroupsRequest orderBy + * @property {string|null} [pageToken] ListRegionInstanceGroupsRequest pageToken + * @property {string|null} [project] ListRegionInstanceGroupsRequest project + * @property {string|null} [region] ListRegionInstanceGroupsRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionInstanceGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionInstanceGroupsRequest. + * @implements IListRegionInstanceGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionInstanceGroupsRequest=} [properties] Properties to set + */ + function ListRegionInstanceGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionInstanceGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + ListRegionInstanceGroupsRequest.prototype.filter = null; + + /** + * ListRegionInstanceGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + ListRegionInstanceGroupsRequest.prototype.maxResults = null; + + /** + * ListRegionInstanceGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + ListRegionInstanceGroupsRequest.prototype.orderBy = null; + + /** + * ListRegionInstanceGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + ListRegionInstanceGroupsRequest.prototype.pageToken = null; + + /** + * ListRegionInstanceGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + ListRegionInstanceGroupsRequest.prototype.project = ""; + + /** + * ListRegionInstanceGroupsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + ListRegionInstanceGroupsRequest.prototype.region = ""; + + /** + * ListRegionInstanceGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + ListRegionInstanceGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionInstanceGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionInstanceGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionInstanceGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionInstanceGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionInstanceGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupsRequest} ListRegionInstanceGroupsRequest instance + */ + ListRegionInstanceGroupsRequest.create = function create(properties) { + return new ListRegionInstanceGroupsRequest(properties); + }; + + /** + * Encodes the specified ListRegionInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionInstanceGroupsRequest} message ListRegionInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionInstanceGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionInstanceGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionInstanceGroupsRequest} message ListRegionInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionInstanceGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionInstanceGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupsRequest} ListRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionInstanceGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionInstanceGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupsRequest} ListRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionInstanceGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionInstanceGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionInstanceGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionInstanceGroupsRequest} ListRegionInstanceGroupsRequest + */ + ListRegionInstanceGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionInstanceGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionInstanceGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionInstanceGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListRegionInstanceGroupsRequest} message ListRegionInstanceGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionInstanceGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionInstanceGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionInstanceGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionInstanceGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionInstanceGroupsRequest; + })(); + + v1.ListInstancesRegionInstanceGroupsRequest = (function() { + + /** + * Properties of a ListInstancesRegionInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListInstancesRegionInstanceGroupsRequest + * @property {string|null} [filter] ListInstancesRegionInstanceGroupsRequest filter + * @property {string|null} [instanceGroup] ListInstancesRegionInstanceGroupsRequest instanceGroup + * @property {number|null} [maxResults] ListInstancesRegionInstanceGroupsRequest maxResults + * @property {string|null} [orderBy] ListInstancesRegionInstanceGroupsRequest orderBy + * @property {string|null} [pageToken] ListInstancesRegionInstanceGroupsRequest pageToken + * @property {string|null} [project] ListInstancesRegionInstanceGroupsRequest project + * @property {string|null} [region] ListInstancesRegionInstanceGroupsRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest|null} [regionInstanceGroupsListInstancesRequestResource] ListInstancesRegionInstanceGroupsRequest regionInstanceGroupsListInstancesRequestResource + * @property {boolean|null} [returnPartialSuccess] ListInstancesRegionInstanceGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListInstancesRegionInstanceGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListInstancesRegionInstanceGroupsRequest. + * @implements IListInstancesRegionInstanceGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest=} [properties] Properties to set + */ + function ListInstancesRegionInstanceGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRegionInstanceGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.filter = null; + + /** + * ListInstancesRegionInstanceGroupsRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.instanceGroup = ""; + + /** + * ListInstancesRegionInstanceGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.maxResults = null; + + /** + * ListInstancesRegionInstanceGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.orderBy = null; + + /** + * ListInstancesRegionInstanceGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.pageToken = null; + + /** + * ListInstancesRegionInstanceGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.project = ""; + + /** + * ListInstancesRegionInstanceGroupsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.region = ""; + + /** + * ListInstancesRegionInstanceGroupsRequest regionInstanceGroupsListInstancesRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupsListInstancesRequest|null|undefined} regionInstanceGroupsListInstancesRequestResource + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.regionInstanceGroupsListInstancesRequestResource = null; + + /** + * ListInstancesRegionInstanceGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + ListInstancesRegionInstanceGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListInstancesRegionInstanceGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesRegionInstanceGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRegionInstanceGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesRegionInstanceGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRegionInstanceGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesRegionInstanceGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRegionInstanceGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesRegionInstanceGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListInstancesRegionInstanceGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + */ + Object.defineProperty(ListInstancesRegionInstanceGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListInstancesRegionInstanceGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest} ListInstancesRegionInstanceGroupsRequest instance + */ + ListInstancesRegionInstanceGroupsRequest.create = function create(properties) { + return new ListInstancesRegionInstanceGroupsRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRegionInstanceGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest} message ListInstancesRegionInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRegionInstanceGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.regionInstanceGroupsListInstancesRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupsListInstancesRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.encode(message.regionInstanceGroupsListInstancesRequestResource, writer.uint32(/* id 48239828, wireType 2 =*/385918626).fork()).ldelim(); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListInstancesRegionInstanceGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest} message ListInstancesRegionInstanceGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRegionInstanceGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRegionInstanceGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest} ListInstancesRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRegionInstanceGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 81095253: + message.instanceGroup = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 48239828: + message.regionInstanceGroupsListInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.decode(reader, reader.uint32()); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInstancesRegionInstanceGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest} ListInstancesRegionInstanceGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRegionInstanceGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRegionInstanceGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRegionInstanceGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupsListInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupsListInstancesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.verify(message.regionInstanceGroupsListInstancesRequestResource); + if (error) + return "regionInstanceGroupsListInstancesRequestResource." + error; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListInstancesRegionInstanceGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest} ListInstancesRegionInstanceGroupsRequest + */ + ListInstancesRegionInstanceGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupsListInstancesRequestResource != null) { + if (typeof object.regionInstanceGroupsListInstancesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest.regionInstanceGroupsListInstancesRequestResource: object expected"); + message.regionInstanceGroupsListInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.fromObject(object.regionInstanceGroupsListInstancesRequestResource); + } + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRegionInstanceGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest} message ListInstancesRegionInstanceGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRegionInstanceGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionInstanceGroupsListInstancesRequestResource = null; + object.instanceGroup = ""; + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.regionInstanceGroupsListInstancesRequestResource != null && message.hasOwnProperty("regionInstanceGroupsListInstancesRequestResource")) + object.regionInstanceGroupsListInstancesRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest.toObject(message.regionInstanceGroupsListInstancesRequestResource, options); + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListInstancesRegionInstanceGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRegionInstanceGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesRegionInstanceGroupsRequest; + })(); + + v1.SetNamedPortsRegionInstanceGroupRequest = (function() { + + /** + * Properties of a SetNamedPortsRegionInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetNamedPortsRegionInstanceGroupRequest + * @property {string|null} [instanceGroup] SetNamedPortsRegionInstanceGroupRequest instanceGroup + * @property {string|null} [project] SetNamedPortsRegionInstanceGroupRequest project + * @property {string|null} [region] SetNamedPortsRegionInstanceGroupRequest region + * @property {google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest|null} [regionInstanceGroupsSetNamedPortsRequestResource] SetNamedPortsRegionInstanceGroupRequest regionInstanceGroupsSetNamedPortsRequestResource + * @property {string|null} [requestId] SetNamedPortsRegionInstanceGroupRequest requestId + */ + + /** + * Constructs a new SetNamedPortsRegionInstanceGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetNamedPortsRegionInstanceGroupRequest. + * @implements ISetNamedPortsRegionInstanceGroupRequest + * @constructor + * @param {google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest=} [properties] Properties to set + */ + function SetNamedPortsRegionInstanceGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetNamedPortsRegionInstanceGroupRequest instanceGroup. + * @member {string} instanceGroup + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @instance + */ + SetNamedPortsRegionInstanceGroupRequest.prototype.instanceGroup = ""; + + /** + * SetNamedPortsRegionInstanceGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @instance + */ + SetNamedPortsRegionInstanceGroupRequest.prototype.project = ""; + + /** + * SetNamedPortsRegionInstanceGroupRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @instance + */ + SetNamedPortsRegionInstanceGroupRequest.prototype.region = ""; + + /** + * SetNamedPortsRegionInstanceGroupRequest regionInstanceGroupsSetNamedPortsRequestResource. + * @member {google.cloud.compute.v1.IRegionInstanceGroupsSetNamedPortsRequest|null|undefined} regionInstanceGroupsSetNamedPortsRequestResource + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @instance + */ + SetNamedPortsRegionInstanceGroupRequest.prototype.regionInstanceGroupsSetNamedPortsRequestResource = null; + + /** + * SetNamedPortsRegionInstanceGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @instance + */ + SetNamedPortsRegionInstanceGroupRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetNamedPortsRegionInstanceGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @instance + */ + Object.defineProperty(SetNamedPortsRegionInstanceGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetNamedPortsRegionInstanceGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest} SetNamedPortsRegionInstanceGroupRequest instance + */ + SetNamedPortsRegionInstanceGroupRequest.create = function create(properties) { + return new SetNamedPortsRegionInstanceGroupRequest(properties); + }; + + /** + * Encodes the specified SetNamedPortsRegionInstanceGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest} message SetNamedPortsRegionInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetNamedPortsRegionInstanceGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionInstanceGroupsSetNamedPortsRequestResource != null && Object.hasOwnProperty.call(message, "regionInstanceGroupsSetNamedPortsRequestResource")) + $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.encode(message.regionInstanceGroupsSetNamedPortsRequestResource, writer.uint32(/* id 1574938, wireType 2 =*/12599506).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.instanceGroup != null && Object.hasOwnProperty.call(message, "instanceGroup")) + writer.uint32(/* id 81095253, wireType 2 =*/648762026).string(message.instanceGroup); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetNamedPortsRegionInstanceGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest} message SetNamedPortsRegionInstanceGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetNamedPortsRegionInstanceGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetNamedPortsRegionInstanceGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest} SetNamedPortsRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetNamedPortsRegionInstanceGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 81095253: + message.instanceGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 1574938: + message.regionInstanceGroupsSetNamedPortsRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetNamedPortsRegionInstanceGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest} SetNamedPortsRegionInstanceGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetNamedPortsRegionInstanceGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetNamedPortsRegionInstanceGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetNamedPortsRegionInstanceGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + if (!$util.isString(message.instanceGroup)) + return "instanceGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionInstanceGroupsSetNamedPortsRequestResource != null && message.hasOwnProperty("regionInstanceGroupsSetNamedPortsRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.verify(message.regionInstanceGroupsSetNamedPortsRequestResource); + if (error) + return "regionInstanceGroupsSetNamedPortsRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a SetNamedPortsRegionInstanceGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest} SetNamedPortsRegionInstanceGroupRequest + */ + SetNamedPortsRegionInstanceGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest(); + if (object.instanceGroup != null) + message.instanceGroup = String(object.instanceGroup); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionInstanceGroupsSetNamedPortsRequestResource != null) { + if (typeof object.regionInstanceGroupsSetNamedPortsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest.regionInstanceGroupsSetNamedPortsRequestResource: object expected"); + message.regionInstanceGroupsSetNamedPortsRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.fromObject(object.regionInstanceGroupsSetNamedPortsRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SetNamedPortsRegionInstanceGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @static + * @param {google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest} message SetNamedPortsRegionInstanceGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetNamedPortsRegionInstanceGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionInstanceGroupsSetNamedPortsRequestResource = null; + object.instanceGroup = ""; + object.region = ""; + object.project = ""; + } + if (message.regionInstanceGroupsSetNamedPortsRequestResource != null && message.hasOwnProperty("regionInstanceGroupsSetNamedPortsRequestResource")) + object.regionInstanceGroupsSetNamedPortsRequestResource = $root.google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest.toObject(message.regionInstanceGroupsSetNamedPortsRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.instanceGroup != null && message.hasOwnProperty("instanceGroup")) + object.instanceGroup = message.instanceGroup; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetNamedPortsRegionInstanceGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest + * @instance + * @returns {Object.} JSON object + */ + SetNamedPortsRegionInstanceGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetNamedPortsRegionInstanceGroupRequest; + })(); + + v1.BulkInsertRegionInstanceRequest = (function() { + + /** + * Properties of a BulkInsertRegionInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IBulkInsertRegionInstanceRequest + * @property {google.cloud.compute.v1.IBulkInsertInstanceResource|null} [bulkInsertInstanceResourceResource] BulkInsertRegionInstanceRequest bulkInsertInstanceResourceResource + * @property {string|null} [project] BulkInsertRegionInstanceRequest project + * @property {string|null} [region] BulkInsertRegionInstanceRequest region + * @property {string|null} [requestId] BulkInsertRegionInstanceRequest requestId + */ + + /** + * Constructs a new BulkInsertRegionInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BulkInsertRegionInstanceRequest. + * @implements IBulkInsertRegionInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IBulkInsertRegionInstanceRequest=} [properties] Properties to set + */ + function BulkInsertRegionInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BulkInsertRegionInstanceRequest bulkInsertInstanceResourceResource. + * @member {google.cloud.compute.v1.IBulkInsertInstanceResource|null|undefined} bulkInsertInstanceResourceResource + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @instance + */ + BulkInsertRegionInstanceRequest.prototype.bulkInsertInstanceResourceResource = null; + + /** + * BulkInsertRegionInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @instance + */ + BulkInsertRegionInstanceRequest.prototype.project = ""; + + /** + * BulkInsertRegionInstanceRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @instance + */ + BulkInsertRegionInstanceRequest.prototype.region = ""; + + /** + * BulkInsertRegionInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @instance + */ + BulkInsertRegionInstanceRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BulkInsertRegionInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @instance + */ + Object.defineProperty(BulkInsertRegionInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BulkInsertRegionInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {google.cloud.compute.v1.IBulkInsertRegionInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.BulkInsertRegionInstanceRequest} BulkInsertRegionInstanceRequest instance + */ + BulkInsertRegionInstanceRequest.create = function create(properties) { + return new BulkInsertRegionInstanceRequest(properties); + }; + + /** + * Encodes the specified BulkInsertRegionInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.BulkInsertRegionInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {google.cloud.compute.v1.IBulkInsertRegionInstanceRequest} message BulkInsertRegionInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertRegionInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.bulkInsertInstanceResourceResource != null && Object.hasOwnProperty.call(message, "bulkInsertInstanceResourceResource")) + $root.google.cloud.compute.v1.BulkInsertInstanceResource.encode(message.bulkInsertInstanceResourceResource, writer.uint32(/* id 41427278, wireType 2 =*/331418226).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified BulkInsertRegionInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BulkInsertRegionInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {google.cloud.compute.v1.IBulkInsertRegionInstanceRequest} message BulkInsertRegionInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BulkInsertRegionInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BulkInsertRegionInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.BulkInsertRegionInstanceRequest} BulkInsertRegionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertRegionInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.BulkInsertRegionInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 41427278: + message.bulkInsertInstanceResourceResource = $root.google.cloud.compute.v1.BulkInsertInstanceResource.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BulkInsertRegionInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.BulkInsertRegionInstanceRequest} BulkInsertRegionInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BulkInsertRegionInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BulkInsertRegionInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BulkInsertRegionInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bulkInsertInstanceResourceResource != null && message.hasOwnProperty("bulkInsertInstanceResourceResource")) { + var error = $root.google.cloud.compute.v1.BulkInsertInstanceResource.verify(message.bulkInsertInstanceResourceResource); + if (error) + return "bulkInsertInstanceResourceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a BulkInsertRegionInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.BulkInsertRegionInstanceRequest} BulkInsertRegionInstanceRequest + */ + BulkInsertRegionInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.BulkInsertRegionInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.BulkInsertRegionInstanceRequest(); + if (object.bulkInsertInstanceResourceResource != null) { + if (typeof object.bulkInsertInstanceResourceResource !== "object") + throw TypeError(".google.cloud.compute.v1.BulkInsertRegionInstanceRequest.bulkInsertInstanceResourceResource: object expected"); + message.bulkInsertInstanceResourceResource = $root.google.cloud.compute.v1.BulkInsertInstanceResource.fromObject(object.bulkInsertInstanceResourceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a BulkInsertRegionInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @static + * @param {google.cloud.compute.v1.BulkInsertRegionInstanceRequest} message BulkInsertRegionInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BulkInsertRegionInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bulkInsertInstanceResourceResource = null; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.bulkInsertInstanceResourceResource != null && message.hasOwnProperty("bulkInsertInstanceResourceResource")) + object.bulkInsertInstanceResourceResource = $root.google.cloud.compute.v1.BulkInsertInstanceResource.toObject(message.bulkInsertInstanceResourceResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this BulkInsertRegionInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.BulkInsertRegionInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + BulkInsertRegionInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BulkInsertRegionInstanceRequest; + })(); + + v1.DeleteRegionNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a DeleteRegionNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] DeleteRegionNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] DeleteRegionNetworkEndpointGroupRequest project + * @property {string|null} [region] DeleteRegionNetworkEndpointGroupRequest region + * @property {string|null} [requestId] DeleteRegionNetworkEndpointGroupRequest requestId + */ + + /** + * Constructs a new DeleteRegionNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionNetworkEndpointGroupRequest. + * @implements IDeleteRegionNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function DeleteRegionNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @instance + */ + DeleteRegionNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * DeleteRegionNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @instance + */ + DeleteRegionNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * DeleteRegionNetworkEndpointGroupRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @instance + */ + DeleteRegionNetworkEndpointGroupRequest.prototype.region = ""; + + /** + * DeleteRegionNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @instance + */ + DeleteRegionNetworkEndpointGroupRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(DeleteRegionNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest} DeleteRegionNetworkEndpointGroupRequest instance + */ + DeleteRegionNetworkEndpointGroupRequest.create = function create(properties) { + return new DeleteRegionNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest} message DeleteRegionNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified DeleteRegionNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest} message DeleteRegionNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest} DeleteRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest} DeleteRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest} DeleteRegionNetworkEndpointGroupRequest + */ + DeleteRegionNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest} message DeleteRegionNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this DeleteRegionNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionNetworkEndpointGroupRequest; + })(); + + v1.GetRegionNetworkEndpointGroupRequest = (function() { + + /** + * Properties of a GetRegionNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionNetworkEndpointGroupRequest + * @property {string|null} [networkEndpointGroup] GetRegionNetworkEndpointGroupRequest networkEndpointGroup + * @property {string|null} [project] GetRegionNetworkEndpointGroupRequest project + * @property {string|null} [region] GetRegionNetworkEndpointGroupRequest region + */ + + /** + * Constructs a new GetRegionNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionNetworkEndpointGroupRequest. + * @implements IGetRegionNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function GetRegionNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionNetworkEndpointGroupRequest networkEndpointGroup. + * @member {string} networkEndpointGroup + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @instance + */ + GetRegionNetworkEndpointGroupRequest.prototype.networkEndpointGroup = ""; + + /** + * GetRegionNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @instance + */ + GetRegionNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * GetRegionNetworkEndpointGroupRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @instance + */ + GetRegionNetworkEndpointGroupRequest.prototype.region = ""; + + /** + * Creates a new GetRegionNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest} GetRegionNetworkEndpointGroupRequest instance + */ + GetRegionNetworkEndpointGroupRequest.create = function create(properties) { + return new GetRegionNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified GetRegionNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest} message GetRegionNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroup != null && Object.hasOwnProperty.call(message, "networkEndpointGroup")) + writer.uint32(/* id 433907078, wireType 2 =*/3471256626).string(message.networkEndpointGroup); + return writer; + }; + + /** + * Encodes the specified GetRegionNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest} message GetRegionNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest} GetRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 433907078: + message.networkEndpointGroup = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest} GetRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + if (!$util.isString(message.networkEndpointGroup)) + return "networkEndpointGroup: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest} GetRegionNetworkEndpointGroupRequest + */ + GetRegionNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest(); + if (object.networkEndpointGroup != null) + message.networkEndpointGroup = String(object.networkEndpointGroup); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest} message GetRegionNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.networkEndpointGroup = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroup != null && message.hasOwnProperty("networkEndpointGroup")) + object.networkEndpointGroup = message.networkEndpointGroup; + return object; + }; + + /** + * Converts this GetRegionNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionNetworkEndpointGroupRequest; + })(); + + v1.InsertRegionNetworkEndpointGroupRequest = (function() { + + /** + * Properties of an InsertRegionNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionNetworkEndpointGroupRequest + * @property {google.cloud.compute.v1.INetworkEndpointGroup|null} [networkEndpointGroupResource] InsertRegionNetworkEndpointGroupRequest networkEndpointGroupResource + * @property {string|null} [project] InsertRegionNetworkEndpointGroupRequest project + * @property {string|null} [region] InsertRegionNetworkEndpointGroupRequest region + * @property {string|null} [requestId] InsertRegionNetworkEndpointGroupRequest requestId + */ + + /** + * Constructs a new InsertRegionNetworkEndpointGroupRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionNetworkEndpointGroupRequest. + * @implements IInsertRegionNetworkEndpointGroupRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest=} [properties] Properties to set + */ + function InsertRegionNetworkEndpointGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionNetworkEndpointGroupRequest networkEndpointGroupResource. + * @member {google.cloud.compute.v1.INetworkEndpointGroup|null|undefined} networkEndpointGroupResource + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @instance + */ + InsertRegionNetworkEndpointGroupRequest.prototype.networkEndpointGroupResource = null; + + /** + * InsertRegionNetworkEndpointGroupRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @instance + */ + InsertRegionNetworkEndpointGroupRequest.prototype.project = ""; + + /** + * InsertRegionNetworkEndpointGroupRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @instance + */ + InsertRegionNetworkEndpointGroupRequest.prototype.region = ""; + + /** + * InsertRegionNetworkEndpointGroupRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @instance + */ + InsertRegionNetworkEndpointGroupRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionNetworkEndpointGroupRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @instance + */ + Object.defineProperty(InsertRegionNetworkEndpointGroupRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionNetworkEndpointGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest} InsertRegionNetworkEndpointGroupRequest instance + */ + InsertRegionNetworkEndpointGroupRequest.create = function create(properties) { + return new InsertRegionNetworkEndpointGroupRequest(properties); + }; + + /** + * Encodes the specified InsertRegionNetworkEndpointGroupRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest} message InsertRegionNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionNetworkEndpointGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.networkEndpointGroupResource != null && Object.hasOwnProperty.call(message, "networkEndpointGroupResource")) + $root.google.cloud.compute.v1.NetworkEndpointGroup.encode(message.networkEndpointGroupResource, writer.uint32(/* id 525788839, wireType 2 =*/4206310714).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRegionNetworkEndpointGroupRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest} message InsertRegionNetworkEndpointGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionNetworkEndpointGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionNetworkEndpointGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest} InsertRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionNetworkEndpointGroupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 525788839: + message.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionNetworkEndpointGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest} InsertRegionNetworkEndpointGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionNetworkEndpointGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionNetworkEndpointGroupRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionNetworkEndpointGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.networkEndpointGroupResource != null && message.hasOwnProperty("networkEndpointGroupResource")) { + var error = $root.google.cloud.compute.v1.NetworkEndpointGroup.verify(message.networkEndpointGroupResource); + if (error) + return "networkEndpointGroupResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionNetworkEndpointGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest} InsertRegionNetworkEndpointGroupRequest + */ + InsertRegionNetworkEndpointGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest(); + if (object.networkEndpointGroupResource != null) { + if (typeof object.networkEndpointGroupResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest.networkEndpointGroupResource: object expected"); + message.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.fromObject(object.networkEndpointGroupResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionNetworkEndpointGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest} message InsertRegionNetworkEndpointGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionNetworkEndpointGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.networkEndpointGroupResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.networkEndpointGroupResource != null && message.hasOwnProperty("networkEndpointGroupResource")) + object.networkEndpointGroupResource = $root.google.cloud.compute.v1.NetworkEndpointGroup.toObject(message.networkEndpointGroupResource, options); + return object; + }; + + /** + * Converts this InsertRegionNetworkEndpointGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionNetworkEndpointGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionNetworkEndpointGroupRequest; + })(); + + v1.ListRegionNetworkEndpointGroupsRequest = (function() { + + /** + * Properties of a ListRegionNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionNetworkEndpointGroupsRequest + * @property {string|null} [filter] ListRegionNetworkEndpointGroupsRequest filter + * @property {number|null} [maxResults] ListRegionNetworkEndpointGroupsRequest maxResults + * @property {string|null} [orderBy] ListRegionNetworkEndpointGroupsRequest orderBy + * @property {string|null} [pageToken] ListRegionNetworkEndpointGroupsRequest pageToken + * @property {string|null} [project] ListRegionNetworkEndpointGroupsRequest project + * @property {string|null} [region] ListRegionNetworkEndpointGroupsRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionNetworkEndpointGroupsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionNetworkEndpointGroupsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionNetworkEndpointGroupsRequest. + * @implements IListRegionNetworkEndpointGroupsRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest=} [properties] Properties to set + */ + function ListRegionNetworkEndpointGroupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionNetworkEndpointGroupsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + ListRegionNetworkEndpointGroupsRequest.prototype.filter = null; + + /** + * ListRegionNetworkEndpointGroupsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + ListRegionNetworkEndpointGroupsRequest.prototype.maxResults = null; + + /** + * ListRegionNetworkEndpointGroupsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + ListRegionNetworkEndpointGroupsRequest.prototype.orderBy = null; + + /** + * ListRegionNetworkEndpointGroupsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + ListRegionNetworkEndpointGroupsRequest.prototype.pageToken = null; + + /** + * ListRegionNetworkEndpointGroupsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + ListRegionNetworkEndpointGroupsRequest.prototype.project = ""; + + /** + * ListRegionNetworkEndpointGroupsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + ListRegionNetworkEndpointGroupsRequest.prototype.region = ""; + + /** + * ListRegionNetworkEndpointGroupsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + ListRegionNetworkEndpointGroupsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionNetworkEndpointGroupsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionNetworkEndpointGroupsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNetworkEndpointGroupsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionNetworkEndpointGroupsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNetworkEndpointGroupsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionNetworkEndpointGroupsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNetworkEndpointGroupsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionNetworkEndpointGroupsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNetworkEndpointGroupsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + */ + Object.defineProperty(ListRegionNetworkEndpointGroupsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionNetworkEndpointGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest} ListRegionNetworkEndpointGroupsRequest instance + */ + ListRegionNetworkEndpointGroupsRequest.create = function create(properties) { + return new ListRegionNetworkEndpointGroupsRequest(properties); + }; + + /** + * Encodes the specified ListRegionNetworkEndpointGroupsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest} message ListRegionNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionNetworkEndpointGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionNetworkEndpointGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest} message ListRegionNetworkEndpointGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionNetworkEndpointGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionNetworkEndpointGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest} ListRegionNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionNetworkEndpointGroupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionNetworkEndpointGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest} ListRegionNetworkEndpointGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionNetworkEndpointGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionNetworkEndpointGroupsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionNetworkEndpointGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionNetworkEndpointGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest} ListRegionNetworkEndpointGroupsRequest + */ + ListRegionNetworkEndpointGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionNetworkEndpointGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @static + * @param {google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest} message ListRegionNetworkEndpointGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionNetworkEndpointGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionNetworkEndpointGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionNetworkEndpointGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionNetworkEndpointGroupsRequest; + })(); + + v1.DeleteRegionNotificationEndpointRequest = (function() { + + /** + * Properties of a DeleteRegionNotificationEndpointRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionNotificationEndpointRequest + * @property {string|null} [notificationEndpoint] DeleteRegionNotificationEndpointRequest notificationEndpoint + * @property {string|null} [project] DeleteRegionNotificationEndpointRequest project + * @property {string|null} [region] DeleteRegionNotificationEndpointRequest region + * @property {string|null} [requestId] DeleteRegionNotificationEndpointRequest requestId + */ + + /** + * Constructs a new DeleteRegionNotificationEndpointRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionNotificationEndpointRequest. + * @implements IDeleteRegionNotificationEndpointRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest=} [properties] Properties to set + */ + function DeleteRegionNotificationEndpointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionNotificationEndpointRequest notificationEndpoint. + * @member {string} notificationEndpoint + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @instance + */ + DeleteRegionNotificationEndpointRequest.prototype.notificationEndpoint = ""; + + /** + * DeleteRegionNotificationEndpointRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @instance + */ + DeleteRegionNotificationEndpointRequest.prototype.project = ""; + + /** + * DeleteRegionNotificationEndpointRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @instance + */ + DeleteRegionNotificationEndpointRequest.prototype.region = ""; + + /** + * DeleteRegionNotificationEndpointRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @instance + */ + DeleteRegionNotificationEndpointRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionNotificationEndpointRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @instance + */ + Object.defineProperty(DeleteRegionNotificationEndpointRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionNotificationEndpointRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest} DeleteRegionNotificationEndpointRequest instance + */ + DeleteRegionNotificationEndpointRequest.create = function create(properties) { + return new DeleteRegionNotificationEndpointRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionNotificationEndpointRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest} message DeleteRegionNotificationEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionNotificationEndpointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.notificationEndpoint != null && Object.hasOwnProperty.call(message, "notificationEndpoint")) + writer.uint32(/* id 376807017, wireType 2 =*/3014456138).string(message.notificationEndpoint); + return writer; + }; + + /** + * Encodes the specified DeleteRegionNotificationEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest} message DeleteRegionNotificationEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionNotificationEndpointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionNotificationEndpointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest} DeleteRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionNotificationEndpointRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 376807017: + message.notificationEndpoint = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionNotificationEndpointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest} DeleteRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionNotificationEndpointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionNotificationEndpointRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionNotificationEndpointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.notificationEndpoint != null && message.hasOwnProperty("notificationEndpoint")) + if (!$util.isString(message.notificationEndpoint)) + return "notificationEndpoint: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates a DeleteRegionNotificationEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest} DeleteRegionNotificationEndpointRequest + */ + DeleteRegionNotificationEndpointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest(); + if (object.notificationEndpoint != null) + message.notificationEndpoint = String(object.notificationEndpoint); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionNotificationEndpointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest} message DeleteRegionNotificationEndpointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionNotificationEndpointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.notificationEndpoint = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.notificationEndpoint != null && message.hasOwnProperty("notificationEndpoint")) + object.notificationEndpoint = message.notificationEndpoint; + return object; + }; + + /** + * Converts this DeleteRegionNotificationEndpointRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionNotificationEndpointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionNotificationEndpointRequest; + })(); + + v1.GetRegionNotificationEndpointRequest = (function() { + + /** + * Properties of a GetRegionNotificationEndpointRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionNotificationEndpointRequest + * @property {string|null} [notificationEndpoint] GetRegionNotificationEndpointRequest notificationEndpoint + * @property {string|null} [project] GetRegionNotificationEndpointRequest project + * @property {string|null} [region] GetRegionNotificationEndpointRequest region + */ + + /** + * Constructs a new GetRegionNotificationEndpointRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionNotificationEndpointRequest. + * @implements IGetRegionNotificationEndpointRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionNotificationEndpointRequest=} [properties] Properties to set + */ + function GetRegionNotificationEndpointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionNotificationEndpointRequest notificationEndpoint. + * @member {string} notificationEndpoint + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @instance + */ + GetRegionNotificationEndpointRequest.prototype.notificationEndpoint = ""; + + /** + * GetRegionNotificationEndpointRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @instance + */ + GetRegionNotificationEndpointRequest.prototype.project = ""; + + /** + * GetRegionNotificationEndpointRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @instance + */ + GetRegionNotificationEndpointRequest.prototype.region = ""; + + /** + * Creates a new GetRegionNotificationEndpointRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionNotificationEndpointRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionNotificationEndpointRequest} GetRegionNotificationEndpointRequest instance + */ + GetRegionNotificationEndpointRequest.create = function create(properties) { + return new GetRegionNotificationEndpointRequest(properties); + }; + + /** + * Encodes the specified GetRegionNotificationEndpointRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionNotificationEndpointRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionNotificationEndpointRequest} message GetRegionNotificationEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionNotificationEndpointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.notificationEndpoint != null && Object.hasOwnProperty.call(message, "notificationEndpoint")) + writer.uint32(/* id 376807017, wireType 2 =*/3014456138).string(message.notificationEndpoint); + return writer; + }; + + /** + * Encodes the specified GetRegionNotificationEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionNotificationEndpointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionNotificationEndpointRequest} message GetRegionNotificationEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionNotificationEndpointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionNotificationEndpointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionNotificationEndpointRequest} GetRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionNotificationEndpointRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionNotificationEndpointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 376807017: + message.notificationEndpoint = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionNotificationEndpointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionNotificationEndpointRequest} GetRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionNotificationEndpointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionNotificationEndpointRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionNotificationEndpointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notificationEndpoint != null && message.hasOwnProperty("notificationEndpoint")) + if (!$util.isString(message.notificationEndpoint)) + return "notificationEndpoint: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionNotificationEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionNotificationEndpointRequest} GetRegionNotificationEndpointRequest + */ + GetRegionNotificationEndpointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionNotificationEndpointRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionNotificationEndpointRequest(); + if (object.notificationEndpoint != null) + message.notificationEndpoint = String(object.notificationEndpoint); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionNotificationEndpointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.GetRegionNotificationEndpointRequest} message GetRegionNotificationEndpointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionNotificationEndpointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.notificationEndpoint = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.notificationEndpoint != null && message.hasOwnProperty("notificationEndpoint")) + object.notificationEndpoint = message.notificationEndpoint; + return object; + }; + + /** + * Converts this GetRegionNotificationEndpointRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionNotificationEndpointRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionNotificationEndpointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionNotificationEndpointRequest; + })(); + + v1.InsertRegionNotificationEndpointRequest = (function() { + + /** + * Properties of an InsertRegionNotificationEndpointRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionNotificationEndpointRequest + * @property {google.cloud.compute.v1.INotificationEndpoint|null} [notificationEndpointResource] InsertRegionNotificationEndpointRequest notificationEndpointResource + * @property {string|null} [project] InsertRegionNotificationEndpointRequest project + * @property {string|null} [region] InsertRegionNotificationEndpointRequest region + * @property {string|null} [requestId] InsertRegionNotificationEndpointRequest requestId + */ + + /** + * Constructs a new InsertRegionNotificationEndpointRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionNotificationEndpointRequest. + * @implements IInsertRegionNotificationEndpointRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest=} [properties] Properties to set + */ + function InsertRegionNotificationEndpointRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionNotificationEndpointRequest notificationEndpointResource. + * @member {google.cloud.compute.v1.INotificationEndpoint|null|undefined} notificationEndpointResource + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @instance + */ + InsertRegionNotificationEndpointRequest.prototype.notificationEndpointResource = null; + + /** + * InsertRegionNotificationEndpointRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @instance + */ + InsertRegionNotificationEndpointRequest.prototype.project = ""; + + /** + * InsertRegionNotificationEndpointRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @instance + */ + InsertRegionNotificationEndpointRequest.prototype.region = ""; + + /** + * InsertRegionNotificationEndpointRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @instance + */ + InsertRegionNotificationEndpointRequest.prototype.requestId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionNotificationEndpointRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @instance + */ + Object.defineProperty(InsertRegionNotificationEndpointRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionNotificationEndpointRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionNotificationEndpointRequest} InsertRegionNotificationEndpointRequest instance + */ + InsertRegionNotificationEndpointRequest.create = function create(properties) { + return new InsertRegionNotificationEndpointRequest(properties); + }; + + /** + * Encodes the specified InsertRegionNotificationEndpointRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNotificationEndpointRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest} message InsertRegionNotificationEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionNotificationEndpointRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.notificationEndpointResource != null && Object.hasOwnProperty.call(message, "notificationEndpointResource")) + $root.google.cloud.compute.v1.NotificationEndpoint.encode(message.notificationEndpointResource, writer.uint32(/* id 338459940, wireType 2 =*/2707679522).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRegionNotificationEndpointRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionNotificationEndpointRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest} message InsertRegionNotificationEndpointRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionNotificationEndpointRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionNotificationEndpointRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionNotificationEndpointRequest} InsertRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionNotificationEndpointRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionNotificationEndpointRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 338459940: + message.notificationEndpointResource = $root.google.cloud.compute.v1.NotificationEndpoint.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionNotificationEndpointRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionNotificationEndpointRequest} InsertRegionNotificationEndpointRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionNotificationEndpointRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionNotificationEndpointRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionNotificationEndpointRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.notificationEndpointResource != null && message.hasOwnProperty("notificationEndpointResource")) { + var error = $root.google.cloud.compute.v1.NotificationEndpoint.verify(message.notificationEndpointResource); + if (error) + return "notificationEndpointResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + return null; + }; + + /** + * Creates an InsertRegionNotificationEndpointRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionNotificationEndpointRequest} InsertRegionNotificationEndpointRequest + */ + InsertRegionNotificationEndpointRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionNotificationEndpointRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionNotificationEndpointRequest(); + if (object.notificationEndpointResource != null) { + if (typeof object.notificationEndpointResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionNotificationEndpointRequest.notificationEndpointResource: object expected"); + message.notificationEndpointResource = $root.google.cloud.compute.v1.NotificationEndpoint.fromObject(object.notificationEndpointResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InsertRegionNotificationEndpointRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionNotificationEndpointRequest} message InsertRegionNotificationEndpointRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionNotificationEndpointRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.notificationEndpointResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.notificationEndpointResource != null && message.hasOwnProperty("notificationEndpointResource")) + object.notificationEndpointResource = $root.google.cloud.compute.v1.NotificationEndpoint.toObject(message.notificationEndpointResource, options); + return object; + }; + + /** + * Converts this InsertRegionNotificationEndpointRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionNotificationEndpointRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionNotificationEndpointRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionNotificationEndpointRequest; + })(); + + v1.ListRegionNotificationEndpointsRequest = (function() { + + /** + * Properties of a ListRegionNotificationEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionNotificationEndpointsRequest + * @property {string|null} [filter] ListRegionNotificationEndpointsRequest filter + * @property {number|null} [maxResults] ListRegionNotificationEndpointsRequest maxResults + * @property {string|null} [orderBy] ListRegionNotificationEndpointsRequest orderBy + * @property {string|null} [pageToken] ListRegionNotificationEndpointsRequest pageToken + * @property {string|null} [project] ListRegionNotificationEndpointsRequest project + * @property {string|null} [region] ListRegionNotificationEndpointsRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionNotificationEndpointsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionNotificationEndpointsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionNotificationEndpointsRequest. + * @implements IListRegionNotificationEndpointsRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionNotificationEndpointsRequest=} [properties] Properties to set + */ + function ListRegionNotificationEndpointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionNotificationEndpointsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + ListRegionNotificationEndpointsRequest.prototype.filter = null; + + /** + * ListRegionNotificationEndpointsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + ListRegionNotificationEndpointsRequest.prototype.maxResults = null; + + /** + * ListRegionNotificationEndpointsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + ListRegionNotificationEndpointsRequest.prototype.orderBy = null; + + /** + * ListRegionNotificationEndpointsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + ListRegionNotificationEndpointsRequest.prototype.pageToken = null; + + /** + * ListRegionNotificationEndpointsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + ListRegionNotificationEndpointsRequest.prototype.project = ""; + + /** + * ListRegionNotificationEndpointsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + ListRegionNotificationEndpointsRequest.prototype.region = ""; + + /** + * ListRegionNotificationEndpointsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + ListRegionNotificationEndpointsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionNotificationEndpointsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + Object.defineProperty(ListRegionNotificationEndpointsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNotificationEndpointsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + Object.defineProperty(ListRegionNotificationEndpointsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNotificationEndpointsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + Object.defineProperty(ListRegionNotificationEndpointsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNotificationEndpointsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + Object.defineProperty(ListRegionNotificationEndpointsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionNotificationEndpointsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + */ + Object.defineProperty(ListRegionNotificationEndpointsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionNotificationEndpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionNotificationEndpointsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionNotificationEndpointsRequest} ListRegionNotificationEndpointsRequest instance + */ + ListRegionNotificationEndpointsRequest.create = function create(properties) { + return new ListRegionNotificationEndpointsRequest(properties); + }; + + /** + * Encodes the specified ListRegionNotificationEndpointsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionNotificationEndpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionNotificationEndpointsRequest} message ListRegionNotificationEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionNotificationEndpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionNotificationEndpointsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionNotificationEndpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionNotificationEndpointsRequest} message ListRegionNotificationEndpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionNotificationEndpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionNotificationEndpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionNotificationEndpointsRequest} ListRegionNotificationEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionNotificationEndpointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionNotificationEndpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionNotificationEndpointsRequest} ListRegionNotificationEndpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionNotificationEndpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionNotificationEndpointsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionNotificationEndpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionNotificationEndpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionNotificationEndpointsRequest} ListRegionNotificationEndpointsRequest + */ + ListRegionNotificationEndpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionNotificationEndpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @static + * @param {google.cloud.compute.v1.ListRegionNotificationEndpointsRequest} message ListRegionNotificationEndpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionNotificationEndpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionNotificationEndpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionNotificationEndpointsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionNotificationEndpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionNotificationEndpointsRequest; + })(); + + v1.DeleteRegionOperationRequest = (function() { + + /** + * Properties of a DeleteRegionOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionOperationRequest + * @property {string|null} [operation] DeleteRegionOperationRequest operation + * @property {string|null} [project] DeleteRegionOperationRequest project + * @property {string|null} [region] DeleteRegionOperationRequest region + */ + + /** + * Constructs a new DeleteRegionOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionOperationRequest. + * @implements IDeleteRegionOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionOperationRequest=} [properties] Properties to set + */ + function DeleteRegionOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @instance + */ + DeleteRegionOperationRequest.prototype.operation = ""; + + /** + * DeleteRegionOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @instance + */ + DeleteRegionOperationRequest.prototype.project = ""; + + /** + * DeleteRegionOperationRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @instance + */ + DeleteRegionOperationRequest.prototype.region = ""; + + /** + * Creates a new DeleteRegionOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionOperationRequest} DeleteRegionOperationRequest instance + */ + DeleteRegionOperationRequest.create = function create(properties) { + return new DeleteRegionOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionOperationRequest} message DeleteRegionOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteRegionOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionOperationRequest} message DeleteRegionOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionOperationRequest} DeleteRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionOperationRequest} DeleteRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a DeleteRegionOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionOperationRequest} DeleteRegionOperationRequest + */ + DeleteRegionOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionOperationRequest} message DeleteRegionOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.region = ""; + object.project = ""; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteRegionOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionOperationRequest; + })(); + + v1.DeleteRegionOperationResponse = (function() { + + /** + * Properties of a DeleteRegionOperationResponse. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionOperationResponse + */ + + /** + * Constructs a new DeleteRegionOperationResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionOperationResponse. + * @implements IDeleteRegionOperationResponse + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionOperationResponse=} [properties] Properties to set + */ + function DeleteRegionOperationResponse(properties) { + if (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 DeleteRegionOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteRegionOperationResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionOperationResponse} DeleteRegionOperationResponse instance + */ + DeleteRegionOperationResponse.create = function create(properties) { + return new DeleteRegionOperationResponse(properties); + }; + + /** + * Encodes the specified DeleteRegionOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteRegionOperationResponse} message DeleteRegionOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteRegionOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteRegionOperationResponse} message DeleteRegionOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionOperationResponse} DeleteRegionOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionOperationResponse} DeleteRegionOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionOperationResponse message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteRegionOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionOperationResponse} DeleteRegionOperationResponse + */ + DeleteRegionOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionOperationResponse) + return object; + return new $root.google.cloud.compute.v1.DeleteRegionOperationResponse(); + }; + + /** + * Creates a plain object from a DeleteRegionOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @static + * @param {google.cloud.compute.v1.DeleteRegionOperationResponse} message DeleteRegionOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteRegionOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionOperationResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionOperationResponse; + })(); + + v1.GetRegionOperationRequest = (function() { + + /** + * Properties of a GetRegionOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionOperationRequest + * @property {string|null} [operation] GetRegionOperationRequest operation + * @property {string|null} [project] GetRegionOperationRequest project + * @property {string|null} [region] GetRegionOperationRequest region + */ + + /** + * Constructs a new GetRegionOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionOperationRequest. + * @implements IGetRegionOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionOperationRequest=} [properties] Properties to set + */ + function GetRegionOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @instance + */ + GetRegionOperationRequest.prototype.operation = ""; + + /** + * GetRegionOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @instance + */ + GetRegionOperationRequest.prototype.project = ""; + + /** + * GetRegionOperationRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @instance + */ + GetRegionOperationRequest.prototype.region = ""; + + /** + * Creates a new GetRegionOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionOperationRequest} GetRegionOperationRequest instance + */ + GetRegionOperationRequest.create = function create(properties) { + return new GetRegionOperationRequest(properties); + }; + + /** + * Encodes the specified GetRegionOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionOperationRequest} message GetRegionOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionOperationRequest} message GetRegionOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionOperationRequest} GetRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionOperationRequest} GetRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionOperationRequest} GetRegionOperationRequest + */ + GetRegionOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.GetRegionOperationRequest} message GetRegionOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.region = ""; + object.project = ""; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionOperationRequest; + })(); + + v1.ListRegionOperationsRequest = (function() { + + /** + * Properties of a ListRegionOperationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionOperationsRequest + * @property {string|null} [filter] ListRegionOperationsRequest filter + * @property {number|null} [maxResults] ListRegionOperationsRequest maxResults + * @property {string|null} [orderBy] ListRegionOperationsRequest orderBy + * @property {string|null} [pageToken] ListRegionOperationsRequest pageToken + * @property {string|null} [project] ListRegionOperationsRequest project + * @property {string|null} [region] ListRegionOperationsRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionOperationsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionOperationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionOperationsRequest. + * @implements IListRegionOperationsRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionOperationsRequest=} [properties] Properties to set + */ + function ListRegionOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionOperationsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + ListRegionOperationsRequest.prototype.filter = null; + + /** + * ListRegionOperationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + ListRegionOperationsRequest.prototype.maxResults = null; + + /** + * ListRegionOperationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + ListRegionOperationsRequest.prototype.orderBy = null; + + /** + * ListRegionOperationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + ListRegionOperationsRequest.prototype.pageToken = null; + + /** + * ListRegionOperationsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + ListRegionOperationsRequest.prototype.project = ""; + + /** + * ListRegionOperationsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + ListRegionOperationsRequest.prototype.region = ""; + + /** + * ListRegionOperationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + ListRegionOperationsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionOperationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + Object.defineProperty(ListRegionOperationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionOperationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + Object.defineProperty(ListRegionOperationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionOperationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + Object.defineProperty(ListRegionOperationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionOperationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + Object.defineProperty(ListRegionOperationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionOperationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + */ + Object.defineProperty(ListRegionOperationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionOperationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionOperationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionOperationsRequest} ListRegionOperationsRequest instance + */ + ListRegionOperationsRequest.create = function create(properties) { + return new ListRegionOperationsRequest(properties); + }; + + /** + * Encodes the specified ListRegionOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionOperationsRequest} message ListRegionOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionOperationsRequest} message ListRegionOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionOperationsRequest} ListRegionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionOperationsRequest} ListRegionOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionOperationsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionOperationsRequest} ListRegionOperationsRequest + */ + ListRegionOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionOperationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionOperationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @static + * @param {google.cloud.compute.v1.ListRegionOperationsRequest} message ListRegionOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionOperationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionOperationsRequest; + })(); + + v1.WaitRegionOperationRequest = (function() { + + /** + * Properties of a WaitRegionOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IWaitRegionOperationRequest + * @property {string|null} [operation] WaitRegionOperationRequest operation + * @property {string|null} [project] WaitRegionOperationRequest project + * @property {string|null} [region] WaitRegionOperationRequest region + */ + + /** + * Constructs a new WaitRegionOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a WaitRegionOperationRequest. + * @implements IWaitRegionOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IWaitRegionOperationRequest=} [properties] Properties to set + */ + function WaitRegionOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitRegionOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @instance + */ + WaitRegionOperationRequest.prototype.operation = ""; + + /** + * WaitRegionOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @instance + */ + WaitRegionOperationRequest.prototype.project = ""; + + /** + * WaitRegionOperationRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @instance + */ + WaitRegionOperationRequest.prototype.region = ""; + + /** + * Creates a new WaitRegionOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitRegionOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.WaitRegionOperationRequest} WaitRegionOperationRequest instance + */ + WaitRegionOperationRequest.create = function create(properties) { + return new WaitRegionOperationRequest(properties); + }; + + /** + * Encodes the specified WaitRegionOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.WaitRegionOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitRegionOperationRequest} message WaitRegionOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitRegionOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified WaitRegionOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WaitRegionOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitRegionOperationRequest} message WaitRegionOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitRegionOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitRegionOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.WaitRegionOperationRequest} WaitRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitRegionOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.WaitRegionOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitRegionOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.WaitRegionOperationRequest} WaitRegionOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitRegionOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitRegionOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitRegionOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a WaitRegionOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.WaitRegionOperationRequest} WaitRegionOperationRequest + */ + WaitRegionOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.WaitRegionOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.WaitRegionOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a WaitRegionOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @static + * @param {google.cloud.compute.v1.WaitRegionOperationRequest} message WaitRegionOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitRegionOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operation = ""; + object.region = ""; + object.project = ""; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this WaitRegionOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.WaitRegionOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitRegionOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitRegionOperationRequest; + })(); + + v1.DeleteRegionSslCertificateRequest = (function() { + + /** + * Properties of a DeleteRegionSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionSslCertificateRequest + * @property {string|null} [project] DeleteRegionSslCertificateRequest project + * @property {string|null} [region] DeleteRegionSslCertificateRequest region + * @property {string|null} [requestId] DeleteRegionSslCertificateRequest requestId + * @property {string|null} [sslCertificate] DeleteRegionSslCertificateRequest sslCertificate + */ + + /** + * Constructs a new DeleteRegionSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionSslCertificateRequest. + * @implements IDeleteRegionSslCertificateRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionSslCertificateRequest=} [properties] Properties to set + */ + function DeleteRegionSslCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionSslCertificateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @instance + */ + DeleteRegionSslCertificateRequest.prototype.project = ""; + + /** + * DeleteRegionSslCertificateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @instance + */ + DeleteRegionSslCertificateRequest.prototype.region = ""; + + /** + * DeleteRegionSslCertificateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @instance + */ + DeleteRegionSslCertificateRequest.prototype.requestId = null; + + /** + * DeleteRegionSslCertificateRequest sslCertificate. + * @member {string} sslCertificate + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @instance + */ + DeleteRegionSslCertificateRequest.prototype.sslCertificate = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionSslCertificateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @instance + */ + Object.defineProperty(DeleteRegionSslCertificateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionSslCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionSslCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionSslCertificateRequest} DeleteRegionSslCertificateRequest instance + */ + DeleteRegionSslCertificateRequest.create = function create(properties) { + return new DeleteRegionSslCertificateRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionSslCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionSslCertificateRequest} message DeleteRegionSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionSslCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.sslCertificate != null && Object.hasOwnProperty.call(message, "sslCertificate")) + writer.uint32(/* id 46443492, wireType 2 =*/371547938).string(message.sslCertificate); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteRegionSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionSslCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionSslCertificateRequest} message DeleteRegionSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionSslCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionSslCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionSslCertificateRequest} DeleteRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionSslCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionSslCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 46443492: + message.sslCertificate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionSslCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionSslCertificateRequest} DeleteRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionSslCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionSslCertificateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionSslCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + if (!$util.isString(message.sslCertificate)) + return "sslCertificate: string expected"; + return null; + }; + + /** + * Creates a DeleteRegionSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionSslCertificateRequest} DeleteRegionSslCertificateRequest + */ + DeleteRegionSslCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionSslCertificateRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionSslCertificateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslCertificate != null) + message.sslCertificate = String(object.sslCertificate); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionSslCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionSslCertificateRequest} message DeleteRegionSslCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionSslCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslCertificate = ""; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + object.sslCertificate = message.sslCertificate; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteRegionSslCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionSslCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionSslCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionSslCertificateRequest; + })(); + + v1.GetRegionSslCertificateRequest = (function() { + + /** + * Properties of a GetRegionSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionSslCertificateRequest + * @property {string|null} [project] GetRegionSslCertificateRequest project + * @property {string|null} [region] GetRegionSslCertificateRequest region + * @property {string|null} [sslCertificate] GetRegionSslCertificateRequest sslCertificate + */ + + /** + * Constructs a new GetRegionSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionSslCertificateRequest. + * @implements IGetRegionSslCertificateRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionSslCertificateRequest=} [properties] Properties to set + */ + function GetRegionSslCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionSslCertificateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @instance + */ + GetRegionSslCertificateRequest.prototype.project = ""; + + /** + * GetRegionSslCertificateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @instance + */ + GetRegionSslCertificateRequest.prototype.region = ""; + + /** + * GetRegionSslCertificateRequest sslCertificate. + * @member {string} sslCertificate + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @instance + */ + GetRegionSslCertificateRequest.prototype.sslCertificate = ""; + + /** + * Creates a new GetRegionSslCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionSslCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionSslCertificateRequest} GetRegionSslCertificateRequest instance + */ + GetRegionSslCertificateRequest.create = function create(properties) { + return new GetRegionSslCertificateRequest(properties); + }; + + /** + * Encodes the specified GetRegionSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionSslCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionSslCertificateRequest} message GetRegionSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionSslCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslCertificate != null && Object.hasOwnProperty.call(message, "sslCertificate")) + writer.uint32(/* id 46443492, wireType 2 =*/371547938).string(message.sslCertificate); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionSslCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionSslCertificateRequest} message GetRegionSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionSslCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionSslCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionSslCertificateRequest} GetRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionSslCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionSslCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 46443492: + message.sslCertificate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionSslCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionSslCertificateRequest} GetRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionSslCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionSslCertificateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionSslCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + if (!$util.isString(message.sslCertificate)) + return "sslCertificate: string expected"; + return null; + }; + + /** + * Creates a GetRegionSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionSslCertificateRequest} GetRegionSslCertificateRequest + */ + GetRegionSslCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionSslCertificateRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionSslCertificateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.sslCertificate != null) + message.sslCertificate = String(object.sslCertificate); + return message; + }; + + /** + * Creates a plain object from a GetRegionSslCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.GetRegionSslCertificateRequest} message GetRegionSslCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionSslCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslCertificate = ""; + object.region = ""; + object.project = ""; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + object.sslCertificate = message.sslCertificate; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionSslCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionSslCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionSslCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionSslCertificateRequest; + })(); + + v1.InsertRegionSslCertificateRequest = (function() { + + /** + * Properties of an InsertRegionSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionSslCertificateRequest + * @property {string|null} [project] InsertRegionSslCertificateRequest project + * @property {string|null} [region] InsertRegionSslCertificateRequest region + * @property {string|null} [requestId] InsertRegionSslCertificateRequest requestId + * @property {google.cloud.compute.v1.ISslCertificate|null} [sslCertificateResource] InsertRegionSslCertificateRequest sslCertificateResource + */ + + /** + * Constructs a new InsertRegionSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionSslCertificateRequest. + * @implements IInsertRegionSslCertificateRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionSslCertificateRequest=} [properties] Properties to set + */ + function InsertRegionSslCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionSslCertificateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @instance + */ + InsertRegionSslCertificateRequest.prototype.project = ""; + + /** + * InsertRegionSslCertificateRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @instance + */ + InsertRegionSslCertificateRequest.prototype.region = ""; + + /** + * InsertRegionSslCertificateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @instance + */ + InsertRegionSslCertificateRequest.prototype.requestId = null; + + /** + * InsertRegionSslCertificateRequest sslCertificateResource. + * @member {google.cloud.compute.v1.ISslCertificate|null|undefined} sslCertificateResource + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @instance + */ + InsertRegionSslCertificateRequest.prototype.sslCertificateResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionSslCertificateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @instance + */ + Object.defineProperty(InsertRegionSslCertificateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionSslCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionSslCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionSslCertificateRequest} InsertRegionSslCertificateRequest instance + */ + InsertRegionSslCertificateRequest.create = function create(properties) { + return new InsertRegionSslCertificateRequest(properties); + }; + + /** + * Encodes the specified InsertRegionSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionSslCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionSslCertificateRequest} message InsertRegionSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionSslCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.sslCertificateResource != null && Object.hasOwnProperty.call(message, "sslCertificateResource")) + $root.google.cloud.compute.v1.SslCertificate.encode(message.sslCertificateResource, writer.uint32(/* id 180709897, wireType 2 =*/1445679178).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRegionSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionSslCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionSslCertificateRequest} message InsertRegionSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionSslCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionSslCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionSslCertificateRequest} InsertRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionSslCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionSslCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 180709897: + message.sslCertificateResource = $root.google.cloud.compute.v1.SslCertificate.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionSslCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionSslCertificateRequest} InsertRegionSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionSslCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionSslCertificateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionSslCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslCertificateResource != null && message.hasOwnProperty("sslCertificateResource")) { + var error = $root.google.cloud.compute.v1.SslCertificate.verify(message.sslCertificateResource); + if (error) + return "sslCertificateResource." + error; + } + return null; + }; + + /** + * Creates an InsertRegionSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionSslCertificateRequest} InsertRegionSslCertificateRequest + */ + InsertRegionSslCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionSslCertificateRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionSslCertificateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslCertificateResource != null) { + if (typeof object.sslCertificateResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionSslCertificateRequest.sslCertificateResource: object expected"); + message.sslCertificateResource = $root.google.cloud.compute.v1.SslCertificate.fromObject(object.sslCertificateResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertRegionSslCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionSslCertificateRequest} message InsertRegionSslCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionSslCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.sslCertificateResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.sslCertificateResource != null && message.hasOwnProperty("sslCertificateResource")) + object.sslCertificateResource = $root.google.cloud.compute.v1.SslCertificate.toObject(message.sslCertificateResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRegionSslCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionSslCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionSslCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionSslCertificateRequest; + })(); + + v1.ListRegionSslCertificatesRequest = (function() { + + /** + * Properties of a ListRegionSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionSslCertificatesRequest + * @property {string|null} [filter] ListRegionSslCertificatesRequest filter + * @property {number|null} [maxResults] ListRegionSslCertificatesRequest maxResults + * @property {string|null} [orderBy] ListRegionSslCertificatesRequest orderBy + * @property {string|null} [pageToken] ListRegionSslCertificatesRequest pageToken + * @property {string|null} [project] ListRegionSslCertificatesRequest project + * @property {string|null} [region] ListRegionSslCertificatesRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionSslCertificatesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionSslCertificatesRequest. + * @implements IListRegionSslCertificatesRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionSslCertificatesRequest=} [properties] Properties to set + */ + function ListRegionSslCertificatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionSslCertificatesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + ListRegionSslCertificatesRequest.prototype.filter = null; + + /** + * ListRegionSslCertificatesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + ListRegionSslCertificatesRequest.prototype.maxResults = null; + + /** + * ListRegionSslCertificatesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + ListRegionSslCertificatesRequest.prototype.orderBy = null; + + /** + * ListRegionSslCertificatesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + ListRegionSslCertificatesRequest.prototype.pageToken = null; + + /** + * ListRegionSslCertificatesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + ListRegionSslCertificatesRequest.prototype.project = ""; + + /** + * ListRegionSslCertificatesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + ListRegionSslCertificatesRequest.prototype.region = ""; + + /** + * ListRegionSslCertificatesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + ListRegionSslCertificatesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionSslCertificatesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListRegionSslCertificatesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionSslCertificatesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListRegionSslCertificatesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionSslCertificatesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListRegionSslCertificatesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionSslCertificatesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListRegionSslCertificatesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionSslCertificatesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListRegionSslCertificatesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionSslCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionSslCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionSslCertificatesRequest} ListRegionSslCertificatesRequest instance + */ + ListRegionSslCertificatesRequest.create = function create(properties) { + return new ListRegionSslCertificatesRequest(properties); + }; + + /** + * Encodes the specified ListRegionSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionSslCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionSslCertificatesRequest} message ListRegionSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionSslCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionSslCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionSslCertificatesRequest} message ListRegionSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionSslCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionSslCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionSslCertificatesRequest} ListRegionSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionSslCertificatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionSslCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionSslCertificatesRequest} ListRegionSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionSslCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionSslCertificatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionSslCertificatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionSslCertificatesRequest} ListRegionSslCertificatesRequest + */ + ListRegionSslCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionSslCertificatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionSslCertificatesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionSslCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ListRegionSslCertificatesRequest} message ListRegionSslCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionSslCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionSslCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionSslCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionSslCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionSslCertificatesRequest; + })(); + + v1.DeleteRegionTargetHttpProxyRequest = (function() { + + /** + * Properties of a DeleteRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionTargetHttpProxyRequest + * @property {string|null} [project] DeleteRegionTargetHttpProxyRequest project + * @property {string|null} [region] DeleteRegionTargetHttpProxyRequest region + * @property {string|null} [requestId] DeleteRegionTargetHttpProxyRequest requestId + * @property {string|null} [targetHttpProxy] DeleteRegionTargetHttpProxyRequest targetHttpProxy + */ + + /** + * Constructs a new DeleteRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionTargetHttpProxyRequest. + * @implements IDeleteRegionTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest=} [properties] Properties to set + */ + function DeleteRegionTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @instance + */ + DeleteRegionTargetHttpProxyRequest.prototype.project = ""; + + /** + * DeleteRegionTargetHttpProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @instance + */ + DeleteRegionTargetHttpProxyRequest.prototype.region = ""; + + /** + * DeleteRegionTargetHttpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @instance + */ + DeleteRegionTargetHttpProxyRequest.prototype.requestId = null; + + /** + * DeleteRegionTargetHttpProxyRequest targetHttpProxy. + * @member {string} targetHttpProxy + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @instance + */ + DeleteRegionTargetHttpProxyRequest.prototype.targetHttpProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionTargetHttpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @instance + */ + Object.defineProperty(DeleteRegionTargetHttpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest} DeleteRegionTargetHttpProxyRequest instance + */ + DeleteRegionTargetHttpProxyRequest.create = function create(properties) { + return new DeleteRegionTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest} message DeleteRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.targetHttpProxy != null && Object.hasOwnProperty.call(message, "targetHttpProxy")) + writer.uint32(/* id 206872421, wireType 2 =*/1654979370).string(message.targetHttpProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest} message DeleteRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest} DeleteRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 206872421: + message.targetHttpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest} DeleteRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + if (!$util.isString(message.targetHttpProxy)) + return "targetHttpProxy: string expected"; + return null; + }; + + /** + * Creates a DeleteRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest} DeleteRegionTargetHttpProxyRequest + */ + DeleteRegionTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpProxy != null) + message.targetHttpProxy = String(object.targetHttpProxy); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest} message DeleteRegionTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.targetHttpProxy = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + object.targetHttpProxy = message.targetHttpProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteRegionTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionTargetHttpProxyRequest; + })(); + + v1.GetRegionTargetHttpProxyRequest = (function() { + + /** + * Properties of a GetRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionTargetHttpProxyRequest + * @property {string|null} [project] GetRegionTargetHttpProxyRequest project + * @property {string|null} [region] GetRegionTargetHttpProxyRequest region + * @property {string|null} [targetHttpProxy] GetRegionTargetHttpProxyRequest targetHttpProxy + */ + + /** + * Constructs a new GetRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionTargetHttpProxyRequest. + * @implements IGetRegionTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest=} [properties] Properties to set + */ + function GetRegionTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @instance + */ + GetRegionTargetHttpProxyRequest.prototype.project = ""; + + /** + * GetRegionTargetHttpProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @instance + */ + GetRegionTargetHttpProxyRequest.prototype.region = ""; + + /** + * GetRegionTargetHttpProxyRequest targetHttpProxy. + * @member {string} targetHttpProxy + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @instance + */ + GetRegionTargetHttpProxyRequest.prototype.targetHttpProxy = ""; + + /** + * Creates a new GetRegionTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionTargetHttpProxyRequest} GetRegionTargetHttpProxyRequest instance + */ + GetRegionTargetHttpProxyRequest.create = function create(properties) { + return new GetRegionTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified GetRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest} message GetRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.targetHttpProxy != null && Object.hasOwnProperty.call(message, "targetHttpProxy")) + writer.uint32(/* id 206872421, wireType 2 =*/1654979370).string(message.targetHttpProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest} message GetRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionTargetHttpProxyRequest} GetRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 206872421: + message.targetHttpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionTargetHttpProxyRequest} GetRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + if (!$util.isString(message.targetHttpProxy)) + return "targetHttpProxy: string expected"; + return null; + }; + + /** + * Creates a GetRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionTargetHttpProxyRequest} GetRegionTargetHttpProxyRequest + */ + GetRegionTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.targetHttpProxy != null) + message.targetHttpProxy = String(object.targetHttpProxy); + return message; + }; + + /** + * Creates a plain object from a GetRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.GetRegionTargetHttpProxyRequest} message GetRegionTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.targetHttpProxy = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + object.targetHttpProxy = message.targetHttpProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionTargetHttpProxyRequest; + })(); + + v1.InsertRegionTargetHttpProxyRequest = (function() { + + /** + * Properties of an InsertRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionTargetHttpProxyRequest + * @property {string|null} [project] InsertRegionTargetHttpProxyRequest project + * @property {string|null} [region] InsertRegionTargetHttpProxyRequest region + * @property {string|null} [requestId] InsertRegionTargetHttpProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetHttpProxy|null} [targetHttpProxyResource] InsertRegionTargetHttpProxyRequest targetHttpProxyResource + */ + + /** + * Constructs a new InsertRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionTargetHttpProxyRequest. + * @implements IInsertRegionTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest=} [properties] Properties to set + */ + function InsertRegionTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @instance + */ + InsertRegionTargetHttpProxyRequest.prototype.project = ""; + + /** + * InsertRegionTargetHttpProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @instance + */ + InsertRegionTargetHttpProxyRequest.prototype.region = ""; + + /** + * InsertRegionTargetHttpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @instance + */ + InsertRegionTargetHttpProxyRequest.prototype.requestId = null; + + /** + * InsertRegionTargetHttpProxyRequest targetHttpProxyResource. + * @member {google.cloud.compute.v1.ITargetHttpProxy|null|undefined} targetHttpProxyResource + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @instance + */ + InsertRegionTargetHttpProxyRequest.prototype.targetHttpProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionTargetHttpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @instance + */ + Object.defineProperty(InsertRegionTargetHttpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest} InsertRegionTargetHttpProxyRequest instance + */ + InsertRegionTargetHttpProxyRequest.create = function create(properties) { + return new InsertRegionTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified InsertRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest} message InsertRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetHttpProxyResource != null && Object.hasOwnProperty.call(message, "targetHttpProxyResource")) + $root.google.cloud.compute.v1.TargetHttpProxy.encode(message.targetHttpProxyResource, writer.uint32(/* id 24696744, wireType 2 =*/197573954).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest} message InsertRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest} InsertRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 24696744: + message.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest} InsertRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpProxyResource != null && message.hasOwnProperty("targetHttpProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpProxy.verify(message.targetHttpProxyResource); + if (error) + return "targetHttpProxyResource." + error; + } + return null; + }; + + /** + * Creates an InsertRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest} InsertRegionTargetHttpProxyRequest + */ + InsertRegionTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpProxyResource != null) { + if (typeof object.targetHttpProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest.targetHttpProxyResource: object expected"); + message.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.fromObject(object.targetHttpProxyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest} message InsertRegionTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpProxyResource = null; + object.region = ""; + object.project = ""; + } + if (message.targetHttpProxyResource != null && message.hasOwnProperty("targetHttpProxyResource")) + object.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.toObject(message.targetHttpProxyResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRegionTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionTargetHttpProxyRequest; + })(); + + v1.ListRegionTargetHttpProxiesRequest = (function() { + + /** + * Properties of a ListRegionTargetHttpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionTargetHttpProxiesRequest + * @property {string|null} [filter] ListRegionTargetHttpProxiesRequest filter + * @property {number|null} [maxResults] ListRegionTargetHttpProxiesRequest maxResults + * @property {string|null} [orderBy] ListRegionTargetHttpProxiesRequest orderBy + * @property {string|null} [pageToken] ListRegionTargetHttpProxiesRequest pageToken + * @property {string|null} [project] ListRegionTargetHttpProxiesRequest project + * @property {string|null} [region] ListRegionTargetHttpProxiesRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionTargetHttpProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionTargetHttpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionTargetHttpProxiesRequest. + * @implements IListRegionTargetHttpProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest=} [properties] Properties to set + */ + function ListRegionTargetHttpProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionTargetHttpProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + ListRegionTargetHttpProxiesRequest.prototype.filter = null; + + /** + * ListRegionTargetHttpProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + ListRegionTargetHttpProxiesRequest.prototype.maxResults = null; + + /** + * ListRegionTargetHttpProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + ListRegionTargetHttpProxiesRequest.prototype.orderBy = null; + + /** + * ListRegionTargetHttpProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + ListRegionTargetHttpProxiesRequest.prototype.pageToken = null; + + /** + * ListRegionTargetHttpProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + ListRegionTargetHttpProxiesRequest.prototype.project = ""; + + /** + * ListRegionTargetHttpProxiesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + ListRegionTargetHttpProxiesRequest.prototype.region = ""; + + /** + * ListRegionTargetHttpProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + ListRegionTargetHttpProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionTargetHttpProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionTargetHttpProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest} ListRegionTargetHttpProxiesRequest instance + */ + ListRegionTargetHttpProxiesRequest.create = function create(properties) { + return new ListRegionTargetHttpProxiesRequest(properties); + }; + + /** + * Encodes the specified ListRegionTargetHttpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest} message ListRegionTargetHttpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionTargetHttpProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionTargetHttpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest} message ListRegionTargetHttpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionTargetHttpProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionTargetHttpProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest} ListRegionTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionTargetHttpProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionTargetHttpProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest} ListRegionTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionTargetHttpProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionTargetHttpProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionTargetHttpProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionTargetHttpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest} ListRegionTargetHttpProxiesRequest + */ + ListRegionTargetHttpProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionTargetHttpProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest} message ListRegionTargetHttpProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionTargetHttpProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionTargetHttpProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionTargetHttpProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionTargetHttpProxiesRequest; + })(); + + v1.SetUrlMapRegionTargetHttpProxyRequest = (function() { + + /** + * Properties of a SetUrlMapRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetUrlMapRegionTargetHttpProxyRequest + * @property {string|null} [project] SetUrlMapRegionTargetHttpProxyRequest project + * @property {string|null} [region] SetUrlMapRegionTargetHttpProxyRequest region + * @property {string|null} [requestId] SetUrlMapRegionTargetHttpProxyRequest requestId + * @property {string|null} [targetHttpProxy] SetUrlMapRegionTargetHttpProxyRequest targetHttpProxy + * @property {google.cloud.compute.v1.IUrlMapReference|null} [urlMapReferenceResource] SetUrlMapRegionTargetHttpProxyRequest urlMapReferenceResource + */ + + /** + * Constructs a new SetUrlMapRegionTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetUrlMapRegionTargetHttpProxyRequest. + * @implements ISetUrlMapRegionTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest=} [properties] Properties to set + */ + function SetUrlMapRegionTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetUrlMapRegionTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpProxyRequest.prototype.project = ""; + + /** + * SetUrlMapRegionTargetHttpProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpProxyRequest.prototype.region = ""; + + /** + * SetUrlMapRegionTargetHttpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpProxyRequest.prototype.requestId = null; + + /** + * SetUrlMapRegionTargetHttpProxyRequest targetHttpProxy. + * @member {string} targetHttpProxy + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpProxyRequest.prototype.targetHttpProxy = ""; + + /** + * SetUrlMapRegionTargetHttpProxyRequest urlMapReferenceResource. + * @member {google.cloud.compute.v1.IUrlMapReference|null|undefined} urlMapReferenceResource + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpProxyRequest.prototype.urlMapReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetUrlMapRegionTargetHttpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @instance + */ + Object.defineProperty(SetUrlMapRegionTargetHttpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetUrlMapRegionTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest} SetUrlMapRegionTargetHttpProxyRequest instance + */ + SetUrlMapRegionTargetHttpProxyRequest.create = function create(properties) { + return new SetUrlMapRegionTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest} message SetUrlMapRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapRegionTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.targetHttpProxy != null && Object.hasOwnProperty.call(message, "targetHttpProxy")) + writer.uint32(/* id 206872421, wireType 2 =*/1654979370).string(message.targetHttpProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMapReferenceResource != null && Object.hasOwnProperty.call(message, "urlMapReferenceResource")) + $root.google.cloud.compute.v1.UrlMapReference.encode(message.urlMapReferenceResource, writer.uint32(/* id 398701333, wireType 2 =*/3189610666).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest} message SetUrlMapRegionTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapRegionTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetUrlMapRegionTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest} SetUrlMapRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapRegionTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 206872421: + message.targetHttpProxy = reader.string(); + break; + case 398701333: + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetUrlMapRegionTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest} SetUrlMapRegionTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapRegionTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetUrlMapRegionTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetUrlMapRegionTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + if (!$util.isString(message.targetHttpProxy)) + return "targetHttpProxy: string expected"; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) { + var error = $root.google.cloud.compute.v1.UrlMapReference.verify(message.urlMapReferenceResource); + if (error) + return "urlMapReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetUrlMapRegionTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest} SetUrlMapRegionTargetHttpProxyRequest + */ + SetUrlMapRegionTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpProxy != null) + message.targetHttpProxy = String(object.targetHttpProxy); + if (object.urlMapReferenceResource != null) { + if (typeof object.urlMapReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest.urlMapReferenceResource: object expected"); + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.fromObject(object.urlMapReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetUrlMapRegionTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest} message SetUrlMapRegionTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetUrlMapRegionTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.targetHttpProxy = ""; + object.project = ""; + object.urlMapReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + object.targetHttpProxy = message.targetHttpProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) + object.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.toObject(message.urlMapReferenceResource, options); + return object; + }; + + /** + * Converts this SetUrlMapRegionTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetUrlMapRegionTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetUrlMapRegionTargetHttpProxyRequest; + })(); + + v1.DeleteRegionTargetHttpsProxyRequest = (function() { + + /** + * Properties of a DeleteRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionTargetHttpsProxyRequest + * @property {string|null} [project] DeleteRegionTargetHttpsProxyRequest project + * @property {string|null} [region] DeleteRegionTargetHttpsProxyRequest region + * @property {string|null} [requestId] DeleteRegionTargetHttpsProxyRequest requestId + * @property {string|null} [targetHttpsProxy] DeleteRegionTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new DeleteRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionTargetHttpsProxyRequest. + * @implements IDeleteRegionTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest=} [properties] Properties to set + */ + function DeleteRegionTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @instance + */ + DeleteRegionTargetHttpsProxyRequest.prototype.project = ""; + + /** + * DeleteRegionTargetHttpsProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @instance + */ + DeleteRegionTargetHttpsProxyRequest.prototype.region = ""; + + /** + * DeleteRegionTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @instance + */ + DeleteRegionTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * DeleteRegionTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @instance + */ + DeleteRegionTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(DeleteRegionTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest} DeleteRegionTargetHttpsProxyRequest instance + */ + DeleteRegionTargetHttpsProxyRequest.create = function create(properties) { + return new DeleteRegionTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest} message DeleteRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest} message DeleteRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest} DeleteRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest} DeleteRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a DeleteRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest} DeleteRegionTargetHttpsProxyRequest + */ + DeleteRegionTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest} message DeleteRegionTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteRegionTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionTargetHttpsProxyRequest; + })(); + + v1.GetRegionTargetHttpsProxyRequest = (function() { + + /** + * Properties of a GetRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionTargetHttpsProxyRequest + * @property {string|null} [project] GetRegionTargetHttpsProxyRequest project + * @property {string|null} [region] GetRegionTargetHttpsProxyRequest region + * @property {string|null} [targetHttpsProxy] GetRegionTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new GetRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionTargetHttpsProxyRequest. + * @implements IGetRegionTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest=} [properties] Properties to set + */ + function GetRegionTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @instance + */ + GetRegionTargetHttpsProxyRequest.prototype.project = ""; + + /** + * GetRegionTargetHttpsProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @instance + */ + GetRegionTargetHttpsProxyRequest.prototype.region = ""; + + /** + * GetRegionTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @instance + */ + GetRegionTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + /** + * Creates a new GetRegionTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest} GetRegionTargetHttpsProxyRequest instance + */ + GetRegionTargetHttpsProxyRequest.create = function create(properties) { + return new GetRegionTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified GetRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest} message GetRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest} message GetRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest} GetRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest} GetRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a GetRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest} GetRegionTargetHttpsProxyRequest + */ + GetRegionTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a GetRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest} message GetRegionTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.region = ""; + object.project = ""; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionTargetHttpsProxyRequest; + })(); + + v1.InsertRegionTargetHttpsProxyRequest = (function() { + + /** + * Properties of an InsertRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionTargetHttpsProxyRequest + * @property {string|null} [project] InsertRegionTargetHttpsProxyRequest project + * @property {string|null} [region] InsertRegionTargetHttpsProxyRequest region + * @property {string|null} [requestId] InsertRegionTargetHttpsProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetHttpsProxy|null} [targetHttpsProxyResource] InsertRegionTargetHttpsProxyRequest targetHttpsProxyResource + */ + + /** + * Constructs a new InsertRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionTargetHttpsProxyRequest. + * @implements IInsertRegionTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest=} [properties] Properties to set + */ + function InsertRegionTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @instance + */ + InsertRegionTargetHttpsProxyRequest.prototype.project = ""; + + /** + * InsertRegionTargetHttpsProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @instance + */ + InsertRegionTargetHttpsProxyRequest.prototype.region = ""; + + /** + * InsertRegionTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @instance + */ + InsertRegionTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * InsertRegionTargetHttpsProxyRequest targetHttpsProxyResource. + * @member {google.cloud.compute.v1.ITargetHttpsProxy|null|undefined} targetHttpsProxyResource + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @instance + */ + InsertRegionTargetHttpsProxyRequest.prototype.targetHttpsProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(InsertRegionTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest} InsertRegionTargetHttpsProxyRequest instance + */ + InsertRegionTargetHttpsProxyRequest.create = function create(properties) { + return new InsertRegionTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified InsertRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest} message InsertRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetHttpsProxyResource != null && Object.hasOwnProperty.call(message, "targetHttpsProxyResource")) + $root.google.cloud.compute.v1.TargetHttpsProxy.encode(message.targetHttpsProxyResource, writer.uint32(/* id 433657473, wireType 2 =*/3469259786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest} message InsertRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest} InsertRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 433657473: + message.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest} InsertRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxyResource != null && message.hasOwnProperty("targetHttpsProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxy.verify(message.targetHttpsProxyResource); + if (error) + return "targetHttpsProxyResource." + error; + } + return null; + }; + + /** + * Creates an InsertRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest} InsertRegionTargetHttpsProxyRequest + */ + InsertRegionTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxyResource != null) { + if (typeof object.targetHttpsProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest.targetHttpsProxyResource: object expected"); + message.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.fromObject(object.targetHttpsProxyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest} message InsertRegionTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.targetHttpsProxyResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetHttpsProxyResource != null && message.hasOwnProperty("targetHttpsProxyResource")) + object.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.toObject(message.targetHttpsProxyResource, options); + return object; + }; + + /** + * Converts this InsertRegionTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionTargetHttpsProxyRequest; + })(); + + v1.ListRegionTargetHttpsProxiesRequest = (function() { + + /** + * Properties of a ListRegionTargetHttpsProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionTargetHttpsProxiesRequest + * @property {string|null} [filter] ListRegionTargetHttpsProxiesRequest filter + * @property {number|null} [maxResults] ListRegionTargetHttpsProxiesRequest maxResults + * @property {string|null} [orderBy] ListRegionTargetHttpsProxiesRequest orderBy + * @property {string|null} [pageToken] ListRegionTargetHttpsProxiesRequest pageToken + * @property {string|null} [project] ListRegionTargetHttpsProxiesRequest project + * @property {string|null} [region] ListRegionTargetHttpsProxiesRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionTargetHttpsProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionTargetHttpsProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionTargetHttpsProxiesRequest. + * @implements IListRegionTargetHttpsProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest=} [properties] Properties to set + */ + function ListRegionTargetHttpsProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionTargetHttpsProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + ListRegionTargetHttpsProxiesRequest.prototype.filter = null; + + /** + * ListRegionTargetHttpsProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + ListRegionTargetHttpsProxiesRequest.prototype.maxResults = null; + + /** + * ListRegionTargetHttpsProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + ListRegionTargetHttpsProxiesRequest.prototype.orderBy = null; + + /** + * ListRegionTargetHttpsProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + ListRegionTargetHttpsProxiesRequest.prototype.pageToken = null; + + /** + * ListRegionTargetHttpsProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + ListRegionTargetHttpsProxiesRequest.prototype.project = ""; + + /** + * ListRegionTargetHttpsProxiesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + ListRegionTargetHttpsProxiesRequest.prototype.region = ""; + + /** + * ListRegionTargetHttpsProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + ListRegionTargetHttpsProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionTargetHttpsProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpsProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpsProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpsProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpsProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpsProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpsProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpsProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionTargetHttpsProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListRegionTargetHttpsProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionTargetHttpsProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest} ListRegionTargetHttpsProxiesRequest instance + */ + ListRegionTargetHttpsProxiesRequest.create = function create(properties) { + return new ListRegionTargetHttpsProxiesRequest(properties); + }; + + /** + * Encodes the specified ListRegionTargetHttpsProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest} message ListRegionTargetHttpsProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionTargetHttpsProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionTargetHttpsProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest} message ListRegionTargetHttpsProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionTargetHttpsProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionTargetHttpsProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest} ListRegionTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionTargetHttpsProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionTargetHttpsProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest} ListRegionTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionTargetHttpsProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionTargetHttpsProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionTargetHttpsProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionTargetHttpsProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest} ListRegionTargetHttpsProxiesRequest + */ + ListRegionTargetHttpsProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionTargetHttpsProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest} message ListRegionTargetHttpsProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionTargetHttpsProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionTargetHttpsProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionTargetHttpsProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionTargetHttpsProxiesRequest; + })(); + + v1.SetSslCertificatesRegionTargetHttpsProxyRequest = (function() { + + /** + * Properties of a SetSslCertificatesRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetSslCertificatesRegionTargetHttpsProxyRequest + * @property {string|null} [project] SetSslCertificatesRegionTargetHttpsProxyRequest project + * @property {string|null} [region] SetSslCertificatesRegionTargetHttpsProxyRequest region + * @property {google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest|null} [regionTargetHttpsProxiesSetSslCertificatesRequestResource] SetSslCertificatesRegionTargetHttpsProxyRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource + * @property {string|null} [requestId] SetSslCertificatesRegionTargetHttpsProxyRequest requestId + * @property {string|null} [targetHttpsProxy] SetSslCertificatesRegionTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new SetSslCertificatesRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetSslCertificatesRegionTargetHttpsProxyRequest. + * @implements ISetSslCertificatesRegionTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest=} [properties] Properties to set + */ + function SetSslCertificatesRegionTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetSslCertificatesRegionTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.prototype.project = ""; + + /** + * SetSslCertificatesRegionTargetHttpsProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.prototype.region = ""; + + /** + * SetSslCertificatesRegionTargetHttpsProxyRequest regionTargetHttpsProxiesSetSslCertificatesRequestResource. + * @member {google.cloud.compute.v1.IRegionTargetHttpsProxiesSetSslCertificatesRequest|null|undefined} regionTargetHttpsProxiesSetSslCertificatesRequestResource + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.prototype.regionTargetHttpsProxiesSetSslCertificatesRequestResource = null; + + /** + * SetSslCertificatesRegionTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * SetSslCertificatesRegionTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetSslCertificatesRegionTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(SetSslCertificatesRegionTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetSslCertificatesRegionTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest} SetSslCertificatesRegionTargetHttpsProxyRequest instance + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.create = function create(properties) { + return new SetSslCertificatesRegionTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified SetSslCertificatesRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest} message SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionTargetHttpsProxiesSetSslCertificatesRequestResource != null && Object.hasOwnProperty.call(message, "regionTargetHttpsProxiesSetSslCertificatesRequestResource")) + $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.encode(message.regionTargetHttpsProxiesSetSslCertificatesRequestResource, writer.uint32(/* id 390693383, wireType 2 =*/3125547066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetSslCertificatesRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest} message SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetSslCertificatesRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest} SetSslCertificatesRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 390693383: + message.regionTargetHttpsProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetSslCertificatesRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest} SetSslCertificatesRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetSslCertificatesRegionTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionTargetHttpsProxiesSetSslCertificatesRequestResource != null && message.hasOwnProperty("regionTargetHttpsProxiesSetSslCertificatesRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.verify(message.regionTargetHttpsProxiesSetSslCertificatesRequestResource); + if (error) + return "regionTargetHttpsProxiesSetSslCertificatesRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a SetSslCertificatesRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest} SetSslCertificatesRegionTargetHttpsProxyRequest + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionTargetHttpsProxiesSetSslCertificatesRequestResource != null) { + if (typeof object.regionTargetHttpsProxiesSetSslCertificatesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest.regionTargetHttpsProxiesSetSslCertificatesRequestResource: object expected"); + message.regionTargetHttpsProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.fromObject(object.regionTargetHttpsProxiesSetSslCertificatesRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a SetSslCertificatesRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest} message SetSslCertificatesRegionTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.region = ""; + object.project = ""; + object.regionTargetHttpsProxiesSetSslCertificatesRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionTargetHttpsProxiesSetSslCertificatesRequestResource != null && message.hasOwnProperty("regionTargetHttpsProxiesSetSslCertificatesRequestResource")) + object.regionTargetHttpsProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest.toObject(message.regionTargetHttpsProxiesSetSslCertificatesRequestResource, options); + return object; + }; + + /** + * Converts this SetSslCertificatesRegionTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetSslCertificatesRegionTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetSslCertificatesRegionTargetHttpsProxyRequest; + })(); + + v1.SetUrlMapRegionTargetHttpsProxyRequest = (function() { + + /** + * Properties of a SetUrlMapRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetUrlMapRegionTargetHttpsProxyRequest + * @property {string|null} [project] SetUrlMapRegionTargetHttpsProxyRequest project + * @property {string|null} [region] SetUrlMapRegionTargetHttpsProxyRequest region + * @property {string|null} [requestId] SetUrlMapRegionTargetHttpsProxyRequest requestId + * @property {string|null} [targetHttpsProxy] SetUrlMapRegionTargetHttpsProxyRequest targetHttpsProxy + * @property {google.cloud.compute.v1.IUrlMapReference|null} [urlMapReferenceResource] SetUrlMapRegionTargetHttpsProxyRequest urlMapReferenceResource + */ + + /** + * Constructs a new SetUrlMapRegionTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetUrlMapRegionTargetHttpsProxyRequest. + * @implements ISetUrlMapRegionTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest=} [properties] Properties to set + */ + function SetUrlMapRegionTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetUrlMapRegionTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpsProxyRequest.prototype.project = ""; + + /** + * SetUrlMapRegionTargetHttpsProxyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpsProxyRequest.prototype.region = ""; + + /** + * SetUrlMapRegionTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * SetUrlMapRegionTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + /** + * SetUrlMapRegionTargetHttpsProxyRequest urlMapReferenceResource. + * @member {google.cloud.compute.v1.IUrlMapReference|null|undefined} urlMapReferenceResource + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @instance + */ + SetUrlMapRegionTargetHttpsProxyRequest.prototype.urlMapReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetUrlMapRegionTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(SetUrlMapRegionTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetUrlMapRegionTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest} SetUrlMapRegionTargetHttpsProxyRequest instance + */ + SetUrlMapRegionTargetHttpsProxyRequest.create = function create(properties) { + return new SetUrlMapRegionTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest} message SetUrlMapRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapRegionTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMapReferenceResource != null && Object.hasOwnProperty.call(message, "urlMapReferenceResource")) + $root.google.cloud.compute.v1.UrlMapReference.encode(message.urlMapReferenceResource, writer.uint32(/* id 398701333, wireType 2 =*/3189610666).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetUrlMapRegionTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest} message SetUrlMapRegionTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapRegionTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetUrlMapRegionTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest} SetUrlMapRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapRegionTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + case 398701333: + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetUrlMapRegionTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest} SetUrlMapRegionTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapRegionTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetUrlMapRegionTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetUrlMapRegionTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) { + var error = $root.google.cloud.compute.v1.UrlMapReference.verify(message.urlMapReferenceResource); + if (error) + return "urlMapReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetUrlMapRegionTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest} SetUrlMapRegionTargetHttpsProxyRequest + */ + SetUrlMapRegionTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + if (object.urlMapReferenceResource != null) { + if (typeof object.urlMapReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest.urlMapReferenceResource: object expected"); + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.fromObject(object.urlMapReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetUrlMapRegionTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest} message SetUrlMapRegionTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetUrlMapRegionTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.region = ""; + object.project = ""; + object.urlMapReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) + object.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.toObject(message.urlMapReferenceResource, options); + return object; + }; + + /** + * Converts this SetUrlMapRegionTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetUrlMapRegionTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetUrlMapRegionTargetHttpsProxyRequest; + })(); + + v1.DeleteRegionUrlMapRequest = (function() { + + /** + * Properties of a DeleteRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRegionUrlMapRequest + * @property {string|null} [project] DeleteRegionUrlMapRequest project + * @property {string|null} [region] DeleteRegionUrlMapRequest region + * @property {string|null} [requestId] DeleteRegionUrlMapRequest requestId + * @property {string|null} [urlMap] DeleteRegionUrlMapRequest urlMap + */ + + /** + * Constructs a new DeleteRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRegionUrlMapRequest. + * @implements IDeleteRegionUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRegionUrlMapRequest=} [properties] Properties to set + */ + function DeleteRegionUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRegionUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @instance + */ + DeleteRegionUrlMapRequest.prototype.project = ""; + + /** + * DeleteRegionUrlMapRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @instance + */ + DeleteRegionUrlMapRequest.prototype.region = ""; + + /** + * DeleteRegionUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @instance + */ + DeleteRegionUrlMapRequest.prototype.requestId = null; + + /** + * DeleteRegionUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @instance + */ + DeleteRegionUrlMapRequest.prototype.urlMap = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRegionUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @instance + */ + Object.defineProperty(DeleteRegionUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRegionUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRegionUrlMapRequest} DeleteRegionUrlMapRequest instance + */ + DeleteRegionUrlMapRequest.create = function create(properties) { + return new DeleteRegionUrlMapRequest(properties); + }; + + /** + * Encodes the specified DeleteRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionUrlMapRequest} message DeleteRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified DeleteRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRegionUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRegionUrlMapRequest} message DeleteRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRegionUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRegionUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRegionUrlMapRequest} DeleteRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRegionUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRegionUrlMapRequest} DeleteRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRegionUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRegionUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRegionUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + return null; + }; + + /** + * Creates a DeleteRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRegionUrlMapRequest} DeleteRegionUrlMapRequest + */ + DeleteRegionUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRegionUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRegionUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from a DeleteRegionUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.DeleteRegionUrlMapRequest} message DeleteRegionUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRegionUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.urlMap = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this DeleteRegionUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRegionUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRegionUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRegionUrlMapRequest; + })(); + + v1.GetRegionUrlMapRequest = (function() { + + /** + * Properties of a GetRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionUrlMapRequest + * @property {string|null} [project] GetRegionUrlMapRequest project + * @property {string|null} [region] GetRegionUrlMapRequest region + * @property {string|null} [urlMap] GetRegionUrlMapRequest urlMap + */ + + /** + * Constructs a new GetRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionUrlMapRequest. + * @implements IGetRegionUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionUrlMapRequest=} [properties] Properties to set + */ + function GetRegionUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @instance + */ + GetRegionUrlMapRequest.prototype.project = ""; + + /** + * GetRegionUrlMapRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @instance + */ + GetRegionUrlMapRequest.prototype.region = ""; + + /** + * GetRegionUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @instance + */ + GetRegionUrlMapRequest.prototype.urlMap = ""; + + /** + * Creates a new GetRegionUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionUrlMapRequest} GetRegionUrlMapRequest instance + */ + GetRegionUrlMapRequest.create = function create(properties) { + return new GetRegionUrlMapRequest(properties); + }; + + /** + * Encodes the specified GetRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionUrlMapRequest} message GetRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified GetRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionUrlMapRequest} message GetRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionUrlMapRequest} GetRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionUrlMapRequest} GetRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + return null; + }; + + /** + * Creates a GetRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionUrlMapRequest} GetRegionUrlMapRequest + */ + GetRegionUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from a GetRegionUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.GetRegionUrlMapRequest} message GetRegionUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.urlMap = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this GetRegionUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionUrlMapRequest; + })(); + + v1.InsertRegionUrlMapRequest = (function() { + + /** + * Properties of an InsertRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRegionUrlMapRequest + * @property {string|null} [project] InsertRegionUrlMapRequest project + * @property {string|null} [region] InsertRegionUrlMapRequest region + * @property {string|null} [requestId] InsertRegionUrlMapRequest requestId + * @property {google.cloud.compute.v1.IUrlMap|null} [urlMapResource] InsertRegionUrlMapRequest urlMapResource + */ + + /** + * Constructs a new InsertRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRegionUrlMapRequest. + * @implements IInsertRegionUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRegionUrlMapRequest=} [properties] Properties to set + */ + function InsertRegionUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRegionUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @instance + */ + InsertRegionUrlMapRequest.prototype.project = ""; + + /** + * InsertRegionUrlMapRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @instance + */ + InsertRegionUrlMapRequest.prototype.region = ""; + + /** + * InsertRegionUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @instance + */ + InsertRegionUrlMapRequest.prototype.requestId = null; + + /** + * InsertRegionUrlMapRequest urlMapResource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} urlMapResource + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @instance + */ + InsertRegionUrlMapRequest.prototype.urlMapResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRegionUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @instance + */ + Object.defineProperty(InsertRegionUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRegionUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRegionUrlMapRequest} InsertRegionUrlMapRequest instance + */ + InsertRegionUrlMapRequest.create = function create(properties) { + return new InsertRegionUrlMapRequest(properties); + }; + + /** + * Encodes the specified InsertRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRegionUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionUrlMapRequest} message InsertRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.urlMapResource != null && Object.hasOwnProperty.call(message, "urlMapResource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.urlMapResource, writer.uint32(/* id 168675425, wireType 2 =*/1349403402).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRegionUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInsertRegionUrlMapRequest} message InsertRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRegionUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRegionUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRegionUrlMapRequest} InsertRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRegionUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 168675425: + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRegionUrlMapRequest} InsertRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRegionUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRegionUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRegionUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.urlMapResource); + if (error) + return "urlMapResource." + error; + } + return null; + }; + + /** + * Creates an InsertRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRegionUrlMapRequest} InsertRegionUrlMapRequest + */ + InsertRegionUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRegionUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRegionUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMapResource != null) { + if (typeof object.urlMapResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRegionUrlMapRequest.urlMapResource: object expected"); + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.urlMapResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertRegionUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.InsertRegionUrlMapRequest} message InsertRegionUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRegionUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.urlMapResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) + object.urlMapResource = $root.google.cloud.compute.v1.UrlMap.toObject(message.urlMapResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRegionUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRegionUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRegionUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRegionUrlMapRequest; + })(); + + v1.ListRegionUrlMapsRequest = (function() { + + /** + * Properties of a ListRegionUrlMapsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionUrlMapsRequest + * @property {string|null} [filter] ListRegionUrlMapsRequest filter + * @property {number|null} [maxResults] ListRegionUrlMapsRequest maxResults + * @property {string|null} [orderBy] ListRegionUrlMapsRequest orderBy + * @property {string|null} [pageToken] ListRegionUrlMapsRequest pageToken + * @property {string|null} [project] ListRegionUrlMapsRequest project + * @property {string|null} [region] ListRegionUrlMapsRequest region + * @property {boolean|null} [returnPartialSuccess] ListRegionUrlMapsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionUrlMapsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionUrlMapsRequest. + * @implements IListRegionUrlMapsRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionUrlMapsRequest=} [properties] Properties to set + */ + function ListRegionUrlMapsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionUrlMapsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + ListRegionUrlMapsRequest.prototype.filter = null; + + /** + * ListRegionUrlMapsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + ListRegionUrlMapsRequest.prototype.maxResults = null; + + /** + * ListRegionUrlMapsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + ListRegionUrlMapsRequest.prototype.orderBy = null; + + /** + * ListRegionUrlMapsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + ListRegionUrlMapsRequest.prototype.pageToken = null; + + /** + * ListRegionUrlMapsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + ListRegionUrlMapsRequest.prototype.project = ""; + + /** + * ListRegionUrlMapsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + ListRegionUrlMapsRequest.prototype.region = ""; + + /** + * ListRegionUrlMapsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + ListRegionUrlMapsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionUrlMapsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + Object.defineProperty(ListRegionUrlMapsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionUrlMapsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + Object.defineProperty(ListRegionUrlMapsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionUrlMapsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + Object.defineProperty(ListRegionUrlMapsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionUrlMapsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + Object.defineProperty(ListRegionUrlMapsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionUrlMapsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + */ + Object.defineProperty(ListRegionUrlMapsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionUrlMapsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionUrlMapsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionUrlMapsRequest} ListRegionUrlMapsRequest instance + */ + ListRegionUrlMapsRequest.create = function create(properties) { + return new ListRegionUrlMapsRequest(properties); + }; + + /** + * Encodes the specified ListRegionUrlMapsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionUrlMapsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionUrlMapsRequest} message ListRegionUrlMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionUrlMapsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionUrlMapsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionUrlMapsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionUrlMapsRequest} message ListRegionUrlMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionUrlMapsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionUrlMapsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionUrlMapsRequest} ListRegionUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionUrlMapsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionUrlMapsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionUrlMapsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionUrlMapsRequest} ListRegionUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionUrlMapsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionUrlMapsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionUrlMapsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionUrlMapsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionUrlMapsRequest} ListRegionUrlMapsRequest + */ + ListRegionUrlMapsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionUrlMapsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionUrlMapsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionUrlMapsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.ListRegionUrlMapsRequest} message ListRegionUrlMapsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionUrlMapsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionUrlMapsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionUrlMapsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionUrlMapsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionUrlMapsRequest; + })(); + + v1.PatchRegionUrlMapRequest = (function() { + + /** + * Properties of a PatchRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRegionUrlMapRequest + * @property {string|null} [project] PatchRegionUrlMapRequest project + * @property {string|null} [region] PatchRegionUrlMapRequest region + * @property {string|null} [requestId] PatchRegionUrlMapRequest requestId + * @property {string|null} [urlMap] PatchRegionUrlMapRequest urlMap + * @property {google.cloud.compute.v1.IUrlMap|null} [urlMapResource] PatchRegionUrlMapRequest urlMapResource + */ + + /** + * Constructs a new PatchRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRegionUrlMapRequest. + * @implements IPatchRegionUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRegionUrlMapRequest=} [properties] Properties to set + */ + function PatchRegionUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRegionUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @instance + */ + PatchRegionUrlMapRequest.prototype.project = ""; + + /** + * PatchRegionUrlMapRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @instance + */ + PatchRegionUrlMapRequest.prototype.region = ""; + + /** + * PatchRegionUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @instance + */ + PatchRegionUrlMapRequest.prototype.requestId = null; + + /** + * PatchRegionUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @instance + */ + PatchRegionUrlMapRequest.prototype.urlMap = ""; + + /** + * PatchRegionUrlMapRequest urlMapResource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} urlMapResource + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @instance + */ + PatchRegionUrlMapRequest.prototype.urlMapResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRegionUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @instance + */ + Object.defineProperty(PatchRegionUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRegionUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRegionUrlMapRequest} PatchRegionUrlMapRequest instance + */ + PatchRegionUrlMapRequest.create = function create(properties) { + return new PatchRegionUrlMapRequest(properties); + }; + + /** + * Encodes the specified PatchRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRegionUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionUrlMapRequest} message PatchRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.urlMapResource != null && Object.hasOwnProperty.call(message, "urlMapResource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.urlMapResource, writer.uint32(/* id 168675425, wireType 2 =*/1349403402).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified PatchRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRegionUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IPatchRegionUrlMapRequest} message PatchRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRegionUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRegionUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRegionUrlMapRequest} PatchRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRegionUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + case 168675425: + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRegionUrlMapRequest} PatchRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRegionUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRegionUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRegionUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.urlMapResource); + if (error) + return "urlMapResource." + error; + } + return null; + }; + + /** + * Creates a PatchRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRegionUrlMapRequest} PatchRegionUrlMapRequest + */ + PatchRegionUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRegionUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRegionUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + if (object.urlMapResource != null) { + if (typeof object.urlMapResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRegionUrlMapRequest.urlMapResource: object expected"); + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.urlMapResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchRegionUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.PatchRegionUrlMapRequest} message PatchRegionUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRegionUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.urlMapResource = null; + object.project = ""; + object.urlMap = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) + object.urlMapResource = $root.google.cloud.compute.v1.UrlMap.toObject(message.urlMapResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this PatchRegionUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRegionUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRegionUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRegionUrlMapRequest; + })(); + + v1.UpdateRegionUrlMapRequest = (function() { + + /** + * Properties of an UpdateRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateRegionUrlMapRequest + * @property {string|null} [project] UpdateRegionUrlMapRequest project + * @property {string|null} [region] UpdateRegionUrlMapRequest region + * @property {string|null} [requestId] UpdateRegionUrlMapRequest requestId + * @property {string|null} [urlMap] UpdateRegionUrlMapRequest urlMap + * @property {google.cloud.compute.v1.IUrlMap|null} [urlMapResource] UpdateRegionUrlMapRequest urlMapResource + */ + + /** + * Constructs a new UpdateRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateRegionUrlMapRequest. + * @implements IUpdateRegionUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateRegionUrlMapRequest=} [properties] Properties to set + */ + function UpdateRegionUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRegionUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @instance + */ + UpdateRegionUrlMapRequest.prototype.project = ""; + + /** + * UpdateRegionUrlMapRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @instance + */ + UpdateRegionUrlMapRequest.prototype.region = ""; + + /** + * UpdateRegionUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @instance + */ + UpdateRegionUrlMapRequest.prototype.requestId = null; + + /** + * UpdateRegionUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @instance + */ + UpdateRegionUrlMapRequest.prototype.urlMap = ""; + + /** + * UpdateRegionUrlMapRequest urlMapResource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} urlMapResource + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @instance + */ + UpdateRegionUrlMapRequest.prototype.urlMapResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateRegionUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @instance + */ + Object.defineProperty(UpdateRegionUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateRegionUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateRegionUrlMapRequest} UpdateRegionUrlMapRequest instance + */ + UpdateRegionUrlMapRequest.create = function create(properties) { + return new UpdateRegionUrlMapRequest(properties); + }; + + /** + * Encodes the specified UpdateRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionUrlMapRequest} message UpdateRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.urlMapResource != null && Object.hasOwnProperty.call(message, "urlMapResource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.urlMapResource, writer.uint32(/* id 168675425, wireType 2 =*/1349403402).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified UpdateRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRegionUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRegionUrlMapRequest} message UpdateRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRegionUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRegionUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateRegionUrlMapRequest} UpdateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateRegionUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + case 168675425: + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateRegionUrlMapRequest} UpdateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRegionUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRegionUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRegionUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.urlMapResource); + if (error) + return "urlMapResource." + error; + } + return null; + }; + + /** + * Creates an UpdateRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateRegionUrlMapRequest} UpdateRegionUrlMapRequest + */ + UpdateRegionUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateRegionUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateRegionUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + if (object.urlMapResource != null) { + if (typeof object.urlMapResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateRegionUrlMapRequest.urlMapResource: object expected"); + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.urlMapResource); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRegionUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.UpdateRegionUrlMapRequest} message UpdateRegionUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRegionUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.urlMapResource = null; + object.project = ""; + object.urlMap = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) + object.urlMapResource = $root.google.cloud.compute.v1.UrlMap.toObject(message.urlMapResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this UpdateRegionUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateRegionUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRegionUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateRegionUrlMapRequest; + })(); + + v1.ValidateRegionUrlMapRequest = (function() { + + /** + * Properties of a ValidateRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IValidateRegionUrlMapRequest + * @property {string|null} [project] ValidateRegionUrlMapRequest project + * @property {string|null} [region] ValidateRegionUrlMapRequest region + * @property {google.cloud.compute.v1.IRegionUrlMapsValidateRequest|null} [regionUrlMapsValidateRequestResource] ValidateRegionUrlMapRequest regionUrlMapsValidateRequestResource + * @property {string|null} [urlMap] ValidateRegionUrlMapRequest urlMap + */ + + /** + * Constructs a new ValidateRegionUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ValidateRegionUrlMapRequest. + * @implements IValidateRegionUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IValidateRegionUrlMapRequest=} [properties] Properties to set + */ + function ValidateRegionUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateRegionUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @instance + */ + ValidateRegionUrlMapRequest.prototype.project = ""; + + /** + * ValidateRegionUrlMapRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @instance + */ + ValidateRegionUrlMapRequest.prototype.region = ""; + + /** + * ValidateRegionUrlMapRequest regionUrlMapsValidateRequestResource. + * @member {google.cloud.compute.v1.IRegionUrlMapsValidateRequest|null|undefined} regionUrlMapsValidateRequestResource + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @instance + */ + ValidateRegionUrlMapRequest.prototype.regionUrlMapsValidateRequestResource = null; + + /** + * ValidateRegionUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @instance + */ + ValidateRegionUrlMapRequest.prototype.urlMap = ""; + + /** + * Creates a new ValidateRegionUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IValidateRegionUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ValidateRegionUrlMapRequest} ValidateRegionUrlMapRequest instance + */ + ValidateRegionUrlMapRequest.create = function create(properties) { + return new ValidateRegionUrlMapRequest(properties); + }; + + /** + * Encodes the specified ValidateRegionUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.ValidateRegionUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IValidateRegionUrlMapRequest} message ValidateRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateRegionUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regionUrlMapsValidateRequestResource != null && Object.hasOwnProperty.call(message, "regionUrlMapsValidateRequestResource")) + $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest.encode(message.regionUrlMapsValidateRequestResource, writer.uint32(/* id 56632858, wireType 2 =*/453062866).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified ValidateRegionUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ValidateRegionUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IValidateRegionUrlMapRequest} message ValidateRegionUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateRegionUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateRegionUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ValidateRegionUrlMapRequest} ValidateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateRegionUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ValidateRegionUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 56632858: + message.regionUrlMapsValidateRequestResource = $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest.decode(reader, reader.uint32()); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateRegionUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ValidateRegionUrlMapRequest} ValidateRegionUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateRegionUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateRegionUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateRegionUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionUrlMapsValidateRequestResource != null && message.hasOwnProperty("regionUrlMapsValidateRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest.verify(message.regionUrlMapsValidateRequestResource); + if (error) + return "regionUrlMapsValidateRequestResource." + error; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + return null; + }; + + /** + * Creates a ValidateRegionUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ValidateRegionUrlMapRequest} ValidateRegionUrlMapRequest + */ + ValidateRegionUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ValidateRegionUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.ValidateRegionUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionUrlMapsValidateRequestResource != null) { + if (typeof object.regionUrlMapsValidateRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ValidateRegionUrlMapRequest.regionUrlMapsValidateRequestResource: object expected"); + message.regionUrlMapsValidateRequestResource = $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest.fromObject(object.regionUrlMapsValidateRequestResource); + } + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from a ValidateRegionUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @static + * @param {google.cloud.compute.v1.ValidateRegionUrlMapRequest} message ValidateRegionUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateRegionUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.regionUrlMapsValidateRequestResource = null; + object.region = ""; + object.project = ""; + object.urlMap = ""; + } + if (message.regionUrlMapsValidateRequestResource != null && message.hasOwnProperty("regionUrlMapsValidateRequestResource")) + object.regionUrlMapsValidateRequestResource = $root.google.cloud.compute.v1.RegionUrlMapsValidateRequest.toObject(message.regionUrlMapsValidateRequestResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this ValidateRegionUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ValidateRegionUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateRegionUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidateRegionUrlMapRequest; + })(); + + v1.GetRegionRequest = (function() { + + /** + * Properties of a GetRegionRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRegionRequest + * @property {string|null} [project] GetRegionRequest project + * @property {string|null} [region] GetRegionRequest region + */ + + /** + * Constructs a new GetRegionRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRegionRequest. + * @implements IGetRegionRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRegionRequest=} [properties] Properties to set + */ + function GetRegionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRegionRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRegionRequest + * @instance + */ + GetRegionRequest.prototype.project = ""; + + /** + * GetRegionRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRegionRequest + * @instance + */ + GetRegionRequest.prototype.region = ""; + + /** + * Creates a new GetRegionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRegionRequest} GetRegionRequest instance + */ + GetRegionRequest.create = function create(properties) { + return new GetRegionRequest(properties); + }; + + /** + * Encodes the specified GetRegionRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRegionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionRequest} message GetRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRegionRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRegionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {google.cloud.compute.v1.IGetRegionRequest} message GetRegionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRegionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRegionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRegionRequest} GetRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRegionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRegionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRegionRequest} GetRegionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRegionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRegionRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRegionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + return null; + }; + + /** + * Creates a GetRegionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRegionRequest} GetRegionRequest + */ + GetRegionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRegionRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRegionRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + return message; + }; + + /** + * Creates a plain object from a GetRegionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRegionRequest + * @static + * @param {google.cloud.compute.v1.GetRegionRequest} message GetRegionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRegionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRegionRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRegionRequest + * @instance + * @returns {Object.} JSON object + */ + GetRegionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRegionRequest; + })(); + + v1.ListRegionsRequest = (function() { + + /** + * Properties of a ListRegionsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRegionsRequest + * @property {string|null} [filter] ListRegionsRequest filter + * @property {number|null} [maxResults] ListRegionsRequest maxResults + * @property {string|null} [orderBy] ListRegionsRequest orderBy + * @property {string|null} [pageToken] ListRegionsRequest pageToken + * @property {string|null} [project] ListRegionsRequest project + * @property {boolean|null} [returnPartialSuccess] ListRegionsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRegionsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRegionsRequest. + * @implements IListRegionsRequest + * @constructor + * @param {google.cloud.compute.v1.IListRegionsRequest=} [properties] Properties to set + */ + function ListRegionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRegionsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.filter = null; + + /** + * ListRegionsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.maxResults = null; + + /** + * ListRegionsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.orderBy = null; + + /** + * ListRegionsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.pageToken = null; + + /** + * ListRegionsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.project = ""; + + /** + * ListRegionsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + ListRegionsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRegionsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + Object.defineProperty(ListRegionsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + Object.defineProperty(ListRegionsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + Object.defineProperty(ListRegionsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + Object.defineProperty(ListRegionsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRegionsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + */ + Object.defineProperty(ListRegionsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRegionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRegionsRequest} ListRegionsRequest instance + */ + ListRegionsRequest.create = function create(properties) { + return new ListRegionsRequest(properties); + }; + + /** + * Encodes the specified ListRegionsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRegionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionsRequest} message ListRegionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRegionsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRegionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {google.cloud.compute.v1.IListRegionsRequest} message ListRegionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRegionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRegionsRequest} ListRegionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRegionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRegionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRegionsRequest} ListRegionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRegionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRegionsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRegionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRegionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRegionsRequest} ListRegionsRequest + */ + ListRegionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRegionsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRegionsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRegionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @static + * @param {google.cloud.compute.v1.ListRegionsRequest} message ListRegionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRegionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRegionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRegionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRegionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRegionsRequest; + })(); + + v1.AggregatedListReservationsRequest = (function() { + + /** + * Properties of an AggregatedListReservationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListReservationsRequest + * @property {string|null} [filter] AggregatedListReservationsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListReservationsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListReservationsRequest maxResults + * @property {string|null} [orderBy] AggregatedListReservationsRequest orderBy + * @property {string|null} [pageToken] AggregatedListReservationsRequest pageToken + * @property {string|null} [project] AggregatedListReservationsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListReservationsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListReservationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListReservationsRequest. + * @implements IAggregatedListReservationsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListReservationsRequest=} [properties] Properties to set + */ + function AggregatedListReservationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListReservationsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + AggregatedListReservationsRequest.prototype.filter = null; + + /** + * AggregatedListReservationsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + AggregatedListReservationsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListReservationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + AggregatedListReservationsRequest.prototype.maxResults = null; + + /** + * AggregatedListReservationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + AggregatedListReservationsRequest.prototype.orderBy = null; + + /** + * AggregatedListReservationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + AggregatedListReservationsRequest.prototype.pageToken = null; + + /** + * AggregatedListReservationsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + AggregatedListReservationsRequest.prototype.project = ""; + + /** + * AggregatedListReservationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + AggregatedListReservationsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListReservationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + Object.defineProperty(AggregatedListReservationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListReservationsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + Object.defineProperty(AggregatedListReservationsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListReservationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + Object.defineProperty(AggregatedListReservationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListReservationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + Object.defineProperty(AggregatedListReservationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListReservationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + Object.defineProperty(AggregatedListReservationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListReservationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + */ + Object.defineProperty(AggregatedListReservationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListReservationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListReservationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListReservationsRequest} AggregatedListReservationsRequest instance + */ + AggregatedListReservationsRequest.create = function create(properties) { + return new AggregatedListReservationsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListReservationsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListReservationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListReservationsRequest} message AggregatedListReservationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListReservationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListReservationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListReservationsRequest} message AggregatedListReservationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListReservationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListReservationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListReservationsRequest} AggregatedListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListReservationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListReservationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListReservationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListReservationsRequest} AggregatedListReservationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListReservationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListReservationsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListReservationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListReservationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListReservationsRequest} AggregatedListReservationsRequest + */ + AggregatedListReservationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListReservationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListReservationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListReservationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListReservationsRequest} message AggregatedListReservationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListReservationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListReservationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListReservationsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListReservationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListReservationsRequest; + })(); + + v1.DeleteReservationRequest = (function() { + + /** + * Properties of a DeleteReservationRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteReservationRequest + * @property {string|null} [project] DeleteReservationRequest project + * @property {string|null} [requestId] DeleteReservationRequest requestId + * @property {string|null} [reservation] DeleteReservationRequest reservation + * @property {string|null} [zone] DeleteReservationRequest zone + */ + + /** + * Constructs a new DeleteReservationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteReservationRequest. + * @implements IDeleteReservationRequest + * @constructor + * @param {google.cloud.compute.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 project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @instance + */ + DeleteReservationRequest.prototype.project = ""; + + /** + * DeleteReservationRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @instance + */ + DeleteReservationRequest.prototype.requestId = null; + + /** + * DeleteReservationRequest reservation. + * @member {string} reservation + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @instance + */ + DeleteReservationRequest.prototype.reservation = ""; + + /** + * DeleteReservationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @instance + */ + DeleteReservationRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteReservationRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @instance + */ + Object.defineProperty(DeleteReservationRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteReservationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteReservationRequest} DeleteReservationRequest instance + */ + DeleteReservationRequest.create = function create(properties) { + return new DeleteReservationRequest(properties); + }; + + /** + * Encodes the specified DeleteReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 47530956, wireType 2 =*/380247650).string(message.reservation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.DeleteReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 47530956: + message.reservation = reader.string(); + break; + case 3744684: + message.zone = 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.compute.v1.DeleteReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.DeleteReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteReservationRequest} DeleteReservationRequest + */ + DeleteReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteReservationRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteReservationRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.reservation != null) + message.reservation = String(object.reservation); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.reservation = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = message.reservation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteReservationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteReservationRequest; + })(); + + v1.GetReservationRequest = (function() { + + /** + * Properties of a GetReservationRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetReservationRequest + * @property {string|null} [project] GetReservationRequest project + * @property {string|null} [reservation] GetReservationRequest reservation + * @property {string|null} [zone] GetReservationRequest zone + */ + + /** + * Constructs a new GetReservationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetReservationRequest. + * @implements IGetReservationRequest + * @constructor + * @param {google.cloud.compute.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 project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetReservationRequest + * @instance + */ + GetReservationRequest.prototype.project = ""; + + /** + * GetReservationRequest reservation. + * @member {string} reservation + * @memberof google.cloud.compute.v1.GetReservationRequest + * @instance + */ + GetReservationRequest.prototype.reservation = ""; + + /** + * GetReservationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetReservationRequest + * @instance + */ + GetReservationRequest.prototype.zone = ""; + + /** + * Creates a new GetReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetReservationRequest + * @static + * @param {google.cloud.compute.v1.IGetReservationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetReservationRequest} GetReservationRequest instance + */ + GetReservationRequest.create = function create(properties) { + return new GetReservationRequest(properties); + }; + + /** + * Encodes the specified GetReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetReservationRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 47530956, wireType 2 =*/380247650).string(message.reservation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetReservationRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.GetReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 47530956: + message.reservation = reader.string(); + break; + case 3744684: + message.zone = 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.compute.v1.GetReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.reservation != null && message.hasOwnProperty("reservation")) + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.GetReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetReservationRequest} GetReservationRequest + */ + GetReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetReservationRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetReservationRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.reservation != null) + message.reservation = String(object.reservation); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetReservationRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.reservation = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = message.reservation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetReservationRequest + * @instance + * @returns {Object.} JSON object + */ + GetReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetReservationRequest; + })(); + + v1.GetIamPolicyReservationRequest = (function() { + + /** + * Properties of a GetIamPolicyReservationRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyReservationRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyReservationRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyReservationRequest project + * @property {string|null} [resource] GetIamPolicyReservationRequest resource + * @property {string|null} [zone] GetIamPolicyReservationRequest zone + */ + + /** + * Constructs a new GetIamPolicyReservationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyReservationRequest. + * @implements IGetIamPolicyReservationRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyReservationRequest=} [properties] Properties to set + */ + function GetIamPolicyReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyReservationRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @instance + */ + GetIamPolicyReservationRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyReservationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @instance + */ + GetIamPolicyReservationRequest.prototype.project = ""; + + /** + * GetIamPolicyReservationRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @instance + */ + GetIamPolicyReservationRequest.prototype.resource = ""; + + /** + * GetIamPolicyReservationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @instance + */ + GetIamPolicyReservationRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyReservationRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @instance + */ + Object.defineProperty(GetIamPolicyReservationRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyReservationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyReservationRequest} GetIamPolicyReservationRequest instance + */ + GetIamPolicyReservationRequest.create = function create(properties) { + return new GetIamPolicyReservationRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyReservationRequest} message GetIamPolicyReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyReservationRequest} message GetIamPolicyReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyReservationRequest} GetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyReservationRequest} GetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyReservationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyReservationRequest} GetIamPolicyReservationRequest + */ + GetIamPolicyReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyReservationRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyReservationRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyReservationRequest} message GetIamPolicyReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyReservationRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyReservationRequest; + })(); + + v1.InsertReservationRequest = (function() { + + /** + * Properties of an InsertReservationRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertReservationRequest + * @property {string|null} [project] InsertReservationRequest project + * @property {string|null} [requestId] InsertReservationRequest requestId + * @property {google.cloud.compute.v1.IReservation|null} [reservationResource] InsertReservationRequest reservationResource + * @property {string|null} [zone] InsertReservationRequest zone + */ + + /** + * Constructs a new InsertReservationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertReservationRequest. + * @implements IInsertReservationRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertReservationRequest=} [properties] Properties to set + */ + function InsertReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertReservationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @instance + */ + InsertReservationRequest.prototype.project = ""; + + /** + * InsertReservationRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @instance + */ + InsertReservationRequest.prototype.requestId = null; + + /** + * InsertReservationRequest reservationResource. + * @member {google.cloud.compute.v1.IReservation|null|undefined} reservationResource + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @instance + */ + InsertReservationRequest.prototype.reservationResource = null; + + /** + * InsertReservationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @instance + */ + InsertReservationRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertReservationRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @instance + */ + Object.defineProperty(InsertReservationRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {google.cloud.compute.v1.IInsertReservationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertReservationRequest} InsertReservationRequest instance + */ + InsertReservationRequest.create = function create(properties) { + return new InsertReservationRequest(properties); + }; + + /** + * Encodes the specified InsertReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {google.cloud.compute.v1.IInsertReservationRequest} message InsertReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.reservationResource != null && Object.hasOwnProperty.call(message, "reservationResource")) + $root.google.cloud.compute.v1.Reservation.encode(message.reservationResource, writer.uint32(/* id 285030177, wireType 2 =*/2280241418).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {google.cloud.compute.v1.IInsertReservationRequest} message InsertReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertReservationRequest} InsertReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 285030177: + message.reservationResource = $root.google.cloud.compute.v1.Reservation.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertReservationRequest} InsertReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertReservationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.reservationResource != null && message.hasOwnProperty("reservationResource")) { + var error = $root.google.cloud.compute.v1.Reservation.verify(message.reservationResource); + if (error) + return "reservationResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertReservationRequest} InsertReservationRequest + */ + InsertReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertReservationRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertReservationRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.reservationResource != null) { + if (typeof object.reservationResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertReservationRequest.reservationResource: object expected"); + message.reservationResource = $root.google.cloud.compute.v1.Reservation.fromObject(object.reservationResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @static + * @param {google.cloud.compute.v1.InsertReservationRequest} message InsertReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.reservationResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.reservationResource != null && message.hasOwnProperty("reservationResource")) + object.reservationResource = $root.google.cloud.compute.v1.Reservation.toObject(message.reservationResource, options); + return object; + }; + + /** + * Converts this InsertReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertReservationRequest + * @instance + * @returns {Object.} JSON object + */ + InsertReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertReservationRequest; + })(); + + v1.ListReservationsRequest = (function() { + + /** + * Properties of a ListReservationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListReservationsRequest + * @property {string|null} [filter] ListReservationsRequest filter + * @property {number|null} [maxResults] ListReservationsRequest maxResults + * @property {string|null} [orderBy] ListReservationsRequest orderBy + * @property {string|null} [pageToken] ListReservationsRequest pageToken + * @property {string|null} [project] ListReservationsRequest project + * @property {boolean|null} [returnPartialSuccess] ListReservationsRequest returnPartialSuccess + * @property {string|null} [zone] ListReservationsRequest zone + */ + + /** + * Constructs a new ListReservationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListReservationsRequest. + * @implements IListReservationsRequest + * @constructor + * @param {google.cloud.compute.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 filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.filter = null; + + /** + * ListReservationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.maxResults = null; + + /** + * ListReservationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.orderBy = null; + + /** + * ListReservationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.pageToken = null; + + /** + * ListReservationsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.project = ""; + + /** + * ListReservationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.returnPartialSuccess = null; + + /** + * ListReservationsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + ListReservationsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListReservationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + Object.defineProperty(ListReservationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReservationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + Object.defineProperty(ListReservationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReservationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + Object.defineProperty(ListReservationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReservationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + Object.defineProperty(ListReservationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListReservationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + */ + Object.defineProperty(ListReservationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListReservationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @static + * @param {google.cloud.compute.v1.IListReservationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListReservationsRequest} ListReservationsRequest instance + */ + ListReservationsRequest.create = function create(properties) { + return new ListReservationsRequest(properties); + }; + + /** + * Encodes the specified ListReservationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListReservationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListReservationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListReservationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.ListReservationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = 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.compute.v1.ListReservationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.ListReservationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListReservationsRequest} ListReservationsRequest + */ + ListReservationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListReservationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListReservationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListReservationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListReservationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListReservationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListReservationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListReservationsRequest; + })(); + + v1.ResizeReservationRequest = (function() { + + /** + * Properties of a ResizeReservationRequest. + * @memberof google.cloud.compute.v1 + * @interface IResizeReservationRequest + * @property {string|null} [project] ResizeReservationRequest project + * @property {string|null} [requestId] ResizeReservationRequest requestId + * @property {string|null} [reservation] ResizeReservationRequest reservation + * @property {google.cloud.compute.v1.IReservationsResizeRequest|null} [reservationsResizeRequestResource] ResizeReservationRequest reservationsResizeRequestResource + * @property {string|null} [zone] ResizeReservationRequest zone + */ + + /** + * Constructs a new ResizeReservationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResizeReservationRequest. + * @implements IResizeReservationRequest + * @constructor + * @param {google.cloud.compute.v1.IResizeReservationRequest=} [properties] Properties to set + */ + function ResizeReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResizeReservationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @instance + */ + ResizeReservationRequest.prototype.project = ""; + + /** + * ResizeReservationRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @instance + */ + ResizeReservationRequest.prototype.requestId = null; + + /** + * ResizeReservationRequest reservation. + * @member {string} reservation + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @instance + */ + ResizeReservationRequest.prototype.reservation = ""; + + /** + * ResizeReservationRequest reservationsResizeRequestResource. + * @member {google.cloud.compute.v1.IReservationsResizeRequest|null|undefined} reservationsResizeRequestResource + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @instance + */ + ResizeReservationRequest.prototype.reservationsResizeRequestResource = null; + + /** + * ResizeReservationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @instance + */ + ResizeReservationRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResizeReservationRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @instance + */ + Object.defineProperty(ResizeReservationRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResizeReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {google.cloud.compute.v1.IResizeReservationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ResizeReservationRequest} ResizeReservationRequest instance + */ + ResizeReservationRequest.create = function create(properties) { + return new ResizeReservationRequest(properties); + }; + + /** + * Encodes the specified ResizeReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.ResizeReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {google.cloud.compute.v1.IResizeReservationRequest} message ResizeReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.reservation != null && Object.hasOwnProperty.call(message, "reservation")) + writer.uint32(/* id 47530956, wireType 2 =*/380247650).string(message.reservation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.reservationsResizeRequestResource != null && Object.hasOwnProperty.call(message, "reservationsResizeRequestResource")) + $root.google.cloud.compute.v1.ReservationsResizeRequest.encode(message.reservationsResizeRequestResource, writer.uint32(/* id 389262801, wireType 2 =*/3114102410).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResizeReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ResizeReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {google.cloud.compute.v1.IResizeReservationRequest} message ResizeReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResizeReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ResizeReservationRequest} ResizeReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ResizeReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 47530956: + message.reservation = reader.string(); + break; + case 389262801: + message.reservationsResizeRequestResource = $root.google.cloud.compute.v1.ReservationsResizeRequest.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResizeReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ResizeReservationRequest} ResizeReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResizeReservationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResizeReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + if (!$util.isString(message.reservation)) + return "reservation: string expected"; + if (message.reservationsResizeRequestResource != null && message.hasOwnProperty("reservationsResizeRequestResource")) { + var error = $root.google.cloud.compute.v1.ReservationsResizeRequest.verify(message.reservationsResizeRequestResource); + if (error) + return "reservationsResizeRequestResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ResizeReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ResizeReservationRequest} ResizeReservationRequest + */ + ResizeReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ResizeReservationRequest) + return object; + var message = new $root.google.cloud.compute.v1.ResizeReservationRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.reservation != null) + message.reservation = String(object.reservation); + if (object.reservationsResizeRequestResource != null) { + if (typeof object.reservationsResizeRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ResizeReservationRequest.reservationsResizeRequestResource: object expected"); + message.reservationsResizeRequestResource = $root.google.cloud.compute.v1.ReservationsResizeRequest.fromObject(object.reservationsResizeRequestResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ResizeReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @static + * @param {google.cloud.compute.v1.ResizeReservationRequest} message ResizeReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResizeReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.reservation = ""; + object.project = ""; + object.reservationsResizeRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.reservation != null && message.hasOwnProperty("reservation")) + object.reservation = message.reservation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.reservationsResizeRequestResource != null && message.hasOwnProperty("reservationsResizeRequestResource")) + object.reservationsResizeRequestResource = $root.google.cloud.compute.v1.ReservationsResizeRequest.toObject(message.reservationsResizeRequestResource, options); + return object; + }; + + /** + * Converts this ResizeReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ResizeReservationRequest + * @instance + * @returns {Object.} JSON object + */ + ResizeReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResizeReservationRequest; + })(); + + v1.SetIamPolicyReservationRequest = (function() { + + /** + * Properties of a SetIamPolicyReservationRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyReservationRequest + * @property {string|null} [project] SetIamPolicyReservationRequest project + * @property {string|null} [resource] SetIamPolicyReservationRequest resource + * @property {string|null} [zone] SetIamPolicyReservationRequest zone + * @property {google.cloud.compute.v1.IZoneSetPolicyRequest|null} [zoneSetPolicyRequestResource] SetIamPolicyReservationRequest zoneSetPolicyRequestResource + */ + + /** + * Constructs a new SetIamPolicyReservationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyReservationRequest. + * @implements ISetIamPolicyReservationRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyReservationRequest=} [properties] Properties to set + */ + function SetIamPolicyReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyReservationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @instance + */ + SetIamPolicyReservationRequest.prototype.project = ""; + + /** + * SetIamPolicyReservationRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @instance + */ + SetIamPolicyReservationRequest.prototype.resource = ""; + + /** + * SetIamPolicyReservationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @instance + */ + SetIamPolicyReservationRequest.prototype.zone = ""; + + /** + * SetIamPolicyReservationRequest zoneSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IZoneSetPolicyRequest|null|undefined} zoneSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @instance + */ + SetIamPolicyReservationRequest.prototype.zoneSetPolicyRequestResource = null; + + /** + * Creates a new SetIamPolicyReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyReservationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyReservationRequest} SetIamPolicyReservationRequest instance + */ + SetIamPolicyReservationRequest.create = function create(properties) { + return new SetIamPolicyReservationRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyReservationRequest} message SetIamPolicyReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.zoneSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "zoneSetPolicyRequestResource")) + $root.google.cloud.compute.v1.ZoneSetPolicyRequest.encode(message.zoneSetPolicyRequestResource, writer.uint32(/* id 382082107, wireType 2 =*/3056656858).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyReservationRequest} message SetIamPolicyReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyReservationRequest} SetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + case 382082107: + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyReservationRequest} SetIamPolicyReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyReservationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.verify(message.zoneSetPolicyRequestResource); + if (error) + return "zoneSetPolicyRequestResource." + error; + } + return null; + }; + + /** + * Creates a SetIamPolicyReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyReservationRequest} SetIamPolicyReservationRequest + */ + SetIamPolicyReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyReservationRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyReservationRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.zone != null) + message.zone = String(object.zone); + if (object.zoneSetPolicyRequestResource != null) { + if (typeof object.zoneSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyReservationRequest.zoneSetPolicyRequestResource: object expected"); + message.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.fromObject(object.zoneSetPolicyRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyReservationRequest} message SetIamPolicyReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.zoneSetPolicyRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zoneSetPolicyRequestResource != null && message.hasOwnProperty("zoneSetPolicyRequestResource")) + object.zoneSetPolicyRequestResource = $root.google.cloud.compute.v1.ZoneSetPolicyRequest.toObject(message.zoneSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyReservationRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyReservationRequest; + })(); + + v1.TestIamPermissionsReservationRequest = (function() { + + /** + * Properties of a TestIamPermissionsReservationRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsReservationRequest + * @property {string|null} [project] TestIamPermissionsReservationRequest project + * @property {string|null} [resource] TestIamPermissionsReservationRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsReservationRequest testPermissionsRequestResource + * @property {string|null} [zone] TestIamPermissionsReservationRequest zone + */ + + /** + * Constructs a new TestIamPermissionsReservationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsReservationRequest. + * @implements ITestIamPermissionsReservationRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsReservationRequest=} [properties] Properties to set + */ + function TestIamPermissionsReservationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsReservationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @instance + */ + TestIamPermissionsReservationRequest.prototype.project = ""; + + /** + * TestIamPermissionsReservationRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @instance + */ + TestIamPermissionsReservationRequest.prototype.resource = ""; + + /** + * TestIamPermissionsReservationRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @instance + */ + TestIamPermissionsReservationRequest.prototype.testPermissionsRequestResource = null; + + /** + * TestIamPermissionsReservationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @instance + */ + TestIamPermissionsReservationRequest.prototype.zone = ""; + + /** + * Creates a new TestIamPermissionsReservationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsReservationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsReservationRequest} TestIamPermissionsReservationRequest instance + */ + TestIamPermissionsReservationRequest.create = function create(properties) { + return new TestIamPermissionsReservationRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsReservationRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsReservationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsReservationRequest} message TestIamPermissionsReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsReservationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsReservationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsReservationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsReservationRequest} message TestIamPermissionsReservationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsReservationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsReservationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsReservationRequest} TestIamPermissionsReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsReservationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsReservationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsReservationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsReservationRequest} TestIamPermissionsReservationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsReservationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsReservationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsReservationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a TestIamPermissionsReservationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsReservationRequest} TestIamPermissionsReservationRequest + */ + TestIamPermissionsReservationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsReservationRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsReservationRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsReservationRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsReservationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsReservationRequest} message TestIamPermissionsReservationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsReservationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsReservationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsReservationRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsReservationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsReservationRequest; + })(); + + v1.AggregatedListResourcePoliciesRequest = (function() { + + /** + * Properties of an AggregatedListResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListResourcePoliciesRequest + * @property {string|null} [filter] AggregatedListResourcePoliciesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListResourcePoliciesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListResourcePoliciesRequest maxResults + * @property {string|null} [orderBy] AggregatedListResourcePoliciesRequest orderBy + * @property {string|null} [pageToken] AggregatedListResourcePoliciesRequest pageToken + * @property {string|null} [project] AggregatedListResourcePoliciesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListResourcePoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListResourcePoliciesRequest. + * @implements IAggregatedListResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest=} [properties] Properties to set + */ + function AggregatedListResourcePoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListResourcePoliciesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + AggregatedListResourcePoliciesRequest.prototype.filter = null; + + /** + * AggregatedListResourcePoliciesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + AggregatedListResourcePoliciesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListResourcePoliciesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + AggregatedListResourcePoliciesRequest.prototype.maxResults = null; + + /** + * AggregatedListResourcePoliciesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + AggregatedListResourcePoliciesRequest.prototype.orderBy = null; + + /** + * AggregatedListResourcePoliciesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + AggregatedListResourcePoliciesRequest.prototype.pageToken = null; + + /** + * AggregatedListResourcePoliciesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + AggregatedListResourcePoliciesRequest.prototype.project = ""; + + /** + * AggregatedListResourcePoliciesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + AggregatedListResourcePoliciesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListResourcePoliciesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(AggregatedListResourcePoliciesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListResourcePoliciesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(AggregatedListResourcePoliciesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListResourcePoliciesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(AggregatedListResourcePoliciesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListResourcePoliciesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(AggregatedListResourcePoliciesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListResourcePoliciesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(AggregatedListResourcePoliciesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListResourcePoliciesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(AggregatedListResourcePoliciesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListResourcePoliciesRequest} AggregatedListResourcePoliciesRequest instance + */ + AggregatedListResourcePoliciesRequest.create = function create(properties) { + return new AggregatedListResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest} message AggregatedListResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest} message AggregatedListResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListResourcePoliciesRequest} AggregatedListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListResourcePoliciesRequest} AggregatedListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListResourcePoliciesRequest} AggregatedListResourcePoliciesRequest + */ + AggregatedListResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListResourcePoliciesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListResourcePoliciesRequest} message AggregatedListResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListResourcePoliciesRequest; + })(); + + v1.DeleteResourcePolicyRequest = (function() { + + /** + * Properties of a DeleteResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteResourcePolicyRequest + * @property {string|null} [project] DeleteResourcePolicyRequest project + * @property {string|null} [region] DeleteResourcePolicyRequest region + * @property {string|null} [requestId] DeleteResourcePolicyRequest requestId + * @property {string|null} [resourcePolicy] DeleteResourcePolicyRequest resourcePolicy + */ + + /** + * Constructs a new DeleteResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteResourcePolicyRequest. + * @implements IDeleteResourcePolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteResourcePolicyRequest=} [properties] Properties to set + */ + function DeleteResourcePolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteResourcePolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @instance + */ + DeleteResourcePolicyRequest.prototype.project = ""; + + /** + * DeleteResourcePolicyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @instance + */ + DeleteResourcePolicyRequest.prototype.region = ""; + + /** + * DeleteResourcePolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @instance + */ + DeleteResourcePolicyRequest.prototype.requestId = null; + + /** + * DeleteResourcePolicyRequest resourcePolicy. + * @member {string} resourcePolicy + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @instance + */ + DeleteResourcePolicyRequest.prototype.resourcePolicy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteResourcePolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @instance + */ + Object.defineProperty(DeleteResourcePolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteResourcePolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteResourcePolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteResourcePolicyRequest} DeleteResourcePolicyRequest instance + */ + DeleteResourcePolicyRequest.create = function create(properties) { + return new DeleteResourcePolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteResourcePolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteResourcePolicyRequest} message DeleteResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourcePolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resourcePolicy != null && Object.hasOwnProperty.call(message, "resourcePolicy")) + writer.uint32(/* id 159240835, wireType 2 =*/1273926682).string(message.resourcePolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteResourcePolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteResourcePolicyRequest} message DeleteResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteResourcePolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteResourcePolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteResourcePolicyRequest} DeleteResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourcePolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteResourcePolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 159240835: + message.resourcePolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteResourcePolicyRequest} DeleteResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteResourcePolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteResourcePolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteResourcePolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.resourcePolicy != null && message.hasOwnProperty("resourcePolicy")) + if (!$util.isString(message.resourcePolicy)) + return "resourcePolicy: string expected"; + return null; + }; + + /** + * Creates a DeleteResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteResourcePolicyRequest} DeleteResourcePolicyRequest + */ + DeleteResourcePolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteResourcePolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteResourcePolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.resourcePolicy != null) + message.resourcePolicy = String(object.resourcePolicy); + return message; + }; + + /** + * Creates a plain object from a DeleteResourcePolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.DeleteResourcePolicyRequest} message DeleteResourcePolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteResourcePolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resourcePolicy = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resourcePolicy != null && message.hasOwnProperty("resourcePolicy")) + object.resourcePolicy = message.resourcePolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteResourcePolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteResourcePolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteResourcePolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteResourcePolicyRequest; + })(); + + v1.GetResourcePolicyRequest = (function() { + + /** + * Properties of a GetResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetResourcePolicyRequest + * @property {string|null} [project] GetResourcePolicyRequest project + * @property {string|null} [region] GetResourcePolicyRequest region + * @property {string|null} [resourcePolicy] GetResourcePolicyRequest resourcePolicy + */ + + /** + * Constructs a new GetResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetResourcePolicyRequest. + * @implements IGetResourcePolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetResourcePolicyRequest=} [properties] Properties to set + */ + function GetResourcePolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetResourcePolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @instance + */ + GetResourcePolicyRequest.prototype.project = ""; + + /** + * GetResourcePolicyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @instance + */ + GetResourcePolicyRequest.prototype.region = ""; + + /** + * GetResourcePolicyRequest resourcePolicy. + * @member {string} resourcePolicy + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @instance + */ + GetResourcePolicyRequest.prototype.resourcePolicy = ""; + + /** + * Creates a new GetResourcePolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetResourcePolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetResourcePolicyRequest} GetResourcePolicyRequest instance + */ + GetResourcePolicyRequest.create = function create(properties) { + return new GetResourcePolicyRequest(properties); + }; + + /** + * Encodes the specified GetResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetResourcePolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetResourcePolicyRequest} message GetResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourcePolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resourcePolicy != null && Object.hasOwnProperty.call(message, "resourcePolicy")) + writer.uint32(/* id 159240835, wireType 2 =*/1273926682).string(message.resourcePolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetResourcePolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetResourcePolicyRequest} message GetResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetResourcePolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetResourcePolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetResourcePolicyRequest} GetResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourcePolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetResourcePolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 159240835: + message.resourcePolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetResourcePolicyRequest} GetResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetResourcePolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetResourcePolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetResourcePolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resourcePolicy != null && message.hasOwnProperty("resourcePolicy")) + if (!$util.isString(message.resourcePolicy)) + return "resourcePolicy: string expected"; + return null; + }; + + /** + * Creates a GetResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetResourcePolicyRequest} GetResourcePolicyRequest + */ + GetResourcePolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetResourcePolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetResourcePolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resourcePolicy != null) + message.resourcePolicy = String(object.resourcePolicy); + return message; + }; + + /** + * Creates a plain object from a GetResourcePolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.GetResourcePolicyRequest} message GetResourcePolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetResourcePolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resourcePolicy = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resourcePolicy != null && message.hasOwnProperty("resourcePolicy")) + object.resourcePolicy = message.resourcePolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetResourcePolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetResourcePolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetResourcePolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetResourcePolicyRequest; + })(); + + v1.GetIamPolicyResourcePolicyRequest = (function() { + + /** + * Properties of a GetIamPolicyResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicyResourcePolicyRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicyResourcePolicyRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicyResourcePolicyRequest project + * @property {string|null} [region] GetIamPolicyResourcePolicyRequest region + * @property {string|null} [resource] GetIamPolicyResourcePolicyRequest resource + */ + + /** + * Constructs a new GetIamPolicyResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicyResourcePolicyRequest. + * @implements IGetIamPolicyResourcePolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest=} [properties] Properties to set + */ + function GetIamPolicyResourcePolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicyResourcePolicyRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @instance + */ + GetIamPolicyResourcePolicyRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicyResourcePolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @instance + */ + GetIamPolicyResourcePolicyRequest.prototype.project = ""; + + /** + * GetIamPolicyResourcePolicyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @instance + */ + GetIamPolicyResourcePolicyRequest.prototype.region = ""; + + /** + * GetIamPolicyResourcePolicyRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @instance + */ + GetIamPolicyResourcePolicyRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicyResourcePolicyRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @instance + */ + Object.defineProperty(GetIamPolicyResourcePolicyRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicyResourcePolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest} GetIamPolicyResourcePolicyRequest instance + */ + GetIamPolicyResourcePolicyRequest.create = function create(properties) { + return new GetIamPolicyResourcePolicyRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicyResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest} message GetIamPolicyResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyResourcePolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicyResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest} message GetIamPolicyResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicyResourcePolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicyResourcePolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest} GetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyResourcePolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicyResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest} GetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicyResourcePolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicyResourcePolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicyResourcePolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicyResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest} GetIamPolicyResourcePolicyRequest + */ + GetIamPolicyResourcePolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicyResourcePolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest} message GetIamPolicyResourcePolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicyResourcePolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicyResourcePolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicyResourcePolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicyResourcePolicyRequest; + })(); + + v1.InsertResourcePolicyRequest = (function() { + + /** + * Properties of an InsertResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertResourcePolicyRequest + * @property {string|null} [project] InsertResourcePolicyRequest project + * @property {string|null} [region] InsertResourcePolicyRequest region + * @property {string|null} [requestId] InsertResourcePolicyRequest requestId + * @property {google.cloud.compute.v1.IResourcePolicy|null} [resourcePolicyResource] InsertResourcePolicyRequest resourcePolicyResource + */ + + /** + * Constructs a new InsertResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertResourcePolicyRequest. + * @implements IInsertResourcePolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertResourcePolicyRequest=} [properties] Properties to set + */ + function InsertResourcePolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertResourcePolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @instance + */ + InsertResourcePolicyRequest.prototype.project = ""; + + /** + * InsertResourcePolicyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @instance + */ + InsertResourcePolicyRequest.prototype.region = ""; + + /** + * InsertResourcePolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @instance + */ + InsertResourcePolicyRequest.prototype.requestId = null; + + /** + * InsertResourcePolicyRequest resourcePolicyResource. + * @member {google.cloud.compute.v1.IResourcePolicy|null|undefined} resourcePolicyResource + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @instance + */ + InsertResourcePolicyRequest.prototype.resourcePolicyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertResourcePolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @instance + */ + Object.defineProperty(InsertResourcePolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertResourcePolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertResourcePolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertResourcePolicyRequest} InsertResourcePolicyRequest instance + */ + InsertResourcePolicyRequest.create = function create(properties) { + return new InsertResourcePolicyRequest(properties); + }; + + /** + * Encodes the specified InsertResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertResourcePolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertResourcePolicyRequest} message InsertResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertResourcePolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.resourcePolicyResource != null && Object.hasOwnProperty.call(message, "resourcePolicyResource")) + $root.google.cloud.compute.v1.ResourcePolicy.encode(message.resourcePolicyResource, writer.uint32(/* id 76826186, wireType 2 =*/614609490).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertResourcePolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertResourcePolicyRequest} message InsertResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertResourcePolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertResourcePolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertResourcePolicyRequest} InsertResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertResourcePolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertResourcePolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 76826186: + message.resourcePolicyResource = $root.google.cloud.compute.v1.ResourcePolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertResourcePolicyRequest} InsertResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertResourcePolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertResourcePolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertResourcePolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.resourcePolicyResource != null && message.hasOwnProperty("resourcePolicyResource")) { + var error = $root.google.cloud.compute.v1.ResourcePolicy.verify(message.resourcePolicyResource); + if (error) + return "resourcePolicyResource." + error; + } + return null; + }; + + /** + * Creates an InsertResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertResourcePolicyRequest} InsertResourcePolicyRequest + */ + InsertResourcePolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertResourcePolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertResourcePolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.resourcePolicyResource != null) { + if (typeof object.resourcePolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertResourcePolicyRequest.resourcePolicyResource: object expected"); + message.resourcePolicyResource = $root.google.cloud.compute.v1.ResourcePolicy.fromObject(object.resourcePolicyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertResourcePolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.InsertResourcePolicyRequest} message InsertResourcePolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertResourcePolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourcePolicyResource = null; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.resourcePolicyResource != null && message.hasOwnProperty("resourcePolicyResource")) + object.resourcePolicyResource = $root.google.cloud.compute.v1.ResourcePolicy.toObject(message.resourcePolicyResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertResourcePolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertResourcePolicyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertResourcePolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertResourcePolicyRequest; + })(); + + v1.ListResourcePoliciesRequest = (function() { + + /** + * Properties of a ListResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListResourcePoliciesRequest + * @property {string|null} [filter] ListResourcePoliciesRequest filter + * @property {number|null} [maxResults] ListResourcePoliciesRequest maxResults + * @property {string|null} [orderBy] ListResourcePoliciesRequest orderBy + * @property {string|null} [pageToken] ListResourcePoliciesRequest pageToken + * @property {string|null} [project] ListResourcePoliciesRequest project + * @property {string|null} [region] ListResourcePoliciesRequest region + * @property {boolean|null} [returnPartialSuccess] ListResourcePoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListResourcePoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListResourcePoliciesRequest. + * @implements IListResourcePoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IListResourcePoliciesRequest=} [properties] Properties to set + */ + function ListResourcePoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourcePoliciesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + ListResourcePoliciesRequest.prototype.filter = null; + + /** + * ListResourcePoliciesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + ListResourcePoliciesRequest.prototype.maxResults = null; + + /** + * ListResourcePoliciesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + ListResourcePoliciesRequest.prototype.orderBy = null; + + /** + * ListResourcePoliciesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + ListResourcePoliciesRequest.prototype.pageToken = null; + + /** + * ListResourcePoliciesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + ListResourcePoliciesRequest.prototype.project = ""; + + /** + * ListResourcePoliciesRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + ListResourcePoliciesRequest.prototype.region = ""; + + /** + * ListResourcePoliciesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + ListResourcePoliciesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListResourcePoliciesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(ListResourcePoliciesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListResourcePoliciesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(ListResourcePoliciesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListResourcePoliciesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(ListResourcePoliciesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListResourcePoliciesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(ListResourcePoliciesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListResourcePoliciesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + */ + Object.defineProperty(ListResourcePoliciesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListResourcePoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListResourcePoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListResourcePoliciesRequest} ListResourcePoliciesRequest instance + */ + ListResourcePoliciesRequest.create = function create(properties) { + return new ListResourcePoliciesRequest(properties); + }; + + /** + * Encodes the specified ListResourcePoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListResourcePoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListResourcePoliciesRequest} message ListResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourcePoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListResourcePoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListResourcePoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListResourcePoliciesRequest} message ListResourcePoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourcePoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourcePoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListResourcePoliciesRequest} ListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourcePoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListResourcePoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourcePoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListResourcePoliciesRequest} ListResourcePoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourcePoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourcePoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourcePoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListResourcePoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListResourcePoliciesRequest} ListResourcePoliciesRequest + */ + ListResourcePoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListResourcePoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListResourcePoliciesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListResourcePoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @static + * @param {google.cloud.compute.v1.ListResourcePoliciesRequest} message ListResourcePoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourcePoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListResourcePoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListResourcePoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListResourcePoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListResourcePoliciesRequest; + })(); + + v1.SetIamPolicyResourcePolicyRequest = (function() { + + /** + * Properties of a SetIamPolicyResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicyResourcePolicyRequest + * @property {string|null} [project] SetIamPolicyResourcePolicyRequest project + * @property {string|null} [region] SetIamPolicyResourcePolicyRequest region + * @property {google.cloud.compute.v1.IRegionSetPolicyRequest|null} [regionSetPolicyRequestResource] SetIamPolicyResourcePolicyRequest regionSetPolicyRequestResource + * @property {string|null} [resource] SetIamPolicyResourcePolicyRequest resource + */ + + /** + * Constructs a new SetIamPolicyResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicyResourcePolicyRequest. + * @implements ISetIamPolicyResourcePolicyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest=} [properties] Properties to set + */ + function SetIamPolicyResourcePolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicyResourcePolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @instance + */ + SetIamPolicyResourcePolicyRequest.prototype.project = ""; + + /** + * SetIamPolicyResourcePolicyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @instance + */ + SetIamPolicyResourcePolicyRequest.prototype.region = ""; + + /** + * SetIamPolicyResourcePolicyRequest regionSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IRegionSetPolicyRequest|null|undefined} regionSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @instance + */ + SetIamPolicyResourcePolicyRequest.prototype.regionSetPolicyRequestResource = null; + + /** + * SetIamPolicyResourcePolicyRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @instance + */ + SetIamPolicyResourcePolicyRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicyResourcePolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest} SetIamPolicyResourcePolicyRequest instance + */ + SetIamPolicyResourcePolicyRequest.create = function create(properties) { + return new SetIamPolicyResourcePolicyRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicyResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest} message SetIamPolicyResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyResourcePolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "regionSetPolicyRequestResource")) + $root.google.cloud.compute.v1.RegionSetPolicyRequest.encode(message.regionSetPolicyRequestResource, writer.uint32(/* id 276489091, wireType 2 =*/2211912730).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicyResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest} message SetIamPolicyResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicyResourcePolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicyResourcePolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest} SetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyResourcePolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 276489091: + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicyResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest} SetIamPolicyResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicyResourcePolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicyResourcePolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicyResourcePolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionSetPolicyRequest.verify(message.regionSetPolicyRequestResource); + if (error) + return "regionSetPolicyRequestResource." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicyResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest} SetIamPolicyResourcePolicyRequest + */ + SetIamPolicyResourcePolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionSetPolicyRequestResource != null) { + if (typeof object.regionSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest.regionSetPolicyRequestResource: object expected"); + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.fromObject(object.regionSetPolicyRequestResource); + } + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicyResourcePolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest} message SetIamPolicyResourcePolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicyResourcePolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.regionSetPolicyRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) + object.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.toObject(message.regionSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicyResourcePolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicyResourcePolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicyResourcePolicyRequest; + })(); + + v1.TestIamPermissionsResourcePolicyRequest = (function() { + + /** + * Properties of a TestIamPermissionsResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsResourcePolicyRequest + * @property {string|null} [project] TestIamPermissionsResourcePolicyRequest project + * @property {string|null} [region] TestIamPermissionsResourcePolicyRequest region + * @property {string|null} [resource] TestIamPermissionsResourcePolicyRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsResourcePolicyRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsResourcePolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsResourcePolicyRequest. + * @implements ITestIamPermissionsResourcePolicyRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest=} [properties] Properties to set + */ + function TestIamPermissionsResourcePolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsResourcePolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @instance + */ + TestIamPermissionsResourcePolicyRequest.prototype.project = ""; + + /** + * TestIamPermissionsResourcePolicyRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @instance + */ + TestIamPermissionsResourcePolicyRequest.prototype.region = ""; + + /** + * TestIamPermissionsResourcePolicyRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @instance + */ + TestIamPermissionsResourcePolicyRequest.prototype.resource = ""; + + /** + * TestIamPermissionsResourcePolicyRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @instance + */ + TestIamPermissionsResourcePolicyRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsResourcePolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest} TestIamPermissionsResourcePolicyRequest instance + */ + TestIamPermissionsResourcePolicyRequest.create = function create(properties) { + return new TestIamPermissionsResourcePolicyRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsResourcePolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest} message TestIamPermissionsResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResourcePolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsResourcePolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest} message TestIamPermissionsResourcePolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsResourcePolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsResourcePolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest} TestIamPermissionsResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResourcePolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsResourcePolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest} TestIamPermissionsResourcePolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsResourcePolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsResourcePolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsResourcePolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsResourcePolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest} TestIamPermissionsResourcePolicyRequest + */ + TestIamPermissionsResourcePolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsResourcePolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest} message TestIamPermissionsResourcePolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsResourcePolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsResourcePolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsResourcePolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsResourcePolicyRequest; + })(); + + v1.AggregatedListRoutersRequest = (function() { + + /** + * Properties of an AggregatedListRoutersRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListRoutersRequest + * @property {string|null} [filter] AggregatedListRoutersRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListRoutersRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListRoutersRequest maxResults + * @property {string|null} [orderBy] AggregatedListRoutersRequest orderBy + * @property {string|null} [pageToken] AggregatedListRoutersRequest pageToken + * @property {string|null} [project] AggregatedListRoutersRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListRoutersRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListRoutersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListRoutersRequest. + * @implements IAggregatedListRoutersRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListRoutersRequest=} [properties] Properties to set + */ + function AggregatedListRoutersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListRoutersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + AggregatedListRoutersRequest.prototype.filter = null; + + /** + * AggregatedListRoutersRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + AggregatedListRoutersRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListRoutersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + AggregatedListRoutersRequest.prototype.maxResults = null; + + /** + * AggregatedListRoutersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + AggregatedListRoutersRequest.prototype.orderBy = null; + + /** + * AggregatedListRoutersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + AggregatedListRoutersRequest.prototype.pageToken = null; + + /** + * AggregatedListRoutersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + AggregatedListRoutersRequest.prototype.project = ""; + + /** + * AggregatedListRoutersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + AggregatedListRoutersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListRoutersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + Object.defineProperty(AggregatedListRoutersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRoutersRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + Object.defineProperty(AggregatedListRoutersRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRoutersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + Object.defineProperty(AggregatedListRoutersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRoutersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + Object.defineProperty(AggregatedListRoutersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRoutersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + Object.defineProperty(AggregatedListRoutersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListRoutersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + */ + Object.defineProperty(AggregatedListRoutersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListRoutersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListRoutersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListRoutersRequest} AggregatedListRoutersRequest instance + */ + AggregatedListRoutersRequest.create = function create(properties) { + return new AggregatedListRoutersRequest(properties); + }; + + /** + * Encodes the specified AggregatedListRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRoutersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListRoutersRequest} message AggregatedListRoutersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListRoutersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListRoutersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListRoutersRequest} message AggregatedListRoutersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListRoutersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListRoutersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListRoutersRequest} AggregatedListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListRoutersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListRoutersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListRoutersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListRoutersRequest} AggregatedListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListRoutersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListRoutersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListRoutersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListRoutersRequest} AggregatedListRoutersRequest + */ + AggregatedListRoutersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListRoutersRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListRoutersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListRoutersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListRoutersRequest} message AggregatedListRoutersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListRoutersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListRoutersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListRoutersRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListRoutersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListRoutersRequest; + })(); + + v1.DeleteRouterRequest = (function() { + + /** + * Properties of a DeleteRouterRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRouterRequest + * @property {string|null} [project] DeleteRouterRequest project + * @property {string|null} [region] DeleteRouterRequest region + * @property {string|null} [requestId] DeleteRouterRequest requestId + * @property {string|null} [router] DeleteRouterRequest router + */ + + /** + * Constructs a new DeleteRouterRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRouterRequest. + * @implements IDeleteRouterRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRouterRequest=} [properties] Properties to set + */ + function DeleteRouterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRouterRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @instance + */ + DeleteRouterRequest.prototype.project = ""; + + /** + * DeleteRouterRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @instance + */ + DeleteRouterRequest.prototype.region = ""; + + /** + * DeleteRouterRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @instance + */ + DeleteRouterRequest.prototype.requestId = null; + + /** + * DeleteRouterRequest router. + * @member {string} router + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @instance + */ + DeleteRouterRequest.prototype.router = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRouterRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @instance + */ + Object.defineProperty(DeleteRouterRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRouterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRouterRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRouterRequest} DeleteRouterRequest instance + */ + DeleteRouterRequest.create = function create(properties) { + return new DeleteRouterRequest(properties); + }; + + /** + * Encodes the specified DeleteRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRouterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRouterRequest} message DeleteRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRouterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRouterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRouterRequest} message DeleteRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRouterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRouterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRouterRequest} DeleteRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRouterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRouterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 148608841: + message.router = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRouterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRouterRequest} DeleteRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRouterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRouterRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRouterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.router != null && message.hasOwnProperty("router")) + if (!$util.isString(message.router)) + return "router: string expected"; + return null; + }; + + /** + * Creates a DeleteRouterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRouterRequest} DeleteRouterRequest + */ + DeleteRouterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRouterRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRouterRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.router != null) + message.router = String(object.router); + return message; + }; + + /** + * Creates a plain object from a DeleteRouterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @static + * @param {google.cloud.compute.v1.DeleteRouterRequest} message DeleteRouterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRouterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.router = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.router != null && message.hasOwnProperty("router")) + object.router = message.router; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteRouterRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRouterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRouterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRouterRequest; + })(); + + v1.GetRouterRequest = (function() { + + /** + * Properties of a GetRouterRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRouterRequest + * @property {string|null} [project] GetRouterRequest project + * @property {string|null} [region] GetRouterRequest region + * @property {string|null} [router] GetRouterRequest router + */ + + /** + * Constructs a new GetRouterRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRouterRequest. + * @implements IGetRouterRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRouterRequest=} [properties] Properties to set + */ + function GetRouterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRouterRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRouterRequest + * @instance + */ + GetRouterRequest.prototype.project = ""; + + /** + * GetRouterRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRouterRequest + * @instance + */ + GetRouterRequest.prototype.region = ""; + + /** + * GetRouterRequest router. + * @member {string} router + * @memberof google.cloud.compute.v1.GetRouterRequest + * @instance + */ + GetRouterRequest.prototype.router = ""; + + /** + * Creates a new GetRouterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {google.cloud.compute.v1.IGetRouterRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRouterRequest} GetRouterRequest instance + */ + GetRouterRequest.create = function create(properties) { + return new GetRouterRequest(properties); + }; + + /** + * Encodes the specified GetRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRouterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {google.cloud.compute.v1.IGetRouterRequest} message GetRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRouterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {google.cloud.compute.v1.IGetRouterRequest} message GetRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRouterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRouterRequest} GetRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRouterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 148608841: + message.router = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRouterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRouterRequest} GetRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRouterRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRouterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.router != null && message.hasOwnProperty("router")) + if (!$util.isString(message.router)) + return "router: string expected"; + return null; + }; + + /** + * Creates a GetRouterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRouterRequest} GetRouterRequest + */ + GetRouterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRouterRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRouterRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.router != null) + message.router = String(object.router); + return message; + }; + + /** + * Creates a plain object from a GetRouterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRouterRequest + * @static + * @param {google.cloud.compute.v1.GetRouterRequest} message GetRouterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRouterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.router = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.router != null && message.hasOwnProperty("router")) + object.router = message.router; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRouterRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRouterRequest + * @instance + * @returns {Object.} JSON object + */ + GetRouterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRouterRequest; + })(); + + v1.GetNatMappingInfoRoutersRequest = (function() { + + /** + * Properties of a GetNatMappingInfoRoutersRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetNatMappingInfoRoutersRequest + * @property {string|null} [filter] GetNatMappingInfoRoutersRequest filter + * @property {number|null} [maxResults] GetNatMappingInfoRoutersRequest maxResults + * @property {string|null} [orderBy] GetNatMappingInfoRoutersRequest orderBy + * @property {string|null} [pageToken] GetNatMappingInfoRoutersRequest pageToken + * @property {string|null} [project] GetNatMappingInfoRoutersRequest project + * @property {string|null} [region] GetNatMappingInfoRoutersRequest region + * @property {boolean|null} [returnPartialSuccess] GetNatMappingInfoRoutersRequest returnPartialSuccess + * @property {string|null} [router] GetNatMappingInfoRoutersRequest router + */ + + /** + * Constructs a new GetNatMappingInfoRoutersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetNatMappingInfoRoutersRequest. + * @implements IGetNatMappingInfoRoutersRequest + * @constructor + * @param {google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest=} [properties] Properties to set + */ + function GetNatMappingInfoRoutersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNatMappingInfoRoutersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.filter = null; + + /** + * GetNatMappingInfoRoutersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.maxResults = null; + + /** + * GetNatMappingInfoRoutersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.orderBy = null; + + /** + * GetNatMappingInfoRoutersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.pageToken = null; + + /** + * GetNatMappingInfoRoutersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.project = ""; + + /** + * GetNatMappingInfoRoutersRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.region = ""; + + /** + * GetNatMappingInfoRoutersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.returnPartialSuccess = null; + + /** + * GetNatMappingInfoRoutersRequest router. + * @member {string} router + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + GetNatMappingInfoRoutersRequest.prototype.router = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetNatMappingInfoRoutersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + Object.defineProperty(GetNatMappingInfoRoutersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetNatMappingInfoRoutersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + Object.defineProperty(GetNatMappingInfoRoutersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetNatMappingInfoRoutersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + Object.defineProperty(GetNatMappingInfoRoutersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetNatMappingInfoRoutersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + Object.defineProperty(GetNatMappingInfoRoutersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GetNatMappingInfoRoutersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + */ + Object.defineProperty(GetNatMappingInfoRoutersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetNatMappingInfoRoutersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetNatMappingInfoRoutersRequest} GetNatMappingInfoRoutersRequest instance + */ + GetNatMappingInfoRoutersRequest.create = function create(properties) { + return new GetNatMappingInfoRoutersRequest(properties); + }; + + /** + * Encodes the specified GetNatMappingInfoRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.GetNatMappingInfoRoutersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest} message GetNatMappingInfoRoutersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNatMappingInfoRoutersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified GetNatMappingInfoRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetNatMappingInfoRoutersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest} message GetNatMappingInfoRoutersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNatMappingInfoRoutersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNatMappingInfoRoutersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetNatMappingInfoRoutersRequest} GetNatMappingInfoRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNatMappingInfoRoutersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 148608841: + message.router = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetNatMappingInfoRoutersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetNatMappingInfoRoutersRequest} GetNatMappingInfoRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNatMappingInfoRoutersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNatMappingInfoRoutersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNatMappingInfoRoutersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.router != null && message.hasOwnProperty("router")) + if (!$util.isString(message.router)) + return "router: string expected"; + return null; + }; + + /** + * Creates a GetNatMappingInfoRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetNatMappingInfoRoutersRequest} GetNatMappingInfoRoutersRequest + */ + GetNatMappingInfoRoutersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.router != null) + message.router = String(object.router); + return message; + }; + + /** + * Creates a plain object from a GetNatMappingInfoRoutersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @static + * @param {google.cloud.compute.v1.GetNatMappingInfoRoutersRequest} message GetNatMappingInfoRoutersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNatMappingInfoRoutersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.router = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.router != null && message.hasOwnProperty("router")) + object.router = message.router; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this GetNatMappingInfoRoutersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetNatMappingInfoRoutersRequest + * @instance + * @returns {Object.} JSON object + */ + GetNatMappingInfoRoutersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetNatMappingInfoRoutersRequest; + })(); + + v1.GetRouterStatusRouterRequest = (function() { + + /** + * Properties of a GetRouterStatusRouterRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRouterStatusRouterRequest + * @property {string|null} [project] GetRouterStatusRouterRequest project + * @property {string|null} [region] GetRouterStatusRouterRequest region + * @property {string|null} [router] GetRouterStatusRouterRequest router + */ + + /** + * Constructs a new GetRouterStatusRouterRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRouterStatusRouterRequest. + * @implements IGetRouterStatusRouterRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRouterStatusRouterRequest=} [properties] Properties to set + */ + function GetRouterStatusRouterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRouterStatusRouterRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @instance + */ + GetRouterStatusRouterRequest.prototype.project = ""; + + /** + * GetRouterStatusRouterRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @instance + */ + GetRouterStatusRouterRequest.prototype.region = ""; + + /** + * GetRouterStatusRouterRequest router. + * @member {string} router + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @instance + */ + GetRouterStatusRouterRequest.prototype.router = ""; + + /** + * Creates a new GetRouterStatusRouterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {google.cloud.compute.v1.IGetRouterStatusRouterRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRouterStatusRouterRequest} GetRouterStatusRouterRequest instance + */ + GetRouterStatusRouterRequest.create = function create(properties) { + return new GetRouterStatusRouterRequest(properties); + }; + + /** + * Encodes the specified GetRouterStatusRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRouterStatusRouterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {google.cloud.compute.v1.IGetRouterStatusRouterRequest} message GetRouterStatusRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouterStatusRouterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRouterStatusRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRouterStatusRouterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {google.cloud.compute.v1.IGetRouterStatusRouterRequest} message GetRouterStatusRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouterStatusRouterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRouterStatusRouterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRouterStatusRouterRequest} GetRouterStatusRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouterStatusRouterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRouterStatusRouterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 148608841: + message.router = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRouterStatusRouterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRouterStatusRouterRequest} GetRouterStatusRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouterStatusRouterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRouterStatusRouterRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRouterStatusRouterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.router != null && message.hasOwnProperty("router")) + if (!$util.isString(message.router)) + return "router: string expected"; + return null; + }; + + /** + * Creates a GetRouterStatusRouterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRouterStatusRouterRequest} GetRouterStatusRouterRequest + */ + GetRouterStatusRouterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRouterStatusRouterRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRouterStatusRouterRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.router != null) + message.router = String(object.router); + return message; + }; + + /** + * Creates a plain object from a GetRouterStatusRouterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @static + * @param {google.cloud.compute.v1.GetRouterStatusRouterRequest} message GetRouterStatusRouterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRouterStatusRouterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.router = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.router != null && message.hasOwnProperty("router")) + object.router = message.router; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRouterStatusRouterRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRouterStatusRouterRequest + * @instance + * @returns {Object.} JSON object + */ + GetRouterStatusRouterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRouterStatusRouterRequest; + })(); + + v1.InsertRouterRequest = (function() { + + /** + * Properties of an InsertRouterRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRouterRequest + * @property {string|null} [project] InsertRouterRequest project + * @property {string|null} [region] InsertRouterRequest region + * @property {string|null} [requestId] InsertRouterRequest requestId + * @property {google.cloud.compute.v1.IRouter|null} [routerResource] InsertRouterRequest routerResource + */ + + /** + * Constructs a new InsertRouterRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRouterRequest. + * @implements IInsertRouterRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRouterRequest=} [properties] Properties to set + */ + function InsertRouterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRouterRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @instance + */ + InsertRouterRequest.prototype.project = ""; + + /** + * InsertRouterRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @instance + */ + InsertRouterRequest.prototype.region = ""; + + /** + * InsertRouterRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @instance + */ + InsertRouterRequest.prototype.requestId = null; + + /** + * InsertRouterRequest routerResource. + * @member {google.cloud.compute.v1.IRouter|null|undefined} routerResource + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @instance + */ + InsertRouterRequest.prototype.routerResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRouterRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @instance + */ + Object.defineProperty(InsertRouterRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRouterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {google.cloud.compute.v1.IInsertRouterRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRouterRequest} InsertRouterRequest instance + */ + InsertRouterRequest.create = function create(properties) { + return new InsertRouterRequest(properties); + }; + + /** + * Encodes the specified InsertRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRouterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {google.cloud.compute.v1.IInsertRouterRequest} message InsertRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRouterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.routerResource != null && Object.hasOwnProperty.call(message, "routerResource")) + $root.google.cloud.compute.v1.Router.encode(message.routerResource, writer.uint32(/* id 155222084, wireType 2 =*/1241776674).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRouterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {google.cloud.compute.v1.IInsertRouterRequest} message InsertRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRouterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRouterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRouterRequest} InsertRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRouterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRouterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 155222084: + message.routerResource = $root.google.cloud.compute.v1.Router.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRouterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRouterRequest} InsertRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRouterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRouterRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRouterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.routerResource != null && message.hasOwnProperty("routerResource")) { + var error = $root.google.cloud.compute.v1.Router.verify(message.routerResource); + if (error) + return "routerResource." + error; + } + return null; + }; + + /** + * Creates an InsertRouterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRouterRequest} InsertRouterRequest + */ + InsertRouterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRouterRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRouterRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.routerResource != null) { + if (typeof object.routerResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRouterRequest.routerResource: object expected"); + message.routerResource = $root.google.cloud.compute.v1.Router.fromObject(object.routerResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertRouterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @static + * @param {google.cloud.compute.v1.InsertRouterRequest} message InsertRouterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRouterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.routerResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.routerResource != null && message.hasOwnProperty("routerResource")) + object.routerResource = $root.google.cloud.compute.v1.Router.toObject(message.routerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRouterRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRouterRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRouterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRouterRequest; + })(); + + v1.ListRoutersRequest = (function() { + + /** + * Properties of a ListRoutersRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRoutersRequest + * @property {string|null} [filter] ListRoutersRequest filter + * @property {number|null} [maxResults] ListRoutersRequest maxResults + * @property {string|null} [orderBy] ListRoutersRequest orderBy + * @property {string|null} [pageToken] ListRoutersRequest pageToken + * @property {string|null} [project] ListRoutersRequest project + * @property {string|null} [region] ListRoutersRequest region + * @property {boolean|null} [returnPartialSuccess] ListRoutersRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRoutersRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRoutersRequest. + * @implements IListRoutersRequest + * @constructor + * @param {google.cloud.compute.v1.IListRoutersRequest=} [properties] Properties to set + */ + function ListRoutersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRoutersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + ListRoutersRequest.prototype.filter = null; + + /** + * ListRoutersRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + ListRoutersRequest.prototype.maxResults = null; + + /** + * ListRoutersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + ListRoutersRequest.prototype.orderBy = null; + + /** + * ListRoutersRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + ListRoutersRequest.prototype.pageToken = null; + + /** + * ListRoutersRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + ListRoutersRequest.prototype.project = ""; + + /** + * ListRoutersRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + ListRoutersRequest.prototype.region = ""; + + /** + * ListRoutersRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + ListRoutersRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRoutersRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + Object.defineProperty(ListRoutersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutersRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + Object.defineProperty(ListRoutersRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutersRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + Object.defineProperty(ListRoutersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutersRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + Object.defineProperty(ListRoutersRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutersRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + */ + Object.defineProperty(ListRoutersRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRoutersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {google.cloud.compute.v1.IListRoutersRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRoutersRequest} ListRoutersRequest instance + */ + ListRoutersRequest.create = function create(properties) { + return new ListRoutersRequest(properties); + }; + + /** + * Encodes the specified ListRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRoutersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {google.cloud.compute.v1.IListRoutersRequest} message ListRoutersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRoutersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {google.cloud.compute.v1.IListRoutersRequest} message ListRoutersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRoutersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRoutersRequest} ListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRoutersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRoutersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRoutersRequest} ListRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRoutersRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRoutersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRoutersRequest} ListRoutersRequest + */ + ListRoutersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRoutersRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRoutersRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRoutersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @static + * @param {google.cloud.compute.v1.ListRoutersRequest} message ListRoutersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRoutersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRoutersRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRoutersRequest + * @instance + * @returns {Object.} JSON object + */ + ListRoutersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRoutersRequest; + })(); + + v1.PatchRouterRequest = (function() { + + /** + * Properties of a PatchRouterRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRouterRequest + * @property {string|null} [project] PatchRouterRequest project + * @property {string|null} [region] PatchRouterRequest region + * @property {string|null} [requestId] PatchRouterRequest requestId + * @property {string|null} [router] PatchRouterRequest router + * @property {google.cloud.compute.v1.IRouter|null} [routerResource] PatchRouterRequest routerResource + */ + + /** + * Constructs a new PatchRouterRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRouterRequest. + * @implements IPatchRouterRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRouterRequest=} [properties] Properties to set + */ + function PatchRouterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRouterRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @instance + */ + PatchRouterRequest.prototype.project = ""; + + /** + * PatchRouterRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @instance + */ + PatchRouterRequest.prototype.region = ""; + + /** + * PatchRouterRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @instance + */ + PatchRouterRequest.prototype.requestId = null; + + /** + * PatchRouterRequest router. + * @member {string} router + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @instance + */ + PatchRouterRequest.prototype.router = ""; + + /** + * PatchRouterRequest routerResource. + * @member {google.cloud.compute.v1.IRouter|null|undefined} routerResource + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @instance + */ + PatchRouterRequest.prototype.routerResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRouterRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @instance + */ + Object.defineProperty(PatchRouterRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRouterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {google.cloud.compute.v1.IPatchRouterRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRouterRequest} PatchRouterRequest instance + */ + PatchRouterRequest.create = function create(properties) { + return new PatchRouterRequest(properties); + }; + + /** + * Encodes the specified PatchRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRouterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {google.cloud.compute.v1.IPatchRouterRequest} message PatchRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRouterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.routerResource != null && Object.hasOwnProperty.call(message, "routerResource")) + $root.google.cloud.compute.v1.Router.encode(message.routerResource, writer.uint32(/* id 155222084, wireType 2 =*/1241776674).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified PatchRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRouterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {google.cloud.compute.v1.IPatchRouterRequest} message PatchRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRouterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRouterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRouterRequest} PatchRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRouterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRouterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 148608841: + message.router = reader.string(); + break; + case 155222084: + message.routerResource = $root.google.cloud.compute.v1.Router.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRouterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRouterRequest} PatchRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRouterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRouterRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRouterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.router != null && message.hasOwnProperty("router")) + if (!$util.isString(message.router)) + return "router: string expected"; + if (message.routerResource != null && message.hasOwnProperty("routerResource")) { + var error = $root.google.cloud.compute.v1.Router.verify(message.routerResource); + if (error) + return "routerResource." + error; + } + return null; + }; + + /** + * Creates a PatchRouterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRouterRequest} PatchRouterRequest + */ + PatchRouterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRouterRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRouterRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.router != null) + message.router = String(object.router); + if (object.routerResource != null) { + if (typeof object.routerResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRouterRequest.routerResource: object expected"); + message.routerResource = $root.google.cloud.compute.v1.Router.fromObject(object.routerResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchRouterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @static + * @param {google.cloud.compute.v1.PatchRouterRequest} message PatchRouterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRouterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.router = ""; + object.routerResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.router != null && message.hasOwnProperty("router")) + object.router = message.router; + if (message.routerResource != null && message.hasOwnProperty("routerResource")) + object.routerResource = $root.google.cloud.compute.v1.Router.toObject(message.routerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this PatchRouterRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRouterRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRouterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRouterRequest; + })(); + + v1.PreviewRouterRequest = (function() { + + /** + * Properties of a PreviewRouterRequest. + * @memberof google.cloud.compute.v1 + * @interface IPreviewRouterRequest + * @property {string|null} [project] PreviewRouterRequest project + * @property {string|null} [region] PreviewRouterRequest region + * @property {string|null} [router] PreviewRouterRequest router + * @property {google.cloud.compute.v1.IRouter|null} [routerResource] PreviewRouterRequest routerResource + */ + + /** + * Constructs a new PreviewRouterRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PreviewRouterRequest. + * @implements IPreviewRouterRequest + * @constructor + * @param {google.cloud.compute.v1.IPreviewRouterRequest=} [properties] Properties to set + */ + function PreviewRouterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewRouterRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @instance + */ + PreviewRouterRequest.prototype.project = ""; + + /** + * PreviewRouterRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @instance + */ + PreviewRouterRequest.prototype.region = ""; + + /** + * PreviewRouterRequest router. + * @member {string} router + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @instance + */ + PreviewRouterRequest.prototype.router = ""; + + /** + * PreviewRouterRequest routerResource. + * @member {google.cloud.compute.v1.IRouter|null|undefined} routerResource + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @instance + */ + PreviewRouterRequest.prototype.routerResource = null; + + /** + * Creates a new PreviewRouterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {google.cloud.compute.v1.IPreviewRouterRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PreviewRouterRequest} PreviewRouterRequest instance + */ + PreviewRouterRequest.create = function create(properties) { + return new PreviewRouterRequest(properties); + }; + + /** + * Encodes the specified PreviewRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.PreviewRouterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {google.cloud.compute.v1.IPreviewRouterRequest} message PreviewRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRouterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.routerResource != null && Object.hasOwnProperty.call(message, "routerResource")) + $root.google.cloud.compute.v1.Router.encode(message.routerResource, writer.uint32(/* id 155222084, wireType 2 =*/1241776674).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified PreviewRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PreviewRouterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {google.cloud.compute.v1.IPreviewRouterRequest} message PreviewRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRouterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewRouterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PreviewRouterRequest} PreviewRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRouterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PreviewRouterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 148608841: + message.router = reader.string(); + break; + case 155222084: + message.routerResource = $root.google.cloud.compute.v1.Router.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewRouterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PreviewRouterRequest} PreviewRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRouterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewRouterRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewRouterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.router != null && message.hasOwnProperty("router")) + if (!$util.isString(message.router)) + return "router: string expected"; + if (message.routerResource != null && message.hasOwnProperty("routerResource")) { + var error = $root.google.cloud.compute.v1.Router.verify(message.routerResource); + if (error) + return "routerResource." + error; + } + return null; + }; + + /** + * Creates a PreviewRouterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PreviewRouterRequest} PreviewRouterRequest + */ + PreviewRouterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PreviewRouterRequest) + return object; + var message = new $root.google.cloud.compute.v1.PreviewRouterRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.router != null) + message.router = String(object.router); + if (object.routerResource != null) { + if (typeof object.routerResource !== "object") + throw TypeError(".google.cloud.compute.v1.PreviewRouterRequest.routerResource: object expected"); + message.routerResource = $root.google.cloud.compute.v1.Router.fromObject(object.routerResource); + } + return message; + }; + + /** + * Creates a plain object from a PreviewRouterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @static + * @param {google.cloud.compute.v1.PreviewRouterRequest} message PreviewRouterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewRouterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.router = ""; + object.routerResource = null; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.router != null && message.hasOwnProperty("router")) + object.router = message.router; + if (message.routerResource != null && message.hasOwnProperty("routerResource")) + object.routerResource = $root.google.cloud.compute.v1.Router.toObject(message.routerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this PreviewRouterRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PreviewRouterRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewRouterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PreviewRouterRequest; + })(); + + v1.UpdateRouterRequest = (function() { + + /** + * Properties of an UpdateRouterRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateRouterRequest + * @property {string|null} [project] UpdateRouterRequest project + * @property {string|null} [region] UpdateRouterRequest region + * @property {string|null} [requestId] UpdateRouterRequest requestId + * @property {string|null} [router] UpdateRouterRequest router + * @property {google.cloud.compute.v1.IRouter|null} [routerResource] UpdateRouterRequest routerResource + */ + + /** + * Constructs a new UpdateRouterRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateRouterRequest. + * @implements IUpdateRouterRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateRouterRequest=} [properties] Properties to set + */ + function UpdateRouterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRouterRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @instance + */ + UpdateRouterRequest.prototype.project = ""; + + /** + * UpdateRouterRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @instance + */ + UpdateRouterRequest.prototype.region = ""; + + /** + * UpdateRouterRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @instance + */ + UpdateRouterRequest.prototype.requestId = null; + + /** + * UpdateRouterRequest router. + * @member {string} router + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @instance + */ + UpdateRouterRequest.prototype.router = ""; + + /** + * UpdateRouterRequest routerResource. + * @member {google.cloud.compute.v1.IRouter|null|undefined} routerResource + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @instance + */ + UpdateRouterRequest.prototype.routerResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateRouterRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @instance + */ + Object.defineProperty(UpdateRouterRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateRouterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRouterRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateRouterRequest} UpdateRouterRequest instance + */ + UpdateRouterRequest.create = function create(properties) { + return new UpdateRouterRequest(properties); + }; + + /** + * Encodes the specified UpdateRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRouterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRouterRequest} message UpdateRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRouterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.router != null && Object.hasOwnProperty.call(message, "router")) + writer.uint32(/* id 148608841, wireType 2 =*/1188870730).string(message.router); + if (message.routerResource != null && Object.hasOwnProperty.call(message, "routerResource")) + $root.google.cloud.compute.v1.Router.encode(message.routerResource, writer.uint32(/* id 155222084, wireType 2 =*/1241776674).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified UpdateRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRouterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {google.cloud.compute.v1.IUpdateRouterRequest} message UpdateRouterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRouterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRouterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateRouterRequest} UpdateRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRouterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateRouterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 148608841: + message.router = reader.string(); + break; + case 155222084: + message.routerResource = $root.google.cloud.compute.v1.Router.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateRouterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateRouterRequest} UpdateRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRouterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRouterRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRouterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.router != null && message.hasOwnProperty("router")) + if (!$util.isString(message.router)) + return "router: string expected"; + if (message.routerResource != null && message.hasOwnProperty("routerResource")) { + var error = $root.google.cloud.compute.v1.Router.verify(message.routerResource); + if (error) + return "routerResource." + error; + } + return null; + }; + + /** + * Creates an UpdateRouterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateRouterRequest} UpdateRouterRequest + */ + UpdateRouterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateRouterRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateRouterRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.router != null) + message.router = String(object.router); + if (object.routerResource != null) { + if (typeof object.routerResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateRouterRequest.routerResource: object expected"); + message.routerResource = $root.google.cloud.compute.v1.Router.fromObject(object.routerResource); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRouterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @static + * @param {google.cloud.compute.v1.UpdateRouterRequest} message UpdateRouterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRouterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.router = ""; + object.routerResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.router != null && message.hasOwnProperty("router")) + object.router = message.router; + if (message.routerResource != null && message.hasOwnProperty("routerResource")) + object.routerResource = $root.google.cloud.compute.v1.Router.toObject(message.routerResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this UpdateRouterRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateRouterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRouterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateRouterRequest; + })(); + + v1.DeleteRouteRequest = (function() { + + /** + * Properties of a DeleteRouteRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteRouteRequest + * @property {string|null} [project] DeleteRouteRequest project + * @property {string|null} [requestId] DeleteRouteRequest requestId + * @property {string|null} [route] DeleteRouteRequest route + */ + + /** + * Constructs a new DeleteRouteRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteRouteRequest. + * @implements IDeleteRouteRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteRouteRequest=} [properties] Properties to set + */ + function DeleteRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRouteRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @instance + */ + DeleteRouteRequest.prototype.project = ""; + + /** + * DeleteRouteRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @instance + */ + DeleteRouteRequest.prototype.requestId = null; + + /** + * DeleteRouteRequest route. + * @member {string} route + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @instance + */ + DeleteRouteRequest.prototype.route = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteRouteRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @instance + */ + Object.defineProperty(DeleteRouteRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRouteRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteRouteRequest} DeleteRouteRequest instance + */ + DeleteRouteRequest.create = function create(properties) { + return new DeleteRouteRequest(properties); + }; + + /** + * Encodes the specified DeleteRouteRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRouteRequest} message DeleteRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.route != null && Object.hasOwnProperty.call(message, "route")) + writer.uint32(/* id 108704329, wireType 2 =*/869634634).string(message.route); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteRouteRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {google.cloud.compute.v1.IDeleteRouteRequest} message DeleteRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteRouteRequest} DeleteRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 108704329: + message.route = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteRouteRequest} DeleteRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRouteRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.route != null && message.hasOwnProperty("route")) + if (!$util.isString(message.route)) + return "route: string expected"; + return null; + }; + + /** + * Creates a DeleteRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteRouteRequest} DeleteRouteRequest + */ + DeleteRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteRouteRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteRouteRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.route != null) + message.route = String(object.route); + return message; + }; + + /** + * Creates a plain object from a DeleteRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @static + * @param {google.cloud.compute.v1.DeleteRouteRequest} message DeleteRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.route = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.route != null && message.hasOwnProperty("route")) + object.route = message.route; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteRouteRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteRouteRequest; + })(); + + v1.GetRouteRequest = (function() { + + /** + * Properties of a GetRouteRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRouteRequest + * @property {string|null} [project] GetRouteRequest project + * @property {string|null} [route] GetRouteRequest route + */ + + /** + * Constructs a new GetRouteRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRouteRequest. + * @implements IGetRouteRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRouteRequest=} [properties] Properties to set + */ + function GetRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRouteRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRouteRequest + * @instance + */ + GetRouteRequest.prototype.project = ""; + + /** + * GetRouteRequest route. + * @member {string} route + * @memberof google.cloud.compute.v1.GetRouteRequest + * @instance + */ + GetRouteRequest.prototype.route = ""; + + /** + * Creates a new GetRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {google.cloud.compute.v1.IGetRouteRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRouteRequest} GetRouteRequest instance + */ + GetRouteRequest.create = function create(properties) { + return new GetRouteRequest(properties); + }; + + /** + * Encodes the specified GetRouteRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {google.cloud.compute.v1.IGetRouteRequest} message GetRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.route != null && Object.hasOwnProperty.call(message, "route")) + writer.uint32(/* id 108704329, wireType 2 =*/869634634).string(message.route); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetRouteRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {google.cloud.compute.v1.IGetRouteRequest} message GetRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRouteRequest} GetRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 108704329: + message.route = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRouteRequest} GetRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRouteRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.route != null && message.hasOwnProperty("route")) + if (!$util.isString(message.route)) + return "route: string expected"; + return null; + }; + + /** + * Creates a GetRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRouteRequest} GetRouteRequest + */ + GetRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRouteRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRouteRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.route != null) + message.route = String(object.route); + return message; + }; + + /** + * Creates a plain object from a GetRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRouteRequest + * @static + * @param {google.cloud.compute.v1.GetRouteRequest} message GetRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.route = ""; + object.project = ""; + } + if (message.route != null && message.hasOwnProperty("route")) + object.route = message.route; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRouteRequest + * @instance + * @returns {Object.} JSON object + */ + GetRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRouteRequest; + })(); + + v1.InsertRouteRequest = (function() { + + /** + * Properties of an InsertRouteRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertRouteRequest + * @property {string|null} [project] InsertRouteRequest project + * @property {string|null} [requestId] InsertRouteRequest requestId + * @property {google.cloud.compute.v1.IRoute|null} [routeResource] InsertRouteRequest routeResource + */ + + /** + * Constructs a new InsertRouteRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertRouteRequest. + * @implements IInsertRouteRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertRouteRequest=} [properties] Properties to set + */ + function InsertRouteRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertRouteRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @instance + */ + InsertRouteRequest.prototype.project = ""; + + /** + * InsertRouteRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @instance + */ + InsertRouteRequest.prototype.requestId = null; + + /** + * InsertRouteRequest routeResource. + * @member {google.cloud.compute.v1.IRoute|null|undefined} routeResource + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @instance + */ + InsertRouteRequest.prototype.routeResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertRouteRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @instance + */ + Object.defineProperty(InsertRouteRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {google.cloud.compute.v1.IInsertRouteRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertRouteRequest} InsertRouteRequest instance + */ + InsertRouteRequest.create = function create(properties) { + return new InsertRouteRequest(properties); + }; + + /** + * Encodes the specified InsertRouteRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {google.cloud.compute.v1.IInsertRouteRequest} message InsertRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.routeResource != null && Object.hasOwnProperty.call(message, "routeResource")) + $root.google.cloud.compute.v1.Route.encode(message.routeResource, writer.uint32(/* id 225428804, wireType 2 =*/1803430434).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertRouteRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {google.cloud.compute.v1.IInsertRouteRequest} message InsertRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertRouteRequest} InsertRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRouteRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 225428804: + message.routeResource = $root.google.cloud.compute.v1.Route.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertRouteRequest} InsertRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertRouteRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.routeResource != null && message.hasOwnProperty("routeResource")) { + var error = $root.google.cloud.compute.v1.Route.verify(message.routeResource); + if (error) + return "routeResource." + error; + } + return null; + }; + + /** + * Creates an InsertRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertRouteRequest} InsertRouteRequest + */ + InsertRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertRouteRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertRouteRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.routeResource != null) { + if (typeof object.routeResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertRouteRequest.routeResource: object expected"); + message.routeResource = $root.google.cloud.compute.v1.Route.fromObject(object.routeResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @static + * @param {google.cloud.compute.v1.InsertRouteRequest} message InsertRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.routeResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.routeResource != null && message.hasOwnProperty("routeResource")) + object.routeResource = $root.google.cloud.compute.v1.Route.toObject(message.routeResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertRouteRequest + * @instance + * @returns {Object.} JSON object + */ + InsertRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertRouteRequest; + })(); + + v1.ListRoutesRequest = (function() { + + /** + * Properties of a ListRoutesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListRoutesRequest + * @property {string|null} [filter] ListRoutesRequest filter + * @property {number|null} [maxResults] ListRoutesRequest maxResults + * @property {string|null} [orderBy] ListRoutesRequest orderBy + * @property {string|null} [pageToken] ListRoutesRequest pageToken + * @property {string|null} [project] ListRoutesRequest project + * @property {boolean|null} [returnPartialSuccess] ListRoutesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListRoutesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListRoutesRequest. + * @implements IListRoutesRequest + * @constructor + * @param {google.cloud.compute.v1.IListRoutesRequest=} [properties] Properties to set + */ + function ListRoutesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRoutesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.filter = null; + + /** + * ListRoutesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.maxResults = null; + + /** + * ListRoutesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.orderBy = null; + + /** + * ListRoutesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.pageToken = null; + + /** + * ListRoutesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.project = ""; + + /** + * ListRoutesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListRoutesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + Object.defineProperty(ListRoutesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + Object.defineProperty(ListRoutesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + Object.defineProperty(ListRoutesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + Object.defineProperty(ListRoutesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListRoutesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + */ + Object.defineProperty(ListRoutesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {google.cloud.compute.v1.IListRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListRoutesRequest} ListRoutesRequest instance + */ + ListRoutesRequest.create = function create(properties) { + return new ListRoutesRequest(properties); + }; + + /** + * Encodes the specified ListRoutesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {google.cloud.compute.v1.IListRoutesRequest} message ListRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {google.cloud.compute.v1.IListRoutesRequest} message ListRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListRoutesRequest} ListRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListRoutesRequest} ListRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRoutesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRoutesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListRoutesRequest} ListRoutesRequest + */ + ListRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListRoutesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListRoutesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @static + * @param {google.cloud.compute.v1.ListRoutesRequest} message ListRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRoutesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListRoutesRequest; + })(); + + v1.AddRuleSecurityPolicyRequest = (function() { + + /** + * Properties of an AddRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddRuleSecurityPolicyRequest + * @property {string|null} [project] AddRuleSecurityPolicyRequest project + * @property {string|null} [securityPolicy] AddRuleSecurityPolicyRequest securityPolicy + * @property {google.cloud.compute.v1.ISecurityPolicyRule|null} [securityPolicyRuleResource] AddRuleSecurityPolicyRequest securityPolicyRuleResource + */ + + /** + * Constructs a new AddRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddRuleSecurityPolicyRequest. + * @implements IAddRuleSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IAddRuleSecurityPolicyRequest=} [properties] Properties to set + */ + function AddRuleSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddRuleSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @instance + */ + AddRuleSecurityPolicyRequest.prototype.project = ""; + + /** + * AddRuleSecurityPolicyRequest securityPolicy. + * @member {string} securityPolicy + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @instance + */ + AddRuleSecurityPolicyRequest.prototype.securityPolicy = ""; + + /** + * AddRuleSecurityPolicyRequest securityPolicyRuleResource. + * @member {google.cloud.compute.v1.ISecurityPolicyRule|null|undefined} securityPolicyRuleResource + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @instance + */ + AddRuleSecurityPolicyRequest.prototype.securityPolicyRuleResource = null; + + /** + * Creates a new AddRuleSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddRuleSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddRuleSecurityPolicyRequest} AddRuleSecurityPolicyRequest instance + */ + AddRuleSecurityPolicyRequest.create = function create(properties) { + return new AddRuleSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified AddRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.AddRuleSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddRuleSecurityPolicyRequest} message AddRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddRuleSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.securityPolicyRuleResource != null && Object.hasOwnProperty.call(message, "securityPolicyRuleResource")) + $root.google.cloud.compute.v1.SecurityPolicyRule.encode(message.securityPolicyRuleResource, writer.uint32(/* id 402693443, wireType 2 =*/3221547546).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddRuleSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IAddRuleSecurityPolicyRequest} message AddRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddRuleSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddRuleSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddRuleSecurityPolicyRequest} AddRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddRuleSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddRuleSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + case 402693443: + message.securityPolicyRuleResource = $root.google.cloud.compute.v1.SecurityPolicyRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddRuleSecurityPolicyRequest} AddRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddRuleSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddRuleSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddRuleSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + if (message.securityPolicyRuleResource != null && message.hasOwnProperty("securityPolicyRuleResource")) { + var error = $root.google.cloud.compute.v1.SecurityPolicyRule.verify(message.securityPolicyRuleResource); + if (error) + return "securityPolicyRuleResource." + error; + } + return null; + }; + + /** + * Creates an AddRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddRuleSecurityPolicyRequest} AddRuleSecurityPolicyRequest + */ + AddRuleSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddRuleSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddRuleSecurityPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + if (object.securityPolicyRuleResource != null) { + if (typeof object.securityPolicyRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddRuleSecurityPolicyRequest.securityPolicyRuleResource: object expected"); + message.securityPolicyRuleResource = $root.google.cloud.compute.v1.SecurityPolicyRule.fromObject(object.securityPolicyRuleResource); + } + return message; + }; + + /** + * Creates a plain object from an AddRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.AddRuleSecurityPolicyRequest} message AddRuleSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddRuleSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = ""; + object.project = ""; + object.securityPolicyRuleResource = null; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = message.securityPolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.securityPolicyRuleResource != null && message.hasOwnProperty("securityPolicyRuleResource")) + object.securityPolicyRuleResource = $root.google.cloud.compute.v1.SecurityPolicyRule.toObject(message.securityPolicyRuleResource, options); + return object; + }; + + /** + * Converts this AddRuleSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddRuleSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + AddRuleSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddRuleSecurityPolicyRequest; + })(); + + v1.DeleteSecurityPolicyRequest = (function() { + + /** + * Properties of a DeleteSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteSecurityPolicyRequest + * @property {string|null} [project] DeleteSecurityPolicyRequest project + * @property {string|null} [requestId] DeleteSecurityPolicyRequest requestId + * @property {string|null} [securityPolicy] DeleteSecurityPolicyRequest securityPolicy + */ + + /** + * Constructs a new DeleteSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteSecurityPolicyRequest. + * @implements IDeleteSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteSecurityPolicyRequest=} [properties] Properties to set + */ + function DeleteSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @instance + */ + DeleteSecurityPolicyRequest.prototype.project = ""; + + /** + * DeleteSecurityPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @instance + */ + DeleteSecurityPolicyRequest.prototype.requestId = null; + + /** + * DeleteSecurityPolicyRequest securityPolicy. + * @member {string} securityPolicy + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @instance + */ + DeleteSecurityPolicyRequest.prototype.securityPolicy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteSecurityPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @instance + */ + Object.defineProperty(DeleteSecurityPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteSecurityPolicyRequest} DeleteSecurityPolicyRequest instance + */ + DeleteSecurityPolicyRequest.create = function create(properties) { + return new DeleteSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSecurityPolicyRequest} message DeleteSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSecurityPolicyRequest} message DeleteSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteSecurityPolicyRequest} DeleteSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteSecurityPolicyRequest} DeleteSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + return null; + }; + + /** + * Creates a DeleteSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteSecurityPolicyRequest} DeleteSecurityPolicyRequest + */ + DeleteSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteSecurityPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + return message; + }; + + /** + * Creates a plain object from a DeleteSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.DeleteSecurityPolicyRequest} message DeleteSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = message.securityPolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSecurityPolicyRequest; + })(); + + v1.GetSecurityPolicyRequest = (function() { + + /** + * Properties of a GetSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetSecurityPolicyRequest + * @property {string|null} [project] GetSecurityPolicyRequest project + * @property {string|null} [securityPolicy] GetSecurityPolicyRequest securityPolicy + */ + + /** + * Constructs a new GetSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetSecurityPolicyRequest. + * @implements IGetSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetSecurityPolicyRequest=} [properties] Properties to set + */ + function GetSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @instance + */ + GetSecurityPolicyRequest.prototype.project = ""; + + /** + * GetSecurityPolicyRequest securityPolicy. + * @member {string} securityPolicy + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @instance + */ + GetSecurityPolicyRequest.prototype.securityPolicy = ""; + + /** + * Creates a new GetSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetSecurityPolicyRequest} GetSecurityPolicyRequest instance + */ + GetSecurityPolicyRequest.create = function create(properties) { + return new GetSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified GetSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetSecurityPolicyRequest} message GetSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetSecurityPolicyRequest} message GetSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetSecurityPolicyRequest} GetSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetSecurityPolicyRequest} GetSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + return null; + }; + + /** + * Creates a GetSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetSecurityPolicyRequest} GetSecurityPolicyRequest + */ + GetSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetSecurityPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + return message; + }; + + /** + * Creates a plain object from a GetSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.GetSecurityPolicyRequest} message GetSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = ""; + object.project = ""; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = message.securityPolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSecurityPolicyRequest; + })(); + + v1.GetRuleSecurityPolicyRequest = (function() { + + /** + * Properties of a GetRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetRuleSecurityPolicyRequest + * @property {number|null} [priority] GetRuleSecurityPolicyRequest priority + * @property {string|null} [project] GetRuleSecurityPolicyRequest project + * @property {string|null} [securityPolicy] GetRuleSecurityPolicyRequest securityPolicy + */ + + /** + * Constructs a new GetRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetRuleSecurityPolicyRequest. + * @implements IGetRuleSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetRuleSecurityPolicyRequest=} [properties] Properties to set + */ + function GetRuleSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRuleSecurityPolicyRequest priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @instance + */ + GetRuleSecurityPolicyRequest.prototype.priority = null; + + /** + * GetRuleSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @instance + */ + GetRuleSecurityPolicyRequest.prototype.project = ""; + + /** + * GetRuleSecurityPolicyRequest securityPolicy. + * @member {string} securityPolicy + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @instance + */ + GetRuleSecurityPolicyRequest.prototype.securityPolicy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetRuleSecurityPolicyRequest _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @instance + */ + Object.defineProperty(GetRuleSecurityPolicyRequest.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetRuleSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetRuleSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetRuleSecurityPolicyRequest} GetRuleSecurityPolicyRequest instance + */ + GetRuleSecurityPolicyRequest.create = function create(properties) { + return new GetRuleSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified GetRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRuleSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetRuleSecurityPolicyRequest} message GetRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuleSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified GetRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRuleSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetRuleSecurityPolicyRequest} message GetRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRuleSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRuleSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetRuleSecurityPolicyRequest} GetRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuleSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetRuleSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 445151652: + message.priority = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetRuleSecurityPolicyRequest} GetRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRuleSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRuleSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRuleSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + return null; + }; + + /** + * Creates a GetRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetRuleSecurityPolicyRequest} GetRuleSecurityPolicyRequest + */ + GetRuleSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetRuleSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetRuleSecurityPolicyRequest(); + if (object.priority != null) + message.priority = object.priority | 0; + if (object.project != null) + message.project = String(object.project); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + return message; + }; + + /** + * Creates a plain object from a GetRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.GetRuleSecurityPolicyRequest} message GetRuleSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRuleSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = ""; + object.project = ""; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = message.securityPolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + return object; + }; + + /** + * Converts this GetRuleSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetRuleSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetRuleSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetRuleSecurityPolicyRequest; + })(); + + v1.InsertSecurityPolicyRequest = (function() { + + /** + * Properties of an InsertSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertSecurityPolicyRequest + * @property {string|null} [project] InsertSecurityPolicyRequest project + * @property {string|null} [requestId] InsertSecurityPolicyRequest requestId + * @property {google.cloud.compute.v1.ISecurityPolicy|null} [securityPolicyResource] InsertSecurityPolicyRequest securityPolicyResource + */ + + /** + * Constructs a new InsertSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertSecurityPolicyRequest. + * @implements IInsertSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertSecurityPolicyRequest=} [properties] Properties to set + */ + function InsertSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @instance + */ + InsertSecurityPolicyRequest.prototype.project = ""; + + /** + * InsertSecurityPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @instance + */ + InsertSecurityPolicyRequest.prototype.requestId = null; + + /** + * InsertSecurityPolicyRequest securityPolicyResource. + * @member {google.cloud.compute.v1.ISecurityPolicy|null|undefined} securityPolicyResource + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @instance + */ + InsertSecurityPolicyRequest.prototype.securityPolicyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertSecurityPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @instance + */ + Object.defineProperty(InsertSecurityPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertSecurityPolicyRequest} InsertSecurityPolicyRequest instance + */ + InsertSecurityPolicyRequest.create = function create(properties) { + return new InsertSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified InsertSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertSecurityPolicyRequest} message InsertSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.securityPolicyResource != null && Object.hasOwnProperty.call(message, "securityPolicyResource")) + $root.google.cloud.compute.v1.SecurityPolicy.encode(message.securityPolicyResource, writer.uint32(/* id 216159612, wireType 2 =*/1729276898).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertSecurityPolicyRequest} message InsertSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertSecurityPolicyRequest} InsertSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 216159612: + message.securityPolicyResource = $root.google.cloud.compute.v1.SecurityPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertSecurityPolicyRequest} InsertSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.securityPolicyResource != null && message.hasOwnProperty("securityPolicyResource")) { + var error = $root.google.cloud.compute.v1.SecurityPolicy.verify(message.securityPolicyResource); + if (error) + return "securityPolicyResource." + error; + } + return null; + }; + + /** + * Creates an InsertSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertSecurityPolicyRequest} InsertSecurityPolicyRequest + */ + InsertSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertSecurityPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.securityPolicyResource != null) { + if (typeof object.securityPolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertSecurityPolicyRequest.securityPolicyResource: object expected"); + message.securityPolicyResource = $root.google.cloud.compute.v1.SecurityPolicy.fromObject(object.securityPolicyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.InsertSecurityPolicyRequest} message InsertSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicyResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.securityPolicyResource != null && message.hasOwnProperty("securityPolicyResource")) + object.securityPolicyResource = $root.google.cloud.compute.v1.SecurityPolicy.toObject(message.securityPolicyResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertSecurityPolicyRequest; + })(); + + v1.ListSecurityPoliciesRequest = (function() { + + /** + * Properties of a ListSecurityPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListSecurityPoliciesRequest + * @property {string|null} [filter] ListSecurityPoliciesRequest filter + * @property {number|null} [maxResults] ListSecurityPoliciesRequest maxResults + * @property {string|null} [orderBy] ListSecurityPoliciesRequest orderBy + * @property {string|null} [pageToken] ListSecurityPoliciesRequest pageToken + * @property {string|null} [project] ListSecurityPoliciesRequest project + * @property {boolean|null} [returnPartialSuccess] ListSecurityPoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListSecurityPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListSecurityPoliciesRequest. + * @implements IListSecurityPoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IListSecurityPoliciesRequest=} [properties] Properties to set + */ + function ListSecurityPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSecurityPoliciesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + ListSecurityPoliciesRequest.prototype.filter = null; + + /** + * ListSecurityPoliciesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + ListSecurityPoliciesRequest.prototype.maxResults = null; + + /** + * ListSecurityPoliciesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + ListSecurityPoliciesRequest.prototype.orderBy = null; + + /** + * ListSecurityPoliciesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + ListSecurityPoliciesRequest.prototype.pageToken = null; + + /** + * ListSecurityPoliciesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + ListSecurityPoliciesRequest.prototype.project = ""; + + /** + * ListSecurityPoliciesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + ListSecurityPoliciesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListSecurityPoliciesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListSecurityPoliciesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSecurityPoliciesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListSecurityPoliciesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSecurityPoliciesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListSecurityPoliciesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSecurityPoliciesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListSecurityPoliciesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSecurityPoliciesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListSecurityPoliciesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListSecurityPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListSecurityPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListSecurityPoliciesRequest} ListSecurityPoliciesRequest instance + */ + ListSecurityPoliciesRequest.create = function create(properties) { + return new ListSecurityPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListSecurityPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSecurityPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListSecurityPoliciesRequest} message ListSecurityPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecurityPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListSecurityPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSecurityPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListSecurityPoliciesRequest} message ListSecurityPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSecurityPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSecurityPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListSecurityPoliciesRequest} ListSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecurityPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListSecurityPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSecurityPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListSecurityPoliciesRequest} ListSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSecurityPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSecurityPoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSecurityPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListSecurityPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListSecurityPoliciesRequest} ListSecurityPoliciesRequest + */ + ListSecurityPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListSecurityPoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListSecurityPoliciesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListSecurityPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.ListSecurityPoliciesRequest} message ListSecurityPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSecurityPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListSecurityPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListSecurityPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSecurityPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSecurityPoliciesRequest; + })(); + + v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest = (function() { + + /** + * Properties of a ListPreconfiguredExpressionSetsSecurityPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @property {string|null} [filter] ListPreconfiguredExpressionSetsSecurityPoliciesRequest filter + * @property {number|null} [maxResults] ListPreconfiguredExpressionSetsSecurityPoliciesRequest maxResults + * @property {string|null} [orderBy] ListPreconfiguredExpressionSetsSecurityPoliciesRequest orderBy + * @property {string|null} [pageToken] ListPreconfiguredExpressionSetsSecurityPoliciesRequest pageToken + * @property {string|null} [project] ListPreconfiguredExpressionSetsSecurityPoliciesRequest project + * @property {boolean|null} [returnPartialSuccess] ListPreconfiguredExpressionSetsSecurityPoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListPreconfiguredExpressionSetsSecurityPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListPreconfiguredExpressionSetsSecurityPoliciesRequest. + * @implements IListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest=} [properties] Properties to set + */ + function ListPreconfiguredExpressionSetsSecurityPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype.filter = null; + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype.maxResults = null; + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype.orderBy = null; + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype.pageToken = null; + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype.project = ""; + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListPreconfiguredExpressionSetsSecurityPoliciesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + */ + Object.defineProperty(ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListPreconfiguredExpressionSetsSecurityPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest} ListPreconfiguredExpressionSetsSecurityPoliciesRequest instance + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.create = function create(properties) { + return new ListPreconfiguredExpressionSetsSecurityPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListPreconfiguredExpressionSetsSecurityPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest} message ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListPreconfiguredExpressionSetsSecurityPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest} message ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest} ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest} ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest} ListPreconfiguredExpressionSetsSecurityPoliciesRequest + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListPreconfiguredExpressionSetsSecurityPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @static + * @param {google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest} message ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListPreconfiguredExpressionSetsSecurityPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListPreconfiguredExpressionSetsSecurityPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListPreconfiguredExpressionSetsSecurityPoliciesRequest; + })(); + + v1.PatchSecurityPolicyRequest = (function() { + + /** + * Properties of a PatchSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchSecurityPolicyRequest + * @property {string|null} [project] PatchSecurityPolicyRequest project + * @property {string|null} [requestId] PatchSecurityPolicyRequest requestId + * @property {string|null} [securityPolicy] PatchSecurityPolicyRequest securityPolicy + * @property {google.cloud.compute.v1.ISecurityPolicy|null} [securityPolicyResource] PatchSecurityPolicyRequest securityPolicyResource + */ + + /** + * Constructs a new PatchSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchSecurityPolicyRequest. + * @implements IPatchSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchSecurityPolicyRequest=} [properties] Properties to set + */ + function PatchSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @instance + */ + PatchSecurityPolicyRequest.prototype.project = ""; + + /** + * PatchSecurityPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @instance + */ + PatchSecurityPolicyRequest.prototype.requestId = null; + + /** + * PatchSecurityPolicyRequest securityPolicy. + * @member {string} securityPolicy + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @instance + */ + PatchSecurityPolicyRequest.prototype.securityPolicy = ""; + + /** + * PatchSecurityPolicyRequest securityPolicyResource. + * @member {google.cloud.compute.v1.ISecurityPolicy|null|undefined} securityPolicyResource + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @instance + */ + PatchSecurityPolicyRequest.prototype.securityPolicyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchSecurityPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @instance + */ + Object.defineProperty(PatchSecurityPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchSecurityPolicyRequest} PatchSecurityPolicyRequest instance + */ + PatchSecurityPolicyRequest.create = function create(properties) { + return new PatchSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified PatchSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchSecurityPolicyRequest} message PatchSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.securityPolicyResource != null && Object.hasOwnProperty.call(message, "securityPolicyResource")) + $root.google.cloud.compute.v1.SecurityPolicy.encode(message.securityPolicyResource, writer.uint32(/* id 216159612, wireType 2 =*/1729276898).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified PatchSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchSecurityPolicyRequest} message PatchSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchSecurityPolicyRequest} PatchSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + case 216159612: + message.securityPolicyResource = $root.google.cloud.compute.v1.SecurityPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchSecurityPolicyRequest} PatchSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + if (message.securityPolicyResource != null && message.hasOwnProperty("securityPolicyResource")) { + var error = $root.google.cloud.compute.v1.SecurityPolicy.verify(message.securityPolicyResource); + if (error) + return "securityPolicyResource." + error; + } + return null; + }; + + /** + * Creates a PatchSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchSecurityPolicyRequest} PatchSecurityPolicyRequest + */ + PatchSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchSecurityPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + if (object.securityPolicyResource != null) { + if (typeof object.securityPolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchSecurityPolicyRequest.securityPolicyResource: object expected"); + message.securityPolicyResource = $root.google.cloud.compute.v1.SecurityPolicy.fromObject(object.securityPolicyResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.PatchSecurityPolicyRequest} message PatchSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = ""; + object.securityPolicyResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = message.securityPolicy; + if (message.securityPolicyResource != null && message.hasOwnProperty("securityPolicyResource")) + object.securityPolicyResource = $root.google.cloud.compute.v1.SecurityPolicy.toObject(message.securityPolicyResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this PatchSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchSecurityPolicyRequest; + })(); + + v1.PatchRuleSecurityPolicyRequest = (function() { + + /** + * Properties of a PatchRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchRuleSecurityPolicyRequest + * @property {number|null} [priority] PatchRuleSecurityPolicyRequest priority + * @property {string|null} [project] PatchRuleSecurityPolicyRequest project + * @property {string|null} [securityPolicy] PatchRuleSecurityPolicyRequest securityPolicy + * @property {google.cloud.compute.v1.ISecurityPolicyRule|null} [securityPolicyRuleResource] PatchRuleSecurityPolicyRequest securityPolicyRuleResource + */ + + /** + * Constructs a new PatchRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchRuleSecurityPolicyRequest. + * @implements IPatchRuleSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest=} [properties] Properties to set + */ + function PatchRuleSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchRuleSecurityPolicyRequest priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @instance + */ + PatchRuleSecurityPolicyRequest.prototype.priority = null; + + /** + * PatchRuleSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @instance + */ + PatchRuleSecurityPolicyRequest.prototype.project = ""; + + /** + * PatchRuleSecurityPolicyRequest securityPolicy. + * @member {string} securityPolicy + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @instance + */ + PatchRuleSecurityPolicyRequest.prototype.securityPolicy = ""; + + /** + * PatchRuleSecurityPolicyRequest securityPolicyRuleResource. + * @member {google.cloud.compute.v1.ISecurityPolicyRule|null|undefined} securityPolicyRuleResource + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @instance + */ + PatchRuleSecurityPolicyRequest.prototype.securityPolicyRuleResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchRuleSecurityPolicyRequest _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @instance + */ + Object.defineProperty(PatchRuleSecurityPolicyRequest.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchRuleSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchRuleSecurityPolicyRequest} PatchRuleSecurityPolicyRequest instance + */ + PatchRuleSecurityPolicyRequest.create = function create(properties) { + return new PatchRuleSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified PatchRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRuleSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest} message PatchRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRuleSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.securityPolicyRuleResource != null && Object.hasOwnProperty.call(message, "securityPolicyRuleResource")) + $root.google.cloud.compute.v1.SecurityPolicyRule.encode(message.securityPolicyRuleResource, writer.uint32(/* id 402693443, wireType 2 =*/3221547546).fork()).ldelim(); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified PatchRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRuleSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest} message PatchRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchRuleSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchRuleSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchRuleSecurityPolicyRequest} PatchRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRuleSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchRuleSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 445151652: + message.priority = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + case 402693443: + message.securityPolicyRuleResource = $root.google.cloud.compute.v1.SecurityPolicyRule.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchRuleSecurityPolicyRequest} PatchRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchRuleSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchRuleSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchRuleSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + if (message.securityPolicyRuleResource != null && message.hasOwnProperty("securityPolicyRuleResource")) { + var error = $root.google.cloud.compute.v1.SecurityPolicyRule.verify(message.securityPolicyRuleResource); + if (error) + return "securityPolicyRuleResource." + error; + } + return null; + }; + + /** + * Creates a PatchRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchRuleSecurityPolicyRequest} PatchRuleSecurityPolicyRequest + */ + PatchRuleSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchRuleSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchRuleSecurityPolicyRequest(); + if (object.priority != null) + message.priority = object.priority | 0; + if (object.project != null) + message.project = String(object.project); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + if (object.securityPolicyRuleResource != null) { + if (typeof object.securityPolicyRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchRuleSecurityPolicyRequest.securityPolicyRuleResource: object expected"); + message.securityPolicyRuleResource = $root.google.cloud.compute.v1.SecurityPolicyRule.fromObject(object.securityPolicyRuleResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.PatchRuleSecurityPolicyRequest} message PatchRuleSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchRuleSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = ""; + object.project = ""; + object.securityPolicyRuleResource = null; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = message.securityPolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.securityPolicyRuleResource != null && message.hasOwnProperty("securityPolicyRuleResource")) + object.securityPolicyRuleResource = $root.google.cloud.compute.v1.SecurityPolicyRule.toObject(message.securityPolicyRuleResource, options); + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + return object; + }; + + /** + * Converts this PatchRuleSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchRuleSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchRuleSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchRuleSecurityPolicyRequest; + })(); + + v1.RemoveRuleSecurityPolicyRequest = (function() { + + /** + * Properties of a RemoveRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveRuleSecurityPolicyRequest + * @property {number|null} [priority] RemoveRuleSecurityPolicyRequest priority + * @property {string|null} [project] RemoveRuleSecurityPolicyRequest project + * @property {string|null} [securityPolicy] RemoveRuleSecurityPolicyRequest securityPolicy + */ + + /** + * Constructs a new RemoveRuleSecurityPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveRuleSecurityPolicyRequest. + * @implements IRemoveRuleSecurityPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest=} [properties] Properties to set + */ + function RemoveRuleSecurityPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveRuleSecurityPolicyRequest priority. + * @member {number|null|undefined} priority + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @instance + */ + RemoveRuleSecurityPolicyRequest.prototype.priority = null; + + /** + * RemoveRuleSecurityPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @instance + */ + RemoveRuleSecurityPolicyRequest.prototype.project = ""; + + /** + * RemoveRuleSecurityPolicyRequest securityPolicy. + * @member {string} securityPolicy + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @instance + */ + RemoveRuleSecurityPolicyRequest.prototype.securityPolicy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveRuleSecurityPolicyRequest _priority. + * @member {"priority"|undefined} _priority + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @instance + */ + Object.defineProperty(RemoveRuleSecurityPolicyRequest.prototype, "_priority", { + get: $util.oneOfGetter($oneOfFields = ["priority"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveRuleSecurityPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest} RemoveRuleSecurityPolicyRequest instance + */ + RemoveRuleSecurityPolicyRequest.create = function create(properties) { + return new RemoveRuleSecurityPolicyRequest(properties); + }; + + /** + * Encodes the specified RemoveRuleSecurityPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest} message RemoveRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveRuleSecurityPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityPolicy != null && Object.hasOwnProperty.call(message, "securityPolicy")) + writer.uint32(/* id 171082513, wireType 2 =*/1368660106).string(message.securityPolicy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 445151652, wireType 0 =*/3561213216).int32(message.priority); + return writer; + }; + + /** + * Encodes the specified RemoveRuleSecurityPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest} message RemoveRuleSecurityPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveRuleSecurityPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveRuleSecurityPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest} RemoveRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveRuleSecurityPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 445151652: + message.priority = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 171082513: + message.securityPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveRuleSecurityPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest} RemoveRuleSecurityPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveRuleSecurityPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveRuleSecurityPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveRuleSecurityPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.priority != null && message.hasOwnProperty("priority")) { + properties._priority = 1; + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + if (!$util.isString(message.securityPolicy)) + return "securityPolicy: string expected"; + return null; + }; + + /** + * Creates a RemoveRuleSecurityPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest} RemoveRuleSecurityPolicyRequest + */ + RemoveRuleSecurityPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest(); + if (object.priority != null) + message.priority = object.priority | 0; + if (object.project != null) + message.project = String(object.project); + if (object.securityPolicy != null) + message.securityPolicy = String(object.securityPolicy); + return message; + }; + + /** + * Creates a plain object from a RemoveRuleSecurityPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @static + * @param {google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest} message RemoveRuleSecurityPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveRuleSecurityPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.securityPolicy = ""; + object.project = ""; + } + if (message.securityPolicy != null && message.hasOwnProperty("securityPolicy")) + object.securityPolicy = message.securityPolicy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.priority != null && message.hasOwnProperty("priority")) { + object.priority = message.priority; + if (options.oneofs) + object._priority = "priority"; + } + return object; + }; + + /** + * Converts this RemoveRuleSecurityPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveRuleSecurityPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveRuleSecurityPolicyRequest; + })(); + + v1.DeleteSnapshotRequest = (function() { + + /** + * Properties of a DeleteSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteSnapshotRequest + * @property {string|null} [project] DeleteSnapshotRequest project + * @property {string|null} [requestId] DeleteSnapshotRequest requestId + * @property {string|null} [snapshot] DeleteSnapshotRequest snapshot + */ + + /** + * Constructs a new DeleteSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteSnapshotRequest=} [properties] Properties to set + */ + function DeleteSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSnapshotRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.project = ""; + + /** + * DeleteSnapshotRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.requestId = null; + + /** + * DeleteSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.snapshot = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteSnapshotRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @instance + */ + Object.defineProperty(DeleteSnapshotRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteSnapshotRequest} DeleteSnapshotRequest instance + */ + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); + }; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 284874180, wireType 2 =*/2278993442).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 284874180: + message.snapshot = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + return null; + }; + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteSnapshotRequest} DeleteSnapshotRequest + */ + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteSnapshotRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteSnapshotRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @static + * @param {google.cloud.compute.v1.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.snapshot = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; + return object; + }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSnapshotRequest; + })(); + + v1.GetSnapshotRequest = (function() { + + /** + * Properties of a GetSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetSnapshotRequest + * @property {string|null} [project] GetSnapshotRequest project + * @property {string|null} [snapshot] GetSnapshotRequest snapshot + */ + + /** + * Constructs a new GetSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest + * @constructor + * @param {google.cloud.compute.v1.IGetSnapshotRequest=} [properties] Properties to set + */ + function GetSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSnapshotRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.project = ""; + + /** + * GetSnapshotRequest snapshot. + * @member {string} snapshot + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.snapshot = ""; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {google.cloud.compute.v1.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetSnapshotRequest} GetSnapshotRequest instance + */ + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); + }; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {google.cloud.compute.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + writer.uint32(/* id 284874180, wireType 2 =*/2278993442).string(message.snapshot); + return writer; + }; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {google.cloud.compute.v1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 284874180: + message.snapshot = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSnapshotRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + if (!$util.isString(message.snapshot)) + return "snapshot: string expected"; + return null; + }; + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetSnapshotRequest} GetSnapshotRequest + */ + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetSnapshotRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetSnapshotRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.snapshot != null) + message.snapshot = String(object.snapshot); + return message; + }; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @static + * @param {google.cloud.compute.v1.GetSnapshotRequest} message GetSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.snapshot = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = message.snapshot; + return object; + }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSnapshotRequest; + })(); + + v1.GetIamPolicySnapshotRequest = (function() { + + /** + * Properties of a GetIamPolicySnapshotRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicySnapshotRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicySnapshotRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicySnapshotRequest project + * @property {string|null} [resource] GetIamPolicySnapshotRequest resource + */ + + /** + * Constructs a new GetIamPolicySnapshotRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicySnapshotRequest. + * @implements IGetIamPolicySnapshotRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicySnapshotRequest=} [properties] Properties to set + */ + function GetIamPolicySnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicySnapshotRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @instance + */ + GetIamPolicySnapshotRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicySnapshotRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @instance + */ + GetIamPolicySnapshotRequest.prototype.project = ""; + + /** + * GetIamPolicySnapshotRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @instance + */ + GetIamPolicySnapshotRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicySnapshotRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @instance + */ + Object.defineProperty(GetIamPolicySnapshotRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicySnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicySnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicySnapshotRequest} GetIamPolicySnapshotRequest instance + */ + GetIamPolicySnapshotRequest.create = function create(properties) { + return new GetIamPolicySnapshotRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicySnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicySnapshotRequest} message GetIamPolicySnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicySnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicySnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicySnapshotRequest} message GetIamPolicySnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicySnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicySnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicySnapshotRequest} GetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicySnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicySnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicySnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicySnapshotRequest} GetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicySnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicySnapshotRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicySnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicySnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicySnapshotRequest} GetIamPolicySnapshotRequest + */ + GetIamPolicySnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicySnapshotRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicySnapshotRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicySnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicySnapshotRequest} message GetIamPolicySnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicySnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicySnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicySnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicySnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicySnapshotRequest; + })(); + + v1.ListSnapshotsRequest = (function() { + + /** + * Properties of a ListSnapshotsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListSnapshotsRequest + * @property {string|null} [filter] ListSnapshotsRequest filter + * @property {number|null} [maxResults] ListSnapshotsRequest maxResults + * @property {string|null} [orderBy] ListSnapshotsRequest orderBy + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken + * @property {string|null} [project] ListSnapshotsRequest project + * @property {boolean|null} [returnPartialSuccess] ListSnapshotsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListSnapshotsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest + * @constructor + * @param {google.cloud.compute.v1.IListSnapshotsRequest=} [properties] Properties to set + */ + function ListSnapshotsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.filter = null; + + /** + * ListSnapshotsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.maxResults = null; + + /** + * ListSnapshotsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.orderBy = null; + + /** + * ListSnapshotsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageToken = null; + + /** + * ListSnapshotsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.project = ""; + + /** + * ListSnapshotsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListSnapshotsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + Object.defineProperty(ListSnapshotsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSnapshotsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + Object.defineProperty(ListSnapshotsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSnapshotsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + Object.defineProperty(ListSnapshotsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSnapshotsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + Object.defineProperty(ListSnapshotsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSnapshotsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + */ + Object.defineProperty(ListSnapshotsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {google.cloud.compute.v1.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListSnapshotsRequest} ListSnapshotsRequest instance + */ + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {google.cloud.compute.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {google.cloud.compute.v1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListSnapshotsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListSnapshotsRequest} ListSnapshotsRequest + */ + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListSnapshotsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListSnapshotsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @static + * @param {google.cloud.compute.v1.ListSnapshotsRequest} message ListSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSnapshotsRequest; + })(); + + v1.SetIamPolicySnapshotRequest = (function() { + + /** + * Properties of a SetIamPolicySnapshotRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicySnapshotRequest + * @property {google.cloud.compute.v1.IGlobalSetPolicyRequest|null} [globalSetPolicyRequestResource] SetIamPolicySnapshotRequest globalSetPolicyRequestResource + * @property {string|null} [project] SetIamPolicySnapshotRequest project + * @property {string|null} [resource] SetIamPolicySnapshotRequest resource + */ + + /** + * Constructs a new SetIamPolicySnapshotRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicySnapshotRequest. + * @implements ISetIamPolicySnapshotRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicySnapshotRequest=} [properties] Properties to set + */ + function SetIamPolicySnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicySnapshotRequest globalSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetPolicyRequest|null|undefined} globalSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @instance + */ + SetIamPolicySnapshotRequest.prototype.globalSetPolicyRequestResource = null; + + /** + * SetIamPolicySnapshotRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @instance + */ + SetIamPolicySnapshotRequest.prototype.project = ""; + + /** + * SetIamPolicySnapshotRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @instance + */ + SetIamPolicySnapshotRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicySnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicySnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicySnapshotRequest} SetIamPolicySnapshotRequest instance + */ + SetIamPolicySnapshotRequest.create = function create(properties) { + return new SetIamPolicySnapshotRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicySnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicySnapshotRequest} message SetIamPolicySnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicySnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "globalSetPolicyRequestResource")) + $root.google.cloud.compute.v1.GlobalSetPolicyRequest.encode(message.globalSetPolicyRequestResource, writer.uint32(/* id 337048498, wireType 2 =*/2696387986).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicySnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicySnapshotRequest} message SetIamPolicySnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicySnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicySnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicySnapshotRequest} SetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicySnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicySnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 337048498: + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicySnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicySnapshotRequest} SetIamPolicySnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicySnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicySnapshotRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicySnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.verify(message.globalSetPolicyRequestResource); + if (error) + return "globalSetPolicyRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicySnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicySnapshotRequest} SetIamPolicySnapshotRequest + */ + SetIamPolicySnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicySnapshotRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicySnapshotRequest(); + if (object.globalSetPolicyRequestResource != null) { + if (typeof object.globalSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicySnapshotRequest.globalSetPolicyRequestResource: object expected"); + message.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.fromObject(object.globalSetPolicyRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicySnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicySnapshotRequest} message SetIamPolicySnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicySnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetPolicyRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetPolicyRequestResource != null && message.hasOwnProperty("globalSetPolicyRequestResource")) + object.globalSetPolicyRequestResource = $root.google.cloud.compute.v1.GlobalSetPolicyRequest.toObject(message.globalSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicySnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicySnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicySnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicySnapshotRequest; + })(); + + v1.SetLabelsSnapshotRequest = (function() { + + /** + * Properties of a SetLabelsSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsSnapshotRequest + * @property {google.cloud.compute.v1.IGlobalSetLabelsRequest|null} [globalSetLabelsRequestResource] SetLabelsSnapshotRequest globalSetLabelsRequestResource + * @property {string|null} [project] SetLabelsSnapshotRequest project + * @property {string|null} [resource] SetLabelsSnapshotRequest resource + */ + + /** + * Constructs a new SetLabelsSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsSnapshotRequest. + * @implements ISetLabelsSnapshotRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsSnapshotRequest=} [properties] Properties to set + */ + function SetLabelsSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsSnapshotRequest globalSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IGlobalSetLabelsRequest|null|undefined} globalSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @instance + */ + SetLabelsSnapshotRequest.prototype.globalSetLabelsRequestResource = null; + + /** + * SetLabelsSnapshotRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @instance + */ + SetLabelsSnapshotRequest.prototype.project = ""; + + /** + * SetLabelsSnapshotRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @instance + */ + SetLabelsSnapshotRequest.prototype.resource = ""; + + /** + * Creates a new SetLabelsSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsSnapshotRequest} SetLabelsSnapshotRequest instance + */ + SetLabelsSnapshotRequest.create = function create(properties) { + return new SetLabelsSnapshotRequest(properties); + }; + + /** + * Encodes the specified SetLabelsSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsSnapshotRequest} message SetLabelsSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.globalSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "globalSetLabelsRequestResource")) + $root.google.cloud.compute.v1.GlobalSetLabelsRequest.encode(message.globalSetLabelsRequestResource, writer.uint32(/* id 319917189, wireType 2 =*/2559337514).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsSnapshotRequest} message SetLabelsSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsSnapshotRequest} SetLabelsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 319917189: + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsSnapshotRequest} SetLabelsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsSnapshotRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.verify(message.globalSetLabelsRequestResource); + if (error) + return "globalSetLabelsRequestResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetLabelsSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsSnapshotRequest} SetLabelsSnapshotRequest + */ + SetLabelsSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsSnapshotRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsSnapshotRequest(); + if (object.globalSetLabelsRequestResource != null) { + if (typeof object.globalSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsSnapshotRequest.globalSetLabelsRequestResource: object expected"); + message.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.fromObject(object.globalSetLabelsRequestResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetLabelsSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsSnapshotRequest} message SetLabelsSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.globalSetLabelsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.globalSetLabelsRequestResource != null && message.hasOwnProperty("globalSetLabelsRequestResource")) + object.globalSetLabelsRequestResource = $root.google.cloud.compute.v1.GlobalSetLabelsRequest.toObject(message.globalSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsSnapshotRequest; + })(); + + v1.TestIamPermissionsSnapshotRequest = (function() { + + /** + * Properties of a TestIamPermissionsSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsSnapshotRequest + * @property {string|null} [project] TestIamPermissionsSnapshotRequest project + * @property {string|null} [resource] TestIamPermissionsSnapshotRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsSnapshotRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsSnapshotRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsSnapshotRequest. + * @implements ITestIamPermissionsSnapshotRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest=} [properties] Properties to set + */ + function TestIamPermissionsSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsSnapshotRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @instance + */ + TestIamPermissionsSnapshotRequest.prototype.project = ""; + + /** + * TestIamPermissionsSnapshotRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @instance + */ + TestIamPermissionsSnapshotRequest.prototype.resource = ""; + + /** + * TestIamPermissionsSnapshotRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @instance + */ + TestIamPermissionsSnapshotRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsSnapshotRequest} TestIamPermissionsSnapshotRequest instance + */ + TestIamPermissionsSnapshotRequest.create = function create(properties) { + return new TestIamPermissionsSnapshotRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsSnapshotRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest} message TestIamPermissionsSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest} message TestIamPermissionsSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsSnapshotRequest} TestIamPermissionsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsSnapshotRequest} TestIamPermissionsSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsSnapshotRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsSnapshotRequest} TestIamPermissionsSnapshotRequest + */ + TestIamPermissionsSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsSnapshotRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsSnapshotRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsSnapshotRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsSnapshotRequest} message TestIamPermissionsSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsSnapshotRequest; + })(); + + v1.AggregatedListSslCertificatesRequest = (function() { + + /** + * Properties of an AggregatedListSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListSslCertificatesRequest + * @property {string|null} [filter] AggregatedListSslCertificatesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListSslCertificatesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListSslCertificatesRequest maxResults + * @property {string|null} [orderBy] AggregatedListSslCertificatesRequest orderBy + * @property {string|null} [pageToken] AggregatedListSslCertificatesRequest pageToken + * @property {string|null} [project] AggregatedListSslCertificatesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListSslCertificatesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListSslCertificatesRequest. + * @implements IAggregatedListSslCertificatesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListSslCertificatesRequest=} [properties] Properties to set + */ + function AggregatedListSslCertificatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListSslCertificatesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + AggregatedListSslCertificatesRequest.prototype.filter = null; + + /** + * AggregatedListSslCertificatesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + AggregatedListSslCertificatesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListSslCertificatesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + AggregatedListSslCertificatesRequest.prototype.maxResults = null; + + /** + * AggregatedListSslCertificatesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + AggregatedListSslCertificatesRequest.prototype.orderBy = null; + + /** + * AggregatedListSslCertificatesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + AggregatedListSslCertificatesRequest.prototype.pageToken = null; + + /** + * AggregatedListSslCertificatesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + AggregatedListSslCertificatesRequest.prototype.project = ""; + + /** + * AggregatedListSslCertificatesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + AggregatedListSslCertificatesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListSslCertificatesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + Object.defineProperty(AggregatedListSslCertificatesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSslCertificatesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + Object.defineProperty(AggregatedListSslCertificatesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSslCertificatesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + Object.defineProperty(AggregatedListSslCertificatesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSslCertificatesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + Object.defineProperty(AggregatedListSslCertificatesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSslCertificatesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + Object.defineProperty(AggregatedListSslCertificatesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSslCertificatesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + */ + Object.defineProperty(AggregatedListSslCertificatesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListSslCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListSslCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListSslCertificatesRequest} AggregatedListSslCertificatesRequest instance + */ + AggregatedListSslCertificatesRequest.create = function create(properties) { + return new AggregatedListSslCertificatesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSslCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListSslCertificatesRequest} message AggregatedListSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListSslCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSslCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListSslCertificatesRequest} message AggregatedListSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListSslCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListSslCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListSslCertificatesRequest} AggregatedListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListSslCertificatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListSslCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListSslCertificatesRequest} AggregatedListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListSslCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListSslCertificatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListSslCertificatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListSslCertificatesRequest} AggregatedListSslCertificatesRequest + */ + AggregatedListSslCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListSslCertificatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListSslCertificatesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListSslCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListSslCertificatesRequest} message AggregatedListSslCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListSslCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListSslCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListSslCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListSslCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListSslCertificatesRequest; + })(); + + v1.DeleteSslCertificateRequest = (function() { + + /** + * Properties of a DeleteSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteSslCertificateRequest + * @property {string|null} [project] DeleteSslCertificateRequest project + * @property {string|null} [requestId] DeleteSslCertificateRequest requestId + * @property {string|null} [sslCertificate] DeleteSslCertificateRequest sslCertificate + */ + + /** + * Constructs a new DeleteSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteSslCertificateRequest. + * @implements IDeleteSslCertificateRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteSslCertificateRequest=} [properties] Properties to set + */ + function DeleteSslCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSslCertificateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @instance + */ + DeleteSslCertificateRequest.prototype.project = ""; + + /** + * DeleteSslCertificateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @instance + */ + DeleteSslCertificateRequest.prototype.requestId = null; + + /** + * DeleteSslCertificateRequest sslCertificate. + * @member {string} sslCertificate + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @instance + */ + DeleteSslCertificateRequest.prototype.sslCertificate = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteSslCertificateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @instance + */ + Object.defineProperty(DeleteSslCertificateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteSslCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSslCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteSslCertificateRequest} DeleteSslCertificateRequest instance + */ + DeleteSslCertificateRequest.create = function create(properties) { + return new DeleteSslCertificateRequest(properties); + }; + + /** + * Encodes the specified DeleteSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSslCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSslCertificateRequest} message DeleteSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSslCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.sslCertificate != null && Object.hasOwnProperty.call(message, "sslCertificate")) + writer.uint32(/* id 46443492, wireType 2 =*/371547938).string(message.sslCertificate); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSslCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSslCertificateRequest} message DeleteSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSslCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSslCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteSslCertificateRequest} DeleteSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSslCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteSslCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 46443492: + message.sslCertificate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSslCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteSslCertificateRequest} DeleteSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSslCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSslCertificateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSslCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + if (!$util.isString(message.sslCertificate)) + return "sslCertificate: string expected"; + return null; + }; + + /** + * Creates a DeleteSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteSslCertificateRequest} DeleteSslCertificateRequest + */ + DeleteSslCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteSslCertificateRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteSslCertificateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslCertificate != null) + message.sslCertificate = String(object.sslCertificate); + return message; + }; + + /** + * Creates a plain object from a DeleteSslCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.DeleteSslCertificateRequest} message DeleteSslCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSslCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslCertificate = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + object.sslCertificate = message.sslCertificate; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteSslCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteSslCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSslCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSslCertificateRequest; + })(); + + v1.GetSslCertificateRequest = (function() { + + /** + * Properties of a GetSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetSslCertificateRequest + * @property {string|null} [project] GetSslCertificateRequest project + * @property {string|null} [sslCertificate] GetSslCertificateRequest sslCertificate + */ + + /** + * Constructs a new GetSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetSslCertificateRequest. + * @implements IGetSslCertificateRequest + * @constructor + * @param {google.cloud.compute.v1.IGetSslCertificateRequest=} [properties] Properties to set + */ + function GetSslCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSslCertificateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @instance + */ + GetSslCertificateRequest.prototype.project = ""; + + /** + * GetSslCertificateRequest sslCertificate. + * @member {string} sslCertificate + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @instance + */ + GetSslCertificateRequest.prototype.sslCertificate = ""; + + /** + * Creates a new GetSslCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IGetSslCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetSslCertificateRequest} GetSslCertificateRequest instance + */ + GetSslCertificateRequest.create = function create(properties) { + return new GetSslCertificateRequest(properties); + }; + + /** + * Encodes the specified GetSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSslCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IGetSslCertificateRequest} message GetSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSslCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sslCertificate != null && Object.hasOwnProperty.call(message, "sslCertificate")) + writer.uint32(/* id 46443492, wireType 2 =*/371547938).string(message.sslCertificate); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSslCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IGetSslCertificateRequest} message GetSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSslCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSslCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetSslCertificateRequest} GetSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSslCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetSslCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 46443492: + message.sslCertificate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSslCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetSslCertificateRequest} GetSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSslCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSslCertificateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSslCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + if (!$util.isString(message.sslCertificate)) + return "sslCertificate: string expected"; + return null; + }; + + /** + * Creates a GetSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetSslCertificateRequest} GetSslCertificateRequest + */ + GetSslCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetSslCertificateRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetSslCertificateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.sslCertificate != null) + message.sslCertificate = String(object.sslCertificate); + return message; + }; + + /** + * Creates a plain object from a GetSslCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.GetSslCertificateRequest} message GetSslCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSslCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslCertificate = ""; + object.project = ""; + } + if (message.sslCertificate != null && message.hasOwnProperty("sslCertificate")) + object.sslCertificate = message.sslCertificate; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetSslCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetSslCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + GetSslCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSslCertificateRequest; + })(); + + v1.InsertSslCertificateRequest = (function() { + + /** + * Properties of an InsertSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertSslCertificateRequest + * @property {string|null} [project] InsertSslCertificateRequest project + * @property {string|null} [requestId] InsertSslCertificateRequest requestId + * @property {google.cloud.compute.v1.ISslCertificate|null} [sslCertificateResource] InsertSslCertificateRequest sslCertificateResource + */ + + /** + * Constructs a new InsertSslCertificateRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertSslCertificateRequest. + * @implements IInsertSslCertificateRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertSslCertificateRequest=} [properties] Properties to set + */ + function InsertSslCertificateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertSslCertificateRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @instance + */ + InsertSslCertificateRequest.prototype.project = ""; + + /** + * InsertSslCertificateRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @instance + */ + InsertSslCertificateRequest.prototype.requestId = null; + + /** + * InsertSslCertificateRequest sslCertificateResource. + * @member {google.cloud.compute.v1.ISslCertificate|null|undefined} sslCertificateResource + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @instance + */ + InsertSslCertificateRequest.prototype.sslCertificateResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertSslCertificateRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @instance + */ + Object.defineProperty(InsertSslCertificateRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertSslCertificateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IInsertSslCertificateRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertSslCertificateRequest} InsertSslCertificateRequest instance + */ + InsertSslCertificateRequest.create = function create(properties) { + return new InsertSslCertificateRequest(properties); + }; + + /** + * Encodes the specified InsertSslCertificateRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSslCertificateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IInsertSslCertificateRequest} message InsertSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSslCertificateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.sslCertificateResource != null && Object.hasOwnProperty.call(message, "sslCertificateResource")) + $root.google.cloud.compute.v1.SslCertificate.encode(message.sslCertificateResource, writer.uint32(/* id 180709897, wireType 2 =*/1445679178).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertSslCertificateRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSslCertificateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.IInsertSslCertificateRequest} message InsertSslCertificateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSslCertificateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertSslCertificateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertSslCertificateRequest} InsertSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSslCertificateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertSslCertificateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 180709897: + message.sslCertificateResource = $root.google.cloud.compute.v1.SslCertificate.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertSslCertificateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertSslCertificateRequest} InsertSslCertificateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSslCertificateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertSslCertificateRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertSslCertificateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslCertificateResource != null && message.hasOwnProperty("sslCertificateResource")) { + var error = $root.google.cloud.compute.v1.SslCertificate.verify(message.sslCertificateResource); + if (error) + return "sslCertificateResource." + error; + } + return null; + }; + + /** + * Creates an InsertSslCertificateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertSslCertificateRequest} InsertSslCertificateRequest + */ + InsertSslCertificateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertSslCertificateRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertSslCertificateRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslCertificateResource != null) { + if (typeof object.sslCertificateResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertSslCertificateRequest.sslCertificateResource: object expected"); + message.sslCertificateResource = $root.google.cloud.compute.v1.SslCertificate.fromObject(object.sslCertificateResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertSslCertificateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @static + * @param {google.cloud.compute.v1.InsertSslCertificateRequest} message InsertSslCertificateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertSslCertificateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sslCertificateResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.sslCertificateResource != null && message.hasOwnProperty("sslCertificateResource")) + object.sslCertificateResource = $root.google.cloud.compute.v1.SslCertificate.toObject(message.sslCertificateResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertSslCertificateRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertSslCertificateRequest + * @instance + * @returns {Object.} JSON object + */ + InsertSslCertificateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertSslCertificateRequest; + })(); + + v1.ListSslCertificatesRequest = (function() { + + /** + * Properties of a ListSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListSslCertificatesRequest + * @property {string|null} [filter] ListSslCertificatesRequest filter + * @property {number|null} [maxResults] ListSslCertificatesRequest maxResults + * @property {string|null} [orderBy] ListSslCertificatesRequest orderBy + * @property {string|null} [pageToken] ListSslCertificatesRequest pageToken + * @property {string|null} [project] ListSslCertificatesRequest project + * @property {boolean|null} [returnPartialSuccess] ListSslCertificatesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListSslCertificatesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListSslCertificatesRequest. + * @implements IListSslCertificatesRequest + * @constructor + * @param {google.cloud.compute.v1.IListSslCertificatesRequest=} [properties] Properties to set + */ + function ListSslCertificatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSslCertificatesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + ListSslCertificatesRequest.prototype.filter = null; + + /** + * ListSslCertificatesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + ListSslCertificatesRequest.prototype.maxResults = null; + + /** + * ListSslCertificatesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + ListSslCertificatesRequest.prototype.orderBy = null; + + /** + * ListSslCertificatesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + ListSslCertificatesRequest.prototype.pageToken = null; + + /** + * ListSslCertificatesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + ListSslCertificatesRequest.prototype.project = ""; + + /** + * ListSslCertificatesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + ListSslCertificatesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListSslCertificatesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListSslCertificatesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslCertificatesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListSslCertificatesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslCertificatesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListSslCertificatesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslCertificatesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListSslCertificatesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslCertificatesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + */ + Object.defineProperty(ListSslCertificatesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListSslCertificatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IListSslCertificatesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListSslCertificatesRequest} ListSslCertificatesRequest instance + */ + ListSslCertificatesRequest.create = function create(properties) { + return new ListSslCertificatesRequest(properties); + }; + + /** + * Encodes the specified ListSslCertificatesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSslCertificatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IListSslCertificatesRequest} message ListSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSslCertificatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListSslCertificatesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSslCertificatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.IListSslCertificatesRequest} message ListSslCertificatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSslCertificatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSslCertificatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListSslCertificatesRequest} ListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSslCertificatesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListSslCertificatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSslCertificatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListSslCertificatesRequest} ListSslCertificatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSslCertificatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSslCertificatesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSslCertificatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListSslCertificatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListSslCertificatesRequest} ListSslCertificatesRequest + */ + ListSslCertificatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListSslCertificatesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListSslCertificatesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListSslCertificatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @static + * @param {google.cloud.compute.v1.ListSslCertificatesRequest} message ListSslCertificatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSslCertificatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListSslCertificatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListSslCertificatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSslCertificatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSslCertificatesRequest; + })(); + + v1.DeleteSslPolicyRequest = (function() { + + /** + * Properties of a DeleteSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteSslPolicyRequest + * @property {string|null} [project] DeleteSslPolicyRequest project + * @property {string|null} [requestId] DeleteSslPolicyRequest requestId + * @property {string|null} [sslPolicy] DeleteSslPolicyRequest sslPolicy + */ + + /** + * Constructs a new DeleteSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteSslPolicyRequest. + * @implements IDeleteSslPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteSslPolicyRequest=} [properties] Properties to set + */ + function DeleteSslPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSslPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @instance + */ + DeleteSslPolicyRequest.prototype.project = ""; + + /** + * DeleteSslPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @instance + */ + DeleteSslPolicyRequest.prototype.requestId = null; + + /** + * DeleteSslPolicyRequest sslPolicy. + * @member {string} sslPolicy + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @instance + */ + DeleteSslPolicyRequest.prototype.sslPolicy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteSslPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @instance + */ + Object.defineProperty(DeleteSslPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteSslPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSslPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteSslPolicyRequest} DeleteSslPolicyRequest instance + */ + DeleteSslPolicyRequest.create = function create(properties) { + return new DeleteSslPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSslPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSslPolicyRequest} message DeleteSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSslPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.sslPolicy != null && Object.hasOwnProperty.call(message, "sslPolicy")) + writer.uint32(/* id 295190213, wireType 2 =*/2361521706).string(message.sslPolicy); + return writer; + }; + + /** + * Encodes the specified DeleteSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSslPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSslPolicyRequest} message DeleteSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSslPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSslPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteSslPolicyRequest} DeleteSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSslPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteSslPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 295190213: + message.sslPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSslPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteSslPolicyRequest} DeleteSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSslPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSslPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSslPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) + if (!$util.isString(message.sslPolicy)) + return "sslPolicy: string expected"; + return null; + }; + + /** + * Creates a DeleteSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteSslPolicyRequest} DeleteSslPolicyRequest + */ + DeleteSslPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteSslPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteSslPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslPolicy != null) + message.sslPolicy = String(object.sslPolicy); + return message; + }; + + /** + * Creates a plain object from a DeleteSslPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.DeleteSslPolicyRequest} message DeleteSslPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSslPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.sslPolicy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) + object.sslPolicy = message.sslPolicy; + return object; + }; + + /** + * Converts this DeleteSslPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteSslPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSslPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSslPolicyRequest; + })(); + + v1.GetSslPolicyRequest = (function() { + + /** + * Properties of a GetSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetSslPolicyRequest + * @property {string|null} [project] GetSslPolicyRequest project + * @property {string|null} [sslPolicy] GetSslPolicyRequest sslPolicy + */ + + /** + * Constructs a new GetSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetSslPolicyRequest. + * @implements IGetSslPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetSslPolicyRequest=} [properties] Properties to set + */ + function GetSslPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSslPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @instance + */ + GetSslPolicyRequest.prototype.project = ""; + + /** + * GetSslPolicyRequest sslPolicy. + * @member {string} sslPolicy + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @instance + */ + GetSslPolicyRequest.prototype.sslPolicy = ""; + + /** + * Creates a new GetSslPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetSslPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetSslPolicyRequest} GetSslPolicyRequest instance + */ + GetSslPolicyRequest.create = function create(properties) { + return new GetSslPolicyRequest(properties); + }; + + /** + * Encodes the specified GetSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSslPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetSslPolicyRequest} message GetSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSslPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.sslPolicy != null && Object.hasOwnProperty.call(message, "sslPolicy")) + writer.uint32(/* id 295190213, wireType 2 =*/2361521706).string(message.sslPolicy); + return writer; + }; + + /** + * Encodes the specified GetSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSslPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IGetSslPolicyRequest} message GetSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSslPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSslPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetSslPolicyRequest} GetSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSslPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetSslPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 295190213: + message.sslPolicy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSslPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetSslPolicyRequest} GetSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSslPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSslPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSslPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) + if (!$util.isString(message.sslPolicy)) + return "sslPolicy: string expected"; + return null; + }; + + /** + * Creates a GetSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetSslPolicyRequest} GetSslPolicyRequest + */ + GetSslPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetSslPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetSslPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.sslPolicy != null) + message.sslPolicy = String(object.sslPolicy); + return message; + }; + + /** + * Creates a plain object from a GetSslPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.GetSslPolicyRequest} message GetSslPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSslPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.sslPolicy = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) + object.sslPolicy = message.sslPolicy; + return object; + }; + + /** + * Converts this GetSslPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetSslPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetSslPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSslPolicyRequest; + })(); + + v1.InsertSslPolicyRequest = (function() { + + /** + * Properties of an InsertSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertSslPolicyRequest + * @property {string|null} [project] InsertSslPolicyRequest project + * @property {string|null} [requestId] InsertSslPolicyRequest requestId + * @property {google.cloud.compute.v1.ISslPolicy|null} [sslPolicyResource] InsertSslPolicyRequest sslPolicyResource + */ + + /** + * Constructs a new InsertSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertSslPolicyRequest. + * @implements IInsertSslPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertSslPolicyRequest=} [properties] Properties to set + */ + function InsertSslPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertSslPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @instance + */ + InsertSslPolicyRequest.prototype.project = ""; + + /** + * InsertSslPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @instance + */ + InsertSslPolicyRequest.prototype.requestId = null; + + /** + * InsertSslPolicyRequest sslPolicyResource. + * @member {google.cloud.compute.v1.ISslPolicy|null|undefined} sslPolicyResource + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @instance + */ + InsertSslPolicyRequest.prototype.sslPolicyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertSslPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @instance + */ + Object.defineProperty(InsertSslPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertSslPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertSslPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertSslPolicyRequest} InsertSslPolicyRequest instance + */ + InsertSslPolicyRequest.create = function create(properties) { + return new InsertSslPolicyRequest(properties); + }; + + /** + * Encodes the specified InsertSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSslPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertSslPolicyRequest} message InsertSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSslPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.sslPolicyResource != null && Object.hasOwnProperty.call(message, "sslPolicyResource")) + $root.google.cloud.compute.v1.SslPolicy.encode(message.sslPolicyResource, writer.uint32(/* id 274891848, wireType 2 =*/2199134786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSslPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IInsertSslPolicyRequest} message InsertSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSslPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertSslPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertSslPolicyRequest} InsertSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSslPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertSslPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 274891848: + message.sslPolicyResource = $root.google.cloud.compute.v1.SslPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertSslPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertSslPolicyRequest} InsertSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSslPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertSslPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertSslPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslPolicyResource != null && message.hasOwnProperty("sslPolicyResource")) { + var error = $root.google.cloud.compute.v1.SslPolicy.verify(message.sslPolicyResource); + if (error) + return "sslPolicyResource." + error; + } + return null; + }; + + /** + * Creates an InsertSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertSslPolicyRequest} InsertSslPolicyRequest + */ + InsertSslPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertSslPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertSslPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslPolicyResource != null) { + if (typeof object.sslPolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertSslPolicyRequest.sslPolicyResource: object expected"); + message.sslPolicyResource = $root.google.cloud.compute.v1.SslPolicy.fromObject(object.sslPolicyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertSslPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.InsertSslPolicyRequest} message InsertSslPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertSslPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.sslPolicyResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.sslPolicyResource != null && message.hasOwnProperty("sslPolicyResource")) + object.sslPolicyResource = $root.google.cloud.compute.v1.SslPolicy.toObject(message.sslPolicyResource, options); + return object; + }; + + /** + * Converts this InsertSslPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertSslPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertSslPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertSslPolicyRequest; + })(); + + v1.ListSslPoliciesRequest = (function() { + + /** + * Properties of a ListSslPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListSslPoliciesRequest + * @property {string|null} [filter] ListSslPoliciesRequest filter + * @property {number|null} [maxResults] ListSslPoliciesRequest maxResults + * @property {string|null} [orderBy] ListSslPoliciesRequest orderBy + * @property {string|null} [pageToken] ListSslPoliciesRequest pageToken + * @property {string|null} [project] ListSslPoliciesRequest project + * @property {boolean|null} [returnPartialSuccess] ListSslPoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListSslPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListSslPoliciesRequest. + * @implements IListSslPoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IListSslPoliciesRequest=} [properties] Properties to set + */ + function ListSslPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSslPoliciesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + ListSslPoliciesRequest.prototype.filter = null; + + /** + * ListSslPoliciesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + ListSslPoliciesRequest.prototype.maxResults = null; + + /** + * ListSslPoliciesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + ListSslPoliciesRequest.prototype.orderBy = null; + + /** + * ListSslPoliciesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + ListSslPoliciesRequest.prototype.pageToken = null; + + /** + * ListSslPoliciesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + ListSslPoliciesRequest.prototype.project = ""; + + /** + * ListSslPoliciesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + ListSslPoliciesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListSslPoliciesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListSslPoliciesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslPoliciesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListSslPoliciesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslPoliciesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListSslPoliciesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslPoliciesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListSslPoliciesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSslPoliciesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListSslPoliciesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListSslPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListSslPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListSslPoliciesRequest} ListSslPoliciesRequest instance + */ + ListSslPoliciesRequest.create = function create(properties) { + return new ListSslPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListSslPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSslPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListSslPoliciesRequest} message ListSslPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSslPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListSslPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSslPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListSslPoliciesRequest} message ListSslPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSslPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSslPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListSslPoliciesRequest} ListSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSslPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListSslPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSslPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListSslPoliciesRequest} ListSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSslPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSslPoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSslPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListSslPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListSslPoliciesRequest} ListSslPoliciesRequest + */ + ListSslPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListSslPoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListSslPoliciesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListSslPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.ListSslPoliciesRequest} message ListSslPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSslPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListSslPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListSslPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSslPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSslPoliciesRequest; + })(); + + v1.ListAvailableFeaturesSslPoliciesRequest = (function() { + + /** + * Properties of a ListAvailableFeaturesSslPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListAvailableFeaturesSslPoliciesRequest + * @property {string|null} [filter] ListAvailableFeaturesSslPoliciesRequest filter + * @property {number|null} [maxResults] ListAvailableFeaturesSslPoliciesRequest maxResults + * @property {string|null} [orderBy] ListAvailableFeaturesSslPoliciesRequest orderBy + * @property {string|null} [pageToken] ListAvailableFeaturesSslPoliciesRequest pageToken + * @property {string|null} [project] ListAvailableFeaturesSslPoliciesRequest project + * @property {boolean|null} [returnPartialSuccess] ListAvailableFeaturesSslPoliciesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListAvailableFeaturesSslPoliciesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListAvailableFeaturesSslPoliciesRequest. + * @implements IListAvailableFeaturesSslPoliciesRequest + * @constructor + * @param {google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest=} [properties] Properties to set + */ + function ListAvailableFeaturesSslPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAvailableFeaturesSslPoliciesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + ListAvailableFeaturesSslPoliciesRequest.prototype.filter = null; + + /** + * ListAvailableFeaturesSslPoliciesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + ListAvailableFeaturesSslPoliciesRequest.prototype.maxResults = null; + + /** + * ListAvailableFeaturesSslPoliciesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + ListAvailableFeaturesSslPoliciesRequest.prototype.orderBy = null; + + /** + * ListAvailableFeaturesSslPoliciesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + ListAvailableFeaturesSslPoliciesRequest.prototype.pageToken = null; + + /** + * ListAvailableFeaturesSslPoliciesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + ListAvailableFeaturesSslPoliciesRequest.prototype.project = ""; + + /** + * ListAvailableFeaturesSslPoliciesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + ListAvailableFeaturesSslPoliciesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListAvailableFeaturesSslPoliciesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListAvailableFeaturesSslPoliciesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAvailableFeaturesSslPoliciesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListAvailableFeaturesSslPoliciesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAvailableFeaturesSslPoliciesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListAvailableFeaturesSslPoliciesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAvailableFeaturesSslPoliciesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListAvailableFeaturesSslPoliciesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListAvailableFeaturesSslPoliciesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + */ + Object.defineProperty(ListAvailableFeaturesSslPoliciesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListAvailableFeaturesSslPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest} ListAvailableFeaturesSslPoliciesRequest instance + */ + ListAvailableFeaturesSslPoliciesRequest.create = function create(properties) { + return new ListAvailableFeaturesSslPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListAvailableFeaturesSslPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest} message ListAvailableFeaturesSslPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableFeaturesSslPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListAvailableFeaturesSslPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest} message ListAvailableFeaturesSslPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableFeaturesSslPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAvailableFeaturesSslPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest} ListAvailableFeaturesSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableFeaturesSslPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAvailableFeaturesSslPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest} ListAvailableFeaturesSslPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableFeaturesSslPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAvailableFeaturesSslPoliciesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAvailableFeaturesSslPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListAvailableFeaturesSslPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest} ListAvailableFeaturesSslPoliciesRequest + */ + ListAvailableFeaturesSslPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListAvailableFeaturesSslPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @static + * @param {google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest} message ListAvailableFeaturesSslPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAvailableFeaturesSslPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListAvailableFeaturesSslPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAvailableFeaturesSslPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAvailableFeaturesSslPoliciesRequest; + })(); + + v1.PatchSslPolicyRequest = (function() { + + /** + * Properties of a PatchSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchSslPolicyRequest + * @property {string|null} [project] PatchSslPolicyRequest project + * @property {string|null} [requestId] PatchSslPolicyRequest requestId + * @property {string|null} [sslPolicy] PatchSslPolicyRequest sslPolicy + * @property {google.cloud.compute.v1.ISslPolicy|null} [sslPolicyResource] PatchSslPolicyRequest sslPolicyResource + */ + + /** + * Constructs a new PatchSslPolicyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchSslPolicyRequest. + * @implements IPatchSslPolicyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchSslPolicyRequest=} [properties] Properties to set + */ + function PatchSslPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchSslPolicyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @instance + */ + PatchSslPolicyRequest.prototype.project = ""; + + /** + * PatchSslPolicyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @instance + */ + PatchSslPolicyRequest.prototype.requestId = null; + + /** + * PatchSslPolicyRequest sslPolicy. + * @member {string} sslPolicy + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @instance + */ + PatchSslPolicyRequest.prototype.sslPolicy = ""; + + /** + * PatchSslPolicyRequest sslPolicyResource. + * @member {google.cloud.compute.v1.ISslPolicy|null|undefined} sslPolicyResource + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @instance + */ + PatchSslPolicyRequest.prototype.sslPolicyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchSslPolicyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @instance + */ + Object.defineProperty(PatchSslPolicyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchSslPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchSslPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchSslPolicyRequest} PatchSslPolicyRequest instance + */ + PatchSslPolicyRequest.create = function create(properties) { + return new PatchSslPolicyRequest(properties); + }; + + /** + * Encodes the specified PatchSslPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchSslPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchSslPolicyRequest} message PatchSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchSslPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.sslPolicyResource != null && Object.hasOwnProperty.call(message, "sslPolicyResource")) + $root.google.cloud.compute.v1.SslPolicy.encode(message.sslPolicyResource, writer.uint32(/* id 274891848, wireType 2 =*/2199134786).fork()).ldelim(); + if (message.sslPolicy != null && Object.hasOwnProperty.call(message, "sslPolicy")) + writer.uint32(/* id 295190213, wireType 2 =*/2361521706).string(message.sslPolicy); + return writer; + }; + + /** + * Encodes the specified PatchSslPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchSslPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.IPatchSslPolicyRequest} message PatchSslPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchSslPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchSslPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchSslPolicyRequest} PatchSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchSslPolicyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchSslPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 295190213: + message.sslPolicy = reader.string(); + break; + case 274891848: + message.sslPolicyResource = $root.google.cloud.compute.v1.SslPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchSslPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchSslPolicyRequest} PatchSslPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchSslPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchSslPolicyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchSslPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) + if (!$util.isString(message.sslPolicy)) + return "sslPolicy: string expected"; + if (message.sslPolicyResource != null && message.hasOwnProperty("sslPolicyResource")) { + var error = $root.google.cloud.compute.v1.SslPolicy.verify(message.sslPolicyResource); + if (error) + return "sslPolicyResource." + error; + } + return null; + }; + + /** + * Creates a PatchSslPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchSslPolicyRequest} PatchSslPolicyRequest + */ + PatchSslPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchSslPolicyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchSslPolicyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslPolicy != null) + message.sslPolicy = String(object.sslPolicy); + if (object.sslPolicyResource != null) { + if (typeof object.sslPolicyResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchSslPolicyRequest.sslPolicyResource: object expected"); + message.sslPolicyResource = $root.google.cloud.compute.v1.SslPolicy.fromObject(object.sslPolicyResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchSslPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @static + * @param {google.cloud.compute.v1.PatchSslPolicyRequest} message PatchSslPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchSslPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.sslPolicyResource = null; + object.sslPolicy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.sslPolicyResource != null && message.hasOwnProperty("sslPolicyResource")) + object.sslPolicyResource = $root.google.cloud.compute.v1.SslPolicy.toObject(message.sslPolicyResource, options); + if (message.sslPolicy != null && message.hasOwnProperty("sslPolicy")) + object.sslPolicy = message.sslPolicy; + return object; + }; + + /** + * Converts this PatchSslPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchSslPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchSslPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchSslPolicyRequest; + })(); + + v1.AggregatedListSubnetworksRequest = (function() { + + /** + * Properties of an AggregatedListSubnetworksRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListSubnetworksRequest + * @property {string|null} [filter] AggregatedListSubnetworksRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListSubnetworksRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListSubnetworksRequest maxResults + * @property {string|null} [orderBy] AggregatedListSubnetworksRequest orderBy + * @property {string|null} [pageToken] AggregatedListSubnetworksRequest pageToken + * @property {string|null} [project] AggregatedListSubnetworksRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListSubnetworksRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListSubnetworksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListSubnetworksRequest. + * @implements IAggregatedListSubnetworksRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListSubnetworksRequest=} [properties] Properties to set + */ + function AggregatedListSubnetworksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListSubnetworksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + AggregatedListSubnetworksRequest.prototype.filter = null; + + /** + * AggregatedListSubnetworksRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + AggregatedListSubnetworksRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListSubnetworksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + AggregatedListSubnetworksRequest.prototype.maxResults = null; + + /** + * AggregatedListSubnetworksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + AggregatedListSubnetworksRequest.prototype.orderBy = null; + + /** + * AggregatedListSubnetworksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + AggregatedListSubnetworksRequest.prototype.pageToken = null; + + /** + * AggregatedListSubnetworksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + AggregatedListSubnetworksRequest.prototype.project = ""; + + /** + * AggregatedListSubnetworksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + AggregatedListSubnetworksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListSubnetworksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + Object.defineProperty(AggregatedListSubnetworksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSubnetworksRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + Object.defineProperty(AggregatedListSubnetworksRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSubnetworksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + Object.defineProperty(AggregatedListSubnetworksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSubnetworksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + Object.defineProperty(AggregatedListSubnetworksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSubnetworksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + Object.defineProperty(AggregatedListSubnetworksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListSubnetworksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + */ + Object.defineProperty(AggregatedListSubnetworksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListSubnetworksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListSubnetworksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListSubnetworksRequest} AggregatedListSubnetworksRequest instance + */ + AggregatedListSubnetworksRequest.create = function create(properties) { + return new AggregatedListSubnetworksRequest(properties); + }; + + /** + * Encodes the specified AggregatedListSubnetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSubnetworksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListSubnetworksRequest} message AggregatedListSubnetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListSubnetworksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListSubnetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListSubnetworksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListSubnetworksRequest} message AggregatedListSubnetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListSubnetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListSubnetworksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListSubnetworksRequest} AggregatedListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListSubnetworksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListSubnetworksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListSubnetworksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListSubnetworksRequest} AggregatedListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListSubnetworksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListSubnetworksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListSubnetworksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListSubnetworksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListSubnetworksRequest} AggregatedListSubnetworksRequest + */ + AggregatedListSubnetworksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListSubnetworksRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListSubnetworksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListSubnetworksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListSubnetworksRequest} message AggregatedListSubnetworksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListSubnetworksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListSubnetworksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListSubnetworksRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListSubnetworksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListSubnetworksRequest; + })(); + + v1.DeleteSubnetworkRequest = (function() { + + /** + * Properties of a DeleteSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteSubnetworkRequest + * @property {string|null} [project] DeleteSubnetworkRequest project + * @property {string|null} [region] DeleteSubnetworkRequest region + * @property {string|null} [requestId] DeleteSubnetworkRequest requestId + * @property {string|null} [subnetwork] DeleteSubnetworkRequest subnetwork + */ + + /** + * Constructs a new DeleteSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteSubnetworkRequest. + * @implements IDeleteSubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteSubnetworkRequest=} [properties] Properties to set + */ + function DeleteSubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @instance + */ + DeleteSubnetworkRequest.prototype.project = ""; + + /** + * DeleteSubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @instance + */ + DeleteSubnetworkRequest.prototype.region = ""; + + /** + * DeleteSubnetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @instance + */ + DeleteSubnetworkRequest.prototype.requestId = null; + + /** + * DeleteSubnetworkRequest subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @instance + */ + DeleteSubnetworkRequest.prototype.subnetwork = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteSubnetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @instance + */ + Object.defineProperty(DeleteSubnetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteSubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteSubnetworkRequest} DeleteSubnetworkRequest instance + */ + DeleteSubnetworkRequest.create = function create(properties) { + return new DeleteSubnetworkRequest(properties); + }; + + /** + * Encodes the specified DeleteSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteSubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSubnetworkRequest} message DeleteSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + return writer; + }; + + /** + * Encodes the specified DeleteSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteSubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IDeleteSubnetworkRequest} message DeleteSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteSubnetworkRequest} DeleteSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteSubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteSubnetworkRequest} DeleteSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + return null; + }; + + /** + * Creates a DeleteSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteSubnetworkRequest} DeleteSubnetworkRequest + */ + DeleteSubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteSubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteSubnetworkRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + return message; + }; + + /** + * Creates a plain object from a DeleteSubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.DeleteSubnetworkRequest} message DeleteSubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.subnetwork = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + return object; + }; + + /** + * Converts this DeleteSubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteSubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteSubnetworkRequest; + })(); + + v1.ExpandIpCidrRangeSubnetworkRequest = (function() { + + /** + * Properties of an ExpandIpCidrRangeSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IExpandIpCidrRangeSubnetworkRequest + * @property {string|null} [project] ExpandIpCidrRangeSubnetworkRequest project + * @property {string|null} [region] ExpandIpCidrRangeSubnetworkRequest region + * @property {string|null} [requestId] ExpandIpCidrRangeSubnetworkRequest requestId + * @property {string|null} [subnetwork] ExpandIpCidrRangeSubnetworkRequest subnetwork + * @property {google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest|null} [subnetworksExpandIpCidrRangeRequestResource] ExpandIpCidrRangeSubnetworkRequest subnetworksExpandIpCidrRangeRequestResource + */ + + /** + * Constructs a new ExpandIpCidrRangeSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ExpandIpCidrRangeSubnetworkRequest. + * @implements IExpandIpCidrRangeSubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest=} [properties] Properties to set + */ + function ExpandIpCidrRangeSubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExpandIpCidrRangeSubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @instance + */ + ExpandIpCidrRangeSubnetworkRequest.prototype.project = ""; + + /** + * ExpandIpCidrRangeSubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @instance + */ + ExpandIpCidrRangeSubnetworkRequest.prototype.region = ""; + + /** + * ExpandIpCidrRangeSubnetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @instance + */ + ExpandIpCidrRangeSubnetworkRequest.prototype.requestId = null; + + /** + * ExpandIpCidrRangeSubnetworkRequest subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @instance + */ + ExpandIpCidrRangeSubnetworkRequest.prototype.subnetwork = ""; + + /** + * ExpandIpCidrRangeSubnetworkRequest subnetworksExpandIpCidrRangeRequestResource. + * @member {google.cloud.compute.v1.ISubnetworksExpandIpCidrRangeRequest|null|undefined} subnetworksExpandIpCidrRangeRequestResource + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @instance + */ + ExpandIpCidrRangeSubnetworkRequest.prototype.subnetworksExpandIpCidrRangeRequestResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExpandIpCidrRangeSubnetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @instance + */ + Object.defineProperty(ExpandIpCidrRangeSubnetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExpandIpCidrRangeSubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest} ExpandIpCidrRangeSubnetworkRequest instance + */ + ExpandIpCidrRangeSubnetworkRequest.create = function create(properties) { + return new ExpandIpCidrRangeSubnetworkRequest(properties); + }; + + /** + * Encodes the specified ExpandIpCidrRangeSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest} message ExpandIpCidrRangeSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpandIpCidrRangeSubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + if (message.subnetworksExpandIpCidrRangeRequestResource != null && Object.hasOwnProperty.call(message, "subnetworksExpandIpCidrRangeRequestResource")) + $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.encode(message.subnetworksExpandIpCidrRangeRequestResource, writer.uint32(/* id 477014110, wireType 2 =*/3816112882).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExpandIpCidrRangeSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest} message ExpandIpCidrRangeSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExpandIpCidrRangeSubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExpandIpCidrRangeSubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest} ExpandIpCidrRangeSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpandIpCidrRangeSubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + case 477014110: + message.subnetworksExpandIpCidrRangeRequestResource = $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExpandIpCidrRangeSubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest} ExpandIpCidrRangeSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExpandIpCidrRangeSubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExpandIpCidrRangeSubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExpandIpCidrRangeSubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.subnetworksExpandIpCidrRangeRequestResource != null && message.hasOwnProperty("subnetworksExpandIpCidrRangeRequestResource")) { + var error = $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.verify(message.subnetworksExpandIpCidrRangeRequestResource); + if (error) + return "subnetworksExpandIpCidrRangeRequestResource." + error; + } + return null; + }; + + /** + * Creates an ExpandIpCidrRangeSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest} ExpandIpCidrRangeSubnetworkRequest + */ + ExpandIpCidrRangeSubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.subnetworksExpandIpCidrRangeRequestResource != null) { + if (typeof object.subnetworksExpandIpCidrRangeRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest.subnetworksExpandIpCidrRangeRequestResource: object expected"); + message.subnetworksExpandIpCidrRangeRequestResource = $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.fromObject(object.subnetworksExpandIpCidrRangeRequestResource); + } + return message; + }; + + /** + * Creates a plain object from an ExpandIpCidrRangeSubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest} message ExpandIpCidrRangeSubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExpandIpCidrRangeSubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.subnetwork = ""; + object.subnetworksExpandIpCidrRangeRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.subnetworksExpandIpCidrRangeRequestResource != null && message.hasOwnProperty("subnetworksExpandIpCidrRangeRequestResource")) + object.subnetworksExpandIpCidrRangeRequestResource = $root.google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest.toObject(message.subnetworksExpandIpCidrRangeRequestResource, options); + return object; + }; + + /** + * Converts this ExpandIpCidrRangeSubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + ExpandIpCidrRangeSubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExpandIpCidrRangeSubnetworkRequest; + })(); + + v1.GetSubnetworkRequest = (function() { + + /** + * Properties of a GetSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetSubnetworkRequest + * @property {string|null} [project] GetSubnetworkRequest project + * @property {string|null} [region] GetSubnetworkRequest region + * @property {string|null} [subnetwork] GetSubnetworkRequest subnetwork + */ + + /** + * Constructs a new GetSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetSubnetworkRequest. + * @implements IGetSubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IGetSubnetworkRequest=} [properties] Properties to set + */ + function GetSubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @instance + */ + GetSubnetworkRequest.prototype.project = ""; + + /** + * GetSubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @instance + */ + GetSubnetworkRequest.prototype.region = ""; + + /** + * GetSubnetworkRequest subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @instance + */ + GetSubnetworkRequest.prototype.subnetwork = ""; + + /** + * Creates a new GetSubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetSubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetSubnetworkRequest} GetSubnetworkRequest instance + */ + GetSubnetworkRequest.create = function create(properties) { + return new GetSubnetworkRequest(properties); + }; + + /** + * Encodes the specified GetSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetSubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetSubnetworkRequest} message GetSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + return writer; + }; + + /** + * Encodes the specified GetSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetSubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetSubnetworkRequest} message GetSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetSubnetworkRequest} GetSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetSubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetSubnetworkRequest} GetSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + return null; + }; + + /** + * Creates a GetSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetSubnetworkRequest} GetSubnetworkRequest + */ + GetSubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetSubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetSubnetworkRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + return message; + }; + + /** + * Creates a plain object from a GetSubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.GetSubnetworkRequest} message GetSubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.subnetwork = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + return object; + }; + + /** + * Converts this GetSubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetSubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + GetSubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetSubnetworkRequest; + })(); + + v1.GetIamPolicySubnetworkRequest = (function() { + + /** + * Properties of a GetIamPolicySubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetIamPolicySubnetworkRequest + * @property {number|null} [optionsRequestedPolicyVersion] GetIamPolicySubnetworkRequest optionsRequestedPolicyVersion + * @property {string|null} [project] GetIamPolicySubnetworkRequest project + * @property {string|null} [region] GetIamPolicySubnetworkRequest region + * @property {string|null} [resource] GetIamPolicySubnetworkRequest resource + */ + + /** + * Constructs a new GetIamPolicySubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetIamPolicySubnetworkRequest. + * @implements IGetIamPolicySubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IGetIamPolicySubnetworkRequest=} [properties] Properties to set + */ + function GetIamPolicySubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIamPolicySubnetworkRequest optionsRequestedPolicyVersion. + * @member {number|null|undefined} optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @instance + */ + GetIamPolicySubnetworkRequest.prototype.optionsRequestedPolicyVersion = null; + + /** + * GetIamPolicySubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @instance + */ + GetIamPolicySubnetworkRequest.prototype.project = ""; + + /** + * GetIamPolicySubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @instance + */ + GetIamPolicySubnetworkRequest.prototype.region = ""; + + /** + * GetIamPolicySubnetworkRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @instance + */ + GetIamPolicySubnetworkRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIamPolicySubnetworkRequest _optionsRequestedPolicyVersion. + * @member {"optionsRequestedPolicyVersion"|undefined} _optionsRequestedPolicyVersion + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @instance + */ + Object.defineProperty(GetIamPolicySubnetworkRequest.prototype, "_optionsRequestedPolicyVersion", { + get: $util.oneOfGetter($oneOfFields = ["optionsRequestedPolicyVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIamPolicySubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicySubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetIamPolicySubnetworkRequest} GetIamPolicySubnetworkRequest instance + */ + GetIamPolicySubnetworkRequest.create = function create(properties) { + return new GetIamPolicySubnetworkRequest(properties); + }; + + /** + * Encodes the specified GetIamPolicySubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicySubnetworkRequest} message GetIamPolicySubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicySubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.optionsRequestedPolicyVersion != null && Object.hasOwnProperty.call(message, "optionsRequestedPolicyVersion")) + writer.uint32(/* id 499220029, wireType 0 =*/3993760232).int32(message.optionsRequestedPolicyVersion); + return writer; + }; + + /** + * Encodes the specified GetIamPolicySubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetIamPolicySubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IGetIamPolicySubnetworkRequest} message GetIamPolicySubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIamPolicySubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIamPolicySubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetIamPolicySubnetworkRequest} GetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicySubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetIamPolicySubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 499220029: + message.optionsRequestedPolicyVersion = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIamPolicySubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetIamPolicySubnetworkRequest} GetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIamPolicySubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIamPolicySubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIamPolicySubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + properties._optionsRequestedPolicyVersion = 1; + if (!$util.isInteger(message.optionsRequestedPolicyVersion)) + return "optionsRequestedPolicyVersion: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a GetIamPolicySubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetIamPolicySubnetworkRequest} GetIamPolicySubnetworkRequest + */ + GetIamPolicySubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetIamPolicySubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetIamPolicySubnetworkRequest(); + if (object.optionsRequestedPolicyVersion != null) + message.optionsRequestedPolicyVersion = object.optionsRequestedPolicyVersion | 0; + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a GetIamPolicySubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.GetIamPolicySubnetworkRequest} message GetIamPolicySubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIamPolicySubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.optionsRequestedPolicyVersion != null && message.hasOwnProperty("optionsRequestedPolicyVersion")) { + object.optionsRequestedPolicyVersion = message.optionsRequestedPolicyVersion; + if (options.oneofs) + object._optionsRequestedPolicyVersion = "optionsRequestedPolicyVersion"; + } + return object; + }; + + /** + * Converts this GetIamPolicySubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetIamPolicySubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + GetIamPolicySubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIamPolicySubnetworkRequest; + })(); + + v1.InsertSubnetworkRequest = (function() { + + /** + * Properties of an InsertSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertSubnetworkRequest + * @property {string|null} [project] InsertSubnetworkRequest project + * @property {string|null} [region] InsertSubnetworkRequest region + * @property {string|null} [requestId] InsertSubnetworkRequest requestId + * @property {google.cloud.compute.v1.ISubnetwork|null} [subnetworkResource] InsertSubnetworkRequest subnetworkResource + */ + + /** + * Constructs a new InsertSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertSubnetworkRequest. + * @implements IInsertSubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertSubnetworkRequest=} [properties] Properties to set + */ + function InsertSubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertSubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @instance + */ + InsertSubnetworkRequest.prototype.project = ""; + + /** + * InsertSubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @instance + */ + InsertSubnetworkRequest.prototype.region = ""; + + /** + * InsertSubnetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @instance + */ + InsertSubnetworkRequest.prototype.requestId = null; + + /** + * InsertSubnetworkRequest subnetworkResource. + * @member {google.cloud.compute.v1.ISubnetwork|null|undefined} subnetworkResource + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @instance + */ + InsertSubnetworkRequest.prototype.subnetworkResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertSubnetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @instance + */ + Object.defineProperty(InsertSubnetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertSubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IInsertSubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertSubnetworkRequest} InsertSubnetworkRequest instance + */ + InsertSubnetworkRequest.create = function create(properties) { + return new InsertSubnetworkRequest(properties); + }; + + /** + * Encodes the specified InsertSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertSubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IInsertSubnetworkRequest} message InsertSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.subnetworkResource != null && Object.hasOwnProperty.call(message, "subnetworkResource")) + $root.google.cloud.compute.v1.Subnetwork.encode(message.subnetworkResource, writer.uint32(/* id 42233151, wireType 2 =*/337865210).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertSubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IInsertSubnetworkRequest} message InsertSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertSubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertSubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertSubnetworkRequest} InsertSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertSubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 42233151: + message.subnetworkResource = $root.google.cloud.compute.v1.Subnetwork.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertSubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertSubnetworkRequest} InsertSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertSubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertSubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertSubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.subnetworkResource != null && message.hasOwnProperty("subnetworkResource")) { + var error = $root.google.cloud.compute.v1.Subnetwork.verify(message.subnetworkResource); + if (error) + return "subnetworkResource." + error; + } + return null; + }; + + /** + * Creates an InsertSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertSubnetworkRequest} InsertSubnetworkRequest + */ + InsertSubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertSubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertSubnetworkRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.subnetworkResource != null) { + if (typeof object.subnetworkResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertSubnetworkRequest.subnetworkResource: object expected"); + message.subnetworkResource = $root.google.cloud.compute.v1.Subnetwork.fromObject(object.subnetworkResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertSubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.InsertSubnetworkRequest} message InsertSubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertSubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subnetworkResource = null; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.subnetworkResource != null && message.hasOwnProperty("subnetworkResource")) + object.subnetworkResource = $root.google.cloud.compute.v1.Subnetwork.toObject(message.subnetworkResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertSubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertSubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + InsertSubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertSubnetworkRequest; + })(); + + v1.ListSubnetworksRequest = (function() { + + /** + * Properties of a ListSubnetworksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListSubnetworksRequest + * @property {string|null} [filter] ListSubnetworksRequest filter + * @property {number|null} [maxResults] ListSubnetworksRequest maxResults + * @property {string|null} [orderBy] ListSubnetworksRequest orderBy + * @property {string|null} [pageToken] ListSubnetworksRequest pageToken + * @property {string|null} [project] ListSubnetworksRequest project + * @property {string|null} [region] ListSubnetworksRequest region + * @property {boolean|null} [returnPartialSuccess] ListSubnetworksRequest returnPartialSuccess + */ + + /** + * Constructs a new ListSubnetworksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListSubnetworksRequest. + * @implements IListSubnetworksRequest + * @constructor + * @param {google.cloud.compute.v1.IListSubnetworksRequest=} [properties] Properties to set + */ + function ListSubnetworksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSubnetworksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + ListSubnetworksRequest.prototype.filter = null; + + /** + * ListSubnetworksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + ListSubnetworksRequest.prototype.maxResults = null; + + /** + * ListSubnetworksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + ListSubnetworksRequest.prototype.orderBy = null; + + /** + * ListSubnetworksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + ListSubnetworksRequest.prototype.pageToken = null; + + /** + * ListSubnetworksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + ListSubnetworksRequest.prototype.project = ""; + + /** + * ListSubnetworksRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + ListSubnetworksRequest.prototype.region = ""; + + /** + * ListSubnetworksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + ListSubnetworksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListSubnetworksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + Object.defineProperty(ListSubnetworksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSubnetworksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + Object.defineProperty(ListSubnetworksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSubnetworksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + Object.defineProperty(ListSubnetworksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSubnetworksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + Object.defineProperty(ListSubnetworksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListSubnetworksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + */ + Object.defineProperty(ListSubnetworksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListSubnetworksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IListSubnetworksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListSubnetworksRequest} ListSubnetworksRequest instance + */ + ListSubnetworksRequest.create = function create(properties) { + return new ListSubnetworksRequest(properties); + }; + + /** + * Encodes the specified ListSubnetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListSubnetworksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IListSubnetworksRequest} message ListSubnetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubnetworksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListSubnetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListSubnetworksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IListSubnetworksRequest} message ListSubnetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubnetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubnetworksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListSubnetworksRequest} ListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubnetworksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListSubnetworksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubnetworksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListSubnetworksRequest} ListSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubnetworksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubnetworksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubnetworksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListSubnetworksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListSubnetworksRequest} ListSubnetworksRequest + */ + ListSubnetworksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListSubnetworksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListSubnetworksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListSubnetworksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.ListSubnetworksRequest} message ListSubnetworksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubnetworksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListSubnetworksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListSubnetworksRequest + * @instance + * @returns {Object.} JSON object + */ + ListSubnetworksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSubnetworksRequest; + })(); + + v1.ListUsableSubnetworksRequest = (function() { + + /** + * Properties of a ListUsableSubnetworksRequest. + * @memberof google.cloud.compute.v1 + * @interface IListUsableSubnetworksRequest + * @property {string|null} [filter] ListUsableSubnetworksRequest filter + * @property {number|null} [maxResults] ListUsableSubnetworksRequest maxResults + * @property {string|null} [orderBy] ListUsableSubnetworksRequest orderBy + * @property {string|null} [pageToken] ListUsableSubnetworksRequest pageToken + * @property {string|null} [project] ListUsableSubnetworksRequest project + * @property {boolean|null} [returnPartialSuccess] ListUsableSubnetworksRequest returnPartialSuccess + */ + + /** + * Constructs a new ListUsableSubnetworksRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListUsableSubnetworksRequest. + * @implements IListUsableSubnetworksRequest + * @constructor + * @param {google.cloud.compute.v1.IListUsableSubnetworksRequest=} [properties] Properties to set + */ + function ListUsableSubnetworksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsableSubnetworksRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + ListUsableSubnetworksRequest.prototype.filter = null; + + /** + * ListUsableSubnetworksRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + ListUsableSubnetworksRequest.prototype.maxResults = null; + + /** + * ListUsableSubnetworksRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + ListUsableSubnetworksRequest.prototype.orderBy = null; + + /** + * ListUsableSubnetworksRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + ListUsableSubnetworksRequest.prototype.pageToken = null; + + /** + * ListUsableSubnetworksRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + ListUsableSubnetworksRequest.prototype.project = ""; + + /** + * ListUsableSubnetworksRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + ListUsableSubnetworksRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListUsableSubnetworksRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + Object.defineProperty(ListUsableSubnetworksRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUsableSubnetworksRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + Object.defineProperty(ListUsableSubnetworksRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUsableSubnetworksRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + Object.defineProperty(ListUsableSubnetworksRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUsableSubnetworksRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + Object.defineProperty(ListUsableSubnetworksRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUsableSubnetworksRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + */ + Object.defineProperty(ListUsableSubnetworksRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListUsableSubnetworksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IListUsableSubnetworksRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListUsableSubnetworksRequest} ListUsableSubnetworksRequest instance + */ + ListUsableSubnetworksRequest.create = function create(properties) { + return new ListUsableSubnetworksRequest(properties); + }; + + /** + * Encodes the specified ListUsableSubnetworksRequest message. Does not implicitly {@link google.cloud.compute.v1.ListUsableSubnetworksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IListUsableSubnetworksRequest} message ListUsableSubnetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableSubnetworksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListUsableSubnetworksRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListUsableSubnetworksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.IListUsableSubnetworksRequest} message ListUsableSubnetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableSubnetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsableSubnetworksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListUsableSubnetworksRequest} ListUsableSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableSubnetworksRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListUsableSubnetworksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsableSubnetworksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListUsableSubnetworksRequest} ListUsableSubnetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableSubnetworksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsableSubnetworksRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsableSubnetworksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListUsableSubnetworksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListUsableSubnetworksRequest} ListUsableSubnetworksRequest + */ + ListUsableSubnetworksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListUsableSubnetworksRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListUsableSubnetworksRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListUsableSubnetworksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @static + * @param {google.cloud.compute.v1.ListUsableSubnetworksRequest} message ListUsableSubnetworksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsableSubnetworksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListUsableSubnetworksRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListUsableSubnetworksRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsableSubnetworksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListUsableSubnetworksRequest; + })(); + + v1.PatchSubnetworkRequest = (function() { + + /** + * Properties of a PatchSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchSubnetworkRequest + * @property {number|null} [drainTimeoutSeconds] PatchSubnetworkRequest drainTimeoutSeconds + * @property {string|null} [project] PatchSubnetworkRequest project + * @property {string|null} [region] PatchSubnetworkRequest region + * @property {string|null} [requestId] PatchSubnetworkRequest requestId + * @property {string|null} [subnetwork] PatchSubnetworkRequest subnetwork + * @property {google.cloud.compute.v1.ISubnetwork|null} [subnetworkResource] PatchSubnetworkRequest subnetworkResource + */ + + /** + * Constructs a new PatchSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchSubnetworkRequest. + * @implements IPatchSubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchSubnetworkRequest=} [properties] Properties to set + */ + function PatchSubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchSubnetworkRequest drainTimeoutSeconds. + * @member {number|null|undefined} drainTimeoutSeconds + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + PatchSubnetworkRequest.prototype.drainTimeoutSeconds = null; + + /** + * PatchSubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + PatchSubnetworkRequest.prototype.project = ""; + + /** + * PatchSubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + PatchSubnetworkRequest.prototype.region = ""; + + /** + * PatchSubnetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + PatchSubnetworkRequest.prototype.requestId = null; + + /** + * PatchSubnetworkRequest subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + PatchSubnetworkRequest.prototype.subnetwork = ""; + + /** + * PatchSubnetworkRequest subnetworkResource. + * @member {google.cloud.compute.v1.ISubnetwork|null|undefined} subnetworkResource + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + PatchSubnetworkRequest.prototype.subnetworkResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchSubnetworkRequest _drainTimeoutSeconds. + * @member {"drainTimeoutSeconds"|undefined} _drainTimeoutSeconds + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + Object.defineProperty(PatchSubnetworkRequest.prototype, "_drainTimeoutSeconds", { + get: $util.oneOfGetter($oneOfFields = ["drainTimeoutSeconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PatchSubnetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + */ + Object.defineProperty(PatchSubnetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchSubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IPatchSubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchSubnetworkRequest} PatchSubnetworkRequest instance + */ + PatchSubnetworkRequest.create = function create(properties) { + return new PatchSubnetworkRequest(properties); + }; + + /** + * Encodes the specified PatchSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchSubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IPatchSubnetworkRequest} message PatchSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchSubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.subnetworkResource != null && Object.hasOwnProperty.call(message, "subnetworkResource")) + $root.google.cloud.compute.v1.Subnetwork.encode(message.subnetworkResource, writer.uint32(/* id 42233151, wireType 2 =*/337865210).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + if (message.drainTimeoutSeconds != null && Object.hasOwnProperty.call(message, "drainTimeoutSeconds")) + writer.uint32(/* id 357707098, wireType 0 =*/2861656784).int32(message.drainTimeoutSeconds); + return writer; + }; + + /** + * Encodes the specified PatchSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchSubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.IPatchSubnetworkRequest} message PatchSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchSubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchSubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchSubnetworkRequest} PatchSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchSubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchSubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 357707098: + message.drainTimeoutSeconds = reader.int32(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + case 42233151: + message.subnetworkResource = $root.google.cloud.compute.v1.Subnetwork.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchSubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchSubnetworkRequest} PatchSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchSubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchSubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchSubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.drainTimeoutSeconds != null && message.hasOwnProperty("drainTimeoutSeconds")) { + properties._drainTimeoutSeconds = 1; + if (!$util.isInteger(message.drainTimeoutSeconds)) + return "drainTimeoutSeconds: integer expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.subnetworkResource != null && message.hasOwnProperty("subnetworkResource")) { + var error = $root.google.cloud.compute.v1.Subnetwork.verify(message.subnetworkResource); + if (error) + return "subnetworkResource." + error; + } + return null; + }; + + /** + * Creates a PatchSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchSubnetworkRequest} PatchSubnetworkRequest + */ + PatchSubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchSubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchSubnetworkRequest(); + if (object.drainTimeoutSeconds != null) + message.drainTimeoutSeconds = object.drainTimeoutSeconds | 0; + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.subnetworkResource != null) { + if (typeof object.subnetworkResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchSubnetworkRequest.subnetworkResource: object expected"); + message.subnetworkResource = $root.google.cloud.compute.v1.Subnetwork.fromObject(object.subnetworkResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchSubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.PatchSubnetworkRequest} message PatchSubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchSubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subnetworkResource = null; + object.region = ""; + object.project = ""; + object.subnetwork = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.subnetworkResource != null && message.hasOwnProperty("subnetworkResource")) + object.subnetworkResource = $root.google.cloud.compute.v1.Subnetwork.toObject(message.subnetworkResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.drainTimeoutSeconds != null && message.hasOwnProperty("drainTimeoutSeconds")) { + object.drainTimeoutSeconds = message.drainTimeoutSeconds; + if (options.oneofs) + object._drainTimeoutSeconds = "drainTimeoutSeconds"; + } + return object; + }; + + /** + * Converts this PatchSubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchSubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + PatchSubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchSubnetworkRequest; + })(); + + v1.SetIamPolicySubnetworkRequest = (function() { + + /** + * Properties of a SetIamPolicySubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetIamPolicySubnetworkRequest + * @property {string|null} [project] SetIamPolicySubnetworkRequest project + * @property {string|null} [region] SetIamPolicySubnetworkRequest region + * @property {google.cloud.compute.v1.IRegionSetPolicyRequest|null} [regionSetPolicyRequestResource] SetIamPolicySubnetworkRequest regionSetPolicyRequestResource + * @property {string|null} [resource] SetIamPolicySubnetworkRequest resource + */ + + /** + * Constructs a new SetIamPolicySubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetIamPolicySubnetworkRequest. + * @implements ISetIamPolicySubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.ISetIamPolicySubnetworkRequest=} [properties] Properties to set + */ + function SetIamPolicySubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetIamPolicySubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @instance + */ + SetIamPolicySubnetworkRequest.prototype.project = ""; + + /** + * SetIamPolicySubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @instance + */ + SetIamPolicySubnetworkRequest.prototype.region = ""; + + /** + * SetIamPolicySubnetworkRequest regionSetPolicyRequestResource. + * @member {google.cloud.compute.v1.IRegionSetPolicyRequest|null|undefined} regionSetPolicyRequestResource + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @instance + */ + SetIamPolicySubnetworkRequest.prototype.regionSetPolicyRequestResource = null; + + /** + * SetIamPolicySubnetworkRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @instance + */ + SetIamPolicySubnetworkRequest.prototype.resource = ""; + + /** + * Creates a new SetIamPolicySubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicySubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetIamPolicySubnetworkRequest} SetIamPolicySubnetworkRequest instance + */ + SetIamPolicySubnetworkRequest.create = function create(properties) { + return new SetIamPolicySubnetworkRequest(properties); + }; + + /** + * Encodes the specified SetIamPolicySubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicySubnetworkRequest} message SetIamPolicySubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicySubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionSetPolicyRequestResource != null && Object.hasOwnProperty.call(message, "regionSetPolicyRequestResource")) + $root.google.cloud.compute.v1.RegionSetPolicyRequest.encode(message.regionSetPolicyRequestResource, writer.uint32(/* id 276489091, wireType 2 =*/2211912730).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetIamPolicySubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetIamPolicySubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ISetIamPolicySubnetworkRequest} message SetIamPolicySubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetIamPolicySubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetIamPolicySubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetIamPolicySubnetworkRequest} SetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicySubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetIamPolicySubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 276489091: + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.decode(reader, reader.uint32()); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetIamPolicySubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetIamPolicySubnetworkRequest} SetIamPolicySubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetIamPolicySubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetIamPolicySubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetIamPolicySubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionSetPolicyRequest.verify(message.regionSetPolicyRequestResource); + if (error) + return "regionSetPolicyRequestResource." + error; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetIamPolicySubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetIamPolicySubnetworkRequest} SetIamPolicySubnetworkRequest + */ + SetIamPolicySubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetIamPolicySubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetIamPolicySubnetworkRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionSetPolicyRequestResource != null) { + if (typeof object.regionSetPolicyRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetIamPolicySubnetworkRequest.regionSetPolicyRequestResource: object expected"); + message.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.fromObject(object.regionSetPolicyRequestResource); + } + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetIamPolicySubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @static + * @param {google.cloud.compute.v1.SetIamPolicySubnetworkRequest} message SetIamPolicySubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetIamPolicySubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.regionSetPolicyRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionSetPolicyRequestResource != null && message.hasOwnProperty("regionSetPolicyRequestResource")) + object.regionSetPolicyRequestResource = $root.google.cloud.compute.v1.RegionSetPolicyRequest.toObject(message.regionSetPolicyRequestResource, options); + return object; + }; + + /** + * Converts this SetIamPolicySubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetIamPolicySubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + SetIamPolicySubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetIamPolicySubnetworkRequest; + })(); + + v1.SetPrivateIpGoogleAccessSubnetworkRequest = (function() { + + /** + * Properties of a SetPrivateIpGoogleAccessSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetPrivateIpGoogleAccessSubnetworkRequest + * @property {string|null} [project] SetPrivateIpGoogleAccessSubnetworkRequest project + * @property {string|null} [region] SetPrivateIpGoogleAccessSubnetworkRequest region + * @property {string|null} [requestId] SetPrivateIpGoogleAccessSubnetworkRequest requestId + * @property {string|null} [subnetwork] SetPrivateIpGoogleAccessSubnetworkRequest subnetwork + * @property {google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest|null} [subnetworksSetPrivateIpGoogleAccessRequestResource] SetPrivateIpGoogleAccessSubnetworkRequest subnetworksSetPrivateIpGoogleAccessRequestResource + */ + + /** + * Constructs a new SetPrivateIpGoogleAccessSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetPrivateIpGoogleAccessSubnetworkRequest. + * @implements ISetPrivateIpGoogleAccessSubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest=} [properties] Properties to set + */ + function SetPrivateIpGoogleAccessSubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetPrivateIpGoogleAccessSubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @instance + */ + SetPrivateIpGoogleAccessSubnetworkRequest.prototype.project = ""; + + /** + * SetPrivateIpGoogleAccessSubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @instance + */ + SetPrivateIpGoogleAccessSubnetworkRequest.prototype.region = ""; + + /** + * SetPrivateIpGoogleAccessSubnetworkRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @instance + */ + SetPrivateIpGoogleAccessSubnetworkRequest.prototype.requestId = null; + + /** + * SetPrivateIpGoogleAccessSubnetworkRequest subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @instance + */ + SetPrivateIpGoogleAccessSubnetworkRequest.prototype.subnetwork = ""; + + /** + * SetPrivateIpGoogleAccessSubnetworkRequest subnetworksSetPrivateIpGoogleAccessRequestResource. + * @member {google.cloud.compute.v1.ISubnetworksSetPrivateIpGoogleAccessRequest|null|undefined} subnetworksSetPrivateIpGoogleAccessRequestResource + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @instance + */ + SetPrivateIpGoogleAccessSubnetworkRequest.prototype.subnetworksSetPrivateIpGoogleAccessRequestResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetPrivateIpGoogleAccessSubnetworkRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @instance + */ + Object.defineProperty(SetPrivateIpGoogleAccessSubnetworkRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetPrivateIpGoogleAccessSubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest} SetPrivateIpGoogleAccessSubnetworkRequest instance + */ + SetPrivateIpGoogleAccessSubnetworkRequest.create = function create(properties) { + return new SetPrivateIpGoogleAccessSubnetworkRequest(properties); + }; + + /** + * Encodes the specified SetPrivateIpGoogleAccessSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest} message SetPrivateIpGoogleAccessSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetPrivateIpGoogleAccessSubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.subnetworksSetPrivateIpGoogleAccessRequestResource != null && Object.hasOwnProperty.call(message, "subnetworksSetPrivateIpGoogleAccessRequestResource")) + $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.encode(message.subnetworksSetPrivateIpGoogleAccessRequestResource, writer.uint32(/* id 268920696, wireType 2 =*/2151365570).fork()).ldelim(); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 307827694, wireType 2 =*/2462621554).string(message.subnetwork); + return writer; + }; + + /** + * Encodes the specified SetPrivateIpGoogleAccessSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest} message SetPrivateIpGoogleAccessSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetPrivateIpGoogleAccessSubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetPrivateIpGoogleAccessSubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest} SetPrivateIpGoogleAccessSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetPrivateIpGoogleAccessSubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 307827694: + message.subnetwork = reader.string(); + break; + case 268920696: + message.subnetworksSetPrivateIpGoogleAccessRequestResource = $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetPrivateIpGoogleAccessSubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest} SetPrivateIpGoogleAccessSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetPrivateIpGoogleAccessSubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetPrivateIpGoogleAccessSubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetPrivateIpGoogleAccessSubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + if (message.subnetworksSetPrivateIpGoogleAccessRequestResource != null && message.hasOwnProperty("subnetworksSetPrivateIpGoogleAccessRequestResource")) { + var error = $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.verify(message.subnetworksSetPrivateIpGoogleAccessRequestResource); + if (error) + return "subnetworksSetPrivateIpGoogleAccessRequestResource." + error; + } + return null; + }; + + /** + * Creates a SetPrivateIpGoogleAccessSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest} SetPrivateIpGoogleAccessSubnetworkRequest + */ + SetPrivateIpGoogleAccessSubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.subnetworksSetPrivateIpGoogleAccessRequestResource != null) { + if (typeof object.subnetworksSetPrivateIpGoogleAccessRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest.subnetworksSetPrivateIpGoogleAccessRequestResource: object expected"); + message.subnetworksSetPrivateIpGoogleAccessRequestResource = $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.fromObject(object.subnetworksSetPrivateIpGoogleAccessRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a SetPrivateIpGoogleAccessSubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest} message SetPrivateIpGoogleAccessSubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetPrivateIpGoogleAccessSubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.subnetworksSetPrivateIpGoogleAccessRequestResource = null; + object.subnetwork = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.subnetworksSetPrivateIpGoogleAccessRequestResource != null && message.hasOwnProperty("subnetworksSetPrivateIpGoogleAccessRequestResource")) + object.subnetworksSetPrivateIpGoogleAccessRequestResource = $root.google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest.toObject(message.subnetworksSetPrivateIpGoogleAccessRequestResource, options); + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + return object; + }; + + /** + * Converts this SetPrivateIpGoogleAccessSubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + SetPrivateIpGoogleAccessSubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetPrivateIpGoogleAccessSubnetworkRequest; + })(); + + v1.TestIamPermissionsSubnetworkRequest = (function() { + + /** + * Properties of a TestIamPermissionsSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsSubnetworkRequest + * @property {string|null} [project] TestIamPermissionsSubnetworkRequest project + * @property {string|null} [region] TestIamPermissionsSubnetworkRequest region + * @property {string|null} [resource] TestIamPermissionsSubnetworkRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsSubnetworkRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsSubnetworkRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsSubnetworkRequest. + * @implements ITestIamPermissionsSubnetworkRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest=} [properties] Properties to set + */ + function TestIamPermissionsSubnetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsSubnetworkRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @instance + */ + TestIamPermissionsSubnetworkRequest.prototype.project = ""; + + /** + * TestIamPermissionsSubnetworkRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @instance + */ + TestIamPermissionsSubnetworkRequest.prototype.region = ""; + + /** + * TestIamPermissionsSubnetworkRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @instance + */ + TestIamPermissionsSubnetworkRequest.prototype.resource = ""; + + /** + * TestIamPermissionsSubnetworkRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @instance + */ + TestIamPermissionsSubnetworkRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsSubnetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest} TestIamPermissionsSubnetworkRequest instance + */ + TestIamPermissionsSubnetworkRequest.create = function create(properties) { + return new TestIamPermissionsSubnetworkRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsSubnetworkRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest} message TestIamPermissionsSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsSubnetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsSubnetworkRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest} message TestIamPermissionsSubnetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsSubnetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsSubnetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest} TestIamPermissionsSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsSubnetworkRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsSubnetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest} TestIamPermissionsSubnetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsSubnetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsSubnetworkRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsSubnetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsSubnetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest} TestIamPermissionsSubnetworkRequest + */ + TestIamPermissionsSubnetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsSubnetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest} message TestIamPermissionsSubnetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsSubnetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsSubnetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsSubnetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsSubnetworkRequest; + })(); + + v1.DeleteTargetGrpcProxyRequest = (function() { + + /** + * Properties of a DeleteTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetGrpcProxyRequest + * @property {string|null} [project] DeleteTargetGrpcProxyRequest project + * @property {string|null} [requestId] DeleteTargetGrpcProxyRequest requestId + * @property {string|null} [targetGrpcProxy] DeleteTargetGrpcProxyRequest targetGrpcProxy + */ + + /** + * Constructs a new DeleteTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetGrpcProxyRequest. + * @implements IDeleteTargetGrpcProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest=} [properties] Properties to set + */ + function DeleteTargetGrpcProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetGrpcProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @instance + */ + DeleteTargetGrpcProxyRequest.prototype.project = ""; + + /** + * DeleteTargetGrpcProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @instance + */ + DeleteTargetGrpcProxyRequest.prototype.requestId = null; + + /** + * DeleteTargetGrpcProxyRequest targetGrpcProxy. + * @member {string} targetGrpcProxy + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @instance + */ + DeleteTargetGrpcProxyRequest.prototype.targetGrpcProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetGrpcProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @instance + */ + Object.defineProperty(DeleteTargetGrpcProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetGrpcProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetGrpcProxyRequest} DeleteTargetGrpcProxyRequest instance + */ + DeleteTargetGrpcProxyRequest.create = function create(properties) { + return new DeleteTargetGrpcProxyRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetGrpcProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest} message DeleteTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetGrpcProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetGrpcProxy != null && Object.hasOwnProperty.call(message, "targetGrpcProxy")) + writer.uint32(/* id 5020283, wireType 2 =*/40162266).string(message.targetGrpcProxy); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetGrpcProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest} message DeleteTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetGrpcProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetGrpcProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetGrpcProxyRequest} DeleteTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetGrpcProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetGrpcProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 5020283: + message.targetGrpcProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetGrpcProxyRequest} DeleteTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetGrpcProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetGrpcProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetGrpcProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetGrpcProxy != null && message.hasOwnProperty("targetGrpcProxy")) + if (!$util.isString(message.targetGrpcProxy)) + return "targetGrpcProxy: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetGrpcProxyRequest} DeleteTargetGrpcProxyRequest + */ + DeleteTargetGrpcProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetGrpcProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetGrpcProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetGrpcProxy != null) + message.targetGrpcProxy = String(object.targetGrpcProxy); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetGrpcProxyRequest} message DeleteTargetGrpcProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetGrpcProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetGrpcProxy = ""; + object.project = ""; + } + if (message.targetGrpcProxy != null && message.hasOwnProperty("targetGrpcProxy")) + object.targetGrpcProxy = message.targetGrpcProxy; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteTargetGrpcProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetGrpcProxyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetGrpcProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetGrpcProxyRequest; + })(); + + v1.GetTargetGrpcProxyRequest = (function() { + + /** + * Properties of a GetTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetGrpcProxyRequest + * @property {string|null} [project] GetTargetGrpcProxyRequest project + * @property {string|null} [targetGrpcProxy] GetTargetGrpcProxyRequest targetGrpcProxy + */ + + /** + * Constructs a new GetTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetGrpcProxyRequest. + * @implements IGetTargetGrpcProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetGrpcProxyRequest=} [properties] Properties to set + */ + function GetTargetGrpcProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetGrpcProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @instance + */ + GetTargetGrpcProxyRequest.prototype.project = ""; + + /** + * GetTargetGrpcProxyRequest targetGrpcProxy. + * @member {string} targetGrpcProxy + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @instance + */ + GetTargetGrpcProxyRequest.prototype.targetGrpcProxy = ""; + + /** + * Creates a new GetTargetGrpcProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetGrpcProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetGrpcProxyRequest} GetTargetGrpcProxyRequest instance + */ + GetTargetGrpcProxyRequest.create = function create(properties) { + return new GetTargetGrpcProxyRequest(properties); + }; + + /** + * Encodes the specified GetTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetGrpcProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetGrpcProxyRequest} message GetTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetGrpcProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetGrpcProxy != null && Object.hasOwnProperty.call(message, "targetGrpcProxy")) + writer.uint32(/* id 5020283, wireType 2 =*/40162266).string(message.targetGrpcProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetGrpcProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetGrpcProxyRequest} message GetTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetGrpcProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetGrpcProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetGrpcProxyRequest} GetTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetGrpcProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetGrpcProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 5020283: + message.targetGrpcProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetGrpcProxyRequest} GetTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetGrpcProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetGrpcProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetGrpcProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.targetGrpcProxy != null && message.hasOwnProperty("targetGrpcProxy")) + if (!$util.isString(message.targetGrpcProxy)) + return "targetGrpcProxy: string expected"; + return null; + }; + + /** + * Creates a GetTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetGrpcProxyRequest} GetTargetGrpcProxyRequest + */ + GetTargetGrpcProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetGrpcProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetGrpcProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.targetGrpcProxy != null) + message.targetGrpcProxy = String(object.targetGrpcProxy); + return message; + }; + + /** + * Creates a plain object from a GetTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.GetTargetGrpcProxyRequest} message GetTargetGrpcProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetGrpcProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetGrpcProxy = ""; + object.project = ""; + } + if (message.targetGrpcProxy != null && message.hasOwnProperty("targetGrpcProxy")) + object.targetGrpcProxy = message.targetGrpcProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetTargetGrpcProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetGrpcProxyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetGrpcProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetGrpcProxyRequest; + })(); + + v1.InsertTargetGrpcProxyRequest = (function() { + + /** + * Properties of an InsertTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetGrpcProxyRequest + * @property {string|null} [project] InsertTargetGrpcProxyRequest project + * @property {string|null} [requestId] InsertTargetGrpcProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetGrpcProxy|null} [targetGrpcProxyResource] InsertTargetGrpcProxyRequest targetGrpcProxyResource + */ + + /** + * Constructs a new InsertTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetGrpcProxyRequest. + * @implements IInsertTargetGrpcProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetGrpcProxyRequest=} [properties] Properties to set + */ + function InsertTargetGrpcProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetGrpcProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @instance + */ + InsertTargetGrpcProxyRequest.prototype.project = ""; + + /** + * InsertTargetGrpcProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @instance + */ + InsertTargetGrpcProxyRequest.prototype.requestId = null; + + /** + * InsertTargetGrpcProxyRequest targetGrpcProxyResource. + * @member {google.cloud.compute.v1.ITargetGrpcProxy|null|undefined} targetGrpcProxyResource + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @instance + */ + InsertTargetGrpcProxyRequest.prototype.targetGrpcProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetGrpcProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @instance + */ + Object.defineProperty(InsertTargetGrpcProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetGrpcProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetGrpcProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetGrpcProxyRequest} InsertTargetGrpcProxyRequest instance + */ + InsertTargetGrpcProxyRequest.create = function create(properties) { + return new InsertTargetGrpcProxyRequest(properties); + }; + + /** + * Encodes the specified InsertTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetGrpcProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetGrpcProxyRequest} message InsertTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetGrpcProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetGrpcProxyResource != null && Object.hasOwnProperty.call(message, "targetGrpcProxyResource")) + $root.google.cloud.compute.v1.TargetGrpcProxy.encode(message.targetGrpcProxyResource, writer.uint32(/* id 328922450, wireType 2 =*/2631379602).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetGrpcProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetGrpcProxyRequest} message InsertTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetGrpcProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetGrpcProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetGrpcProxyRequest} InsertTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetGrpcProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetGrpcProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 328922450: + message.targetGrpcProxyResource = $root.google.cloud.compute.v1.TargetGrpcProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetGrpcProxyRequest} InsertTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetGrpcProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetGrpcProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetGrpcProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetGrpcProxyResource != null && message.hasOwnProperty("targetGrpcProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetGrpcProxy.verify(message.targetGrpcProxyResource); + if (error) + return "targetGrpcProxyResource." + error; + } + return null; + }; + + /** + * Creates an InsertTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetGrpcProxyRequest} InsertTargetGrpcProxyRequest + */ + InsertTargetGrpcProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetGrpcProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetGrpcProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetGrpcProxyResource != null) { + if (typeof object.targetGrpcProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetGrpcProxyRequest.targetGrpcProxyResource: object expected"); + message.targetGrpcProxyResource = $root.google.cloud.compute.v1.TargetGrpcProxy.fromObject(object.targetGrpcProxyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetGrpcProxyRequest} message InsertTargetGrpcProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetGrpcProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.targetGrpcProxyResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetGrpcProxyResource != null && message.hasOwnProperty("targetGrpcProxyResource")) + object.targetGrpcProxyResource = $root.google.cloud.compute.v1.TargetGrpcProxy.toObject(message.targetGrpcProxyResource, options); + return object; + }; + + /** + * Converts this InsertTargetGrpcProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetGrpcProxyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetGrpcProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetGrpcProxyRequest; + })(); + + v1.ListTargetGrpcProxiesRequest = (function() { + + /** + * Properties of a ListTargetGrpcProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetGrpcProxiesRequest + * @property {string|null} [filter] ListTargetGrpcProxiesRequest filter + * @property {number|null} [maxResults] ListTargetGrpcProxiesRequest maxResults + * @property {string|null} [orderBy] ListTargetGrpcProxiesRequest orderBy + * @property {string|null} [pageToken] ListTargetGrpcProxiesRequest pageToken + * @property {string|null} [project] ListTargetGrpcProxiesRequest project + * @property {boolean|null} [returnPartialSuccess] ListTargetGrpcProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListTargetGrpcProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetGrpcProxiesRequest. + * @implements IListTargetGrpcProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetGrpcProxiesRequest=} [properties] Properties to set + */ + function ListTargetGrpcProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetGrpcProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + ListTargetGrpcProxiesRequest.prototype.filter = null; + + /** + * ListTargetGrpcProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + ListTargetGrpcProxiesRequest.prototype.maxResults = null; + + /** + * ListTargetGrpcProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + ListTargetGrpcProxiesRequest.prototype.orderBy = null; + + /** + * ListTargetGrpcProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + ListTargetGrpcProxiesRequest.prototype.pageToken = null; + + /** + * ListTargetGrpcProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + ListTargetGrpcProxiesRequest.prototype.project = ""; + + /** + * ListTargetGrpcProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + ListTargetGrpcProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetGrpcProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetGrpcProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetGrpcProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetGrpcProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetGrpcProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetGrpcProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetGrpcProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetGrpcProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetGrpcProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetGrpcProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetGrpcProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetGrpcProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetGrpcProxiesRequest} ListTargetGrpcProxiesRequest instance + */ + ListTargetGrpcProxiesRequest.create = function create(properties) { + return new ListTargetGrpcProxiesRequest(properties); + }; + + /** + * Encodes the specified ListTargetGrpcProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetGrpcProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetGrpcProxiesRequest} message ListTargetGrpcProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetGrpcProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetGrpcProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetGrpcProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetGrpcProxiesRequest} message ListTargetGrpcProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetGrpcProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetGrpcProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetGrpcProxiesRequest} ListTargetGrpcProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetGrpcProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetGrpcProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetGrpcProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetGrpcProxiesRequest} ListTargetGrpcProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetGrpcProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetGrpcProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetGrpcProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListTargetGrpcProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetGrpcProxiesRequest} ListTargetGrpcProxiesRequest + */ + ListTargetGrpcProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetGrpcProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetGrpcProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListTargetGrpcProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @static + * @param {google.cloud.compute.v1.ListTargetGrpcProxiesRequest} message ListTargetGrpcProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetGrpcProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetGrpcProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetGrpcProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetGrpcProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetGrpcProxiesRequest; + })(); + + v1.PatchTargetGrpcProxyRequest = (function() { + + /** + * Properties of a PatchTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchTargetGrpcProxyRequest + * @property {string|null} [project] PatchTargetGrpcProxyRequest project + * @property {string|null} [requestId] PatchTargetGrpcProxyRequest requestId + * @property {string|null} [targetGrpcProxy] PatchTargetGrpcProxyRequest targetGrpcProxy + * @property {google.cloud.compute.v1.ITargetGrpcProxy|null} [targetGrpcProxyResource] PatchTargetGrpcProxyRequest targetGrpcProxyResource + */ + + /** + * Constructs a new PatchTargetGrpcProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchTargetGrpcProxyRequest. + * @implements IPatchTargetGrpcProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchTargetGrpcProxyRequest=} [properties] Properties to set + */ + function PatchTargetGrpcProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchTargetGrpcProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @instance + */ + PatchTargetGrpcProxyRequest.prototype.project = ""; + + /** + * PatchTargetGrpcProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @instance + */ + PatchTargetGrpcProxyRequest.prototype.requestId = null; + + /** + * PatchTargetGrpcProxyRequest targetGrpcProxy. + * @member {string} targetGrpcProxy + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @instance + */ + PatchTargetGrpcProxyRequest.prototype.targetGrpcProxy = ""; + + /** + * PatchTargetGrpcProxyRequest targetGrpcProxyResource. + * @member {google.cloud.compute.v1.ITargetGrpcProxy|null|undefined} targetGrpcProxyResource + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @instance + */ + PatchTargetGrpcProxyRequest.prototype.targetGrpcProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchTargetGrpcProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @instance + */ + Object.defineProperty(PatchTargetGrpcProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchTargetGrpcProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetGrpcProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchTargetGrpcProxyRequest} PatchTargetGrpcProxyRequest instance + */ + PatchTargetGrpcProxyRequest.create = function create(properties) { + return new PatchTargetGrpcProxyRequest(properties); + }; + + /** + * Encodes the specified PatchTargetGrpcProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchTargetGrpcProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetGrpcProxyRequest} message PatchTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchTargetGrpcProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetGrpcProxy != null && Object.hasOwnProperty.call(message, "targetGrpcProxy")) + writer.uint32(/* id 5020283, wireType 2 =*/40162266).string(message.targetGrpcProxy); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetGrpcProxyResource != null && Object.hasOwnProperty.call(message, "targetGrpcProxyResource")) + $root.google.cloud.compute.v1.TargetGrpcProxy.encode(message.targetGrpcProxyResource, writer.uint32(/* id 328922450, wireType 2 =*/2631379602).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchTargetGrpcProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchTargetGrpcProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetGrpcProxyRequest} message PatchTargetGrpcProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchTargetGrpcProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchTargetGrpcProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchTargetGrpcProxyRequest} PatchTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchTargetGrpcProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchTargetGrpcProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 5020283: + message.targetGrpcProxy = reader.string(); + break; + case 328922450: + message.targetGrpcProxyResource = $root.google.cloud.compute.v1.TargetGrpcProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchTargetGrpcProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchTargetGrpcProxyRequest} PatchTargetGrpcProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchTargetGrpcProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchTargetGrpcProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchTargetGrpcProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetGrpcProxy != null && message.hasOwnProperty("targetGrpcProxy")) + if (!$util.isString(message.targetGrpcProxy)) + return "targetGrpcProxy: string expected"; + if (message.targetGrpcProxyResource != null && message.hasOwnProperty("targetGrpcProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetGrpcProxy.verify(message.targetGrpcProxyResource); + if (error) + return "targetGrpcProxyResource." + error; + } + return null; + }; + + /** + * Creates a PatchTargetGrpcProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchTargetGrpcProxyRequest} PatchTargetGrpcProxyRequest + */ + PatchTargetGrpcProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchTargetGrpcProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchTargetGrpcProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetGrpcProxy != null) + message.targetGrpcProxy = String(object.targetGrpcProxy); + if (object.targetGrpcProxyResource != null) { + if (typeof object.targetGrpcProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchTargetGrpcProxyRequest.targetGrpcProxyResource: object expected"); + message.targetGrpcProxyResource = $root.google.cloud.compute.v1.TargetGrpcProxy.fromObject(object.targetGrpcProxyResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchTargetGrpcProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @static + * @param {google.cloud.compute.v1.PatchTargetGrpcProxyRequest} message PatchTargetGrpcProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchTargetGrpcProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetGrpcProxy = ""; + object.project = ""; + object.targetGrpcProxyResource = null; + } + if (message.targetGrpcProxy != null && message.hasOwnProperty("targetGrpcProxy")) + object.targetGrpcProxy = message.targetGrpcProxy; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetGrpcProxyResource != null && message.hasOwnProperty("targetGrpcProxyResource")) + object.targetGrpcProxyResource = $root.google.cloud.compute.v1.TargetGrpcProxy.toObject(message.targetGrpcProxyResource, options); + return object; + }; + + /** + * Converts this PatchTargetGrpcProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchTargetGrpcProxyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchTargetGrpcProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchTargetGrpcProxyRequest; + })(); + + v1.AggregatedListTargetHttpProxiesRequest = (function() { + + /** + * Properties of an AggregatedListTargetHttpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListTargetHttpProxiesRequest + * @property {string|null} [filter] AggregatedListTargetHttpProxiesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListTargetHttpProxiesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListTargetHttpProxiesRequest maxResults + * @property {string|null} [orderBy] AggregatedListTargetHttpProxiesRequest orderBy + * @property {string|null} [pageToken] AggregatedListTargetHttpProxiesRequest pageToken + * @property {string|null} [project] AggregatedListTargetHttpProxiesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListTargetHttpProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListTargetHttpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListTargetHttpProxiesRequest. + * @implements IAggregatedListTargetHttpProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest=} [properties] Properties to set + */ + function AggregatedListTargetHttpProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListTargetHttpProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + AggregatedListTargetHttpProxiesRequest.prototype.filter = null; + + /** + * AggregatedListTargetHttpProxiesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + AggregatedListTargetHttpProxiesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListTargetHttpProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + AggregatedListTargetHttpProxiesRequest.prototype.maxResults = null; + + /** + * AggregatedListTargetHttpProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + AggregatedListTargetHttpProxiesRequest.prototype.orderBy = null; + + /** + * AggregatedListTargetHttpProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + AggregatedListTargetHttpProxiesRequest.prototype.pageToken = null; + + /** + * AggregatedListTargetHttpProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + AggregatedListTargetHttpProxiesRequest.prototype.project = ""; + + /** + * AggregatedListTargetHttpProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + AggregatedListTargetHttpProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListTargetHttpProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpProxiesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpProxiesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListTargetHttpProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest} AggregatedListTargetHttpProxiesRequest instance + */ + AggregatedListTargetHttpProxiesRequest.create = function create(properties) { + return new AggregatedListTargetHttpProxiesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListTargetHttpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest} message AggregatedListTargetHttpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetHttpProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListTargetHttpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest} message AggregatedListTargetHttpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetHttpProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListTargetHttpProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest} AggregatedListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetHttpProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListTargetHttpProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest} AggregatedListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetHttpProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListTargetHttpProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListTargetHttpProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListTargetHttpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest} AggregatedListTargetHttpProxiesRequest + */ + AggregatedListTargetHttpProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListTargetHttpProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest} message AggregatedListTargetHttpProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListTargetHttpProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListTargetHttpProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListTargetHttpProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListTargetHttpProxiesRequest; + })(); + + v1.DeleteTargetHttpProxyRequest = (function() { + + /** + * Properties of a DeleteTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetHttpProxyRequest + * @property {string|null} [project] DeleteTargetHttpProxyRequest project + * @property {string|null} [requestId] DeleteTargetHttpProxyRequest requestId + * @property {string|null} [targetHttpProxy] DeleteTargetHttpProxyRequest targetHttpProxy + */ + + /** + * Constructs a new DeleteTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetHttpProxyRequest. + * @implements IDeleteTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetHttpProxyRequest=} [properties] Properties to set + */ + function DeleteTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @instance + */ + DeleteTargetHttpProxyRequest.prototype.project = ""; + + /** + * DeleteTargetHttpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @instance + */ + DeleteTargetHttpProxyRequest.prototype.requestId = null; + + /** + * DeleteTargetHttpProxyRequest targetHttpProxy. + * @member {string} targetHttpProxy + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @instance + */ + DeleteTargetHttpProxyRequest.prototype.targetHttpProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetHttpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @instance + */ + Object.defineProperty(DeleteTargetHttpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetHttpProxyRequest} DeleteTargetHttpProxyRequest instance + */ + DeleteTargetHttpProxyRequest.create = function create(properties) { + return new DeleteTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetHttpProxyRequest} message DeleteTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpProxy != null && Object.hasOwnProperty.call(message, "targetHttpProxy")) + writer.uint32(/* id 206872421, wireType 2 =*/1654979370).string(message.targetHttpProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetHttpProxyRequest} message DeleteTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetHttpProxyRequest} DeleteTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 206872421: + message.targetHttpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetHttpProxyRequest} DeleteTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + if (!$util.isString(message.targetHttpProxy)) + return "targetHttpProxy: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetHttpProxyRequest} DeleteTargetHttpProxyRequest + */ + DeleteTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpProxy != null) + message.targetHttpProxy = String(object.targetHttpProxy); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetHttpProxyRequest} message DeleteTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpProxy = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + object.targetHttpProxy = message.targetHttpProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetHttpProxyRequest; + })(); + + v1.GetTargetHttpProxyRequest = (function() { + + /** + * Properties of a GetTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetHttpProxyRequest + * @property {string|null} [project] GetTargetHttpProxyRequest project + * @property {string|null} [targetHttpProxy] GetTargetHttpProxyRequest targetHttpProxy + */ + + /** + * Constructs a new GetTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetHttpProxyRequest. + * @implements IGetTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetHttpProxyRequest=} [properties] Properties to set + */ + function GetTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @instance + */ + GetTargetHttpProxyRequest.prototype.project = ""; + + /** + * GetTargetHttpProxyRequest targetHttpProxy. + * @member {string} targetHttpProxy + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @instance + */ + GetTargetHttpProxyRequest.prototype.targetHttpProxy = ""; + + /** + * Creates a new GetTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetHttpProxyRequest} GetTargetHttpProxyRequest instance + */ + GetTargetHttpProxyRequest.create = function create(properties) { + return new GetTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified GetTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetHttpProxyRequest} message GetTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetHttpProxy != null && Object.hasOwnProperty.call(message, "targetHttpProxy")) + writer.uint32(/* id 206872421, wireType 2 =*/1654979370).string(message.targetHttpProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetHttpProxyRequest} message GetTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetHttpProxyRequest} GetTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 206872421: + message.targetHttpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetHttpProxyRequest} GetTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + if (!$util.isString(message.targetHttpProxy)) + return "targetHttpProxy: string expected"; + return null; + }; + + /** + * Creates a GetTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetHttpProxyRequest} GetTargetHttpProxyRequest + */ + GetTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.targetHttpProxy != null) + message.targetHttpProxy = String(object.targetHttpProxy); + return message; + }; + + /** + * Creates a plain object from a GetTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.GetTargetHttpProxyRequest} message GetTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpProxy = ""; + object.project = ""; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + object.targetHttpProxy = message.targetHttpProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetHttpProxyRequest; + })(); + + v1.InsertTargetHttpProxyRequest = (function() { + + /** + * Properties of an InsertTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetHttpProxyRequest + * @property {string|null} [project] InsertTargetHttpProxyRequest project + * @property {string|null} [requestId] InsertTargetHttpProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetHttpProxy|null} [targetHttpProxyResource] InsertTargetHttpProxyRequest targetHttpProxyResource + */ + + /** + * Constructs a new InsertTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetHttpProxyRequest. + * @implements IInsertTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetHttpProxyRequest=} [properties] Properties to set + */ + function InsertTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @instance + */ + InsertTargetHttpProxyRequest.prototype.project = ""; + + /** + * InsertTargetHttpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @instance + */ + InsertTargetHttpProxyRequest.prototype.requestId = null; + + /** + * InsertTargetHttpProxyRequest targetHttpProxyResource. + * @member {google.cloud.compute.v1.ITargetHttpProxy|null|undefined} targetHttpProxyResource + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @instance + */ + InsertTargetHttpProxyRequest.prototype.targetHttpProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetHttpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @instance + */ + Object.defineProperty(InsertTargetHttpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetHttpProxyRequest} InsertTargetHttpProxyRequest instance + */ + InsertTargetHttpProxyRequest.create = function create(properties) { + return new InsertTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified InsertTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetHttpProxyRequest} message InsertTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetHttpProxyResource != null && Object.hasOwnProperty.call(message, "targetHttpProxyResource")) + $root.google.cloud.compute.v1.TargetHttpProxy.encode(message.targetHttpProxyResource, writer.uint32(/* id 24696744, wireType 2 =*/197573954).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetHttpProxyRequest} message InsertTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetHttpProxyRequest} InsertTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 24696744: + message.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetHttpProxyRequest} InsertTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpProxyResource != null && message.hasOwnProperty("targetHttpProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpProxy.verify(message.targetHttpProxyResource); + if (error) + return "targetHttpProxyResource." + error; + } + return null; + }; + + /** + * Creates an InsertTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetHttpProxyRequest} InsertTargetHttpProxyRequest + */ + InsertTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpProxyResource != null) { + if (typeof object.targetHttpProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetHttpProxyRequest.targetHttpProxyResource: object expected"); + message.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.fromObject(object.targetHttpProxyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetHttpProxyRequest} message InsertTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpProxyResource = null; + object.project = ""; + } + if (message.targetHttpProxyResource != null && message.hasOwnProperty("targetHttpProxyResource")) + object.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.toObject(message.targetHttpProxyResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetHttpProxyRequest; + })(); + + v1.ListTargetHttpProxiesRequest = (function() { + + /** + * Properties of a ListTargetHttpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetHttpProxiesRequest + * @property {string|null} [filter] ListTargetHttpProxiesRequest filter + * @property {number|null} [maxResults] ListTargetHttpProxiesRequest maxResults + * @property {string|null} [orderBy] ListTargetHttpProxiesRequest orderBy + * @property {string|null} [pageToken] ListTargetHttpProxiesRequest pageToken + * @property {string|null} [project] ListTargetHttpProxiesRequest project + * @property {boolean|null} [returnPartialSuccess] ListTargetHttpProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListTargetHttpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetHttpProxiesRequest. + * @implements IListTargetHttpProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetHttpProxiesRequest=} [properties] Properties to set + */ + function ListTargetHttpProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetHttpProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + ListTargetHttpProxiesRequest.prototype.filter = null; + + /** + * ListTargetHttpProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + ListTargetHttpProxiesRequest.prototype.maxResults = null; + + /** + * ListTargetHttpProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + ListTargetHttpProxiesRequest.prototype.orderBy = null; + + /** + * ListTargetHttpProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + ListTargetHttpProxiesRequest.prototype.pageToken = null; + + /** + * ListTargetHttpProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + ListTargetHttpProxiesRequest.prototype.project = ""; + + /** + * ListTargetHttpProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + ListTargetHttpProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetHttpProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetHttpProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetHttpProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetHttpProxiesRequest} ListTargetHttpProxiesRequest instance + */ + ListTargetHttpProxiesRequest.create = function create(properties) { + return new ListTargetHttpProxiesRequest(properties); + }; + + /** + * Encodes the specified ListTargetHttpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetHttpProxiesRequest} message ListTargetHttpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetHttpProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetHttpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetHttpProxiesRequest} message ListTargetHttpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetHttpProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetHttpProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetHttpProxiesRequest} ListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetHttpProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetHttpProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetHttpProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetHttpProxiesRequest} ListTargetHttpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetHttpProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetHttpProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetHttpProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListTargetHttpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetHttpProxiesRequest} ListTargetHttpProxiesRequest + */ + ListTargetHttpProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetHttpProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetHttpProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListTargetHttpProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @static + * @param {google.cloud.compute.v1.ListTargetHttpProxiesRequest} message ListTargetHttpProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetHttpProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetHttpProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetHttpProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetHttpProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetHttpProxiesRequest; + })(); + + v1.PatchTargetHttpProxyRequest = (function() { + + /** + * Properties of a PatchTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchTargetHttpProxyRequest + * @property {string|null} [project] PatchTargetHttpProxyRequest project + * @property {string|null} [requestId] PatchTargetHttpProxyRequest requestId + * @property {string|null} [targetHttpProxy] PatchTargetHttpProxyRequest targetHttpProxy + * @property {google.cloud.compute.v1.ITargetHttpProxy|null} [targetHttpProxyResource] PatchTargetHttpProxyRequest targetHttpProxyResource + */ + + /** + * Constructs a new PatchTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchTargetHttpProxyRequest. + * @implements IPatchTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchTargetHttpProxyRequest=} [properties] Properties to set + */ + function PatchTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @instance + */ + PatchTargetHttpProxyRequest.prototype.project = ""; + + /** + * PatchTargetHttpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @instance + */ + PatchTargetHttpProxyRequest.prototype.requestId = null; + + /** + * PatchTargetHttpProxyRequest targetHttpProxy. + * @member {string} targetHttpProxy + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @instance + */ + PatchTargetHttpProxyRequest.prototype.targetHttpProxy = ""; + + /** + * PatchTargetHttpProxyRequest targetHttpProxyResource. + * @member {google.cloud.compute.v1.ITargetHttpProxy|null|undefined} targetHttpProxyResource + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @instance + */ + PatchTargetHttpProxyRequest.prototype.targetHttpProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchTargetHttpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @instance + */ + Object.defineProperty(PatchTargetHttpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchTargetHttpProxyRequest} PatchTargetHttpProxyRequest instance + */ + PatchTargetHttpProxyRequest.create = function create(properties) { + return new PatchTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified PatchTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetHttpProxyRequest} message PatchTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetHttpProxyResource != null && Object.hasOwnProperty.call(message, "targetHttpProxyResource")) + $root.google.cloud.compute.v1.TargetHttpProxy.encode(message.targetHttpProxyResource, writer.uint32(/* id 24696744, wireType 2 =*/197573954).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpProxy != null && Object.hasOwnProperty.call(message, "targetHttpProxy")) + writer.uint32(/* id 206872421, wireType 2 =*/1654979370).string(message.targetHttpProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified PatchTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetHttpProxyRequest} message PatchTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchTargetHttpProxyRequest} PatchTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 206872421: + message.targetHttpProxy = reader.string(); + break; + case 24696744: + message.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchTargetHttpProxyRequest} PatchTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + if (!$util.isString(message.targetHttpProxy)) + return "targetHttpProxy: string expected"; + if (message.targetHttpProxyResource != null && message.hasOwnProperty("targetHttpProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpProxy.verify(message.targetHttpProxyResource); + if (error) + return "targetHttpProxyResource." + error; + } + return null; + }; + + /** + * Creates a PatchTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchTargetHttpProxyRequest} PatchTargetHttpProxyRequest + */ + PatchTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpProxy != null) + message.targetHttpProxy = String(object.targetHttpProxy); + if (object.targetHttpProxyResource != null) { + if (typeof object.targetHttpProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchTargetHttpProxyRequest.targetHttpProxyResource: object expected"); + message.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.fromObject(object.targetHttpProxyResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.PatchTargetHttpProxyRequest} message PatchTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpProxyResource = null; + object.targetHttpProxy = ""; + object.project = ""; + } + if (message.targetHttpProxyResource != null && message.hasOwnProperty("targetHttpProxyResource")) + object.targetHttpProxyResource = $root.google.cloud.compute.v1.TargetHttpProxy.toObject(message.targetHttpProxyResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + object.targetHttpProxy = message.targetHttpProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this PatchTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchTargetHttpProxyRequest; + })(); + + v1.SetUrlMapTargetHttpProxyRequest = (function() { + + /** + * Properties of a SetUrlMapTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetUrlMapTargetHttpProxyRequest + * @property {string|null} [project] SetUrlMapTargetHttpProxyRequest project + * @property {string|null} [requestId] SetUrlMapTargetHttpProxyRequest requestId + * @property {string|null} [targetHttpProxy] SetUrlMapTargetHttpProxyRequest targetHttpProxy + * @property {google.cloud.compute.v1.IUrlMapReference|null} [urlMapReferenceResource] SetUrlMapTargetHttpProxyRequest urlMapReferenceResource + */ + + /** + * Constructs a new SetUrlMapTargetHttpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetUrlMapTargetHttpProxyRequest. + * @implements ISetUrlMapTargetHttpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest=} [properties] Properties to set + */ + function SetUrlMapTargetHttpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetUrlMapTargetHttpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @instance + */ + SetUrlMapTargetHttpProxyRequest.prototype.project = ""; + + /** + * SetUrlMapTargetHttpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @instance + */ + SetUrlMapTargetHttpProxyRequest.prototype.requestId = null; + + /** + * SetUrlMapTargetHttpProxyRequest targetHttpProxy. + * @member {string} targetHttpProxy + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @instance + */ + SetUrlMapTargetHttpProxyRequest.prototype.targetHttpProxy = ""; + + /** + * SetUrlMapTargetHttpProxyRequest urlMapReferenceResource. + * @member {google.cloud.compute.v1.IUrlMapReference|null|undefined} urlMapReferenceResource + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @instance + */ + SetUrlMapTargetHttpProxyRequest.prototype.urlMapReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetUrlMapTargetHttpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @instance + */ + Object.defineProperty(SetUrlMapTargetHttpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetUrlMapTargetHttpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest} SetUrlMapTargetHttpProxyRequest instance + */ + SetUrlMapTargetHttpProxyRequest.create = function create(properties) { + return new SetUrlMapTargetHttpProxyRequest(properties); + }; + + /** + * Encodes the specified SetUrlMapTargetHttpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest} message SetUrlMapTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapTargetHttpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpProxy != null && Object.hasOwnProperty.call(message, "targetHttpProxy")) + writer.uint32(/* id 206872421, wireType 2 =*/1654979370).string(message.targetHttpProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMapReferenceResource != null && Object.hasOwnProperty.call(message, "urlMapReferenceResource")) + $root.google.cloud.compute.v1.UrlMapReference.encode(message.urlMapReferenceResource, writer.uint32(/* id 398701333, wireType 2 =*/3189610666).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetUrlMapTargetHttpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest} message SetUrlMapTargetHttpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapTargetHttpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetUrlMapTargetHttpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest} SetUrlMapTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapTargetHttpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 206872421: + message.targetHttpProxy = reader.string(); + break; + case 398701333: + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetUrlMapTargetHttpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest} SetUrlMapTargetHttpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapTargetHttpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetUrlMapTargetHttpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetUrlMapTargetHttpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + if (!$util.isString(message.targetHttpProxy)) + return "targetHttpProxy: string expected"; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) { + var error = $root.google.cloud.compute.v1.UrlMapReference.verify(message.urlMapReferenceResource); + if (error) + return "urlMapReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetUrlMapTargetHttpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest} SetUrlMapTargetHttpProxyRequest + */ + SetUrlMapTargetHttpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpProxy != null) + message.targetHttpProxy = String(object.targetHttpProxy); + if (object.urlMapReferenceResource != null) { + if (typeof object.urlMapReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest.urlMapReferenceResource: object expected"); + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.fromObject(object.urlMapReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetUrlMapTargetHttpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @static + * @param {google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest} message SetUrlMapTargetHttpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetUrlMapTargetHttpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpProxy = ""; + object.project = ""; + object.urlMapReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpProxy != null && message.hasOwnProperty("targetHttpProxy")) + object.targetHttpProxy = message.targetHttpProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) + object.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.toObject(message.urlMapReferenceResource, options); + return object; + }; + + /** + * Converts this SetUrlMapTargetHttpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetUrlMapTargetHttpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetUrlMapTargetHttpProxyRequest; + })(); + + v1.AggregatedListTargetHttpsProxiesRequest = (function() { + + /** + * Properties of an AggregatedListTargetHttpsProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListTargetHttpsProxiesRequest + * @property {string|null} [filter] AggregatedListTargetHttpsProxiesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListTargetHttpsProxiesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListTargetHttpsProxiesRequest maxResults + * @property {string|null} [orderBy] AggregatedListTargetHttpsProxiesRequest orderBy + * @property {string|null} [pageToken] AggregatedListTargetHttpsProxiesRequest pageToken + * @property {string|null} [project] AggregatedListTargetHttpsProxiesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListTargetHttpsProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListTargetHttpsProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListTargetHttpsProxiesRequest. + * @implements IAggregatedListTargetHttpsProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest=} [properties] Properties to set + */ + function AggregatedListTargetHttpsProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListTargetHttpsProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + AggregatedListTargetHttpsProxiesRequest.prototype.filter = null; + + /** + * AggregatedListTargetHttpsProxiesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + AggregatedListTargetHttpsProxiesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListTargetHttpsProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + AggregatedListTargetHttpsProxiesRequest.prototype.maxResults = null; + + /** + * AggregatedListTargetHttpsProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + AggregatedListTargetHttpsProxiesRequest.prototype.orderBy = null; + + /** + * AggregatedListTargetHttpsProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + AggregatedListTargetHttpsProxiesRequest.prototype.pageToken = null; + + /** + * AggregatedListTargetHttpsProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + AggregatedListTargetHttpsProxiesRequest.prototype.project = ""; + + /** + * AggregatedListTargetHttpsProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + AggregatedListTargetHttpsProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListTargetHttpsProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpsProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpsProxiesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpsProxiesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpsProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpsProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpsProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpsProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpsProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpsProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetHttpsProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetHttpsProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListTargetHttpsProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest} AggregatedListTargetHttpsProxiesRequest instance + */ + AggregatedListTargetHttpsProxiesRequest.create = function create(properties) { + return new AggregatedListTargetHttpsProxiesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListTargetHttpsProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest} message AggregatedListTargetHttpsProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetHttpsProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListTargetHttpsProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest} message AggregatedListTargetHttpsProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetHttpsProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListTargetHttpsProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest} AggregatedListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetHttpsProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListTargetHttpsProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest} AggregatedListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetHttpsProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListTargetHttpsProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListTargetHttpsProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListTargetHttpsProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest} AggregatedListTargetHttpsProxiesRequest + */ + AggregatedListTargetHttpsProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListTargetHttpsProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest} message AggregatedListTargetHttpsProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListTargetHttpsProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListTargetHttpsProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListTargetHttpsProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListTargetHttpsProxiesRequest; + })(); + + v1.DeleteTargetHttpsProxyRequest = (function() { + + /** + * Properties of a DeleteTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetHttpsProxyRequest + * @property {string|null} [project] DeleteTargetHttpsProxyRequest project + * @property {string|null} [requestId] DeleteTargetHttpsProxyRequest requestId + * @property {string|null} [targetHttpsProxy] DeleteTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new DeleteTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetHttpsProxyRequest. + * @implements IDeleteTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest=} [properties] Properties to set + */ + function DeleteTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @instance + */ + DeleteTargetHttpsProxyRequest.prototype.project = ""; + + /** + * DeleteTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @instance + */ + DeleteTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * DeleteTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @instance + */ + DeleteTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(DeleteTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetHttpsProxyRequest} DeleteTargetHttpsProxyRequest instance + */ + DeleteTargetHttpsProxyRequest.create = function create(properties) { + return new DeleteTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest} message DeleteTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest} message DeleteTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetHttpsProxyRequest} DeleteTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetHttpsProxyRequest} DeleteTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetHttpsProxyRequest} DeleteTargetHttpsProxyRequest + */ + DeleteTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetHttpsProxyRequest} message DeleteTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetHttpsProxyRequest; + })(); + + v1.GetTargetHttpsProxyRequest = (function() { + + /** + * Properties of a GetTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetHttpsProxyRequest + * @property {string|null} [project] GetTargetHttpsProxyRequest project + * @property {string|null} [targetHttpsProxy] GetTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new GetTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetHttpsProxyRequest. + * @implements IGetTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetHttpsProxyRequest=} [properties] Properties to set + */ + function GetTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @instance + */ + GetTargetHttpsProxyRequest.prototype.project = ""; + + /** + * GetTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @instance + */ + GetTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + /** + * Creates a new GetTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetHttpsProxyRequest} GetTargetHttpsProxyRequest instance + */ + GetTargetHttpsProxyRequest.create = function create(properties) { + return new GetTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified GetTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetHttpsProxyRequest} message GetTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetHttpsProxyRequest} message GetTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetHttpsProxyRequest} GetTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetHttpsProxyRequest} GetTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a GetTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetHttpsProxyRequest} GetTargetHttpsProxyRequest + */ + GetTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a GetTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.GetTargetHttpsProxyRequest} message GetTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.project = ""; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetHttpsProxyRequest; + })(); + + v1.InsertTargetHttpsProxyRequest = (function() { + + /** + * Properties of an InsertTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetHttpsProxyRequest + * @property {string|null} [project] InsertTargetHttpsProxyRequest project + * @property {string|null} [requestId] InsertTargetHttpsProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetHttpsProxy|null} [targetHttpsProxyResource] InsertTargetHttpsProxyRequest targetHttpsProxyResource + */ + + /** + * Constructs a new InsertTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetHttpsProxyRequest. + * @implements IInsertTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetHttpsProxyRequest=} [properties] Properties to set + */ + function InsertTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @instance + */ + InsertTargetHttpsProxyRequest.prototype.project = ""; + + /** + * InsertTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @instance + */ + InsertTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * InsertTargetHttpsProxyRequest targetHttpsProxyResource. + * @member {google.cloud.compute.v1.ITargetHttpsProxy|null|undefined} targetHttpsProxyResource + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @instance + */ + InsertTargetHttpsProxyRequest.prototype.targetHttpsProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(InsertTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetHttpsProxyRequest} InsertTargetHttpsProxyRequest instance + */ + InsertTargetHttpsProxyRequest.create = function create(properties) { + return new InsertTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified InsertTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetHttpsProxyRequest} message InsertTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetHttpsProxyResource != null && Object.hasOwnProperty.call(message, "targetHttpsProxyResource")) + $root.google.cloud.compute.v1.TargetHttpsProxy.encode(message.targetHttpsProxyResource, writer.uint32(/* id 433657473, wireType 2 =*/3469259786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetHttpsProxyRequest} message InsertTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetHttpsProxyRequest} InsertTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 433657473: + message.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetHttpsProxyRequest} InsertTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxyResource != null && message.hasOwnProperty("targetHttpsProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxy.verify(message.targetHttpsProxyResource); + if (error) + return "targetHttpsProxyResource." + error; + } + return null; + }; + + /** + * Creates an InsertTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetHttpsProxyRequest} InsertTargetHttpsProxyRequest + */ + InsertTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxyResource != null) { + if (typeof object.targetHttpsProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetHttpsProxyRequest.targetHttpsProxyResource: object expected"); + message.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.fromObject(object.targetHttpsProxyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetHttpsProxyRequest} message InsertTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.targetHttpsProxyResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetHttpsProxyResource != null && message.hasOwnProperty("targetHttpsProxyResource")) + object.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.toObject(message.targetHttpsProxyResource, options); + return object; + }; + + /** + * Converts this InsertTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetHttpsProxyRequest; + })(); + + v1.ListTargetHttpsProxiesRequest = (function() { + + /** + * Properties of a ListTargetHttpsProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetHttpsProxiesRequest + * @property {string|null} [filter] ListTargetHttpsProxiesRequest filter + * @property {number|null} [maxResults] ListTargetHttpsProxiesRequest maxResults + * @property {string|null} [orderBy] ListTargetHttpsProxiesRequest orderBy + * @property {string|null} [pageToken] ListTargetHttpsProxiesRequest pageToken + * @property {string|null} [project] ListTargetHttpsProxiesRequest project + * @property {boolean|null} [returnPartialSuccess] ListTargetHttpsProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListTargetHttpsProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetHttpsProxiesRequest. + * @implements IListTargetHttpsProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetHttpsProxiesRequest=} [properties] Properties to set + */ + function ListTargetHttpsProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetHttpsProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + ListTargetHttpsProxiesRequest.prototype.filter = null; + + /** + * ListTargetHttpsProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + ListTargetHttpsProxiesRequest.prototype.maxResults = null; + + /** + * ListTargetHttpsProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + ListTargetHttpsProxiesRequest.prototype.orderBy = null; + + /** + * ListTargetHttpsProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + ListTargetHttpsProxiesRequest.prototype.pageToken = null; + + /** + * ListTargetHttpsProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + ListTargetHttpsProxiesRequest.prototype.project = ""; + + /** + * ListTargetHttpsProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + ListTargetHttpsProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetHttpsProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpsProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpsProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpsProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpsProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpsProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpsProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpsProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetHttpsProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetHttpsProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetHttpsProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetHttpsProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetHttpsProxiesRequest} ListTargetHttpsProxiesRequest instance + */ + ListTargetHttpsProxiesRequest.create = function create(properties) { + return new ListTargetHttpsProxiesRequest(properties); + }; + + /** + * Encodes the specified ListTargetHttpsProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpsProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetHttpsProxiesRequest} message ListTargetHttpsProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetHttpsProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetHttpsProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetHttpsProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetHttpsProxiesRequest} message ListTargetHttpsProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetHttpsProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetHttpsProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetHttpsProxiesRequest} ListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetHttpsProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetHttpsProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetHttpsProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetHttpsProxiesRequest} ListTargetHttpsProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetHttpsProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetHttpsProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetHttpsProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListTargetHttpsProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetHttpsProxiesRequest} ListTargetHttpsProxiesRequest + */ + ListTargetHttpsProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetHttpsProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetHttpsProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListTargetHttpsProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @static + * @param {google.cloud.compute.v1.ListTargetHttpsProxiesRequest} message ListTargetHttpsProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetHttpsProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetHttpsProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetHttpsProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetHttpsProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetHttpsProxiesRequest; + })(); + + v1.PatchTargetHttpsProxyRequest = (function() { + + /** + * Properties of a PatchTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchTargetHttpsProxyRequest + * @property {string|null} [project] PatchTargetHttpsProxyRequest project + * @property {string|null} [requestId] PatchTargetHttpsProxyRequest requestId + * @property {string|null} [targetHttpsProxy] PatchTargetHttpsProxyRequest targetHttpsProxy + * @property {google.cloud.compute.v1.ITargetHttpsProxy|null} [targetHttpsProxyResource] PatchTargetHttpsProxyRequest targetHttpsProxyResource + */ + + /** + * Constructs a new PatchTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchTargetHttpsProxyRequest. + * @implements IPatchTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchTargetHttpsProxyRequest=} [properties] Properties to set + */ + function PatchTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @instance + */ + PatchTargetHttpsProxyRequest.prototype.project = ""; + + /** + * PatchTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @instance + */ + PatchTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * PatchTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @instance + */ + PatchTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + /** + * PatchTargetHttpsProxyRequest targetHttpsProxyResource. + * @member {google.cloud.compute.v1.ITargetHttpsProxy|null|undefined} targetHttpsProxyResource + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @instance + */ + PatchTargetHttpsProxyRequest.prototype.targetHttpsProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(PatchTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchTargetHttpsProxyRequest} PatchTargetHttpsProxyRequest instance + */ + PatchTargetHttpsProxyRequest.create = function create(properties) { + return new PatchTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified PatchTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetHttpsProxyRequest} message PatchTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetHttpsProxyResource != null && Object.hasOwnProperty.call(message, "targetHttpsProxyResource")) + $root.google.cloud.compute.v1.TargetHttpsProxy.encode(message.targetHttpsProxyResource, writer.uint32(/* id 433657473, wireType 2 =*/3469259786).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PatchTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.IPatchTargetHttpsProxyRequest} message PatchTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchTargetHttpsProxyRequest} PatchTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + case 433657473: + message.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchTargetHttpsProxyRequest} PatchTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + if (message.targetHttpsProxyResource != null && message.hasOwnProperty("targetHttpsProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxy.verify(message.targetHttpsProxyResource); + if (error) + return "targetHttpsProxyResource." + error; + } + return null; + }; + + /** + * Creates a PatchTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchTargetHttpsProxyRequest} PatchTargetHttpsProxyRequest + */ + PatchTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + if (object.targetHttpsProxyResource != null) { + if (typeof object.targetHttpsProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchTargetHttpsProxyRequest.targetHttpsProxyResource: object expected"); + message.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.fromObject(object.targetHttpsProxyResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.PatchTargetHttpsProxyRequest} message PatchTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.project = ""; + object.targetHttpsProxyResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetHttpsProxyResource != null && message.hasOwnProperty("targetHttpsProxyResource")) + object.targetHttpsProxyResource = $root.google.cloud.compute.v1.TargetHttpsProxy.toObject(message.targetHttpsProxyResource, options); + return object; + }; + + /** + * Converts this PatchTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + PatchTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchTargetHttpsProxyRequest; + })(); + + v1.SetQuicOverrideTargetHttpsProxyRequest = (function() { + + /** + * Properties of a SetQuicOverrideTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetQuicOverrideTargetHttpsProxyRequest + * @property {string|null} [project] SetQuicOverrideTargetHttpsProxyRequest project + * @property {string|null} [requestId] SetQuicOverrideTargetHttpsProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest|null} [targetHttpsProxiesSetQuicOverrideRequestResource] SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxiesSetQuicOverrideRequestResource + * @property {string|null} [targetHttpsProxy] SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new SetQuicOverrideTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetQuicOverrideTargetHttpsProxyRequest. + * @implements ISetQuicOverrideTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest=} [properties] Properties to set + */ + function SetQuicOverrideTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetQuicOverrideTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @instance + */ + SetQuicOverrideTargetHttpsProxyRequest.prototype.project = ""; + + /** + * SetQuicOverrideTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @instance + */ + SetQuicOverrideTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxiesSetQuicOverrideRequestResource. + * @member {google.cloud.compute.v1.ITargetHttpsProxiesSetQuicOverrideRequest|null|undefined} targetHttpsProxiesSetQuicOverrideRequestResource + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @instance + */ + SetQuicOverrideTargetHttpsProxyRequest.prototype.targetHttpsProxiesSetQuicOverrideRequestResource = null; + + /** + * SetQuicOverrideTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @instance + */ + SetQuicOverrideTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetQuicOverrideTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(SetQuicOverrideTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetQuicOverrideTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest} SetQuicOverrideTargetHttpsProxyRequest instance + */ + SetQuicOverrideTargetHttpsProxyRequest.create = function create(properties) { + return new SetQuicOverrideTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified SetQuicOverrideTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest} message SetQuicOverrideTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetQuicOverrideTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.targetHttpsProxiesSetQuicOverrideRequestResource != null && Object.hasOwnProperty.call(message, "targetHttpsProxiesSetQuicOverrideRequestResource")) + $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.encode(message.targetHttpsProxiesSetQuicOverrideRequestResource, writer.uint32(/* id 72940258, wireType 2 =*/583522066).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetQuicOverrideTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest} message SetQuicOverrideTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetQuicOverrideTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetQuicOverrideTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest} SetQuicOverrideTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetQuicOverrideTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 72940258: + message.targetHttpsProxiesSetQuicOverrideRequestResource = $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.decode(reader, reader.uint32()); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetQuicOverrideTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest} SetQuicOverrideTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetQuicOverrideTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetQuicOverrideTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetQuicOverrideTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxiesSetQuicOverrideRequestResource != null && message.hasOwnProperty("targetHttpsProxiesSetQuicOverrideRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.verify(message.targetHttpsProxiesSetQuicOverrideRequestResource); + if (error) + return "targetHttpsProxiesSetQuicOverrideRequestResource." + error; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a SetQuicOverrideTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest} SetQuicOverrideTargetHttpsProxyRequest + */ + SetQuicOverrideTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxiesSetQuicOverrideRequestResource != null) { + if (typeof object.targetHttpsProxiesSetQuicOverrideRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest.targetHttpsProxiesSetQuicOverrideRequestResource: object expected"); + message.targetHttpsProxiesSetQuicOverrideRequestResource = $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.fromObject(object.targetHttpsProxiesSetQuicOverrideRequestResource); + } + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a SetQuicOverrideTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest} message SetQuicOverrideTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetQuicOverrideTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.targetHttpsProxiesSetQuicOverrideRequestResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.targetHttpsProxiesSetQuicOverrideRequestResource != null && message.hasOwnProperty("targetHttpsProxiesSetQuicOverrideRequestResource")) + object.targetHttpsProxiesSetQuicOverrideRequestResource = $root.google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest.toObject(message.targetHttpsProxiesSetQuicOverrideRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetQuicOverrideTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetQuicOverrideTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetQuicOverrideTargetHttpsProxyRequest; + })(); + + v1.SetSslCertificatesTargetHttpsProxyRequest = (function() { + + /** + * Properties of a SetSslCertificatesTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetSslCertificatesTargetHttpsProxyRequest + * @property {string|null} [project] SetSslCertificatesTargetHttpsProxyRequest project + * @property {string|null} [requestId] SetSslCertificatesTargetHttpsProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest|null} [targetHttpsProxiesSetSslCertificatesRequestResource] SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxiesSetSslCertificatesRequestResource + * @property {string|null} [targetHttpsProxy] SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new SetSslCertificatesTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetSslCertificatesTargetHttpsProxyRequest. + * @implements ISetSslCertificatesTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest=} [properties] Properties to set + */ + function SetSslCertificatesTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetSslCertificatesTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesTargetHttpsProxyRequest.prototype.project = ""; + + /** + * SetSslCertificatesTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxiesSetSslCertificatesRequestResource. + * @member {google.cloud.compute.v1.ITargetHttpsProxiesSetSslCertificatesRequest|null|undefined} targetHttpsProxiesSetSslCertificatesRequestResource + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesTargetHttpsProxyRequest.prototype.targetHttpsProxiesSetSslCertificatesRequestResource = null; + + /** + * SetSslCertificatesTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @instance + */ + SetSslCertificatesTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetSslCertificatesTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(SetSslCertificatesTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetSslCertificatesTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest} SetSslCertificatesTargetHttpsProxyRequest instance + */ + SetSslCertificatesTargetHttpsProxyRequest.create = function create(properties) { + return new SetSslCertificatesTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified SetSslCertificatesTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest} message SetSslCertificatesTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslCertificatesTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.targetHttpsProxiesSetSslCertificatesRequestResource != null && Object.hasOwnProperty.call(message, "targetHttpsProxiesSetSslCertificatesRequestResource")) + $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.encode(message.targetHttpsProxiesSetSslCertificatesRequestResource, writer.uint32(/* id 223122908, wireType 2 =*/1784983266).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified SetSslCertificatesTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest} message SetSslCertificatesTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslCertificatesTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetSslCertificatesTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest} SetSslCertificatesTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslCertificatesTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 223122908: + message.targetHttpsProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.decode(reader, reader.uint32()); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetSslCertificatesTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest} SetSslCertificatesTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslCertificatesTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetSslCertificatesTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetSslCertificatesTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxiesSetSslCertificatesRequestResource != null && message.hasOwnProperty("targetHttpsProxiesSetSslCertificatesRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.verify(message.targetHttpsProxiesSetSslCertificatesRequestResource); + if (error) + return "targetHttpsProxiesSetSslCertificatesRequestResource." + error; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a SetSslCertificatesTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest} SetSslCertificatesTargetHttpsProxyRequest + */ + SetSslCertificatesTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxiesSetSslCertificatesRequestResource != null) { + if (typeof object.targetHttpsProxiesSetSslCertificatesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest.targetHttpsProxiesSetSslCertificatesRequestResource: object expected"); + message.targetHttpsProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.fromObject(object.targetHttpsProxiesSetSslCertificatesRequestResource); + } + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a SetSslCertificatesTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest} message SetSslCertificatesTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetSslCertificatesTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.targetHttpsProxiesSetSslCertificatesRequestResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.targetHttpsProxiesSetSslCertificatesRequestResource != null && message.hasOwnProperty("targetHttpsProxiesSetSslCertificatesRequestResource")) + object.targetHttpsProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest.toObject(message.targetHttpsProxiesSetSslCertificatesRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this SetSslCertificatesTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetSslCertificatesTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetSslCertificatesTargetHttpsProxyRequest; + })(); + + v1.SetSslPolicyTargetHttpsProxyRequest = (function() { + + /** + * Properties of a SetSslPolicyTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetSslPolicyTargetHttpsProxyRequest + * @property {string|null} [project] SetSslPolicyTargetHttpsProxyRequest project + * @property {string|null} [requestId] SetSslPolicyTargetHttpsProxyRequest requestId + * @property {google.cloud.compute.v1.ISslPolicyReference|null} [sslPolicyReferenceResource] SetSslPolicyTargetHttpsProxyRequest sslPolicyReferenceResource + * @property {string|null} [targetHttpsProxy] SetSslPolicyTargetHttpsProxyRequest targetHttpsProxy + */ + + /** + * Constructs a new SetSslPolicyTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetSslPolicyTargetHttpsProxyRequest. + * @implements ISetSslPolicyTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest=} [properties] Properties to set + */ + function SetSslPolicyTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetSslPolicyTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @instance + */ + SetSslPolicyTargetHttpsProxyRequest.prototype.project = ""; + + /** + * SetSslPolicyTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @instance + */ + SetSslPolicyTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * SetSslPolicyTargetHttpsProxyRequest sslPolicyReferenceResource. + * @member {google.cloud.compute.v1.ISslPolicyReference|null|undefined} sslPolicyReferenceResource + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @instance + */ + SetSslPolicyTargetHttpsProxyRequest.prototype.sslPolicyReferenceResource = null; + + /** + * SetSslPolicyTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @instance + */ + SetSslPolicyTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetSslPolicyTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(SetSslPolicyTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetSslPolicyTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest} SetSslPolicyTargetHttpsProxyRequest instance + */ + SetSslPolicyTargetHttpsProxyRequest.create = function create(properties) { + return new SetSslPolicyTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified SetSslPolicyTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest} message SetSslPolicyTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslPolicyTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.sslPolicyReferenceResource != null && Object.hasOwnProperty.call(message, "sslPolicyReferenceResource")) + $root.google.cloud.compute.v1.SslPolicyReference.encode(message.sslPolicyReferenceResource, writer.uint32(/* id 235403836, wireType 2 =*/1883230690).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetSslPolicyTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest} message SetSslPolicyTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslPolicyTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetSslPolicyTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest} SetSslPolicyTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslPolicyTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 235403836: + message.sslPolicyReferenceResource = $root.google.cloud.compute.v1.SslPolicyReference.decode(reader, reader.uint32()); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetSslPolicyTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest} SetSslPolicyTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslPolicyTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetSslPolicyTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetSslPolicyTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslPolicyReferenceResource != null && message.hasOwnProperty("sslPolicyReferenceResource")) { + var error = $root.google.cloud.compute.v1.SslPolicyReference.verify(message.sslPolicyReferenceResource); + if (error) + return "sslPolicyReferenceResource." + error; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + return null; + }; + + /** + * Creates a SetSslPolicyTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest} SetSslPolicyTargetHttpsProxyRequest + */ + SetSslPolicyTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslPolicyReferenceResource != null) { + if (typeof object.sslPolicyReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest.sslPolicyReferenceResource: object expected"); + message.sslPolicyReferenceResource = $root.google.cloud.compute.v1.SslPolicyReference.fromObject(object.sslPolicyReferenceResource); + } + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + return message; + }; + + /** + * Creates a plain object from a SetSslPolicyTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest} message SetSslPolicyTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetSslPolicyTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.project = ""; + object.sslPolicyReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.sslPolicyReferenceResource != null && message.hasOwnProperty("sslPolicyReferenceResource")) + object.sslPolicyReferenceResource = $root.google.cloud.compute.v1.SslPolicyReference.toObject(message.sslPolicyReferenceResource, options); + return object; + }; + + /** + * Converts this SetSslPolicyTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetSslPolicyTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetSslPolicyTargetHttpsProxyRequest; + })(); + + v1.SetUrlMapTargetHttpsProxyRequest = (function() { + + /** + * Properties of a SetUrlMapTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetUrlMapTargetHttpsProxyRequest + * @property {string|null} [project] SetUrlMapTargetHttpsProxyRequest project + * @property {string|null} [requestId] SetUrlMapTargetHttpsProxyRequest requestId + * @property {string|null} [targetHttpsProxy] SetUrlMapTargetHttpsProxyRequest targetHttpsProxy + * @property {google.cloud.compute.v1.IUrlMapReference|null} [urlMapReferenceResource] SetUrlMapTargetHttpsProxyRequest urlMapReferenceResource + */ + + /** + * Constructs a new SetUrlMapTargetHttpsProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetUrlMapTargetHttpsProxyRequest. + * @implements ISetUrlMapTargetHttpsProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest=} [properties] Properties to set + */ + function SetUrlMapTargetHttpsProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetUrlMapTargetHttpsProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @instance + */ + SetUrlMapTargetHttpsProxyRequest.prototype.project = ""; + + /** + * SetUrlMapTargetHttpsProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @instance + */ + SetUrlMapTargetHttpsProxyRequest.prototype.requestId = null; + + /** + * SetUrlMapTargetHttpsProxyRequest targetHttpsProxy. + * @member {string} targetHttpsProxy + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @instance + */ + SetUrlMapTargetHttpsProxyRequest.prototype.targetHttpsProxy = ""; + + /** + * SetUrlMapTargetHttpsProxyRequest urlMapReferenceResource. + * @member {google.cloud.compute.v1.IUrlMapReference|null|undefined} urlMapReferenceResource + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @instance + */ + SetUrlMapTargetHttpsProxyRequest.prototype.urlMapReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetUrlMapTargetHttpsProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @instance + */ + Object.defineProperty(SetUrlMapTargetHttpsProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetUrlMapTargetHttpsProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest} SetUrlMapTargetHttpsProxyRequest instance + */ + SetUrlMapTargetHttpsProxyRequest.create = function create(properties) { + return new SetUrlMapTargetHttpsProxyRequest(properties); + }; + + /** + * Encodes the specified SetUrlMapTargetHttpsProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest} message SetUrlMapTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapTargetHttpsProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetHttpsProxy != null && Object.hasOwnProperty.call(message, "targetHttpsProxy")) + writer.uint32(/* id 52336748, wireType 2 =*/418693986).string(message.targetHttpsProxy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMapReferenceResource != null && Object.hasOwnProperty.call(message, "urlMapReferenceResource")) + $root.google.cloud.compute.v1.UrlMapReference.encode(message.urlMapReferenceResource, writer.uint32(/* id 398701333, wireType 2 =*/3189610666).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetUrlMapTargetHttpsProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest} message SetUrlMapTargetHttpsProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetUrlMapTargetHttpsProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetUrlMapTargetHttpsProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest} SetUrlMapTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapTargetHttpsProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 52336748: + message.targetHttpsProxy = reader.string(); + break; + case 398701333: + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetUrlMapTargetHttpsProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest} SetUrlMapTargetHttpsProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetUrlMapTargetHttpsProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetUrlMapTargetHttpsProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetUrlMapTargetHttpsProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + if (!$util.isString(message.targetHttpsProxy)) + return "targetHttpsProxy: string expected"; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) { + var error = $root.google.cloud.compute.v1.UrlMapReference.verify(message.urlMapReferenceResource); + if (error) + return "urlMapReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetUrlMapTargetHttpsProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest} SetUrlMapTargetHttpsProxyRequest + */ + SetUrlMapTargetHttpsProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetHttpsProxy != null) + message.targetHttpsProxy = String(object.targetHttpsProxy); + if (object.urlMapReferenceResource != null) { + if (typeof object.urlMapReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest.urlMapReferenceResource: object expected"); + message.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.fromObject(object.urlMapReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetUrlMapTargetHttpsProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @static + * @param {google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest} message SetUrlMapTargetHttpsProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetUrlMapTargetHttpsProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetHttpsProxy = ""; + object.project = ""; + object.urlMapReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetHttpsProxy != null && message.hasOwnProperty("targetHttpsProxy")) + object.targetHttpsProxy = message.targetHttpsProxy; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMapReferenceResource != null && message.hasOwnProperty("urlMapReferenceResource")) + object.urlMapReferenceResource = $root.google.cloud.compute.v1.UrlMapReference.toObject(message.urlMapReferenceResource, options); + return object; + }; + + /** + * Converts this SetUrlMapTargetHttpsProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetUrlMapTargetHttpsProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetUrlMapTargetHttpsProxyRequest; + })(); + + v1.AggregatedListTargetInstancesRequest = (function() { + + /** + * Properties of an AggregatedListTargetInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListTargetInstancesRequest + * @property {string|null} [filter] AggregatedListTargetInstancesRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListTargetInstancesRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListTargetInstancesRequest maxResults + * @property {string|null} [orderBy] AggregatedListTargetInstancesRequest orderBy + * @property {string|null} [pageToken] AggregatedListTargetInstancesRequest pageToken + * @property {string|null} [project] AggregatedListTargetInstancesRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListTargetInstancesRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListTargetInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListTargetInstancesRequest. + * @implements IAggregatedListTargetInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListTargetInstancesRequest=} [properties] Properties to set + */ + function AggregatedListTargetInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListTargetInstancesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + AggregatedListTargetInstancesRequest.prototype.filter = null; + + /** + * AggregatedListTargetInstancesRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + AggregatedListTargetInstancesRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListTargetInstancesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + AggregatedListTargetInstancesRequest.prototype.maxResults = null; + + /** + * AggregatedListTargetInstancesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + AggregatedListTargetInstancesRequest.prototype.orderBy = null; + + /** + * AggregatedListTargetInstancesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + AggregatedListTargetInstancesRequest.prototype.pageToken = null; + + /** + * AggregatedListTargetInstancesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + AggregatedListTargetInstancesRequest.prototype.project = ""; + + /** + * AggregatedListTargetInstancesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + AggregatedListTargetInstancesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListTargetInstancesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetInstancesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetInstancesRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetInstancesRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetInstancesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetInstancesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetInstancesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetInstancesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetInstancesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetInstancesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetInstancesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetInstancesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListTargetInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListTargetInstancesRequest} AggregatedListTargetInstancesRequest instance + */ + AggregatedListTargetInstancesRequest.create = function create(properties) { + return new AggregatedListTargetInstancesRequest(properties); + }; + + /** + * Encodes the specified AggregatedListTargetInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetInstancesRequest} message AggregatedListTargetInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListTargetInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetInstancesRequest} message AggregatedListTargetInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListTargetInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListTargetInstancesRequest} AggregatedListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListTargetInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListTargetInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListTargetInstancesRequest} AggregatedListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListTargetInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListTargetInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListTargetInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListTargetInstancesRequest} AggregatedListTargetInstancesRequest + */ + AggregatedListTargetInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListTargetInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListTargetInstancesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListTargetInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListTargetInstancesRequest} message AggregatedListTargetInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListTargetInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListTargetInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListTargetInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListTargetInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListTargetInstancesRequest; + })(); + + v1.DeleteTargetInstanceRequest = (function() { + + /** + * Properties of a DeleteTargetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetInstanceRequest + * @property {string|null} [project] DeleteTargetInstanceRequest project + * @property {string|null} [requestId] DeleteTargetInstanceRequest requestId + * @property {string|null} [targetInstance] DeleteTargetInstanceRequest targetInstance + * @property {string|null} [zone] DeleteTargetInstanceRequest zone + */ + + /** + * Constructs a new DeleteTargetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetInstanceRequest. + * @implements IDeleteTargetInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetInstanceRequest=} [properties] Properties to set + */ + function DeleteTargetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @instance + */ + DeleteTargetInstanceRequest.prototype.project = ""; + + /** + * DeleteTargetInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @instance + */ + DeleteTargetInstanceRequest.prototype.requestId = null; + + /** + * DeleteTargetInstanceRequest targetInstance. + * @member {string} targetInstance + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @instance + */ + DeleteTargetInstanceRequest.prototype.targetInstance = ""; + + /** + * DeleteTargetInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @instance + */ + DeleteTargetInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @instance + */ + Object.defineProperty(DeleteTargetInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetInstanceRequest} DeleteTargetInstanceRequest instance + */ + DeleteTargetInstanceRequest.create = function create(properties) { + return new DeleteTargetInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetInstanceRequest} message DeleteTargetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) + writer.uint32(/* id 289769347, wireType 2 =*/2318154778).string(message.targetInstance); + return writer; + }; + + /** + * Encodes the specified DeleteTargetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetInstanceRequest} message DeleteTargetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetInstanceRequest} DeleteTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 289769347: + message.targetInstance = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetInstanceRequest} DeleteTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) + if (!$util.isString(message.targetInstance)) + return "targetInstance: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetInstanceRequest} DeleteTargetInstanceRequest + */ + DeleteTargetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetInstanceRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetInstance != null) + message.targetInstance = String(object.targetInstance); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetInstanceRequest} message DeleteTargetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.targetInstance = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) + object.targetInstance = message.targetInstance; + return object; + }; + + /** + * Converts this DeleteTargetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetInstanceRequest; + })(); + + v1.GetTargetInstanceRequest = (function() { + + /** + * Properties of a GetTargetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetInstanceRequest + * @property {string|null} [project] GetTargetInstanceRequest project + * @property {string|null} [targetInstance] GetTargetInstanceRequest targetInstance + * @property {string|null} [zone] GetTargetInstanceRequest zone + */ + + /** + * Constructs a new GetTargetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetInstanceRequest. + * @implements IGetTargetInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetInstanceRequest=} [properties] Properties to set + */ + function GetTargetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @instance + */ + GetTargetInstanceRequest.prototype.project = ""; + + /** + * GetTargetInstanceRequest targetInstance. + * @member {string} targetInstance + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @instance + */ + GetTargetInstanceRequest.prototype.targetInstance = ""; + + /** + * GetTargetInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @instance + */ + GetTargetInstanceRequest.prototype.zone = ""; + + /** + * Creates a new GetTargetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetInstanceRequest} GetTargetInstanceRequest instance + */ + GetTargetInstanceRequest.create = function create(properties) { + return new GetTargetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetTargetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetInstanceRequest} message GetTargetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetInstance != null && Object.hasOwnProperty.call(message, "targetInstance")) + writer.uint32(/* id 289769347, wireType 2 =*/2318154778).string(message.targetInstance); + return writer; + }; + + /** + * Encodes the specified GetTargetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetInstanceRequest} message GetTargetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetInstanceRequest} GetTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 289769347: + message.targetInstance = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetInstanceRequest} GetTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) + if (!$util.isString(message.targetInstance)) + return "targetInstance: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetTargetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetInstanceRequest} GetTargetInstanceRequest + */ + GetTargetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetInstanceRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.targetInstance != null) + message.targetInstance = String(object.targetInstance); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetTargetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.GetTargetInstanceRequest} message GetTargetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.targetInstance = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetInstance != null && message.hasOwnProperty("targetInstance")) + object.targetInstance = message.targetInstance; + return object; + }; + + /** + * Converts this GetTargetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetInstanceRequest; + })(); + + v1.InsertTargetInstanceRequest = (function() { + + /** + * Properties of an InsertTargetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetInstanceRequest + * @property {string|null} [project] InsertTargetInstanceRequest project + * @property {string|null} [requestId] InsertTargetInstanceRequest requestId + * @property {google.cloud.compute.v1.ITargetInstance|null} [targetInstanceResource] InsertTargetInstanceRequest targetInstanceResource + * @property {string|null} [zone] InsertTargetInstanceRequest zone + */ + + /** + * Constructs a new InsertTargetInstanceRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetInstanceRequest. + * @implements IInsertTargetInstanceRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetInstanceRequest=} [properties] Properties to set + */ + function InsertTargetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetInstanceRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @instance + */ + InsertTargetInstanceRequest.prototype.project = ""; + + /** + * InsertTargetInstanceRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @instance + */ + InsertTargetInstanceRequest.prototype.requestId = null; + + /** + * InsertTargetInstanceRequest targetInstanceResource. + * @member {google.cloud.compute.v1.ITargetInstance|null|undefined} targetInstanceResource + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @instance + */ + InsertTargetInstanceRequest.prototype.targetInstanceResource = null; + + /** + * InsertTargetInstanceRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @instance + */ + InsertTargetInstanceRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetInstanceRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @instance + */ + Object.defineProperty(InsertTargetInstanceRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetInstanceRequest} InsertTargetInstanceRequest instance + */ + InsertTargetInstanceRequest.create = function create(properties) { + return new InsertTargetInstanceRequest(properties); + }; + + /** + * Encodes the specified InsertTargetInstanceRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetInstanceRequest} message InsertTargetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetInstanceResource != null && Object.hasOwnProperty.call(message, "targetInstanceResource")) + $root.google.cloud.compute.v1.TargetInstance.encode(message.targetInstanceResource, writer.uint32(/* id 430453066, wireType 2 =*/3443624530).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InsertTargetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetInstanceRequest} message InsertTargetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetInstanceRequest} InsertTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetInstanceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 430453066: + message.targetInstanceResource = $root.google.cloud.compute.v1.TargetInstance.decode(reader, reader.uint32()); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetInstanceRequest} InsertTargetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetInstanceRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetInstanceResource != null && message.hasOwnProperty("targetInstanceResource")) { + var error = $root.google.cloud.compute.v1.TargetInstance.verify(message.targetInstanceResource); + if (error) + return "targetInstanceResource." + error; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates an InsertTargetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetInstanceRequest} InsertTargetInstanceRequest + */ + InsertTargetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetInstanceRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetInstanceRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetInstanceResource != null) { + if (typeof object.targetInstanceResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetInstanceRequest.targetInstanceResource: object expected"); + message.targetInstanceResource = $root.google.cloud.compute.v1.TargetInstance.fromObject(object.targetInstanceResource); + } + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from an InsertTargetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetInstanceRequest} message InsertTargetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + object.targetInstanceResource = null; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetInstanceResource != null && message.hasOwnProperty("targetInstanceResource")) + object.targetInstanceResource = $root.google.cloud.compute.v1.TargetInstance.toObject(message.targetInstanceResource, options); + return object; + }; + + /** + * Converts this InsertTargetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetInstanceRequest; + })(); + + v1.ListTargetInstancesRequest = (function() { + + /** + * Properties of a ListTargetInstancesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetInstancesRequest + * @property {string|null} [filter] ListTargetInstancesRequest filter + * @property {number|null} [maxResults] ListTargetInstancesRequest maxResults + * @property {string|null} [orderBy] ListTargetInstancesRequest orderBy + * @property {string|null} [pageToken] ListTargetInstancesRequest pageToken + * @property {string|null} [project] ListTargetInstancesRequest project + * @property {boolean|null} [returnPartialSuccess] ListTargetInstancesRequest returnPartialSuccess + * @property {string|null} [zone] ListTargetInstancesRequest zone + */ + + /** + * Constructs a new ListTargetInstancesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetInstancesRequest. + * @implements IListTargetInstancesRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetInstancesRequest=} [properties] Properties to set + */ + function ListTargetInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetInstancesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + ListTargetInstancesRequest.prototype.filter = null; + + /** + * ListTargetInstancesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + ListTargetInstancesRequest.prototype.maxResults = null; + + /** + * ListTargetInstancesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + ListTargetInstancesRequest.prototype.orderBy = null; + + /** + * ListTargetInstancesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + ListTargetInstancesRequest.prototype.pageToken = null; + + /** + * ListTargetInstancesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + ListTargetInstancesRequest.prototype.project = ""; + + /** + * ListTargetInstancesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + ListTargetInstancesRequest.prototype.returnPartialSuccess = null; + + /** + * ListTargetInstancesRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + ListTargetInstancesRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetInstancesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + Object.defineProperty(ListTargetInstancesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetInstancesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + Object.defineProperty(ListTargetInstancesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetInstancesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + Object.defineProperty(ListTargetInstancesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetInstancesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + Object.defineProperty(ListTargetInstancesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetInstancesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + */ + Object.defineProperty(ListTargetInstancesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetInstancesRequest} ListTargetInstancesRequest instance + */ + ListTargetInstancesRequest.create = function create(properties) { + return new ListTargetInstancesRequest(properties); + }; + + /** + * Encodes the specified ListTargetInstancesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetInstancesRequest} message ListTargetInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetInstancesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetInstancesRequest} message ListTargetInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetInstancesRequest} ListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetInstancesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetInstancesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetInstancesRequest} ListTargetInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetInstancesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetInstancesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListTargetInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetInstancesRequest} ListTargetInstancesRequest + */ + ListTargetInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetInstancesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetInstancesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListTargetInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @static + * @param {google.cloud.compute.v1.ListTargetInstancesRequest} message ListTargetInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetInstancesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetInstancesRequest; + })(); + + v1.AddHealthCheckTargetPoolRequest = (function() { + + /** + * Properties of an AddHealthCheckTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddHealthCheckTargetPoolRequest + * @property {string|null} [project] AddHealthCheckTargetPoolRequest project + * @property {string|null} [region] AddHealthCheckTargetPoolRequest region + * @property {string|null} [requestId] AddHealthCheckTargetPoolRequest requestId + * @property {string|null} [targetPool] AddHealthCheckTargetPoolRequest targetPool + * @property {google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest|null} [targetPoolsAddHealthCheckRequestResource] AddHealthCheckTargetPoolRequest targetPoolsAddHealthCheckRequestResource + */ + + /** + * Constructs a new AddHealthCheckTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddHealthCheckTargetPoolRequest. + * @implements IAddHealthCheckTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest=} [properties] Properties to set + */ + function AddHealthCheckTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddHealthCheckTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @instance + */ + AddHealthCheckTargetPoolRequest.prototype.project = ""; + + /** + * AddHealthCheckTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @instance + */ + AddHealthCheckTargetPoolRequest.prototype.region = ""; + + /** + * AddHealthCheckTargetPoolRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @instance + */ + AddHealthCheckTargetPoolRequest.prototype.requestId = null; + + /** + * AddHealthCheckTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @instance + */ + AddHealthCheckTargetPoolRequest.prototype.targetPool = ""; + + /** + * AddHealthCheckTargetPoolRequest targetPoolsAddHealthCheckRequestResource. + * @member {google.cloud.compute.v1.ITargetPoolsAddHealthCheckRequest|null|undefined} targetPoolsAddHealthCheckRequestResource + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @instance + */ + AddHealthCheckTargetPoolRequest.prototype.targetPoolsAddHealthCheckRequestResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddHealthCheckTargetPoolRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @instance + */ + Object.defineProperty(AddHealthCheckTargetPoolRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddHealthCheckTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddHealthCheckTargetPoolRequest} AddHealthCheckTargetPoolRequest instance + */ + AddHealthCheckTargetPoolRequest.create = function create(properties) { + return new AddHealthCheckTargetPoolRequest(properties); + }; + + /** + * Encodes the specified AddHealthCheckTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.AddHealthCheckTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest} message AddHealthCheckTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddHealthCheckTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetPoolsAddHealthCheckRequestResource != null && Object.hasOwnProperty.call(message, "targetPoolsAddHealthCheckRequestResource")) + $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.encode(message.targetPoolsAddHealthCheckRequestResource, writer.uint32(/* id 269573412, wireType 2 =*/2156587298).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddHealthCheckTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddHealthCheckTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest} message AddHealthCheckTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddHealthCheckTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddHealthCheckTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddHealthCheckTargetPoolRequest} AddHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddHealthCheckTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddHealthCheckTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + case 269573412: + message.targetPoolsAddHealthCheckRequestResource = $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddHealthCheckTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddHealthCheckTargetPoolRequest} AddHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddHealthCheckTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddHealthCheckTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddHealthCheckTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + if (message.targetPoolsAddHealthCheckRequestResource != null && message.hasOwnProperty("targetPoolsAddHealthCheckRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.verify(message.targetPoolsAddHealthCheckRequestResource); + if (error) + return "targetPoolsAddHealthCheckRequestResource." + error; + } + return null; + }; + + /** + * Creates an AddHealthCheckTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddHealthCheckTargetPoolRequest} AddHealthCheckTargetPoolRequest + */ + AddHealthCheckTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddHealthCheckTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddHealthCheckTargetPoolRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + if (object.targetPoolsAddHealthCheckRequestResource != null) { + if (typeof object.targetPoolsAddHealthCheckRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddHealthCheckTargetPoolRequest.targetPoolsAddHealthCheckRequestResource: object expected"); + message.targetPoolsAddHealthCheckRequestResource = $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.fromObject(object.targetPoolsAddHealthCheckRequestResource); + } + return message; + }; + + /** + * Creates a plain object from an AddHealthCheckTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.AddHealthCheckTargetPoolRequest} message AddHealthCheckTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddHealthCheckTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPool = ""; + object.region = ""; + object.project = ""; + object.targetPoolsAddHealthCheckRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetPoolsAddHealthCheckRequestResource != null && message.hasOwnProperty("targetPoolsAddHealthCheckRequestResource")) + object.targetPoolsAddHealthCheckRequestResource = $root.google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest.toObject(message.targetPoolsAddHealthCheckRequestResource, options); + return object; + }; + + /** + * Converts this AddHealthCheckTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddHealthCheckTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + AddHealthCheckTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddHealthCheckTargetPoolRequest; + })(); + + v1.AddInstanceTargetPoolRequest = (function() { + + /** + * Properties of an AddInstanceTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IAddInstanceTargetPoolRequest + * @property {string|null} [project] AddInstanceTargetPoolRequest project + * @property {string|null} [region] AddInstanceTargetPoolRequest region + * @property {string|null} [requestId] AddInstanceTargetPoolRequest requestId + * @property {string|null} [targetPool] AddInstanceTargetPoolRequest targetPool + * @property {google.cloud.compute.v1.ITargetPoolsAddInstanceRequest|null} [targetPoolsAddInstanceRequestResource] AddInstanceTargetPoolRequest targetPoolsAddInstanceRequestResource + */ + + /** + * Constructs a new AddInstanceTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AddInstanceTargetPoolRequest. + * @implements IAddInstanceTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IAddInstanceTargetPoolRequest=} [properties] Properties to set + */ + function AddInstanceTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddInstanceTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @instance + */ + AddInstanceTargetPoolRequest.prototype.project = ""; + + /** + * AddInstanceTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @instance + */ + AddInstanceTargetPoolRequest.prototype.region = ""; + + /** + * AddInstanceTargetPoolRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @instance + */ + AddInstanceTargetPoolRequest.prototype.requestId = null; + + /** + * AddInstanceTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @instance + */ + AddInstanceTargetPoolRequest.prototype.targetPool = ""; + + /** + * AddInstanceTargetPoolRequest targetPoolsAddInstanceRequestResource. + * @member {google.cloud.compute.v1.ITargetPoolsAddInstanceRequest|null|undefined} targetPoolsAddInstanceRequestResource + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @instance + */ + AddInstanceTargetPoolRequest.prototype.targetPoolsAddInstanceRequestResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AddInstanceTargetPoolRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @instance + */ + Object.defineProperty(AddInstanceTargetPoolRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AddInstanceTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IAddInstanceTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AddInstanceTargetPoolRequest} AddInstanceTargetPoolRequest instance + */ + AddInstanceTargetPoolRequest.create = function create(properties) { + return new AddInstanceTargetPoolRequest(properties); + }; + + /** + * Encodes the specified AddInstanceTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.AddInstanceTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IAddInstanceTargetPoolRequest} message AddInstanceTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddInstanceTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetPoolsAddInstanceRequestResource != null && Object.hasOwnProperty.call(message, "targetPoolsAddInstanceRequestResource")) + $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest.encode(message.targetPoolsAddInstanceRequestResource, writer.uint32(/* id 428796404, wireType 2 =*/3430371234).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddInstanceTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddInstanceTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IAddInstanceTargetPoolRequest} message AddInstanceTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddInstanceTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddInstanceTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AddInstanceTargetPoolRequest} AddInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddInstanceTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AddInstanceTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + case 428796404: + message.targetPoolsAddInstanceRequestResource = $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddInstanceTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AddInstanceTargetPoolRequest} AddInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddInstanceTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddInstanceTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddInstanceTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + if (message.targetPoolsAddInstanceRequestResource != null && message.hasOwnProperty("targetPoolsAddInstanceRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest.verify(message.targetPoolsAddInstanceRequestResource); + if (error) + return "targetPoolsAddInstanceRequestResource." + error; + } + return null; + }; + + /** + * Creates an AddInstanceTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AddInstanceTargetPoolRequest} AddInstanceTargetPoolRequest + */ + AddInstanceTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AddInstanceTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.AddInstanceTargetPoolRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + if (object.targetPoolsAddInstanceRequestResource != null) { + if (typeof object.targetPoolsAddInstanceRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.AddInstanceTargetPoolRequest.targetPoolsAddInstanceRequestResource: object expected"); + message.targetPoolsAddInstanceRequestResource = $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest.fromObject(object.targetPoolsAddInstanceRequestResource); + } + return message; + }; + + /** + * Creates a plain object from an AddInstanceTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.AddInstanceTargetPoolRequest} message AddInstanceTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddInstanceTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPool = ""; + object.region = ""; + object.project = ""; + object.targetPoolsAddInstanceRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetPoolsAddInstanceRequestResource != null && message.hasOwnProperty("targetPoolsAddInstanceRequestResource")) + object.targetPoolsAddInstanceRequestResource = $root.google.cloud.compute.v1.TargetPoolsAddInstanceRequest.toObject(message.targetPoolsAddInstanceRequestResource, options); + return object; + }; + + /** + * Converts this AddInstanceTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AddInstanceTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + AddInstanceTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddInstanceTargetPoolRequest; + })(); + + v1.AggregatedListTargetPoolsRequest = (function() { + + /** + * Properties of an AggregatedListTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListTargetPoolsRequest + * @property {string|null} [filter] AggregatedListTargetPoolsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListTargetPoolsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListTargetPoolsRequest maxResults + * @property {string|null} [orderBy] AggregatedListTargetPoolsRequest orderBy + * @property {string|null} [pageToken] AggregatedListTargetPoolsRequest pageToken + * @property {string|null} [project] AggregatedListTargetPoolsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListTargetPoolsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListTargetPoolsRequest. + * @implements IAggregatedListTargetPoolsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListTargetPoolsRequest=} [properties] Properties to set + */ + function AggregatedListTargetPoolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListTargetPoolsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + AggregatedListTargetPoolsRequest.prototype.filter = null; + + /** + * AggregatedListTargetPoolsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + AggregatedListTargetPoolsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListTargetPoolsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + AggregatedListTargetPoolsRequest.prototype.maxResults = null; + + /** + * AggregatedListTargetPoolsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + AggregatedListTargetPoolsRequest.prototype.orderBy = null; + + /** + * AggregatedListTargetPoolsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + AggregatedListTargetPoolsRequest.prototype.pageToken = null; + + /** + * AggregatedListTargetPoolsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + AggregatedListTargetPoolsRequest.prototype.project = ""; + + /** + * AggregatedListTargetPoolsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + AggregatedListTargetPoolsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListTargetPoolsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetPoolsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetPoolsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetPoolsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetPoolsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetPoolsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetPoolsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetPoolsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetPoolsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetPoolsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetPoolsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetPoolsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListTargetPoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetPoolsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListTargetPoolsRequest} AggregatedListTargetPoolsRequest instance + */ + AggregatedListTargetPoolsRequest.create = function create(properties) { + return new AggregatedListTargetPoolsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetPoolsRequest} message AggregatedListTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetPoolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetPoolsRequest} message AggregatedListTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListTargetPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListTargetPoolsRequest} AggregatedListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetPoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListTargetPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListTargetPoolsRequest} AggregatedListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListTargetPoolsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListTargetPoolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListTargetPoolsRequest} AggregatedListTargetPoolsRequest + */ + AggregatedListTargetPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListTargetPoolsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListTargetPoolsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListTargetPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListTargetPoolsRequest} message AggregatedListTargetPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListTargetPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListTargetPoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListTargetPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListTargetPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListTargetPoolsRequest; + })(); + + v1.DeleteTargetPoolRequest = (function() { + + /** + * Properties of a DeleteTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetPoolRequest + * @property {string|null} [project] DeleteTargetPoolRequest project + * @property {string|null} [region] DeleteTargetPoolRequest region + * @property {string|null} [requestId] DeleteTargetPoolRequest requestId + * @property {string|null} [targetPool] DeleteTargetPoolRequest targetPool + */ + + /** + * Constructs a new DeleteTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetPoolRequest. + * @implements IDeleteTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetPoolRequest=} [properties] Properties to set + */ + function DeleteTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @instance + */ + DeleteTargetPoolRequest.prototype.project = ""; + + /** + * DeleteTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @instance + */ + DeleteTargetPoolRequest.prototype.region = ""; + + /** + * DeleteTargetPoolRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @instance + */ + DeleteTargetPoolRequest.prototype.requestId = null; + + /** + * DeleteTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @instance + */ + DeleteTargetPoolRequest.prototype.targetPool = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetPoolRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @instance + */ + Object.defineProperty(DeleteTargetPoolRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetPoolRequest} DeleteTargetPoolRequest instance + */ + DeleteTargetPoolRequest.create = function create(properties) { + return new DeleteTargetPoolRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetPoolRequest} message DeleteTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetPoolRequest} message DeleteTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetPoolRequest} DeleteTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetPoolRequest} DeleteTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetPoolRequest} DeleteTargetPoolRequest + */ + DeleteTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetPoolRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetPoolRequest} message DeleteTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPool = ""; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetPoolRequest; + })(); + + v1.GetTargetPoolRequest = (function() { + + /** + * Properties of a GetTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetPoolRequest + * @property {string|null} [project] GetTargetPoolRequest project + * @property {string|null} [region] GetTargetPoolRequest region + * @property {string|null} [targetPool] GetTargetPoolRequest targetPool + */ + + /** + * Constructs a new GetTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetPoolRequest. + * @implements IGetTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetPoolRequest=} [properties] Properties to set + */ + function GetTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @instance + */ + GetTargetPoolRequest.prototype.project = ""; + + /** + * GetTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @instance + */ + GetTargetPoolRequest.prototype.region = ""; + + /** + * GetTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @instance + */ + GetTargetPoolRequest.prototype.targetPool = ""; + + /** + * Creates a new GetTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetPoolRequest} GetTargetPoolRequest instance + */ + GetTargetPoolRequest.create = function create(properties) { + return new GetTargetPoolRequest(properties); + }; + + /** + * Encodes the specified GetTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetPoolRequest} message GetTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetPoolRequest} message GetTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetPoolRequest} GetTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetPoolRequest} GetTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + return null; + }; + + /** + * Creates a GetTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetPoolRequest} GetTargetPoolRequest + */ + GetTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetPoolRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + return message; + }; + + /** + * Creates a plain object from a GetTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.GetTargetPoolRequest} message GetTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPool = ""; + object.region = ""; + object.project = ""; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetPoolRequest; + })(); + + v1.GetHealthTargetPoolRequest = (function() { + + /** + * Properties of a GetHealthTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetHealthTargetPoolRequest + * @property {google.cloud.compute.v1.IInstanceReference|null} [instanceReferenceResource] GetHealthTargetPoolRequest instanceReferenceResource + * @property {string|null} [project] GetHealthTargetPoolRequest project + * @property {string|null} [region] GetHealthTargetPoolRequest region + * @property {string|null} [targetPool] GetHealthTargetPoolRequest targetPool + */ + + /** + * Constructs a new GetHealthTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetHealthTargetPoolRequest. + * @implements IGetHealthTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IGetHealthTargetPoolRequest=} [properties] Properties to set + */ + function GetHealthTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetHealthTargetPoolRequest instanceReferenceResource. + * @member {google.cloud.compute.v1.IInstanceReference|null|undefined} instanceReferenceResource + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @instance + */ + GetHealthTargetPoolRequest.prototype.instanceReferenceResource = null; + + /** + * GetHealthTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @instance + */ + GetHealthTargetPoolRequest.prototype.project = ""; + + /** + * GetHealthTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @instance + */ + GetHealthTargetPoolRequest.prototype.region = ""; + + /** + * GetHealthTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @instance + */ + GetHealthTargetPoolRequest.prototype.targetPool = ""; + + /** + * Creates a new GetHealthTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetHealthTargetPoolRequest} GetHealthTargetPoolRequest instance + */ + GetHealthTargetPoolRequest.create = function create(properties) { + return new GetHealthTargetPoolRequest(properties); + }; + + /** + * Encodes the specified GetHealthTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.GetHealthTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthTargetPoolRequest} message GetHealthTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.instanceReferenceResource != null && Object.hasOwnProperty.call(message, "instanceReferenceResource")) + $root.google.cloud.compute.v1.InstanceReference.encode(message.instanceReferenceResource, writer.uint32(/* id 292926060, wireType 2 =*/2343408482).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetHealthTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetHealthTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IGetHealthTargetPoolRequest} message GetHealthTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHealthTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHealthTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetHealthTargetPoolRequest} GetHealthTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetHealthTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 292926060: + message.instanceReferenceResource = $root.google.cloud.compute.v1.InstanceReference.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetHealthTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetHealthTargetPoolRequest} GetHealthTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHealthTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHealthTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHealthTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceReferenceResource != null && message.hasOwnProperty("instanceReferenceResource")) { + var error = $root.google.cloud.compute.v1.InstanceReference.verify(message.instanceReferenceResource); + if (error) + return "instanceReferenceResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + return null; + }; + + /** + * Creates a GetHealthTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetHealthTargetPoolRequest} GetHealthTargetPoolRequest + */ + GetHealthTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetHealthTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetHealthTargetPoolRequest(); + if (object.instanceReferenceResource != null) { + if (typeof object.instanceReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.GetHealthTargetPoolRequest.instanceReferenceResource: object expected"); + message.instanceReferenceResource = $root.google.cloud.compute.v1.InstanceReference.fromObject(object.instanceReferenceResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + return message; + }; + + /** + * Creates a plain object from a GetHealthTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.GetHealthTargetPoolRequest} message GetHealthTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHealthTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPool = ""; + object.region = ""; + object.project = ""; + object.instanceReferenceResource = null; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.instanceReferenceResource != null && message.hasOwnProperty("instanceReferenceResource")) + object.instanceReferenceResource = $root.google.cloud.compute.v1.InstanceReference.toObject(message.instanceReferenceResource, options); + return object; + }; + + /** + * Converts this GetHealthTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetHealthTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetHealthTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetHealthTargetPoolRequest; + })(); + + v1.InsertTargetPoolRequest = (function() { + + /** + * Properties of an InsertTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetPoolRequest + * @property {string|null} [project] InsertTargetPoolRequest project + * @property {string|null} [region] InsertTargetPoolRequest region + * @property {string|null} [requestId] InsertTargetPoolRequest requestId + * @property {google.cloud.compute.v1.ITargetPool|null} [targetPoolResource] InsertTargetPoolRequest targetPoolResource + */ + + /** + * Constructs a new InsertTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetPoolRequest. + * @implements IInsertTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetPoolRequest=} [properties] Properties to set + */ + function InsertTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @instance + */ + InsertTargetPoolRequest.prototype.project = ""; + + /** + * InsertTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @instance + */ + InsertTargetPoolRequest.prototype.region = ""; + + /** + * InsertTargetPoolRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @instance + */ + InsertTargetPoolRequest.prototype.requestId = null; + + /** + * InsertTargetPoolRequest targetPoolResource. + * @member {google.cloud.compute.v1.ITargetPool|null|undefined} targetPoolResource + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @instance + */ + InsertTargetPoolRequest.prototype.targetPoolResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetPoolRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @instance + */ + Object.defineProperty(InsertTargetPoolRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetPoolRequest} InsertTargetPoolRequest instance + */ + InsertTargetPoolRequest.create = function create(properties) { + return new InsertTargetPoolRequest(properties); + }; + + /** + * Encodes the specified InsertTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetPoolRequest} message InsertTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetPoolResource != null && Object.hasOwnProperty.call(message, "targetPoolResource")) + $root.google.cloud.compute.v1.TargetPool.encode(message.targetPoolResource, writer.uint32(/* id 101281443, wireType 2 =*/810251546).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetPoolRequest} message InsertTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetPoolRequest} InsertTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 101281443: + message.targetPoolResource = $root.google.cloud.compute.v1.TargetPool.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetPoolRequest} InsertTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetPoolResource != null && message.hasOwnProperty("targetPoolResource")) { + var error = $root.google.cloud.compute.v1.TargetPool.verify(message.targetPoolResource); + if (error) + return "targetPoolResource." + error; + } + return null; + }; + + /** + * Creates an InsertTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetPoolRequest} InsertTargetPoolRequest + */ + InsertTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetPoolRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetPoolResource != null) { + if (typeof object.targetPoolResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetPoolRequest.targetPoolResource: object expected"); + message.targetPoolResource = $root.google.cloud.compute.v1.TargetPool.fromObject(object.targetPoolResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetPoolRequest} message InsertTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPoolResource = null; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetPoolResource != null && message.hasOwnProperty("targetPoolResource")) + object.targetPoolResource = $root.google.cloud.compute.v1.TargetPool.toObject(message.targetPoolResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetPoolRequest; + })(); + + v1.ListTargetPoolsRequest = (function() { + + /** + * Properties of a ListTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetPoolsRequest + * @property {string|null} [filter] ListTargetPoolsRequest filter + * @property {number|null} [maxResults] ListTargetPoolsRequest maxResults + * @property {string|null} [orderBy] ListTargetPoolsRequest orderBy + * @property {string|null} [pageToken] ListTargetPoolsRequest pageToken + * @property {string|null} [project] ListTargetPoolsRequest project + * @property {string|null} [region] ListTargetPoolsRequest region + * @property {boolean|null} [returnPartialSuccess] ListTargetPoolsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListTargetPoolsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetPoolsRequest. + * @implements IListTargetPoolsRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetPoolsRequest=} [properties] Properties to set + */ + function ListTargetPoolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetPoolsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + ListTargetPoolsRequest.prototype.filter = null; + + /** + * ListTargetPoolsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + ListTargetPoolsRequest.prototype.maxResults = null; + + /** + * ListTargetPoolsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + ListTargetPoolsRequest.prototype.orderBy = null; + + /** + * ListTargetPoolsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + ListTargetPoolsRequest.prototype.pageToken = null; + + /** + * ListTargetPoolsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + ListTargetPoolsRequest.prototype.project = ""; + + /** + * ListTargetPoolsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + ListTargetPoolsRequest.prototype.region = ""; + + /** + * ListTargetPoolsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + ListTargetPoolsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetPoolsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + Object.defineProperty(ListTargetPoolsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetPoolsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + Object.defineProperty(ListTargetPoolsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetPoolsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + Object.defineProperty(ListTargetPoolsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetPoolsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + Object.defineProperty(ListTargetPoolsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetPoolsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + */ + Object.defineProperty(ListTargetPoolsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetPoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IListTargetPoolsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetPoolsRequest} ListTargetPoolsRequest instance + */ + ListTargetPoolsRequest.create = function create(properties) { + return new ListTargetPoolsRequest(properties); + }; + + /** + * Encodes the specified ListTargetPoolsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IListTargetPoolsRequest} message ListTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetPoolsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.IListTargetPoolsRequest} message ListTargetPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetPoolsRequest} ListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetPoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetPoolsRequest} ListTargetPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetPoolsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetPoolsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListTargetPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetPoolsRequest} ListTargetPoolsRequest + */ + ListTargetPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetPoolsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetPoolsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListTargetPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @static + * @param {google.cloud.compute.v1.ListTargetPoolsRequest} message ListTargetPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetPoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetPoolsRequest; + })(); + + v1.RemoveHealthCheckTargetPoolRequest = (function() { + + /** + * Properties of a RemoveHealthCheckTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveHealthCheckTargetPoolRequest + * @property {string|null} [project] RemoveHealthCheckTargetPoolRequest project + * @property {string|null} [region] RemoveHealthCheckTargetPoolRequest region + * @property {string|null} [requestId] RemoveHealthCheckTargetPoolRequest requestId + * @property {string|null} [targetPool] RemoveHealthCheckTargetPoolRequest targetPool + * @property {google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest|null} [targetPoolsRemoveHealthCheckRequestResource] RemoveHealthCheckTargetPoolRequest targetPoolsRemoveHealthCheckRequestResource + */ + + /** + * Constructs a new RemoveHealthCheckTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveHealthCheckTargetPoolRequest. + * @implements IRemoveHealthCheckTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest=} [properties] Properties to set + */ + function RemoveHealthCheckTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveHealthCheckTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @instance + */ + RemoveHealthCheckTargetPoolRequest.prototype.project = ""; + + /** + * RemoveHealthCheckTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @instance + */ + RemoveHealthCheckTargetPoolRequest.prototype.region = ""; + + /** + * RemoveHealthCheckTargetPoolRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @instance + */ + RemoveHealthCheckTargetPoolRequest.prototype.requestId = null; + + /** + * RemoveHealthCheckTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @instance + */ + RemoveHealthCheckTargetPoolRequest.prototype.targetPool = ""; + + /** + * RemoveHealthCheckTargetPoolRequest targetPoolsRemoveHealthCheckRequestResource. + * @member {google.cloud.compute.v1.ITargetPoolsRemoveHealthCheckRequest|null|undefined} targetPoolsRemoveHealthCheckRequestResource + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @instance + */ + RemoveHealthCheckTargetPoolRequest.prototype.targetPoolsRemoveHealthCheckRequestResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveHealthCheckTargetPoolRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @instance + */ + Object.defineProperty(RemoveHealthCheckTargetPoolRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveHealthCheckTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest} RemoveHealthCheckTargetPoolRequest instance + */ + RemoveHealthCheckTargetPoolRequest.create = function create(properties) { + return new RemoveHealthCheckTargetPoolRequest(properties); + }; + + /** + * Encodes the specified RemoveHealthCheckTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest} message RemoveHealthCheckTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveHealthCheckTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetPoolsRemoveHealthCheckRequestResource != null && Object.hasOwnProperty.call(message, "targetPoolsRemoveHealthCheckRequestResource")) + $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.encode(message.targetPoolsRemoveHealthCheckRequestResource, writer.uint32(/* id 304985011, wireType 2 =*/2439880090).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RemoveHealthCheckTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest} message RemoveHealthCheckTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveHealthCheckTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveHealthCheckTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest} RemoveHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveHealthCheckTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + case 304985011: + message.targetPoolsRemoveHealthCheckRequestResource = $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveHealthCheckTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest} RemoveHealthCheckTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveHealthCheckTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveHealthCheckTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveHealthCheckTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + if (message.targetPoolsRemoveHealthCheckRequestResource != null && message.hasOwnProperty("targetPoolsRemoveHealthCheckRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.verify(message.targetPoolsRemoveHealthCheckRequestResource); + if (error) + return "targetPoolsRemoveHealthCheckRequestResource." + error; + } + return null; + }; + + /** + * Creates a RemoveHealthCheckTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest} RemoveHealthCheckTargetPoolRequest + */ + RemoveHealthCheckTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + if (object.targetPoolsRemoveHealthCheckRequestResource != null) { + if (typeof object.targetPoolsRemoveHealthCheckRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest.targetPoolsRemoveHealthCheckRequestResource: object expected"); + message.targetPoolsRemoveHealthCheckRequestResource = $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.fromObject(object.targetPoolsRemoveHealthCheckRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a RemoveHealthCheckTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest} message RemoveHealthCheckTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveHealthCheckTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPool = ""; + object.region = ""; + object.project = ""; + object.targetPoolsRemoveHealthCheckRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetPoolsRemoveHealthCheckRequestResource != null && message.hasOwnProperty("targetPoolsRemoveHealthCheckRequestResource")) + object.targetPoolsRemoveHealthCheckRequestResource = $root.google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest.toObject(message.targetPoolsRemoveHealthCheckRequestResource, options); + return object; + }; + + /** + * Converts this RemoveHealthCheckTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveHealthCheckTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveHealthCheckTargetPoolRequest; + })(); + + v1.RemoveInstanceTargetPoolRequest = (function() { + + /** + * Properties of a RemoveInstanceTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface IRemoveInstanceTargetPoolRequest + * @property {string|null} [project] RemoveInstanceTargetPoolRequest project + * @property {string|null} [region] RemoveInstanceTargetPoolRequest region + * @property {string|null} [requestId] RemoveInstanceTargetPoolRequest requestId + * @property {string|null} [targetPool] RemoveInstanceTargetPoolRequest targetPool + * @property {google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest|null} [targetPoolsRemoveInstanceRequestResource] RemoveInstanceTargetPoolRequest targetPoolsRemoveInstanceRequestResource + */ + + /** + * Constructs a new RemoveInstanceTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RemoveInstanceTargetPoolRequest. + * @implements IRemoveInstanceTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest=} [properties] Properties to set + */ + function RemoveInstanceTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveInstanceTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @instance + */ + RemoveInstanceTargetPoolRequest.prototype.project = ""; + + /** + * RemoveInstanceTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @instance + */ + RemoveInstanceTargetPoolRequest.prototype.region = ""; + + /** + * RemoveInstanceTargetPoolRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @instance + */ + RemoveInstanceTargetPoolRequest.prototype.requestId = null; + + /** + * RemoveInstanceTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @instance + */ + RemoveInstanceTargetPoolRequest.prototype.targetPool = ""; + + /** + * RemoveInstanceTargetPoolRequest targetPoolsRemoveInstanceRequestResource. + * @member {google.cloud.compute.v1.ITargetPoolsRemoveInstanceRequest|null|undefined} targetPoolsRemoveInstanceRequestResource + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @instance + */ + RemoveInstanceTargetPoolRequest.prototype.targetPoolsRemoveInstanceRequestResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RemoveInstanceTargetPoolRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @instance + */ + Object.defineProperty(RemoveInstanceTargetPoolRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RemoveInstanceTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.RemoveInstanceTargetPoolRequest} RemoveInstanceTargetPoolRequest instance + */ + RemoveInstanceTargetPoolRequest.create = function create(properties) { + return new RemoveInstanceTargetPoolRequest(properties); + }; + + /** + * Encodes the specified RemoveInstanceTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.RemoveInstanceTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest} message RemoveInstanceTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveInstanceTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetPoolsRemoveInstanceRequestResource != null && Object.hasOwnProperty.call(message, "targetPoolsRemoveInstanceRequestResource")) + $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.encode(message.targetPoolsRemoveInstanceRequestResource, writer.uint32(/* id 29548547, wireType 2 =*/236388378).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified RemoveInstanceTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemoveInstanceTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest} message RemoveInstanceTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveInstanceTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveInstanceTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.RemoveInstanceTargetPoolRequest} RemoveInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveInstanceTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.RemoveInstanceTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + case 29548547: + message.targetPoolsRemoveInstanceRequestResource = $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveInstanceTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.RemoveInstanceTargetPoolRequest} RemoveInstanceTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveInstanceTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveInstanceTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveInstanceTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + if (message.targetPoolsRemoveInstanceRequestResource != null && message.hasOwnProperty("targetPoolsRemoveInstanceRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.verify(message.targetPoolsRemoveInstanceRequestResource); + if (error) + return "targetPoolsRemoveInstanceRequestResource." + error; + } + return null; + }; + + /** + * Creates a RemoveInstanceTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.RemoveInstanceTargetPoolRequest} RemoveInstanceTargetPoolRequest + */ + RemoveInstanceTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.RemoveInstanceTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.RemoveInstanceTargetPoolRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + if (object.targetPoolsRemoveInstanceRequestResource != null) { + if (typeof object.targetPoolsRemoveInstanceRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.RemoveInstanceTargetPoolRequest.targetPoolsRemoveInstanceRequestResource: object expected"); + message.targetPoolsRemoveInstanceRequestResource = $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.fromObject(object.targetPoolsRemoveInstanceRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a RemoveInstanceTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.RemoveInstanceTargetPoolRequest} message RemoveInstanceTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveInstanceTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPoolsRemoveInstanceRequestResource = null; + object.targetPool = ""; + object.region = ""; + object.project = ""; + } + if (message.targetPoolsRemoveInstanceRequestResource != null && message.hasOwnProperty("targetPoolsRemoveInstanceRequestResource")) + object.targetPoolsRemoveInstanceRequestResource = $root.google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest.toObject(message.targetPoolsRemoveInstanceRequestResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this RemoveInstanceTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.RemoveInstanceTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveInstanceTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveInstanceTargetPoolRequest; + })(); + + v1.SetBackupTargetPoolRequest = (function() { + + /** + * Properties of a SetBackupTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetBackupTargetPoolRequest + * @property {number|null} [failoverRatio] SetBackupTargetPoolRequest failoverRatio + * @property {string|null} [project] SetBackupTargetPoolRequest project + * @property {string|null} [region] SetBackupTargetPoolRequest region + * @property {string|null} [requestId] SetBackupTargetPoolRequest requestId + * @property {string|null} [targetPool] SetBackupTargetPoolRequest targetPool + * @property {google.cloud.compute.v1.ITargetReference|null} [targetReferenceResource] SetBackupTargetPoolRequest targetReferenceResource + */ + + /** + * Constructs a new SetBackupTargetPoolRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetBackupTargetPoolRequest. + * @implements ISetBackupTargetPoolRequest + * @constructor + * @param {google.cloud.compute.v1.ISetBackupTargetPoolRequest=} [properties] Properties to set + */ + function SetBackupTargetPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetBackupTargetPoolRequest failoverRatio. + * @member {number|null|undefined} failoverRatio + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + SetBackupTargetPoolRequest.prototype.failoverRatio = null; + + /** + * SetBackupTargetPoolRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + SetBackupTargetPoolRequest.prototype.project = ""; + + /** + * SetBackupTargetPoolRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + SetBackupTargetPoolRequest.prototype.region = ""; + + /** + * SetBackupTargetPoolRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + SetBackupTargetPoolRequest.prototype.requestId = null; + + /** + * SetBackupTargetPoolRequest targetPool. + * @member {string} targetPool + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + SetBackupTargetPoolRequest.prototype.targetPool = ""; + + /** + * SetBackupTargetPoolRequest targetReferenceResource. + * @member {google.cloud.compute.v1.ITargetReference|null|undefined} targetReferenceResource + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + SetBackupTargetPoolRequest.prototype.targetReferenceResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetBackupTargetPoolRequest _failoverRatio. + * @member {"failoverRatio"|undefined} _failoverRatio + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + Object.defineProperty(SetBackupTargetPoolRequest.prototype, "_failoverRatio", { + get: $util.oneOfGetter($oneOfFields = ["failoverRatio"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SetBackupTargetPoolRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + */ + Object.defineProperty(SetBackupTargetPoolRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetBackupTargetPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.ISetBackupTargetPoolRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetBackupTargetPoolRequest} SetBackupTargetPoolRequest instance + */ + SetBackupTargetPoolRequest.create = function create(properties) { + return new SetBackupTargetPoolRequest(properties); + }; + + /** + * Encodes the specified SetBackupTargetPoolRequest message. Does not implicitly {@link google.cloud.compute.v1.SetBackupTargetPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.ISetBackupTargetPoolRequest} message SetBackupTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetBackupTargetPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetPool != null && Object.hasOwnProperty.call(message, "targetPool")) + writer.uint32(/* id 62796298, wireType 2 =*/502370386).string(message.targetPool); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.failoverRatio != null && Object.hasOwnProperty.call(message, "failoverRatio")) + writer.uint32(/* id 212667006, wireType 5 =*/1701336053).float(message.failoverRatio); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetReferenceResource != null && Object.hasOwnProperty.call(message, "targetReferenceResource")) + $root.google.cloud.compute.v1.TargetReference.encode(message.targetReferenceResource, writer.uint32(/* id 523721712, wireType 2 =*/4189773698).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetBackupTargetPoolRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetBackupTargetPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.ISetBackupTargetPoolRequest} message SetBackupTargetPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetBackupTargetPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetBackupTargetPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetBackupTargetPoolRequest} SetBackupTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetBackupTargetPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetBackupTargetPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 212667006: + message.failoverRatio = reader.float(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 62796298: + message.targetPool = reader.string(); + break; + case 523721712: + message.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetBackupTargetPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetBackupTargetPoolRequest} SetBackupTargetPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetBackupTargetPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetBackupTargetPoolRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetBackupTargetPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.failoverRatio != null && message.hasOwnProperty("failoverRatio")) { + properties._failoverRatio = 1; + if (typeof message.failoverRatio !== "number") + return "failoverRatio: number expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + if (!$util.isString(message.targetPool)) + return "targetPool: string expected"; + if (message.targetReferenceResource != null && message.hasOwnProperty("targetReferenceResource")) { + var error = $root.google.cloud.compute.v1.TargetReference.verify(message.targetReferenceResource); + if (error) + return "targetReferenceResource." + error; + } + return null; + }; + + /** + * Creates a SetBackupTargetPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetBackupTargetPoolRequest} SetBackupTargetPoolRequest + */ + SetBackupTargetPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetBackupTargetPoolRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetBackupTargetPoolRequest(); + if (object.failoverRatio != null) + message.failoverRatio = Number(object.failoverRatio); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetPool != null) + message.targetPool = String(object.targetPool); + if (object.targetReferenceResource != null) { + if (typeof object.targetReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetBackupTargetPoolRequest.targetReferenceResource: object expected"); + message.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.fromObject(object.targetReferenceResource); + } + return message; + }; + + /** + * Creates a plain object from a SetBackupTargetPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @static + * @param {google.cloud.compute.v1.SetBackupTargetPoolRequest} message SetBackupTargetPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetBackupTargetPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetPool = ""; + object.region = ""; + object.project = ""; + object.targetReferenceResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetPool != null && message.hasOwnProperty("targetPool")) + object.targetPool = message.targetPool; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.failoverRatio != null && message.hasOwnProperty("failoverRatio")) { + object.failoverRatio = options.json && !isFinite(message.failoverRatio) ? String(message.failoverRatio) : message.failoverRatio; + if (options.oneofs) + object._failoverRatio = "failoverRatio"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetReferenceResource != null && message.hasOwnProperty("targetReferenceResource")) + object.targetReferenceResource = $root.google.cloud.compute.v1.TargetReference.toObject(message.targetReferenceResource, options); + return object; + }; + + /** + * Converts this SetBackupTargetPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetBackupTargetPoolRequest + * @instance + * @returns {Object.} JSON object + */ + SetBackupTargetPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetBackupTargetPoolRequest; + })(); + + v1.DeleteTargetSslProxyRequest = (function() { + + /** + * Properties of a DeleteTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetSslProxyRequest + * @property {string|null} [project] DeleteTargetSslProxyRequest project + * @property {string|null} [requestId] DeleteTargetSslProxyRequest requestId + * @property {string|null} [targetSslProxy] DeleteTargetSslProxyRequest targetSslProxy + */ + + /** + * Constructs a new DeleteTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetSslProxyRequest. + * @implements IDeleteTargetSslProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetSslProxyRequest=} [properties] Properties to set + */ + function DeleteTargetSslProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetSslProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @instance + */ + DeleteTargetSslProxyRequest.prototype.project = ""; + + /** + * DeleteTargetSslProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @instance + */ + DeleteTargetSslProxyRequest.prototype.requestId = null; + + /** + * DeleteTargetSslProxyRequest targetSslProxy. + * @member {string} targetSslProxy + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @instance + */ + DeleteTargetSslProxyRequest.prototype.targetSslProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetSslProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @instance + */ + Object.defineProperty(DeleteTargetSslProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetSslProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetSslProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetSslProxyRequest} DeleteTargetSslProxyRequest instance + */ + DeleteTargetSslProxyRequest.create = function create(properties) { + return new DeleteTargetSslProxyRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetSslProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetSslProxyRequest} message DeleteTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetSslProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetSslProxy != null && Object.hasOwnProperty.call(message, "targetSslProxy")) + writer.uint32(/* id 338795853, wireType 2 =*/2710366826).string(message.targetSslProxy); + return writer; + }; + + /** + * Encodes the specified DeleteTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetSslProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetSslProxyRequest} message DeleteTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetSslProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetSslProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetSslProxyRequest} DeleteTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetSslProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetSslProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 338795853: + message.targetSslProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetSslProxyRequest} DeleteTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetSslProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetSslProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetSslProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + if (!$util.isString(message.targetSslProxy)) + return "targetSslProxy: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetSslProxyRequest} DeleteTargetSslProxyRequest + */ + DeleteTargetSslProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetSslProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetSslProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetSslProxy != null) + message.targetSslProxy = String(object.targetSslProxy); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetSslProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetSslProxyRequest} message DeleteTargetSslProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetSslProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.targetSslProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + object.targetSslProxy = message.targetSslProxy; + return object; + }; + + /** + * Converts this DeleteTargetSslProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetSslProxyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetSslProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetSslProxyRequest; + })(); + + v1.GetTargetSslProxyRequest = (function() { + + /** + * Properties of a GetTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetSslProxyRequest + * @property {string|null} [project] GetTargetSslProxyRequest project + * @property {string|null} [targetSslProxy] GetTargetSslProxyRequest targetSslProxy + */ + + /** + * Constructs a new GetTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetSslProxyRequest. + * @implements IGetTargetSslProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetSslProxyRequest=} [properties] Properties to set + */ + function GetTargetSslProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetSslProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @instance + */ + GetTargetSslProxyRequest.prototype.project = ""; + + /** + * GetTargetSslProxyRequest targetSslProxy. + * @member {string} targetSslProxy + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @instance + */ + GetTargetSslProxyRequest.prototype.targetSslProxy = ""; + + /** + * Creates a new GetTargetSslProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetSslProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetSslProxyRequest} GetTargetSslProxyRequest instance + */ + GetTargetSslProxyRequest.create = function create(properties) { + return new GetTargetSslProxyRequest(properties); + }; + + /** + * Encodes the specified GetTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetSslProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetSslProxyRequest} message GetTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetSslProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetSslProxy != null && Object.hasOwnProperty.call(message, "targetSslProxy")) + writer.uint32(/* id 338795853, wireType 2 =*/2710366826).string(message.targetSslProxy); + return writer; + }; + + /** + * Encodes the specified GetTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetSslProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetSslProxyRequest} message GetTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetSslProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetSslProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetSslProxyRequest} GetTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetSslProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetSslProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 338795853: + message.targetSslProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetSslProxyRequest} GetTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetSslProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetSslProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetSslProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + if (!$util.isString(message.targetSslProxy)) + return "targetSslProxy: string expected"; + return null; + }; + + /** + * Creates a GetTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetSslProxyRequest} GetTargetSslProxyRequest + */ + GetTargetSslProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetSslProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetSslProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.targetSslProxy != null) + message.targetSslProxy = String(object.targetSslProxy); + return message; + }; + + /** + * Creates a plain object from a GetTargetSslProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.GetTargetSslProxyRequest} message GetTargetSslProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetSslProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.targetSslProxy = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + object.targetSslProxy = message.targetSslProxy; + return object; + }; + + /** + * Converts this GetTargetSslProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetSslProxyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetSslProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetSslProxyRequest; + })(); + + v1.InsertTargetSslProxyRequest = (function() { + + /** + * Properties of an InsertTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetSslProxyRequest + * @property {string|null} [project] InsertTargetSslProxyRequest project + * @property {string|null} [requestId] InsertTargetSslProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetSslProxy|null} [targetSslProxyResource] InsertTargetSslProxyRequest targetSslProxyResource + */ + + /** + * Constructs a new InsertTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetSslProxyRequest. + * @implements IInsertTargetSslProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetSslProxyRequest=} [properties] Properties to set + */ + function InsertTargetSslProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetSslProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @instance + */ + InsertTargetSslProxyRequest.prototype.project = ""; + + /** + * InsertTargetSslProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @instance + */ + InsertTargetSslProxyRequest.prototype.requestId = null; + + /** + * InsertTargetSslProxyRequest targetSslProxyResource. + * @member {google.cloud.compute.v1.ITargetSslProxy|null|undefined} targetSslProxyResource + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @instance + */ + InsertTargetSslProxyRequest.prototype.targetSslProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetSslProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @instance + */ + Object.defineProperty(InsertTargetSslProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetSslProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetSslProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetSslProxyRequest} InsertTargetSslProxyRequest instance + */ + InsertTargetSslProxyRequest.create = function create(properties) { + return new InsertTargetSslProxyRequest(properties); + }; + + /** + * Encodes the specified InsertTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetSslProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetSslProxyRequest} message InsertTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetSslProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetSslProxyResource != null && Object.hasOwnProperty.call(message, "targetSslProxyResource")) + $root.google.cloud.compute.v1.TargetSslProxy.encode(message.targetSslProxyResource, writer.uint32(/* id 142016192, wireType 2 =*/1136129538).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetSslProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetSslProxyRequest} message InsertTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetSslProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetSslProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetSslProxyRequest} InsertTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetSslProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetSslProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 142016192: + message.targetSslProxyResource = $root.google.cloud.compute.v1.TargetSslProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetSslProxyRequest} InsertTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetSslProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetSslProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetSslProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetSslProxyResource != null && message.hasOwnProperty("targetSslProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetSslProxy.verify(message.targetSslProxyResource); + if (error) + return "targetSslProxyResource." + error; + } + return null; + }; + + /** + * Creates an InsertTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetSslProxyRequest} InsertTargetSslProxyRequest + */ + InsertTargetSslProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetSslProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetSslProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetSslProxyResource != null) { + if (typeof object.targetSslProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetSslProxyRequest.targetSslProxyResource: object expected"); + message.targetSslProxyResource = $root.google.cloud.compute.v1.TargetSslProxy.fromObject(object.targetSslProxyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertTargetSslProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetSslProxyRequest} message InsertTargetSslProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetSslProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetSslProxyResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetSslProxyResource != null && message.hasOwnProperty("targetSslProxyResource")) + object.targetSslProxyResource = $root.google.cloud.compute.v1.TargetSslProxy.toObject(message.targetSslProxyResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertTargetSslProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetSslProxyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetSslProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetSslProxyRequest; + })(); + + v1.ListTargetSslProxiesRequest = (function() { + + /** + * Properties of a ListTargetSslProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetSslProxiesRequest + * @property {string|null} [filter] ListTargetSslProxiesRequest filter + * @property {number|null} [maxResults] ListTargetSslProxiesRequest maxResults + * @property {string|null} [orderBy] ListTargetSslProxiesRequest orderBy + * @property {string|null} [pageToken] ListTargetSslProxiesRequest pageToken + * @property {string|null} [project] ListTargetSslProxiesRequest project + * @property {boolean|null} [returnPartialSuccess] ListTargetSslProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListTargetSslProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetSslProxiesRequest. + * @implements IListTargetSslProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetSslProxiesRequest=} [properties] Properties to set + */ + function ListTargetSslProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetSslProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + ListTargetSslProxiesRequest.prototype.filter = null; + + /** + * ListTargetSslProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + ListTargetSslProxiesRequest.prototype.maxResults = null; + + /** + * ListTargetSslProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + ListTargetSslProxiesRequest.prototype.orderBy = null; + + /** + * ListTargetSslProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + ListTargetSslProxiesRequest.prototype.pageToken = null; + + /** + * ListTargetSslProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + ListTargetSslProxiesRequest.prototype.project = ""; + + /** + * ListTargetSslProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + ListTargetSslProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetSslProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetSslProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetSslProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetSslProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetSslProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetSslProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetSslProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetSslProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetSslProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetSslProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetSslProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetSslProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetSslProxiesRequest} ListTargetSslProxiesRequest instance + */ + ListTargetSslProxiesRequest.create = function create(properties) { + return new ListTargetSslProxiesRequest(properties); + }; + + /** + * Encodes the specified ListTargetSslProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetSslProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetSslProxiesRequest} message ListTargetSslProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetSslProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetSslProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetSslProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetSslProxiesRequest} message ListTargetSslProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetSslProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetSslProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetSslProxiesRequest} ListTargetSslProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetSslProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetSslProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetSslProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetSslProxiesRequest} ListTargetSslProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetSslProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetSslProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetSslProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListTargetSslProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetSslProxiesRequest} ListTargetSslProxiesRequest + */ + ListTargetSslProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetSslProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetSslProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListTargetSslProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @static + * @param {google.cloud.compute.v1.ListTargetSslProxiesRequest} message ListTargetSslProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetSslProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetSslProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetSslProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetSslProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetSslProxiesRequest; + })(); + + v1.SetBackendServiceTargetSslProxyRequest = (function() { + + /** + * Properties of a SetBackendServiceTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetBackendServiceTargetSslProxyRequest + * @property {string|null} [project] SetBackendServiceTargetSslProxyRequest project + * @property {string|null} [requestId] SetBackendServiceTargetSslProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest|null} [targetSslProxiesSetBackendServiceRequestResource] SetBackendServiceTargetSslProxyRequest targetSslProxiesSetBackendServiceRequestResource + * @property {string|null} [targetSslProxy] SetBackendServiceTargetSslProxyRequest targetSslProxy + */ + + /** + * Constructs a new SetBackendServiceTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetBackendServiceTargetSslProxyRequest. + * @implements ISetBackendServiceTargetSslProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest=} [properties] Properties to set + */ + function SetBackendServiceTargetSslProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetBackendServiceTargetSslProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @instance + */ + SetBackendServiceTargetSslProxyRequest.prototype.project = ""; + + /** + * SetBackendServiceTargetSslProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @instance + */ + SetBackendServiceTargetSslProxyRequest.prototype.requestId = null; + + /** + * SetBackendServiceTargetSslProxyRequest targetSslProxiesSetBackendServiceRequestResource. + * @member {google.cloud.compute.v1.ITargetSslProxiesSetBackendServiceRequest|null|undefined} targetSslProxiesSetBackendServiceRequestResource + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @instance + */ + SetBackendServiceTargetSslProxyRequest.prototype.targetSslProxiesSetBackendServiceRequestResource = null; + + /** + * SetBackendServiceTargetSslProxyRequest targetSslProxy. + * @member {string} targetSslProxy + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @instance + */ + SetBackendServiceTargetSslProxyRequest.prototype.targetSslProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetBackendServiceTargetSslProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @instance + */ + Object.defineProperty(SetBackendServiceTargetSslProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetBackendServiceTargetSslProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest} SetBackendServiceTargetSslProxyRequest instance + */ + SetBackendServiceTargetSslProxyRequest.create = function create(properties) { + return new SetBackendServiceTargetSslProxyRequest(properties); + }; + + /** + * Encodes the specified SetBackendServiceTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest} message SetBackendServiceTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetBackendServiceTargetSslProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetSslProxiesSetBackendServiceRequestResource != null && Object.hasOwnProperty.call(message, "targetSslProxiesSetBackendServiceRequestResource")) + $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.encode(message.targetSslProxiesSetBackendServiceRequestResource, writer.uint32(/* id 139080868, wireType 2 =*/1112646946).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetSslProxy != null && Object.hasOwnProperty.call(message, "targetSslProxy")) + writer.uint32(/* id 338795853, wireType 2 =*/2710366826).string(message.targetSslProxy); + return writer; + }; + + /** + * Encodes the specified SetBackendServiceTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest} message SetBackendServiceTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetBackendServiceTargetSslProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetBackendServiceTargetSslProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest} SetBackendServiceTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetBackendServiceTargetSslProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 139080868: + message.targetSslProxiesSetBackendServiceRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.decode(reader, reader.uint32()); + break; + case 338795853: + message.targetSslProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetBackendServiceTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest} SetBackendServiceTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetBackendServiceTargetSslProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetBackendServiceTargetSslProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetBackendServiceTargetSslProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetSslProxiesSetBackendServiceRequestResource != null && message.hasOwnProperty("targetSslProxiesSetBackendServiceRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.verify(message.targetSslProxiesSetBackendServiceRequestResource); + if (error) + return "targetSslProxiesSetBackendServiceRequestResource." + error; + } + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + if (!$util.isString(message.targetSslProxy)) + return "targetSslProxy: string expected"; + return null; + }; + + /** + * Creates a SetBackendServiceTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest} SetBackendServiceTargetSslProxyRequest + */ + SetBackendServiceTargetSslProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetSslProxiesSetBackendServiceRequestResource != null) { + if (typeof object.targetSslProxiesSetBackendServiceRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest.targetSslProxiesSetBackendServiceRequestResource: object expected"); + message.targetSslProxiesSetBackendServiceRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.fromObject(object.targetSslProxiesSetBackendServiceRequestResource); + } + if (object.targetSslProxy != null) + message.targetSslProxy = String(object.targetSslProxy); + return message; + }; + + /** + * Creates a plain object from a SetBackendServiceTargetSslProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest} message SetBackendServiceTargetSslProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetBackendServiceTargetSslProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetSslProxiesSetBackendServiceRequestResource = null; + object.project = ""; + object.targetSslProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetSslProxiesSetBackendServiceRequestResource != null && message.hasOwnProperty("targetSslProxiesSetBackendServiceRequestResource")) + object.targetSslProxiesSetBackendServiceRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest.toObject(message.targetSslProxiesSetBackendServiceRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + object.targetSslProxy = message.targetSslProxy; + return object; + }; + + /** + * Converts this SetBackendServiceTargetSslProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetBackendServiceTargetSslProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetBackendServiceTargetSslProxyRequest; + })(); + + v1.SetProxyHeaderTargetSslProxyRequest = (function() { + + /** + * Properties of a SetProxyHeaderTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetProxyHeaderTargetSslProxyRequest + * @property {string|null} [project] SetProxyHeaderTargetSslProxyRequest project + * @property {string|null} [requestId] SetProxyHeaderTargetSslProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest|null} [targetSslProxiesSetProxyHeaderRequestResource] SetProxyHeaderTargetSslProxyRequest targetSslProxiesSetProxyHeaderRequestResource + * @property {string|null} [targetSslProxy] SetProxyHeaderTargetSslProxyRequest targetSslProxy + */ + + /** + * Constructs a new SetProxyHeaderTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetProxyHeaderTargetSslProxyRequest. + * @implements ISetProxyHeaderTargetSslProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest=} [properties] Properties to set + */ + function SetProxyHeaderTargetSslProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetProxyHeaderTargetSslProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @instance + */ + SetProxyHeaderTargetSslProxyRequest.prototype.project = ""; + + /** + * SetProxyHeaderTargetSslProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @instance + */ + SetProxyHeaderTargetSslProxyRequest.prototype.requestId = null; + + /** + * SetProxyHeaderTargetSslProxyRequest targetSslProxiesSetProxyHeaderRequestResource. + * @member {google.cloud.compute.v1.ITargetSslProxiesSetProxyHeaderRequest|null|undefined} targetSslProxiesSetProxyHeaderRequestResource + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @instance + */ + SetProxyHeaderTargetSslProxyRequest.prototype.targetSslProxiesSetProxyHeaderRequestResource = null; + + /** + * SetProxyHeaderTargetSslProxyRequest targetSslProxy. + * @member {string} targetSslProxy + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @instance + */ + SetProxyHeaderTargetSslProxyRequest.prototype.targetSslProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetProxyHeaderTargetSslProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @instance + */ + Object.defineProperty(SetProxyHeaderTargetSslProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetProxyHeaderTargetSslProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest} SetProxyHeaderTargetSslProxyRequest instance + */ + SetProxyHeaderTargetSslProxyRequest.create = function create(properties) { + return new SetProxyHeaderTargetSslProxyRequest(properties); + }; + + /** + * Encodes the specified SetProxyHeaderTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest} message SetProxyHeaderTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetProxyHeaderTargetSslProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetSslProxiesSetProxyHeaderRequestResource != null && Object.hasOwnProperty.call(message, "targetSslProxiesSetProxyHeaderRequestResource")) + $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.encode(message.targetSslProxiesSetProxyHeaderRequestResource, writer.uint32(/* id 205284526, wireType 2 =*/1642276210).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetSslProxy != null && Object.hasOwnProperty.call(message, "targetSslProxy")) + writer.uint32(/* id 338795853, wireType 2 =*/2710366826).string(message.targetSslProxy); + return writer; + }; + + /** + * Encodes the specified SetProxyHeaderTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest} message SetProxyHeaderTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetProxyHeaderTargetSslProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetProxyHeaderTargetSslProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest} SetProxyHeaderTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetProxyHeaderTargetSslProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 205284526: + message.targetSslProxiesSetProxyHeaderRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.decode(reader, reader.uint32()); + break; + case 338795853: + message.targetSslProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetProxyHeaderTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest} SetProxyHeaderTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetProxyHeaderTargetSslProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetProxyHeaderTargetSslProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetProxyHeaderTargetSslProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetSslProxiesSetProxyHeaderRequestResource != null && message.hasOwnProperty("targetSslProxiesSetProxyHeaderRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.verify(message.targetSslProxiesSetProxyHeaderRequestResource); + if (error) + return "targetSslProxiesSetProxyHeaderRequestResource." + error; + } + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + if (!$util.isString(message.targetSslProxy)) + return "targetSslProxy: string expected"; + return null; + }; + + /** + * Creates a SetProxyHeaderTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest} SetProxyHeaderTargetSslProxyRequest + */ + SetProxyHeaderTargetSslProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetSslProxiesSetProxyHeaderRequestResource != null) { + if (typeof object.targetSslProxiesSetProxyHeaderRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest.targetSslProxiesSetProxyHeaderRequestResource: object expected"); + message.targetSslProxiesSetProxyHeaderRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.fromObject(object.targetSslProxiesSetProxyHeaderRequestResource); + } + if (object.targetSslProxy != null) + message.targetSslProxy = String(object.targetSslProxy); + return message; + }; + + /** + * Creates a plain object from a SetProxyHeaderTargetSslProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest} message SetProxyHeaderTargetSslProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetProxyHeaderTargetSslProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetSslProxiesSetProxyHeaderRequestResource = null; + object.project = ""; + object.targetSslProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetSslProxiesSetProxyHeaderRequestResource != null && message.hasOwnProperty("targetSslProxiesSetProxyHeaderRequestResource")) + object.targetSslProxiesSetProxyHeaderRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest.toObject(message.targetSslProxiesSetProxyHeaderRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + object.targetSslProxy = message.targetSslProxy; + return object; + }; + + /** + * Converts this SetProxyHeaderTargetSslProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetProxyHeaderTargetSslProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetProxyHeaderTargetSslProxyRequest; + })(); + + v1.SetSslCertificatesTargetSslProxyRequest = (function() { + + /** + * Properties of a SetSslCertificatesTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetSslCertificatesTargetSslProxyRequest + * @property {string|null} [project] SetSslCertificatesTargetSslProxyRequest project + * @property {string|null} [requestId] SetSslCertificatesTargetSslProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest|null} [targetSslProxiesSetSslCertificatesRequestResource] SetSslCertificatesTargetSslProxyRequest targetSslProxiesSetSslCertificatesRequestResource + * @property {string|null} [targetSslProxy] SetSslCertificatesTargetSslProxyRequest targetSslProxy + */ + + /** + * Constructs a new SetSslCertificatesTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetSslCertificatesTargetSslProxyRequest. + * @implements ISetSslCertificatesTargetSslProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest=} [properties] Properties to set + */ + function SetSslCertificatesTargetSslProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetSslCertificatesTargetSslProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @instance + */ + SetSslCertificatesTargetSslProxyRequest.prototype.project = ""; + + /** + * SetSslCertificatesTargetSslProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @instance + */ + SetSslCertificatesTargetSslProxyRequest.prototype.requestId = null; + + /** + * SetSslCertificatesTargetSslProxyRequest targetSslProxiesSetSslCertificatesRequestResource. + * @member {google.cloud.compute.v1.ITargetSslProxiesSetSslCertificatesRequest|null|undefined} targetSslProxiesSetSslCertificatesRequestResource + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @instance + */ + SetSslCertificatesTargetSslProxyRequest.prototype.targetSslProxiesSetSslCertificatesRequestResource = null; + + /** + * SetSslCertificatesTargetSslProxyRequest targetSslProxy. + * @member {string} targetSslProxy + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @instance + */ + SetSslCertificatesTargetSslProxyRequest.prototype.targetSslProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetSslCertificatesTargetSslProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @instance + */ + Object.defineProperty(SetSslCertificatesTargetSslProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetSslCertificatesTargetSslProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest} SetSslCertificatesTargetSslProxyRequest instance + */ + SetSslCertificatesTargetSslProxyRequest.create = function create(properties) { + return new SetSslCertificatesTargetSslProxyRequest(properties); + }; + + /** + * Encodes the specified SetSslCertificatesTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest} message SetSslCertificatesTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslCertificatesTargetSslProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetSslProxiesSetSslCertificatesRequestResource != null && Object.hasOwnProperty.call(message, "targetSslProxiesSetSslCertificatesRequestResource")) + $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.encode(message.targetSslProxiesSetSslCertificatesRequestResource, writer.uint32(/* id 147940797, wireType 2 =*/1183526378).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetSslProxy != null && Object.hasOwnProperty.call(message, "targetSslProxy")) + writer.uint32(/* id 338795853, wireType 2 =*/2710366826).string(message.targetSslProxy); + return writer; + }; + + /** + * Encodes the specified SetSslCertificatesTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest} message SetSslCertificatesTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslCertificatesTargetSslProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetSslCertificatesTargetSslProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest} SetSslCertificatesTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslCertificatesTargetSslProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 147940797: + message.targetSslProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.decode(reader, reader.uint32()); + break; + case 338795853: + message.targetSslProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetSslCertificatesTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest} SetSslCertificatesTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslCertificatesTargetSslProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetSslCertificatesTargetSslProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetSslCertificatesTargetSslProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetSslProxiesSetSslCertificatesRequestResource != null && message.hasOwnProperty("targetSslProxiesSetSslCertificatesRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.verify(message.targetSslProxiesSetSslCertificatesRequestResource); + if (error) + return "targetSslProxiesSetSslCertificatesRequestResource." + error; + } + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + if (!$util.isString(message.targetSslProxy)) + return "targetSslProxy: string expected"; + return null; + }; + + /** + * Creates a SetSslCertificatesTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest} SetSslCertificatesTargetSslProxyRequest + */ + SetSslCertificatesTargetSslProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetSslProxiesSetSslCertificatesRequestResource != null) { + if (typeof object.targetSslProxiesSetSslCertificatesRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest.targetSslProxiesSetSslCertificatesRequestResource: object expected"); + message.targetSslProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.fromObject(object.targetSslProxiesSetSslCertificatesRequestResource); + } + if (object.targetSslProxy != null) + message.targetSslProxy = String(object.targetSslProxy); + return message; + }; + + /** + * Creates a plain object from a SetSslCertificatesTargetSslProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest} message SetSslCertificatesTargetSslProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetSslCertificatesTargetSslProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetSslProxiesSetSslCertificatesRequestResource = null; + object.project = ""; + object.targetSslProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetSslProxiesSetSslCertificatesRequestResource != null && message.hasOwnProperty("targetSslProxiesSetSslCertificatesRequestResource")) + object.targetSslProxiesSetSslCertificatesRequestResource = $root.google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest.toObject(message.targetSslProxiesSetSslCertificatesRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + object.targetSslProxy = message.targetSslProxy; + return object; + }; + + /** + * Converts this SetSslCertificatesTargetSslProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetSslCertificatesTargetSslProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetSslCertificatesTargetSslProxyRequest; + })(); + + v1.SetSslPolicyTargetSslProxyRequest = (function() { + + /** + * Properties of a SetSslPolicyTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetSslPolicyTargetSslProxyRequest + * @property {string|null} [project] SetSslPolicyTargetSslProxyRequest project + * @property {string|null} [requestId] SetSslPolicyTargetSslProxyRequest requestId + * @property {google.cloud.compute.v1.ISslPolicyReference|null} [sslPolicyReferenceResource] SetSslPolicyTargetSslProxyRequest sslPolicyReferenceResource + * @property {string|null} [targetSslProxy] SetSslPolicyTargetSslProxyRequest targetSslProxy + */ + + /** + * Constructs a new SetSslPolicyTargetSslProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetSslPolicyTargetSslProxyRequest. + * @implements ISetSslPolicyTargetSslProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest=} [properties] Properties to set + */ + function SetSslPolicyTargetSslProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetSslPolicyTargetSslProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @instance + */ + SetSslPolicyTargetSslProxyRequest.prototype.project = ""; + + /** + * SetSslPolicyTargetSslProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @instance + */ + SetSslPolicyTargetSslProxyRequest.prototype.requestId = null; + + /** + * SetSslPolicyTargetSslProxyRequest sslPolicyReferenceResource. + * @member {google.cloud.compute.v1.ISslPolicyReference|null|undefined} sslPolicyReferenceResource + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @instance + */ + SetSslPolicyTargetSslProxyRequest.prototype.sslPolicyReferenceResource = null; + + /** + * SetSslPolicyTargetSslProxyRequest targetSslProxy. + * @member {string} targetSslProxy + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @instance + */ + SetSslPolicyTargetSslProxyRequest.prototype.targetSslProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetSslPolicyTargetSslProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @instance + */ + Object.defineProperty(SetSslPolicyTargetSslProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetSslPolicyTargetSslProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest} SetSslPolicyTargetSslProxyRequest instance + */ + SetSslPolicyTargetSslProxyRequest.create = function create(properties) { + return new SetSslPolicyTargetSslProxyRequest(properties); + }; + + /** + * Encodes the specified SetSslPolicyTargetSslProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest} message SetSslPolicyTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslPolicyTargetSslProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.sslPolicyReferenceResource != null && Object.hasOwnProperty.call(message, "sslPolicyReferenceResource")) + $root.google.cloud.compute.v1.SslPolicyReference.encode(message.sslPolicyReferenceResource, writer.uint32(/* id 235403836, wireType 2 =*/1883230690).fork()).ldelim(); + if (message.targetSslProxy != null && Object.hasOwnProperty.call(message, "targetSslProxy")) + writer.uint32(/* id 338795853, wireType 2 =*/2710366826).string(message.targetSslProxy); + return writer; + }; + + /** + * Encodes the specified SetSslPolicyTargetSslProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest} message SetSslPolicyTargetSslProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetSslPolicyTargetSslProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetSslPolicyTargetSslProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest} SetSslPolicyTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslPolicyTargetSslProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 235403836: + message.sslPolicyReferenceResource = $root.google.cloud.compute.v1.SslPolicyReference.decode(reader, reader.uint32()); + break; + case 338795853: + message.targetSslProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetSslPolicyTargetSslProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest} SetSslPolicyTargetSslProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetSslPolicyTargetSslProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetSslPolicyTargetSslProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetSslPolicyTargetSslProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.sslPolicyReferenceResource != null && message.hasOwnProperty("sslPolicyReferenceResource")) { + var error = $root.google.cloud.compute.v1.SslPolicyReference.verify(message.sslPolicyReferenceResource); + if (error) + return "sslPolicyReferenceResource." + error; + } + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + if (!$util.isString(message.targetSslProxy)) + return "targetSslProxy: string expected"; + return null; + }; + + /** + * Creates a SetSslPolicyTargetSslProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest} SetSslPolicyTargetSslProxyRequest + */ + SetSslPolicyTargetSslProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.sslPolicyReferenceResource != null) { + if (typeof object.sslPolicyReferenceResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest.sslPolicyReferenceResource: object expected"); + message.sslPolicyReferenceResource = $root.google.cloud.compute.v1.SslPolicyReference.fromObject(object.sslPolicyReferenceResource); + } + if (object.targetSslProxy != null) + message.targetSslProxy = String(object.targetSslProxy); + return message; + }; + + /** + * Creates a plain object from a SetSslPolicyTargetSslProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @static + * @param {google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest} message SetSslPolicyTargetSslProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetSslPolicyTargetSslProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.sslPolicyReferenceResource = null; + object.targetSslProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.sslPolicyReferenceResource != null && message.hasOwnProperty("sslPolicyReferenceResource")) + object.sslPolicyReferenceResource = $root.google.cloud.compute.v1.SslPolicyReference.toObject(message.sslPolicyReferenceResource, options); + if (message.targetSslProxy != null && message.hasOwnProperty("targetSslProxy")) + object.targetSslProxy = message.targetSslProxy; + return object; + }; + + /** + * Converts this SetSslPolicyTargetSslProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetSslPolicyTargetSslProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetSslPolicyTargetSslProxyRequest; + })(); + + v1.DeleteTargetTcpProxyRequest = (function() { + + /** + * Properties of a DeleteTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetTcpProxyRequest + * @property {string|null} [project] DeleteTargetTcpProxyRequest project + * @property {string|null} [requestId] DeleteTargetTcpProxyRequest requestId + * @property {string|null} [targetTcpProxy] DeleteTargetTcpProxyRequest targetTcpProxy + */ + + /** + * Constructs a new DeleteTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetTcpProxyRequest. + * @implements IDeleteTargetTcpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetTcpProxyRequest=} [properties] Properties to set + */ + function DeleteTargetTcpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetTcpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @instance + */ + DeleteTargetTcpProxyRequest.prototype.project = ""; + + /** + * DeleteTargetTcpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @instance + */ + DeleteTargetTcpProxyRequest.prototype.requestId = null; + + /** + * DeleteTargetTcpProxyRequest targetTcpProxy. + * @member {string} targetTcpProxy + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @instance + */ + DeleteTargetTcpProxyRequest.prototype.targetTcpProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetTcpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @instance + */ + Object.defineProperty(DeleteTargetTcpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetTcpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetTcpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetTcpProxyRequest} DeleteTargetTcpProxyRequest instance + */ + DeleteTargetTcpProxyRequest.create = function create(properties) { + return new DeleteTargetTcpProxyRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetTcpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetTcpProxyRequest} message DeleteTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetTcpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetTcpProxy != null && Object.hasOwnProperty.call(message, "targetTcpProxy")) + writer.uint32(/* id 503065442, wireType 2 =*/4024523538).string(message.targetTcpProxy); + return writer; + }; + + /** + * Encodes the specified DeleteTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetTcpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetTcpProxyRequest} message DeleteTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetTcpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetTcpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetTcpProxyRequest} DeleteTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetTcpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetTcpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 503065442: + message.targetTcpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetTcpProxyRequest} DeleteTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetTcpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetTcpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetTcpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + if (!$util.isString(message.targetTcpProxy)) + return "targetTcpProxy: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetTcpProxyRequest} DeleteTargetTcpProxyRequest + */ + DeleteTargetTcpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetTcpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetTcpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetTcpProxy != null) + message.targetTcpProxy = String(object.targetTcpProxy); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetTcpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetTcpProxyRequest} message DeleteTargetTcpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetTcpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.targetTcpProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + object.targetTcpProxy = message.targetTcpProxy; + return object; + }; + + /** + * Converts this DeleteTargetTcpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetTcpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetTcpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetTcpProxyRequest; + })(); + + v1.GetTargetTcpProxyRequest = (function() { + + /** + * Properties of a GetTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetTcpProxyRequest + * @property {string|null} [project] GetTargetTcpProxyRequest project + * @property {string|null} [targetTcpProxy] GetTargetTcpProxyRequest targetTcpProxy + */ + + /** + * Constructs a new GetTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetTcpProxyRequest. + * @implements IGetTargetTcpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetTcpProxyRequest=} [properties] Properties to set + */ + function GetTargetTcpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetTcpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @instance + */ + GetTargetTcpProxyRequest.prototype.project = ""; + + /** + * GetTargetTcpProxyRequest targetTcpProxy. + * @member {string} targetTcpProxy + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @instance + */ + GetTargetTcpProxyRequest.prototype.targetTcpProxy = ""; + + /** + * Creates a new GetTargetTcpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetTcpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetTcpProxyRequest} GetTargetTcpProxyRequest instance + */ + GetTargetTcpProxyRequest.create = function create(properties) { + return new GetTargetTcpProxyRequest(properties); + }; + + /** + * Encodes the specified GetTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetTcpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetTcpProxyRequest} message GetTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetTcpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetTcpProxy != null && Object.hasOwnProperty.call(message, "targetTcpProxy")) + writer.uint32(/* id 503065442, wireType 2 =*/4024523538).string(message.targetTcpProxy); + return writer; + }; + + /** + * Encodes the specified GetTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetTcpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetTcpProxyRequest} message GetTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetTcpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetTcpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetTcpProxyRequest} GetTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetTcpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetTcpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 503065442: + message.targetTcpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetTcpProxyRequest} GetTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetTcpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetTcpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetTcpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + if (!$util.isString(message.targetTcpProxy)) + return "targetTcpProxy: string expected"; + return null; + }; + + /** + * Creates a GetTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetTcpProxyRequest} GetTargetTcpProxyRequest + */ + GetTargetTcpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetTcpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetTcpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.targetTcpProxy != null) + message.targetTcpProxy = String(object.targetTcpProxy); + return message; + }; + + /** + * Creates a plain object from a GetTargetTcpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.GetTargetTcpProxyRequest} message GetTargetTcpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetTcpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.targetTcpProxy = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + object.targetTcpProxy = message.targetTcpProxy; + return object; + }; + + /** + * Converts this GetTargetTcpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetTcpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetTcpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetTcpProxyRequest; + })(); + + v1.InsertTargetTcpProxyRequest = (function() { + + /** + * Properties of an InsertTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetTcpProxyRequest + * @property {string|null} [project] InsertTargetTcpProxyRequest project + * @property {string|null} [requestId] InsertTargetTcpProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetTcpProxy|null} [targetTcpProxyResource] InsertTargetTcpProxyRequest targetTcpProxyResource + */ + + /** + * Constructs a new InsertTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetTcpProxyRequest. + * @implements IInsertTargetTcpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetTcpProxyRequest=} [properties] Properties to set + */ + function InsertTargetTcpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetTcpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @instance + */ + InsertTargetTcpProxyRequest.prototype.project = ""; + + /** + * InsertTargetTcpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @instance + */ + InsertTargetTcpProxyRequest.prototype.requestId = null; + + /** + * InsertTargetTcpProxyRequest targetTcpProxyResource. + * @member {google.cloud.compute.v1.ITargetTcpProxy|null|undefined} targetTcpProxyResource + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @instance + */ + InsertTargetTcpProxyRequest.prototype.targetTcpProxyResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetTcpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @instance + */ + Object.defineProperty(InsertTargetTcpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetTcpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetTcpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetTcpProxyRequest} InsertTargetTcpProxyRequest instance + */ + InsertTargetTcpProxyRequest.create = function create(properties) { + return new InsertTargetTcpProxyRequest(properties); + }; + + /** + * Encodes the specified InsertTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetTcpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetTcpProxyRequest} message InsertTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetTcpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetTcpProxyResource != null && Object.hasOwnProperty.call(message, "targetTcpProxyResource")) + $root.google.cloud.compute.v1.TargetTcpProxy.encode(message.targetTcpProxyResource, writer.uint32(/* id 145913931, wireType 2 =*/1167311450).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetTcpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetTcpProxyRequest} message InsertTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetTcpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetTcpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetTcpProxyRequest} InsertTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetTcpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetTcpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 145913931: + message.targetTcpProxyResource = $root.google.cloud.compute.v1.TargetTcpProxy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetTcpProxyRequest} InsertTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetTcpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetTcpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetTcpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetTcpProxyResource != null && message.hasOwnProperty("targetTcpProxyResource")) { + var error = $root.google.cloud.compute.v1.TargetTcpProxy.verify(message.targetTcpProxyResource); + if (error) + return "targetTcpProxyResource." + error; + } + return null; + }; + + /** + * Creates an InsertTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetTcpProxyRequest} InsertTargetTcpProxyRequest + */ + InsertTargetTcpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetTcpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetTcpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetTcpProxyResource != null) { + if (typeof object.targetTcpProxyResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetTcpProxyRequest.targetTcpProxyResource: object expected"); + message.targetTcpProxyResource = $root.google.cloud.compute.v1.TargetTcpProxy.fromObject(object.targetTcpProxyResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertTargetTcpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetTcpProxyRequest} message InsertTargetTcpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetTcpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetTcpProxyResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetTcpProxyResource != null && message.hasOwnProperty("targetTcpProxyResource")) + object.targetTcpProxyResource = $root.google.cloud.compute.v1.TargetTcpProxy.toObject(message.targetTcpProxyResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertTargetTcpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetTcpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetTcpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetTcpProxyRequest; + })(); + + v1.ListTargetTcpProxiesRequest = (function() { + + /** + * Properties of a ListTargetTcpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetTcpProxiesRequest + * @property {string|null} [filter] ListTargetTcpProxiesRequest filter + * @property {number|null} [maxResults] ListTargetTcpProxiesRequest maxResults + * @property {string|null} [orderBy] ListTargetTcpProxiesRequest orderBy + * @property {string|null} [pageToken] ListTargetTcpProxiesRequest pageToken + * @property {string|null} [project] ListTargetTcpProxiesRequest project + * @property {boolean|null} [returnPartialSuccess] ListTargetTcpProxiesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListTargetTcpProxiesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetTcpProxiesRequest. + * @implements IListTargetTcpProxiesRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetTcpProxiesRequest=} [properties] Properties to set + */ + function ListTargetTcpProxiesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetTcpProxiesRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + ListTargetTcpProxiesRequest.prototype.filter = null; + + /** + * ListTargetTcpProxiesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + ListTargetTcpProxiesRequest.prototype.maxResults = null; + + /** + * ListTargetTcpProxiesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + ListTargetTcpProxiesRequest.prototype.orderBy = null; + + /** + * ListTargetTcpProxiesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + ListTargetTcpProxiesRequest.prototype.pageToken = null; + + /** + * ListTargetTcpProxiesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + ListTargetTcpProxiesRequest.prototype.project = ""; + + /** + * ListTargetTcpProxiesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + ListTargetTcpProxiesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetTcpProxiesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetTcpProxiesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetTcpProxiesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetTcpProxiesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetTcpProxiesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetTcpProxiesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetTcpProxiesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetTcpProxiesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetTcpProxiesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + */ + Object.defineProperty(ListTargetTcpProxiesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetTcpProxiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetTcpProxiesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetTcpProxiesRequest} ListTargetTcpProxiesRequest instance + */ + ListTargetTcpProxiesRequest.create = function create(properties) { + return new ListTargetTcpProxiesRequest(properties); + }; + + /** + * Encodes the specified ListTargetTcpProxiesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetTcpProxiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetTcpProxiesRequest} message ListTargetTcpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetTcpProxiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetTcpProxiesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetTcpProxiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {google.cloud.compute.v1.IListTargetTcpProxiesRequest} message ListTargetTcpProxiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetTcpProxiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetTcpProxiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetTcpProxiesRequest} ListTargetTcpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetTcpProxiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetTcpProxiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetTcpProxiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetTcpProxiesRequest} ListTargetTcpProxiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetTcpProxiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetTcpProxiesRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetTcpProxiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListTargetTcpProxiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetTcpProxiesRequest} ListTargetTcpProxiesRequest + */ + ListTargetTcpProxiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetTcpProxiesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetTcpProxiesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListTargetTcpProxiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @static + * @param {google.cloud.compute.v1.ListTargetTcpProxiesRequest} message ListTargetTcpProxiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetTcpProxiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetTcpProxiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetTcpProxiesRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetTcpProxiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetTcpProxiesRequest; + })(); + + v1.SetBackendServiceTargetTcpProxyRequest = (function() { + + /** + * Properties of a SetBackendServiceTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetBackendServiceTargetTcpProxyRequest + * @property {string|null} [project] SetBackendServiceTargetTcpProxyRequest project + * @property {string|null} [requestId] SetBackendServiceTargetTcpProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest|null} [targetTcpProxiesSetBackendServiceRequestResource] SetBackendServiceTargetTcpProxyRequest targetTcpProxiesSetBackendServiceRequestResource + * @property {string|null} [targetTcpProxy] SetBackendServiceTargetTcpProxyRequest targetTcpProxy + */ + + /** + * Constructs a new SetBackendServiceTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetBackendServiceTargetTcpProxyRequest. + * @implements ISetBackendServiceTargetTcpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest=} [properties] Properties to set + */ + function SetBackendServiceTargetTcpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetBackendServiceTargetTcpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @instance + */ + SetBackendServiceTargetTcpProxyRequest.prototype.project = ""; + + /** + * SetBackendServiceTargetTcpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @instance + */ + SetBackendServiceTargetTcpProxyRequest.prototype.requestId = null; + + /** + * SetBackendServiceTargetTcpProxyRequest targetTcpProxiesSetBackendServiceRequestResource. + * @member {google.cloud.compute.v1.ITargetTcpProxiesSetBackendServiceRequest|null|undefined} targetTcpProxiesSetBackendServiceRequestResource + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @instance + */ + SetBackendServiceTargetTcpProxyRequest.prototype.targetTcpProxiesSetBackendServiceRequestResource = null; + + /** + * SetBackendServiceTargetTcpProxyRequest targetTcpProxy. + * @member {string} targetTcpProxy + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @instance + */ + SetBackendServiceTargetTcpProxyRequest.prototype.targetTcpProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetBackendServiceTargetTcpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @instance + */ + Object.defineProperty(SetBackendServiceTargetTcpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetBackendServiceTargetTcpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest} SetBackendServiceTargetTcpProxyRequest instance + */ + SetBackendServiceTargetTcpProxyRequest.create = function create(properties) { + return new SetBackendServiceTargetTcpProxyRequest(properties); + }; + + /** + * Encodes the specified SetBackendServiceTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest} message SetBackendServiceTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetBackendServiceTargetTcpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetTcpProxiesSetBackendServiceRequestResource != null && Object.hasOwnProperty.call(message, "targetTcpProxiesSetBackendServiceRequestResource")) + $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.encode(message.targetTcpProxiesSetBackendServiceRequestResource, writer.uint32(/* id 273721583, wireType 2 =*/2189772666).fork()).ldelim(); + if (message.targetTcpProxy != null && Object.hasOwnProperty.call(message, "targetTcpProxy")) + writer.uint32(/* id 503065442, wireType 2 =*/4024523538).string(message.targetTcpProxy); + return writer; + }; + + /** + * Encodes the specified SetBackendServiceTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest} message SetBackendServiceTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetBackendServiceTargetTcpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetBackendServiceTargetTcpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest} SetBackendServiceTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetBackendServiceTargetTcpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 273721583: + message.targetTcpProxiesSetBackendServiceRequestResource = $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.decode(reader, reader.uint32()); + break; + case 503065442: + message.targetTcpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetBackendServiceTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest} SetBackendServiceTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetBackendServiceTargetTcpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetBackendServiceTargetTcpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetBackendServiceTargetTcpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetTcpProxiesSetBackendServiceRequestResource != null && message.hasOwnProperty("targetTcpProxiesSetBackendServiceRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.verify(message.targetTcpProxiesSetBackendServiceRequestResource); + if (error) + return "targetTcpProxiesSetBackendServiceRequestResource." + error; + } + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + if (!$util.isString(message.targetTcpProxy)) + return "targetTcpProxy: string expected"; + return null; + }; + + /** + * Creates a SetBackendServiceTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest} SetBackendServiceTargetTcpProxyRequest + */ + SetBackendServiceTargetTcpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetTcpProxiesSetBackendServiceRequestResource != null) { + if (typeof object.targetTcpProxiesSetBackendServiceRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest.targetTcpProxiesSetBackendServiceRequestResource: object expected"); + message.targetTcpProxiesSetBackendServiceRequestResource = $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.fromObject(object.targetTcpProxiesSetBackendServiceRequestResource); + } + if (object.targetTcpProxy != null) + message.targetTcpProxy = String(object.targetTcpProxy); + return message; + }; + + /** + * Creates a plain object from a SetBackendServiceTargetTcpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest} message SetBackendServiceTargetTcpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetBackendServiceTargetTcpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.targetTcpProxiesSetBackendServiceRequestResource = null; + object.targetTcpProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetTcpProxiesSetBackendServiceRequestResource != null && message.hasOwnProperty("targetTcpProxiesSetBackendServiceRequestResource")) + object.targetTcpProxiesSetBackendServiceRequestResource = $root.google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest.toObject(message.targetTcpProxiesSetBackendServiceRequestResource, options); + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + object.targetTcpProxy = message.targetTcpProxy; + return object; + }; + + /** + * Converts this SetBackendServiceTargetTcpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetBackendServiceTargetTcpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetBackendServiceTargetTcpProxyRequest; + })(); + + v1.SetProxyHeaderTargetTcpProxyRequest = (function() { + + /** + * Properties of a SetProxyHeaderTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetProxyHeaderTargetTcpProxyRequest + * @property {string|null} [project] SetProxyHeaderTargetTcpProxyRequest project + * @property {string|null} [requestId] SetProxyHeaderTargetTcpProxyRequest requestId + * @property {google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest|null} [targetTcpProxiesSetProxyHeaderRequestResource] SetProxyHeaderTargetTcpProxyRequest targetTcpProxiesSetProxyHeaderRequestResource + * @property {string|null} [targetTcpProxy] SetProxyHeaderTargetTcpProxyRequest targetTcpProxy + */ + + /** + * Constructs a new SetProxyHeaderTargetTcpProxyRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetProxyHeaderTargetTcpProxyRequest. + * @implements ISetProxyHeaderTargetTcpProxyRequest + * @constructor + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest=} [properties] Properties to set + */ + function SetProxyHeaderTargetTcpProxyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetProxyHeaderTargetTcpProxyRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @instance + */ + SetProxyHeaderTargetTcpProxyRequest.prototype.project = ""; + + /** + * SetProxyHeaderTargetTcpProxyRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @instance + */ + SetProxyHeaderTargetTcpProxyRequest.prototype.requestId = null; + + /** + * SetProxyHeaderTargetTcpProxyRequest targetTcpProxiesSetProxyHeaderRequestResource. + * @member {google.cloud.compute.v1.ITargetTcpProxiesSetProxyHeaderRequest|null|undefined} targetTcpProxiesSetProxyHeaderRequestResource + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @instance + */ + SetProxyHeaderTargetTcpProxyRequest.prototype.targetTcpProxiesSetProxyHeaderRequestResource = null; + + /** + * SetProxyHeaderTargetTcpProxyRequest targetTcpProxy. + * @member {string} targetTcpProxy + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @instance + */ + SetProxyHeaderTargetTcpProxyRequest.prototype.targetTcpProxy = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetProxyHeaderTargetTcpProxyRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @instance + */ + Object.defineProperty(SetProxyHeaderTargetTcpProxyRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetProxyHeaderTargetTcpProxyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest} SetProxyHeaderTargetTcpProxyRequest instance + */ + SetProxyHeaderTargetTcpProxyRequest.create = function create(properties) { + return new SetProxyHeaderTargetTcpProxyRequest(properties); + }; + + /** + * Encodes the specified SetProxyHeaderTargetTcpProxyRequest message. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest} message SetProxyHeaderTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetProxyHeaderTargetTcpProxyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.targetTcpProxiesSetProxyHeaderRequestResource != null && Object.hasOwnProperty.call(message, "targetTcpProxiesSetProxyHeaderRequestResource")) + $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.encode(message.targetTcpProxiesSetProxyHeaderRequestResource, writer.uint32(/* id 219958339, wireType 2 =*/1759666714).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetTcpProxy != null && Object.hasOwnProperty.call(message, "targetTcpProxy")) + writer.uint32(/* id 503065442, wireType 2 =*/4024523538).string(message.targetTcpProxy); + return writer; + }; + + /** + * Encodes the specified SetProxyHeaderTargetTcpProxyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest} message SetProxyHeaderTargetTcpProxyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetProxyHeaderTargetTcpProxyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetProxyHeaderTargetTcpProxyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest} SetProxyHeaderTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetProxyHeaderTargetTcpProxyRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 219958339: + message.targetTcpProxiesSetProxyHeaderRequestResource = $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.decode(reader, reader.uint32()); + break; + case 503065442: + message.targetTcpProxy = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetProxyHeaderTargetTcpProxyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest} SetProxyHeaderTargetTcpProxyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetProxyHeaderTargetTcpProxyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetProxyHeaderTargetTcpProxyRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetProxyHeaderTargetTcpProxyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetTcpProxiesSetProxyHeaderRequestResource != null && message.hasOwnProperty("targetTcpProxiesSetProxyHeaderRequestResource")) { + var error = $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.verify(message.targetTcpProxiesSetProxyHeaderRequestResource); + if (error) + return "targetTcpProxiesSetProxyHeaderRequestResource." + error; + } + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + if (!$util.isString(message.targetTcpProxy)) + return "targetTcpProxy: string expected"; + return null; + }; + + /** + * Creates a SetProxyHeaderTargetTcpProxyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest} SetProxyHeaderTargetTcpProxyRequest + */ + SetProxyHeaderTargetTcpProxyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetTcpProxiesSetProxyHeaderRequestResource != null) { + if (typeof object.targetTcpProxiesSetProxyHeaderRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest.targetTcpProxiesSetProxyHeaderRequestResource: object expected"); + message.targetTcpProxiesSetProxyHeaderRequestResource = $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.fromObject(object.targetTcpProxiesSetProxyHeaderRequestResource); + } + if (object.targetTcpProxy != null) + message.targetTcpProxy = String(object.targetTcpProxy); + return message; + }; + + /** + * Creates a plain object from a SetProxyHeaderTargetTcpProxyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @static + * @param {google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest} message SetProxyHeaderTargetTcpProxyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetProxyHeaderTargetTcpProxyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetTcpProxiesSetProxyHeaderRequestResource = null; + object.project = ""; + object.targetTcpProxy = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.targetTcpProxiesSetProxyHeaderRequestResource != null && message.hasOwnProperty("targetTcpProxiesSetProxyHeaderRequestResource")) + object.targetTcpProxiesSetProxyHeaderRequestResource = $root.google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest.toObject(message.targetTcpProxiesSetProxyHeaderRequestResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetTcpProxy != null && message.hasOwnProperty("targetTcpProxy")) + object.targetTcpProxy = message.targetTcpProxy; + return object; + }; + + /** + * Converts this SetProxyHeaderTargetTcpProxyRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest + * @instance + * @returns {Object.} JSON object + */ + SetProxyHeaderTargetTcpProxyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetProxyHeaderTargetTcpProxyRequest; + })(); + + v1.AggregatedListTargetVpnGatewaysRequest = (function() { + + /** + * Properties of an AggregatedListTargetVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListTargetVpnGatewaysRequest + * @property {string|null} [filter] AggregatedListTargetVpnGatewaysRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListTargetVpnGatewaysRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListTargetVpnGatewaysRequest maxResults + * @property {string|null} [orderBy] AggregatedListTargetVpnGatewaysRequest orderBy + * @property {string|null} [pageToken] AggregatedListTargetVpnGatewaysRequest pageToken + * @property {string|null} [project] AggregatedListTargetVpnGatewaysRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListTargetVpnGatewaysRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListTargetVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListTargetVpnGatewaysRequest. + * @implements IAggregatedListTargetVpnGatewaysRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest=} [properties] Properties to set + */ + function AggregatedListTargetVpnGatewaysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListTargetVpnGatewaysRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + AggregatedListTargetVpnGatewaysRequest.prototype.filter = null; + + /** + * AggregatedListTargetVpnGatewaysRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + AggregatedListTargetVpnGatewaysRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListTargetVpnGatewaysRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + AggregatedListTargetVpnGatewaysRequest.prototype.maxResults = null; + + /** + * AggregatedListTargetVpnGatewaysRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + AggregatedListTargetVpnGatewaysRequest.prototype.orderBy = null; + + /** + * AggregatedListTargetVpnGatewaysRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + AggregatedListTargetVpnGatewaysRequest.prototype.pageToken = null; + + /** + * AggregatedListTargetVpnGatewaysRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + AggregatedListTargetVpnGatewaysRequest.prototype.project = ""; + + /** + * AggregatedListTargetVpnGatewaysRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + AggregatedListTargetVpnGatewaysRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListTargetVpnGatewaysRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetVpnGatewaysRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetVpnGatewaysRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetVpnGatewaysRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetVpnGatewaysRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetVpnGatewaysRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetVpnGatewaysRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetVpnGatewaysRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetVpnGatewaysRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetVpnGatewaysRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListTargetVpnGatewaysRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListTargetVpnGatewaysRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListTargetVpnGatewaysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest} AggregatedListTargetVpnGatewaysRequest instance + */ + AggregatedListTargetVpnGatewaysRequest.create = function create(properties) { + return new AggregatedListTargetVpnGatewaysRequest(properties); + }; + + /** + * Encodes the specified AggregatedListTargetVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest} message AggregatedListTargetVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetVpnGatewaysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListTargetVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest} message AggregatedListTargetVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListTargetVpnGatewaysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListTargetVpnGatewaysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest} AggregatedListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetVpnGatewaysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListTargetVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest} AggregatedListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListTargetVpnGatewaysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListTargetVpnGatewaysRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListTargetVpnGatewaysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListTargetVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest} AggregatedListTargetVpnGatewaysRequest + */ + AggregatedListTargetVpnGatewaysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListTargetVpnGatewaysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest} message AggregatedListTargetVpnGatewaysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListTargetVpnGatewaysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListTargetVpnGatewaysRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListTargetVpnGatewaysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListTargetVpnGatewaysRequest; + })(); + + v1.DeleteTargetVpnGatewayRequest = (function() { + + /** + * Properties of a DeleteTargetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteTargetVpnGatewayRequest + * @property {string|null} [project] DeleteTargetVpnGatewayRequest project + * @property {string|null} [region] DeleteTargetVpnGatewayRequest region + * @property {string|null} [requestId] DeleteTargetVpnGatewayRequest requestId + * @property {string|null} [targetVpnGateway] DeleteTargetVpnGatewayRequest targetVpnGateway + */ + + /** + * Constructs a new DeleteTargetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteTargetVpnGatewayRequest. + * @implements IDeleteTargetVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest=} [properties] Properties to set + */ + function DeleteTargetVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTargetVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @instance + */ + DeleteTargetVpnGatewayRequest.prototype.project = ""; + + /** + * DeleteTargetVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @instance + */ + DeleteTargetVpnGatewayRequest.prototype.region = ""; + + /** + * DeleteTargetVpnGatewayRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @instance + */ + DeleteTargetVpnGatewayRequest.prototype.requestId = null; + + /** + * DeleteTargetVpnGatewayRequest targetVpnGateway. + * @member {string} targetVpnGateway + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @instance + */ + DeleteTargetVpnGatewayRequest.prototype.targetVpnGateway = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteTargetVpnGatewayRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @instance + */ + Object.defineProperty(DeleteTargetVpnGatewayRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteTargetVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteTargetVpnGatewayRequest} DeleteTargetVpnGatewayRequest instance + */ + DeleteTargetVpnGatewayRequest.create = function create(properties) { + return new DeleteTargetVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified DeleteTargetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest} message DeleteTargetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetVpnGateway != null && Object.hasOwnProperty.call(message, "targetVpnGateway")) + writer.uint32(/* id 532512843, wireType 2 =*/4260102746).string(message.targetVpnGateway); + return writer; + }; + + /** + * Encodes the specified DeleteTargetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteTargetVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest} message DeleteTargetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTargetVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTargetVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteTargetVpnGatewayRequest} DeleteTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteTargetVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 532512843: + message.targetVpnGateway = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTargetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteTargetVpnGatewayRequest} DeleteTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTargetVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTargetVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTargetVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetVpnGateway != null && message.hasOwnProperty("targetVpnGateway")) + if (!$util.isString(message.targetVpnGateway)) + return "targetVpnGateway: string expected"; + return null; + }; + + /** + * Creates a DeleteTargetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteTargetVpnGatewayRequest} DeleteTargetVpnGatewayRequest + */ + DeleteTargetVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteTargetVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteTargetVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetVpnGateway != null) + message.targetVpnGateway = String(object.targetVpnGateway); + return message; + }; + + /** + * Creates a plain object from a DeleteTargetVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.DeleteTargetVpnGatewayRequest} message DeleteTargetVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTargetVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.targetVpnGateway = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetVpnGateway != null && message.hasOwnProperty("targetVpnGateway")) + object.targetVpnGateway = message.targetVpnGateway; + return object; + }; + + /** + * Converts this DeleteTargetVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteTargetVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTargetVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteTargetVpnGatewayRequest; + })(); + + v1.GetTargetVpnGatewayRequest = (function() { + + /** + * Properties of a GetTargetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetTargetVpnGatewayRequest + * @property {string|null} [project] GetTargetVpnGatewayRequest project + * @property {string|null} [region] GetTargetVpnGatewayRequest region + * @property {string|null} [targetVpnGateway] GetTargetVpnGatewayRequest targetVpnGateway + */ + + /** + * Constructs a new GetTargetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetTargetVpnGatewayRequest. + * @implements IGetTargetVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IGetTargetVpnGatewayRequest=} [properties] Properties to set + */ + function GetTargetVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTargetVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @instance + */ + GetTargetVpnGatewayRequest.prototype.project = ""; + + /** + * GetTargetVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @instance + */ + GetTargetVpnGatewayRequest.prototype.region = ""; + + /** + * GetTargetVpnGatewayRequest targetVpnGateway. + * @member {string} targetVpnGateway + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @instance + */ + GetTargetVpnGatewayRequest.prototype.targetVpnGateway = ""; + + /** + * Creates a new GetTargetVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetTargetVpnGatewayRequest} GetTargetVpnGatewayRequest instance + */ + GetTargetVpnGatewayRequest.create = function create(properties) { + return new GetTargetVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified GetTargetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetTargetVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetVpnGatewayRequest} message GetTargetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.targetVpnGateway != null && Object.hasOwnProperty.call(message, "targetVpnGateway")) + writer.uint32(/* id 532512843, wireType 2 =*/4260102746).string(message.targetVpnGateway); + return writer; + }; + + /** + * Encodes the specified GetTargetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetTargetVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetTargetVpnGatewayRequest} message GetTargetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTargetVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTargetVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetTargetVpnGatewayRequest} GetTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetTargetVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 532512843: + message.targetVpnGateway = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTargetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetTargetVpnGatewayRequest} GetTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTargetVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTargetVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTargetVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.targetVpnGateway != null && message.hasOwnProperty("targetVpnGateway")) + if (!$util.isString(message.targetVpnGateway)) + return "targetVpnGateway: string expected"; + return null; + }; + + /** + * Creates a GetTargetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetTargetVpnGatewayRequest} GetTargetVpnGatewayRequest + */ + GetTargetVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetTargetVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetTargetVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.targetVpnGateway != null) + message.targetVpnGateway = String(object.targetVpnGateway); + return message; + }; + + /** + * Creates a plain object from a GetTargetVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.GetTargetVpnGatewayRequest} message GetTargetVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTargetVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.targetVpnGateway = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.targetVpnGateway != null && message.hasOwnProperty("targetVpnGateway")) + object.targetVpnGateway = message.targetVpnGateway; + return object; + }; + + /** + * Converts this GetTargetVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetTargetVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + GetTargetVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetTargetVpnGatewayRequest; + })(); + + v1.InsertTargetVpnGatewayRequest = (function() { + + /** + * Properties of an InsertTargetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertTargetVpnGatewayRequest + * @property {string|null} [project] InsertTargetVpnGatewayRequest project + * @property {string|null} [region] InsertTargetVpnGatewayRequest region + * @property {string|null} [requestId] InsertTargetVpnGatewayRequest requestId + * @property {google.cloud.compute.v1.ITargetVpnGateway|null} [targetVpnGatewayResource] InsertTargetVpnGatewayRequest targetVpnGatewayResource + */ + + /** + * Constructs a new InsertTargetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertTargetVpnGatewayRequest. + * @implements IInsertTargetVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertTargetVpnGatewayRequest=} [properties] Properties to set + */ + function InsertTargetVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertTargetVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @instance + */ + InsertTargetVpnGatewayRequest.prototype.project = ""; + + /** + * InsertTargetVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @instance + */ + InsertTargetVpnGatewayRequest.prototype.region = ""; + + /** + * InsertTargetVpnGatewayRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @instance + */ + InsertTargetVpnGatewayRequest.prototype.requestId = null; + + /** + * InsertTargetVpnGatewayRequest targetVpnGatewayResource. + * @member {google.cloud.compute.v1.ITargetVpnGateway|null|undefined} targetVpnGatewayResource + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @instance + */ + InsertTargetVpnGatewayRequest.prototype.targetVpnGatewayResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertTargetVpnGatewayRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @instance + */ + Object.defineProperty(InsertTargetVpnGatewayRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertTargetVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertTargetVpnGatewayRequest} InsertTargetVpnGatewayRequest instance + */ + InsertTargetVpnGatewayRequest.create = function create(properties) { + return new InsertTargetVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified InsertTargetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertTargetVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetVpnGatewayRequest} message InsertTargetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetVpnGatewayResource != null && Object.hasOwnProperty.call(message, "targetVpnGatewayResource")) + $root.google.cloud.compute.v1.TargetVpnGateway.encode(message.targetVpnGatewayResource, writer.uint32(/* id 498050, wireType 2 =*/3984402).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertTargetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertTargetVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertTargetVpnGatewayRequest} message InsertTargetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertTargetVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertTargetVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertTargetVpnGatewayRequest} InsertTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertTargetVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 498050: + message.targetVpnGatewayResource = $root.google.cloud.compute.v1.TargetVpnGateway.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertTargetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertTargetVpnGatewayRequest} InsertTargetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertTargetVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertTargetVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertTargetVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.targetVpnGatewayResource != null && message.hasOwnProperty("targetVpnGatewayResource")) { + var error = $root.google.cloud.compute.v1.TargetVpnGateway.verify(message.targetVpnGatewayResource); + if (error) + return "targetVpnGatewayResource." + error; + } + return null; + }; + + /** + * Creates an InsertTargetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertTargetVpnGatewayRequest} InsertTargetVpnGatewayRequest + */ + InsertTargetVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertTargetVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertTargetVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.targetVpnGatewayResource != null) { + if (typeof object.targetVpnGatewayResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertTargetVpnGatewayRequest.targetVpnGatewayResource: object expected"); + message.targetVpnGatewayResource = $root.google.cloud.compute.v1.TargetVpnGateway.fromObject(object.targetVpnGatewayResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertTargetVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.InsertTargetVpnGatewayRequest} message InsertTargetVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertTargetVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.targetVpnGatewayResource = null; + object.region = ""; + object.project = ""; + } + if (message.targetVpnGatewayResource != null && message.hasOwnProperty("targetVpnGatewayResource")) + object.targetVpnGatewayResource = $root.google.cloud.compute.v1.TargetVpnGateway.toObject(message.targetVpnGatewayResource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertTargetVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertTargetVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + InsertTargetVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertTargetVpnGatewayRequest; + })(); + + v1.ListTargetVpnGatewaysRequest = (function() { + + /** + * Properties of a ListTargetVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @interface IListTargetVpnGatewaysRequest + * @property {string|null} [filter] ListTargetVpnGatewaysRequest filter + * @property {number|null} [maxResults] ListTargetVpnGatewaysRequest maxResults + * @property {string|null} [orderBy] ListTargetVpnGatewaysRequest orderBy + * @property {string|null} [pageToken] ListTargetVpnGatewaysRequest pageToken + * @property {string|null} [project] ListTargetVpnGatewaysRequest project + * @property {string|null} [region] ListTargetVpnGatewaysRequest region + * @property {boolean|null} [returnPartialSuccess] ListTargetVpnGatewaysRequest returnPartialSuccess + */ + + /** + * Constructs a new ListTargetVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListTargetVpnGatewaysRequest. + * @implements IListTargetVpnGatewaysRequest + * @constructor + * @param {google.cloud.compute.v1.IListTargetVpnGatewaysRequest=} [properties] Properties to set + */ + function ListTargetVpnGatewaysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTargetVpnGatewaysRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + ListTargetVpnGatewaysRequest.prototype.filter = null; + + /** + * ListTargetVpnGatewaysRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + ListTargetVpnGatewaysRequest.prototype.maxResults = null; + + /** + * ListTargetVpnGatewaysRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + ListTargetVpnGatewaysRequest.prototype.orderBy = null; + + /** + * ListTargetVpnGatewaysRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + ListTargetVpnGatewaysRequest.prototype.pageToken = null; + + /** + * ListTargetVpnGatewaysRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + ListTargetVpnGatewaysRequest.prototype.project = ""; + + /** + * ListTargetVpnGatewaysRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + ListTargetVpnGatewaysRequest.prototype.region = ""; + + /** + * ListTargetVpnGatewaysRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + ListTargetVpnGatewaysRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListTargetVpnGatewaysRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListTargetVpnGatewaysRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetVpnGatewaysRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListTargetVpnGatewaysRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetVpnGatewaysRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListTargetVpnGatewaysRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetVpnGatewaysRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListTargetVpnGatewaysRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListTargetVpnGatewaysRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListTargetVpnGatewaysRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListTargetVpnGatewaysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListTargetVpnGatewaysRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListTargetVpnGatewaysRequest} ListTargetVpnGatewaysRequest instance + */ + ListTargetVpnGatewaysRequest.create = function create(properties) { + return new ListTargetVpnGatewaysRequest(properties); + }; + + /** + * Encodes the specified ListTargetVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.ListTargetVpnGatewaysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListTargetVpnGatewaysRequest} message ListTargetVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetVpnGatewaysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListTargetVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListTargetVpnGatewaysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListTargetVpnGatewaysRequest} message ListTargetVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTargetVpnGatewaysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTargetVpnGatewaysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListTargetVpnGatewaysRequest} ListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetVpnGatewaysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListTargetVpnGatewaysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTargetVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListTargetVpnGatewaysRequest} ListTargetVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTargetVpnGatewaysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTargetVpnGatewaysRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTargetVpnGatewaysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListTargetVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListTargetVpnGatewaysRequest} ListTargetVpnGatewaysRequest + */ + ListTargetVpnGatewaysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListTargetVpnGatewaysRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListTargetVpnGatewaysRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListTargetVpnGatewaysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.ListTargetVpnGatewaysRequest} message ListTargetVpnGatewaysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTargetVpnGatewaysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListTargetVpnGatewaysRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListTargetVpnGatewaysRequest + * @instance + * @returns {Object.} JSON object + */ + ListTargetVpnGatewaysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListTargetVpnGatewaysRequest; + })(); + + v1.AggregatedListUrlMapsRequest = (function() { + + /** + * Properties of an AggregatedListUrlMapsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListUrlMapsRequest + * @property {string|null} [filter] AggregatedListUrlMapsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListUrlMapsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListUrlMapsRequest maxResults + * @property {string|null} [orderBy] AggregatedListUrlMapsRequest orderBy + * @property {string|null} [pageToken] AggregatedListUrlMapsRequest pageToken + * @property {string|null} [project] AggregatedListUrlMapsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListUrlMapsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListUrlMapsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListUrlMapsRequest. + * @implements IAggregatedListUrlMapsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListUrlMapsRequest=} [properties] Properties to set + */ + function AggregatedListUrlMapsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListUrlMapsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + AggregatedListUrlMapsRequest.prototype.filter = null; + + /** + * AggregatedListUrlMapsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + AggregatedListUrlMapsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListUrlMapsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + AggregatedListUrlMapsRequest.prototype.maxResults = null; + + /** + * AggregatedListUrlMapsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + AggregatedListUrlMapsRequest.prototype.orderBy = null; + + /** + * AggregatedListUrlMapsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + AggregatedListUrlMapsRequest.prototype.pageToken = null; + + /** + * AggregatedListUrlMapsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + AggregatedListUrlMapsRequest.prototype.project = ""; + + /** + * AggregatedListUrlMapsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + AggregatedListUrlMapsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListUrlMapsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + Object.defineProperty(AggregatedListUrlMapsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListUrlMapsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + Object.defineProperty(AggregatedListUrlMapsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListUrlMapsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + Object.defineProperty(AggregatedListUrlMapsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListUrlMapsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + Object.defineProperty(AggregatedListUrlMapsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListUrlMapsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + Object.defineProperty(AggregatedListUrlMapsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListUrlMapsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + */ + Object.defineProperty(AggregatedListUrlMapsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListUrlMapsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListUrlMapsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListUrlMapsRequest} AggregatedListUrlMapsRequest instance + */ + AggregatedListUrlMapsRequest.create = function create(properties) { + return new AggregatedListUrlMapsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListUrlMapsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListUrlMapsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListUrlMapsRequest} message AggregatedListUrlMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListUrlMapsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListUrlMapsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListUrlMapsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListUrlMapsRequest} message AggregatedListUrlMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListUrlMapsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListUrlMapsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListUrlMapsRequest} AggregatedListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListUrlMapsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListUrlMapsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListUrlMapsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListUrlMapsRequest} AggregatedListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListUrlMapsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListUrlMapsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListUrlMapsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListUrlMapsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListUrlMapsRequest} AggregatedListUrlMapsRequest + */ + AggregatedListUrlMapsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListUrlMapsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListUrlMapsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListUrlMapsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListUrlMapsRequest} message AggregatedListUrlMapsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListUrlMapsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListUrlMapsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListUrlMapsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListUrlMapsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListUrlMapsRequest; + })(); + + v1.DeleteUrlMapRequest = (function() { + + /** + * Properties of a DeleteUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteUrlMapRequest + * @property {string|null} [project] DeleteUrlMapRequest project + * @property {string|null} [requestId] DeleteUrlMapRequest requestId + * @property {string|null} [urlMap] DeleteUrlMapRequest urlMap + */ + + /** + * Constructs a new DeleteUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteUrlMapRequest. + * @implements IDeleteUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteUrlMapRequest=} [properties] Properties to set + */ + function DeleteUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @instance + */ + DeleteUrlMapRequest.prototype.project = ""; + + /** + * DeleteUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @instance + */ + DeleteUrlMapRequest.prototype.requestId = null; + + /** + * DeleteUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @instance + */ + DeleteUrlMapRequest.prototype.urlMap = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @instance + */ + Object.defineProperty(DeleteUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IDeleteUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteUrlMapRequest} DeleteUrlMapRequest instance + */ + DeleteUrlMapRequest.create = function create(properties) { + return new DeleteUrlMapRequest(properties); + }; + + /** + * Encodes the specified DeleteUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IDeleteUrlMapRequest} message DeleteUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified DeleteUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IDeleteUrlMapRequest} message DeleteUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteUrlMapRequest} DeleteUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteUrlMapRequest} DeleteUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + return null; + }; + + /** + * Creates a DeleteUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteUrlMapRequest} DeleteUrlMapRequest + */ + DeleteUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from a DeleteUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @static + * @param {google.cloud.compute.v1.DeleteUrlMapRequest} message DeleteUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.urlMap = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this DeleteUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteUrlMapRequest; + })(); + + v1.GetUrlMapRequest = (function() { + + /** + * Properties of a GetUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetUrlMapRequest + * @property {string|null} [project] GetUrlMapRequest project + * @property {string|null} [urlMap] GetUrlMapRequest urlMap + */ + + /** + * Constructs a new GetUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetUrlMapRequest. + * @implements IGetUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IGetUrlMapRequest=} [properties] Properties to set + */ + function GetUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @instance + */ + GetUrlMapRequest.prototype.project = ""; + + /** + * GetUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @instance + */ + GetUrlMapRequest.prototype.urlMap = ""; + + /** + * Creates a new GetUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IGetUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetUrlMapRequest} GetUrlMapRequest instance + */ + GetUrlMapRequest.create = function create(properties) { + return new GetUrlMapRequest(properties); + }; + + /** + * Encodes the specified GetUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.GetUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IGetUrlMapRequest} message GetUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified GetUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IGetUrlMapRequest} message GetUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetUrlMapRequest} GetUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetUrlMapRequest} GetUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + return null; + }; + + /** + * Creates a GetUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetUrlMapRequest} GetUrlMapRequest + */ + GetUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from a GetUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @static + * @param {google.cloud.compute.v1.GetUrlMapRequest} message GetUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.urlMap = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this GetUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + GetUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetUrlMapRequest; + })(); + + v1.InsertUrlMapRequest = (function() { + + /** + * Properties of an InsertUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertUrlMapRequest + * @property {string|null} [project] InsertUrlMapRequest project + * @property {string|null} [requestId] InsertUrlMapRequest requestId + * @property {google.cloud.compute.v1.IUrlMap|null} [urlMapResource] InsertUrlMapRequest urlMapResource + */ + + /** + * Constructs a new InsertUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertUrlMapRequest. + * @implements IInsertUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertUrlMapRequest=} [properties] Properties to set + */ + function InsertUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @instance + */ + InsertUrlMapRequest.prototype.project = ""; + + /** + * InsertUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @instance + */ + InsertUrlMapRequest.prototype.requestId = null; + + /** + * InsertUrlMapRequest urlMapResource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} urlMapResource + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @instance + */ + InsertUrlMapRequest.prototype.urlMapResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @instance + */ + Object.defineProperty(InsertUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInsertUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertUrlMapRequest} InsertUrlMapRequest instance + */ + InsertUrlMapRequest.create = function create(properties) { + return new InsertUrlMapRequest(properties); + }; + + /** + * Encodes the specified InsertUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInsertUrlMapRequest} message InsertUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.urlMapResource != null && Object.hasOwnProperty.call(message, "urlMapResource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.urlMapResource, writer.uint32(/* id 168675425, wireType 2 =*/1349403402).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInsertUrlMapRequest} message InsertUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertUrlMapRequest} InsertUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 168675425: + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertUrlMapRequest} InsertUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.urlMapResource); + if (error) + return "urlMapResource." + error; + } + return null; + }; + + /** + * Creates an InsertUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertUrlMapRequest} InsertUrlMapRequest + */ + InsertUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMapResource != null) { + if (typeof object.urlMapResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertUrlMapRequest.urlMapResource: object expected"); + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.urlMapResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @static + * @param {google.cloud.compute.v1.InsertUrlMapRequest} message InsertUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.urlMapResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) + object.urlMapResource = $root.google.cloud.compute.v1.UrlMap.toObject(message.urlMapResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + InsertUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertUrlMapRequest; + })(); + + v1.InvalidateCacheUrlMapRequest = (function() { + + /** + * Properties of an InvalidateCacheUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IInvalidateCacheUrlMapRequest + * @property {google.cloud.compute.v1.ICacheInvalidationRule|null} [cacheInvalidationRuleResource] InvalidateCacheUrlMapRequest cacheInvalidationRuleResource + * @property {string|null} [project] InvalidateCacheUrlMapRequest project + * @property {string|null} [requestId] InvalidateCacheUrlMapRequest requestId + * @property {string|null} [urlMap] InvalidateCacheUrlMapRequest urlMap + */ + + /** + * Constructs a new InvalidateCacheUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InvalidateCacheUrlMapRequest. + * @implements IInvalidateCacheUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IInvalidateCacheUrlMapRequest=} [properties] Properties to set + */ + function InvalidateCacheUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InvalidateCacheUrlMapRequest cacheInvalidationRuleResource. + * @member {google.cloud.compute.v1.ICacheInvalidationRule|null|undefined} cacheInvalidationRuleResource + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @instance + */ + InvalidateCacheUrlMapRequest.prototype.cacheInvalidationRuleResource = null; + + /** + * InvalidateCacheUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @instance + */ + InvalidateCacheUrlMapRequest.prototype.project = ""; + + /** + * InvalidateCacheUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @instance + */ + InvalidateCacheUrlMapRequest.prototype.requestId = null; + + /** + * InvalidateCacheUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @instance + */ + InvalidateCacheUrlMapRequest.prototype.urlMap = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InvalidateCacheUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @instance + */ + Object.defineProperty(InvalidateCacheUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InvalidateCacheUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInvalidateCacheUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InvalidateCacheUrlMapRequest} InvalidateCacheUrlMapRequest instance + */ + InvalidateCacheUrlMapRequest.create = function create(properties) { + return new InvalidateCacheUrlMapRequest(properties); + }; + + /** + * Encodes the specified InvalidateCacheUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.InvalidateCacheUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInvalidateCacheUrlMapRequest} message InvalidateCacheUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidateCacheUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.cacheInvalidationRuleResource != null && Object.hasOwnProperty.call(message, "cacheInvalidationRuleResource")) + $root.google.cloud.compute.v1.CacheInvalidationRule.encode(message.cacheInvalidationRuleResource, writer.uint32(/* id 312795565, wireType 2 =*/2502364522).fork()).ldelim(); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified InvalidateCacheUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InvalidateCacheUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IInvalidateCacheUrlMapRequest} message InvalidateCacheUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InvalidateCacheUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InvalidateCacheUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InvalidateCacheUrlMapRequest} InvalidateCacheUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidateCacheUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InvalidateCacheUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 312795565: + message.cacheInvalidationRuleResource = $root.google.cloud.compute.v1.CacheInvalidationRule.decode(reader, reader.uint32()); + break; + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InvalidateCacheUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InvalidateCacheUrlMapRequest} InvalidateCacheUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InvalidateCacheUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InvalidateCacheUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InvalidateCacheUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cacheInvalidationRuleResource != null && message.hasOwnProperty("cacheInvalidationRuleResource")) { + var error = $root.google.cloud.compute.v1.CacheInvalidationRule.verify(message.cacheInvalidationRuleResource); + if (error) + return "cacheInvalidationRuleResource." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + return null; + }; + + /** + * Creates an InvalidateCacheUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InvalidateCacheUrlMapRequest} InvalidateCacheUrlMapRequest + */ + InvalidateCacheUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InvalidateCacheUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.InvalidateCacheUrlMapRequest(); + if (object.cacheInvalidationRuleResource != null) { + if (typeof object.cacheInvalidationRuleResource !== "object") + throw TypeError(".google.cloud.compute.v1.InvalidateCacheUrlMapRequest.cacheInvalidationRuleResource: object expected"); + message.cacheInvalidationRuleResource = $root.google.cloud.compute.v1.CacheInvalidationRule.fromObject(object.cacheInvalidationRuleResource); + } + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + return message; + }; + + /** + * Creates a plain object from an InvalidateCacheUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @static + * @param {google.cloud.compute.v1.InvalidateCacheUrlMapRequest} message InvalidateCacheUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InvalidateCacheUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.cacheInvalidationRuleResource = null; + object.urlMap = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.cacheInvalidationRuleResource != null && message.hasOwnProperty("cacheInvalidationRuleResource")) + object.cacheInvalidationRuleResource = $root.google.cloud.compute.v1.CacheInvalidationRule.toObject(message.cacheInvalidationRuleResource, options); + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this InvalidateCacheUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InvalidateCacheUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + InvalidateCacheUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InvalidateCacheUrlMapRequest; + })(); + + v1.ListUrlMapsRequest = (function() { + + /** + * Properties of a ListUrlMapsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListUrlMapsRequest + * @property {string|null} [filter] ListUrlMapsRequest filter + * @property {number|null} [maxResults] ListUrlMapsRequest maxResults + * @property {string|null} [orderBy] ListUrlMapsRequest orderBy + * @property {string|null} [pageToken] ListUrlMapsRequest pageToken + * @property {string|null} [project] ListUrlMapsRequest project + * @property {boolean|null} [returnPartialSuccess] ListUrlMapsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListUrlMapsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListUrlMapsRequest. + * @implements IListUrlMapsRequest + * @constructor + * @param {google.cloud.compute.v1.IListUrlMapsRequest=} [properties] Properties to set + */ + function ListUrlMapsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUrlMapsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + ListUrlMapsRequest.prototype.filter = null; + + /** + * ListUrlMapsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + ListUrlMapsRequest.prototype.maxResults = null; + + /** + * ListUrlMapsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + ListUrlMapsRequest.prototype.orderBy = null; + + /** + * ListUrlMapsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + ListUrlMapsRequest.prototype.pageToken = null; + + /** + * ListUrlMapsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + ListUrlMapsRequest.prototype.project = ""; + + /** + * ListUrlMapsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + ListUrlMapsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListUrlMapsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + Object.defineProperty(ListUrlMapsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUrlMapsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + Object.defineProperty(ListUrlMapsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUrlMapsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + Object.defineProperty(ListUrlMapsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUrlMapsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + Object.defineProperty(ListUrlMapsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListUrlMapsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + */ + Object.defineProperty(ListUrlMapsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListUrlMapsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IListUrlMapsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListUrlMapsRequest} ListUrlMapsRequest instance + */ + ListUrlMapsRequest.create = function create(properties) { + return new ListUrlMapsRequest(properties); + }; + + /** + * Encodes the specified ListUrlMapsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListUrlMapsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IListUrlMapsRequest} message ListUrlMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUrlMapsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListUrlMapsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListUrlMapsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.IListUrlMapsRequest} message ListUrlMapsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUrlMapsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUrlMapsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListUrlMapsRequest} ListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUrlMapsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListUrlMapsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUrlMapsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListUrlMapsRequest} ListUrlMapsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUrlMapsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUrlMapsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUrlMapsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListUrlMapsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListUrlMapsRequest} ListUrlMapsRequest + */ + ListUrlMapsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListUrlMapsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListUrlMapsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListUrlMapsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @static + * @param {google.cloud.compute.v1.ListUrlMapsRequest} message ListUrlMapsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUrlMapsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListUrlMapsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListUrlMapsRequest + * @instance + * @returns {Object.} JSON object + */ + ListUrlMapsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListUrlMapsRequest; + })(); + + v1.PatchUrlMapRequest = (function() { + + /** + * Properties of a PatchUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IPatchUrlMapRequest + * @property {string|null} [project] PatchUrlMapRequest project + * @property {string|null} [requestId] PatchUrlMapRequest requestId + * @property {string|null} [urlMap] PatchUrlMapRequest urlMap + * @property {google.cloud.compute.v1.IUrlMap|null} [urlMapResource] PatchUrlMapRequest urlMapResource + */ + + /** + * Constructs a new PatchUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PatchUrlMapRequest. + * @implements IPatchUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IPatchUrlMapRequest=} [properties] Properties to set + */ + function PatchUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PatchUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @instance + */ + PatchUrlMapRequest.prototype.project = ""; + + /** + * PatchUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @instance + */ + PatchUrlMapRequest.prototype.requestId = null; + + /** + * PatchUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @instance + */ + PatchUrlMapRequest.prototype.urlMap = ""; + + /** + * PatchUrlMapRequest urlMapResource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} urlMapResource + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @instance + */ + PatchUrlMapRequest.prototype.urlMapResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PatchUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @instance + */ + Object.defineProperty(PatchUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PatchUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IPatchUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.PatchUrlMapRequest} PatchUrlMapRequest instance + */ + PatchUrlMapRequest.create = function create(properties) { + return new PatchUrlMapRequest(properties); + }; + + /** + * Encodes the specified PatchUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IPatchUrlMapRequest} message PatchUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.urlMapResource != null && Object.hasOwnProperty.call(message, "urlMapResource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.urlMapResource, writer.uint32(/* id 168675425, wireType 2 =*/1349403402).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified PatchUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IPatchUrlMapRequest} message PatchUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PatchUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PatchUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.PatchUrlMapRequest} PatchUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.PatchUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + case 168675425: + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PatchUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.PatchUrlMapRequest} PatchUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PatchUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PatchUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PatchUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.urlMapResource); + if (error) + return "urlMapResource." + error; + } + return null; + }; + + /** + * Creates a PatchUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.PatchUrlMapRequest} PatchUrlMapRequest + */ + PatchUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.PatchUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.PatchUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + if (object.urlMapResource != null) { + if (typeof object.urlMapResource !== "object") + throw TypeError(".google.cloud.compute.v1.PatchUrlMapRequest.urlMapResource: object expected"); + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.urlMapResource); + } + return message; + }; + + /** + * Creates a plain object from a PatchUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @static + * @param {google.cloud.compute.v1.PatchUrlMapRequest} message PatchUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PatchUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.urlMapResource = null; + object.project = ""; + object.urlMap = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) + object.urlMapResource = $root.google.cloud.compute.v1.UrlMap.toObject(message.urlMapResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this PatchUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.PatchUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + PatchUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PatchUrlMapRequest; + })(); + + v1.UpdateUrlMapRequest = (function() { + + /** + * Properties of an UpdateUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IUpdateUrlMapRequest + * @property {string|null} [project] UpdateUrlMapRequest project + * @property {string|null} [requestId] UpdateUrlMapRequest requestId + * @property {string|null} [urlMap] UpdateUrlMapRequest urlMap + * @property {google.cloud.compute.v1.IUrlMap|null} [urlMapResource] UpdateUrlMapRequest urlMapResource + */ + + /** + * Constructs a new UpdateUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UpdateUrlMapRequest. + * @implements IUpdateUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IUpdateUrlMapRequest=} [properties] Properties to set + */ + function UpdateUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @instance + */ + UpdateUrlMapRequest.prototype.project = ""; + + /** + * UpdateUrlMapRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @instance + */ + UpdateUrlMapRequest.prototype.requestId = null; + + /** + * UpdateUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @instance + */ + UpdateUrlMapRequest.prototype.urlMap = ""; + + /** + * UpdateUrlMapRequest urlMapResource. + * @member {google.cloud.compute.v1.IUrlMap|null|undefined} urlMapResource + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @instance + */ + UpdateUrlMapRequest.prototype.urlMapResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * UpdateUrlMapRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @instance + */ + Object.defineProperty(UpdateUrlMapRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UpdateUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IUpdateUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.UpdateUrlMapRequest} UpdateUrlMapRequest instance + */ + UpdateUrlMapRequest.create = function create(properties) { + return new UpdateUrlMapRequest(properties); + }; + + /** + * Encodes the specified UpdateUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IUpdateUrlMapRequest} message UpdateUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.urlMapResource != null && Object.hasOwnProperty.call(message, "urlMapResource")) + $root.google.cloud.compute.v1.UrlMap.encode(message.urlMapResource, writer.uint32(/* id 168675425, wireType 2 =*/1349403402).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + return writer; + }; + + /** + * Encodes the specified UpdateUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IUpdateUrlMapRequest} message UpdateUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.UpdateUrlMapRequest} UpdateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.UpdateUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + case 168675425: + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.UpdateUrlMapRequest} UpdateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) { + var error = $root.google.cloud.compute.v1.UrlMap.verify(message.urlMapResource); + if (error) + return "urlMapResource." + error; + } + return null; + }; + + /** + * Creates an UpdateUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.UpdateUrlMapRequest} UpdateUrlMapRequest + */ + UpdateUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.UpdateUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.UpdateUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + if (object.urlMapResource != null) { + if (typeof object.urlMapResource !== "object") + throw TypeError(".google.cloud.compute.v1.UpdateUrlMapRequest.urlMapResource: object expected"); + message.urlMapResource = $root.google.cloud.compute.v1.UrlMap.fromObject(object.urlMapResource); + } + return message; + }; + + /** + * Creates a plain object from an UpdateUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.UpdateUrlMapRequest} message UpdateUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.urlMapResource = null; + object.project = ""; + object.urlMap = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.urlMapResource != null && message.hasOwnProperty("urlMapResource")) + object.urlMapResource = $root.google.cloud.compute.v1.UrlMap.toObject(message.urlMapResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + return object; + }; + + /** + * Converts this UpdateUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.UpdateUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateUrlMapRequest; + })(); + + v1.ValidateUrlMapRequest = (function() { + + /** + * Properties of a ValidateUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @interface IValidateUrlMapRequest + * @property {string|null} [project] ValidateUrlMapRequest project + * @property {string|null} [urlMap] ValidateUrlMapRequest urlMap + * @property {google.cloud.compute.v1.IUrlMapsValidateRequest|null} [urlMapsValidateRequestResource] ValidateUrlMapRequest urlMapsValidateRequestResource + */ + + /** + * Constructs a new ValidateUrlMapRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ValidateUrlMapRequest. + * @implements IValidateUrlMapRequest + * @constructor + * @param {google.cloud.compute.v1.IValidateUrlMapRequest=} [properties] Properties to set + */ + function ValidateUrlMapRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidateUrlMapRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @instance + */ + ValidateUrlMapRequest.prototype.project = ""; + + /** + * ValidateUrlMapRequest urlMap. + * @member {string} urlMap + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @instance + */ + ValidateUrlMapRequest.prototype.urlMap = ""; + + /** + * ValidateUrlMapRequest urlMapsValidateRequestResource. + * @member {google.cloud.compute.v1.IUrlMapsValidateRequest|null|undefined} urlMapsValidateRequestResource + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @instance + */ + ValidateUrlMapRequest.prototype.urlMapsValidateRequestResource = null; + + /** + * Creates a new ValidateUrlMapRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IValidateUrlMapRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ValidateUrlMapRequest} ValidateUrlMapRequest instance + */ + ValidateUrlMapRequest.create = function create(properties) { + return new ValidateUrlMapRequest(properties); + }; + + /** + * Encodes the specified ValidateUrlMapRequest message. Does not implicitly {@link google.cloud.compute.v1.ValidateUrlMapRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IValidateUrlMapRequest} message ValidateUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateUrlMapRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.urlMap != null && Object.hasOwnProperty.call(message, "urlMap")) + writer.uint32(/* id 367020684, wireType 2 =*/2936165474).string(message.urlMap); + if (message.urlMapsValidateRequestResource != null && Object.hasOwnProperty.call(message, "urlMapsValidateRequestResource")) + $root.google.cloud.compute.v1.UrlMapsValidateRequest.encode(message.urlMapsValidateRequestResource, writer.uint32(/* id 395913455, wireType 2 =*/3167307642).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidateUrlMapRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ValidateUrlMapRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.IValidateUrlMapRequest} message ValidateUrlMapRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidateUrlMapRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidateUrlMapRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ValidateUrlMapRequest} ValidateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateUrlMapRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ValidateUrlMapRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 367020684: + message.urlMap = reader.string(); + break; + case 395913455: + message.urlMapsValidateRequestResource = $root.google.cloud.compute.v1.UrlMapsValidateRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidateUrlMapRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ValidateUrlMapRequest} ValidateUrlMapRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidateUrlMapRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidateUrlMapRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidateUrlMapRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + if (!$util.isString(message.urlMap)) + return "urlMap: string expected"; + if (message.urlMapsValidateRequestResource != null && message.hasOwnProperty("urlMapsValidateRequestResource")) { + var error = $root.google.cloud.compute.v1.UrlMapsValidateRequest.verify(message.urlMapsValidateRequestResource); + if (error) + return "urlMapsValidateRequestResource." + error; + } + return null; + }; + + /** + * Creates a ValidateUrlMapRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ValidateUrlMapRequest} ValidateUrlMapRequest + */ + ValidateUrlMapRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ValidateUrlMapRequest) + return object; + var message = new $root.google.cloud.compute.v1.ValidateUrlMapRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.urlMap != null) + message.urlMap = String(object.urlMap); + if (object.urlMapsValidateRequestResource != null) { + if (typeof object.urlMapsValidateRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.ValidateUrlMapRequest.urlMapsValidateRequestResource: object expected"); + message.urlMapsValidateRequestResource = $root.google.cloud.compute.v1.UrlMapsValidateRequest.fromObject(object.urlMapsValidateRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a ValidateUrlMapRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @static + * @param {google.cloud.compute.v1.ValidateUrlMapRequest} message ValidateUrlMapRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidateUrlMapRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.urlMap = ""; + object.urlMapsValidateRequestResource = null; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.urlMap != null && message.hasOwnProperty("urlMap")) + object.urlMap = message.urlMap; + if (message.urlMapsValidateRequestResource != null && message.hasOwnProperty("urlMapsValidateRequestResource")) + object.urlMapsValidateRequestResource = $root.google.cloud.compute.v1.UrlMapsValidateRequest.toObject(message.urlMapsValidateRequestResource, options); + return object; + }; + + /** + * Converts this ValidateUrlMapRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ValidateUrlMapRequest + * @instance + * @returns {Object.} JSON object + */ + ValidateUrlMapRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidateUrlMapRequest; + })(); + + v1.AggregatedListVpnGatewaysRequest = (function() { + + /** + * Properties of an AggregatedListVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListVpnGatewaysRequest + * @property {string|null} [filter] AggregatedListVpnGatewaysRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListVpnGatewaysRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListVpnGatewaysRequest maxResults + * @property {string|null} [orderBy] AggregatedListVpnGatewaysRequest orderBy + * @property {string|null} [pageToken] AggregatedListVpnGatewaysRequest pageToken + * @property {string|null} [project] AggregatedListVpnGatewaysRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListVpnGatewaysRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListVpnGatewaysRequest. + * @implements IAggregatedListVpnGatewaysRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest=} [properties] Properties to set + */ + function AggregatedListVpnGatewaysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListVpnGatewaysRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + AggregatedListVpnGatewaysRequest.prototype.filter = null; + + /** + * AggregatedListVpnGatewaysRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + AggregatedListVpnGatewaysRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListVpnGatewaysRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + AggregatedListVpnGatewaysRequest.prototype.maxResults = null; + + /** + * AggregatedListVpnGatewaysRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + AggregatedListVpnGatewaysRequest.prototype.orderBy = null; + + /** + * AggregatedListVpnGatewaysRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + AggregatedListVpnGatewaysRequest.prototype.pageToken = null; + + /** + * AggregatedListVpnGatewaysRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + AggregatedListVpnGatewaysRequest.prototype.project = ""; + + /** + * AggregatedListVpnGatewaysRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + AggregatedListVpnGatewaysRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListVpnGatewaysRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnGatewaysRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnGatewaysRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnGatewaysRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnGatewaysRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnGatewaysRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnGatewaysRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnGatewaysRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnGatewaysRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnGatewaysRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnGatewaysRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnGatewaysRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListVpnGatewaysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListVpnGatewaysRequest} AggregatedListVpnGatewaysRequest instance + */ + AggregatedListVpnGatewaysRequest.create = function create(properties) { + return new AggregatedListVpnGatewaysRequest(properties); + }; + + /** + * Encodes the specified AggregatedListVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnGatewaysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest} message AggregatedListVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListVpnGatewaysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnGatewaysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest} message AggregatedListVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListVpnGatewaysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListVpnGatewaysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListVpnGatewaysRequest} AggregatedListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListVpnGatewaysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListVpnGatewaysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListVpnGatewaysRequest} AggregatedListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListVpnGatewaysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListVpnGatewaysRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListVpnGatewaysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListVpnGatewaysRequest} AggregatedListVpnGatewaysRequest + */ + AggregatedListVpnGatewaysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListVpnGatewaysRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListVpnGatewaysRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListVpnGatewaysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListVpnGatewaysRequest} message AggregatedListVpnGatewaysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListVpnGatewaysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListVpnGatewaysRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListVpnGatewaysRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListVpnGatewaysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListVpnGatewaysRequest; + })(); + + v1.DeleteVpnGatewayRequest = (function() { + + /** + * Properties of a DeleteVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteVpnGatewayRequest + * @property {string|null} [project] DeleteVpnGatewayRequest project + * @property {string|null} [region] DeleteVpnGatewayRequest region + * @property {string|null} [requestId] DeleteVpnGatewayRequest requestId + * @property {string|null} [vpnGateway] DeleteVpnGatewayRequest vpnGateway + */ + + /** + * Constructs a new DeleteVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteVpnGatewayRequest. + * @implements IDeleteVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteVpnGatewayRequest=} [properties] Properties to set + */ + function DeleteVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @instance + */ + DeleteVpnGatewayRequest.prototype.project = ""; + + /** + * DeleteVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @instance + */ + DeleteVpnGatewayRequest.prototype.region = ""; + + /** + * DeleteVpnGatewayRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @instance + */ + DeleteVpnGatewayRequest.prototype.requestId = null; + + /** + * DeleteVpnGatewayRequest vpnGateway. + * @member {string} vpnGateway + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @instance + */ + DeleteVpnGatewayRequest.prototype.vpnGateway = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteVpnGatewayRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @instance + */ + Object.defineProperty(DeleteVpnGatewayRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteVpnGatewayRequest} DeleteVpnGatewayRequest instance + */ + DeleteVpnGatewayRequest.create = function create(properties) { + return new DeleteVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified DeleteVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteVpnGatewayRequest} message DeleteVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.vpnGateway != null && Object.hasOwnProperty.call(message, "vpnGateway")) + writer.uint32(/* id 406684153, wireType 2 =*/3253473226).string(message.vpnGateway); + return writer; + }; + + /** + * Encodes the specified DeleteVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IDeleteVpnGatewayRequest} message DeleteVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteVpnGatewayRequest} DeleteVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 406684153: + message.vpnGateway = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteVpnGatewayRequest} DeleteVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) + if (!$util.isString(message.vpnGateway)) + return "vpnGateway: string expected"; + return null; + }; + + /** + * Creates a DeleteVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteVpnGatewayRequest} DeleteVpnGatewayRequest + */ + DeleteVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.vpnGateway != null) + message.vpnGateway = String(object.vpnGateway); + return message; + }; + + /** + * Creates a plain object from a DeleteVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.DeleteVpnGatewayRequest} message DeleteVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.vpnGateway = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) + object.vpnGateway = message.vpnGateway; + return object; + }; + + /** + * Converts this DeleteVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteVpnGatewayRequest; + })(); + + v1.GetVpnGatewayRequest = (function() { + + /** + * Properties of a GetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetVpnGatewayRequest + * @property {string|null} [project] GetVpnGatewayRequest project + * @property {string|null} [region] GetVpnGatewayRequest region + * @property {string|null} [vpnGateway] GetVpnGatewayRequest vpnGateway + */ + + /** + * Constructs a new GetVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetVpnGatewayRequest. + * @implements IGetVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IGetVpnGatewayRequest=} [properties] Properties to set + */ + function GetVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @instance + */ + GetVpnGatewayRequest.prototype.project = ""; + + /** + * GetVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @instance + */ + GetVpnGatewayRequest.prototype.region = ""; + + /** + * GetVpnGatewayRequest vpnGateway. + * @member {string} vpnGateway + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @instance + */ + GetVpnGatewayRequest.prototype.vpnGateway = ""; + + /** + * Creates a new GetVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetVpnGatewayRequest} GetVpnGatewayRequest instance + */ + GetVpnGatewayRequest.create = function create(properties) { + return new GetVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified GetVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetVpnGatewayRequest} message GetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.vpnGateway != null && Object.hasOwnProperty.call(message, "vpnGateway")) + writer.uint32(/* id 406684153, wireType 2 =*/3253473226).string(message.vpnGateway); + return writer; + }; + + /** + * Encodes the specified GetVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetVpnGatewayRequest} message GetVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetVpnGatewayRequest} GetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 406684153: + message.vpnGateway = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetVpnGatewayRequest} GetVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) + if (!$util.isString(message.vpnGateway)) + return "vpnGateway: string expected"; + return null; + }; + + /** + * Creates a GetVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetVpnGatewayRequest} GetVpnGatewayRequest + */ + GetVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.vpnGateway != null) + message.vpnGateway = String(object.vpnGateway); + return message; + }; + + /** + * Creates a plain object from a GetVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.GetVpnGatewayRequest} message GetVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.vpnGateway = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) + object.vpnGateway = message.vpnGateway; + return object; + }; + + /** + * Converts this GetVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + GetVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetVpnGatewayRequest; + })(); + + v1.GetStatusVpnGatewayRequest = (function() { + + /** + * Properties of a GetStatusVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetStatusVpnGatewayRequest + * @property {string|null} [project] GetStatusVpnGatewayRequest project + * @property {string|null} [region] GetStatusVpnGatewayRequest region + * @property {string|null} [vpnGateway] GetStatusVpnGatewayRequest vpnGateway + */ + + /** + * Constructs a new GetStatusVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetStatusVpnGatewayRequest. + * @implements IGetStatusVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IGetStatusVpnGatewayRequest=} [properties] Properties to set + */ + function GetStatusVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetStatusVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @instance + */ + GetStatusVpnGatewayRequest.prototype.project = ""; + + /** + * GetStatusVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @instance + */ + GetStatusVpnGatewayRequest.prototype.region = ""; + + /** + * GetStatusVpnGatewayRequest vpnGateway. + * @member {string} vpnGateway + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @instance + */ + GetStatusVpnGatewayRequest.prototype.vpnGateway = ""; + + /** + * Creates a new GetStatusVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetStatusVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetStatusVpnGatewayRequest} GetStatusVpnGatewayRequest instance + */ + GetStatusVpnGatewayRequest.create = function create(properties) { + return new GetStatusVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified GetStatusVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.GetStatusVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetStatusVpnGatewayRequest} message GetStatusVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.vpnGateway != null && Object.hasOwnProperty.call(message, "vpnGateway")) + writer.uint32(/* id 406684153, wireType 2 =*/3253473226).string(message.vpnGateway); + return writer; + }; + + /** + * Encodes the specified GetStatusVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetStatusVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IGetStatusVpnGatewayRequest} message GetStatusVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetStatusVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetStatusVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetStatusVpnGatewayRequest} GetStatusVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetStatusVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 406684153: + message.vpnGateway = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetStatusVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetStatusVpnGatewayRequest} GetStatusVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetStatusVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetStatusVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetStatusVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) + if (!$util.isString(message.vpnGateway)) + return "vpnGateway: string expected"; + return null; + }; + + /** + * Creates a GetStatusVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetStatusVpnGatewayRequest} GetStatusVpnGatewayRequest + */ + GetStatusVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetStatusVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetStatusVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.vpnGateway != null) + message.vpnGateway = String(object.vpnGateway); + return message; + }; + + /** + * Creates a plain object from a GetStatusVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.GetStatusVpnGatewayRequest} message GetStatusVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetStatusVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + object.vpnGateway = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.vpnGateway != null && message.hasOwnProperty("vpnGateway")) + object.vpnGateway = message.vpnGateway; + return object; + }; + + /** + * Converts this GetStatusVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetStatusVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + GetStatusVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetStatusVpnGatewayRequest; + })(); + + v1.InsertVpnGatewayRequest = (function() { + + /** + * Properties of an InsertVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertVpnGatewayRequest + * @property {string|null} [project] InsertVpnGatewayRequest project + * @property {string|null} [region] InsertVpnGatewayRequest region + * @property {string|null} [requestId] InsertVpnGatewayRequest requestId + * @property {google.cloud.compute.v1.IVpnGateway|null} [vpnGatewayResource] InsertVpnGatewayRequest vpnGatewayResource + */ + + /** + * Constructs a new InsertVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertVpnGatewayRequest. + * @implements IInsertVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertVpnGatewayRequest=} [properties] Properties to set + */ + function InsertVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @instance + */ + InsertVpnGatewayRequest.prototype.project = ""; + + /** + * InsertVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @instance + */ + InsertVpnGatewayRequest.prototype.region = ""; + + /** + * InsertVpnGatewayRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @instance + */ + InsertVpnGatewayRequest.prototype.requestId = null; + + /** + * InsertVpnGatewayRequest vpnGatewayResource. + * @member {google.cloud.compute.v1.IVpnGateway|null|undefined} vpnGatewayResource + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @instance + */ + InsertVpnGatewayRequest.prototype.vpnGatewayResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertVpnGatewayRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @instance + */ + Object.defineProperty(InsertVpnGatewayRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertVpnGatewayRequest} InsertVpnGatewayRequest instance + */ + InsertVpnGatewayRequest.create = function create(properties) { + return new InsertVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified InsertVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertVpnGatewayRequest} message InsertVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.vpnGatewayResource != null && Object.hasOwnProperty.call(message, "vpnGatewayResource")) + $root.google.cloud.compute.v1.VpnGateway.encode(message.vpnGatewayResource, writer.uint32(/* id 182688660, wireType 2 =*/1461509282).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.IInsertVpnGatewayRequest} message InsertVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertVpnGatewayRequest} InsertVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 182688660: + message.vpnGatewayResource = $root.google.cloud.compute.v1.VpnGateway.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertVpnGatewayRequest} InsertVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.vpnGatewayResource != null && message.hasOwnProperty("vpnGatewayResource")) { + var error = $root.google.cloud.compute.v1.VpnGateway.verify(message.vpnGatewayResource); + if (error) + return "vpnGatewayResource." + error; + } + return null; + }; + + /** + * Creates an InsertVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertVpnGatewayRequest} InsertVpnGatewayRequest + */ + InsertVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.vpnGatewayResource != null) { + if (typeof object.vpnGatewayResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertVpnGatewayRequest.vpnGatewayResource: object expected"); + message.vpnGatewayResource = $root.google.cloud.compute.v1.VpnGateway.fromObject(object.vpnGatewayResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.InsertVpnGatewayRequest} message InsertVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.vpnGatewayResource = null; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.vpnGatewayResource != null && message.hasOwnProperty("vpnGatewayResource")) + object.vpnGatewayResource = $root.google.cloud.compute.v1.VpnGateway.toObject(message.vpnGatewayResource, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + InsertVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertVpnGatewayRequest; + })(); + + v1.ListVpnGatewaysRequest = (function() { + + /** + * Properties of a ListVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @interface IListVpnGatewaysRequest + * @property {string|null} [filter] ListVpnGatewaysRequest filter + * @property {number|null} [maxResults] ListVpnGatewaysRequest maxResults + * @property {string|null} [orderBy] ListVpnGatewaysRequest orderBy + * @property {string|null} [pageToken] ListVpnGatewaysRequest pageToken + * @property {string|null} [project] ListVpnGatewaysRequest project + * @property {string|null} [region] ListVpnGatewaysRequest region + * @property {boolean|null} [returnPartialSuccess] ListVpnGatewaysRequest returnPartialSuccess + */ + + /** + * Constructs a new ListVpnGatewaysRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListVpnGatewaysRequest. + * @implements IListVpnGatewaysRequest + * @constructor + * @param {google.cloud.compute.v1.IListVpnGatewaysRequest=} [properties] Properties to set + */ + function ListVpnGatewaysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVpnGatewaysRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + ListVpnGatewaysRequest.prototype.filter = null; + + /** + * ListVpnGatewaysRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + ListVpnGatewaysRequest.prototype.maxResults = null; + + /** + * ListVpnGatewaysRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + ListVpnGatewaysRequest.prototype.orderBy = null; + + /** + * ListVpnGatewaysRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + ListVpnGatewaysRequest.prototype.pageToken = null; + + /** + * ListVpnGatewaysRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + ListVpnGatewaysRequest.prototype.project = ""; + + /** + * ListVpnGatewaysRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + ListVpnGatewaysRequest.prototype.region = ""; + + /** + * ListVpnGatewaysRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + ListVpnGatewaysRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListVpnGatewaysRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListVpnGatewaysRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnGatewaysRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListVpnGatewaysRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnGatewaysRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListVpnGatewaysRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnGatewaysRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListVpnGatewaysRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnGatewaysRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + */ + Object.defineProperty(ListVpnGatewaysRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListVpnGatewaysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListVpnGatewaysRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListVpnGatewaysRequest} ListVpnGatewaysRequest instance + */ + ListVpnGatewaysRequest.create = function create(properties) { + return new ListVpnGatewaysRequest(properties); + }; + + /** + * Encodes the specified ListVpnGatewaysRequest message. Does not implicitly {@link google.cloud.compute.v1.ListVpnGatewaysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListVpnGatewaysRequest} message ListVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnGatewaysRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListVpnGatewaysRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListVpnGatewaysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.IListVpnGatewaysRequest} message ListVpnGatewaysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnGatewaysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVpnGatewaysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListVpnGatewaysRequest} ListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnGatewaysRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListVpnGatewaysRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVpnGatewaysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListVpnGatewaysRequest} ListVpnGatewaysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnGatewaysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVpnGatewaysRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVpnGatewaysRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListVpnGatewaysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListVpnGatewaysRequest} ListVpnGatewaysRequest + */ + ListVpnGatewaysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListVpnGatewaysRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListVpnGatewaysRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListVpnGatewaysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @static + * @param {google.cloud.compute.v1.ListVpnGatewaysRequest} message ListVpnGatewaysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVpnGatewaysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListVpnGatewaysRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListVpnGatewaysRequest + * @instance + * @returns {Object.} JSON object + */ + ListVpnGatewaysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListVpnGatewaysRequest; + })(); + + v1.SetLabelsVpnGatewayRequest = (function() { + + /** + * Properties of a SetLabelsVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface ISetLabelsVpnGatewayRequest + * @property {string|null} [project] SetLabelsVpnGatewayRequest project + * @property {string|null} [region] SetLabelsVpnGatewayRequest region + * @property {google.cloud.compute.v1.IRegionSetLabelsRequest|null} [regionSetLabelsRequestResource] SetLabelsVpnGatewayRequest regionSetLabelsRequestResource + * @property {string|null} [requestId] SetLabelsVpnGatewayRequest requestId + * @property {string|null} [resource] SetLabelsVpnGatewayRequest resource + */ + + /** + * Constructs a new SetLabelsVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SetLabelsVpnGatewayRequest. + * @implements ISetLabelsVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.ISetLabelsVpnGatewayRequest=} [properties] Properties to set + */ + function SetLabelsVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetLabelsVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @instance + */ + SetLabelsVpnGatewayRequest.prototype.project = ""; + + /** + * SetLabelsVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @instance + */ + SetLabelsVpnGatewayRequest.prototype.region = ""; + + /** + * SetLabelsVpnGatewayRequest regionSetLabelsRequestResource. + * @member {google.cloud.compute.v1.IRegionSetLabelsRequest|null|undefined} regionSetLabelsRequestResource + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @instance + */ + SetLabelsVpnGatewayRequest.prototype.regionSetLabelsRequestResource = null; + + /** + * SetLabelsVpnGatewayRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @instance + */ + SetLabelsVpnGatewayRequest.prototype.requestId = null; + + /** + * SetLabelsVpnGatewayRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @instance + */ + SetLabelsVpnGatewayRequest.prototype.resource = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SetLabelsVpnGatewayRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @instance + */ + Object.defineProperty(SetLabelsVpnGatewayRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SetLabelsVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.SetLabelsVpnGatewayRequest} SetLabelsVpnGatewayRequest instance + */ + SetLabelsVpnGatewayRequest.create = function create(properties) { + return new SetLabelsVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified SetLabelsVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.SetLabelsVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsVpnGatewayRequest} message SetLabelsVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.regionSetLabelsRequestResource != null && Object.hasOwnProperty.call(message, "regionSetLabelsRequestResource")) + $root.google.cloud.compute.v1.RegionSetLabelsRequest.encode(message.regionSetLabelsRequestResource, writer.uint32(/* id 259357782, wireType 2 =*/2074862258).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetLabelsVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.SetLabelsVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ISetLabelsVpnGatewayRequest} message SetLabelsVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetLabelsVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetLabelsVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.SetLabelsVpnGatewayRequest} SetLabelsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.SetLabelsVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 259357782: + message.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.decode(reader, reader.uint32()); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetLabelsVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.SetLabelsVpnGatewayRequest} SetLabelsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetLabelsVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetLabelsVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetLabelsVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.regionSetLabelsRequestResource != null && message.hasOwnProperty("regionSetLabelsRequestResource")) { + var error = $root.google.cloud.compute.v1.RegionSetLabelsRequest.verify(message.regionSetLabelsRequestResource); + if (error) + return "regionSetLabelsRequestResource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a SetLabelsVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.SetLabelsVpnGatewayRequest} SetLabelsVpnGatewayRequest + */ + SetLabelsVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.SetLabelsVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.SetLabelsVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.regionSetLabelsRequestResource != null) { + if (typeof object.regionSetLabelsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.SetLabelsVpnGatewayRequest.regionSetLabelsRequestResource: object expected"); + message.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.fromObject(object.regionSetLabelsRequestResource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a SetLabelsVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.SetLabelsVpnGatewayRequest} message SetLabelsVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetLabelsVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.regionSetLabelsRequestResource = null; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.regionSetLabelsRequestResource != null && message.hasOwnProperty("regionSetLabelsRequestResource")) + object.regionSetLabelsRequestResource = $root.google.cloud.compute.v1.RegionSetLabelsRequest.toObject(message.regionSetLabelsRequestResource, options); + return object; + }; + + /** + * Converts this SetLabelsVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.SetLabelsVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + SetLabelsVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetLabelsVpnGatewayRequest; + })(); + + v1.TestIamPermissionsVpnGatewayRequest = (function() { + + /** + * Properties of a TestIamPermissionsVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @interface ITestIamPermissionsVpnGatewayRequest + * @property {string|null} [project] TestIamPermissionsVpnGatewayRequest project + * @property {string|null} [region] TestIamPermissionsVpnGatewayRequest region + * @property {string|null} [resource] TestIamPermissionsVpnGatewayRequest resource + * @property {google.cloud.compute.v1.ITestPermissionsRequest|null} [testPermissionsRequestResource] TestIamPermissionsVpnGatewayRequest testPermissionsRequestResource + */ + + /** + * Constructs a new TestIamPermissionsVpnGatewayRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TestIamPermissionsVpnGatewayRequest. + * @implements ITestIamPermissionsVpnGatewayRequest + * @constructor + * @param {google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest=} [properties] Properties to set + */ + function TestIamPermissionsVpnGatewayRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TestIamPermissionsVpnGatewayRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @instance + */ + TestIamPermissionsVpnGatewayRequest.prototype.project = ""; + + /** + * TestIamPermissionsVpnGatewayRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @instance + */ + TestIamPermissionsVpnGatewayRequest.prototype.region = ""; + + /** + * TestIamPermissionsVpnGatewayRequest resource. + * @member {string} resource + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @instance + */ + TestIamPermissionsVpnGatewayRequest.prototype.resource = ""; + + /** + * TestIamPermissionsVpnGatewayRequest testPermissionsRequestResource. + * @member {google.cloud.compute.v1.ITestPermissionsRequest|null|undefined} testPermissionsRequestResource + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @instance + */ + TestIamPermissionsVpnGatewayRequest.prototype.testPermissionsRequestResource = null; + + /** + * Creates a new TestIamPermissionsVpnGatewayRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest} TestIamPermissionsVpnGatewayRequest instance + */ + TestIamPermissionsVpnGatewayRequest.create = function create(properties) { + return new TestIamPermissionsVpnGatewayRequest(properties); + }; + + /** + * Encodes the specified TestIamPermissionsVpnGatewayRequest message. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest} message TestIamPermissionsVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsVpnGatewayRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 195806222, wireType 2 =*/1566449778).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.testPermissionsRequestResource != null && Object.hasOwnProperty.call(message, "testPermissionsRequestResource")) + $root.google.cloud.compute.v1.TestPermissionsRequest.encode(message.testPermissionsRequestResource, writer.uint32(/* id 439214758, wireType 2 =*/3513718066).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TestIamPermissionsVpnGatewayRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest} message TestIamPermissionsVpnGatewayRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TestIamPermissionsVpnGatewayRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TestIamPermissionsVpnGatewayRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest} TestIamPermissionsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsVpnGatewayRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 195806222: + message.resource = reader.string(); + break; + case 439214758: + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TestIamPermissionsVpnGatewayRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest} TestIamPermissionsVpnGatewayRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TestIamPermissionsVpnGatewayRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TestIamPermissionsVpnGatewayRequest message. + * @function verify + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TestIamPermissionsVpnGatewayRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) { + var error = $root.google.cloud.compute.v1.TestPermissionsRequest.verify(message.testPermissionsRequestResource); + if (error) + return "testPermissionsRequestResource." + error; + } + return null; + }; + + /** + * Creates a TestIamPermissionsVpnGatewayRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest} TestIamPermissionsVpnGatewayRequest + */ + TestIamPermissionsVpnGatewayRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest) + return object; + var message = new $root.google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.resource != null) + message.resource = String(object.resource); + if (object.testPermissionsRequestResource != null) { + if (typeof object.testPermissionsRequestResource !== "object") + throw TypeError(".google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest.testPermissionsRequestResource: object expected"); + message.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.fromObject(object.testPermissionsRequestResource); + } + return message; + }; + + /** + * Creates a plain object from a TestIamPermissionsVpnGatewayRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @static + * @param {google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest} message TestIamPermissionsVpnGatewayRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TestIamPermissionsVpnGatewayRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.resource = ""; + object.project = ""; + object.testPermissionsRequestResource = null; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.testPermissionsRequestResource != null && message.hasOwnProperty("testPermissionsRequestResource")) + object.testPermissionsRequestResource = $root.google.cloud.compute.v1.TestPermissionsRequest.toObject(message.testPermissionsRequestResource, options); + return object; + }; + + /** + * Converts this TestIamPermissionsVpnGatewayRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest + * @instance + * @returns {Object.} JSON object + */ + TestIamPermissionsVpnGatewayRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TestIamPermissionsVpnGatewayRequest; + })(); + + v1.AggregatedListVpnTunnelsRequest = (function() { + + /** + * Properties of an AggregatedListVpnTunnelsRequest. + * @memberof google.cloud.compute.v1 + * @interface IAggregatedListVpnTunnelsRequest + * @property {string|null} [filter] AggregatedListVpnTunnelsRequest filter + * @property {boolean|null} [includeAllScopes] AggregatedListVpnTunnelsRequest includeAllScopes + * @property {number|null} [maxResults] AggregatedListVpnTunnelsRequest maxResults + * @property {string|null} [orderBy] AggregatedListVpnTunnelsRequest orderBy + * @property {string|null} [pageToken] AggregatedListVpnTunnelsRequest pageToken + * @property {string|null} [project] AggregatedListVpnTunnelsRequest project + * @property {boolean|null} [returnPartialSuccess] AggregatedListVpnTunnelsRequest returnPartialSuccess + */ + + /** + * Constructs a new AggregatedListVpnTunnelsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AggregatedListVpnTunnelsRequest. + * @implements IAggregatedListVpnTunnelsRequest + * @constructor + * @param {google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest=} [properties] Properties to set + */ + function AggregatedListVpnTunnelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregatedListVpnTunnelsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + AggregatedListVpnTunnelsRequest.prototype.filter = null; + + /** + * AggregatedListVpnTunnelsRequest includeAllScopes. + * @member {boolean|null|undefined} includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + AggregatedListVpnTunnelsRequest.prototype.includeAllScopes = null; + + /** + * AggregatedListVpnTunnelsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + AggregatedListVpnTunnelsRequest.prototype.maxResults = null; + + /** + * AggregatedListVpnTunnelsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + AggregatedListVpnTunnelsRequest.prototype.orderBy = null; + + /** + * AggregatedListVpnTunnelsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + AggregatedListVpnTunnelsRequest.prototype.pageToken = null; + + /** + * AggregatedListVpnTunnelsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + AggregatedListVpnTunnelsRequest.prototype.project = ""; + + /** + * AggregatedListVpnTunnelsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + AggregatedListVpnTunnelsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AggregatedListVpnTunnelsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnTunnelsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnTunnelsRequest _includeAllScopes. + * @member {"includeAllScopes"|undefined} _includeAllScopes + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnTunnelsRequest.prototype, "_includeAllScopes", { + get: $util.oneOfGetter($oneOfFields = ["includeAllScopes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnTunnelsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnTunnelsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnTunnelsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnTunnelsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnTunnelsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnTunnelsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AggregatedListVpnTunnelsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(AggregatedListVpnTunnelsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AggregatedListVpnTunnelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.AggregatedListVpnTunnelsRequest} AggregatedListVpnTunnelsRequest instance + */ + AggregatedListVpnTunnelsRequest.create = function create(properties) { + return new AggregatedListVpnTunnelsRequest(properties); + }; + + /** + * Encodes the specified AggregatedListVpnTunnelsRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnTunnelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest} message AggregatedListVpnTunnelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListVpnTunnelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.includeAllScopes != null && Object.hasOwnProperty.call(message, "includeAllScopes")) + writer.uint32(/* id 391327988, wireType 0 =*/3130623904).bool(message.includeAllScopes); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified AggregatedListVpnTunnelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListVpnTunnelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest} message AggregatedListVpnTunnelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregatedListVpnTunnelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregatedListVpnTunnelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.AggregatedListVpnTunnelsRequest} AggregatedListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListVpnTunnelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.AggregatedListVpnTunnelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 391327988: + message.includeAllScopes = reader.bool(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregatedListVpnTunnelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.AggregatedListVpnTunnelsRequest} AggregatedListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregatedListVpnTunnelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregatedListVpnTunnelsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregatedListVpnTunnelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + properties._includeAllScopes = 1; + if (typeof message.includeAllScopes !== "boolean") + return "includeAllScopes: boolean expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates an AggregatedListVpnTunnelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.AggregatedListVpnTunnelsRequest} AggregatedListVpnTunnelsRequest + */ + AggregatedListVpnTunnelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.AggregatedListVpnTunnelsRequest) + return object; + var message = new $root.google.cloud.compute.v1.AggregatedListVpnTunnelsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.includeAllScopes != null) + message.includeAllScopes = Boolean(object.includeAllScopes); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from an AggregatedListVpnTunnelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.AggregatedListVpnTunnelsRequest} message AggregatedListVpnTunnelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregatedListVpnTunnelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.includeAllScopes != null && message.hasOwnProperty("includeAllScopes")) { + object.includeAllScopes = message.includeAllScopes; + if (options.oneofs) + object._includeAllScopes = "includeAllScopes"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this AggregatedListVpnTunnelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.AggregatedListVpnTunnelsRequest + * @instance + * @returns {Object.} JSON object + */ + AggregatedListVpnTunnelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregatedListVpnTunnelsRequest; + })(); + + v1.DeleteVpnTunnelRequest = (function() { + + /** + * Properties of a DeleteVpnTunnelRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteVpnTunnelRequest + * @property {string|null} [project] DeleteVpnTunnelRequest project + * @property {string|null} [region] DeleteVpnTunnelRequest region + * @property {string|null} [requestId] DeleteVpnTunnelRequest requestId + * @property {string|null} [vpnTunnel] DeleteVpnTunnelRequest vpnTunnel + */ + + /** + * Constructs a new DeleteVpnTunnelRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteVpnTunnelRequest. + * @implements IDeleteVpnTunnelRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteVpnTunnelRequest=} [properties] Properties to set + */ + function DeleteVpnTunnelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteVpnTunnelRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @instance + */ + DeleteVpnTunnelRequest.prototype.project = ""; + + /** + * DeleteVpnTunnelRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @instance + */ + DeleteVpnTunnelRequest.prototype.region = ""; + + /** + * DeleteVpnTunnelRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @instance + */ + DeleteVpnTunnelRequest.prototype.requestId = null; + + /** + * DeleteVpnTunnelRequest vpnTunnel. + * @member {string} vpnTunnel + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @instance + */ + DeleteVpnTunnelRequest.prototype.vpnTunnel = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeleteVpnTunnelRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @instance + */ + Object.defineProperty(DeleteVpnTunnelRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeleteVpnTunnelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IDeleteVpnTunnelRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteVpnTunnelRequest} DeleteVpnTunnelRequest instance + */ + DeleteVpnTunnelRequest.create = function create(properties) { + return new DeleteVpnTunnelRequest(properties); + }; + + /** + * Encodes the specified DeleteVpnTunnelRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnTunnelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IDeleteVpnTunnelRequest} message DeleteVpnTunnelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVpnTunnelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.vpnTunnel != null && Object.hasOwnProperty.call(message, "vpnTunnel")) + writer.uint32(/* id 143821331, wireType 2 =*/1150570650).string(message.vpnTunnel); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteVpnTunnelRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteVpnTunnelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IDeleteVpnTunnelRequest} message DeleteVpnTunnelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVpnTunnelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVpnTunnelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteVpnTunnelRequest} DeleteVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVpnTunnelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteVpnTunnelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 143821331: + message.vpnTunnel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVpnTunnelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteVpnTunnelRequest} DeleteVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVpnTunnelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVpnTunnelRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVpnTunnelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.vpnTunnel != null && message.hasOwnProperty("vpnTunnel")) + if (!$util.isString(message.vpnTunnel)) + return "vpnTunnel: string expected"; + return null; + }; + + /** + * Creates a DeleteVpnTunnelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteVpnTunnelRequest} DeleteVpnTunnelRequest + */ + DeleteVpnTunnelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteVpnTunnelRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteVpnTunnelRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.vpnTunnel != null) + message.vpnTunnel = String(object.vpnTunnel); + return message; + }; + + /** + * Creates a plain object from a DeleteVpnTunnelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.DeleteVpnTunnelRequest} message DeleteVpnTunnelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVpnTunnelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.vpnTunnel = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.vpnTunnel != null && message.hasOwnProperty("vpnTunnel")) + object.vpnTunnel = message.vpnTunnel; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteVpnTunnelRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteVpnTunnelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVpnTunnelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteVpnTunnelRequest; + })(); + + v1.GetVpnTunnelRequest = (function() { + + /** + * Properties of a GetVpnTunnelRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetVpnTunnelRequest + * @property {string|null} [project] GetVpnTunnelRequest project + * @property {string|null} [region] GetVpnTunnelRequest region + * @property {string|null} [vpnTunnel] GetVpnTunnelRequest vpnTunnel + */ + + /** + * Constructs a new GetVpnTunnelRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetVpnTunnelRequest. + * @implements IGetVpnTunnelRequest + * @constructor + * @param {google.cloud.compute.v1.IGetVpnTunnelRequest=} [properties] Properties to set + */ + function GetVpnTunnelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVpnTunnelRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @instance + */ + GetVpnTunnelRequest.prototype.project = ""; + + /** + * GetVpnTunnelRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @instance + */ + GetVpnTunnelRequest.prototype.region = ""; + + /** + * GetVpnTunnelRequest vpnTunnel. + * @member {string} vpnTunnel + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @instance + */ + GetVpnTunnelRequest.prototype.vpnTunnel = ""; + + /** + * Creates a new GetVpnTunnelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IGetVpnTunnelRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetVpnTunnelRequest} GetVpnTunnelRequest instance + */ + GetVpnTunnelRequest.create = function create(properties) { + return new GetVpnTunnelRequest(properties); + }; + + /** + * Encodes the specified GetVpnTunnelRequest message. Does not implicitly {@link google.cloud.compute.v1.GetVpnTunnelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IGetVpnTunnelRequest} message GetVpnTunnelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVpnTunnelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.vpnTunnel != null && Object.hasOwnProperty.call(message, "vpnTunnel")) + writer.uint32(/* id 143821331, wireType 2 =*/1150570650).string(message.vpnTunnel); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetVpnTunnelRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetVpnTunnelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IGetVpnTunnelRequest} message GetVpnTunnelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVpnTunnelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVpnTunnelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetVpnTunnelRequest} GetVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVpnTunnelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetVpnTunnelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 143821331: + message.vpnTunnel = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetVpnTunnelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetVpnTunnelRequest} GetVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVpnTunnelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVpnTunnelRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVpnTunnelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.vpnTunnel != null && message.hasOwnProperty("vpnTunnel")) + if (!$util.isString(message.vpnTunnel)) + return "vpnTunnel: string expected"; + return null; + }; + + /** + * Creates a GetVpnTunnelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetVpnTunnelRequest} GetVpnTunnelRequest + */ + GetVpnTunnelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetVpnTunnelRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetVpnTunnelRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.vpnTunnel != null) + message.vpnTunnel = String(object.vpnTunnel); + return message; + }; + + /** + * Creates a plain object from a GetVpnTunnelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.GetVpnTunnelRequest} message GetVpnTunnelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVpnTunnelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.vpnTunnel = ""; + object.project = ""; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.vpnTunnel != null && message.hasOwnProperty("vpnTunnel")) + object.vpnTunnel = message.vpnTunnel; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetVpnTunnelRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetVpnTunnelRequest + * @instance + * @returns {Object.} JSON object + */ + GetVpnTunnelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetVpnTunnelRequest; + })(); + + v1.InsertVpnTunnelRequest = (function() { + + /** + * Properties of an InsertVpnTunnelRequest. + * @memberof google.cloud.compute.v1 + * @interface IInsertVpnTunnelRequest + * @property {string|null} [project] InsertVpnTunnelRequest project + * @property {string|null} [region] InsertVpnTunnelRequest region + * @property {string|null} [requestId] InsertVpnTunnelRequest requestId + * @property {google.cloud.compute.v1.IVpnTunnel|null} [vpnTunnelResource] InsertVpnTunnelRequest vpnTunnelResource + */ + + /** + * Constructs a new InsertVpnTunnelRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InsertVpnTunnelRequest. + * @implements IInsertVpnTunnelRequest + * @constructor + * @param {google.cloud.compute.v1.IInsertVpnTunnelRequest=} [properties] Properties to set + */ + function InsertVpnTunnelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertVpnTunnelRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @instance + */ + InsertVpnTunnelRequest.prototype.project = ""; + + /** + * InsertVpnTunnelRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @instance + */ + InsertVpnTunnelRequest.prototype.region = ""; + + /** + * InsertVpnTunnelRequest requestId. + * @member {string|null|undefined} requestId + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @instance + */ + InsertVpnTunnelRequest.prototype.requestId = null; + + /** + * InsertVpnTunnelRequest vpnTunnelResource. + * @member {google.cloud.compute.v1.IVpnTunnel|null|undefined} vpnTunnelResource + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @instance + */ + InsertVpnTunnelRequest.prototype.vpnTunnelResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InsertVpnTunnelRequest _requestId. + * @member {"requestId"|undefined} _requestId + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @instance + */ + Object.defineProperty(InsertVpnTunnelRequest.prototype, "_requestId", { + get: $util.oneOfGetter($oneOfFields = ["requestId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InsertVpnTunnelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IInsertVpnTunnelRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.InsertVpnTunnelRequest} InsertVpnTunnelRequest instance + */ + InsertVpnTunnelRequest.create = function create(properties) { + return new InsertVpnTunnelRequest(properties); + }; + + /** + * Encodes the specified InsertVpnTunnelRequest message. Does not implicitly {@link google.cloud.compute.v1.InsertVpnTunnelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IInsertVpnTunnelRequest} message InsertVpnTunnelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertVpnTunnelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 37109963, wireType 2 =*/296879706).string(message.requestId); + if (message.vpnTunnelResource != null && Object.hasOwnProperty.call(message, "vpnTunnelResource")) + $root.google.cloud.compute.v1.VpnTunnel.encode(message.vpnTunnelResource, writer.uint32(/* id 86839482, wireType 2 =*/694715858).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified InsertVpnTunnelRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.InsertVpnTunnelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.IInsertVpnTunnelRequest} message InsertVpnTunnelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertVpnTunnelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertVpnTunnelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.InsertVpnTunnelRequest} InsertVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertVpnTunnelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.InsertVpnTunnelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 37109963: + message.requestId = reader.string(); + break; + case 86839482: + message.vpnTunnelResource = $root.google.cloud.compute.v1.VpnTunnel.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertVpnTunnelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.InsertVpnTunnelRequest} InsertVpnTunnelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertVpnTunnelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertVpnTunnelRequest message. + * @function verify + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertVpnTunnelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) { + properties._requestId = 1; + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + } + if (message.vpnTunnelResource != null && message.hasOwnProperty("vpnTunnelResource")) { + var error = $root.google.cloud.compute.v1.VpnTunnel.verify(message.vpnTunnelResource); + if (error) + return "vpnTunnelResource." + error; + } + return null; + }; + + /** + * Creates an InsertVpnTunnelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.InsertVpnTunnelRequest} InsertVpnTunnelRequest + */ + InsertVpnTunnelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.InsertVpnTunnelRequest) + return object; + var message = new $root.google.cloud.compute.v1.InsertVpnTunnelRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.vpnTunnelResource != null) { + if (typeof object.vpnTunnelResource !== "object") + throw TypeError(".google.cloud.compute.v1.InsertVpnTunnelRequest.vpnTunnelResource: object expected"); + message.vpnTunnelResource = $root.google.cloud.compute.v1.VpnTunnel.fromObject(object.vpnTunnelResource); + } + return message; + }; + + /** + * Creates a plain object from an InsertVpnTunnelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @static + * @param {google.cloud.compute.v1.InsertVpnTunnelRequest} message InsertVpnTunnelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertVpnTunnelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vpnTunnelResource = null; + object.region = ""; + object.project = ""; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) { + object.requestId = message.requestId; + if (options.oneofs) + object._requestId = "requestId"; + } + if (message.vpnTunnelResource != null && message.hasOwnProperty("vpnTunnelResource")) + object.vpnTunnelResource = $root.google.cloud.compute.v1.VpnTunnel.toObject(message.vpnTunnelResource, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this InsertVpnTunnelRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.InsertVpnTunnelRequest + * @instance + * @returns {Object.} JSON object + */ + InsertVpnTunnelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InsertVpnTunnelRequest; + })(); + + v1.ListVpnTunnelsRequest = (function() { + + /** + * Properties of a ListVpnTunnelsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListVpnTunnelsRequest + * @property {string|null} [filter] ListVpnTunnelsRequest filter + * @property {number|null} [maxResults] ListVpnTunnelsRequest maxResults + * @property {string|null} [orderBy] ListVpnTunnelsRequest orderBy + * @property {string|null} [pageToken] ListVpnTunnelsRequest pageToken + * @property {string|null} [project] ListVpnTunnelsRequest project + * @property {string|null} [region] ListVpnTunnelsRequest region + * @property {boolean|null} [returnPartialSuccess] ListVpnTunnelsRequest returnPartialSuccess + */ + + /** + * Constructs a new ListVpnTunnelsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListVpnTunnelsRequest. + * @implements IListVpnTunnelsRequest + * @constructor + * @param {google.cloud.compute.v1.IListVpnTunnelsRequest=} [properties] Properties to set + */ + function ListVpnTunnelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVpnTunnelsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + ListVpnTunnelsRequest.prototype.filter = null; + + /** + * ListVpnTunnelsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + ListVpnTunnelsRequest.prototype.maxResults = null; + + /** + * ListVpnTunnelsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + ListVpnTunnelsRequest.prototype.orderBy = null; + + /** + * ListVpnTunnelsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + ListVpnTunnelsRequest.prototype.pageToken = null; + + /** + * ListVpnTunnelsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + ListVpnTunnelsRequest.prototype.project = ""; + + /** + * ListVpnTunnelsRequest region. + * @member {string} region + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + ListVpnTunnelsRequest.prototype.region = ""; + + /** + * ListVpnTunnelsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + ListVpnTunnelsRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListVpnTunnelsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(ListVpnTunnelsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnTunnelsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(ListVpnTunnelsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnTunnelsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(ListVpnTunnelsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnTunnelsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(ListVpnTunnelsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListVpnTunnelsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + */ + Object.defineProperty(ListVpnTunnelsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListVpnTunnelsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.IListVpnTunnelsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListVpnTunnelsRequest} ListVpnTunnelsRequest instance + */ + ListVpnTunnelsRequest.create = function create(properties) { + return new ListVpnTunnelsRequest(properties); + }; + + /** + * Encodes the specified ListVpnTunnelsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListVpnTunnelsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.IListVpnTunnelsRequest} message ListVpnTunnelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnTunnelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 138946292, wireType 2 =*/1111570338).string(message.region); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListVpnTunnelsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListVpnTunnelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.IListVpnTunnelsRequest} message ListVpnTunnelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVpnTunnelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVpnTunnelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListVpnTunnelsRequest} ListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnTunnelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListVpnTunnelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 138946292: + message.region = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListVpnTunnelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListVpnTunnelsRequest} ListVpnTunnelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVpnTunnelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVpnTunnelsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVpnTunnelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListVpnTunnelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListVpnTunnelsRequest} ListVpnTunnelsRequest + */ + ListVpnTunnelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListVpnTunnelsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListVpnTunnelsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListVpnTunnelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @static + * @param {google.cloud.compute.v1.ListVpnTunnelsRequest} message ListVpnTunnelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVpnTunnelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.region = ""; + object.project = ""; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListVpnTunnelsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListVpnTunnelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListVpnTunnelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListVpnTunnelsRequest; + })(); + + v1.DeleteZoneOperationRequest = (function() { + + /** + * Properties of a DeleteZoneOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IDeleteZoneOperationRequest + * @property {string|null} [operation] DeleteZoneOperationRequest operation + * @property {string|null} [project] DeleteZoneOperationRequest project + * @property {string|null} [zone] DeleteZoneOperationRequest zone + */ + + /** + * Constructs a new DeleteZoneOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteZoneOperationRequest. + * @implements IDeleteZoneOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IDeleteZoneOperationRequest=} [properties] Properties to set + */ + function DeleteZoneOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteZoneOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @instance + */ + DeleteZoneOperationRequest.prototype.operation = ""; + + /** + * DeleteZoneOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @instance + */ + DeleteZoneOperationRequest.prototype.project = ""; + + /** + * DeleteZoneOperationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @instance + */ + DeleteZoneOperationRequest.prototype.zone = ""; + + /** + * Creates a new DeleteZoneOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteZoneOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteZoneOperationRequest} DeleteZoneOperationRequest instance + */ + DeleteZoneOperationRequest.create = function create(properties) { + return new DeleteZoneOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteZoneOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteZoneOperationRequest} message DeleteZoneOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteZoneOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified DeleteZoneOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IDeleteZoneOperationRequest} message DeleteZoneOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteZoneOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteZoneOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteZoneOperationRequest} DeleteZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteZoneOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteZoneOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteZoneOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteZoneOperationRequest} DeleteZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteZoneOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteZoneOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteZoneOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DeleteZoneOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteZoneOperationRequest} DeleteZoneOperationRequest + */ + DeleteZoneOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteZoneOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.DeleteZoneOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DeleteZoneOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.DeleteZoneOperationRequest} message DeleteZoneOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteZoneOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.operation = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this DeleteZoneOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteZoneOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteZoneOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteZoneOperationRequest; + })(); + + v1.DeleteZoneOperationResponse = (function() { + + /** + * Properties of a DeleteZoneOperationResponse. + * @memberof google.cloud.compute.v1 + * @interface IDeleteZoneOperationResponse + */ + + /** + * Constructs a new DeleteZoneOperationResponse. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DeleteZoneOperationResponse. + * @implements IDeleteZoneOperationResponse + * @constructor + * @param {google.cloud.compute.v1.IDeleteZoneOperationResponse=} [properties] Properties to set + */ + function DeleteZoneOperationResponse(properties) { + if (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 DeleteZoneOperationResponse instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteZoneOperationResponse=} [properties] Properties to set + * @returns {google.cloud.compute.v1.DeleteZoneOperationResponse} DeleteZoneOperationResponse instance + */ + DeleteZoneOperationResponse.create = function create(properties) { + return new DeleteZoneOperationResponse(properties); + }; + + /** + * Encodes the specified DeleteZoneOperationResponse message. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteZoneOperationResponse} message DeleteZoneOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteZoneOperationResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified DeleteZoneOperationResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteZoneOperationResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {google.cloud.compute.v1.IDeleteZoneOperationResponse} message DeleteZoneOperationResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteZoneOperationResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteZoneOperationResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.DeleteZoneOperationResponse} DeleteZoneOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteZoneOperationResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.DeleteZoneOperationResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteZoneOperationResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.DeleteZoneOperationResponse} DeleteZoneOperationResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteZoneOperationResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteZoneOperationResponse message. + * @function verify + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteZoneOperationResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a DeleteZoneOperationResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.DeleteZoneOperationResponse} DeleteZoneOperationResponse + */ + DeleteZoneOperationResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.DeleteZoneOperationResponse) + return object; + return new $root.google.cloud.compute.v1.DeleteZoneOperationResponse(); + }; + + /** + * Creates a plain object from a DeleteZoneOperationResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @static + * @param {google.cloud.compute.v1.DeleteZoneOperationResponse} message DeleteZoneOperationResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteZoneOperationResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this DeleteZoneOperationResponse to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.DeleteZoneOperationResponse + * @instance + * @returns {Object.} JSON object + */ + DeleteZoneOperationResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteZoneOperationResponse; + })(); + + v1.GetZoneOperationRequest = (function() { + + /** + * Properties of a GetZoneOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetZoneOperationRequest + * @property {string|null} [operation] GetZoneOperationRequest operation + * @property {string|null} [project] GetZoneOperationRequest project + * @property {string|null} [zone] GetZoneOperationRequest zone + */ + + /** + * Constructs a new GetZoneOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetZoneOperationRequest. + * @implements IGetZoneOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IGetZoneOperationRequest=} [properties] Properties to set + */ + function GetZoneOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetZoneOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @instance + */ + GetZoneOperationRequest.prototype.operation = ""; + + /** + * GetZoneOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @instance + */ + GetZoneOperationRequest.prototype.project = ""; + + /** + * GetZoneOperationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @instance + */ + GetZoneOperationRequest.prototype.zone = ""; + + /** + * Creates a new GetZoneOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetZoneOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetZoneOperationRequest} GetZoneOperationRequest instance + */ + GetZoneOperationRequest.create = function create(properties) { + return new GetZoneOperationRequest(properties); + }; + + /** + * Encodes the specified GetZoneOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.GetZoneOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetZoneOperationRequest} message GetZoneOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetZoneOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetZoneOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetZoneOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IGetZoneOperationRequest} message GetZoneOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetZoneOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetZoneOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.GetZoneOperationRequest} GetZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetZoneOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.GetZoneOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetZoneOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.GetZoneOperationRequest} GetZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetZoneOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetZoneOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetZoneOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a GetZoneOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetZoneOperationRequest} GetZoneOperationRequest + */ + GetZoneOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetZoneOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetZoneOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetZoneOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.GetZoneOperationRequest} message GetZoneOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetZoneOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.operation = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetZoneOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetZoneOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetZoneOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetZoneOperationRequest; + })(); + + v1.ListZoneOperationsRequest = (function() { + + /** + * Properties of a ListZoneOperationsRequest. + * @memberof google.cloud.compute.v1 + * @interface IListZoneOperationsRequest + * @property {string|null} [filter] ListZoneOperationsRequest filter + * @property {number|null} [maxResults] ListZoneOperationsRequest maxResults + * @property {string|null} [orderBy] ListZoneOperationsRequest orderBy + * @property {string|null} [pageToken] ListZoneOperationsRequest pageToken + * @property {string|null} [project] ListZoneOperationsRequest project + * @property {boolean|null} [returnPartialSuccess] ListZoneOperationsRequest returnPartialSuccess + * @property {string|null} [zone] ListZoneOperationsRequest zone + */ + + /** + * Constructs a new ListZoneOperationsRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListZoneOperationsRequest. + * @implements IListZoneOperationsRequest + * @constructor + * @param {google.cloud.compute.v1.IListZoneOperationsRequest=} [properties] Properties to set + */ + function ListZoneOperationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListZoneOperationsRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + ListZoneOperationsRequest.prototype.filter = null; + + /** + * ListZoneOperationsRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + ListZoneOperationsRequest.prototype.maxResults = null; + + /** + * ListZoneOperationsRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + ListZoneOperationsRequest.prototype.orderBy = null; + + /** + * ListZoneOperationsRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + ListZoneOperationsRequest.prototype.pageToken = null; + + /** + * ListZoneOperationsRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + ListZoneOperationsRequest.prototype.project = ""; + + /** + * ListZoneOperationsRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + ListZoneOperationsRequest.prototype.returnPartialSuccess = null; + + /** + * ListZoneOperationsRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + ListZoneOperationsRequest.prototype.zone = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListZoneOperationsRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + Object.defineProperty(ListZoneOperationsRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZoneOperationsRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + Object.defineProperty(ListZoneOperationsRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZoneOperationsRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + Object.defineProperty(ListZoneOperationsRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZoneOperationsRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + Object.defineProperty(ListZoneOperationsRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZoneOperationsRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + */ + Object.defineProperty(ListZoneOperationsRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListZoneOperationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListZoneOperationsRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListZoneOperationsRequest} ListZoneOperationsRequest instance + */ + ListZoneOperationsRequest.create = function create(properties) { + return new ListZoneOperationsRequest(properties); + }; + + /** + * Encodes the specified ListZoneOperationsRequest message. Does not implicitly {@link google.cloud.compute.v1.ListZoneOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListZoneOperationsRequest} message ListZoneOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZoneOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListZoneOperationsRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListZoneOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {google.cloud.compute.v1.IListZoneOperationsRequest} message ListZoneOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListZoneOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListZoneOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.ListZoneOperationsRequest} ListZoneOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZoneOperationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.ListZoneOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListZoneOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.ListZoneOperationsRequest} ListZoneOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListZoneOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListZoneOperationsRequest message. + * @function verify + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListZoneOperationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ListZoneOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListZoneOperationsRequest} ListZoneOperationsRequest + */ + ListZoneOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListZoneOperationsRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListZoneOperationsRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ListZoneOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @static + * @param {google.cloud.compute.v1.ListZoneOperationsRequest} message ListZoneOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListZoneOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListZoneOperationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListZoneOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListZoneOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListZoneOperationsRequest; + })(); + + v1.WaitZoneOperationRequest = (function() { + + /** + * Properties of a WaitZoneOperationRequest. + * @memberof google.cloud.compute.v1 + * @interface IWaitZoneOperationRequest + * @property {string|null} [operation] WaitZoneOperationRequest operation + * @property {string|null} [project] WaitZoneOperationRequest project + * @property {string|null} [zone] WaitZoneOperationRequest zone + */ + + /** + * Constructs a new WaitZoneOperationRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a WaitZoneOperationRequest. + * @implements IWaitZoneOperationRequest + * @constructor + * @param {google.cloud.compute.v1.IWaitZoneOperationRequest=} [properties] Properties to set + */ + function WaitZoneOperationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitZoneOperationRequest operation. + * @member {string} operation + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @instance + */ + WaitZoneOperationRequest.prototype.operation = ""; + + /** + * WaitZoneOperationRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @instance + */ + WaitZoneOperationRequest.prototype.project = ""; + + /** + * WaitZoneOperationRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @instance + */ + WaitZoneOperationRequest.prototype.zone = ""; + + /** + * Creates a new WaitZoneOperationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitZoneOperationRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.WaitZoneOperationRequest} WaitZoneOperationRequest instance + */ + WaitZoneOperationRequest.create = function create(properties) { + return new WaitZoneOperationRequest(properties); + }; + + /** + * Encodes the specified WaitZoneOperationRequest message. Does not implicitly {@link google.cloud.compute.v1.WaitZoneOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitZoneOperationRequest} message WaitZoneOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitZoneOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 52090215, wireType 2 =*/416721722).string(message.operation); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified WaitZoneOperationRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.WaitZoneOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.IWaitZoneOperationRequest} message WaitZoneOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitZoneOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitZoneOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.compute.v1.WaitZoneOperationRequest} WaitZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitZoneOperationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.compute.v1.WaitZoneOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 52090215: + message.operation = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitZoneOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.v1.WaitZoneOperationRequest} WaitZoneOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitZoneOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitZoneOperationRequest message. + * @function verify + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitZoneOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a WaitZoneOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.WaitZoneOperationRequest} WaitZoneOperationRequest + */ + WaitZoneOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.WaitZoneOperationRequest) + return object; + var message = new $root.google.cloud.compute.v1.WaitZoneOperationRequest(); + if (object.operation != null) + message.operation = String(object.operation); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a WaitZoneOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @static + * @param {google.cloud.compute.v1.WaitZoneOperationRequest} message WaitZoneOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitZoneOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.operation = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this WaitZoneOperationRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.WaitZoneOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitZoneOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitZoneOperationRequest; + })(); + + v1.GetZoneRequest = (function() { + + /** + * Properties of a GetZoneRequest. + * @memberof google.cloud.compute.v1 + * @interface IGetZoneRequest + * @property {string|null} [project] GetZoneRequest project + * @property {string|null} [zone] GetZoneRequest zone + */ + + /** + * Constructs a new GetZoneRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GetZoneRequest. + * @implements IGetZoneRequest + * @constructor + * @param {google.cloud.compute.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 project. + * @member {string} project + * @memberof google.cloud.compute.v1.GetZoneRequest + * @instance + */ + GetZoneRequest.prototype.project = ""; + + /** + * GetZoneRequest zone. + * @member {string} zone + * @memberof google.cloud.compute.v1.GetZoneRequest + * @instance + */ + GetZoneRequest.prototype.zone = ""; + + /** + * Creates a new GetZoneRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.GetZoneRequest + * @static + * @param {google.cloud.compute.v1.IGetZoneRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.GetZoneRequest} GetZoneRequest instance + */ + GetZoneRequest.create = function create(properties) { + return new GetZoneRequest(properties); + }; + + /** + * Encodes the specified GetZoneRequest message. Does not implicitly {@link google.cloud.compute.v1.GetZoneRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.GetZoneRequest + * @static + * @param {google.cloud.compute.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 3744684, wireType 2 =*/29957474).string(message.zone); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + return writer; + }; + + /** + * Encodes the specified GetZoneRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetZoneRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.GetZoneRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.GetZoneRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 227560217: + message.project = reader.string(); + break; + case 3744684: + message.zone = 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.compute.v1.GetZoneRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: 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.compute.v1.GetZoneRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.GetZoneRequest} GetZoneRequest + */ + GetZoneRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.GetZoneRequest) + return object; + var message = new $root.google.cloud.compute.v1.GetZoneRequest(); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a GetZoneRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.GetZoneRequest + * @static + * @param {google.cloud.compute.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.zone = ""; + object.project = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + return object; + }; + + /** + * Converts this GetZoneRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.GetZoneRequest + * @instance + * @returns {Object.} JSON object + */ + GetZoneRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetZoneRequest; + })(); + + v1.ListZonesRequest = (function() { + + /** + * Properties of a ListZonesRequest. + * @memberof google.cloud.compute.v1 + * @interface IListZonesRequest + * @property {string|null} [filter] ListZonesRequest filter + * @property {number|null} [maxResults] ListZonesRequest maxResults + * @property {string|null} [orderBy] ListZonesRequest orderBy + * @property {string|null} [pageToken] ListZonesRequest pageToken + * @property {string|null} [project] ListZonesRequest project + * @property {boolean|null} [returnPartialSuccess] ListZonesRequest returnPartialSuccess + */ + + /** + * Constructs a new ListZonesRequest. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ListZonesRequest. + * @implements IListZonesRequest + * @constructor + * @param {google.cloud.compute.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 filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.filter = null; + + /** + * ListZonesRequest maxResults. + * @member {number|null|undefined} maxResults + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.maxResults = null; + + /** + * ListZonesRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.orderBy = null; + + /** + * ListZonesRequest pageToken. + * @member {string|null|undefined} pageToken + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.pageToken = null; + + /** + * ListZonesRequest project. + * @member {string} project + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.project = ""; + + /** + * ListZonesRequest returnPartialSuccess. + * @member {boolean|null|undefined} returnPartialSuccess + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + ListZonesRequest.prototype.returnPartialSuccess = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ListZonesRequest _filter. + * @member {"filter"|undefined} _filter + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + Object.defineProperty(ListZonesRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZonesRequest _maxResults. + * @member {"maxResults"|undefined} _maxResults + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + Object.defineProperty(ListZonesRequest.prototype, "_maxResults", { + get: $util.oneOfGetter($oneOfFields = ["maxResults"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZonesRequest _orderBy. + * @member {"orderBy"|undefined} _orderBy + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + Object.defineProperty(ListZonesRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZonesRequest _pageToken. + * @member {"pageToken"|undefined} _pageToken + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + Object.defineProperty(ListZonesRequest.prototype, "_pageToken", { + get: $util.oneOfGetter($oneOfFields = ["pageToken"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ListZonesRequest _returnPartialSuccess. + * @member {"returnPartialSuccess"|undefined} _returnPartialSuccess + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + */ + Object.defineProperty(ListZonesRequest.prototype, "_returnPartialSuccess", { + get: $util.oneOfGetter($oneOfFields = ["returnPartialSuccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListZonesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.compute.v1.ListZonesRequest + * @static + * @param {google.cloud.compute.v1.IListZonesRequest=} [properties] Properties to set + * @returns {google.cloud.compute.v1.ListZonesRequest} ListZonesRequest instance + */ + ListZonesRequest.create = function create(properties) { + return new ListZonesRequest(properties); + }; + + /** + * Encodes the specified ListZonesRequest message. Does not implicitly {@link google.cloud.compute.v1.ListZonesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.compute.v1.ListZonesRequest + * @static + * @param {google.cloud.compute.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.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 19994697, wireType 2 =*/159957578).string(message.pageToken); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 54715419, wireType 0 =*/437723352).uint32(message.maxResults); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 160562920, wireType 2 =*/1284503362).string(message.orderBy); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 227560217, wireType 2 =*/1820481738).string(message.project); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 336120696, wireType 2 =*/2688965570).string(message.filter); + if (message.returnPartialSuccess != null && Object.hasOwnProperty.call(message, "returnPartialSuccess")) + writer.uint32(/* id 517198390, wireType 0 =*/4137587120).bool(message.returnPartialSuccess); + return writer; + }; + + /** + * Encodes the specified ListZonesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListZonesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.compute.v1.ListZonesRequest + * @static + * @param {google.cloud.compute.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.compute.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.compute.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.compute.v1.ListZonesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 336120696: + message.filter = reader.string(); + break; + case 54715419: + message.maxResults = reader.uint32(); + break; + case 160562920: + message.orderBy = reader.string(); + break; + case 19994697: + message.pageToken = reader.string(); + break; + case 227560217: + message.project = reader.string(); + break; + case 517198390: + message.returnPartialSuccess = reader.bool(); + 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.compute.v1.ListZonesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.compute.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.compute.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"; + var properties = {}; + if (message.filter != null && message.hasOwnProperty("filter")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + properties._maxResults = 1; + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + properties._pageToken = 1; + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + properties._returnPartialSuccess = 1; + if (typeof message.returnPartialSuccess !== "boolean") + return "returnPartialSuccess: boolean expected"; + } + return null; + }; + + /** + * Creates a ListZonesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.compute.v1.ListZonesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.compute.v1.ListZonesRequest} ListZonesRequest + */ + ListZonesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.compute.v1.ListZonesRequest) + return object; + var message = new $root.google.cloud.compute.v1.ListZonesRequest(); + if (object.filter != null) + message.filter = String(object.filter); + if (object.maxResults != null) + message.maxResults = object.maxResults >>> 0; + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.project != null) + message.project = String(object.project); + if (object.returnPartialSuccess != null) + message.returnPartialSuccess = Boolean(object.returnPartialSuccess); + return message; + }; + + /** + * Creates a plain object from a ListZonesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.compute.v1.ListZonesRequest + * @static + * @param {google.cloud.compute.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.project = ""; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) { + object.pageToken = message.pageToken; + if (options.oneofs) + object._pageToken = "pageToken"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) { + object.maxResults = message.maxResults; + if (options.oneofs) + object._maxResults = "maxResults"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.returnPartialSuccess != null && message.hasOwnProperty("returnPartialSuccess")) { + object.returnPartialSuccess = message.returnPartialSuccess; + if (options.oneofs) + object._returnPartialSuccess = "returnPartialSuccess"; + } + return object; + }; + + /** + * Converts this ListZonesRequest to JSON. + * @function toJSON + * @memberof google.cloud.compute.v1.ListZonesRequest + * @instance + * @returns {Object.} JSON object + */ + ListZonesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListZonesRequest; + })(); + + v1.AcceleratorTypes = (function() { + + /** + * Constructs a new AcceleratorTypes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an AcceleratorTypes + * @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 AcceleratorTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AcceleratorTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AcceleratorTypes; + + /** + * Creates new AcceleratorTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @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 {AcceleratorTypes} RPC service. Useful where requests and/or responses are streamed. + */ + AcceleratorTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.AcceleratorTypes#aggregatedList}. + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AcceleratorTypeAggregatedList} [response] AcceleratorTypeAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest} request AggregatedListAcceleratorTypesRequest message or plain object + * @param {google.cloud.compute.v1.AcceleratorTypes.AggregatedListCallback} callback Node-style callback called with the error, if any, and AcceleratorTypeAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AcceleratorTypes.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest, $root.google.cloud.compute.v1.AcceleratorTypeAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest} request AggregatedListAcceleratorTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.AcceleratorTypes#get}. + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AcceleratorType} [response] AcceleratorType + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @instance + * @param {google.cloud.compute.v1.IGetAcceleratorTypeRequest} request GetAcceleratorTypeRequest message or plain object + * @param {google.cloud.compute.v1.AcceleratorTypes.GetCallback} callback Node-style callback called with the error, if any, and AcceleratorType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AcceleratorTypes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetAcceleratorTypeRequest, $root.google.cloud.compute.v1.AcceleratorType, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @instance + * @param {google.cloud.compute.v1.IGetAcceleratorTypeRequest} request GetAcceleratorTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.AcceleratorTypes#list}. + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AcceleratorTypeList} [response] AcceleratorTypeList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @instance + * @param {google.cloud.compute.v1.IListAcceleratorTypesRequest} request ListAcceleratorTypesRequest message or plain object + * @param {google.cloud.compute.v1.AcceleratorTypes.ListCallback} callback Node-style callback called with the error, if any, and AcceleratorTypeList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AcceleratorTypes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListAcceleratorTypesRequest, $root.google.cloud.compute.v1.AcceleratorTypeList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.AcceleratorTypes + * @instance + * @param {google.cloud.compute.v1.IListAcceleratorTypesRequest} request ListAcceleratorTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AcceleratorTypes; + })(); + + v1.Addresses = (function() { + + /** + * Constructs a new Addresses service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Addresses + * @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 Addresses(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Addresses.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Addresses; + + /** + * Creates new Addresses service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Addresses + * @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 {Addresses} RPC service. Useful where requests and/or responses are streamed. + */ + Addresses.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#aggregatedList}. + * @memberof google.cloud.compute.v1.Addresses + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AddressAggregatedList} [response] AddressAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IAggregatedListAddressesRequest} request AggregatedListAddressesRequest message or plain object + * @param {google.cloud.compute.v1.Addresses.AggregatedListCallback} callback Node-style callback called with the error, if any, and AddressAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Addresses.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListAddressesRequest, $root.google.cloud.compute.v1.AddressAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IAggregatedListAddressesRequest} request AggregatedListAddressesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#delete_}. + * @memberof google.cloud.compute.v1.Addresses + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IDeleteAddressRequest} request DeleteAddressRequest message or plain object + * @param {google.cloud.compute.v1.Addresses.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Addresses.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteAddressRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IDeleteAddressRequest} request DeleteAddressRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#get}. + * @memberof google.cloud.compute.v1.Addresses + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Address} [response] Address + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IGetAddressRequest} request GetAddressRequest message or plain object + * @param {google.cloud.compute.v1.Addresses.GetCallback} callback Node-style callback called with the error, if any, and Address + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Addresses.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetAddressRequest, $root.google.cloud.compute.v1.Address, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IGetAddressRequest} request GetAddressRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#insert}. + * @memberof google.cloud.compute.v1.Addresses + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IInsertAddressRequest} request InsertAddressRequest message or plain object + * @param {google.cloud.compute.v1.Addresses.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Addresses.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertAddressRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IInsertAddressRequest} request InsertAddressRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Addresses#list}. + * @memberof google.cloud.compute.v1.Addresses + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AddressList} [response] AddressList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IListAddressesRequest} request ListAddressesRequest message or plain object + * @param {google.cloud.compute.v1.Addresses.ListCallback} callback Node-style callback called with the error, if any, and AddressList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Addresses.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListAddressesRequest, $root.google.cloud.compute.v1.AddressList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Addresses + * @instance + * @param {google.cloud.compute.v1.IListAddressesRequest} request ListAddressesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Addresses; + })(); + + v1.Autoscalers = (function() { + + /** + * Constructs a new Autoscalers service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Autoscalers + * @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 Autoscalers(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Autoscalers.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Autoscalers; + + /** + * Creates new Autoscalers service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Autoscalers + * @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 {Autoscalers} RPC service. Useful where requests and/or responses are streamed. + */ + Autoscalers.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#aggregatedList}. + * @memberof google.cloud.compute.v1.Autoscalers + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AutoscalerAggregatedList} [response] AutoscalerAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IAggregatedListAutoscalersRequest} request AggregatedListAutoscalersRequest message or plain object + * @param {google.cloud.compute.v1.Autoscalers.AggregatedListCallback} callback Node-style callback called with the error, if any, and AutoscalerAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Autoscalers.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListAutoscalersRequest, $root.google.cloud.compute.v1.AutoscalerAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IAggregatedListAutoscalersRequest} request AggregatedListAutoscalersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#delete_}. + * @memberof google.cloud.compute.v1.Autoscalers + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IDeleteAutoscalerRequest} request DeleteAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.Autoscalers.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Autoscalers.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IDeleteAutoscalerRequest} request DeleteAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#get}. + * @memberof google.cloud.compute.v1.Autoscalers + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Autoscaler} [response] Autoscaler + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IGetAutoscalerRequest} request GetAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.Autoscalers.GetCallback} callback Node-style callback called with the error, if any, and Autoscaler + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Autoscalers.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetAutoscalerRequest, $root.google.cloud.compute.v1.Autoscaler, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IGetAutoscalerRequest} request GetAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#insert}. + * @memberof google.cloud.compute.v1.Autoscalers + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IInsertAutoscalerRequest} request InsertAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.Autoscalers.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Autoscalers.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IInsertAutoscalerRequest} request InsertAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#list}. + * @memberof google.cloud.compute.v1.Autoscalers + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AutoscalerList} [response] AutoscalerList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IListAutoscalersRequest} request ListAutoscalersRequest message or plain object + * @param {google.cloud.compute.v1.Autoscalers.ListCallback} callback Node-style callback called with the error, if any, and AutoscalerList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Autoscalers.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListAutoscalersRequest, $root.google.cloud.compute.v1.AutoscalerList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IListAutoscalersRequest} request ListAutoscalersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#patch}. + * @memberof google.cloud.compute.v1.Autoscalers + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IPatchAutoscalerRequest} request PatchAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.Autoscalers.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Autoscalers.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IPatchAutoscalerRequest} request PatchAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Autoscalers#update}. + * @memberof google.cloud.compute.v1.Autoscalers + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IUpdateAutoscalerRequest} request UpdateAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.Autoscalers.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Autoscalers.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Autoscalers + * @instance + * @param {google.cloud.compute.v1.IUpdateAutoscalerRequest} request UpdateAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Autoscalers; + })(); + + v1.BackendBuckets = (function() { + + /** + * Constructs a new BackendBuckets service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendBuckets + * @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 BackendBuckets(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BackendBuckets.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackendBuckets; + + /** + * Creates new BackendBuckets service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.BackendBuckets + * @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 {BackendBuckets} RPC service. Useful where requests and/or responses are streamed. + */ + BackendBuckets.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#addSignedUrlKey}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef AddSignedUrlKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddSignedUrlKey. + * @function addSignedUrlKey + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest} request AddSignedUrlKeyBackendBucketRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.AddSignedUrlKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype.addSignedUrlKey = function addSignedUrlKey(request, callback) { + return this.rpcCall(addSignedUrlKey, $root.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddSignedUrlKey" }); + + /** + * Calls AddSignedUrlKey. + * @function addSignedUrlKey + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest} request AddSignedUrlKeyBackendBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#delete_}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IDeleteBackendBucketRequest} request DeleteBackendBucketRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteBackendBucketRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IDeleteBackendBucketRequest} request DeleteBackendBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#deleteSignedUrlKey}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef DeleteSignedUrlKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeleteSignedUrlKey. + * @function deleteSignedUrlKey + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest} request DeleteSignedUrlKeyBackendBucketRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.DeleteSignedUrlKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype.deleteSignedUrlKey = function deleteSignedUrlKey(request, callback) { + return this.rpcCall(deleteSignedUrlKey, $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeleteSignedUrlKey" }); + + /** + * Calls DeleteSignedUrlKey. + * @function deleteSignedUrlKey + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest} request DeleteSignedUrlKeyBackendBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#get}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendBucket} [response] BackendBucket + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IGetBackendBucketRequest} request GetBackendBucketRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.GetCallback} callback Node-style callback called with the error, if any, and BackendBucket + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetBackendBucketRequest, $root.google.cloud.compute.v1.BackendBucket, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IGetBackendBucketRequest} request GetBackendBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#insert}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IInsertBackendBucketRequest} request InsertBackendBucketRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertBackendBucketRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IInsertBackendBucketRequest} request InsertBackendBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#list}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendBucketList} [response] BackendBucketList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IListBackendBucketsRequest} request ListBackendBucketsRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.ListCallback} callback Node-style callback called with the error, if any, and BackendBucketList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListBackendBucketsRequest, $root.google.cloud.compute.v1.BackendBucketList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IListBackendBucketsRequest} request ListBackendBucketsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#patch}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IPatchBackendBucketRequest} request PatchBackendBucketRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchBackendBucketRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IPatchBackendBucketRequest} request PatchBackendBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendBuckets#update}. + * @memberof google.cloud.compute.v1.BackendBuckets + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IUpdateBackendBucketRequest} request UpdateBackendBucketRequest message or plain object + * @param {google.cloud.compute.v1.BackendBuckets.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendBuckets.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateBackendBucketRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.BackendBuckets + * @instance + * @param {google.cloud.compute.v1.IUpdateBackendBucketRequest} request UpdateBackendBucketRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BackendBuckets; + })(); + + v1.BackendServices = (function() { + + /** + * Constructs a new BackendServices service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a BackendServices + * @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 BackendServices(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BackendServices.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackendServices; + + /** + * Creates new BackendServices service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.BackendServices + * @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 {BackendServices} RPC service. Useful where requests and/or responses are streamed. + */ + BackendServices.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#addSignedUrlKey}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef AddSignedUrlKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddSignedUrlKey. + * @function addSignedUrlKey + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest} request AddSignedUrlKeyBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.AddSignedUrlKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.addSignedUrlKey = function addSignedUrlKey(request, callback) { + return this.rpcCall(addSignedUrlKey, $root.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddSignedUrlKey" }); + + /** + * Calls AddSignedUrlKey. + * @function addSignedUrlKey + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest} request AddSignedUrlKeyBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#aggregatedList}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendServiceAggregatedList} [response] BackendServiceAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IAggregatedListBackendServicesRequest} request AggregatedListBackendServicesRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.AggregatedListCallback} callback Node-style callback called with the error, if any, and BackendServiceAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListBackendServicesRequest, $root.google.cloud.compute.v1.BackendServiceAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IAggregatedListBackendServicesRequest} request AggregatedListBackendServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#delete_}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IDeleteBackendServiceRequest} request DeleteBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IDeleteBackendServiceRequest} request DeleteBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#deleteSignedUrlKey}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef DeleteSignedUrlKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeleteSignedUrlKey. + * @function deleteSignedUrlKey + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest} request DeleteSignedUrlKeyBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.DeleteSignedUrlKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.deleteSignedUrlKey = function deleteSignedUrlKey(request, callback) { + return this.rpcCall(deleteSignedUrlKey, $root.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeleteSignedUrlKey" }); + + /** + * Calls DeleteSignedUrlKey. + * @function deleteSignedUrlKey + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest} request DeleteSignedUrlKeyBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#get}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendService} [response] BackendService + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IGetBackendServiceRequest} request GetBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.GetCallback} callback Node-style callback called with the error, if any, and BackendService + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetBackendServiceRequest, $root.google.cloud.compute.v1.BackendService, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IGetBackendServiceRequest} request GetBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#getHealth}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef GetHealthCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendServiceGroupHealth} [response] BackendServiceGroupHealth + */ + + /** + * Calls GetHealth. + * @function getHealth + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IGetHealthBackendServiceRequest} request GetHealthBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.GetHealthCallback} callback Node-style callback called with the error, if any, and BackendServiceGroupHealth + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.getHealth = function getHealth(request, callback) { + return this.rpcCall(getHealth, $root.google.cloud.compute.v1.GetHealthBackendServiceRequest, $root.google.cloud.compute.v1.BackendServiceGroupHealth, request, callback); + }, "name", { value: "GetHealth" }); + + /** + * Calls GetHealth. + * @function getHealth + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IGetHealthBackendServiceRequest} request GetHealthBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#insert}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IInsertBackendServiceRequest} request InsertBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IInsertBackendServiceRequest} request InsertBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#list}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendServiceList} [response] BackendServiceList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IListBackendServicesRequest} request ListBackendServicesRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.ListCallback} callback Node-style callback called with the error, if any, and BackendServiceList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListBackendServicesRequest, $root.google.cloud.compute.v1.BackendServiceList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IListBackendServicesRequest} request ListBackendServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#patch}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IPatchBackendServiceRequest} request PatchBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IPatchBackendServiceRequest} request PatchBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#setSecurityPolicy}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef SetSecurityPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetSecurityPolicy. + * @function setSecurityPolicy + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest} request SetSecurityPolicyBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.SetSecurityPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.setSecurityPolicy = function setSecurityPolicy(request, callback) { + return this.rpcCall(setSecurityPolicy, $root.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetSecurityPolicy" }); + + /** + * Calls SetSecurityPolicy. + * @function setSecurityPolicy + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest} request SetSecurityPolicyBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.BackendServices#update}. + * @memberof google.cloud.compute.v1.BackendServices + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IUpdateBackendServiceRequest} request UpdateBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.BackendServices.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackendServices.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.BackendServices + * @instance + * @param {google.cloud.compute.v1.IUpdateBackendServiceRequest} request UpdateBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BackendServices; + })(); + + v1.DiskTypes = (function() { + + /** + * Constructs a new DiskTypes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a DiskTypes + * @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 DiskTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DiskTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DiskTypes; + + /** + * Creates new DiskTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.DiskTypes + * @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 {DiskTypes} RPC service. Useful where requests and/or responses are streamed. + */ + DiskTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.DiskTypes#aggregatedList}. + * @memberof google.cloud.compute.v1.DiskTypes + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DiskTypeAggregatedList} [response] DiskTypeAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.DiskTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListDiskTypesRequest} request AggregatedListDiskTypesRequest message or plain object + * @param {google.cloud.compute.v1.DiskTypes.AggregatedListCallback} callback Node-style callback called with the error, if any, and DiskTypeAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DiskTypes.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListDiskTypesRequest, $root.google.cloud.compute.v1.DiskTypeAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.DiskTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListDiskTypesRequest} request AggregatedListDiskTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.DiskTypes#get}. + * @memberof google.cloud.compute.v1.DiskTypes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DiskType} [response] DiskType + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.DiskTypes + * @instance + * @param {google.cloud.compute.v1.IGetDiskTypeRequest} request GetDiskTypeRequest message or plain object + * @param {google.cloud.compute.v1.DiskTypes.GetCallback} callback Node-style callback called with the error, if any, and DiskType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DiskTypes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetDiskTypeRequest, $root.google.cloud.compute.v1.DiskType, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.DiskTypes + * @instance + * @param {google.cloud.compute.v1.IGetDiskTypeRequest} request GetDiskTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.DiskTypes#list}. + * @memberof google.cloud.compute.v1.DiskTypes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DiskTypeList} [response] DiskTypeList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.DiskTypes + * @instance + * @param {google.cloud.compute.v1.IListDiskTypesRequest} request ListDiskTypesRequest message or plain object + * @param {google.cloud.compute.v1.DiskTypes.ListCallback} callback Node-style callback called with the error, if any, and DiskTypeList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DiskTypes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListDiskTypesRequest, $root.google.cloud.compute.v1.DiskTypeList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.DiskTypes + * @instance + * @param {google.cloud.compute.v1.IListDiskTypesRequest} request ListDiskTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DiskTypes; + })(); + + v1.Disks = (function() { + + /** + * Constructs a new Disks service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Disks + * @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 Disks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Disks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Disks; + + /** + * Creates new Disks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Disks + * @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 {Disks} RPC service. Useful where requests and/or responses are streamed. + */ + Disks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#addResourcePolicies}. + * @memberof google.cloud.compute.v1.Disks + * @typedef AddResourcePoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddResourcePolicies. + * @function addResourcePolicies + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IAddResourcePoliciesDiskRequest} request AddResourcePoliciesDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.AddResourcePoliciesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.addResourcePolicies = function addResourcePolicies(request, callback) { + return this.rpcCall(addResourcePolicies, $root.google.cloud.compute.v1.AddResourcePoliciesDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddResourcePolicies" }); + + /** + * Calls AddResourcePolicies. + * @function addResourcePolicies + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IAddResourcePoliciesDiskRequest} request AddResourcePoliciesDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#aggregatedList}. + * @memberof google.cloud.compute.v1.Disks + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DiskAggregatedList} [response] DiskAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IAggregatedListDisksRequest} request AggregatedListDisksRequest message or plain object + * @param {google.cloud.compute.v1.Disks.AggregatedListCallback} callback Node-style callback called with the error, if any, and DiskAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListDisksRequest, $root.google.cloud.compute.v1.DiskAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IAggregatedListDisksRequest} request AggregatedListDisksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#createSnapshot}. + * @memberof google.cloud.compute.v1.Disks + * @typedef CreateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ICreateSnapshotDiskRequest} request CreateSnapshotDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.createSnapshot = function createSnapshot(request, callback) { + return this.rpcCall(createSnapshot, $root.google.cloud.compute.v1.CreateSnapshotDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "CreateSnapshot" }); + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ICreateSnapshotDiskRequest} request CreateSnapshotDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#delete_}. + * @memberof google.cloud.compute.v1.Disks + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IDeleteDiskRequest} request DeleteDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IDeleteDiskRequest} request DeleteDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#get}. + * @memberof google.cloud.compute.v1.Disks + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Disk} [response] Disk + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IGetDiskRequest} request GetDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.GetCallback} callback Node-style callback called with the error, if any, and Disk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetDiskRequest, $root.google.cloud.compute.v1.Disk, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IGetDiskRequest} request GetDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#getIamPolicy}. + * @memberof google.cloud.compute.v1.Disks + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyDiskRequest} request GetIamPolicyDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyDiskRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyDiskRequest} request GetIamPolicyDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#insert}. + * @memberof google.cloud.compute.v1.Disks + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IInsertDiskRequest} request InsertDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IInsertDiskRequest} request InsertDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#list}. + * @memberof google.cloud.compute.v1.Disks + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DiskList} [response] DiskList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IListDisksRequest} request ListDisksRequest message or plain object + * @param {google.cloud.compute.v1.Disks.ListCallback} callback Node-style callback called with the error, if any, and DiskList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListDisksRequest, $root.google.cloud.compute.v1.DiskList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IListDisksRequest} request ListDisksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#removeResourcePolicies}. + * @memberof google.cloud.compute.v1.Disks + * @typedef RemoveResourcePoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveResourcePolicies. + * @function removeResourcePolicies + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest} request RemoveResourcePoliciesDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.RemoveResourcePoliciesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.removeResourcePolicies = function removeResourcePolicies(request, callback) { + return this.rpcCall(removeResourcePolicies, $root.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveResourcePolicies" }); + + /** + * Calls RemoveResourcePolicies. + * @function removeResourcePolicies + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest} request RemoveResourcePoliciesDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#resize}. + * @memberof google.cloud.compute.v1.Disks + * @typedef ResizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IResizeDiskRequest} request ResizeDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.ResizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.resize = function resize(request, callback) { + return this.rpcCall(resize, $root.google.cloud.compute.v1.ResizeDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Resize" }); + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.IResizeDiskRequest} request ResizeDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#setIamPolicy}. + * @memberof google.cloud.compute.v1.Disks + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyDiskRequest} request SetIamPolicyDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyDiskRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyDiskRequest} request SetIamPolicyDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#setLabels}. + * @memberof google.cloud.compute.v1.Disks + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ISetLabelsDiskRequest} request SetLabelsDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ISetLabelsDiskRequest} request SetLabelsDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Disks#testIamPermissions}. + * @memberof google.cloud.compute.v1.Disks + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsDiskRequest} request TestIamPermissionsDiskRequest message or plain object + * @param {google.cloud.compute.v1.Disks.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Disks.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsDiskRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Disks + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsDiskRequest} request TestIamPermissionsDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Disks; + })(); + + v1.ExternalVpnGateways = (function() { + + /** + * Constructs a new ExternalVpnGateways service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an ExternalVpnGateways + * @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 ExternalVpnGateways(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ExternalVpnGateways.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ExternalVpnGateways; + + /** + * Creates new ExternalVpnGateways service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @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 {ExternalVpnGateways} RPC service. Useful where requests and/or responses are streamed. + */ + ExternalVpnGateways.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#delete_}. + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest} request DeleteExternalVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.ExternalVpnGateways.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ExternalVpnGateways.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest} request DeleteExternalVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#get}. + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ExternalVpnGateway} [response] ExternalVpnGateway + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetExternalVpnGatewayRequest} request GetExternalVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.ExternalVpnGateways.GetCallback} callback Node-style callback called with the error, if any, and ExternalVpnGateway + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ExternalVpnGateways.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetExternalVpnGatewayRequest, $root.google.cloud.compute.v1.ExternalVpnGateway, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetExternalVpnGatewayRequest} request GetExternalVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#insert}. + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IInsertExternalVpnGatewayRequest} request InsertExternalVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.ExternalVpnGateways.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ExternalVpnGateways.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertExternalVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IInsertExternalVpnGatewayRequest} request InsertExternalVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#list}. + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ExternalVpnGatewayList} [response] ExternalVpnGatewayList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IListExternalVpnGatewaysRequest} request ListExternalVpnGatewaysRequest message or plain object + * @param {google.cloud.compute.v1.ExternalVpnGateways.ListCallback} callback Node-style callback called with the error, if any, and ExternalVpnGatewayList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ExternalVpnGateways.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListExternalVpnGatewaysRequest, $root.google.cloud.compute.v1.ExternalVpnGatewayList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.IListExternalVpnGatewaysRequest} request ListExternalVpnGatewaysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#setLabels}. + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest} request SetLabelsExternalVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.ExternalVpnGateways.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ExternalVpnGateways.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest} request SetLabelsExternalVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ExternalVpnGateways#testIamPermissions}. + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest} request TestIamPermissionsExternalVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.ExternalVpnGateways.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ExternalVpnGateways.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.ExternalVpnGateways + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest} request TestIamPermissionsExternalVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ExternalVpnGateways; + })(); + + v1.FirewallPolicies = (function() { + + /** + * Constructs a new FirewallPolicies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a FirewallPolicies + * @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 FirewallPolicies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (FirewallPolicies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FirewallPolicies; + + /** + * Creates new FirewallPolicies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.FirewallPolicies + * @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 {FirewallPolicies} RPC service. Useful where requests and/or responses are streamed. + */ + FirewallPolicies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#addAssociation}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef AddAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddAssociation. + * @function addAssociation + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest} request AddAssociationFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.AddAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.addAssociation = function addAssociation(request, callback) { + return this.rpcCall(addAssociation, $root.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddAssociation" }); + + /** + * Calls AddAssociation. + * @function addAssociation + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest} request AddAssociationFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#addRule}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef AddRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddRule. + * @function addRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IAddRuleFirewallPolicyRequest} request AddRuleFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.AddRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.addRule = function addRule(request, callback) { + return this.rpcCall(addRule, $root.google.cloud.compute.v1.AddRuleFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddRule" }); + + /** + * Calls AddRule. + * @function addRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IAddRuleFirewallPolicyRequest} request AddRuleFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#cloneRules}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef CloneRulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls CloneRules. + * @function cloneRules + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest} request CloneRulesFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.CloneRulesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.cloneRules = function cloneRules(request, callback) { + return this.rpcCall(cloneRules, $root.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "CloneRules" }); + + /** + * Calls CloneRules. + * @function cloneRules + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest} request CloneRulesFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#delete_}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteFirewallPolicyRequest} request DeleteFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteFirewallPolicyRequest} request DeleteFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#get}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.FirewallPolicy} [response] FirewallPolicy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetFirewallPolicyRequest} request GetFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.GetCallback} callback Node-style callback called with the error, if any, and FirewallPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetFirewallPolicyRequest, $root.google.cloud.compute.v1.FirewallPolicy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetFirewallPolicyRequest} request GetFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#getAssociation}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef GetAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.FirewallPolicyAssociation} [response] FirewallPolicyAssociation + */ + + /** + * Calls GetAssociation. + * @function getAssociation + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest} request GetAssociationFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.GetAssociationCallback} callback Node-style callback called with the error, if any, and FirewallPolicyAssociation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.getAssociation = function getAssociation(request, callback) { + return this.rpcCall(getAssociation, $root.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest, $root.google.cloud.compute.v1.FirewallPolicyAssociation, request, callback); + }, "name", { value: "GetAssociation" }); + + /** + * Calls GetAssociation. + * @function getAssociation + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest} request GetAssociationFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#getIamPolicy}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest} request GetIamPolicyFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest} request GetIamPolicyFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#getRule}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef GetRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.FirewallPolicyRule} [response] FirewallPolicyRule + */ + + /** + * Calls GetRule. + * @function getRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetRuleFirewallPolicyRequest} request GetRuleFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.GetRuleCallback} callback Node-style callback called with the error, if any, and FirewallPolicyRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.getRule = function getRule(request, callback) { + return this.rpcCall(getRule, $root.google.cloud.compute.v1.GetRuleFirewallPolicyRequest, $root.google.cloud.compute.v1.FirewallPolicyRule, request, callback); + }, "name", { value: "GetRule" }); + + /** + * Calls GetRule. + * @function getRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IGetRuleFirewallPolicyRequest} request GetRuleFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#insert}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IInsertFirewallPolicyRequest} request InsertFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IInsertFirewallPolicyRequest} request InsertFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#list}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.FirewallPolicyList} [response] FirewallPolicyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IListFirewallPoliciesRequest} request ListFirewallPoliciesRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.ListCallback} callback Node-style callback called with the error, if any, and FirewallPolicyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListFirewallPoliciesRequest, $root.google.cloud.compute.v1.FirewallPolicyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IListFirewallPoliciesRequest} request ListFirewallPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#listAssociations}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef ListAssociationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse} [response] FirewallPoliciesListAssociationsResponse + */ + + /** + * Calls ListAssociations. + * @function listAssociations + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest} request ListAssociationsFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.ListAssociationsCallback} callback Node-style callback called with the error, if any, and FirewallPoliciesListAssociationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.listAssociations = function listAssociations(request, callback) { + return this.rpcCall(listAssociations, $root.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest, $root.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse, request, callback); + }, "name", { value: "ListAssociations" }); + + /** + * Calls ListAssociations. + * @function listAssociations + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest} request ListAssociationsFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#move}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef MoveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Move. + * @function move + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IMoveFirewallPolicyRequest} request MoveFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.MoveCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.move = function move(request, callback) { + return this.rpcCall(move, $root.google.cloud.compute.v1.MoveFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Move" }); + + /** + * Calls Move. + * @function move + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IMoveFirewallPolicyRequest} request MoveFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#patch}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchFirewallPolicyRequest} request PatchFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchFirewallPolicyRequest} request PatchFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#patchRule}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef PatchRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls PatchRule. + * @function patchRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest} request PatchRuleFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.PatchRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.patchRule = function patchRule(request, callback) { + return this.rpcCall(patchRule, $root.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "PatchRule" }); + + /** + * Calls PatchRule. + * @function patchRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest} request PatchRuleFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#removeAssociation}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef RemoveAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveAssociation. + * @function removeAssociation + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest} request RemoveAssociationFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.RemoveAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.removeAssociation = function removeAssociation(request, callback) { + return this.rpcCall(removeAssociation, $root.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveAssociation" }); + + /** + * Calls RemoveAssociation. + * @function removeAssociation + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest} request RemoveAssociationFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#removeRule}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef RemoveRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveRule. + * @function removeRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest} request RemoveRuleFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.RemoveRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.removeRule = function removeRule(request, callback) { + return this.rpcCall(removeRule, $root.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveRule" }); + + /** + * Calls RemoveRule. + * @function removeRule + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest} request RemoveRuleFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#setIamPolicy}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest} request SetIamPolicyFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest} request SetIamPolicyFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.FirewallPolicies#testIamPermissions}. + * @memberof google.cloud.compute.v1.FirewallPolicies + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest} request TestIamPermissionsFirewallPolicyRequest message or plain object + * @param {google.cloud.compute.v1.FirewallPolicies.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirewallPolicies.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.FirewallPolicies + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest} request TestIamPermissionsFirewallPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return FirewallPolicies; + })(); + + v1.Firewalls = (function() { + + /** + * Constructs a new Firewalls service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Firewalls + * @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 Firewalls(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Firewalls.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Firewalls; + + /** + * Creates new Firewalls service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Firewalls + * @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 {Firewalls} RPC service. Useful where requests and/or responses are streamed. + */ + Firewalls.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#delete_}. + * @memberof google.cloud.compute.v1.Firewalls + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IDeleteFirewallRequest} request DeleteFirewallRequest message or plain object + * @param {google.cloud.compute.v1.Firewalls.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewalls.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteFirewallRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IDeleteFirewallRequest} request DeleteFirewallRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#get}. + * @memberof google.cloud.compute.v1.Firewalls + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Firewall} [response] Firewall + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IGetFirewallRequest} request GetFirewallRequest message or plain object + * @param {google.cloud.compute.v1.Firewalls.GetCallback} callback Node-style callback called with the error, if any, and Firewall + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewalls.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetFirewallRequest, $root.google.cloud.compute.v1.Firewall, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IGetFirewallRequest} request GetFirewallRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#insert}. + * @memberof google.cloud.compute.v1.Firewalls + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IInsertFirewallRequest} request InsertFirewallRequest message or plain object + * @param {google.cloud.compute.v1.Firewalls.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewalls.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertFirewallRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IInsertFirewallRequest} request InsertFirewallRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#list}. + * @memberof google.cloud.compute.v1.Firewalls + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.FirewallList} [response] FirewallList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IListFirewallsRequest} request ListFirewallsRequest message or plain object + * @param {google.cloud.compute.v1.Firewalls.ListCallback} callback Node-style callback called with the error, if any, and FirewallList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewalls.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListFirewallsRequest, $root.google.cloud.compute.v1.FirewallList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IListFirewallsRequest} request ListFirewallsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#patch}. + * @memberof google.cloud.compute.v1.Firewalls + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IPatchFirewallRequest} request PatchFirewallRequest message or plain object + * @param {google.cloud.compute.v1.Firewalls.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewalls.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchFirewallRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IPatchFirewallRequest} request PatchFirewallRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Firewalls#update}. + * @memberof google.cloud.compute.v1.Firewalls + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IUpdateFirewallRequest} request UpdateFirewallRequest message or plain object + * @param {google.cloud.compute.v1.Firewalls.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Firewalls.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateFirewallRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Firewalls + * @instance + * @param {google.cloud.compute.v1.IUpdateFirewallRequest} request UpdateFirewallRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Firewalls; + })(); + + v1.ForwardingRules = (function() { + + /** + * Constructs a new ForwardingRules service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ForwardingRules + * @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 ForwardingRules(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ForwardingRules.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ForwardingRules; + + /** + * Creates new ForwardingRules service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.ForwardingRules + * @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 {ForwardingRules} RPC service. Useful where requests and/or responses are streamed. + */ + ForwardingRules.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#aggregatedList}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ForwardingRuleAggregatedList} [response] ForwardingRuleAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IAggregatedListForwardingRulesRequest} request AggregatedListForwardingRulesRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.AggregatedListCallback} callback Node-style callback called with the error, if any, and ForwardingRuleAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListForwardingRulesRequest, $root.google.cloud.compute.v1.ForwardingRuleAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IAggregatedListForwardingRulesRequest} request AggregatedListForwardingRulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#delete_}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IDeleteForwardingRuleRequest} request DeleteForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IDeleteForwardingRuleRequest} request DeleteForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#get}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ForwardingRule} [response] ForwardingRule + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IGetForwardingRuleRequest} request GetForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.GetCallback} callback Node-style callback called with the error, if any, and ForwardingRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetForwardingRuleRequest, $root.google.cloud.compute.v1.ForwardingRule, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IGetForwardingRuleRequest} request GetForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#insert}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IInsertForwardingRuleRequest} request InsertForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IInsertForwardingRuleRequest} request InsertForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#list}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ForwardingRuleList} [response] ForwardingRuleList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IListForwardingRulesRequest} request ListForwardingRulesRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.ListCallback} callback Node-style callback called with the error, if any, and ForwardingRuleList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListForwardingRulesRequest, $root.google.cloud.compute.v1.ForwardingRuleList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IListForwardingRulesRequest} request ListForwardingRulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#patch}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IPatchForwardingRuleRequest} request PatchForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.IPatchForwardingRuleRequest} request PatchForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#setLabels}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetLabelsForwardingRuleRequest} request SetLabelsForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetLabelsForwardingRuleRequest} request SetLabelsForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ForwardingRules#setTarget}. + * @memberof google.cloud.compute.v1.ForwardingRules + * @typedef SetTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetTarget. + * @function setTarget + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetTargetForwardingRuleRequest} request SetTargetForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.ForwardingRules.SetTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ForwardingRules.prototype.setTarget = function setTarget(request, callback) { + return this.rpcCall(setTarget, $root.google.cloud.compute.v1.SetTargetForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetTarget" }); + + /** + * Calls SetTarget. + * @function setTarget + * @memberof google.cloud.compute.v1.ForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetTargetForwardingRuleRequest} request SetTargetForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ForwardingRules; + })(); + + v1.GlobalAddresses = (function() { + + /** + * Constructs a new GlobalAddresses service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalAddresses + * @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 GlobalAddresses(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GlobalAddresses.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GlobalAddresses; + + /** + * Creates new GlobalAddresses service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.GlobalAddresses + * @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 {GlobalAddresses} RPC service. Useful where requests and/or responses are streamed. + */ + GlobalAddresses.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#delete_}. + * @memberof google.cloud.compute.v1.GlobalAddresses + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalAddressRequest} request DeleteGlobalAddressRequest message or plain object + * @param {google.cloud.compute.v1.GlobalAddresses.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalAddresses.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteGlobalAddressRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalAddressRequest} request DeleteGlobalAddressRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#get}. + * @memberof google.cloud.compute.v1.GlobalAddresses + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Address} [response] Address + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IGetGlobalAddressRequest} request GetGlobalAddressRequest message or plain object + * @param {google.cloud.compute.v1.GlobalAddresses.GetCallback} callback Node-style callback called with the error, if any, and Address + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalAddresses.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetGlobalAddressRequest, $root.google.cloud.compute.v1.Address, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IGetGlobalAddressRequest} request GetGlobalAddressRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#insert}. + * @memberof google.cloud.compute.v1.GlobalAddresses + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalAddressRequest} request InsertGlobalAddressRequest message or plain object + * @param {google.cloud.compute.v1.GlobalAddresses.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalAddresses.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertGlobalAddressRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalAddressRequest} request InsertGlobalAddressRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalAddresses#list}. + * @memberof google.cloud.compute.v1.GlobalAddresses + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.AddressList} [response] AddressList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IListGlobalAddressesRequest} request ListGlobalAddressesRequest message or plain object + * @param {google.cloud.compute.v1.GlobalAddresses.ListCallback} callback Node-style callback called with the error, if any, and AddressList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalAddresses.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListGlobalAddressesRequest, $root.google.cloud.compute.v1.AddressList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalAddresses + * @instance + * @param {google.cloud.compute.v1.IListGlobalAddressesRequest} request ListGlobalAddressesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GlobalAddresses; + })(); + + v1.GlobalForwardingRules = (function() { + + /** + * Constructs a new GlobalForwardingRules service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalForwardingRules + * @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 GlobalForwardingRules(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GlobalForwardingRules.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GlobalForwardingRules; + + /** + * Creates new GlobalForwardingRules service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @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 {GlobalForwardingRules} RPC service. Useful where requests and/or responses are streamed. + */ + GlobalForwardingRules.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#delete_}. + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest} request DeleteGlobalForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.GlobalForwardingRules.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalForwardingRules.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest} request DeleteGlobalForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#get}. + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ForwardingRule} [response] ForwardingRule + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IGetGlobalForwardingRuleRequest} request GetGlobalForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.GlobalForwardingRules.GetCallback} callback Node-style callback called with the error, if any, and ForwardingRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalForwardingRules.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetGlobalForwardingRuleRequest, $root.google.cloud.compute.v1.ForwardingRule, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IGetGlobalForwardingRuleRequest} request GetGlobalForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#insert}. + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest} request InsertGlobalForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.GlobalForwardingRules.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalForwardingRules.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertGlobalForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest} request InsertGlobalForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#list}. + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ForwardingRuleList} [response] ForwardingRuleList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IListGlobalForwardingRulesRequest} request ListGlobalForwardingRulesRequest message or plain object + * @param {google.cloud.compute.v1.GlobalForwardingRules.ListCallback} callback Node-style callback called with the error, if any, and ForwardingRuleList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalForwardingRules.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListGlobalForwardingRulesRequest, $root.google.cloud.compute.v1.ForwardingRuleList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IListGlobalForwardingRulesRequest} request ListGlobalForwardingRulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#patch}. + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest} request PatchGlobalForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.GlobalForwardingRules.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalForwardingRules.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchGlobalForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest} request PatchGlobalForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#setLabels}. + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest} request SetLabelsGlobalForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.GlobalForwardingRules.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalForwardingRules.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest} request SetLabelsGlobalForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalForwardingRules#setTarget}. + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @typedef SetTargetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetTarget. + * @function setTarget + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest} request SetTargetGlobalForwardingRuleRequest message or plain object + * @param {google.cloud.compute.v1.GlobalForwardingRules.SetTargetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalForwardingRules.prototype.setTarget = function setTarget(request, callback) { + return this.rpcCall(setTarget, $root.google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetTarget" }); + + /** + * Calls SetTarget. + * @function setTarget + * @memberof google.cloud.compute.v1.GlobalForwardingRules + * @instance + * @param {google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest} request SetTargetGlobalForwardingRuleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GlobalForwardingRules; + })(); + + v1.GlobalNetworkEndpointGroups = (function() { + + /** + * Constructs a new GlobalNetworkEndpointGroups service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalNetworkEndpointGroups + * @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 GlobalNetworkEndpointGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GlobalNetworkEndpointGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GlobalNetworkEndpointGroups; + + /** + * Creates new GlobalNetworkEndpointGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @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 {GlobalNetworkEndpointGroups} RPC service. Useful where requests and/or responses are streamed. + */ + GlobalNetworkEndpointGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#attachNetworkEndpoints}. + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @typedef AttachNetworkEndpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AttachNetworkEndpoints. + * @function attachNetworkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} request AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroups.AttachNetworkEndpointsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalNetworkEndpointGroups.prototype.attachNetworkEndpoints = function attachNetworkEndpoints(request, callback) { + return this.rpcCall(attachNetworkEndpoints, $root.google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AttachNetworkEndpoints" }); + + /** + * Calls AttachNetworkEndpoints. + * @function attachNetworkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest} request AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#delete_}. + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest} request DeleteGlobalNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroups.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalNetworkEndpointGroups.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest} request DeleteGlobalNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#detachNetworkEndpoints}. + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @typedef DetachNetworkEndpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DetachNetworkEndpoints. + * @function detachNetworkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} request DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroups.DetachNetworkEndpointsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalNetworkEndpointGroups.prototype.detachNetworkEndpoints = function detachNetworkEndpoints(request, callback) { + return this.rpcCall(detachNetworkEndpoints, $root.google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DetachNetworkEndpoints" }); + + /** + * Calls DetachNetworkEndpoints. + * @function detachNetworkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest} request DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#get}. + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroup} [response] NetworkEndpointGroup + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest} request GetGlobalNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroups.GetCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalNetworkEndpointGroups.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.NetworkEndpointGroup, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest} request GetGlobalNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#insert}. + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest} request InsertGlobalNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroups.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalNetworkEndpointGroups.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest} request InsertGlobalNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#list}. + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroupList} [response] NetworkEndpointGroupList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest} request ListGlobalNetworkEndpointGroupsRequest message or plain object + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroups.ListCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroupList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalNetworkEndpointGroups.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest, $root.google.cloud.compute.v1.NetworkEndpointGroupList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest} request ListGlobalNetworkEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalNetworkEndpointGroups#listNetworkEndpoints}. + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @typedef ListNetworkEndpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints} [response] NetworkEndpointGroupsListNetworkEndpoints + */ + + /** + * Calls ListNetworkEndpoints. + * @function listNetworkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} request ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroups.ListNetworkEndpointsCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroupsListNetworkEndpoints + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalNetworkEndpointGroups.prototype.listNetworkEndpoints = function listNetworkEndpoints(request, callback) { + return this.rpcCall(listNetworkEndpoints, $root.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, $root.google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints, request, callback); + }, "name", { value: "ListNetworkEndpoints" }); + + /** + * Calls ListNetworkEndpoints. + * @function listNetworkEndpoints + * @memberof google.cloud.compute.v1.GlobalNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest} request ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GlobalNetworkEndpointGroups; + })(); + + v1.GlobalOperations = (function() { + + /** + * Constructs a new GlobalOperations service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalOperations + * @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 GlobalOperations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GlobalOperations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GlobalOperations; + + /** + * Creates new GlobalOperations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.GlobalOperations + * @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 {GlobalOperations} RPC service. Useful where requests and/or responses are streamed. + */ + GlobalOperations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#aggregatedList}. + * @memberof google.cloud.compute.v1.GlobalOperations + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.OperationAggregatedList} [response] OperationAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest} request AggregatedListGlobalOperationsRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOperations.AggregatedListCallback} callback Node-style callback called with the error, if any, and OperationAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOperations.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListGlobalOperationsRequest, $root.google.cloud.compute.v1.OperationAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest} request AggregatedListGlobalOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#delete_}. + * @memberof google.cloud.compute.v1.GlobalOperations + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DeleteGlobalOperationResponse} [response] DeleteGlobalOperationResponse + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalOperationRequest} request DeleteGlobalOperationRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOperations.DeleteCallback} callback Node-style callback called with the error, if any, and DeleteGlobalOperationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOperations.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteGlobalOperationRequest, $root.google.cloud.compute.v1.DeleteGlobalOperationResponse, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalOperationRequest} request DeleteGlobalOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#get}. + * @memberof google.cloud.compute.v1.GlobalOperations + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IGetGlobalOperationRequest} request GetGlobalOperationRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOperations.GetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOperations.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetGlobalOperationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IGetGlobalOperationRequest} request GetGlobalOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#list}. + * @memberof google.cloud.compute.v1.GlobalOperations + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.OperationList} [response] OperationList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IListGlobalOperationsRequest} request ListGlobalOperationsRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOperations.ListCallback} callback Node-style callback called with the error, if any, and OperationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOperations.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListGlobalOperationsRequest, $root.google.cloud.compute.v1.OperationList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IListGlobalOperationsRequest} request ListGlobalOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOperations#wait}. + * @memberof google.cloud.compute.v1.GlobalOperations + * @typedef WaitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Wait. + * @function wait + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IWaitGlobalOperationRequest} request WaitGlobalOperationRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOperations.WaitCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOperations.prototype.wait = function wait(request, callback) { + return this.rpcCall(wait, $root.google.cloud.compute.v1.WaitGlobalOperationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Wait" }); + + /** + * Calls Wait. + * @function wait + * @memberof google.cloud.compute.v1.GlobalOperations + * @instance + * @param {google.cloud.compute.v1.IWaitGlobalOperationRequest} request WaitGlobalOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GlobalOperations; + })(); + + v1.GlobalOrganizationOperations = (function() { + + /** + * Constructs a new GlobalOrganizationOperations service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalOrganizationOperations + * @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 GlobalOrganizationOperations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GlobalOrganizationOperations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GlobalOrganizationOperations; + + /** + * Creates new GlobalOrganizationOperations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @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 {GlobalOrganizationOperations} RPC service. Useful where requests and/or responses are streamed. + */ + GlobalOrganizationOperations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOrganizationOperations#delete_}. + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse} [response] DeleteGlobalOrganizationOperationResponse + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest} request DeleteGlobalOrganizationOperationRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOrganizationOperations.DeleteCallback} callback Node-style callback called with the error, if any, and DeleteGlobalOrganizationOperationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOrganizationOperations.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest, $root.google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest} request DeleteGlobalOrganizationOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOrganizationOperations#get}. + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @instance + * @param {google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest} request GetGlobalOrganizationOperationRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOrganizationOperations.GetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOrganizationOperations.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetGlobalOrganizationOperationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @instance + * @param {google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest} request GetGlobalOrganizationOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalOrganizationOperations#list}. + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.OperationList} [response] OperationList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @instance + * @param {google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest} request ListGlobalOrganizationOperationsRequest message or plain object + * @param {google.cloud.compute.v1.GlobalOrganizationOperations.ListCallback} callback Node-style callback called with the error, if any, and OperationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalOrganizationOperations.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest, $root.google.cloud.compute.v1.OperationList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalOrganizationOperations + * @instance + * @param {google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest} request ListGlobalOrganizationOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GlobalOrganizationOperations; + })(); + + v1.GlobalPublicDelegatedPrefixes = (function() { + + /** + * Constructs a new GlobalPublicDelegatedPrefixes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a GlobalPublicDelegatedPrefixes + * @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 GlobalPublicDelegatedPrefixes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GlobalPublicDelegatedPrefixes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GlobalPublicDelegatedPrefixes; + + /** + * Creates new GlobalPublicDelegatedPrefixes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @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 {GlobalPublicDelegatedPrefixes} RPC service. Useful where requests and/or responses are streamed. + */ + GlobalPublicDelegatedPrefixes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#delete_}. + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest} request DeleteGlobalPublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalPublicDelegatedPrefixes.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest} request DeleteGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#get}. + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PublicDelegatedPrefix} [response] PublicDelegatedPrefix + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest} request GetGlobalPublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.GetCallback} callback Node-style callback called with the error, if any, and PublicDelegatedPrefix + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalPublicDelegatedPrefixes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.PublicDelegatedPrefix, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest} request GetGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#insert}. + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest} request InsertGlobalPublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalPublicDelegatedPrefixes.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest} request InsertGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#list}. + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PublicDelegatedPrefixList} [response] PublicDelegatedPrefixList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest} request ListGlobalPublicDelegatedPrefixesRequest message or plain object + * @param {google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.ListCallback} callback Node-style callback called with the error, if any, and PublicDelegatedPrefixList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalPublicDelegatedPrefixes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest, $root.google.cloud.compute.v1.PublicDelegatedPrefixList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest} request ListGlobalPublicDelegatedPrefixesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.GlobalPublicDelegatedPrefixes#patch}. + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest} request PatchGlobalPublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.GlobalPublicDelegatedPrefixes.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GlobalPublicDelegatedPrefixes.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.GlobalPublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest} request PatchGlobalPublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GlobalPublicDelegatedPrefixes; + })(); + + v1.HealthChecks = (function() { + + /** + * Constructs a new HealthChecks service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a HealthChecks + * @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 HealthChecks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (HealthChecks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = HealthChecks; + + /** + * Creates new HealthChecks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.HealthChecks + * @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 {HealthChecks} RPC service. Useful where requests and/or responses are streamed. + */ + HealthChecks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#aggregatedList}. + * @memberof google.cloud.compute.v1.HealthChecks + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.HealthChecksAggregatedList} [response] HealthChecksAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IAggregatedListHealthChecksRequest} request AggregatedListHealthChecksRequest message or plain object + * @param {google.cloud.compute.v1.HealthChecks.AggregatedListCallback} callback Node-style callback called with the error, if any, and HealthChecksAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthChecks.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListHealthChecksRequest, $root.google.cloud.compute.v1.HealthChecksAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IAggregatedListHealthChecksRequest} request AggregatedListHealthChecksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#delete_}. + * @memberof google.cloud.compute.v1.HealthChecks + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IDeleteHealthCheckRequest} request DeleteHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.HealthChecks.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthChecks.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IDeleteHealthCheckRequest} request DeleteHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#get}. + * @memberof google.cloud.compute.v1.HealthChecks + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.HealthCheck} [response] HealthCheck + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IGetHealthCheckRequest} request GetHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.HealthChecks.GetCallback} callback Node-style callback called with the error, if any, and HealthCheck + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthChecks.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetHealthCheckRequest, $root.google.cloud.compute.v1.HealthCheck, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IGetHealthCheckRequest} request GetHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#insert}. + * @memberof google.cloud.compute.v1.HealthChecks + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IInsertHealthCheckRequest} request InsertHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.HealthChecks.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthChecks.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IInsertHealthCheckRequest} request InsertHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#list}. + * @memberof google.cloud.compute.v1.HealthChecks + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.HealthCheckList} [response] HealthCheckList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IListHealthChecksRequest} request ListHealthChecksRequest message or plain object + * @param {google.cloud.compute.v1.HealthChecks.ListCallback} callback Node-style callback called with the error, if any, and HealthCheckList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthChecks.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListHealthChecksRequest, $root.google.cloud.compute.v1.HealthCheckList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IListHealthChecksRequest} request ListHealthChecksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#patch}. + * @memberof google.cloud.compute.v1.HealthChecks + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IPatchHealthCheckRequest} request PatchHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.HealthChecks.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthChecks.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IPatchHealthCheckRequest} request PatchHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.HealthChecks#update}. + * @memberof google.cloud.compute.v1.HealthChecks + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IUpdateHealthCheckRequest} request UpdateHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.HealthChecks.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HealthChecks.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.HealthChecks + * @instance + * @param {google.cloud.compute.v1.IUpdateHealthCheckRequest} request UpdateHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return HealthChecks; + })(); + + v1.Images = (function() { + + /** + * Constructs a new Images service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Images + * @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 Images(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Images.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Images; + + /** + * Creates new Images service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Images + * @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 {Images} RPC service. Useful where requests and/or responses are streamed. + */ + Images.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#delete_}. + * @memberof google.cloud.compute.v1.Images + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IDeleteImageRequest} request DeleteImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteImageRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IDeleteImageRequest} request DeleteImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#deprecate}. + * @memberof google.cloud.compute.v1.Images + * @typedef DeprecateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Deprecate. + * @function deprecate + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IDeprecateImageRequest} request DeprecateImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.DeprecateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.deprecate = function deprecate(request, callback) { + return this.rpcCall(deprecate, $root.google.cloud.compute.v1.DeprecateImageRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Deprecate" }); + + /** + * Calls Deprecate. + * @function deprecate + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IDeprecateImageRequest} request DeprecateImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#get}. + * @memberof google.cloud.compute.v1.Images + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Image} [response] Image + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IGetImageRequest} request GetImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.GetCallback} callback Node-style callback called with the error, if any, and Image + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetImageRequest, $root.google.cloud.compute.v1.Image, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IGetImageRequest} request GetImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#getFromFamily}. + * @memberof google.cloud.compute.v1.Images + * @typedef GetFromFamilyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Image} [response] Image + */ + + /** + * Calls GetFromFamily. + * @function getFromFamily + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IGetFromFamilyImageRequest} request GetFromFamilyImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.GetFromFamilyCallback} callback Node-style callback called with the error, if any, and Image + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.getFromFamily = function getFromFamily(request, callback) { + return this.rpcCall(getFromFamily, $root.google.cloud.compute.v1.GetFromFamilyImageRequest, $root.google.cloud.compute.v1.Image, request, callback); + }, "name", { value: "GetFromFamily" }); + + /** + * Calls GetFromFamily. + * @function getFromFamily + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IGetFromFamilyImageRequest} request GetFromFamilyImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#getIamPolicy}. + * @memberof google.cloud.compute.v1.Images + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyImageRequest} request GetIamPolicyImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyImageRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyImageRequest} request GetIamPolicyImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#insert}. + * @memberof google.cloud.compute.v1.Images + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IInsertImageRequest} request InsertImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertImageRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IInsertImageRequest} request InsertImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#list}. + * @memberof google.cloud.compute.v1.Images + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ImageList} [response] ImageList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IListImagesRequest} request ListImagesRequest message or plain object + * @param {google.cloud.compute.v1.Images.ListCallback} callback Node-style callback called with the error, if any, and ImageList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListImagesRequest, $root.google.cloud.compute.v1.ImageList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IListImagesRequest} request ListImagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#patch}. + * @memberof google.cloud.compute.v1.Images + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IPatchImageRequest} request PatchImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchImageRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.IPatchImageRequest} request PatchImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#setIamPolicy}. + * @memberof google.cloud.compute.v1.Images + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyImageRequest} request SetIamPolicyImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyImageRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyImageRequest} request SetIamPolicyImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#setLabels}. + * @memberof google.cloud.compute.v1.Images + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.ISetLabelsImageRequest} request SetLabelsImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsImageRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.ISetLabelsImageRequest} request SetLabelsImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Images#testIamPermissions}. + * @memberof google.cloud.compute.v1.Images + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsImageRequest} request TestIamPermissionsImageRequest message or plain object + * @param {google.cloud.compute.v1.Images.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Images.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsImageRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Images + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsImageRequest} request TestIamPermissionsImageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Images; + })(); + + v1.InstanceGroupManagers = (function() { + + /** + * Constructs a new InstanceGroupManagers service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroupManagers + * @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 InstanceGroupManagers(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (InstanceGroupManagers.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InstanceGroupManagers; + + /** + * Creates new InstanceGroupManagers service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @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 {InstanceGroupManagers} RPC service. Useful where requests and/or responses are streamed. + */ + InstanceGroupManagers.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#abandonInstances}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef AbandonInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AbandonInstances. + * @function abandonInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest} request AbandonInstancesInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.AbandonInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.abandonInstances = function abandonInstances(request, callback) { + return this.rpcCall(abandonInstances, $root.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AbandonInstances" }); + + /** + * Calls AbandonInstances. + * @function abandonInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest} request AbandonInstancesInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#aggregatedList}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupManagerAggregatedList} [response] InstanceGroupManagerAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest} request AggregatedListInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.AggregatedListCallback} callback Node-style callback called with the error, if any, and InstanceGroupManagerAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest, $root.google.cloud.compute.v1.InstanceGroupManagerAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest} request AggregatedListInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#applyUpdatesToInstances}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef ApplyUpdatesToInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls ApplyUpdatesToInstances. + * @function applyUpdatesToInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest} request ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.ApplyUpdatesToInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.applyUpdatesToInstances = function applyUpdatesToInstances(request, callback) { + return this.rpcCall(applyUpdatesToInstances, $root.google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "ApplyUpdatesToInstances" }); + + /** + * Calls ApplyUpdatesToInstances. + * @function applyUpdatesToInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest} request ApplyUpdatesToInstancesInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#createInstances}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef CreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls CreateInstances. + * @function createInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest} request CreateInstancesInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.CreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.createInstances = function createInstances(request, callback) { + return this.rpcCall(createInstances, $root.google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "CreateInstances" }); + + /** + * Calls CreateInstances. + * @function createInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest} request CreateInstancesInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#delete_}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest} request DeleteInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest} request DeleteInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#deleteInstances}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef DeleteInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeleteInstances. + * @function deleteInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest} request DeleteInstancesInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.DeleteInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.deleteInstances = function deleteInstances(request, callback) { + return this.rpcCall(deleteInstances, $root.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeleteInstances" }); + + /** + * Calls DeleteInstances. + * @function deleteInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest} request DeleteInstancesInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#deletePerInstanceConfigs}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef DeletePerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeletePerInstanceConfigs. + * @function deletePerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest} request DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.DeletePerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.deletePerInstanceConfigs = function deletePerInstanceConfigs(request, callback) { + return this.rpcCall(deletePerInstanceConfigs, $root.google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeletePerInstanceConfigs" }); + + /** + * Calls DeletePerInstanceConfigs. + * @function deletePerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest} request DeletePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#get}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupManager} [response] InstanceGroupManager + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IGetInstanceGroupManagerRequest} request GetInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.GetCallback} callback Node-style callback called with the error, if any, and InstanceGroupManager + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetInstanceGroupManagerRequest, $root.google.cloud.compute.v1.InstanceGroupManager, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IGetInstanceGroupManagerRequest} request GetInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#insert}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceGroupManagerRequest} request InsertInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceGroupManagerRequest} request InsertInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#list}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupManagerList} [response] InstanceGroupManagerList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListInstanceGroupManagersRequest} request ListInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.ListCallback} callback Node-style callback called with the error, if any, and InstanceGroupManagerList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListInstanceGroupManagersRequest, $root.google.cloud.compute.v1.InstanceGroupManagerList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListInstanceGroupManagersRequest} request ListInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#listErrors}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef ListErrorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse} [response] InstanceGroupManagersListErrorsResponse + */ + + /** + * Calls ListErrors. + * @function listErrors + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest} request ListErrorsInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.ListErrorsCallback} callback Node-style callback called with the error, if any, and InstanceGroupManagersListErrorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.listErrors = function listErrors(request, callback) { + return this.rpcCall(listErrors, $root.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest, $root.google.cloud.compute.v1.InstanceGroupManagersListErrorsResponse, request, callback); + }, "name", { value: "ListErrors" }); + + /** + * Calls ListErrors. + * @function listErrors + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest} request ListErrorsInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#listManagedInstances}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef ListManagedInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse} [response] InstanceGroupManagersListManagedInstancesResponse + */ + + /** + * Calls ListManagedInstances. + * @function listManagedInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest} request ListManagedInstancesInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.ListManagedInstancesCallback} callback Node-style callback called with the error, if any, and InstanceGroupManagersListManagedInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.listManagedInstances = function listManagedInstances(request, callback) { + return this.rpcCall(listManagedInstances, $root.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest, $root.google.cloud.compute.v1.InstanceGroupManagersListManagedInstancesResponse, request, callback); + }, "name", { value: "ListManagedInstances" }); + + /** + * Calls ListManagedInstances. + * @function listManagedInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest} request ListManagedInstancesInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#listPerInstanceConfigs}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef ListPerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp} [response] InstanceGroupManagersListPerInstanceConfigsResp + */ + + /** + * Calls ListPerInstanceConfigs. + * @function listPerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest} request ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.ListPerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and InstanceGroupManagersListPerInstanceConfigsResp + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.listPerInstanceConfigs = function listPerInstanceConfigs(request, callback) { + return this.rpcCall(listPerInstanceConfigs, $root.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest, $root.google.cloud.compute.v1.InstanceGroupManagersListPerInstanceConfigsResp, request, callback); + }, "name", { value: "ListPerInstanceConfigs" }); + + /** + * Calls ListPerInstanceConfigs. + * @function listPerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest} request ListPerInstanceConfigsInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#patch}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchInstanceGroupManagerRequest} request PatchInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchInstanceGroupManagerRequest} request PatchInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#patchPerInstanceConfigs}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef PatchPerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls PatchPerInstanceConfigs. + * @function patchPerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest} request PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.PatchPerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.patchPerInstanceConfigs = function patchPerInstanceConfigs(request, callback) { + return this.rpcCall(patchPerInstanceConfigs, $root.google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "PatchPerInstanceConfigs" }); + + /** + * Calls PatchPerInstanceConfigs. + * @function patchPerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest} request PatchPerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#recreateInstances}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef RecreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RecreateInstances. + * @function recreateInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest} request RecreateInstancesInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.RecreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.recreateInstances = function recreateInstances(request, callback) { + return this.rpcCall(recreateInstances, $root.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RecreateInstances" }); + + /** + * Calls RecreateInstances. + * @function recreateInstances + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest} request RecreateInstancesInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#resize}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef ResizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IResizeInstanceGroupManagerRequest} request ResizeInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.ResizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.resize = function resize(request, callback) { + return this.rpcCall(resize, $root.google.cloud.compute.v1.ResizeInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Resize" }); + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IResizeInstanceGroupManagerRequest} request ResizeInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#setInstanceTemplate}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef SetInstanceTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetInstanceTemplate. + * @function setInstanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest} request SetInstanceTemplateInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.SetInstanceTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.setInstanceTemplate = function setInstanceTemplate(request, callback) { + return this.rpcCall(setInstanceTemplate, $root.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetInstanceTemplate" }); + + /** + * Calls SetInstanceTemplate. + * @function setInstanceTemplate + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest} request SetInstanceTemplateInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#setTargetPools}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef SetTargetPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetTargetPools. + * @function setTargetPools + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest} request SetTargetPoolsInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.SetTargetPoolsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.setTargetPools = function setTargetPools(request, callback) { + return this.rpcCall(setTargetPools, $root.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetTargetPools" }); + + /** + * Calls SetTargetPools. + * @function setTargetPools + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest} request SetTargetPoolsInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroupManagers#updatePerInstanceConfigs}. + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @typedef UpdatePerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls UpdatePerInstanceConfigs. + * @function updatePerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest} request UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroupManagers.UpdatePerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroupManagers.prototype.updatePerInstanceConfigs = function updatePerInstanceConfigs(request, callback) { + return this.rpcCall(updatePerInstanceConfigs, $root.google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "UpdatePerInstanceConfigs" }); + + /** + * Calls UpdatePerInstanceConfigs. + * @function updatePerInstanceConfigs + * @memberof google.cloud.compute.v1.InstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest} request UpdatePerInstanceConfigsInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return InstanceGroupManagers; + })(); + + v1.InstanceGroups = (function() { + + /** + * Constructs a new InstanceGroups service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceGroups + * @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 InstanceGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (InstanceGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InstanceGroups; + + /** + * Creates new InstanceGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.InstanceGroups + * @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 {InstanceGroups} RPC service. Useful where requests and/or responses are streamed. + */ + InstanceGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#addInstances}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef AddInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddInstances. + * @function addInstances + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IAddInstancesInstanceGroupRequest} request AddInstancesInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.AddInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.addInstances = function addInstances(request, callback) { + return this.rpcCall(addInstances, $root.google.cloud.compute.v1.AddInstancesInstanceGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddInstances" }); + + /** + * Calls AddInstances. + * @function addInstances + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IAddInstancesInstanceGroupRequest} request AddInstancesInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#aggregatedList}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupAggregatedList} [response] InstanceGroupAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest} request AggregatedListInstanceGroupsRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.AggregatedListCallback} callback Node-style callback called with the error, if any, and InstanceGroupAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListInstanceGroupsRequest, $root.google.cloud.compute.v1.InstanceGroupAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest} request AggregatedListInstanceGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#delete_}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceGroupRequest} request DeleteInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteInstanceGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceGroupRequest} request DeleteInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#get}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroup} [response] InstanceGroup + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IGetInstanceGroupRequest} request GetInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.GetCallback} callback Node-style callback called with the error, if any, and InstanceGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetInstanceGroupRequest, $root.google.cloud.compute.v1.InstanceGroup, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IGetInstanceGroupRequest} request GetInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#insert}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceGroupRequest} request InsertInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertInstanceGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceGroupRequest} request InsertInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#list}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupList} [response] InstanceGroupList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListInstanceGroupsRequest} request ListInstanceGroupsRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.ListCallback} callback Node-style callback called with the error, if any, and InstanceGroupList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListInstanceGroupsRequest, $root.google.cloud.compute.v1.InstanceGroupList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListInstanceGroupsRequest} request ListInstanceGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#listInstances}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupsListInstances} [response] InstanceGroupsListInstances + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListInstancesInstanceGroupsRequest} request ListInstancesInstanceGroupsRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.ListInstancesCallback} callback Node-style callback called with the error, if any, and InstanceGroupsListInstances + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest, $root.google.cloud.compute.v1.InstanceGroupsListInstances, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListInstancesInstanceGroupsRequest} request ListInstancesInstanceGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#removeInstances}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef RemoveInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveInstances. + * @function removeInstances + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest} request RemoveInstancesInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.RemoveInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.removeInstances = function removeInstances(request, callback) { + return this.rpcCall(removeInstances, $root.google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveInstances" }); + + /** + * Calls RemoveInstances. + * @function removeInstances + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest} request RemoveInstancesInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceGroups#setNamedPorts}. + * @memberof google.cloud.compute.v1.InstanceGroups + * @typedef SetNamedPortsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetNamedPorts. + * @function setNamedPorts + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest} request SetNamedPortsInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.InstanceGroups.SetNamedPortsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceGroups.prototype.setNamedPorts = function setNamedPorts(request, callback) { + return this.rpcCall(setNamedPorts, $root.google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetNamedPorts" }); + + /** + * Calls SetNamedPorts. + * @function setNamedPorts + * @memberof google.cloud.compute.v1.InstanceGroups + * @instance + * @param {google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest} request SetNamedPortsInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return InstanceGroups; + })(); + + v1.InstanceTemplates = (function() { + + /** + * Constructs a new InstanceTemplates service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InstanceTemplates + * @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 InstanceTemplates(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (InstanceTemplates.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InstanceTemplates; + + /** + * Creates new InstanceTemplates service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.InstanceTemplates + * @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 {InstanceTemplates} RPC service. Useful where requests and/or responses are streamed. + */ + InstanceTemplates.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#delete_}. + * @memberof google.cloud.compute.v1.InstanceTemplates + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceTemplateRequest} request DeleteInstanceTemplateRequest message or plain object + * @param {google.cloud.compute.v1.InstanceTemplates.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceTemplates.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteInstanceTemplateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceTemplateRequest} request DeleteInstanceTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#get}. + * @memberof google.cloud.compute.v1.InstanceTemplates + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceTemplate} [response] InstanceTemplate + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IGetInstanceTemplateRequest} request GetInstanceTemplateRequest message or plain object + * @param {google.cloud.compute.v1.InstanceTemplates.GetCallback} callback Node-style callback called with the error, if any, and InstanceTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceTemplates.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetInstanceTemplateRequest, $root.google.cloud.compute.v1.InstanceTemplate, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IGetInstanceTemplateRequest} request GetInstanceTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#getIamPolicy}. + * @memberof google.cloud.compute.v1.InstanceTemplates + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest} request GetIamPolicyInstanceTemplateRequest message or plain object + * @param {google.cloud.compute.v1.InstanceTemplates.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceTemplates.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest} request GetIamPolicyInstanceTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#insert}. + * @memberof google.cloud.compute.v1.InstanceTemplates + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceTemplateRequest} request InsertInstanceTemplateRequest message or plain object + * @param {google.cloud.compute.v1.InstanceTemplates.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceTemplates.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertInstanceTemplateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceTemplateRequest} request InsertInstanceTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#list}. + * @memberof google.cloud.compute.v1.InstanceTemplates + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceTemplateList} [response] InstanceTemplateList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IListInstanceTemplatesRequest} request ListInstanceTemplatesRequest message or plain object + * @param {google.cloud.compute.v1.InstanceTemplates.ListCallback} callback Node-style callback called with the error, if any, and InstanceTemplateList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceTemplates.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListInstanceTemplatesRequest, $root.google.cloud.compute.v1.InstanceTemplateList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.IListInstanceTemplatesRequest} request ListInstanceTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#setIamPolicy}. + * @memberof google.cloud.compute.v1.InstanceTemplates + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest} request SetIamPolicyInstanceTemplateRequest message or plain object + * @param {google.cloud.compute.v1.InstanceTemplates.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceTemplates.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest} request SetIamPolicyInstanceTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InstanceTemplates#testIamPermissions}. + * @memberof google.cloud.compute.v1.InstanceTemplates + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest} request TestIamPermissionsInstanceTemplateRequest message or plain object + * @param {google.cloud.compute.v1.InstanceTemplates.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InstanceTemplates.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.InstanceTemplates + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest} request TestIamPermissionsInstanceTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return InstanceTemplates; + })(); + + v1.Instances = (function() { + + /** + * Constructs a new Instances service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Instances + * @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 Instances(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Instances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Instances; + + /** + * Creates new Instances service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Instances + * @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 {Instances} RPC service. Useful where requests and/or responses are streamed. + */ + Instances.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#addAccessConfig}. + * @memberof google.cloud.compute.v1.Instances + * @typedef AddAccessConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddAccessConfig. + * @function addAccessConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAddAccessConfigInstanceRequest} request AddAccessConfigInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.AddAccessConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.addAccessConfig = function addAccessConfig(request, callback) { + return this.rpcCall(addAccessConfig, $root.google.cloud.compute.v1.AddAccessConfigInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddAccessConfig" }); + + /** + * Calls AddAccessConfig. + * @function addAccessConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAddAccessConfigInstanceRequest} request AddAccessConfigInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#addResourcePolicies}. + * @memberof google.cloud.compute.v1.Instances + * @typedef AddResourcePoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddResourcePolicies. + * @function addResourcePolicies + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest} request AddResourcePoliciesInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.AddResourcePoliciesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.addResourcePolicies = function addResourcePolicies(request, callback) { + return this.rpcCall(addResourcePolicies, $root.google.cloud.compute.v1.AddResourcePoliciesInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddResourcePolicies" }); + + /** + * Calls AddResourcePolicies. + * @function addResourcePolicies + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest} request AddResourcePoliciesInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#aggregatedList}. + * @memberof google.cloud.compute.v1.Instances + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceAggregatedList} [response] InstanceAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInstancesRequest} request AggregatedListInstancesRequest message or plain object + * @param {google.cloud.compute.v1.Instances.AggregatedListCallback} callback Node-style callback called with the error, if any, and InstanceAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListInstancesRequest, $root.google.cloud.compute.v1.InstanceAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInstancesRequest} request AggregatedListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#attachDisk}. + * @memberof google.cloud.compute.v1.Instances + * @typedef AttachDiskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AttachDisk. + * @function attachDisk + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAttachDiskInstanceRequest} request AttachDiskInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.AttachDiskCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.attachDisk = function attachDisk(request, callback) { + return this.rpcCall(attachDisk, $root.google.cloud.compute.v1.AttachDiskInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AttachDisk" }); + + /** + * Calls AttachDisk. + * @function attachDisk + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IAttachDiskInstanceRequest} request AttachDiskInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#bulkInsert}. + * @memberof google.cloud.compute.v1.Instances + * @typedef BulkInsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls BulkInsert. + * @function bulkInsert + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IBulkInsertInstanceRequest} request BulkInsertInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.BulkInsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.bulkInsert = function bulkInsert(request, callback) { + return this.rpcCall(bulkInsert, $root.google.cloud.compute.v1.BulkInsertInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "BulkInsert" }); + + /** + * Calls BulkInsert. + * @function bulkInsert + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IBulkInsertInstanceRequest} request BulkInsertInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#delete_}. + * @memberof google.cloud.compute.v1.Instances + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#deleteAccessConfig}. + * @memberof google.cloud.compute.v1.Instances + * @typedef DeleteAccessConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeleteAccessConfig. + * @function deleteAccessConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest} request DeleteAccessConfigInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.DeleteAccessConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.deleteAccessConfig = function deleteAccessConfig(request, callback) { + return this.rpcCall(deleteAccessConfig, $root.google.cloud.compute.v1.DeleteAccessConfigInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeleteAccessConfig" }); + + /** + * Calls DeleteAccessConfig. + * @function deleteAccessConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest} request DeleteAccessConfigInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#detachDisk}. + * @memberof google.cloud.compute.v1.Instances + * @typedef DetachDiskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DetachDisk. + * @function detachDisk + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IDetachDiskInstanceRequest} request DetachDiskInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.DetachDiskCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.detachDisk = function detachDisk(request, callback) { + return this.rpcCall(detachDisk, $root.google.cloud.compute.v1.DetachDiskInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DetachDisk" }); + + /** + * Calls DetachDisk. + * @function detachDisk + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IDetachDiskInstanceRequest} request DetachDiskInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#get}. + * @memberof google.cloud.compute.v1.Instances + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Instance} [response] Instance + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.GetCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetInstanceRequest, $root.google.cloud.compute.v1.Instance, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getEffectiveFirewalls}. + * @memberof google.cloud.compute.v1.Instances + * @typedef GetEffectiveFirewallsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse} [response] InstancesGetEffectiveFirewallsResponse + */ + + /** + * Calls GetEffectiveFirewalls. + * @function getEffectiveFirewalls + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest} request GetEffectiveFirewallsInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.GetEffectiveFirewallsCallback} callback Node-style callback called with the error, if any, and InstancesGetEffectiveFirewallsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getEffectiveFirewalls = function getEffectiveFirewalls(request, callback) { + return this.rpcCall(getEffectiveFirewalls, $root.google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest, $root.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse, request, callback); + }, "name", { value: "GetEffectiveFirewalls" }); + + /** + * Calls GetEffectiveFirewalls. + * @function getEffectiveFirewalls + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest} request GetEffectiveFirewallsInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getGuestAttributes}. + * @memberof google.cloud.compute.v1.Instances + * @typedef GetGuestAttributesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.GuestAttributes} [response] GuestAttributes + */ + + /** + * Calls GetGuestAttributes. + * @function getGuestAttributes + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetGuestAttributesInstanceRequest} request GetGuestAttributesInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.GetGuestAttributesCallback} callback Node-style callback called with the error, if any, and GuestAttributes + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getGuestAttributes = function getGuestAttributes(request, callback) { + return this.rpcCall(getGuestAttributes, $root.google.cloud.compute.v1.GetGuestAttributesInstanceRequest, $root.google.cloud.compute.v1.GuestAttributes, request, callback); + }, "name", { value: "GetGuestAttributes" }); + + /** + * Calls GetGuestAttributes. + * @function getGuestAttributes + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetGuestAttributesInstanceRequest} request GetGuestAttributesInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getIamPolicy}. + * @memberof google.cloud.compute.v1.Instances + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceRequest} request GetIamPolicyInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyInstanceRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyInstanceRequest} request GetIamPolicyInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getScreenshot}. + * @memberof google.cloud.compute.v1.Instances + * @typedef GetScreenshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Screenshot} [response] Screenshot + */ + + /** + * Calls GetScreenshot. + * @function getScreenshot + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetScreenshotInstanceRequest} request GetScreenshotInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.GetScreenshotCallback} callback Node-style callback called with the error, if any, and Screenshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getScreenshot = function getScreenshot(request, callback) { + return this.rpcCall(getScreenshot, $root.google.cloud.compute.v1.GetScreenshotInstanceRequest, $root.google.cloud.compute.v1.Screenshot, request, callback); + }, "name", { value: "GetScreenshot" }); + + /** + * Calls GetScreenshot. + * @function getScreenshot + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetScreenshotInstanceRequest} request GetScreenshotInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getSerialPortOutput}. + * @memberof google.cloud.compute.v1.Instances + * @typedef GetSerialPortOutputCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SerialPortOutput} [response] SerialPortOutput + */ + + /** + * Calls GetSerialPortOutput. + * @function getSerialPortOutput + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest} request GetSerialPortOutputInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.GetSerialPortOutputCallback} callback Node-style callback called with the error, if any, and SerialPortOutput + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getSerialPortOutput = function getSerialPortOutput(request, callback) { + return this.rpcCall(getSerialPortOutput, $root.google.cloud.compute.v1.GetSerialPortOutputInstanceRequest, $root.google.cloud.compute.v1.SerialPortOutput, request, callback); + }, "name", { value: "GetSerialPortOutput" }); + + /** + * Calls GetSerialPortOutput. + * @function getSerialPortOutput + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest} request GetSerialPortOutputInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#getShieldedInstanceIdentity}. + * @memberof google.cloud.compute.v1.Instances + * @typedef GetShieldedInstanceIdentityCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ShieldedInstanceIdentity} [response] ShieldedInstanceIdentity + */ + + /** + * Calls GetShieldedInstanceIdentity. + * @function getShieldedInstanceIdentity + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest} request GetShieldedInstanceIdentityInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.GetShieldedInstanceIdentityCallback} callback Node-style callback called with the error, if any, and ShieldedInstanceIdentity + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.getShieldedInstanceIdentity = function getShieldedInstanceIdentity(request, callback) { + return this.rpcCall(getShieldedInstanceIdentity, $root.google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest, $root.google.cloud.compute.v1.ShieldedInstanceIdentity, request, callback); + }, "name", { value: "GetShieldedInstanceIdentity" }); + + /** + * Calls GetShieldedInstanceIdentity. + * @function getShieldedInstanceIdentity + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest} request GetShieldedInstanceIdentityInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#insert}. + * @memberof google.cloud.compute.v1.Instances + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceRequest} request InsertInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IInsertInstanceRequest} request InsertInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#list}. + * @memberof google.cloud.compute.v1.Instances + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceList} [response] InstanceList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.compute.v1.Instances.ListCallback} callback Node-style callback called with the error, if any, and InstanceList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListInstancesRequest, $root.google.cloud.compute.v1.InstanceList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#listReferrers}. + * @memberof google.cloud.compute.v1.Instances + * @typedef ListReferrersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceListReferrers} [response] InstanceListReferrers + */ + + /** + * Calls ListReferrers. + * @function listReferrers + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IListReferrersInstancesRequest} request ListReferrersInstancesRequest message or plain object + * @param {google.cloud.compute.v1.Instances.ListReferrersCallback} callback Node-style callback called with the error, if any, and InstanceListReferrers + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.listReferrers = function listReferrers(request, callback) { + return this.rpcCall(listReferrers, $root.google.cloud.compute.v1.ListReferrersInstancesRequest, $root.google.cloud.compute.v1.InstanceListReferrers, request, callback); + }, "name", { value: "ListReferrers" }); + + /** + * Calls ListReferrers. + * @function listReferrers + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IListReferrersInstancesRequest} request ListReferrersInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#removeResourcePolicies}. + * @memberof google.cloud.compute.v1.Instances + * @typedef RemoveResourcePoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveResourcePolicies. + * @function removeResourcePolicies + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest} request RemoveResourcePoliciesInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.RemoveResourcePoliciesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.removeResourcePolicies = function removeResourcePolicies(request, callback) { + return this.rpcCall(removeResourcePolicies, $root.google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveResourcePolicies" }); + + /** + * Calls RemoveResourcePolicies. + * @function removeResourcePolicies + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest} request RemoveResourcePoliciesInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#reset}. + * @memberof google.cloud.compute.v1.Instances + * @typedef ResetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Reset. + * @function reset + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IResetInstanceRequest} request ResetInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.ResetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.reset = function reset(request, callback) { + return this.rpcCall(reset, $root.google.cloud.compute.v1.ResetInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Reset" }); + + /** + * Calls Reset. + * @function reset + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IResetInstanceRequest} request ResetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setDeletionProtection}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetDeletionProtectionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetDeletionProtection. + * @function setDeletionProtection + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest} request SetDeletionProtectionInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetDeletionProtectionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setDeletionProtection = function setDeletionProtection(request, callback) { + return this.rpcCall(setDeletionProtection, $root.google.cloud.compute.v1.SetDeletionProtectionInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetDeletionProtection" }); + + /** + * Calls SetDeletionProtection. + * @function setDeletionProtection + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest} request SetDeletionProtectionInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setDiskAutoDelete}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetDiskAutoDeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetDiskAutoDelete. + * @function setDiskAutoDelete + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest} request SetDiskAutoDeleteInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetDiskAutoDeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setDiskAutoDelete = function setDiskAutoDelete(request, callback) { + return this.rpcCall(setDiskAutoDelete, $root.google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetDiskAutoDelete" }); + + /** + * Calls SetDiskAutoDelete. + * @function setDiskAutoDelete + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest} request SetDiskAutoDeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setIamPolicy}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceRequest} request SetIamPolicyInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyInstanceRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyInstanceRequest} request SetIamPolicyInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setLabels}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetLabelsInstanceRequest} request SetLabelsInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetLabelsInstanceRequest} request SetLabelsInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMachineResources}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetMachineResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetMachineResources. + * @function setMachineResources + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMachineResourcesInstanceRequest} request SetMachineResourcesInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetMachineResourcesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setMachineResources = function setMachineResources(request, callback) { + return this.rpcCall(setMachineResources, $root.google.cloud.compute.v1.SetMachineResourcesInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetMachineResources" }); + + /** + * Calls SetMachineResources. + * @function setMachineResources + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMachineResourcesInstanceRequest} request SetMachineResourcesInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMachineType}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetMachineTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetMachineType. + * @function setMachineType + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMachineTypeInstanceRequest} request SetMachineTypeInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetMachineTypeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setMachineType = function setMachineType(request, callback) { + return this.rpcCall(setMachineType, $root.google.cloud.compute.v1.SetMachineTypeInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetMachineType" }); + + /** + * Calls SetMachineType. + * @function setMachineType + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMachineTypeInstanceRequest} request SetMachineTypeInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMetadata}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetMetadata. + * @function setMetadata + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMetadataInstanceRequest} request SetMetadataInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetMetadataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setMetadata = function setMetadata(request, callback) { + return this.rpcCall(setMetadata, $root.google.cloud.compute.v1.SetMetadataInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetMetadata" }); + + /** + * Calls SetMetadata. + * @function setMetadata + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMetadataInstanceRequest} request SetMetadataInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setMinCpuPlatform}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetMinCpuPlatformCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetMinCpuPlatform. + * @function setMinCpuPlatform + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest} request SetMinCpuPlatformInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetMinCpuPlatformCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setMinCpuPlatform = function setMinCpuPlatform(request, callback) { + return this.rpcCall(setMinCpuPlatform, $root.google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetMinCpuPlatform" }); + + /** + * Calls SetMinCpuPlatform. + * @function setMinCpuPlatform + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest} request SetMinCpuPlatformInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setScheduling}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetSchedulingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetScheduling. + * @function setScheduling + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetSchedulingInstanceRequest} request SetSchedulingInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetSchedulingCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setScheduling = function setScheduling(request, callback) { + return this.rpcCall(setScheduling, $root.google.cloud.compute.v1.SetSchedulingInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetScheduling" }); + + /** + * Calls SetScheduling. + * @function setScheduling + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetSchedulingInstanceRequest} request SetSchedulingInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setServiceAccount}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetServiceAccountCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetServiceAccount. + * @function setServiceAccount + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetServiceAccountInstanceRequest} request SetServiceAccountInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetServiceAccountCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setServiceAccount = function setServiceAccount(request, callback) { + return this.rpcCall(setServiceAccount, $root.google.cloud.compute.v1.SetServiceAccountInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetServiceAccount" }); + + /** + * Calls SetServiceAccount. + * @function setServiceAccount + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetServiceAccountInstanceRequest} request SetServiceAccountInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setShieldedInstanceIntegrityPolicy}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetShieldedInstanceIntegrityPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetShieldedInstanceIntegrityPolicy. + * @function setShieldedInstanceIntegrityPolicy + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest} request SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetShieldedInstanceIntegrityPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setShieldedInstanceIntegrityPolicy = function setShieldedInstanceIntegrityPolicy(request, callback) { + return this.rpcCall(setShieldedInstanceIntegrityPolicy, $root.google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetShieldedInstanceIntegrityPolicy" }); + + /** + * Calls SetShieldedInstanceIntegrityPolicy. + * @function setShieldedInstanceIntegrityPolicy + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest} request SetShieldedInstanceIntegrityPolicyInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#setTags}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SetTagsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetTags. + * @function setTags + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetTagsInstanceRequest} request SetTagsInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SetTagsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.setTags = function setTags(request, callback) { + return this.rpcCall(setTags, $root.google.cloud.compute.v1.SetTagsInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetTags" }); + + /** + * Calls SetTags. + * @function setTags + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISetTagsInstanceRequest} request SetTagsInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#simulateMaintenanceEvent}. + * @memberof google.cloud.compute.v1.Instances + * @typedef SimulateMaintenanceEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SimulateMaintenanceEvent. + * @function simulateMaintenanceEvent + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest} request SimulateMaintenanceEventInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.SimulateMaintenanceEventCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.simulateMaintenanceEvent = function simulateMaintenanceEvent(request, callback) { + return this.rpcCall(simulateMaintenanceEvent, $root.google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SimulateMaintenanceEvent" }); + + /** + * Calls SimulateMaintenanceEvent. + * @function simulateMaintenanceEvent + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest} request SimulateMaintenanceEventInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#start}. + * @memberof google.cloud.compute.v1.Instances + * @typedef StartCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Start. + * @function start + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.StartCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.start = function start(request, callback) { + return this.rpcCall(start, $root.google.cloud.compute.v1.StartInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Start" }); + + /** + * Calls Start. + * @function start + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IStartInstanceRequest} request StartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#startWithEncryptionKey}. + * @memberof google.cloud.compute.v1.Instances + * @typedef StartWithEncryptionKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls StartWithEncryptionKey. + * @function startWithEncryptionKey + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest} request StartWithEncryptionKeyInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.StartWithEncryptionKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.startWithEncryptionKey = function startWithEncryptionKey(request, callback) { + return this.rpcCall(startWithEncryptionKey, $root.google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "StartWithEncryptionKey" }); + + /** + * Calls StartWithEncryptionKey. + * @function startWithEncryptionKey + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest} request StartWithEncryptionKeyInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#stop}. + * @memberof google.cloud.compute.v1.Instances + * @typedef StopCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Stop. + * @function stop + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.StopCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.stop = function stop(request, callback) { + return this.rpcCall(stop, $root.google.cloud.compute.v1.StopInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Stop" }); + + /** + * Calls Stop. + * @function stop + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IStopInstanceRequest} request StopInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#testIamPermissions}. + * @memberof google.cloud.compute.v1.Instances + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceRequest} request TestIamPermissionsInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsInstanceRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsInstanceRequest} request TestIamPermissionsInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#update}. + * @memberof google.cloud.compute.v1.Instances + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateAccessConfig}. + * @memberof google.cloud.compute.v1.Instances + * @typedef UpdateAccessConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls UpdateAccessConfig. + * @function updateAccessConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest} request UpdateAccessConfigInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.UpdateAccessConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.updateAccessConfig = function updateAccessConfig(request, callback) { + return this.rpcCall(updateAccessConfig, $root.google.cloud.compute.v1.UpdateAccessConfigInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "UpdateAccessConfig" }); + + /** + * Calls UpdateAccessConfig. + * @function updateAccessConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest} request UpdateAccessConfigInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateDisplayDevice}. + * @memberof google.cloud.compute.v1.Instances + * @typedef UpdateDisplayDeviceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls UpdateDisplayDevice. + * @function updateDisplayDevice + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest} request UpdateDisplayDeviceInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.UpdateDisplayDeviceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.updateDisplayDevice = function updateDisplayDevice(request, callback) { + return this.rpcCall(updateDisplayDevice, $root.google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "UpdateDisplayDevice" }); + + /** + * Calls UpdateDisplayDevice. + * @function updateDisplayDevice + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest} request UpdateDisplayDeviceInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateNetworkInterface}. + * @memberof google.cloud.compute.v1.Instances + * @typedef UpdateNetworkInterfaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls UpdateNetworkInterface. + * @function updateNetworkInterface + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest} request UpdateNetworkInterfaceInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.UpdateNetworkInterfaceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.updateNetworkInterface = function updateNetworkInterface(request, callback) { + return this.rpcCall(updateNetworkInterface, $root.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "UpdateNetworkInterface" }); + + /** + * Calls UpdateNetworkInterface. + * @function updateNetworkInterface + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest} request UpdateNetworkInterfaceInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Instances#updateShieldedInstanceConfig}. + * @memberof google.cloud.compute.v1.Instances + * @typedef UpdateShieldedInstanceConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls UpdateShieldedInstanceConfig. + * @function updateShieldedInstanceConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest} request UpdateShieldedInstanceConfigInstanceRequest message or plain object + * @param {google.cloud.compute.v1.Instances.UpdateShieldedInstanceConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Instances.prototype.updateShieldedInstanceConfig = function updateShieldedInstanceConfig(request, callback) { + return this.rpcCall(updateShieldedInstanceConfig, $root.google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "UpdateShieldedInstanceConfig" }); + + /** + * Calls UpdateShieldedInstanceConfig. + * @function updateShieldedInstanceConfig + * @memberof google.cloud.compute.v1.Instances + * @instance + * @param {google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest} request UpdateShieldedInstanceConfigInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Instances; + })(); + + v1.InterconnectAttachments = (function() { + + /** + * Constructs a new InterconnectAttachments service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectAttachments + * @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 InterconnectAttachments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (InterconnectAttachments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InterconnectAttachments; + + /** + * Creates new InterconnectAttachments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @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 {InterconnectAttachments} RPC service. Useful where requests and/or responses are streamed. + */ + InterconnectAttachments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#aggregatedList}. + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InterconnectAttachmentAggregatedList} [response] InterconnectAttachmentAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest} request AggregatedListInterconnectAttachmentsRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectAttachments.AggregatedListCallback} callback Node-style callback called with the error, if any, and InterconnectAttachmentAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectAttachments.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest, $root.google.cloud.compute.v1.InterconnectAttachmentAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest} request AggregatedListInterconnectAttachmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#delete_}. + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest} request DeleteInterconnectAttachmentRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectAttachments.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectAttachments.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteInterconnectAttachmentRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest} request DeleteInterconnectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#get}. + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InterconnectAttachment} [response] InterconnectAttachment + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IGetInterconnectAttachmentRequest} request GetInterconnectAttachmentRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectAttachments.GetCallback} callback Node-style callback called with the error, if any, and InterconnectAttachment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectAttachments.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetInterconnectAttachmentRequest, $root.google.cloud.compute.v1.InterconnectAttachment, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IGetInterconnectAttachmentRequest} request GetInterconnectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#insert}. + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IInsertInterconnectAttachmentRequest} request InsertInterconnectAttachmentRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectAttachments.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectAttachments.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertInterconnectAttachmentRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IInsertInterconnectAttachmentRequest} request InsertInterconnectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#list}. + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InterconnectAttachmentList} [response] InterconnectAttachmentList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IListInterconnectAttachmentsRequest} request ListInterconnectAttachmentsRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectAttachments.ListCallback} callback Node-style callback called with the error, if any, and InterconnectAttachmentList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectAttachments.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListInterconnectAttachmentsRequest, $root.google.cloud.compute.v1.InterconnectAttachmentList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IListInterconnectAttachmentsRequest} request ListInterconnectAttachmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectAttachments#patch}. + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IPatchInterconnectAttachmentRequest} request PatchInterconnectAttachmentRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectAttachments.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectAttachments.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchInterconnectAttachmentRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.InterconnectAttachments + * @instance + * @param {google.cloud.compute.v1.IPatchInterconnectAttachmentRequest} request PatchInterconnectAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return InterconnectAttachments; + })(); + + v1.InterconnectLocations = (function() { + + /** + * Constructs a new InterconnectLocations service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an InterconnectLocations + * @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 InterconnectLocations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (InterconnectLocations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = InterconnectLocations; + + /** + * Creates new InterconnectLocations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.InterconnectLocations + * @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 {InterconnectLocations} RPC service. Useful where requests and/or responses are streamed. + */ + InterconnectLocations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectLocations#get}. + * @memberof google.cloud.compute.v1.InterconnectLocations + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InterconnectLocation} [response] InterconnectLocation + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InterconnectLocations + * @instance + * @param {google.cloud.compute.v1.IGetInterconnectLocationRequest} request GetInterconnectLocationRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectLocations.GetCallback} callback Node-style callback called with the error, if any, and InterconnectLocation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectLocations.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetInterconnectLocationRequest, $root.google.cloud.compute.v1.InterconnectLocation, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.InterconnectLocations + * @instance + * @param {google.cloud.compute.v1.IGetInterconnectLocationRequest} request GetInterconnectLocationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.InterconnectLocations#list}. + * @memberof google.cloud.compute.v1.InterconnectLocations + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InterconnectLocationList} [response] InterconnectLocationList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InterconnectLocations + * @instance + * @param {google.cloud.compute.v1.IListInterconnectLocationsRequest} request ListInterconnectLocationsRequest message or plain object + * @param {google.cloud.compute.v1.InterconnectLocations.ListCallback} callback Node-style callback called with the error, if any, and InterconnectLocationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(InterconnectLocations.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListInterconnectLocationsRequest, $root.google.cloud.compute.v1.InterconnectLocationList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.InterconnectLocations + * @instance + * @param {google.cloud.compute.v1.IListInterconnectLocationsRequest} request ListInterconnectLocationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return InterconnectLocations; + })(); + + v1.Interconnects = (function() { + + /** + * Constructs a new Interconnects service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an Interconnects + * @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 Interconnects(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Interconnects.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Interconnects; + + /** + * Creates new Interconnects service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Interconnects + * @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 {Interconnects} RPC service. Useful where requests and/or responses are streamed. + */ + Interconnects.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#delete_}. + * @memberof google.cloud.compute.v1.Interconnects + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IDeleteInterconnectRequest} request DeleteInterconnectRequest message or plain object + * @param {google.cloud.compute.v1.Interconnects.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Interconnects.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteInterconnectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IDeleteInterconnectRequest} request DeleteInterconnectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#get}. + * @memberof google.cloud.compute.v1.Interconnects + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Interconnect} [response] Interconnect + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IGetInterconnectRequest} request GetInterconnectRequest message or plain object + * @param {google.cloud.compute.v1.Interconnects.GetCallback} callback Node-style callback called with the error, if any, and Interconnect + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Interconnects.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetInterconnectRequest, $root.google.cloud.compute.v1.Interconnect, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IGetInterconnectRequest} request GetInterconnectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#getDiagnostics}. + * @memberof google.cloud.compute.v1.Interconnects + * @typedef GetDiagnosticsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse} [response] InterconnectsGetDiagnosticsResponse + */ + + /** + * Calls GetDiagnostics. + * @function getDiagnostics + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest} request GetDiagnosticsInterconnectRequest message or plain object + * @param {google.cloud.compute.v1.Interconnects.GetDiagnosticsCallback} callback Node-style callback called with the error, if any, and InterconnectsGetDiagnosticsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Interconnects.prototype.getDiagnostics = function getDiagnostics(request, callback) { + return this.rpcCall(getDiagnostics, $root.google.cloud.compute.v1.GetDiagnosticsInterconnectRequest, $root.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse, request, callback); + }, "name", { value: "GetDiagnostics" }); + + /** + * Calls GetDiagnostics. + * @function getDiagnostics + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest} request GetDiagnosticsInterconnectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#insert}. + * @memberof google.cloud.compute.v1.Interconnects + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IInsertInterconnectRequest} request InsertInterconnectRequest message or plain object + * @param {google.cloud.compute.v1.Interconnects.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Interconnects.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertInterconnectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IInsertInterconnectRequest} request InsertInterconnectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#list}. + * @memberof google.cloud.compute.v1.Interconnects + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InterconnectList} [response] InterconnectList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IListInterconnectsRequest} request ListInterconnectsRequest message or plain object + * @param {google.cloud.compute.v1.Interconnects.ListCallback} callback Node-style callback called with the error, if any, and InterconnectList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Interconnects.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListInterconnectsRequest, $root.google.cloud.compute.v1.InterconnectList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IListInterconnectsRequest} request ListInterconnectsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Interconnects#patch}. + * @memberof google.cloud.compute.v1.Interconnects + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IPatchInterconnectRequest} request PatchInterconnectRequest message or plain object + * @param {google.cloud.compute.v1.Interconnects.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Interconnects.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchInterconnectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Interconnects + * @instance + * @param {google.cloud.compute.v1.IPatchInterconnectRequest} request PatchInterconnectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Interconnects; + })(); + + v1.LicenseCodes = (function() { + + /** + * Constructs a new LicenseCodes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a LicenseCodes + * @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 LicenseCodes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (LicenseCodes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = LicenseCodes; + + /** + * Creates new LicenseCodes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.LicenseCodes + * @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 {LicenseCodes} RPC service. Useful where requests and/or responses are streamed. + */ + LicenseCodes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.LicenseCodes#get}. + * @memberof google.cloud.compute.v1.LicenseCodes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.LicenseCode} [response] LicenseCode + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.LicenseCodes + * @instance + * @param {google.cloud.compute.v1.IGetLicenseCodeRequest} request GetLicenseCodeRequest message or plain object + * @param {google.cloud.compute.v1.LicenseCodes.GetCallback} callback Node-style callback called with the error, if any, and LicenseCode + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LicenseCodes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetLicenseCodeRequest, $root.google.cloud.compute.v1.LicenseCode, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.LicenseCodes + * @instance + * @param {google.cloud.compute.v1.IGetLicenseCodeRequest} request GetLicenseCodeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.LicenseCodes#testIamPermissions}. + * @memberof google.cloud.compute.v1.LicenseCodes + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.LicenseCodes + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest} request TestIamPermissionsLicenseCodeRequest message or plain object + * @param {google.cloud.compute.v1.LicenseCodes.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(LicenseCodes.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.LicenseCodes + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest} request TestIamPermissionsLicenseCodeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return LicenseCodes; + })(); + + v1.Licenses = (function() { + + /** + * Constructs a new Licenses service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Licenses + * @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 Licenses(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Licenses.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Licenses; + + /** + * Creates new Licenses service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Licenses + * @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 {Licenses} RPC service. Useful where requests and/or responses are streamed. + */ + Licenses.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#delete_}. + * @memberof google.cloud.compute.v1.Licenses + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IDeleteLicenseRequest} request DeleteLicenseRequest message or plain object + * @param {google.cloud.compute.v1.Licenses.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Licenses.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteLicenseRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IDeleteLicenseRequest} request DeleteLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#get}. + * @memberof google.cloud.compute.v1.Licenses + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.License} [response] License + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IGetLicenseRequest} request GetLicenseRequest message or plain object + * @param {google.cloud.compute.v1.Licenses.GetCallback} callback Node-style callback called with the error, if any, and License + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Licenses.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetLicenseRequest, $root.google.cloud.compute.v1.License, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IGetLicenseRequest} request GetLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#getIamPolicy}. + * @memberof google.cloud.compute.v1.Licenses + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyLicenseRequest} request GetIamPolicyLicenseRequest message or plain object + * @param {google.cloud.compute.v1.Licenses.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Licenses.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyLicenseRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyLicenseRequest} request GetIamPolicyLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#insert}. + * @memberof google.cloud.compute.v1.Licenses + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IInsertLicenseRequest} request InsertLicenseRequest message or plain object + * @param {google.cloud.compute.v1.Licenses.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Licenses.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertLicenseRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IInsertLicenseRequest} request InsertLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#list}. + * @memberof google.cloud.compute.v1.Licenses + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.LicensesListResponse} [response] LicensesListResponse + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IListLicensesRequest} request ListLicensesRequest message or plain object + * @param {google.cloud.compute.v1.Licenses.ListCallback} callback Node-style callback called with the error, if any, and LicensesListResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Licenses.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListLicensesRequest, $root.google.cloud.compute.v1.LicensesListResponse, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.IListLicensesRequest} request ListLicensesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#setIamPolicy}. + * @memberof google.cloud.compute.v1.Licenses + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyLicenseRequest} request SetIamPolicyLicenseRequest message or plain object + * @param {google.cloud.compute.v1.Licenses.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Licenses.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyLicenseRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyLicenseRequest} request SetIamPolicyLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Licenses#testIamPermissions}. + * @memberof google.cloud.compute.v1.Licenses + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseRequest} request TestIamPermissionsLicenseRequest message or plain object + * @param {google.cloud.compute.v1.Licenses.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Licenses.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsLicenseRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Licenses + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsLicenseRequest} request TestIamPermissionsLicenseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Licenses; + })(); + + v1.MachineTypes = (function() { + + /** + * Constructs a new MachineTypes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a MachineTypes + * @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 MachineTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (MachineTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MachineTypes; + + /** + * Creates new MachineTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.MachineTypes + * @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 {MachineTypes} RPC service. Useful where requests and/or responses are streamed. + */ + MachineTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.MachineTypes#aggregatedList}. + * @memberof google.cloud.compute.v1.MachineTypes + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.MachineTypeAggregatedList} [response] MachineTypeAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.MachineTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListMachineTypesRequest} request AggregatedListMachineTypesRequest message or plain object + * @param {google.cloud.compute.v1.MachineTypes.AggregatedListCallback} callback Node-style callback called with the error, if any, and MachineTypeAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MachineTypes.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListMachineTypesRequest, $root.google.cloud.compute.v1.MachineTypeAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.MachineTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListMachineTypesRequest} request AggregatedListMachineTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.MachineTypes#get}. + * @memberof google.cloud.compute.v1.MachineTypes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.MachineType} [response] MachineType + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.MachineTypes + * @instance + * @param {google.cloud.compute.v1.IGetMachineTypeRequest} request GetMachineTypeRequest message or plain object + * @param {google.cloud.compute.v1.MachineTypes.GetCallback} callback Node-style callback called with the error, if any, and MachineType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MachineTypes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetMachineTypeRequest, $root.google.cloud.compute.v1.MachineType, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.MachineTypes + * @instance + * @param {google.cloud.compute.v1.IGetMachineTypeRequest} request GetMachineTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.MachineTypes#list}. + * @memberof google.cloud.compute.v1.MachineTypes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.MachineTypeList} [response] MachineTypeList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.MachineTypes + * @instance + * @param {google.cloud.compute.v1.IListMachineTypesRequest} request ListMachineTypesRequest message or plain object + * @param {google.cloud.compute.v1.MachineTypes.ListCallback} callback Node-style callback called with the error, if any, and MachineTypeList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(MachineTypes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListMachineTypesRequest, $root.google.cloud.compute.v1.MachineTypeList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.MachineTypes + * @instance + * @param {google.cloud.compute.v1.IListMachineTypesRequest} request ListMachineTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return MachineTypes; + })(); + + v1.NetworkEndpointGroups = (function() { + + /** + * Constructs a new NetworkEndpointGroups service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NetworkEndpointGroups + * @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 NetworkEndpointGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NetworkEndpointGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NetworkEndpointGroups; + + /** + * Creates new NetworkEndpointGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @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 {NetworkEndpointGroups} RPC service. Useful where requests and/or responses are streamed. + */ + NetworkEndpointGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#aggregatedList}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroupAggregatedList} [response] NetworkEndpointGroupAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest} request AggregatedListNetworkEndpointGroupsRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.AggregatedListCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroupAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest, $root.google.cloud.compute.v1.NetworkEndpointGroupAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest} request AggregatedListNetworkEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#attachNetworkEndpoints}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef AttachNetworkEndpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AttachNetworkEndpoints. + * @function attachNetworkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest} request AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.AttachNetworkEndpointsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.attachNetworkEndpoints = function attachNetworkEndpoints(request, callback) { + return this.rpcCall(attachNetworkEndpoints, $root.google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AttachNetworkEndpoints" }); + + /** + * Calls AttachNetworkEndpoints. + * @function attachNetworkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest} request AttachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#delete_}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest} request DeleteNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest} request DeleteNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#detachNetworkEndpoints}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef DetachNetworkEndpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DetachNetworkEndpoints. + * @function detachNetworkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest} request DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.DetachNetworkEndpointsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.detachNetworkEndpoints = function detachNetworkEndpoints(request, callback) { + return this.rpcCall(detachNetworkEndpoints, $root.google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DetachNetworkEndpoints" }); + + /** + * Calls DetachNetworkEndpoints. + * @function detachNetworkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest} request DetachNetworkEndpointsNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#get}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroup} [response] NetworkEndpointGroup + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IGetNetworkEndpointGroupRequest} request GetNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.GetCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.NetworkEndpointGroup, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IGetNetworkEndpointGroupRequest} request GetNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#insert}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest} request InsertNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest} request InsertNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#list}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroupList} [response] NetworkEndpointGroupList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListNetworkEndpointGroupsRequest} request ListNetworkEndpointGroupsRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.ListCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroupList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest, $root.google.cloud.compute.v1.NetworkEndpointGroupList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListNetworkEndpointGroupsRequest} request ListNetworkEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#listNetworkEndpoints}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef ListNetworkEndpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints} [response] NetworkEndpointGroupsListNetworkEndpoints + */ + + /** + * Calls ListNetworkEndpoints. + * @function listNetworkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest} request ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.ListNetworkEndpointsCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroupsListNetworkEndpoints + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.listNetworkEndpoints = function listNetworkEndpoints(request, callback) { + return this.rpcCall(listNetworkEndpoints, $root.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest, $root.google.cloud.compute.v1.NetworkEndpointGroupsListNetworkEndpoints, request, callback); + }, "name", { value: "ListNetworkEndpoints" }); + + /** + * Calls ListNetworkEndpoints. + * @function listNetworkEndpoints + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest} request ListNetworkEndpointsNetworkEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkEndpointGroups#testIamPermissions}. + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest} request TestIamPermissionsNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.NetworkEndpointGroups.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NetworkEndpointGroups.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.NetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest} request TestIamPermissionsNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NetworkEndpointGroups; + })(); + + v1.Networks = (function() { + + /** + * Constructs a new Networks service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Networks + * @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 Networks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Networks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Networks; + + /** + * Creates new Networks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Networks + * @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 {Networks} RPC service. Useful where requests and/or responses are streamed. + */ + Networks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#addPeering}. + * @memberof google.cloud.compute.v1.Networks + * @typedef AddPeeringCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddPeering. + * @function addPeering + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IAddPeeringNetworkRequest} request AddPeeringNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.AddPeeringCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.addPeering = function addPeering(request, callback) { + return this.rpcCall(addPeering, $root.google.cloud.compute.v1.AddPeeringNetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddPeering" }); + + /** + * Calls AddPeering. + * @function addPeering + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IAddPeeringNetworkRequest} request AddPeeringNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#delete_}. + * @memberof google.cloud.compute.v1.Networks + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IDeleteNetworkRequest} request DeleteNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteNetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IDeleteNetworkRequest} request DeleteNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#get}. + * @memberof google.cloud.compute.v1.Networks + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Network} [response] Network + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IGetNetworkRequest} request GetNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.GetCallback} callback Node-style callback called with the error, if any, and Network + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetNetworkRequest, $root.google.cloud.compute.v1.Network, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IGetNetworkRequest} request GetNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#getEffectiveFirewalls}. + * @memberof google.cloud.compute.v1.Networks + * @typedef GetEffectiveFirewallsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse} [response] NetworksGetEffectiveFirewallsResponse + */ + + /** + * Calls GetEffectiveFirewalls. + * @function getEffectiveFirewalls + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest} request GetEffectiveFirewallsNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.GetEffectiveFirewallsCallback} callback Node-style callback called with the error, if any, and NetworksGetEffectiveFirewallsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.getEffectiveFirewalls = function getEffectiveFirewalls(request, callback) { + return this.rpcCall(getEffectiveFirewalls, $root.google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest, $root.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse, request, callback); + }, "name", { value: "GetEffectiveFirewalls" }); + + /** + * Calls GetEffectiveFirewalls. + * @function getEffectiveFirewalls + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest} request GetEffectiveFirewallsNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#insert}. + * @memberof google.cloud.compute.v1.Networks + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IInsertNetworkRequest} request InsertNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertNetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IInsertNetworkRequest} request InsertNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#list}. + * @memberof google.cloud.compute.v1.Networks + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkList} [response] NetworkList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IListNetworksRequest} request ListNetworksRequest message or plain object + * @param {google.cloud.compute.v1.Networks.ListCallback} callback Node-style callback called with the error, if any, and NetworkList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListNetworksRequest, $root.google.cloud.compute.v1.NetworkList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IListNetworksRequest} request ListNetworksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#listPeeringRoutes}. + * @memberof google.cloud.compute.v1.Networks + * @typedef ListPeeringRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ExchangedPeeringRoutesList} [response] ExchangedPeeringRoutesList + */ + + /** + * Calls ListPeeringRoutes. + * @function listPeeringRoutes + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IListPeeringRoutesNetworksRequest} request ListPeeringRoutesNetworksRequest message or plain object + * @param {google.cloud.compute.v1.Networks.ListPeeringRoutesCallback} callback Node-style callback called with the error, if any, and ExchangedPeeringRoutesList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.listPeeringRoutes = function listPeeringRoutes(request, callback) { + return this.rpcCall(listPeeringRoutes, $root.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest, $root.google.cloud.compute.v1.ExchangedPeeringRoutesList, request, callback); + }, "name", { value: "ListPeeringRoutes" }); + + /** + * Calls ListPeeringRoutes. + * @function listPeeringRoutes + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IListPeeringRoutesNetworksRequest} request ListPeeringRoutesNetworksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#patch}. + * @memberof google.cloud.compute.v1.Networks + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IPatchNetworkRequest} request PatchNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchNetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IPatchNetworkRequest} request PatchNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#removePeering}. + * @memberof google.cloud.compute.v1.Networks + * @typedef RemovePeeringCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemovePeering. + * @function removePeering + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IRemovePeeringNetworkRequest} request RemovePeeringNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.RemovePeeringCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.removePeering = function removePeering(request, callback) { + return this.rpcCall(removePeering, $root.google.cloud.compute.v1.RemovePeeringNetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemovePeering" }); + + /** + * Calls RemovePeering. + * @function removePeering + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IRemovePeeringNetworkRequest} request RemovePeeringNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#switchToCustomMode}. + * @memberof google.cloud.compute.v1.Networks + * @typedef SwitchToCustomModeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SwitchToCustomMode. + * @function switchToCustomMode + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest} request SwitchToCustomModeNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.SwitchToCustomModeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.switchToCustomMode = function switchToCustomMode(request, callback) { + return this.rpcCall(switchToCustomMode, $root.google.cloud.compute.v1.SwitchToCustomModeNetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SwitchToCustomMode" }); + + /** + * Calls SwitchToCustomMode. + * @function switchToCustomMode + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest} request SwitchToCustomModeNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Networks#updatePeering}. + * @memberof google.cloud.compute.v1.Networks + * @typedef UpdatePeeringCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls UpdatePeering. + * @function updatePeering + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IUpdatePeeringNetworkRequest} request UpdatePeeringNetworkRequest message or plain object + * @param {google.cloud.compute.v1.Networks.UpdatePeeringCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Networks.prototype.updatePeering = function updatePeering(request, callback) { + return this.rpcCall(updatePeering, $root.google.cloud.compute.v1.UpdatePeeringNetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "UpdatePeering" }); + + /** + * Calls UpdatePeering. + * @function updatePeering + * @memberof google.cloud.compute.v1.Networks + * @instance + * @param {google.cloud.compute.v1.IUpdatePeeringNetworkRequest} request UpdatePeeringNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Networks; + })(); + + v1.NodeGroups = (function() { + + /** + * Constructs a new NodeGroups service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeGroups + * @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 NodeGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NodeGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NodeGroups; + + /** + * Creates new NodeGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.NodeGroups + * @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 {NodeGroups} RPC service. Useful where requests and/or responses are streamed. + */ + NodeGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#addNodes}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef AddNodesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddNodes. + * @function addNodes + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IAddNodesNodeGroupRequest} request AddNodesNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.AddNodesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.addNodes = function addNodes(request, callback) { + return this.rpcCall(addNodes, $root.google.cloud.compute.v1.AddNodesNodeGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddNodes" }); + + /** + * Calls AddNodes. + * @function addNodes + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IAddNodesNodeGroupRequest} request AddNodesNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#aggregatedList}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeGroupAggregatedList} [response] NodeGroupAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNodeGroupsRequest} request AggregatedListNodeGroupsRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.AggregatedListCallback} callback Node-style callback called with the error, if any, and NodeGroupAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListNodeGroupsRequest, $root.google.cloud.compute.v1.NodeGroupAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNodeGroupsRequest} request AggregatedListNodeGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#delete_}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteNodeGroupRequest} request DeleteNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteNodeGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteNodeGroupRequest} request DeleteNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#deleteNodes}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef DeleteNodesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeleteNodes. + * @function deleteNodes + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteNodesNodeGroupRequest} request DeleteNodesNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.DeleteNodesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.deleteNodes = function deleteNodes(request, callback) { + return this.rpcCall(deleteNodes, $root.google.cloud.compute.v1.DeleteNodesNodeGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeleteNodes" }); + + /** + * Calls DeleteNodes. + * @function deleteNodes + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteNodesNodeGroupRequest} request DeleteNodesNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#get}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeGroup} [response] NodeGroup + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IGetNodeGroupRequest} request GetNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.GetCallback} callback Node-style callback called with the error, if any, and NodeGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetNodeGroupRequest, $root.google.cloud.compute.v1.NodeGroup, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IGetNodeGroupRequest} request GetNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#getIamPolicy}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest} request GetIamPolicyNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyNodeGroupRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest} request GetIamPolicyNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#insert}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IInsertNodeGroupRequest} request InsertNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertNodeGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IInsertNodeGroupRequest} request InsertNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#list}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeGroupList} [response] NodeGroupList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IListNodeGroupsRequest} request ListNodeGroupsRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.ListCallback} callback Node-style callback called with the error, if any, and NodeGroupList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListNodeGroupsRequest, $root.google.cloud.compute.v1.NodeGroupList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IListNodeGroupsRequest} request ListNodeGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#listNodes}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef ListNodesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeGroupsListNodes} [response] NodeGroupsListNodes + */ + + /** + * Calls ListNodes. + * @function listNodes + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IListNodesNodeGroupsRequest} request ListNodesNodeGroupsRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.ListNodesCallback} callback Node-style callback called with the error, if any, and NodeGroupsListNodes + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.listNodes = function listNodes(request, callback) { + return this.rpcCall(listNodes, $root.google.cloud.compute.v1.ListNodesNodeGroupsRequest, $root.google.cloud.compute.v1.NodeGroupsListNodes, request, callback); + }, "name", { value: "ListNodes" }); + + /** + * Calls ListNodes. + * @function listNodes + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IListNodesNodeGroupsRequest} request ListNodesNodeGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#patch}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IPatchNodeGroupRequest} request PatchNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchNodeGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.IPatchNodeGroupRequest} request PatchNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#setIamPolicy}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest} request SetIamPolicyNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyNodeGroupRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest} request SetIamPolicyNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#setNodeTemplate}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef SetNodeTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetNodeTemplate. + * @function setNodeTemplate + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest} request SetNodeTemplateNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.SetNodeTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.setNodeTemplate = function setNodeTemplate(request, callback) { + return this.rpcCall(setNodeTemplate, $root.google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetNodeTemplate" }); + + /** + * Calls SetNodeTemplate. + * @function setNodeTemplate + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest} request SetNodeTemplateNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeGroups#testIamPermissions}. + * @memberof google.cloud.compute.v1.NodeGroups + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest} request TestIamPermissionsNodeGroupRequest message or plain object + * @param {google.cloud.compute.v1.NodeGroups.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroups.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.NodeGroups + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest} request TestIamPermissionsNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NodeGroups; + })(); + + v1.NodeTemplates = (function() { + + /** + * Constructs a new NodeTemplates service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTemplates + * @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 NodeTemplates(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NodeTemplates.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NodeTemplates; + + /** + * Creates new NodeTemplates service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.NodeTemplates + * @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 {NodeTemplates} RPC service. Useful where requests and/or responses are streamed. + */ + NodeTemplates.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#aggregatedList}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeTemplateAggregatedList} [response] NodeTemplateAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest} request AggregatedListNodeTemplatesRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.AggregatedListCallback} callback Node-style callback called with the error, if any, and NodeTemplateAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListNodeTemplatesRequest, $root.google.cloud.compute.v1.NodeTemplateAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest} request AggregatedListNodeTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#delete_}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IDeleteNodeTemplateRequest} request DeleteNodeTemplateRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteNodeTemplateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IDeleteNodeTemplateRequest} request DeleteNodeTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#get}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeTemplate} [response] NodeTemplate + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IGetNodeTemplateRequest} request GetNodeTemplateRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.GetCallback} callback Node-style callback called with the error, if any, and NodeTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetNodeTemplateRequest, $root.google.cloud.compute.v1.NodeTemplate, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IGetNodeTemplateRequest} request GetNodeTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#getIamPolicy}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest} request GetIamPolicyNodeTemplateRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest} request GetIamPolicyNodeTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#insert}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IInsertNodeTemplateRequest} request InsertNodeTemplateRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertNodeTemplateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IInsertNodeTemplateRequest} request InsertNodeTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#list}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeTemplateList} [response] NodeTemplateList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IListNodeTemplatesRequest} request ListNodeTemplatesRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.ListCallback} callback Node-style callback called with the error, if any, and NodeTemplateList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListNodeTemplatesRequest, $root.google.cloud.compute.v1.NodeTemplateList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.IListNodeTemplatesRequest} request ListNodeTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#setIamPolicy}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest} request SetIamPolicyNodeTemplateRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest} request SetIamPolicyNodeTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTemplates#testIamPermissions}. + * @memberof google.cloud.compute.v1.NodeTemplates + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest} request TestIamPermissionsNodeTemplateRequest message or plain object + * @param {google.cloud.compute.v1.NodeTemplates.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTemplates.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.NodeTemplates + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest} request TestIamPermissionsNodeTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NodeTemplates; + })(); + + v1.NodeTypes = (function() { + + /** + * Constructs a new NodeTypes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a NodeTypes + * @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 NodeTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NodeTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NodeTypes; + + /** + * Creates new NodeTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.NodeTypes + * @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 {NodeTypes} RPC service. Useful where requests and/or responses are streamed. + */ + NodeTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTypes#aggregatedList}. + * @memberof google.cloud.compute.v1.NodeTypes + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeTypeAggregatedList} [response] NodeTypeAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NodeTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNodeTypesRequest} request AggregatedListNodeTypesRequest message or plain object + * @param {google.cloud.compute.v1.NodeTypes.AggregatedListCallback} callback Node-style callback called with the error, if any, and NodeTypeAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTypes.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListNodeTypesRequest, $root.google.cloud.compute.v1.NodeTypeAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.NodeTypes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListNodeTypesRequest} request AggregatedListNodeTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTypes#get}. + * @memberof google.cloud.compute.v1.NodeTypes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeType} [response] NodeType + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NodeTypes + * @instance + * @param {google.cloud.compute.v1.IGetNodeTypeRequest} request GetNodeTypeRequest message or plain object + * @param {google.cloud.compute.v1.NodeTypes.GetCallback} callback Node-style callback called with the error, if any, and NodeType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTypes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetNodeTypeRequest, $root.google.cloud.compute.v1.NodeType, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.NodeTypes + * @instance + * @param {google.cloud.compute.v1.IGetNodeTypeRequest} request GetNodeTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.NodeTypes#list}. + * @memberof google.cloud.compute.v1.NodeTypes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NodeTypeList} [response] NodeTypeList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NodeTypes + * @instance + * @param {google.cloud.compute.v1.IListNodeTypesRequest} request ListNodeTypesRequest message or plain object + * @param {google.cloud.compute.v1.NodeTypes.ListCallback} callback Node-style callback called with the error, if any, and NodeTypeList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeTypes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListNodeTypesRequest, $root.google.cloud.compute.v1.NodeTypeList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.NodeTypes + * @instance + * @param {google.cloud.compute.v1.IListNodeTypesRequest} request ListNodeTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NodeTypes; + })(); + + v1.PacketMirrorings = (function() { + + /** + * Constructs a new PacketMirrorings service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PacketMirrorings + * @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 PacketMirrorings(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PacketMirrorings.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PacketMirrorings; + + /** + * Creates new PacketMirrorings service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.PacketMirrorings + * @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 {PacketMirrorings} RPC service. Useful where requests and/or responses are streamed. + */ + PacketMirrorings.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#aggregatedList}. + * @memberof google.cloud.compute.v1.PacketMirrorings + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PacketMirroringAggregatedList} [response] PacketMirroringAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest} request AggregatedListPacketMirroringsRequest message or plain object + * @param {google.cloud.compute.v1.PacketMirrorings.AggregatedListCallback} callback Node-style callback called with the error, if any, and PacketMirroringAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PacketMirrorings.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListPacketMirroringsRequest, $root.google.cloud.compute.v1.PacketMirroringAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest} request AggregatedListPacketMirroringsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#delete_}. + * @memberof google.cloud.compute.v1.PacketMirrorings + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IDeletePacketMirroringRequest} request DeletePacketMirroringRequest message or plain object + * @param {google.cloud.compute.v1.PacketMirrorings.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PacketMirrorings.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeletePacketMirroringRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IDeletePacketMirroringRequest} request DeletePacketMirroringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#get}. + * @memberof google.cloud.compute.v1.PacketMirrorings + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PacketMirroring} [response] PacketMirroring + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IGetPacketMirroringRequest} request GetPacketMirroringRequest message or plain object + * @param {google.cloud.compute.v1.PacketMirrorings.GetCallback} callback Node-style callback called with the error, if any, and PacketMirroring + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PacketMirrorings.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetPacketMirroringRequest, $root.google.cloud.compute.v1.PacketMirroring, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IGetPacketMirroringRequest} request GetPacketMirroringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#insert}. + * @memberof google.cloud.compute.v1.PacketMirrorings + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IInsertPacketMirroringRequest} request InsertPacketMirroringRequest message or plain object + * @param {google.cloud.compute.v1.PacketMirrorings.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PacketMirrorings.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertPacketMirroringRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IInsertPacketMirroringRequest} request InsertPacketMirroringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#list}. + * @memberof google.cloud.compute.v1.PacketMirrorings + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PacketMirroringList} [response] PacketMirroringList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IListPacketMirroringsRequest} request ListPacketMirroringsRequest message or plain object + * @param {google.cloud.compute.v1.PacketMirrorings.ListCallback} callback Node-style callback called with the error, if any, and PacketMirroringList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PacketMirrorings.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListPacketMirroringsRequest, $root.google.cloud.compute.v1.PacketMirroringList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IListPacketMirroringsRequest} request ListPacketMirroringsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#patch}. + * @memberof google.cloud.compute.v1.PacketMirrorings + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IPatchPacketMirroringRequest} request PatchPacketMirroringRequest message or plain object + * @param {google.cloud.compute.v1.PacketMirrorings.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PacketMirrorings.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchPacketMirroringRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.IPatchPacketMirroringRequest} request PatchPacketMirroringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PacketMirrorings#testIamPermissions}. + * @memberof google.cloud.compute.v1.PacketMirrorings + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest} request TestIamPermissionsPacketMirroringRequest message or plain object + * @param {google.cloud.compute.v1.PacketMirrorings.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PacketMirrorings.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.PacketMirrorings + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest} request TestIamPermissionsPacketMirroringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PacketMirrorings; + })(); + + v1.Projects = (function() { + + /** + * Constructs a new Projects service. + * @memberof google.cloud.compute.v1 + * @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.compute.v1.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.compute.v1.Projects#disableXpnHost}. + * @memberof google.cloud.compute.v1.Projects + * @typedef DisableXpnHostCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DisableXpnHost. + * @function disableXpnHost + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IDisableXpnHostProjectRequest} request DisableXpnHostProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.DisableXpnHostCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.disableXpnHost = function disableXpnHost(request, callback) { + return this.rpcCall(disableXpnHost, $root.google.cloud.compute.v1.DisableXpnHostProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DisableXpnHost" }); + + /** + * Calls DisableXpnHost. + * @function disableXpnHost + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IDisableXpnHostProjectRequest} request DisableXpnHostProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#disableXpnResource}. + * @memberof google.cloud.compute.v1.Projects + * @typedef DisableXpnResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DisableXpnResource. + * @function disableXpnResource + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IDisableXpnResourceProjectRequest} request DisableXpnResourceProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.DisableXpnResourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.disableXpnResource = function disableXpnResource(request, callback) { + return this.rpcCall(disableXpnResource, $root.google.cloud.compute.v1.DisableXpnResourceProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DisableXpnResource" }); + + /** + * Calls DisableXpnResource. + * @function disableXpnResource + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IDisableXpnResourceProjectRequest} request DisableXpnResourceProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#enableXpnHost}. + * @memberof google.cloud.compute.v1.Projects + * @typedef EnableXpnHostCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls EnableXpnHost. + * @function enableXpnHost + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IEnableXpnHostProjectRequest} request EnableXpnHostProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.EnableXpnHostCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.enableXpnHost = function enableXpnHost(request, callback) { + return this.rpcCall(enableXpnHost, $root.google.cloud.compute.v1.EnableXpnHostProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "EnableXpnHost" }); + + /** + * Calls EnableXpnHost. + * @function enableXpnHost + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IEnableXpnHostProjectRequest} request EnableXpnHostProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#enableXpnResource}. + * @memberof google.cloud.compute.v1.Projects + * @typedef EnableXpnResourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls EnableXpnResource. + * @function enableXpnResource + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IEnableXpnResourceProjectRequest} request EnableXpnResourceProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.EnableXpnResourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.enableXpnResource = function enableXpnResource(request, callback) { + return this.rpcCall(enableXpnResource, $root.google.cloud.compute.v1.EnableXpnResourceProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "EnableXpnResource" }); + + /** + * Calls EnableXpnResource. + * @function enableXpnResource + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IEnableXpnResourceProjectRequest} request EnableXpnResourceProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#get}. + * @memberof google.cloud.compute.v1.Projects + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Project} [response] Project + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IGetProjectRequest} request GetProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.GetCallback} callback Node-style callback called with the error, if any, and Project + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetProjectRequest, $root.google.cloud.compute.v1.Project, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IGetProjectRequest} request GetProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#getXpnHost}. + * @memberof google.cloud.compute.v1.Projects + * @typedef GetXpnHostCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Project} [response] Project + */ + + /** + * Calls GetXpnHost. + * @function getXpnHost + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IGetXpnHostProjectRequest} request GetXpnHostProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.GetXpnHostCallback} callback Node-style callback called with the error, if any, and Project + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.getXpnHost = function getXpnHost(request, callback) { + return this.rpcCall(getXpnHost, $root.google.cloud.compute.v1.GetXpnHostProjectRequest, $root.google.cloud.compute.v1.Project, request, callback); + }, "name", { value: "GetXpnHost" }); + + /** + * Calls GetXpnHost. + * @function getXpnHost + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IGetXpnHostProjectRequest} request GetXpnHostProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#getXpnResources}. + * @memberof google.cloud.compute.v1.Projects + * @typedef GetXpnResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ProjectsGetXpnResources} [response] ProjectsGetXpnResources + */ + + /** + * Calls GetXpnResources. + * @function getXpnResources + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IGetXpnResourcesProjectsRequest} request GetXpnResourcesProjectsRequest message or plain object + * @param {google.cloud.compute.v1.Projects.GetXpnResourcesCallback} callback Node-style callback called with the error, if any, and ProjectsGetXpnResources + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.getXpnResources = function getXpnResources(request, callback) { + return this.rpcCall(getXpnResources, $root.google.cloud.compute.v1.GetXpnResourcesProjectsRequest, $root.google.cloud.compute.v1.ProjectsGetXpnResources, request, callback); + }, "name", { value: "GetXpnResources" }); + + /** + * Calls GetXpnResources. + * @function getXpnResources + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IGetXpnResourcesProjectsRequest} request GetXpnResourcesProjectsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#listXpnHosts}. + * @memberof google.cloud.compute.v1.Projects + * @typedef ListXpnHostsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.XpnHostList} [response] XpnHostList + */ + + /** + * Calls ListXpnHosts. + * @function listXpnHosts + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IListXpnHostsProjectsRequest} request ListXpnHostsProjectsRequest message or plain object + * @param {google.cloud.compute.v1.Projects.ListXpnHostsCallback} callback Node-style callback called with the error, if any, and XpnHostList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.listXpnHosts = function listXpnHosts(request, callback) { + return this.rpcCall(listXpnHosts, $root.google.cloud.compute.v1.ListXpnHostsProjectsRequest, $root.google.cloud.compute.v1.XpnHostList, request, callback); + }, "name", { value: "ListXpnHosts" }); + + /** + * Calls ListXpnHosts. + * @function listXpnHosts + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IListXpnHostsProjectsRequest} request ListXpnHostsProjectsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#moveDisk}. + * @memberof google.cloud.compute.v1.Projects + * @typedef MoveDiskCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls MoveDisk. + * @function moveDisk + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IMoveDiskProjectRequest} request MoveDiskProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.MoveDiskCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.moveDisk = function moveDisk(request, callback) { + return this.rpcCall(moveDisk, $root.google.cloud.compute.v1.MoveDiskProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "MoveDisk" }); + + /** + * Calls MoveDisk. + * @function moveDisk + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IMoveDiskProjectRequest} request MoveDiskProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#moveInstance}. + * @memberof google.cloud.compute.v1.Projects + * @typedef MoveInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls MoveInstance. + * @function moveInstance + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IMoveInstanceProjectRequest} request MoveInstanceProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.MoveInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.moveInstance = function moveInstance(request, callback) { + return this.rpcCall(moveInstance, $root.google.cloud.compute.v1.MoveInstanceProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "MoveInstance" }); + + /** + * Calls MoveInstance. + * @function moveInstance + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.IMoveInstanceProjectRequest} request MoveInstanceProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#setCommonInstanceMetadata}. + * @memberof google.cloud.compute.v1.Projects + * @typedef SetCommonInstanceMetadataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetCommonInstanceMetadata. + * @function setCommonInstanceMetadata + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest} request SetCommonInstanceMetadataProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.SetCommonInstanceMetadataCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.setCommonInstanceMetadata = function setCommonInstanceMetadata(request, callback) { + return this.rpcCall(setCommonInstanceMetadata, $root.google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetCommonInstanceMetadata" }); + + /** + * Calls SetCommonInstanceMetadata. + * @function setCommonInstanceMetadata + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest} request SetCommonInstanceMetadataProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#setDefaultNetworkTier}. + * @memberof google.cloud.compute.v1.Projects + * @typedef SetDefaultNetworkTierCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetDefaultNetworkTier. + * @function setDefaultNetworkTier + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest} request SetDefaultNetworkTierProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.SetDefaultNetworkTierCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.setDefaultNetworkTier = function setDefaultNetworkTier(request, callback) { + return this.rpcCall(setDefaultNetworkTier, $root.google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetDefaultNetworkTier" }); + + /** + * Calls SetDefaultNetworkTier. + * @function setDefaultNetworkTier + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest} request SetDefaultNetworkTierProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Projects#setUsageExportBucket}. + * @memberof google.cloud.compute.v1.Projects + * @typedef SetUsageExportBucketCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetUsageExportBucket. + * @function setUsageExportBucket + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.ISetUsageExportBucketProjectRequest} request SetUsageExportBucketProjectRequest message or plain object + * @param {google.cloud.compute.v1.Projects.SetUsageExportBucketCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Projects.prototype.setUsageExportBucket = function setUsageExportBucket(request, callback) { + return this.rpcCall(setUsageExportBucket, $root.google.cloud.compute.v1.SetUsageExportBucketProjectRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetUsageExportBucket" }); + + /** + * Calls SetUsageExportBucket. + * @function setUsageExportBucket + * @memberof google.cloud.compute.v1.Projects + * @instance + * @param {google.cloud.compute.v1.ISetUsageExportBucketProjectRequest} request SetUsageExportBucketProjectRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Projects; + })(); + + v1.PublicAdvertisedPrefixes = (function() { + + /** + * Constructs a new PublicAdvertisedPrefixes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicAdvertisedPrefixes + * @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 PublicAdvertisedPrefixes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PublicAdvertisedPrefixes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PublicAdvertisedPrefixes; + + /** + * Creates new PublicAdvertisedPrefixes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @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 {PublicAdvertisedPrefixes} RPC service. Useful where requests and/or responses are streamed. + */ + PublicAdvertisedPrefixes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#delete_}. + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest} request DeletePublicAdvertisedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixes.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicAdvertisedPrefixes.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest} request DeletePublicAdvertisedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#get}. + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PublicAdvertisedPrefix} [response] PublicAdvertisedPrefix + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest} request GetPublicAdvertisedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixes.GetCallback} callback Node-style callback called with the error, if any, and PublicAdvertisedPrefix + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicAdvertisedPrefixes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest, $root.google.cloud.compute.v1.PublicAdvertisedPrefix, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest} request GetPublicAdvertisedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#insert}. + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest} request InsertPublicAdvertisedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixes.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicAdvertisedPrefixes.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest} request InsertPublicAdvertisedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#list}. + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixList} [response] PublicAdvertisedPrefixList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest} request ListPublicAdvertisedPrefixesRequest message or plain object + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixes.ListCallback} callback Node-style callback called with the error, if any, and PublicAdvertisedPrefixList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicAdvertisedPrefixes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest, $root.google.cloud.compute.v1.PublicAdvertisedPrefixList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest} request ListPublicAdvertisedPrefixesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicAdvertisedPrefixes#patch}. + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest} request PatchPublicAdvertisedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicAdvertisedPrefixes.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicAdvertisedPrefixes.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.PublicAdvertisedPrefixes + * @instance + * @param {google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest} request PatchPublicAdvertisedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PublicAdvertisedPrefixes; + })(); + + v1.PublicDelegatedPrefixes = (function() { + + /** + * Constructs a new PublicDelegatedPrefixes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a PublicDelegatedPrefixes + * @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 PublicDelegatedPrefixes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PublicDelegatedPrefixes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PublicDelegatedPrefixes; + + /** + * Creates new PublicDelegatedPrefixes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @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 {PublicDelegatedPrefixes} RPC service. Useful where requests and/or responses are streamed. + */ + PublicDelegatedPrefixes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#aggregatedList}. + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList} [response] PublicDelegatedPrefixAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest} request AggregatedListPublicDelegatedPrefixesRequest message or plain object + * @param {google.cloud.compute.v1.PublicDelegatedPrefixes.AggregatedListCallback} callback Node-style callback called with the error, if any, and PublicDelegatedPrefixAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicDelegatedPrefixes.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest, $root.google.cloud.compute.v1.PublicDelegatedPrefixAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest} request AggregatedListPublicDelegatedPrefixesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#delete_}. + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest} request DeletePublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicDelegatedPrefixes.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicDelegatedPrefixes.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest} request DeletePublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#get}. + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PublicDelegatedPrefix} [response] PublicDelegatedPrefix + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest} request GetPublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicDelegatedPrefixes.GetCallback} callback Node-style callback called with the error, if any, and PublicDelegatedPrefix + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicDelegatedPrefixes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.PublicDelegatedPrefix, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest} request GetPublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#insert}. + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest} request InsertPublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicDelegatedPrefixes.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicDelegatedPrefixes.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest} request InsertPublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#list}. + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.PublicDelegatedPrefixList} [response] PublicDelegatedPrefixList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest} request ListPublicDelegatedPrefixesRequest message or plain object + * @param {google.cloud.compute.v1.PublicDelegatedPrefixes.ListCallback} callback Node-style callback called with the error, if any, and PublicDelegatedPrefixList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicDelegatedPrefixes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest, $root.google.cloud.compute.v1.PublicDelegatedPrefixList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest} request ListPublicDelegatedPrefixesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.PublicDelegatedPrefixes#patch}. + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest} request PatchPublicDelegatedPrefixeRequest message or plain object + * @param {google.cloud.compute.v1.PublicDelegatedPrefixes.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PublicDelegatedPrefixes.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.PublicDelegatedPrefixes + * @instance + * @param {google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest} request PatchPublicDelegatedPrefixeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PublicDelegatedPrefixes; + })(); + + v1.RegionAutoscalers = (function() { + + /** + * Constructs a new RegionAutoscalers service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionAutoscalers + * @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 RegionAutoscalers(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionAutoscalers.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionAutoscalers; + + /** + * Creates new RegionAutoscalers service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @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 {RegionAutoscalers} RPC service. Useful where requests and/or responses are streamed. + */ + RegionAutoscalers.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#delete_}. + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionAutoscalerRequest} request DeleteRegionAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.RegionAutoscalers.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionAutoscalers.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionAutoscalerRequest} request DeleteRegionAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#get}. + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Autoscaler} [response] Autoscaler + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IGetRegionAutoscalerRequest} request GetRegionAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.RegionAutoscalers.GetCallback} callback Node-style callback called with the error, if any, and Autoscaler + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionAutoscalers.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionAutoscalerRequest, $root.google.cloud.compute.v1.Autoscaler, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IGetRegionAutoscalerRequest} request GetRegionAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#insert}. + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IInsertRegionAutoscalerRequest} request InsertRegionAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.RegionAutoscalers.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionAutoscalers.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IInsertRegionAutoscalerRequest} request InsertRegionAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#list}. + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionAutoscalerList} [response] RegionAutoscalerList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IListRegionAutoscalersRequest} request ListRegionAutoscalersRequest message or plain object + * @param {google.cloud.compute.v1.RegionAutoscalers.ListCallback} callback Node-style callback called with the error, if any, and RegionAutoscalerList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionAutoscalers.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionAutoscalersRequest, $root.google.cloud.compute.v1.RegionAutoscalerList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IListRegionAutoscalersRequest} request ListRegionAutoscalersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#patch}. + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IPatchRegionAutoscalerRequest} request PatchRegionAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.RegionAutoscalers.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionAutoscalers.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchRegionAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IPatchRegionAutoscalerRequest} request PatchRegionAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionAutoscalers#update}. + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionAutoscalerRequest} request UpdateRegionAutoscalerRequest message or plain object + * @param {google.cloud.compute.v1.RegionAutoscalers.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionAutoscalers.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateRegionAutoscalerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionAutoscalers + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionAutoscalerRequest} request UpdateRegionAutoscalerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionAutoscalers; + })(); + + v1.RegionBackendServices = (function() { + + /** + * Constructs a new RegionBackendServices service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionBackendServices + * @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 RegionBackendServices(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionBackendServices.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionBackendServices; + + /** + * Creates new RegionBackendServices service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionBackendServices + * @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 {RegionBackendServices} RPC service. Useful where requests and/or responses are streamed. + */ + RegionBackendServices.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#delete_}. + * @memberof google.cloud.compute.v1.RegionBackendServices + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionBackendServiceRequest} request DeleteRegionBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionBackendServices.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionBackendServices.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionBackendServiceRequest} request DeleteRegionBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#get}. + * @memberof google.cloud.compute.v1.RegionBackendServices + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendService} [response] BackendService + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IGetRegionBackendServiceRequest} request GetRegionBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionBackendServices.GetCallback} callback Node-style callback called with the error, if any, and BackendService + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionBackendServices.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionBackendServiceRequest, $root.google.cloud.compute.v1.BackendService, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IGetRegionBackendServiceRequest} request GetRegionBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#getHealth}. + * @memberof google.cloud.compute.v1.RegionBackendServices + * @typedef GetHealthCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendServiceGroupHealth} [response] BackendServiceGroupHealth + */ + + /** + * Calls GetHealth. + * @function getHealth + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest} request GetHealthRegionBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionBackendServices.GetHealthCallback} callback Node-style callback called with the error, if any, and BackendServiceGroupHealth + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionBackendServices.prototype.getHealth = function getHealth(request, callback) { + return this.rpcCall(getHealth, $root.google.cloud.compute.v1.GetHealthRegionBackendServiceRequest, $root.google.cloud.compute.v1.BackendServiceGroupHealth, request, callback); + }, "name", { value: "GetHealth" }); + + /** + * Calls GetHealth. + * @function getHealth + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest} request GetHealthRegionBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#insert}. + * @memberof google.cloud.compute.v1.RegionBackendServices + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IInsertRegionBackendServiceRequest} request InsertRegionBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionBackendServices.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionBackendServices.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IInsertRegionBackendServiceRequest} request InsertRegionBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#list}. + * @memberof google.cloud.compute.v1.RegionBackendServices + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.BackendServiceList} [response] BackendServiceList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IListRegionBackendServicesRequest} request ListRegionBackendServicesRequest message or plain object + * @param {google.cloud.compute.v1.RegionBackendServices.ListCallback} callback Node-style callback called with the error, if any, and BackendServiceList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionBackendServices.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionBackendServicesRequest, $root.google.cloud.compute.v1.BackendServiceList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IListRegionBackendServicesRequest} request ListRegionBackendServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#patch}. + * @memberof google.cloud.compute.v1.RegionBackendServices + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IPatchRegionBackendServiceRequest} request PatchRegionBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionBackendServices.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionBackendServices.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchRegionBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IPatchRegionBackendServiceRequest} request PatchRegionBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionBackendServices#update}. + * @memberof google.cloud.compute.v1.RegionBackendServices + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionBackendServiceRequest} request UpdateRegionBackendServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionBackendServices.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionBackendServices.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateRegionBackendServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionBackendServices + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionBackendServiceRequest} request UpdateRegionBackendServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionBackendServices; + })(); + + v1.RegionCommitments = (function() { + + /** + * Constructs a new RegionCommitments service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionCommitments + * @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 RegionCommitments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionCommitments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionCommitments; + + /** + * Creates new RegionCommitments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionCommitments + * @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 {RegionCommitments} RPC service. Useful where requests and/or responses are streamed. + */ + RegionCommitments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#aggregatedList}. + * @memberof google.cloud.compute.v1.RegionCommitments + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.CommitmentAggregatedList} [response] CommitmentAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest} request AggregatedListRegionCommitmentsRequest message or plain object + * @param {google.cloud.compute.v1.RegionCommitments.AggregatedListCallback} callback Node-style callback called with the error, if any, and CommitmentAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionCommitments.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest, $root.google.cloud.compute.v1.CommitmentAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest} request AggregatedListRegionCommitmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#get}. + * @memberof google.cloud.compute.v1.RegionCommitments + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Commitment} [response] Commitment + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IGetRegionCommitmentRequest} request GetRegionCommitmentRequest message or plain object + * @param {google.cloud.compute.v1.RegionCommitments.GetCallback} callback Node-style callback called with the error, if any, and Commitment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionCommitments.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionCommitmentRequest, $root.google.cloud.compute.v1.Commitment, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IGetRegionCommitmentRequest} request GetRegionCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#insert}. + * @memberof google.cloud.compute.v1.RegionCommitments + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IInsertRegionCommitmentRequest} request InsertRegionCommitmentRequest message or plain object + * @param {google.cloud.compute.v1.RegionCommitments.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionCommitments.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionCommitmentRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IInsertRegionCommitmentRequest} request InsertRegionCommitmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionCommitments#list}. + * @memberof google.cloud.compute.v1.RegionCommitments + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.CommitmentList} [response] CommitmentList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IListRegionCommitmentsRequest} request ListRegionCommitmentsRequest message or plain object + * @param {google.cloud.compute.v1.RegionCommitments.ListCallback} callback Node-style callback called with the error, if any, and CommitmentList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionCommitments.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionCommitmentsRequest, $root.google.cloud.compute.v1.CommitmentList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionCommitments + * @instance + * @param {google.cloud.compute.v1.IListRegionCommitmentsRequest} request ListRegionCommitmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionCommitments; + })(); + + v1.RegionDiskTypes = (function() { + + /** + * Constructs a new RegionDiskTypes service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionDiskTypes + * @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 RegionDiskTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionDiskTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionDiskTypes; + + /** + * Creates new RegionDiskTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionDiskTypes + * @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 {RegionDiskTypes} RPC service. Useful where requests and/or responses are streamed. + */ + RegionDiskTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDiskTypes#get}. + * @memberof google.cloud.compute.v1.RegionDiskTypes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DiskType} [response] DiskType + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionDiskTypes + * @instance + * @param {google.cloud.compute.v1.IGetRegionDiskTypeRequest} request GetRegionDiskTypeRequest message or plain object + * @param {google.cloud.compute.v1.RegionDiskTypes.GetCallback} callback Node-style callback called with the error, if any, and DiskType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDiskTypes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionDiskTypeRequest, $root.google.cloud.compute.v1.DiskType, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionDiskTypes + * @instance + * @param {google.cloud.compute.v1.IGetRegionDiskTypeRequest} request GetRegionDiskTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDiskTypes#list}. + * @memberof google.cloud.compute.v1.RegionDiskTypes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionDiskTypeList} [response] RegionDiskTypeList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionDiskTypes + * @instance + * @param {google.cloud.compute.v1.IListRegionDiskTypesRequest} request ListRegionDiskTypesRequest message or plain object + * @param {google.cloud.compute.v1.RegionDiskTypes.ListCallback} callback Node-style callback called with the error, if any, and RegionDiskTypeList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDiskTypes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionDiskTypesRequest, $root.google.cloud.compute.v1.RegionDiskTypeList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionDiskTypes + * @instance + * @param {google.cloud.compute.v1.IListRegionDiskTypesRequest} request ListRegionDiskTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionDiskTypes; + })(); + + v1.RegionDisks = (function() { + + /** + * Constructs a new RegionDisks service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionDisks + * @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 RegionDisks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionDisks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionDisks; + + /** + * Creates new RegionDisks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionDisks + * @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 {RegionDisks} RPC service. Useful where requests and/or responses are streamed. + */ + RegionDisks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#addResourcePolicies}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef AddResourcePoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddResourcePolicies. + * @function addResourcePolicies + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest} request AddResourcePoliciesRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.AddResourcePoliciesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.addResourcePolicies = function addResourcePolicies(request, callback) { + return this.rpcCall(addResourcePolicies, $root.google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddResourcePolicies" }); + + /** + * Calls AddResourcePolicies. + * @function addResourcePolicies + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest} request AddResourcePoliciesRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#createSnapshot}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef CreateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest} request CreateSnapshotRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.createSnapshot = function createSnapshot(request, callback) { + return this.rpcCall(createSnapshot, $root.google.cloud.compute.v1.CreateSnapshotRegionDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "CreateSnapshot" }); + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest} request CreateSnapshotRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#delete_}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionDiskRequest} request DeleteRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionDiskRequest} request DeleteRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#get}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Disk} [response] Disk + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IGetRegionDiskRequest} request GetRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.GetCallback} callback Node-style callback called with the error, if any, and Disk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionDiskRequest, $root.google.cloud.compute.v1.Disk, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IGetRegionDiskRequest} request GetRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#getIamPolicy}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest} request GetIamPolicyRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyRegionDiskRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest} request GetIamPolicyRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#insert}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IInsertRegionDiskRequest} request InsertRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IInsertRegionDiskRequest} request InsertRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#list}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DiskList} [response] DiskList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IListRegionDisksRequest} request ListRegionDisksRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.ListCallback} callback Node-style callback called with the error, if any, and DiskList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionDisksRequest, $root.google.cloud.compute.v1.DiskList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IListRegionDisksRequest} request ListRegionDisksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#removeResourcePolicies}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef RemoveResourcePoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveResourcePolicies. + * @function removeResourcePolicies + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest} request RemoveResourcePoliciesRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.RemoveResourcePoliciesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.removeResourcePolicies = function removeResourcePolicies(request, callback) { + return this.rpcCall(removeResourcePolicies, $root.google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveResourcePolicies" }); + + /** + * Calls RemoveResourcePolicies. + * @function removeResourcePolicies + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest} request RemoveResourcePoliciesRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#resize}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef ResizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IResizeRegionDiskRequest} request ResizeRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.ResizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.resize = function resize(request, callback) { + return this.rpcCall(resize, $root.google.cloud.compute.v1.ResizeRegionDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Resize" }); + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.IResizeRegionDiskRequest} request ResizeRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#setIamPolicy}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest} request SetIamPolicyRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyRegionDiskRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest} request SetIamPolicyRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#setLabels}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ISetLabelsRegionDiskRequest} request SetLabelsRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsRegionDiskRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ISetLabelsRegionDiskRequest} request SetLabelsRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionDisks#testIamPermissions}. + * @memberof google.cloud.compute.v1.RegionDisks + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest} request TestIamPermissionsRegionDiskRequest message or plain object + * @param {google.cloud.compute.v1.RegionDisks.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionDisks.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.RegionDisks + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest} request TestIamPermissionsRegionDiskRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionDisks; + })(); + + v1.RegionHealthCheckServices = (function() { + + /** + * Constructs a new RegionHealthCheckServices service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionHealthCheckServices + * @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 RegionHealthCheckServices(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionHealthCheckServices.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionHealthCheckServices; + + /** + * Creates new RegionHealthCheckServices service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @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 {RegionHealthCheckServices} RPC service. Useful where requests and/or responses are streamed. + */ + RegionHealthCheckServices.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#delete_}. + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest} request DeleteRegionHealthCheckServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthCheckServices.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthCheckServices.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest} request DeleteRegionHealthCheckServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#get}. + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.HealthCheckService} [response] HealthCheckService + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest} request GetRegionHealthCheckServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthCheckServices.GetCallback} callback Node-style callback called with the error, if any, and HealthCheckService + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthCheckServices.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionHealthCheckServiceRequest, $root.google.cloud.compute.v1.HealthCheckService, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest} request GetRegionHealthCheckServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#insert}. + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest} request InsertRegionHealthCheckServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthCheckServices.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthCheckServices.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest} request InsertRegionHealthCheckServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#list}. + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.HealthCheckServicesList} [response] HealthCheckServicesList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IListRegionHealthCheckServicesRequest} request ListRegionHealthCheckServicesRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthCheckServices.ListCallback} callback Node-style callback called with the error, if any, and HealthCheckServicesList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthCheckServices.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest, $root.google.cloud.compute.v1.HealthCheckServicesList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IListRegionHealthCheckServicesRequest} request ListRegionHealthCheckServicesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthCheckServices#patch}. + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest} request PatchRegionHealthCheckServiceRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthCheckServices.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthCheckServices.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionHealthCheckServices + * @instance + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest} request PatchRegionHealthCheckServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionHealthCheckServices; + })(); + + v1.RegionHealthChecks = (function() { + + /** + * Constructs a new RegionHealthChecks service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionHealthChecks + * @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 RegionHealthChecks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionHealthChecks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionHealthChecks; + + /** + * Creates new RegionHealthChecks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @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 {RegionHealthChecks} RPC service. Useful where requests and/or responses are streamed. + */ + RegionHealthChecks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#delete_}. + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckRequest} request DeleteRegionHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthChecks.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthChecks.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionHealthCheckRequest} request DeleteRegionHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#get}. + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.HealthCheck} [response] HealthCheck + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IGetRegionHealthCheckRequest} request GetRegionHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthChecks.GetCallback} callback Node-style callback called with the error, if any, and HealthCheck + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthChecks.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionHealthCheckRequest, $root.google.cloud.compute.v1.HealthCheck, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IGetRegionHealthCheckRequest} request GetRegionHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#insert}. + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckRequest} request InsertRegionHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthChecks.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthChecks.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IInsertRegionHealthCheckRequest} request InsertRegionHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#list}. + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.HealthCheckList} [response] HealthCheckList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IListRegionHealthChecksRequest} request ListRegionHealthChecksRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthChecks.ListCallback} callback Node-style callback called with the error, if any, and HealthCheckList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthChecks.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionHealthChecksRequest, $root.google.cloud.compute.v1.HealthCheckList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IListRegionHealthChecksRequest} request ListRegionHealthChecksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#patch}. + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckRequest} request PatchRegionHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthChecks.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthChecks.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchRegionHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IPatchRegionHealthCheckRequest} request PatchRegionHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionHealthChecks#update}. + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionHealthCheckRequest} request UpdateRegionHealthCheckRequest message or plain object + * @param {google.cloud.compute.v1.RegionHealthChecks.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionHealthChecks.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateRegionHealthCheckRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionHealthChecks + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionHealthCheckRequest} request UpdateRegionHealthCheckRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionHealthChecks; + })(); + + v1.RegionInstanceGroupManagers = (function() { + + /** + * Constructs a new RegionInstanceGroupManagers service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroupManagers + * @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 RegionInstanceGroupManagers(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionInstanceGroupManagers.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionInstanceGroupManagers; + + /** + * Creates new RegionInstanceGroupManagers service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @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 {RegionInstanceGroupManagers} RPC service. Useful where requests and/or responses are streamed. + */ + RegionInstanceGroupManagers.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#abandonInstances}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef AbandonInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AbandonInstances. + * @function abandonInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest} request AbandonInstancesRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.AbandonInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.abandonInstances = function abandonInstances(request, callback) { + return this.rpcCall(abandonInstances, $root.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AbandonInstances" }); + + /** + * Calls AbandonInstances. + * @function abandonInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest} request AbandonInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#applyUpdatesToInstances}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef ApplyUpdatesToInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls ApplyUpdatesToInstances. + * @function applyUpdatesToInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} request ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.ApplyUpdatesToInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.applyUpdatesToInstances = function applyUpdatesToInstances(request, callback) { + return this.rpcCall(applyUpdatesToInstances, $root.google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "ApplyUpdatesToInstances" }); + + /** + * Calls ApplyUpdatesToInstances. + * @function applyUpdatesToInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest} request ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#createInstances}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef CreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls CreateInstances. + * @function createInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest} request CreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.CreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.createInstances = function createInstances(request, callback) { + return this.rpcCall(createInstances, $root.google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "CreateInstances" }); + + /** + * Calls CreateInstances. + * @function createInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest} request CreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#delete_}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest} request DeleteRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest} request DeleteRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#deleteInstances}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef DeleteInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeleteInstances. + * @function deleteInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest} request DeleteInstancesRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.DeleteInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.deleteInstances = function deleteInstances(request, callback) { + return this.rpcCall(deleteInstances, $root.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeleteInstances" }); + + /** + * Calls DeleteInstances. + * @function deleteInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest} request DeleteInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#deletePerInstanceConfigs}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef DeletePerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls DeletePerInstanceConfigs. + * @function deletePerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest} request DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.DeletePerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.deletePerInstanceConfigs = function deletePerInstanceConfigs(request, callback) { + return this.rpcCall(deletePerInstanceConfigs, $root.google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "DeletePerInstanceConfigs" }); + + /** + * Calls DeletePerInstanceConfigs. + * @function deletePerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest} request DeletePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#get}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroupManager} [response] InstanceGroupManager + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest} request GetRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.GetCallback} callback Node-style callback called with the error, if any, and InstanceGroupManager + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.InstanceGroupManager, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest} request GetRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#insert}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest} request InsertRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest} request InsertRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#list}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerList} [response] RegionInstanceGroupManagerList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest} request ListRegionInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.ListCallback} callback Node-style callback called with the error, if any, and RegionInstanceGroupManagerList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest, $root.google.cloud.compute.v1.RegionInstanceGroupManagerList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest} request ListRegionInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#listErrors}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef ListErrorsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse} [response] RegionInstanceGroupManagersListErrorsResponse + */ + + /** + * Calls ListErrors. + * @function listErrors + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest} request ListErrorsRegionInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.ListErrorsCallback} callback Node-style callback called with the error, if any, and RegionInstanceGroupManagersListErrorsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.listErrors = function listErrors(request, callback) { + return this.rpcCall(listErrors, $root.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest, $root.google.cloud.compute.v1.RegionInstanceGroupManagersListErrorsResponse, request, callback); + }, "name", { value: "ListErrors" }); + + /** + * Calls ListErrors. + * @function listErrors + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest} request ListErrorsRegionInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#listManagedInstances}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef ListManagedInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse} [response] RegionInstanceGroupManagersListInstancesResponse + */ + + /** + * Calls ListManagedInstances. + * @function listManagedInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest} request ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.ListManagedInstancesCallback} callback Node-style callback called with the error, if any, and RegionInstanceGroupManagersListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.listManagedInstances = function listManagedInstances(request, callback) { + return this.rpcCall(listManagedInstances, $root.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest, $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstancesResponse, request, callback); + }, "name", { value: "ListManagedInstances" }); + + /** + * Calls ListManagedInstances. + * @function listManagedInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest} request ListManagedInstancesRegionInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#listPerInstanceConfigs}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef ListPerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp} [response] RegionInstanceGroupManagersListInstanceConfigsResp + */ + + /** + * Calls ListPerInstanceConfigs. + * @function listPerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest} request ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.ListPerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and RegionInstanceGroupManagersListInstanceConfigsResp + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.listPerInstanceConfigs = function listPerInstanceConfigs(request, callback) { + return this.rpcCall(listPerInstanceConfigs, $root.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, $root.google.cloud.compute.v1.RegionInstanceGroupManagersListInstanceConfigsResp, request, callback); + }, "name", { value: "ListPerInstanceConfigs" }); + + /** + * Calls ListPerInstanceConfigs. + * @function listPerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest} request ListPerInstanceConfigsRegionInstanceGroupManagersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#patch}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest} request PatchRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest} request PatchRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#patchPerInstanceConfigs}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef PatchPerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls PatchPerInstanceConfigs. + * @function patchPerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest} request PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.PatchPerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.patchPerInstanceConfigs = function patchPerInstanceConfigs(request, callback) { + return this.rpcCall(patchPerInstanceConfigs, $root.google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "PatchPerInstanceConfigs" }); + + /** + * Calls PatchPerInstanceConfigs. + * @function patchPerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest} request PatchPerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#recreateInstances}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef RecreateInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RecreateInstances. + * @function recreateInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest} request RecreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.RecreateInstancesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.recreateInstances = function recreateInstances(request, callback) { + return this.rpcCall(recreateInstances, $root.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RecreateInstances" }); + + /** + * Calls RecreateInstances. + * @function recreateInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest} request RecreateInstancesRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#resize}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef ResizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest} request ResizeRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.ResizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.resize = function resize(request, callback) { + return this.rpcCall(resize, $root.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Resize" }); + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest} request ResizeRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#setInstanceTemplate}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef SetInstanceTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetInstanceTemplate. + * @function setInstanceTemplate + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest} request SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.SetInstanceTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.setInstanceTemplate = function setInstanceTemplate(request, callback) { + return this.rpcCall(setInstanceTemplate, $root.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetInstanceTemplate" }); + + /** + * Calls SetInstanceTemplate. + * @function setInstanceTemplate + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest} request SetInstanceTemplateRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#setTargetPools}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef SetTargetPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetTargetPools. + * @function setTargetPools + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest} request SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.SetTargetPoolsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.setTargetPools = function setTargetPools(request, callback) { + return this.rpcCall(setTargetPools, $root.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetTargetPools" }); + + /** + * Calls SetTargetPools. + * @function setTargetPools + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest} request SetTargetPoolsRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroupManagers#updatePerInstanceConfigs}. + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @typedef UpdatePerInstanceConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls UpdatePerInstanceConfigs. + * @function updatePerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} request UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroupManagers.UpdatePerInstanceConfigsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroupManagers.prototype.updatePerInstanceConfigs = function updatePerInstanceConfigs(request, callback) { + return this.rpcCall(updatePerInstanceConfigs, $root.google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "UpdatePerInstanceConfigs" }); + + /** + * Calls UpdatePerInstanceConfigs. + * @function updatePerInstanceConfigs + * @memberof google.cloud.compute.v1.RegionInstanceGroupManagers + * @instance + * @param {google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest} request UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionInstanceGroupManagers; + })(); + + v1.RegionInstanceGroups = (function() { + + /** + * Constructs a new RegionInstanceGroups service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstanceGroups + * @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 RegionInstanceGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionInstanceGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionInstanceGroups; + + /** + * Creates new RegionInstanceGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @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 {RegionInstanceGroups} RPC service. Useful where requests and/or responses are streamed. + */ + RegionInstanceGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#get}. + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.InstanceGroup} [response] InstanceGroup + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupRequest} request GetRegionInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroups.GetCallback} callback Node-style callback called with the error, if any, and InstanceGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroups.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionInstanceGroupRequest, $root.google.cloud.compute.v1.InstanceGroup, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.IGetRegionInstanceGroupRequest} request GetRegionInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#list}. + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionInstanceGroupList} [response] RegionInstanceGroupList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListRegionInstanceGroupsRequest} request ListRegionInstanceGroupsRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroups.ListCallback} callback Node-style callback called with the error, if any, and RegionInstanceGroupList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroups.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionInstanceGroupsRequest, $root.google.cloud.compute.v1.RegionInstanceGroupList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListRegionInstanceGroupsRequest} request ListRegionInstanceGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#listInstances}. + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionInstanceGroupsListInstances} [response] RegionInstanceGroupsListInstances + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest} request ListInstancesRegionInstanceGroupsRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroups.ListInstancesCallback} callback Node-style callback called with the error, if any, and RegionInstanceGroupsListInstances + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroups.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest, $root.google.cloud.compute.v1.RegionInstanceGroupsListInstances, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest} request ListInstancesRegionInstanceGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstanceGroups#setNamedPorts}. + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @typedef SetNamedPortsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetNamedPorts. + * @function setNamedPorts + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest} request SetNamedPortsRegionInstanceGroupRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstanceGroups.SetNamedPortsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstanceGroups.prototype.setNamedPorts = function setNamedPorts(request, callback) { + return this.rpcCall(setNamedPorts, $root.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetNamedPorts" }); + + /** + * Calls SetNamedPorts. + * @function setNamedPorts + * @memberof google.cloud.compute.v1.RegionInstanceGroups + * @instance + * @param {google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest} request SetNamedPortsRegionInstanceGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionInstanceGroups; + })(); + + v1.RegionInstances = (function() { + + /** + * Constructs a new RegionInstances service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionInstances + * @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 RegionInstances(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionInstances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionInstances; + + /** + * Creates new RegionInstances service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionInstances + * @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 {RegionInstances} RPC service. Useful where requests and/or responses are streamed. + */ + RegionInstances.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionInstances#bulkInsert}. + * @memberof google.cloud.compute.v1.RegionInstances + * @typedef BulkInsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls BulkInsert. + * @function bulkInsert + * @memberof google.cloud.compute.v1.RegionInstances + * @instance + * @param {google.cloud.compute.v1.IBulkInsertRegionInstanceRequest} request BulkInsertRegionInstanceRequest message or plain object + * @param {google.cloud.compute.v1.RegionInstances.BulkInsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionInstances.prototype.bulkInsert = function bulkInsert(request, callback) { + return this.rpcCall(bulkInsert, $root.google.cloud.compute.v1.BulkInsertRegionInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "BulkInsert" }); + + /** + * Calls BulkInsert. + * @function bulkInsert + * @memberof google.cloud.compute.v1.RegionInstances + * @instance + * @param {google.cloud.compute.v1.IBulkInsertRegionInstanceRequest} request BulkInsertRegionInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionInstances; + })(); + + v1.RegionNetworkEndpointGroups = (function() { + + /** + * Constructs a new RegionNetworkEndpointGroups service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionNetworkEndpointGroups + * @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 RegionNetworkEndpointGroups(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionNetworkEndpointGroups.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionNetworkEndpointGroups; + + /** + * Creates new RegionNetworkEndpointGroups service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @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 {RegionNetworkEndpointGroups} RPC service. Useful where requests and/or responses are streamed. + */ + RegionNetworkEndpointGroups.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#delete_}. + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest} request DeleteRegionNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.RegionNetworkEndpointGroups.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNetworkEndpointGroups.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest} request DeleteRegionNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#get}. + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroup} [response] NetworkEndpointGroup + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest} request GetRegionNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.RegionNetworkEndpointGroups.GetCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNetworkEndpointGroups.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.NetworkEndpointGroup, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest} request GetRegionNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#insert}. + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest} request InsertRegionNetworkEndpointGroupRequest message or plain object + * @param {google.cloud.compute.v1.RegionNetworkEndpointGroups.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNetworkEndpointGroups.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest} request InsertRegionNetworkEndpointGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNetworkEndpointGroups#list}. + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NetworkEndpointGroupList} [response] NetworkEndpointGroupList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest} request ListRegionNetworkEndpointGroupsRequest message or plain object + * @param {google.cloud.compute.v1.RegionNetworkEndpointGroups.ListCallback} callback Node-style callback called with the error, if any, and NetworkEndpointGroupList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNetworkEndpointGroups.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest, $root.google.cloud.compute.v1.NetworkEndpointGroupList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionNetworkEndpointGroups + * @instance + * @param {google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest} request ListRegionNetworkEndpointGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionNetworkEndpointGroups; + })(); + + v1.RegionNotificationEndpoints = (function() { + + /** + * Constructs a new RegionNotificationEndpoints service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionNotificationEndpoints + * @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 RegionNotificationEndpoints(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionNotificationEndpoints.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionNotificationEndpoints; + + /** + * Creates new RegionNotificationEndpoints service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @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 {RegionNotificationEndpoints} RPC service. Useful where requests and/or responses are streamed. + */ + RegionNotificationEndpoints.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#delete_}. + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest} request DeleteRegionNotificationEndpointRequest message or plain object + * @param {google.cloud.compute.v1.RegionNotificationEndpoints.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNotificationEndpoints.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest} request DeleteRegionNotificationEndpointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#get}. + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NotificationEndpoint} [response] NotificationEndpoint + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IGetRegionNotificationEndpointRequest} request GetRegionNotificationEndpointRequest message or plain object + * @param {google.cloud.compute.v1.RegionNotificationEndpoints.GetCallback} callback Node-style callback called with the error, if any, and NotificationEndpoint + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNotificationEndpoints.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionNotificationEndpointRequest, $root.google.cloud.compute.v1.NotificationEndpoint, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IGetRegionNotificationEndpointRequest} request GetRegionNotificationEndpointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#insert}. + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest} request InsertRegionNotificationEndpointRequest message or plain object + * @param {google.cloud.compute.v1.RegionNotificationEndpoints.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNotificationEndpoints.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionNotificationEndpointRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest} request InsertRegionNotificationEndpointRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionNotificationEndpoints#list}. + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.NotificationEndpointList} [response] NotificationEndpointList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IListRegionNotificationEndpointsRequest} request ListRegionNotificationEndpointsRequest message or plain object + * @param {google.cloud.compute.v1.RegionNotificationEndpoints.ListCallback} callback Node-style callback called with the error, if any, and NotificationEndpointList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionNotificationEndpoints.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest, $root.google.cloud.compute.v1.NotificationEndpointList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionNotificationEndpoints + * @instance + * @param {google.cloud.compute.v1.IListRegionNotificationEndpointsRequest} request ListRegionNotificationEndpointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionNotificationEndpoints; + })(); + + v1.RegionOperations = (function() { + + /** + * Constructs a new RegionOperations service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionOperations + * @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 RegionOperations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionOperations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionOperations; + + /** + * Creates new RegionOperations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionOperations + * @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 {RegionOperations} RPC service. Useful where requests and/or responses are streamed. + */ + RegionOperations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#delete_}. + * @memberof google.cloud.compute.v1.RegionOperations + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DeleteRegionOperationResponse} [response] DeleteRegionOperationResponse + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionOperationRequest} request DeleteRegionOperationRequest message or plain object + * @param {google.cloud.compute.v1.RegionOperations.DeleteCallback} callback Node-style callback called with the error, if any, and DeleteRegionOperationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionOperations.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionOperationRequest, $root.google.cloud.compute.v1.DeleteRegionOperationResponse, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionOperationRequest} request DeleteRegionOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#get}. + * @memberof google.cloud.compute.v1.RegionOperations + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IGetRegionOperationRequest} request GetRegionOperationRequest message or plain object + * @param {google.cloud.compute.v1.RegionOperations.GetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionOperations.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionOperationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IGetRegionOperationRequest} request GetRegionOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#list}. + * @memberof google.cloud.compute.v1.RegionOperations + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.OperationList} [response] OperationList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IListRegionOperationsRequest} request ListRegionOperationsRequest message or plain object + * @param {google.cloud.compute.v1.RegionOperations.ListCallback} callback Node-style callback called with the error, if any, and OperationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionOperations.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionOperationsRequest, $root.google.cloud.compute.v1.OperationList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IListRegionOperationsRequest} request ListRegionOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionOperations#wait}. + * @memberof google.cloud.compute.v1.RegionOperations + * @typedef WaitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Wait. + * @function wait + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IWaitRegionOperationRequest} request WaitRegionOperationRequest message or plain object + * @param {google.cloud.compute.v1.RegionOperations.WaitCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionOperations.prototype.wait = function wait(request, callback) { + return this.rpcCall(wait, $root.google.cloud.compute.v1.WaitRegionOperationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Wait" }); + + /** + * Calls Wait. + * @function wait + * @memberof google.cloud.compute.v1.RegionOperations + * @instance + * @param {google.cloud.compute.v1.IWaitRegionOperationRequest} request WaitRegionOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionOperations; + })(); + + v1.RegionSslCertificates = (function() { + + /** + * Constructs a new RegionSslCertificates service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionSslCertificates + * @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 RegionSslCertificates(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionSslCertificates.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionSslCertificates; + + /** + * Creates new RegionSslCertificates service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @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 {RegionSslCertificates} RPC service. Useful where requests and/or responses are streamed. + */ + RegionSslCertificates.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#delete_}. + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionSslCertificateRequest} request DeleteRegionSslCertificateRequest message or plain object + * @param {google.cloud.compute.v1.RegionSslCertificates.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionSslCertificates.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionSslCertificateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionSslCertificateRequest} request DeleteRegionSslCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#get}. + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslCertificate} [response] SslCertificate + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IGetRegionSslCertificateRequest} request GetRegionSslCertificateRequest message or plain object + * @param {google.cloud.compute.v1.RegionSslCertificates.GetCallback} callback Node-style callback called with the error, if any, and SslCertificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionSslCertificates.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionSslCertificateRequest, $root.google.cloud.compute.v1.SslCertificate, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IGetRegionSslCertificateRequest} request GetRegionSslCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#insert}. + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IInsertRegionSslCertificateRequest} request InsertRegionSslCertificateRequest message or plain object + * @param {google.cloud.compute.v1.RegionSslCertificates.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionSslCertificates.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionSslCertificateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IInsertRegionSslCertificateRequest} request InsertRegionSslCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionSslCertificates#list}. + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslCertificateList} [response] SslCertificateList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IListRegionSslCertificatesRequest} request ListRegionSslCertificatesRequest message or plain object + * @param {google.cloud.compute.v1.RegionSslCertificates.ListCallback} callback Node-style callback called with the error, if any, and SslCertificateList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionSslCertificates.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionSslCertificatesRequest, $root.google.cloud.compute.v1.SslCertificateList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionSslCertificates + * @instance + * @param {google.cloud.compute.v1.IListRegionSslCertificatesRequest} request ListRegionSslCertificatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionSslCertificates; + })(); + + v1.RegionTargetHttpProxies = (function() { + + /** + * Constructs a new RegionTargetHttpProxies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionTargetHttpProxies + * @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 RegionTargetHttpProxies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionTargetHttpProxies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionTargetHttpProxies; + + /** + * Creates new RegionTargetHttpProxies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @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 {RegionTargetHttpProxies} RPC service. Useful where requests and/or responses are streamed. + */ + RegionTargetHttpProxies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#delete_}. + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest} request DeleteRegionTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpProxies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpProxies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest} request DeleteRegionTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#get}. + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpProxy} [response] TargetHttpProxy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest} request GetRegionTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpProxies.GetCallback} callback Node-style callback called with the error, if any, and TargetHttpProxy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpProxies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionTargetHttpProxyRequest, $root.google.cloud.compute.v1.TargetHttpProxy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest} request GetRegionTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#insert}. + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest} request InsertRegionTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpProxies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpProxies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest} request InsertRegionTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#list}. + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpProxyList} [response] TargetHttpProxyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest} request ListRegionTargetHttpProxiesRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpProxies.ListCallback} callback Node-style callback called with the error, if any, and TargetHttpProxyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpProxies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest, $root.google.cloud.compute.v1.TargetHttpProxyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest} request ListRegionTargetHttpProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpProxies#setUrlMap}. + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @typedef SetUrlMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest} request SetUrlMapRegionTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpProxies.SetUrlMapCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpProxies.prototype.setUrlMap = function setUrlMap(request, callback) { + return this.rpcCall(setUrlMap, $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetUrlMap" }); + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.RegionTargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest} request SetUrlMapRegionTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionTargetHttpProxies; + })(); + + v1.RegionTargetHttpsProxies = (function() { + + /** + * Constructs a new RegionTargetHttpsProxies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionTargetHttpsProxies + * @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 RegionTargetHttpsProxies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionTargetHttpsProxies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionTargetHttpsProxies; + + /** + * Creates new RegionTargetHttpsProxies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @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 {RegionTargetHttpsProxies} RPC service. Useful where requests and/or responses are streamed. + */ + RegionTargetHttpsProxies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#delete_}. + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest} request DeleteRegionTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpsProxies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpsProxies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest} request DeleteRegionTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#get}. + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpsProxy} [response] TargetHttpsProxy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest} request GetRegionTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpsProxies.GetCallback} callback Node-style callback called with the error, if any, and TargetHttpsProxy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpsProxies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest, $root.google.cloud.compute.v1.TargetHttpsProxy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest} request GetRegionTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#insert}. + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest} request InsertRegionTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpsProxies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpsProxies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest} request InsertRegionTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#list}. + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpsProxyList} [response] TargetHttpsProxyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest} request ListRegionTargetHttpsProxiesRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpsProxies.ListCallback} callback Node-style callback called with the error, if any, and TargetHttpsProxyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpsProxies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest, $root.google.cloud.compute.v1.TargetHttpsProxyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest} request ListRegionTargetHttpsProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#setSslCertificates}. + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @typedef SetSslCertificatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetSslCertificates. + * @function setSslCertificates + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest} request SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpsProxies.SetSslCertificatesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpsProxies.prototype.setSslCertificates = function setSslCertificates(request, callback) { + return this.rpcCall(setSslCertificates, $root.google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetSslCertificates" }); + + /** + * Calls SetSslCertificates. + * @function setSslCertificates + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest} request SetSslCertificatesRegionTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionTargetHttpsProxies#setUrlMap}. + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @typedef SetUrlMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest} request SetUrlMapRegionTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.RegionTargetHttpsProxies.SetUrlMapCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionTargetHttpsProxies.prototype.setUrlMap = function setUrlMap(request, callback) { + return this.rpcCall(setUrlMap, $root.google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetUrlMap" }); + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.RegionTargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest} request SetUrlMapRegionTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionTargetHttpsProxies; + })(); + + v1.RegionUrlMaps = (function() { + + /** + * Constructs a new RegionUrlMaps service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a RegionUrlMaps + * @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 RegionUrlMaps(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RegionUrlMaps.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RegionUrlMaps; + + /** + * Creates new RegionUrlMaps service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @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 {RegionUrlMaps} RPC service. Useful where requests and/or responses are streamed. + */ + RegionUrlMaps.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#delete_}. + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionUrlMapRequest} request DeleteRegionUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.RegionUrlMaps.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionUrlMaps.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRegionUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IDeleteRegionUrlMapRequest} request DeleteRegionUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#get}. + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UrlMap} [response] UrlMap + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IGetRegionUrlMapRequest} request GetRegionUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.RegionUrlMaps.GetCallback} callback Node-style callback called with the error, if any, and UrlMap + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionUrlMaps.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionUrlMapRequest, $root.google.cloud.compute.v1.UrlMap, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IGetRegionUrlMapRequest} request GetRegionUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#insert}. + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IInsertRegionUrlMapRequest} request InsertRegionUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.RegionUrlMaps.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionUrlMaps.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRegionUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IInsertRegionUrlMapRequest} request InsertRegionUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#list}. + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UrlMapList} [response] UrlMapList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IListRegionUrlMapsRequest} request ListRegionUrlMapsRequest message or plain object + * @param {google.cloud.compute.v1.RegionUrlMaps.ListCallback} callback Node-style callback called with the error, if any, and UrlMapList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionUrlMaps.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionUrlMapsRequest, $root.google.cloud.compute.v1.UrlMapList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IListRegionUrlMapsRequest} request ListRegionUrlMapsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#patch}. + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IPatchRegionUrlMapRequest} request PatchRegionUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.RegionUrlMaps.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionUrlMaps.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchRegionUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IPatchRegionUrlMapRequest} request PatchRegionUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#update}. + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionUrlMapRequest} request UpdateRegionUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.RegionUrlMaps.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionUrlMaps.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateRegionUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IUpdateRegionUrlMapRequest} request UpdateRegionUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.RegionUrlMaps#validate}. + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @typedef ValidateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UrlMapsValidateResponse} [response] UrlMapsValidateResponse + */ + + /** + * Calls Validate. + * @function validate + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IValidateRegionUrlMapRequest} request ValidateRegionUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.RegionUrlMaps.ValidateCallback} callback Node-style callback called with the error, if any, and UrlMapsValidateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RegionUrlMaps.prototype.validate = function validate(request, callback) { + return this.rpcCall(validate, $root.google.cloud.compute.v1.ValidateRegionUrlMapRequest, $root.google.cloud.compute.v1.UrlMapsValidateResponse, request, callback); + }, "name", { value: "Validate" }); + + /** + * Calls Validate. + * @function validate + * @memberof google.cloud.compute.v1.RegionUrlMaps + * @instance + * @param {google.cloud.compute.v1.IValidateRegionUrlMapRequest} request ValidateRegionUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RegionUrlMaps; + })(); + + v1.Regions = (function() { + + /** + * Constructs a new Regions service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Regions + * @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 Regions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Regions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Regions; + + /** + * Creates new Regions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Regions + * @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 {Regions} RPC service. Useful where requests and/or responses are streamed. + */ + Regions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Regions#get}. + * @memberof google.cloud.compute.v1.Regions + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Region} [response] Region + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Regions + * @instance + * @param {google.cloud.compute.v1.IGetRegionRequest} request GetRegionRequest message or plain object + * @param {google.cloud.compute.v1.Regions.GetCallback} callback Node-style callback called with the error, if any, and Region + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Regions.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRegionRequest, $root.google.cloud.compute.v1.Region, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Regions + * @instance + * @param {google.cloud.compute.v1.IGetRegionRequest} request GetRegionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Regions#list}. + * @memberof google.cloud.compute.v1.Regions + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RegionList} [response] RegionList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Regions + * @instance + * @param {google.cloud.compute.v1.IListRegionsRequest} request ListRegionsRequest message or plain object + * @param {google.cloud.compute.v1.Regions.ListCallback} callback Node-style callback called with the error, if any, and RegionList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Regions.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRegionsRequest, $root.google.cloud.compute.v1.RegionList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Regions + * @instance + * @param {google.cloud.compute.v1.IListRegionsRequest} request ListRegionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Regions; + })(); + + v1.Reservations = (function() { + + /** + * Constructs a new Reservations service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Reservations + * @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 Reservations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Reservations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Reservations; + + /** + * Creates new Reservations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Reservations + * @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 {Reservations} RPC service. Useful where requests and/or responses are streamed. + */ + Reservations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#aggregatedList}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ReservationAggregatedList} [response] ReservationAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IAggregatedListReservationsRequest} request AggregatedListReservationsRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.AggregatedListCallback} callback Node-style callback called with the error, if any, and ReservationAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListReservationsRequest, $root.google.cloud.compute.v1.ReservationAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IAggregatedListReservationsRequest} request AggregatedListReservationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#delete_}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IDeleteReservationRequest} request DeleteReservationRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteReservationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IDeleteReservationRequest} request DeleteReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#get}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Reservation} [response] Reservation + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IGetReservationRequest} request GetReservationRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.GetCallback} callback Node-style callback called with the error, if any, and Reservation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetReservationRequest, $root.google.cloud.compute.v1.Reservation, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IGetReservationRequest} request GetReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#getIamPolicy}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyReservationRequest} request GetIamPolicyReservationRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyReservationRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyReservationRequest} request GetIamPolicyReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#insert}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IInsertReservationRequest} request InsertReservationRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertReservationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IInsertReservationRequest} request InsertReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#list}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ReservationList} [response] ReservationList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IListReservationsRequest} request ListReservationsRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.ListCallback} callback Node-style callback called with the error, if any, and ReservationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListReservationsRequest, $root.google.cloud.compute.v1.ReservationList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IListReservationsRequest} request ListReservationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#resize}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef ResizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IResizeReservationRequest} request ResizeReservationRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.ResizeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.resize = function resize(request, callback) { + return this.rpcCall(resize, $root.google.cloud.compute.v1.ResizeReservationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Resize" }); + + /** + * Calls Resize. + * @function resize + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.IResizeReservationRequest} request ResizeReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#setIamPolicy}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyReservationRequest} request SetIamPolicyReservationRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyReservationRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyReservationRequest} request SetIamPolicyReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Reservations#testIamPermissions}. + * @memberof google.cloud.compute.v1.Reservations + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsReservationRequest} request TestIamPermissionsReservationRequest message or plain object + * @param {google.cloud.compute.v1.Reservations.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Reservations.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsReservationRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Reservations + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsReservationRequest} request TestIamPermissionsReservationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Reservations; + })(); + + v1.ResourcePolicies = (function() { + + /** + * Constructs a new ResourcePolicies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ResourcePolicies + * @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 ResourcePolicies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ResourcePolicies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ResourcePolicies; + + /** + * Creates new ResourcePolicies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.ResourcePolicies + * @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 {ResourcePolicies} RPC service. Useful where requests and/or responses are streamed. + */ + ResourcePolicies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#aggregatedList}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ResourcePolicyAggregatedList} [response] ResourcePolicyAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest} request AggregatedListResourcePoliciesRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.AggregatedListCallback} callback Node-style callback called with the error, if any, and ResourcePolicyAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListResourcePoliciesRequest, $root.google.cloud.compute.v1.ResourcePolicyAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest} request AggregatedListResourcePoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#delete_}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteResourcePolicyRequest} request DeleteResourcePolicyRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteResourcePolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteResourcePolicyRequest} request DeleteResourcePolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#get}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ResourcePolicy} [response] ResourcePolicy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IGetResourcePolicyRequest} request GetResourcePolicyRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.GetCallback} callback Node-style callback called with the error, if any, and ResourcePolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetResourcePolicyRequest, $root.google.cloud.compute.v1.ResourcePolicy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IGetResourcePolicyRequest} request GetResourcePolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#getIamPolicy}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest} request GetIamPolicyResourcePolicyRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest} request GetIamPolicyResourcePolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#insert}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IInsertResourcePolicyRequest} request InsertResourcePolicyRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertResourcePolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IInsertResourcePolicyRequest} request InsertResourcePolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#list}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ResourcePolicyList} [response] ResourcePolicyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IListResourcePoliciesRequest} request ListResourcePoliciesRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.ListCallback} callback Node-style callback called with the error, if any, and ResourcePolicyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListResourcePoliciesRequest, $root.google.cloud.compute.v1.ResourcePolicyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.IListResourcePoliciesRequest} request ListResourcePoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#setIamPolicy}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest} request SetIamPolicyResourcePolicyRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest} request SetIamPolicyResourcePolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ResourcePolicies#testIamPermissions}. + * @memberof google.cloud.compute.v1.ResourcePolicies + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest} request TestIamPermissionsResourcePolicyRequest message or plain object + * @param {google.cloud.compute.v1.ResourcePolicies.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ResourcePolicies.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.ResourcePolicies + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest} request TestIamPermissionsResourcePolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ResourcePolicies; + })(); + + v1.Routers = (function() { + + /** + * Constructs a new Routers service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Routers + * @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 Routers(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Routers.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Routers; + + /** + * Creates new Routers service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Routers + * @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 {Routers} RPC service. Useful where requests and/or responses are streamed. + */ + Routers.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#aggregatedList}. + * @memberof google.cloud.compute.v1.Routers + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RouterAggregatedList} [response] RouterAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IAggregatedListRoutersRequest} request AggregatedListRoutersRequest message or plain object + * @param {google.cloud.compute.v1.Routers.AggregatedListCallback} callback Node-style callback called with the error, if any, and RouterAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListRoutersRequest, $root.google.cloud.compute.v1.RouterAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IAggregatedListRoutersRequest} request AggregatedListRoutersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#delete_}. + * @memberof google.cloud.compute.v1.Routers + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IDeleteRouterRequest} request DeleteRouterRequest message or plain object + * @param {google.cloud.compute.v1.Routers.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRouterRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IDeleteRouterRequest} request DeleteRouterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#get}. + * @memberof google.cloud.compute.v1.Routers + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Router} [response] Router + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IGetRouterRequest} request GetRouterRequest message or plain object + * @param {google.cloud.compute.v1.Routers.GetCallback} callback Node-style callback called with the error, if any, and Router + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRouterRequest, $root.google.cloud.compute.v1.Router, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IGetRouterRequest} request GetRouterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#getNatMappingInfo}. + * @memberof google.cloud.compute.v1.Routers + * @typedef GetNatMappingInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VmEndpointNatMappingsList} [response] VmEndpointNatMappingsList + */ + + /** + * Calls GetNatMappingInfo. + * @function getNatMappingInfo + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest} request GetNatMappingInfoRoutersRequest message or plain object + * @param {google.cloud.compute.v1.Routers.GetNatMappingInfoCallback} callback Node-style callback called with the error, if any, and VmEndpointNatMappingsList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.getNatMappingInfo = function getNatMappingInfo(request, callback) { + return this.rpcCall(getNatMappingInfo, $root.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest, $root.google.cloud.compute.v1.VmEndpointNatMappingsList, request, callback); + }, "name", { value: "GetNatMappingInfo" }); + + /** + * Calls GetNatMappingInfo. + * @function getNatMappingInfo + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest} request GetNatMappingInfoRoutersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#getRouterStatus}. + * @memberof google.cloud.compute.v1.Routers + * @typedef GetRouterStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RouterStatusResponse} [response] RouterStatusResponse + */ + + /** + * Calls GetRouterStatus. + * @function getRouterStatus + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IGetRouterStatusRouterRequest} request GetRouterStatusRouterRequest message or plain object + * @param {google.cloud.compute.v1.Routers.GetRouterStatusCallback} callback Node-style callback called with the error, if any, and RouterStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.getRouterStatus = function getRouterStatus(request, callback) { + return this.rpcCall(getRouterStatus, $root.google.cloud.compute.v1.GetRouterStatusRouterRequest, $root.google.cloud.compute.v1.RouterStatusResponse, request, callback); + }, "name", { value: "GetRouterStatus" }); + + /** + * Calls GetRouterStatus. + * @function getRouterStatus + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IGetRouterStatusRouterRequest} request GetRouterStatusRouterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#insert}. + * @memberof google.cloud.compute.v1.Routers + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IInsertRouterRequest} request InsertRouterRequest message or plain object + * @param {google.cloud.compute.v1.Routers.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRouterRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IInsertRouterRequest} request InsertRouterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#list}. + * @memberof google.cloud.compute.v1.Routers + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RouterList} [response] RouterList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IListRoutersRequest} request ListRoutersRequest message or plain object + * @param {google.cloud.compute.v1.Routers.ListCallback} callback Node-style callback called with the error, if any, and RouterList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRoutersRequest, $root.google.cloud.compute.v1.RouterList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IListRoutersRequest} request ListRoutersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#patch}. + * @memberof google.cloud.compute.v1.Routers + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IPatchRouterRequest} request PatchRouterRequest message or plain object + * @param {google.cloud.compute.v1.Routers.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchRouterRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IPatchRouterRequest} request PatchRouterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#preview}. + * @memberof google.cloud.compute.v1.Routers + * @typedef PreviewCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RoutersPreviewResponse} [response] RoutersPreviewResponse + */ + + /** + * Calls Preview. + * @function preview + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IPreviewRouterRequest} request PreviewRouterRequest message or plain object + * @param {google.cloud.compute.v1.Routers.PreviewCallback} callback Node-style callback called with the error, if any, and RoutersPreviewResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.preview = function preview(request, callback) { + return this.rpcCall(preview, $root.google.cloud.compute.v1.PreviewRouterRequest, $root.google.cloud.compute.v1.RoutersPreviewResponse, request, callback); + }, "name", { value: "Preview" }); + + /** + * Calls Preview. + * @function preview + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IPreviewRouterRequest} request PreviewRouterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routers#update}. + * @memberof google.cloud.compute.v1.Routers + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IUpdateRouterRequest} request UpdateRouterRequest message or plain object + * @param {google.cloud.compute.v1.Routers.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routers.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateRouterRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.Routers + * @instance + * @param {google.cloud.compute.v1.IUpdateRouterRequest} request UpdateRouterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Routers; + })(); + + v1.Routes = (function() { + + /** + * Constructs a new Routes service. + * @memberof google.cloud.compute.v1 + * @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.cloud.compute.v1.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.cloud.compute.v1.Routes#delete_}. + * @memberof google.cloud.compute.v1.Routes + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IDeleteRouteRequest} request DeleteRouteRequest message or plain object + * @param {google.cloud.compute.v1.Routes.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteRouteRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IDeleteRouteRequest} request DeleteRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routes#get}. + * @memberof google.cloud.compute.v1.Routes + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Route} [response] Route + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IGetRouteRequest} request GetRouteRequest message or plain object + * @param {google.cloud.compute.v1.Routes.GetCallback} callback Node-style callback called with the error, if any, and Route + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetRouteRequest, $root.google.cloud.compute.v1.Route, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IGetRouteRequest} request GetRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routes#insert}. + * @memberof google.cloud.compute.v1.Routes + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IInsertRouteRequest} request InsertRouteRequest message or plain object + * @param {google.cloud.compute.v1.Routes.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertRouteRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IInsertRouteRequest} request InsertRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Routes#list}. + * @memberof google.cloud.compute.v1.Routes + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.RouteList} [response] RouteList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IListRoutesRequest} request ListRoutesRequest message or plain object + * @param {google.cloud.compute.v1.Routes.ListCallback} callback Node-style callback called with the error, if any, and RouteList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Routes.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListRoutesRequest, $root.google.cloud.compute.v1.RouteList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Routes + * @instance + * @param {google.cloud.compute.v1.IListRoutesRequest} request ListRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Routes; + })(); + + v1.SecurityPolicies = (function() { + + /** + * Constructs a new SecurityPolicies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SecurityPolicies + * @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 SecurityPolicies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SecurityPolicies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SecurityPolicies; + + /** + * Creates new SecurityPolicies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.SecurityPolicies + * @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 {SecurityPolicies} RPC service. Useful where requests and/or responses are streamed. + */ + SecurityPolicies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#addRule}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef AddRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddRule. + * @function addRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IAddRuleSecurityPolicyRequest} request AddRuleSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.AddRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.addRule = function addRule(request, callback) { + return this.rpcCall(addRule, $root.google.cloud.compute.v1.AddRuleSecurityPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddRule" }); + + /** + * Calls AddRule. + * @function addRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IAddRuleSecurityPolicyRequest} request AddRuleSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#delete_}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteSecurityPolicyRequest} request DeleteSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteSecurityPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteSecurityPolicyRequest} request DeleteSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#get}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SecurityPolicy} [response] SecurityPolicy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IGetSecurityPolicyRequest} request GetSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.GetCallback} callback Node-style callback called with the error, if any, and SecurityPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetSecurityPolicyRequest, $root.google.cloud.compute.v1.SecurityPolicy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IGetSecurityPolicyRequest} request GetSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#getRule}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef GetRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SecurityPolicyRule} [response] SecurityPolicyRule + */ + + /** + * Calls GetRule. + * @function getRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IGetRuleSecurityPolicyRequest} request GetRuleSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.GetRuleCallback} callback Node-style callback called with the error, if any, and SecurityPolicyRule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.getRule = function getRule(request, callback) { + return this.rpcCall(getRule, $root.google.cloud.compute.v1.GetRuleSecurityPolicyRequest, $root.google.cloud.compute.v1.SecurityPolicyRule, request, callback); + }, "name", { value: "GetRule" }); + + /** + * Calls GetRule. + * @function getRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IGetRuleSecurityPolicyRequest} request GetRuleSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#insert}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IInsertSecurityPolicyRequest} request InsertSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertSecurityPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IInsertSecurityPolicyRequest} request InsertSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#list}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SecurityPolicyList} [response] SecurityPolicyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IListSecurityPoliciesRequest} request ListSecurityPoliciesRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.ListCallback} callback Node-style callback called with the error, if any, and SecurityPolicyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListSecurityPoliciesRequest, $root.google.cloud.compute.v1.SecurityPolicyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IListSecurityPoliciesRequest} request ListSecurityPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#listPreconfiguredExpressionSets}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef ListPreconfiguredExpressionSetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse} [response] SecurityPoliciesListPreconfiguredExpressionSetsResponse + */ + + /** + * Calls ListPreconfiguredExpressionSets. + * @function listPreconfiguredExpressionSets + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest} request ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.ListPreconfiguredExpressionSetsCallback} callback Node-style callback called with the error, if any, and SecurityPoliciesListPreconfiguredExpressionSetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.listPreconfiguredExpressionSets = function listPreconfiguredExpressionSets(request, callback) { + return this.rpcCall(listPreconfiguredExpressionSets, $root.google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest, $root.google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse, request, callback); + }, "name", { value: "ListPreconfiguredExpressionSets" }); + + /** + * Calls ListPreconfiguredExpressionSets. + * @function listPreconfiguredExpressionSets + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest} request ListPreconfiguredExpressionSetsSecurityPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#patch}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchSecurityPolicyRequest} request PatchSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchSecurityPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchSecurityPolicyRequest} request PatchSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#patchRule}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef PatchRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls PatchRule. + * @function patchRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest} request PatchRuleSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.PatchRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.patchRule = function patchRule(request, callback) { + return this.rpcCall(patchRule, $root.google.cloud.compute.v1.PatchRuleSecurityPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "PatchRule" }); + + /** + * Calls PatchRule. + * @function patchRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest} request PatchRuleSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SecurityPolicies#removeRule}. + * @memberof google.cloud.compute.v1.SecurityPolicies + * @typedef RemoveRuleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveRule. + * @function removeRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest} request RemoveRuleSecurityPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SecurityPolicies.RemoveRuleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SecurityPolicies.prototype.removeRule = function removeRule(request, callback) { + return this.rpcCall(removeRule, $root.google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveRule" }); + + /** + * Calls RemoveRule. + * @function removeRule + * @memberof google.cloud.compute.v1.SecurityPolicies + * @instance + * @param {google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest} request RemoveRuleSecurityPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SecurityPolicies; + })(); + + v1.Snapshots = (function() { + + /** + * Constructs a new Snapshots service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Snapshots + * @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 Snapshots(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Snapshots.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Snapshots; + + /** + * Creates new Snapshots service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Snapshots + * @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 {Snapshots} RPC service. Useful where requests and/or responses are streamed. + */ + Snapshots.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#delete_}. + * @memberof google.cloud.compute.v1.Snapshots + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.cloud.compute.v1.Snapshots.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Snapshots.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteSnapshotRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#get}. + * @memberof google.cloud.compute.v1.Snapshots + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Snapshot} [response] Snapshot + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.cloud.compute.v1.Snapshots.GetCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Snapshots.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetSnapshotRequest, $root.google.cloud.compute.v1.Snapshot, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#getIamPolicy}. + * @memberof google.cloud.compute.v1.Snapshots + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicySnapshotRequest} request GetIamPolicySnapshotRequest message or plain object + * @param {google.cloud.compute.v1.Snapshots.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Snapshots.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicySnapshotRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicySnapshotRequest} request GetIamPolicySnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#list}. + * @memberof google.cloud.compute.v1.Snapshots + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SnapshotList} [response] SnapshotList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.cloud.compute.v1.Snapshots.ListCallback} callback Node-style callback called with the error, if any, and SnapshotList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Snapshots.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListSnapshotsRequest, $root.google.cloud.compute.v1.SnapshotList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#setIamPolicy}. + * @memberof google.cloud.compute.v1.Snapshots + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicySnapshotRequest} request SetIamPolicySnapshotRequest message or plain object + * @param {google.cloud.compute.v1.Snapshots.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Snapshots.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicySnapshotRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicySnapshotRequest} request SetIamPolicySnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#setLabels}. + * @memberof google.cloud.compute.v1.Snapshots + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.ISetLabelsSnapshotRequest} request SetLabelsSnapshotRequest message or plain object + * @param {google.cloud.compute.v1.Snapshots.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Snapshots.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsSnapshotRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.ISetLabelsSnapshotRequest} request SetLabelsSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Snapshots#testIamPermissions}. + * @memberof google.cloud.compute.v1.Snapshots + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest} request TestIamPermissionsSnapshotRequest message or plain object + * @param {google.cloud.compute.v1.Snapshots.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Snapshots.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsSnapshotRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Snapshots + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest} request TestIamPermissionsSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Snapshots; + })(); + + v1.SslCertificates = (function() { + + /** + * Constructs a new SslCertificates service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslCertificates + * @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 SslCertificates(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SslCertificates.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SslCertificates; + + /** + * Creates new SslCertificates service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.SslCertificates + * @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 {SslCertificates} RPC service. Useful where requests and/or responses are streamed. + */ + SslCertificates.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#aggregatedList}. + * @memberof google.cloud.compute.v1.SslCertificates + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslCertificateAggregatedList} [response] SslCertificateAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IAggregatedListSslCertificatesRequest} request AggregatedListSslCertificatesRequest message or plain object + * @param {google.cloud.compute.v1.SslCertificates.AggregatedListCallback} callback Node-style callback called with the error, if any, and SslCertificateAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslCertificates.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListSslCertificatesRequest, $root.google.cloud.compute.v1.SslCertificateAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IAggregatedListSslCertificatesRequest} request AggregatedListSslCertificatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#delete_}. + * @memberof google.cloud.compute.v1.SslCertificates + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IDeleteSslCertificateRequest} request DeleteSslCertificateRequest message or plain object + * @param {google.cloud.compute.v1.SslCertificates.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslCertificates.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteSslCertificateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IDeleteSslCertificateRequest} request DeleteSslCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#get}. + * @memberof google.cloud.compute.v1.SslCertificates + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslCertificate} [response] SslCertificate + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IGetSslCertificateRequest} request GetSslCertificateRequest message or plain object + * @param {google.cloud.compute.v1.SslCertificates.GetCallback} callback Node-style callback called with the error, if any, and SslCertificate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslCertificates.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetSslCertificateRequest, $root.google.cloud.compute.v1.SslCertificate, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IGetSslCertificateRequest} request GetSslCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#insert}. + * @memberof google.cloud.compute.v1.SslCertificates + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IInsertSslCertificateRequest} request InsertSslCertificateRequest message or plain object + * @param {google.cloud.compute.v1.SslCertificates.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslCertificates.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertSslCertificateRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IInsertSslCertificateRequest} request InsertSslCertificateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslCertificates#list}. + * @memberof google.cloud.compute.v1.SslCertificates + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslCertificateList} [response] SslCertificateList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IListSslCertificatesRequest} request ListSslCertificatesRequest message or plain object + * @param {google.cloud.compute.v1.SslCertificates.ListCallback} callback Node-style callback called with the error, if any, and SslCertificateList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslCertificates.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListSslCertificatesRequest, $root.google.cloud.compute.v1.SslCertificateList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.SslCertificates + * @instance + * @param {google.cloud.compute.v1.IListSslCertificatesRequest} request ListSslCertificatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SslCertificates; + })(); + + v1.SslPolicies = (function() { + + /** + * Constructs a new SslPolicies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a SslPolicies + * @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 SslPolicies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SslPolicies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SslPolicies; + + /** + * Creates new SslPolicies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.SslPolicies + * @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 {SslPolicies} RPC service. Useful where requests and/or responses are streamed. + */ + SslPolicies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#delete_}. + * @memberof google.cloud.compute.v1.SslPolicies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteSslPolicyRequest} request DeleteSslPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SslPolicies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslPolicies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteSslPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IDeleteSslPolicyRequest} request DeleteSslPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#get}. + * @memberof google.cloud.compute.v1.SslPolicies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslPolicy} [response] SslPolicy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IGetSslPolicyRequest} request GetSslPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SslPolicies.GetCallback} callback Node-style callback called with the error, if any, and SslPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslPolicies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetSslPolicyRequest, $root.google.cloud.compute.v1.SslPolicy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IGetSslPolicyRequest} request GetSslPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#insert}. + * @memberof google.cloud.compute.v1.SslPolicies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IInsertSslPolicyRequest} request InsertSslPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SslPolicies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslPolicies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertSslPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IInsertSslPolicyRequest} request InsertSslPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#list}. + * @memberof google.cloud.compute.v1.SslPolicies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslPoliciesList} [response] SslPoliciesList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IListSslPoliciesRequest} request ListSslPoliciesRequest message or plain object + * @param {google.cloud.compute.v1.SslPolicies.ListCallback} callback Node-style callback called with the error, if any, and SslPoliciesList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslPolicies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListSslPoliciesRequest, $root.google.cloud.compute.v1.SslPoliciesList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IListSslPoliciesRequest} request ListSslPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#listAvailableFeatures}. + * @memberof google.cloud.compute.v1.SslPolicies + * @typedef ListAvailableFeaturesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse} [response] SslPoliciesListAvailableFeaturesResponse + */ + + /** + * Calls ListAvailableFeatures. + * @function listAvailableFeatures + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest} request ListAvailableFeaturesSslPoliciesRequest message or plain object + * @param {google.cloud.compute.v1.SslPolicies.ListAvailableFeaturesCallback} callback Node-style callback called with the error, if any, and SslPoliciesListAvailableFeaturesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslPolicies.prototype.listAvailableFeatures = function listAvailableFeatures(request, callback) { + return this.rpcCall(listAvailableFeatures, $root.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest, $root.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse, request, callback); + }, "name", { value: "ListAvailableFeatures" }); + + /** + * Calls ListAvailableFeatures. + * @function listAvailableFeatures + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest} request ListAvailableFeaturesSslPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.SslPolicies#patch}. + * @memberof google.cloud.compute.v1.SslPolicies + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchSslPolicyRequest} request PatchSslPolicyRequest message or plain object + * @param {google.cloud.compute.v1.SslPolicies.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SslPolicies.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchSslPolicyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.SslPolicies + * @instance + * @param {google.cloud.compute.v1.IPatchSslPolicyRequest} request PatchSslPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SslPolicies; + })(); + + v1.Subnetworks = (function() { + + /** + * Constructs a new Subnetworks service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Subnetworks + * @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 Subnetworks(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Subnetworks.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Subnetworks; + + /** + * Creates new Subnetworks service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Subnetworks + * @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 {Subnetworks} RPC service. Useful where requests and/or responses are streamed. + */ + Subnetworks.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#aggregatedList}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SubnetworkAggregatedList} [response] SubnetworkAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IAggregatedListSubnetworksRequest} request AggregatedListSubnetworksRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.AggregatedListCallback} callback Node-style callback called with the error, if any, and SubnetworkAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListSubnetworksRequest, $root.google.cloud.compute.v1.SubnetworkAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IAggregatedListSubnetworksRequest} request AggregatedListSubnetworksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#delete_}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IDeleteSubnetworkRequest} request DeleteSubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteSubnetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IDeleteSubnetworkRequest} request DeleteSubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#expandIpCidrRange}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef ExpandIpCidrRangeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls ExpandIpCidrRange. + * @function expandIpCidrRange + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest} request ExpandIpCidrRangeSubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.ExpandIpCidrRangeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.expandIpCidrRange = function expandIpCidrRange(request, callback) { + return this.rpcCall(expandIpCidrRange, $root.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "ExpandIpCidrRange" }); + + /** + * Calls ExpandIpCidrRange. + * @function expandIpCidrRange + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest} request ExpandIpCidrRangeSubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#get}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Subnetwork} [response] Subnetwork + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IGetSubnetworkRequest} request GetSubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.GetCallback} callback Node-style callback called with the error, if any, and Subnetwork + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetSubnetworkRequest, $root.google.cloud.compute.v1.Subnetwork, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IGetSubnetworkRequest} request GetSubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#getIamPolicy}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef GetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicySubnetworkRequest} request GetIamPolicySubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.GetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.getIamPolicy = function getIamPolicy(request, callback) { + return this.rpcCall(getIamPolicy, $root.google.cloud.compute.v1.GetIamPolicySubnetworkRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "GetIamPolicy" }); + + /** + * Calls GetIamPolicy. + * @function getIamPolicy + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IGetIamPolicySubnetworkRequest} request GetIamPolicySubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#insert}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IInsertSubnetworkRequest} request InsertSubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertSubnetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IInsertSubnetworkRequest} request InsertSubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#list}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.SubnetworkList} [response] SubnetworkList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IListSubnetworksRequest} request ListSubnetworksRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.ListCallback} callback Node-style callback called with the error, if any, and SubnetworkList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListSubnetworksRequest, $root.google.cloud.compute.v1.SubnetworkList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IListSubnetworksRequest} request ListSubnetworksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#listUsable}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef ListUsableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UsableSubnetworksAggregatedList} [response] UsableSubnetworksAggregatedList + */ + + /** + * Calls ListUsable. + * @function listUsable + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IListUsableSubnetworksRequest} request ListUsableSubnetworksRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.ListUsableCallback} callback Node-style callback called with the error, if any, and UsableSubnetworksAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.listUsable = function listUsable(request, callback) { + return this.rpcCall(listUsable, $root.google.cloud.compute.v1.ListUsableSubnetworksRequest, $root.google.cloud.compute.v1.UsableSubnetworksAggregatedList, request, callback); + }, "name", { value: "ListUsable" }); + + /** + * Calls ListUsable. + * @function listUsable + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IListUsableSubnetworksRequest} request ListUsableSubnetworksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#patch}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IPatchSubnetworkRequest} request PatchSubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchSubnetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.IPatchSubnetworkRequest} request PatchSubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#setIamPolicy}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef SetIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Policy} [response] Policy + */ + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicySubnetworkRequest} request SetIamPolicySubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.SetIamPolicyCallback} callback Node-style callback called with the error, if any, and Policy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.setIamPolicy = function setIamPolicy(request, callback) { + return this.rpcCall(setIamPolicy, $root.google.cloud.compute.v1.SetIamPolicySubnetworkRequest, $root.google.cloud.compute.v1.Policy, request, callback); + }, "name", { value: "SetIamPolicy" }); + + /** + * Calls SetIamPolicy. + * @function setIamPolicy + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.ISetIamPolicySubnetworkRequest} request SetIamPolicySubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#setPrivateIpGoogleAccess}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef SetPrivateIpGoogleAccessCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetPrivateIpGoogleAccess. + * @function setPrivateIpGoogleAccess + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest} request SetPrivateIpGoogleAccessSubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.SetPrivateIpGoogleAccessCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.setPrivateIpGoogleAccess = function setPrivateIpGoogleAccess(request, callback) { + return this.rpcCall(setPrivateIpGoogleAccess, $root.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetPrivateIpGoogleAccess" }); + + /** + * Calls SetPrivateIpGoogleAccess. + * @function setPrivateIpGoogleAccess + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest} request SetPrivateIpGoogleAccessSubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Subnetworks#testIamPermissions}. + * @memberof google.cloud.compute.v1.Subnetworks + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest} request TestIamPermissionsSubnetworkRequest message or plain object + * @param {google.cloud.compute.v1.Subnetworks.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Subnetworks.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.Subnetworks + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest} request TestIamPermissionsSubnetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Subnetworks; + })(); + + v1.TargetGrpcProxies = (function() { + + /** + * Constructs a new TargetGrpcProxies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetGrpcProxies + * @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 TargetGrpcProxies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetGrpcProxies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetGrpcProxies; + + /** + * Creates new TargetGrpcProxies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @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 {TargetGrpcProxies} RPC service. Useful where requests and/or responses are streamed. + */ + TargetGrpcProxies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#delete_}. + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest} request DeleteTargetGrpcProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetGrpcProxies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetGrpcProxies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetGrpcProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest} request DeleteTargetGrpcProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#get}. + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetGrpcProxy} [response] TargetGrpcProxy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetGrpcProxyRequest} request GetTargetGrpcProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetGrpcProxies.GetCallback} callback Node-style callback called with the error, if any, and TargetGrpcProxy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetGrpcProxies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetGrpcProxyRequest, $root.google.cloud.compute.v1.TargetGrpcProxy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetGrpcProxyRequest} request GetTargetGrpcProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#insert}. + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetGrpcProxyRequest} request InsertTargetGrpcProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetGrpcProxies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetGrpcProxies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetGrpcProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetGrpcProxyRequest} request InsertTargetGrpcProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#list}. + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetGrpcProxyList} [response] TargetGrpcProxyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetGrpcProxiesRequest} request ListTargetGrpcProxiesRequest message or plain object + * @param {google.cloud.compute.v1.TargetGrpcProxies.ListCallback} callback Node-style callback called with the error, if any, and TargetGrpcProxyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetGrpcProxies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetGrpcProxiesRequest, $root.google.cloud.compute.v1.TargetGrpcProxyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetGrpcProxiesRequest} request ListTargetGrpcProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetGrpcProxies#patch}. + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IPatchTargetGrpcProxyRequest} request PatchTargetGrpcProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetGrpcProxies.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetGrpcProxies.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchTargetGrpcProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.TargetGrpcProxies + * @instance + * @param {google.cloud.compute.v1.IPatchTargetGrpcProxyRequest} request PatchTargetGrpcProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetGrpcProxies; + })(); + + v1.TargetHttpProxies = (function() { + + /** + * Constructs a new TargetHttpProxies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpProxies + * @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 TargetHttpProxies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetHttpProxies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetHttpProxies; + + /** + * Creates new TargetHttpProxies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @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 {TargetHttpProxies} RPC service. Useful where requests and/or responses are streamed. + */ + TargetHttpProxies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#aggregatedList}. + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpProxyAggregatedList} [response] TargetHttpProxyAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest} request AggregatedListTargetHttpProxiesRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpProxies.AggregatedListCallback} callback Node-style callback called with the error, if any, and TargetHttpProxyAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpProxies.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest, $root.google.cloud.compute.v1.TargetHttpProxyAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest} request AggregatedListTargetHttpProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#delete_}. + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetHttpProxyRequest} request DeleteTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpProxies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpProxies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetHttpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetHttpProxyRequest} request DeleteTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#get}. + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpProxy} [response] TargetHttpProxy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetHttpProxyRequest} request GetTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpProxies.GetCallback} callback Node-style callback called with the error, if any, and TargetHttpProxy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpProxies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetHttpProxyRequest, $root.google.cloud.compute.v1.TargetHttpProxy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetHttpProxyRequest} request GetTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#insert}. + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetHttpProxyRequest} request InsertTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpProxies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpProxies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetHttpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetHttpProxyRequest} request InsertTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#list}. + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpProxyList} [response] TargetHttpProxyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetHttpProxiesRequest} request ListTargetHttpProxiesRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpProxies.ListCallback} callback Node-style callback called with the error, if any, and TargetHttpProxyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpProxies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetHttpProxiesRequest, $root.google.cloud.compute.v1.TargetHttpProxyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetHttpProxiesRequest} request ListTargetHttpProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#patch}. + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IPatchTargetHttpProxyRequest} request PatchTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpProxies.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpProxies.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchTargetHttpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.IPatchTargetHttpProxyRequest} request PatchTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpProxies#setUrlMap}. + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @typedef SetUrlMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest} request SetUrlMapTargetHttpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpProxies.SetUrlMapCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpProxies.prototype.setUrlMap = function setUrlMap(request, callback) { + return this.rpcCall(setUrlMap, $root.google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetUrlMap" }); + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.TargetHttpProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest} request SetUrlMapTargetHttpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetHttpProxies; + })(); + + v1.TargetHttpsProxies = (function() { + + /** + * Constructs a new TargetHttpsProxies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetHttpsProxies + * @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 TargetHttpsProxies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetHttpsProxies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetHttpsProxies; + + /** + * Creates new TargetHttpsProxies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @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 {TargetHttpsProxies} RPC service. Useful where requests and/or responses are streamed. + */ + TargetHttpsProxies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#aggregatedList}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpsProxyAggregatedList} [response] TargetHttpsProxyAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest} request AggregatedListTargetHttpsProxiesRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.AggregatedListCallback} callback Node-style callback called with the error, if any, and TargetHttpsProxyAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest, $root.google.cloud.compute.v1.TargetHttpsProxyAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest} request AggregatedListTargetHttpsProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#delete_}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest} request DeleteTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest} request DeleteTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#get}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpsProxy} [response] TargetHttpsProxy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetHttpsProxyRequest} request GetTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.GetCallback} callback Node-style callback called with the error, if any, and TargetHttpsProxy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetHttpsProxyRequest, $root.google.cloud.compute.v1.TargetHttpsProxy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetHttpsProxyRequest} request GetTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#insert}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetHttpsProxyRequest} request InsertTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetHttpsProxyRequest} request InsertTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#list}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetHttpsProxyList} [response] TargetHttpsProxyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetHttpsProxiesRequest} request ListTargetHttpsProxiesRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.ListCallback} callback Node-style callback called with the error, if any, and TargetHttpsProxyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetHttpsProxiesRequest, $root.google.cloud.compute.v1.TargetHttpsProxyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetHttpsProxiesRequest} request ListTargetHttpsProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#patch}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IPatchTargetHttpsProxyRequest} request PatchTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.IPatchTargetHttpsProxyRequest} request PatchTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setQuicOverride}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef SetQuicOverrideCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetQuicOverride. + * @function setQuicOverride + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest} request SetQuicOverrideTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.SetQuicOverrideCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.setQuicOverride = function setQuicOverride(request, callback) { + return this.rpcCall(setQuicOverride, $root.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetQuicOverride" }); + + /** + * Calls SetQuicOverride. + * @function setQuicOverride + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest} request SetQuicOverrideTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setSslCertificates}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef SetSslCertificatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetSslCertificates. + * @function setSslCertificates + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest} request SetSslCertificatesTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.SetSslCertificatesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.setSslCertificates = function setSslCertificates(request, callback) { + return this.rpcCall(setSslCertificates, $root.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetSslCertificates" }); + + /** + * Calls SetSslCertificates. + * @function setSslCertificates + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest} request SetSslCertificatesTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setSslPolicy}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef SetSslPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetSslPolicy. + * @function setSslPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest} request SetSslPolicyTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.SetSslPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.setSslPolicy = function setSslPolicy(request, callback) { + return this.rpcCall(setSslPolicy, $root.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetSslPolicy" }); + + /** + * Calls SetSslPolicy. + * @function setSslPolicy + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest} request SetSslPolicyTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetHttpsProxies#setUrlMap}. + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @typedef SetUrlMapCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest} request SetUrlMapTargetHttpsProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetHttpsProxies.SetUrlMapCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetHttpsProxies.prototype.setUrlMap = function setUrlMap(request, callback) { + return this.rpcCall(setUrlMap, $root.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetUrlMap" }); + + /** + * Calls SetUrlMap. + * @function setUrlMap + * @memberof google.cloud.compute.v1.TargetHttpsProxies + * @instance + * @param {google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest} request SetUrlMapTargetHttpsProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetHttpsProxies; + })(); + + v1.TargetInstances = (function() { + + /** + * Constructs a new TargetInstances service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetInstances + * @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 TargetInstances(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetInstances.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetInstances; + + /** + * Creates new TargetInstances service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetInstances + * @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 {TargetInstances} RPC service. Useful where requests and/or responses are streamed. + */ + TargetInstances.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#aggregatedList}. + * @memberof google.cloud.compute.v1.TargetInstances + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetInstanceAggregatedList} [response] TargetInstanceAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetInstancesRequest} request AggregatedListTargetInstancesRequest message or plain object + * @param {google.cloud.compute.v1.TargetInstances.AggregatedListCallback} callback Node-style callback called with the error, if any, and TargetInstanceAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetInstances.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListTargetInstancesRequest, $root.google.cloud.compute.v1.TargetInstanceAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetInstancesRequest} request AggregatedListTargetInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#delete_}. + * @memberof google.cloud.compute.v1.TargetInstances + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetInstanceRequest} request DeleteTargetInstanceRequest message or plain object + * @param {google.cloud.compute.v1.TargetInstances.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetInstances.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetInstanceRequest} request DeleteTargetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#get}. + * @memberof google.cloud.compute.v1.TargetInstances + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetInstance} [response] TargetInstance + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IGetTargetInstanceRequest} request GetTargetInstanceRequest message or plain object + * @param {google.cloud.compute.v1.TargetInstances.GetCallback} callback Node-style callback called with the error, if any, and TargetInstance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetInstances.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetInstanceRequest, $root.google.cloud.compute.v1.TargetInstance, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IGetTargetInstanceRequest} request GetTargetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#insert}. + * @memberof google.cloud.compute.v1.TargetInstances + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IInsertTargetInstanceRequest} request InsertTargetInstanceRequest message or plain object + * @param {google.cloud.compute.v1.TargetInstances.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetInstances.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetInstanceRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IInsertTargetInstanceRequest} request InsertTargetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetInstances#list}. + * @memberof google.cloud.compute.v1.TargetInstances + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetInstanceList} [response] TargetInstanceList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IListTargetInstancesRequest} request ListTargetInstancesRequest message or plain object + * @param {google.cloud.compute.v1.TargetInstances.ListCallback} callback Node-style callback called with the error, if any, and TargetInstanceList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetInstances.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetInstancesRequest, $root.google.cloud.compute.v1.TargetInstanceList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetInstances + * @instance + * @param {google.cloud.compute.v1.IListTargetInstancesRequest} request ListTargetInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetInstances; + })(); + + v1.TargetPools = (function() { + + /** + * Constructs a new TargetPools service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetPools + * @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 TargetPools(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetPools.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetPools; + + /** + * Creates new TargetPools service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetPools + * @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 {TargetPools} RPC service. Useful where requests and/or responses are streamed. + */ + TargetPools.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#addHealthCheck}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef AddHealthCheckCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddHealthCheck. + * @function addHealthCheck + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest} request AddHealthCheckTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.AddHealthCheckCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.addHealthCheck = function addHealthCheck(request, callback) { + return this.rpcCall(addHealthCheck, $root.google.cloud.compute.v1.AddHealthCheckTargetPoolRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddHealthCheck" }); + + /** + * Calls AddHealthCheck. + * @function addHealthCheck + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest} request AddHealthCheckTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#addInstance}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef AddInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls AddInstance. + * @function addInstance + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IAddInstanceTargetPoolRequest} request AddInstanceTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.AddInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.addInstance = function addInstance(request, callback) { + return this.rpcCall(addInstance, $root.google.cloud.compute.v1.AddInstanceTargetPoolRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "AddInstance" }); + + /** + * Calls AddInstance. + * @function addInstance + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IAddInstanceTargetPoolRequest} request AddInstanceTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#aggregatedList}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetPoolAggregatedList} [response] TargetPoolAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetPoolsRequest} request AggregatedListTargetPoolsRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.AggregatedListCallback} callback Node-style callback called with the error, if any, and TargetPoolAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListTargetPoolsRequest, $root.google.cloud.compute.v1.TargetPoolAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetPoolsRequest} request AggregatedListTargetPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#delete_}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetPoolRequest} request DeleteTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetPoolRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetPoolRequest} request DeleteTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#get}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetPool} [response] TargetPool + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IGetTargetPoolRequest} request GetTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.GetCallback} callback Node-style callback called with the error, if any, and TargetPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetPoolRequest, $root.google.cloud.compute.v1.TargetPool, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IGetTargetPoolRequest} request GetTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#getHealth}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef GetHealthCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetPoolInstanceHealth} [response] TargetPoolInstanceHealth + */ + + /** + * Calls GetHealth. + * @function getHealth + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IGetHealthTargetPoolRequest} request GetHealthTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.GetHealthCallback} callback Node-style callback called with the error, if any, and TargetPoolInstanceHealth + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.getHealth = function getHealth(request, callback) { + return this.rpcCall(getHealth, $root.google.cloud.compute.v1.GetHealthTargetPoolRequest, $root.google.cloud.compute.v1.TargetPoolInstanceHealth, request, callback); + }, "name", { value: "GetHealth" }); + + /** + * Calls GetHealth. + * @function getHealth + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IGetHealthTargetPoolRequest} request GetHealthTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#insert}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IInsertTargetPoolRequest} request InsertTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetPoolRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IInsertTargetPoolRequest} request InsertTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#list}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetPoolList} [response] TargetPoolList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IListTargetPoolsRequest} request ListTargetPoolsRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.ListCallback} callback Node-style callback called with the error, if any, and TargetPoolList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetPoolsRequest, $root.google.cloud.compute.v1.TargetPoolList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IListTargetPoolsRequest} request ListTargetPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#removeHealthCheck}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef RemoveHealthCheckCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveHealthCheck. + * @function removeHealthCheck + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest} request RemoveHealthCheckTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.RemoveHealthCheckCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.removeHealthCheck = function removeHealthCheck(request, callback) { + return this.rpcCall(removeHealthCheck, $root.google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveHealthCheck" }); + + /** + * Calls RemoveHealthCheck. + * @function removeHealthCheck + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest} request RemoveHealthCheckTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#removeInstance}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef RemoveInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls RemoveInstance. + * @function removeInstance + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest} request RemoveInstanceTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.RemoveInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.removeInstance = function removeInstance(request, callback) { + return this.rpcCall(removeInstance, $root.google.cloud.compute.v1.RemoveInstanceTargetPoolRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "RemoveInstance" }); + + /** + * Calls RemoveInstance. + * @function removeInstance + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest} request RemoveInstanceTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetPools#setBackup}. + * @memberof google.cloud.compute.v1.TargetPools + * @typedef SetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetBackup. + * @function setBackup + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.ISetBackupTargetPoolRequest} request SetBackupTargetPoolRequest message or plain object + * @param {google.cloud.compute.v1.TargetPools.SetBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetPools.prototype.setBackup = function setBackup(request, callback) { + return this.rpcCall(setBackup, $root.google.cloud.compute.v1.SetBackupTargetPoolRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetBackup" }); + + /** + * Calls SetBackup. + * @function setBackup + * @memberof google.cloud.compute.v1.TargetPools + * @instance + * @param {google.cloud.compute.v1.ISetBackupTargetPoolRequest} request SetBackupTargetPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetPools; + })(); + + v1.TargetSslProxies = (function() { + + /** + * Constructs a new TargetSslProxies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetSslProxies + * @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 TargetSslProxies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetSslProxies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetSslProxies; + + /** + * Creates new TargetSslProxies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetSslProxies + * @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 {TargetSslProxies} RPC service. Useful where requests and/or responses are streamed. + */ + TargetSslProxies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#delete_}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetSslProxyRequest} request DeleteTargetSslProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetSslProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetSslProxyRequest} request DeleteTargetSslProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#get}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetSslProxy} [response] TargetSslProxy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetSslProxyRequest} request GetTargetSslProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.GetCallback} callback Node-style callback called with the error, if any, and TargetSslProxy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetSslProxyRequest, $root.google.cloud.compute.v1.TargetSslProxy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetSslProxyRequest} request GetTargetSslProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#insert}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetSslProxyRequest} request InsertTargetSslProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetSslProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetSslProxyRequest} request InsertTargetSslProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#list}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetSslProxyList} [response] TargetSslProxyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetSslProxiesRequest} request ListTargetSslProxiesRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.ListCallback} callback Node-style callback called with the error, if any, and TargetSslProxyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetSslProxiesRequest, $root.google.cloud.compute.v1.TargetSslProxyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetSslProxiesRequest} request ListTargetSslProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setBackendService}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef SetBackendServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetBackendService. + * @function setBackendService + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest} request SetBackendServiceTargetSslProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.SetBackendServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype.setBackendService = function setBackendService(request, callback) { + return this.rpcCall(setBackendService, $root.google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetBackendService" }); + + /** + * Calls SetBackendService. + * @function setBackendService + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest} request SetBackendServiceTargetSslProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setProxyHeader}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef SetProxyHeaderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetProxyHeader. + * @function setProxyHeader + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest} request SetProxyHeaderTargetSslProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.SetProxyHeaderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype.setProxyHeader = function setProxyHeader(request, callback) { + return this.rpcCall(setProxyHeader, $root.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetProxyHeader" }); + + /** + * Calls SetProxyHeader. + * @function setProxyHeader + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest} request SetProxyHeaderTargetSslProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setSslCertificates}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef SetSslCertificatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetSslCertificates. + * @function setSslCertificates + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest} request SetSslCertificatesTargetSslProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.SetSslCertificatesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype.setSslCertificates = function setSslCertificates(request, callback) { + return this.rpcCall(setSslCertificates, $root.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetSslCertificates" }); + + /** + * Calls SetSslCertificates. + * @function setSslCertificates + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest} request SetSslCertificatesTargetSslProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetSslProxies#setSslPolicy}. + * @memberof google.cloud.compute.v1.TargetSslProxies + * @typedef SetSslPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetSslPolicy. + * @function setSslPolicy + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest} request SetSslPolicyTargetSslProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetSslProxies.SetSslPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetSslProxies.prototype.setSslPolicy = function setSslPolicy(request, callback) { + return this.rpcCall(setSslPolicy, $root.google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetSslPolicy" }); + + /** + * Calls SetSslPolicy. + * @function setSslPolicy + * @memberof google.cloud.compute.v1.TargetSslProxies + * @instance + * @param {google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest} request SetSslPolicyTargetSslProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetSslProxies; + })(); + + v1.TargetTcpProxies = (function() { + + /** + * Constructs a new TargetTcpProxies service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetTcpProxies + * @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 TargetTcpProxies(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetTcpProxies.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetTcpProxies; + + /** + * Creates new TargetTcpProxies service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @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 {TargetTcpProxies} RPC service. Useful where requests and/or responses are streamed. + */ + TargetTcpProxies.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#delete_}. + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetTcpProxyRequest} request DeleteTargetTcpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetTcpProxies.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetTcpProxies.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetTcpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetTcpProxyRequest} request DeleteTargetTcpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#get}. + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetTcpProxy} [response] TargetTcpProxy + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetTcpProxyRequest} request GetTargetTcpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetTcpProxies.GetCallback} callback Node-style callback called with the error, if any, and TargetTcpProxy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetTcpProxies.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetTcpProxyRequest, $root.google.cloud.compute.v1.TargetTcpProxy, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IGetTargetTcpProxyRequest} request GetTargetTcpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#insert}. + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetTcpProxyRequest} request InsertTargetTcpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetTcpProxies.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetTcpProxies.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetTcpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IInsertTargetTcpProxyRequest} request InsertTargetTcpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#list}. + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetTcpProxyList} [response] TargetTcpProxyList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetTcpProxiesRequest} request ListTargetTcpProxiesRequest message or plain object + * @param {google.cloud.compute.v1.TargetTcpProxies.ListCallback} callback Node-style callback called with the error, if any, and TargetTcpProxyList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetTcpProxies.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetTcpProxiesRequest, $root.google.cloud.compute.v1.TargetTcpProxyList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.IListTargetTcpProxiesRequest} request ListTargetTcpProxiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#setBackendService}. + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @typedef SetBackendServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetBackendService. + * @function setBackendService + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest} request SetBackendServiceTargetTcpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetTcpProxies.SetBackendServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetTcpProxies.prototype.setBackendService = function setBackendService(request, callback) { + return this.rpcCall(setBackendService, $root.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetBackendService" }); + + /** + * Calls SetBackendService. + * @function setBackendService + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest} request SetBackendServiceTargetTcpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetTcpProxies#setProxyHeader}. + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @typedef SetProxyHeaderCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetProxyHeader. + * @function setProxyHeader + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest} request SetProxyHeaderTargetTcpProxyRequest message or plain object + * @param {google.cloud.compute.v1.TargetTcpProxies.SetProxyHeaderCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetTcpProxies.prototype.setProxyHeader = function setProxyHeader(request, callback) { + return this.rpcCall(setProxyHeader, $root.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetProxyHeader" }); + + /** + * Calls SetProxyHeader. + * @function setProxyHeader + * @memberof google.cloud.compute.v1.TargetTcpProxies + * @instance + * @param {google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest} request SetProxyHeaderTargetTcpProxyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetTcpProxies; + })(); + + v1.TargetVpnGateways = (function() { + + /** + * Constructs a new TargetVpnGateways service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a TargetVpnGateways + * @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 TargetVpnGateways(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TargetVpnGateways.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TargetVpnGateways; + + /** + * Creates new TargetVpnGateways service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @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 {TargetVpnGateways} RPC service. Useful where requests and/or responses are streamed. + */ + TargetVpnGateways.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#aggregatedList}. + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetVpnGatewayAggregatedList} [response] TargetVpnGatewayAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest} request AggregatedListTargetVpnGatewaysRequest message or plain object + * @param {google.cloud.compute.v1.TargetVpnGateways.AggregatedListCallback} callback Node-style callback called with the error, if any, and TargetVpnGatewayAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetVpnGateways.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest, $root.google.cloud.compute.v1.TargetVpnGatewayAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest} request AggregatedListTargetVpnGatewaysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#delete_}. + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest} request DeleteTargetVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.TargetVpnGateways.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetVpnGateways.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteTargetVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest} request DeleteTargetVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#get}. + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetVpnGateway} [response] TargetVpnGateway + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetTargetVpnGatewayRequest} request GetTargetVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.TargetVpnGateways.GetCallback} callback Node-style callback called with the error, if any, and TargetVpnGateway + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetVpnGateways.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetTargetVpnGatewayRequest, $root.google.cloud.compute.v1.TargetVpnGateway, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetTargetVpnGatewayRequest} request GetTargetVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#insert}. + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IInsertTargetVpnGatewayRequest} request InsertTargetVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.TargetVpnGateways.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetVpnGateways.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertTargetVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IInsertTargetVpnGatewayRequest} request InsertTargetVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.TargetVpnGateways#list}. + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TargetVpnGatewayList} [response] TargetVpnGatewayList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IListTargetVpnGatewaysRequest} request ListTargetVpnGatewaysRequest message or plain object + * @param {google.cloud.compute.v1.TargetVpnGateways.ListCallback} callback Node-style callback called with the error, if any, and TargetVpnGatewayList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TargetVpnGateways.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListTargetVpnGatewaysRequest, $root.google.cloud.compute.v1.TargetVpnGatewayList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.TargetVpnGateways + * @instance + * @param {google.cloud.compute.v1.IListTargetVpnGatewaysRequest} request ListTargetVpnGatewaysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TargetVpnGateways; + })(); + + v1.UrlMaps = (function() { + + /** + * Constructs a new UrlMaps service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents an UrlMaps + * @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 UrlMaps(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (UrlMaps.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = UrlMaps; + + /** + * Creates new UrlMaps service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.UrlMaps + * @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 {UrlMaps} RPC service. Useful where requests and/or responses are streamed. + */ + UrlMaps.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#aggregatedList}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UrlMapsAggregatedList} [response] UrlMapsAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IAggregatedListUrlMapsRequest} request AggregatedListUrlMapsRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.AggregatedListCallback} callback Node-style callback called with the error, if any, and UrlMapsAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListUrlMapsRequest, $root.google.cloud.compute.v1.UrlMapsAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IAggregatedListUrlMapsRequest} request AggregatedListUrlMapsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#delete_}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IDeleteUrlMapRequest} request DeleteUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IDeleteUrlMapRequest} request DeleteUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#get}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UrlMap} [response] UrlMap + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IGetUrlMapRequest} request GetUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.GetCallback} callback Node-style callback called with the error, if any, and UrlMap + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetUrlMapRequest, $root.google.cloud.compute.v1.UrlMap, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IGetUrlMapRequest} request GetUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#insert}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IInsertUrlMapRequest} request InsertUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IInsertUrlMapRequest} request InsertUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#invalidateCache}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef InvalidateCacheCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls InvalidateCache. + * @function invalidateCache + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IInvalidateCacheUrlMapRequest} request InvalidateCacheUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.InvalidateCacheCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.invalidateCache = function invalidateCache(request, callback) { + return this.rpcCall(invalidateCache, $root.google.cloud.compute.v1.InvalidateCacheUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "InvalidateCache" }); + + /** + * Calls InvalidateCache. + * @function invalidateCache + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IInvalidateCacheUrlMapRequest} request InvalidateCacheUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#list}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UrlMapList} [response] UrlMapList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IListUrlMapsRequest} request ListUrlMapsRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.ListCallback} callback Node-style callback called with the error, if any, and UrlMapList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListUrlMapsRequest, $root.google.cloud.compute.v1.UrlMapList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IListUrlMapsRequest} request ListUrlMapsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#patch}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef PatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IPatchUrlMapRequest} request PatchUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.PatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.patch = function patch(request, callback) { + return this.rpcCall(patch, $root.google.cloud.compute.v1.PatchUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Patch" }); + + /** + * Calls Patch. + * @function patch + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IPatchUrlMapRequest} request PatchUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#update}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef UpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IUpdateUrlMapRequest} request UpdateUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.UpdateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.update = function update(request, callback) { + return this.rpcCall(update, $root.google.cloud.compute.v1.UpdateUrlMapRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Update" }); + + /** + * Calls Update. + * @function update + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IUpdateUrlMapRequest} request UpdateUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.UrlMaps#validate}. + * @memberof google.cloud.compute.v1.UrlMaps + * @typedef ValidateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.UrlMapsValidateResponse} [response] UrlMapsValidateResponse + */ + + /** + * Calls Validate. + * @function validate + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IValidateUrlMapRequest} request ValidateUrlMapRequest message or plain object + * @param {google.cloud.compute.v1.UrlMaps.ValidateCallback} callback Node-style callback called with the error, if any, and UrlMapsValidateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(UrlMaps.prototype.validate = function validate(request, callback) { + return this.rpcCall(validate, $root.google.cloud.compute.v1.ValidateUrlMapRequest, $root.google.cloud.compute.v1.UrlMapsValidateResponse, request, callback); + }, "name", { value: "Validate" }); + + /** + * Calls Validate. + * @function validate + * @memberof google.cloud.compute.v1.UrlMaps + * @instance + * @param {google.cloud.compute.v1.IValidateUrlMapRequest} request ValidateUrlMapRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return UrlMaps; + })(); + + v1.VpnGateways = (function() { + + /** + * Constructs a new VpnGateways service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnGateways + * @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 VpnGateways(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VpnGateways.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VpnGateways; + + /** + * Creates new VpnGateways service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.VpnGateways + * @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 {VpnGateways} RPC service. Useful where requests and/or responses are streamed. + */ + VpnGateways.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#aggregatedList}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VpnGatewayAggregatedList} [response] VpnGatewayAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest} request AggregatedListVpnGatewaysRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.AggregatedListCallback} callback Node-style callback called with the error, if any, and VpnGatewayAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListVpnGatewaysRequest, $root.google.cloud.compute.v1.VpnGatewayAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest} request AggregatedListVpnGatewaysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#delete_}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IDeleteVpnGatewayRequest} request DeleteVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IDeleteVpnGatewayRequest} request DeleteVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#get}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VpnGateway} [response] VpnGateway + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetVpnGatewayRequest} request GetVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.GetCallback} callback Node-style callback called with the error, if any, and VpnGateway + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetVpnGatewayRequest, $root.google.cloud.compute.v1.VpnGateway, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetVpnGatewayRequest} request GetVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#getStatus}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef GetStatusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VpnGatewaysGetStatusResponse} [response] VpnGatewaysGetStatusResponse + */ + + /** + * Calls GetStatus. + * @function getStatus + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetStatusVpnGatewayRequest} request GetStatusVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.GetStatusCallback} callback Node-style callback called with the error, if any, and VpnGatewaysGetStatusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype.getStatus = function getStatus(request, callback) { + return this.rpcCall(getStatus, $root.google.cloud.compute.v1.GetStatusVpnGatewayRequest, $root.google.cloud.compute.v1.VpnGatewaysGetStatusResponse, request, callback); + }, "name", { value: "GetStatus" }); + + /** + * Calls GetStatus. + * @function getStatus + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IGetStatusVpnGatewayRequest} request GetStatusVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#insert}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IInsertVpnGatewayRequest} request InsertVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IInsertVpnGatewayRequest} request InsertVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#list}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VpnGatewayList} [response] VpnGatewayList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IListVpnGatewaysRequest} request ListVpnGatewaysRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.ListCallback} callback Node-style callback called with the error, if any, and VpnGatewayList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListVpnGatewaysRequest, $root.google.cloud.compute.v1.VpnGatewayList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.IListVpnGatewaysRequest} request ListVpnGatewaysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#setLabels}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef SetLabelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.ISetLabelsVpnGatewayRequest} request SetLabelsVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.SetLabelsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype.setLabels = function setLabels(request, callback) { + return this.rpcCall(setLabels, $root.google.cloud.compute.v1.SetLabelsVpnGatewayRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "SetLabels" }); + + /** + * Calls SetLabels. + * @function setLabels + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.ISetLabelsVpnGatewayRequest} request SetLabelsVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnGateways#testIamPermissions}. + * @memberof google.cloud.compute.v1.VpnGateways + * @typedef TestIamPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.TestPermissionsResponse} [response] TestPermissionsResponse + */ + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest} request TestIamPermissionsVpnGatewayRequest message or plain object + * @param {google.cloud.compute.v1.VpnGateways.TestIamPermissionsCallback} callback Node-style callback called with the error, if any, and TestPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnGateways.prototype.testIamPermissions = function testIamPermissions(request, callback) { + return this.rpcCall(testIamPermissions, $root.google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest, $root.google.cloud.compute.v1.TestPermissionsResponse, request, callback); + }, "name", { value: "TestIamPermissions" }); + + /** + * Calls TestIamPermissions. + * @function testIamPermissions + * @memberof google.cloud.compute.v1.VpnGateways + * @instance + * @param {google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest} request TestIamPermissionsVpnGatewayRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VpnGateways; + })(); + + v1.VpnTunnels = (function() { + + /** + * Constructs a new VpnTunnels service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a VpnTunnels + * @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 VpnTunnels(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VpnTunnels.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VpnTunnels; + + /** + * Creates new VpnTunnels service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.VpnTunnels + * @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 {VpnTunnels} RPC service. Useful where requests and/or responses are streamed. + */ + VpnTunnels.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#aggregatedList}. + * @memberof google.cloud.compute.v1.VpnTunnels + * @typedef AggregatedListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VpnTunnelAggregatedList} [response] VpnTunnelAggregatedList + */ + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest} request AggregatedListVpnTunnelsRequest message or plain object + * @param {google.cloud.compute.v1.VpnTunnels.AggregatedListCallback} callback Node-style callback called with the error, if any, and VpnTunnelAggregatedList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnTunnels.prototype.aggregatedList = function aggregatedList(request, callback) { + return this.rpcCall(aggregatedList, $root.google.cloud.compute.v1.AggregatedListVpnTunnelsRequest, $root.google.cloud.compute.v1.VpnTunnelAggregatedList, request, callback); + }, "name", { value: "AggregatedList" }); + + /** + * Calls AggregatedList. + * @function aggregatedList + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest} request AggregatedListVpnTunnelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#delete_}. + * @memberof google.cloud.compute.v1.VpnTunnels + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IDeleteVpnTunnelRequest} request DeleteVpnTunnelRequest message or plain object + * @param {google.cloud.compute.v1.VpnTunnels.DeleteCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnTunnels.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteVpnTunnelRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IDeleteVpnTunnelRequest} request DeleteVpnTunnelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#get}. + * @memberof google.cloud.compute.v1.VpnTunnels + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VpnTunnel} [response] VpnTunnel + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IGetVpnTunnelRequest} request GetVpnTunnelRequest message or plain object + * @param {google.cloud.compute.v1.VpnTunnels.GetCallback} callback Node-style callback called with the error, if any, and VpnTunnel + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnTunnels.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetVpnTunnelRequest, $root.google.cloud.compute.v1.VpnTunnel, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IGetVpnTunnelRequest} request GetVpnTunnelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#insert}. + * @memberof google.cloud.compute.v1.VpnTunnels + * @typedef InsertCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IInsertVpnTunnelRequest} request InsertVpnTunnelRequest message or plain object + * @param {google.cloud.compute.v1.VpnTunnels.InsertCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnTunnels.prototype.insert = function insert(request, callback) { + return this.rpcCall(insert, $root.google.cloud.compute.v1.InsertVpnTunnelRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Insert" }); + + /** + * Calls Insert. + * @function insert + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IInsertVpnTunnelRequest} request InsertVpnTunnelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.VpnTunnels#list}. + * @memberof google.cloud.compute.v1.VpnTunnels + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.VpnTunnelList} [response] VpnTunnelList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IListVpnTunnelsRequest} request ListVpnTunnelsRequest message or plain object + * @param {google.cloud.compute.v1.VpnTunnels.ListCallback} callback Node-style callback called with the error, if any, and VpnTunnelList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VpnTunnels.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListVpnTunnelsRequest, $root.google.cloud.compute.v1.VpnTunnelList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.VpnTunnels + * @instance + * @param {google.cloud.compute.v1.IListVpnTunnelsRequest} request ListVpnTunnelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VpnTunnels; + })(); + + v1.ZoneOperations = (function() { + + /** + * Constructs a new ZoneOperations service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a ZoneOperations + * @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 ZoneOperations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ZoneOperations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ZoneOperations; + + /** + * Creates new ZoneOperations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.ZoneOperations + * @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 {ZoneOperations} RPC service. Useful where requests and/or responses are streamed. + */ + ZoneOperations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#delete_}. + * @memberof google.cloud.compute.v1.ZoneOperations + * @typedef DeleteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.DeleteZoneOperationResponse} [response] DeleteZoneOperationResponse + */ + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteZoneOperationRequest} request DeleteZoneOperationRequest message or plain object + * @param {google.cloud.compute.v1.ZoneOperations.DeleteCallback} callback Node-style callback called with the error, if any, and DeleteZoneOperationResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ZoneOperations.prototype["delete"] = function delete_(request, callback) { + return this.rpcCall(delete_, $root.google.cloud.compute.v1.DeleteZoneOperationRequest, $root.google.cloud.compute.v1.DeleteZoneOperationResponse, request, callback); + }, "name", { value: "Delete" }); + + /** + * Calls Delete. + * @function delete + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IDeleteZoneOperationRequest} request DeleteZoneOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#get}. + * @memberof google.cloud.compute.v1.ZoneOperations + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IGetZoneOperationRequest} request GetZoneOperationRequest message or plain object + * @param {google.cloud.compute.v1.ZoneOperations.GetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ZoneOperations.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetZoneOperationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IGetZoneOperationRequest} request GetZoneOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#list}. + * @memberof google.cloud.compute.v1.ZoneOperations + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.OperationList} [response] OperationList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IListZoneOperationsRequest} request ListZoneOperationsRequest message or plain object + * @param {google.cloud.compute.v1.ZoneOperations.ListCallback} callback Node-style callback called with the error, if any, and OperationList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ZoneOperations.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListZoneOperationsRequest, $root.google.cloud.compute.v1.OperationList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IListZoneOperationsRequest} request ListZoneOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.ZoneOperations#wait}. + * @memberof google.cloud.compute.v1.ZoneOperations + * @typedef WaitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Operation} [response] Operation + */ + + /** + * Calls Wait. + * @function wait + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IWaitZoneOperationRequest} request WaitZoneOperationRequest message or plain object + * @param {google.cloud.compute.v1.ZoneOperations.WaitCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ZoneOperations.prototype.wait = function wait(request, callback) { + return this.rpcCall(wait, $root.google.cloud.compute.v1.WaitZoneOperationRequest, $root.google.cloud.compute.v1.Operation, request, callback); + }, "name", { value: "Wait" }); + + /** + * Calls Wait. + * @function wait + * @memberof google.cloud.compute.v1.ZoneOperations + * @instance + * @param {google.cloud.compute.v1.IWaitZoneOperationRequest} request WaitZoneOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ZoneOperations; + })(); + + v1.Zones = (function() { + + /** + * Constructs a new Zones service. + * @memberof google.cloud.compute.v1 + * @classdesc Represents a Zones + * @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 Zones(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Zones.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Zones; + + /** + * Creates new Zones service using the specified rpc implementation. + * @function create + * @memberof google.cloud.compute.v1.Zones + * @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 {Zones} RPC service. Useful where requests and/or responses are streamed. + */ + Zones.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.compute.v1.Zones#get}. + * @memberof google.cloud.compute.v1.Zones + * @typedef GetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.Zone} [response] Zone + */ + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Zones + * @instance + * @param {google.cloud.compute.v1.IGetZoneRequest} request GetZoneRequest message or plain object + * @param {google.cloud.compute.v1.Zones.GetCallback} callback Node-style callback called with the error, if any, and Zone + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Zones.prototype.get = function get(request, callback) { + return this.rpcCall(get, $root.google.cloud.compute.v1.GetZoneRequest, $root.google.cloud.compute.v1.Zone, request, callback); + }, "name", { value: "Get" }); + + /** + * Calls Get. + * @function get + * @memberof google.cloud.compute.v1.Zones + * @instance + * @param {google.cloud.compute.v1.IGetZoneRequest} request GetZoneRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.compute.v1.Zones#list}. + * @memberof google.cloud.compute.v1.Zones + * @typedef ListCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.compute.v1.ZoneList} [response] ZoneList + */ + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Zones + * @instance + * @param {google.cloud.compute.v1.IListZonesRequest} request ListZonesRequest message or plain object + * @param {google.cloud.compute.v1.Zones.ListCallback} callback Node-style callback called with the error, if any, and ZoneList + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Zones.prototype.list = function list(request, callback) { + return this.rpcCall(list, $root.google.cloud.compute.v1.ListZonesRequest, $root.google.cloud.compute.v1.ZoneList, request, callback); + }, "name", { value: "List" }); + + /** + * Calls List. + * @function list + * @memberof google.cloud.compute.v1.Zones + * @instance + * @param {google.cloud.compute.v1.IListZonesRequest} request ListZonesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Zones; + })(); + + return v1; + })(); + + return compute; + })(); + + 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); + }; + + 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); + }; + + 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); + }; + + 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 + */ + 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; + 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); + }; + + /** + * 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); + }; + + 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); + }; + + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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; + 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"; + 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); + 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 = ""; + } + 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; + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + /** + * 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + /** + * 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); + }; + + 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} [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 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.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 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.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: + 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.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; + } + } + 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[".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.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); + }; + + /** + * 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + /** + * 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) + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates 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); + 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; + 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"; + 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; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + return protobuf; + })(); + + return google; + })(); + + return $root; +}); diff --git a/protos/protos.json b/protos/protos.json new file mode 100644 index 00000000..15f8b63d --- /dev/null +++ b/protos/protos.json @@ -0,0 +1,72641 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "compute": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Compute.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/compute/v1;compute", + "java_multiple_files": true, + "java_package": "com.google.cloud.compute.v1", + "php_namespace": "Google\\Cloud\\Compute\\V1", + "ruby_package": "Google::Cloud::Compute::V1" + }, + "nested": { + "AcceleratorConfig": { + "oneofs": { + "_acceleratorCount": { + "oneof": [ + "acceleratorCount" + ] + }, + "_acceleratorType": { + "oneof": [ + "acceleratorType" + ] + } + }, + "fields": { + "acceleratorCount": { + "type": "int32", + "id": 504879675, + "options": { + "proto3_optional": true + } + }, + "acceleratorType": { + "type": "string", + "id": 138031246, + "options": { + "proto3_optional": true + } + } + } + }, + "DeprecationStatus": { + "oneofs": { + "_deleted": { + "oneof": [ + "deleted" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_obsolete": { + "oneof": [ + "obsolete" + ] + }, + "_replacement": { + "oneof": [ + "replacement" + ] + }, + "_state": { + "oneof": [ + "state" + ] + } + }, + "fields": { + "deleted": { + "type": "string", + "id": 476721177, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "string", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "obsolete": { + "type": "string", + "id": 357647769, + "options": { + "proto3_optional": true + } + }, + "replacement": { + "type": "string", + "id": 430919186, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "UNDEFINED_STATE": 0, + "ACTIVE": 314733318, + "DELETED": 120962041, + "DEPRECATED": 463360435, + "OBSOLETE": 66532761 + } + } + } + }, + "AcceleratorType": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_maximumCardsPerInstance": { + "oneof": [ + "maximumCardsPerInstance" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "DeprecationStatus", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "maximumCardsPerInstance": { + "type": "int32", + "id": 263814482, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + } + }, + "AcceleratorTypesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "acceleratorTypes": { + "rule": "repeated", + "type": "AcceleratorType", + "id": 520872357 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "Data": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 106079, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 111972721, + "options": { + "proto3_optional": true + } + } + } + }, + "Warning": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "code": { + "type": "Code", + "id": 3059181, + "options": { + "proto3_optional": true + } + }, + "data": { + "rule": "repeated", + "type": "Data", + "id": 3076010 + }, + "message": { + "type": "string", + "id": 418054151, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Code": { + "values": { + "UNDEFINED_CODE": 0, + "CLEANUP_FAILED": 150308440, + "DEPRECATED_RESOURCE_USED": 391835586, + "DEPRECATED_TYPE_USED": 346526230, + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE": 369442967, + "EXPERIMENTAL_TYPE_USED": 451954443, + "EXTERNAL_API_WARNING": 175546307, + "FIELD_VALUE_OVERRIDEN": 329669423, + "INJECTED_KERNELS_DEPRECATED": 417377419, + "LARGE_DEPLOYMENT_WARNING": 481440678, + "MISSING_TYPE_DEPENDENCY": 344505463, + "NEXT_HOP_ADDRESS_NOT_ASSIGNED": 324964999, + "NEXT_HOP_CANNOT_IP_FORWARD": 383382887, + "NEXT_HOP_INSTANCE_NOT_FOUND": 464250446, + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK": 243758146, + "NEXT_HOP_NOT_RUNNING": 417081265, + "NOT_CRITICAL_ERROR": 105763924, + "NO_RESULTS_ON_PAGE": 30036744, + "PARTIAL_SUCCESS": 39966469, + "REQUIRED_TOS_AGREEMENT": 3745539, + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING": 496728641, + "RESOURCE_NOT_DELETED": 168598460, + "SCHEMA_VALIDATION_IGNORED": 275245642, + "SINGLE_INSTANCE_PROPERTY_TEMPLATE": 268305617, + "UNDECLARED_PROPERTIES": 390513439, + "UNREACHABLE": 13328052 + } + } + } + }, + "AcceleratorTypeAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "AcceleratorTypesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AcceleratorTypeList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "AcceleratorType", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AccessConfig": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_natIP": { + "oneof": [ + "natIP" + ] + }, + "_networkTier": { + "oneof": [ + "networkTier" + ] + }, + "_publicPtrDomainName": { + "oneof": [ + "publicPtrDomainName" + ] + }, + "_setPublicPtr": { + "oneof": [ + "setPublicPtr" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "natIP": { + "type": "string", + "id": 117634556, + "options": { + "proto3_optional": true + } + }, + "networkTier": { + "type": "NetworkTier", + "id": 517397843, + "options": { + "proto3_optional": true + } + }, + "publicPtrDomainName": { + "type": "string", + "id": 316599167, + "options": { + "proto3_optional": true + } + }, + "setPublicPtr": { + "type": "bool", + "id": 523870229, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "NetworkTier": { + "values": { + "UNDEFINED_NETWORK_TIER": 0, + "PREMIUM": 399530551, + "STANDARD": 484642493 + } + }, + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "ONE_TO_ONE_NAT": 84090205 + } + } + } + }, + "Address": { + "oneofs": { + "_address": { + "oneof": [ + "address" + ] + }, + "_addressType": { + "oneof": [ + "addressType" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_ipVersion": { + "oneof": [ + "ipVersion" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_networkTier": { + "oneof": [ + "networkTier" + ] + }, + "_prefixLength": { + "oneof": [ + "prefixLength" + ] + }, + "_purpose": { + "oneof": [ + "purpose" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + } + }, + "fields": { + "address": { + "type": "string", + "id": 462920692, + "options": { + "proto3_optional": true + } + }, + "addressType": { + "type": "AddressType", + "id": 264307877, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "ipVersion": { + "type": "IpVersion", + "id": 294959552, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "networkTier": { + "type": "NetworkTier", + "id": 517397843, + "options": { + "proto3_optional": true + } + }, + "prefixLength": { + "type": "int32", + "id": 453565747, + "options": { + "proto3_optional": true + } + }, + "purpose": { + "type": "Purpose", + "id": 316407070, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "proto3_optional": true + } + }, + "users": { + "rule": "repeated", + "type": "string", + "id": 111578632 + } + }, + "nested": { + "AddressType": { + "values": { + "UNDEFINED_ADDRESS_TYPE": 0, + "EXTERNAL": 35607499, + "INTERNAL": 279295677, + "UNSPECIFIED_TYPE": 53933922 + } + }, + "IpVersion": { + "values": { + "UNDEFINED_IP_VERSION": 0, + "IPV4": 2254341, + "IPV6": 2254343, + "UNSPECIFIED_VERSION": 21850000 + } + }, + "NetworkTier": { + "values": { + "UNDEFINED_NETWORK_TIER": 0, + "PREMIUM": 399530551, + "STANDARD": 484642493 + } + }, + "Purpose": { + "values": { + "UNDEFINED_PURPOSE": 0, + "DNS_RESOLVER": 476114556, + "GCE_ENDPOINT": 230515243, + "IPSEC_INTERCONNECT": 340437251, + "NAT_AUTO": 163666477, + "PRIVATE_SERVICE_CONNECT": 48134724, + "SHARED_LOADBALANCER_VIP": 294447572, + "VPC_PEERING": 400800170 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "IN_USE": 17393485, + "RESERVED": 432241448, + "RESERVING": 514587225 + } + } + } + }, + "AddressesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "addresses": { + "rule": "repeated", + "type": "Address", + "id": 337673122 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AddressAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "AddressesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AddressList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Address", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AdvancedMachineFeatures": { + "oneofs": { + "_enableNestedVirtualization": { + "oneof": [ + "enableNestedVirtualization" + ] + }, + "_threadsPerCore": { + "oneof": [ + "threadsPerCore" + ] + } + }, + "fields": { + "enableNestedVirtualization": { + "type": "bool", + "id": 16639365, + "options": { + "proto3_optional": true + } + }, + "threadsPerCore": { + "type": "int32", + "id": 352611671, + "options": { + "proto3_optional": true + } + } + } + }, + "AliasIpRange": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_subnetworkRangeName": { + "oneof": [ + "subnetworkRangeName" + ] + } + }, + "fields": { + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "subnetworkRangeName": { + "type": "string", + "id": 387995966, + "options": { + "proto3_optional": true + } + } + } + }, + "AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk": { + "oneofs": { + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_interface": { + "oneof": [ + "interface" + ] + } + }, + "fields": { + "diskSizeGb": { + "type": "int64", + "id": 316263735, + "options": { + "proto3_optional": true + } + }, + "interface": { + "type": "Interface", + "id": 502623545, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Interface": { + "values": { + "UNDEFINED_INTERFACE": 0, + "NVME": 2408800, + "SCSI": 2539686 + } + } + } + }, + "AllocationSpecificSKUAllocationReservedInstanceProperties": { + "oneofs": { + "_locationHint": { + "oneof": [ + "locationHint" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + } + }, + "fields": { + "guestAccelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 463595119 + }, + "localSsds": { + "rule": "repeated", + "type": "AllocationSpecificSKUAllocationAllocatedInstancePropertiesReservedDisk", + "id": 229951299 + }, + "locationHint": { + "type": "string", + "id": 350519505, + "options": { + "proto3_optional": true + } + }, + "machineType": { + "type": "string", + "id": 227711026, + "options": { + "proto3_optional": true + } + }, + "minCpuPlatform": { + "type": "string", + "id": 242912759, + "options": { + "proto3_optional": true + } + } + } + }, + "AllocationSpecificSKUReservation": { + "oneofs": { + "_count": { + "oneof": [ + "count" + ] + }, + "_inUseCount": { + "oneof": [ + "inUseCount" + ] + }, + "_instanceProperties": { + "oneof": [ + "instanceProperties" + ] + } + }, + "fields": { + "count": { + "type": "int64", + "id": 94851343, + "options": { + "proto3_optional": true + } + }, + "inUseCount": { + "type": "int64", + "id": 493458877, + "options": { + "proto3_optional": true + } + }, + "instanceProperties": { + "type": "AllocationSpecificSKUAllocationReservedInstanceProperties", + "id": 215355165, + "options": { + "proto3_optional": true + } + } + } + }, + "CustomerEncryptionKey": { + "oneofs": { + "_kmsKeyName": { + "oneof": [ + "kmsKeyName" + ] + }, + "_kmsKeyServiceAccount": { + "oneof": [ + "kmsKeyServiceAccount" + ] + }, + "_rawKey": { + "oneof": [ + "rawKey" + ] + }, + "_sha256": { + "oneof": [ + "sha256" + ] + } + }, + "fields": { + "kmsKeyName": { + "type": "string", + "id": 484373913, + "options": { + "proto3_optional": true + } + }, + "kmsKeyServiceAccount": { + "type": "string", + "id": 209986261, + "options": { + "proto3_optional": true + } + }, + "rawKey": { + "type": "string", + "id": 449196488, + "options": { + "proto3_optional": true + } + }, + "sha256": { + "type": "string", + "id": 170112551, + "options": { + "proto3_optional": true + } + } + } + }, + "GuestOsFeature": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "FEATURE_TYPE_UNSPECIFIED": 531767259, + "GVNIC": 68209305, + "MULTI_IP_SUBNET": 151776719, + "SECURE_BOOT": 376811194, + "SEV_CAPABLE": 87083793, + "UEFI_COMPATIBLE": 195865408, + "VIRTIO_SCSI_MULTIQUEUE": 201597069, + "WINDOWS": 456863331 + } + } + } + }, + "AttachedDiskInitializeParams": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_diskName": { + "oneof": [ + "diskName" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_diskType": { + "oneof": [ + "diskType" + ] + }, + "_onUpdateAction": { + "oneof": [ + "onUpdateAction" + ] + }, + "_provisionedIops": { + "oneof": [ + "provisionedIops" + ] + }, + "_sourceImage": { + "oneof": [ + "sourceImage" + ] + }, + "_sourceImageEncryptionKey": { + "oneof": [ + "sourceImageEncryptionKey" + ] + }, + "_sourceSnapshot": { + "oneof": [ + "sourceSnapshot" + ] + }, + "_sourceSnapshotEncryptionKey": { + "oneof": [ + "sourceSnapshotEncryptionKey" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "diskName": { + "type": "string", + "id": 92807149, + "options": { + "proto3_optional": true + } + }, + "diskSizeGb": { + "type": "int64", + "id": 316263735, + "options": { + "proto3_optional": true + } + }, + "diskType": { + "type": "string", + "id": 93009052, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "onUpdateAction": { + "type": "OnUpdateAction", + "id": 202451980, + "options": { + "proto3_optional": true + } + }, + "provisionedIops": { + "type": "int64", + "id": 186769108, + "options": { + "proto3_optional": true + } + }, + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + }, + "sourceImage": { + "type": "string", + "id": 50443319, + "options": { + "proto3_optional": true + } + }, + "sourceImageEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 381503659, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshot": { + "type": "string", + "id": 126061928, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshotEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 303679322, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "OnUpdateAction": { + "values": { + "UNDEFINED_ON_UPDATE_ACTION": 0, + "RECREATE_DISK": 494767853, + "RECREATE_DISK_IF_SOURCE_CHANGED": 398099712, + "USE_EXISTING_DISK": 232682233 + } + } + } + }, + "InitialStateConfig": { + "oneofs": { + "_pk": { + "oneof": [ + "pk" + ] + } + }, + "fields": { + "dbs": { + "rule": "repeated", + "type": "FileContentBuffer", + "id": 99253 + }, + "dbxs": { + "rule": "repeated", + "type": "FileContentBuffer", + "id": 3077113 + }, + "keks": { + "rule": "repeated", + "type": "FileContentBuffer", + "id": 3288130 + }, + "pk": { + "type": "FileContentBuffer", + "id": 3579, + "options": { + "proto3_optional": true + } + } + } + }, + "AttachedDisk": { + "oneofs": { + "_autoDelete": { + "oneof": [ + "autoDelete" + ] + }, + "_boot": { + "oneof": [ + "boot" + ] + }, + "_deviceName": { + "oneof": [ + "deviceName" + ] + }, + "_diskEncryptionKey": { + "oneof": [ + "diskEncryptionKey" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_index": { + "oneof": [ + "index" + ] + }, + "_initializeParams": { + "oneof": [ + "initializeParams" + ] + }, + "_interface": { + "oneof": [ + "interface" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_mode": { + "oneof": [ + "mode" + ] + }, + "_shieldedInstanceInitialState": { + "oneof": [ + "shieldedInstanceInitialState" + ] + }, + "_source": { + "oneof": [ + "source" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "autoDelete": { + "type": "bool", + "id": 464761403, + "options": { + "proto3_optional": true + } + }, + "boot": { + "type": "bool", + "id": 3029746, + "options": { + "proto3_optional": true + } + }, + "deviceName": { + "type": "string", + "id": 67541716, + "options": { + "proto3_optional": true + } + }, + "diskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 271660677, + "options": { + "proto3_optional": true + } + }, + "diskSizeGb": { + "type": "int64", + "id": 316263735, + "options": { + "proto3_optional": true + } + }, + "guestOsFeatures": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 79294545 + }, + "index": { + "type": "int32", + "id": 100346066, + "options": { + "proto3_optional": true + } + }, + "initializeParams": { + "type": "AttachedDiskInitializeParams", + "id": 17697045, + "options": { + "proto3_optional": true + } + }, + "interface": { + "type": "Interface", + "id": 502623545, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "licenses": { + "rule": "repeated", + "type": "string", + "id": 337642578 + }, + "mode": { + "type": "Mode", + "id": 3357091, + "options": { + "proto3_optional": true + } + }, + "shieldedInstanceInitialState": { + "type": "InitialStateConfig", + "id": 192356867, + "options": { + "proto3_optional": true + } + }, + "source": { + "type": "string", + "id": 177235995, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Interface": { + "values": { + "UNDEFINED_INTERFACE": 0, + "NVME": 2408800, + "SCSI": 2539686 + } + }, + "Mode": { + "values": { + "UNDEFINED_MODE": 0, + "READ_ONLY": 91950261, + "READ_WRITE": 173607894 + } + }, + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "PERSISTENT": 460683927, + "SCRATCH": 496778970 + } + } + } + }, + "AuditLogConfig": { + "oneofs": { + "_ignoreChildExemptions": { + "oneof": [ + "ignoreChildExemptions" + ] + }, + "_logType": { + "oneof": [ + "logType" + ] + } + }, + "fields": { + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 232615576 + }, + "ignoreChildExemptions": { + "type": "bool", + "id": 70141850, + "options": { + "proto3_optional": true + } + }, + "logType": { + "type": "LogType", + "id": 403115861, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "LogType": { + "values": { + "UNDEFINED_LOG_TYPE": 0, + "ADMIN_READ": 128951462, + "DATA_READ": 305224971, + "DATA_WRITE": 340181738, + "LOG_TYPE_UNSPECIFIED": 154527053 + } + } + } + }, + "AuditConfig": { + "oneofs": { + "_service": { + "oneof": [ + "service" + ] + } + }, + "fields": { + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 488420626 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 232615576 + }, + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + } + } + }, + "AuthorizationLoggingOptions": { + "oneofs": { + "_permissionType": { + "oneof": [ + "permissionType" + ] + } + }, + "fields": { + "permissionType": { + "type": "PermissionType", + "id": 525978538, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PermissionType": { + "values": { + "UNDEFINED_PERMISSION_TYPE": 0, + "ADMIN_READ": 128951462, + "ADMIN_WRITE": 244412079, + "DATA_READ": 305224971, + "DATA_WRITE": 340181738, + "PERMISSION_TYPE_UNSPECIFIED": 440313346 + } + } + } + }, + "AutoscalingPolicy": { + "oneofs": { + "_coolDownPeriodSec": { + "oneof": [ + "coolDownPeriodSec" + ] + }, + "_cpuUtilization": { + "oneof": [ + "cpuUtilization" + ] + }, + "_loadBalancingUtilization": { + "oneof": [ + "loadBalancingUtilization" + ] + }, + "_maxNumReplicas": { + "oneof": [ + "maxNumReplicas" + ] + }, + "_minNumReplicas": { + "oneof": [ + "minNumReplicas" + ] + }, + "_mode": { + "oneof": [ + "mode" + ] + }, + "_scaleInControl": { + "oneof": [ + "scaleInControl" + ] + } + }, + "fields": { + "coolDownPeriodSec": { + "type": "int32", + "id": 107692954, + "options": { + "proto3_optional": true + } + }, + "cpuUtilization": { + "type": "AutoscalingPolicyCpuUtilization", + "id": 381211147, + "options": { + "proto3_optional": true + } + }, + "customMetricUtilizations": { + "rule": "repeated", + "type": "AutoscalingPolicyCustomMetricUtilization", + "id": 131972850 + }, + "loadBalancingUtilization": { + "type": "AutoscalingPolicyLoadBalancingUtilization", + "id": 429746403, + "options": { + "proto3_optional": true + } + }, + "maxNumReplicas": { + "type": "int32", + "id": 62327375, + "options": { + "proto3_optional": true + } + }, + "minNumReplicas": { + "type": "int32", + "id": 535329825, + "options": { + "proto3_optional": true + } + }, + "mode": { + "type": "Mode", + "id": 3357091, + "options": { + "proto3_optional": true + } + }, + "scaleInControl": { + "type": "AutoscalingPolicyScaleInControl", + "id": 527670872, + "options": { + "proto3_optional": true + } + }, + "scalingSchedules": { + "keyType": "string", + "type": "AutoscalingPolicyScalingSchedule", + "id": 355416580 + } + }, + "nested": { + "Mode": { + "values": { + "UNDEFINED_MODE": 0, + "OFF": 78159, + "ON": 2527, + "ONLY_SCALE_OUT": 152713670, + "ONLY_UP": 478095374 + } + } + } + }, + "ScalingScheduleStatus": { + "oneofs": { + "_lastStartTime": { + "oneof": [ + "lastStartTime" + ] + }, + "_nextStartTime": { + "oneof": [ + "nextStartTime" + ] + }, + "_state": { + "oneof": [ + "state" + ] + } + }, + "fields": { + "lastStartTime": { + "type": "string", + "id": 34545107, + "options": { + "proto3_optional": true + } + }, + "nextStartTime": { + "type": "string", + "id": 97270102, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "UNDEFINED_STATE": 0, + "ACTIVE": 314733318, + "DISABLED": 516696700, + "OBSOLETE": 66532761, + "READY": 77848963 + } + } + } + }, + "AutoscalerStatusDetails": { + "oneofs": { + "_message": { + "oneof": [ + "message" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "message": { + "type": "string", + "id": 418054151, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "ALL_INSTANCES_UNHEALTHY": 404965477, + "BACKEND_SERVICE_DOES_NOT_EXIST": 191417626, + "CAPPED_AT_MAX_NUM_REPLICAS": 518617, + "CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE": 328964659, + "CUSTOM_METRIC_INVALID": 204430550, + "MIN_EQUALS_MAX": 2821361, + "MISSING_CUSTOM_METRIC_DATA_POINTS": 94885086, + "MISSING_LOAD_BALANCING_DATA_POINTS": 509858898, + "MODE_OFF": 164169907, + "MODE_ONLY_SCALE_OUT": 3840994, + "MODE_ONLY_UP": 100969842, + "MORE_THAN_ONE_BACKEND_SERVICE": 151922141, + "NOT_ENOUGH_QUOTA_AVAILABLE": 403101631, + "REGION_RESOURCE_STOCKOUT": 528622846, + "SCALING_TARGET_DOES_NOT_EXIST": 122636699, + "SCHEDULED_INSTANCES_GREATER_THAN_AUTOSCALER_MAX": 29275586, + "SCHEDULED_INSTANCES_LESS_THAN_AUTOSCALER_MIN": 398287669, + "UNKNOWN": 433141802, + "UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION": 330845009, + "ZONE_RESOURCE_STOCKOUT": 210200502 + } + } + } + }, + "Autoscaler": { + "oneofs": { + "_autoscalingPolicy": { + "oneof": [ + "autoscalingPolicy" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_recommendedSize": { + "oneof": [ + "recommendedSize" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_target": { + "oneof": [ + "target" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "autoscalingPolicy": { + "type": "AutoscalingPolicy", + "id": 221950041, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "recommendedSize": { + "type": "int32", + "id": 257915749, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "scalingScheduleStatus": { + "keyType": "string", + "type": "ScalingScheduleStatus", + "id": 465950178 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "statusDetails": { + "rule": "repeated", + "type": "AutoscalerStatusDetails", + "id": 363353845 + }, + "target": { + "type": "string", + "id": 192835985, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "ACTIVE": 314733318, + "DELETING": 528602024, + "ERROR": 66247144, + "PENDING": 35394935 + } + } + } + }, + "AutoscalersScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "autoscalers": { + "rule": "repeated", + "type": "Autoscaler", + "id": 465771644 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AutoscalerAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "AutoscalersScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AutoscalerList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Autoscaler", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "AutoscalingPolicyCpuUtilization": { + "oneofs": { + "_predictiveMethod": { + "oneof": [ + "predictiveMethod" + ] + }, + "_utilizationTarget": { + "oneof": [ + "utilizationTarget" + ] + } + }, + "fields": { + "predictiveMethod": { + "type": "PredictiveMethod", + "id": 390220737, + "options": { + "proto3_optional": true + } + }, + "utilizationTarget": { + "type": "double", + "id": 215905870, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PredictiveMethod": { + "values": { + "UNDEFINED_PREDICTIVE_METHOD": 0, + "NONE": 2402104, + "OPTIMIZE_AVAILABILITY": 11629437 + } + } + } + }, + "AutoscalingPolicyCustomMetricUtilization": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_metric": { + "oneof": [ + "metric" + ] + }, + "_singleInstanceAssignment": { + "oneof": [ + "singleInstanceAssignment" + ] + }, + "_utilizationTarget": { + "oneof": [ + "utilizationTarget" + ] + }, + "_utilizationTargetType": { + "oneof": [ + "utilizationTargetType" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "metric": { + "type": "string", + "id": 533067184, + "options": { + "proto3_optional": true + } + }, + "singleInstanceAssignment": { + "type": "double", + "id": 504768064, + "options": { + "proto3_optional": true + } + }, + "utilizationTarget": { + "type": "double", + "id": 215905870, + "options": { + "proto3_optional": true + } + }, + "utilizationTargetType": { + "type": "UtilizationTargetType", + "id": 340169355, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "UtilizationTargetType": { + "values": { + "UNDEFINED_UTILIZATION_TARGET_TYPE": 0, + "DELTA_PER_MINUTE": 87432861, + "DELTA_PER_SECOND": 255180029, + "GAUGE": 67590361 + } + } + } + }, + "AutoscalingPolicyLoadBalancingUtilization": { + "oneofs": { + "_utilizationTarget": { + "oneof": [ + "utilizationTarget" + ] + } + }, + "fields": { + "utilizationTarget": { + "type": "double", + "id": 215905870, + "options": { + "proto3_optional": true + } + } + } + }, + "AutoscalingPolicyScaleInControl": { + "oneofs": { + "_maxScaledInReplicas": { + "oneof": [ + "maxScaledInReplicas" + ] + }, + "_timeWindowSec": { + "oneof": [ + "timeWindowSec" + ] + } + }, + "fields": { + "maxScaledInReplicas": { + "type": "FixedOrPercent", + "id": 180710123, + "options": { + "proto3_optional": true + } + }, + "timeWindowSec": { + "type": "int32", + "id": 36405300, + "options": { + "proto3_optional": true + } + } + } + }, + "AutoscalingPolicyScalingSchedule": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_disabled": { + "oneof": [ + "disabled" + ] + }, + "_durationSec": { + "oneof": [ + "durationSec" + ] + }, + "_minRequiredReplicas": { + "oneof": [ + "minRequiredReplicas" + ] + }, + "_schedule": { + "oneof": [ + "schedule" + ] + }, + "_timeZone": { + "oneof": [ + "timeZone" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "disabled": { + "type": "bool", + "id": 270940796, + "options": { + "proto3_optional": true + } + }, + "durationSec": { + "type": "int32", + "id": 212356902, + "options": { + "proto3_optional": true + } + }, + "minRequiredReplicas": { + "type": "int32", + "id": 365514414, + "options": { + "proto3_optional": true + } + }, + "schedule": { + "type": "string", + "id": 375820951, + "options": { + "proto3_optional": true + } + }, + "timeZone": { + "type": "string", + "id": 36848094, + "options": { + "proto3_optional": true + } + } + } + }, + "FixedOrPercent": { + "oneofs": { + "_calculated": { + "oneof": [ + "calculated" + ] + }, + "_fixed": { + "oneof": [ + "fixed" + ] + }, + "_percent": { + "oneof": [ + "percent" + ] + } + }, + "fields": { + "calculated": { + "type": "int32", + "id": 472082878, + "options": { + "proto3_optional": true + } + }, + "fixed": { + "type": "int32", + "id": 97445748, + "options": { + "proto3_optional": true + } + }, + "percent": { + "type": "int32", + "id": 394814533, + "options": { + "proto3_optional": true + } + } + } + }, + "Backend": { + "oneofs": { + "_balancingMode": { + "oneof": [ + "balancingMode" + ] + }, + "_capacityScaler": { + "oneof": [ + "capacityScaler" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_failover": { + "oneof": [ + "failover" + ] + }, + "_group": { + "oneof": [ + "group" + ] + }, + "_maxConnections": { + "oneof": [ + "maxConnections" + ] + }, + "_maxConnectionsPerEndpoint": { + "oneof": [ + "maxConnectionsPerEndpoint" + ] + }, + "_maxConnectionsPerInstance": { + "oneof": [ + "maxConnectionsPerInstance" + ] + }, + "_maxRate": { + "oneof": [ + "maxRate" + ] + }, + "_maxRatePerEndpoint": { + "oneof": [ + "maxRatePerEndpoint" + ] + }, + "_maxRatePerInstance": { + "oneof": [ + "maxRatePerInstance" + ] + }, + "_maxUtilization": { + "oneof": [ + "maxUtilization" + ] + } + }, + "fields": { + "balancingMode": { + "type": "BalancingMode", + "id": 430286217, + "options": { + "proto3_optional": true + } + }, + "capacityScaler": { + "type": "float", + "id": 315958157, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "failover": { + "type": "bool", + "id": 138892530, + "options": { + "proto3_optional": true + } + }, + "group": { + "type": "string", + "id": 98629247, + "options": { + "proto3_optional": true + } + }, + "maxConnections": { + "type": "int32", + "id": 110652154, + "options": { + "proto3_optional": true + } + }, + "maxConnectionsPerEndpoint": { + "type": "int32", + "id": 216904604, + "options": { + "proto3_optional": true + } + }, + "maxConnectionsPerInstance": { + "type": "int32", + "id": 104671900, + "options": { + "proto3_optional": true + } + }, + "maxRate": { + "type": "int32", + "id": 408035035, + "options": { + "proto3_optional": true + } + }, + "maxRatePerEndpoint": { + "type": "float", + "id": 129832283, + "options": { + "proto3_optional": true + } + }, + "maxRatePerInstance": { + "type": "float", + "id": 17599579, + "options": { + "proto3_optional": true + } + }, + "maxUtilization": { + "type": "float", + "id": 148192199, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "BalancingMode": { + "values": { + "UNDEFINED_BALANCING_MODE": 0, + "CONNECTION": 246311646, + "RATE": 2508000, + "UTILIZATION": 157008386 + } + } + } + }, + "BackendBucketCdnPolicy": { + "oneofs": { + "_cacheMode": { + "oneof": [ + "cacheMode" + ] + }, + "_clientTtl": { + "oneof": [ + "clientTtl" + ] + }, + "_defaultTtl": { + "oneof": [ + "defaultTtl" + ] + }, + "_maxTtl": { + "oneof": [ + "maxTtl" + ] + }, + "_negativeCaching": { + "oneof": [ + "negativeCaching" + ] + }, + "_requestCoalescing": { + "oneof": [ + "requestCoalescing" + ] + }, + "_serveWhileStale": { + "oneof": [ + "serveWhileStale" + ] + }, + "_signedUrlCacheMaxAgeSec": { + "oneof": [ + "signedUrlCacheMaxAgeSec" + ] + } + }, + "fields": { + "bypassCacheOnRequestHeaders": { + "rule": "repeated", + "type": "BackendBucketCdnPolicyBypassCacheOnRequestHeader", + "id": 486203082 + }, + "cacheMode": { + "type": "CacheMode", + "id": 28877888, + "options": { + "proto3_optional": true + } + }, + "clientTtl": { + "type": "int32", + "id": 29034360, + "options": { + "proto3_optional": true + } + }, + "defaultTtl": { + "type": "int32", + "id": 100253422, + "options": { + "proto3_optional": true + } + }, + "maxTtl": { + "type": "int32", + "id": 307578001, + "options": { + "proto3_optional": true + } + }, + "negativeCaching": { + "type": "bool", + "id": 336110005, + "options": { + "proto3_optional": true + } + }, + "negativeCachingPolicy": { + "rule": "repeated", + "type": "BackendBucketCdnPolicyNegativeCachingPolicy", + "id": 155359996 + }, + "requestCoalescing": { + "type": "bool", + "id": 532808276, + "options": { + "proto3_optional": true + } + }, + "serveWhileStale": { + "type": "int32", + "id": 236682203, + "options": { + "proto3_optional": true + } + }, + "signedUrlCacheMaxAgeSec": { + "type": "int64", + "id": 269374534, + "options": { + "proto3_optional": true + } + }, + "signedUrlKeyNames": { + "rule": "repeated", + "type": "string", + "id": 371848885 + } + }, + "nested": { + "CacheMode": { + "values": { + "UNDEFINED_CACHE_MODE": 0, + "CACHE_ALL_STATIC": 355027945, + "FORCE_CACHE_ALL": 486026928, + "INVALID_CACHE_MODE": 381295560, + "USE_ORIGIN_HEADERS": 55380261 + } + } + } + }, + "BackendBucket": { + "oneofs": { + "_bucketName": { + "oneof": [ + "bucketName" + ] + }, + "_cdnPolicy": { + "oneof": [ + "cdnPolicy" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_enableCdn": { + "oneof": [ + "enableCdn" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "bucketName": { + "type": "string", + "id": 283610048, + "options": { + "proto3_optional": true + } + }, + "cdnPolicy": { + "type": "BackendBucketCdnPolicy", + "id": 213976452, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "customResponseHeaders": { + "rule": "repeated", + "type": "string", + "id": 387539094 + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "enableCdn": { + "type": "bool", + "id": 282942321, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendBucketCdnPolicyBypassCacheOnRequestHeader": { + "oneofs": { + "_headerName": { + "oneof": [ + "headerName" + ] + } + }, + "fields": { + "headerName": { + "type": "string", + "id": 110223613, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendBucketCdnPolicyNegativeCachingPolicy": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_ttl": { + "oneof": [ + "ttl" + ] + } + }, + "fields": { + "code": { + "type": "int32", + "id": 3059181, + "options": { + "proto3_optional": true + } + }, + "ttl": { + "type": "int32", + "id": 115180, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendBucketList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "BackendBucket", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceCdnPolicy": { + "oneofs": { + "_cacheKeyPolicy": { + "oneof": [ + "cacheKeyPolicy" + ] + }, + "_cacheMode": { + "oneof": [ + "cacheMode" + ] + }, + "_clientTtl": { + "oneof": [ + "clientTtl" + ] + }, + "_defaultTtl": { + "oneof": [ + "defaultTtl" + ] + }, + "_maxTtl": { + "oneof": [ + "maxTtl" + ] + }, + "_negativeCaching": { + "oneof": [ + "negativeCaching" + ] + }, + "_requestCoalescing": { + "oneof": [ + "requestCoalescing" + ] + }, + "_serveWhileStale": { + "oneof": [ + "serveWhileStale" + ] + }, + "_signedUrlCacheMaxAgeSec": { + "oneof": [ + "signedUrlCacheMaxAgeSec" + ] + } + }, + "fields": { + "bypassCacheOnRequestHeaders": { + "rule": "repeated", + "type": "BackendServiceCdnPolicyBypassCacheOnRequestHeader", + "id": 486203082 + }, + "cacheKeyPolicy": { + "type": "CacheKeyPolicy", + "id": 159263727, + "options": { + "proto3_optional": true + } + }, + "cacheMode": { + "type": "CacheMode", + "id": 28877888, + "options": { + "proto3_optional": true + } + }, + "clientTtl": { + "type": "int32", + "id": 29034360, + "options": { + "proto3_optional": true + } + }, + "defaultTtl": { + "type": "int32", + "id": 100253422, + "options": { + "proto3_optional": true + } + }, + "maxTtl": { + "type": "int32", + "id": 307578001, + "options": { + "proto3_optional": true + } + }, + "negativeCaching": { + "type": "bool", + "id": 336110005, + "options": { + "proto3_optional": true + } + }, + "negativeCachingPolicy": { + "rule": "repeated", + "type": "BackendServiceCdnPolicyNegativeCachingPolicy", + "id": 155359996 + }, + "requestCoalescing": { + "type": "bool", + "id": 532808276, + "options": { + "proto3_optional": true + } + }, + "serveWhileStale": { + "type": "int32", + "id": 236682203, + "options": { + "proto3_optional": true + } + }, + "signedUrlCacheMaxAgeSec": { + "type": "int64", + "id": 269374534, + "options": { + "proto3_optional": true + } + }, + "signedUrlKeyNames": { + "rule": "repeated", + "type": "string", + "id": 371848885 + } + }, + "nested": { + "CacheMode": { + "values": { + "UNDEFINED_CACHE_MODE": 0, + "CACHE_ALL_STATIC": 355027945, + "FORCE_CACHE_ALL": 486026928, + "INVALID_CACHE_MODE": 381295560, + "USE_ORIGIN_HEADERS": 55380261 + } + } + } + }, + "CircuitBreakers": { + "oneofs": { + "_maxConnections": { + "oneof": [ + "maxConnections" + ] + }, + "_maxPendingRequests": { + "oneof": [ + "maxPendingRequests" + ] + }, + "_maxRequests": { + "oneof": [ + "maxRequests" + ] + }, + "_maxRequestsPerConnection": { + "oneof": [ + "maxRequestsPerConnection" + ] + }, + "_maxRetries": { + "oneof": [ + "maxRetries" + ] + } + }, + "fields": { + "maxConnections": { + "type": "int32", + "id": 110652154, + "options": { + "proto3_optional": true + } + }, + "maxPendingRequests": { + "type": "int32", + "id": 375558887, + "options": { + "proto3_optional": true + } + }, + "maxRequests": { + "type": "int32", + "id": 28097599, + "options": { + "proto3_optional": true + } + }, + "maxRequestsPerConnection": { + "type": "int32", + "id": 361630528, + "options": { + "proto3_optional": true + } + }, + "maxRetries": { + "type": "int32", + "id": 55546219, + "options": { + "proto3_optional": true + } + } + } + }, + "ConnectionDraining": { + "oneofs": { + "_drainingTimeoutSec": { + "oneof": [ + "drainingTimeoutSec" + ] + } + }, + "fields": { + "drainingTimeoutSec": { + "type": "int32", + "id": 225127070, + "options": { + "proto3_optional": true + } + } + } + }, + "ConsistentHashLoadBalancerSettings": { + "oneofs": { + "_httpCookie": { + "oneof": [ + "httpCookie" + ] + }, + "_httpHeaderName": { + "oneof": [ + "httpHeaderName" + ] + }, + "_minimumRingSize": { + "oneof": [ + "minimumRingSize" + ] + } + }, + "fields": { + "httpCookie": { + "type": "ConsistentHashLoadBalancerSettingsHttpCookie", + "id": 6673915, + "options": { + "proto3_optional": true + } + }, + "httpHeaderName": { + "type": "string", + "id": 234798022, + "options": { + "proto3_optional": true + } + }, + "minimumRingSize": { + "type": "int64", + "id": 234380735, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceFailoverPolicy": { + "oneofs": { + "_disableConnectionDrainOnFailover": { + "oneof": [ + "disableConnectionDrainOnFailover" + ] + }, + "_dropTrafficIfUnhealthy": { + "oneof": [ + "dropTrafficIfUnhealthy" + ] + }, + "_failoverRatio": { + "oneof": [ + "failoverRatio" + ] + } + }, + "fields": { + "disableConnectionDrainOnFailover": { + "type": "bool", + "id": 182150753, + "options": { + "proto3_optional": true + } + }, + "dropTrafficIfUnhealthy": { + "type": "bool", + "id": 112289428, + "options": { + "proto3_optional": true + } + }, + "failoverRatio": { + "type": "float", + "id": 212667006, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceIAP": { + "oneofs": { + "_enabled": { + "oneof": [ + "enabled" + ] + }, + "_oauth2ClientId": { + "oneof": [ + "oauth2ClientId" + ] + }, + "_oauth2ClientSecret": { + "oneof": [ + "oauth2ClientSecret" + ] + }, + "_oauth2ClientSecretSha256": { + "oneof": [ + "oauth2ClientSecretSha256" + ] + } + }, + "fields": { + "enabled": { + "type": "bool", + "id": 1018689, + "options": { + "proto3_optional": true + } + }, + "oauth2ClientId": { + "type": "string", + "id": 314017611, + "options": { + "proto3_optional": true + } + }, + "oauth2ClientSecret": { + "type": "string", + "id": 50999520, + "options": { + "proto3_optional": true + } + }, + "oauth2ClientSecretSha256": { + "type": "string", + "id": 112903782, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceLogConfig": { + "oneofs": { + "_enable": { + "oneof": [ + "enable" + ] + }, + "_sampleRate": { + "oneof": [ + "sampleRate" + ] + } + }, + "fields": { + "enable": { + "type": "bool", + "id": 311764355, + "options": { + "proto3_optional": true + } + }, + "sampleRate": { + "type": "float", + "id": 153193045, + "options": { + "proto3_optional": true + } + } + } + }, + "Duration": { + "oneofs": { + "_nanos": { + "oneof": [ + "nanos" + ] + }, + "_seconds": { + "oneof": [ + "seconds" + ] + } + }, + "fields": { + "nanos": { + "type": "int32", + "id": 104586303, + "options": { + "proto3_optional": true + } + }, + "seconds": { + "type": "int64", + "id": 359484031, + "options": { + "proto3_optional": true + } + } + } + }, + "OutlierDetection": { + "oneofs": { + "_baseEjectionTime": { + "oneof": [ + "baseEjectionTime" + ] + }, + "_consecutiveErrors": { + "oneof": [ + "consecutiveErrors" + ] + }, + "_consecutiveGatewayFailure": { + "oneof": [ + "consecutiveGatewayFailure" + ] + }, + "_enforcingConsecutiveErrors": { + "oneof": [ + "enforcingConsecutiveErrors" + ] + }, + "_enforcingConsecutiveGatewayFailure": { + "oneof": [ + "enforcingConsecutiveGatewayFailure" + ] + }, + "_enforcingSuccessRate": { + "oneof": [ + "enforcingSuccessRate" + ] + }, + "_interval": { + "oneof": [ + "interval" + ] + }, + "_maxEjectionPercent": { + "oneof": [ + "maxEjectionPercent" + ] + }, + "_successRateMinimumHosts": { + "oneof": [ + "successRateMinimumHosts" + ] + }, + "_successRateRequestVolume": { + "oneof": [ + "successRateRequestVolume" + ] + }, + "_successRateStdevFactor": { + "oneof": [ + "successRateStdevFactor" + ] + } + }, + "fields": { + "baseEjectionTime": { + "type": "Duration", + "id": 80997255, + "options": { + "proto3_optional": true + } + }, + "consecutiveErrors": { + "type": "int32", + "id": 387193248, + "options": { + "proto3_optional": true + } + }, + "consecutiveGatewayFailure": { + "type": "int32", + "id": 417504250, + "options": { + "proto3_optional": true + } + }, + "enforcingConsecutiveErrors": { + "type": "int32", + "id": 213133760, + "options": { + "proto3_optional": true + } + }, + "enforcingConsecutiveGatewayFailure": { + "type": "int32", + "id": 394440666, + "options": { + "proto3_optional": true + } + }, + "enforcingSuccessRate": { + "type": "int32", + "id": 194508732, + "options": { + "proto3_optional": true + } + }, + "interval": { + "type": "Duration", + "id": 33547461, + "options": { + "proto3_optional": true + } + }, + "maxEjectionPercent": { + "type": "int32", + "id": 18436888, + "options": { + "proto3_optional": true + } + }, + "successRateMinimumHosts": { + "type": "int32", + "id": 525766903, + "options": { + "proto3_optional": true + } + }, + "successRateRequestVolume": { + "type": "int32", + "id": 281425357, + "options": { + "proto3_optional": true + } + }, + "successRateStdevFactor": { + "type": "int32", + "id": 174735773, + "options": { + "proto3_optional": true + } + } + } + }, + "SecuritySettings": { + "oneofs": { + "_clientTlsPolicy": { + "oneof": [ + "clientTlsPolicy" + ] + } + }, + "fields": { + "clientTlsPolicy": { + "type": "string", + "id": 462325226, + "options": { + "proto3_optional": true + } + }, + "subjectAltNames": { + "rule": "repeated", + "type": "string", + "id": 330029535 + } + } + }, + "BackendService": { + "oneofs": { + "_affinityCookieTtlSec": { + "oneof": [ + "affinityCookieTtlSec" + ] + }, + "_cdnPolicy": { + "oneof": [ + "cdnPolicy" + ] + }, + "_circuitBreakers": { + "oneof": [ + "circuitBreakers" + ] + }, + "_connectionDraining": { + "oneof": [ + "connectionDraining" + ] + }, + "_consistentHash": { + "oneof": [ + "consistentHash" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_enableCDN": { + "oneof": [ + "enableCDN" + ] + }, + "_failoverPolicy": { + "oneof": [ + "failoverPolicy" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_iap": { + "oneof": [ + "iap" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_loadBalancingScheme": { + "oneof": [ + "loadBalancingScheme" + ] + }, + "_localityLbPolicy": { + "oneof": [ + "localityLbPolicy" + ] + }, + "_logConfig": { + "oneof": [ + "logConfig" + ] + }, + "_maxStreamDuration": { + "oneof": [ + "maxStreamDuration" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_outlierDetection": { + "oneof": [ + "outlierDetection" + ] + }, + "_port": { + "oneof": [ + "port" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + }, + "_protocol": { + "oneof": [ + "protocol" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_securityPolicy": { + "oneof": [ + "securityPolicy" + ] + }, + "_securitySettings": { + "oneof": [ + "securitySettings" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_sessionAffinity": { + "oneof": [ + "sessionAffinity" + ] + }, + "_timeoutSec": { + "oneof": [ + "timeoutSec" + ] + } + }, + "fields": { + "affinityCookieTtlSec": { + "type": "int32", + "id": 369996954, + "options": { + "proto3_optional": true + } + }, + "backends": { + "rule": "repeated", + "type": "Backend", + "id": 510839903 + }, + "cdnPolicy": { + "type": "BackendServiceCdnPolicy", + "id": 213976452, + "options": { + "proto3_optional": true + } + }, + "circuitBreakers": { + "type": "CircuitBreakers", + "id": 421340061, + "options": { + "proto3_optional": true + } + }, + "connectionDraining": { + "type": "ConnectionDraining", + "id": 461096747, + "options": { + "proto3_optional": true + } + }, + "consistentHash": { + "type": "ConsistentHashLoadBalancerSettings", + "id": 905883, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "customRequestHeaders": { + "rule": "repeated", + "type": "string", + "id": 27977992 + }, + "customResponseHeaders": { + "rule": "repeated", + "type": "string", + "id": 387539094 + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "enableCDN": { + "type": "bool", + "id": 250733499, + "options": { + "proto3_optional": true + } + }, + "failoverPolicy": { + "type": "BackendServiceFailoverPolicy", + "id": 105658655, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "healthChecks": { + "rule": "repeated", + "type": "string", + "id": 448370606 + }, + "iap": { + "type": "BackendServiceIAP", + "id": 104024, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "loadBalancingScheme": { + "type": "LoadBalancingScheme", + "id": 363890244, + "options": { + "proto3_optional": true + } + }, + "localityLbPolicy": { + "type": "LocalityLbPolicy", + "id": 131431487, + "options": { + "proto3_optional": true + } + }, + "logConfig": { + "type": "BackendServiceLogConfig", + "id": 351299741, + "options": { + "proto3_optional": true + } + }, + "maxStreamDuration": { + "type": "Duration", + "id": 61428376, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "outlierDetection": { + "type": "OutlierDetection", + "id": 354625086, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + }, + "protocol": { + "type": "Protocol", + "id": 84577944, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "proto3_optional": true + } + }, + "securitySettings": { + "type": "SecuritySettings", + "id": 478649922, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sessionAffinity": { + "type": "SessionAffinity", + "id": 463888561, + "options": { + "proto3_optional": true + } + }, + "timeoutSec": { + "type": "int32", + "id": 79994995, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "LoadBalancingScheme": { + "values": { + "UNDEFINED_LOAD_BALANCING_SCHEME": 0, + "EXTERNAL": 35607499, + "INTERNAL": 279295677, + "INTERNAL_MANAGED": 37350397, + "INTERNAL_SELF_MANAGED": 236211150, + "INVALID_LOAD_BALANCING_SCHEME": 275352060 + } + }, + "LocalityLbPolicy": { + "values": { + "UNDEFINED_LOCALITY_LB_POLICY": 0, + "INVALID_LB_POLICY": 323318707, + "LEAST_REQUEST": 46604921, + "MAGLEV": 119180266, + "ORIGINAL_DESTINATION": 166297216, + "RANDOM": 262527171, + "RING_HASH": 432795069, + "ROUND_ROBIN": 153895801 + } + }, + "Protocol": { + "values": { + "UNDEFINED_PROTOCOL": 0, + "GRPC": 2196510, + "HTTP": 2228360, + "HTTP2": 69079210, + "HTTPS": 69079243, + "SSL": 82412, + "TCP": 82881, + "UDP": 83873 + } + }, + "SessionAffinity": { + "values": { + "UNDEFINED_SESSION_AFFINITY": 0, + "CLIENT_IP": 345665051, + "CLIENT_IP_NO_DESTINATION": 106122516, + "CLIENT_IP_PORT_PROTO": 221722926, + "CLIENT_IP_PROTO": 25322148, + "GENERATED_COOKIE": 370321204, + "HEADER_FIELD": 200737960, + "HTTP_COOKIE": 494981627, + "NONE": 2402104 + } + } + } + }, + "BackendServicesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "backendServices": { + "rule": "repeated", + "type": "BackendService", + "id": 388522409 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "BackendServicesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceCdnPolicyBypassCacheOnRequestHeader": { + "oneofs": { + "_headerName": { + "oneof": [ + "headerName" + ] + } + }, + "fields": { + "headerName": { + "type": "string", + "id": 110223613, + "options": { + "proto3_optional": true + } + } + } + }, + "CacheKeyPolicy": { + "oneofs": { + "_includeHost": { + "oneof": [ + "includeHost" + ] + }, + "_includeProtocol": { + "oneof": [ + "includeProtocol" + ] + }, + "_includeQueryString": { + "oneof": [ + "includeQueryString" + ] + } + }, + "fields": { + "includeHost": { + "type": "bool", + "id": 486867679, + "options": { + "proto3_optional": true + } + }, + "includeProtocol": { + "type": "bool", + "id": 303507535, + "options": { + "proto3_optional": true + } + }, + "includeQueryString": { + "type": "bool", + "id": 474036639, + "options": { + "proto3_optional": true + } + }, + "queryStringBlacklist": { + "rule": "repeated", + "type": "string", + "id": 354964742 + }, + "queryStringWhitelist": { + "rule": "repeated", + "type": "string", + "id": 52456496 + } + } + }, + "BackendServiceCdnPolicyNegativeCachingPolicy": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_ttl": { + "oneof": [ + "ttl" + ] + } + }, + "fields": { + "code": { + "type": "int32", + "id": 3059181, + "options": { + "proto3_optional": true + } + }, + "ttl": { + "type": "int32", + "id": 115180, + "options": { + "proto3_optional": true + } + } + } + }, + "HealthStatus": { + "oneofs": { + "_forwardingRule": { + "oneof": [ + "forwardingRule" + ] + }, + "_forwardingRuleIp": { + "oneof": [ + "forwardingRuleIp" + ] + }, + "_healthState": { + "oneof": [ + "healthState" + ] + }, + "_instance": { + "oneof": [ + "instance" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_port": { + "oneof": [ + "port" + ] + }, + "_weight": { + "oneof": [ + "weight" + ] + }, + "_weightError": { + "oneof": [ + "weightError" + ] + } + }, + "fields": { + "annotations": { + "keyType": "string", + "type": "string", + "id": 112032548 + }, + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "proto3_optional": true + } + }, + "forwardingRuleIp": { + "type": "string", + "id": 172250632, + "options": { + "proto3_optional": true + } + }, + "healthState": { + "type": "HealthState", + "id": 324007150, + "options": { + "proto3_optional": true + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 406272220, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "weight": { + "type": "string", + "id": 282149496, + "options": { + "proto3_optional": true + } + }, + "weightError": { + "type": "WeightError", + "id": 522501505, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "HealthState": { + "values": { + "UNDEFINED_HEALTH_STATE": 0, + "HEALTHY": 439801213, + "UNHEALTHY": 462118084 + } + }, + "WeightError": { + "values": { + "UNDEFINED_WEIGHT_ERROR": 0, + "INVALID_WEIGHT": 383698400, + "MISSING_WEIGHT": 384027537, + "UNAVAILABLE_WEIGHT": 439464295, + "WEIGHT_NONE": 502428831 + } + } + } + }, + "BackendServiceGroupHealth": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + } + }, + "fields": { + "annotations": { + "keyType": "string", + "type": "string", + "id": 112032548 + }, + "healthStatus": { + "rule": "repeated", + "type": "HealthStatus", + "id": 380545845 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "BackendService", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "BackendServiceReference": { + "oneofs": { + "_backendService": { + "oneof": [ + "backendService" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "proto3_optional": true + } + } + } + }, + "Expr": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_expression": { + "oneof": [ + "expression" + ] + }, + "_location": { + "oneof": [ + "location" + ] + }, + "_title": { + "oneof": [ + "title" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "expression": { + "type": "string", + "id": 352031384, + "options": { + "proto3_optional": true + } + }, + "location": { + "type": "string", + "id": 290430901, + "options": { + "proto3_optional": true + } + }, + "title": { + "type": "string", + "id": 110371416, + "options": { + "proto3_optional": true + } + } + } + }, + "Binding": { + "oneofs": { + "_bindingId": { + "oneof": [ + "bindingId" + ] + }, + "_condition": { + "oneof": [ + "condition" + ] + }, + "_role": { + "oneof": [ + "role" + ] + } + }, + "fields": { + "bindingId": { + "type": "string", + "id": 441088277, + "options": { + "proto3_optional": true + } + }, + "condition": { + "type": "Expr", + "id": 212430107, + "options": { + "proto3_optional": true + } + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 412010777 + }, + "role": { + "type": "string", + "id": 3506294, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceProperties": { + "oneofs": { + "_advancedMachineFeatures": { + "oneof": [ + "advancedMachineFeatures" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_confidentialInstanceConfig": { + "oneof": [ + "confidentialInstanceConfig" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_privateIpv6GoogleAccess": { + "oneof": [ + "privateIpv6GoogleAccess" + ] + }, + "_reservationAffinity": { + "oneof": [ + "reservationAffinity" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_shieldedInstanceConfig": { + "oneof": [ + "shieldedInstanceConfig" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + } + }, + "fields": { + "advancedMachineFeatures": { + "type": "AdvancedMachineFeatures", + "id": 409646002, + "options": { + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 467731324, + "options": { + "proto3_optional": true + } + }, + "confidentialInstanceConfig": { + "type": "ConfidentialInstanceConfig", + "id": 490637685, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 95594102 + }, + "guestAccelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 463595119 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "machineType": { + "type": "string", + "id": 227711026, + "options": { + "proto3_optional": true + } + }, + "metadata": { + "type": "Metadata", + "id": 86866735, + "options": { + "proto3_optional": true + } + }, + "minCpuPlatform": { + "type": "string", + "id": 242912759, + "options": { + "proto3_optional": true + } + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 52735243 + }, + "privateIpv6GoogleAccess": { + "type": "PrivateIpv6GoogleAccess", + "id": 48277006, + "options": { + "proto3_optional": true + } + }, + "reservationAffinity": { + "type": "ReservationAffinity", + "id": 157850683, + "options": { + "proto3_optional": true + } + }, + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + }, + "scheduling": { + "type": "Scheduling", + "id": 386688404, + "options": { + "proto3_optional": true + } + }, + "serviceAccounts": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 277537328 + }, + "shieldedInstanceConfig": { + "type": "ShieldedInstanceConfig", + "id": 12862901, + "options": { + "proto3_optional": true + } + }, + "tags": { + "type": "Tags", + "id": 3552281, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PrivateIpv6GoogleAccess": { + "values": { + "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS": 0, + "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": 427975994, + "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": 288210263, + "INHERIT_FROM_SUBNETWORK": 530256959 + } + } + } + }, + "LocationPolicy": { + "fields": { + "locations": { + "keyType": "string", + "type": "LocationPolicyLocation", + "id": 413423454 + } + } + }, + "BulkInsertInstanceResourcePerInstanceProperties": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + } + } + }, + "BulkInsertInstanceResource": { + "oneofs": { + "_count": { + "oneof": [ + "count" + ] + }, + "_instanceProperties": { + "oneof": [ + "instanceProperties" + ] + }, + "_locationPolicy": { + "oneof": [ + "locationPolicy" + ] + }, + "_minCount": { + "oneof": [ + "minCount" + ] + }, + "_namePattern": { + "oneof": [ + "namePattern" + ] + }, + "_sourceInstanceTemplate": { + "oneof": [ + "sourceInstanceTemplate" + ] + } + }, + "fields": { + "count": { + "type": "int64", + "id": 94851343, + "options": { + "proto3_optional": true + } + }, + "instanceProperties": { + "type": "InstanceProperties", + "id": 215355165, + "options": { + "proto3_optional": true + } + }, + "locationPolicy": { + "type": "LocationPolicy", + "id": 465689852, + "options": { + "proto3_optional": true + } + }, + "minCount": { + "type": "int64", + "id": 523228386, + "options": { + "proto3_optional": true + } + }, + "namePattern": { + "type": "string", + "id": 413815260, + "options": { + "proto3_optional": true + } + }, + "perInstanceProperties": { + "keyType": "string", + "type": "BulkInsertInstanceResourcePerInstanceProperties", + "id": 108502267 + }, + "sourceInstanceTemplate": { + "type": "string", + "id": 332423616, + "options": { + "proto3_optional": true + } + } + } + }, + "CacheInvalidationRule": { + "oneofs": { + "_host": { + "oneof": [ + "host" + ] + }, + "_path": { + "oneof": [ + "path" + ] + } + }, + "fields": { + "host": { + "type": "string", + "id": 3208616, + "options": { + "proto3_optional": true + } + }, + "path": { + "type": "string", + "id": 3433509, + "options": { + "proto3_optional": true + } + } + } + }, + "LicenseResourceCommitment": { + "oneofs": { + "_amount": { + "oneof": [ + "amount" + ] + }, + "_coresPerLicense": { + "oneof": [ + "coresPerLicense" + ] + }, + "_license": { + "oneof": [ + "license" + ] + } + }, + "fields": { + "amount": { + "type": "int64", + "id": 196759640, + "options": { + "proto3_optional": true + } + }, + "coresPerLicense": { + "type": "string", + "id": 32482324, + "options": { + "proto3_optional": true + } + }, + "license": { + "type": "string", + "id": 166757441, + "options": { + "proto3_optional": true + } + } + } + }, + "Reservation": { + "oneofs": { + "_commitment": { + "oneof": [ + "commitment" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_specificReservation": { + "oneof": [ + "specificReservation" + ] + }, + "_specificReservationRequired": { + "oneof": [ + "specificReservationRequired" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "commitment": { + "type": "string", + "id": 482134805, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 480964267, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "specificReservation": { + "type": "AllocationSpecificSKUReservation", + "id": 404901951, + "options": { + "proto3_optional": true + } + }, + "specificReservationRequired": { + "type": "bool", + "id": 226550687, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "INVALID": 530283991, + "READY": 77848963, + "UPDATING": 494614342 + } + } + } + }, + "ResourceCommitment": { + "oneofs": { + "_acceleratorType": { + "oneof": [ + "acceleratorType" + ] + }, + "_amount": { + "oneof": [ + "amount" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "acceleratorType": { + "type": "string", + "id": 138031246, + "options": { + "proto3_optional": true + } + }, + "amount": { + "type": "int64", + "id": 196759640, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "ACCELERATOR": 429815371, + "LOCAL_SSD": 508934896, + "MEMORY": 123056385, + "UNSPECIFIED": 526786327, + "VCPU": 2628978 + } + } + } + }, + "Commitment": { + "oneofs": { + "_category": { + "oneof": [ + "category" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_endTimestamp": { + "oneof": [ + "endTimestamp" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_licenseResource": { + "oneof": [ + "licenseResource" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_plan": { + "oneof": [ + "plan" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_startTimestamp": { + "oneof": [ + "startTimestamp" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_statusMessage": { + "oneof": [ + "statusMessage" + ] + } + }, + "fields": { + "category": { + "type": "Category", + "id": 50511102, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "endTimestamp": { + "type": "string", + "id": 468096690, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "licenseResource": { + "type": "LicenseResourceCommitment", + "id": 437955148, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "plan": { + "type": "Plan", + "id": 3443497, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "reservations": { + "rule": "repeated", + "type": "Reservation", + "id": 399717927 + }, + "resources": { + "rule": "repeated", + "type": "ResourceCommitment", + "id": 164412965 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "startTimestamp": { + "type": "string", + "id": 83645817, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "statusMessage": { + "type": "string", + "id": 297428154, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Category": { + "values": { + "UNDEFINED_CATEGORY": 0, + "CATEGORY_UNSPECIFIED": 509189462, + "LICENSE": 347869217, + "MACHINE": 469553191 + } + }, + "Plan": { + "values": { + "UNDEFINED_PLAN": 0, + "INVALID": 530283991, + "THIRTY_SIX_MONTH": 266295942, + "TWELVE_MONTH": 173083962 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "ACTIVE": 314733318, + "CREATING": 455564985, + "EXPIRED": 482489093, + "NOT_YET_ACTIVE": 20607337 + } + } + } + }, + "CommitmentsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "commitments": { + "rule": "repeated", + "type": "Commitment", + "id": 450664446 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "CommitmentAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "CommitmentsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "CommitmentList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Commitment", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "Condition": { + "oneofs": { + "_iam": { + "oneof": [ + "iam" + ] + }, + "_op": { + "oneof": [ + "op" + ] + }, + "_svc": { + "oneof": [ + "svc" + ] + }, + "_sys": { + "oneof": [ + "sys" + ] + } + }, + "fields": { + "iam": { + "type": "string", + "id": 104021, + "options": { + "proto3_optional": true + } + }, + "op": { + "type": "string", + "id": 3553, + "options": { + "proto3_optional": true + } + }, + "svc": { + "type": "string", + "id": 114272, + "options": { + "proto3_optional": true + } + }, + "sys": { + "type": "string", + "id": 114381, + "options": { + "proto3_optional": true + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 249928994 + } + } + }, + "ConfidentialInstanceConfig": { + "oneofs": { + "_enableConfidentialCompute": { + "oneof": [ + "enableConfidentialCompute" + ] + } + }, + "fields": { + "enableConfidentialCompute": { + "type": "bool", + "id": 102135228, + "options": { + "proto3_optional": true + } + } + } + }, + "ConsistentHashLoadBalancerSettingsHttpCookie": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_path": { + "oneof": [ + "path" + ] + }, + "_ttl": { + "oneof": [ + "ttl" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "path": { + "type": "string", + "id": 3433509, + "options": { + "proto3_optional": true + } + }, + "ttl": { + "type": "Duration", + "id": 115180, + "options": { + "proto3_optional": true + } + } + } + }, + "CorsPolicy": { + "oneofs": { + "_allowCredentials": { + "oneof": [ + "allowCredentials" + ] + }, + "_disabled": { + "oneof": [ + "disabled" + ] + }, + "_maxAge": { + "oneof": [ + "maxAge" + ] + } + }, + "fields": { + "allowCredentials": { + "type": "bool", + "id": 481263366, + "options": { + "proto3_optional": true + } + }, + "allowHeaders": { + "rule": "repeated", + "type": "string", + "id": 45179024 + }, + "allowMethods": { + "rule": "repeated", + "type": "string", + "id": 205405372 + }, + "allowOriginRegexes": { + "rule": "repeated", + "type": "string", + "id": 215385810 + }, + "allowOrigins": { + "rule": "repeated", + "type": "string", + "id": 194914071 + }, + "disabled": { + "type": "bool", + "id": 270940796, + "options": { + "proto3_optional": true + } + }, + "exposeHeaders": { + "rule": "repeated", + "type": "string", + "id": 247604747 + }, + "maxAge": { + "type": "int32", + "id": 307559332, + "options": { + "proto3_optional": true + } + } + } + }, + "CustomerEncryptionKeyProtectedDisk": { + "oneofs": { + "_diskEncryptionKey": { + "oneof": [ + "diskEncryptionKey" + ] + }, + "_source": { + "oneof": [ + "source" + ] + } + }, + "fields": { + "diskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 271660677, + "options": { + "proto3_optional": true + } + }, + "source": { + "type": "string", + "id": 177235995, + "options": { + "proto3_optional": true + } + } + } + }, + "Disk": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_diskEncryptionKey": { + "oneof": [ + "diskEncryptionKey" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + }, + "_lastAttachTimestamp": { + "oneof": [ + "lastAttachTimestamp" + ] + }, + "_lastDetachTimestamp": { + "oneof": [ + "lastDetachTimestamp" + ] + }, + "_locationHint": { + "oneof": [ + "locationHint" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_options": { + "oneof": [ + "options" + ] + }, + "_physicalBlockSizeBytes": { + "oneof": [ + "physicalBlockSizeBytes" + ] + }, + "_provisionedIops": { + "oneof": [ + "provisionedIops" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_sizeGb": { + "oneof": [ + "sizeGb" + ] + }, + "_sourceDisk": { + "oneof": [ + "sourceDisk" + ] + }, + "_sourceDiskId": { + "oneof": [ + "sourceDiskId" + ] + }, + "_sourceImage": { + "oneof": [ + "sourceImage" + ] + }, + "_sourceImageEncryptionKey": { + "oneof": [ + "sourceImageEncryptionKey" + ] + }, + "_sourceImageId": { + "oneof": [ + "sourceImageId" + ] + }, + "_sourceSnapshot": { + "oneof": [ + "sourceSnapshot" + ] + }, + "_sourceSnapshotEncryptionKey": { + "oneof": [ + "sourceSnapshotEncryptionKey" + ] + }, + "_sourceSnapshotId": { + "oneof": [ + "sourceSnapshotId" + ] + }, + "_sourceStorageObject": { + "oneof": [ + "sourceStorageObject" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_type": { + "oneof": [ + "type" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "diskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 271660677, + "options": { + "proto3_optional": true + } + }, + "guestOsFeatures": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 79294545 + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "lastAttachTimestamp": { + "type": "string", + "id": 42159653, + "options": { + "proto3_optional": true + } + }, + "lastDetachTimestamp": { + "type": "string", + "id": 56471027, + "options": { + "proto3_optional": true + } + }, + "licenseCodes": { + "rule": "repeated", + "type": "int64", + "id": 45482664 + }, + "licenses": { + "rule": "repeated", + "type": "string", + "id": 337642578 + }, + "locationHint": { + "type": "string", + "id": 350519505, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "options": { + "type": "string", + "id": 361137822, + "options": { + "proto3_optional": true + } + }, + "physicalBlockSizeBytes": { + "type": "int64", + "id": 420007943, + "options": { + "proto3_optional": true + } + }, + "provisionedIops": { + "type": "int64", + "id": 186769108, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "replicaZones": { + "rule": "repeated", + "type": "string", + "id": 48438272 + }, + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + }, + "satisfiesPzs": { + "type": "bool", + "id": 480964267, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sizeGb": { + "type": "int64", + "id": 494929369, + "options": { + "proto3_optional": true + } + }, + "sourceDisk": { + "type": "string", + "id": 451753793, + "options": { + "proto3_optional": true + } + }, + "sourceDiskId": { + "type": "string", + "id": 454190809, + "options": { + "proto3_optional": true + } + }, + "sourceImage": { + "type": "string", + "id": 50443319, + "options": { + "proto3_optional": true + } + }, + "sourceImageEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 381503659, + "options": { + "proto3_optional": true + } + }, + "sourceImageId": { + "type": "string", + "id": 55328291, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshot": { + "type": "string", + "id": 126061928, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshotEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 303679322, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshotId": { + "type": "string", + "id": 98962258, + "options": { + "proto3_optional": true + } + }, + "sourceStorageObject": { + "type": "string", + "id": 233052711, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "string", + "id": 3575610, + "options": { + "proto3_optional": true + } + }, + "users": { + "rule": "repeated", + "type": "string", + "id": 111578632 + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "FAILED": 455706685, + "READY": 77848963, + "RESTORING": 404263851 + } + } + } + }, + "DisksScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "disks": { + "rule": "repeated", + "type": "Disk", + "id": 95594102 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "DiskAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "DisksScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "DiskInstantiationConfig": { + "oneofs": { + "_autoDelete": { + "oneof": [ + "autoDelete" + ] + }, + "_customImage": { + "oneof": [ + "customImage" + ] + }, + "_deviceName": { + "oneof": [ + "deviceName" + ] + }, + "_instantiateFrom": { + "oneof": [ + "instantiateFrom" + ] + } + }, + "fields": { + "autoDelete": { + "type": "bool", + "id": 464761403, + "options": { + "proto3_optional": true + } + }, + "customImage": { + "type": "string", + "id": 184123149, + "options": { + "proto3_optional": true + } + }, + "deviceName": { + "type": "string", + "id": 67541716, + "options": { + "proto3_optional": true + } + }, + "instantiateFrom": { + "type": "InstantiateFrom", + "id": 393383903, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "InstantiateFrom": { + "values": { + "UNDEFINED_INSTANTIATE_FROM": 0, + "ATTACH_READ_ONLY": 513775419, + "BLANK": 63281460, + "CUSTOM_IMAGE": 196311789, + "DEFAULT": 115302945, + "DO_NOT_INCLUDE": 104218952, + "SOURCE_IMAGE": 62631959, + "SOURCE_IMAGE_FAMILY": 76850316 + } + } + } + }, + "DiskList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Disk", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "DiskMoveRequest": { + "oneofs": { + "_destinationZone": { + "oneof": [ + "destinationZone" + ] + }, + "_targetDisk": { + "oneof": [ + "targetDisk" + ] + } + }, + "fields": { + "destinationZone": { + "type": "string", + "id": 131854653, + "options": { + "proto3_optional": true + } + }, + "targetDisk": { + "type": "string", + "id": 62433163, + "options": { + "proto3_optional": true + } + } + } + }, + "DiskType": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_defaultDiskSizeGb": { + "oneof": [ + "defaultDiskSizeGb" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_validDiskSize": { + "oneof": [ + "validDiskSize" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "defaultDiskSizeGb": { + "type": "int64", + "id": 270619253, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "DeprecationStatus", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "validDiskSize": { + "type": "string", + "id": 493962464, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + } + }, + "DiskTypesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "diskTypes": { + "rule": "repeated", + "type": "DiskType", + "id": 198926167 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "DiskTypeAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "DiskTypesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "DiskTypeList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "DiskType", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "DisksAddResourcePoliciesRequest": { + "fields": { + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + } + } + }, + "DisksRemoveResourcePoliciesRequest": { + "fields": { + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + } + } + }, + "DisksResizeRequest": { + "oneofs": { + "_sizeGb": { + "oneof": [ + "sizeGb" + ] + } + }, + "fields": { + "sizeGb": { + "type": "int64", + "id": 494929369, + "options": { + "proto3_optional": true + } + } + } + }, + "DisplayDevice": { + "oneofs": { + "_enableDisplay": { + "oneof": [ + "enableDisplay" + ] + } + }, + "fields": { + "enableDisplay": { + "type": "bool", + "id": 14266886, + "options": { + "proto3_optional": true + } + } + } + }, + "DistributionPolicyZoneConfiguration": { + "oneofs": { + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + } + }, + "DistributionPolicy": { + "oneofs": { + "_targetShape": { + "oneof": [ + "targetShape" + ] + } + }, + "fields": { + "targetShape": { + "type": "TargetShape", + "id": 338621299, + "options": { + "proto3_optional": true + } + }, + "zones": { + "rule": "repeated", + "type": "DistributionPolicyZoneConfiguration", + "id": 116085319 + } + }, + "nested": { + "TargetShape": { + "values": { + "UNDEFINED_TARGET_SHAPE": 0, + "ANY": 64972, + "BALANCED": 468409608, + "EVEN": 2140442 + } + } + } + }, + "ExchangedPeeringRoute": { + "oneofs": { + "_destRange": { + "oneof": [ + "destRange" + ] + }, + "_imported": { + "oneof": [ + "imported" + ] + }, + "_nextHopRegion": { + "oneof": [ + "nextHopRegion" + ] + }, + "_priority": { + "oneof": [ + "priority" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "destRange": { + "type": "string", + "id": 381327712, + "options": { + "proto3_optional": true + } + }, + "imported": { + "type": "bool", + "id": 114502404, + "options": { + "proto3_optional": true + } + }, + "nextHopRegion": { + "type": "string", + "id": 122577014, + "options": { + "proto3_optional": true + } + }, + "priority": { + "type": "uint32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "DYNAMIC_PEERING_ROUTE": 469794858, + "STATIC_PEERING_ROUTE": 473407545, + "SUBNET_PEERING_ROUTE": 465782504 + } + } + } + }, + "ExchangedPeeringRoutesList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "ExchangedPeeringRoute", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ExternalVpnGatewayInterface": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + } + }, + "fields": { + "id": { + "type": "uint32", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 406272220, + "options": { + "proto3_optional": true + } + } + } + }, + "ExternalVpnGateway": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_redundancyType": { + "oneof": [ + "redundancyType" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "interfaces": { + "rule": "repeated", + "type": "ExternalVpnGatewayInterface", + "id": 12073562 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "redundancyType": { + "type": "RedundancyType", + "id": 271443740, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "RedundancyType": { + "values": { + "UNDEFINED_REDUNDANCY_TYPE": 0, + "FOUR_IPS_REDUNDANCY": 520087913, + "SINGLE_IP_INTERNALLY_REDUNDANT": 133914873, + "TWO_IPS_REDUNDANCY": 367049635 + } + } + } + }, + "ExternalVpnGatewayList": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "ExternalVpnGateway", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "FileContentBuffer": { + "oneofs": { + "_content": { + "oneof": [ + "content" + ] + }, + "_fileType": { + "oneof": [ + "fileType" + ] + } + }, + "fields": { + "content": { + "type": "string", + "id": 414659705, + "options": { + "proto3_optional": true + } + }, + "fileType": { + "type": "FileType", + "id": 294346781, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "FileType": { + "values": { + "UNDEFINED_FILE_TYPE": 0, + "BIN": 65767, + "UNDEFINED": 137851184, + "X509": 2674086 + } + } + } + }, + "Allowed": { + "oneofs": { + "_IPProtocol": { + "oneof": [ + "IPProtocol" + ] + } + }, + "fields": { + "IPProtocol": { + "type": "string", + "id": 488094525, + "options": { + "proto3_optional": true + } + }, + "ports": { + "rule": "repeated", + "type": "string", + "id": 106854418 + } + } + }, + "Denied": { + "oneofs": { + "_IPProtocol": { + "oneof": [ + "IPProtocol" + ] + } + }, + "fields": { + "IPProtocol": { + "type": "string", + "id": 488094525, + "options": { + "proto3_optional": true + } + }, + "ports": { + "rule": "repeated", + "type": "string", + "id": 106854418 + } + } + }, + "FirewallLogConfig": { + "oneofs": { + "_enable": { + "oneof": [ + "enable" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + } + }, + "fields": { + "enable": { + "type": "bool", + "id": 311764355, + "options": { + "proto3_optional": true + } + }, + "metadata": { + "type": "Metadata", + "id": 86866735, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Metadata": { + "values": { + "UNDEFINED_METADATA": 0, + "EXCLUDE_ALL_METADATA": 334519954, + "INCLUDE_ALL_METADATA": 164619908 + } + } + } + }, + "Firewall": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_direction": { + "oneof": [ + "direction" + ] + }, + "_disabled": { + "oneof": [ + "disabled" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_logConfig": { + "oneof": [ + "logConfig" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_priority": { + "oneof": [ + "priority" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "allowed": { + "rule": "repeated", + "type": "Allowed", + "id": 162398632 + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "denied": { + "rule": "repeated", + "type": "Denied", + "id": 275217307 + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "destinationRanges": { + "rule": "repeated", + "type": "string", + "id": 305699879 + }, + "direction": { + "type": "Direction", + "id": 111150975, + "options": { + "proto3_optional": true + } + }, + "disabled": { + "type": "bool", + "id": 270940796, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "logConfig": { + "type": "FirewallLogConfig", + "id": 351299741, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sourceRanges": { + "rule": "repeated", + "type": "string", + "id": 200097658 + }, + "sourceServiceAccounts": { + "rule": "repeated", + "type": "string", + "id": 105100756 + }, + "sourceTags": { + "rule": "repeated", + "type": "string", + "id": 452222397 + }, + "targetServiceAccounts": { + "rule": "repeated", + "type": "string", + "id": 457639710 + }, + "targetTags": { + "rule": "repeated", + "type": "string", + "id": 62901767 + } + }, + "nested": { + "Direction": { + "values": { + "UNDEFINED_DIRECTION": 0, + "EGRESS": 432880501, + "INGRESS": 516931221 + } + } + } + }, + "FirewallList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Firewall", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "FirewallPolicyAssociation": { + "oneofs": { + "_attachmentTarget": { + "oneof": [ + "attachmentTarget" + ] + }, + "_displayName": { + "oneof": [ + "displayName" + ] + }, + "_firewallPolicyId": { + "oneof": [ + "firewallPolicyId" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_shortName": { + "oneof": [ + "shortName" + ] + } + }, + "fields": { + "attachmentTarget": { + "type": "string", + "id": 175773741, + "options": { + "proto3_optional": true + } + }, + "displayName": { + "type": "string", + "id": 4473832, + "options": { + "proto3_optional": true + } + }, + "firewallPolicyId": { + "type": "string", + "id": 357211849, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "shortName": { + "type": "string", + "id": 492051566, + "options": { + "proto3_optional": true + } + } + } + }, + "FirewallPoliciesListAssociationsResponse": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + } + }, + "fields": { + "associations": { + "rule": "repeated", + "type": "FirewallPolicyAssociation", + "id": 508736530 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + } + } + }, + "FirewallPolicyRule": { + "oneofs": { + "_action": { + "oneof": [ + "action" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_direction": { + "oneof": [ + "direction" + ] + }, + "_disabled": { + "oneof": [ + "disabled" + ] + }, + "_enableLogging": { + "oneof": [ + "enableLogging" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_match": { + "oneof": [ + "match" + ] + }, + "_priority": { + "oneof": [ + "priority" + ] + }, + "_ruleTupleCount": { + "oneof": [ + "ruleTupleCount" + ] + } + }, + "fields": { + "action": { + "type": "string", + "id": 187661878, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "direction": { + "type": "Direction", + "id": 111150975, + "options": { + "proto3_optional": true + } + }, + "disabled": { + "type": "bool", + "id": 270940796, + "options": { + "proto3_optional": true + } + }, + "enableLogging": { + "type": "bool", + "id": 295396515, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "match": { + "type": "FirewallPolicyRuleMatcher", + "id": 103668165, + "options": { + "proto3_optional": true + } + }, + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "ruleTupleCount": { + "type": "int32", + "id": 388342037, + "options": { + "proto3_optional": true + } + }, + "targetResources": { + "rule": "repeated", + "type": "string", + "id": 528230647 + }, + "targetServiceAccounts": { + "rule": "repeated", + "type": "string", + "id": 457639710 + } + }, + "nested": { + "Direction": { + "values": { + "UNDEFINED_DIRECTION": 0, + "EGRESS": 432880501, + "INGRESS": 516931221 + } + } + } + }, + "FirewallPolicy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_displayName": { + "oneof": [ + "displayName" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_parent": { + "oneof": [ + "parent" + ] + }, + "_ruleTupleCount": { + "oneof": [ + "ruleTupleCount" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_selfLinkWithId": { + "oneof": [ + "selfLinkWithId" + ] + }, + "_shortName": { + "oneof": [ + "shortName" + ] + } + }, + "fields": { + "associations": { + "rule": "repeated", + "type": "FirewallPolicyAssociation", + "id": 508736530 + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "displayName": { + "type": "string", + "id": 4473832, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "parent": { + "type": "string", + "id": 78317738, + "options": { + "proto3_optional": true + } + }, + "ruleTupleCount": { + "type": "int32", + "id": 388342037, + "options": { + "proto3_optional": true + } + }, + "rules": { + "rule": "repeated", + "type": "FirewallPolicyRule", + "id": 108873975 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "selfLinkWithId": { + "type": "string", + "id": 44520962, + "options": { + "proto3_optional": true + } + }, + "shortName": { + "type": "string", + "id": 492051566, + "options": { + "proto3_optional": true + } + } + } + }, + "FirewallPolicyList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "FirewallPolicy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "FirewallPolicyRuleMatcher": { + "fields": { + "destIpRanges": { + "rule": "repeated", + "type": "string", + "id": 337357713 + }, + "layer4Configs": { + "rule": "repeated", + "type": "FirewallPolicyRuleMatcherLayer4Config", + "id": 373534261 + }, + "srcIpRanges": { + "rule": "repeated", + "type": "string", + "id": 432128083 + } + } + }, + "FirewallPolicyRuleMatcherLayer4Config": { + "oneofs": { + "_ipProtocol": { + "oneof": [ + "ipProtocol" + ] + } + }, + "fields": { + "ipProtocol": { + "type": "string", + "id": 475958960, + "options": { + "proto3_optional": true + } + }, + "ports": { + "rule": "repeated", + "type": "string", + "id": 106854418 + } + } + }, + "MetadataFilter": { + "oneofs": { + "_filterMatchCriteria": { + "oneof": [ + "filterMatchCriteria" + ] + } + }, + "fields": { + "filterLabels": { + "rule": "repeated", + "type": "MetadataFilterLabelMatch", + "id": 307903142 + }, + "filterMatchCriteria": { + "type": "FilterMatchCriteria", + "id": 239970368, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "FilterMatchCriteria": { + "values": { + "UNDEFINED_FILTER_MATCH_CRITERIA": 0, + "MATCH_ALL": 180663271, + "MATCH_ANY": 180663346, + "NOT_SET": 163646646 + } + } + } + }, + "ForwardingRuleServiceDirectoryRegistration": { + "oneofs": { + "_namespace": { + "oneof": [ + "namespace" + ] + }, + "_service": { + "oneof": [ + "service" + ] + }, + "_serviceDirectoryRegion": { + "oneof": [ + "serviceDirectoryRegion" + ] + } + }, + "fields": { + "namespace": { + "type": "string", + "id": 178476379, + "options": { + "proto3_optional": true + } + }, + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + }, + "serviceDirectoryRegion": { + "type": "string", + "id": 74030416, + "options": { + "proto3_optional": true + } + } + } + }, + "ForwardingRule": { + "oneofs": { + "_IPAddress": { + "oneof": [ + "IPAddress" + ] + }, + "_IPProtocol": { + "oneof": [ + "IPProtocol" + ] + }, + "_allPorts": { + "oneof": [ + "allPorts" + ] + }, + "_allowGlobalAccess": { + "oneof": [ + "allowGlobalAccess" + ] + }, + "_backendService": { + "oneof": [ + "backendService" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_ipVersion": { + "oneof": [ + "ipVersion" + ] + }, + "_isMirroringCollector": { + "oneof": [ + "isMirroringCollector" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + }, + "_loadBalancingScheme": { + "oneof": [ + "loadBalancingScheme" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_networkTier": { + "oneof": [ + "networkTier" + ] + }, + "_portRange": { + "oneof": [ + "portRange" + ] + }, + "_pscConnectionId": { + "oneof": [ + "pscConnectionId" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_serviceLabel": { + "oneof": [ + "serviceLabel" + ] + }, + "_serviceName": { + "oneof": [ + "serviceName" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + }, + "_target": { + "oneof": [ + "target" + ] + } + }, + "fields": { + "IPAddress": { + "type": "string", + "id": 42976943, + "options": { + "proto3_optional": true + } + }, + "IPProtocol": { + "type": "IPProtocol_", + "id": 488094525, + "options": { + "proto3_optional": true + } + }, + "allPorts": { + "type": "bool", + "id": 445175796, + "options": { + "proto3_optional": true + } + }, + "allowGlobalAccess": { + "type": "bool", + "id": 499409674, + "options": { + "proto3_optional": true + } + }, + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "ipVersion": { + "type": "IpVersion", + "id": 294959552, + "options": { + "proto3_optional": true + } + }, + "isMirroringCollector": { + "type": "bool", + "id": 119255164, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "loadBalancingScheme": { + "type": "LoadBalancingScheme", + "id": 363890244, + "options": { + "proto3_optional": true + } + }, + "metadataFilters": { + "rule": "repeated", + "type": "MetadataFilter", + "id": 464725739 + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "networkTier": { + "type": "NetworkTier", + "id": 517397843, + "options": { + "proto3_optional": true + } + }, + "portRange": { + "type": "string", + "id": 217518079, + "options": { + "proto3_optional": true + } + }, + "ports": { + "rule": "repeated", + "type": "string", + "id": 106854418 + }, + "pscConnectionId": { + "type": "uint64", + "id": 292082397, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "serviceDirectoryRegistrations": { + "rule": "repeated", + "type": "ForwardingRuleServiceDirectoryRegistration", + "id": 223549694 + }, + "serviceLabel": { + "type": "string", + "id": 417008874, + "options": { + "proto3_optional": true + } + }, + "serviceName": { + "type": "string", + "id": 359880149, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "proto3_optional": true + } + }, + "target": { + "type": "string", + "id": 192835985, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "IPProtocol_": { + "values": { + "UNDEFINED_I_P_PROTOCOL": 0, + "AH": 2087, + "ESP": 68962, + "ICMP": 2241597, + "SCTP": 2539724, + "TCP": 82881, + "UDP": 83873 + } + }, + "IpVersion": { + "values": { + "UNDEFINED_IP_VERSION": 0, + "IPV4": 2254341, + "IPV6": 2254343, + "UNSPECIFIED_VERSION": 21850000 + } + }, + "LoadBalancingScheme": { + "values": { + "UNDEFINED_LOAD_BALANCING_SCHEME": 0, + "EXTERNAL": 35607499, + "INTERNAL": 279295677, + "INTERNAL_MANAGED": 37350397, + "INTERNAL_SELF_MANAGED": 236211150, + "INVALID": 530283991 + } + }, + "NetworkTier": { + "values": { + "UNDEFINED_NETWORK_TIER": 0, + "PREMIUM": 399530551, + "STANDARD": 484642493 + } + } + } + }, + "ForwardingRulesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "forwardingRules": { + "rule": "repeated", + "type": "ForwardingRule", + "id": 315821365 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ForwardingRuleAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "ForwardingRulesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ForwardingRuleList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "ForwardingRule", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ForwardingRuleReference": { + "oneofs": { + "_forwardingRule": { + "oneof": [ + "forwardingRule" + ] + } + }, + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "proto3_optional": true + } + } + } + }, + "GRPCHealthCheck": { + "oneofs": { + "_grpcServiceName": { + "oneof": [ + "grpcServiceName" + ] + }, + "_port": { + "oneof": [ + "port" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + }, + "_portSpecification": { + "oneof": [ + "portSpecification" + ] + } + }, + "fields": { + "grpcServiceName": { + "type": "string", + "id": 136533078, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + }, + "portSpecification": { + "type": "PortSpecification", + "id": 51590597, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PortSpecification": { + "values": { + "UNDEFINED_PORT_SPECIFICATION": 0, + "USE_FIXED_PORT": 190235748, + "USE_NAMED_PORT": 349300671, + "USE_SERVING_PORT": 362637516 + } + } + } + }, + "NetworkEndpoint": { + "oneofs": { + "_fqdn": { + "oneof": [ + "fqdn" + ] + }, + "_instance": { + "oneof": [ + "instance" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_port": { + "oneof": [ + "port" + ] + } + }, + "fields": { + "annotations": { + "keyType": "string", + "type": "string", + "id": 112032548 + }, + "fqdn": { + "type": "string", + "id": 3150485, + "options": { + "proto3_optional": true + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 406272220, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + } + } + }, + "GlobalNetworkEndpointGroupsAttachEndpointsRequest": { + "fields": { + "networkEndpoints": { + "rule": "repeated", + "type": "NetworkEndpoint", + "id": 149850285 + } + } + }, + "GlobalNetworkEndpointGroupsDetachEndpointsRequest": { + "fields": { + "networkEndpoints": { + "rule": "repeated", + "type": "NetworkEndpoint", + "id": 149850285 + } + } + }, + "Policy": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_iamOwned": { + "oneof": [ + "iamOwned" + ] + }, + "_version": { + "oneof": [ + "version" + ] + } + }, + "fields": { + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 328080653 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 403251854 + }, + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "iamOwned": { + "type": "bool", + "id": 450566203, + "options": { + "proto3_optional": true + } + }, + "rules": { + "rule": "repeated", + "type": "Rule", + "id": 108873975 + }, + "version": { + "type": "int32", + "id": 351608024, + "options": { + "proto3_optional": true + } + } + } + }, + "GlobalOrganizationSetPolicyRequest": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_policy": { + "oneof": [ + "policy" + ] + } + }, + "fields": { + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 403251854 + }, + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "policy": { + "type": "Policy", + "id": 91071794, + "options": { + "proto3_optional": true + } + } + } + }, + "GlobalSetLabelsRequest": { + "oneofs": { + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + } + }, + "fields": { + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + } + } + }, + "GlobalSetPolicyRequest": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_policy": { + "oneof": [ + "policy" + ] + } + }, + "fields": { + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 403251854 + }, + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "policy": { + "type": "Policy", + "id": 91071794, + "options": { + "proto3_optional": true + } + } + } + }, + "GuestAttributesValue": { + "fields": { + "items": { + "rule": "repeated", + "type": "GuestAttributesEntry", + "id": 100526016 + } + } + }, + "GuestAttributes": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + }, + "_queryPath": { + "oneof": [ + "queryPath" + ] + }, + "_queryValue": { + "oneof": [ + "queryValue" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_variableKey": { + "oneof": [ + "variableKey" + ] + }, + "_variableValue": { + "oneof": [ + "variableValue" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "queryPath": { + "type": "string", + "id": 368591164, + "options": { + "proto3_optional": true + } + }, + "queryValue": { + "type": "GuestAttributesValue", + "id": 157570874, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "variableKey": { + "type": "string", + "id": 164364828, + "options": { + "proto3_optional": true + } + }, + "variableValue": { + "type": "string", + "id": 124582382, + "options": { + "proto3_optional": true + } + } + } + }, + "GuestAttributesEntry": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_namespace": { + "oneof": [ + "namespace" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 106079, + "options": { + "proto3_optional": true + } + }, + "namespace": { + "type": "string", + "id": 178476379, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 111972721, + "options": { + "proto3_optional": true + } + } + } + }, + "HTTP2HealthCheck": { + "oneofs": { + "_host": { + "oneof": [ + "host" + ] + }, + "_port": { + "oneof": [ + "port" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + }, + "_portSpecification": { + "oneof": [ + "portSpecification" + ] + }, + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + }, + "_requestPath": { + "oneof": [ + "requestPath" + ] + }, + "_response": { + "oneof": [ + "response" + ] + } + }, + "fields": { + "host": { + "type": "string", + "id": 3208616, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + }, + "portSpecification": { + "type": "PortSpecification", + "id": 51590597, + "options": { + "proto3_optional": true + } + }, + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + }, + "requestPath": { + "type": "string", + "id": 229403605, + "options": { + "proto3_optional": true + } + }, + "response": { + "type": "string", + "id": 196547649, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PortSpecification": { + "values": { + "UNDEFINED_PORT_SPECIFICATION": 0, + "USE_FIXED_PORT": 190235748, + "USE_NAMED_PORT": 349300671, + "USE_SERVING_PORT": 362637516 + } + }, + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "HTTPHealthCheck": { + "oneofs": { + "_host": { + "oneof": [ + "host" + ] + }, + "_port": { + "oneof": [ + "port" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + }, + "_portSpecification": { + "oneof": [ + "portSpecification" + ] + }, + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + }, + "_requestPath": { + "oneof": [ + "requestPath" + ] + }, + "_response": { + "oneof": [ + "response" + ] + } + }, + "fields": { + "host": { + "type": "string", + "id": 3208616, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + }, + "portSpecification": { + "type": "PortSpecification", + "id": 51590597, + "options": { + "proto3_optional": true + } + }, + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + }, + "requestPath": { + "type": "string", + "id": 229403605, + "options": { + "proto3_optional": true + } + }, + "response": { + "type": "string", + "id": 196547649, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PortSpecification": { + "values": { + "UNDEFINED_PORT_SPECIFICATION": 0, + "USE_FIXED_PORT": 190235748, + "USE_NAMED_PORT": 349300671, + "USE_SERVING_PORT": 362637516 + } + }, + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "HTTPSHealthCheck": { + "oneofs": { + "_host": { + "oneof": [ + "host" + ] + }, + "_port": { + "oneof": [ + "port" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + }, + "_portSpecification": { + "oneof": [ + "portSpecification" + ] + }, + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + }, + "_requestPath": { + "oneof": [ + "requestPath" + ] + }, + "_response": { + "oneof": [ + "response" + ] + } + }, + "fields": { + "host": { + "type": "string", + "id": 3208616, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + }, + "portSpecification": { + "type": "PortSpecification", + "id": 51590597, + "options": { + "proto3_optional": true + } + }, + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + }, + "requestPath": { + "type": "string", + "id": 229403605, + "options": { + "proto3_optional": true + } + }, + "response": { + "type": "string", + "id": 196547649, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PortSpecification": { + "values": { + "UNDEFINED_PORT_SPECIFICATION": 0, + "USE_FIXED_PORT": 190235748, + "USE_NAMED_PORT": 349300671, + "USE_SERVING_PORT": 362637516 + } + }, + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "HealthCheckLogConfig": { + "oneofs": { + "_enable": { + "oneof": [ + "enable" + ] + } + }, + "fields": { + "enable": { + "type": "bool", + "id": 311764355, + "options": { + "proto3_optional": true + } + } + } + }, + "SSLHealthCheck": { + "oneofs": { + "_port": { + "oneof": [ + "port" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + }, + "_portSpecification": { + "oneof": [ + "portSpecification" + ] + }, + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + }, + "_request": { + "oneof": [ + "request" + ] + }, + "_response": { + "oneof": [ + "response" + ] + } + }, + "fields": { + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + }, + "portSpecification": { + "type": "PortSpecification", + "id": 51590597, + "options": { + "proto3_optional": true + } + }, + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + }, + "request": { + "type": "string", + "id": 21951119, + "options": { + "proto3_optional": true + } + }, + "response": { + "type": "string", + "id": 196547649, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PortSpecification": { + "values": { + "UNDEFINED_PORT_SPECIFICATION": 0, + "USE_FIXED_PORT": 190235748, + "USE_NAMED_PORT": 349300671, + "USE_SERVING_PORT": 362637516 + } + }, + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "TCPHealthCheck": { + "oneofs": { + "_port": { + "oneof": [ + "port" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + }, + "_portSpecification": { + "oneof": [ + "portSpecification" + ] + }, + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + }, + "_request": { + "oneof": [ + "request" + ] + }, + "_response": { + "oneof": [ + "response" + ] + } + }, + "fields": { + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + }, + "portSpecification": { + "type": "PortSpecification", + "id": 51590597, + "options": { + "proto3_optional": true + } + }, + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + }, + "request": { + "type": "string", + "id": 21951119, + "options": { + "proto3_optional": true + } + }, + "response": { + "type": "string", + "id": 196547649, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PortSpecification": { + "values": { + "UNDEFINED_PORT_SPECIFICATION": 0, + "USE_FIXED_PORT": 190235748, + "USE_NAMED_PORT": 349300671, + "USE_SERVING_PORT": 362637516 + } + }, + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "HealthCheck": { + "oneofs": { + "_checkIntervalSec": { + "oneof": [ + "checkIntervalSec" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_grpcHealthCheck": { + "oneof": [ + "grpcHealthCheck" + ] + }, + "_healthyThreshold": { + "oneof": [ + "healthyThreshold" + ] + }, + "_http2HealthCheck": { + "oneof": [ + "http2HealthCheck" + ] + }, + "_httpHealthCheck": { + "oneof": [ + "httpHealthCheck" + ] + }, + "_httpsHealthCheck": { + "oneof": [ + "httpsHealthCheck" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_logConfig": { + "oneof": [ + "logConfig" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_sslHealthCheck": { + "oneof": [ + "sslHealthCheck" + ] + }, + "_tcpHealthCheck": { + "oneof": [ + "tcpHealthCheck" + ] + }, + "_timeoutSec": { + "oneof": [ + "timeoutSec" + ] + }, + "_type": { + "oneof": [ + "type" + ] + }, + "_unhealthyThreshold": { + "oneof": [ + "unhealthyThreshold" + ] + } + }, + "fields": { + "checkIntervalSec": { + "type": "int32", + "id": 345561006, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "grpcHealthCheck": { + "type": "GRPCHealthCheck", + "id": 85529574, + "options": { + "proto3_optional": true + } + }, + "healthyThreshold": { + "type": "int32", + "id": 403212361, + "options": { + "proto3_optional": true + } + }, + "http2HealthCheck": { + "type": "HTTP2HealthCheck", + "id": 11360986, + "options": { + "proto3_optional": true + } + }, + "httpHealthCheck": { + "type": "HTTPHealthCheck", + "id": 412586940, + "options": { + "proto3_optional": true + } + }, + "httpsHealthCheck": { + "type": "HTTPSHealthCheck", + "id": 436046905, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "logConfig": { + "type": "HealthCheckLogConfig", + "id": 351299741, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sslHealthCheck": { + "type": "SSLHealthCheck", + "id": 280032440, + "options": { + "proto3_optional": true + } + }, + "tcpHealthCheck": { + "type": "TCPHealthCheck", + "id": 469980419, + "options": { + "proto3_optional": true + } + }, + "timeoutSec": { + "type": "int32", + "id": 79994995, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + }, + "unhealthyThreshold": { + "type": "int32", + "id": 227958480, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "GRPC": 2196510, + "HTTP": 2228360, + "HTTP2": 69079210, + "HTTPS": 69079243, + "INVALID": 530283991, + "SSL": 82412, + "TCP": 82881 + } + } + } + }, + "HealthCheckList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "HealthCheck", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "HealthCheckReference": { + "oneofs": { + "_healthCheck": { + "oneof": [ + "healthCheck" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "proto3_optional": true + } + } + } + }, + "HealthCheckService": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_healthStatusAggregationPolicy": { + "oneof": [ + "healthStatusAggregationPolicy" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "healthChecks": { + "rule": "repeated", + "type": "string", + "id": 448370606 + }, + "healthStatusAggregationPolicy": { + "type": "HealthStatusAggregationPolicy", + "id": 253163129, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "networkEndpointGroups": { + "rule": "repeated", + "type": "string", + "id": 29346733 + }, + "notificationEndpoints": { + "rule": "repeated", + "type": "string", + "id": 406728490 + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "HealthStatusAggregationPolicy": { + "values": { + "UNDEFINED_HEALTH_STATUS_AGGREGATION_POLICY": 0, + "AND": 64951, + "NO_AGGREGATION": 426445124 + } + } + } + }, + "HealthCheckServiceReference": { + "oneofs": { + "_healthCheckService": { + "oneof": [ + "healthCheckService" + ] + } + }, + "fields": { + "healthCheckService": { + "type": "string", + "id": 408374747, + "options": { + "proto3_optional": true + } + } + } + }, + "HealthCheckServicesList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "HealthCheckService", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "HealthChecksScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "healthChecks": { + "rule": "repeated", + "type": "HealthCheck", + "id": 448370606 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "HealthChecksAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "HealthChecksScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "HealthStatusForNetworkEndpoint": { + "oneofs": { + "_backendService": { + "oneof": [ + "backendService" + ] + }, + "_forwardingRule": { + "oneof": [ + "forwardingRule" + ] + }, + "_healthCheck": { + "oneof": [ + "healthCheck" + ] + }, + "_healthCheckService": { + "oneof": [ + "healthCheckService" + ] + }, + "_healthState": { + "oneof": [ + "healthState" + ] + } + }, + "fields": { + "backendService": { + "type": "BackendServiceReference", + "id": 306946058, + "options": { + "proto3_optional": true + } + }, + "forwardingRule": { + "type": "ForwardingRuleReference", + "id": 269964030, + "options": { + "proto3_optional": true + } + }, + "healthCheck": { + "type": "HealthCheckReference", + "id": 308876645, + "options": { + "proto3_optional": true + } + }, + "healthCheckService": { + "type": "HealthCheckServiceReference", + "id": 408374747, + "options": { + "proto3_optional": true + } + }, + "healthState": { + "type": "HealthState", + "id": 324007150, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "HealthState": { + "values": { + "UNDEFINED_HEALTH_STATE": 0, + "DRAINING": 480455402, + "HEALTHY": 439801213, + "UNHEALTHY": 462118084, + "UNKNOWN": 433141802 + } + } + } + }, + "HostRule": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_pathMatcher": { + "oneof": [ + "pathMatcher" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "hosts": { + "rule": "repeated", + "type": "string", + "id": 99467211 + }, + "pathMatcher": { + "type": "string", + "id": 337813272, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpFaultAbort": { + "oneofs": { + "_httpStatus": { + "oneof": [ + "httpStatus" + ] + }, + "_percentage": { + "oneof": [ + "percentage" + ] + } + }, + "fields": { + "httpStatus": { + "type": "uint32", + "id": 468949897, + "options": { + "proto3_optional": true + } + }, + "percentage": { + "type": "double", + "id": 151909018, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpFaultDelay": { + "oneofs": { + "_fixedDelay": { + "oneof": [ + "fixedDelay" + ] + }, + "_percentage": { + "oneof": [ + "percentage" + ] + } + }, + "fields": { + "fixedDelay": { + "type": "Duration", + "id": 317037816, + "options": { + "proto3_optional": true + } + }, + "percentage": { + "type": "double", + "id": 151909018, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpFaultInjection": { + "oneofs": { + "_abort": { + "oneof": [ + "abort" + ] + }, + "_delay": { + "oneof": [ + "delay" + ] + } + }, + "fields": { + "abort": { + "type": "HttpFaultAbort", + "id": 92611376, + "options": { + "proto3_optional": true + } + }, + "delay": { + "type": "HttpFaultDelay", + "id": 95467907, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpHeaderOption": { + "oneofs": { + "_headerName": { + "oneof": [ + "headerName" + ] + }, + "_headerValue": { + "oneof": [ + "headerValue" + ] + }, + "_replace": { + "oneof": [ + "replace" + ] + } + }, + "fields": { + "headerName": { + "type": "string", + "id": 110223613, + "options": { + "proto3_optional": true + } + }, + "headerValue": { + "type": "string", + "id": 203094335, + "options": { + "proto3_optional": true + } + }, + "replace": { + "type": "bool", + "id": 20755124, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpHeaderAction": { + "fields": { + "requestHeadersToAdd": { + "rule": "repeated", + "type": "HttpHeaderOption", + "id": 72111974 + }, + "requestHeadersToRemove": { + "rule": "repeated", + "type": "string", + "id": 218425247 + }, + "responseHeadersToAdd": { + "rule": "repeated", + "type": "HttpHeaderOption", + "id": 32136052 + }, + "responseHeadersToRemove": { + "rule": "repeated", + "type": "string", + "id": 75415761 + } + } + }, + "Int64RangeMatch": { + "oneofs": { + "_rangeEnd": { + "oneof": [ + "rangeEnd" + ] + }, + "_rangeStart": { + "oneof": [ + "rangeStart" + ] + } + }, + "fields": { + "rangeEnd": { + "type": "int64", + "id": 322439897, + "options": { + "proto3_optional": true + } + }, + "rangeStart": { + "type": "int64", + "id": 103333600, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpHeaderMatch": { + "oneofs": { + "_exactMatch": { + "oneof": [ + "exactMatch" + ] + }, + "_headerName": { + "oneof": [ + "headerName" + ] + }, + "_invertMatch": { + "oneof": [ + "invertMatch" + ] + }, + "_prefixMatch": { + "oneof": [ + "prefixMatch" + ] + }, + "_presentMatch": { + "oneof": [ + "presentMatch" + ] + }, + "_rangeMatch": { + "oneof": [ + "rangeMatch" + ] + }, + "_regexMatch": { + "oneof": [ + "regexMatch" + ] + }, + "_suffixMatch": { + "oneof": [ + "suffixMatch" + ] + } + }, + "fields": { + "exactMatch": { + "type": "string", + "id": 457641093, + "options": { + "proto3_optional": true + } + }, + "headerName": { + "type": "string", + "id": 110223613, + "options": { + "proto3_optional": true + } + }, + "invertMatch": { + "type": "bool", + "id": 501130268, + "options": { + "proto3_optional": true + } + }, + "prefixMatch": { + "type": "string", + "id": 257898968, + "options": { + "proto3_optional": true + } + }, + "presentMatch": { + "type": "bool", + "id": 67435841, + "options": { + "proto3_optional": true + } + }, + "rangeMatch": { + "type": "Int64RangeMatch", + "id": 97244227, + "options": { + "proto3_optional": true + } + }, + "regexMatch": { + "type": "string", + "id": 107387853, + "options": { + "proto3_optional": true + } + }, + "suffixMatch": { + "type": "string", + "id": 426488663, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpQueryParameterMatch": { + "oneofs": { + "_exactMatch": { + "oneof": [ + "exactMatch" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_presentMatch": { + "oneof": [ + "presentMatch" + ] + }, + "_regexMatch": { + "oneof": [ + "regexMatch" + ] + } + }, + "fields": { + "exactMatch": { + "type": "string", + "id": 457641093, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "presentMatch": { + "type": "bool", + "id": 67435841, + "options": { + "proto3_optional": true + } + }, + "regexMatch": { + "type": "string", + "id": 107387853, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpRedirectAction": { + "oneofs": { + "_hostRedirect": { + "oneof": [ + "hostRedirect" + ] + }, + "_httpsRedirect": { + "oneof": [ + "httpsRedirect" + ] + }, + "_pathRedirect": { + "oneof": [ + "pathRedirect" + ] + }, + "_prefixRedirect": { + "oneof": [ + "prefixRedirect" + ] + }, + "_redirectResponseCode": { + "oneof": [ + "redirectResponseCode" + ] + }, + "_stripQuery": { + "oneof": [ + "stripQuery" + ] + } + }, + "fields": { + "hostRedirect": { + "type": "string", + "id": 107417747, + "options": { + "proto3_optional": true + } + }, + "httpsRedirect": { + "type": "bool", + "id": 170260656, + "options": { + "proto3_optional": true + } + }, + "pathRedirect": { + "type": "string", + "id": 272342710, + "options": { + "proto3_optional": true + } + }, + "prefixRedirect": { + "type": "string", + "id": 446184169, + "options": { + "proto3_optional": true + } + }, + "redirectResponseCode": { + "type": "RedirectResponseCode", + "id": 436710408, + "options": { + "proto3_optional": true + } + }, + "stripQuery": { + "type": "bool", + "id": 52284641, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "RedirectResponseCode": { + "values": { + "UNDEFINED_REDIRECT_RESPONSE_CODE": 0, + "FOUND": 67084130, + "MOVED_PERMANENTLY_DEFAULT": 386698449, + "PERMANENT_REDIRECT": 382006381, + "SEE_OTHER": 445380580, + "TEMPORARY_REDIRECT": 489550378 + } + } + } + }, + "HttpRetryPolicy": { + "oneofs": { + "_numRetries": { + "oneof": [ + "numRetries" + ] + }, + "_perTryTimeout": { + "oneof": [ + "perTryTimeout" + ] + } + }, + "fields": { + "numRetries": { + "type": "uint32", + "id": 251680141, + "options": { + "proto3_optional": true + } + }, + "perTryTimeout": { + "type": "Duration", + "id": 280041147, + "options": { + "proto3_optional": true + } + }, + "retryConditions": { + "rule": "repeated", + "type": "string", + "id": 28815535 + } + } + }, + "RequestMirrorPolicy": { + "oneofs": { + "_backendService": { + "oneof": [ + "backendService" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlRewrite": { + "oneofs": { + "_hostRewrite": { + "oneof": [ + "hostRewrite" + ] + }, + "_pathPrefixRewrite": { + "oneof": [ + "pathPrefixRewrite" + ] + } + }, + "fields": { + "hostRewrite": { + "type": "string", + "id": 159819253, + "options": { + "proto3_optional": true + } + }, + "pathPrefixRewrite": { + "type": "string", + "id": 41186361, + "options": { + "proto3_optional": true + } + } + } + }, + "WeightedBackendService": { + "oneofs": { + "_backendService": { + "oneof": [ + "backendService" + ] + }, + "_headerAction": { + "oneof": [ + "headerAction" + ] + }, + "_weight": { + "oneof": [ + "weight" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "proto3_optional": true + } + }, + "headerAction": { + "type": "HttpHeaderAction", + "id": 328077352, + "options": { + "proto3_optional": true + } + }, + "weight": { + "type": "uint32", + "id": 282149496, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpRouteAction": { + "oneofs": { + "_corsPolicy": { + "oneof": [ + "corsPolicy" + ] + }, + "_faultInjectionPolicy": { + "oneof": [ + "faultInjectionPolicy" + ] + }, + "_maxStreamDuration": { + "oneof": [ + "maxStreamDuration" + ] + }, + "_requestMirrorPolicy": { + "oneof": [ + "requestMirrorPolicy" + ] + }, + "_retryPolicy": { + "oneof": [ + "retryPolicy" + ] + }, + "_timeout": { + "oneof": [ + "timeout" + ] + }, + "_urlRewrite": { + "oneof": [ + "urlRewrite" + ] + } + }, + "fields": { + "corsPolicy": { + "type": "CorsPolicy", + "id": 398943748, + "options": { + "proto3_optional": true + } + }, + "faultInjectionPolicy": { + "type": "HttpFaultInjection", + "id": 412781079, + "options": { + "proto3_optional": true + } + }, + "maxStreamDuration": { + "type": "Duration", + "id": 61428376, + "options": { + "proto3_optional": true + } + }, + "requestMirrorPolicy": { + "type": "RequestMirrorPolicy", + "id": 220196866, + "options": { + "proto3_optional": true + } + }, + "retryPolicy": { + "type": "HttpRetryPolicy", + "id": 56799913, + "options": { + "proto3_optional": true + } + }, + "timeout": { + "type": "Duration", + "id": 296701281, + "options": { + "proto3_optional": true + } + }, + "urlRewrite": { + "type": "UrlRewrite", + "id": 273333948, + "options": { + "proto3_optional": true + } + }, + "weightedBackendServices": { + "rule": "repeated", + "type": "WeightedBackendService", + "id": 337028049 + } + } + }, + "HttpRouteRuleMatch": { + "oneofs": { + "_fullPathMatch": { + "oneof": [ + "fullPathMatch" + ] + }, + "_ignoreCase": { + "oneof": [ + "ignoreCase" + ] + }, + "_prefixMatch": { + "oneof": [ + "prefixMatch" + ] + }, + "_regexMatch": { + "oneof": [ + "regexMatch" + ] + } + }, + "fields": { + "fullPathMatch": { + "type": "string", + "id": 214598875, + "options": { + "proto3_optional": true + } + }, + "headerMatches": { + "rule": "repeated", + "type": "HttpHeaderMatch", + "id": 361903489 + }, + "ignoreCase": { + "type": "bool", + "id": 464324989, + "options": { + "proto3_optional": true + } + }, + "metadataFilters": { + "rule": "repeated", + "type": "MetadataFilter", + "id": 464725739 + }, + "prefixMatch": { + "type": "string", + "id": 257898968, + "options": { + "proto3_optional": true + } + }, + "queryParameterMatches": { + "rule": "repeated", + "type": "HttpQueryParameterMatch", + "id": 286231270 + }, + "regexMatch": { + "type": "string", + "id": 107387853, + "options": { + "proto3_optional": true + } + } + } + }, + "HttpRouteRule": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_headerAction": { + "oneof": [ + "headerAction" + ] + }, + "_priority": { + "oneof": [ + "priority" + ] + }, + "_routeAction": { + "oneof": [ + "routeAction" + ] + }, + "_service": { + "oneof": [ + "service" + ] + }, + "_urlRedirect": { + "oneof": [ + "urlRedirect" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "headerAction": { + "type": "HttpHeaderAction", + "id": 328077352, + "options": { + "proto3_optional": true + } + }, + "matchRules": { + "rule": "repeated", + "type": "HttpRouteRuleMatch", + "id": 376200701 + }, + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "routeAction": { + "type": "HttpRouteAction", + "id": 424563948, + "options": { + "proto3_optional": true + } + }, + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + }, + "urlRedirect": { + "type": "HttpRedirectAction", + "id": 405147820, + "options": { + "proto3_optional": true + } + } + } + }, + "RawDisk": { + "oneofs": { + "_containerType": { + "oneof": [ + "containerType" + ] + }, + "_sha1Checksum": { + "oneof": [ + "sha1Checksum" + ] + }, + "_source": { + "oneof": [ + "source" + ] + } + }, + "fields": { + "containerType": { + "type": "ContainerType", + "id": 318809144, + "options": { + "proto3_optional": true + } + }, + "sha1Checksum": { + "type": "string", + "id": 314444349, + "options": { + "proto3_optional": true + } + }, + "source": { + "type": "string", + "id": 177235995, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ContainerType": { + "values": { + "UNDEFINED_CONTAINER_TYPE": 0, + "TAR": 82821 + } + } + } + }, + "Image": { + "oneofs": { + "_archiveSizeBytes": { + "oneof": [ + "archiveSizeBytes" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_family": { + "oneof": [ + "family" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_imageEncryptionKey": { + "oneof": [ + "imageEncryptionKey" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_rawDisk": { + "oneof": [ + "rawDisk" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_shieldedInstanceInitialState": { + "oneof": [ + "shieldedInstanceInitialState" + ] + }, + "_sourceDisk": { + "oneof": [ + "sourceDisk" + ] + }, + "_sourceDiskEncryptionKey": { + "oneof": [ + "sourceDiskEncryptionKey" + ] + }, + "_sourceDiskId": { + "oneof": [ + "sourceDiskId" + ] + }, + "_sourceImage": { + "oneof": [ + "sourceImage" + ] + }, + "_sourceImageEncryptionKey": { + "oneof": [ + "sourceImageEncryptionKey" + ] + }, + "_sourceImageId": { + "oneof": [ + "sourceImageId" + ] + }, + "_sourceSnapshot": { + "oneof": [ + "sourceSnapshot" + ] + }, + "_sourceSnapshotEncryptionKey": { + "oneof": [ + "sourceSnapshotEncryptionKey" + ] + }, + "_sourceSnapshotId": { + "oneof": [ + "sourceSnapshotId" + ] + }, + "_sourceType": { + "oneof": [ + "sourceType" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "archiveSizeBytes": { + "type": "int64", + "id": 381093450, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "DeprecationStatus", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "diskSizeGb": { + "type": "int64", + "id": 316263735, + "options": { + "proto3_optional": true + } + }, + "family": { + "type": "string", + "id": 328751972, + "options": { + "proto3_optional": true + } + }, + "guestOsFeatures": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 79294545 + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "imageEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 379512583, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "licenseCodes": { + "rule": "repeated", + "type": "int64", + "id": 45482664 + }, + "licenses": { + "rule": "repeated", + "type": "string", + "id": 337642578 + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "rawDisk": { + "type": "RawDisk", + "id": 503113556, + "options": { + "proto3_optional": true + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 480964267, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "shieldedInstanceInitialState": { + "type": "InitialStateConfig", + "id": 192356867, + "options": { + "proto3_optional": true + } + }, + "sourceDisk": { + "type": "string", + "id": 451753793, + "options": { + "proto3_optional": true + } + }, + "sourceDiskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 531501153, + "options": { + "proto3_optional": true + } + }, + "sourceDiskId": { + "type": "string", + "id": 454190809, + "options": { + "proto3_optional": true + } + }, + "sourceImage": { + "type": "string", + "id": 50443319, + "options": { + "proto3_optional": true + } + }, + "sourceImageEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 381503659, + "options": { + "proto3_optional": true + } + }, + "sourceImageId": { + "type": "string", + "id": 55328291, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshot": { + "type": "string", + "id": 126061928, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshotEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 303679322, + "options": { + "proto3_optional": true + } + }, + "sourceSnapshotId": { + "type": "string", + "id": 98962258, + "options": { + "proto3_optional": true + } + }, + "sourceType": { + "type": "SourceType", + "id": 452245726, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "storageLocations": { + "rule": "repeated", + "type": "string", + "id": 328005274 + } + }, + "nested": { + "SourceType": { + "values": { + "UNDEFINED_SOURCE_TYPE": 0, + "RAW": 80904 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "DELETING": 528602024, + "FAILED": 455706685, + "PENDING": 35394935, + "READY": 77848963 + } + } + } + }, + "ImageList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Image", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "Metadata": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + } + }, + "fields": { + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Items", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkInterface": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_ipv6Address": { + "oneof": [ + "ipv6Address" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_networkIP": { + "oneof": [ + "networkIP" + ] + }, + "_nicType": { + "oneof": [ + "nicType" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + } + }, + "fields": { + "accessConfigs": { + "rule": "repeated", + "type": "AccessConfig", + "id": 111058326 + }, + "aliasIpRanges": { + "rule": "repeated", + "type": "AliasIpRange", + "id": 165085631 + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "ipv6Address": { + "type": "string", + "id": 341563804, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "networkIP": { + "type": "string", + "id": 207181961, + "options": { + "proto3_optional": true + } + }, + "nicType": { + "type": "NicType", + "id": 59810577, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "NicType": { + "values": { + "UNDEFINED_NIC_TYPE": 0, + "GVNIC": 68209305, + "UNSPECIFIED_NIC_TYPE": 67411801, + "VIRTIO_NET": 452123481 + } + } + } + }, + "ReservationAffinity": { + "oneofs": { + "_consumeReservationType": { + "oneof": [ + "consumeReservationType" + ] + }, + "_key": { + "oneof": [ + "key" + ] + } + }, + "fields": { + "consumeReservationType": { + "type": "ConsumeReservationType", + "id": 300736944, + "options": { + "proto3_optional": true + } + }, + "key": { + "type": "string", + "id": 106079, + "options": { + "proto3_optional": true + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 249928994 + } + }, + "nested": { + "ConsumeReservationType": { + "values": { + "UNDEFINED_CONSUME_RESERVATION_TYPE": 0, + "ANY_RESERVATION": 200008121, + "NO_RESERVATION": 169322030, + "SPECIFIC_RESERVATION": 229889055, + "UNSPECIFIED": 526786327 + } + } + } + }, + "Scheduling": { + "oneofs": { + "_automaticRestart": { + "oneof": [ + "automaticRestart" + ] + }, + "_locationHint": { + "oneof": [ + "locationHint" + ] + }, + "_minNodeCpus": { + "oneof": [ + "minNodeCpus" + ] + }, + "_onHostMaintenance": { + "oneof": [ + "onHostMaintenance" + ] + }, + "_preemptible": { + "oneof": [ + "preemptible" + ] + } + }, + "fields": { + "automaticRestart": { + "type": "bool", + "id": 350821371, + "options": { + "proto3_optional": true + } + }, + "locationHint": { + "type": "string", + "id": 350519505, + "options": { + "proto3_optional": true + } + }, + "minNodeCpus": { + "type": "int32", + "id": 317231675, + "options": { + "proto3_optional": true + } + }, + "nodeAffinities": { + "rule": "repeated", + "type": "SchedulingNodeAffinity", + "id": 461799971 + }, + "onHostMaintenance": { + "type": "OnHostMaintenance", + "id": 64616796, + "options": { + "proto3_optional": true + } + }, + "preemptible": { + "type": "bool", + "id": 324203169, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "OnHostMaintenance": { + "values": { + "UNDEFINED_ON_HOST_MAINTENANCE": 0, + "MIGRATE": 165699979, + "TERMINATE": 527617601 + } + } + } + }, + "ServiceAccount": { + "oneofs": { + "_email": { + "oneof": [ + "email" + ] + } + }, + "fields": { + "email": { + "type": "string", + "id": 96619420, + "options": { + "proto3_optional": true + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 165973151 + } + } + }, + "ShieldedInstanceConfig": { + "oneofs": { + "_enableIntegrityMonitoring": { + "oneof": [ + "enableIntegrityMonitoring" + ] + }, + "_enableSecureBoot": { + "oneof": [ + "enableSecureBoot" + ] + }, + "_enableVtpm": { + "oneof": [ + "enableVtpm" + ] + } + }, + "fields": { + "enableIntegrityMonitoring": { + "type": "bool", + "id": 409071030, + "options": { + "proto3_optional": true + } + }, + "enableSecureBoot": { + "type": "bool", + "id": 123568638, + "options": { + "proto3_optional": true + } + }, + "enableVtpm": { + "type": "bool", + "id": 181858935, + "options": { + "proto3_optional": true + } + } + } + }, + "ShieldedInstanceIntegrityPolicy": { + "oneofs": { + "_updateAutoLearnPolicy": { + "oneof": [ + "updateAutoLearnPolicy" + ] + } + }, + "fields": { + "updateAutoLearnPolicy": { + "type": "bool", + "id": 245490215, + "options": { + "proto3_optional": true + } + } + } + }, + "Tags": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + } + }, + "fields": { + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "string", + "id": 100526016 + } + } + }, + "Instance": { + "oneofs": { + "_advancedMachineFeatures": { + "oneof": [ + "advancedMachineFeatures" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_confidentialInstanceConfig": { + "oneof": [ + "confidentialInstanceConfig" + ] + }, + "_cpuPlatform": { + "oneof": [ + "cpuPlatform" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_deletionProtection": { + "oneof": [ + "deletionProtection" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_displayDevice": { + "oneof": [ + "displayDevice" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_hostname": { + "oneof": [ + "hostname" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + }, + "_lastStartTimestamp": { + "oneof": [ + "lastStartTimestamp" + ] + }, + "_lastStopTimestamp": { + "oneof": [ + "lastStopTimestamp" + ] + }, + "_lastSuspendedTimestamp": { + "oneof": [ + "lastSuspendedTimestamp" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_privateIpv6GoogleAccess": { + "oneof": [ + "privateIpv6GoogleAccess" + ] + }, + "_reservationAffinity": { + "oneof": [ + "reservationAffinity" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_shieldedInstanceConfig": { + "oneof": [ + "shieldedInstanceConfig" + ] + }, + "_shieldedInstanceIntegrityPolicy": { + "oneof": [ + "shieldedInstanceIntegrityPolicy" + ] + }, + "_startRestricted": { + "oneof": [ + "startRestricted" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_statusMessage": { + "oneof": [ + "statusMessage" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "advancedMachineFeatures": { + "type": "AdvancedMachineFeatures", + "id": 409646002, + "options": { + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 467731324, + "options": { + "proto3_optional": true + } + }, + "confidentialInstanceConfig": { + "type": "ConfidentialInstanceConfig", + "id": 490637685, + "options": { + "proto3_optional": true + } + }, + "cpuPlatform": { + "type": "string", + "id": 410285354, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "deletionProtection": { + "type": "bool", + "id": 458014698, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 95594102 + }, + "displayDevice": { + "type": "DisplayDevice", + "id": 258933875, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "guestAccelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 463595119 + }, + "hostname": { + "type": "string", + "id": 237067315, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "lastStartTimestamp": { + "type": "string", + "id": 443830736, + "options": { + "proto3_optional": true + } + }, + "lastStopTimestamp": { + "type": "string", + "id": 412823010, + "options": { + "proto3_optional": true + } + }, + "lastSuspendedTimestamp": { + "type": "string", + "id": 356275337, + "options": { + "proto3_optional": true + } + }, + "machineType": { + "type": "string", + "id": 227711026, + "options": { + "proto3_optional": true + } + }, + "metadata": { + "type": "Metadata", + "id": 86866735, + "options": { + "proto3_optional": true + } + }, + "minCpuPlatform": { + "type": "string", + "id": 242912759, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 52735243 + }, + "privateIpv6GoogleAccess": { + "type": "PrivateIpv6GoogleAccess", + "id": 48277006, + "options": { + "proto3_optional": true + } + }, + "reservationAffinity": { + "type": "ReservationAffinity", + "id": 157850683, + "options": { + "proto3_optional": true + } + }, + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + }, + "satisfiesPzs": { + "type": "bool", + "id": 480964267, + "options": { + "proto3_optional": true + } + }, + "scheduling": { + "type": "Scheduling", + "id": 386688404, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "serviceAccounts": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 277537328 + }, + "shieldedInstanceConfig": { + "type": "ShieldedInstanceConfig", + "id": 12862901, + "options": { + "proto3_optional": true + } + }, + "shieldedInstanceIntegrityPolicy": { + "type": "ShieldedInstanceIntegrityPolicy", + "id": 163696919, + "options": { + "proto3_optional": true + } + }, + "startRestricted": { + "type": "bool", + "id": 123693144, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "statusMessage": { + "type": "string", + "id": 297428154, + "options": { + "proto3_optional": true + } + }, + "tags": { + "type": "Tags", + "id": 3552281, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PrivateIpv6GoogleAccess": { + "values": { + "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS": 0, + "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": 427975994, + "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": 288210263, + "INHERIT_FROM_SUBNETWORK": 530256959 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "DEPROVISIONING": 428935662, + "PROVISIONING": 290896621, + "REPAIRING": 413483285, + "RUNNING": 121282975, + "STAGING": 431072283, + "STOPPED": 444276141, + "STOPPING": 350791796, + "SUSPENDED": 51223995, + "SUSPENDING": 514206246, + "TERMINATED": 250018339 + } + } + } + }, + "InstancesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 29097598 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "InstancesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NamedPort": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_port": { + "oneof": [ + "port" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroup": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_size": { + "oneof": [ + "size" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "namedPorts": { + "rule": "repeated", + "type": "NamedPort", + "id": 427598732 + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "size": { + "type": "int32", + "id": 3530753, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "instanceGroups": { + "rule": "repeated", + "type": "InstanceGroup", + "id": 366469310 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "InstanceGroupsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InstanceGroup", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerAutoHealingPolicy": { + "oneofs": { + "_healthCheck": { + "oneof": [ + "healthCheck" + ] + }, + "_initialDelaySec": { + "oneof": [ + "initialDelaySec" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "proto3_optional": true + } + }, + "initialDelaySec": { + "type": "int32", + "id": 263207002, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerActionsSummary": { + "oneofs": { + "_abandoning": { + "oneof": [ + "abandoning" + ] + }, + "_creating": { + "oneof": [ + "creating" + ] + }, + "_creatingWithoutRetries": { + "oneof": [ + "creatingWithoutRetries" + ] + }, + "_deleting": { + "oneof": [ + "deleting" + ] + }, + "_none": { + "oneof": [ + "none" + ] + }, + "_recreating": { + "oneof": [ + "recreating" + ] + }, + "_refreshing": { + "oneof": [ + "refreshing" + ] + }, + "_restarting": { + "oneof": [ + "restarting" + ] + }, + "_verifying": { + "oneof": [ + "verifying" + ] + } + }, + "fields": { + "abandoning": { + "type": "int32", + "id": 440023373, + "options": { + "proto3_optional": true + } + }, + "creating": { + "type": "int32", + "id": 209809081, + "options": { + "proto3_optional": true + } + }, + "creatingWithoutRetries": { + "type": "int32", + "id": 369916745, + "options": { + "proto3_optional": true + } + }, + "deleting": { + "type": "int32", + "id": 282846120, + "options": { + "proto3_optional": true + } + }, + "none": { + "type": "int32", + "id": 3387192, + "options": { + "proto3_optional": true + } + }, + "recreating": { + "type": "int32", + "id": 339057132, + "options": { + "proto3_optional": true + } + }, + "refreshing": { + "type": "int32", + "id": 215044903, + "options": { + "proto3_optional": true + } + }, + "restarting": { + "type": "int32", + "id": 372312947, + "options": { + "proto3_optional": true + } + }, + "verifying": { + "type": "int32", + "id": 451612873, + "options": { + "proto3_optional": true + } + } + } + }, + "StatefulPolicy": { + "oneofs": { + "_preservedState": { + "oneof": [ + "preservedState" + ] + } + }, + "fields": { + "preservedState": { + "type": "StatefulPolicyPreservedState", + "id": 2634026, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerStatus": { + "oneofs": { + "_autoscaler": { + "oneof": [ + "autoscaler" + ] + }, + "_isStable": { + "oneof": [ + "isStable" + ] + }, + "_stateful": { + "oneof": [ + "stateful" + ] + }, + "_versionTarget": { + "oneof": [ + "versionTarget" + ] + } + }, + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "proto3_optional": true + } + }, + "isStable": { + "type": "bool", + "id": 108410864, + "options": { + "proto3_optional": true + } + }, + "stateful": { + "type": "InstanceGroupManagerStatusStateful", + "id": 244462412, + "options": { + "proto3_optional": true + } + }, + "versionTarget": { + "type": "InstanceGroupManagerStatusVersionTarget", + "id": 289386200, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerUpdatePolicy": { + "oneofs": { + "_instanceRedistributionType": { + "oneof": [ + "instanceRedistributionType" + ] + }, + "_maxSurge": { + "oneof": [ + "maxSurge" + ] + }, + "_maxUnavailable": { + "oneof": [ + "maxUnavailable" + ] + }, + "_minimalAction": { + "oneof": [ + "minimalAction" + ] + }, + "_replacementMethod": { + "oneof": [ + "replacementMethod" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "instanceRedistributionType": { + "type": "string", + "id": 292630424, + "options": { + "proto3_optional": true + } + }, + "maxSurge": { + "type": "FixedOrPercent", + "id": 302572691, + "options": { + "proto3_optional": true + } + }, + "maxUnavailable": { + "type": "FixedOrPercent", + "id": 404940277, + "options": { + "proto3_optional": true + } + }, + "minimalAction": { + "type": "string", + "id": 270567060, + "options": { + "proto3_optional": true + } + }, + "replacementMethod": { + "type": "string", + "id": 505931694, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "string", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerVersion": { + "oneofs": { + "_instanceTemplate": { + "oneof": [ + "instanceTemplate" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_targetSize": { + "oneof": [ + "targetSize" + ] + } + }, + "fields": { + "instanceTemplate": { + "type": "string", + "id": 309248228, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "targetSize": { + "type": "FixedOrPercent", + "id": 62880239, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManager": { + "oneofs": { + "_baseInstanceName": { + "oneof": [ + "baseInstanceName" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_currentActions": { + "oneof": [ + "currentActions" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_distributionPolicy": { + "oneof": [ + "distributionPolicy" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_instanceGroup": { + "oneof": [ + "instanceGroup" + ] + }, + "_instanceTemplate": { + "oneof": [ + "instanceTemplate" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_statefulPolicy": { + "oneof": [ + "statefulPolicy" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_targetSize": { + "oneof": [ + "targetSize" + ] + }, + "_updatePolicy": { + "oneof": [ + "updatePolicy" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "autoHealingPolicies": { + "rule": "repeated", + "type": "InstanceGroupManagerAutoHealingPolicy", + "id": 456799109 + }, + "baseInstanceName": { + "type": "string", + "id": 389106439, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "currentActions": { + "type": "InstanceGroupManagerActionsSummary", + "id": 164045879, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "distributionPolicy": { + "type": "DistributionPolicy", + "id": 534558541, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "proto3_optional": true + } + }, + "instanceTemplate": { + "type": "string", + "id": 309248228, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "namedPorts": { + "rule": "repeated", + "type": "NamedPort", + "id": 427598732 + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "statefulPolicy": { + "type": "StatefulPolicy", + "id": 47538565, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "InstanceGroupManagerStatus", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "targetPools": { + "rule": "repeated", + "type": "string", + "id": 336072617 + }, + "targetSize": { + "type": "int32", + "id": 62880239, + "options": { + "proto3_optional": true + } + }, + "updatePolicy": { + "type": "InstanceGroupManagerUpdatePolicy", + "id": 175809896, + "options": { + "proto3_optional": true + } + }, + "versions": { + "rule": "repeated", + "type": "InstanceGroupManagerVersion", + "id": 162430619 + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagersScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "instanceGroupManagers": { + "rule": "repeated", + "type": "InstanceGroupManager", + "id": 214072592 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "InstanceGroupManagersScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InstanceGroupManager", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerStatusStateful": { + "oneofs": { + "_hasStatefulConfig": { + "oneof": [ + "hasStatefulConfig" + ] + }, + "_perInstanceConfigs": { + "oneof": [ + "perInstanceConfigs" + ] + } + }, + "fields": { + "hasStatefulConfig": { + "type": "bool", + "id": 110474224, + "options": { + "proto3_optional": true + } + }, + "perInstanceConfigs": { + "type": "InstanceGroupManagerStatusStatefulPerInstanceConfigs", + "id": 526265001, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerStatusVersionTarget": { + "oneofs": { + "_isReached": { + "oneof": [ + "isReached" + ] + } + }, + "fields": { + "isReached": { + "type": "bool", + "id": 433209149, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagerStatusStatefulPerInstanceConfigs": { + "oneofs": { + "_allEffective": { + "oneof": [ + "allEffective" + ] + } + }, + "fields": { + "allEffective": { + "type": "bool", + "id": 516540553, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagersAbandonInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + } + } + }, + "InstanceGroupManagersApplyUpdatesRequest": { + "oneofs": { + "_allInstances": { + "oneof": [ + "allInstances" + ] + }, + "_minimalAction": { + "oneof": [ + "minimalAction" + ] + }, + "_mostDisruptiveAllowedAction": { + "oneof": [ + "mostDisruptiveAllowedAction" + ] + } + }, + "fields": { + "allInstances": { + "type": "bool", + "id": 403676512, + "options": { + "proto3_optional": true + } + }, + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + }, + "minimalAction": { + "type": "string", + "id": 270567060, + "options": { + "proto3_optional": true + } + }, + "mostDisruptiveAllowedAction": { + "type": "string", + "id": 66103053, + "options": { + "proto3_optional": true + } + } + } + }, + "PerInstanceConfig": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_preservedState": { + "oneof": [ + "preservedState" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "preservedState": { + "type": "PreservedState", + "id": 2634026, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "APPLYING": 352003508, + "DELETING": 528602024, + "EFFECTIVE": 244201863, + "NONE": 2402104, + "UNAPPLIED": 483935140, + "UNAPPLIED_DELETION": 313956873 + } + } + } + }, + "InstanceGroupManagersCreateInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 29097598 + } + } + }, + "InstanceGroupManagersDeleteInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + } + } + }, + "InstanceGroupManagersDeletePerInstanceConfigsReq": { + "fields": { + "names": { + "rule": "repeated", + "type": "string", + "id": 104585032 + } + } + }, + "InstanceManagedByIgmError": { + "oneofs": { + "_error": { + "oneof": [ + "error" + ] + }, + "_instanceActionDetails": { + "oneof": [ + "instanceActionDetails" + ] + }, + "_timestamp": { + "oneof": [ + "timestamp" + ] + } + }, + "fields": { + "error": { + "type": "InstanceManagedByIgmErrorManagedInstanceError", + "id": 96784904, + "options": { + "proto3_optional": true + } + }, + "instanceActionDetails": { + "type": "InstanceManagedByIgmErrorInstanceActionDetails", + "id": 292224547, + "options": { + "proto3_optional": true + } + }, + "timestamp": { + "type": "string", + "id": 55126294, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagersListErrorsResponse": { + "oneofs": { + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + } + }, + "fields": { + "items": { + "rule": "repeated", + "type": "InstanceManagedByIgmError", + "id": 100526016 + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + } + } + }, + "ManagedInstance": { + "oneofs": { + "_currentAction": { + "oneof": [ + "currentAction" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_instance": { + "oneof": [ + "instance" + ] + }, + "_instanceStatus": { + "oneof": [ + "instanceStatus" + ] + }, + "_lastAttempt": { + "oneof": [ + "lastAttempt" + ] + }, + "_preservedStateFromConfig": { + "oneof": [ + "preservedStateFromConfig" + ] + }, + "_preservedStateFromPolicy": { + "oneof": [ + "preservedStateFromPolicy" + ] + }, + "_version": { + "oneof": [ + "version" + ] + } + }, + "fields": { + "currentAction": { + "type": "CurrentAction", + "id": 178475964, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "proto3_optional": true + } + }, + "instanceHealth": { + "rule": "repeated", + "type": "ManagedInstanceInstanceHealth", + "id": 382667078 + }, + "instanceStatus": { + "type": "InstanceStatus", + "id": 174577372, + "options": { + "proto3_optional": true + } + }, + "lastAttempt": { + "type": "ManagedInstanceLastAttempt", + "id": 434771492, + "options": { + "proto3_optional": true + } + }, + "preservedStateFromConfig": { + "type": "PreservedState", + "id": 98661858, + "options": { + "proto3_optional": true + } + }, + "preservedStateFromPolicy": { + "type": "PreservedState", + "id": 470783954, + "options": { + "proto3_optional": true + } + }, + "version": { + "type": "ManagedInstanceVersion", + "id": 351608024, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "CurrentAction": { + "values": { + "UNDEFINED_CURRENT_ACTION": 0, + "ABANDONING": 388244813, + "CREATING": 455564985, + "CREATING_WITHOUT_RETRIES": 428843785, + "DELETING": 528602024, + "NONE": 2402104, + "RECREATING": 287278572, + "REFRESHING": 163266343, + "RESTARTING": 320534387, + "VERIFYING": 16982185 + } + }, + "InstanceStatus": { + "values": { + "UNDEFINED_INSTANCE_STATUS": 0, + "DEPROVISIONING": 428935662, + "PROVISIONING": 290896621, + "REPAIRING": 413483285, + "RUNNING": 121282975, + "STAGING": 431072283, + "STOPPED": 444276141, + "STOPPING": 350791796, + "SUSPENDED": 51223995, + "SUSPENDING": 514206246, + "TERMINATED": 250018339 + } + } + } + }, + "InstanceGroupManagersListManagedInstancesResponse": { + "oneofs": { + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + } + }, + "fields": { + "managedInstances": { + "rule": "repeated", + "type": "ManagedInstance", + "id": 336219614 + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagersListPerInstanceConfigsResp": { + "oneofs": { + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "items": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 100526016 + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagersPatchPerInstanceConfigsReq": { + "fields": { + "perInstanceConfigs": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 526265001 + } + } + }, + "InstanceGroupManagersRecreateInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + } + } + }, + "InstanceGroupManagersSetInstanceTemplateRequest": { + "oneofs": { + "_instanceTemplate": { + "oneof": [ + "instanceTemplate" + ] + } + }, + "fields": { + "instanceTemplate": { + "type": "string", + "id": 309248228, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupManagersSetTargetPoolsRequest": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + } + }, + "fields": { + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "targetPools": { + "rule": "repeated", + "type": "string", + "id": 336072617 + } + } + }, + "InstanceGroupManagersUpdatePerInstanceConfigsReq": { + "fields": { + "perInstanceConfigs": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 526265001 + } + } + }, + "InstanceReference": { + "oneofs": { + "_instance": { + "oneof": [ + "instance" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupsAddInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "InstanceReference", + "id": 29097598 + } + } + }, + "InstanceWithNamedPorts": { + "oneofs": { + "_instance": { + "oneof": [ + "instance" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "proto3_optional": true + } + }, + "namedPorts": { + "rule": "repeated", + "type": "NamedPort", + "id": 427598732 + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "DEPROVISIONING": 428935662, + "PROVISIONING": 290896621, + "REPAIRING": 413483285, + "RUNNING": 121282975, + "STAGING": 431072283, + "STOPPED": 444276141, + "STOPPING": 350791796, + "SUSPENDED": 51223995, + "SUSPENDING": 514206246, + "TERMINATED": 250018339 + } + } + } + }, + "InstanceGroupsListInstances": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InstanceWithNamedPorts", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceGroupsListInstancesRequest": { + "oneofs": { + "_instanceState": { + "oneof": [ + "instanceState" + ] + } + }, + "fields": { + "instanceState": { + "type": "InstanceState", + "id": 92223591, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "InstanceState": { + "values": { + "UNDEFINED_INSTANCE_STATE": 0, + "ALL": 64897, + "RUNNING": 121282975 + } + } + } + }, + "InstanceGroupsRemoveInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "InstanceReference", + "id": 29097598 + } + } + }, + "InstanceGroupsSetNamedPortsRequest": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + } + }, + "fields": { + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "namedPorts": { + "rule": "repeated", + "type": "NamedPort", + "id": 427598732 + } + } + }, + "InstanceList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Instance", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "Reference": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + }, + "_referenceType": { + "oneof": [ + "referenceType" + ] + }, + "_referrer": { + "oneof": [ + "referrer" + ] + }, + "_target": { + "oneof": [ + "target" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "referenceType": { + "type": "string", + "id": 247521198, + "options": { + "proto3_optional": true + } + }, + "referrer": { + "type": "string", + "id": 351173663, + "options": { + "proto3_optional": true + } + }, + "target": { + "type": "string", + "id": 192835985, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceListReferrers": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Reference", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceManagedByIgmErrorManagedInstanceError": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "code": { + "type": "string", + "id": 3059181, + "options": { + "proto3_optional": true + } + }, + "message": { + "type": "string", + "id": 418054151, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceManagedByIgmErrorInstanceActionDetails": { + "oneofs": { + "_action": { + "oneof": [ + "action" + ] + }, + "_instance": { + "oneof": [ + "instance" + ] + }, + "_version": { + "oneof": [ + "version" + ] + } + }, + "fields": { + "action": { + "type": "Action", + "id": 187661878, + "options": { + "proto3_optional": true + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "proto3_optional": true + } + }, + "version": { + "type": "ManagedInstanceVersion", + "id": 351608024, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Action": { + "values": { + "UNDEFINED_ACTION": 0, + "ABANDONING": 388244813, + "CREATING": 455564985, + "CREATING_WITHOUT_RETRIES": 428843785, + "DELETING": 528602024, + "NONE": 2402104, + "RECREATING": 287278572, + "REFRESHING": 163266343, + "RESTARTING": 320534387, + "VERIFYING": 16982185 + } + } + } + }, + "ManagedInstanceVersion": { + "oneofs": { + "_instanceTemplate": { + "oneof": [ + "instanceTemplate" + ] + }, + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "instanceTemplate": { + "type": "string", + "id": 309248228, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceMoveRequest": { + "oneofs": { + "_destinationZone": { + "oneof": [ + "destinationZone" + ] + }, + "_targetInstance": { + "oneof": [ + "targetInstance" + ] + } + }, + "fields": { + "destinationZone": { + "type": "string", + "id": 131854653, + "options": { + "proto3_optional": true + } + }, + "targetInstance": { + "type": "string", + "id": 289769347, + "options": { + "proto3_optional": true + } + } + } + }, + "SourceInstanceParams": { + "fields": { + "diskConfigs": { + "rule": "repeated", + "type": "DiskInstantiationConfig", + "id": 235580623 + } + } + }, + "InstanceTemplate": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_properties": { + "oneof": [ + "properties" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_sourceInstance": { + "oneof": [ + "sourceInstance" + ] + }, + "_sourceInstanceParams": { + "oneof": [ + "sourceInstanceParams" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "properties": { + "type": "InstanceProperties", + "id": 147688755, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sourceInstance": { + "type": "string", + "id": 396315705, + "options": { + "proto3_optional": true + } + }, + "sourceInstanceParams": { + "type": "SourceInstanceParams", + "id": 135342156, + "options": { + "proto3_optional": true + } + } + } + }, + "InstanceTemplateList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InstanceTemplate", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InstancesAddResourcePoliciesRequest": { + "fields": { + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + } + } + }, + "InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy": { + "oneofs": { + "_displayName": { + "oneof": [ + "displayName" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_shortName": { + "oneof": [ + "shortName" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 4473832, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "rules": { + "rule": "repeated", + "type": "FirewallPolicyRule", + "id": 108873975 + }, + "shortName": { + "type": "string", + "id": 492051566, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "HIERARCHY": 69902869, + "UNSPECIFIED": 526786327 + } + } + } + }, + "InstancesGetEffectiveFirewallsResponse": { + "fields": { + "firewallPolicys": { + "rule": "repeated", + "type": "InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy", + "id": 410985794 + }, + "firewalls": { + "rule": "repeated", + "type": "Firewall", + "id": 272245619 + } + } + }, + "InstancesRemoveResourcePoliciesRequest": { + "fields": { + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + } + } + }, + "InstancesSetLabelsRequest": { + "oneofs": { + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + } + }, + "fields": { + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + } + } + }, + "InstancesSetMachineResourcesRequest": { + "fields": { + "guestAccelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 463595119 + } + } + }, + "InstancesSetMachineTypeRequest": { + "oneofs": { + "_machineType": { + "oneof": [ + "machineType" + ] + } + }, + "fields": { + "machineType": { + "type": "string", + "id": 227711026, + "options": { + "proto3_optional": true + } + } + } + }, + "InstancesSetMinCpuPlatformRequest": { + "oneofs": { + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + } + }, + "fields": { + "minCpuPlatform": { + "type": "string", + "id": 242912759, + "options": { + "proto3_optional": true + } + } + } + }, + "InstancesSetServiceAccountRequest": { + "oneofs": { + "_email": { + "oneof": [ + "email" + ] + } + }, + "fields": { + "email": { + "type": "string", + "id": 96619420, + "options": { + "proto3_optional": true + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 165973151 + } + } + }, + "InstancesStartWithEncryptionKeyRequest": { + "fields": { + "disks": { + "rule": "repeated", + "type": "CustomerEncryptionKeyProtectedDisk", + "id": 95594102 + } + } + }, + "InterconnectCircuitInfo": { + "oneofs": { + "_customerDemarcId": { + "oneof": [ + "customerDemarcId" + ] + }, + "_googleCircuitId": { + "oneof": [ + "googleCircuitId" + ] + }, + "_googleDemarcId": { + "oneof": [ + "googleDemarcId" + ] + } + }, + "fields": { + "customerDemarcId": { + "type": "string", + "id": 28771859, + "options": { + "proto3_optional": true + } + }, + "googleCircuitId": { + "type": "string", + "id": 262014711, + "options": { + "proto3_optional": true + } + }, + "googleDemarcId": { + "type": "string", + "id": 448196270, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectOutageNotification": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_endTime": { + "oneof": [ + "endTime" + ] + }, + "_issueType": { + "oneof": [ + "issueType" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_source": { + "oneof": [ + "source" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + }, + "_state": { + "oneof": [ + "state" + ] + } + }, + "fields": { + "affectedCircuits": { + "rule": "repeated", + "type": "string", + "id": 177717013 + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "endTime": { + "type": "int64", + "id": 114938801, + "options": { + "proto3_optional": true + } + }, + "issueType": { + "type": "IssueType", + "id": 369639136, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "source": { + "type": "Source", + "id": 177235995, + "options": { + "proto3_optional": true + } + }, + "startTime": { + "type": "int64", + "id": 37467274, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "IssueType": { + "values": { + "UNDEFINED_ISSUE_TYPE": 0, + "IT_OUTAGE": 175779973, + "IT_PARTIAL_OUTAGE": 92103971, + "OUTAGE": 195285745, + "PARTIAL_OUTAGE": 147053455 + } + }, + "Source": { + "values": { + "UNDEFINED_SOURCE": 0, + "GOOGLE": 497439289, + "NSRC_GOOGLE": 510574562 + } + }, + "State": { + "values": { + "UNDEFINED_STATE": 0, + "ACTIVE": 314733318, + "CANCELLED": 41957681, + "COMPLETED": 309921323, + "NS_ACTIVE": 252563136, + "NS_CANCELED": 506579411 + } + } + } + }, + "Interconnect": { + "oneofs": { + "_adminEnabled": { + "oneof": [ + "adminEnabled" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_customerName": { + "oneof": [ + "customerName" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_googleIpAddress": { + "oneof": [ + "googleIpAddress" + ] + }, + "_googleReferenceId": { + "oneof": [ + "googleReferenceId" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_interconnectType": { + "oneof": [ + "interconnectType" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_linkType": { + "oneof": [ + "linkType" + ] + }, + "_location": { + "oneof": [ + "location" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_nocContactEmail": { + "oneof": [ + "nocContactEmail" + ] + }, + "_operationalStatus": { + "oneof": [ + "operationalStatus" + ] + }, + "_peerIpAddress": { + "oneof": [ + "peerIpAddress" + ] + }, + "_provisionedLinkCount": { + "oneof": [ + "provisionedLinkCount" + ] + }, + "_requestedLinkCount": { + "oneof": [ + "requestedLinkCount" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_state": { + "oneof": [ + "state" + ] + } + }, + "fields": { + "adminEnabled": { + "type": "bool", + "id": 445675089, + "options": { + "proto3_optional": true + } + }, + "circuitInfos": { + "rule": "repeated", + "type": "InterconnectCircuitInfo", + "id": 164839855 + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "customerName": { + "type": "string", + "id": 3665484, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "expectedOutages": { + "rule": "repeated", + "type": "InterconnectOutageNotification", + "id": 264484123 + }, + "googleIpAddress": { + "type": "string", + "id": 443105954, + "options": { + "proto3_optional": true + } + }, + "googleReferenceId": { + "type": "string", + "id": 534944469, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "interconnectAttachments": { + "rule": "repeated", + "type": "string", + "id": 425388415 + }, + "interconnectType": { + "type": "InterconnectType", + "id": 515165259, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "linkType": { + "type": "LinkType", + "id": 523207775, + "options": { + "proto3_optional": true + } + }, + "location": { + "type": "string", + "id": 290430901, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "nocContactEmail": { + "type": "string", + "id": 14072832, + "options": { + "proto3_optional": true + } + }, + "operationalStatus": { + "type": "OperationalStatus", + "id": 201070847, + "options": { + "proto3_optional": true + } + }, + "peerIpAddress": { + "type": "string", + "id": 207735769, + "options": { + "proto3_optional": true + } + }, + "provisionedLinkCount": { + "type": "int32", + "id": 410888565, + "options": { + "proto3_optional": true + } + }, + "requestedLinkCount": { + "type": "int32", + "id": 45051387, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "InterconnectType": { + "values": { + "UNDEFINED_INTERCONNECT_TYPE": 0, + "DEDICATED": 258411983, + "IT_PRIVATE": 335677007, + "PARTNER": 461924520 + } + }, + "LinkType": { + "values": { + "UNDEFINED_LINK_TYPE": 0, + "LINK_TYPE_ETHERNET_100G_LR": 337672551, + "LINK_TYPE_ETHERNET_10G_LR": 236739749 + } + }, + "OperationalStatus": { + "values": { + "UNDEFINED_OPERATIONAL_STATUS": 0, + "OS_ACTIVE": 55721409, + "OS_UNPROVISIONED": 239771840 + } + }, + "State": { + "values": { + "UNDEFINED_STATE": 0, + "ACTIVE": 314733318, + "UNPROVISIONED": 517333979 + } + } + } + }, + "InterconnectAttachmentPartnerMetadata": { + "oneofs": { + "_interconnectName": { + "oneof": [ + "interconnectName" + ] + }, + "_partnerName": { + "oneof": [ + "partnerName" + ] + }, + "_portalUrl": { + "oneof": [ + "portalUrl" + ] + } + }, + "fields": { + "interconnectName": { + "type": "string", + "id": 514963356, + "options": { + "proto3_optional": true + } + }, + "partnerName": { + "type": "string", + "id": 161747874, + "options": { + "proto3_optional": true + } + }, + "portalUrl": { + "type": "string", + "id": 269182748, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectAttachmentPrivateInfo": { + "oneofs": { + "_tag8021q": { + "oneof": [ + "tag8021q" + ] + } + }, + "fields": { + "tag8021q": { + "type": "uint32", + "id": 271820992, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectAttachment": { + "oneofs": { + "_adminEnabled": { + "oneof": [ + "adminEnabled" + ] + }, + "_bandwidth": { + "oneof": [ + "bandwidth" + ] + }, + "_cloudRouterIpAddress": { + "oneof": [ + "cloudRouterIpAddress" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_customerRouterIpAddress": { + "oneof": [ + "customerRouterIpAddress" + ] + }, + "_dataplaneVersion": { + "oneof": [ + "dataplaneVersion" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_edgeAvailabilityDomain": { + "oneof": [ + "edgeAvailabilityDomain" + ] + }, + "_encryption": { + "oneof": [ + "encryption" + ] + }, + "_googleReferenceId": { + "oneof": [ + "googleReferenceId" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_interconnect": { + "oneof": [ + "interconnect" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_mtu": { + "oneof": [ + "mtu" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_operationalStatus": { + "oneof": [ + "operationalStatus" + ] + }, + "_pairingKey": { + "oneof": [ + "pairingKey" + ] + }, + "_partnerAsn": { + "oneof": [ + "partnerAsn" + ] + }, + "_partnerMetadata": { + "oneof": [ + "partnerMetadata" + ] + }, + "_privateInterconnectInfo": { + "oneof": [ + "privateInterconnectInfo" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_router": { + "oneof": [ + "router" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_state": { + "oneof": [ + "state" + ] + }, + "_type": { + "oneof": [ + "type" + ] + }, + "_vlanTag8021q": { + "oneof": [ + "vlanTag8021q" + ] + } + }, + "fields": { + "adminEnabled": { + "type": "bool", + "id": 445675089, + "options": { + "proto3_optional": true + } + }, + "bandwidth": { + "type": "Bandwidth", + "id": 181715121, + "options": { + "proto3_optional": true + } + }, + "candidateSubnets": { + "rule": "repeated", + "type": "string", + "id": 237842938 + }, + "cloudRouterIpAddress": { + "type": "string", + "id": 287392776, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "customerRouterIpAddress": { + "type": "string", + "id": 332475761, + "options": { + "proto3_optional": true + } + }, + "dataplaneVersion": { + "type": "int32", + "id": 34920075, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "edgeAvailabilityDomain": { + "type": "EdgeAvailabilityDomain", + "id": 71289510, + "options": { + "proto3_optional": true + } + }, + "encryption": { + "type": "Encryption", + "id": 97980291, + "options": { + "proto3_optional": true + } + }, + "googleReferenceId": { + "type": "string", + "id": 534944469, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "interconnect": { + "type": "string", + "id": 224601230, + "options": { + "proto3_optional": true + } + }, + "ipsecInternalAddresses": { + "rule": "repeated", + "type": "string", + "id": 407648565 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "mtu": { + "type": "int32", + "id": 108462, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "operationalStatus": { + "type": "OperationalStatus", + "id": 201070847, + "options": { + "proto3_optional": true + } + }, + "pairingKey": { + "type": "string", + "id": 439695464, + "options": { + "proto3_optional": true + } + }, + "partnerAsn": { + "type": "int64", + "id": 438166149, + "options": { + "proto3_optional": true + } + }, + "partnerMetadata": { + "type": "InterconnectAttachmentPartnerMetadata", + "id": 65908934, + "options": { + "proto3_optional": true + } + }, + "privateInterconnectInfo": { + "type": "InterconnectAttachmentPrivateInfo", + "id": 237270531, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + }, + "vlanTag8021q": { + "type": "int32", + "id": 119927836, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Bandwidth": { + "values": { + "UNDEFINED_BANDWIDTH": 0, + "BPS_100M": 49547958, + "BPS_10G": 278693006, + "BPS_1G": 355358448, + "BPS_200M": 49577749, + "BPS_20G": 278693967, + "BPS_2G": 355358479, + "BPS_300M": 49607540, + "BPS_400M": 49637331, + "BPS_500M": 49667122, + "BPS_50G": 278696850, + "BPS_50M": 278696856, + "BPS_5G": 355358572 + } + }, + "EdgeAvailabilityDomain": { + "values": { + "UNDEFINED_EDGE_AVAILABILITY_DOMAIN": 0, + "AVAILABILITY_DOMAIN_1": 349552090, + "AVAILABILITY_DOMAIN_2": 349552091, + "AVAILABILITY_DOMAIN_ANY": 375256373 + } + }, + "Encryption": { + "values": { + "UNDEFINED_ENCRYPTION": 0, + "IPSEC": 69882282, + "NONE": 2402104 + } + }, + "OperationalStatus": { + "values": { + "UNDEFINED_OPERATIONAL_STATUS": 0, + "OS_ACTIVE": 55721409, + "OS_UNPROVISIONED": 239771840 + } + }, + "State": { + "values": { + "UNDEFINED_STATE": 0, + "ACTIVE": 314733318, + "DEFUNCT": 115891759, + "PARTNER_REQUEST_RECEIVED": 513587304, + "PENDING_CUSTOMER": 167494054, + "PENDING_PARTNER": 387890656, + "STATE_UNSPECIFIED": 470755401, + "UNPROVISIONED": 517333979 + } + }, + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "DEDICATED": 258411983, + "PARTNER": 461924520, + "PARTNER_PROVIDER": 483261352 + } + } + } + }, + "InterconnectAttachmentsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "interconnectAttachments": { + "rule": "repeated", + "type": "InterconnectAttachment", + "id": 425388415 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectAttachmentAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "InterconnectAttachmentsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectAttachmentList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InterconnectAttachment", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectDiagnosticsARPEntry": { + "oneofs": { + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_macAddress": { + "oneof": [ + "macAddress" + ] + } + }, + "fields": { + "ipAddress": { + "type": "string", + "id": 406272220, + "options": { + "proto3_optional": true + } + }, + "macAddress": { + "type": "string", + "id": 332540164, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectDiagnosticsLinkStatus": { + "oneofs": { + "_circuitId": { + "oneof": [ + "circuitId" + ] + }, + "_googleDemarc": { + "oneof": [ + "googleDemarc" + ] + }, + "_lacpStatus": { + "oneof": [ + "lacpStatus" + ] + }, + "_receivingOpticalPower": { + "oneof": [ + "receivingOpticalPower" + ] + }, + "_transmittingOpticalPower": { + "oneof": [ + "transmittingOpticalPower" + ] + } + }, + "fields": { + "arpCaches": { + "rule": "repeated", + "type": "InterconnectDiagnosticsARPEntry", + "id": 414591761 + }, + "circuitId": { + "type": "string", + "id": 225180977, + "options": { + "proto3_optional": true + } + }, + "googleDemarc": { + "type": "string", + "id": 51084, + "options": { + "proto3_optional": true + } + }, + "lacpStatus": { + "type": "InterconnectDiagnosticsLinkLACPStatus", + "id": 361210415, + "options": { + "proto3_optional": true + } + }, + "receivingOpticalPower": { + "type": "InterconnectDiagnosticsLinkOpticalPower", + "id": 244717279, + "options": { + "proto3_optional": true + } + }, + "transmittingOpticalPower": { + "type": "InterconnectDiagnosticsLinkOpticalPower", + "id": 459431197, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectDiagnostics": { + "oneofs": { + "_macAddress": { + "oneof": [ + "macAddress" + ] + } + }, + "fields": { + "arpCaches": { + "rule": "repeated", + "type": "InterconnectDiagnosticsARPEntry", + "id": 414591761 + }, + "links": { + "rule": "repeated", + "type": "InterconnectDiagnosticsLinkStatus", + "id": 102977465 + }, + "macAddress": { + "type": "string", + "id": 332540164, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectDiagnosticsLinkLACPStatus": { + "oneofs": { + "_googleSystemId": { + "oneof": [ + "googleSystemId" + ] + }, + "_neighborSystemId": { + "oneof": [ + "neighborSystemId" + ] + }, + "_state": { + "oneof": [ + "state" + ] + } + }, + "fields": { + "googleSystemId": { + "type": "string", + "id": 91210405, + "options": { + "proto3_optional": true + } + }, + "neighborSystemId": { + "type": "string", + "id": 343821342, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "UNDEFINED_STATE": 0, + "ACTIVE": 314733318, + "DETACHED": 216562546 + } + } + } + }, + "InterconnectDiagnosticsLinkOpticalPower": { + "oneofs": { + "_state": { + "oneof": [ + "state" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "float", + "id": 111972721, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "UNDEFINED_STATE": 0, + "HIGH_ALARM": 305363284, + "HIGH_WARNING": 220984799, + "LOW_ALARM": 316659046, + "LOW_WARNING": 338793841, + "OK": 2524 + } + } + } + }, + "InterconnectList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Interconnect", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectLocationRegionInfo": { + "oneofs": { + "_expectedRttMs": { + "oneof": [ + "expectedRttMs" + ] + }, + "_locationPresence": { + "oneof": [ + "locationPresence" + ] + }, + "_region": { + "oneof": [ + "region" + ] + } + }, + "fields": { + "expectedRttMs": { + "type": "int64", + "id": 422543866, + "options": { + "proto3_optional": true + } + }, + "locationPresence": { + "type": "LocationPresence", + "id": 101517893, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "LocationPresence": { + "values": { + "UNDEFINED_LOCATION_PRESENCE": 0, + "GLOBAL": 494663587, + "LOCAL_REGION": 403535464, + "LP_GLOBAL": 429584062, + "LP_LOCAL_REGION": 488598851 + } + } + } + }, + "InterconnectLocation": { + "oneofs": { + "_address": { + "oneof": [ + "address" + ] + }, + "_availabilityZone": { + "oneof": [ + "availabilityZone" + ] + }, + "_city": { + "oneof": [ + "city" + ] + }, + "_continent": { + "oneof": [ + "continent" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_facilityProvider": { + "oneof": [ + "facilityProvider" + ] + }, + "_facilityProviderFacilityId": { + "oneof": [ + "facilityProviderFacilityId" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_peeringdbFacilityId": { + "oneof": [ + "peeringdbFacilityId" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "address": { + "type": "string", + "id": 462920692, + "options": { + "proto3_optional": true + } + }, + "availabilityZone": { + "type": "string", + "id": 158459920, + "options": { + "proto3_optional": true + } + }, + "city": { + "type": "string", + "id": 3053931, + "options": { + "proto3_optional": true + } + }, + "continent": { + "type": "Continent", + "id": 133442996, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "facilityProvider": { + "type": "string", + "id": 533303309, + "options": { + "proto3_optional": true + } + }, + "facilityProviderFacilityId": { + "type": "string", + "id": 87269125, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "peeringdbFacilityId": { + "type": "string", + "id": 536567094, + "options": { + "proto3_optional": true + } + }, + "regionInfos": { + "rule": "repeated", + "type": "InterconnectLocationRegionInfo", + "id": 312194170 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Continent": { + "values": { + "UNDEFINED_CONTINENT": 0, + "AFRICA": 317443706, + "ASIA_PAC": 119782269, + "C_AFRICA": 71993846, + "C_ASIA_PAC": 465668089, + "C_EUROPE": 200369438, + "C_NORTH_AMERICA": 275697048, + "C_SOUTH_AMERICA": 397149792, + "EUROPE": 445819298, + "NORTH_AMERICA": 448015508, + "SOUTH_AMERICA": 32597340 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "AVAILABLE": 442079913, + "CLOSED": 380163436 + } + } + } + }, + "InterconnectLocationList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InterconnectLocation", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "InterconnectsGetDiagnosticsResponse": { + "oneofs": { + "_result": { + "oneof": [ + "result" + ] + } + }, + "fields": { + "result": { + "type": "InterconnectDiagnostics", + "id": 139315229, + "options": { + "proto3_optional": true + } + } + } + }, + "LicenseResourceRequirements": { + "oneofs": { + "_minGuestCpuCount": { + "oneof": [ + "minGuestCpuCount" + ] + }, + "_minMemoryMb": { + "oneof": [ + "minMemoryMb" + ] + } + }, + "fields": { + "minGuestCpuCount": { + "type": "int32", + "id": 477964836, + "options": { + "proto3_optional": true + } + }, + "minMemoryMb": { + "type": "int32", + "id": 504785894, + "options": { + "proto3_optional": true + } + } + } + }, + "License": { + "oneofs": { + "_chargesUseFee": { + "oneof": [ + "chargesUseFee" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_licenseCode": { + "oneof": [ + "licenseCode" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_resourceRequirements": { + "oneof": [ + "resourceRequirements" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_transferable": { + "oneof": [ + "transferable" + ] + } + }, + "fields": { + "chargesUseFee": { + "type": "bool", + "id": 372412622, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "licenseCode": { + "type": "uint64", + "id": 1467179, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "resourceRequirements": { + "type": "LicenseResourceRequirements", + "id": 214292769, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "transferable": { + "type": "bool", + "id": 4349893, + "options": { + "proto3_optional": true + } + } + } + }, + "LicenseCodeLicenseAlias": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + } + }, + "LicenseCode": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_state": { + "oneof": [ + "state" + ] + }, + "_transferable": { + "oneof": [ + "transferable" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "licenseAlias": { + "rule": "repeated", + "type": "LicenseCodeLicenseAlias", + "id": 43550930 + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + }, + "transferable": { + "type": "bool", + "id": 4349893, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "UNDEFINED_STATE": 0, + "DISABLED": 516696700, + "ENABLED": 182130465, + "RESTRICTED": 261551195, + "STATE_UNSPECIFIED": 470755401, + "TERMINATED": 250018339 + } + } + } + }, + "LicensesListResponse": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "License", + "id": 100526016 + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "LocalDisk": { + "oneofs": { + "_diskCount": { + "oneof": [ + "diskCount" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_diskType": { + "oneof": [ + "diskType" + ] + } + }, + "fields": { + "diskCount": { + "type": "int32", + "id": 182933485, + "options": { + "proto3_optional": true + } + }, + "diskSizeGb": { + "type": "int32", + "id": 316263735, + "options": { + "proto3_optional": true + } + }, + "diskType": { + "type": "string", + "id": 93009052, + "options": { + "proto3_optional": true + } + } + } + }, + "LocationPolicyLocation": { + "oneofs": { + "_preference": { + "oneof": [ + "preference" + ] + } + }, + "fields": { + "preference": { + "type": "Preference", + "id": 150781147, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Preference": { + "values": { + "UNDEFINED_PREFERENCE": 0, + "ALLOW": 62368553, + "DENY": 2094604, + "PREFERENCE_UNSPECIFIED": 496219571 + } + } + } + }, + "LogConfigCloudAuditOptions": { + "oneofs": { + "_authorizationLoggingOptions": { + "oneof": [ + "authorizationLoggingOptions" + ] + }, + "_logName": { + "oneof": [ + "logName" + ] + } + }, + "fields": { + "authorizationLoggingOptions": { + "type": "AuthorizationLoggingOptions", + "id": 217861624, + "options": { + "proto3_optional": true + } + }, + "logName": { + "type": "LogName", + "id": 402913958, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "LogName": { + "values": { + "UNDEFINED_LOG_NAME": 0, + "ADMIN_ACTIVITY": 427503135, + "DATA_ACCESS": 238070681, + "UNSPECIFIED_LOG_NAME": 410515182 + } + } + } + }, + "LogConfigCounterOptions": { + "oneofs": { + "_field": { + "oneof": [ + "field" + ] + }, + "_metric": { + "oneof": [ + "metric" + ] + } + }, + "fields": { + "customFields": { + "rule": "repeated", + "type": "LogConfigCounterOptionsCustomField", + "id": 249651015 + }, + "field": { + "type": "string", + "id": 97427706, + "options": { + "proto3_optional": true + } + }, + "metric": { + "type": "string", + "id": 533067184, + "options": { + "proto3_optional": true + } + } + } + }, + "LogConfigDataAccessOptions": { + "oneofs": { + "_logMode": { + "oneof": [ + "logMode" + ] + } + }, + "fields": { + "logMode": { + "type": "LogMode", + "id": 402897342, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "LogMode": { + "values": { + "UNDEFINED_LOG_MODE": 0, + "LOG_FAIL_CLOSED": 360469778, + "LOG_MODE_UNSPECIFIED": 88160822 + } + } + } + }, + "LogConfig": { + "oneofs": { + "_cloudAudit": { + "oneof": [ + "cloudAudit" + ] + }, + "_counter": { + "oneof": [ + "counter" + ] + }, + "_dataAccess": { + "oneof": [ + "dataAccess" + ] + } + }, + "fields": { + "cloudAudit": { + "type": "LogConfigCloudAuditOptions", + "id": 412852561, + "options": { + "proto3_optional": true + } + }, + "counter": { + "type": "LogConfigCounterOptions", + "id": 420959740, + "options": { + "proto3_optional": true + } + }, + "dataAccess": { + "type": "LogConfigDataAccessOptions", + "id": 286633881, + "options": { + "proto3_optional": true + } + } + } + }, + "LogConfigCounterOptionsCustomField": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 111972721, + "options": { + "proto3_optional": true + } + } + } + }, + "Accelerators": { + "oneofs": { + "_guestAcceleratorCount": { + "oneof": [ + "guestAcceleratorCount" + ] + }, + "_guestAcceleratorType": { + "oneof": [ + "guestAcceleratorType" + ] + } + }, + "fields": { + "guestAcceleratorCount": { + "type": "int32", + "id": 479079316, + "options": { + "proto3_optional": true + } + }, + "guestAcceleratorType": { + "type": "string", + "id": 293064725, + "options": { + "proto3_optional": true + } + } + } + }, + "ScratchDisks": { + "oneofs": { + "_diskGb": { + "oneof": [ + "diskGb" + ] + } + }, + "fields": { + "diskGb": { + "type": "int32", + "id": 60990141, + "options": { + "proto3_optional": true + } + } + } + }, + "MachineType": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_guestCpus": { + "oneof": [ + "guestCpus" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_imageSpaceGb": { + "oneof": [ + "imageSpaceGb" + ] + }, + "_isSharedCpu": { + "oneof": [ + "isSharedCpu" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_maximumPersistentDisks": { + "oneof": [ + "maximumPersistentDisks" + ] + }, + "_maximumPersistentDisksSizeGb": { + "oneof": [ + "maximumPersistentDisksSizeGb" + ] + }, + "_memoryMb": { + "oneof": [ + "memoryMb" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "accelerators": { + "rule": "repeated", + "type": "Accelerators", + "id": 269577064 + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "DeprecationStatus", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "guestCpus": { + "type": "int32", + "id": 393356754, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "imageSpaceGb": { + "type": "int32", + "id": 75331864, + "options": { + "proto3_optional": true + } + }, + "isSharedCpu": { + "type": "bool", + "id": 521399555, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "maximumPersistentDisks": { + "type": "int32", + "id": 496220941, + "options": { + "proto3_optional": true + } + }, + "maximumPersistentDisksSizeGb": { + "type": "int64", + "id": 154274471, + "options": { + "proto3_optional": true + } + }, + "memoryMb": { + "type": "int32", + "id": 116001171, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "scratchDisks": { + "rule": "repeated", + "type": "ScratchDisks", + "id": 480778481 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + } + }, + "MachineTypesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "machineTypes": { + "rule": "repeated", + "type": "MachineType", + "id": 79720065 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "MachineTypeAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "MachineTypesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "MachineTypeList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "MachineType", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ManagedInstanceInstanceHealth": { + "oneofs": { + "_detailedHealthState": { + "oneof": [ + "detailedHealthState" + ] + }, + "_healthCheck": { + "oneof": [ + "healthCheck" + ] + } + }, + "fields": { + "detailedHealthState": { + "type": "DetailedHealthState", + "id": 510470173, + "options": { + "proto3_optional": true + } + }, + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "DetailedHealthState": { + "values": { + "UNDEFINED_DETAILED_HEALTH_STATE": 0, + "DRAINING": 480455402, + "HEALTHY": 439801213, + "TIMEOUT": 477813057, + "UNHEALTHY": 462118084, + "UNKNOWN": 433141802 + } + } + } + }, + "ManagedInstanceLastAttempt": { + "oneofs": { + "_errors": { + "oneof": [ + "errors" + ] + } + }, + "fields": { + "errors": { + "type": "Errors", + "id": 315977579, + "options": { + "proto3_optional": true + } + } + } + }, + "PreservedState": { + "fields": { + "disks": { + "keyType": "string", + "type": "PreservedStatePreservedDisk", + "id": 95594102 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 86866735 + } + } + }, + "Errors": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_location": { + "oneof": [ + "location" + ] + }, + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "code": { + "type": "string", + "id": 3059181, + "options": { + "proto3_optional": true + } + }, + "location": { + "type": "string", + "id": 290430901, + "options": { + "proto3_optional": true + } + }, + "message": { + "type": "string", + "id": 418054151, + "options": { + "proto3_optional": true + } + } + } + }, + "Items": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 106079, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 111972721, + "options": { + "proto3_optional": true + } + } + } + }, + "MetadataFilterLabelMatch": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 111972721, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkPeering": { + "oneofs": { + "_autoCreateRoutes": { + "oneof": [ + "autoCreateRoutes" + ] + }, + "_exchangeSubnetRoutes": { + "oneof": [ + "exchangeSubnetRoutes" + ] + }, + "_exportCustomRoutes": { + "oneof": [ + "exportCustomRoutes" + ] + }, + "_exportSubnetRoutesWithPublicIp": { + "oneof": [ + "exportSubnetRoutesWithPublicIp" + ] + }, + "_importCustomRoutes": { + "oneof": [ + "importCustomRoutes" + ] + }, + "_importSubnetRoutesWithPublicIp": { + "oneof": [ + "importSubnetRoutesWithPublicIp" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_peerMtu": { + "oneof": [ + "peerMtu" + ] + }, + "_state": { + "oneof": [ + "state" + ] + }, + "_stateDetails": { + "oneof": [ + "stateDetails" + ] + } + }, + "fields": { + "autoCreateRoutes": { + "type": "bool", + "id": 57454941, + "options": { + "proto3_optional": true + } + }, + "exchangeSubnetRoutes": { + "type": "bool", + "id": 26322256, + "options": { + "proto3_optional": true + } + }, + "exportCustomRoutes": { + "type": "bool", + "id": 60281485, + "options": { + "proto3_optional": true + } + }, + "exportSubnetRoutesWithPublicIp": { + "type": "bool", + "id": 97940834, + "options": { + "proto3_optional": true + } + }, + "importCustomRoutes": { + "type": "bool", + "id": 197982398, + "options": { + "proto3_optional": true + } + }, + "importSubnetRoutesWithPublicIp": { + "type": "bool", + "id": 14419729, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "peerMtu": { + "type": "int32", + "id": 69584721, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + }, + "stateDetails": { + "type": "string", + "id": 95566996, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "UNDEFINED_STATE": 0, + "ACTIVE": 314733318, + "INACTIVE": 270421099 + } + } + } + }, + "NetworkRoutingConfig": { + "oneofs": { + "_routingMode": { + "oneof": [ + "routingMode" + ] + } + }, + "fields": { + "routingMode": { + "type": "RoutingMode", + "id": 475143548, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "RoutingMode": { + "values": { + "UNDEFINED_ROUTING_MODE": 0, + "GLOBAL": 494663587, + "REGIONAL": 92288543 + } + } + } + }, + "Network": { + "oneofs": { + "_IPv4Range": { + "oneof": [ + "IPv4Range" + ] + }, + "_autoCreateSubnetworks": { + "oneof": [ + "autoCreateSubnetworks" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_gatewayIPv4": { + "oneof": [ + "gatewayIPv4" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_mtu": { + "oneof": [ + "mtu" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_routingConfig": { + "oneof": [ + "routingConfig" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "IPv4Range": { + "type": "string", + "id": 59234358, + "options": { + "proto3_optional": true + } + }, + "autoCreateSubnetworks": { + "type": "bool", + "id": 256156690, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "gatewayIPv4": { + "type": "string", + "id": 178678877, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "mtu": { + "type": "int32", + "id": 108462, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "peerings": { + "rule": "repeated", + "type": "NetworkPeering", + "id": 69883187 + }, + "routingConfig": { + "type": "NetworkRoutingConfig", + "id": 523556059, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "subnetworks": { + "rule": "repeated", + "type": "string", + "id": 415853125 + } + } + }, + "NetworkEndpointGroupAppEngine": { + "oneofs": { + "_service": { + "oneof": [ + "service" + ] + }, + "_urlMask": { + "oneof": [ + "urlMask" + ] + }, + "_version": { + "oneof": [ + "version" + ] + } + }, + "fields": { + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + }, + "urlMask": { + "type": "string", + "id": 103352252, + "options": { + "proto3_optional": true + } + }, + "version": { + "type": "string", + "id": 351608024, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkEndpointGroupCloudFunction": { + "oneofs": { + "_function": { + "oneof": [ + "function" + ] + }, + "_urlMask": { + "oneof": [ + "urlMask" + ] + } + }, + "fields": { + "function": { + "type": "string", + "id": 307196888, + "options": { + "proto3_optional": true + } + }, + "urlMask": { + "type": "string", + "id": 103352252, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkEndpointGroupCloudRun": { + "oneofs": { + "_service": { + "oneof": [ + "service" + ] + }, + "_tag": { + "oneof": [ + "tag" + ] + }, + "_urlMask": { + "oneof": [ + "urlMask" + ] + } + }, + "fields": { + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + }, + "tag": { + "type": "string", + "id": 114586, + "options": { + "proto3_optional": true + } + }, + "urlMask": { + "type": "string", + "id": 103352252, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkEndpointGroup": { + "oneofs": { + "_appEngine": { + "oneof": [ + "appEngine" + ] + }, + "_cloudFunction": { + "oneof": [ + "cloudFunction" + ] + }, + "_cloudRun": { + "oneof": [ + "cloudRun" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_defaultPort": { + "oneof": [ + "defaultPort" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_networkEndpointType": { + "oneof": [ + "networkEndpointType" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_size": { + "oneof": [ + "size" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "annotations": { + "keyType": "string", + "type": "string", + "id": 112032548 + }, + "appEngine": { + "type": "NetworkEndpointGroupAppEngine", + "id": 340788768, + "options": { + "proto3_optional": true + } + }, + "cloudFunction": { + "type": "NetworkEndpointGroupCloudFunction", + "id": 519893666, + "options": { + "proto3_optional": true + } + }, + "cloudRun": { + "type": "NetworkEndpointGroupCloudRun", + "id": 111060353, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "defaultPort": { + "type": "int32", + "id": 423377855, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "networkEndpointType": { + "type": "NetworkEndpointType", + "id": 118301523, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "size": { + "type": "int32", + "id": 3530753, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "NetworkEndpointType": { + "values": { + "UNDEFINED_NETWORK_ENDPOINT_TYPE": 0, + "GCE_VM_IP": 401880793, + "GCE_VM_IP_PORT": 501838375, + "INTERNET_FQDN_PORT": 404154477, + "INTERNET_IP_PORT": 477719963, + "NON_GCP_PRIVATE_IP_PORT": 336447968, + "SERVERLESS": 270492508 + } + } + } + }, + "NetworkEndpointGroupsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "networkEndpointGroups": { + "rule": "repeated", + "type": "NetworkEndpointGroup", + "id": 29346733 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkEndpointGroupAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "NetworkEndpointGroupsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkEndpointGroupList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "NetworkEndpointGroup", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkEndpointGroupsAttachEndpointsRequest": { + "fields": { + "networkEndpoints": { + "rule": "repeated", + "type": "NetworkEndpoint", + "id": 149850285 + } + } + }, + "NetworkEndpointGroupsDetachEndpointsRequest": { + "fields": { + "networkEndpoints": { + "rule": "repeated", + "type": "NetworkEndpoint", + "id": 149850285 + } + } + }, + "NetworkEndpointGroupsListEndpointsRequest": { + "oneofs": { + "_healthStatus": { + "oneof": [ + "healthStatus" + ] + } + }, + "fields": { + "healthStatus": { + "type": "HealthStatus", + "id": 380545845, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "HealthStatus": { + "values": { + "UNDEFINED_HEALTH_STATUS": 0, + "SHOW": 2544381, + "SKIP": 2547071 + } + } + } + }, + "NetworkEndpointWithHealthStatus": { + "oneofs": { + "_networkEndpoint": { + "oneof": [ + "networkEndpoint" + ] + } + }, + "fields": { + "healths": { + "rule": "repeated", + "type": "HealthStatusForNetworkEndpoint", + "id": 258689431 + }, + "networkEndpoint": { + "type": "NetworkEndpoint", + "id": 56789126, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkEndpointGroupsListNetworkEndpoints": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "NetworkEndpointWithHealthStatus", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworkList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Network", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworksAddPeeringRequest": { + "oneofs": { + "_autoCreateRoutes": { + "oneof": [ + "autoCreateRoutes" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_networkPeering": { + "oneof": [ + "networkPeering" + ] + }, + "_peerNetwork": { + "oneof": [ + "peerNetwork" + ] + } + }, + "fields": { + "autoCreateRoutes": { + "type": "bool", + "id": 57454941, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "networkPeering": { + "type": "NetworkPeering", + "id": 328926767, + "options": { + "proto3_optional": true + } + }, + "peerNetwork": { + "type": "string", + "id": 500625489, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy": { + "oneofs": { + "_displayName": { + "oneof": [ + "displayName" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_shortName": { + "oneof": [ + "shortName" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 4473832, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "rules": { + "rule": "repeated", + "type": "FirewallPolicyRule", + "id": 108873975 + }, + "shortName": { + "type": "string", + "id": 492051566, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "HIERARCHY": 69902869, + "NETWORK": 413984270, + "UNSPECIFIED": 526786327 + } + } + } + }, + "NetworksGetEffectiveFirewallsResponse": { + "fields": { + "firewallPolicys": { + "rule": "repeated", + "type": "NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy", + "id": 410985794 + }, + "firewalls": { + "rule": "repeated", + "type": "Firewall", + "id": 272245619 + } + } + }, + "NetworksRemovePeeringRequest": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + } + } + }, + "NetworksUpdatePeeringRequest": { + "oneofs": { + "_networkPeering": { + "oneof": [ + "networkPeering" + ] + } + }, + "fields": { + "networkPeering": { + "type": "NetworkPeering", + "id": 328926767, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeGroupAutoscalingPolicy": { + "oneofs": { + "_maxNodes": { + "oneof": [ + "maxNodes" + ] + }, + "_minNodes": { + "oneof": [ + "minNodes" + ] + }, + "_mode": { + "oneof": [ + "mode" + ] + } + }, + "fields": { + "maxNodes": { + "type": "int32", + "id": 297762838, + "options": { + "proto3_optional": true + } + }, + "minNodes": { + "type": "int32", + "id": 533370500, + "options": { + "proto3_optional": true + } + }, + "mode": { + "type": "Mode", + "id": 3357091, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Mode": { + "values": { + "UNDEFINED_MODE": 0, + "MODE_UNSPECIFIED": 371348091, + "OFF": 78159, + "ON": 2527, + "ONLY_SCALE_OUT": 152713670 + } + } + } + }, + "NodeGroupMaintenanceWindow": { + "oneofs": { + "_maintenanceDuration": { + "oneof": [ + "maintenanceDuration" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + } + }, + "fields": { + "maintenanceDuration": { + "type": "Duration", + "id": 525291840, + "options": { + "proto3_optional": true + } + }, + "startTime": { + "type": "string", + "id": 37467274, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeGroup": { + "oneofs": { + "_autoscalingPolicy": { + "oneof": [ + "autoscalingPolicy" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_locationHint": { + "oneof": [ + "locationHint" + ] + }, + "_maintenancePolicy": { + "oneof": [ + "maintenancePolicy" + ] + }, + "_maintenanceWindow": { + "oneof": [ + "maintenanceWindow" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_nodeTemplate": { + "oneof": [ + "nodeTemplate" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_size": { + "oneof": [ + "size" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "autoscalingPolicy": { + "type": "NodeGroupAutoscalingPolicy", + "id": 221950041, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "locationHint": { + "type": "string", + "id": 350519505, + "options": { + "proto3_optional": true + } + }, + "maintenancePolicy": { + "type": "MaintenancePolicy", + "id": 528327646, + "options": { + "proto3_optional": true + } + }, + "maintenanceWindow": { + "type": "NodeGroupMaintenanceWindow", + "id": 186374812, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "nodeTemplate": { + "type": "string", + "id": 323154455, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "size": { + "type": "int32", + "id": 3530753, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "MaintenancePolicy": { + "values": { + "UNDEFINED_MAINTENANCE_POLICY": 0, + "DEFAULT": 115302945, + "MAINTENANCE_POLICY_UNSPECIFIED": 72964182, + "MIGRATE_WITHIN_NODE_GROUP": 153483394, + "RESTART_IN_PLACE": 228647325 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "INVALID": 530283991, + "READY": 77848963 + } + } + } + }, + "NodeGroupsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "nodeGroups": { + "rule": "repeated", + "type": "NodeGroup", + "id": 73188017 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeGroupAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "NodeGroupsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeGroupList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "NodeGroup", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ServerBinding": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "RESTART_NODE_ON_ANY_SERVER": 502950985, + "RESTART_NODE_ON_MINIMAL_SERVERS": 204166495, + "SERVER_BINDING_TYPE_UNSPECIFIED": 180825512 + } + } + } + }, + "NodeGroupNode": { + "oneofs": { + "_cpuOvercommitType": { + "oneof": [ + "cpuOvercommitType" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_nodeType": { + "oneof": [ + "nodeType" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_serverBinding": { + "oneof": [ + "serverBinding" + ] + }, + "_serverId": { + "oneof": [ + "serverId" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "accelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 269577064 + }, + "cpuOvercommitType": { + "type": "CpuOvercommitType", + "id": 247727959, + "options": { + "proto3_optional": true + } + }, + "disks": { + "rule": "repeated", + "type": "LocalDisk", + "id": 95594102 + }, + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "nodeType": { + "type": "string", + "id": 465832791, + "options": { + "proto3_optional": true + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 480964267, + "options": { + "proto3_optional": true + } + }, + "serverBinding": { + "type": "ServerBinding", + "id": 208179593, + "options": { + "proto3_optional": true + } + }, + "serverId": { + "type": "string", + "id": 339433367, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "CpuOvercommitType": { + "values": { + "UNDEFINED_CPU_OVERCOMMIT_TYPE": 0, + "CPU_OVERCOMMIT_TYPE_UNSPECIFIED": 520665615, + "ENABLED": 182130465, + "NONE": 2402104 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "INVALID": 530283991, + "READY": 77848963, + "REPAIRING": 413483285 + } + } + } + }, + "NodeGroupsAddNodesRequest": { + "oneofs": { + "_additionalNodeCount": { + "oneof": [ + "additionalNodeCount" + ] + } + }, + "fields": { + "additionalNodeCount": { + "type": "int32", + "id": 134997930, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeGroupsDeleteNodesRequest": { + "fields": { + "nodes": { + "rule": "repeated", + "type": "string", + "id": 104993457 + } + } + }, + "NodeGroupsListNodes": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "NodeGroupNode", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeGroupsSetNodeTemplateRequest": { + "oneofs": { + "_nodeTemplate": { + "oneof": [ + "nodeTemplate" + ] + } + }, + "fields": { + "nodeTemplate": { + "type": "string", + "id": 323154455, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeTemplateNodeTypeFlexibility": { + "oneofs": { + "_cpus": { + "oneof": [ + "cpus" + ] + }, + "_localSsd": { + "oneof": [ + "localSsd" + ] + }, + "_memory": { + "oneof": [ + "memory" + ] + } + }, + "fields": { + "cpus": { + "type": "string", + "id": 3060683, + "options": { + "proto3_optional": true + } + }, + "localSsd": { + "type": "string", + "id": 405741360, + "options": { + "proto3_optional": true + } + }, + "memory": { + "type": "string", + "id": 532856065, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeTemplate": { + "oneofs": { + "_cpuOvercommitType": { + "oneof": [ + "cpuOvercommitType" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_nodeType": { + "oneof": [ + "nodeType" + ] + }, + "_nodeTypeFlexibility": { + "oneof": [ + "nodeTypeFlexibility" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_serverBinding": { + "oneof": [ + "serverBinding" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_statusMessage": { + "oneof": [ + "statusMessage" + ] + } + }, + "fields": { + "accelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 269577064 + }, + "cpuOvercommitType": { + "type": "CpuOvercommitType", + "id": 247727959, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "disks": { + "rule": "repeated", + "type": "LocalDisk", + "id": 95594102 + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "nodeAffinityLabels": { + "keyType": "string", + "type": "string", + "id": 339007161 + }, + "nodeType": { + "type": "string", + "id": 465832791, + "options": { + "proto3_optional": true + } + }, + "nodeTypeFlexibility": { + "type": "NodeTemplateNodeTypeFlexibility", + "id": 315257905, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "serverBinding": { + "type": "ServerBinding", + "id": 208179593, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "statusMessage": { + "type": "string", + "id": 297428154, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "CpuOvercommitType": { + "values": { + "UNDEFINED_CPU_OVERCOMMIT_TYPE": 0, + "CPU_OVERCOMMIT_TYPE_UNSPECIFIED": 520665615, + "ENABLED": 182130465, + "NONE": 2402104 + } + }, + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "INVALID": 530283991, + "READY": 77848963 + } + } + } + }, + "NodeTemplatesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "nodeTemplates": { + "rule": "repeated", + "type": "NodeTemplate", + "id": 354111804 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeTemplateAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "NodeTemplatesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeTemplateList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "NodeTemplate", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeType": { + "oneofs": { + "_cpuPlatform": { + "oneof": [ + "cpuPlatform" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_guestCpus": { + "oneof": [ + "guestCpus" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_localSsdGb": { + "oneof": [ + "localSsdGb" + ] + }, + "_memoryMb": { + "oneof": [ + "memoryMb" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "cpuPlatform": { + "type": "string", + "id": 410285354, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "DeprecationStatus", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "guestCpus": { + "type": "int32", + "id": 393356754, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "localSsdGb": { + "type": "int32", + "id": 329237578, + "options": { + "proto3_optional": true + } + }, + "memoryMb": { + "type": "int32", + "id": 116001171, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeTypesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "nodeTypes": { + "rule": "repeated", + "type": "NodeType", + "id": 482172924 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeTypeAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "NodeTypesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NodeTypeList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "NodeType", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "NotificationEndpointGrpcSettings": { + "oneofs": { + "_authority": { + "oneof": [ + "authority" + ] + }, + "_endpoint": { + "oneof": [ + "endpoint" + ] + }, + "_payloadName": { + "oneof": [ + "payloadName" + ] + }, + "_resendInterval": { + "oneof": [ + "resendInterval" + ] + }, + "_retryDurationSec": { + "oneof": [ + "retryDurationSec" + ] + } + }, + "fields": { + "authority": { + "type": "string", + "id": 401868611, + "options": { + "proto3_optional": true + } + }, + "endpoint": { + "type": "string", + "id": 130489749, + "options": { + "proto3_optional": true + } + }, + "payloadName": { + "type": "string", + "id": 300358300, + "options": { + "proto3_optional": true + } + }, + "resendInterval": { + "type": "Duration", + "id": 478288969, + "options": { + "proto3_optional": true + } + }, + "retryDurationSec": { + "type": "uint32", + "id": 115681117, + "options": { + "proto3_optional": true + } + } + } + }, + "NotificationEndpoint": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_grpcSettings": { + "oneof": [ + "grpcSettings" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "grpcSettings": { + "type": "NotificationEndpointGrpcSettings", + "id": 456139556, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + } + }, + "NotificationEndpointList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "NotificationEndpoint", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "Error": { + "fields": { + "errors": { + "rule": "repeated", + "type": "Errors", + "id": 315977579 + } + } + }, + "Warnings": { + "oneofs": { + "_code": { + "oneof": [ + "code" + ] + }, + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "code": { + "type": "Code", + "id": 3059181, + "options": { + "proto3_optional": true + } + }, + "data": { + "rule": "repeated", + "type": "Data", + "id": 3076010 + }, + "message": { + "type": "string", + "id": 418054151, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Code": { + "values": { + "UNDEFINED_CODE": 0, + "CLEANUP_FAILED": 150308440, + "DEPRECATED_RESOURCE_USED": 391835586, + "DEPRECATED_TYPE_USED": 346526230, + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE": 369442967, + "EXPERIMENTAL_TYPE_USED": 451954443, + "EXTERNAL_API_WARNING": 175546307, + "FIELD_VALUE_OVERRIDEN": 329669423, + "INJECTED_KERNELS_DEPRECATED": 417377419, + "LARGE_DEPLOYMENT_WARNING": 481440678, + "MISSING_TYPE_DEPENDENCY": 344505463, + "NEXT_HOP_ADDRESS_NOT_ASSIGNED": 324964999, + "NEXT_HOP_CANNOT_IP_FORWARD": 383382887, + "NEXT_HOP_INSTANCE_NOT_FOUND": 464250446, + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK": 243758146, + "NEXT_HOP_NOT_RUNNING": 417081265, + "NOT_CRITICAL_ERROR": 105763924, + "NO_RESULTS_ON_PAGE": 30036744, + "PARTIAL_SUCCESS": 39966469, + "REQUIRED_TOS_AGREEMENT": 3745539, + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING": 496728641, + "RESOURCE_NOT_DELETED": 168598460, + "SCHEMA_VALIDATION_IGNORED": 275245642, + "SINGLE_INSTANCE_PROPERTY_TEMPLATE": 268305617, + "UNDECLARED_PROPERTIES": 390513439, + "UNREACHABLE": 13328052 + } + } + } + }, + "Operation": { + "oneofs": { + "_clientOperationId": { + "oneof": [ + "clientOperationId" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_endTime": { + "oneof": [ + "endTime" + ] + }, + "_error": { + "oneof": [ + "error" + ] + }, + "_httpErrorMessage": { + "oneof": [ + "httpErrorMessage" + ] + }, + "_httpErrorStatusCode": { + "oneof": [ + "httpErrorStatusCode" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_insertTime": { + "oneof": [ + "insertTime" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_operationGroupId": { + "oneof": [ + "operationGroupId" + ] + }, + "_operationType": { + "oneof": [ + "operationType" + ] + }, + "_progress": { + "oneof": [ + "progress" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_statusMessage": { + "oneof": [ + "statusMessage" + ] + }, + "_targetId": { + "oneof": [ + "targetId" + ] + }, + "_targetLink": { + "oneof": [ + "targetLink" + ] + }, + "_user": { + "oneof": [ + "user" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "clientOperationId": { + "type": "string", + "id": 297240295, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "endTime": { + "type": "string", + "id": 114938801, + "options": { + "proto3_optional": true + } + }, + "error": { + "type": "Error", + "id": 96784904, + "options": { + "proto3_optional": true + } + }, + "httpErrorMessage": { + "type": "string", + "id": 202521945, + "options": { + "proto3_optional": true + } + }, + "httpErrorStatusCode": { + "type": "int32", + "id": 312345196, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "insertTime": { + "type": "string", + "id": 433722515, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "operationGroupId": { + "type": "string", + "id": 40171187, + "options": { + "proto3_optional": true + } + }, + "operationType": { + "type": "string", + "id": 177650450, + "options": { + "proto3_optional": true + } + }, + "progress": { + "type": "int32", + "id": 72663597, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "startTime": { + "type": "string", + "id": 37467274, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "statusMessage": { + "type": "string", + "id": 297428154, + "options": { + "proto3_optional": true + } + }, + "targetId": { + "type": "uint64", + "id": 258165385, + "options": { + "proto3_optional": true + } + }, + "targetLink": { + "type": "string", + "id": 62671336, + "options": { + "proto3_optional": true + } + }, + "user": { + "type": "string", + "id": 3599307, + "options": { + "proto3_optional": true + } + }, + "warnings": { + "rule": "repeated", + "type": "Warnings", + "id": 498091095 + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "DONE": 2104194, + "PENDING": 35394935, + "RUNNING": 121282975 + } + } + } + }, + "OperationsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 4184044 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "OperationAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "OperationsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "OperationList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Operation", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "PacketMirroringForwardingRuleInfo": { + "oneofs": { + "_canonicalUrl": { + "oneof": [ + "canonicalUrl" + ] + }, + "_url": { + "oneof": [ + "url" + ] + } + }, + "fields": { + "canonicalUrl": { + "type": "string", + "id": 512294820, + "options": { + "proto3_optional": true + } + }, + "url": { + "type": "string", + "id": 116079, + "options": { + "proto3_optional": true + } + } + } + }, + "PacketMirroringFilter": { + "oneofs": { + "_direction": { + "oneof": [ + "direction" + ] + } + }, + "fields": { + "IPProtocols": { + "rule": "repeated", + "type": "string", + "id": 98544854 + }, + "cidrRanges": { + "rule": "repeated", + "type": "string", + "id": 487901697 + }, + "direction": { + "type": "Direction", + "id": 111150975, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Direction": { + "values": { + "UNDEFINED_DIRECTION": 0, + "BOTH": 2044801, + "EGRESS": 432880501, + "INGRESS": 516931221 + } + } + } + }, + "PacketMirroringMirroredResourceInfo": { + "fields": { + "instances": { + "rule": "repeated", + "type": "PacketMirroringMirroredResourceInfoInstanceInfo", + "id": 29097598 + }, + "subnetworks": { + "rule": "repeated", + "type": "PacketMirroringMirroredResourceInfoSubnetInfo", + "id": 415853125 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 3552281 + } + } + }, + "PacketMirroringNetworkInfo": { + "oneofs": { + "_canonicalUrl": { + "oneof": [ + "canonicalUrl" + ] + }, + "_url": { + "oneof": [ + "url" + ] + } + }, + "fields": { + "canonicalUrl": { + "type": "string", + "id": 512294820, + "options": { + "proto3_optional": true + } + }, + "url": { + "type": "string", + "id": 116079, + "options": { + "proto3_optional": true + } + } + } + }, + "PacketMirroring": { + "oneofs": { + "_collectorIlb": { + "oneof": [ + "collectorIlb" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_enable": { + "oneof": [ + "enable" + ] + }, + "_filter": { + "oneof": [ + "filter" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_mirroredResources": { + "oneof": [ + "mirroredResources" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_priority": { + "oneof": [ + "priority" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "collectorIlb": { + "type": "PacketMirroringForwardingRuleInfo", + "id": 426607853, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "enable": { + "type": "Enable", + "id": 311764355, + "options": { + "proto3_optional": true + } + }, + "filter": { + "type": "PacketMirroringFilter", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "mirroredResources": { + "type": "PacketMirroringMirroredResourceInfo", + "id": 124817348, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "PacketMirroringNetworkInfo", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "priority": { + "type": "uint32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Enable": { + "values": { + "UNDEFINED_ENABLE": 0, + "FALSE": 66658563, + "TRUE": 2583950 + } + } + } + }, + "PacketMirroringsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "packetMirrorings": { + "rule": "repeated", + "type": "PacketMirroring", + "id": 154615079 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "PacketMirroringAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "PacketMirroringsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "PacketMirroringList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "PacketMirroring", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "PacketMirroringMirroredResourceInfoInstanceInfo": { + "oneofs": { + "_canonicalUrl": { + "oneof": [ + "canonicalUrl" + ] + }, + "_url": { + "oneof": [ + "url" + ] + } + }, + "fields": { + "canonicalUrl": { + "type": "string", + "id": 512294820, + "options": { + "proto3_optional": true + } + }, + "url": { + "type": "string", + "id": 116079, + "options": { + "proto3_optional": true + } + } + } + }, + "PacketMirroringMirroredResourceInfoSubnetInfo": { + "oneofs": { + "_canonicalUrl": { + "oneof": [ + "canonicalUrl" + ] + }, + "_url": { + "oneof": [ + "url" + ] + } + }, + "fields": { + "canonicalUrl": { + "type": "string", + "id": 512294820, + "options": { + "proto3_optional": true + } + }, + "url": { + "type": "string", + "id": 116079, + "options": { + "proto3_optional": true + } + } + } + }, + "PathRule": { + "oneofs": { + "_routeAction": { + "oneof": [ + "routeAction" + ] + }, + "_service": { + "oneof": [ + "service" + ] + }, + "_urlRedirect": { + "oneof": [ + "urlRedirect" + ] + } + }, + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 106438894 + }, + "routeAction": { + "type": "HttpRouteAction", + "id": 424563948, + "options": { + "proto3_optional": true + } + }, + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + }, + "urlRedirect": { + "type": "HttpRedirectAction", + "id": 405147820, + "options": { + "proto3_optional": true + } + } + } + }, + "PathMatcher": { + "oneofs": { + "_defaultRouteAction": { + "oneof": [ + "defaultRouteAction" + ] + }, + "_defaultService": { + "oneof": [ + "defaultService" + ] + }, + "_defaultUrlRedirect": { + "oneof": [ + "defaultUrlRedirect" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_headerAction": { + "oneof": [ + "headerAction" + ] + }, + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "defaultRouteAction": { + "type": "HttpRouteAction", + "id": 378919466, + "options": { + "proto3_optional": true + } + }, + "defaultService": { + "type": "string", + "id": 370242231, + "options": { + "proto3_optional": true + } + }, + "defaultUrlRedirect": { + "type": "HttpRedirectAction", + "id": 359503338, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "headerAction": { + "type": "HttpHeaderAction", + "id": 328077352, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "pathRules": { + "rule": "repeated", + "type": "PathRule", + "id": 104439901 + }, + "routeRules": { + "rule": "repeated", + "type": "HttpRouteRule", + "id": 376292225 + } + } + }, + "Rule": { + "oneofs": { + "_action": { + "oneof": [ + "action" + ] + }, + "_description": { + "oneof": [ + "description" + ] + } + }, + "fields": { + "action": { + "type": "Action", + "id": 187661878, + "options": { + "proto3_optional": true + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 142882488 + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "ins": { + "rule": "repeated", + "type": "string", + "id": 104430 + }, + "logConfigs": { + "rule": "repeated", + "type": "LogConfig", + "id": 152873846 + }, + "notIns": { + "rule": "repeated", + "type": "string", + "id": 518443138 + }, + "permissions": { + "rule": "repeated", + "type": "string", + "id": 59962500 + } + }, + "nested": { + "Action": { + "values": { + "UNDEFINED_ACTION": 0, + "ALLOW": 62368553, + "ALLOW_WITH_LOG": 76034177, + "DENY": 2094604, + "DENY_WITH_LOG": 351433982, + "LOG": 75556, + "NO_ACTION": 260643444 + } + } + } + }, + "WafExpressionSet": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + } + }, + "fields": { + "aliases": { + "rule": "repeated", + "type": "string", + "id": 159207166 + }, + "expressions": { + "rule": "repeated", + "type": "WafExpressionSetExpression", + "id": 175554779 + }, + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + } + } + }, + "PreconfiguredWafSet": { + "fields": { + "expressionSets": { + "rule": "repeated", + "type": "WafExpressionSet", + "id": 474011032 + } + } + }, + "PreservedStatePreservedDisk": { + "oneofs": { + "_autoDelete": { + "oneof": [ + "autoDelete" + ] + }, + "_mode": { + "oneof": [ + "mode" + ] + }, + "_source": { + "oneof": [ + "source" + ] + } + }, + "fields": { + "autoDelete": { + "type": "AutoDelete", + "id": 464761403, + "options": { + "proto3_optional": true + } + }, + "mode": { + "type": "Mode", + "id": 3357091, + "options": { + "proto3_optional": true + } + }, + "source": { + "type": "string", + "id": 177235995, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "AutoDelete": { + "values": { + "UNDEFINED_AUTO_DELETE": 0, + "NEVER": 74175084, + "ON_PERMANENT_INSTANCE_DELETION": 95727719 + } + }, + "Mode": { + "values": { + "UNDEFINED_MODE": 0, + "READ_ONLY": 91950261, + "READ_WRITE": 173607894 + } + } + } + }, + "Quota": { + "oneofs": { + "_limit": { + "oneof": [ + "limit" + ] + }, + "_metric": { + "oneof": [ + "metric" + ] + }, + "_owner": { + "oneof": [ + "owner" + ] + }, + "_usage": { + "oneof": [ + "usage" + ] + } + }, + "fields": { + "limit": { + "type": "double", + "id": 102976443, + "options": { + "proto3_optional": true + } + }, + "metric": { + "type": "Metric", + "id": 533067184, + "options": { + "proto3_optional": true + } + }, + "owner": { + "type": "string", + "id": 106164915, + "options": { + "proto3_optional": true + } + }, + "usage": { + "type": "double", + "id": 111574433, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Metric": { + "values": { + "UNDEFINED_METRIC": 0, + "A2_CPUS": 153206585, + "AFFINITY_GROUPS": 108303563, + "AUTOSCALERS": 471248988, + "BACKEND_BUCKETS": 137626846, + "BACKEND_SERVICES": 269623753, + "C2D_CPUS": 508182517, + "C2_CPUS": 317601211, + "COMMITMENTS": 456141790, + "COMMITTED_A2_CPUS": 59330902, + "COMMITTED_C2D_CPUS": 282390904, + "COMMITTED_C2_CPUS": 223725528, + "COMMITTED_CPUS": 292394702, + "COMMITTED_E2_CPUS": 388120154, + "COMMITTED_LICENSES": 357606869, + "COMMITTED_LOCAL_SSD_TOTAL_GB": 308393480, + "COMMITTED_MEMORY_OPTIMIZED_CPUS": 489057886, + "COMMITTED_N2A_CPUS": 40064304, + "COMMITTED_N2D_CPUS": 125951757, + "COMMITTED_N2_CPUS": 322589603, + "COMMITTED_NVIDIA_A100_GPUS": 375799445, + "COMMITTED_NVIDIA_K80_GPUS": 3857188, + "COMMITTED_NVIDIA_P100_GPUS": 107528100, + "COMMITTED_NVIDIA_P4_GPUS": 347952897, + "COMMITTED_NVIDIA_T4_GPUS": 139871237, + "COMMITTED_NVIDIA_V100_GPUS": 219562, + "CPUS": 2075595, + "CPUS_ALL_REGIONS": 470911149, + "DISKS_TOTAL_GB": 353520543, + "E2_CPUS": 481995837, + "EXTERNAL_NETWORK_LB_FORWARDING_RULES": 374298265, + "EXTERNAL_PROTOCOL_FORWARDING_RULES": 63478888, + "EXTERNAL_VPN_GATEWAYS": 272457134, + "FIREWALLS": 374485843, + "FORWARDING_RULES": 432668949, + "GLOBAL_INTERNAL_ADDRESSES": 42738332, + "GPUS_ALL_REGIONS": 39387177, + "HEALTH_CHECKS": 289347502, + "IMAGES": 15562360, + "INSTANCES": 131337822, + "INSTANCE_GROUPS": 355919038, + "INSTANCE_GROUP_MANAGERS": 101798192, + "INSTANCE_TEMPLATES": 226188271, + "INTERCONNECTS": 415204741, + "INTERCONNECT_ATTACHMENTS_PER_REGION": 159968086, + "INTERCONNECT_ATTACHMENTS_TOTAL_MBPS": 425090419, + "INTERCONNECT_TOTAL_GBPS": 285341866, + "INTERNAL_ADDRESSES": 197899392, + "INTERNAL_TRAFFIC_DIRECTOR_FORWARDING_RULES": 266433668, + "IN_PLACE_SNAPSHOTS": 151359133, + "IN_USE_ADDRESSES": 402125072, + "IN_USE_BACKUP_SCHEDULES": 32786705, + "IN_USE_SNAPSHOT_SCHEDULES": 462104083, + "LOCAL_SSD_TOTAL_GB": 330878021, + "M1_CPUS": 37203366, + "M2_CPUS": 65832517, + "MACHINE_IMAGES": 446986640, + "N2A_CPUS": 265855917, + "N2D_CPUS": 351743370, + "N2_CPUS": 416465286, + "NETWORKS": 485481477, + "NETWORK_ENDPOINT_GROUPS": 102144909, + "NETWORK_FIREWALL_POLICIES": 101117374, + "NODE_GROUPS": 24624817, + "NODE_TEMPLATES": 474896668, + "NVIDIA_A100_GPUS": 504872978, + "NVIDIA_K80_GPUS": 163886599, + "NVIDIA_P100_GPUS": 236601633, + "NVIDIA_P100_VWS_GPUS": 213970574, + "NVIDIA_P4_GPUS": 283841470, + "NVIDIA_P4_VWS_GPUS": 528296619, + "NVIDIA_T4_GPUS": 75759810, + "NVIDIA_T4_VWS_GPUS": 319813039, + "NVIDIA_V100_GPUS": 129293095, + "PACKET_MIRRORINGS": 15578407, + "PD_EXTREME_TOTAL_PROVISIONED_IOPS": 69593965, + "PREEMPTIBLE_CPUS": 251184841, + "PREEMPTIBLE_LOCAL_SSD_GB": 260819336, + "PREEMPTIBLE_NVIDIA_A100_GPUS": 68832784, + "PREEMPTIBLE_NVIDIA_K80_GPUS": 374960201, + "PREEMPTIBLE_NVIDIA_P100_GPUS": 337432351, + "PREEMPTIBLE_NVIDIA_P100_VWS_GPUS": 313544076, + "PREEMPTIBLE_NVIDIA_P4_GPUS": 429197628, + "PREEMPTIBLE_NVIDIA_P4_VWS_GPUS": 252981545, + "PREEMPTIBLE_NVIDIA_T4_GPUS": 221115968, + "PREEMPTIBLE_NVIDIA_T4_VWS_GPUS": 44497965, + "PREEMPTIBLE_NVIDIA_V100_GPUS": 230123813, + "PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK": 231164291, + "PUBLIC_ADVERTISED_PREFIXES": 471371980, + "PUBLIC_DELEGATED_PREFIXES": 532465974, + "REGIONAL_AUTOSCALERS": 29363772, + "REGIONAL_INSTANCE_GROUP_MANAGERS": 37543696, + "RESERVATIONS": 32644647, + "RESOURCE_POLICIES": 83955297, + "ROUTERS": 493018666, + "ROUTES": 275680074, + "SECURITY_POLICIES": 189518703, + "SECURITY_POLICY_CEVAL_RULES": 470815689, + "SECURITY_POLICY_RULES": 203549225, + "SNAPSHOTS": 343405327, + "SSD_TOTAL_GB": 161732561, + "SSL_CERTIFICATES": 378372399, + "STATIC_ADDRESSES": 93624049, + "STATIC_BYOIP_ADDRESSES": 275809649, + "SUBNETWORKS": 421330469, + "TARGET_HTTPS_PROXIES": 219522506, + "TARGET_HTTP_PROXIES": 164117155, + "TARGET_INSTANCES": 284519728, + "TARGET_POOLS": 348261257, + "TARGET_SSL_PROXIES": 159216235, + "TARGET_TCP_PROXIES": 182243136, + "TARGET_VPN_GATEWAYS": 75029928, + "URL_MAPS": 378660743, + "VPN_GATEWAYS": 35620282, + "VPN_TUNNELS": 104327296, + "XPN_SERVICE_PROJECTS": 95191981 + } + } + } + }, + "UsageExportLocation": { + "oneofs": { + "_bucketName": { + "oneof": [ + "bucketName" + ] + }, + "_reportNamePrefix": { + "oneof": [ + "reportNamePrefix" + ] + } + }, + "fields": { + "bucketName": { + "type": "string", + "id": 283610048, + "options": { + "proto3_optional": true + } + }, + "reportNamePrefix": { + "type": "string", + "id": 320198715, + "options": { + "proto3_optional": true + } + } + } + }, + "Project": { + "oneofs": { + "_commonInstanceMetadata": { + "oneof": [ + "commonInstanceMetadata" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_defaultNetworkTier": { + "oneof": [ + "defaultNetworkTier" + ] + }, + "_defaultServiceAccount": { + "oneof": [ + "defaultServiceAccount" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_usageExportLocation": { + "oneof": [ + "usageExportLocation" + ] + }, + "_xpnProjectStatus": { + "oneof": [ + "xpnProjectStatus" + ] + } + }, + "fields": { + "commonInstanceMetadata": { + "type": "Metadata", + "id": 185794117, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "defaultNetworkTier": { + "type": "DefaultNetworkTier", + "id": 471753361, + "options": { + "proto3_optional": true + } + }, + "defaultServiceAccount": { + "type": "string", + "id": 298712229, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "enabledFeatures": { + "rule": "repeated", + "type": "string", + "id": 469017467 + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "quotas": { + "rule": "repeated", + "type": "Quota", + "id": 125341947 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "usageExportLocation": { + "type": "UsageExportLocation", + "id": 347543874, + "options": { + "proto3_optional": true + } + }, + "xpnProjectStatus": { + "type": "XpnProjectStatus", + "id": 228419265, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "DefaultNetworkTier": { + "values": { + "UNDEFINED_DEFAULT_NETWORK_TIER": 0, + "PREMIUM": 399530551, + "STANDARD": 484642493 + } + }, + "XpnProjectStatus": { + "values": { + "UNDEFINED_XPN_PROJECT_STATUS": 0, + "HOST": 2223528, + "UNSPECIFIED_XPN_PROJECT_STATUS": 340393257 + } + } + } + }, + "XpnResourceId": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "PROJECT": 408671993, + "XPN_RESOURCE_TYPE_UNSPECIFIED": 151607034 + } + } + } + }, + "ProjectsDisableXpnResourceRequest": { + "oneofs": { + "_xpnResource": { + "oneof": [ + "xpnResource" + ] + } + }, + "fields": { + "xpnResource": { + "type": "XpnResourceId", + "id": 133384631, + "options": { + "proto3_optional": true + } + } + } + }, + "ProjectsEnableXpnResourceRequest": { + "oneofs": { + "_xpnResource": { + "oneof": [ + "xpnResource" + ] + } + }, + "fields": { + "xpnResource": { + "type": "XpnResourceId", + "id": 133384631, + "options": { + "proto3_optional": true + } + } + } + }, + "ProjectsGetXpnResources": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "resources": { + "rule": "repeated", + "type": "XpnResourceId", + "id": 164412965 + } + } + }, + "ProjectsListXpnHostsRequest": { + "oneofs": { + "_organization": { + "oneof": [ + "organization" + ] + } + }, + "fields": { + "organization": { + "type": "string", + "id": 105180467, + "options": { + "proto3_optional": true + } + } + } + }, + "ProjectsSetDefaultNetworkTierRequest": { + "oneofs": { + "_networkTier": { + "oneof": [ + "networkTier" + ] + } + }, + "fields": { + "networkTier": { + "type": "NetworkTier", + "id": 517397843, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "NetworkTier": { + "values": { + "UNDEFINED_NETWORK_TIER": 0, + "PREMIUM": 399530551, + "STANDARD": 484642493 + } + } + } + }, + "PublicAdvertisedPrefixPublicDelegatedPrefix": { + "oneofs": { + "_ipRange": { + "oneof": [ + "ipRange" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_project": { + "oneof": [ + "project" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "ipRange": { + "type": "string", + "id": 145092645, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "string", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + } + }, + "PublicAdvertisedPrefix": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_dnsVerificationIp": { + "oneof": [ + "dnsVerificationIp" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_sharedSecret": { + "oneof": [ + "sharedSecret" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "dnsVerificationIp": { + "type": "string", + "id": 241011381, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "publicDelegatedPrefixs": { + "rule": "repeated", + "type": "PublicAdvertisedPrefixPublicDelegatedPrefix", + "id": 425811723 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sharedSecret": { + "type": "string", + "id": 381932490, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "INITIAL": 518841124, + "PREFIX_CONFIGURATION_COMPLETE": 480889551, + "PREFIX_CONFIGURATION_IN_PROGRESS": 378550961, + "PREFIX_REMOVAL_IN_PROGRESS": 284375783, + "PTR_CONFIGURED": 513497167, + "REVERSE_DNS_LOOKUP_FAILED": 295755183, + "VALIDATED": 66197998 + } + } + } + }, + "PublicAdvertisedPrefixList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "PublicAdvertisedPrefix", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "PublicDelegatedPrefixPublicDelegatedSubPrefix": { + "oneofs": { + "_delegateeProject": { + "oneof": [ + "delegateeProject" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_isAddress": { + "oneof": [ + "isAddress" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "delegateeProject": { + "type": "string", + "id": 414860634, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "isAddress": { + "type": "bool", + "id": 352617951, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "ACTIVE": 314733318, + "INACTIVE": 270421099 + } + } + } + }, + "PublicDelegatedPrefix": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_isLiveMigration": { + "oneof": [ + "isLiveMigration" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_parentPrefix": { + "oneof": [ + "parentPrefix" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "isLiveMigration": { + "type": "bool", + "id": 511823856, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "parentPrefix": { + "type": "string", + "id": 15233991, + "options": { + "proto3_optional": true + } + }, + "publicDelegatedSubPrefixs": { + "rule": "repeated", + "type": "PublicDelegatedPrefixPublicDelegatedSubPrefix", + "id": 188940044 + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "ANNOUNCED": 365103355, + "DELETING": 528602024, + "INITIALIZING": 306588749 + } + } + } + }, + "PublicDelegatedPrefixesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "publicDelegatedPrefixes": { + "rule": "repeated", + "type": "PublicDelegatedPrefix", + "id": 315261206 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "PublicDelegatedPrefixAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "PublicDelegatedPrefixesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "PublicDelegatedPrefixList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "PublicDelegatedPrefix", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "Region": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_supportsPzs": { + "oneof": [ + "supportsPzs" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "DeprecationStatus", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "quotas": { + "rule": "repeated", + "type": "Quota", + "id": 125341947 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "supportsPzs": { + "type": "bool", + "id": 83983214, + "options": { + "proto3_optional": true + } + }, + "zones": { + "rule": "repeated", + "type": "string", + "id": 116085319 + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "DOWN": 2104482, + "UP": 2715 + } + } + } + }, + "RegionAutoscalerList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Autoscaler", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionDiskTypeList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "DiskType", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionDisksAddResourcePoliciesRequest": { + "fields": { + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + } + } + }, + "RegionDisksRemoveResourcePoliciesRequest": { + "fields": { + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22220385 + } + } + }, + "RegionDisksResizeRequest": { + "oneofs": { + "_sizeGb": { + "oneof": [ + "sizeGb" + ] + } + }, + "fields": { + "sizeGb": { + "type": "int64", + "id": 494929369, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InstanceGroup", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupManagerDeleteInstanceConfigReq": { + "fields": { + "names": { + "rule": "repeated", + "type": "string", + "id": 104585032 + } + } + }, + "RegionInstanceGroupManagerList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InstanceGroupManager", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupManagerPatchInstanceConfigReq": { + "fields": { + "perInstanceConfigs": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 526265001 + } + } + }, + "RegionInstanceGroupManagerUpdateInstanceConfigReq": { + "fields": { + "perInstanceConfigs": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 526265001 + } + } + }, + "RegionInstanceGroupManagersAbandonInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + } + } + }, + "RegionInstanceGroupManagersApplyUpdatesRequest": { + "oneofs": { + "_allInstances": { + "oneof": [ + "allInstances" + ] + }, + "_minimalAction": { + "oneof": [ + "minimalAction" + ] + }, + "_mostDisruptiveAllowedAction": { + "oneof": [ + "mostDisruptiveAllowedAction" + ] + } + }, + "fields": { + "allInstances": { + "type": "bool", + "id": 403676512, + "options": { + "proto3_optional": true + } + }, + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + }, + "minimalAction": { + "type": "string", + "id": 270567060, + "options": { + "proto3_optional": true + } + }, + "mostDisruptiveAllowedAction": { + "type": "string", + "id": 66103053, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupManagersCreateInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 29097598 + } + } + }, + "RegionInstanceGroupManagersDeleteInstancesRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + } + } + }, + "RegionInstanceGroupManagersListErrorsResponse": { + "oneofs": { + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + } + }, + "fields": { + "items": { + "rule": "repeated", + "type": "InstanceManagedByIgmError", + "id": 100526016 + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupManagersListInstanceConfigsResp": { + "oneofs": { + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "items": { + "rule": "repeated", + "type": "PerInstanceConfig", + "id": 100526016 + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupManagersListInstancesResponse": { + "oneofs": { + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + } + }, + "fields": { + "managedInstances": { + "rule": "repeated", + "type": "ManagedInstance", + "id": 336219614 + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupManagersRecreateRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + } + } + }, + "RegionInstanceGroupManagersSetTargetPoolsRequest": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + } + }, + "fields": { + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "targetPools": { + "rule": "repeated", + "type": "string", + "id": 336072617 + } + } + }, + "RegionInstanceGroupManagersSetTemplateRequest": { + "oneofs": { + "_instanceTemplate": { + "oneof": [ + "instanceTemplate" + ] + } + }, + "fields": { + "instanceTemplate": { + "type": "string", + "id": 309248228, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupsListInstances": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "InstanceWithNamedPorts", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionInstanceGroupsListInstancesRequest": { + "oneofs": { + "_instanceState": { + "oneof": [ + "instanceState" + ] + }, + "_portName": { + "oneof": [ + "portName" + ] + } + }, + "fields": { + "instanceState": { + "type": "InstanceState", + "id": 92223591, + "options": { + "proto3_optional": true + } + }, + "portName": { + "type": "string", + "id": 41534345, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "InstanceState": { + "values": { + "UNDEFINED_INSTANCE_STATE": 0, + "ALL": 64897, + "RUNNING": 121282975 + } + } + } + }, + "RegionInstanceGroupsSetNamedPortsRequest": { + "oneofs": { + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + } + }, + "fields": { + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "namedPorts": { + "rule": "repeated", + "type": "NamedPort", + "id": 427598732 + } + } + }, + "RegionList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Region", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionSetLabelsRequest": { + "oneofs": { + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + } + }, + "fields": { + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + } + } + }, + "RegionSetPolicyRequest": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_policy": { + "oneof": [ + "policy" + ] + } + }, + "fields": { + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 403251854 + }, + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "policy": { + "type": "Policy", + "id": 91071794, + "options": { + "proto3_optional": true + } + } + } + }, + "RegionTargetHttpsProxiesSetSslCertificatesRequest": { + "fields": { + "sslCertificates": { + "rule": "repeated", + "type": "string", + "id": 366006543 + } + } + }, + "UrlMap": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_defaultRouteAction": { + "oneof": [ + "defaultRouteAction" + ] + }, + "_defaultService": { + "oneof": [ + "defaultService" + ] + }, + "_defaultUrlRedirect": { + "oneof": [ + "defaultUrlRedirect" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_headerAction": { + "oneof": [ + "headerAction" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "defaultRouteAction": { + "type": "HttpRouteAction", + "id": 378919466, + "options": { + "proto3_optional": true + } + }, + "defaultService": { + "type": "string", + "id": 370242231, + "options": { + "proto3_optional": true + } + }, + "defaultUrlRedirect": { + "type": "HttpRedirectAction", + "id": 359503338, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "headerAction": { + "type": "HttpHeaderAction", + "id": 328077352, + "options": { + "proto3_optional": true + } + }, + "hostRules": { + "rule": "repeated", + "type": "HostRule", + "id": 311804832 + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "pathMatchers": { + "rule": "repeated", + "type": "PathMatcher", + "id": 271664219 + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "tests": { + "rule": "repeated", + "type": "UrlMapTest", + "id": 110251553 + } + } + }, + "RegionUrlMapsValidateRequest": { + "oneofs": { + "_resource": { + "oneof": [ + "resource" + ] + } + }, + "fields": { + "resource": { + "type": "UrlMap", + "id": 195806222, + "options": { + "proto3_optional": true + } + } + } + }, + "ReservationsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "reservations": { + "rule": "repeated", + "type": "Reservation", + "id": 399717927 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ReservationAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "ReservationsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ReservationList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Reservation", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ReservationsResizeRequest": { + "oneofs": { + "_specificSkuCount": { + "oneof": [ + "specificSkuCount" + ] + } + }, + "fields": { + "specificSkuCount": { + "type": "int64", + "id": 13890720, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourceGroupReference": { + "oneofs": { + "_group": { + "oneof": [ + "group" + ] + } + }, + "fields": { + "group": { + "type": "string", + "id": 98629247, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_groupPlacementPolicy": { + "oneof": [ + "groupPlacementPolicy" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_instanceSchedulePolicy": { + "oneof": [ + "instanceSchedulePolicy" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_resourceStatus": { + "oneof": [ + "resourceStatus" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_snapshotSchedulePolicy": { + "oneof": [ + "snapshotSchedulePolicy" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "groupPlacementPolicy": { + "type": "ResourcePolicyGroupPlacementPolicy", + "id": 10931596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "instanceSchedulePolicy": { + "type": "ResourcePolicyInstanceSchedulePolicy", + "id": 344877104, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "resourceStatus": { + "type": "ResourcePolicyResourceStatus", + "id": 249429315, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "snapshotSchedulePolicy": { + "type": "ResourcePolicySnapshotSchedulePolicy", + "id": 218131295, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "EXPIRED": 482489093, + "INVALID": 530283991, + "READY": 77848963 + } + } + } + }, + "ResourcePoliciesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "resourcePolicies": { + "rule": "repeated", + "type": "ResourcePolicy", + "id": 22220385 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyGroupPlacementPolicy": { + "oneofs": { + "_availabilityDomainCount": { + "oneof": [ + "availabilityDomainCount" + ] + }, + "_collocation": { + "oneof": [ + "collocation" + ] + }, + "_vmCount": { + "oneof": [ + "vmCount" + ] + } + }, + "fields": { + "availabilityDomainCount": { + "type": "int32", + "id": 12453432, + "options": { + "proto3_optional": true + } + }, + "collocation": { + "type": "Collocation", + "id": 511156533, + "options": { + "proto3_optional": true + } + }, + "vmCount": { + "type": "int32", + "id": 261463431, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Collocation": { + "values": { + "UNDEFINED_COLLOCATION": 0, + "COLLOCATED": 103257554, + "UNSPECIFIED_COLLOCATION": 464308205 + } + } + } + }, + "ResourcePolicyInstanceSchedulePolicy": { + "oneofs": { + "_expirationTime": { + "oneof": [ + "expirationTime" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + }, + "_timeZone": { + "oneof": [ + "timeZone" + ] + }, + "_vmStartSchedule": { + "oneof": [ + "vmStartSchedule" + ] + }, + "_vmStopSchedule": { + "oneof": [ + "vmStopSchedule" + ] + } + }, + "fields": { + "expirationTime": { + "type": "string", + "id": 230299229, + "options": { + "proto3_optional": true + } + }, + "startTime": { + "type": "string", + "id": 37467274, + "options": { + "proto3_optional": true + } + }, + "timeZone": { + "type": "string", + "id": 36848094, + "options": { + "proto3_optional": true + } + }, + "vmStartSchedule": { + "type": "ResourcePolicyInstanceSchedulePolicySchedule", + "id": 17762396, + "options": { + "proto3_optional": true + } + }, + "vmStopSchedule": { + "type": "ResourcePolicyInstanceSchedulePolicySchedule", + "id": 426242732, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyResourceStatus": { + "oneofs": { + "_instanceSchedulePolicy": { + "oneof": [ + "instanceSchedulePolicy" + ] + } + }, + "fields": { + "instanceSchedulePolicy": { + "type": "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus", + "id": 344877104, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicySnapshotSchedulePolicy": { + "oneofs": { + "_retentionPolicy": { + "oneof": [ + "retentionPolicy" + ] + }, + "_schedule": { + "oneof": [ + "schedule" + ] + }, + "_snapshotProperties": { + "oneof": [ + "snapshotProperties" + ] + } + }, + "fields": { + "retentionPolicy": { + "type": "ResourcePolicySnapshotSchedulePolicyRetentionPolicy", + "id": 68625779, + "options": { + "proto3_optional": true + } + }, + "schedule": { + "type": "ResourcePolicySnapshotSchedulePolicySchedule", + "id": 375820951, + "options": { + "proto3_optional": true + } + }, + "snapshotProperties": { + "type": "ResourcePolicySnapshotSchedulePolicySnapshotProperties", + "id": 185371278, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyAggregatedList": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "ResourcePoliciesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyDailyCycle": { + "oneofs": { + "_daysInCycle": { + "oneof": [ + "daysInCycle" + ] + }, + "_duration": { + "oneof": [ + "duration" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + } + }, + "fields": { + "daysInCycle": { + "type": "int32", + "id": 369790004, + "options": { + "proto3_optional": true + } + }, + "duration": { + "type": "string", + "id": 155471252, + "options": { + "proto3_optional": true + } + }, + "startTime": { + "type": "string", + "id": 37467274, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyHourlyCycle": { + "oneofs": { + "_duration": { + "oneof": [ + "duration" + ] + }, + "_hoursInCycle": { + "oneof": [ + "hoursInCycle" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + } + }, + "fields": { + "duration": { + "type": "string", + "id": 155471252, + "options": { + "proto3_optional": true + } + }, + "hoursInCycle": { + "type": "int32", + "id": 526763132, + "options": { + "proto3_optional": true + } + }, + "startTime": { + "type": "string", + "id": 37467274, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyInstanceSchedulePolicySchedule": { + "oneofs": { + "_schedule": { + "oneof": [ + "schedule" + ] + } + }, + "fields": { + "schedule": { + "type": "string", + "id": 375820951, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyList": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "ResourcePolicy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicyResourceStatusInstanceSchedulePolicyStatus": { + "oneofs": { + "_lastRunStartTime": { + "oneof": [ + "lastRunStartTime" + ] + }, + "_nextRunStartTime": { + "oneof": [ + "nextRunStartTime" + ] + } + }, + "fields": { + "lastRunStartTime": { + "type": "string", + "id": 303069063, + "options": { + "proto3_optional": true + } + }, + "nextRunStartTime": { + "type": "string", + "id": 318642570, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicySnapshotSchedulePolicyRetentionPolicy": { + "oneofs": { + "_maxRetentionDays": { + "oneof": [ + "maxRetentionDays" + ] + }, + "_onSourceDiskDelete": { + "oneof": [ + "onSourceDiskDelete" + ] + } + }, + "fields": { + "maxRetentionDays": { + "type": "int32", + "id": 324296979, + "options": { + "proto3_optional": true + } + }, + "onSourceDiskDelete": { + "type": "OnSourceDiskDelete", + "id": 321955529, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "OnSourceDiskDelete": { + "values": { + "UNDEFINED_ON_SOURCE_DISK_DELETE": 0, + "APPLY_RETENTION_POLICY": 535071332, + "KEEP_AUTO_SNAPSHOTS": 258925689, + "UNSPECIFIED_ON_SOURCE_DISK_DELETE": 239140769 + } + } + } + }, + "ResourcePolicySnapshotSchedulePolicySchedule": { + "oneofs": { + "_dailySchedule": { + "oneof": [ + "dailySchedule" + ] + }, + "_hourlySchedule": { + "oneof": [ + "hourlySchedule" + ] + }, + "_weeklySchedule": { + "oneof": [ + "weeklySchedule" + ] + } + }, + "fields": { + "dailySchedule": { + "type": "ResourcePolicyDailyCycle", + "id": 86159869, + "options": { + "proto3_optional": true + } + }, + "hourlySchedule": { + "type": "ResourcePolicyHourlyCycle", + "id": 38328485, + "options": { + "proto3_optional": true + } + }, + "weeklySchedule": { + "type": "ResourcePolicyWeeklyCycle", + "id": 359548053, + "options": { + "proto3_optional": true + } + } + } + }, + "ResourcePolicySnapshotSchedulePolicySnapshotProperties": { + "oneofs": { + "_chainName": { + "oneof": [ + "chainName" + ] + }, + "_guestFlush": { + "oneof": [ + "guestFlush" + ] + } + }, + "fields": { + "chainName": { + "type": "string", + "id": 68644169, + "options": { + "proto3_optional": true + } + }, + "guestFlush": { + "type": "bool", + "id": 385550813, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "storageLocations": { + "rule": "repeated", + "type": "string", + "id": 328005274 + } + } + }, + "ResourcePolicyWeeklyCycle": { + "fields": { + "dayOfWeeks": { + "rule": "repeated", + "type": "ResourcePolicyWeeklyCycleDayOfWeek", + "id": 257871834 + } + } + }, + "ResourcePolicyWeeklyCycleDayOfWeek": { + "oneofs": { + "_day": { + "oneof": [ + "day" + ] + }, + "_duration": { + "oneof": [ + "duration" + ] + }, + "_startTime": { + "oneof": [ + "startTime" + ] + } + }, + "fields": { + "day": { + "type": "Day", + "id": 99228, + "options": { + "proto3_optional": true + } + }, + "duration": { + "type": "string", + "id": 155471252, + "options": { + "proto3_optional": true + } + }, + "startTime": { + "type": "string", + "id": 37467274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Day": { + "values": { + "UNDEFINED_DAY": 0, + "FRIDAY": 471398751, + "INVALID": 530283991, + "MONDAY": 132310288, + "SATURDAY": 279037881, + "SUNDAY": 309626320, + "THURSDAY": 207198682, + "TUESDAY": 277509677, + "WEDNESDAY": 422029110 + } + } + } + }, + "Route": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_destRange": { + "oneof": [ + "destRange" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_nextHopGateway": { + "oneof": [ + "nextHopGateway" + ] + }, + "_nextHopIlb": { + "oneof": [ + "nextHopIlb" + ] + }, + "_nextHopInstance": { + "oneof": [ + "nextHopInstance" + ] + }, + "_nextHopIp": { + "oneof": [ + "nextHopIp" + ] + }, + "_nextHopNetwork": { + "oneof": [ + "nextHopNetwork" + ] + }, + "_nextHopPeering": { + "oneof": [ + "nextHopPeering" + ] + }, + "_nextHopVpnTunnel": { + "oneof": [ + "nextHopVpnTunnel" + ] + }, + "_priority": { + "oneof": [ + "priority" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "destRange": { + "type": "string", + "id": 381327712, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "nextHopGateway": { + "type": "string", + "id": 377175298, + "options": { + "proto3_optional": true + } + }, + "nextHopIlb": { + "type": "string", + "id": 198679901, + "options": { + "proto3_optional": true + } + }, + "nextHopInstance": { + "type": "string", + "id": 393508247, + "options": { + "proto3_optional": true + } + }, + "nextHopIp": { + "type": "string", + "id": 110319529, + "options": { + "proto3_optional": true + } + }, + "nextHopNetwork": { + "type": "string", + "id": 262295788, + "options": { + "proto3_optional": true + } + }, + "nextHopPeering": { + "type": "string", + "id": 412682750, + "options": { + "proto3_optional": true + } + }, + "nextHopVpnTunnel": { + "type": "string", + "id": 519844501, + "options": { + "proto3_optional": true + } + }, + "priority": { + "type": "uint32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 3552281 + }, + "warnings": { + "rule": "repeated", + "type": "Warnings", + "id": 498091095 + } + } + }, + "RouteList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Route", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RouterBgp": { + "oneofs": { + "_advertiseMode": { + "oneof": [ + "advertiseMode" + ] + }, + "_asn": { + "oneof": [ + "asn" + ] + } + }, + "fields": { + "advertiseMode": { + "type": "AdvertiseMode", + "id": 312134331, + "options": { + "proto3_optional": true + } + }, + "advertisedGroups": { + "rule": "repeated", + "type": "AdvertisedGroups", + "id": 21065526 + }, + "advertisedIpRanges": { + "rule": "repeated", + "type": "RouterAdvertisedIpRange", + "id": 35449932 + }, + "asn": { + "type": "uint32", + "id": 96892, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "AdvertiseMode": { + "values": { + "UNDEFINED_ADVERTISE_MODE": 0, + "CUSTOM": 388595569, + "DEFAULT": 115302945 + } + }, + "AdvertisedGroups": { + "values": { + "UNDEFINED_ADVERTISED_GROUPS": 0, + "ALL_SUBNETS": 3622872 + } + } + } + }, + "RouterBgpPeer": { + "oneofs": { + "_advertiseMode": { + "oneof": [ + "advertiseMode" + ] + }, + "_advertisedRoutePriority": { + "oneof": [ + "advertisedRoutePriority" + ] + }, + "_interfaceName": { + "oneof": [ + "interfaceName" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_managementType": { + "oneof": [ + "managementType" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_peerAsn": { + "oneof": [ + "peerAsn" + ] + }, + "_peerIpAddress": { + "oneof": [ + "peerIpAddress" + ] + } + }, + "fields": { + "advertiseMode": { + "type": "AdvertiseMode", + "id": 312134331, + "options": { + "proto3_optional": true + } + }, + "advertisedGroups": { + "rule": "repeated", + "type": "AdvertisedGroups", + "id": 21065526 + }, + "advertisedIpRanges": { + "rule": "repeated", + "type": "RouterAdvertisedIpRange", + "id": 35449932 + }, + "advertisedRoutePriority": { + "type": "uint32", + "id": 186486332, + "options": { + "proto3_optional": true + } + }, + "interfaceName": { + "type": "string", + "id": 437854673, + "options": { + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 406272220, + "options": { + "proto3_optional": true + } + }, + "managementType": { + "type": "ManagementType", + "id": 173703606, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "peerAsn": { + "type": "uint32", + "id": 69573151, + "options": { + "proto3_optional": true + } + }, + "peerIpAddress": { + "type": "string", + "id": 207735769, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "AdvertiseMode": { + "values": { + "UNDEFINED_ADVERTISE_MODE": 0, + "CUSTOM": 388595569, + "DEFAULT": 115302945 + } + }, + "AdvertisedGroups": { + "values": { + "UNDEFINED_ADVERTISED_GROUPS": 0, + "ALL_SUBNETS": 3622872 + } + }, + "ManagementType": { + "values": { + "UNDEFINED_MANAGEMENT_TYPE": 0, + "MANAGED_BY_ATTACHMENT": 458926411, + "MANAGED_BY_USER": 317294067 + } + } + } + }, + "RouterInterface": { + "oneofs": { + "_ipRange": { + "oneof": [ + "ipRange" + ] + }, + "_linkedInterconnectAttachment": { + "oneof": [ + "linkedInterconnectAttachment" + ] + }, + "_linkedVpnTunnel": { + "oneof": [ + "linkedVpnTunnel" + ] + }, + "_managementType": { + "oneof": [ + "managementType" + ] + }, + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "ipRange": { + "type": "string", + "id": 145092645, + "options": { + "proto3_optional": true + } + }, + "linkedInterconnectAttachment": { + "type": "string", + "id": 501085518, + "options": { + "proto3_optional": true + } + }, + "linkedVpnTunnel": { + "type": "string", + "id": 352296953, + "options": { + "proto3_optional": true + } + }, + "managementType": { + "type": "ManagementType", + "id": 173703606, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ManagementType": { + "values": { + "UNDEFINED_MANAGEMENT_TYPE": 0, + "MANAGED_BY_ATTACHMENT": 458926411, + "MANAGED_BY_USER": 317294067 + } + } + } + }, + "RouterNat": { + "oneofs": { + "_enableEndpointIndependentMapping": { + "oneof": [ + "enableEndpointIndependentMapping" + ] + }, + "_icmpIdleTimeoutSec": { + "oneof": [ + "icmpIdleTimeoutSec" + ] + }, + "_logConfig": { + "oneof": [ + "logConfig" + ] + }, + "_minPortsPerVm": { + "oneof": [ + "minPortsPerVm" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_natIpAllocateOption": { + "oneof": [ + "natIpAllocateOption" + ] + }, + "_sourceSubnetworkIpRangesToNat": { + "oneof": [ + "sourceSubnetworkIpRangesToNat" + ] + }, + "_tcpEstablishedIdleTimeoutSec": { + "oneof": [ + "tcpEstablishedIdleTimeoutSec" + ] + }, + "_tcpTransitoryIdleTimeoutSec": { + "oneof": [ + "tcpTransitoryIdleTimeoutSec" + ] + }, + "_udpIdleTimeoutSec": { + "oneof": [ + "udpIdleTimeoutSec" + ] + } + }, + "fields": { + "drainNatIps": { + "rule": "repeated", + "type": "string", + "id": 504078535 + }, + "enableEndpointIndependentMapping": { + "type": "bool", + "id": 259441819, + "options": { + "proto3_optional": true + } + }, + "icmpIdleTimeoutSec": { + "type": "int32", + "id": 3647562, + "options": { + "proto3_optional": true + } + }, + "logConfig": { + "type": "RouterNatLogConfig", + "id": 351299741, + "options": { + "proto3_optional": true + } + }, + "minPortsPerVm": { + "type": "int32", + "id": 186193587, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "natIpAllocateOption": { + "type": "NatIpAllocateOption", + "id": 429726845, + "options": { + "proto3_optional": true + } + }, + "natIps": { + "rule": "repeated", + "type": "string", + "id": 117635086 + }, + "sourceSubnetworkIpRangesToNat": { + "type": "SourceSubnetworkIpRangesToNat", + "id": 252213211, + "options": { + "proto3_optional": true + } + }, + "subnetworks": { + "rule": "repeated", + "type": "RouterNatSubnetworkToNat", + "id": 415853125 + }, + "tcpEstablishedIdleTimeoutSec": { + "type": "int32", + "id": 223098349, + "options": { + "proto3_optional": true + } + }, + "tcpTransitoryIdleTimeoutSec": { + "type": "int32", + "id": 205028774, + "options": { + "proto3_optional": true + } + }, + "udpIdleTimeoutSec": { + "type": "int32", + "id": 64919878, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "NatIpAllocateOption": { + "values": { + "UNDEFINED_NAT_IP_ALLOCATE_OPTION": 0, + "AUTO_ONLY": 182333500, + "MANUAL_ONLY": 261251205 + } + }, + "SourceSubnetworkIpRangesToNat": { + "values": { + "UNDEFINED_SOURCE_SUBNETWORK_IP_RANGES_TO_NAT": 0, + "ALL_SUBNETWORKS_ALL_IP_RANGES": 179964376, + "ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES": 185573819, + "LIST_OF_SUBNETWORKS": 517542270 + } + } + } + }, + "Router": { + "oneofs": { + "_bgp": { + "oneof": [ + "bgp" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_encryptedInterconnectRouter": { + "oneof": [ + "encryptedInterconnectRouter" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "bgp": { + "type": "RouterBgp", + "id": 97483, + "options": { + "proto3_optional": true + } + }, + "bgpPeers": { + "rule": "repeated", + "type": "RouterBgpPeer", + "id": 452695773 + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "encryptedInterconnectRouter": { + "type": "bool", + "id": 297996575, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "interfaces": { + "rule": "repeated", + "type": "RouterInterface", + "id": 12073562 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "nats": { + "rule": "repeated", + "type": "RouterNat", + "id": 3373938 + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + } + }, + "RouterAdvertisedIpRange": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_range": { + "oneof": [ + "range" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "range": { + "type": "string", + "id": 108280125, + "options": { + "proto3_optional": true + } + } + } + }, + "RoutersScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "routers": { + "rule": "repeated", + "type": "Router", + "id": 311906890 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RouterAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "RoutersScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RouterList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Router", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "RouterNatLogConfig": { + "oneofs": { + "_enable": { + "oneof": [ + "enable" + ] + }, + "_filter": { + "oneof": [ + "filter" + ] + } + }, + "fields": { + "enable": { + "type": "bool", + "id": 311764355, + "options": { + "proto3_optional": true + } + }, + "filter": { + "type": "Filter", + "id": 336120696, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Filter": { + "values": { + "UNDEFINED_FILTER": 0, + "ALL": 64897, + "ERRORS_ONLY": 307484672, + "TRANSLATIONS_ONLY": 357212649 + } + } + } + }, + "RouterNatSubnetworkToNat": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "secondaryIpRangeNames": { + "rule": "repeated", + "type": "string", + "id": 264315097 + }, + "sourceIpRangesToNat": { + "rule": "repeated", + "type": "SourceIpRangesToNat", + "id": 388310386 + } + }, + "nested": { + "SourceIpRangesToNat": { + "values": { + "UNDEFINED_SOURCE_IP_RANGES_TO_NAT": 0, + "ALL_IP_RANGES": 35608496, + "LIST_OF_SECONDARY_IP_RANGES": 192289308, + "PRIMARY_IP_RANGE": 297109954 + } + } + } + }, + "RouterStatusBgpPeerStatus": { + "oneofs": { + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_linkedVpnTunnel": { + "oneof": [ + "linkedVpnTunnel" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_numLearnedRoutes": { + "oneof": [ + "numLearnedRoutes" + ] + }, + "_peerIpAddress": { + "oneof": [ + "peerIpAddress" + ] + }, + "_state": { + "oneof": [ + "state" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_uptime": { + "oneof": [ + "uptime" + ] + }, + "_uptimeSeconds": { + "oneof": [ + "uptimeSeconds" + ] + } + }, + "fields": { + "advertisedRoutes": { + "rule": "repeated", + "type": "Route", + "id": 333393068 + }, + "ipAddress": { + "type": "string", + "id": 406272220, + "options": { + "proto3_optional": true + } + }, + "linkedVpnTunnel": { + "type": "string", + "id": 352296953, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "numLearnedRoutes": { + "type": "uint32", + "id": 135457535, + "options": { + "proto3_optional": true + } + }, + "peerIpAddress": { + "type": "string", + "id": 207735769, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "string", + "id": 109757585, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "uptime": { + "type": "string", + "id": 235379688, + "options": { + "proto3_optional": true + } + }, + "uptimeSeconds": { + "type": "string", + "id": 104736040, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "DOWN": 2104482, + "UNKNOWN": 433141802, + "UP": 2715 + } + } + } + }, + "RouterStatusNatStatus": { + "oneofs": { + "_minExtraNatIpsNeeded": { + "oneof": [ + "minExtraNatIpsNeeded" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_numVmEndpointsWithNatMappings": { + "oneof": [ + "numVmEndpointsWithNatMappings" + ] + } + }, + "fields": { + "autoAllocatedNatIps": { + "rule": "repeated", + "type": "string", + "id": 510794246 + }, + "drainAutoAllocatedNatIps": { + "rule": "repeated", + "type": "string", + "id": 309184557 + }, + "drainUserAllocatedNatIps": { + "rule": "repeated", + "type": "string", + "id": 305268553 + }, + "minExtraNatIpsNeeded": { + "type": "int32", + "id": 365786338, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "numVmEndpointsWithNatMappings": { + "type": "int32", + "id": 512367468, + "options": { + "proto3_optional": true + } + }, + "userAllocatedNatIpResources": { + "rule": "repeated", + "type": "string", + "id": 212776151 + }, + "userAllocatedNatIps": { + "rule": "repeated", + "type": "string", + "id": 506878242 + } + } + }, + "RouterStatus": { + "oneofs": { + "_network": { + "oneof": [ + "network" + ] + } + }, + "fields": { + "bestRoutes": { + "rule": "repeated", + "type": "Route", + "id": 395826693 + }, + "bestRoutesForRouter": { + "rule": "repeated", + "type": "Route", + "id": 119389689 + }, + "bgpPeerStatus": { + "rule": "repeated", + "type": "RouterStatusBgpPeerStatus", + "id": 218459131 + }, + "natStatus": { + "rule": "repeated", + "type": "RouterStatusNatStatus", + "id": 63098064 + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + } + } + }, + "RouterStatusResponse": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + }, + "_result": { + "oneof": [ + "result" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "result": { + "type": "RouterStatus", + "id": 139315229, + "options": { + "proto3_optional": true + } + } + } + }, + "RoutersPreviewResponse": { + "oneofs": { + "_resource": { + "oneof": [ + "resource" + ] + } + }, + "fields": { + "resource": { + "type": "Router", + "id": 195806222, + "options": { + "proto3_optional": true + } + } + } + }, + "SchedulingNodeAffinity": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_operator": { + "oneof": [ + "operator" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 106079, + "options": { + "proto3_optional": true + } + }, + "operator": { + "type": "Operator", + "id": 36317348, + "options": { + "proto3_optional": true + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 249928994 + } + }, + "nested": { + "Operator": { + "values": { + "UNDEFINED_OPERATOR": 0, + "IN": 2341, + "NOT_IN": 161144369, + "OPERATOR_UNSPECIFIED": 128892924 + } + } + } + }, + "Screenshot": { + "oneofs": { + "_contents": { + "oneof": [ + "contents" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + } + }, + "fields": { + "contents": { + "type": "string", + "id": 506419994, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + } + } + }, + "SecurityPoliciesWafConfig": { + "oneofs": { + "_wafRules": { + "oneof": [ + "wafRules" + ] + } + }, + "fields": { + "wafRules": { + "type": "PreconfiguredWafSet", + "id": 74899924, + "options": { + "proto3_optional": true + } + } + } + }, + "SecurityPoliciesListPreconfiguredExpressionSetsResponse": { + "oneofs": { + "_preconfiguredExpressionSets": { + "oneof": [ + "preconfiguredExpressionSets" + ] + } + }, + "fields": { + "preconfiguredExpressionSets": { + "type": "SecurityPoliciesWafConfig", + "id": 536200826, + "options": { + "proto3_optional": true + } + } + } + }, + "SecurityPolicyRule": { + "oneofs": { + "_action": { + "oneof": [ + "action" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_match": { + "oneof": [ + "match" + ] + }, + "_preview": { + "oneof": [ + "preview" + ] + }, + "_priority": { + "oneof": [ + "priority" + ] + } + }, + "fields": { + "action": { + "type": "string", + "id": 187661878, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "match": { + "type": "SecurityPolicyRuleMatcher", + "id": 103668165, + "options": { + "proto3_optional": true + } + }, + "preview": { + "type": "bool", + "id": 218686408, + "options": { + "proto3_optional": true + } + }, + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + } + } + }, + "SecurityPolicy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "rules": { + "rule": "repeated", + "type": "SecurityPolicyRule", + "id": 108873975 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + } + } + }, + "SecurityPolicyList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "SecurityPolicy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SecurityPolicyReference": { + "oneofs": { + "_securityPolicy": { + "oneof": [ + "securityPolicy" + ] + } + }, + "fields": { + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "proto3_optional": true + } + } + } + }, + "SecurityPolicyRuleMatcher": { + "oneofs": { + "_config": { + "oneof": [ + "config" + ] + }, + "_expr": { + "oneof": [ + "expr" + ] + }, + "_versionedExpr": { + "oneof": [ + "versionedExpr" + ] + } + }, + "fields": { + "config": { + "type": "SecurityPolicyRuleMatcherConfig", + "id": 255820610, + "options": { + "proto3_optional": true + } + }, + "expr": { + "type": "Expr", + "id": 3127797, + "options": { + "proto3_optional": true + } + }, + "versionedExpr": { + "type": "VersionedExpr", + "id": 322286013, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "VersionedExpr": { + "values": { + "UNDEFINED_VERSIONED_EXPR": 0, + "SRC_IPS_V1": 70925961 + } + } + } + }, + "SecurityPolicyRuleMatcherConfig": { + "fields": { + "srcIpRanges": { + "rule": "repeated", + "type": "string", + "id": 432128083 + } + } + }, + "SerialPortOutput": { + "oneofs": { + "_contents": { + "oneof": [ + "contents" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_next": { + "oneof": [ + "next" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_start": { + "oneof": [ + "start" + ] + } + }, + "fields": { + "contents": { + "type": "string", + "id": 506419994, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "next": { + "type": "int64", + "id": 3377907, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "start": { + "type": "int64", + "id": 109757538, + "options": { + "proto3_optional": true + } + } + } + }, + "ShieldedInstanceIdentityEntry": { + "oneofs": { + "_ekCert": { + "oneof": [ + "ekCert" + ] + }, + "_ekPub": { + "oneof": [ + "ekPub" + ] + } + }, + "fields": { + "ekCert": { + "type": "string", + "id": 450178589, + "options": { + "proto3_optional": true + } + }, + "ekPub": { + "type": "string", + "id": 308947940, + "options": { + "proto3_optional": true + } + } + } + }, + "ShieldedInstanceIdentity": { + "oneofs": { + "_encryptionKey": { + "oneof": [ + "encryptionKey" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_signingKey": { + "oneof": [ + "signingKey" + ] + } + }, + "fields": { + "encryptionKey": { + "type": "ShieldedInstanceIdentityEntry", + "id": 488268707, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "signingKey": { + "type": "ShieldedInstanceIdentityEntry", + "id": 320948261, + "options": { + "proto3_optional": true + } + } + } + }, + "SignedUrlKey": { + "oneofs": { + "_keyName": { + "oneof": [ + "keyName" + ] + }, + "_keyValue": { + "oneof": [ + "keyValue" + ] + } + }, + "fields": { + "keyName": { + "type": "string", + "id": 500938859, + "options": { + "proto3_optional": true + } + }, + "keyValue": { + "type": "string", + "id": 504106897, + "options": { + "proto3_optional": true + } + } + } + }, + "Snapshot": { + "oneofs": { + "_autoCreated": { + "oneof": [ + "autoCreated" + ] + }, + "_chainName": { + "oneof": [ + "chainName" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_downloadBytes": { + "oneof": [ + "downloadBytes" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + }, + "_locationHint": { + "oneof": [ + "locationHint" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_snapshotEncryptionKey": { + "oneof": [ + "snapshotEncryptionKey" + ] + }, + "_sourceDisk": { + "oneof": [ + "sourceDisk" + ] + }, + "_sourceDiskEncryptionKey": { + "oneof": [ + "sourceDiskEncryptionKey" + ] + }, + "_sourceDiskId": { + "oneof": [ + "sourceDiskId" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_storageBytes": { + "oneof": [ + "storageBytes" + ] + }, + "_storageBytesStatus": { + "oneof": [ + "storageBytesStatus" + ] + } + }, + "fields": { + "autoCreated": { + "type": "bool", + "id": 463922264, + "options": { + "proto3_optional": true + } + }, + "chainName": { + "type": "string", + "id": 68644169, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "diskSizeGb": { + "type": "int64", + "id": 316263735, + "options": { + "proto3_optional": true + } + }, + "downloadBytes": { + "type": "int64", + "id": 435054068, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "licenseCodes": { + "rule": "repeated", + "type": "int64", + "id": 45482664 + }, + "licenses": { + "rule": "repeated", + "type": "string", + "id": 337642578 + }, + "locationHint": { + "type": "string", + "id": 350519505, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 480964267, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "snapshotEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 43334526, + "options": { + "proto3_optional": true + } + }, + "sourceDisk": { + "type": "string", + "id": 451753793, + "options": { + "proto3_optional": true + } + }, + "sourceDiskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 531501153, + "options": { + "proto3_optional": true + } + }, + "sourceDiskId": { + "type": "string", + "id": 454190809, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "storageBytes": { + "type": "int64", + "id": 424631719, + "options": { + "proto3_optional": true + } + }, + "storageBytesStatus": { + "type": "StorageBytesStatus", + "id": 490739082, + "options": { + "proto3_optional": true + } + }, + "storageLocations": { + "rule": "repeated", + "type": "string", + "id": 328005274 + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "FAILED": 455706685, + "READY": 77848963, + "UPLOADING": 267603489 + } + }, + "StorageBytesStatus": { + "values": { + "UNDEFINED_STORAGE_BYTES_STATUS": 0, + "UPDATING": 494614342, + "UP_TO_DATE": 101306702 + } + } + } + }, + "SnapshotList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Snapshot", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SslCertificateManagedSslCertificate": { + "oneofs": { + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "domainStatus": { + "keyType": "string", + "type": "string", + "id": 360305613 + }, + "domains": { + "rule": "repeated", + "type": "string", + "id": 226935855 + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "ACTIVE": 314733318, + "MANAGED_CERTIFICATE_STATUS_UNSPECIFIED": 474800850, + "PROVISIONING": 290896621, + "PROVISIONING_FAILED": 76813775, + "PROVISIONING_FAILED_PERMANENTLY": 275036203, + "RENEWAL_FAILED": 434659076 + } + } + } + }, + "SslCertificateSelfManagedSslCertificate": { + "oneofs": { + "_certificate": { + "oneof": [ + "certificate" + ] + }, + "_privateKey": { + "oneof": [ + "privateKey" + ] + } + }, + "fields": { + "certificate": { + "type": "string", + "id": 341787031, + "options": { + "proto3_optional": true + } + }, + "privateKey": { + "type": "string", + "id": 361331107, + "options": { + "proto3_optional": true + } + } + } + }, + "SslCertificate": { + "oneofs": { + "_certificate": { + "oneof": [ + "certificate" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_expireTime": { + "oneof": [ + "expireTime" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_managed": { + "oneof": [ + "managed" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_privateKey": { + "oneof": [ + "privateKey" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_selfManaged": { + "oneof": [ + "selfManaged" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "certificate": { + "type": "string", + "id": 341787031, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "expireTime": { + "type": "string", + "id": 440691181, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "managed": { + "type": "SslCertificateManagedSslCertificate", + "id": 298389407, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "privateKey": { + "type": "string", + "id": 361331107, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "selfManaged": { + "type": "SslCertificateSelfManagedSslCertificate", + "id": 329284012, + "options": { + "proto3_optional": true + } + }, + "subjectAlternativeNames": { + "rule": "repeated", + "type": "string", + "id": 528807907 + }, + "type": { + "type": "Type", + "id": 3575610, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Type": { + "values": { + "UNDEFINED_TYPE": 0, + "MANAGED": 479501183, + "SELF_MANAGED": 434437516, + "TYPE_UNSPECIFIED": 437714322 + } + } + } + }, + "SslCertificatesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "sslCertificates": { + "rule": "repeated", + "type": "SslCertificate", + "id": 366006543 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SslCertificateAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "SslCertificatesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SslCertificateList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "SslCertificate", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SslPolicy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_minTlsVersion": { + "oneof": [ + "minTlsVersion" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_profile": { + "oneof": [ + "profile" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "customFeatures": { + "rule": "repeated", + "type": "string", + "id": 34789707 + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "enabledFeatures": { + "rule": "repeated", + "type": "string", + "id": 469017467 + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "minTlsVersion": { + "type": "MinTlsVersion", + "id": 8155943, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "profile": { + "type": "Profile", + "id": 227445161, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warnings": { + "rule": "repeated", + "type": "Warnings", + "id": 498091095 + } + }, + "nested": { + "MinTlsVersion": { + "values": { + "UNDEFINED_MIN_TLS_VERSION": 0, + "TLS_1_0": 33116734, + "TLS_1_1": 33116735, + "TLS_1_2": 33116736 + } + }, + "Profile": { + "values": { + "UNDEFINED_PROFILE": 0, + "COMPATIBLE": 179357396, + "CUSTOM": 388595569, + "MODERN": 132013855, + "RESTRICTED": 261551195 + } + } + } + }, + "SslPoliciesList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "SslPolicy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SslPoliciesListAvailableFeaturesResponse": { + "fields": { + "features": { + "rule": "repeated", + "type": "string", + "id": 246211645 + } + } + }, + "SslPolicyReference": { + "oneofs": { + "_sslPolicy": { + "oneof": [ + "sslPolicy" + ] + } + }, + "fields": { + "sslPolicy": { + "type": "string", + "id": 295190213, + "options": { + "proto3_optional": true + } + } + } + }, + "StatefulPolicyPreservedState": { + "fields": { + "disks": { + "keyType": "string", + "type": "StatefulPolicyPreservedStateDiskDevice", + "id": 95594102 + } + } + }, + "StatefulPolicyPreservedStateDiskDevice": { + "oneofs": { + "_autoDelete": { + "oneof": [ + "autoDelete" + ] + } + }, + "fields": { + "autoDelete": { + "type": "AutoDelete", + "id": 464761403, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "AutoDelete": { + "values": { + "UNDEFINED_AUTO_DELETE": 0, + "NEVER": 74175084, + "ON_PERMANENT_INSTANCE_DELETION": 95727719 + } + } + } + }, + "SubnetworkLogConfig": { + "oneofs": { + "_aggregationInterval": { + "oneof": [ + "aggregationInterval" + ] + }, + "_enable": { + "oneof": [ + "enable" + ] + }, + "_filterExpr": { + "oneof": [ + "filterExpr" + ] + }, + "_flowSampling": { + "oneof": [ + "flowSampling" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + } + }, + "fields": { + "aggregationInterval": { + "type": "AggregationInterval", + "id": 174919042, + "options": { + "proto3_optional": true + } + }, + "enable": { + "type": "bool", + "id": 311764355, + "options": { + "proto3_optional": true + } + }, + "filterExpr": { + "type": "string", + "id": 183374428, + "options": { + "proto3_optional": true + } + }, + "flowSampling": { + "type": "float", + "id": 530150360, + "options": { + "proto3_optional": true + } + }, + "metadata": { + "type": "Metadata", + "id": 86866735, + "options": { + "proto3_optional": true + } + }, + "metadataFields": { + "rule": "repeated", + "type": "string", + "id": 378461641 + } + }, + "nested": { + "AggregationInterval": { + "values": { + "UNDEFINED_AGGREGATION_INTERVAL": 0, + "INTERVAL_10_MIN": 487155916, + "INTERVAL_15_MIN": 491773521, + "INTERVAL_1_MIN": 69052714, + "INTERVAL_30_SEC": 7548937, + "INTERVAL_5_MIN": 72746798, + "INTERVAL_5_SEC": 72752429 + } + }, + "Metadata": { + "values": { + "UNDEFINED_METADATA": 0, + "CUSTOM_METADATA": 62450749, + "EXCLUDE_ALL_METADATA": 334519954, + "INCLUDE_ALL_METADATA": 164619908 + } + } + } + }, + "SubnetworkSecondaryRange": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_rangeName": { + "oneof": [ + "rangeName" + ] + } + }, + "fields": { + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "rangeName": { + "type": "string", + "id": 332216397, + "options": { + "proto3_optional": true + } + } + } + }, + "Subnetwork": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_enableFlowLogs": { + "oneof": [ + "enableFlowLogs" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_gatewayAddress": { + "oneof": [ + "gatewayAddress" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_ipv6CidrRange": { + "oneof": [ + "ipv6CidrRange" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_logConfig": { + "oneof": [ + "logConfig" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_privateIpGoogleAccess": { + "oneof": [ + "privateIpGoogleAccess" + ] + }, + "_privateIpv6GoogleAccess": { + "oneof": [ + "privateIpv6GoogleAccess" + ] + }, + "_purpose": { + "oneof": [ + "purpose" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_role": { + "oneof": [ + "role" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_state": { + "oneof": [ + "state" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "enableFlowLogs": { + "type": "bool", + "id": 151544420, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "gatewayAddress": { + "type": "string", + "id": 459867385, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "ipv6CidrRange": { + "type": "string", + "id": 273141258, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "logConfig": { + "type": "SubnetworkLogConfig", + "id": 351299741, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "privateIpGoogleAccess": { + "type": "bool", + "id": 421491790, + "options": { + "proto3_optional": true + } + }, + "privateIpv6GoogleAccess": { + "type": "PrivateIpv6GoogleAccess", + "id": 48277006, + "options": { + "proto3_optional": true + } + }, + "purpose": { + "type": "Purpose", + "id": 316407070, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "role": { + "type": "Role", + "id": 3506294, + "options": { + "proto3_optional": true + } + }, + "secondaryIpRanges": { + "rule": "repeated", + "type": "SubnetworkSecondaryRange", + "id": 136658915 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "PrivateIpv6GoogleAccess": { + "values": { + "UNDEFINED_PRIVATE_IPV6_GOOGLE_ACCESS": 0, + "DISABLE_GOOGLE_ACCESS": 450958579, + "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": 427975994, + "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": 288210263 + } + }, + "Purpose": { + "values": { + "UNDEFINED_PURPOSE": 0, + "INTERNAL_HTTPS_LOAD_BALANCER": 248748889, + "PRIVATE": 403485027, + "PRIVATE_RFC_1918": 254902107 + } + }, + "Role": { + "values": { + "UNDEFINED_ROLE": 0, + "ACTIVE": 314733318, + "BACKUP": 341010882 + } + }, + "State": { + "values": { + "UNDEFINED_STATE": 0, + "DRAINING": 480455402, + "READY": 77848963 + } + } + } + }, + "SubnetworksScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "subnetworks": { + "rule": "repeated", + "type": "Subnetwork", + "id": 415853125 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SubnetworkAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "SubnetworksScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SubnetworkList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Subnetwork", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "SubnetworksExpandIpCidrRangeRequest": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + } + }, + "fields": { + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + } + } + }, + "SubnetworksSetPrivateIpGoogleAccessRequest": { + "oneofs": { + "_privateIpGoogleAccess": { + "oneof": [ + "privateIpGoogleAccess" + ] + } + }, + "fields": { + "privateIpGoogleAccess": { + "type": "bool", + "id": 421491790, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetGrpcProxy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_selfLinkWithId": { + "oneof": [ + "selfLinkWithId" + ] + }, + "_urlMap": { + "oneof": [ + "urlMap" + ] + }, + "_validateForProxyless": { + "oneof": [ + "validateForProxyless" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "selfLinkWithId": { + "type": "string", + "id": 44520962, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "proto3_optional": true + } + }, + "validateForProxyless": { + "type": "bool", + "id": 101822888, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetGrpcProxyList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetGrpcProxy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetHttpProxy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_proxyBind": { + "oneof": [ + "proxyBind" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_urlMap": { + "oneof": [ + "urlMap" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "proxyBind": { + "type": "bool", + "id": 286025582, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetHttpProxiesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "targetHttpProxies": { + "rule": "repeated", + "type": "TargetHttpProxy", + "id": 162147011 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetHttpProxyAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "TargetHttpProxiesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + } + } + }, + "TargetHttpProxyList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetHttpProxy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetHttpsProxy": { + "oneofs": { + "_authorizationPolicy": { + "oneof": [ + "authorizationPolicy" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_fingerprint": { + "oneof": [ + "fingerprint" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_proxyBind": { + "oneof": [ + "proxyBind" + ] + }, + "_quicOverride": { + "oneof": [ + "quicOverride" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_serverTlsPolicy": { + "oneof": [ + "serverTlsPolicy" + ] + }, + "_sslPolicy": { + "oneof": [ + "sslPolicy" + ] + }, + "_urlMap": { + "oneof": [ + "urlMap" + ] + } + }, + "fields": { + "authorizationPolicy": { + "type": "string", + "id": 33945528, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "fingerprint": { + "type": "string", + "id": 234678500, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "proxyBind": { + "type": "bool", + "id": 286025582, + "options": { + "proto3_optional": true + } + }, + "quicOverride": { + "type": "QuicOverride", + "id": 456577197, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "serverTlsPolicy": { + "type": "string", + "id": 295825266, + "options": { + "proto3_optional": true + } + }, + "sslCertificates": { + "rule": "repeated", + "type": "string", + "id": 366006543 + }, + "sslPolicy": { + "type": "string", + "id": 295190213, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "QuicOverride": { + "values": { + "UNDEFINED_QUIC_OVERRIDE": 0, + "DISABLE": 241807048, + "ENABLE": 438835587, + "NONE": 2402104 + } + } + } + }, + "TargetHttpsProxiesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "targetHttpsProxies": { + "rule": "repeated", + "type": "TargetHttpsProxy", + "id": 366607882 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetHttpsProxiesSetQuicOverrideRequest": { + "oneofs": { + "_quicOverride": { + "oneof": [ + "quicOverride" + ] + } + }, + "fields": { + "quicOverride": { + "type": "QuicOverride", + "id": 456577197, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "QuicOverride": { + "values": { + "UNDEFINED_QUIC_OVERRIDE": 0, + "DISABLE": 241807048, + "ENABLE": 438835587, + "NONE": 2402104 + } + } + } + }, + "TargetHttpsProxiesSetSslCertificatesRequest": { + "fields": { + "sslCertificates": { + "rule": "repeated", + "type": "string", + "id": 366006543 + } + } + }, + "TargetHttpsProxyAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "TargetHttpsProxiesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetHttpsProxyList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetHttpsProxy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetInstance": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_instance": { + "oneof": [ + "instance" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_natPolicy": { + "oneof": [ + "natPolicy" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "natPolicy": { + "type": "NatPolicy", + "id": 509780496, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "NatPolicy": { + "values": { + "UNDEFINED_NAT_POLICY": 0, + "NO_NAT": 161455491 + } + } + } + }, + "TargetInstancesScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "targetInstances": { + "rule": "repeated", + "type": "TargetInstance", + "id": 392915280 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetInstanceAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "TargetInstancesScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetInstanceList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetInstance", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetPool": { + "oneofs": { + "_backupPool": { + "oneof": [ + "backupPool" + ] + }, + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_failoverRatio": { + "oneof": [ + "failoverRatio" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_sessionAffinity": { + "oneof": [ + "sessionAffinity" + ] + } + }, + "fields": { + "backupPool": { + "type": "string", + "id": 45884537, + "options": { + "proto3_optional": true + } + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "failoverRatio": { + "type": "float", + "id": 212667006, + "options": { + "proto3_optional": true + } + }, + "healthChecks": { + "rule": "repeated", + "type": "string", + "id": 448370606 + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "instances": { + "rule": "repeated", + "type": "string", + "id": 29097598 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sessionAffinity": { + "type": "SessionAffinity", + "id": 463888561, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "SessionAffinity": { + "values": { + "UNDEFINED_SESSION_AFFINITY": 0, + "CLIENT_IP": 345665051, + "CLIENT_IP_NO_DESTINATION": 106122516, + "CLIENT_IP_PORT_PROTO": 221722926, + "CLIENT_IP_PROTO": 25322148, + "GENERATED_COOKIE": 370321204, + "HEADER_FIELD": 200737960, + "HTTP_COOKIE": 494981627, + "NONE": 2402104 + } + } + } + }, + "TargetPoolsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "targetPools": { + "rule": "repeated", + "type": "TargetPool", + "id": 336072617 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetPoolAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "TargetPoolsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetPoolInstanceHealth": { + "oneofs": { + "_kind": { + "oneof": [ + "kind" + ] + } + }, + "fields": { + "healthStatus": { + "rule": "repeated", + "type": "HealthStatus", + "id": 380545845 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetPoolList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetPool", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetPoolsAddHealthCheckRequest": { + "fields": { + "healthChecks": { + "rule": "repeated", + "type": "HealthCheckReference", + "id": 448370606 + } + } + }, + "TargetPoolsAddInstanceRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "InstanceReference", + "id": 29097598 + } + } + }, + "TargetPoolsRemoveHealthCheckRequest": { + "fields": { + "healthChecks": { + "rule": "repeated", + "type": "HealthCheckReference", + "id": 448370606 + } + } + }, + "TargetPoolsRemoveInstanceRequest": { + "fields": { + "instances": { + "rule": "repeated", + "type": "InstanceReference", + "id": 29097598 + } + } + }, + "TargetReference": { + "oneofs": { + "_target": { + "oneof": [ + "target" + ] + } + }, + "fields": { + "target": { + "type": "string", + "id": 192835985, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetSslProxiesSetBackendServiceRequest": { + "oneofs": { + "_service": { + "oneof": [ + "service" + ] + } + }, + "fields": { + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetSslProxiesSetProxyHeaderRequest": { + "oneofs": { + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + } + }, + "fields": { + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "TargetSslProxiesSetSslCertificatesRequest": { + "fields": { + "sslCertificates": { + "rule": "repeated", + "type": "string", + "id": 366006543 + } + } + }, + "TargetSslProxy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_service": { + "oneof": [ + "service" + ] + }, + "_sslPolicy": { + "oneof": [ + "sslPolicy" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + }, + "sslCertificates": { + "rule": "repeated", + "type": "string", + "id": 366006543 + }, + "sslPolicy": { + "type": "string", + "id": 295190213, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "TargetSslProxyList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetSslProxy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetTcpProxiesSetBackendServiceRequest": { + "oneofs": { + "_service": { + "oneof": [ + "service" + ] + } + }, + "fields": { + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetTcpProxiesSetProxyHeaderRequest": { + "oneofs": { + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + } + }, + "fields": { + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "TargetTcpProxy": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_proxyBind": { + "oneof": [ + "proxyBind" + ] + }, + "_proxyHeader": { + "oneof": [ + "proxyHeader" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_service": { + "oneof": [ + "service" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "proxyBind": { + "type": "bool", + "id": 286025582, + "options": { + "proto3_optional": true + } + }, + "proxyHeader": { + "type": "ProxyHeader", + "id": 160374142, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "ProxyHeader": { + "values": { + "UNDEFINED_PROXY_HEADER": 0, + "NONE": 2402104, + "PROXY_V1": 334352940 + } + } + } + }, + "TargetTcpProxyList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetTcpProxy", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetVpnGateway": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_status": { + "oneof": [ + "status" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "forwardingRules": { + "rule": "repeated", + "type": "string", + "id": 315821365 + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "tunnels": { + "rule": "repeated", + "type": "string", + "id": 104561931 + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "CREATING": 455564985, + "DELETING": 528602024, + "FAILED": 455706685, + "READY": 77848963 + } + } + } + }, + "TargetVpnGatewaysScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "targetVpnGateways": { + "rule": "repeated", + "type": "TargetVpnGateway", + "id": 401770888 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetVpnGatewayAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "TargetVpnGatewaysScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "TargetVpnGatewayList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "TargetVpnGateway", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapTestHeader": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 111972721, + "options": { + "proto3_optional": true + } + } + } + }, + "TestFailure": { + "oneofs": { + "_actualOutputUrl": { + "oneof": [ + "actualOutputUrl" + ] + }, + "_actualRedirectResponseCode": { + "oneof": [ + "actualRedirectResponseCode" + ] + }, + "_actualService": { + "oneof": [ + "actualService" + ] + }, + "_expectedOutputUrl": { + "oneof": [ + "expectedOutputUrl" + ] + }, + "_expectedRedirectResponseCode": { + "oneof": [ + "expectedRedirectResponseCode" + ] + }, + "_expectedService": { + "oneof": [ + "expectedService" + ] + }, + "_host": { + "oneof": [ + "host" + ] + }, + "_path": { + "oneof": [ + "path" + ] + } + }, + "fields": { + "actualOutputUrl": { + "type": "string", + "id": 287075458, + "options": { + "proto3_optional": true + } + }, + "actualRedirectResponseCode": { + "type": "int32", + "id": 42926553, + "options": { + "proto3_optional": true + } + }, + "actualService": { + "type": "string", + "id": 440379652, + "options": { + "proto3_optional": true + } + }, + "expectedOutputUrl": { + "type": "string", + "id": 433967384, + "options": { + "proto3_optional": true + } + }, + "expectedRedirectResponseCode": { + "type": "int32", + "id": 18888047, + "options": { + "proto3_optional": true + } + }, + "expectedService": { + "type": "string", + "id": 133987374, + "options": { + "proto3_optional": true + } + }, + "headers": { + "rule": "repeated", + "type": "UrlMapTestHeader", + "id": 258436998 + }, + "host": { + "type": "string", + "id": 3208616, + "options": { + "proto3_optional": true + } + }, + "path": { + "type": "string", + "id": 3433509, + "options": { + "proto3_optional": true + } + } + } + }, + "TestPermissionsRequest": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 59962500 + } + } + }, + "TestPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 59962500 + } + } + }, + "UrlMapTest": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_expectedOutputUrl": { + "oneof": [ + "expectedOutputUrl" + ] + }, + "_expectedRedirectResponseCode": { + "oneof": [ + "expectedRedirectResponseCode" + ] + }, + "_host": { + "oneof": [ + "host" + ] + }, + "_path": { + "oneof": [ + "path" + ] + }, + "_service": { + "oneof": [ + "service" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "expectedOutputUrl": { + "type": "string", + "id": 433967384, + "options": { + "proto3_optional": true + } + }, + "expectedRedirectResponseCode": { + "type": "int32", + "id": 18888047, + "options": { + "proto3_optional": true + } + }, + "headers": { + "rule": "repeated", + "type": "UrlMapTestHeader", + "id": 258436998 + }, + "host": { + "type": "string", + "id": 3208616, + "options": { + "proto3_optional": true + } + }, + "path": { + "type": "string", + "id": 3433509, + "options": { + "proto3_optional": true + } + }, + "service": { + "type": "string", + "id": 373540533, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "UrlMap", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapReference": { + "oneofs": { + "_urlMap": { + "oneof": [ + "urlMap" + ] + } + }, + "fields": { + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapValidationResult": { + "oneofs": { + "_loadSucceeded": { + "oneof": [ + "loadSucceeded" + ] + }, + "_testPassed": { + "oneof": [ + "testPassed" + ] + } + }, + "fields": { + "loadErrors": { + "rule": "repeated", + "type": "string", + "id": 310147300 + }, + "loadSucceeded": { + "type": "bool", + "id": 128326216, + "options": { + "proto3_optional": true + } + }, + "testFailures": { + "rule": "repeated", + "type": "TestFailure", + "id": 505934134 + }, + "testPassed": { + "type": "bool", + "id": 192708797, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "urlMaps": { + "rule": "repeated", + "type": "UrlMap", + "id": 103352167 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapsAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "UrlMapsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapsValidateRequest": { + "oneofs": { + "_resource": { + "oneof": [ + "resource" + ] + } + }, + "fields": { + "resource": { + "type": "UrlMap", + "id": 195806222, + "options": { + "proto3_optional": true + } + } + } + }, + "UrlMapsValidateResponse": { + "oneofs": { + "_result": { + "oneof": [ + "result" + ] + } + }, + "fields": { + "result": { + "type": "UrlMapValidationResult", + "id": 139315229, + "options": { + "proto3_optional": true + } + } + } + }, + "UsableSubnetworkSecondaryRange": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_rangeName": { + "oneof": [ + "rangeName" + ] + } + }, + "fields": { + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "rangeName": { + "type": "string", + "id": 332216397, + "options": { + "proto3_optional": true + } + } + } + }, + "UsableSubnetwork": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + } + }, + "fields": { + "ipCidrRange": { + "type": "string", + "id": 98117322, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "secondaryIpRanges": { + "rule": "repeated", + "type": "UsableSubnetworkSecondaryRange", + "id": 136658915 + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "proto3_optional": true + } + } + } + }, + "UsableSubnetworksAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "UsableSubnetwork", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "VmEndpointNatMappingsInterfaceNatMappings": { + "oneofs": { + "_numTotalDrainNatPorts": { + "oneof": [ + "numTotalDrainNatPorts" + ] + }, + "_numTotalNatPorts": { + "oneof": [ + "numTotalNatPorts" + ] + }, + "_sourceAliasIpRange": { + "oneof": [ + "sourceAliasIpRange" + ] + }, + "_sourceVirtualIp": { + "oneof": [ + "sourceVirtualIp" + ] + } + }, + "fields": { + "drainNatIpPortRanges": { + "rule": "repeated", + "type": "string", + "id": 395440577 + }, + "natIpPortRanges": { + "rule": "repeated", + "type": "string", + "id": 531830810 + }, + "numTotalDrainNatPorts": { + "type": "int32", + "id": 335532793, + "options": { + "proto3_optional": true + } + }, + "numTotalNatPorts": { + "type": "int32", + "id": 299904384, + "options": { + "proto3_optional": true + } + }, + "sourceAliasIpRange": { + "type": "string", + "id": 440340952, + "options": { + "proto3_optional": true + } + }, + "sourceVirtualIp": { + "type": "string", + "id": 149836159, + "options": { + "proto3_optional": true + } + } + } + }, + "VmEndpointNatMappings": { + "oneofs": { + "_instanceName": { + "oneof": [ + "instanceName" + ] + } + }, + "fields": { + "instanceName": { + "type": "string", + "id": 227947509, + "options": { + "proto3_optional": true + } + }, + "interfaceNatMappings": { + "rule": "repeated", + "type": "VmEndpointNatMappingsInterfaceNatMappings", + "id": 256196617 + } + } + }, + "VmEndpointNatMappingsList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "result": { + "rule": "repeated", + "type": "VmEndpointNatMappings", + "id": 139315229 + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnGatewayVpnGatewayInterface": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_interconnectAttachment": { + "oneof": [ + "interconnectAttachment" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + } + }, + "fields": { + "id": { + "type": "uint32", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "interconnectAttachment": { + "type": "string", + "id": 308135284, + "options": { + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 406272220, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnGateway": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_network": { + "oneof": [ + "network" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "vpnInterfaces": { + "rule": "repeated", + "type": "VpnGatewayVpnGatewayInterface", + "id": 91842181 + } + } + }, + "VpnGatewaysScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "vpnGateways": { + "rule": "repeated", + "type": "VpnGateway", + "id": 259177882 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnGatewayAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "VpnGatewaysScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnGatewayList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "VpnGateway", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnGatewayStatusVpnConnection": { + "oneofs": { + "_peerExternalGateway": { + "oneof": [ + "peerExternalGateway" + ] + }, + "_peerGcpGateway": { + "oneof": [ + "peerGcpGateway" + ] + }, + "_state": { + "oneof": [ + "state" + ] + } + }, + "fields": { + "peerExternalGateway": { + "type": "string", + "id": 384956173, + "options": { + "proto3_optional": true + } + }, + "peerGcpGateway": { + "type": "string", + "id": 281867452, + "options": { + "proto3_optional": true + } + }, + "state": { + "type": "VpnGatewayStatusHighAvailabilityRequirementState", + "id": 109757585, + "options": { + "proto3_optional": true + } + }, + "tunnels": { + "rule": "repeated", + "type": "VpnGatewayStatusTunnel", + "id": 104561931 + } + } + }, + "VpnGatewayStatus": { + "fields": { + "vpnConnections": { + "rule": "repeated", + "type": "VpnGatewayStatusVpnConnection", + "id": 439334538 + } + } + }, + "VpnGatewayStatusHighAvailabilityRequirementState": { + "oneofs": { + "_state": { + "oneof": [ + "state" + ] + }, + "_unsatisfiedReason": { + "oneof": [ + "unsatisfiedReason" + ] + } + }, + "fields": { + "state": { + "type": "State", + "id": 109757585, + "options": { + "proto3_optional": true + } + }, + "unsatisfiedReason": { + "type": "UnsatisfiedReason", + "id": 55016330, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "State": { + "values": { + "UNDEFINED_STATE": 0, + "CONNECTION_REDUNDANCY_MET": 505242907, + "CONNECTION_REDUNDANCY_NOT_MET": 511863311 + } + }, + "UnsatisfiedReason": { + "values": { + "UNDEFINED_UNSATISFIED_REASON": 0, + "INCOMPLETE_TUNNELS_COVERAGE": 55917437 + } + } + } + }, + "VpnGatewayStatusTunnel": { + "oneofs": { + "_localGatewayInterface": { + "oneof": [ + "localGatewayInterface" + ] + }, + "_peerGatewayInterface": { + "oneof": [ + "peerGatewayInterface" + ] + }, + "_tunnelUrl": { + "oneof": [ + "tunnelUrl" + ] + } + }, + "fields": { + "localGatewayInterface": { + "type": "uint32", + "id": 158764330, + "options": { + "proto3_optional": true + } + }, + "peerGatewayInterface": { + "type": "uint32", + "id": 214380385, + "options": { + "proto3_optional": true + } + }, + "tunnelUrl": { + "type": "string", + "id": 78975256, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnGatewaysGetStatusResponse": { + "oneofs": { + "_result": { + "oneof": [ + "result" + ] + } + }, + "fields": { + "result": { + "type": "VpnGatewayStatus", + "id": 139315229, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnTunnel": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_detailedStatus": { + "oneof": [ + "detailedStatus" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_ikeVersion": { + "oneof": [ + "ikeVersion" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_peerExternalGateway": { + "oneof": [ + "peerExternalGateway" + ] + }, + "_peerExternalGatewayInterface": { + "oneof": [ + "peerExternalGatewayInterface" + ] + }, + "_peerGcpGateway": { + "oneof": [ + "peerGcpGateway" + ] + }, + "_peerIp": { + "oneof": [ + "peerIp" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_router": { + "oneof": [ + "router" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_sharedSecret": { + "oneof": [ + "sharedSecret" + ] + }, + "_sharedSecretHash": { + "oneof": [ + "sharedSecretHash" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_targetVpnGateway": { + "oneof": [ + "targetVpnGateway" + ] + }, + "_vpnGateway": { + "oneof": [ + "vpnGateway" + ] + }, + "_vpnGatewayInterface": { + "oneof": [ + "vpnGatewayInterface" + ] + } + }, + "fields": { + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "detailedStatus": { + "type": "string", + "id": 333501025, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "ikeVersion": { + "type": "int32", + "id": 218376220, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "localTrafficSelector": { + "rule": "repeated", + "type": "string", + "id": 317314613 + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "peerExternalGateway": { + "type": "string", + "id": 384956173, + "options": { + "proto3_optional": true + } + }, + "peerExternalGatewayInterface": { + "type": "int32", + "id": 452768391, + "options": { + "proto3_optional": true + } + }, + "peerGcpGateway": { + "type": "string", + "id": 281867452, + "options": { + "proto3_optional": true + } + }, + "peerIp": { + "type": "string", + "id": 383249700, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "remoteTrafficSelector": { + "rule": "repeated", + "type": "string", + "id": 358887098 + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "sharedSecret": { + "type": "string", + "id": 381932490, + "options": { + "proto3_optional": true + } + }, + "sharedSecretHash": { + "type": "string", + "id": 398881891, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "targetVpnGateway": { + "type": "string", + "id": 532512843, + "options": { + "proto3_optional": true + } + }, + "vpnGateway": { + "type": "string", + "id": 406684153, + "options": { + "proto3_optional": true + } + }, + "vpnGatewayInterface": { + "type": "int32", + "id": 95979123, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "ALLOCATING_RESOURCES": 320922816, + "AUTHORIZATION_ERROR": 23580290, + "DEPROVISIONING": 428935662, + "ESTABLISHED": 88852344, + "FAILED": 455706685, + "FIRST_HANDSHAKE": 191393000, + "NEGOTIATION_FAILURE": 360325868, + "NETWORK_ERROR": 193912951, + "NO_INCOMING_PACKETS": 119983216, + "PROVISIONING": 290896621, + "REJECTED": 174130302, + "STOPPED": 444276141, + "WAITING_FOR_FULL_CONFIG": 41640522 + } + } + } + }, + "VpnTunnelsScopedList": { + "oneofs": { + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "vpnTunnels": { + "rule": "repeated", + "type": "VpnTunnel", + "id": 163494080 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnTunnelAggregatedList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "keyType": "string", + "type": "VpnTunnelsScopedList", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "unreachables": { + "rule": "repeated", + "type": "string", + "id": 243372063 + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "VpnTunnelList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "VpnTunnel", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "WafExpressionSetExpression": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + } + } + }, + "XpnHostList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Project", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "Zone": { + "oneofs": { + "_creationTimestamp": { + "oneof": [ + "creationTimestamp" + ] + }, + "_deprecated": { + "oneof": [ + "deprecated" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_status": { + "oneof": [ + "status" + ] + }, + "_supportsPzs": { + "oneof": [ + "supportsPzs" + ] + } + }, + "fields": { + "availableCpuPlatforms": { + "rule": "repeated", + "type": "string", + "id": 175536531 + }, + "creationTimestamp": { + "type": "string", + "id": 30525366, + "options": { + "proto3_optional": true + } + }, + "deprecated": { + "type": "DeprecationStatus", + "id": 515138995, + "options": { + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 422937596, + "options": { + "proto3_optional": true + } + }, + "id": { + "type": "uint64", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "status": { + "type": "Status", + "id": 181260274, + "options": { + "proto3_optional": true + } + }, + "supportsPzs": { + "type": "bool", + "id": 83983214, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Status": { + "values": { + "UNDEFINED_STATUS": 0, + "DOWN": 2104482, + "UP": 2715 + } + } + } + }, + "ZoneList": { + "oneofs": { + "_id": { + "oneof": [ + "id" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_nextPageToken": { + "oneof": [ + "nextPageToken" + ] + }, + "_selfLink": { + "oneof": [ + "selfLink" + ] + }, + "_warning": { + "oneof": [ + "warning" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3355, + "options": { + "proto3_optional": true + } + }, + "items": { + "rule": "repeated", + "type": "Zone", + "id": 100526016 + }, + "kind": { + "type": "string", + "id": 3292052, + "options": { + "proto3_optional": true + } + }, + "nextPageToken": { + "type": "string", + "id": 79797525, + "options": { + "proto3_optional": true + } + }, + "selfLink": { + "type": "string", + "id": 456214797, + "options": { + "proto3_optional": true + } + }, + "warning": { + "type": "Warning", + "id": 50704284, + "options": { + "proto3_optional": true + } + } + } + }, + "ZoneSetLabelsRequest": { + "oneofs": { + "_labelFingerprint": { + "oneof": [ + "labelFingerprint" + ] + } + }, + "fields": { + "labelFingerprint": { + "type": "string", + "id": 178124825, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 500195327 + } + } + }, + "ZoneSetPolicyRequest": { + "oneofs": { + "_etag": { + "oneof": [ + "etag" + ] + }, + "_policy": { + "oneof": [ + "policy" + ] + } + }, + "fields": { + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 403251854 + }, + "etag": { + "type": "string", + "id": 3123477, + "options": { + "proto3_optional": true + } + }, + "policy": { + "type": "Policy", + "id": 91071794, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListAcceleratorTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "GetAcceleratorTypeRequest": { + "fields": { + "acceleratorType": { + "type": "string", + "id": 138031246, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListAcceleratorTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListAddressesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteAddressRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "address": { + "type": "string", + "id": 462920692, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetAddressRequest": { + "fields": { + "address": { + "type": "string", + "id": 462920692, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertAddressRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "addressResource": { + "type": "Address", + "id": 483888121, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListAddressesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListAutoscalersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteAutoscalerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAutoscalerRequest": { + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertAutoscalerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscalerResource": { + "type": "Autoscaler", + "id": 207616118, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListAutoscalersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PatchAutoscalerRequest": { + "oneofs": { + "_autoscaler": { + "oneof": [ + "autoscaler" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "proto3_optional": true + } + }, + "autoscalerResource": { + "type": "Autoscaler", + "id": 207616118, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAutoscalerRequest": { + "oneofs": { + "_autoscaler": { + "oneof": [ + "autoscaler" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "proto3_optional": true + } + }, + "autoscalerResource": { + "type": "Autoscaler", + "id": 207616118, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddSignedUrlKeyBackendBucketRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendBucket": { + "type": "string", + "id": 91714037, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "signedUrlKeyResource": { + "type": "SignedUrlKey", + "id": 457625985, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteBackendBucketRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendBucket": { + "type": "string", + "id": 91714037, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteSignedUrlKeyBackendBucketRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendBucket": { + "type": "string", + "id": 91714037, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keyName": { + "type": "string", + "id": 500938859, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetBackendBucketRequest": { + "fields": { + "backendBucket": { + "type": "string", + "id": 91714037, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertBackendBucketRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendBucketResource": { + "type": "BackendBucket", + "id": 380757784, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListBackendBucketsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchBackendBucketRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendBucket": { + "type": "string", + "id": 91714037, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backendBucketResource": { + "type": "BackendBucket", + "id": 380757784, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateBackendBucketRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendBucket": { + "type": "string", + "id": 91714037, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backendBucketResource": { + "type": "BackendBucket", + "id": 380757784, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AddSignedUrlKeyBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "signedUrlKeyResource": { + "type": "SignedUrlKey", + "id": 457625985, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListBackendServicesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteSignedUrlKeyBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "keyName": { + "type": "string", + "id": 500938859, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetBackendServiceRequest": { + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetHealthBackendServiceRequest": { + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceGroupReferenceResource": { + "type": "ResourceGroupReference", + "id": 112951123, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendServiceResource": { + "type": "BackendService", + "id": 347586723, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListBackendServicesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backendServiceResource": { + "type": "BackendService", + "id": 347586723, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetSecurityPolicyBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "securityPolicyReferenceResource": { + "type": "SecurityPolicyReference", + "id": 204135024, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backendServiceResource": { + "type": "BackendService", + "id": 347586723, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListDiskTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "GetDiskTypeRequest": { + "fields": { + "diskType": { + "type": "string", + "id": 93009052, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListDiskTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddResourcePoliciesDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disksAddResourcePoliciesRequestResource": { + "type": "DisksAddResourcePoliciesRequest", + "id": 496483363, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListDisksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "CreateSnapshotDiskRequest": { + "oneofs": { + "_guestFlush": { + "oneof": [ + "guestFlush" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "guestFlush": { + "type": "bool", + "id": 385550813, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "snapshotResource": { + "type": "Snapshot", + "id": 481319977, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDiskRequest": { + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyDiskRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + }, + "_sourceImage": { + "oneof": [ + "sourceImage" + ] + } + }, + "fields": { + "diskResource": { + "type": "Disk", + "id": 25880688, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sourceImage": { + "type": "string", + "id": 50443319, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListDisksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveResourcePoliciesDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disksRemoveResourcePoliciesRequestResource": { + "type": "DisksRemoveResourcePoliciesRequest", + "id": 436756718, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ResizeDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "disksResizeRequestResource": { + "type": "DisksResizeRequest", + "id": 78307616, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetIamPolicyDiskRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zoneSetPolicyRequestResource": { + "type": "ZoneSetPolicyRequest", + "id": 382082107, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetLabelsDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zoneSetLabelsRequestResource": { + "type": "ZoneSetLabelsRequest", + "id": 364950798, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsDiskRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteExternalVpnGatewayRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "externalVpnGateway": { + "type": "string", + "id": 109898629, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetExternalVpnGatewayRequest": { + "fields": { + "externalVpnGateway": { + "type": "string", + "id": 109898629, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertExternalVpnGatewayRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "externalVpnGatewayResource": { + "type": "ExternalVpnGateway", + "id": 486813576, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListExternalVpnGatewaysRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetLabelsExternalVpnGatewayRequest": { + "fields": { + "globalSetLabelsRequestResource": { + "type": "GlobalSetLabelsRequest", + "id": 319917189, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsExternalVpnGatewayRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddAssociationFirewallPolicyRequest": { + "oneofs": { + "_replaceExistingAssociation": { + "oneof": [ + "replaceExistingAssociation" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallPolicyAssociationResource": { + "type": "FirewallPolicyAssociation", + "id": 259546170, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "replaceExistingAssociation": { + "type": "bool", + "id": 209541240, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AddRuleFirewallPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallPolicyRuleResource": { + "type": "FirewallPolicyRule", + "id": 250523523, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "CloneRulesFirewallPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + }, + "_sourceFirewallPolicy": { + "oneof": [ + "sourceFirewallPolicy" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sourceFirewallPolicy": { + "type": "string", + "id": 25013549, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteFirewallPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetFirewallPolicyRequest": { + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAssociationFirewallPolicyRequest": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + } + } + }, + "GetIamPolicyFirewallPolicyRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRuleFirewallPolicyRequest": { + "oneofs": { + "_priority": { + "oneof": [ + "priority" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + } + } + }, + "InsertFirewallPolicyRequest": { + "oneofs": { + "_parentId": { + "oneof": [ + "parentId" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicyResource": { + "type": "FirewallPolicy", + "id": 495049532, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parentId": { + "type": "string", + "id": 459714768, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListFirewallPoliciesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_parentId": { + "oneof": [ + "parentId" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "parentId": { + "type": "string", + "id": 459714768, + "options": { + "proto3_optional": true + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListAssociationsFirewallPolicyRequest": { + "oneofs": { + "_targetResource": { + "oneof": [ + "targetResource" + ] + } + }, + "fields": { + "targetResource": { + "type": "string", + "id": 467318524, + "options": { + "proto3_optional": true + } + } + } + }, + "MoveFirewallPolicyRequest": { + "oneofs": { + "_parentId": { + "oneof": [ + "parentId" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parentId": { + "type": "string", + "id": 459714768, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchFirewallPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallPolicyResource": { + "type": "FirewallPolicy", + "id": 495049532, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRuleFirewallPolicyRequest": { + "oneofs": { + "_priority": { + "oneof": [ + "priority" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallPolicyRuleResource": { + "type": "FirewallPolicyRule", + "id": 250523523, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "RemoveAssociationFirewallPolicyRequest": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 3373707, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "RemoveRuleFirewallPolicyRequest": { + "oneofs": { + "_priority": { + "oneof": [ + "priority" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallPolicy": { + "type": "string", + "id": 498173265, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicyFirewallPolicyRequest": { + "fields": { + "globalOrganizationSetPolicyRequestResource": { + "type": "GlobalOrganizationSetPolicyRequest", + "id": 177408606, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsFirewallPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteFirewallRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewall": { + "type": "string", + "id": 511016192, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetFirewallRequest": { + "fields": { + "firewall": { + "type": "string", + "id": 511016192, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertFirewallRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewallResource": { + "type": "Firewall", + "id": 41425005, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListFirewallsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchFirewallRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewall": { + "type": "string", + "id": 511016192, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallResource": { + "type": "Firewall", + "id": 41425005, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateFirewallRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "firewall": { + "type": "string", + "id": 511016192, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "firewallResource": { + "type": "Firewall", + "id": 41425005, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListForwardingRulesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetForwardingRuleRequest": { + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRuleResource": { + "type": "ForwardingRule", + "id": 301211695, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListForwardingRulesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "forwardingRuleResource": { + "type": "ForwardingRule", + "id": 301211695, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetLabelsForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionSetLabelsRequestResource": { + "type": "RegionSetLabelsRequest", + "id": 259357782, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetTargetForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetReferenceResource": { + "type": "TargetReference", + "id": 523721712, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGlobalAddressRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "address": { + "type": "string", + "id": 462920692, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetGlobalAddressRequest": { + "fields": { + "address": { + "type": "string", + "id": 462920692, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertGlobalAddressRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "addressResource": { + "type": "Address", + "id": 483888121, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListGlobalAddressesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteGlobalForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetGlobalForwardingRuleRequest": { + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertGlobalForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRuleResource": { + "type": "ForwardingRule", + "id": 301211695, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListGlobalForwardingRulesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchGlobalForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "forwardingRuleResource": { + "type": "ForwardingRule", + "id": 301211695, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetLabelsGlobalForwardingRuleRequest": { + "fields": { + "globalSetLabelsRequestResource": { + "type": "GlobalSetLabelsRequest", + "id": 319917189, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetTargetGlobalForwardingRuleRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forwardingRule": { + "type": "string", + "id": 269964030, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetReferenceResource": { + "type": "TargetReference", + "id": 523721712, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "globalNetworkEndpointGroupsAttachEndpointsRequestResource": { + "type": "GlobalNetworkEndpointGroupsAttachEndpointsRequest", + "id": 30691563, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteGlobalNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "globalNetworkEndpointGroupsDetachEndpointsRequestResource": { + "type": "GlobalNetworkEndpointGroupsDetachEndpointsRequest", + "id": 8898269, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetGlobalNetworkEndpointGroupRequest": { + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertGlobalNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroupResource": { + "type": "NetworkEndpointGroup", + "id": 525788839, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListGlobalNetworkEndpointGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListGlobalOperationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteGlobalOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGlobalOperationResponse": { + "fields": {} + }, + "GetGlobalOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListGlobalOperationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "WaitGlobalOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGlobalOrganizationOperationRequest": { + "oneofs": { + "_parentId": { + "oneof": [ + "parentId" + ] + } + }, + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parentId": { + "type": "string", + "id": 459714768, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteGlobalOrganizationOperationResponse": { + "fields": {} + }, + "GetGlobalOrganizationOperationRequest": { + "oneofs": { + "_parentId": { + "oneof": [ + "parentId" + ] + } + }, + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parentId": { + "type": "string", + "id": 459714768, + "options": { + "proto3_optional": true + } + } + } + }, + "ListGlobalOrganizationOperationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_parentId": { + "oneof": [ + "parentId" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "parentId": { + "type": "string", + "id": 459714768, + "options": { + "proto3_optional": true + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteGlobalPublicDelegatedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefix": { + "type": "string", + "id": 204238440, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetGlobalPublicDelegatedPrefixeRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefix": { + "type": "string", + "id": 204238440, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertGlobalPublicDelegatedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefixResource": { + "type": "PublicDelegatedPrefix", + "id": 47594501, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListGlobalPublicDelegatedPrefixesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchGlobalPublicDelegatedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefix": { + "type": "string", + "id": 204238440, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefixResource": { + "type": "PublicDelegatedPrefix", + "id": 47594501, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListHealthChecksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetHealthCheckRequest": { + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheckResource": { + "type": "HealthCheck", + "id": 201925032, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListHealthChecksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "healthCheckResource": { + "type": "HealthCheck", + "id": 201925032, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "healthCheckResource": { + "type": "HealthCheck", + "id": 201925032, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteImageRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "image": { + "type": "string", + "id": 100313435, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeprecateImageRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "deprecationStatusResource": { + "type": "DeprecationStatus", + "id": 333006064, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "image": { + "type": "string", + "id": 100313435, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetImageRequest": { + "fields": { + "image": { + "type": "string", + "id": 100313435, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetFromFamilyImageRequest": { + "fields": { + "family": { + "type": "string", + "id": 328751972, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyImageRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertImageRequest": { + "oneofs": { + "_forceCreate": { + "oneof": [ + "forceCreate" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "forceCreate": { + "type": "bool", + "id": 197723344, + "options": { + "proto3_optional": true + } + }, + "imageResource": { + "type": "Image", + "id": 371171954, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListImagesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchImageRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "image": { + "type": "string", + "id": 100313435, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "imageResource": { + "type": "Image", + "id": 371171954, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicyImageRequest": { + "fields": { + "globalSetPolicyRequestResource": { + "type": "GlobalSetPolicyRequest", + "id": 337048498, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetLabelsImageRequest": { + "fields": { + "globalSetLabelsRequestResource": { + "type": "GlobalSetLabelsRequest", + "id": 319917189, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsImageRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AbandonInstancesInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersAbandonInstancesRequestResource": { + "type": "InstanceGroupManagersAbandonInstancesRequest", + "id": 320929016, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ApplyUpdatesToInstancesInstanceGroupManagerRequest": { + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersApplyUpdatesRequestResource": { + "type": "InstanceGroupManagersApplyUpdatesRequest", + "id": 259242835, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateInstancesInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersCreateInstancesRequestResource": { + "type": "InstanceGroupManagersCreateInstancesRequest", + "id": 24558867, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstancesInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersDeleteInstancesRequestResource": { + "type": "InstanceGroupManagersDeleteInstancesRequest", + "id": 166421252, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeletePerInstanceConfigsInstanceGroupManagerRequest": { + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersDeletePerInstanceConfigsReqResource": { + "type": "InstanceGroupManagersDeletePerInstanceConfigsReq", + "id": 362427680, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstanceGroupManagerRequest": { + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManagerResource": { + "type": "InstanceGroupManager", + "id": 261063946, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListErrorsInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListManagedInstancesInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListPerInstanceConfigsInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PatchInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagerResource": { + "type": "InstanceGroupManager", + "id": 261063946, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PatchPerInstanceConfigsInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersPatchPerInstanceConfigsReqResource": { + "type": "InstanceGroupManagersPatchPerInstanceConfigsReq", + "id": 356650495, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RecreateInstancesInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersRecreateInstancesRequestResource": { + "type": "InstanceGroupManagersRecreateInstancesRequest", + "id": 21405952, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ResizeInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "size": { + "type": "int32", + "id": 3530753, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetInstanceTemplateInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersSetInstanceTemplateRequestResource": { + "type": "InstanceGroupManagersSetInstanceTemplateRequest", + "id": 9809093, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetTargetPoolsInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersSetTargetPoolsRequestResource": { + "type": "InstanceGroupManagersSetTargetPoolsRequest", + "id": 281150216, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdatePerInstanceConfigsInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagersUpdatePerInstanceConfigsReqResource": { + "type": "InstanceGroupManagersUpdatePerInstanceConfigsReq", + "id": 141402302, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddInstancesInstanceGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupsAddInstancesRequestResource": { + "type": "InstanceGroupsAddInstancesRequest", + "id": 453713246, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListInstanceGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteInstanceGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstanceGroupRequest": { + "fields": { + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertInstanceGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupResource": { + "type": "InstanceGroup", + "id": 286612152, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListInstanceGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListInstancesInstanceGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupsListInstancesRequestResource": { + "type": "InstanceGroupsListInstancesRequest", + "id": 476255263, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveInstancesInstanceGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupsRemoveInstancesRequestResource": { + "type": "InstanceGroupsRemoveInstancesRequest", + "id": 390981817, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetNamedPortsInstanceGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupsSetNamedPortsRequestResource": { + "type": "InstanceGroupsSetNamedPortsRequest", + "id": 385151535, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceTemplateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceTemplate": { + "type": "string", + "id": 309248228, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetInstanceTemplateRequest": { + "fields": { + "instanceTemplate": { + "type": "string", + "id": 309248228, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyInstanceTemplateRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertInstanceTemplateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceTemplateResource": { + "type": "InstanceTemplate", + "id": 10679561, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListInstanceTemplatesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicyInstanceTemplateRequest": { + "fields": { + "globalSetPolicyRequestResource": { + "type": "GlobalSetPolicyRequest", + "id": 337048498, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsInstanceTemplateRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddAccessConfigInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "accessConfigResource": { + "type": "AccessConfig", + "id": 387825552, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkInterface": { + "type": "string", + "id": 365387880, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddResourcePoliciesInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesAddResourcePoliciesRequestResource": { + "type": "InstancesAddResourcePoliciesRequest", + "id": 489351963, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListInstancesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AttachDiskInstanceRequest": { + "oneofs": { + "_forceAttach": { + "oneof": [ + "forceAttach" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "attachedDiskResource": { + "type": "AttachedDisk", + "id": 90605845, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "forceAttach": { + "type": "bool", + "id": 142758425, + "options": { + "proto3_optional": true + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BulkInsertInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "bulkInsertInstanceResourceResource": { + "type": "BulkInsertInstanceResource", + "id": 41427278, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteAccessConfigInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "accessConfig": { + "type": "string", + "id": 72856189, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkInterface": { + "type": "string", + "id": 365387880, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DetachDiskInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "deviceName": { + "type": "string", + "id": 67541716, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetEffectiveFirewallsInstanceRequest": { + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkInterface": { + "type": "string", + "id": 365387880, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetGuestAttributesInstanceRequest": { + "oneofs": { + "_queryPath": { + "oneof": [ + "queryPath" + ] + }, + "_variableKey": { + "oneof": [ + "variableKey" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "queryPath": { + "type": "string", + "id": 368591164, + "options": { + "proto3_optional": true + } + }, + "variableKey": { + "type": "string", + "id": 164364828, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyInstanceRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetScreenshotInstanceRequest": { + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSerialPortOutputInstanceRequest": { + "oneofs": { + "_port": { + "oneof": [ + "port" + ] + }, + "_start": { + "oneof": [ + "start" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "port": { + "type": "int32", + "id": 3446913, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "start": { + "type": "int64", + "id": 109757538, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetShieldedInstanceIdentityInstanceRequest": { + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + }, + "_sourceInstanceTemplate": { + "oneof": [ + "sourceInstanceTemplate" + ] + } + }, + "fields": { + "instanceResource": { + "type": "Instance", + "id": 215988344, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sourceInstanceTemplate": { + "type": "string", + "id": 332423616, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListInstancesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListReferrersInstancesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveResourcePoliciesInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesRemoveResourcePoliciesRequestResource": { + "type": "InstancesRemoveResourcePoliciesRequest", + "id": 49229558, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ResetInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetDeletionProtectionInstanceRequest": { + "oneofs": { + "_deletionProtection": { + "oneof": [ + "deletionProtection" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "deletionProtection": { + "type": "bool", + "id": 458014698, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetDiskAutoDeleteInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoDelete": { + "type": "bool", + "id": 464761403, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deviceName": { + "type": "string", + "id": 67541716, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetIamPolicyInstanceRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zoneSetPolicyRequestResource": { + "type": "ZoneSetPolicyRequest", + "id": 382082107, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetLabelsInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesSetLabelsRequestResource": { + "type": "InstancesSetLabelsRequest", + "id": 207749344, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetMachineResourcesInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesSetMachineResourcesRequestResource": { + "type": "InstancesSetMachineResourcesRequest", + "id": 196286318, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetMachineTypeInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesSetMachineTypeRequestResource": { + "type": "InstancesSetMachineTypeRequest", + "id": 254157709, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetMetadataInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "metadataResource": { + "type": "Metadata", + "id": 291086110, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetMinCpuPlatformInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesSetMinCpuPlatformRequestResource": { + "type": "InstancesSetMinCpuPlatformRequest", + "id": 148459368, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetSchedulingInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "schedulingResource": { + "type": "Scheduling", + "id": 463181401, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetServiceAccountInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesSetServiceAccountRequestResource": { + "type": "InstancesSetServiceAccountRequest", + "id": 275550008, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetShieldedInstanceIntegrityPolicyInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "shieldedInstanceIntegrityPolicyResource": { + "type": "ShieldedInstanceIntegrityPolicy", + "id": 409169462, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetTagsInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "tagsResource": { + "type": "Tags", + "id": 331435380, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SimulateMaintenanceEventInstanceRequest": { + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StartInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StartWithEncryptionKeyInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instancesStartWithEncryptionKeyRequestResource": { + "type": "InstancesStartWithEncryptionKeyRequest", + "id": 441712511, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StopInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsInstanceRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateInstanceRequest": { + "oneofs": { + "_minimalAction": { + "oneof": [ + "minimalAction" + ] + }, + "_mostDisruptiveAllowedAction": { + "oneof": [ + "mostDisruptiveAllowedAction" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceResource": { + "type": "Instance", + "id": 215988344, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "minimalAction": { + "type": "string", + "id": 270567060, + "options": { + "proto3_optional": true + } + }, + "mostDisruptiveAllowedAction": { + "type": "string", + "id": 66103053, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateAccessConfigInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "accessConfigResource": { + "type": "AccessConfig", + "id": 387825552, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkInterface": { + "type": "string", + "id": 365387880, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateDisplayDeviceInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "displayDeviceResource": { + "type": "DisplayDevice", + "id": 289686106, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateNetworkInterfaceInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkInterface": { + "type": "string", + "id": 365387880, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkInterfaceResource": { + "type": "NetworkInterface", + "id": 325814789, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateShieldedInstanceConfigInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instance": { + "type": "string", + "id": 18257045, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "shieldedInstanceConfigResource": { + "type": "ShieldedInstanceConfig", + "id": 272059224, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListInterconnectAttachmentsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteInterconnectAttachmentRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "interconnectAttachment": { + "type": "string", + "id": 308135284, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetInterconnectAttachmentRequest": { + "fields": { + "interconnectAttachment": { + "type": "string", + "id": 308135284, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertInterconnectAttachmentRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + }, + "_validateOnly": { + "oneof": [ + "validateOnly" + ] + } + }, + "fields": { + "interconnectAttachmentResource": { + "type": "InterconnectAttachment", + "id": 212341369, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "validateOnly": { + "type": "bool", + "id": 242744629, + "options": { + "proto3_optional": true + } + } + } + }, + "ListInterconnectAttachmentsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchInterconnectAttachmentRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "interconnectAttachment": { + "type": "string", + "id": 308135284, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "interconnectAttachmentResource": { + "type": "InterconnectAttachment", + "id": 212341369, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetInterconnectLocationRequest": { + "fields": { + "interconnectLocation": { + "type": "string", + "id": 492235846, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListInterconnectLocationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteInterconnectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "interconnect": { + "type": "string", + "id": 224601230, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetInterconnectRequest": { + "fields": { + "interconnect": { + "type": "string", + "id": 224601230, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDiagnosticsInterconnectRequest": { + "fields": { + "interconnect": { + "type": "string", + "id": 224601230, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertInterconnectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "interconnectResource": { + "type": "Interconnect", + "id": 397611167, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListInterconnectsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchInterconnectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "interconnect": { + "type": "string", + "id": 224601230, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "interconnectResource": { + "type": "Interconnect", + "id": 397611167, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetLicenseCodeRequest": { + "fields": { + "licenseCode": { + "type": "string", + "id": 1467179, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsLicenseCodeRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteLicenseRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "license": { + "type": "string", + "id": 166757441, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetLicenseRequest": { + "fields": { + "license": { + "type": "string", + "id": 166757441, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyLicenseRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertLicenseRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "licenseResource": { + "type": "License", + "id": 437955148, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListLicensesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicyLicenseRequest": { + "fields": { + "globalSetPolicyRequestResource": { + "type": "GlobalSetPolicyRequest", + "id": 337048498, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsLicenseRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListMachineTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "GetMachineTypeRequest": { + "fields": { + "machineType": { + "type": "string", + "id": 227711026, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListMachineTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListNetworkEndpointGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AttachNetworkEndpointsNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkEndpointGroupsAttachEndpointsRequestResource": { + "type": "NetworkEndpointGroupsAttachEndpointsRequest", + "id": 531079, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DetachNetworkEndpointsNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkEndpointGroupsDetachEndpointsRequestResource": { + "type": "NetworkEndpointGroupsDetachEndpointsRequest", + "id": 515608697, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetNetworkEndpointGroupRequest": { + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroupResource": { + "type": "NetworkEndpointGroup", + "id": 525788839, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListNetworkEndpointGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListNetworkEndpointsNetworkEndpointGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkEndpointGroupsListEndpointsRequestResource": { + "type": "NetworkEndpointGroupsListEndpointsRequest", + "id": 59493390, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsNetworkEndpointGroupRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddPeeringNetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networksAddPeeringRequestResource": { + "type": "NetworksAddPeeringRequest", + "id": 388810421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteNetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetNetworkRequest": { + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetEffectiveFirewallsNetworkRequest": { + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertNetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkResource": { + "type": "Network", + "id": 122105599, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListNetworksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListPeeringRoutesNetworksRequest": { + "oneofs": { + "_direction": { + "oneof": [ + "direction" + ] + }, + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_peeringName": { + "oneof": [ + "peeringName" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "direction": { + "type": "Direction", + "id": 111150975, + "options": { + "proto3_optional": true + } + }, + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "peeringName": { + "type": "string", + "id": 249571370, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "proto3_optional": true + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Direction": { + "values": { + "UNDEFINED_DIRECTION": 0, + "INCOMING": 338552870, + "OUTGOING": 307438444 + } + } + } + }, + "PatchNetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkResource": { + "type": "Network", + "id": 122105599, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "RemovePeeringNetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networksRemovePeeringRequestResource": { + "type": "NetworksRemovePeeringRequest", + "id": 421162494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SwitchToCustomModeNetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdatePeeringNetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 232872494, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networksUpdatePeeringRequestResource": { + "type": "NetworksUpdatePeeringRequest", + "id": 224433497, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AddNodesNodeGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupsAddNodesRequestResource": { + "type": "NodeGroupsAddNodesRequest", + "id": 131263288, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListNodeGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteNodeGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteNodesNodeGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupsDeleteNodesRequestResource": { + "type": "NodeGroupsDeleteNodesRequest", + "id": 183298962, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetNodeGroupRequest": { + "fields": { + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyNodeGroupRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertNodeGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "initialNodeCount": { + "type": "int32", + "id": 71951469, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupResource": { + "type": "NodeGroup", + "id": 505321899, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListNodeGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListNodesNodeGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PatchNodeGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupResource": { + "type": "NodeGroup", + "id": 505321899, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetIamPolicyNodeGroupRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zoneSetPolicyRequestResource": { + "type": "ZoneSetPolicyRequest", + "id": 382082107, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetNodeTemplateNodeGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeGroup": { + "type": "string", + "id": 469958146, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupsSetNodeTemplateRequestResource": { + "type": "NodeGroupsSetNodeTemplateRequest", + "id": 117382321, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsNodeGroupRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListNodeTemplatesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteNodeTemplateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeTemplate": { + "type": "string", + "id": 323154455, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetNodeTemplateRequest": { + "fields": { + "nodeTemplate": { + "type": "string", + "id": 323154455, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyNodeTemplateRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertNodeTemplateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "nodeTemplateResource": { + "type": "NodeTemplate", + "id": 127364406, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListNodeTemplatesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicyNodeTemplateRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionSetPolicyRequestResource": { + "type": "RegionSetPolicyRequest", + "id": 276489091, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsNodeTemplateRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListNodeTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "GetNodeTypeRequest": { + "fields": { + "nodeType": { + "type": "string", + "id": 465832791, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListNodeTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListPacketMirroringsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeletePacketMirroringRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "packetMirroring": { + "type": "string", + "id": 22305996, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetPacketMirroringRequest": { + "fields": { + "packetMirroring": { + "type": "string", + "id": 22305996, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertPacketMirroringRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "packetMirroringResource": { + "type": "PacketMirroring", + "id": 493501985, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListPacketMirroringsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchPacketMirroringRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "packetMirroring": { + "type": "string", + "id": 22305996, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "packetMirroringResource": { + "type": "PacketMirroring", + "id": 493501985, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "TestIamPermissionsPacketMirroringRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DisableXpnHostProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DisableXpnResourceProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectsDisableXpnResourceRequestResource": { + "type": "ProjectsDisableXpnResourceRequest", + "id": 209136170, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "EnableXpnHostProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "EnableXpnResourceProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectsEnableXpnResourceRequestResource": { + "type": "ProjectsEnableXpnResourceRequest", + "id": 421980207, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetProjectRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetXpnHostProjectRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetXpnResourcesProjectsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListXpnHostsProjectsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectsListXpnHostsRequestResource": { + "type": "ProjectsListXpnHostsRequest", + "id": 238266391, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "MoveDiskProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "diskMoveRequestResource": { + "type": "DiskMoveRequest", + "id": 313008458, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "MoveInstanceProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceMoveRequestResource": { + "type": "InstanceMoveRequest", + "id": 311664194, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetCommonInstanceMetadataProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "metadataResource": { + "type": "Metadata", + "id": 291086110, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetDefaultNetworkTierProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "projectsSetDefaultNetworkTierRequestResource": { + "type": "ProjectsSetDefaultNetworkTierRequest", + "id": 126410762, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetUsageExportBucketProjectRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "usageExportLocationResource": { + "type": "UsageExportLocation", + "id": 20260459, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeletePublicAdvertisedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicAdvertisedPrefix": { + "type": "string", + "id": 101874590, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetPublicAdvertisedPrefixeRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicAdvertisedPrefix": { + "type": "string", + "id": 101874590, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertPublicAdvertisedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicAdvertisedPrefixResource": { + "type": "PublicAdvertisedPrefix", + "id": 233614223, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListPublicAdvertisedPrefixesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchPublicAdvertisedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicAdvertisedPrefix": { + "type": "string", + "id": 101874590, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicAdvertisedPrefixResource": { + "type": "PublicAdvertisedPrefix", + "id": 233614223, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListPublicDelegatedPrefixesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeletePublicDelegatedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefix": { + "type": "string", + "id": 204238440, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetPublicDelegatedPrefixeRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefix": { + "type": "string", + "id": 204238440, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertPublicDelegatedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefixResource": { + "type": "PublicDelegatedPrefix", + "id": 47594501, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListPublicDelegatedPrefixesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchPublicDelegatedPrefixeRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefix": { + "type": "string", + "id": 204238440, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "publicDelegatedPrefixResource": { + "type": "PublicDelegatedPrefix", + "id": 47594501, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionAutoscalerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionAutoscalerRequest": { + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionAutoscalerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscalerResource": { + "type": "Autoscaler", + "id": 207616118, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionAutoscalersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRegionAutoscalerRequest": { + "oneofs": { + "_autoscaler": { + "oneof": [ + "autoscaler" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "proto3_optional": true + } + }, + "autoscalerResource": { + "type": "Autoscaler", + "id": 207616118, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateRegionAutoscalerRequest": { + "oneofs": { + "_autoscaler": { + "oneof": [ + "autoscaler" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "autoscaler": { + "type": "string", + "id": 517258967, + "options": { + "proto3_optional": true + } + }, + "autoscalerResource": { + "type": "Autoscaler", + "id": 207616118, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionBackendServiceRequest": { + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetHealthRegionBackendServiceRequest": { + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceGroupReferenceResource": { + "type": "ResourceGroupReference", + "id": 112951123, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendServiceResource": { + "type": "BackendService", + "id": 347586723, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionBackendServicesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRegionBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backendServiceResource": { + "type": "BackendService", + "id": 347586723, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateRegionBackendServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "backendService": { + "type": "string", + "id": 306946058, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backendServiceResource": { + "type": "BackendService", + "id": 347586723, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListRegionCommitmentsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionCommitmentRequest": { + "fields": { + "commitment": { + "type": "string", + "id": 482134805, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionCommitmentRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "commitmentResource": { + "type": "Commitment", + "id": 244240888, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionCommitmentsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionDiskTypeRequest": { + "fields": { + "diskType": { + "type": "string", + "id": 93009052, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionDiskTypesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AddResourcePoliciesRegionDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionDisksAddResourcePoliciesRequestResource": { + "type": "RegionDisksAddResourcePoliciesRequest", + "id": 284196750, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "CreateSnapshotRegionDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "snapshotResource": { + "type": "Snapshot", + "id": 481319977, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRegionDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionDiskRequest": { + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyRegionDiskRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + }, + "_sourceImage": { + "oneof": [ + "sourceImage" + ] + } + }, + "fields": { + "diskResource": { + "type": "Disk", + "id": 25880688, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sourceImage": { + "type": "string", + "id": 50443319, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionDisksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "RemoveResourcePoliciesRegionDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionDisksRemoveResourcePoliciesRequestResource": { + "type": "RegionDisksRemoveResourcePoliciesRequest", + "id": 8741283, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ResizeRegionDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "disk": { + "type": "string", + "id": 3083677, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionDisksResizeRequestResource": { + "type": "RegionDisksResizeRequest", + "id": 446633237, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicyRegionDiskRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionSetPolicyRequestResource": { + "type": "RegionSetPolicyRequest", + "id": 276489091, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetLabelsRegionDiskRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionSetLabelsRequestResource": { + "type": "RegionSetLabelsRequest", + "id": 259357782, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsRegionDiskRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRegionHealthCheckServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheckService": { + "type": "string", + "id": 408374747, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionHealthCheckServiceRequest": { + "fields": { + "healthCheckService": { + "type": "string", + "id": 408374747, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionHealthCheckServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheckServiceResource": { + "type": "HealthCheckService", + "id": 477367794, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionHealthCheckServicesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRegionHealthCheckServiceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheckService": { + "type": "string", + "id": 408374747, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "healthCheckServiceResource": { + "type": "HealthCheckService", + "id": 477367794, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionHealthCheckRequest": { + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheckResource": { + "type": "HealthCheck", + "id": 201925032, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionHealthChecksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRegionHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "healthCheckResource": { + "type": "HealthCheck", + "id": 201925032, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdateRegionHealthCheckRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "healthCheck": { + "type": "string", + "id": 308876645, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "healthCheckResource": { + "type": "HealthCheck", + "id": 201925032, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "AbandonInstancesRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagersAbandonInstancesRequestResource": { + "type": "RegionInstanceGroupManagersAbandonInstancesRequest", + "id": 488499491, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest": { + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagersApplyUpdatesRequestResource": { + "type": "RegionInstanceGroupManagersApplyUpdatesRequest", + "id": 76248318, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateInstancesRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagersCreateInstancesRequestResource": { + "type": "RegionInstanceGroupManagersCreateInstancesRequest", + "id": 359014280, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteInstancesRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagersDeleteInstancesRequestResource": { + "type": "RegionInstanceGroupManagersDeleteInstancesRequest", + "id": 500876665, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeletePerInstanceConfigsRegionInstanceGroupManagerRequest": { + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagerDeleteInstanceConfigReqResource": { + "type": "RegionInstanceGroupManagerDeleteInstanceConfigReq", + "id": 740741, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRegionInstanceGroupManagerRequest": { + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManagerResource": { + "type": "InstanceGroupManager", + "id": 261063946, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListErrorsRegionInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListManagedInstancesRegionInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListPerInstanceConfigsRegionInstanceGroupManagersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instanceGroupManagerResource": { + "type": "InstanceGroupManager", + "id": 261063946, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchPerInstanceConfigsRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagerPatchInstanceConfigReqResource": { + "type": "RegionInstanceGroupManagerPatchInstanceConfigReq", + "id": 197682890, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "RecreateInstancesRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagersRecreateRequestResource": { + "type": "RegionInstanceGroupManagersRecreateRequest", + "id": 170999316, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ResizeRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "size": { + "type": "int32", + "id": 3530753, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetInstanceTemplateRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagersSetTemplateRequestResource": { + "type": "RegionInstanceGroupManagersSetTemplateRequest", + "id": 187310412, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "SetTargetPoolsRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagersSetTargetPoolsRequestResource": { + "type": "RegionInstanceGroupManagersSetTargetPoolsRequest", + "id": 78734717, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroupManager": { + "type": "string", + "id": 249363395, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupManagerUpdateInstanceConfigReqResource": { + "type": "RegionInstanceGroupManagerUpdateInstanceConfigReq", + "id": 89036583, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionInstanceGroupRequest": { + "fields": { + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionInstanceGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListInstancesRegionInstanceGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupsListInstancesRequestResource": { + "type": "RegionInstanceGroupsListInstancesRequest", + "id": 48239828, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetNamedPortsRegionInstanceGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "instanceGroup": { + "type": "string", + "id": 81095253, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionInstanceGroupsSetNamedPortsRequestResource": { + "type": "RegionInstanceGroupsSetNamedPortsRequest", + "id": 1574938, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "BulkInsertRegionInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "bulkInsertInstanceResourceResource": { + "type": "BulkInsertInstanceResource", + "id": 41427278, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionNetworkEndpointGroupRequest": { + "fields": { + "networkEndpointGroup": { + "type": "string", + "id": 433907078, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionNetworkEndpointGroupRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "networkEndpointGroupResource": { + "type": "NetworkEndpointGroup", + "id": 525788839, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionNetworkEndpointGroupsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionNotificationEndpointRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "notificationEndpoint": { + "type": "string", + "id": 376807017, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "GetRegionNotificationEndpointRequest": { + "fields": { + "notificationEndpoint": { + "type": "string", + "id": 376807017, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionNotificationEndpointRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "notificationEndpointResource": { + "type": "NotificationEndpoint", + "id": 338459940, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + } + } + }, + "ListRegionNotificationEndpointsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRegionOperationResponse": { + "fields": {} + }, + "GetRegionOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionOperationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "WaitRegionOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRegionSslCertificateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslCertificate": { + "type": "string", + "id": 46443492, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRegionSslCertificateRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sslCertificate": { + "type": "string", + "id": 46443492, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionSslCertificateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslCertificateResource": { + "type": "SslCertificate", + "id": 180709897, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionSslCertificatesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRegionTargetHttpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpProxy": { + "type": "string", + "id": 206872421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRegionTargetHttpProxyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpProxy": { + "type": "string", + "id": 206872421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionTargetHttpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpProxyResource": { + "type": "TargetHttpProxy", + "id": 24696744, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionTargetHttpProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetUrlMapRegionTargetHttpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpProxy": { + "type": "string", + "id": 206872421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapReferenceResource": { + "type": "UrlMapReference", + "id": 398701333, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRegionTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRegionTargetHttpsProxyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxyResource": { + "type": "TargetHttpsProxy", + "id": 433657473, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionTargetHttpsProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetSslCertificatesRegionTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionTargetHttpsProxiesSetSslCertificatesRequestResource": { + "type": "RegionTargetHttpsProxiesSetSslCertificatesRequest", + "id": 390693383, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetUrlMapRegionTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapReferenceResource": { + "type": "UrlMapReference", + "id": 398701333, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRegionUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRegionUrlMapRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRegionUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMapResource": { + "type": "UrlMap", + "id": 168675425, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionUrlMapsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRegionUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapResource": { + "type": "UrlMap", + "id": 168675425, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateRegionUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapResource": { + "type": "UrlMap", + "id": 168675425, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValidateRegionUrlMapRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionUrlMapsValidateRequestResource": { + "type": "RegionUrlMapsValidateRequest", + "id": 56632858, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRegionRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRegionsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListReservationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteReservationRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "reservation": { + "type": "string", + "id": 47530956, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetReservationRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reservation": { + "type": "string", + "id": 47530956, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyReservationRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertReservationRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "reservationResource": { + "type": "Reservation", + "id": 285030177, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListReservationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ResizeReservationRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "reservation": { + "type": "string", + "id": 47530956, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reservationsResizeRequestResource": { + "type": "ReservationsResizeRequest", + "id": 389262801, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetIamPolicyReservationRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zoneSetPolicyRequestResource": { + "type": "ZoneSetPolicyRequest", + "id": 382082107, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsReservationRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListResourcePoliciesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteResourcePolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "resourcePolicy": { + "type": "string", + "id": 159240835, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetResourcePolicyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourcePolicy": { + "type": "string", + "id": 159240835, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicyResourcePolicyRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertResourcePolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "resourcePolicyResource": { + "type": "ResourcePolicy", + "id": 76826186, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListResourcePoliciesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicyResourcePolicyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionSetPolicyRequestResource": { + "type": "RegionSetPolicyRequest", + "id": 276489091, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsResourcePolicyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListRoutersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteRouterRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRouterRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetNatMappingInfoRoutersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRouterStatusRouterRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRouterRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "routerResource": { + "type": "Router", + "id": 155222084, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRoutersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchRouterRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routerResource": { + "type": "Router", + "id": 155222084, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PreviewRouterRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routerResource": { + "type": "Router", + "id": 155222084, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateRouterRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "router": { + "type": "string", + "id": 148608841, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "routerResource": { + "type": "Router", + "id": 155222084, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRouteRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "route": { + "type": "string", + "id": 108704329, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRouteRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "route": { + "type": "string", + "id": 108704329, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertRouteRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "routeResource": { + "type": "Route", + "id": 225428804, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListRoutesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AddRuleSecurityPolicyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicyRuleResource": { + "type": "SecurityPolicyRule", + "id": 402693443, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSecurityPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSecurityPolicyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRuleSecurityPolicyRequest": { + "oneofs": { + "_priority": { + "oneof": [ + "priority" + ] + } + }, + "fields": { + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertSecurityPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "securityPolicyResource": { + "type": "SecurityPolicy", + "id": 216159612, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSecurityPoliciesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListPreconfiguredExpressionSetsSecurityPoliciesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchSecurityPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicyResource": { + "type": "SecurityPolicy", + "id": 216159612, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PatchRuleSecurityPolicyRequest": { + "oneofs": { + "_priority": { + "oneof": [ + "priority" + ] + } + }, + "fields": { + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicyRuleResource": { + "type": "SecurityPolicyRule", + "id": 402693443, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveRuleSecurityPolicyRequest": { + "oneofs": { + "_priority": { + "oneof": [ + "priority" + ] + } + }, + "fields": { + "priority": { + "type": "int32", + "id": 445151652, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "securityPolicy": { + "type": "string", + "id": 171082513, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSnapshotRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "snapshot": { + "type": "string", + "id": 284874180, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSnapshotRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "snapshot": { + "type": "string", + "id": 284874180, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicySnapshotRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSnapshotsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetIamPolicySnapshotRequest": { + "fields": { + "globalSetPolicyRequestResource": { + "type": "GlobalSetPolicyRequest", + "id": 337048498, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetLabelsSnapshotRequest": { + "fields": { + "globalSetLabelsRequestResource": { + "type": "GlobalSetLabelsRequest", + "id": 319917189, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsSnapshotRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListSslCertificatesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteSslCertificateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslCertificate": { + "type": "string", + "id": 46443492, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSslCertificateRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sslCertificate": { + "type": "string", + "id": 46443492, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertSslCertificateRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslCertificateResource": { + "type": "SslCertificate", + "id": 180709897, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSslCertificatesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteSslPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslPolicy": { + "type": "string", + "id": 295190213, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSslPolicyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sslPolicy": { + "type": "string", + "id": 295190213, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertSslPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslPolicyResource": { + "type": "SslPolicy", + "id": 274891848, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSslPoliciesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListAvailableFeaturesSslPoliciesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchSslPolicyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslPolicy": { + "type": "string", + "id": 295190213, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sslPolicyResource": { + "type": "SslPolicy", + "id": 274891848, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListSubnetworksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteSubnetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ExpandIpCidrRangeSubnetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subnetworksExpandIpCidrRangeRequestResource": { + "type": "SubnetworksExpandIpCidrRangeRequest", + "id": 477014110, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSubnetworkRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetIamPolicySubnetworkRequest": { + "oneofs": { + "_optionsRequestedPolicyVersion": { + "oneof": [ + "optionsRequestedPolicyVersion" + ] + } + }, + "fields": { + "optionsRequestedPolicyVersion": { + "type": "int32", + "id": 499220029, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertSubnetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "subnetworkResource": { + "type": "Subnetwork", + "id": 42233151, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSubnetworksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "ListUsableSubnetworksRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchSubnetworkRequest": { + "oneofs": { + "_drainTimeoutSeconds": { + "oneof": [ + "drainTimeoutSeconds" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "drainTimeoutSeconds": { + "type": "int32", + "id": 357707098, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subnetworkResource": { + "type": "Subnetwork", + "id": 42233151, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetIamPolicySubnetworkRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionSetPolicyRequestResource": { + "type": "RegionSetPolicyRequest", + "id": 276489091, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetPrivateIpGoogleAccessSubnetworkRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 307827694, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subnetworksSetPrivateIpGoogleAccessRequestResource": { + "type": "SubnetworksSetPrivateIpGoogleAccessRequest", + "id": 268920696, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsSubnetworkRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteTargetGrpcProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetGrpcProxy": { + "type": "string", + "id": 5020283, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetGrpcProxyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetGrpcProxy": { + "type": "string", + "id": 5020283, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetGrpcProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetGrpcProxyResource": { + "type": "TargetGrpcProxy", + "id": 328922450, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetGrpcProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchTargetGrpcProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetGrpcProxy": { + "type": "string", + "id": 5020283, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetGrpcProxyResource": { + "type": "TargetGrpcProxy", + "id": 328922450, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListTargetHttpProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteTargetHttpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpProxy": { + "type": "string", + "id": 206872421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetHttpProxyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpProxy": { + "type": "string", + "id": 206872421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetHttpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpProxyResource": { + "type": "TargetHttpProxy", + "id": 24696744, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetHttpProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchTargetHttpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpProxy": { + "type": "string", + "id": 206872421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpProxyResource": { + "type": "TargetHttpProxy", + "id": 24696744, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetUrlMapTargetHttpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpProxy": { + "type": "string", + "id": 206872421, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapReferenceResource": { + "type": "UrlMapReference", + "id": 398701333, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListTargetHttpsProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetHttpsProxyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxyResource": { + "type": "TargetHttpsProxy", + "id": 433657473, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetHttpsProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpsProxyResource": { + "type": "TargetHttpsProxy", + "id": 433657473, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetQuicOverrideTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxiesSetQuicOverrideRequestResource": { + "type": "TargetHttpsProxiesSetQuicOverrideRequest", + "id": 72940258, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetSslCertificatesTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxiesSetSslCertificatesRequestResource": { + "type": "TargetHttpsProxiesSetSslCertificatesRequest", + "id": 223122908, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetSslPolicyTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslPolicyReferenceResource": { + "type": "SslPolicyReference", + "id": 235403836, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetUrlMapTargetHttpsProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetHttpsProxy": { + "type": "string", + "id": 52336748, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapReferenceResource": { + "type": "UrlMapReference", + "id": 398701333, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListTargetInstancesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteTargetInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetInstance": { + "type": "string", + "id": 289769347, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetInstanceRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetInstance": { + "type": "string", + "id": 289769347, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetInstanceRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetInstanceResource": { + "type": "TargetInstance", + "id": 430453066, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetInstancesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddHealthCheckTargetPoolRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetPoolsAddHealthCheckRequestResource": { + "type": "TargetPoolsAddHealthCheckRequest", + "id": 269573412, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AddInstanceTargetPoolRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetPoolsAddInstanceRequestResource": { + "type": "TargetPoolsAddInstanceRequest", + "id": 428796404, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListTargetPoolsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteTargetPoolRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetPoolRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetHealthTargetPoolRequest": { + "fields": { + "instanceReferenceResource": { + "type": "InstanceReference", + "id": 292926060, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetPoolRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetPoolResource": { + "type": "TargetPool", + "id": 101281443, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetPoolsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "RemoveHealthCheckTargetPoolRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetPoolsRemoveHealthCheckRequestResource": { + "type": "TargetPoolsRemoveHealthCheckRequest", + "id": 304985011, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveInstanceTargetPoolRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetPoolsRemoveInstanceRequestResource": { + "type": "TargetPoolsRemoveInstanceRequest", + "id": 29548547, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetBackupTargetPoolRequest": { + "oneofs": { + "_failoverRatio": { + "oneof": [ + "failoverRatio" + ] + }, + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "failoverRatio": { + "type": "float", + "id": 212667006, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetPool": { + "type": "string", + "id": 62796298, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetReferenceResource": { + "type": "TargetReference", + "id": 523721712, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteTargetSslProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetSslProxy": { + "type": "string", + "id": 338795853, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetSslProxyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetSslProxy": { + "type": "string", + "id": 338795853, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetSslProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetSslProxyResource": { + "type": "TargetSslProxy", + "id": 142016192, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetSslProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetBackendServiceTargetSslProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetSslProxiesSetBackendServiceRequestResource": { + "type": "TargetSslProxiesSetBackendServiceRequest", + "id": 139080868, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetSslProxy": { + "type": "string", + "id": 338795853, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetProxyHeaderTargetSslProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetSslProxiesSetProxyHeaderRequestResource": { + "type": "TargetSslProxiesSetProxyHeaderRequest", + "id": 205284526, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetSslProxy": { + "type": "string", + "id": 338795853, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetSslCertificatesTargetSslProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetSslProxiesSetSslCertificatesRequestResource": { + "type": "TargetSslProxiesSetSslCertificatesRequest", + "id": 147940797, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetSslProxy": { + "type": "string", + "id": 338795853, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetSslPolicyTargetSslProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "sslPolicyReferenceResource": { + "type": "SslPolicyReference", + "id": 235403836, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetSslProxy": { + "type": "string", + "id": 338795853, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteTargetTcpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetTcpProxy": { + "type": "string", + "id": 503065442, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetTcpProxyRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetTcpProxy": { + "type": "string", + "id": 503065442, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetTcpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetTcpProxyResource": { + "type": "TargetTcpProxy", + "id": 145913931, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetTcpProxiesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetBackendServiceTargetTcpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetTcpProxiesSetBackendServiceRequestResource": { + "type": "TargetTcpProxiesSetBackendServiceRequest", + "id": 273721583, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetTcpProxy": { + "type": "string", + "id": 503065442, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SetProxyHeaderTargetTcpProxyRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetTcpProxiesSetProxyHeaderRequestResource": { + "type": "TargetTcpProxiesSetProxyHeaderRequest", + "id": 219958339, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetTcpProxy": { + "type": "string", + "id": 503065442, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListTargetVpnGatewaysRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteTargetVpnGatewayRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetVpnGateway": { + "type": "string", + "id": 532512843, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetTargetVpnGatewayRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "targetVpnGateway": { + "type": "string", + "id": 532512843, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertTargetVpnGatewayRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "targetVpnGatewayResource": { + "type": "TargetVpnGateway", + "id": 498050, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListTargetVpnGatewaysRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AggregatedListUrlMapsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetUrlMapRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMapResource": { + "type": "UrlMap", + "id": 168675425, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InvalidateCacheUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "cacheInvalidationRuleResource": { + "type": "CacheInvalidationRule", + "id": 312795565, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListUrlMapsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "PatchUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapResource": { + "type": "UrlMap", + "id": 168675425, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateUrlMapRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapResource": { + "type": "UrlMap", + "id": 168675425, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValidateUrlMapRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMap": { + "type": "string", + "id": 367020684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "urlMapsValidateRequestResource": { + "type": "UrlMapsValidateRequest", + "id": 395913455, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListVpnGatewaysRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteVpnGatewayRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "vpnGateway": { + "type": "string", + "id": 406684153, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetVpnGatewayRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vpnGateway": { + "type": "string", + "id": 406684153, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetStatusVpnGatewayRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vpnGateway": { + "type": "string", + "id": 406684153, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertVpnGatewayRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "vpnGatewayResource": { + "type": "VpnGateway", + "id": 182688660, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListVpnGatewaysRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "SetLabelsVpnGatewayRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "regionSetLabelsRequestResource": { + "type": "RegionSetLabelsRequest", + "id": 259357782, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TestIamPermissionsVpnGatewayRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 195806222, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "testPermissionsRequestResource": { + "type": "TestPermissionsRequest", + "id": 439214758, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AggregatedListVpnTunnelsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_includeAllScopes": { + "oneof": [ + "includeAllScopes" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "includeAllScopes": { + "type": "bool", + "id": 391327988, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteVpnTunnelRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "vpnTunnel": { + "type": "string", + "id": 143821331, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetVpnTunnelRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vpnTunnel": { + "type": "string", + "id": 143821331, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InsertVpnTunnelRequest": { + "oneofs": { + "_requestId": { + "oneof": [ + "requestId" + ] + } + }, + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 37109963, + "options": { + "proto3_optional": true + } + }, + "vpnTunnelResource": { + "type": "VpnTunnel", + "id": 86839482, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListVpnTunnelsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 138946292, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "DeleteZoneOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteZoneOperationResponse": { + "fields": {} + }, + "GetZoneOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListZoneOperationsRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WaitZoneOperationRequest": { + "fields": { + "operation": { + "type": "string", + "id": 52090215, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetZoneRequest": { + "fields": { + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 3744684, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListZonesRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_maxResults": { + "oneof": [ + "maxResults" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + }, + "_pageToken": { + "oneof": [ + "pageToken" + ] + }, + "_returnPartialSuccess": { + "oneof": [ + "returnPartialSuccess" + ] + } + }, + "fields": { + "filter": { + "type": "string", + "id": 336120696, + "options": { + "proto3_optional": true + } + }, + "maxResults": { + "type": "uint32", + "id": 54715419, + "options": { + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 160562920, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 19994697, + "options": { + "proto3_optional": true + } + }, + "project": { + "type": "string", + "id": 227560217, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "returnPartialSuccess": { + "type": "bool", + "id": 517198390, + "options": { + "proto3_optional": true + } + } + } + }, + "AcceleratorTypes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListAcceleratorTypesRequest", + "responseType": "AcceleratorTypeAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/acceleratorTypes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/acceleratorTypes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Get": { + "requestType": "GetAcceleratorTypeRequest", + "responseType": "AcceleratorType", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes/{accelerator_type}", + "(google.api.method_signature)": "project,zone,accelerator_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes/{accelerator_type}" + } + }, + { + "(google.api.method_signature)": "project,zone,accelerator_type" + } + ] + }, + "List": { + "requestType": "ListAcceleratorTypesRequest", + "responseType": "AcceleratorTypeList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + } + } + }, + "Addresses": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListAddressesRequest", + "responseType": "AddressAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/addresses", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/addresses" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteAddressRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/addresses/{address}", + "(google.api.method_signature)": "project,region,address" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/addresses/{address}" + } + }, + { + "(google.api.method_signature)": "project,region,address" + } + ] + }, + "Get": { + "requestType": "GetAddressRequest", + "responseType": "Address", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/addresses/{address}", + "(google.api.method_signature)": "project,region,address" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/addresses/{address}" + } + }, + { + "(google.api.method_signature)": "project,region,address" + } + ] + }, + "Insert": { + "requestType": "InsertAddressRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/addresses", + "(google.api.http).body": "address_resource", + "(google.api.method_signature)": "project,region,address_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/addresses", + "body": "address_resource" + } + }, + { + "(google.api.method_signature)": "project,region,address_resource" + } + ] + }, + "List": { + "requestType": "ListAddressesRequest", + "responseType": "AddressList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/addresses", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/addresses" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "Autoscalers": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListAutoscalersRequest", + "responseType": "AutoscalerAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/autoscalers", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/autoscalers" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + "(google.api.method_signature)": "project,zone,autoscaler" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}" + } + }, + { + "(google.api.method_signature)": "project,zone,autoscaler" + } + ] + }, + "Get": { + "requestType": "GetAutoscalerRequest", + "responseType": "Autoscaler", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}", + "(google.api.method_signature)": "project,zone,autoscaler" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}" + } + }, + { + "(google.api.method_signature)": "project,zone,autoscaler" + } + ] + }, + "Insert": { + "requestType": "InsertAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/autoscalers", + "(google.api.http).body": "autoscaler_resource", + "(google.api.method_signature)": "project,zone,autoscaler_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/autoscalers", + "body": "autoscaler_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,autoscaler_resource" + } + ] + }, + "List": { + "requestType": "ListAutoscalersRequest", + "responseType": "AutoscalerList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/autoscalers", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/autoscalers" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "Patch": { + "requestType": "PatchAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/zones/{zone}/autoscalers", + "(google.api.http).body": "autoscaler_resource", + "(google.api.method_signature)": "project,zone,autoscaler_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/zones/{zone}/autoscalers", + "body": "autoscaler_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,autoscaler_resource" + } + ] + }, + "Update": { + "requestType": "UpdateAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/zones/{zone}/autoscalers", + "(google.api.http).body": "autoscaler_resource", + "(google.api.method_signature)": "project,zone,autoscaler_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/zones/{zone}/autoscalers", + "body": "autoscaler_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,autoscaler_resource" + } + ] + } + } + }, + "BackendBuckets": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddSignedUrlKey": { + "requestType": "AddSignedUrlKeyBackendBucketRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/addSignedUrlKey", + "(google.api.http).body": "signed_url_key_resource", + "(google.api.method_signature)": "project,backend_bucket,signed_url_key_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/addSignedUrlKey", + "body": "signed_url_key_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_bucket,signed_url_key_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteBackendBucketRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}", + "(google.api.method_signature)": "project,backend_bucket" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}" + } + }, + { + "(google.api.method_signature)": "project,backend_bucket" + } + ] + }, + "DeleteSignedUrlKey": { + "requestType": "DeleteSignedUrlKeyBackendBucketRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/deleteSignedUrlKey", + "(google.api.method_signature)": "project,backend_bucket,key_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}/deleteSignedUrlKey" + } + }, + { + "(google.api.method_signature)": "project,backend_bucket,key_name" + } + ] + }, + "Get": { + "requestType": "GetBackendBucketRequest", + "responseType": "BackendBucket", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}", + "(google.api.method_signature)": "project,backend_bucket" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}" + } + }, + { + "(google.api.method_signature)": "project,backend_bucket" + } + ] + }, + "Insert": { + "requestType": "InsertBackendBucketRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendBuckets", + "(google.api.http).body": "backend_bucket_resource", + "(google.api.method_signature)": "project,backend_bucket_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendBuckets", + "body": "backend_bucket_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_bucket_resource" + } + ] + }, + "List": { + "requestType": "ListBackendBucketsRequest", + "responseType": "BackendBucketList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/backendBuckets", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/backendBuckets" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchBackendBucketRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}", + "(google.api.http).body": "backend_bucket_resource", + "(google.api.method_signature)": "project,backend_bucket,backend_bucket_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}", + "body": "backend_bucket_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_bucket,backend_bucket_resource" + } + ] + }, + "Update": { + "requestType": "UpdateBackendBucketRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}", + "(google.api.http).body": "backend_bucket_resource", + "(google.api.method_signature)": "project,backend_bucket,backend_bucket_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/global/backendBuckets/{backend_bucket}", + "body": "backend_bucket_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_bucket,backend_bucket_resource" + } + ] + } + } + }, + "BackendServices": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddSignedUrlKey": { + "requestType": "AddSignedUrlKeyBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/addSignedUrlKey", + "(google.api.http).body": "signed_url_key_resource", + "(google.api.method_signature)": "project,backend_service,signed_url_key_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/addSignedUrlKey", + "body": "signed_url_key_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_service,signed_url_key_resource" + } + ] + }, + "AggregatedList": { + "requestType": "AggregatedListBackendServicesRequest", + "responseType": "BackendServiceAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/backendServices", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/backendServices" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/backendServices/{backend_service}", + "(google.api.method_signature)": "project,backend_service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/backendServices/{backend_service}" + } + }, + { + "(google.api.method_signature)": "project,backend_service" + } + ] + }, + "DeleteSignedUrlKey": { + "requestType": "DeleteSignedUrlKeyBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/deleteSignedUrlKey", + "(google.api.method_signature)": "project,backend_service,key_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/deleteSignedUrlKey" + } + }, + { + "(google.api.method_signature)": "project,backend_service,key_name" + } + ] + }, + "Get": { + "requestType": "GetBackendServiceRequest", + "responseType": "BackendService", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/backendServices/{backend_service}", + "(google.api.method_signature)": "project,backend_service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/backendServices/{backend_service}" + } + }, + { + "(google.api.method_signature)": "project,backend_service" + } + ] + }, + "GetHealth": { + "requestType": "GetHealthBackendServiceRequest", + "responseType": "BackendServiceGroupHealth", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/getHealth", + "(google.api.http).body": "resource_group_reference_resource", + "(google.api.method_signature)": "project,backend_service,resource_group_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/getHealth", + "body": "resource_group_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_service,resource_group_reference_resource" + } + ] + }, + "Insert": { + "requestType": "InsertBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendServices", + "(google.api.http).body": "backend_service_resource", + "(google.api.method_signature)": "project,backend_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendServices", + "body": "backend_service_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_service_resource" + } + ] + }, + "List": { + "requestType": "ListBackendServicesRequest", + "responseType": "BackendServiceList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/backendServices", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/backendServices" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/backendServices/{backend_service}", + "(google.api.http).body": "backend_service_resource", + "(google.api.method_signature)": "project,backend_service,backend_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/backendServices/{backend_service}", + "body": "backend_service_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_service,backend_service_resource" + } + ] + }, + "SetSecurityPolicy": { + "requestType": "SetSecurityPolicyBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/setSecurityPolicy", + "(google.api.http).body": "security_policy_reference_resource", + "(google.api.method_signature)": "project,backend_service,security_policy_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/backendServices/{backend_service}/setSecurityPolicy", + "body": "security_policy_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_service,security_policy_reference_resource" + } + ] + }, + "Update": { + "requestType": "UpdateBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/global/backendServices/{backend_service}", + "(google.api.http).body": "backend_service_resource", + "(google.api.method_signature)": "project,backend_service,backend_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/global/backendServices/{backend_service}", + "body": "backend_service_resource" + } + }, + { + "(google.api.method_signature)": "project,backend_service,backend_service_resource" + } + ] + } + } + }, + "DiskTypes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListDiskTypesRequest", + "responseType": "DiskTypeAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/diskTypes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/diskTypes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Get": { + "requestType": "GetDiskTypeRequest", + "responseType": "DiskType", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/diskTypes/{disk_type}", + "(google.api.method_signature)": "project,zone,disk_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/diskTypes/{disk_type}" + } + }, + { + "(google.api.method_signature)": "project,zone,disk_type" + } + ] + }, + "List": { + "requestType": "ListDiskTypesRequest", + "responseType": "DiskTypeList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/diskTypes", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/diskTypes" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + } + } + }, + "Disks": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddResourcePolicies": { + "requestType": "AddResourcePoliciesDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies", + "(google.api.http).body": "disks_add_resource_policies_request_resource", + "(google.api.method_signature)": "project,zone,disk,disks_add_resource_policies_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/addResourcePolicies", + "body": "disks_add_resource_policies_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,disk,disks_add_resource_policies_request_resource" + } + ] + }, + "AggregatedList": { + "requestType": "AggregatedListDisksRequest", + "responseType": "DiskAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/disks", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/disks" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "CreateSnapshot": { + "requestType": "CreateSnapshotDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot", + "(google.api.http).body": "snapshot_resource", + "(google.api.method_signature)": "project,zone,disk,snapshot_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot", + "body": "snapshot_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,disk,snapshot_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}", + "(google.api.method_signature)": "project,zone,disk" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}" + } + }, + { + "(google.api.method_signature)": "project,zone,disk" + } + ] + }, + "Get": { + "requestType": "GetDiskRequest", + "responseType": "Disk", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}", + "(google.api.method_signature)": "project,zone,disk" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}" + } + }, + { + "(google.api.method_signature)": "project,zone,disk" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyDiskRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,zone,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,zone,resource" + } + ] + }, + "Insert": { + "requestType": "InsertDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks", + "(google.api.http).body": "disk_resource", + "(google.api.method_signature)": "project,zone,disk_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks", + "body": "disk_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,disk_resource" + } + ] + }, + "List": { + "requestType": "ListDisksRequest", + "responseType": "DiskList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/disks", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/disks" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "RemoveResourcePolicies": { + "requestType": "RemoveResourcePoliciesDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies", + "(google.api.http).body": "disks_remove_resource_policies_request_resource", + "(google.api.method_signature)": "project,zone,disk,disks_remove_resource_policies_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/removeResourcePolicies", + "body": "disks_remove_resource_policies_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,disk,disks_remove_resource_policies_request_resource" + } + ] + }, + "Resize": { + "requestType": "ResizeDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/resize", + "(google.api.http).body": "disks_resize_request_resource", + "(google.api.method_signature)": "project,zone,disk,disks_resize_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/resize", + "body": "disks_resize_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,disk,disks_resize_request_resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyDiskRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy", + "(google.api.http).body": "zone_set_policy_request_resource", + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy", + "body": "zone_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setLabels", + "(google.api.http).body": "zone_set_labels_request_resource", + "(google.api.method_signature)": "project,zone,resource,zone_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setLabels", + "body": "zone_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,zone_set_labels_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsDiskRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + } + ] + } + } + }, + "ExternalVpnGateways": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteExternalVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}", + "(google.api.method_signature)": "project,external_vpn_gateway" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}" + } + }, + { + "(google.api.method_signature)": "project,external_vpn_gateway" + } + ] + }, + "Get": { + "requestType": "GetExternalVpnGatewayRequest", + "responseType": "ExternalVpnGateway", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}", + "(google.api.method_signature)": "project,external_vpn_gateway" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/externalVpnGateways/{external_vpn_gateway}" + } + }, + { + "(google.api.method_signature)": "project,external_vpn_gateway" + } + ] + }, + "Insert": { + "requestType": "InsertExternalVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/externalVpnGateways", + "(google.api.http).body": "external_vpn_gateway_resource", + "(google.api.method_signature)": "project,external_vpn_gateway_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/externalVpnGateways", + "body": "external_vpn_gateway_resource" + } + }, + { + "(google.api.method_signature)": "project,external_vpn_gateway_resource" + } + ] + }, + "List": { + "requestType": "ListExternalVpnGatewaysRequest", + "responseType": "ExternalVpnGatewayList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/externalVpnGateways", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/externalVpnGateways" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsExternalVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/setLabels", + "(google.api.http).body": "global_set_labels_request_resource", + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/setLabels", + "body": "global_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsExternalVpnGatewayRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/externalVpnGateways/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + } + ] + } + } + }, + "FirewallPolicies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddAssociation": { + "requestType": "AddAssociationFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addAssociation", + "(google.api.http).body": "firewall_policy_association_resource", + "(google.api.method_signature)": "firewall_policy,firewall_policy_association_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addAssociation", + "body": "firewall_policy_association_resource" + } + }, + { + "(google.api.method_signature)": "firewall_policy,firewall_policy_association_resource" + } + ] + }, + "AddRule": { + "requestType": "AddRuleFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addRule", + "(google.api.http).body": "firewall_policy_rule_resource", + "(google.api.method_signature)": "firewall_policy,firewall_policy_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/addRule", + "body": "firewall_policy_rule_resource" + } + }, + { + "(google.api.method_signature)": "firewall_policy,firewall_policy_rule_resource" + } + ] + }, + "CloneRules": { + "requestType": "CloneRulesFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/cloneRules", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/cloneRules" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "Delete": { + "requestType": "DeleteFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "Get": { + "requestType": "GetFirewallPolicyRequest", + "responseType": "FirewallPolicy", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "GetAssociation": { + "requestType": "GetAssociationFirewallPolicyRequest", + "responseType": "FirewallPolicyAssociation", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getAssociation", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getAssociation" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyFirewallPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/firewallPolicies/{resource}/getIamPolicy", + "(google.api.method_signature)": "resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/firewallPolicies/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "resource" + } + ] + }, + "GetRule": { + "requestType": "GetRuleFirewallPolicyRequest", + "responseType": "FirewallPolicyRule", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getRule", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/getRule" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "Insert": { + "requestType": "InsertFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies", + "(google.api.http).body": "firewall_policy_resource", + "(google.api.method_signature)": "firewall_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies", + "body": "firewall_policy_resource" + } + }, + { + "(google.api.method_signature)": "firewall_policy_resource" + } + ] + }, + "List": { + "requestType": "ListFirewallPoliciesRequest", + "responseType": "FirewallPolicyList", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/firewallPolicies", + "(google.api.method_signature)": "" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/firewallPolicies" + } + }, + { + "(google.api.method_signature)": "" + } + ] + }, + "ListAssociations": { + "requestType": "ListAssociationsFirewallPolicyRequest", + "responseType": "FirewallPoliciesListAssociationsResponse", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/firewallPolicies/listAssociations", + "(google.api.method_signature)": "" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/firewallPolicies/listAssociations" + } + }, + { + "(google.api.method_signature)": "" + } + ] + }, + "Move": { + "requestType": "MoveFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/move", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/move" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "Patch": { + "requestType": "PatchFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}", + "(google.api.http).body": "firewall_policy_resource", + "(google.api.method_signature)": "firewall_policy,firewall_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}", + "body": "firewall_policy_resource" + } + }, + { + "(google.api.method_signature)": "firewall_policy,firewall_policy_resource" + } + ] + }, + "PatchRule": { + "requestType": "PatchRuleFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/patchRule", + "(google.api.http).body": "firewall_policy_rule_resource", + "(google.api.method_signature)": "firewall_policy,firewall_policy_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/patchRule", + "body": "firewall_policy_rule_resource" + } + }, + { + "(google.api.method_signature)": "firewall_policy,firewall_policy_rule_resource" + } + ] + }, + "RemoveAssociation": { + "requestType": "RemoveAssociationFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeAssociation", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeAssociation" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "RemoveRule": { + "requestType": "RemoveRuleFirewallPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeRule", + "(google.api.method_signature)": "firewall_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{firewall_policy}/removeRule" + } + }, + { + "(google.api.method_signature)": "firewall_policy" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyFirewallPolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{resource}/setIamPolicy", + "(google.api.http).body": "global_organization_set_policy_request_resource", + "(google.api.method_signature)": "resource,global_organization_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{resource}/setIamPolicy", + "body": "global_organization_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "resource,global_organization_set_policy_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsFirewallPolicyRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/locations/global/firewallPolicies/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/locations/global/firewallPolicies/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "resource,test_permissions_request_resource" + } + ] + } + } + }, + "Firewalls": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteFirewallRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/firewalls/{firewall}", + "(google.api.method_signature)": "project,firewall" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/firewalls/{firewall}" + } + }, + { + "(google.api.method_signature)": "project,firewall" + } + ] + }, + "Get": { + "requestType": "GetFirewallRequest", + "responseType": "Firewall", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/firewalls/{firewall}", + "(google.api.method_signature)": "project,firewall" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/firewalls/{firewall}" + } + }, + { + "(google.api.method_signature)": "project,firewall" + } + ] + }, + "Insert": { + "requestType": "InsertFirewallRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/firewalls", + "(google.api.http).body": "firewall_resource", + "(google.api.method_signature)": "project,firewall_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/firewalls", + "body": "firewall_resource" + } + }, + { + "(google.api.method_signature)": "project,firewall_resource" + } + ] + }, + "List": { + "requestType": "ListFirewallsRequest", + "responseType": "FirewallList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/firewalls", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/firewalls" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchFirewallRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/firewalls/{firewall}", + "(google.api.http).body": "firewall_resource", + "(google.api.method_signature)": "project,firewall,firewall_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/firewalls/{firewall}", + "body": "firewall_resource" + } + }, + { + "(google.api.method_signature)": "project,firewall,firewall_resource" + } + ] + }, + "Update": { + "requestType": "UpdateFirewallRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/global/firewalls/{firewall}", + "(google.api.http).body": "firewall_resource", + "(google.api.method_signature)": "project,firewall,firewall_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/global/firewalls/{firewall}", + "body": "firewall_resource" + } + }, + { + "(google.api.method_signature)": "project,firewall,firewall_resource" + } + ] + } + } + }, + "ForwardingRules": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListForwardingRulesRequest", + "responseType": "ForwardingRuleAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/forwardingRules", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/forwardingRules" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}", + "(google.api.method_signature)": "project,region,forwarding_rule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" + } + }, + { + "(google.api.method_signature)": "project,region,forwarding_rule" + } + ] + }, + "Get": { + "requestType": "GetForwardingRuleRequest", + "responseType": "ForwardingRule", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}", + "(google.api.method_signature)": "project,region,forwarding_rule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" + } + }, + { + "(google.api.method_signature)": "project,region,forwarding_rule" + } + ] + }, + "Insert": { + "requestType": "InsertForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/forwardingRules", + "(google.api.http).body": "forwarding_rule_resource", + "(google.api.method_signature)": "project,region,forwarding_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/forwardingRules", + "body": "forwarding_rule_resource" + } + }, + { + "(google.api.method_signature)": "project,region,forwarding_rule_resource" + } + ] + }, + "List": { + "requestType": "ListForwardingRulesRequest", + "responseType": "ForwardingRuleList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/forwardingRules", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/forwardingRules" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}", + "(google.api.http).body": "forwarding_rule_resource", + "(google.api.method_signature)": "project,region,forwarding_rule,forwarding_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}", + "body": "forwarding_rule_resource" + } + }, + { + "(google.api.method_signature)": "project,region,forwarding_rule,forwarding_rule_resource" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels", + "(google.api.http).body": "region_set_labels_request_resource", + "(google.api.method_signature)": "project,region,resource,region_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels", + "body": "region_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,region_set_labels_request_resource" + } + ] + }, + "SetTarget": { + "requestType": "SetTargetForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}/setTarget", + "(google.api.http).body": "target_reference_resource", + "(google.api.method_signature)": "project,region,forwarding_rule,target_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}/setTarget", + "body": "target_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,region,forwarding_rule,target_reference_resource" + } + ] + } + } + }, + "GlobalAddresses": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteGlobalAddressRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/addresses/{address}", + "(google.api.method_signature)": "project,address" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/addresses/{address}" + } + }, + { + "(google.api.method_signature)": "project,address" + } + ] + }, + "Get": { + "requestType": "GetGlobalAddressRequest", + "responseType": "Address", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/addresses/{address}", + "(google.api.method_signature)": "project,address" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/addresses/{address}" + } + }, + { + "(google.api.method_signature)": "project,address" + } + ] + }, + "Insert": { + "requestType": "InsertGlobalAddressRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/addresses", + "(google.api.http).body": "address_resource", + "(google.api.method_signature)": "project,address_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/addresses", + "body": "address_resource" + } + }, + { + "(google.api.method_signature)": "project,address_resource" + } + ] + }, + "List": { + "requestType": "ListGlobalAddressesRequest", + "responseType": "AddressList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/addresses", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/addresses" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + } + } + }, + "GlobalForwardingRules": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteGlobalForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}", + "(google.api.method_signature)": "project,forwarding_rule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}" + } + }, + { + "(google.api.method_signature)": "project,forwarding_rule" + } + ] + }, + "Get": { + "requestType": "GetGlobalForwardingRuleRequest", + "responseType": "ForwardingRule", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}", + "(google.api.method_signature)": "project,forwarding_rule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}" + } + }, + { + "(google.api.method_signature)": "project,forwarding_rule" + } + ] + }, + "Insert": { + "requestType": "InsertGlobalForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/forwardingRules", + "(google.api.http).body": "forwarding_rule_resource", + "(google.api.method_signature)": "project,forwarding_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/forwardingRules", + "body": "forwarding_rule_resource" + } + }, + { + "(google.api.method_signature)": "project,forwarding_rule_resource" + } + ] + }, + "List": { + "requestType": "ListGlobalForwardingRulesRequest", + "responseType": "ForwardingRuleList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/forwardingRules", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/forwardingRules" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchGlobalForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}", + "(google.api.http).body": "forwarding_rule_resource", + "(google.api.method_signature)": "project,forwarding_rule,forwarding_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}", + "body": "forwarding_rule_resource" + } + }, + { + "(google.api.method_signature)": "project,forwarding_rule,forwarding_rule_resource" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsGlobalForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/forwardingRules/{resource}/setLabels", + "(google.api.http).body": "global_set_labels_request_resource", + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/forwardingRules/{resource}/setLabels", + "body": "global_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + } + ] + }, + "SetTarget": { + "requestType": "SetTargetGlobalForwardingRuleRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}/setTarget", + "(google.api.http).body": "target_reference_resource", + "(google.api.method_signature)": "project,forwarding_rule,target_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/forwardingRules/{forwarding_rule}/setTarget", + "body": "target_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,forwarding_rule,target_reference_resource" + } + ] + } + } + }, + "GlobalNetworkEndpointGroups": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AttachNetworkEndpoints": { + "requestType": "AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints", + "(google.api.http).body": "global_network_endpoint_groups_attach_endpoints_request_resource", + "(google.api.method_signature)": "project,network_endpoint_group,global_network_endpoint_groups_attach_endpoints_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints", + "body": "global_network_endpoint_groups_attach_endpoints_request_resource" + } + }, + { + "(google.api.method_signature)": "project,network_endpoint_group,global_network_endpoint_groups_attach_endpoints_request_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteGlobalNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}", + "(google.api.method_signature)": "project,network_endpoint_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}" + } + }, + { + "(google.api.method_signature)": "project,network_endpoint_group" + } + ] + }, + "DetachNetworkEndpoints": { + "requestType": "DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints", + "(google.api.http).body": "global_network_endpoint_groups_detach_endpoints_request_resource", + "(google.api.method_signature)": "project,network_endpoint_group,global_network_endpoint_groups_detach_endpoints_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints", + "body": "global_network_endpoint_groups_detach_endpoints_request_resource" + } + }, + { + "(google.api.method_signature)": "project,network_endpoint_group,global_network_endpoint_groups_detach_endpoints_request_resource" + } + ] + }, + "Get": { + "requestType": "GetGlobalNetworkEndpointGroupRequest", + "responseType": "NetworkEndpointGroup", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}", + "(google.api.method_signature)": "project,network_endpoint_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}" + } + }, + { + "(google.api.method_signature)": "project,network_endpoint_group" + } + ] + }, + "Insert": { + "requestType": "InsertGlobalNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networkEndpointGroups", + "(google.api.http).body": "network_endpoint_group_resource", + "(google.api.method_signature)": "project,network_endpoint_group_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networkEndpointGroups", + "body": "network_endpoint_group_resource" + } + }, + { + "(google.api.method_signature)": "project,network_endpoint_group_resource" + } + ] + }, + "List": { + "requestType": "ListGlobalNetworkEndpointGroupsRequest", + "responseType": "NetworkEndpointGroupList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/networkEndpointGroups", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/networkEndpointGroups" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ListNetworkEndpoints": { + "requestType": "ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest", + "responseType": "NetworkEndpointGroupsListNetworkEndpoints", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints", + "(google.api.method_signature)": "project,network_endpoint_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints" + } + }, + { + "(google.api.method_signature)": "project,network_endpoint_group" + } + ] + } + } + }, + "GlobalOperations": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListGlobalOperationsRequest", + "responseType": "OperationAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/operations", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/operations" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteGlobalOperationRequest", + "responseType": "DeleteGlobalOperationResponse", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/operations/{operation}", + "(google.api.method_signature)": "project,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "project,operation" + } + ] + }, + "Get": { + "requestType": "GetGlobalOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/operations/{operation}", + "(google.api.method_signature)": "project,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "project,operation" + } + ] + }, + "List": { + "requestType": "ListGlobalOperationsRequest", + "responseType": "OperationList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/operations", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/operations" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Wait": { + "requestType": "WaitGlobalOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/operations/{operation}/wait", + "(google.api.method_signature)": "project,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/operations/{operation}/wait" + } + }, + { + "(google.api.method_signature)": "project,operation" + } + ] + } + } + }, + "GlobalOrganizationOperations": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteGlobalOrganizationOperationRequest", + "responseType": "DeleteGlobalOrganizationOperationResponse", + "options": { + "(google.api.http).delete": "/compute/v1/locations/global/operations/{operation}", + "(google.api.method_signature)": "operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/locations/global/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "operation" + } + ] + }, + "Get": { + "requestType": "GetGlobalOrganizationOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/operations/{operation}", + "(google.api.method_signature)": "operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "operation" + } + ] + }, + "List": { + "requestType": "ListGlobalOrganizationOperationsRequest", + "responseType": "OperationList", + "options": { + "(google.api.http).get": "/compute/v1/locations/global/operations", + "(google.api.method_signature)": "" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/locations/global/operations" + } + }, + { + "(google.api.method_signature)": "" + } + ] + } + } + }, + "GlobalPublicDelegatedPrefixes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteGlobalPublicDelegatedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}", + "(google.api.method_signature)": "project,public_delegated_prefix" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}" + } + }, + { + "(google.api.method_signature)": "project,public_delegated_prefix" + } + ] + }, + "Get": { + "requestType": "GetGlobalPublicDelegatedPrefixeRequest", + "responseType": "PublicDelegatedPrefix", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}", + "(google.api.method_signature)": "project,public_delegated_prefix" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}" + } + }, + { + "(google.api.method_signature)": "project,public_delegated_prefix" + } + ] + }, + "Insert": { + "requestType": "InsertGlobalPublicDelegatedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes", + "(google.api.http).body": "public_delegated_prefix_resource", + "(google.api.method_signature)": "project,public_delegated_prefix_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes", + "body": "public_delegated_prefix_resource" + } + }, + { + "(google.api.method_signature)": "project,public_delegated_prefix_resource" + } + ] + }, + "List": { + "requestType": "ListGlobalPublicDelegatedPrefixesRequest", + "responseType": "PublicDelegatedPrefixList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchGlobalPublicDelegatedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}", + "(google.api.http).body": "public_delegated_prefix_resource", + "(google.api.method_signature)": "project,public_delegated_prefix,public_delegated_prefix_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/publicDelegatedPrefixes/{public_delegated_prefix}", + "body": "public_delegated_prefix_resource" + } + }, + { + "(google.api.method_signature)": "project,public_delegated_prefix,public_delegated_prefix_resource" + } + ] + } + } + }, + "HealthChecks": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListHealthChecksRequest", + "responseType": "HealthChecksAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/healthChecks", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/healthChecks" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/healthChecks/{health_check}", + "(google.api.method_signature)": "project,health_check" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/healthChecks/{health_check}" + } + }, + { + "(google.api.method_signature)": "project,health_check" + } + ] + }, + "Get": { + "requestType": "GetHealthCheckRequest", + "responseType": "HealthCheck", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/healthChecks/{health_check}", + "(google.api.method_signature)": "project,health_check" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/healthChecks/{health_check}" + } + }, + { + "(google.api.method_signature)": "project,health_check" + } + ] + }, + "Insert": { + "requestType": "InsertHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/healthChecks", + "(google.api.http).body": "health_check_resource", + "(google.api.method_signature)": "project,health_check_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/healthChecks", + "body": "health_check_resource" + } + }, + { + "(google.api.method_signature)": "project,health_check_resource" + } + ] + }, + "List": { + "requestType": "ListHealthChecksRequest", + "responseType": "HealthCheckList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/healthChecks", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/healthChecks" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/healthChecks/{health_check}", + "(google.api.http).body": "health_check_resource", + "(google.api.method_signature)": "project,health_check,health_check_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/healthChecks/{health_check}", + "body": "health_check_resource" + } + }, + { + "(google.api.method_signature)": "project,health_check,health_check_resource" + } + ] + }, + "Update": { + "requestType": "UpdateHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/global/healthChecks/{health_check}", + "(google.api.http).body": "health_check_resource", + "(google.api.method_signature)": "project,health_check,health_check_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/global/healthChecks/{health_check}", + "body": "health_check_resource" + } + }, + { + "(google.api.method_signature)": "project,health_check,health_check_resource" + } + ] + } + } + }, + "Images": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteImageRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/images/{image}", + "(google.api.method_signature)": "project,image" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/images/{image}" + } + }, + { + "(google.api.method_signature)": "project,image" + } + ] + }, + "Deprecate": { + "requestType": "DeprecateImageRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/images/{image}/deprecate", + "(google.api.http).body": "deprecation_status_resource", + "(google.api.method_signature)": "project,image,deprecation_status_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/images/{image}/deprecate", + "body": "deprecation_status_resource" + } + }, + { + "(google.api.method_signature)": "project,image,deprecation_status_resource" + } + ] + }, + "Get": { + "requestType": "GetImageRequest", + "responseType": "Image", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/images/{image}", + "(google.api.method_signature)": "project,image" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/images/{image}" + } + }, + { + "(google.api.method_signature)": "project,image" + } + ] + }, + "GetFromFamily": { + "requestType": "GetFromFamilyImageRequest", + "responseType": "Image", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/images/family/{family}", + "(google.api.method_signature)": "project,family" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/images/family/{family}" + } + }, + { + "(google.api.method_signature)": "project,family" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyImageRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/images/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/images/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,resource" + } + ] + }, + "Insert": { + "requestType": "InsertImageRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/images", + "(google.api.http).body": "image_resource", + "(google.api.method_signature)": "project,image_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/images", + "body": "image_resource" + } + }, + { + "(google.api.method_signature)": "project,image_resource" + } + ] + }, + "List": { + "requestType": "ListImagesRequest", + "responseType": "ImageList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/images", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/images" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchImageRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/images/{image}", + "(google.api.http).body": "image_resource", + "(google.api.method_signature)": "project,image,image_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/images/{image}", + "body": "image_resource" + } + }, + { + "(google.api.method_signature)": "project,image,image_resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyImageRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/images/{resource}/setIamPolicy", + "(google.api.http).body": "global_set_policy_request_resource", + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/images/{resource}/setIamPolicy", + "body": "global_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsImageRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/images/{resource}/setLabels", + "(google.api.http).body": "global_set_labels_request_resource", + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/images/{resource}/setLabels", + "body": "global_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsImageRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/images/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/images/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + } + ] + } + } + }, + "InstanceGroupManagers": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AbandonInstances": { + "requestType": "AbandonInstancesInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/abandonInstances", + "(google.api.http).body": "instance_group_managers_abandon_instances_request_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_abandon_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/abandonInstances", + "body": "instance_group_managers_abandon_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_abandon_instances_request_resource" + } + ] + }, + "AggregatedList": { + "requestType": "AggregatedListInstanceGroupManagersRequest", + "responseType": "InstanceGroupManagerAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/instanceGroupManagers", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/instanceGroupManagers" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ApplyUpdatesToInstances": { + "requestType": "ApplyUpdatesToInstancesInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances", + "(google.api.http).body": "instance_group_managers_apply_updates_request_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_apply_updates_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances", + "body": "instance_group_managers_apply_updates_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_apply_updates_request_resource" + } + ] + }, + "CreateInstances": { + "requestType": "CreateInstancesInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/createInstances", + "(google.api.http).body": "instance_group_managers_create_instances_request_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_create_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/createInstances", + "body": "instance_group_managers_create_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_create_instances_request_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}", + "(google.api.method_signature)": "project,zone,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager" + } + ] + }, + "DeleteInstances": { + "requestType": "DeleteInstancesInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deleteInstances", + "(google.api.http).body": "instance_group_managers_delete_instances_request_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_delete_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deleteInstances", + "body": "instance_group_managers_delete_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_delete_instances_request_resource" + } + ] + }, + "DeletePerInstanceConfigs": { + "requestType": "DeletePerInstanceConfigsInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs", + "(google.api.http).body": "instance_group_managers_delete_per_instance_configs_req_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_delete_per_instance_configs_req_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs", + "body": "instance_group_managers_delete_per_instance_configs_req_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_delete_per_instance_configs_req_resource" + } + ] + }, + "Get": { + "requestType": "GetInstanceGroupManagerRequest", + "responseType": "InstanceGroupManager", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}", + "(google.api.method_signature)": "project,zone,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager" + } + ] + }, + "Insert": { + "requestType": "InsertInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers", + "(google.api.http).body": "instance_group_manager_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers", + "body": "instance_group_manager_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager_resource" + } + ] + }, + "List": { + "requestType": "ListInstanceGroupManagersRequest", + "responseType": "InstanceGroupManagerList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "ListErrors": { + "requestType": "ListErrorsInstanceGroupManagersRequest", + "responseType": "InstanceGroupManagersListErrorsResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listErrors", + "(google.api.method_signature)": "project,zone,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listErrors" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager" + } + ] + }, + "ListManagedInstances": { + "requestType": "ListManagedInstancesInstanceGroupManagersRequest", + "responseType": "InstanceGroupManagersListManagedInstancesResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listManagedInstances", + "(google.api.method_signature)": "project,zone,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listManagedInstances" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager" + } + ] + }, + "ListPerInstanceConfigs": { + "requestType": "ListPerInstanceConfigsInstanceGroupManagersRequest", + "responseType": "InstanceGroupManagersListPerInstanceConfigsResp", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs", + "(google.api.method_signature)": "project,zone,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager" + } + ] + }, + "Patch": { + "requestType": "PatchInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}", + "(google.api.http).body": "instance_group_manager_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_manager_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}", + "body": "instance_group_manager_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_manager_resource" + } + ] + }, + "PatchPerInstanceConfigs": { + "requestType": "PatchPerInstanceConfigsInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs", + "(google.api.http).body": "instance_group_managers_patch_per_instance_configs_req_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_patch_per_instance_configs_req_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs", + "body": "instance_group_managers_patch_per_instance_configs_req_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_patch_per_instance_configs_req_resource" + } + ] + }, + "RecreateInstances": { + "requestType": "RecreateInstancesInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/recreateInstances", + "(google.api.http).body": "instance_group_managers_recreate_instances_request_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_recreate_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/recreateInstances", + "body": "instance_group_managers_recreate_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_recreate_instances_request_resource" + } + ] + }, + "Resize": { + "requestType": "ResizeInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resize", + "(google.api.method_signature)": "project,zone,instance_group_manager,size" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/resize" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,size" + } + ] + }, + "SetInstanceTemplate": { + "requestType": "SetInstanceTemplateInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate", + "(google.api.http).body": "instance_group_managers_set_instance_template_request_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_set_instance_template_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate", + "body": "instance_group_managers_set_instance_template_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_set_instance_template_request_resource" + } + ] + }, + "SetTargetPools": { + "requestType": "SetTargetPoolsInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setTargetPools", + "(google.api.http).body": "instance_group_managers_set_target_pools_request_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_set_target_pools_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/setTargetPools", + "body": "instance_group_managers_set_target_pools_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_set_target_pools_request_resource" + } + ] + }, + "UpdatePerInstanceConfigs": { + "requestType": "UpdatePerInstanceConfigsInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs", + "(google.api.http).body": "instance_group_managers_update_per_instance_configs_req_resource", + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_update_per_instance_configs_req_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs", + "body": "instance_group_managers_update_per_instance_configs_req_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_manager,instance_group_managers_update_per_instance_configs_req_resource" + } + ] + } + } + }, + "InstanceGroups": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddInstances": { + "requestType": "AddInstancesInstanceGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/addInstances", + "(google.api.http).body": "instance_groups_add_instances_request_resource", + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_add_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/addInstances", + "body": "instance_groups_add_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_add_instances_request_resource" + } + ] + }, + "AggregatedList": { + "requestType": "AggregatedListInstanceGroupsRequest", + "responseType": "InstanceGroupAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/instanceGroups", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/instanceGroups" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteInstanceGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}", + "(google.api.method_signature)": "project,zone,instance_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group" + } + ] + }, + "Get": { + "requestType": "GetInstanceGroupRequest", + "responseType": "InstanceGroup", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}", + "(google.api.method_signature)": "project,zone,instance_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group" + } + ] + }, + "Insert": { + "requestType": "InsertInstanceGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups", + "(google.api.http).body": "instance_group_resource", + "(google.api.method_signature)": "project,zone,instance_group_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups", + "body": "instance_group_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group_resource" + } + ] + }, + "List": { + "requestType": "ListInstanceGroupsRequest", + "responseType": "InstanceGroupList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesInstanceGroupsRequest", + "responseType": "InstanceGroupsListInstances", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/listInstances", + "(google.api.http).body": "instance_groups_list_instances_request_resource", + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_list_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/listInstances", + "body": "instance_groups_list_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_list_instances_request_resource" + } + ] + }, + "RemoveInstances": { + "requestType": "RemoveInstancesInstanceGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/removeInstances", + "(google.api.http).body": "instance_groups_remove_instances_request_resource", + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_remove_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/removeInstances", + "body": "instance_groups_remove_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_remove_instances_request_resource" + } + ] + }, + "SetNamedPorts": { + "requestType": "SetNamedPortsInstanceGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/setNamedPorts", + "(google.api.http).body": "instance_groups_set_named_ports_request_resource", + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_set_named_ports_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/setNamedPorts", + "body": "instance_groups_set_named_ports_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_group,instance_groups_set_named_ports_request_resource" + } + ] + } + } + }, + "InstanceTemplates": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteInstanceTemplateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}", + "(google.api.method_signature)": "project,instance_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}" + } + }, + { + "(google.api.method_signature)": "project,instance_template" + } + ] + }, + "Get": { + "requestType": "GetInstanceTemplateRequest", + "responseType": "InstanceTemplate", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}", + "(google.api.method_signature)": "project,instance_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/instanceTemplates/{instance_template}" + } + }, + { + "(google.api.method_signature)": "project,instance_template" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyInstanceTemplateRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,resource" + } + ] + }, + "Insert": { + "requestType": "InsertInstanceTemplateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/instanceTemplates", + "(google.api.http).body": "instance_template_resource", + "(google.api.method_signature)": "project,instance_template_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/instanceTemplates", + "body": "instance_template_resource" + } + }, + { + "(google.api.method_signature)": "project,instance_template_resource" + } + ] + }, + "List": { + "requestType": "ListInstanceTemplatesRequest", + "responseType": "InstanceTemplateList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/instanceTemplates", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/instanceTemplates" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyInstanceTemplateRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/setIamPolicy", + "(google.api.http).body": "global_set_policy_request_resource", + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/setIamPolicy", + "body": "global_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsInstanceTemplateRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + } + ] + } + } + }, + "Instances": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddAccessConfig": { + "requestType": "AddAccessConfigInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig", + "(google.api.http).body": "access_config_resource", + "(google.api.method_signature)": "project,zone,instance,network_interface,access_config_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig", + "body": "access_config_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,network_interface,access_config_resource" + } + ] + }, + "AddResourcePolicies": { + "requestType": "AddResourcePoliciesInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies", + "(google.api.http).body": "instances_add_resource_policies_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_add_resource_policies_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies", + "body": "instances_add_resource_policies_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_add_resource_policies_request_resource" + } + ] + }, + "AggregatedList": { + "requestType": "AggregatedListInstancesRequest", + "responseType": "InstanceAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/instances", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/instances" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "AttachDisk": { + "requestType": "AttachDiskInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk", + "(google.api.http).body": "attached_disk_resource", + "(google.api.method_signature)": "project,zone,instance,attached_disk_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk", + "body": "attached_disk_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,attached_disk_resource" + } + ] + }, + "BulkInsert": { + "requestType": "BulkInsertInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/bulkInsert", + "(google.api.http).body": "bulk_insert_instance_resource_resource", + "(google.api.method_signature)": "project,zone,bulk_insert_instance_resource_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/bulkInsert", + "body": "bulk_insert_instance_resource_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,bulk_insert_instance_resource_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "DeleteAccessConfig": { + "requestType": "DeleteAccessConfigInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig", + "(google.api.method_signature)": "project,zone,instance,access_config,network_interface" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,access_config,network_interface" + } + ] + }, + "DetachDisk": { + "requestType": "DetachDiskInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/detachDisk", + "(google.api.method_signature)": "project,zone,instance,device_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/detachDisk" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,device_name" + } + ] + }, + "Get": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "GetEffectiveFirewalls": { + "requestType": "GetEffectiveFirewallsInstanceRequest", + "responseType": "InstancesGetEffectiveFirewallsResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls", + "(google.api.method_signature)": "project,zone,instance,network_interface" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,network_interface" + } + ] + }, + "GetGuestAttributes": { + "requestType": "GetGuestAttributesInstanceRequest", + "responseType": "GuestAttributes", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyInstanceRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,zone,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,zone,resource" + } + ] + }, + "GetScreenshot": { + "requestType": "GetScreenshotInstanceRequest", + "responseType": "Screenshot", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/screenshot", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/screenshot" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "GetSerialPortOutput": { + "requestType": "GetSerialPortOutputInstanceRequest", + "responseType": "SerialPortOutput", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "GetShieldedInstanceIdentity": { + "requestType": "GetShieldedInstanceIdentityInstanceRequest", + "responseType": "ShieldedInstanceIdentity", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "Insert": { + "requestType": "InsertInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances", + "(google.api.http).body": "instance_resource", + "(google.api.method_signature)": "project,zone,instance_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances", + "body": "instance_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance_resource" + } + ] + }, + "List": { + "requestType": "ListInstancesRequest", + "responseType": "InstanceList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "ListReferrers": { + "requestType": "ListReferrersInstancesRequest", + "responseType": "InstanceListReferrers", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/referrers", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/referrers" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "RemoveResourcePolicies": { + "requestType": "RemoveResourcePoliciesInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies", + "(google.api.http).body": "instances_remove_resource_policies_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_remove_resource_policies_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies", + "body": "instances_remove_resource_policies_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_remove_resource_policies_request_resource" + } + ] + }, + "Reset": { + "requestType": "ResetInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reset", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reset" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "SetDeletionProtection": { + "requestType": "SetDeletionProtectionInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection", + "(google.api.method_signature)": "project,zone,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection" + } + }, + { + "(google.api.method_signature)": "project,zone,resource" + } + ] + }, + "SetDiskAutoDelete": { + "requestType": "SetDiskAutoDeleteInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete", + "(google.api.method_signature)": "project,zone,instance,auto_delete,device_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,auto_delete,device_name" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyInstanceRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy", + "(google.api.http).body": "zone_set_policy_request_resource", + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy", + "body": "zone_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setLabels", + "(google.api.http).body": "instances_set_labels_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setLabels", + "body": "instances_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_set_labels_request_resource" + } + ] + }, + "SetMachineResources": { + "requestType": "SetMachineResourcesInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources", + "(google.api.http).body": "instances_set_machine_resources_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_set_machine_resources_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources", + "body": "instances_set_machine_resources_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_set_machine_resources_request_resource" + } + ] + }, + "SetMachineType": { + "requestType": "SetMachineTypeInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineType", + "(google.api.http).body": "instances_set_machine_type_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_set_machine_type_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineType", + "body": "instances_set_machine_type_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_set_machine_type_request_resource" + } + ] + }, + "SetMetadata": { + "requestType": "SetMetadataInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata", + "(google.api.http).body": "metadata_resource", + "(google.api.method_signature)": "project,zone,instance,metadata_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata", + "body": "metadata_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,metadata_resource" + } + ] + }, + "SetMinCpuPlatform": { + "requestType": "SetMinCpuPlatformInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform", + "(google.api.http).body": "instances_set_min_cpu_platform_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_set_min_cpu_platform_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform", + "body": "instances_set_min_cpu_platform_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_set_min_cpu_platform_request_resource" + } + ] + }, + "SetScheduling": { + "requestType": "SetSchedulingInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setScheduling", + "(google.api.http).body": "scheduling_resource", + "(google.api.method_signature)": "project,zone,instance,scheduling_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setScheduling", + "body": "scheduling_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,scheduling_resource" + } + ] + }, + "SetServiceAccount": { + "requestType": "SetServiceAccountInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount", + "(google.api.http).body": "instances_set_service_account_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_set_service_account_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount", + "body": "instances_set_service_account_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_set_service_account_request_resource" + } + ] + }, + "SetShieldedInstanceIntegrityPolicy": { + "requestType": "SetShieldedInstanceIntegrityPolicyInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy", + "(google.api.http).body": "shielded_instance_integrity_policy_resource", + "(google.api.method_signature)": "project,zone,instance,shielded_instance_integrity_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy", + "body": "shielded_instance_integrity_policy_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,shielded_instance_integrity_policy_resource" + } + ] + }, + "SetTags": { + "requestType": "SetTagsInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setTags", + "(google.api.http).body": "tags_resource", + "(google.api.method_signature)": "project,zone,instance,tags_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setTags", + "body": "tags_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,tags_resource" + } + ] + }, + "SimulateMaintenanceEvent": { + "requestType": "SimulateMaintenanceEventInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "Start": { + "requestType": "StartInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/start", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/start" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "StartWithEncryptionKey": { + "requestType": "StartWithEncryptionKeyInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey", + "(google.api.http).body": "instances_start_with_encryption_key_request_resource", + "(google.api.method_signature)": "project,zone,instance,instances_start_with_encryption_key_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey", + "body": "instances_start_with_encryption_key_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instances_start_with_encryption_key_request_resource" + } + ] + }, + "Stop": { + "requestType": "StopInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop", + "(google.api.method_signature)": "project,zone,instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop" + } + }, + { + "(google.api.method_signature)": "project,zone,instance" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsInstanceRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + } + ] + }, + "Update": { + "requestType": "UpdateInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}", + "(google.api.http).body": "instance_resource", + "(google.api.method_signature)": "project,zone,instance,instance_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}", + "body": "instance_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,instance_resource" + } + ] + }, + "UpdateAccessConfig": { + "requestType": "UpdateAccessConfigInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig", + "(google.api.http).body": "access_config_resource", + "(google.api.method_signature)": "project,zone,instance,network_interface,access_config_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig", + "body": "access_config_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,network_interface,access_config_resource" + } + ] + }, + "UpdateDisplayDevice": { + "requestType": "UpdateDisplayDeviceInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice", + "(google.api.http).body": "display_device_resource", + "(google.api.method_signature)": "project,zone,instance,display_device_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice", + "body": "display_device_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,display_device_resource" + } + ] + }, + "UpdateNetworkInterface": { + "requestType": "UpdateNetworkInterfaceInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface", + "(google.api.http).body": "network_interface_resource", + "(google.api.method_signature)": "project,zone,instance,network_interface,network_interface_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface", + "body": "network_interface_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,network_interface,network_interface_resource" + } + ] + }, + "UpdateShieldedInstanceConfig": { + "requestType": "UpdateShieldedInstanceConfigInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig", + "(google.api.http).body": "shielded_instance_config_resource", + "(google.api.method_signature)": "project,zone,instance,shielded_instance_config_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig", + "body": "shielded_instance_config_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,instance,shielded_instance_config_resource" + } + ] + } + } + }, + "InterconnectAttachments": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListInterconnectAttachmentsRequest", + "responseType": "InterconnectAttachmentAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/interconnectAttachments", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/interconnectAttachments" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteInterconnectAttachmentRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}", + "(google.api.method_signature)": "project,region,interconnect_attachment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}" + } + }, + { + "(google.api.method_signature)": "project,region,interconnect_attachment" + } + ] + }, + "Get": { + "requestType": "GetInterconnectAttachmentRequest", + "responseType": "InterconnectAttachment", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}", + "(google.api.method_signature)": "project,region,interconnect_attachment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}" + } + }, + { + "(google.api.method_signature)": "project,region,interconnect_attachment" + } + ] + }, + "Insert": { + "requestType": "InsertInterconnectAttachmentRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments", + "(google.api.http).body": "interconnect_attachment_resource", + "(google.api.method_signature)": "project,region,interconnect_attachment_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments", + "body": "interconnect_attachment_resource" + } + }, + { + "(google.api.method_signature)": "project,region,interconnect_attachment_resource" + } + ] + }, + "List": { + "requestType": "ListInterconnectAttachmentsRequest", + "responseType": "InterconnectAttachmentList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchInterconnectAttachmentRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}", + "(google.api.http).body": "interconnect_attachment_resource", + "(google.api.method_signature)": "project,region,interconnect_attachment,interconnect_attachment_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnect_attachment}", + "body": "interconnect_attachment_resource" + } + }, + { + "(google.api.method_signature)": "project,region,interconnect_attachment,interconnect_attachment_resource" + } + ] + } + } + }, + "InterconnectLocations": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Get": { + "requestType": "GetInterconnectLocationRequest", + "responseType": "InterconnectLocation", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/interconnectLocations/{interconnect_location}", + "(google.api.method_signature)": "project,interconnect_location" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/interconnectLocations/{interconnect_location}" + } + }, + { + "(google.api.method_signature)": "project,interconnect_location" + } + ] + }, + "List": { + "requestType": "ListInterconnectLocationsRequest", + "responseType": "InterconnectLocationList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/interconnectLocations", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/interconnectLocations" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + } + } + }, + "Interconnects": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteInterconnectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/interconnects/{interconnect}", + "(google.api.method_signature)": "project,interconnect" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/interconnects/{interconnect}" + } + }, + { + "(google.api.method_signature)": "project,interconnect" + } + ] + }, + "Get": { + "requestType": "GetInterconnectRequest", + "responseType": "Interconnect", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/interconnects/{interconnect}", + "(google.api.method_signature)": "project,interconnect" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/interconnects/{interconnect}" + } + }, + { + "(google.api.method_signature)": "project,interconnect" + } + ] + }, + "GetDiagnostics": { + "requestType": "GetDiagnosticsInterconnectRequest", + "responseType": "InterconnectsGetDiagnosticsResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/interconnects/{interconnect}/getDiagnostics", + "(google.api.method_signature)": "project,interconnect" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/interconnects/{interconnect}/getDiagnostics" + } + }, + { + "(google.api.method_signature)": "project,interconnect" + } + ] + }, + "Insert": { + "requestType": "InsertInterconnectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/interconnects", + "(google.api.http).body": "interconnect_resource", + "(google.api.method_signature)": "project,interconnect_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/interconnects", + "body": "interconnect_resource" + } + }, + { + "(google.api.method_signature)": "project,interconnect_resource" + } + ] + }, + "List": { + "requestType": "ListInterconnectsRequest", + "responseType": "InterconnectList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/interconnects", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/interconnects" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchInterconnectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/interconnects/{interconnect}", + "(google.api.http).body": "interconnect_resource", + "(google.api.method_signature)": "project,interconnect,interconnect_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/interconnects/{interconnect}", + "body": "interconnect_resource" + } + }, + { + "(google.api.method_signature)": "project,interconnect,interconnect_resource" + } + ] + } + } + }, + "LicenseCodes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Get": { + "requestType": "GetLicenseCodeRequest", + "responseType": "LicenseCode", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/licenseCodes/{license_code}", + "(google.api.method_signature)": "project,license_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/licenseCodes/{license_code}" + } + }, + { + "(google.api.method_signature)": "project,license_code" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsLicenseCodeRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/licenseCodes/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/licenseCodes/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + } + ] + } + } + }, + "Licenses": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteLicenseRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/licenses/{license}", + "(google.api.method_signature)": "project,license" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/licenses/{license}" + } + }, + { + "(google.api.method_signature)": "project,license" + } + ] + }, + "Get": { + "requestType": "GetLicenseRequest", + "responseType": "License", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/licenses/{license}", + "(google.api.method_signature)": "project,license" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/licenses/{license}" + } + }, + { + "(google.api.method_signature)": "project,license" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyLicenseRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/licenses/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/licenses/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,resource" + } + ] + }, + "Insert": { + "requestType": "InsertLicenseRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/licenses", + "(google.api.http).body": "license_resource", + "(google.api.method_signature)": "project,license_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/licenses", + "body": "license_resource" + } + }, + { + "(google.api.method_signature)": "project,license_resource" + } + ] + }, + "List": { + "requestType": "ListLicensesRequest", + "responseType": "LicensesListResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/licenses", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/licenses" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyLicenseRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/licenses/{resource}/setIamPolicy", + "(google.api.http).body": "global_set_policy_request_resource", + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/licenses/{resource}/setIamPolicy", + "body": "global_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsLicenseRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/licenses/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/licenses/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + } + ] + } + } + }, + "MachineTypes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListMachineTypesRequest", + "responseType": "MachineTypeAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/machineTypes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/machineTypes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Get": { + "requestType": "GetMachineTypeRequest", + "responseType": "MachineType", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/machineTypes/{machine_type}", + "(google.api.method_signature)": "project,zone,machine_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/machineTypes/{machine_type}" + } + }, + { + "(google.api.method_signature)": "project,zone,machine_type" + } + ] + }, + "List": { + "requestType": "ListMachineTypesRequest", + "responseType": "MachineTypeList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/machineTypes", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/machineTypes" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + } + } + }, + "NetworkEndpointGroups": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListNetworkEndpointGroupsRequest", + "responseType": "NetworkEndpointGroupAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/networkEndpointGroups", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/networkEndpointGroups" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "AttachNetworkEndpoints": { + "requestType": "AttachNetworkEndpointsNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints", + "(google.api.http).body": "network_endpoint_groups_attach_endpoints_request_resource", + "(google.api.method_signature)": "project,zone,network_endpoint_group,network_endpoint_groups_attach_endpoints_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/attachNetworkEndpoints", + "body": "network_endpoint_groups_attach_endpoints_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,network_endpoint_group,network_endpoint_groups_attach_endpoints_request_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}", + "(google.api.method_signature)": "project,zone,network_endpoint_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}" + } + }, + { + "(google.api.method_signature)": "project,zone,network_endpoint_group" + } + ] + }, + "DetachNetworkEndpoints": { + "requestType": "DetachNetworkEndpointsNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints", + "(google.api.http).body": "network_endpoint_groups_detach_endpoints_request_resource", + "(google.api.method_signature)": "project,zone,network_endpoint_group,network_endpoint_groups_detach_endpoints_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/detachNetworkEndpoints", + "body": "network_endpoint_groups_detach_endpoints_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,network_endpoint_group,network_endpoint_groups_detach_endpoints_request_resource" + } + ] + }, + "Get": { + "requestType": "GetNetworkEndpointGroupRequest", + "responseType": "NetworkEndpointGroup", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}", + "(google.api.method_signature)": "project,zone,network_endpoint_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}" + } + }, + { + "(google.api.method_signature)": "project,zone,network_endpoint_group" + } + ] + }, + "Insert": { + "requestType": "InsertNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups", + "(google.api.http).body": "network_endpoint_group_resource", + "(google.api.method_signature)": "project,zone,network_endpoint_group_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups", + "body": "network_endpoint_group_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,network_endpoint_group_resource" + } + ] + }, + "List": { + "requestType": "ListNetworkEndpointGroupsRequest", + "responseType": "NetworkEndpointGroupList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "ListNetworkEndpoints": { + "requestType": "ListNetworkEndpointsNetworkEndpointGroupsRequest", + "responseType": "NetworkEndpointGroupsListNetworkEndpoints", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints", + "(google.api.http).body": "network_endpoint_groups_list_endpoints_request_resource", + "(google.api.method_signature)": "project,zone,network_endpoint_group,network_endpoint_groups_list_endpoints_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{network_endpoint_group}/listNetworkEndpoints", + "body": "network_endpoint_groups_list_endpoints_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,network_endpoint_group,network_endpoint_groups_list_endpoints_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsNetworkEndpointGroupRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + } + ] + } + } + }, + "Networks": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddPeering": { + "requestType": "AddPeeringNetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networks/{network}/addPeering", + "(google.api.http).body": "networks_add_peering_request_resource", + "(google.api.method_signature)": "project,network,networks_add_peering_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networks/{network}/addPeering", + "body": "networks_add_peering_request_resource" + } + }, + { + "(google.api.method_signature)": "project,network,networks_add_peering_request_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteNetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/networks/{network}", + "(google.api.method_signature)": "project,network" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/networks/{network}" + } + }, + { + "(google.api.method_signature)": "project,network" + } + ] + }, + "Get": { + "requestType": "GetNetworkRequest", + "responseType": "Network", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/networks/{network}", + "(google.api.method_signature)": "project,network" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/networks/{network}" + } + }, + { + "(google.api.method_signature)": "project,network" + } + ] + }, + "GetEffectiveFirewalls": { + "requestType": "GetEffectiveFirewallsNetworkRequest", + "responseType": "NetworksGetEffectiveFirewallsResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/networks/{network}/getEffectiveFirewalls", + "(google.api.method_signature)": "project,network" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/networks/{network}/getEffectiveFirewalls" + } + }, + { + "(google.api.method_signature)": "project,network" + } + ] + }, + "Insert": { + "requestType": "InsertNetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networks", + "(google.api.http).body": "network_resource", + "(google.api.method_signature)": "project,network_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networks", + "body": "network_resource" + } + }, + { + "(google.api.method_signature)": "project,network_resource" + } + ] + }, + "List": { + "requestType": "ListNetworksRequest", + "responseType": "NetworkList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/networks", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/networks" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ListPeeringRoutes": { + "requestType": "ListPeeringRoutesNetworksRequest", + "responseType": "ExchangedPeeringRoutesList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/networks/{network}/listPeeringRoutes", + "(google.api.method_signature)": "project,network" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/networks/{network}/listPeeringRoutes" + } + }, + { + "(google.api.method_signature)": "project,network" + } + ] + }, + "Patch": { + "requestType": "PatchNetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/networks/{network}", + "(google.api.http).body": "network_resource", + "(google.api.method_signature)": "project,network,network_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/networks/{network}", + "body": "network_resource" + } + }, + { + "(google.api.method_signature)": "project,network,network_resource" + } + ] + }, + "RemovePeering": { + "requestType": "RemovePeeringNetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networks/{network}/removePeering", + "(google.api.http).body": "networks_remove_peering_request_resource", + "(google.api.method_signature)": "project,network,networks_remove_peering_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networks/{network}/removePeering", + "body": "networks_remove_peering_request_resource" + } + }, + { + "(google.api.method_signature)": "project,network,networks_remove_peering_request_resource" + } + ] + }, + "SwitchToCustomMode": { + "requestType": "SwitchToCustomModeNetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/networks/{network}/switchToCustomMode", + "(google.api.method_signature)": "project,network" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/networks/{network}/switchToCustomMode" + } + }, + { + "(google.api.method_signature)": "project,network" + } + ] + }, + "UpdatePeering": { + "requestType": "UpdatePeeringNetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/networks/{network}/updatePeering", + "(google.api.http).body": "networks_update_peering_request_resource", + "(google.api.method_signature)": "project,network,networks_update_peering_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/networks/{network}/updatePeering", + "body": "networks_update_peering_request_resource" + } + }, + { + "(google.api.method_signature)": "project,network,networks_update_peering_request_resource" + } + ] + } + } + }, + "NodeGroups": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddNodes": { + "requestType": "AddNodesNodeGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/addNodes", + "(google.api.http).body": "node_groups_add_nodes_request_resource", + "(google.api.method_signature)": "project,zone,node_group,node_groups_add_nodes_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/addNodes", + "body": "node_groups_add_nodes_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group,node_groups_add_nodes_request_resource" + } + ] + }, + "AggregatedList": { + "requestType": "AggregatedListNodeGroupsRequest", + "responseType": "NodeGroupAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/nodeGroups", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/nodeGroups" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteNodeGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}", + "(google.api.method_signature)": "project,zone,node_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group" + } + ] + }, + "DeleteNodes": { + "requestType": "DeleteNodesNodeGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/deleteNodes", + "(google.api.http).body": "node_groups_delete_nodes_request_resource", + "(google.api.method_signature)": "project,zone,node_group,node_groups_delete_nodes_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/deleteNodes", + "body": "node_groups_delete_nodes_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group,node_groups_delete_nodes_request_resource" + } + ] + }, + "Get": { + "requestType": "GetNodeGroupRequest", + "responseType": "NodeGroup", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}", + "(google.api.method_signature)": "project,zone,node_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyNodeGroupRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,zone,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,zone,resource" + } + ] + }, + "Insert": { + "requestType": "InsertNodeGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups", + "(google.api.http).body": "node_group_resource", + "(google.api.method_signature)": "project,zone,initial_node_count,node_group_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups", + "body": "node_group_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,initial_node_count,node_group_resource" + } + ] + }, + "List": { + "requestType": "ListNodeGroupsRequest", + "responseType": "NodeGroupList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "ListNodes": { + "requestType": "ListNodesNodeGroupsRequest", + "responseType": "NodeGroupsListNodes", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/listNodes", + "(google.api.method_signature)": "project,zone,node_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/listNodes" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group" + } + ] + }, + "Patch": { + "requestType": "PatchNodeGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}", + "(google.api.http).body": "node_group_resource", + "(google.api.method_signature)": "project,zone,node_group,node_group_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}", + "body": "node_group_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group,node_group_resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyNodeGroupRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy", + "(google.api.http).body": "zone_set_policy_request_resource", + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy", + "body": "zone_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + } + ] + }, + "SetNodeTemplate": { + "requestType": "SetNodeTemplateNodeGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/setNodeTemplate", + "(google.api.http).body": "node_groups_set_node_template_request_resource", + "(google.api.method_signature)": "project,zone,node_group,node_groups_set_node_template_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{node_group}/setNodeTemplate", + "body": "node_groups_set_node_template_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,node_group,node_groups_set_node_template_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsNodeGroupRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + } + ] + } + } + }, + "NodeTemplates": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListNodeTemplatesRequest", + "responseType": "NodeTemplateAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/nodeTemplates", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/nodeTemplates" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteNodeTemplateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}", + "(google.api.method_signature)": "project,region,node_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}" + } + }, + { + "(google.api.method_signature)": "project,region,node_template" + } + ] + }, + "Get": { + "requestType": "GetNodeTemplateRequest", + "responseType": "NodeTemplate", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}", + "(google.api.method_signature)": "project,region,node_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{node_template}" + } + }, + { + "(google.api.method_signature)": "project,region,node_template" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyNodeTemplateRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,region,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,region,resource" + } + ] + }, + "Insert": { + "requestType": "InsertNodeTemplateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates", + "(google.api.http).body": "node_template_resource", + "(google.api.method_signature)": "project,region,node_template_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates", + "body": "node_template_resource" + } + }, + { + "(google.api.method_signature)": "project,region,node_template_resource" + } + ] + }, + "List": { + "requestType": "ListNodeTemplatesRequest", + "responseType": "NodeTemplateList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyNodeTemplateRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy", + "(google.api.http).body": "region_set_policy_request_resource", + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy", + "body": "region_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsNodeTemplateRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + } + ] + } + } + }, + "NodeTypes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListNodeTypesRequest", + "responseType": "NodeTypeAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/nodeTypes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/nodeTypes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Get": { + "requestType": "GetNodeTypeRequest", + "responseType": "NodeType", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/nodeTypes/{node_type}", + "(google.api.method_signature)": "project,zone,node_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/nodeTypes/{node_type}" + } + }, + { + "(google.api.method_signature)": "project,zone,node_type" + } + ] + }, + "List": { + "requestType": "ListNodeTypesRequest", + "responseType": "NodeTypeList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/nodeTypes", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/nodeTypes" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + } + } + }, + "PacketMirrorings": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListPacketMirroringsRequest", + "responseType": "PacketMirroringAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/packetMirrorings", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/packetMirrorings" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeletePacketMirroringRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}", + "(google.api.method_signature)": "project,region,packet_mirroring" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}" + } + }, + { + "(google.api.method_signature)": "project,region,packet_mirroring" + } + ] + }, + "Get": { + "requestType": "GetPacketMirroringRequest", + "responseType": "PacketMirroring", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}", + "(google.api.method_signature)": "project,region,packet_mirroring" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}" + } + }, + { + "(google.api.method_signature)": "project,region,packet_mirroring" + } + ] + }, + "Insert": { + "requestType": "InsertPacketMirroringRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings", + "(google.api.http).body": "packet_mirroring_resource", + "(google.api.method_signature)": "project,region,packet_mirroring_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings", + "body": "packet_mirroring_resource" + } + }, + { + "(google.api.method_signature)": "project,region,packet_mirroring_resource" + } + ] + }, + "List": { + "requestType": "ListPacketMirroringsRequest", + "responseType": "PacketMirroringList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchPacketMirroringRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}", + "(google.api.http).body": "packet_mirroring_resource", + "(google.api.method_signature)": "project,region,packet_mirroring,packet_mirroring_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{packet_mirroring}", + "body": "packet_mirroring_resource" + } + }, + { + "(google.api.method_signature)": "project,region,packet_mirroring,packet_mirroring_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsPacketMirroringRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + } + ] + } + } + }, + "Projects": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "DisableXpnHost": { + "requestType": "DisableXpnHostProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/disableXpnHost", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/disableXpnHost" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "DisableXpnResource": { + "requestType": "DisableXpnResourceProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/disableXpnResource", + "(google.api.http).body": "projects_disable_xpn_resource_request_resource", + "(google.api.method_signature)": "project,projects_disable_xpn_resource_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/disableXpnResource", + "body": "projects_disable_xpn_resource_request_resource" + } + }, + { + "(google.api.method_signature)": "project,projects_disable_xpn_resource_request_resource" + } + ] + }, + "EnableXpnHost": { + "requestType": "EnableXpnHostProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/enableXpnHost", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/enableXpnHost" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "EnableXpnResource": { + "requestType": "EnableXpnResourceProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/enableXpnResource", + "(google.api.http).body": "projects_enable_xpn_resource_request_resource", + "(google.api.method_signature)": "project,projects_enable_xpn_resource_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/enableXpnResource", + "body": "projects_enable_xpn_resource_request_resource" + } + }, + { + "(google.api.method_signature)": "project,projects_enable_xpn_resource_request_resource" + } + ] + }, + "Get": { + "requestType": "GetProjectRequest", + "responseType": "Project", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "GetXpnHost": { + "requestType": "GetXpnHostProjectRequest", + "responseType": "Project", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/getXpnHost", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/getXpnHost" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "GetXpnResources": { + "requestType": "GetXpnResourcesProjectsRequest", + "responseType": "ProjectsGetXpnResources", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/getXpnResources", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/getXpnResources" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ListXpnHosts": { + "requestType": "ListXpnHostsProjectsRequest", + "responseType": "XpnHostList", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/listXpnHosts", + "(google.api.http).body": "projects_list_xpn_hosts_request_resource", + "(google.api.method_signature)": "project,projects_list_xpn_hosts_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/listXpnHosts", + "body": "projects_list_xpn_hosts_request_resource" + } + }, + { + "(google.api.method_signature)": "project,projects_list_xpn_hosts_request_resource" + } + ] + }, + "MoveDisk": { + "requestType": "MoveDiskProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/moveDisk", + "(google.api.http).body": "disk_move_request_resource", + "(google.api.method_signature)": "project,disk_move_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/moveDisk", + "body": "disk_move_request_resource" + } + }, + { + "(google.api.method_signature)": "project,disk_move_request_resource" + } + ] + }, + "MoveInstance": { + "requestType": "MoveInstanceProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/moveInstance", + "(google.api.http).body": "instance_move_request_resource", + "(google.api.method_signature)": "project,instance_move_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/moveInstance", + "body": "instance_move_request_resource" + } + }, + { + "(google.api.method_signature)": "project,instance_move_request_resource" + } + ] + }, + "SetCommonInstanceMetadata": { + "requestType": "SetCommonInstanceMetadataProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/setCommonInstanceMetadata", + "(google.api.http).body": "metadata_resource", + "(google.api.method_signature)": "project,metadata_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/setCommonInstanceMetadata", + "body": "metadata_resource" + } + }, + { + "(google.api.method_signature)": "project,metadata_resource" + } + ] + }, + "SetDefaultNetworkTier": { + "requestType": "SetDefaultNetworkTierProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/setDefaultNetworkTier", + "(google.api.http).body": "projects_set_default_network_tier_request_resource", + "(google.api.method_signature)": "project,projects_set_default_network_tier_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/setDefaultNetworkTier", + "body": "projects_set_default_network_tier_request_resource" + } + }, + { + "(google.api.method_signature)": "project,projects_set_default_network_tier_request_resource" + } + ] + }, + "SetUsageExportBucket": { + "requestType": "SetUsageExportBucketProjectRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/setUsageExportBucket", + "(google.api.http).body": "usage_export_location_resource", + "(google.api.method_signature)": "project,usage_export_location_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/setUsageExportBucket", + "body": "usage_export_location_resource" + } + }, + { + "(google.api.method_signature)": "project,usage_export_location_resource" + } + ] + } + } + }, + "PublicAdvertisedPrefixes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeletePublicAdvertisedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}", + "(google.api.method_signature)": "project,public_advertised_prefix" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}" + } + }, + { + "(google.api.method_signature)": "project,public_advertised_prefix" + } + ] + }, + "Get": { + "requestType": "GetPublicAdvertisedPrefixeRequest", + "responseType": "PublicAdvertisedPrefix", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}", + "(google.api.method_signature)": "project,public_advertised_prefix" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}" + } + }, + { + "(google.api.method_signature)": "project,public_advertised_prefix" + } + ] + }, + "Insert": { + "requestType": "InsertPublicAdvertisedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes", + "(google.api.http).body": "public_advertised_prefix_resource", + "(google.api.method_signature)": "project,public_advertised_prefix_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes", + "body": "public_advertised_prefix_resource" + } + }, + { + "(google.api.method_signature)": "project,public_advertised_prefix_resource" + } + ] + }, + "List": { + "requestType": "ListPublicAdvertisedPrefixesRequest", + "responseType": "PublicAdvertisedPrefixList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchPublicAdvertisedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}", + "(google.api.http).body": "public_advertised_prefix_resource", + "(google.api.method_signature)": "project,public_advertised_prefix,public_advertised_prefix_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/publicAdvertisedPrefixes/{public_advertised_prefix}", + "body": "public_advertised_prefix_resource" + } + }, + { + "(google.api.method_signature)": "project,public_advertised_prefix,public_advertised_prefix_resource" + } + ] + } + } + }, + "PublicDelegatedPrefixes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListPublicDelegatedPrefixesRequest", + "responseType": "PublicDelegatedPrefixAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/publicDelegatedPrefixes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/publicDelegatedPrefixes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeletePublicDelegatedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}", + "(google.api.method_signature)": "project,region,public_delegated_prefix" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}" + } + }, + { + "(google.api.method_signature)": "project,region,public_delegated_prefix" + } + ] + }, + "Get": { + "requestType": "GetPublicDelegatedPrefixeRequest", + "responseType": "PublicDelegatedPrefix", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}", + "(google.api.method_signature)": "project,region,public_delegated_prefix" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}" + } + }, + { + "(google.api.method_signature)": "project,region,public_delegated_prefix" + } + ] + }, + "Insert": { + "requestType": "InsertPublicDelegatedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes", + "(google.api.http).body": "public_delegated_prefix_resource", + "(google.api.method_signature)": "project,region,public_delegated_prefix_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes", + "body": "public_delegated_prefix_resource" + } + }, + { + "(google.api.method_signature)": "project,region,public_delegated_prefix_resource" + } + ] + }, + "List": { + "requestType": "ListPublicDelegatedPrefixesRequest", + "responseType": "PublicDelegatedPrefixList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchPublicDelegatedPrefixeRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}", + "(google.api.http).body": "public_delegated_prefix_resource", + "(google.api.method_signature)": "project,region,public_delegated_prefix,public_delegated_prefix_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/publicDelegatedPrefixes/{public_delegated_prefix}", + "body": "public_delegated_prefix_resource" + } + }, + { + "(google.api.method_signature)": "project,region,public_delegated_prefix,public_delegated_prefix_resource" + } + ] + } + } + }, + "RegionAutoscalers": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}", + "(google.api.method_signature)": "project,region,autoscaler" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}" + } + }, + { + "(google.api.method_signature)": "project,region,autoscaler" + } + ] + }, + "Get": { + "requestType": "GetRegionAutoscalerRequest", + "responseType": "Autoscaler", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}", + "(google.api.method_signature)": "project,region,autoscaler" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}" + } + }, + { + "(google.api.method_signature)": "project,region,autoscaler" + } + ] + }, + "Insert": { + "requestType": "InsertRegionAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/autoscalers", + "(google.api.http).body": "autoscaler_resource", + "(google.api.method_signature)": "project,region,autoscaler_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/autoscalers", + "body": "autoscaler_resource" + } + }, + { + "(google.api.method_signature)": "project,region,autoscaler_resource" + } + ] + }, + "List": { + "requestType": "ListRegionAutoscalersRequest", + "responseType": "RegionAutoscalerList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/autoscalers", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/autoscalers" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchRegionAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/autoscalers", + "(google.api.http).body": "autoscaler_resource", + "(google.api.method_signature)": "project,region,autoscaler_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/autoscalers", + "body": "autoscaler_resource" + } + }, + { + "(google.api.method_signature)": "project,region,autoscaler_resource" + } + ] + }, + "Update": { + "requestType": "UpdateRegionAutoscalerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/regions/{region}/autoscalers", + "(google.api.http).body": "autoscaler_resource", + "(google.api.method_signature)": "project,region,autoscaler_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/regions/{region}/autoscalers", + "body": "autoscaler_resource" + } + }, + { + "(google.api.method_signature)": "project,region,autoscaler_resource" + } + ] + } + } + }, + "RegionBackendServices": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}", + "(google.api.method_signature)": "project,region,backend_service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}" + } + }, + { + "(google.api.method_signature)": "project,region,backend_service" + } + ] + }, + "Get": { + "requestType": "GetRegionBackendServiceRequest", + "responseType": "BackendService", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}", + "(google.api.method_signature)": "project,region,backend_service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}" + } + }, + { + "(google.api.method_signature)": "project,region,backend_service" + } + ] + }, + "GetHealth": { + "requestType": "GetHealthRegionBackendServiceRequest", + "responseType": "BackendServiceGroupHealth", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}/getHealth", + "(google.api.http).body": "resource_group_reference_resource", + "(google.api.method_signature)": "project,region,backend_service,resource_group_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}/getHealth", + "body": "resource_group_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,region,backend_service,resource_group_reference_resource" + } + ] + }, + "Insert": { + "requestType": "InsertRegionBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/backendServices", + "(google.api.http).body": "backend_service_resource", + "(google.api.method_signature)": "project,region,backend_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/backendServices", + "body": "backend_service_resource" + } + }, + { + "(google.api.method_signature)": "project,region,backend_service_resource" + } + ] + }, + "List": { + "requestType": "ListRegionBackendServicesRequest", + "responseType": "BackendServiceList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/backendServices", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/backendServices" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchRegionBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}", + "(google.api.http).body": "backend_service_resource", + "(google.api.method_signature)": "project,region,backend_service,backend_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}", + "body": "backend_service_resource" + } + }, + { + "(google.api.method_signature)": "project,region,backend_service,backend_service_resource" + } + ] + }, + "Update": { + "requestType": "UpdateRegionBackendServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}", + "(google.api.http).body": "backend_service_resource", + "(google.api.method_signature)": "project,region,backend_service,backend_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/regions/{region}/backendServices/{backend_service}", + "body": "backend_service_resource" + } + }, + { + "(google.api.method_signature)": "project,region,backend_service,backend_service_resource" + } + ] + } + } + }, + "RegionCommitments": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListRegionCommitmentsRequest", + "responseType": "CommitmentAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/commitments", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/commitments" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Get": { + "requestType": "GetRegionCommitmentRequest", + "responseType": "Commitment", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}", + "(google.api.method_signature)": "project,region,commitment" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}" + } + }, + { + "(google.api.method_signature)": "project,region,commitment" + } + ] + }, + "Insert": { + "requestType": "InsertRegionCommitmentRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/commitments", + "(google.api.http).body": "commitment_resource", + "(google.api.method_signature)": "project,region,commitment_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/commitments", + "body": "commitment_resource" + } + }, + { + "(google.api.method_signature)": "project,region,commitment_resource" + } + ] + }, + "List": { + "requestType": "ListRegionCommitmentsRequest", + "responseType": "CommitmentList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/commitments", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/commitments" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "RegionDiskTypes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Get": { + "requestType": "GetRegionDiskTypeRequest", + "responseType": "DiskType", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/diskTypes/{disk_type}", + "(google.api.method_signature)": "project,region,disk_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/diskTypes/{disk_type}" + } + }, + { + "(google.api.method_signature)": "project,region,disk_type" + } + ] + }, + "List": { + "requestType": "ListRegionDiskTypesRequest", + "responseType": "RegionDiskTypeList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/diskTypes", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/diskTypes" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "RegionDisks": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddResourcePolicies": { + "requestType": "AddResourcePoliciesRegionDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies", + "(google.api.http).body": "region_disks_add_resource_policies_request_resource", + "(google.api.method_signature)": "project,region,disk,region_disks_add_resource_policies_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies", + "body": "region_disks_add_resource_policies_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,disk,region_disks_add_resource_policies_request_resource" + } + ] + }, + "CreateSnapshot": { + "requestType": "CreateSnapshotRegionDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/createSnapshot", + "(google.api.http).body": "snapshot_resource", + "(google.api.method_signature)": "project,region,disk,snapshot_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/createSnapshot", + "body": "snapshot_resource" + } + }, + { + "(google.api.method_signature)": "project,region,disk,snapshot_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteRegionDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}", + "(google.api.method_signature)": "project,region,disk" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}" + } + }, + { + "(google.api.method_signature)": "project,region,disk" + } + ] + }, + "Get": { + "requestType": "GetRegionDiskRequest", + "responseType": "Disk", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}", + "(google.api.method_signature)": "project,region,disk" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}" + } + }, + { + "(google.api.method_signature)": "project,region,disk" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyRegionDiskRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,region,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,region,resource" + } + ] + }, + "Insert": { + "requestType": "InsertRegionDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks", + "(google.api.http).body": "disk_resource", + "(google.api.method_signature)": "project,region,disk_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks", + "body": "disk_resource" + } + }, + { + "(google.api.method_signature)": "project,region,disk_resource" + } + ] + }, + "List": { + "requestType": "ListRegionDisksRequest", + "responseType": "DiskList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/disks", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/disks" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "RemoveResourcePolicies": { + "requestType": "RemoveResourcePoliciesRegionDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies", + "(google.api.http).body": "region_disks_remove_resource_policies_request_resource", + "(google.api.method_signature)": "project,region,disk,region_disks_remove_resource_policies_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies", + "body": "region_disks_remove_resource_policies_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,disk,region_disks_remove_resource_policies_request_resource" + } + ] + }, + "Resize": { + "requestType": "ResizeRegionDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/resize", + "(google.api.http).body": "region_disks_resize_request_resource", + "(google.api.method_signature)": "project,region,disk,region_disks_resize_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks/{disk}/resize", + "body": "region_disks_resize_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,disk,region_disks_resize_request_resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyRegionDiskRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setIamPolicy", + "(google.api.http).body": "region_set_policy_request_resource", + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setIamPolicy", + "body": "region_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsRegionDiskRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setLabels", + "(google.api.http).body": "region_set_labels_request_resource", + "(google.api.method_signature)": "project,region,resource,region_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/setLabels", + "body": "region_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,region_set_labels_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsRegionDiskRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + } + ] + } + } + }, + "RegionHealthCheckServices": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionHealthCheckServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}", + "(google.api.method_signature)": "project,region,health_check_service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}" + } + }, + { + "(google.api.method_signature)": "project,region,health_check_service" + } + ] + }, + "Get": { + "requestType": "GetRegionHealthCheckServiceRequest", + "responseType": "HealthCheckService", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}", + "(google.api.method_signature)": "project,region,health_check_service" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}" + } + }, + { + "(google.api.method_signature)": "project,region,health_check_service" + } + ] + }, + "Insert": { + "requestType": "InsertRegionHealthCheckServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices", + "(google.api.http).body": "health_check_service_resource", + "(google.api.method_signature)": "project,region,health_check_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices", + "body": "health_check_service_resource" + } + }, + { + "(google.api.method_signature)": "project,region,health_check_service_resource" + } + ] + }, + "List": { + "requestType": "ListRegionHealthCheckServicesRequest", + "responseType": "HealthCheckServicesList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchRegionHealthCheckServiceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}", + "(google.api.http).body": "health_check_service_resource", + "(google.api.method_signature)": "project,region,health_check_service,health_check_service_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/healthCheckServices/{health_check_service}", + "body": "health_check_service_resource" + } + }, + { + "(google.api.method_signature)": "project,region,health_check_service,health_check_service_resource" + } + ] + } + } + }, + "RegionHealthChecks": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}", + "(google.api.method_signature)": "project,region,health_check" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}" + } + }, + { + "(google.api.method_signature)": "project,region,health_check" + } + ] + }, + "Get": { + "requestType": "GetRegionHealthCheckRequest", + "responseType": "HealthCheck", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}", + "(google.api.method_signature)": "project,region,health_check" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}" + } + }, + { + "(google.api.method_signature)": "project,region,health_check" + } + ] + }, + "Insert": { + "requestType": "InsertRegionHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/healthChecks", + "(google.api.http).body": "health_check_resource", + "(google.api.method_signature)": "project,region,health_check_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/healthChecks", + "body": "health_check_resource" + } + }, + { + "(google.api.method_signature)": "project,region,health_check_resource" + } + ] + }, + "List": { + "requestType": "ListRegionHealthChecksRequest", + "responseType": "HealthCheckList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/healthChecks", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/healthChecks" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchRegionHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}", + "(google.api.http).body": "health_check_resource", + "(google.api.method_signature)": "project,region,health_check,health_check_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}", + "body": "health_check_resource" + } + }, + { + "(google.api.method_signature)": "project,region,health_check,health_check_resource" + } + ] + }, + "Update": { + "requestType": "UpdateRegionHealthCheckRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}", + "(google.api.http).body": "health_check_resource", + "(google.api.method_signature)": "project,region,health_check,health_check_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/regions/{region}/healthChecks/{health_check}", + "body": "health_check_resource" + } + }, + { + "(google.api.method_signature)": "project,region,health_check,health_check_resource" + } + ] + } + } + }, + "RegionInstanceGroupManagers": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AbandonInstances": { + "requestType": "AbandonInstancesRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/abandonInstances", + "(google.api.http).body": "region_instance_group_managers_abandon_instances_request_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_abandon_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/abandonInstances", + "body": "region_instance_group_managers_abandon_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_abandon_instances_request_resource" + } + ] + }, + "ApplyUpdatesToInstances": { + "requestType": "ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances", + "(google.api.http).body": "region_instance_group_managers_apply_updates_request_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_apply_updates_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/applyUpdatesToInstances", + "body": "region_instance_group_managers_apply_updates_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_apply_updates_request_resource" + } + ] + }, + "CreateInstances": { + "requestType": "CreateInstancesRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/createInstances", + "(google.api.http).body": "region_instance_group_managers_create_instances_request_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_create_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/createInstances", + "body": "region_instance_group_managers_create_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_create_instances_request_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}", + "(google.api.method_signature)": "project,region,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager" + } + ] + }, + "DeleteInstances": { + "requestType": "DeleteInstancesRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deleteInstances", + "(google.api.http).body": "region_instance_group_managers_delete_instances_request_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_delete_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deleteInstances", + "body": "region_instance_group_managers_delete_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_delete_instances_request_resource" + } + ] + }, + "DeletePerInstanceConfigs": { + "requestType": "DeletePerInstanceConfigsRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs", + "(google.api.http).body": "region_instance_group_manager_delete_instance_config_req_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_manager_delete_instance_config_req_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/deletePerInstanceConfigs", + "body": "region_instance_group_manager_delete_instance_config_req_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_manager_delete_instance_config_req_resource" + } + ] + }, + "Get": { + "requestType": "GetRegionInstanceGroupManagerRequest", + "responseType": "InstanceGroupManager", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}", + "(google.api.method_signature)": "project,region,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager" + } + ] + }, + "Insert": { + "requestType": "InsertRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers", + "(google.api.http).body": "instance_group_manager_resource", + "(google.api.method_signature)": "project,region,instance_group_manager_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers", + "body": "instance_group_manager_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager_resource" + } + ] + }, + "List": { + "requestType": "ListRegionInstanceGroupManagersRequest", + "responseType": "RegionInstanceGroupManagerList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "ListErrors": { + "requestType": "ListErrorsRegionInstanceGroupManagersRequest", + "responseType": "RegionInstanceGroupManagersListErrorsResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listErrors", + "(google.api.method_signature)": "project,region,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listErrors" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager" + } + ] + }, + "ListManagedInstances": { + "requestType": "ListManagedInstancesRegionInstanceGroupManagersRequest", + "responseType": "RegionInstanceGroupManagersListInstancesResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listManagedInstances", + "(google.api.method_signature)": "project,region,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listManagedInstances" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager" + } + ] + }, + "ListPerInstanceConfigs": { + "requestType": "ListPerInstanceConfigsRegionInstanceGroupManagersRequest", + "responseType": "RegionInstanceGroupManagersListInstanceConfigsResp", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs", + "(google.api.method_signature)": "project,region,instance_group_manager" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/listPerInstanceConfigs" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager" + } + ] + }, + "Patch": { + "requestType": "PatchRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}", + "(google.api.http).body": "instance_group_manager_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,instance_group_manager_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}", + "body": "instance_group_manager_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,instance_group_manager_resource" + } + ] + }, + "PatchPerInstanceConfigs": { + "requestType": "PatchPerInstanceConfigsRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs", + "(google.api.http).body": "region_instance_group_manager_patch_instance_config_req_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_manager_patch_instance_config_req_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/patchPerInstanceConfigs", + "body": "region_instance_group_manager_patch_instance_config_req_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_manager_patch_instance_config_req_resource" + } + ] + }, + "RecreateInstances": { + "requestType": "RecreateInstancesRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/recreateInstances", + "(google.api.http).body": "region_instance_group_managers_recreate_request_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_recreate_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/recreateInstances", + "body": "region_instance_group_managers_recreate_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_recreate_request_resource" + } + ] + }, + "Resize": { + "requestType": "ResizeRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/resize", + "(google.api.method_signature)": "project,region,instance_group_manager,size" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/resize" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,size" + } + ] + }, + "SetInstanceTemplate": { + "requestType": "SetInstanceTemplateRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate", + "(google.api.http).body": "region_instance_group_managers_set_template_request_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_set_template_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setInstanceTemplate", + "body": "region_instance_group_managers_set_template_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_set_template_request_resource" + } + ] + }, + "SetTargetPools": { + "requestType": "SetTargetPoolsRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setTargetPools", + "(google.api.http).body": "region_instance_group_managers_set_target_pools_request_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_set_target_pools_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/setTargetPools", + "body": "region_instance_group_managers_set_target_pools_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_managers_set_target_pools_request_resource" + } + ] + }, + "UpdatePerInstanceConfigs": { + "requestType": "UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs", + "(google.api.http).body": "region_instance_group_manager_update_instance_config_req_resource", + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_manager_update_instance_config_req_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instance_group_manager}/updatePerInstanceConfigs", + "body": "region_instance_group_manager_update_instance_config_req_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group_manager,region_instance_group_manager_update_instance_config_req_resource" + } + ] + } + } + }, + "RegionInstanceGroups": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Get": { + "requestType": "GetRegionInstanceGroupRequest", + "responseType": "InstanceGroup", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}", + "(google.api.method_signature)": "project,region,instance_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group" + } + ] + }, + "List": { + "requestType": "ListRegionInstanceGroupsRequest", + "responseType": "RegionInstanceGroupList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/instanceGroups", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/instanceGroups" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRegionInstanceGroupsRequest", + "responseType": "RegionInstanceGroupsListInstances", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/listInstances", + "(google.api.http).body": "region_instance_groups_list_instances_request_resource", + "(google.api.method_signature)": "project,region,instance_group,region_instance_groups_list_instances_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/listInstances", + "body": "region_instance_groups_list_instances_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group,region_instance_groups_list_instances_request_resource" + } + ] + }, + "SetNamedPorts": { + "requestType": "SetNamedPortsRegionInstanceGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/setNamedPorts", + "(google.api.http).body": "region_instance_groups_set_named_ports_request_resource", + "(google.api.method_signature)": "project,region,instance_group,region_instance_groups_set_named_ports_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instance_group}/setNamedPorts", + "body": "region_instance_groups_set_named_ports_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,instance_group,region_instance_groups_set_named_ports_request_resource" + } + ] + } + } + }, + "RegionInstances": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "BulkInsert": { + "requestType": "BulkInsertRegionInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/instances/bulkInsert", + "(google.api.http).body": "bulk_insert_instance_resource_resource", + "(google.api.method_signature)": "project,region,bulk_insert_instance_resource_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/instances/bulkInsert", + "body": "bulk_insert_instance_resource_resource" + } + }, + { + "(google.api.method_signature)": "project,region,bulk_insert_instance_resource_resource" + } + ] + } + } + }, + "RegionNetworkEndpointGroups": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}", + "(google.api.method_signature)": "project,region,network_endpoint_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}" + } + }, + { + "(google.api.method_signature)": "project,region,network_endpoint_group" + } + ] + }, + "Get": { + "requestType": "GetRegionNetworkEndpointGroupRequest", + "responseType": "NetworkEndpointGroup", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}", + "(google.api.method_signature)": "project,region,network_endpoint_group" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups/{network_endpoint_group}" + } + }, + { + "(google.api.method_signature)": "project,region,network_endpoint_group" + } + ] + }, + "Insert": { + "requestType": "InsertRegionNetworkEndpointGroupRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups", + "(google.api.http).body": "network_endpoint_group_resource", + "(google.api.method_signature)": "project,region,network_endpoint_group_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups", + "body": "network_endpoint_group_resource" + } + }, + { + "(google.api.method_signature)": "project,region,network_endpoint_group_resource" + } + ] + }, + "List": { + "requestType": "ListRegionNetworkEndpointGroupsRequest", + "responseType": "NetworkEndpointGroupList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/networkEndpointGroups" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "RegionNotificationEndpoints": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionNotificationEndpointRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}", + "(google.api.method_signature)": "project,region,notification_endpoint" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}" + } + }, + { + "(google.api.method_signature)": "project,region,notification_endpoint" + } + ] + }, + "Get": { + "requestType": "GetRegionNotificationEndpointRequest", + "responseType": "NotificationEndpoint", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}", + "(google.api.method_signature)": "project,region,notification_endpoint" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints/{notification_endpoint}" + } + }, + { + "(google.api.method_signature)": "project,region,notification_endpoint" + } + ] + }, + "Insert": { + "requestType": "InsertRegionNotificationEndpointRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints", + "(google.api.http).body": "notification_endpoint_resource", + "(google.api.method_signature)": "project,region,notification_endpoint_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints", + "body": "notification_endpoint_resource" + } + }, + { + "(google.api.method_signature)": "project,region,notification_endpoint_resource" + } + ] + }, + "List": { + "requestType": "ListRegionNotificationEndpointsRequest", + "responseType": "NotificationEndpointList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/notificationEndpoints" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "RegionOperations": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionOperationRequest", + "responseType": "DeleteRegionOperationResponse", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/operations/{operation}", + "(google.api.method_signature)": "project,region,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "project,region,operation" + } + ] + }, + "Get": { + "requestType": "GetRegionOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/operations/{operation}", + "(google.api.method_signature)": "project,region,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "project,region,operation" + } + ] + }, + "List": { + "requestType": "ListRegionOperationsRequest", + "responseType": "OperationList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/operations", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/operations" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Wait": { + "requestType": "WaitRegionOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/operations/{operation}/wait", + "(google.api.method_signature)": "project,region,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/operations/{operation}/wait" + } + }, + { + "(google.api.method_signature)": "project,region,operation" + } + ] + } + } + }, + "RegionSslCertificates": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionSslCertificateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}", + "(google.api.method_signature)": "project,region,ssl_certificate" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}" + } + }, + { + "(google.api.method_signature)": "project,region,ssl_certificate" + } + ] + }, + "Get": { + "requestType": "GetRegionSslCertificateRequest", + "responseType": "SslCertificate", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}", + "(google.api.method_signature)": "project,region,ssl_certificate" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/sslCertificates/{ssl_certificate}" + } + }, + { + "(google.api.method_signature)": "project,region,ssl_certificate" + } + ] + }, + "Insert": { + "requestType": "InsertRegionSslCertificateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/sslCertificates", + "(google.api.http).body": "ssl_certificate_resource", + "(google.api.method_signature)": "project,region,ssl_certificate_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/sslCertificates", + "body": "ssl_certificate_resource" + } + }, + { + "(google.api.method_signature)": "project,region,ssl_certificate_resource" + } + ] + }, + "List": { + "requestType": "ListRegionSslCertificatesRequest", + "responseType": "SslCertificateList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/sslCertificates", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/sslCertificates" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "RegionTargetHttpProxies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionTargetHttpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}", + "(google.api.method_signature)": "project,region,target_http_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}" + } + }, + { + "(google.api.method_signature)": "project,region,target_http_proxy" + } + ] + }, + "Get": { + "requestType": "GetRegionTargetHttpProxyRequest", + "responseType": "TargetHttpProxy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}", + "(google.api.method_signature)": "project,region,target_http_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}" + } + }, + { + "(google.api.method_signature)": "project,region,target_http_proxy" + } + ] + }, + "Insert": { + "requestType": "InsertRegionTargetHttpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies", + "(google.api.http).body": "target_http_proxy_resource", + "(google.api.method_signature)": "project,region,target_http_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies", + "body": "target_http_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_http_proxy_resource" + } + ] + }, + "List": { + "requestType": "ListRegionTargetHttpProxiesRequest", + "responseType": "TargetHttpProxyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "SetUrlMap": { + "requestType": "SetUrlMapRegionTargetHttpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}/setUrlMap", + "(google.api.http).body": "url_map_reference_resource", + "(google.api.method_signature)": "project,region,target_http_proxy,url_map_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetHttpProxies/{target_http_proxy}/setUrlMap", + "body": "url_map_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_http_proxy,url_map_reference_resource" + } + ] + } + } + }, + "RegionTargetHttpsProxies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}", + "(google.api.method_signature)": "project,region,target_https_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}" + } + }, + { + "(google.api.method_signature)": "project,region,target_https_proxy" + } + ] + }, + "Get": { + "requestType": "GetRegionTargetHttpsProxyRequest", + "responseType": "TargetHttpsProxy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}", + "(google.api.method_signature)": "project,region,target_https_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}" + } + }, + { + "(google.api.method_signature)": "project,region,target_https_proxy" + } + ] + }, + "Insert": { + "requestType": "InsertRegionTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies", + "(google.api.http).body": "target_https_proxy_resource", + "(google.api.method_signature)": "project,region,target_https_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies", + "body": "target_https_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_https_proxy_resource" + } + ] + }, + "List": { + "requestType": "ListRegionTargetHttpsProxiesRequest", + "responseType": "TargetHttpsProxyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "SetSslCertificates": { + "requestType": "SetSslCertificatesRegionTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setSslCertificates", + "(google.api.http).body": "region_target_https_proxies_set_ssl_certificates_request_resource", + "(google.api.method_signature)": "project,region,target_https_proxy,region_target_https_proxies_set_ssl_certificates_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setSslCertificates", + "body": "region_target_https_proxies_set_ssl_certificates_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_https_proxy,region_target_https_proxies_set_ssl_certificates_request_resource" + } + ] + }, + "SetUrlMap": { + "requestType": "SetUrlMapRegionTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setUrlMap", + "(google.api.http).body": "url_map_reference_resource", + "(google.api.method_signature)": "project,region,target_https_proxy,url_map_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetHttpsProxies/{target_https_proxy}/setUrlMap", + "body": "url_map_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_https_proxy,url_map_reference_resource" + } + ] + } + } + }, + "RegionUrlMaps": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRegionUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}", + "(google.api.method_signature)": "project,region,url_map" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}" + } + }, + { + "(google.api.method_signature)": "project,region,url_map" + } + ] + }, + "Get": { + "requestType": "GetRegionUrlMapRequest", + "responseType": "UrlMap", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}", + "(google.api.method_signature)": "project,region,url_map" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}" + } + }, + { + "(google.api.method_signature)": "project,region,url_map" + } + ] + }, + "Insert": { + "requestType": "InsertRegionUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/urlMaps", + "(google.api.http).body": "url_map_resource", + "(google.api.method_signature)": "project,region,url_map_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/urlMaps", + "body": "url_map_resource" + } + }, + { + "(google.api.method_signature)": "project,region,url_map_resource" + } + ] + }, + "List": { + "requestType": "ListRegionUrlMapsRequest", + "responseType": "UrlMapList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/urlMaps", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/urlMaps" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchRegionUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}", + "(google.api.http).body": "url_map_resource", + "(google.api.method_signature)": "project,region,url_map,url_map_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}", + "body": "url_map_resource" + } + }, + { + "(google.api.method_signature)": "project,region,url_map,url_map_resource" + } + ] + }, + "Update": { + "requestType": "UpdateRegionUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}", + "(google.api.http).body": "url_map_resource", + "(google.api.method_signature)": "project,region,url_map,url_map_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}", + "body": "url_map_resource" + } + }, + { + "(google.api.method_signature)": "project,region,url_map,url_map_resource" + } + ] + }, + "Validate": { + "requestType": "ValidateRegionUrlMapRequest", + "responseType": "UrlMapsValidateResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}/validate", + "(google.api.http).body": "region_url_maps_validate_request_resource", + "(google.api.method_signature)": "project,region,url_map,region_url_maps_validate_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/urlMaps/{url_map}/validate", + "body": "region_url_maps_validate_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,url_map,region_url_maps_validate_request_resource" + } + ] + } + } + }, + "Regions": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Get": { + "requestType": "GetRegionRequest", + "responseType": "Region", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "List": { + "requestType": "ListRegionsRequest", + "responseType": "RegionList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + } + } + }, + "Reservations": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListReservationsRequest", + "responseType": "ReservationAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/reservations", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/reservations" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteReservationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}", + "(google.api.method_signature)": "project,zone,reservation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}" + } + }, + { + "(google.api.method_signature)": "project,zone,reservation" + } + ] + }, + "Get": { + "requestType": "GetReservationRequest", + "responseType": "Reservation", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}", + "(google.api.method_signature)": "project,zone,reservation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}" + } + }, + { + "(google.api.method_signature)": "project,zone,reservation" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyReservationRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,zone,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,zone,resource" + } + ] + }, + "Insert": { + "requestType": "InsertReservationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/reservations", + "(google.api.http).body": "reservation_resource", + "(google.api.method_signature)": "project,zone,reservation_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/reservations", + "body": "reservation_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,reservation_resource" + } + ] + }, + "List": { + "requestType": "ListReservationsRequest", + "responseType": "ReservationList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/reservations", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/reservations" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "Resize": { + "requestType": "ResizeReservationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}/resize", + "(google.api.http).body": "reservations_resize_request_resource", + "(google.api.method_signature)": "project,zone,reservation,reservations_resize_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/reservations/{reservation}/resize", + "body": "reservations_resize_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,reservation,reservations_resize_request_resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyReservationRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/setIamPolicy", + "(google.api.http).body": "zone_set_policy_request_resource", + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/setIamPolicy", + "body": "zone_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,zone_set_policy_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsReservationRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/reservations/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,resource,test_permissions_request_resource" + } + ] + } + } + }, + "ResourcePolicies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListResourcePoliciesRequest", + "responseType": "ResourcePolicyAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/resourcePolicies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/resourcePolicies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteResourcePolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}", + "(google.api.method_signature)": "project,region,resource_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}" + } + }, + { + "(google.api.method_signature)": "project,region,resource_policy" + } + ] + }, + "Get": { + "requestType": "GetResourcePolicyRequest", + "responseType": "ResourcePolicy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}", + "(google.api.method_signature)": "project,region,resource_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}" + } + }, + { + "(google.api.method_signature)": "project,region,resource_policy" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicyResourcePolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,region,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,region,resource" + } + ] + }, + "Insert": { + "requestType": "InsertResourcePolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies", + "(google.api.http).body": "resource_policy_resource", + "(google.api.method_signature)": "project,region,resource_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies", + "body": "resource_policy_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource_policy_resource" + } + ] + }, + "List": { + "requestType": "ListResourcePoliciesRequest", + "responseType": "ResourcePolicyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicyResourcePolicyRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy", + "(google.api.http).body": "region_set_policy_request_resource", + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/setIamPolicy", + "body": "region_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsResourcePolicyRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + } + ] + } + } + }, + "Routers": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListRoutersRequest", + "responseType": "RouterAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/routers", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/routers" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteRouterRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/routers/{router}", + "(google.api.method_signature)": "project,region,router" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/routers/{router}" + } + }, + { + "(google.api.method_signature)": "project,region,router" + } + ] + }, + "Get": { + "requestType": "GetRouterRequest", + "responseType": "Router", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/routers/{router}", + "(google.api.method_signature)": "project,region,router" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/routers/{router}" + } + }, + { + "(google.api.method_signature)": "project,region,router" + } + ] + }, + "GetNatMappingInfo": { + "requestType": "GetNatMappingInfoRoutersRequest", + "responseType": "VmEndpointNatMappingsList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo", + "(google.api.method_signature)": "project,region,router" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getNatMappingInfo" + } + }, + { + "(google.api.method_signature)": "project,region,router" + } + ] + }, + "GetRouterStatus": { + "requestType": "GetRouterStatusRouterRequest", + "responseType": "RouterStatusResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getRouterStatus", + "(google.api.method_signature)": "project,region,router" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getRouterStatus" + } + }, + { + "(google.api.method_signature)": "project,region,router" + } + ] + }, + "Insert": { + "requestType": "InsertRouterRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/routers", + "(google.api.http).body": "router_resource", + "(google.api.method_signature)": "project,region,router_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/routers", + "body": "router_resource" + } + }, + { + "(google.api.method_signature)": "project,region,router_resource" + } + ] + }, + "List": { + "requestType": "ListRoutersRequest", + "responseType": "RouterList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/routers", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/routers" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "Patch": { + "requestType": "PatchRouterRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/routers/{router}", + "(google.api.http).body": "router_resource", + "(google.api.method_signature)": "project,region,router,router_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/routers/{router}", + "body": "router_resource" + } + }, + { + "(google.api.method_signature)": "project,region,router,router_resource" + } + ] + }, + "Preview": { + "requestType": "PreviewRouterRequest", + "responseType": "RoutersPreviewResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/routers/{router}/preview", + "(google.api.http).body": "router_resource", + "(google.api.method_signature)": "project,region,router,router_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/routers/{router}/preview", + "body": "router_resource" + } + }, + { + "(google.api.method_signature)": "project,region,router,router_resource" + } + ] + }, + "Update": { + "requestType": "UpdateRouterRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/regions/{region}/routers/{router}", + "(google.api.http).body": "router_resource", + "(google.api.method_signature)": "project,region,router,router_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/regions/{region}/routers/{router}", + "body": "router_resource" + } + }, + { + "(google.api.method_signature)": "project,region,router,router_resource" + } + ] + } + } + }, + "Routes": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteRouteRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/routes/{route}", + "(google.api.method_signature)": "project,route" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/routes/{route}" + } + }, + { + "(google.api.method_signature)": "project,route" + } + ] + }, + "Get": { + "requestType": "GetRouteRequest", + "responseType": "Route", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/routes/{route}", + "(google.api.method_signature)": "project,route" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/routes/{route}" + } + }, + { + "(google.api.method_signature)": "project,route" + } + ] + }, + "Insert": { + "requestType": "InsertRouteRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/routes", + "(google.api.http).body": "route_resource", + "(google.api.method_signature)": "project,route_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/routes", + "body": "route_resource" + } + }, + { + "(google.api.method_signature)": "project,route_resource" + } + ] + }, + "List": { + "requestType": "ListRoutesRequest", + "responseType": "RouteList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/routes", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/routes" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + } + } + }, + "SecurityPolicies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddRule": { + "requestType": "AddRuleSecurityPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/addRule", + "(google.api.http).body": "security_policy_rule_resource", + "(google.api.method_signature)": "project,security_policy,security_policy_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/addRule", + "body": "security_policy_rule_resource" + } + }, + { + "(google.api.method_signature)": "project,security_policy,security_policy_rule_resource" + } + ] + }, + "Delete": { + "requestType": "DeleteSecurityPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}", + "(google.api.method_signature)": "project,security_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}" + } + }, + { + "(google.api.method_signature)": "project,security_policy" + } + ] + }, + "Get": { + "requestType": "GetSecurityPolicyRequest", + "responseType": "SecurityPolicy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}", + "(google.api.method_signature)": "project,security_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}" + } + }, + { + "(google.api.method_signature)": "project,security_policy" + } + ] + }, + "GetRule": { + "requestType": "GetRuleSecurityPolicyRequest", + "responseType": "SecurityPolicyRule", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/getRule", + "(google.api.method_signature)": "project,security_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/getRule" + } + }, + { + "(google.api.method_signature)": "project,security_policy" + } + ] + }, + "Insert": { + "requestType": "InsertSecurityPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/securityPolicies", + "(google.api.http).body": "security_policy_resource", + "(google.api.method_signature)": "project,security_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/securityPolicies", + "body": "security_policy_resource" + } + }, + { + "(google.api.method_signature)": "project,security_policy_resource" + } + ] + }, + "List": { + "requestType": "ListSecurityPoliciesRequest", + "responseType": "SecurityPolicyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/securityPolicies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/securityPolicies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ListPreconfiguredExpressionSets": { + "requestType": "ListPreconfiguredExpressionSetsSecurityPoliciesRequest", + "responseType": "SecurityPoliciesListPreconfiguredExpressionSetsResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/securityPolicies/listPreconfiguredExpressionSets" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchSecurityPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}", + "(google.api.http).body": "security_policy_resource", + "(google.api.method_signature)": "project,security_policy,security_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}", + "body": "security_policy_resource" + } + }, + { + "(google.api.method_signature)": "project,security_policy,security_policy_resource" + } + ] + }, + "PatchRule": { + "requestType": "PatchRuleSecurityPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/patchRule", + "(google.api.http).body": "security_policy_rule_resource", + "(google.api.method_signature)": "project,security_policy,security_policy_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/patchRule", + "body": "security_policy_rule_resource" + } + }, + { + "(google.api.method_signature)": "project,security_policy,security_policy_rule_resource" + } + ] + }, + "RemoveRule": { + "requestType": "RemoveRuleSecurityPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/removeRule", + "(google.api.method_signature)": "project,security_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/securityPolicies/{security_policy}/removeRule" + } + }, + { + "(google.api.method_signature)": "project,security_policy" + } + ] + } + } + }, + "Snapshots": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteSnapshotRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/snapshots/{snapshot}", + "(google.api.method_signature)": "project,snapshot" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/snapshots/{snapshot}" + } + }, + { + "(google.api.method_signature)": "project,snapshot" + } + ] + }, + "Get": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/snapshots/{snapshot}", + "(google.api.method_signature)": "project,snapshot" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/snapshots/{snapshot}" + } + }, + { + "(google.api.method_signature)": "project,snapshot" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicySnapshotRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/snapshots/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/snapshots/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,resource" + } + ] + }, + "List": { + "requestType": "ListSnapshotsRequest", + "responseType": "SnapshotList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/snapshots", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/snapshots" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicySnapshotRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/snapshots/{resource}/setIamPolicy", + "(google.api.http).body": "global_set_policy_request_resource", + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/snapshots/{resource}/setIamPolicy", + "body": "global_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_policy_request_resource" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsSnapshotRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/snapshots/{resource}/setLabels", + "(google.api.http).body": "global_set_labels_request_resource", + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/snapshots/{resource}/setLabels", + "body": "global_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,global_set_labels_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsSnapshotRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/snapshots/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/snapshots/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,resource,test_permissions_request_resource" + } + ] + } + } + }, + "SslCertificates": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListSslCertificatesRequest", + "responseType": "SslCertificateAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/sslCertificates", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/sslCertificates" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteSslCertificateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}", + "(google.api.method_signature)": "project,ssl_certificate" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}" + } + }, + { + "(google.api.method_signature)": "project,ssl_certificate" + } + ] + }, + "Get": { + "requestType": "GetSslCertificateRequest", + "responseType": "SslCertificate", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}", + "(google.api.method_signature)": "project,ssl_certificate" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/sslCertificates/{ssl_certificate}" + } + }, + { + "(google.api.method_signature)": "project,ssl_certificate" + } + ] + }, + "Insert": { + "requestType": "InsertSslCertificateRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/sslCertificates", + "(google.api.http).body": "ssl_certificate_resource", + "(google.api.method_signature)": "project,ssl_certificate_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/sslCertificates", + "body": "ssl_certificate_resource" + } + }, + { + "(google.api.method_signature)": "project,ssl_certificate_resource" + } + ] + }, + "List": { + "requestType": "ListSslCertificatesRequest", + "responseType": "SslCertificateList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/sslCertificates", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/sslCertificates" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + } + } + }, + "SslPolicies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteSslPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}", + "(google.api.method_signature)": "project,ssl_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}" + } + }, + { + "(google.api.method_signature)": "project,ssl_policy" + } + ] + }, + "Get": { + "requestType": "GetSslPolicyRequest", + "responseType": "SslPolicy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}", + "(google.api.method_signature)": "project,ssl_policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}" + } + }, + { + "(google.api.method_signature)": "project,ssl_policy" + } + ] + }, + "Insert": { + "requestType": "InsertSslPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/sslPolicies", + "(google.api.http).body": "ssl_policy_resource", + "(google.api.method_signature)": "project,ssl_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/sslPolicies", + "body": "ssl_policy_resource" + } + }, + { + "(google.api.method_signature)": "project,ssl_policy_resource" + } + ] + }, + "List": { + "requestType": "ListSslPoliciesRequest", + "responseType": "SslPoliciesList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/sslPolicies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/sslPolicies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "ListAvailableFeatures": { + "requestType": "ListAvailableFeaturesSslPoliciesRequest", + "responseType": "SslPoliciesListAvailableFeaturesResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/sslPolicies/listAvailableFeatures", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/sslPolicies/listAvailableFeatures" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchSslPolicyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}", + "(google.api.http).body": "ssl_policy_resource", + "(google.api.method_signature)": "project,ssl_policy,ssl_policy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/sslPolicies/{ssl_policy}", + "body": "ssl_policy_resource" + } + }, + { + "(google.api.method_signature)": "project,ssl_policy,ssl_policy_resource" + } + ] + } + } + }, + "Subnetworks": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListSubnetworksRequest", + "responseType": "SubnetworkAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/subnetworks", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/subnetworks" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteSubnetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}", + "(google.api.method_signature)": "project,region,subnetwork" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}" + } + }, + { + "(google.api.method_signature)": "project,region,subnetwork" + } + ] + }, + "ExpandIpCidrRange": { + "requestType": "ExpandIpCidrRangeSubnetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange", + "(google.api.http).body": "subnetworks_expand_ip_cidr_range_request_resource", + "(google.api.method_signature)": "project,region,subnetwork,subnetworks_expand_ip_cidr_range_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange", + "body": "subnetworks_expand_ip_cidr_range_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,subnetwork,subnetworks_expand_ip_cidr_range_request_resource" + } + ] + }, + "Get": { + "requestType": "GetSubnetworkRequest", + "responseType": "Subnetwork", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}", + "(google.api.method_signature)": "project,region,subnetwork" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}" + } + }, + { + "(google.api.method_signature)": "project,region,subnetwork" + } + ] + }, + "GetIamPolicy": { + "requestType": "GetIamPolicySubnetworkRequest", + "responseType": "Policy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy", + "(google.api.method_signature)": "project,region,resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy" + } + }, + { + "(google.api.method_signature)": "project,region,resource" + } + ] + }, + "Insert": { + "requestType": "InsertSubnetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/subnetworks", + "(google.api.http).body": "subnetwork_resource", + "(google.api.method_signature)": "project,region,subnetwork_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/subnetworks", + "body": "subnetwork_resource" + } + }, + { + "(google.api.method_signature)": "project,region,subnetwork_resource" + } + ] + }, + "List": { + "requestType": "ListSubnetworksRequest", + "responseType": "SubnetworkList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/subnetworks", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/subnetworks" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "ListUsable": { + "requestType": "ListUsableSubnetworksRequest", + "responseType": "UsableSubnetworksAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/subnetworks/listUsable", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/subnetworks/listUsable" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchSubnetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}", + "(google.api.http).body": "subnetwork_resource", + "(google.api.method_signature)": "project,region,subnetwork,subnetwork_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}", + "body": "subnetwork_resource" + } + }, + { + "(google.api.method_signature)": "project,region,subnetwork,subnetwork_resource" + } + ] + }, + "SetIamPolicy": { + "requestType": "SetIamPolicySubnetworkRequest", + "responseType": "Policy", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy", + "(google.api.http).body": "region_set_policy_request_resource", + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy", + "body": "region_set_policy_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,region_set_policy_request_resource" + } + ] + }, + "SetPrivateIpGoogleAccess": { + "requestType": "SetPrivateIpGoogleAccessSubnetworkRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess", + "(google.api.http).body": "subnetworks_set_private_ip_google_access_request_resource", + "(google.api.method_signature)": "project,region,subnetwork,subnetworks_set_private_ip_google_access_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess", + "body": "subnetworks_set_private_ip_google_access_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,subnetwork,subnetworks_set_private_ip_google_access_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsSubnetworkRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + } + ] + } + } + }, + "TargetGrpcProxies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteTargetGrpcProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}", + "(google.api.method_signature)": "project,target_grpc_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_grpc_proxy" + } + ] + }, + "Get": { + "requestType": "GetTargetGrpcProxyRequest", + "responseType": "TargetGrpcProxy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}", + "(google.api.method_signature)": "project,target_grpc_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_grpc_proxy" + } + ] + }, + "Insert": { + "requestType": "InsertTargetGrpcProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetGrpcProxies", + "(google.api.http).body": "target_grpc_proxy_resource", + "(google.api.method_signature)": "project,target_grpc_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetGrpcProxies", + "body": "target_grpc_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_grpc_proxy_resource" + } + ] + }, + "List": { + "requestType": "ListTargetGrpcProxiesRequest", + "responseType": "TargetGrpcProxyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetGrpcProxies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetGrpcProxies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchTargetGrpcProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}", + "(google.api.http).body": "target_grpc_proxy_resource", + "(google.api.method_signature)": "project,target_grpc_proxy,target_grpc_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/targetGrpcProxies/{target_grpc_proxy}", + "body": "target_grpc_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_grpc_proxy,target_grpc_proxy_resource" + } + ] + } + } + }, + "TargetHttpProxies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListTargetHttpProxiesRequest", + "responseType": "TargetHttpProxyAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/targetHttpProxies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/targetHttpProxies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteTargetHttpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}", + "(google.api.method_signature)": "project,target_http_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_http_proxy" + } + ] + }, + "Get": { + "requestType": "GetTargetHttpProxyRequest", + "responseType": "TargetHttpProxy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}", + "(google.api.method_signature)": "project,target_http_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_http_proxy" + } + ] + }, + "Insert": { + "requestType": "InsertTargetHttpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetHttpProxies", + "(google.api.http).body": "target_http_proxy_resource", + "(google.api.method_signature)": "project,target_http_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetHttpProxies", + "body": "target_http_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_http_proxy_resource" + } + ] + }, + "List": { + "requestType": "ListTargetHttpProxiesRequest", + "responseType": "TargetHttpProxyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetHttpProxies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetHttpProxies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchTargetHttpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}", + "(google.api.http).body": "target_http_proxy_resource", + "(google.api.method_signature)": "project,target_http_proxy,target_http_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/targetHttpProxies/{target_http_proxy}", + "body": "target_http_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_http_proxy,target_http_proxy_resource" + } + ] + }, + "SetUrlMap": { + "requestType": "SetUrlMapTargetHttpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/targetHttpProxies/{target_http_proxy}/setUrlMap", + "(google.api.http).body": "url_map_reference_resource", + "(google.api.method_signature)": "project,target_http_proxy,url_map_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/targetHttpProxies/{target_http_proxy}/setUrlMap", + "body": "url_map_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,target_http_proxy,url_map_reference_resource" + } + ] + } + } + }, + "TargetHttpsProxies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListTargetHttpsProxiesRequest", + "responseType": "TargetHttpsProxyAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/targetHttpsProxies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/targetHttpsProxies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}", + "(google.api.method_signature)": "project,target_https_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy" + } + ] + }, + "Get": { + "requestType": "GetTargetHttpsProxyRequest", + "responseType": "TargetHttpsProxy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}", + "(google.api.method_signature)": "project,target_https_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy" + } + ] + }, + "Insert": { + "requestType": "InsertTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetHttpsProxies", + "(google.api.http).body": "target_https_proxy_resource", + "(google.api.method_signature)": "project,target_https_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetHttpsProxies", + "body": "target_https_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy_resource" + } + ] + }, + "List": { + "requestType": "ListTargetHttpsProxiesRequest", + "responseType": "TargetHttpsProxyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetHttpsProxies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetHttpsProxies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}", + "(google.api.http).body": "target_https_proxy_resource", + "(google.api.method_signature)": "project,target_https_proxy,target_https_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}", + "body": "target_https_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy,target_https_proxy_resource" + } + ] + }, + "SetQuicOverride": { + "requestType": "SetQuicOverrideTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride", + "(google.api.http).body": "target_https_proxies_set_quic_override_request_resource", + "(google.api.method_signature)": "project,target_https_proxy,target_https_proxies_set_quic_override_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setQuicOverride", + "body": "target_https_proxies_set_quic_override_request_resource" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy,target_https_proxies_set_quic_override_request_resource" + } + ] + }, + "SetSslCertificates": { + "requestType": "SetSslCertificatesTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates", + "(google.api.http).body": "target_https_proxies_set_ssl_certificates_request_resource", + "(google.api.method_signature)": "project,target_https_proxy,target_https_proxies_set_ssl_certificates_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setSslCertificates", + "body": "target_https_proxies_set_ssl_certificates_request_resource" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy,target_https_proxies_set_ssl_certificates_request_resource" + } + ] + }, + "SetSslPolicy": { + "requestType": "SetSslPolicyTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setSslPolicy", + "(google.api.http).body": "ssl_policy_reference_resource", + "(google.api.method_signature)": "project,target_https_proxy,ssl_policy_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetHttpsProxies/{target_https_proxy}/setSslPolicy", + "body": "ssl_policy_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy,ssl_policy_reference_resource" + } + ] + }, + "SetUrlMap": { + "requestType": "SetUrlMapTargetHttpsProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setUrlMap", + "(google.api.http).body": "url_map_reference_resource", + "(google.api.method_signature)": "project,target_https_proxy,url_map_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/targetHttpsProxies/{target_https_proxy}/setUrlMap", + "body": "url_map_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,target_https_proxy,url_map_reference_resource" + } + ] + } + } + }, + "TargetInstances": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListTargetInstancesRequest", + "responseType": "TargetInstanceAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/targetInstances", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/targetInstances" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteTargetInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}", + "(google.api.method_signature)": "project,zone,target_instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}" + } + }, + { + "(google.api.method_signature)": "project,zone,target_instance" + } + ] + }, + "Get": { + "requestType": "GetTargetInstanceRequest", + "responseType": "TargetInstance", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}", + "(google.api.method_signature)": "project,zone,target_instance" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{target_instance}" + } + }, + { + "(google.api.method_signature)": "project,zone,target_instance" + } + ] + }, + "Insert": { + "requestType": "InsertTargetInstanceRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/targetInstances", + "(google.api.http).body": "target_instance_resource", + "(google.api.method_signature)": "project,zone,target_instance_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/targetInstances", + "body": "target_instance_resource" + } + }, + { + "(google.api.method_signature)": "project,zone,target_instance_resource" + } + ] + }, + "List": { + "requestType": "ListTargetInstancesRequest", + "responseType": "TargetInstanceList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/targetInstances", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/targetInstances" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + } + } + }, + "TargetPools": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AddHealthCheck": { + "requestType": "AddHealthCheckTargetPoolRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addHealthCheck", + "(google.api.http).body": "target_pools_add_health_check_request_resource", + "(google.api.method_signature)": "project,region,target_pool,target_pools_add_health_check_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addHealthCheck", + "body": "target_pools_add_health_check_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool,target_pools_add_health_check_request_resource" + } + ] + }, + "AddInstance": { + "requestType": "AddInstanceTargetPoolRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addInstance", + "(google.api.http).body": "target_pools_add_instance_request_resource", + "(google.api.method_signature)": "project,region,target_pool,target_pools_add_instance_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/addInstance", + "body": "target_pools_add_instance_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool,target_pools_add_instance_request_resource" + } + ] + }, + "AggregatedList": { + "requestType": "AggregatedListTargetPoolsRequest", + "responseType": "TargetPoolAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/targetPools", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/targetPools" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteTargetPoolRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}", + "(google.api.method_signature)": "project,region,target_pool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool" + } + ] + }, + "Get": { + "requestType": "GetTargetPoolRequest", + "responseType": "TargetPool", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}", + "(google.api.method_signature)": "project,region,target_pool" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool" + } + ] + }, + "GetHealth": { + "requestType": "GetHealthTargetPoolRequest", + "responseType": "TargetPoolInstanceHealth", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/getHealth", + "(google.api.http).body": "instance_reference_resource", + "(google.api.method_signature)": "project,region,target_pool,instance_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/getHealth", + "body": "instance_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool,instance_reference_resource" + } + ] + }, + "Insert": { + "requestType": "InsertTargetPoolRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetPools", + "(google.api.http).body": "target_pool_resource", + "(google.api.method_signature)": "project,region,target_pool_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetPools", + "body": "target_pool_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool_resource" + } + ] + }, + "List": { + "requestType": "ListTargetPoolsRequest", + "responseType": "TargetPoolList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetPools", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetPools" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "RemoveHealthCheck": { + "requestType": "RemoveHealthCheckTargetPoolRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeHealthCheck", + "(google.api.http).body": "target_pools_remove_health_check_request_resource", + "(google.api.method_signature)": "project,region,target_pool,target_pools_remove_health_check_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeHealthCheck", + "body": "target_pools_remove_health_check_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool,target_pools_remove_health_check_request_resource" + } + ] + }, + "RemoveInstance": { + "requestType": "RemoveInstanceTargetPoolRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeInstance", + "(google.api.http).body": "target_pools_remove_instance_request_resource", + "(google.api.method_signature)": "project,region,target_pool,target_pools_remove_instance_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/removeInstance", + "body": "target_pools_remove_instance_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool,target_pools_remove_instance_request_resource" + } + ] + }, + "SetBackup": { + "requestType": "SetBackupTargetPoolRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/setBackup", + "(google.api.http).body": "target_reference_resource", + "(google.api.method_signature)": "project,region,target_pool,target_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetPools/{target_pool}/setBackup", + "body": "target_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_pool,target_reference_resource" + } + ] + } + } + }, + "TargetSslProxies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteTargetSslProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}", + "(google.api.method_signature)": "project,target_ssl_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_ssl_proxy" + } + ] + }, + "Get": { + "requestType": "GetTargetSslProxyRequest", + "responseType": "TargetSslProxy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}", + "(google.api.method_signature)": "project,target_ssl_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_ssl_proxy" + } + ] + }, + "Insert": { + "requestType": "InsertTargetSslProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetSslProxies", + "(google.api.http).body": "target_ssl_proxy_resource", + "(google.api.method_signature)": "project,target_ssl_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetSslProxies", + "body": "target_ssl_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_ssl_proxy_resource" + } + ] + }, + "List": { + "requestType": "ListTargetSslProxiesRequest", + "responseType": "TargetSslProxyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetSslProxies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetSslProxies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "SetBackendService": { + "requestType": "SetBackendServiceTargetSslProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setBackendService", + "(google.api.http).body": "target_ssl_proxies_set_backend_service_request_resource", + "(google.api.method_signature)": "project,target_ssl_proxy,target_ssl_proxies_set_backend_service_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setBackendService", + "body": "target_ssl_proxies_set_backend_service_request_resource" + } + }, + { + "(google.api.method_signature)": "project,target_ssl_proxy,target_ssl_proxies_set_backend_service_request_resource" + } + ] + }, + "SetProxyHeader": { + "requestType": "SetProxyHeaderTargetSslProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader", + "(google.api.http).body": "target_ssl_proxies_set_proxy_header_request_resource", + "(google.api.method_signature)": "project,target_ssl_proxy,target_ssl_proxies_set_proxy_header_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setProxyHeader", + "body": "target_ssl_proxies_set_proxy_header_request_resource" + } + }, + { + "(google.api.method_signature)": "project,target_ssl_proxy,target_ssl_proxies_set_proxy_header_request_resource" + } + ] + }, + "SetSslCertificates": { + "requestType": "SetSslCertificatesTargetSslProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates", + "(google.api.http).body": "target_ssl_proxies_set_ssl_certificates_request_resource", + "(google.api.method_signature)": "project,target_ssl_proxy,target_ssl_proxies_set_ssl_certificates_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslCertificates", + "body": "target_ssl_proxies_set_ssl_certificates_request_resource" + } + }, + { + "(google.api.method_signature)": "project,target_ssl_proxy,target_ssl_proxies_set_ssl_certificates_request_resource" + } + ] + }, + "SetSslPolicy": { + "requestType": "SetSslPolicyTargetSslProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslPolicy", + "(google.api.http).body": "ssl_policy_reference_resource", + "(google.api.method_signature)": "project,target_ssl_proxy,ssl_policy_reference_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetSslProxies/{target_ssl_proxy}/setSslPolicy", + "body": "ssl_policy_reference_resource" + } + }, + { + "(google.api.method_signature)": "project,target_ssl_proxy,ssl_policy_reference_resource" + } + ] + } + } + }, + "TargetTcpProxies": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteTargetTcpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}", + "(google.api.method_signature)": "project,target_tcp_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_tcp_proxy" + } + ] + }, + "Get": { + "requestType": "GetTargetTcpProxyRequest", + "responseType": "TargetTcpProxy", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}", + "(google.api.method_signature)": "project,target_tcp_proxy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}" + } + }, + { + "(google.api.method_signature)": "project,target_tcp_proxy" + } + ] + }, + "Insert": { + "requestType": "InsertTargetTcpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetTcpProxies", + "(google.api.http).body": "target_tcp_proxy_resource", + "(google.api.method_signature)": "project,target_tcp_proxy_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetTcpProxies", + "body": "target_tcp_proxy_resource" + } + }, + { + "(google.api.method_signature)": "project,target_tcp_proxy_resource" + } + ] + }, + "List": { + "requestType": "ListTargetTcpProxiesRequest", + "responseType": "TargetTcpProxyList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/targetTcpProxies", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/targetTcpProxies" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "SetBackendService": { + "requestType": "SetBackendServiceTargetTcpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setBackendService", + "(google.api.http).body": "target_tcp_proxies_set_backend_service_request_resource", + "(google.api.method_signature)": "project,target_tcp_proxy,target_tcp_proxies_set_backend_service_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setBackendService", + "body": "target_tcp_proxies_set_backend_service_request_resource" + } + }, + { + "(google.api.method_signature)": "project,target_tcp_proxy,target_tcp_proxies_set_backend_service_request_resource" + } + ] + }, + "SetProxyHeader": { + "requestType": "SetProxyHeaderTargetTcpProxyRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setProxyHeader", + "(google.api.http).body": "target_tcp_proxies_set_proxy_header_request_resource", + "(google.api.method_signature)": "project,target_tcp_proxy,target_tcp_proxies_set_proxy_header_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/targetTcpProxies/{target_tcp_proxy}/setProxyHeader", + "body": "target_tcp_proxies_set_proxy_header_request_resource" + } + }, + { + "(google.api.method_signature)": "project,target_tcp_proxy,target_tcp_proxies_set_proxy_header_request_resource" + } + ] + } + } + }, + "TargetVpnGateways": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListTargetVpnGatewaysRequest", + "responseType": "TargetVpnGatewayAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/targetVpnGateways", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/targetVpnGateways" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteTargetVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}", + "(google.api.method_signature)": "project,region,target_vpn_gateway" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}" + } + }, + { + "(google.api.method_signature)": "project,region,target_vpn_gateway" + } + ] + }, + "Get": { + "requestType": "GetTargetVpnGatewayRequest", + "responseType": "TargetVpnGateway", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}", + "(google.api.method_signature)": "project,region,target_vpn_gateway" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{target_vpn_gateway}" + } + }, + { + "(google.api.method_signature)": "project,region,target_vpn_gateway" + } + ] + }, + "Insert": { + "requestType": "InsertTargetVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways", + "(google.api.http).body": "target_vpn_gateway_resource", + "(google.api.method_signature)": "project,region,target_vpn_gateway_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways", + "body": "target_vpn_gateway_resource" + } + }, + { + "(google.api.method_signature)": "project,region,target_vpn_gateway_resource" + } + ] + }, + "List": { + "requestType": "ListTargetVpnGatewaysRequest", + "responseType": "TargetVpnGatewayList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/targetVpnGateways" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "UrlMaps": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListUrlMapsRequest", + "responseType": "UrlMapsAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/urlMaps", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/urlMaps" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/global/urlMaps/{url_map}", + "(google.api.method_signature)": "project,url_map" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/global/urlMaps/{url_map}" + } + }, + { + "(google.api.method_signature)": "project,url_map" + } + ] + }, + "Get": { + "requestType": "GetUrlMapRequest", + "responseType": "UrlMap", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/urlMaps/{url_map}", + "(google.api.method_signature)": "project,url_map" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/urlMaps/{url_map}" + } + }, + { + "(google.api.method_signature)": "project,url_map" + } + ] + }, + "Insert": { + "requestType": "InsertUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/urlMaps", + "(google.api.http).body": "url_map_resource", + "(google.api.method_signature)": "project,url_map_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/urlMaps", + "body": "url_map_resource" + } + }, + { + "(google.api.method_signature)": "project,url_map_resource" + } + ] + }, + "InvalidateCache": { + "requestType": "InvalidateCacheUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/urlMaps/{url_map}/invalidateCache", + "(google.api.http).body": "cache_invalidation_rule_resource", + "(google.api.method_signature)": "project,url_map,cache_invalidation_rule_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/urlMaps/{url_map}/invalidateCache", + "body": "cache_invalidation_rule_resource" + } + }, + { + "(google.api.method_signature)": "project,url_map,cache_invalidation_rule_resource" + } + ] + }, + "List": { + "requestType": "ListUrlMapsRequest", + "responseType": "UrlMapList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/global/urlMaps", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/global/urlMaps" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Patch": { + "requestType": "PatchUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).patch": "/compute/v1/projects/{project}/global/urlMaps/{url_map}", + "(google.api.http).body": "url_map_resource", + "(google.api.method_signature)": "project,url_map,url_map_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/compute/v1/projects/{project}/global/urlMaps/{url_map}", + "body": "url_map_resource" + } + }, + { + "(google.api.method_signature)": "project,url_map,url_map_resource" + } + ] + }, + "Update": { + "requestType": "UpdateUrlMapRequest", + "responseType": "Operation", + "options": { + "(google.api.http).put": "/compute/v1/projects/{project}/global/urlMaps/{url_map}", + "(google.api.http).body": "url_map_resource", + "(google.api.method_signature)": "project,url_map,url_map_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/compute/v1/projects/{project}/global/urlMaps/{url_map}", + "body": "url_map_resource" + } + }, + { + "(google.api.method_signature)": "project,url_map,url_map_resource" + } + ] + }, + "Validate": { + "requestType": "ValidateUrlMapRequest", + "responseType": "UrlMapsValidateResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/global/urlMaps/{url_map}/validate", + "(google.api.http).body": "url_maps_validate_request_resource", + "(google.api.method_signature)": "project,url_map,url_maps_validate_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/global/urlMaps/{url_map}/validate", + "body": "url_maps_validate_request_resource" + } + }, + { + "(google.api.method_signature)": "project,url_map,url_maps_validate_request_resource" + } + ] + } + } + }, + "VpnGateways": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListVpnGatewaysRequest", + "responseType": "VpnGatewayAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/vpnGateways", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/vpnGateways" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}", + "(google.api.method_signature)": "project,region,vpn_gateway" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}" + } + }, + { + "(google.api.method_signature)": "project,region,vpn_gateway" + } + ] + }, + "Get": { + "requestType": "GetVpnGatewayRequest", + "responseType": "VpnGateway", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}", + "(google.api.method_signature)": "project,region,vpn_gateway" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}" + } + }, + { + "(google.api.method_signature)": "project,region,vpn_gateway" + } + ] + }, + "GetStatus": { + "requestType": "GetStatusVpnGatewayRequest", + "responseType": "VpnGatewaysGetStatusResponse", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}/getStatus", + "(google.api.method_signature)": "project,region,vpn_gateway" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{vpn_gateway}/getStatus" + } + }, + { + "(google.api.method_signature)": "project,region,vpn_gateway" + } + ] + }, + "Insert": { + "requestType": "InsertVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/vpnGateways", + "(google.api.http).body": "vpn_gateway_resource", + "(google.api.method_signature)": "project,region,vpn_gateway_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/vpnGateways", + "body": "vpn_gateway_resource" + } + }, + { + "(google.api.method_signature)": "project,region,vpn_gateway_resource" + } + ] + }, + "List": { + "requestType": "ListVpnGatewaysRequest", + "responseType": "VpnGatewayList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/vpnGateways", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/vpnGateways" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + }, + "SetLabels": { + "requestType": "SetLabelsVpnGatewayRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/setLabels", + "(google.api.http).body": "region_set_labels_request_resource", + "(google.api.method_signature)": "project,region,resource,region_set_labels_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/setLabels", + "body": "region_set_labels_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,region_set_labels_request_resource" + } + ] + }, + "TestIamPermissions": { + "requestType": "TestIamPermissionsVpnGatewayRequest", + "responseType": "TestPermissionsResponse", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions", + "(google.api.http).body": "test_permissions_request_resource", + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/vpnGateways/{resource}/testIamPermissions", + "body": "test_permissions_request_resource" + } + }, + { + "(google.api.method_signature)": "project,region,resource,test_permissions_request_resource" + } + ] + } + } + }, + "VpnTunnels": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AggregatedList": { + "requestType": "AggregatedListVpnTunnelsRequest", + "responseType": "VpnTunnelAggregatedList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/aggregated/vpnTunnels", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/aggregated/vpnTunnels" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + }, + "Delete": { + "requestType": "DeleteVpnTunnelRequest", + "responseType": "Operation", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}", + "(google.api.method_signature)": "project,region,vpn_tunnel" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}" + } + }, + { + "(google.api.method_signature)": "project,region,vpn_tunnel" + } + ] + }, + "Get": { + "requestType": "GetVpnTunnelRequest", + "responseType": "VpnTunnel", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}", + "(google.api.method_signature)": "project,region,vpn_tunnel" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpn_tunnel}" + } + }, + { + "(google.api.method_signature)": "project,region,vpn_tunnel" + } + ] + }, + "Insert": { + "requestType": "InsertVpnTunnelRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels", + "(google.api.http).body": "vpn_tunnel_resource", + "(google.api.method_signature)": "project,region,vpn_tunnel_resource" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels", + "body": "vpn_tunnel_resource" + } + }, + { + "(google.api.method_signature)": "project,region,vpn_tunnel_resource" + } + ] + }, + "List": { + "requestType": "ListVpnTunnelsRequest", + "responseType": "VpnTunnelList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels", + "(google.api.method_signature)": "project,region" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/regions/{region}/vpnTunnels" + } + }, + { + "(google.api.method_signature)": "project,region" + } + ] + } + } + }, + "ZoneOperations": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Delete": { + "requestType": "DeleteZoneOperationRequest", + "responseType": "DeleteZoneOperationResponse", + "options": { + "(google.api.http).delete": "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}", + "(google.api.method_signature)": "project,zone,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "project,zone,operation" + } + ] + }, + "Get": { + "requestType": "GetZoneOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}", + "(google.api.method_signature)": "project,zone,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}" + } + }, + { + "(google.api.method_signature)": "project,zone,operation" + } + ] + }, + "List": { + "requestType": "ListZoneOperationsRequest", + "responseType": "OperationList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}/operations", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}/operations" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "Wait": { + "requestType": "WaitZoneOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).post": "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait", + "(google.api.method_signature)": "project,zone,operation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/compute/v1/projects/{project}/zones/{zone}/operations/{operation}/wait" + } + }, + { + "(google.api.method_signature)": "project,zone,operation" + } + ] + } + } + }, + "Zones": { + "options": { + "(google.api.default_host)": "compute.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "Get": { + "requestType": "GetZoneRequest", + "responseType": "Zone", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones/{zone}", + "(google.api.method_signature)": "project,zone" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones/{zone}" + } + }, + { + "(google.api.method_signature)": "project,zone" + } + ] + }, + "List": { + "requestType": "ListZonesRequest", + "responseType": "ZoneList", + "options": { + "(google.api.http).get": "/compute/v1/projects/{project}/zones", + "(google.api.method_signature)": "project" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/compute/v1/projects/{project}/zones" + } + }, + { + "(google.api.method_signature)": "project" + } + ] + } + } + } + } + } + } + } + } + }, + "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 + } + }, + "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 + } + } + }, + "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": [ + [ + 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 + } + }, + "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 + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/samples/.eslintrc.yml b/samples/.eslintrc.yml deleted file mode 100644 index 0aa37ac6..00000000 --- a/samples/.eslintrc.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -rules: - no-console: off - node/no-missing-require: off diff --git a/samples/README.md b/samples/README.md index 1ab06915..f72aac45 100644 --- a/samples/README.md +++ b/samples/README.md @@ -12,14 +12,18 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) - * [Create VM](#create-vm) - * [Delete VM](#delete-vm) - * [List VMs](#list-vms) + * [Create Instance](#create-instance) + * [Delete Instance](#delete-instance) + * [Disable Usage Export](#disable-usage-export) + * [Get Usage Export Bucket](#get-usage-export-bucket) + * [List All Instances](#list-all-instances) + * [List Images](#list-images) + * [List Images By Page](#list-images-by-page) + * [List Instances](#list-instances) * [Mailjet](#mailjet) - * [Quickstart](#quickstart) * [Sendgrid](#sendgrid) - * [Startup Script](#startup-script) - * [Vms](#vms) + * [Set Usage Export Bucket](#set-usage-export-bucket) + * [Wait For Operation](#wait-for-operation) ## Before you begin @@ -36,16 +40,16 @@ Before running the samples, make sure you've followed the steps outlined in -### Create VM +### Create Instance -View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/createVM.js). +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/createInstance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/createVM.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/createInstance.js,samples/README.md) __Usage:__ -`node createVM ` +`node samples/createInstance.js` ----- @@ -53,16 +57,16 @@ __Usage:__ -### Delete VM +### Delete Instance -View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/deleteVM.js). +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/deleteInstance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/deleteVM.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/deleteInstance.js,samples/README.md) __Usage:__ -`node deleteVM ` +`node samples/deleteInstance.js` ----- @@ -70,16 +74,16 @@ __Usage:__ -### List VMs +### Disable Usage Export -View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listVMs.js). +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/disableUsageExport.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listVMs.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/disableUsageExport.js,samples/README.md) __Usage:__ -`node listVMs` +`node samples/disableUsageExport.js` ----- @@ -87,16 +91,50 @@ __Usage:__ -### Mailjet +### Get Usage Export Bucket -View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/mailjet.js). +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/getUsageExportBucket.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/mailjet.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/getUsageExportBucket.js,samples/README.md) __Usage:__ -`node mailjet` +`node samples/getUsageExportBucket.js` + + +----- + + + + +### List All Instances + +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listAllInstances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listAllInstances.js,samples/README.md) + +__Usage:__ + + +`node samples/listAllInstances.js` + + +----- + + + + +### List Images + +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listImages.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listImages.js,samples/README.md) + +__Usage:__ + + +`node samples/listImages.js` ----- @@ -104,16 +142,50 @@ __Usage:__ -### Quickstart +### List Images By Page -View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listImagesByPage.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listImagesByPage.js,samples/README.md) __Usage:__ -`node samples/quickstart.js` +`node samples/listImagesByPage.js` + + +----- + + + + +### List Instances + +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/listInstances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/listInstances.js,samples/README.md) + +__Usage:__ + + +`node samples/listInstances.js` + + +----- + + + + +### Mailjet + +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/mailjet.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/mailjet.js,samples/README.md) + +__Usage:__ + + +`node mailjet` ----- @@ -138,16 +210,16 @@ __Usage:__ -### Startup Script +### Set Usage Export Bucket -View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/startupScript.js). +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/setUsageExportBucket.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/startupScript.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/setUsageExportBucket.js,samples/README.md) __Usage:__ -`node samples/startupScript.js` +`node samples/setUsageExportBucket.js` ----- @@ -155,16 +227,16 @@ __Usage:__ -### Vms +### Wait For Operation -View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/vms.js). +View the [source code](https://github.com/googleapis/nodejs-compute/blob/master/samples/waitForOperation.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/vms.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-compute&page=editor&open_in_editor=samples/waitForOperation.js,samples/README.md) __Usage:__ -`node samples/vms.js` +`node samples/waitForOperation.js` diff --git a/samples/createInstance.js b/samples/createInstance.js new file mode 100644 index 00000000..44caeb74 --- /dev/null +++ b/samples/createInstance.js @@ -0,0 +1,112 @@ +// 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. + +/** + * Sends an instance creation request to GCP and waits for it to complete. + * + * @param {string} projectId - ID or number of the project you want to use. + * @param {string} zone - Name of the zone you want to check, for example: us-west3-b + * @param {string} instanceName - Name of the new machine. + * @param {string} machineType - Machine type you want to create in following format: + * "zones/{zone}/machineTypes/{type_name}". For example: + * "zones/europe-west3-c/machineTypes/f1-micro" + * You can find the list of available machine types using: + * https://cloud.google.com/sdk/gcloud/reference/compute/machine-types/list + * @param {string} sourceImage - Path the the disk image you want to use for your boot + * disk. This can be one of the public images + * (e.g. "projects/debian-cloud/global/images/family/debian-10") + * or a private image you have access to. + * You can check the list of available public images using: + * $ gcloud compute images list + * @param {string} networkName - Name of the network you want the new instance to use. + * For example: global/networks/default - if you want to use the default network. + */ +function main( + projectId, + zone, + instanceName, + machineType = 'n1-standard-1', + sourceImage = 'projects/debian-cloud/global/images/family/debian-10', + networkName = 'global/networks/default' +) { + // [START compute_instances_create] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // const zone = 'europe-central2-b' + // const instanceName = 'YOUR_INSTANCE_NAME' + // const machineType = 'n1-standard-1'; + // const sourceImage = 'projects/debian-cloud/global/images/family/debian-10'; + // const networkName = 'global/networks/default'; + + const compute = require('@google-cloud/compute'); + const compute_protos = compute.protos.google.cloud.compute.v1; + + // Create a new instance with the values provided above in the specified project and zone. + async function createInstance() { + const instancesClient = new compute.InstancesClient({fallback: 'rest'}); + + // Describe the size and source image of the boot disk to attach to the instance. + const attachedDisk = new compute_protos.AttachedDisk(); + const initializeParams = new compute_protos.AttachedDiskInitializeParams(); + + initializeParams.diskSizeGb = '10'; + initializeParams.sourceImage = sourceImage; + + attachedDisk.initializeParams = initializeParams; + attachedDisk.autoDelete = true; + attachedDisk.boot = true; + attachedDisk.type = compute_protos.AttachedDisk.Type.PERSISTENT; + + // Use the network interface provided in the networkName argument. + const networkInterface = new compute_protos.NetworkInterface(); + networkInterface.name = networkName; + + // Collect information into the Instance object. + const instance = new compute_protos.Instance(); + instance.name = instanceName; + instance.disks = [attachedDisk]; + instance.machineType = `zones/${zone}/machineTypes/${machineType}`; + instance.networkInterfaces = [networkInterface]; + + console.log(`Creating the ${instanceName} instance in ${zone}...`); + + // Wait for the create operation to complete. + const [operation] = await instancesClient.insert({ + instanceResource: instance, + project: projectId, + zone, + }); + + if (operation.status === 'RUNNING') { + const operationsClient = new compute.ZoneOperationsClient({ + fallback: 'rest', + }); + + await operationsClient.wait({ + operation: operation.name, + project: projectId, + zone: operation.zone.split('/').pop(), + }); + } + + console.log('Instance created.'); + } + + createInstance(); + // [END compute_instances_create] +} + +main(...process.argv.slice(2)); diff --git a/samples/createVM.js b/samples/createVM.js deleted file mode 100644 index dd08047e..00000000 --- a/samples/createVM.js +++ /dev/null @@ -1,40 +0,0 @@ -// 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. - -// sample-metadata: -// title: Create VM -// usage: node createVM - -'use strict'; - -async function main( - vmName = 'new_virtual_machine' // VM name of your choice -) { - // [START gce_create_vm] - const Compute = require('@google-cloud/compute'); - const compute = new Compute(); - const zone = compute.zone('us-central1-c'); - - async function createVM() { - // TODO(developer): provide a name for your VM - // const vmName = 'new-virutal-machine'; - const [vm, operation] = await zone.createVM(vmName, {os: 'ubuntu'}); - console.log(vm); - await operation.promise(); - console.log('Virtual machine created!'); - } - createVM(); - // [END gce_create_vm] -} - -main(...process.argv.slice(2)); diff --git a/samples/deleteInstance.js b/samples/deleteInstance.js new file mode 100644 index 00000000..b309926d --- /dev/null +++ b/samples/deleteInstance.js @@ -0,0 +1,65 @@ +// 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. + +/** + * Sends a delete request to GCP and waits for it to complete. + * + * @param {string} projectId - ID or number of the project you want to use. + * @param {string} zone - Name of the zone you want to check, for example: us-west3-b + * @param {string} instanceName - Name of the instance you want to delete. + */ +function main(projectId, zone, instanceName) { + // [START compute_instances_delete] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // const zone = 'europe-central2-b' + // const instanceName = 'YOUR_INSTANCE_NAME'; + + const compute = require('@google-cloud/compute'); + + // Delete the instance specified by `instanceName` if it's present in the given project and zone. + async function deleteInstance() { + const instancesClient = new compute.InstancesClient({fallback: 'rest'}); + + console.log(`Deleting ${instanceName} from ${zone}...`); + + // Wait for the delete operation to complete. + const [operation] = await instancesClient.delete({ + project: projectId, + zone, + instance: instanceName, + }); + + if (operation.status === 'RUNNING') { + const operationsClient = new compute.ZoneOperationsClient({ + fallback: 'rest', + }); + + await operationsClient.wait({ + operation: operation.name, + project: projectId, + zone: operation.zone.split('/').pop(), + }); + } + + console.log('Instance deleted.'); + } + + deleteInstance(); + // [END compute_instances_delete] +} + +main(...process.argv.slice(2)); diff --git a/samples/deleteVM.js b/samples/deleteVM.js deleted file mode 100644 index f53b96d0..00000000 --- a/samples/deleteVM.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2020, 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. - -// sample-metadata: -// title: Delete VM -// usage: node deleteVM - -'use strict'; - -async function main( - name = 'virtual_machine_name' // VM name of your choice -) { - // [START gce_delete_vm] - const Compute = require('@google-cloud/compute'); - - async function deleteVM() { - const compute = new Compute(); - const zone = compute.zone('us-central1-c'); - // TODO(developer): choose a name for the VM to delete - // const name = 'vm-name'; - const vm = zone.vm(name); - const [operation] = await vm.delete(); - await operation.promise(); - console.log('VM deleted!'); - } - deleteVM(); - // [END gce_delete_vm] -} - -main(...process.argv.slice(2)); diff --git a/samples/disableUsageExport.js b/samples/disableUsageExport.js new file mode 100644 index 00000000..f1506af9 --- /dev/null +++ b/samples/disableUsageExport.js @@ -0,0 +1,43 @@ +// 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. + +/** + * Disable Compute Engine usage export bucket for the Cloud Project. + * + * @param {string} projectId - ID or number of the project you want to use. + */ +function main(projectId) { + // [START compute_usage_report_disable] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + + const compute = require('@google-cloud/compute'); + + async function disableUsageExport() { + const projectsClient = new compute.ProjectsClient({fallback: 'rest'}); + + // Updating the setting with empty usageExportLocationResource will disable the usage report generation. + projectsClient.setUsageExportBucket({ + project: projectId, + usageExportLocationResource: {}, + }); + } + + disableUsageExport(); + // [END compute_usage_report_disable] +} + +main(...process.argv.slice(2)); diff --git a/samples/getUsageExportBucket.js b/samples/getUsageExportBucket.js new file mode 100644 index 00000000..289dcba6 --- /dev/null +++ b/samples/getUsageExportBucket.js @@ -0,0 +1,61 @@ +// 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. + +/** + * Retrieve Compute Engine usage export bucket for the Cloud project. Replaces the empty value returned by the API with the default value used to generate report file names. + * + * @param {string} projectId - ID or number of the project you want to use. + */ +function main(projectId) { + // [START compute_usage_report_get] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + + const compute = require('@google-cloud/compute'); + + async function getUsageExportBucket() { + // Get the usage export location for the project from the server. + const projectsClient = new compute.ProjectsClient({fallback: 'rest'}); + const [project] = await projectsClient.get({ + project: projectId, + }); + + const usageExportLocation = project.usageExportLocation; + + if (!usageExportLocation || !usageExportLocation.bucketName) { + // The usage reports are disabled. + return; + } + + if (!usageExportLocation.reportNamePrefix) { + // Although the server explicitly sent the empty string value, the next usage report generated with these settings still has the default prefix value `usage_gce`. (see https://cloud.google.com/compute/docs/reference/rest/v1/projects/get) + console.log( + 'Report name prefix not set, replacing with default value of `usage_gce`.' + ); + usageExportLocation.reportNamePrefix = 'usage_gce'; + } + + console.log( + 'Returned reportNamePrefix:', + usageExportLocation.reportNamePrefix + ); + } + + getUsageExportBucket(); + // [END compute_usage_report_get] +} + +main(...process.argv.slice(2)); diff --git a/samples/listAllInstances.js b/samples/listAllInstances.js new file mode 100644 index 00000000..16057b1c --- /dev/null +++ b/samples/listAllInstances.js @@ -0,0 +1,60 @@ +// 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. + +/** + * Gets all instances present in a project, grouped by their zone. + * + * @param {string} projectId - ID or number of the project you want to use. + */ +function main(projectId) { + // [START compute_instances_list_all] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + + const compute = require('@google-cloud/compute'); + + // List all instances in the specified project. + async function listAllInstances() { + const instancesClient = new compute.InstancesClient({fallback: 'rest'}); + + //Use the `maxResults` parameter to limit the number of results that the API returns per response page. + const aggListRequest = instancesClient.aggregatedListAsync({ + project: projectId, + maxResults: 5, + }); + + console.log('Instances found:'); + + // Despite using the `maxResults` parameter, you don't need to handle the pagination + // yourself. The returned object handles pagination automatically, + // requesting next pages as you iterate over the results. + for await (const [zone, instancesObject] of aggListRequest) { + const instances = instancesObject.instances; + + if (instances && instances.length > 0) { + console.log(` ${zone}`); + for (const instance of instances) { + console.log(` - ${instance.name} (${instance.machineType})`); + } + } + } + } + + listAllInstances(); + // [END compute_instances_list_all] +} + +main(...process.argv.slice(2)); diff --git a/samples/listImages.js b/samples/listImages.js new file mode 100644 index 00000000..c6513e46 --- /dev/null +++ b/samples/listImages.js @@ -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 +// +// 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. + +/** + * Prints a list of all non-deprecated image names available in given project. + * + * @param {string} projectId - ID or number of the project you want to list images from + */ +function main(projectId) { + // [START compute_images_list] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + + const compute = require('@google-cloud/compute'); + + async function listImages() { + const imagesClient = new compute.ImagesClient({fallback: 'rest'}); + + // Listing only non-deprecated images to reduce the size of the reply. + const images = imagesClient.listAsync({ + project: projectId, + maxResults: 3, + filter: 'deprecated.state != DEPRECATED', + }); + + // Although the `maxResults` parameter is specified in the request, the iterable returned + // by the `listAsync()` method hides the pagination mechanic. The library makes multiple + // requests to the API for you, so you can simply iterate over all the images. + for await (const image of images) { + console.log(` - ${image.name}`); + } + } + + listImages(); + // [END compute_images_list] +} + +main(...process.argv.slice(2)); diff --git a/samples/listImagesByPage.js b/samples/listImagesByPage.js new file mode 100644 index 00000000..a14f2e72 --- /dev/null +++ b/samples/listImagesByPage.js @@ -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. + +/** + * Prints a list of all non-deprecated image names available in a given project, divided into pages as returned by the Compute Engine API. + * + * @param {string} projectId - ID or number of the project you want to list images from + * @param {number} pageSize - size of the pages you want the API to return on each call. + */ +function main(projectId, pageSize = 10) { + // [START compute_images_list_page] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // const pageSize = 10; + + const compute = require('@google-cloud/compute'); + + async function listImagesByPage() { + const imagesClient = new compute.ImagesClient({fallback: 'rest'}); + + // Listing only non-deprecated images to reduce the size of the reply. + const listRequest = { + project: projectId, + maxResults: pageSize, + filter: 'deprecated.state != DEPRECATED', + }; + + const options = { + autoPaginate: false, + }; + + let pageNum = 1; + + // Set autoPaginate option to `false` to have more granular control of + // iteration over paginated results from the API. Each time you want to access the + // next page, the library retrieves that page from the API. + const listCallback = (err, resources, nextPageRequest, response) => { + if (err) { + console.error(err); + return; + } + + console.log(`Page ${pageNum}:`); + pageNum += 1; + + for (let i = 0; i < resources.length; i++) { + console.log(resources[i].name); + } + + if (response.nextPageToken) { + imagesClient.list(nextPageRequest, options, listCallback); + } + }; + + imagesClient.list(listRequest, options, listCallback); + } + + listImagesByPage(); + // [END compute_images_list_page] +} + +main(...process.argv.slice(2)); diff --git a/samples/listInstances.js b/samples/listInstances.js new file mode 100644 index 00000000..1e81ff2c --- /dev/null +++ b/samples/listInstances.js @@ -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 +// +// 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. + +/** + * Gets a list of instances created in given project in given zone. + * + * @param {string} projectId - ID or number of the project you want to use. + * @param {string} zone - Name of the zone you want to check, for example: us-west3-b + */ +function main(projectId, zone) { + // [START compute_instances_list] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // const zone = 'europe-central2-b' + + const compute = require('@google-cloud/compute'); + + // List all instances in the given zone in the specified project. + async function listInstances() { + const instancesClient = new compute.InstancesClient({fallback: 'rest'}); + + const [instanceList] = await instancesClient.list({ + project: projectId, + zone, + }); + + console.log(`Instances found in zone ${zone}:`); + + for (const instance of instanceList) { + console.log(` - ${instance.name} (${instance.machineType})`); + } + } + + listInstances(); + // [END compute_instances_list] +} + +main(...process.argv.slice(2)); diff --git a/samples/listVMs.js b/samples/listVMs.js deleted file mode 100644 index d5eb248c..00000000 --- a/samples/listVMs.js +++ /dev/null @@ -1,35 +0,0 @@ -// 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. - -// sample-metadata: -// title: List VMs -// usage: node listVMs - -'use strict'; - -async function main() { - // [START gce_list_vms] - const Compute = require('@google-cloud/compute'); - const compute = new Compute(); - async function listVMs() { - const vms = await compute.getVMs({ - maxResults: 10, - }); - console.log(`Found ${vms.length} VMs!`); - vms.forEach(vm => console.log(vm)); - } - listVMs(); - // [END gce_list_vms] -} -main().catch(console.error); diff --git a/samples/mailjet.js b/samples/mailjet.js index b587faff..5ad072be 100644 --- a/samples/mailjet.js +++ b/samples/mailjet.js @@ -1,4 +1,4 @@ -// Copyright 2017 Google LLC +// 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. @@ -18,7 +18,7 @@ 'use strict'; -// [START send] +// [START compute_send] const mailer = require('nodemailer'); const smtp = require('nodemailer-smtp-transport'); @@ -43,4 +43,4 @@ async function mailjet() { console.log(json); } mailjet(); -// [END send] +// [END compute_send] diff --git a/samples/package.json b/samples/package.json index cde30e0e..72be09d0 100644 --- a/samples/package.json +++ b/samples/package.json @@ -1,27 +1,26 @@ { - "name": "nodejs-docs-samples-computeengine", - "private": true, + "name": "nodejs-docs-samples-compute", "license": "Apache-2.0", "author": "Google Inc.", + "engines": { + "node": ">=10" + }, "repository": "googleapis/nodejs-compute", + "private": true, "files": [ - "*.js", - "!test/" + "*.js" ], - "engines": { - "node": ">=8" - }, "scripts": { - "test": "mocha --timeout 1200000" + "test": "mocha test --timeout 1200000" }, "dependencies": { - "@google-cloud/compute": "^2.6.0", + "@google-cloud/compute": "3.0.0-alpha.3", "@sendgrid/mail": "^7.0.0", - "node-fetch": "^2.3.0", "nodemailer": "^6.0.0", "nodemailer-smtp-transport": "^2.7.4" }, "devDependencies": { + "@google-cloud/storage": "^5.8.5", "chai": "^4.2.0", "mocha": "^8.0.0", "proxyquire": "^2.0.1", diff --git a/samples/quickstart.js b/samples/quickstart.js deleted file mode 100644 index f71b0ed4..00000000 --- a/samples/quickstart.js +++ /dev/null @@ -1,47 +0,0 @@ -// 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. - -'use strict'; - -async function main( - vmName = 'new_virtual_machine' // VM name of your choice -) { - // [START compute_engine_quickstart] - // Imports the Google Cloud client library - const Compute = require('@google-cloud/compute'); - - // Creates a client - const compute = new Compute(); - - async function quickstart() { - // Create a new VM using the latest OS image of your choice. - const zone = compute.zone('us-central1-c'); - - // TODO(developer): choose a name for the VM - // const vmName = 'vm-name'; - - // Start the VM create task - const [vm, operation] = await zone.createVM(vmName, {os: 'ubuntu'}); - console.log(vm); - - // `operation` lets you check the status of long-running tasks. - await operation.promise(); - - // Complete! - console.log('Virtual machine created!'); - } - quickstart(); - // [END compute_engine_quickstart] -} - -main(...process.argv.slice(2)); diff --git a/samples/sendgrid.js b/samples/sendgrid.js index 60a783bd..cb3b7922 100644 --- a/samples/sendgrid.js +++ b/samples/sendgrid.js @@ -1,9 +1,10 @@ -// Copyright 2015 Google, Inc +// 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 +// 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, @@ -13,7 +14,7 @@ 'use strict'; -// [START send] +// [START compute_send] // This sample is based off of: // https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/mail const sendgrid = require('@sendgrid/mail'); @@ -28,4 +29,4 @@ async function sendgridExample() { }); } sendgridExample(); -// [END send] +// [END compute_send] diff --git a/samples/setUsageExportBucket.js b/samples/setUsageExportBucket.js new file mode 100644 index 00000000..0bbbc303 --- /dev/null +++ b/samples/setUsageExportBucket.js @@ -0,0 +1,58 @@ +// 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. + +/** + * Set Compute Engine usage export bucket for the Cloud project. This sample presents how to interpret the default value for the report name prefix parameter. + * + * @param {string} projectId - ID or number of the project you want to use. + * @param {string} bucketName - Google Cloud Storage Bucket used to store Compute Engine usage reports. An existing Google Cloud Storage bucket is required. + * @param {string} reportNamePrefix - Report Name Prefix which defaults to an empty string to showcase default values behaviour. + */ +function main(projectId, bucketName, reportNamePrefix = '') { + // [START compute_usage_report_set] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // const bucketName = 'YOUR_BUCKET_NAME'; + + const compute = require('@google-cloud/compute'); + const compute_protos = compute.protos.google.cloud.compute.v1; + + async function setUsageExportBucket() { + const usageExportLocationResource = + new compute_protos.UsageExportLocation(); + usageExportLocationResource.bucketName = bucketName; + usageExportLocationResource.reportNamePrefix = reportNamePrefix; + + if (!reportNamePrefix) { + // Sending an empty value for reportNamePrefix results in the next usage report being generated with the default prefix value "usage_gce". (see: https://cloud.google.com/compute/docs/reference/rest/v1/projects/get) + console.log( + 'Setting reportNamePrefix to empty value causes the report to have the default prefix value `usage_gce`.' + ); + } + + // Set the usage export location. + const projectsClient = new compute.ProjectsClient({fallback: 'rest'}); + projectsClient.setUsageExportBucket({ + project: projectId, + usageExportLocationResource, + }); + } + + setUsageExportBucket(); + // [END compute_usage_report_set] +} + +main(...process.argv.slice(2)); diff --git a/samples/startupScript.js b/samples/startupScript.js deleted file mode 100644 index d433560c..00000000 --- a/samples/startupScript.js +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.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(name = 'start-script-example') { - // [START gce_startup_script] - const Compute = require('@google-cloud/compute'); - const fetch = require('node-fetch'); - - const compute = new Compute(); - const zone = compute.zone('us-central1-c'); - - // TODO(developer): choose a name for your virtual machine - // const name = 'your-vm-name'; - - /** - * Create a new virtual machine with Ubuntu and Apache - * @param {string} name Name of the virtual machine - */ - async function createVMWithStartupScript() { - // Create a new VM, using default ubuntu image. The startup script - // installs apache and a custom homepage. - const config = { - os: 'ubuntu', - http: true, - metadata: { - items: [ - { - key: 'startup-script', - value: `#! /bin/bash - - # Installs apache and a custom homepage - apt-get update - apt-get install -y apache2 - cat < /var/www/html/index.html - -

Hello World

-

This page was created from a simple start-up script!

`, - }, - ], - }, - }; - - const vm = zone.vm(name); - - console.log(`Creating VM ${name}...`); - const [, operation] = await vm.create(config); - - console.log(`Polling operation ${operation.id}...`); - await operation.promise(); - - console.log('Acquiring VM metadata...'); - const [metadata] = await vm.getMetadata(); - - // External IP of the VM. - const ip = metadata.networkInterfaces[0].accessConfigs[0].natIP; - console.log(`Booting new VM with IP http://${ip}...`); - - // Ping the VM to determine when the HTTP server is ready. - console.log('Operation complete. Waiting for IP'); - await pingVM(ip); - - console.log(`\n${name} created successfully`); - } - - /** - * Poll a given IP address until it returns a result. - * @param {string} ip IP address to poll - */ - async function pingVM(ip) { - let exit = false; - while (!exit) { - await new Promise(r => setTimeout(r, 2000)); - try { - const res = await fetch(`http://${ip}`); - if (res.status !== 200) { - throw new Error(res.status); - } - exit = true; - } catch (err) { - process.stdout.write('.'); - } - } - } - - createVMWithStartupScript(); - // [END gce_startup_script] -} - -main(...process.argv.slice(2)); diff --git a/samples/test/.eslintrc.yml b/samples/test/.eslintrc similarity index 100% rename from samples/test/.eslintrc.yml rename to samples/test/.eslintrc diff --git a/samples/test/mailjet.test.js b/samples/test/mailjet.test.js index 6da3c8f0..b2de020f 100644 --- a/samples/test/mailjet.test.js +++ b/samples/test/mailjet.test.js @@ -1,4 +1,4 @@ -// Copyright 2017 Google LLC +// 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. diff --git a/samples/test/samples.test.js b/samples/test/samples.test.js index 879da76d..982db6a6 100644 --- a/samples/test/samples.test.js +++ b/samples/test/samples.test.js @@ -1,4 +1,4 @@ -// Copyright 2018 Google LLC +// 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. @@ -14,69 +14,160 @@ 'use strict'; +const compute = require('@google-cloud/compute'); +const {Storage} = require('@google-cloud/storage'); + +const {describe, it} = require('mocha'); const uuid = require('uuid'); const cp = require('child_process'); const {assert} = require('chai'); -const Compute = require('@google-cloud/compute'); -const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); +const instancesClient = new compute.InstancesClient({fallback: 'rest'}); +const projectsClient = new compute.ProjectsClient({fallback: 'rest'}); -const compute = new Compute(); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); describe('samples', () => { - describe('quickstart', () => { - const name = `gcloud-ubuntu-${uuid.v4().split('-')[0]}`; - after(async () => deleteVM(name)); - it('should run the quickstart', () => { - const output = execSync(`node quickstart ${name}`); - assert.match(output, /Virtual machine created!/); - }); + const instanceName = `gcloud-test-intance-${uuid.v4().split('-')[0]}`; + const zone = 'europe-central2-b'; + const bucketName = `test-bucket-name-${uuid.v4().split('-')[0]}`; + + const storage = new Storage(); + + it('should create instance', async () => { + const projectId = await instancesClient.getProjectId(); + const output = execSync( + `node createInstance ${projectId} ${zone} ${instanceName}` + ); + assert.match(output, /Instance created./); + }); + + it('should print instances list', async () => { + const projectId = await instancesClient.getProjectId(); + const output = execSync(`node listInstances ${projectId} ${zone}`); + assert.match(output, /Instances found in zone/); + }); + + it('should print all instances list', async () => { + const projectId = await instancesClient.getProjectId(); + const output = execSync(`node listAllInstances ${projectId}`); + assert.match(output, /Instances found:/); + }); + + it('should delete instance', async () => { + const projectId = await instancesClient.getProjectId(); + const output = execSync( + `node deleteInstance ${projectId} ${zone} ${instanceName}` + ); + assert.match(output, /Instance deleted./); }); - describe('lifecycle', () => { - const name = `gcloud-ubuntu-${uuid.v4().split('-')[0]}`; + it('should wait for operation', async () => { + const projectId = await instancesClient.getProjectId(); - it('should create a VM', () => { - const output = execSync(`node createVM ${name}`); - assert.match(output, /Virtual machine created!/); + const newinstanceName = `gcloud-test-intance-${uuid.v4().split('-')[0]}`; + + execSync(`node createInstance ${projectId} ${zone} ${newinstanceName}`); + + const [operation] = await instancesClient.delete({ + project: projectId, + zone, + instance: newinstanceName, }); - it('should list the VMs', () => { - const output = execSync('node listVMs'); - assert.match(output, /Found \d+ VMs!/); + const operationString = JSON.stringify(operation); + + const output = execSync( + `node waitForOperation ${projectId} '${operationString}'` + ); + assert.match(output, /Operation finished./); + }); + + describe('usage export', () => { + before(async () => { + await storage.createBucket(bucketName); }); - it('should delete the VM', () => { - const output = execSync(`node deleteVM ${name}`); - assert.match(output, /VM deleted!/); + after(async () => { + const projectId = await instancesClient.getProjectId(); + + await projectsClient.setUsageExportBucket({ + project: projectId, + usageExportLocationResource: {}, + }); + + await storage.bucket(bucketName).delete(); }); - }); - describe('start-up script', () => { - const name = `gcloud-apache-${uuid.v4().split('-')[0]}`; - after(async () => deleteVM(name)); - it('should create vm with startup script', function (done) { - this.timeout(280000); - this.retries(3); - const {spawn} = require('child_process'); - const startupScript = spawn('node', ['startupScript', name], { - stdio: 'inherit', + it('should set empty default value in reportNamePrefix', async () => { + const projectId = await instancesClient.getProjectId(); + + const output = execSync( + `node setUsageExportBucket ${projectId} ${bucketName}` + ); + await new Promise(resolve => setTimeout(resolve, 5000)); + + assert.match( + output, + /Setting reportNamePrefix to empty value causes the report to have the default prefix value `usage_gce`./ + ); + + const [project] = await projectsClient.get({ + project: projectId, }); - startupScript.on('close', code => { - assert.strictEqual(code, 0); - return done(); + + const usageExportLocation = project.usageExportLocation; + + assert.equal(usageExportLocation.bucketName, bucketName); + assert.equal(usageExportLocation.reportNamePrefix, ''); + }); + + it('should get current default value in reportNamePrefix', async () => { + const projectId = await instancesClient.getProjectId(); + + execSync(`node setUsageExportBucket ${projectId} ${bucketName}`); + await new Promise(resolve => setTimeout(resolve, 5000)); + const output = execSync(`node getUsageExportBucket ${projectId}`); + + assert.match( + output, + /Report name prefix not set, replacing with default value of `usage_gce`./ + ); + + assert.match(output, /Returned reportNamePrefix: usage_gce/); + }); + + it('should disable usage export', async () => { + const projectId = await instancesClient.getProjectId(); + + execSync(`node setUsageExportBucket ${projectId} ${bucketName}`); + await new Promise(resolve => setTimeout(resolve, 5000)); + execSync(`node disableUsageExport ${projectId}`); + await new Promise(resolve => setTimeout(resolve, 5000)); + + const [project] = await projectsClient.get({ + project: projectId, }); + + assert.isUndefined(project.usageExportLocation); }); }); -}); -/** - * Utility function to delete a VM. - * @param {string} name - */ -async function deleteVM(name) { - const zone = compute.zone('us-central1-c'); - const vm = zone.vm(name); - const [operation] = await vm.delete(); - await operation.promise(); -} + describe('pagination', () => { + const projectId = 'windows-sql-cloud'; + + it('should automatically iterate throught the pages', async () => { + const output = execSync(`node listImages ${projectId}`); + const lines = output.split(' - '); + + assert(lines.length > 3); + }); + + it('should iterate page by page granularly', async () => { + const output = execSync(`node listImagesByPage ${projectId}`); + + assert.match(output, /Page 1/); + assert.match(output, /Page 2/); + }); + }); +}); diff --git a/samples/test/sendgrid.test.js b/samples/test/sendgrid.test.js index 217cc8a1..6b3c3339 100644 --- a/samples/test/sendgrid.test.js +++ b/samples/test/sendgrid.test.js @@ -1,4 +1,4 @@ -// Copyright 2017 Google LLC +// 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. diff --git a/samples/vms.js b/samples/vms.js deleted file mode 100644 index b810f92c..00000000 --- a/samples/vms.js +++ /dev/null @@ -1,53 +0,0 @@ -// 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. - -// [START complete] -'use strict'; - -// [START auth] -// By default, the client will authenticate using the service account file -// specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use -// the project specified by the GCLOUD_PROJECT environment variable. See -// https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application -const Compute = require('@google-cloud/compute'); -// [END auth] - -// [START initialize] -// Creates a client -const compute = new Compute(); -// [END initialize] - -// [START list] - -async function getVmsExample() { - // In this example we only want one VM per page - const options = { - maxResults: 1, - }; - const vms = await compute.getVMs(options); - return vms; -} -// [END list] -// [END complete] - -// Run the examples -exports.main = async () => { - const vms = await getVmsExample().catch(console.error); - if (vms) console.log('VMs:', vms); - return vms; -}; - -if (module === require.main) { - exports.main(console.log); -} diff --git a/samples/waitForOperation.js b/samples/waitForOperation.js new file mode 100644 index 00000000..3f27c67d --- /dev/null +++ b/samples/waitForOperation.js @@ -0,0 +1,53 @@ +// 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. + +/** + * Waits for an operation to be completed. Calling this function will block until the operation is finished. + * @param {string} projectId - ID or number of the project you want to use. + * @param {string} operationString - Operation instance you want to wait in string format. + */ +function main(projectId, operationString) { + // [START compute_instances_operation_check] + /** + * TODO(developer): Uncomment and replace these variables before running the sample. + */ + // const projectId = 'YOUR_PROJECT_ID'; + // const operationString = 'YOUR_OPERATION_STRING' + + const compute = require('@google-cloud/compute'); + + // Parse stringified operation to the object instance. + const operation = JSON.parse(operationString); + + async function waitForOperation() { + if (operation.status === 'RUNNING') { + const operationsClient = new compute.ZoneOperationsClient({ + fallback: 'rest', + }); + + await operationsClient.wait({ + operation: operation.name, + project: projectId, + zone: operation.zone.split('/').pop(), + }); + } + + console.log('Operation finished.'); + } + + waitForOperation(); + // [END compute_instances_operation_check] +} + +main(...process.argv.slice(2)); diff --git a/src/address.js b/src/address.js deleted file mode 100644 index 0e68c57d..00000000 --- a/src/address.js +++ /dev/null @@ -1,237 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * An Address object allows you to interact with a Google Compute Engine - * address. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * @see [Address Resource]{@link https://cloud.google.com/compute/docs/reference/v1/addresses} * - * - * @class - * @param {Region} region - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const address = region.address('address1'); - */ -class Address extends common.ServiceObject { - constructor(region, name) { - const methods = { - /** - * Create an address. - * - * @method Address#create - * @param {object=} options - See {Region#createAddress}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const address = region.address('address1'); - * - * address.create(function(err, address, operation, apiResponse) { - * // `address` is an Address object. - * - * // `operation` is an Operation object that can be used to check the - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * address.create().then(function(data) { - * const address = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the address exists. - * - * @method Address#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the address exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const address = region.address('address1'); - * - * address.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * address.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get an address if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Address#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const address = region.address('address1'); - * - * address.get(function(err, address, apiResponse) { - * // `address` is an Address object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * address.get().then(function(data) { - * const address = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the metadata of this address. - * - * @see [Address Resource]{@link https://cloud.google.com/compute/docs/reference/v1/addresses} - * @see [Addresses: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/addresses/get} - * - * @method Address#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The address's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const address = region.address('address1'); - * - * address.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * address.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: region, - baseUrl: '/addresses', - id: name, - createMethod: region.createAddress.bind(region), - methods: methods, - pollIntervalMs: region.compute.pollIntervalMs, - }); - /** - * @name Address#name - * @type {string} - */ - this.name = name; - /** - * The parent {@link Region} instance of this {@link Address} instance. - * @name Address#region - * @type {Region} - */ - this.region = region; - } - /** - * Delete the address. - * - * @see [Addresses: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/addresses/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const address = region.address('address1'); - * - * address.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * address.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - callback = callback || common.util.noop; - const region = this.region; - this.request( - { - method: 'DELETE', - uri: '', - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = region.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Address); - -module.exports = Address; diff --git a/src/autoscaler.js b/src/autoscaler.js deleted file mode 100644 index 1e31f6cf..00000000 --- a/src/autoscaler.js +++ /dev/null @@ -1,308 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/*! Developer Documentation - * - * @param {Zone} zone - Zone object this autoscaler belongs to. - * @param {string} name - Name of the autoscaler. - */ -/** - * Autoscalers allow you to automatically scale virtual machine instances in - * managed instance groups according to an autoscaling policy that you define. - * - * @see [Autoscaling Groups of Instances]{@link https://cloud.google.com/compute/docs/autoscaler} - * - * @class - * @param {Zone} zone - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const autoscaler = zone.autoscaler('autoscaler-name'); - */ -class Autoscaler extends common.ServiceObject { - constructor(zone, name) { - const methods = { - /** - * Create an autoscaler. - * - * @method Autoscaler#create - * @param {object} config - See {Zone#createAutoscaler}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const autoscaler = zone.autoscaler('autoscaler-name'); - * - * const config = { - * coolDown: 30, - * cpu: 80, - * loadBalance: 40, - * maxReplicas: 5, - * minReplicas: 0, - * target: 'instance-group-manager-1' - * }; - * - * const callback = function(err, autoscaler, operation, apiResponse) { - * // `autoscaler` is an Autoscaler object. - * - * // `operation` is an Operation object that can be used to check the - * // of the request. - * }; - * - * autoscaler.create(config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * autoscaler.create(config).then(function(data) { - * const autoscaler = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the autoscaler exists. - * - * @method Autoscaler#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the autoscaler exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const autoscaler = zone.autoscaler('autoscaler-name'); - * - * autoscaler.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * autoscaler.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get an autoscaler if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Autoscaler#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const autoscaler = zone.autoscaler('autoscaler-name'); - * - * autoscaler.get(function(err, autoscaler, apiResponse) { - * // `autoscaler` is an Autoscaler object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * autoscaler.get().then(function(data) { - * const autoscaler = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the metadata of this autoscaler. - * - * @method Autoscaler#getMetadata - * @see [Autoscaler Resource]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers} - * @see [Autoscalers: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers/get} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The autoscaler's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const autoscaler = zone.autoscaler('autoscaler-name'); - * - * autoscaler.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * autoscaler.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: zone, - baseUrl: '/autoscalers', - id: name, - createMethod: zone.createAutoscaler.bind(zone), - methods: methods, - pollIntervalMs: zone.compute.pollIntervalMs, - }); - /** - * @name Autoscaler#name - * @type {string} - */ - this.name = name; - /** - * Parent {@link Zone} instance of this {@link Autoscaler} instance. - * @name Autoscaler#zone - * @type {Zone} - */ - this.zone = zone; - } - /** - * Delete the autoscaler. - * - * @see [Autoscalers: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const autoscaler = zone.autoscaler('autoscaler-name'); - * - * autoscaler.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * autoscaler.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - callback = callback || common.util.noop; - const zone = this.zone; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Set the autoscaler's metadata. - * - * @see [Autoscaler Resource]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers} - * - * @param {object} metadata - See a - * [Firewall resource](https://cloud.google.com/compute/docs/reference/v1/autoscalers). - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const autoscaler = zone.autoscaler('autoscaler-name'); - * - * const metadata = { - * description: 'New description' - * }; - * - * autoscaler.setMetadata(metadata, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * autoscaler.setMetadata(metadata).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setMetadata(metadata, callback) { - const zone = this.zone; - callback = callback || common.util.noop; - metadata = metadata || {}; - metadata.name = this.name; - metadata.zone = this.zone.name; - zone.request( - { - method: 'PATCH', - uri: '/autoscalers', - qs: { - autoscaler: this.name, - }, - json: metadata, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Autoscaler); - -module.exports = Autoscaler; diff --git a/src/disk.js b/src/disk.js deleted file mode 100644 index 1013e9ac..00000000 --- a/src/disk.js +++ /dev/null @@ -1,351 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const format = require('string-format-obj'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); -const Snapshot = require('./snapshot.js'); - -/** - * A Disk object allows you to interact with a Google Compute Engine disk. - * - * @see [Disks Overview]{@link https://cloud.google.com/compute/docs/disks} - * @see [Disk Resource]{@link https://cloud.google.com/compute/docs/reference/v1/disks} - * - * @class - * @param {Zone} zone - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - */ -class Disk extends common.ServiceObject { - constructor(zone, name) { - const methods = { - /** - * Create a persistent disk. - * - * @method Disk#create - * @param {object} config - See {Zone#createDisk}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * - * const config = { - * // ... - * }; - * - * disk.create(config, function(err, disk, operation, apiResponse) { - * // `disk` is a Disk object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * disk.create(config).then(function(data) { - * const disk = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the disk exists. - * - * @method Disk#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the disk exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * - * disk.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * disk.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a disk if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Disk#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * - * disk.get(function(err, disk, apiResponse) { - * // `disk` is a Disk object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * disk.get().then(function(data) { - * const disk = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the disk's metadata. - * - * @method Disk#getMetadata - * @see [Disk Resource]{@link https://cloud.google.com/compute/docs/reference/v1/disks} - * @see [Disks: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/disks/get} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The disk's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * - * disk.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * disk.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: zone, - baseUrl: '/disks', - /** - * @name Disk#id - * @type {string} - */ - id: name, - createMethod: zone.createDisk.bind(zone), - methods: methods, - pollIntervalMs: zone.compute.pollIntervalMs, - }); - /** - * @name Disk#name - * @type {string} - */ - this.name = name; - /** - * The parent {@link Zone} instance of this {@link Disk} instance. - * @name Disk#zone - * @type {Zone} - */ - this.zone = zone; - /** - * @name Disk#formattedName - * @type {string} - */ - this.formattedName = Disk.formatName_(zone, name); - } - /** - * Create a snapshot of a disk. - * - * @see [Snapshots Overview]{@link https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots} - * @see [Disks: createSnapshot API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/disks/createSnapshot} - * - * @param {string} name - Name of the snapshot. - * @param {object=} options - See the - * [Disks: createSnapshot](https://cloud.google.com/compute/docs/reference/v1/disks/createSnapshot) - * request body. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Snapshot} callback.snapshot - The created Snapshot - * object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * - * function callback(err, snapshot, operation, apiResponse) { - * // `snapshot` is a Snapshot object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * disk.createSnapshot('new-snapshot-name', callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * disk.createSnapshot('new-snapshot-name').then(function(data) { - * const snapshot = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createSnapshot(name, options, callback) { - const self = this; - const zone = this.zone; - if (is.fn(options)) { - callback = options; - options = {}; - } - this.request( - { - method: 'POST', - uri: '/createSnapshot', - json: Object.assign({}, options, { - name: name, - }), - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const snapshot = self.snapshot(name); - const operation = zone.operation(resp.name); - operation.metadata = resp; - callback(null, snapshot, operation, resp); - } - ); - } - /** - * Delete the disk. - * - * @see [Disks: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/disks/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * - * disk.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * disk.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - const zone = this.zone; - callback = callback || common.util.noop; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Get a reference to a snapshot from this disk. - * - * @see [Snapshots Overview]{@link https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots} - * - * @param {string} name - Name of the snapshot. - * @returns {Snapshot} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * const snapshot = disk.snapshot('snapshot-name'); - */ - snapshot(name) { - return new Snapshot(this, name); - } - /** - * Format a disk's name how the API expects. - * - * @private - * - * @param {Zone} zone - The Zone this disk belongs to. - * @param {string} name - The name of the disk. - * @returns {string} - The formatted name. - */ - static formatName_(zone, name) { - return format('projects/{pId}/zones/{zoneName}/disks/{diskName}', { - pId: zone.compute.projectId, - zoneName: zone.name, - diskName: name, - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Disk, { - exclude: ['snapshot'], -}); - -module.exports = Disk; diff --git a/src/firewall.js b/src/firewall.js deleted file mode 100644 index ebc7211f..00000000 --- a/src/firewall.js +++ /dev/null @@ -1,301 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * A Firewall object allows you to interact with a Google Compute Engine - * firewall. - * - * @see [Firewalls Overview]{@link https://cloud.google.com/compute/docs/networking#firewalls} - * @see [Firewall Resource]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls} - * - * @class - * @param {Compute} compute - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const firewall = compute.firewall('tcp-3000'); - */ -class Firewall extends common.ServiceObject { - constructor(compute, name) { - const methods = { - /** - * Create a firewall. - * - * @method Firewall#create - * @param {object} config - See {@link Compute#createFirewall}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const firewall = compute.firewall('tcp-3000'); - * - * const config = { - * // ... - * }; - * - * firewall.create(config, function(err, firewall, operation, apiResponse) { - * // `firewall` is a Firewall object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * firewall.create(config).then(function(data) { - * const firewall = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the firewall exists. - * - * @method Firewall#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the firewall exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const firewall = compute.firewall('tcp-3000'); - * - * firewall.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * firewall.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a firewall if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Firewall#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const firewall = compute.firewall('tcp-3000'); - * - * firewall.get(function(err, firewall, apiResponse) { - * // `firewall` is a Firewall object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * firewall.get().then(function(data) { - * const firewall = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the firewall's metadata. - * - * @see [Firewalls: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls/get} - * @see [Firewall Resource]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls} - * - * @method Firewall#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The firewall's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const firewall = compute.firewall('tcp-3000'); - * - * firewall.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * firewall.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: compute, - baseUrl: '/global/firewalls', - /** - * @name Firewall#id - * @type {string} - */ - id: name, - createMethod: compute.createFirewall.bind(compute), - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - /** - * The parent {@link Compute} instance of this {@link Firewall} instance. - * @name Firewall#compute - * @type {Compute} - */ - this.compute = compute; - /** - * @name Firewall#name - * @type {string} - */ - this.name = name; - /** - * @name Firewall#metadata - * @type {object} - */ - this.metadata.network = 'global/networks/default'; - } - /** - * Delete the firewall. - * - * @see [Firewalls: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const firewall = compute.firewall('tcp-3000'); - * - * firewall.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * firewall.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - const compute = this.compute; - callback = callback || common.util.noop; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Set the firewall's metadata. - * - * @see [Firewall Resource]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls} - * - * @param {object} metadata - See a - * [Firewall resource](https://cloud.google.com/compute/docs/reference/v1/firewalls). - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const firewall = compute.firewall('tcp-3000'); - * - * const metadata = { - * description: 'New description' - * }; - * - * firewall.setMetadata(metadata, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * firewall.setMetadata(metadata).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setMetadata(metadata, callback) { - const compute = this.compute; - callback = callback || common.util.noop; - metadata = metadata || {}; - metadata.name = this.name; - metadata.network = metadata.network || this.metadata.network; - this.request( - { - method: 'PATCH', - uri: '', - json: metadata, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Firewall); - -/** - * Reference to the {@link Firewall} class. - * @name module:@google-cloud/compute.Firewall - * @see Firewall - */ -module.exports = Firewall; diff --git a/src/health-check.js b/src/health-check.js deleted file mode 100644 index 68e46326..00000000 --- a/src/health-check.js +++ /dev/null @@ -1,300 +0,0 @@ -/*! - * Copyright 2016 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 common = require('@google-cloud/common'); -const extend = require('extend'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * Health checks ensure that Compute Engine forwards new connections only to - * instances that are up and ready to receive them. Compute Engine sends health - * check requests to each instance at the specified frequency; once an instance - * exceeds its allowed number of health check failures, it is no longer - * considered an eligible instance for receiving new traffic. - * - * @see [Health Checks Overview]{@link https://cloud.google.com/compute/docs/load-balancing/health-checks} - * - * @class - * @param {Compute} compute - Compute object this health check belongs - * to. - * @param {string} name - Name of the health check. - * @param {object=} options - Optional configuration. - * @param {boolean} options.https - Specify if this is an HTTPS health check - * resource. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const healthCheck = gce.healthCheck('health-check-name'); - */ -class HealthCheck extends common.ServiceObject { - constructor(compute, name, options) { - const methods = { - /** - * Create an HTTP or HTTPS health check. - * - * @method HealthCheck#create - * @param {object} options - See {@link Compute#createHealthCheck}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const healthCheck = gce.healthCheck('health-check-name'); - * - * healthCheck.create(function(err, healthCheck, operation, apiResponse) { - * // `healthCheck` is a HealthCheck object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * healthCheck.create().then(function(data) { - * const healthCheck = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the health check exists. - * - * @method HealthCheck#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the health check exists or - * not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const healthCheck = gce.healthCheck('health-check-name'); - * - * healthCheck.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * healthCheck.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get the health check if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method HealthCheck#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const healthCheck = gce.healthCheck('health-check-name'); - * - * healthCheck.get(function(err, healthCheck, apiResponse) { - * // `healthCheck` is a HealthCheck object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * healthCheck.get().then(function(data) { - * const healthCheck = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the health check's metadata. - * - * @see [HttpHealthChecks: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/get} - * @see [HttpHealthCheck resource](https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks#resource) - * @see [HttpsHealthChecks: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/get} - * @see [HttpsHealthCheck resource](https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks#resource) - * - * @method HealthCheck#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The health check's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const healthCheck = gce.healthCheck('health-check-name'); - * - * healthCheck.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * healthCheck.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - options = options || {}; - const https = options.https; - super({ - parent: compute, - baseUrl: '/global/' + (https ? 'httpsHealthChecks' : 'httpHealthChecks'), - /** - * @name HealthCheck#id - * @type {string} - */ - id: name, - createMethod: function (name, options, callback) { - if (is.fn(options)) { - callback = options; - options = {}; - } - options = extend({}, options, {https: https}); - compute.createHealthCheck(name, options, callback); - }, - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - /** - * The parent {@link Compute} instance of this {@link HealthCheck} instance. - * @name HealthCheck#compute - * @type {Compute} - */ - this.compute = compute; - } - /** - * Delete the health check. - * - * @see [HttpHealthCheck: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/delete} - * @see [HttpsHealthCheck: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const healthCheck = gce.healthCheck('health-check-name'); - * - * healthCheck.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * healthCheck.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - const compute = this.compute; - callback = callback || common.util.noop; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Set the health check's metadata. - * - * @see [HttpHealthCheck: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/insert} - * @see [HttpsHealthCheck: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/insert} - * - * @param {object} metadata - See a - * [HttpHealthCheck resource](https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks#resource) - * and [HttpsHealthCheck resource](https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks#resource). - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const healthCheck = gce.healthCheck('health-check-name'); - * - * const metadata = { - * description: 'New description' - * }; - * - * healthCheck.setMetadata(metadata, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * healthCheck.setMetadata(metadata).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setMetadata(metadata, callback) { - const compute = this.compute; - callback = callback || common.util.noop; - super.setMetadata(metadata, (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(HealthCheck); - -/** - * Reference to the {@link HealthCheck} class. - * @name module:@google-cloud/compute.HealthCheck - * @see HealthCheck - */ -module.exports = HealthCheck; diff --git a/src/image.js b/src/image.js deleted file mode 100644 index f1a619b6..00000000 --- a/src/image.js +++ /dev/null @@ -1,221 +0,0 @@ -/*! - * Copyright 2018 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * An Image object allows you to interact with a Google Compute Engine image. - * - * @see [Images Overview]{@link https://cloud.google.com/compute/docs/images} - * @see [Image Resource]{@link https://cloud.google.com/compute/docs/reference/v1/images} - * - * @class - * @param {Compute} compute - The parent Compute instance this Image belongs to. - * @param {string} name - Image name. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const image = compute.image('image-name'); - */ -class Image extends common.ServiceObject { - constructor(compute, name) { - const methods = { - /** - * Check if the image exists. - * - * @method Image#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the image exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const image = compute.image('image-name'); - * - * image.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * image.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get an image if it exists. - * - * @method Image#get - * @param {options=} options - Configuration object. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const image = compute.image('image-name'); - * - * image.get(function(err, image, apiResponse) { - * // `image` is an Image object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * image.get().then(function(data) { - * const image = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the image's metadata. - * - * @see [Images: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/images/get} - * @see [Image Resource]{@link https://cloud.google.com/compute/docs/reference/v1/images} - * - * @method Image#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The image's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const image = compute.image('image-name'); - * - * image.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * image.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: compute, - baseUrl: '/global/images', - /** - * @name Image#id - * @type {string} - */ - id: name, - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - } - - /** - * Create an image. - * - * @method Image#create - * @param {Disk} disk - See {@link Compute#createImage}. - * @param {object} [options] - See {@link Compute#createImage}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * const image = compute.image('image-name'); - * - * image.create(disk, function(err, image, operation, apiResponse) { - * // `image` is an Image object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * image.create(disk).then(function(data) { - * const image = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create(disk, options, callback) { - this.parent.createImage(this.id, disk, options, callback); - } - - /** - * Delete the image. - * - * @see [Images: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/images/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const image = compute.image('image-name'); - * - * image.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * image.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - const compute = this.parent; - callback = callback || common.util.noop; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Image); - -/** - * Reference to the {@link Image} class. - * @name module:@google-cloud/compute.Image - * @see Image - */ -module.exports = Image; diff --git a/src/index.js b/src/index.js deleted file mode 100644 index cd0fd4c6..00000000 --- a/src/index.js +++ /dev/null @@ -1,2975 +0,0 @@ -/*! - * Copyright 2015 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 arrify = require('arrify'); -const common = require('@google-cloud/common'); -const extend = require('extend'); -const format = require('string-format-obj'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); -const {paginator} = require('@google-cloud/paginator'); - -const Firewall = require('./firewall.js'); -const HealthCheck = require('./health-check.js'); -const Network = require('./network.js'); -const Operation = require('./operation.js'); -const Project = require('./project.js'); -const Region = require('./region.js'); -const Rule = require('./rule.js'); -const Service = require('./service.js'); -const Snapshot = require('./snapshot.js'); -const Zone = require('./zone.js'); -const Image = require('./image.js'); - -/** - * @typedef {object} ClientConfig - * @property {string} [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://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application Application Default Credentials}, - * your project ID will be detected automatically. - * @property {string} [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 above is not necessary. NOTE: .pem and - * .p12 require you to specify the `email` option as well. - * @property {string} [email] Account email address. Required when using a .pem - * or .p12 keyFilename. - * @property {object} [credentials] Credentials object. - * @property {string} [credentials.client_email] - * @property {string} [credentials.private_key] - * @property {boolean} [autoRetry=true] Automatically retry requests if the - * response is related to rate limits or certain intermittent server errors. - * We will exponentially backoff subsequent requests by default. - * @property {number} [maxRetries=3] Maximum number of automatic retries - * attempted before returning the error. - * @property {number} [pollIntervalMs=500] Poll interval for long running - * operations. - * @property {Constructor} [promise] Custom promise module to use instead of - * native Promises. - * @property {string} [apiEndpoint] The API endpoint of the service used to make requests. Defaults to `compute.googleapis.com` - */ -/** - * @see [What is Google Compute Engine?]{@link https://cloud.google.com/compute/docs} - * - * @class - * - * @param {ClientConfig} [options] Configuration options. - * - * @example Create a client that uses Application Default Credentials (ADC) - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * - * @example Create a client with explicit credentials - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json' - * }); - */ -class Compute extends common.Service { - constructor(options = {}) { - options = extend( - true, - { - apiEndpoint: 'compute.googleapis.com', - }, - options - ); - const config = { - apiEndpoint: options.apiEndpoint, - baseUrl: `https://${options.apiEndpoint}/compute/v1`, - scopes: ['https://www.googleapis.com/auth/compute'], - packageJson: require('../package.json'), - }; - super(config, options); - this.pollIntervalMs = options.pollIntervalMs; - } - /** - * Create a firewall. - * - * @see [Firewalls Overview]{@link https://cloud.google.com/compute/docs/networking#firewalls} - * @see [Firewalls: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls/insert} - * - * @throws {Error} if a name is not provided. - * @throws {Error} if a config object is not provided. - * - * @param {string} name - Name of the firewall. - * @param {object} config - See a - * [Firewall resource](https://cloud.google.com/compute/docs/reference/v1/firewalls#resource). - * @param {object} config.protocols - A map of protocol to port range. The keys - * of the object refer to a protocol (e.g. `tcp`, `udp`) and the value for - * the key are the ports/port-ranges that are allowed to make a connection. - * If a `true` value, that means all ports on that protocol will be opened. - * If `false`, all traffic on that protocol will be blocked. - * @param {string[]} config.ranges - The IP address blocks that this rule - * applies to, expressed in - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * format. - * @param {string[]} config.tags - Instance tags which this rule applies to. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Firewall} callback.firewall - The created Firewall - * object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * var config = { - * protocols: { - * tcp: [3000], - * udp: [] // An empty array means all ports are allowed. - * }, - * - * ranges: ['0.0.0.0/0'] - * }; - * - * function callback(err, firewall, operation, apiResponse) { - * // `firewall` is a Firewall object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * gce.createFirewall('new-firewall-name', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.createFirewall('new-firewall-name', config).then(function(data) { - * var firewall = data[0]; - * var operation = data[1]; - * var apiResponse = data[2]; - * }); - */ - createFirewall(name, config, callback) { - const self = this; - if (!is.string(name)) { - throw new Error('A firewall name must be provided.'); - } - if (!is.object(config)) { - throw new Error('A firewall configuration object must be provided.'); - } - const body = Object.assign({}, config, { - name: name, - }); - if (body.protocols) { - body.allowed = arrify(body.allowed); - for (const protocol in body.protocols) { - const allowedConfig = { - IPProtocol: protocol, - }; - const ports = body.protocols[protocol]; - if (ports === false || ports.length === 0) { - continue; - } - // If the port is `true`, open up all ports on this protocol. - allowedConfig.ports = ports === true ? [] : arrify(ports); - body.allowed.push(allowedConfig); - } - delete body.protocols; - } - if (body.ranges) { - body.sourceRanges = arrify(body.ranges); - delete body.ranges; - } - if (body.tags) { - body.sourceTags = arrify(body.tags); - delete body.tags; - } - this.request( - { - method: 'POST', - uri: '/global/firewalls', - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const firewall = self.firewall(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, firewall, operation, resp); - } - ); - } - /** - * Create an HTTP or HTTPS health check. - * - * @see [Health Checks Overview]{@link https://cloud.google.com/compute/docs/load-balancing/health-checks} - * @see [HttpHealthCheck: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/insert} - * @see [HttpsHealthCheck: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/insert} - * - * @param {string} name - Name of the HTTP or HTTPS health check to create. - * @param {object=} options - See a - * [HttpHealthCheck resource](https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks#resource) - * and [HttpsHealthCheck resource](https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks#resource). - * @param {boolean} options.https - Create an HTTPs health check. Default: - * `false`. - * @param {number} options.interval - How often (in seconds) to send a health - * check. The default value is 5 seconds. (Alias for - * `options.checkIntervalSec`) - * @param {number} options.timeout - How long (in seconds) to wait before - * claiming failure. The default value is 5 seconds. It is invalid for - * this value to be greater than checkIntervalSec. (Alias for - * `options.timeoutSec`) - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {HealthCheck} callback.healthCheck - The created - * HealthCheck object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * function callback(err, healthCheck, operation, apiResponse) { - * // `healthCheck` is a HealthCheck object. - * - * // `operation` is an Operation object that can be used to check the status - * // of network creation. - * } - * - * gce.createHealthCheck('new-health-check-name', callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.createHealthCheck('new-health-check-name').then(function(data) { - * var healthCheck = data[0]; - * var operation = data[1]; - * var apiResponse = data[2]; - * }); - */ - createHealthCheck(name, options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - if (!is.string(name)) { - throw new Error('A health check name must be provided.'); - } - const body = Object.assign({}, options, { - name: name, - }); - const https = options.https; - delete body.https; - if (body.interval) { - body.checkIntervalSec = body.interval; - delete body.interval; - } - if (body.timeout) { - body.timeoutSec = body.timeout; - delete body.timeout; - } - this.request( - { - method: 'POST', - uri: '/global/' + (https ? 'httpsHealthChecks' : 'httpHealthChecks'), - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const healthCheck = self.healthCheck(name, { - https: https, - }); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, healthCheck, operation, resp); - } - ); - } - /** - * Create an image from a disk. - * - * @see [Images: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/images/insert} - * - * @param {string} name - The name of the target image. - * @param {Disk} disk - The source disk to create the image from. - * @param {object} [options] - See the - * [Images: insert API documentation](https://cloud.google.com/compute/docs/reference/v1/images/insert). - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object that can be used - * to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const disk = zone.disk('disk1'); - * - * compute.createImage('new-image', disk, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of network creation. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * compute.createImage('new-image', disk).then(function(data) { - * var image = data[0]; - * var operation = data[1]; - * var apiResponse = data[2]; - * }); - */ - createImage(name, disk, options, callback) { - const self = this; - if (!common.util.isCustomType(disk, 'Disk')) { - throw new Error('A Disk object is required.'); - } - if (is.fn(options)) { - callback = options; - options = {}; - } - const body = Object.assign( - { - name: name, - sourceDisk: format('zones/{zoneName}/disks/{diskName}', { - zoneName: disk.zone.name, - diskName: disk.name, - }), - }, - options - ); - this.request( - { - method: 'POST', - uri: '/global/images', - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const image = self.image(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, image, operation, resp); - } - ); - } - /** - * Create a network. - * - * @see [Networks Overview]{@link https://cloud.google.com/compute/docs/networking#networks} - * @see [Networks: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/networks/insert} - * - * @param {string} name - Name of the network. - * @param {object} config - See a - * [Network resource](https://cloud.google.com/compute/docs/reference/v1/networks#resource). - * @param {string} config.gateway - A gateway address for default routing to - * other networks. (Alias for `config.gatewayIPv4`) - * @param {string} config.range - - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) range - * of addresses that are legal on this network. (Alias for - * `config.IPv4Range`) - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Network} callback.network - The created Network - * object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * var config = { - * range: '10.240.0.0/16' - * }; - * - * function callback(err, network, operation, apiResponse) { - * // `network` is a Network object. - * - * // `operation` is an Operation object that can be used to check the status - * // of network creation. - * } - * - * gce.createNetwork('new-network', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.createNetwork('new-network', config).then(function(data) { - * var network = data[0]; - * var operation = data[1]; - * var apiResponse = data[2]; - * }); - */ - createNetwork(name, config, callback) { - const self = this; - const body = Object.assign({}, config, { - name: name, - }); - if (body.range) { - body.IPv4Range = body.range; - delete body.range; - } - if (body.gateway) { - body.gatewayIPv4 = body.gateway; - delete body.gateway; - } - this.request( - { - method: 'POST', - uri: '/global/networks', - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const network = self.network(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, network, operation, resp); - } - ); - } - /** - * Create a global forwarding rule. - * - * @see [GlobalForwardingRule Resource]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules#resource} - * @see [GlobalForwardingRules: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/insert} - * - * @param {string} name - Name of the rule. - * @param {object} config - See a - * [GlobalForwardingRule resource](https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules#resource). - * @param {string=} config.ip - The single IP address this forwarding rule will - * match against. All traffic that matches the IP address, protocol, and - * ports of this forwarding rule will be handled by this rule. If specified, - * the IP address must be a static external IP address. To create a new - * ephemeral external IP address for the forwarding rule, leave this field - * empty. (Alias for `config.IPAddress`) - * @param {string=} config.protocol - The type of protocol that this forwarding - * rule matches. Valid values are `AH`, `ESP`, `SCTP`, `TCP`, `UDP`. - * Default: `TCP`. (Alias for `config.IPProtocol`) - * @param {string=} config.range - A single port or single contiguous port - * range, ranging from low to high for which this forwarding rule matches. - * Packets of the specified protocol sent to these ports will be forwarded - * on to the appropriate target pool or target instance. If this field is - * left empty, then the forwarding matches traffic for all ports for the - * specified protocol. (Alias for `config.portRange`) - * @param {string} config.target - The full or valid partial URL of the target - * resource to receive the matched traffic. This target must be a global - * [`TargetHttpProxy` or `TargetHttpsProxy` resource](https://cloud.google.com/compute/docs/load-balancing/http/target-proxies). - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Rule} callback.rule - The created Rule object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * var name = 'new-rule-name'; - * - * var config = { - * target: 'global/targetHttpProxies/my-proxy', - * range: '8080-8089' - * }; - * - * gce.createRule(name, config, function (err, rule, operation, apiResponse) { - * // `rule` is a Rule object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.createRule(name, config).then(function(data) { - * var rule = data[0]; - * var operation = data[1]; - * var apiResponse = data[2]; - * }); - */ - createRule(name, config, callback) { - const self = this; - const body = Object.assign({}, config, { - name: name, - }); - if (body.ip) { - body.IPAddress = body.ip; - delete body.ip; - } - if (body.protocol) { - body.IPProtocol = body.protocol; - delete body.protocol; - } - if (body.range) { - body.portRange = body.range; - delete body.range; - } - this.request( - { - method: 'POST', - uri: '/global/forwardingRules', - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const rule = self.rule(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, rule, operation, resp); - } - ); - } - /** - * Create a backend service. - * - * @see [Backend Services Overview]{@link https://cloud.google.com/compute/docs/load-balancing/http/backend-service} - * @see [BackendServices: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/backendServices/insert} - * - * @param {string} name - Name of the backend service. - * @param {object} config - See a - * [BackendService resource](https://cloud.google.com/compute/docs/reference/v1/backendServices#resource). - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Service} callback.service - The created Service - * object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * var config = { - * backends: [ - * { - * group: 'URL of an Instance Group resource' - * } - * ], - * healthChecks: [ - * 'URL of an HTTP/HTTPS health check resource' - * ] - * }; - * - * function callback(err, service, operation, apiResponse) { - * // `service` is a Service object. - * - * // `operation` is an Operation object that can be used to check the status - * // of network creation. - * } - * - * gce.createService('new-service', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.createService('new-service', config).then(function(data) { - * var service = data[0]; - * var operation = data[1]; - * var apiResponse = data[2]; - * }); - */ - createService(name, config, callback) { - const self = this; - const body = Object.assign({}, config, { - name: name, - }); - this.request( - { - method: 'POST', - uri: '/global/backendServices', - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const service = self.service(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, service, operation, resp); - } - ); - } - /** - * Get a reference to a Google Compute Engine firewall. - * - * See {@link Network#firewall} to get a Firewall object for a specific - * network. - * - * @see [Firewalls Overview]{@link https://cloud.google.com/compute/docs/networking#firewalls} - * - * @param {string} name - Name of the firewall. - * @returns {Firewall} - * - * @example - * var firewall = gce.firewall('firewall-name'); - */ - firewall(name) { - return new Firewall(this, name); - } - /** - * Get a list of addresses. For a detailed description of method's options see - * [API reference](https://goo.gl/r9XmXJ). - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * @see [Addresses: aggregatedList API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/addresses/aggregatedList} - * - * @param {object=} options - Address search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of addresses to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Address[]} callback.addresses - Address objects from - * your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getAddresses(function(err, addresses) { - * // addresses is an array of `Address` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, addresses, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getAddresses(nextQuery, callback); - * } - * } - * - * gce.getAddresses({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getAddresses().then(function(data) { - * var addresses = data[0]; - * }); - */ - getAddresses(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/aggregated/addresses', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const regions = resp.items || {}; - const addresses = Object.keys(regions).reduce((acc, regionName) => { - const region = self.region(regionName.replace('regions/', '')); - const regionAddresses = regions[regionName].addresses || []; - regionAddresses.forEach(address => { - const addressInstance = region.address(address.name); - addressInstance.metadata = address; - acc.push(addressInstance); - }); - return acc; - }, []); - callback(null, addresses, nextQuery, resp); - } - ); - } - /** - * Get a list of autoscalers. For a detailed description of this method's - * options, see the [API reference](https://cloud.google.com/compute/docs/reference/v1/autoscalers/aggregatedList). - * - * @see [Managing Autoscalers]{@link https://cloud.google.com/compute/docs/autoscaler/managing-autoscalers} - * @see [Understanding Autoscaler Decisions]{@link https://cloud.google.com/compute/docs/autoscaler/understanding-autoscaler-decisions} - * @see [Autoscalers: aggregatedList API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers/aggregatedList} - * - * @param {object=} options - Address search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of addresses to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Autoscaler[]} callback.autoscalers - Autoscaler - * objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getAutoscalers(function(err, autoscalers) { - * // autoscalers is an array of `Autoscaler` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, autoscalers, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getAutoscalers(nextQuery, callback); - * } - * } - * - * gce.getAutoscalers({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getAutoscalers().then(function(data) { - * var autoscalers = data[0]; - * }); - */ - getAutoscalers(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/aggregated/autoscalers', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const zones = resp.items || {}; - const autoscalers = Object.keys(zones).reduce((acc, zoneName) => { - if (zoneName.indexOf('zones/') !== 0) { - return acc; - } - const zone = self.zone(zoneName.replace('zones/', '')); - const zoneAutoscalers = zones[zoneName].autoscalers || []; - zoneAutoscalers.forEach(autoscaler => { - const autoscalerInstance = zone.autoscaler(autoscaler.name); - autoscalerInstance.metadata = autoscaler; - acc.push(autoscalerInstance); - }); - return acc; - }, []); - callback(null, autoscalers, nextQuery, resp); - } - ); - } - /** - * Get a list of disks. - * - * @see [Disks Overview]{@link https://cloud.google.com/compute/docs/disks} - * @see [Disks: aggregatedList API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/disks/aggregatedList} - * - * @param {object=} options - Disk search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of disks to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Disk[]} callback.disks - Disk objects from your - * project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getDisks(function(err, disks) { - * // `disks` is an array of `Disk` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, disks, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getDisks(nextQuery, callback); - * } - * } - * - * gce.getDisks({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getDisks().then(function(data) { - * var disks = data[0]; - * }); - */ - getDisks(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/aggregated/disks', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const zones = resp.items || {}; - const disks = Object.keys(zones).reduce((acc, zoneName) => { - const zone = self.zone(zoneName.replace('zones/', '')); - const disks = zones[zoneName].disks || []; - disks.forEach(disk => { - const diskInstance = zone.disk(disk.name); - diskInstance.metadata = disk; - acc.push(diskInstance); - }); - return acc; - }, []); - callback(null, disks, nextQuery, resp); - } - ); - } - /** - * Get a list of instance groups. - * - * @see [InstanceGroups Overview]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups} - * @see [InstanceGroups: aggregatedList API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/aggregatedList} - * - * @param {object=} options - Instance group search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of instance groups to - * return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {InstanceGroup[]} callback.instanceGroups - - * InstanceGroup objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getInstanceGroups(function(err, instanceGroups) { - * // `instanceGroups` is an array of `InstanceGroup` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, instanceGroups, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getInstanceGroups(nextQuery, callback); - * } - * } - * - * gce.getInstanceGroups({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getInstanceGroups().then(function(data) { - * var instanceGroups = data[0]; - * }); - */ - getInstanceGroups(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/aggregated/instanceGroups', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const zones = resp.items || {}; - const instanceGroups = Object.keys(zones).reduce((acc, zoneName) => { - const zone = self.zone(zoneName.replace('zones/', '')); - const instanceGroups = zones[zoneName].instanceGroups || []; - instanceGroups.forEach(group => { - const instanceGroupInstance = zone.instanceGroup(group.name); - instanceGroupInstance.metadata = group; - acc.push(instanceGroupInstance); - }); - return acc; - }, []); - callback(null, instanceGroups, nextQuery, resp); - } - ); - } - /** - * Get a list of firewalls. - * - * @see [Firewalls Overview]{@link https://cloud.google.com/compute/docs/networking#firewalls} - * @see [Firewalls: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls/list} - * - * @param {object=} options - Firewall search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of firewalls to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Firewall[]} callback.firewalls - Firewall objects from - * your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getFirewalls(function(err, firewalls) { - * // `firewalls` is an array of `Firewall` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, firewalls, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getFirewalls(nextQuery, callback); - * } - * } - * - * gce.getFirewalls({ - * autoPaginate: false - * }, callback); - * - * gce.getFirewalls().then(function(data) { - * var firewalls = data[0]; - * }); - */ - getFirewalls(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/global/firewalls', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const firewalls = (resp.items || []).map(firewall => { - const firewallInstance = self.firewall(firewall.name); - firewallInstance.metadata = firewall; - return firewallInstance; - }); - callback(null, firewalls, nextQuery, resp); - } - ); - } - /** - * Get a list of health checks. - * - * @see [Health Checks Overview]{@link https://cloud.google.com/compute/docs/load-balancing/health-checks} - * @see [HttpHealthCheck: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpHealthChecks/list} - * @see [HttpsHealthCheck: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/httpsHealthChecks/list} - * - * @param {object=} options - Health check search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {boolean} options.https - List only HTTPs health checks. Default: - * `false`. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of networks to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {HealthCheck[]} callback.healthChecks - HealthCheck - * objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getHealthChecks(function(err, healthChecks) { - * // `healthChecks` is an array of `HealthCheck` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, healthChecks, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getHealthChecks(nextQuery, callback); - * } - * } - * - * gce.getHealthChecks({ - * autoPaginate: false - * }, callback); - * - * gce.getHealthChecks().then(function(data) { - * var healthChecks = data[0]; - * }); - */ - getHealthChecks(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = Object.assign({}, options); - const https = options.https; - delete options.https; - this.request( - { - uri: '/global/' + (https ? 'httpsHealthChecks' : 'httpHealthChecks'), - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const healthChecks = (resp.items || []).map(healthCheck => { - const healthCheckInstance = self.healthCheck(healthCheck.name, { - https: https, - }); - healthCheckInstance.metadata = healthCheck; - return healthCheckInstance; - }); - callback(null, healthChecks, nextQuery, resp); - } - ); - } - /** - * Get a list of images. - * - * @see [Images Overview]{@link https://cloud.google.com/compute/docs/images} - * @see [Images: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/images} - * - * @param {object=} options - Image search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of images to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Image[]} callback.images - Image objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getImages(function(err, images) { - * // `images` is an array of `Image` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, images, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getImages(nextQuery, callback); - * } - * } - * - * gce.getImages({ - * autoPaginate: false - * }, callback); - * - * gce.getImages().then(function(data) { - * var images = data[0]; - * }); - */ - getImages(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/global/images', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const images = (resp.items || []).map(image => { - const imageInstance = self.image(image.name); - imageInstance.metadata = image; - return imageInstance; - }); - callback(null, images, nextQuery, resp); - } - ); - } - /** - * Get a list of machine types in this project. - * - * @see [MachineTypes: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes/aggregatedList} - * @see [Machine Types Overview]{@link https://cloud.google.com/compute/docs/machine-types} - * @see [MachineType Resource]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes} - * - * @param {object=} options - Machine type search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of machineTypes to - * return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {MachineType[]} callback.machineTypes - MachineType - * objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getMachineTypes(function(err, machineTypes) { - * // `machineTypes` is an array of `MachineType` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, machineTypes, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getMachineTypes(nextQuery, callback); - * } - * } - * - * gce.getMachineTypes({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getMachineTypes().then(function(data) { - * var machineTypes = data[0]; - * }); - */ - getMachineTypes(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/aggregated/machineTypes', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const zones = resp.items || {}; - const machineTypes = Object.keys(zones).reduce((acc, zoneName) => { - const zone = self.zone(zoneName.replace('zones/', '')); - const machineTypesByZone = zones[zoneName].machineTypes || []; - machineTypesByZone.forEach(machineType => { - const machineTypeInstance = zone.machineType(machineType.name); - machineTypeInstance.metadata = machineType; - acc.push(machineTypeInstance); - }); - return acc; - }, []); - callback(null, machineTypes, nextQuery, resp); - } - ); - } - /** - * Get a list of networks. - * - * @see [Networks Overview]{@link https://cloud.google.com/compute/docs/networking#networks} - * @see [Networks: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/networks/list} - * - * @param {object=} options - Network search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of networks to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Network[]} callback.networks - Network objects from - * your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getNetworks(function(err, networks) { - * // `networks` is an array of `Network` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, networks, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getNetworks(nextQuery, callback); - * } - * } - * - * gce.getNetworks({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getNetworks().then(function(data) { - * var networks = data[0]; - * }); - */ - getNetworks(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/global/networks', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const networks = (resp.items || []).map(network => { - const networkInstance = self.network(network.name); - networkInstance.metadata = network; - return networkInstance; - }); - callback(null, networks, nextQuery, resp); - } - ); - } - /** - * Get a list of global operations. - * - * @see [Global Operation Overview]{@link https://cloud.google.com/compute/docs/reference/v1/globalOperations} - * @see [GlobalOperations: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalOperations/list} - * - * @param {object=} options - Operation search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of operations to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation[]} callback.operations - Operation objects - * from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getOperations(function(err, operations) { - * // `operations` is an array of `Operation` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, operations, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getOperations(nextQuery, callback); - * } - * } - * - * gce.getOperations({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getOperations().then(function(data) { - * var operations = data[0]; - * }); - */ - getOperations(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/global/operations', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const operations = (resp.items || []).map(operation => { - const operationInstance = self.operation(operation.name); - operationInstance.metadata = operation; - return operationInstance; - }); - callback(null, operations, nextQuery, resp); - } - ); - } - /** - * Return the regions available to your project. - * - * @see [Regions & Zones Overview]{@link https://cloud.google.com/compute/docs/zones} - * @see [Regions: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/regions/list} - * - * @param {object=} options - Instance search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of instances to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Region[]} callback.regions - Region objects that are - * available to your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getRegions(function(err, regions) { - * // `regions` is an array of `Region` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, regions, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getRegions(nextQuery, callback); - * } - * } - * - * gce.getRegions({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getRegions().then(function(data) { - * var regions = data[0]; - * }); - */ - getRegions(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - this.request( - { - uri: '/regions', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const regions = resp.items.map(region => { - const regionInstance = self.region(region.name); - regionInstance.metadata = region; - return regionInstance; - }); - callback(null, regions, nextQuery, resp); - } - ); - } - /** - * Get a list of forwarding rules. - * - * @see [GlobalForwardingRules: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/list} - * - * @param {object=} options - Rules search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of rules to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Rule[]} callback.rules - Rule objects from your - * project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getRules(function(err, rules) { - * // `rules` is an array of `Rule` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, rules, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getRules(nextQuery, callback); - * } - * } - * - * gce.getRules({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getRules().then(function(data) { - * var rules = data[0]; - * }); - */ - getRules(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/global/forwardingRules', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const rules = (resp.items || []).map(rule => { - const ruleInstance = self.rule(rule.name); - ruleInstance.metadata = rule; - return ruleInstance; - }); - callback(null, rules, nextQuery, resp); - } - ); - } - /** - * Get a list of backend services. - * - * @see [Backend Services Overview]{@link https://cloud.google.com/compute/docs/load-balancing/http/backend-service} - * @see [BackendServices: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/backendServices/list} - * - * @param {object=} options - BackendService search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of snapshots to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Service[]} callback.services - Service objects from - * your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getServices(function(err, services) { - * // `services` is an array of `Service` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, services, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getServices(nextQuery, callback); - * } - * } - * - * gce.getServices({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getServices().then(function(data) { - * var services = data[0]; - * }); - */ - getServices(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/global/backendServices', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const services = (resp.items || []).map(service => { - const serviceInstance = self.service(service.name); - serviceInstance.metadata = service; - return serviceInstance; - }); - callback(null, services, nextQuery, resp); - } - ); - } - /** - * Get a list of snapshots. - * - * @see [Snapshots Overview]{@link https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots} - * @see [Snapshots: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/snapshots/list} - * - * @param {object=} options - Snapshot search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of snapshots to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Snapshot[]} callback.snapshots - Snapshot objects from - * your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getSnapshots(function(err, snapshots) { - * // `snapshots` is an array of `Snapshot` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, snapshots, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getSnapshots(nextQuery, callback); - * } - * } - * - * gce.getSnapshots({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getSnapshots().then(function(data) { - * var snapshots = data[0]; - * }); - */ - getSnapshots(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/global/snapshots', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const snapshots = (resp.items || []).map(snapshot => { - const snapshotInstance = self.snapshot(snapshot.name); - snapshotInstance.metadata = snapshot; - return snapshotInstance; - }); - callback(null, snapshots, nextQuery, resp); - } - ); - } - /** - * Get a list of subnetworks in this project. - * - * @see [Subnetworks Overview]{@link https://cloud.google.com/compute/docs/subnetworks} - * @see [Subnetworks: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks} - * - * @param {object=} options - Subnetwork search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of subnetworks to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Subnetwork[]} callback.subnetworks - Subnetwork - * objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getSubnetworks(function(err, subnetworks) { - * // `subnetworks` is an array of `Subnetworks` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, subnetworks, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getSubnetworks(nextQuery, callback); - * } - * } - * - * gce.getSubnetworks({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getSubnetworks().then(function(data) { - * var subnetworks = data[0]; - * }); - */ - getSubnetworks(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/aggregated/subnetworks', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const regions = resp.items || {}; - const subnetworks = Object.keys(regions).reduce((acc, regionName) => { - const region = self.region(regionName.replace('regions/', '')); - const subnetworks = regions[regionName].subnetworks || []; - subnetworks.forEach(subnetwork => { - const subnetworkInstance = region.subnetwork(subnetwork.name); - subnetworkInstance.metadata = subnetwork; - acc.push(subnetworkInstance); - }); - return acc; - }, []); - callback(null, subnetworks, nextQuery, resp); - } - ); - } - /** - * Get a list of virtual machine instances. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * @see [Instances: aggregatedList API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/aggregatedList} - * - * @param {object=} options - Instance search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of instances to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {VM[]} callback.vms - VM objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getVMs(function(err, vms) { - * // `vms` is an array of `VM` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, vms, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getVMs(nextQuery, callback); - * } - * } - * - * gce.getVMs({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getVMs().then(function(data) { - * var vms = data[0]; - * }); - */ - getVMs(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/aggregated/instances', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const zones = resp.items || {}; - const vms = Object.keys(zones).reduce((acc, zoneName) => { - const zone = self.zone(zoneName.replace('zones/', '')); - const instances = zones[zoneName].instances || []; - instances.forEach(instance => { - const vmInstance = zone.vm(instance.name); - vmInstance.metadata = instance; - acc.push(vmInstance); - }); - return acc; - }, []); - callback(null, vms, nextQuery, resp); - } - ); - } - /** - * Return the zones available to your project. - * - * @see [Regions & Zones Overview]{@link https://cloud.google.com/compute/docs/zones} - * @see [Zones: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/zones/list} - * - * @param {object=} options - Instance search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of instances to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Zone[]} callback.zones - Zone objects that are - * available to your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * gce.getZones(function(err, zones) { - * // `zones` is an array of `Zone` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, zones, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * gce.getZones(nextQuery, callback); - * } - * } - * - * gce.getZones({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * gce.getZones().then(function(data) { - * var zones = data[0]; - * }); - */ - getZones(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - this.request( - { - uri: '/zones', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const zones = resp.items.map(zone => { - const zoneInstance = self.zone(zone.name); - zoneInstance.metadata = zone; - return zoneInstance; - }); - callback(null, zones, nextQuery, resp); - } - ); - } - /** - * Get a reference to a Google Compute Engine health check. - * - * @see [Health Checks Overview]{@link https://cloud.google.com/compute/docs/load-balancing/health-checks} - * - * @param {string} name - Name of the health check. - * @param {object=} options - Configuration object. - * @param {boolean} options.https - Specify if this is an HTTPS health check - * resource. Default: `false` - * @returns {HealthCheck} - * - * @example - * var healthCheck = gce.healthCheck('http-health-check-name'); - * - * //- - * // Access an HTTPS health check. - * //- - * var httpsHealthCheck = gce.healthCheck('https-health-check-name', { - * https: true - * }); - */ - healthCheck(name, options) { - return new HealthCheck(this, name, options); - } - /** - * Get a reference to a Google Compute Engine image. - * - * @see [Images Overview]{@link https://cloud.google.com/compute/docs/images} - * - * @param {string} name - Name of the image. - * @returns {Image} - * - * @example - * var image = gce.image('image-name'); - */ - image(name) { - return new Image(this, name); - } - /** - * Get a reference to a Google Compute Engine network. - * - * @see [Networks Overview]{@link https://cloud.google.com/compute/docs/networking#networks} - * - * @param {string} name - Name of the network. - * @returns {Network} - * - * @example - * var network = gce.network('network-name'); - */ - network(name) { - return new Network(this, name); - } - /** - * Get a reference to a global Google Compute Engine operation. - * - * @see [Global Operation Overview]{@link https://cloud.google.com/compute/docs/reference/v1/globalOperations} - * - * @param {string} name - Name of the existing operation. - * @returns {Operation} - * - * @example - * var operation = gce.operation('operation-name'); - */ - operation(name) { - return new Operation(this, name); - } - /** - * Get a reference to your Google Compute Engine project. - * - * @see [Projects Overview]{@link https://cloud.google.com/compute/docs/reference/v1/projects} - * - * @returns {Project} - * - * @example - * var project = gce.project(); - */ - project() { - return new Project(this); - } - /** - * Get a reference to a Google Compute Engine region. - * - * @see [Regions & Zones Overview]{@link https://cloud.google.com/compute/docs/zones} - * - * @param {string} name - Name of the region. - * @returns {Region} - * - * @example - * var region = gce.region('region-name'); - */ - region(name) { - return new Region(this, name); - } - /** - * Get a reference to a Google Compute Engine forwading rule. - * - * @param {string} name - Name of the rule. - * @returns {Rule} - * - * @example - * var rule = gce.rule('rule-name'); - */ - rule(name) { - return new Rule(this, name); - } - /** - * Get a reference to a Google Compute Engine backend service. - * - * @see [Backend Services Overview]{@link https://cloud.google.com/compute/docs/load-balancing/http/backend-service} - * - * @param {string} name - Name of the existing service. - * @returns {Service} - * - * @example - * var service = gce.service('service-name'); - */ - service(name) { - return new Service(this, name); - } - /** - * Get a reference to a Google Compute Engine snapshot. - * - * @see [Snapshots Overview]{@link https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots} - * - * @param {string} name - Name of the existing snapshot. - * @returns {Snapshot} - * - * @example - * var snapshot = gce.snapshot('snapshot-name'); - */ - snapshot(name) { - return new Snapshot(this, name); - } - /** - * Get a reference to a Google Compute Engine zone. - * - * @see [Regions & Zones Overview]{@link https://cloud.google.com/compute/docs/zones} - * - * @param {string} name - Name of the zone. - * @returns {Zone} - * - * @example - * var zone = gce.zone('zone-name'); - */ - zone(name) { - return new Zone(this, name); - } - /** - * Register a single callback that will wait for an operation to finish before - * being executed. - * - * @returns {function} callback - The callback function. - * @returns {?error} callback.err - An error returned from the operation. - * @returns {object} callback.apiResponse - The operation's final API response. - */ - execAfterOperation_(callback) { - return function (err) { - // arguments = [..., op, apiResponse] - const operation = arguments[arguments.length - 2]; - const apiResponse = arguments[arguments.length - 1]; - if (err) { - callback(err, apiResponse); - return; - } - operation.on('error', callback).on('complete', metadata => { - callback(null, metadata); - }); - }; - } -} - -/** - * Get a list of {@link Address} objects as a readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link Compute#getAddresses} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getAddressesStream() - * .on('error', console.error) - * .on('data', function(address) { - * // `address` is an `Address` object. - * }) - * .on('end', function() { - * // All addresses retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getAddressesStream() - * .on('data', function(address) { - * this.end(); - * }); - */ -Compute.prototype.getAddressesStream = paginator.streamify('getAddresses'); - -/** - * Get a list of {@link Autoscaler} objects as a readable object - * stream. - * - * @param {object=} query - Configuration object. See - * {@link Compute#getAutoscalers} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getAutoscalersStream() - * .on('error', console.error) - * .on('data', function(autoscaler) { - * // `autoscaler` is an `Autoscaler` object. - * }) - * .on('end', function() { - * // All addresses retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getAutoscalersStream() - * .on('data', function(address) { - * this.end(); - * }); - */ -Compute.prototype.getAutoscalersStream = paginator.streamify('getAutoscalers'); - -/** - * Get a list of {@link Disk} objects as a readable object stream. - * - * @method Compute#getDisksStream - * @param {object=} options - Configuration object. See - * {@link Compute#getDisks} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getDisksStream() - * .on('error', console.error) - * .on('data', function(disk) { - * // `disk` is a `Disk` object. - * }) - * .on('end', function() { - * // All disks retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getDisksStream() - * .on('data', function(disk) { - * this.end(); - * }); - */ - -Compute.prototype.getDisksStream = paginator.streamify('getDisks'); - -/** - * Get a list of {@link InstanceGroup} objects as a readable object - * stream. - * - * @method Compute#getInstanceGroupsStream - * @param {object=} options - Configuration object. See - * {@link Compute#getInstanceGroups} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getInstanceGroupsStream() - * .on('error', console.error) - * .on('data', function(instanceGroup) { - * // `instanceGroup` is an `InstanceGroup` object. - * }) - * .on('end', function() { - * // All instance groups retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getInstanceGroupsStream() - * .on('data', function(instanceGroup) { - * this.end(); - * }); - */ - -Compute.prototype.getInstanceGroupsStream = - paginator.streamify('getInstanceGroups'); - -/** - * Get a list of {@link Firewall} objects as a readable object stream. - * - * @method Compute#getFirewallsStream - * @param {object=} query - Configuration object. See - * {@link Compute#getFirewalls} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getFirewallsStream() - * .on('error', console.error) - * .on('data', function(firewall) { - * // `firewall` is a `Firewall` object. - * }) - * .on('end', function() { - * // All firewalls retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getFirewallsStream() - * .on('data', function(firewall) { - * this.end(); - * }); - */ -Compute.prototype.getFirewallsStream = paginator.streamify('getFirewalls'); - -/** - * Get a list of {@link HealthCheck} objects as a readable object - * stream. - * - * @method Compute#getHealthChecksStream - * @param {object=} options - Configuration object. See - * {@link Compute#getHealthChecks} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getHealthChecksStream() - * .on('error', console.error) - * .on('data', function(healthCheck) { - * // `healthCheck` is a `HealthCheck` object. - * }) - * .on('end', function() { - * // All health checks retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getHealthChecksStream() - * .on('data', function(healthCheck) { - * this.end(); - * }); - */ -Compute.prototype.getHealthChecksStream = - paginator.streamify('getHealthChecks'); - -/** - * Get a list of {@link Image} objects as a readable object stream. - * - * @method Compute#getImagesStream - * @param {object=} query - Configuration object. See {@link Compute#getImages} - * for a complete list of options. - * @returns {stream} - * - * @example - * gce.getImagesStream() - * .on('error', console.error) - * .on('data', function(image) { - * // `image` is an `Image` object. - * }) - * .on('end', function() { - * // All images retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getImagesStream() - * .on('data', function(image) { - * this.end(); - * }); - */ -Compute.prototype.getImagesStream = paginator.streamify('getImages'); - -/** - * Get a list of {@link MachineType} objects in this project as a - * readable object stream. - * - * @method Compute#getMachineTypesStream - * @param {object=} options - Configuration object. See - * {@link Compute#getMachineTypes} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getMachineTypesStream() - * .on('error', console.error) - * .on('data', function(machineType) { - * // `machineType` is a `MachineType` object. - * }) - * .on('end', function() { - * // All machine types retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getMachineTypesStream() - * .on('data', function(machineType) { - * this.end(); - * }); - */ -Compute.prototype.getMachineTypesStream = - paginator.streamify('getMachineTypes'); - -/** - * Get a list of {@link Network} objects as a readable object stream. - * - * @method Compute#getNetworksStream - * @param {object=} options - Configuration object. See - * {@link Compute#getNetworks} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getNetworksStream() - * .on('error', console.error) - * .on('data', function(network) { - * // `network` is a `Network` object. - * }) - * .on('end', function() { - * // All networks retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getNetworksStream() - * .on('data', function(network) { - * this.end(); - * }); - */ -Compute.prototype.getNetworksStream = paginator.streamify('getNetworks'); - -/** - * Get a list of global {@link Operation} objects as a readable object - * stream. - * - * @method Compute#getOperationsStream - * @param {object=} options - Configuration object. See - * {@link Compute#getOperations} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getOperationsStream() - * .on('error', console.error) - * .on('data', function(operation) { - * // `operation` is a `Operation` object. - * }) - * .on('end', function() { - * // All operations retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getOperationsStream() - * .on('data', function(operation) { - * this.end(); - * }); - */ -Compute.prototype.getOperationsStream = paginator.streamify('getOperations'); - -/** - * Return the {@link Region} objects available to your project as a - * readable object stream. - * - * @method Compute#getRegionsStream - * @param {object=} options - Configuration object. See - * {@link Compute#getRegions} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getRegionsStream() - * .on('error', console.error) - * .on('data', function(region) { - * // `region` is a `Region` object. - * }) - * .on('end', function() { - * // All regions retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getRegionsStream() - * .on('data', function(region) { - * this.end(); - * }); - */ -Compute.prototype.getRegionsStream = paginator.streamify('getRegions'); - -/** - * Get a list of {@link Rule} objects as a readable object stream. - * - * @method Compute#getRulesStream - * @param {object=} options - Configuration object. See - * {@link Compute#getRules} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getRulesStream() - * .on('error', console.error) - * .on('data', function(rule) { - * // `rule` is a `Rule` object. - * }) - * .on('end', function() { - * // All rules retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getRulesStream() - * .on('data', function(rule) { - * this.end(); - * }); - */ -Compute.prototype.getRulesStream = paginator.streamify('getRules'); - -/** - * Get a list of {@link Service} objects as a readable object stream. - * - * @method Compute#getServicesStream - * @param {object=} options - Configuration object. See - * {@link Compute#getServices} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getServicesStream() - * .on('error', console.error) - * .on('data', function(service) { - * // `service` is a `Service` object. - * }) - * .on('end', function() { - * // All services retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getServicesStream() - * .on('data', function(service) { - * this.end(); - * }); - */ -Compute.prototype.getServicesStream = paginator.streamify('getServices'); - -/** - * Get a list of {@link Snapshot} objects as a readable object stream. - * - * @method Compute#getSnapshotsStream - * @param {object=} options - Configuration object. See - * {@link Compute#getSnapshots} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getSnapshotsStream() - * .on('error', console.error) - * .on('data', function(snapshot) { - * // `snapshot` is a `Snapshot` object. - * }) - * .on('end', function() { - * // All snapshots retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getSnapshotsStream() - * .on('data', function(snapshot) { - * this.end(); - * }); - */ -Compute.prototype.getSnapshotsStream = paginator.streamify('getSnapshots'); - -/** - * Get a list of {@link Subnetwork} objects in this project as a - * readable object stream. - * - * @method Compute#getSubnetworksStream - * @param {object=} options - Configuration object. See - * {@link Compute#getSubnetworks} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getSubnetworksStream() - * .on('error', console.error) - * .on('data', function(subnetwork) { - * // `subnetwork` is a `Subnetwork` object. - * }) - * .on('end', function() { - * // All subnetworks retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getSubnetworksStream() - * .on('data', function(subnetwork) { - * this.end(); - * }); - */ -Compute.prototype.getSubnetworksStream = paginator.streamify('getSubnetworks'); - -/** - * Get a list of {@link VM} instances as a readable object stream. - * - * @method Compute#getVMsStream - * @param {object=} options - Configuration object. See - * {@link Compute#getVMs} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getVMsStream() - * .on('error', console.error) - * .on('data', function(vm) { - * // `vm` is a `VM` object. - * }) - * .on('end', function() { - * // All vms retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getVMsStream() - * .on('data', function(vm) { - * this.end(); - * }); - */ -Compute.prototype.getVMsStream = paginator.streamify('getVMs'); - -/** - * Return the {@link Zone} objects available to your project as a - * readable object stream. - * - * @method Compute#getZonesStream - * @param {object=} options - Configuration object. See - * {@link Compute#getZones} for a complete list of options. - * @returns {stream} - * - * @example - * gce.getZonesStream() - * .on('error', console.error) - * .on('data', function(zone) { - * // `zone` is a `Zone` object. - * }) - * .on('end', function() { - * // All zones retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * gce.getZonesStream() - * .on('data', function(zone) { - * this.end(); - * }); - */ -Compute.prototype.getZonesStream = paginator.streamify('getZones'); - -/*! Developer Documentation - * - * These methods can be auto-paginated. - */ -paginator.extend(Compute, [ - 'getAddresses', - 'getAutoscalers', - 'getDisks', - 'getFirewalls', - 'getImages', - 'getHealthChecks', - 'getInstanceGroups', - 'getMachineTypes', - 'getNetworks', - 'getOperations', - 'getRegions', - 'getRules', - 'getServices', - 'getSnapshots', - 'getSubnetworks', - 'getVMs', - 'getZones', -]); - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Compute, { - exclude: [ - 'address', - 'autoscaler', - 'disk', - 'firewall', - 'image', - 'healthCheck', - 'instanceGroup', - 'machineType', - 'network', - 'operation', - 'project', - 'region', - 'rule', - 'service', - 'snapshot', - 'subnetwork', - 'vm', - 'zone', - ], -}); - -/** - * {@link Firewall} class. - * - * @name Compute.Firewall - * @see Firewall - * @type {constructor} - */ -Compute.Firewall = Firewall; - -/** - * {@link HealthCheck} class. - * - * @name Compute.HealthCheck - * @see HealthCheck - * @type {constructor} - */ -Compute.HealthCheck = HealthCheck; - -/** - * {@link Image} class. - * - * @name Compute.Image - * @see Image - * @type {constructor} - */ -Compute.Image = Image; - -/** - * {@link Network} class. - * - * @name Compute.Network - * @see Network - * @type {constructor} - */ -Compute.Network = Network; - -/** - * {@link Operation} class. - * - * @name Compute.Operation - * @see Operation - * @type {constructor} - */ -Compute.Operation = Operation; - -/** - * {@link Project} class. - * - * @name Compute.Project - * @see Project - * @type {constructor} - */ -Compute.Project = Project; - -/** - * {@link Region} class. - * - * @name Compute.Region - * @see Region - * @type {constructor} - */ -Compute.Region = Region; - -/** - * {@link Rule} class. - * - * @name Compute.Rule - * @see Rule - * @type {constructor} - */ -Compute.Rule = Rule; - -/** - * {@link Service} class. - * - * @name Compute.Service - * @see Service - * @type {constructor} - */ -Compute.Service = Service; - -/** - * {@link Snapshot} class. - * - * @name Compute.Snapshot - * @see Snapshot - * @type {constructor} - */ -Compute.Snapshot = Snapshot; - -/** - * {@link Zone} class. - * - * @name Compute.Zone - * @see Zone - * @type {constructor} - */ -Compute.Zone = Zone; - -/** - * The default export of the `@google-cloud/compute` package is the - * {@link Compute} class. - * - * See {@link Compute} and {@link ClientConfig} for client methods and - * configuration options. - * - * @module {constructor} @google-cloud/compute - * @alias nodejs-compute - * - * @example Install the client library with
npm: - * npm install --save @google-cloud/compute - * - * @example Import the client library - * const Compute = require('@google-cloud/compute'); - * - * @example Create a client that uses Application Default Credentials (ADC): - * const compute = new Compute(); - * - * @example Create a client with explicit credentials: - * const compute = new Compute({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json' - * }); - * - * @example include:samples/quickstart.js - * region_tag:compute_engine_quickstart - * Full quickstart example: - */ -module.exports = Compute; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..41807c9c --- /dev/null +++ b/src/index.ts @@ -0,0 +1,342 @@ +// 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 v1 from './v1'; +const AcceleratorTypesClient = v1.AcceleratorTypesClient; +type AcceleratorTypesClient = v1.AcceleratorTypesClient; +const AddressesClient = v1.AddressesClient; +type AddressesClient = v1.AddressesClient; +const AutoscalersClient = v1.AutoscalersClient; +type AutoscalersClient = v1.AutoscalersClient; +const BackendBucketsClient = v1.BackendBucketsClient; +type BackendBucketsClient = v1.BackendBucketsClient; +const BackendServicesClient = v1.BackendServicesClient; +type BackendServicesClient = v1.BackendServicesClient; +const DisksClient = v1.DisksClient; +type DisksClient = v1.DisksClient; +const DiskTypesClient = v1.DiskTypesClient; +type DiskTypesClient = v1.DiskTypesClient; +const ExternalVpnGatewaysClient = v1.ExternalVpnGatewaysClient; +type ExternalVpnGatewaysClient = v1.ExternalVpnGatewaysClient; +const FirewallPoliciesClient = v1.FirewallPoliciesClient; +type FirewallPoliciesClient = v1.FirewallPoliciesClient; +const FirewallsClient = v1.FirewallsClient; +type FirewallsClient = v1.FirewallsClient; +const ForwardingRulesClient = v1.ForwardingRulesClient; +type ForwardingRulesClient = v1.ForwardingRulesClient; +const GlobalAddressesClient = v1.GlobalAddressesClient; +type GlobalAddressesClient = v1.GlobalAddressesClient; +const GlobalForwardingRulesClient = v1.GlobalForwardingRulesClient; +type GlobalForwardingRulesClient = v1.GlobalForwardingRulesClient; +const GlobalNetworkEndpointGroupsClient = v1.GlobalNetworkEndpointGroupsClient; +type GlobalNetworkEndpointGroupsClient = v1.GlobalNetworkEndpointGroupsClient; +const GlobalOperationsClient = v1.GlobalOperationsClient; +type GlobalOperationsClient = v1.GlobalOperationsClient; +const GlobalOrganizationOperationsClient = + v1.GlobalOrganizationOperationsClient; +type GlobalOrganizationOperationsClient = v1.GlobalOrganizationOperationsClient; +const GlobalPublicDelegatedPrefixesClient = + v1.GlobalPublicDelegatedPrefixesClient; +type GlobalPublicDelegatedPrefixesClient = + v1.GlobalPublicDelegatedPrefixesClient; +const HealthChecksClient = v1.HealthChecksClient; +type HealthChecksClient = v1.HealthChecksClient; +const ImagesClient = v1.ImagesClient; +type ImagesClient = v1.ImagesClient; +const InstanceGroupManagersClient = v1.InstanceGroupManagersClient; +type InstanceGroupManagersClient = v1.InstanceGroupManagersClient; +const InstanceGroupsClient = v1.InstanceGroupsClient; +type InstanceGroupsClient = v1.InstanceGroupsClient; +const InstancesClient = v1.InstancesClient; +type InstancesClient = v1.InstancesClient; +const InstanceTemplatesClient = v1.InstanceTemplatesClient; +type InstanceTemplatesClient = v1.InstanceTemplatesClient; +const InterconnectAttachmentsClient = v1.InterconnectAttachmentsClient; +type InterconnectAttachmentsClient = v1.InterconnectAttachmentsClient; +const InterconnectLocationsClient = v1.InterconnectLocationsClient; +type InterconnectLocationsClient = v1.InterconnectLocationsClient; +const InterconnectsClient = v1.InterconnectsClient; +type InterconnectsClient = v1.InterconnectsClient; +const LicenseCodesClient = v1.LicenseCodesClient; +type LicenseCodesClient = v1.LicenseCodesClient; +const LicensesClient = v1.LicensesClient; +type LicensesClient = v1.LicensesClient; +const MachineTypesClient = v1.MachineTypesClient; +type MachineTypesClient = v1.MachineTypesClient; +const NetworkEndpointGroupsClient = v1.NetworkEndpointGroupsClient; +type NetworkEndpointGroupsClient = v1.NetworkEndpointGroupsClient; +const NetworksClient = v1.NetworksClient; +type NetworksClient = v1.NetworksClient; +const NodeGroupsClient = v1.NodeGroupsClient; +type NodeGroupsClient = v1.NodeGroupsClient; +const NodeTemplatesClient = v1.NodeTemplatesClient; +type NodeTemplatesClient = v1.NodeTemplatesClient; +const NodeTypesClient = v1.NodeTypesClient; +type NodeTypesClient = v1.NodeTypesClient; +const PacketMirroringsClient = v1.PacketMirroringsClient; +type PacketMirroringsClient = v1.PacketMirroringsClient; +const ProjectsClient = v1.ProjectsClient; +type ProjectsClient = v1.ProjectsClient; +const PublicAdvertisedPrefixesClient = v1.PublicAdvertisedPrefixesClient; +type PublicAdvertisedPrefixesClient = v1.PublicAdvertisedPrefixesClient; +const PublicDelegatedPrefixesClient = v1.PublicDelegatedPrefixesClient; +type PublicDelegatedPrefixesClient = v1.PublicDelegatedPrefixesClient; +const RegionAutoscalersClient = v1.RegionAutoscalersClient; +type RegionAutoscalersClient = v1.RegionAutoscalersClient; +const RegionBackendServicesClient = v1.RegionBackendServicesClient; +type RegionBackendServicesClient = v1.RegionBackendServicesClient; +const RegionCommitmentsClient = v1.RegionCommitmentsClient; +type RegionCommitmentsClient = v1.RegionCommitmentsClient; +const RegionDisksClient = v1.RegionDisksClient; +type RegionDisksClient = v1.RegionDisksClient; +const RegionDiskTypesClient = v1.RegionDiskTypesClient; +type RegionDiskTypesClient = v1.RegionDiskTypesClient; +const RegionHealthChecksClient = v1.RegionHealthChecksClient; +type RegionHealthChecksClient = v1.RegionHealthChecksClient; +const RegionHealthCheckServicesClient = v1.RegionHealthCheckServicesClient; +type RegionHealthCheckServicesClient = v1.RegionHealthCheckServicesClient; +const RegionInstanceGroupManagersClient = v1.RegionInstanceGroupManagersClient; +type RegionInstanceGroupManagersClient = v1.RegionInstanceGroupManagersClient; +const RegionInstanceGroupsClient = v1.RegionInstanceGroupsClient; +type RegionInstanceGroupsClient = v1.RegionInstanceGroupsClient; +const RegionInstancesClient = v1.RegionInstancesClient; +type RegionInstancesClient = v1.RegionInstancesClient; +const RegionNetworkEndpointGroupsClient = v1.RegionNetworkEndpointGroupsClient; +type RegionNetworkEndpointGroupsClient = v1.RegionNetworkEndpointGroupsClient; +const RegionNotificationEndpointsClient = v1.RegionNotificationEndpointsClient; +type RegionNotificationEndpointsClient = v1.RegionNotificationEndpointsClient; +const RegionOperationsClient = v1.RegionOperationsClient; +type RegionOperationsClient = v1.RegionOperationsClient; +const RegionsClient = v1.RegionsClient; +type RegionsClient = v1.RegionsClient; +const RegionSslCertificatesClient = v1.RegionSslCertificatesClient; +type RegionSslCertificatesClient = v1.RegionSslCertificatesClient; +const RegionTargetHttpProxiesClient = v1.RegionTargetHttpProxiesClient; +type RegionTargetHttpProxiesClient = v1.RegionTargetHttpProxiesClient; +const RegionTargetHttpsProxiesClient = v1.RegionTargetHttpsProxiesClient; +type RegionTargetHttpsProxiesClient = v1.RegionTargetHttpsProxiesClient; +const RegionUrlMapsClient = v1.RegionUrlMapsClient; +type RegionUrlMapsClient = v1.RegionUrlMapsClient; +const ReservationsClient = v1.ReservationsClient; +type ReservationsClient = v1.ReservationsClient; +const ResourcePoliciesClient = v1.ResourcePoliciesClient; +type ResourcePoliciesClient = v1.ResourcePoliciesClient; +const RoutersClient = v1.RoutersClient; +type RoutersClient = v1.RoutersClient; +const RoutesClient = v1.RoutesClient; +type RoutesClient = v1.RoutesClient; +const SecurityPoliciesClient = v1.SecurityPoliciesClient; +type SecurityPoliciesClient = v1.SecurityPoliciesClient; +const SnapshotsClient = v1.SnapshotsClient; +type SnapshotsClient = v1.SnapshotsClient; +const SslCertificatesClient = v1.SslCertificatesClient; +type SslCertificatesClient = v1.SslCertificatesClient; +const SslPoliciesClient = v1.SslPoliciesClient; +type SslPoliciesClient = v1.SslPoliciesClient; +const SubnetworksClient = v1.SubnetworksClient; +type SubnetworksClient = v1.SubnetworksClient; +const TargetGrpcProxiesClient = v1.TargetGrpcProxiesClient; +type TargetGrpcProxiesClient = v1.TargetGrpcProxiesClient; +const TargetHttpProxiesClient = v1.TargetHttpProxiesClient; +type TargetHttpProxiesClient = v1.TargetHttpProxiesClient; +const TargetHttpsProxiesClient = v1.TargetHttpsProxiesClient; +type TargetHttpsProxiesClient = v1.TargetHttpsProxiesClient; +const TargetInstancesClient = v1.TargetInstancesClient; +type TargetInstancesClient = v1.TargetInstancesClient; +const TargetPoolsClient = v1.TargetPoolsClient; +type TargetPoolsClient = v1.TargetPoolsClient; +const TargetSslProxiesClient = v1.TargetSslProxiesClient; +type TargetSslProxiesClient = v1.TargetSslProxiesClient; +const TargetTcpProxiesClient = v1.TargetTcpProxiesClient; +type TargetTcpProxiesClient = v1.TargetTcpProxiesClient; +const TargetVpnGatewaysClient = v1.TargetVpnGatewaysClient; +type TargetVpnGatewaysClient = v1.TargetVpnGatewaysClient; +const UrlMapsClient = v1.UrlMapsClient; +type UrlMapsClient = v1.UrlMapsClient; +const VpnGatewaysClient = v1.VpnGatewaysClient; +type VpnGatewaysClient = v1.VpnGatewaysClient; +const VpnTunnelsClient = v1.VpnTunnelsClient; +type VpnTunnelsClient = v1.VpnTunnelsClient; +const ZoneOperationsClient = v1.ZoneOperationsClient; +type ZoneOperationsClient = v1.ZoneOperationsClient; +const ZonesClient = v1.ZonesClient; +type ZonesClient = v1.ZonesClient; +export { + v1, + AcceleratorTypesClient, + AddressesClient, + AutoscalersClient, + BackendBucketsClient, + BackendServicesClient, + DisksClient, + DiskTypesClient, + ExternalVpnGatewaysClient, + FirewallPoliciesClient, + FirewallsClient, + ForwardingRulesClient, + GlobalAddressesClient, + GlobalForwardingRulesClient, + GlobalNetworkEndpointGroupsClient, + GlobalOperationsClient, + GlobalOrganizationOperationsClient, + GlobalPublicDelegatedPrefixesClient, + HealthChecksClient, + ImagesClient, + InstanceGroupManagersClient, + InstanceGroupsClient, + InstancesClient, + InstanceTemplatesClient, + InterconnectAttachmentsClient, + InterconnectLocationsClient, + InterconnectsClient, + LicenseCodesClient, + LicensesClient, + MachineTypesClient, + NetworkEndpointGroupsClient, + NetworksClient, + NodeGroupsClient, + NodeTemplatesClient, + NodeTypesClient, + PacketMirroringsClient, + ProjectsClient, + PublicAdvertisedPrefixesClient, + PublicDelegatedPrefixesClient, + RegionAutoscalersClient, + RegionBackendServicesClient, + RegionCommitmentsClient, + RegionDisksClient, + RegionDiskTypesClient, + RegionHealthChecksClient, + RegionHealthCheckServicesClient, + RegionInstanceGroupManagersClient, + RegionInstanceGroupsClient, + RegionInstancesClient, + RegionNetworkEndpointGroupsClient, + RegionNotificationEndpointsClient, + RegionOperationsClient, + RegionsClient, + RegionSslCertificatesClient, + RegionTargetHttpProxiesClient, + RegionTargetHttpsProxiesClient, + RegionUrlMapsClient, + ReservationsClient, + ResourcePoliciesClient, + RoutersClient, + RoutesClient, + SecurityPoliciesClient, + SnapshotsClient, + SslCertificatesClient, + SslPoliciesClient, + SubnetworksClient, + TargetGrpcProxiesClient, + TargetHttpProxiesClient, + TargetHttpsProxiesClient, + TargetInstancesClient, + TargetPoolsClient, + TargetSslProxiesClient, + TargetTcpProxiesClient, + TargetVpnGatewaysClient, + UrlMapsClient, + VpnGatewaysClient, + VpnTunnelsClient, + ZoneOperationsClient, + ZonesClient, +}; +export default { + v1, + AcceleratorTypesClient, + AddressesClient, + AutoscalersClient, + BackendBucketsClient, + BackendServicesClient, + DisksClient, + DiskTypesClient, + ExternalVpnGatewaysClient, + FirewallPoliciesClient, + FirewallsClient, + ForwardingRulesClient, + GlobalAddressesClient, + GlobalForwardingRulesClient, + GlobalNetworkEndpointGroupsClient, + GlobalOperationsClient, + GlobalOrganizationOperationsClient, + GlobalPublicDelegatedPrefixesClient, + HealthChecksClient, + ImagesClient, + InstanceGroupManagersClient, + InstanceGroupsClient, + InstancesClient, + InstanceTemplatesClient, + InterconnectAttachmentsClient, + InterconnectLocationsClient, + InterconnectsClient, + LicenseCodesClient, + LicensesClient, + MachineTypesClient, + NetworkEndpointGroupsClient, + NetworksClient, + NodeGroupsClient, + NodeTemplatesClient, + NodeTypesClient, + PacketMirroringsClient, + ProjectsClient, + PublicAdvertisedPrefixesClient, + PublicDelegatedPrefixesClient, + RegionAutoscalersClient, + RegionBackendServicesClient, + RegionCommitmentsClient, + RegionDisksClient, + RegionDiskTypesClient, + RegionHealthChecksClient, + RegionHealthCheckServicesClient, + RegionInstanceGroupManagersClient, + RegionInstanceGroupsClient, + RegionInstancesClient, + RegionNetworkEndpointGroupsClient, + RegionNotificationEndpointsClient, + RegionOperationsClient, + RegionsClient, + RegionSslCertificatesClient, + RegionTargetHttpProxiesClient, + RegionTargetHttpsProxiesClient, + RegionUrlMapsClient, + ReservationsClient, + ResourcePoliciesClient, + RoutersClient, + RoutesClient, + SecurityPoliciesClient, + SnapshotsClient, + SslCertificatesClient, + SslPoliciesClient, + SubnetworksClient, + TargetGrpcProxiesClient, + TargetHttpProxiesClient, + TargetHttpsProxiesClient, + TargetInstancesClient, + TargetPoolsClient, + TargetSslProxiesClient, + TargetTcpProxiesClient, + TargetVpnGatewaysClient, + UrlMapsClient, + VpnGatewaysClient, + VpnTunnelsClient, + ZoneOperationsClient, + ZonesClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/src/instance-group-manager.js b/src/instance-group-manager.js deleted file mode 100644 index 64902b0b..00000000 --- a/src/instance-group-manager.js +++ /dev/null @@ -1,414 +0,0 @@ -/*! - * Copyright 2016 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 arrify = require('arrify'); -const common = require('@google-cloud/common'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * A managed instance group uses an instance template to create a group of identical instances. - * You control a managed instance group as a single entity. - * - * @see [Creating Groups of Instances]{@link https://cloud.google.com/compute/docs/instance-groups} - * @see [Managed Instance Groups]{@link https://cloud.google.com/compute/docs/instance-groups/#managed_instance_groups} - * - * @class - * @param {Zone} zone - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - */ -class InstanceGroupManager extends common.ServiceObject { - constructor(zone, name) { - const methods = { - /** - * Check if the instance group manager exists. - * - * @method InstanceGroupManager#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the instance group manager exists or - * not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - * - * instanceGroupManager.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroupManager.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get an instance group manager if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method InstanceGroupManager#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - * - * instanceGroupManager.get(function(err, instanceGroupManager, apiResponse) { - * // `instanceGroupManager` is an InstanceGroupManager object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroupManager.get().then(function(data) { - * const instanceGroupManager = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the instance group manager's metadata. - * - * @see [InstanceGroupManagers: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers/get} - * @see [InstanceGroupManagers Resource]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers} - * - * @method InstanceGroupManager#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The instance group manager's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - * - * instanceGroupManager.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroupManager.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: zone, - baseUrl: '/instanceGroupManagers', - /** - * @name InstanceGroupManager#id - * @type {string} - */ - id: name, - // createMethod: zone.createInstanceGroupManager.bind(zone), - methods: methods, - pollIntervalMs: zone.compute.pollIntervalMs, - }); - /** - * The parent {@link Zone} instance of this {@link InstanceGroup} instance. - * @name InstanceGroup#zone - * @type {Zone} - */ - this.zone = zone; - /** - * @name InstanceGroup#name - * @type {string} - */ - this.name = name; - } - /** - * Flags the specified instances to be removed from the managed instance group. - * @see [InstanceGroupManagers: abandonInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers/abandonInstances} - * @param {VM|VM[]} vms - VM instances to abandon from - * this instance group manager. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - * - * const vms = [ - * gce.zone('us-central1-a').vm('http-server'), - * gce.zone('us-central1-a').vm('https-server') - * ]; - * - * instanceGroupManager.abandonInstances(vms, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroupManager.abandonInstances(vms).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - abandonInstances(vms, callback) { - this.request( - { - method: 'POST', - uri: '/abandonInstances', - json: { - instances: arrify(vms).map(vm => vm.url), - }, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = this.zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } - /** - * Flags the specified instances in the managed instance group for immediate deletion. - * @see [InstanceGroupManagers: deleteInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers/deleteInstances} - * @param {VM|VM[]} vms - VM instances to delete from - * this instance group manager. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - * - * const vms = [ - * gce.zone('us-central1-a').vm('http-server'), - * gce.zone('us-central1-a').vm('https-server') - * ]; - * - * instanceGroupManager.deleteInstances(vms, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroupManager.deleteInstances(vms).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - deleteInstances(vms, callback) { - this.request( - { - method: 'POST', - uri: '/deleteInstances', - json: { - instances: arrify(vms).map(vm => vm.url), - }, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = this.zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } - /** - * Get a list of managed VM instances in this instance group manager. - * - * @see [InstanceGroupManagers: listManagedInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers/listManagedInstances} - * - * @param {object=} options - Instance search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of VMs to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {VM[]} callback.vms - VM objects from this instance - * group. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - * - * instanceGroupManager.getManagedInstances(function(err, vms) { - * // `vms` is an array of `VM` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, vms, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * instanceGroupManager.getManagedInstances(nextQuery, callback); - * } - * } - * - * instanceGroupManager.getManagedInstances({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroupManager.getManagedInstances().then(function(data) { - * const vms = data[0]; - * }); - */ - getManagedInstances(options, callback) { - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - method: 'POST', - uri: '/listManagedInstances', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const vms = arrify(resp.managedInstances).map(vm => { - const vmInstance = this.zone.vm(vm.instance); - vmInstance.metadata = vm; - return vmInstance; - }); - callback(null, vms, nextQuery, resp); - } - ); - } - /** - * Resizes the managed instance group. - * - * @see [InstanceGroupManagers: resize API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers/resize} - * - * @param {number} size - The number of running instances that the managed instance group should maintain at any given time. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroupManager = zone.instanceGroupManager('web-servers'); - * - * instanceGroupManager.resize(2, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroupManager.resize(2).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - resize(size, callback) { - this.request( - { - method: 'POST', - uri: '/resize', - qs: {size: size}, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = this.zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(InstanceGroupManager); - -module.exports = InstanceGroupManager; diff --git a/src/instance-group.js b/src/instance-group.js deleted file mode 100644 index d8b2d7bc..00000000 --- a/src/instance-group.js +++ /dev/null @@ -1,579 +0,0 @@ -/*! - * Copyright 2016 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 arrify = require('arrify'); -const common = require('@google-cloud/common'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); -const {paginator} = require('@google-cloud/paginator'); - -/** - * You can create and manage groups of virtual machine instances so that you - * don't have to individually control each instance in your project. - * - * @see [Creating Groups of Instances]{@link https://cloud.google.com/compute/docs/instance-groups} - * @see [Unmanaged Instance Groups]{@link https://cloud.google.com/compute/docs/instance-groups/creating-groups-of-unmanaged-instances} - * - * @class - * @param {Zone} zone - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - */ -class InstanceGroup extends common.ServiceObject { - constructor(zone, name) { - const methods = { - /** - * Create an instance group. - * - * @method InstanceGroup#create - * @param {object=} options - See {@link Zone#createInstanceGroup}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * function onCreated(err, instanceGroup, operation, apiResponse) { - * // `instanceGroup` is an InstanceGroup object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * } - * - * instanceGroup.create(onCreated); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.create().then(function(data) { - * const instanceGroup = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the instance group exists. - * - * @method InstanceGroup#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the instance group exists or - * not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * instanceGroup.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get an instance group if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method InstanceGroup#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * instanceGroup.get(function(err, instanceGroup, apiResponse) { - * // `instanceGroup` is an InstanceGroup object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.get().then(function(data) { - * const instanceGroup = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the instance group's metadata. - * - * @see [InstanceGroups: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/get} - * @see [InstanceGroups Resource]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups} - * - * @method InstanceGroup#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The instance group's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * instanceGroup.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: zone, - baseUrl: '/instanceGroups', - /** - * @name InstanceGroup#id - * @type {string} - */ - id: name, - createMethod: zone.createInstanceGroup.bind(zone), - methods: methods, - pollIntervalMs: zone.compute.pollIntervalMs, - }); - /** - * The parent {@link Zone} instance of this {@link InstanceGroup} instance. - * @name InstanceGroup#zone - * @type {Zone} - */ - this.zone = zone; - /** - * @name InstanceGroup#name - * @type {string} - */ - this.name = name; - } - /** - * Add one or more VMs to this instance group. - * - * @see [InstanceGroups: addInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/addInstances} - * - * @param {VM|VM[]} vms - VM instances to add to - * this instance group. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * const vms = [ - * gce.zone('us-central1-a').vm('http-server'), - * gce.zone('us-central1-a').vm('https-server') - * ]; - * - * instanceGroup.add(vms, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.add(vms).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - add(vms, callback) { - const self = this; - this.request( - { - method: 'POST', - uri: '/addInstances', - json: { - instances: arrify(vms).map(vm => { - return { - instance: vm.url, - }; - }), - }, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = self.zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } - /** - * Delete the instance group. - * - * @see [InstanceGroups: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * instanceGroup.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - const self = this; - callback = callback || common.util.noop; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = self.zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Get a list of VM instances in this instance group. - * - * @see [InstanceGroups: listInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/listInstances} - * - * @param {object=} options - Instance search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of VMs to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {boolean} options.running - Only return instances which are running. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {VM[]} callback.vms - VM objects from this instance - * group. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * instanceGroup.getVMs(function(err, vms) { - * // `vms` is an array of `VM` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, vms, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * instanceGroup.getVMs(nextQuery, callback); - * } - * } - * - * instanceGroup.getVMs({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.getVMs().then(function(data) { - * const vms = data[0]; - * }); - */ - getVMs(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - let body; - if (options.running) { - body = { - instanceState: 'RUNNING', - }; - } - this.request( - { - method: 'POST', - uri: '/listInstances', - qs: options, - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const vms = arrify(resp.items).map(vm => { - const vmInstance = self.zone.vm(vm.instance); - vmInstance.metadata = vm; - return vmInstance; - }); - callback(null, vms, nextQuery, resp); - } - ); - } - /** - * Remove one or more VMs from this instance group. - * - * @see [InstanceGroups: removeInstances API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/removeInstances} - * - * @param {VM|VM[]} vms - VM instances to remove - * from this instance group. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * const vms = [ - * gce.zone('us-central1-a').vm('http-server'), - * gce.zone('us-central1-a').vm('https-server') - * ]; - * - * instanceGroup.remove(vms, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.remove(vms).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - remove(vms, callback) { - const self = this; - this.request( - { - method: 'POST', - uri: '/removeInstances', - json: { - instances: arrify(vms).map(vm => { - return { - instance: vm.url, - }; - }), - }, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = self.zone.operation(resp.name); - operation.metadata = resp; - callback(err, operation, resp); - } - ); - } - /** - * Set the named ports for this instance group. - * - * @see [InstanceGroups: setNamedPorts API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/setNamedPorts} - * - * @param {object} ports - A map of names to ports. The key should be the name, - * and the value the port number. - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * const ports = { - * http: 80, - * https: 443 - * }; - * - * instanceGroup.setPorts(ports, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * instanceGroup.setPorts(ports).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setPorts(ports, callback) { - const self = this; - callback = callback || common.util.noop; - this.request( - { - method: 'POST', - uri: '/setNamedPorts', - json: { - namedPorts: InstanceGroup.formatPorts_(ports), - }, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = self.zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } - /** - * Format a map of named ports in the way the API expects. - * - * @private - * - * @param {object} ports - A map of names to ports. The key should be the name, - * and the value the port number. - * @returns {object[]} - The formatted array of named ports. - */ - static formatPorts_(ports) { - return Object.keys(ports).map(port => { - return { - name: port, - port: ports[port], - }; - }); - } -} - -/** - * Get a list of {@link VM} instances in this instance group as a - * readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link InstanceGroup#getVMs} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * const instanceGroup = zone.instanceGroup('web-servers'); - * - * instanceGroup.getVMsStream() - * .on('error', console.error) - * .on('data', function(vm) { - * // `vm` is a `VM` object. - * }) - * .on('end', function() { - * // All instances retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * instanceGroup.getVMsStream() - * .on('data', function(vm) { - * this.end(); - * }); - */ -InstanceGroup.prototype.getVMsStream = paginator.streamify('getVMs'); - -/*! Developer Documentation - * - * These methods can be auto-paginated. - */ -paginator.extend(InstanceGroup, ['getVMs']); - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(InstanceGroup); - -module.exports = InstanceGroup; diff --git a/src/machine-type.js b/src/machine-type.js deleted file mode 100644 index 39f0f541..00000000 --- a/src/machine-type.js +++ /dev/null @@ -1,147 +0,0 @@ -/*! - * Copyright 2016 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 common = require('@google-cloud/common'); - -/** - * A MachineType object allows you to interact with a Google Compute Engine - * machine type. - * - * @see [Machine Types Overview]{@link https://cloud.google.com/compute/docs/machine-types} - * @see [MachineType Resource]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes} - * - * @class - * @param {Zone} zone - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-b'); - * const machineType = zone.machineType('g1-small'); - */ -class MachineType extends common.ServiceObject { - constructor(zone, name) { - const methods = { - /** - * Check if the machine type exists. - * - * @method MachineType#create - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the machine type exists or - * not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-b'); - * const machineType = zone.machineType('g1-small'); - * - * machineType.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * machineType.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a machine type if it exists. - * - * @method MachineType#get - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-b'); - * const machineType = zone.machineType('g1-small'); - * - * machineType.get(function(err, machineType, apiResponse) { - * // `machineType` is a MachineType object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * machineType.get().then(function(data) { - * const machineType = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the machine type's metadata. - * - * @see [MachineTypes: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes/get} - * @see [MachineType Resource]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes} - * - * @method MachineType#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The machine type's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-b'); - * const machineType = zone.machineType('g1-small'); - * - * machineType.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * machineType.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: zone, - baseUrl: '/machineTypes', - /** - * @name MachineType#id - * @type {string} - */ - id: name, - methods: methods, - pollIntervalMs: zone.compute.pollIntervalMs, - }); - /** - * The parent {@link Zone} instance of this {@link MachineType} instance. - * @name MachineType#zone - * @type {Zone} - */ - this.zone = zone; - /** - * @name MachineType#name - * @type {string} - */ - this.name = name; - } -} - -module.exports = MachineType; diff --git a/src/network.js b/src/network.js deleted file mode 100644 index c15af2a4..00000000 --- a/src/network.js +++ /dev/null @@ -1,609 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const format = require('string-format-obj'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * A Network object allows you to interact with a Google Compute Engine network. - * - * @see [Networks Overview]{@link https://cloud.google.com/compute/docs/networking#networks} - * @see [Network Resource]{@link https://cloud.google.com/compute/docs/reference/v1/networks} - * - * @class - * @param {Compute} compute - * @param {strign} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - */ -class Network extends common.ServiceObject { - constructor(compute, name) { - const methods = { - /** - * Create a network. - * - * @method Network#create - * @param {object} config - See {@link Compute#createNetwork}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * const config = { - * // ... - * }; - * - * network.create(config, function(err, network, operation, apiResponse) { - * // `network` is a Network object. - * - * // `operation` is an Operation object that can be used to check the - * // status of network creation. - * }); - * - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.create(config).then(function(data) { - * const network = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the network exists. - * - * @method Network#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the network exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a network if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Network#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.get(function(err, network, apiResponse) { - * // `network` is a Network object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.get().then(function(data) { - * const network = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the network's metadata. - * - * @see [Network Resource]{@link https://cloud.google.com/compute/docs/reference/v1/networks} - * @see [Networks: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/networks/delete} - * - * @method Network#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The network's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: compute, - baseUrl: '/global/networks', - /** - * @name Network#id - * @type {string} - */ - id: name, - createMethod: compute.createNetwork.bind(compute), - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - /** - * The parent {@link Compute} instance of this {@link Network} instance. - * @name Network#compute - * @type {Compute} - */ - this.compute = compute; - /** - * @name Network#formattedName - * @type {string} - */ - this.formattedName = Network.formatName_(compute, name); - /** - * @name Network#name - * @type {string} - */ - this.name = name; - } - /** - * Create a firewall for this network. - * - * @see [Firewalls Overview]{@link https://cloud.google.com/compute/docs/networking#firewalls} - * @see [Firewalls: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls/insert} - * - * @param {string} name - Name of the firewall. - * @param {object} config - See a - * [Firewall resource](https://cloud.google.com/compute/docs/reference/v1/firewalls#resource). - * @param {object} config.protocols - A map of protocol to port range. The keys - * of the object refer to a protocol (e.g. `tcp`, `udp`) and the value for - * the key are the ports/port-ranges that are allowed to make a connection. - * @param {string[]} config.ranges - The IP address blocks that this rule - * applies to, expressed in - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * format. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Firewall} callback.firewall - The created Firewall - * object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * const config = { - * protocols: { - * tcp: [3000], - * udp: [] // An empty array means all ports are allowed. - * }, - * - * ranges: ['0.0.0.0/0'] - * }; - * - * function callback(err, firewall, operation, apiResponse) { - * // `firewall` is a Firewall object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * network.createFirewall('new-firewall-name', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.createFirewall('new-firewall-name', config).then(function(data) { - * const firewall = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createFirewall(name, config, callback) { - config = Object.assign({}, config, { - network: this.formattedName, - }); - this.compute.createFirewall(name, config, callback); - } - /** - * Create a subnetwork in this network. - * - * @see [Subnetwork Resource]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks#resource} - * @see [Subnetwork: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks/insert} - * - * @param {string} name - Name of the subnetwork. - * @param {object} config - See a - * [Subnetwork resource](https://cloud.google.com/compute/docs/reference/v1/subnetworks#resource). - * @param {Region|string} config.region - The region where the - * Subnetwork resides. - * @param {string} config.range - The range of internal addresses that - * are owned by this subnetwork. - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) range - * of addresses that are legal on this network. (Alias for - * `config.ipCidrRange`) - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Subnetwork} callback.subnetwork - The created - * Subnetwork object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * const region = compute.region('us-east1'); - * - * const config = { - * region: region, - * range: '10.0.1.0/24' - * }; - * - * function callback(err, subnetwork, operation, apiResponse) { - * // `subnetwork` is a Subnetwork object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * network.createSubnetwork('new-subnetwork-name', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.createSubnetwork('new-subnetwork-name', config).then(function(data) { - * const subnetwork = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createSubnetwork(name, config, callback) { - config = Object.assign({}, config, { - network: this.formattedName, - }); - let region = config.region; - if (is.string(region)) { - region = this.compute.region(region); - } - delete config.region; - region.createSubnetwork(name, config, callback); - } - /** - * Get a list of subnetworks in this network. - * - * @see [Subnetworks Overview]{@link https://cloud.google.com/compute/docs/subnetworks} - * @see [Subnetworks: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks} - * - * @param {object=} options - Subnetwork search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of subnetworks to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Subnetwork[]} callback.subnetworks - Subnetwork - * objects from this network. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.getSubnetworks(function(err, subnetworks) { - * // `subnetworks` is an array of `Subnetworks` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, subnetworks, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * network.getSubnetworks(nextQuery, callback); - * } - * } - * - * network.getSubnetworks({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.getSubnetworks().then(function(data) { - * const subnetworks = data[0]; - * }); - */ - getSubnetworks(options, callback) { - if (is.fn(options)) { - callback = options; - options = {}; - } - options = Object.assign({}, options, { - filter: 'network eq .*' + this.formattedName, - }); - this.compute.getSubnetworks(options, callback); - } - /** - * Get a {@link Subnetwork} list within this network as a readable - * object stream. - * - * @param {object=} options - Configuration object. See - * {@link Network#getSubnetworks} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.getSubnetworksStream() - * .on('error', console.error) - * .on('data', function(subnetwork) { - * // `subnetwork` is a `Subnetwork` object. - * }) - * .on('end', function() { - * // All subnetworks retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * network.getSubnetworksStream() - * .on('data', function(subnetwork) { - * this.end(); - * }); - */ - getSubnetworksStream(options) { - options = Object.assign({}, options, { - filter: 'network eq .*' + this.formattedName, - }); - return this.compute.getSubnetworksStream(options); - } - /** - * Delete the network. - * - * @see [Networks: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/networks/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - const compute = this.compute; - callback = callback || common.util.noop; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Get a reference to a Google Compute Engine firewall in this network. - * - * @see [Firewalls Overview]{@link https://cloud.google.com/compute/docs/networking#firewalls} - * - * @param {string} name - Name of the firewall. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * const firewall = network.firewall('firewall-name'); - */ - firewall(name) { - const firewall = this.compute.firewall(name); - firewall.metadata = { - network: this.formattedName, - }; - return firewall; - } - /** - * Get a list of firewalls for this network. - * - * @see [Firewalls Overview]{@link https://cloud.google.com/compute/docs/networking#firewalls} - * @see [Firewalls: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/firewalls/list} - * - * @param {object=} options - Firewall search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of firewalls to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Firewall[]} callback.firewalls - Firewall objects from - * this network. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.getFirewalls(function(err, firewalls) { - * // `firewalls` is an array of `Firewall` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, firewalls, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * network.getFirewalls(nextQuery, callback); - * } - * } - * - * network.getFirewalls({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * network.getFirewalls().then(function(data) { - * const firewalls = data[0]; - * }); - */ - getFirewalls(options, callback) { - if (is.fn(options)) { - callback = options; - options = {}; - } - options = Object.assign({}, options, { - filter: 'network eq .*' + this.formattedName, - }); - this.compute.getFirewalls(options, callback); - } - /** - * Get a list of {@link Firewall} objects for this network as a - * readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link Network#getFirewalls} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const network = compute.network('network-name'); - * - * network.getFirewallsStream() - * .on('error', console.error) - * .on('data', function(firewall) { - * // `firewall` is a `Firewall` object. - * }) - * .on('end', function() { - * // All firewalls retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * network.getFirewallsStream() - * .on('data', function(firewall) { - * this.end(); - * }); - */ - getFirewallsStream(options) { - options = Object.assign({}, options, { - filter: 'network eq .*' + this.formattedName, - }); - return this.compute.getFirewallsStream(options); - } - /** - * Format a network's name how the API expects. - * - * @private - * - * @param {Compute} compute - The Compute object this network belongs to. - * @param {string} name - The name of the network. - * @returns {string} - The formatted name. - */ - static formatName_(compute, name) { - return format('projects/{projectId}/global/networks/{name}', { - projectId: compute.projectId, - name: name, - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Network, { - exclude: ['firewall'], -}); - -/** - * Reference to the {@link Network} class. - * @name module:@google-cloud/compute.Network - * @see Network - */ -module.exports = Network; diff --git a/src/operation.js b/src/operation.js deleted file mode 100644 index 30535626..00000000 --- a/src/operation.js +++ /dev/null @@ -1,283 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * An Operation object allows you to interact with a Google Compute Engine - * operation. - * - * An operation can be a - * [GlobalOperation](https://cloud.google.com/compute/docs/reference/v1/globalOperations), - * [RegionOperation](https://cloud.google.com/compute/docs/reference/v1/regionOperations), - * or - * [ZoneOperation](https://cloud.google.com/compute/docs/reference/v1/zoneOperations). - * - * @class - * @param {Compute|Zone|Region} scope The scope of the operation: a `Compute`, - * `Zone`, or `Region` object. - * @param {string} name Operation name. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * - * //- - * // Reference a global operation. - * //- - * const operation = compute.operation('operation-id'); - * - * //- - * // Reference a region operation. - * //- - * const region = compute.region('us-central1'); - * const operation = region.operation('operation-id'); - * - * //- - * // Reference a zone operation. - * //- - * const zone = compute.zone('us-central1-a'); - * const operation = zone.operation('operation-id'); - * - * //- - * // All operations are event emitters. The status of each operation is polled - * // continuously, starting only after you register a "complete" listener. - * //- - * operation.on('complete', function(metadata) { - * // The operation is complete. - * }); - * - * //- - * // You can register a listener to monitor when the operation begins running. - * //- - * operation.on('running', function(metadata) { - * // The operation is running. - * }); - * - * //- - * // Be sure to register an error handler as well to catch any issues which - * // impeded the operation. - * //- - * operation.on('error', function(err) { - * // An error occurred during the operation. - * }); - * - * //- - * // To force the Operation object to stop polling for updates, simply remove - * // any "complete" listeners you've registered. - * // - * // The easiest way to do this is with `removeAllListeners()`. - * //- - * operation.removeAllListeners(); - */ -class Operation extends common.Operation { - constructor(scope, name) { - const isCompute = scope.constructor.name === 'Compute'; - const methods = { - /** - * Delete the operation. - * - * @see [GlobalOperations: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalOperations/delete} - * @see [RegionOperations: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/regionOperations/delete} - * @see [ZoneOperations: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/zoneOperations/delete} - * - * @method Operation#delete - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const operation = compute.operation('operation-id'); - * - * operation.delete(function(err, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * operation.delete().then(function(data) { - * var apiResponse = data[0]; - * }); - */ - delete: true, - /** - * Check if the operation exists. - * - * @method Operation#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the operation exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const operation = compute.operation('operation-id'); - * - * operation.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * operation.exists().then(function(data) { - * var exists = data[0]; - * }); - */ - exists: true, - /** - * Get an operation if it exists. - * - * @method Operation#get - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const operation = compute.operation('operation-id'); - * - * operation.get(function(err, operation, apiResponse) { - * // `operation` is an Operation object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * operation.get().then(function(data) { - * var operation = data[0]; - * var apiResponse = data[1]; - * }); - */ - get: true, - }; - super({ - parent: scope, - baseUrl: isCompute ? '/global/operations' : '/operations', - /** - * @name Operation#id - * @type {string} - */ - id: name, - methods: methods, - pollIntervalMs: isCompute - ? scope.pollIntervalMs - : scope.compute.pollIntervalMs, - }); - - /** - * @name Operation#name - * @type {string} - */ - this.name = name; - } - /** - * Get the operation's metadata. For a detailed description of metadata see - * [Operation resource](https://goo.gl/sWm1rt). - * - * @see [GlobalOperations: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalOperations/get} - * @see [RegionOperations: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/regionOperations/get} - * @see [ZoneOperations: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/zoneOperations/get} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request - * @param {object} callback.metadata - The disk's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * - * operation.getMetadata(function(err, metadata, apiResponse) { - * // `metadata.error`: Contains errors if the operation failed. - * // `metadata.warnings`: Contains warnings. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * operation.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata(callback) { - const self = this; - callback = callback || common.util.noop; - super.getMetadata((err, apiResponse) => { - // An Operation entity contains a property named `error`. This makes - // `request` think the operation failed, and will return an ApiError to - // this callback. We have to make sure this isn't a false error by seeing if - // the response body contains a property that wouldn't exist on a failed API - // request (`name`). - const requestFailed = - err && (!apiResponse || apiResponse.name !== self.name); - if (requestFailed) { - callback(err, null, apiResponse); - return; - } - self.metadata = apiResponse; - callback(null, self.metadata, apiResponse); - }); - } - /** - * Poll `getMetadata` to check the operation's status. This runs a loop to ping - * the API on an interval. - * - * Note: This method is automatically called once a "complete" event handler is - * registered on the operation. - * - * @private - */ - poll_(callback) { - const self = this; - this.getMetadata((err, metadata, apiResponse) => { - // Parsing the response body will automatically create an ApiError object if - // the operation failed. - const parsedHttpRespBody = common.util.parseHttpRespBody(apiResponse); - err = err || parsedHttpRespBody.err; - if (err) { - callback(err); - return; - } - if (metadata.status === 'RUNNING' && !self.status) { - self.status = metadata.status; - self.emit('running', metadata); - } - if (metadata.status !== 'DONE') { - callback(); - return; - } - self.status = metadata.status; - callback(null, metadata); - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Operation); - -/** - * Reference to the {@link Operation} class. - * @name module:@google-cloud/compute.Operation - * @see Operation - */ -module.exports = Operation; diff --git a/src/project.js b/src/project.js deleted file mode 100644 index e263a014..00000000 --- a/src/project.js +++ /dev/null @@ -1,115 +0,0 @@ -/*! - * 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * A Project object allows you to interact with your Google Compute Engine - * project. - * - * @see [Projects Overview]{@link https://cloud.google.com/compute/docs/projects} - * @see [Projects Resource]{@link https://cloud.google.com/compute/docs/reference/v1/projects} - * - * @class - * @param {Compute} compute - Compute object this project belongs to. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const project = compute.project(); - */ -class Project extends common.ServiceObject { - constructor(compute) { - const methods = { - /** - * Get a Project object. - * - * @method Project#get - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const project = compute.project(); - * - * project.get(function(err, project, apiResponse) { - * // `project` is a Project object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * project.get().then(function(data) { - * const project = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the project's metadata. - * - * @see [Projects: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/projects/get} - * @see [Projects Resource]{@link https://cloud.google.com/compute/docs/reference/v1/projects} - * - * @method Project#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The machine type's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const project = compute.project(); - * - * project.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * project.getMetadata().then(function(data) { - * var metadata = data[0]; - * var apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: compute, - baseUrl: '', - id: '', - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Project); - -/** - * Reference to the {@link Project} class. - * @name module:@google-cloud/compute.Project - * @see Project - */ -module.exports = Project; diff --git a/src/region.js b/src/region.js deleted file mode 100644 index b295b802..00000000 --- a/src/region.js +++ /dev/null @@ -1,948 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); -const {paginator} = require('@google-cloud/paginator'); - -const Address = require('./address.js'); -const Network = require('./network.js'); -const Operation = require('./operation.js'); -const Rule = require('./rule.js'); -const Subnetwork = require('./subnetwork.js'); - -/** - * A Region object allows you to interact with a Google Compute Engine region. - * - * @see [Regions & Zones Overview]{@link https://cloud.google.com/compute/docs/zones} - * @see [Region Resource]{@link https://cloud.google.com/compute/docs/reference/v1/regions} - * - * @class - * @param {Compute} compute - * @param {string} name - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - */ -class Region extends common.ServiceObject { - constructor(compute, name) { - const methods = { - /** - * Check if the region exists. - * - * @method Region#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the region exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a region. - * - * @method Region#get - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.get(function(err, region, apiResponse) { - * // `region` is a Region object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.get().then(function(data) { - * const region = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the region's metadata. - * - * @see [Region Resource]{@link https://cloud.google.com/compute/docs/reference/v1/regions} - * @see [Regions: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/regions/get} - * - * @method Region#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The region's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: compute, - baseUrl: '/regions', - /** - * @name Region#id - * @type {string} - */ - id: name, - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - /** - * @name Region#name - * @type {string} - */ - this.name = name; - this.compute = compute; - this.interceptors.push({ - request: function (reqOpts) { - if (reqOpts.uri.indexOf('/global/forwardingRules') > -1) { - reqOpts.uri = reqOpts.uri.replace('/global', ''); - } - return reqOpts; - }, - }); - } - /** - * Get a reference to a Google Compute Engine address in this region. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * - * @param {string} name - Name of the address. - * @returns {Address} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * const address = region.address('address-name'); - */ - address(name) { - return new Address(this, name); - } - /** - * Create an address in this region. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * @see [Address Resource]{@link https://cloud.google.com/compute/docs/reference/v1/addresses} - * @see [Addresses: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/addresses/insert} - * - * @param {string} name - Name of the address. - * @param {object=} options - See an - * [Address resource](https://cloud.google.com/compute/docs/reference/v1/addresses). - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Address} callback.address - The created Address - * object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * function callback(err, address, operation, apiResponse) { - * // `address` is an Address object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * region.createAddress('new-address', callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.createAddress('new-address').then(function(data) { - * const address = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createAddress(name, options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - this.request( - { - method: 'POST', - uri: '/addresses', - json: Object.assign({}, options, { - name: name, - }), - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const address = self.address(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, address, operation, resp); - } - ); - } - /** - * Create a subnetwork in this region. - * - * @see [Subnetwork Resource]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks#resource} - * @see [Subnetwork: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks/insert} - * - * @param {string} name - Name of the subnetwork. - * @param {object} config - See a - * [Subnetwork resource](https://cloud.google.com/compute/docs/reference/v1/subnetworks#resource). - * @param {Network|string} config.network - The network to which - * this subnetwork belongs. **Only networks that are in the distributed mode - * can have subnetworks.** - * @param {string} config.range - The range of internal addresses that - * are owned by this subnetwork. [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) range - * of addresses that are legal on this network. (Alias for - * `config.ipCidrRange`) - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Subnetwork} callback.subnetwork - The created - * Subnetwork object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * const config = { - * network: 'network1', - * range: '10.0.1.0/24' - * }; - * - * function callback(err, subnetwork, operation, apiResponse) { - * // `subnetwork` is a Subnetwork object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * region.createSubnetwork('new-subnetwork-name', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.createSubnetwork('new-subnetwork-name', config).then(function(data) { - * const subnetwork = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createSubnetwork(name, config, callback) { - const self = this; - const body = Object.assign({}, config, { - name: name, - }); - if (body.network instanceof Network) { - body.network = body.network.formattedName; - } - if (body.range) { - body.ipCidrRange = body.range; - delete body.range; - } - this.request( - { - method: 'POST', - uri: '/subnetworks', - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const subnetwork = self.subnetwork(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, subnetwork, operation, resp); - } - ); - } - /** - * Create a forwarding rule in this region. - * - * @see [ForwardingRule Resource]{@link https://cloud.google.com/compute/docs/reference/v1/forwardingRules#resource} - * @see [ForwardingRules: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/forwardingRules/insert} - * - * @param {string} name - Name of the rule. - * @param {object} config - See a - * [ForwardingRule resource](https://cloud.google.com/compute/docs/reference/v1/forwardingRules#resource). - * @param {string=} config.ip - The single IP address this forwarding rule will - * match against. All traffic that matches the IP address, protocol, and - * ports of this forwarding rule will be handled by this rule. If specified, - * the IP address must be a static external IP address. To create a new - * ephemeral external IP address for the forwarding rule, leave this field - * empty. (Alias for `config.IPAddress`) - * @param {string=} config.protocol - The type of protocol that this forwarding - * rule matches. Valid values are `AH`, `ESP`, `SCTP`, `TCP`, `UDP`. - * Default: `TCP`. (Alias for `config.IPProtocol`) - * @param {string=} config.range - A single port or single contiguous port - * range, ranging from low to high for which this forwarding rule matches. - * Packets of the specified protocol sent to these ports will be forwarded - * on to the appropriate target pool or target instance. If this field is - * left empty, then the forwarding matches traffic for all ports for the - * specified protocol. (Alias for `config.portRange`) - * @param {string} config.target - The full or valid partial URL of the target - * resource to receive the matched traffic. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Rule} callback.rule - The created Rule object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * const name = 'new-rule-name'; - * - * const cfg = { - * target: 'zones/us-central1-a/targetInstances/my-target-instance', - * range: '8080-8089' - * }; - * - * region.createRule(name, cfg, function (err, rule, operation, apiResponse) { - * // `rule` is a Rule object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.createRule(name, cfg).then(function(data) { - * const rule = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createRule(name, config, callback) { - this.parent.createRule.call(this, name, config, callback); - } - /** - * Get a list of addresses in this region. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * @see [Addresses: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/addresses/list} - * - * @param {object=} options - Address search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of addresses to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Address[]} callback.addresses - Address objects from - * this region. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getAddresses(function(err, addresses) { - * // `addresses` is an array of `Address` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, addresses, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * region.getAddresses(nextQuery, callback); - * } - * } - * - * region.getAddresses({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.getAddresses().then(function(data) { - * const addresses = data[0]; - * }); - */ - getAddresses(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/addresses', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const addresses = (resp.items || []).map(address => { - const addressInstance = self.address(address.name); - addressInstance.metadata = address; - return addressInstance; - }); - callback(null, addresses, nextQuery, resp); - } - ); - } - /** - * Get a list of operations for this region. - * - * @see [Region Operation Overview]{@link https://cloud.google.com/compute/docs/reference/v1/regionOperations} - * @see [RegionOperations: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/regionOperations/list} - * - * @param {object=} options - Operation search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of operations to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation[]} callback.operations - Operation objects - * from this region. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getOperations(function(err, operations) { - * // `operations` is an array of `Operation` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, operations, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * region.getOperations(nextQuery, callback); - * } - * } - * - * region.getOperations({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.getOperations().then(function(data) { - * const operations = data[0]; - * }); - */ - getOperations(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/operations', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const operations = (resp.items || []).map(operation => { - const operationInstance = self.operation(operation.name); - operationInstance.metadata = operation; - return operationInstance; - }); - callback(null, operations, nextQuery, resp); - } - ); - } - /** - * Get a list of forwading rules in this region. - * - * @see [ForwardingRules: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/forwardingRules/list} - * - * @param {object=} options - Rules search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of rules to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Rule[]} callback.rules - Rule objects from this - * region. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getRules(function(err, rules) { - * // `rules` is an array of `Rule` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, rules, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * region.getRules(nextQuery, callback); - * } - * } - * - * region.getRules({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.getRules().then(function(data) { - * const rules = data[0]; - * }); - */ - getRules(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/forwardingRules', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const rules = (resp.items || []).map(rule => { - const ruleInstance = self.rule(rule.name); - ruleInstance.metadata = rule; - return ruleInstance; - }); - callback(null, rules, nextQuery, resp); - } - ); - } - /** - * Get a list of subnetworks in this region. - * - * @see [Subnetworks Overview]{@link https://cloud.google.com/compute/docs/subnetworks} - * @see [Subnetworks: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks} - * - * @param {object=} options - Subnetwork search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of subnetworks to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Subnetwork[]} callback.subnetworks - Subnetwork - * objects from this region. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getSubnetworks(function(err, subnetworks) { - * // `subnetworks` is an array of `Subnetwork` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, subnetworks, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * region.getSubnetworks(nextQuery, callback); - * } - * } - * - * region.getSubnetworks({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * region.getSubnetworks().then(function(data) { - * const subnetworks = data[0]; - * }); - */ - getSubnetworks(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/subnetworks', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const subnetworks = (resp.items || []).map(subnetwork => { - const subnetworkInstance = self.subnetwork(subnetwork.name); - subnetworkInstance.metadata = subnetwork; - return subnetworkInstance; - }); - callback(null, subnetworks, nextQuery, resp); - } - ); - } - /** - * Get a reference to a Google Compute Engine region operation. - * - * @see [Region Operation Overview]{@link https://cloud.google.com/compute/docs/reference/v1/regionOperations} - * - * @param {string} name - Name of the existing operation. - * @returns {Operation} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * const operation = region.operation('operation-name'); - */ - operation(name) { - return new Operation(this, name); - } - /** - * Get a reference to a Google Compute Engine forwarding rule in this region. - * - * @param {string} name - Name of the rule. - * @returns {Rule} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * const rule = region.rule('rule-name'); - */ - rule(name) { - return new Rule(this, name); - } - /** - * Get a reference to a Google Compute Engine subnetwork in this region. - * - * @see [Subnetworks Overview]{@link https://cloud.google.com/compute/docs/subnetworks} - * - * @param {string} name - Name of the subnetwork. - * @returns {Subnetwork} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * const subnetwork = region.subnetwork('subnetwork-name'); - */ - subnetwork(name) { - return new Subnetwork(this, name); - } -} - -/** - * Get a list of {@link Address} objects in this region as a readable - * object stream. - * - * @param {object=} options - Configuration object. See - * {@link Region#getAddresses} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getAddressesStream() - * .on('error', console.error) - * .on('data', function(address) { - * // `address` is an `Address` object. - * }) - * .on('end', function() { - * // All addresses retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * region.getAddressesStream() - * .on('data', function(address) { - * this.end(); - * }); - */ -Region.prototype.getAddressesStream = paginator.streamify('getAddresses'); - -/** - * Get a list of {@link Operation} objects for this region as a - * readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link Region#getOperations} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getOperationsStream() - * .on('error', console.error) - * .on('data', function(operation) { - * // `operation` is an `Operation` object. - * }) - * .on('end', function() { - * // All operations retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * region.getOperationsStream() - * .on('data', function(operation) { - * this.end(); - * }); - */ -Region.prototype.getOperationsStream = paginator.streamify('getOperations'); - -/** - * Get a list of {@link Rule} objects in this region as a readable - * object stream. - * - * @param {object=} options - Configuration object. See - * {@link Region#getRulesStream} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getRulesStream() - * .on('error', console.error) - * .on('data', function(rule) { - * // `rule` is a `Rule` object. - * }) - * .on('end', function() { - * // All rules retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * region.getRulesStream() - * .on('data', function(rule) { - * this.end(); - * }); - */ -Region.prototype.getRulesStream = paginator.streamify('getRules'); - -/** - * Get a list of {@link Subnetwork} objects in this region as a - * readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link Region#getSubnetworks} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('us-central1'); - * - * region.getSubnetworksStream() - * .on('error', console.error) - * .on('data', function(subnetwork) { - * // `subnetwork` is a `Subnetwork` object. - * }) - * .on('end', function() { - * // All subnetworks retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * region.getSubnetworksStream() - * .on('data', function(subnetwork) { - * this.end(); - * }); - */ -Region.prototype.getSubnetworksStream = paginator.streamify('getSubnetworks'); - -/*! Developer Documentation - * - * These methods can be auto-paginated. - */ -paginator.extend(Region, [ - 'getAddresses', - 'getOperations', - 'getRules', - 'getSubnetworks', -]); - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Region, { - exclude: ['address', 'operation', 'rule', 'subnetwork'], -}); - -/** - * Reference to the {@link Region} class. - * @name module:@google-cloud/compute.Region - * @see Region - */ -module.exports = Region; diff --git a/src/rule.js b/src/rule.js deleted file mode 100644 index 9a890e42..00000000 --- a/src/rule.js +++ /dev/null @@ -1,311 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * Forwarding rules work in conjunction with target pools and target instances - * to support load balancing and protocol forwarding features. To use load - * balancing and protocol forwarding, you must create a forwarding rule that - * directs traffic to specific target pools (for load balancing) or target - * instances (for protocol forwarding). - * - * @see [Forwarding rules]{@link https://cloud.google.com/compute/docs/load-balancing/network/forwarding-rules} - * - * @class - * @param {Compute|Region} scope - The parent scope this - * firewall rule belongs to. - * @param {string} name - Rule name. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * - * //- - * // Reference a global rule. - * //- - * const rule = compute.rule('rule-name'); - * - * //- - * // Reference a region rule. - * //- - * const region = compute.region('us-central1'); - * const rule = region.rule('rule-name'); - */ -class Rule extends common.ServiceObject { - constructor(scope, name) { - const isGlobalRule = scope.constructor.name === 'Compute'; - const methods = { - /** - * Create a forwarding rule. - * - * @method Rule#create - * @param {object} config - See {@link Compute#createRule} or - * {@link Region#createRule} if accessing this object through - * a Region. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const rule = region.rule('rule-name'); - * - * const config = { - * // `target` will be different depending of this is a Regional or Global - * // forwarding rule - * target: 'global/targetHttpProxies/my-proxy', - * portRange: '8080-8089' - * }; - * - * rule.create(config, function(err, rule, operation, apiResponse) { - * // `rule` is a Rule object. - * - * // `operation` is an Operation object that can be used to check the - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * rule.create(config).then(function(data) { - * const rule = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the forwarding rule exists. - * - * @method Rule#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the rule exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const rule = region.rule('rule-name'); - * - * rule.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * rule.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a forwarding rule if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Rule#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const rule = region.rule('rule-name'); - * - * rule.get(function(err, rule, apiResponse) { - * // `rule` is a Rule object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * rule.get().then(function(data) { - * const rule = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the metadata of this rule. - * - * @see [GlobalForwardingRule Resource]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules#resource} - * @see [ForwardingRule Resource]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules#resource} - * @see [GlobalForwardingRules: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/get} - * @see [ForwardingRules: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/forwardingRules/get} - * - * @method Rule#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The rule's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const rule = region.rule('rule-name'); - * - * rule.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * rule.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: scope, - baseUrl: (isGlobalRule ? '/global' : '') + '/forwardingRules', - /** - * @name Rule#id - * @type {string} - */ - id: name, - createMethod: scope.createRule.bind(scope), - methods: methods, - pollIntervalMs: scope.compute - ? scope.compute.pollIntervalMs - : scope.pollIntervalMs, - }); - /** - * @name Rule#scope - * @type {Compute|Region} - */ - this.scope = scope; - } - /** - * Delete the rule. - * - * @see [GlobalForwardingRules: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/delete} - * @see [ForwardingRules: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/forwardingRules/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const rule = compute.rule('rule-name'); - * - * rule.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * rule.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - callback = callback || common.util.noop; - const scope = this.scope; - super.delete((err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = scope.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Set the target for this forwarding rule. - * - * @see [GlobalForwardingRules: setTarget API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/globalForwardingRules/setTarget} - * @see [ForwardingRules: setTarget API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/forwardingRules/setTarget} - * - * @param {string} target - The full or valid partial URL of the target resource - * to receive the matched traffic. For regional forwarding rules, this - * target must live in the same region as the forwarding rule. For global - * forwarding rules, this target must be a global `TargetHttpProxy` - * resource. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const rule = compute.rule('rule-name'); - * - * rule.setTarget('new-target', function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * rule.setTarget('new-target').then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setTarget(target, callback) { - callback = callback || common.util.noop; - const scope = this.scope; - this.request( - { - method: 'POST', - uri: '/setTarget', - json: { - target: target, - }, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = scope.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Rule); - -/** - * Reference to the {@link Rule} class. - * @name module:@google-cloud/compute.Rule - * @see Rule - */ -module.exports = Rule; diff --git a/src/service.js b/src/service.js deleted file mode 100644 index 0b5e2ad4..00000000 --- a/src/service.js +++ /dev/null @@ -1,385 +0,0 @@ -/*! - * Copyright 2016 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 arrify = require('arrify'); -const common = require('@google-cloud/common'); -const format = require('string-format-obj'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * An HTTP(S) load balancing backend service is a centralized service for - * managing backends, which in turn manage instances that handle user requests. - * You configure your load balancing service to route requests to your backend - * service. The backend service in turn knows which instances it can use, how - * much traffic they can handle, and how much traffic they are currently - * handling. In addition, the backend service monitors health checking and does - * not send traffic to unhealthy instances. - * - * @see [Backend Services Overview]{@link https://cloud.google.com/compute/docs/load-balancing/http/backend-service} - * - * @class - * @param {Compute} compute - The Compute instance this service inherits - * from. - * @param {string} name - Name of the service. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - */ -class Service extends common.ServiceObject { - constructor(compute, name) { - const methods = { - /** - * Create a backend service. - * - * @method Service#create - * @param {object} config - See {@link Compute#createService}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - * - * const config = { - * backends: [ - * { - * group: 'URL of an Instance Group resource' - * } - * ], - * healthChecks: [ - * 'URL of an HTTP/HTTPS health check resource' - * ] - * }; - * - * service.create(config, function(err, service, operation, apiResponse) { - * // `service` is a Service object. - * - * // `operation` is an Operation object that can be used to check the - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * service.create(config).then(function(data) { - * const service = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the backend service exists. - * - * @method Service#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the backend service exists or - * not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - * - * service.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * service.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a Service object if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Service#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - * - * service.get(function(err, service, apiResponse) { - * // `service` is a Service object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * service.get().then(function(data) { - * const service = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the metadata of this backend service. - * - * @see [BackendService Resource]{@link https://cloud.google.com/compute/docs/reference/v1/backendServices#resource} - * @see [BackendService: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/backendServices/get} - * - * @method Service#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The service's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - * - * service.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * service.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: compute, - baseUrl: '/global/backendServices', - /** - * @name Service#id - * @type {string} - */ - id: name, - createMethod: compute.createService.bind(compute), - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - /** - * The parent {@link Compute} instance of this {@link Service} instance. - * @name Service#compute - * @type {Compute} - */ - this.compute = compute; - /** - * @name Service#name - * @type {string} - */ - this.name = name; - } - /** - * Delete the backend service. - * - * @see [BackendServices: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/backendServices/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - * - * service.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * service.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - const compute = this.compute; - callback = callback || common.util.noop; - common.ServiceObject.prototype.delete.call(this, (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } - /** - * Get the most recent health check results. - * - * @see [BackendServices: getHealth API Documentation]{@link https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth} - * - * @param {string|object} group - The fully-qualified URL of an Instance Group - * resource. - * @param {string} group.name - The name of the Instance Group resource. - * @param {Zone|string} group.zone - The name of the zone or a - * Zone object. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object[]} callback.status - A list of health checks and their - * corresponding status. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - * - * const group = { - * name: 'instance-group-name', - * zone: 'us-central1-a' - * }; - * - * service.getHealth(group, function(err, status, apiResponse) { - * if (!err) { - * // status = [ - * // { - * // ipAddress: '...', - * // instance: '...', - * // healthState: '...', - * // port: '...' - * // } - * // ] - * } - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * service.getHealth(group).then(function(data) { - * const status = data[0]; - * const apiResponse = data[1]; - * }); - */ - getHealth(group, callback) { - if (!is.string(group)) { - group = format( - '{resourceBaseUrl}/projects/{p}/zones/{z}/instanceGroups/{n}', - { - resourceBaseUrl: 'https://www.googleapis.com/compute/v1', - p: this.parent.projectId, - z: group.zone.name || group.zone, - n: group.name, - } - ); - } - this.request( - { - method: 'POST', - uri: '/getHealth', - json: { - group: group, - }, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - callback(null, arrify(resp.healthStatus), resp); - } - ); - } - /** - * Set the backend service's metadata. - * - * @see [BackendService Resource]{@link https://cloud.google.com/compute/docs/reference/v1/backendServices#resource} - * - * @param {object} metadata - See a - * [BackendService resource](https://cloud.google.com/compute/docs/reference/v1/backendServices#resource). - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const service = const.service('service-name'); - * - * const metadata = { - * description: 'New description' - * }; - * - * service.setMetadata(metadata, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * service.setMetadata(metadata).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setMetadata(metadata, callback) { - const compute = this.compute; - callback = callback || common.util.noop; - this.request( - { - method: 'PATCH', - uri: '', - json: metadata, - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Service); - -/** - * Reference to the {@link Service} class. - * @name module:@google-cloud/compute.Service - * @see Service - */ -module.exports = Service; diff --git a/src/snapshot.js b/src/snapshot.js deleted file mode 100644 index 695cda95..00000000 --- a/src/snapshot.js +++ /dev/null @@ -1,241 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * A Snapshot object allows you to interact with a Google Compute Engine - * snapshot. - * - * @see [Snapshots Overview]{@link https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots} - * @see [Snapshot Resource]{@link https://cloud.google.com/compute/docs/reference/v1/snapshots} - * - * @class - * @param {Compute|Disk} scope - The parent scope this - * snapshot belongs to. If it's a Disk, we expose the `create` methods. - * @param {string} name - Snapshot name. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const snapshot = compute.snapshot('snapshot-name'); - * - * //- - * // Or, access through a disk. - * //- - * const disk = compute.zone('us-central1-a').disk('disk-name'); - * const snapshot = disk.snapshot('disk-snapshot-name'); - */ -class Snapshot extends common.ServiceObject { - constructor(scope, name) { - const isDisk = scope.constructor.name === 'Disk'; - const methods = { - /** - * Check if the snapshot exists. - * - * @method Snapshot#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the snapshot exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const snapshot = compute.snapshot('snapshot-name'); - * - * snapshot.exists(function(err, exists) {}); - */ - exists: true, - /** - * Get a snapshot if it exists. - * - * If you access this snapshot through a Disk object, this can be used as a - * "get or create" method. Pass an object with `autoCreate` set to `true`. - * Any extra configuration that is normally required for the `create` method - * must be contained within this object as well. - * - * @method Snapshot#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const snapshot = compute.snapshot('snapshot-name'); - * - * snapshot.get(function(err, snapshot, apiResponse) { - * // `snapshot` is a Snapshot object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * snapshot.get().then(function(data) { - * const snapshot = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the snapshot's metadata. - * - * @see [Snapshot Resource]{@link https://cloud.google.com/compute/docs/reference/v1/snapshots} - * @see [Snapshots: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/snapshots/get} - * - * @method Snapshot#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The snapshot's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const snapshot = compute.snapshot('snapshot-name'); - * - * snapshot.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * snapshot.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - const compute = isDisk ? scope.zone.compute : scope; - const config = { - parent: scope, - baseUrl: `https://${compute.apiEndpoint}/compute/v1/projects/{{projectId}}/global/snapshots`, - /** - * @name Snapshot#id - * @type {string} - */ - id: name, - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }; - if (isDisk) { - config.createMethod = scope.createSnapshot.bind(scope); - /** - * Create a snapshot. - * - * **This is only available if you accessed this object through - * {@link Disk#snapshot}.** - * - * @method Snapshot#create - * @param {object} config - See {@link Disk#createSnapshot}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const snapshot = compute.snapshot('snapshot-name'); - * - * snapshot.create(function(err, snapshot, operation, apiResponse) { - * // `snapshot` is a Snapshot object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * snapshot.create().then(function(data) { - * const snapshot = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - config.methods.create = true; - } - super(config); - /** - * @name Snapshot#compute - * @type {Compute} - */ - this.compute = compute; - /** - * @name Snapshot#name - * @type {string} - */ - this.name = name; - } - /** - * Delete the snapshot. - * - * @see [Snapshots: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/snapshots/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const snapshot = compute.snapshot('snapshot-name'); - * - * snapshot.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * snapshot.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - callback = callback || common.util.noop; - const compute = this.compute; - common.ServiceObject.prototype.delete.call(this, (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = compute.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Snapshot); - -/** - * Reference to the {@link Snapshot} class. - * @name module:@google-cloud/compute.Snapshot - * @see Snapshot - */ -module.exports = Snapshot; diff --git a/src/subnetwork.js b/src/subnetwork.js deleted file mode 100644 index 39d934a6..00000000 --- a/src/subnetwork.js +++ /dev/null @@ -1,243 +0,0 @@ -/*! - * Copyright 2016 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 common = require('@google-cloud/common'); -const {promisifyAll} = require('@google-cloud/promisify'); - -/** - * An Subnetwork object allows you to interact with a Google Compute Engine - * subnetwork. - * - * @see [Subnetworks Overview]{@link https://cloud.google.com/compute/docs/subnetworks} - * @see [Subnetwork Resource]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks} - * - * @class - * @param {Region} region - Region this subnetwork belongs to. - * @param {string} name - Name of the subnetwork. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const subnetwork = region.subnetwork('subnetwork1'); - */ -class Subnetwork extends common.ServiceObject { - constructor(region, name) { - const methods = { - /** - * Create a subnetwork. - * - * @method Subnetwork#create - * @param {object} config - See {@link Region#createSubnetwork}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const subnetwork = region.subnetwork('subnetwork1'); - * - * const config = { - * // ... - * }; - * - * function callback(err, subnetwork, operation, apiResponse) { - * // `subnetwork` is a Subnetwork object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * } - * - * subnetwork.create(config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * subnetwork.create(config).then(function(data) { - * const subnetwork = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the subnetwork exists. - * - * @method Subnetwork#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the subnetwork exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const subnetwork = region.subnetwork('subnetwork1'); - * - * subnetwork.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * subnetwork.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a subnetwork if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method Subnetwork#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const subnetwork = region.subnetwork('subnetwork1'); - * - * subnetwork.get(function(err, subnetwork, apiResponse) { - * // `subnetwork` is a Subnetwork object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * subnetwork.get().then(function(data) { - * const subnetwork = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the metadata of this subnetwork. - * - * @see [Subnetwork Resource]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks} - * @see [Subnetwork: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks/get} - * - * @method Subnetwork#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The subnetwork's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const subnetwork = region.subnetwork('subnetwork1'); - * - * subnetwork.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * subnetwork.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: region, - baseUrl: '/subnetworks', - id: name, - createMethod: region.createSubnetwork.bind(region), - methods: methods, - pollIntervalMs: region.compute.pollIntervalMs, - }); - /** - * @name Subnetwork#name - * @type {string} - */ - this.name = name; - /** - * The parent {@link Region} instance of this {@link Subnetwork} instance. - * @name Subnetwork#region - * @type {Region} - */ - this.region = region; - } - /** - * Delete the subnetwork. - * - * @see [Subnetworks: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/subnetworks/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const region = compute.region('region-name'); - * const subnetwork = region.subnetwork('subnetwork1'); - * - * subnetwork.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * subnetwork.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - callback = callback || common.util.noop; - const region = this.region; - this.request( - { - method: 'DELETE', - uri: '', - }, - (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = region.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - } - ); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Subnetwork); - -module.exports = Subnetwork; diff --git a/src/v1/accelerator_types_client.ts b/src/v1/accelerator_types_client.ts new file mode 100644 index 00000000..6c288e46 --- /dev/null +++ b/src/v1/accelerator_types_client.ts @@ -0,0 +1,739 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/accelerator_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './accelerator_types_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * + * Services + * + * The AcceleratorTypes API. + * @class + * @memberof v1 + */ +export class AcceleratorTypesClient { + 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}; + acceleratorTypesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AcceleratorTypesClient. + * + * @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 AcceleratorTypesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.AcceleratorTypes', + 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 = gax.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.acceleratorTypesStub) { + return this.acceleratorTypesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.AcceleratorTypes. + this.acceleratorTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.AcceleratorTypes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.AcceleratorTypes, + 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 acceleratorTypesStubMethods = ['aggregatedList', 'get', 'list']; + for (const methodName of acceleratorTypesStubMethods) { + const callPromise = this.acceleratorTypesStub.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.acceleratorTypesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAcceleratorType, + protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IAcceleratorType, + | protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IAcceleratorType, + | protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified accelerator type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.acceleratorType + * Name of the accelerator type to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [AcceleratorType]{@link google.cloud.compute.v1.AcceleratorType}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IAcceleratorType, + | protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IAcceleratorType, + | protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAcceleratorType, + protos.google.cloud.compute.v1.IGetAcceleratorTypeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [AcceleratorTypesScopedList]{@link google.cloud.compute.v1.AcceleratorTypesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListAcceleratorTypesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IAcceleratorTypesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IAcceleratorTypesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAcceleratorType[], + protos.google.cloud.compute.v1.IListAcceleratorTypesRequest | null, + protos.google.cloud.compute.v1.IAcceleratorTypeList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + protos.google.cloud.compute.v1.IAcceleratorTypeList | null | undefined, + protos.google.cloud.compute.v1.IAcceleratorType + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + protos.google.cloud.compute.v1.IAcceleratorTypeList | null | undefined, + protos.google.cloud.compute.v1.IAcceleratorType + > + ): void; + /** + * Retrieves a list of accelerator types that are available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [AcceleratorType]{@link google.cloud.compute.v1.AcceleratorType}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + | protos.google.cloud.compute.v1.IAcceleratorTypeList + | null + | undefined, + protos.google.cloud.compute.v1.IAcceleratorType + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + protos.google.cloud.compute.v1.IAcceleratorTypeList | null | undefined, + protos.google.cloud.compute.v1.IAcceleratorType + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAcceleratorType[], + protos.google.cloud.compute.v1.IListAcceleratorTypesRequest | null, + protos.google.cloud.compute.v1.IAcceleratorTypeList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [AcceleratorType]{@link google.cloud.compute.v1.AcceleratorType} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [AcceleratorType]{@link google.cloud.compute.v1.AcceleratorType}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListAcceleratorTypesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.acceleratorTypesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/accelerator_types_client_config.json b/src/v1/accelerator_types_client_config.json new file mode 100644 index 00000000..c78002c0 --- /dev/null +++ b/src/v1/accelerator_types_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.compute.v1.AcceleratorTypes": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/accelerator_types_proto_list.json b/src/v1/accelerator_types_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/accelerator_types_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/addresses_client.ts b/src/v1/addresses_client.ts new file mode 100644 index 00000000..616dfdad --- /dev/null +++ b/src/v1/addresses_client.ts @@ -0,0 +1,921 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/addresses_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './addresses_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Addresses API. + * @class + * @memberof v1 + */ +export class AddressesClient { + 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}; + addressesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AddressesClient. + * + * @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 AddressesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Addresses', + 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 = gax.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.addressesStub) { + return this.addressesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Addresses. + this.addressesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Addresses' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Addresses, + 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 addressesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of addressesStubMethods) { + const callPromise = this.addressesStub.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.addressesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteAddressRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteAddressRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteAddressRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteAddressRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteAddressRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteAddressRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified address resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.address + * Name of the address resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteAddressRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAddressRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteAddressRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteAddressRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetAddressRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetAddressRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetAddressRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetAddressRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetAddressRequest, + callback: Callback< + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetAddressRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified address resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.address + * Name of the address resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [Address]{@link google.cloud.compute.v1.Address}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetAddressRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetAddressRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetAddressRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetAddressRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertAddressRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertAddressRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertAddressRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertAddressRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertAddressRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertAddressRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an address resource in the specified project by using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Address} request.addressResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertAddressRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertAddressRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertAddressRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertAddressRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [AddressesScopedList]{@link google.cloud.compute.v1.AddressesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListAddressesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IAddressesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IAddressesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListAddressesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress[], + protos.google.cloud.compute.v1.IListAddressesRequest | null, + protos.google.cloud.compute.v1.IAddressList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListAddressesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListAddressesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + > + ): void; + /** + * Retrieves a list of addresses contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Address]{@link google.cloud.compute.v1.Address}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListAddressesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress[], + protos.google.cloud.compute.v1.IListAddressesRequest | null, + protos.google.cloud.compute.v1.IAddressList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Address]{@link google.cloud.compute.v1.Address} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListAddressesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Address]{@link google.cloud.compute.v1.Address}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListAddressesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.addressesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/addresses_client_config.json b/src/v1/addresses_client_config.json new file mode 100644 index 00000000..500c42aa --- /dev/null +++ b/src/v1/addresses_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Addresses": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/addresses_proto_list.json b/src/v1/addresses_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/addresses_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/autoscalers_client.ts b/src/v1/autoscalers_client.ts new file mode 100644 index 00000000..8e0bbab3 --- /dev/null +++ b/src/v1/autoscalers_client.ts @@ -0,0 +1,1137 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/autoscalers_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './autoscalers_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Autoscalers API. + * @class + * @memberof v1 + */ +export class AutoscalersClient { + 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}; + autoscalersStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutoscalersClient. + * + * @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 AutoscalersClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Autoscalers', + 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 = gax.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.autoscalersStub) { + return this.autoscalersStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Autoscalers. + this.autoscalersStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Autoscalers' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Autoscalers, + 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 autoscalersStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'update', + ]; + for (const methodName of autoscalersStubMethods) { + const callPromise = this.autoscalersStub.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.autoscalersStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteAutoscalerRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified autoscaler. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler, + protos.google.cloud.compute.v1.IGetAutoscalerRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IAutoscaler, + protos.google.cloud.compute.v1.IGetAutoscalerRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IAutoscaler, + protos.google.cloud.compute.v1.IGetAutoscalerRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * Name of the zone for 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 [Autoscaler]{@link google.cloud.compute.v1.Autoscaler}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IAutoscaler, + | protos.google.cloud.compute.v1.IGetAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IAutoscaler, + protos.google.cloud.compute.v1.IGetAutoscalerRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler, + protos.google.cloud.compute.v1.IGetAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertAutoscalerRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Autoscaler} request.autoscalerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchAutoscalerRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchAutoscalerRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchAutoscalerRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to patch. + * @param {google.cloud.compute.v1.Autoscaler} request.autoscalerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchAutoscalerRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateAutoscalerRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to update. + * @param {google.cloud.compute.v1.Autoscaler} request.autoscalerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [AutoscalersScopedList]{@link google.cloud.compute.v1.AutoscalersScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListAutoscalersRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IAutoscalersScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IAutoscalersScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListAutoscalersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler[], + protos.google.cloud.compute.v1.IListAutoscalersRequest | null, + protos.google.cloud.compute.v1.IAutoscalerList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListAutoscalersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListAutoscalersRequest, + protos.google.cloud.compute.v1.IAutoscalerList | null | undefined, + protos.google.cloud.compute.v1.IAutoscaler + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListAutoscalersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListAutoscalersRequest, + protos.google.cloud.compute.v1.IAutoscalerList | null | undefined, + protos.google.cloud.compute.v1.IAutoscaler + > + ): void; + /** + * Retrieves a list of autoscalers contained within the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for 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 Array of [Autoscaler]{@link google.cloud.compute.v1.Autoscaler}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListAutoscalersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListAutoscalersRequest, + protos.google.cloud.compute.v1.IAutoscalerList | null | undefined, + protos.google.cloud.compute.v1.IAutoscaler + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListAutoscalersRequest, + protos.google.cloud.compute.v1.IAutoscalerList | null | undefined, + protos.google.cloud.compute.v1.IAutoscaler + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler[], + protos.google.cloud.compute.v1.IListAutoscalersRequest | null, + protos.google.cloud.compute.v1.IAutoscalerList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for this request. + * @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 [Autoscaler]{@link google.cloud.compute.v1.Autoscaler} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListAutoscalersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for this request. + * @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 + * [Autoscaler]{@link google.cloud.compute.v1.Autoscaler}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListAutoscalersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.autoscalersStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/autoscalers_client_config.json b/src/v1/autoscalers_client_config.json new file mode 100644 index 00000000..38ec0371 --- /dev/null +++ b/src/v1/autoscalers_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Autoscalers": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/autoscalers_proto_list.json b/src/v1/autoscalers_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/autoscalers_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/backend_buckets_client.ts b/src/v1/backend_buckets_client.ts new file mode 100644 index 00000000..a780deec --- /dev/null +++ b/src/v1/backend_buckets_client.ts @@ -0,0 +1,1272 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/backend_buckets_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './backend_buckets_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The BackendBuckets API. + * @class + * @memberof v1 + */ +export class BackendBucketsClient { + 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}; + backendBucketsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BackendBucketsClient. + * + * @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 BackendBucketsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.BackendBuckets', + 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 = gax.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.backendBucketsStub) { + return this.backendBucketsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.BackendBuckets. + this.backendBucketsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.BackendBuckets' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.BackendBuckets, + 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 backendBucketsStubMethods = [ + 'addSignedUrlKey', + 'delete', + 'deleteSignedUrlKey', + 'get', + 'insert', + 'list', + 'patch', + 'update', + ]; + for (const methodName of backendBucketsStubMethods) { + const callPromise = this.backendBucketsStub.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.backendBucketsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addSignedUrlKey( + request?: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest + | undefined + ), + {} | undefined + ] + >; + addSignedUrlKey( + request: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addSignedUrlKey( + request: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds a key for validating requests with signed URLs for this backend bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendBucket + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SignedUrlKey} request.signedUrlKeyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addSignedUrlKey(request); + */ + addSignedUrlKey( + request?: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendBucketRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addSignedUrlKey(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteBackendBucketRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteBackendBucketRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteBackendBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteBackendBucketRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified BackendBucket resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendBucket + * Name of the BackendBucket resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteBackendBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendBucketRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteBackendBucketRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + deleteSignedUrlKey( + request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest + | undefined + ), + {} | undefined + ] + >; + deleteSignedUrlKey( + request: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSignedUrlKey( + request: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a key for validating requests with signed URLs for this backend bucket. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendBucket + * Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} request.keyName + * The name of the Signed URL Key to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deleteSignedUrlKey(request); + */ + deleteSignedUrlKey( + request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendBucketRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSignedUrlKey(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetBackendBucketRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendBucket, + protos.google.cloud.compute.v1.IGetBackendBucketRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetBackendBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IBackendBucket, + | protos.google.cloud.compute.v1.IGetBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetBackendBucketRequest, + callback: Callback< + protos.google.cloud.compute.v1.IBackendBucket, + | protos.google.cloud.compute.v1.IGetBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendBucket + * Name of the BackendBucket resource to return. + * @param {string} request.project + * Project ID for 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 [BackendBucket]{@link google.cloud.compute.v1.BackendBucket}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetBackendBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IBackendBucket, + | protos.google.cloud.compute.v1.IGetBackendBucketRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IBackendBucket, + | protos.google.cloud.compute.v1.IGetBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendBucket, + protos.google.cloud.compute.v1.IGetBackendBucketRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertBackendBucketRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertBackendBucketRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertBackendBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertBackendBucketRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a BackendBucket resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.BackendBucket} request.backendBucketResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertBackendBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendBucketRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertBackendBucketRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchBackendBucketRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchBackendBucketRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchBackendBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchBackendBucketRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified BackendBucket resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendBucket + * Name of the BackendBucket resource to patch. + * @param {google.cloud.compute.v1.BackendBucket} request.backendBucketResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchBackendBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendBucketRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchBackendBucketRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateBackendBucketRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateBackendBucketRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateBackendBucketRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateBackendBucketRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified BackendBucket resource with the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendBucket + * Name of the BackendBucket resource to update. + * @param {google.cloud.compute.v1.BackendBucket} request.backendBucketResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateBackendBucketRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendBucketRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendBucketRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateBackendBucketRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListBackendBucketsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendBucket[], + protos.google.cloud.compute.v1.IListBackendBucketsRequest | null, + protos.google.cloud.compute.v1.IBackendBucketList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListBackendBucketsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListBackendBucketsRequest, + protos.google.cloud.compute.v1.IBackendBucketList | null | undefined, + protos.google.cloud.compute.v1.IBackendBucket + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListBackendBucketsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListBackendBucketsRequest, + protos.google.cloud.compute.v1.IBackendBucketList | null | undefined, + protos.google.cloud.compute.v1.IBackendBucket + > + ): void; + /** + * Retrieves the list of BackendBucket resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [BackendBucket]{@link google.cloud.compute.v1.BackendBucket}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListBackendBucketsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListBackendBucketsRequest, + protos.google.cloud.compute.v1.IBackendBucketList | null | undefined, + protos.google.cloud.compute.v1.IBackendBucket + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListBackendBucketsRequest, + protos.google.cloud.compute.v1.IBackendBucketList | null | undefined, + protos.google.cloud.compute.v1.IBackendBucket + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendBucket[], + protos.google.cloud.compute.v1.IListBackendBucketsRequest | null, + protos.google.cloud.compute.v1.IBackendBucketList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [BackendBucket]{@link google.cloud.compute.v1.BackendBucket} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListBackendBucketsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [BackendBucket]{@link google.cloud.compute.v1.BackendBucket}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListBackendBucketsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.backendBucketsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/backend_buckets_client_config.json b/src/v1/backend_buckets_client_config.json new file mode 100644 index 00000000..d6454d56 --- /dev/null +++ b/src/v1/backend_buckets_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.compute.v1.BackendBuckets": { + "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": { + "AddSignedUrlKey": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSignedUrlKey": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/backend_buckets_proto_list.json b/src/v1/backend_buckets_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/backend_buckets_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/backend_services_client.ts b/src/v1/backend_services_client.ts new file mode 100644 index 00000000..3950e377 --- /dev/null +++ b/src/v1/backend_services_client.ts @@ -0,0 +1,1562 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/backend_services_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './backend_services_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The BackendServices API. + * @class + * @memberof v1 + */ +export class BackendServicesClient { + 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}; + backendServicesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BackendServicesClient. + * + * @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 BackendServicesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.BackendServices', + 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 = gax.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.backendServicesStub) { + return this.backendServicesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.BackendServices. + this.backendServicesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.BackendServices' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.BackendServices, + 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 backendServicesStubMethods = [ + 'addSignedUrlKey', + 'aggregatedList', + 'delete', + 'deleteSignedUrlKey', + 'get', + 'getHealth', + 'insert', + 'list', + 'patch', + 'setSecurityPolicy', + 'update', + ]; + for (const methodName of backendServicesStubMethods) { + const callPromise = this.backendServicesStub.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.backendServicesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addSignedUrlKey( + request?: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + addSignedUrlKey( + request: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addSignedUrlKey( + request: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds a key for validating requests with signed URLs for this backend service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SignedUrlKey} request.signedUrlKeyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addSignedUrlKey(request); + */ + addSignedUrlKey( + request?: protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddSignedUrlKeyBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addSignedUrlKey(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteBackendServiceRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified BackendService resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteBackendServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + deleteSignedUrlKey( + request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + deleteSignedUrlKey( + request: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteSignedUrlKey( + request: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a key for validating requests with signed URLs for this backend service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} request.keyName + * The name of the Signed URL Key to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deleteSignedUrlKey(request); + */ + deleteSignedUrlKey( + request?: protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteSignedUrlKeyBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deleteSignedUrlKey(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService, + protos.google.cloud.compute.v1.IGetBackendServiceRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified BackendService resource. Gets a list of available backend services. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to return. + * @param {string} request.project + * Project ID for 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 [BackendService]{@link google.cloud.compute.v1.BackendService}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService, + protos.google.cloud.compute.v1.IGetBackendServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getHealth( + request?: protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + ( + | protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + getHealth( + request: protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getHealth( + request: protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the most recent health check results for this BackendService. + * + * Example request body: + * + * { "group": "/zones/us-east1-b/instanceGroups/lb-backend-example" } + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to which the queried instance belongs. + * @param {string} request.project + * @param {google.cloud.compute.v1.ResourceGroupReference} request.resourceGroupReferenceResource + * The body resource for 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 [BackendServiceGroupHealth]{@link google.cloud.compute.v1.BackendServiceGroupHealth}. + * 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.getHealth(request); + */ + getHealth( + request?: protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + ( + | protos.google.cloud.compute.v1.IGetHealthBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getHealth(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertBackendServiceRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.BackendService} request.backendServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertBackendServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchBackendServiceRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to patch. + * @param {google.cloud.compute.v1.BackendService} request.backendServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchBackendServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setSecurityPolicy( + request?: protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + setSecurityPolicy( + request: protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setSecurityPolicy( + request: protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SecurityPolicyReference} request.securityPolicyReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setSecurityPolicy(request); + */ + setSecurityPolicy( + request?: protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSecurityPolicyBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setSecurityPolicy(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateBackendServiceRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to update. + * @param {google.cloud.compute.v1.BackendService} request.backendServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateBackendServiceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Name of the project scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [BackendServicesScopedList]{@link google.cloud.compute.v1.BackendServicesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListBackendServicesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IBackendServicesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IBackendServicesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListBackendServicesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService[], + protos.google.cloud.compute.v1.IListBackendServicesRequest | null, + protos.google.cloud.compute.v1.IBackendServiceList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListBackendServicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListBackendServicesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + > + ): void; + /** + * Retrieves the list of BackendService resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [BackendService]{@link google.cloud.compute.v1.BackendService}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListBackendServicesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService[], + protos.google.cloud.compute.v1.IListBackendServicesRequest | null, + protos.google.cloud.compute.v1.IBackendServiceList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [BackendService]{@link google.cloud.compute.v1.BackendService} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListBackendServicesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [BackendService]{@link google.cloud.compute.v1.BackendService}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListBackendServicesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.backendServicesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/backend_services_client_config.json b/src/v1/backend_services_client_config.json new file mode 100644 index 00000000..be2362ba --- /dev/null +++ b/src/v1/backend_services_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.BackendServices": { + "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": { + "AddSignedUrlKey": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSignedUrlKey": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHealth": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetSecurityPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/backend_services_proto_list.json b/src/v1/backend_services_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/backend_services_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/disk_types_client.ts b/src/v1/disk_types_client.ts new file mode 100644 index 00000000..e8c31f13 --- /dev/null +++ b/src/v1/disk_types_client.ts @@ -0,0 +1,726 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/disk_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './disk_types_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The DiskTypes API. + * @class + * @memberof v1 + */ +export class DiskTypesClient { + 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}; + diskTypesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DiskTypesClient. + * + * @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 DiskTypesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.DiskTypes', + 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 = gax.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.diskTypesStub) { + return this.diskTypesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.DiskTypes. + this.diskTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.DiskTypes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.DiskTypes, + 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 diskTypesStubMethods = ['aggregatedList', 'get', 'list']; + for (const methodName of diskTypesStubMethods) { + const callPromise = this.diskTypesStub.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.diskTypesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetDiskTypeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetDiskTypeRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetDiskTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetDiskTypeRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetDiskTypeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetDiskTypeRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified disk type. Gets a list of available disk types by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.diskType + * Name of the disk type to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [DiskType]{@link google.cloud.compute.v1.DiskType}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetDiskTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetDiskTypeRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetDiskTypeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetDiskTypeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [DiskTypesScopedList]{@link google.cloud.compute.v1.DiskTypesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListDiskTypesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IDiskTypesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IDiskTypesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListDiskTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType[], + protos.google.cloud.compute.v1.IListDiskTypesRequest | null, + protos.google.cloud.compute.v1.IDiskTypeList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListDiskTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListDiskTypesRequest, + protos.google.cloud.compute.v1.IDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListDiskTypesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListDiskTypesRequest, + protos.google.cloud.compute.v1.IDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + > + ): void; + /** + * Retrieves a list of disk types available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [DiskType]{@link google.cloud.compute.v1.DiskType}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListDiskTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListDiskTypesRequest, + protos.google.cloud.compute.v1.IDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListDiskTypesRequest, + protos.google.cloud.compute.v1.IDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType[], + protos.google.cloud.compute.v1.IListDiskTypesRequest | null, + protos.google.cloud.compute.v1.IDiskTypeList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [DiskType]{@link google.cloud.compute.v1.DiskType} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListDiskTypesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [DiskType]{@link google.cloud.compute.v1.DiskType}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListDiskTypesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.diskTypesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/disk_types_client_config.json b/src/v1/disk_types_client_config.json new file mode 100644 index 00000000..22be88a0 --- /dev/null +++ b/src/v1/disk_types_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.compute.v1.DiskTypes": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/disk_types_proto_list.json b/src/v1/disk_types_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/disk_types_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/disks_client.ts b/src/v1/disks_client.ts new file mode 100644 index 00000000..3f770518 --- /dev/null +++ b/src/v1/disks_client.ts @@ -0,0 +1,1735 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/disks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './disks_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Disks API. + * @class + * @memberof v1 + */ +export class DisksClient { + 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}; + disksStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DisksClient. + * + * @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 DisksClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Disks', + 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 = gax.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.disksStub) { + return this.disksStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Disks. + this.disksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Disks' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Disks, + 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 disksStubMethods = [ + 'addResourcePolicies', + 'aggregatedList', + 'createSnapshot', + 'delete', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'removeResourcePolicies', + 'resize', + 'setIamPolicy', + 'setLabels', + 'testIamPermissions', + ]; + for (const methodName of disksStubMethods) { + const callPromise = this.disksStub.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.disksStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addResourcePolicies( + request?: protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest + | undefined + ), + {} | undefined + ] + >; + addResourcePolicies( + request: protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addResourcePolicies( + request: protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * The disk name for this request. + * @param {google.cloud.compute.v1.DisksAddResourcePoliciesRequest} request.disksAddResourcePoliciesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addResourcePolicies(request); + */ + addResourcePolicies( + request?: protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddResourcePoliciesDiskRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addResourcePolicies(request, options, callback); + } + createSnapshot( + request?: protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest | undefined, + {} | undefined + ] + >; + createSnapshot( + request: protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSnapshot( + request: protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a snapshot of a specified persistent disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * Name of the persistent disk to snapshot. + * @param {boolean} request.guestFlush + * [Input Only] Whether to attempt an application consistent snapshot by informing the OS to prepare for the snapshot process. Currently only supported on Windows instances using the Volume Shadow Copy Service (VSS). + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Snapshot} request.snapshotResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.createSnapshot(request); + */ + createSnapshot( + request?: protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ICreateSnapshotDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.createSnapshot(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteDiskRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified persistent disk. Deleting a disk removes its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * Name of the persistent disk to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteDiskRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteDiskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetDiskRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * Name of the persistent disk to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [Disk]{@link google.cloud.compute.v1.Disk}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetDiskRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetDiskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertDiskRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Disk} request.diskResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sourceImage + * Source image to restore onto a disk. This field is optional. + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertDiskRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertDiskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + removeResourcePolicies( + request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest + | undefined + ), + {} | undefined + ] + >; + removeResourcePolicies( + request: protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeResourcePolicies( + request: protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes resource policies from a disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * The disk name for this request. + * @param {google.cloud.compute.v1.DisksRemoveResourcePoliciesRequest} request.disksRemoveResourcePoliciesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeResourcePolicies(request); + */ + removeResourcePolicies( + request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesDiskRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removeResourcePolicies( + request, + options, + callback + ); + } + resize( + request?: protos.google.cloud.compute.v1.IResizeDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeDiskRequest | undefined, + {} | undefined + ] + >; + resize( + request: protos.google.cloud.compute.v1.IResizeDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + resize( + request: protos.google.cloud.compute.v1.IResizeDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Resizes the specified persistent disk. You can only increase the size of the disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * The name of the persistent disk. + * @param {google.cloud.compute.v1.DisksResizeRequest} request.disksResizeRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.resize(request); + */ + resize( + request?: protos.google.cloud.compute.v1.IResizeDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeDiskRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeDiskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.resize(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for this request. + * @param {google.cloud.compute.v1.ZoneSetPolicyRequest} request.zoneSetPolicyRequestResource + * The body resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsDiskRequest | undefined, + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for this request. + * @param {google.cloud.compute.v1.ZoneSetLabelsRequest} request.zoneSetLabelsRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsDiskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest | undefined, + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + protos.google.cloud.compute.v1.ITestIamPermissionsDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [DisksScopedList]{@link google.cloud.compute.v1.DisksScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListDisksRequest, + options?: CallOptions + ): AsyncIterable<[string, protos.google.cloud.compute.v1.IDisksScopedList]> { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IDisksScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListDisksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk[], + protos.google.cloud.compute.v1.IListDisksRequest | null, + protos.google.cloud.compute.v1.IDiskList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListDisksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListDisksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + > + ): void; + /** + * Retrieves a list of persistent disks contained within the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [Disk]{@link google.cloud.compute.v1.Disk}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListDisksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk[], + protos.google.cloud.compute.v1.IListDisksRequest | null, + protos.google.cloud.compute.v1.IDiskList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [Disk]{@link google.cloud.compute.v1.Disk} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListDisksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [Disk]{@link google.cloud.compute.v1.Disk}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListDisksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.disksStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/disks_client_config.json b/src/v1/disks_client_config.json new file mode 100644 index 00000000..fcc10526 --- /dev/null +++ b/src/v1/disks_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Disks": { + "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": { + "AddResourcePolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveResourcePolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Resize": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/disks_proto_list.json b/src/v1/disks_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/disks_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/external_vpn_gateways_client.ts b/src/v1/external_vpn_gateways_client.ts new file mode 100644 index 00000000..5bf8045d --- /dev/null +++ b/src/v1/external_vpn_gateways_client.ts @@ -0,0 +1,1070 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/external_vpn_gateways_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './external_vpn_gateways_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The ExternalVpnGateways API. + * @class + * @memberof v1 + */ +export class ExternalVpnGatewaysClient { + 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}; + externalVpnGatewaysStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ExternalVpnGatewaysClient. + * + * @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 ExternalVpnGatewaysClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.ExternalVpnGateways', + 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 = gax.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.externalVpnGatewaysStub) { + return this.externalVpnGatewaysStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.ExternalVpnGateways. + this.externalVpnGatewaysStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.ExternalVpnGateways' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.ExternalVpnGateways, + 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 externalVpnGatewaysStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'setLabels', + 'testIamPermissions', + ]; + for (const methodName of externalVpnGatewaysStubMethods) { + const callPromise = this.externalVpnGatewaysStub.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.externalVpnGatewaysStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified externalVpnGateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.externalVpnGateway + * Name of the externalVpnGateways to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IExternalVpnGateway, + protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IExternalVpnGateway, + | protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IExternalVpnGateway, + | protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified externalVpnGateway. Get a list of available externalVpnGateways by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.externalVpnGateway + * Name of the externalVpnGateway to return. + * @param {string} request.project + * Project ID for 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 [ExternalVpnGateway]{@link google.cloud.compute.v1.ExternalVpnGateway}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IExternalVpnGateway, + | protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IExternalVpnGateway, + | protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IExternalVpnGateway, + protos.google.cloud.compute.v1.IGetExternalVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a ExternalVpnGateway in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.ExternalVpnGateway} request.externalVpnGatewayResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on an ExternalVpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetLabelsRequest} request.globalSetLabelsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetLabelsExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsExternalVpnGatewayRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IExternalVpnGateway[], + protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest | null, + protos.google.cloud.compute.v1.IExternalVpnGatewayList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + protos.google.cloud.compute.v1.IExternalVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.IExternalVpnGateway + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + protos.google.cloud.compute.v1.IExternalVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.IExternalVpnGateway + > + ): void; + /** + * Retrieves the list of ExternalVpnGateway available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [ExternalVpnGateway]{@link google.cloud.compute.v1.ExternalVpnGateway}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + | protos.google.cloud.compute.v1.IExternalVpnGatewayList + | null + | undefined, + protos.google.cloud.compute.v1.IExternalVpnGateway + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + protos.google.cloud.compute.v1.IExternalVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.IExternalVpnGateway + > + ): Promise< + [ + protos.google.cloud.compute.v1.IExternalVpnGateway[], + protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest | null, + protos.google.cloud.compute.v1.IExternalVpnGatewayList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [ExternalVpnGateway]{@link google.cloud.compute.v1.ExternalVpnGateway} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [ExternalVpnGateway]{@link google.cloud.compute.v1.ExternalVpnGateway}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListExternalVpnGatewaysRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.externalVpnGatewaysStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/external_vpn_gateways_client_config.json b/src/v1/external_vpn_gateways_client_config.json new file mode 100644 index 00000000..db73f24b --- /dev/null +++ b/src/v1/external_vpn_gateways_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ExternalVpnGateways": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/external_vpn_gateways_proto_list.json b/src/v1/external_vpn_gateways_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/external_vpn_gateways_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/firewall_policies_client.ts b/src/v1/firewall_policies_client.ts new file mode 100644 index 00000000..623cf2ff --- /dev/null +++ b/src/v1/firewall_policies_client.ts @@ -0,0 +1,2244 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/firewall_policies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './firewall_policies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The FirewallPolicies API. + * @class + * @memberof v1 + */ +export class FirewallPoliciesClient { + 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}; + firewallPoliciesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FirewallPoliciesClient. + * + * @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 FirewallPoliciesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.FirewallPolicies', + 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 = gax.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.firewallPoliciesStub) { + return this.firewallPoliciesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.FirewallPolicies. + this.firewallPoliciesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.FirewallPolicies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.FirewallPolicies, + 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 firewallPoliciesStubMethods = [ + 'addAssociation', + 'addRule', + 'cloneRules', + 'delete', + 'get', + 'getAssociation', + 'getIamPolicy', + 'getRule', + 'insert', + 'list', + 'listAssociations', + 'move', + 'patch', + 'patchRule', + 'removeAssociation', + 'removeRule', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of firewallPoliciesStubMethods) { + const callPromise = this.firewallPoliciesStub.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.firewallPoliciesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addAssociation( + request?: protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + addAssociation( + request: protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addAssociation( + request: protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Inserts an association for the specified firewall policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {google.cloud.compute.v1.FirewallPolicyAssociation} request.firewallPolicyAssociationResource + * The body resource for this request + * @param {boolean} request.replaceExistingAssociation + * Indicates whether or not to replace it if an association of the attachment already exists. This is false by default, in which case an error will be returned if an association already exists. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addAssociation(request); + */ + addAssociation( + request?: protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddAssociationFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.addAssociation(request, options, callback); + } + addRule( + request?: protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest | undefined, + {} | undefined + ] + >; + addRule( + request: protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addRule( + request: protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Inserts a rule into a firewall policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {google.cloud.compute.v1.FirewallPolicyRule} request.firewallPolicyRuleResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addRule(request); + */ + addRule( + request?: protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddRuleFirewallPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.addRule(request, options, callback); + } + cloneRules( + request?: protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + cloneRules( + request: protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + cloneRules( + request: protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Copies rules to the specified firewall policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sourceFirewallPolicy + * The firewall policy from which to copy rules. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.cloneRules(request); + */ + cloneRules( + request?: protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICloneRulesFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.cloneRules(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to delete. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteFirewallPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicy, + protos.google.cloud.compute.v1.IGetFirewallPolicyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPolicy, + | protos.google.cloud.compute.v1.IGetFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPolicy, + | protos.google.cloud.compute.v1.IGetFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified firewall policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FirewallPolicy]{@link google.cloud.compute.v1.FirewallPolicy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IFirewallPolicy, + | protos.google.cloud.compute.v1.IGetFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IFirewallPolicy, + | protos.google.cloud.compute.v1.IGetFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicy, + protos.google.cloud.compute.v1.IGetFirewallPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getAssociation( + request?: protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicyAssociation, + ( + | protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + getAssociation( + request: protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPolicyAssociation, + | protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAssociation( + request: protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPolicyAssociation, + | protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets an association with the specified name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to which the queried rule belongs. + * @param {string} request.name + * The name of the association to get from the firewall policy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FirewallPolicyAssociation]{@link google.cloud.compute.v1.FirewallPolicyAssociation}. + * 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.getAssociation(request); + */ + getAssociation( + request?: protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IFirewallPolicyAssociation, + | protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IFirewallPolicyAssociation, + | protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicyAssociation, + ( + | protos.google.cloud.compute.v1.IGetAssociationFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.getAssociation(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + getRule( + request?: protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicyRule, + protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest | undefined, + {} | undefined + ] + >; + getRule( + request: protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRule( + request: protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a rule of the specified priority. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to which the queried rule belongs. + * @param {number} request.priority + * The priority of the rule to get from the firewall policy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FirewallPolicyRule]{@link google.cloud.compute.v1.FirewallPolicyRule}. + * 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.getRule(request); + */ + getRule( + request?: protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IFirewallPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IFirewallPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicyRule, + protos.google.cloud.compute.v1.IGetRuleFirewallPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.getRule(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new policy in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.FirewallPolicy} request.firewallPolicyResource + * The body resource for this request + * @param {string} request.parentId + * Parent ID for this request. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertFirewallPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + listAssociations( + request?: protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, + ( + | protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + listAssociations( + request: protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, + | protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listAssociations( + request: protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, + | protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Lists associations of a specified target, i.e., organization or folder. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.targetResource + * The target resource to list associations. It is an organization, or a folder. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [FirewallPoliciesListAssociationsResponse]{@link google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse}. + * 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.listAssociations(request); + */ + listAssociations( + request?: protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, + | protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, + | protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse, + ( + | protos.google.cloud.compute.v1.IListAssociationsFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.listAssociations(request, options, callback); + } + move( + request?: protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest | undefined, + {} | undefined + ] + >; + move( + request: protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + move( + request: protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Moves the specified firewall policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {string} request.parentId + * The new parent of the firewall policy. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.move(request); + */ + move( + request?: protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveFirewallPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.move(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified policy with the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {google.cloud.compute.v1.FirewallPolicy} request.firewallPolicyResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchFirewallPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + patchRule( + request?: protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + patchRule( + request: protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patchRule( + request: protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches a rule of the specified priority. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {google.cloud.compute.v1.FirewallPolicyRule} request.firewallPolicyRuleResource + * The body resource for this request + * @param {number} request.priority + * The priority of the rule to patch. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patchRule(request); + */ + patchRule( + request?: protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRuleFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.patchRule(request, options, callback); + } + removeAssociation( + request?: protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + removeAssociation( + request: protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeAssociation( + request: protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes an association for the specified firewall policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {string} request.name + * Name for the attachment that will be removed. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeAssociation(request); + */ + removeAssociation( + request?: protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveAssociationFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.removeAssociation(request, options, callback); + } + removeRule( + request?: protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + removeRule( + request: protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeRule( + request: protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a rule of the specified priority. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewallPolicy + * Name of the firewall policy to update. + * @param {number} request.priority + * The priority of the rule to remove from the firewall policy. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeRule(request); + */ + removeRule( + request?: protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveRuleFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + firewall_policy: request.firewallPolicy || '', + }); + this.initialize(); + return this.innerApiCalls.removeRule(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalOrganizationSetPolicyRequest} request.globalOrganizationSetPolicyRequestResource + * The body resource for this request + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsFirewallPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + resource: request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicy[], + protos.google.cloud.compute.v1.IListFirewallPoliciesRequest | null, + protos.google.cloud.compute.v1.IFirewallPolicyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + protos.google.cloud.compute.v1.IFirewallPolicyList | null | undefined, + protos.google.cloud.compute.v1.IFirewallPolicy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + protos.google.cloud.compute.v1.IFirewallPolicyList | null | undefined, + protos.google.cloud.compute.v1.IFirewallPolicy + > + ): void; + /** + * Lists all the policies that have been configured for the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.parentId + * Parent ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [FirewallPolicy]{@link google.cloud.compute.v1.FirewallPolicy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + protos.google.cloud.compute.v1.IFirewallPolicyList | null | undefined, + protos.google.cloud.compute.v1.IFirewallPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + protos.google.cloud.compute.v1.IFirewallPolicyList | null | undefined, + protos.google.cloud.compute.v1.IFirewallPolicy + > + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewallPolicy[], + protos.google.cloud.compute.v1.IListFirewallPoliciesRequest | null, + protos.google.cloud.compute.v1.IFirewallPolicyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.parentId + * Parent ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [FirewallPolicy]{@link google.cloud.compute.v1.FirewallPolicy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.parentId + * Parent ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [FirewallPolicy]{@link google.cloud.compute.v1.FirewallPolicy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListFirewallPoliciesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.firewallPoliciesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/firewall_policies_client_config.json b/src/v1/firewall_policies_client_config.json new file mode 100644 index 00000000..1888d5e8 --- /dev/null +++ b/src/v1/firewall_policies_client_config.json @@ -0,0 +1,98 @@ +{ + "interfaces": { + "google.cloud.compute.v1.FirewallPolicies": { + "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": { + "AddAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CloneRules": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAssociations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Move": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PatchRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/firewall_policies_proto_list.json b/src/v1/firewall_policies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/firewall_policies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/firewalls_client.ts b/src/v1/firewalls_client.ts new file mode 100644 index 00000000..ca15d50b --- /dev/null +++ b/src/v1/firewalls_client.ts @@ -0,0 +1,1024 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/firewalls_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './firewalls_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Firewalls API. + * @class + * @memberof v1 + */ +export class FirewallsClient { + 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}; + firewallsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FirewallsClient. + * + * @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 FirewallsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Firewalls', + 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 = gax.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.firewallsStub) { + return this.firewallsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Firewalls. + this.firewallsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Firewalls' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Firewalls, + 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 firewallsStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'update', + ]; + for (const methodName of firewallsStubMethods) { + const callPromise = this.firewallsStub.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.firewallsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteFirewallRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteFirewallRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteFirewallRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteFirewallRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified firewall. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewall + * Name of the firewall rule to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteFirewallRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteFirewallRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteFirewallRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteFirewallRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetFirewallRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewall, + protos.google.cloud.compute.v1.IGetFirewallRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetFirewallRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IFirewall, + protos.google.cloud.compute.v1.IGetFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetFirewallRequest, + callback: Callback< + protos.google.cloud.compute.v1.IFirewall, + protos.google.cloud.compute.v1.IGetFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified firewall. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewall + * Name of the firewall rule to return. + * @param {string} request.project + * Project ID for 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 [Firewall]{@link google.cloud.compute.v1.Firewall}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetFirewallRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IFirewall, + protos.google.cloud.compute.v1.IGetFirewallRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IFirewall, + protos.google.cloud.compute.v1.IGetFirewallRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewall, + protos.google.cloud.compute.v1.IGetFirewallRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertFirewallRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertFirewallRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertFirewallRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertFirewallRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a firewall rule in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Firewall} request.firewallResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertFirewallRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertFirewallRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertFirewallRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertFirewallRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchFirewallRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchFirewallRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchFirewallRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchFirewallRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewall + * Name of the firewall rule to patch. + * @param {google.cloud.compute.v1.Firewall} request.firewallResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchFirewallRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchFirewallRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchFirewallRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchFirewallRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateFirewallRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateFirewallRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateFirewallRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateFirewallRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateFirewallRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified firewall rule with the data included in the request. Note that all fields will be updated if using PUT, even fields that are not specified. To update individual fields, please use PATCH instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.firewall + * Name of the firewall rule to update. + * @param {google.cloud.compute.v1.Firewall} request.firewallResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateFirewallRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateFirewallRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateFirewallRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateFirewallRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListFirewallsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewall[], + protos.google.cloud.compute.v1.IListFirewallsRequest | null, + protos.google.cloud.compute.v1.IFirewallList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListFirewallsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallsRequest, + protos.google.cloud.compute.v1.IFirewallList | null | undefined, + protos.google.cloud.compute.v1.IFirewall + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListFirewallsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallsRequest, + protos.google.cloud.compute.v1.IFirewallList | null | undefined, + protos.google.cloud.compute.v1.IFirewall + > + ): void; + /** + * Retrieves the list of firewall rules available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Firewall]{@link google.cloud.compute.v1.Firewall}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListFirewallsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallsRequest, + protos.google.cloud.compute.v1.IFirewallList | null | undefined, + protos.google.cloud.compute.v1.IFirewall + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListFirewallsRequest, + protos.google.cloud.compute.v1.IFirewallList | null | undefined, + protos.google.cloud.compute.v1.IFirewall + > + ): Promise< + [ + protos.google.cloud.compute.v1.IFirewall[], + protos.google.cloud.compute.v1.IListFirewallsRequest | null, + protos.google.cloud.compute.v1.IFirewallList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Firewall]{@link google.cloud.compute.v1.Firewall} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListFirewallsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Firewall]{@link google.cloud.compute.v1.Firewall}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListFirewallsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.firewallsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/firewalls_client_config.json b/src/v1/firewalls_client_config.json new file mode 100644 index 00000000..9086e9d5 --- /dev/null +++ b/src/v1/firewalls_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Firewalls": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/firewalls_proto_list.json b/src/v1/firewalls_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/firewalls_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/forwarding_rules_client.ts b/src/v1/forwarding_rules_client.ts new file mode 100644 index 00000000..418acb8e --- /dev/null +++ b/src/v1/forwarding_rules_client.ts @@ -0,0 +1,1265 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/forwarding_rules_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './forwarding_rules_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The ForwardingRules API. + * @class + * @memberof v1 + */ +export class ForwardingRulesClient { + 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}; + forwardingRulesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ForwardingRulesClient. + * + * @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 ForwardingRulesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.ForwardingRules', + 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 = gax.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.forwardingRulesStub) { + return this.forwardingRulesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.ForwardingRules. + this.forwardingRulesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.ForwardingRules' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.ForwardingRules, + 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 forwardingRulesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'setLabels', + 'setTarget', + ]; + for (const methodName of forwardingRulesStubMethods) { + const callPromise = this.forwardingRulesStub.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.forwardingRulesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified ForwardingRule resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteForwardingRuleRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule, + protos.google.cloud.compute.v1.IGetForwardingRuleRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified ForwardingRule resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule, + protos.google.cloud.compute.v1.IGetForwardingRuleRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertForwardingRuleRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a ForwardingRule resource in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.ForwardingRule} request.forwardingRuleResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertForwardingRuleRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchForwardingRuleRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource to patch. + * @param {google.cloud.compute.v1.ForwardingRule} request.forwardingRuleResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchForwardingRuleRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The region for this request. + * @param {google.cloud.compute.v1.RegionSetLabelsRequest} request.regionSetLabelsRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.resource + * Name or id of the resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetLabelsForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + setTarget( + request?: protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + setTarget( + request: protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setTarget( + request: protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes target URL for forwarding rule. The new target should be of the same type as the old target. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource in which target is to be set. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetReference} request.targetReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setTarget(request); + */ + setTarget( + request?: protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setTarget(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [ForwardingRulesScopedList]{@link google.cloud.compute.v1.ForwardingRulesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListForwardingRulesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IForwardingRulesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IForwardingRulesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListForwardingRulesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule[], + protos.google.cloud.compute.v1.IListForwardingRulesRequest | null, + protos.google.cloud.compute.v1.IForwardingRuleList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListForwardingRulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListForwardingRulesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + > + ): void; + /** + * Retrieves a list of ForwardingRule resources available to the specified project and region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListForwardingRulesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + > + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule[], + protos.google.cloud.compute.v1.IListForwardingRulesRequest | null, + protos.google.cloud.compute.v1.IForwardingRuleList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListForwardingRulesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListForwardingRulesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.forwardingRulesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/forwarding_rules_client_config.json b/src/v1/forwarding_rules_client_config.json new file mode 100644 index 00000000..f954dc6c --- /dev/null +++ b/src/v1/forwarding_rules_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ForwardingRules": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetTarget": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/forwarding_rules_proto_list.json b/src/v1/forwarding_rules_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/forwarding_rules_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json new file mode 100644 index 00000000..1aaf458b --- /dev/null +++ b/src/v1/gapic_metadata.json @@ -0,0 +1,7345 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.compute.v1", + "libraryPackage": "@google-cloud/compute", + "services": { + "AcceleratorTypes": { + "clients": { + "grpc": { + "libraryClient": "AcceleratorTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AcceleratorTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Addresses": { + "clients": { + "grpc": { + "libraryClient": "AddressesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AddressesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Autoscalers": { + "clients": { + "grpc": { + "libraryClient": "AutoscalersClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutoscalersClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "BackendBuckets": { + "clients": { + "grpc": { + "libraryClient": "BackendBucketsClient", + "rpcs": { + "AddSignedUrlKey": { + "methods": [ + "addSignedUrlKey" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteSignedUrlKey": { + "methods": [ + "deleteSignedUrlKey" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BackendBucketsClient", + "rpcs": { + "AddSignedUrlKey": { + "methods": [ + "addSignedUrlKey" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteSignedUrlKey": { + "methods": [ + "deleteSignedUrlKey" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "BackendServices": { + "clients": { + "grpc": { + "libraryClient": "BackendServicesClient", + "rpcs": { + "AddSignedUrlKey": { + "methods": [ + "addSignedUrlKey" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteSignedUrlKey": { + "methods": [ + "deleteSignedUrlKey" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetHealth": { + "methods": [ + "getHealth" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetSecurityPolicy": { + "methods": [ + "setSecurityPolicy" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BackendServicesClient", + "rpcs": { + "AddSignedUrlKey": { + "methods": [ + "addSignedUrlKey" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteSignedUrlKey": { + "methods": [ + "deleteSignedUrlKey" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetHealth": { + "methods": [ + "getHealth" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetSecurityPolicy": { + "methods": [ + "setSecurityPolicy" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Disks": { + "clients": { + "grpc": { + "libraryClient": "DisksClient", + "rpcs": { + "AddResourcePolicies": { + "methods": [ + "addResourcePolicies" + ] + }, + "CreateSnapshot": { + "methods": [ + "createSnapshot" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "removeResourcePolicies" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DisksClient", + "rpcs": { + "AddResourcePolicies": { + "methods": [ + "addResourcePolicies" + ] + }, + "CreateSnapshot": { + "methods": [ + "createSnapshot" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "removeResourcePolicies" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "DiskTypes": { + "clients": { + "grpc": { + "libraryClient": "DiskTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DiskTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "ExternalVpnGateways": { + "clients": { + "grpc": { + "libraryClient": "ExternalVpnGatewaysClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ExternalVpnGatewaysClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "FirewallPolicies": { + "clients": { + "grpc": { + "libraryClient": "FirewallPoliciesClient", + "rpcs": { + "AddAssociation": { + "methods": [ + "addAssociation" + ] + }, + "AddRule": { + "methods": [ + "addRule" + ] + }, + "CloneRules": { + "methods": [ + "cloneRules" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetAssociation": { + "methods": [ + "getAssociation" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetRule": { + "methods": [ + "getRule" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "ListAssociations": { + "methods": [ + "listAssociations" + ] + }, + "Move": { + "methods": [ + "move" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchRule": { + "methods": [ + "patchRule" + ] + }, + "RemoveAssociation": { + "methods": [ + "removeAssociation" + ] + }, + "RemoveRule": { + "methods": [ + "removeRule" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FirewallPoliciesClient", + "rpcs": { + "AddAssociation": { + "methods": [ + "addAssociation" + ] + }, + "AddRule": { + "methods": [ + "addRule" + ] + }, + "CloneRules": { + "methods": [ + "cloneRules" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetAssociation": { + "methods": [ + "getAssociation" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetRule": { + "methods": [ + "getRule" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "ListAssociations": { + "methods": [ + "listAssociations" + ] + }, + "Move": { + "methods": [ + "move" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchRule": { + "methods": [ + "patchRule" + ] + }, + "RemoveAssociation": { + "methods": [ + "removeAssociation" + ] + }, + "RemoveRule": { + "methods": [ + "removeRule" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Firewalls": { + "clients": { + "grpc": { + "libraryClient": "FirewallsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FirewallsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "ForwardingRules": { + "clients": { + "grpc": { + "libraryClient": "ForwardingRulesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetTarget": { + "methods": [ + "setTarget" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ForwardingRulesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetTarget": { + "methods": [ + "setTarget" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "GlobalAddresses": { + "clients": { + "grpc": { + "libraryClient": "GlobalAddressesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GlobalAddressesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "GlobalForwardingRules": { + "clients": { + "grpc": { + "libraryClient": "GlobalForwardingRulesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetTarget": { + "methods": [ + "setTarget" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GlobalForwardingRulesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetTarget": { + "methods": [ + "setTarget" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "GlobalNetworkEndpointGroups": { + "clients": { + "grpc": { + "libraryClient": "GlobalNetworkEndpointGroupsClient", + "rpcs": { + "AttachNetworkEndpoints": { + "methods": [ + "attachNetworkEndpoints" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DetachNetworkEndpoints": { + "methods": [ + "detachNetworkEndpoints" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListNetworkEndpoints": { + "methods": [ + "listNetworkEndpoints", + "listNetworkEndpointsStream", + "listNetworkEndpointsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GlobalNetworkEndpointGroupsClient", + "rpcs": { + "AttachNetworkEndpoints": { + "methods": [ + "attachNetworkEndpoints" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DetachNetworkEndpoints": { + "methods": [ + "detachNetworkEndpoints" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListNetworkEndpoints": { + "methods": [ + "listNetworkEndpoints", + "listNetworkEndpointsStream", + "listNetworkEndpointsAsync" + ] + } + } + } + } + }, + "GlobalOperations": { + "clients": { + "grpc": { + "libraryClient": "GlobalOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Wait": { + "methods": [ + "wait" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GlobalOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Wait": { + "methods": [ + "wait" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "GlobalOrganizationOperations": { + "clients": { + "grpc": { + "libraryClient": "GlobalOrganizationOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GlobalOrganizationOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "GlobalPublicDelegatedPrefixes": { + "clients": { + "grpc": { + "libraryClient": "GlobalPublicDelegatedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GlobalPublicDelegatedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "HealthChecks": { + "clients": { + "grpc": { + "libraryClient": "HealthChecksClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "HealthChecksClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Images": { + "clients": { + "grpc": { + "libraryClient": "ImagesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Deprecate": { + "methods": [ + "deprecate" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetFromFamily": { + "methods": [ + "getFromFamily" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ImagesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Deprecate": { + "methods": [ + "deprecate" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetFromFamily": { + "methods": [ + "getFromFamily" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "InstanceGroupManagers": { + "clients": { + "grpc": { + "libraryClient": "InstanceGroupManagersClient", + "rpcs": { + "AbandonInstances": { + "methods": [ + "abandonInstances" + ] + }, + "ApplyUpdatesToInstances": { + "methods": [ + "applyUpdatesToInstances" + ] + }, + "CreateInstances": { + "methods": [ + "createInstances" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteInstances": { + "methods": [ + "deleteInstances" + ] + }, + "DeletePerInstanceConfigs": { + "methods": [ + "deletePerInstanceConfigs" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchPerInstanceConfigs": { + "methods": [ + "patchPerInstanceConfigs" + ] + }, + "RecreateInstances": { + "methods": [ + "recreateInstances" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetInstanceTemplate": { + "methods": [ + "setInstanceTemplate" + ] + }, + "SetTargetPools": { + "methods": [ + "setTargetPools" + ] + }, + "UpdatePerInstanceConfigs": { + "methods": [ + "updatePerInstanceConfigs" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListErrors": { + "methods": [ + "listErrors", + "listErrorsStream", + "listErrorsAsync" + ] + }, + "ListManagedInstances": { + "methods": [ + "listManagedInstances", + "listManagedInstancesStream", + "listManagedInstancesAsync" + ] + }, + "ListPerInstanceConfigs": { + "methods": [ + "listPerInstanceConfigs", + "listPerInstanceConfigsStream", + "listPerInstanceConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstanceGroupManagersClient", + "rpcs": { + "AbandonInstances": { + "methods": [ + "abandonInstances" + ] + }, + "ApplyUpdatesToInstances": { + "methods": [ + "applyUpdatesToInstances" + ] + }, + "CreateInstances": { + "methods": [ + "createInstances" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteInstances": { + "methods": [ + "deleteInstances" + ] + }, + "DeletePerInstanceConfigs": { + "methods": [ + "deletePerInstanceConfigs" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchPerInstanceConfigs": { + "methods": [ + "patchPerInstanceConfigs" + ] + }, + "RecreateInstances": { + "methods": [ + "recreateInstances" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetInstanceTemplate": { + "methods": [ + "setInstanceTemplate" + ] + }, + "SetTargetPools": { + "methods": [ + "setTargetPools" + ] + }, + "UpdatePerInstanceConfigs": { + "methods": [ + "updatePerInstanceConfigs" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListErrors": { + "methods": [ + "listErrors", + "listErrorsStream", + "listErrorsAsync" + ] + }, + "ListManagedInstances": { + "methods": [ + "listManagedInstances", + "listManagedInstancesStream", + "listManagedInstancesAsync" + ] + }, + "ListPerInstanceConfigs": { + "methods": [ + "listPerInstanceConfigs", + "listPerInstanceConfigsStream", + "listPerInstanceConfigsAsync" + ] + } + } + } + } + }, + "InstanceGroups": { + "clients": { + "grpc": { + "libraryClient": "InstanceGroupsClient", + "rpcs": { + "AddInstances": { + "methods": [ + "addInstances" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveInstances": { + "methods": [ + "removeInstances" + ] + }, + "SetNamedPorts": { + "methods": [ + "setNamedPorts" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstanceGroupsClient", + "rpcs": { + "AddInstances": { + "methods": [ + "addInstances" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveInstances": { + "methods": [ + "removeInstances" + ] + }, + "SetNamedPorts": { + "methods": [ + "setNamedPorts" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + }, + "Instances": { + "clients": { + "grpc": { + "libraryClient": "InstancesClient", + "rpcs": { + "AddAccessConfig": { + "methods": [ + "addAccessConfig" + ] + }, + "AddResourcePolicies": { + "methods": [ + "addResourcePolicies" + ] + }, + "AttachDisk": { + "methods": [ + "attachDisk" + ] + }, + "BulkInsert": { + "methods": [ + "bulkInsert" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteAccessConfig": { + "methods": [ + "deleteAccessConfig" + ] + }, + "DetachDisk": { + "methods": [ + "detachDisk" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetEffectiveFirewalls": { + "methods": [ + "getEffectiveFirewalls" + ] + }, + "GetGuestAttributes": { + "methods": [ + "getGuestAttributes" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetScreenshot": { + "methods": [ + "getScreenshot" + ] + }, + "GetSerialPortOutput": { + "methods": [ + "getSerialPortOutput" + ] + }, + "GetShieldedInstanceIdentity": { + "methods": [ + "getShieldedInstanceIdentity" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "removeResourcePolicies" + ] + }, + "Reset": { + "methods": [ + "reset" + ] + }, + "SetDeletionProtection": { + "methods": [ + "setDeletionProtection" + ] + }, + "SetDiskAutoDelete": { + "methods": [ + "setDiskAutoDelete" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetMachineResources": { + "methods": [ + "setMachineResources" + ] + }, + "SetMachineType": { + "methods": [ + "setMachineType" + ] + }, + "SetMetadata": { + "methods": [ + "setMetadata" + ] + }, + "SetMinCpuPlatform": { + "methods": [ + "setMinCpuPlatform" + ] + }, + "SetScheduling": { + "methods": [ + "setScheduling" + ] + }, + "SetServiceAccount": { + "methods": [ + "setServiceAccount" + ] + }, + "SetShieldedInstanceIntegrityPolicy": { + "methods": [ + "setShieldedInstanceIntegrityPolicy" + ] + }, + "SetTags": { + "methods": [ + "setTags" + ] + }, + "SimulateMaintenanceEvent": { + "methods": [ + "simulateMaintenanceEvent" + ] + }, + "Start": { + "methods": [ + "start" + ] + }, + "StartWithEncryptionKey": { + "methods": [ + "startWithEncryptionKey" + ] + }, + "Stop": { + "methods": [ + "stop" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "UpdateAccessConfig": { + "methods": [ + "updateAccessConfig" + ] + }, + "UpdateDisplayDevice": { + "methods": [ + "updateDisplayDevice" + ] + }, + "UpdateNetworkInterface": { + "methods": [ + "updateNetworkInterface" + ] + }, + "UpdateShieldedInstanceConfig": { + "methods": [ + "updateShieldedInstanceConfig" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListReferrers": { + "methods": [ + "listReferrers", + "listReferrersStream", + "listReferrersAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstancesClient", + "rpcs": { + "AddAccessConfig": { + "methods": [ + "addAccessConfig" + ] + }, + "AddResourcePolicies": { + "methods": [ + "addResourcePolicies" + ] + }, + "AttachDisk": { + "methods": [ + "attachDisk" + ] + }, + "BulkInsert": { + "methods": [ + "bulkInsert" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteAccessConfig": { + "methods": [ + "deleteAccessConfig" + ] + }, + "DetachDisk": { + "methods": [ + "detachDisk" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetEffectiveFirewalls": { + "methods": [ + "getEffectiveFirewalls" + ] + }, + "GetGuestAttributes": { + "methods": [ + "getGuestAttributes" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "GetScreenshot": { + "methods": [ + "getScreenshot" + ] + }, + "GetSerialPortOutput": { + "methods": [ + "getSerialPortOutput" + ] + }, + "GetShieldedInstanceIdentity": { + "methods": [ + "getShieldedInstanceIdentity" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "removeResourcePolicies" + ] + }, + "Reset": { + "methods": [ + "reset" + ] + }, + "SetDeletionProtection": { + "methods": [ + "setDeletionProtection" + ] + }, + "SetDiskAutoDelete": { + "methods": [ + "setDiskAutoDelete" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "SetMachineResources": { + "methods": [ + "setMachineResources" + ] + }, + "SetMachineType": { + "methods": [ + "setMachineType" + ] + }, + "SetMetadata": { + "methods": [ + "setMetadata" + ] + }, + "SetMinCpuPlatform": { + "methods": [ + "setMinCpuPlatform" + ] + }, + "SetScheduling": { + "methods": [ + "setScheduling" + ] + }, + "SetServiceAccount": { + "methods": [ + "setServiceAccount" + ] + }, + "SetShieldedInstanceIntegrityPolicy": { + "methods": [ + "setShieldedInstanceIntegrityPolicy" + ] + }, + "SetTags": { + "methods": [ + "setTags" + ] + }, + "SimulateMaintenanceEvent": { + "methods": [ + "simulateMaintenanceEvent" + ] + }, + "Start": { + "methods": [ + "start" + ] + }, + "StartWithEncryptionKey": { + "methods": [ + "startWithEncryptionKey" + ] + }, + "Stop": { + "methods": [ + "stop" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "UpdateAccessConfig": { + "methods": [ + "updateAccessConfig" + ] + }, + "UpdateDisplayDevice": { + "methods": [ + "updateDisplayDevice" + ] + }, + "UpdateNetworkInterface": { + "methods": [ + "updateNetworkInterface" + ] + }, + "UpdateShieldedInstanceConfig": { + "methods": [ + "updateShieldedInstanceConfig" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListReferrers": { + "methods": [ + "listReferrers", + "listReferrersStream", + "listReferrersAsync" + ] + } + } + } + } + }, + "InstanceTemplates": { + "clients": { + "grpc": { + "libraryClient": "InstanceTemplatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InstanceTemplatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "InterconnectAttachments": { + "clients": { + "grpc": { + "libraryClient": "InterconnectAttachmentsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InterconnectAttachmentsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "InterconnectLocations": { + "clients": { + "grpc": { + "libraryClient": "InterconnectLocationsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InterconnectLocationsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Interconnects": { + "clients": { + "grpc": { + "libraryClient": "InterconnectsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetDiagnostics": { + "methods": [ + "getDiagnostics" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "InterconnectsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetDiagnostics": { + "methods": [ + "getDiagnostics" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "LicenseCodes": { + "clients": { + "grpc": { + "libraryClient": "LicenseCodesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LicenseCodesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + } + } + } + } + }, + "Licenses": { + "clients": { + "grpc": { + "libraryClient": "LicensesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "LicensesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "MachineTypes": { + "clients": { + "grpc": { + "libraryClient": "MachineTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "MachineTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "NetworkEndpointGroups": { + "clients": { + "grpc": { + "libraryClient": "NetworkEndpointGroupsClient", + "rpcs": { + "AttachNetworkEndpoints": { + "methods": [ + "attachNetworkEndpoints" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DetachNetworkEndpoints": { + "methods": [ + "detachNetworkEndpoints" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListNetworkEndpoints": { + "methods": [ + "listNetworkEndpoints", + "listNetworkEndpointsStream", + "listNetworkEndpointsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NetworkEndpointGroupsClient", + "rpcs": { + "AttachNetworkEndpoints": { + "methods": [ + "attachNetworkEndpoints" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DetachNetworkEndpoints": { + "methods": [ + "detachNetworkEndpoints" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListNetworkEndpoints": { + "methods": [ + "listNetworkEndpoints", + "listNetworkEndpointsStream", + "listNetworkEndpointsAsync" + ] + } + } + } + } + }, + "Networks": { + "clients": { + "grpc": { + "libraryClient": "NetworksClient", + "rpcs": { + "AddPeering": { + "methods": [ + "addPeering" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetEffectiveFirewalls": { + "methods": [ + "getEffectiveFirewalls" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "RemovePeering": { + "methods": [ + "removePeering" + ] + }, + "SwitchToCustomMode": { + "methods": [ + "switchToCustomMode" + ] + }, + "UpdatePeering": { + "methods": [ + "updatePeering" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListPeeringRoutes": { + "methods": [ + "listPeeringRoutes", + "listPeeringRoutesStream", + "listPeeringRoutesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NetworksClient", + "rpcs": { + "AddPeering": { + "methods": [ + "addPeering" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetEffectiveFirewalls": { + "methods": [ + "getEffectiveFirewalls" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "RemovePeering": { + "methods": [ + "removePeering" + ] + }, + "SwitchToCustomMode": { + "methods": [ + "switchToCustomMode" + ] + }, + "UpdatePeering": { + "methods": [ + "updatePeering" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListPeeringRoutes": { + "methods": [ + "listPeeringRoutes", + "listPeeringRoutesStream", + "listPeeringRoutesAsync" + ] + } + } + } + } + }, + "NodeGroups": { + "clients": { + "grpc": { + "libraryClient": "NodeGroupsClient", + "rpcs": { + "AddNodes": { + "methods": [ + "addNodes" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteNodes": { + "methods": [ + "deleteNodes" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetNodeTemplate": { + "methods": [ + "setNodeTemplate" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListNodes": { + "methods": [ + "listNodes", + "listNodesStream", + "listNodesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NodeGroupsClient", + "rpcs": { + "AddNodes": { + "methods": [ + "addNodes" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteNodes": { + "methods": [ + "deleteNodes" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetNodeTemplate": { + "methods": [ + "setNodeTemplate" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListNodes": { + "methods": [ + "listNodes", + "listNodesStream", + "listNodesAsync" + ] + } + } + } + } + }, + "NodeTemplates": { + "clients": { + "grpc": { + "libraryClient": "NodeTemplatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NodeTemplatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "NodeTypes": { + "clients": { + "grpc": { + "libraryClient": "NodeTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NodeTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "PacketMirrorings": { + "clients": { + "grpc": { + "libraryClient": "PacketMirroringsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PacketMirroringsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Projects": { + "clients": { + "grpc": { + "libraryClient": "ProjectsClient", + "rpcs": { + "DisableXpnHost": { + "methods": [ + "disableXpnHost" + ] + }, + "DisableXpnResource": { + "methods": [ + "disableXpnResource" + ] + }, + "EnableXpnHost": { + "methods": [ + "enableXpnHost" + ] + }, + "EnableXpnResource": { + "methods": [ + "enableXpnResource" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetXpnHost": { + "methods": [ + "getXpnHost" + ] + }, + "MoveDisk": { + "methods": [ + "moveDisk" + ] + }, + "MoveInstance": { + "methods": [ + "moveInstance" + ] + }, + "SetCommonInstanceMetadata": { + "methods": [ + "setCommonInstanceMetadata" + ] + }, + "SetDefaultNetworkTier": { + "methods": [ + "setDefaultNetworkTier" + ] + }, + "SetUsageExportBucket": { + "methods": [ + "setUsageExportBucket" + ] + }, + "GetXpnResources": { + "methods": [ + "getXpnResources", + "getXpnResourcesStream", + "getXpnResourcesAsync" + ] + }, + "ListXpnHosts": { + "methods": [ + "listXpnHosts", + "listXpnHostsStream", + "listXpnHostsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ProjectsClient", + "rpcs": { + "DisableXpnHost": { + "methods": [ + "disableXpnHost" + ] + }, + "DisableXpnResource": { + "methods": [ + "disableXpnResource" + ] + }, + "EnableXpnHost": { + "methods": [ + "enableXpnHost" + ] + }, + "EnableXpnResource": { + "methods": [ + "enableXpnResource" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetXpnHost": { + "methods": [ + "getXpnHost" + ] + }, + "MoveDisk": { + "methods": [ + "moveDisk" + ] + }, + "MoveInstance": { + "methods": [ + "moveInstance" + ] + }, + "SetCommonInstanceMetadata": { + "methods": [ + "setCommonInstanceMetadata" + ] + }, + "SetDefaultNetworkTier": { + "methods": [ + "setDefaultNetworkTier" + ] + }, + "SetUsageExportBucket": { + "methods": [ + "setUsageExportBucket" + ] + }, + "GetXpnResources": { + "methods": [ + "getXpnResources", + "getXpnResourcesStream", + "getXpnResourcesAsync" + ] + }, + "ListXpnHosts": { + "methods": [ + "listXpnHosts", + "listXpnHostsStream", + "listXpnHostsAsync" + ] + } + } + } + } + }, + "PublicAdvertisedPrefixes": { + "clients": { + "grpc": { + "libraryClient": "PublicAdvertisedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PublicAdvertisedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "PublicDelegatedPrefixes": { + "clients": { + "grpc": { + "libraryClient": "PublicDelegatedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PublicDelegatedPrefixesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionAutoscalers": { + "clients": { + "grpc": { + "libraryClient": "RegionAutoscalersClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionAutoscalersClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionBackendServices": { + "clients": { + "grpc": { + "libraryClient": "RegionBackendServicesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetHealth": { + "methods": [ + "getHealth" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionBackendServicesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetHealth": { + "methods": [ + "getHealth" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionCommitments": { + "clients": { + "grpc": { + "libraryClient": "RegionCommitmentsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionCommitmentsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionDisks": { + "clients": { + "grpc": { + "libraryClient": "RegionDisksClient", + "rpcs": { + "AddResourcePolicies": { + "methods": [ + "addResourcePolicies" + ] + }, + "CreateSnapshot": { + "methods": [ + "createSnapshot" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "removeResourcePolicies" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionDisksClient", + "rpcs": { + "AddResourcePolicies": { + "methods": [ + "addResourcePolicies" + ] + }, + "CreateSnapshot": { + "methods": [ + "createSnapshot" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveResourcePolicies": { + "methods": [ + "removeResourcePolicies" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionDiskTypes": { + "clients": { + "grpc": { + "libraryClient": "RegionDiskTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionDiskTypesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionHealthChecks": { + "clients": { + "grpc": { + "libraryClient": "RegionHealthChecksClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionHealthChecksClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionHealthCheckServices": { + "clients": { + "grpc": { + "libraryClient": "RegionHealthCheckServicesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionHealthCheckServicesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionInstanceGroupManagers": { + "clients": { + "grpc": { + "libraryClient": "RegionInstanceGroupManagersClient", + "rpcs": { + "AbandonInstances": { + "methods": [ + "abandonInstances" + ] + }, + "ApplyUpdatesToInstances": { + "methods": [ + "applyUpdatesToInstances" + ] + }, + "CreateInstances": { + "methods": [ + "createInstances" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteInstances": { + "methods": [ + "deleteInstances" + ] + }, + "DeletePerInstanceConfigs": { + "methods": [ + "deletePerInstanceConfigs" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchPerInstanceConfigs": { + "methods": [ + "patchPerInstanceConfigs" + ] + }, + "RecreateInstances": { + "methods": [ + "recreateInstances" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetInstanceTemplate": { + "methods": [ + "setInstanceTemplate" + ] + }, + "SetTargetPools": { + "methods": [ + "setTargetPools" + ] + }, + "UpdatePerInstanceConfigs": { + "methods": [ + "updatePerInstanceConfigs" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListErrors": { + "methods": [ + "listErrors", + "listErrorsStream", + "listErrorsAsync" + ] + }, + "ListManagedInstances": { + "methods": [ + "listManagedInstances", + "listManagedInstancesStream", + "listManagedInstancesAsync" + ] + }, + "ListPerInstanceConfigs": { + "methods": [ + "listPerInstanceConfigs", + "listPerInstanceConfigsStream", + "listPerInstanceConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionInstanceGroupManagersClient", + "rpcs": { + "AbandonInstances": { + "methods": [ + "abandonInstances" + ] + }, + "ApplyUpdatesToInstances": { + "methods": [ + "applyUpdatesToInstances" + ] + }, + "CreateInstances": { + "methods": [ + "createInstances" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "DeleteInstances": { + "methods": [ + "deleteInstances" + ] + }, + "DeletePerInstanceConfigs": { + "methods": [ + "deletePerInstanceConfigs" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchPerInstanceConfigs": { + "methods": [ + "patchPerInstanceConfigs" + ] + }, + "RecreateInstances": { + "methods": [ + "recreateInstances" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetInstanceTemplate": { + "methods": [ + "setInstanceTemplate" + ] + }, + "SetTargetPools": { + "methods": [ + "setTargetPools" + ] + }, + "UpdatePerInstanceConfigs": { + "methods": [ + "updatePerInstanceConfigs" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListErrors": { + "methods": [ + "listErrors", + "listErrorsStream", + "listErrorsAsync" + ] + }, + "ListManagedInstances": { + "methods": [ + "listManagedInstances", + "listManagedInstancesStream", + "listManagedInstancesAsync" + ] + }, + "ListPerInstanceConfigs": { + "methods": [ + "listPerInstanceConfigs", + "listPerInstanceConfigsStream", + "listPerInstanceConfigsAsync" + ] + } + } + } + } + }, + "RegionInstanceGroups": { + "clients": { + "grpc": { + "libraryClient": "RegionInstanceGroupsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "SetNamedPorts": { + "methods": [ + "setNamedPorts" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionInstanceGroupsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "SetNamedPorts": { + "methods": [ + "setNamedPorts" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + }, + "RegionInstances": { + "clients": { + "grpc": { + "libraryClient": "RegionInstancesClient", + "rpcs": { + "BulkInsert": { + "methods": [ + "bulkInsert" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionInstancesClient", + "rpcs": { + "BulkInsert": { + "methods": [ + "bulkInsert" + ] + } + } + } + } + }, + "RegionNetworkEndpointGroups": { + "clients": { + "grpc": { + "libraryClient": "RegionNetworkEndpointGroupsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionNetworkEndpointGroupsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionNotificationEndpoints": { + "clients": { + "grpc": { + "libraryClient": "RegionNotificationEndpointsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionNotificationEndpointsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionOperations": { + "clients": { + "grpc": { + "libraryClient": "RegionOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Wait": { + "methods": [ + "wait" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Wait": { + "methods": [ + "wait" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Regions": { + "clients": { + "grpc": { + "libraryClient": "RegionsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionsClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionSslCertificates": { + "clients": { + "grpc": { + "libraryClient": "RegionSslCertificatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionSslCertificatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionTargetHttpProxies": { + "clients": { + "grpc": { + "libraryClient": "RegionTargetHttpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionTargetHttpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionTargetHttpsProxies": { + "clients": { + "grpc": { + "libraryClient": "RegionTargetHttpsProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetSslCertificates": { + "methods": [ + "setSslCertificates" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionTargetHttpsProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetSslCertificates": { + "methods": [ + "setSslCertificates" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "RegionUrlMaps": { + "clients": { + "grpc": { + "libraryClient": "RegionUrlMapsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "Validate": { + "methods": [ + "validate" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RegionUrlMapsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "Validate": { + "methods": [ + "validate" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Reservations": { + "clients": { + "grpc": { + "libraryClient": "ReservationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ReservationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Resize": { + "methods": [ + "resize" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "ResourcePolicies": { + "clients": { + "grpc": { + "libraryClient": "ResourcePoliciesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ResourcePoliciesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Routers": { + "clients": { + "grpc": { + "libraryClient": "RoutersClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetRouterStatus": { + "methods": [ + "getRouterStatus" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Preview": { + "methods": [ + "preview" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "GetNatMappingInfo": { + "methods": [ + "getNatMappingInfo", + "getNatMappingInfoStream", + "getNatMappingInfoAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RoutersClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetRouterStatus": { + "methods": [ + "getRouterStatus" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Preview": { + "methods": [ + "preview" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "GetNatMappingInfo": { + "methods": [ + "getNatMappingInfo", + "getNatMappingInfoStream", + "getNatMappingInfoAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Routes": { + "clients": { + "grpc": { + "libraryClient": "RoutesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RoutesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "SecurityPolicies": { + "clients": { + "grpc": { + "libraryClient": "SecurityPoliciesClient", + "rpcs": { + "AddRule": { + "methods": [ + "addRule" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetRule": { + "methods": [ + "getRule" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "ListPreconfiguredExpressionSets": { + "methods": [ + "listPreconfiguredExpressionSets" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchRule": { + "methods": [ + "patchRule" + ] + }, + "RemoveRule": { + "methods": [ + "removeRule" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SecurityPoliciesClient", + "rpcs": { + "AddRule": { + "methods": [ + "addRule" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetRule": { + "methods": [ + "getRule" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "ListPreconfiguredExpressionSets": { + "methods": [ + "listPreconfiguredExpressionSets" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "PatchRule": { + "methods": [ + "patchRule" + ] + }, + "RemoveRule": { + "methods": [ + "removeRule" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Snapshots": { + "clients": { + "grpc": { + "libraryClient": "SnapshotsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SnapshotsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "SslCertificates": { + "clients": { + "grpc": { + "libraryClient": "SslCertificatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SslCertificatesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "SslPolicies": { + "clients": { + "grpc": { + "libraryClient": "SslPoliciesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "ListAvailableFeatures": { + "methods": [ + "listAvailableFeatures" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SslPoliciesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "ListAvailableFeatures": { + "methods": [ + "listAvailableFeatures" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Subnetworks": { + "clients": { + "grpc": { + "libraryClient": "SubnetworksClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "ExpandIpCidrRange": { + "methods": [ + "expandIpCidrRange" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetPrivateIpGoogleAccess": { + "methods": [ + "setPrivateIpGoogleAccess" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListUsable": { + "methods": [ + "listUsable", + "listUsableStream", + "listUsableAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SubnetworksClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "ExpandIpCidrRange": { + "methods": [ + "expandIpCidrRange" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetIamPolicy": { + "methods": [ + "getIamPolicy" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetIamPolicy": { + "methods": [ + "setIamPolicy" + ] + }, + "SetPrivateIpGoogleAccess": { + "methods": [ + "setPrivateIpGoogleAccess" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + }, + "ListUsable": { + "methods": [ + "listUsable", + "listUsableStream", + "listUsableAsync" + ] + } + } + } + } + }, + "TargetGrpcProxies": { + "clients": { + "grpc": { + "libraryClient": "TargetGrpcProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetGrpcProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "TargetHttpProxies": { + "clients": { + "grpc": { + "libraryClient": "TargetHttpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetHttpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "TargetHttpsProxies": { + "clients": { + "grpc": { + "libraryClient": "TargetHttpsProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetQuicOverride": { + "methods": [ + "setQuicOverride" + ] + }, + "SetSslCertificates": { + "methods": [ + "setSslCertificates" + ] + }, + "SetSslPolicy": { + "methods": [ + "setSslPolicy" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetHttpsProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "SetQuicOverride": { + "methods": [ + "setQuicOverride" + ] + }, + "SetSslCertificates": { + "methods": [ + "setSslCertificates" + ] + }, + "SetSslPolicy": { + "methods": [ + "setSslPolicy" + ] + }, + "SetUrlMap": { + "methods": [ + "setUrlMap" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "TargetInstances": { + "clients": { + "grpc": { + "libraryClient": "TargetInstancesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetInstancesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "TargetPools": { + "clients": { + "grpc": { + "libraryClient": "TargetPoolsClient", + "rpcs": { + "AddHealthCheck": { + "methods": [ + "addHealthCheck" + ] + }, + "AddInstance": { + "methods": [ + "addInstance" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetHealth": { + "methods": [ + "getHealth" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveHealthCheck": { + "methods": [ + "removeHealthCheck" + ] + }, + "RemoveInstance": { + "methods": [ + "removeInstance" + ] + }, + "SetBackup": { + "methods": [ + "setBackup" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetPoolsClient", + "rpcs": { + "AddHealthCheck": { + "methods": [ + "addHealthCheck" + ] + }, + "AddInstance": { + "methods": [ + "addInstance" + ] + }, + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetHealth": { + "methods": [ + "getHealth" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "RemoveHealthCheck": { + "methods": [ + "removeHealthCheck" + ] + }, + "RemoveInstance": { + "methods": [ + "removeInstance" + ] + }, + "SetBackup": { + "methods": [ + "setBackup" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "TargetSslProxies": { + "clients": { + "grpc": { + "libraryClient": "TargetSslProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetBackendService": { + "methods": [ + "setBackendService" + ] + }, + "SetProxyHeader": { + "methods": [ + "setProxyHeader" + ] + }, + "SetSslCertificates": { + "methods": [ + "setSslCertificates" + ] + }, + "SetSslPolicy": { + "methods": [ + "setSslPolicy" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetSslProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetBackendService": { + "methods": [ + "setBackendService" + ] + }, + "SetProxyHeader": { + "methods": [ + "setProxyHeader" + ] + }, + "SetSslCertificates": { + "methods": [ + "setSslCertificates" + ] + }, + "SetSslPolicy": { + "methods": [ + "setSslPolicy" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "TargetTcpProxies": { + "clients": { + "grpc": { + "libraryClient": "TargetTcpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetBackendService": { + "methods": [ + "setBackendService" + ] + }, + "SetProxyHeader": { + "methods": [ + "setProxyHeader" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetTcpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetBackendService": { + "methods": [ + "setBackendService" + ] + }, + "SetProxyHeader": { + "methods": [ + "setProxyHeader" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "TargetVpnGateways": { + "clients": { + "grpc": { + "libraryClient": "TargetVpnGatewaysClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TargetVpnGatewaysClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "UrlMaps": { + "clients": { + "grpc": { + "libraryClient": "UrlMapsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "InvalidateCache": { + "methods": [ + "invalidateCache" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "Validate": { + "methods": [ + "validate" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "UrlMapsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "InvalidateCache": { + "methods": [ + "invalidateCache" + ] + }, + "Patch": { + "methods": [ + "patch" + ] + }, + "Update": { + "methods": [ + "update" + ] + }, + "Validate": { + "methods": [ + "validate" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "VpnGateways": { + "clients": { + "grpc": { + "libraryClient": "VpnGatewaysClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetStatus": { + "methods": [ + "getStatus" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VpnGatewaysClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "GetStatus": { + "methods": [ + "getStatus" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "SetLabels": { + "methods": [ + "setLabels" + ] + }, + "TestIamPermissions": { + "methods": [ + "testIamPermissions" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "VpnTunnels": { + "clients": { + "grpc": { + "libraryClient": "VpnTunnelsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VpnTunnelsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Insert": { + "methods": [ + "insert" + ] + }, + "AggregatedList": { + "methods": [ + "aggregatedList", + "aggregatedListStream", + "aggregatedListAsync" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "ZoneOperations": { + "clients": { + "grpc": { + "libraryClient": "ZoneOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Wait": { + "methods": [ + "wait" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ZoneOperationsClient", + "rpcs": { + "Delete": { + "methods": [ + "delete" + ] + }, + "Get": { + "methods": [ + "get" + ] + }, + "Wait": { + "methods": [ + "wait" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + }, + "Zones": { + "clients": { + "grpc": { + "libraryClient": "ZonesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ZonesClient", + "rpcs": { + "Get": { + "methods": [ + "get" + ] + }, + "List": { + "methods": [ + "list", + "listStream", + "listAsync" + ] + } + } + } + } + } + } +} diff --git a/src/v1/global_addresses_client.ts b/src/v1/global_addresses_client.ts new file mode 100644 index 00000000..3f30a3c4 --- /dev/null +++ b/src/v1/global_addresses_client.ts @@ -0,0 +1,847 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/global_addresses_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './global_addresses_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The GlobalAddresses API. + * @class + * @memberof v1 + */ +export class GlobalAddressesClient { + 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}; + globalAddressesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GlobalAddressesClient. + * + * @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 GlobalAddressesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.GlobalAddresses', + 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 = gax.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.globalAddressesStub) { + return this.globalAddressesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.GlobalAddresses. + this.globalAddressesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.GlobalAddresses' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.GlobalAddresses, + 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 globalAddressesStubMethods = ['delete', 'get', 'insert', 'list']; + for (const methodName of globalAddressesStubMethods) { + const callPromise = this.globalAddressesStub.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.globalAddressesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified address resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.address + * Name of the address resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteGlobalAddressRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetGlobalAddressRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetGlobalAddressRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetGlobalAddressRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IAddress, + | protos.google.cloud.compute.v1.IGetGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetGlobalAddressRequest, + callback: Callback< + protos.google.cloud.compute.v1.IAddress, + | protos.google.cloud.compute.v1.IGetGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified address resource. Gets a list of available addresses by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.address + * Name of the address resource to return. + * @param {string} request.project + * Project ID for 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 [Address]{@link google.cloud.compute.v1.Address}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetGlobalAddressRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IAddress, + | protos.google.cloud.compute.v1.IGetGlobalAddressRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IAddress, + | protos.google.cloud.compute.v1.IGetGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress, + protos.google.cloud.compute.v1.IGetGlobalAddressRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalAddressRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertGlobalAddressRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalAddressRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalAddressRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an address resource in the specified project by using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Address} request.addressResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalAddressRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalAddressRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalAddressRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertGlobalAddressRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress[], + protos.google.cloud.compute.v1.IListGlobalAddressesRequest | null, + protos.google.cloud.compute.v1.IAddressList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + > + ): void; + /** + * Retrieves a list of global addresses. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Address]{@link google.cloud.compute.v1.Address}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + protos.google.cloud.compute.v1.IAddressList | null | undefined, + protos.google.cloud.compute.v1.IAddress + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAddress[], + protos.google.cloud.compute.v1.IListGlobalAddressesRequest | null, + protos.google.cloud.compute.v1.IAddressList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Address]{@link google.cloud.compute.v1.Address} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Address]{@link google.cloud.compute.v1.Address}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListGlobalAddressesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.globalAddressesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/global_addresses_client_config.json b/src/v1/global_addresses_client_config.json new file mode 100644 index 00000000..b4e2a5dd --- /dev/null +++ b/src/v1/global_addresses_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalAddresses": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/global_addresses_proto_list.json b/src/v1/global_addresses_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/global_addresses_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/global_forwarding_rules_client.ts b/src/v1/global_forwarding_rules_client.ts new file mode 100644 index 00000000..614e36e1 --- /dev/null +++ b/src/v1/global_forwarding_rules_client.ts @@ -0,0 +1,1189 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/global_forwarding_rules_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './global_forwarding_rules_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The GlobalForwardingRules API. + * @class + * @memberof v1 + */ +export class GlobalForwardingRulesClient { + 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}; + globalForwardingRulesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GlobalForwardingRulesClient. + * + * @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 GlobalForwardingRulesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.GlobalForwardingRules', + 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 = gax.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.globalForwardingRulesStub) { + return this.globalForwardingRulesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.GlobalForwardingRules. + this.globalForwardingRulesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.GlobalForwardingRules' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.GlobalForwardingRules, + 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 globalForwardingRulesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'setLabels', + 'setTarget', + ]; + for (const methodName of globalForwardingRulesStubMethods) { + const callPromise = this.globalForwardingRulesStub.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.globalForwardingRulesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified GlobalForwardingRule resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule, + ( + | protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified GlobalForwardingRule resource. Gets a list of available forwarding rules by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource to return. + * @param {string} request.project + * Project ID for 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 [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IForwardingRule, + | protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule, + ( + | protos.google.cloud.compute.v1.IGetGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a GlobalForwardingRule resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.ForwardingRule} request.forwardingRuleResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified forwarding rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. Currently, you can only patch the network_tier field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource to patch. + * @param {google.cloud.compute.v1.ForwardingRule} request.forwardingRuleResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on the specified resource. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetLabelsRequest} request.globalSetLabelsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetLabelsGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + setTarget( + request?: protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + >; + setTarget( + request: protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setTarget( + request: protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes target URL for the GlobalForwardingRule resource. The new target should be of the same type as the old target. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.forwardingRule + * Name of the ForwardingRule resource in which target is to be set. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetReference} request.targetReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setTarget(request); + */ + setTarget( + request?: protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetGlobalForwardingRuleRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setTarget(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule[], + protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest | null, + protos.google.cloud.compute.v1.IForwardingRuleList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + > + ): void; + /** + * Retrieves a list of GlobalForwardingRule resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + protos.google.cloud.compute.v1.IForwardingRuleList | null | undefined, + protos.google.cloud.compute.v1.IForwardingRule + > + ): Promise< + [ + protos.google.cloud.compute.v1.IForwardingRule[], + protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest | null, + protos.google.cloud.compute.v1.IForwardingRuleList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [ForwardingRule]{@link google.cloud.compute.v1.ForwardingRule}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListGlobalForwardingRulesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.globalForwardingRulesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/global_forwarding_rules_client_config.json b/src/v1/global_forwarding_rules_client_config.json new file mode 100644 index 00000000..e69560c0 --- /dev/null +++ b/src/v1/global_forwarding_rules_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalForwardingRules": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetTarget": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/global_forwarding_rules_proto_list.json b/src/v1/global_forwarding_rules_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/global_forwarding_rules_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/global_network_endpoint_groups_client.ts b/src/v1/global_network_endpoint_groups_client.ts new file mode 100644 index 00000000..8be9c98e --- /dev/null +++ b/src/v1/global_network_endpoint_groups_client.ts @@ -0,0 +1,1355 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/global_network_endpoint_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './global_network_endpoint_groups_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The GlobalNetworkEndpointGroups API. + * @class + * @memberof v1 + */ +export class GlobalNetworkEndpointGroupsClient { + 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}; + globalNetworkEndpointGroupsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GlobalNetworkEndpointGroupsClient. + * + * @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 GlobalNetworkEndpointGroupsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listNetworkEndpoints: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.GlobalNetworkEndpointGroups', + 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 = gax.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.globalNetworkEndpointGroupsStub) { + return this.globalNetworkEndpointGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.GlobalNetworkEndpointGroups. + this.globalNetworkEndpointGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.GlobalNetworkEndpointGroups' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .GlobalNetworkEndpointGroups, + 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 globalNetworkEndpointGroupsStubMethods = [ + 'attachNetworkEndpoints', + 'delete', + 'detachNetworkEndpoints', + 'get', + 'insert', + 'list', + 'listNetworkEndpoints', + ]; + for (const methodName of globalNetworkEndpointGroupsStubMethods) { + const callPromise = this.globalNetworkEndpointGroupsStub.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.globalNetworkEndpointGroupsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + attachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + attachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + attachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Attach a network endpoint to the specified network endpoint group. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroupsAttachEndpointsRequest} request.globalNetworkEndpointGroupsAttachEndpointsRequestResource + * The body resource for this request + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.attachNetworkEndpoints(request); + */ + attachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.attachNetworkEndpoints( + request, + options, + callback + ); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified network endpoint group.Note that the NEG cannot be deleted if there are backend services referencing it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group to delete. It should comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + detachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + detachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + detachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Detach the network endpoint from the specified network endpoint group. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalNetworkEndpointGroupsDetachEndpointsRequest} request.globalNetworkEndpointGroupsDetachEndpointsRequestResource + * The body resource for this request + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.detachNetworkEndpoints(request); + */ + detachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.detachNetworkEndpoints( + request, + options, + callback + ); + } + get( + request?: protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup, + ( + | protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group. It should comply with RFC1035. + * @param {string} request.project + * Project ID for 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 [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup, + ( + | protos.google.cloud.compute.v1.IGetGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.NetworkEndpointGroup} request.networkEndpointGroupResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertGlobalNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup[], + protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): void; + /** + * Retrieves the list of network endpoint groups that are located in the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup[], + protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListGlobalNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[], + protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + ] + >; + listNetworkEndpoints( + request: protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + > + ): void; + listNetworkEndpoints( + request: protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + > + ): void; + /** + * Lists the network endpoints in the specified network endpoint group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [NetworkEndpointWithHealthStatus]{@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus}. + * 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 `listNetworkEndpointsAsync()` + * 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. + */ + listNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[], + protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listNetworkEndpoints(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [NetworkEndpointWithHealthStatus]{@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus} 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 `listNetworkEndpointsAsync()` + * 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. + */ + listNetworkEndpointsStream( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNetworkEndpoints.createStream( + this.innerApiCalls.listNetworkEndpoints as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNetworkEndpoints`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [NetworkEndpointWithHealthStatus]{@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus}. 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.listNetworkEndpointsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listNetworkEndpointsAsync( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsGlobalNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNetworkEndpoints.asyncIterate( + this.innerApiCalls['listNetworkEndpoints'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.globalNetworkEndpointGroupsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/global_network_endpoint_groups_client_config.json b/src/v1/global_network_endpoint_groups_client_config.json new file mode 100644 index 00000000..e353418e --- /dev/null +++ b/src/v1/global_network_endpoint_groups_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalNetworkEndpointGroups": { + "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": { + "AttachNetworkEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DetachNetworkEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNetworkEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/global_network_endpoint_groups_proto_list.json b/src/v1/global_network_endpoint_groups_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/global_network_endpoint_groups_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/global_operations_client.ts b/src/v1/global_operations_client.ts new file mode 100644 index 00000000..2c49d9b1 --- /dev/null +++ b/src/v1/global_operations_client.ts @@ -0,0 +1,921 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/global_operations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './global_operations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The GlobalOperations API. + * @class + * @memberof v1 + */ +export class GlobalOperationsClient { + 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}; + globalOperationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GlobalOperationsClient. + * + * @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 GlobalOperationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.GlobalOperations', + 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 = gax.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.globalOperationsStub) { + return this.globalOperationsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.GlobalOperations. + this.globalOperationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.GlobalOperations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.GlobalOperations, + 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 globalOperationsStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'list', + 'wait', + ]; + for (const methodName of globalOperationsStubMethods) { + const callPromise = this.globalOperationsStub.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.globalOperationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteGlobalOperationResponse, + protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified Operations resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to delete. + * @param {string} request.project + * Project ID for 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 [DeleteGlobalOperationResponse]{@link google.cloud.compute.v1.DeleteGlobalOperationResponse}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteGlobalOperationResponse, + protos.google.cloud.compute.v1.IDeleteGlobalOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetGlobalOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IGetGlobalOperationRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetGlobalOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetGlobalOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to return. + * @param {string} request.project + * Project ID for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetGlobalOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IGetGlobalOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + wait( + request?: protos.google.cloud.compute.v1.IWaitGlobalOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IWaitGlobalOperationRequest | undefined, + {} | undefined + ] + >; + wait( + request: protos.google.cloud.compute.v1.IWaitGlobalOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + wait( + request: protos.google.cloud.compute.v1.IWaitGlobalOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + * + * This method is called on a best-effort basis. Specifically: + * - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + * - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to return. + * @param {string} request.project + * Project ID for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.wait(request); + */ + wait( + request?: protos.google.cloud.compute.v1.IWaitGlobalOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitGlobalOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitGlobalOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IWaitGlobalOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.wait(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [OperationsScopedList]{@link google.cloud.compute.v1.OperationsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListGlobalOperationsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IOperationsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IOperationsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListGlobalOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + /** + * Retrieves a list of Operation resources contained within the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Operation]{@link google.cloud.compute.v1.Operation}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListGlobalOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Operation]{@link google.cloud.compute.v1.Operation} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Operation]{@link google.cloud.compute.v1.Operation}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListGlobalOperationsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.globalOperationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/global_operations_client_config.json b/src/v1/global_operations_client_config.json new file mode 100644 index 00000000..a732080c --- /dev/null +++ b/src/v1/global_operations_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalOperations": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Wait": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/global_operations_proto_list.json b/src/v1/global_operations_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/global_operations_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/global_organization_operations_client.ts b/src/v1/global_organization_operations_client.ts new file mode 100644 index 00000000..cdb6e33f --- /dev/null +++ b/src/v1/global_organization_operations_client.ts @@ -0,0 +1,738 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/global_organization_operations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './global_organization_operations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The GlobalOrganizationOperations API. + * @class + * @memberof v1 + */ +export class GlobalOrganizationOperationsClient { + 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}; + globalOrganizationOperationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GlobalOrganizationOperationsClient. + * + * @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 GlobalOrganizationOperationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.GlobalOrganizationOperations', + 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 = gax.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.globalOrganizationOperationsStub) { + return this.globalOrganizationOperationsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.GlobalOrganizationOperations. + this.globalOrganizationOperationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.GlobalOrganizationOperations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .GlobalOrganizationOperations, + 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 globalOrganizationOperationsStubMethods = ['delete', 'get', 'list']; + for (const methodName of globalOrganizationOperationsStubMethods) { + const callPromise = this.globalOrganizationOperationsStub.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.globalOrganizationOperationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified Operations resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to delete. + * @param {string} request.parentId + * Parent ID for 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 [DeleteGlobalOrganizationOperationResponse]{@link google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, + | protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + operation: request.operation || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified Operations resource. Gets a list of operations by making a `list()` request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to return. + * @param {string} request.parentId + * Parent ID for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IGetGlobalOrganizationOperationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + operation: request.operation || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + /** + * Retrieves a list of Operation resources contained within the specified organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.parentId + * Parent ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Operation]{@link google.cloud.compute.v1.Operation}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.parentId + * Parent ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Operation]{@link google.cloud.compute.v1.Operation} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.parentId + * Parent ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Operation]{@link google.cloud.compute.v1.Operation}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListGlobalOrganizationOperationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.globalOrganizationOperationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/global_organization_operations_client_config.json b/src/v1/global_organization_operations_client_config.json new file mode 100644 index 00000000..1a261cc2 --- /dev/null +++ b/src/v1/global_organization_operations_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalOrganizationOperations": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/global_organization_operations_proto_list.json b/src/v1/global_organization_operations_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/global_organization_operations_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/global_public_delegated_prefixes_client.ts b/src/v1/global_public_delegated_prefixes_client.ts new file mode 100644 index 00000000..2efca7dd --- /dev/null +++ b/src/v1/global_public_delegated_prefixes_client.ts @@ -0,0 +1,988 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/global_public_delegated_prefixes_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './global_public_delegated_prefixes_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The GlobalPublicDelegatedPrefixes API. + * @class + * @memberof v1 + */ +export class GlobalPublicDelegatedPrefixesClient { + 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}; + globalPublicDelegatedPrefixesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GlobalPublicDelegatedPrefixesClient. + * + * @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 GlobalPublicDelegatedPrefixesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.GlobalPublicDelegatedPrefixes', + 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 = gax.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.globalPublicDelegatedPrefixesStub) { + return this.globalPublicDelegatedPrefixesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.GlobalPublicDelegatedPrefixes. + this.globalPublicDelegatedPrefixesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.GlobalPublicDelegatedPrefixes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .GlobalPublicDelegatedPrefixes, + 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 globalPublicDelegatedPrefixesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + ]; + for (const methodName of globalPublicDelegatedPrefixesStubMethods) { + const callPromise = this.globalPublicDelegatedPrefixesStub.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.globalPublicDelegatedPrefixesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified global PublicDelegatedPrefix. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicDelegatedPrefix + * Name of the PublicDelegatedPrefix resource to delete. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + ( + | protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified global PublicDelegatedPrefix resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicDelegatedPrefix + * Name of the PublicDelegatedPrefix resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + ( + | protos.google.cloud.compute.v1.IGetGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.PublicDelegatedPrefix} request.publicDelegatedPrefixResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified global PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicDelegatedPrefix + * Name of the PublicDelegatedPrefix resource to patch. + * @param {google.cloud.compute.v1.PublicDelegatedPrefix} request.publicDelegatedPrefixResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchGlobalPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix[], + protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest | null, + protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + > + ): void; + /** + * Lists the global PublicDelegatedPrefixes for a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix[], + protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest | null, + protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListGlobalPublicDelegatedPrefixesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.globalPublicDelegatedPrefixesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/global_public_delegated_prefixes_client_config.json b/src/v1/global_public_delegated_prefixes_client_config.json new file mode 100644 index 00000000..7304040d --- /dev/null +++ b/src/v1/global_public_delegated_prefixes_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.GlobalPublicDelegatedPrefixes": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/global_public_delegated_prefixes_proto_list.json b/src/v1/global_public_delegated_prefixes_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/global_public_delegated_prefixes_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/health_checks_client.ts b/src/v1/health_checks_client.ts new file mode 100644 index 00000000..a5478ede --- /dev/null +++ b/src/v1/health_checks_client.ts @@ -0,0 +1,1127 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/health_checks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './health_checks_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The HealthChecks API. + * @class + * @memberof v1 + */ +export class HealthChecksClient { + 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}; + healthChecksStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of HealthChecksClient. + * + * @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 HealthChecksClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.HealthChecks', + 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 = gax.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.healthChecksStub) { + return this.healthChecksStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.HealthChecks. + this.healthChecksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.HealthChecks' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.HealthChecks, + 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 healthChecksStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'update', + ]; + for (const methodName of healthChecksStubMethods) { + const callPromise = this.healthChecksStub.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.healthChecksStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteHealthCheckRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified HealthCheck resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteHealthCheckRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck, + protos.google.cloud.compute.v1.IGetHealthCheckRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IHealthCheck, + protos.google.cloud.compute.v1.IGetHealthCheckRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IHealthCheck, + protos.google.cloud.compute.v1.IGetHealthCheckRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to return. + * @param {string} request.project + * Project ID for 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 [HealthCheck]{@link google.cloud.compute.v1.HealthCheck}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IHealthCheck, + | protos.google.cloud.compute.v1.IGetHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IHealthCheck, + protos.google.cloud.compute.v1.IGetHealthCheckRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck, + protos.google.cloud.compute.v1.IGetHealthCheckRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertHealthCheckRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.HealthCheck} request.healthCheckResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertHealthCheckRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchHealthCheckRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to patch. + * @param {google.cloud.compute.v1.HealthCheck} request.healthCheckResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchHealthCheckRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateHealthCheckRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to update. + * @param {google.cloud.compute.v1.HealthCheck} request.healthCheckResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateHealthCheckRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Name of the project scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [HealthChecksScopedList]{@link google.cloud.compute.v1.HealthChecksScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListHealthChecksRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IHealthChecksScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IHealthChecksScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListHealthChecksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck[], + protos.google.cloud.compute.v1.IListHealthChecksRequest | null, + protos.google.cloud.compute.v1.IHealthCheckList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListHealthChecksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListHealthChecksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + > + ): void; + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [HealthCheck]{@link google.cloud.compute.v1.HealthCheck}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListHealthChecksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + > + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck[], + protos.google.cloud.compute.v1.IListHealthChecksRequest | null, + protos.google.cloud.compute.v1.IHealthCheckList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [HealthCheck]{@link google.cloud.compute.v1.HealthCheck} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListHealthChecksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [HealthCheck]{@link google.cloud.compute.v1.HealthCheck}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListHealthChecksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.healthChecksStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/health_checks_client_config.json b/src/v1/health_checks_client_config.json new file mode 100644 index 00000000..b84bd976 --- /dev/null +++ b/src/v1/health_checks_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.HealthChecks": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/health_checks_proto_list.json b/src/v1/health_checks_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/health_checks_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/images_client.ts b/src/v1/images_client.ts new file mode 100644 index 00000000..5c562f56 --- /dev/null +++ b/src/v1/images_client.ts @@ -0,0 +1,1500 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/images_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './images_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Images API. + * @class + * @memberof v1 + */ +export class ImagesClient { + 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}; + imagesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ImagesClient. + * + * @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 ImagesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Images', + 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 = gax.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.imagesStub) { + return this.imagesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Images. + this.imagesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Images' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Images, + 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 imagesStubMethods = [ + 'delete', + 'deprecate', + 'get', + 'getFromFamily', + 'getIamPolicy', + 'insert', + 'list', + 'patch', + 'setIamPolicy', + 'setLabels', + 'testIamPermissions', + ]; + for (const methodName of imagesStubMethods) { + const callPromise = this.imagesStub.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.imagesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteImageRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteImageRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteImageRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified image. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.image + * Name of the image resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteImageRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteImageRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + deprecate( + request?: protos.google.cloud.compute.v1.IDeprecateImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeprecateImageRequest | undefined, + {} | undefined + ] + >; + deprecate( + request: protos.google.cloud.compute.v1.IDeprecateImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeprecateImageRequest | null | undefined, + {} | null | undefined + > + ): void; + deprecate( + request: protos.google.cloud.compute.v1.IDeprecateImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeprecateImageRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the deprecation status of an image. + * + * If an empty request body is given, clears the deprecation status instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.DeprecationStatus} request.deprecationStatusResource + * The body resource for this request + * @param {string} request.image + * Image name. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deprecate(request); + */ + deprecate( + request?: protos.google.cloud.compute.v1.IDeprecateImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeprecateImageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeprecateImageRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeprecateImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deprecate(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetImageRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetImageRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetImageRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified image. Gets a list of available images by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.image + * Name of the image resource to return. + * @param {string} request.project + * Project ID for 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 [Image]{@link google.cloud.compute.v1.Image}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetImageRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetImageRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getFromFamily( + request?: protos.google.cloud.compute.v1.IGetFromFamilyImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetFromFamilyImageRequest | undefined, + {} | undefined + ] + >; + getFromFamily( + request: protos.google.cloud.compute.v1.IGetFromFamilyImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IImage, + | protos.google.cloud.compute.v1.IGetFromFamilyImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFromFamily( + request: protos.google.cloud.compute.v1.IGetFromFamilyImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IImage, + | protos.google.cloud.compute.v1.IGetFromFamilyImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the latest image that is part of an image family and is not deprecated. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.family + * Name of the image family to search for. + * @param {string} request.project + * Project ID for 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 [Image]{@link google.cloud.compute.v1.Image}. + * 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.getFromFamily(request); + */ + getFromFamily( + request?: protos.google.cloud.compute.v1.IGetFromFamilyImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IImage, + | protos.google.cloud.compute.v1.IGetFromFamilyImageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IImage, + | protos.google.cloud.compute.v1.IGetFromFamilyImageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IImage, + protos.google.cloud.compute.v1.IGetFromFamilyImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getFromFamily(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyImageRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertImageRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertImageRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertImageRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an image in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {boolean} request.forceCreate + * Force image creation if true. + * @param {google.cloud.compute.v1.Image} request.imageResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertImageRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertImageRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchImageRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchImageRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchImageRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified image with the data included in the request. Only the following fields can be modified: family, description, deprecation status. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.image + * Name of the image resource to patch. + * @param {google.cloud.compute.v1.Image} request.imageResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchImageRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchImageRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyImageRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetPolicyRequest} request.globalSetPolicyRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyImageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsImageRequest | undefined, + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsImageRequest | null | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsImageRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetLabelsRequest} request.globalSetLabelsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsImageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsImageRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsImageRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsImageRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListImagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IImage[], + protos.google.cloud.compute.v1.IListImagesRequest | null, + protos.google.cloud.compute.v1.IImageList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListImagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListImagesRequest, + protos.google.cloud.compute.v1.IImageList | null | undefined, + protos.google.cloud.compute.v1.IImage + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListImagesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListImagesRequest, + protos.google.cloud.compute.v1.IImageList | null | undefined, + protos.google.cloud.compute.v1.IImage + > + ): void; + /** + * Retrieves the list of custom images available to the specified project. Custom images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 8. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Image]{@link google.cloud.compute.v1.Image}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListImagesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListImagesRequest, + protos.google.cloud.compute.v1.IImageList | null | undefined, + protos.google.cloud.compute.v1.IImage + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListImagesRequest, + protos.google.cloud.compute.v1.IImageList | null | undefined, + protos.google.cloud.compute.v1.IImage + > + ): Promise< + [ + protos.google.cloud.compute.v1.IImage[], + protos.google.cloud.compute.v1.IListImagesRequest | null, + protos.google.cloud.compute.v1.IImageList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Image]{@link google.cloud.compute.v1.Image} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListImagesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Image]{@link google.cloud.compute.v1.Image}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListImagesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.imagesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/images_client_config.json b/src/v1/images_client_config.json new file mode 100644 index 00000000..fa2e7fe9 --- /dev/null +++ b/src/v1/images_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Images": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Deprecate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFromFamily": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/images_proto_list.json b/src/v1/images_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/images_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/index.ts b/src/v1/index.ts new file mode 100644 index 00000000..4b2089a5 --- /dev/null +++ b/src/v1/index.ts @@ -0,0 +1,96 @@ +// 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 {AcceleratorTypesClient} from './accelerator_types_client'; +export {AddressesClient} from './addresses_client'; +export {AutoscalersClient} from './autoscalers_client'; +export {BackendBucketsClient} from './backend_buckets_client'; +export {BackendServicesClient} from './backend_services_client'; +export {DisksClient} from './disks_client'; +export {DiskTypesClient} from './disk_types_client'; +export {ExternalVpnGatewaysClient} from './external_vpn_gateways_client'; +export {FirewallPoliciesClient} from './firewall_policies_client'; +export {FirewallsClient} from './firewalls_client'; +export {ForwardingRulesClient} from './forwarding_rules_client'; +export {GlobalAddressesClient} from './global_addresses_client'; +export {GlobalForwardingRulesClient} from './global_forwarding_rules_client'; +export {GlobalNetworkEndpointGroupsClient} from './global_network_endpoint_groups_client'; +export {GlobalOperationsClient} from './global_operations_client'; +export {GlobalOrganizationOperationsClient} from './global_organization_operations_client'; +export {GlobalPublicDelegatedPrefixesClient} from './global_public_delegated_prefixes_client'; +export {HealthChecksClient} from './health_checks_client'; +export {ImagesClient} from './images_client'; +export {InstanceGroupManagersClient} from './instance_group_managers_client'; +export {InstanceGroupsClient} from './instance_groups_client'; +export {InstancesClient} from './instances_client'; +export {InstanceTemplatesClient} from './instance_templates_client'; +export {InterconnectAttachmentsClient} from './interconnect_attachments_client'; +export {InterconnectLocationsClient} from './interconnect_locations_client'; +export {InterconnectsClient} from './interconnects_client'; +export {LicenseCodesClient} from './license_codes_client'; +export {LicensesClient} from './licenses_client'; +export {MachineTypesClient} from './machine_types_client'; +export {NetworkEndpointGroupsClient} from './network_endpoint_groups_client'; +export {NetworksClient} from './networks_client'; +export {NodeGroupsClient} from './node_groups_client'; +export {NodeTemplatesClient} from './node_templates_client'; +export {NodeTypesClient} from './node_types_client'; +export {PacketMirroringsClient} from './packet_mirrorings_client'; +export {ProjectsClient} from './projects_client'; +export {PublicAdvertisedPrefixesClient} from './public_advertised_prefixes_client'; +export {PublicDelegatedPrefixesClient} from './public_delegated_prefixes_client'; +export {RegionAutoscalersClient} from './region_autoscalers_client'; +export {RegionBackendServicesClient} from './region_backend_services_client'; +export {RegionCommitmentsClient} from './region_commitments_client'; +export {RegionDisksClient} from './region_disks_client'; +export {RegionDiskTypesClient} from './region_disk_types_client'; +export {RegionHealthChecksClient} from './region_health_checks_client'; +export {RegionHealthCheckServicesClient} from './region_health_check_services_client'; +export {RegionInstanceGroupManagersClient} from './region_instance_group_managers_client'; +export {RegionInstanceGroupsClient} from './region_instance_groups_client'; +export {RegionInstancesClient} from './region_instances_client'; +export {RegionNetworkEndpointGroupsClient} from './region_network_endpoint_groups_client'; +export {RegionNotificationEndpointsClient} from './region_notification_endpoints_client'; +export {RegionOperationsClient} from './region_operations_client'; +export {RegionsClient} from './regions_client'; +export {RegionSslCertificatesClient} from './region_ssl_certificates_client'; +export {RegionTargetHttpProxiesClient} from './region_target_http_proxies_client'; +export {RegionTargetHttpsProxiesClient} from './region_target_https_proxies_client'; +export {RegionUrlMapsClient} from './region_url_maps_client'; +export {ReservationsClient} from './reservations_client'; +export {ResourcePoliciesClient} from './resource_policies_client'; +export {RoutersClient} from './routers_client'; +export {RoutesClient} from './routes_client'; +export {SecurityPoliciesClient} from './security_policies_client'; +export {SnapshotsClient} from './snapshots_client'; +export {SslCertificatesClient} from './ssl_certificates_client'; +export {SslPoliciesClient} from './ssl_policies_client'; +export {SubnetworksClient} from './subnetworks_client'; +export {TargetGrpcProxiesClient} from './target_grpc_proxies_client'; +export {TargetHttpProxiesClient} from './target_http_proxies_client'; +export {TargetHttpsProxiesClient} from './target_https_proxies_client'; +export {TargetInstancesClient} from './target_instances_client'; +export {TargetPoolsClient} from './target_pools_client'; +export {TargetSslProxiesClient} from './target_ssl_proxies_client'; +export {TargetTcpProxiesClient} from './target_tcp_proxies_client'; +export {TargetVpnGatewaysClient} from './target_vpn_gateways_client'; +export {UrlMapsClient} from './url_maps_client'; +export {VpnGatewaysClient} from './vpn_gateways_client'; +export {VpnTunnelsClient} from './vpn_tunnels_client'; +export {ZoneOperationsClient} from './zone_operations_client'; +export {ZonesClient} from './zones_client'; diff --git a/src/v1/instance_group_managers_client.ts b/src/v1/instance_group_managers_client.ts new file mode 100644 index 00000000..15e7186d --- /dev/null +++ b/src/v1/instance_group_managers_client.ts @@ -0,0 +1,3089 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/instance_group_managers_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './instance_group_managers_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The InstanceGroupManagers API. + * @class + * @memberof v1 + */ +export class InstanceGroupManagersClient { + 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}; + instanceGroupManagersStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InstanceGroupManagersClient. + * + * @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 InstanceGroupManagersClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listErrors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listManagedInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'managedInstances' + ), + listPerInstanceConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.InstanceGroupManagers', + 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 = gax.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.instanceGroupManagersStub) { + return this.instanceGroupManagersStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.InstanceGroupManagers. + this.instanceGroupManagersStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.InstanceGroupManagers' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.InstanceGroupManagers, + 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 instanceGroupManagersStubMethods = [ + 'abandonInstances', + 'aggregatedList', + 'applyUpdatesToInstances', + 'createInstances', + 'delete', + 'deleteInstances', + 'deletePerInstanceConfigs', + 'get', + 'insert', + 'list', + 'listErrors', + 'listManagedInstances', + 'listPerInstanceConfigs', + 'patch', + 'patchPerInstanceConfigs', + 'recreateInstances', + 'resize', + 'setInstanceTemplate', + 'setTargetPools', + 'updatePerInstanceConfigs', + ]; + for (const methodName of instanceGroupManagersStubMethods) { + const callPromise = this.instanceGroupManagersStub.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.instanceGroupManagersStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + abandonInstances( + request?: protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + abandonInstances( + request: protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + abandonInstances( + request: protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Flags the specified instances to be removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {google.cloud.compute.v1.InstanceGroupManagersAbandonInstancesRequest} request.instanceGroupManagersAbandonInstancesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.abandonInstances(request); + */ + abandonInstances( + request?: protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAbandonInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.abandonInstances(request, options, callback); + } + applyUpdatesToInstances( + request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + applyUpdatesToInstances( + request: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + applyUpdatesToInstances( + request: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Applies changes to selected instances on the managed instance group. This method can be used to apply new overrides and/or new versions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group, should conform to RFC1035. + * @param {google.cloud.compute.v1.InstanceGroupManagersApplyUpdatesRequest} request.instanceGroupManagersApplyUpdatesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. Should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.applyUpdatesToInstances(request); + */ + applyUpdatesToInstances( + request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.applyUpdatesToInstances( + request, + options, + callback + ); + } + createInstances( + request?: protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + createInstances( + request: protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createInstances( + request: protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {google.cloud.compute.v1.InstanceGroupManagersCreateInstancesRequest} request.instanceGroupManagersCreateInstancesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.createInstances(request); + */ + createInstances( + request?: protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICreateInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.createInstances(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified managed instance group and all of the instances in that group. Note that the instance group must not belong to a backend service. Read Deleting an instance group for more information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + deleteInstances( + request?: protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + deleteInstances( + request: protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteInstances( + request: protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Flags the specified instances in the managed instance group for immediate deletion. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {google.cloud.compute.v1.InstanceGroupManagersDeleteInstancesRequest} request.instanceGroupManagersDeleteInstancesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deleteInstances(request); + */ + deleteInstances( + request?: protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstances(request, options, callback); + } + deletePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + deletePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes selected per-instance configs for the managed instance group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {google.cloud.compute.v1.InstanceGroupManagersDeletePerInstanceConfigsReq} request.instanceGroupManagersDeletePerInstanceConfigsReqResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deletePerInstanceConfigs(request); + */ + deletePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deletePerInstanceConfigs( + request, + options, + callback + ); + } + get( + request?: protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager, + ( + | protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager, + ( + | protos.google.cloud.compute.v1.IGetInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A managed instance group can have up to 1000 VM instances per group. Please contact Cloud Support if you need an increase in this limit. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.InstanceGroupManager} request.instanceGroupManagerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where you want to create the managed instance group. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listManagedInstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the instance group manager. + * @param {google.cloud.compute.v1.InstanceGroupManager} request.instanceGroupManagerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where you want to create the managed instance group. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + patchPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + patchPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patchPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {google.cloud.compute.v1.InstanceGroupManagersPatchPerInstanceConfigsReq} request.instanceGroupManagersPatchPerInstanceConfigsReqResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patchPerInstanceConfigs(request); + */ + patchPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patchPerInstanceConfigs( + request, + options, + callback + ); + } + recreateInstances( + request?: protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + recreateInstances( + request: protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + recreateInstances( + request: protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {google.cloud.compute.v1.InstanceGroupManagersRecreateInstancesRequest} request.instanceGroupManagersRecreateInstancesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.recreateInstances(request); + */ + recreateInstances( + request?: protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRecreateInstancesInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.recreateInstances(request, options, callback); + } + resize( + request?: protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + resize( + request: protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resize( + request: protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Resizes the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + * + * When resizing down, the instance group arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM attributes when making the selection including: + * + * + The status of the VM instance. + The health of the VM instance. + The instance template version the VM is based on. + For regional managed instance groups, the location of the VM instance. + * + * This list is subject to change. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {number} request.size + * The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.resize(request); + */ + resize( + request?: protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IResizeInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.resize(request, options, callback); + } + setInstanceTemplate( + request?: protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + setInstanceTemplate( + request: protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setInstanceTemplate( + request: protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {google.cloud.compute.v1.InstanceGroupManagersSetInstanceTemplateRequest} request.instanceGroupManagersSetInstanceTemplateRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setInstanceTemplate(request); + */ + setInstanceTemplate( + request?: protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetInstanceTemplateInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setInstanceTemplate(request, options, callback); + } + setTargetPools( + request?: protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + setTargetPools( + request: protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setTargetPools( + request: protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {google.cloud.compute.v1.InstanceGroupManagersSetTargetPoolsRequest} request.instanceGroupManagersSetTargetPoolsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setTargetPools(request); + */ + setTargetPools( + request?: protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetPoolsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setTargetPools(request, options, callback); + } + updatePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + updatePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {google.cloud.compute.v1.InstanceGroupManagersUpdatePerInstanceConfigsReq} request.instanceGroupManagersUpdatePerInstanceConfigsReqResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.updatePerInstanceConfigs(request); + */ + updatePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.updatePerInstanceConfigs( + request, + options, + callback + ); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [InstanceGroupManagersScopedList]{@link google.cloud.compute.v1.InstanceGroupManagersScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListInstanceGroupManagersRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IInstanceGroupManagersScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IInstanceGroupManagersScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager[], + protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagerList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + > + ): void; + /** + * Retrieves a list of managed instance groups that are contained within the specified project and zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager[], + protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagerList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @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 [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @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 + * [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listErrors( + request?: protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceManagedByIgmError[], + protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse + ] + >; + listErrors( + request: protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + > + ): void; + listErrors( + request: protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + > + ): void; + /** + * Lists all errors thrown by actions on instances for a given managed instance group. The filter and orderBy query parameters are not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:{@link 0-9|a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9}{0,19}. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [InstanceManagedByIgmError]{@link google.cloud.compute.v1.InstanceManagedByIgmError}. + * 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 `listErrorsAsync()` + * 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. + */ + listErrors( + request?: protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceManagedByIgmError[], + protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagersListErrorsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listErrors(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:{@link 0-9|a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9}{0,19}. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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 [InstanceManagedByIgmError]{@link google.cloud.compute.v1.InstanceManagedByIgmError} 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 `listErrorsAsync()` + * 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. + */ + listErrorsStream( + request?: protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listErrors.createStream( + this.innerApiCalls.listErrors as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listErrors`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:{@link 0-9|a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9}{0,19}. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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 + * [InstanceManagedByIgmError]{@link google.cloud.compute.v1.InstanceManagedByIgmError}. 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.listErrorsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listErrorsAsync( + request?: protos.google.cloud.compute.v1.IListErrorsInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listErrors.asyncIterate( + this.innerApiCalls['listErrors'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listManagedInstances( + request?: protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IManagedInstance[], + protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse + ] + >; + listManagedInstances( + request: protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + > + ): void; + listManagedInstances( + request: protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + > + ): void; + /** + * Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ManagedInstance]{@link google.cloud.compute.v1.ManagedInstance}. + * 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 `listManagedInstancesAsync()` + * 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. + */ + listManagedInstances( + request?: protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + > + ): Promise< + [ + protos.google.cloud.compute.v1.IManagedInstance[], + protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagersListManagedInstancesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listManagedInstances(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @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 [ManagedInstance]{@link google.cloud.compute.v1.ManagedInstance} 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 `listManagedInstancesAsync()` + * 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. + */ + listManagedInstancesStream( + request?: protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listManagedInstances.createStream( + this.innerApiCalls.listManagedInstances as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listManagedInstances`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. + * @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 + * [ManagedInstance]{@link google.cloud.compute.v1.ManagedInstance}. 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.listManagedInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listManagedInstancesAsync( + request?: protos.google.cloud.compute.v1.IListManagedInstancesInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listManagedInstances.asyncIterate( + this.innerApiCalls['listManagedInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPerInstanceConfig[], + protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp + ] + >; + listPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + > + ): void; + listPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + > + ): void; + /** + * Lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PerInstanceConfig]{@link google.cloud.compute.v1.PerInstanceConfig}. + * 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 `listPerInstanceConfigsAsync()` + * 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. + */ + listPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPerInstanceConfig[], + protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupManagersListPerInstanceConfigsResp + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listPerInstanceConfigs( + 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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 [PerInstanceConfig]{@link google.cloud.compute.v1.PerInstanceConfig} 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 `listPerInstanceConfigsAsync()` + * 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. + */ + listPerInstanceConfigsStream( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPerInstanceConfigs.createStream( + this.innerApiCalls.listPerInstanceConfigs as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPerInstanceConfigs`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @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 + * [PerInstanceConfig]{@link google.cloud.compute.v1.PerInstanceConfig}. 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.listPerInstanceConfigsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listPerInstanceConfigsAsync( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPerInstanceConfigs.asyncIterate( + this.innerApiCalls['listPerInstanceConfigs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.instanceGroupManagersStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/instance_group_managers_client_config.json b/src/v1/instance_group_managers_client_config.json new file mode 100644 index 00000000..a082a15e --- /dev/null +++ b/src/v1/instance_group_managers_client_config.json @@ -0,0 +1,106 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceGroupManagers": { + "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": { + "AbandonInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyUpdatesToInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListErrors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListManagedInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PatchPerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RecreateInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Resize": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetInstanceTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetTargetPools": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/instance_group_managers_proto_list.json b/src/v1/instance_group_managers_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/instance_group_managers_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/instance_groups_client.ts b/src/v1/instance_groups_client.ts new file mode 100644 index 00000000..eb03f641 --- /dev/null +++ b/src/v1/instance_groups_client.ts @@ -0,0 +1,1540 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/instance_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './instance_groups_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The InstanceGroups API. + * @class + * @memberof v1 + */ +export class InstanceGroupsClient { + 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}; + instanceGroupsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InstanceGroupsClient. + * + * @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 InstanceGroupsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.InstanceGroups', + 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 = gax.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.instanceGroupsStub) { + return this.instanceGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.InstanceGroups. + this.instanceGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.InstanceGroups' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.InstanceGroups, + 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 instanceGroupsStubMethods = [ + 'addInstances', + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'listInstances', + 'removeInstances', + 'setNamedPorts', + ]; + for (const methodName of instanceGroupsStubMethods) { + const callPromise = this.instanceGroupsStub.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.instanceGroupsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addInstances( + request?: protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest + | undefined + ), + {} | undefined + ] + >; + addInstances( + request: protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addInstances( + request: protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroup + * The name of the instance group where you are adding instances. + * @param {google.cloud.compute.v1.InstanceGroupsAddInstancesRequest} request.instanceGroupsAddInstancesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addInstances(request); + */ + addInstances( + request?: protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddInstancesInstanceGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addInstances(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroup + * The name of the instance group to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup, + protos.google.cloud.compute.v1.IGetInstanceGroupRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. + * + * For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroup + * The name of the instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone where the instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup, + protos.google.cloud.compute.v1.IGetInstanceGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceGroupRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an instance group in the specified project using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.InstanceGroup} request.instanceGroupResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where you want to create the instance group. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + removeInstances( + request?: protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest + | undefined + ), + {} | undefined + ] + >; + removeInstances( + request: protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeInstances( + request: protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes one or more instances from the specified instance group, but does not delete those instances. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroup + * The name of the instance group where the specified instances will be removed. + * @param {google.cloud.compute.v1.InstanceGroupsRemoveInstancesRequest} request.instanceGroupsRemoveInstancesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeInstances(request); + */ + removeInstances( + request?: protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveInstancesInstanceGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removeInstances(request, options, callback); + } + setNamedPorts( + request?: protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest + | undefined + ), + {} | undefined + ] + >; + setNamedPorts( + request: protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setNamedPorts( + request: protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the named ports for the specified instance group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroup + * The name of the instance group where the named ports are updated. + * @param {google.cloud.compute.v1.InstanceGroupsSetNamedPortsRequest} request.instanceGroupsSetNamedPortsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setNamedPorts(request); + */ + setNamedPorts( + request?: protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetNamedPortsInstanceGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setNamedPorts(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [InstanceGroupsScopedList]{@link google.cloud.compute.v1.InstanceGroupsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListInstanceGroupsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IInstanceGroupsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IInstanceGroupsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup[], + protos.google.cloud.compute.v1.IListInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + protos.google.cloud.compute.v1.IInstanceGroupList | null | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + protos.google.cloud.compute.v1.IInstanceGroupList | null | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + > + ): void; + /** + * Retrieves the list of zonal instance group resources contained within the specified zone. + * + * For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + protos.google.cloud.compute.v1.IInstanceGroupList | null | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + protos.google.cloud.compute.v1.IInstanceGroupList | null | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup[], + protos.google.cloud.compute.v1.IListInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the instance group is located. + * @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 [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the instance group is located. + * @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 + * [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listInstances( + request?: protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceWithNamedPorts[], + protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupsListInstances + ] + >; + listInstances( + request: protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + > + ): void; + listInstances( + request: protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + > + ): void; + /** + * Lists the instances in the specified instance group. The orderBy query parameter is not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroup + * The name of the instance group from which you want to generate a list of included instances. + * @param {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} request.instanceGroupsListInstancesRequestResource + * The body resource for this request + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the instance group is located. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [InstanceWithNamedPorts]{@link google.cloud.compute.v1.InstanceWithNamedPorts}. + * 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.compute.v1.IListInstancesInstanceGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceWithNamedPorts[], + protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IInstanceGroupsListInstances + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroup + * The name of the instance group from which you want to generate a list of included instances. + * @param {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} request.instanceGroupsListInstancesRequestResource + * The body resource for this request + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the instance group is located. + * @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 [InstanceWithNamedPorts]{@link google.cloud.compute.v1.InstanceWithNamedPorts} 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.compute.v1.IListInstancesInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as gax.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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroup + * The name of the instance group from which you want to generate a list of included instances. + * @param {google.cloud.compute.v1.InstanceGroupsListInstancesRequest} request.instanceGroupsListInstancesRequestResource + * The body resource for this request + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the instance group is located. + * @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 + * [InstanceWithNamedPorts]{@link google.cloud.compute.v1.InstanceWithNamedPorts}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listInstancesAsync( + request?: protos.google.cloud.compute.v1.IListInstancesInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.instanceGroupsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/instance_groups_client_config.json b/src/v1/instance_groups_client_config.json new file mode 100644 index 00000000..cd3de4b8 --- /dev/null +++ b/src/v1/instance_groups_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceGroups": { + "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": { + "AddInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNamedPorts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/instance_groups_proto_list.json b/src/v1/instance_groups_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/instance_groups_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/instance_templates_client.ts b/src/v1/instance_templates_client.ts new file mode 100644 index 00000000..ed073f27 --- /dev/null +++ b/src/v1/instance_templates_client.ts @@ -0,0 +1,1160 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/instance_templates_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './instance_templates_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The InstanceTemplates API. + * @class + * @memberof v1 + */ +export class InstanceTemplatesClient { + 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}; + instanceTemplatesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InstanceTemplatesClient. + * + * @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 InstanceTemplatesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.InstanceTemplates', + 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 = gax.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.instanceTemplatesStub) { + return this.instanceTemplatesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.InstanceTemplates. + this.instanceTemplatesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.InstanceTemplates' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.InstanceTemplates, + 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 instanceTemplatesStubMethods = [ + 'delete', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of instanceTemplatesStubMethods) { + const callPromise = this.instanceTemplatesStub.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.instanceTemplatesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified instance template. Deleting an instance template is permanent and cannot be undone. It is not possible to delete templates that are already in use by a managed instance group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceTemplate + * The name of the instance template to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceTemplateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetInstanceTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceTemplate, + protos.google.cloud.compute.v1.IGetInstanceTemplateRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetInstanceTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceTemplate, + | protos.google.cloud.compute.v1.IGetInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetInstanceTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceTemplate, + | protos.google.cloud.compute.v1.IGetInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified instance template. Gets a list of available instance templates by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceTemplate + * The name of the instance template. + * @param {string} request.project + * Project ID for 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 [InstanceTemplate]{@link google.cloud.compute.v1.InstanceTemplate}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetInstanceTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInstanceTemplate, + | protos.google.cloud.compute.v1.IGetInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInstanceTemplate, + | protos.google.cloud.compute.v1.IGetInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceTemplate, + protos.google.cloud.compute.v1.IGetInstanceTemplateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest + | undefined + ), + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.InstanceTemplate} request.instanceTemplateResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceTemplateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest + | undefined + ), + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetPolicyRequest} request.globalSetPolicyRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceTemplate[], + protos.google.cloud.compute.v1.IListInstanceTemplatesRequest | null, + protos.google.cloud.compute.v1.IInstanceTemplateList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + protos.google.cloud.compute.v1.IInstanceTemplateList | null | undefined, + protos.google.cloud.compute.v1.IInstanceTemplate + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + protos.google.cloud.compute.v1.IInstanceTemplateList | null | undefined, + protos.google.cloud.compute.v1.IInstanceTemplate + > + ): void; + /** + * Retrieves a list of instance templates that are contained within the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [InstanceTemplate]{@link google.cloud.compute.v1.InstanceTemplate}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + | protos.google.cloud.compute.v1.IInstanceTemplateList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceTemplate + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + protos.google.cloud.compute.v1.IInstanceTemplateList | null | undefined, + protos.google.cloud.compute.v1.IInstanceTemplate + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceTemplate[], + protos.google.cloud.compute.v1.IListInstanceTemplatesRequest | null, + protos.google.cloud.compute.v1.IInstanceTemplateList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [InstanceTemplate]{@link google.cloud.compute.v1.InstanceTemplate} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [InstanceTemplate]{@link google.cloud.compute.v1.InstanceTemplate}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListInstanceTemplatesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.instanceTemplatesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/instance_templates_client_config.json b/src/v1/instance_templates_client_config.json new file mode 100644 index 00000000..9bec5e0e --- /dev/null +++ b/src/v1/instance_templates_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InstanceTemplates": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/instance_templates_proto_list.json b/src/v1/instance_templates_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/instance_templates_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/instances_client.ts b/src/v1/instances_client.ts new file mode 100644 index 00000000..d77f2eb9 --- /dev/null +++ b/src/v1/instances_client.ts @@ -0,0 +1,5003 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/instances_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './instances_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Instances API. + * @class + * @memberof v1 + */ +export class InstancesClient { + 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}; + instancesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InstancesClient. + * + * @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 InstancesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listReferrers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Instances', + 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 = gax.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.instancesStub) { + return this.instancesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Instances. + this.instancesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Instances' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Instances, + 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 instancesStubMethods = [ + 'addAccessConfig', + 'addResourcePolicies', + 'aggregatedList', + 'attachDisk', + 'bulkInsert', + 'delete', + 'deleteAccessConfig', + 'detachDisk', + 'get', + 'getEffectiveFirewalls', + 'getGuestAttributes', + 'getIamPolicy', + 'getScreenshot', + 'getSerialPortOutput', + 'getShieldedInstanceIdentity', + 'insert', + 'list', + 'listReferrers', + 'removeResourcePolicies', + 'reset', + 'setDeletionProtection', + 'setDiskAutoDelete', + 'setIamPolicy', + 'setLabels', + 'setMachineResources', + 'setMachineType', + 'setMetadata', + 'setMinCpuPlatform', + 'setScheduling', + 'setServiceAccount', + 'setShieldedInstanceIntegrityPolicy', + 'setTags', + 'simulateMaintenanceEvent', + 'start', + 'startWithEncryptionKey', + 'stop', + 'testIamPermissions', + 'update', + 'updateAccessConfig', + 'updateDisplayDevice', + 'updateNetworkInterface', + 'updateShieldedInstanceConfig', + ]; + for (const methodName of instancesStubMethods) { + const callPromise = this.instancesStub.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.instancesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addAccessConfig( + request?: protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest + | undefined + ), + {} | undefined + ] + >; + addAccessConfig( + request: protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addAccessConfig( + request: protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds an access config to an instance's network interface. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.AccessConfig} request.accessConfigResource + * The body resource for this request + * @param {string} request.instance + * The instance name for this request. + * @param {string} request.networkInterface + * The name of the network interface to add to this instance. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addAccessConfig(request); + */ + addAccessConfig( + request?: protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddAccessConfigInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addAccessConfig(request, options, callback); + } + addResourcePolicies( + request?: protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest + | undefined + ), + {} | undefined + ] + >; + addResourcePolicies( + request: protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addResourcePolicies( + request: protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds existing resource policies to an instance. You can only add one policy right now which will be applied to this instance for scheduling live migrations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * The instance name for this request. + * @param {google.cloud.compute.v1.InstancesAddResourcePoliciesRequest} request.instancesAddResourcePoliciesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addResourcePolicies(request); + */ + addResourcePolicies( + request?: protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddResourcePoliciesInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addResourcePolicies(request, options, callback); + } + attachDisk( + request?: protos.google.cloud.compute.v1.IAttachDiskInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAttachDiskInstanceRequest | undefined, + {} | undefined + ] + >; + attachDisk( + request: protos.google.cloud.compute.v1.IAttachDiskInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + attachDisk( + request: protos.google.cloud.compute.v1.IAttachDiskInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Attaches an existing Disk resource to an instance. You must first create the disk before you can attach it. It is not possible to create and attach a disk at the same time. For more information, read Adding a persistent disk to your instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.AttachedDisk} request.attachedDiskResource + * The body resource for this request + * @param {boolean} request.forceAttach + * Whether to force attach the regional disk even if it's currently attached to another instance. If you try to force attach a zonal disk to an instance, you will receive an error. + * @param {string} request.instance + * The instance name for this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.attachDisk(request); + */ + attachDisk( + request?: protos.google.cloud.compute.v1.IAttachDiskInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAttachDiskInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.attachDisk(request, options, callback); + } + bulkInsert( + request?: protos.google.cloud.compute.v1.IBulkInsertInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IBulkInsertInstanceRequest | undefined, + {} | undefined + ] + >; + bulkInsert( + request: protos.google.cloud.compute.v1.IBulkInsertInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + bulkInsert( + request: protos.google.cloud.compute.v1.IBulkInsertInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates multiple instances. Count specifies the number of instances to create. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.BulkInsertInstanceResource} request.bulkInsertInstanceResourceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.bulkInsert(request); + */ + bulkInsert( + request?: protos.google.cloud.compute.v1.IBulkInsertInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IBulkInsertInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.bulkInsert(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified Instance resource. For more information, see Deleting an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + deleteAccessConfig( + request?: protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest + | undefined + ), + {} | undefined + ] + >; + deleteAccessConfig( + request: protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteAccessConfig( + request: protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes an access config from an instance's network interface. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.accessConfig + * The name of the access config to delete. + * @param {string} request.instance + * The instance name for this request. + * @param {string} request.networkInterface + * The name of the network interface. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deleteAccessConfig(request); + */ + deleteAccessConfig( + request?: protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteAccessConfigInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deleteAccessConfig(request, options, callback); + } + detachDisk( + request?: protos.google.cloud.compute.v1.IDetachDiskInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDetachDiskInstanceRequest | undefined, + {} | undefined + ] + >; + detachDisk( + request: protos.google.cloud.compute.v1.IDetachDiskInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + detachDisk( + request: protos.google.cloud.compute.v1.IDetachDiskInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Detaches a disk from an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.deviceName + * The device name of the disk to detach. Make a get() request on the instance to view currently attached disks and device names. + * @param {string} request.instance + * Instance name for this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.detachDisk(request); + */ + detachDisk( + request?: protos.google.cloud.compute.v1.IDetachDiskInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachDiskInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDetachDiskInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.detachDisk(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstance, + protos.google.cloud.compute.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInstance, + protos.google.cloud.compute.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInstance, + protos.google.cloud.compute.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified Instance resource. Gets a list of available instances by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [Instance]{@link google.cloud.compute.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 + * const [response] = await client.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInstance, + protos.google.cloud.compute.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInstance, + protos.google.cloud.compute.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstance, + protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getEffectiveFirewalls( + request?: protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, + ( + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest + | undefined + ), + {} | undefined + ] + >; + getEffectiveFirewalls( + request: protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEffectiveFirewalls( + request: protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns effective firewalls applied to an interface of the instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {string} request.networkInterface + * The name of the network interface to get the effective firewalls. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [InstancesGetEffectiveFirewallsResponse]{@link google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse}. + * 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.getEffectiveFirewalls(request); + */ + getEffectiveFirewalls( + request?: protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse, + ( + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getEffectiveFirewalls(request, options, callback); + } + getGuestAttributes( + request?: protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IGuestAttributes, + ( + | protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest + | undefined + ), + {} | undefined + ] + >; + getGuestAttributes( + request: protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IGuestAttributes, + | protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGuestAttributes( + request: protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IGuestAttributes, + | protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified guest attributes entry. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.queryPath + * Specifies the guest attributes path to be queried. + * @param {string} request.variableKey + * Specifies the key for the guest attributes entry. + * @param {string} request.zone + * The name of the zone for 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 [GuestAttributes]{@link google.cloud.compute.v1.GuestAttributes}. + * 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.getGuestAttributes(request); + */ + getGuestAttributes( + request?: protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IGuestAttributes, + | protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IGuestAttributes, + | protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IGuestAttributes, + ( + | protos.google.cloud.compute.v1.IGetGuestAttributesInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getGuestAttributes(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + getScreenshot( + request?: protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IScreenshot, + protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest | undefined, + {} | undefined + ] + >; + getScreenshot( + request: protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IScreenshot, + | protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getScreenshot( + request: protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IScreenshot, + | protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the screenshot from the specified instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [Screenshot]{@link google.cloud.compute.v1.Screenshot}. + * 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.getScreenshot(request); + */ + getScreenshot( + request?: protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IScreenshot, + | protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IScreenshot, + | protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IScreenshot, + protos.google.cloud.compute.v1.IGetScreenshotInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getScreenshot(request, options, callback); + } + getSerialPortOutput( + request?: protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISerialPortOutput, + ( + | protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest + | undefined + ), + {} | undefined + ] + >; + getSerialPortOutput( + request: protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISerialPortOutput, + | protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSerialPortOutput( + request: protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISerialPortOutput, + | protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the last 1 MB of serial port output from the specified instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance for this request. + * @param {number} request.port + * Specifies which COM or serial port to retrieve data from. + * @param {string} request.project + * Project ID for this request. + * @param {number} request.start + * Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. + * + * If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. + * + * You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. + * @param {string} request.zone + * The name of the zone for 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 [SerialPortOutput]{@link google.cloud.compute.v1.SerialPortOutput}. + * 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.getSerialPortOutput(request); + */ + getSerialPortOutput( + request?: protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISerialPortOutput, + | protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISerialPortOutput, + | protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISerialPortOutput, + ( + | protos.google.cloud.compute.v1.IGetSerialPortOutputInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getSerialPortOutput(request, options, callback); + } + getShieldedInstanceIdentity( + request?: protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IShieldedInstanceIdentity, + ( + | protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest + | undefined + ), + {} | undefined + ] + >; + getShieldedInstanceIdentity( + request: protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IShieldedInstanceIdentity, + | protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getShieldedInstanceIdentity( + request: protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IShieldedInstanceIdentity, + | protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the Shielded Instance Identity of an instance + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name or id of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [ShieldedInstanceIdentity]{@link google.cloud.compute.v1.ShieldedInstanceIdentity}. + * 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.getShieldedInstanceIdentity(request); + */ + getShieldedInstanceIdentity( + request?: protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IShieldedInstanceIdentity, + | protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IShieldedInstanceIdentity, + | protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IShieldedInstanceIdentity, + ( + | protos.google.cloud.compute.v1.IGetShieldedInstanceIdentityInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getShieldedInstanceIdentity( + request, + options, + callback + ); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an instance resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Instance} request.instanceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sourceInstanceTemplate + * Specifies instance template to create the instance. + * + * This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: + * - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate + * - projects/project/global/instanceTemplates/instanceTemplate + * - global/instanceTemplates/instanceTemplate + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + removeResourcePolicies( + request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest + | undefined + ), + {} | undefined + ] + >; + removeResourcePolicies( + request: protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeResourcePolicies( + request: protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes resource policies from an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * The instance name for this request. + * @param {google.cloud.compute.v1.InstancesRemoveResourcePoliciesRequest} request.instancesRemoveResourcePoliciesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeResourcePolicies(request); + */ + removeResourcePolicies( + request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removeResourcePolicies( + request, + options, + callback + ); + } + reset( + request?: protos.google.cloud.compute.v1.IResetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResetInstanceRequest | undefined, + {} | undefined + ] + >; + reset( + request: protos.google.cloud.compute.v1.IResetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + reset( + request: protos.google.cloud.compute.v1.IResetInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Performs a reset on the instance. This is a hard reset the VM does not do a graceful shutdown. For more information, see Resetting an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.reset(request); + */ + reset( + request?: protos.google.cloud.compute.v1.IResetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResetInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.reset(request, options, callback); + } + setDeletionProtection( + request?: protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest + | undefined + ), + {} | undefined + ] + >; + setDeletionProtection( + request: protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setDeletionProtection( + request: protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets deletion protection on the instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {boolean} request.deletionProtection + * Whether the resource should be protected against deletion. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setDeletionProtection(request); + */ + setDeletionProtection( + request?: protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetDeletionProtectionInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setDeletionProtection(request, options, callback); + } + setDiskAutoDelete( + request?: protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest + | undefined + ), + {} | undefined + ] + >; + setDiskAutoDelete( + request: protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setDiskAutoDelete( + request: protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the auto-delete flag for a disk attached to an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {boolean} request.autoDelete + * Whether to auto-delete the disk when the instance is deleted. + * @param {string} request.deviceName + * The device name of the disk to modify. Make a get() request on the instance to view currently attached disks and device names. + * @param {string} request.instance + * The instance name for this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setDiskAutoDelete(request); + */ + setDiskAutoDelete( + request?: protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetDiskAutoDeleteInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setDiskAutoDelete(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for this request. + * @param {google.cloud.compute.v1.ZoneSetPolicyRequest} request.zoneSetPolicyRequestResource + * The body resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsInstanceRequest | undefined, + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {google.cloud.compute.v1.InstancesSetLabelsRequest} request.instancesSetLabelsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + setMachineResources( + request?: protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest + | undefined + ), + {} | undefined + ] + >; + setMachineResources( + request: protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setMachineResources( + request: protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the number and/or type of accelerator for a stopped instance to the values specified in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {google.cloud.compute.v1.InstancesSetMachineResourcesRequest} request.instancesSetMachineResourcesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setMachineResources(request); + */ + setMachineResources( + request?: protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetMachineResourcesInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setMachineResources(request, options, callback); + } + setMachineType( + request?: protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest | undefined, + {} | undefined + ] + >; + setMachineType( + request: protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setMachineType( + request: protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the machine type for a stopped instance to the machine type specified in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {google.cloud.compute.v1.InstancesSetMachineTypeRequest} request.instancesSetMachineTypeRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setMachineType(request); + */ + setMachineType( + request?: protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetMachineTypeInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setMachineType(request, options, callback); + } + setMetadata( + request?: protos.google.cloud.compute.v1.ISetMetadataInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetMetadataInstanceRequest | undefined, + {} | undefined + ] + >; + setMetadata( + request: protos.google.cloud.compute.v1.ISetMetadataInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMetadataInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setMetadata( + request: protos.google.cloud.compute.v1.ISetMetadataInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMetadataInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets metadata for the specified instance to the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {google.cloud.compute.v1.Metadata} request.metadataResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setMetadata(request); + */ + setMetadata( + request?: protos.google.cloud.compute.v1.ISetMetadataInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMetadataInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMetadataInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetMetadataInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setMetadata(request, options, callback); + } + setMinCpuPlatform( + request?: protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest + | undefined + ), + {} | undefined + ] + >; + setMinCpuPlatform( + request: protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setMinCpuPlatform( + request: protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the minimum CPU platform that this instance should use. This method can only be called on a stopped instance. For more information, read Specifying a Minimum CPU Platform. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {google.cloud.compute.v1.InstancesSetMinCpuPlatformRequest} request.instancesSetMinCpuPlatformRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setMinCpuPlatform(request); + */ + setMinCpuPlatform( + request?: protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetMinCpuPlatformInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setMinCpuPlatform(request, options, callback); + } + setScheduling( + request?: protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest | undefined, + {} | undefined + ] + >; + setScheduling( + request: protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setScheduling( + request: protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets an instance's scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a `TERMINATED` state. See Instance Life Cycle for more information on the possible instance states. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Instance name for this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Scheduling} request.schedulingResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setScheduling(request); + */ + setScheduling( + request?: protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetSchedulingInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setScheduling(request, options, callback); + } + setServiceAccount( + request?: protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest + | undefined + ), + {} | undefined + ] + >; + setServiceAccount( + request: protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setServiceAccount( + request: protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance resource to start. + * @param {google.cloud.compute.v1.InstancesSetServiceAccountRequest} request.instancesSetServiceAccountRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setServiceAccount(request); + */ + setServiceAccount( + request?: protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetServiceAccountInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setServiceAccount(request, options, callback); + } + setShieldedInstanceIntegrityPolicy( + request?: protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest + | undefined + ), + {} | undefined + ] + >; + setShieldedInstanceIntegrityPolicy( + request: protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setShieldedInstanceIntegrityPolicy( + request: protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the Shielded Instance integrity policy for an instance. You can only use this method on a running instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name or id of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.ShieldedInstanceIntegrityPolicy} request.shieldedInstanceIntegrityPolicyResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setShieldedInstanceIntegrityPolicy(request); + */ + setShieldedInstanceIntegrityPolicy( + request?: protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetShieldedInstanceIntegrityPolicyInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setShieldedInstanceIntegrityPolicy( + request, + options, + callback + ); + } + setTags( + request?: protos.google.cloud.compute.v1.ISetTagsInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetTagsInstanceRequest | undefined, + {} | undefined + ] + >; + setTags( + request: protos.google.cloud.compute.v1.ISetTagsInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetTagsInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + setTags( + request: protos.google.cloud.compute.v1.ISetTagsInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetTagsInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Sets network tags for the specified instance to the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Tags} request.tagsResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setTags(request); + */ + setTags( + request?: protos.google.cloud.compute.v1.ISetTagsInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTagsInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetTagsInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetTagsInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setTags(request, options, callback); + } + simulateMaintenanceEvent( + request?: protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest + | undefined + ), + {} | undefined + ] + >; + simulateMaintenanceEvent( + request: protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + simulateMaintenanceEvent( + request: protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Simulates a maintenance event on the instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.simulateMaintenanceEvent(request); + */ + simulateMaintenanceEvent( + request?: protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISimulateMaintenanceEventInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.simulateMaintenanceEvent( + request, + options, + callback + ); + } + start( + request?: protos.google.cloud.compute.v1.IStartInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStartInstanceRequest | undefined, + {} | undefined + ] + >; + start( + request: protos.google.cloud.compute.v1.IStartInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStartInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + start( + request: protos.google.cloud.compute.v1.IStartInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStartInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance resource to start. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.start(request); + */ + start( + request?: protos.google.cloud.compute.v1.IStartInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IStartInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStartInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStartInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.start(request, options, callback); + } + startWithEncryptionKey( + request?: protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest + | undefined + ), + {} | undefined + ] + >; + startWithEncryptionKey( + request: protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + startWithEncryptionKey( + request: protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Starts an instance that was stopped using the instances().stop method. For more information, see Restart an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance resource to start. + * @param {google.cloud.compute.v1.InstancesStartWithEncryptionKeyRequest} request.instancesStartWithEncryptionKeyRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.startWithEncryptionKey(request); + */ + startWithEncryptionKey( + request?: protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IStartWithEncryptionKeyInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.startWithEncryptionKey( + request, + options, + callback + ); + } + stop( + request?: protos.google.cloud.compute.v1.IStopInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStopInstanceRequest | undefined, + {} | undefined + ] + >; + stop( + request: protos.google.cloud.compute.v1.IStopInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStopInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + stop( + request: protos.google.cloud.compute.v1.IStopInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStopInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Stops a running instance, shutting it down cleanly, and allows you to restart the instance at a later time. Stopped instances do not incur VM usage charges while they are stopped. However, resources that the VM is using, such as persistent disks and static IP addresses, will continue to be charged until they are deleted. For more information, see Stopping an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance resource to stop. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.stop(request); + */ + stop( + request?: protos.google.cloud.compute.v1.IStopInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IStopInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStopInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IStopInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.stop(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateInstanceRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name of the instance resource to update. + * @param {google.cloud.compute.v1.Instance} request.instanceResource + * The body resource for this request + * @param {string} request.minimalAction + * Specifies the action to take when updating an instance even if the updated properties do not require it. If not specified, then Compute Engine acts based on the minimum action that the updated properties require. + * @param {string} request.mostDisruptiveAllowedAction + * Specifies the most disruptive action that can be taken on the instance as part of the update. Compute Engine returns an error if the instance properties require a more disruptive action as part of the instance update. Valid options from lowest to highest are NO_EFFECT, REFRESH, and RESTART. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + updateAccessConfig( + request?: protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest + | undefined + ), + {} | undefined + ] + >; + updateAccessConfig( + request: protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAccessConfig( + request: protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified access config from an instance's network interface with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.AccessConfig} request.accessConfigResource + * The body resource for this request + * @param {string} request.instance + * The instance name for this request. + * @param {string} request.networkInterface + * The name of the network interface where the access config is attached. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.updateAccessConfig(request); + */ + updateAccessConfig( + request?: protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateAccessConfigInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.updateAccessConfig(request, options, callback); + } + updateDisplayDevice( + request?: protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest + | undefined + ), + {} | undefined + ] + >; + updateDisplayDevice( + request: protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDisplayDevice( + request: protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the Display config for a VM instance. You can only use this method on a stopped VM instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.DisplayDevice} request.displayDeviceResource + * The body resource for this request + * @param {string} request.instance + * Name of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.updateDisplayDevice(request); + */ + updateDisplayDevice( + request?: protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateDisplayDeviceInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.updateDisplayDevice(request, options, callback); + } + updateNetworkInterface( + request?: protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest + | undefined + ), + {} | undefined + ] + >; + updateNetworkInterface( + request: protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateNetworkInterface( + request: protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * The instance name for this request. + * @param {string} request.networkInterface + * The name of the network interface to update. + * @param {google.cloud.compute.v1.NetworkInterface} request.networkInterfaceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.updateNetworkInterface(request); + */ + updateNetworkInterface( + request?: protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateNetworkInterfaceInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.updateNetworkInterface( + request, + options, + callback + ); + } + updateShieldedInstanceConfig( + request?: protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest + | undefined + ), + {} | undefined + ] + >; + updateShieldedInstanceConfig( + request: protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateShieldedInstanceConfig( + request: protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the Shielded Instance config for an instance. You can only use this method on a stopped instance. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instance + * Name or id of the instance scoping this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.ShieldedInstanceConfig} request.shieldedInstanceConfigResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.updateShieldedInstanceConfig(request); + */ + updateShieldedInstanceConfig( + request?: protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateShieldedInstanceConfigInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.updateShieldedInstanceConfig( + request, + options, + callback + ); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [InstancesScopedList]{@link google.cloud.compute.v1.InstancesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListInstancesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IInstancesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IInstancesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstance[], + protos.google.cloud.compute.v1.IListInstancesRequest | null, + protos.google.cloud.compute.v1.IInstanceList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRequest, + protos.google.cloud.compute.v1.IInstanceList | null | undefined, + protos.google.cloud.compute.v1.IInstance + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRequest, + protos.google.cloud.compute.v1.IInstanceList | null | undefined, + protos.google.cloud.compute.v1.IInstance + > + ): void; + /** + * Retrieves the list of instances contained within the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [Instance]{@link google.cloud.compute.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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRequest, + protos.google.cloud.compute.v1.IInstanceList | null | undefined, + protos.google.cloud.compute.v1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRequest, + protos.google.cloud.compute.v1.IInstanceList | null | undefined, + protos.google.cloud.compute.v1.IInstance + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstance[], + protos.google.cloud.compute.v1.IListInstancesRequest | null, + protos.google.cloud.compute.v1.IInstanceList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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.compute.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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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.compute.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 + * const iterable = client.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listReferrers( + request?: protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IReference[], + protos.google.cloud.compute.v1.IListReferrersInstancesRequest | null, + protos.google.cloud.compute.v1.IInstanceListReferrers + ] + >; + listReferrers( + request: protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + protos.google.cloud.compute.v1.IInstanceListReferrers | null | undefined, + protos.google.cloud.compute.v1.IReference + > + ): void; + listReferrers( + request: protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + protos.google.cloud.compute.v1.IInstanceListReferrers | null | undefined, + protos.google.cloud.compute.v1.IReference + > + ): void; + /** + * Retrieves a list of resources that refer to the VM instance specified in the request. For example, if the VM instance is part of a managed or unmanaged instance group, the referrers list includes the instance group. For more information, read Viewing referrers to VM instances. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instance + * Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [Reference]{@link google.cloud.compute.v1.Reference}. + * 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 `listReferrersAsync()` + * 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. + */ + listReferrers( + request?: protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + | protos.google.cloud.compute.v1.IInstanceListReferrers + | null + | undefined, + protos.google.cloud.compute.v1.IReference + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + protos.google.cloud.compute.v1.IInstanceListReferrers | null | undefined, + protos.google.cloud.compute.v1.IReference + > + ): Promise< + [ + protos.google.cloud.compute.v1.IReference[], + protos.google.cloud.compute.v1.IListReferrersInstancesRequest | null, + protos.google.cloud.compute.v1.IInstanceListReferrers + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listReferrers(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instance + * Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [Reference]{@link google.cloud.compute.v1.Reference} 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 `listReferrersAsync()` + * 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. + */ + listReferrersStream( + request?: protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listReferrers.createStream( + this.innerApiCalls.listReferrers as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listReferrers`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instance + * Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [Reference]{@link google.cloud.compute.v1.Reference}. 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.listReferrersAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listReferrersAsync( + request?: protos.google.cloud.compute.v1.IListReferrersInstancesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listReferrers.asyncIterate( + this.innerApiCalls['listReferrers'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.instancesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/instances_client_config.json b/src/v1/instances_client_config.json new file mode 100644 index 00000000..2560d652 --- /dev/null +++ b/src/v1/instances_client_config.json @@ -0,0 +1,194 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Instances": { + "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": { + "AddAccessConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddResourcePolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AttachDisk": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BulkInsert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteAccessConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DetachDisk": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEffectiveFirewalls": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGuestAttributes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetScreenshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSerialPortOutput": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetShieldedInstanceIdentity": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReferrers": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveResourcePolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Reset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetDeletionProtection": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetDiskAutoDelete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMachineResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMachineType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMetadata": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetMinCpuPlatform": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetScheduling": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetServiceAccount": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetShieldedInstanceIntegrityPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetTags": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SimulateMaintenanceEvent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Start": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartWithEncryptionKey": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Stop": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAccessConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDisplayDevice": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNetworkInterface": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateShieldedInstanceConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/instances_proto_list.json b/src/v1/instances_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/instances_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/interconnect_attachments_client.ts b/src/v1/interconnect_attachments_client.ts new file mode 100644 index 00000000..3f213b9d --- /dev/null +++ b/src/v1/interconnect_attachments_client.ts @@ -0,0 +1,1083 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/interconnect_attachments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './interconnect_attachments_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The InterconnectAttachments API. + * @class + * @memberof v1 + */ +export class InterconnectAttachmentsClient { + 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}; + interconnectAttachmentsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InterconnectAttachmentsClient. + * + * @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 InterconnectAttachmentsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.InterconnectAttachments', + 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 = gax.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.interconnectAttachmentsStub) { + return this.interconnectAttachmentsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.InterconnectAttachments. + this.interconnectAttachmentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.InterconnectAttachments' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.InterconnectAttachments, + 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 interconnectAttachmentsStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + ]; + for (const methodName of interconnectAttachmentsStubMethods) { + const callPromise = this.interconnectAttachmentsStub.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.interconnectAttachmentsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified interconnect attachment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnectAttachment + * Name of the interconnect attachment to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectAttachment, + ( + | protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnectAttachment, + | protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnectAttachment, + | protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified interconnect attachment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnectAttachment + * Name of the interconnect attachment to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [InterconnectAttachment]{@link google.cloud.compute.v1.InterconnectAttachment}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInterconnectAttachment, + | protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInterconnectAttachment, + | protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectAttachment, + ( + | protos.google.cloud.compute.v1.IGetInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an InterconnectAttachment in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.InterconnectAttachment} request.interconnectAttachmentResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 + * If true, the request will not be committed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified interconnect attachment with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnectAttachment + * Name of the interconnect attachment to patch. + * @param {google.cloud.compute.v1.InterconnectAttachment} request.interconnectAttachmentResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchInterconnectAttachmentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [InterconnectAttachmentsScopedList]{@link google.cloud.compute.v1.InterconnectAttachmentsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListInterconnectAttachmentsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IInterconnectAttachmentsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [ + string, + protos.google.cloud.compute.v1.IInterconnectAttachmentsScopedList + ] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectAttachment[], + protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest | null, + protos.google.cloud.compute.v1.IInterconnectAttachmentList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + | protos.google.cloud.compute.v1.IInterconnectAttachmentList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectAttachment + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + | protos.google.cloud.compute.v1.IInterconnectAttachmentList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectAttachment + > + ): void; + /** + * Retrieves the list of interconnect attachments contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [InterconnectAttachment]{@link google.cloud.compute.v1.InterconnectAttachment}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + | protos.google.cloud.compute.v1.IInterconnectAttachmentList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectAttachment + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + | protos.google.cloud.compute.v1.IInterconnectAttachmentList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectAttachment + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectAttachment[], + protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest | null, + protos.google.cloud.compute.v1.IInterconnectAttachmentList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [InterconnectAttachment]{@link google.cloud.compute.v1.InterconnectAttachment} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [InterconnectAttachment]{@link google.cloud.compute.v1.InterconnectAttachment}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListInterconnectAttachmentsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.interconnectAttachmentsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/interconnect_attachments_client_config.json b/src/v1/interconnect_attachments_client_config.json new file mode 100644 index 00000000..3d028bf1 --- /dev/null +++ b/src/v1/interconnect_attachments_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InterconnectAttachments": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/interconnect_attachments_proto_list.json b/src/v1/interconnect_attachments_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/interconnect_attachments_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/interconnect_locations_client.ts b/src/v1/interconnect_locations_client.ts new file mode 100644 index 00000000..9a8f23de --- /dev/null +++ b/src/v1/interconnect_locations_client.ts @@ -0,0 +1,665 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/interconnect_locations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './interconnect_locations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The InterconnectLocations API. + * @class + * @memberof v1 + */ +export class InterconnectLocationsClient { + 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}; + interconnectLocationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InterconnectLocationsClient. + * + * @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 InterconnectLocationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.InterconnectLocations', + 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 = gax.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.interconnectLocationsStub) { + return this.interconnectLocationsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.InterconnectLocations. + this.interconnectLocationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.InterconnectLocations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.InterconnectLocations, + 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 interconnectLocationsStubMethods = ['get', 'list']; + for (const methodName of interconnectLocationsStubMethods) { + const callPromise = this.interconnectLocationsStub.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.interconnectLocationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetInterconnectLocationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectLocation, + ( + | protos.google.cloud.compute.v1.IGetInterconnectLocationRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetInterconnectLocationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnectLocation, + | protos.google.cloud.compute.v1.IGetInterconnectLocationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetInterconnectLocationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnectLocation, + | protos.google.cloud.compute.v1.IGetInterconnectLocationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the details for the specified interconnect location. Gets a list of available interconnect locations by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnectLocation + * Name of the interconnect location to return. + * @param {string} request.project + * Project ID for 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 [InterconnectLocation]{@link google.cloud.compute.v1.InterconnectLocation}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetInterconnectLocationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInterconnectLocation, + | protos.google.cloud.compute.v1.IGetInterconnectLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInterconnectLocation, + | protos.google.cloud.compute.v1.IGetInterconnectLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectLocation, + ( + | protos.google.cloud.compute.v1.IGetInterconnectLocationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectLocation[], + protos.google.cloud.compute.v1.IListInterconnectLocationsRequest | null, + protos.google.cloud.compute.v1.IInterconnectLocationList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + | protos.google.cloud.compute.v1.IInterconnectLocationList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectLocation + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + | protos.google.cloud.compute.v1.IInterconnectLocationList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectLocation + > + ): void; + /** + * Retrieves the list of interconnect locations available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [InterconnectLocation]{@link google.cloud.compute.v1.InterconnectLocation}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + | protos.google.cloud.compute.v1.IInterconnectLocationList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectLocation + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + | protos.google.cloud.compute.v1.IInterconnectLocationList + | null + | undefined, + protos.google.cloud.compute.v1.IInterconnectLocation + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectLocation[], + protos.google.cloud.compute.v1.IListInterconnectLocationsRequest | null, + protos.google.cloud.compute.v1.IInterconnectLocationList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [InterconnectLocation]{@link google.cloud.compute.v1.InterconnectLocation} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [InterconnectLocation]{@link google.cloud.compute.v1.InterconnectLocation}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListInterconnectLocationsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.interconnectLocationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/interconnect_locations_client_config.json b/src/v1/interconnect_locations_client_config.json new file mode 100644 index 00000000..c9772ce3 --- /dev/null +++ b/src/v1/interconnect_locations_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.compute.v1.InterconnectLocations": { + "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": { + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/interconnect_locations_proto_list.json b/src/v1/interconnect_locations_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/interconnect_locations_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/interconnects_client.ts b/src/v1/interconnects_client.ts new file mode 100644 index 00000000..c9e50d40 --- /dev/null +++ b/src/v1/interconnects_client.ts @@ -0,0 +1,1048 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/interconnects_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './interconnects_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Interconnects API. + * @class + * @memberof v1 + */ +export class InterconnectsClient { + 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}; + interconnectsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of InterconnectsClient. + * + * @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 InterconnectsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Interconnects', + 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 = gax.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.interconnectsStub) { + return this.interconnectsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Interconnects. + this.interconnectsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Interconnects' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Interconnects, + 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 interconnectsStubMethods = [ + 'delete', + 'get', + 'getDiagnostics', + 'insert', + 'list', + 'patch', + ]; + for (const methodName of interconnectsStubMethods) { + const callPromise = this.interconnectsStub.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.interconnectsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteInterconnectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInterconnectRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteInterconnectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteInterconnectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified interconnect. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnect + * Name of the interconnect to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteInterconnectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteInterconnectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetInterconnectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnect, + protos.google.cloud.compute.v1.IGetInterconnectRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetInterconnectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnect, + protos.google.cloud.compute.v1.IGetInterconnectRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetInterconnectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnect, + protos.google.cloud.compute.v1.IGetInterconnectRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified interconnect. Get a list of available interconnects by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnect + * Name of the interconnect to return. + * @param {string} request.project + * Project ID for 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 [Interconnect]{@link google.cloud.compute.v1.Interconnect}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetInterconnectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInterconnect, + | protos.google.cloud.compute.v1.IGetInterconnectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInterconnect, + protos.google.cloud.compute.v1.IGetInterconnectRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnect, + protos.google.cloud.compute.v1.IGetInterconnectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getDiagnostics( + request?: protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, + ( + | protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest + | undefined + ), + {} | undefined + ] + >; + getDiagnostics( + request: protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, + | protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDiagnostics( + request: protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, + | protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the interconnectDiagnostics for the specified interconnect. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnect + * Name of the interconnect resource to query. + * @param {string} request.project + * Project ID for 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 [InterconnectsGetDiagnosticsResponse]{@link google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse}. + * 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.getDiagnostics(request); + */ + getDiagnostics( + request?: protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, + | protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, + | protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse, + ( + | protos.google.cloud.compute.v1.IGetDiagnosticsInterconnectRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getDiagnostics(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertInterconnectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInterconnectRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertInterconnectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertInterconnectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a Interconnect in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Interconnect} request.interconnectResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertInterconnectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertInterconnectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchInterconnectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchInterconnectRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchInterconnectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchInterconnectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified interconnect with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.interconnect + * Name of the interconnect to update. + * @param {google.cloud.compute.v1.Interconnect} request.interconnectResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchInterconnectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchInterconnectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchInterconnectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListInterconnectsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnect[], + protos.google.cloud.compute.v1.IListInterconnectsRequest | null, + protos.google.cloud.compute.v1.IInterconnectList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListInterconnectsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectsRequest, + protos.google.cloud.compute.v1.IInterconnectList | null | undefined, + protos.google.cloud.compute.v1.IInterconnect + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListInterconnectsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectsRequest, + protos.google.cloud.compute.v1.IInterconnectList | null | undefined, + protos.google.cloud.compute.v1.IInterconnect + > + ): void; + /** + * Retrieves the list of interconnect available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Interconnect]{@link google.cloud.compute.v1.Interconnect}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListInterconnectsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectsRequest, + protos.google.cloud.compute.v1.IInterconnectList | null | undefined, + protos.google.cloud.compute.v1.IInterconnect + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInterconnectsRequest, + protos.google.cloud.compute.v1.IInterconnectList | null | undefined, + protos.google.cloud.compute.v1.IInterconnect + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInterconnect[], + protos.google.cloud.compute.v1.IListInterconnectsRequest | null, + protos.google.cloud.compute.v1.IInterconnectList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Interconnect]{@link google.cloud.compute.v1.Interconnect} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListInterconnectsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Interconnect]{@link google.cloud.compute.v1.Interconnect}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListInterconnectsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.interconnectsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/interconnects_client_config.json b/src/v1/interconnects_client_config.json new file mode 100644 index 00000000..40f77383 --- /dev/null +++ b/src/v1/interconnects_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Interconnects": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDiagnostics": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/interconnects_proto_list.json b/src/v1/interconnects_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/interconnects_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/license_codes_client.ts b/src/v1/license_codes_client.ts new file mode 100644 index 00000000..5c2eaf1c --- /dev/null +++ b/src/v1/license_codes_client.ts @@ -0,0 +1,493 @@ +// 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} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/license_codes_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './license_codes_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The LicenseCodes API. + * @class + * @memberof v1 + */ +export class LicenseCodesClient { + 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}; + licenseCodesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LicenseCodesClient. + * + * @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 LicenseCodesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.LicenseCodes', + 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 = gax.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.licenseCodesStub) { + return this.licenseCodesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.LicenseCodes. + this.licenseCodesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.LicenseCodes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.LicenseCodes, + 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 licenseCodesStubMethods = ['get', 'testIamPermissions']; + for (const methodName of licenseCodesStubMethods) { + const callPromise = this.licenseCodesStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.licenseCodesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetLicenseCodeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ILicenseCode, + protos.google.cloud.compute.v1.IGetLicenseCodeRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetLicenseCodeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ILicenseCode, + protos.google.cloud.compute.v1.IGetLicenseCodeRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetLicenseCodeRequest, + callback: Callback< + protos.google.cloud.compute.v1.ILicenseCode, + protos.google.cloud.compute.v1.IGetLicenseCodeRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.licenseCode + * Number corresponding to the License code resource to return. + * @param {string} request.project + * Project ID for 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 [LicenseCode]{@link google.cloud.compute.v1.LicenseCode}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetLicenseCodeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ILicenseCode, + | protos.google.cloud.compute.v1.IGetLicenseCodeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ILicenseCode, + protos.google.cloud.compute.v1.IGetLicenseCodeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ILicenseCode, + protos.google.cloud.compute.v1.IGetLicenseCodeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseCodeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(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 { + this.initialize(); + if (!this._terminated) { + return this.licenseCodesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/license_codes_client_config.json b/src/v1/license_codes_client_config.json new file mode 100644 index 00000000..ba42ff9d --- /dev/null +++ b/src/v1/license_codes_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.compute.v1.LicenseCodes": { + "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": { + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/license_codes_proto_list.json b/src/v1/license_codes_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/license_codes_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/licenses_client.ts b/src/v1/licenses_client.ts new file mode 100644 index 00000000..d78122d4 --- /dev/null +++ b/src/v1/licenses_client.ts @@ -0,0 +1,1128 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/licenses_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './licenses_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Licenses API. + * @class + * @memberof v1 + */ +export class LicensesClient { + 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}; + licensesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of LicensesClient. + * + * @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 LicensesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Licenses', + 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 = gax.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.licensesStub) { + return this.licensesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Licenses. + this.licensesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Licenses' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Licenses, + 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 licensesStubMethods = [ + 'delete', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of licensesStubMethods) { + const callPromise = this.licensesStub.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.licensesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteLicenseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteLicenseRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteLicenseRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteLicenseRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteLicenseRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.license + * Name of the license resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteLicenseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteLicenseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteLicenseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteLicenseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetLicenseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ILicense, + protos.google.cloud.compute.v1.IGetLicenseRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ILicense, + protos.google.cloud.compute.v1.IGetLicenseRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetLicenseRequest, + callback: Callback< + protos.google.cloud.compute.v1.ILicense, + protos.google.cloud.compute.v1.IGetLicenseRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.license + * Name of the License resource to return. + * @param {string} request.project + * Project ID for 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 [License]{@link google.cloud.compute.v1.License}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetLicenseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ILicense, + protos.google.cloud.compute.v1.IGetLicenseRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ILicense, + protos.google.cloud.compute.v1.IGetLicenseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ILicense, + protos.google.cloud.compute.v1.IGetLicenseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyLicenseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertLicenseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertLicenseRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertLicenseRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertLicenseRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertLicenseRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.License} request.licenseResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertLicenseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertLicenseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertLicenseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertLicenseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetPolicyRequest} request.globalSetPolicyRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyLicenseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsLicenseRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListLicensesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ILicense[], + protos.google.cloud.compute.v1.IListLicensesRequest | null, + protos.google.cloud.compute.v1.ILicensesListResponse + ] + >; + list( + request: protos.google.cloud.compute.v1.IListLicensesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListLicensesRequest, + protos.google.cloud.compute.v1.ILicensesListResponse | null | undefined, + protos.google.cloud.compute.v1.ILicense + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListLicensesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListLicensesRequest, + protos.google.cloud.compute.v1.ILicensesListResponse | null | undefined, + protos.google.cloud.compute.v1.ILicense + > + ): void; + /** + * Retrieves the list of licenses available in the specified project. This method does not get any licenses that belong to other projects, including licenses attached to publicly-available images, like Debian 9. If you want to get a list of publicly-available licenses, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [License]{@link google.cloud.compute.v1.License}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListLicensesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListLicensesRequest, + | protos.google.cloud.compute.v1.ILicensesListResponse + | null + | undefined, + protos.google.cloud.compute.v1.ILicense + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListLicensesRequest, + protos.google.cloud.compute.v1.ILicensesListResponse | null | undefined, + protos.google.cloud.compute.v1.ILicense + > + ): Promise< + [ + protos.google.cloud.compute.v1.ILicense[], + protos.google.cloud.compute.v1.IListLicensesRequest | null, + protos.google.cloud.compute.v1.ILicensesListResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [License]{@link google.cloud.compute.v1.License} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListLicensesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [License]{@link google.cloud.compute.v1.License}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListLicensesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.licensesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/licenses_client_config.json b/src/v1/licenses_client_config.json new file mode 100644 index 00000000..61162120 --- /dev/null +++ b/src/v1/licenses_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Licenses": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/licenses_proto_list.json b/src/v1/licenses_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/licenses_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/machine_types_client.ts b/src/v1/machine_types_client.ts new file mode 100644 index 00000000..f97049d6 --- /dev/null +++ b/src/v1/machine_types_client.ts @@ -0,0 +1,728 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/machine_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './machine_types_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The MachineTypes API. + * @class + * @memberof v1 + */ +export class MachineTypesClient { + 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}; + machineTypesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of MachineTypesClient. + * + * @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 MachineTypesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.MachineTypes', + 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 = gax.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.machineTypesStub) { + return this.machineTypesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.MachineTypes. + this.machineTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.MachineTypes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.MachineTypes, + 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 machineTypesStubMethods = ['aggregatedList', 'get', 'list']; + for (const methodName of machineTypesStubMethods) { + const callPromise = this.machineTypesStub.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.machineTypesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetMachineTypeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IMachineType, + protos.google.cloud.compute.v1.IGetMachineTypeRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetMachineTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IMachineType, + protos.google.cloud.compute.v1.IGetMachineTypeRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetMachineTypeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IMachineType, + protos.google.cloud.compute.v1.IGetMachineTypeRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified machine type. Gets a list of available machine types by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.machineType + * Name of the machine type to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [MachineType]{@link google.cloud.compute.v1.MachineType}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetMachineTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IMachineType, + | protos.google.cloud.compute.v1.IGetMachineTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IMachineType, + protos.google.cloud.compute.v1.IGetMachineTypeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IMachineType, + protos.google.cloud.compute.v1.IGetMachineTypeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [MachineTypesScopedList]{@link google.cloud.compute.v1.MachineTypesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListMachineTypesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IMachineTypesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IMachineTypesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListMachineTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IMachineType[], + protos.google.cloud.compute.v1.IListMachineTypesRequest | null, + protos.google.cloud.compute.v1.IMachineTypeList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListMachineTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListMachineTypesRequest, + protos.google.cloud.compute.v1.IMachineTypeList | null | undefined, + protos.google.cloud.compute.v1.IMachineType + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListMachineTypesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListMachineTypesRequest, + protos.google.cloud.compute.v1.IMachineTypeList | null | undefined, + protos.google.cloud.compute.v1.IMachineType + > + ): void; + /** + * Retrieves a list of machine types available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [MachineType]{@link google.cloud.compute.v1.MachineType}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListMachineTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListMachineTypesRequest, + protos.google.cloud.compute.v1.IMachineTypeList | null | undefined, + protos.google.cloud.compute.v1.IMachineType + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListMachineTypesRequest, + protos.google.cloud.compute.v1.IMachineTypeList | null | undefined, + protos.google.cloud.compute.v1.IMachineType + > + ): Promise< + [ + protos.google.cloud.compute.v1.IMachineType[], + protos.google.cloud.compute.v1.IListMachineTypesRequest | null, + protos.google.cloud.compute.v1.IMachineTypeList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [MachineType]{@link google.cloud.compute.v1.MachineType} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListMachineTypesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [MachineType]{@link google.cloud.compute.v1.MachineType}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListMachineTypesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.machineTypesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/machine_types_client_config.json b/src/v1/machine_types_client_config.json new file mode 100644 index 00000000..d741c0b9 --- /dev/null +++ b/src/v1/machine_types_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.compute.v1.MachineTypes": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/machine_types_proto_list.json b/src/v1/machine_types_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/machine_types_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/network_endpoint_groups_client.ts b/src/v1/network_endpoint_groups_client.ts new file mode 100644 index 00000000..bff94413 --- /dev/null +++ b/src/v1/network_endpoint_groups_client.ts @@ -0,0 +1,1563 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/network_endpoint_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './network_endpoint_groups_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The NetworkEndpointGroups API. + * @class + * @memberof v1 + */ +export class NetworkEndpointGroupsClient { + 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}; + networkEndpointGroupsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NetworkEndpointGroupsClient. + * + * @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 NetworkEndpointGroupsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listNetworkEndpoints: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.NetworkEndpointGroups', + 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 = gax.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.networkEndpointGroupsStub) { + return this.networkEndpointGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.NetworkEndpointGroups. + this.networkEndpointGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.NetworkEndpointGroups' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.NetworkEndpointGroups, + 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 networkEndpointGroupsStubMethods = [ + 'aggregatedList', + 'attachNetworkEndpoints', + 'delete', + 'detachNetworkEndpoints', + 'get', + 'insert', + 'list', + 'listNetworkEndpoints', + 'testIamPermissions', + ]; + for (const methodName of networkEndpointGroupsStubMethods) { + const callPromise = this.networkEndpointGroupsStub.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.networkEndpointGroupsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + attachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + attachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + attachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Attach a list of network endpoints to the specified network endpoint group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param {google.cloud.compute.v1.NetworkEndpointGroupsAttachEndpointsRequest} request.networkEndpointGroupsAttachEndpointsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.attachNetworkEndpoints(request); + */ + attachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAttachNetworkEndpointsNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.attachNetworkEndpoints( + request, + options, + callback + ); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified network endpoint group. The network endpoints in the NEG and the VM instances they belong to are not terminated when the NEG is deleted. Note that the NEG cannot be deleted if there are backend services referencing it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group to delete. It should comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + detachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + detachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + detachNetworkEndpoints( + request: protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Detach a list of network endpoints from the specified network endpoint group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @param {google.cloud.compute.v1.NetworkEndpointGroupsDetachEndpointsRequest} request.networkEndpointGroupsDetachEndpointsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.detachNetworkEndpoints(request); + */ + detachNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDetachNetworkEndpointsNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.detachNetworkEndpoints( + request, + options, + callback + ); + } + get( + request?: protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup, + ( + | protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group. It should comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup, + ( + | protos.google.cloud.compute.v1.IGetNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.NetworkEndpointGroup} request.networkEndpointGroupResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [NetworkEndpointGroupsScopedList]{@link google.cloud.compute.v1.NetworkEndpointGroupsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListNetworkEndpointGroupsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.INetworkEndpointGroupsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.INetworkEndpointGroupsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup[], + protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): void; + /** + * Retrieves the list of network endpoint groups that are located in the specified project and zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup[], + protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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 [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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 + * [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[], + protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + ] + >; + listNetworkEndpoints( + request: protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + > + ): void; + listNetworkEndpoints( + request: protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + > + ): void; + /** + * Lists the network endpoints in the specified network endpoint group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} request.networkEndpointGroupsListEndpointsRequestResource + * The body resource for this request + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [NetworkEndpointWithHealthStatus]{@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus}. + * 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 `listNetworkEndpointsAsync()` + * 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. + */ + listNetworkEndpoints( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[], + protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupsListNetworkEndpoints + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listNetworkEndpoints(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} request.networkEndpointGroupsListEndpointsRequestResource + * The body resource for this request + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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 [NetworkEndpointWithHealthStatus]{@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus} 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 `listNetworkEndpointsAsync()` + * 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. + */ + listNetworkEndpointsStream( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNetworkEndpoints.createStream( + this.innerApiCalls.listNetworkEndpoints as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNetworkEndpoints`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param {google.cloud.compute.v1.NetworkEndpointGroupsListEndpointsRequest} request.networkEndpointGroupsListEndpointsRequestResource + * The body resource for this request + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @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 + * [NetworkEndpointWithHealthStatus]{@link google.cloud.compute.v1.NetworkEndpointWithHealthStatus}. 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.listNetworkEndpointsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listNetworkEndpointsAsync( + request?: protos.google.cloud.compute.v1.IListNetworkEndpointsNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNetworkEndpoints.asyncIterate( + this.innerApiCalls['listNetworkEndpoints'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.networkEndpointGroupsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/network_endpoint_groups_client_config.json b/src/v1/network_endpoint_groups_client_config.json new file mode 100644 index 00000000..66b746a1 --- /dev/null +++ b/src/v1/network_endpoint_groups_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NetworkEndpointGroups": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AttachNetworkEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DetachNetworkEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNetworkEndpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/network_endpoint_groups_proto_list.json b/src/v1/network_endpoint_groups_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/network_endpoint_groups_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/networks_client.ts b/src/v1/networks_client.ts new file mode 100644 index 00000000..f717e300 --- /dev/null +++ b/src/v1/networks_client.ts @@ -0,0 +1,1709 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/networks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './networks_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Networks API. + * @class + * @memberof v1 + */ +export class NetworksClient { + 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}; + networksStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NetworksClient. + * + * @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 NetworksClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listPeeringRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Networks', + 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 = gax.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.networksStub) { + return this.networksStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Networks. + this.networksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Networks' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Networks, + 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 networksStubMethods = [ + 'addPeering', + 'delete', + 'get', + 'getEffectiveFirewalls', + 'insert', + 'list', + 'listPeeringRoutes', + 'patch', + 'removePeering', + 'switchToCustomMode', + 'updatePeering', + ]; + for (const methodName of networksStubMethods) { + const callPromise = this.networksStub.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.networksStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addPeering( + request?: protos.google.cloud.compute.v1.IAddPeeringNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddPeeringNetworkRequest | undefined, + {} | undefined + ] + >; + addPeering( + request: protos.google.cloud.compute.v1.IAddPeeringNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddPeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addPeering( + request: protos.google.cloud.compute.v1.IAddPeeringNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddPeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds a peering to the specified network. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network resource to add peering to. + * @param {google.cloud.compute.v1.NetworksAddPeeringRequest} request.networksAddPeeringRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addPeering(request); + */ + addPeering( + request?: protos.google.cloud.compute.v1.IAddPeeringNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddPeeringNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddPeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddPeeringNetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addPeering(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNetworkRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified network. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNetworkRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetwork, + protos.google.cloud.compute.v1.IGetNetworkRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INetwork, + protos.google.cloud.compute.v1.IGetNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.INetwork, + protos.google.cloud.compute.v1.IGetNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified network. Gets a list of available networks by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network to return. + * @param {string} request.project + * Project ID for 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 [Network]{@link google.cloud.compute.v1.Network}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INetwork, + protos.google.cloud.compute.v1.IGetNetworkRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INetwork, + protos.google.cloud.compute.v1.IGetNetworkRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetwork, + protos.google.cloud.compute.v1.IGetNetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getEffectiveFirewalls( + request?: protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, + ( + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest + | undefined + ), + {} | undefined + ] + >; + getEffectiveFirewalls( + request: protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getEffectiveFirewalls( + request: protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the effective firewalls on a given network. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network for this request. + * @param {string} request.project + * Project ID for 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 [NetworksGetEffectiveFirewallsResponse]{@link google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse}. + * 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.getEffectiveFirewalls(request); + */ + getEffectiveFirewalls( + request?: protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse, + ( + | protos.google.cloud.compute.v1.IGetEffectiveFirewallsNetworkRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getEffectiveFirewalls(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNetworkRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a network in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Network} request.networkResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNetworkRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNetworkRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified network with the data included in the request. Only the following fields can be modified: routingConfig.routingMode. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network to update. + * @param {google.cloud.compute.v1.Network} request.networkResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNetworkRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + removePeering( + request?: protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest | undefined, + {} | undefined + ] + >; + removePeering( + request: protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removePeering( + request: protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes a peering from the specified network. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network resource to remove peering from. + * @param {google.cloud.compute.v1.NetworksRemovePeeringRequest} request.networksRemovePeeringRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removePeering(request); + */ + removePeering( + request?: protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IRemovePeeringNetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removePeering(request, options, callback); + } + switchToCustomMode( + request?: protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest + | undefined + ), + {} | undefined + ] + >; + switchToCustomMode( + request: protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + switchToCustomMode( + request: protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Switches the network mode from auto subnet mode to custom subnet mode. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network to be updated. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.switchToCustomMode(request); + */ + switchToCustomMode( + request?: protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISwitchToCustomModeNetworkRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.switchToCustomMode(request, options, callback); + } + updatePeering( + request?: protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest | undefined, + {} | undefined + ] + >; + updatePeering( + request: protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePeering( + request: protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified network peering with the data included in the request Only the following fields can be modified: NetworkPeering.export_custom_routes, and NetworkPeering.import_custom_routes + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.network + * Name of the network resource which the updated peering is belonging to. + * @param {google.cloud.compute.v1.NetworksUpdatePeeringRequest} request.networksUpdatePeeringRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.updatePeering(request); + */ + updatePeering( + request?: protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdatePeeringNetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.updatePeering(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListNetworksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetwork[], + protos.google.cloud.compute.v1.IListNetworksRequest | null, + protos.google.cloud.compute.v1.INetworkList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListNetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworksRequest, + protos.google.cloud.compute.v1.INetworkList | null | undefined, + protos.google.cloud.compute.v1.INetwork + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListNetworksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworksRequest, + protos.google.cloud.compute.v1.INetworkList | null | undefined, + protos.google.cloud.compute.v1.INetwork + > + ): void; + /** + * Retrieves the list of networks available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Network]{@link google.cloud.compute.v1.Network}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListNetworksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNetworksRequest, + protos.google.cloud.compute.v1.INetworkList | null | undefined, + protos.google.cloud.compute.v1.INetwork + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNetworksRequest, + protos.google.cloud.compute.v1.INetworkList | null | undefined, + protos.google.cloud.compute.v1.INetwork + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetwork[], + protos.google.cloud.compute.v1.IListNetworksRequest | null, + protos.google.cloud.compute.v1.INetworkList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Network]{@link google.cloud.compute.v1.Network} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListNetworksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Network]{@link google.cloud.compute.v1.Network}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListNetworksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listPeeringRoutes( + request?: protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IExchangedPeeringRoute[], + protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest | null, + protos.google.cloud.compute.v1.IExchangedPeeringRoutesList + ] + >; + listPeeringRoutes( + request: protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + | protos.google.cloud.compute.v1.IExchangedPeeringRoutesList + | null + | undefined, + protos.google.cloud.compute.v1.IExchangedPeeringRoute + > + ): void; + listPeeringRoutes( + request: protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + | protos.google.cloud.compute.v1.IExchangedPeeringRoutesList + | null + | undefined, + protos.google.cloud.compute.v1.IExchangedPeeringRoute + > + ): void; + /** + * Lists the peering routes exchanged over peering connection. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction} request.direction + * The direction of the exchanged routes. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.network + * Name of the network for this request. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.peeringName + * The response will show routes exchanged over the given peering connection. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [ExchangedPeeringRoute]{@link google.cloud.compute.v1.ExchangedPeeringRoute}. + * 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 `listPeeringRoutesAsync()` + * 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. + */ + listPeeringRoutes( + request?: protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + | protos.google.cloud.compute.v1.IExchangedPeeringRoutesList + | null + | undefined, + protos.google.cloud.compute.v1.IExchangedPeeringRoute + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + | protos.google.cloud.compute.v1.IExchangedPeeringRoutesList + | null + | undefined, + protos.google.cloud.compute.v1.IExchangedPeeringRoute + > + ): Promise< + [ + protos.google.cloud.compute.v1.IExchangedPeeringRoute[], + protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest | null, + protos.google.cloud.compute.v1.IExchangedPeeringRoutesList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listPeeringRoutes(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 {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction} request.direction + * The direction of the exchanged routes. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.network + * Name of the network for this request. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.peeringName + * The response will show routes exchanged over the given peering connection. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [ExchangedPeeringRoute]{@link google.cloud.compute.v1.ExchangedPeeringRoute} 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 `listPeeringRoutesAsync()` + * 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. + */ + listPeeringRoutesStream( + request?: protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPeeringRoutes.createStream( + this.innerApiCalls.listPeeringRoutes as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPeeringRoutes`, 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 {google.cloud.compute.v1.ListPeeringRoutesNetworksRequest.Direction} request.direction + * The direction of the exchanged routes. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.network + * Name of the network for this request. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.peeringName + * The response will show routes exchanged over the given peering connection. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The region of the request. The response will include all subnet routes, static routes and dynamic routes in the region. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [ExchangedPeeringRoute]{@link google.cloud.compute.v1.ExchangedPeeringRoute}. 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.listPeeringRoutesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listPeeringRoutesAsync( + request?: protos.google.cloud.compute.v1.IListPeeringRoutesNetworksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPeeringRoutes.asyncIterate( + this.innerApiCalls['listPeeringRoutes'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.networksStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/networks_client_config.json b/src/v1/networks_client_config.json new file mode 100644 index 00000000..c26bf30d --- /dev/null +++ b/src/v1/networks_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Networks": { + "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": { + "AddPeering": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetEffectiveFirewalls": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPeeringRoutes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemovePeering": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SwitchToCustomMode": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePeering": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/networks_proto_list.json b/src/v1/networks_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/networks_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/node_groups_client.ts b/src/v1/node_groups_client.ts new file mode 100644 index 00000000..58dcb89c --- /dev/null +++ b/src/v1/node_groups_client.ts @@ -0,0 +1,1892 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/node_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './node_groups_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The NodeGroups API. + * @class + * @memberof v1 + */ +export class NodeGroupsClient { + 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}; + nodeGroupsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NodeGroupsClient. + * + * @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 NodeGroupsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listNodes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.NodeGroups', + 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 = gax.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.nodeGroupsStub) { + return this.nodeGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.NodeGroups. + this.nodeGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.NodeGroups' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.NodeGroups, + 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 nodeGroupsStubMethods = [ + 'addNodes', + 'aggregatedList', + 'delete', + 'deleteNodes', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'listNodes', + 'patch', + 'setIamPolicy', + 'setNodeTemplate', + 'testIamPermissions', + ]; + for (const methodName of nodeGroupsStubMethods) { + const callPromise = this.nodeGroupsStub.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.nodeGroupsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addNodes( + request?: protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest | undefined, + {} | undefined + ] + >; + addNodes( + request: protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addNodes( + request: protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds specified number of nodes to the node group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeGroup + * Name of the NodeGroup resource. + * @param {google.cloud.compute.v1.NodeGroupsAddNodesRequest} request.nodeGroupsAddNodesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addNodes(request); + */ + addNodes( + request?: protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddNodesNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addNodes(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodeGroupRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified NodeGroup resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeGroup + * Name of the NodeGroup resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + deleteNodes( + request?: protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest | undefined, + {} | undefined + ] + >; + deleteNodes( + request: protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteNodes( + request: protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes specified nodes from the node group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeGroup + * Name of the NodeGroup resource whose nodes will be deleted. + * @param {google.cloud.compute.v1.NodeGroupsDeleteNodesRequest} request.nodeGroupsDeleteNodesRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deleteNodes(request); + */ + deleteNodes( + request?: protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodesNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deleteNodes(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INodeGroup, + protos.google.cloud.compute.v1.IGetNodeGroupRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INodeGroup, + protos.google.cloud.compute.v1.IGetNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.INodeGroup, + protos.google.cloud.compute.v1.IGetNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeGroup + * Name of the node group to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [NodeGroup]{@link google.cloud.compute.v1.NodeGroup}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INodeGroup, + | protos.google.cloud.compute.v1.IGetNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INodeGroup, + protos.google.cloud.compute.v1.IGetNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INodeGroup, + protos.google.cloud.compute.v1.IGetNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNodeGroupRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a NodeGroup resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.initialNodeCount + * Initial count of nodes in the node group. + * @param {google.cloud.compute.v1.NodeGroup} request.nodeGroupResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNodeGroupRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified node group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeGroup + * Name of the NodeGroup resource to update. + * @param {google.cloud.compute.v1.NodeGroup} request.nodeGroupResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNodeGroupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for this request. + * @param {google.cloud.compute.v1.ZoneSetPolicyRequest} request.zoneSetPolicyRequestResource + * The body resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyNodeGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + setNodeTemplate( + request?: protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest + | undefined + ), + {} | undefined + ] + >; + setNodeTemplate( + request: protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setNodeTemplate( + request: protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the node template of the node group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeGroup + * Name of the NodeGroup resource to update. + * @param {google.cloud.compute.v1.NodeGroupsSetNodeTemplateRequest} request.nodeGroupsSetNodeTemplateRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.zone + * The name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setNodeTemplate(request); + */ + setNodeTemplate( + request?: protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetNodeTemplateNodeGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setNodeTemplate(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [NodeGroupsScopedList]{@link google.cloud.compute.v1.NodeGroupsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListNodeGroupsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.INodeGroupsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.INodeGroupsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListNodeGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INodeGroup[], + protos.google.cloud.compute.v1.IListNodeGroupsRequest | null, + protos.google.cloud.compute.v1.INodeGroupList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListNodeGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeGroupsRequest, + protos.google.cloud.compute.v1.INodeGroupList | null | undefined, + protos.google.cloud.compute.v1.INodeGroup + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListNodeGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeGroupsRequest, + protos.google.cloud.compute.v1.INodeGroupList | null | undefined, + protos.google.cloud.compute.v1.INodeGroup + > + ): void; + /** + * Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [NodeGroup]{@link google.cloud.compute.v1.NodeGroup}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListNodeGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNodeGroupsRequest, + protos.google.cloud.compute.v1.INodeGroupList | null | undefined, + protos.google.cloud.compute.v1.INodeGroup + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeGroupsRequest, + protos.google.cloud.compute.v1.INodeGroupList | null | undefined, + protos.google.cloud.compute.v1.INodeGroup + > + ): Promise< + [ + protos.google.cloud.compute.v1.INodeGroup[], + protos.google.cloud.compute.v1.IListNodeGroupsRequest | null, + protos.google.cloud.compute.v1.INodeGroupList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [NodeGroup]{@link google.cloud.compute.v1.NodeGroup} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListNodeGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [NodeGroup]{@link google.cloud.compute.v1.NodeGroup}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListNodeGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listNodes( + request?: protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INodeGroupNode[], + protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest | null, + protos.google.cloud.compute.v1.INodeGroupsListNodes + ] + >; + listNodes( + request: protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + protos.google.cloud.compute.v1.INodeGroupsListNodes | null | undefined, + protos.google.cloud.compute.v1.INodeGroupNode + > + ): void; + listNodes( + request: protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + protos.google.cloud.compute.v1.INodeGroupsListNodes | null | undefined, + protos.google.cloud.compute.v1.INodeGroupNode + > + ): void; + /** + * Lists nodes in the node group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.nodeGroup + * Name of the NodeGroup resource whose nodes you want to list. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [NodeGroupNode]{@link google.cloud.compute.v1.NodeGroupNode}. + * 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 `listNodesAsync()` + * 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. + */ + listNodes( + request?: protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + | protos.google.cloud.compute.v1.INodeGroupsListNodes + | null + | undefined, + protos.google.cloud.compute.v1.INodeGroupNode + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + protos.google.cloud.compute.v1.INodeGroupsListNodes | null | undefined, + protos.google.cloud.compute.v1.INodeGroupNode + > + ): Promise< + [ + protos.google.cloud.compute.v1.INodeGroupNode[], + protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest | null, + protos.google.cloud.compute.v1.INodeGroupsListNodes + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listNodes(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.nodeGroup + * Name of the NodeGroup resource whose nodes you want to list. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [NodeGroupNode]{@link google.cloud.compute.v1.NodeGroupNode} 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 `listNodesAsync()` + * 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. + */ + listNodesStream( + request?: protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNodes.createStream( + this.innerApiCalls.listNodes as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNodes`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.nodeGroup + * Name of the NodeGroup resource whose nodes you want to list. + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [NodeGroupNode]{@link google.cloud.compute.v1.NodeGroupNode}. 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.listNodesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listNodesAsync( + request?: protos.google.cloud.compute.v1.IListNodesNodeGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listNodes.asyncIterate( + this.innerApiCalls['listNodes'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.nodeGroupsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/node_groups_client_config.json b/src/v1/node_groups_client_config.json new file mode 100644 index 00000000..e2646e0c --- /dev/null +++ b/src/v1/node_groups_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NodeGroups": { + "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": { + "AddNodes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNodes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNodes": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNodeTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/node_groups_proto_list.json b/src/v1/node_groups_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/node_groups_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/node_templates_client.ts b/src/v1/node_templates_client.ts new file mode 100644 index 00000000..6fbf1b87 --- /dev/null +++ b/src/v1/node_templates_client.ts @@ -0,0 +1,1247 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/node_templates_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './node_templates_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The NodeTemplates API. + * @class + * @memberof v1 + */ +export class NodeTemplatesClient { + 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}; + nodeTemplatesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NodeTemplatesClient. + * + * @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 NodeTemplatesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.NodeTemplates', + 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 = gax.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.nodeTemplatesStub) { + return this.nodeTemplatesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.NodeTemplates. + this.nodeTemplatesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.NodeTemplates' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.NodeTemplates, + 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 nodeTemplatesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of nodeTemplatesStubMethods) { + const callPromise = this.nodeTemplatesStub.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.nodeTemplatesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified NodeTemplate resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeTemplate + * Name of the NodeTemplate resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteNodeTemplateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetNodeTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INodeTemplate, + protos.google.cloud.compute.v1.IGetNodeTemplateRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetNodeTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INodeTemplate, + protos.google.cloud.compute.v1.IGetNodeTemplateRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetNodeTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.INodeTemplate, + protos.google.cloud.compute.v1.IGetNodeTemplateRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified node template. Gets a list of available node templates by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeTemplate + * Name of the node template to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for 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 [NodeTemplate]{@link google.cloud.compute.v1.NodeTemplate}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetNodeTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INodeTemplate, + | protos.google.cloud.compute.v1.IGetNodeTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INodeTemplate, + protos.google.cloud.compute.v1.IGetNodeTemplateRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INodeTemplate, + protos.google.cloud.compute.v1.IGetNodeTemplateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest + | undefined + ), + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyNodeTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertNodeTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNodeTemplateRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertNodeTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertNodeTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a NodeTemplate resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.NodeTemplate} request.nodeTemplateResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertNodeTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNodeTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertNodeTemplateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest + | undefined + ), + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {google.cloud.compute.v1.RegionSetPolicyRequest} request.regionSetPolicyRequestResource + * The body resource for this request + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyNodeTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsNodeTemplateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [NodeTemplatesScopedList]{@link google.cloud.compute.v1.NodeTemplatesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListNodeTemplatesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.INodeTemplatesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.INodeTemplatesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INodeTemplate[], + protos.google.cloud.compute.v1.IListNodeTemplatesRequest | null, + protos.google.cloud.compute.v1.INodeTemplateList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + protos.google.cloud.compute.v1.INodeTemplateList | null | undefined, + protos.google.cloud.compute.v1.INodeTemplate + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + protos.google.cloud.compute.v1.INodeTemplateList | null | undefined, + protos.google.cloud.compute.v1.INodeTemplate + > + ): void; + /** + * Retrieves a list of node templates available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [NodeTemplate]{@link google.cloud.compute.v1.NodeTemplate}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + protos.google.cloud.compute.v1.INodeTemplateList | null | undefined, + protos.google.cloud.compute.v1.INodeTemplate + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + protos.google.cloud.compute.v1.INodeTemplateList | null | undefined, + protos.google.cloud.compute.v1.INodeTemplate + > + ): Promise< + [ + protos.google.cloud.compute.v1.INodeTemplate[], + protos.google.cloud.compute.v1.IListNodeTemplatesRequest | null, + protos.google.cloud.compute.v1.INodeTemplateList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [NodeTemplate]{@link google.cloud.compute.v1.NodeTemplate} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [NodeTemplate]{@link google.cloud.compute.v1.NodeTemplate}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListNodeTemplatesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.nodeTemplatesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/node_templates_client_config.json b/src/v1/node_templates_client_config.json new file mode 100644 index 00000000..59375d22 --- /dev/null +++ b/src/v1/node_templates_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NodeTemplates": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/node_templates_proto_list.json b/src/v1/node_templates_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/node_templates_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/node_types_client.ts b/src/v1/node_types_client.ts new file mode 100644 index 00000000..9a0358b1 --- /dev/null +++ b/src/v1/node_types_client.ts @@ -0,0 +1,726 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/node_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './node_types_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The NodeTypes API. + * @class + * @memberof v1 + */ +export class NodeTypesClient { + 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}; + nodeTypesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NodeTypesClient. + * + * @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 NodeTypesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.NodeTypes', + 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 = gax.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.nodeTypesStub) { + return this.nodeTypesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.NodeTypes. + this.nodeTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.NodeTypes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.NodeTypes, + 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 nodeTypesStubMethods = ['aggregatedList', 'get', 'list']; + for (const methodName of nodeTypesStubMethods) { + const callPromise = this.nodeTypesStub.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.nodeTypesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetNodeTypeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INodeType, + protos.google.cloud.compute.v1.IGetNodeTypeRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetNodeTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INodeType, + protos.google.cloud.compute.v1.IGetNodeTypeRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetNodeTypeRequest, + callback: Callback< + protos.google.cloud.compute.v1.INodeType, + protos.google.cloud.compute.v1.IGetNodeTypeRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified node type. Gets a list of available node types by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.nodeType + * Name of the node type to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * The name of the zone for 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 [NodeType]{@link google.cloud.compute.v1.NodeType}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetNodeTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INodeType, + protos.google.cloud.compute.v1.IGetNodeTypeRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INodeType, + protos.google.cloud.compute.v1.IGetNodeTypeRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INodeType, + protos.google.cloud.compute.v1.IGetNodeTypeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [NodeTypesScopedList]{@link google.cloud.compute.v1.NodeTypesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListNodeTypesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.INodeTypesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.INodeTypesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListNodeTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INodeType[], + protos.google.cloud.compute.v1.IListNodeTypesRequest | null, + protos.google.cloud.compute.v1.INodeTypeList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListNodeTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTypesRequest, + protos.google.cloud.compute.v1.INodeTypeList | null | undefined, + protos.google.cloud.compute.v1.INodeType + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListNodeTypesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTypesRequest, + protos.google.cloud.compute.v1.INodeTypeList | null | undefined, + protos.google.cloud.compute.v1.INodeType + > + ): void; + /** + * Retrieves a list of node types available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for 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 Array of [NodeType]{@link google.cloud.compute.v1.NodeType}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListNodeTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTypesRequest, + protos.google.cloud.compute.v1.INodeTypeList | null | undefined, + protos.google.cloud.compute.v1.INodeType + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListNodeTypesRequest, + protos.google.cloud.compute.v1.INodeTypeList | null | undefined, + protos.google.cloud.compute.v1.INodeType + > + ): Promise< + [ + protos.google.cloud.compute.v1.INodeType[], + protos.google.cloud.compute.v1.IListNodeTypesRequest | null, + protos.google.cloud.compute.v1.INodeTypeList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 [NodeType]{@link google.cloud.compute.v1.NodeType} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListNodeTypesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * The name of the zone for this request. + * @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 + * [NodeType]{@link google.cloud.compute.v1.NodeType}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListNodeTypesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.nodeTypesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/node_types_client_config.json b/src/v1/node_types_client_config.json new file mode 100644 index 00000000..47c4adac --- /dev/null +++ b/src/v1/node_types_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.compute.v1.NodeTypes": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/node_types_proto_list.json b/src/v1/node_types_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/node_types_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/packet_mirrorings_client.ts b/src/v1/packet_mirrorings_client.ts new file mode 100644 index 00000000..2ac8ddf1 --- /dev/null +++ b/src/v1/packet_mirrorings_client.ts @@ -0,0 +1,1151 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/packet_mirrorings_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './packet_mirrorings_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The PacketMirrorings API. + * @class + * @memberof v1 + */ +export class PacketMirroringsClient { + 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}; + packetMirroringsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PacketMirroringsClient. + * + * @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 PacketMirroringsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.PacketMirrorings', + 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 = gax.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.packetMirroringsStub) { + return this.packetMirroringsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.PacketMirrorings. + this.packetMirroringsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.PacketMirrorings' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.PacketMirrorings, + 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 packetMirroringsStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'testIamPermissions', + ]; + for (const methodName of packetMirroringsStubMethods) { + const callPromise = this.packetMirroringsStub.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.packetMirroringsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeletePacketMirroringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeletePacketMirroringRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeletePacketMirroringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeletePacketMirroringRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified PacketMirroring resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.packetMirroring + * Name of the PacketMirroring resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeletePacketMirroringRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePacketMirroringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeletePacketMirroringRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetPacketMirroringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPacketMirroring, + protos.google.cloud.compute.v1.IGetPacketMirroringRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetPacketMirroringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPacketMirroring, + | protos.google.cloud.compute.v1.IGetPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetPacketMirroringRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPacketMirroring, + | protos.google.cloud.compute.v1.IGetPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified PacketMirroring resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.packetMirroring + * Name of the PacketMirroring resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [PacketMirroring]{@link google.cloud.compute.v1.PacketMirroring}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetPacketMirroringRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPacketMirroring, + | protos.google.cloud.compute.v1.IGetPacketMirroringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPacketMirroring, + | protos.google.cloud.compute.v1.IGetPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPacketMirroring, + protos.google.cloud.compute.v1.IGetPacketMirroringRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertPacketMirroringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertPacketMirroringRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertPacketMirroringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertPacketMirroringRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a PacketMirroring resource in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.PacketMirroring} request.packetMirroringResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertPacketMirroringRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPacketMirroringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertPacketMirroringRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchPacketMirroringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchPacketMirroringRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchPacketMirroringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchPacketMirroringRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified PacketMirroring resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.packetMirroring + * Name of the PacketMirroring resource to patch. + * @param {google.cloud.compute.v1.PacketMirroring} request.packetMirroringResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchPacketMirroringRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPacketMirroringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchPacketMirroringRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsPacketMirroringRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [PacketMirroringsScopedList]{@link google.cloud.compute.v1.PacketMirroringsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListPacketMirroringsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IPacketMirroringsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IPacketMirroringsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPacketMirroring[], + protos.google.cloud.compute.v1.IListPacketMirroringsRequest | null, + protos.google.cloud.compute.v1.IPacketMirroringList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + protos.google.cloud.compute.v1.IPacketMirroringList | null | undefined, + protos.google.cloud.compute.v1.IPacketMirroring + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + protos.google.cloud.compute.v1.IPacketMirroringList | null | undefined, + protos.google.cloud.compute.v1.IPacketMirroring + > + ): void; + /** + * Retrieves a list of PacketMirroring resources available to the specified project and region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [PacketMirroring]{@link google.cloud.compute.v1.PacketMirroring}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + | protos.google.cloud.compute.v1.IPacketMirroringList + | null + | undefined, + protos.google.cloud.compute.v1.IPacketMirroring + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + protos.google.cloud.compute.v1.IPacketMirroringList | null | undefined, + protos.google.cloud.compute.v1.IPacketMirroring + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPacketMirroring[], + protos.google.cloud.compute.v1.IListPacketMirroringsRequest | null, + protos.google.cloud.compute.v1.IPacketMirroringList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [PacketMirroring]{@link google.cloud.compute.v1.PacketMirroring} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [PacketMirroring]{@link google.cloud.compute.v1.PacketMirroring}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListPacketMirroringsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.packetMirroringsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/packet_mirrorings_client_config.json b/src/v1/packet_mirrorings_client_config.json new file mode 100644 index 00000000..27835529 --- /dev/null +++ b/src/v1/packet_mirrorings_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.PacketMirrorings": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/packet_mirrorings_proto_list.json b/src/v1/packet_mirrorings_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/packet_mirrorings_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/projects_client.ts b/src/v1/projects_client.ts new file mode 100644 index 00000000..1475e3aa --- /dev/null +++ b/src/v1/projects_client.ts @@ -0,0 +1,1909 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/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; + +/** + * The Projects API. + * @class + * @memberof v1 + */ +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}; + 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/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 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 ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + getXpnResources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'resources' + ), + listXpnHosts: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.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 = gax.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.compute.v1.Projects. + this.projectsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Projects' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.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 = [ + 'disableXpnHost', + 'disableXpnResource', + 'enableXpnHost', + 'enableXpnResource', + 'get', + 'getXpnHost', + 'getXpnResources', + 'listXpnHosts', + 'moveDisk', + 'moveInstance', + 'setCommonInstanceMetadata', + 'setDefaultNetworkTier', + 'setUsageExportBucket', + ]; + 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] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + 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 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + disableXpnHost( + request?: protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | undefined, + {} | undefined + ] + >; + disableXpnHost( + request: protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + disableXpnHost( + request: protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Disable this project as a shared VPC host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.disableXpnHost(request); + */ + disableXpnHost( + request?: protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDisableXpnHostProjectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.disableXpnHost(request, options, callback); + } + disableXpnResource( + request?: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest + | undefined + ), + {} | undefined + ] + >; + disableXpnResource( + request: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + disableXpnResource( + request: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Disable a service resource (also known as service project) associated with this host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.ProjectsDisableXpnResourceRequest} request.projectsDisableXpnResourceRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.disableXpnResource(request); + */ + disableXpnResource( + request?: protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDisableXpnResourceProjectRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.disableXpnResource(request, options, callback); + } + enableXpnHost( + request?: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | undefined, + {} | undefined + ] + >; + enableXpnHost( + request: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enableXpnHost( + request: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Enable this project as a shared VPC host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.enableXpnHost(request); + */ + enableXpnHost( + request?: protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IEnableXpnHostProjectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.enableXpnHost(request, options, callback); + } + enableXpnResource( + request?: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest + | undefined + ), + {} | undefined + ] + >; + enableXpnResource( + request: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + enableXpnResource( + request: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.ProjectsEnableXpnResourceRequest} request.projectsEnableXpnResourceRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.enableXpnResource(request); + */ + enableXpnResource( + request?: protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IEnableXpnResourceProjectRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.enableXpnResource(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.IGetProjectRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.IGetProjectRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.IGetProjectRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified Project resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for 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 [Project]{@link google.cloud.compute.v1.Project}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.IGetProjectRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.IGetProjectRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getXpnHost( + request?: protos.google.cloud.compute.v1.IGetXpnHostProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.IGetXpnHostProjectRequest | undefined, + {} | undefined + ] + >; + getXpnHost( + request: protos.google.cloud.compute.v1.IGetXpnHostProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IProject, + | protos.google.cloud.compute.v1.IGetXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getXpnHost( + request: protos.google.cloud.compute.v1.IGetXpnHostProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IProject, + | protos.google.cloud.compute.v1.IGetXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the shared VPC host project that this project links to. May be empty if no link exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for 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 [Project]{@link google.cloud.compute.v1.Project}. + * 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.getXpnHost(request); + */ + getXpnHost( + request?: protos.google.cloud.compute.v1.IGetXpnHostProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IProject, + | protos.google.cloud.compute.v1.IGetXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IProject, + | protos.google.cloud.compute.v1.IGetXpnHostProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IProject, + protos.google.cloud.compute.v1.IGetXpnHostProjectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getXpnHost(request, options, callback); + } + moveDisk( + request?: protos.google.cloud.compute.v1.IMoveDiskProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveDiskProjectRequest | undefined, + {} | undefined + ] + >; + moveDisk( + request: protos.google.cloud.compute.v1.IMoveDiskProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveDiskProjectRequest | null | undefined, + {} | null | undefined + > + ): void; + moveDisk( + request: protos.google.cloud.compute.v1.IMoveDiskProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveDiskProjectRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Moves a persistent disk from one zone to another. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.DiskMoveRequest} request.diskMoveRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.moveDisk(request); + */ + moveDisk( + request?: protos.google.cloud.compute.v1.IMoveDiskProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveDiskProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveDiskProjectRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveDiskProjectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.moveDisk(request, options, callback); + } + moveInstance( + request?: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | undefined, + {} | undefined + ] + >; + moveInstance( + request: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveInstanceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + moveInstance( + request: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveInstanceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Moves an instance and its attached persistent disks from one zone to another. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.InstanceMoveRequest} request.instanceMoveRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.moveInstance(request); + */ + moveInstance( + request?: protos.google.cloud.compute.v1.IMoveInstanceProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveInstanceProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IMoveInstanceProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IMoveInstanceProjectRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.moveInstance(request, options, callback); + } + setCommonInstanceMetadata( + request?: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest + | undefined + ), + {} | undefined + ] + >; + setCommonInstanceMetadata( + request: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setCommonInstanceMetadata( + request: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets metadata common to all instances within the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Metadata} request.metadataResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setCommonInstanceMetadata(request); + */ + setCommonInstanceMetadata( + request?: protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetCommonInstanceMetadataProjectRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setCommonInstanceMetadata( + request, + options, + callback + ); + } + setDefaultNetworkTier( + request?: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest + | undefined + ), + {} | undefined + ] + >; + setDefaultNetworkTier( + request: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setDefaultNetworkTier( + request: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.ProjectsSetDefaultNetworkTierRequest} request.projectsSetDefaultNetworkTierRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setDefaultNetworkTier(request); + */ + setDefaultNetworkTier( + request?: protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetDefaultNetworkTierProjectRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setDefaultNetworkTier(request, options, callback); + } + setUsageExportBucket( + request?: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest + | undefined + ), + {} | undefined + ] + >; + setUsageExportBucket( + request: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setUsageExportBucket( + request: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.UsageExportLocation} request.usageExportLocationResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setUsageExportBucket(request); + */ + setUsageExportBucket( + request?: protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUsageExportBucketProjectRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setUsageExportBucket(request, options, callback); + } + + getXpnResources( + request?: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IXpnResourceId[], + protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest | null, + protos.google.cloud.compute.v1.IProjectsGetXpnResources + ] + >; + getXpnResources( + request: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + | protos.google.cloud.compute.v1.IProjectsGetXpnResources + | null + | undefined, + protos.google.cloud.compute.v1.IXpnResourceId + > + ): void; + getXpnResources( + request: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + | protos.google.cloud.compute.v1.IProjectsGetXpnResources + | null + | undefined, + protos.google.cloud.compute.v1.IXpnResourceId + > + ): void; + /** + * Gets service resources (a.k.a service project) associated with this host project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [XpnResourceId]{@link google.cloud.compute.v1.XpnResourceId}. + * 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 `getXpnResourcesAsync()` + * 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. + */ + getXpnResources( + request?: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + | protos.google.cloud.compute.v1.IProjectsGetXpnResources + | null + | undefined, + protos.google.cloud.compute.v1.IXpnResourceId + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + | protos.google.cloud.compute.v1.IProjectsGetXpnResources + | null + | undefined, + protos.google.cloud.compute.v1.IXpnResourceId + > + ): Promise< + [ + protos.google.cloud.compute.v1.IXpnResourceId[], + protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest | null, + protos.google.cloud.compute.v1.IProjectsGetXpnResources + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getXpnResources(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [XpnResourceId]{@link google.cloud.compute.v1.XpnResourceId} 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 `getXpnResourcesAsync()` + * 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. + */ + getXpnResourcesStream( + request?: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.getXpnResources.createStream( + this.innerApiCalls.getXpnResources as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `getXpnResources`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [XpnResourceId]{@link google.cloud.compute.v1.XpnResourceId}. 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.getXpnResourcesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + getXpnResourcesAsync( + request?: protos.google.cloud.compute.v1.IGetXpnResourcesProjectsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.getXpnResources.asyncIterate( + this.innerApiCalls['getXpnResources'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listXpnHosts( + request?: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IProject[], + protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest | null, + protos.google.cloud.compute.v1.IXpnHostList + ] + >; + listXpnHosts( + request: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + protos.google.cloud.compute.v1.IXpnHostList | null | undefined, + protos.google.cloud.compute.v1.IProject + > + ): void; + listXpnHosts( + request: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + protos.google.cloud.compute.v1.IXpnHostList | null | undefined, + protos.google.cloud.compute.v1.IProject + > + ): void; + /** + * Lists all shared VPC host projects visible to the user in an organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.ProjectsListXpnHostsRequest} request.projectsListXpnHostsRequestResource + * The body resource for this request + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Project]{@link google.cloud.compute.v1.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 `listXpnHostsAsync()` + * 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. + */ + listXpnHosts( + request?: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + protos.google.cloud.compute.v1.IXpnHostList | null | undefined, + protos.google.cloud.compute.v1.IProject + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + protos.google.cloud.compute.v1.IXpnHostList | null | undefined, + protos.google.cloud.compute.v1.IProject + > + ): Promise< + [ + protos.google.cloud.compute.v1.IProject[], + protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest | null, + protos.google.cloud.compute.v1.IXpnHostList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listXpnHosts(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.ProjectsListXpnHostsRequest} request.projectsListXpnHostsRequestResource + * The body resource for this request + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Project]{@link google.cloud.compute.v1.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 `listXpnHostsAsync()` + * 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. + */ + listXpnHostsStream( + request?: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listXpnHosts.createStream( + this.innerApiCalls.listXpnHosts as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listXpnHosts`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.ProjectsListXpnHostsRequest} request.projectsListXpnHostsRequestResource + * The body resource for this request + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Project]{@link google.cloud.compute.v1.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 + * const iterable = client.listXpnHostsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listXpnHostsAsync( + request?: protos.google.cloud.compute.v1.IListXpnHostsProjectsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listXpnHosts.asyncIterate( + this.innerApiCalls['listXpnHosts'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.projectsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/projects_client_config.json b/src/v1/projects_client_config.json new file mode 100644 index 00000000..9863abe9 --- /dev/null +++ b/src/v1/projects_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Projects": { + "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": { + "DisableXpnHost": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DisableXpnResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EnableXpnHost": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EnableXpnResource": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetXpnHost": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetXpnResources": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListXpnHosts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveDisk": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "MoveInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetCommonInstanceMetadata": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetDefaultNetworkTier": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetUsageExportBucket": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/projects_proto_list.json b/src/v1/projects_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/projects_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/public_advertised_prefixes_client.ts b/src/v1/public_advertised_prefixes_client.ts new file mode 100644 index 00000000..bc25fee1 --- /dev/null +++ b/src/v1/public_advertised_prefixes_client.ts @@ -0,0 +1,988 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/public_advertised_prefixes_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './public_advertised_prefixes_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The PublicAdvertisedPrefixes API. + * @class + * @memberof v1 + */ +export class PublicAdvertisedPrefixesClient { + 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}; + publicAdvertisedPrefixesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PublicAdvertisedPrefixesClient. + * + * @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 PublicAdvertisedPrefixesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.PublicAdvertisedPrefixes', + 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 = gax.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.publicAdvertisedPrefixesStub) { + return this.publicAdvertisedPrefixesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.PublicAdvertisedPrefixes. + this.publicAdvertisedPrefixesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.PublicAdvertisedPrefixes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .PublicAdvertisedPrefixes, + 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 publicAdvertisedPrefixesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + ]; + for (const methodName of publicAdvertisedPrefixesStubMethods) { + const callPromise = this.publicAdvertisedPrefixesStub.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.publicAdvertisedPrefixesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified PublicAdvertisedPrefix + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicAdvertisedPrefix + * Name of the PublicAdvertisedPrefix resource to delete. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix, + ( + | protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix, + | protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix, + | protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified PublicAdvertisedPrefix resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicAdvertisedPrefix + * Name of the PublicAdvertisedPrefix resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [PublicAdvertisedPrefix]{@link google.cloud.compute.v1.PublicAdvertisedPrefix}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix, + | protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix, + | protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix, + ( + | protos.google.cloud.compute.v1.IGetPublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.PublicAdvertisedPrefix} request.publicAdvertisedPrefixResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertPublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicAdvertisedPrefix + * Name of the PublicAdvertisedPrefix resource to patch. + * @param {google.cloud.compute.v1.PublicAdvertisedPrefix} request.publicAdvertisedPrefixResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPublicAdvertisedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix[], + protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest | null, + protos.google.cloud.compute.v1.IPublicAdvertisedPrefixList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicAdvertisedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicAdvertisedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix + > + ): void; + /** + * Lists the PublicAdvertisedPrefixes for a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [PublicAdvertisedPrefix]{@link google.cloud.compute.v1.PublicAdvertisedPrefix}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicAdvertisedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicAdvertisedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicAdvertisedPrefix[], + protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest | null, + protos.google.cloud.compute.v1.IPublicAdvertisedPrefixList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [PublicAdvertisedPrefix]{@link google.cloud.compute.v1.PublicAdvertisedPrefix} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [PublicAdvertisedPrefix]{@link google.cloud.compute.v1.PublicAdvertisedPrefix}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListPublicAdvertisedPrefixesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.publicAdvertisedPrefixesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/public_advertised_prefixes_client_config.json b/src/v1/public_advertised_prefixes_client_config.json new file mode 100644 index 00000000..e33e314e --- /dev/null +++ b/src/v1/public_advertised_prefixes_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.PublicAdvertisedPrefixes": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/public_advertised_prefixes_proto_list.json b/src/v1/public_advertised_prefixes_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/public_advertised_prefixes_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/public_delegated_prefixes_client.ts b/src/v1/public_delegated_prefixes_client.ts new file mode 100644 index 00000000..17f05851 --- /dev/null +++ b/src/v1/public_delegated_prefixes_client.ts @@ -0,0 +1,1081 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/public_delegated_prefixes_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './public_delegated_prefixes_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The PublicDelegatedPrefixes API. + * @class + * @memberof v1 + */ +export class PublicDelegatedPrefixesClient { + 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}; + publicDelegatedPrefixesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PublicDelegatedPrefixesClient. + * + * @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 PublicDelegatedPrefixesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.PublicDelegatedPrefixes', + 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 = gax.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.publicDelegatedPrefixesStub) { + return this.publicDelegatedPrefixesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.PublicDelegatedPrefixes. + this.publicDelegatedPrefixesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.PublicDelegatedPrefixes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.PublicDelegatedPrefixes, + 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 publicDelegatedPrefixesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + ]; + for (const methodName of publicDelegatedPrefixesStubMethods) { + const callPromise = this.publicDelegatedPrefixesStub.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.publicDelegatedPrefixesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified PublicDelegatedPrefix in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicDelegatedPrefix + * Name of the PublicDelegatedPrefix resource to delete. + * @param {string} request.region + * Name of the region of this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + ( + | protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified PublicDelegatedPrefix resource in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicDelegatedPrefix + * Name of the PublicDelegatedPrefix resource to return. + * @param {string} request.region + * Name of the region of 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 [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + | protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix, + ( + | protos.google.cloud.compute.v1.IGetPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {google.cloud.compute.v1.PublicDelegatedPrefix} request.publicDelegatedPrefixResource + * The body resource for this request + * @param {string} request.region + * Name of the region of this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified PublicDelegatedPrefix resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.publicDelegatedPrefix + * Name of the PublicDelegatedPrefix resource to patch. + * @param {google.cloud.compute.v1.PublicDelegatedPrefix} request.publicDelegatedPrefixResource + * The body resource for this request + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPublicDelegatedPrefixeRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Name of the project scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [PublicDelegatedPrefixesScopedList]{@link google.cloud.compute.v1.PublicDelegatedPrefixesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListPublicDelegatedPrefixesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [ + string, + protos.google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList + ] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix[], + protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest | null, + protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + > + ): void; + /** + * Lists the PublicDelegatedPrefixes for a project in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region of this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + | protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + | null + | undefined, + protos.google.cloud.compute.v1.IPublicDelegatedPrefix + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPublicDelegatedPrefix[], + protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest | null, + protos.google.cloud.compute.v1.IPublicDelegatedPrefixList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region of this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region of this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [PublicDelegatedPrefix]{@link google.cloud.compute.v1.PublicDelegatedPrefix}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListPublicDelegatedPrefixesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.publicDelegatedPrefixesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/public_delegated_prefixes_client_config.json b/src/v1/public_delegated_prefixes_client_config.json new file mode 100644 index 00000000..4c6f77db --- /dev/null +++ b/src/v1/public_delegated_prefixes_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.PublicDelegatedPrefixes": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/public_delegated_prefixes_proto_list.json b/src/v1/public_delegated_prefixes_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/public_delegated_prefixes_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_autoscalers_client.ts b/src/v1/region_autoscalers_client.ts new file mode 100644 index 00000000..5458b2c7 --- /dev/null +++ b/src/v1/region_autoscalers_client.ts @@ -0,0 +1,1074 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_autoscalers_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_autoscalers_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionAutoscalers API. + * @class + * @memberof v1 + */ +export class RegionAutoscalersClient { + 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}; + regionAutoscalersStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionAutoscalersClient. + * + * @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 RegionAutoscalersClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionAutoscalers', + 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 = gax.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.regionAutoscalersStub) { + return this.regionAutoscalersStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionAutoscalers. + this.regionAutoscalersStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionAutoscalers' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionAutoscalers, + 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 regionAutoscalersStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'update', + ]; + for (const methodName of regionAutoscalersStubMethods) { + const callPromise = this.regionAutoscalersStub.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.regionAutoscalersStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified autoscaler. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRegionAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler, + protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IAutoscaler, + | protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IAutoscaler, + | protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified autoscaler. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [Autoscaler]{@link google.cloud.compute.v1.Autoscaler}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IAutoscaler, + | protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IAutoscaler, + | protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler, + protos.google.cloud.compute.v1.IGetRegionAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an autoscaler in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Autoscaler} request.autoscalerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an autoscaler in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to patch. + * @param {google.cloud.compute.v1.Autoscaler} request.autoscalerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRegionAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates an autoscaler in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.autoscaler + * Name of the autoscaler to update. + * @param {google.cloud.compute.v1.Autoscaler} request.autoscalerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRegionAutoscalerRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler[], + protos.google.cloud.compute.v1.IListRegionAutoscalersRequest | null, + protos.google.cloud.compute.v1.IRegionAutoscalerList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + protos.google.cloud.compute.v1.IRegionAutoscalerList | null | undefined, + protos.google.cloud.compute.v1.IAutoscaler + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + protos.google.cloud.compute.v1.IRegionAutoscalerList | null | undefined, + protos.google.cloud.compute.v1.IAutoscaler + > + ): void; + /** + * Retrieves a list of autoscalers contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Autoscaler]{@link google.cloud.compute.v1.Autoscaler}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + | protos.google.cloud.compute.v1.IRegionAutoscalerList + | null + | undefined, + protos.google.cloud.compute.v1.IAutoscaler + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + protos.google.cloud.compute.v1.IRegionAutoscalerList | null | undefined, + protos.google.cloud.compute.v1.IAutoscaler + > + ): Promise< + [ + protos.google.cloud.compute.v1.IAutoscaler[], + protos.google.cloud.compute.v1.IListRegionAutoscalersRequest | null, + protos.google.cloud.compute.v1.IRegionAutoscalerList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Autoscaler]{@link google.cloud.compute.v1.Autoscaler} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Autoscaler]{@link google.cloud.compute.v1.Autoscaler}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionAutoscalersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionAutoscalersStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_autoscalers_client_config.json b/src/v1/region_autoscalers_client_config.json new file mode 100644 index 00000000..3497c12d --- /dev/null +++ b/src/v1/region_autoscalers_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionAutoscalers": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_autoscalers_proto_list.json b/src/v1/region_autoscalers_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_autoscalers_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_backend_services_client.ts b/src/v1/region_backend_services_client.ts new file mode 100644 index 00000000..26940d29 --- /dev/null +++ b/src/v1/region_backend_services_client.ts @@ -0,0 +1,1206 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_backend_services_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_backend_services_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionBackendServices API. + * @class + * @memberof v1 + */ +export class RegionBackendServicesClient { + 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}; + regionBackendServicesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionBackendServicesClient. + * + * @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 RegionBackendServicesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionBackendServices', + 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 = gax.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.regionBackendServicesStub) { + return this.regionBackendServicesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionBackendServices. + this.regionBackendServicesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionBackendServices' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionBackendServices, + 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 regionBackendServicesStubMethods = [ + 'delete', + 'get', + 'getHealth', + 'insert', + 'list', + 'patch', + 'update', + ]; + for (const methodName of regionBackendServicesStubMethods) { + const callPromise = this.regionBackendServicesStub.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.regionBackendServicesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified regional BackendService resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService, + ( + | protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified regional BackendService resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [BackendService]{@link google.cloud.compute.v1.BackendService}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IBackendService, + | protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService, + ( + | protos.google.cloud.compute.v1.IGetRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getHealth( + request?: protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + ( + | protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + getHealth( + request: protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getHealth( + request: protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the most recent health check results for this regional BackendService. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource for which to get health. + * @param {string} request.project + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.ResourceGroupReference} request.resourceGroupReferenceResource + * The body resource for 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 [BackendServiceGroupHealth]{@link google.cloud.compute.v1.BackendServiceGroupHealth}. + * 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.getHealth(request); + */ + getHealth( + request?: protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + | protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendServiceGroupHealth, + ( + | protos.google.cloud.compute.v1.IGetHealthRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getHealth(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.BackendService} request.backendServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to patch. + * @param {google.cloud.compute.v1.BackendService} request.backendServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.backendService + * Name of the BackendService resource to update. + * @param {google.cloud.compute.v1.BackendService} request.backendServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateRegionBackendServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService[], + protos.google.cloud.compute.v1.IListRegionBackendServicesRequest | null, + protos.google.cloud.compute.v1.IBackendServiceList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + > + ): void; + /** + * Retrieves the list of regional BackendService resources available to the specified project in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [BackendService]{@link google.cloud.compute.v1.BackendService}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + protos.google.cloud.compute.v1.IBackendServiceList | null | undefined, + protos.google.cloud.compute.v1.IBackendService + > + ): Promise< + [ + protos.google.cloud.compute.v1.IBackendService[], + protos.google.cloud.compute.v1.IListRegionBackendServicesRequest | null, + protos.google.cloud.compute.v1.IBackendServiceList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [BackendService]{@link google.cloud.compute.v1.BackendService} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [BackendService]{@link google.cloud.compute.v1.BackendService}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionBackendServicesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionBackendServicesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_backend_services_client_config.json b/src/v1/region_backend_services_client_config.json new file mode 100644 index 00000000..eddba3d1 --- /dev/null +++ b/src/v1/region_backend_services_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionBackendServices": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHealth": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_backend_services_proto_list.json b/src/v1/region_backend_services_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_backend_services_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_commitments_client.ts b/src/v1/region_commitments_client.ts new file mode 100644 index 00000000..422f959d --- /dev/null +++ b/src/v1/region_commitments_client.ts @@ -0,0 +1,839 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_commitments_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_commitments_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionCommitments API. + * @class + * @memberof v1 + */ +export class RegionCommitmentsClient { + 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}; + regionCommitmentsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionCommitmentsClient. + * + * @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 RegionCommitmentsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionCommitments', + 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 = gax.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.regionCommitmentsStub) { + return this.regionCommitmentsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionCommitments. + this.regionCommitmentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionCommitments' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionCommitments, + 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 regionCommitmentsStubMethods = [ + 'aggregatedList', + 'get', + 'insert', + 'list', + ]; + for (const methodName of regionCommitmentsStubMethods) { + const callPromise = this.regionCommitmentsStub.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.regionCommitmentsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetRegionCommitmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ICommitment, + protos.google.cloud.compute.v1.IGetRegionCommitmentRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionCommitmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ICommitment, + | protos.google.cloud.compute.v1.IGetRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionCommitmentRequest, + callback: Callback< + protos.google.cloud.compute.v1.ICommitment, + | protos.google.cloud.compute.v1.IGetRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified commitment resource. Gets a list of available commitments by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.commitment + * Name of the commitment to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [Commitment]{@link google.cloud.compute.v1.Commitment}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionCommitmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ICommitment, + | protos.google.cloud.compute.v1.IGetRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ICommitment, + | protos.google.cloud.compute.v1.IGetRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ICommitment, + protos.google.cloud.compute.v1.IGetRegionCommitmentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a commitment in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Commitment} request.commitmentResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionCommitmentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [CommitmentsScopedList]{@link google.cloud.compute.v1.CommitmentsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListRegionCommitmentsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ICommitmentsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ICommitmentsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ICommitment[], + protos.google.cloud.compute.v1.IListRegionCommitmentsRequest | null, + protos.google.cloud.compute.v1.ICommitmentList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + protos.google.cloud.compute.v1.ICommitmentList | null | undefined, + protos.google.cloud.compute.v1.ICommitment + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + protos.google.cloud.compute.v1.ICommitmentList | null | undefined, + protos.google.cloud.compute.v1.ICommitment + > + ): void; + /** + * Retrieves a list of commitments contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Commitment]{@link google.cloud.compute.v1.Commitment}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + protos.google.cloud.compute.v1.ICommitmentList | null | undefined, + protos.google.cloud.compute.v1.ICommitment + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + protos.google.cloud.compute.v1.ICommitmentList | null | undefined, + protos.google.cloud.compute.v1.ICommitment + > + ): Promise< + [ + protos.google.cloud.compute.v1.ICommitment[], + protos.google.cloud.compute.v1.IListRegionCommitmentsRequest | null, + protos.google.cloud.compute.v1.ICommitmentList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Commitment]{@link google.cloud.compute.v1.Commitment} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Commitment]{@link google.cloud.compute.v1.Commitment}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionCommitmentsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionCommitmentsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_commitments_client_config.json b/src/v1/region_commitments_client_config.json new file mode 100644 index 00000000..02e9f7fd --- /dev/null +++ b/src/v1/region_commitments_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionCommitments": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_commitments_proto_list.json b/src/v1/region_commitments_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_commitments_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_disk_types_client.ts b/src/v1/region_disk_types_client.ts new file mode 100644 index 00000000..03753d40 --- /dev/null +++ b/src/v1/region_disk_types_client.ts @@ -0,0 +1,658 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_disk_types_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_disk_types_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionDiskTypes API. + * @class + * @memberof v1 + */ +export class RegionDiskTypesClient { + 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}; + regionDiskTypesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionDiskTypesClient. + * + * @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 RegionDiskTypesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionDiskTypes', + 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 = gax.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.regionDiskTypesStub) { + return this.regionDiskTypesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionDiskTypes. + this.regionDiskTypesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionDiskTypes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionDiskTypes, + 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 regionDiskTypesStubMethods = ['get', 'list']; + for (const methodName of regionDiskTypesStubMethods) { + const callPromise = this.regionDiskTypesStub.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.regionDiskTypesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDiskType, + | protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDiskType, + | protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified regional disk type. Gets a list of available disk types by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.diskType + * Name of the disk type to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for 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 [DiskType]{@link google.cloud.compute.v1.DiskType}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDiskType, + | protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDiskType, + | protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType, + protos.google.cloud.compute.v1.IGetRegionDiskTypeRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType[], + protos.google.cloud.compute.v1.IListRegionDiskTypesRequest | null, + protos.google.cloud.compute.v1.IRegionDiskTypeList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + protos.google.cloud.compute.v1.IRegionDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + protos.google.cloud.compute.v1.IRegionDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + > + ): void; + /** + * Retrieves a list of regional disk types available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [DiskType]{@link google.cloud.compute.v1.DiskType}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + protos.google.cloud.compute.v1.IRegionDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + protos.google.cloud.compute.v1.IRegionDiskTypeList | null | undefined, + protos.google.cloud.compute.v1.IDiskType + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDiskType[], + protos.google.cloud.compute.v1.IListRegionDiskTypesRequest | null, + protos.google.cloud.compute.v1.IRegionDiskTypeList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [DiskType]{@link google.cloud.compute.v1.DiskType} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [DiskType]{@link google.cloud.compute.v1.DiskType}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionDiskTypesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionDiskTypesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_disk_types_client_config.json b/src/v1/region_disk_types_client_config.json new file mode 100644 index 00000000..cd33b260 --- /dev/null +++ b/src/v1/region_disk_types_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionDiskTypes": { + "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": { + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_disk_types_proto_list.json b/src/v1/region_disk_types_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_disk_types_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_disks_client.ts b/src/v1/region_disks_client.ts new file mode 100644 index 00000000..788414e9 --- /dev/null +++ b/src/v1/region_disks_client.ts @@ -0,0 +1,1702 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_disks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_disks_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionDisks API. + * @class + * @memberof v1 + */ +export class RegionDisksClient { + 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}; + regionDisksStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionDisksClient. + * + * @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 RegionDisksClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionDisks', + 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 = gax.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.regionDisksStub) { + return this.regionDisksStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionDisks. + this.regionDisksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionDisks' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionDisks, + 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 regionDisksStubMethods = [ + 'addResourcePolicies', + 'createSnapshot', + 'delete', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'removeResourcePolicies', + 'resize', + 'setIamPolicy', + 'setLabels', + 'testIamPermissions', + ]; + for (const methodName of regionDisksStubMethods) { + const callPromise = this.regionDisksStub.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.regionDisksStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addResourcePolicies( + request?: protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest + | undefined + ), + {} | undefined + ] + >; + addResourcePolicies( + request: protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addResourcePolicies( + request: protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds existing resource policies to a regional disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * The disk name for this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {google.cloud.compute.v1.RegionDisksAddResourcePoliciesRequest} request.regionDisksAddResourcePoliciesRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addResourcePolicies(request); + */ + addResourcePolicies( + request?: protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddResourcePoliciesRegionDiskRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addResourcePolicies(request, options, callback); + } + createSnapshot( + request?: protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest + | undefined + ), + {} | undefined + ] + >; + createSnapshot( + request: protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSnapshot( + request: protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a snapshot of this regional disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * Name of the regional persistent disk to snapshot. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Snapshot} request.snapshotResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.createSnapshot(request); + */ + createSnapshot( + request?: protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICreateSnapshotRegionDiskRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.createSnapshot(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRegionDiskRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified regional persistent disk. Deleting a regional disk removes all the replicas of its data permanently and is irreversible. However, deleting a disk does not delete any snapshots previously made from the disk. You must separately delete snapshots. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * Name of the regional persistent disk to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRegionDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetRegionDiskRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetRegionDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetRegionDiskRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns a specified regional persistent disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * Name of the regional persistent disk to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [Disk]{@link google.cloud.compute.v1.Disk}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDisk, + | protos.google.cloud.compute.v1.IGetRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetRegionDiskRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk, + protos.google.cloud.compute.v1.IGetRegionDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicyRegionDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionDiskRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a persistent regional disk in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.Disk} request.diskResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sourceImage + * Source image to restore onto a disk. This field is optional. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + removeResourcePolicies( + request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest + | undefined + ), + {} | undefined + ] + >; + removeResourcePolicies( + request: protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeResourcePolicies( + request: protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes resource policies from a regional disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * The disk name for this request. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {google.cloud.compute.v1.RegionDisksRemoveResourcePoliciesRequest} request.regionDisksRemoveResourcePoliciesRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeResourcePolicies(request); + */ + removeResourcePolicies( + request?: protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveResourcePoliciesRegionDiskRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removeResourcePolicies( + request, + options, + callback + ); + } + resize( + request?: protos.google.cloud.compute.v1.IResizeRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeRegionDiskRequest | undefined, + {} | undefined + ] + >; + resize( + request: protos.google.cloud.compute.v1.IResizeRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resize( + request: protos.google.cloud.compute.v1.IResizeRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Resizes the specified regional persistent disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.disk + * Name of the regional persistent disk. + * @param {string} request.project + * The project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {google.cloud.compute.v1.RegionDisksResizeRequest} request.regionDisksResizeRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.resize(request); + */ + resize( + request?: protos.google.cloud.compute.v1.IResizeRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeRegionDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.resize(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {google.cloud.compute.v1.RegionSetPolicyRequest} request.regionSetPolicyRequestResource + * The body resource for this request + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicyRegionDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest | undefined, + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on the target regional disk. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The region for this request. + * @param {google.cloud.compute.v1.RegionSetLabelsRequest} request.regionSetLabelsRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.resource + * Name or id of the resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsRegionDiskRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsRegionDiskRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionDisksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk[], + protos.google.cloud.compute.v1.IListRegionDisksRequest | null, + protos.google.cloud.compute.v1.IDiskList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionDisksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionDisksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + > + ): void; + /** + * Retrieves the list of persistent disks contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Disk]{@link google.cloud.compute.v1.Disk}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionDisksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionDisksRequest, + protos.google.cloud.compute.v1.IDiskList | null | undefined, + protos.google.cloud.compute.v1.IDisk + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDisk[], + protos.google.cloud.compute.v1.IListRegionDisksRequest | null, + protos.google.cloud.compute.v1.IDiskList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Disk]{@link google.cloud.compute.v1.Disk} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionDisksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Disk]{@link google.cloud.compute.v1.Disk}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionDisksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionDisksStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_disks_client_config.json b/src/v1/region_disks_client_config.json new file mode 100644 index 00000000..7f6519df --- /dev/null +++ b/src/v1/region_disks_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionDisks": { + "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": { + "AddResourcePolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveResourcePolicies": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Resize": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_disks_proto_list.json b/src/v1/region_disks_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_disks_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_health_check_services_client.ts b/src/v1/region_health_check_services_client.ts new file mode 100644 index 00000000..996e5949 --- /dev/null +++ b/src/v1/region_health_check_services_client.ts @@ -0,0 +1,1002 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_health_check_services_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_health_check_services_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionHealthCheckServices API. + * @class + * @memberof v1 + */ +export class RegionHealthCheckServicesClient { + 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}; + regionHealthCheckServicesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionHealthCheckServicesClient. + * + * @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 RegionHealthCheckServicesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionHealthCheckServices', + 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 = gax.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.regionHealthCheckServicesStub) { + return this.regionHealthCheckServicesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionHealthCheckServices. + this.regionHealthCheckServicesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionHealthCheckServices' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .RegionHealthCheckServices, + 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 regionHealthCheckServicesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + ]; + for (const methodName of regionHealthCheckServicesStubMethods) { + const callPromise = this.regionHealthCheckServicesStub.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.regionHealthCheckServicesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified regional HealthCheckService. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheckService + * Name of the HealthCheckService to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheckService, + ( + | protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IHealthCheckService, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IHealthCheckService, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified regional HealthCheckService resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheckService + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [HealthCheckService]{@link google.cloud.compute.v1.HealthCheckService}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IHealthCheckService, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IHealthCheckService, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheckService, + ( + | protos.google.cloud.compute.v1.IGetRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a regional HealthCheckService resource in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.HealthCheckService} request.healthCheckServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified regional HealthCheckService resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheckService + * Name of the HealthCheckService to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {google.cloud.compute.v1.HealthCheckService} request.healthCheckServiceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckServiceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheckService[], + protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest | null, + protos.google.cloud.compute.v1.IHealthCheckServicesList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + | protos.google.cloud.compute.v1.IHealthCheckServicesList + | null + | undefined, + protos.google.cloud.compute.v1.IHealthCheckService + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + | protos.google.cloud.compute.v1.IHealthCheckServicesList + | null + | undefined, + protos.google.cloud.compute.v1.IHealthCheckService + > + ): void; + /** + * Lists all the HealthCheckService resources that have been configured for the specified project in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [HealthCheckService]{@link google.cloud.compute.v1.HealthCheckService}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + | protos.google.cloud.compute.v1.IHealthCheckServicesList + | null + | undefined, + protos.google.cloud.compute.v1.IHealthCheckService + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + | protos.google.cloud.compute.v1.IHealthCheckServicesList + | null + | undefined, + protos.google.cloud.compute.v1.IHealthCheckService + > + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheckService[], + protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest | null, + protos.google.cloud.compute.v1.IHealthCheckServicesList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [HealthCheckService]{@link google.cloud.compute.v1.HealthCheckService} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [HealthCheckService]{@link google.cloud.compute.v1.HealthCheckService}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionHealthCheckServicesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionHealthCheckServicesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_health_check_services_client_config.json b/src/v1/region_health_check_services_client_config.json new file mode 100644 index 00000000..e421f312 --- /dev/null +++ b/src/v1/region_health_check_services_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionHealthCheckServices": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_health_check_services_proto_list.json b/src/v1/region_health_check_services_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_health_check_services_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_health_checks_client.ts b/src/v1/region_health_checks_client.ts new file mode 100644 index 00000000..2ad6193a --- /dev/null +++ b/src/v1/region_health_checks_client.ts @@ -0,0 +1,1090 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_health_checks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_health_checks_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionHealthChecks API. + * @class + * @memberof v1 + */ +export class RegionHealthChecksClient { + 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}; + regionHealthChecksStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionHealthChecksClient. + * + * @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 RegionHealthChecksClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionHealthChecks', + 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 = gax.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.regionHealthChecksStub) { + return this.regionHealthChecksStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionHealthChecks. + this.regionHealthChecksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionHealthChecks' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionHealthChecks, + 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 regionHealthChecksStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'update', + ]; + for (const methodName of regionHealthChecksStubMethods) { + const callPromise = this.regionHealthChecksStub.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.regionHealthChecksStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified HealthCheck resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionHealthCheckRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck, + protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IHealthCheck, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IHealthCheck, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [HealthCheck]{@link google.cloud.compute.v1.HealthCheck}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IHealthCheck, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IHealthCheck, + | protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck, + protos.google.cloud.compute.v1.IGetRegionHealthCheckRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a HealthCheck resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.HealthCheck} request.healthCheckResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionHealthCheckRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to patch. + * @param {google.cloud.compute.v1.HealthCheck} request.healthCheckResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRegionHealthCheckRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest + | undefined + ), + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a HealthCheck resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.healthCheck + * Name of the HealthCheck resource to update. + * @param {google.cloud.compute.v1.HealthCheck} request.healthCheckResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdateRegionHealthCheckRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck[], + protos.google.cloud.compute.v1.IListRegionHealthChecksRequest | null, + protos.google.cloud.compute.v1.IHealthCheckList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + > + ): void; + /** + * Retrieves the list of HealthCheck resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [HealthCheck]{@link google.cloud.compute.v1.HealthCheck}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + protos.google.cloud.compute.v1.IHealthCheckList | null | undefined, + protos.google.cloud.compute.v1.IHealthCheck + > + ): Promise< + [ + protos.google.cloud.compute.v1.IHealthCheck[], + protos.google.cloud.compute.v1.IListRegionHealthChecksRequest | null, + protos.google.cloud.compute.v1.IHealthCheckList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [HealthCheck]{@link google.cloud.compute.v1.HealthCheck} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [HealthCheck]{@link google.cloud.compute.v1.HealthCheck}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionHealthChecksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionHealthChecksStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_health_checks_client_config.json b/src/v1/region_health_checks_client_config.json new file mode 100644 index 00000000..4e97b15f --- /dev/null +++ b/src/v1/region_health_checks_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionHealthChecks": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_health_checks_proto_list.json b/src/v1/region_health_checks_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_health_checks_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_instance_group_managers_client.ts b/src/v1/region_instance_group_managers_client.ts new file mode 100644 index 00000000..cb7dc981 --- /dev/null +++ b/src/v1/region_instance_group_managers_client.ts @@ -0,0 +1,3009 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_instance_group_managers_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_instance_group_managers_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionInstanceGroupManagers API. + * @class + * @memberof v1 + */ +export class RegionInstanceGroupManagersClient { + 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}; + regionInstanceGroupManagersStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionInstanceGroupManagersClient. + * + * @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 RegionInstanceGroupManagersClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listErrors: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listManagedInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'managedInstances' + ), + listPerInstanceConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionInstanceGroupManagers', + 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 = gax.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.regionInstanceGroupManagersStub) { + return this.regionInstanceGroupManagersStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionInstanceGroupManagers. + this.regionInstanceGroupManagersStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionInstanceGroupManagers' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .RegionInstanceGroupManagers, + 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 regionInstanceGroupManagersStubMethods = [ + 'abandonInstances', + 'applyUpdatesToInstances', + 'createInstances', + 'delete', + 'deleteInstances', + 'deletePerInstanceConfigs', + 'get', + 'insert', + 'list', + 'listErrors', + 'listManagedInstances', + 'listPerInstanceConfigs', + 'patch', + 'patchPerInstanceConfigs', + 'recreateInstances', + 'resize', + 'setInstanceTemplate', + 'setTargetPools', + 'updatePerInstanceConfigs', + ]; + for (const methodName of regionInstanceGroupManagersStubMethods) { + const callPromise = this.regionInstanceGroupManagersStub.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.regionInstanceGroupManagersStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + abandonInstances( + request?: protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + abandonInstances( + request: protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + abandonInstances( + request: protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Flags the specified instances to be immediately removed from the managed instance group. Abandoning an instance does not delete the instance, but it does remove the instance from any target pools that are applied by the managed instance group. This method reduces the targetSize of the managed instance group by the number of instances that you abandon. This operation is marked as DONE when the action is scheduled even if the instances have not yet been removed from the group. You must separately verify the status of the abandoning action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * Name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersAbandonInstancesRequest} request.regionInstanceGroupManagersAbandonInstancesRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.abandonInstances(request); + */ + abandonInstances( + request?: protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAbandonInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.abandonInstances(request, options, callback); + } + applyUpdatesToInstances( + request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + applyUpdatesToInstances( + request: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + applyUpdatesToInstances( + request: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Apply updates to selected instances the managed instance group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group, should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request, should conform to RFC1035. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersApplyUpdatesRequest} request.regionInstanceGroupManagersApplyUpdatesRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.applyUpdatesToInstances(request); + */ + applyUpdatesToInstances( + request?: protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IApplyUpdatesToInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.applyUpdatesToInstances( + request, + options, + callback + ); + } + createInstances( + request?: protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + createInstances( + request: protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createInstances( + request: protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region where the managed instance group is located. It should conform to RFC1035. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersCreateInstancesRequest} request.regionInstanceGroupManagersCreateInstancesRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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. + * + * The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.createInstances(request); + */ + createInstances( + request?: protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ICreateInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.createInstances(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified managed instance group and all of the instances in that group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * Name of the managed instance group to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + deleteInstances( + request?: protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + deleteInstances( + request: protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteInstances( + request: protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * Name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersDeleteInstancesRequest} request.regionInstanceGroupManagersDeleteInstancesRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deleteInstances(request); + */ + deleteInstances( + request?: protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstances(request, options, callback); + } + deletePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + deletePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes selected per-instance configs for the managed instance group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request, should conform to RFC1035. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerDeleteInstanceConfigReq} request.regionInstanceGroupManagerDeleteInstanceConfigReqResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.deletePerInstanceConfigs(request); + */ + deletePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeletePerInstanceConfigsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.deletePerInstanceConfigs( + request, + options, + callback + ); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager, + ( + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns all of the details about the specified managed instance group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * Name of the managed instance group to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInstanceGroupManager, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager, + ( + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. + * + * A regional managed instance group can contain up to 2000 instances. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.InstanceGroupManager} request.instanceGroupManagerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the instance group manager. + * @param {google.cloud.compute.v1.InstanceGroupManager} request.instanceGroupManagerResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + patchPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + patchPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patchPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request, should conform to RFC1035. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerPatchInstanceConfigReq} request.regionInstanceGroupManagerPatchInstanceConfigReqResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patchPerInstanceConfigs(request); + */ + patchPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchPerInstanceConfigsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patchPerInstanceConfigs( + request, + options, + callback + ); + } + recreateInstances( + request?: protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + recreateInstances( + request: protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + recreateInstances( + request: protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Flags the specified VM instances in the managed instance group to be immediately recreated. Each instance is recreated using the group's current configuration. This operation is marked as DONE when the flag is set even if the instances have not yet been recreated. You must separately verify the status of each instance by checking its currentAction field; for more information, see Checking the status of managed instances. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * You can specify a maximum of 1000 instances with this method per request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * Name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersRecreateRequest} request.regionInstanceGroupManagersRecreateRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.recreateInstances(request); + */ + recreateInstances( + request?: protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRecreateInstancesRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.recreateInstances(request, options, callback); + } + resize( + request?: protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + resize( + request: protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resize( + request: protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the intended size of the managed instance group. If you increase the size, the group creates new instances using the current instance template. If you decrease the size, the group deletes one or more instances. + * + * The resize operation is marked DONE if the resize request is successful. The underlying actions take additional time. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method. + * + * If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is removed or deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * Name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {number} request.size + * Number of instances that should exist in this instance group manager. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.resize(request); + */ + resize( + request?: protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IResizeRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.resize(request, options, callback); + } + setInstanceTemplate( + request?: protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + setInstanceTemplate( + request: protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setInstanceTemplate( + request: protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersSetTemplateRequest} request.regionInstanceGroupManagersSetTemplateRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setInstanceTemplate(request); + */ + setInstanceTemplate( + request?: protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetInstanceTemplateRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setInstanceTemplate(request, options, callback); + } + setTargetPools( + request?: protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + setTargetPools( + request: protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setTargetPools( + request: protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * Name of the managed instance group. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagersSetTargetPoolsRequest} request.regionInstanceGroupManagersSetTargetPoolsRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setTargetPools(request); + */ + setTargetPools( + request?: protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetTargetPoolsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setTargetPools(request, options, callback); + } + updatePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + >; + updatePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePerInstanceConfigs( + request: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request, should conform to RFC1035. + * @param {google.cloud.compute.v1.RegionInstanceGroupManagerUpdateInstanceConfigReq} request.regionInstanceGroupManagerUpdateInstanceConfigReqResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.updatePerInstanceConfigs(request); + */ + updatePerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IUpdatePerInstanceConfigsRegionInstanceGroupManagerRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.updatePerInstanceConfigs( + request, + options, + callback + ); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager[], + protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagerList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + > + ): void; + /** + * Retrieves the list of managed instance groups that are contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagerList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroupManager + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroupManager[], + protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagerList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [InstanceGroupManager]{@link google.cloud.compute.v1.InstanceGroupManager}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listErrors( + request?: protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceManagedByIgmError[], + protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse + ] + >; + listErrors( + request: protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + > + ): void; + listErrors( + request: protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + > + ): void; + /** + * Lists all errors thrown by actions on instances for a given regional managed instance group. The filter and orderBy query parameters are not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:{@link 0-9|a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9}{0,19}. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. This should conform to RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [InstanceManagedByIgmError]{@link google.cloud.compute.v1.InstanceManagedByIgmError}. + * 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 `listErrorsAsync()` + * 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. + */ + listErrors( + request?: protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceManagedByIgmError + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceManagedByIgmError[], + protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListErrorsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listErrors(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:{@link 0-9|a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9}{0,19}. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. This should conform to RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [InstanceManagedByIgmError]{@link google.cloud.compute.v1.InstanceManagedByIgmError} 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 `listErrorsAsync()` + * 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. + */ + listErrorsStream( + request?: protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listErrors.createStream( + this.innerApiCalls.listErrors as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listErrors`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It must be a string that meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern: (?:{@link 0-9|a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|[1-9}{0,19}. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. This should conform to RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [InstanceManagedByIgmError]{@link google.cloud.compute.v1.InstanceManagedByIgmError}. 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.listErrorsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listErrorsAsync( + request?: protos.google.cloud.compute.v1.IListErrorsRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listErrors.asyncIterate( + this.innerApiCalls['listErrors'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listManagedInstances( + request?: protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IManagedInstance[], + protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse + ] + >; + listManagedInstances( + request: protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + > + ): void; + listManagedInstances( + request: protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + > + ): void; + /** + * Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [ManagedInstance]{@link google.cloud.compute.v1.ManagedInstance}. + * 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 `listManagedInstancesAsync()` + * 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. + */ + listManagedInstances( + request?: protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse + | null + | undefined, + protos.google.cloud.compute.v1.IManagedInstance + > + ): Promise< + [ + protos.google.cloud.compute.v1.IManagedInstance[], + protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstancesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listManagedInstances(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [ManagedInstance]{@link google.cloud.compute.v1.ManagedInstance} 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 `listManagedInstancesAsync()` + * 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. + */ + listManagedInstancesStream( + request?: protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listManagedInstances.createStream( + this.innerApiCalls.listManagedInstances as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listManagedInstances`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [ManagedInstance]{@link google.cloud.compute.v1.ManagedInstance}. 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.listManagedInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listManagedInstancesAsync( + request?: protos.google.cloud.compute.v1.IListManagedInstancesRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listManagedInstances.asyncIterate( + this.innerApiCalls['listManagedInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPerInstanceConfig[], + protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp + ] + >; + listPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + > + ): void; + listPerInstanceConfigs( + request: protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + > + ): void; + /** + * Lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request, should conform to RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [PerInstanceConfig]{@link google.cloud.compute.v1.PerInstanceConfig}. + * 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 `listPerInstanceConfigsAsync()` + * 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. + */ + listPerInstanceConfigs( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp + | null + | undefined, + protos.google.cloud.compute.v1.IPerInstanceConfig + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPerInstanceConfig[], + protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupManagersListInstanceConfigsResp + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listPerInstanceConfigs( + 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request, should conform to RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [PerInstanceConfig]{@link google.cloud.compute.v1.PerInstanceConfig} 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 `listPerInstanceConfigsAsync()` + * 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. + */ + listPerInstanceConfigsStream( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPerInstanceConfigs.createStream( + this.innerApiCalls.listPerInstanceConfigs as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPerInstanceConfigs`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroupManager + * The name of the managed instance group. It should conform to RFC1035. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request, should conform to RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [PerInstanceConfig]{@link google.cloud.compute.v1.PerInstanceConfig}. 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.listPerInstanceConfigsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listPerInstanceConfigsAsync( + request?: protos.google.cloud.compute.v1.IListPerInstanceConfigsRegionInstanceGroupManagersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listPerInstanceConfigs.asyncIterate( + this.innerApiCalls['listPerInstanceConfigs'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionInstanceGroupManagersStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_instance_group_managers_client_config.json b/src/v1/region_instance_group_managers_client_config.json new file mode 100644 index 00000000..20202b53 --- /dev/null +++ b/src/v1/region_instance_group_managers_client_config.json @@ -0,0 +1,102 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstanceGroupManagers": { + "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": { + "AbandonInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ApplyUpdatesToInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListErrors": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListManagedInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PatchPerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RecreateInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Resize": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetInstanceTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetTargetPools": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePerInstanceConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_instance_group_managers_proto_list.json b/src/v1/region_instance_group_managers_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_instance_group_managers_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_instance_groups_client.ts b/src/v1/region_instance_groups_client.ts new file mode 100644 index 00000000..fa40858e --- /dev/null +++ b/src/v1/region_instance_groups_client.ts @@ -0,0 +1,1041 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_instance_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_instance_groups_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionInstanceGroups API. + * @class + * @memberof v1 + */ +export class RegionInstanceGroupsClient { + 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}; + regionInstanceGroupsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionInstanceGroupsClient. + * + * @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 RegionInstanceGroupsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionInstanceGroups', + 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 = gax.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.regionInstanceGroupsStub) { + return this.regionInstanceGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionInstanceGroups. + this.regionInstanceGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionInstanceGroups' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionInstanceGroups, + 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 regionInstanceGroupsStubMethods = [ + 'get', + 'list', + 'listInstances', + 'setNamedPorts', + ]; + for (const methodName of regionInstanceGroupsStubMethods) { + const callPromise = this.regionInstanceGroupsStub.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.regionInstanceGroupsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup, + protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified instance group resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroup + * Name of the instance group resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IInstanceGroup, + | protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup, + protos.google.cloud.compute.v1.IGetRegionInstanceGroupRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + setNamedPorts( + request?: protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest + | undefined + ), + {} | undefined + ] + >; + setNamedPorts( + request: protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setNamedPorts( + request: protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the named ports for the specified regional instance group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.instanceGroup + * The name of the regional instance group where the named ports are updated. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupsSetNamedPortsRequest} request.regionInstanceGroupsSetNamedPortsRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setNamedPorts(request); + */ + setNamedPorts( + request?: protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetNamedPortsRegionInstanceGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setNamedPorts(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup[], + protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + > + ): void; + /** + * Retrieves the list of instance group resources contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupList + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceGroup + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceGroup[], + protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [InstanceGroup]{@link google.cloud.compute.v1.InstanceGroup}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listInstances( + request?: protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceWithNamedPorts[], + protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupsListInstances + ] + >; + listInstances( + request: protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + > + ): void; + listInstances( + request: protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + > + ): void; + /** + * Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroup + * Name of the regional instance group for which we want to list the instances. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} request.regionInstanceGroupsListInstancesRequestResource + * The body resource for this request + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [InstanceWithNamedPorts]{@link google.cloud.compute.v1.InstanceWithNamedPorts}. + * 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.compute.v1.IListInstancesRegionInstanceGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + | protos.google.cloud.compute.v1.IRegionInstanceGroupsListInstances + | null + | undefined, + protos.google.cloud.compute.v1.IInstanceWithNamedPorts + > + ): Promise< + [ + protos.google.cloud.compute.v1.IInstanceWithNamedPorts[], + protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest | null, + protos.google.cloud.compute.v1.IRegionInstanceGroupsListInstances + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroup + * Name of the regional instance group for which we want to list the instances. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} request.regionInstanceGroupsListInstancesRequestResource + * The body resource for this request + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [InstanceWithNamedPorts]{@link google.cloud.compute.v1.InstanceWithNamedPorts} 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.compute.v1.IListInstancesRegionInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as gax.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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {string} request.instanceGroup + * Name of the regional instance group for which we want to list the instances. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionInstanceGroupsListInstancesRequest} request.regionInstanceGroupsListInstancesRequestResource + * The body resource for this request + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [InstanceWithNamedPorts]{@link google.cloud.compute.v1.InstanceWithNamedPorts}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listInstancesAsync( + request?: protos.google.cloud.compute.v1.IListInstancesRegionInstanceGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionInstanceGroupsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_instance_groups_client_config.json b/src/v1/region_instance_groups_client_config.json new file mode 100644 index 00000000..41481773 --- /dev/null +++ b/src/v1/region_instance_groups_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstanceGroups": { + "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": { + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetNamedPorts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_instance_groups_proto_list.json b/src/v1/region_instance_groups_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_instance_groups_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_instances_client.ts b/src/v1/region_instances_client.ts new file mode 100644 index 00000000..6a7e3818 --- /dev/null +++ b/src/v1/region_instances_client.ts @@ -0,0 +1,411 @@ +// 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} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_instances_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_instances_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionInstances API. + * @class + * @memberof v1 + */ +export class RegionInstancesClient { + 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}; + regionInstancesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionInstancesClient. + * + * @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 RegionInstancesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionInstances', + 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 = gax.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.regionInstancesStub) { + return this.regionInstancesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionInstances. + this.regionInstancesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionInstances' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionInstances, + 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 regionInstancesStubMethods = ['bulkInsert']; + for (const methodName of regionInstancesStubMethods) { + const callPromise = this.regionInstancesStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.regionInstancesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + bulkInsert( + request?: protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest + | undefined + ), + {} | undefined + ] + >; + bulkInsert( + request: protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + bulkInsert( + request: protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates multiple instances in a given region. Count specifies the number of instances to create. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.BulkInsertInstanceResource} request.bulkInsertInstanceResourceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.bulkInsert(request); + */ + bulkInsert( + request?: protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IBulkInsertRegionInstanceRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.bulkInsert(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 { + this.initialize(); + if (!this._terminated) { + return this.regionInstancesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_instances_client_config.json b/src/v1/region_instances_client_config.json new file mode 100644 index 00000000..520a7d18 --- /dev/null +++ b/src/v1/region_instances_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionInstances": { + "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": { + "BulkInsert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_instances_proto_list.json b/src/v1/region_instances_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_instances_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_network_endpoint_groups_client.ts b/src/v1/region_network_endpoint_groups_client.ts new file mode 100644 index 00000000..0b1f2570 --- /dev/null +++ b/src/v1/region_network_endpoint_groups_client.ts @@ -0,0 +1,892 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_network_endpoint_groups_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_network_endpoint_groups_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionNetworkEndpointGroups API. + * @class + * @memberof v1 + */ +export class RegionNetworkEndpointGroupsClient { + 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}; + regionNetworkEndpointGroupsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionNetworkEndpointGroupsClient. + * + * @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 RegionNetworkEndpointGroupsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionNetworkEndpointGroups', + 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 = gax.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.regionNetworkEndpointGroupsStub) { + return this.regionNetworkEndpointGroupsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionNetworkEndpointGroups. + this.regionNetworkEndpointGroupsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionNetworkEndpointGroups' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .RegionNetworkEndpointGroups, + 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 regionNetworkEndpointGroupsStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of regionNetworkEndpointGroupsStubMethods) { + const callPromise = this.regionNetworkEndpointGroupsStub.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.regionNetworkEndpointGroupsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group to delete. It should comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup, + ( + | protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.networkEndpointGroup + * The name of the network endpoint group. It should comply with RFC1035. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INetworkEndpointGroup, + | protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup, + ( + | protos.google.cloud.compute.v1.IGetRegionNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a network endpoint group in the specified project using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.NetworkEndpointGroup} request.networkEndpointGroupResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region where you want to create the network endpoint group. It should comply with RFC1035. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionNetworkEndpointGroupRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup[], + protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): void; + /** + * Retrieves the list of regional network endpoint groups available to the specified project in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + | protos.google.cloud.compute.v1.INetworkEndpointGroupList + | null + | undefined, + protos.google.cloud.compute.v1.INetworkEndpointGroup + > + ): Promise< + [ + protos.google.cloud.compute.v1.INetworkEndpointGroup[], + protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest | null, + protos.google.cloud.compute.v1.INetworkEndpointGroupList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region where the network endpoint group is located. It should comply with RFC1035. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [NetworkEndpointGroup]{@link google.cloud.compute.v1.NetworkEndpointGroup}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionNetworkEndpointGroupsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionNetworkEndpointGroupsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_network_endpoint_groups_client_config.json b/src/v1/region_network_endpoint_groups_client_config.json new file mode 100644 index 00000000..052b8d57 --- /dev/null +++ b/src/v1/region_network_endpoint_groups_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionNetworkEndpointGroups": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_network_endpoint_groups_proto_list.json b/src/v1/region_network_endpoint_groups_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_network_endpoint_groups_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_notification_endpoints_client.ts b/src/v1/region_notification_endpoints_client.ts new file mode 100644 index 00000000..aff63dd4 --- /dev/null +++ b/src/v1/region_notification_endpoints_client.ts @@ -0,0 +1,892 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_notification_endpoints_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_notification_endpoints_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionNotificationEndpoints API. + * @class + * @memberof v1 + */ +export class RegionNotificationEndpointsClient { + 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}; + regionNotificationEndpointsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionNotificationEndpointsClient. + * + * @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 RegionNotificationEndpointsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionNotificationEndpoints', + 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 = gax.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.regionNotificationEndpointsStub) { + return this.regionNotificationEndpointsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionNotificationEndpoints. + this.regionNotificationEndpointsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionNotificationEndpoints' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .RegionNotificationEndpoints, + 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 regionNotificationEndpointsStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of regionNotificationEndpointsStubMethods) { + const callPromise = this.regionNotificationEndpointsStub.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.regionNotificationEndpointsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified NotificationEndpoint in the given region + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.notificationEndpoint + * Name of the NotificationEndpoint resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionNotificationEndpointRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INotificationEndpoint, + ( + | protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.INotificationEndpoint, + | protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, + callback: Callback< + protos.google.cloud.compute.v1.INotificationEndpoint, + | protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified NotificationEndpoint resource in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.notificationEndpoint + * Name of the NotificationEndpoint resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping 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 [NotificationEndpoint]{@link google.cloud.compute.v1.NotificationEndpoint}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.INotificationEndpoint, + | protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.INotificationEndpoint, + | protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.INotificationEndpoint, + ( + | protos.google.cloud.compute.v1.IGetRegionNotificationEndpointRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.NotificationEndpoint} request.notificationEndpointResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionNotificationEndpointRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.INotificationEndpoint[], + protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest | null, + protos.google.cloud.compute.v1.INotificationEndpointList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + | protos.google.cloud.compute.v1.INotificationEndpointList + | null + | undefined, + protos.google.cloud.compute.v1.INotificationEndpoint + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + | protos.google.cloud.compute.v1.INotificationEndpointList + | null + | undefined, + protos.google.cloud.compute.v1.INotificationEndpoint + > + ): void; + /** + * Lists the NotificationEndpoints for a project in the given region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [NotificationEndpoint]{@link google.cloud.compute.v1.NotificationEndpoint}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + | protos.google.cloud.compute.v1.INotificationEndpointList + | null + | undefined, + protos.google.cloud.compute.v1.INotificationEndpoint + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + | protos.google.cloud.compute.v1.INotificationEndpointList + | null + | undefined, + protos.google.cloud.compute.v1.INotificationEndpoint + > + ): Promise< + [ + protos.google.cloud.compute.v1.INotificationEndpoint[], + protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest | null, + protos.google.cloud.compute.v1.INotificationEndpointList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [NotificationEndpoint]{@link google.cloud.compute.v1.NotificationEndpoint} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [NotificationEndpoint]{@link google.cloud.compute.v1.NotificationEndpoint}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionNotificationEndpointsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionNotificationEndpointsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_notification_endpoints_client_config.json b/src/v1/region_notification_endpoints_client_config.json new file mode 100644 index 00000000..86593257 --- /dev/null +++ b/src/v1/region_notification_endpoints_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionNotificationEndpoints": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_notification_endpoints_proto_list.json b/src/v1/region_notification_endpoints_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_notification_endpoints_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_operations_client.ts b/src/v1/region_operations_client.ts new file mode 100644 index 00000000..e3953a21 --- /dev/null +++ b/src/v1/region_operations_client.ts @@ -0,0 +1,851 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_operations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_operations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionOperations API. + * @class + * @memberof v1 + */ +export class RegionOperationsClient { + 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}; + regionOperationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionOperationsClient. + * + * @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 RegionOperationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionOperations', + 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 = gax.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.regionOperationsStub) { + return this.regionOperationsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionOperations. + this.regionOperationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionOperations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionOperations, + 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 regionOperationsStubMethods = ['delete', 'get', 'list', 'wait']; + for (const methodName of regionOperationsStubMethods) { + const callPromise = this.regionOperationsStub.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.regionOperationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteRegionOperationResponse, + protos.google.cloud.compute.v1.IDeleteRegionOperationRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteRegionOperationResponse, + | protos.google.cloud.compute.v1.IDeleteRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteRegionOperationResponse, + | protos.google.cloud.compute.v1.IDeleteRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified region-specific Operations resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [DeleteRegionOperationResponse]{@link google.cloud.compute.v1.DeleteRegionOperationResponse}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDeleteRegionOperationResponse, + | protos.google.cloud.compute.v1.IDeleteRegionOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDeleteRegionOperationResponse, + | protos.google.cloud.compute.v1.IDeleteRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteRegionOperationResponse, + protos.google.cloud.compute.v1.IDeleteRegionOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IGetRegionOperationRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified region-specific Operations resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetRegionOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IGetRegionOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + wait( + request?: protos.google.cloud.compute.v1.IWaitRegionOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IWaitRegionOperationRequest | undefined, + {} | undefined + ] + >; + wait( + request: protos.google.cloud.compute.v1.IWaitRegionOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + wait( + request: protos.google.cloud.compute.v1.IWaitRegionOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + * + * This method is called on a best-effort basis. Specifically: + * - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + * - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.wait(request); + */ + wait( + request?: protos.google.cloud.compute.v1.IWaitRegionOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitRegionOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitRegionOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IWaitRegionOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.wait(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionOperationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListRegionOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionOperationsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + /** + * Retrieves a list of Operation resources contained within the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Operation]{@link google.cloud.compute.v1.Operation}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionOperationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListRegionOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Operation]{@link google.cloud.compute.v1.Operation} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionOperationsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Operation]{@link google.cloud.compute.v1.Operation}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionOperationsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionOperationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_operations_client_config.json b/src/v1/region_operations_client_config.json new file mode 100644 index 00000000..517773ba --- /dev/null +++ b/src/v1/region_operations_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionOperations": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Wait": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_operations_proto_list.json b/src/v1/region_operations_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_operations_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_ssl_certificates_client.ts b/src/v1/region_ssl_certificates_client.ts new file mode 100644 index 00000000..99a5c307 --- /dev/null +++ b/src/v1/region_ssl_certificates_client.ts @@ -0,0 +1,883 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_ssl_certificates_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_ssl_certificates_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionSslCertificates API. + * @class + * @memberof v1 + */ +export class RegionSslCertificatesClient { + 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}; + regionSslCertificatesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionSslCertificatesClient. + * + * @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 RegionSslCertificatesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionSslCertificates', + 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 = gax.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.regionSslCertificatesStub) { + return this.regionSslCertificatesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionSslCertificates. + this.regionSslCertificatesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionSslCertificates' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionSslCertificates, + 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 regionSslCertificatesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of regionSslCertificatesStubMethods) { + const callPromise = this.regionSslCertificatesStub.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.regionSslCertificatesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified SslCertificate resource in the region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sslCertificate + * Name of the SslCertificate resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionSslCertificateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate, + ( + | protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified SslCertificate resource in the specified region. Get a list of available SSL certificates by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.sslCertificate + * Name of the SslCertificate resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SslCertificate]{@link google.cloud.compute.v1.SslCertificate}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate, + ( + | protos.google.cloud.compute.v1.IGetRegionSslCertificateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a SslCertificate resource in the specified project and region using the data included in the request + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SslCertificate} request.sslCertificateResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionSslCertificateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate[], + protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest | null, + protos.google.cloud.compute.v1.ISslCertificateList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + > + ): void; + /** + * Retrieves the list of SslCertificate resources available to the specified project in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [SslCertificate]{@link google.cloud.compute.v1.SslCertificate}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate[], + protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest | null, + protos.google.cloud.compute.v1.ISslCertificateList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [SslCertificate]{@link google.cloud.compute.v1.SslCertificate} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [SslCertificate]{@link google.cloud.compute.v1.SslCertificate}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionSslCertificatesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionSslCertificatesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_ssl_certificates_client_config.json b/src/v1/region_ssl_certificates_client_config.json new file mode 100644 index 00000000..af77bfa9 --- /dev/null +++ b/src/v1/region_ssl_certificates_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionSslCertificates": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_ssl_certificates_proto_list.json b/src/v1/region_ssl_certificates_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_ssl_certificates_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_target_http_proxies_client.ts b/src/v1/region_target_http_proxies_client.ts new file mode 100644 index 00000000..dcee20c5 --- /dev/null +++ b/src/v1/region_target_http_proxies_client.ts @@ -0,0 +1,995 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_target_http_proxies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_target_http_proxies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionTargetHttpProxies API. + * @class + * @memberof v1 + */ +export class RegionTargetHttpProxiesClient { + 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}; + regionTargetHttpProxiesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionTargetHttpProxiesClient. + * + * @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 RegionTargetHttpProxiesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionTargetHttpProxies', + 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 = gax.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.regionTargetHttpProxiesStub) { + return this.regionTargetHttpProxiesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionTargetHttpProxies. + this.regionTargetHttpProxiesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionTargetHttpProxies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionTargetHttpProxies, + 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 regionTargetHttpProxiesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'setUrlMap', + ]; + for (const methodName of regionTargetHttpProxiesStubMethods) { + const callPromise = this.regionTargetHttpProxiesStub.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.regionTargetHttpProxiesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetHttpProxy resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpProxy + * Name of the TargetHttpProxy resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy, + ( + | protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetHttpProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.targetHttpProxy + * Name of the TargetHttpProxy resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy, + ( + | protos.google.cloud.compute.v1.IGetRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetHttpProxy resource in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetHttpProxy} request.targetHttpProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + >; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the URL map for TargetHttpProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpProxy + * Name of the TargetHttpProxy to set a URL map for. + * @param {google.cloud.compute.v1.UrlMapReference} request.urlMapReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setUrlMap(request); + */ + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setUrlMap(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy[], + protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpProxyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + > + ): void; + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + | protos.google.cloud.compute.v1.ITargetHttpProxyList + | null + | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy[], + protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpProxyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpProxiesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionTargetHttpProxiesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_target_http_proxies_client_config.json b/src/v1/region_target_http_proxies_client_config.json new file mode 100644 index 00000000..35421753 --- /dev/null +++ b/src/v1/region_target_http_proxies_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionTargetHttpProxies": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetUrlMap": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_target_http_proxies_proto_list.json b/src/v1/region_target_http_proxies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_target_http_proxies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_target_https_proxies_client.ts b/src/v1/region_target_https_proxies_client.ts new file mode 100644 index 00000000..b0881fd9 --- /dev/null +++ b/src/v1/region_target_https_proxies_client.ts @@ -0,0 +1,1106 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_target_https_proxies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_target_https_proxies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionTargetHttpsProxies API. + * @class + * @memberof v1 + */ +export class RegionTargetHttpsProxiesClient { + 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}; + regionTargetHttpsProxiesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionTargetHttpsProxiesClient. + * + * @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 RegionTargetHttpsProxiesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionTargetHttpsProxies', + 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 = gax.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.regionTargetHttpsProxiesStub) { + return this.regionTargetHttpsProxiesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionTargetHttpsProxies. + this.regionTargetHttpsProxiesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionTargetHttpsProxies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1 + .RegionTargetHttpsProxies, + 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 regionTargetHttpsProxiesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'setSslCertificates', + 'setUrlMap', + ]; + for (const methodName of regionTargetHttpsProxiesStubMethods) { + const callPromise = this.regionTargetHttpsProxiesStub.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.regionTargetHttpsProxiesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetHttpsProxy resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IDeleteRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy, + ( + | protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetHttpsProxy resource in the specified region. Gets a list of available target HTTP proxies by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy, + ( + | protos.google.cloud.compute.v1.IGetRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetHttpsProxy} request.targetHttpsProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IInsertRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setSslCertificates( + request?: protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + setSslCertificates( + request: protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setSslCertificates( + request: protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionTargetHttpsProxiesSetSslCertificatesRequest} request.regionTargetHttpsProxiesSetSslCertificatesRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setSslCertificates(request); + */ + setSslCertificates( + request?: protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslCertificatesRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setSslCertificates(request, options, callback); + } + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the URL map for TargetHttpsProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy to set a URL map for. + * @param {google.cloud.compute.v1.UrlMapReference} request.urlMapReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setUrlMap(request); + */ + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapRegionTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setUrlMap(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy[], + protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpsProxyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpsProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpsProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + > + ): void; + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + | protos.google.cloud.compute.v1.ITargetHttpsProxyList + | null + | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpsProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy[], + protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpsProxyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionTargetHttpsProxiesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionTargetHttpsProxiesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_target_https_proxies_client_config.json b/src/v1/region_target_https_proxies_client_config.json new file mode 100644 index 00000000..edb18448 --- /dev/null +++ b/src/v1/region_target_https_proxies_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionTargetHttpsProxies": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetSslCertificates": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetUrlMap": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_target_https_proxies_proto_list.json b/src/v1/region_target_https_proxies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_target_https_proxies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/region_url_maps_client.ts b/src/v1/region_url_maps_client.ts new file mode 100644 index 00000000..6ec9b799 --- /dev/null +++ b/src/v1/region_url_maps_client.ts @@ -0,0 +1,1148 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/region_url_maps_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './region_url_maps_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The RegionUrlMaps API. + * @class + * @memberof v1 + */ +export class RegionUrlMapsClient { + 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}; + regionUrlMapsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionUrlMapsClient. + * + * @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 RegionUrlMapsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.RegionUrlMaps', + 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 = gax.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.regionUrlMapsStub) { + return this.regionUrlMapsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.RegionUrlMaps. + this.regionUrlMapsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.RegionUrlMaps' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.RegionUrlMaps, + 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 regionUrlMapsStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'update', + 'validate', + ]; + for (const methodName of regionUrlMapsStubMethods) { + const callPromise = this.regionUrlMapsStub.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.regionUrlMapsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified UrlMap resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {string} request.urlMap + * Name of the UrlMap resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRegionUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRegionUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetRegionUrlMapRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetRegionUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetRegionUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.urlMap + * Name of the UrlMap resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [UrlMap]{@link google.cloud.compute.v1.UrlMap}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IUrlMap, + | protos.google.cloud.compute.v1.IGetRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetRegionUrlMapRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetRegionUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {google.cloud.compute.v1.UrlMap} request.urlMapResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRegionUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {string} request.urlMap + * Name of the UrlMap resource to patch. + * @param {google.cloud.compute.v1.UrlMap} request.urlMapResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRegionUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {string} request.urlMap + * Name of the UrlMap resource to update. + * @param {google.cloud.compute.v1.UrlMap} request.urlMapResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRegionUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + validate( + request?: protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest | undefined, + {} | undefined + ] + >; + validate( + request: protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + | protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + validate( + request: protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + | protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {google.cloud.compute.v1.RegionUrlMapsValidateRequest} request.regionUrlMapsValidateRequestResource + * The body resource for this request + * @param {string} request.urlMap + * Name of the UrlMap resource to be validated as. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [UrlMapsValidateResponse]{@link google.cloud.compute.v1.UrlMapsValidateResponse}. + * 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.validate(request); + */ + validate( + request?: protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + | protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + | protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + protos.google.cloud.compute.v1.IValidateRegionUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.validate(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap[], + protos.google.cloud.compute.v1.IListRegionUrlMapsRequest | null, + protos.google.cloud.compute.v1.IUrlMapList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + > + ): void; + /** + * Retrieves the list of UrlMap resources available to the specified project in the specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [UrlMap]{@link google.cloud.compute.v1.UrlMap}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + > + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap[], + protos.google.cloud.compute.v1.IListRegionUrlMapsRequest | null, + protos.google.cloud.compute.v1.IUrlMapList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [UrlMap]{@link google.cloud.compute.v1.UrlMap} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [UrlMap]{@link google.cloud.compute.v1.UrlMap}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionUrlMapsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionUrlMapsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/region_url_maps_client_config.json b/src/v1/region_url_maps_client_config.json new file mode 100644 index 00000000..d6cda938 --- /dev/null +++ b/src/v1/region_url_maps_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.RegionUrlMaps": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Validate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/region_url_maps_proto_list.json b/src/v1/region_url_maps_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/region_url_maps_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/regions_client.ts b/src/v1/regions_client.ts new file mode 100644 index 00000000..8be30656 --- /dev/null +++ b/src/v1/regions_client.ts @@ -0,0 +1,642 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/regions_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './regions_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Regions API. + * @class + * @memberof v1 + */ +export class RegionsClient { + 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}; + regionsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RegionsClient. + * + * @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 RegionsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Regions', + 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 = gax.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.regionsStub) { + return this.regionsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Regions. + this.regionsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Regions' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Regions, + 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 regionsStubMethods = ['get', 'list']; + for (const methodName of regionsStubMethods) { + const callPromise = this.regionsStub.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.regionsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetRegionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRegion, + protos.google.cloud.compute.v1.IGetRegionRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRegionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IRegion, + protos.google.cloud.compute.v1.IGetRegionRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRegionRequest, + callback: Callback< + protos.google.cloud.compute.v1.IRegion, + protos.google.cloud.compute.v1.IGetRegionRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified Region resource. Gets a list of available regions by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Region]{@link google.cloud.compute.v1.Region}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRegionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IRegion, + protos.google.cloud.compute.v1.IGetRegionRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IRegion, + protos.google.cloud.compute.v1.IGetRegionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRegion, + protos.google.cloud.compute.v1.IGetRegionRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRegionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRegion[], + protos.google.cloud.compute.v1.IListRegionsRequest | null, + protos.google.cloud.compute.v1.IRegionList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRegionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionsRequest, + protos.google.cloud.compute.v1.IRegionList | null | undefined, + protos.google.cloud.compute.v1.IRegion + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRegionsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionsRequest, + protos.google.cloud.compute.v1.IRegionList | null | undefined, + protos.google.cloud.compute.v1.IRegion + > + ): void; + /** + * Retrieves the list of region resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Region]{@link google.cloud.compute.v1.Region}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRegionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRegionsRequest, + protos.google.cloud.compute.v1.IRegionList | null | undefined, + protos.google.cloud.compute.v1.IRegion + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRegionsRequest, + protos.google.cloud.compute.v1.IRegionList | null | undefined, + protos.google.cloud.compute.v1.IRegion + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRegion[], + protos.google.cloud.compute.v1.IListRegionsRequest | null, + protos.google.cloud.compute.v1.IRegionList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Region]{@link google.cloud.compute.v1.Region} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRegionsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Region]{@link google.cloud.compute.v1.Region}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRegionsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.regionsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/regions_client_config.json b/src/v1/regions_client_config.json new file mode 100644 index 00000000..0c86e316 --- /dev/null +++ b/src/v1/regions_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Regions": { + "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": { + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/regions_proto_list.json b/src/v1/regions_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/regions_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/reservations_client.ts b/src/v1/reservations_client.ts new file mode 100644 index 00000000..2564bc86 --- /dev/null +++ b/src/v1/reservations_client.ts @@ -0,0 +1,1351 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/reservations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './reservations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Reservations API. + * @class + * @memberof v1 + */ +export class ReservationsClient { + 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}; + reservationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ReservationsClient. + * + * @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 ReservationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Reservations', + 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 = gax.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.reservationsStub) { + return this.reservationsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Reservations. + this.reservationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Reservations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Reservations, + 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 reservationsStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'resize', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of reservationsStubMethods) { + const callPromise = this.reservationsStub.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.reservationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteReservationRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteReservationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.reservation + * Name of the reservation to delete. + * @param {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IReservation, + protos.google.cloud.compute.v1.IGetReservationRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IReservation, + protos.google.cloud.compute.v1.IGetReservationRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetReservationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IReservation, + protos.google.cloud.compute.v1.IGetReservationRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves information about the specified reservation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.reservation + * Name of the reservation to retrieve. + * @param {string} request.zone + * Name of the zone for 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 [Reservation]{@link google.cloud.compute.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 + * const [response] = await client.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IReservation, + | protos.google.cloud.compute.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IReservation, + protos.google.cloud.compute.v1.IGetReservationRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IReservation, + protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest + | undefined + ), + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyReservationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertReservationRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertReservationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new reservation. For more information, read Reserving zonal resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Reservation} request.reservationResource + * The body resource for this request + * @param {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertReservationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + resize( + request?: protos.google.cloud.compute.v1.IResizeReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeReservationRequest | undefined, + {} | undefined + ] + >; + resize( + request: protos.google.cloud.compute.v1.IResizeReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + resize( + request: protos.google.cloud.compute.v1.IResizeReservationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.reservation + * Name of the reservation to update. + * @param {google.cloud.compute.v1.ReservationsResizeRequest} request.reservationsResizeRequestResource + * The body resource for this request + * @param {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.resize(request); + */ + resize( + request?: protos.google.cloud.compute.v1.IResizeReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IResizeReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IResizeReservationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.resize(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest + | undefined + ), + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {string} request.zone + * The name of the zone for this request. + * @param {google.cloud.compute.v1.ZoneSetPolicyRequest} request.zoneSetPolicyRequestResource + * The body resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyReservationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for this request + * @param {string} request.zone + * The name of the zone for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsReservationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [ReservationsScopedList]{@link google.cloud.compute.v1.ReservationsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListReservationsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IReservationsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IReservationsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListReservationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IReservation[], + protos.google.cloud.compute.v1.IListReservationsRequest | null, + protos.google.cloud.compute.v1.IReservationList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListReservationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListReservationsRequest, + protos.google.cloud.compute.v1.IReservationList | null | undefined, + protos.google.cloud.compute.v1.IReservation + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListReservationsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListReservationsRequest, + protos.google.cloud.compute.v1.IReservationList | null | undefined, + protos.google.cloud.compute.v1.IReservation + > + ): void; + /** + * A list of all the reservations that have been configured for the specified project in specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for 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 Array of [Reservation]{@link google.cloud.compute.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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListReservationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListReservationsRequest, + protos.google.cloud.compute.v1.IReservationList | null | undefined, + protos.google.cloud.compute.v1.IReservation + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListReservationsRequest, + protos.google.cloud.compute.v1.IReservationList | null | undefined, + protos.google.cloud.compute.v1.IReservation + > + ): Promise< + [ + protos.google.cloud.compute.v1.IReservation[], + protos.google.cloud.compute.v1.IListReservationsRequest | null, + protos.google.cloud.compute.v1.IReservationList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for this request. + * @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.compute.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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for this request. + * @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.compute.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 + * const iterable = client.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.reservationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/reservations_client_config.json b/src/v1/reservations_client_config.json new file mode 100644 index 00000000..6a9cface --- /dev/null +++ b/src/v1/reservations_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Reservations": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Resize": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/reservations_proto_list.json b/src/v1/reservations_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/reservations_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/resource_policies_client.ts b/src/v1/resource_policies_client.ts new file mode 100644 index 00000000..f03f849f --- /dev/null +++ b/src/v1/resource_policies_client.ts @@ -0,0 +1,1253 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/resource_policies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './resource_policies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The ResourcePolicies API. + * @class + * @memberof v1 + */ +export class ResourcePoliciesClient { + 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}; + resourcePoliciesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ResourcePoliciesClient. + * + * @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 ResourcePoliciesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.ResourcePolicies', + 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 = gax.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.resourcePoliciesStub) { + return this.resourcePoliciesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.ResourcePolicies. + this.resourcePoliciesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.ResourcePolicies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.ResourcePolicies, + 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 resourcePoliciesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'setIamPolicy', + 'testIamPermissions', + ]; + for (const methodName of resourcePoliciesStubMethods) { + const callPromise = this.resourcePoliciesStub.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.resourcePoliciesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified resource policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.resourcePolicy + * Name of the resource policy to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteResourcePolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetResourcePolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IResourcePolicy, + protos.google.cloud.compute.v1.IGetResourcePolicyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetResourcePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IResourcePolicy, + | protos.google.cloud.compute.v1.IGetResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetResourcePolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IResourcePolicy, + | protos.google.cloud.compute.v1.IGetResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves all information of the specified resource policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.resourcePolicy + * Name of the resource policy to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ResourcePolicy]{@link google.cloud.compute.v1.ResourcePolicy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetResourcePolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IResourcePolicy, + | protos.google.cloud.compute.v1.IGetResourcePolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IResourcePolicy, + | protos.google.cloud.compute.v1.IGetResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IResourcePolicy, + protos.google.cloud.compute.v1.IGetResourcePolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest + | undefined + ), + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.IGetIamPolicyResourcePolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertResourcePolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertResourcePolicyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertResourcePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertResourcePolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new resource policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.ResourcePolicy} request.resourcePolicyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertResourcePolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertResourcePolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertResourcePolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest + | undefined + ), + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {google.cloud.compute.v1.RegionSetPolicyRequest} request.regionSetPolicyRequestResource + * The body resource for this request + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + ( + | protos.google.cloud.compute.v1.ISetIamPolicyResourcePolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsResourcePolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [ResourcePoliciesScopedList]{@link google.cloud.compute.v1.ResourcePoliciesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListResourcePoliciesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IResourcePoliciesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IResourcePoliciesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IResourcePolicy[], + protos.google.cloud.compute.v1.IListResourcePoliciesRequest | null, + protos.google.cloud.compute.v1.IResourcePolicyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + protos.google.cloud.compute.v1.IResourcePolicyList | null | undefined, + protos.google.cloud.compute.v1.IResourcePolicy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + protos.google.cloud.compute.v1.IResourcePolicyList | null | undefined, + protos.google.cloud.compute.v1.IResourcePolicy + > + ): void; + /** + * A list all the resource policies that have been configured for the specified project in specified region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [ResourcePolicy]{@link google.cloud.compute.v1.ResourcePolicy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + protos.google.cloud.compute.v1.IResourcePolicyList | null | undefined, + protos.google.cloud.compute.v1.IResourcePolicy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + protos.google.cloud.compute.v1.IResourcePolicyList | null | undefined, + protos.google.cloud.compute.v1.IResourcePolicy + > + ): Promise< + [ + protos.google.cloud.compute.v1.IResourcePolicy[], + protos.google.cloud.compute.v1.IListResourcePoliciesRequest | null, + protos.google.cloud.compute.v1.IResourcePolicyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [ResourcePolicy]{@link google.cloud.compute.v1.ResourcePolicy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [ResourcePolicy]{@link google.cloud.compute.v1.ResourcePolicy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListResourcePoliciesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.resourcePoliciesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/resource_policies_client_config.json b/src/v1/resource_policies_client_config.json new file mode 100644 index 00000000..5e0e41c3 --- /dev/null +++ b/src/v1/resource_policies_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ResourcePolicies": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/resource_policies_proto_list.json b/src/v1/resource_policies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/resource_policies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/routers_client.ts b/src/v1/routers_client.ts new file mode 100644 index 00000000..9f73cafd --- /dev/null +++ b/src/v1/routers_client.ts @@ -0,0 +1,1560 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/routers_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './routers_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Routers API. + * @class + * @memberof v1 + */ +export class RoutersClient { + 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}; + routersStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RoutersClient. + * + * @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 RoutersClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + getNatMappingInfo: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'result' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Routers', + 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 = gax.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.routersStub) { + return this.routersStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Routers. + this.routersStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Routers' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Routers, + 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 routersStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'getNatMappingInfo', + 'getRouterStatus', + 'insert', + 'list', + 'patch', + 'preview', + 'update', + ]; + for (const methodName of routersStubMethods) { + const callPromise = this.routersStub.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.routersStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRouterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouterRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRouterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRouterRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified Router resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.router + * Name of the Router resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRouterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteRouterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouterRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRouterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRouter, + protos.google.cloud.compute.v1.IGetRouterRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRouterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IRouter, + protos.google.cloud.compute.v1.IGetRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRouterRequest, + callback: Callback< + protos.google.cloud.compute.v1.IRouter, + protos.google.cloud.compute.v1.IGetRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified Router resource. Gets a list of available routers by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.router + * Name of the Router resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Router]{@link google.cloud.compute.v1.Router}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRouterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IRouter, + protos.google.cloud.compute.v1.IGetRouterRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IRouter, + protos.google.cloud.compute.v1.IGetRouterRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRouter, + protos.google.cloud.compute.v1.IGetRouterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getRouterStatus( + request?: protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRouterStatusResponse, + protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest | undefined, + {} | undefined + ] + >; + getRouterStatus( + request: protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IRouterStatusResponse, + | protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRouterStatus( + request: protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest, + callback: Callback< + protos.google.cloud.compute.v1.IRouterStatusResponse, + | protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves runtime information of the specified router. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.router + * Name of the Router resource to query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [RouterStatusResponse]{@link google.cloud.compute.v1.RouterStatusResponse}. + * 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.getRouterStatus(request); + */ + getRouterStatus( + request?: protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IRouterStatusResponse, + | protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IRouterStatusResponse, + | protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRouterStatusResponse, + protos.google.cloud.compute.v1.IGetRouterStatusRouterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getRouterStatus(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRouterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouterRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRouterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRouterRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a Router resource in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Router} request.routerResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRouterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertRouterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouterRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchRouterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRouterRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchRouterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchRouterRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.router + * Name of the Router resource to patch. + * @param {google.cloud.compute.v1.Router} request.routerResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchRouterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRouterRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRouterRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchRouterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + preview( + request?: protos.google.cloud.compute.v1.IPreviewRouterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRoutersPreviewResponse, + protos.google.cloud.compute.v1.IPreviewRouterRequest | undefined, + {} | undefined + ] + >; + preview( + request: protos.google.cloud.compute.v1.IPreviewRouterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IRoutersPreviewResponse, + protos.google.cloud.compute.v1.IPreviewRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + preview( + request: protos.google.cloud.compute.v1.IPreviewRouterRequest, + callback: Callback< + protos.google.cloud.compute.v1.IRoutersPreviewResponse, + protos.google.cloud.compute.v1.IPreviewRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.router + * Name of the Router resource to query. + * @param {google.cloud.compute.v1.Router} request.routerResource + * The body resource for 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 [RoutersPreviewResponse]{@link google.cloud.compute.v1.RoutersPreviewResponse}. + * 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.preview(request); + */ + preview( + request?: protos.google.cloud.compute.v1.IPreviewRouterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IRoutersPreviewResponse, + | protos.google.cloud.compute.v1.IPreviewRouterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IRoutersPreviewResponse, + protos.google.cloud.compute.v1.IPreviewRouterRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRoutersPreviewResponse, + protos.google.cloud.compute.v1.IPreviewRouterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.preview(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateRouterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRouterRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateRouterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateRouterRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRouterRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.router + * Name of the Router resource to update. + * @param {google.cloud.compute.v1.Router} request.routerResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateRouterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateRouterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRouterRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateRouterRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [RoutersScopedList]{@link google.cloud.compute.v1.RoutersScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListRoutersRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IRoutersScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IRoutersScopedList] + >; + } + getNatMappingInfo( + request?: protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IVmEndpointNatMappings[], + protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest | null, + protos.google.cloud.compute.v1.IVmEndpointNatMappingsList + ] + >; + getNatMappingInfo( + request: protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + | protos.google.cloud.compute.v1.IVmEndpointNatMappingsList + | null + | undefined, + protos.google.cloud.compute.v1.IVmEndpointNatMappings + > + ): void; + getNatMappingInfo( + request: protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + | protos.google.cloud.compute.v1.IVmEndpointNatMappingsList + | null + | undefined, + protos.google.cloud.compute.v1.IVmEndpointNatMappings + > + ): void; + /** + * Retrieves runtime Nat mapping information of VM endpoints. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.router + * Name of the Router resource to query for Nat Mapping information of VM endpoints. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [VmEndpointNatMappings]{@link google.cloud.compute.v1.VmEndpointNatMappings}. + * 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 `getNatMappingInfoAsync()` + * 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. + */ + getNatMappingInfo( + request?: protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + | protos.google.cloud.compute.v1.IVmEndpointNatMappingsList + | null + | undefined, + protos.google.cloud.compute.v1.IVmEndpointNatMappings + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + | protos.google.cloud.compute.v1.IVmEndpointNatMappingsList + | null + | undefined, + protos.google.cloud.compute.v1.IVmEndpointNatMappings + > + ): Promise< + [ + protos.google.cloud.compute.v1.IVmEndpointNatMappings[], + protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest | null, + protos.google.cloud.compute.v1.IVmEndpointNatMappingsList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getNatMappingInfo(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.router + * Name of the Router resource to query for Nat Mapping information of VM endpoints. + * @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 [VmEndpointNatMappings]{@link google.cloud.compute.v1.VmEndpointNatMappings} 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 `getNatMappingInfoAsync()` + * 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. + */ + getNatMappingInfoStream( + request?: protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.getNatMappingInfo.createStream( + this.innerApiCalls.getNatMappingInfo as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `getNatMappingInfo`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.router + * Name of the Router resource to query for Nat Mapping information of VM endpoints. + * @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 + * [VmEndpointNatMappings]{@link google.cloud.compute.v1.VmEndpointNatMappings}. 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.getNatMappingInfoAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + getNatMappingInfoAsync( + request?: protos.google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.getNatMappingInfo.asyncIterate( + this.innerApiCalls['getNatMappingInfo'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + list( + request?: protos.google.cloud.compute.v1.IListRoutersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRouter[], + protos.google.cloud.compute.v1.IListRoutersRequest | null, + protos.google.cloud.compute.v1.IRouterList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRoutersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRoutersRequest, + protos.google.cloud.compute.v1.IRouterList | null | undefined, + protos.google.cloud.compute.v1.IRouter + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRoutersRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRoutersRequest, + protos.google.cloud.compute.v1.IRouterList | null | undefined, + protos.google.cloud.compute.v1.IRouter + > + ): void; + /** + * Retrieves a list of Router resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Router]{@link google.cloud.compute.v1.Router}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRoutersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRoutersRequest, + protos.google.cloud.compute.v1.IRouterList | null | undefined, + protos.google.cloud.compute.v1.IRouter + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRoutersRequest, + protos.google.cloud.compute.v1.IRouterList | null | undefined, + protos.google.cloud.compute.v1.IRouter + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRouter[], + protos.google.cloud.compute.v1.IListRoutersRequest | null, + protos.google.cloud.compute.v1.IRouterList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Router]{@link google.cloud.compute.v1.Router} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRoutersRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Router]{@link google.cloud.compute.v1.Router}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRoutersRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.routersStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/routers_client_config.json b/src/v1/routers_client_config.json new file mode 100644 index 00000000..ad60e60a --- /dev/null +++ b/src/v1/routers_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Routers": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNatMappingInfo": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRouterStatus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Preview": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/routers_proto_list.json b/src/v1/routers_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/routers_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/routes_client.ts b/src/v1/routes_client.ts new file mode 100644 index 00000000..4edc2ca8 --- /dev/null +++ b/src/v1/routes_client.ts @@ -0,0 +1,823 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/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 v1 + */ +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/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 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 ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.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 = gax.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.cloud.compute.v1.Routes. + this.routesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Routes' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.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 = ['delete', 'get', 'insert', 'list']; + for (const methodName of routesStubMethods) { + const callPromise = this.routesStub.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.routesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouteRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouteRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteRouteRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouteRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified Route resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.route + * Name of the Route resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouteRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouteRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteRouteRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRoute, + protos.google.cloud.compute.v1.IGetRouteRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IRoute, + protos.google.cloud.compute.v1.IGetRouteRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetRouteRequest, + callback: Callback< + protos.google.cloud.compute.v1.IRoute, + protos.google.cloud.compute.v1.IGetRouteRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified Route resource. Gets a list of available routes by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.route + * Name of the Route resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Route]{@link google.cloud.compute.v1.Route}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IRoute, + protos.google.cloud.compute.v1.IGetRouteRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IRoute, + protos.google.cloud.compute.v1.IGetRouteRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRoute, + protos.google.cloud.compute.v1.IGetRouteRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouteRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouteRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertRouteRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouteRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a Route resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Route} request.routeResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouteRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouteRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertRouteRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IRoute[], + protos.google.cloud.compute.v1.IListRoutesRequest | null, + protos.google.cloud.compute.v1.IRouteList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListRoutesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRoutesRequest, + protos.google.cloud.compute.v1.IRouteList | null | undefined, + protos.google.cloud.compute.v1.IRoute + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListRoutesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListRoutesRequest, + protos.google.cloud.compute.v1.IRouteList | null | undefined, + protos.google.cloud.compute.v1.IRoute + > + ): void; + /** + * Retrieves the list of Route resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Route]{@link google.cloud.compute.v1.Route}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListRoutesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListRoutesRequest, + protos.google.cloud.compute.v1.IRouteList | null | undefined, + protos.google.cloud.compute.v1.IRoute + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListRoutesRequest, + protos.google.cloud.compute.v1.IRouteList | null | undefined, + protos.google.cloud.compute.v1.IRoute + > + ): Promise< + [ + protos.google.cloud.compute.v1.IRoute[], + protos.google.cloud.compute.v1.IListRoutesRequest | null, + protos.google.cloud.compute.v1.IRouteList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Route]{@link google.cloud.compute.v1.Route} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListRoutesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Route]{@link google.cloud.compute.v1.Route}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListRoutesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.routesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/routes_client_config.json b/src/v1/routes_client_config.json new file mode 100644 index 00000000..15a5c180 --- /dev/null +++ b/src/v1/routes_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/routes_proto_list.json b/src/v1/routes_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/routes_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/security_policies_client.ts b/src/v1/security_policies_client.ts new file mode 100644 index 00000000..93506165 --- /dev/null +++ b/src/v1/security_policies_client.ts @@ -0,0 +1,1474 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/security_policies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './security_policies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The SecurityPolicies API. + * @class + * @memberof v1 + */ +export class SecurityPoliciesClient { + 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}; + securityPoliciesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SecurityPoliciesClient. + * + * @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 SecurityPoliciesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.SecurityPolicies', + 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 = gax.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.securityPoliciesStub) { + return this.securityPoliciesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.SecurityPolicies. + this.securityPoliciesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.SecurityPolicies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.SecurityPolicies, + 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 securityPoliciesStubMethods = [ + 'addRule', + 'delete', + 'get', + 'getRule', + 'insert', + 'list', + 'listPreconfiguredExpressionSets', + 'patch', + 'patchRule', + 'removeRule', + ]; + for (const methodName of securityPoliciesStubMethods) { + const callPromise = this.securityPoliciesStub.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.securityPoliciesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addRule( + request?: protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest | undefined, + {} | undefined + ] + >; + addRule( + request: protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addRule( + request: protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Inserts a rule into a security policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.securityPolicy + * Name of the security policy to update. + * @param {google.cloud.compute.v1.SecurityPolicyRule} request.securityPolicyRuleResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addRule(request); + */ + addRule( + request?: protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddRuleSecurityPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addRule(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.securityPolicy + * Name of the security policy to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSecurityPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPolicy, + protos.google.cloud.compute.v1.IGetSecurityPolicyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISecurityPolicy, + | protos.google.cloud.compute.v1.IGetSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISecurityPolicy, + | protos.google.cloud.compute.v1.IGetSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * List all of the ordered rules present in a single specified policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.securityPolicy + * Name of the security policy to get. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityPolicy]{@link google.cloud.compute.v1.SecurityPolicy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISecurityPolicy, + | protos.google.cloud.compute.v1.IGetSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISecurityPolicy, + | protos.google.cloud.compute.v1.IGetSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPolicy, + protos.google.cloud.compute.v1.IGetSecurityPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getRule( + request?: protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPolicyRule, + protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest | undefined, + {} | undefined + ] + >; + getRule( + request: protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISecurityPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRule( + request: protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISecurityPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets a rule at the specified priority. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.priority + * The priority of the rule to get from the security policy. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.securityPolicy + * Name of the security policy to which the queried rule belongs. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SecurityPolicyRule]{@link google.cloud.compute.v1.SecurityPolicyRule}. + * 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.getRule(request); + */ + getRule( + request?: protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISecurityPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISecurityPolicyRule, + | protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPolicyRule, + protos.google.cloud.compute.v1.IGetRuleSecurityPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getRule(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new policy in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SecurityPolicy} request.securityPolicyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSecurityPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + listPreconfiguredExpressionSets( + request?: protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, + ( + | protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest + | undefined + ), + {} | undefined + ] + >; + listPreconfiguredExpressionSets( + request: protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, + | protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listPreconfiguredExpressionSets( + request: protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, + | protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the current list of preconfigured Web Application Firewall (WAF) expressions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 [SecurityPoliciesListPreconfiguredExpressionSetsResponse]{@link google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse}. + * 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.listPreconfiguredExpressionSets(request); + */ + listPreconfiguredExpressionSets( + request?: protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, + | protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, + | protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse, + ( + | protos.google.cloud.compute.v1.IListPreconfiguredExpressionSetsSecurityPoliciesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listPreconfiguredExpressionSets( + request, + options, + callback + ); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.securityPolicy + * Name of the security policy to update. + * @param {google.cloud.compute.v1.SecurityPolicy} request.securityPolicyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSecurityPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + patchRule( + request?: protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest + | undefined + ), + {} | undefined + ] + >; + patchRule( + request: protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patchRule( + request: protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches a rule at the specified priority. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.priority + * The priority of the rule to patch. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.securityPolicy + * Name of the security policy to update. + * @param {google.cloud.compute.v1.SecurityPolicyRule} request.securityPolicyRuleResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patchRule(request); + */ + patchRule( + request?: protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IPatchRuleSecurityPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patchRule(request, options, callback); + } + removeRule( + request?: protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest + | undefined + ), + {} | undefined + ] + >; + removeRule( + request: protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeRule( + request: protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a rule at the specified priority. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.priority + * The priority of the rule to remove from the security policy. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.securityPolicy + * Name of the security policy 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeRule(request); + */ + removeRule( + request?: protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveRuleSecurityPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removeRule(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPolicy[], + protos.google.cloud.compute.v1.IListSecurityPoliciesRequest | null, + protos.google.cloud.compute.v1.ISecurityPolicyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + protos.google.cloud.compute.v1.ISecurityPolicyList | null | undefined, + protos.google.cloud.compute.v1.ISecurityPolicy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + protos.google.cloud.compute.v1.ISecurityPolicyList | null | undefined, + protos.google.cloud.compute.v1.ISecurityPolicy + > + ): void; + /** + * List all the policies that have been configured for the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [SecurityPolicy]{@link google.cloud.compute.v1.SecurityPolicy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + protos.google.cloud.compute.v1.ISecurityPolicyList | null | undefined, + protos.google.cloud.compute.v1.ISecurityPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + protos.google.cloud.compute.v1.ISecurityPolicyList | null | undefined, + protos.google.cloud.compute.v1.ISecurityPolicy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISecurityPolicy[], + protos.google.cloud.compute.v1.IListSecurityPoliciesRequest | null, + protos.google.cloud.compute.v1.ISecurityPolicyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [SecurityPolicy]{@link google.cloud.compute.v1.SecurityPolicy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [SecurityPolicy]{@link google.cloud.compute.v1.SecurityPolicy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListSecurityPoliciesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.securityPoliciesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/security_policies_client_config.json b/src/v1/security_policies_client_config.json new file mode 100644 index 00000000..e072433a --- /dev/null +++ b/src/v1/security_policies_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.compute.v1.SecurityPolicies": { + "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": { + "AddRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPreconfiguredExpressionSets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PatchRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveRule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/security_policies_proto_list.json b/src/v1/security_policies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/security_policies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/snapshots_client.ts b/src/v1/snapshots_client.ts new file mode 100644 index 00000000..84053749 --- /dev/null +++ b/src/v1/snapshots_client.ts @@ -0,0 +1,1130 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/snapshots_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './snapshots_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Snapshots API. + * @class + * @memberof v1 + */ +export class SnapshotsClient { + 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}; + snapshotsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SnapshotsClient. + * + * @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 SnapshotsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Snapshots', + 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 = gax.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.snapshotsStub) { + return this.snapshotsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Snapshots. + this.snapshotsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Snapshots' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Snapshots, + 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 snapshotsStubMethods = [ + 'delete', + 'get', + 'getIamPolicy', + 'list', + 'setIamPolicy', + 'setLabels', + 'testIamPermissions', + ]; + for (const methodName of snapshotsStubMethods) { + const callPromise = this.snapshotsStub.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.snapshotsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteSnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSnapshotRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteSnapshotRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot. + * + * For more information, see Deleting snapshots. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.snapshot + * Name of the Snapshot resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetSnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISnapshot, + protos.google.cloud.compute.v1.IGetSnapshotRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISnapshot, + protos.google.cloud.compute.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetSnapshotRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISnapshot, + protos.google.cloud.compute.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified Snapshot resource. Gets a list of available snapshots by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.snapshot + * Name of the Snapshot resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Snapshot]{@link google.cloud.compute.v1.Snapshot}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISnapshot, + protos.google.cloud.compute.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISnapshot, + protos.google.cloud.compute.v1.IGetSnapshotRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISnapshot, + protos.google.cloud.compute.v1.IGetSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicySnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetPolicyRequest} request.globalSetPolicyRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicySnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest | undefined, + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.GlobalSetLabelsRequest} request.globalSetLabelsRequestResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsSnapshotRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListSnapshotsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISnapshot[], + protos.google.cloud.compute.v1.IListSnapshotsRequest | null, + protos.google.cloud.compute.v1.ISnapshotList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListSnapshotsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSnapshotsRequest, + protos.google.cloud.compute.v1.ISnapshotList | null | undefined, + protos.google.cloud.compute.v1.ISnapshot + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListSnapshotsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSnapshotsRequest, + protos.google.cloud.compute.v1.ISnapshotList | null | undefined, + protos.google.cloud.compute.v1.ISnapshot + > + ): void; + /** + * Retrieves the list of Snapshot resources contained within the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Snapshot]{@link google.cloud.compute.v1.Snapshot}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListSnapshotsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListSnapshotsRequest, + protos.google.cloud.compute.v1.ISnapshotList | null | undefined, + protos.google.cloud.compute.v1.ISnapshot + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListSnapshotsRequest, + protos.google.cloud.compute.v1.ISnapshotList | null | undefined, + protos.google.cloud.compute.v1.ISnapshot + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISnapshot[], + protos.google.cloud.compute.v1.IListSnapshotsRequest | null, + protos.google.cloud.compute.v1.ISnapshotList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Snapshot]{@link google.cloud.compute.v1.Snapshot} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListSnapshotsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Snapshot]{@link google.cloud.compute.v1.Snapshot}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListSnapshotsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.snapshotsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/snapshots_client_config.json b/src/v1/snapshots_client_config.json new file mode 100644 index 00000000..4449801d --- /dev/null +++ b/src/v1/snapshots_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Snapshots": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/snapshots_proto_list.json b/src/v1/snapshots_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/snapshots_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/ssl_certificates_client.ts b/src/v1/ssl_certificates_client.ts new file mode 100644 index 00000000..bb040297 --- /dev/null +++ b/src/v1/ssl_certificates_client.ts @@ -0,0 +1,929 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/ssl_certificates_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './ssl_certificates_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The SslCertificates API. + * @class + * @memberof v1 + */ +export class SslCertificatesClient { + 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}; + sslCertificatesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SslCertificatesClient. + * + * @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 SslCertificatesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.SslCertificates', + 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 = gax.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.sslCertificatesStub) { + return this.sslCertificatesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.SslCertificates. + this.sslCertificatesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.SslCertificates' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.SslCertificates, + 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 sslCertificatesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of sslCertificatesStubMethods) { + const callPromise = this.sslCertificatesStub.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.sslCertificatesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteSslCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSslCertificateRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteSslCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteSslCertificateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified SslCertificate resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sslCertificate + * Name of the SslCertificate resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteSslCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSslCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSslCertificateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetSslCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate, + protos.google.cloud.compute.v1.IGetSslCertificateRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetSslCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetSslCertificateRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified SslCertificate resource. Gets a list of available SSL certificates by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.sslCertificate + * Name of the SslCertificate resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SslCertificate]{@link google.cloud.compute.v1.SslCertificate}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetSslCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetSslCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISslCertificate, + | protos.google.cloud.compute.v1.IGetSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate, + protos.google.cloud.compute.v1.IGetSslCertificateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertSslCertificateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSslCertificateRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertSslCertificateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertSslCertificateRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a SslCertificate resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SslCertificate} request.sslCertificateResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertSslCertificateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSslCertificateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSslCertificateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSslCertificateRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Name of the project scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [SslCertificatesScopedList]{@link google.cloud.compute.v1.SslCertificatesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListSslCertificatesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ISslCertificatesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ISslCertificatesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListSslCertificatesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate[], + protos.google.cloud.compute.v1.IListSslCertificatesRequest | null, + protos.google.cloud.compute.v1.ISslCertificateList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListSslCertificatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListSslCertificatesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + > + ): void; + /** + * Retrieves the list of SslCertificate resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [SslCertificate]{@link google.cloud.compute.v1.SslCertificate}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListSslCertificatesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListSslCertificatesRequest, + protos.google.cloud.compute.v1.ISslCertificateList | null | undefined, + protos.google.cloud.compute.v1.ISslCertificate + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISslCertificate[], + protos.google.cloud.compute.v1.IListSslCertificatesRequest | null, + protos.google.cloud.compute.v1.ISslCertificateList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [SslCertificate]{@link google.cloud.compute.v1.SslCertificate} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListSslCertificatesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [SslCertificate]{@link google.cloud.compute.v1.SslCertificate}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListSslCertificatesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.sslCertificatesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/ssl_certificates_client_config.json b/src/v1/ssl_certificates_client_config.json new file mode 100644 index 00000000..1ed2c359 --- /dev/null +++ b/src/v1/ssl_certificates_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.SslCertificates": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/ssl_certificates_proto_list.json b/src/v1/ssl_certificates_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/ssl_certificates_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/ssl_policies_client.ts b/src/v1/ssl_policies_client.ts new file mode 100644 index 00000000..6a91bf1d --- /dev/null +++ b/src/v1/ssl_policies_client.ts @@ -0,0 +1,1048 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/ssl_policies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './ssl_policies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The SslPolicies API. + * @class + * @memberof v1 + */ +export class SslPoliciesClient { + 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}; + sslPoliciesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SslPoliciesClient. + * + * @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 SslPoliciesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.SslPolicies', + 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 = gax.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.sslPoliciesStub) { + return this.sslPoliciesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.SslPolicies. + this.sslPoliciesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.SslPolicies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.SslPolicies, + 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 sslPoliciesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'listAvailableFeatures', + 'patch', + ]; + for (const methodName of sslPoliciesStubMethods) { + const callPromise = this.sslPoliciesStub.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.sslPoliciesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteSslPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSslPolicyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteSslPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteSslPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sslPolicy + * Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteSslPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSslPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSslPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetSslPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISslPolicy, + protos.google.cloud.compute.v1.IGetSslPolicyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetSslPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISslPolicy, + protos.google.cloud.compute.v1.IGetSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetSslPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISslPolicy, + protos.google.cloud.compute.v1.IGetSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Lists all of the ordered rules present in a single specified policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.sslPolicy + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SslPolicy]{@link google.cloud.compute.v1.SslPolicy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetSslPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISslPolicy, + | protos.google.cloud.compute.v1.IGetSslPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISslPolicy, + protos.google.cloud.compute.v1.IGetSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISslPolicy, + protos.google.cloud.compute.v1.IGetSslPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertSslPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSslPolicyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertSslPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertSslPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SslPolicy} request.sslPolicyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertSslPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSslPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSslPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + listAvailableFeatures( + request?: protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, + ( + | protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest + | undefined + ), + {} | undefined + ] + >; + listAvailableFeatures( + request: protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, + | protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listAvailableFeatures( + request: protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, + | protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Lists all features that can be specified in the SSL policy when using custom profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 [SslPoliciesListAvailableFeaturesResponse]{@link google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse}. + * 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.listAvailableFeatures(request); + */ + listAvailableFeatures( + request?: protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, + | protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, + | protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse, + ( + | protos.google.cloud.compute.v1.IListAvailableFeaturesSslPoliciesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listAvailableFeatures(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchSslPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSslPolicyRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchSslPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchSslPolicyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified SSL policy with the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.sslPolicy + * Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {google.cloud.compute.v1.SslPolicy} request.sslPolicyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchSslPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchSslPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSslPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSslPolicyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListSslPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISslPolicy[], + protos.google.cloud.compute.v1.IListSslPoliciesRequest | null, + protos.google.cloud.compute.v1.ISslPoliciesList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListSslPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSslPoliciesRequest, + protos.google.cloud.compute.v1.ISslPoliciesList | null | undefined, + protos.google.cloud.compute.v1.ISslPolicy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListSslPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSslPoliciesRequest, + protos.google.cloud.compute.v1.ISslPoliciesList | null | undefined, + protos.google.cloud.compute.v1.ISslPolicy + > + ): void; + /** + * Lists all the SSL policies that have been configured for the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [SslPolicy]{@link google.cloud.compute.v1.SslPolicy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListSslPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListSslPoliciesRequest, + protos.google.cloud.compute.v1.ISslPoliciesList | null | undefined, + protos.google.cloud.compute.v1.ISslPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListSslPoliciesRequest, + protos.google.cloud.compute.v1.ISslPoliciesList | null | undefined, + protos.google.cloud.compute.v1.ISslPolicy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISslPolicy[], + protos.google.cloud.compute.v1.IListSslPoliciesRequest | null, + protos.google.cloud.compute.v1.ISslPoliciesList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [SslPolicy]{@link google.cloud.compute.v1.SslPolicy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListSslPoliciesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [SslPolicy]{@link google.cloud.compute.v1.SslPolicy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListSslPoliciesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.sslPoliciesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/ssl_policies_client_config.json b/src/v1/ssl_policies_client_config.json new file mode 100644 index 00000000..447f91a3 --- /dev/null +++ b/src/v1/ssl_policies_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.SslPolicies": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAvailableFeatures": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/ssl_policies_proto_list.json b/src/v1/ssl_policies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/ssl_policies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/subnetworks_client.ts b/src/v1/subnetworks_client.ts new file mode 100644 index 00000000..69a5a22d --- /dev/null +++ b/src/v1/subnetworks_client.ts @@ -0,0 +1,1804 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/subnetworks_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './subnetworks_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Subnetworks API. + * @class + * @memberof v1 + */ +export class SubnetworksClient { + 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}; + subnetworksStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SubnetworksClient. + * + * @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 SubnetworksClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + listUsable: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Subnetworks', + 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 = gax.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.subnetworksStub) { + return this.subnetworksStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Subnetworks. + this.subnetworksStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Subnetworks' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Subnetworks, + 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 subnetworksStubMethods = [ + 'aggregatedList', + 'delete', + 'expandIpCidrRange', + 'get', + 'getIamPolicy', + 'insert', + 'list', + 'listUsable', + 'patch', + 'setIamPolicy', + 'setPrivateIpGoogleAccess', + 'testIamPermissions', + ]; + for (const methodName of subnetworksStubMethods) { + const callPromise = this.subnetworksStub.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.subnetworksStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteSubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSubnetworkRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteSubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteSubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified subnetwork. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.subnetwork + * Name of the Subnetwork resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteSubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteSubnetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + expandIpCidrRange( + request?: protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest + | undefined + ), + {} | undefined + ] + >; + expandIpCidrRange( + request: protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + expandIpCidrRange( + request: protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Expands the IP CIDR range of the subnetwork to a specified value. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.subnetwork + * Name of the Subnetwork resource to update. + * @param {google.cloud.compute.v1.SubnetworksExpandIpCidrRangeRequest} request.subnetworksExpandIpCidrRangeRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.expandIpCidrRange(request); + */ + expandIpCidrRange( + request?: protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IExpandIpCidrRangeSubnetworkRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.expandIpCidrRange(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetSubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISubnetwork, + protos.google.cloud.compute.v1.IGetSubnetworkRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetSubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ISubnetwork, + protos.google.cloud.compute.v1.IGetSubnetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetSubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.ISubnetwork, + protos.google.cloud.compute.v1.IGetSubnetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified subnetwork. Gets a list of available subnetworks list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.subnetwork + * Name of the Subnetwork resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Subnetwork]{@link google.cloud.compute.v1.Subnetwork}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetSubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ISubnetwork, + | protos.google.cloud.compute.v1.IGetSubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ISubnetwork, + protos.google.cloud.compute.v1.IGetSubnetworkRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISubnetwork, + protos.google.cloud.compute.v1.IGetSubnetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest | undefined, + {} | undefined + ] + >; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getIamPolicy( + request: protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the access control policy for a resource. May be empty if no such policy or resource exists. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.optionsRequestedPolicyVersion + * Requested IAM Policy version. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.getIamPolicy(request); + */ + getIamPolicy( + request?: protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.IGetIamPolicySubnetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getIamPolicy(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertSubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSubnetworkRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertSubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertSubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a subnetwork in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.Subnetwork} request.subnetworkResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertSubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertSubnetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchSubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSubnetworkRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchSubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSubnetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchSubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSubnetworkRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified subnetwork with the data included in the request. Only certain fields can be updated with a patch request as indicated in the field descriptions. You must specify the current fingerprint of the subnetwork resource being patched. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.drainTimeoutSeconds + * The drain timeout specifies the upper bound in seconds on the amount of time allowed to drain connections from the current ACTIVE subnetwork to the current BACKUP subnetwork. The drain timeout is only applicable when the following conditions are true: - the subnetwork being patched has purpose = INTERNAL_HTTPS_LOAD_BALANCER - the subnetwork being patched has role = BACKUP - the patch request is setting the role to ACTIVE. Note that after this patch operation the roles of the ACTIVE and BACKUP subnetworks will be swapped. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.subnetwork + * Name of the Subnetwork resource to patch. + * @param {google.cloud.compute.v1.Subnetwork} request.subnetworkResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchSubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchSubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSubnetworkRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchSubnetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest | undefined, + {} | undefined + ] + >; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setIamPolicy( + request: protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {google.cloud.compute.v1.RegionSetPolicyRequest} request.regionSetPolicyRequestResource + * The body resource for this request + * @param {string} request.resource + * Name or id of the resource for 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 [Policy]{@link google.cloud.compute.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 + * const [response] = await client.setIamPolicy(request); + */ + setIamPolicy( + request?: protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IPolicy, + | protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IPolicy, + protos.google.cloud.compute.v1.ISetIamPolicySubnetworkRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setIamPolicy(request, options, callback); + } + setPrivateIpGoogleAccess( + request?: protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest + | undefined + ), + {} | undefined + ] + >; + setPrivateIpGoogleAccess( + request: protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setPrivateIpGoogleAccess( + request: protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.subnetwork + * Name of the Subnetwork resource. + * @param {google.cloud.compute.v1.SubnetworksSetPrivateIpGoogleAccessRequest} request.subnetworksSetPrivateIpGoogleAccessRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setPrivateIpGoogleAccess(request); + */ + setPrivateIpGoogleAccess( + request?: protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetPrivateIpGoogleAccessSubnetworkRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setPrivateIpGoogleAccess( + request, + options, + callback + ); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsSubnetworkRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [SubnetworksScopedList]{@link google.cloud.compute.v1.SubnetworksScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListSubnetworksRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ISubnetworksScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ISubnetworksScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListSubnetworksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ISubnetwork[], + protos.google.cloud.compute.v1.IListSubnetworksRequest | null, + protos.google.cloud.compute.v1.ISubnetworkList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListSubnetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSubnetworksRequest, + protos.google.cloud.compute.v1.ISubnetworkList | null | undefined, + protos.google.cloud.compute.v1.ISubnetwork + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListSubnetworksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListSubnetworksRequest, + protos.google.cloud.compute.v1.ISubnetworkList | null | undefined, + protos.google.cloud.compute.v1.ISubnetwork + > + ): void; + /** + * Retrieves a list of subnetworks available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Subnetwork]{@link google.cloud.compute.v1.Subnetwork}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListSubnetworksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListSubnetworksRequest, + protos.google.cloud.compute.v1.ISubnetworkList | null | undefined, + protos.google.cloud.compute.v1.ISubnetwork + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListSubnetworksRequest, + protos.google.cloud.compute.v1.ISubnetworkList | null | undefined, + protos.google.cloud.compute.v1.ISubnetwork + > + ): Promise< + [ + protos.google.cloud.compute.v1.ISubnetwork[], + protos.google.cloud.compute.v1.IListSubnetworksRequest | null, + protos.google.cloud.compute.v1.ISubnetworkList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Subnetwork]{@link google.cloud.compute.v1.Subnetwork} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListSubnetworksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Subnetwork]{@link google.cloud.compute.v1.Subnetwork}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListSubnetworksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listUsable( + request?: protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IUsableSubnetwork[], + protos.google.cloud.compute.v1.IListUsableSubnetworksRequest | null, + protos.google.cloud.compute.v1.IUsableSubnetworksAggregatedList + ] + >; + listUsable( + request: protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + | protos.google.cloud.compute.v1.IUsableSubnetworksAggregatedList + | null + | undefined, + protos.google.cloud.compute.v1.IUsableSubnetwork + > + ): void; + listUsable( + request: protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + | protos.google.cloud.compute.v1.IUsableSubnetworksAggregatedList + | null + | undefined, + protos.google.cloud.compute.v1.IUsableSubnetwork + > + ): void; + /** + * Retrieves an aggregated list of all usable subnetworks in the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [UsableSubnetwork]{@link google.cloud.compute.v1.UsableSubnetwork}. + * 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 `listUsableAsync()` + * 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. + */ + listUsable( + request?: protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + | protos.google.cloud.compute.v1.IUsableSubnetworksAggregatedList + | null + | undefined, + protos.google.cloud.compute.v1.IUsableSubnetwork + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + | protos.google.cloud.compute.v1.IUsableSubnetworksAggregatedList + | null + | undefined, + protos.google.cloud.compute.v1.IUsableSubnetwork + > + ): Promise< + [ + protos.google.cloud.compute.v1.IUsableSubnetwork[], + protos.google.cloud.compute.v1.IListUsableSubnetworksRequest | null, + protos.google.cloud.compute.v1.IUsableSubnetworksAggregatedList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.listUsable(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [UsableSubnetwork]{@link google.cloud.compute.v1.UsableSubnetwork} 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 `listUsableAsync()` + * 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. + */ + listUsableStream( + request?: protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listUsable.createStream( + this.innerApiCalls.listUsable as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listUsable`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [UsableSubnetwork]{@link google.cloud.compute.v1.UsableSubnetwork}. 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.listUsableAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listUsableAsync( + request?: protos.google.cloud.compute.v1.IListUsableSubnetworksRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listUsable.asyncIterate( + this.innerApiCalls['listUsable'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.subnetworksStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/subnetworks_client_config.json b/src/v1/subnetworks_client_config.json new file mode 100644 index 00000000..b850981a --- /dev/null +++ b/src/v1/subnetworks_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Subnetworks": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ExpandIpCidrRange": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListUsable": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetIamPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetPrivateIpGoogleAccess": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/subnetworks_proto_list.json b/src/v1/subnetworks_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/subnetworks_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_grpc_proxies_client.ts b/src/v1/target_grpc_proxies_client.ts new file mode 100644 index 00000000..9002852e --- /dev/null +++ b/src/v1/target_grpc_proxies_client.ts @@ -0,0 +1,956 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_grpc_proxies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_grpc_proxies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetGrpcProxies API. + * @class + * @memberof v1 + */ +export class TargetGrpcProxiesClient { + 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}; + targetGrpcProxiesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetGrpcProxiesClient. + * + * @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 TargetGrpcProxiesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetGrpcProxies', + 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 = gax.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.targetGrpcProxiesStub) { + return this.targetGrpcProxiesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetGrpcProxies. + this.targetGrpcProxiesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetGrpcProxies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetGrpcProxies, + 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 targetGrpcProxiesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'patch', + ]; + for (const methodName of targetGrpcProxiesStubMethods) { + const callPromise = this.targetGrpcProxiesStub.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.targetGrpcProxiesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetGrpcProxy in the given scope + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetGrpcProxy + * Name of the TargetGrpcProxy resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetGrpcProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetGrpcProxy, + protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetGrpcProxy, + | protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetGrpcProxy, + | protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetGrpcProxy resource in the given scope. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.targetGrpcProxy + * Name of the TargetGrpcProxy resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetGrpcProxy]{@link google.cloud.compute.v1.TargetGrpcProxy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetGrpcProxy, + | protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetGrpcProxy, + | protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetGrpcProxy, + protos.google.cloud.compute.v1.IGetTargetGrpcProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetGrpcProxy} request.targetGrpcProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetGrpcProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified TargetGrpcProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetGrpcProxy + * Name of the TargetGrpcProxy resource to patch. + * @param {google.cloud.compute.v1.TargetGrpcProxy} request.targetGrpcProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchTargetGrpcProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetGrpcProxy[], + protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetGrpcProxyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + protos.google.cloud.compute.v1.ITargetGrpcProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetGrpcProxy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + protos.google.cloud.compute.v1.ITargetGrpcProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetGrpcProxy + > + ): void; + /** + * Lists the TargetGrpcProxies for a project in the given scope. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetGrpcProxy]{@link google.cloud.compute.v1.TargetGrpcProxy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + | protos.google.cloud.compute.v1.ITargetGrpcProxyList + | null + | undefined, + protos.google.cloud.compute.v1.ITargetGrpcProxy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + protos.google.cloud.compute.v1.ITargetGrpcProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetGrpcProxy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetGrpcProxy[], + protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetGrpcProxyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetGrpcProxy]{@link google.cloud.compute.v1.TargetGrpcProxy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetGrpcProxy]{@link google.cloud.compute.v1.TargetGrpcProxy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetGrpcProxiesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetGrpcProxiesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_grpc_proxies_client_config.json b/src/v1/target_grpc_proxies_client_config.json new file mode 100644 index 00000000..1c2f425e --- /dev/null +++ b/src/v1/target_grpc_proxies_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetGrpcProxies": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_grpc_proxies_proto_list.json b/src/v1/target_grpc_proxies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_grpc_proxies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_http_proxies_client.ts b/src/v1/target_http_proxies_client.ts new file mode 100644 index 00000000..96bde05f --- /dev/null +++ b/src/v1/target_http_proxies_client.ts @@ -0,0 +1,1141 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_http_proxies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_http_proxies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetHttpProxies API. + * @class + * @memberof v1 + */ +export class TargetHttpProxiesClient { + 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}; + targetHttpProxiesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetHttpProxiesClient. + * + * @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 TargetHttpProxiesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetHttpProxies', + 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 = gax.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.targetHttpProxiesStub) { + return this.targetHttpProxiesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetHttpProxies. + this.targetHttpProxiesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetHttpProxies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetHttpProxies, + 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 targetHttpProxiesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'setUrlMap', + ]; + for (const methodName of targetHttpProxiesStubMethods) { + const callPromise = this.targetHttpProxiesStub.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.targetHttpProxiesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetHttpProxy resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpProxy + * Name of the TargetHttpProxy resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetHttpProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy, + protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetHttpProxy resource. Gets a list of available target HTTP proxies by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.targetHttpProxy + * Name of the TargetHttpProxy resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetHttpProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy, + protos.google.cloud.compute.v1.IGetTargetHttpProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetHttpProxy resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetHttpProxy} request.targetHttpProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetHttpProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified TargetHttpProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpProxy + * Name of the TargetHttpProxy resource to patch. + * @param {google.cloud.compute.v1.TargetHttpProxy} request.targetHttpProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchTargetHttpProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + >; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the URL map for TargetHttpProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpProxy + * Name of the TargetHttpProxy to set a URL map for. + * @param {google.cloud.compute.v1.UrlMapReference} request.urlMapReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setUrlMap(request); + */ + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setUrlMap(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Name of the project scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [TargetHttpProxiesScopedList]{@link google.cloud.compute.v1.TargetHttpProxiesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListTargetHttpProxiesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetHttpProxiesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetHttpProxiesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy[], + protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpProxyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + > + ): void; + /** + * Retrieves the list of TargetHttpProxy resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + | protos.google.cloud.compute.v1.ITargetHttpProxyList + | null + | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpProxy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpProxy[], + protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpProxyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetHttpProxy]{@link google.cloud.compute.v1.TargetHttpProxy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetHttpProxiesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetHttpProxiesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_http_proxies_client_config.json b/src/v1/target_http_proxies_client_config.json new file mode 100644 index 00000000..6451b518 --- /dev/null +++ b/src/v1/target_http_proxies_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetHttpProxies": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetUrlMap": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_http_proxies_proto_list.json b/src/v1/target_http_proxies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_http_proxies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_https_proxies_client.ts b/src/v1/target_https_proxies_client.ts new file mode 100644 index 00000000..ec288ca8 --- /dev/null +++ b/src/v1/target_https_proxies_client.ts @@ -0,0 +1,1465 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_https_proxies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_https_proxies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetHttpsProxies API. + * @class + * @memberof v1 + */ +export class TargetHttpsProxiesClient { + 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}; + targetHttpsProxiesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetHttpsProxiesClient. + * + * @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 TargetHttpsProxiesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetHttpsProxies', + 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 = gax.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.targetHttpsProxiesStub) { + return this.targetHttpsProxiesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetHttpsProxies. + this.targetHttpsProxiesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetHttpsProxies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetHttpsProxies, + 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 targetHttpsProxiesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + 'patch', + 'setQuicOverride', + 'setSslCertificates', + 'setSslPolicy', + 'setUrlMap', + ]; + for (const methodName of targetHttpsProxiesStubMethods) { + const callPromise = this.targetHttpsProxiesStub.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.targetHttpsProxiesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetHttpsProxy resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetHttpsProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy, + protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetHttpsProxy resource. Gets a list of available target HTTPS proxies by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetHttpsProxy, + | protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy, + protos.google.cloud.compute.v1.IGetTargetHttpsProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetHttpsProxy resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetHttpsProxy} request.targetHttpsProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetHttpsProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. (== suppress_warning http-rest-shadowed ==) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to patch. + * @param {google.cloud.compute.v1.TargetHttpsProxy} request.targetHttpsProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchTargetHttpsProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + setQuicOverride( + request?: protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + setQuicOverride( + request: protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setQuicOverride( + request: protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the QUIC override policy for TargetHttpsProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetHttpsProxiesSetQuicOverrideRequest} request.targetHttpsProxiesSetQuicOverrideRequestResource + * The body resource for this request + * @param {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setQuicOverride(request); + */ + setQuicOverride( + request?: protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetQuicOverrideTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setQuicOverride(request, options, callback); + } + setSslCertificates( + request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + setSslCertificates( + request: protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setSslCertificates( + request: protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Replaces SslCertificates for TargetHttpsProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetHttpsProxiesSetSslCertificatesRequest} request.targetHttpsProxiesSetSslCertificatesRequestResource + * The body resource for this request + * @param {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setSslCertificates(request); + */ + setSslCertificates( + request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setSslCertificates(request, options, callback); + } + setSslPolicy( + request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + setSslPolicy( + request: protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setSslPolicy( + request: protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the HTTPS proxy load balancer. They do not affect the connection between the load balancer and the backends. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SslPolicyReference} request.sslPolicyReferenceResource + * The body resource for this request + * @param {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setSslPolicy(request); + */ + setSslPolicy( + request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslPolicyTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setSslPolicy(request, options, callback); + } + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + >; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setUrlMap( + request: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the URL map for TargetHttpsProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetHttpsProxy + * Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param {google.cloud.compute.v1.UrlMapReference} request.urlMapReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setUrlMap(request); + */ + setUrlMap( + request?: protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetUrlMapTargetHttpsProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setUrlMap(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Name of the project scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [TargetHttpsProxiesScopedList]{@link google.cloud.compute.v1.TargetHttpsProxiesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListTargetHttpsProxiesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetHttpsProxiesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetHttpsProxiesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy[], + protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpsProxyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpsProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpsProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + > + ): void; + /** + * Retrieves the list of TargetHttpsProxy resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + | protos.google.cloud.compute.v1.ITargetHttpsProxyList + | null + | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + protos.google.cloud.compute.v1.ITargetHttpsProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetHttpsProxy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetHttpsProxy[], + protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetHttpsProxyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetHttpsProxy]{@link google.cloud.compute.v1.TargetHttpsProxy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetHttpsProxiesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetHttpsProxiesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_https_proxies_client_config.json b/src/v1/target_https_proxies_client_config.json new file mode 100644 index 00000000..94b50445 --- /dev/null +++ b/src/v1/target_https_proxies_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetHttpsProxies": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetQuicOverride": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetSslCertificates": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetSslPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetUrlMap": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_https_proxies_proto_list.json b/src/v1/target_https_proxies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_https_proxies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_instances_client.ts b/src/v1/target_instances_client.ts new file mode 100644 index 00000000..2faf0da2 --- /dev/null +++ b/src/v1/target_instances_client.ts @@ -0,0 +1,941 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_instances_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_instances_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetInstances API. + * @class + * @memberof v1 + */ +export class TargetInstancesClient { + 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}; + targetInstancesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetInstancesClient. + * + * @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 TargetInstancesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetInstances', + 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 = gax.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.targetInstancesStub) { + return this.targetInstancesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetInstances. + this.targetInstancesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetInstances' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetInstances, + 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 targetInstancesStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of targetInstancesStubMethods) { + const callPromise = this.targetInstancesStub.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.targetInstancesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetInstance resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetInstance + * Name of the TargetInstance resource to delete. + * @param {string} request.zone + * Name of the zone scoping 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetInstance, + protos.google.cloud.compute.v1.IGetTargetInstanceRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetInstance, + | protos.google.cloud.compute.v1.IGetTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetInstance, + | protos.google.cloud.compute.v1.IGetTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetInstance resource. Gets a list of available target instances by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.targetInstance + * Name of the TargetInstance resource to return. + * @param {string} request.zone + * Name of the zone scoping 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 [TargetInstance]{@link google.cloud.compute.v1.TargetInstance}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetInstance, + | protos.google.cloud.compute.v1.IGetTargetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetInstance, + | protos.google.cloud.compute.v1.IGetTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetInstance, + protos.google.cloud.compute.v1.IGetTargetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetInstanceRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetInstanceRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetInstance resource in the specified project and zone using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetInstance} request.targetInstanceResource + * The body resource for this request + * @param {string} request.zone + * Name of the zone scoping 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetInstanceRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [TargetInstancesScopedList]{@link google.cloud.compute.v1.TargetInstancesScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListTargetInstancesRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetInstancesScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetInstancesScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListTargetInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetInstance[], + protos.google.cloud.compute.v1.IListTargetInstancesRequest | null, + protos.google.cloud.compute.v1.ITargetInstanceList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetInstancesRequest, + protos.google.cloud.compute.v1.ITargetInstanceList | null | undefined, + protos.google.cloud.compute.v1.ITargetInstance + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetInstancesRequest, + protos.google.cloud.compute.v1.ITargetInstanceList | null | undefined, + protos.google.cloud.compute.v1.ITargetInstance + > + ): void; + /** + * Retrieves a list of TargetInstance resources available to the specified project and zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone scoping 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 Array of [TargetInstance]{@link google.cloud.compute.v1.TargetInstance}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetInstancesRequest, + protos.google.cloud.compute.v1.ITargetInstanceList | null | undefined, + protos.google.cloud.compute.v1.ITargetInstance + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetInstancesRequest, + protos.google.cloud.compute.v1.ITargetInstanceList | null | undefined, + protos.google.cloud.compute.v1.ITargetInstance + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetInstance[], + protos.google.cloud.compute.v1.IListTargetInstancesRequest | null, + protos.google.cloud.compute.v1.ITargetInstanceList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone scoping this request. + * @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 [TargetInstance]{@link google.cloud.compute.v1.TargetInstance} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetInstancesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone scoping this request. + * @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 + * [TargetInstance]{@link google.cloud.compute.v1.TargetInstance}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetInstancesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetInstancesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_instances_client_config.json b/src/v1/target_instances_client_config.json new file mode 100644 index 00000000..b56ce469 --- /dev/null +++ b/src/v1/target_instances_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetInstances": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_instances_proto_list.json b/src/v1/target_instances_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_instances_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_pools_client.ts b/src/v1/target_pools_client.ts new file mode 100644 index 00000000..6b206330 --- /dev/null +++ b/src/v1/target_pools_client.ts @@ -0,0 +1,1573 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_pools_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_pools_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetPools API. + * @class + * @memberof v1 + */ +export class TargetPoolsClient { + 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}; + targetPoolsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetPoolsClient. + * + * @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 TargetPoolsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetPools', + 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 = gax.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.targetPoolsStub) { + return this.targetPoolsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetPools. + this.targetPoolsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetPools' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetPools, + 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 targetPoolsStubMethods = [ + 'addHealthCheck', + 'addInstance', + 'aggregatedList', + 'delete', + 'get', + 'getHealth', + 'insert', + 'list', + 'removeHealthCheck', + 'removeInstance', + 'setBackup', + ]; + for (const methodName of targetPoolsStubMethods) { + const callPromise = this.targetPoolsStub.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.targetPoolsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + addHealthCheck( + request?: protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest + | undefined + ), + {} | undefined + ] + >; + addHealthCheck( + request: protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addHealthCheck( + request: protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds health check URLs to a target pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetPool + * Name of the target pool to add a health check to. + * @param {google.cloud.compute.v1.TargetPoolsAddHealthCheckRequest} request.targetPoolsAddHealthCheckRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addHealthCheck(request); + */ + addHealthCheck( + request?: protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IAddHealthCheckTargetPoolRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addHealthCheck(request, options, callback); + } + addInstance( + request?: protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest | undefined, + {} | undefined + ] + >; + addInstance( + request: protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + addInstance( + request: protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Adds an instance to a target pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetPool + * Name of the TargetPool resource to add instances to. + * @param {google.cloud.compute.v1.TargetPoolsAddInstanceRequest} request.targetPoolsAddInstanceRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.addInstance(request); + */ + addInstance( + request?: protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IAddInstanceTargetPoolRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.addInstance(request, options, callback); + } + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetPoolRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified target pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetPool + * Name of the TargetPool resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetPoolRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetPool, + protos.google.cloud.compute.v1.IGetTargetPoolRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetPool, + protos.google.cloud.compute.v1.IGetTargetPoolRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetPool, + protos.google.cloud.compute.v1.IGetTargetPoolRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified target pool. Gets a list of available target pools by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.targetPool + * Name of the TargetPool resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetPool]{@link google.cloud.compute.v1.TargetPool}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetPool, + | protos.google.cloud.compute.v1.IGetTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetPool, + protos.google.cloud.compute.v1.IGetTargetPoolRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetPool, + protos.google.cloud.compute.v1.IGetTargetPoolRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getHealth( + request?: protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetPoolInstanceHealth, + protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest | undefined, + {} | undefined + ] + >; + getHealth( + request: protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetPoolInstanceHealth, + | protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getHealth( + request: protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetPoolInstanceHealth, + | protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the most recent health check results for each IP for the instance that is referenced by the given target pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.InstanceReference} request.instanceReferenceResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.targetPool + * Name of the TargetPool resource to which the queried instance belongs. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetPoolInstanceHealth]{@link google.cloud.compute.v1.TargetPoolInstanceHealth}. + * 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.getHealth(request); + */ + getHealth( + request?: protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetPoolInstanceHealth, + | protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetPoolInstanceHealth, + | protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetPoolInstanceHealth, + protos.google.cloud.compute.v1.IGetHealthTargetPoolRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getHealth(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetPoolRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a target pool in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetPool} request.targetPoolResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetPoolRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + removeHealthCheck( + request?: protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest + | undefined + ), + {} | undefined + ] + >; + removeHealthCheck( + request: protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeHealthCheck( + request: protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes health check URL from a target pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetPool + * Name of the target pool to remove health checks from. + * @param {google.cloud.compute.v1.TargetPoolsRemoveHealthCheckRequest} request.targetPoolsRemoveHealthCheckRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeHealthCheck(request); + */ + removeHealthCheck( + request?: protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveHealthCheckTargetPoolRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removeHealthCheck(request, options, callback); + } + removeInstance( + request?: protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest + | undefined + ), + {} | undefined + ] + >; + removeInstance( + request: protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + removeInstance( + request: protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Removes instance URL from a target pool. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetPool + * Name of the TargetPool resource to remove instances from. + * @param {google.cloud.compute.v1.TargetPoolsRemoveInstanceRequest} request.targetPoolsRemoveInstanceRequestResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.removeInstance(request); + */ + removeInstance( + request?: protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.IRemoveInstanceTargetPoolRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.removeInstance(request, options, callback); + } + setBackup( + request?: protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest | undefined, + {} | undefined + ] + >; + setBackup( + request: protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setBackup( + request: protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes a backup target pool's configurations. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.failoverRatio + * New failoverRatio value for the target pool. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetPool + * Name of the TargetPool resource to set a backup pool for. + * @param {google.cloud.compute.v1.TargetReference} request.targetReferenceResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setBackup(request); + */ + setBackup( + request?: protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetBackupTargetPoolRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setBackup(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [TargetPoolsScopedList]{@link google.cloud.compute.v1.TargetPoolsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListTargetPoolsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetPoolsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetPoolsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListTargetPoolsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetPool[], + protos.google.cloud.compute.v1.IListTargetPoolsRequest | null, + protos.google.cloud.compute.v1.ITargetPoolList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetPoolsRequest, + protos.google.cloud.compute.v1.ITargetPoolList | null | undefined, + protos.google.cloud.compute.v1.ITargetPool + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetPoolsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetPoolsRequest, + protos.google.cloud.compute.v1.ITargetPoolList | null | undefined, + protos.google.cloud.compute.v1.ITargetPool + > + ): void; + /** + * Retrieves a list of target pools available to the specified project and region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetPool]{@link google.cloud.compute.v1.TargetPool}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetPoolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetPoolsRequest, + protos.google.cloud.compute.v1.ITargetPoolList | null | undefined, + protos.google.cloud.compute.v1.ITargetPool + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetPoolsRequest, + protos.google.cloud.compute.v1.ITargetPoolList | null | undefined, + protos.google.cloud.compute.v1.ITargetPool + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetPool[], + protos.google.cloud.compute.v1.IListTargetPoolsRequest | null, + protos.google.cloud.compute.v1.ITargetPoolList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetPool]{@link google.cloud.compute.v1.TargetPool} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetPoolsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetPool]{@link google.cloud.compute.v1.TargetPool}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetPoolsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetPoolsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_pools_client_config.json b/src/v1/target_pools_client_config.json new file mode 100644 index 00000000..1fe0572f --- /dev/null +++ b/src/v1/target_pools_client_config.json @@ -0,0 +1,70 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetPools": { + "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": { + "AddHealthCheck": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetHealth": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveHealthCheck": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_pools_proto_list.json b/src/v1/target_pools_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_pools_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_ssl_proxies_client.ts b/src/v1/target_ssl_proxies_client.ts new file mode 100644 index 00000000..d0871538 --- /dev/null +++ b/src/v1/target_ssl_proxies_client.ts @@ -0,0 +1,1284 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_ssl_proxies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_ssl_proxies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetSslProxies API. + * @class + * @memberof v1 + */ +export class TargetSslProxiesClient { + 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}; + targetSslProxiesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetSslProxiesClient. + * + * @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 TargetSslProxiesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetSslProxies', + 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 = gax.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.targetSslProxiesStub) { + return this.targetSslProxiesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetSslProxies. + this.targetSslProxiesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetSslProxies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetSslProxies, + 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 targetSslProxiesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'setBackendService', + 'setProxyHeader', + 'setSslCertificates', + 'setSslPolicy', + ]; + for (const methodName of targetSslProxiesStubMethods) { + const callPromise = this.targetSslProxiesStub.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.targetSslProxiesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetSslProxy resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetSslProxy + * Name of the TargetSslProxy resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetSslProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetSslProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetSslProxy, + protos.google.cloud.compute.v1.IGetTargetSslProxyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetSslProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetSslProxy, + | protos.google.cloud.compute.v1.IGetTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetSslProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetSslProxy, + | protos.google.cloud.compute.v1.IGetTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.targetSslProxy + * Name of the TargetSslProxy resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetSslProxy]{@link google.cloud.compute.v1.TargetSslProxy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetSslProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetSslProxy, + | protos.google.cloud.compute.v1.IGetTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetSslProxy, + | protos.google.cloud.compute.v1.IGetTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetSslProxy, + protos.google.cloud.compute.v1.IGetTargetSslProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetSslProxy resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetSslProxy} request.targetSslProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetSslProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setBackendService( + request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + >; + setBackendService( + request: protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setBackendService( + request: protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the BackendService for TargetSslProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetSslProxiesSetBackendServiceRequest} request.targetSslProxiesSetBackendServiceRequestResource + * The body resource for this request + * @param {string} request.targetSslProxy + * Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setBackendService(request); + */ + setBackendService( + request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetBackendServiceTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setBackendService(request, options, callback); + } + setProxyHeader( + request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + >; + setProxyHeader( + request: protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setProxyHeader( + request: protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the ProxyHeaderType for TargetSslProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetSslProxiesSetProxyHeaderRequest} request.targetSslProxiesSetProxyHeaderRequestResource + * The body resource for this request + * @param {string} request.targetSslProxy + * Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setProxyHeader(request); + */ + setProxyHeader( + request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setProxyHeader(request, options, callback); + } + setSslCertificates( + request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + >; + setSslCertificates( + request: protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setSslCertificates( + request: protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes SslCertificates for TargetSslProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetSslProxiesSetSslCertificatesRequest} request.targetSslProxiesSetSslCertificatesRequestResource + * The body resource for this request + * @param {string} request.targetSslProxy + * Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setSslCertificates(request); + */ + setSslCertificates( + request?: protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslCertificatesTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setSslCertificates(request, options, callback); + } + setSslPolicy( + request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + >; + setSslPolicy( + request: protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setSslPolicy( + request: protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.SslPolicyReference} request.sslPolicyReferenceResource + * The body resource for this request + * @param {string} request.targetSslProxy + * Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setSslPolicy(request); + */ + setSslPolicy( + request?: protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetSslPolicyTargetSslProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setSslPolicy(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetSslProxy[], + protos.google.cloud.compute.v1.IListTargetSslProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetSslProxyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + protos.google.cloud.compute.v1.ITargetSslProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetSslProxy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + protos.google.cloud.compute.v1.ITargetSslProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetSslProxy + > + ): void; + /** + * Retrieves the list of TargetSslProxy resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetSslProxy]{@link google.cloud.compute.v1.TargetSslProxy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + protos.google.cloud.compute.v1.ITargetSslProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetSslProxy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + protos.google.cloud.compute.v1.ITargetSslProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetSslProxy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetSslProxy[], + protos.google.cloud.compute.v1.IListTargetSslProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetSslProxyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetSslProxy]{@link google.cloud.compute.v1.TargetSslProxy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetSslProxy]{@link google.cloud.compute.v1.TargetSslProxy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetSslProxiesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetSslProxiesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_ssl_proxies_client_config.json b/src/v1/target_ssl_proxies_client_config.json new file mode 100644 index 00000000..17dbfe89 --- /dev/null +++ b/src/v1/target_ssl_proxies_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetSslProxies": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetBackendService": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetProxyHeader": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetSslCertificates": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetSslPolicy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_ssl_proxies_proto_list.json b/src/v1/target_ssl_proxies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_ssl_proxies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_tcp_proxies_client.ts b/src/v1/target_tcp_proxies_client.ts new file mode 100644 index 00000000..d64db7a4 --- /dev/null +++ b/src/v1/target_tcp_proxies_client.ts @@ -0,0 +1,1068 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_tcp_proxies_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_tcp_proxies_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetTcpProxies API. + * @class + * @memberof v1 + */ +export class TargetTcpProxiesClient { + 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}; + targetTcpProxiesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetTcpProxiesClient. + * + * @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 TargetTcpProxiesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetTcpProxies', + 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 = gax.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.targetTcpProxiesStub) { + return this.targetTcpProxiesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetTcpProxies. + this.targetTcpProxiesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetTcpProxies' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetTcpProxies, + 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 targetTcpProxiesStubMethods = [ + 'delete', + 'get', + 'insert', + 'list', + 'setBackendService', + 'setProxyHeader', + ]; + for (const methodName of targetTcpProxiesStubMethods) { + const callPromise = this.targetTcpProxiesStub.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.targetTcpProxiesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified TargetTcpProxy resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetTcpProxy + * Name of the TargetTcpProxy resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetTcpProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetTcpProxy, + protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetTcpProxy, + | protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetTcpProxy, + | protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.targetTcpProxy + * Name of the TargetTcpProxy resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetTcpProxy]{@link google.cloud.compute.v1.TargetTcpProxy}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetTcpProxy, + | protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetTcpProxy, + | protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetTcpProxy, + protos.google.cloud.compute.v1.IGetTargetTcpProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a TargetTcpProxy resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetTcpProxy} request.targetTcpProxyResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetTcpProxyRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setBackendService( + request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest + | undefined + ), + {} | undefined + ] + >; + setBackendService( + request: protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setBackendService( + request: protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the BackendService for TargetTcpProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetTcpProxiesSetBackendServiceRequest} request.targetTcpProxiesSetBackendServiceRequestResource + * The body resource for this request + * @param {string} request.targetTcpProxy + * Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setBackendService(request); + */ + setBackendService( + request?: protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetBackendServiceTargetTcpProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setBackendService(request, options, callback); + } + setProxyHeader( + request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest + | undefined + ), + {} | undefined + ] + >; + setProxyHeader( + request: protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setProxyHeader( + request: protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Changes the ProxyHeaderType for TargetTcpProxy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetTcpProxiesSetProxyHeaderRequest} request.targetTcpProxiesSetProxyHeaderRequestResource + * The body resource for this request + * @param {string} request.targetTcpProxy + * Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setProxyHeader(request); + */ + setProxyHeader( + request?: protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + ( + | protos.google.cloud.compute.v1.ISetProxyHeaderTargetTcpProxyRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setProxyHeader(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetTcpProxy[], + protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetTcpProxyList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + protos.google.cloud.compute.v1.ITargetTcpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetTcpProxy + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + protos.google.cloud.compute.v1.ITargetTcpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetTcpProxy + > + ): void; + /** + * Retrieves the list of TargetTcpProxy resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetTcpProxy]{@link google.cloud.compute.v1.TargetTcpProxy}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + protos.google.cloud.compute.v1.ITargetTcpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetTcpProxy + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + protos.google.cloud.compute.v1.ITargetTcpProxyList | null | undefined, + protos.google.cloud.compute.v1.ITargetTcpProxy + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetTcpProxy[], + protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest | null, + protos.google.cloud.compute.v1.ITargetTcpProxyList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetTcpProxy]{@link google.cloud.compute.v1.TargetTcpProxy} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetTcpProxy]{@link google.cloud.compute.v1.TargetTcpProxy}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetTcpProxiesRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetTcpProxiesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_tcp_proxies_client_config.json b/src/v1/target_tcp_proxies_client_config.json new file mode 100644 index 00000000..e453ef89 --- /dev/null +++ b/src/v1/target_tcp_proxies_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetTcpProxies": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetBackendService": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetProxyHeader": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_tcp_proxies_proto_list.json b/src/v1/target_tcp_proxies_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_tcp_proxies_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/target_vpn_gateways_client.ts b/src/v1/target_vpn_gateways_client.ts new file mode 100644 index 00000000..503ad620 --- /dev/null +++ b/src/v1/target_vpn_gateways_client.ts @@ -0,0 +1,943 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/target_vpn_gateways_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './target_vpn_gateways_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The TargetVpnGateways API. + * @class + * @memberof v1 + */ +export class TargetVpnGatewaysClient { + 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}; + targetVpnGatewaysStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TargetVpnGatewaysClient. + * + * @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 TargetVpnGatewaysClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.TargetVpnGateways', + 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 = gax.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.targetVpnGatewaysStub) { + return this.targetVpnGatewaysStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.TargetVpnGateways. + this.targetVpnGatewaysStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.TargetVpnGateways' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.TargetVpnGateways, + 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 targetVpnGatewaysStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of targetVpnGatewaysStubMethods) { + const callPromise = this.targetVpnGatewaysStub.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.targetVpnGatewaysStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified target VPN gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.targetVpnGateway + * Name of the target VPN gateway to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteTargetVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetVpnGateway, + protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITargetVpnGateway, + | protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITargetVpnGateway, + | protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.targetVpnGateway + * Name of the target VPN gateway to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TargetVpnGateway]{@link google.cloud.compute.v1.TargetVpnGateway}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITargetVpnGateway, + | protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITargetVpnGateway, + | protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetVpnGateway, + protos.google.cloud.compute.v1.IGetTargetVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a target VPN gateway in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.TargetVpnGateway} request.targetVpnGatewayResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertTargetVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [TargetVpnGatewaysScopedList]{@link google.cloud.compute.v1.TargetVpnGatewaysScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListTargetVpnGatewaysRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetVpnGatewaysScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.ITargetVpnGatewaysScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetVpnGateway[], + protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest | null, + protos.google.cloud.compute.v1.ITargetVpnGatewayList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + protos.google.cloud.compute.v1.ITargetVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.ITargetVpnGateway + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + protos.google.cloud.compute.v1.ITargetVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.ITargetVpnGateway + > + ): void; + /** + * Retrieves a list of target VPN gateways available to the specified project and region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [TargetVpnGateway]{@link google.cloud.compute.v1.TargetVpnGateway}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + | protos.google.cloud.compute.v1.ITargetVpnGatewayList + | null + | undefined, + protos.google.cloud.compute.v1.ITargetVpnGateway + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + protos.google.cloud.compute.v1.ITargetVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.ITargetVpnGateway + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITargetVpnGateway[], + protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest | null, + protos.google.cloud.compute.v1.ITargetVpnGatewayList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [TargetVpnGateway]{@link google.cloud.compute.v1.TargetVpnGateway} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [TargetVpnGateway]{@link google.cloud.compute.v1.TargetVpnGateway}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListTargetVpnGatewaysRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.targetVpnGatewaysStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/target_vpn_gateways_client_config.json b/src/v1/target_vpn_gateways_client_config.json new file mode 100644 index 00000000..2c373714 --- /dev/null +++ b/src/v1/target_vpn_gateways_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.TargetVpnGateways": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/target_vpn_gateways_proto_list.json b/src/v1/target_vpn_gateways_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/target_vpn_gateways_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/url_maps_client.ts b/src/v1/url_maps_client.ts new file mode 100644 index 00000000..c845c859 --- /dev/null +++ b/src/v1/url_maps_client.ts @@ -0,0 +1,1293 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/url_maps_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './url_maps_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The UrlMaps API. + * @class + * @memberof v1 + */ +export class UrlMapsClient { + 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}; + urlMapsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of UrlMapsClient. + * + * @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 UrlMapsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.UrlMaps', + 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 = gax.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.urlMapsStub) { + return this.urlMapsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.UrlMaps. + this.urlMapsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.UrlMaps' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.UrlMaps, + 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 urlMapsStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'invalidateCache', + 'list', + 'patch', + 'update', + 'validate', + ]; + for (const methodName of urlMapsStubMethods) { + const callPromise = this.urlMapsStub.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.urlMapsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteUrlMapRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified UrlMap resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.urlMap + * Name of the UrlMap resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteUrlMapRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetUrlMapRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.urlMap + * Name of the UrlMap resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [UrlMap]{@link google.cloud.compute.v1.UrlMap}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetUrlMapRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetUrlMapRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap, + protos.google.cloud.compute.v1.IGetUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertUrlMapRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a UrlMap resource in the specified project using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.UrlMap} request.urlMapResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertUrlMapRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + invalidateCache( + request?: protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest | undefined, + {} | undefined + ] + >; + invalidateCache( + request: protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + invalidateCache( + request: protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap. + * + * For more information, see [Invalidating cached content](https://cloud.google.com/cdn/docs/invalidating-cached-content). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.compute.v1.CacheInvalidationRule} request.cacheInvalidationRuleResource + * The body resource for this request + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.urlMap + * Name of the UrlMap scoping 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.invalidateCache(request); + */ + invalidateCache( + request?: protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInvalidateCacheUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.invalidateCache(request, options, callback); + } + patch( + request?: protos.google.cloud.compute.v1.IPatchUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchUrlMapRequest | undefined, + {} | undefined + ] + >; + patch( + request: protos.google.cloud.compute.v1.IPatchUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + patch( + request: protos.google.cloud.compute.v1.IPatchUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.urlMap + * Name of the UrlMap resource to patch. + * @param {google.cloud.compute.v1.UrlMap} request.urlMapResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.patch(request); + */ + patch( + request?: protos.google.cloud.compute.v1.IPatchUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchUrlMapRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchUrlMapRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IPatchUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.patch(request, options, callback); + } + update( + request?: protos.google.cloud.compute.v1.IUpdateUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateUrlMapRequest | undefined, + {} | undefined + ] + >; + update( + request: protos.google.cloud.compute.v1.IUpdateUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + update( + request: protos.google.cloud.compute.v1.IUpdateUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified UrlMap resource with the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.urlMap + * Name of the UrlMap resource to update. + * @param {google.cloud.compute.v1.UrlMap} request.urlMapResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.update(request); + */ + update( + request?: protos.google.cloud.compute.v1.IUpdateUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IUpdateUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateUrlMapRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IUpdateUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.update(request, options, callback); + } + validate( + request?: protos.google.cloud.compute.v1.IValidateUrlMapRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + protos.google.cloud.compute.v1.IValidateUrlMapRequest | undefined, + {} | undefined + ] + >; + validate( + request: protos.google.cloud.compute.v1.IValidateUrlMapRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + protos.google.cloud.compute.v1.IValidateUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + validate( + request: protos.google.cloud.compute.v1.IValidateUrlMapRequest, + callback: Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + protos.google.cloud.compute.v1.IValidateUrlMapRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.urlMap + * Name of the UrlMap resource to be validated as. + * @param {google.cloud.compute.v1.UrlMapsValidateRequest} request.urlMapsValidateRequestResource + * The body resource for 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 [UrlMapsValidateResponse]{@link google.cloud.compute.v1.UrlMapsValidateResponse}. + * 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.validate(request); + */ + validate( + request?: protos.google.cloud.compute.v1.IValidateUrlMapRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + | protos.google.cloud.compute.v1.IValidateUrlMapRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + protos.google.cloud.compute.v1.IValidateUrlMapRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMapsValidateResponse, + protos.google.cloud.compute.v1.IValidateUrlMapRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.validate(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Name of the project scoping this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [UrlMapsScopedList]{@link google.cloud.compute.v1.UrlMapsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListUrlMapsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IUrlMapsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IUrlMapsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListUrlMapsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap[], + protos.google.cloud.compute.v1.IListUrlMapsRequest | null, + protos.google.cloud.compute.v1.IUrlMapList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListUrlMapsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListUrlMapsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + > + ): void; + /** + * Retrieves the list of UrlMap resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [UrlMap]{@link google.cloud.compute.v1.UrlMap}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListUrlMapsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListUrlMapsRequest, + protos.google.cloud.compute.v1.IUrlMapList | null | undefined, + protos.google.cloud.compute.v1.IUrlMap + > + ): Promise< + [ + protos.google.cloud.compute.v1.IUrlMap[], + protos.google.cloud.compute.v1.IListUrlMapsRequest | null, + protos.google.cloud.compute.v1.IUrlMapList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [UrlMap]{@link google.cloud.compute.v1.UrlMap} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListUrlMapsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [UrlMap]{@link google.cloud.compute.v1.UrlMap}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListUrlMapsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.urlMapsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/url_maps_client_config.json b/src/v1/url_maps_client_config.json new file mode 100644 index 00000000..2bd3852a --- /dev/null +++ b/src/v1/url_maps_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.compute.v1.UrlMaps": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InvalidateCache": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Patch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Update": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Validate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/url_maps_proto_list.json b/src/v1/url_maps_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/url_maps_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/vpn_gateways_client.ts b/src/v1/vpn_gateways_client.ts new file mode 100644 index 00000000..e02a9914 --- /dev/null +++ b/src/v1/vpn_gateways_client.ts @@ -0,0 +1,1239 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/vpn_gateways_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vpn_gateways_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The VpnGateways API. + * @class + * @memberof v1 + */ +export class VpnGatewaysClient { + 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}; + vpnGatewaysStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VpnGatewaysClient. + * + * @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 VpnGatewaysClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.VpnGateways', + 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 = gax.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.vpnGatewaysStub) { + return this.vpnGatewaysStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.VpnGateways. + this.vpnGatewaysStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.VpnGateways' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.VpnGateways, + 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 vpnGatewaysStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'getStatus', + 'insert', + 'list', + 'setLabels', + 'testIamPermissions', + ]; + for (const methodName of vpnGatewaysStubMethods) { + const callPromise = this.vpnGatewaysStub.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.vpnGatewaysStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified VPN gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.vpnGateway + * Name of the VPN gateway to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnGateway, + protos.google.cloud.compute.v1.IGetVpnGatewayRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IVpnGateway, + protos.google.cloud.compute.v1.IGetVpnGatewayRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IVpnGateway, + protos.google.cloud.compute.v1.IGetVpnGatewayRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified VPN gateway. Gets a list of available VPN gateways by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.vpnGateway + * Name of the VPN gateway to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [VpnGateway]{@link google.cloud.compute.v1.VpnGateway}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IVpnGateway, + | protos.google.cloud.compute.v1.IGetVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IVpnGateway, + protos.google.cloud.compute.v1.IGetVpnGatewayRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnGateway, + protos.google.cloud.compute.v1.IGetVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + getStatus( + request?: protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, + protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest | undefined, + {} | undefined + ] + >; + getStatus( + request: protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, + | protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getStatus( + request: protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, + | protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the status for the specified VPN gateway. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.vpnGateway + * Name of the VPN gateway to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [VpnGatewaysGetStatusResponse]{@link google.cloud.compute.v1.VpnGatewaysGetStatusResponse}. + * 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.getStatus(request); + */ + getStatus( + request?: protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, + | protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, + | protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnGatewaysGetStatusResponse, + protos.google.cloud.compute.v1.IGetStatusVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.getStatus(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertVpnGatewayRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a VPN gateway in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.VpnGateway} request.vpnGatewayResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest | undefined, + {} | undefined + ] + >; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + setLabels( + request: protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Sets the labels on a VpnGateway. To learn more about labels, read the Labeling Resources documentation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The region for this request. + * @param {google.cloud.compute.v1.RegionSetLabelsRequest} request.regionSetLabelsRequestResource + * The body resource for this request + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.resource + * Name or id of the resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.setLabels(request); + */ + setLabels( + request?: protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.ISetLabelsVpnGatewayRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.setLabels(request, options, callback); + } + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest + | undefined + ), + {} | undefined + ] + >; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + testIamPermissions( + request: protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, + callback: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Returns permissions that a caller has on the specified resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * The name of the region for this request. + * @param {string} request.resource + * Name or id of the resource for this request. + * @param {google.cloud.compute.v1.TestPermissionsRequest} request.testPermissionsRequestResource + * The body resource for 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 [TestPermissionsResponse]{@link google.cloud.compute.v1.TestPermissionsResponse}. + * 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.testIamPermissions(request); + */ + testIamPermissions( + request?: protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.ITestPermissionsResponse, + | protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.ITestPermissionsResponse, + ( + | protos.google.cloud.compute.v1.ITestIamPermissionsVpnGatewayRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.testIamPermissions(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [VpnGatewaysScopedList]{@link google.cloud.compute.v1.VpnGatewaysScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListVpnGatewaysRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IVpnGatewaysScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IVpnGatewaysScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnGateway[], + protos.google.cloud.compute.v1.IListVpnGatewaysRequest | null, + protos.google.cloud.compute.v1.IVpnGatewayList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + protos.google.cloud.compute.v1.IVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.IVpnGateway + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + protos.google.cloud.compute.v1.IVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.IVpnGateway + > + ): void; + /** + * Retrieves a list of VPN gateways available to the specified project and region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [VpnGateway]{@link google.cloud.compute.v1.VpnGateway}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + protos.google.cloud.compute.v1.IVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.IVpnGateway + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + protos.google.cloud.compute.v1.IVpnGatewayList | null | undefined, + protos.google.cloud.compute.v1.IVpnGateway + > + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnGateway[], + protos.google.cloud.compute.v1.IListVpnGatewaysRequest | null, + protos.google.cloud.compute.v1.IVpnGatewayList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [VpnGateway]{@link google.cloud.compute.v1.VpnGateway} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [VpnGateway]{@link google.cloud.compute.v1.VpnGateway}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListVpnGatewaysRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.vpnGatewaysStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/vpn_gateways_client_config.json b/src/v1/vpn_gateways_client_config.json new file mode 100644 index 00000000..16eec681 --- /dev/null +++ b/src/v1/vpn_gateways_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.compute.v1.VpnGateways": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetStatus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SetLabels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TestIamPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/vpn_gateways_proto_list.json b/src/v1/vpn_gateways_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/vpn_gateways_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/vpn_tunnels_client.ts b/src/v1/vpn_tunnels_client.ts new file mode 100644 index 00000000..4dc8732e --- /dev/null +++ b/src/v1/vpn_tunnels_client.ts @@ -0,0 +1,923 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/vpn_tunnels_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vpn_tunnels_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The VpnTunnels API. + * @class + * @memberof v1 + */ +export class VpnTunnelsClient { + 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}; + vpnTunnelsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VpnTunnelsClient. + * + * @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 VpnTunnelsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + aggregatedList: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.VpnTunnels', + 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 = gax.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.vpnTunnelsStub) { + return this.vpnTunnelsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.VpnTunnels. + this.vpnTunnelsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.VpnTunnels' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.VpnTunnels, + 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 vpnTunnelsStubMethods = [ + 'aggregatedList', + 'delete', + 'get', + 'insert', + 'list', + ]; + for (const methodName of vpnTunnelsStubMethods) { + const callPromise = this.vpnTunnelsStub.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.vpnTunnelsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified VpnTunnel resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {string} request.vpnTunnel + * Name of the VpnTunnel resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IDeleteVpnTunnelRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetVpnTunnelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnTunnel, + protos.google.cloud.compute.v1.IGetVpnTunnelRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetVpnTunnelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IVpnTunnel, + protos.google.cloud.compute.v1.IGetVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetVpnTunnelRequest, + callback: Callback< + protos.google.cloud.compute.v1.IVpnTunnel, + protos.google.cloud.compute.v1.IGetVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.vpnTunnel + * Name of the VpnTunnel resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [VpnTunnel]{@link google.cloud.compute.v1.VpnTunnel}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetVpnTunnelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IVpnTunnel, + | protos.google.cloud.compute.v1.IGetVpnTunnelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IVpnTunnel, + protos.google.cloud.compute.v1.IGetVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnTunnel, + protos.google.cloud.compute.v1.IGetVpnTunnelRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + insert( + request?: protos.google.cloud.compute.v1.IInsertVpnTunnelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertVpnTunnelRequest | undefined, + {} | undefined + ] + >; + insert( + request: protos.google.cloud.compute.v1.IInsertVpnTunnelRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): void; + insert( + request: protos.google.cloud.compute.v1.IInsertVpnTunnelRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a VpnTunnel resource in the specified project and region using the data included in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {string} request.requestId + * An optional 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. + * + * 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 {google.cloud.compute.v1.VpnTunnel} request.vpnTunnelResource + * The body resource for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.insert(request); + */ + insert( + request?: protos.google.cloud.compute.v1.IInsertVpnTunnelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IInsertVpnTunnelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertVpnTunnelRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IInsertVpnTunnelRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.insert(request, options, callback); + } + + /** + * Equivalent to `aggregatedList`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {boolean} request.includeAllScopes + * Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * as tuple [string, [VpnTunnelsScopedList]{@link google.cloud.compute.v1.VpnTunnelsScopedList}]. 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.aggregatedListAsync(request); + * for await (const [key, value] of iterable) { + * // process response + * } + */ + aggregatedListAsync( + request?: protos.google.cloud.compute.v1.IAggregatedListVpnTunnelsRequest, + options?: CallOptions + ): AsyncIterable< + [string, protos.google.cloud.compute.v1.IVpnTunnelsScopedList] + > { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.aggregatedList.asyncIterate( + this.innerApiCalls['aggregatedList'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable< + [string, protos.google.cloud.compute.v1.IVpnTunnelsScopedList] + >; + } + list( + request?: protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnTunnel[], + protos.google.cloud.compute.v1.IListVpnTunnelsRequest | null, + protos.google.cloud.compute.v1.IVpnTunnelList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + protos.google.cloud.compute.v1.IVpnTunnelList | null | undefined, + protos.google.cloud.compute.v1.IVpnTunnel + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + protos.google.cloud.compute.v1.IVpnTunnelList | null | undefined, + protos.google.cloud.compute.v1.IVpnTunnel + > + ): void; + /** + * Retrieves a list of VpnTunnel resources contained in the specified project and region. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [VpnTunnel]{@link google.cloud.compute.v1.VpnTunnel}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + protos.google.cloud.compute.v1.IVpnTunnelList | null | undefined, + protos.google.cloud.compute.v1.IVpnTunnel + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + protos.google.cloud.compute.v1.IVpnTunnelList | null | undefined, + protos.google.cloud.compute.v1.IVpnTunnel + > + ): Promise< + [ + protos.google.cloud.compute.v1.IVpnTunnel[], + protos.google.cloud.compute.v1.IListVpnTunnelsRequest | null, + protos.google.cloud.compute.v1.IVpnTunnelList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [VpnTunnel]{@link google.cloud.compute.v1.VpnTunnel} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.region + * Name of the region for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [VpnTunnel]{@link google.cloud.compute.v1.VpnTunnel}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListVpnTunnelsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.vpnTunnelsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/vpn_tunnels_client_config.json b/src/v1/vpn_tunnels_client_config.json new file mode 100644 index 00000000..31a90b49 --- /dev/null +++ b/src/v1/vpn_tunnels_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.compute.v1.VpnTunnels": { + "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": { + "AggregatedList": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Insert": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/vpn_tunnels_proto_list.json b/src/v1/vpn_tunnels_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/vpn_tunnels_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/zone_operations_client.ts b/src/v1/zone_operations_client.ts new file mode 100644 index 00000000..8c06baae --- /dev/null +++ b/src/v1/zone_operations_client.ts @@ -0,0 +1,851 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/zone_operations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './zone_operations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The ZoneOperations API. + * @class + * @memberof v1 + */ +export class ZoneOperationsClient { + 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}; + zoneOperationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ZoneOperationsClient. + * + * @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 ZoneOperationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.ZoneOperations', + 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 = gax.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.zoneOperationsStub) { + return this.zoneOperationsStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.ZoneOperations. + this.zoneOperationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.ZoneOperations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.ZoneOperations, + 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 zoneOperationsStubMethods = ['delete', 'get', 'list', 'wait']; + for (const methodName of zoneOperationsStubMethods) { + const callPromise = this.zoneOperationsStub.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.zoneOperationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute', + '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 -- + // ------------------- + delete( + request?: protos.google.cloud.compute.v1.IDeleteZoneOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteZoneOperationResponse, + protos.google.cloud.compute.v1.IDeleteZoneOperationRequest | undefined, + {} | undefined + ] + >; + delete( + request: protos.google.cloud.compute.v1.IDeleteZoneOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteZoneOperationResponse, + | protos.google.cloud.compute.v1.IDeleteZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + delete( + request: protos.google.cloud.compute.v1.IDeleteZoneOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IDeleteZoneOperationResponse, + | protos.google.cloud.compute.v1.IDeleteZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified zone-specific Operations resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to delete. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * Name of the zone for 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 [DeleteZoneOperationResponse]{@link google.cloud.compute.v1.DeleteZoneOperationResponse}. + * 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.delete(request); + */ + delete( + request?: protos.google.cloud.compute.v1.IDeleteZoneOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IDeleteZoneOperationResponse, + | protos.google.cloud.compute.v1.IDeleteZoneOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IDeleteZoneOperationResponse, + | protos.google.cloud.compute.v1.IDeleteZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IDeleteZoneOperationResponse, + protos.google.cloud.compute.v1.IDeleteZoneOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.delete(request, options, callback); + } + get( + request?: protos.google.cloud.compute.v1.IGetZoneOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IGetZoneOperationRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetZoneOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetZoneOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified zone-specific Operations resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetZoneOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetZoneOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IGetZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IGetZoneOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + wait( + request?: protos.google.cloud.compute.v1.IWaitZoneOperationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IWaitZoneOperationRequest | undefined, + {} | undefined + ] + >; + wait( + request: protos.google.cloud.compute.v1.IWaitZoneOperationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + wait( + request: protos.google.cloud.compute.v1.IWaitZoneOperationRequest, + callback: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Waits for the specified Operation resource to return as `DONE` or for the request to approach the 2 minute deadline, and retrieves the specified Operation resource. This method differs from the `GET` method in that it waits for no more than the default deadline (2 minutes) and then returns the current state of the operation, which might be `DONE` or still in progress. + * + * This method is called on a best-effort basis. Specifically: + * - In uncommon cases, when the server is overloaded, the request might return before the default deadline is reached, or might return after zero seconds. + * - If the default deadline is reached, there is no guarantee that the operation is actually done when the method returns. Be prepared to retry if the operation is not `DONE`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.operation + * Name of the Operations resource to return. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * Name of the zone for 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 [Operation]{@link google.cloud.compute.v1.Operation}. + * 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.wait(request); + */ + wait( + request?: protos.google.cloud.compute.v1.IWaitZoneOperationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitZoneOperationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IOperation, + | protos.google.cloud.compute.v1.IWaitZoneOperationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation, + protos.google.cloud.compute.v1.IWaitZoneOperationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.wait(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListZoneOperationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListZoneOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListZoneOperationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListZoneOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListZoneOperationsRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListZoneOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): void; + /** + * Retrieves a list of Operation resources contained within the specified zone. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for 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 Array of [Operation]{@link google.cloud.compute.v1.Operation}. + * 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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListZoneOperationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListZoneOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListZoneOperationsRequest, + protos.google.cloud.compute.v1.IOperationList | null | undefined, + protos.google.cloud.compute.v1.IOperation + > + ): Promise< + [ + protos.google.cloud.compute.v1.IOperation[], + protos.google.cloud.compute.v1.IListZoneOperationsRequest | null, + protos.google.cloud.compute.v1.IOperationList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for request. + * @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 [Operation]{@link google.cloud.compute.v1.Operation} 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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.v1.IListZoneOperationsRequest, + 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({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. + * @param {string} request.zone + * Name of the zone for request. + * @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 + * [Operation]{@link google.cloud.compute.v1.Operation}. 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.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.v1.IListZoneOperationsRequest, + 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({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.zoneOperationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/zone_operations_client_config.json b/src/v1/zone_operations_client_config.json new file mode 100644 index 00000000..f6cca722 --- /dev/null +++ b/src/v1/zone_operations_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.compute.v1.ZoneOperations": { + "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": { + "Delete": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "Wait": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/zone_operations_proto_list.json b/src/v1/zone_operations_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/zone_operations_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/v1/zones_client.ts b/src/v1/zones_client.ts new file mode 100644 index 00000000..47fa5a41 --- /dev/null +++ b/src/v1/zones_client.ts @@ -0,0 +1,642 @@ +// 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 {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/zones_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './zones_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * The Zones API. + * @class + * @memberof v1 + */ +export class ZonesClient { + 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}; + zonesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ZonesClient. + * + * @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 ZonesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + // Implicitely set 'rest' value for the apis use rest as transport (eg. googleapis-discovery apis). + if (!opts) { + opts = {fallback: 'rest'}; + } else { + opts.fallback = opts.fallback ?? 'rest'; + } + 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); + + // 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 = { + list: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'items' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.compute.v1.Zones', + 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 = gax.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.zonesStub) { + return this.zonesStub; + } + + // Put together the "service stub" for + // google.cloud.compute.v1.Zones. + this.zonesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.compute.v1.Zones' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.compute.v1.Zones, + 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 zonesStubMethods = ['get', 'list']; + for (const methodName of zonesStubMethods) { + const callPromise = this.zonesStub.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.zonesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'compute.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 'compute.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/compute.readonly', + 'https://www.googleapis.com/auth/compute', + '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 -- + // ------------------- + get( + request?: protos.google.cloud.compute.v1.IGetZoneRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IZone, + protos.google.cloud.compute.v1.IGetZoneRequest | undefined, + {} | undefined + ] + >; + get( + request: protos.google.cloud.compute.v1.IGetZoneRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.compute.v1.IZone, + protos.google.cloud.compute.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + > + ): void; + get( + request: protos.google.cloud.compute.v1.IGetZoneRequest, + callback: Callback< + protos.google.cloud.compute.v1.IZone, + protos.google.cloud.compute.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Returns the specified Zone resource. Gets a list of available zones by making a list() request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.project + * Project ID for this request. + * @param {string} request.zone + * Name of the zone resource to return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.compute.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 + * const [response] = await client.get(request); + */ + get( + request?: protos.google.cloud.compute.v1.IGetZoneRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.compute.v1.IZone, + protos.google.cloud.compute.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.compute.v1.IZone, + protos.google.cloud.compute.v1.IGetZoneRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.compute.v1.IZone, + protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.get(request, options, callback); + } + + list( + request?: protos.google.cloud.compute.v1.IListZonesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.compute.v1.IZone[], + protos.google.cloud.compute.v1.IListZonesRequest | null, + protos.google.cloud.compute.v1.IZoneList + ] + >; + list( + request: protos.google.cloud.compute.v1.IListZonesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListZonesRequest, + protos.google.cloud.compute.v1.IZoneList | null | undefined, + protos.google.cloud.compute.v1.IZone + > + ): void; + list( + request: protos.google.cloud.compute.v1.IListZonesRequest, + callback: PaginationCallback< + protos.google.cloud.compute.v1.IListZonesRequest, + protos.google.cloud.compute.v1.IZoneList | null | undefined, + protos.google.cloud.compute.v1.IZone + > + ): void; + /** + * Retrieves the list of Zone resources available to the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value 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 Array of [Zone]{@link google.cloud.compute.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 `listAsync()` + * 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. + */ + list( + request?: protos.google.cloud.compute.v1.IListZonesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.compute.v1.IListZonesRequest, + protos.google.cloud.compute.v1.IZoneList | null | undefined, + protos.google.cloud.compute.v1.IZone + >, + callback?: PaginationCallback< + protos.google.cloud.compute.v1.IListZonesRequest, + protos.google.cloud.compute.v1.IZoneList | null | undefined, + protos.google.cloud.compute.v1.IZone + > + ): Promise< + [ + protos.google.cloud.compute.v1.IZone[], + protos.google.cloud.compute.v1.IListZonesRequest | null, + protos.google.cloud.compute.v1.IZoneList + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } 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({ + project: request.project || '', + }); + this.initialize(); + return this.innerApiCalls.list(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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 [Zone]{@link google.cloud.compute.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 `listAsync()` + * 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. + */ + listStream( + request?: protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.createStream( + this.innerApiCalls.list as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `list`, 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.filter + * A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. + * + * You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. + * + * To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` + * @param {number} request.maxResults + * The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. + * + * You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. + * + * Currently, only sorting by `name` or `creationTimestamp desc` is supported. + * @param {string} request.pageToken + * Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} request.project + * Project ID for this request. + * @param {boolean} request.returnPartialSuccess + * Opt-in for partial success behavior which provides partial results in case of failure. The default value is 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 + * [Zone]{@link google.cloud.compute.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 + * const iterable = client.listAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAsync( + request?: protos.google.cloud.compute.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'] = + gax.routingHeader.fromParams({ + project: request.project || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.list.asyncIterate( + this.innerApiCalls['list'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + + /** + * 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.zonesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/src/v1/zones_client_config.json b/src/v1/zones_client_config.json new file mode 100644 index 00000000..c2ada1e4 --- /dev/null +++ b/src/v1/zones_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.compute.v1.Zones": { + "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": { + "Get": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "List": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/src/v1/zones_proto_list.json b/src/v1/zones_proto_list.json new file mode 100644 index 00000000..4ad01aef --- /dev/null +++ b/src/v1/zones_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/compute/v1/compute.proto" +] diff --git a/src/vm.js b/src/vm.js deleted file mode 100644 index b7328193..00000000 --- a/src/vm.js +++ /dev/null @@ -1,1304 +0,0 @@ -/*! - * Copyright 2015 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 common = require('@google-cloud/common'); -const extend = require('extend'); -const format = require('string-format-obj'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); -const {replaceProjectIdToken} = require('@google-cloud/projectify'); - -const Disk = require('./disk.js'); - -/** - * Custom error type for errors related to detaching a disk. - * - * @private - * - * @param {string} message - Custom error message. - * @returns {Error} - */ -class DetachDiskError extends Error { - constructor(message) { - super(message); - this.name = 'DetachDiskError'; - } -} - -/** - * Custom error type for when `waitFor()` does not return a status in a timely - * fashion. - * - * @private - * - * @param {string} message - Custom error message. - * @returns {Error} - */ -class WaitForTimeoutError extends Error { - constructor(message) { - super(message); - this.name = 'WaitForTimeoutError'; - } -} - -/** - * The statuses that a VM can be in. - * - * @private - */ -const VALID_STATUSES = [ - 'PROVISIONING', - 'STAGING', - 'RUNNING', - 'STOPPING', - 'SUSPENDING', - 'SUSPENDED', - 'TERMINATED', -]; - -/** - * Interval for polling during waitFor. - * - * @private - */ -const WAIT_FOR_POLLING_INTERVAL_MS = 2000; - -/** - * An Instance object allows you to interact with a Google Compute Engine - * instance. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * @see [Instance Resource]{@link https://cloud.google.com/compute/docs/reference/v1/instances} - * - * @class - * @param {Zone} zone - Zone object this instance belongs to. - * @param {string} name - Name of the instance. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - */ -class VM extends common.ServiceObject { - constructor(zone, name) { - name = name.replace(/.*\/([^/]+)$/, '$1'); // Just the instance name. - const methods = { - /** - * Create a virtual machine. - * - * @method VM#create - * @param {object} config - See {Zone#createVM}. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * const config = { - * // ... - * }; - * - * vm.create(config, function(err, vm, operation, apiResponse) { - * // `vm` is a VM object. - * - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.create(config).then(function(data) { - * const vm = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - create: true, - /** - * Check if the vm exists. - * - * @method VM#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the vm exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a virtual machine if it exists. - * - * You may optionally use this to "get or create" an object by providing an - * object with `autoCreate` set to `true`. Any extra configuration that is - * normally required for the `create` method must be contained within this - * object as well. - * - * @method VM#get - * @param {options=} options - Configuration object. - * @param {boolean} options.autoCreate - Automatically create the object if - * it does not exist. Default: `false` - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.get(function(err, vm, apiResponse) { - * // `vm` is a VM object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.get().then(function(data) { - * const vm = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the instance's metadata. - * - * @see [Instance Resource]{@link https://cloud.google.com/compute/docs/reference/v1/instances} - * @see [Instance: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/get} - * - * @method VM#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The instance's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.getMetadata().then(function(data) { - * // Representation of this VM as the API sees it. - * const metadata = data[0]; - * const apiResponse = data[1]; - * - * // Custom metadata and predefined keys. - * const customMetadata = metadata.metadata; - * }); - */ - getMetadata: true, - }; - super({ - parent: zone, - baseUrl: '/instances', - /** - * @name VM#id - * @type {string} - */ - id: name, - createMethod: zone.createVM.bind(zone), - methods: methods, - pollIntervalMs: zone.compute.pollIntervalMs, - }); - - /** - * @name VM#name - * @type {string} - */ - this.name = name; - /** - * The parent {@link Zone} instance of this {@link VM} instance. - * @name VM#zone - * @type {Zone} - */ - this.zone = zone; - this.hasActiveWaiters = false; - this.waiters = []; - this.url = format( - '{resourceBaseUrl}/{project}/zones/{zone}/instances/{name}', - { - resourceBaseUrl: 'https://www.googleapis.com/compute/v1/projects', - project: zone.compute.projectId, - zone: zone.name, - name: this.name, - } - ); - } - /** - * Attach a disk to the instance. - * - * @see [Disks Overview]{@link https://cloud.google.com/compute/docs/disks} - * @see [Disk Resource]{@link https://cloud.google.com/compute/docs/reference/v1/disks} - * @see [Instance: attachDisk API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/attachDisk} - * - * @throws {Error} if a {module:compute/disk} is not provided. - * - * @param {module:compute/disk} disk - The disk to attach. - * @param {object=} options - See the - * [Instances: attachDisk](https://cloud.google.com/compute/docs/reference/v1/instances/attachDisk) - * request body. - * @param {boolean} options.readOnly - Attach the disk in read-only mode. (Alias - * for `options.mode = READ_ONLY`) - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * const disk = zone.disk('my-disk'); - * - * function callback(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * vm.attachDisk(disk, callback); - * - * //- - * // Provide an options object to customize the request. - * //- - * const options = { - * autoDelete: true, - * readOnly: true - * }; - * - * vm.attachDisk(disk, options, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.attachDisk(disk, options).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - attachDisk(disk, options, callback) { - if (!(disk instanceof Disk)) { - throw new Error('A Disk object must be provided.'); - } - if (is.fn(options)) { - callback = options; - options = {}; - } - const body = Object.assign( - { - // Default the deviceName to the name of the disk, like the Console does. - deviceName: disk.name, - }, - options, - { - source: disk.formattedName, - } - ); - if (body.readOnly) { - body.mode = 'READ_ONLY'; - delete body.readOnly; - } - this.request( - { - method: 'POST', - uri: '/attachDisk', - json: body, - }, - callback - ); - } - /** - * Delete the instance. - * - * @see [Instance: delete API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/delete} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.delete(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.delete().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - delete(callback) { - this.request( - { - method: 'DELETE', - uri: '', - }, - callback || common.util.noop - ); - } - /** - * Detach a disk from the instance. - * - * @see [Instance: detachDisk API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/detachDisk} - * - * @param {module:compute/disk|string} deviceName - The device name of the disk - * to detach. If a Disk object is provided, we try to find the device name - * automatically by searching through the attached disks on the instance. - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * const disk = zone.disk('my-disk'); - * - * vm.detachDisk(disk, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.detachDisk(disk).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - detachDisk(disk, callback) { - const self = this; - if (!(disk instanceof Disk)) { - throw new Error('A Disk object must be provided.'); - } - this.getMetadata((err, metadata) => { - if (err) { - callback(new DetachDiskError(err.message)); - return; - } - self.zone.compute.authClient.getProjectId((err, projectId) => { - if (err) { - callback(err); - return; - } - const diskName = replaceProjectIdToken(disk.formattedName, projectId); - let deviceName; - const resourceBaseUrl = 'https://www.googleapis.com/compute/v1/'; - const disks = metadata.disks || []; - // Try to find the deviceName by matching the source of the attached disks - // to the name of the disk provided by the user. - for (let i = 0; !deviceName && i < disks.length; i++) { - const attachedDisk = disks[i]; - const source = attachedDisk.source.replace(resourceBaseUrl, ''); - if (source === diskName) { - deviceName = attachedDisk.deviceName; - } - } - if (!deviceName) { - callback( - new DetachDiskError('Device name for this disk was not found.') - ); - return; - } - self.request( - { - method: 'POST', - uri: '/detachDisk', - qs: { - deviceName: deviceName, - }, - }, - callback || common.util.noop - ); - }); - }); - } - /** - * Get the instance's labels and their fingerprint. - * - * This method wraps {module:compute/vm#getMetadata}, returning only the `labels` - * property. - * - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object[]} callback.labels - Label objects from this VM. - * @param {string} callback.fingerprint - The current label fingerprint. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.getLabels(function(err, labels, fingerprint, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.getLabels().then(function(data) { - * const labels = data[0]; - * const fingerprint = data[1]; - * const apiResponse = data[2]; - * }); - */ - getLabels(callback) { - this.getMetadata((err, metadata, apiResponse) => { - if (err) { - callback(err, null, null, apiResponse); - return; - } - callback(null, metadata.labels, metadata.labelFingerprint, apiResponse); - }); - } - /** - * Returns the serial port output for the instance. - * - * @see [Instances: getSerialPortOutput API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/getSerialPortOutput} - * - * @param {number=} port - The port from which the output is retrieved (1-4). - * Default: `1`. - * @param {object=} options - Configuration object. - * @param {string=} options.start - The starting byte position of the output to return. - * To start with the first byte of output to the specified port, omit this field or set it to 0. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object} callback.output - The output from the port. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.getSerialPortOutput(function(err, output, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.getSerialPortOutput().then(function(data) { - * const output = data[0]; - * const apiResponse = data[1]; - * }); - */ - getSerialPortOutput(port, options, callback) { - if (is.object(port)) { - options = port; - port = 1; - } else if (is.fn(port)) { - callback = port; - port = 1; - } - - if (is.fn(options)) { - callback = options; - options = {}; - } - - port = port || 1; - options = options || {}; - const reqOpts = { - uri: '/serialPort', - qs: { - port: port, - start: options.start || 0, - }, - }; - const request = common.ServiceObject.prototype.request; - request.call(this, reqOpts, (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - callback(null, resp.contents, resp); - }); - } - /** - * Get the instance's tags and their fingerprint. - * - * This method wraps {module:compute/vm#getMetadata}, returning only the `tags` - * property. - * - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object[]} callback.tags - Tag objects from this VM. - * @param {string} callback.fingerprint - The current tag fingerprint. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.getTags(function(err, tags, fingerprint, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.getTags().then(function(data) { - * const tags = data[0]; - * const fingerprint = data[1]; - * const apiResponse = data[2]; - * }); - */ - getTags(callback) { - this.getMetadata((err, metadata, apiResponse) => { - if (err) { - callback(err, null, null, apiResponse); - return; - } - callback( - null, - metadata.tags.items, - metadata.tags.fingerprint, - apiResponse - ); - }); - } - /** - * Reset the instance. - * - * @see [Instances: reset API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/reset} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.reset(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.reset().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - reset(callback) { - this.request( - { - method: 'POST', - uri: '/reset', - }, - callback || common.util.noop - ); - } - /** - * Set the machine type for this instance, **stopping and restarting the VM as - * necessary**. - * - * For a list of the standard, high-memory, and high-CPU machines you may choose - * from, see - * [Predefined machine types]{@link https://cloud.google.com/compute/docs/machine-types#predefined_machine_types}. - * - * In order to change the machine type, the VM must not be running. This method - * will automatically stop the VM if it is running before changing the machine - * type. After it is sucessfully changed, the VM will be started. - * - * @see [Instances: setMachineType API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/setMachineType} - * @see [Predefined machine types]{@link https://cloud.google.com/compute/docs/machine-types#predefined_machine_types} - * - * @param {string} machineType - Full or partial machine type. See a list of - * predefined machine types - * [here](https://cloud.google.com/compute/docs/machine-types#predefined_machine_types). - * @param {object=} options - Configuration object. - * @param {boolean} options.start - Start the VM after successfully updating the - * machine type. Default: `false`. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.resize('n1-standard-1', function(err, apiResponse) { - * if (!err) { - * // The VM is running and its machine type was changed successfully. - * } - * }); - * - * //- - * // By default, calling `resize` will start your server after updating its - * // machine type. If you want to leave it stopped, set `options.start` to - * // `false`. - * //- - * const options = { - * start: false - * }; - * - * vm.resize('ns-standard-1', options, function(err, apiResponse) { - * if (!err) { - * // The VM is stopped and its machine type was changed successfully. - * } - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.resize('ns-standard-1', options).then(function(data) { - * const apiResponse = data[0]; - * }); - */ - resize(machineType, options, callback) { - const self = this; - const compute = this.zone.parent; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - const isPartialMachineType = machineType.indexOf('/') === -1; - if (isPartialMachineType) { - machineType = format('zones/{zoneName}/machineTypes/{machineType}', { - zoneName: this.zone.name, - machineType: machineType, - }); - } - this.request( - { - method: 'POST', - uri: '/setMachineType', - json: { - machineType: machineType, - }, - }, - compute.execAfterOperation_((err, apiResponse) => { - if (err) { - if (err.message === 'Instance is starting or running.') { - // The instance must be stopped before its machine type can be set. - self.stop( - compute.execAfterOperation_((err, apiResponse) => { - if (err) { - callback(err, apiResponse); - return; - } - // Try again now that the instance is stopped. - self.resize(machineType, callback); - }) - ); - } else { - callback(err, apiResponse); - } - return; - } - // The machine type was changed successfully. - if (options.start === false) { - callback(null, apiResponse); - } else { - self.start(compute.execAfterOperation_(callback)); - } - }) - ); - } - /** - * Set labels for this instance. - * - * @see [Instances: setLabels API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/setLabels} - * - * @param {object} labels - New labels. - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * const labels = { - * 'startup-script': '...', - * customKey: null // Setting `null` will remove the `customKey` property. - * }; - * - * vm.setLabels(labels, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.setLabels(labels).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setLabels(labels, labelFingerprint, callback) { - const body = { - labels: labels, - labelFingerprint: labelFingerprint, - }; - this.request( - { - method: 'POST', - uri: '/setLabels', - json: body, - }, - callback || common.util.noop - ); - } - /** - * Set the custom metadata for this instance. - * - * This will combine the `metadata` key/value pairs with any pre-existing - * metadata. Any changes will override pre-existing keys. To remove a - * pre-existing key, explicitly set the key's value to `null`. - * - * @see [Instances: setMetadata API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/setMetadata} - * - * @param {object} metadata - New metadata. - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * const metadata = { - * 'startup-script': '...', - * customKey: null // Setting `null` will remove the `customKey` property. - * }; - * - * vm.setMetadata(metadata, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.setMetadata(metadata).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setMetadata(metadata, callback) { - const self = this; - callback = callback || common.util.noop; - this.getMetadata((err, currentMetadata, apiResponse) => { - if (err) { - callback(err, null, apiResponse); - return; - } - const request = { - fingerprint: currentMetadata.metadata.fingerprint, - items: [], - }; - const metadataJSON = (currentMetadata.metadata.items || []).reduce( - (metadataJSON, keyValPair) => { - metadataJSON[keyValPair.key] = keyValPair.value; - return metadataJSON; - }, - {} - ); - const newMetadataJSON = Object.assign(metadataJSON, metadata); - for (const key in newMetadataJSON) { - /* eslint-disable no-prototype-builtins */ - if (newMetadataJSON.hasOwnProperty(key)) { - const value = newMetadataJSON[key]; - if (value !== null) { - request.items.push({key, value}); - } - } - } - self.request( - { - method: 'POST', - uri: '/setMetadata', - json: request, - }, - callback - ); - }); - } - /** - * Set the instance's tags. - * - * @see [Instances: setTags API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/setTags} - * - * @param {string[]} tags - The new tags for the instance. - * @param {string} fingerprint - The current tags fingerprint. An up-to-date - * fingerprint must be provided. - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.getTags(function(err, tags, fingerprint) { - * tags.push('new-tag'); - * - * vm.setTags(tags, fingerprint, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.getTags().then(function(data) { - * const tags = data[0]; - * const fingerprint = data[1]; - * - * tags.push('new-tag'); - * - * return vm.setTags(tags, fingerprint); - * }).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - setTags(tags, fingerprint, callback) { - const body = { - items: tags, - fingerprint: fingerprint, - }; - this.request( - { - method: 'POST', - uri: '/setTags', - json: body, - }, - callback || common.util.noop - ); - } - /** - * Start the instance. - * - * @see [Instances: start API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/start} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.start(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.start().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - start(callback) { - this.request( - { - method: 'POST', - uri: '/start', - }, - callback || common.util.noop - ); - } - /** - * Start an instance with customer encrypted disks. - * - * @see [Instances: start API Documentation]{@link https://cloud.google.com/compute/docs/reference/rest/v1/instances/startWithEncryptionKey} - * - * @param {object[]} disks - An array of the encrypted disks and their keys. - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * var disks = [ - * { - * source: 'disk_name', - * diskEncryptionKey: { - * rawKey: '...' - * } - * } - * ] - * - * vm.startWithEncryptionKey(disks, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.startWithEncryptionKey(disks).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - startWithEncryptionKey(disks, callback) { - this.request( - { - method: 'POST', - uri: '/startWithEncryptionKey', - json: { - disks, - }, - }, - callback || common.util.noop - ); - } - /** - * Stop the instance. - * - * @see [Instances: stop API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/stop} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.stop(function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.stop().then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - stop(callback) { - this.request( - { - method: 'POST', - uri: '/stop', - }, - callback || common.util.noop - ); - } - /** - * Update the instance. - * - * NOTE: This method will pull the latest record of the current metadata, then - * merge it with the object you provide. This means there is a chance of a - * mismatch in data if the resource is updated immediately after we pull the - * metadata, but before we update it. - * - * @see [Instances: update API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/update} - * - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * const metadata = { - * deletionProtection: false, - * }; - * - * vm.update(metadata, function(err, operation, apiResponse) { - * // `operation` is an Operation object that can be used to check the - * // status of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.update(metadata).then(function(data) { - * const operation = data[0]; - * const apiResponse = data[1]; - * }); - */ - update(metadata, callback) { - callback = callback || common.util.noop; - - this.getMetadata((err, currentMetadata) => { - if (err) { - callback(err); - return; - } - - this.request( - { - method: 'PUT', - uri: '', - json: extend(true, currentMetadata, metadata), - }, - callback - ); - }); - } - /** - * This function will callback when the VM is in the specified state. - * - * Will time out after the specified time (default: 300 seconds). - * - * @param {string} status - The status to wait for. This can be: - * - "PROVISIONING" - * - "STAGING" - * - "RUNNING" - * - "STOPPING" - * - "SUSPENDING" - * - "SUSPENDED" - * - "TERMINATED" - * @param {object=} options - Configuration object. - * @param {number} options.timeout - The number of seconds to wait until timing - * out, between `0` and `600`. Default: `300` - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while waiting for the - * status. - * @param {object} callback.metadata - The instance's metadata. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('zone-name'); - * const vm = zone.vm('vm-name'); - * - * vm.waitFor('RUNNING', function(err, metadata) { - * if (!err) { - * // The VM is running. - * } - * }); - * - * //- - * // By default, `waitFor` will timeout after 300 seconds while waiting for the - * // desired state to occur. This can be changed to any number between 0 and - * // 600. If the timeout is set to 0, it will poll once for status and then - * // timeout if the desired state is not reached. - * //- - * const options = { - * timeout: 600 - * }; - * - * vm.waitFor('TERMINATED', options, function(err, metadata) { - * if (!err) { - * // The VM is terminated. - * } - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * vm.waitFor('RUNNING', options).then(function(data) { - * const metadata = data[0]; - * }); - */ - waitFor(status, options, callback) { - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - status = status.toUpperCase(); - // The timeout should default to five minutes, be less than or equal to 10 - // minutes, and be greater than or equal to 0 seconds. - let timeout = 300; - if (is.number(options.timeout)) { - timeout = Math.min(Math.max(options.timeout, 0), 600); - } - if (VALID_STATUSES.indexOf(status) === -1) { - throw new Error('Status passed to waitFor is invalid.'); - } - this.waiters.push({ - status: status, - timeout: timeout, - startTime: new Date() / 1000, - callback: callback, - }); - if (!this.hasActiveWaiters) { - this.hasActiveWaiters = true; - this.startPolling_(); - } - } - /** - * Poll `getMetadata` to check the VM's status. This runs a loop to ping - * the API on an interval. - * - * Note: This method is automatically called when a `waitFor()` call - * is made. - * - * @private - */ - startPolling_() { - const self = this; - if (!this.hasActiveWaiters) { - return; - } - this.getMetadata((err, metadata) => { - const now = new Date() / 1000; - const waitersToRemove = self.waiters.filter(waiter => { - if (err) { - waiter.callback(err); - return true; - } - if (metadata.status === waiter.status) { - waiter.callback(null, metadata); - return true; - } - if (now - waiter.startTime >= waiter.timeout) { - const waitForTimeoutError = new WaitForTimeoutError( - [ - 'waitFor timed out waiting for VM ' + self.name, - 'to be in status: ' + waiter.status, - ].join(' ') - ); - waiter.callback(waitForTimeoutError); - return true; - } - }); - waitersToRemove.forEach(waiter => { - self.waiters.splice(self.waiters.indexOf(waiter), 1); - }); - self.hasActiveWaiters = self.waiters.length > 0; - if (self.hasActiveWaiters) { - setTimeout(self.startPolling_.bind(self), WAIT_FOR_POLLING_INTERVAL_MS); - } - }); - } - /** - * Make a new request object from the provided arguments and wrap the callback - * to intercept non-successful responses. - * - * Most operations on a VM are long-running. This method handles building an - * operation and returning it to the user's provided callback. In methods that - * don't require an operation, we simply don't do anything with the `Operation` - * object. - * - * @private - * - * @param {string} method - Action. - * @param {string} path - Request path. - * @param {*} query - Request query object. - * @param {*} body - Request body contents. - * @param {function} callback - The callback function. - */ - request(reqOpts, callback) { - const zone = this.zone; - const request = common.ServiceObject.prototype.request; - request.call(this, reqOpts, (err, resp) => { - if (err) { - callback(err, null, resp); - return; - } - const operation = zone.operation(resp.name); - operation.metadata = resp; - callback(null, operation, resp); - }); - } -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(VM); - -module.exports = VM; diff --git a/src/zone.js b/src/zone.js deleted file mode 100644 index 81851e46..00000000 --- a/src/zone.js +++ /dev/null @@ -1,1681 +0,0 @@ -/*! - * Copyright 2015 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 arrify = require('arrify'); -const async = require('async'); -const common = require('@google-cloud/common'); -const extend = require('extend'); -const format = require('string-format-obj'); -const {GCEImages} = require('gce-images'); -const is = require('is'); -const {promisifyAll} = require('@google-cloud/promisify'); -const {paginator} = require('@google-cloud/paginator'); - -const Autoscaler = require('./autoscaler.js'); -const Disk = require('./disk.js'); -const InstanceGroup = require('./instance-group.js'); -const InstanceGroupManager = require('./instance-group-manager.js'); -const MachineType = require('./machine-type.js'); -const Operation = require('./operation.js'); -const VM = require('./vm.js'); - -/** - * A Zone object allows you to interact with a Google Compute Engine zone. - * - * @see [Regions & Zones Overview]{@link https://cloud.google.com/compute/docs/zones} - * @see [Zone Resource]{@link https://cloud.google.com/compute/docs/reference/v1/zones} - * - * @class - * @param {Compute} compute - Compute object this zone belongs to. - * @param {string} name - Name of the zone. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - */ -class Zone extends common.ServiceObject { - constructor(compute, name) { - const methods = { - /** - * Check if the zone exists. - * - * @method Zone#exists - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {boolean} callback.exists - Whether the zone exists or not. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.exists(function(err, exists) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.exists().then(function(data) { - * const exists = data[0]; - * }); - */ - exists: true, - /** - * Get a zone. - * - * @method Zone#get - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.get(function(err, zone, apiResponse) { - * // `zone` is a Zone object. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.get().then(function(data) { - * const zone = data[0]; - * const apiResponse = data[1]; - * }); - */ - get: true, - /** - * Get the zone's metadata. - * - * @see [Zone Resource]{@link https://cloud.google.com/compute/docs/reference/v1/zones} - * @see [Zones: get API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/zones/get} - * - * @method Zone#getMetadata - * @param {function=} callback - The callback function. - * @param {?error} callback.err - An error returned while making this - * request. - * @param {object} callback.metadata - The zone's metadata. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getMetadata(function(err, metadata, apiResponse) {}); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getMetadata().then(function(data) { - * const metadata = data[0]; - * const apiResponse = data[1]; - * }); - */ - getMetadata: true, - }; - super({ - parent: compute, - baseUrl: '/zones', - /** - * @name Zone#id - * @type {string} - */ - id: name, - methods: methods, - pollIntervalMs: compute.pollIntervalMs, - }); - /** - * The parent {@link Compute} instance of this {@link Zone} instance. - * @name Zone#compute - * @type {Compute} - */ - this.compute = compute; - /** - * @name Zone#name - * @type {string} - */ - this.name = name; - this.gceImages = new GCEImages({ - authClient: compute.authClient, - }); - } - /** - * Get a reference to a Google Compute Engine autoscaler in this zone. - * - * @param {string} name - Name of the autoscaler. - * @returns {Autoscaler} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const autoscaler = zone.autoscaler('autoscaler-name'); - */ - autoscaler(name) { - return new Autoscaler(this, name); - } - /** - * Create an autoscaler in this zone. - * - * @see [Load Balancing and Scaling]{@link https://cloud.google.com/compute/docs/load-balancing-and-autoscaling} - * @see [Autoscaler Resource]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers} - * @see [Autoscalers: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers/insert} - * - * @throws {Error} If `config.target` is not provided. - * - * @param {string} name - Name of the autoscaler. - * @param {object} config - See an - * [Autoscaler resource](https://cloud.google.com/compute/docs/reference/v1/autoscalers). - * @param {number} config.coolDown - The number of seconds that the autoscaler - * should wait before it starts collecting information from a new instance. - * Alias for `config.autoscalingPolicy.coolDownPeriodSec`. - * @param {number} config.cpu - The target CPU utilization that the autoscaler - * should maintain, between 1 - 100. Alias for - * `config.autoscalingPolicy.cpuUtilization.utilizationTarget`. - * @param {number} config.loadBalance - Backend capacity utilization that - * autoscaler should maintain, between 1 - 100. Alias for - * `config.autoscalingPolicy.loadBalancingUtilization.utilizationTarget`. - * @param {number} config.maxReplicas - The maximum number of instances that the - * autoscaler can scale up to. Alias for - * `config.autoscalingPolicy.maxNumReplicas`. - * @param {number} config.minReplicas - The minimum number of replicas that the - * autoscaler can scale down to. Alias for - * `config.autoscalingPolicy.minNumReplicas`. - * @param {string} config.target - The name of the managed instance group that - * this autoscaler will scale. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Autoscaler} callback.autoscaler - The created - * Autoscaler object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const config = { - * coolDown: 30, - * cpu: 80, - * loadBalance: 40, - * maxReplicas: 5, - * minReplicas: 0, - * target: 'instance-group-manager-1' - * }; - * - * function callback(err, autoscaler, operation, apiResponse) { - * // `autoscaler` is an Autoscaler object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * zone.createAutoscaler('name', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.createAutoscaler('name', config).then(function(data) { - * const autoscaler = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createAutoscaler(name, config, callback) { - const self = this; - if (!config.target) { - throw new Error('Cannot create an autoscaler without a target.'); - } - const json = extend(true, {}, config, { - name: name, - autoscalingPolicy: {}, - }); - if (!/^https*:/.test(json.target)) { - json.target = [ - 'https://content.googleapis.com/compute/v1/projects/', - this.compute.projectId, - '/zones/', - this.name, - '/instanceGroupManagers/', - json.target, - ].join(''); - } - if (is.defined(json.coolDown)) { - json.autoscalingPolicy.coolDownPeriodSec = json.coolDown; - delete json.coolDown; - } - if (is.defined(json.cpu)) { - json.autoscalingPolicy.cpuUtilization = { - utilizationTarget: json.cpu / 100, - }; - delete json.cpu; - } - if (is.defined(json.loadBalance)) { - json.autoscalingPolicy.loadBalancingUtilization = { - utilizationTarget: json.loadBalance / 100, - }; - delete json.loadBalance; - } - if (is.defined(json.maxReplicas)) { - json.autoscalingPolicy.maxNumReplicas = json.maxReplicas; - delete json.maxReplicas; - } - if (is.defined(json.minReplicas)) { - json.autoscalingPolicy.minNumReplicas = json.minReplicas; - delete json.minReplicas; - } - this.request( - { - method: 'POST', - uri: '/autoscalers', - json: json, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const autoscaler = self.autoscaler(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, autoscaler, operation, resp); - } - ); - } - /** - * Create a persistent disk in this zone. - * - * @see [Disk Resource]{@link https://cloud.google.com/compute/docs/reference/v1/disks} - * @see [Disks: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/disks/insert} - * - * @param {string} name - Name of the disk. - * @param {object} config - See a - * [Disk resource](https://cloud.google.com/compute/docs/reference/v1/disks). - * @param {string=} config.os - Specify the name of an OS, and we will use the - * latest version as the source image of a new boot disk. See - * [this list of accepted OS names](https://github.com/stephenplusplus/gce-images#accepted-os-names). - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Disk} callback.disk - The created Disk object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * //- - * // Create a persistent disk using the latest Ubuntu version - * // as the source image. - * //- - * const config = { - * os: 'ubuntu', - * sizeGb: 10 - * }; - * - * //- - * // Create a persistent disk using the latest Ubuntu version from your project - * // as the source image. - * //- - * const config = { - * os: 'your-project-id-or-name/ubuntu', - * sizeGb: 10 - * }; - * - * zone.createDisk('name', config, function(err, disk, operation, apiResponse) { - * // `disk` is a Disk object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.createDisk('name', config).then(function(data) { - * const disk = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createDisk(name, config, callback) { - const self = this; - const query = {}; - const body = Object.assign({}, config, { - name: name, - }); - if (body.image) { - query.sourceImage = body.image; - delete body.image; - } - if (body.os) { - this.gceImages.getLatest(body.os, (err, image) => { - if (err) { - callback(err); - return; - } - delete body.os; - body.sourceImage = image.selfLink; - self.createDisk(name, body, callback); - }); - return; - } - this.request( - { - method: 'POST', - uri: '/disks', - qs: query, - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const disk = self.disk(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, disk, operation, resp); - } - ); - } - /** - * Create an instance group in this zone. - * - * @see [InstanceGroup Resource]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups#resource} - * @see [InstanceGroups: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/insert} - * - * @param {string} name - Name of the instance group. - * @param {object} options - See an - * [InstanceGroup resource](https://cloud.google.com/compute/docs/reference/v1/instanceGroups#resource). - * @param {object} options.ports - A map of names to ports. The key should be - * the name, and the value the port number. Maps to `options.namedPorts`. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {InstanceGroup} callback.instanceGroup - The created - * InstanceGroup object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * function onCreated(err, instanceGroup, operation, apiResponse) { - * // `instanceGroup` is an InstanceGroup object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * zone.createInstanceGroup('instance-group-name', onCreated); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.createInstanceGroup('instance-group-name', config).then(function(data) { - * const instanceGroup = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createInstanceGroup(name, options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - const body = Object.assign({}, options, { - name: name, - }); - if (body.ports) { - body.namedPorts = InstanceGroup.formatPorts_(body.ports); - delete body.ports; - } - this.request( - { - method: 'POST', - uri: '/instanceGroups', - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const instanceGroup = self.instanceGroup(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, instanceGroup, operation, resp); - } - ); - } - /** - * Create a virtual machine in this zone. - * - * @see [Instance Resource]{@link https://cloud.google.com/compute/docs/reference/v1/instances} - * @see [Instances: insert API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/insert} - * - * @param {string} name - Name of the instance. - * @param {object} config - See an - * [Instance resource](https://cloud.google.com/compute/docs/reference/v1/instances). - * @param {?object[]} config.disks - See - * [disks object](https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert). - * @param {boolean=} config.http - Allow HTTP traffic. Default: `false` - * @param {boolean=} config.https - Allow HTTPS traffic. Default: `false` - * @param {?object[]} config.networkInterfaces - An array of configurations for - * this interface. This specifies how this interface should interact with - * other network services, such as connecting to the internet. Default: - * `[ { network: 'global/networks/default' } ]` - * @param {string=} config.machineType - The machine type resource to use. - * Provide only the name of the machine, e.g. `n1-standard-16`. Refer to - * [Available Machine Types](https://goo.gl/jrHEbo). Default: - * `n1-standard-1` - * @param {string=} config.os - Specify the name of an OS, and we will use the - * latest version as the source image of a new boot disk. See - * [this list of accepted OS names](https://github.com/stephenplusplus/gce-images#accepted-os-names). - * @param {?string[]} config.tags - An array of tags. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {VM} callback.vm - The created VM object. - * @param {Operation} callback.operation - An operation object - * that can be used to check the status of the request. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * //- - * // Create a new instance using the latest Debian version from your project - * // as the source image for a new boot disk. - * //- - * const config = { - * os: 'your-project-id-or-name/debian', - * http: true, - * tags: ['debian-server'] - * }; - * - * //- - * // Create a new instance using the latest Debian version as the source image - * // for a new boot disk. - * //- - * const config = { - * os: 'debian', - * http: true, - * tags: ['debian-server'] - * }; - * - * //- - * // The above object will auto-expand behind the scenes to something like the - * // following. The Debian version may be different when you run the command. - * //- - * const config = { - * machineType: 'n1-standard-1', - * disks: [ - * { - * boot: true, - * initializeParams: { - * sourceImage: - * 'https://www.googleapis.com/compute/v1/projects' + - * '/debian-cloud/global/images/debian-7-wheezy-v20150710' - * } - * } - * ], - * networkInterfaces: [ - * { - * network: 'global/networks/default' - * } - * ], - * tags: [ - * { - * items: [ - * 'debian-server', - * 'http-server' - * ] - * } - * ] - * }; - * - * function callback(err, vm, operation, apiResponse) { - * // `vm` is a VM object. - * - * // `operation` is an Operation object that can be used to check the status - * // of the request. - * } - * - * zone.createVM('new-vm-name', config, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.createVM('new-vm-name', config).then(function(data) { - * const vm = data[0]; - * const operation = data[1]; - * const apiResponse = data[2]; - * }); - */ - createVM(name, config, callback) { - const self = this; - const query = {}; - const body = Object.assign({name}, config); - if (body.template) { - query.sourceInstanceTemplate = body.template; - delete body.template; - } - if (!is.defined(query.sourceInstanceTemplate)) { - body.machineType = body.machineType || 'n1-standard-1'; - body.networkInterfaces = body.networkInterfaces || [ - {network: 'global/networks/default'}, - ]; - } - if (body.machineType && body.machineType.indexOf('/') === -1) { - // The specified machineType is only a partial name, e.g. 'n1-standard-1'. - body.machineType = format('zones/{zoneName}/machineTypes/{machineType}', { - zoneName: this.name, - machineType: body.machineType, - }); - } - if (is.array(body.tags)) { - body.tags = { - items: body.tags, - }; - } - if (body.http || body.https) { - // We will add tags to the created instance (http-server and/or - // https-server), and create the appropriate firewall rules to allow - // connections on the necessary ports to these tags. - const createFirewallMethods = []; - body.networkInterfaces[0].accessConfigs = [ - { - type: 'ONE_TO_ONE_NAT', - }, - ]; - body.tags = body.tags || {}; - body.tags.items = body.tags.items || []; - if (body.http) { - delete body.http; - createFirewallMethods.push(this.createHttpServerFirewall_.bind(this)); - if (body.tags.items.indexOf('http-server') === -1) { - body.tags.items.push('http-server'); - } - } - if (body.https) { - delete body.https; - createFirewallMethods.push(this.createHttpsServerFirewall_.bind(this)); - if (body.tags.items.indexOf('https-server') === -1) { - body.tags.items.push('https-server'); - } - } - // We have to make sure the firewall rules exist to allow HTTP/S traffic. - async.parallel(createFirewallMethods, err => { - if (err) { - callback(err); - return; - } - self.createVM(name, body, callback); - }); - return; - } - if (body.os) { - this.gceImages.getLatest(body.os, (err, image) => { - if (err) { - callback(err); - return; - } - delete body.os; - body.disks = body.disks || []; - // Only push an additional disk configuration if the disk provided - // is not bootable: - if (body.disks.length === 0 || !body.disks[0].boot) { - body.disks.unshift({ - autoDelete: true, - boot: true, - initializeParams: { - sourceImage: image.selfLink, - }, - }); - } - self.createVM(name, body, callback); - }); - return; - } - this.request( - { - method: 'POST', - uri: '/instances', - qs: query, - json: body, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - const vm = self.vm(name); - const operation = self.operation(resp.name); - operation.metadata = resp; - callback(null, vm, operation, resp); - } - ); - } - /** - * Get a reference to a Google Compute Engine disk in this zone. - * - * @see [Disks Overview]{@link https://cloud.google.com/compute/docs/disks} - * - * @param {string} name - Name of the disk. - * @returns {Disk} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const disk = zone.disk('disk1'); - */ - disk(name) { - return new Disk(this, name); - } - /** - * Get a list of autoscalers from this zone. - * - * @see [Managing Autoscalers]{@link https://cloud.google.com/compute/docs/autoscaler/managing-autoscalers} - * @see [Understanding Autoscaler Decisions]{@link https://cloud.google.com/compute/docs/autoscaler/understanding-autoscaler-decisions} - * @see [Autoscalers: aggregatedList API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/autoscalers/list} - * - * @param {object=} options - Autoscaler search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of autoscalers to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Autoscaler[]} callback.autoscalers - Autoscaler - * objects from your project. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getAutoscalers(function(err, autoscalers) { - * // autoscalers is an array of `Autoscaler` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, autoscalers, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * zone.getAutoscalers(nextQuery, callback); - * } - * } - * - * zone.getAutoscalers({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getAutoscalers().then(function(data) { - * const autoscalers = data[0]; - * }); - */ - getAutoscalers(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/autoscalers', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const autoscalers = arrify(resp.items).map(autoscaler => { - const autoscalerInstance = self.autoscaler(autoscaler.name); - autoscalerInstance.metadata = autoscaler; - return autoscalerInstance; - }); - callback(null, autoscalers, nextQuery, resp); - } - ); - } - /** - * Get a list of disks in this zone. - * - * @see [Disks Overview]{@link https://cloud.google.com/compute/docs/disks} - * @see [Disks: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/disks/list} - * - * @param {object=} options - Disk search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of disks to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Disk[]} callback.disks - Disk objects from this zone. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getDisks(function(err, disks) { - * // `disks` is an array of `Disk` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, disks, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * zone.getDisks(nextQuery, callback); - * } - * } - * - * zone.getDisks({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getDisks().then(function(data) { - * const disks = data[0]; - * }); - */ - getDisks(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/disks', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const disks = (resp.items || []).map(disk => { - const diskInstance = self.disk(disk.name); - diskInstance.metadata = disk; - return diskInstance; - }); - callback(null, disks, nextQuery, resp); - } - ); - } - /** - * Get a list of instance groups for this zone. - * - * @see [InstanceGroups Overview]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups} - * @see [InstanceGroups: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups/list} - * - * @param {object=} options - Instance group search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of instance groups to - * return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {InstanceGroup[]} callback.instanceGroups - - * InstanceGroup objects from this zone. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getInstanceGroups(function(err, instanceGroups) { - * // `instanceGroups` is an array of `InstanceGroup` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, instanceGroups, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * zone.getInstanceGroups(nextQuery, callback); - * } - * } - * - * zone.getInstanceGroups({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getInstanceGroups().then(function(data) { - * const instanceGroups = data[0]; - * }); - */ - getInstanceGroups(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/instanceGroups', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const instanceGroups = (resp.items || []).map(instanceGroup => { - const instanceGroupInstance = self.instanceGroup(instanceGroup.name); - instanceGroupInstance.metadata = instanceGroup; - return instanceGroupInstance; - }); - callback(null, instanceGroups, nextQuery, resp); - } - ); - } - /** - * Get a list of instance group managers for this zone. - * - * @see [InstanceGroupManagers Overview]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers} - * @see [InstanceGroupManagers: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers/list} - * - * @param {object=} options - Instance group manager search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of instance groups to - * return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {InstanceGroupManager[]} callback.instanceGroupManagers - - * InstanceGroupManager objects from this zone. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getInstanceGroupManagers(function(err, instanceGroupManagers) { - * // `instanceGroupManagers` is an array of `InstanceGroupManager` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, instanceGroupManagers, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * zone.getInstanceGroupManagers(nextQuery, callback); - * } - * } - * - * zone.getInstanceGroupManagers({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getInstanceGroupManagers().then(function(data) { - * const instanceGroupManagerss = data[0]; - * }); - */ - getInstanceGroupManagers(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/instanceGroupManagers', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const instanceGroupManagers = (resp.items || []).map( - instanceGroupManager => { - const instanceGroupManagerInstance = self.instanceGroupManager( - instanceGroupManager.name - ); - instanceGroupManagerInstance.metadata = instanceGroupManager; - return instanceGroupManagerInstance; - } - ); - callback(null, instanceGroupManagers, nextQuery, resp); - } - ); - } - /** - * Get a list of machine types for this zone. - * - * @see [MachineTypes: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes/list} - * @see [Machine Types Overview]{@link https://cloud.google.com/compute/docs/machine-types} - * @see [MachineType Resource]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes} - * - * @param {object=} options - Machine type search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of machineTypes - * to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {MachineType[]} callback.machineTypes - MachineType - * objects from this zone. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getMachineTypes(function(err, machineTypes) { - * // `machineTypes` is an array of `MachineType` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, machineTypes, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * zone.getMachineTypes(nextQuery, callback); - * } - * } - * - * zone.getMachineTypes({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getMachineTypes().then(function(data) { - * const machineTypes = data[0]; - * }); - */ - getMachineTypes(options, callback) { - if (is.fn(options)) { - callback = options; - options = {}; - } - options = Object.assign({}, options, { - filter: 'zone eq .*' + this.name, - }); - return this.compute.getMachineTypes(options, callback); - } - /** - * Get a list of operations for this zone. - * - * @see [Zone Operation Overview]{@link https://cloud.google.com/compute/docs/reference/v1/zoneOperations} - * @see [ZoneOperations: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/zoneOperations/list} - * - * @param {object=} options - Operation search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {number} options.maxApiCalls - Maximum number of API calls to make. - * @param {number} options.maxResults - Maximum number of operations to return. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {Operation[]} callback.operations - Operation objects - * from this zone. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getOperations(function(err, operations) { - * // `operations` is an array of `Operation` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, operations, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * zone.getOperations(nextQuery, callback); - * } - * } - * - * zone.getOperations({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getOperations().then(function(data) { - * const operations = data[0]; - * }); - */ - getOperations(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/operations', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const operations = (resp.items || []).map(operation => { - const operationInstance = self.operation(operation.name); - operationInstance.metadata = operation; - return operationInstance; - }); - callback(null, operations, nextQuery, resp); - } - ); - } - /** - * Get a list of VM instances in this zone. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * @see [Instances: list API Documentation]{@link https://cloud.google.com/compute/docs/reference/v1/instances/list} - * - * @param {object=} options - Instance search options. - * @param {boolean} options.autoPaginate - Have pagination handled - * automatically. Default: true. - * @param {string} options.filter - Search filter in the format of - * `{name} {comparison} {filterString}`. - * - **`name`**: the name of the field to compare - * - **`comparison`**: the comparison operator, `eq` (equal) or `ne` - * (not equal) - * - **`filterString`**: the string to filter to. For string fields, this - * can be a regular expression. - * @param {string} options.pageToken - A previously-returned page token - * representing part of the larger set of results to view. - * @param {function} callback - The callback function. - * @param {?error} callback.err - An error returned while making this request. - * @param {VM[]} callback.vms - VM objects from this zone. - * @param {object} callback.apiResponse - The full API response. - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getVMs(function(err, vms) { - * // `vms` is an array of `VM` objects. - * }); - * - * //- - * // To control how many API requests are made and page through the results - * // manually, set `autoPaginate` to `false`. - * //- - * function callback(err, vms, nextQuery, apiResponse) { - * if (nextQuery) { - * // More results exist. - * zone.getVMs(nextQuery, callback); - * } - * } - * - * zone.getVMs({ - * autoPaginate: false - * }, callback); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * zone.getVMs().then(function(data) { - * const vms = data[0]; - * }); - */ - getVMs(options, callback) { - const self = this; - if (is.fn(options)) { - callback = options; - options = {}; - } - options = options || {}; - this.request( - { - uri: '/instances', - qs: options, - }, - (err, resp) => { - if (err) { - callback(err, null, null, resp); - return; - } - let nextQuery = null; - if (resp.nextPageToken) { - nextQuery = Object.assign({}, options, { - pageToken: resp.nextPageToken, - }); - } - const vms = (resp.items || []).map(instance => { - const vmInstance = self.vm(instance.name); - vmInstance.metadata = instance; - return vmInstance; - }); - callback(null, vms, nextQuery, resp); - } - ); - } - /** - * Get a reference to a Google Compute Engine instance group. - * - * @see [InstanceGroups Overview]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroups} - * - * @param {string} name - Name of the existing instance group. - * @returns {InstanceGroup} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const instanceGroup = zone.instanceGroup('my-instance-group'); - */ - instanceGroup(name) { - return new InstanceGroup(this, name); - } - /** - * Get a reference to a Google Compute Engine instance group manager. - * - * @see [InstanceGroupManagers Overview]{@link https://cloud.google.com/compute/docs/reference/v1/instanceGroupManagers} - * - * @param {string} name - Name of the existing instance group manager. - * @returns {InstanceGroupManager} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const instanceGroupManager = zone.instanceGroupManager('my-instance-group-manager'); - */ - instanceGroupManager(name) { - return new InstanceGroupManager(this, name); - } - /** - * Get a reference to a Google Compute Engine machine type. - * - * @see [Machine Types Overview]{@link https://cloud.google.com/compute/docs/machine-types} - * @see [MachineType Resource]{@link https://cloud.google.com/compute/docs/reference/v1/machineTypes} - * - * @param {string} name - Name of the existing machine type. - * @returns {MachineType} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const machineType = zone.machineType('g1-small'); - */ - machineType(name) { - return new MachineType(this, name); - } - /** - * Get a reference to a Google Compute Engine zone operation. - * - * @see [Zone Operation Overview]{@link https://cloud.google.com/compute/docs/reference/v1/zoneOperations} - * - * @param {string} name - Name of the existing operation. - * @returns {Operation} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const operation = zone.operation('operation-1445532685163-8b137d2a-1822afe7'); - */ - operation(name) { - return new Operation(this, name); - } - /** - * Get a reference to a Google Compute Engine virtual machine instance. - * - * @see [Instances and Networks]{@link https://cloud.google.com/compute/docs/instances-and-network} - * - * @param {string} name - Name of the virtual machine. - * @returns {VM} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * const vm = zone.vm('vm-name'); - */ - vm(name) { - return new VM(this, name); - } - /** - * This method attempts to create a firewall rule to allow tcp:80 connections. - * - * @private - * - * @param {function} callback - The callback function. - * @param {?error} callback.err - If the firewall couldn't be created and it - * didn't already exist. - */ - createHttpServerFirewall_(callback) { - this.compute.createFirewall( - 'default-allow-http', - { - protocols: { - tcp: [80], - }, - ranges: ['0.0.0.0/0'], - tags: ['http-server'], - }, - err => { - // If it already exists, we're all good. - callback(err && err.code !== 409 ? err : null); - } - ); - } - /** - * This method attempts to create a firewall rule to allow tcp:443 connections. - * - * @private - * - * @param {function} callback - The callback function. - * @param {?error} callback.err - If the firewall couldn't be created and it - * didn't already exist. - */ - createHttpsServerFirewall_(callback) { - this.compute.createFirewall( - 'default-allow-https', - { - protocols: { - tcp: [443], - }, - ranges: ['0.0.0.0/0'], - tags: ['https-server'], - }, - err => { - // If it already exists, we're all good. - callback(err && err.code !== 409 ? err : null); - } - ); - } -} - -/** - * Get a list of {@link Autoscaler} objects from this zone as a - * readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link Zone#getAutoscalers} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getAutoscalersStream() - * .on('error', console.error) - * .on('data', function(autoscaler) { - * // `autoscaler` is an `Autoscaler` object. - * }) - * .on('end', function() { - * // All autoscalers retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * zone.getAutoscalersStream() - * .on('data', function(autoscaler) { - * this.end(); - * }); - */ -Zone.prototype.getAutoscalersStream = paginator.streamify('getAutoscalers'); - -/** - * Get a list of {@link Disk} objects in this zone as a readable object - * stream. - * - * @param {object=} options - Configuration object. See - * {@link Zone#getDisks} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getDisksStream() - * .on('error', console.error) - * .on('data', function(disk) { - * // `disk` is a `Disk` object. - * }) - * .on('end', function() { - * // All disks retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * zone.getDisksStream() - * .on('data', function(disk) { - * this.end(); - * }); - */ -Zone.prototype.getDisksStream = paginator.streamify('getDisks'); - -/** - * Get a list of {@link InstanceGroup} objects for this zone as a - * readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link Zone#getInstanceGroups} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getInstanceGroupsStream() - * .on('error', console.error) - * .on('data', function(instanceGroup) { - * // `instanceGroup` is an `InstanceGroup` object. - * }) - * .on('end', function() { - * // All instance groups retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * zone.getInstanceGroupsStream() - * .on('data', function(instanceGroup) { - * this.end(); - * }); - */ -Zone.prototype.getInstanceGroupsStream = - paginator.streamify('getInstanceGroups'); - -/** - * Get a list of {@link MachineType} objects for this zone as a - * readable object stream. - * - * @param {object=} options - Configuration object. See - * {@link Zone#getMachineTypes} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getMachineTypesStream() - * .on('error', console.error) - * .on('data', function(machineType) { - * // `machineType` is a `MachineType` object. - * }) - * .on('end', function() { - * // All machine types retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * zone.getMachineTypesStream() - * .on('data', function(machineType) { - * this.end(); - * }); - */ -Zone.prototype.getMachineTypesStream = paginator.streamify('getMachineTypes'); - -/** - * Get a list of {@link Operation} objects for this zone as a readable - * object stream. - * - * @param {object=} options - Configuration object. See - * {@link Zone#getOperations} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getOperationsStream() - * .on('error', console.error) - * .on('data', function(operation) { - * // `operation` is an `Operation` object. - * }) - * .on('end', function() { - * // All operations retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * zone.getOperationsStream() - * .on('data', function(operation) { - * this.end(); - * }); - */ -Zone.prototype.getOperationsStream = paginator.streamify('getOperations'); - -/** - * Get a list of {@link VM} instances in this zone as a readable object - * stream. - * - * @param {object=} options - Configuration object. See - * {@link Zone#getVMs} for a complete list of options. - * @returns {stream} - * - * @example - * const Compute = require('@google-cloud/compute'); - * const compute = new Compute(); - * const zone = compute.zone('us-central1-a'); - * - * zone.getVMsStream() - * .on('error', console.error) - * .on('data', function(vm) { - * // `vm` is a `VM` object. - * }) - * .on('end', function() { - * // All instances retrieved. - * }); - * - * //- - * // If you anticipate many results, you can end a stream early to prevent - * // unnecessary processing and API requests. - * //- - * zone.getVMsStream() - * .on('data', function(vm) { - * this.end(); - * }); - */ -Zone.prototype.getVMsStream = paginator.streamify('getVMs'); - -/*! Developer Documentation - * - * These methods can be auto-paginated. - */ -paginator.extend(Zone, [ - 'getAutoscalers', - 'getDisks', - 'getInstanceGroups', - 'getInstanceGroupManagers', - 'getMachineTypes', - 'getOperations', - 'getVMs', -]); - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Zone, { - exclude: [ - 'autoscaler', - 'disk', - 'instanceGroup', - 'instanceGroupManager', - 'machineType', - 'operation', - 'vm', - ], -}); - -/** - * Reference to the {@link Zone} class. - * @name module:@google-cloud/compute.Zone - * @see Zone - */ -module.exports = Zone; diff --git a/synth.metadata b/synth.metadata new file mode 100644 index 00000000..333523b4 --- /dev/null +++ b/synth.metadata @@ -0,0 +1,29 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "git@github.com:googleapis/nodejs-compute.git", + "sha": "13d2f4172de5f51db0c85771fd254c392ffcd38c" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "df7fc1e3a6df4316920ab221431945cdf9aa7217" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis-discovery", + "apiName": "compute", + "apiVersion": "v1", + "language": "nodejs", + "generator": "bazel" + } + } + ] +} \ No newline at end of file diff --git a/synth.py b/synth.py new file mode 100644 index 00000000..3098f292 --- /dev/null +++ b/synth.py @@ -0,0 +1,49 @@ +# 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. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.node as node +import logging + +logging.basicConfig(level=logging.DEBUG) + +AUTOSYNTH_MULTIPLE_COMMITS = True + + +gapic = gcp.GAPICBazel() +common_templates = gcp.CommonTemplates() + +versions = ['v1'] +name = 'compute' + +for version in versions: + library = gapic.node_library(name, version, diregapic=True) + + # skip index, protos, package.json, and README.md + s.copy( + library, + excludes=['package.json'] + ) + +templates = common_templates.node_library(source_location='build/src') +s.copy(templates) + +s.replace("src/v1/url_maps_client.ts", + "\(/cdn/docs/invalidating-cached-content", + "(https://cloud.google.com/cdn/docs/invalidating-cached-content") + +node.postprocess_gapic_library() diff --git a/system-test/compute.js b/system-test/compute.js index 7613f822..9ea26768 100644 --- a/system-test/compute.js +++ b/system-test/compute.js @@ -1,4 +1,4 @@ -// Copyright 2015 Google LLC +// 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. @@ -15,1452 +15,449 @@ 'use strict'; const assert = require('assert'); -const concat = require('concat-stream'); +const expect = require('chai').expect; const uuid = require('uuid'); -const {promisify} = require('util'); -let testFlag = true; +const compute = require('../'); -const Compute = require('../'); +const DiskType = compute.protos.google.cloud.compute.v1.AttachedDisk.Type; describe('Compute', () => { - // Since the Compute Engine API is rather large and involves long-running - // tasks for nearly every request, our system tests follow a pattern designed - // to create a minimal amount of resources. - // - // Each `describe` block tests one object type. Before the tests run, the - // object is created. - // - // The created object is then used and expected to exist for the rest of the - // tests in that `describe` block. - // - // After all describe blocks have run, all of the created objects are - // deleted. This will also pick up any previously-created objects that were - // unable to be removed if a prior test run had unexpectedly quit. - - const TESTS_PREFIX = 'gcloud'; - const TEST_ID = uuid.v4().split('-')[0]; - const FULL_PREFIX = `${TESTS_PREFIX}-${TEST_ID}`; - const REGION_NAME = 'us-central1'; - const ZONE_NAME = 'us-central1-a'; - - const compute = new Compute(); - const region = compute.region(REGION_NAME); - const zone = compute.zone(ZONE_NAME); - - const computeRequest = promisify(compute.request).bind(compute); - const zoneRequest = promisify(zone.request).bind(zone); - - before(() => deleteAllTestObjects({expiredOnly: true})); - after(() => deleteAllTestObjects({expiredOnly: false})); - - describe('addresses', () => { - const ADDRESS_NAME = generateName('address'); - const address = region.address(ADDRESS_NAME); + const region = 'us-central1'; + const zone = 'us-central1-a'; + let client = null; + let project = null; + let dirty = false; + let operationsClient = null; + + before(async () => { + operationsClient = new compute.ZoneOperationsClient({fallback: 'rest'}); + project = await operationsClient.getProjectId(); + }); - before(() => create(address)); + describe('Addresses', () => { + let ADDRESS_NAME = null; - it('should have created the address', async () => { - const [metadata] = await address.getMetadata(); - assert.strictEqual(metadata.name, ADDRESS_NAME); - }); - - it('should get a list of addresses', async () => { - const [addresses] = await compute.getAddresses(); - assert(addresses.length > 0); + before(async () => { + client = new compute.AddressesClient({fallback: 'rest'}); + ADDRESS_NAME = generateName('address'); }); - it('should get a list of addresses in stream mode', done => { - let resultsMatched = 0; - compute - .getAddressesStream() - .on('error', done) - .on('data', () => { - resultsMatched++; - }) - .on('end', () => { - assert(resultsMatched > 0); - done(); + after(async () => { + if (dirty) { + await client.delete({ + project, + region, + address: ADDRESS_NAME, }); + } }); - it('should access an address through a Region', async () => { - return region.address(ADDRESS_NAME).getMetadata(); - }); - }); - - describe('autoscalers', () => { - const AUTOSCALER_NAME = generateName('autoscaler'); - const autoscaler = zone.autoscaler(AUTOSCALER_NAME); - - const NETWORK_NAME = generateName('network'); - const network = compute.network(NETWORK_NAME); + it('addresses create, get', async () => { + const addressResource = { + name: ADDRESS_NAME, + description: 'тест', + }; - const INSTANCE_TEMPLATE_NAME = generateName('instance-template'); - const INSTANCE_GROUP_MANAGER_NAME = generateName('instance-group-manager'); - - before(async () => { - await create(network, {range: '10.240.0.0/16'}); - await createInstanceTemplate( - INSTANCE_TEMPLATE_NAME, - network.formattedName - ); - await createInstanceGroupManager( - INSTANCE_GROUP_MANAGER_NAME, - [ - 'https://www.googleapis.com/compute/v1/projects', - compute.projectId, - 'global/instanceTemplates', - INSTANCE_TEMPLATE_NAME, - ].join('/') - ); - await create(autoscaler, { - coolDown: 30, - cpu: 80, - loadBalance: 40, - maxReplicas: 5, - minReplicas: 1, - target: INSTANCE_GROUP_MANAGER_NAME, + await client.insert({ + project, + region, + addressResource, }); - }); + dirty = true; - it('should have created the autoscaler', async () => { - const [metadata] = await autoscaler.getMetadata(); - assert.strictEqual(metadata.name, AUTOSCALER_NAME); - - assert.deepStrictEqual(metadata.autoscalingPolicy, { - coolDownPeriodSec: 30, - cpuUtilization: { - utilizationTarget: 0.8, - }, - loadBalancingUtilization: { - utilizationTarget: 0.4, - }, - maxNumReplicas: 5, - minNumReplicas: 1, - mode: 'ON', + const [getResponse] = await client.get({ + project, + region, + address: addressResource.name, }); - }); - it('should get a list of autoscalers', async () => { - const [autoscalers] = await compute.getAutoscalers(); - assert(autoscalers.length > 0); + assert.strictEqual(getResponse.name, ADDRESS_NAME); }); - it('should get a list of autoscalers in stream mode', done => { - let resultsMatched = 0; - compute - .getAutoscalersStream() - .on('error', done) - .on('data', () => { - resultsMatched++; - }) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should set & get metadata', async () => { - const description = 'description'; - await awaitResult( - autoscaler.setMetadata({ - description: description, - }) + it('addresses list, aggregated_list', async () => { + const [listResponse] = await client.list({ + project, + region, + }); + let presented = false; + for (const item of listResponse) { + if (item.name === ADDRESS_NAME) { + presented = true; + } + } + assert.strictEqual( + presented, + true, + 'address was not found in list response.' ); - const [metadata] = await autoscaler.getMetadata(); - assert.strictEqual(metadata.description, description); - }); - }); - - describe('disks', () => { - const DISK_NAME = generateName('disk'); - const disk = zone.disk(DISK_NAME); - - before(() => create(disk, {os: 'ubuntu'})); - - it('should have created the disk', async () => { - const [metadata] = await disk.getMetadata(); - assert.strictEqual(metadata.name, DISK_NAME); - }); - - it('should get a list of disks', async () => { - const [disks] = await compute.getDisks(); - assert(disks.length > 0); - }); - - it('should get a list of disks in stream mode', done => { - let resultsMatched = 0; - compute - .getDisksStream() - .on('error', done) - .on('data', () => { - resultsMatched++; - }) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should access a disk through a Zone', async () => { - return zone.disk(DISK_NAME).getMetadata(); - }); - - it('should take and delete a snapshot', async () => { - const [snapshot, operation] = await disk - .snapshot(generateName('snapshot')) - .create(); - await operation.promise(); - await snapshot.getMetadata(); - await snapshot.delete(); - }); - - it('should run operation as a promise', async () => { - const snapshot = disk.snapshot(generateName('snapshot')); - const [, operation] = await snapshot.create(); - return operation.promise(); - }); - }); - - describe('firewalls', () => { - const FIREWALL_NAME = generateName('firewall'); - const firewall = compute.firewall(FIREWALL_NAME); - - const CONFIG = { - protocols: { - tcp: [3000], - icmp: true, // This should open all ports on this protocol - udp: [], // This should not open ports on this protocol at all - }, - - ranges: ['0.0.0.0/0'], - }; - const expectedMetadata = { - allowed: [ - { - IPProtocol: 'tcp', - ports: ['3000'], - }, - { - IPProtocol: 'icmp', - }, - ], - - sourceRanges: CONFIG.ranges, - }; - - before(() => create(firewall, CONFIG)); - - it('should have opened the correct connections', async () => { - const [metadata] = await firewall.getMetadata(); - assert.deepStrictEqual(metadata.allowed, expectedMetadata.allowed); - assert.deepStrictEqual( - metadata.sourceRanges, - expectedMetadata.sourceRanges + const iterable = client.aggregatedListAsync({ + project, + }); + presented = false; + for await (const [location, addressesObject] of iterable) { + if (location === 'regions/' + region) { + const addresses = addressesObject.addresses; + addresses.forEach(address => { + if (address.name === ADDRESS_NAME) { + presented = true; + } + }); + } + } + assert.strictEqual( + presented, + true, + 'address was not found in aggregated list response.' ); }); - it('should get a list of firewalls', async () => { - const [firewalls] = await compute.getFirewalls(); - assert(firewalls.length > 0); - }); - - it('should get a list of firewalls in stream mode', done => { - let resultsMatched = 0; - compute - .getFirewallsStream() - .on('error', done) - .on('data', () => { - resultsMatched++; - }) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - describe('health checks', () => { - const HEALTH_CHECK_NAME = generateName('health-check'); - const healthCheck = compute.healthCheck(HEALTH_CHECK_NAME); - - const OPTIONS = { - description: 'A health check.', - interval: 50, - timeout: 25, - }; - - before(() => create(healthCheck, OPTIONS)); - - it('should have created the correct health check', async () => { - const [metadata] = await healthCheck.getMetadata(); - assert.strictEqual(metadata.description, OPTIONS.description); - assert.strictEqual(metadata.checkIntervalSec, OPTIONS.interval); - assert.strictEqual(metadata.timeoutSec, OPTIONS.timeout); - }); - - it('should set metadata', async () => { - const description = 'The best description. Possibly ever.'; - await awaitResult(healthCheck.setMetadata({description})); - const [metadata] = await healthCheck.getMetadata(); - assert.strictEqual(metadata.description, description); - }); - - it('should get a list of health checks', async () => { - const [healthChecks] = await compute.getHealthChecks(); - assert(healthChecks.length > 0); - }); - - it('should get a list of health checks in stream mode', done => { - let resultsMatched = 0; - compute - .getHealthChecksStream() - .on('error', done) - .on('data', () => { - resultsMatched++; - }) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - describe('health checks (https)', () => { - const HEALTH_CHECK_NAME = generateName('health-check'); - const healthCheck = compute.healthCheck(HEALTH_CHECK_NAME, { - https: true, - }); - - const OPTIONS = { - description: 'A health check.', - interval: 50, - timeout: 25, - }; - - before(() => create(healthCheck, OPTIONS)); - - it('should have created the correct health check', async () => { - const [metadata] = await healthCheck.getMetadata(); - assert.strictEqual(metadata.description, OPTIONS.description); - assert.strictEqual(metadata.checkIntervalSec, OPTIONS.interval); - assert.strictEqual(metadata.timeoutSec, OPTIONS.timeout); - }); - - it('should set metadata', async () => { - const description = 'The best description. Possibly ever.'; - await awaitResult(healthCheck.setMetadata({description})); - const [metadata] = await healthCheck.getMetadata(); - assert.strictEqual(metadata.description, description); - }); - - it('should get a list of health checks', async () => { - const [healthChecks] = await compute.getHealthChecks({https: true}); - assert(healthChecks.length > 0); - }); - - it('should get a list of health checks in stream mode', done => { - let resultsMatched = 0; - compute - .getHealthChecksStream({https: true}) - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - describe('images', () => { - const DISK = zone.disk(generateName('disk')); - const IMAGE = compute.image(generateName('image')); - - before(() => create(DISK, {os: 'ubuntu'})); - before(() => create(IMAGE, DISK)); - - it('should create an image', async () => { - const [exists] = await IMAGE.exists(); - assert.strictEqual(exists, true); - }); - - it('should create an image from an image object', async () => { - const image = compute.image(generateName('image')); - const [, operation] = await image.create(DISK, {labels: {a: 'b'}}); - await operation.promise(); - }); - - it('should list images', async () => { - const [images] = await compute.getImages(); - assert(images.length > 0); - }); - - it('should list images in stream mode', done => { - let resultsMatched = 0; - compute - .getImagesStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); + it('addresses delete', async () => { + await client.delete({ + project, + region, + address: ADDRESS_NAME, + }); + dirty = false; }); }); - describe('instance groups', () => { - const INSTANCE_GROUP_NAME = generateName('instance-group'); - const instanceGroup = zone.instanceGroup(INSTANCE_GROUP_NAME); - - const OPTIONS = { - description: 'new instance group', - ports: { - http: 80, - }, - }; - - before(() => create(instanceGroup, OPTIONS)); - - it('should have created an instance group', async () => { - const [metadata] = await instanceGroup.getMetadata(); - assert.strictEqual(metadata.name, INSTANCE_GROUP_NAME); - assert.strictEqual(metadata.description, OPTIONS.description); - assert.deepStrictEqual(metadata.namedPorts, [ - { - name: 'http', - port: 80, - }, - ]); - }); + describe('Instances', () => { + let INSTANCE_NAME = null; - it('should list project instance groups', async () => { - const [instanceGroups] = await compute.getInstanceGroups(); - assert(instanceGroups.length > 0); - }); - - it('should list project instance groups in stream mode', done => { - let resultsMatched = 0; - compute - .getInstanceGroupsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should list zonal instance groups', async () => { - const [instanceGroups] = await zone.getInstanceGroups(); - assert(instanceGroups.length > 0); + before(async () => { + client = new compute.InstancesClient({fallback: 'rest'}); + INSTANCE_NAME = generateName('instance'); }); - it('should list zonal instance groups in stream mode', done => { - let resultsMatched = 0; - zone - .getInstanceGroupsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); + after(async function () { + this.timeout(10 * 60 * 1000); + if (dirty) { + await client.delete({ + project, + zone, + instance: INSTANCE_NAME, }); + } }); - it('should set named ports', async () => { - const ports = OPTIONS.ports; - await awaitResult(instanceGroup.setPorts(ports)); - const [metadata] = await instanceGroup.getMetadata(); - assert.deepStrictEqual(metadata.namedPorts, [ - { - name: 'http', - port: 80, - }, - ]); - }); - - describe('adding and removing VMs', () => { - const vm = zone.vm(generateName('vm')); - - before(() => create(vm, {os: 'ubuntu'})); - - it('should add a VM to the instance group', async () => { - return awaitResult(instanceGroup.add(vm)); - }); - - it('should list the VMs', async () => { - const [vms] = await instanceGroup.getVMs(); - const vmNamesInGroup = vms.map(x => x.name); - assert(vmNamesInGroup.indexOf(vm.name) > -1); + it('instance create and fetch', async function () { + this.timeout(10 * 60 * 1000); + const instanceResource = { + name: INSTANCE_NAME, + description: 'test', + machineType: `zones/${zone}/machineTypes/n1-standard-1`, + disks: [ + { + boot: true, + initializeParams: { + sourceImage: + 'projects/debian-cloud/global/images/family/debian-10', + }, + autoDelete: true, + type: DiskType.PERSISTENT, + }, + ], + networkInterfaces: [ + { + name: 'default', + }, + ], + }; + const [insertResponse] = await client.insert({ + project, + zone, + instanceResource, }); + dirty = true; - it('should list the VMs in stream mode', done => { - instanceGroup - .getVMsStream() - .on('error', done) - .pipe( - concat(vms => { - const vmNamesInGroup = vms.map(x => x.name); - assert(vmNamesInGroup.indexOf(vm.name) > -1); - done(); - }) - ); - }); + await waitZonalOperation(insertResponse); - it('should remove a VM from the instance group', async () => { - return awaitResult(instanceGroup.remove(vm)); + const [getResponse] = await client.get({ + project, + zone, + instance: INSTANCE_NAME, }); - }); - }); - - describe('machine types', () => { - it('should get a list of machine types', async () => { - const [machineTypes] = await compute.getMachineTypes(); - assert(machineTypes.length > 0); - }); - - it('should get a list of machine types in stream mode', done => { - let resultsMatched = 0; - compute - .getMachineTypesStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get the metadata', done => { - compute - .getMachineTypesStream() - .on('error', done) - .once('data', machineType => { - machineType.getMetadata((err, metadata) => { - assert.strictEqual(metadata.kind, 'compute#machineType'); - done(); - }); - }); - }); - }); - - describe('machine types (zonal)', () => { - it('should get a list of machine types', async () => { - const [machineTypes] = await zone.getMachineTypes(); - assert(machineTypes.length > 0); - }); - - it('should get a list of machine types in stream mode', done => { - let resultsMatched = 0; - zone - .getMachineTypesStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get the metadata', done => { - zone - .getMachineTypesStream() - .on('error', done) - .once('data', machineType => { - machineType.getMetadata((err, metadata) => { - assert.strictEqual(metadata.kind, 'compute#machineType'); - done(); - }); - }); - }); - }); - - describe('networks', () => { - const NETWORK_NAME = generateName('network'); - const network = compute.network(NETWORK_NAME); - - const CONFIG = { - range: '10.240.0.0/16', - }; - - before(() => create(network, CONFIG)); - - it('should have opened the correct range', async () => { - const [metadata] = await network.getMetadata(); - assert.strictEqual(metadata.IPv4Range, CONFIG.range); - }); - it('should get a list of networks', async () => { - const [networks] = await compute.getNetworks(); - assert(networks.length > 0); - }); - - it('should get a list of networks in stream mode', done => { - let resultsMatched = 0; - compute - .getNetworksStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - describe('operations', () => { - it('should get a list of operations', async () => { - const [operations] = await compute.getOperations(); - assert(operations.length > 0); - }); - - it('should get a list of operations in stream mode', done => { - let resultsMatched = 0; - compute - .getOperationsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - describe('project', () => { - let project; - beforeEach(() => { - project = compute.project(); - }); - - it('should get the project', async () => { - const [p] = await project.get(); - assert.ok(p.metadata); - }); - - it('should get metadata about the project', async () => { - const [metadata] = await project.getMetadata(); - assert.ok(metadata); - }); - }); - - describe('regions', () => { - it('should get a list of regions', async () => { - const [regions] = await compute.getRegions(); - assert(regions.length > 0); - }); - - it('should get a list of regions in stream mode', done => { - let resultsMatched = 0; - compute - .getRegionsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get a list of addresses', async () => { - const [addresses] = await region.getOperations(); - assert(addresses.length > 0); - }); - - it('should get a list of addresses in stream mode', done => { - let resultsMatched = 0; - region - .getOperationsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get a list of operations', async () => { - const [operations] = await region.getOperations(); - assert(operations.length > 0); - }); - - it('should get a list of operations in stream mode', done => { - let resultsMatched = 0; - region - .getOperationsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - describe('rules', () => { - const RULE_NAME = generateName('rule'); - const NETWORK_NAME = generateName('network'); - const SUBNETWORK_NAME = generateName('subnetwork'); - const BACKEND_SERVICE_NAME = generateName('backend-service'); - let RULE; - let SUBNETWORK; - - before(async () => { - const projectId = await compute.authClient.getProjectId(); - const resourceUrlPrefix = `https://www.googleapis.com/compute/v1/projects/${projectId}`; - const [network, networkOperation] = await compute.createNetwork( - NETWORK_NAME, - { - autoCreateSubnetworks: false, - } + assert.strictEqual(getResponse.name, INSTANCE_NAME); + assert.strictEqual( + getResponse.shieldedInstanceConfig.enableSecureBoot, + false ); - await networkOperation.promise(); + }); - const [subnetwork, subnetworkOperation] = await network.createSubnetwork( - SUBNETWORK_NAME, - { - region: 'us-central1', - range: '10.0.1.0/24', - } - ); - SUBNETWORK = subnetwork; - await subnetworkOperation.promise(); + it('instances patch', async function () { + this.timeout(10 * 60 * 1000); + const [stopResponse] = await client.stop({ + project, + zone, + instance: INSTANCE_NAME, + }); - const region = compute.region('us-central1'); + await waitZonalOperation(stopResponse); - const resp = await computeRequest({ - method: 'POST', - uri: '/regions/us-central1/backendServices', - json: { - name: BACKEND_SERVICE_NAME, - loadBalancingScheme: 'INTERNAL', + const [patchResponse] = await client.updateShieldedInstanceConfig({ + project, + zone, + shieldedInstanceConfigResource: { + enableSecureBoot: true, }, + instance: INSTANCE_NAME, }); - await region.operation(resp.name).promise(); - const [rule, ruleOperation] = await region.createRule(RULE_NAME, { - loadBalancingScheme: 'INTERNAL', - backendService: `${resourceUrlPrefix}/regions/us-central1/backendServices/${BACKEND_SERVICE_NAME}`, - subnetwork: `${resourceUrlPrefix}/regions/us-central1/subnetworks/${SUBNETWORK_NAME}`, - network: `${resourceUrlPrefix}/global/networks/${NETWORK_NAME}`, - ports: ['80', '81', '82'], + await waitZonalOperation(patchResponse); + + const [fetched] = await client.get({ + project, + zone, + instance: INSTANCE_NAME, }); + assert.strictEqual(fetched.shieldedInstanceConfig.enableSecureBoot, true); + }); - RULE = rule; + it('API errors propagated', async () => { + let error = null; try { - const timeOutPromise = new Promise((resolve, reject) => { - setTimeout(() => reject('Timed out!'), 1100000); + await client.get({ + project, + zone, + instance: 'notexist555', }); - await Promise.race([timeOutPromise, await ruleOperation.promise()]); } catch (err) { - testFlag = false; + error = err; } + expect(error).to.be.an('Error'); + expect(error.message).to.contain('was not found'); + expect(error.code).to.equal(404); }); - after(async () => { - const [firewalls] = await compute.getFirewalls(); - const firewallsToDelete = firewalls.filter(x => - x.name.startsWith(TESTS_PREFIX) - ); - for (const firewall of firewallsToDelete) { - await firewall.delete(); - } - if (testFlag) { - const [ruleOperation] = await RULE.delete(); - await ruleOperation.promise(); - await computeRequest({ - method: 'DELETE', - uri: 'regions/us-central1/backendServices/' + BACKEND_SERVICE_NAME, - }); - } - - const [subnetworkOperation] = await SUBNETWORK.delete(); - await subnetworkOperation.promise(); - }); - - it('should have created the right rule', async () => { - if (testFlag) { - const [metadata] = await RULE.getMetadata(); - assert.strictEqual(metadata.name, RULE_NAME); - assert.strictEqual(metadata.IPProtocol, 'TCP'); - assert.deepStrictEqual(metadata.ports, ['80', '81', '82']); - assert.strictEqual(metadata.loadBalancingScheme, 'INTERNAL'); - } - }); - }); - - describe('rules (regional)', () => { - const RULE_NAME = generateName('rule'); - const rule = region.rule(RULE_NAME); - const TARGET_INSTANCE_NAME = generateName('target-instance'); - const VM_NAME = generateName('vm'); - const vm = zone.vm(VM_NAME); - - before(async () => { - await create(vm, { - os: 'ubuntu', - http: true, - }); - await createTargetInstance(TARGET_INSTANCE_NAME, VM_NAME); - await create(rule, { - target: [ - 'zones/' + zone.name + '/targetInstances/' + TARGET_INSTANCE_NAME, - ].join(''), - range: '8000-9000', + it('instances update desc to an empty string', async function () { + this.timeout(10 * 60 * 1000); + const [instance] = await client.get({ + project, + zone, + instance: INSTANCE_NAME, }); - }); - - it('should get a list of rules', async () => { - const [rules] = await region.getRules(); - assert(rules.length > 0); - }); - - it('should have created the right rule', async () => { - let target = [ - 'https://www.googleapis.com/compute/v1/projects/' + compute.projectId, - '/zones/' + zone.name + '/targetInstances/' + TARGET_INSTANCE_NAME, - ].join(''); - - const [metadata] = await rule.getMetadata(); - assert.strictEqual(metadata.name, RULE_NAME); - assert.strictEqual(metadata.IPProtocol, 'TCP'); - assert.strictEqual(metadata.portRange, '8000-9000'); - - // The projectId may have been replaced depending on how the system - // tests are being run, so let's not care about that. - target = target.replace(/projects\/[^/]*\//, ''); - metadata.target = metadata.target.replace(/projects\/[^/]*\//, ''); - assert.strictEqual(metadata.target, target); - }); - }); - - describe('services', () => { - const service = compute.service(generateName('service')); - - const INSTANCE_GROUP_NAME = generateName('instance-group'); - const HEALTH_CHECK_NAME = generateName('health-check'); - - before( - async () => - await createService( - service.name, - INSTANCE_GROUP_NAME, - HEALTH_CHECK_NAME - ) - ); - - it('should get a list of services', async () => { - const [services] = await compute.getServices(); - assert(services.length > 0); - }); - - it('should get a list of services in stream mode', done => { - let resultsMatched = 0; - compute - .getServicesStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get the results of a health check', async () => { - const [status] = await service.getHealth({ - name: INSTANCE_GROUP_NAME, + assert.strictEqual(instance.description, 'test'); + instance.description = ''; + const [updateOp] = await client.update({ + project: project, zone: zone, + instance: INSTANCE_NAME, + instanceResource: instance, }); - assert.strictEqual(Array.isArray(status), true); - }); - - it('should set metadata', async () => { - const description = 'The best description. Possibly ever.'; - await awaitResult(service.setMetadata({description})); - const [metadata] = await service.getMetadata(); - assert.strictEqual(metadata.description, description); - }); - }); - - describe('snapshots', () => { - it('should get a list of snapshots', async () => { - const [snapshots] = await compute.getSnapshots(); - assert(snapshots.length > 0); - }); - - it('should get a list of snapshots in stream mode', done => { - let resultsMatched = 0; - compute - .getSnapshotsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - describe('subnetworks', () => { - const NETWORK_NAME = generateName('network'); - const network = compute.network(NETWORK_NAME); - const SUBNETWORK_NAME = generateName('subnetwork'); - const subnetwork = region.subnetwork(SUBNETWORK_NAME); - const NETWORK_CONFIG = { - autoCreateSubnetworks: false, - }; - const SUBNETWORK_CONFIG = { - network: 'global/networks/' + NETWORK_NAME, - range: '10.0.1.0/24', - }; - - before(async () => { - await create(network, NETWORK_CONFIG); - await create(subnetwork, SUBNETWORK_CONFIG); - }); - - it('should have created the subnetwork', async () => { - const [metadata] = await subnetwork.getMetadata(); - assert.strictEqual(metadata.name, SUBNETWORK_NAME); - }); - - it('should get a list of subnetworks', async () => { - const [subnetworks] = await compute.getSubnetworks(); - assert(subnetworks.length > 0); - }); - - it('should get a list of subnetworks in stream mode', done => { - let resultsMatched = 0; - compute - .getSubnetworksStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get a list of regional subnetworks', async () => { - const [subnetworks] = await region.getSubnetworks(); - assert(subnetworks.length > 0); - }); - - it('should get a list of regional subnetworks in stream', done => { - let resultsMatched = 0; - region - .getSubnetworksStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should access a subnetwork through a Region', async () => { - return region.subnetwork(SUBNETWORK_NAME).getMetadata(); + await waitZonalOperation(updateOp); + const [fetched] = await client.get({ + project, + zone, + instance: INSTANCE_NAME, + }); + assert.strictEqual(fetched.description, ''); }); }); - describe('vms', () => { - const VM_NAME = generateName('vm'); - const vm = zone.vm(VM_NAME); + describe('InstancesGroup Manager', () => { + let clientTemplates = null; + let clientInstanceGroups = null; + let instanceGroupName = null; + let instanceTemplateName = null; before(async () => { - await create(vm, {os: 'ubuntu', http: true}); - }); - - it('should have enabled HTTP connections', async () => { - const [tags] = await vm.getTags(); - assert.deepStrictEqual(tags, ['http-server']); - }); - - it('should get a list of vms', async () => { - const [vms] = await compute.getVMs(); - assert(vms.length > 0); - }); - - it('should get a list of vms in stream mode', done => { - let resultsMatched = 0; - compute - .getVMsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should access a VM through a Zone', async () => { - await zone.vm(VM_NAME).getMetadata(); - }); - - it('should attach and detach a disk', async () => { - const disk = zone.disk(generateName('disk')); - await awaitResult(disk.create({os: 'ubuntu'})); - await awaitResult(vm.attachDisk(disk)); - await awaitResult(vm.detachDisk(disk)); - }); - - it('should get serial port output', async () => { - return vm.getSerialPortOutput(); - }); - - it('should set labels', async () => { - let [labels, fingerprint] = await vm.getLabels(); - await awaitResult(vm.setLabels({foo: 'bar'}, fingerprint)); - [labels, fingerprint] = await vm.getLabels(); - assert.strictEqual(labels.foo, 'bar'); - }); - - it('should set tags', async () => { - const newTagName = 'new-tag'; - const [tags, fingerprint] = await vm.getTags(); - tags.push(newTagName); - await awaitResult(vm.setTags(tags, fingerprint)); - const [t2] = await vm.getTags(); - assert(t2.indexOf(newTagName) > -1); - }); - - it('should reset', async () => { - return awaitResult(vm.reset()); - }); - - it('should resize the machine', async () => { - const machineType = 'n1-standard-2'; - await vm.resize(machineType); - const [metadata] = await vm.getMetadata(); - const expectedMachineType = [ - 'https://www.googleapis.com/compute/v1', - 'zones', - zone.id, - 'machineTypes', - machineType, - ].join('/'); - - // The projectId may have been replaced depending on how the system - // tests are being run, so let's not care about that. - metadata.machineType = metadata.machineType.replace( - /projects\/[^/]*\//, - '' - ); - assert.strictEqual(metadata.machineType, expectedMachineType); - }); - - it('should set metadata', async () => { - const key = 'newKey'; - const value = 'newValue'; - await awaitResult(vm.setMetadata({[key]: value})); - await vm.getMetadata(); - assert.deepStrictEqual(vm.metadata.metadata.items, [{key, value}]); - }); - - it('should update the VM', async () => { - await awaitResult(vm.update({deletionProtection: false})); - const [metadata] = await vm.getMetadata(); - assert.strictEqual(metadata.deletionProtection, false); - }); - - it('should allow updating old metadata', async () => { - const key = 'newKey'; - const value = 'newValue'; - const overriddenValue = `${value}${value}`; - await awaitResult(vm.setMetadata({[key]: value})); - await awaitResult(vm.setMetadata({[key]: overriddenValue})); - await vm.getMetadata(); - assert.deepStrictEqual(vm.metadata.metadata.items, [ - {key, value: overriddenValue}, - ]); - }); - - it('should allow removing old metadata', async () => { - const key = 'newKey'; - const value = 'newValue'; - await awaitResult(vm.setMetadata({[key]: value})); - await awaitResult(vm.setMetadata({[key]: null})); - await vm.getMetadata(); - assert.strictEqual(vm.metadata.metadata.items, undefined); - }); - - it('should start', async () => { - return awaitResult(vm.start()); - }); - - it('should stop and trigger STOPPING `waitFor` event', async () => { - await Promise.all([ - vm.waitFor('STOPPING', {timeout: 600}), - awaitResult(vm.stop()), - ]); - }); - }); - - describe('zones', () => { - it('should get a list of zones', async () => { - const [zones] = await compute.getZones(); - assert(zones.length > 0); - }); - - it('should get a list of zones in stream mode', done => { - let resultsMatched = 0; - compute - .getZonesStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get a list of disks', async () => { - const [disks] = await zone.getDisks(); - assert(disks.length > 0); - }); - - it('should get a list of disks in stream mode', done => { - let resultsMatched = 0; - zone - .getDisksStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - - it('should get a list of operations', async () => { - const [operations] = await zone.getOperations(); - assert(operations.length > 0); - }); - - it('should get a list of operations in stream mode', done => { - let resultsMatched = 0; - zone - .getOperationsStream() - .on('error', done) - .on('data', () => resultsMatched++) - .on('end', () => { - assert(resultsMatched > 0); - done(); - }); - }); - }); - - function generateName(customPrefix) { - const resourceId = uuid.v4().split('-')[0]; - return `${TESTS_PREFIX}-${TEST_ID}-${customPrefix}-${resourceId}`; - } - - async function deleteAllTestObjects(opts) { - opts.name = opts.expiredOnly ? TESTS_PREFIX : FULL_PREFIX; - try { - await deleteRegionalRules(opts); - await callAndDeleteGcloudTestObject('Rules', opts); - await deleteTargetProxies(opts); - await deleteUrlMaps(opts); - await callAndDeleteGcloudTestObject('Services', opts); - await deleteHttpsHealthChecks(opts); - await deleteInstanceGroupManagers(opts); - await deleteInstanceTemplates(opts); - await deleteTargetInstances(opts); - await deleteAllGcloudTestObjects(opts); - } catch (err) { - console.warn(err); - } - } - - async function deleteAllGcloudTestObjects(opts) { - const objectTypes = [ - 'VMs', - 'Addresses', - 'Autoscalers', - 'Disks', - 'Images', - 'InstanceGroups', - 'Firewalls', - 'Subnetworks', - 'HealthChecks', - 'Networks', - 'Snapshots', - ]; - for (const type of objectTypes) { - await callAndDeleteGcloudTestObject(type, opts); - } - } - - async function callAndDeleteGcloudTestObject(type, opts) { - let [objects] = await compute[`get${type}`]({ - filter: `name eq ${opts.name}.*`, - }); - objects = filterExpired(objects, opts); - if (objects.length === 0) { - return Promise.resolve(); - } - console.log(`deleting ${objects.length} ${type}...`); - await Promise.all( - objects.map(async o => { - console.log(`Deleting ${type} '${o.name}'...`); - await awaitResult(o.delete()); - console.log(`${type} '${o.name}' deleted!`); - }) - ); - } - - async function create(object, cfg) { - return awaitResult(object.create(cfg)); - } - - async function deleteRegionalRules(opts) { - const [rules] = await region.getRules({ - filter: `name eq ${opts.name}.*`, - }); - return Promise.all( - filterExpired(rules, opts).map(rule => awaitResult(rule.delete())) - ); - } - - async function createService(name, instanceGroupName, healthCheckName) { - const service = compute.service(name); - const group = zone.instanceGroup(instanceGroupName); - const healthCheck = compute.healthCheck(healthCheckName); - await create(group); - const [metadata] = await group.getMetadata(); - const groupUrl = metadata.selfLink; - await create(healthCheck); - const [metadata2] = await healthCheck.getMetadata(); - const healthCheckUrl = metadata2.selfLink; - await create(service, { - backends: [ - { - group: groupUrl, - }, - ], - healthChecks: [healthCheckUrl], - }); - } - - async function deleteHttpsHealthChecks(opts) { - const [healthChecks] = await compute.getHealthChecks({ - filter: `name eq ${opts.name}.*`, - https: true, - }); - return Promise.all( - filterExpired(healthChecks, opts).map(healthCheck => - awaitResult(healthCheck.delete()) - ) - ); - } - - async function deleteUrlMaps(opts) { - const resp = await computeRequest({ - uri: '/global/urlMaps', - qs: { - filter: `name eq ${opts.name}.*`, - }, - }); - return Promise.all( - filterExpired(resp.items, opts) - .map(x => x.name) - .map(deleteUrlMap) - ); - } - - async function deleteUrlMap(name) { - const resp = await computeRequest({ - method: 'DELETE', - uri: '/global/urlMaps/' + name, - }); - const operation = compute.operation(resp.name); - await operation.promise(); - } - - async function deleteTargetProxies(opts) { - const resp = await computeRequest({ - uri: '/global/targetHttpProxies', - qs: { - filter: `name eq ${opts.name}.*`, - }, - }); - return Promise.all( - filterExpired(resp.items, opts) - .map(x => x.name) - .map(deleteTargetProxy) - ); - } - - async function deleteTargetProxy(name) { - const resp = await computeRequest({ - method: 'DELETE', - uri: '/global/targetHttpProxies/' + name, - }); - const operation = compute.operation(resp.name); - await operation.promise(); - } - - async function deleteTargetInstances(opts) { - const resp = await zoneRequest({ - uri: '/targetInstances', - qs: { - filter: `name eq ${opts.name}.*`, - }, - }); - return Promise.all( - filterExpired(resp.items, opts) - .map(x => x.name) - .map(x => deleteTargetInstance(x)) - ); - } - - async function createTargetInstance(name, instanceName) { - const resp = await zoneRequest({ - method: 'POST', - uri: '/targetInstances', - json: { - name: name, - instance: 'zones/' + zone.name + '/instances/' + instanceName, - }, + clientTemplates = new compute.InstanceTemplatesClient({fallback: 'rest'}); + clientInstanceGroups = new compute.InstanceGroupManagersClient({ + fallback: 'rest', + }); + instanceGroupName = generateName('instance-group'); + instanceTemplateName = generateName('instance-group'); }); - const operation = zone.operation(resp.name); - await operation.promise(); - } - async function deleteTargetInstance(name) { - const resp = await zoneRequest({ - method: 'DELETE', - uri: '/targetInstances/' + name, - }); - const operation = zone.operation(resp.name); - await operation.promise(); - } + after(async function () { + this.timeout(10 * 60 * 1000); + const [deleteIgm] = await clientInstanceGroups.delete({ + project, + zone, + instanceGroupManager: instanceGroupName, + }); + await waitZonalOperation(deleteIgm); - async function deleteInstanceTemplates(opts) { - const resp = await computeRequest({ - uri: '/global/instanceTemplates', - qs: { - filter: `name eq ${opts.name}.*`, - }, + await clientTemplates.delete({ + project, + instanceTemplate: instanceTemplateName, + }); }); - const names = filterExpired(resp.items, opts).map(x => x.name); - return Promise.all(names.map(x => deleteInstanceTemplate(x))); - } - async function createInstanceTemplate(name, networkName) { - const resp = await computeRequest({ - method: 'POST', - uri: '/global/instanceTemplates', - json: { - name: name, + it('create instance group manager with size 0', async function () { + // we want to test that body field can be set to 0 + this.timeout(10 * 60 * 1000); + const instanceTemplate = { + name: instanceTemplateName, properties: { disks: [ { boot: true, - mode: 'READ_ONLY', initializeParams: { - diskName: generateName('disk'), - diskSizeGb: 10, - diskType: 'pd-standard', - sourceImage: [ - 'projects/centos-cloud/global/images/centos-6-v20150710', - ].join(''), + sourceImage: + 'projects/debian-cloud/global/images/family/debian-10', }, + autoDelete: true, + type: DiskType.PERSISTENT, }, ], - machineType: 'n1-standard-1', networkInterfaces: [ { - network: networkName, - accessConfigs: [ - { - name: generateName('access_config'), - type: 'ONE_TO_ONE_NAT', - }, - ], + name: 'default', }, ], + machineType: 'n1-standard-1', }, - }, - }); - const operation = compute.operation(resp.name); - await operation.promise(); - } + }; + const [insertOp] = await clientTemplates.insert({ + instanceTemplateResource: instanceTemplate, + project: project, + }); + await waitGlobalOperation(insertOp); + const instanceGroupManager = { + baseInstanceName: 'tsgapic', + instanceTemplate: insertOp.targetLink, + name: instanceGroupName, + targetSize: 0, + }; + const [insertGroup] = await clientInstanceGroups.insert({ + project, + zone, + instanceGroupManagerResource: instanceGroupManager, + }); + await waitZonalOperation(insertGroup); - async function deleteInstanceTemplate(name) { - const resp = await computeRequest({ - method: 'DELETE', - uri: '/global/instanceTemplates/' + name, + const [fetch] = await clientInstanceGroups.get({ + project, + zone, + instanceGroupManager: instanceGroupName, + }); + assert.strictEqual(fetch.targetSize, 0); }); - const operation = compute.operation(resp.name); - await operation.promise(); - } - async function deleteInstanceGroupManagers(opts) { - const resp = await zoneRequest({ - uri: '/instanceGroupManagers', - qs: { - filter: `name eq ${opts.name}.*`, - }, + it('Resize group to 1 and then back to 0.', async function () { + // we want to test that query param field can be set to 0 + this.timeout(10 * 60 * 1000); + const [resize] = await clientInstanceGroups.resize({ + project, + zone, + instanceGroupManager: instanceGroupName, + size: 1, + }); + await waitZonalOperation(resize); + + const [fetch] = await clientInstanceGroups.get({ + project, + zone, + instanceGroupManager: instanceGroupName, + }); + assert.strictEqual(fetch.targetSize, 1); + + const [resizeBack] = await clientInstanceGroups.resize({ + project, + zone, + instanceGroupManager: instanceGroupName, + size: 0, + }); + await waitZonalOperation(resizeBack); + + const [resized] = await clientInstanceGroups.get({ + project, + zone, + instanceGroupManager: instanceGroupName, + }); + assert.strictEqual(resized.targetSize, 0); }); - const names = filterExpired(resp.items, opts).map(x => x.name); - await Promise.all(names.map(name => deleteInstanceGroupManager(name))); + }); + + async function waitZonalOperation(operation) { + for (;;) { + const [getResp] = await operationsClient.wait({ + project, + zone, + operation: operation.name, + }); + if (getResp.status === 'DONE') { + // b/191191972 + break; + } else { + await new Promise(resolve => setTimeout(resolve, 4000)); + } + } } - async function createInstanceGroupManager(name, instanceTemplateName) { - const resp = await zoneRequest({ - method: 'POST', - uri: '/instanceGroupManagers', - json: { - baseInstanceName: name.replace(/\W/g, ''), - name: name, - targetSize: 1, - instanceTemplate: instanceTemplateName, - }, + describe('Pagination', () => { + let client = null; + + before(async () => { + client = new compute.AcceleratorTypesClient({fallback: 'rest'}); }); - const operation = zone.operation(resp.name); - await operation.promise(); - } - async function deleteInstanceGroupManager(name) { - const resp = await zoneRequest({ - method: 'DELETE', - uri: '/instanceGroupManagers/' + name, + it('Pagination in list response', async () => { + const [listResponse] = await client.list({ + project, + zone, + maxResults: 1, + }); + let presented = false; + for (const item of listResponse) { + if (item.name === 'nvidia-tesla-t4') { + presented = true; + } + } + assert.strictEqual( + presented, + true, + 'accelerator type nvidia-tesla-t4 was not found in list response.' + ); }); - const operation = zone.operation(resp.name); - await operation.promise(); - } -}); -async function awaitResult(promise) { - const result = await promise; - const operation = result[result.length - 2]; - await operation.promise(); -} + it('Pagination in map responses', async function () { + this.timeout(10 * 60 * 1000); + const iterable = client.aggregatedListAsync({ + project, + maxResults: 2, + }); + let presented = false; + for await (const [location, acceleratorTypesObj] of iterable) { + if (location === 'zones/' + zone) { + const acceleratorTypes = acceleratorTypesObj.acceleratorTypes; + acceleratorTypes.forEach(acceleratorType => { + if (acceleratorType.name === 'nvidia-tesla-t4') { + presented = true; + } + }); + } + } + assert.strictEqual( + presented, + true, + 'accelerator type nvidia-tesla-t4 was not found in map response.' + ); + }); + }); -function filterExpired(resources, opts) { - resources = resources || []; - if (opts.expiredOnly) { - return resources.filter(isExpired); - } else { - return resources; + async function waitGlobalOperation(operation) { + const globalClient = new compute.GlobalOperationsClient({fallback: 'rest'}); + for (;;) { + const [getResp] = await globalClient.get({ + project, + operation: operation.name, + }); + if (getResp.status === 'DONE') { + // b/191191972 + break; + } else { + await new Promise(resolve => setTimeout(resolve, 4000)); + } + } } -} -function isExpired(resource) { - if ( - resource && - (resource.creationTimestamp || - (resource.metadata && resource.metadata.creationTimestamp)) - ) { - const created = new Date( - resource.creationTimestamp || resource.metadata.creationTimestamp - ); - const age = Date.now() - created.getTime(); - return age > 1000 * 60 * 60; - } else { - console.log(resource); - throw new Error('No Creation Timestamp found!'); + function generateName(customPrefix) { + const TESTS_PREFIX = 'tsgapic'; + const resourceId = uuid.v4().split('-')[0]; + return `${TESTS_PREFIX}-${customPrefix}-${resourceId}`; } -} +}); diff --git a/system-test/fixtures/sample/src/index.js b/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..8ed1ce4d --- /dev/null +++ b/system-test/fixtures/sample/src/index.js @@ -0,0 +1,115 @@ +// 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 compute = require('@google-cloud/compute'); + +function main() { + const acceleratorTypesClient = new compute.AcceleratorTypesClient(); + const addressesClient = new compute.AddressesClient(); + const autoscalersClient = new compute.AutoscalersClient(); + const backendBucketsClient = new compute.BackendBucketsClient(); + const backendServicesClient = new compute.BackendServicesClient(); + const disksClient = new compute.DisksClient(); + const diskTypesClient = new compute.DiskTypesClient(); + const externalVpnGatewaysClient = new compute.ExternalVpnGatewaysClient(); + const firewallPoliciesClient = new compute.FirewallPoliciesClient(); + const firewallsClient = new compute.FirewallsClient(); + const forwardingRulesClient = new compute.ForwardingRulesClient(); + const globalAddressesClient = new compute.GlobalAddressesClient(); + const globalForwardingRulesClient = new compute.GlobalForwardingRulesClient(); + const globalNetworkEndpointGroupsClient = + new compute.GlobalNetworkEndpointGroupsClient(); + const globalOperationsClient = new compute.GlobalOperationsClient(); + const globalOrganizationOperationsClient = + new compute.GlobalOrganizationOperationsClient(); + const globalPublicDelegatedPrefixesClient = + new compute.GlobalPublicDelegatedPrefixesClient(); + const healthChecksClient = new compute.HealthChecksClient(); + const imagesClient = new compute.ImagesClient(); + const instanceGroupManagersClient = new compute.InstanceGroupManagersClient(); + const instanceGroupsClient = new compute.InstanceGroupsClient(); + const instancesClient = new compute.InstancesClient(); + const instanceTemplatesClient = new compute.InstanceTemplatesClient(); + const interconnectAttachmentsClient = + new compute.InterconnectAttachmentsClient(); + const interconnectLocationsClient = new compute.InterconnectLocationsClient(); + const interconnectsClient = new compute.InterconnectsClient(); + const licenseCodesClient = new compute.LicenseCodesClient(); + const licensesClient = new compute.LicensesClient(); + const machineTypesClient = new compute.MachineTypesClient(); + const networkEndpointGroupsClient = new compute.NetworkEndpointGroupsClient(); + const networksClient = new compute.NetworksClient(); + const nodeGroupsClient = new compute.NodeGroupsClient(); + const nodeTemplatesClient = new compute.NodeTemplatesClient(); + const nodeTypesClient = new compute.NodeTypesClient(); + const packetMirroringsClient = new compute.PacketMirroringsClient(); + const projectsClient = new compute.ProjectsClient(); + const publicAdvertisedPrefixesClient = + new compute.PublicAdvertisedPrefixesClient(); + const publicDelegatedPrefixesClient = + new compute.PublicDelegatedPrefixesClient(); + const regionAutoscalersClient = new compute.RegionAutoscalersClient(); + const regionBackendServicesClient = new compute.RegionBackendServicesClient(); + const regionCommitmentsClient = new compute.RegionCommitmentsClient(); + const regionDisksClient = new compute.RegionDisksClient(); + const regionDiskTypesClient = new compute.RegionDiskTypesClient(); + const regionHealthChecksClient = new compute.RegionHealthChecksClient(); + const regionHealthCheckServicesClient = + new compute.RegionHealthCheckServicesClient(); + const regionInstanceGroupManagersClient = + new compute.RegionInstanceGroupManagersClient(); + const regionInstanceGroupsClient = new compute.RegionInstanceGroupsClient(); + const regionInstancesClient = new compute.RegionInstancesClient(); + const regionNetworkEndpointGroupsClient = + new compute.RegionNetworkEndpointGroupsClient(); + const regionNotificationEndpointsClient = + new compute.RegionNotificationEndpointsClient(); + const regionOperationsClient = new compute.RegionOperationsClient(); + const regionsClient = new compute.RegionsClient(); + const regionSslCertificatesClient = new compute.RegionSslCertificatesClient(); + const regionTargetHttpProxiesClient = + new compute.RegionTargetHttpProxiesClient(); + const regionTargetHttpsProxiesClient = + new compute.RegionTargetHttpsProxiesClient(); + const regionUrlMapsClient = new compute.RegionUrlMapsClient(); + const reservationsClient = new compute.ReservationsClient(); + const resourcePoliciesClient = new compute.ResourcePoliciesClient(); + const routersClient = new compute.RoutersClient(); + const routesClient = new compute.RoutesClient(); + const securityPoliciesClient = new compute.SecurityPoliciesClient(); + const snapshotsClient = new compute.SnapshotsClient(); + const sslCertificatesClient = new compute.SslCertificatesClient(); + const sslPoliciesClient = new compute.SslPoliciesClient(); + const subnetworksClient = new compute.SubnetworksClient(); + const targetGrpcProxiesClient = new compute.TargetGrpcProxiesClient(); + const targetHttpProxiesClient = new compute.TargetHttpProxiesClient(); + const targetHttpsProxiesClient = new compute.TargetHttpsProxiesClient(); + const targetInstancesClient = new compute.TargetInstancesClient(); + const targetPoolsClient = new compute.TargetPoolsClient(); + const targetSslProxiesClient = new compute.TargetSslProxiesClient(); + const targetTcpProxiesClient = new compute.TargetTcpProxiesClient(); + const targetVpnGatewaysClient = new compute.TargetVpnGatewaysClient(); + const urlMapsClient = new compute.UrlMapsClient(); + const vpnGatewaysClient = new compute.VpnGatewaysClient(); + const vpnTunnelsClient = new compute.VpnTunnelsClient(); + const zoneOperationsClient = new compute.ZoneOperationsClient(); + const zonesClient = new compute.ZonesClient(); +} + +main(); diff --git a/system-test/fixtures/sample/src/index.ts b/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..7f8ea6f3 --- /dev/null +++ b/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,631 @@ +// 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 { + AcceleratorTypesClient, + AddressesClient, + AutoscalersClient, + BackendBucketsClient, + BackendServicesClient, + DisksClient, + DiskTypesClient, + ExternalVpnGatewaysClient, + FirewallPoliciesClient, + FirewallsClient, + ForwardingRulesClient, + GlobalAddressesClient, + GlobalForwardingRulesClient, + GlobalNetworkEndpointGroupsClient, + GlobalOperationsClient, + GlobalOrganizationOperationsClient, + GlobalPublicDelegatedPrefixesClient, + HealthChecksClient, + ImagesClient, + InstanceGroupManagersClient, + InstanceGroupsClient, + InstancesClient, + InstanceTemplatesClient, + InterconnectAttachmentsClient, + InterconnectLocationsClient, + InterconnectsClient, + LicenseCodesClient, + LicensesClient, + MachineTypesClient, + NetworkEndpointGroupsClient, + NetworksClient, + NodeGroupsClient, + NodeTemplatesClient, + NodeTypesClient, + PacketMirroringsClient, + ProjectsClient, + PublicAdvertisedPrefixesClient, + PublicDelegatedPrefixesClient, + RegionAutoscalersClient, + RegionBackendServicesClient, + RegionCommitmentsClient, + RegionDisksClient, + RegionDiskTypesClient, + RegionHealthChecksClient, + RegionHealthCheckServicesClient, + RegionInstanceGroupManagersClient, + RegionInstanceGroupsClient, + RegionInstancesClient, + RegionNetworkEndpointGroupsClient, + RegionNotificationEndpointsClient, + RegionOperationsClient, + RegionsClient, + RegionSslCertificatesClient, + RegionTargetHttpProxiesClient, + RegionTargetHttpsProxiesClient, + RegionUrlMapsClient, + ReservationsClient, + ResourcePoliciesClient, + RoutersClient, + RoutesClient, + SecurityPoliciesClient, + SnapshotsClient, + SslCertificatesClient, + SslPoliciesClient, + SubnetworksClient, + TargetGrpcProxiesClient, + TargetHttpProxiesClient, + TargetHttpsProxiesClient, + TargetInstancesClient, + TargetPoolsClient, + TargetSslProxiesClient, + TargetTcpProxiesClient, + TargetVpnGatewaysClient, + UrlMapsClient, + VpnGatewaysClient, + VpnTunnelsClient, + ZoneOperationsClient, + ZonesClient, +} from '@google-cloud/compute'; + +// check that the client class type name can be used +function doStuffWithAcceleratorTypesClient(client: AcceleratorTypesClient) { + client.close(); +} +function doStuffWithAddressesClient(client: AddressesClient) { + client.close(); +} +function doStuffWithAutoscalersClient(client: AutoscalersClient) { + client.close(); +} +function doStuffWithBackendBucketsClient(client: BackendBucketsClient) { + client.close(); +} +function doStuffWithBackendServicesClient(client: BackendServicesClient) { + client.close(); +} +function doStuffWithDisksClient(client: DisksClient) { + client.close(); +} +function doStuffWithDiskTypesClient(client: DiskTypesClient) { + client.close(); +} +function doStuffWithExternalVpnGatewaysClient( + client: ExternalVpnGatewaysClient +) { + client.close(); +} +function doStuffWithFirewallPoliciesClient(client: FirewallPoliciesClient) { + client.close(); +} +function doStuffWithFirewallsClient(client: FirewallsClient) { + client.close(); +} +function doStuffWithForwardingRulesClient(client: ForwardingRulesClient) { + client.close(); +} +function doStuffWithGlobalAddressesClient(client: GlobalAddressesClient) { + client.close(); +} +function doStuffWithGlobalForwardingRulesClient( + client: GlobalForwardingRulesClient +) { + client.close(); +} +function doStuffWithGlobalNetworkEndpointGroupsClient( + client: GlobalNetworkEndpointGroupsClient +) { + client.close(); +} +function doStuffWithGlobalOperationsClient(client: GlobalOperationsClient) { + client.close(); +} +function doStuffWithGlobalOrganizationOperationsClient( + client: GlobalOrganizationOperationsClient +) { + client.close(); +} +function doStuffWithGlobalPublicDelegatedPrefixesClient( + client: GlobalPublicDelegatedPrefixesClient +) { + client.close(); +} +function doStuffWithHealthChecksClient(client: HealthChecksClient) { + client.close(); +} +function doStuffWithImagesClient(client: ImagesClient) { + client.close(); +} +function doStuffWithInstanceGroupManagersClient( + client: InstanceGroupManagersClient +) { + client.close(); +} +function doStuffWithInstanceGroupsClient(client: InstanceGroupsClient) { + client.close(); +} +function doStuffWithInstancesClient(client: InstancesClient) { + client.close(); +} +function doStuffWithInstanceTemplatesClient(client: InstanceTemplatesClient) { + client.close(); +} +function doStuffWithInterconnectAttachmentsClient( + client: InterconnectAttachmentsClient +) { + client.close(); +} +function doStuffWithInterconnectLocationsClient( + client: InterconnectLocationsClient +) { + client.close(); +} +function doStuffWithInterconnectsClient(client: InterconnectsClient) { + client.close(); +} +function doStuffWithLicenseCodesClient(client: LicenseCodesClient) { + client.close(); +} +function doStuffWithLicensesClient(client: LicensesClient) { + client.close(); +} +function doStuffWithMachineTypesClient(client: MachineTypesClient) { + client.close(); +} +function doStuffWithNetworkEndpointGroupsClient( + client: NetworkEndpointGroupsClient +) { + client.close(); +} +function doStuffWithNetworksClient(client: NetworksClient) { + client.close(); +} +function doStuffWithNodeGroupsClient(client: NodeGroupsClient) { + client.close(); +} +function doStuffWithNodeTemplatesClient(client: NodeTemplatesClient) { + client.close(); +} +function doStuffWithNodeTypesClient(client: NodeTypesClient) { + client.close(); +} +function doStuffWithPacketMirroringsClient(client: PacketMirroringsClient) { + client.close(); +} +function doStuffWithProjectsClient(client: ProjectsClient) { + client.close(); +} +function doStuffWithPublicAdvertisedPrefixesClient( + client: PublicAdvertisedPrefixesClient +) { + client.close(); +} +function doStuffWithPublicDelegatedPrefixesClient( + client: PublicDelegatedPrefixesClient +) { + client.close(); +} +function doStuffWithRegionAutoscalersClient(client: RegionAutoscalersClient) { + client.close(); +} +function doStuffWithRegionBackendServicesClient( + client: RegionBackendServicesClient +) { + client.close(); +} +function doStuffWithRegionCommitmentsClient(client: RegionCommitmentsClient) { + client.close(); +} +function doStuffWithRegionDisksClient(client: RegionDisksClient) { + client.close(); +} +function doStuffWithRegionDiskTypesClient(client: RegionDiskTypesClient) { + client.close(); +} +function doStuffWithRegionHealthChecksClient(client: RegionHealthChecksClient) { + client.close(); +} +function doStuffWithRegionHealthCheckServicesClient( + client: RegionHealthCheckServicesClient +) { + client.close(); +} +function doStuffWithRegionInstanceGroupManagersClient( + client: RegionInstanceGroupManagersClient +) { + client.close(); +} +function doStuffWithRegionInstanceGroupsClient( + client: RegionInstanceGroupsClient +) { + client.close(); +} +function doStuffWithRegionInstancesClient(client: RegionInstancesClient) { + client.close(); +} +function doStuffWithRegionNetworkEndpointGroupsClient( + client: RegionNetworkEndpointGroupsClient +) { + client.close(); +} +function doStuffWithRegionNotificationEndpointsClient( + client: RegionNotificationEndpointsClient +) { + client.close(); +} +function doStuffWithRegionOperationsClient(client: RegionOperationsClient) { + client.close(); +} +function doStuffWithRegionsClient(client: RegionsClient) { + client.close(); +} +function doStuffWithRegionSslCertificatesClient( + client: RegionSslCertificatesClient +) { + client.close(); +} +function doStuffWithRegionTargetHttpProxiesClient( + client: RegionTargetHttpProxiesClient +) { + client.close(); +} +function doStuffWithRegionTargetHttpsProxiesClient( + client: RegionTargetHttpsProxiesClient +) { + client.close(); +} +function doStuffWithRegionUrlMapsClient(client: RegionUrlMapsClient) { + client.close(); +} +function doStuffWithReservationsClient(client: ReservationsClient) { + client.close(); +} +function doStuffWithResourcePoliciesClient(client: ResourcePoliciesClient) { + client.close(); +} +function doStuffWithRoutersClient(client: RoutersClient) { + client.close(); +} +function doStuffWithRoutesClient(client: RoutesClient) { + client.close(); +} +function doStuffWithSecurityPoliciesClient(client: SecurityPoliciesClient) { + client.close(); +} +function doStuffWithSnapshotsClient(client: SnapshotsClient) { + client.close(); +} +function doStuffWithSslCertificatesClient(client: SslCertificatesClient) { + client.close(); +} +function doStuffWithSslPoliciesClient(client: SslPoliciesClient) { + client.close(); +} +function doStuffWithSubnetworksClient(client: SubnetworksClient) { + client.close(); +} +function doStuffWithTargetGrpcProxiesClient(client: TargetGrpcProxiesClient) { + client.close(); +} +function doStuffWithTargetHttpProxiesClient(client: TargetHttpProxiesClient) { + client.close(); +} +function doStuffWithTargetHttpsProxiesClient(client: TargetHttpsProxiesClient) { + client.close(); +} +function doStuffWithTargetInstancesClient(client: TargetInstancesClient) { + client.close(); +} +function doStuffWithTargetPoolsClient(client: TargetPoolsClient) { + client.close(); +} +function doStuffWithTargetSslProxiesClient(client: TargetSslProxiesClient) { + client.close(); +} +function doStuffWithTargetTcpProxiesClient(client: TargetTcpProxiesClient) { + client.close(); +} +function doStuffWithTargetVpnGatewaysClient(client: TargetVpnGatewaysClient) { + client.close(); +} +function doStuffWithUrlMapsClient(client: UrlMapsClient) { + client.close(); +} +function doStuffWithVpnGatewaysClient(client: VpnGatewaysClient) { + client.close(); +} +function doStuffWithVpnTunnelsClient(client: VpnTunnelsClient) { + client.close(); +} +function doStuffWithZoneOperationsClient(client: ZoneOperationsClient) { + client.close(); +} +function doStuffWithZonesClient(client: ZonesClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const acceleratorTypesClient = new AcceleratorTypesClient(); + doStuffWithAcceleratorTypesClient(acceleratorTypesClient); + // check that the client instance can be created + const addressesClient = new AddressesClient(); + doStuffWithAddressesClient(addressesClient); + // check that the client instance can be created + const autoscalersClient = new AutoscalersClient(); + doStuffWithAutoscalersClient(autoscalersClient); + // check that the client instance can be created + const backendBucketsClient = new BackendBucketsClient(); + doStuffWithBackendBucketsClient(backendBucketsClient); + // check that the client instance can be created + const backendServicesClient = new BackendServicesClient(); + doStuffWithBackendServicesClient(backendServicesClient); + // check that the client instance can be created + const disksClient = new DisksClient(); + doStuffWithDisksClient(disksClient); + // check that the client instance can be created + const diskTypesClient = new DiskTypesClient(); + doStuffWithDiskTypesClient(diskTypesClient); + // check that the client instance can be created + const externalVpnGatewaysClient = new ExternalVpnGatewaysClient(); + doStuffWithExternalVpnGatewaysClient(externalVpnGatewaysClient); + // check that the client instance can be created + const firewallPoliciesClient = new FirewallPoliciesClient(); + doStuffWithFirewallPoliciesClient(firewallPoliciesClient); + // check that the client instance can be created + const firewallsClient = new FirewallsClient(); + doStuffWithFirewallsClient(firewallsClient); + // check that the client instance can be created + const forwardingRulesClient = new ForwardingRulesClient(); + doStuffWithForwardingRulesClient(forwardingRulesClient); + // check that the client instance can be created + const globalAddressesClient = new GlobalAddressesClient(); + doStuffWithGlobalAddressesClient(globalAddressesClient); + // check that the client instance can be created + const globalForwardingRulesClient = new GlobalForwardingRulesClient(); + doStuffWithGlobalForwardingRulesClient(globalForwardingRulesClient); + // check that the client instance can be created + const globalNetworkEndpointGroupsClient = + new GlobalNetworkEndpointGroupsClient(); + doStuffWithGlobalNetworkEndpointGroupsClient( + globalNetworkEndpointGroupsClient + ); + // check that the client instance can be created + const globalOperationsClient = new GlobalOperationsClient(); + doStuffWithGlobalOperationsClient(globalOperationsClient); + // check that the client instance can be created + const globalOrganizationOperationsClient = + new GlobalOrganizationOperationsClient(); + doStuffWithGlobalOrganizationOperationsClient( + globalOrganizationOperationsClient + ); + // check that the client instance can be created + const globalPublicDelegatedPrefixesClient = + new GlobalPublicDelegatedPrefixesClient(); + doStuffWithGlobalPublicDelegatedPrefixesClient( + globalPublicDelegatedPrefixesClient + ); + // check that the client instance can be created + const healthChecksClient = new HealthChecksClient(); + doStuffWithHealthChecksClient(healthChecksClient); + // check that the client instance can be created + const imagesClient = new ImagesClient(); + doStuffWithImagesClient(imagesClient); + // check that the client instance can be created + const instanceGroupManagersClient = new InstanceGroupManagersClient(); + doStuffWithInstanceGroupManagersClient(instanceGroupManagersClient); + // check that the client instance can be created + const instanceGroupsClient = new InstanceGroupsClient(); + doStuffWithInstanceGroupsClient(instanceGroupsClient); + // check that the client instance can be created + const instancesClient = new InstancesClient(); + doStuffWithInstancesClient(instancesClient); + // check that the client instance can be created + const instanceTemplatesClient = new InstanceTemplatesClient(); + doStuffWithInstanceTemplatesClient(instanceTemplatesClient); + // check that the client instance can be created + const interconnectAttachmentsClient = new InterconnectAttachmentsClient(); + doStuffWithInterconnectAttachmentsClient(interconnectAttachmentsClient); + // check that the client instance can be created + const interconnectLocationsClient = new InterconnectLocationsClient(); + doStuffWithInterconnectLocationsClient(interconnectLocationsClient); + // check that the client instance can be created + const interconnectsClient = new InterconnectsClient(); + doStuffWithInterconnectsClient(interconnectsClient); + // check that the client instance can be created + const licenseCodesClient = new LicenseCodesClient(); + doStuffWithLicenseCodesClient(licenseCodesClient); + // check that the client instance can be created + const licensesClient = new LicensesClient(); + doStuffWithLicensesClient(licensesClient); + // check that the client instance can be created + const machineTypesClient = new MachineTypesClient(); + doStuffWithMachineTypesClient(machineTypesClient); + // check that the client instance can be created + const networkEndpointGroupsClient = new NetworkEndpointGroupsClient(); + doStuffWithNetworkEndpointGroupsClient(networkEndpointGroupsClient); + // check that the client instance can be created + const networksClient = new NetworksClient(); + doStuffWithNetworksClient(networksClient); + // check that the client instance can be created + const nodeGroupsClient = new NodeGroupsClient(); + doStuffWithNodeGroupsClient(nodeGroupsClient); + // check that the client instance can be created + const nodeTemplatesClient = new NodeTemplatesClient(); + doStuffWithNodeTemplatesClient(nodeTemplatesClient); + // check that the client instance can be created + const nodeTypesClient = new NodeTypesClient(); + doStuffWithNodeTypesClient(nodeTypesClient); + // check that the client instance can be created + const packetMirroringsClient = new PacketMirroringsClient(); + doStuffWithPacketMirroringsClient(packetMirroringsClient); + // check that the client instance can be created + const projectsClient = new ProjectsClient(); + doStuffWithProjectsClient(projectsClient); + // check that the client instance can be created + const publicAdvertisedPrefixesClient = new PublicAdvertisedPrefixesClient(); + doStuffWithPublicAdvertisedPrefixesClient(publicAdvertisedPrefixesClient); + // check that the client instance can be created + const publicDelegatedPrefixesClient = new PublicDelegatedPrefixesClient(); + doStuffWithPublicDelegatedPrefixesClient(publicDelegatedPrefixesClient); + // check that the client instance can be created + const regionAutoscalersClient = new RegionAutoscalersClient(); + doStuffWithRegionAutoscalersClient(regionAutoscalersClient); + // check that the client instance can be created + const regionBackendServicesClient = new RegionBackendServicesClient(); + doStuffWithRegionBackendServicesClient(regionBackendServicesClient); + // check that the client instance can be created + const regionCommitmentsClient = new RegionCommitmentsClient(); + doStuffWithRegionCommitmentsClient(regionCommitmentsClient); + // check that the client instance can be created + const regionDisksClient = new RegionDisksClient(); + doStuffWithRegionDisksClient(regionDisksClient); + // check that the client instance can be created + const regionDiskTypesClient = new RegionDiskTypesClient(); + doStuffWithRegionDiskTypesClient(regionDiskTypesClient); + // check that the client instance can be created + const regionHealthChecksClient = new RegionHealthChecksClient(); + doStuffWithRegionHealthChecksClient(regionHealthChecksClient); + // check that the client instance can be created + const regionHealthCheckServicesClient = new RegionHealthCheckServicesClient(); + doStuffWithRegionHealthCheckServicesClient(regionHealthCheckServicesClient); + // check that the client instance can be created + const regionInstanceGroupManagersClient = + new RegionInstanceGroupManagersClient(); + doStuffWithRegionInstanceGroupManagersClient( + regionInstanceGroupManagersClient + ); + // check that the client instance can be created + const regionInstanceGroupsClient = new RegionInstanceGroupsClient(); + doStuffWithRegionInstanceGroupsClient(regionInstanceGroupsClient); + // check that the client instance can be created + const regionInstancesClient = new RegionInstancesClient(); + doStuffWithRegionInstancesClient(regionInstancesClient); + // check that the client instance can be created + const regionNetworkEndpointGroupsClient = + new RegionNetworkEndpointGroupsClient(); + doStuffWithRegionNetworkEndpointGroupsClient( + regionNetworkEndpointGroupsClient + ); + // check that the client instance can be created + const regionNotificationEndpointsClient = + new RegionNotificationEndpointsClient(); + doStuffWithRegionNotificationEndpointsClient( + regionNotificationEndpointsClient + ); + // check that the client instance can be created + const regionOperationsClient = new RegionOperationsClient(); + doStuffWithRegionOperationsClient(regionOperationsClient); + // check that the client instance can be created + const regionsClient = new RegionsClient(); + doStuffWithRegionsClient(regionsClient); + // check that the client instance can be created + const regionSslCertificatesClient = new RegionSslCertificatesClient(); + doStuffWithRegionSslCertificatesClient(regionSslCertificatesClient); + // check that the client instance can be created + const regionTargetHttpProxiesClient = new RegionTargetHttpProxiesClient(); + doStuffWithRegionTargetHttpProxiesClient(regionTargetHttpProxiesClient); + // check that the client instance can be created + const regionTargetHttpsProxiesClient = new RegionTargetHttpsProxiesClient(); + doStuffWithRegionTargetHttpsProxiesClient(regionTargetHttpsProxiesClient); + // check that the client instance can be created + const regionUrlMapsClient = new RegionUrlMapsClient(); + doStuffWithRegionUrlMapsClient(regionUrlMapsClient); + // check that the client instance can be created + const reservationsClient = new ReservationsClient(); + doStuffWithReservationsClient(reservationsClient); + // check that the client instance can be created + const resourcePoliciesClient = new ResourcePoliciesClient(); + doStuffWithResourcePoliciesClient(resourcePoliciesClient); + // check that the client instance can be created + const routersClient = new RoutersClient(); + doStuffWithRoutersClient(routersClient); + // check that the client instance can be created + const routesClient = new RoutesClient(); + doStuffWithRoutesClient(routesClient); + // check that the client instance can be created + const securityPoliciesClient = new SecurityPoliciesClient(); + doStuffWithSecurityPoliciesClient(securityPoliciesClient); + // check that the client instance can be created + const snapshotsClient = new SnapshotsClient(); + doStuffWithSnapshotsClient(snapshotsClient); + // check that the client instance can be created + const sslCertificatesClient = new SslCertificatesClient(); + doStuffWithSslCertificatesClient(sslCertificatesClient); + // check that the client instance can be created + const sslPoliciesClient = new SslPoliciesClient(); + doStuffWithSslPoliciesClient(sslPoliciesClient); + // check that the client instance can be created + const subnetworksClient = new SubnetworksClient(); + doStuffWithSubnetworksClient(subnetworksClient); + // check that the client instance can be created + const targetGrpcProxiesClient = new TargetGrpcProxiesClient(); + doStuffWithTargetGrpcProxiesClient(targetGrpcProxiesClient); + // check that the client instance can be created + const targetHttpProxiesClient = new TargetHttpProxiesClient(); + doStuffWithTargetHttpProxiesClient(targetHttpProxiesClient); + // check that the client instance can be created + const targetHttpsProxiesClient = new TargetHttpsProxiesClient(); + doStuffWithTargetHttpsProxiesClient(targetHttpsProxiesClient); + // check that the client instance can be created + const targetInstancesClient = new TargetInstancesClient(); + doStuffWithTargetInstancesClient(targetInstancesClient); + // check that the client instance can be created + const targetPoolsClient = new TargetPoolsClient(); + doStuffWithTargetPoolsClient(targetPoolsClient); + // check that the client instance can be created + const targetSslProxiesClient = new TargetSslProxiesClient(); + doStuffWithTargetSslProxiesClient(targetSslProxiesClient); + // check that the client instance can be created + const targetTcpProxiesClient = new TargetTcpProxiesClient(); + doStuffWithTargetTcpProxiesClient(targetTcpProxiesClient); + // check that the client instance can be created + const targetVpnGatewaysClient = new TargetVpnGatewaysClient(); + doStuffWithTargetVpnGatewaysClient(targetVpnGatewaysClient); + // check that the client instance can be created + const urlMapsClient = new UrlMapsClient(); + doStuffWithUrlMapsClient(urlMapsClient); + // check that the client instance can be created + const vpnGatewaysClient = new VpnGatewaysClient(); + doStuffWithVpnGatewaysClient(vpnGatewaysClient); + // check that the client instance can be created + const vpnTunnelsClient = new VpnTunnelsClient(); + doStuffWithVpnTunnelsClient(vpnTunnelsClient); + // check that the client instance can be created + const zoneOperationsClient = new ZoneOperationsClient(); + doStuffWithZoneOperationsClient(zoneOperationsClient); + // check that the client instance can be created + const zonesClient = new ZonesClient(); + doStuffWithZonesClient(zonesClient); +} + +main(); diff --git a/system-test/install.ts b/system-test/install.ts new file mode 100644 index 00000000..d2d61c03 --- /dev/null +++ b/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/test/.eslintrc.yml b/test/.eslintrc.yml deleted file mode 100644 index 73f7bbc9..00000000 --- a/test/.eslintrc.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -env: - mocha: true -rules: - node/no-unpublished-require: off diff --git a/test/address.js b/test/address.js deleted file mode 100644 index 82630097..00000000 --- a/test/address.js +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Address') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Address', () => { - let Address; - let address; - - const ADDRESS_NAME = 'us-central1'; - const REGION = { - createAddress: () => {}, - compute: {}, - }; - - before(() => { - Address = proxyquire('../src/address.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - address = new Address(REGION, ADDRESS_NAME); - }); - - describe('instantiation', () => { - it('should localize the region', () => { - assert.strictEqual(address.region, REGION); - }); - - it('should localize the name', () => { - assert.strictEqual(address.name, ADDRESS_NAME); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should inherit from ServiceObject', done => { - const regionInstance = Object.assign({}, REGION, { - createAddress: { - bind: function (context) { - assert.strictEqual(context, regionInstance); - done(); - }, - }, - }); - - const address = new Address(regionInstance, ADDRESS_NAME); - assert(address instanceof ServiceObject); - - const calledWith = address.calledWith_[0]; - - assert.strictEqual(calledWith.parent, regionInstance); - assert.strictEqual(calledWith.baseUrl, '/addresses'); - assert.strictEqual(calledWith.id, ADDRESS_NAME); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('delete', () => { - it('should make the correct API request', done => { - address.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'DELETE'); - assert.strictEqual(reqOpts.uri, ''); - done(); - }; - - address.delete(assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - address.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - address.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - address.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - address.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - address.region.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - address.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - address.delete(); - }); - }); - }); - }); -}); diff --git a/test/autoscaler.js b/test/autoscaler.js deleted file mode 100644 index 20102f61..00000000 --- a/test/autoscaler.js +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Autoscaler') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Autoscaler', () => { - let Autoscaler; - let autoscaler; - - const AUTOSCALER_NAME = 'autoscaler-name'; - - const COMPUTE = {projectId: 'project-id'}; - const ZONE = { - compute: COMPUTE, - name: 'us-central1-a', - createAutoscaler: util.noop, - }; - - before(() => { - Autoscaler = proxyquire('../src/autoscaler.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - autoscaler = new Autoscaler(ZONE, AUTOSCALER_NAME); - }); - - describe('instantiation', () => { - it('should localize the zone', () => { - assert.strictEqual(autoscaler.zone, ZONE); - }); - - it('should localize the name', () => { - assert.strictEqual(autoscaler.name, AUTOSCALER_NAME); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should inherit from ServiceObject', () => { - const createMethod = util.noop; - - const zoneInstance = Object.assign({}, ZONE, { - createAutoscaler: { - bind: function (context) { - assert.strictEqual(context, zoneInstance); - return createMethod; - }, - }, - }); - - const autoscaler = new Autoscaler(zoneInstance, AUTOSCALER_NAME); - assert(autoscaler instanceof ServiceObject); - - const calledWith = autoscaler.calledWith_[0]; - - assert.strictEqual(calledWith.parent, zoneInstance); - assert.strictEqual(calledWith.baseUrl, '/autoscalers'); - assert.strictEqual(calledWith.id, AUTOSCALER_NAME); - assert.strictEqual(calledWith.createMethod, createMethod); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, autoscaler); - done(); - }; - - autoscaler.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - autoscaler.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - autoscaler.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - autoscaler.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - autoscaler.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - autoscaler.delete(); - }); - }); - }); - }); - - describe('setMetadata', () => { - it('should make the correct API request', done => { - const metadata = {}; - - autoscaler.zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'PATCH'); - assert.strictEqual(reqOpts.uri, '/autoscalers'); - assert.strictEqual(reqOpts.json, metadata); - assert.deepStrictEqual(metadata, { - name: autoscaler.name, - zone: ZONE.name, - }); - - done(); - }; - - autoscaler.setMetadata(metadata, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - autoscaler.zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - autoscaler.setMetadata({e: 'f'}, (err, op, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(op, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - autoscaler.zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with operation & response', done => { - const operation = {}; - const metadata = {a: 'b'}; - - autoscaler.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - autoscaler.setMetadata(metadata, (err, op, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - autoscaler.setMetadata({a: 'b'}); - }); - }); - }); - }); -}); diff --git a/test/disk.js b/test/disk.js deleted file mode 100644 index 0ff1af1d..00000000 --- a/test/disk.js +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const format = require('string-format-obj'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class, options) { - if (Class.name !== 'Disk') { - return; - } - - promisified = true; - assert.deepStrictEqual(options.exclude, ['snapshot']); - }, -}); - -function FakeSnapshot() { - this.calledWith_ = [].slice.call(arguments); -} - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Disk', () => { - let Disk; - let disk; - - const COMPUTE = { - projectId: 'project-id', - }; - - const ZONE = { - compute: COMPUTE, - name: 'us-central1-a', - createDisk: util.noop, - }; - - const DISK_NAME = 'disk-name'; - const DISK_FULL_NAME = format('projects/{pId}/zones/{zName}/disks/{dName}', { - pId: COMPUTE.projectId, - zName: ZONE.name, - dName: DISK_NAME, - }); - - before(() => { - Disk = proxyquire('../src/disk.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - './snapshot.js': FakeSnapshot, - }); - }); - - beforeEach(() => { - disk = new Disk(ZONE, DISK_NAME); - }); - - describe('instantiation', () => { - it('should localize the zone', () => { - assert.strictEqual(disk.zone, ZONE); - }); - - it('should localize the name', () => { - assert.strictEqual(disk.name, DISK_NAME); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should format the disk name', () => { - const formatName_ = Disk.formatName_; - const formattedName = 'projects/a/zones/b/disks/c'; - - Disk.formatName_ = function (zone, name) { - Disk.formatName_ = formatName_; - - assert.strictEqual(zone, ZONE); - assert.strictEqual(name, DISK_NAME); - - return formattedName; - }; - - const disk = new Disk(ZONE, DISK_NAME); - assert(disk.formattedName, formattedName); - }); - - it('should inherit from ServiceObject', done => { - const zoneInstance = Object.assign({}, ZONE, { - createDisk: { - bind: function (context) { - assert.strictEqual(context, zoneInstance); - done(); - }, - }, - }); - - const disk = new Disk(zoneInstance, DISK_NAME); - assert(disk instanceof ServiceObject); - - const calledWith = disk.calledWith_[0]; - - assert.strictEqual(calledWith.parent, zoneInstance); - assert.strictEqual(calledWith.baseUrl, '/disks'); - assert.strictEqual(calledWith.id, DISK_NAME); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('formatName_', () => { - it('should format the name', () => { - const formattedName_ = Disk.formatName_(ZONE, DISK_NAME); - assert.strictEqual(formattedName_, DISK_FULL_NAME); - }); - }); - - describe('createSnapshot', () => { - it('should make the correct API request', done => { - disk.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/createSnapshot'); - assert.deepStrictEqual(reqOpts.json, {name: 'test', a: 'b'}); - done(); - }; - - disk.createSnapshot('test', {a: 'b'}, util.noop); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - disk.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - disk.createSnapshot('test', {}, (err, snap, op, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(snap, null); - assert.strictEqual(op, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require options', () => { - assert.doesNotThrow(() => { - disk.createSnapshot('test', util.noop); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - disk.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Snapshot & Operation', done => { - const snapshot = {}; - const operation = {}; - - disk.snapshot = function (name) { - assert.strictEqual(name, 'test'); - return snapshot; - }; - - disk.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - disk.createSnapshot('test', {}, (err, snap, op, apiResponse_) => { - assert.ifError(err); - - assert.strictEqual(snap, snapshot); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - - it('should not require options', () => { - assert.doesNotThrow(() => { - disk.createSnapshot('test', util.noop); - }); - }); - }); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, disk); - done(); - }; - - disk.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - disk.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - disk.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - disk.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - disk.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - disk.delete(); - }); - }); - }); - }); - - describe('snapshot', () => { - const NAME = 'snapshot-name'; - - it('should return a Snapshot object', () => { - const snapshot = disk.snapshot(NAME); - assert(snapshot instanceof FakeSnapshot); - assert.strictEqual(snapshot.calledWith_[0], disk); - assert.strictEqual(snapshot.calledWith_[1], NAME); - }); - }); -}); diff --git a/test/firewall.js b/test/firewall.js deleted file mode 100644 index ecff36c4..00000000 --- a/test/firewall.js +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Firewall') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Firewall', () => { - let Firewall; - let firewall; - - const COMPUTE = { - projectId: 'project-id', - createFirewall: util.noop, - }; - const FIREWALL_NAME = 'tcp-3000'; - const DEFAULT_FIREWALL_NETWORK = 'global/networks/default'; - - before(() => { - Firewall = proxyquire('../src/firewall.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - firewall = new Firewall(COMPUTE, FIREWALL_NAME); - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should localize compute instance', () => { - assert.strictEqual(firewall.compute, COMPUTE); - }); - - it('should localize the firewall name', () => { - assert.strictEqual(firewall.name, FIREWALL_NAME); - }); - - it('should default to the global network', () => { - assert.deepStrictEqual(firewall.metadata, { - network: DEFAULT_FIREWALL_NETWORK, - }); - }); - - it('should inherit from ServiceObject', () => { - const computeInstance = Object.assign({}, COMPUTE, { - createFirewall: { - bind: function (context) { - assert.strictEqual(context, computeInstance); - }, - }, - }); - - const firewall = new Firewall(computeInstance, FIREWALL_NAME); - - assert(firewall instanceof ServiceObject); - - const calledWith = firewall.calledWith_[0]; - - assert.strictEqual(calledWith.parent, computeInstance); - assert.strictEqual(calledWith.baseUrl, '/global/firewalls'); - assert.strictEqual(calledWith.id, FIREWALL_NAME); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, firewall); - done(); - }; - - firewall.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - firewall.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - firewall.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - firewall.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - firewall.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - firewall.delete(); - }); - }); - }); - }); - - describe('setMetadata', () => { - it('should make the correct API request', done => { - const metadata = {}; - - firewall.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'PATCH'); - assert.strictEqual(reqOpts.uri, ''); - assert.strictEqual(reqOpts.json, metadata); - assert.deepStrictEqual(metadata, { - name: firewall.name, - network: DEFAULT_FIREWALL_NETWORK, - }); - - done(); - }; - - firewall.setMetadata(metadata, assert.ifError); - }); - - it('should respect network specification', done => { - const metadata = {network: 'custom-network'}; - - firewall.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.network, metadata.network); - done(); - }; - - firewall.setMetadata(metadata, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - firewall.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - firewall.setMetadata({e: 'f'}, (err, op, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(op, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - firewall.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with operation & response', done => { - const operation = {}; - const metadata = {a: 'b'}; - - firewall.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - firewall.setMetadata(metadata, (err, op, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - firewall.setMetadata({a: 'b'}); - }); - }); - }); - }); -}); diff --git a/test/gapic_accelerator_types_v1.ts b/test/gapic_accelerator_types_v1.ts new file mode 100644 index 00000000..db13c1d8 --- /dev/null +++ b/test/gapic_accelerator_types_v1.ts @@ -0,0 +1,710 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as acceleratortypesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.AcceleratorTypesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + acceleratortypesModule.v1.AcceleratorTypesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + acceleratortypesModule.v1.AcceleratorTypesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = acceleratortypesModule.v1.AcceleratorTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.acceleratorTypesStub, undefined); + await client.initialize(); + assert(client.acceleratorTypesStub); + }); + + it('has close method', () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + 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 acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAcceleratorTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAcceleratorTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAcceleratorType | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAcceleratorTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorTypesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorTypesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorTypesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IAcceleratorTypesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IAcceleratorTypesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAcceleratorType[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.AcceleratorType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.AcceleratorType) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.AcceleratorType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.AcceleratorType) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.AcceleratorType() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IAcceleratorType[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new acceleratortypesModule.v1.AcceleratorTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAcceleratorTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IAcceleratorType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_addresses_v1.ts b/test/gapic_addresses_v1.ts new file mode 100644 index 00000000..ef1e6ac0 --- /dev/null +++ b/test/gapic_addresses_v1.ts @@ -0,0 +1,900 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as addressesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.AddressesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = addressesModule.v1.AddressesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = addressesModule.v1.AddressesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = addressesModule.v1.AddressesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new addressesModule.v1.AddressesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new addressesModule.v1.AddressesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.addressesStub, undefined); + await client.initialize(); + assert(client.addressesStub); + }); + + it('has close method', () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + 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 addressesModule.v1.AddressesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Address() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Address() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAddress | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.AddressesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.AddressesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.AddressesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IAddressesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new addressesModule.v1.AddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IAddressesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new addressesModule.v1.AddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new addressesModule.v1.AddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAddress[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new addressesModule.v1.AddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new addressesModule.v1.AddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Address[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Address) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new addressesModule.v1.AddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Address[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Address) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new addressesModule.v1.AddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IAddress[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new addressesModule.v1.AddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IAddress[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_autoscalers_v1.ts b/test/gapic_autoscalers_v1.ts new file mode 100644 index 00000000..3d665507 --- /dev/null +++ b/test/gapic_autoscalers_v1.ts @@ -0,0 +1,1115 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as autoscalersModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.AutoscalersClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = autoscalersModule.v1.AutoscalersClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = autoscalersModule.v1.AutoscalersClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = autoscalersModule.v1.AutoscalersClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new autoscalersModule.v1.AutoscalersClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.autoscalersStub, undefined); + await client.initialize(); + assert(client.autoscalersStub); + }); + + it('has close method', () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + 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 autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Autoscaler() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Autoscaler() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAutoscaler | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.AutoscalersScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.AutoscalersScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.AutoscalersScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IAutoscalersScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IAutoscalersScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAutoscaler[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Autoscaler[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Autoscaler) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Autoscaler[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Autoscaler) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IAutoscaler[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new autoscalersModule.v1.AutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IAutoscaler[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_backend_buckets_v1.ts b/test/gapic_backend_buckets_v1.ts new file mode 100644 index 00000000..d4fa8984 --- /dev/null +++ b/test/gapic_backend_buckets_v1.ts @@ -0,0 +1,1270 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as backendbucketsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.BackendBucketsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + backendbucketsModule.v1.BackendBucketsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + backendbucketsModule.v1.BackendBucketsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = backendbucketsModule.v1.BackendBucketsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new backendbucketsModule.v1.BackendBucketsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.backendBucketsStub, undefined); + await client.initialize(); + assert(client.backendBucketsStub); + }); + + it('has close method', () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + 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 backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + 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('addSignedUrlKey', () => { + it('invokes addSignedUrlKey without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addSignedUrlKey = stubSimpleCall(expectedResponse); + const [response] = await client.addSignedUrlKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addSignedUrlKey without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addSignedUrlKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addSignedUrlKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addSignedUrlKey with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddSignedUrlKeyBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addSignedUrlKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addSignedUrlKey(request), expectedError); + assert( + (client.innerApiCalls.addSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteSignedUrlKey', () => { + it('invokes deleteSignedUrlKey without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteSignedUrlKey = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSignedUrlKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSignedUrlKey without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteSignedUrlKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSignedUrlKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteSignedUrlKey with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSignedUrlKeyBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSignedUrlKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSignedUrlKey(request), expectedError); + assert( + (client.innerApiCalls.deleteSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendBucket | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateBackendBucketRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendBucketsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendBucketsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendBucket[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendBucketsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendBucketsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.BackendBucket[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.BackendBucket) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendBucketsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.BackendBucket[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.BackendBucket) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendBucketsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendBucket() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IBackendBucket[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new backendbucketsModule.v1.BackendBucketsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendBucketsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IBackendBucket[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_backend_services_v1.ts b/test/gapic_backend_services_v1.ts new file mode 100644 index 00000000..7cb741f4 --- /dev/null +++ b/test/gapic_backend_services_v1.ts @@ -0,0 +1,1583 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as backendservicesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.BackendServicesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + backendservicesModule.v1.BackendServicesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + backendservicesModule.v1.BackendServicesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = backendservicesModule.v1.BackendServicesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new backendservicesModule.v1.BackendServicesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.backendServicesStub, undefined); + await client.initialize(); + assert(client.backendServicesStub); + }); + + it('has close method', () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + 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 backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + 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('addSignedUrlKey', () => { + it('invokes addSignedUrlKey without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addSignedUrlKey = stubSimpleCall(expectedResponse); + const [response] = await client.addSignedUrlKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addSignedUrlKey without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addSignedUrlKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addSignedUrlKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addSignedUrlKey with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddSignedUrlKeyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addSignedUrlKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addSignedUrlKey(request), expectedError); + assert( + (client.innerApiCalls.addSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteSignedUrlKey', () => { + it('invokes deleteSignedUrlKey without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteSignedUrlKey = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteSignedUrlKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteSignedUrlKey without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteSignedUrlKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSignedUrlKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteSignedUrlKey with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSignedUrlKeyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSignedUrlKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSignedUrlKey(request), expectedError); + assert( + (client.innerApiCalls.deleteSignedUrlKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendService | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getHealth', () => { + it('invokes getHealth without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendServiceGroupHealth() + ); + client.innerApiCalls.getHealth = stubSimpleCall(expectedResponse); + const [response] = await client.getHealth(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getHealth without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendServiceGroupHealth() + ); + client.innerApiCalls.getHealth = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHealth( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendServiceGroupHealth | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getHealth with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getHealth = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHealth(request), expectedError); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setSecurityPolicy', () => { + it('invokes setSecurityPolicy without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSecurityPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setSecurityPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSecurityPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setSecurityPolicy without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSecurityPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setSecurityPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSecurityPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setSecurityPolicy with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSecurityPolicyBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setSecurityPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setSecurityPolicy(request), expectedError); + assert( + (client.innerApiCalls.setSecurityPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendServicesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendServicesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendServicesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IBackendServicesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IBackendServicesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendService[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.BackendService[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.BackendService) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.BackendService[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.BackendService) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IBackendService[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new backendservicesModule.v1.BackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IBackendService[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_disk_types_v1.ts b/test/gapic_disk_types_v1.ts new file mode 100644 index 00000000..9fcd39d5 --- /dev/null +++ b/test/gapic_disk_types_v1.ts @@ -0,0 +1,684 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as disktypesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.DiskTypesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = disktypesModule.v1.DiskTypesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = disktypesModule.v1.DiskTypesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = disktypesModule.v1.DiskTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new disktypesModule.v1.DiskTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new disktypesModule.v1.DiskTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.diskTypesStub, undefined); + await client.initialize(); + assert(client.diskTypesStub); + }); + + it('has close method', () => { + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + 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 disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiskTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DiskType() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiskTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DiskType() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDiskType | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiskTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.DiskTypesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.DiskTypesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.DiskTypesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IDiskTypesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IDiskTypesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDiskType[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.DiskType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.DiskType) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.DiskType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.DiskType) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IDiskType[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new disktypesModule.v1.DiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IDiskType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_disks_v1.ts b/test/gapic_disks_v1.ts new file mode 100644 index 00000000..d3dcc41e --- /dev/null +++ b/test/gapic_disks_v1.ts @@ -0,0 +1,1782 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as disksModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.DisksClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = disksModule.v1.DisksClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = disksModule.v1.DisksClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = disksModule.v1.DisksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new disksModule.v1.DisksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new disksModule.v1.DisksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.disksStub, undefined); + await client.initialize(); + assert(client.disksStub); + }); + + it('has close method', () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + 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 disksModule.v1.DisksClient({ + auth: googleAuth, + 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('addResourcePolicies', () => { + it('invokes addResourcePolicies without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addResourcePolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.addResourcePolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addResourcePolicies without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addResourcePolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addResourcePolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addResourcePolicies with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addResourcePolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addResourcePolicies(request), expectedError); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createSnapshot', () => { + it('invokes createSnapshot without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateSnapshotDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.createSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSnapshot without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateSnapshotDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSnapshot with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateSnapshotDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createSnapshot(request), expectedError); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Disk() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Disk() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDisk | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeResourcePolicies', () => { + it('invokes removeResourcePolicies without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeResourcePolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.removeResourcePolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeResourcePolicies without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeResourcePolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeResourcePolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeResourcePolicies with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeResourcePolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.removeResourcePolicies(request), + expectedError + ); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('resize', () => { + it('invokes resize without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = stubSimpleCall(expectedResponse); + const [response] = await client.resize(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes resize without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resize( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes resize with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resize(request), expectedError); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.DisksScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.DisksScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.DisksScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IDisksScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new disksModule.v1.DisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IDisksScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new disksModule.v1.DisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new disksModule.v1.DisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDisk[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new disksModule.v1.DisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new disksModule.v1.DisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Disk[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Disk) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new disksModule.v1.DisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Disk[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Disk) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new disksModule.v1.DisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IDisk[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new disksModule.v1.DisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IDisk[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_external_vpn_gateways_v1.ts b/test/gapic_external_vpn_gateways_v1.ts new file mode 100644 index 00000000..dc2260c0 --- /dev/null +++ b/test/gapic_external_vpn_gateways_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, beforeEach, afterEach} from 'mocha'; +import * as externalvpngatewaysModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ExternalVpnGatewaysClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + externalvpngatewaysModule.v1.ExternalVpnGatewaysClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + externalvpngatewaysModule.v1.ExternalVpnGatewaysClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = externalvpngatewaysModule.v1.ExternalVpnGatewaysClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.externalVpnGatewaysStub, undefined); + await client.initialize(); + assert(client.externalVpnGatewaysStub); + }); + + it('has close method', () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient({ + auth: googleAuth, + 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 externalvpngatewaysModule.v1.ExternalVpnGatewaysClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IExternalVpnGateway | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsExternalVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListExternalVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListExternalVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IExternalVpnGateway[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListExternalVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListExternalVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ExternalVpnGateway[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ExternalVpnGateway) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListExternalVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ExternalVpnGateway[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ExternalVpnGateway) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListExternalVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExternalVpnGateway() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IExternalVpnGateway[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new externalvpngatewaysModule.v1.ExternalVpnGatewaysClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListExternalVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IExternalVpnGateway[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_firewall_policies_v1.ts b/test/gapic_firewall_policies_v1.ts new file mode 100644 index 00000000..ecb9dd45 --- /dev/null +++ b/test/gapic_firewall_policies_v1.ts @@ -0,0 +1,2270 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as firewallpoliciesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.FirewallPoliciesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + firewallpoliciesModule.v1.FirewallPoliciesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + firewallpoliciesModule.v1.FirewallPoliciesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = firewallpoliciesModule.v1.FirewallPoliciesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.firewallPoliciesStub, undefined); + await client.initialize(); + assert(client.firewallPoliciesStub); + }); + + it('has close method', () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + 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 firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + 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('addAssociation', () => { + it('invokes addAssociation without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addAssociation = stubSimpleCall(expectedResponse); + const [response] = await client.addAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addAssociation without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addAssociation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addAssociation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addAssociation with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addAssociation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addAssociation(request), expectedError); + assert( + (client.innerApiCalls.addAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('addRule', () => { + it('invokes addRule without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addRule = stubSimpleCall(expectedResponse); + const [response] = await client.addRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addRule without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addRule with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addRule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addRule(request), expectedError); + assert( + (client.innerApiCalls.addRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('cloneRules', () => { + it('invokes cloneRules without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.cloneRules = stubSimpleCall(expectedResponse); + const [response] = await client.cloneRules(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.cloneRules as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes cloneRules without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.cloneRules = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cloneRules( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.cloneRules as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes cloneRules with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CloneRulesFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.cloneRules = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.cloneRules(request), expectedError); + assert( + (client.innerApiCalls.cloneRules as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IFirewallPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getAssociation', () => { + it('invokes getAssociation without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicyAssociation() + ); + client.innerApiCalls.getAssociation = stubSimpleCall(expectedResponse); + const [response] = await client.getAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getAssociation without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicyAssociation() + ); + client.innerApiCalls.getAssociation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAssociation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IFirewallPolicyAssociation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getAssociation with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAssociation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAssociation(request), expectedError); + assert( + (client.innerApiCalls.getAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getRule', () => { + it('invokes getRule without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicyRule() + ); + client.innerApiCalls.getRule = stubSimpleCall(expectedResponse); + const [response] = await client.getRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getRule without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicyRule() + ); + client.innerApiCalls.getRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IFirewallPolicyRule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getRule with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRule(request), expectedError); + assert( + (client.innerApiCalls.getRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertFirewallPolicyRequest() + ); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertFirewallPolicyRequest() + ); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertFirewallPolicyRequest() + ); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listAssociations', () => { + it('invokes listAssociations without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest() + ); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse() + ); + client.innerApiCalls.listAssociations = stubSimpleCall(expectedResponse); + const [response] = await client.listAssociations(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssociations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAssociations without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest() + ); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPoliciesListAssociationsResponse() + ); + client.innerApiCalls.listAssociations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssociations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IFirewallPoliciesListAssociationsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAssociations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAssociations with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAssociationsFirewallPolicyRequest() + ); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssociations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAssociations(request), expectedError); + assert( + (client.innerApiCalls.listAssociations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('move', () => { + it('invokes move without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.move = stubSimpleCall(expectedResponse); + const [response] = await client.move(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.move as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes move without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.move = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.move( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.move as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes move with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.move = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.move(request), expectedError); + assert( + (client.innerApiCalls.move as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patchRule', () => { + it('invokes patchRule without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchRule = stubSimpleCall(expectedResponse); + const [response] = await client.patchRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patchRule without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patchRule with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patchRule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patchRule(request), expectedError); + assert( + (client.innerApiCalls.patchRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeAssociation', () => { + it('invokes removeAssociation without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeAssociation = stubSimpleCall(expectedResponse); + const [response] = await client.removeAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeAssociation without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeAssociation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeAssociation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeAssociation with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveAssociationFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeAssociation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeAssociation(request), expectedError); + assert( + (client.innerApiCalls.removeAssociation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeRule', () => { + it('invokes removeRule without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeRule = stubSimpleCall(expectedResponse); + const [response] = await client.removeRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeRule without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeRule with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveRuleFirewallPolicyRequest() + ); + request.firewallPolicy = ''; + const expectedHeaderRequestParams = 'firewall_policy='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeRule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeRule(request), expectedError); + assert( + (client.innerApiCalls.removeRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsFirewallPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallPoliciesRequest() + ); + const expectedOptions = {}; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallPoliciesRequest() + ); + const expectedOptions = {}; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IFirewallPolicy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallPoliciesRequest() + ); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallPoliciesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.FirewallPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.FirewallPolicy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + }); + + it('invokes listStream with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallPoliciesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.FirewallPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.FirewallPolicy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallPoliciesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.FirewallPolicy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IFirewallPolicy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new firewallpoliciesModule.v1.FirewallPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallPoliciesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IFirewallPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + }); + }); +}); diff --git a/test/gapic_firewalls_v1.ts b/test/gapic_firewalls_v1.ts new file mode 100644 index 00000000..3caab92d --- /dev/null +++ b/test/gapic_firewalls_v1.ts @@ -0,0 +1,1021 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as firewallsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.FirewallsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = firewallsModule.v1.FirewallsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = firewallsModule.v1.FirewallsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = firewallsModule.v1.FirewallsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new firewallsModule.v1.FirewallsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new firewallsModule.v1.FirewallsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.firewallsStub, undefined); + await client.initialize(); + assert(client.firewallsStub); + }); + + it('has close method', () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + 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 firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Firewall() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Firewall() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IFirewall | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateFirewallRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IFirewall[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Firewall[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Firewall) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Firewall[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Firewall) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + generateSampleMessage(new protos.google.cloud.compute.v1.Firewall()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IFirewall[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new firewallsModule.v1.FirewallsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListFirewallsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IFirewall[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_forwarding_rules_v1.ts b/test/gapic_forwarding_rules_v1.ts new file mode 100644 index 00000000..51c266e0 --- /dev/null +++ b/test/gapic_forwarding_rules_v1.ts @@ -0,0 +1,1249 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as forwardingrulesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ForwardingRulesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + forwardingrulesModule.v1.ForwardingRulesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + forwardingrulesModule.v1.ForwardingRulesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = forwardingrulesModule.v1.ForwardingRulesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.forwardingRulesStub, undefined); + await client.initialize(); + assert(client.forwardingRulesStub); + }); + + it('has close method', () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + 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 forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IForwardingRule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setTarget', () => { + it('invokes setTarget without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTarget = stubSimpleCall(expectedResponse); + const [response] = await client.setTarget(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTarget as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setTarget without error using callback', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTarget = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setTarget( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTarget as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setTarget with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setTarget = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setTarget(request), expectedError); + assert( + (client.innerApiCalls.setTarget as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRulesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRulesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRulesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IForwardingRulesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IForwardingRulesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IForwardingRule[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ForwardingRule[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ForwardingRule) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ForwardingRule[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ForwardingRule) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IForwardingRule[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new forwardingrulesModule.v1.ForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IForwardingRule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_global_addresses_v1.ts b/test/gapic_global_addresses_v1.ts new file mode 100644 index 00000000..3a787916 --- /dev/null +++ b/test/gapic_global_addresses_v1.ts @@ -0,0 +1,808 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as globaladdressesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.GlobalAddressesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + globaladdressesModule.v1.GlobalAddressesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + globaladdressesModule.v1.GlobalAddressesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = globaladdressesModule.v1.GlobalAddressesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.globalAddressesStub, undefined); + await client.initialize(); + assert(client.globalAddressesStub); + }); + + it('has close method', () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + 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 globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Address() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Address() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAddress | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalAddressRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAddress[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Address[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Address) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Address[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Address) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + generateSampleMessage(new protos.google.cloud.compute.v1.Address()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IAddress[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new globaladdressesModule.v1.GlobalAddressesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalAddressesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IAddress[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_global_forwarding_rules_v1.ts b/test/gapic_global_forwarding_rules_v1.ts new file mode 100644 index 00000000..919262ec --- /dev/null +++ b/test/gapic_global_forwarding_rules_v1.ts @@ -0,0 +1,1187 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as globalforwardingrulesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.GlobalForwardingRulesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + globalforwardingrulesModule.v1.GlobalForwardingRulesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + globalforwardingrulesModule.v1.GlobalForwardingRulesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + globalforwardingrulesModule.v1.GlobalForwardingRulesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.globalForwardingRulesStub, undefined); + await client.initialize(); + assert(client.globalForwardingRulesStub); + }); + + it('has close method', () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + 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 globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IForwardingRule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setTarget', () => { + it('invokes setTarget without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTarget = stubSimpleCall(expectedResponse); + const [response] = await client.setTarget(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTarget as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setTarget without error using callback', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTarget = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setTarget( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTarget as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setTarget with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetGlobalForwardingRuleRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setTarget = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setTarget(request), expectedError); + assert( + (client.innerApiCalls.setTarget as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IForwardingRule[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ForwardingRule[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ForwardingRule) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ForwardingRule[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ForwardingRule) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ForwardingRule() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IForwardingRule[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new globalforwardingrulesModule.v1.GlobalForwardingRulesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalForwardingRulesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IForwardingRule[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_global_network_endpoint_groups_v1.ts b/test/gapic_global_network_endpoint_groups_v1.ts new file mode 100644 index 00000000..8dfdac98 --- /dev/null +++ b/test/gapic_global_network_endpoint_groups_v1.ts @@ -0,0 +1,1491 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as globalnetworkendpointgroupsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.GlobalNetworkEndpointGroupsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + assert.strictEqual(client.globalNetworkEndpointGroupsStub, undefined); + await client.initialize(); + assert(client.globalNetworkEndpointGroupsStub); + }); + + it('has close method', () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + 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 globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + 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('attachNetworkEndpoints', () => { + it('invokes attachNetworkEndpoints without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.attachNetworkEndpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.attachNetworkEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.attachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes attachNetworkEndpoints without error using callback', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.attachNetworkEndpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.attachNetworkEndpoints( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.attachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes attachNetworkEndpoints with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachNetworkEndpointsGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.attachNetworkEndpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.attachNetworkEndpoints(request), + expectedError + ); + assert( + (client.innerApiCalls.attachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('detachNetworkEndpoints', () => { + it('invokes detachNetworkEndpoints without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.detachNetworkEndpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.detachNetworkEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes detachNetworkEndpoints without error using callback', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.detachNetworkEndpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detachNetworkEndpoints( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes detachNetworkEndpoints with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachNetworkEndpointsGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detachNetworkEndpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.detachNetworkEndpoints(request), + expectedError + ); + assert( + (client.innerApiCalls.detachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INetworkEndpointGroup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.INetworkEndpointGroup[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointGroup[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NetworkEndpointGroup) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointGroup[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NetworkEndpointGroup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INetworkEndpointGroup[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INetworkEndpointGroup[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNetworkEndpoints', () => { + it('invokes listNetworkEndpoints without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.innerApiCalls.listNetworkEndpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.listNetworkEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNetworkEndpoints without error using callback', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.innerApiCalls.listNetworkEndpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNetworkEndpoints( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listNetworkEndpoints with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNetworkEndpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listNetworkEndpoints(request), expectedError); + assert( + (client.innerApiCalls.listNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNetworkEndpointsStream without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.descriptors.page.listNetworkEndpoints.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNetworkEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus + ) => { + 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.listNetworkEndpoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNetworkEndpoints, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listNetworkEndpointsStream with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listNetworkEndpoints.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNetworkEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listNetworkEndpoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNetworkEndpoints, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNetworkEndpoints without error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.descriptors.page.listNetworkEndpoints.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[] = + []; + const iterable = client.listNetworkEndpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNetworkEndpoints with error', async () => { + const client = + new globalnetworkendpointgroupsModule.v1.GlobalNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsGlobalNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listNetworkEndpoints.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNetworkEndpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_global_operations_v1.ts b/test/gapic_global_operations_v1.ts new file mode 100644 index 00000000..7e033368 --- /dev/null +++ b/test/gapic_global_operations_v1.ts @@ -0,0 +1,901 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as globaloperationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.GlobalOperationsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + globaloperationsModule.v1.GlobalOperationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + globaloperationsModule.v1.GlobalOperationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = globaloperationsModule.v1.GlobalOperationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.globalOperationsStub, undefined); + await client.initialize(); + assert(client.globalOperationsStub); + }); + + it('has close method', () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + 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 globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOperationResponse() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOperationResponse() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDeleteGlobalOperationResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('wait', () => { + it('invokes wait without error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.wait = stubSimpleCall(expectedResponse); + const [response] = await client.wait(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes wait without error using callback', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.wait = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.wait( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes wait with error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitGlobalOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.wait = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.wait(request), expectedError); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.OperationsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.OperationsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.OperationsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IOperationsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IOperationsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new globaloperationsModule.v1.GlobalOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_global_organization_operations_v1.ts b/test/gapic_global_organization_operations_v1.ts new file mode 100644 index 00000000..e8faf18a --- /dev/null +++ b/test/gapic_global_organization_operations_v1.ts @@ -0,0 +1,707 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as globalorganizationoperationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.GlobalOrganizationOperationsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + assert.strictEqual(client.globalOrganizationOperationsStub, undefined); + await client.initialize(); + assert(client.globalOrganizationOperationsStub); + }); + + it('has close method', () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + 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 globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest() + ); + request.operation = ''; + const expectedHeaderRequestParams = 'operation='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest() + ); + request.operation = ''; + const expectedHeaderRequestParams = 'operation='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOrganizationOperationResponse() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDeleteGlobalOrganizationOperationResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalOrganizationOperationRequest() + ); + request.operation = ''; + const expectedHeaderRequestParams = 'operation='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalOrganizationOperationRequest() + ); + request.operation = ''; + const expectedHeaderRequestParams = 'operation='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalOrganizationOperationRequest() + ); + request.operation = ''; + const expectedHeaderRequestParams = 'operation='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalOrganizationOperationRequest() + ); + request.operation = ''; + const expectedHeaderRequestParams = 'operation='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest() + ); + const expectedOptions = {}; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest() + ); + const expectedOptions = {}; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest() + ); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + }); + + it('invokes listStream with error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new globalorganizationoperationsModule.v1.GlobalOrganizationOperationsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalOrganizationOperationsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + }); + }); +}); diff --git a/test/gapic_global_public_delegated_prefixes_v1.ts b/test/gapic_global_public_delegated_prefixes_v1.ts new file mode 100644 index 00000000..074b2d90 --- /dev/null +++ b/test/gapic_global_public_delegated_prefixes_v1.ts @@ -0,0 +1,1022 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as globalpublicdelegatedprefixesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.GlobalPublicDelegatedPrefixesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + assert.strictEqual(client.globalPublicDelegatedPrefixesStub, undefined); + await client.initialize(); + assert(client.globalPublicDelegatedPrefixesStub); + }); + + it('has close method', () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + 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 globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPublicDelegatedPrefix | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchGlobalPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IPublicDelegatedPrefix[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PublicDelegatedPrefix[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PublicDelegatedPrefix) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PublicDelegatedPrefix[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PublicDelegatedPrefix) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IPublicDelegatedPrefix[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new globalpublicdelegatedprefixesModule.v1.GlobalPublicDelegatedPrefixesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListGlobalPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IPublicDelegatedPrefix[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_health_checks_v1.ts b/test/gapic_health_checks_v1.ts new file mode 100644 index 00000000..945ed2e9 --- /dev/null +++ b/test/gapic_health_checks_v1.ts @@ -0,0 +1,1115 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as healthchecksModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.HealthChecksClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = healthchecksModule.v1.HealthChecksClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = healthchecksModule.v1.HealthChecksClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = healthchecksModule.v1.HealthChecksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new healthchecksModule.v1.HealthChecksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.healthChecksStub, undefined); + await client.initialize(); + assert(client.healthChecksStub); + }); + + it('has close method', () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + 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 healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheck() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheck() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IHealthCheck | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthChecksScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthChecksScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthChecksScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IHealthChecksScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IHealthChecksScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IHealthCheck[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.HealthCheck[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.HealthCheck) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.HealthCheck[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.HealthCheck) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IHealthCheck[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new healthchecksModule.v1.HealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IHealthCheck[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_images_v1.ts b/test/gapic_images_v1.ts new file mode 100644 index 00000000..d756da83 --- /dev/null +++ b/test/gapic_images_v1.ts @@ -0,0 +1,1568 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as imagesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ImagesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = imagesModule.v1.ImagesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = imagesModule.v1.ImagesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = imagesModule.v1.ImagesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new imagesModule.v1.ImagesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new imagesModule.v1.ImagesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.imagesStub, undefined); + await client.initialize(); + assert(client.imagesStub); + }); + + it('has close method', () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + 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 imagesModule.v1.ImagesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deprecate', () => { + it('invokes deprecate without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeprecateImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deprecate = stubSimpleCall(expectedResponse); + const [response] = await client.deprecate(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deprecate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deprecate without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeprecateImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deprecate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deprecate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deprecate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deprecate with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeprecateImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deprecate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deprecate(request), expectedError); + assert( + (client.innerApiCalls.deprecate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Image() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Image() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IImage | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getFromFamily', () => { + it('invokes getFromFamily without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFromFamilyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Image() + ); + client.innerApiCalls.getFromFamily = stubSimpleCall(expectedResponse); + const [response] = await client.getFromFamily(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getFromFamily as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getFromFamily without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFromFamilyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Image() + ); + client.innerApiCalls.getFromFamily = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFromFamily( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IImage | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getFromFamily as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getFromFamily with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetFromFamilyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getFromFamily = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getFromFamily(request), expectedError); + assert( + (client.innerApiCalls.getFromFamily as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsImageRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListImagesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new imagesModule.v1.ImagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListImagesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IImage[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListImagesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListImagesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Image[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Image) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListImagesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Image[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Image) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new imagesModule.v1.ImagesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListImagesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + generateSampleMessage(new protos.google.cloud.compute.v1.Image()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IImage[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new imagesModule.v1.ImagesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListImagesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IImage[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_instance_group_managers_v1.ts b/test/gapic_instance_group_managers_v1.ts new file mode 100644 index 00000000..271d4ad1 --- /dev/null +++ b/test/gapic_instance_group_managers_v1.ts @@ -0,0 +1,3311 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as instancegroupmanagersModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.InstanceGroupManagersClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + instancegroupmanagersModule.v1.InstanceGroupManagersClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + instancegroupmanagersModule.v1.InstanceGroupManagersClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + instancegroupmanagersModule.v1.InstanceGroupManagersClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.instanceGroupManagersStub, undefined); + await client.initialize(); + assert(client.instanceGroupManagersStub); + }); + + it('has close method', () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + 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 instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + 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('abandonInstances', () => { + it('invokes abandonInstances without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.abandonInstances = stubSimpleCall(expectedResponse); + const [response] = await client.abandonInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.abandonInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes abandonInstances without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.abandonInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.abandonInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.abandonInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes abandonInstances with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AbandonInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.abandonInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.abandonInstances(request), expectedError); + assert( + (client.innerApiCalls.abandonInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('applyUpdatesToInstances', () => { + it('invokes applyUpdatesToInstances without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.applyUpdatesToInstances = + stubSimpleCall(expectedResponse); + const [response] = await client.applyUpdatesToInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyUpdatesToInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applyUpdatesToInstances without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.applyUpdatesToInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.applyUpdatesToInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyUpdatesToInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes applyUpdatesToInstances with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ApplyUpdatesToInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applyUpdatesToInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.applyUpdatesToInstances(request), + expectedError + ); + assert( + (client.innerApiCalls.applyUpdatesToInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createInstances', () => { + it('invokes createInstances without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createInstances = stubSimpleCall(expectedResponse); + const [response] = await client.createInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createInstances without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createInstances with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstances(request), expectedError); + assert( + (client.innerApiCalls.createInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteInstances', () => { + it('invokes deleteInstances without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteInstances = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteInstances without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteInstances with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstances(request), expectedError); + assert( + (client.innerApiCalls.deleteInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deletePerInstanceConfigs', () => { + it('invokes deletePerInstanceConfigs without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deletePerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.deletePerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deletePerInstanceConfigs without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deletePerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deletePerInstanceConfigs with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deletePerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceGroupManager | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patchPerInstanceConfigs', () => { + it('invokes patchPerInstanceConfigs without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchPerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.patchPerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patchPerInstanceConfigs without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchPerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchPerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patchPerInstanceConfigs with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patchPerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.patchPerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('recreateInstances', () => { + it('invokes recreateInstances without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.recreateInstances = stubSimpleCall(expectedResponse); + const [response] = await client.recreateInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.recreateInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes recreateInstances without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.recreateInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recreateInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.recreateInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes recreateInstances with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RecreateInstancesInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.recreateInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.recreateInstances(request), expectedError); + assert( + (client.innerApiCalls.recreateInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('resize', () => { + it('invokes resize without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = stubSimpleCall(expectedResponse); + const [response] = await client.resize(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes resize without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resize( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes resize with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resize(request), expectedError); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setInstanceTemplate', () => { + it('invokes setInstanceTemplate without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setInstanceTemplate = + stubSimpleCall(expectedResponse); + const [response] = await client.setInstanceTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setInstanceTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setInstanceTemplate without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setInstanceTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setInstanceTemplate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setInstanceTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setInstanceTemplate with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetInstanceTemplateInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setInstanceTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setInstanceTemplate(request), expectedError); + assert( + (client.innerApiCalls.setInstanceTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setTargetPools', () => { + it('invokes setTargetPools without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTargetPools = stubSimpleCall(expectedResponse); + const [response] = await client.setTargetPools(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTargetPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setTargetPools without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTargetPools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setTargetPools( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTargetPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setTargetPools with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetPoolsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setTargetPools = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setTargetPools(request), expectedError); + assert( + (client.innerApiCalls.setTargetPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updatePerInstanceConfigs', () => { + it('invokes updatePerInstanceConfigs without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updatePerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.updatePerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updatePerInstanceConfigs without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updatePerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updatePerInstanceConfigs with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePerInstanceConfigsInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updatePerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManagersScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManagersScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManagersScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.IInstanceGroupManagersScopedList + ] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.IInstanceGroupManagersScopedList + ] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInstanceGroupManager[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroupManager[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroupManager) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroupManager[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroupManager) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceGroupManager[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstanceGroupManager[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listErrors', () => { + it('invokes listErrors without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.innerApiCalls.listErrors = stubSimpleCall(expectedResponse); + const [response] = await client.listErrors(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listErrors as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listErrors without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.innerApiCalls.listErrors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listErrors( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInstanceManagedByIgmError[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listErrors as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listErrors with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listErrors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listErrors(request), expectedError); + assert( + (client.innerApiCalls.listErrors as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listErrorsStream without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.descriptors.page.listErrors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listErrorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceManagedByIgmError[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.InstanceManagedByIgmError + ) => { + 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.listErrors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listErrors, request) + ); + assert.strictEqual( + (client.descriptors.page.listErrors.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listErrorsStream with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listErrors.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listErrorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceManagedByIgmError[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.InstanceManagedByIgmError + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listErrors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listErrors, request) + ); + assert.strictEqual( + (client.descriptors.page.listErrors.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listErrors without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.descriptors.page.listErrors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceManagedByIgmError[] = + []; + const iterable = client.listErrorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listErrors with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listErrors.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listErrorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstanceManagedByIgmError[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listManagedInstances', () => { + it('invokes listManagedInstances without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.innerApiCalls.listManagedInstances = + stubSimpleCall(expectedResponse); + const [response] = await client.listManagedInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listManagedInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listManagedInstances without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.innerApiCalls.listManagedInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listManagedInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IManagedInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listManagedInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listManagedInstances with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listManagedInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listManagedInstances(request), expectedError); + assert( + (client.innerApiCalls.listManagedInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listManagedInstancesStream without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.descriptors.page.listManagedInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listManagedInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ManagedInstance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ManagedInstance) => { + 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.listManagedInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listManagedInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listManagedInstancesStream with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listManagedInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listManagedInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ManagedInstance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ManagedInstance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listManagedInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listManagedInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listManagedInstances without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.descriptors.page.listManagedInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IManagedInstance[] = []; + const iterable = client.listManagedInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listManagedInstances with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listManagedInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listManagedInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IManagedInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listPerInstanceConfigs', () => { + it('invokes listPerInstanceConfigs without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.innerApiCalls.listPerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listPerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPerInstanceConfigs without error using callback', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.innerApiCalls.listPerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPerInstanceConfig[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listPerInstanceConfigs with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listPerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listPerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.listPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPerInstanceConfigsStream without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.descriptors.page.listPerInstanceConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPerInstanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PerInstanceConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PerInstanceConfig) => { + 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.listPerInstanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPerInstanceConfigs, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listPerInstanceConfigsStream with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listPerInstanceConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPerInstanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PerInstanceConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PerInstanceConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listPerInstanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPerInstanceConfigs, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPerInstanceConfigs without error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.descriptors.page.listPerInstanceConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IPerInstanceConfig[] = []; + const iterable = client.listPerInstanceConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPerInstanceConfigs with error', async () => { + const client = + new instancegroupmanagersModule.v1.InstanceGroupManagersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listPerInstanceConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPerInstanceConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IPerInstanceConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_instance_groups_v1.ts b/test/gapic_instance_groups_v1.ts new file mode 100644 index 00000000..2d43f8ac --- /dev/null +++ b/test/gapic_instance_groups_v1.ts @@ -0,0 +1,1570 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as instancegroupsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.InstanceGroupsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + instancegroupsModule.v1.InstanceGroupsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + instancegroupsModule.v1.InstanceGroupsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = instancegroupsModule.v1.InstanceGroupsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.instanceGroupsStub, undefined); + await client.initialize(); + assert(client.instanceGroupsStub); + }); + + it('has close method', () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + 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 instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + 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('addInstances', () => { + it('invokes addInstances without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddInstancesInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addInstances = stubSimpleCall(expectedResponse); + const [response] = await client.addInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addInstances without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddInstancesInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addInstances with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddInstancesInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addInstances(request), expectedError); + assert( + (client.innerApiCalls.addInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceGroup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeInstances', () => { + it('invokes removeInstances without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeInstances = stubSimpleCall(expectedResponse); + const [response] = await client.removeInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeInstances without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeInstances with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveInstancesInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeInstances(request), expectedError); + assert( + (client.innerApiCalls.removeInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setNamedPorts', () => { + it('invokes setNamedPorts without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setNamedPorts = stubSimpleCall(expectedResponse); + const [response] = await client.setNamedPorts(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setNamedPorts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setNamedPorts without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setNamedPorts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNamedPorts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setNamedPorts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setNamedPorts with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNamedPortsInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setNamedPorts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setNamedPorts(request), expectedError); + assert( + (client.innerApiCalls.setNamedPorts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IInstanceGroupsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IInstanceGroupsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceGroup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroup) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceGroup[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstanceGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInstanceWithNamedPorts[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listInstances with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceWithNamedPorts[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceWithNamedPorts) => { + 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.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + 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.compute.v1.InstanceWithNamedPorts[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceWithNamedPorts) => { + 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.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceWithNamedPorts[] = + []; + 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.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new instancegroupsModule.v1.InstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + 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.compute.v1.IInstanceWithNamedPorts[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_instance_templates_v1.ts b/test/gapic_instance_templates_v1.ts new file mode 100644 index 00000000..3bbd368b --- /dev/null +++ b/test/gapic_instance_templates_v1.ts @@ -0,0 +1,1167 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as instancetemplatesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.InstanceTemplatesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + instancetemplatesModule.v1.InstanceTemplatesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + instancetemplatesModule.v1.InstanceTemplatesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = instancetemplatesModule.v1.InstanceTemplatesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.instanceTemplatesStub, undefined); + await client.initialize(); + assert(client.instanceTemplatesStub); + }); + + it('has close method', () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + 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 instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceTemplate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsInstanceTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceTemplate[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceTemplate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceTemplate) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceTemplate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceTemplate) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceTemplate() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceTemplate[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new instancetemplatesModule.v1.InstanceTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstanceTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstanceTemplate[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_instances_v1.ts b/test/gapic_instances_v1.ts new file mode 100644 index 00000000..59617e38 --- /dev/null +++ b/test/gapic_instances_v1.ts @@ -0,0 +1,5202 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as instancesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.InstancesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = instancesModule.v1.InstancesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = instancesModule.v1.InstancesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = instancesModule.v1.InstancesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new instancesModule.v1.InstancesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new instancesModule.v1.InstancesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.instancesStub, undefined); + await client.initialize(); + assert(client.instancesStub); + }); + + it('has close method', () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + 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 instancesModule.v1.InstancesClient({ + auth: googleAuth, + 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('addAccessConfig', () => { + it('invokes addAccessConfig without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addAccessConfig = stubSimpleCall(expectedResponse); + const [response] = await client.addAccessConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addAccessConfig without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addAccessConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addAccessConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addAccessConfig with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addAccessConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addAccessConfig(request), expectedError); + assert( + (client.innerApiCalls.addAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('addResourcePolicies', () => { + it('invokes addResourcePolicies without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addResourcePolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.addResourcePolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addResourcePolicies without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addResourcePolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addResourcePolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addResourcePolicies with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addResourcePolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addResourcePolicies(request), expectedError); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('attachDisk', () => { + it('invokes attachDisk without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachDiskInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.attachDisk = stubSimpleCall(expectedResponse); + const [response] = await client.attachDisk(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.attachDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes attachDisk without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachDiskInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.attachDisk = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.attachDisk( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.attachDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes attachDisk with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachDiskInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.attachDisk = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.attachDisk(request), expectedError); + assert( + (client.innerApiCalls.attachDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('bulkInsert', () => { + it('invokes bulkInsert without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.BulkInsertInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.bulkInsert = stubSimpleCall(expectedResponse); + const [response] = await client.bulkInsert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkInsert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkInsert without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.BulkInsertInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.bulkInsert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkInsert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkInsert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes bulkInsert with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.BulkInsertInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkInsert = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.bulkInsert(request), expectedError); + assert( + (client.innerApiCalls.bulkInsert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteAccessConfig', () => { + it('invokes deleteAccessConfig without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteAccessConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteAccessConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteAccessConfig without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteAccessConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAccessConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteAccessConfig with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAccessConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteAccessConfig(request), expectedError); + assert( + (client.innerApiCalls.deleteAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('detachDisk', () => { + it('invokes detachDisk without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachDiskInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.detachDisk = stubSimpleCall(expectedResponse); + const [response] = await client.detachDisk(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detachDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes detachDisk without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachDiskInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.detachDisk = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detachDisk( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detachDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes detachDisk with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachDiskInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detachDisk = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.detachDisk(request), expectedError); + assert( + (client.innerApiCalls.detachDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Instance() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Instance() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getEffectiveFirewalls', () => { + it('invokes getEffectiveFirewalls without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse() + ); + client.innerApiCalls.getEffectiveFirewalls = + stubSimpleCall(expectedResponse); + const [response] = await client.getEffectiveFirewalls(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getEffectiveFirewalls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getEffectiveFirewalls without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstancesGetEffectiveFirewallsResponse() + ); + client.innerApiCalls.getEffectiveFirewalls = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEffectiveFirewalls( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstancesGetEffectiveFirewallsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getEffectiveFirewalls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getEffectiveFirewalls with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetEffectiveFirewallsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getEffectiveFirewalls = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getEffectiveFirewalls(request), + expectedError + ); + assert( + (client.innerApiCalls.getEffectiveFirewalls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getGuestAttributes', () => { + it('invokes getGuestAttributes without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGuestAttributesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.GuestAttributes() + ); + client.innerApiCalls.getGuestAttributes = + stubSimpleCall(expectedResponse); + const [response] = await client.getGuestAttributes(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGuestAttributes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getGuestAttributes without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGuestAttributesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.GuestAttributes() + ); + client.innerApiCalls.getGuestAttributes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGuestAttributes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IGuestAttributes | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getGuestAttributes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getGuestAttributes with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetGuestAttributesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGuestAttributes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGuestAttributes(request), expectedError); + assert( + (client.innerApiCalls.getGuestAttributes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getScreenshot', () => { + it('invokes getScreenshot without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetScreenshotInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Screenshot() + ); + client.innerApiCalls.getScreenshot = stubSimpleCall(expectedResponse); + const [response] = await client.getScreenshot(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getScreenshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getScreenshot without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetScreenshotInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Screenshot() + ); + client.innerApiCalls.getScreenshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getScreenshot( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IScreenshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getScreenshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getScreenshot with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetScreenshotInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getScreenshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getScreenshot(request), expectedError); + assert( + (client.innerApiCalls.getScreenshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getSerialPortOutput', () => { + it('invokes getSerialPortOutput without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSerialPortOutputInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SerialPortOutput() + ); + client.innerApiCalls.getSerialPortOutput = + stubSimpleCall(expectedResponse); + const [response] = await client.getSerialPortOutput(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSerialPortOutput as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getSerialPortOutput without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSerialPortOutputInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SerialPortOutput() + ); + client.innerApiCalls.getSerialPortOutput = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSerialPortOutput( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISerialPortOutput | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getSerialPortOutput as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getSerialPortOutput with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSerialPortOutputInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getSerialPortOutput = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSerialPortOutput(request), expectedError); + assert( + (client.innerApiCalls.getSerialPortOutput as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getShieldedInstanceIdentity', () => { + it('invokes getShieldedInstanceIdentity without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ShieldedInstanceIdentity() + ); + client.innerApiCalls.getShieldedInstanceIdentity = + stubSimpleCall(expectedResponse); + const [response] = await client.getShieldedInstanceIdentity(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getShieldedInstanceIdentity as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getShieldedInstanceIdentity without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ShieldedInstanceIdentity() + ); + client.innerApiCalls.getShieldedInstanceIdentity = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getShieldedInstanceIdentity( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IShieldedInstanceIdentity | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getShieldedInstanceIdentity as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getShieldedInstanceIdentity with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetShieldedInstanceIdentityInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getShieldedInstanceIdentity = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getShieldedInstanceIdentity(request), + expectedError + ); + assert( + (client.innerApiCalls.getShieldedInstanceIdentity as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeResourcePolicies', () => { + it('invokes removeResourcePolicies without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeResourcePolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.removeResourcePolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeResourcePolicies without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeResourcePolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeResourcePolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeResourcePolicies with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeResourcePolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.removeResourcePolicies(request), + expectedError + ); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('reset', () => { + it('invokes reset without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.reset = stubSimpleCall(expectedResponse); + const [response] = await client.reset(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.reset as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes reset without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.reset = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reset( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.reset as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes reset with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.reset = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.reset(request), expectedError); + assert( + (client.innerApiCalls.reset as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setDeletionProtection', () => { + it('invokes setDeletionProtection without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDeletionProtectionInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setDeletionProtection = + stubSimpleCall(expectedResponse); + const [response] = await client.setDeletionProtection(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setDeletionProtection as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setDeletionProtection without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDeletionProtectionInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setDeletionProtection = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setDeletionProtection( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setDeletionProtection as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setDeletionProtection with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDeletionProtectionInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setDeletionProtection = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.setDeletionProtection(request), + expectedError + ); + assert( + (client.innerApiCalls.setDeletionProtection as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setDiskAutoDelete', () => { + it('invokes setDiskAutoDelete without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setDiskAutoDelete = stubSimpleCall(expectedResponse); + const [response] = await client.setDiskAutoDelete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setDiskAutoDelete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setDiskAutoDelete without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setDiskAutoDelete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setDiskAutoDelete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setDiskAutoDelete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setDiskAutoDelete with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDiskAutoDeleteInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setDiskAutoDelete = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setDiskAutoDelete(request), expectedError); + assert( + (client.innerApiCalls.setDiskAutoDelete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setMachineResources', () => { + it('invokes setMachineResources without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMachineResourcesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMachineResources = + stubSimpleCall(expectedResponse); + const [response] = await client.setMachineResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMachineResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setMachineResources without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMachineResourcesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMachineResources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMachineResources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMachineResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setMachineResources with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMachineResourcesInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setMachineResources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setMachineResources(request), expectedError); + assert( + (client.innerApiCalls.setMachineResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setMachineType', () => { + it('invokes setMachineType without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMachineTypeInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMachineType = stubSimpleCall(expectedResponse); + const [response] = await client.setMachineType(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMachineType as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setMachineType without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMachineTypeInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMachineType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMachineType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMachineType as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setMachineType with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMachineTypeInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setMachineType = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setMachineType(request), expectedError); + assert( + (client.innerApiCalls.setMachineType as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setMetadata', () => { + it('invokes setMetadata without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMetadataInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMetadata = stubSimpleCall(expectedResponse); + const [response] = await client.setMetadata(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMetadata as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setMetadata without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMetadataInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMetadata = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMetadata( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMetadata as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setMetadata with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMetadataInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setMetadata = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setMetadata(request), expectedError); + assert( + (client.innerApiCalls.setMetadata as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setMinCpuPlatform', () => { + it('invokes setMinCpuPlatform without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMinCpuPlatform = stubSimpleCall(expectedResponse); + const [response] = await client.setMinCpuPlatform(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMinCpuPlatform as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setMinCpuPlatform without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setMinCpuPlatform = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setMinCpuPlatform( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setMinCpuPlatform as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setMinCpuPlatform with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetMinCpuPlatformInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setMinCpuPlatform = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setMinCpuPlatform(request), expectedError); + assert( + (client.innerApiCalls.setMinCpuPlatform as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setScheduling', () => { + it('invokes setScheduling without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSchedulingInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setScheduling = stubSimpleCall(expectedResponse); + const [response] = await client.setScheduling(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setScheduling as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setScheduling without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSchedulingInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setScheduling = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setScheduling( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setScheduling as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setScheduling with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSchedulingInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setScheduling = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setScheduling(request), expectedError); + assert( + (client.innerApiCalls.setScheduling as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setServiceAccount', () => { + it('invokes setServiceAccount without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetServiceAccountInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setServiceAccount = stubSimpleCall(expectedResponse); + const [response] = await client.setServiceAccount(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setServiceAccount as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setServiceAccount without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetServiceAccountInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setServiceAccount = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setServiceAccount( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setServiceAccount as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setServiceAccount with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetServiceAccountInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setServiceAccount = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setServiceAccount(request), expectedError); + assert( + (client.innerApiCalls.setServiceAccount as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setShieldedInstanceIntegrityPolicy', () => { + it('invokes setShieldedInstanceIntegrityPolicy without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setShieldedInstanceIntegrityPolicy = + stubSimpleCall(expectedResponse); + const [response] = await client.setShieldedInstanceIntegrityPolicy( + request + ); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setShieldedInstanceIntegrityPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setShieldedInstanceIntegrityPolicy without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setShieldedInstanceIntegrityPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setShieldedInstanceIntegrityPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setShieldedInstanceIntegrityPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setShieldedInstanceIntegrityPolicy with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetShieldedInstanceIntegrityPolicyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setShieldedInstanceIntegrityPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.setShieldedInstanceIntegrityPolicy(request), + expectedError + ); + assert( + (client.innerApiCalls.setShieldedInstanceIntegrityPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setTags', () => { + it('invokes setTags without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTagsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTags = stubSimpleCall(expectedResponse); + const [response] = await client.setTags(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTags as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setTags without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTagsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTags = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setTags( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTags as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setTags with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTagsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setTags = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setTags(request), expectedError); + assert( + (client.innerApiCalls.setTags as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('simulateMaintenanceEvent', () => { + it('invokes simulateMaintenanceEvent without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.simulateMaintenanceEvent = + stubSimpleCall(expectedResponse); + const [response] = await client.simulateMaintenanceEvent(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.simulateMaintenanceEvent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes simulateMaintenanceEvent without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.simulateMaintenanceEvent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.simulateMaintenanceEvent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.simulateMaintenanceEvent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes simulateMaintenanceEvent with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SimulateMaintenanceEventInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.simulateMaintenanceEvent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.simulateMaintenanceEvent(request), + expectedError + ); + assert( + (client.innerApiCalls.simulateMaintenanceEvent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('start', () => { + it('invokes start without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StartInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.start = stubSimpleCall(expectedResponse); + const [response] = await client.start(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.start as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes start without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StartInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.start = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.start( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.start as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes start with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StartInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.start = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.start(request), expectedError); + assert( + (client.innerApiCalls.start as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('startWithEncryptionKey', () => { + it('invokes startWithEncryptionKey without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.startWithEncryptionKey = + stubSimpleCall(expectedResponse); + const [response] = await client.startWithEncryptionKey(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.startWithEncryptionKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes startWithEncryptionKey without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.startWithEncryptionKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startWithEncryptionKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.startWithEncryptionKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes startWithEncryptionKey with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StartWithEncryptionKeyInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.startWithEncryptionKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.startWithEncryptionKey(request), + expectedError + ); + assert( + (client.innerApiCalls.startWithEncryptionKey as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('stop', () => { + it('invokes stop without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StopInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.stop = stubSimpleCall(expectedResponse); + const [response] = await client.stop(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.stop as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes stop without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StopInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.stop = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stop( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.stop as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes stop with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.StopInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.stop = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.stop(request), expectedError); + assert( + (client.innerApiCalls.stop as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateAccessConfig', () => { + it('invokes updateAccessConfig without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateAccessConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateAccessConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAccessConfig without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateAccessConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAccessConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateAccessConfig with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateAccessConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAccessConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAccessConfig(request), expectedError); + assert( + (client.innerApiCalls.updateAccessConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateDisplayDevice', () => { + it('invokes updateDisplayDevice without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateDisplayDevice = + stubSimpleCall(expectedResponse); + const [response] = await client.updateDisplayDevice(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateDisplayDevice as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateDisplayDevice without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateDisplayDevice = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDisplayDevice( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateDisplayDevice as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateDisplayDevice with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateDisplayDeviceInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDisplayDevice = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDisplayDevice(request), expectedError); + assert( + (client.innerApiCalls.updateDisplayDevice as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateNetworkInterface', () => { + it('invokes updateNetworkInterface without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateNetworkInterface = + stubSimpleCall(expectedResponse); + const [response] = await client.updateNetworkInterface(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNetworkInterface as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateNetworkInterface without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateNetworkInterface = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNetworkInterface( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateNetworkInterface as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateNetworkInterface with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateNetworkInterfaceInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNetworkInterface = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateNetworkInterface(request), + expectedError + ); + assert( + (client.innerApiCalls.updateNetworkInterface as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateShieldedInstanceConfig', () => { + it('invokes updateShieldedInstanceConfig without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateShieldedInstanceConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.updateShieldedInstanceConfig(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateShieldedInstanceConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateShieldedInstanceConfig without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updateShieldedInstanceConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateShieldedInstanceConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateShieldedInstanceConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateShieldedInstanceConfig with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateShieldedInstanceConfigInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateShieldedInstanceConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateShieldedInstanceConfig(request), + expectedError + ); + assert( + (client.innerApiCalls.updateShieldedInstanceConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstancesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstancesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.InstancesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IInstancesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IInstancesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + generateSampleMessage(new protos.google.cloud.compute.v1.Instance()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstance[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listReferrers', () => { + it('invokes listReferrers without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReferrersInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + ]; + client.innerApiCalls.listReferrers = stubSimpleCall(expectedResponse); + const [response] = await client.listReferrers(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listReferrers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listReferrers without error using callback', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReferrersInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + ]; + client.innerApiCalls.listReferrers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReferrers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IReference[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listReferrers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listReferrers with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReferrersInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listReferrers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReferrers(request), expectedError); + assert( + (client.innerApiCalls.listReferrers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listReferrersStream without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReferrersInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + ]; + client.descriptors.page.listReferrers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReferrersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Reference[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Reference) => { + 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.listReferrers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReferrers, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listReferrers.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listReferrersStream with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReferrersInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listReferrers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listReferrersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Reference[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Reference) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReferrers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReferrers, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listReferrers.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listReferrers without error', async () => { + const client = new instancesModule.v1.InstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReferrersInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reference()), + ]; + client.descriptors.page.listReferrers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IReference[] = []; + const iterable = client.listReferrersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listReferrers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listReferrers.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listReferrers with error', async () => { + const client = new instancesModule.v1.InstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReferrersInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listReferrers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReferrersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IReference[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listReferrers.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listReferrers.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_interconnect_attachments_v1.ts b/test/gapic_interconnect_attachments_v1.ts new file mode 100644 index 00000000..7a094c2d --- /dev/null +++ b/test/gapic_interconnect_attachments_v1.ts @@ -0,0 +1,1075 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as interconnectattachmentsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.InterconnectAttachmentsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + interconnectattachmentsModule.v1.InterconnectAttachmentsClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + interconnectattachmentsModule.v1.InterconnectAttachmentsClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + interconnectattachmentsModule.v1.InterconnectAttachmentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.interconnectAttachmentsStub, undefined); + await client.initialize(); + assert(client.interconnectAttachmentsStub); + }); + + it('has close method', () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + 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 interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInterconnectAttachment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInterconnectAttachmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachmentsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachmentsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachmentsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.IInterconnectAttachmentsScopedList + ] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.IInterconnectAttachmentsScopedList + ] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInterconnectAttachment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InterconnectAttachment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InterconnectAttachment) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InterconnectAttachment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InterconnectAttachment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectAttachment() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInterconnectAttachment[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new interconnectattachmentsModule.v1.InterconnectAttachmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectAttachmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInterconnectAttachment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_interconnect_locations_v1.ts b/test/gapic_interconnect_locations_v1.ts new file mode 100644 index 00000000..7ef29da6 --- /dev/null +++ b/test/gapic_interconnect_locations_v1.ts @@ -0,0 +1,639 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as interconnectlocationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.InterconnectLocationsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + interconnectlocationsModule.v1.InterconnectLocationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + interconnectlocationsModule.v1.InterconnectLocationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + interconnectlocationsModule.v1.InterconnectLocationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.interconnectLocationsStub, undefined); + await client.initialize(); + assert(client.interconnectLocationsStub); + }); + + it('has close method', () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + 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 interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectLocationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectLocationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInterconnectLocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectLocationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectLocationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectLocationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInterconnectLocation[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectLocationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectLocationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InterconnectLocation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InterconnectLocation) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectLocationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InterconnectLocation[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InterconnectLocation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectLocationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectLocation() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInterconnectLocation[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new interconnectlocationsModule.v1.InterconnectLocationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectLocationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInterconnectLocation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_interconnects_v1.ts b/test/gapic_interconnects_v1.ts new file mode 100644 index 00000000..52cc7284 --- /dev/null +++ b/test/gapic_interconnects_v1.ts @@ -0,0 +1,1048 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as interconnectsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.InterconnectsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = interconnectsModule.v1.InterconnectsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = interconnectsModule.v1.InterconnectsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = interconnectsModule.v1.InterconnectsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new interconnectsModule.v1.InterconnectsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.interconnectsStub, undefined); + await client.initialize(); + assert(client.interconnectsStub); + }); + + it('has close method', () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + 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 interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInterconnect | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getDiagnostics', () => { + it('invokes getDiagnostics without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiagnosticsInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse() + ); + client.innerApiCalls.getDiagnostics = stubSimpleCall(expectedResponse); + const [response] = await client.getDiagnostics(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getDiagnostics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getDiagnostics without error using callback', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiagnosticsInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InterconnectsGetDiagnosticsResponse() + ); + client.innerApiCalls.getDiagnostics = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDiagnostics( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInterconnectsGetDiagnosticsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getDiagnostics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getDiagnostics with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetDiagnosticsInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDiagnostics = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDiagnostics(request), expectedError); + assert( + (client.innerApiCalls.getDiagnostics as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchInterconnectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInterconnect[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Interconnect[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Interconnect) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Interconnect[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Interconnect) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.Interconnect() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInterconnect[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new interconnectsModule.v1.InterconnectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInterconnectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInterconnect[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_license_codes_v1.ts b/test/gapic_license_codes_v1.ts new file mode 100644 index 00000000..67725667 --- /dev/null +++ b/test/gapic_license_codes_v1.ts @@ -0,0 +1,364 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as licensecodesModule from '../src'; + +import {GoogleAuth, 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); +} + +describe('v1.LicenseCodesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = licensecodesModule.v1.LicenseCodesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = licensecodesModule.v1.LicenseCodesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = licensecodesModule.v1.LicenseCodesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new licensecodesModule.v1.LicenseCodesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.licenseCodesStub, undefined); + await client.initialize(); + assert(client.licenseCodesStub); + }); + + it('has close method', () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + 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 licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetLicenseCodeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.LicenseCode() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetLicenseCodeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.LicenseCode() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ILicenseCode | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetLicenseCodeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new licensecodesModule.v1.LicenseCodesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsLicenseCodeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); +}); diff --git a/test/gapic_licenses_v1.ts b/test/gapic_licenses_v1.ts new file mode 100644 index 00000000..75ea3285 --- /dev/null +++ b/test/gapic_licenses_v1.ts @@ -0,0 +1,1140 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as licensesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.LicensesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = licensesModule.v1.LicensesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = licensesModule.v1.LicensesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = licensesModule.v1.LicensesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new licensesModule.v1.LicensesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new licensesModule.v1.LicensesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.licensesStub, undefined); + await client.initialize(); + assert(client.licensesStub); + }); + + it('has close method', () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + 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 licensesModule.v1.LicensesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.License() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.License() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ILicense | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsLicenseRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListLicensesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new licensesModule.v1.LicensesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListLicensesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ILicense[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListLicensesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListLicensesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.License[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.License) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListLicensesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.License[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.License) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new licensesModule.v1.LicensesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListLicensesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + generateSampleMessage(new protos.google.cloud.compute.v1.License()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ILicense[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new licensesModule.v1.LicensesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListLicensesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ILicense[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_machine_types_v1.ts b/test/gapic_machine_types_v1.ts new file mode 100644 index 00000000..4b1e189f --- /dev/null +++ b/test/gapic_machine_types_v1.ts @@ -0,0 +1,684 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as machinetypesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.MachineTypesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = machinetypesModule.v1.MachineTypesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = machinetypesModule.v1.MachineTypesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = machinetypesModule.v1.MachineTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new machinetypesModule.v1.MachineTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.machineTypesStub, undefined); + await client.initialize(); + assert(client.machineTypesStub); + }); + + it('has close method', () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + 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 machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetMachineTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.MachineType() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetMachineTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.MachineType() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IMachineType | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetMachineTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.MachineTypesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.MachineTypesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.MachineTypesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IMachineTypesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IMachineTypesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IMachineType[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.MachineType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.MachineType) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.MachineType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.MachineType) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + generateSampleMessage(new protos.google.cloud.compute.v1.MachineType()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IMachineType[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new machinetypesModule.v1.MachineTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListMachineTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IMachineType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_network_endpoint_groups_v1.ts b/test/gapic_network_endpoint_groups_v1.ts new file mode 100644 index 00000000..e4151f42 --- /dev/null +++ b/test/gapic_network_endpoint_groups_v1.ts @@ -0,0 +1,1637 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as networkendpointgroupsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.NetworkEndpointGroupsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + networkendpointgroupsModule.v1.NetworkEndpointGroupsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + networkendpointgroupsModule.v1.NetworkEndpointGroupsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + networkendpointgroupsModule.v1.NetworkEndpointGroupsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.networkEndpointGroupsStub, undefined); + await client.initialize(); + assert(client.networkEndpointGroupsStub); + }); + + it('has close method', () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + 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 networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + 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('attachNetworkEndpoints', () => { + it('invokes attachNetworkEndpoints without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.attachNetworkEndpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.attachNetworkEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.attachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes attachNetworkEndpoints without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.attachNetworkEndpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.attachNetworkEndpoints( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.attachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes attachNetworkEndpoints with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AttachNetworkEndpointsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.attachNetworkEndpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.attachNetworkEndpoints(request), + expectedError + ); + assert( + (client.innerApiCalls.attachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('detachNetworkEndpoints', () => { + it('invokes detachNetworkEndpoints without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.detachNetworkEndpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.detachNetworkEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes detachNetworkEndpoints without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.detachNetworkEndpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.detachNetworkEndpoints( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.detachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes detachNetworkEndpoints with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DetachNetworkEndpointsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.detachNetworkEndpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.detachNetworkEndpoints(request), + expectedError + ); + assert( + (client.innerApiCalls.detachNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INetworkEndpointGroup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroupsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroupsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroupsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.INetworkEndpointGroupsScopedList + ] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.INetworkEndpointGroupsScopedList + ] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.INetworkEndpointGroup[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointGroup[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NetworkEndpointGroup) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointGroup[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NetworkEndpointGroup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INetworkEndpointGroup[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INetworkEndpointGroup[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNetworkEndpoints', () => { + it('invokes listNetworkEndpoints without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.innerApiCalls.listNetworkEndpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.listNetworkEndpoints(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNetworkEndpoints without error using callback', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.innerApiCalls.listNetworkEndpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNetworkEndpoints( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listNetworkEndpoints with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNetworkEndpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listNetworkEndpoints(request), expectedError); + assert( + (client.innerApiCalls.listNetworkEndpoints as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNetworkEndpointsStream without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.descriptors.page.listNetworkEndpoints.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNetworkEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus + ) => { + 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.listNetworkEndpoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNetworkEndpoints, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listNetworkEndpointsStream with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listNetworkEndpoints.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNetworkEndpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listNetworkEndpoints.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNetworkEndpoints, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNetworkEndpoints without error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointWithHealthStatus() + ), + ]; + client.descriptors.page.listNetworkEndpoints.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[] = + []; + const iterable = client.listNetworkEndpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNetworkEndpoints with error', async () => { + const client = + new networkendpointgroupsModule.v1.NetworkEndpointGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworkEndpointsNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listNetworkEndpoints.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNetworkEndpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INetworkEndpointWithHealthStatus[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listNetworkEndpoints.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_networks_v1.ts b/test/gapic_networks_v1.ts new file mode 100644 index 00000000..268d47d6 --- /dev/null +++ b/test/gapic_networks_v1.ts @@ -0,0 +1,1784 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as networksModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.NetworksClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = networksModule.v1.NetworksClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = networksModule.v1.NetworksClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = networksModule.v1.NetworksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new networksModule.v1.NetworksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new networksModule.v1.NetworksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.networksStub, undefined); + await client.initialize(); + assert(client.networksStub); + }); + + it('has close method', () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + 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 networksModule.v1.NetworksClient({ + auth: googleAuth, + 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('addPeering', () => { + it('invokes addPeering without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddPeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addPeering = stubSimpleCall(expectedResponse); + const [response] = await client.addPeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addPeering without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddPeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addPeering = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addPeering( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addPeering with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddPeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addPeering = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addPeering(request), expectedError); + assert( + (client.innerApiCalls.addPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Network() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Network() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INetwork | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getEffectiveFirewalls', () => { + it('invokes getEffectiveFirewalls without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse() + ); + client.innerApiCalls.getEffectiveFirewalls = + stubSimpleCall(expectedResponse); + const [response] = await client.getEffectiveFirewalls(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getEffectiveFirewalls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getEffectiveFirewalls without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponse() + ); + client.innerApiCalls.getEffectiveFirewalls = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getEffectiveFirewalls( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INetworksGetEffectiveFirewallsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getEffectiveFirewalls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getEffectiveFirewalls with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetEffectiveFirewallsNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getEffectiveFirewalls = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getEffectiveFirewalls(request), + expectedError + ); + assert( + (client.innerApiCalls.getEffectiveFirewalls as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removePeering', () => { + it('invokes removePeering without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemovePeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removePeering = stubSimpleCall(expectedResponse); + const [response] = await client.removePeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removePeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removePeering without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemovePeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removePeering = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removePeering( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removePeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removePeering with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemovePeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removePeering = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removePeering(request), expectedError); + assert( + (client.innerApiCalls.removePeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('switchToCustomMode', () => { + it('invokes switchToCustomMode without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SwitchToCustomModeNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.switchToCustomMode = + stubSimpleCall(expectedResponse); + const [response] = await client.switchToCustomMode(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.switchToCustomMode as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes switchToCustomMode without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SwitchToCustomModeNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.switchToCustomMode = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.switchToCustomMode( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.switchToCustomMode as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes switchToCustomMode with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SwitchToCustomModeNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.switchToCustomMode = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.switchToCustomMode(request), expectedError); + assert( + (client.innerApiCalls.switchToCustomMode as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updatePeering', () => { + it('invokes updatePeering without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updatePeering = stubSimpleCall(expectedResponse); + const [response] = await client.updatePeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updatePeering without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updatePeering = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePeering( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updatePeering with error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePeeringNetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePeering = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updatePeering(request), expectedError); + assert( + (client.innerApiCalls.updatePeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INetwork[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Network[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Network) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Network[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Network) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + generateSampleMessage(new protos.google.cloud.compute.v1.Network()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INetwork[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INetwork[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listPeeringRoutes', () => { + it('invokes listPeeringRoutes without error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + ]; + client.innerApiCalls.listPeeringRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.listPeeringRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPeeringRoutes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPeeringRoutes without error using callback', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + ]; + client.innerApiCalls.listPeeringRoutes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPeeringRoutes( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IExchangedPeeringRoute[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPeeringRoutes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listPeeringRoutes with error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listPeeringRoutes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPeeringRoutes(request), expectedError); + assert( + (client.innerApiCalls.listPeeringRoutes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPeeringRoutesStream without error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + ]; + client.descriptors.page.listPeeringRoutes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPeeringRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ExchangedPeeringRoute[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ExchangedPeeringRoute) => { + 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.listPeeringRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPeeringRoutes, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listPeeringRoutes.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listPeeringRoutesStream with error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listPeeringRoutes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPeeringRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ExchangedPeeringRoute[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ExchangedPeeringRoute) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPeeringRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPeeringRoutes, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listPeeringRoutes.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPeeringRoutes without error', async () => { + const client = new networksModule.v1.NetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ExchangedPeeringRoute() + ), + ]; + client.descriptors.page.listPeeringRoutes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IExchangedPeeringRoute[] = + []; + const iterable = client.listPeeringRoutesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPeeringRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listPeeringRoutes.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPeeringRoutes with error', async () => { + const client = new networksModule.v1.NetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPeeringRoutesNetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listPeeringRoutes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPeeringRoutesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IExchangedPeeringRoute[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPeeringRoutes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listPeeringRoutes.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_node_groups_v1.ts b/test/gapic_node_groups_v1.ts new file mode 100644 index 00000000..e68749e5 --- /dev/null +++ b/test/gapic_node_groups_v1.ts @@ -0,0 +1,1971 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as nodegroupsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.NodeGroupsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = nodegroupsModule.v1.NodeGroupsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = nodegroupsModule.v1.NodeGroupsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = nodegroupsModule.v1.NodeGroupsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new nodegroupsModule.v1.NodeGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.nodeGroupsStub, undefined); + await client.initialize(); + assert(client.nodeGroupsStub); + }); + + it('has close method', () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + 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 nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + 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('addNodes', () => { + it('invokes addNodes without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddNodesNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addNodes = stubSimpleCall(expectedResponse); + const [response] = await client.addNodes(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addNodes without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddNodesNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addNodes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addNodes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addNodes with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddNodesNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addNodes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addNodes(request), expectedError); + assert( + (client.innerApiCalls.addNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteNodes', () => { + it('invokes deleteNodes without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodesNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteNodes = stubSimpleCall(expectedResponse); + const [response] = await client.deleteNodes(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteNodes without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodesNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteNodes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNodes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteNodes with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodesNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNodes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteNodes(request), expectedError); + assert( + (client.innerApiCalls.deleteNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroup() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroup() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INodeGroup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setNodeTemplate', () => { + it('invokes setNodeTemplate without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setNodeTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.setNodeTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setNodeTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setNodeTemplate without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setNodeTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNodeTemplate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setNodeTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setNodeTemplate with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNodeTemplateNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setNodeTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setNodeTemplate(request), expectedError); + assert( + (client.innerApiCalls.setNodeTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNodeGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.INodeGroupsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.INodeGroupsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INodeGroup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeGroup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeGroup) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeGroup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeGroup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeGroup()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INodeGroup[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INodeGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNodes', () => { + it('invokes listNodes without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodesNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + ]; + client.innerApiCalls.listNodes = stubSimpleCall(expectedResponse); + const [response] = await client.listNodes(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNodes without error using callback', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodesNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + ]; + client.innerApiCalls.listNodes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNodes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INodeGroupNode[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listNodes with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodesNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNodes = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNodes(request), expectedError); + assert( + (client.innerApiCalls.listNodes as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listNodesStream without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodesNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + ]; + client.descriptors.page.listNodes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNodesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeGroupNode[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeGroupNode) => { + 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.listNodes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNodes, request) + ); + assert.strictEqual( + (client.descriptors.page.listNodes.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listNodesStream with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodesNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listNodes.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listNodesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeGroupNode[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeGroupNode) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listNodes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNodes, request) + ); + assert.strictEqual( + (client.descriptors.page.listNodes.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNodes without error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodesNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeGroupNode() + ), + ]; + client.descriptors.page.listNodes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INodeGroupNode[] = []; + const iterable = client.listNodesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNodes.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listNodes.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNodes with error', async () => { + const client = new nodegroupsModule.v1.NodeGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodesNodeGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listNodes.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listNodesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INodeGroupNode[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNodes.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listNodes.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_node_templates_v1.ts b/test/gapic_node_templates_v1.ts new file mode 100644 index 00000000..75809885 --- /dev/null +++ b/test/gapic_node_templates_v1.ts @@ -0,0 +1,1258 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as nodetemplatesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.NodeTemplatesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = nodetemplatesModule.v1.NodeTemplatesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = nodetemplatesModule.v1.NodeTemplatesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = nodetemplatesModule.v1.NodeTemplatesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.nodeTemplatesStub, undefined); + await client.initialize(); + assert(client.nodeTemplatesStub); + }); + + it('has close method', () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + 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 nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INodeTemplate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsNodeTemplateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplatesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplatesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplatesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.INodeTemplatesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.INodeTemplatesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INodeTemplate[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeTemplate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeTemplate) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeTemplate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeTemplate) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTemplate() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INodeTemplate[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new nodetemplatesModule.v1.NodeTemplatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTemplatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INodeTemplate[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_node_types_v1.ts b/test/gapic_node_types_v1.ts new file mode 100644 index 00000000..182af290 --- /dev/null +++ b/test/gapic_node_types_v1.ts @@ -0,0 +1,684 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as nodetypesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.NodeTypesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = nodetypesModule.v1.NodeTypesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = nodetypesModule.v1.NodeTypesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = nodetypesModule.v1.NodeTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new nodetypesModule.v1.NodeTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.nodeTypesStub, undefined); + await client.initialize(); + assert(client.nodeTypesStub); + }); + + it('has close method', () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + 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 nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NodeType() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NodeType() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INodeType | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNodeTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTypesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTypesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.NodeTypesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.INodeTypesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.INodeTypesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INodeType[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeType) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NodeType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NodeType) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + generateSampleMessage(new protos.google.cloud.compute.v1.NodeType()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INodeType[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new nodetypesModule.v1.NodeTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListNodeTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INodeType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_packet_mirrorings_v1.ts b/test/gapic_packet_mirrorings_v1.ts new file mode 100644 index 00000000..ebee70a3 --- /dev/null +++ b/test/gapic_packet_mirrorings_v1.ts @@ -0,0 +1,1145 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as packetmirroringsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.PacketMirroringsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + packetmirroringsModule.v1.PacketMirroringsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + packetmirroringsModule.v1.PacketMirroringsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = packetmirroringsModule.v1.PacketMirroringsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.packetMirroringsStub, undefined); + await client.initialize(); + assert(client.packetMirroringsStub); + }); + + it('has close method', () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + 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 packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPacketMirroring | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsPacketMirroringRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroringsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroringsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroringsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IPacketMirroringsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IPacketMirroringsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPacketMirroring[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PacketMirroring[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PacketMirroring) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PacketMirroring[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PacketMirroring) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PacketMirroring() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IPacketMirroring[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new packetmirroringsModule.v1.PacketMirroringsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPacketMirroringsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IPacketMirroring[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_projects_v1.ts b/test/gapic_projects_v1.ts new file mode 100644 index 00000000..c13c6a71 --- /dev/null +++ b/test/gapic_projects_v1.ts @@ -0,0 +1,2020 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as projectsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ProjectsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = projectsModule.v1.ProjectsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = projectsModule.v1.ProjectsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = projectsModule.v1.ProjectsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new projectsModule.v1.ProjectsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new projectsModule.v1.ProjectsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.projectsStub, undefined); + await client.initialize(); + assert(client.projectsStub); + }); + + it('has close method', () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + 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.v1.ProjectsClient({ + auth: googleAuth, + 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('disableXpnHost', () => { + it('invokes disableXpnHost without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DisableXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.disableXpnHost = stubSimpleCall(expectedResponse); + const [response] = await client.disableXpnHost(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.disableXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes disableXpnHost without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DisableXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.disableXpnHost = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableXpnHost( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.disableXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes disableXpnHost with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DisableXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.disableXpnHost = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.disableXpnHost(request), expectedError); + assert( + (client.innerApiCalls.disableXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('disableXpnResource', () => { + it('invokes disableXpnResource without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DisableXpnResourceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.disableXpnResource = + stubSimpleCall(expectedResponse); + const [response] = await client.disableXpnResource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.disableXpnResource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes disableXpnResource without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DisableXpnResourceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.disableXpnResource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.disableXpnResource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.disableXpnResource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes disableXpnResource with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DisableXpnResourceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.disableXpnResource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.disableXpnResource(request), expectedError); + assert( + (client.innerApiCalls.disableXpnResource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('enableXpnHost', () => { + it('invokes enableXpnHost without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.EnableXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.enableXpnHost = stubSimpleCall(expectedResponse); + const [response] = await client.enableXpnHost(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.enableXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes enableXpnHost without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.EnableXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.enableXpnHost = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableXpnHost( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.enableXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes enableXpnHost with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.EnableXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.enableXpnHost = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.enableXpnHost(request), expectedError); + assert( + (client.innerApiCalls.enableXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('enableXpnResource', () => { + it('invokes enableXpnResource without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.EnableXpnResourceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.enableXpnResource = stubSimpleCall(expectedResponse); + const [response] = await client.enableXpnResource(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.enableXpnResource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes enableXpnResource without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.EnableXpnResourceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.enableXpnResource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.enableXpnResource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.enableXpnResource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes enableXpnResource with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.EnableXpnResourceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.enableXpnResource = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.enableXpnResource(request), expectedError); + assert( + (client.innerApiCalls.enableXpnResource as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Project() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Project() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IProject | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getXpnHost', () => { + it('invokes getXpnHost without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Project() + ); + client.innerApiCalls.getXpnHost = stubSimpleCall(expectedResponse); + const [response] = await client.getXpnHost(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getXpnHost without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Project() + ); + client.innerApiCalls.getXpnHost = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getXpnHost( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IProject | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getXpnHost with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnHostProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getXpnHost = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getXpnHost(request), expectedError); + assert( + (client.innerApiCalls.getXpnHost as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('moveDisk', () => { + it('invokes moveDisk without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveDiskProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.moveDisk = stubSimpleCall(expectedResponse); + const [response] = await client.moveDisk(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.moveDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes moveDisk without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveDiskProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.moveDisk = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveDisk( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.moveDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes moveDisk with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveDiskProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.moveDisk = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.moveDisk(request), expectedError); + assert( + (client.innerApiCalls.moveDisk as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('moveInstance', () => { + it('invokes moveInstance without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveInstanceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.moveInstance = stubSimpleCall(expectedResponse); + const [response] = await client.moveInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes moveInstance without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveInstanceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.moveInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.moveInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes moveInstance with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.MoveInstanceProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.moveInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.moveInstance(request), expectedError); + assert( + (client.innerApiCalls.moveInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setCommonInstanceMetadata', () => { + it('invokes setCommonInstanceMetadata without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setCommonInstanceMetadata = + stubSimpleCall(expectedResponse); + const [response] = await client.setCommonInstanceMetadata(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setCommonInstanceMetadata as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setCommonInstanceMetadata without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setCommonInstanceMetadata = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setCommonInstanceMetadata( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setCommonInstanceMetadata as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setCommonInstanceMetadata with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetCommonInstanceMetadataProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setCommonInstanceMetadata = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.setCommonInstanceMetadata(request), + expectedError + ); + assert( + (client.innerApiCalls.setCommonInstanceMetadata as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setDefaultNetworkTier', () => { + it('invokes setDefaultNetworkTier without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setDefaultNetworkTier = + stubSimpleCall(expectedResponse); + const [response] = await client.setDefaultNetworkTier(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setDefaultNetworkTier as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setDefaultNetworkTier without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setDefaultNetworkTier = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setDefaultNetworkTier( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setDefaultNetworkTier as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setDefaultNetworkTier with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetDefaultNetworkTierProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setDefaultNetworkTier = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.setDefaultNetworkTier(request), + expectedError + ); + assert( + (client.innerApiCalls.setDefaultNetworkTier as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setUsageExportBucket', () => { + it('invokes setUsageExportBucket without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUsageExportBucketProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUsageExportBucket = + stubSimpleCall(expectedResponse); + const [response] = await client.setUsageExportBucket(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUsageExportBucket as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setUsageExportBucket without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUsageExportBucketProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUsageExportBucket = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setUsageExportBucket( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUsageExportBucket as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setUsageExportBucket with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUsageExportBucketProjectRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setUsageExportBucket = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setUsageExportBucket(request), expectedError); + assert( + (client.innerApiCalls.setUsageExportBucket as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getXpnResources', () => { + it('invokes getXpnResources without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnResourcesProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + ]; + client.innerApiCalls.getXpnResources = stubSimpleCall(expectedResponse); + const [response] = await client.getXpnResources(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getXpnResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getXpnResources without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnResourcesProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + ]; + client.innerApiCalls.getXpnResources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getXpnResources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IXpnResourceId[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getXpnResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getXpnResources with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnResourcesProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getXpnResources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getXpnResources(request), expectedError); + assert( + (client.innerApiCalls.getXpnResources as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getXpnResourcesStream without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnResourcesProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + ]; + client.descriptors.page.getXpnResources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.getXpnResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.XpnResourceId[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.XpnResourceId) => { + 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.getXpnResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.getXpnResources, request) + ); + assert.strictEqual( + ( + client.descriptors.page.getXpnResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes getXpnResourcesStream with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnResourcesProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.getXpnResources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.getXpnResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.XpnResourceId[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.XpnResourceId) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.getXpnResources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.getXpnResources, request) + ); + assert.strictEqual( + ( + client.descriptors.page.getXpnResources.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with getXpnResources without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnResourcesProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.XpnResourceId() + ), + ]; + client.descriptors.page.getXpnResources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IXpnResourceId[] = []; + const iterable = client.getXpnResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.getXpnResources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.getXpnResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with getXpnResources with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetXpnResourcesProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.getXpnResources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.getXpnResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IXpnResourceId[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.getXpnResources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.getXpnResources.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listXpnHosts', () => { + it('invokes listXpnHosts without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListXpnHostsProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + ]; + client.innerApiCalls.listXpnHosts = stubSimpleCall(expectedResponse); + const [response] = await client.listXpnHosts(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listXpnHosts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listXpnHosts without error using callback', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListXpnHostsProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + ]; + client.innerApiCalls.listXpnHosts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listXpnHosts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IProject[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listXpnHosts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listXpnHosts with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListXpnHostsProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listXpnHosts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listXpnHosts(request), expectedError); + assert( + (client.innerApiCalls.listXpnHosts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listXpnHostsStream without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListXpnHostsProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + ]; + client.descriptors.page.listXpnHosts.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listXpnHostsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Project[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.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.listXpnHosts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listXpnHosts, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listXpnHosts.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listXpnHostsStream with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListXpnHostsProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listXpnHosts.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listXpnHostsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Project[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.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.listXpnHosts.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listXpnHosts, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listXpnHosts.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listXpnHosts without error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListXpnHostsProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + generateSampleMessage(new protos.google.cloud.compute.v1.Project()), + ]; + client.descriptors.page.listXpnHosts.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IProject[] = []; + const iterable = client.listXpnHostsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listXpnHosts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listXpnHosts.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listXpnHosts with error', async () => { + const client = new projectsModule.v1.ProjectsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListXpnHostsProjectsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listXpnHosts.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listXpnHostsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IProject[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listXpnHosts.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listXpnHosts.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_public_advertised_prefixes_v1.ts b/test/gapic_public_advertised_prefixes_v1.ts new file mode 100644 index 00000000..a9e37e52 --- /dev/null +++ b/test/gapic_public_advertised_prefixes_v1.ts @@ -0,0 +1,973 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as publicadvertisedprefixesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.PublicAdvertisedPrefixesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.publicAdvertisedPrefixesStub, undefined); + await client.initialize(); + assert(client.publicAdvertisedPrefixesStub); + }); + + it('has close method', () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + 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 publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPublicAdvertisedPrefix | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPublicAdvertisedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IPublicAdvertisedPrefix[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PublicAdvertisedPrefix[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PublicAdvertisedPrefix) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PublicAdvertisedPrefix[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PublicAdvertisedPrefix) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicAdvertisedPrefix() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IPublicAdvertisedPrefix[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new publicadvertisedprefixesModule.v1.PublicAdvertisedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicAdvertisedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IPublicAdvertisedPrefix[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_public_delegated_prefixes_v1.ts b/test/gapic_public_delegated_prefixes_v1.ts new file mode 100644 index 00000000..3b9aa15c --- /dev/null +++ b/test/gapic_public_delegated_prefixes_v1.ts @@ -0,0 +1,1075 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as publicdelegatedprefixesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.PublicDelegatedPrefixesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.publicDelegatedPrefixesStub, undefined); + await client.initialize(); + assert(client.publicDelegatedPrefixesStub); + }); + + it('has close method', () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + 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 publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPublicDelegatedPrefix | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPublicDelegatedPrefixeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefixesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList + ] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [ + string, + protos.google.cloud.compute.v1.IPublicDelegatedPrefixesScopedList + ] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IPublicDelegatedPrefix[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PublicDelegatedPrefix[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PublicDelegatedPrefix) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PublicDelegatedPrefix[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PublicDelegatedPrefix) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PublicDelegatedPrefix() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IPublicDelegatedPrefix[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new publicdelegatedprefixesModule.v1.PublicDelegatedPrefixesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPublicDelegatedPrefixesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IPublicDelegatedPrefix[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_autoscalers_v1.ts b/test/gapic_region_autoscalers_v1.ts new file mode 100644 index 00000000..4f58c717 --- /dev/null +++ b/test/gapic_region_autoscalers_v1.ts @@ -0,0 +1,1023 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionautoscalersModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionAutoscalersClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionautoscalersModule.v1.RegionAutoscalersClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionautoscalersModule.v1.RegionAutoscalersClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regionautoscalersModule.v1.RegionAutoscalersClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionAutoscalersStub, undefined); + await client.initialize(); + assert(client.regionAutoscalersStub); + }); + + it('has close method', () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + 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 regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Autoscaler() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Autoscaler() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAutoscaler | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionAutoscalerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IAutoscaler[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Autoscaler[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Autoscaler) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Autoscaler[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Autoscaler) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + generateSampleMessage(new protos.google.cloud.compute.v1.Autoscaler()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IAutoscaler[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regionautoscalersModule.v1.RegionAutoscalersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionAutoscalersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IAutoscaler[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_backend_services_v1.ts b/test/gapic_region_backend_services_v1.ts new file mode 100644 index 00000000..eb3dbe93 --- /dev/null +++ b/test/gapic_region_backend_services_v1.ts @@ -0,0 +1,1187 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionbackendservicesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionBackendServicesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionbackendservicesModule.v1.RegionBackendServicesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionbackendservicesModule.v1.RegionBackendServicesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regionbackendservicesModule.v1.RegionBackendServicesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionBackendServicesStub, undefined); + await client.initialize(); + assert(client.regionBackendServicesStub); + }); + + it('has close method', () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + 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 regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendService | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getHealth', () => { + it('invokes getHealth without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendServiceGroupHealth() + ); + client.innerApiCalls.getHealth = stubSimpleCall(expectedResponse); + const [response] = await client.getHealth(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getHealth without error using callback', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.BackendServiceGroupHealth() + ); + client.innerApiCalls.getHealth = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHealth( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendServiceGroupHealth | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getHealth with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getHealth = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHealth(request), expectedError); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionBackendServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IBackendService[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.BackendService[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.BackendService) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.BackendService[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.BackendService) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.BackendService() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IBackendService[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regionbackendservicesModule.v1.RegionBackendServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionBackendServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IBackendService[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_commitments_v1.ts b/test/gapic_region_commitments_v1.ts new file mode 100644 index 00000000..715a551e --- /dev/null +++ b/test/gapic_region_commitments_v1.ts @@ -0,0 +1,794 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regioncommitmentsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionCommitmentsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regioncommitmentsModule.v1.RegionCommitmentsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regioncommitmentsModule.v1.RegionCommitmentsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regioncommitmentsModule.v1.RegionCommitmentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionCommitmentsStub, undefined); + await client.initialize(); + assert(client.regionCommitmentsStub); + }); + + it('has close method', () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + 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 regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionCommitmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Commitment() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionCommitmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Commitment() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ICommitment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionCommitmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionCommitmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionCommitmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionCommitmentRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.CommitmentsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.CommitmentsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.CommitmentsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ICommitmentsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ICommitmentsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ICommitment[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Commitment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Commitment) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Commitment[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Commitment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + generateSampleMessage(new protos.google.cloud.compute.v1.Commitment()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ICommitment[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regioncommitmentsModule.v1.RegionCommitmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionCommitmentsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ICommitment[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_disk_types_v1.ts b/test/gapic_region_disk_types_v1.ts new file mode 100644 index 00000000..2e4c1f66 --- /dev/null +++ b/test/gapic_region_disk_types_v1.ts @@ -0,0 +1,592 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regiondisktypesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionDiskTypesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regiondisktypesModule.v1.RegionDiskTypesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regiondisktypesModule.v1.RegionDiskTypesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regiondisktypesModule.v1.RegionDiskTypesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionDiskTypesStub, undefined); + await client.initialize(); + assert(client.regionDiskTypesStub); + }); + + it('has close method', () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + 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 regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionDiskTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DiskType() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionDiskTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DiskType() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDiskType | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionDiskTypeRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDiskType[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.DiskType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.DiskType) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.DiskType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.DiskType) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + generateSampleMessage(new protos.google.cloud.compute.v1.DiskType()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IDiskType[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regiondisktypesModule.v1.RegionDiskTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDiskTypesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IDiskType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_disks_v1.ts b/test/gapic_region_disks_v1.ts new file mode 100644 index 00000000..41a5f7ee --- /dev/null +++ b/test/gapic_region_disks_v1.ts @@ -0,0 +1,1688 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regiondisksModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionDisksClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = regiondisksModule.v1.RegionDisksClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = regiondisksModule.v1.RegionDisksClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regiondisksModule.v1.RegionDisksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regiondisksModule.v1.RegionDisksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionDisksStub, undefined); + await client.initialize(); + assert(client.regionDisksStub); + }); + + it('has close method', () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + 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 regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + 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('addResourcePolicies', () => { + it('invokes addResourcePolicies without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addResourcePolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.addResourcePolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addResourcePolicies without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addResourcePolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addResourcePolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addResourcePolicies with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddResourcePoliciesRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addResourcePolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addResourcePolicies(request), expectedError); + assert( + (client.innerApiCalls.addResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createSnapshot', () => { + it('invokes createSnapshot without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateSnapshotRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.createSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createSnapshot without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateSnapshotRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createSnapshot with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateSnapshotRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createSnapshot(request), expectedError); + assert( + (client.innerApiCalls.createSnapshot as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Disk() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Disk() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDisk | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeResourcePolicies', () => { + it('invokes removeResourcePolicies without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeResourcePolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.removeResourcePolicies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeResourcePolicies without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeResourcePolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeResourcePolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeResourcePolicies with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveResourcePoliciesRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeResourcePolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.removeResourcePolicies(request), + expectedError + ); + assert( + (client.innerApiCalls.removeResourcePolicies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('resize', () => { + it('invokes resize without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = stubSimpleCall(expectedResponse); + const [response] = await client.resize(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes resize without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resize( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes resize with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resize(request), expectedError); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsRegionDiskRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDisk[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Disk[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Disk) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Disk[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Disk) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + generateSampleMessage(new protos.google.cloud.compute.v1.Disk()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IDisk[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regiondisksModule.v1.RegionDisksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionDisksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IDisk[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_health_check_services_v1.ts b/test/gapic_region_health_check_services_v1.ts new file mode 100644 index 00000000..7939c40b --- /dev/null +++ b/test/gapic_region_health_check_services_v1.ts @@ -0,0 +1,971 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionhealthcheckservicesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionHealthCheckServicesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionHealthCheckServicesStub, undefined); + await client.initialize(); + assert(client.regionHealthCheckServicesStub); + }); + + it('has close method', () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + 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 regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IHealthCheckService | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionHealthCheckServiceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IHealthCheckService[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.HealthCheckService[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.HealthCheckService) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.HealthCheckService[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.HealthCheckService) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheckService() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IHealthCheckService[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regionhealthcheckservicesModule.v1.RegionHealthCheckServicesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthCheckServicesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IHealthCheckService[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_health_checks_v1.ts b/test/gapic_region_health_checks_v1.ts new file mode 100644 index 00000000..fbbe2500 --- /dev/null +++ b/test/gapic_region_health_checks_v1.ts @@ -0,0 +1,1023 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionhealthchecksModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionHealthChecksClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionhealthchecksModule.v1.RegionHealthChecksClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionhealthchecksModule.v1.RegionHealthChecksClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regionhealthchecksModule.v1.RegionHealthChecksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionHealthChecksStub, undefined); + await client.initialize(); + assert(client.regionHealthChecksStub); + }); + + it('has close method', () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + 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 regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheck() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.HealthCheck() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IHealthCheck | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionHealthCheckRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IHealthCheck[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.HealthCheck[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.HealthCheck) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.HealthCheck[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.HealthCheck) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + generateSampleMessage(new protos.google.cloud.compute.v1.HealthCheck()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IHealthCheck[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regionhealthchecksModule.v1.RegionHealthChecksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionHealthChecksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IHealthCheck[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_instance_group_managers_v1.ts b/test/gapic_region_instance_group_managers_v1.ts new file mode 100644 index 00000000..11853e41 --- /dev/null +++ b/test/gapic_region_instance_group_managers_v1.ts @@ -0,0 +1,3368 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regioninstancegroupmanagersModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionInstanceGroupManagersClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + assert.strictEqual(client.regionInstanceGroupManagersStub, undefined); + await client.initialize(); + assert(client.regionInstanceGroupManagersStub); + }); + + it('has close method', () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + 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 regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + 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('abandonInstances', () => { + it('invokes abandonInstances without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.abandonInstances = stubSimpleCall(expectedResponse); + const [response] = await client.abandonInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.abandonInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes abandonInstances without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.abandonInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.abandonInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.abandonInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes abandonInstances with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AbandonInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.abandonInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.abandonInstances(request), expectedError); + assert( + (client.innerApiCalls.abandonInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('applyUpdatesToInstances', () => { + it('invokes applyUpdatesToInstances without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.applyUpdatesToInstances = + stubSimpleCall(expectedResponse); + const [response] = await client.applyUpdatesToInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyUpdatesToInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes applyUpdatesToInstances without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.applyUpdatesToInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.applyUpdatesToInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.applyUpdatesToInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes applyUpdatesToInstances with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ApplyUpdatesToInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.applyUpdatesToInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.applyUpdatesToInstances(request), + expectedError + ); + assert( + (client.innerApiCalls.applyUpdatesToInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createInstances', () => { + it('invokes createInstances without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createInstances = stubSimpleCall(expectedResponse); + const [response] = await client.createInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createInstances without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.createInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createInstances with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.CreateInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstances(request), expectedError); + assert( + (client.innerApiCalls.createInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteInstances', () => { + it('invokes deleteInstances without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteInstances = stubSimpleCall(expectedResponse); + const [response] = await client.deleteInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteInstances without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deleteInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteInstances with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstances(request), expectedError); + assert( + (client.innerApiCalls.deleteInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deletePerInstanceConfigs', () => { + it('invokes deletePerInstanceConfigs without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deletePerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.deletePerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deletePerInstanceConfigs without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.deletePerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deletePerInstanceConfigs with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deletePerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.deletePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceGroupManager | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patchPerInstanceConfigs', () => { + it('invokes patchPerInstanceConfigs without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchPerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.patchPerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patchPerInstanceConfigs without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchPerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchPerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patchPerInstanceConfigs with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patchPerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.patchPerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.patchPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('recreateInstances', () => { + it('invokes recreateInstances without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.recreateInstances = stubSimpleCall(expectedResponse); + const [response] = await client.recreateInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.recreateInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes recreateInstances without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.recreateInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.recreateInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.recreateInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes recreateInstances with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RecreateInstancesRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.recreateInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.recreateInstances(request), expectedError); + assert( + (client.innerApiCalls.recreateInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('resize', () => { + it('invokes resize without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = stubSimpleCall(expectedResponse); + const [response] = await client.resize(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes resize without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resize( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes resize with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resize(request), expectedError); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setInstanceTemplate', () => { + it('invokes setInstanceTemplate without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setInstanceTemplate = + stubSimpleCall(expectedResponse); + const [response] = await client.setInstanceTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setInstanceTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setInstanceTemplate without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setInstanceTemplate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setInstanceTemplate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setInstanceTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setInstanceTemplate with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetInstanceTemplateRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setInstanceTemplate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setInstanceTemplate(request), expectedError); + assert( + (client.innerApiCalls.setInstanceTemplate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setTargetPools', () => { + it('invokes setTargetPools without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTargetPools = stubSimpleCall(expectedResponse); + const [response] = await client.setTargetPools(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTargetPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setTargetPools without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setTargetPools = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setTargetPools( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setTargetPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setTargetPools with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetTargetPoolsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setTargetPools = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setTargetPools(request), expectedError); + assert( + (client.innerApiCalls.setTargetPools as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updatePerInstanceConfigs', () => { + it('invokes updatePerInstanceConfigs without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updatePerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.updatePerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updatePerInstanceConfigs without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.updatePerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updatePerInstanceConfigs with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updatePerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.updatePerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInstanceGroupManager[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroupManager[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroupManager) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroupManager[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroupManager) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroupManager() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceGroupManager[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstanceGroupManager[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listErrors', () => { + it('invokes listErrors without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.innerApiCalls.listErrors = stubSimpleCall(expectedResponse); + const [response] = await client.listErrors(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listErrors as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listErrors without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.innerApiCalls.listErrors = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listErrors( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInstanceManagedByIgmError[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listErrors as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listErrors with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listErrors = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listErrors(request), expectedError); + assert( + (client.innerApiCalls.listErrors as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listErrorsStream without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.descriptors.page.listErrors.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listErrorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceManagedByIgmError[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.InstanceManagedByIgmError + ) => { + 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.listErrors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listErrors, request) + ); + assert.strictEqual( + (client.descriptors.page.listErrors.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listErrorsStream with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listErrors.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listErrorsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceManagedByIgmError[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.compute.v1.InstanceManagedByIgmError + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listErrors.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listErrors, request) + ); + assert.strictEqual( + (client.descriptors.page.listErrors.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listErrors without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceManagedByIgmError() + ), + ]; + client.descriptors.page.listErrors.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceManagedByIgmError[] = + []; + const iterable = client.listErrorsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listErrors with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListErrorsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listErrors.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listErrorsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstanceManagedByIgmError[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listErrors.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listManagedInstances', () => { + it('invokes listManagedInstances without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.innerApiCalls.listManagedInstances = + stubSimpleCall(expectedResponse); + const [response] = await client.listManagedInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listManagedInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listManagedInstances without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.innerApiCalls.listManagedInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listManagedInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IManagedInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listManagedInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listManagedInstances with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listManagedInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listManagedInstances(request), expectedError); + assert( + (client.innerApiCalls.listManagedInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listManagedInstancesStream without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.descriptors.page.listManagedInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listManagedInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ManagedInstance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ManagedInstance) => { + 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.listManagedInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listManagedInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listManagedInstancesStream with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listManagedInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listManagedInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ManagedInstance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ManagedInstance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listManagedInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listManagedInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listManagedInstances without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ManagedInstance() + ), + ]; + client.descriptors.page.listManagedInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IManagedInstance[] = []; + const iterable = client.listManagedInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listManagedInstances with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListManagedInstancesRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listManagedInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listManagedInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IManagedInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listManagedInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listPerInstanceConfigs', () => { + it('invokes listPerInstanceConfigs without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.innerApiCalls.listPerInstanceConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listPerInstanceConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPerInstanceConfigs without error using callback', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.innerApiCalls.listPerInstanceConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPerInstanceConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPerInstanceConfig[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listPerInstanceConfigs with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listPerInstanceConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listPerInstanceConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.listPerInstanceConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPerInstanceConfigsStream without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.descriptors.page.listPerInstanceConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPerInstanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PerInstanceConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PerInstanceConfig) => { + 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.listPerInstanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPerInstanceConfigs, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listPerInstanceConfigsStream with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listPerInstanceConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPerInstanceConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.PerInstanceConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.PerInstanceConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listPerInstanceConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listPerInstanceConfigs, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPerInstanceConfigs without error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.PerInstanceConfig() + ), + ]; + client.descriptors.page.listPerInstanceConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IPerInstanceConfig[] = []; + const iterable = client.listPerInstanceConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listPerInstanceConfigs with error', async () => { + const client = + new regioninstancegroupmanagersModule.v1.RegionInstanceGroupManagersClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPerInstanceConfigsRegionInstanceGroupManagersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listPerInstanceConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPerInstanceConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IPerInstanceConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listPerInstanceConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_instance_groups_v1.ts b/test/gapic_region_instance_groups_v1.ts new file mode 100644 index 00000000..f5606362 --- /dev/null +++ b/test/gapic_region_instance_groups_v1.ts @@ -0,0 +1,1069 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regioninstancegroupsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionInstanceGroupsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regioninstancegroupsModule.v1.RegionInstanceGroupsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regioninstancegroupsModule.v1.RegionInstanceGroupsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regioninstancegroupsModule.v1.RegionInstanceGroupsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regioninstancegroupsModule.v1.RegionInstanceGroupsClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regioninstancegroupsModule.v1.RegionInstanceGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + assert.strictEqual(client.regionInstanceGroupsStub, undefined); + await client.initialize(); + assert(client.regionInstanceGroupsStub); + }); + + it('has close method', () => { + const client = new regioninstancegroupsModule.v1.RegionInstanceGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regioninstancegroupsModule.v1.RegionInstanceGroupsClient( + { + auth: googleAuth, + 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 regioninstancegroupsModule.v1.RegionInstanceGroupsClient( + { + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceGroup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setNamedPorts', () => { + it('invokes setNamedPorts without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setNamedPorts = stubSimpleCall(expectedResponse); + const [response] = await client.setNamedPorts(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setNamedPorts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setNamedPorts without error using callback', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setNamedPorts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setNamedPorts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setNamedPorts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setNamedPorts with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetNamedPortsRegionInstanceGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setNamedPorts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setNamedPorts(request), expectedError); + assert( + (client.innerApiCalls.setNamedPorts as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IInstanceGroup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroup) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceGroup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceGroup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceGroup() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceGroup[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IInstanceGroup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listInstances without error using callback', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IInstanceWithNamedPorts[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listInstances with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listInstancesStream without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.InstanceWithNamedPorts[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceWithNamedPorts) => { + 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.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + 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.compute.v1.InstanceWithNamedPorts[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.InstanceWithNamedPorts) => { + 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.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.InstanceWithNamedPorts() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IInstanceWithNamedPorts[] = + []; + 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.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = + new regioninstancegroupsModule.v1.RegionInstanceGroupsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListInstancesRegionInstanceGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + 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.compute.v1.IInstanceWithNamedPorts[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_instances_v1.ts b/test/gapic_region_instances_v1.ts new file mode 100644 index 00000000..868a9a4d --- /dev/null +++ b/test/gapic_region_instances_v1.ts @@ -0,0 +1,258 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regioninstancesModule from '../src'; + +import {GoogleAuth, 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); +} + +describe('v1.RegionInstancesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regioninstancesModule.v1.RegionInstancesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regioninstancesModule.v1.RegionInstancesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regioninstancesModule.v1.RegionInstancesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regioninstancesModule.v1.RegionInstancesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regioninstancesModule.v1.RegionInstancesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regioninstancesModule.v1.RegionInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionInstancesStub, undefined); + await client.initialize(); + assert(client.regionInstancesStub); + }); + + it('has close method', () => { + const client = new regioninstancesModule.v1.RegionInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regioninstancesModule.v1.RegionInstancesClient({ + auth: googleAuth, + 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 regioninstancesModule.v1.RegionInstancesClient({ + auth: googleAuth, + 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('bulkInsert', () => { + it('invokes bulkInsert without error', async () => { + const client = new regioninstancesModule.v1.RegionInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.BulkInsertRegionInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.bulkInsert = stubSimpleCall(expectedResponse); + const [response] = await client.bulkInsert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkInsert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes bulkInsert without error using callback', async () => { + const client = new regioninstancesModule.v1.RegionInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.BulkInsertRegionInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.bulkInsert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.bulkInsert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bulkInsert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes bulkInsert with error', async () => { + const client = new regioninstancesModule.v1.RegionInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.BulkInsertRegionInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.bulkInsert = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.bulkInsert(request), expectedError); + assert( + (client.innerApiCalls.bulkInsert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); +}); diff --git a/test/gapic_region_network_endpoint_groups_v1.ts b/test/gapic_region_network_endpoint_groups_v1.ts new file mode 100644 index 00000000..e58639e3 --- /dev/null +++ b/test/gapic_region_network_endpoint_groups_v1.ts @@ -0,0 +1,906 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionnetworkendpointgroupsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionNetworkEndpointGroupsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + assert.strictEqual(client.regionNetworkEndpointGroupsStub, undefined); + await client.initialize(); + assert(client.regionNetworkEndpointGroupsStub); + }); + + it('has close method', () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + 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 regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INetworkEndpointGroup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionNetworkEndpointGroupRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.INetworkEndpointGroup[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointGroup[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NetworkEndpointGroup) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NetworkEndpointGroup[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NetworkEndpointGroup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NetworkEndpointGroup() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INetworkEndpointGroup[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regionnetworkendpointgroupsModule.v1.RegionNetworkEndpointGroupsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNetworkEndpointGroupsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INetworkEndpointGroup[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_notification_endpoints_v1.ts b/test/gapic_region_notification_endpoints_v1.ts new file mode 100644 index 00000000..9d712dd8 --- /dev/null +++ b/test/gapic_region_notification_endpoints_v1.ts @@ -0,0 +1,906 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionnotificationendpointsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionNotificationEndpointsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + assert.strictEqual(client.regionNotificationEndpointsStub, undefined); + await client.initialize(); + assert(client.regionNotificationEndpointsStub); + }); + + it('has close method', () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + 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 regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.INotificationEndpoint | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionNotificationEndpointRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.INotificationEndpoint[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NotificationEndpoint[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NotificationEndpoint) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.NotificationEndpoint[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.NotificationEndpoint) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + auth: googleAuth, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.NotificationEndpoint() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.INotificationEndpoint[] = + []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regionnotificationendpointsModule.v1.RegionNotificationEndpointsClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionNotificationEndpointsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.INotificationEndpoint[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_operations_v1.ts b/test/gapic_region_operations_v1.ts new file mode 100644 index 00000000..1becb634 --- /dev/null +++ b/test/gapic_region_operations_v1.ts @@ -0,0 +1,807 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionoperationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionOperationsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionoperationsModule.v1.RegionOperationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionoperationsModule.v1.RegionOperationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regionoperationsModule.v1.RegionOperationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regionoperationsModule.v1.RegionOperationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionOperationsStub, undefined); + await client.initialize(); + assert(client.regionOperationsStub); + }); + + it('has close method', () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + 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 regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionOperationResponse() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionOperationResponse() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDeleteRegionOperationResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('wait', () => { + it('invokes wait without error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.wait = stubSimpleCall(expectedResponse); + const [response] = await client.wait(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes wait without error using callback', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.wait = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.wait( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes wait with error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitRegionOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.wait = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.wait(request), expectedError); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regionoperationsModule.v1.RegionOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_ssl_certificates_v1.ts b/test/gapic_region_ssl_certificates_v1.ts new file mode 100644 index 00000000..a97f4ba6 --- /dev/null +++ b/test/gapic_region_ssl_certificates_v1.ts @@ -0,0 +1,855 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionsslcertificatesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionSslCertificatesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regionsslcertificatesModule.v1.RegionSslCertificatesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regionsslcertificatesModule.v1.RegionSslCertificatesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regionsslcertificatesModule.v1.RegionSslCertificatesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionSslCertificatesStub, undefined); + await client.initialize(); + assert(client.regionSslCertificatesStub); + }); + + it('has close method', () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + 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 regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISslCertificate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISslCertificate[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SslCertificate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SslCertificate) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SslCertificate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SslCertificate) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ISslCertificate[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regionsslcertificatesModule.v1.RegionSslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ISslCertificate[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_target_http_proxies_v1.ts b/test/gapic_region_target_http_proxies_v1.ts new file mode 100644 index 00000000..6d6dff44 --- /dev/null +++ b/test/gapic_region_target_http_proxies_v1.ts @@ -0,0 +1,968 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regiontargethttpproxiesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionTargetHttpProxiesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionTargetHttpProxiesStub, undefined); + await client.initialize(); + assert(client.regionTargetHttpProxiesStub); + }); + + it('has close method', () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + 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 regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpProxy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setUrlMap', () => { + it('invokes setUrlMap without error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); + const [response] = await client.setUrlMap(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setUrlMap without error using callback', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setUrlMap( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setUrlMap with error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapRegionTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setUrlMap = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setUrlMap(request), expectedError); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpProxy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpProxy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpProxy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetHttpProxy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regiontargethttpproxiesModule.v1.RegionTargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetHttpProxy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_target_https_proxies_v1.ts b/test/gapic_region_target_https_proxies_v1.ts new file mode 100644 index 00000000..5e7ba28f --- /dev/null +++ b/test/gapic_region_target_https_proxies_v1.ts @@ -0,0 +1,1084 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regiontargethttpsproxiesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionTargetHttpsProxiesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionTargetHttpsProxiesStub, undefined); + await client.initialize(); + assert(client.regionTargetHttpsProxiesStub); + }); + + it('has close method', () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + 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 regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpsProxy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setSslCertificates', () => { + it('invokes setSslCertificates without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslCertificates = + stubSimpleCall(expectedResponse); + const [response] = await client.setSslCertificates(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setSslCertificates without error using callback', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslCertificates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setSslCertificates( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setSslCertificates with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setSslCertificates = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setSslCertificates(request), expectedError); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setUrlMap', () => { + it('invokes setUrlMap without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); + const [response] = await client.setUrlMap(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setUrlMap without error using callback', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setUrlMap( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setUrlMap with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapRegionTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setUrlMap = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setUrlMap(request), expectedError); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpsProxy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpsProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpsProxy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpsProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpsProxy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetHttpsProxy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = + new regiontargethttpsproxiesModule.v1.RegionTargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetHttpsProxy[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_region_url_maps_v1.ts b/test/gapic_region_url_maps_v1.ts new file mode 100644 index 00000000..27f21ed7 --- /dev/null +++ b/test/gapic_region_url_maps_v1.ts @@ -0,0 +1,1123 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionurlmapsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionUrlMapsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = regionurlmapsModule.v1.RegionUrlMapsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = regionurlmapsModule.v1.RegionUrlMapsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regionurlmapsModule.v1.RegionUrlMapsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionUrlMapsStub, undefined); + await client.initialize(); + assert(client.regionUrlMapsStub); + }); + + it('has close method', () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + 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 regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMap() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMap() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IUrlMap | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('validate', () => { + it('invokes validate without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ValidateRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMapsValidateResponse() + ); + client.innerApiCalls.validate = stubSimpleCall(expectedResponse); + const [response] = await client.validate(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.validate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes validate without error using callback', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ValidateRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMapsValidateResponse() + ); + client.innerApiCalls.validate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IUrlMapsValidateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.validate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes validate with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ValidateRegionUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.validate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.validate(request), expectedError); + assert( + (client.innerApiCalls.validate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IUrlMap[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.UrlMap[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.UrlMap) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.UrlMap[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.UrlMap) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IUrlMap[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regionurlmapsModule.v1.RegionUrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IUrlMap[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_regions_v1.ts b/test/gapic_regions_v1.ts new file mode 100644 index 00000000..a1e13275 --- /dev/null +++ b/test/gapic_regions_v1.ts @@ -0,0 +1,584 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as regionsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RegionsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = regionsModule.v1.RegionsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = regionsModule.v1.RegionsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = regionsModule.v1.RegionsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new regionsModule.v1.RegionsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new regionsModule.v1.RegionsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new regionsModule.v1.RegionsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.regionsStub, undefined); + await client.initialize(); + assert(client.regionsStub); + }); + + it('has close method', () => { + const client = new regionsModule.v1.RegionsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new regionsModule.v1.RegionsClient({ + auth: googleAuth, + 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 regionsModule.v1.RegionsClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new regionsModule.v1.RegionsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Region() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new regionsModule.v1.RegionsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Region() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRegion | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new regionsModule.v1.RegionsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRegionRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new regionsModule.v1.RegionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new regionsModule.v1.RegionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRegion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new regionsModule.v1.RegionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new regionsModule.v1.RegionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Region[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Region) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new regionsModule.v1.RegionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Region[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Region) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new regionsModule.v1.RegionsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + generateSampleMessage(new protos.google.cloud.compute.v1.Region()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IRegion[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new regionsModule.v1.RegionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRegionsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IRegion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_reservations_v1.ts b/test/gapic_reservations_v1.ts new file mode 100644 index 00000000..95539718 --- /dev/null +++ b/test/gapic_reservations_v1.ts @@ -0,0 +1,1342 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as reservationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ReservationsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = reservationsModule.v1.ReservationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = reservationsModule.v1.ReservationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = reservationsModule.v1.ReservationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new reservationsModule.v1.ReservationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new reservationsModule.v1.ReservationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.reservationsStub, undefined); + await client.initialize(); + assert(client.reservationsStub); + }); + + it('has close method', () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + 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 reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Reservation() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Reservation() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IReservation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('resize', () => { + it('invokes resize without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = stubSimpleCall(expectedResponse); + const [response] = await client.resize(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes resize without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.resize = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resize( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes resize with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ResizeReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.resize = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.resize(request), expectedError); + assert( + (client.innerApiCalls.resize as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsReservationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.ReservationsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.ReservationsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.ReservationsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IReservationsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IReservationsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IReservation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Reservation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Reservation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Reservation()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IReservation[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new reservationsModule.v1.ReservationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListReservationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IReservation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_resource_policies_v1.ts b/test/gapic_resource_policies_v1.ts new file mode 100644 index 00000000..8c8e9a33 --- /dev/null +++ b/test/gapic_resource_policies_v1.ts @@ -0,0 +1,1260 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as resourcepoliciesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ResourcePoliciesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + resourcepoliciesModule.v1.ResourcePoliciesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + resourcepoliciesModule.v1.ResourcePoliciesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = resourcepoliciesModule.v1.ResourcePoliciesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.resourcePoliciesStub, undefined); + await client.initialize(); + assert(client.resourcePoliciesStub); + }); + + it('has close method', () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + 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 resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IResourcePolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicyResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicyResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsResourcePolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePoliciesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePoliciesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePoliciesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IResourcePoliciesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IResourcePoliciesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IResourcePolicy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ResourcePolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ResourcePolicy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.ResourcePolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.ResourcePolicy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.ResourcePolicy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IResourcePolicy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new resourcepoliciesModule.v1.ResourcePoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListResourcePoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IResourcePolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_routers_v1.ts b/test/gapic_routers_v1.ts new file mode 100644 index 00000000..84f204a1 --- /dev/null +++ b/test/gapic_routers_v1.ts @@ -0,0 +1,1639 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as routersModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RoutersClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = routersModule.v1.RoutersClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = routersModule.v1.RoutersClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = routersModule.v1.RoutersClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new routersModule.v1.RoutersClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new routersModule.v1.RoutersClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.routersStub, undefined); + await client.initialize(); + assert(client.routersStub); + }); + + it('has close method', () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + 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 routersModule.v1.RoutersClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Router() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Router() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRouter | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getRouterStatus', () => { + it('invokes getRouterStatus without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouterStatusRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.RouterStatusResponse() + ); + client.innerApiCalls.getRouterStatus = stubSimpleCall(expectedResponse); + const [response] = await client.getRouterStatus(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRouterStatus as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getRouterStatus without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouterStatusRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.RouterStatusResponse() + ); + client.innerApiCalls.getRouterStatus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRouterStatus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRouterStatusResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRouterStatus as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getRouterStatus with error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouterStatusRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRouterStatus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRouterStatus(request), expectedError); + assert( + (client.innerApiCalls.getRouterStatus as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('preview', () => { + it('invokes preview without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PreviewRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.RoutersPreviewResponse() + ); + client.innerApiCalls.preview = stubSimpleCall(expectedResponse); + const [response] = await client.preview(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.preview as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes preview without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PreviewRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.RoutersPreviewResponse() + ); + client.innerApiCalls.preview = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.preview( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRoutersPreviewResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.preview as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes preview with error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PreviewRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.preview = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.preview(request), expectedError); + assert( + (client.innerApiCalls.preview as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateRouterRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.RoutersScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.RoutersScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.RoutersScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IRoutersScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IRoutersScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('getNatMappingInfo', () => { + it('invokes getNatMappingInfo without error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + ]; + client.innerApiCalls.getNatMappingInfo = stubSimpleCall(expectedResponse); + const [response] = await client.getNatMappingInfo(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getNatMappingInfo as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getNatMappingInfo without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + ]; + client.innerApiCalls.getNatMappingInfo = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNatMappingInfo( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.compute.v1.IVmEndpointNatMappings[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getNatMappingInfo as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getNatMappingInfo with error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getNatMappingInfo = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getNatMappingInfo(request), expectedError); + assert( + (client.innerApiCalls.getNatMappingInfo as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getNatMappingInfoStream without error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + ]; + client.descriptors.page.getNatMappingInfo.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.getNatMappingInfoStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.VmEndpointNatMappings[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.VmEndpointNatMappings) => { + 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.getNatMappingInfo.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.getNatMappingInfo, request) + ); + assert.strictEqual( + ( + client.descriptors.page.getNatMappingInfo.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes getNatMappingInfoStream with error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.getNatMappingInfo.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.getNatMappingInfoStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.VmEndpointNatMappings[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.VmEndpointNatMappings) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.getNatMappingInfo.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.getNatMappingInfo, request) + ); + assert.strictEqual( + ( + client.descriptors.page.getNatMappingInfo.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with getNatMappingInfo without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.VmEndpointNatMappings() + ), + ]; + client.descriptors.page.getNatMappingInfo.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IVmEndpointNatMappings[] = + []; + const iterable = client.getNatMappingInfoAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.getNatMappingInfo.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.getNatMappingInfo.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with getNatMappingInfo with error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetNatMappingInfoRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.getNatMappingInfo.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.getNatMappingInfoAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IVmEndpointNatMappings[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.getNatMappingInfo.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.getNatMappingInfo.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRouter[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Router[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Router) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Router[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Router) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new routersModule.v1.RoutersClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + generateSampleMessage(new protos.google.cloud.compute.v1.Router()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IRouter[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new routersModule.v1.RoutersClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutersRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IRouter[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_routes_v1.ts b/test/gapic_routes_v1.ts new file mode 100644 index 00000000..cbc6a581 --- /dev/null +++ b/test/gapic_routes_v1.ts @@ -0,0 +1,800 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as routesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.RoutesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = routesModule.v1.RoutesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = routesModule.v1.RoutesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = routesModule.v1.RoutesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new routesModule.v1.RoutesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new routesModule.v1.RoutesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.routesStub, undefined); + await client.initialize(); + assert(client.routesStub); + }); + + it('has close method', () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + 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.v1.RoutesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Route() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Route() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRoute | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertRouteRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new routesModule.v1.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new routesModule.v1.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IRoute[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new routesModule.v1.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new routesModule.v1.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Route[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Route) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new routesModule.v1.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Route[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.Route) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new routesModule.v1.RoutesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + generateSampleMessage(new protos.google.cloud.compute.v1.Route()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IRoute[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new routesModule.v1.RoutesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListRoutesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IRoute[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_security_policies_v1.ts b/test/gapic_security_policies_v1.ts new file mode 100644 index 00000000..87f6dddf --- /dev/null +++ b/test/gapic_security_policies_v1.ts @@ -0,0 +1,1489 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as securitypoliciesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.SecurityPoliciesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + securitypoliciesModule.v1.SecurityPoliciesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + securitypoliciesModule.v1.SecurityPoliciesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = securitypoliciesModule.v1.SecurityPoliciesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.securityPoliciesStub, undefined); + await client.initialize(); + assert(client.securityPoliciesStub); + }); + + it('has close method', () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + 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 securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + 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('addRule', () => { + it('invokes addRule without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addRule = stubSimpleCall(expectedResponse); + const [response] = await client.addRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addRule without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addRule with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addRule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addRule(request), expectedError); + assert( + (client.innerApiCalls.addRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISecurityPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getRule', () => { + it('invokes getRule without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicyRule() + ); + client.innerApiCalls.getRule = stubSimpleCall(expectedResponse); + const [response] = await client.getRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getRule without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicyRule() + ); + client.innerApiCalls.getRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISecurityPolicyRule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getRule with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRule(request), expectedError); + assert( + (client.innerApiCalls.getRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listPreconfiguredExpressionSets', () => { + it('invokes listPreconfiguredExpressionSets without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse() + ); + client.innerApiCalls.listPreconfiguredExpressionSets = + stubSimpleCall(expectedResponse); + const [response] = await client.listPreconfiguredExpressionSets(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPreconfiguredExpressionSets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listPreconfiguredExpressionSets without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPoliciesListPreconfiguredExpressionSetsResponse() + ); + client.innerApiCalls.listPreconfiguredExpressionSets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPreconfiguredExpressionSets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISecurityPoliciesListPreconfiguredExpressionSetsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listPreconfiguredExpressionSets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listPreconfiguredExpressionSets with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListPreconfiguredExpressionSetsSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listPreconfiguredExpressionSets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listPreconfiguredExpressionSets(request), + expectedError + ); + assert( + (client.innerApiCalls.listPreconfiguredExpressionSets as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patchRule', () => { + it('invokes patchRule without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchRule = stubSimpleCall(expectedResponse); + const [response] = await client.patchRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patchRule without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patchRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patchRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patchRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patchRule with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patchRule = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patchRule(request), expectedError); + assert( + (client.innerApiCalls.patchRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeRule', () => { + it('invokes removeRule without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeRule = stubSimpleCall(expectedResponse); + const [response] = await client.removeRule(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeRule without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeRule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeRule( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeRule with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveRuleSecurityPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeRule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeRule(request), expectedError); + assert( + (client.innerApiCalls.removeRule as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISecurityPolicy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SecurityPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SecurityPolicy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SecurityPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SecurityPolicy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SecurityPolicy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ISecurityPolicy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new securitypoliciesModule.v1.SecurityPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSecurityPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ISecurityPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_snapshots_v1.ts b/test/gapic_snapshots_v1.ts new file mode 100644 index 00000000..852ada39 --- /dev/null +++ b/test/gapic_snapshots_v1.ts @@ -0,0 +1,1140 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as snapshotsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.SnapshotsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = snapshotsModule.v1.SnapshotsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = snapshotsModule.v1.SnapshotsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = snapshotsModule.v1.SnapshotsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new snapshotsModule.v1.SnapshotsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.snapshotsStub, undefined); + await client.initialize(); + assert(client.snapshotsStub); + }); + + it('has close method', () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + 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 snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Snapshot() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Snapshot() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISnapshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicySnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicySnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicySnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicySnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicySnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicySnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsSnapshotRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISnapshot[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Snapshot[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Snapshot) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Snapshot[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Snapshot) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + generateSampleMessage(new protos.google.cloud.compute.v1.Snapshot()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ISnapshot[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new snapshotsModule.v1.SnapshotsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSnapshotsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ISnapshot[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_ssl_certificates_v1.ts b/test/gapic_ssl_certificates_v1.ts new file mode 100644 index 00000000..7b75dc5a --- /dev/null +++ b/test/gapic_ssl_certificates_v1.ts @@ -0,0 +1,926 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as sslcertificatesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.SslCertificatesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + sslcertificatesModule.v1.SslCertificatesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + sslcertificatesModule.v1.SslCertificatesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = sslcertificatesModule.v1.SslCertificatesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.sslCertificatesStub, undefined); + await client.initialize(); + assert(client.sslCertificatesStub); + }); + + it('has close method', () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + 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 sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISslCertificate | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSslCertificateRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificatesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificatesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificatesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ISslCertificatesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ISslCertificatesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISslCertificate[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SslCertificate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SslCertificate) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SslCertificate[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SslCertificate) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.SslCertificate() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ISslCertificate[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new sslcertificatesModule.v1.SslCertificatesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslCertificatesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ISslCertificate[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_ssl_policies_v1.ts b/test/gapic_ssl_policies_v1.ts new file mode 100644 index 00000000..83faf515 --- /dev/null +++ b/test/gapic_ssl_policies_v1.ts @@ -0,0 +1,1028 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as sslpoliciesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.SslPoliciesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = sslpoliciesModule.v1.SslPoliciesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = sslpoliciesModule.v1.SslPoliciesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = sslpoliciesModule.v1.SslPoliciesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.sslPoliciesStub, undefined); + await client.initialize(); + assert(client.sslPoliciesStub); + }); + + it('has close method', () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + 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 sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslPolicy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslPolicy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISslPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listAvailableFeatures', () => { + it('invokes listAvailableFeatures without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse() + ); + client.innerApiCalls.listAvailableFeatures = + stubSimpleCall(expectedResponse); + const [response] = await client.listAvailableFeatures(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAvailableFeatures as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAvailableFeatures without error using callback', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.SslPoliciesListAvailableFeaturesResponse() + ); + client.innerApiCalls.listAvailableFeatures = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAvailableFeatures( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISslPoliciesListAvailableFeaturesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAvailableFeatures as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAvailableFeatures with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListAvailableFeaturesSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAvailableFeatures = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listAvailableFeatures(request), + expectedError + ); + assert( + (client.innerApiCalls.listAvailableFeatures as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSslPolicyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISslPolicy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SslPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SslPolicy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.SslPolicy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.SslPolicy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + generateSampleMessage(new protos.google.cloud.compute.v1.SslPolicy()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ISslPolicy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new sslpoliciesModule.v1.SslPoliciesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSslPoliciesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ISslPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_subnetworks_v1.ts b/test/gapic_subnetworks_v1.ts new file mode 100644 index 00000000..9766e88a --- /dev/null +++ b/test/gapic_subnetworks_v1.ts @@ -0,0 +1,1877 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as subnetworksModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.SubnetworksClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = subnetworksModule.v1.SubnetworksClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = subnetworksModule.v1.SubnetworksClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = subnetworksModule.v1.SubnetworksClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new subnetworksModule.v1.SubnetworksClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.subnetworksStub, undefined); + await client.initialize(); + assert(client.subnetworksStub); + }); + + it('has close method', () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + 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 subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('expandIpCidrRange', () => { + it('invokes expandIpCidrRange without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.expandIpCidrRange = stubSimpleCall(expectedResponse); + const [response] = await client.expandIpCidrRange(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.expandIpCidrRange as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes expandIpCidrRange without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.expandIpCidrRange = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.expandIpCidrRange( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.expandIpCidrRange as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes expandIpCidrRange with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ExpandIpCidrRangeSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.expandIpCidrRange = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.expandIpCidrRange(request), expectedError); + assert( + (client.innerApiCalls.expandIpCidrRange as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Subnetwork() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Subnetwork() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISubnetwork | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicySubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getIamPolicy without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicySubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.getIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getIamPolicy with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetIamPolicySubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicySubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setIamPolicy without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicySubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Policy() + ); + client.innerApiCalls.setIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setIamPolicy with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetIamPolicySubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setPrivateIpGoogleAccess', () => { + it('invokes setPrivateIpGoogleAccess without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setPrivateIpGoogleAccess = + stubSimpleCall(expectedResponse); + const [response] = await client.setPrivateIpGoogleAccess(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setPrivateIpGoogleAccess as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setPrivateIpGoogleAccess without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setPrivateIpGoogleAccess = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setPrivateIpGoogleAccess( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setPrivateIpGoogleAccess as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setPrivateIpGoogleAccess with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetPrivateIpGoogleAccessSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setPrivateIpGoogleAccess = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.setPrivateIpGoogleAccess(request), + expectedError + ); + assert( + (client.innerApiCalls.setPrivateIpGoogleAccess as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsSubnetworkRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.SubnetworksScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.SubnetworksScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.SubnetworksScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ISubnetworksScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ISubnetworksScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ISubnetwork[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Subnetwork[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Subnetwork) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Subnetwork[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Subnetwork) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + generateSampleMessage(new protos.google.cloud.compute.v1.Subnetwork()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ISubnetwork[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ISubnetwork[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listUsable', () => { + it('invokes listUsable without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUsableSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + ]; + client.innerApiCalls.listUsable = stubSimpleCall(expectedResponse); + const [response] = await client.listUsable(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listUsable as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listUsable without error using callback', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUsableSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + ]; + client.innerApiCalls.listUsable = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsable( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IUsableSubnetwork[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listUsable as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listUsable with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUsableSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsable = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listUsable(request), expectedError); + assert( + (client.innerApiCalls.listUsable as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listUsableStream without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUsableSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + ]; + client.descriptors.page.listUsable.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listUsableStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.UsableSubnetwork[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.UsableSubnetwork) => { + 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.listUsable.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listUsable, request) + ); + assert.strictEqual( + (client.descriptors.page.listUsable.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listUsableStream with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUsableSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listUsable.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listUsableStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.UsableSubnetwork[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.UsableSubnetwork) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listUsable.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listUsable, request) + ); + assert.strictEqual( + (client.descriptors.page.listUsable.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listUsable without error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUsableSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.UsableSubnetwork() + ), + ]; + client.descriptors.page.listUsable.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IUsableSubnetwork[] = []; + const iterable = client.listUsableAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listUsable.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listUsable.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listUsable with error', async () => { + const client = new subnetworksModule.v1.SubnetworksClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUsableSubnetworksRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.listUsable.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listUsableAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IUsableSubnetwork[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listUsable.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listUsable.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_grpc_proxies_v1.ts b/test/gapic_target_grpc_proxies_v1.ts new file mode 100644 index 00000000..81dd5893 --- /dev/null +++ b/test/gapic_target_grpc_proxies_v1.ts @@ -0,0 +1,939 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targetgrpcproxiesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetGrpcProxiesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + targetgrpcproxiesModule.v1.TargetGrpcProxiesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + targetgrpcproxiesModule.v1.TargetGrpcProxiesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targetgrpcproxiesModule.v1.TargetGrpcProxiesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetGrpcProxiesStub, undefined); + await client.initialize(); + assert(client.targetGrpcProxiesStub); + }); + + it('has close method', () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + 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 targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetGrpcProxy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetGrpcProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetGrpcProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetGrpcProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetGrpcProxy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetGrpcProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetGrpcProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetGrpcProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetGrpcProxy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetGrpcProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetGrpcProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetGrpcProxy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetGrpcProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetGrpcProxy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetGrpcProxy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targetgrpcproxiesModule.v1.TargetGrpcProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetGrpcProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetGrpcProxy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_http_proxies_v1.ts b/test/gapic_target_http_proxies_v1.ts new file mode 100644 index 00000000..cd5ed418 --- /dev/null +++ b/test/gapic_target_http_proxies_v1.ts @@ -0,0 +1,1141 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targethttpproxiesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetHttpProxiesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + targethttpproxiesModule.v1.TargetHttpProxiesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + targethttpproxiesModule.v1.TargetHttpProxiesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targethttpproxiesModule.v1.TargetHttpProxiesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetHttpProxiesStub, undefined); + await client.initialize(); + assert(client.targetHttpProxiesStub); + }); + + it('has close method', () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + 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 targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpProxy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setUrlMap', () => { + it('invokes setUrlMap without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); + const [response] = await client.setUrlMap(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setUrlMap without error using callback', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setUrlMap( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setUrlMap with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapTargetHttpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setUrlMap = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setUrlMap(request), expectedError); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxiesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxiesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxiesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetHttpProxiesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetHttpProxiesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpProxy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpProxy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpProxy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpProxy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetHttpProxy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targethttpproxiesModule.v1.TargetHttpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetHttpProxy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_https_proxies_v1.ts b/test/gapic_target_https_proxies_v1.ts new file mode 100644 index 00000000..ff7c25f8 --- /dev/null +++ b/test/gapic_target_https_proxies_v1.ts @@ -0,0 +1,1476 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targethttpsproxiesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetHttpsProxiesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + targethttpsproxiesModule.v1.TargetHttpsProxiesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + targethttpsproxiesModule.v1.TargetHttpsProxiesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targethttpsproxiesModule.v1.TargetHttpsProxiesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetHttpsProxiesStub, undefined); + await client.initialize(); + assert(client.targetHttpsProxiesStub); + }); + + it('has close method', () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + 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 targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpsProxy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setQuicOverride', () => { + it('invokes setQuicOverride without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setQuicOverride = stubSimpleCall(expectedResponse); + const [response] = await client.setQuicOverride(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setQuicOverride as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setQuicOverride without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setQuicOverride = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setQuicOverride( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setQuicOverride as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setQuicOverride with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetQuicOverrideTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setQuicOverride = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setQuicOverride(request), expectedError); + assert( + (client.innerApiCalls.setQuicOverride as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setSslCertificates', () => { + it('invokes setSslCertificates without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslCertificates = + stubSimpleCall(expectedResponse); + const [response] = await client.setSslCertificates(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setSslCertificates without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslCertificates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setSslCertificates( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setSslCertificates with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setSslCertificates = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setSslCertificates(request), expectedError); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setSslPolicy', () => { + it('invokes setSslPolicy without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setSslPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setSslPolicy without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setSslPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setSslPolicy with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslPolicyTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setSslPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setSslPolicy(request), expectedError); + assert( + (client.innerApiCalls.setSslPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setUrlMap', () => { + it('invokes setUrlMap without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = stubSimpleCall(expectedResponse); + const [response] = await client.setUrlMap(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setUrlMap without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setUrlMap = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setUrlMap( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setUrlMap with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetUrlMapTargetHttpsProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setUrlMap = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setUrlMap(request), expectedError); + assert( + (client.innerApiCalls.setUrlMap as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxiesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxiesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxiesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetHttpsProxiesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetHttpsProxiesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetHttpsProxy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpsProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpsProxy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetHttpsProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetHttpsProxy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetHttpsProxy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetHttpsProxy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targethttpsproxiesModule.v1.TargetHttpsProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetHttpsProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetHttpsProxy[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_instances_v1.ts b/test/gapic_target_instances_v1.ts new file mode 100644 index 00000000..ca689c4e --- /dev/null +++ b/test/gapic_target_instances_v1.ts @@ -0,0 +1,926 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targetinstancesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetInstancesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + targetinstancesModule.v1.TargetInstancesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + targetinstancesModule.v1.TargetInstancesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targetinstancesModule.v1.TargetInstancesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targetinstancesModule.v1.TargetInstancesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetInstancesStub, undefined); + await client.initialize(); + assert(client.targetInstancesStub); + }); + + it('has close method', () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + 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 targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetInstanceRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstancesScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstancesScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstancesScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetInstancesScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetInstancesScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetInstance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetInstance) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetInstance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetInstance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetInstance() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetInstance[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targetinstancesModule.v1.TargetInstancesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetInstancesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_pools_v1.ts b/test/gapic_target_pools_v1.ts new file mode 100644 index 00000000..0a4cd552 --- /dev/null +++ b/test/gapic_target_pools_v1.ts @@ -0,0 +1,1560 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targetpoolsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetPoolsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = targetpoolsModule.v1.TargetPoolsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = targetpoolsModule.v1.TargetPoolsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targetpoolsModule.v1.TargetPoolsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targetpoolsModule.v1.TargetPoolsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetPoolsStub, undefined); + await client.initialize(); + assert(client.targetPoolsStub); + }); + + it('has close method', () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + 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 targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + 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('addHealthCheck', () => { + it('invokes addHealthCheck without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddHealthCheckTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addHealthCheck = stubSimpleCall(expectedResponse); + const [response] = await client.addHealthCheck(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addHealthCheck as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addHealthCheck without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddHealthCheckTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addHealthCheck = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addHealthCheck( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addHealthCheck as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addHealthCheck with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddHealthCheckTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addHealthCheck = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addHealthCheck(request), expectedError); + assert( + (client.innerApiCalls.addHealthCheck as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('addInstance', () => { + it('invokes addInstance without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddInstanceTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addInstance = stubSimpleCall(expectedResponse); + const [response] = await client.addInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes addInstance without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddInstanceTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.addInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes addInstance with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AddInstanceTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addInstance(request), expectedError); + assert( + (client.innerApiCalls.addInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('delete', () => { + it('invokes delete without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetPool() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetPool() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetPool | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getHealth', () => { + it('invokes getHealth without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetPoolInstanceHealth() + ); + client.innerApiCalls.getHealth = stubSimpleCall(expectedResponse); + const [response] = await client.getHealth(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getHealth without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetPoolInstanceHealth() + ); + client.innerApiCalls.getHealth = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHealth( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetPoolInstanceHealth | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getHealth with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetHealthTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getHealth = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getHealth(request), expectedError); + assert( + (client.innerApiCalls.getHealth as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeHealthCheck', () => { + it('invokes removeHealthCheck without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeHealthCheck = stubSimpleCall(expectedResponse); + const [response] = await client.removeHealthCheck(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeHealthCheck as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeHealthCheck without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeHealthCheck = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeHealthCheck( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeHealthCheck as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeHealthCheck with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveHealthCheckTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeHealthCheck = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeHealthCheck(request), expectedError); + assert( + (client.innerApiCalls.removeHealthCheck as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeInstance', () => { + it('invokes removeInstance without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveInstanceTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeInstance = stubSimpleCall(expectedResponse); + const [response] = await client.removeInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes removeInstance without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveInstanceTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.removeInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes removeInstance with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.RemoveInstanceTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeInstance(request), expectedError); + assert( + (client.innerApiCalls.removeInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setBackup', () => { + it('invokes setBackup without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackupTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setBackup = stubSimpleCall(expectedResponse); + const [response] = await client.setBackup(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setBackup without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackupTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setBackup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setBackup with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackupTargetPoolRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setBackup(request), expectedError); + assert( + (client.innerApiCalls.setBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetPoolsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetPoolsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetPoolsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetPoolsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetPoolsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetPool[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetPool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetPool) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetPool[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetPool) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + generateSampleMessage(new protos.google.cloud.compute.v1.TargetPool()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetPool[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targetpoolsModule.v1.TargetPoolsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetPoolsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetPool[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_ssl_proxies_v1.ts b/test/gapic_target_ssl_proxies_v1.ts new file mode 100644 index 00000000..50c40a0b --- /dev/null +++ b/test/gapic_target_ssl_proxies_v1.ts @@ -0,0 +1,1277 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targetsslproxiesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetSslProxiesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + targetsslproxiesModule.v1.TargetSslProxiesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + targetsslproxiesModule.v1.TargetSslProxiesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targetsslproxiesModule.v1.TargetSslProxiesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetSslProxiesStub, undefined); + await client.initialize(); + assert(client.targetSslProxiesStub); + }); + + it('has close method', () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + 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 targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetSslProxy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setBackendService', () => { + it('invokes setBackendService without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setBackendService = stubSimpleCall(expectedResponse); + const [response] = await client.setBackendService(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setBackendService as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setBackendService without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setBackendService = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setBackendService( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setBackendService as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setBackendService with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackendServiceTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setBackendService = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setBackendService(request), expectedError); + assert( + (client.innerApiCalls.setBackendService as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setProxyHeader', () => { + it('invokes setProxyHeader without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setProxyHeader = stubSimpleCall(expectedResponse); + const [response] = await client.setProxyHeader(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setProxyHeader as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setProxyHeader without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setProxyHeader = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setProxyHeader( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setProxyHeader as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setProxyHeader with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetProxyHeaderTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setProxyHeader = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setProxyHeader(request), expectedError); + assert( + (client.innerApiCalls.setProxyHeader as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setSslCertificates', () => { + it('invokes setSslCertificates without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslCertificates = + stubSimpleCall(expectedResponse); + const [response] = await client.setSslCertificates(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setSslCertificates without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslCertificates = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setSslCertificates( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setSslCertificates with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslCertificatesTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setSslCertificates = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setSslCertificates(request), expectedError); + assert( + (client.innerApiCalls.setSslCertificates as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setSslPolicy', () => { + it('invokes setSslPolicy without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.setSslPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setSslPolicy without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setSslPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setSslPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setSslPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setSslPolicy with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetSslPolicyTargetSslProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setSslPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setSslPolicy(request), expectedError); + assert( + (client.innerApiCalls.setSslPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetSslProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetSslProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetSslProxy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetSslProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetSslProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetSslProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetSslProxy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetSslProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetSslProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetSslProxy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetSslProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetSslProxy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetSslProxy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targetsslproxiesModule.v1.TargetSslProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetSslProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetSslProxy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_tcp_proxies_v1.ts b/test/gapic_target_tcp_proxies_v1.ts new file mode 100644 index 00000000..c5bf97c4 --- /dev/null +++ b/test/gapic_target_tcp_proxies_v1.ts @@ -0,0 +1,1054 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targettcpproxiesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetTcpProxiesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + targettcpproxiesModule.v1.TargetTcpProxiesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + targettcpproxiesModule.v1.TargetTcpProxiesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targettcpproxiesModule.v1.TargetTcpProxiesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetTcpProxiesStub, undefined); + await client.initialize(); + assert(client.targetTcpProxiesStub); + }); + + it('has close method', () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + 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 targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetTcpProxy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setBackendService', () => { + it('invokes setBackendService without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setBackendService = stubSimpleCall(expectedResponse); + const [response] = await client.setBackendService(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setBackendService as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setBackendService without error using callback', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setBackendService = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setBackendService( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setBackendService as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setBackendService with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetBackendServiceTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setBackendService = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setBackendService(request), expectedError); + assert( + (client.innerApiCalls.setBackendService as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setProxyHeader', () => { + it('invokes setProxyHeader without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setProxyHeader = stubSimpleCall(expectedResponse); + const [response] = await client.setProxyHeader(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setProxyHeader as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setProxyHeader without error using callback', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setProxyHeader = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setProxyHeader( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setProxyHeader as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setProxyHeader with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetProxyHeaderTargetTcpProxyRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setProxyHeader = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.setProxyHeader(request), expectedError); + assert( + (client.innerApiCalls.setProxyHeader as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetTcpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetTcpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetTcpProxy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetTcpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetTcpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetTcpProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetTcpProxy) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetTcpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetTcpProxy[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetTcpProxy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetTcpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetTcpProxy() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetTcpProxy[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targettcpproxiesModule.v1.TargetTcpProxiesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetTcpProxiesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetTcpProxy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_target_vpn_gateways_v1.ts b/test/gapic_target_vpn_gateways_v1.ts new file mode 100644 index 00000000..f6d77c4d --- /dev/null +++ b/test/gapic_target_vpn_gateways_v1.ts @@ -0,0 +1,927 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as targetvpngatewaysModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.TargetVpnGatewaysClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + targetvpngatewaysModule.v1.TargetVpnGatewaysClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + targetvpngatewaysModule.v1.TargetVpnGatewaysClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = targetvpngatewaysModule.v1.TargetVpnGatewaysClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.targetVpnGatewaysStub, undefined); + await client.initialize(); + assert(client.targetVpnGatewaysStub); + }); + + it('has close method', () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + 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 targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetVpnGateway | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertTargetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGatewaysScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGatewaysScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGatewaysScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetVpnGatewaysScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.ITargetVpnGatewaysScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITargetVpnGateway[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetVpnGateway[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetVpnGateway) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.TargetVpnGateway[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.TargetVpnGateway) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + generateSampleMessage( + new protos.google.cloud.compute.v1.TargetVpnGateway() + ), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.ITargetVpnGateway[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new targetvpngatewaysModule.v1.TargetVpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListTargetVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.ITargetVpnGateway[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_url_maps_v1.ts b/test/gapic_url_maps_v1.ts new file mode 100644 index 00000000..7bc121e9 --- /dev/null +++ b/test/gapic_url_maps_v1.ts @@ -0,0 +1,1328 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as urlmapsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.UrlMapsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = urlmapsModule.v1.UrlMapsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = urlmapsModule.v1.UrlMapsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = urlmapsModule.v1.UrlMapsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new urlmapsModule.v1.UrlMapsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.urlMapsStub, undefined); + await client.initialize(); + assert(client.urlMapsStub); + }); + + it('has close method', () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + 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 urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMap() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMap() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IUrlMap | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('invalidateCache', () => { + it('invokes invalidateCache without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InvalidateCacheUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.invalidateCache = stubSimpleCall(expectedResponse); + const [response] = await client.invalidateCache(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.invalidateCache as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes invalidateCache without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InvalidateCacheUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.invalidateCache = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.invalidateCache( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.invalidateCache as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes invalidateCache with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InvalidateCacheUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.invalidateCache = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.invalidateCache(request), expectedError); + assert( + (client.innerApiCalls.invalidateCache as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('patch', () => { + it('invokes patch without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCall(expectedResponse); + const [response] = await client.patch(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes patch without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.patch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.patch( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes patch with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.PatchUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.patch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.patch(request), expectedError); + assert( + (client.innerApiCalls.patch as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('update', () => { + it('invokes update without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = stubSimpleCall(expectedResponse); + const [response] = await client.update(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes update without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.update = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.update( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes update with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.UpdateUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.update = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.update(request), expectedError); + assert( + (client.innerApiCalls.update as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('validate', () => { + it('invokes validate without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ValidateUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMapsValidateResponse() + ); + client.innerApiCalls.validate = stubSimpleCall(expectedResponse); + const [response] = await client.validate(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.validate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes validate without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ValidateUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMapsValidateResponse() + ); + client.innerApiCalls.validate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.validate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IUrlMapsValidateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.validate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes validate with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ValidateUrlMapRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.validate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.validate(request), expectedError); + assert( + (client.innerApiCalls.validate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMapsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMapsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.UrlMapsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IUrlMapsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IUrlMapsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IUrlMap[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.UrlMap[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.UrlMap) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.UrlMap[] = []; + stream.on('data', (response: protos.google.cloud.compute.v1.UrlMap) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + generateSampleMessage(new protos.google.cloud.compute.v1.UrlMap()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IUrlMap[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new urlmapsModule.v1.UrlMapsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListUrlMapsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IUrlMap[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_vpn_gateways_v1.ts b/test/gapic_vpn_gateways_v1.ts new file mode 100644 index 00000000..6783d522 --- /dev/null +++ b/test/gapic_vpn_gateways_v1.ts @@ -0,0 +1,1228 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as vpngatewaysModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.VpnGatewaysClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = vpngatewaysModule.v1.VpnGatewaysClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = vpngatewaysModule.v1.VpnGatewaysClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = vpngatewaysModule.v1.VpnGatewaysClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.vpnGatewaysStub, undefined); + await client.initialize(); + assert(client.vpnGatewaysStub); + }); + + it('has close method', () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + 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 vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.VpnGateway() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.VpnGateway() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IVpnGateway | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getStatus', () => { + it('invokes getStatus without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetStatusVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.VpnGatewaysGetStatusResponse() + ); + client.innerApiCalls.getStatus = stubSimpleCall(expectedResponse); + const [response] = await client.getStatus(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getStatus as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getStatus without error using callback', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetStatusVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.VpnGatewaysGetStatusResponse() + ); + client.innerApiCalls.getStatus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getStatus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IVpnGatewaysGetStatusResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getStatus as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getStatus with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetStatusVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getStatus = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getStatus(request), expectedError); + assert( + (client.innerApiCalls.getStatus as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('setLabels', () => { + it('invokes setLabels without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = stubSimpleCall(expectedResponse); + const [response] = await client.setLabels(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes setLabels without error using callback', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.setLabels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setLabels( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes setLabels with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.SetLabelsVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.setLabels = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setLabels(request), expectedError); + assert( + (client.innerApiCalls.setLabels as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCall(expectedResponse); + const [response] = await client.testIamPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes testIamPermissions without error using callback', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.TestPermissionsResponse() + ); + client.innerApiCalls.testIamPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.ITestPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes testIamPermissions with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.TestIamPermissionsVpnGatewayRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.testIamPermissions(request), expectedError); + assert( + (client.innerApiCalls.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.VpnGatewaysScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.VpnGatewaysScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.VpnGatewaysScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IVpnGatewaysScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IVpnGatewaysScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IVpnGateway[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.VpnGateway[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.VpnGateway) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.VpnGateway[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.VpnGateway) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnGateway()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IVpnGateway[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new vpngatewaysModule.v1.VpnGatewaysClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnGatewaysRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IVpnGateway[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_vpn_tunnels_v1.ts b/test/gapic_vpn_tunnels_v1.ts new file mode 100644 index 00000000..910e4157 --- /dev/null +++ b/test/gapic_vpn_tunnels_v1.ts @@ -0,0 +1,900 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as vpntunnelsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.VpnTunnelsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = vpntunnelsModule.v1.VpnTunnelsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = vpntunnelsModule.v1.VpnTunnelsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = vpntunnelsModule.v1.VpnTunnelsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.vpnTunnelsStub, undefined); + await client.initialize(); + assert(client.vpnTunnelsStub); + }); + + it('has close method', () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + 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 vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.VpnTunnel() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.VpnTunnel() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IVpnTunnel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('insert', () => { + it('invokes insert without error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = stubSimpleCall(expectedResponse); + const [response] = await client.insert(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes insert without error using callback', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.insert = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.insert( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes insert with error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.InsertVpnTunnelRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.insert = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.insert(request), expectedError); + assert( + (client.innerApiCalls.insert as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('aggregatedList', () => { + it('uses async iteration with aggregatedList without error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + [ + 'tuple_key_1', + generateSampleMessage( + new protos.google.cloud.compute.v1.VpnTunnelsScopedList() + ), + ], + [ + 'tuple_key_2', + generateSampleMessage( + new protos.google.cloud.compute.v1.VpnTunnelsScopedList() + ), + ], + [ + 'tuple_key_3', + generateSampleMessage( + new protos.google.cloud.compute.v1.VpnTunnelsScopedList() + ), + ], + ]; + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: Array< + [string, protos.google.cloud.compute.v1.IVpnTunnelsScopedList] + > = []; + const iterable = client.aggregatedListAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with aggregatedList with error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.AggregatedListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.aggregatedList.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.aggregatedListAsync(request); + await assert.rejects(async () => { + const responses: Array< + [string, protos.google.cloud.compute.v1.IVpnTunnelsScopedList] + > = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.aggregatedList.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IVpnTunnel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.VpnTunnel[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.VpnTunnel) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.VpnTunnel[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.VpnTunnel) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + generateSampleMessage(new protos.google.cloud.compute.v1.VpnTunnel()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IVpnTunnel[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new vpntunnelsModule.v1.VpnTunnelsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListVpnTunnelsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IVpnTunnel[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_zone_operations_v1.ts b/test/gapic_zone_operations_v1.ts new file mode 100644 index 00000000..5525cdba --- /dev/null +++ b/test/gapic_zone_operations_v1.ts @@ -0,0 +1,807 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as zoneoperationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ZoneOperationsClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = + zoneoperationsModule.v1.ZoneOperationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + zoneoperationsModule.v1.ZoneOperationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = zoneoperationsModule.v1.ZoneOperationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.zoneOperationsStub, undefined); + await client.initialize(); + assert(client.zoneOperationsStub); + }); + + it('has close method', () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + 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 zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + 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('delete', () => { + it('invokes delete without error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteZoneOperationResponse() + ); + client.innerApiCalls.delete = stubSimpleCall(expectedResponse); + const [response] = await client.delete(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes delete without error using callback', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteZoneOperationResponse() + ); + client.innerApiCalls.delete = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.delete( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IDeleteZoneOperationResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes delete with error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.DeleteZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.delete = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.delete(request), expectedError); + assert( + (client.innerApiCalls.delete as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('get', () => { + it('invokes get without error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('wait', () => { + it('invokes wait without error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.wait = stubSimpleCall(expectedResponse); + const [response] = await client.wait(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes wait without error using callback', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Operation() + ); + client.innerApiCalls.wait = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.wait( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes wait with error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.WaitZoneOperationRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.wait = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.wait(request), expectedError); + assert( + (client.innerApiCalls.wait as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZoneOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZoneOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IOperation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZoneOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZoneOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + 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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZoneOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Operation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.compute.v1.Operation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZoneOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + generateSampleMessage(new protos.google.cloud.compute.v1.Operation()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new zoneoperationsModule.v1.ZoneOperationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZoneOperationsRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IOperation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/gapic_zones_v1.ts b/test/gapic_zones_v1.ts new file mode 100644 index 00000000..c77d80f7 --- /dev/null +++ b/test/gapic_zones_v1.ts @@ -0,0 +1,584 @@ +// 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, beforeEach, afterEach} from 'mocha'; +import * as zonesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {GoogleAuth, 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.ZonesClient', () => { + let googleAuth: GoogleAuth; + beforeEach(() => { + googleAuth = { + getClient: sinon.stub().resolves({ + getRequestHeaders: sinon + .stub() + .resolves({Authorization: 'Bearer SOME_TOKEN'}), + }), + } as unknown as GoogleAuth; + }); + afterEach(() => { + sinon.restore(); + }); + it('has servicePath', () => { + const servicePath = zonesModule.v1.ZonesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = zonesModule.v1.ZonesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = zonesModule.v1.ZonesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new zonesModule.v1.ZonesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new zonesModule.v1.ZonesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new zonesModule.v1.ZonesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + assert.strictEqual(client.zonesStub, undefined); + await client.initialize(); + assert(client.zonesStub); + }); + + it('has close method', () => { + const client = new zonesModule.v1.ZonesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new zonesModule.v1.ZonesClient({ + auth: googleAuth, + 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 zonesModule.v1.ZonesClient({ + auth: googleAuth, + 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('get', () => { + it('invokes get without error', async () => { + const client = new zonesModule.v1.ZonesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetZoneRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Zone() + ); + client.innerApiCalls.get = stubSimpleCall(expectedResponse); + const [response] = await client.get(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes get without error using callback', async () => { + const client = new zonesModule.v1.ZonesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetZoneRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.compute.v1.Zone() + ); + client.innerApiCalls.get = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.get( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IZone | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes get with error', async () => { + const client = new zonesModule.v1.ZonesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.GetZoneRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.get = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.get(request), expectedError); + assert( + (client.innerApiCalls.get as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('list', () => { + it('invokes list without error', async () => { + const client = new zonesModule.v1.ZonesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZonesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + ]; + client.innerApiCalls.list = stubSimpleCall(expectedResponse); + const [response] = await client.list(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes list without error using callback', async () => { + const client = new zonesModule.v1.ZonesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZonesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + ]; + client.innerApiCalls.list = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.list( + request, + ( + err?: Error | null, + result?: protos.google.cloud.compute.v1.IZone[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes list with error', async () => { + const client = new zonesModule.v1.ZonesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZonesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.list = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.list(request), expectedError); + assert( + (client.innerApiCalls.list as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listStream without error', async () => { + const client = new zonesModule.v1.ZonesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZonesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + ]; + client.descriptors.page.list.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Zone[] = []; + stream.on('data', (response: protos.google.cloud.compute.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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listStream with error', async () => { + const client = new zonesModule.v1.ZonesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZonesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.compute.v1.Zone[] = []; + stream.on('data', (response: protos.google.cloud.compute.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.list.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.list, request) + ); + assert.strictEqual( + (client.descriptors.page.list.createStream as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list without error', async () => { + const client = new zonesModule.v1.ZonesClient({ + auth: googleAuth, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZonesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + generateSampleMessage(new protos.google.cloud.compute.v1.Zone()), + ]; + client.descriptors.page.list.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.compute.v1.IZone[] = []; + const iterable = client.listAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with list with error', async () => { + const client = new zonesModule.v1.ZonesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.compute.v1.ListZonesRequest() + ); + request.project = ''; + const expectedHeaderRequestParams = 'project='; + const expectedError = new Error('expected'); + client.descriptors.page.list.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.compute.v1.IZone[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.list.asyncIterate as SinonStub).getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); +}); diff --git a/test/health-check.js b/test/health-check.js deleted file mode 100644 index fc1da9d2..00000000 --- a/test/health-check.js +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2016 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'HealthCheck') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('HealthCheck', () => { - let HealthCheck; - let healthCheck; - - const COMPUTE = { - createHealthCheck: util.noop, - }; - const HEALTH_CHECK_NAME = 'health-check-name'; - const OPTIONS = {}; - - before(() => { - HealthCheck = proxyquire('../src/health-check.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - healthCheck = new HealthCheck(COMPUTE, HEALTH_CHECK_NAME, OPTIONS); - }); - - afterEach(() => { - COMPUTE.createHealthCheck = util.noop; - }); - - describe('instantiation', () => { - it('should inherit from ServiceObject', () => { - assert(healthCheck instanceof FakeServiceObject); - - const calledWith = healthCheck.calledWith_[0]; - - assert.strictEqual(calledWith.parent, COMPUTE); - assert.strictEqual(calledWith.id, HEALTH_CHECK_NAME); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - describe('http', () => { - it('should set the correct baseUrl', () => { - const calledWith = healthCheck.calledWith_[0]; - assert.strictEqual(calledWith.baseUrl, '/global/httpHealthChecks'); - }); - - it('should not set options.https when created', done => { - const createMethod = healthCheck.calledWith_[0].createMethod; - const NAME = 'name'; - const OPTIONS = {a: 'b'}; - const originalOptions = Object.assign({}, OPTIONS); - COMPUTE.createHealthCheck = function (name, opts, callback) { - assert.strictEqual(name, NAME); - assert.deepStrictEqual(opts, OPTIONS); - assert.deepStrictEqual(OPTIONS, originalOptions); - callback(); // done() - }; - createMethod(NAME, OPTIONS, done); - }); - - it('should not require a callback when creating', done => { - const createMethod = healthCheck.calledWith_[0].createMethod; - - COMPUTE.createHealthCheck = function (name, opts, callback) { - assert.deepStrictEqual(opts, {}); - callback(); // done() - }; - - createMethod('name', done); - }); - }); - - describe('https', () => { - let healthCheck; - - beforeEach(() => { - healthCheck = new HealthCheck(COMPUTE, HEALTH_CHECK_NAME, { - https: true, - }); - }); - - it('should set the correct baseUrl', () => { - const calledWith = healthCheck.calledWith_[0]; - - assert.strictEqual(calledWith.baseUrl, '/global/httpsHealthChecks'); - }); - - it('should set options.https = true when created', done => { - const createMethod = healthCheck.calledWith_[0].createMethod; - - const NAME = 'name'; - const OPTIONS = {a: 'b'}; - const originalOptions = Object.assign({}, OPTIONS); - - COMPUTE.createHealthCheck = function (name, opts, callback) { - assert.strictEqual(name, NAME); - assert.deepStrictEqual(opts, Object.assign({https: true}, OPTIONS)); - assert.deepStrictEqual(OPTIONS, originalOptions); - callback(); // done() - }; - - createMethod(NAME, OPTIONS, done); - }); - - it('should not require a callback when creating', done => { - const createMethod = healthCheck.calledWith_[0].createMethod; - - COMPUTE.createHealthCheck = function (name, opts, callback) { - assert.deepStrictEqual(opts, {https: true}); - callback(); // done() - }; - - createMethod('name', done); - }); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, healthCheck); - done(); - }; - - healthCheck.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - healthCheck.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - healthCheck.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - healthCheck.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - healthCheck.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - healthCheck.delete(); - }); - }); - }); - }); - - describe('setMetadata', () => { - const METADATA = {}; - - it('should call ServiceObject.setMetadata', done => { - FakeServiceObject.prototype.setMetadata = function (metadata) { - assert.strictEqual(this, healthCheck); - assert.strictEqual(metadata, METADATA); - done(); - }; - - healthCheck.setMetadata(METADATA, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {}; - - beforeEach(() => { - FakeServiceObject.prototype.setMetadata = function ( - metadata, - callback - ) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - healthCheck.setMetadata(METADATA, (err, op, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(op, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.setMetadata = function ( - metadata, - callback - ) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with operation & response', done => { - const operation = {}; - const metadata = {a: 'b'}; - - healthCheck.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - healthCheck.setMetadata(metadata, (err, op, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - healthCheck.setMetadata({a: 'b'}); - }); - }); - }); - }); -}); diff --git a/test/image.js b/test/image.js deleted file mode 100644 index 490de9d2..00000000 --- a/test/image.js +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2018 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Image') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Image', () => { - let Image; - let image; - - const COMPUTE = { - projectId: 'project-id', - operation: util.noop, - }; - const IMAGE_NAME = 'image-name'; - - before(() => { - Image = proxyquire('../src/image.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - image = new Image(COMPUTE, IMAGE_NAME); - image.parent = COMPUTE; - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should inherit from ServiceObject', () => { - const computeInstance = Object.assign({}, COMPUTE); - - const image = new Image(computeInstance, IMAGE_NAME); - assert(image instanceof ServiceObject); - - const calledWith = image.calledWith_[0]; - - assert.strictEqual(calledWith.parent, computeInstance); - assert.strictEqual(calledWith.baseUrl, '/global/images'); - assert.strictEqual(calledWith.id, IMAGE_NAME); - assert.deepStrictEqual(calledWith.methods, { - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('create', () => { - it('should pass correct arguments to compute.createImage method', done => { - const disk = {}; - const options = {}; - - image.parent.createImage = (id, disk_, options_, callback) => { - assert.strictEqual(id, image.id); - assert.strictEqual(disk_, disk); - assert.strictEqual(options_, options); - callback(); // done() - }; - - image.create(disk, options, done); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, image); - done(); - }; - - image.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - image.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - image.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - image.parent.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - image.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - image.delete(); - }); - }); - }); - }); -}); diff --git a/test/index.js b/test/index.js deleted file mode 100644 index 5bddffcd..00000000 --- a/test/index.js +++ /dev/null @@ -1,2968 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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 arrify = require('arrify'); -const assert = require('assert'); -const events = require('events'); -const extend = require('extend'); -const format = require('string-format-obj'); -const proxyquire = require('proxyquire'); -const {Service, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -const slice = Array.prototype.slice; - -const fakeUtil = Object.assign({}, util, { - makeAuthenticatedRequestFactory: util.noop, -}); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class, options) { - if (Class.name !== 'Compute') { - return; - } - promisified = true; - assert.deepStrictEqual(options.exclude, [ - 'address', - 'autoscaler', - 'disk', - 'firewall', - 'image', - 'healthCheck', - 'instanceGroup', - 'machineType', - 'network', - 'operation', - 'project', - 'region', - 'rule', - 'service', - 'snapshot', - 'subnetwork', - 'vm', - 'zone', - ]); - }, -}); -const originalFakeUtil = extend(true, {}, fakeUtil); - -const fakePaginator = { - paginator: { - extend: function (Class, methods) { - if (Class.name !== 'Compute') { - return; - } - - methods = arrify(methods); - assert.deepStrictEqual(methods, [ - 'getAddresses', - 'getAutoscalers', - 'getDisks', - 'getFirewalls', - 'getImages', - 'getHealthChecks', - 'getInstanceGroups', - 'getMachineTypes', - 'getNetworks', - 'getOperations', - 'getRegions', - 'getRules', - 'getServices', - 'getSnapshots', - 'getSubnetworks', - 'getVMs', - 'getZones', - ]); - }, - streamify: function (methodName) { - return methodName; - }, - }, -}; - -function FakeFirewall() { - this.calledWith_ = slice.call(arguments); -} - -function FakeHealthCheck() { - this.calledWith_ = slice.call(arguments); -} - -function FakeImage() { - this.calledWith_ = slice.call(arguments); -} - -function FakeNetwork() { - this.calledWith_ = slice.call(arguments); -} - -function FakeOperation() { - this.calledWith_ = slice.call(arguments); -} - -function FakeProject() { - this.calledWith_ = slice.call(arguments); -} - -function FakeRegion() { - this.calledWith_ = slice.call(arguments); - this.address = function () { - return {}; - }; - this.subnetwork = function () { - return {}; - }; -} - -function FakeRule() { - this.calledWith_ = slice.call(arguments); -} - -class FakeServiceClass { - constructor() { - this.calledWith_ = slice.call(arguments); - } -} - -function FakeSnapshot() { - this.calledWith_ = slice.call(arguments); -} - -function FakeZone() { - this.calledWith_ = slice.call(arguments); - this.disk = function () { - return {}; - }; - this.vm = function () { - return {}; - }; - this.machineType = function () { - return {}; - }; -} - -class FakeService extends Service { - constructor(config, options) { - super(config, options); - this.calledWith_ = arguments; - } -} - -describe('Compute', () => { - let Compute; - let compute; - - const PROJECT_ID = 'project-id'; - - before(function () { - // Node v4 on Circle times out. - this.timeout(0); - - Compute = proxyquire('../', { - '@google-cloud/common': { - Service: FakeService, - util: fakeUtil, - }, - '@google-cloud/paginator': fakePaginator, - '@google-cloud/promisify': fakePromisify, - './firewall.js': FakeFirewall, - './health-check.js': FakeHealthCheck, - './image.js': FakeImage, - './network.js': FakeNetwork, - './operation.js': FakeOperation, - './project.js': FakeProject, - './region.js': FakeRegion, - './rule.js': FakeRule, - './service.js': FakeServiceClass, - './snapshot.js': FakeSnapshot, - './zone.js': FakeZone, - }); - }); - - beforeEach(() => { - Object.assign(fakeUtil, originalFakeUtil); - compute = new Compute({ - projectId: PROJECT_ID, - }); - }); - - describe('instantiation', () => { - it('should return a new instance of Compute', () => { - const compute = new Compute({projectId: PROJECT_ID}); - assert(compute instanceof Compute); - }); - - it('should inherit from Service', () => { - assert(compute instanceof Service); - - const calledWith = compute.calledWith_[0]; - - const apiEndpoint = 'compute.googleapis.com'; - const baseUrl = `https://${apiEndpoint}/compute/v1`; - assert.strictEqual(calledWith.apiEndpoint, apiEndpoint); - assert.strictEqual(calledWith.baseUrl, baseUrl); - assert.deepStrictEqual(calledWith.scopes, [ - 'https://www.googleapis.com/auth/compute', - ]); - assert.deepStrictEqual( - calledWith.packageJson, - require('../package.json') - ); - }); - - it('should streamify the correct methods', () => { - assert.strictEqual(compute.getAddressesStream, 'getAddresses'); - assert.strictEqual(compute.getAutoscalersStream, 'getAutoscalers'); - assert.strictEqual(compute.getDisksStream, 'getDisks'); - assert.strictEqual(compute.getInstanceGroupsStream, 'getInstanceGroups'); - assert.strictEqual(compute.getImagesStream, 'getImages'); - assert.strictEqual(compute.getFirewallsStream, 'getFirewalls'); - assert.strictEqual(compute.getHealthChecksStream, 'getHealthChecks'); - assert.strictEqual(compute.getMachineTypesStream, 'getMachineTypes'); - assert.strictEqual(compute.getNetworksStream, 'getNetworks'); - assert.strictEqual(compute.getOperationsStream, 'getOperations'); - assert.strictEqual(compute.getRegionsStream, 'getRegions'); - assert.strictEqual(compute.getRulesStream, 'getRules'); - assert.strictEqual(compute.getServicesStream, 'getServices'); - assert.strictEqual(compute.getSnapshotsStream, 'getSnapshots'); - assert.strictEqual(compute.getSubnetworksStream, 'getSubnetworks'); - assert.strictEqual(compute.getVMsStream, 'getVMs'); - assert.strictEqual(compute.getZonesStream, 'getZones'); - }); - - it('should allow overriding the API endpoint', () => { - const apiEndpoint = 'custom.endpoint.com'; - const compute = new Compute({apiEndpoint}); - const calledWith = compute.calledWith_[0]; - - assert.strictEqual(calledWith.apiEndpoint, apiEndpoint); - assert.strictEqual( - calledWith.baseUrl, - `https://${apiEndpoint}/compute/v1` - ); - }); - - it('should localize the poll interval', () => { - const pollIntervalMs = 9; - const compute = new Compute({pollIntervalMs}); - assert.strictEqual(compute.pollIntervalMs, pollIntervalMs); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - }); - - describe('createFirewall', () => { - it('should throw if a name is not provided', () => { - assert.throws(() => { - compute.createFirewall({}, assert.ifError); - }, /A firewall name must be provided./); - }); - - it('should throw if config is not provided', () => { - assert.throws(() => { - compute.createFirewall('name', assert.ifError); - }, /A firewall configuration object must be provided./); - }); - - describe('config.protocols', () => { - it('should format protocols', done => { - const options = { - allowed: { - IPProtocol: 'http', - ports: [8000], - }, - protocols: { - https: [8080, 9000], - ssh: 22, - ftp: [], - ah: false, - icmp: true, - }, - }; - - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json.allowed, [ - {IPProtocol: 'http', ports: [8000]}, - {IPProtocol: 'https', ports: [8080, 9000]}, - {IPProtocol: 'ssh', ports: [22]}, - {IPProtocol: 'icmp', ports: []}, - ]); - assert.strictEqual(reqOpts.json.protocols, undefined); - done(); - }; - - compute.createFirewall('name', options, assert.ifError); - }); - }); - - describe('config.ranges', () => { - it('should format ranges to sourceRanges', done => { - const options = { - ranges: '0.0.0.0/0', // non-array to test that it's arrified. - }; - - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json.sourceRanges, [options.ranges]); - assert.strictEqual(reqOpts.json.ranges, undefined); - done(); - }; - - compute.createFirewall('name', options, assert.ifError); - }); - }); - - describe('config.tags', () => { - it('should format tags to sourceTags', done => { - const options = { - tags: 'tag', // non-array to test that it's arrified. - }; - - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json.sourceTags, [options.tags]); - assert.strictEqual(reqOpts.json.tags, undefined); - done(); - }; - - compute.createFirewall('name', options, assert.ifError); - }); - }); - - it('should make the correct API request', done => { - const name = 'new-firewall-name'; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/global/firewalls'); - assert.deepStrictEqual(reqOpts.json, {name: name}); - done(); - }; - - compute.createFirewall(name, {}, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should exec the callback with error & API response', done => { - compute.createFirewall('name', {}, (err, firewall, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(firewall, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec cb with Firewall, Operation & apiResp', done => { - const name = 'name'; - const firewall = {}; - const operation = {}; - - compute.firewall = function (name_) { - assert.strictEqual(name_, name); - return firewall; - }; - - compute.operation = function (name_) { - assert.strictEqual(name_, apiResponse.name); - return operation; - }; - - compute.createFirewall('name', {}, (err, fw, op, resp) => { - assert.strictEqual(err, null); - assert.strictEqual(fw, firewall); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - - describe('createHealthCheck', () => { - it('should throw if a name is not provided', () => { - assert.throws(() => { - compute.createHealthCheck({}, assert.ifError); - }, /A health check name must be provided./); - }); - - describe('options.interval', () => { - it('should set checkIntervalSec', done => { - const options = {interval: 50}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.checkIntervalSec, options.interval); - assert.strictEqual(reqOpts.json.interval, undefined); - done(); - }; - - compute.createHealthCheck('name', options, assert.ifError); - }); - }); - - describe('config.timeout', () => { - it('should set timeoutSec', done => { - const options = {timeout: 50}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.timeoutSec, options.timeout); - assert.strictEqual(reqOpts.json.timeout, undefined); - done(); - }; - - compute.createHealthCheck('name', options, assert.ifError); - }); - }); - - describe('options.https', () => { - it('should make the correct API request', done => { - const name = 'https-health-check-name'; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.https, undefined); - assert.strictEqual(reqOpts.json.name, name); - assert.strictEqual(reqOpts.uri, '/global/httpsHealthChecks'); - done(); - }; - - compute.createHealthCheck(name, {https: true}, assert.ifError); - }); - }); - - it('should make the correct default API request', done => { - const name = 'new-health-check-name'; - const options = {a: 'b'}; - const originalOptions = Object.assign({}, options); - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/global/httpHealthChecks'); - assert.deepStrictEqual(reqOpts.json, {a: 'b', name: name}); - assert.deepStrictEqual(options, originalOptions); - done(); - }; - - compute.createHealthCheck(name, options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should exec the callback with error & API response', done => { - compute.createHealthCheck('name', {}, (err, hc, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(hc, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec cb with HealthCheck, Op, & apiResp', done => { - const name = 'name'; - const healthCheck = {}; - const operation = {}; - - compute.healthCheck = function (name_, options) { - assert.strictEqual(name_, name); - assert.deepStrictEqual(options.https, undefined); - return healthCheck; - }; - - compute.operation = function (name_) { - assert.strictEqual(name_, apiResponse.name); - return operation; - }; - - compute.createHealthCheck('name', {}, (err, hc, op, resp) => { - assert.strictEqual(err, null); - assert.strictEqual(hc, healthCheck); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - - it('should create an HTTPS HealthCheck object', done => { - const name = 'name'; - - compute.healthCheck = function (name_, options) { - assert.strictEqual(name_, name); - assert.strictEqual(options.https, true); - done(); - }; - - compute.createHealthCheck('name', {https: true}, assert.ifError); - }); - }); - }); - - describe('createImage', () => { - const NAME = 'image-name'; - - const DISK = { - name: 'disk-name', - zone: { - name: 'zone-name', - }, - }; - - beforeEach(() => { - fakeUtil.isCustomType = function () { - return true; - }; - }); - - it('should throw if Disk is not provided', () => { - fakeUtil.isCustomType = function (unknown, type) { - assert.strictEqual(unknown, DISK); - assert.strictEqual(type, 'Disk'); - return false; - }; - - assert.throws(() => { - compute.createImage(NAME, DISK); - }, /A Disk object is required\./); - }); - - it('should make the correct API request', done => { - const options = { - a: 'b', - c: 'd', - }; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/global/images'); - assert.deepStrictEqual(reqOpts.json, { - name: NAME, - sourceDisk: format('zones/{zoneName}/disks/{diskName}', { - zoneName: DISK.zone.name, - diskName: DISK.name, - }), - a: 'b', - c: 'd', - }); - - done(); - }; - - compute.createImage(NAME, DISK, options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should exec the callback with error & API response', done => { - compute.createImage(NAME, DISK, (err, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec cb with Operation & apiResp', done => { - const network = {}; - const operation = {}; - - compute.network = function (name) { - assert.strictEqual(name, NAME); - return network; - }; - - compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - compute.createImage(NAME, DISK, (err, image, op, resp) => { - assert.strictEqual(err, null); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - - describe('createNetwork', () => { - describe('config.range', () => { - it('should set the IPv4Range', done => { - const options = { - range: '10.240.0.0/16', - }; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.IPv4Range, options.range); - assert.strictEqual(reqOpts.json.range, undefined); - done(); - }; - - compute.createNetwork('name', options, assert.ifError); - }); - }); - - describe('config.gateway', () => { - it('should set the gatewayIPv4', done => { - const options = { - gateway: '10.1.1.1', - }; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.gatewayIPv4, options.gateway); - assert.strictEqual(reqOpts.json.gateway, undefined); - done(); - }; - - compute.createNetwork('name', options, assert.ifError); - }); - }); - - it('should make the correct API request', done => { - const name = 'new-network'; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/global/networks'); - assert.deepStrictEqual(reqOpts.json, {name: name}); - done(); - }; - - compute.createNetwork(name, {}, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should exec the callback with error & API response', done => { - compute.createNetwork('name', {}, (err, network, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(network, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const NAME = 'network-name'; - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec cb with Network, Operation & apiResp', done => { - const network = {}; - const operation = {}; - - compute.network = function (name_) { - assert.strictEqual(name_, NAME); - return network; - }; - - compute.operation = function (name_) { - assert.strictEqual(name_, apiResponse.name); - return operation; - }; - - compute.createNetwork(NAME, {}, (err, network_, op, resp) => { - assert.strictEqual(err, null); - assert.strictEqual(network_, network); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - - describe('createRule', () => { - const NAME = 'new-rule'; - - it('should make the correct API request', done => { - const config = {a: 'b'}; - const originalConfig = Object.assign({}, config); - const expectedConfig = Object.assign({}, config, {name: NAME}); - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/global/forwardingRules'); - assert.deepStrictEqual(config, originalConfig); - assert.deepStrictEqual(reqOpts.json, expectedConfig); - done(); - }; - - compute.createRule(NAME, config, assert.ifError); - }); - - describe('config.ip', () => { - const CONFIG = { - ip: '0.0.0.0', - }; - - it('should accept an array of tags', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, { - name: NAME, - IPAddress: CONFIG.ip, - }); - done(); - }; - - compute.createRule(NAME, CONFIG, assert.ifError); - }); - }); - - describe('config.protocol', () => { - const CONFIG = { - protocol: 'TCP', - }; - - it('should accept an array of tags', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, { - name: NAME, - IPProtocol: CONFIG.protocol, - }); - done(); - }; - - compute.createRule(NAME, CONFIG, assert.ifError); - }); - }); - - describe('config.range', () => { - const CONFIG = { - range: '200-300', - }; - - it('should accept an array of tags', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, { - name: NAME, - portRange: CONFIG.range, - }); - done(); - }; - - compute.createRule(NAME, CONFIG, assert.ifError); - }); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should exec the callback with error & API response', done => { - compute.createRule(NAME, {}, (err, rule, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(rule, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec cb with Rule, Operation & apiResp', done => { - const rule = {}; - const operation = {}; - - compute.rule = function (name) { - assert.strictEqual(name, NAME); - return rule; - }; - - compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - compute.createRule(NAME, {}, (err, rule_, op, resp) => { - assert.strictEqual(err, null); - assert.strictEqual(rule_, rule); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - - describe('createService', () => { - const NAME = 'new-service'; - - it('should make the correct API request', done => { - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/global/backendServices'); - assert.deepStrictEqual(reqOpts.json, {name: NAME}); - done(); - }; - - compute.createService(NAME, {}, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should exec the callback with error & API response', done => { - compute.createService(NAME, {}, (err, service, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(service, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec cb with Service, Operation & apiResp', done => { - const service = {}; - const operation = {}; - - compute.service = function (name) { - assert.strictEqual(name, NAME); - return service; - }; - - compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - compute.createService(NAME, {}, (err, service_, op, resp) => { - assert.strictEqual(err, null); - assert.strictEqual(service_, service); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - - describe('firewall', () => { - const NAME = 'firewall-name'; - - it('should return a Firewall object', () => { - const firewall = compute.firewall(NAME); - assert(firewall instanceof FakeFirewall); - assert.strictEqual(firewall.calledWith_[0], compute); - assert.strictEqual(firewall.calledWith_[1], NAME); - }); - }); - - describe('getAddresses', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getAddresses(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/aggregated/addresses'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getAddresses(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getAddresses({}, (err, addresses, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(addresses, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const REGION_NAME = 'region-1'; - const FULL_REGION_NAME = 'regions/' + REGION_NAME; - - const address = {name: 'address-1'}; - const apiResponse = { - items: {}, - }; - - apiResponse.items[FULL_REGION_NAME] = { - addresses: [address], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Address objects from the response', done => { - const region = {}; - - compute.region = function (name) { - assert.strictEqual(name, REGION_NAME); - return region; - }; - - region.address = function (name) { - assert.strictEqual(name, address.name); - setImmediate(done); - return address; - }; - - compute.getAddresses({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getAddresses(query, (err, addresses, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getAutoscalers', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getAutoscalers(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/aggregated/autoscalers'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getAutoscalers(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getAutoscalers({}, (err, autoscalers, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(autoscalers, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const ZONE_NAME = 'us-central1-a'; - const FULL_ZONE_NAME = 'zones/' + ZONE_NAME; - - const autoscaler = {name: 'autoscaler-1'}; - const apiResponse = { - items: {}, - }; - - apiResponse.items['not-zone-name'] = { - autoscalers: [autoscaler], - }; - - apiResponse.items[FULL_ZONE_NAME] = { - autoscalers: [autoscaler], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Autoscaler objects from the response', done => { - const zone = {}; - - compute.zone = function (name) { - assert.strictEqual(name, ZONE_NAME); - return zone; - }; - - zone.autoscaler = function (name) { - assert.strictEqual(name, autoscaler.name); - setImmediate(done); - return autoscaler; - }; - - compute.getAutoscalers({}, assert.ifError); - }); - - it('should not create zone-less Autoscalers', done => { - const zone = {}; - - compute.zone = function () { - return zone; - }; - - zone.autoscaler = function () { - return autoscaler; - }; - - compute.getAutoscalers({}, (err, autoscalers) => { - assert.ifError(err); - assert(Object.keys(apiResponse.items).length > 1); - assert.strictEqual(autoscalers.length, 1); - done(); - }); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - delete apiResponseWithNextPageToken.items; - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getAutoscalers(query, (err, autoscalers, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getDisks', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getDisks(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/aggregated/disks'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getDisks(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getDisks({}, (err, disks, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(disks, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const ZONE_NAME = 'zone-1'; - const FULL_ZONE_NAME = 'zones/' + ZONE_NAME; - - const disk = {name: 'disk-1'}; - const apiResponse = { - items: {}, - }; - - apiResponse.items[FULL_ZONE_NAME] = { - disks: [disk], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Disk objects from the response', done => { - const zone = {}; - - compute.zone = function (name) { - assert.strictEqual(name, ZONE_NAME); - return zone; - }; - - zone.disk = function (name) { - assert.strictEqual(name, disk.name); - setImmediate(done); - return disk; - }; - - compute.getDisks({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getDisks(query, (err, disks, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getFirewalls', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getFirewalls(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/firewalls'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getFirewalls(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getFirewalls({}, (err, firewalls, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(firewalls, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const firewall = {name: 'firewall-1'}; - const apiResponse = { - items: [firewall], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Firewall objects from the response', done => { - compute.firewall = function (name) { - assert.strictEqual(name, firewall.name); - setImmediate(done); - return firewall; - }; - - compute.getFirewalls({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getFirewalls(query, (err, firewalls, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getHealthChecks', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getHealthChecks(assert.ifError); - }); - - it('should make the correct default API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/httpHealthChecks'); - assert.deepStrictEqual(reqOpts.qs, options); - done(); - }; - - compute.getHealthChecks(options, assert.ifError); - }); - - describe('options.https', () => { - it('should make the correct API request', done => { - const options = {https: true}; - const originalOptions = Object.assign({}, options); - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/httpsHealthChecks'); - assert.deepStrictEqual(reqOpts.qs, {}); - assert.deepStrictEqual(options, originalOptions); - done(); - }; - - compute.getHealthChecks(options, assert.ifError); - }); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getHealthChecks({}, (err, hcs, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(hcs, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const healthCheck = {name: 'health-check-1'}; - const apiResponse = {items: [healthCheck]}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create HealthCheck objects from the response', done => { - compute.healthCheck = function (name, options) { - assert.strictEqual(name, healthCheck.name); - assert.strictEqual(options.https, undefined); - setImmediate(done); - return healthCheck; - }; - - compute.getHealthChecks({}, assert.ifError); - }); - - it('should create HTTPS Health Check objects', done => { - compute.healthCheck = function (name, options) { - assert.strictEqual(name, healthCheck.name); - assert.strictEqual(options.https, true); - setImmediate(done); - return healthCheck; - }; - - compute.getHealthChecks({https: true}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getHealthChecks(query, (err, firewalls, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getImages', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getImages(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/images'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getImages(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getImages({}, (err, images, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(images, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const image = {name: 'image-1'}; - const apiResponse = { - items: [image], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Image objects from the response', done => { - compute.image = function (name) { - assert.strictEqual(name, image.name); - setImmediate(done); - return image; - }; - - compute.getImages({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getImages(query, (err, images, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getInstanceGroups', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getInstanceGroups(assert.ifError); - }); - - it('should make the correct default API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/aggregated/instanceGroups'); - assert.deepStrictEqual(reqOpts.qs, options); - done(); - }; - - compute.getInstanceGroups(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getInstanceGroups({}, (err, groups, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(groups, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const ZONE_NAME = 'zone-1'; - const FULL_ZONE_NAME = 'zones/' + ZONE_NAME; - - const instanceGroup = {name: 'instance-group-1'}; - const apiResponse = { - items: {}, - }; - - apiResponse.items[FULL_ZONE_NAME] = { - instanceGroups: [instanceGroup], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create InstanceGroup objects from the resp', done => { - const zone = {}; - - compute.zone = function (name) { - assert.strictEqual(name, ZONE_NAME); - return zone; - }; - - zone.instanceGroup = function (name) { - assert.strictEqual(name, instanceGroup.name); - setImmediate(done); - return instanceGroup; - }; - - compute.getInstanceGroups({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - delete apiResponseWithNextPageToken.items; - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getInstanceGroups(query, (err, groups, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getMachineTypes', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getMachineTypes(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/aggregated/machineTypes'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getMachineTypes(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getMachineTypes({}, (err, machTypes, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(machTypes, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const ZONE_NAME = 'zone-1'; - const FULL_ZONE_NAME = 'zones/' + ZONE_NAME; - - const machineType = {name: 'machineType-1'}; - const apiResponse = { - items: {}, - }; - - apiResponse.items[FULL_ZONE_NAME] = { - machineTypes: [machineType], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create MachineType objects from the response', done => { - const zone = {}; - const machineTypeInstance = {}; - - compute.zone = function (name) { - assert.strictEqual(name, ZONE_NAME); - return zone; - }; - - zone.machineType = function (name) { - assert.strictEqual(name, machineType.name); - return machineTypeInstance; - }; - - compute.getMachineTypes({}, (err, machTypes, nextQuery, resp) => { - assert.ifError(err); - assert.strictEqual(machTypes[0], machineTypeInstance); - assert.strictEqual(machTypes[0].metadata, machineType); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getMachineTypes(query, (err, machineTypes, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getNetworks', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getNetworks(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/networks'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getNetworks(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getNetworks({}, (err, networks, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(networks, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const network = {name: 'network-1'}; - const apiResponse = { - items: [network], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Network objects from the response', done => { - compute.network = function (name) { - assert.strictEqual(name, network.name); - setImmediate(done); - return network; - }; - - compute.getNetworks({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getNetworks(query, (err, networks, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getOperations', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getOperations(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/operations'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getOperations(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getOperations({}, (err, ops, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(ops, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const operation = {name: 'op-1'}; - const apiResponse = { - items: [operation], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Operation objects from the response', done => { - compute.operation = function (name) { - assert.strictEqual(name, operation.name); - setImmediate(done); - return operation; - }; - - compute.getOperations({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getOperations(query, (err, operations, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getRegions', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getRegions(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/regions'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getRegions(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getRegions({}, (err, regions, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(regions, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const region = {name: 'region-1'}; - const apiResponse = { - items: [region], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Region objects from the response', done => { - compute.region = function (name) { - assert.strictEqual(name, region.name); - setImmediate(done); - return region; - }; - - compute.getRegions({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getRegions(query, (err, regions, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getRules', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getRules(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/forwardingRules'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getRules(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getRules({}, (err, rules, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(rules, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const rule = { - name: 'rule-1', - }; - const apiResponse = { - items: [rule], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Rule objects from the response', done => { - compute.rule = function (name) { - assert.strictEqual(name, rule.name); - return rule; - }; - - compute.getRules({}, (err, rules) => { - assert.ifError(err); - assert.deepStrictEqual(rules, [rule]); - done(); - }); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = { - a: 'b', - c: 'd', - }; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getRules(query, (err, rules, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getServices', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getServices(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/backendServices'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getServices(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getServices({}, (err, services, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(services, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const service = { - name: 'service-1', - }; - const apiResponse = { - items: [service], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Service objects from the response', done => { - compute.service = function (name) { - assert.strictEqual(name, service.name); - setImmediate(done); - return service; - }; - - compute.getServices({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = { - a: 'b', - c: 'd', - }; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getServices(query, (err, services, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getSnapshots', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getSnapshots(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/global/snapshots'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getSnapshots(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getSnapshots({}, (err, snapshots, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(snapshots, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const snapshot = {name: 'snapshot-1'}; - const apiResponse = { - items: [snapshot], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Snapshot objects from the response', done => { - compute.snapshot = function (name) { - assert.strictEqual(name, snapshot.name); - setImmediate(done); - return snapshot; - }; - - compute.getSnapshots({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getSnapshots(query, (err, snapshots, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getSubnetworks', () => { - it('should accept only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getSubnetworks(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/aggregated/subnetworks'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getSubnetworks(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getSubnetworks({}, (err, subnetworks, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(subnetworks, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const REGION_NAME = 'region-1'; - const FULL_REGION_NAME = 'regions/' + REGION_NAME; - - const subnetwork = {name: 'subnetwork-1'}; - const apiResponse = { - items: {}, - }; - - apiResponse.items[FULL_REGION_NAME] = { - subnetworks: [subnetwork], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Subnetwork objects from the response', done => { - const region = {}; - const fakeSubnetwork = {}; - - compute.region = function (name) { - assert.strictEqual(name, REGION_NAME); - return region; - }; - - region.subnetwork = function (name) { - assert.strictEqual(name, subnetwork.name); - return fakeSubnetwork; - }; - - compute.getSubnetworks({}, (err, subnetworks, nextQuery, resp) => { - assert.ifError(err); - - assert.strictEqual(subnetworks[0], fakeSubnetwork); - assert.strictEqual(subnetworks[0].metadata, subnetwork); - - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getSubnetworks(query, (err, subnetworks, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getVMs', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getVMs(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/aggregated/instances'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getVMs(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getVMs({}, (err, vms, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(vms, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const ZONE_NAME = 'zone-1'; - const FULL_ZONE_NAME = 'zones/' + ZONE_NAME; - - const vm = {name: 'vm-1'}; - const apiResponse = { - items: {}, - }; - - apiResponse.items[FULL_ZONE_NAME] = { - instances: [vm], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create VM objects from the response', done => { - const zone = {}; - - compute.zone = function (name) { - assert.strictEqual(name, ZONE_NAME); - return zone; - }; - - zone.vm = function (name) { - assert.strictEqual(name, vm.name); - setImmediate(done); - return vm; - }; - - compute.getVMs({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getVMs(query, (err, vms, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('getZones', () => { - it('should work with only a callback', done => { - compute.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - compute.getZones(assert.ifError); - }); - - it('should make the correct API request', done => { - const options = {}; - - compute.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/zones'); - assert.strictEqual(reqOpts.qs, options); - done(); - }; - - compute.getZones(options, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - compute.getZones({}, (err, zones, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(zones, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const zone = {name: 'zone-1'}; - const apiResponse = { - items: [zone], - }; - - beforeEach(() => { - compute.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should create Zone objects from the response', done => { - compute.zone = function (name) { - assert.strictEqual(name, zone.name); - setImmediate(done); - return zone; - }; - - compute.getZones({}, assert.ifError); - }); - - it('should build a nextQuery if necessary', done => { - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: 'next-page-token', - }); - - const query = {a: 'b', c: 'd'}; - const originalQuery = Object.assign({}, query); - - compute.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - compute.getZones(query, (err, snapshots, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(query, originalQuery); - - assert.deepStrictEqual( - nextQuery, - Object.assign({}, query, { - pageToken: apiResponseWithNextPageToken.nextPageToken, - }) - ); - - done(); - }); - }); - }); - }); - - describe('healthCheck', () => { - const NAME = 'health-check-name'; - const OPTIONS = {}; - - it('should return a HealthCheck object', () => { - const healthCheck = compute.healthCheck(NAME, OPTIONS); - assert(healthCheck instanceof FakeHealthCheck); - assert.strictEqual(healthCheck.calledWith_[0], compute); - assert.strictEqual(healthCheck.calledWith_[1], NAME); - assert.strictEqual(healthCheck.calledWith_[2], OPTIONS); - }); - }); - - describe('image', () => { - const NAME = 'image-name'; - - it('should return an Image object', () => { - const image = compute.image(NAME); - assert(image instanceof FakeImage); - assert.strictEqual(image.calledWith_[0], compute); - assert.strictEqual(image.calledWith_[1], NAME); - }); - }); - - describe('network', () => { - const NAME = 'network-name'; - - it('should return a Network object', () => { - const network = compute.network(NAME); - assert(network instanceof FakeNetwork); - assert.strictEqual(network.calledWith_[0], compute); - assert.strictEqual(network.calledWith_[1], NAME); - }); - }); - - describe('operation', () => { - const NAME = 'op-name'; - - it('should return an Operation object', () => { - const op = compute.operation(NAME); - assert(op instanceof FakeOperation); - assert.strictEqual(op.calledWith_[0], compute); - assert.strictEqual(op.calledWith_[1], NAME); - }); - }); - - describe('project', () => { - it('should return a Project object', () => { - const project = compute.project(); - assert(project instanceof FakeProject); - assert.strictEqual(project.calledWith_[0], compute); - }); - }); - - describe('region', () => { - const NAME = 'region-name'; - - it('should return a Region object', () => { - const region = compute.region(NAME); - assert(region instanceof FakeRegion); - assert.strictEqual(region.calledWith_[0], compute); - assert.strictEqual(region.calledWith_[1], NAME); - }); - }); - - describe('rule', () => { - const NAME = 'rule-name'; - - it('should return a Rule object', () => { - const rule = compute.rule(NAME); - assert(rule instanceof FakeRule); - assert.strictEqual(rule.calledWith_[0], compute); - assert.strictEqual(rule.calledWith_[1], NAME); - }); - }); - - describe('service', () => { - const NAME = 'service-name'; - - it('should return a Service object', () => { - const service = compute.service(NAME); - assert(service instanceof FakeServiceClass); - assert.strictEqual(service.calledWith_[0], compute); - assert.strictEqual(service.calledWith_[1], NAME); - }); - }); - - describe('snapshot', () => { - const NAME = 'snapshot-name'; - - it('should return a Snapshot object', () => { - const snapshot = compute.snapshot(NAME); - assert(snapshot instanceof FakeSnapshot); - assert.strictEqual(snapshot.calledWith_[0], compute); - assert.strictEqual(snapshot.calledWith_[1], NAME); - }); - }); - - describe('zone', () => { - const NAME = 'zone-name'; - - it('should return a Zone object', () => { - const zone = compute.zone(NAME); - assert(zone instanceof FakeZone); - assert.strictEqual(zone.calledWith_[0], compute); - assert.strictEqual(zone.calledWith_[1], NAME); - }); - }); - - describe('execAfterOperation_', () => { - const OPERATION = new events.EventEmitter(); - - it('should execute callback with error & API response', done => { - const error = new Error('Error.'); - const apiResponse = {}; - - function onComplete(err, apiResponse_) { - assert.strictEqual(err, error); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - - const execWithOperation = compute.execAfterOperation_(onComplete); - - execWithOperation(error, OPERATION, apiResponse); - }); - - it('should support variable arity', done => { - const error = new Error('Error.'); - const apiResponse = {}; - - function onComplete(err, apiResponse_) { - assert.strictEqual(err, error); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - - const execWithOperation = compute.execAfterOperation_(onComplete); - - execWithOperation(error, null, null, OPERATION, apiResponse); - }); - - it('should register callback on operation error', done => { - const apiResponse = {}; - - function onComplete() {} - - OPERATION.once('newListener', (event, callback) => { - assert.strictEqual(event, 'error'); - assert.strictEqual(callback, onComplete); - done(); - }); - - const execWithOperation = compute.execAfterOperation_(onComplete); - execWithOperation(null, OPERATION, apiResponse); - }); - - it('should execute callback on operation complete', done => { - const apiResponse = {}; - - function onComplete(err, apiResponse_) { - assert.strictEqual(err, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - - const execWithOperation = compute.execAfterOperation_(onComplete); - execWithOperation(null, OPERATION, {}); - - OPERATION.emit('complete', apiResponse); - }); - }); -}); diff --git a/test/instance-group-manager.js b/test/instance-group-manager.js deleted file mode 100644 index e3b2f5e9..00000000 --- a/test/instance-group-manager.js +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'InstanceGroupManager') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('InstanceGroupManager', () => { - let InstanceGroupManager; - let instanceGroupManager; - - const staticMethods = {}; - - const ZONE = { - compute: {}, - }; - const NAME = 'instance-group-manager-name'; - - before(() => { - InstanceGroupManager = proxyquire('../src/instance-group-manager.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - Object.assign(InstanceGroupManager, staticMethods); - instanceGroupManager = new InstanceGroupManager(ZONE, NAME); - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should localize the zone instance', () => { - assert.strictEqual(instanceGroupManager.zone, ZONE); - }); - - it('should localize the name', () => { - assert.strictEqual(instanceGroupManager.name, NAME); - }); - - it('should inherit from ServiceObject', done => { - const zoneInstance = Object.assign({}, ZONE); - const instanceGroupManager = new InstanceGroupManager(zoneInstance, NAME); - assert(instanceGroupManager instanceof ServiceObject); - - const calledWith = instanceGroupManager.calledWith_[0]; - - assert.strictEqual(calledWith.parent, zoneInstance); - assert.strictEqual(calledWith.baseUrl, '/instanceGroupManagers'); - assert.strictEqual(calledWith.id, NAME); - assert.deepStrictEqual(calledWith.methods, { - exists: true, - get: true, - getMetadata: true, - }); - - done(); - }); - }); - - describe('abandonInstances', () => { - const VMS = [{url: 'vm-url'}, {url: 'vm-url-2'}]; - - it('should make the correct API request', done => { - instanceGroupManager.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/abandonInstances'); - assert.deepStrictEqual(reqOpts.json, { - instances: VMS.map(vm => { - return vm.url; - }), - }); - - done(); - }; - - instanceGroupManager.abandonInstances(VMS, assert.ifError); - }); - - describe('error', () => { - const apiResponse = {}; - const error = new Error('Error.'); - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error and API response', done => { - instanceGroupManager.abandonInstances( - VMS, - (err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - ); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'op-name'}; - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should return an Operation and API response', done => { - const operation = {}; - - instanceGroupManager.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - instanceGroupManager.abandonInstances( - VMS, - (err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - ); - }); - }); - }); - - describe('deleteInstances', () => { - const VMS = [{url: 'vm-url'}, {url: 'vm-url-2'}]; - - it('should make the correct API request', done => { - instanceGroupManager.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/deleteInstances'); - assert.deepStrictEqual(reqOpts.json, { - instances: VMS.map(vm => { - return vm.url; - }), - }); - - done(); - }; - - instanceGroupManager.deleteInstances(VMS, assert.ifError); - }); - - describe('error', () => { - const apiResponse = {}; - const error = new Error('Error.'); - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error and API response', done => { - instanceGroupManager.deleteInstances( - VMS, - (err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - ); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'op-name'}; - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should return an Operation and API response', done => { - const operation = {}; - - instanceGroupManager.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - instanceGroupManager.deleteInstances( - VMS, - (err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - ); - }); - }); - }); - - describe('getManagedInstances', () => { - beforeEach(() => { - instanceGroupManager.zone.vm = function () { - return {}; - }; - }); - - it('should accept only a callback', done => { - instanceGroupManager.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - instanceGroupManager.getManagedInstances(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - instanceGroupManager.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/listManagedInstances'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - instanceGroupManager.getManagedInstances(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - instanceGroupManager.getManagedInstances( - {}, - (err, vms, nextQuery, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - } - ); - }); - }); - - describe('success', () => { - const apiResponse = { - managedInstances: [{instance: 'vm-name'}], - }; - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - instanceGroupManager.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - instanceGroupManager.getManagedInstances({}, (err, vms, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with VMs & API response', done => { - const vm = {}; - - instanceGroupManager.zone.vm = function (name) { - assert.strictEqual(name, apiResponse.managedInstances[0].instance); - return vm; - }; - - instanceGroupManager.getManagedInstances( - {}, - (err, vms, nextQuery, apiResponse_) => { - assert.ifError(err); - - assert.strictEqual(vms[0], vm); - assert.strictEqual( - vms[0].metadata, - apiResponse.managedInstances[0] - ); - - assert.strictEqual(apiResponse_, apiResponse); - - done(); - } - ); - }); - }); - }); - - describe('resize', () => { - const query = {size: 1}; - - it('should make the correct API request', done => { - instanceGroupManager.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/resize'); - assert.deepStrictEqual(reqOpts.qs, query); - assert.deepStrictEqual(reqOpts.json, undefined); - - done(); - }; - - instanceGroupManager.resize(1, assert.ifError); - }); - - describe('error', () => { - const apiResponse = {}; - const error = new Error('Error.'); - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error and API response', done => { - instanceGroupManager.resize(query, (err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'op-name'}; - - beforeEach(() => { - instanceGroupManager.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should return an Operation and API response', done => { - const operation = {}; - - instanceGroupManager.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - instanceGroupManager.resize(query, (err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - }); -}); diff --git a/test/instance-group.js b/test/instance-group.js deleted file mode 100644 index df5437b8..00000000 --- a/test/instance-group.js +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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 arrify = require('arrify'); -const assert = require('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'InstanceGroup') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -let extended = false; -const fakePaginator = { - paginator: { - extend: function (Class, methods) { - if (Class.name !== 'InstanceGroup') { - return; - } - - extended = true; - methods = arrify(methods); - assert.strictEqual(Class.name, 'InstanceGroup'); - assert.deepStrictEqual(methods, ['getVMs']); - }, - streamify: function (methodName) { - return methodName; - }, - }, -}; - -describe('InstanceGroup', () => { - let InstanceGroup; - let instanceGroup; - - const staticMethods = {}; - - const ZONE = { - createInstanceGroup: util.noop, - vm: util.noop, - compute: {}, - }; - const NAME = 'instance-group-name'; - - before(() => { - InstanceGroup = proxyquire('../src/instance-group.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/paginator': fakePaginator, - '@google-cloud/promisify': fakePromisify, - }); - staticMethods.formatPorts_ = InstanceGroup.formatPorts_; - }); - - beforeEach(() => { - Object.assign(InstanceGroup, staticMethods); - instanceGroup = new InstanceGroup(ZONE, NAME); - }); - - describe('instantiation', () => { - it('should extend the correct methods', () => { - assert(extended); // See `fakePaginator.extend` - }); - - it('should streamify the correct methods', () => { - assert.strictEqual(instanceGroup.getVMsStream, 'getVMs'); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should localize the zone instance', () => { - assert.strictEqual(instanceGroup.zone, ZONE); - }); - - it('should localize the name', () => { - assert.strictEqual(instanceGroup.name, NAME); - }); - - it('should inherit from ServiceObject', done => { - const zoneInstance = Object.assign({}, ZONE, { - createInstanceGroup: { - bind: function (context) { - assert.strictEqual(context, zoneInstance); - - setImmediate(() => { - assert(instanceGroup instanceof ServiceObject); - - const calledWith = instanceGroup.calledWith_[0]; - - assert.strictEqual(calledWith.parent, zoneInstance); - assert.strictEqual(calledWith.baseUrl, '/instanceGroups'); - assert.strictEqual(calledWith.id, NAME); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - - done(); - }); - }, - }, - }); - - const instanceGroup = new InstanceGroup(zoneInstance, NAME); - }); - }); - - describe('formatPorts_', () => { - const PORTS = { - http: 80, - https: 443, - }; - - it('should format an object of named ports', () => { - assert.deepStrictEqual(InstanceGroup.formatPorts_(PORTS), [ - {name: 'http', port: 80}, - {name: 'https', port: 443}, - ]); - }); - }); - - describe('add', () => { - const VMS = [{url: 'vm-url'}, {url: 'vm-url-2'}]; - - it('should make the correct API request', done => { - instanceGroup.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/addInstances'); - assert.deepStrictEqual(reqOpts.json, { - instances: VMS.map(vm => { - return { - instance: vm.url, - }; - }), - }); - - done(); - }; - - instanceGroup.add(VMS, assert.ifError); - }); - - describe('error', () => { - const apiResponse = {}; - const error = new Error('Error.'); - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error and API response', done => { - instanceGroup.add(VMS, (err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'op-name'}; - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should return an Operation and API response', done => { - const operation = {}; - - instanceGroup.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - instanceGroup.add(VMS, (err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, instanceGroup); - done(); - }; - - instanceGroup.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - instanceGroup.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - instanceGroup.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - instanceGroup.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - instanceGroup.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - instanceGroup.delete(); - }); - }); - }); - }); - - describe('getVMs', () => { - beforeEach(() => { - instanceGroup.zone.vm = function () { - return {}; - }; - }); - - it('should accept only a callback', done => { - instanceGroup.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - instanceGroup.getVMs(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - instanceGroup.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/listInstances'); - assert.strictEqual(reqOpts.qs, query); - assert.strictEqual(reqOpts.json, undefined); - - done(); - }; - - instanceGroup.getVMs(query, assert.ifError); - }); - - describe('options.running', () => { - const OPTIONS = { - running: true, - }; - - it('should set the instanceState filter', done => { - instanceGroup.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, { - instanceState: 'RUNNING', - }); - done(); - }; - - instanceGroup.getVMs(OPTIONS, assert.ifError); - }); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - instanceGroup.getVMs({}, (err, vms, nextQuery, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(vms, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{instance: 'vm-name'}], - }; - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - instanceGroup.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - instanceGroup.getVMs({}, (err, vms, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with VMs & API response', done => { - const vm = {}; - - instanceGroup.zone.vm = function (name) { - assert.strictEqual(name, apiResponse.items[0].instance); - return vm; - }; - - instanceGroup.getVMs({}, (err, vms, nextQuery, apiResponse_) => { - assert.ifError(err); - - assert.strictEqual(vms[0], vm); - assert.strictEqual(vms[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - }); - - describe('remove', () => { - const VMS = [{url: 'vm-url'}, {url: 'vm-url-2'}]; - - it('should make the correct API request', done => { - instanceGroup.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/removeInstances'); - assert.deepStrictEqual(reqOpts.json, { - instances: VMS.map(vm => { - return { - instance: vm.url, - }; - }), - }); - - done(); - }; - - instanceGroup.remove(VMS, assert.ifError); - }); - - describe('error', () => { - const apiResponse = {}; - const error = new Error('Error.'); - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error and API response', done => { - instanceGroup.remove(VMS, (err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'op-name'}; - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should return an Operation and API response', done => { - const operation = {}; - - instanceGroup.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - instanceGroup.remove(VMS, (err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - }); - - describe('setPorts', () => { - const PORTS = { - http: 80, - https: 443, - }; - - it('should format the named ports', done => { - const expectedNamedPorts = []; - - InstanceGroup.formatPorts_ = function (ports) { - assert.strictEqual(ports, PORTS); - return expectedNamedPorts; - }; - - instanceGroup.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/setNamedPorts'); - assert.strictEqual(reqOpts.json.namedPorts, expectedNamedPorts); - done(); - }; - - instanceGroup.setPorts(PORTS, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - instanceGroup.setPorts(PORTS, (err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - instanceGroup.setPorts(PORTS); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - instanceGroup.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - instanceGroup.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - instanceGroup.setPorts(PORTS, (err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - instanceGroup.setPorts(PORTS); - }); - }); - }); - }); -}); diff --git a/test/machine-type.js b/test/machine-type.js deleted file mode 100644 index 43402df5..00000000 --- a/test/machine-type.js +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2016 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject} = require('@google-cloud/common'); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('MachineType', () => { - let MachineType; - let machineType; - const ZONE_NAME = 'zone-1'; - const ZONE = { - name: ZONE_NAME, - compute: {}, - }; - - const MACHINE_TYPE_NAME = 'g1-small'; - - before(() => { - MachineType = proxyquire('../src/machine-type.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - }); - }); - - beforeEach(() => { - machineType = new MachineType(ZONE, MACHINE_TYPE_NAME); - }); - - describe('instantiation', () => { - it('should localize the zone', () => { - assert.strictEqual(machineType.zone, ZONE); - }); - - it('should localize the name', () => { - assert.strictEqual(machineType.name, MACHINE_TYPE_NAME); - }); - - it('should inherit from ServiceObject', () => { - assert(machineType instanceof ServiceObject); - - const calledWith = machineType.calledWith_[0]; - - assert.strictEqual(calledWith.parent, ZONE); - assert.strictEqual(calledWith.baseUrl, '/machineTypes'); - assert.strictEqual(calledWith.id, MACHINE_TYPE_NAME); - assert.deepStrictEqual(calledWith.methods, { - exists: true, - get: true, - getMetadata: true, - }); - }); - }); -}); diff --git a/test/network.js b/test/network.js deleted file mode 100644 index cbc3d4f7..00000000 --- a/test/network.js +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const format = require('string-format-obj'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class, options) { - if (Class.name !== 'Network') { - return; - } - promisified = true; - assert.deepStrictEqual(options.exclude, ['firewall']); - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Network', () => { - let Network; - let network; - - /* eslint-disable no-unused-vars */ - let REGION; - let Region; - - const COMPUTE = { - projectId: 'project-id', - createNetwork: util.noop, - }; - const NETWORK_NAME = 'network-name'; - const NETWORK_FULL_NAME = format('projects/{pId}/global/networks/{name}', { - pId: COMPUTE.projectId, - name: NETWORK_NAME, - }); - const REGION_NAME = 'region-name'; - - before(() => { - Network = proxyquire('../src/network.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - - Region = require('../src/region.js'); - }); - - beforeEach(() => { - network = new Network(COMPUTE, NETWORK_NAME); - REGION = new Region(COMPUTE, REGION_NAME); - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should localize the compute instance', () => { - assert.strictEqual(network.compute, COMPUTE); - }); - - it('should localize the name', () => { - assert.strictEqual(network.name, NETWORK_NAME); - }); - - it('should format the network name', () => { - const formatName_ = Network.formatName_; - const formattedName = 'projects/a/global/networks/b'; - - Network.formatName_ = function (compute, name) { - Network.formatName_ = formatName_; - - assert.strictEqual(compute, COMPUTE); - assert.strictEqual(name, NETWORK_NAME); - - return formattedName; - }; - - const network = new Network(COMPUTE, NETWORK_NAME); - assert(network.formattedName, formattedName); - }); - - it('should inherit from ServiceObject', done => { - const computeInstance = Object.assign({}, COMPUTE, { - createNetwork: { - bind: function (context) { - assert.strictEqual(context, computeInstance); - done(); - }, - }, - }); - - const network = new Network(computeInstance, NETWORK_NAME); - assert(network instanceof ServiceObject); - - const calledWith = network.calledWith_[0]; - - assert.strictEqual(calledWith.parent, computeInstance); - assert.strictEqual(calledWith.baseUrl, '/global/networks'); - assert.strictEqual(calledWith.id, NETWORK_NAME); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('formatName_', () => { - it('should format the name', () => { - const formattedName_ = Network.formatName_(COMPUTE, NETWORK_NAME); - assert.strictEqual(formattedName_, NETWORK_FULL_NAME); - }); - }); - - describe('createFirewall', () => { - it('should make the correct call to Compute', done => { - const name = 'firewall-name'; - const config = {a: 'b', c: 'd'}; - const expectedConfig = Object.assign({}, config, { - network: network.formattedName, - }); - - network.compute.createFirewall = function (name_, config_, callback) { - assert.strictEqual(name_, name); - assert.deepStrictEqual(config_, expectedConfig); - callback(); - }; - - network.createFirewall(name, config, done); - }); - }); - - describe('createSubnetwork', () => { - it('should call region.createSubnetwork correctly', done => { - const name = 'subnetwork-name'; - const region = {}; - const config = { - a: 'b', - c: 'd', - region: REGION_NAME, - }; - - const expectedConfig = Object.assign({}, config, { - network: network.formattedName, - }); - delete expectedConfig.region; - - network.compute.region = function (name) { - assert.strictEqual(name, REGION_NAME); - return region; - }; - - region.createSubnetwork = function (name_, config, callback) { - assert.strictEqual(name_, name); - assert.deepStrictEqual(config, expectedConfig); - - callback(); // done(); - }; - - network.createSubnetwork(name, config, done); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, network); - done(); - }; - - network.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - network.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - network.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - network.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - network.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - network.delete(); - }); - }); - }); - }); - - describe('firewall', () => { - it('should return a Firewall with the correct metadata', () => { - const name = 'firewall-name'; - const firewall = {}; - - network.compute.firewall = function (name_) { - assert.strictEqual(name_, name); - return firewall; - }; - - const firewallInstance = network.firewall(name); - assert.deepStrictEqual(firewallInstance.metadata, { - network: network.formattedName, - }); - }); - }); - - describe('getFirewalls', () => { - it('should make the correct call to Compute', done => { - const options = {a: 'b', c: 'd'}; - const expectedOptions = Object.assign({}, options, { - filter: 'network eq .*' + network.formattedName, - }); - - network.compute.getFirewalls = function (options, callback) { - assert.deepStrictEqual(options, expectedOptions); - callback(); - }; - - network.getFirewalls(options, done); - }); - - it('should not require options', done => { - network.compute.getFirewalls = function (options, callback) { - callback(); - }; - - network.getFirewalls(done); - }); - }); - - describe('getFirewallsStream', () => { - it('should call to getFirewallsStream correctly', done => { - const options = {a: 'b', c: 'd'}; - const expectedOptions = Object.assign({}, options, { - filter: 'network eq .*' + network.formattedName, - }); - - network.compute.getFirewallsStream = function (options) { - assert.deepStrictEqual(options, expectedOptions); - done(); - }; - - network.getFirewallsStream(options); - }); - - it('should not require options', done => { - network.compute.getFirewallsStream = function () { - done(); - }; - - network.getFirewallsStream(); - }); - - it('should return a stream', done => { - const fakeStream = {}; - - network.compute.getFirewallsStream = function () { - setImmediate(done); - return fakeStream; - }; - - const stream = network.getFirewallsStream(); - assert.strictEqual(stream, fakeStream); - }); - }); - - describe('getSubnetworks', () => { - it('should call to compute.getSubnetworks correctly', done => { - const options = {a: 'b', c: 'd'}; - const expectedOptions = Object.assign({}, options, { - filter: 'network eq .*' + network.formattedName, - }); - - network.compute.getSubnetworks = function (options, callback) { - assert.deepStrictEqual(options, expectedOptions); - callback(); - }; - - network.getSubnetworks(options, done); - }); - - it('should not require options', done => { - network.compute.getSubnetworks = function (options, callback) { - callback(); - }; - - network.getSubnetworks(done); - }); - }); - - describe('getSubnetworksStream', () => { - it('should call to getSubnetworksStream correctly', done => { - const options = {a: 'b', c: 'd'}; - const expectedOptions = Object.assign({}, options, { - filter: 'network eq .*' + network.formattedName, - }); - - network.compute.getSubnetworksStream = function (options) { - assert.deepStrictEqual(options, expectedOptions); - done(); - }; - - network.getSubnetworksStream(options); - }); - - it('should not require options', done => { - network.compute.getSubnetworksStream = function () { - done(); - }; - - network.getSubnetworksStream(); - }); - - it('should return a stream', done => { - const fakeStream = {}; - - network.compute.getSubnetworksStream = function () { - setImmediate(done); - return fakeStream; - }; - - const stream = network.getSubnetworksStream(); - assert.strictEqual(stream, fakeStream); - }); - }); -}); diff --git a/test/operation.js b/test/operation.js deleted file mode 100644 index f8e1f79e..00000000 --- a/test/operation.js +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire').noPreserveCache(); -const {util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -class FakeOperation { - constructor() { - this.calledWith_ = arguments; - } -} - -class FakeServiceObject { - constructor() { - this.calledWith_ = arguments; - } -} - -let parseHttpRespBodyOverride = null; -let promisified = false; -const fakeUtil = Object.assign({}, util, { - parseHttpRespBody: function () { - if (parseHttpRespBodyOverride) { - return parseHttpRespBodyOverride.apply(null, arguments); - } - return util.parseHttpRespBody.apply(this, arguments); - }, -}); - -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Operation') { - promisified = true; - } - }, -}); - -describe('Operation', () => { - let Operation; - let operation; - - const SCOPE = { - Promise: Promise, - compute: {}, - }; - const OPERATION_NAME = 'operation-name'; - - before(() => { - Operation = proxyquire('../src/operation.js', { - '@google-cloud/common': { - Operation: FakeOperation, - ServiceObject: FakeServiceObject, - util: fakeUtil, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - parseHttpRespBodyOverride = null; - operation = new Operation(SCOPE, OPERATION_NAME); - }); - - describe('instantiation', () => { - it('should localize the name', () => { - assert.strictEqual(operation.name, OPERATION_NAME); - }); - - it('should inherit from Operation', () => { - assert(operation instanceof FakeOperation); - - const calledWith = operation.calledWith_[0]; - - assert.strictEqual(calledWith.parent, SCOPE); - assert.strictEqual(calledWith.baseUrl, '/operations'); - assert.strictEqual(calledWith.id, OPERATION_NAME); - assert.deepStrictEqual(calledWith.methods, { - delete: true, - exists: true, - get: true, - }); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should give the right baseUrl for a global Operation', () => { - const operation = new Operation( - { - constructor: { - name: 'Compute', - }, - }, - OPERATION_NAME - ); - - const calledWith = operation.calledWith_[0]; - assert.strictEqual(calledWith.baseUrl, '/global/operations'); - }); - }); - - describe('getMetadata', () => { - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.getMetadata = function (callback) { - callback(error, apiResponse); - }; - }); - - it.skip('should ignore false errors', done => { - const apiResponse = { - name: operation.name, - error: { - errors: [], - }, - }; - - operation.getMetadata = function (callback) { - callback(apiResponse.error, apiResponse); - }; - - operation.getMetadata((err, metadata, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it.skip('should execute callback with error and API response', done => { - operation.getMetadata((err, metadata, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(metadata, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it.skip('should not require a callback', () => { - assert.doesNotThrow(() => { - operation.getMetadata(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.getMetadata = function (callback) { - callback(null, apiResponse); - }; - }); - - it.skip('should update the metadata to the API response', done => { - operation.getMetadata(err => { - assert.ifError(err); - assert.strictEqual(operation.metadata, apiResponse); - done(); - }); - }); - - it.skip('should exec callback with metadata and API response', done => { - operation.getMetadata((err, metadata, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it.skip('should not require a callback', () => { - assert.doesNotThrow(() => { - operation.getMetadata(); - }); - }); - }); - }); - - describe('poll_', () => { - beforeEach(() => { - operation.emit = util.noop; - }); - - it('should call getMetadata', done => { - operation.getMetadata = function () { - done(); - }; - - operation.poll_(assert.ifError); - }); - - describe('API error', () => { - const error = new Error('Error.'); - - beforeEach(() => { - operation.getMetadata = function (callback) { - callback(error); - }; - }); - - it('should emit the error', done => { - operation.poll_(err => { - assert.strictEqual(err, error); - done(); - }); - }); - }); - - describe('operation failure', () => { - const error = new Error('Error.'); - const apiResponse = {error: error}; - - beforeEach(() => { - operation.getMetadata = function (callback) { - callback(null, apiResponse, apiResponse); - }; - }); - - it('should parse and return the response body', done => { - const parsedHttpRespBody = {err: {}}; - - parseHttpRespBodyOverride = function (body) { - assert.strictEqual(body, apiResponse); - return parsedHttpRespBody; - }; - - operation.poll_(err => { - assert.strictEqual(err, parsedHttpRespBody.err); - done(); - }); - }); - }); - - describe('operation running', () => { - const apiResponse = {status: 'RUNNING'}; - - beforeEach(() => { - operation.getMetadata = function (callback) { - callback(null, apiResponse, apiResponse); - }; - }); - - it('should update status', done => { - delete operation.status; - - operation.poll_(err => { - assert.ifError(err); - assert.strictEqual(operation.status, apiResponse.status); - done(); - }); - }); - - it('should emit the running event', done => { - operation.emit = function (eventName, metadata) { - assert.strictEqual(eventName, 'running'); - assert.strictEqual(metadata, apiResponse); - done(); - }; - - operation.poll_(assert.ifError); - }); - - it('should not emit running if already running', done => { - operation.emit = function (eventName) { - assert.strictEqual(eventName, 'running'); - - operation.emit = done; // will fail test if called - operation.poll_(done); - }; - - operation.poll_(assert.ifError); - }); - }); - - describe('operation complete', () => { - const apiResponse = {status: 'DONE'}; - - beforeEach(() => { - operation.getMetadata = function (callback) { - callback(null, apiResponse, apiResponse); - }; - }); - - it('should update status', done => { - operation.status = 'PENDING'; - - operation.poll_(err => { - assert.ifError(err); - assert.strictEqual(operation.status, apiResponse.status); - done(); - }); - }); - - it('should execute callback with metadata', done => { - operation.poll_((err, metadata) => { - assert.ifError(err); - assert.strictEqual(metadata, apiResponse); - done(); - }); - }); - }); - }); -}); diff --git a/test/project.js b/test/project.js deleted file mode 100644 index ba4a63da..00000000 --- a/test/project.js +++ /dev/null @@ -1,78 +0,0 @@ -// 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('assert'); -const proxyquire = require('proxyquire'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Project') { - promisified = true; - } - }, -}); - -class FakeServiceObject { - constructor() { - this.calledWith_ = arguments; - } -} - -describe('Project', () => { - let Project; - let project; - - const PROJECT_ID = 'project-1'; - const COMPUTE = { - projectId: PROJECT_ID, - authConfig: {a: 'b', c: 'd'}, - }; - - before(() => { - Project = proxyquire('../src/project.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - project = new Project(COMPUTE); - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should inherit from ServiceObject', () => { - assert(project instanceof FakeServiceObject); - - const calledWith = project.calledWith_[0]; - - assert.strictEqual(calledWith.parent, COMPUTE); - assert.strictEqual(calledWith.baseUrl, ''); - assert.strictEqual(calledWith.id, ''); - assert.deepStrictEqual(calledWith.methods, { - get: true, - getMetadata: true, - }); - }); - }); -}); diff --git a/test/region.js b/test/region.js deleted file mode 100644 index d70ac418..00000000 --- a/test/region.js +++ /dev/null @@ -1,842 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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 arrify = require('arrify'); -const assert = require('assert'); -const {ServiceObject} = require('@google-cloud/common'); -const is = require('is'); -const proxyquire = require('proxyquire'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class, options) { - if (Class.name !== 'Region') { - return; - } - promisified = true; - assert.deepStrictEqual(options.exclude, [ - 'address', - 'operation', - 'rule', - 'subnetwork', - ]); - }, -}); - -function FakeAddress() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeNetwork() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeOperation() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeRule() { - this.calledWith_ = [].slice.call(arguments); -} - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -function FakeSubnetwork() { - this.calledWith_ = [].slice.call(arguments); -} - -let extended = false; -const fakePaginator = { - paginator: { - extend: function (Class, methods) { - if (Class.name !== 'Region') { - return; - } - - extended = true; - methods = arrify(methods); - assert.strictEqual(Class.name, 'Region'); - assert.deepStrictEqual(methods, [ - 'getAddresses', - 'getOperations', - 'getRules', - 'getSubnetworks', - ]); - }, - streamify: function (methodName) { - return methodName; - }, - }, -}; - -describe('Region', () => { - let Region; - let region; - - const COMPUTE = { - authConfig: {a: 'b', c: 'd'}, - }; - const REGION_NAME = 'us-central1'; - - before(() => { - Region = proxyquire('../src/region.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/paginator': fakePaginator, - '@google-cloud/promisify': fakePromisify, - './address.js': FakeAddress, - './network.js': FakeNetwork, - './operation.js': FakeOperation, - './rule.js': FakeRule, - './subnetwork.js': FakeSubnetwork, - }); - }); - - beforeEach(() => { - region = new Region(COMPUTE, REGION_NAME); - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should extend the correct methods', () => { - assert(extended); // See `fakePaginator.extend` - }); - - it('should streamify the correct methods', () => { - assert.strictEqual(region.getAddressesStream, 'getAddresses'); - assert.strictEqual(region.getOperationsStream, 'getOperations'); - assert.strictEqual(region.getRulesStream, 'getRules'); - assert.strictEqual(region.getSubnetworksStream, 'getSubnetworks'); - }); - - it('should localize the name', () => { - assert.strictEqual(region.name, REGION_NAME); - }); - - it('should inherit from ServiceObject', () => { - assert(region instanceof ServiceObject); - - const calledWith = region.calledWith_[0]; - - assert.strictEqual(calledWith.parent, COMPUTE); - assert.strictEqual(calledWith.baseUrl, '/regions'); - assert.strictEqual(calledWith.id, REGION_NAME); - assert.deepStrictEqual(calledWith.methods, { - exists: true, - get: true, - getMetadata: true, - }); - }); - - describe('request interceptor', () => { - it('should assign a request interceptor', () => { - const requestInterceptor = region.interceptors.pop().request; - assert(is.fn(requestInterceptor)); - }); - - it('should strip `/global` from forwardingRules requests', () => { - const reqOpts = { - uri: '/compute/v1/projects/projectId/global/forwardingRules', - }; - const expectedReqOpts = { - uri: '/compute/v1/projects/projectId/forwardingRules', - }; - - const requestInterceptor = region.interceptors.pop().request; - assert.deepStrictEqual(requestInterceptor(reqOpts), expectedReqOpts); - }); - - it('should not affect non-cancel requests', () => { - const reqOpts = { - uri: '/compute/v1/projects/projectId/other/request', - }; - const expectedReqOpts = { - uri: '/compute/v1/projects/projectId/other/request', - }; - - const requestInterceptor = region.interceptors.pop().request; - assert.deepStrictEqual(requestInterceptor(reqOpts), expectedReqOpts); - }); - }); - }); - - describe('address', () => { - const NAME = 'address-name'; - - it('should return an Address object', () => { - const address = region.address(NAME); - assert(address instanceof FakeAddress); - assert.strictEqual(address.calledWith_[0], region); - assert.strictEqual(address.calledWith_[1], NAME); - }); - }); - - describe('createAddress', () => { - const NAME = 'address-name'; - const OPTIONS = {a: 'b', c: 'd'}; - const EXPECTED_BODY = Object.assign({}, OPTIONS, {name: NAME}); - - it('should not require any options', done => { - const expectedBody = {name: NAME}; - - region.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, expectedBody); - done(); - }; - - region.createAddress(NAME, assert.ifError); - }); - - it('should make the correct API request', done => { - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/addresses'); - assert.deepStrictEqual(reqOpts.json, EXPECTED_BODY); - - done(); - }; - - region.createAddress(NAME, OPTIONS, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - region.createAddress(NAME, OPTIONS, (err, address_, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(address_, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec callback with Address, Op & apiResponse', done => { - const address = {}; - const operation = {}; - - region.address = function (name) { - assert.strictEqual(name, NAME); - return address; - }; - - region.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - region.createAddress(NAME, OPTIONS, (err, address_, op, resp) => { - assert.ifError(err); - - assert.strictEqual(address_, address); - - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, resp); - - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - - describe('createRule', () => { - const NAME = 'rule-name'; - const CONFIG = {}; - - it('should call compute#createRule', done => { - region.parent.createRule = function (name, config, callback) { - assert.strictEqual(this, region); - assert.strictEqual(name, NAME); - assert.strictEqual(config, CONFIG); - callback(); // done() - }; - - region.createRule(NAME, CONFIG, done); - }); - }); - - describe('createSubnetwork', () => { - const NAME = 'subnetwork-name'; - const CONFIG = { - a: 'b', - c: 'd', - network: 'network-name', - }; - const EXPECTED_BODY = Object.assign({}, CONFIG, {name: NAME}); - - it('should make the correct API request', done => { - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/subnetworks'); - assert.deepStrictEqual(reqOpts.json, EXPECTED_BODY); - - done(); - }; - - region.createSubnetwork(NAME, CONFIG, assert.ifError); - }); - - describe('config.network', () => { - it('should accept a Network object', done => { - const network = new FakeNetwork(); - network.formattedName = 'formatted-name'; - - const config = Object.assign({}, CONFIG, { - network: network, - }); - - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.network, network.formattedName); - done(); - }; - - region.createSubnetwork(NAME, config, assert.ifError); - }); - }); - - describe('config.range', () => { - it('should accept and delete a range property', done => { - const config = Object.assign({}, CONFIG, { - range: '...', - }); - - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.ipCidrRange, config.range); - assert.strictEqual(reqOpts.json.range, undefined); - done(); - }; - - region.createSubnetwork(NAME, config, assert.ifError); - }); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - region.createSubnetwork(NAME, CONFIG, (err, sub, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(sub, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec cb with Subnetwork, Op & apiResponse', done => { - const subnetwork = {}; - const operation = {}; - - region.subnetwork = function (name) { - assert.strictEqual(name, NAME); - return subnetwork; - }; - - region.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - region.createSubnetwork(NAME, CONFIG, (err, sub, op, resp) => { - assert.ifError(err); - - assert.strictEqual(sub, subnetwork); - - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, resp); - - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - - describe('getAddresses', () => { - it('should accept only a callback', done => { - region.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - region.getAddresses(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/addresses'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - region.getAddresses(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - region.getAddresses({}, (err, addresses, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(addresses, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'operation-name'}], - }; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - region.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - region.getAddresses({}, (err, addresses, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Operations & API resp', done => { - const address = {}; - - region.address = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return address; - }; - - region.getAddresses({}, (err, addresses, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(addresses[0], address); - assert.strictEqual(addresses[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getOperations', () => { - it('should accept only a callback', done => { - region.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - region.getOperations(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/operations'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - region.getOperations(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - region.getOperations({}, (err, operations, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(operations, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'operation-name'}], - }; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - region.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - region.getOperations({}, (err, operations, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Operations & API resp', done => { - const operation = {}; - - region.operation = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return operation; - }; - - region.getOperations({}, (err, operations, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(operations[0], operation); - assert.strictEqual(operations[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getRules', () => { - it('should accept only a callback', done => { - region.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - region.getRules(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/forwardingRules'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - region.getRules(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - region.getRules({}, (err, rules, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(rules, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'operation-name'}], - }; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - region.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - region.getRules({}, (err, rules, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Operations & API resp', done => { - const rule = {}; - - region.rule = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return rule; - }; - - region.getRules({}, (err, rules, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(rules[0], rule); - assert.strictEqual(rules[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getSubnetworks', () => { - it('should accept only a callback', done => { - region.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - region.getSubnetworks(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - region.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/subnetworks'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - region.getSubnetworks(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - region.getSubnetworks({}, (err, subnetworks, nextQuery, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(subnetworks, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'subnetwork-name'}], - }; - - beforeEach(() => { - region.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - region.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - region.getSubnetworks({}, (err, subnetworks, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Operations & API resp', done => { - const subnetwork = {}; - - region.subnetwork = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return subnetwork; - }; - - region.getSubnetworks({}, (err, subnetworks, nextQuery, resp) => { - assert.ifError(err); - - assert.strictEqual(subnetworks[0], subnetwork); - assert.strictEqual(subnetworks[0].metadata, apiResponse.items[0]); - - assert.strictEqual(resp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('operation', () => { - const NAME = 'operation-name'; - - it('should return a Operation object', () => { - const operation = region.operation(NAME); - assert(operation instanceof FakeOperation); - assert.strictEqual(operation.calledWith_[0], region); - assert.strictEqual(operation.calledWith_[1], NAME); - }); - }); - - describe('rule', () => { - const NAME = 'rule-name'; - - it('should return a Operation object', () => { - const rule = region.rule(NAME); - assert(rule instanceof FakeRule); - assert.strictEqual(rule.calledWith_[0], region); - assert.strictEqual(rule.calledWith_[1], NAME); - }); - }); - - describe('subnetwork', () => { - const NAME = 'subnetwork-name'; - - it('should return a Subnetwork object', () => { - const subnetwork = region.subnetwork(NAME); - assert(subnetwork instanceof FakeSubnetwork); - assert.strictEqual(subnetwork.calledWith_[0], region); - assert.strictEqual(subnetwork.calledWith_[1], NAME); - }); - }); -}); diff --git a/test/rule.js b/test/rule.js deleted file mode 100644 index b6027d48..00000000 --- a/test/rule.js +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Rule') { - promisified = true; - } - }, -}); - -class FakeServiceObject { - constructor() { - this.calledWith_ = arguments; - } -} - -describe('Rule', () => { - let Rule; - let rule; - - function Compute() { - this.createRule = util.noop; - this.operation = util.noop; - } - - const COMPUTE = new Compute(); - const RULE_NAME = 'rule-name'; - - before(() => { - Rule = proxyquire('../src/rule.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - rule = new Rule(COMPUTE, RULE_NAME); - }); - - describe('instantiation', () => { - it('should inherit from ServiceObject', () => { - const computeInstance = new Compute(); - const bindMethod = {}; - - Object.assign(computeInstance, { - createRule: { - bind: function (context) { - assert.strictEqual(context, computeInstance); - return bindMethod; - }, - }, - }); - - const rule = new Rule(computeInstance, RULE_NAME); - assert(rule instanceof FakeServiceObject); - - const calledWith = rule.calledWith_[0]; - - assert.strictEqual(calledWith.parent, computeInstance); - assert.strictEqual(calledWith.baseUrl, '/global/forwardingRules'); - assert.strictEqual(calledWith.id, RULE_NAME); - assert.strictEqual(calledWith.createMethod, bindMethod); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should not use global forwarding rules', () => { - const rule = new Rule({createRule: util.noop}, RULE_NAME); - assert(rule instanceof FakeServiceObject); - - const calledWith = rule.calledWith_[0]; - - assert.strictEqual(calledWith.baseUrl, '/forwardingRules'); - }); - - it('should localize the scope', () => { - assert.strictEqual(rule.scope, COMPUTE); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, rule); - done(); - }; - - rule.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - rule.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - rule.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - rule.scope.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - rule.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - rule.delete(); - }); - }); - }); - }); - - describe('setTarget', () => { - const TARGET = 'target'; - - it('should make the correct API request', done => { - rule.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/setTarget'); - assert.deepStrictEqual(reqOpts.json, {target: TARGET}); - - done(); - }; - - rule.setTarget(TARGET, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {}; - - beforeEach(() => { - rule.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - rule.setTarget(TARGET, (err, op, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(op, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - rule.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with operation & response', done => { - const operation = {}; - - rule.scope.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - rule.setTarget(TARGET, (err, op, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - rule.setTarget(TARGET); - }); - }); - }); - }); -}); diff --git a/test/run.ts b/test/run.ts new file mode 100644 index 00000000..58fce557 --- /dev/null +++ b/test/run.ts @@ -0,0 +1,70 @@ +// 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. + +// Simple test runner for unit tests - there are so many generated unit tests +// they don't fit into one mocha invocation + +import {readdir} from 'fs'; +import {join} from 'path'; +import {spawn} from 'child_process'; +import {promisify} from 'util'; +const readdirp = promisify(readdir); + +function spawnp(command: string, parameters: string[]) { + return new Promise((resolve, reject) => { + const proc = spawn(command, parameters, { + stdio: ['inherit', 'inherit', 'inherit'], + }); + proc.on('exit', code => { + if (code === 0) { + resolve(); + } + reject(); + }); + }); +} + +const testDir = join('.', 'build', 'test'); +const runCommand = 'node'; +const runParameters = ['./node_modules/mocha/bin/mocha']; +const batchSize = 2; + +async function runBatch(batch: string[]) { + const parameters = [...runParameters, ...batch]; + console.log(`${runCommand} ${parameters.join(' ')}`); + await spawnp(runCommand, parameters); +} + +async function main() { + const files = await readdirp(testDir); + const jsFiles = files.filter(fn => fn.match(/^gapic_.*\.js$/)); + + const batch: string[] = []; + for (const file of jsFiles) { + batch.push(join(testDir, file)); + if (batch.length >= batchSize) { + await runBatch(batch); + batch.splice(0); + } + } + + if (batch.length > 0) { + await runBatch(batch); + batch.splice(0); + } +} + +main().catch(() => { + process.exitCode = 1; +}); diff --git a/test/service.js b/test/service.js deleted file mode 100644 index 2840fd31..00000000 --- a/test/service.js +++ /dev/null @@ -1,361 +0,0 @@ -// Copyright 2016 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Service') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Service', () => { - let Service; - let service; - - const SERVICE_NAME = 'service-name'; - - const COMPUTE = { - projectId: 'project-id', - createService: util.noop, - apiEndpoint: 'compute.googleapis.com', - }; - - before(() => { - Service = proxyquire('../src/service.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - service = new Service(COMPUTE, SERVICE_NAME); - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should localize the Compute instance', () => { - assert.strictEqual(service.compute, COMPUTE); - }); - - it('should localize the name', () => { - assert.strictEqual(service.name, SERVICE_NAME); - }); - - it('should inherit from ServiceObject', () => { - const createMethod = util.noop; - - const computeInstance = Object.assign({}, COMPUTE, { - createService: { - bind: function (context) { - assert.strictEqual(context, computeInstance); - return createMethod; - }, - }, - }); - - const service = new Service(computeInstance, SERVICE_NAME); - assert(service instanceof ServiceObject); - - const calledWith = service.calledWith_[0]; - - assert.strictEqual(calledWith.parent, computeInstance); - assert.strictEqual(calledWith.baseUrl, '/global/backendServices'); - assert.strictEqual(calledWith.id, SERVICE_NAME); - assert.strictEqual(calledWith.createMethod, createMethod); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, service); - done(); - }; - - service.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - service.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - service.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - service.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - service.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - service.delete(); - }); - }); - }); - }); - - describe('getHealth', () => { - const GROUP = 'http://group-url'; - - it('should make the correct request', done => { - service.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/getHealth'); - assert.deepStrictEqual(reqOpts.json, { - group: GROUP, - }); - - done(); - }; - - service.getHealth(GROUP, assert.ifError); - }); - - describe('group object', () => { - it('should compose the right URL', done => { - const group = { - name: 'instance-group-name', - zone: 'zone-name', - }; - - service.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, { - group: [ - 'https://www.googleapis.com/compute/v1/projects/', - COMPUTE.projectId, - '/zones/', - group.zone, - '/instanceGroups/', - group.name, - ].join(''), - }); - - done(); - }; - - service.getHealth(group, assert.ifError); - }); - - it('should compose the right URL', done => { - const group = { - name: 'instance-group-name', - // Simulating a {module:compute/zone}: - zone: { - name: 'zone-name', - }, - }; - - service.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, { - group: [ - 'https://www.googleapis.com/compute/v1/projects/', - COMPUTE.projectId, - '/zones/', - group.zone.name, - '/instanceGroups/', - group.name, - ].join(''), - }); - - done(); - }; - - service.getHealth(group, assert.ifError); - }); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - service.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - service.getHealth(GROUP, (err, status, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(status, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - healthStatus: {}, - }; - - beforeEach(() => { - service.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with status & API response', done => { - service.getHealth(GROUP, (err, status, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(status[0], apiResponse.healthStatus); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - }); - - describe('setMetadata', () => { - it('should make the correct API request', done => { - const metadata = {}; - - service.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'PATCH'); - assert.strictEqual(reqOpts.uri, ''); - assert.strictEqual(reqOpts.json, metadata); - - done(); - }; - - service.setMetadata(metadata, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - service.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - service.setMetadata({e: 'f'}, (err, op, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(op, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - service.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with operation & response', done => { - const operation = {}; - const metadata = {a: 'b'}; - - service.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - service.setMetadata(metadata, (err, op, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - service.setMetadata({a: 'b'}); - }); - }); - }); - }); -}); diff --git a/test/snapshot.js b/test/snapshot.js deleted file mode 100644 index a44d6690..00000000 --- a/test/snapshot.js +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const {ServiceObject} = require('@google-cloud/common'); -const proxyquire = require('proxyquire'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Snapshot') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Snapshot', () => { - let Snapshot; - let snapshot; - - const COMPUTE = { - apiEndpoint: 'compute.googleapis.com', - }; - const SNAPSHOT_NAME = 'snapshot-name'; - - before(() => { - Snapshot = proxyquire('../src/snapshot.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - snapshot = new Snapshot(COMPUTE, SNAPSHOT_NAME); - }); - - describe('instantiation', () => { - it('should localize the compute instance', () => { - assert.strictEqual(snapshot.compute, COMPUTE); - }); - - it('should localize the name', () => { - assert.strictEqual(snapshot.name, SNAPSHOT_NAME); - }); - - it('should inherit from ServiceObject', () => { - const calledWith = snapshot.calledWith_[0]; - - assert.strictEqual(calledWith.parent, COMPUTE); - assert.strictEqual( - calledWith.baseUrl, - 'https://compute.googleapis.com/compute/v1/projects/{{projectId}}/global/snapshots' - ); - assert.strictEqual(calledWith.id, SNAPSHOT_NAME); - assert.deepStrictEqual(calledWith.methods, { - exists: true, - get: true, - getMetadata: true, - }); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should allow creating for a Disk object snapshot', done => { - const scope = { - constructor: { - name: 'Disk', - }, - createSnapshot: function () { - assert.strictEqual(this, scope); - done(); - }, - zone: { - compute: COMPUTE, - }, - }; - - const snapshot = new Snapshot(scope, SNAPSHOT_NAME); - assert(snapshot instanceof ServiceObject); - - assert.strictEqual(snapshot.compute, scope.zone.compute); - - const calledWith = snapshot.calledWith_[0]; - assert.strictEqual(calledWith.methods.create, true); - - calledWith.createMethod(); // (scope.createSnapshot) - }); - }); - - describe('delete', () => { - it('should call ServiceObject.delete', done => { - FakeServiceObject.prototype.delete = function () { - assert.strictEqual(this, snapshot); - done(); - }; - - snapshot.delete(); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(error, apiResponse); - }; - }); - - it('should exec the callback with error & API response', done => { - snapshot.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - snapshot.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - FakeServiceObject.prototype.delete = function (callback) { - callback(null, apiResponse); - }; - }); - - it('should exec callback with Operation & API response', done => { - const operation = {}; - - snapshot.compute.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - snapshot.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - snapshot.delete(); - }); - }); - }); - }); -}); diff --git a/test/subnetwork.js b/test/subnetwork.js deleted file mode 100644 index eaf340cf..00000000 --- a/test/subnetwork.js +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2016 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'Subnetwork') { - promisified = true; - } - }, -}); - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('Subnetwork', () => { - let Subnetwork; - let subnetwork; - - const SUBNETWORK_NAME = 'subnetwork_name'; - const REGION_NAME = 'region-1'; - const REGION = { - createSubnetwork: util.noop, - name: REGION_NAME, - compute: {}, - }; - - before(() => { - Subnetwork = proxyquire('../src/subnetwork.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - }); - }); - - beforeEach(() => { - subnetwork = new Subnetwork(REGION, SUBNETWORK_NAME); - }); - - describe('instantiation', () => { - it('should localize the name', () => { - assert.strictEqual(subnetwork.name, SUBNETWORK_NAME); - }); - - it('should localize the region', () => { - assert.strictEqual(subnetwork.region, REGION); - }); - - it('should inherit from ServiceObject', () => { - const createSubnetworkBound = {}; - - const regionInstance = Object.assign({}, REGION, { - createSubnetwork: { - bind: function (context) { - assert.strictEqual(context, regionInstance); - return createSubnetworkBound; - }, - }, - }); - - const subnetwork = new Subnetwork(regionInstance, SUBNETWORK_NAME); - assert(subnetwork instanceof ServiceObject); - - const calledWith = subnetwork.calledWith_[0]; - - assert.strictEqual(calledWith.parent, regionInstance); - assert.strictEqual(calledWith.baseUrl, '/subnetworks'); - assert.strictEqual(calledWith.id, SUBNETWORK_NAME); - assert.strictEqual(calledWith.createMethod, createSubnetworkBound); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - }); - - describe('delete', () => { - it('should make the correct API request', done => { - subnetwork.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'DELETE'); - assert.strictEqual(reqOpts.uri, ''); - done(); - }; - - subnetwork.delete(assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - subnetwork.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should return an error if the request fails', done => { - subnetwork.delete((err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - subnetwork.delete(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - name: 'op-name', - }; - - beforeEach(() => { - subnetwork.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Operation & Response', done => { - const operation = {}; - - subnetwork.region.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - subnetwork.delete((err, operation_, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(operation_.metadata, apiResponse); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - subnetwork.delete(); - }); - }); - }); - }); -}); diff --git a/test/vm.js b/test/vm.js deleted file mode 100644 index b099e308..00000000 --- a/test/vm.js +++ /dev/null @@ -1,1409 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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('assert'); -const extend = require('extend'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); -const {replaceProjectIdToken} = require('@google-cloud/projectify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class) { - if (Class.name === 'VM') { - promisified = true; - } - }, -}); - -let replaceProjectIdTokenOverride; -function fakeReplaceProjectIdToken() { - return (replaceProjectIdTokenOverride || replaceProjectIdToken).apply( - null, - arguments - ); -} - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -describe('VM', () => { - let VM; - let vm; - - let Disk; - let DISK; - - const COMPUTE = { - authClient: { - projectId: 'project-id', - getProjectId: callback => { - callback(null, 'project-id'); - }, - }, - projectId: 'project-id', - apiEndpoint: 'compute.googleapis.com', - }; - const ZONE = { - compute: COMPUTE, - name: 'us-central1-a', - createDisk: util.noop, - createVM: util.noop, - }; - const VM_NAME = 'vm-name'; - const FULLY_QUALIFIED_NAME = [ - 'project/project-id/zones/zone-name/instances/', - VM_NAME, - ].join(''); - - before(() => { - Disk = require('../src/disk.js'); - VM = proxyquire('../src/vm.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/promisify': fakePromisify, - '@google-cloud/projectify': { - replaceProjectIdToken: fakeReplaceProjectIdToken, - }, - }); - }); - - beforeEach(() => { - replaceProjectIdTokenOverride = null; - vm = new VM(ZONE, VM_NAME); - DISK = new Disk(ZONE, 'disk-name'); - }); - - describe('instantiation', () => { - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should localize the zone', () => { - assert.strictEqual(vm.zone, ZONE); - }); - - it('should localize the name', () => { - assert.strictEqual(vm.name, VM_NAME); - }); - - it('should strip a qualified name to just the instance name', () => { - const vm = new VM(ZONE, FULLY_QUALIFIED_NAME); - assert.strictEqual(vm.name, VM_NAME); - }); - - it('should initialize hasActiveWaiters to false', () => { - assert.strictEqual(vm.hasActiveWaiters, false); - }); - - it('should initialize an empty waiter array', () => { - assert.deepStrictEqual(vm.waiters, []); - }); - - it('should localize the URL of the VM', () => { - assert.strictEqual( - vm.url, - [ - 'https://www.googleapis.com/compute/v1/projects', - COMPUTE.projectId, - 'zones', - ZONE.name, - 'instances', - VM_NAME, - ].join('/') - ); - }); - - it('should inherit from ServiceObject', done => { - const zoneInstance = Object.assign({}, ZONE, { - createVM: { - bind: function (context) { - assert.strictEqual(context, zoneInstance); - done(); - }, - }, - }); - - const vm = new VM(zoneInstance, VM_NAME); - assert(vm instanceof ServiceObject); - - const calledWith = vm.calledWith_[0]; - - assert.strictEqual(calledWith.parent, zoneInstance); - assert.strictEqual(calledWith.baseUrl, '/instances'); - assert.strictEqual(calledWith.id, VM_NAME); - assert.deepStrictEqual(calledWith.methods, { - create: true, - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('attachDisk', () => { - let EXPECTED_BODY; - - beforeEach(() => { - EXPECTED_BODY = { - deviceName: DISK.name, - source: DISK.formattedName, - }; - }); - - it('should throw if a Disk object is not provided', () => { - assert.throws(() => { - vm.attachDisk('disk-3', {}, assert.ifError); - }, /A Disk object must be provided/); - - assert.doesNotThrow(() => { - vm.request = util.noop; - vm.attachDisk(DISK, {}, assert.ifError); - }); - }); - - it('should not require an options object', done => { - vm.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, EXPECTED_BODY); - done(); - }; - - vm.attachDisk(DISK, assert.ifError); - }); - - describe('options.readOnly', () => { - const CONFIG = {readOnly: true}; - - it('should set the correct mode', done => { - const expectedBody = Object.assign({}, EXPECTED_BODY, { - mode: 'READ_ONLY', - }); - - vm.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, expectedBody); - done(); - }; - - vm.attachDisk(DISK, CONFIG, assert.ifError); - }); - - it('should delete the readOnly property', done => { - vm.request = function (reqOpts) { - assert.strictEqual(typeof reqOpts.json.readOnly, 'undefined'); - done(); - }; - - vm.attachDisk(DISK, CONFIG, assert.ifError); - }); - }); - - it('should make the correct API request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/attachDisk'); - assert.deepStrictEqual(reqOpts.json, EXPECTED_BODY); - - callback(); - }; - - vm.attachDisk(DISK, {}, done); - }); - }); - - describe('delete', () => { - it('should make the correct API request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'DELETE'); - assert.strictEqual(reqOpts.uri, ''); - - callback(); - }; - - vm.delete(done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(() => { - callback(); - done(); - }); - }; - - vm.delete(); - }); - }); - - describe('detachDisk', () => { - let DEVICE_NAME; - let METADATA; - - beforeEach(() => { - DEVICE_NAME = DISK.formattedName; - - METADATA = { - disks: [ - { - source: DEVICE_NAME, - deviceName: DEVICE_NAME, - }, - ], - }; - - vm.getMetadata = function (callback) { - callback(null, METADATA, METADATA); - }; - }); - - it('should throw if a Disk is not provided', () => { - assert.throws(() => { - vm.detachDisk('disk-name'); - }, /A Disk object must be provided/); - - assert.doesNotThrow(() => { - vm.getMetadata = util.noop; - vm.detachDisk(DISK); - }); - }); - - it('should replace projectId token in disk name', done => { - const REPLACED_DEVICE_NAME = 'replaced-device-name'; - - replaceProjectIdTokenOverride = function (value, projectId) { - assert.strictEqual(value, DISK.formattedName); - assert.strictEqual(projectId, COMPUTE.authClient.projectId); - return REPLACED_DEVICE_NAME; - }; - - vm.getMetadata = function (callback) { - const metadata = { - disks: [ - { - source: REPLACED_DEVICE_NAME, - deviceName: REPLACED_DEVICE_NAME, - }, - ], - }; - - callback(null, metadata, metadata); - }; - - vm.request = function (reqOpts) { - assert.strictEqual(reqOpts.qs.deviceName, REPLACED_DEVICE_NAME); - done(); - }; - - vm.detachDisk(DISK, assert.ifError); - }); - - it('should return an error if device name not found', done => { - const metadata = { - disks: [ - { - source: 'a', - deviceName: 'b', - }, - ], - }; - - vm.getMetadata = function (callback) { - callback(null, metadata, metadata); - }; - - vm.detachDisk(DISK, err => { - assert.strictEqual(err.name, 'DetachDiskError'); - - const errorMessage = 'Device name for this disk was not found.'; - assert.strictEqual(err.message, errorMessage); - - done(); - }); - }); - - it('should make the correct API request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/detachDisk'); - assert.deepStrictEqual(reqOpts.qs, {deviceName: DEVICE_NAME}); - - callback(); - }; - - vm.detachDisk(DISK, done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(() => { - callback(); - done(); - }); - }; - - vm.detachDisk(DISK); - }); - - describe('refreshing metadata', () => { - describe('error', () => { - const ERROR = new Error('Error.'); - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(ERROR); - }; - }); - - it('should return DetachDisk error', done => { - vm.detachDisk(DISK, err => { - assert.strictEqual(err.name, 'DetachDiskError'); - assert.strictEqual(err.message, ERROR.message); - done(); - }); - }); - }); - }); - }); - - describe('getLabels', () => { - it('should get metadata', done => { - vm.getMetadata = function () { - done(); - }; - - vm.getTags(assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(error, null, apiResponse); - }; - }); - - it('should execute callback with error', done => { - vm.getLabels((err, labels, fingerprint, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(labels, null); - assert.strictEqual(fingerprint, null); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const metadata = { - labels: {}, - labelFingerprint: 'fingerprint', - }; - - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(null, metadata, apiResponse); - }; - }); - - it('should execute callback with tags and fingerprint', done => { - vm.getLabels((err, labels, fingerprint, apiResponse_) => { - assert.ifError(err); - - assert.strictEqual(labels, metadata.labels); - assert.strictEqual(fingerprint, metadata.labelFingerprint); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getSerialPortOutput', () => { - const EXPECTED_QUERY = {port: 1, start: 0}; - - it('should default to port 1', done => { - FakeServiceObject.prototype.request = function (reqOpts) { - assert.strictEqual(reqOpts.qs.port, 1); - done(); - }; - - vm.getSerialPortOutput(assert.ifError); - }); - - it('should override the default port', done => { - const port = 8001; - - FakeServiceObject.prototype.request = function (reqOpts) { - assert.strictEqual(reqOpts.qs.port, port); - done(); - }; - - vm.getSerialPortOutput(port, assert.ifError); - }); - - it('should override the start', done => { - const start = 10; - - FakeServiceObject.prototype.request = function (reqOpts) { - assert.strictEqual(reqOpts.qs.start, start); - done(); - }; - - vm.getSerialPortOutput({start}, assert.ifError); - }); - - it('should make the correct API request', done => { - FakeServiceObject.prototype.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/serialPort'); - assert.deepStrictEqual(reqOpts.qs, EXPECTED_QUERY); - - done(); - }; - - vm.getSerialPortOutput(assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - vm.getSerialPortOutput((err, output, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(output, null); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {contents: 'contents'}; - - beforeEach(() => { - FakeServiceObject.prototype.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec callback with contents & API response', done => { - vm.getSerialPortOutput((err, output, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(output, apiResponse.contents); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getTags', () => { - it('should get metadata', done => { - vm.getMetadata = function () { - done(); - }; - - vm.getTags(assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(error, null, apiResponse); - }; - }); - - it('should execute callback with error', done => { - vm.getTags((err, tags, fingerprint, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(tags, null); - assert.strictEqual(fingerprint, null); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - - describe('success', () => { - const metadata = { - tags: { - items: [], - fingerprint: 'fingerprint', - }, - }; - - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(null, metadata, apiResponse); - }; - }); - - it('should execute callback with tags and fingerprint', done => { - vm.getTags((err, tags, fingerprint, apiResponse_) => { - assert.ifError(err); - - assert.strictEqual(tags, metadata.tags.items); - assert.strictEqual(fingerprint, metadata.tags.fingerprint); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - }); - - describe('reset', () => { - it('should make the correct API request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/reset'); - - callback(); - }; - - vm.reset(done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(() => { - callback(); - done(); - }); - }; - - vm.reset(); - }); - }); - - describe('resize', () => { - const MACHINE_TYPE = 'zones/' + ZONE.name + '/machineTypes/machineType'; - - beforeEach(() => { - vm.request = util.noop; - - vm.zone.parent = { - execAfterOperation_: util.noop, - }; - }); - - it('should try to set the machine type', done => { - vm.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/setMachineType'); - assert.deepStrictEqual(reqOpts.json, { - machineType: MACHINE_TYPE, - }); - done(); - }; - - vm.resize(MACHINE_TYPE, assert.ifError); - }); - - it('should allow a partial machine type', done => { - const partialMachineType = MACHINE_TYPE.split('/').pop(); - - vm.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/setMachineType'); - assert.deepStrictEqual(reqOpts.json, { - machineType: MACHINE_TYPE, - }); - done(); - }; - - vm.resize(partialMachineType, assert.ifError); - }); - - describe('error', () => { - describe('instance is running', () => { - const error = new Error('Instance is starting or running.'); - - beforeEach(() => { - vm.zone.parent.execAfterOperation_ = function (callback) { - vm.zone.parent.execAfterOperation_ = util.noop; - callback(error); - }; - }); - - it('should stop the VM', done => { - vm.stop = function () { - done(); - }; - - vm.resize(MACHINE_TYPE, assert.ifError); - }); - - describe('stopping failed', () => { - const vmStopError = new Error('Error.'); - const apiResponse = {}; - - beforeEach(() => { - // First: vm.request() - vm.zone.parent.execAfterOperation_ = function (callback) { - // Second: vm.stop() - vm.zone.parent.execAfterOperation_ = function (callback) { - return function onVmStop() { - callback(vmStopError, apiResponse); - }; - }; - - callback(error); - }; - - vm.stop = function (onVmStop) { - onVmStop(); - }; - }); - - it('should return the error and API response', done => { - vm.resize(MACHINE_TYPE, (err, apiResponse_) => { - assert.strictEqual(err, vmStopError); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('stopping succeeded', () => { - beforeEach(() => { - // First: vm.request() - vm.zone.parent.execAfterOperation_ = function (callback) { - // Second: vm.stop() - vm.zone.parent.execAfterOperation_ = function (callback) { - return function onVmStop() { - callback(); - }; - }; - - callback(error); - }; - - vm.stop = function (onVmStop) { - // `setImmediate` to allow the `resize` reassignment to register. - setImmediate(onVmStop); - }; - }); - - it('should try to resize the VM again', done => { - vm.resize(MACHINE_TYPE, assert.ifError); - - vm.resize = function () { - done(); - }; - }); - }); - }); - - describe('instance is stopped', () => { - const error = new Error('Error'); - const apiResponse = {}; - - beforeEach(() => { - vm.zone.parent.execAfterOperation_ = function (callback) { - vm.zone.parent.execAfterOperation_ = util.noop; - - callback(error, apiResponse); - }; - }); - - it('should return the error & API response', done => { - vm.resize(MACHINE_TYPE, (err, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - }); - - describe('success', () => { - it('should start the VM by default', done => { - function userCallback() {} - function onVmStart() {} - - vm.zone.parent.execAfterOperation_ = function (callback) { - vm.zone.parent.execAfterOperation_ = function (callback) { - assert.strictEqual(callback, userCallback); - return onVmStart; - }; - - callback(); - }; - - vm.start = function (callback) { - assert.strictEqual(callback, onVmStart); - done(); - }; - - vm.resize(MACHINE_TYPE, userCallback); - }); - }); - - it('should not start the VM by request', done => { - const apiResponse = {}; - - vm.zone.parent.execAfterOperation_ = function (callback) { - callback(null, apiResponse); - }; - - vm.start = function () { - done(); // Test will fail if called. - }; - - vm.resize(MACHINE_TYPE, {start: false}, (err, apiResponse_) => { - assert.ifError(err); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('setLabels', () => { - const LABELS = []; - const FINGERPRINT = ''; - - it('should make the correct request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/setLabels'); - assert.strictEqual(reqOpts.json.labels, LABELS); - assert.strictEqual(reqOpts.json.labelFingerprint, FINGERPRINT); - - callback(); // done() - }; - - vm.setLabels(LABELS, FINGERPRINT, done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(callback); - done(); - }; - - vm.setLabels(LABELS, FINGERPRINT); - }); - }); - - describe('setMetadata', () => { - const METADATA = { - newKey: 'newValue', - }; - - describe('getting the current fingerprint', () => { - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {}; - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(error, null, apiResponse); - }; - }); - - it('should exec the callback with error & API resp', done => { - vm.setMetadata(METADATA, (err, operation, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - - describe('success', () => { - const metadata = { - metadata: { - fingerprint: '===', - }, - }; - - const apiResponse = {}; - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(null, metadata, apiResponse); - }; - }); - - it('should make the correct request', done => { - const expectedNewMetadata = extend(true, {}, metadata.metadata, { - items: [ - { - key: 'newKey', - value: 'newValue', - }, - ], - }); - - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/setMetadata'); - assert.deepStrictEqual(reqOpts.json, expectedNewMetadata); - - callback(); // done() - }; - - vm.setMetadata(METADATA, done); - }); - }); - }); - }); - }); - - describe('setTags', () => { - const TAGS = []; - const FINGERPRINT = ''; - - it('should make the correct request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/setTags'); - assert.strictEqual(reqOpts.json.items, TAGS); - assert.strictEqual(reqOpts.json.fingerprint, FINGERPRINT); - - callback(); // done() - }; - - vm.setTags(TAGS, FINGERPRINT, done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(callback); - done(); - }; - - vm.setTags(TAGS, FINGERPRINT); - }); - }); - - describe('start', () => { - it('should make the correct API request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/start'); - - callback(); - }; - - vm.start(done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(() => { - callback(); - done(); - }); - }; - - vm.start(); - }); - }); - - describe('startWithEncryptionKey', () => { - const DISKS = []; - - it('should make the correct API request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/startWithEncryptionKey'); - assert.strictEqual(reqOpts.json.disks, DISKS); - - callback(); - }; - - vm.startWithEncryptionKey(DISKS, done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(() => { - callback(); - done(); - }); - }; - - vm.start(); - }); - }); - - describe('stop', () => { - it('should make the correct API request', done => { - vm.request = function (reqOpts, callback) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/stop'); - - callback(); - }; - - vm.stop(done); - }); - - it('should not require a callback', done => { - vm.request = function (reqOpts, callback) { - assert.doesNotThrow(() => { - callback(); - done(); - }); - }; - - vm.stop(); - }); - }); - - describe('update', () => { - const CURRENT_METADATA = {currentProperty: true}; - const METADATA = {newProperty: true}; - - beforeEach(() => { - vm.getMetadata = callback => { - callback(null, CURRENT_METADATA); - }; - vm.request = () => {}; - }); - - it('should pull the latest metadata', done => { - vm.getMetadata = () => { - done(); - }; - - vm.update(METADATA, assert.ifError); - }); - - it('should return an error if the metadata call failed', done => { - const error = new Error('Error.'); - - vm.getMetadata = callback => { - callback(error); - }; - - vm.update(METADATA, err => { - assert.strictEqual(err, error); - done(); - }); - }); - - it('should send the correct request', done => { - vm.request = reqOpts => { - assert.deepStrictEqual(reqOpts, { - method: 'PUT', - uri: '', - json: extend(true, CURRENT_METADATA, METADATA), - }); - done(); - }; - - vm.update(METADATA, assert.ifError); - }); - - it('should deep merge the current metadata with new metadata', done => { - const currentMetadata = { - a: { - b: { - c: true, - d: true, - }, - }, - }; - const newMetadata = { - a: { - b: { - c: false, - }, - }, - }; - const expectedMetadata = { - a: { - b: { - c: false, - d: true, - }, - }, - }; - - vm.getMetadata = callback => { - callback(null, currentMetadata); - }; - - vm.request = reqOpts => { - assert.deepStrictEqual(reqOpts.json, expectedMetadata); - done(); - }; - - vm.update(newMetadata, assert.ifError); - }); - - it('should not require a callback', () => { - assert.doesNotThrow(() => { - vm.update(METADATA); - }); - }); - }); - - describe('waitFor', () => { - const VALID_STATUSES = [ - 'PROVISIONING', - 'STAGING', - 'RUNNING', - 'STOPPING', - 'SUSPENDING', - 'SUSPENDED', - 'TERMINATED', - ]; - - beforeEach(() => { - vm.startPolling_ = util.noop; - }); - - it('should throw if an invalid status is passed', () => { - assert.throws(() => { - vm.waitFor('It', assert.ifError); - }, new RegExp('Status passed to waitFor is invalid.')); - }); - - it('should accept valid statuses', () => { - assert.doesNotThrow(() => { - VALID_STATUSES.forEach(status => { - vm.waitFor(status, assert.ifError); - }); - }); - }); - - it('should accept lowercase status', () => { - assert.doesNotThrow(() => { - vm.waitFor('ProVisioning', assert.ifError); - assert.strictEqual(vm.waiters.pop().status, 'PROVISIONING'); - }); - }); - - it('should not allow an out of bounds timeout', () => { - vm.waitFor(VALID_STATUSES[0], {timeout: -1}, assert.ifError); - assert.strictEqual(vm.waiters.pop().timeout, 0); - - vm.waitFor(VALID_STATUSES[0], {timeout: 601}, assert.ifError); - assert.strictEqual(vm.waiters.pop().timeout, 600); - }); - - it('should create a waiter', done => { - const now = new Date() / 1000; - vm.waitFor(VALID_STATUSES[0], done); - - const createdWaiter = vm.waiters.pop(); - - assert.strictEqual(createdWaiter.status, VALID_STATUSES[0]); - assert.strictEqual(createdWaiter.timeout, 300); - - assert(createdWaiter.startTime > now - 1000); - assert(createdWaiter.startTime < now + 1000); - - createdWaiter.callback(); // done() - }); - - it('should flip hasActiveWaiters to true', () => { - assert.strictEqual(vm.hasActiveWaiters, false); - vm.waitFor(VALID_STATUSES[0], assert.ifError); - assert.strictEqual(vm.hasActiveWaiters, true); - }); - - it('should start polling', done => { - vm.startPolling_ = done; - - vm.waitFor(VALID_STATUSES[0], assert.ifError); - }); - - it('should not start polling if already polling', done => { - vm.hasActiveWaiters = true; - - vm.startPolling_ = function () { - done(new Error('Should not have called startPolling_.')); - }; - - vm.waitFor(VALID_STATUSES[0], assert.ifError); - done(); - }); - }); - - describe('startPolling_', () => { - const METADATA = {}; - - beforeEach(() => { - vm.hasActiveWaiters = true; - - vm.getMetadata = function (callback) { - callback(null, METADATA); - }; - }); - - it('should only poll if there are active waiters', done => { - vm.hasActiveWaiters = false; - - vm.getMetadata = function () { - done(new Error('Should not have refreshed metadata.')); - }; - - vm.startPolling_(); - done(); - }); - - it('should refresh metadata', done => { - vm.getMetadata = function () { - done(); - }; - - vm.startPolling_(); - }); - - describe('metadata refresh error', () => { - const ERROR = new Error('Error.'); - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(ERROR); - }; - - vm.waiters.push({ - callback: util.noop, - }); - }); - - it('should execute waiter with error', done => { - vm.waiters[0].callback = function (err) { - assert.strictEqual(err, ERROR); - done(); - }; - - vm.startPolling_(); - }); - - it('should remove waiter', () => { - assert.strictEqual(vm.waiters.length, 1); - vm.startPolling_(); - assert.strictEqual(vm.waiters.length, 0); - }); - - it('should flip hasActiveWaiters to false', () => { - assert.strictEqual(vm.hasActiveWaiters, true); - vm.startPolling_(); - assert.strictEqual(vm.hasActiveWaiters, false); - }); - }); - - describe('desired status reached', () => { - const STATUS = 'status'; - const METADATA = { - status: STATUS, - }; - - beforeEach(() => { - vm.getMetadata = function (callback) { - callback(null, METADATA); - }; - - vm.waiters.push({ - status: STATUS, - callback: util.noop, - }); - }); - - it('should execute callback with metadata', done => { - vm.waiters[0].callback = function (err, metadata) { - assert.ifError(err); - assert.strictEqual(metadata, METADATA); - done(); - }; - - vm.startPolling_(); - }); - - it('should remove waiter', () => { - assert.strictEqual(vm.waiters.length, 1); - vm.startPolling_(); - assert.strictEqual(vm.waiters.length, 0); - }); - - it('should flip hasActiveWaiters to false', () => { - assert.strictEqual(vm.hasActiveWaiters, true); - vm.startPolling_(); - assert.strictEqual(vm.hasActiveWaiters, false); - }); - }); - - describe('timeout exceeded', () => { - const STATUS = 'status'; - - beforeEach(() => { - vm.waiters.push({ - status: STATUS, - startTime: Date.now() / 1000 - 20, - timeout: 10, - callback: util.noop, - }); - }); - - it('should execute callback with WaitForTimeoutError', done => { - vm.waiters[0].callback = function (err) { - assert.strictEqual(err.name, 'WaitForTimeoutError'); - assert.strictEqual( - err.message, - [ - 'waitFor timed out waiting for VM ' + vm.name, - 'to be in status: ' + STATUS, - ].join(' ') - ); - - done(); - }; - - vm.startPolling_(); - }); - - it('should remove waiter', () => { - assert.strictEqual(vm.waiters.length, 1); - vm.startPolling_(); - assert.strictEqual(vm.waiters.length, 0); - }); - - it('should flip hasActiveWaiters to false', () => { - assert.strictEqual(vm.hasActiveWaiters, true); - vm.startPolling_(); - assert.strictEqual(vm.hasActiveWaiters, false); - }); - }); - - describe('desired status not reached yet', () => { - const STATUS = 'status'; - const setTimeout = global.setTimeout; - - beforeEach(() => { - vm.waiters.push({ - status: STATUS, - startTime: Date.now() / 1000, - timeout: 500, - }); - }); - - after(() => { - global.setTimeout = setTimeout; - }); - - it('should check for the status again after interval', done => { - global.setTimeout = function (fn, interval) { - assert.strictEqual(interval, 2000); - - vm.getMetadata = function () { - // Confirms startPolling_() was called again. - done(); - }; - - fn(); // startPolling_() - }; - - assert.strictEqual(vm.waiters.length, 1); - vm.startPolling_(); - assert.strictEqual(vm.waiters.length, 1); - }); - }); - }); - - describe('request', () => { - it('should make the correct request to Compute', done => { - const reqOpts = {}; - - FakeServiceObject.prototype.request = function (reqOpts_) { - assert.strictEqual(this, vm); - assert.strictEqual(reqOpts_, reqOpts); - - done(); - }; - - vm.request(reqOpts, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - FakeServiceObject.prototype.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - vm.request({}, (err, operation, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(operation, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - FakeServiceObject.prototype.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should execute callback with Zone object & API resp', done => { - const operation = {}; - - vm.zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - vm.request({}, (err, operation_, resp) => { - assert.ifError(err); - assert.strictEqual(operation_, operation); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); -}); diff --git a/test/zone.js b/test/zone.js deleted file mode 100644 index 728c6b7b..00000000 --- a/test/zone.js +++ /dev/null @@ -1,1951 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.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 arrify = require('arrify'); -const assert = require('assert'); -const {GCEImages} = require('gce-images'); -const proxyquire = require('proxyquire'); -const {ServiceObject, util} = require('@google-cloud/common'); -const promisify = require('@google-cloud/promisify'); - -let promisified = false; -const fakePromisify = Object.assign({}, promisify, { - promisifyAll: function (Class, options) { - if (Class.name !== 'Zone') { - return; - } - - promisified = true; - assert.deepStrictEqual(options.exclude, [ - 'autoscaler', - 'disk', - 'instanceGroup', - 'instanceGroupManager', - 'machineType', - 'operation', - 'vm', - ]); - }, -}); - -function FakeAutoscaler() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeDisk() { - this.calledWith_ = [].slice.call(arguments); -} - -let formatPortsOverride; -FakeInstanceGroup.formatPorts_ = function () { - return (formatPortsOverride || util.noop).apply(null, arguments); -}; - -function FakeInstanceGroup() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeInstanceGroupManager() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeMachineType() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeOperation() { - this.calledWith_ = [].slice.call(arguments); -} - -function FakeVM() { - this.calledWith_ = [].slice.call(arguments); -} - -class FakeServiceObject extends ServiceObject { - constructor(config) { - super(config); - this.calledWith_ = arguments; - } -} - -let extended = false; -const fakePaginator = { - paginator: { - extend: function (Class, methods) { - if (Class.name !== 'Zone') { - return; - } - - extended = true; - methods = arrify(methods); - assert.strictEqual(Class.name, 'Zone'); - assert.deepStrictEqual(methods, [ - 'getAutoscalers', - 'getDisks', - 'getInstanceGroups', - 'getInstanceGroupManagers', - 'getMachineTypes', - 'getOperations', - 'getVMs', - ]); - }, - streamify: function (methodName) { - return methodName; - }, - }, -}; - -describe('Zone', () => { - let Zone; - let zone; - - const COMPUTE = { - authClient: {}, - projectId: 'project-id', - }; - const ZONE_NAME = 'us-central1-a'; - - before(() => { - Zone = proxyquire('../src/zone.js', { - '@google-cloud/common': { - ServiceObject: FakeServiceObject, - }, - '@google-cloud/paginator': fakePaginator, - '@google-cloud/promisify': fakePromisify, - './autoscaler.js': FakeAutoscaler, - './disk.js': FakeDisk, - './instance-group.js': FakeInstanceGroup, - './instance-group-manager.js': FakeInstanceGroupManager, - './machine-type.js': FakeMachineType, - './operation.js': FakeOperation, - './vm.js': FakeVM, - }); - }); - - beforeEach(() => { - formatPortsOverride = null; - zone = new Zone(COMPUTE, ZONE_NAME); - }); - - describe('instantiation', () => { - it('should extend the correct methods', () => { - assert(extended); // See `fakePaginator.extend` - }); - - it('should promisify all the things', () => { - assert(promisified); - }); - - it('should streamify the correct methods', () => { - assert.strictEqual(zone.getAutoscalersStream, 'getAutoscalers'); - assert.strictEqual(zone.getDisksStream, 'getDisks'); - assert.strictEqual(zone.getInstanceGroupsStream, 'getInstanceGroups'); - assert.strictEqual(zone.getMachineTypesStream, 'getMachineTypes'); - assert.strictEqual(zone.getOperationsStream, 'getOperations'); - assert.strictEqual(zone.getVMsStream, 'getVMs'); - }); - - it('should localize the compute instance', () => { - assert.strictEqual(zone.compute, COMPUTE); - }); - - it('should localize the name', () => { - assert.strictEqual(zone.name, ZONE_NAME); - }); - - it('should create a gceImages instance', () => { - const newZone = new Zone(COMPUTE, ZONE_NAME); - assert(newZone.gceImages instanceof GCEImages); - assert.strictEqual(newZone.gceImages._auth, COMPUTE.authClient); - }); - - it('should inherit from ServiceObject', () => { - assert(zone instanceof ServiceObject); - - const calledWith = zone.calledWith_[0]; - - assert.strictEqual(calledWith.parent, COMPUTE); - assert.strictEqual(calledWith.baseUrl, '/zones'); - assert.strictEqual(calledWith.id, ZONE_NAME); - assert.deepStrictEqual(calledWith.methods, { - exists: true, - get: true, - getMetadata: true, - }); - }); - }); - - describe('autoscaler', () => { - const NAME = 'autoscaler-name'; - - it('should return an Autoscaler object', () => { - const autoscaler = zone.autoscaler(NAME); - assert(autoscaler instanceof FakeAutoscaler); - assert.strictEqual(autoscaler.calledWith_[0], zone); - assert.strictEqual(autoscaler.calledWith_[1], NAME); - }); - }); - - describe('createAutoscaler', () => { - const NAME = 'autoscaler-name'; - const TARGET = 'target'; - - beforeEach(() => { - zone.request = util.noop; - }); - - it('should throw if a target is not provided', () => { - assert.throws(() => { - zone.createAutoscaler(NAME, {}, assert.ifError); - }, /Cannot create an autoscaler without a target\./); - }); - - it('should make the correct request', done => { - const config = { - target: TARGET, - }; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.name, NAME); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - - it('should use a provided autoscalingPolicy', done => { - const config = { - autoscalingPolicy: { - a: 'b', - c: 'd', - }, - target: TARGET, - }; - - zone.request = function (reqOpts) { - const policy = reqOpts.json.autoscalingPolicy; - assert.deepStrictEqual(policy, config.autoscalingPolicy); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - - describe('config.target', () => { - it('should use a provided http target', done => { - const config = { - target: 'http://my-target', - }; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.target, config.target); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - - it('should use a provided https target', done => { - const config = { - target: 'https://my-target', - }; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.target, config.target); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - - it('should create a full target URL', done => { - const config = { - target: 'my-target', - }; - - zone.request = function (reqOpts) { - const expectedTarget = [ - 'https://content.googleapis.com/compute/v1/projects/', - COMPUTE.projectId, - '/zones/', - zone.name, - '/instanceGroupManagers/', - config.target, - ].join(''); - - assert.strictEqual(reqOpts.json.target, expectedTarget); - - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - }); - - describe('config.coolDown', () => { - it('should set coolDownPeriodSec', done => { - const config = { - coolDown: 80, - target: TARGET, - }; - - zone.request = function (reqOpts) { - const policy = reqOpts.json.autoscalingPolicy; - assert.strictEqual(policy.coolDownPeriodSec, config.coolDown); - assert.strictEqual(reqOpts.coolDown, undefined); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - }); - - describe('config.cpu', () => { - it('should set cpuUtilization', done => { - const config = { - cpu: 80, - target: TARGET, - }; - - zone.request = function (reqOpts) { - const policy = reqOpts.json.autoscalingPolicy; - const cpu = policy.cpuUtilization; - assert.strictEqual(cpu.utilizationTarget, config.cpu / 100); - assert.strictEqual(reqOpts.cpu, undefined); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - }); - - describe('config.loadBalance', () => { - it('should set loadBalancingUtilization', done => { - const config = { - loadBalance: 80, - target: TARGET, - }; - - zone.request = function (reqOpts) { - const policy = reqOpts.json.autoscalingPolicy; - const lb = policy.loadBalancingUtilization; - assert.strictEqual(lb.utilizationTarget, config.loadBalance / 100); - assert.strictEqual(reqOpts.loadBalance, undefined); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - }); - - describe('config.maxReplicas', () => { - it('should set maxNumReplicas', done => { - const config = { - maxReplicas: 10, - target: TARGET, - }; - - zone.request = function (reqOpts) { - const policy = reqOpts.json.autoscalingPolicy; - assert.strictEqual(policy.maxNumReplicas, config.maxReplicas); - assert.strictEqual(reqOpts.maxReplicas, undefined); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - }); - - describe('config.minReplicas', () => { - it('should set minNumReplicas', done => { - const config = { - minReplicas: 10, - target: TARGET, - }; - - zone.request = function (reqOpts) { - const policy = reqOpts.json.autoscalingPolicy; - assert.strictEqual(policy.minNumReplicas, config.minReplicas); - assert.strictEqual(reqOpts.minReplicas, undefined); - done(); - }; - - zone.createAutoscaler(NAME, config, assert.ifError); - }); - }); - - describe('API request', () => { - const CONFIG = { - a: 'b', - c: 'd', - target: 'http://target', - }; - - const expectedBody = { - name: NAME, - target: 'http://target', - autoscalingPolicy: {}, - a: 'b', - c: 'd', - }; - - it('should make the correct API request', done => { - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/autoscalers'); - assert.deepStrictEqual(reqOpts.json, expectedBody); - - done(); - }; - - zone.createAutoscaler(NAME, CONFIG, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.createAutoscaler(NAME, CONFIG, (err, as, op, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(as, null); - assert.strictEqual(op, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec callback with AutoS, Op & apiResponse', done => { - const autoscaler = {}; - const operation = {}; - - zone.autoscaler = function (name) { - assert.strictEqual(name, NAME); - return autoscaler; - }; - - zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - zone.createAutoscaler(NAME, CONFIG, (err, as, op, apiResp) => { - assert.ifError(err); - - assert.strictEqual(as, autoscaler); - - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResp); - - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - }); - }); - - describe('createDisk', () => { - const NAME = 'disk-name'; - - beforeEach(() => { - zone.request = util.noop; - }); - - it('should use the image property as qs.sourceImages', done => { - const config = { - image: 'abc', - }; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.qs.sourceImage, config.image); - done(); - }; - - zone.createDisk(NAME, config, assert.ifError); - }); - - describe('config.os', () => { - const CONFIG = { - os: 'os-name', - }; - - it('should get the latest image', done => { - zone.gceImages.getLatest = function (os) { - assert.strictEqual(os, CONFIG.os); - done(); - }; - - zone.createDisk(NAME, CONFIG, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - - beforeEach(() => { - zone.gceImages.getLatest = function (os, callback) { - callback(error); - }; - }); - - it('should execute callback with error', done => { - zone.createDisk(NAME, CONFIG, err => { - assert.strictEqual(err, error); - done(); - }); - }); - }); - - describe('success', () => { - const gceImagesResp = { - selfLink: 'http://selflink', - }; - - const expectedConfig = { - name: NAME, - sourceImage: gceImagesResp.selfLink, - }; - - it('should call createDisk with the correct config', done => { - zone.gceImages.getLatest = function (os, callback) { - zone.createDisk = function (name, config, callback) { - assert.strictEqual(name, NAME); - assert.deepStrictEqual(config, expectedConfig); - callback(); - }; - - callback(null, gceImagesResp); - }; - - zone.createDisk(NAME, CONFIG, done); - }); - }); - }); - - describe('API request', () => { - const CONFIG = { - a: 'b', - c: 'd', - }; - - const expectedBody = { - name: NAME, - a: 'b', - c: 'd', - }; - - it('should make the correct API request', done => { - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/disks'); - assert.deepStrictEqual(reqOpts.qs, {}); - assert.deepStrictEqual(reqOpts.json, expectedBody); - - done(); - }; - - zone.createDisk(NAME, CONFIG, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.createDisk(NAME, CONFIG, (err, disk, op, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(disk, null); - assert.strictEqual(op, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec callback with Disk, Op & apiResponse', done => { - const disk = {}; - const operation = {}; - - zone.disk = function (name) { - assert.strictEqual(name, NAME); - return disk; - }; - - zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - zone.createDisk(NAME, CONFIG, (err, disk_, op, apiResp) => { - assert.ifError(err); - - assert.strictEqual(disk_, disk); - - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResp); - - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - }); - }); - - describe('createInstanceGroup', () => { - const NAME = 'instance-group'; - - beforeEach(() => { - zone.request = util.noop; - }); - - describe('options.ports', () => { - const PORTS = { - http: 80, - https: 443, - }; - - it('should format named ports', done => { - const expectedNamedPorts = []; - - formatPortsOverride = function (ports) { - assert.strictEqual(ports, PORTS); - return expectedNamedPorts; - }; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.namedPorts, expectedNamedPorts); - assert.strictEqual(reqOpts.json.ports, undefined); - done(); - }; - - zone.createInstanceGroup(NAME, {ports: PORTS}, assert.ifError); - }); - }); - - describe('API request', () => { - const OPTIONS = { - a: 'b', - c: 'd', - }; - - const expectedBody = { - name: NAME, - a: 'b', - c: 'd', - }; - - it('should make the correct API request', done => { - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/instanceGroups'); - assert.deepStrictEqual(reqOpts.json, expectedBody); - - done(); - }; - - zone.createInstanceGroup(NAME, OPTIONS, assert.ifError); - }); - - it('should not require options', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json, {name: NAME}); - done(); - }; - - zone.createInstanceGroup(NAME, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.createInstanceGroup(NAME, OPTIONS, (err, ig, op, resp) => { - assert.strictEqual(err, error); - assert.strictEqual(ig, null); - assert.strictEqual(op, null); - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec callback with Group, Op & apiResponse', done => { - const instanceGroup = {}; - const operation = {}; - - zone.instanceGroup = function (name) { - assert.strictEqual(name, NAME); - return instanceGroup; - }; - - zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - zone.createInstanceGroup(NAME, OPTIONS, (err, ig, op, resp) => { - assert.ifError(err); - - assert.strictEqual(ig, instanceGroup); - - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, resp); - - assert.strictEqual(resp, apiResponse); - done(); - }); - }); - }); - }); - }); - - describe('createVM', () => { - const NAME = 'new-vm'; - - const CONFIG = {}; - - const EXPECTED_CONFIG = { - name: NAME, - machineType: 'zones/' + ZONE_NAME + '/machineTypes/n1-standard-1', - networkInterfaces: [ - { - network: 'global/networks/default', - }, - ], - }; - - describe('config.template', () => { - const CONFIG = { - template: '/path/to/template', - }; - - it('should define sourceInstanceTemplate', done => { - zone.request = function (reqOpts) { - assert.strictEqual( - reqOpts.qs.sourceInstanceTemplate, - CONFIG.template - ); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should not set default value for machineType', done => { - zone.request = function (reqOpts) { - assert.strictEqual(typeof reqOpts.json.machineType, 'undefined'); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should not set default value for network', done => { - zone.request = function (reqOpts) { - assert.strictEqual( - typeof reqOpts.json.networkInterfaces, - 'undefined' - ); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - }); - - describe('config.machineType', () => { - const CONFIG = { - machineType: 'f1-micro', - }; - - it('should format a given machine type', done => { - zone.request = function (reqOpts) { - assert.strictEqual( - reqOpts.json.machineType, - 'zones/' + ZONE_NAME + '/machineTypes/' + CONFIG.machineType - ); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - }); - - describe('config.tags', () => { - const CONFIG = { - tags: ['a', 'b'], - }; - - it('should accept an array of tags', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json.tags.items, CONFIG.tags); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - }); - - describe('config.http', () => { - const CONFIG = { - http: true, - }; - - beforeEach(() => { - zone.createHttpServerFirewall_ = function (callback) { - callback(); - }; - }); - - it('should execute cb with error from creating firewall', done => { - const error = new Error('Error.'); - - zone.createHttpServerFirewall_ = function (callback) { - callback(error); - }; - - zone.createVM(NAME, CONFIG, err => { - assert.strictEqual(err, error); - done(); - }); - }); - - it('should create a firewall rule', done => { - zone.createHttpServerFirewall_ = function () { - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should add a network interface accessConfig', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual( - reqOpts.json.networkInterfaces[0].accessConfigs[0], - { - type: 'ONE_TO_ONE_NAT', - } - ); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should add an http tag', done => { - zone.request = function (reqOpts) { - assert(reqOpts.json.tags.items.indexOf('http-server') > -1); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should not overwrite existing tags', done => { - const config = { - http: true, - tags: { - items: ['a', 'b'], - }, - }; - - const expectedTags = ['a', 'b', 'http-server']; - - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json.tags.items, expectedTags); - done(); - }; - - zone.createVM(NAME, config, assert.ifError); - }); - - it('should delete the https property', done => { - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.https, undefined); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - }); - - describe('config.https', () => { - const CONFIG = { - https: true, - }; - - beforeEach(() => { - zone.createHttpsServerFirewall_ = function (callback) { - callback(); - }; - }); - - it('should execute cb with error from creating firewall', done => { - const error = new Error('Error.'); - - zone.createHttpsServerFirewall_ = function (callback) { - callback(error); - }; - - zone.createVM(NAME, CONFIG, err => { - assert.strictEqual(err, error); - done(); - }); - }); - - it('should create a firewall rule', done => { - zone.createHttpsServerFirewall_ = function () { - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should add a network interface accessConfig', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual( - reqOpts.json.networkInterfaces[0].accessConfigs[0], - { - type: 'ONE_TO_ONE_NAT', - } - ); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should add an https tag', done => { - zone.request = function (reqOpts) { - assert(reqOpts.json.tags.items.indexOf('https-server') > -1); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - it('should not overwrite existing tags', done => { - const config = { - https: true, - tags: { - items: ['a', 'b'], - }, - }; - - const expectedTags = ['a', 'b', 'https-server']; - - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.json.tags.items, expectedTags); - done(); - }; - - zone.createVM(NAME, config, assert.ifError); - }); - - it('should delete the https property', done => { - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.json.https, undefined); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - }); - - describe('config.os', () => { - const CONFIG = { - os: 'os-name', - }; - - it('should get the latest image', done => { - zone.gceImages.getLatest = function (os) { - assert.strictEqual(os, CONFIG.os); - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - - beforeEach(() => { - zone.gceImages.getLatest = function (os, callback) { - callback(error); - }; - }); - - it('should execute callback with error', done => { - zone.createVM(NAME, CONFIG, err => { - assert.strictEqual(err, error); - done(); - }); - }); - }); - - describe('success', () => { - const gceImagesResp = { - selfLink: 'http://selflink', - }; - - const expectedConfig = Object.assign({}, EXPECTED_CONFIG, { - disks: [ - { - autoDelete: true, - boot: true, - initializeParams: { - sourceImage: gceImagesResp.selfLink, - }, - }, - ], - }); - - it('should call createVM with the correct config', done => { - zone.gceImages.getLatest = function (os, callback) { - zone.createVM = function (name, config, callback) { - assert.strictEqual(name, NAME); - assert.deepStrictEqual(config, expectedConfig); - callback(); - }; - - callback(null, gceImagesResp); - }; - - zone.createVM(NAME, CONFIG, done); - }); - }); - }); - - describe('API request', () => { - it('should make the correct API request', done => { - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.method, 'POST'); - assert.strictEqual(reqOpts.uri, '/instances'); - assert.deepStrictEqual(reqOpts.json, EXPECTED_CONFIG); - - done(); - }; - - zone.createVM(NAME, CONFIG, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.createVM(NAME, CONFIG, (err, vm, op, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(vm, null); - assert.strictEqual(op, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = {name: 'operation-name'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should exec callback with Disk, Op & apiResponse', done => { - const vm = {}; - const operation = {}; - - zone.vm = function (name) { - assert.strictEqual(name, NAME); - return vm; - }; - - zone.operation = function (name) { - assert.strictEqual(name, apiResponse.name); - return operation; - }; - - zone.createVM(NAME, CONFIG, (err, vm_, op, apiResp) => { - assert.ifError(err); - - assert.strictEqual(vm_, vm); - - assert.strictEqual(op, operation); - assert.strictEqual(op.metadata, apiResp); - - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - }); - }); - - describe('disk', () => { - const NAME = 'disk-name'; - - it('should return a Disk object', () => { - const disk = zone.disk(NAME); - assert(disk instanceof FakeDisk); - assert.strictEqual(disk.calledWith_[0], zone); - assert.strictEqual(disk.calledWith_[1], NAME); - }); - }); - - describe('getAutoscalers', () => { - it('should accept only a callback', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - zone.getAutoscalers(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/autoscalers'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - zone.getAutoscalers(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.getAutoscalers({}, (err, autoscalers, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(autoscalers, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'autoscaler-name'}], - }; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - zone.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - zone.getAutoscalers({}, (err, disks, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Autoscalers & API resp', done => { - const autoscaler = {}; - - zone.autoscaler = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return autoscaler; - }; - - zone.getAutoscalers({}, (err, autoscalers, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(autoscalers[0], autoscaler); - assert.strictEqual(autoscalers[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getDisks', () => { - it('should accept only a callback', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - zone.getDisks(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/disks'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - zone.getDisks(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.getDisks({}, (err, disks, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(disks, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'disk-name'}], - }; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - zone.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - zone.getDisks({}, (err, disks, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Disks & API resp', done => { - const disk = {}; - - zone.disk = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return disk; - }; - - zone.getDisks({}, (err, disks, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(disks[0], disk); - assert.strictEqual(disks[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getInstanceGroups', () => { - it('should accept only a callback', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - zone.getInstanceGroups(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/instanceGroups'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - zone.getInstanceGroups(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.getInstanceGroups({}, (err, groups, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(groups, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'operation-name'}], - }; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - zone.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - zone.getInstanceGroups({}, (err, groups, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Groups & API resp', done => { - const group = {}; - - zone.instanceGroup = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return group; - }; - - zone.getInstanceGroups({}, (err, groups, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(groups[0], group); - assert.strictEqual(groups[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getInstanceGroupManagers', () => { - it('should accept only a callback', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - zone.getInstanceGroupManagers(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/instanceGroupManagers'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - zone.getInstanceGroupManagers(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.getInstanceGroupManagers({}, (err, groups, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(groups, null); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'operation-name'}], - }; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - zone.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - zone.getInstanceGroupManagers({}, (err, groups, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Groups & API resp', done => { - const group = {}; - - zone.instanceGroupManager = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return group; - }; - - zone.getInstanceGroupManagers({}, (err, groups, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(groups[0], group); - assert.strictEqual(groups[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getMachineTypes', () => { - it('should make the correct call to Compute', done => { - const options = {a: 'b', c: 'd'}; - const expectedOptions = Object.assign({}, options, { - filter: 'zone eq .*' + zone.name, - }); - - zone.compute.getMachineTypes = function (options, callback) { - assert.deepStrictEqual(options, expectedOptions); - callback(); - }; - - zone.getMachineTypes(options, done); - }); - - it('should not require options', done => { - zone.compute.getMachineTypes = function (options, callback) { - callback(); - }; - - zone.getMachineTypes(done); - }); - - it('should not require any arguments', done => { - zone.compute.getMachineTypes = function (options, callback) { - assert.deepStrictEqual(options, { - filter: 'zone eq .*' + zone.name, - }); - assert.strictEqual(typeof callback, 'undefined'); - done(); - }; - - zone.getMachineTypes(); - }); - - it('should return the result of compute.getMachineTypes', () => { - const resultOfGetMachineTypes = {}; - - zone.compute.getMachineTypes = function () { - return resultOfGetMachineTypes; - }; - - assert.strictEqual(zone.getMachineTypes(), resultOfGetMachineTypes); - }); - }); - - describe('getOperations', () => { - it('should accept only a callback', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - zone.getOperations(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/operations'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - zone.getOperations(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.getOperations({}, (err, operations, nextQuery, apiResp) => { - assert.strictEqual(err, error); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResp, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'operation-name'}], - }; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - zone.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - zone.getOperations({}, (err, operations, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with Operations & API resp', done => { - const operation = {}; - - zone.operation = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return operation; - }; - - zone.getOperations({}, (err, operations, nextQuery, apiResp) => { - assert.ifError(err); - - assert.strictEqual(operations[0], operation); - assert.strictEqual(operations[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResp, apiResponse); - - done(); - }); - }); - }); - }); - - describe('getVMs', () => { - it('should accept only a callback', done => { - zone.request = function (reqOpts) { - assert.deepStrictEqual(reqOpts.qs, {}); - done(); - }; - - zone.getVMs(assert.ifError); - }); - - it('should make the correct API request', done => { - const query = {a: 'b', c: 'd'}; - - zone.request = function (reqOpts) { - assert.strictEqual(reqOpts.uri, '/instances'); - assert.strictEqual(reqOpts.qs, query); - - done(); - }; - - zone.getVMs(query, assert.ifError); - }); - - describe('error', () => { - const error = new Error('Error.'); - const apiResponse = {a: 'b', c: 'd'}; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(error, apiResponse); - }; - }); - - it('should execute callback with error & API response', done => { - zone.getVMs({}, (err, vms, nextQuery, apiResponse_) => { - assert.strictEqual(err, error); - assert.strictEqual(nextQuery, null); - assert.strictEqual(apiResponse_, apiResponse); - done(); - }); - }); - }); - - describe('success', () => { - const apiResponse = { - items: [{name: 'vm-name'}], - }; - - beforeEach(() => { - zone.request = function (reqOpts, callback) { - callback(null, apiResponse); - }; - }); - - it('should build a nextQuery if necessary', done => { - const nextPageToken = 'next-page-token'; - const apiResponseWithNextPageToken = Object.assign({}, apiResponse, { - nextPageToken: nextPageToken, - }); - const expectedNextQuery = { - pageToken: nextPageToken, - }; - - zone.request = function (reqOpts, callback) { - callback(null, apiResponseWithNextPageToken); - }; - - zone.getVMs({}, (err, vms, nextQuery) => { - assert.ifError(err); - - assert.deepStrictEqual(nextQuery, expectedNextQuery); - - done(); - }); - }); - - it('should execute callback with VMs & API response', done => { - const vm = {}; - - zone.vm = function (name) { - assert.strictEqual(name, apiResponse.items[0].name); - return vm; - }; - - zone.getVMs({}, (err, vms, nextQuery, apiResponse_) => { - assert.ifError(err); - - assert.strictEqual(vms[0], vm); - assert.strictEqual(vms[0].metadata, apiResponse.items[0]); - - assert.strictEqual(apiResponse_, apiResponse); - - done(); - }); - }); - }); - }); - - describe('instanceGroup', () => { - const NAME = 'instance-group'; - - it('should return an InstanceGroup object', () => { - const instanceGroup = zone.instanceGroup(NAME); - assert(instanceGroup instanceof FakeInstanceGroup); - assert.strictEqual(instanceGroup.calledWith_[0], zone); - assert.strictEqual(instanceGroup.calledWith_[1], NAME); - }); - }); - - describe('instanceGroupManager', () => { - const NAME = 'instance-group-manager'; - - it('should return an InstanceGroupManager object', () => { - const instanceGroupManager = zone.instanceGroupManager(NAME); - assert(instanceGroupManager instanceof FakeInstanceGroupManager); - assert.strictEqual(instanceGroupManager.calledWith_[0], zone); - assert.strictEqual(instanceGroupManager.calledWith_[1], NAME); - }); - }); - - describe('machineType', () => { - const NAME = 'machine-name'; - - it('should return a MachineType object', () => { - const machineType = zone.machineType(NAME); - - assert(machineType instanceof FakeMachineType); - assert.strictEqual(machineType.calledWith_[0], zone); - assert.strictEqual(machineType.calledWith_[1], NAME); - }); - }); - - describe('operation', () => { - const NAME = 'operation-name'; - - it('should return an Operation object', () => { - const operation = zone.operation(NAME); - assert(operation instanceof FakeOperation); - assert.strictEqual(operation.calledWith_[0], zone); - assert.strictEqual(operation.calledWith_[1], NAME); - }); - }); - - describe('vm', () => { - const NAME = 'vm-name'; - - it('should return a VM object', () => { - const vm = zone.vm(NAME); - assert(vm instanceof FakeVM); - assert.strictEqual(vm.calledWith_[0], zone); - assert.strictEqual(vm.calledWith_[1], NAME); - }); - }); - - describe('createHttpServerFirewall_', () => { - it('should create a firewall rule', done => { - zone.compute.createFirewall = function (name, config) { - assert.strictEqual(name, 'default-allow-http'); - assert.deepStrictEqual(config, { - protocols: { - tcp: [80], - }, - ranges: ['0.0.0.0/0'], - tags: ['http-server'], - }); - - done(); - }; - - zone.createHttpServerFirewall_(assert.ifError); - }); - - it('should execute callback with error & API response', done => { - const error = new Error('Error.'); - - zone.compute.createFirewall = function (name, config, callback) { - callback(error); - }; - - zone.createHttpServerFirewall_(err => { - assert.strictEqual(err, error); - done(); - }); - }); - - it('should not execute callback with error if 409', done => { - const error = new Error('Error.'); - error.code = 409; - - const apiResponse = {}; - - zone.compute.createFirewall = function (name, config, callback) { - callback(error, null, apiResponse); - }; - - zone.createHttpServerFirewall_(err => { - assert.strictEqual(err, null); - done(); - }); - }); - }); - - describe('createHttpsServerFirewall_', () => { - it('should create a firewall rule', done => { - zone.compute.createFirewall = function (name, config) { - assert.strictEqual(name, 'default-allow-https'); - assert.deepStrictEqual(config, { - protocols: { - tcp: [443], - }, - ranges: ['0.0.0.0/0'], - tags: ['https-server'], - }); - - done(); - }; - - zone.createHttpsServerFirewall_(assert.ifError); - }); - - it('should execute callback with error & API response', done => { - const error = new Error('Error.'); - - zone.compute.createFirewall = function (name, config, callback) { - callback(error); - }; - - zone.createHttpsServerFirewall_(err => { - assert.strictEqual(err, error); - done(); - }); - }); - - it('should not execute callback with error if 409', done => { - const error = new Error('Error.'); - error.code = 409; - - zone.compute.createFirewall = function (name, config, callback) { - callback(error); - }; - - zone.createHttpsServerFirewall_(err => { - assert.strictEqual(err, null); - done(); - }); - }); - }); -}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..c78f1c88 --- /dev/null +++ b/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/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..73447d85 --- /dev/null +++ b/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: 'AcceleratorTypes', + filename: './accelerator-types.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', +};